From cefedcb6955f1b01e1a3ea271da2df6328b402b7 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 22 Feb 2014 13:55:29 +0000 Subject: [PATCH 001/419] [NETAPI32] NetGetJoinInformation: Fix netapi32 wksta winetest crash. svn path=/trunk/; revision=62288 --- reactos/dll/win32/netapi32/wksta.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/dll/win32/netapi32/wksta.c b/reactos/dll/win32/netapi32/wksta.c index 3512d31c06c..4cef46cd02e 100644 --- a/reactos/dll/win32/netapi32/wksta.c +++ b/reactos/dll/win32/netapi32/wksta.c @@ -570,6 +570,9 @@ NET_API_STATUS NET_API_FUNCTION NetGetJoinInformation( { FIXME("Stub %s %p %p\n", wine_dbgstr_w(Server), Name, type); + if (Name == NULL || type == NULL) + return ERROR_INVALID_PARAMETER; + *Name = NULL; *type = NetSetupUnknownStatus; From 9347a16a57ef12c2685f345b67e53169f5b94aca Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 22 Feb 2014 13:58:33 +0000 Subject: [PATCH 002/419] [SYSSETUP] Add date/time to setuplog.txt. Patch by Lee Schroeder. Thanks a lot! CORE-7927 #resolve svn path=/trunk/; revision=62289 --- reactos/dll/win32/syssetup/logfile.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/reactos/dll/win32/syssetup/logfile.c b/reactos/dll/win32/syssetup/logfile.c index ea0db8e547d..5a941d03865 100644 --- a/reactos/dll/win32/syssetup/logfile.c +++ b/reactos/dll/win32/syssetup/logfile.c @@ -97,6 +97,8 @@ SYSSETUP_LogItem(IN const LPSTR lpFileName, DWORD dwMessageSize; DWORD dwWritten; CHAR Buffer[6]; + CHAR TimeBuffer[30]; + SYSTEMTIME stTime; /* Get the severity code string */ switch (dwSeverity) @@ -148,6 +150,28 @@ SYSSETUP_LogItem(IN const LPSTR lpFileName, NULL, FILE_END); + /* Write Time/Date */ + GetLocalTime(&stTime); + + snprintf(TimeBuffer, sizeof(TimeBuffer), + "%02d/%02d/%02d %02d:%02d:%02d.%03d", + stTime.wMonth, + stTime.wDay, + stTime.wYear, + stTime.wHour, + stTime.wMinute, + stTime.wSecond, + stTime.wMilliseconds); + + WriteFile(hLogFile, + TimeBuffer, + strlen(TimeBuffer), + &dwWritten, + NULL); + + /* Write comma */ + WriteFile(hLogFile, ",", 1, &dwWritten, NULL); + /* Write file name */ WriteFile(hLogFile, lpFileName, From 11e1167b0cad0fb4911f4e3b03da8b792862eb6c Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 23 Feb 2014 09:32:44 +0000 Subject: [PATCH 003/419] [MSGINA] Shutdown dialog: Display the current users name in the "log off" list entry. svn path=/trunk/; revision=62297 --- reactos/dll/win32/msgina/gui.c | 4 +++- reactos/dll/win32/msgina/lang/bg-BG.rc | 4 ++-- reactos/dll/win32/msgina/lang/cs-CZ.rc | 4 ++-- reactos/dll/win32/msgina/lang/de-DE.rc | 4 ++-- reactos/dll/win32/msgina/lang/en-US.rc | 5 ++--- reactos/dll/win32/msgina/lang/es-ES.rc | 4 ++-- reactos/dll/win32/msgina/lang/fr-FR.rc | 4 ++-- reactos/dll/win32/msgina/lang/he-IL.rc | 4 ++-- reactos/dll/win32/msgina/lang/id-ID.rc | 4 ++-- reactos/dll/win32/msgina/lang/it-IT.rc | 4 ++-- reactos/dll/win32/msgina/lang/ja-JP.rc | 4 ++-- reactos/dll/win32/msgina/lang/no-NO.rc | 4 ++-- reactos/dll/win32/msgina/lang/pl-PL.rc | 4 ++-- reactos/dll/win32/msgina/lang/ro-RO.rc | 4 ++-- reactos/dll/win32/msgina/lang/ru-RU.rc | 4 ++-- reactos/dll/win32/msgina/lang/sk-SK.rc | 4 ++-- reactos/dll/win32/msgina/lang/sq-AL.rc | 4 ++-- reactos/dll/win32/msgina/lang/tr-TR.rc | 4 ++-- reactos/dll/win32/msgina/lang/uk-UA.rc | 4 ++-- 19 files changed, 39 insertions(+), 38 deletions(-) diff --git a/reactos/dll/win32/msgina/gui.c b/reactos/dll/win32/msgina/gui.c index b14de46b5bc..4b509e6b8ba 100644 --- a/reactos/dll/win32/msgina/gui.c +++ b/reactos/dll/win32/msgina/gui.c @@ -641,6 +641,7 @@ ShutDownOnInit( IN PGINA_CONTEXT pgContext) { WCHAR szBuffer[256]; + WCHAR szBuffer2[256]; HWND hwndList; INT idx, count, i; @@ -651,7 +652,8 @@ ShutDownOnInit( /* Log off */ LoadStringW(hDllInstance, IDS_SHUTDOWN_LOGOFF, szBuffer, sizeof(szBuffer) / sizeof(WCHAR)); - idx = SendMessageW(hwndList, CB_ADDSTRING, 0, (LPARAM)szBuffer); + wsprintfW(szBuffer2, szBuffer, pgContext->UserName); + idx = SendMessageW(hwndList, CB_ADDSTRING, 0, (LPARAM)szBuffer2); if (idx != CB_ERR) SendMessageW(hwndList, CB_SETITEMDATA, idx, WLX_SAS_ACTION_LOGOFF); diff --git a/reactos/dll/win32/msgina/lang/bg-BG.rc b/reactos/dll/win32/msgina/lang/bg-BG.rc index e6933af4b1a..d06701b5941 100644 --- a/reactos/dll/win32/msgina/lang/bg-BG.rc +++ b/reactos/dll/win32/msgina/lang/bg-BG.rc @@ -150,14 +150,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/cs-CZ.rc b/reactos/dll/win32/msgina/lang/cs-CZ.rc index a84bfbe3f82..00ebf875e69 100644 --- a/reactos/dll/win32/msgina/lang/cs-CZ.rc +++ b/reactos/dll/win32/msgina/lang/cs-CZ.rc @@ -155,14 +155,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/de-DE.rc b/reactos/dll/win32/msgina/lang/de-DE.rc index a2e465925e9..79710d88509 100644 --- a/reactos/dll/win32/msgina/lang/de-DE.rc +++ b/reactos/dll/win32/msgina/lang/de-DE.rc @@ -150,14 +150,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/en-US.rc b/reactos/dll/win32/msgina/lang/en-US.rc index 5f424785f7b..e442a6a9e49 100644 --- a/reactos/dll/win32/msgina/lang/en-US.rc +++ b/reactos/dll/win32/msgina/lang/en-US.rc @@ -150,15 +150,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/es-ES.rc b/reactos/dll/win32/msgina/lang/es-ES.rc index badf1b51aef..fff68d7c5c8 100644 --- a/reactos/dll/win32/msgina/lang/es-ES.rc +++ b/reactos/dll/win32/msgina/lang/es-ES.rc @@ -152,14 +152,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/fr-FR.rc b/reactos/dll/win32/msgina/lang/fr-FR.rc index 5bf4e503e3d..ebe178564e3 100644 --- a/reactos/dll/win32/msgina/lang/fr-FR.rc +++ b/reactos/dll/win32/msgina/lang/fr-FR.rc @@ -150,14 +150,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/he-IL.rc b/reactos/dll/win32/msgina/lang/he-IL.rc index 0796163a213..0a364801c19 100644 --- a/reactos/dll/win32/msgina/lang/he-IL.rc +++ b/reactos/dll/win32/msgina/lang/he-IL.rc @@ -150,14 +150,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/id-ID.rc b/reactos/dll/win32/msgina/lang/id-ID.rc index c58f86367cd..a8c593ba557 100644 --- a/reactos/dll/win32/msgina/lang/id-ID.rc +++ b/reactos/dll/win32/msgina/lang/id-ID.rc @@ -149,14 +149,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/it-IT.rc b/reactos/dll/win32/msgina/lang/it-IT.rc index f4a7571652d..7ab86e7f6f9 100644 --- a/reactos/dll/win32/msgina/lang/it-IT.rc +++ b/reactos/dll/win32/msgina/lang/it-IT.rc @@ -158,14 +158,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/ja-JP.rc b/reactos/dll/win32/msgina/lang/ja-JP.rc index f69607e45e3..a1731d0296c 100644 --- a/reactos/dll/win32/msgina/lang/ja-JP.rc +++ b/reactos/dll/win32/msgina/lang/ja-JP.rc @@ -150,14 +150,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/no-NO.rc b/reactos/dll/win32/msgina/lang/no-NO.rc index 0be753a7239..41b0af8ee2d 100644 --- a/reactos/dll/win32/msgina/lang/no-NO.rc +++ b/reactos/dll/win32/msgina/lang/no-NO.rc @@ -150,14 +150,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/pl-PL.rc b/reactos/dll/win32/msgina/lang/pl-PL.rc index efe84fe1db6..aad32ffc51f 100644 --- a/reactos/dll/win32/msgina/lang/pl-PL.rc +++ b/reactos/dll/win32/msgina/lang/pl-PL.rc @@ -159,14 +159,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/ro-RO.rc b/reactos/dll/win32/msgina/lang/ro-RO.rc index 59db80699c1..f63e48c638a 100644 --- a/reactos/dll/win32/msgina/lang/ro-RO.rc +++ b/reactos/dll/win32/msgina/lang/ro-RO.rc @@ -152,14 +152,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/ru-RU.rc b/reactos/dll/win32/msgina/lang/ru-RU.rc index a884a19831b..0c69e47cfed 100644 --- a/reactos/dll/win32/msgina/lang/ru-RU.rc +++ b/reactos/dll/win32/msgina/lang/ru-RU.rc @@ -152,14 +152,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/sk-SK.rc b/reactos/dll/win32/msgina/lang/sk-SK.rc index 20d16321a68..ead0f3a5d43 100644 --- a/reactos/dll/win32/msgina/lang/sk-SK.rc +++ b/reactos/dll/win32/msgina/lang/sk-SK.rc @@ -155,14 +155,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/sq-AL.rc b/reactos/dll/win32/msgina/lang/sq-AL.rc index 00a631781ee..8c18c16d80f 100644 --- a/reactos/dll/win32/msgina/lang/sq-AL.rc +++ b/reactos/dll/win32/msgina/lang/sq-AL.rc @@ -150,14 +150,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/tr-TR.rc b/reactos/dll/win32/msgina/lang/tr-TR.rc index 2ba7bb56427..9eebba74ed5 100644 --- a/reactos/dll/win32/msgina/lang/tr-TR.rc +++ b/reactos/dll/win32/msgina/lang/tr-TR.rc @@ -152,14 +152,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." diff --git a/reactos/dll/win32/msgina/lang/uk-UA.rc b/reactos/dll/win32/msgina/lang/uk-UA.rc index 79b08953a0c..34be98fe154 100644 --- a/reactos/dll/win32/msgina/lang/uk-UA.rc +++ b/reactos/dll/win32/msgina/lang/uk-UA.rc @@ -158,14 +158,14 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN + IDS_SHUTDOWN_LOGOFF "Log off ""%s""" IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_LOGOFF "Log off" IDS_SHUTDOWN_RESTART "Restart" IDS_SHUTDOWN_SLEEP "Sleep" IDS_SHUTDOWN_HIBERNATE "Hibernate" /* Shut down descriptions */ - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." + IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." From c1e3e32d6dd4b547fb17b6a3e952071b78597937 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 23 Feb 2014 10:37:31 +0000 Subject: [PATCH 004/419] [CMAKE] * Use the appropriate CMake command to get the absolute path. I forgot to commit this change in the transition phase. CORE-7918 #resolve #comment Should be fixed in r62298. Thank you for testing the VS build. svn path=/trunk/; revision=62298 --- reactos/cmake/msvc.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/cmake/msvc.cmake b/reactos/cmake/msvc.cmake index ff82dfab108..99d10f7a18b 100644 --- a/reactos/cmake/msvc.cmake +++ b/reactos/cmake/msvc.cmake @@ -343,9 +343,9 @@ macro(add_asm_files _target) get_directory_property(_defines COMPILE_DEFINITIONS) foreach(_source_file ${ARGN}) get_filename_component(_source_file_base_name ${_source_file} NAME_WE) + get_filename_component(_source_file_full_path ${_source_file} ABSOLUTE) set(_preprocessed_asm_file ${CMAKE_CURRENT_BINARY_DIR}/asm/${_source_file_base_name}_${_target}.tmp) set(_object_file ${CMAKE_CURRENT_BINARY_DIR}/asm/${_source_file_base_name}_${_target}.obj) - set(_source_file_full_path ${CMAKE_CURRENT_SOURCE_DIR}/${_source_file}) get_source_file_property(_defines_semicolon_list ${_source_file_full_path} COMPILE_DEFINITIONS) unset(_source_file_defines) foreach(_define ${_defines_semicolon_list}) From 5d59eafa5737b1e486b30c1292cd12b8c90ec1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 23 Feb 2014 11:41:56 +0000 Subject: [PATCH 005/419] [MSGINA]: Addendum for r62065 . I don't like freeing this 'msg' object in many places (in the caller and in the thread). svn path=/trunk/; revision=62299 --- reactos/dll/win32/msgina/gui.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/dll/win32/msgina/gui.c b/reactos/dll/win32/msgina/gui.c index 4b509e6b8ba..e9ad0a99276 100644 --- a/reactos/dll/win32/msgina/gui.c +++ b/reactos/dll/win32/msgina/gui.c @@ -145,11 +145,21 @@ GUIDisplayStatusMessage( &ThreadId); if (Thread) { + /* 'msg' will be freed by 'StartupWindowThread' */ + CloseHandle(Thread); WaitForSingleObject(msg->StartupEvent, INFINITE); CloseHandle(msg->StartupEvent); return TRUE; } + else + { + /* + * The 'StartupWindowThread' thread couldn't be created, + * so we need to free the allocated 'msg'. + */ + HeapFree(GetProcessHeap(), 0, msg); + } return FALSE; } From 5f2e7f0391fa990583d308f0deae4a04c4341974 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 23 Feb 2014 12:25:36 +0000 Subject: [PATCH 006/419] [CMAKE] * Add a workaround for the recent MSVC toolchain (MSBUILD) /MP bug. svn path=/trunk/; revision=62300 --- reactos/cmake/msvc.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reactos/cmake/msvc.cmake b/reactos/cmake/msvc.cmake index 99d10f7a18b..7d213195eee 100644 --- a/reactos/cmake/msvc.cmake +++ b/reactos/cmake/msvc.cmake @@ -121,7 +121,14 @@ set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) if(PCH) macro(add_pch _target _pch _sources) - set(_gch ${CMAKE_CURRENT_BINARY_DIR}/${_target}.pch) + + # Workaround for the MSVC toolchain (MSBUILD) /MP bug + set(_temp_gch ${CMAKE_CURRENT_BINARY_DIR}/${_target}.pch) + if(MSVC_IDE) + file(TO_NATIVE_PATH ${_temp_gch} _gch) + else() + set(_gch ${_temp_gch}) + endif() if(IS_CPP) set(_pch_language CXX) From 9b4d645ad080f8d6071581a947fcd14422fa238d Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 25 Feb 2014 03:39:23 +0000 Subject: [PATCH 007/419] [Ext2fs] - Fixed the driver start up for Ext2 partitions and drives. Now the driver loads. - At one time this driver worked on the same hardware I have today, same drives nothing has changed. Now since all the changes else where, guessing it broke something. - Don't assign and bug reports to me, if so, I will remove them! svn path=/trunk/; revision=62326 --- reactos/boot/bootdata/hivesys.inf | 10 +++++++++- reactos/drivers/filesystems/ext2/src/ext2init.c | 2 +- reactos/drivers/filesystems/ext2/src/fsctrl.c | 8 ++++++++ reactos/drivers/filesystems/fs_rec/ext2.c | 2 +- reactos/drivers/filesystems/fs_rec/fs_rec.c | 6 +++--- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/reactos/boot/bootdata/hivesys.inf b/reactos/boot/bootdata/hivesys.inf index 010a2ba52d7..b704b6bd28c 100644 --- a/reactos/boot/bootdata/hivesys.inf +++ b/reactos/boot/bootdata/hivesys.inf @@ -1561,6 +1561,14 @@ HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","ImagePath",0x00020000,"system3 HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Start",0x00010001,0x00000000 HKLM,"SYSTEM\CurrentControlSet\Services\usbccgp","Type",0x00010001,0x00000001 +; MountMgr driver +;HKLM,"SYSTEM\CurrentControlSet\Services\MountMgr","ErrorControl",0x00010001,0x00000001 +;HKLM,"SYSTEM\CurrentControlSet\Services\MountMgr","Group",0x00000000,"Boot Bus Extender" +;HKLM,"SYSTEM\CurrentControlSet\Services\MountMgr","ImagePath",0x00020000,"system32\drivers\mountmgr.sys" +;HKLM,"SYSTEM\CurrentControlSet\Services\MountMgr","Start",0x00010001,0x00000000 +;HKLM,"SYSTEM\CurrentControlSet\Services\MountMgr","Tag",0x00010001,0x00000008 +;HKLM,"SYSTEM\CurrentControlSet\Services\MountMgr","Type",0x00010001,0x00000001 + ; ACPI driver HKLM,"SYSTEM\CurrentControlSet\Services\acpi","ErrorControl",0x00010001,0x00000001 HKLM,"SYSTEM\CurrentControlSet\Services\acpi","Group",0x00000000,"Boot Bus Extender" @@ -1859,7 +1867,7 @@ HKLM,"SYSTEM\CurrentControlSet\Services\RamDisk","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","ImagePath",0x00020000,"system32\drivers\ext2fs.sys" HKLM,"SYSTEM\CurrentControlSet\Services\Ext2fs","Start",0x00010001,0x00000003 HKLM,"SYSTEM\CurrentControlSet\Services\Ext2fs","Type",0x00010001,0x00000002 diff --git a/reactos/drivers/filesystems/ext2/src/ext2init.c b/reactos/drivers/filesystems/ext2/src/ext2init.c index 68e84f1bcc9..4ad2540ead4 100644 --- a/reactos/drivers/filesystems/ext2/src/ext2init.c +++ b/reactos/drivers/filesystems/ext2/src/ext2init.c @@ -20,7 +20,7 @@ #define EXT2_BUG_CHECK_ID EXT2_FILE_INIT #define DEBUG_LEVEL (DEBUG_TRACE_INIT) -#define EXT2_FS_NAME L"\\ext2" +#define EXT2_FS_NAME L"\\Ext2fs" // Must match others! // global variables are declared here Ext2Data Ext2GlobalData; diff --git a/reactos/drivers/filesystems/ext2/src/fsctrl.c b/reactos/drivers/filesystems/ext2/src/fsctrl.c index 26837451394..4af6001fe81 100644 --- a/reactos/drivers/filesystems/ext2/src/fsctrl.c +++ b/reactos/drivers/filesystems/ext2/src/fsctrl.c @@ -535,6 +535,7 @@ Ext2MountVolume ( else { DebugTrace(DEBUG_TRACE_MOUNT, "Failing mount. Partition not Ext2...", 0); + DbgPrint("Supper Blk Magic %x\n",SuperBlock->s_magic); } try_exit: NOTHING; @@ -782,7 +783,13 @@ BOOLEAN Ext2PerformVerifyDiskRead( if (Status == STATUS_INVALID_PARAMETER) { + DbgPrint("Ext2PerformVerifyDiskRead Invalid Param\n"); + return FALSE; + } + if (Status == STATUS_NO_MEDIA_IN_DEVICE) + { + DbgPrint("Ext2PerformVerifyDiskRead NO MEDIA in DEVICE!!! BS!!\n"); return FALSE; } @@ -792,6 +799,7 @@ BOOLEAN Ext2PerformVerifyDiskRead( if (!NT_SUCCESS(Status)) { + DbgPrint("Ext2PerformVerifyDiskRead Fail Status %x\n",Status); return FALSE; } diff --git a/reactos/drivers/filesystems/fs_rec/ext2.c b/reactos/drivers/filesystems/fs_rec/ext2.c index d940253247c..fa06eb0dfe3 100644 --- a/reactos/drivers/filesystems/fs_rec/ext2.c +++ b/reactos/drivers/filesystems/fs_rec/ext2.c @@ -93,7 +93,7 @@ FsRecExt2FsControl(IN PDEVICE_OBJECT DeviceObject, /* Load the file system */ Status = FsRecLoadFileSystem(DeviceObject, - L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Ext2"); + L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Ext2fs"); break; default: diff --git a/reactos/drivers/filesystems/fs_rec/fs_rec.c b/reactos/drivers/filesystems/fs_rec/fs_rec.c index 00b0a67b103..17293013dfc 100644 --- a/reactos/drivers/filesystems/fs_rec/fs_rec.c +++ b/reactos/drivers/filesystems/fs_rec/fs_rec.c @@ -373,14 +373,14 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, if (NT_SUCCESS(Status)) DeviceCount++; /* Register EXT2 */ - /*Status = FsRecRegisterFs(DriverObject, + Status = FsRecRegisterFs(DriverObject, NULL, NULL, - L"\\Ext2", + L"\\Ext2fs", L"\\FileSystem\\Ext2Recognizer", FS_TYPE_EXT2, FILE_DEVICE_DISK_FILE_SYSTEM); - if (NT_SUCCESS(Status)) DeviceCount++;*/ + if (NT_SUCCESS(Status)){ DeviceCount++; DPRINT1("2 Ext2FS!!!!!\n");} /* Return appropriate Status */ return (DeviceCount > 0) ? STATUS_SUCCESS : STATUS_IMAGE_ALREADY_LOADED; From 38758f72ac0b6a277a9c3f98826ae0b694d264ca Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 25 Feb 2014 05:29:00 +0000 Subject: [PATCH 008/419] [Win32ss] - MapWindowPoints return incorrect result for windows with WS_EX_LAYOUTRTL style. - Patch by Maxim Andreyanov. see CORE-7947. svn path=/trunk/; revision=62327 --- reactos/win32ss/user/ntuser/window.c | 11 +++++++++++ reactos/win32ss/user/ntuser/winpos.c | 2 -- reactos/win32ss/user/user32/windows/winpos.c | 2 -- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index 91feae4df56..e0e57643c5a 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -2313,6 +2313,17 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs, ParentWindow->rcClient.top); } */ + /* correct child window coordinates if mirroring on parent is enabled */ + if (ParentWindow != NULL) + { + if ( ((Cs->style & WS_CHILD) == WS_CHILD) && + ((ParentWindow->ExStyle & WS_EX_LAYOUTRTL) == WS_EX_LAYOUTRTL)) + { + Window->rcWindow.right = ParentWindow->rcClient.right - (Window->rcWindow.left - ParentWindow->rcClient.left); + Window->rcWindow.left = Window->rcWindow.right - Size.cx; + } + } + Window->rcClient = Window->rcWindow; /* Link the window */ diff --git a/reactos/win32ss/user/ntuser/winpos.c b/reactos/win32ss/user/ntuser/winpos.c index ab2c722b92c..da0f7e8f985 100644 --- a/reactos/win32ss/user/ntuser/winpos.c +++ b/reactos/win32ss/user/ntuser/winpos.c @@ -120,8 +120,6 @@ IntMapWindowPoints(PWND FromWnd, PWND ToWnd, LPPOINT lpPoints, UINT cPoints) Delta.y -= ToWnd->rcClient.top; } - if (mirror_from) Delta.x = -Delta.x; - for (i = 0; i != cPoints; i++) { lpPoints[i].x += Delta.x; diff --git a/reactos/win32ss/user/user32/windows/winpos.c b/reactos/win32ss/user/user32/windows/winpos.c index 8917ea4718f..30b43f7199b 100644 --- a/reactos/win32ss/user/user32/windows/winpos.c +++ b/reactos/win32ss/user/user32/windows/winpos.c @@ -218,8 +218,6 @@ MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints) Delta.y -= ToWnd->rcClient.top; } - if (mirror_from) Delta.x = -Delta.x; - for (i = 0; i != cPoints; i++) { lpPoints[i].x += Delta.x; From bcc1390a3611772beb8f57cdd258629989e7a351 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Wed, 26 Feb 2014 22:54:03 +0000 Subject: [PATCH 009/419] [User32Test] - Update listbox and msg test to wine 1.7.13. svn path=/trunk/; revision=62338 --- rostests/winetests/user32/listbox.c | 30 ++++++++++++++++ rostests/winetests/user32/msg.c | 56 +++++++++++++++-------------- 2 files changed, 59 insertions(+), 27 deletions(-) diff --git a/rostests/winetests/user32/listbox.c b/rostests/winetests/user32/listbox.c index fdc190d8e6d..8e3fbcd34a1 100644 --- a/rostests/winetests/user32/listbox.c +++ b/rostests/winetests/user32/listbox.c @@ -234,6 +234,8 @@ static void check_item_height(void) DestroyWindow (hLB); } +static int got_selchange; + static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { switch (msg) @@ -267,6 +269,10 @@ static LRESULT WINAPI main_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA break; } + case WM_COMMAND: + if (HIWORD( wparam ) == LBN_SELCHANGE) got_selchange++; + break; + default: break; } @@ -1588,6 +1594,29 @@ todo_wine DestroyWindow(parent); } +static void test_missing_lbuttonup( void ) +{ + HWND listbox, parent, capture; + + parent = create_parent(); + listbox = create_listbox(WS_CHILD | WS_VISIBLE, parent); + + /* Send button down without a corresponding button up */ + SendMessageA(listbox, WM_LBUTTONDOWN, 0, MAKELPARAM(10,10)); + capture = GetCapture(); + ok(capture == listbox, "got %p expected %p\n", capture, listbox); + + /* Capture is released and LBN_SELCHANGE sent during WM_KILLFOCUS */ + got_selchange = 0; + SetFocus(NULL); + capture = GetCapture(); + ok(capture == NULL, "got %p\n", capture); + ok(got_selchange, "got %d\n", got_selchange); + + DestroyWindow(listbox); + DestroyWindow(parent); +} + START_TEST(listbox) { const struct listbox_test SS = @@ -1668,4 +1697,5 @@ START_TEST(listbox) test_listbox_dlgdir(); test_set_count(); test_GetListBoxInfo(); + test_missing_lbuttonup(); } diff --git a/rostests/winetests/user32/msg.c b/rostests/winetests/user32/msg.c index 530df4d9df6..a0c610b8c3f 100755 --- a/rostests/winetests/user32/msg.c +++ b/rostests/winetests/user32/msg.c @@ -1719,11 +1719,11 @@ static const struct message WmSHOWNATopInvisible[] = { { 0 } }; -static int after_end_dialog, test_def_id; +static BOOL after_end_dialog, test_def_id, paint_loop_done; static int sequence_cnt, sequence_size; static struct recvd_message* sequence; static int log_all_parent_messages; -static int paint_loop_done; +static CRITICAL_SECTION sequence_cs; /* user32 functions */ static HWND (WINAPI *pGetAncestor)(HWND,UINT); @@ -1814,7 +1814,8 @@ static void add_message_(int line, const struct recvd_message *msg) { struct recvd_message *seq; - if (!sequence) + EnterCriticalSection( &sequence_cs ); + if (!sequence) { sequence_size = 10; sequence = HeapAlloc( GetProcessHeap(), 0, sequence_size * sizeof(*sequence) ); @@ -1826,7 +1827,7 @@ static void add_message_(int line, const struct recvd_message *msg) } assert(sequence); - seq = &sequence[sequence_cnt]; + seq = &sequence[sequence_cnt++]; seq->hwnd = msg->hwnd; seq->message = msg->message; seq->flags = msg->flags; @@ -1835,6 +1836,7 @@ static void add_message_(int line, const struct recvd_message *msg) seq->line = line; seq->descr = msg->descr; seq->output[0] = 0; + LeaveCriticalSection( &sequence_cs ); if (msg->descr) { @@ -1919,8 +1921,6 @@ static void add_message_(int line, const struct recvd_message *msg) sprintf( seq->output + strlen(seq->output), " (flags %x)", msg->flags ); } } - - sequence_cnt++; } /* try to make sure pending X events have been processed before continuing */ @@ -1941,9 +1941,11 @@ static void flush_events(void) static void flush_sequence(void) { + EnterCriticalSection( &sequence_cs ); HeapFree(GetProcessHeap(), 0, sequence); sequence = 0; sequence_cnt = sequence_size = 0; + LeaveCriticalSection( &sequence_cs ); } static void dump_sequence(const struct message *expected, const char *context, const char *file, int line) @@ -2030,7 +2032,7 @@ static void dump_sequence(const struct message *expected, const char *context, c ok_sequence_( (exp), (contx), (todo), __FILE__, __LINE__) -static void ok_sequence_(const struct message *expected_list, const char *context, int todo, +static void ok_sequence_(const struct message *expected_list, const char *context, BOOL todo, const char *file, int line) { static const struct recvd_message end_of_sequence; @@ -4762,17 +4764,17 @@ static void test_messages(void) flush_sequence(); - test_def_id = 1; + test_def_id = TRUE; SendMessageA(hwnd, WM_NULL, 0, 0); flush_sequence(); - after_end_dialog = 1; + after_end_dialog = TRUE; EndDialog( hwnd, 0 ); ok_sequence(WmEndCustomDialogSeq, "EndCustomDialog", FALSE); DestroyWindow(hwnd); - after_end_dialog = 0; - test_def_id = 0; + after_end_dialog = FALSE; + test_def_id = FALSE; hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_POPUP, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL); @@ -7886,7 +7888,7 @@ static LRESULT WINAPI PaintLoopProcA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM } else ok(broken(1), "infinite loop\n"); if ( i == 0) - paint_loop_done = 1; + paint_loop_done = TRUE; return DefWindowProcA(hWnd,msg,wParam,lParam); } } @@ -9040,22 +9042,22 @@ static void test_scrollwindowex(void) trace("start scroll\n"); ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL, SW_ERASE|SW_INVALIDATE); - ok_sequence(WmEmptySeq, "ScrollWindowEx", 0); + ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE); trace("end scroll\n"); flush_sequence(); flush_events(); - ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", 0); + ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE); flush_events(); flush_sequence(); /* Now without the SW_ERASE flag */ trace("start scroll\n"); ScrollWindowEx( hwnd, 10, 10, &rect, NULL, NULL, NULL, SW_INVALIDATE); - ok_sequence(WmEmptySeq, "ScrollWindowEx", 0); + ok_sequence(WmEmptySeq, "ScrollWindowEx", FALSE); trace("end scroll\n"); flush_sequence(); flush_events(); - ok_sequence(ScrollWindowPaint2, "ScrollWindowEx", 0); + ok_sequence(ScrollWindowPaint2, "ScrollWindowEx", FALSE); flush_events(); flush_sequence(); @@ -9069,7 +9071,7 @@ static void test_scrollwindowex(void) trace("end scroll\n"); flush_sequence(); flush_events(); - ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", 0); + ok_sequence(ScrollWindowPaint1, "ScrollWindowEx", FALSE); flush_events(); flush_sequence(); @@ -9079,7 +9081,7 @@ static void test_scrollwindowex(void) trace("end scroll\n"); flush_sequence(); flush_events(); - ok_sequence(ScrollWindowPaint1, "ScrollWindow", 0); + ok_sequence(ScrollWindowPaint1, "ScrollWindow", FALSE); ok(DestroyWindow(hchild), "failed to destroy window\n"); ok(DestroyWindow(hwnd), "failed to destroy window\n"); @@ -9212,7 +9214,7 @@ static void test_DestroyWindow(void) ret = DestroyWindow(parent); ok( ret, "DestroyWindow() error %d\n", GetLastError()); test_DestroyWindow_flag = FALSE; - ok_sequence(destroy_window_with_children, "destroy window with children", 0); + ok_sequence(destroy_window_with_children, "destroy window with children", FALSE); ok(!IsWindow(parent), "parent still exists\n"); ok(!IsWindow(child1), "child1 still exists\n"); @@ -10229,8 +10231,7 @@ static void wait_move_event(HWND hwnd, int x, int y) { MSG msg; DWORD time; - BOOL ret; - int go = 0; + BOOL ret, go = FALSE; time = GetTickCount(); while (GetTickCount() - time < 200 && !go) { @@ -12590,6 +12591,7 @@ static void test_menu_messages(void) SetMenu(hwnd, hmenu); SetForegroundWindow( hwnd ); + flush_events(); set_menu_style(hmenu, MNS_NOTIFYBYPOS); style = get_menu_style(hmenu); @@ -12708,7 +12710,7 @@ static void test_paintingloop(void) { HWND hwnd; - paint_loop_done = 0; + paint_loop_done = FALSE; hwnd = CreateWindowExA(0x0,"PaintLoopWindowClass", "PaintLoopWindowClass",WS_OVERLAPPEDWINDOW, 100, 100, 100, 100, 0, 0, 0, NULL ); @@ -12732,7 +12734,7 @@ static void test_defwinproc(void) { HWND hwnd; MSG msg; - int gotwmquit = FALSE; + BOOL gotwmquit = FALSE; hwnd = CreateWindowExA(0, "static", "test_defwndproc", WS_POPUP, 0,0,0,0,0,0,0, NULL); assert(hwnd); DefWindowProcA( hwnd, WM_ENDSESSION, 1, 0); @@ -12740,7 +12742,7 @@ static void test_defwinproc(void) if( msg.message == WM_QUIT) gotwmquit = TRUE; DispatchMessageA( &msg ); } - ok( gotwmquit == FALSE, "Unexpected WM_QUIT message!\n"); + ok(!gotwmquit, "Unexpected WM_QUIT message!\n"); DestroyWindow( hwnd); } @@ -14292,6 +14294,7 @@ START_TEST(msg) return; } + InitializeCriticalSection( &sequence_cs ); init_procs(); hModuleImm32 = LoadLibraryA("imm32.dll"); @@ -14327,7 +14330,6 @@ START_TEST(msg) test_winevents(); /* Fix message sequences before removing 4 lines below */ -#if 1 if (pUnhookWinEvent && hEvent_hook) { ret = pUnhookWinEvent(hEvent_hook); @@ -14335,7 +14337,6 @@ START_TEST(msg) pUnhookWinEvent = 0; } hEvent_hook = 0; -#endif test_SetFocus(); test_SetParent(); @@ -14358,7 +14359,7 @@ START_TEST(msg) test_paint_messages(); if(!winetest_interactive) skip("ReactOS ActivateActCtx seems to be broken.\n"); - else + else test_interthread_messages(); test_message_conversion(); test_accelerators(); @@ -14407,4 +14408,5 @@ START_TEST(msg) GetLastError() == 0xdeadbeef, /* Win9x */ "unexpected error %d\n", GetLastError()); } + DeleteCriticalSection( &sequence_cs ); } From f08e1261edff24dbc2db8a00d26b31ba14cbd1bc Mon Sep 17 00:00:00 2001 From: James Tabor Date: Wed, 26 Feb 2014 22:56:27 +0000 Subject: [PATCH 010/419] [User32|ListBox] - Patch by Huw Davies: If the listbox loses focus while holding capture, release it by essentially simulating a button up event. svn path=/trunk/; revision=62339 --- reactos/win32ss/user/user32/controls/listbox.c | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/win32ss/user/user32/controls/listbox.c b/reactos/win32ss/user/user32/controls/listbox.c index 09081e749dc..18e0fe99660 100644 --- a/reactos/win32ss/user/user32/controls/listbox.c +++ b/reactos/win32ss/user/user32/controls/listbox.c @@ -3052,6 +3052,7 @@ LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg, SEND_NOTIFICATION( descr, LBN_SETFOCUS ); return 0; case WM_KILLFOCUS: + LISTBOX_HandleLButtonUp( descr ); /* Release capture if we have it */ descr->in_focus = FALSE; descr->wheel_remain = 0; if ((descr->focus_item != -1) && descr->caret_on) From 4d92b88dea7bfc18fa647bf81169dc151859582d Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 27 Feb 2014 01:12:32 +0000 Subject: [PATCH 011/419] [Win32k] - Fix server side call for Get Combo and ListBox information so it does not loop through the message loop. svn path=/trunk/; revision=62340 --- reactos/win32ss/user/ntuser/window.c | 143 ++++++++++++++++++++++++++- 1 file changed, 141 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index e0e57643c5a..90382406243 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -3248,7 +3248,40 @@ CLEANUP: END_CLEANUP; } +//// +//// ReactOS work around! Keep it the sames as in Combo.c and Controls.h +//// +/* combo state struct */ +typedef struct +{ + HWND self; + HWND owner; + UINT dwStyle; + HWND hWndEdit; + HWND hWndLBox; + UINT wState; + HFONT hFont; + RECT textRect; + RECT buttonRect; + RECT droppedRect; + INT droppedIndex; + INT fixedOwnerDrawHeight; + INT droppedWidth; /* last two are not used unless set */ + INT editHeight; /* explicitly */ + LONG UIState; +} HEADCOMBO,*LPHEADCOMBO; +// Window Extra data container. +typedef struct _WND2CBOX +{ + WND; + LPHEADCOMBO pCBox; +} WND2CBOX, *PWND2CBOX; + +#define CBF_BUTTONDOWN 0x0002 +//// +//// +//// BOOL APIENTRY NtUserGetComboBoxInfo( @@ -3256,6 +3289,9 @@ NtUserGetComboBoxInfo( PCOMBOBOXINFO pcbi) { PWND Wnd; + PPROCESSINFO ppi; + BOOL NotSameppi = FALSE; + BOOL Ret = TRUE; DECLARE_RETURN(BOOL); TRACE("Enter NtUserGetComboBoxInfo\n"); @@ -3281,22 +3317,95 @@ NtUserGetComboBoxInfo( } _SEH2_END; + if (pcbi->cbSize < sizeof(COMBOBOXINFO)) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + RETURN(FALSE); + } + // Pass the user pointer, it was already probed. - RETURN( (BOOL) co_IntSendMessage( Wnd->head.h, CB_GETCOMBOBOXINFO, 0, (LPARAM)pcbi)); + if ((Wnd->pcls->atomClassName != gpsi->atomSysClass[ICLS_COMBOBOX]) && Wnd->fnid != FNID_COMBOBOX) + { + RETURN( (BOOL) co_IntSendMessage( Wnd->head.h, CB_GETCOMBOBOXINFO, 0, (LPARAM)pcbi)); + } + + ppi = PsGetCurrentProcessWin32Process(); + NotSameppi = ppi != Wnd->head.pti->ppi; + if (NotSameppi) + { + KeAttachProcess(&Wnd->head.pti->ppi->peProcess->Pcb); + } + + _SEH2_TRY + { + LPHEADCOMBO lphc = ((PWND2CBOX)Wnd)->pCBox; + pcbi->rcItem = lphc->textRect; + pcbi->rcButton = lphc->buttonRect; + pcbi->stateButton = 0; + if (lphc->wState & CBF_BUTTONDOWN) + pcbi->stateButton |= STATE_SYSTEM_PRESSED; + if (RECTL_bIsEmptyRect(&lphc->buttonRect)) + pcbi->stateButton |= STATE_SYSTEM_INVISIBLE; + pcbi->hwndCombo = lphc->self; + pcbi->hwndItem = lphc->hWndEdit; + pcbi->hwndList = lphc->hWndLBox; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Ret = FALSE; + SetLastNtError(_SEH2_GetExceptionCode()); + } + _SEH2_END; + + RETURN( Ret); CLEANUP: + if (NotSameppi) KeDetachProcess(); TRACE("Leave NtUserGetComboBoxInfo, ret=%i\n",_ret_); UserLeave(); END_CLEANUP; } +//// +//// ReactOS work around! Keep it the sames as in Listbox.c +//// +/* Listbox structure */ +typedef struct +{ + HWND self; /* Our own window handle */ + HWND owner; /* Owner window to send notifications to */ + UINT style; /* Window style */ + INT width; /* Window width */ + INT height; /* Window height */ + VOID *items; /* Array of items */ + INT nb_items; /* Number of items */ + INT top_item; /* Top visible item */ + INT selected_item; /* Selected item */ + INT focus_item; /* Item that has the focus */ + INT anchor_item; /* Anchor item for extended selection */ + INT item_height; /* Default item height */ + INT page_size; /* Items per listbox page */ + INT column_width; /* Column width for multi-column listboxes */ +} LB_DESCR; +// Window Extra data container. +typedef struct _WND2LB +{ + WND; + LB_DESCR * pLBiv; +} WND2LB, *PWND2LB; +//// +//// +//// DWORD APIENTRY NtUserGetListBoxInfo( HWND hWnd) { PWND Wnd; + PPROCESSINFO ppi; + BOOL NotSameppi = FALSE; + DWORD Ret = 0; DECLARE_RETURN(DWORD); TRACE("Enter NtUserGetListBoxInfo\n"); @@ -3307,9 +3416,39 @@ NtUserGetListBoxInfo( RETURN( 0 ); } - RETURN( (DWORD) co_IntSendMessage( Wnd->head.h, LB_GETLISTBOXINFO, 0, 0 )); + if ((Wnd->pcls->atomClassName != gpsi->atomSysClass[ICLS_LISTBOX]) && Wnd->fnid != FNID_LISTBOX) + { + RETURN( (DWORD) co_IntSendMessage( Wnd->head.h, LB_GETLISTBOXINFO, 0, 0 )); + } + + // wine lisbox:test_GetListBoxInfo lb_getlistboxinfo = 0, should not send a message! + ppi = PsGetCurrentProcessWin32Process(); + NotSameppi = ppi != Wnd->head.pti->ppi; + if (NotSameppi) + { + KeAttachProcess(&Wnd->head.pti->ppi->peProcess->Pcb); + } + + _SEH2_TRY + { + LB_DESCR *descr = ((PWND2LB)Wnd)->pLBiv; + // See Controls ListBox.c:LB_GETLISTBOXINFO must match... + if (descr->style & LBS_MULTICOLUMN) //// ReactOS + Ret = descr->page_size * descr->column_width; + else + Ret = descr->page_size; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Ret = 0; + SetLastNtError(_SEH2_GetExceptionCode()); + } + _SEH2_END; + + RETURN( Ret); CLEANUP: + if (NotSameppi) KeDetachProcess(); TRACE("Leave NtUserGetListBoxInfo, ret=%lu\n", _ret_); UserLeave(); END_CLEANUP; From 5729a923fe373e2ac9974789756d8f8cbdb050de Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 27 Feb 2014 13:20:59 +0000 Subject: [PATCH 012/419] - Remove debug print. svn path=/trunk/; revision=62348 --- reactos/drivers/filesystems/ext2/src/fsctrl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/drivers/filesystems/ext2/src/fsctrl.c b/reactos/drivers/filesystems/ext2/src/fsctrl.c index 4af6001fe81..642743ac3c4 100644 --- a/reactos/drivers/filesystems/ext2/src/fsctrl.c +++ b/reactos/drivers/filesystems/ext2/src/fsctrl.c @@ -535,7 +535,6 @@ Ext2MountVolume ( else { DebugTrace(DEBUG_TRACE_MOUNT, "Failing mount. Partition not Ext2...", 0); - DbgPrint("Supper Blk Magic %x\n",SuperBlock->s_magic); } try_exit: NOTHING; From 06a96d5805bef568f0dfe2a24e616b707df25e33 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 28 Feb 2014 16:18:41 +0000 Subject: [PATCH 013/419] [CMAKE] * Add support for marking an image as hotpatchable. [INCLUDES] * Introduce a way to allow us to mark pretty much any function in our codebase as DECLSPEC_HOTPATCH (not just in Wine modules). * Fix DECLSPEC_HOTPATCH define and enable this hot patching feature support. CORE-7959 svn path=/trunk/; revision=62354 --- reactos/cmake/CMakeMacros.cmake | 13 ++++++++++++- reactos/include/crt/_mingw.h | 9 +++++++++ reactos/include/reactos/wine/config.h | 6 ++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/reactos/cmake/CMakeMacros.cmake b/reactos/cmake/CMakeMacros.cmake index f6f4bcbfb2f..1229654bab5 100644 --- a/reactos/cmake/CMakeMacros.cmake +++ b/reactos/cmake/CMakeMacros.cmake @@ -417,7 +417,7 @@ function(add_importlibs _module) endfunction() function(set_module_type MODULE TYPE) - cmake_parse_arguments(__module "UNICODE" "IMAGEBASE" "ENTRYPOINT" ${ARGN}) + cmake_parse_arguments(__module "UNICODE;HOTPATCHABLE" "IMAGEBASE" "ENTRYPOINT" ${ARGN}) if(__module_UNPARSED_ARGUMENTS) message(STATUS "set_module_type : unparsed arguments ${__module_UNPARSED_ARGUMENTS}, module : ${MODULE}") @@ -457,6 +457,17 @@ function(set_module_type MODULE TYPE) add_target_compile_definitions(${MODULE} UNICODE _UNICODE) endif() + # Handle hotpatchable images. + # GCC has this as a function attribute so we're handling it using DECLSPEC_HOTPATCH + if(__module_HOTPATCHABLE AND MSVC) + set_property(TARGET ${_target} APPEND_STRING PROPERTY COMPILE_FLAGS " /hotpatch") + if(ARCH STREQUAL "i386") + set_property(TARGET ${_target} APPEND_STRING PROPERTY LINK_FLAGS " /FUNCTIONPADMIN:5") + elseif(ARCH STREQUAL "amd64") + set_property(TARGET ${_target} APPEND_STRING PROPERTY LINK_FLAGS " /FUNCTIONPADMIN:6") + endif() + endif() + # set entry point if(__module_ENTRYPOINT OR (__module_ENTRYPOINT STREQUAL "0")) list(GET __module_ENTRYPOINT 0 __entrypoint) diff --git a/reactos/include/crt/_mingw.h b/reactos/include/crt/_mingw.h index f63e7dac32e..40b8b11ed39 100644 --- a/reactos/include/crt/_mingw.h +++ b/reactos/include/crt/_mingw.h @@ -215,6 +215,15 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case. */ #define _DECLSPEC_INTRIN_TYPE #endif +/* Define to a function attribute for Microsoft hotpatch assembly prefix. */ +#ifndef DECLSPEC_HOTPATCH +#ifdef _MSC_VER +#define DECLSPEC_HOTPATCH +#else +#define DECLSPEC_HOTPATCH __attribute__((__ms_hook_prologue__)) +#endif +#endif /* DECLSPEC_HOTPATCH */ + #include "_mingw_mac.h" #endif /* !_INC_MINGW */ diff --git a/reactos/include/reactos/wine/config.h b/reactos/include/reactos/wine/config.h index 6f1d8d632cb..36bb5c2a0a1 100644 --- a/reactos/include/reactos/wine/config.h +++ b/reactos/include/reactos/wine/config.h @@ -1,7 +1,13 @@ #define __WINE_CONFIG_H /* Define to a function attribute for Microsoft hotpatch assembly prefix. */ +#ifndef DECLSPEC_HOTPATCH +#ifdef _MSC_VER #define DECLSPEC_HOTPATCH +#else +#define DECLSPEC_HOTPATCH __attribute__((__ms_hook_prologue__)) +#endif +#endif /* DECLSPEC_HOTPATCH */ /* Define to the file extension for executables. */ #define EXEEXT ".exe" From 09dfcb57208d4321181e3dcd4751f0fb2a268a3e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 28 Feb 2014 16:21:10 +0000 Subject: [PATCH 014/419] [USER32] * Mark as hotpatchable. * Uncomment out the hot patching attribute for ShowCursor() now that the feature is supported. * More will come. CORE-7959 svn path=/trunk/; revision=62355 --- reactos/win32ss/user/user32/CMakeLists.txt | 2 +- reactos/win32ss/user/user32/windows/cursoricon.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/user32/CMakeLists.txt b/reactos/win32ss/user/user32/CMakeLists.txt index 58df58e5ce4..8ea0ea1f840 100644 --- a/reactos/win32ss/user/user32/CMakeLists.txt +++ b/reactos/win32ss/user/user32/CMakeLists.txt @@ -71,7 +71,7 @@ add_library(user32 SHARED user32.rc ${CMAKE_CURRENT_BINARY_DIR}/user32.def) -set_module_type(user32 win32dll ENTRYPOINT DllMain 12 UNICODE) +set_module_type(user32 win32dll ENTRYPOINT DllMain 12 UNICODE HOTPATCHABLE) target_link_libraries(user32 user32_wsprintf wine win32ksys ${PSEH_LIB}) if(MSVC) diff --git a/reactos/win32ss/user/user32/windows/cursoricon.c b/reactos/win32ss/user/user32/windows/cursoricon.c index ba5c1a66287..cfe5aa0dd43 100644 --- a/reactos/win32ss/user/user32/windows/cursoricon.c +++ b/reactos/win32ss/user/user32/windows/cursoricon.c @@ -1252,7 +1252,7 @@ BOOL WINAPI DrawIcon( HDC hdc, INT x, INT y, HICON hIcon ) /*********************************************************************** * ShowCursor (USER32.@) */ -INT WINAPI /*DECLSPEC_HOTPATCH*/ ShowCursor( BOOL bShow ) +INT WINAPI DECLSPEC_HOTPATCH ShowCursor( BOOL bShow ) { return NtUserxShowCursor(bShow); } From 66e64a9325817796c0ba8dfecff17869d05a421b Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 28 Feb 2014 16:24:50 +0000 Subject: [PATCH 015/419] [DIRECTX] * Mark some modules as hotpatchable. CORE-7959 svn path=/trunk/; revision=62356 --- reactos/dll/directx/wine/d3d8/CMakeLists.txt | 2 +- reactos/dll/directx/wine/d3d9/CMakeLists.txt | 2 +- reactos/dll/directx/wine/ddraw/CMakeLists.txt | 2 +- reactos/dll/directx/wine/dinput/CMakeLists.txt | 2 +- reactos/dll/directx/wine/dinput8/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/dll/directx/wine/d3d8/CMakeLists.txt b/reactos/dll/directx/wine/d3d8/CMakeLists.txt index d96473e41a0..cb111aee279 100644 --- a/reactos/dll/directx/wine/d3d8/CMakeLists.txt +++ b/reactos/dll/directx/wine/d3d8/CMakeLists.txt @@ -26,7 +26,7 @@ add_library(d3d8 SHARED version.rc ${CMAKE_CURRENT_BINARY_DIR}/d3d8.def) -set_module_type(d3d8 win32dll UNICODE) +set_module_type(d3d8 win32dll UNICODE HOTPATCHABLE) target_link_libraries(d3d8 uuid wine) add_importlibs(d3d8 wined3d msvcrt kernel32 ntdll) add_pch(d3d8 d3d8_private.h SOURCE) diff --git a/reactos/dll/directx/wine/d3d9/CMakeLists.txt b/reactos/dll/directx/wine/d3d9/CMakeLists.txt index 77bdc5472b4..330dc93ca07 100644 --- a/reactos/dll/directx/wine/d3d9/CMakeLists.txt +++ b/reactos/dll/directx/wine/d3d9/CMakeLists.txt @@ -29,7 +29,7 @@ add_library(d3d9 SHARED ${CMAKE_CURRENT_BINARY_DIR}/d3d9_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/d3d9.def) -set_module_type(d3d9 win32dll UNICODE) +set_module_type(d3d9 win32dll UNICODE HOTPATCHABLE) target_link_libraries(d3d9 wine) add_importlibs(d3d9 wined3d msvcrt kernel32 ntdll) add_pch(d3d9 d3d9_private.h SOURCE) diff --git a/reactos/dll/directx/wine/ddraw/CMakeLists.txt b/reactos/dll/directx/wine/ddraw/CMakeLists.txt index 115bc59fb6c..aa34f1760c7 100644 --- a/reactos/dll/directx/wine/ddraw/CMakeLists.txt +++ b/reactos/dll/directx/wine/ddraw/CMakeLists.txt @@ -34,7 +34,7 @@ add_library(ddraw SHARED ddraw.rc ${CMAKE_CURRENT_BINARY_DIR}/ddraw.def) -set_module_type(ddraw win32dll) +set_module_type(ddraw win32dll HOTPATCHABLE) target_link_libraries(ddraw wine uuid dxguid ${PSEH_LIB}) add_importlibs(ddraw advapi32 gdi32 user32 wined3d msvcrt kernel32 ntdll) add_dependencies(ddraw wineheaders) diff --git a/reactos/dll/directx/wine/dinput/CMakeLists.txt b/reactos/dll/directx/wine/dinput/CMakeLists.txt index 5e2809fff35..c2b10420576 100644 --- a/reactos/dll/directx/wine/dinput/CMakeLists.txt +++ b/reactos/dll/directx/wine/dinput/CMakeLists.txt @@ -24,7 +24,7 @@ add_library(dinput SHARED add_library(dinput_data_formats data_formats.c) add_dependencies(dinput_data_formats psdk) -set_module_type(dinput win32dll) +set_module_type(dinput win32dll HOTPATCHABLE) target_link_libraries(dinput dxguid uuid wine) add_importlibs(dinput comctl32 ole32 user32 advapi32 msvcrt kernel32 ntdll) add_pch(dinput dinput_private.h SOURCE) diff --git a/reactos/dll/directx/wine/dinput8/CMakeLists.txt b/reactos/dll/directx/wine/dinput8/CMakeLists.txt index 804d97b1c17..d2907e689e0 100644 --- a/reactos/dll/directx/wine/dinput8/CMakeLists.txt +++ b/reactos/dll/directx/wine/dinput8/CMakeLists.txt @@ -8,7 +8,7 @@ list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/dinput8.def) add_library(dinput8 SHARED ${SOURCE} version.rc) -set_module_type(dinput8 win32dll) +set_module_type(dinput8 win32dll HOTPATCHABLE) target_link_libraries(dinput8 dxguid uuid wine) add_importlibs(dinput8 ole32 msvcrt kernel32 ntdll) add_cd_file(TARGET dinput8 DESTINATION reactos/system32 FOR all) From ccee4fcbcee0f8bd419ce7d9d27e5c471e3f26ce Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 28 Feb 2014 18:39:29 +0000 Subject: [PATCH 016/419] [IPHLPAPI] * Mark as hotpatchable. CORE-7959 svn path=/trunk/; revision=62358 --- reactos/dll/win32/iphlpapi/CMakeLists.txt | 2 +- reactos/dll/win32/iphlpapi/iphlpapi_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/iphlpapi/CMakeLists.txt b/reactos/dll/win32/iphlpapi/CMakeLists.txt index ce365f72ce2..3d15eb6aded 100644 --- a/reactos/dll/win32/iphlpapi/CMakeLists.txt +++ b/reactos/dll/win32/iphlpapi/CMakeLists.txt @@ -24,7 +24,7 @@ add_library(iphlpapi SHARED iphlpapi.rc ${CMAKE_CURRENT_BINARY_DIR}/iphlpapi.def) -set_module_type(iphlpapi win32dll UNICODE) +set_module_type(iphlpapi win32dll UNICODE HOTPATCHABLE) target_link_libraries(iphlpapi wine tdilib) add_importlibs(iphlpapi icmp dhcpcsvc advapi32 ws2_32 msvcrt kernel32 ntdll) add_pch(iphlpapi iphlpapi_private.h SOURCE) diff --git a/reactos/dll/win32/iphlpapi/iphlpapi_main.c b/reactos/dll/win32/iphlpapi/iphlpapi_main.c index b61ae6f0394..dff38c05714 100644 --- a/reactos/dll/win32/iphlpapi/iphlpapi_main.c +++ b/reactos/dll/win32/iphlpapi/iphlpapi_main.c @@ -2281,7 +2281,7 @@ PIP_ADAPTER_ORDER_MAP WINAPI GetAdapterOrderMap(VOID) /* * @implemented */ -DWORD WINAPI GetAdaptersAddresses(ULONG Family,ULONG Flags,PVOID Reserved,PIP_ADAPTER_ADDRESSES pAdapterAddresses,PULONG pOutBufLen) +DWORD WINAPI DECLSPEC_HOTPATCH GetAdaptersAddresses(ULONG Family,ULONG Flags,PVOID Reserved,PIP_ADAPTER_ADDRESSES pAdapterAddresses,PULONG pOutBufLen) { #if 0 InterfaceIndexTable *indexTable; From 9892a47037ea076928fd4fe927b9602cbbe5d2cc Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 28 Feb 2014 21:24:32 +0000 Subject: [PATCH 017/419] [OPENGL32] * Mark as hotpatchable. CORE-7959 svn path=/trunk/; revision=62360 --- reactos/dll/opengl/opengl32/CMakeLists.txt | 2 +- reactos/dll/opengl/opengl32/wgl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/opengl/opengl32/CMakeLists.txt b/reactos/dll/opengl/opengl32/CMakeLists.txt index 17d7da19de3..9a14f68ee0e 100644 --- a/reactos/dll/opengl/opengl32/CMakeLists.txt +++ b/reactos/dll/opengl/opengl32/CMakeLists.txt @@ -53,7 +53,7 @@ if((ARCH STREQUAL "i386") AND (NOT MSVC)) target_link_libraries(opengl32 mesa_x86) endif() -set_module_type(opengl32 win32dll) +set_module_type(opengl32 win32dll HOTPATCHABLE) add_importlibs(opengl32 gdi32 user32 advapi32 msvcrt kernel32 ntdll) add_pch(opengl32 opengl32.h SOURCE) diff --git a/reactos/dll/opengl/opengl32/wgl.c b/reactos/dll/opengl/opengl32/wgl.c index 32503e7344b..8da98b9d350 100644 --- a/reactos/dll/opengl/opengl32/wgl.c +++ b/reactos/dll/opengl/opengl32/wgl.c @@ -871,7 +871,7 @@ BOOL WINAPI wglShareLists(HGLRC hglrcSrc, HGLRC hglrcDst) return sw_ShareLists(ctx_src->dhglrc, ctx_dst->dhglrc); } -BOOL WINAPI wglSwapBuffers(HDC hdc) +BOOL WINAPI DECLSPEC_HOTPATCH wglSwapBuffers(HDC hdc) { struct wgl_dc_data* dc_data = get_dc_data(hdc); From 4644ad4140877c02d816ac61b0bb7677fcb3645a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 28 Feb 2014 23:34:32 +0000 Subject: [PATCH 018/419] [CMAKE] Make MSVC warning C4020 "Too many actual parameters" an error CORE-7960 #resolve #comment Committed in revision 62361. svn path=/trunk/; revision=62361 --- reactos/cmake/msvc.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/cmake/msvc.cmake b/reactos/cmake/msvc.cmake index 7d213195eee..16949003343 100644 --- a/reactos/cmake/msvc.cmake +++ b/reactos/cmake/msvc.cmake @@ -43,6 +43,7 @@ add_compile_flags("/wd4290") # The following warnings are treated as errors: # - C4013: implicit function declaration +# - C4020: too many actual parameters # - C4022: pointer type mismatch for parameter # - TODO: C4028: formal parameter different from declaration # - C4047: different level of indirection @@ -55,7 +56,7 @@ add_compile_flags("/wd4290") # - C4229: modifiers on data are ignored # - C4700: uninitialized variable usage # - C4603: macro is not defined or definition is different after precompiled header use -add_compile_flags("/we4013 /we4022 /we4047 /we4098 /we4113 /we4129 /we4229 /we4700 /we4603") +add_compile_flags("/we4013 /we4020 /we4022 /we4047 /we4098 /we4113 /we4129 /we4229 /we4700 /we4603") # Enable warnings above the default level, but don't treat them as errors: # - C4115: named type definition in parentheses From de68f2df0f520fbbdfb5c7ca89492726d5943fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 28 Feb 2014 23:55:40 +0000 Subject: [PATCH 019/419] [CMD][HELP] Fix the IsConsoleHandle helper. svn path=/trunk/; revision=62362 --- reactos/base/applications/cmdutils/help/help.c | 3 ++- reactos/base/shell/cmd/console.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/reactos/base/applications/cmdutils/help/help.c b/reactos/base/applications/cmdutils/help/help.c index 69af5ebd091..2a2b67cb5ba 100644 --- a/reactos/base/applications/cmdutils/help/help.c +++ b/reactos/base/applications/cmdutils/help/help.c @@ -25,7 +25,8 @@ BOOL IsConsoleHandle(HANDLE hHandle) DWORD dwMode; /* Check whether the handle may be that of a console... */ - if ((GetFileType(hHandle) & FILE_TYPE_CHAR) == 0) return FALSE; + if ((GetFileType(hHandle) & ~FILE_TYPE_REMOTE) != FILE_TYPE_CHAR) + return FALSE; /* * It may be. Perform another test... The idea comes from the diff --git a/reactos/base/shell/cmd/console.c b/reactos/base/shell/cmd/console.c index 921684b08ba..a01c0c8d748 100644 --- a/reactos/base/shell/cmd/console.c +++ b/reactos/base/shell/cmd/console.c @@ -31,7 +31,8 @@ BOOL IsConsoleHandle(HANDLE hHandle) DWORD dwMode; /* Check whether the handle may be that of a console... */ - if ((GetFileType(hHandle) & FILE_TYPE_CHAR) == 0) return FALSE; + if ((GetFileType(hHandle) & ~FILE_TYPE_REMOTE) != FILE_TYPE_CHAR) + return FALSE; /* * It may be. Perform another test... The idea comes from the From 2d1a100b5717f4f29fa2b3d85fb3b364f8197fea Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 1 Mar 2014 11:37:23 +0000 Subject: [PATCH 020/419] [NETAPI32] - NetUserSetInfo: Implement the info level 22. - Update the users DACL according to the user flags for the info levels 1, 2, 3, 4, 22 and 1008. svn path=/trunk/; revision=62364 --- reactos/dll/win32/netapi32/user.c | 154 +++++++++++++++++++++++++++--- 1 file changed, 143 insertions(+), 11 deletions(-) diff --git a/reactos/dll/win32/netapi32/user.c b/reactos/dll/win32/netapi32/user.c index 6452a4ad225..01d787a1e65 100644 --- a/reactos/dll/win32/netapi32/user.c +++ b/reactos/dll/win32/netapi32/user.c @@ -250,6 +250,28 @@ GetPasswordAge(IN PLARGE_INTEGER PasswordLastSet) } +static +VOID +ChangeUserDacl(IN PACL Dacl, + IN ULONG Flags) +{ + PACCESS_ALLOWED_ACE Ace = NULL; + NTSTATUS Status; + + if (Dacl == NULL) + return; + + Status = GetAllowedWorldAce(Dacl, &Ace); + if (!NT_SUCCESS(Status)) + return; + + if (Flags & UF_PASSWD_CANT_CHANGE) + Ace->Mask &= ~USER_CHANGE_PASSWORD; + else + Ace->Mask |= USER_CHANGE_PASSWORD; +} + + static NET_API_STATUS GetUserDacl(IN SAM_HANDLE UserHandle, @@ -1511,6 +1533,7 @@ SetUserInfo(SAM_HANDLE UserHandle, PUSER_INFO_2 UserInfo2; PUSER_INFO_3 UserInfo3; PUSER_INFO_4 UserInfo4; + PUSER_INFO_22 UserInfo22; PUSER_INFO_1003 UserInfo1003; PUSER_INFO_1006 UserInfo1006; PUSER_INFO_1007 UserInfo1007; @@ -1527,11 +1550,20 @@ SetUserInfo(SAM_HANDLE UserHandle, PUSER_INFO_1051 UserInfo1051; PUSER_INFO_1052 UserInfo1052; PUSER_INFO_1053 UserInfo1053; + PACL Dacl = NULL; NET_API_STATUS ApiStatus = NERR_Success; NTSTATUS Status = STATUS_SUCCESS; ZeroMemory(&UserAllInfo, sizeof(USER_ALL_INFORMATION)); + if ((Level == 1) || (Level == 2) || (Level == 3) || + (Level == 4) || (Level == 22) || (Level == 1008)) + { + ApiStatus = GetUserDacl(UserHandle, &Dacl); + if (ApiStatus != NERR_Success) + goto done; + } + switch (Level) { case 0: @@ -1574,6 +1606,7 @@ SetUserInfo(SAM_HANDLE UserHandle, UserAllInfo.WhichFields |= USER_ALL_ADMINCOMMENT; } + ChangeUserDacl(Dacl, UserInfo1->usri1_flags); UserAllInfo.UserAccountControl = GetAccountControl(UserInfo1->usri1_flags); UserAllInfo.WhichFields |= USER_ALL_USERACCOUNTCONTROL; @@ -1616,6 +1649,7 @@ SetUserInfo(SAM_HANDLE UserHandle, UserAllInfo.WhichFields |= USER_ALL_ADMINCOMMENT; } + ChangeUserDacl(Dacl, UserInfo2->usri2_flags); UserAllInfo.UserAccountControl = GetAccountControl(UserInfo2->usri2_flags); UserAllInfo.WhichFields |= USER_ALL_USERACCOUNTCONTROL; @@ -1718,6 +1752,7 @@ SetUserInfo(SAM_HANDLE UserHandle, UserAllInfo.WhichFields |= USER_ALL_ADMINCOMMENT; } + ChangeUserDacl(Dacl, UserInfo3->usri3_flags); UserAllInfo.UserAccountControl = GetAccountControl(UserInfo3->usri3_flags); UserAllInfo.WhichFields |= USER_ALL_USERACCOUNTCONTROL; @@ -1842,6 +1877,7 @@ SetUserInfo(SAM_HANDLE UserHandle, UserAllInfo.WhichFields |= USER_ALL_ADMINCOMMENT; } + ChangeUserDacl(Dacl, UserInfo4->usri4_flags); UserAllInfo.UserAccountControl = GetAccountControl(UserInfo4->usri4_flags); UserAllInfo.WhichFields |= USER_ALL_USERACCOUNTCONTROL; @@ -1899,8 +1935,8 @@ SetUserInfo(SAM_HANDLE UserHandle, // usri4_max_storage ignored -// UserInfo3->usri4_units_per_week; -// UserInfo3->usri4_logon_hours; +// UserInfo4->usri4_units_per_week; +// UserInfo4->usri4_logon_hours; // usri4_bad_pw_count ignored // usri4_num_logons ignored @@ -1936,7 +1972,104 @@ SetUserInfo(SAM_HANDLE UserHandle, break; // case 21: -// case 22: +// break; + + case 22: + UserInfo22 = (PUSER_INFO_22)UserInfo; + + // usri22_name ignored + +// UserInfo22->usri22_password[ENCRYPTED_PWLEN]; + + // usri22_password_age ignored + +// UserInfo3->usri3_priv; + + if (UserInfo22->usri22_home_dir != NULL) + { + RtlInitUnicodeString(&UserAllInfo.HomeDirectory, + UserInfo22->usri22_home_dir); + UserAllInfo.WhichFields |= USER_ALL_HOMEDIRECTORY; + } + + if (UserInfo22->usri22_comment != NULL) + { + RtlInitUnicodeString(&UserAllInfo.AdminComment, + UserInfo22->usri22_comment); + UserAllInfo.WhichFields |= USER_ALL_ADMINCOMMENT; + } + + ChangeUserDacl(Dacl, UserInfo22->usri22_flags); + UserAllInfo.UserAccountControl = GetAccountControl(UserInfo22->usri22_flags); + UserAllInfo.WhichFields |= USER_ALL_USERACCOUNTCONTROL; + + if (UserInfo22->usri22_script_path != NULL) + { + RtlInitUnicodeString(&UserAllInfo.ScriptPath, + UserInfo22->usri22_script_path); + UserAllInfo.WhichFields |= USER_ALL_SCRIPTPATH; + } + +// UserInfo22->usri22_auth_flags; + + if (UserInfo22->usri22_full_name != NULL) + { + RtlInitUnicodeString(&UserAllInfo.FullName, + UserInfo22->usri22_full_name); + UserAllInfo.WhichFields |= USER_ALL_FULLNAME; + } + + if (UserInfo22->usri22_usr_comment != NULL) + { + RtlInitUnicodeString(&UserAllInfo.UserComment, + UserInfo22->usri22_usr_comment); + UserAllInfo.WhichFields |= USER_ALL_USERCOMMENT; + } + + if (UserInfo22->usri22_parms != NULL) + { + RtlInitUnicodeString(&UserAllInfo.Parameters, + UserInfo22->usri22_parms); + UserAllInfo.WhichFields |= USER_ALL_PARAMETERS; + } + + if (UserInfo22->usri22_workstations != NULL) + { + RtlInitUnicodeString(&UserAllInfo.WorkStations, + UserInfo22->usri22_workstations); + UserAllInfo.WhichFields |= USER_ALL_WORKSTATIONS; + } + + // usri22_last_logon ignored + // usri22_last_logoff ignored + + if (UserInfo22->usri22_acct_expires == TIMEQ_FOREVER) + { + UserAllInfo.AccountExpires.LowPart = 0; + UserAllInfo.AccountExpires.HighPart = 0; + } + else + { + RtlSecondsSince1970ToTime(UserInfo22->usri22_acct_expires, + &UserAllInfo.AccountExpires); + } + UserAllInfo.WhichFields |= USER_ALL_ACCOUNTEXPIRES; + + // usri22_max_storage ignored + +// UserInfo22->usri22_units_per_week; +// UserInfo22->usri22_logon_hours; + + // usri22_bad_pw_count ignored + // usri22_num_logons ignored + // usri22_logon_server ignored + + UserAllInfo.CountryCode = UserInfo22->usri22_country_code; + UserAllInfo.WhichFields |= USER_ALL_COUNTRYCODE; + + UserAllInfo.CodePage = UserInfo22->usri22_code_page; + UserAllInfo.WhichFields |= USER_ALL_CODEPAGE; + break; case 1003: UserInfo1003 = (PUSER_INFO_1003)UserInfo; @@ -1951,6 +2084,7 @@ SetUserInfo(SAM_HANDLE UserHandle, break; // case 1005: +// break; case 1006: UserInfo1006 = (PUSER_INFO_1006)UserInfo; @@ -1976,6 +2110,7 @@ SetUserInfo(SAM_HANDLE UserHandle, case 1008: UserInfo1008 = (PUSER_INFO_1008)UserInfo; + ChangeUserDacl(Dacl, UserInfo1008->usri1008_flags); UserAllInfo.UserAccountControl = GetAccountControl(UserInfo1008->usri1008_flags); UserAllInfo.WhichFields |= USER_ALL_USERACCOUNTCONTROL; break; @@ -1992,6 +2127,7 @@ SetUserInfo(SAM_HANDLE UserHandle, break; // case 1010: +// break; case 1011: UserInfo1011 = (PUSER_INFO_1011)UserInfo; @@ -2064,6 +2200,7 @@ SetUserInfo(SAM_HANDLE UserHandle, break; // case 1020: +// break; case 1024: UserInfo1024 = (PUSER_INFO_1024)UserInfo; @@ -2124,6 +2261,9 @@ SetUserInfo(SAM_HANDLE UserHandle, } done: + if (Dacl != NULL) + HeapFree(GetProcessHeap(), 0, Dacl); + return ApiStatus; } @@ -2934,14 +3074,6 @@ done: // *bufptr = (LPBYTE)Buffer; return ApiStatus; - -#if 0 - *bufptr = NULL; - *entriesread = 0; - *totalentries = 0; - - return ERROR_INVALID_LEVEL; -#endif } From 27558e0b69a2ab5e632f30d61d6606357c15a788 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 1 Mar 2014 12:11:26 +0000 Subject: [PATCH 021/419] [NETAPI32] NetUserSetInfo: Enable info levels 4, 22, 1017 and 1018. svn path=/trunk/; revision=62366 --- reactos/dll/win32/netapi32/user.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/netapi32/user.c b/reactos/dll/win32/netapi32/user.c index 01d787a1e65..0abfc0d73ab 100644 --- a/reactos/dll/win32/netapi32/user.c +++ b/reactos/dll/win32/netapi32/user.c @@ -3887,9 +3887,9 @@ NetUserSetInfo(LPCWSTR servername, case 1: case 2: case 3: -// case 4: + case 4: // case 21: -// case 22: + case 22: case 1003: // case 1005: case 1006: @@ -3901,8 +3901,8 @@ NetUserSetInfo(LPCWSTR servername, case 1012: case 1013: case 1014: -// case 1017: -// case 1018: + case 1017: + case 1018: // case 1020: case 1024: case 1025: From dae5c99d1293426c6468d67c4695f8c5dac637dc Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 1 Mar 2014 17:12:21 +0000 Subject: [PATCH 022/419] [MSV1_0] LsaApLogonUser: Add checks for account restrictions (account disabled and account locked). svn path=/trunk/; revision=62368 --- reactos/dll/win32/msv1_0/msv1_0.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/msv1_0/msv1_0.c b/reactos/dll/win32/msv1_0/msv1_0.c index 5581d78a2e8..ec63a04368d 100644 --- a/reactos/dll/win32/msv1_0/msv1_0.c +++ b/reactos/dll/win32/msv1_0/msv1_0.c @@ -1083,7 +1083,33 @@ LsaApLogonUser(IN PLSA_CLIENT_REQUEST ClientRequest, TRACE("UserName: %S\n", UserInfo->All.UserName.Buffer); - /* FIXME: Check restrictions */ + /* Check account restrictions for non-administrator accounts */ + if (RelativeIds.Element[0] != DOMAIN_USER_RID_ADMIN) + { + /* Check if the account has been disabled */ + if (UserInfo->All.UserAccountControl & USER_ACCOUNT_DISABLED) + { + ERR("Account disabled!\n"); + *SubStatus = STATUS_ACCOUNT_DISABLED; + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } + + /* Check if the account has been locked */ + if (UserInfo->All.UserAccountControl & USER_ACCOUNT_AUTO_LOCKED) + { + ERR("Account disabled!\n"); + *SubStatus = STATUS_ACCOUNT_LOCKED_OUT; + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } + + /* FIXME: more checks */ +// *SubStatus = STATUS_PASSWORD_EXPIRED; +// *SubStatus = STATUS_INVALID_LOGON_HOURS; +// *SubStatus = STATUS_INVALID_WORKSTATION; + + } /* Check the password */ if ((UserInfo->All.UserAccountControl & USER_PASSWORD_NOT_REQUIRED) == 0) From 5012425e7fb1fb2546f0184457ed89c48114c8de Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 1 Mar 2014 20:45:10 +0000 Subject: [PATCH 023/419] [MSGINA] MyLogonUser: Pass the sub status to the caller. svn path=/trunk/; revision=62369 --- reactos/dll/win32/msgina/lsa.c | 25 +++++--------- reactos/dll/win32/msgina/msgina.c | 55 ++++++++++++++++++++----------- reactos/dll/win32/msgina/msgina.h | 7 ++-- reactos/dll/win32/msgina/tui.c | 28 ++++++++++------ 4 files changed, 66 insertions(+), 49 deletions(-) diff --git a/reactos/dll/win32/msgina/lsa.c b/reactos/dll/win32/msgina/lsa.c index 126a55aa5c4..174378f0fcd 100644 --- a/reactos/dll/win32/msgina/lsa.c +++ b/reactos/dll/win32/msgina/lsa.c @@ -7,7 +7,7 @@ #include "msgina.h" -BOOL +NTSTATUS ConnectToLsa( PGINA_CONTEXT pgContext) { @@ -18,7 +18,7 @@ ConnectToLsa( /* We are already connected to the LSA */ if (pgContext->LsaHandle != NULL) - return TRUE; + return STATUS_SUCCESS; /* Connect to the LSA server */ RtlInitAnsiString((PANSI_STRING)&LogonProcessName, @@ -30,7 +30,7 @@ ConnectToLsa( if (!NT_SUCCESS(Status)) { ERR("LsaRegisterLogonProcess failed (Status 0x%08lx)\n", Status); - return FALSE; + return Status; } /* Get the authentication package */ @@ -43,21 +43,21 @@ ConnectToLsa( if (!NT_SUCCESS(Status)) { ERR("LsaLookupAuthenticationPackage failed (Status 0x%08lx)\n", Status); - return FALSE; } - return TRUE; + return Status; } -BOOL +NTSTATUS MyLogonUser( HANDLE LsaHandle, ULONG AuthenticationPackage, LPWSTR lpszUsername, LPWSTR lpszDomain, LPWSTR lpszPassword, - PHANDLE phToken) + PHANDLE phToken, + PNTSTATUS SubStatus) { SID_IDENTIFIER_AUTHORITY LocalAuthority = {SECURITY_LOCAL_SID_AUTHORITY}; SID_IDENTIFIER_AUTHORITY SystemAuthority = {SECURITY_NT_AUTHORITY}; @@ -78,7 +78,6 @@ MyLogonUser( LUID LogonId = {0, 0}; HANDLE TokenHandle = NULL; QUOTA_LIMITS QuotaLimits; - NTSTATUS SubStatus = STATUS_SUCCESS; NTSTATUS Status; *phToken = NULL; @@ -209,7 +208,7 @@ MyLogonUser( &Luid, &TokenHandle, &QuotaLimits, - &SubStatus); + SubStatus); if (!NT_SUCCESS(Status)) { ERR("LsaLogonUser failed (Status 0x%08lx)\n", Status); @@ -259,13 +258,7 @@ done: if (AuthInfo != NULL) RtlFreeHeap(RtlGetProcessHeap(), 0, AuthInfo); - if (!NT_SUCCESS(Status)) - { - SetLastError(RtlNtStatusToDosError(Status)); - return FALSE; - } - - return TRUE; + return Status; } /* EOF */ diff --git a/reactos/dll/win32/msgina/msgina.c b/reactos/dll/win32/msgina/msgina.c index 6f54e20121f..6480cbef32a 100644 --- a/reactos/dll/win32/msgina/msgina.c +++ b/reactos/dll/win32/msgina/msgina.c @@ -612,20 +612,27 @@ DoAdminUnlock( ULONG Size; ULONG i; NTSTATUS Status; + NTSTATUS SubStatus = STATUS_SUCCESS; TRACE("(%S %S %S)\n", UserName, Domain, Password); - if (!ConnectToLsa(pgContext)) - return FALSE; - - if (!MyLogonUser(pgContext->LsaHandle, - pgContext->AuthenticationPackage, - UserName, - Domain, - Password, - &pgContext->UserToken)) + Status = ConnectToLsa(pgContext); + if (!NT_SUCCESS(Status)) { - WARN("LogonUserW() failed\n"); + WARN("ConnectToLsa() failed\n"); + return FALSE; + } + + Status = MyLogonUser(pgContext->LsaHandle, + pgContext->AuthenticationPackage, + UserName, + Domain, + Password, + &pgContext->UserToken, + &SubStatus); + if (!NT_SUCCESS(Status)) + { + WARN("MyLogonUser() failed\n"); return FALSE; } @@ -693,18 +700,26 @@ DoLoginTasks( DWORD cbStats, cbSize; DWORD dwLength; BOOL bResult; + NTSTATUS SubStatus; + NTSTATUS Status; - if (!ConnectToLsa(pgContext)) - return FALSE; - - if (!MyLogonUser(pgContext->LsaHandle, - pgContext->AuthenticationPackage, - UserName, - Domain, - Password, - &pgContext->UserToken)) + Status = ConnectToLsa(pgContext); + if (!NT_SUCCESS(Status)) { - WARN("LogonUserW() failed\n"); + WARN("ConnectToLsa() failed\n"); + return FALSE; + } + + Status = MyLogonUser(pgContext->LsaHandle, + pgContext->AuthenticationPackage, + UserName, + Domain, + Password, + &pgContext->UserToken, + &SubStatus); + if (!NT_SUCCESS(Status)) + { + WARN("MyLogonUser() failed\n"); goto cleanup; } diff --git a/reactos/dll/win32/msgina/msgina.h b/reactos/dll/win32/msgina/msgina.h index 5507b10422b..a6ba264d0cf 100644 --- a/reactos/dll/win32/msgina/msgina.h +++ b/reactos/dll/win32/msgina/msgina.h @@ -81,18 +81,19 @@ typedef struct _GINA_UI /* lsa.c */ -BOOL +NTSTATUS ConnectToLsa( PGINA_CONTEXT pgContext); -BOOL +NTSTATUS MyLogonUser( HANDLE LsaHandle, ULONG AuthenticationPackage, LPWSTR lpszUsername, LPWSTR lpszDomain, LPWSTR lpszPassword, - PHANDLE phToken); + PHANDLE phToken, + PNTSTATUS SubStatus); /* msgina.c */ diff --git a/reactos/dll/win32/msgina/tui.c b/reactos/dll/win32/msgina/tui.c index fb40c421a2d..aa262232659 100644 --- a/reactos/dll/win32/msgina/tui.c +++ b/reactos/dll/win32/msgina/tui.c @@ -221,6 +221,8 @@ TUILockedSAS( HANDLE hToken; WCHAR UserName[256]; WCHAR Password[256]; + NTSTATUS SubStatus; + NTSTATUS Status; TRACE("TUILockedSAS()\n"); @@ -235,17 +237,23 @@ TUILockedSAS( if (!ReadString(IDS_ASKFORPASSWORD, Password, 256, FALSE)) return WLX_SAS_ACTION_NONE; - if (!ConnectToLsa(pgContext)) - return WLX_SAS_ACTION_NONE; - - if (!MyLogonUser(pgContext->LsaHandle, - pgContext->AuthenticationPackage, - UserName, - NULL, - Password, - &hToken)) + Status = ConnectToLsa(pgContext); + if (!NT_SUCCESS(Status)) { - WARN("LogonUserW() failed\n"); + WARN("ConnectToLsa() failed\n"); + return WLX_SAS_ACTION_NONE; + } + + Status = MyLogonUser(pgContext->LsaHandle, + pgContext->AuthenticationPackage, + UserName, + NULL, + Password, + &hToken, + &SubStatus); + if (!NT_SUCCESS(Status)) + { + WARN("MyLogonUser() failed\n"); return WLX_SAS_ACTION_NONE; } From 447234095775f605505dca229f75d9492f544789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 1 Mar 2014 22:42:38 +0000 Subject: [PATCH 024/419] [FTP] Fix download with ftp.exe, the problem was that we didn't switch download mode to binary when needed, because of idiotic defines used that where pointless here. We have this bug since revision 12776... Patch by Alexander Varnin, see CORE-3682 for details. CORE-3682 #resolve #comment Committed in revision, cheers ;) svn path=/trunk/; revision=62372 --- reactos/base/applications/network/ftp/cmds.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/reactos/base/applications/network/ftp/cmds.c b/reactos/base/applications/network/ftp/cmds.c index 4b9c08df167..dd752ec7ab9 100644 --- a/reactos/base/applications/network/ftp/cmds.c +++ b/reactos/base/applications/network/ftp/cmds.c @@ -85,18 +85,11 @@ void setpeer(int argc, const char *argv[]) } host = hookup(argv[1], portnum); if (host) { -#if defined(unix) && NBBY == 8 int overbose; -#endif connected = 1; if (autologin) (void) login(argv[1]); -#if defined(unix) && NBBY == 8 -/* - * this ifdef is to keep someone form "porting" this to an incompatible - * system and not checking this out. This way they have to think about it. - */ overbose = verbose; if (debug == 0) verbose = -1; @@ -119,7 +112,7 @@ void setpeer(int argc, const char *argv[]) *cp = c; } if (!strncmp(reply_string, "215 UNIX Type: L8", 17)) { - setbinary(); + setbinary(0, NULL); /* allbinary = 1; this violates the RFC */ if (overbose) printf("Using %s mode to transfer files.\n", @@ -130,7 +123,6 @@ void setpeer(int argc, const char *argv[]) "Remember to set tenex mode when transfering binary files from this machine.\n"); } verbose = overbose; -#endif /* unix */ } (void) fflush(stdout); } From fc63b50ede5ecbb8628dabaa7d27ab5906aa349d Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 11:49:18 +0000 Subject: [PATCH 025/419] [NTOSKRNL] * Generate a trace when we hit this issue. svn path=/trunk/; revision=62375 --- reactos/ntoskrnl/mm/ARM3/virtual.c | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/ntoskrnl/mm/ARM3/virtual.c b/reactos/ntoskrnl/mm/ARM3/virtual.c index 5fd8d048c80..09e0f6810e0 100644 --- a/reactos/ntoskrnl/mm/ARM3/virtual.c +++ b/reactos/ntoskrnl/mm/ARM3/virtual.c @@ -5300,6 +5300,7 @@ MmGetPhysicalAddress(PVOID Address) } DPRINT1("MM:MmGetPhysicalAddressFailed base address was %p\n", Address); + KeRosDumpStackFrames(NULL, 20); PhysicalAddress.QuadPart = 0; return PhysicalAddress; } From acfa62fbeb6f541c8751df1422e204e9f273b93c Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 12:27:42 +0000 Subject: [PATCH 026/419] [NTOSKRNL] * Move the trace call before the debug print. svn path=/trunk/; revision=62376 --- reactos/ntoskrnl/mm/ARM3/virtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/mm/ARM3/virtual.c b/reactos/ntoskrnl/mm/ARM3/virtual.c index 09e0f6810e0..4630f52209d 100644 --- a/reactos/ntoskrnl/mm/ARM3/virtual.c +++ b/reactos/ntoskrnl/mm/ARM3/virtual.c @@ -5299,8 +5299,8 @@ MmGetPhysicalAddress(PVOID Address) } } - DPRINT1("MM:MmGetPhysicalAddressFailed base address was %p\n", Address); KeRosDumpStackFrames(NULL, 20); + DPRINT1("MM:MmGetPhysicalAddressFailed base address was %p\n", Address); PhysicalAddress.QuadPart = 0; return PhysicalAddress; } From 3958819ba0f6ba7c649fd7e3d85e23d310629c05 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 13:01:16 +0000 Subject: [PATCH 027/419] [NTOSKRNL] * Print RealFrameCount here. svn path=/trunk/; revision=62377 --- reactos/ntoskrnl/ke/bug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index 9782230a0b9..820201f69fc 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -275,6 +275,7 @@ KeRosDumpStackFrames(IN PULONG_PTR Frame OPTIONAL, { /* Get the current frames (skip the two. One for the dumper, one for the caller) */ RealFrameCount = RtlCaptureStackBackTrace(2, FrameCount, (PVOID*)Frames, NULL); + DPRINT1("RealFrameCount =%lu\n", RealFrameCount); /* Dump them */ KeRosDumpStackFrameArray(Frames, RealFrameCount); From e46cb53319036bc919a8aa41d88190af8ee0bbad Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 17:06:37 +0000 Subject: [PATCH 028/419] [TRANSLATIONS] * Turkish translation update by Erdem Ersoy. CORE-7861 svn path=/trunk/; revision=62380 --- reactos/base/applications/calc/lang/tr-TR.rc | 2 +- .../base/applications/charmap/lang/tr-TR.rc | 4 +- .../games/solitaire/lang/tr-TR.rc | 10 +- .../base/applications/games/solitaire/rsrc.rc | 6 +- .../applications/games/spider/lang/tr-TR.rc | 8 +- .../base/applications/games/spider/rsrc.rc | 6 +- .../applications/games/winmine/lang/tr-TR.rc | 26 +- .../base/applications/games/winmine/rsrc.rc | 6 +- .../base/applications/magnify/lang/tr-TR.rc | 8 +- reactos/base/applications/magnify/magnify.rc | 6 +- .../base/applications/msconfig/lang/tr-TR.rc | 10 +- .../mscutils/devmgmt/lang/tr-TR.rc | 2 +- .../mscutils/devmgmt_new/lang/tr-TR.rc | 2 +- .../mscutils/eventvwr/lang/tr-TR.rc | 2 +- .../mscutils/servman/lang/tr-TR.rc | 6 +- .../base/applications/mspaint/lang/tr-TR.rc | 2 +- .../base/applications/notepad/lang/tr-TR.rc | 50 ++-- reactos/base/applications/notepad/rsrc.rc | 6 +- reactos/base/applications/rapps/lang/tr-TR.rc | 2 +- .../base/applications/regedit/lang/tr-TR.rc | 2 +- reactos/base/applications/winhlp32/lang/Tr.rc | 2 +- reactos/base/applications/wordpad/lang/Tr.rc | 6 +- reactos/boot/freeldr/fdebug/lang/tr-TR.rc | 2 +- reactos/dll/cpl/desk/lang/tr-TR.rc | 4 +- reactos/dll/cpl/input/lang/tr-TR.rc | 6 +- reactos/dll/cpl/intl/lang/tr-TR.rc | 12 +- reactos/dll/cpl/main/lang/tr-TR.rc | 2 +- reactos/dll/win32/crypt32/lang/crypt32_Tr.rc | 22 +- reactos/dll/win32/cryptui/lang/cryptui_Tr.rc | 24 +- reactos/dll/win32/devmgr/devmgr.rc | 3 + reactos/dll/win32/devmgr/lang/tr-TR.rc | 239 ++++++++++++++++++ reactos/dll/win32/hhctrl.ocx/hhctrl.rc | 6 +- reactos/dll/win32/hhctrl.ocx/lang/Tr.rc | 22 +- reactos/dll/win32/iccvid/lang/iccvid_Tr.rc | 6 +- reactos/dll/win32/iccvid/rsrc.rc | 6 +- 35 files changed, 385 insertions(+), 143 deletions(-) create mode 100644 reactos/dll/win32/devmgr/lang/tr-TR.rc diff --git a/reactos/base/applications/calc/lang/tr-TR.rc b/reactos/base/applications/calc/lang/tr-TR.rc index 8ba7251007f..daa77611be1 100644 --- a/reactos/base/applications/calc/lang/tr-TR.rc +++ b/reactos/base/applications/calc/lang/tr-TR.rc @@ -415,7 +415,7 @@ END STRINGTABLE BEGIN - IDS_STRING_LICENSE "Hesap Makinesi, GNU GPL ile yayınlanan özgür bir yazılımdır.\r\n\r\nGNU GPL'nin bir tıpkısını buradan elde edebilirsiniz:\r\nhttp://www.gnu.org/licenses/gpl.html\r\n\r\nBir de GNU GPL'nin çevirilerini buradan elde edebilirsiniz:\r\nhttp://www.gnu.org/licenses/translations.html" + IDS_STRING_LICENSE "Hesap Makinesi, GNU GPL ile yayınlanan özgür bir yazılımdır.\r\n\r\nGNU GPL'nin bir sûretini buradan elde edebilirsiniz:\r\nhttp://www.gnu.org/licenses/gpl.html\r\n\r\nBir de GNU GPL'nin çevirilerini buradan elde edebilirsiniz:\r\nhttp://www.gnu.org/licenses/translations.html" IDS_MATH_ERROR "Yanlışlık" IDS_QUICKHELP "Hızlı Yardım" END diff --git a/reactos/base/applications/charmap/lang/tr-TR.rc b/reactos/base/applications/charmap/lang/tr-TR.rc index fff29158cba..6a8e3ac344f 100644 --- a/reactos/base/applications/charmap/lang/tr-TR.rc +++ b/reactos/base/applications/charmap/lang/tr-TR.rc @@ -32,7 +32,7 @@ BEGIN PUSHBUTTON "Ara", IDC_BUTTON_SEARCH, 200, 44, 50, 14 EDITTEXT IDC_EDIT_SEARCH, 72, 44, 116, 14, ES_AUTOHSCROLL LTEXT "Ada Göre Ara:", IDC_STATIC, 8, 48, 42, 8 - LTEXT "Evrenlik Düzgü:", IDC_STATIC, 200, 8, 30, 8 + LTEXT "Evrenlik Kod:", IDC_STATIC, 200, 8, 30, 8 EDITTEXT IDC_EDIT_UNICODE, 236, 4, 28, 12, ES_AUTOHSCROLL END @@ -50,7 +50,7 @@ END STRINGTABLE BEGIN - IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgürdür, yâni bu yazılım Özgür Yazılım Vakfı'nın yayınladığı GNU Umûmî Kamu Ruhsatı'nın 2. sürümü veyâ daha sonraki sürümleri altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği umuduyla dağıtılmıştır, ancak bilhassa SATILABİLİRLİK ve BELİRLİ BİR AMACA UYGUNLUK açısından olmak üzere bu yazılımın hiçbir güvencesi yoktur. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretine de iye olmanız gerekir, eğer yoksa Özgür Yazılım Vakfı A.Ş.'ne (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." IDS_ABOUT "&Hakkında" IDS_TITLE "Karakter Eşlem" END diff --git a/reactos/base/applications/games/solitaire/lang/tr-TR.rc b/reactos/base/applications/games/solitaire/lang/tr-TR.rc index 3cc00e2d696..26eb43921ab 100644 --- a/reactos/base/applications/games/solitaire/lang/tr-TR.rc +++ b/reactos/base/applications/games/solitaire/lang/tr-TR.rc @@ -16,7 +16,7 @@ CAPTION "Seçenekler" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Kâğıtlar", -1, 7, 7, 90, 40 - AUTORADIOBUTTON "T&ekli Çek", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Tekli Çek", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "&Üçlü Çek", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 AUTOCHECKBOX "&Süreyi Göster", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED AUTOCHECKBOX "&Durum Çubuğu", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP @@ -25,7 +25,7 @@ BEGIN END IDD_CARDBACK DIALOGEX 6, 6, 186, 104 -CAPTION "Deste Seç" +CAPTION "Kâğıt Arkalığı Seçme" FONT 8, "MS Shell Dlg" STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT BEGIN @@ -51,9 +51,9 @@ STRINGTABLE BEGIN IDS_SOL_NAME "Solitaire" IDS_SOL_ABOUT "Solitaire, J Brown eliyle yapılmıştır.\n\nCardLib sürümü: 1.0" - IDS_SOL_QUIT "Bu oyundan çıkmak ister misiniz?" + IDS_SOL_QUIT "Bu oyundan çıkılsın mı?" IDS_SOL_WIN "Tebrikler, kazandınız!" - IDS_SOL_DEAL "Tekrar dağıtılsın mı?" + IDS_SOL_DEAL "Yine dağıtılsın mı?" END /* Menus */ @@ -71,7 +71,7 @@ BEGIN END POPUP "&Yardım" BEGIN - MENUITEM "&Yardım Konuları\tF1", IDM_HELP_CONTENTS + MENUITEM "&İçindekiler\tF1", IDM_HELP_CONTENTS MENUITEM "&Hakkında", IDM_HELP_ABOUT END END diff --git a/reactos/base/applications/games/solitaire/rsrc.rc b/reactos/base/applications/games/solitaire/rsrc.rc index 2ed6826c84e..b2c8779d14e 100644 --- a/reactos/base/applications/games/solitaire/rsrc.rc +++ b/reactos/base/applications/games/solitaire/rsrc.rc @@ -78,6 +78,9 @@ IDI_SOLITAIRE ICON "solitaire.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif @@ -87,9 +90,6 @@ IDI_SOLITAIRE ICON "solitaire.ico" #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/games/spider/lang/tr-TR.rc b/reactos/base/applications/games/spider/lang/tr-TR.rc index 2f501624c41..515d791e30a 100644 --- a/reactos/base/applications/games/spider/lang/tr-TR.rc +++ b/reactos/base/applications/games/spider/lang/tr-TR.rc @@ -11,7 +11,7 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT /* Dialogs */ IDD_CARDBACK DIALOGEX 6, 6, 186, 104 -CAPTION "Deste Seç" +CAPTION "Kâğıt Arkalığı Seçme" FONT 8, "MS Shell Dlg" STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | DS_SHELLFONT BEGIN @@ -49,9 +49,9 @@ STRINGTABLE BEGIN IDS_SPI_NAME "Örümcek Solitaire" IDS_SPI_ABOUT "Örümcek Solitaire, Gregor Schneider eliyle yapılmıştır.\n\nCardLib sürümü: 1.0" - IDS_SPI_QUIT "Bu oyundan çıkmak ister misiniz?" + IDS_SPI_QUIT "Bu oyundan çıkılsın mı?" IDS_SPI_WIN "Tebrikler, kazandınız!" - IDS_SPI_DEAL "Tekrar dağıtılsın mı?" + IDS_SPI_DEAL "Yine dağıtılsın mı?" END /* Menus */ @@ -68,7 +68,7 @@ BEGIN END POPUP "&Yardım" BEGIN - MENUITEM "&Yardım Konuları\tF1", IDM_HELP_CONTENTS + MENUITEM "&İçindekiler\tF1", IDM_HELP_CONTENTS MENUITEM "&Hakkında", IDM_HELP_ABOUT END END diff --git a/reactos/base/applications/games/spider/rsrc.rc b/reactos/base/applications/games/spider/rsrc.rc index ffe6ea7a272..b7b08e2c216 100644 --- a/reactos/base/applications/games/spider/rsrc.rc +++ b/reactos/base/applications/games/spider/rsrc.rc @@ -57,15 +57,15 @@ IDI_SPIDER ICON "spider.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/games/winmine/lang/tr-TR.rc b/reactos/base/applications/games/winmine/lang/tr-TR.rc index bea9f4fd2a9..b75af37a7c6 100644 --- a/reactos/base/applications/games/winmine/lang/tr-TR.rc +++ b/reactos/base/applications/games/winmine/lang/tr-TR.rc @@ -5,22 +5,22 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT STRINGTABLE BEGIN IDS_APPNAME "Mayın Tarlası" - IDS_NOBODY "Hiç kimse" - IDS_ABOUT "Bu oyun, Joshua Thielen eliyle, 2000 yılında yapılmıştır." + IDS_NOBODY "Hiç Kimse" + IDS_ABOUT "Telif Hakkı: 2000 - Joshua Thielen" END MENU_WINEMINE MENU BEGIN - POPUP "&Oyun" + POPUP "&Seçenekler" BEGIN MENUITEM "&Yeni Oyun\tF2", IDM_NEW MENUITEM SEPARATOR - MENUITEM "İ&mleme", IDM_MARKQ + MENUITEM "&Soru İmiyle İmleme", IDM_MARKQ MENUITEM SEPARATOR - MENUITEM "&Başlangıç", IDM_BEGINNER - MENUITEM "&Orta", IDM_ADVANCED - MENUITEM "&İleri", IDM_EXPERT - MENUITEM "&Değişik...", IDM_CUSTOM + MENUITEM "&Acemî", IDM_BEGINNER + MENUITEM "&Gelişmiş", IDM_ADVANCED + MENUITEM "&Usta", IDM_EXPERT + MENUITEM "&Husûsî...", IDM_CUSTOM MENUITEM SEPARATOR MENUITEM "&Çıkış\tAlt+X", IDM_EXIT END @@ -37,9 +37,9 @@ CAPTION "En Kısa Süreler" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "En Kısa Süreler", -1, 10, 10, 140, 45 - LTEXT "Başlangıç", -1, 20, 20, 40, 8 - LTEXT "Orta", -1, 20, 30, 40, 8 - LTEXT "İleri", -1, 20, 40, 40, 8 + LTEXT "Acemî", -1, 20, 20, 40, 8 + LTEXT "Gelişmiş", -1, 20, 30, 40, 8 + LTEXT "Usta", -1, 20, 40, 40, 8 LTEXT "999", IDC_TIME1, 70, 20, 15, 8 LTEXT "999", IDC_TIME2, 70, 30, 15, 8 LTEXT "999", IDC_TIME3, 70, 40, 15, 8 @@ -54,14 +54,14 @@ STYLE DS_MODALFRAME | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_POPUP | DS_SHELL CAPTION "Tebrikler!" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Adınızı Giriniz:", -1, 10, 10, 150, 10 + LTEXT "Adınızı giriniz.", -1, 10, 10, 150, 10 EDITTEXT IDC_EDITNAME, 25, 20, 110, 12 DEFPUSHBUTTON "Tamam", IDOK, 60, 40, 40, 15 END DLG_CUSTOM DIALOGEX 0, 0, 100, 100 STYLE DS_MODALFRAME | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_POPUP | DS_SHELLFONT -CAPTION "Değişik" +CAPTION "Husûsî" FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Yataç Sayısı:", -1, 5, 5, 30, 10 diff --git a/reactos/base/applications/games/winmine/rsrc.rc b/reactos/base/applications/games/winmine/rsrc.rc index 76cbfeb387c..2c8be76accd 100644 --- a/reactos/base/applications/games/winmine/rsrc.rc +++ b/reactos/base/applications/games/winmine/rsrc.rc @@ -111,15 +111,15 @@ MINES BITMAP "rc/mines.bmp" #ifdef LANGUAGE_SL_SI #include "lang/sl-SI.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/magnify/lang/tr-TR.rc b/reactos/base/applications/magnify/lang/tr-TR.rc index 6447beda58e..3bfd90af38f 100644 --- a/reactos/base/applications/magnify/lang/tr-TR.rc +++ b/reactos/base/applications/magnify/lang/tr-TR.rc @@ -10,7 +10,7 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT IDC_MAGNIFIER MENU BEGIN - POPUP "&Seçke" + POPUP "&Kütük" BEGIN MENUITEM "&Çıkış", IDM_EXIT MENUITEM "&Seçenekler...", IDM_OPTIONS @@ -53,7 +53,7 @@ BEGIN BS_AUTOCHECKBOX | WS_TABSTOP, 18, 54, 114, 10 CONTROL "&Metin Düzenlemesini İzle", IDC_FOLLOWTEXTEDITINGCHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 18, 66, 114, 10 - CONTROL "&Renkleri Ters Çevir", IDC_INVERTCOLORSCHECK, "Button", + CONTROL "&Renkleri Evir", IDC_INVERTCOLORSCHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 18, 102, 114, 10 CONTROL "&Simge Durumunda Başlat", IDC_STARTMINIMIZEDCHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 18, 114, 114, 10 @@ -68,8 +68,8 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Tamam", IDOK, 193, 76, 50, 14 ICON IDI_ICON, IDC_STATIC, 7, 17, 20, 20 - LTEXT "Büyüteç, hafif görme engelli kullanıcıların en az çaba harcamaları için tasarlanmıştır. Görme engelli bir çok kullanıcı, günlük kullanım için bu aracı kullanmaya gereksinim duyacaktır.", IDC_STATIC, 36, 7, 207, 33 - CONTROL "Bunu bir daha gösterme.", IDC_SHOWWARNINGCHECK, "Button", + LTEXT "Büyüteç, yeğni görme bozukluğu olan kullanıcılara en yüksek düzeydeki işlevliliği sağlamak için tasarlanmıştır. Görme bozukluğu olan birçok kullanıcı, günlük kullanım için yüksek işlevlikli bir büyütme aracına gereksinim duyacaktır.", IDC_STATIC, 36, 7, 207, 33 + CONTROL "Bu iletiyi bir daha gösterme.", IDC_SHOWWARNINGCHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10 END diff --git a/reactos/base/applications/magnify/magnify.rc b/reactos/base/applications/magnify/magnify.rc index 2ab65781b1d..8d59c35104a 100644 --- a/reactos/base/applications/magnify/magnify.rc +++ b/reactos/base/applications/magnify/magnify.rc @@ -60,15 +60,15 @@ IDI_ICON ICON "res/magnify.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/msconfig/lang/tr-TR.rc b/reactos/base/applications/msconfig/lang/tr-TR.rc index 09373fe9444..7d5cd240e18 100644 --- a/reactos/base/applications/msconfig/lang/tr-TR.rc +++ b/reactos/base/applications/msconfig/lang/tr-TR.rc @@ -22,7 +22,7 @@ BEGIN CONTROL "List3", IDC_STARTUP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 148 PUSHBUTTON "&Hepsini Etkinleştir", IDC_BTN_STARTUP_ACTIVATE, 223, 155, 66, 14 - PUSHBUTTON "H&epsini Devre Dışı Bırak", IDC_BTN_STARTUP_DEACTIVATE, 295, 155, 66, 14 + PUSHBUTTON "H&epsini Edilginleştir", IDC_BTN_STARTUP_DEACTIVATE, 295, 155, 66, 14 END IDD_SYSTEM_PAGE DIALOGEX 0, 0, 362, 175 @@ -35,12 +35,12 @@ BEGIN PUSHBUTTON "B&ir Yukarı Taşı", IDC_BTN_SYSTEM_UP, 290, 5, 66, 14 PUSHBUTTON "Bi&r Aşağı Taşı", IDC_BTN_SYSTEM_DOWN, 290, 25, 66, 14 PUSHBUTTON "E&tkinleştir", IDC_BTN_SYSTEM_ENABLE, 290, 50, 66, 14 - PUSHBUTTON "&Devre Dışı Bırak", IDC_BTN_SYSTEM_DISABLE, 290, 70, 66, 14 + PUSHBUTTON "E&dilginleştir", IDC_BTN_SYSTEM_DISABLE, 290, 70, 66, 14 PUSHBUTTON "&Ara", IDC_BTN_SYSTEM_FIND, 290, 95, 66, 14 - PUSHBUTTON "Ye&ni", IDC_BTN_SYSTEM_NEW, 290, 115, 66, 14 + PUSHBUTTON "&Yeni", IDC_BTN_SYSTEM_NEW, 290, 115, 66, 14 PUSHBUTTON "De&ğiştir", IDC_BTN_SYSTEM_EDIT, 290, 135, 66, 14 PUSHBUTTON "&Hepsini Etkinleştir", IDC_BTN_SYSTEM_ACTIVATE, 123, 155, 66, 14 - PUSHBUTTON "H&epsini Devre Dışı Bırak", IDC_BTN_SYSTEM_DEACTIVATE, 195, 155, 66, 14 + PUSHBUTTON "H&epsini Edilginleştir", IDC_BTN_SYSTEM_DEACTIVATE, 195, 155, 66, 14 END IDD_TOOLS_PAGE DIALOGEX 0, 0, 362, 175 @@ -60,7 +60,7 @@ BEGIN CONTROL "List1", IDC_SERVICES_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 2, 1, 360, 148 PUSHBUTTON "&Hepsini Etkinleştir", IDC_BTN_SERVICES_ACTIVATE, 223, 155, 66, 14 - PUSHBUTTON "H&epsini Devre Dışı Bırak", IDC_BTN_SERVICES_DEACTIVATE, 295, 155, 66, 14 + PUSHBUTTON "H&epsini Edilginleştir", IDC_BTN_SERVICES_DEACTIVATE, 295, 155, 66, 14 END IDD_GENERAL_PAGE DIALOGEX 0, 0, 362, 175 diff --git a/reactos/base/applications/mscutils/devmgmt/lang/tr-TR.rc b/reactos/base/applications/mscutils/devmgmt/lang/tr-TR.rc index 23d3c64a80c..33f09cc9783 100644 --- a/reactos/base/applications/mscutils/devmgmt/lang/tr-TR.rc +++ b/reactos/base/applications/mscutils/devmgmt/lang/tr-TR.rc @@ -55,7 +55,7 @@ END STRINGTABLE BEGIN - IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgürdür, yâni bu yazılımı Özgür Yazılım Vakfı'nın yayınladığı GNU Umûmî Kamu Ruhsatı'nın 2. sürümü veyâ daha sonraki sürümleri altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bilhassa SATILABİLİRLİK ve BELİRLİ BİR AMACA UYGUNLUK açısından olmak üzere bu yazılımın HİÇBİR GÜVENCESİ YOKTUR. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretine de iye olmanız gerekir, eğer yoksa Özgür Yazılım Vakfı A.Ş.'ne (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." END STRINGTABLE diff --git a/reactos/base/applications/mscutils/devmgmt_new/lang/tr-TR.rc b/reactos/base/applications/mscutils/devmgmt_new/lang/tr-TR.rc index d693fa20529..b56b11ce701 100644 --- a/reactos/base/applications/mscutils/devmgmt_new/lang/tr-TR.rc +++ b/reactos/base/applications/mscutils/devmgmt_new/lang/tr-TR.rc @@ -48,7 +48,7 @@ END STRINGTABLE BEGIN - IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgürdür, yâni bu yazılımı Özgür Yazılım Vakfı'nın yayınladığı GNU Umûmî Kamu Ruhsatı'nın 2. sürümü veyâ daha sonraki sürümleri altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bilhassa SATILABİLİRLİK ve BELİRLİ BİR AMACA UYGUNLUK açısından olmak üzere bu yazılımın HİÇBİR GÜVENCESİ YOKTUR. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretine de iye olmanız gerekir, eğer yoksa Özgür Yazılım Vakfı A.Ş.'ne (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." END STRINGTABLE diff --git a/reactos/base/applications/mscutils/eventvwr/lang/tr-TR.rc b/reactos/base/applications/mscutils/eventvwr/lang/tr-TR.rc index be61b7c5014..39fbbdad68d 100644 --- a/reactos/base/applications/mscutils/eventvwr/lang/tr-TR.rc +++ b/reactos/base/applications/mscutils/eventvwr/lang/tr-TR.rc @@ -19,7 +19,7 @@ BEGIN MENUITEM "&Seçenekler", ID_OPTIONS POPUP "&Yardım" BEGIN - MENUITEM "&Yardım Konuları", IDM_HELP + MENUITEM "&Yardım", IDM_HELP MENUITEM SEPARATOR MENUITEM "&Hakkında", IDM_ABOUT END diff --git a/reactos/base/applications/mscutils/servman/lang/tr-TR.rc b/reactos/base/applications/mscutils/servman/lang/tr-TR.rc index ccff2c9b591..59c53842235 100644 --- a/reactos/base/applications/mscutils/servman/lang/tr-TR.rc +++ b/reactos/base/applications/mscutils/servman/lang/tr-TR.rc @@ -39,7 +39,7 @@ BEGIN END POPUP "&Yardım" BEGIN - MENUITEM "&Yardım Konuları", ID_HELP + MENUITEM "&Yardım", ID_HELP MENUITEM "&Hakkında", ID_ABOUT END END @@ -203,7 +203,7 @@ BEGIN IDS_SERVICES_STOPPED "Durdu" IDS_SERVICES_AUTO "Kendiliğinden" IDS_SERVICES_MAN "Elle" - IDS_SERVICES_DIS "Devre Dışı" + IDS_SERVICES_DIS "Edilgin" END STRINGTABLE @@ -211,7 +211,7 @@ BEGIN IDS_NUM_SERVICES "Hizmet Sayısı: %d" IDS_STOP_DEPENDS "%s durduğunda, bu hizmetler de durur:" IDS_NO_DEPENDS "" - IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgürdür, yâni bu yazılımı Özgür Yazılım Vakfı'nın yayınladığı GNU Umûmî Kamu Ruhsatı'nın 2. sürümü veyâ daha sonraki sürümleri altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bilhassa SATILABİLİRLİK ve BELİRLİ BİR AMACA UYGUNLUK açısından olmak üzere bu yazılımın HİÇBİR GÜVENCESİ YOKTUR. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretine de iye olmanız gerekir, eğer yoksa Özgür Yazılım Vakfı A.Ş.'ne (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." END STRINGTABLE diff --git a/reactos/base/applications/mspaint/lang/tr-TR.rc b/reactos/base/applications/mspaint/lang/tr-TR.rc index ad68b8a3ec0..16fdaeb6aab 100644 --- a/reactos/base/applications/mspaint/lang/tr-TR.rc +++ b/reactos/base/applications/mspaint/lang/tr-TR.rc @@ -186,7 +186,7 @@ BEGIN IDS_PROGRAMNAME "Görüntü Düzenleyicisi" IDS_WINDOWTITLE "%s - Görüntü Düzenleyicisi" IDS_INFOTITLE "Görüntü Düzenleyicisi" - IDS_INFOTEXT "Görüntü Düzenleyicisi, GNU Kısıtlı Umûmî Kamu Ruhsatı'nın (LGPL). sürümüyle ruhsatlıdır. (bkz: www.gnu.org)" + IDS_INFOTEXT "Görüntü Düzenleyicisi, GNU Kısıtlı Umûmî Kamu Ruhsatı'yla (LGPL'yle) ruhsatlıdır. (bkz: www.gnu.org)" IDS_SAVEPROMPTTEXT "%s için yapılan değişiklikler kaydedilsin mi?" IDS_DEFAULTFILENAME "Adsız.bmp" IDS_MINIATURETITLE "Küçüğü" diff --git a/reactos/base/applications/notepad/lang/tr-TR.rc b/reactos/base/applications/notepad/lang/tr-TR.rc index 38671e3a802..479194a757d 100644 --- a/reactos/base/applications/notepad/lang/tr-TR.rc +++ b/reactos/base/applications/notepad/lang/tr-TR.rc @@ -50,12 +50,12 @@ BEGIN MENUITEM "G&it...\tCtrl+G", CMD_GOTO MENUITEM SEPARATOR MENUITEM "&Tümünü Seç\tCtrl+A", CMD_SELECT_ALL - MENUITEM "&Şimdiki Zamanı Koy\tF5", CMD_TIME_DATE + MENUITEM "&Şimdiki Zamânı Koy\tF5", CMD_TIME_DATE END POPUP "&Biçim" BEGIN - MENUITEM "&Yataç Kaydır", CMD_WRAP - MENUITEM "Y&azı Türü...", CMD_FONT + MENUITEM "&Uzun Yataçları Kaydır", CMD_WRAP + MENUITEM "&Yazı Türü...", CMD_FONT END POPUP "&Görünüm" BEGIN @@ -63,9 +63,9 @@ BEGIN END POPUP "&Yardım" BEGIN - MENUITEM "&Yardım Konuları", CMD_HELP_CONTENTS - MENUITEM "Y&ardımda Ara", CMD_HELP_SEARCH - MENUITEM "Ya&rdım İçin Yardım", CMD_HELP_ON_HELP + MENUITEM "&İçindekiler", CMD_HELP_CONTENTS + MENUITEM "&Ara", CMD_HELP_SEARCH + MENUITEM "&Yardım İçin Yardım", CMD_HELP_ON_HELP MENUITEM SEPARATOR MENUITEM "&Bilgi", CMD_ABOUT MENUITEM "&Hakkında", CMD_ABOUT_WINE @@ -78,22 +78,22 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Sayfa Yapısı" BEGIN - LTEXT "Üst Bilgi:", 0x140, 10, 07, 40, 15 + LTEXT "&Üst Bilgi:", 0x140, 10, 07, 40, 15 EDITTEXT 0x141, 60, 05, 110, 12, WS_BORDER | WS_TABSTOP - LTEXT "Alt Bilgi:", 0x142, 10, 24, 40, 15 + LTEXT "&Alt Bilgi:", 0x142, 10, 24, 40, 15 EDITTEXT 0x143, 60, 22, 110, 12, WS_BORDER | WS_TABSTOP GROUPBOX "Kıyı Payı:", 0x144, 10, 43, 160, 45 - LTEXT "Sol:", 0x145, 20, 55, 30, 10, WS_CHILD + LTEXT "&Sol:", 0x145, 20, 55, 30, 10, WS_CHILD EDITTEXT /*STRING_PAGESETUP_LEFTVALUE,*/ 0x147, 50, 55, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP - LTEXT "Üst:", 0x148, 20, 73, 30, 10, WS_CHILD + LTEXT "Üs&t:", 0x148, 20, 73, 30, 10, WS_CHILD EDITTEXT /*STRING_PAGESETUP_TOPVALUE,*/ 0x14A, 50, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP - LTEXT "Sağ:", 0x14B, 100, 55, 30, 10, WS_CHILD + LTEXT "Sa&ğ:", 0x14B, 100, 55, 30, 10, WS_CHILD EDITTEXT /*STRING_PAGESETUP_RIGHTVALUE,*/ 0x14D, 130, 55, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP - LTEXT "Alt:", 0x14E, 100, 73, 30, 10, WS_CHILD + LTEXT "A<:", 0x14E, 100, 73, 30, 10, WS_CHILD EDITTEXT /*STRING_PAGESETUP_BOTTOMVALUE,*/ 0x150, 130, 73, 35, 11, WS_CHILD | WS_BORDER | WS_TABSTOP DEFPUSHBUTTON "Tamam", IDOK, 180, 3, 40, 15, WS_TABSTOP PUSHBUTTON "İptal", IDCANCEL, 180, 21, 40, 15, WS_TABSTOP - PUSHBUTTON "Yardım", IDHELP, 180, 39, 40, 15, WS_TABSTOP + PUSHBUTTON "&Yardım", IDHELP, 180, 39, 40, 15, WS_TABSTOP END /* Dialog 'Encoding' */ @@ -125,16 +125,16 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU CAPTION "Metin Düzenleyicisi Hakkında" FONT 8, "MS Shell Dlg" BEGIN - CONTROL "Metin Düzenleyicisi - Sürüm: 1.0\r\nTelif Hakları: 1997,98 Marcel Baur (mbaur@g26.ethz.ch)\r\n 2000 Mike McCormack (Mike_McCormack@looksmart.com.au)\r\n 2002 Sylvain Petreolle (spetreolle@yahoo.fr)\r\n 2002 Andriy Palamarchuk\r\n", -1, "Static", SS_LEFTNOWORDWRAP | WS_GROUP, 46, 7, 232, 39 + CONTROL "Metin Düzenleyicisi - Sürüm: 1.0\r\nTelif Hakları:\r\n1997,98 - Marcel Baur (mbaur@g26.ethz.ch)\r\n2000 - Mike McCormack (Mike_McCormack@looksmart.com.au)\r\n2002 - Sylvain Petreolle (spetreolle@yahoo.fr)\r\n2002 - Andriy Palamarchuk\r\n", -1, "Static", SS_LEFTNOWORDWRAP | WS_GROUP, 46, 7, 232, 39 CONTROL " ", -1, "Static", 0x50000000, 8, 48, 272, 11 - DEFPUSHBUTTON "Tamam", IDOK, 114, 149, 44, 15, WS_GROUP + DEFPUSHBUTTON "Kapat", IDOK, 114, 149, 44, 15, WS_GROUP ICON IDI_NPICON, -1, 12, 9, 20, 30 EDITTEXT IDC_LICENSE, 8, 64, 272, 81, ES_MULTILINE | ES_READONLY | WS_VSCROLL END STRINGTABLE BEGIN - STRING_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgürdür, yâni bu yazılımı Özgür Yazılım Vakfı'nın yayınladığı GNU Umûmî Kamu Ruhsatı'nın 2. sürümü veyâ daha sonraki sürümleri altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bilhassa SATILABİLİRLİK ve BELİRLİ BİR AMACA UYGUNLUK açısından olmak üzere bu yazılımın HİÇBİR GÜVENCESİ YOKTUR. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretine de iye olmanız gerekir, eğer yoksa Özgür Yazılım Vakfı A.Ş.'ne (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + STRING_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." END STRINGTABLE @@ -152,18 +152,18 @@ BEGIN STRING_UNTITLED "Adsız" STRING_ALL_FILES "Tüm Kütükler (*.*)" STRING_TEXT_FILES_TXT "Metin Belgeleri (*.txt)" - STRING_TOOLARGE "%s kütüğü Metin Düzenleyicisi için çok büyük. Bu kütüğü düzenlemek için başka bir düzenleyici kullanınız." - STRING_NOTEXT "Hiçbir şey yazmadınız. Birşeyler yazıp yeniden deneyiniz." + STRING_TOOLARGE "%s kütüğü Metin Düzenleyicisi için çok büyük. Başka bir düzenleyici kullanınız." + STRING_NOTEXT "Hiçbir metin girmediniz. Birşeyler yazıp yeniden deneyiniz." STRING_DOESNOTEXIST "%s kütüğü yok. Yeni bir kütük oluşturmak ister misiniz?" - STRING_NOTSAVED "%s kütüğündeki metin değiştirilmiş. Değişiklikleri kaydetmek istiyor musunuz?" - STRING_NOTFOUND "%s kütüğü bulunamadı." - STRING_OUT_OF_MEMORY "Bu işlemi bitirmek için gereken bellek yetersiz. Kullanılabilen belleği arttırmak için bir veyâ daha çok uygulamadan çıkıp bu işlemi yeniden deneyiniz." - STRING_CANNOTFIND "%s kütüğü bulunamadı." + STRING_NOTSAVED "%s kütüğü değiştirilmiş. Değişiklikleri kaydetmek ister misiniz?" + STRING_NOTFOUND "%s bulunamadı." + STRING_OUT_OF_MEMORY "Bu işi bitirmek için bellek yetersiz. Kullanılabilen belleği arttırmak için bir ya da daha çok uygulama kapatınız." + STRING_CANNOTFIND "%s bulunamadı." STRING_ANSI "ANSI" - STRING_UNICODE "Evrenlik Düzgü" - STRING_UNICODE_BE "Evrenlik Düzgü (Büyük Sonlu)" + STRING_UNICODE "Evrenlik Kod" + STRING_UNICODE_BE "Evrenlik Kod (Büyük Sonlu)" STRING_UTF8 "UTF-8" - STRING_CRLF "Pencereler (CR + LF)" + STRING_CRLF "Windows (CR + LF)" STRING_LF "UNIX (LF)" STRING_CR "Mac (CR)" STRING_LINE_COLUMN "%d. Yataç, %d. Dikeç" diff --git a/reactos/base/applications/notepad/rsrc.rc b/reactos/base/applications/notepad/rsrc.rc index 0355409bc85..2c1b5b4278f 100644 --- a/reactos/base/applications/notepad/rsrc.rc +++ b/reactos/base/applications/notepad/rsrc.rc @@ -115,6 +115,9 @@ IDI_NPICON ICON "res/notepad.ico" #ifdef LANGUAGE_SL_SI #include "lang/sl-SI.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif @@ -124,9 +127,6 @@ IDI_NPICON ICON "res/notepad.ico" #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_ZH_CN #include "lang/zh-CN.rc" #endif diff --git a/reactos/base/applications/rapps/lang/tr-TR.rc b/reactos/base/applications/rapps/lang/tr-TR.rc index 97623391c34..71eb177d30b 100644 --- a/reactos/base/applications/rapps/lang/tr-TR.rc +++ b/reactos/base/applications/rapps/lang/tr-TR.rc @@ -24,7 +24,7 @@ BEGIN END POPUP "Y&ardım" BEGIN - MENUITEM "&Yardım Konuları", ID_HELP, GRAYED + MENUITEM "&Yardım", ID_HELP, GRAYED MENUITEM "&Hakkında", ID_ABOUT END END diff --git a/reactos/base/applications/regedit/lang/tr-TR.rc b/reactos/base/applications/regedit/lang/tr-TR.rc index 78f492c1f9c..6d480365bf0 100644 --- a/reactos/base/applications/regedit/lang/tr-TR.rc +++ b/reactos/base/applications/regedit/lang/tr-TR.rc @@ -357,7 +357,7 @@ BEGIN IDS_FLT_REGFILES_FLT "*.reg" IDS_FLT_HIVFILES "Yığın Dosyaları (*.*)" IDS_FLT_HIVFILES_FLT "*.*" - IDS_FLT_REGEDIT4 "Pencereler 9x ve Pencereler NT 4.0 Türündeki Değer Kütükleri (*.reg)" + IDS_FLT_REGEDIT4 "Windows 9x ve Windows NT 4.0 Türündeki Değer Kütükleri (*.reg)" IDS_FLT_REGEDIT4_FLT "*.reg" IDS_FLT_ALLFILES "Tüm Kütükler (*.*)" IDS_FLT_ALLFILES_FLT "*.*" diff --git a/reactos/base/applications/winhlp32/lang/Tr.rc b/reactos/base/applications/winhlp32/lang/Tr.rc index 32c2ba0d228..90aa19ebad2 100644 --- a/reactos/base/applications/winhlp32/lang/Tr.rc +++ b/reactos/base/applications/winhlp32/lang/Tr.rc @@ -57,7 +57,7 @@ MAIN_MENU MENU MENUITEM "&Dizge Renklerini Kullan", MNID_OPTS_SYSTEM_COLORS } POPUP "&Yardım" { - MENUITEM "&Yardım Konuları", MNID_HELP_HELPON + MENUITEM "&Yardım İçin Yardım", MNID_HELP_HELPON MENUITEM "H&er Zaman Üstte", MNID_HELP_HELPTOP MENUITEM SEPARATOR MENUITEM "&Hakkında", MNID_HELP_ABOUT diff --git a/reactos/base/applications/wordpad/lang/Tr.rc b/reactos/base/applications/wordpad/lang/Tr.rc index a627d381587..82915da531c 100644 --- a/reactos/base/applications/wordpad/lang/Tr.rc +++ b/reactos/base/applications/wordpad/lang/Tr.rc @@ -83,7 +83,7 @@ BEGIN MENUITEM "&Öğe İmi", ID_BULLET MENUITEM "&Paragraf...", ID_PARAFORMAT MENUITEM "&Sekme Durakları...", ID_TABSTOPS - POPUP "&Arkaplan" + POPUP "&Arka Plan" BEGIN MENUITEM "&Dizge Rengi\tCtrl+1", ID_BACK_1 MENUITEM "&Sarımtırak\tCtrl+2", ID_BACK_2 @@ -207,11 +207,11 @@ STRINGTABLE BEGIN STRING_ALL_FILES, "Tüm Kütükler (*.*)" STRING_TEXT_FILES_TXT, "Metin Belgeleri (*.txt)" - STRING_TEXT_FILES_UNICODE_TXT, "Evrenlik Düzgülü Metin Belgeleri (*.txt)" + STRING_TEXT_FILES_UNICODE_TXT, "Evrenlik Kodlu Metin Belgeleri (*.txt)" STRING_RICHTEXT_FILES_RTF, "Gelişmiş Metin Belgeleri (*.rtf)" STRING_NEWFILE_RICHTEXT, "Gelişmiş Metin Belgesi" STRING_NEWFILE_TXT, "Metin Belgesi" - STRING_NEWFILE_TXT_UNICODE, "Evrenlik Düzgülü Metin Belgesi" + STRING_NEWFILE_TXT_UNICODE, "Evrenlik Kodlu Metin Belgesi" STRING_PRINTER_FILES_PRN, "Yazıcı Kütükleri (*.PRN)" END diff --git a/reactos/boot/freeldr/fdebug/lang/tr-TR.rc b/reactos/boot/freeldr/fdebug/lang/tr-TR.rc index b2bfed1e108..7153091a68a 100644 --- a/reactos/boot/freeldr/fdebug/lang/tr-TR.rc +++ b/reactos/boot/freeldr/fdebug/lang/tr-TR.rc @@ -81,5 +81,5 @@ END STRINGTABLE BEGIN - IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgürdür, yâni bu yazılımı Özgür Yazılım Vakfı'nın yayınladığı GNU Umûmî Kamu Ruhsatı'nın 2. sürümü veyâ daha sonraki sürümleri altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bilhassa SATILABİLİRLİK ve BELİRLİ BİR AMACA UYGUNLUK açısından olmak üzere bu yazılımın HİÇBİR GÜVENCESİ YOKTUR. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretine de iye olmanız gerekir, eğer yoksa Özgür Yazılım Vakfı A.Ş.'ne (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." END diff --git a/reactos/dll/cpl/desk/lang/tr-TR.rc b/reactos/dll/cpl/desk/lang/tr-TR.rc index 96c6d900492..d235f51c71f 100644 --- a/reactos/dll/cpl/desk/lang/tr-TR.rc +++ b/reactos/dll/cpl/desk/lang/tr-TR.rc @@ -4,7 +4,7 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT IDD_BACKGROUND DIALOGEX 0, 0, 246, 204 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Arkagörünüm" +CAPTION "Arka Plan" FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_BACKGROUND_PREVIEW, "Static", SS_OWNERDRAW, 70, 10, 105, 80, 0 @@ -245,7 +245,7 @@ BEGIN IDS_ELEMENT_14 "Edilgin Seçke Öğeleri" IDS_ELEMENT_15 "İleti" IDS_ELEMENT_16 "Kaydırma Çubukları Denetimleri" - IDS_ELEMENT_17 "Uygulama Arkagörünümü" + IDS_ELEMENT_17 "Uygulama Arka Planı" IDS_ELEMENT_18 "Küçük Başlık Çubuğu" IDS_ELEMENT_19 "Simge Aralığı (Yatay)" IDS_ELEMENT_20 "Simge Aralığı (Dikey)" diff --git a/reactos/dll/cpl/input/lang/tr-TR.rc b/reactos/dll/cpl/input/lang/tr-TR.rc index 4bb6bb6e37d..55c4375481d 100644 --- a/reactos/dll/cpl/input/lang/tr-TR.rc +++ b/reactos/dll/cpl/input/lang/tr-TR.rc @@ -136,7 +136,7 @@ BEGIN IDS_CANADIAN_FRENCH_LEGACY_LAYOUT "Kanada Fransızcası (Eski)" IDS_CANADIAN_MULTILINGUAL_STD_LAYOUT "Kanada Çok Dilli Ölçün" IDS_CANTONESE_PHONETIC_LAYOUT "Kanton Lehçesi Tam Seslik" - IDS_CHINESE_SIMPLIFIED_MSPINYINIME30_LAYOUT "Çince (Bayağılaştırılmış) - Mikroyazılım Pinyin IME 3.0" + IDS_CHINESE_SIMPLIFIED_MSPINYINIME30_LAYOUT "Çince (Bayağılaştırılmış) - Microsoft Pinyin IME 3.0" IDS_CHINESE_SIMPLIFIED_NEIMA_LAYOUT "Çince (Bayağılaştırılmış) - NeiMa" IDS_CHINESE_SIMPLIFIED_QUANPIN_LAYOUT "Çince (Bayağılaştırılmış) - KuanPin" IDS_CHINESE_SIMPLIFIED_SHUANGPIN_LAYOUT "Çince (Bayağılaştırılmış) - ŞuangPin" @@ -144,14 +144,14 @@ BEGIN IDS_CHINESE_SIMPLIFIED_ZHENGMA_LAYOUT "Çince (Bayağılaştırılmış) - ZengMa" IDS_CHINESE_TRADITIONAL_ALPHANUMERIC_LAYOUT "Çince (Geleneklik) - Hârflik ve Sayılık" IDS_CHINESE_TRADITIONAL_ARRAY_LAYOUT "Çince (Geleneklik) - Düzen" - IDS_CHINESE_TRADITIONAL_BIG5CODE_LAYOUT "Çince (Geleneklik) - Big5 Düzgüsü" + IDS_CHINESE_TRADITIONAL_BIG5CODE_LAYOUT "Çince (Geleneklik) - Big5 Kodu" IDS_CHINESE_TRADITIONAL_CHANGJIE_LAYOUT "Çince (Geleneklik) - ÇangJi" IDS_CHINESE_TRADITIONAL_DAYI_LAYOUT "Çince (Geleneklik) - DaYi" IDS_CHINESE_TRADITIONAL_NEWCHANGJIE_LAYOUT "Çince (Geleneklik) - Yeni ÇangJi" IDS_CHINESE_TRADITIONAL_NEWPHONETIC_LAYOUT "Çince (Geleneklik) - Yeni Tam Seslik" IDS_CHINESE_TRADITIONAL_PHONETIC_LAYOUT "Çince (Geleneklik) - Tam Seslik" IDS_CHINESE_TRADITIONAL_QUICK_LAYOUT "Çince (Geleneklik) - Çabuk" - IDS_CHINESE_TRADITIONAL_UNICODE_LAYOUT "Çince (Geleneklik) - Evrenlik Düzgülük" + IDS_CHINESE_TRADITIONAL_UNICODE_LAYOUT "Çince (Geleneklik) - Evrenlik Kodluk" IDS_CHINESE_TRADITIONAL_USKEYBOARD_LAYOUT "Çince (Geleneklik) - ABD Düğme Takımı" IDS_CROATIAN_LAYOUT "Hırvatça" IDS_CZECH_LAYOUT "Çekçe" diff --git a/reactos/dll/cpl/intl/lang/tr-TR.rc b/reactos/dll/cpl/intl/lang/tr-TR.rc index 22e3b256998..26b34ee69c5 100644 --- a/reactos/dll/cpl/intl/lang/tr-TR.rc +++ b/reactos/dll/cpl/intl/lang/tr-TR.rc @@ -47,11 +47,11 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Gelişmiş" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Evrenlik Düzgülü Olmayan Çizeylemler İçin Dil", -1, 5, 5, 234, 90 + GROUPBOX "Evrenlik Kodlu Olmayan Çizeylemler İçin Dil", -1, 5, 5, 234, 90 COMBOBOX IDC_LANGUAGE_COMBO, 14, 75, 217, 160, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP | CBS_SORT - LTEXT "Bu dizge ayârı, Evrenlik Düzgülü olmayan çizeylemlerin seçkelerinin ve iletişim kutularının kendi dillerinde görüntülenmesini etkinleştirir. Bu ayar, Evrenlik Düzgülü çizeylemleri etkilemez ve bu ayar, bu bilgisayardaki tüm kullanıcıları etkiler.", -1, 14, 18, 223, 33 - LTEXT "Kullanmak istediğiniz Evrenlik Düzgülü olmayan çizeylemlerin dil sürümlerini karşılaştırmak için bir dil seçiniz:", -1, 14, 55, 223, 18 - GROUPBOX "Düzgü Sayfası Dönüştürme Çizelgesi", -1, 5, 101, 234, 88 + LTEXT "Bu dizge ayârı, Evrenlik Kodlu olmayan çizeylemlerin seçkelerinin ve iletişim kutularının kendi dillerinde görüntülenmesini etkinleştirir. Bu ayar, Evrenlik Kodlu çizeylemleri etkilemez ve bu ayar, bu bilgisayardaki tüm kullanıcıları etkiler.", -1, 14, 18, 223, 33 + LTEXT "Kullanmak istediğiniz Evrenlik Kodlu olmayan çizeylemlerin dil sürümlerini karşılaştırmak için bir dil seçiniz:", -1, 14, 55, 223, 18 + GROUPBOX "Kod Sayfası Dönüştürme Çizelgesi", -1, 5, 101, 234, 88 CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT | LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70 GROUPBOX "Öntanımlı Kullanıcı Hesâbı Ayarları", -1, 5, 193, 234, 30 CHECKBOX "Bu Kullanıcının Tüm Ayarlarını Öntanımlı Olarak Ayarla", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22, BS_MULTILINE @@ -200,8 +200,8 @@ BEGIN IDS_ERROR_SYMBOL_SEPARATE "Girilen kısa târih ayıracı yanlış simge(ler) içeriyor." IDS_ERROR_SYMBOL_FORMAT_SHORT "Girilen kısa târih biçimi yanlış simge(ler) içeriyor." IDS_ERROR_SYMBOL_FORMAT_LONG "Girilen uzun târih biçimi yanlış simge(ler) içeriyor." - IDS_ERROR_OEM_CODE_PAGE "OEM düzgü sayfasının okunmasında sorun var." - IDS_ERROR_ANSI_CODE_PAGE "ANSI düzgü sayfasının okunmasında sorun var." + IDS_ERROR_OEM_CODE_PAGE "OEM kod sayfasının okunmasında sorun var." + IDS_ERROR_ANSI_CODE_PAGE "ANSI kod sayfasının okunmasında sorun var." IDS_ERROR_INT_KEY_REG "HKCU\\Control Panel\\International dizininin açılmasında sorun var." IDS_ERROR_DEF_INT_KEY_REG "HKU\\.DEFAULT\\Control Panel\\International dizininin açılmasında sorun var." IDS_ERROR_NLS_KEY_REG "HKU\\.DEFAULT\\Control Panel\\International dizininin açılmasında sorun var." diff --git a/reactos/dll/cpl/main/lang/tr-TR.rc b/reactos/dll/cpl/main/lang/tr-TR.rc index 0a67db6fdc8..6eb7b9a4b72 100644 --- a/reactos/dll/cpl/main/lang/tr-TR.rc +++ b/reactos/dll/cpl/main/lang/tr-TR.rc @@ -66,7 +66,7 @@ BEGIN GROUPBOX "Tıklama Kilidi", -1, 5, 150, 236, 70 CHECKBOX "&Tıklama Kilidi'ni Aç", IDC_CHECK_CLICK_LOCK, 10, 160, 70, 20 PUSHBUTTON "&Ayarlar...", IDC_BUTTON_CLICK_LOCK, 172, 161, 60, 14 - LTEXT "Fâre düğmesine basılı tutmadan sürüklemeyi ve seçmeyi etkinleştirir. Kilitlemek için kısaca fâre düğmesine basınız. Bırakmak için fâre düğmesine tekrar basınız.", -1, 10, 180, 224, 30 + LTEXT "Fâre düğmesine basılı tutmadan sürüklemeyi ve seçmeyi etkinleştirir. Kilitlemek için kısaca fâre düğmesine basınız. Bırakmak için fâre düğmesine yine basınız.", -1, 10, 180, 224, 30 END IDD_PAGE_POINTER DIALOGEX 0, 0, 246, 228 diff --git a/reactos/dll/win32/crypt32/lang/crypt32_Tr.rc b/reactos/dll/win32/crypt32/lang/crypt32_Tr.rc index b69b3826c4a..dc2d15ab2f6 100644 --- a/reactos/dll/win32/crypt32/lang/crypt32_Tr.rc +++ b/reactos/dll/win32/crypt32/lang/crypt32_Tr.rc @@ -33,7 +33,7 @@ STRINGTABLE IDS_KEY_USAGE "Anahtar Kullanımı" IDS_CERT_POLICIES "Onay Belgesi İlkeleri" IDS_SUBJECT_KEY_IDENTIFIER "Konu Anahtarı Tanımlayıcısı" - IDS_CRL_REASON_CODE "CRL Neden Düzgüsü" + IDS_CRL_REASON_CODE "CRL Neden Kodu" IDS_CRL_DIST_POINTS "CRL Dağıtım Noktaları" IDS_ENHANCED_KEY_USAGE "Gelişmiş Anahtar Kullanımı" IDS_AUTHORITY_INFO_ACCESS "Yetkili Bilgi Erişimi" @@ -82,7 +82,7 @@ STRINGTABLE IDS_CROSS_CA_VERSION "Çapraz CA Sürümü" IDS_SERIALIZED_SIG_SERIAL_NUMBER "Dizilendirilmiş İmzâ Dizi Numarası" IDS_PRINCIPAL_NAME "Asıl Adı" - IDS_WINDOWS_PRODUCT_UPDATE "Pencereler Ürünü Şimdikileştirmesi" + IDS_WINDOWS_PRODUCT_UPDATE "Windows Ürünü Şimdikileştirmesi" IDS_ENROLLMENT_NAME_VALUE_PAIR "Kaydedilmiş Ad Değeri Çifti" IDS_OS_VERSION "İşletim Dizgesi Sürümü" IDS_ENROLLMENT_CSP "Kayıt CSP'si" @@ -109,7 +109,7 @@ STRINGTABLE IDS_PKCS_7_SIGNED_ENVELOPED "PKCS 7 İmzâlı Zarflı" IDS_PKCS_7_DIGESTED "PKCS 7 Özetlenmiş" IDS_PKCS_7_ENCRYPTED "PKCS 7 Şifreli" - IDS_PREVIOUS_CA_CERT_HASH "Bir Önceki CA Onay Belgesi Düzgüsü" + IDS_PREVIOUS_CA_CERT_HASH "Bir Önceki CA Onay Belgesi Kodu" IDS_CRL_VIRTUAL_BASE "Farazî Taban CRL Numarası" IDS_CRL_NEXT_PUBLISH "Bir Sonraki CRL Yayımlaması" IDS_CA_EXCHANGE "CA Şifreleme Onay Belgesi" @@ -129,24 +129,24 @@ STRINGTABLE IDS_REVOKE_REQUEST "İsteği İptal Et" IDS_QUERY_PENDING "Sorgu Beklemede" IDS_SORTED_CTL "Onay Belgesi Güven Dizelgesi" - IDS_ARCHIVED_KEY_CERT_HASH "Belgeliklenmiş Anahtar Onaylama Düzgüsü" + IDS_ARCHIVED_KEY_CERT_HASH "Belgeliklenmiş Anahtar Onaylama Kodu" IDS_PRIVATE_KEY_USAGE_PERIOD "Husûsî Anahtar Kullanım Dönemi" IDS_CLIENT_INFORMATION "İstemci Bilgisi" IDS_SERVER_AUTHENTICATION "Sunucu Yetkilendirmesi" IDS_CLIENT_AUTHENTICATION "İstemci Yetkilendirmesi" - IDS_CODE_SIGNING "Düzgü İmzâlama" + IDS_CODE_SIGNING "Kod İmzâlama" IDS_SECURE_EMAIL "Güvenli E-Posta" IDS_TIME_STAMPING "Zaman Damgalama" - IDS_MICROSOFT_TRUST_LIST_SIGNING "Mikroyazılım Güven Dizelgesi İmzâlaması" - IDS_MICROSOFT_TIME_STAMPING "Mikroyazılım Zaman Damgalaması" + IDS_MICROSOFT_TRUST_LIST_SIGNING "Microsoft Güven Dizelgesi İmzâlaması" + IDS_MICROSOFT_TIME_STAMPING "Microsoft Zaman Damgalaması" IDS_IPSEC_END_SYSTEM "IP Güvenlik Uç Dizgesi" IDS_IPSEC_TUNNEL "IP Güvenlik Tünel Sonu" IDS_IPSEC_USER "IP Güvenlik Kullanıcısı" IDS_EFS "Şifreleyici Kütük Dizgesi" - IDS_WHQL_CRYPTO "Pencereler Donanım Sürücüsü Doğrulaması" - IDS_NT5_CRYPTO "Pencereler Dizge Bileşeni Doğrulaması" - IDS_OEM_WHQL_CRYPTO "OEM Pencereler Dizge Bileşeni Doğrulaması" - IDS_EMBEDDED_NT_CRYPTO "Gömülü Pencereler Dizge Bileşeni Doğrulaması" + IDS_WHQL_CRYPTO "Windows Donanım Sürücüsü Doğrulaması" + IDS_NT5_CRYPTO "Windows Dizge Bileşeni Doğrulaması" + IDS_OEM_WHQL_CRYPTO "OEM Windows Dizge Bileşeni Doğrulaması" + IDS_EMBEDDED_NT_CRYPTO "Gömülü Windows Dizge Bileşeni Doğrulaması" IDS_KEY_PACK_LICENSES "Anahtar Paketi Rusatları" IDS_LICENSE_SERVER "Ruhsat Sunucusu Doğrulaması" IDS_SMART_CARD_LOGON "Akıllı Kart ile Oturum Açma" diff --git a/reactos/dll/win32/cryptui/lang/cryptui_Tr.rc b/reactos/dll/win32/cryptui/lang/cryptui_Tr.rc index 37f1245ebf7..9ec86034f09 100644 --- a/reactos/dll/win32/cryptui/lang/cryptui_Tr.rc +++ b/reactos/dll/win32/cryptui/lang/cryptui_Tr.rc @@ -51,16 +51,16 @@ STRINGTABLE IDS_FIELDS_CRITICAL_EXTENSIONS "Yalnızca Önemli Eklentiler" IDS_FIELDS_PROPERTIES "Yalnızca Husûsiyetler" IDS_FIELD_VERSION "Sürüm" - IDS_FIELD_SERIAL_NUMBER "Dizi numarası" + IDS_FIELD_SERIAL_NUMBER "Dizi Numarası" IDS_FIELD_ISSUER "Dağıtıcı" - IDS_FIELD_VALID_FROM "Şuradan geçerlidir" - IDS_FIELD_VALID_TO "Şuraya geçerlidir" + IDS_FIELD_VALID_FROM "Şuradan Geçerlidir" + IDS_FIELD_VALID_TO "Şuraya Geçerlidir" IDS_FIELD_SUBJECT "Konu" - IDS_FIELD_PUBLIC_KEY "Açık anahtar" + IDS_FIELD_PUBLIC_KEY "Açık Anahtar" IDS_FIELD_PUBLIC_KEY_FORMAT "%1 (%2!d! bit)" - IDS_PROP_HASH "SHA1 düzgüsü" + IDS_PROP_HASH "SHA1 Kodu" IDS_PROP_ENHKEY_USAGE "Gelişmiş anahtar kullanımı (husûsiyet)" - IDS_PROP_FRIENDLY_NAME "Kolay adı" + IDS_PROP_FRIENDLY_NAME "Kolay Adı" IDS_PROP_DESCRIPTION "Tanımı" IDS_CERTIFICATE_PROPERTIES "Onay Belgesi Husûsiyetleri" IDS_CERTIFICATE_PURPOSE_ERROR "1.2.3.4 biçiminde bir OID giriniz." @@ -77,7 +77,7 @@ STRINGTABLE IDS_IMPORT_FILTER_PFX "Şahsî Bilgi Değiştirmesi (*.pfx; *.p12)" IDS_IMPORT_FILTER_CRL "Onay Belgesi İptal Dizelgesi (*.crl)" IDS_IMPORT_FILTER_CTL "Onay Belgesi Güven Dizelgesi (*.stl)" - IDS_IMPORT_FILTER_SERIALIZED_STORE "Mikroyazılım Dizilendirilmiş Onay Belgesi Deposu (*.sst)" + IDS_IMPORT_FILTER_SERIALIZED_STORE "Microsoft Dizilendirilmiş Onay Belgesi Deposu (*.sst)" IDS_IMPORT_FILTER_CMS "CMS/PKCS #7 İletileri (*.spc; *.p7b)" IDS_IMPORT_FILTER_ALL "Tüm Kütükler (*.*)" IDS_IMPORT_EMPTY_FILE "Bir kütük seçiniz." @@ -140,10 +140,10 @@ Yazılımı yayımlamadan sonraki değişikliklerden korur." IDS_PURPOSE_CTL_USAGE_SIGNING "Onay belgesi güven dizelgesini sayılık olarak imzâlamanızı sağlar." IDS_PURPOSE_EFS "Diskteki verilerin şifrelenmesini sağlar." IDS_PURPOSE_EFS_RECOVERY "Kütük Kurtarma" - IDS_PURPOSE_WHQL "Pencereler Donanım Sürücüsü Doğrulaması" - IDS_PURPOSE_NT5 "Pencereler Dizge Bileşeni Doğrulaması" - IDS_PURPOSE_OEM_WHQL "OEM Pencereler Dizge Bileşeni Doğrulaması" - IDS_PURPOSE_EMBEDDED_NT "Gömülü Pencereler Dizge Bileşeni Doğrulaması" + IDS_PURPOSE_WHQL "Windows Donanım Sürücüsü Doğrulaması" + IDS_PURPOSE_NT5 "Windows Dizge Bileşeni Doğrulaması" + IDS_PURPOSE_OEM_WHQL "OEM Windows Dizge Bileşeni Doğrulaması" + IDS_PURPOSE_EMBEDDED_NT "Gömülü Windows Dizge Bileşeni Doğrulaması" IDS_PURPOSE_ROOT_LIST_SIGNER "Kök Dizelgesi İmzâlayıcısı" IDS_PURPOSE_QUALIFIED_SUBORDINATION "Nitelikli Bağlılık" IDS_PURPOSE_KEY_RECOVERY "Anahtar Kurtarma" @@ -312,7 +312,7 @@ BEGIN -1, 31,53,265,10 LTEXT "Şahsî Bilgi Değiştirmesi/PKCS #12 (.pfx, .p12)", -1, 31,68,265,10 - LTEXT "Mikroyazılım Dizilendirilmiş Onay Belgesi Deposu (.sst)", + LTEXT "Microsoft Dizilendirilmiş Onay Belgesi Deposu (.sst)", -1, 31,83,265,10 END diff --git a/reactos/dll/win32/devmgr/devmgr.rc b/reactos/dll/win32/devmgr/devmgr.rc index 33c5e7d7dd7..6270626e401 100644 --- a/reactos/dll/win32/devmgr/devmgr.rc +++ b/reactos/dll/win32/devmgr/devmgr.rc @@ -71,6 +71,9 @@ IDI_DEVMGR ICON "resources/devmgr.ico" #ifdef LANGUAGE_SQ_AL #include "lang/sq-AL.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "lang/tr-TR.rc" +#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/dll/win32/devmgr/lang/tr-TR.rc b/reactos/dll/win32/devmgr/lang/tr-TR.rc new file mode 100644 index 00000000000..9a2716d83a8 --- /dev/null +++ b/reactos/dll/win32/devmgr/lang/tr-TR.rc @@ -0,0 +1,239 @@ +/* TRANSLATOR: 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ + +LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + IDS_NAME "Ad" + IDS_TYPE "Tür" + IDS_MANUFACTURER "Üretici: %1" + IDS_LOCATION "Konum: %1" + IDS_STATUS "Aygıt Durumu: %1" + IDS_UNKNOWN "Bilinmiyor" + IDS_LOCATIONSTR "Konum %1!u! (%2)" + IDS_DEVCODE " (Kod %1!u!)" + IDS_DEVCODE2 " (Kod %2!u!)" + IDS_ENABLEDEVICE "Bu Aygıtı Kullan (Etkinleştir)" + IDS_DISABLEDEVICE "Bu Aygıtı Kullanma (Edilginleştir)" + IDS_UNKNOWNDEVICE "Bilinmeyen Aygıt" + IDS_NODRIVERLOADED "Bu aygıt için hiçbir sürücü kurulmadı." + IDS_DEVONPARENT "%1 Üzerinde" + IDS_TROUBLESHOOTDEV "&Sorun Giderme..." + IDS_ENABLEDEV "&Sürücüyü Etkinleştir" + IDS_REINSTALLDRV "&Sürücüyü Yeniden Kur" + IDS_PROPERTIES "&Husûsiyetler" + IDS_UPDATEDRV "&Sürücüyü Şimdikileştir..." + IDS_REBOOT "&Bilgisayarı Yeniden Başlat..." + IDS_NOTAVAILABLE "Yok" + IDS_NOTDIGITALLYSIGNED "Sayılık olarak imzâlanmamış." + IDS_NODRIVERS "Bu aygıt için gerekli olan veyâ yüklenen sürücü kütükleri yok." + IDS_RESOURCE_COLUMN "Kaynak Türü" + IDS_SETTING_COLUMN "Ayar" + IDS_RESOURCE_MEMORY_RANGE "Bellek Erimi" + IDS_RESOURCE_INTERRUPT "IRQ" + IDS_RESOURCE_DMA "DMA" + IDS_RESOURCE_PORT "E/A Erimi" +END + +/* error messages, source: http://www.z123.org/techsupport/medm.htm */ +STRINGTABLE +BEGIN + IDS_DEV_NO_PROBLEM "Bu aygıt düzgün çalışıyor." + IDS_DEV_NOT_CONFIGURED "Bu aygıt doğru yapılandırılmamış." + IDS_DEV_DEVLOADER_FAILED "Bilgisayar, iki tür veri yolu bildirdiğinden dolayı ReactOS bu aygıtın sürücüsünü yükleyemedi." + IDS_DEV_DEVLOADER_FAILED2 "Bu aygıtın %1 aygıt yükleyicisi/yükleyicileri aygıtın sürücüsünü yükleyemedi." + IDS_DEV_OUT_OF_MEMORY "Bu aygıtın sürücüsü kötü olabilir veyâ dizgeniz bellekte veyâ başka kaynaklarda yavaş çalışıyor olabilir." + IDS_DEV_ENTRY_IS_WRONG_TYPE "Bu aygıtın sürücülerinin kötü veyâ değer defterinizin bozuk olabilmesinden dolayı bu aygıt düzgün bir şekilde çalışmıyor." + IDS_DEV_LACKED_ARBITRATOR "Bu aygıtın sürücüsü, ReactOS'un nasıl yöneteceğini bilmediği bir kaynağa gereksinim duyuyor." + IDS_DEV_BOOT_CONFIG_CONFLICT "Bu aygıtın gereksinim duyduğu kaynakları başka bir aygıt kullanıyor." + IDS_DEV_FAILED_FILTER "Bu aygıtın sürücüleri yeniden kurulmaya gereksinim duyuyor." + IDS_DEV_DEVLOADER_NOT_FOUND "ReactOS'un bu aygıtın sürücülerini yükleyen %1 kütüğünü yükleyemesinden dolayı bu aygıt düzgün çalışmıyor." + IDS_DEV_DEVLOADER_NOT_FOUND2 "Bu aygıtın sürücülerini yükleyen %1 kütüğünün kötü olmasından dolayı bu aygıt düzgün çalışmıyor." + IDS_DEV_DEVLOADER_NOT_FOUND3 "Aygıt başarısızlığı: Bu aygıtın sürücüsünü değiştirmeyi deneyiniz. Eğer olmuyorsa donanımınızın belgelerine bakınız." + IDS_DEV_INVALID_DATA "Bilgisayarınızın BIOS'u bu aygıtın kaynaklarının yanlış olduğunu bildirdiğinden dolayı bu aygıt düzgün çalışmıyor." + IDS_DEV_INVALID_DATA2 "Bu aygıtın BIOS'u bu aygıtın kaynaklarının yanlış olduğunu bildirdiğinden dolayı bu aygıt düzgün çalışmıyor." + IDS_DEV_FAILED_START "Bu aygıt ya yok, ya düzgün çalışmıyor, ya da bu aygıtın kurulu tüm sürücüleri yok." + IDS_DEV_LIAR "ReactOS, bu aygıtı başlatırken yanıt vermeyi durdurdu, bu yüzden bu aygıt bir daha başlatılmayacak." + IDS_DEV_NORMAL_CONFLICT "Bu aygıt, kullanmak için hiç boş %1 kaynaklarını bulamıyor." + IDS_DEV_NOT_VERIFIED "Bu aygıt ya yok, ya düzgün çalışmıyor, ya da bu aygıtın kurulu tüm sürücüleri yok." + IDS_DEV_NEED_RESTART "Bu aygıt bilgisayarınızı yeniden başlatana kadar düzgün çalışamaz." + IDS_DEV_REENUMERATION "Bu aygıt, kaynak çakışmasına neden oldu." + IDS_DEV_PARTIAL_LOG_CONF "ReactOS, bu aygıtın kullandığı tüm kaynakları tanılayamadı." + IDS_DEV_UNKNOWN_RESOURCE "%1 sürücü bilgi kütüğü, bu alt aygıtın, bu üst aygıtın iye olmadığı ya da tanımadığı kaynağı kullandığını gösteriyor." + IDS_DEV_REINSTALL "Bu aygıtın sürücüleri yeniden başlatılmaya gereksinim duyuyor." + IDS_DEV_REGISTRY "Değer defteriniz bozuk olabilir." + IDS_DEV_WILL_BE_REMOVED "ReactOS bu aygıtı kaldırıyor." + IDS_DEV_DISABLED "Bu aygıt başlatılmamış." + IDS_DEV_DISABLED2 "Bu aygıt edilgin." + IDS_DEV_DEVLOADER_NOT_READY "Bu aygıtın yükleyicileri gerekli sürücüleri yükleyemiyor." + IDS_DEV_DEVLOADER_NOT_READY2 "Bu görüntü bağdaştırıcısı düzgün çalışıyor." + IDS_DEV_DEVLOADER_NOT_READY3 "Bu aygıtın yükleyicileri gerekli sürücüleri yükleyemiyor." + IDS_DEV_DEVICE_NOT_THERE "Bu aygıt ya yok, ya düzgün çalışmıyor, ya da bu aygıtın kurulu tüm sürücüleri yok." + IDS_DEV_MOVED "ReactOS, bu aygıtı kurma işleminde." + IDS_DEV_TOO_EARLY "ReactOS, bu aygıtı kurma işleminde." + IDS_DEV_NO_VALID_LOG_CONF "ReactOS, bu aygıtın kaynaklarını belirleyemez." + IDS_DEV_FAILED_INSTALL "Bu aygıtın sürücüleri kurulu değil." + IDS_DEV_HARDWARE_DISABLED "Bu aygıtın BIOS'u aygıta hiç kaynak vermediğinden dolayı bu aygıt edilgin." + IDS_DEV_CANT_SHARE_IRQ "Bu aygıt, başka bir aygıtın kullandığı paylaşılamayan Kesme İsteği (IRQ) kaynağı kullanıyor.\nÇakışan ayârı değiştirmeli ya da çakışmaya neden olan gerçek kip sürücüsünü kaldırmalısınız." + IDS_DEV_FAILED_ADD "%1 şeyinin düzgün çalışmamasından dolayı bu aygıt düzgün çalışmıyor." + IDS_DEV_DISABLED_SERVICE "ReactOS, kurulum kütüklerinin üzerinde bulunduğu, sürücüye ya da ağ konumuna erişememesinden dolayı bu aygıtın sürücülerini kuramıyor." + IDS_DEV_TRANSLATION_FAILED "Bu aygıt sürücüsüne yanıt vermiyor." + IDS_DEV_NO_SOFTCONFIG "ReactOS, bu aygıtın ayarlarını belirleyemiyor. Bu aygıtla gelen belgelere bakınız ve yapılandırmayı ayarlamak için ""Kaynaklar"" sekmesini kullanınız." + IDS_DEV_BIOS_TABLE "Bilgisayarınızın dizge bellenimi, bu aygıtı, düzgün olarak, yapılandırmak ve kullanmak için yeterli bilgi içermiyor.\nBu aygıtı kullanmak için, bellenim veyâ BIOS güncellemesi elde etmek için bilgisayarınızın üreticisiyle iletişime geçiniz." + IDS_DEV_IRQ_TRANSLATION_FAILED "Bu aygıt, bir PCI kesmesi istemektedir ancak bir ISA kesmesi için yapılandırılmıştır (ya da tersi).\nBu aygıtın kesmesini yapılandırmak için bilgisayarın dizge kurulum çizeylemini kullanınız." + IDS_DEV_FAILED_DRIVER_ENTRY "ReactOS, bu donanımın aygıt sürücüsünü başlatamıyor." + IDS_DEV_DRIVER_FAILED_PRIOR_UNLOAD "ReactOS, bellekte hâlâ aygıt sürücüsünün bir önceki tıpkısı olduğundan dolayı bu donanımın aygıt sürücüsünü yükleyemiyor." + IDS_DEV_DRIVER_FAILED_LOAD "ReactOS, bu donanımın aygıt sürücüsünü yükleyemiyor. Sürücü eksik ya da bozulmuş olabilir." + IDS_DEV_DRIVER_SERVICE_KEY_INVALID "ReactOS, bu donanımın, değer defterinde hizmet dizini bilgisinin eksik ya da yanlış kaydedildiğinden dolayı bu donanıma erişemiyor." + IDS_DEV_LEGACY_SERVICE_NO_DEVICES "ReactOS, bu donanımın aygıt sürücüsünü başarılı bir şekilde yükledi ancak donanım aygıtını bulamıyor." + IDS_DEV_DUPLICATE_DEVICE "ReactOS, dizgede önceden bir tıpkı aygıt çalışıyor olmasından dolayı bu donanımın aygıt sürücüsünü yükleyemiyor." + IDS_DEV_FAILED_POST_START "ReactOS, bu aygıtı, sorunlar bildirdiğinden dolayı durdurdu." + IDS_DEV_HALTED "Bir uygulama ya da bir hizmet, bu donanım aygıtını kapattı." + IDS_DEV_PHANTOM "Şu an bu donanım aygıtı bilgisayara bağlı değil." + IDS_DEV_SYSTEM_SHUTDOWN "ReactOS, işletim dizgesinin kapatma işleminde olmasından dolayı bu donanım aygıtının erişimini elde edemiyor." + IDS_DEV_HELD_FOR_EJECT "ReactOS, bu donanım aygıtının, güvenli kaldırılmaya anıklandığından ancak bilgisayardan kaldırılmadığından dolayı onu kullanamıyor." + IDS_DEV_DRIVER_BLOCKED "Bu aygıtın yazılımı, ReactOS'la sorunları olduğu bilindiğinden dolayı başlatmaktan engellendi. Yeni bir donanım için donanımın satıcısıyla iletişime geçiniz." + IDS_DEV_REGISTRY_TOO_LARGE "ReactOS, dizge yığınının çok büyük olmasından dolayı yeni donanım aygıtlarını başlatamıyor. (Değer Defteri Büyüklük Sınırı'nı aşar.)" + IDS_DEV_SETPROPERTIES_FAILED "ReactOS, bu aygıtın ayarlarını değiştiremez." +END + +STRINGTABLE +BEGIN + IDS_PROP_DEVICEID "Aygıt Örneği Kimliği" + IDS_PROP_HARDWAREIDS "Donanım Kimlikleri" + IDS_PROP_COMPATIBLEIDS "Uyumlu Kimlikler" + IDS_PROP_MATCHINGDEVICEID "Eşleşen Aygıt Kimliği" + IDS_PROP_SERVICE "Hizmet" + IDS_PROP_ENUMERATOR "Numaralandırıcı" + IDS_PROP_CAPABILITIES "Yetenekler" + IDS_PROP_DEVNODEFLAGS "Aygıt Bileşeni İmleri" + IDS_PROP_CONFIGFLAGS "Yapılandırma İmleri" + IDS_PROP_CSCONFIGFLAGS "CSConfig İmleri" + IDS_PROP_EJECTIONRELATIONS "Çıkarma İlişkileri" + IDS_PROP_REMOVALRELATIONS "Kaldırma İlişkileri" + IDS_PROP_BUSRELATIONS "Veri Yolu İlişkileri" + IDS_PROP_DEVUPPERFILTERS "Üst Aygıt Süzgeçleri" + IDS_PROP_DEVLOWERFILTERS "Alt Aygıt Süzgeçleri" + IDS_PROP_CLASSUPPERFILTERS "Üst Sınıf Süzgeçleri" + IDS_PROP_CLASSLOWERFILTERS "Alt Sınıf Süzgeçleri" + IDS_PROP_CLASSINSTALLER "Sınıf Yükleyicileri" + IDS_PROP_CLASSCOINSTALLER "Sınıf Yükleme Yardımcıları" + IDS_PROP_DEVICECOINSTALLER "Aygıt Yükleme Yardımcıları" + IDS_PROP_FIRMWAREREVISION "Bellenim Düzeltmesi" + IDS_PROP_CURRENTPOWERSTATE "Şimdiki Güç Durumu" + IDS_PROP_POWERCAPABILITIES "Güç Yetenekleri" + IDS_PROP_POWERSTATEMAPPINGS "Güç Durumu Eşlemeleri" +END + +IDD_HARDWARE DIALOGEX 0, 0, 300, 400 +STYLE DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION | DS_SHELLFONT +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&Aygıtlar:", IDC_DEVICES, 7, 6, 196, 10 + CONTROL "", IDC_LV_DEVICES, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | + LVS_SHAREIMAGELISTS | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 7, 16, 196, 50 + GROUPBOX "Aygıt Husûsiyetleri", IDC_PROPERTIESGROUP, 7, 76, 196, 105 + LTEXT "", IDC_MANUFACTURER, 14, 88, 183, 10, SS_ENDELLIPSIS + LTEXT "", IDC_LOCATION, 14, 100, 183, 10, SS_ENDELLIPSIS + LTEXT "", IDC_STATUS, 14, 112, 183, 30 + PUSHBUTTON "&Sorun Giderme...", IDC_TROUBLESHOOT, 80, 140, 60, 14, BS_PUSHBUTTON | WS_CHILD | WS_DISABLED | WS_TABSTOP + PUSHBUTTON "&Husûsiyetler", IDC_PROPERTIES, 146, 140, 50, 14 +END + +IDD_DEVICEGENERAL DIALOGEX 0, 0, 252, 218 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Umûmî" +FONT 8, "MS Shell Dlg" +BEGIN + ICON "", IDC_DEVICON, 7, 7, 20, 20 + LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX + LTEXT "Aygıt Türü:", -1, 37, 39, 60, 8, SS_NOPREFIX + EDITTEXT IDC_DEVTYPE, 100, 39, 146, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Üretici:", -1, 37, 53, 60, 8, SS_NOPREFIX + EDITTEXT IDC_DEVMANUFACTURER, 100, 53, 145, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Konum:", -1, 37, 67, 60, 8, SS_NOPREFIX + EDITTEXT IDC_DEVLOCATION, 100, 67, 145, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + GROUPBOX "Aygıt Durumu", IDC_DEVSTATUSGROUP, 7, 83, 238, 100 + EDITTEXT IDC_DEVSTATUS, 14, 96, 224, 61, NOT WS_TABSTOP | ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | WS_VSCROLL + PUSHBUTTON "&Sorun Giderme...", IDC_DEVPROBLEM, 148, 163, 90, 15 + LTEXT "&Aygıt Kullanımı:", IDC_DEVUSAGELABEL, 7, 188, 222, 8, WS_DISABLED + COMBOBOX IDC_DEVUSAGE, 7, 198, 239, 40, CBS_DROPDOWNLIST | WS_VSCROLL | WS_DISABLED +END + +IDD_DEVICEDRIVER DIALOGEX 0, 0, 252, 218 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Sürücü" +FONT 8, "MS Shell Dlg" +BEGIN + ICON "", IDC_DEVICON, 7, 7, 20, 20 + LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX + LTEXT "Sürücü Sağlayıcısı:", -1, 37, 39, 60, 8, SS_NOPREFIX + EDITTEXT IDC_DRVPROVIDER, 100, 39, 146, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Sürücü Zamânı:", -1, 37, 53, 60, 8, SS_NOPREFIX + EDITTEXT IDC_DRVDATE, 100, 53, 145, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Sürücü Sürümü:", -1, 37, 67, 60, 8, SS_NOPREFIX + EDITTEXT IDC_DRVVERSION, 100, 67, 145, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Sürücü İmzâlayıcısı:", -1, 37, 81, 60, 8, SS_NOPREFIX + EDITTEXT IDC_DIGITALSIGNER, 100, 81, 145, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + PUSHBUTTON "&Sürücü Ayrıntıları...", IDC_DRIVERDETAILS, 7, 106, 75, 15 + LTEXT "Sürücü kütükleri hakkında ayrıntıları görmek için.", -1, 91, 110, 154, 17, SS_NOPREFIX + PUSHBUTTON "S&ürücüyü Şimdikileştir...", IDC_UPDATEDRIVER, 7, 126, 75, 15 + LTEXT "Bu aygıtın sürücüsünü şimdikileştir.", -1, 91, 130, 154, 17, SS_NOPREFIX +END + +IDD_DRIVERDETAILS DIALOGEX 0, 0, 224, 230 +STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUPWINDOW | WS_VISIBLE | WS_DLGFRAME +CAPTION "Sürücü Kütüğü Ayrıntıları" +FONT 8, "MS Shell Dlg" +BEGIN + ICON "", IDC_DEVICON, 7, 7, 20, 20 + LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX + LTEXT "&Sürücü Kütükleri:", -1, 7, 36, 204, 8 + CONTROL "", IDC_DRIVERFILES, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_SORTASCENDING | + LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 7, 46, 209, 80 + LTEXT "Sağlayıcı:", -1, 14, 134, 50, 8 + EDITTEXT IDC_FILEPROVIDER, 66, 134, 155, 8, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Kütük Sürümü:", -1, 14, 150, 50, 8 + EDITTEXT IDC_FILEVERSION, 66, 150, 155, 8, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Telif Hakkı:", -1, 14, 166, 50, 8 + EDITTEXT IDC_FILECOPYRIGHT, 66, 166, 155, 8, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + LTEXT "Sayılık İmzâlayıcı:", -1, 14, 182, 50, 8 + EDITTEXT IDC_DIGITALSIGNER, 66, 182, 155, 8, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY + DEFPUSHBUTTON "Tamam", IDOK, 167, 208, 50, 14 +END + +IDD_DEVICEDETAILS DIALOGEX 0, 0, 252, 218 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Ayrıntılar" +FONT 8, "MS Shell Dlg" +BEGIN + ICON "", IDC_DEVICON, 7, 7, 20, 20 + LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX + COMBOBOX IDC_DETAILSPROPNAME, 7, 36, 238, 165, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "", IDC_DETAILSPROPVALUE, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | + LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 7, 58, 238, 155 +END + +IDD_DEVICERESOURCES DIALOGEX 0, 0, 252, 218 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Kaynaklar" +FONT 8, "MS Shell Dlg" +BEGIN + ICON "", IDC_DEVICON, 7, 7, 20, 20 + LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX + LTEXT "Kaynak Ayarları:", -1, 7, 36, 204, 8 + CONTROL "", IDC_DRIVERRESOURCES, "SysListView32", LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS | LVS_SORTASCENDING | + LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP, 7, 46, 209, 80 +END + +IDD_DEVICEPOWER DIALOGEX 0, 0, 252, 218 +STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION +CAPTION "Güç" +FONT 8, "MS Shell Dlg" +BEGIN + ICON "", IDC_DEVICON, 7, 7, 20, 20 + LTEXT "", IDC_DEVNAME, 37, 9, 174, 16, SS_NOPREFIX +END diff --git a/reactos/dll/win32/hhctrl.ocx/hhctrl.rc b/reactos/dll/win32/hhctrl.ocx/hhctrl.rc index 9fae00ebef4..26cd74ad344 100644 --- a/reactos/dll/win32/hhctrl.ocx/hhctrl.rc +++ b/reactos/dll/win32/hhctrl.ocx/hhctrl.rc @@ -57,9 +57,6 @@ #ifdef LANGUAGE_SV_SE #include "lang/Sv.rc" #endif -#ifdef LANGUAGE_TR_TR - #include "lang/Tr.rc" -#endif /* UTF-8 */ #ifdef LANGUAGE_DE_DE @@ -98,6 +95,9 @@ #ifdef LANGAUGE_SQ_AL #include "lang/Sq.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "lang/Tr.rc" +#endif #ifdef LANGUAGE_UK_UA #include "lang/Uk.rc" #endif diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc b/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc index 748899908f7..4c4a6daccfb 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc @@ -2,7 +2,7 @@ * HTML Help resources * Turkish Language Support * - * Copyright 2006 Fatih Ac + * Copyrights: 2006 - Fatih Aşıcı (fasici@linux-sevenler.org), 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,24 +23,24 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT STRINGTABLE BEGIN - IDS_CONTENTS "&erik" - IDS_INDEX "Di&zin" + IDS_CONTENTS "&İçindekiler" + IDS_INDEX "&Dizin" IDS_SEARCH "&Ara" - IDS_FAVORITES "&Sk Kullanlanlar" + IDS_FAVORITES "&Yer İmleri" END STRINGTABLE BEGIN - IDTB_EXPAND "Gster" + IDTB_EXPAND "Göster" IDTB_CONTRACT "Gizle" IDTB_STOP "Dur" IDTB_REFRESH "Yenile" IDTB_BACK "Geri" IDTB_HOME "Ev" - IDTB_SYNC "Eitle" - IDTB_PRINT "Yazdr" - IDTB_OPTIONS "Seenekler" - IDTB_FORWARD "leri" + IDTB_SYNC "Eşitle" + IDTB_PRINT "Yazdır" + IDTB_OPTIONS "Seçenekler" + IDTB_FORWARD "İleri" IDTB_NOTES "IDTB_NOTES" IDTB_BROWSE_FWD "IDTB_BROWSE_FWD" IDTB_BROWSE_BACK "IDT_BROWSE_BACK" @@ -51,8 +51,8 @@ BEGIN IDTB_FAVORITES "IDTB_FAVORITES" IDTB_JUMP1 "Jump1" IDTB_JUMP2 "Jump2" - IDTB_CUSTOMIZE "zelletir" - IDTB_ZOOM "Yaklatr" + IDTB_CUSTOMIZE "Husûsileştir" + IDTB_ZOOM "Yakınlaştır" IDTB_TOC_NEXT "IDTB_TOC_NEXT" IDTB_TOC_PREV "IDTB_TOC_PREV" END diff --git a/reactos/dll/win32/iccvid/lang/iccvid_Tr.rc b/reactos/dll/win32/iccvid/lang/iccvid_Tr.rc index eec2b7ec5fd..f24b5b6717a 100644 --- a/reactos/dll/win32/iccvid/lang/iccvid_Tr.rc +++ b/reactos/dll/win32/iccvid/lang/iccvid_Tr.rc @@ -1,5 +1,5 @@ /* - * Copyright 2006 Fatih Ac + * Copyrights: 2006 - Fatih Aşıcı, 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,6 +22,6 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT STRINGTABLE { - IDS_NAME "Cinepak Vidyo zc" - IDS_DESCRIPTION "Cinepak Vidyo zc" + IDS_NAME "Cinepak Vidyo Kodeki" + IDS_DESCRIPTION "Cinepak Vidyo Kodeki" } diff --git a/reactos/dll/win32/iccvid/rsrc.rc b/reactos/dll/win32/iccvid/rsrc.rc index 245b593d1d3..25e514008a4 100644 --- a/reactos/dll/win32/iccvid/rsrc.rc +++ b/reactos/dll/win32/iccvid/rsrc.rc @@ -46,9 +46,6 @@ #ifdef LANGUAGE_SV_SE #include "lang/iccvid_Sv.rc" #endif -#ifdef LANGUAGE_TR_TR - #include "lang/iccvid_Tr.rc" -#endif /* UTF-8 */ #ifdef LANGUAGE_DE_DE @@ -84,6 +81,9 @@ #ifdef LANGUAGE_SQ_AL #include "lang/iccvid_Sq.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "lang/iccvid_Tr.rc" +#endif #ifdef LANGUAGE_UK_UA #include "lang/iccvid_Uk.rc" #endif From 62dc9b0d32443e40594a1a237220ffc16f387960 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 2 Mar 2014 19:36:50 +0000 Subject: [PATCH 029/419] [PSEH3] - Switch the registration asm functions from a complete custom calling convention to regparm(2), so that it can be used in "returns_twice" based algorithm (required by CLANG, which doesn't support "asm goto" construct) - Add support for saving all non-volatiles in the registration frame (also required by CLANG, since without asm goto, we cannot give the compiler the required hints to save these registers itself) svn path=/trunk/; revision=62383 --- reactos/include/reactos/libs/pseh/pseh3.h | 15 ++++- reactos/lib/pseh/i386/pseh3.c | 2 + reactos/lib/pseh/i386/pseh3_asmdef.h | 3 + reactos/lib/pseh/i386/pseh3_i386.S | 70 ++++++++++++++++------- 4 files changed, 66 insertions(+), 24 deletions(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index d1168893894..0b75e7df732 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -12,6 +12,11 @@ #include "excpt.h" +/* CLANG must safe non-volatiles, because it uses a return-twice algorithm */ +#if defined(__clang__) && !defined(_SEH3$_FRAME_ALL_NONVOLATILES) +#define _SEH3$_FRAME_ALL_NONVOLATILES 1 +#endif + typedef struct _SEH3$_SCOPE_TABLE { void *Target; @@ -42,7 +47,11 @@ typedef struct _SEH3$_REGISTRATION_FRAME /* Registers that we need to save */ unsigned long Esp; unsigned long Ebp; - +#ifdef _SEH3$_FRAME_ALL_NONVOLATILES + unsigned long Ebx; + unsigned long Esi; + unsigned long Edi; +#endif } SEH3$_REGISTRATION_FRAME ,*PSEH3$_REGISTRATION_FRAME; /* Prevent gcc from inlining functions that use SEH. */ @@ -95,7 +104,7 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter /* This is an asm wrapper around _SEH3$_RegisterFrame */ #define _SEH3$_RegisterFrame(_TrylevelFrame, _DataTable, _Target) \ - asm goto ("leal %0, %%ecx\n" \ + asm goto ("leal %0, %%edx\n" \ "call __SEH3$_RegisterFrame\n" \ : \ : "m" (*(_TrylevelFrame)), "a" (_DataTable) \ @@ -104,7 +113,7 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter /* This is an asm wrapper around _SEH3$_EnterTryLevel */ #define _SEH3$_RegisterTryLevel(_TrylevelFrame, _DataTable, _Target) \ - asm goto ("leal %0, %%ecx\n" \ + asm goto ("leal %0, %%edx\n" \ "call __SEH3$_RegisterTryLevel\n" \ : \ : "m" (*(_TrylevelFrame)), "a" (_DataTable) \ diff --git a/reactos/lib/pseh/i386/pseh3.c b/reactos/lib/pseh/i386/pseh3.c index 13e5df1d601..1d37ca0a981 100644 --- a/reactos/lib/pseh/i386/pseh3.c +++ b/reactos/lib/pseh/i386/pseh3.c @@ -34,6 +34,8 @@ #include #include +/* We need the full structure with all non-volatile */ +#define _SEH3$_FRAME_ALL_NONVOLATILES 1 #include "pseh3.h" #include "pseh3_asmdef.h" diff --git a/reactos/lib/pseh/i386/pseh3_asmdef.h b/reactos/lib/pseh/i386/pseh3_asmdef.h index 6fd821ce837..f8d847eb323 100644 --- a/reactos/lib/pseh/i386/pseh3_asmdef.h +++ b/reactos/lib/pseh/i386/pseh3_asmdef.h @@ -7,6 +7,9 @@ #define SEH3_REGISTRATION_FRAME_ExceptionPointers 16 #define SEH3_REGISTRATION_FRAME_Esp 20 #define SEH3_REGISTRATION_FRAME_Ebp 24 +#define SEH3_REGISTRATION_FRAME_Ebx 28 +#define SEH3_REGISTRATION_FRAME_Esi 32 +#define SEH3_REGISTRATION_FRAME_Edi 36 #define SEH3_SCOPE_TABLE_Target 0 #define SEH3_SCOPE_TABLE_Filter 4 diff --git a/reactos/lib/pseh/i386/pseh3_i386.S b/reactos/lib/pseh/i386/pseh3_i386.S index eca7182158c..e647312ee74 100644 --- a/reactos/lib/pseh/i386/pseh3_i386.S +++ b/reactos/lib/pseh/i386/pseh3_i386.S @@ -11,62 +11,90 @@ .text - .extern __SEH3$_except_handler /* * void - * _SEH3$_RegisterFrame( - * PSEH_REGISTRATION_FRAME RegistrationRecord, - * PSEH_DATA_TABLE DataTable); + * __attribute__((regparm(2))) + * __attribute__((returns_twice)) + * _SEH3$_RegisterFrame[WithNonVolatiles]( + * PSEH_DATA_TABLE DataTable, + * PSEH_REGISTRATION_FRAME RegistrationRecord); */ +.global __SEH3$_RegisterFrameWithNonVolatiles +__SEH3$_RegisterFrameWithNonVolatiles: + + /* Save non-volatiles in the registration frame */ + mov [edx + SEH3_REGISTRATION_FRAME_Ebx], ebx + mov [edx + SEH3_REGISTRATION_FRAME_Esi], esi + mov [edx + SEH3_REGISTRATION_FRAME_Edi], edi + .global __SEH3$_RegisterFrame __SEH3$_RegisterFrame: /* Save the address of the static data table */ - mov [ecx + SEH3_REGISTRATION_FRAME_ScopeTable], eax + mov [edx + SEH3_REGISTRATION_FRAME_ScopeTable], eax /* Set the handler address */ - mov dword ptr [ecx + SEH3_REGISTRATION_FRAME_Handler], offset __SEH3$_except_handler + mov dword ptr [edx + SEH3_REGISTRATION_FRAME_Handler], offset __SEH3$_except_handler /* Set this as the end of the internal chain */ - mov dword ptr [ecx + SEH3_REGISTRATION_FRAME_EndOfChain], ecx + mov dword ptr [edx + SEH3_REGISTRATION_FRAME_EndOfChain], edx /* Register the frame in the TEB */ mov eax, dword ptr fs:[0] - mov [ecx + SEH3_REGISTRATION_FRAME_Next], eax - mov dword ptr fs:[0], ecx + mov [edx + SEH3_REGISTRATION_FRAME_Next], eax + mov dword ptr fs:[0], edx - /* Save the registers */ - mov [ecx + SEH3_REGISTRATION_FRAME_Esp], esp - mov [ecx + SEH3_REGISTRATION_FRAME_Ebp], ebp + /* Save the stack registers */ + mov [edx + SEH3_REGISTRATION_FRAME_Esp], esp + mov [edx + SEH3_REGISTRATION_FRAME_Ebp], ebp + /* Set eax to 0 to indicate 1st return */ + xor eax, eax ret +/* + * void + * __attribute__((regparm(2))) + * __attribute__((returns_twice)) + * _SEH3$_RegisterTryLevel[WithNonVolatiles]( + * PSEH_DATA_TABLE DataTable, + * PSEH_REGISTRATION_FRAME RegistrationRecord); + */ +.global __SEH3$_RegisterTryLevelWithNonVolatiles +__SEH3$_RegisterTryLevelWithNonVolatiles: + + /* Save non-volatiles in the registration frame */ + mov [edx + SEH3_REGISTRATION_FRAME_Ebx], ebx + mov [edx + SEH3_REGISTRATION_FRAME_Esi], esi + mov [edx + SEH3_REGISTRATION_FRAME_Edi], edi + .global __SEH3$_RegisterTryLevel __SEH3$_RegisterTryLevel: /* Save the address of the static data table */ - mov [ecx + SEH3_REGISTRATION_FRAME_ScopeTable], eax + mov [edx + SEH3_REGISTRATION_FRAME_ScopeTable], eax /* Set the handler address to NULL as identification */ - and dword ptr [ecx + SEH3_REGISTRATION_FRAME_Handler], 0 + and dword ptr [edx + SEH3_REGISTRATION_FRAME_Handler], 0 /* Get the current registered frame */ mov eax, dword ptr fs:[0] /* Get the current end of the chain and set this as Next */ - mov edx, [eax + SEH3_REGISTRATION_FRAME_EndOfChain] - mov [ecx + SEH3_REGISTRATION_FRAME_Next], edx + mov ecx, [eax + SEH3_REGISTRATION_FRAME_EndOfChain] + mov [edx + SEH3_REGISTRATION_FRAME_Next], ecx /* Set this as the end of the internal chain */ - mov dword ptr [eax + SEH3_REGISTRATION_FRAME_EndOfChain], ecx + mov dword ptr [eax + SEH3_REGISTRATION_FRAME_EndOfChain], edx - /* Save the registers */ - mov [ecx + SEH3_REGISTRATION_FRAME_Esp], esp - mov [ecx + SEH3_REGISTRATION_FRAME_Ebp], ebp + /* Save the stack registers */ + mov [edx + SEH3_REGISTRATION_FRAME_Esp], esp + mov [edx + SEH3_REGISTRATION_FRAME_Ebp], ebp + /* Set eax to 0 to indicate 1st return */ + xor eax, eax ret - From fd28183355c1ce6d723d572255b48d8927868e5a Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 2 Mar 2014 19:49:33 +0000 Subject: [PATCH 030/419] [SERVICES] RSetServiceStatus: Protect the service type from changes by the caller. svn path=/trunk/; revision=62384 --- reactos/base/system/services/rpcserver.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/reactos/base/system/services/rpcserver.c b/reactos/base/system/services/rpcserver.c index ba53003c67e..fbe4bb5c0bc 100644 --- a/reactos/base/system/services/rpcserver.c +++ b/reactos/base/system/services/rpcserver.c @@ -1617,12 +1617,13 @@ DWORD RSetServiceStatus( { PSERVICE lpService; DWORD dwPreviousState; + DWORD dwPreviousType; LPCWSTR lpErrorStrings[2]; WCHAR szErrorBuffer[32]; DPRINT("RSetServiceStatus() called\n"); DPRINT("hServiceStatus = %lu\n", hServiceStatus); - DPRINT("dwServiceType = %lu\n", lpServiceStatus->dwServiceType); + DPRINT("dwServiceType = 0x%lx\n", lpServiceStatus->dwServiceType); DPRINT("dwCurrentState = %lu\n", lpServiceStatus->dwCurrentState); DPRINT("dwControlsAccepted = %lu\n", lpServiceStatus->dwControlsAccepted); DPRINT("dwWin32ExitCode = %lu\n", lpServiceStatus->dwWin32ExitCode); @@ -1666,10 +1667,17 @@ DWORD RSetServiceStatus( /* Save the current service state */ dwPreviousState = lpService->Status.dwCurrentState; + /* Save the current service type */ + dwPreviousType = lpService->Status.dwServiceType; + + /* Update the service status */ RtlCopyMemory(&lpService->Status, lpServiceStatus, sizeof(SERVICE_STATUS)); + /* Restore the previous service type */ + lpService->Status.dwServiceType = dwPreviousType; + /* Unlock the service database */ ScmUnlockDatabase(); @@ -1755,7 +1763,7 @@ DWORD RChangeServiceConfigW( LPWSTR lpImagePathW = NULL; DPRINT("RChangeServiceConfigW() called\n"); - DPRINT("dwServiceType = %lu\n", dwServiceType); + DPRINT("dwServiceType = 0x%lx\n", dwServiceType); DPRINT("dwStartType = %lu\n", dwStartType); DPRINT("dwErrorControl = %lu\n", dwErrorControl); DPRINT("lpBinaryPathName = %S\n", lpBinaryPathName); @@ -1999,7 +2007,7 @@ DWORD RCreateServiceW( DPRINT("lpServiceName = %S\n", lpServiceName); DPRINT("lpDisplayName = %S\n", lpDisplayName); DPRINT("dwDesiredAccess = %lx\n", dwDesiredAccess); - DPRINT("dwServiceType = %lu\n", dwServiceType); + DPRINT("dwServiceType = 0x%lx\n", dwServiceType); DPRINT("dwStartType = %lu\n", dwStartType); DPRINT("dwErrorControl = %lu\n", dwErrorControl); DPRINT("lpBinaryPathName = %S\n", lpBinaryPathName); From eaf929fbe9ad7318344054ad8a1349c39e2b95fa Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 2 Mar 2014 19:53:15 +0000 Subject: [PATCH 031/419] [CMAKE] Add simple clang support to configure.cmp (use "configure clang", which will use ninja as the generator and clang as the compiler) svn path=/trunk/; revision=62385 --- reactos/configure.cmd | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reactos/configure.cmd b/reactos/configure.cmd index bca5d02fe71..77caee58e1b 100755 --- a/reactos/configure.cmd +++ b/reactos/configure.cmd @@ -37,6 +37,9 @@ if defined ROS_ARCH ( set CMAKE_GENERATOR="Eclipse CDT4 - MinGW Makefiles" ) else if /I "%1" == "Makefiles" ( set CMAKE_GENERATOR="MinGW Makefiles" + ) else if /I "%1" == "clang" ( + set BUILD_ENVIRONMENT=Clang + set CMAKE_GENERATOR="Ninja" ) else ( set CMAKE_GENERATOR="Ninja" ) @@ -151,6 +154,8 @@ if EXIST CMakeCache.txt ( if "%BUILD_ENVIRONMENT%" == "MinGW" ( cmake -G %CMAKE_GENERATOR% -DENABLE_CCACHE=0 -DCMAKE_TOOLCHAIN_FILE=toolchain-gcc.cmake -DARCH=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:DIR="%REACTOS_BUILD_TOOLS_DIR%" "%REACTOS_SOURCE_DIR%" +) else if "%BUILD_ENVIRONMENT%" == "Clang" ( + cmake -G %CMAKE_GENERATOR% -DENABLE_CCACHE=0 -DCMAKE_TOOLCHAIN_FILE=toolchain-clang.cmake -DARCH=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:DIR="%REACTOS_BUILD_TOOLS_DIR%" "%REACTOS_SOURCE_DIR%" ) else ( cmake -G %CMAKE_GENERATOR% -DCMAKE_TOOLCHAIN_FILE=toolchain-msvc.cmake -DARCH=%ARCH% -DREACTOS_BUILD_TOOLS_DIR:DIR="%REACTOS_BUILD_TOOLS_DIR%" "%REACTOS_SOURCE_DIR%" ) From 6d213f365818fb8d2cda493db8d6690faf4da238 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 20:08:07 +0000 Subject: [PATCH 032/419] [CMAKE] * Remove some unsupported flags from the Clang build options. svn path=/trunk/; revision=62386 --- reactos/cmake/gcc.cmake | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index ed2f656f3cb..d8ea5436aa8 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -40,13 +40,19 @@ set(REACTOS_SOURCE_DIR_NATIVE ${REACTOS_SOURCE_DIR}) if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") string(REPLACE "/" "\\" REACTOS_SOURCE_DIR_NATIVE ${REACTOS_SOURCE_DIR}) endif() -add_compile_flags("-fdebug-prefix-map=\"${REACTOS_SOURCE_DIR_NATIVE}\"=ReactOS") + +if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_compile_flags("-fdebug-prefix-map=\"${REACTOS_SOURCE_DIR_NATIVE}\"=ReactOS") +endif() # Debugging if(SEPARATE_DBG) add_compile_flags("-gdwarf-2 -g2") else() - add_compile_flags("-gdwarf-2 -gstrict-dwarf -femit-struct-debug-detailed=none -feliminate-unused-debug-symbols") + add_compile_flags("-gdwarf-2 -gstrict-dwarf") + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_compile_flags("-femit-struct-debug-detailed=none -feliminate-unused-debug-symbols") + endif() endif() # For some reason, cmake sets -fPIC, and we don't want it @@ -63,8 +69,14 @@ endif() # Warnings, errors add_compile_flags("-Werror -Wall -Wpointer-arith") -add_compile_flags("-Wno-char-subscripts -Wno-multichar -Wno-unused-value -Wno-maybe-uninitialized") -add_compile_flags("-Wno-error=unused-but-set-variable -Wno-error=narrowing") +add_compile_flags("-Wno-char-subscripts -Wno-multichar -Wno-unused-value") + +if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_compile_flags("-Wno-maybe-uninitialized") + add_compile_flags("-Wno-error=unused-but-set-variable") +endif() + +add_compile_flags("-Wno-error=narrowing") add_compile_flags("-Wtype-limits -Wno-error=type-limits") if(ARCH STREQUAL "amd64") @@ -96,7 +108,10 @@ if(LTCG) endif() if(ARCH STREQUAL "i386") - add_compile_flags("-mpreferred-stack-boundary=3 -fno-set-stack-executable -fno-optimize-sibling-calls -fno-omit-frame-pointer") + add_compile_flags("-fno-optimize-sibling-calls -fno-omit-frame-pointer") + if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_compile_flags("-mpreferred-stack-boundary=3 -fno-set-stack-executable") + endif() # FIXME: this doesn't work. CMAKE_BUILD_TYPE is always "Debug" if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") add_compile_flags("-momit-leaf-frame-pointer") @@ -174,9 +189,13 @@ endif() set(CMAKE_EXE_LINKER_FLAGS "-nostdlib -Wl,--enable-auto-image-base,--disable-auto-import,--disable-stdcall-fixup") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} -Wl,--disable-stdcall-fixup") -SET(CMAKE_C_COMPILE_OBJECT "${CCACHE} -Wa,--compress-debug-sections -o -c ") +if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + set(_compress_debug_sections_flag "-Wa,--compress-debug-sections") +endif() + +SET(CMAKE_C_COMPILE_OBJECT "${CCACHE} ${_compress_debug_sections_flag} -o -c ") SET(CMAKE_CXX_COMPILE_OBJECT "${CCACHE} -o -c ") -set(CMAKE_ASM_COMPILE_OBJECT " -Wa,--compress-debug-sections -x assembler-with-cpp -o -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm -D__ASM__ -c ") +set(CMAKE_ASM_COMPILE_OBJECT " ${_compress_debug_sections_flag} -x assembler-with-cpp -o -I${REACTOS_SOURCE_DIR}/include/asm -I${REACTOS_BINARY_DIR}/include/asm -D__ASM__ -c ") set(CMAKE_RC_COMPILE_OBJECT " -O coff -DRC_INVOKED -D__WIN32__=1 -D__FLAT__=1 ${I18N_DEFS} ") set(CMAKE_DEPFILE_FLAGS_RC "--preprocessor \"${MINGW_TOOLCHAIN_PREFIX}gcc${MINGW_TOOLCHAIN_SUFFIX} -E -xc-header -MMD -MF -MT \" ") From dd0002fc056a1e7f24c31f730e2e7f036f06ccb0 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 20:27:39 +0000 Subject: [PATCH 033/419] [CMAKE] * Use the GCC compatible dialect in Clang builds. svn path=/trunk/; revision=62387 --- reactos/cmake/gcc.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index d8ea5436aa8..9cee3340626 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -31,6 +31,10 @@ if(GCC_VERSION VERSION_GREATER 4.7) add_compile_flags("-mstackrealign") endif() +if(CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_compile_flags_language("-std=gnu89" "C") +endif() + add_compile_flags_language("-fno-rtti -fno-exceptions" "CXX") #bug From 2675d2c14561a3324935d76968658a44a3ae5a42 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 20:41:36 +0000 Subject: [PATCH 034/419] [CMAKE] * Disable the MS extensions warning in Clang build. svn path=/trunk/; revision=62388 --- reactos/cmake/gcc.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index 9cee3340626..5f2c99d6470 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -33,6 +33,7 @@ endif() if(CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_flags_language("-std=gnu89" "C") + add_compile_flags("-Wno-microsoft") endif() add_compile_flags_language("-fno-rtti -fno-exceptions" "CXX") From 3800bc28b336430c54efa1b77965b2a384fafb3a Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 20:42:26 +0000 Subject: [PATCH 035/419] [CRT/INTRIN_X86] * In Clang these are built-ins. svn path=/trunk/; revision=62389 --- reactos/include/crt/mingw32/intrin_x86.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reactos/include/crt/mingw32/intrin_x86.h b/reactos/include/crt/mingw32/intrin_x86.h index d129b1ac700..c7a71455442 100644 --- a/reactos/include/crt/mingw32/intrin_x86.h +++ b/reactos/include/crt/mingw32/intrin_x86.h @@ -186,10 +186,12 @@ __INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Desti return __sync_val_compare_and_swap(Destination, Comperand, Exchange); } +#ifndef __clang__ __INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand) { return __sync_val_compare_and_swap(Destination, Comperand, Exchange); } +#endif __INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand) { @@ -224,10 +226,12 @@ __INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, co return __sync_fetch_and_add(Addend, Value); } +#ifndef __clang__ __INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const Addend, const long Value) { return __sync_fetch_and_add(Addend, Value); } +#endif #if defined(_M_AMD64) __INTRIN_INLINE long long _InterlockedExchangeAdd64(volatile long long * const Addend, const long long Value) @@ -302,6 +306,7 @@ __INTRIN_INLINE long long _InterlockedXor64(volatile long long * const value, co } #endif +#ifndef __clang__ __INTRIN_INLINE long _InterlockedDecrement(volatile long * const lpAddend) { return __sync_sub_and_fetch(lpAddend, 1); @@ -311,6 +316,7 @@ __INTRIN_INLINE long _InterlockedIncrement(volatile long * const lpAddend) { return __sync_add_and_fetch(lpAddend, 1); } +#endif __INTRIN_INLINE short _InterlockedDecrement16(volatile short * const lpAddend) { From 96b7e0dd7ba32ecc5069d57b7b11aa1d2b4b05c9 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 20:43:19 +0000 Subject: [PATCH 036/419] [NDK] * Fix a Clang warning. svn path=/trunk/; revision=62390 --- reactos/include/ndk/vffuncs.h | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/include/ndk/vffuncs.h b/reactos/include/ndk/vffuncs.h index 1ee2056d1b9..cd97645ecef 100644 --- a/reactos/include/ndk/vffuncs.h +++ b/reactos/include/ndk/vffuncs.h @@ -38,7 +38,6 @@ VfIsVerificationEnabled( ); VOID -NTAPI VfFailDeviceNode( _In_ PDEVICE_OBJECT PhysicalDeviceObject, _In_ ULONG BugCheckMajorCode, From 4916e626c0b3b1f09a65edea8706b3a5389b556c Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 20:47:34 +0000 Subject: [PATCH 037/419] [CMAKE] * Disable PCH in Clang builds. We'll inspect this later. svn path=/trunk/; revision=62391 --- reactos/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/CMakeLists.txt b/reactos/CMakeLists.txt index 68143311105..f590ed83578 100644 --- a/reactos/CMakeLists.txt +++ b/reactos/CMakeLists.txt @@ -134,7 +134,7 @@ else() add_definitions(-D_WINKD_=1) endif() - if((NOT DEFINED PCH) AND (CMAKE_VERSION STREQUAL "2.8.12.1-ReactOS")) + if((NOT DEFINED PCH) AND (CMAKE_VERSION STREQUAL "2.8.12.1-ReactOS") AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) set(PCH 1) else() set(PCH 0) From cb992793ac31ff8f68c0a4f8e7d02423369c5587 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 20:51:42 +0000 Subject: [PATCH 038/419] [CMAKE] * Add a Clang toolchain file. Only Windows build is tested ATM. svn path=/trunk/; revision=62392 --- reactos/toolchain-clang.cmake | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 reactos/toolchain-clang.cmake diff --git a/reactos/toolchain-clang.cmake b/reactos/toolchain-clang.cmake new file mode 100644 index 00000000000..930dafcacfa --- /dev/null +++ b/reactos/toolchain-clang.cmake @@ -0,0 +1,64 @@ + +if(NOT ARCH) + set(ARCH i386) +endif() + +# Choose the right MinGW toolchain prefix +if (NOT DEFINED MINGW_TOOLCHAIN_PREFIX) + if(ARCH STREQUAL "i386") + + if(CMAKE_HOST_WIN32) + set(MINGW_TOOLCHAIN_PREFIX "" CACHE STRING "MinGW Toolchain Prefix") + else() + if(NOT $ENV{_ROSBE_VERSION} VERSION_LESS 2.1) + set(MINGW_TOOLCHAIN_PREFIX "i686-w64-mingw32-" CACHE STRING "MinGW-W64 Toolchain Prefix") + else() + set(MINGW_TOOLCHAIN_PREFIX "mingw32-" CACHE STRING "MinGW Toolchain Prefix") + endif() + endif() + + elseif(ARCH STREQUAL "amd64") + set(MINGW_TOOLCHAIN_PREFIX "x86_64-w64-mingw32-" CACHE STRING "MinGW Toolchain Prefix") + elseif(ARCH STREQUAL "arm") + set(MINGW_TOOLCHAIN_PREFIX "arm-mingw32ce-" CACHE STRING "MinGW Toolchain Prefix") + endif() +endif() + +if (NOT DEFINED MINGW_TOOLCHAIN_SUFFIX) + set(MINGW_TOOLCHAIN_SUFFIX "" CACHE STRING "MinGW Toolchain Suffix") +endif() + +if(ENABLE_CCACHE) + set(CCACHE "ccache" CACHE STRING "ccache") +else() + set(CCACHE "" CACHE STRING "ccache") +endif() + +# The name of the target operating system +set(CMAKE_SYSTEM_NAME Windows) +set(CMAKE_SYSTEM_PROCESSOR i686) + +# Which tools to use +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_ASM_COMPILER ${MINGW_TOOLCHAIN_PREFIX}gcc${MINGW_TOOLCHAIN_SUFFIX}) +set(CMAKE_ASM_COMPILER_ID "GNU") +set(CMAKE_MC_COMPILER ${MINGW_TOOLCHAIN_PREFIX}windmc) +set(CMAKE_RC_COMPILER ${MINGW_TOOLCHAIN_PREFIX}windres) +set(CMAKE_DLLTOOL ${MINGW_TOOLCHAIN_PREFIX}dlltool) + +if(NOT LTCG) + set(CMAKE_C_CREATE_STATIC_LIBRARY " crT ") +else() + set(CMAKE_C_CREATE_STATIC_LIBRARY " cr ") +endif() +set(CMAKE_CXX_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) +set(CMAKE_ASM_CREATE_STATIC_LIBRARY ${CMAKE_C_CREATE_STATIC_LIBRARY}) + +# Don't link with anything by default unless we say so +set(CMAKE_C_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C Libraries") + +#MARK_AS_ADVANCED(CLEAR CMAKE_CXX_STANDARD_LIBRARIES) +set(CMAKE_CXX_STANDARD_LIBRARIES "-lgcc" CACHE STRING "Standard C++ Libraries") + +set(CMAKE_SHARED_LINKER_FLAGS_INIT "-nostdlib -Wl,--enable-auto-image-base,--disable-auto-import") From 9e835893d0f080676893add47f0dcc0e2f8c323b Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 2 Mar 2014 20:54:04 +0000 Subject: [PATCH 039/419] [PSEH3] - Switch parameters in _SEH3$_RegisterFrame and _SEH3$_RegisterTryLevel (just for consistency) - rename _SEH3$_RegisterTryLevel macro to _SEH3$_RegisterTryLevel_ - Add TryLevel and HandlerType fields to the scope table, since we'll need these later - Start factoring out some Clang specific macros svn path=/trunk/; revision=62393 --- reactos/include/reactos/libs/pseh/pseh3.h | 126 +++++++++++++++------- reactos/lib/pseh/i386/pseh3_i386.S | 52 ++++----- 2 files changed, 115 insertions(+), 63 deletions(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index 0b75e7df732..28a06410fdf 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -21,6 +21,8 @@ typedef struct _SEH3$_SCOPE_TABLE { void *Target; void *Filter; + unsigned char TryLevel; + unsigned char HandlerType; } SEH3$_SCOPE_TABLE, *PSEH3$_SCOPE_TABLE; typedef struct _SEH3$_EXCEPTION_POINTERS @@ -57,6 +59,7 @@ typedef struct _SEH3$_REGISTRATION_FRAME /* Prevent gcc from inlining functions that use SEH. */ static inline __attribute__((always_inline)) __attribute__((returns_twice)) void _SEH3$_PreventInlining() {} +/* Unregister the root frame */ extern inline __attribute__((always_inline,gnu_inline)) void _SEH3$_UnregisterFrame(volatile SEH3$_REGISTRATION_FRAME *RegistrationFrame) { @@ -64,6 +67,7 @@ void _SEH3$_UnregisterFrame(volatile SEH3$_REGISTRATION_FRAME *RegistrationFrame : : [NewHead] "ir" (RegistrationFrame->Next) : "memory"); } +/* Unregister a trylevel frame */ extern inline __attribute__((always_inline,gnu_inline)) void _SEH3$_UnregisterTryLevel( volatile SEH3$_REGISTRATION_FRAME *TrylevelFrame) @@ -84,41 +88,80 @@ int __cdecl __attribute__((error ("Can only be used inside a __finally block.")) unsigned long __cdecl __attribute__((error("Can only be used inside an exception filter or __except block."))) _exception_code(void); void * __cdecl __attribute__((error("Can only be used inside an exception filter."))) _exception_info(void); -/* Define the registers that get clobbered, when reaching the __except block. - We specify ebp on optimized builds without frame pointer, since it will be - used by GCC as a general purpose register then. */ -#if defined(__OPTIMIZE__) && defined(_ALLOW_OMIT_FRAME_POINTER) -#define _SEH3$_CLOBBER_ON_EXCEPTION "ebp", "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" -#else -#define _SEH3$_CLOBBER_ON_EXCEPTION "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" -#endif - /* This attribute allows automatic cleanup of the registered frames */ #define _SEH3$_AUTO_CLEANUP __attribute__((cleanup(_SEH3$_AutoCleanup))) -#define _SEH3$_ASM_GOTO(_Asm, _Label, ...) asm goto (_Asm : : : "memory", ## __VA_ARGS__ : _Label) +/* CLANG specific definitions! */ +#ifdef __clang__ + +/* CLANG doesn't have asm goto! */ +#define _SEH3$_ASM_GOTO(_Label, ...) + +int +__attribute__((regparm(2))) +__attribute__((returns_twice)) +_SEH3$_RegisterFrameWithNonVolatiles( + volatile SEH3$_REGISTRATION_FRAME* RegistrationFrame, + const SEH3$_SCOPE_TABLE* ScopeTable); + +#define _SEH3$_RegisterFrame_(_TrylevelFrame, _DataTable) \ + do { \ + int result = _SEH3$_RegisterFrameWithNonVolatiles(_TrylevelFrame, _DataTable); \ + if (__builtin_expect(result != 0, 0)) \ + { \ + if (result == 1) goto _SEH3$_l_FilterOrFinally; \ + if (result == 2) goto _SEH3$_l_HandlerTarget; \ + goto _SEH3$_l_BeforeFilterOrFinally; \ + } \ + } while(0) + +int +__attribute__((regparm(2))) +__attribute__((returns_twice)) +_SEH3$_RegisterTryLevelWithNonVolatiles( + volatile SEH3$_REGISTRATION_FRAME* RegistrationFrame, + const SEH3$_SCOPE_TABLE* ScopeTable); + +#define _SEH3$_RegisterTryLevel_(_TrylevelFrame, _DataTable) \ + do { \ + int result = _SEH3$_RegisterTryLevelWithNonVolatiles(_TrylevelFrame, _DataTable); \ + if (__builtin_expect(result != 0, 0)) \ + { \ + if (result == 1) goto _SEH3$_l_FilterOrFinally; \ + if (result == 2) goto _SEH3$_l_HandlerTarget; \ + goto _SEH3$_l_BeforeFilterOrFinally; \ + } \ + } while(0) + +#else /* !__clang__ */ + +#define _SEH3$_ASM_GOTO(_Label, ...) asm goto ("#\n" : : : "memory", ## __VA_ARGS__ : _Label) + +/* This is an asm wrapper around _SEH3$_RegisterFrame */ +#define _SEH3$_RegisterFrame_(_TrylevelFrame, _DataTable) \ + asm goto ("leal %1, %%edx\n" \ + "call __SEH3$_RegisterFrame\n" \ + : \ + : "a" (_TrylevelFrame), "m" (*(_DataTable)) \ + : "ecx", "edx", "memory" \ + : _SEH3$_l_HandlerTarget) + +/* This is an asm wrapper around _SEH3$_RegisterTryLevel */ +#define _SEH3$_RegisterTryLevel_(_TrylevelFrame, _DataTable) \ + asm goto ("leal %1, %%edx\n" \ + "call __SEH3$_RegisterTryLevel\n" \ + : \ + : "a" (_TrylevelFrame), "m" (*(_DataTable)) \ + : "ecx", "edx", "memory" \ + : _SEH3$_l_HandlerTarget) + +#endif /* __clang__ */ + #define _SEH3$_DECLARE_EXCEPT_INTRINSICS() \ inline __attribute__((always_inline, gnu_inline)) \ unsigned long _exception_code() { return _SEH3$_TrylevelFrame.ExceptionPointers->ExceptionRecord->ExceptionCode; } -/* This is an asm wrapper around _SEH3$_RegisterFrame */ -#define _SEH3$_RegisterFrame(_TrylevelFrame, _DataTable, _Target) \ - asm goto ("leal %0, %%edx\n" \ - "call __SEH3$_RegisterFrame\n" \ - : \ - : "m" (*(_TrylevelFrame)), "a" (_DataTable) \ - : "ecx", "edx", "memory" \ - : _Target) - -/* This is an asm wrapper around _SEH3$_EnterTryLevel */ -#define _SEH3$_RegisterTryLevel(_TrylevelFrame, _DataTable, _Target) \ - asm goto ("leal %0, %%edx\n" \ - "call __SEH3$_RegisterTryLevel\n" \ - : \ - : "m" (*(_TrylevelFrame)), "a" (_DataTable) \ - : "ecx", "edx", "memory" \ - : _Target) /* On GCC the filter function is a nested function with __fastcall calling convention. The eax register contains a base address the function uses @@ -176,13 +219,22 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter _SEH3$_FinallyFunction(1); \ } +/* Define the registers that get clobbered, when reaching the __except block. + We specify ebp on optimized builds without frame pointer, since it will be + used by GCC as a general purpose register then. */ +#if defined(__OPTIMIZE__) && defined(_ALLOW_OMIT_FRAME_POINTER) +#define _SEH3$_CLOBBER_ON_EXCEPTION "ebp", "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" +#else +#define _SEH3$_CLOBBER_ON_EXCEPTION "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" +#endif + /* This construct scares GCC so much, that it will stop moving code around into places that are never executed. */ #define _SEH3$_SCARE_GCC() \ void *plabel; \ - _SEH3$_ASM_GOTO("#\n", _SEH3$_l_BeforeTry); \ - _SEH3$_ASM_GOTO("#\n", _SEH3$_l_HandlerTarget); \ - _SEH3$_ASM_GOTO("#\n", _SEH3$_l_OnException); \ + _SEH3$_ASM_GOTO(_SEH3$_l_BeforeTry); \ + _SEH3$_ASM_GOTO(_SEH3$_l_HandlerTarget); \ + _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ asm volatile ("#" : "=a"(plabel) : "p"(&&_SEH3$_l_BeforeTry), "p"(&&_SEH3$_l_HandlerTarget), "p"(&&_SEH3$_l_OnException) \ : _SEH3$_CLOBBER_ON_EXCEPTION ); \ goto _SEH3$_l_OnException; @@ -226,7 +278,7 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter goto _SEH3$_l_EndTry; \ \ _SEH3$_l_BeforeTry: (void)0; \ - _SEH3$_ASM_GOTO("#\n", _SEH3$_l_OnException); \ + _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ \ /* Forward declaration of the filter function */ \ _SEH3$_DECLARE_FILTER_FUNC(_SEH3$_FilterFunction); \ @@ -235,8 +287,8 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter static const SEH3$_SCOPE_TABLE _SEH3$_ScopeTable = { &&_SEH3$_l_HandlerTarget, _SEH3$_FILTER(&_SEH3$_FilterFunction, (__VA_ARGS__)) }; \ \ /* Register the registration record. */ \ - if (_SEH3$_TryLevel == 1) _SEH3$_RegisterFrame(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable, _SEH3$_l_HandlerTarget); \ - else _SEH3$_RegisterTryLevel(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable, _SEH3$_l_HandlerTarget); \ + if (_SEH3$_TryLevel == 1) _SEH3$_RegisterFrame_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ + else _SEH3$_RegisterTryLevel_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ \ /* Emit the filter function */ \ _SEH3$_DEFINE_FILTER_FUNC(_SEH3$_FilterFunction, (__VA_ARGS__)) \ @@ -268,7 +320,7 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter goto _SEH3$_l_EndTry; \ \ _SEH3$_l_BeforeTry: (void)0; \ - _SEH3$_ASM_GOTO("#\n", _SEH3$_l_OnException); \ + _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ \ /* Forward declaration of the finally function */ \ _SEH3$_DECLARE_FILTER_FUNC(_SEH3$_FinallyFunction); \ @@ -277,8 +329,8 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter static const SEH3$_SCOPE_TABLE _SEH3$_ScopeTable = { 0, &_SEH3$_FinallyFunction }; \ \ /* Register the registration record. */ \ - if (_SEH3$_TryLevel == 1) _SEH3$_RegisterFrame(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable, _SEH3$_l_HandlerTarget); \ - else _SEH3$_RegisterTryLevel(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable, _SEH3$_l_HandlerTarget); \ + if (_SEH3$_TryLevel == 1) _SEH3$_RegisterFrame_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ + else _SEH3$_RegisterTryLevel_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ \ goto _SEH3$_l_DoTry; \ \ @@ -300,7 +352,7 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter _SEH3$_SCARE_GCC() \ \ _SEH3$_l_EndTry:(void)0; \ - _SEH3$_ASM_GOTO("#\n", _SEH3$_l_OnException); \ + _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ \ /* Implementation of the auto cleanup function */ \ _SEH3$_DEFINE_CLEANUP_FUNC(_SEH3$_AutoCleanup); \ diff --git a/reactos/lib/pseh/i386/pseh3_i386.S b/reactos/lib/pseh/i386/pseh3_i386.S index e647312ee74..bd37a74642f 100644 --- a/reactos/lib/pseh/i386/pseh3_i386.S +++ b/reactos/lib/pseh/i386/pseh3_i386.S @@ -18,37 +18,37 @@ * __attribute__((regparm(2))) * __attribute__((returns_twice)) * _SEH3$_RegisterFrame[WithNonVolatiles]( - * PSEH_DATA_TABLE DataTable, - * PSEH_REGISTRATION_FRAME RegistrationRecord); + * PSEH3$_REGISTRATION_FRAME RegistrationFrame, + * PSEH3$_SCOPE_TABLE ScopeTable); */ .global __SEH3$_RegisterFrameWithNonVolatiles __SEH3$_RegisterFrameWithNonVolatiles: /* Save non-volatiles in the registration frame */ - mov [edx + SEH3_REGISTRATION_FRAME_Ebx], ebx - mov [edx + SEH3_REGISTRATION_FRAME_Esi], esi - mov [edx + SEH3_REGISTRATION_FRAME_Edi], edi + mov [eax + SEH3_REGISTRATION_FRAME_Ebx], ebx + mov [eax + SEH3_REGISTRATION_FRAME_Esi], esi + mov [eax + SEH3_REGISTRATION_FRAME_Edi], edi .global __SEH3$_RegisterFrame __SEH3$_RegisterFrame: /* Save the address of the static data table */ - mov [edx + SEH3_REGISTRATION_FRAME_ScopeTable], eax + mov [eax + SEH3_REGISTRATION_FRAME_ScopeTable], edx /* Set the handler address */ - mov dword ptr [edx + SEH3_REGISTRATION_FRAME_Handler], offset __SEH3$_except_handler + mov dword ptr [eax + SEH3_REGISTRATION_FRAME_Handler], offset __SEH3$_except_handler /* Set this as the end of the internal chain */ - mov dword ptr [edx + SEH3_REGISTRATION_FRAME_EndOfChain], edx + mov dword ptr [eax + SEH3_REGISTRATION_FRAME_EndOfChain], eax /* Register the frame in the TEB */ - mov eax, dword ptr fs:[0] - mov [edx + SEH3_REGISTRATION_FRAME_Next], eax - mov dword ptr fs:[0], edx + mov edx, dword ptr fs:[0] + mov [eax + SEH3_REGISTRATION_FRAME_Next], edx + mov dword ptr fs:[0], eax /* Save the stack registers */ - mov [edx + SEH3_REGISTRATION_FRAME_Esp], esp - mov [edx + SEH3_REGISTRATION_FRAME_Ebp], ebp + mov [eax + SEH3_REGISTRATION_FRAME_Esp], esp + mov [eax + SEH3_REGISTRATION_FRAME_Ebp], ebp /* Set eax to 0 to indicate 1st return */ xor eax, eax @@ -60,39 +60,39 @@ __SEH3$_RegisterFrame: * __attribute__((regparm(2))) * __attribute__((returns_twice)) * _SEH3$_RegisterTryLevel[WithNonVolatiles]( - * PSEH_DATA_TABLE DataTable, - * PSEH_REGISTRATION_FRAME RegistrationRecord); + * PSEH3$_REGISTRATION_FRAME RegistrationFrame, + * PSEH3$_SCOPE_TABLE ScopeTable); */ .global __SEH3$_RegisterTryLevelWithNonVolatiles __SEH3$_RegisterTryLevelWithNonVolatiles: /* Save non-volatiles in the registration frame */ - mov [edx + SEH3_REGISTRATION_FRAME_Ebx], ebx - mov [edx + SEH3_REGISTRATION_FRAME_Esi], esi - mov [edx + SEH3_REGISTRATION_FRAME_Edi], edi + mov [eax + SEH3_REGISTRATION_FRAME_Ebx], ebx + mov [eax + SEH3_REGISTRATION_FRAME_Esi], esi + mov [eax + SEH3_REGISTRATION_FRAME_Edi], edi .global __SEH3$_RegisterTryLevel __SEH3$_RegisterTryLevel: /* Save the address of the static data table */ - mov [edx + SEH3_REGISTRATION_FRAME_ScopeTable], eax + mov [eax + SEH3_REGISTRATION_FRAME_ScopeTable], edx /* Set the handler address to NULL as identification */ - and dword ptr [edx + SEH3_REGISTRATION_FRAME_Handler], 0 + and dword ptr [eax + SEH3_REGISTRATION_FRAME_Handler], 0 /* Get the current registered frame */ - mov eax, dword ptr fs:[0] + mov edx, dword ptr fs:[0] /* Get the current end of the chain and set this as Next */ - mov ecx, [eax + SEH3_REGISTRATION_FRAME_EndOfChain] - mov [edx + SEH3_REGISTRATION_FRAME_Next], ecx + mov ecx, [edx + SEH3_REGISTRATION_FRAME_EndOfChain] + mov [eax + SEH3_REGISTRATION_FRAME_Next], ecx /* Set this as the end of the internal chain */ - mov dword ptr [eax + SEH3_REGISTRATION_FRAME_EndOfChain], edx + mov dword ptr [edx + SEH3_REGISTRATION_FRAME_EndOfChain], eax /* Save the stack registers */ - mov [edx + SEH3_REGISTRATION_FRAME_Esp], esp - mov [edx + SEH3_REGISTRATION_FRAME_Ebp], ebp + mov [eax + SEH3_REGISTRATION_FRAME_Esp], esp + mov [eax + SEH3_REGISTRATION_FRAME_Ebp], ebp /* Set eax to 0 to indicate 1st return */ xor eax, eax From d4a5969c226b3cc07bbce22d09925e72f27a1f55 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 20:57:57 +0000 Subject: [PATCH 040/419] [CMAKE] * Remove some unsupported warning from the Clang build. svn path=/trunk/; revision=62394 --- reactos/lib/3rdparty/cardlib/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/lib/3rdparty/cardlib/CMakeLists.txt b/reactos/lib/3rdparty/cardlib/CMakeLists.txt index 87cbb500bd4..8369f57d970 100644 --- a/reactos/lib/3rdparty/cardlib/CMakeLists.txt +++ b/reactos/lib/3rdparty/cardlib/CMakeLists.txt @@ -19,6 +19,6 @@ add_library(cardlib ${SOURCE}) add_dependencies(cardlib psdk) add_pch(cardlib cardlib.h SOURCE) -if(NOT MSVC) +if(NOT MSVC AND (NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")) add_target_compile_flags(cardlib "-Wno-unused-but-set-variable") endif() From 0dd2f479dc87434ca481d19ef32861a8d74c4f10 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 21:04:20 +0000 Subject: [PATCH 041/419] [SHELL32] * Remove what seems to be a useless source file. This variable is defined and used in shell32_main.cpp. svn path=/trunk/; revision=62395 --- reactos/dll/win32/shell32/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/shell32/CMakeLists.txt b/reactos/dll/win32/shell32/CMakeLists.txt index f84298872e7..f7fb726678d 100644 --- a/reactos/dll/win32/shell32/CMakeLists.txt +++ b/reactos/dll/win32/shell32/CMakeLists.txt @@ -16,7 +16,7 @@ include_directories( spec2def(shell32.dll shell32.spec ADD_IMPORTLIB) list(APPEND SOURCE - authors.cpp + #authors.cpp autocomplete.cpp brsfolder.cpp changenotify.cpp @@ -54,6 +54,7 @@ list(APPEND SOURCE folders/fonts.cpp folders/cpanel.cpp folders/recyclebin.cpp + droptargets/CexeDropHandler.cpp shlexec.cpp shlfileop.cpp shlfolder.cpp From 257374c12b195ae1aaaf2e59df1bc5b392810cb8 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 21:18:32 +0000 Subject: [PATCH 042/419] [PSDK] * Don't warn about ignored attributes in Clang build. svn path=/trunk/; revision=62396 --- reactos/include/psdk/strsafe.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/include/psdk/strsafe.h b/reactos/include/psdk/strsafe.h index f3f7eac7f21..0a891601520 100644 --- a/reactos/include/psdk/strsafe.h +++ b/reactos/include/psdk/strsafe.h @@ -12,6 +12,11 @@ #include #include +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wignored-attributes" +#endif + #ifndef _SIZE_T_DEFINED #define _SIZE_T_DEFINED #undef size_t @@ -2059,4 +2064,9 @@ STRSAFE_INLINE_API StringGetsExWorkerW(STRSAFE_LPWSTR pszDest,size_t cchDest,siz #undef _getws #define _getws _getws_instead_use_StringCbGetsW_or_StringCchGetsW; #endif + +#ifdef __clang__ +#pragma clang diagnostic pop #endif + +#endif /* _STRSAFE_H_INCLUDED_ */ From 4d03b99484d435856e14c166b387564ad9317eac Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 21:23:04 +0000 Subject: [PATCH 043/419] [PSDK][SHELL32] * Fix ShellMessageBox{A,W} calling convention. Spotted by Clang. svn path=/trunk/; revision=62397 --- reactos/dll/win32/shell32/shellord.cpp | 4 ++-- reactos/include/psdk/shellapi.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/shell32/shellord.cpp b/reactos/dll/win32/shell32/shellord.cpp index 629e1f832cd..6d19541fb11 100644 --- a/reactos/dll/win32/shell32/shellord.cpp +++ b/reactos/dll/win32/shell32/shellord.cpp @@ -309,7 +309,7 @@ BOOL WINAPI RegisterShellHook( * ordinal. If you change the implementation here please update the code in * shlwapi as well. */ -EXTERN_C int WINAPI ShellMessageBoxW( +EXTERN_C int ShellMessageBoxW( HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText, @@ -367,7 +367,7 @@ EXTERN_C int WINAPI ShellMessageBoxW( * NOTES * Exported by ordinal */ -EXTERN_C int WINAPI ShellMessageBoxA( +EXTERN_C int ShellMessageBoxA( HINSTANCE hInstance, HWND hWnd, LPCSTR lpText, diff --git a/reactos/include/psdk/shellapi.h b/reactos/include/psdk/shellapi.h index b4c2c13d73e..a116c918b95 100644 --- a/reactos/include/psdk/shellapi.h +++ b/reactos/include/psdk/shellapi.h @@ -476,7 +476,6 @@ ShellAboutW( _In_opt_ HICON hIcon); int -WINAPI ShellMessageBoxA( _In_opt_ HINSTANCE hAppInst, _In_opt_ HWND hWnd, @@ -486,7 +485,6 @@ ShellMessageBoxA( ...); int -WINAPI ShellMessageBoxW( _In_opt_ HINSTANCE hAppInst, _In_opt_ HWND hWnd, From a82fcfc024832c72b9d5fc11c2d9b85193ebab07 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 21:35:18 +0000 Subject: [PATCH 044/419] [SHELL32] * Remove accidentally added line (you'll get this Drag and Drop fun later ;) ). svn path=/trunk/; revision=62398 --- reactos/dll/win32/shell32/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/dll/win32/shell32/CMakeLists.txt b/reactos/dll/win32/shell32/CMakeLists.txt index f7fb726678d..f0c920e3409 100644 --- a/reactos/dll/win32/shell32/CMakeLists.txt +++ b/reactos/dll/win32/shell32/CMakeLists.txt @@ -54,7 +54,6 @@ list(APPEND SOURCE folders/fonts.cpp folders/cpanel.cpp folders/recyclebin.cpp - droptargets/CexeDropHandler.cpp shlexec.cpp shlfileop.cpp shlfolder.cpp From cdcdc82cda33bb67fad7cd4890d07bdfb5661f1e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 21:40:58 +0000 Subject: [PATCH 045/419] [LIB/ATL] * Who came up with this _declspec thing ? Was it you Arch ? svn path=/trunk/; revision=62399 --- reactos/lib/atl/atlwin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/lib/atl/atlwin.h b/reactos/lib/atl/atlwin.h index cc925758585..7e4f10462f9 100644 --- a/reactos/lib/atl/atlwin.h +++ b/reactos/lib/atl/atlwin.h @@ -360,7 +360,7 @@ public: } }; -_declspec(selectany) RECT CWindow::rcDefault = { CW_USEDEFAULT, CW_USEDEFAULT, 0, 0 }; +__declspec(selectany) RECT CWindow::rcDefault = { CW_USEDEFAULT, CW_USEDEFAULT, 0, 0 }; template class CWindowImplBaseT : public TBase, public CMessageMap From 665aba875f83f946e4bce96369c0778754cf9ce7 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 21:42:19 +0000 Subject: [PATCH 046/419] [PSDK] * Fix a FIXME.. Actually, the LLVM/Clang folks did this ;) svn path=/trunk/; revision=62400 --- reactos/include/psdk/guiddef.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/reactos/include/psdk/guiddef.h b/reactos/include/psdk/guiddef.h index 5b7f7267872..be843cc085f 100644 --- a/reactos/include/psdk/guiddef.h +++ b/reactos/include/psdk/guiddef.h @@ -32,13 +32,8 @@ typedef struct _GUID #endif #ifndef DECLSPEC_SELECTANY -#ifdef __clang__ -/* FIXME: http://llvm.org/bugs/show_bug.cgi?id=13778 */ -#define DECLSPEC_SELECTANY __attribute__((weak)) -#else #define DECLSPEC_SELECTANY __declspec(selectany) #endif -#endif #ifndef EXTERN_C #ifdef __cplusplus From 2948ed43c56c76ce78a5609c469ba9871351d1fb Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 21:45:44 +0000 Subject: [PATCH 047/419] [SHELL32] * Comment out some unused variables. * Remove some unused default debug channel declarations. svn path=/trunk/; revision=62401 --- reactos/dll/win32/shell32/CMenuDeskBar.cpp | 3 --- reactos/dll/win32/shell32/folders.cpp | 2 -- reactos/dll/win32/shell32/shellpath.cpp | 12 ++++++++---- reactos/dll/win32/shell32/shpolicy.cpp | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/reactos/dll/win32/shell32/CMenuDeskBar.cpp b/reactos/dll/win32/shell32/CMenuDeskBar.cpp index 140b663794a..485553b4e8f 100644 --- a/reactos/dll/win32/shell32/CMenuDeskBar.cpp +++ b/reactos/dll/win32/shell32/CMenuDeskBar.cpp @@ -1,7 +1,5 @@ #include "precomp.h" -WINE_DEFAULT_DEBUG_CHANNEL(shell); - HRESULT STDMETHODCALLTYPE CMenuDeskBar::Popup( POINTL *ppt, RECTL *prcExclude, @@ -137,4 +135,3 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::TranslateAcceleratorIO(THIS_ LPMSG lpMsg { return S_OK; } - diff --git a/reactos/dll/win32/shell32/folders.cpp b/reactos/dll/win32/shell32/folders.cpp index 14501642d0d..9df6d6d4744 100644 --- a/reactos/dll/win32/shell32/folders.cpp +++ b/reactos/dll/win32/shell32/folders.cpp @@ -19,8 +19,6 @@ #include "precomp.h" -WINE_DEFAULT_DEBUG_CHANNEL(shell); - WCHAR swShell32Name[MAX_PATH]; DWORD NumIconOverlayHandlers = 0; diff --git a/reactos/dll/win32/shell32/shellpath.cpp b/reactos/dll/win32/shell32/shellpath.cpp index 8511feffda9..de7e7e72ef7 100644 --- a/reactos/dll/win32/shell32/shellpath.cpp +++ b/reactos/dll/win32/shell32/shellpath.cpp @@ -564,16 +564,20 @@ static const WCHAR DefaultW[] = {'.','D','e','f','a','u','l','t','\0'}; static const WCHAR AllUsersProfileW[] = {'%','A','L','L','U','S','E','R','S','P','R','O','F','I','L','E','%','\0'}; static const WCHAR UserProfileW[] = {'%','U','S','E','R','P','R','O','F','I','L','E','%','\0'}; static const WCHAR SystemDriveW[] = {'%','S','y','s','t','e','m','D','r','i','v','e','%','\0'}; +static const WCHAR szSHFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; +static const WCHAR szSHUserFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; + +#if 0 static const WCHAR ProfileListW[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s',' ','N','T','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','P','r','o','f','i','l','e','L','i','s','t',0}; static const WCHAR ProfilesDirectoryW[] = {'P','r','o','f','i','l','e','s','D','i','r','e','c','t','o','r','y',0}; static const WCHAR AllUsersProfileValueW[] = {'A','l','l','U','s','e','r','s','P','r','o','f','i','l','e','\0'}; -static const WCHAR szSHFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; -static const WCHAR szSHUserFolders[] = {'S','o','f','t','w','a','r','e','\\','M','i','c','r','o','s','o','f','t','\\','W','i','n','d','o','w','s','\\','C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\','E','x','p','l','o','r','e','r','\\','U','s','e','r',' ','S','h','e','l','l',' ','F','o','l','d','e','r','s','\0'}; +static const WCHAR szDefaultProfileDirW[] = {'p','r','o','f','i','l','e','s','\0'}; +static const WCHAR AllUsersW[] = {'A','l','l',' ','U','s','e','r','s','\0'}; +#endif + /* This defaults to L"Documents and Settings" on Windows 2000/XP, but we're * acting more Windows 9x-like for now. */ -static const WCHAR szDefaultProfileDirW[] = {'p','r','o','f','i','l','e','s','\0'}; -static const WCHAR AllUsersW[] = {'A','l','l',' ','U','s','e','r','s','\0'}; typedef enum _CSIDL_Type { CSIDL_Type_User, diff --git a/reactos/dll/win32/shell32/shpolicy.cpp b/reactos/dll/win32/shell32/shpolicy.cpp index c9f0ef3668e..69d92968da1 100644 --- a/reactos/dll/win32/shell32/shpolicy.cpp +++ b/reactos/dll/win32/shell32/shpolicy.cpp @@ -67,7 +67,7 @@ static const char strNoChangeStartMenu[] = {"NoChangeStartMenu"}; static const char strNoWindowsUpdate[] = {"NoWindowsUpdate"}; static const char strNoSetActiveDesktop[] = {"NoSetActiveDesktop"}; static const char strNoForgetSoftwareUpdate[] = {"NoForgetSoftwareUpdate"}; -static const char strNoMSAppLogo[] = {"NoMSAppLogo5ChannelNotify"}; +//static const char strNoMSAppLogo[] = {"NoMSAppLogo5ChannelNotify"}; static const char strForceCopyACLW[] = {"ForceCopyACLWithFile"}; static const char strNoResolveTrk[] = {"NoResolveTrack"}; static const char strNoResolveSearch[] = {"NoResolveSearch"}; From a12d2d5e6cd6d664235d65e539c8d5c97da0ee58 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 2 Mar 2014 22:04:15 +0000 Subject: [PATCH 048/419] [PSEH3] Start factoring out compiler support for nested functions (neither CLANG not C++ support it, so we will add some other crazy hacks later ;-)) svn path=/trunk/; revision=62402 --- reactos/include/reactos/libs/pseh/pseh3.h | 64 +++++++++++++++-------- reactos/lib/pseh/i386/pseh3.c | 5 +- 2 files changed, 45 insertions(+), 24 deletions(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index 28a06410fdf..16a179089a8 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -89,7 +89,7 @@ unsigned long __cdecl __attribute__((error("Can only be used inside an exception void * __cdecl __attribute__((error("Can only be used inside an exception filter."))) _exception_info(void); /* This attribute allows automatic cleanup of the registered frames */ -#define _SEH3$_AUTO_CLEANUP __attribute__((cleanup(_SEH3$_AutoCleanup))) +#define _SEH3$_AUTO_CLEANUP __attribute__((cleanup(_SEH3$_Unregister))) /* CLANG specific definitions! */ #ifdef __clang__ @@ -133,6 +133,8 @@ _SEH3$_RegisterTryLevelWithNonVolatiles( } \ } while(0) +#define _SEH3$_SCARE_GCC() + #else /* !__clang__ */ #define _SEH3$_ASM_GOTO(_Label, ...) asm goto ("#\n" : : : "memory", ## __VA_ARGS__ : _Label) @@ -155,14 +157,49 @@ _SEH3$_RegisterTryLevelWithNonVolatiles( : "ecx", "edx", "memory" \ : _SEH3$_l_HandlerTarget) +/* Define the registers that get clobbered, when reaching the __except block. + We specify ebp on optimized builds without frame pointer, since it will be + used by GCC as a general purpose register then. */ +#if defined(__OPTIMIZE__) && defined(_ALLOW_OMIT_FRAME_POINTER) +#define _SEH3$_CLOBBER_ON_EXCEPTION "ebp", "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" +#else +#define _SEH3$_CLOBBER_ON_EXCEPTION "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" +#endif + +/* This construct scares GCC so much, that it will stop moving code + around into places that are never executed. */ +#define _SEH3$_SCARE_GCC() \ + void *plabel; \ + _SEH3$_ASM_GOTO(_SEH3$_l_BeforeTry); \ + _SEH3$_ASM_GOTO(_SEH3$_l_HandlerTarget); \ + _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ + asm volatile ("#" : "=a"(plabel) : "p"(&&_SEH3$_l_BeforeTry), "p"(&&_SEH3$_l_HandlerTarget), "p"(&&_SEH3$_l_OnException) \ + : _SEH3$_CLOBBER_ON_EXCEPTION ); \ + goto _SEH3$_l_OnException; + #endif /* __clang__ */ +/* Neither CLANG nor C++ support nested functions */ +#if defined(__cplusplus) || defined(__clang__) + +/* Use the global unregister function */ +void +__attribute__((regparm(1))) +_SEH3$_Unregister( + volatile SEH3$_REGISTRATION_FRAME *Frame); + +/* These are only dummies here */ +#define _SEH3$_DECLARE_CLEANUP_FUNC(_Name) +#define _SEH3$_DEFINE_CLEANUP_FUNC(_Name) +#define _SEH3$_DECLARE_FILTER_FUNC(_Name) +#define _SEH3$_DEFINE_DUMMY_FINALLY(_Name) + +#else /* __cplusplus || __clang__ */ #define _SEH3$_DECLARE_EXCEPT_INTRINSICS() \ inline __attribute__((always_inline, gnu_inline)) \ unsigned long _exception_code() { return _SEH3$_TrylevelFrame.ExceptionPointers->ExceptionRecord->ExceptionCode; } - /* On GCC the filter function is a nested function with __fastcall calling convention. The eax register contains a base address the function uses to address the callers stack frame. __fastcall is chosen, because it gives @@ -219,25 +256,8 @@ _SEH3$_RegisterTryLevelWithNonVolatiles( _SEH3$_FinallyFunction(1); \ } -/* Define the registers that get clobbered, when reaching the __except block. - We specify ebp on optimized builds without frame pointer, since it will be - used by GCC as a general purpose register then. */ -#if defined(__OPTIMIZE__) && defined(_ALLOW_OMIT_FRAME_POINTER) -#define _SEH3$_CLOBBER_ON_EXCEPTION "ebp", "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" -#else -#define _SEH3$_CLOBBER_ON_EXCEPTION "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" -#endif +#endif /* __cplusplus || __clang__ */ -/* This construct scares GCC so much, that it will stop moving code - around into places that are never executed. */ -#define _SEH3$_SCARE_GCC() \ - void *plabel; \ - _SEH3$_ASM_GOTO(_SEH3$_l_BeforeTry); \ - _SEH3$_ASM_GOTO(_SEH3$_l_HandlerTarget); \ - _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ - asm volatile ("#" : "=a"(plabel) : "p"(&&_SEH3$_l_BeforeTry), "p"(&&_SEH3$_l_HandlerTarget), "p"(&&_SEH3$_l_OnException) \ - : _SEH3$_CLOBBER_ON_EXCEPTION ); \ - goto _SEH3$_l_OnException; #define _SEH3_TRY \ @@ -259,7 +279,7 @@ _SEH3$_RegisterTryLevelWithNonVolatiles( }; \ \ /* Forward declaration of the auto cleanup function */ \ - _SEH3$_DECLARE_CLEANUP_FUNC(_SEH3$_AutoCleanup); \ + _SEH3$_DECLARE_CLEANUP_FUNC(_SEH3$_Unregister); \ \ /* Allocate a registration frame */ \ volatile SEH3$_REGISTRATION_FRAME _SEH3$_AUTO_CLEANUP _SEH3$_TrylevelFrame; \ @@ -355,7 +375,7 @@ _SEH3$_RegisterTryLevelWithNonVolatiles( _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ \ /* Implementation of the auto cleanup function */ \ - _SEH3$_DEFINE_CLEANUP_FUNC(_SEH3$_AutoCleanup); \ + _SEH3$_DEFINE_CLEANUP_FUNC(_SEH3$_Unregister); \ \ /* Close the outer scope */ \ } while (0); diff --git a/reactos/lib/pseh/i386/pseh3.c b/reactos/lib/pseh/i386/pseh3.c index 1d37ca0a981..47d742d3f98 100644 --- a/reactos/lib/pseh/i386/pseh3.c +++ b/reactos/lib/pseh/i386/pseh3.c @@ -50,8 +50,9 @@ C_ASSERT(SEH3_REGISTRATION_FRAME_Ebp == FIELD_OFFSET(SEH3$_REGISTRATION_FRAME, E C_ASSERT(SEH3_SCOPE_TABLE_Filter == FIELD_OFFSET(SEH3$_SCOPE_TABLE, Filter)); C_ASSERT(SEH3_SCOPE_TABLE_Target == FIELD_OFFSET(SEH3$_SCOPE_TABLE, Target)); -static inline -void _SEH3$_Unregister( +void +__attribute__((regparm(1))) +_SEH3$_Unregister( volatile SEH3$_REGISTRATION_FRAME *Frame) { if (Frame->Handler) From 35bcabdf0031494a2c4971a56b86ba34fb9df45c Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 2 Mar 2014 22:11:49 +0000 Subject: [PATCH 049/419] [CMAKE] * Don't treat warnings like errors in the Clang build just yet. svn path=/trunk/; revision=62403 --- reactos/cmake/gcc.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index 5f2c99d6470..9c31f25cce0 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -73,7 +73,11 @@ else() endif() # Warnings, errors -add_compile_flags("-Werror -Wall -Wpointer-arith") +if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") + add_compile_flags("-Werror") +endif() + +add_compile_flags("-Wall -Wpointer-arith") add_compile_flags("-Wno-char-subscripts -Wno-multichar -Wno-unused-value") if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") From 53b9cb60dc643c8f2a313868899f90abaa66b830 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sun, 2 Mar 2014 22:39:02 +0000 Subject: [PATCH 050/419] - Code cleanup and update. Change trace to error for tracking. svn path=/trunk/; revision=62404 --- reactos/win32ss/user/ntuser/winpos.c | 72 +--------------------------- 1 file changed, 2 insertions(+), 70 deletions(-) diff --git a/reactos/win32ss/user/ntuser/winpos.c b/reactos/win32ss/user/ntuser/winpos.c index da0f7e8f985..7919b9a0639 100644 --- a/reactos/win32ss/user/ntuser/winpos.c +++ b/reactos/win32ss/user/ntuser/winpos.c @@ -1381,7 +1381,7 @@ co_WinPosDoWinPosChanging(PWND Window, * * FIXME: hide/show owned popups when owner visibility changes. * - * ReactOS: See bug 6751 and 7228. + * ReactOS: See bug CORE-6129 and CORE-6554. * */ //// @@ -1450,7 +1450,7 @@ WinPosDoOwnedPopups(PWND Window, HWND hWndInsertAfter) if (hWndInsertAfter == HWND_BOTTOM) { - TRACE("Window is HWND_BOTTOM\n"); + ERR("Window is HWND_BOTTOM\n"); if (List) ExFreePoolWithTag(List, USERTAG_WINDOWLIST); goto done; } @@ -1721,7 +1721,6 @@ co_WinPosSetWindowPos( RECTL CopyRect; PWND Ancestor; BOOL bPointerInWindow; - //BOOL bNoTopMost; ASSERT_REFS_CO(Window); @@ -1760,9 +1759,6 @@ co_WinPosSetWindowPos( co_WinPosDoWinPosChanging(Window, &WinPos, &NewWindowRect, &NewClientRect); - // HWND_NOTOPMOST is redirected in WinPosFixupFlags. - //bNoTopMost = WndInsertAfter == HWND_NOTOPMOST; - /* Does the window still exist? */ if (!IntIsWindow(WinPos.hwnd)) { @@ -1823,70 +1819,6 @@ co_WinPosSetWindowPos( if (!(WinPos.flags & SWP_NOZORDER) && WinPos.hwnd != UserGetShellWindow()) { IntLinkHwnd(Window, WinPos.hwndInsertAfter); -#if 0 - //// Fix bug 6751 & 7228 see WinPosDoOwnedPopups wine Fixme. - PWND ParentWindow; - PWND Sibling; - PWND InsertAfterWindow; - - if ((ParentWindow = Window->spwndParent)) // Must have a Parent window! - { - //ERR("SetWindowPos has parent window.\n"); - if (WinPos.hwndInsertAfter == HWND_TOPMOST) - { - InsertAfterWindow = NULL; - } - else if ( WinPos.hwndInsertAfter == HWND_TOP ) - { - InsertAfterWindow = NULL; - - Sibling = ParentWindow->spwndChild; - - while ( Sibling && Sibling->ExStyle & WS_EX_TOPMOST ) - { - InsertAfterWindow = Sibling; - Sibling = Sibling->spwndNext; - } - } - else if (WinPos.hwndInsertAfter == HWND_BOTTOM) - { - if (ParentWindow->spwndChild) - { - InsertAfterWindow = ParentWindow->spwndChild; - - if(InsertAfterWindow) - { - while (InsertAfterWindow->spwndNext) - InsertAfterWindow = InsertAfterWindow->spwndNext; - } - } - else - InsertAfterWindow = NULL; - } - else - InsertAfterWindow = IntGetWindowObject(WinPos.hwndInsertAfter); - /* Do nothing if hwndInsertAfter is HWND_BOTTOM and Window is already - the last window */ - if (InsertAfterWindow != Window) - { - IntUnlinkWindow(Window); - IntLinkWindow(Window, InsertAfterWindow); - } - - if ( ( WinPos.hwndInsertAfter == HWND_TOPMOST || - ( Window->ExStyle & WS_EX_TOPMOST && Window->spwndPrev && Window->spwndPrev->ExStyle & WS_EX_TOPMOST ) || - ( Window->spwndNext && Window->spwndNext->ExStyle & WS_EX_TOPMOST ) ) && - !bNoTopMost ) - { - Window->ExStyle |= WS_EX_TOPMOST; - } - else - { - Window->ExStyle &= ~ WS_EX_TOPMOST; - } - } - //// -#endif } OldWindowRect = Window->rcWindow; From d0ba06e7f2185cce87117a5ab511cf98cc48e1b3 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sun, 2 Mar 2014 22:42:00 +0000 Subject: [PATCH 051/419] - Move code, this relates to CORE-6651. svn path=/trunk/; revision=62405 --- reactos/win32ss/user/ntuser/focus.c | 46 +++++++++++++++-------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/reactos/win32ss/user/ntuser/focus.c b/reactos/win32ss/user/ntuser/focus.c index c58e1d072ea..8c6973feb49 100644 --- a/reactos/win32ss/user/ntuser/focus.c +++ b/reactos/win32ss/user/ntuser/focus.c @@ -298,28 +298,6 @@ IntSendFocusMessages( PTHREADINFO pti, PWND pWnd) } } -HWND FASTCALL -IntFindChildWindowToOwner(PWND Root, PWND Owner) -{ - HWND Ret; - PWND Child, OwnerWnd; - - for(Child = Root->spwndChild; Child; Child = Child->spwndNext) - { - OwnerWnd = Child->spwndOwner; - if(!OwnerWnd) - continue; - - if(OwnerWnd == Owner) - { - Ret = Child->head.h; - return Ret; - } - } - - return NULL; -} - VOID FASTCALL FindRemoveAsyncMsg(PWND Wnd, WPARAM wParam) { @@ -546,6 +524,30 @@ co_IntSetForegroundAndFocusWindow( return Ret && fgRet; } +/* + Revision 7888, activate modal dialog when clicking on a disabled window. +*/ +HWND FASTCALL +IntFindChildWindowToOwner(PWND Root, PWND Owner) +{ + HWND Ret; + PWND Child, OwnerWnd; + + for(Child = Root->spwndChild; Child; Child = Child->spwndNext) + { + OwnerWnd = Child->spwndOwner; + if(!OwnerWnd) + continue; + + if(OwnerWnd == Owner) + { + Ret = Child->head.h; + return Ret; + } + } + return NULL; +} + BOOL FASTCALL co_IntMouseActivateWindow(PWND Wnd) { From 6e275a78d21b3e54c010d026a8fc23ba4d1afb83 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 2 Mar 2014 23:39:20 +0000 Subject: [PATCH 052/419] [SERVICES] RSetServiceStatus: Set the wait hint and check point only if the service is in a pending state, otherwise they should be 0. svn path=/trunk/; revision=62408 --- reactos/base/system/services/rpcserver.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/base/system/services/rpcserver.c b/reactos/base/system/services/rpcserver.c index fbe4bb5c0bc..692628a29b8 100644 --- a/reactos/base/system/services/rpcserver.c +++ b/reactos/base/system/services/rpcserver.c @@ -1661,6 +1661,16 @@ DWORD RSetServiceStatus( return ERROR_INVALID_DATA; } + /* Set the wait hint and check point only if the service is in a pending state, + otherwise they should be 0 */ + if (lpServiceStatus->dwCurrentState == SERVICE_STOPPED || + lpServiceStatus->dwCurrentState == SERVICE_PAUSED || + lpServiceStatus->dwCurrentState == SERVICE_RUNNING) + { + lpServiceStatus->dwWaitHint = 0; + lpServiceStatus->dwCheckPoint = 0; + } + /* Lock the service database exclusively */ ScmLockDatabaseExclusive(); From 6334f63dbc09d9397a06b08ee89f6c2e2dae4cea Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 3 Mar 2014 06:38:45 +0000 Subject: [PATCH 053/419] [WinSS] - Fix activate modal dialog when clicking on a disabled window (part 2) without zorder support. Other than clicking the tool bar, it will help activate the popup and bring it to the top. Panic mode support. - Adapt window from point to ignore disabled windows. Attempting to fill a code hole. See CORE-6651. svn path=/trunk/; revision=62410 --- reactos/win32ss/user/ntuser/focus.c | 21 ++++++--------------- reactos/win32ss/user/ntuser/msgqueue.c | 17 +++++------------ reactos/win32ss/user/ntuser/winpos.c | 13 +++++++------ reactos/win32ss/user/ntuser/winpos.h | 2 +- 4 files changed, 19 insertions(+), 34 deletions(-) diff --git a/reactos/win32ss/user/ntuser/focus.c b/reactos/win32ss/user/ntuser/focus.c index 8c6973feb49..bf1a32d259d 100644 --- a/reactos/win32ss/user/ntuser/focus.c +++ b/reactos/win32ss/user/ntuser/focus.c @@ -120,7 +120,7 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO (WPARAM)UserHMGetHandle(Window), 0); } - //// Fixes bug 7089. + //// Fixes CORE-6434. if (!(Window->style & WS_CHILD)) { PWND pwndTemp = co_GetDesktopWindow(Window)->spwndChild; @@ -229,8 +229,6 @@ co_IntSendActivateMessages(PWND WindowPrev, PWND Window, BOOL MouseActivate, BOO co_IntMakeWindowActive(Window); - /* FIXME: IntIsWindow */ - co_IntSendMessageNoWait( UserHMGetHandle(Window), WM_NCACTIVATE, (WPARAM)(Window == (gpqForeground ? gpqForeground->spwndActive : NULL)), @@ -552,9 +550,7 @@ BOOL FASTCALL co_IntMouseActivateWindow(PWND Wnd) { HWND Top; - PWND TopWindow; USER_REFERENCE_ENTRY Ref; - ASSERT_REFS_CO(Wnd); if (Wnd->style & WS_DISABLED) @@ -564,6 +560,7 @@ co_IntMouseActivateWindow(PWND Wnd) PWND DesktopWindow = UserGetDesktopWindow(); if (DesktopWindow) { + ERR("Window Diabled\n"); Top = IntFindChildWindowToOwner(DesktopWindow, Wnd); if ((TopWnd = ValidateHwndNoErr(Top))) { @@ -576,15 +573,8 @@ co_IntMouseActivateWindow(PWND Wnd) } return FALSE; } - - TopWindow = UserGetAncestor(Wnd, GA_ROOT); - //if (TopWindow) {ERR("MAW 2 pWnd %p hWnd %p\n",TopWindow,TopWindow->head.h);} - if (!TopWindow) return FALSE; - - /* TMN: Check return value from this function? */ - UserRefObjectCo(TopWindow, &Ref); - co_IntSetForegroundAndFocusWindow(TopWindow, TRUE); - UserDerefObjectCo(TopWindow); + ERR("Mouse Active\n"); + co_IntSetForegroundAndFocusWindow(Wnd, TRUE); return TRUE; } @@ -733,6 +723,7 @@ co_IntSetActiveWindow(PWND Wnd OPTIONAL, BOOL bMouse, BOOL bFocus, BOOL Async) InAAPM = co_IntSendActivateMessages(WndPrev, Wnd, bMouse, Async); /* now change focus if necessary */ + //// Fixes CORE-6452 allows setting focus on window. if (bFocus && !(ThreadQueue->QF_flags & QF_FOCUSNULLSINCEACTIVE)) { /* Do not change focus if the window is no longer active */ @@ -745,7 +736,7 @@ co_IntSetActiveWindow(PWND Wnd OPTIONAL, BOOL bMouse, BOOL bFocus, BOOL Async) IntSendFocusMessages( pti, pWndSend); } } - + //// if (InAAPM) { pti->TIF_flags &= ~TIF_INACTIVATEAPPMSG; diff --git a/reactos/win32ss/user/ntuser/msgqueue.c b/reactos/win32ss/user/ntuser/msgqueue.c index f4475111ded..e6f31cb62b4 100644 --- a/reactos/win32ss/user/ntuser/msgqueue.c +++ b/reactos/win32ss/user/ntuser/msgqueue.c @@ -575,6 +575,7 @@ co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook { pti = pwnd->head.pti; MessageQueue = pti->MessageQueue; + // MessageQueue->ptiMouse = pti; if ( pti->TIF_flags & TIF_INCLEANUP || MessageQueue->QF_flags & QF_INDESTROY) { @@ -1342,7 +1343,7 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT USHORT hittest; EVENTMSG event; MOUSEHOOKSTRUCT hook; - BOOL eatMsg; + BOOL eatMsg = FALSE; PWND pwndMsg, pwndDesktop; PUSER_MESSAGE_QUEUE MessageQueue; @@ -1367,9 +1368,8 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT if (pwndMsg) UserReferenceObject(pwndMsg); } else - { // Fix wine Msg test_HTTRANSPARENT. Start with a NULL window. - // http://www.winehq.org/pipermail/wine-patches/2012-August/116776.html - pwndMsg = co_WinPosWindowFromPoint(NULL, &msg->pt, &hittest); + { + pwndMsg = co_WinPosWindowFromPoint(NULL, &msg->pt, &hittest, TRUE); } TRACE("Got mouse message for %p, hittest: 0x%x\n", msg->hwnd, hittest); @@ -1392,10 +1392,6 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT msg->hwnd = UserHMGetHandle(pwndMsg); -#if 0 - if (!check_hwnd_filter( msg, hwnd_filter )) RETURN(FALSE); -#endif - pt = msg->pt; message = msg->message; /* Note: windows has no concept of a non-client wheel message */ @@ -1547,8 +1543,6 @@ BOOL co_IntProcessMouseMessage(MSG* msg, BOOL* RemoveMessages, UINT first, UINT RETURN(TRUE); } - eatMsg = FALSE; - if ((msg->message == WM_LBUTTONDOWN) || (msg->message == WM_RBUTTONDOWN) || (msg->message == WM_MBUTTONDOWN) || @@ -1807,8 +1801,7 @@ co_MsqPeekHardwareMessage(IN PTHREADINFO pti, break; } } - CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, - ListEntry); + CurrentMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry); } while(CurrentEntry != ListHead); diff --git a/reactos/win32ss/user/ntuser/winpos.c b/reactos/win32ss/user/ntuser/winpos.c index 7919b9a0639..5ad490abfb6 100644 --- a/reactos/win32ss/user/ntuser/winpos.c +++ b/reactos/win32ss/user/ntuser/winpos.c @@ -2440,7 +2440,8 @@ PWND FASTCALL co_WinPosSearchChildren( PWND ScopeWin, POINT *Point, - USHORT *HitTest + USHORT *HitTest, + BOOL Ignore ) { PWND pwndChild; @@ -2451,7 +2452,7 @@ co_WinPosSearchChildren( return NULL; } - if ((ScopeWin->style & WS_DISABLED)) + if (!Ignore && (ScopeWin->style & WS_DISABLED)) { return NULL; } @@ -2475,7 +2476,7 @@ co_WinPosSearchChildren( continue; } - pwndChild = co_WinPosSearchChildren(pwndChild, Point, HitTest); + pwndChild = co_WinPosSearchChildren(pwndChild, Point, HitTest, Ignore); if(pwndChild != NULL) { @@ -2506,7 +2507,7 @@ co_WinPosSearchChildren( } PWND FASTCALL -co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest) +co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest, BOOL Ignore) { PWND Window; POINT Point = *WinPoint; @@ -2524,7 +2525,7 @@ co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest) ASSERT_REFS_CO(ScopeWin); UserRefObjectCo(ScopeWin, &Ref); - Window = co_WinPosSearchChildren(ScopeWin, &Point, HitTest); + Window = co_WinPosSearchChildren(ScopeWin, &Point, HitTest, Ignore); UserDerefObjectCo(ScopeWin); if (Window) @@ -3447,7 +3448,7 @@ NtUserWindowFromPoint(LONG X, LONG Y) UserRefObjectCo(DesktopWindow, &Ref); //pti = PsGetCurrentThreadWin32Thread(); - Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest); + Window = co_WinPosWindowFromPoint(DesktopWindow, &pt, &hittest, FALSE); if (Window) { diff --git a/reactos/win32ss/user/ntuser/winpos.h b/reactos/win32ss/user/ntuser/winpos.h index adfaa32c17d..ed3464cf19d 100644 --- a/reactos/win32ss/user/ntuser/winpos.h +++ b/reactos/win32ss/user/ntuser/winpos.h @@ -52,7 +52,7 @@ UINT FASTCALL co_WinPosMinMaximize(PWND WindowObject, UINT ShowFlag, RECTL* NewP BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Wnd, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags); BOOLEAN FASTCALL co_WinPosShowWindow(PWND Window, INT Cmd); void FASTCALL co_WinPosSendSizeMove(PWND Window); -PWND FASTCALL co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest); +PWND FASTCALL co_WinPosWindowFromPoint(PWND ScopeWin, POINT *WinPoint, USHORT* HitTest, BOOL Ignore); VOID FASTCALL co_WinPosActivateOtherWindow(PWND); PWND FASTCALL IntRealChildWindowFromPoint(PWND,LONG,LONG); BOOL FASTCALL IntScreenToClient(PWND,LPPOINT); From 50c9a384f470a1d9f54ba00f3018ac2f072893c2 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Mon, 3 Mar 2014 15:44:44 +0000 Subject: [PATCH 054/419] [ADVAPI32] Implement the ANSI part of ion's half done patch from r59843. Fixes two more service bugs. svn path=/trunk/; revision=62413 --- reactos/dll/win32/advapi32/service/sctrl.c | 92 ++++++++++++++-------- 1 file changed, 58 insertions(+), 34 deletions(-) diff --git a/reactos/dll/win32/advapi32/service/sctrl.c b/reactos/dll/win32/advapi32/service/sctrl.c index 6893c14ac12..9b32bbb36a0 100644 --- a/reactos/dll/win32/advapi32/service/sctrl.c +++ b/reactos/dll/win32/advapi32/service/sctrl.c @@ -288,8 +288,10 @@ ScBuildUnicodeArgsVector(PSCM_CONTROL_PACKET ControlPacket, { LPWSTR *lpVector; LPWSTR *lpArg; - DWORD i, cbServiceName, cbTotal; LPWSTR pszServiceName; + DWORD cbServiceName; + DWORD cbTotal; + DWORD i; if (ControlPacket == NULL || lpArgCount == NULL || lpArgVector == NULL) return ERROR_INVALID_PARAMETER; @@ -297,18 +299,12 @@ ScBuildUnicodeArgsVector(PSCM_CONTROL_PACKET ControlPacket, *lpArgCount = 0; *lpArgVector = NULL; - pszServiceName = (PWSTR) ((PBYTE) ControlPacket + ControlPacket->dwServiceNameOffset); + pszServiceName = (PWSTR)((PBYTE)ControlPacket + ControlPacket->dwServiceNameOffset); cbServiceName = lstrlenW(pszServiceName) * sizeof(WCHAR) + sizeof(UNICODE_NULL); + cbTotal = cbServiceName + sizeof(LPWSTR); if (ControlPacket->dwArgumentsCount > 0) - { - cbTotal = ControlPacket->dwSize - ControlPacket->dwArgumentsOffset + - cbServiceName + sizeof(LPWSTR); - } - else - { - cbTotal = cbServiceName + sizeof(LPWSTR); - } + cbTotal += ControlPacket->dwSize - ControlPacket->dwArgumentsOffset; lpVector = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, @@ -321,7 +317,7 @@ ScBuildUnicodeArgsVector(PSCM_CONTROL_PACKET ControlPacket, lpArg++; memcpy(lpArg, pszServiceName, cbServiceName); - lpArg = (LPWSTR*) ((ULONG_PTR) lpArg + cbServiceName); + lpArg = (LPWSTR*)((ULONG_PTR)lpArg + cbServiceName); if (ControlPacket->dwArgumentsCount > 0) { @@ -351,10 +347,13 @@ ScBuildAnsiArgsVector(PSCM_CONTROL_PACKET ControlPacket, LPSTR *lpVector; LPSTR *lpPtr; LPWSTR lpUnicodeString; + LPWSTR pszServiceName; LPSTR lpAnsiString; + DWORD cbServiceName; DWORD dwVectorSize; DWORD dwUnicodeSize; - DWORD dwAnsiSize; + DWORD dwAnsiSize = 0; + DWORD dwAnsiNameSize = 0; DWORD i; if (ControlPacket == NULL || lpArgCount == NULL || lpArgVector == NULL) @@ -363,13 +362,21 @@ ScBuildAnsiArgsVector(PSCM_CONTROL_PACKET ControlPacket, *lpArgCount = 0; *lpArgVector = NULL; - /* FIXME: There should always be one argument (the name) sent to services... */ - /* FIXME: See the Unicode version above on how to achieve this */ + pszServiceName = (PWSTR)((PBYTE)ControlPacket + ControlPacket->dwServiceNameOffset); + cbServiceName = lstrlenW(pszServiceName) * sizeof(WCHAR) + sizeof(UNICODE_NULL); + dwAnsiNameSize = WideCharToMultiByte(CP_ACP, + 0, + pszServiceName, + cbServiceName, + NULL, + 0, + NULL, + NULL); + + dwVectorSize = ControlPacket->dwArgumentsCount * sizeof(LPWSTR); if (ControlPacket->dwArgumentsCount > 0) { - dwVectorSize = ControlPacket->dwArgumentsCount * sizeof(LPWSTR); - lpUnicodeString = (LPWSTR)((PBYTE)ControlPacket + ControlPacket->dwArgumentsOffset + dwVectorSize); @@ -385,15 +392,31 @@ ScBuildAnsiArgsVector(PSCM_CONTROL_PACKET ControlPacket, 0, NULL, NULL); + } - lpVector = HeapAlloc(GetProcessHeap(), - HEAP_ZERO_MEMORY, - dwVectorSize + dwAnsiSize); - if (lpVector == NULL) - return ERROR_OUTOFMEMORY; + dwVectorSize += sizeof(LPWSTR); - lpPtr = (LPSTR*)lpVector; - lpAnsiString = (LPSTR)((ULONG_PTR)lpVector + dwVectorSize); + lpVector = HeapAlloc(GetProcessHeap(), + HEAP_ZERO_MEMORY, + dwVectorSize + dwAnsiNameSize + dwAnsiSize); + if (lpVector == NULL) + return ERROR_OUTOFMEMORY; + + lpPtr = (LPSTR*)lpVector; + lpAnsiString = (LPSTR)((ULONG_PTR)lpVector + dwVectorSize); + + WideCharToMultiByte(CP_ACP, + 0, + pszServiceName, + cbServiceName, + lpAnsiString, + dwAnsiNameSize, + NULL, + NULL); + + if (ControlPacket->dwArgumentsCount > 0) + { + lpAnsiString = (LPSTR)((ULONG_PTR)lpAnsiString + dwAnsiNameSize); WideCharToMultiByte(CP_ACP, 0, @@ -403,19 +426,20 @@ ScBuildAnsiArgsVector(PSCM_CONTROL_PACKET ControlPacket, dwAnsiSize, NULL, NULL); - - for (i = 0; i < ControlPacket->dwArgumentsCount; i++) - { - *lpPtr = lpAnsiString; - - lpPtr++; - lpAnsiString += (strlen(lpAnsiString) + 1); - } - - *lpArgCount = ControlPacket->dwArgumentsCount; - *lpArgVector = lpVector; } + lpAnsiString = (LPSTR)((ULONG_PTR)lpVector + dwVectorSize); + for (i = 0; i < ControlPacket->dwArgumentsCount + 1; i++) + { + *lpPtr = lpAnsiString; + + lpPtr++; + lpAnsiString += (strlen(lpAnsiString) + 1); + } + + *lpArgCount = ControlPacket->dwArgumentsCount + 1; + *lpArgVector = lpVector; + return ERROR_SUCCESS; } From 2b1527a42167cd8aeb5a9ef18c599e43d1254879 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Mon, 3 Mar 2014 20:41:39 +0000 Subject: [PATCH 055/419] [FREETYPE] * Update to version 2.5.2. Thanks to Robert Naumann for providing a patch that I used as a base for this. [WIN32K] * Update the FreeType header inclusions. CORE-7719 svn path=/trunk/; revision=62417 --- reactos/lib/3rdparty/freetype/CMakeLists.txt | 19 +- reactos/lib/3rdparty/freetype/ChangeLog | 1560 ++++++++++++++++- reactos/lib/3rdparty/freetype/README | 8 +- reactos/lib/3rdparty/freetype/autogen.sh | 4 +- .../lib/3rdparty/freetype/devel/ft2build.h | 40 + .../lib/3rdparty/freetype/devel/ftoption.h | 833 +++++++++ .../include/{freetype => }/config/ftconfig.h | 88 +- .../include/{freetype => }/config/ftheader.h | 118 +- .../include/{freetype => }/config/ftmodule.h | 0 .../include/{freetype => }/config/ftoption.h | 14 +- .../include/{freetype => }/config/ftstdlib.h | 0 .../include/{freetype => }/freetype.h | 96 +- .../freetype/include/freetype/ftcffdrv.h | 151 -- .../lib/3rdparty/freetype/include/ft2build.h | 23 +- .../include/{freetype => }/ftadvanc.h | 4 +- .../freetype/include/{freetype => }/ftautoh.h | 4 +- .../freetype/include/{freetype => }/ftbbox.h | 6 +- .../freetype/include/{freetype => }/ftbdf.h | 0 .../include/{freetype => }/ftbitmap.h | 0 .../freetype/include/{freetype => }/ftbzip2.h | 0 .../freetype/include/{freetype => }/ftcache.h | 2 +- .../lib/3rdparty/freetype/include/ftcffdrv.h | 254 +++ .../include/{freetype => }/ftchapters.h | 2 +- .../freetype/include/{freetype => }/ftcid.h | 0 .../include/{freetype => }/fterrdef.h | 0 .../include/{freetype => }/fterrors.h | 0 .../freetype/include/{freetype => }/ftgasp.h | 0 .../freetype/include/{freetype => }/ftglyph.h | 10 +- .../freetype/include/{freetype => }/ftgxval.h | 10 +- .../freetype/include/{freetype => }/ftgzip.h | 49 +- .../freetype/include/{freetype => }/ftimage.h | 18 +- .../include/{freetype => }/ftincrem.h | 0 .../include/{freetype => }/ftlcdfil.h | 6 +- .../freetype/include/{freetype => }/ftlist.h | 12 +- .../freetype/include/{freetype => }/ftlzw.h | 0 .../freetype/include/{freetype => }/ftmac.h | 6 +- .../freetype/include/{freetype => }/ftmm.h | 7 +- .../include/{freetype => }/ftmodapi.h | 8 +- .../include/{freetype => }/ftmoderr.h | 0 .../freetype/include/{freetype => }/ftotval.h | 6 +- .../freetype/include/{freetype => }/ftoutln.h | 23 +- .../freetype/include/{freetype => }/ftpfr.h | 0 .../include/{freetype => }/ftrender.h | 0 .../freetype/include/{freetype => }/ftsizes.h | 4 +- .../include/{freetype => }/ftsnames.h | 6 +- .../include/{freetype => }/ftstroke.h | 0 .../freetype/include/{freetype => }/ftsynth.h | 4 +- .../include/{freetype => }/ftsystem.h | 0 .../include/{freetype => }/fttrigon.h | 0 .../freetype/include/{freetype => }/ftttdrv.h | 22 +- .../freetype/include/{freetype => }/fttypes.h | 6 +- .../include/{freetype => }/ftwinfnt.h | 7 +- .../freetype/include/{freetype => }/ftxf86.h | 4 +- .../{freetype => }/internal/autohint.h | 0 .../include/{freetype => }/internal/ftcalc.h | 6 +- .../include/{freetype => }/internal/ftdebug.h | 0 .../{freetype => }/internal/ftdriver.h | 0 .../{freetype => }/internal/ftgloadr.h | 0 .../{freetype => }/internal/ftmemory.h | 0 .../include/{freetype => }/internal/ftobjs.h | 0 .../include/{freetype => }/internal/ftpic.h | 0 .../include/{freetype => }/internal/ftrfork.h | 0 .../include/{freetype => }/internal/ftserv.h | 36 +- .../{freetype => }/internal/ftstream.h | 0 .../include/{freetype => }/internal/fttrace.h | 0 .../include/{freetype => }/internal/ftvalid.h | 0 .../{freetype => }/internal/internal.h | 38 +- .../include/{freetype => }/internal/psaux.h | 0 .../include/{freetype => }/internal/pshints.h | 0 .../{freetype => }/internal/services/svbdf.h | 0 .../{freetype => }/internal/services/svcid.h | 0 .../internal/services/svgldict.h | 0 .../internal/services/svgxval.h | 0 .../{freetype => }/internal/services/svkern.h | 0 .../{freetype => }/internal/services/svmm.h | 0 .../internal/services/svotval.h | 0 .../{freetype => }/internal/services/svpfr.h | 0 .../internal/services/svpostnm.h | 0 .../{freetype => }/internal/services/svprop.h | 0 .../internal/services/svpscmap.h | 0 .../internal/services/svpsinfo.h | 0 .../{freetype => }/internal/services/svsfnt.h | 0 .../internal/services/svttcmap.h | 4 +- .../internal/services/svtteng.h | 0 .../internal/services/svttglyf.h | 0 .../internal/services/svwinfnt.h | 0 .../internal/services/svxf86nm.h | 0 .../include/{freetype => }/internal/sfnt.h | 0 .../include/{freetype => }/internal/t1types.h | 0 .../include/{freetype => }/internal/tttypes.h | 108 +- .../include/{freetype => }/t1tables.h | 0 .../include/{freetype => }/ttnameid.h | 4 +- .../include/{freetype => }/tttables.h | 38 +- .../freetype/include/{freetype => }/tttags.h | 2 + .../freetype/include/{freetype => }/ttunpat.h | 0 reactos/lib/3rdparty/freetype/modules.cfg | 50 +- reactos/lib/3rdparty/freetype/objs/README | 2 + .../3rdparty/freetype/src/autofit/afblue.c | 166 ++ .../3rdparty/freetype/src/autofit/afblue.cin | 39 + .../3rdparty/freetype/src/autofit/afblue.dat | 218 +++ .../3rdparty/freetype/src/autofit/afblue.h | 199 +++ .../3rdparty/freetype/src/autofit/afblue.hin | 142 ++ .../lib/3rdparty/freetype/src/autofit/afcjk.c | 650 +++---- .../lib/3rdparty/freetype/src/autofit/afcjk.h | 59 +- .../3rdparty/freetype/src/autofit/afdummy.c | 39 +- .../3rdparty/freetype/src/autofit/afdummy.h | 10 +- .../3rdparty/freetype/src/autofit/afglobal.c | 126 +- .../3rdparty/freetype/src/autofit/afglobal.h | 23 +- .../3rdparty/freetype/src/autofit/afhints.c | 283 +-- .../3rdparty/freetype/src/autofit/afhints.h | 45 +- .../3rdparty/freetype/src/autofit/afindic.c | 64 +- .../3rdparty/freetype/src/autofit/afindic.h | 11 +- .../3rdparty/freetype/src/autofit/aflatin.c | 532 ++++-- .../3rdparty/freetype/src/autofit/aflatin.h | 43 +- .../3rdparty/freetype/src/autofit/aflatin2.c | 72 +- .../3rdparty/freetype/src/autofit/aflatin2.h | 18 +- .../3rdparty/freetype/src/autofit/afloader.c | 43 +- .../lib/3rdparty/freetype/src/autofit/afpic.c | 49 +- .../lib/3rdparty/freetype/src/autofit/afpic.h | 35 +- .../3rdparty/freetype/src/autofit/afscript.h | 37 + .../3rdparty/freetype/src/autofit/aftypes.h | 287 ++- .../3rdparty/freetype/src/autofit/afwrtsys.h | 51 + .../3rdparty/freetype/src/autofit/autofit.c | 3 +- .../3rdparty/freetype/src/autofit/rules.mk | 7 +- .../lib/3rdparty/freetype/src/base/ftbbox.c | 332 +--- .../lib/3rdparty/freetype/src/base/ftbitmap.c | 4 + .../lib/3rdparty/freetype/src/base/ftcalc.c | 30 +- .../lib/3rdparty/freetype/src/base/ftdebug.c | 2 +- .../lib/3rdparty/freetype/src/base/ftglyph.c | 62 +- .../lib/3rdparty/freetype/src/base/ftinit.c | 4 +- .../lib/3rdparty/freetype/src/base/ftmac.c | 1 - .../lib/3rdparty/freetype/src/base/ftobjs.c | 40 +- .../lib/3rdparty/freetype/src/base/ftoutln.c | 7 +- .../lib/3rdparty/freetype/src/base/ftpic.c | 4 +- .../lib/3rdparty/freetype/src/base/ftsynth.c | 11 +- reactos/lib/3rdparty/freetype/src/base/md5.c | 51 +- reactos/lib/3rdparty/freetype/src/base/md5.h | 2 +- .../lib/3rdparty/freetype/src/base/rules.mk | 4 +- reactos/lib/3rdparty/freetype/src/bdf/Jamfile | 29 - .../lib/3rdparty/freetype/src/bdf/bdfdrivr.c | 16 +- .../lib/3rdparty/freetype/src/bzip2/Jamfile | 19 - .../lib/3rdparty/freetype/src/cache/Jamfile | 43 - .../lib/3rdparty/freetype/src/cff/cf2blues.c | 2 + .../lib/3rdparty/freetype/src/cff/cf2font.c | 161 +- .../lib/3rdparty/freetype/src/cff/cf2font.h | 2 + reactos/lib/3rdparty/freetype/src/cff/cf2ft.c | 9 + .../lib/3rdparty/freetype/src/cff/cf2hints.c | 196 ++- .../lib/3rdparty/freetype/src/cff/cf2hints.h | 4 +- .../lib/3rdparty/freetype/src/cff/cffdrivr.c | 63 +- .../lib/3rdparty/freetype/src/cff/cffgload.c | 6 +- .../lib/3rdparty/freetype/src/cff/cffload.c | 10 +- .../lib/3rdparty/freetype/src/cff/cffobjs.c | 11 +- .../lib/3rdparty/freetype/src/cff/cffobjs.h | 2 + .../lib/3rdparty/freetype/src/cid/cidgload.c | 2 +- .../lib/3rdparty/freetype/src/cid/cidload.c | 6 +- .../3rdparty/freetype/src/gxvalid/gxvcommn.c | 8 + .../3rdparty/freetype/src/gxvalid/gxvcommn.h | 2 +- .../3rdparty/freetype/src/gxvalid/gxvmort.c | 2 + .../3rdparty/freetype/src/gxvalid/gxvmorx2.c | 4 +- .../lib/3rdparty/freetype/src/gzip/Jamfile | 16 - .../lib/3rdparty/freetype/src/gzip/ftgzip.c | 78 +- .../lib/3rdparty/freetype/src/gzip/rules.mk | 59 +- .../lib/3rdparty/freetype/src/pcf/pcfdrivr.c | 42 +- .../lib/3rdparty/freetype/src/pcf/pcfread.c | 2 +- .../lib/3rdparty/freetype/src/pcf/pcfutil.c | 12 +- .../lib/3rdparty/freetype/src/pfr/pfrcmap.c | 10 +- .../lib/3rdparty/freetype/src/pfr/pfrgload.c | 2 +- .../lib/3rdparty/freetype/src/pfr/pfrobjs.c | 2 + .../lib/3rdparty/freetype/src/psaux/Jamfile | 31 - .../3rdparty/freetype/src/pshinter/pshglob.c | 4 +- .../3rdparty/freetype/src/raster/ftraster.c | 4 +- .../lib/3rdparty/freetype/src/sfnt/pngshim.c | 57 +- .../lib/3rdparty/freetype/src/sfnt/pngshim.h | 5 +- .../lib/3rdparty/freetype/src/sfnt/sfdriver.c | 4 +- .../lib/3rdparty/freetype/src/sfnt/sfobjs.c | 421 ++++- .../lib/3rdparty/freetype/src/sfnt/ttcmap.c | 11 +- .../lib/3rdparty/freetype/src/sfnt/ttkern.c | 6 +- .../lib/3rdparty/freetype/src/sfnt/ttload.c | 52 +- .../lib/3rdparty/freetype/src/sfnt/ttmtx.c | 19 +- .../lib/3rdparty/freetype/src/sfnt/ttsbit.c | 612 +++++-- .../lib/3rdparty/freetype/src/sfnt/ttsbit.h | 4 +- .../3rdparty/freetype/src/smooth/ftgrays.c | 87 +- .../lib/3rdparty/freetype/src/tools/afblue.pl | 542 ++++++ .../3rdparty/freetype/src/tools/chktrcmp.py | 4 +- .../freetype/src/tools/docmaker/content.py | 19 +- .../freetype/src/tools/docmaker/docmaker.py | 4 +- .../freetype/src/tools/docmaker/sources.py | 40 +- .../freetype/src/tools/docmaker/tohtml.py | 33 +- .../3rdparty/freetype/src/truetype/ttdriver.c | 3 +- .../3rdparty/freetype/src/truetype/ttgload.c | 238 ++- .../3rdparty/freetype/src/truetype/ttgload.h | 1 + .../3rdparty/freetype/src/truetype/ttinterp.c | 253 ++- .../3rdparty/freetype/src/truetype/ttinterp.h | 4 +- .../3rdparty/freetype/src/truetype/ttobjs.c | 23 +- .../lib/3rdparty/freetype/src/type1/t1gload.c | 2 + .../lib/3rdparty/freetype/src/type1/t1load.c | 4 +- .../3rdparty/freetype/src/type42/t42objs.c | 5 +- .../3rdparty/freetype/src/winfonts/winfnt.c | 4 +- reactos/media/doc/3rd Party Files.txt | 2 +- reactos/win32ss/gdi/ntgdi/freetype.c | 10 +- 200 files changed, 8423 insertions(+), 2432 deletions(-) create mode 100644 reactos/lib/3rdparty/freetype/devel/ft2build.h create mode 100644 reactos/lib/3rdparty/freetype/devel/ftoption.h rename reactos/lib/3rdparty/freetype/include/{freetype => }/config/ftconfig.h (89%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/config/ftheader.h (89%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/config/ftmodule.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/config/ftoption.h (99%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/config/ftstdlib.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/freetype.h (98%) delete mode 100644 reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftadvanc.h (98%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftautoh.h (98%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftbbox.h (97%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftbdf.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftbitmap.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftbzip2.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftcache.h (99%) create mode 100644 reactos/lib/3rdparty/freetype/include/ftcffdrv.h rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftchapters.h (99%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftcid.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/fterrdef.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/fterrors.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftgasp.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftglyph.h (99%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftgxval.h (98%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftgzip.h (74%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftimage.h (99%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftincrem.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftlcdfil.h (97%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftlist.h (97%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftlzw.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftmac.h (98%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftmm.h (98%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftmodapi.h (99%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftmoderr.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftotval.h (97%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftoutln.h (96%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftpfr.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftrender.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftsizes.h (98%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftsnames.h (98%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftstroke.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftsynth.h (96%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftsystem.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/fttrigon.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftttdrv.h (85%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/fttypes.h (99%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftwinfnt.h (97%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ftxf86.h (96%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/autohint.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftcalc.h (98%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftdebug.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftdriver.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftgloadr.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftmemory.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftobjs.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftpic.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftrfork.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftserv.h (96%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftstream.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/fttrace.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/ftvalid.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/internal.h (61%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/psaux.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/pshints.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svbdf.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svcid.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svgldict.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svgxval.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svkern.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svmm.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svotval.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svpfr.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svpostnm.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svprop.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svpscmap.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svpsinfo.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svsfnt.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svttcmap.h (97%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svtteng.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svttglyf.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svwinfnt.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/services/svxf86nm.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/sfnt.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/t1types.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/internal/tttypes.h (94%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/t1tables.h (100%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ttnameid.h (99%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/tttables.h (97%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/tttags.h (97%) rename reactos/lib/3rdparty/freetype/include/{freetype => }/ttunpat.h (100%) create mode 100644 reactos/lib/3rdparty/freetype/objs/README create mode 100644 reactos/lib/3rdparty/freetype/src/autofit/afblue.c create mode 100644 reactos/lib/3rdparty/freetype/src/autofit/afblue.cin create mode 100644 reactos/lib/3rdparty/freetype/src/autofit/afblue.dat create mode 100644 reactos/lib/3rdparty/freetype/src/autofit/afblue.h create mode 100644 reactos/lib/3rdparty/freetype/src/autofit/afblue.hin create mode 100644 reactos/lib/3rdparty/freetype/src/autofit/afscript.h create mode 100644 reactos/lib/3rdparty/freetype/src/autofit/afwrtsys.h delete mode 100644 reactos/lib/3rdparty/freetype/src/bdf/Jamfile delete mode 100644 reactos/lib/3rdparty/freetype/src/bzip2/Jamfile delete mode 100644 reactos/lib/3rdparty/freetype/src/cache/Jamfile delete mode 100644 reactos/lib/3rdparty/freetype/src/gzip/Jamfile delete mode 100644 reactos/lib/3rdparty/freetype/src/psaux/Jamfile create mode 100644 reactos/lib/3rdparty/freetype/src/tools/afblue.pl diff --git a/reactos/lib/3rdparty/freetype/CMakeLists.txt b/reactos/lib/3rdparty/freetype/CMakeLists.txt index 764c3a1bfb1..c6afe6e77d7 100644 --- a/reactos/lib/3rdparty/freetype/CMakeLists.txt +++ b/reactos/lib/3rdparty/freetype/CMakeLists.txt @@ -7,24 +7,35 @@ include_directories(include) list(APPEND SOURCE src/autofit/autofit.c - src/base/ftbase.c + src/base/ftadvanc.c src/base/ftbbox.c - src/base/ftbdf.c src/base/ftbitmap.c + src/base/ftcalc.c + src/base/ftcid.c + src/base/ftdbgmem.c src/base/ftdebug.c + src/base/ftfstype.c src/base/ftgasp.c + src/base/ftgloadr.c src/base/ftglyph.c src/base/ftgxval.c src/base/ftinit.c src/base/ftlcdfil.c src/base/ftmm.c + src/base/ftobjs.c src/base/ftotval.c + src/base/ftoutln.c src/base/ftpatent.c src/base/ftpfr.c + src/base/ftrfork.c + src/base/ftsnames.c + src/base/ftstream.c src/base/ftstroke.c src/base/ftsynth.c src/base/ftsystem.c + src/base/fttrigon.c src/base/fttype1.c + src/base/ftutil.c src/base/ftwinfnt.c src/base/ftxf86.c src/bdf/bdf.c @@ -32,15 +43,13 @@ list(APPEND SOURCE src/cache/ftcache.c src/cff/cff.c src/cid/type1cid.c - src/gxvalid/gxvalid.c src/gzip/ftgzip.c src/lzw/ftlzw.c - src/otvalid/otvalid.c src/pcf/pcf.c src/pfr/pfr.c src/psaux/psaux.c src/pshinter/pshinter.c - src/psnames/psnames.c + src/psnames/psmodule.c src/raster/raster.c src/sfnt/sfnt.c src/smooth/smooth.c diff --git a/reactos/lib/3rdparty/freetype/ChangeLog b/reactos/lib/3rdparty/freetype/ChangeLog index 5cda57a46ec..b67e4362a38 100644 --- a/reactos/lib/3rdparty/freetype/ChangeLog +++ b/reactos/lib/3rdparty/freetype/ChangeLog @@ -1,3 +1,1559 @@ +2013-12-08 Werner Lemberg + + * Version 2.5.2 released. + ========================= + + + Tag sources with `VER-2-5-2'. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.5.2. + + * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, + builds/windows/vc2005/index.html, + builds/windows/vc2008/freetype.vcproj, + builds/windows/vc2008/index.html, + builds/windows/vc2010/freetype.vcxproj, + builds/windows/vc2010/index.html, + builds/windows/visualc/freetype.dsp, + builds/windows/visualc/freetype.vcproj, + builds/windows/visualc/index.html, + builds/windows/visualce/freetype.dsp, + builds/windows/visualce/freetype.vcproj, + builds/windows/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.5.1/2.5.2/, s/251/252/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. + + * builds/unix/configure.raw (version_info): Set to 17:1:11. + * docs/CHANGES: Updated. + +2013-12-07 Werner Lemberg + + [truetype] Next round in phantom point handling. + + Greg Hitchcock provided very interesting insights into the + complicated history of the horizontal positions of the TSB and BSB + phantom points. + + * src/truetype/ttgload.c (TT_LOADER_SET_PP) + [TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Use `subpixel_hinting' and + `grayscale_hinting' flags as conditionals for the x position of TSB + and BSB. + +2013-12-05 Werner Lemberg + + * builds/freetype.mk (FT_CC): Removed. Unused. + +2013-12-04 Werner Lemberg + + [sfnt] Fix handling of embedded bitmap strikes. + + This corrects the commit from 2013-11-21. Problem reported by + Andrey Panov . + + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Fix logic to + detect excessive bytes for bit-aligned bitmaps. + +2013-12-03 Werner Lemberg + + [truetype] Remove dead code. + + Reported by Nigel Tao . + + * include/internal/tttypes.h (TT_LoaderRec): Remove unused + `preserve_pps' field. + * src/truetype/ttgload.c (TT_Hint_Glyph): Updated. + +2013-12-03 Werner Lemberg + + [truetype] Fix phantom point handling. + + This is a further improvement to the changes from 2013-11-06. + + * src/truetype/ttgload.c (TT_Hint_Glyph): Horizontal phantom points + are rounded horizontally, vertical ones are rounded vertically. + (TT_LOADER_SET_PP): The horizontal position of vertical phantom + points in pre-ClearType mode is zero, as shown in the OpenType + specification. + +2013-12-02 Werner Lemberg + + [truetype] Fix change from 2013-11-20. + + Problem reported by Akira Kakuto . + + * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Protect call to + `Update_Max' with both a TT_USE_BYTECODE_INTERPRETER guard and a + `IS_HINTED' clause. + Also remove redundant check using `maxSizeOfInstructions' – in + simple glyphs, the bytecode data comes before the outline data, and + a validity test for this is already present. + +2013-11-27 Werner Lemberg + + [autofit] Fix use of dumping functions in `ftgrid' demo program. + + * src/autofit/afhints.c (AF_DUMP) [FT_DEBUG_AUTOFIT]: New macro. + (af_glyph_hints_dump_points, af_glyph_hints_dump_segments, + af_glyph_hints_dump_edges) [FT_DEBUG_AUTOFIT]: Add parameter to + handle output to stdout. + Use AF_DUMP. + (af_glyph_hints_dump_points, af_glyph_hints_dump_segments, + af_glyph_hints_dump_edges) [!FT_DEBUG_AUTOFIT]: Removed. + +2013-11-25 Werner Lemberg + + * Version 2.5.1 released. + ========================= + + + Tag sources with `VER-2-5-1'. + + * docs/VERSION.DLL: Update documentation and bump version number to + 2.5.1. + + * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj, + builds/windows/vc2005/index.html, + builds/windows/vc2008/freetype.vcproj, + builds/windows/vc2008/index.html, + builds/windows/vc2010/freetype.vcxproj, + builds/windows/vc2010/index.html, + builds/windows/visualc/freetype.dsp, + builds/windows/visualc/freetype.vcproj, + builds/windows/visualc/index.html, + builds/windows/visualce/freetype.dsp, + builds/windows/visualce/freetype.vcproj, + builds/windows/visualce/index.html, + builds/wince/vc2005-ce/freetype.vcproj, + builds/wince/vc2005-ce/index.html, + builds/wince/vc2008-ce/freetype.vcproj, + builds/wince/vc2008-ce/index.html: s/2.5.0/2.5.1/, s/250/251/. + + * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1. + + * builds/unix/configure.raw (version_info): Set to 17:0:11. + * CMakeLists.txt (VERSION_PATCH): Set to 2. + * docs/CHANGES, docs/release: Updated. + +2013-11-23 Werner Lemberg + + [truetype]: Add tricky font names `hkscsiic.ttf' and `iicore.ttf'. + + * src/truetype/ttobjs.c (TRICK_NAMES_MAX_CHARACTERS, + TRICK_NAMES_COUNT): Updated. + (trick_names): Add family name for the two fonts. + +2013-11-23 Werner Lemberg + + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Typo. + +2013-11-21 Werner Lemberg + + [sfnt] Typo. + + Problem reported by Hin-Tak Leung . + + * src/sfnt/sfobjs.c (sfnt_load_face): Return correct `bsize->width' + value if the font lacks an `OS/2' table. + +2013-11-21 Werner Lemberg + + [sfnt] Improve handling of buggy embedded bitmap strikes. + + We are now able to successfully load `AppleMyoungJo.ttf'. + Problem reported by Hin-Tak Leung . + + * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Don't trust glyph + format. + +2013-11-20 Werner Lemberg + + [truetype] Don't trust `maxp's `maxSizeOfInstructions'. + + Problem reported by Hin-Tak Leung ; see + + http://lists.nongnu.org/archive/html/freetype-devel/2013-08/msg00005.html + + for details. + + * src/base/ftobjs.c (FT_Load_Glyph): Check size of `fpgm' and `prep' + tables also for setting `autohint'. + + * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use code from + `TT_Process_Composite_Glyph' for handling unreliable values of + `maxSizeOfInstructions'. + +2013-11-16 Werner Lemberg + + [sfnt] Fix `OS/2' table version 5 support. + + We now follow the `official' announcement from Microsoft (on the + OpenType mailing list, which unfortunately hasn't a public archive). + + * include/freetype/tttables.h (TT_OS2): + s/usLowerPointSize/usLowerOpticalPointSize/, + s/usUpperPointSize/usUpperOpticalPointSize/. + + * src/sfnt/ttload.c (tt_face_load_os2): Update, and set correct + default values. + +2013-11-13 Werner Lemberg + + * builds/unix/ft2unix.h: Remove. No longer necessary. + + * builds/unix/install.mk (install): Updated. + +2013-11-13 Werner Lemberg + + Simplify header file hierarchy. + + This large patch changes the header file directory layout from + `include/freetype/...' to `include/...', effectively removing one + level. Since the file `ft2build.h' is also located in `include' + (and it stays there even after installation), all FreeType header + files are now in a single directory. + + Applications that use (a) `freetype-config' or FreeType's + `pkg-config' file to get the include directory for the compiler, and + (b) the documented way for header inclusion like + + #include + #include FT_FREETYPE_H + ... + + don't need any change to the source code. + + * include/freetype/*: Move up to... + * include/*: ... this directory. + + * builds/amiga/include/freetype/*: Move up to... + * builds/amiga/include/*: ... this directory. + + */*: Essentially do `s@/freetype/@/@' where appropriate. + + * CMakeList.txt: Simplify. + * builds/unix/freetype-config.in, builds/unix/freetype2.in: For + `--cflags', return a single directory. + * builds/unix/install.mk (install): No longer try to remove `cache' + and `internal' subdirectories; instead, remove the `freetype' + subdirectory. + +2013-11-12 Werner Lemberg + + [truetype] Fix last `truetype' commit. + + * src/truetype/ttgload.c (tt_get_metrics): Preserve stream position. + Return error value. + (load_truetype_glyph): Updated. + +2013-11-10 Werner Lemberg + + * docs/CMAKE: New dummy file. + +2013-11-08 Dave Arnold + + [cff] Fix for hints that touch. + + * src/cff/cf2hints.c (cf2_hintmap_insertHint): Fix condition for + finding index value of insertion point. + +2013-11-06 Werner Lemberg + + [truetype] Fix handling of phantom points in composite glyphs. + Problem reported by Nigel Tao . + + This is a follow-up commit to the previous one. + + * src/truetype/ttgload.c (load_truetype_glyph): Call + `tt_get_metrics' after loading the glyph header. + +2013-11-06 Werner Lemberg + + [truetype] Improve emulation of vertical metrics. + + This commit also improves the start values of vertical phantom + points. Kudos to Greg Hitchcock for help. + + * src/truetype/ttgload.c (TT_Get_VMetrics): Add parameter to pass + `yMax' value. Replace code with fixed Microsoft definition. + (tt_get_metrics): Updated. + (TT_LOADER_SET_PP): Add explanation how to initialize phantom + points, taken from both the OpenType specification and private + communication with Greg (which will eventually be added to the + standard). + Fix horizontal position of `pp3' and `pp4'. + + * src/truetype/ttgload.h: Updated. + + * src/truetype/ttdriver.c (tt_get_advances): Updated. + + * docs/CHANGES: Updated. + +2013-11-05 Werner Lemberg + + * builds/windows/vc2010/freetype.vcxproj: s/v110/v100/. + PlatformToolSet version 110 is for VC2012. + + Problem reported (with solution) by Dave Arnold . + +2013-11-05 Werner Lemberg + + [truetype] Correctly reset point tags for glyph components. + Problem reported by Nigel Tao . + + * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Fix loop. + +2013-11-02 Werner Lemberg + + [truetype] Fix GETINFO opcode handling of subpixel hinting bits. + + * src/truetype/ttinterp.c (Ins_GETINFO): Don't request bit 6 set to + get info on subpixel hinting. + + * docs/CHANGES: Updated. + +2013-11-02 Werner Lemberg + + Fix Savannah bug #40451. + + Simply apply the patch from the bug report. + + * builds/unix/ftconfig.in, builds/vms/ftconfig.h, + include/freetype/config/ftconfig.h: The used #pragma directives only + work with gcc versions 4.6 and higher. + +2013-11-01 Werner Lemberg + + * docs/CHANGES: Updated. + +2013-11-01 Werner Lemberg + + [truetype] Minor code refactoring. + + Two benefits: The allocated FDEF (and IDEF) array gets slightly + smaller, and the `ttdebug' demo program has access to function + numbers without additional costs. + + Fortunately, no changes to FontForge are necessary – this is the + only external TrueType debugger I know of, but others may exist and + should check the code accordingly. + + * src/truetype/ttinterp.h (TT_CallRec): Replace `Cur_Restart' and + `Cur_End' with a pointer to the corresponding `TT_DefRecord' + structure. + + * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF, Ins_ENDF, + Ins_CALL, Ins_LOOPCALL, Ins_UNKNOWN, TT_RunIns ): + Updated. + +2013-10-27 Werner Lemberg + + [sfnt] Implement support for `OS/2' table version 5. + + See + + http://typedrawers.com/discussion/470/new-microsoft-size-specific-design-selection-mechanism + + for the announcement. + + * include/freetype/tttables.h (TT_OS2): Add fields + `usLowerPointSize' and `usUpperPointSize'. Since FreeType returns + this structure only as a pointer through `FT_Get_Sfnt_Table', there + shouldn't be any ABI problems. + + * src/sfnt/ttload.c (tt_face_load_os2): Implement it. + + * docs/CHANGES: Updated. + +2013-10-24 Werner Lemberg + + * README.git, docs/CHANGES, docs/INSTALL: Updated. + +2013-10-24 John Cary + + Provide cmake support. + + * CMakeLists.txt: New file. + +2013-10-23 Kenneth Miller + Werner Lemberg + + Provide support for x64 builds in Visual C++ project files. + + * src/builds/win32: Renamed to... + * src/builds/windows: This. + + * src/builds/windows/vc2010/*: Updated to handle x64 target. + + * src/builds/windows/*.mk, docs/INSTALL.GNU: s/win32/windows/ where + appropriate. + +2013-10-22 Werner Lemberg + + * src/base/md5.c, src/base/md5.h: Updated to recent version. + + * src/base/ftobjs.c: Updated; `md5.c' no longer uses `free'. + + The canonical URL to get updates for this file is + + http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/popa3d/popa3d/md5/ + + as the author told me in private communication. + +2013-10-19 Werner Lemberg + + [autofit] s/SMALL_TOP/X_HEIGHT/. + + * src/autofit/afblue.dat: Updated. + + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + + * src/autofit/aflatin.c, src/autofit/aflatin.h, + src/autofit/atlatin2.c: Updated. + +2013-10-19 Werner Lemberg + + * src/autofit/afblue.dat: s/MINOR/DESCENDER/. + + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + +2013-10-16 Werner Lemberg + + [autofit] Add description strings to script entries. + + Currently, this is unused. + + * src/autofit/afscript.h: Do it. + * src/autofit/afglobal.c, src/autofit/afpic.c, + src/autofit/aftypes.h: Updated. + +2013-10-16 Werner Lemberg + + [autofit] Improve tracing message for extra light flag. + + * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Do it. + +2013-10-15 Chongyu Zhu + + [arm] Fix thumb2 inline assembly under LLVM. + + When using `ADD' with an immediate operand, the instruction is + actually `ADD Rd, Rn, #', that is, the maximum of the + immediate operand cannot exceed 4095. It will fail to compile with + LLVM. + + However, in GCC, due to some legacy compatibility considerations, + `ADD.W' will be automatically emitted when the immediate operand is + larger than 4095. + + * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h + (FT_MulFix_arm) [__GNUC__]: Support clang compiler. + + * src/truetype/ttinterp.c (TT_MulFix14_arm) [__GNUC__]: Ditto. + +2013-10-12 Werner Lemberg + + [autofit] Improve tracing of `latin' hinter. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Report blue + zone types. + (af_latin_metrics_scale_dim): Report scaling changes due to x height + alignment. + Report scaled stroke width and blue zone values. + +2013-10-03 Dave Arnold + + * src/cff/cf2font.c (cf2_computeDarkening): Avoid division by zero. + + Note that the old code avoided using a region of the piecewise + linear function where the slope was zero. The recovery was to use a + different section of the function, which produced a different, + incorrect amount of darkening. + +2013-10-02 Darrell Bellert + + * src/sfnt/ttload.c (tt_face_load_pclt): Fix `pclt_fields'. + +2013-10-02 Dave Arnold + + * src/cff/cf2font.c (cf2_computeDarkening): Initialize darkenAmount. + + This line was lost in commit 89ca1fd6 (from 2013-06-25). The effect + is to use a previous darkening amount when producing an unhinted, + unscaled outline. This can cause autohint samples in ftgrid and + ftview to be based on darkened CFF outlines instead of unhinted, + undarkened ones. + +2013-09-29 Dave Arnold + + Fix Savannah bug #39295. + + The bug was caused by switching to the initial hintmap (the one in + effect when `moveto' executes) just before drawing the final element + in the charstring. This ensured that the path was closed (in both + Character Space and Device Space). But if the final element was a + curve and if the final hintmap was different enough from the initial + one, then the curve was visibly distorted. + + The first part of the fix is to draw the final curve using the final + hintmap as specified by the charstring. This corrects the + distortion but does not ensure closing in Device Space. It may + require the rasterizer to automatically generate an extra closing + line. Depending on the hintmap differences, this line could be from + zero to a couple pixels in length. + + The second part of the fix covers the case where the charstring + subpath is closed with an explicit line. We now modify that line's + end point to avoid the distortion. + + Some glyphs in the bug report font (TexGyreHeros-Regular) that show + the change are: + + 25ppem S (98) + 24ppem eight (52) + 25.5ppem p (85) + + Curves at the *end* of a subpath are no longer distorted. However, + some of these glyphs have bad hint substitutions in the middle of a + subpath, and these are not affected. + + The patch has been tested with a set of 106 fonts that shipped with + Adobe Creative Suite 4, together with 756 Open Source CFF fonts from + Google Fonts. There are 1.5 million glyphs, of which some 20k are + changed with the fix. A sampling of a few hundred of these changes + have been examined more closely, and the changes look good (or at + least acceptable). + + * src/cff/cf2hints.h (CF2_GlyphPathRec): New element `pathIsClosing' + to indicate that we synthesize a closepath line. + + * src/cff/cf2hints.c (cf2_glyphpath_init): Updated. + (cf2_glyphpath_pushPrevElem): If closing, use first hint map (for + `lineto' operator) and adjust hint zone. + For synthesized closing lines, use end point in first hint zone. + (cf2_glyphpath_lineTo): Take care of synthesized closing lines. In + particular, shift the detection of zero-length lines from character + space to device space. + (cf2_glyphpath_closeOpenPath): Remove assertion. + Updated. + +2013-09-25 Werner Lemberg + + * src/autofit/aflatin.c (af_{grek,cyrl}_uniranges): Fix arrays. + +2013-09-25 suzuki toshiya + + [bdf, pcf] Refuse non-zero face_index. + + Suggested by Akira Tagoh, see + + http://lists.gnu.org/archive/html/freetype/2013-09/msg00030.html + + * src/bdf/bdfdrivr.c (BDF_Face_Init): Return `Invalid_Argument' + error if the font could be opened but non-zero `face_index' is + given. + * src/pcf/pcfdrivr.c (PCF_Face_Init): Ditto. + + * src/type42/t42objs.c (T42_Face_Init): Remove unrequired FT_UNUSED + macro for `face_index' because it is validated later. + +2013-09-23 Werner Lemberg + + Fix Savannah bug #40090. + + * src/autofit/afcjk.c (af_cjk_metrics_scale): Revert commit + 306f8c5d (from 2013-08-25) affecting this function. + +2013-09-22 Werner Lemberg + + [autofit] Disunify Cyrillic and Greek handling from Latin. + + * src/autofit/afscript.h: Add Cyrillic and Greek. + + * src/autofit/afblue.dat (AF_BLUE_STRINGSET_GREK, + AF_BLUE_STRINGSET_CYRL): Add blue zones for Greek and Cyrillic. + (AF_BLUE_STRINGSET_LATN): Fix typo. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + + * src/autofit/aflatin.c (af_grek_uniranges, af_cyrl_uniranges): New + arrays. + (af_grek_script_class, af_cyrl_script_class): New scripts. + * src/autofit/aflatin.h: Updated. + +2013-09-20 Werner Lemberg + + * docs/CHANGES: Updated. + +2013-09-20 Behdad Esfahbod + + Fix vertical size of emboldened glyphs. + + Cf. https://bugzilla.gnome.org/show_bug.cgi?id=686709 + + * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Adjust `horiBearingY' + also. + +2013-09-11 Alexei Podtelezhnikov + + * include/freetype/ftoutln.h: Correct FT_Outline_Get_Orientation + algorithm description. + +2013-09-11 Werner Lemberg + + [autofit] Improve Hebrew rendering. + + This change introduces a new blue zone property + `AF_BLUE_PROPERTY_LATIN_LONG' to make the auto-hinter ignore short + top segments. + + * src/autofit/afblue.dat: Fix Hebrew blue strings. + Use AF_BLUE_PROPERTY_LATIN_LONG for AF_BLUE_STRING_HEBREW_TOP. + + * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_LONG): New macro. + + * src/autofit/afblue.c, src/autofit/afblue.h: Updated. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Handle + `AF_LATIN_IS_LONG_BLUE'. + + * src/autofit/aflatin.h (AF_LATIN_IS_LONG_BLUE): New macro. + +2013-08-28 Behdad Esfahbod + + [sfnt] Fix frame access while reading WOFF table directory. + + * src/sfnt/sfobjs.c (woff_open_font): Using single memory frame + while reading the directory entries for the whole loop. + +2013-08-29 Werner Lemberg + Behdad Esfahbod + + Implement support for WOFF containers. + + We simply synthesize a SFNT from the WOFF, create a memory stream + for the new data, and load the SFNT as usual. + + Does NOT add any API to access WOFF metadata or private blocks. + + * include/freetype/internal/tttypes.h (WOFF_HeaderRec, + WOFF_TableRec): New structures. + + * include/freetype/tttags.h (TTAG_wOFF): New macro. + + * src/base/ftobjs.c (FT_Open_Face): Set `stream' after calling + `open_face'. + + * src/sfnt/sfobjs.c [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Include + `FT_GZIP_H'. + (WRITE_BYTE, WRITE_USHORT, WRITE_ULONG): New temporary macros for + writing to a stream. + (sfnt_stream_close, compare_offsets, woff_open_font): New functions. + (sfnt_open_font): Handle `TTAG_wOFF'. + (sfnt_init_face): Set `stream' after calling `sfnt_open_font'. + + * src/truetype/ttobjs.c (tt_face_init): Set `stream' after calling + `sfnt->init_face'. + + * src/base/ftobjs.c (open_face): Use a pointer to FT_Stream as an + argument so that a changed stream survives. + Update callers. + +2013-08-28 Werner Lemberg + + [gzip] New function `FT_Gzip_Uncompress'. + + This is modeled after zlib's `uncompress' function. We need this + for WOFF support. + + * include/freetype/ftgzip.h, src/gzip/ftgzip.c (FT_Gzip_Uncompress): + New function. + + * src/gzip/rules.mk: Rewrite to better reflect dependencies. + +2013-08-28 Werner Lemberg + + [autofit] Fix `make multi' compilation. + + * src/autofit/afblue.cin, src/autofit/afblue.c: Don't include + `afblue.h' but `aftypes.h'. + * src/autofit/afcjk.c: Don't include `aftypes.h' but `afglobal.h'. + +2013-08-28 Werner Lemberg + + [autofit] Fix C++ compilation. + + * src/autofit/afglobal.c (af_face_globals_get_metrics), + src/autofit/afdummy.c (af_dflt_script_class), src/autofit/afindic.c + (af_deva_script_class): Use proper casts. + +2013-08-27 Behdad Esfahbod + + * src/sfnt/ttload.c (tt_face_load_font_dir): Fix sign typos. + +2013-08-27 Behdad Esfahbod + + FT_Open_Face: Improve external stream handling. + + If the font's `clazz->init_face' function wants to swap to new + stream, handling of whether original stream was external could + result to either memory leak or double free. Mark externality into + face flags before calling `init_face' such that the clazz can handle + external streams properly. + + * src/base/ftobjs.c (FT_Open_Face): Move code to set + FT_FACE_FLAG_EXTERNAL_STREAM to... + (open_face): This function. + +2013-08-27 Werner Lemberg + + Remove `FT_SqrtFixed' function. + + It's no longer used. + + * include/freetype/internal/ftcalc.h, src/base/ftcalc.c: Do it. + +2013-08-27 Werner Lemberg + + [autofit] While tracing, report script names instead of ID values. + + * src/autofit/afglobal.c (af_script_names) [FT_DEBUG_LEVEL_TRACE]: + New array. + * src/autofit/afglobal.h: Updated. + + * src/autofit/afcjk.c (af_cjk_metrics_init_widths, + af_cjk_hint_edges): Use `af_script_names'. + * src/autofit/aflatin.c (af_latin_metrics_init_widths, + af_latin_hint_edges): Ditto. + +2013-08-26 Werner Lemberg + + [autofit] Report used script while hinting a glyph. + + * src/autofit/afcjk.c (af_cjk_hint_edges), src/autofit/aflatin.c + (af_latin_hint_edges): Implement it. + +2013-08-26 Werner Lemberg + + [autofit] Add support for Hebrew script. + + * src/autofit/afblue.dat: Add blue strings for Hebrew. + * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated. + + * src/autofit/aflatin.c (af_hebr_uniranges): New array. + (af_hebr_script_class): New script. + * src/autofit/aflatin.h, src/autofit/afscript.h: Updated. + +2013-08-26 Werner Lemberg + + [autofit] Improve tracing messages. + + * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Mention script + ID in tracing message. + (af_cjk_metrics_init_blues): Initialize `axis' outside of the inner + loop. + Improve tracing messages. + (af_cjk_hint_edges) [FT_DEBUG_LEVEL_TRACE]: New variable + `num_actions' to count hinting actions. + Improve tracing messages. + + * src/autofit/aflatin.c (af_latin_metrics_init_widths): Mention + script ID in tracing message. + (af_latin_metrics_init_blues, af_latin_hint_edges): Improve tracing + messages. + +2013-08-26 Werner Lemberg + + Better tracing of loaded glyphs. + + Previously, the loading of a glyph was traced at level 4, if at all. + With this change, all font loading routines emit a tracing message + at level 1, making it easier to select tracing output (for example + using F2_DEBUG="any:1 afhints:7 aflatin:7"). + + * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Add tracing message. + * src/cff/cffdrivr.c (cff_glyph_load): Ditto. + * src/cff/cffgload.c (cff_decoder_prepare): Improve tracing + messages. + * src/cid/cidgload.c (cid_load_glyph): Use level 1 for tracing + message. + * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto. + * src/pfr/pfrobjs.c (pfr_slot_load): Add tracing message. + * src/truetype/ttgload.c (TT_Load_Glyph): Ditto. + * src/type1/t1gload.c (T1_Load_Glyph): Ditto. + * src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto. + * src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto. + +2013-08-26 Werner Lemberg + + [autofit] Fix script selection. + + * src/autofit/afglobal.c (af_face_globals_get_metrics): Use + `AF_SCRIPT_DFLT', not value 0. + Simplify code. + + * src/autofit/afscript.h: Sort by script name. + +2013-08-26 Werner Lemberg + + [autofit] Make `dummy' hinter work as expected. + + * src/autofit/afdummy.c (af_dummy_hints_init): Properly set scaling + information. + (af_dummy_hints_apply): Scale the glyphs. + +2013-08-25 Werner Lemberg + + [autofit] Make `cjk' module use blue stringsets. + + * src/autofit/afcjk.c (AF_CJK_MAX_TEST_CHARACTERS): Removed. + (af_cjk_hani_blue_chars): Removed. + (AF_CJK_BLUE_TYPE_*): Removed. + (af_cjk_metrics_init_blues): Replace AF_CJK_MAX_TEST_CHARACTERS with + AF_BLUE_STRING_MAX_LEN. + Change loops to use offsets (in file `afblue.h') into the new arrays + `af_blue_stringsets' and `af_blue_strings' (in file `afblue.c'). + Instead of three dimensions (as used in the old blue string array) + we now use properties to do the same, saving one loop nesting level. + + * src/autofit/afcjk.h: Remove old enumeration values superseded by + the new data in `afblue.h'. + (AF_CJK_IS_TOP_BLUE, AF_CJK_IS_HORIZ_BLUE, AF_CJK_IS_FILLED_BLUE, + AF_CJK_IS_RIGHT_BLUE): New macros, to be used in + `af_cjk_metrics_init_blues'. + (AF_CJK_BLUE_IS_RIGHT): Remove this now redundant enum value. + (AF_CJK_BLUE_IS_TOP): Renamed to... + (AF_CJK_BLUE_TOP): This. + (AF_CJK_MAX_BLUES): Remove. + (AF_CJKAxisRec): Updated. + +2013-08-25 Werner Lemberg + + [autofit] Typo. + + * src/autofit/afblue.hin, src/autofit/afblue.c (GET_UTF8_CHAR): Use + cast. + +2013-08-25 Werner Lemberg + + [autofit] Synchronize `cjk' with `latin' module (and vice versa). + + * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Add tracing + messages. + (af_cjk_metrics_init_blues): Don't pass blue string array as + argument but use the global array directly. + Use `outline' directly. + Update and add tracing messages. + (af_cjk_metrics_init): Simplify code. + (af_cjk_metrics_scale_dim): Improve tracing message. + (af_cjk_metrics_scale): Synchronize. + + * src/autofit/aflatin.c (af_latin_metrics_init_widths, + af_latin_metrics_init_blues): Improve and add tracing messages. + +2013-08-25 Werner Lemberg + + [autofit] Make `latin' module use blue stringsets. + + * src/autofit/aflatin.c (AF_LATIN_MAX_TEST_CHARACTERS): Removed. + (af_latin_blue_chars): Removed. + (af_latin_metrics_init_blues): Replace AF_LATIN_MAX_TEST_CHARACTERS + with AF_BLUE_STRING_MAX_LEN. + Change loops to use offsets (in file `afblue.h') into the new arrays + `af_blue_stringsets' and `af_blue_strings' (in file `afblue.c'). + Use `AF_LATIN_IS_SMALL_TOP_BLUE' macro. + + * src/autofit/aflatin.h: Remove old enumeration values superseded by + the new data in `afblue.h'. + (AF_LATIN_IS_TOP_BLUE): Updated definition. + (AF_LATIN_IS_SMALL_TOP_BLUE): New macro. + (AF_LATIN_MAX_BLUES): Remove. + (AF_LatinAxisRec): Updated. + +2013-08-25 Werner Lemberg + + [autofit] Add blue stringsets. + + * src/autofit/aftypes.h: Include `afblue.h'. + (AF_ScriptClassRec): Add `blue_stringset' field. + (AF_DEFINE_SCRIPT_CLASS): Updated. + + * src/autofit/autofit.c: Include `afblue.c'. + + * src/autofit/afcjk.c (af_hani_script_class), src/autofit/afdummy.c + (af_dflt_script_class), src/autofit/afindic.c + (af_deva_script_class), src/autofit/aflatin.c + (af_latn_script_class), src/autofit/aflatin2.c + (af_ltn2_script_class): Updated. + + * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afblue.c'. + +2013-08-25 Werner Lemberg + + [autofit] Introduce data file for blue strings. + + The idea is to have a central file which gets processed by a Perl + script to create proper `.c' and `.h' files using templates. There + are two other reasons to do that: + + . The data file should be easily readable. We use UTF-8 encoding + which then gets converted to single bytes. + + . Since the number of supported scripts will increase soon, the + current usage of blue string arrays is a waste of space. Using + the Perl script it is possible to imitate jagged arrays, + defining enumeration constants as offsets into the arrays. + + This commit only adds files without changing any functionality. + + * src/autofit/afblue.dat: New data file. + * src/tools/afblue.pl: New Perl script for processing `afblue.dat'. + + * src/autofit/afblue.cin, src/autofit/afblue.hin: New template files + for... + * src/autofit/afblue.c, src/autofit/afblue.c: New source files. + To avoid a dependency on Perl, we add them too. + +2013-08-19 Alexei Podtelezhnikov + + [base] Enable new algorithm for `BBox_Cubic_Check'. + + * src/base/ftbbox.c: Enable new BBox_Cubic_Check algorithm, remove + the old one. + Improve comments. + +2013-08-18 Werner Lemberg + + * builds/unix/unix-def.in (freetype2.pc): Don't set executable bit. + +2013-08-18 Werner Lemberg + + Fix Savannah bug #39804. + + * builds/unix/configure.raw (LIBPNG): Define and export. + * builds/unix/freetype-config.in, builds/unix/freetype2.in: Handle + libpng. + +2013-08-17 Alexei Podtelezhnikov + + [base] Clean up BBox_Conic_Check. + + * src/base/ftbbox.c (BBox_Conic_Check): Remove redundant checks for + extremum at the segment ends, which are already within the bbox. + Slightly modify calculations. + +2013-08-15 Alexei Podtelezhnikov + + [base] Finish experimental (disabled) BBox_Cubic_Check implementation. + + * src/base/ftbbox.c (BBox_Cubic_Check): Scale arguments to improve + accuracy and avoid overflows. + +2013-08-13 Alexei Podtelezhnikov + + [base] Refactor experimental (disabled) BBox_Cubic_Check. + + * src/base/ftbbox.c (BBox_Cubic_Check): Implement the minimum search + as the mirror image of the maximum search implemented here... + (update_max): New function. + +2013-08-06 John Tytgat + + Fix Savannah bug #39702. + + * src/cff/cffload.c (cff_index_get_pointers): Check for `cur_offset + != 0'; this stronger test is mandated by the CFF specification. + Fix test for INDEX structures which have one or more empty entries + at the end. + +2013-08-05 Werner Lemberg + + Fix gcc pragmas, part 2. + + * src/truetype/ttinterp.c (TT_MulFix14_long_long, + TT_DotFix14_long_long): `#pragma gcc diagnostic {push,pop}' has been + introduced with gcc version 4.6. + +2013-08-05 Werner Lemberg + + Fix gcc pragmas. + + * src/truetype/ttinterp.c (TT_MulFix14_long_long, + TT_DotFix14_long_long): Older gcc versions don't accept diagnostic + pragmas within a function body. + +2013-08-05 Werner Lemberg + + Fix Savannah bug #39700. + + * builds/unix/ftconfig.h: Synchronize with + `include/freetype/config/ftconfig.h'. + + * builds/vms/ftconfig.h: Ditto. + Make the differences to the master `ftconfig.h' file as small as + possible for easier maintainance. + +2013-08-05 Werner Lemberg + + [autofit] Improve handling of `near' points. + + Points which are very near to each other are now marked as such. + The `weak' flag is then computed by using the `in' vector of the + first and the `out' vector of the last point of a group of near + points. + + For example, this fixes the rendering of glyph `Oslash' in + `Roboto-Thin.ttf'. + + * src/autofit/afhints.h (AF_Flags): New value `AF_FLAGS_NEAR'. + + * src/autofit/afhints.c (af_glyph_hints_reload): Introduce + the heuristic value `near_limit' to decide whether the current point + is near to the previous one, then set `AF_FLAG_NEAR' accordingly. + Store good `in' vector (of last non-near point) in + `last_good_in_{x,y}' and use it as an argument to + `ft_corner_is_flat' if necessary. + +2013-08-02 Werner Lemberg + + * include/freetype/ftcffdrv.h: Improve documentation. + This is based on blog entries from David Lemon and Dave Arnold (both + from Adobe) with kind permission. Dave also helped in + proof-reading. + +2013-08-02 Werner Lemberg + + [autofit] Move declaration of scripts into separate file. + + This has the benefit that we don't need to duplicate the data at + different places. + + * src/autofit/afscript.h: New file. + + * src/autofit/aftypes.h (AF_Script): Include `afscript.h' to define + the enumeration values. + + * src/autofit/afglobal.c: Include `afscript.h' to get the script + specific header files. + (af_script_classes): Include `afscript.h' to fill this array. + + * src/autofit/afpic.c: Include `afscript.h' to get the script + specific header files. + (autofit_module_class_pic_init): Include `afscript.h' for + initialization. + * src/autofit/afpic.h (AF_SCRIPT_CLASSES_COUNT, + AF_SCRIPT_CLASSES_REC_COUNT): Removed. Use `AF_SCRIPT_MAX' instead. + + * src/autofit/rules.mk (AUTOF_DRV_H): Updated. + +2013-08-02 Werner Lemberg + + [autofit] Move declaration of writing systems into separate file. + + This has the benefit that we don't need to duplicate the data at + different places. + + * src/autofit/afwrtsys.h: New file. + + * src/autofit/aftypes.h (AF_WritingSystem): Include `afwrtsys.h' to + define the enumeration values. + + * src/autofit/afglobal.c: Include `afwrtsys.h' to get the writing + system specific header files. + Include `afpic.h'. + (af_writing_system_classes): Include `afwrtsys.h' to fill this + array. + + * src/autofit/afpic.c: Include `afwrtsys.h' to get the writing + system specific header files. + (autofit_module_class_pic_init): Include `afwrtsys.h' for + initialization. + * src/autofit/afpic.h (AF_WRITING_SYSTEM_CLASSES_COUNT, + AF_WRITING_SYSTEM_CLASSES_REC_COUNT): Removed. Use + `AF_WRITING_SYSTEM_MAX' instead. + +2013-08-02 Werner Lemberg + + [sfnt] Fix compilation with g++. + + * src/sfnt/pngshim.c (error_callback, read_data_from_FT_stream): Use + cast. + (Load_SBit_Png): Pacify compiler. + +2013-08-02 suzuki toshiya + Werner Lemberg + + [autofit] Fix `make multi'. + + * include/freetype/config/ftconfig.h (FT_LOCAL_ARRAY, + FT_LOCAL_ARRAY_DEF): New macros. + + * src/autofit/afglobal.c (af_writing_system_classes, + af_script_classes): Use FT_LOCAL_ARRAY_DEF. + * src/autofit/afglobal.h: Declare `af_writing_system_classes' and + `af_script_classes'. + * src/autofit/afloader.c: Include `afpic.h'. + +2013-08-01 Werner Lemberg + + Another round of cppcheck nitpicks. + + The call was (from the top-level of the FreeType tree): + + cppcheck --force \ + --enable=all \ + -I /usr/include \ + -I /usr/local/include \ + -I /usr/lib/gcc/i586-suse-linux/4.7/include \ + -I include \ + -I include/freetype \ + -I include/freetype/config \ + -I include/freetype/internal \ + -DFT2_BUILD_LIBRARY \ + . &> cppcheck.log + + using cppcheck git commit f7e93f99. + + Note that cppcheck still can't handle `#include FOO' (with `FOO' a + macro). + + */* Improve variable scopes. + */* Remove redundant initializations which get overwritten. + + * src/gxvalid/*: Comment out redundant code or guard it with + FT_DEBUG_LEVEL_TRACE. + +2013-07-30 Werner Lemberg + + [autofit] Introduce `writing systems'. + + This patch adds a new top level to the auto-hinter's script class + hierarchy. It defines `writing systems' which can contain multiple + scripts. + + For example, the `latin' writing system (in file `aflatin.c') is + able to support scripts like Latin, Cyrillic, Armenian, etc., which + can be handled similarly. + + Scripts are now named using four-letter OpenType tags. + + * src/autofit/aftypes.h (AF_ScriptClassRec): Move relevant members + to... + (AF_WritingSystemClassRec): This new structure. It holds pointers + to functions which can be shared among related scripts. + (AF_WritingSystem): New enumeration. + (AF_Script): Revised values using four-letter tags. + (AF_DEFINE_WRITING_SYSTEM_CLASS): New macro. + (AF_DEFINE_SCRIPT_CLASS): Updated. + + * src/autofit/afglobal.c (af_writing_system_classes): New global, + constant array. + (af_script_classes): Updated. + (af_face_globals_free): Updated. + Remove assertion. + (af_face_globals_get_metrics): Updated. + + * src/autofit/afglobal.h (AF_SCRIPT_FALLBACK) + [!AF_CONFIG_OPTION_CJK]: Handle this case. + + * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph): + Updated. + + * src/autofit/afpic.c (autofit_module_class_pic_init): Updated; + initialize structures for both writing systems and scripts. + * src/autofit/afpic.h: Updated. + (AF_WRITING_SYSTEM_CLASSES_GET): New macro. + + * src/autofit/afcjk.c (af_cjk_writing_system_class): New writing + system. + (af_cjk_uniranges): Renamed to... + (af_hani_uniranges): This. + (af_cjk_script_class): Reduced and renamed to... + (af_hani_script_class): This. + * src/autofit/afcjk.h: Updated. + + * src/autofit/afdummy.c (af_dummy_writing_system_class): New writing + system. + (af_dummy_script_class): Reduced and renamed to... + (af_dflt_script_class): This. + * src/autofit/afdummy.h: Updated. + + * src/autofit/afindic.c (af_indic_writing_system_class): New writing + system. + (af_indic_uniranges): Renamed to... + (af_deva_uniranges): This. + (af_indic_script_class): Reduced and renamed to... + (af_deva_script_class): This. + * src/autofit/afcjk.h: Updated. + + * src/autofit/aflatin.c (af_latin_writing_system_class): New writing + system. + (af_latin_uniranges): Renamed to... + (af_latn_uniranges): This. + (af_latin_script_class): Reduced and renamed to... + (af_latn_script_class): This. + * src/autofit/aflatin.h: Updated. + + * src/autofit/aflatin2.c (af_latin2_writing_system_class): New + writing system. + (af_latin2_uniranges): Renamed to... + (af_ltn2_uniranges): This. + Synchronize ranges with `latin'. + (af_latin2_script_class): Reduced and renamed to... + (af_ltn2_script_class): This. + * src/autofit/aflatin2.h: Updated. + +2013-07-30 Werner Lemberg + + [autofit] Variable renaming. + + * src/autofit/aftypes.h (AF_ScriptMetricsRec): + s/clazz/script_class/. + Update all users. + +2013-07-30 suzuki toshiya + + Ignore libpng-config under cross-building configuration, + because it will return the flags for the hosting environment. + + * builds/unix/configure.raw: Ignore libpng-config when + `cross_compiling' == yes. + +2013-07-30 Behdad Esfahbod + + Prevent division by zero by a transparent color. + + * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): + Return 0 immediately, when alpha channel is zero. + +2013-07-25 Behdad Esfahbod + + Add FT_FACE_FLAG_COLOR and FT_HAS_COLOR. + + Also disambiguate Google's color bitmap tables. + + * include/freetype/freetype.h (FT_FACE_FLAG_COLOR, FT_HAS_COLOR): + New macros. + + * include/freetype/internal/tttypes.h (TT_SbitTableType): Add + TT_SBIT_TABLE_TYPE_CBLC. + + * src/sfnt/sfobjs.c (sfnt_load_face): Handle FT_FACE_FLAG_COLOR. + + * src/sfnt/ttsbit.c (tt_face_load_sbit, + tt_face_load_strike_metrics, tt_face_load_sbit_image): Handle + TT_SBIT_TABLE_TYPE_CBLC. + +2013-07-24 suzuki toshiya + + [sfnt] Fix for `make multi' target. + + * src/sfnt/pngshim.c (Load_SBit_Png): Use FT_LOCAL_DEF(). + +2013-07-20 Werner Lemberg + + * docs/INSTALL.GNU: Updated. + +2013-07-20 Behdad Esfahbod + + [sfnt] Fix `sbix' table version handling. + + * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]: + USHORT version numbers are to be considered as `minor'. + +2013-07-19 Werner Lemberg + + [autofit] Fix segment classification for blue zones. + + The old code (essentially unchanged since the very beginning) + incorrectly handled this configuration + + x -o- x + / \ + / \ + / \ + o o + + as flat and this + + o o + / / + x| x| + | | + o---------------o + + as round. (`o' and `x' are on and off points, respectively). + + This is a major change which should improve the rendering results + enormously for many TrueType fonts, especially in the range approx. + 20-40ppem, fixing the appearance of many overshoots. + + * src/autofit/aflatin.c (af_latin_metrics_init_blues): Look at the + first and last points of the segment, not the points right before + and after. + +2013-07-19 Behdad Esfahbod + + [sfnt] `sbix' fix-ups. + + * src/sfnt/sfobjs.c (sfnt_load_face): Apple's `sbix' color bitmaps + are rendered scaled and then the `glyf' outline rendered on top. We + don't support that yet, so just ignore the `glyf' outline and + advertise it as a bitmap-only font. + + * src/sfnt/ttsbit.c (tt_face_load_strike_metrics) + [TT_SBIT_TABLE_TYPE_SBIX]: Return metrics in 26.6 units. + (tt_face_load_sbix_image): Typo. + +2013-07-18 Behdad Esfahbod + + [sfnt] Add support for Apple's `sbix' color bitmap table. + + * include/freetype/internal/tttypes.h (TT_SBit_MetricsRec): Widen + fields to FT_Short and FT_UShort, respectively. + (TT_SBitTableType): New enumeration. + (TT_FaceRec): Add `sbit_table_type' field. + + * include/freetype/tttags.h (TTAG_sbix): New macro. + + * src/sfnt/pngshim.c (Load_SBit_Png): Pass a more generic + FT_GlyphSlot argument instead FT_Bitmap. + Add flag to control map and metrics handling. + Update all users. + + * src/sfnt/ttsbit.c: Include `ttmtx.h'. + (tt_face_load_eblc): Renamed to... + (tt_face_load_sbit): This. + Handlic `sbix' bitmaps. + (tt_face_free_eblc): Renamed to... + (tt_face_load_sbit): This. + Updated. + (tt_face_load_strike_metrics): Handle `sbix' bitmaps. + (tt_face_load_sbix_image): New function. + (tt_sbit_decoder_alloc_bitmap, tt_sbit_decoder_load_image, + tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned, + tt_sbit_decoder_load_compound, tt_sbit_decoder_load_png, + tt_sbit_decoder_load_image, tt_sbit_decoder_load_bitmap): Don't pass + and handle load flags. + (tt_sbit_decoder_load_bitmap) [!FT_CONFIG_OPTION_USE_PNG]: Better + handle formats 17-19. + Move color to grayscale conversion to... + (tt_face_load_sbit_image): Here. + Handle `sbix' bitmaps. + + * src/sfnt/pngshim.h: Updated. + * src/sfnt/ttsbit.h: Updated. + * src/sfnt/sfdriver.c: Updated. + +2013-07-18 Werner Lemberg + + [sfnt] Ignore invalid magic number in `head' or `bhed'. + + Other font engines seem to ignore it also. Problem reported by + Hin-Tak Leung . + + * src/sfnt/ttload.c (check_table_dir): Don't abort but warn only if + we have an invalid magic number. + +2013-07-16 Werner Lemberg + + [smooth] Fix segfault caused by previous commit. + + * src/smooth/ftgrays.c (gray_set_cell): Always compute + `ras.invalid'. + +2013-07-16 David Turner + + [smooth] Improve performance. + + Provide a work-around for an ARM-specific performance bug in GCC. + This speeds up the rasterizer by more than 5%. + + Also slightly optimize `set_gray_cell' and `gray_record_cell' (which + also improves performance on other platforms by a tiny bit (<1%). + + * src/smooth/ftgrays.c (FT_DIV_MOD): New macro. + Use it where appropriate. + + (gray_record_cell, gray_set_cell, gray_move_to, + gray_convert_glyph_inner): Streamline condition handling. + +2013-07-16 David Turner + + [truetype] Add assembler code for TT_MulFix14 and TT_DotFix14. + + This patch provides slightly optimized versions for ARM, x86, and + x86_64 CPUs if built with GCC. + + Also remove some dead code. + + * src/truetype/ttinterp.c (TT_MulFix14_arm, TT_MulFix14_long_long, + TT_DotFix14_long_long): New functions. + +2013-07-16 David Turner + + Optimize FT_MulFix for x86_64 GCC builds. + + This patch provides an optimized `FT_MulFix' implementation for + x86_64 machines when FreeType is built with GCC, or compatible + compilers like Clang. + + Example: + bin/ftbench -p -t 5 -s 14 -f 0008 Arial.ttf + + Before: + + Load 4.863 us/op + Load_Advances (Normal) 4.816 us/op + Load_Advances (Fast) 0.028 us/op + Render 2.753 us/op + Get_Glyph 0.463 us/op + Get_CBox 0.077 us/op + Get_Char_Index 0.023 us/op + Iterate CMap 13.898 us/op + New_Face 12.368 us/op + Embolden 0.028 us/op + Get_BBox 0.302 us/op + + After: + + Load 4.617 us/op + Load_Advances (Normal) 4.645 us/op + Load_Advances (Fast) 0.027 us/op + Render 2.789 us/op + Get_Glyph 0.460 us/op + Get_CBox 0.077 us/op + Get_Char_Index 0.024 us/op + Iterate CMap 13.403 us/op + New_Face 12.278 us/op + Embolden 0.028 us/op + Get_BBox 0.301 us/op + + * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h + (FT_MulFix_x86_64): New function. + +2013-07-16 David Turner + + Speed up ARMv7 support. + + When building for ARMv7 with thumb2 instructions, the optimized + `FT_MulFix_arm' assembly routine was not being used. + + The reason for this is in the `ftconfig.h' header, namely: + + - The assembly routine uses the `smull' instruction which is not + available when generating Thumb-1 machine code. It is available + in Thumb-2 mode, though. + + - The header was written a long time ago before Thumb-2 became + widely popular (e.g. with Android). So it simply doesn't use the + assembly routine if the `__thumb__' built-in macro is defined. + + - When compiling in Thumb-2 mode, the compiler will define both + `__thumb__' and `__thumb2__'. + + By checking for `(__thumb2__ || !__thumb__)', we ensure that the + assembly routine is only avoided when generating Thumb-1 code. + + Given that this is performance-sensitive function, this improves + `ftbench' as follows on a Galaxy Nexus: + + Before (us/op) After (us/op) + + - loading Arial.ttf glyphs at 14 ppem [1] + + Load 34.285 33.098 + + - same operation with the light auto-hinter [2] + + Load 31.317 29.590 + + - same operation without hinting [3] + + Load 6.143 5.376 + + - loading Arial.ttf advances at 14 ppem [4] + + Load_Advances (normal) 34.216 33.016 + Load_Advances (fast) 0.176 0.176 + + [1] ftbench -t 5 -p -s 14 -b a -f 0008 Arial.ttf + [2] ftbench -t 5 -p -s 14 -b a -r 1 -f 0028 Arial.ttf + [3] ftbench -t 5 -p -s 14 -b a -f 000a Arial.ttf + [4] ftbench -t 5 -p -s 14 -b b -f 0008 Arial.ttf + + * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h + (FT_MULFIX_ASSEMBLER): Fix handling for ARMv7. + +2013-06-28 Werner Lemberg + + * docs/CHANGES: Updated. + +2013-06-27 Werner Lemberg + + * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix bitmap width guard. + +2013-06-25 Werner Lemberg + + [cff] Add darkening limit to `darkening-parameters'. + + * src/cff/cffdrivr.c (cff_property_set): Add check. + +2013-06-25 Werner Lemberg + + [cff] Add `darkening-parameters' property. + + * include/freetype/ftcffdrv.h: Document it. + + * src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle + `darkening-parameters' property. + + * src/cff/cf2font.h (CF2_FontRec): Add `darkenParams' array. + + * src/cff/cf2font.c (cf2_computeDarkening): Add `darkenParams' + argument and use it. + Update all callers. + + * src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Copy + `darken_params' values. + + * src/cff/cffobjs.h (CFF_DriverRec): Add `darken_params' array. + + * src/cff/cffobjs.c (cff_driver_init): Set default values for + `darken_params'. + +2013-06-25 Werner Lemberg + + [docmaker] Code shuffling. + + * src/tools/docmaker/tohtml.py (re_url): Move regexp... + * src/tools/docmaker/sources.py: ... to this file. + +2013-06-25 Werner Lemberg + + [docmaker] Remove unused functions. + + * src/tools/docmaker/content.py (DocMarkup.get_start, + DocBlock.get_markup_name): Removed. + * src/tools/docmaker/tohtml.py (html_quote0, dump_html_code, + HtmlFormatter.make_html_words): Removed. + +2013-06-25 Werner Lemberg + + * builds/freetype.mk (dll): Remove target. + + Problem reported by Jörg Günnewig . + +2013-06-25 Werner Lemberg + + [docmaker] Recognise URLs. + + * src/tools/docmaker/tohtml.py (re_url): New regular expression. + (make_html_para): Use it. + 2013-06-19 Werner Lemberg * Version 2.5.0.1 released. @@ -295,7 +1851,7 @@ */* Improve variable scopes. */* Remove redundant initializations which get overwritten. - * src/base/ftmac.c ,builds/mac/ftmac.c (count_faces_scalable): + * src/base/ftmac.c, builds/mac/ftmac.c (count_faces_scalable): Remove unused variable. * src/base/ftdbgmem.c (ft_mem_table_destroy): `table' can't be zero. @@ -575,7 +2131,7 @@ [sfnt] Clean up bitmap code. * src/sfnt/ttsbit.c: Deleted. - * src/sfnt/ttsbit0.c: Renamed to `ttsbit.c'. + * src/sfnt/ttsbit0.c: Renamed to `ttsbit.c'. * rules.mk (SFNT_DRV_H): Updated. 2013-05-10 Werner Lemberg diff --git a/reactos/lib/3rdparty/freetype/README b/reactos/lib/3rdparty/freetype/README index 798715a4119..c660cd1c27e 100644 --- a/reactos/lib/3rdparty/freetype/README +++ b/reactos/lib/3rdparty/freetype/README @@ -1,4 +1,4 @@ - FreeType 2.5.0 + FreeType 2.5.2 ============== Homepage: http://www.freetype.org @@ -24,9 +24,9 @@ and download one of the following files. - freetype-doc-2.5.0.tar.bz2 - freetype-doc-2.5.0.tar.gz - ftdoc250.zip + freetype-doc-2.5.2.tar.bz2 + freetype-doc-2.5.2.tar.gz + ftdoc252.zip To view the documentation online, go to diff --git a/reactos/lib/3rdparty/freetype/autogen.sh b/reactos/lib/3rdparty/freetype/autogen.sh index 0eaba395b5f..cc0e661ce5a 100644 --- a/reactos/lib/3rdparty/freetype/autogen.sh +++ b/reactos/lib/3rdparty/freetype/autogen.sh @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2005, 2006, 2007, 2008, 2009, 2010 by +# Copyright 2005-2010, 2013 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -139,7 +139,7 @@ check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4 check_tool_version $AUTOCONF autoconf AUTOCONF 2.62 # This sets freetype_major, freetype_minor, and freetype_patch. -eval `sed -nf version.sed include/freetype/freetype.h` +eval `sed -nf version.sed include/freetype.h` # We set freetype-patch to an empty value if it is zero. if test "$freetype_patch" = ".0"; then diff --git a/reactos/lib/3rdparty/freetype/devel/ft2build.h b/reactos/lib/3rdparty/freetype/devel/ft2build.h new file mode 100644 index 00000000000..6cc34b77b42 --- /dev/null +++ b/reactos/lib/3rdparty/freetype/devel/ft2build.h @@ -0,0 +1,40 @@ +/***************************************************************************/ +/* */ +/* ft2build.h */ +/* */ +/* FreeType 2 build and setup macros (development version). */ +/* */ +/* Copyright 1996-2001, 2003, 2006, 2013 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /* + * This is a development version of to build the library in + * debug mode. Its only difference to the default version is that it + * includes a local `ftoption.h' header file with different settings for + * many configuration macros. + * + * To use it, simply ensure that the directory containing this file is + * scanned by the compiler before the default FreeType header directory. + * + */ + +#ifndef __FT2BUILD_H__ +#define __FT2BUILD_H__ + +#define FT_CONFIG_OPTIONS_H + +#include + +#endif /* __FT2BUILD_H__ */ + + +/* END */ diff --git a/reactos/lib/3rdparty/freetype/devel/ftoption.h b/reactos/lib/3rdparty/freetype/devel/ftoption.h new file mode 100644 index 00000000000..27d1bd9a5d7 --- /dev/null +++ b/reactos/lib/3rdparty/freetype/devel/ftoption.h @@ -0,0 +1,833 @@ +/***************************************************************************/ +/* */ +/* ftoption.h (for development) */ +/* */ +/* User-selectable configuration macros (specification only). */ +/* */ +/* Copyright 1996-2013 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTOPTION_H__ +#define __FTOPTION_H__ + + +#include + + +FT_BEGIN_HEADER + + /*************************************************************************/ + /* */ + /* USER-SELECTABLE CONFIGURATION MACROS */ + /* */ + /* This file contains the default configuration macro definitions for */ + /* a standard build of the FreeType library. There are three ways to */ + /* use this file to build project-specific versions of the library: */ + /* */ + /* - You can modify this file by hand, but this is not recommended in */ + /* cases where you would like to build several versions of the */ + /* library from a single source directory. */ + /* */ + /* - You can put a copy of this file in your build directory, more */ + /* precisely in `$BUILD/config/ftoption.h', where `$BUILD' is the */ + /* name of a directory that is included _before_ the FreeType include */ + /* path during compilation. */ + /* */ + /* The default FreeType Makefiles and Jamfiles use the build */ + /* directory `builds/' by default, but you can easily change */ + /* that for your own projects. */ + /* */ + /* - Copy the file to `$BUILD/ft2build.h' and modify it */ + /* slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to */ + /* locate this file during the build. For example, */ + /* */ + /* #define FT_CONFIG_OPTIONS_H */ + /* #include */ + /* */ + /* will use `$BUILD/myftoptions.h' instead of this file for macro */ + /* definitions. */ + /* */ + /* Note also that you can similarly pre-define the macro */ + /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */ + /* that are statically linked to the library at compile time. By */ + /* default, this file is . */ + /* */ + /* We highly recommend using the third method whenever possible. */ + /* */ + /*************************************************************************/ + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** G E N E R A L F R E E T Y P E 2 C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Uncomment the line below if you want to activate sub-pixel rendering */ + /* (a.k.a. LCD rendering, or ClearType) in this build of the library. */ + /* */ + /* Note that this feature is covered by several Microsoft patents */ + /* and should not be activated in any default build of the library. */ + /* */ + /* This macro has no impact on the FreeType API, only on its */ + /* _implementation_. For example, using FT_RENDER_MODE_LCD when calling */ + /* FT_Render_Glyph still generates a bitmap that is 3 times wider than */ + /* the original size in case this macro isn't defined; however, each */ + /* triplet of subpixels has R=G=B. */ + /* */ + /* This is done to allow FreeType clients to run unmodified, forcing */ + /* them to display normal gray-level anti-aliased glyphs. */ + /* */ +#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING + + + /*************************************************************************/ + /* */ + /* Many compilers provide a non-ANSI 64-bit data type that can be used */ + /* by FreeType to speed up some computations. However, this will create */ + /* some problems when compiling the library in strict ANSI mode. */ + /* */ + /* For this reason, the use of 64-bit integers is normally disabled when */ + /* the __STDC__ macro is defined. You can however disable this by */ + /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here. */ + /* */ + /* For most compilers, this will only create compilation warnings when */ + /* building the library. */ + /* */ + /* ObNote: The compiler-specific 64-bit integers are detected in the */ + /* file `ftconfig.h' either statically or through the */ + /* `configure' script on supported platforms. */ + /* */ +#undef FT_CONFIG_OPTION_FORCE_INT64 + + + /*************************************************************************/ + /* */ + /* If this macro is defined, do not try to use an assembler version of */ + /* performance-critical functions (e.g. FT_MulFix). You should only do */ + /* that to verify that the assembler function works properly, or to */ + /* execute benchmark tests of the various implementations. */ +/* #define FT_CONFIG_OPTION_NO_ASSEMBLER */ + + + /*************************************************************************/ + /* */ + /* If this macro is defined, try to use an inlined assembler version of */ + /* the `FT_MulFix' function, which is a `hotspot' when loading and */ + /* hinting glyphs, and which should be executed as fast as possible. */ + /* */ + /* Note that if your compiler or CPU is not supported, this will default */ + /* to the standard and portable implementation found in `ftcalc.c'. */ + /* */ +#define FT_CONFIG_OPTION_INLINE_MULFIX + + + /*************************************************************************/ + /* */ + /* LZW-compressed file support. */ + /* */ + /* FreeType now handles font files that have been compressed with the */ + /* `compress' program. This is mostly used to parse many of the PCF */ + /* files that come with various X11 distributions. The implementation */ + /* uses NetBSD's `zopen' to partially uncompress the file on the fly */ + /* (see src/lzw/ftgzip.c). */ + /* */ + /* Define this macro if you want to enable this `feature'. */ + /* */ +#define FT_CONFIG_OPTION_USE_LZW + + + /*************************************************************************/ + /* */ + /* Gzip-compressed file support. */ + /* */ + /* FreeType now handles font files that have been compressed with the */ + /* `gzip' program. This is mostly used to parse many of the PCF files */ + /* that come with XFree86. The implementation uses `zlib' to */ + /* partially uncompress the file on the fly (see src/gzip/ftgzip.c). */ + /* */ + /* Define this macro if you want to enable this `feature'. See also */ + /* the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below. */ + /* */ +#define FT_CONFIG_OPTION_USE_ZLIB + + + /*************************************************************************/ + /* */ + /* ZLib library selection */ + /* */ + /* This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined. */ + /* It allows FreeType's `ftgzip' component to link to the system's */ + /* installation of the ZLib library. This is useful on systems like */ + /* Unix or VMS where it generally is already available. */ + /* */ + /* If you let it undefined, the component will use its own copy */ + /* of the zlib sources instead. These have been modified to be */ + /* included directly within the component and *not* export external */ + /* function names. This allows you to link any program with FreeType */ + /* _and_ ZLib without linking conflicts. */ + /* */ + /* Do not #undef this macro here since the build system might define */ + /* it for certain configurations only. */ + /* */ +/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */ + + + /*************************************************************************/ + /* */ + /* Bzip2-compressed file support. */ + /* */ + /* FreeType now handles font files that have been compressed with the */ + /* `bzip2' program. This is mostly used to parse many of the PCF */ + /* files that come with XFree86. The implementation uses `libbz2' to */ + /* partially uncompress the file on the fly (see src/bzip2/ftbzip2.c). */ + /* Contrary to gzip, bzip2 currently is not included and need to use */ + /* the system available bzip2 implementation. */ + /* */ + /* Define this macro if you want to enable this `feature'. */ + /* */ +#define FT_CONFIG_OPTION_USE_BZIP2 + + + /*************************************************************************/ + /* */ + /* PNG bitmap support. */ + /* */ + /* FreeType now handles loading color bitmap glyphs in the PNG format. */ + /* This requires help from the external libpng library. Uncompressed */ + /* color bitmaps do not need any external libraries and will be */ + /* supported regardless of this configuration. */ + /* */ + /* Define this macro if you want to enable this `feature'. */ + /* */ +#define FT_CONFIG_OPTION_USE_PNG + + + /*************************************************************************/ + /* */ + /* Define to disable the use of file stream functions and types, FILE, */ + /* fopen() etc. Enables the use of smaller system libraries on embedded */ + /* systems that have multiple system libraries, some with or without */ + /* file stream support, in the cases where file stream support is not */ + /* necessary such as memory loading of font files. */ + /* */ +/* #define FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */ + + + /*************************************************************************/ + /* */ + /* DLL export compilation */ + /* */ + /* When compiling FreeType as a DLL, some systems/compilers need a */ + /* special keyword in front OR after the return type of function */ + /* declarations. */ + /* */ + /* Two macros are used within the FreeType source code to define */ + /* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */ + /* */ + /* FT_EXPORT( return_type ) */ + /* */ + /* is used in a function declaration, as in */ + /* */ + /* FT_EXPORT( FT_Error ) */ + /* FT_Init_FreeType( FT_Library* alibrary ); */ + /* */ + /* */ + /* FT_EXPORT_DEF( return_type ) */ + /* */ + /* is used in a function definition, as in */ + /* */ + /* FT_EXPORT_DEF( FT_Error ) */ + /* FT_Init_FreeType( FT_Library* alibrary ) */ + /* { */ + /* ... some code ... */ + /* return FT_Err_Ok; */ + /* } */ + /* */ + /* You can provide your own implementation of FT_EXPORT and */ + /* FT_EXPORT_DEF here if you want. If you leave them undefined, they */ + /* will be later automatically defined as `extern return_type' to */ + /* allow normal compilation. */ + /* */ + /* Do not #undef these macros here since the build system might define */ + /* them for certain configurations only. */ + /* */ +/* #define FT_EXPORT(x) extern x */ +/* #define FT_EXPORT_DEF(x) x */ + + + /*************************************************************************/ + /* */ + /* Glyph Postscript Names handling */ + /* */ + /* By default, FreeType 2 is compiled with the `psnames' module. This */ + /* module is in charge of converting a glyph name string into a */ + /* Unicode value, or return a Macintosh standard glyph name for the */ + /* use with the TrueType `post' table. */ + /* */ + /* Undefine this macro if you do not want `psnames' compiled in your */ + /* build of FreeType. This has the following effects: */ + /* */ + /* - The TrueType driver will provide its own set of glyph names, */ + /* if you build it to support postscript names in the TrueType */ + /* `post' table. */ + /* */ + /* - The Type 1 driver will not be able to synthesize a Unicode */ + /* charmap out of the glyphs found in the fonts. */ + /* */ + /* You would normally undefine this configuration macro when building */ + /* a version of FreeType that doesn't contain a Type 1 or CFF driver. */ + /* */ +#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES + + + /*************************************************************************/ + /* */ + /* Postscript Names to Unicode Values support */ + /* */ + /* By default, FreeType 2 is built with the `PSNames' module compiled */ + /* in. Among other things, the module is used to convert a glyph name */ + /* into a Unicode value. This is especially useful in order to */ + /* synthesize on the fly a Unicode charmap from the CFF/Type 1 driver */ + /* through a big table named the `Adobe Glyph List' (AGL). */ + /* */ + /* Undefine this macro if you do not want the Adobe Glyph List */ + /* compiled in your `PSNames' module. The Type 1 driver will not be */ + /* able to synthesize a Unicode charmap out of the glyphs found in the */ + /* fonts. */ + /* */ +#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST + + + /*************************************************************************/ + /* */ + /* Support for Mac fonts */ + /* */ + /* Define this macro if you want support for outline fonts in Mac */ + /* format (mac dfont, mac resource, macbinary containing a mac */ + /* resource) on non-Mac platforms. */ + /* */ + /* Note that the `FOND' resource isn't checked. */ + /* */ +#define FT_CONFIG_OPTION_MAC_FONTS + + + /*************************************************************************/ + /* */ + /* Guessing methods to access embedded resource forks */ + /* */ + /* Enable extra Mac fonts support on non-Mac platforms (e.g. */ + /* GNU/Linux). */ + /* */ + /* Resource forks which include fonts data are stored sometimes in */ + /* locations which users or developers don't expected. In some cases, */ + /* resource forks start with some offset from the head of a file. In */ + /* other cases, the actual resource fork is stored in file different */ + /* from what the user specifies. If this option is activated, */ + /* FreeType tries to guess whether such offsets or different file */ + /* names must be used. */ + /* */ + /* Note that normal, direct access of resource forks is controlled via */ + /* the FT_CONFIG_OPTION_MAC_FONTS option. */ + /* */ +#ifdef FT_CONFIG_OPTION_MAC_FONTS +#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK +#endif + + + /*************************************************************************/ + /* */ + /* Allow the use of FT_Incremental_Interface to load typefaces that */ + /* contain no glyph data, but supply it via a callback function. */ + /* This is required by clients supporting document formats which */ + /* supply font data incrementally as the document is parsed, such */ + /* as the Ghostscript interpreter for the PostScript language. */ + /* */ +#define FT_CONFIG_OPTION_INCREMENTAL + + + /*************************************************************************/ + /* */ + /* The size in bytes of the render pool used by the scan-line converter */ + /* to do all of its work. */ + /* */ + /* This must be greater than 4KByte if you use FreeType to rasterize */ + /* glyphs; otherwise, you may set it to zero to avoid unnecessary */ + /* allocation of the render pool. */ + /* */ +#define FT_RENDER_POOL_SIZE 16384L + + + /*************************************************************************/ + /* */ + /* FT_MAX_MODULES */ + /* */ + /* The maximum number of modules that can be registered in a single */ + /* FreeType library object. 32 is the default. */ + /* */ +#define FT_MAX_MODULES 32 + + + /*************************************************************************/ + /* */ + /* Debug level */ + /* */ + /* FreeType can be compiled in debug or trace mode. In debug mode, */ + /* errors are reported through the `ftdebug' component. In trace */ + /* mode, additional messages are sent to the standard output during */ + /* execution. */ + /* */ + /* Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode. */ + /* Define FT_DEBUG_LEVEL_TRACE to build it in trace mode. */ + /* */ + /* Don't define any of these macros to compile in `release' mode! */ + /* */ + /* Do not #undef these macros here since the build system might define */ + /* them for certain configurations only. */ + /* */ +#define FT_DEBUG_LEVEL_ERROR +#define FT_DEBUG_LEVEL_TRACE + + + /*************************************************************************/ + /* */ + /* Autofitter debugging */ + /* */ + /* If FT_DEBUG_AUTOFIT is defined, FreeType provides some means to */ + /* control the autofitter behaviour for debugging purposes with global */ + /* boolean variables (consequently, you should *never* enable this */ + /* while compiling in `release' mode): */ + /* */ + /* _af_debug_disable_horz_hints */ + /* _af_debug_disable_vert_hints */ + /* _af_debug_disable_blue_hints */ + /* */ + /* Additionally, the following functions provide dumps of various */ + /* internal autofit structures to stdout (using `printf'): */ + /* */ + /* af_glyph_hints_dump_points */ + /* af_glyph_hints_dump_segments */ + /* af_glyph_hints_dump_edges */ + /* */ + /* As an argument, they use another global variable: */ + /* */ + /* _af_debug_hints */ + /* */ + /* Please have a look at the `ftgrid' demo program to see how those */ + /* variables and macros should be used. */ + /* */ + /* Do not #undef these macros here since the build system might define */ + /* them for certain configurations only. */ + /* */ +#define FT_DEBUG_AUTOFIT + + + /*************************************************************************/ + /* */ + /* Memory Debugging */ + /* */ + /* FreeType now comes with an integrated memory debugger that is */ + /* capable of detecting simple errors like memory leaks or double */ + /* deletes. To compile it within your build of the library, you */ + /* should define FT_DEBUG_MEMORY here. */ + /* */ + /* Note that the memory debugger is only activated at runtime when */ + /* when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */ + /* */ + /* Do not #undef this macro here since the build system might define */ + /* it for certain configurations only. */ + /* */ +#define FT_DEBUG_MEMORY + + + /*************************************************************************/ + /* */ + /* Module errors */ + /* */ + /* If this macro is set (which is _not_ the default), the higher byte */ + /* of an error code gives the module in which the error has occurred, */ + /* while the lower byte is the real error code. */ + /* */ + /* Setting this macro makes sense for debugging purposes only, since */ + /* it would break source compatibility of certain programs that use */ + /* FreeType 2. */ + /* */ + /* More details can be found in the files ftmoderr.h and fterrors.h. */ + /* */ +#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS + + + /*************************************************************************/ + /* */ + /* Position Independent Code */ + /* */ + /* If this macro is set (which is _not_ the default), FreeType2 will */ + /* avoid creating constants that require address fixups. Instead the */ + /* constants will be moved into a struct and additional intialization */ + /* code will be used. */ + /* */ + /* Setting this macro is needed for systems that prohibit address */ + /* fixups, such as BREW. */ + /* */ +/* #define FT_CONFIG_OPTION_PIC */ + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** S F N T D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support */ + /* embedded bitmaps in all formats using the SFNT module (namely */ + /* TrueType & OpenType). */ + /* */ +#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to */ + /* load and enumerate the glyph Postscript names in a TrueType or */ + /* OpenType file. */ + /* */ + /* Note that when you do not compile the `PSNames' module by undefining */ + /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will */ + /* contain additional code used to read the PS Names table from a font. */ + /* */ + /* (By default, the module uses `PSNames' to extract glyph names.) */ + /* */ +#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to */ + /* access the internal name table in a SFNT-based format like TrueType */ + /* or OpenType. The name table contains various strings used to */ + /* describe the font, like family name, copyright, version, etc. It */ + /* does not contain any glyph name though. */ + /* */ + /* Accessing SFNT names is done through the functions declared in */ + /* `ftsnames.h'. */ + /* */ +#define TT_CONFIG_OPTION_SFNT_NAMES + + + /*************************************************************************/ + /* */ + /* TrueType CMap support */ + /* */ + /* Here you can fine-tune which TrueType CMap table format shall be */ + /* supported. */ +#define TT_CONFIG_CMAP_FORMAT_0 +#define TT_CONFIG_CMAP_FORMAT_2 +#define TT_CONFIG_CMAP_FORMAT_4 +#define TT_CONFIG_CMAP_FORMAT_6 +#define TT_CONFIG_CMAP_FORMAT_8 +#define TT_CONFIG_CMAP_FORMAT_10 +#define TT_CONFIG_CMAP_FORMAT_12 +#define TT_CONFIG_CMAP_FORMAT_13 +#define TT_CONFIG_CMAP_FORMAT_14 + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** T R U E T Y P E D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile */ + /* a bytecode interpreter in the TrueType driver. */ + /* */ + /* By undefining this, you will only compile the code necessary to load */ + /* TrueType glyphs without hinting. */ + /* */ + /* Do not #undef this macro here, since the build system might */ + /* define it for certain configurations only. */ + /* */ +#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */ + /* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */ + /* replaces the native TrueType hinting mechanism when anything but */ + /* FT_RENDER_MODE_MONO is requested. */ + /* */ + /* Enabling this causes the TrueType driver to ignore instructions under */ + /* certain conditions. This is done in accordance with the guide here, */ + /* with some minor differences: */ + /* */ + /* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */ + /* */ + /* By undefining this, you only compile the code necessary to hint */ + /* TrueType glyphs with native TT hinting. */ + /* */ + /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */ + /* defined. */ + /* */ +#define TT_CONFIG_OPTION_SUBPIXEL_HINTING + + + /*************************************************************************/ + /* */ + /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */ + /* of the TrueType bytecode interpreter is used that doesn't implement */ + /* any of the patented opcodes and algorithms. The patents related to */ + /* TrueType hinting have expired worldwide since May 2010; this option */ + /* is now deprecated. */ + /* */ + /* Note that the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* */ + /* if you define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; in other words, */ + /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or */ + /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time. */ + /* */ + /* This macro is only useful for a small number of font files (mostly */ + /* for Asian scripts) that require bytecode interpretation to properly */ + /* load glyphs. For all other fonts, this produces unpleasant results, */ + /* thus the unpatented interpreter is never used to load glyphs from */ + /* TrueType fonts unless one of the following two options is used. */ + /* */ + /* - The unpatented interpreter is explicitly activated by the user */ + /* through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag */ + /* when opening the FT_Face. */ + /* */ + /* - FreeType detects that the FT_Face corresponds to one of the */ + /* `trick' fonts (e.g., `Mingliu') it knows about. The font engine */ + /* contains a hard-coded list of font names and other matching */ + /* parameters (see function `tt_face_init' in file */ + /* `src/truetype/ttobjs.c'). */ + /* */ + /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */ + /* */ + /* { */ + /* FT_Parameter parameter; */ + /* FT_Open_Args open_args; */ + /* */ + /* */ + /* parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING; */ + /* */ + /* open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; */ + /* open_args.pathname = my_font_pathname; */ + /* open_args.num_params = 1; */ + /* open_args.params = ¶meter; */ + /* */ + /* error = FT_Open_Face( library, &open_args, index, &face ); */ + /* ... */ + /* } */ + /* */ +/* #define TT_CONFIG_OPTION_UNPATENTED_HINTING */ + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType */ + /* bytecode interpreter with a huge switch statement, rather than a call */ + /* table. This results in smaller and faster code for a number of */ + /* architectures. */ + /* */ + /* Note however that on some compiler/processor combinations, undefining */ + /* this macro will generate faster, though larger, code. */ + /* */ +#define TT_CONFIG_OPTION_INTERPRETER_SWITCH + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the */ + /* TrueType glyph loader to use Apple's definition of how to handle */ + /* component offsets in composite glyphs. */ + /* */ + /* Apple and MS disagree on the default behavior of component offsets */ + /* in composites. Apple says that they should be scaled by the scaling */ + /* factors in the transformation matrix (roughly, it's more complex) */ + /* while MS says they should not. OpenType defines two bits in the */ + /* composite flags array which can be used to disambiguate, but old */ + /* fonts will not have them. */ + /* */ + /* http://www.microsoft.com/typography/otspec/glyf.htm */ + /* http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html */ + /* */ +#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include */ + /* support for Apple's distortable font technology (fvar, gvar, cvar, */ + /* and avar tables). This has many similarities to Type 1 Multiple */ + /* Masters support. */ + /* */ +#define TT_CONFIG_OPTION_GX_VAR_SUPPORT + + + /*************************************************************************/ + /* */ + /* Define TT_CONFIG_OPTION_BDF if you want to include support for */ + /* an embedded `BDF ' table within SFNT-based bitmap formats. */ + /* */ +#define TT_CONFIG_OPTION_BDF + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** T Y P E 1 D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* T1_MAX_DICT_DEPTH is the maximum depth of nest dictionaries and */ + /* arrays in the Type 1 stream (see t1load.c). A minimum of 4 is */ + /* required. */ + /* */ +#define T1_MAX_DICT_DEPTH 5 + + + /*************************************************************************/ + /* */ + /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine */ + /* calls during glyph loading. */ + /* */ +#define T1_MAX_SUBRS_CALLS 16 + + + /*************************************************************************/ + /* */ + /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity. A */ + /* minimum of 16 is required. */ + /* */ + /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */ + /* */ +#define T1_MAX_CHARSTRINGS_OPERANDS 256 + + + /*************************************************************************/ + /* */ + /* Define this configuration macro if you want to prevent the */ + /* compilation of `t1afm', which is in charge of reading Type 1 AFM */ + /* files into an existing face. Note that if set, the T1 driver will be */ + /* unable to produce kerning distances. */ + /* */ +#undef T1_CONFIG_OPTION_NO_AFM + + + /*************************************************************************/ + /* */ + /* Define this configuration macro if you want to prevent the */ + /* compilation of the Multiple Masters font support in the Type 1 */ + /* driver. */ + /* */ +#undef T1_CONFIG_OPTION_NO_MM_SUPPORT + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** C F F D R I V E R C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* CFF_CONFIG_OPTION_OLD_ENGINE controls whether the pre-Adobe CFF */ + /* engine gets compiled into FreeType. If defined, it is possible to */ + /* switch between the two engines using the `hinting-engine' property of */ + /* the cff driver module. */ + /* */ +#define CFF_CONFIG_OPTION_OLD_ENGINE + + + /*************************************************************************/ + /*************************************************************************/ + /**** ****/ + /**** A U T O F I T M O D U L E C O N F I G U R A T I O N ****/ + /**** ****/ + /*************************************************************************/ + /*************************************************************************/ + + + /*************************************************************************/ + /* */ + /* Compile autofit module with CJK (Chinese, Japanese, Korean) script */ + /* support. */ + /* */ +#define AF_CONFIG_OPTION_CJK + + /*************************************************************************/ + /* */ + /* Compile autofit module with Indic script support. */ + /* */ +#define AF_CONFIG_OPTION_INDIC + + /*************************************************************************/ + /* */ + /* Compile autofit module with warp hinting. The idea of the warping */ + /* code is to slightly scale and shift a glyph within a single dimension */ + /* so that as much of its segments are aligned (more or less) on the */ + /* grid. To find out the optimal scaling and shifting value, various */ + /* parameter combinations are tried and scored. */ + /* */ + /* This experimental option is only active if the render mode is */ + /* FT_RENDER_MODE_LIGHT. */ + /* */ +#define AF_CONFIG_OPTION_USE_WARPER + + /* */ + + + /* + * This macro is obsolete. Support has been removed in FreeType + * version 2.5. + */ +/* #define FT_CONFIG_OPTION_OLD_INTERNALS */ + + + /* + * This macro is defined if either unpatented or native TrueType + * hinting is requested by the definitions above. + */ +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER +#define TT_USE_BYTECODE_INTERPRETER +#undef TT_CONFIG_OPTION_UNPATENTED_HINTING +#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING +#define TT_USE_BYTECODE_INTERPRETER +#endif + +FT_END_HEADER + + +#endif /* __FTOPTION_H__ */ + + +/* END */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/config/ftconfig.h b/reactos/lib/3rdparty/freetype/include/config/ftconfig.h similarity index 89% rename from reactos/lib/3rdparty/freetype/include/freetype/config/ftconfig.h rename to reactos/lib/3rdparty/freetype/include/config/ftconfig.h index 5dce30ef3ed..0770e787883 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/config/ftconfig.h +++ b/reactos/lib/3rdparty/freetype/include/config/ftconfig.h @@ -27,11 +27,11 @@ /* Note however that if some specific modifications are needed, we */ /* advise you to place a modified copy in your build directory. */ /* */ - /* The build directory is usually `freetype/builds/', and */ - /* contains system-specific files that are always included first when */ - /* building the library. */ + /* The build directory is usually `builds/', and contains */ + /* system-specific files that are always included first when building */ + /* the library. */ /* */ - /* This ANSI version should stay in `include/freetype/config'. */ + /* This ANSI version should stay in `include/config/'. */ /* */ /*************************************************************************/ @@ -53,7 +53,7 @@ FT_BEGIN_HEADER /* These macros can be toggled to suit a specific system. The current */ /* ones are defaults used to compile FreeType in an ANSI C environment */ /* (16bit compilers are also supported). Copy this file to your own */ - /* `freetype/builds/' directory, and edit it to port the engine. */ + /* `builds/' directory, and edit it to port the engine. */ /* */ /*************************************************************************/ @@ -338,6 +338,7 @@ FT_BEGIN_HEADER /* These must be defined `static __inline__' with GCC. */ #if defined( __CC_ARM ) || defined( __ARMCC__ ) /* RVCT */ + #define FT_MULFIX_ASSEMBLER FT_MulFix_arm /* documentation is in freetype.h */ @@ -367,8 +368,10 @@ FT_BEGIN_HEADER #ifdef __GNUC__ -#if defined( __arm__ ) && !defined( __thumb__ ) && \ +#if defined( __arm__ ) && \ + ( !defined( __thumb__ ) || defined( __thumb2__ ) ) && \ !( defined( __CC_ARM ) || defined( __ARMCC__ ) ) + #define FT_MULFIX_ASSEMBLER FT_MulFix_arm /* documentation is in freetype.h */ @@ -383,7 +386,11 @@ FT_BEGIN_HEADER __asm__ __volatile__ ( "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ +#ifdef __clang__ + "add.w %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ +#else "add %0, %0, #0x8000\n\t" /* %0 += 0x8000 */ +#endif "adds %1, %1, %0\n\t" /* %1 += %0 */ "adc %2, %2, #0\n\t" /* %2 += carry */ "mov %0, %1, lsr #16\n\t" /* %0 = %1 >> 16 */ @@ -394,9 +401,13 @@ FT_BEGIN_HEADER return a; } -#endif /* __arm__ && !__thumb__ && !( __CC_ARM || __ARMCC__ ) */ +#endif /* __arm__ && */ + /* ( __thumb2__ || !__thumb__ ) && */ + /* !( __CC_ARM || __ARMCC__ ) */ + #if defined( __i386__ ) + #define FT_MULFIX_ASSEMBLER FT_MulFix_i386 /* documentation is in freetype.h */ @@ -465,6 +476,66 @@ FT_BEGIN_HEADER #endif /* _MSC_VER */ + +#if defined( __GNUC__ ) && defined( __x86_64__ ) + +#define FT_MULFIX_ASSEMBLER FT_MulFix_x86_64 + + static __inline__ FT_Int32 + FT_MulFix_x86_64( FT_Int32 a, + FT_Int32 b ) + { + /* Temporarily disable the warning that C90 doesn't support */ + /* `long long'. */ +#if ( __GNUC__ > 4 ) || ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 6 ) ) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wlong-long" +#endif + +#if 1 + /* Technically not an assembly fragment, but GCC does a really good */ + /* job at inlining it and generating good machine code for it. */ + long long ret, tmp; + + + ret = (long long)a * b; + tmp = ret >> 63; + ret += 0x8000 + tmp; + + return (FT_Int32)( ret >> 16 ); +#else + + /* For some reason, GCC 4.6 on Ubuntu 12.04 generates invalid machine */ + /* code from the lines below. The main issue is that `wide_a' is not */ + /* properly initialized by sign-extending `a'. Instead, the generated */ + /* machine code assumes that the register that contains `a' on input */ + /* can be used directly as a 64-bit value, which is wrong most of the */ + /* time. */ + long long wide_a = (long long)a; + long long wide_b = (long long)b; + long long result; + + + __asm__ __volatile__ ( + "imul %2, %1\n" + "mov %1, %0\n" + "sar $63, %0\n" + "lea 0x8000(%1, %0), %0\n" + "sar $16, %0\n" + : "=&r"(result), "=&r"(wide_a) + : "r"(wide_b) + : "cc" ); + + return (FT_Int32)result; +#endif + +#if ( __GNUC__ > 4 ) || ( ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ >= 6 ) ) +#pragma GCC diagnostic pop +#endif + } + +#endif /* __GNUC__ && __x86_64__ */ + #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ @@ -492,6 +563,9 @@ FT_BEGIN_HEADER #endif /* FT_MAKE_OPTION_SINGLE_OBJECT */ +#define FT_LOCAL_ARRAY( x ) extern const x +#define FT_LOCAL_ARRAY_DEF( x ) const x + #ifndef FT_BASE diff --git a/reactos/lib/3rdparty/freetype/include/freetype/config/ftheader.h b/reactos/lib/3rdparty/freetype/include/config/ftheader.h similarity index 89% rename from reactos/lib/3rdparty/freetype/include/freetype/config/ftheader.h rename to reactos/lib/3rdparty/freetype/include/config/ftheader.h index 8371a31611b..b6236299210 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/config/ftheader.h +++ b/reactos/lib/3rdparty/freetype/include/config/ftheader.h @@ -107,7 +107,7 @@ * */ #ifndef FT_CONFIG_CONFIG_H -#define FT_CONFIG_CONFIG_H +#define FT_CONFIG_CONFIG_H #endif @@ -122,7 +122,7 @@ * */ #ifndef FT_CONFIG_STANDARD_LIBRARY_H -#define FT_CONFIG_STANDARD_LIBRARY_H +#define FT_CONFIG_STANDARD_LIBRARY_H #endif @@ -137,7 +137,7 @@ * */ #ifndef FT_CONFIG_OPTIONS_H -#define FT_CONFIG_OPTIONS_H +#define FT_CONFIG_OPTIONS_H #endif @@ -153,7 +153,7 @@ * */ #ifndef FT_CONFIG_MODULES_H -#define FT_CONFIG_MODULES_H +#define FT_CONFIG_MODULES_H #endif /* */ @@ -170,7 +170,7 @@ * base FreeType~2 API. * */ -#define FT_FREETYPE_H +#define FT_FREETYPE_H /************************************************************************* @@ -185,7 +185,7 @@ * It is included by @FT_FREETYPE_H. * */ -#define FT_ERRORS_H +#define FT_ERRORS_H /************************************************************************* @@ -198,7 +198,7 @@ * list of FreeType~2 module error offsets (and messages). * */ -#define FT_MODULE_ERRORS_H +#define FT_MODULE_ERRORS_H /************************************************************************* @@ -214,7 +214,7 @@ * It is included by @FT_FREETYPE_H. * */ -#define FT_SYSTEM_H +#define FT_SYSTEM_H /************************************************************************* @@ -230,7 +230,7 @@ * It is included by @FT_FREETYPE_H. * */ -#define FT_IMAGE_H +#define FT_IMAGE_H /************************************************************************* @@ -245,7 +245,7 @@ * It is included by @FT_FREETYPE_H. * */ -#define FT_TYPES_H +#define FT_TYPES_H /************************************************************************* @@ -260,7 +260,7 @@ * (Most applications will never need to include this file.) * */ -#define FT_LIST_H +#define FT_LIST_H /************************************************************************* @@ -273,7 +273,7 @@ * scalable outline management API of FreeType~2. * */ -#define FT_OUTLINE_H +#define FT_OUTLINE_H /************************************************************************* @@ -286,7 +286,7 @@ * API which manages multiple @FT_Size objects per face. * */ -#define FT_SIZES_H +#define FT_SIZES_H /************************************************************************* @@ -299,7 +299,7 @@ * module management API of FreeType~2. * */ -#define FT_MODULE_H +#define FT_MODULE_H /************************************************************************* @@ -312,7 +312,7 @@ * renderer module management API of FreeType~2. * */ -#define FT_RENDER_H +#define FT_RENDER_H /************************************************************************* @@ -325,7 +325,7 @@ * structures and macros related to the auto-hinting module. * */ -#define FT_AUTOHINTER_H +#define FT_AUTOHINTER_H /************************************************************************* @@ -338,7 +338,7 @@ * structures and macros related to the CFF driver module. * */ -#define FT_CFF_DRIVER_H +#define FT_CFF_DRIVER_H /************************************************************************* @@ -351,7 +351,7 @@ * structures and macros related to the TrueType driver module. * */ -#define FT_TRUETYPE_DRIVER_H +#define FT_TRUETYPE_DRIVER_H /************************************************************************* @@ -364,7 +364,7 @@ * types and API specific to the Type~1 format. * */ -#define FT_TYPE1_TABLES_H +#define FT_TYPE1_TABLES_H /************************************************************************* @@ -379,7 +379,7 @@ * definitions, taken from the TrueType and OpenType specifications. * */ -#define FT_TRUETYPE_IDS_H +#define FT_TRUETYPE_IDS_H /************************************************************************* @@ -392,7 +392,7 @@ * types and API specific to the TrueType (as well as OpenType) format. * */ -#define FT_TRUETYPE_TABLES_H +#define FT_TRUETYPE_TABLES_H /************************************************************************* @@ -406,7 +406,7 @@ * SFNT-based font formats (i.e., TrueType and OpenType). * */ -#define FT_TRUETYPE_TAGS_H +#define FT_TRUETYPE_TAGS_H /************************************************************************* @@ -420,7 +420,7 @@ * face. * */ -#define FT_BDF_H +#define FT_BDF_H /************************************************************************* @@ -434,7 +434,7 @@ * face. * */ -#define FT_CID_H +#define FT_CID_H /************************************************************************* @@ -447,7 +447,7 @@ * definitions of an API which supports gzip-compressed files. * */ -#define FT_GZIP_H +#define FT_GZIP_H /************************************************************************* @@ -460,7 +460,7 @@ * definitions of an API which supports LZW-compressed files. * */ -#define FT_LZW_H +#define FT_LZW_H /************************************************************************* @@ -473,7 +473,7 @@ * definitions of an API which supports bzip2-compressed files. * */ -#define FT_BZIP2_H +#define FT_BZIP2_H /************************************************************************* @@ -486,7 +486,7 @@ * definitions of an API which supports Windows FNT files. * */ -#define FT_WINFONTS_H +#define FT_WINFONTS_H /************************************************************************* @@ -499,7 +499,7 @@ * API of the optional glyph management component. * */ -#define FT_GLYPH_H +#define FT_GLYPH_H /************************************************************************* @@ -512,7 +512,7 @@ * API of the optional bitmap conversion component. * */ -#define FT_BITMAP_H +#define FT_BITMAP_H /************************************************************************* @@ -525,7 +525,7 @@ * API of the optional exact bounding box computation routines. * */ -#define FT_BBOX_H +#define FT_BBOX_H /************************************************************************* @@ -538,7 +538,7 @@ * API of the optional FreeType~2 cache sub-system. * */ -#define FT_CACHE_H +#define FT_CACHE_H /************************************************************************* @@ -612,7 +612,7 @@ * compiled on the Mac (note that the base API still works though). * */ -#define FT_MAC_H +#define FT_MAC_H /************************************************************************* @@ -625,7 +625,7 @@ * optional multiple-masters management API of FreeType~2. * */ -#define FT_MULTIPLE_MASTERS_H +#define FT_MULTIPLE_MASTERS_H /************************************************************************* @@ -639,7 +639,7 @@ * SFNT-based font formats (i.e., TrueType and OpenType). * */ -#define FT_SFNT_NAMES_H +#define FT_SFNT_NAMES_H /************************************************************************* @@ -653,7 +653,7 @@ * GPOS, GSUB, JSTF). * */ -#define FT_OPENTYPE_VALIDATE_H +#define FT_OPENTYPE_VALIDATE_H /************************************************************************* @@ -667,7 +667,7 @@ * mort, morx, bsln, just, kern, opbd, trak, prop). * */ -#define FT_GX_VALIDATE_H +#define FT_GX_VALIDATE_H /************************************************************************* @@ -680,7 +680,7 @@ * FreeType~2 API which accesses PFR-specific data. * */ -#define FT_PFR_H +#define FT_PFR_H /************************************************************************* @@ -692,7 +692,7 @@ * A macro used in #include statements to name the file containing the * FreeType~2 API which provides functions to stroke outline paths. */ -#define FT_STROKER_H +#define FT_STROKER_H /************************************************************************* @@ -704,7 +704,7 @@ * A macro used in #include statements to name the file containing the * FreeType~2 API which performs artificial obliquing and emboldening. */ -#define FT_SYNTHESIS_H +#define FT_SYNTHESIS_H /************************************************************************* @@ -717,7 +717,7 @@ * FreeType~2 API which provides functions specific to the XFree86 and * X.Org X11 servers. */ -#define FT_XFREE86_H +#define FT_XFREE86_H /************************************************************************* @@ -730,7 +730,7 @@ * FreeType~2 API which performs trigonometric computations (e.g., * cosines and arc tangents). */ -#define FT_TRIGONOMETRY_H +#define FT_TRIGONOMETRY_H /************************************************************************* @@ -742,7 +742,7 @@ * A macro used in #include statements to name the file containing the * FreeType~2 API which performs color filtering for subpixel rendering. */ -#define FT_LCD_FILTER_H +#define FT_LCD_FILTER_H /************************************************************************* @@ -754,7 +754,7 @@ * A macro used in #include statements to name the file containing the * FreeType~2 API which performs color filtering for subpixel rendering. */ -#define FT_UNPATENTED_HINTING_H +#define FT_UNPATENTED_HINTING_H /************************************************************************* @@ -766,7 +766,7 @@ * A macro used in #include statements to name the file containing the * FreeType~2 API which performs color filtering for subpixel rendering. */ -#define FT_INCREMENTAL_H +#define FT_INCREMENTAL_H /************************************************************************* @@ -778,7 +778,7 @@ * A macro used in #include statements to name the file containing the * FreeType~2 API which returns entries from the TrueType GASP table. */ -#define FT_GASP_H +#define FT_GASP_H /************************************************************************* @@ -790,38 +790,38 @@ * A macro used in #include statements to name the file containing the * FreeType~2 API which returns individual and ranged glyph advances. */ -#define FT_ADVANCES_H +#define FT_ADVANCES_H /* */ -#define FT_ERROR_DEFINITIONS_H +#define FT_ERROR_DEFINITIONS_H /* The internals of the cache sub-system are no longer exposed. We */ /* default to FT_CACHE_H at the moment just in case, but we know of */ /* no rogue client that uses them. */ /* */ -#define FT_CACHE_MANAGER_H -#define FT_CACHE_INTERNAL_MRU_H -#define FT_CACHE_INTERNAL_MANAGER_H -#define FT_CACHE_INTERNAL_CACHE_H -#define FT_CACHE_INTERNAL_GLYPH_H -#define FT_CACHE_INTERNAL_IMAGE_H -#define FT_CACHE_INTERNAL_SBITS_H +#define FT_CACHE_MANAGER_H +#define FT_CACHE_INTERNAL_MRU_H +#define FT_CACHE_INTERNAL_MANAGER_H +#define FT_CACHE_INTERNAL_CACHE_H +#define FT_CACHE_INTERNAL_GLYPH_H +#define FT_CACHE_INTERNAL_IMAGE_H +#define FT_CACHE_INTERNAL_SBITS_H -#define FT_INCREMENTAL_H +#define FT_INCREMENTAL_H -#define FT_TRUETYPE_UNPATENTED_H +#define FT_TRUETYPE_UNPATENTED_H /* - * Include internal headers definitions from + * Include internal headers definitions from * only when building the library. */ #ifdef FT2_BUILD_LIBRARY -#define FT_INTERNAL_INTERNAL_H +#define FT_INTERNAL_INTERNAL_H #include FT_INTERNAL_INTERNAL_H #endif /* FT2_BUILD_LIBRARY */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/config/ftmodule.h b/reactos/lib/3rdparty/freetype/include/config/ftmodule.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/config/ftmodule.h rename to reactos/lib/3rdparty/freetype/include/config/ftmodule.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/config/ftoption.h b/reactos/lib/3rdparty/freetype/include/config/ftoption.h similarity index 99% rename from reactos/lib/3rdparty/freetype/include/freetype/config/ftoption.h rename to reactos/lib/3rdparty/freetype/include/config/ftoption.h index 90057c3a7f0..fe2ba15b48c 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/config/ftoption.h +++ b/reactos/lib/3rdparty/freetype/include/config/ftoption.h @@ -38,9 +38,9 @@ FT_BEGIN_HEADER /* library from a single source directory. */ /* */ /* - You can put a copy of this file in your build directory, more */ - /* precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD' */ - /* is the name of a directory that is included _before_ the FreeType */ - /* include path during compilation. */ + /* precisely in `$BUILD/config/ftoption.h', where `$BUILD' is the */ + /* name of a directory that is included _before_ the FreeType include */ + /* path during compilation. */ /* */ /* The default FreeType Makefiles and Jamfiles use the build */ /* directory `builds/' by default, but you can easily change */ @@ -51,7 +51,7 @@ FT_BEGIN_HEADER /* locate this file during the build. For example, */ /* */ /* #define FT_CONFIG_OPTIONS_H */ - /* #include */ + /* #include */ /* */ /* will use `$BUILD/myftoptions.h' instead of this file for macro */ /* definitions. */ @@ -59,7 +59,7 @@ FT_BEGIN_HEADER /* Note also that you can similarly pre-define the macro */ /* FT_CONFIG_MODULES_H used to locate the file listing of the modules */ /* that are statically linked to the library at compile time. By */ - /* default, this file is . */ + /* default, this file is . */ /* */ /* We highly recommend using the third method whenever possible. */ /* */ @@ -323,7 +323,7 @@ FT_BEGIN_HEADER /* */ /* Note that the `FOND' resource isn't checked. */ /* */ -/*#define FT_CONFIG_OPTION_MAC_FONTS */ +#define FT_CONFIG_OPTION_MAC_FONTS /*************************************************************************/ @@ -528,7 +528,7 @@ FT_BEGIN_HEADER /* does not contain any glyph name though. */ /* */ /* Accessing SFNT names is done through the functions declared in */ - /* `freetype/ftsnames.h'. */ + /* `ftsnames.h'. */ /* */ #define TT_CONFIG_OPTION_SFNT_NAMES diff --git a/reactos/lib/3rdparty/freetype/include/freetype/config/ftstdlib.h b/reactos/lib/3rdparty/freetype/include/config/ftstdlib.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/config/ftstdlib.h rename to reactos/lib/3rdparty/freetype/include/config/ftstdlib.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/freetype.h b/reactos/lib/3rdparty/freetype/include/freetype.h similarity index 98% rename from reactos/lib/3rdparty/freetype/include/freetype/freetype.h rename to reactos/lib/3rdparty/freetype/include/freetype.h index fe46d229787..39a18af89e9 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/freetype.h +++ b/reactos/lib/3rdparty/freetype/include/freetype.h @@ -98,7 +98,10 @@ FT_BEGIN_HEADER /* FT_FACE_FLAG_FIXED_WIDTH */ /* FT_FACE_FLAG_HORIZONTAL */ /* FT_FACE_FLAG_VERTICAL */ + /* FT_FACE_FLAG_COLOR */ /* FT_FACE_FLAG_SFNT */ + /* FT_FACE_FLAG_CID_KEYED */ + /* FT_FACE_FLAG_TRICKY */ /* FT_FACE_FLAG_KERNING */ /* FT_FACE_FLAG_MULTIPLE_MASTERS */ /* FT_FACE_FLAG_GLYPH_NAMES */ @@ -417,7 +420,8 @@ FT_BEGIN_HEADER /* */ /* Each @FT_Face has an _active_ @FT_Size object that is used by */ /* functions like @FT_Load_Glyph to determine the scaling */ - /* transformation which is used to load and hint glyphs and metrics. */ + /* transformation that in turn is used to load and hint glyphs and */ + /* metrics. */ /* */ /* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, */ /* @FT_Request_Size or even @FT_Select_Size to change the content */ @@ -552,11 +556,12 @@ FT_BEGIN_HEADER /* FT_ENCODING_MS_SYMBOL :: */ /* Corresponds to the Microsoft Symbol encoding, used to encode */ /* mathematical symbols in the 32..255 character code range. For */ - /* more information, see `http://www.ceviz.net/symbol.htm'. */ + /* more information, see */ + /* `http://www.kostis.net/charsets/symbol.htm'. */ /* */ /* FT_ENCODING_SJIS :: */ /* Corresponds to Japanese SJIS encoding. More info at */ - /* at `http://langsupport.japanreference.com/encoding.shtml'. */ + /* at `http://en.wikipedia.org/wiki/Shift_JIS'. */ /* See note on multi-byte encodings below. */ /* */ /* FT_ENCODING_GB2312 :: */ @@ -570,7 +575,7 @@ FT_BEGIN_HEADER /* FT_ENCODING_WANSUNG :: */ /* Corresponds to the Korean encoding system known as Wansung. */ /* For more information see */ - /* `http://www.microsoft.com/typography/unicode/949.txt'. */ + /* `http://msdn.microsoft.com/en-US/goglobal/cc305154'. */ /* */ /* FT_ENCODING_JOHAB :: */ /* The Korean standard character set (KS~C 5601-1992), which */ @@ -645,10 +650,10 @@ FT_BEGIN_HEADER /* FT_ENCODING_APPLE_ROMAN). */ /* */ /* If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function */ - /* @FT_Get_CMap_Language_ID to query the Mac language ID which may */ + /* @FT_Get_CMap_Language_ID to query the Mac language ID that may */ /* be needed to be able to distinguish Apple encoding variants. See */ /* */ - /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT */ + /* http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt */ /* */ /* to get an idea how to do that. Basically, if the language ID */ /* is~0, don't use it, otherwise subtract 1 from the language ID. */ @@ -808,7 +813,7 @@ FT_BEGIN_HEADER /* highest CID used in the font. */ /* */ /* family_name :: The face's family name. This is an ASCII */ - /* string, usually in English, which describes */ + /* string, usually in English, that describes */ /* the typeface's family (like `Times New */ /* Roman', `Bodoni', `Garamond', etc). This */ /* is a least common denominator used to list */ @@ -820,7 +825,7 @@ FT_BEGIN_HEADER /* PDF file). */ /* */ /* style_name :: The face's style name. This is an ASCII */ - /* string, usually in English, which describes */ + /* string, usually in English, that describes */ /* the typeface's style (like `Italic', */ /* `Bold', `Condensed', etc). Not all font */ /* formats provide a style name, so this field */ @@ -1054,7 +1059,7 @@ FT_BEGIN_HEADER /* exist make FT_Load_Glyph return successfully; in all other cases */ /* you get an `FT_Err_Invalid_Argument' error. */ /* */ - /* Note that CID-keyed fonts which are in an SFNT wrapper don't */ + /* Note that CID-keyed fonts that are in an SFNT wrapper don't */ /* have this flag set since the glyphs are accessed in the normal */ /* way (using contiguous indices); the `CID-ness' isn't visible to */ /* the application. */ @@ -1062,7 +1067,7 @@ FT_BEGIN_HEADER /* FT_FACE_FLAG_TRICKY :: */ /* Set if the font is `tricky', this is, it always needs the */ /* font format's native hinting engine to get a reasonable result. */ - /* A typical example is the Chinese font `mingli.ttf' which uses */ + /* A typical example is the Chinese font `mingli.ttf' that uses */ /* TrueType bytecode instructions to move and scale all of its */ /* subglyphs. */ /* */ @@ -1075,6 +1080,10 @@ FT_BEGIN_HEADER /* Currently, there are about a dozen TrueType fonts in the list of */ /* tricky fonts; they are hard-coded in file `ttobjs.c'. */ /* */ + /* FT_FACE_FLAG_COLOR :: */ + /* Set if the font has color glyph tables. To access color glyphs */ + /* use @FT_LOAD_COLOR. */ + /* */ #define FT_FACE_FLAG_SCALABLE ( 1L << 0 ) #define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 ) #define FT_FACE_FLAG_FIXED_WIDTH ( 1L << 2 ) @@ -1089,6 +1098,7 @@ FT_BEGIN_HEADER #define FT_FACE_FLAG_HINTER ( 1L << 11 ) #define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) #define FT_FACE_FLAG_TRICKY ( 1L << 13 ) +#define FT_FACE_FLAG_COLOR ( 1L << 14 ) /************************************************************************* @@ -1273,6 +1283,20 @@ FT_BEGIN_HEADER ( face->face_flags & FT_FACE_FLAG_TRICKY ) + /************************************************************************* + * + * @macro: + * FT_HAS_COLOR( face ) + * + * @description: + * A macro that returns true whenever a face object contains + * tables for color glyphs. + * + */ +#define FT_HAS_COLOR( face ) \ + ( face->face_flags & FT_FACE_FLAG_COLOR ) + + /*************************************************************************/ /* */ /* */ @@ -1394,9 +1418,9 @@ FT_BEGIN_HEADER /* */ /* face :: Handle to the parent face object. */ /* */ - /* generic :: A typeless pointer, which is unused by the FreeType */ - /* library or any of its drivers. It can be used by */ - /* client applications to link their own data to each size */ + /* generic :: A typeless pointer, unused by the FreeType library or */ + /* any of its drivers. It can be used by client */ + /* applications to link their own data to each size */ /* object. */ /* */ /* metrics :: Metrics for this size object. This field is read-only. */ @@ -1464,10 +1488,10 @@ FT_BEGIN_HEADER /* listed through a direct, single-linked list */ /* using its `next' field. */ /* */ - /* generic :: A typeless pointer which is unused by the */ - /* FreeType library or any of its drivers. It */ - /* can be used by client applications to link */ - /* their own data to each glyph slot object. */ + /* generic :: A typeless pointer unused by the FreeType */ + /* library or any of its drivers. It can be */ + /* used by client applications to link their own */ + /* data to each glyph slot object. */ /* */ /* metrics :: The metrics of the last loaded glyph in the */ /* slot. The returned values depend on the last */ @@ -1494,8 +1518,8 @@ FT_BEGIN_HEADER /* */ /* advance :: This shorthand is, depending on */ /* @FT_LOAD_IGNORE_TRANSFORM, the transformed */ - /* advance width for the glyph (in 26.6 */ - /* fractional pixel format). As specified with */ + /* (hinted) advance width for the glyph, in 26.6 */ + /* fractional pixel format. As specified with */ /* @FT_LOAD_VERTICAL_LAYOUT, it uses either the */ /* `horiAdvance' or the `vertAdvance' value of */ /* `metrics' field. */ @@ -1584,7 +1608,7 @@ FT_BEGIN_HEADER /* `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP. */ /* */ /* */ - /* Here a small pseudo code fragment which shows how to use */ + /* Here a small pseudo code fragment that shows how to use */ /* `lsb_delta' and `rsb_delta': */ /* */ /* { */ @@ -1813,7 +1837,7 @@ FT_BEGIN_HEADER /* opening a new face. */ /* */ /* */ - /* The stream type is determined by the contents of `flags' which */ + /* The stream type is determined by the contents of `flags' that */ /* are tested in the following order by @FT_Open_Face: */ /* */ /* If the `FT_OPEN_MEMORY' bit is set, assume that this is a */ @@ -1894,7 +1918,7 @@ FT_BEGIN_HEADER /* FT_New_Memory_Face */ /* */ /* */ - /* This function calls @FT_Open_Face to open a font which has been */ + /* This function calls @FT_Open_Face to open a font that has been */ /* loaded into memory. */ /* */ /* */ @@ -1940,7 +1964,7 @@ FT_BEGIN_HEADER /* library :: A handle to the library resource. */ /* */ /* */ - /* args :: A pointer to an `FT_Open_Args' structure which must */ + /* args :: A pointer to an `FT_Open_Args' structure that must */ /* be filled by the caller. */ /* */ /* face_index :: The index of the face within the font. The first */ @@ -1956,7 +1980,7 @@ FT_BEGIN_HEADER /* */ /* */ /* Unlike FreeType 1.x, this function automatically creates a glyph */ - /* slot for the face object which can be accessed directly through */ + /* slot for the face object that can be accessed directly through */ /* `face->glyph'. */ /* */ /* FT_Open_Face can be used to quickly check whether the font */ @@ -1965,7 +1989,7 @@ FT_BEGIN_HEADER /* if the font format is recognized, or non-zero otherwise; */ /* the function returns a more or less empty face handle in `*aface' */ /* (if `aface' isn't NULL). The only useful field in this special */ - /* case is `face->num_faces' which gives the number of faces within */ + /* case is `face->num_faces' that gives the number of faces within */ /* the font file. After examination, the returned @FT_Face structure */ /* should be deallocated with a call to @FT_Done_Face. */ /* */ @@ -2023,7 +2047,7 @@ FT_BEGIN_HEADER /* face :: The target face object. */ /* */ /* */ - /* parameters :: A pointer to @FT_Open_Args which must be filled by */ + /* parameters :: A pointer to @FT_Open_Args that must be filled by */ /* the caller. */ /* */ /* */ @@ -2054,7 +2078,7 @@ FT_BEGIN_HEADER /* then only destroys a face if the counter is~1, otherwise it simply */ /* decrements the counter. */ /* */ - /* This function helps in managing life-cycles of structures which */ + /* This function helps in managing life-cycles of structures that */ /* reference @FT_Face objects. */ /* */ /* */ @@ -2361,7 +2385,7 @@ FT_BEGIN_HEADER /* the details. */ /* */ /* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument' is */ - /* returned for invalid CID values (this is, for CID values which */ + /* returned for invalid CID values (this is, for CID values that */ /* don't have a corresponding glyph in the font). See the discussion */ /* of the @FT_FACE_FLAG_CID_KEYED flag for more details. */ /* */ @@ -2635,7 +2659,7 @@ FT_BEGIN_HEADER * `load_flags'. They can't be ORed. * * If @FT_LOAD_RENDER is also set, the glyph is rendered in the - * corresponding mode (i.e., the mode which matches the used algorithm + * corresponding mode (i.e., the mode that matches the used algorithm * best). An exeption is FT_LOAD_TARGET_MONO since it implies * @FT_LOAD_MONOCHROME. * @@ -3003,7 +3027,7 @@ FT_BEGIN_HEADER /* */ /* This function is not compiled within the library if the config */ /* macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in */ - /* `include/freetype/config/ftoptions.h'. */ + /* `ftoptions.h'. */ /* */ FT_EXPORT( FT_Error ) FT_Get_Glyph_Name( FT_Face face, @@ -3059,8 +3083,8 @@ FT_BEGIN_HEADER /* */ /* Because many fonts contain more than a single cmap for Unicode */ /* encoding, this function has some special code to select the one */ - /* which covers Unicode best (`best' in the sense that a UCS-4 cmap */ - /* is preferred to a UCS-2 cmap). It is thus preferable to */ + /* that covers Unicode best (`best' in the sense that a UCS-4 cmap is */ + /* preferred to a UCS-2 cmap). It is thus preferable to */ /* @FT_Set_Charmap in this case. */ /* */ FT_EXPORT( FT_Error ) @@ -3414,7 +3438,7 @@ FT_BEGIN_HEADER /* */ /* */ /* Use this function rather than directly reading the `fs_type' field */ - /* in the @PS_FontInfoRec structure which is only guaranteed to */ + /* in the @PS_FontInfoRec structure, which is only guaranteed to */ /* return the correct results for Type~1 fonts. */ /* */ /* */ @@ -3594,7 +3618,7 @@ FT_BEGIN_HEADER /* The character codepoint in Unicode. */ /* */ /* */ - /* A pointer to an array of variant selector code points which are */ + /* A pointer to an array of variant selector code points that are */ /* active for the given character, or NULL if the corresponding list */ /* is empty. */ /* */ @@ -3628,7 +3652,7 @@ FT_BEGIN_HEADER /* The variant selector code point in Unicode. */ /* */ /* */ - /* A list of all the code points which are specified by this selector */ + /* A list of all the code points that are specified by this selector */ /* (both default and non-default codes are returned) or NULL if there */ /* is no valid cmap or the variant selector is invalid. */ /* */ @@ -3901,7 +3925,7 @@ FT_BEGIN_HEADER */ #define FREETYPE_MAJOR 2 #define FREETYPE_MINOR 5 -#define FREETYPE_PATCH 0 +#define FREETYPE_PATCH 2 /*************************************************************************/ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h b/reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h deleted file mode 100644 index ccbcbccaa86..00000000000 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftcffdrv.h +++ /dev/null @@ -1,151 +0,0 @@ -/***************************************************************************/ -/* */ -/* ftcffdrv.h */ -/* */ -/* FreeType API for controlling the CFF driver (specification only). */ -/* */ -/* Copyright 2013 by */ -/* David Turner, Robert Wilhelm, and Werner Lemberg. */ -/* */ -/* This file is part of the FreeType project, and may only be used, */ -/* modified, and distributed under the terms of the FreeType project */ -/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ -/* this file you indicate that you have read the license and */ -/* understand and accept it fully. */ -/* */ -/***************************************************************************/ - - -#ifndef __FTCFFDRV_H__ -#define __FTCFFDRV_H__ - -#include -#include FT_FREETYPE_H - -#ifdef FREETYPE_H -#error "freetype.h of FreeType 1 has been loaded!" -#error "Please fix the directory search order for header files" -#error "so that freetype.h of FreeType 2 is found first." -#endif - - -FT_BEGIN_HEADER - - - /************************************************************************** - * - * @section: - * cff_driver - * - * @title: - * The CFF driver - * - * @abstract: - * Controlling the CFF driver module. - * - * @description: - * While FreeType's CFF driver doesn't expose API functions by itself, - * it is possible to control its behaviour with @FT_Property_Set and - * @FT_Property_Get. The following lists the available properties - * together with the necessary macros and structures. - * - * The CFF driver's module name is `cff'. - * - */ - - - /************************************************************************** - * - * @property: - * hinting-engine - * - * @description: - * Thanks to Adobe, which contributed a new hinting (and parsing) - * engine, an application can select between `freetype' and `adobe' if - * compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration - * macro isn't defined, `hinting-engine' does nothing. - * - * The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is - * defined, and `adobe' otherwise. - * - * The following example code demonstrates how to select Adobe's hinting - * engine (omitting the error handling). - * - * { - * FT_Library library; - * FT_Face face; - * FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE; - * - * - * FT_Init_FreeType( &library ); - * - * FT_Property_Set( library, "cff", - * "hinting-engine", &hinting_engine ); - * } - * - * @note: - * This property can be used with @FT_Property_Get also. - * - */ - - - /************************************************************************** - * - * @enum: - * FT_CFF_HINTING_XXX - * - * @description: - * A list of constants used for the @hinting-engine property to select - * the hinting engine for CFF fonts. - * - * @values: - * FT_CFF_HINTING_FREETYPE :: - * Use the old FreeType hinting engine. - * - * FT_CFF_HINTING_ADOBE :: - * Use the hinting engine contributed by Adobe. - * - */ -#define FT_CFF_HINTING_FREETYPE 0 -#define FT_CFF_HINTING_ADOBE 1 - - - /************************************************************************** - * - * @property: - * no-stem-darkening - * - * @description: - * By default, the Adobe CFF engine darkens stems at smaller sizes, - * regardless of hinting, to enhance contrast. Setting this property, - * stem darkening gets switched off. - * - * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set. - * - * { - * FT_Library library; - * FT_Face face; - * FT_Bool no_stem_darkening = TRUE; - * - * - * FT_Init_FreeType( &library ); - * - * FT_Property_Set( library, "cff", - * "no-stem-darkening", &no_stem_darkening ); - * } - * - * @note: - * This property can be used with @FT_Property_Get also. - * - */ - - - /* */ - -FT_END_HEADER - - -#endif /* __FTCFFDRV_H__ */ - - -/* END */ diff --git a/reactos/lib/3rdparty/freetype/include/ft2build.h b/reactos/lib/3rdparty/freetype/include/ft2build.h index 923d887df6f..6f8eb7f3731 100644 --- a/reactos/lib/3rdparty/freetype/include/ft2build.h +++ b/reactos/lib/3rdparty/freetype/include/ft2build.h @@ -3,9 +3,8 @@ /* ft2build.h */ /* */ /* FreeType 2 build and setup macros. */ -/* (Generic version) */ /* */ -/* Copyright 1996-2001, 2006 by */ +/* Copyright 1996-2001, 2006, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -19,21 +18,25 @@ /*************************************************************************/ /* */ - /* This file corresponds to the default `ft2build.h' file for */ - /* FreeType 2. It uses the `freetype' include root. */ + /* This is the `entry point' for FreeType header file inclusions. It is */ + /* the only header file which should be included directly; all other */ + /* FreeType header files should be accessed with macro names (after */ + /* including `ft2build.h'). */ /* */ - /* Note that specific platforms might use a different configuration. */ - /* See builds/unix/ft2unix.h for an example. */ + /* A typical example is */ + /* */ + /* #include */ + /* #include FT_FREETYPE_H */ /* */ /*************************************************************************/ -#ifndef __FT2_BUILD_GENERIC_H__ -#define __FT2_BUILD_GENERIC_H__ +#ifndef __FT2BUILD_H__ +#define __FT2BUILD_H__ -#include +#include -#endif /* __FT2_BUILD_GENERIC_H__ */ +#endif /* __FT2BUILD_H__ */ /* END */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftadvanc.h b/reactos/lib/3rdparty/freetype/include/ftadvanc.h similarity index 98% rename from reactos/lib/3rdparty/freetype/include/freetype/ftadvanc.h rename to reactos/lib/3rdparty/freetype/include/ftadvanc.h index 012b74b8122..8f7e2fce5ed 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftadvanc.h +++ b/reactos/lib/3rdparty/freetype/include/ftadvanc.h @@ -64,11 +64,11 @@ FT_BEGIN_HEADER /* corresponding hinting mode or font driver doesn't allow for very */ /* quick advance computation. */ /* */ - /* Typically, glyphs which are either unscaled, unhinted, bitmapped, */ + /* Typically, glyphs that are either unscaled, unhinted, bitmapped, */ /* or light-hinted can have their advance width computed very */ /* quickly. */ /* */ - /* Normal and bytecode hinted modes, which require loading, scaling, */ + /* Normal and bytecode hinted modes that require loading, scaling, */ /* and hinting of the glyph outline, are extremely slow by */ /* comparison. */ /* */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftautoh.h b/reactos/lib/3rdparty/freetype/include/ftautoh.h similarity index 98% rename from reactos/lib/3rdparty/freetype/include/freetype/ftautoh.h rename to reactos/lib/3rdparty/freetype/include/ftautoh.h index 5e1153a1c1d..bf97b3f2404 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftautoh.h +++ b/reactos/lib/3rdparty/freetype/include/ftautoh.h @@ -79,7 +79,7 @@ FT_BEGIN_HEADER * sense, see the @FT_AUTOHINTER_SCRIPT_XXX values) is stored as an * array with `num_glyphs' elements, as found in the font's @FT_Face * structure. The `glyph-to-script-map' property returns a pointer to - * this array which can be modified as needed. Note that the + * this array, which can be modified as needed. Note that the * modification should happen before the first glyph gets processed by * the auto-hinter so that the global analysis of the font shapes * actually uses the modified mapping. @@ -282,7 +282,7 @@ FT_BEGIN_HEADER * This property can be used with @FT_Property_Get also. * * It's important to use the right timing for changing this value: The - * creation of the glyph-to-script map which eventually uses the + * creation of the glyph-to-script map that eventually uses the * fallback script value gets triggered either by setting or reading a * face-specific property like @glyph-to-script-map, or by auto-hinting * any glyph from that face. In particular, if you have already created diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftbbox.h b/reactos/lib/3rdparty/freetype/include/ftbbox.h similarity index 97% rename from reactos/lib/3rdparty/freetype/include/freetype/ftbbox.h rename to reactos/lib/3rdparty/freetype/include/ftbbox.h index 976691956f2..8938841a622 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftbbox.h +++ b/reactos/lib/3rdparty/freetype/include/ftbbox.h @@ -4,7 +4,7 @@ /* */ /* FreeType exact bbox computation (specification). */ /* */ -/* Copyright 1996-2001, 2003, 2007, 2011 by */ +/* Copyright 1996-2001, 2003, 2007, 2011, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -60,7 +60,7 @@ FT_BEGIN_HEADER /* */ /* Compute the exact bounding box of an outline. This is slower */ /* than computing the control box. However, it uses an advanced */ - /* algorithm which returns _very_ quickly when the two boxes */ + /* algorithm that returns _very_ quickly when the two boxes */ /* coincide. Otherwise, the outline Bézier arcs are traversed to */ /* extract their extrema. */ /* */ @@ -78,7 +78,7 @@ FT_BEGIN_HEADER /* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */ /* reasonable values for the BBox it is necessary to load the glyph */ /* at a large ppem value (so that the hinting instructions can */ - /* properly shift and scale the subglyphs), then extracting the BBox */ + /* properly shift and scale the subglyphs), then extracting the BBox, */ /* which can be eventually converted back to font units. */ /* */ FT_EXPORT( FT_Error ) diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftbdf.h b/reactos/lib/3rdparty/freetype/include/ftbdf.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftbdf.h rename to reactos/lib/3rdparty/freetype/include/ftbdf.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftbitmap.h b/reactos/lib/3rdparty/freetype/include/ftbitmap.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftbitmap.h rename to reactos/lib/3rdparty/freetype/include/ftbitmap.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftbzip2.h b/reactos/lib/3rdparty/freetype/include/ftbzip2.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftbzip2.h rename to reactos/lib/3rdparty/freetype/include/ftbzip2.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftcache.h b/reactos/lib/3rdparty/freetype/include/ftcache.h similarity index 99% rename from reactos/lib/3rdparty/freetype/include/freetype/ftcache.h rename to reactos/lib/3rdparty/freetype/include/ftcache.h index 4ec9587cf6f..a5d7100a3fb 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftcache.h +++ b/reactos/lib/3rdparty/freetype/include/ftcache.h @@ -156,7 +156,7 @@ FT_BEGIN_HEADER * @note: * Never use NULL as a valid @FTC_FaceID. * - * Face IDs are passed by the client to the cache manager, which calls, + * Face IDs are passed by the client to the cache manager that calls, * when needed, the @FTC_Face_Requester to translate them into new * @FT_Face objects. * diff --git a/reactos/lib/3rdparty/freetype/include/ftcffdrv.h b/reactos/lib/3rdparty/freetype/include/ftcffdrv.h new file mode 100644 index 00000000000..e4d039d0214 --- /dev/null +++ b/reactos/lib/3rdparty/freetype/include/ftcffdrv.h @@ -0,0 +1,254 @@ +/***************************************************************************/ +/* */ +/* ftcffdrv.h */ +/* */ +/* FreeType API for controlling the CFF driver (specification only). */ +/* */ +/* Copyright 2013 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTCFFDRV_H__ +#define __FTCFFDRV_H__ + +#include +#include FT_FREETYPE_H + +#ifdef FREETYPE_H +#error "freetype.h of FreeType 1 has been loaded!" +#error "Please fix the directory search order for header files" +#error "so that freetype.h of FreeType 2 is found first." +#endif + + +FT_BEGIN_HEADER + + + /************************************************************************** + * + * @section: + * cff_driver + * + * @title: + * The CFF driver + * + * @abstract: + * Controlling the CFF driver module. + * + * @description: + * While FreeType's CFF driver doesn't expose API functions by itself, + * it is possible to control its behaviour with @FT_Property_Set and + * @FT_Property_Get. The list below gives the available properties + * together with the necessary macros and structures. + * + * The CFF driver's module name is `cff'. + * + * *Hinting* *and* *antialiasing* *principles* *of* *the* *new* *engine* + * + * The rasterizer is positioning horizontal features (e.g., ascender + * height & x-height, or crossbars) on the pixel grid and minimizing the + * amount of antialiasing applied to them, while placing vertical + * features (vertical stems) on the pixel grid without hinting, thus + * representing the stem position and weight accurately. Sometimes the + * vertical stems may be only partially black. In this context, + * `antialiasing' means that stems are not positioned exactly on pixel + * borders, causing a fuzzy appearance. + * + * There are two principles behind this approach. + * + * 1) No hinting in the horizontal direction: Unlike `superhinted' + * TrueType, which changes glyph widths to accommodate regular + * inter-glyph spacing, Adobe's approach is `faithful to the design' in + * representing both the glyph width and the inter-glyph spacing + * designed for the font. This makes the screen display as close as it + * can be to the result one would get with infinite resolution, while + * preserving what is considered the key characteristics of each glyph. + * Note that the distances between unhinted and grid-fitted positions at + * small sizes are comparable to kerning values and thus would be + * noticeable (and distracting) while reading if hinting were applied. + * + * One of the reasons to not hint horizontally is antialiasing for LCD + * screens: The pixel geometry of modern displays supplies three + * vertical sub-pixels as the eye moves horizontally across each visible + * pixel. On devices where we can be certain this characteristic is + * present a rasterizer can take advantage of the sub-pixels to add + * increments of weight. In Western writing systems this turns out to + * be the more critical direction anyway; the weights and spacing of + * vertical stems (see above) are central to Armenian, Cyrillic, Greek, + * and Latin type designs. Even when the rasterizer uses greyscale + * antialiasing instead of color (a necessary compromise when one + * doesn't know the screen characteristics), the unhinted vertical + * features preserve the design's weight and spacing much better than + * aliased type would. + * + * 2) Aligment in the vertical direction: Weights and spacing along the + * y~axis are less critical; what is much more important is the visual + * alignment of related features (like cap-height and x-height). The + * sense of alignment for these is enhanced by the sharpness of grid-fit + * edges, while the cruder vertical resolution (full pixels instead of + * 1/3 pixels) is less of a problem. + * + * On the technical side, horizontal alignment zones for ascender, + * x-height, and other important height values (traditionally called + * `blue zones') as defined in the font are positioned independently, + * each being rounded to the nearest pixel edge, taking care of + * overshoot suppression at small sizes, stem darkening, and scaling. + * + * Hstems (this is, hint values defined in the font to help align + * horizontal features) that fall within a blue zone are said to be + * `captured' and are aligned to that zone. Uncaptured stems are moved + * in one of four ways, top edge up or down, bottom edge up or down. + * Unless there are conflicting hstems, the smallest movement is taken + * to minimize distortion. + */ + + + /************************************************************************** + * + * @property: + * hinting-engine + * + * @description: + * Thanks to Adobe, which contributed a new hinting (and parsing) + * engine, an application can select between `freetype' and `adobe' if + * compiled with CFF_CONFIG_OPTION_OLD_ENGINE. If this configuration + * macro isn't defined, `hinting-engine' does nothing. + * + * The default engine is `freetype' if CFF_CONFIG_OPTION_OLD_ENGINE is + * defined, and `adobe' otherwise. + * + * The following example code demonstrates how to select Adobe's hinting + * engine (omitting the error handling). + * + * { + * FT_Library library; + * FT_UInt hinting_engine = FT_CFF_HINTING_ADOBE; + * + * + * FT_Init_FreeType( &library ); + * + * FT_Property_Set( library, "cff", + * "hinting-engine", &hinting_engine ); + * } + * + * @note: + * This property can be used with @FT_Property_Get also. + * + */ + + + /************************************************************************** + * + * @enum: + * FT_CFF_HINTING_XXX + * + * @description: + * A list of constants used for the @hinting-engine property to select + * the hinting engine for CFF fonts. + * + * @values: + * FT_CFF_HINTING_FREETYPE :: + * Use the old FreeType hinting engine. + * + * FT_CFF_HINTING_ADOBE :: + * Use the hinting engine contributed by Adobe. + * + */ +#define FT_CFF_HINTING_FREETYPE 0 +#define FT_CFF_HINTING_ADOBE 1 + + + /************************************************************************** + * + * @property: + * no-stem-darkening + * + * @description: + * By default, the Adobe CFF engine darkens stems at smaller sizes, + * regardless of hinting, to enhance contrast. This feature requires + * a rendering system with proper gamma correction. Setting this + * property, stem darkening gets switched off. + * + * Note that stem darkening is never applied if @FT_LOAD_NO_SCALE is set. + * + * { + * FT_Library library; + * FT_Bool no_stem_darkening = TRUE; + * + * + * FT_Init_FreeType( &library ); + * + * FT_Property_Set( library, "cff", + * "no-stem-darkening", &no_stem_darkening ); + * } + * + * @note: + * This property can be used with @FT_Property_Get also. + * + */ + + + /************************************************************************** + * + * @property: + * darkening-parameters + * + * @description: + * By default, the Adobe CFF engine darkens stems as follows (if the + * `no-stem-darkening' property isn't set): + * + * { + * stem width <= 0.5px: darkening amount = 0.4px + * stem width = 1px: darkening amount = 0.275px + * stem width = 1.667px: darkening amount = 0.275px + * stem width >= 2.333px: darkening amount = 0px + * } + * + * and piecewise linear in-between. Using the `darkening-parameters' + * property, these four control points can be changed, as the following + * example demonstrates. + * + * { + * FT_Library library; + * FT_Int darken_params[8] = { 500, 300, // x1, y1 + * 1000, 200, // x2, y2 + * 1500, 100, // x3, y3 + * 2000, 0 }; // x4, y4 + * + * + * FT_Init_FreeType( &library ); + * + * FT_Property_Set( library, "cff", + * "darkening-parameters", darken_params ); + * } + * + * The x~values give the stem width, and the y~values the darkening + * amount. The unit is 1000th of pixels. All coordinate values must be + * positive; the x~values must be monotonically increasing; the + * y~values must be monotonically decreasing and smaller than or + * equal to 500 (corresponding to half a pixel); the slope of each + * linear piece must be shallower than -1 (e.g., -.4). + * + * @note: + * This property can be used with @FT_Property_Get also. + * + */ + + + /* */ + +FT_END_HEADER + + +#endif /* __FTCFFDRV_H__ */ + + +/* END */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftchapters.h b/reactos/lib/3rdparty/freetype/include/ftchapters.h similarity index 99% rename from reactos/lib/3rdparty/freetype/include/freetype/ftchapters.h rename to reactos/lib/3rdparty/freetype/include/ftchapters.h index c55670d1d23..4b1059a8592 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftchapters.h +++ b/reactos/lib/3rdparty/freetype/include/ftchapters.h @@ -1,7 +1,7 @@ /***************************************************************************/ /* */ /* This file defines the structure of the FreeType reference. */ -/* It is used by the python script which generates the HTML files. */ +/* It is used by the python script that generates the HTML files. */ /* */ /***************************************************************************/ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftcid.h b/reactos/lib/3rdparty/freetype/include/ftcid.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftcid.h rename to reactos/lib/3rdparty/freetype/include/ftcid.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/fterrdef.h b/reactos/lib/3rdparty/freetype/include/fterrdef.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/fterrdef.h rename to reactos/lib/3rdparty/freetype/include/fterrdef.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/fterrors.h b/reactos/lib/3rdparty/freetype/include/fterrors.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/fterrors.h rename to reactos/lib/3rdparty/freetype/include/fterrors.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftgasp.h b/reactos/lib/3rdparty/freetype/include/ftgasp.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftgasp.h rename to reactos/lib/3rdparty/freetype/include/ftgasp.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftglyph.h b/reactos/lib/3rdparty/freetype/include/ftglyph.h similarity index 99% rename from reactos/lib/3rdparty/freetype/include/freetype/ftglyph.h rename to reactos/lib/3rdparty/freetype/include/ftglyph.h index 31dc33187d7..2d30ed9de7b 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftglyph.h +++ b/reactos/lib/3rdparty/freetype/include/ftglyph.h @@ -4,7 +4,7 @@ /* */ /* FreeType convenience functions to handle glyphs (specification). */ /* */ -/* Copyright 1996-2003, 2006, 2008, 2009, 2011 by */ +/* Copyright 1996-2003, 2006, 2008, 2009, 2011, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -358,17 +358,17 @@ FT_BEGIN_HEADER /* outline's points, including Bézier control points. Though it */ /* coincides with the exact bounding box for most glyphs, it can be */ /* slightly larger in some situations (like when rotating an outline */ - /* which contains Bézier outside arcs). */ + /* that contains Bézier outside arcs). */ /* */ /* Computing the control box is very fast, while getting the bounding */ /* box can take much more time as it needs to walk over all segments */ /* and arcs in the outline. To get the latter, you can use the */ - /* `ftbbox' component which is dedicated to this single task. */ + /* `ftbbox' component, which is dedicated to this single task. */ /* */ /* */ /* glyph :: A handle to the source glyph object. */ /* */ - /* mode :: The mode which indicates how to interpret the returned */ + /* mode :: The mode that indicates how to interpret the returned */ /* bounding box values. */ /* */ /* */ @@ -388,7 +388,7 @@ FT_BEGIN_HEADER /* @FT_LOAD_NO_SCALE, the resulting CBox is meaningless. To get */ /* reasonable values for the CBox it is necessary to load the glyph */ /* at a large ppem value (so that the hinting instructions can */ - /* properly shift and scale the subglyphs), then extracting the CBox */ + /* properly shift and scale the subglyphs), then extracting the CBox, */ /* which can be eventually converted back to font units. */ /* */ /* Note that the maximum coordinates are exclusive, which means that */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftgxval.h b/reactos/lib/3rdparty/freetype/include/ftgxval.h similarity index 98% rename from reactos/lib/3rdparty/freetype/include/freetype/ftgxval.h rename to reactos/lib/3rdparty/freetype/include/ftgxval.h index 497015c1011..6d38e327aa1 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftgxval.h +++ b/reactos/lib/3rdparty/freetype/include/ftgxval.h @@ -4,7 +4,7 @@ /* */ /* FreeType API for validating TrueTypeGX/AAT tables (specification). */ /* */ -/* Copyright 2004, 2005, 2006 by */ +/* Copyright 2004-2006, 2013 by */ /* Masatake YAMATO, Redhat K.K, */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ @@ -180,7 +180,7 @@ FT_BEGIN_HEADER * * @description: * Validate various TrueTypeGX tables to assure that all offsets and - * indices are valid. The idea is that a higher-level library which + * indices are valid. The idea is that a higher-level library that * actually does the text layout can access those tables without * error checking (which can be quite time consuming). * @@ -189,7 +189,7 @@ FT_BEGIN_HEADER * A handle to the input face. * * validation_flags :: - * A bit field which specifies the tables to be validated. See + * A bit field that specifies the tables to be validated. See * @FT_VALIDATE_GXXXX for possible values. * * table_length :: @@ -286,7 +286,7 @@ FT_BEGIN_HEADER * * @description: * Validate classic (16-bit format) kern table to assure that the offsets - * and indices are valid. The idea is that a higher-level library which + * and indices are valid. The idea is that a higher-level library that * actually does the text layout can access those tables without error * checking (which can be quite time consuming). * @@ -299,7 +299,7 @@ FT_BEGIN_HEADER * A handle to the input face. * * validation_flags :: - * A bit field which specifies the dialect to be validated. See + * A bit field that specifies the dialect to be validated. See * @FT_VALIDATE_CKERNXXX for possible values. * * @output: diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftgzip.h b/reactos/lib/3rdparty/freetype/include/ftgzip.h similarity index 74% rename from reactos/lib/3rdparty/freetype/include/freetype/ftgzip.h rename to reactos/lib/3rdparty/freetype/include/ftgzip.h index acbc4f0327b..78e726999ac 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftgzip.h +++ b/reactos/lib/3rdparty/freetype/include/ftgzip.h @@ -4,7 +4,7 @@ /* */ /* Gzip-compressed stream support. */ /* */ -/* Copyright 2002, 2003, 2004, 2006 by */ +/* Copyright 2002-2004, 2006, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -91,6 +91,53 @@ FT_BEGIN_HEADER FT_Stream_OpenGzip( FT_Stream stream, FT_Stream source ); + + /************************************************************************ + * + * @function: + * FT_Gzip_Uncompress + * + * @description: + * Decompress a zipped input buffer into an output buffer. This function + * is modeled after zlib's `uncompress' function. + * + * @input: + * memory :: + * A FreeType memory handle. + * + * input :: + * The input buffer. + * + * input_len :: + * The length of the input buffer. + * + * @output: + * output:: + * The output buffer. + * + * @inout: + * output_len :: + * Before calling the function, this is the the total size of the + * output buffer, which must be large enough to hold the entire + * uncompressed data (so the size of the uncompressed data must be + * known in advance). After calling the function, `output_len' is the + * size of the used data in `output'. + * + * @return: + * FreeType error code. 0~means success. + * + * @note: + * This function may return `FT_Err_Unimplemented_Feature' if your build + * of FreeType was not compiled with zlib support. + */ + FT_EXPORT( FT_Error ) + FT_Gzip_Uncompress( FT_Memory memory, + FT_Byte* output, + FT_ULong* output_len, + const FT_Byte* input, + FT_ULong input_len ); + + /* */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftimage.h b/reactos/lib/3rdparty/freetype/include/ftimage.h similarity index 99% rename from reactos/lib/3rdparty/freetype/include/freetype/ftimage.h rename to reactos/lib/3rdparty/freetype/include/ftimage.h index 3b826b1d32f..ea71a78efb6 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftimage.h +++ b/reactos/lib/3rdparty/freetype/include/ftimage.h @@ -555,7 +555,7 @@ FT_BEGIN_HEADER /* */ /* to :: A pointer to the target point of the `move to'. */ /* */ - /* user :: A typeless pointer which is passed from the caller of the */ + /* user :: A typeless pointer, which is passed from the caller of the */ /* decomposition function. */ /* */ /* */ @@ -582,7 +582,7 @@ FT_BEGIN_HEADER /* */ /* to :: A pointer to the target point of the `line to'. */ /* */ - /* user :: A typeless pointer which is passed from the caller of the */ + /* user :: A typeless pointer, which is passed from the caller of the */ /* decomposition function. */ /* */ /* */ @@ -613,7 +613,7 @@ FT_BEGIN_HEADER /* */ /* to :: A pointer to the target end point of the conic arc. */ /* */ - /* user :: A typeless pointer which is passed from the caller of */ + /* user :: A typeless pointer, which is passed from the caller of */ /* the decomposition function. */ /* */ /* */ @@ -645,7 +645,7 @@ FT_BEGIN_HEADER /* */ /* to :: A pointer to the target end point. */ /* */ - /* user :: A typeless pointer which is passed from the caller of */ + /* user :: A typeless pointer, which is passed from the caller of */ /* the decomposition function. */ /* */ /* */ @@ -836,8 +836,8 @@ FT_BEGIN_HEADER /* a a bitmap. This section contains the public API for rasters. */ /* */ /* Note that in FreeType 2, all rasters are now encapsulated within */ - /* specific modules called `renderers'. See `freetype/ftrender.h' for */ - /* more details on renderers. */ + /* specific modules called `renderers'. See `ftrender.h' for more */ + /* details on renderers. */ /* */ /*************************************************************************/ @@ -891,8 +891,8 @@ FT_BEGIN_HEADER /* */ /* */ /* This structure is used by the span drawing callback type named */ - /* @FT_SpanFunc which takes the y~coordinate of the span as a */ - /* a parameter. */ + /* @FT_SpanFunc that takes the y~coordinate of the span as a */ + /* parameter. */ /* */ /* The coverage value is always between 0 and 255. If you want less */ /* gray values, the callback function has to reduce them. */ @@ -1265,7 +1265,7 @@ FT_BEGIN_HEADER /* XXX: For now, the standard raster doesn't support direct */ /* composition but this should change for the final release (see */ /* the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c' */ - /* for examples of distinct implementations which support direct */ + /* for examples of distinct implementations that support direct */ /* composition). */ /* */ typedef int diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftincrem.h b/reactos/lib/3rdparty/freetype/include/ftincrem.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftincrem.h rename to reactos/lib/3rdparty/freetype/include/ftincrem.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftlcdfil.h b/reactos/lib/3rdparty/freetype/include/ftlcdfil.h similarity index 97% rename from reactos/lib/3rdparty/freetype/include/freetype/ftlcdfil.h rename to reactos/lib/3rdparty/freetype/include/ftlcdfil.h index 8b253f118be..39206f01927 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftlcdfil.h +++ b/reactos/lib/3rdparty/freetype/include/ftlcdfil.h @@ -5,7 +5,7 @@ /* FreeType API for color filtering of subpixel bitmap glyphs */ /* (specification). */ /* */ -/* Copyright 2006, 2007, 2008, 2010 by */ +/* Copyright 2006-2008, 2010, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -45,9 +45,9 @@ FT_BEGIN_HEADER * * @description: * The @FT_Library_SetLcdFilter API can be used to specify a low-pass - * filter which is then applied to LCD-optimized bitmaps generated + * filter, which is then applied to LCD-optimized bitmaps generated * through @FT_Render_Glyph. This is useful to reduce color fringes - * which would occur with unfiltered rendering. + * that would occur with unfiltered rendering. * * Note that no filter is active by default, and that this function is * *not* implemented in default builds of the library. You need to diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftlist.h b/reactos/lib/3rdparty/freetype/include/ftlist.h similarity index 97% rename from reactos/lib/3rdparty/freetype/include/freetype/ftlist.h rename to reactos/lib/3rdparty/freetype/include/ftlist.h index bb6f7f119d3..241e21e555c 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftlist.h +++ b/reactos/lib/3rdparty/freetype/include/ftlist.h @@ -4,7 +4,7 @@ /* */ /* Generic list support for FreeType (specification). */ /* */ -/* Copyright 1996-2001, 2003, 2007, 2010 by */ +/* Copyright 1996-2001, 2003, 2007, 2010, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -173,7 +173,7 @@ FT_BEGIN_HEADER /* FT_List_Iterator */ /* */ /* */ - /* An FT_List iterator function which is called during a list parse */ + /* An FT_List iterator function that is called during a list parse */ /* by @FT_List_Iterate. */ /* */ /* */ @@ -200,7 +200,7 @@ FT_BEGIN_HEADER /* */ /* list :: A handle to the list. */ /* iterator :: An iterator function, called on each node of the list. */ - /* user :: A user-supplied field which is passed as the second */ + /* user :: A user-supplied field that is passed as the second */ /* argument to the iterator. */ /* */ /* */ @@ -218,7 +218,7 @@ FT_BEGIN_HEADER /* FT_List_Destructor */ /* */ /* */ - /* An @FT_List iterator function which is called during a list */ + /* An @FT_List iterator function that is called during a list */ /* finalization by @FT_List_Finalize to destroy all elements in a */ /* given list. */ /* */ @@ -250,9 +250,9 @@ FT_BEGIN_HEADER /* destroy :: A list destructor that will be applied to each element */ /* of the list. */ /* */ - /* memory :: The current memory object which handles deallocation. */ + /* memory :: The current memory object that handles deallocation. */ /* */ - /* user :: A user-supplied field which is passed as the last */ + /* user :: A user-supplied field that is passed as the last */ /* argument to the destructor. */ /* */ /* */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftlzw.h b/reactos/lib/3rdparty/freetype/include/ftlzw.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftlzw.h rename to reactos/lib/3rdparty/freetype/include/ftlzw.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftmac.h b/reactos/lib/3rdparty/freetype/include/ftmac.h similarity index 98% rename from reactos/lib/3rdparty/freetype/include/freetype/ftmac.h rename to reactos/lib/3rdparty/freetype/include/ftmac.h index ab5bab5170c..42874fe6fc1 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftmac.h +++ b/reactos/lib/3rdparty/freetype/include/ftmac.h @@ -4,7 +4,7 @@ /* */ /* Additional Mac-specific API. */ /* */ -/* Copyright 1996-2001, 2004, 2006, 2007 by */ +/* Copyright 1996-2001, 2004, 2006, 2007, 2013 by */ /* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -18,7 +18,7 @@ /***************************************************************************/ /* */ -/* NOTE: Include this file after and after any */ +/* NOTE: Include this file after FT_FREETYPE_H and after any */ /* Mac-specific headers (because this header uses Mac types such as */ /* Handle, FSSpec, FSRef, etc.) */ /* */ @@ -168,7 +168,7 @@ FT_BEGIN_HEADER /* */ /* */ /* Return a pathname of the disk file and face index for given font */ - /* name which is handled by ATS framework. */ + /* name that is handled by ATS framework. */ /* */ /* */ /* fontName :: Mac OS name of the font in ATS framework. */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftmm.h b/reactos/lib/3rdparty/freetype/include/ftmm.h similarity index 98% rename from reactos/lib/3rdparty/freetype/include/freetype/ftmm.h rename to reactos/lib/3rdparty/freetype/include/ftmm.h index 3aefb9e4f25..837975a0b5c 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftmm.h +++ b/reactos/lib/3rdparty/freetype/include/ftmm.h @@ -4,7 +4,7 @@ /* */ /* FreeType Multiple Master font interface (specification). */ /* */ -/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ +/* Copyright 1996-2001, 2003, 2004, 2006, 2009, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -196,7 +196,7 @@ FT_BEGIN_HEADER /* number of designs). */ /* */ /* num_namedstyles :: The number of named styles; only meaningful for */ - /* GX which allows certain design coordinates to */ + /* GX that allows certain design coordinates to */ /* have a string ID (in the `name' table) */ /* associated with them. The font can tell the */ /* user that, for example, Weight=1.5 is `Bold'. */ @@ -258,8 +258,7 @@ FT_BEGIN_HEADER /* */ /* */ /* amaster :: The Multiple Masters/GX var descriptor. */ - /* Allocates a data structure, which the user must free */ - /* (a single call to FT_FREE will do it). */ + /* Allocates a data structure, which the user must free. */ /* */ /* */ /* FreeType error code. 0~means success. */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftmodapi.h b/reactos/lib/3rdparty/freetype/include/ftmodapi.h similarity index 99% rename from reactos/lib/3rdparty/freetype/include/freetype/ftmodapi.h rename to reactos/lib/3rdparty/freetype/include/ftmodapi.h index 8abffb558f1..22878f8c6d7 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftmodapi.h +++ b/reactos/lib/3rdparty/freetype/include/ftmodapi.h @@ -298,7 +298,7 @@ FT_BEGIN_HEADER * Note that only a few modules have properties. * * value :: - * A generic pointer to a variable or structure which gives the new + * A generic pointer to a variable or structure that gives the new * value of the property. The exact definition of `value' is * dependent on the property; see the `Synopsis' subsection of the * module's documentation. @@ -364,7 +364,7 @@ FT_BEGIN_HEADER * * @inout: * value :: - * A generic pointer to a variable or structure which gives the + * A generic pointer to a variable or structure that gives the * value of the property. The exact definition of `value' is * dependent on the property; see the `Synopsis' subsection of the * module's documentation. @@ -418,7 +418,7 @@ FT_BEGIN_HEADER /* @FT_Done_Library then only destroys a library if the counter is~1, */ /* otherwise it simply decrements the counter. */ /* */ - /* This function helps in managing life-cycles of structures which */ + /* This function helps in managing life-cycles of structures that */ /* reference @FT_Library objects. */ /* */ /* */ @@ -584,7 +584,7 @@ FT_BEGIN_HEADER * The library implements a bytecode interpreter that doesn't * support the patented operations of the TrueType virtual machine. * - * Its main use is to load certain Asian fonts which position and + * Its main use is to load certain Asian fonts that position and * scale glyph components with bytecode instructions. It produces * bad output for most other fonts. * diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftmoderr.h b/reactos/lib/3rdparty/freetype/include/ftmoderr.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftmoderr.h rename to reactos/lib/3rdparty/freetype/include/ftmoderr.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftotval.h b/reactos/lib/3rdparty/freetype/include/ftotval.h similarity index 97% rename from reactos/lib/3rdparty/freetype/include/freetype/ftotval.h rename to reactos/lib/3rdparty/freetype/include/ftotval.h index 027f2e88657..bb52dc4a0d2 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftotval.h +++ b/reactos/lib/3rdparty/freetype/include/ftotval.h @@ -4,7 +4,7 @@ /* */ /* FreeType API for validating OpenType tables (specification). */ /* */ -/* Copyright 2004, 2005, 2006, 2007 by */ +/* Copyright 2004-2007, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -116,7 +116,7 @@ FT_BEGIN_HEADER * * @description: * Validate various OpenType tables to assure that all offsets and - * indices are valid. The idea is that a higher-level library which + * indices are valid. The idea is that a higher-level library that * actually does the text layout can access those tables without * error checking (which can be quite time consuming). * @@ -125,7 +125,7 @@ FT_BEGIN_HEADER * A handle to the input face. * * validation_flags :: - * A bit field which specifies the tables to be validated. See + * A bit field that specifies the tables to be validated. See * @FT_VALIDATE_OTXXX for possible values. * * @output: diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftoutln.h b/reactos/lib/3rdparty/freetype/include/ftoutln.h similarity index 96% rename from reactos/lib/3rdparty/freetype/include/freetype/ftoutln.h rename to reactos/lib/3rdparty/freetype/include/ftoutln.h index fd69f282929..8c7c57d99eb 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftoutln.h +++ b/reactos/lib/3rdparty/freetype/include/ftoutln.h @@ -5,7 +5,7 @@ /* Support for the FT_Outline type used to store glyph shapes of */ /* most scalable font formats (specification). */ /* */ -/* Copyright 1996-2003, 2005-2012 by */ +/* Copyright 1996-2003, 2005-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -97,7 +97,7 @@ FT_BEGIN_HEADER /* operations. */ /* */ /* */ - /* user :: A typeless pointer which is passed to each */ + /* user :: A typeless pointer that is passed to each */ /* emitter during the decomposition. It can be */ /* used to store the state during the */ /* decomposition. */ @@ -105,6 +105,13 @@ FT_BEGIN_HEADER /* */ /* FreeType error code. 0~means success. */ /* */ + /* */ + /* A contour that contains a single point only is represented by a */ + /* `move to' operation followed by `line to' to the same point. In */ + /* most cases, it is best to filter this out before using the */ + /* outline for stroking purposes (otherwise it would result in a */ + /* visible dot when round caps are used). */ + /* */ FT_EXPORT( FT_Error ) FT_Outline_Decompose( FT_Outline* outline, const FT_Outline_Funcs* func_interface, @@ -217,12 +224,12 @@ FT_BEGIN_HEADER /* the outline's points, including Bézier control points. Though it */ /* coincides with the exact bounding box for most glyphs, it can be */ /* slightly larger in some situations (like when rotating an outline */ - /* which contains Bézier outside arcs). */ + /* that contains Bézier outside arcs). */ /* */ /* Computing the control box is very fast, while getting the bounding */ /* box can take much more time as it needs to walk over all segments */ /* and arcs in the outline. To get the latter, you can use the */ - /* `ftbbox' component which is dedicated to this single task. */ + /* `ftbbox' component, which is dedicated to this single task. */ /* */ /* */ /* outline :: A pointer to the source outline descriptor. */ @@ -525,9 +532,11 @@ FT_BEGIN_HEADER * * @description: * This function analyzes a glyph outline and tries to compute its - * fill orientation (see @FT_Orientation). This is done by computing - * the direction of each global horizontal and/or vertical extrema - * within the outline. + * fill orientation (see @FT_Orientation). This is done by integrating + * the total area covered by the outline. The positive integral + * corresponds to the clockwise orientation and @FT_ORIENTATION_POSTSCRIPT + * is returned. The negative integral corresponds to the counter-clockwise + * orientation and @FT_ORIENTATION_TRUETYPE is returned. * * Note that this will return @FT_ORIENTATION_TRUETYPE for empty * outlines. diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftpfr.h b/reactos/lib/3rdparty/freetype/include/ftpfr.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftpfr.h rename to reactos/lib/3rdparty/freetype/include/ftpfr.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftrender.h b/reactos/lib/3rdparty/freetype/include/ftrender.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftrender.h rename to reactos/lib/3rdparty/freetype/include/ftrender.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftsizes.h b/reactos/lib/3rdparty/freetype/include/ftsizes.h similarity index 98% rename from reactos/lib/3rdparty/freetype/include/freetype/ftsizes.h rename to reactos/lib/3rdparty/freetype/include/ftsizes.h index 3e548cc39f3..41670457014 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftsizes.h +++ b/reactos/lib/3rdparty/freetype/include/ftsizes.h @@ -4,7 +4,7 @@ /* */ /* FreeType size objects management (specification). */ /* */ -/* Copyright 1996-2001, 2003, 2004, 2006, 2009 by */ +/* Copyright 1996-2001, 2003, 2004, 2006, 2009, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -129,7 +129,7 @@ FT_BEGIN_HEADER /* */ /* Even though it is possible to create several size objects for a */ /* given face (see @FT_New_Size for details), functions like */ - /* @FT_Load_Glyph or @FT_Load_Char only use the one which has been */ + /* @FT_Load_Glyph or @FT_Load_Char only use the one that has been */ /* activated last to determine the `current character pixel size'. */ /* */ /* This function can be used to `activate' a previously created size */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftsnames.h b/reactos/lib/3rdparty/freetype/include/ftsnames.h similarity index 98% rename from reactos/lib/3rdparty/freetype/include/freetype/ftsnames.h rename to reactos/lib/3rdparty/freetype/include/ftsnames.h index 485e4e162e7..88af440356c 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftsnames.h +++ b/reactos/lib/3rdparty/freetype/include/ftsnames.h @@ -7,7 +7,7 @@ /* */ /* This is _not_ used to retrieve glyph names! */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2006, 2009, 2010 by */ +/* Copyright 1996-2003, 2006, 2009, 2010, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -169,7 +169,7 @@ FT_BEGIN_HEADER * A constant used as the tag of @FT_Parameter structures to make * FT_Open_Face() ignore preferred family subfamily names in `name' * table since OpenType version 1.4. For backwards compatibility with - * legacy systems which has 4-face-per-family restriction. + * legacy systems that have a 4-face-per-family restriction. * */ #define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY FT_MAKE_TAG( 'i', 'g', 'p', 'f' ) @@ -184,7 +184,7 @@ FT_BEGIN_HEADER * A constant used as the tag of @FT_Parameter structures to make * FT_Open_Face() ignore preferred subfamily names in `name' table since * OpenType version 1.4. For backwards compatibility with legacy - * systems which has 4-face-per-family restriction. + * systems that have a 4-face-per-family restriction. * */ #define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY FT_MAKE_TAG( 'i', 'g', 'p', 's' ) diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftstroke.h b/reactos/lib/3rdparty/freetype/include/ftstroke.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftstroke.h rename to reactos/lib/3rdparty/freetype/include/ftstroke.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftsynth.h b/reactos/lib/3rdparty/freetype/include/ftsynth.h similarity index 96% rename from reactos/lib/3rdparty/freetype/include/freetype/ftsynth.h rename to reactos/lib/3rdparty/freetype/include/ftsynth.h index 2074503cf60..839ab5e4002 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftsynth.h +++ b/reactos/lib/3rdparty/freetype/include/ftsynth.h @@ -5,7 +5,7 @@ /* FreeType synthesizing code for emboldening and slanting */ /* (specification). */ /* */ -/* Copyright 2000-2001, 2003, 2006, 2008, 2012 by */ +/* Copyright 2000-2001, 2003, 2006, 2008, 2012, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -37,7 +37,7 @@ /* Main reason for not lifting the functions in this module to a */ /* `standard' API is that the used parameters for emboldening and */ /* slanting are not configurable. Consider the functions as a */ - /* code resource which should be copied into the application and */ + /* code resource that should be copied into the application and */ /* adapted to the particular needs. */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftsystem.h b/reactos/lib/3rdparty/freetype/include/ftsystem.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ftsystem.h rename to reactos/lib/3rdparty/freetype/include/ftsystem.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/fttrigon.h b/reactos/lib/3rdparty/freetype/include/fttrigon.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/fttrigon.h rename to reactos/lib/3rdparty/freetype/include/fttrigon.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftttdrv.h b/reactos/lib/3rdparty/freetype/include/ftttdrv.h similarity index 85% rename from reactos/lib/3rdparty/freetype/include/freetype/ftttdrv.h rename to reactos/lib/3rdparty/freetype/include/ftttdrv.h index d5d3f1ccc18..70ad3d583b3 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftttdrv.h +++ b/reactos/lib/3rdparty/freetype/include/ftttdrv.h @@ -61,7 +61,7 @@ FT_BEGIN_HEADER * interpreter-version * * @description: - * Currently, two versions are available which represent the bytecode + * Currently, two versions are available, representing the bytecode * interpreter with and without subpixel hinting support, * respectively. The default is subpixel support if * TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel @@ -134,6 +134,26 @@ FT_BEGIN_HEADER * FT_CONFIG_OPTION_SUBPIXEL_HINTING, selecting version~38 causes an * `FT_Err_Unimplemented_Feature' error. * + * Depending on the graphics framework, Microsoft uses different + * bytecode engines. As a consequence, the version numbers returned by + * a call to the `GETINFO[1]' bytecode instruction are more convoluted + * than desired. + * + * { + * framework Windows version result of GETINFO[1] + * ---------------------------------------------------- + * GDI before XP 35 + * GDI XP and later 37 + * GDI+ old before Vista 37 + * GDI+ old Vista, 7 38 + * GDI+ after 7 40 + * DWrite before 8 39 + * DWrite 8 and later 40 + * } + * + * Since FreeType doesn't provide all capabilities of DWrite ClearType, + * using version~38 seems justified. + * */ #define TT_INTERPRETER_VERSION_35 35 #define TT_INTERPRETER_VERSION_38 38 diff --git a/reactos/lib/3rdparty/freetype/include/freetype/fttypes.h b/reactos/lib/3rdparty/freetype/include/fttypes.h similarity index 99% rename from reactos/lib/3rdparty/freetype/include/freetype/fttypes.h rename to reactos/lib/3rdparty/freetype/include/fttypes.h index 027e59ce115..bd944a4935f 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/fttypes.h +++ b/reactos/lib/3rdparty/freetype/include/fttypes.h @@ -418,7 +418,7 @@ FT_BEGIN_HEADER /* details of usage. */ /* */ /* */ - /* The address of the FreeType object which is under finalization. */ + /* The address of the FreeType object that is under finalization. */ /* Its client data is accessed through its `generic' field. */ /* */ typedef void (*FT_Generic_Finalizer)(void* object); @@ -466,8 +466,8 @@ FT_BEGIN_HEADER /* FT_MAKE_TAG */ /* */ /* */ - /* This macro converts four-letter tags which are used to label */ - /* TrueType tables into an unsigned long to be used within FreeType. */ + /* This macro converts four-letter tags that are used to label */ + /* TrueType tables into an unsigned long, to be used within FreeType. */ /* */ /* */ /* The produced values *must* be 32-bit integers. Don't redefine */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftwinfnt.h b/reactos/lib/3rdparty/freetype/include/ftwinfnt.h similarity index 97% rename from reactos/lib/3rdparty/freetype/include/freetype/ftwinfnt.h rename to reactos/lib/3rdparty/freetype/include/ftwinfnt.h index ea33353536e..0b673517914 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftwinfnt.h +++ b/reactos/lib/3rdparty/freetype/include/ftwinfnt.h @@ -58,9 +58,10 @@ FT_BEGIN_HEADER * @description: * A list of valid values for the `charset' byte in * @FT_WinFNT_HeaderRec. Exact mapping tables for the various cpXXXX - * encodings (except for cp1361) can be found at ftp://ftp.unicode.org - * in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. cp1361 is - * roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT. + * encodings (except for cp1361) can be found at + * ftp://ftp.unicode.org/public in the MAPPINGS/VENDORS/MICSFT/WINDOWS + * subdirectory. cp1361 is roughly a superset of + * MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT. * * @values: * FT_WinFNT_ID_DEFAULT :: diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ftxf86.h b/reactos/lib/3rdparty/freetype/include/ftxf86.h similarity index 96% rename from reactos/lib/3rdparty/freetype/include/freetype/ftxf86.h rename to reactos/lib/3rdparty/freetype/include/ftxf86.h index 8c68afdcc58..493cccdd0a5 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ftxf86.h +++ b/reactos/lib/3rdparty/freetype/include/ftxf86.h @@ -4,7 +4,7 @@ /* */ /* Support functions for X11. */ /* */ -/* Copyright 2002, 2003, 2004, 2006, 2007 by */ +/* Copyright 2002-2004, 2006, 2007, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -62,7 +62,7 @@ FT_BEGIN_HEADER /* */ /* */ /* Return a string describing the format of a given face, using values */ - /* which can be used as an X11 FONT_PROPERTY. Possible values are */ + /* that can be used as an X11 FONT_PROPERTY. Possible values are */ /* `TrueType', `Type~1', `BDF', `PCF', `Type~42', `CID~Type~1', `CFF', */ /* `PFR', and `Windows~FNT'. */ /* */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/autohint.h b/reactos/lib/3rdparty/freetype/include/internal/autohint.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/autohint.h rename to reactos/lib/3rdparty/freetype/include/internal/autohint.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftcalc.h b/reactos/lib/3rdparty/freetype/include/internal/ftcalc.h similarity index 98% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftcalc.h rename to reactos/lib/3rdparty/freetype/include/internal/ftcalc.h index faac3a38675..03bd68eb108 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftcalc.h +++ b/reactos/lib/3rdparty/freetype/include/internal/ftcalc.h @@ -27,10 +27,12 @@ FT_BEGIN_HEADER +#if 0 + /*************************************************************************/ /* */ /* */ - /* FT_FixedSqrt */ + /* FT_SqrtFixed */ /* */ /* */ /* Computes the square root of a 16.16 fixed-point value. */ @@ -47,6 +49,8 @@ FT_BEGIN_HEADER FT_BASE( FT_Int32 ) FT_SqrtFixed( FT_Int32 x ); +#endif /* 0 */ + /*************************************************************************/ /* */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftdebug.h b/reactos/lib/3rdparty/freetype/include/internal/ftdebug.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftdebug.h rename to reactos/lib/3rdparty/freetype/include/internal/ftdebug.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftdriver.h b/reactos/lib/3rdparty/freetype/include/internal/ftdriver.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftdriver.h rename to reactos/lib/3rdparty/freetype/include/internal/ftdriver.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftgloadr.h b/reactos/lib/3rdparty/freetype/include/internal/ftgloadr.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftgloadr.h rename to reactos/lib/3rdparty/freetype/include/internal/ftgloadr.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h b/reactos/lib/3rdparty/freetype/include/internal/ftmemory.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftmemory.h rename to reactos/lib/3rdparty/freetype/include/internal/ftmemory.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h b/reactos/lib/3rdparty/freetype/include/internal/ftobjs.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftobjs.h rename to reactos/lib/3rdparty/freetype/include/internal/ftobjs.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftpic.h b/reactos/lib/3rdparty/freetype/include/internal/ftpic.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftpic.h rename to reactos/lib/3rdparty/freetype/include/internal/ftpic.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftrfork.h b/reactos/lib/3rdparty/freetype/include/internal/ftrfork.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftrfork.h rename to reactos/lib/3rdparty/freetype/include/internal/ftrfork.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftserv.h b/reactos/lib/3rdparty/freetype/include/internal/ftserv.h similarity index 96% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftserv.h rename to reactos/lib/3rdparty/freetype/include/internal/ftserv.h index cd5fbd0fac6..1203ec8121a 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftserv.h +++ b/reactos/lib/3rdparty/freetype/include/internal/ftserv.h @@ -734,24 +734,24 @@ FT_BEGIN_HEADER * The header files containing the services. */ -#define FT_SERVICE_BDF_H -#define FT_SERVICE_CID_H -#define FT_SERVICE_GLYPH_DICT_H -#define FT_SERVICE_GX_VALIDATE_H -#define FT_SERVICE_KERNING_H -#define FT_SERVICE_MULTIPLE_MASTERS_H -#define FT_SERVICE_OPENTYPE_VALIDATE_H -#define FT_SERVICE_PFR_H -#define FT_SERVICE_POSTSCRIPT_CMAPS_H -#define FT_SERVICE_POSTSCRIPT_INFO_H -#define FT_SERVICE_POSTSCRIPT_NAME_H -#define FT_SERVICE_PROPERTIES_H -#define FT_SERVICE_SFNT_H -#define FT_SERVICE_TRUETYPE_ENGINE_H -#define FT_SERVICE_TT_CMAP_H -#define FT_SERVICE_WINFNT_H -#define FT_SERVICE_XFREE86_NAME_H -#define FT_SERVICE_TRUETYPE_GLYF_H +#define FT_SERVICE_BDF_H +#define FT_SERVICE_CID_H +#define FT_SERVICE_GLYPH_DICT_H +#define FT_SERVICE_GX_VALIDATE_H +#define FT_SERVICE_KERNING_H +#define FT_SERVICE_MULTIPLE_MASTERS_H +#define FT_SERVICE_OPENTYPE_VALIDATE_H +#define FT_SERVICE_PFR_H +#define FT_SERVICE_POSTSCRIPT_CMAPS_H +#define FT_SERVICE_POSTSCRIPT_INFO_H +#define FT_SERVICE_POSTSCRIPT_NAME_H +#define FT_SERVICE_PROPERTIES_H +#define FT_SERVICE_SFNT_H +#define FT_SERVICE_TRUETYPE_ENGINE_H +#define FT_SERVICE_TT_CMAP_H +#define FT_SERVICE_WINFNT_H +#define FT_SERVICE_XFREE86_NAME_H +#define FT_SERVICE_TRUETYPE_GLYF_H /* */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftstream.h b/reactos/lib/3rdparty/freetype/include/internal/ftstream.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftstream.h rename to reactos/lib/3rdparty/freetype/include/internal/ftstream.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/fttrace.h b/reactos/lib/3rdparty/freetype/include/internal/fttrace.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/fttrace.h rename to reactos/lib/3rdparty/freetype/include/internal/fttrace.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/ftvalid.h b/reactos/lib/3rdparty/freetype/include/internal/ftvalid.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/ftvalid.h rename to reactos/lib/3rdparty/freetype/include/internal/ftvalid.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/internal.h b/reactos/lib/3rdparty/freetype/include/internal/internal.h similarity index 61% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/internal.h rename to reactos/lib/3rdparty/freetype/include/internal/internal.h index 262afcfa8ae..e0ddb06b708 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/internal/internal.h +++ b/reactos/lib/3rdparty/freetype/include/internal/internal.h @@ -24,28 +24,28 @@ /*************************************************************************/ -#define FT_INTERNAL_OBJECTS_H -#define FT_INTERNAL_PIC_H -#define FT_INTERNAL_STREAM_H -#define FT_INTERNAL_MEMORY_H -#define FT_INTERNAL_DEBUG_H -#define FT_INTERNAL_CALC_H -#define FT_INTERNAL_DRIVER_H -#define FT_INTERNAL_TRACE_H -#define FT_INTERNAL_GLYPH_LOADER_H -#define FT_INTERNAL_SFNT_H -#define FT_INTERNAL_SERVICE_H -#define FT_INTERNAL_RFORK_H -#define FT_INTERNAL_VALIDATE_H +#define FT_INTERNAL_OBJECTS_H +#define FT_INTERNAL_PIC_H +#define FT_INTERNAL_STREAM_H +#define FT_INTERNAL_MEMORY_H +#define FT_INTERNAL_DEBUG_H +#define FT_INTERNAL_CALC_H +#define FT_INTERNAL_DRIVER_H +#define FT_INTERNAL_TRACE_H +#define FT_INTERNAL_GLYPH_LOADER_H +#define FT_INTERNAL_SFNT_H +#define FT_INTERNAL_SERVICE_H +#define FT_INTERNAL_RFORK_H +#define FT_INTERNAL_VALIDATE_H -#define FT_INTERNAL_TRUETYPE_TYPES_H -#define FT_INTERNAL_TYPE1_TYPES_H +#define FT_INTERNAL_TRUETYPE_TYPES_H +#define FT_INTERNAL_TYPE1_TYPES_H -#define FT_INTERNAL_POSTSCRIPT_AUX_H -#define FT_INTERNAL_POSTSCRIPT_HINTS_H -#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H +#define FT_INTERNAL_POSTSCRIPT_AUX_H +#define FT_INTERNAL_POSTSCRIPT_HINTS_H +#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H -#define FT_INTERNAL_AUTOHINT_H +#define FT_INTERNAL_AUTOHINT_H #if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/psaux.h b/reactos/lib/3rdparty/freetype/include/internal/psaux.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/psaux.h rename to reactos/lib/3rdparty/freetype/include/internal/psaux.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/pshints.h b/reactos/lib/3rdparty/freetype/include/internal/pshints.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/pshints.h rename to reactos/lib/3rdparty/freetype/include/internal/pshints.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svbdf.h b/reactos/lib/3rdparty/freetype/include/internal/services/svbdf.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svbdf.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svbdf.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svcid.h b/reactos/lib/3rdparty/freetype/include/internal/services/svcid.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svcid.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svcid.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svgldict.h b/reactos/lib/3rdparty/freetype/include/internal/services/svgldict.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svgldict.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svgldict.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svgxval.h b/reactos/lib/3rdparty/freetype/include/internal/services/svgxval.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svgxval.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svgxval.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svkern.h b/reactos/lib/3rdparty/freetype/include/internal/services/svkern.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svkern.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svkern.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svmm.h b/reactos/lib/3rdparty/freetype/include/internal/services/svmm.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svmm.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svmm.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svotval.h b/reactos/lib/3rdparty/freetype/include/internal/services/svotval.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svotval.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svotval.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpfr.h b/reactos/lib/3rdparty/freetype/include/internal/services/svpfr.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpfr.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svpfr.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpostnm.h b/reactos/lib/3rdparty/freetype/include/internal/services/svpostnm.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpostnm.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svpostnm.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svprop.h b/reactos/lib/3rdparty/freetype/include/internal/services/svprop.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svprop.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svprop.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpscmap.h b/reactos/lib/3rdparty/freetype/include/internal/services/svpscmap.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpscmap.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svpscmap.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h b/reactos/lib/3rdparty/freetype/include/internal/services/svpsinfo.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svpsinfo.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svpsinfo.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svsfnt.h b/reactos/lib/3rdparty/freetype/include/internal/services/svsfnt.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svsfnt.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svsfnt.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svttcmap.h b/reactos/lib/3rdparty/freetype/include/internal/services/svttcmap.h similarity index 97% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svttcmap.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svttcmap.h index 83994aaf8ae..4370f4c2d82 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svttcmap.h +++ b/reactos/lib/3rdparty/freetype/include/internal/services/svttcmap.h @@ -7,7 +7,7 @@ /* Copyright 2003 by */ /* Masatake YAMATO, Redhat K.K. */ /* */ -/* Copyright 2003, 2008, 2009, 2012 by */ +/* Copyright 2003, 2008, 2009, 2012, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -47,7 +47,7 @@ FT_BEGIN_HEADER /* */ /* language :: */ /* The language ID used in Mac fonts. Definitions of values are in */ - /* freetype/ttnameid.h. */ + /* `ttnameid.h'. */ /* */ /* format :: */ /* The cmap format. OpenType 1.5 defines the formats 0 (byte */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svtteng.h b/reactos/lib/3rdparty/freetype/include/internal/services/svtteng.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svtteng.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svtteng.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svttglyf.h b/reactos/lib/3rdparty/freetype/include/internal/services/svttglyf.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svttglyf.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svttglyf.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h b/reactos/lib/3rdparty/freetype/include/internal/services/svwinfnt.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svwinfnt.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svwinfnt.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/services/svxf86nm.h b/reactos/lib/3rdparty/freetype/include/internal/services/svxf86nm.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/services/svxf86nm.h rename to reactos/lib/3rdparty/freetype/include/internal/services/svxf86nm.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/sfnt.h b/reactos/lib/3rdparty/freetype/include/internal/sfnt.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/sfnt.h rename to reactos/lib/3rdparty/freetype/include/internal/sfnt.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/t1types.h b/reactos/lib/3rdparty/freetype/include/internal/t1types.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/t1types.h rename to reactos/lib/3rdparty/freetype/include/internal/t1types.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/internal/tttypes.h b/reactos/lib/3rdparty/freetype/include/internal/tttypes.h similarity index 94% rename from reactos/lib/3rdparty/freetype/include/freetype/internal/tttypes.h rename to reactos/lib/3rdparty/freetype/include/internal/tttypes.h index 1bbfe499c5b..ad302b87c88 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/internal/tttypes.h +++ b/reactos/lib/3rdparty/freetype/include/internal/tttypes.h @@ -137,6 +137,75 @@ FT_BEGIN_HEADER } TT_TableRec, *TT_Table; + /*************************************************************************/ + /* */ + /* */ + /* WOFF_HeaderRec */ + /* */ + /* */ + /* WOFF file format header. */ + /* */ + /* */ + /* See */ + /* */ + /* http://www.w3.org/TR/WOFF/#WOFFHeader */ + /* */ + typedef struct WOFF_HeaderRec_ + { + FT_ULong signature; + FT_ULong flavor; + FT_ULong length; + FT_UShort num_tables; + FT_UShort reserved; + FT_ULong totalSfntSize; + FT_UShort majorVersion; + FT_UShort minorVersion; + FT_ULong metaOffset; + FT_ULong metaLength; + FT_ULong metaOrigLength; + FT_ULong privOffset; + FT_ULong privLength; + + } WOFF_HeaderRec, *WOFF_Header; + + + /*************************************************************************/ + /* */ + /* */ + /* WOFF_TableRec */ + /* */ + /* */ + /* This structure describes a given table of a WOFF font. */ + /* */ + /* */ + /* Tag :: A four-bytes tag describing the table. */ + /* */ + /* Offset :: The offset of the table from the start of the WOFF */ + /* font in its resource. */ + /* */ + /* CompLength :: Compressed table length (in bytes). */ + /* */ + /* OrigLength :: Unompressed table length (in bytes). */ + /* */ + /* CheckSum :: The table checksum. This value can be ignored. */ + /* */ + /* OrigOffset :: The uncompressed table file offset. This value gets */ + /* computed while constructing the (uncompressed) SFNT */ + /* header. It is not contained in the WOFF file. */ + /* */ + typedef struct WOFF_TableRec_ + { + FT_ULong Tag; /* table ID */ + FT_ULong Offset; /* table file offset */ + FT_ULong CompLength; /* compressed table length */ + FT_ULong OrigLength; /* uncompressed table length */ + FT_ULong CheckSum; /* uncompressed checksum */ + + FT_ULong OrigOffset; /* uncompressed table file offset */ + /* (not in the WOFF file) */ + } WOFF_TableRec, *WOFF_Table; + + /*************************************************************************/ /* */ /* */ @@ -353,16 +422,16 @@ FT_BEGIN_HEADER /* */ typedef struct TT_SBit_MetricsRec_ { - FT_Byte height; - FT_Byte width; + FT_UShort height; + FT_UShort width; - FT_Char horiBearingX; - FT_Char horiBearingY; - FT_Byte horiAdvance; + FT_Short horiBearingX; + FT_Short horiBearingY; + FT_UShort horiAdvance; - FT_Char vertBearingX; - FT_Char vertBearingY; - FT_Byte vertAdvance; + FT_Short vertBearingX; + FT_Short vertBearingY; + FT_UShort vertAdvance; } TT_SBit_MetricsRec, *TT_SBit_Metrics; @@ -979,6 +1048,20 @@ FT_BEGIN_HEADER (*TT_Loader_EndGlyphFunc)( TT_Loader loader ); + typedef enum TT_SbitTableType_ + { + TT_SBIT_TABLE_TYPE_NONE = 0, + TT_SBIT_TABLE_TYPE_EBLC, /* `EBLC' (Microsoft), */ + /* `bloc' (Apple) */ + TT_SBIT_TABLE_TYPE_CBLC, /* `CBLC' (Google) */ + TT_SBIT_TABLE_TYPE_SBIX, /* `sbix' (Apple) */ + + /* do not remove */ + TT_SBIT_TABLE_TYPE_MAX + + } TT_SbitTableType; + + /*************************************************************************/ /* */ /* TrueType Face Type */ @@ -1090,13 +1173,6 @@ FT_BEGIN_HEADER /* */ /* pclt :: The `pclt' SFNT table. */ /* */ - /* num_sbit_strikes :: The number of sbit strikes, i.e., bitmap */ - /* sizes, embedded in this font. */ - /* */ - /* sbit_strikes :: An array of sbit strikes embedded in this */ - /* font. This table is optional in a */ - /* TrueType/OpenType font. */ - /* */ /* num_sbit_scales :: The number of sbit scales for this font. */ /* */ /* sbit_scales :: Array of sbit scales embedded in this */ @@ -1302,6 +1378,7 @@ FT_BEGIN_HEADER FT_Byte* sbit_table; FT_ULong sbit_table_size; + TT_SbitTableType sbit_table_type; FT_UInt sbit_num_strikes; FT_Byte* kern_table; @@ -1402,7 +1479,6 @@ FT_BEGIN_HEADER FT_Int advance; FT_Int linear; FT_Bool linear_def; - FT_Bool preserve_pps; FT_Vector pp1; FT_Vector pp2; diff --git a/reactos/lib/3rdparty/freetype/include/freetype/t1tables.h b/reactos/lib/3rdparty/freetype/include/t1tables.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/t1tables.h rename to reactos/lib/3rdparty/freetype/include/t1tables.h diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ttnameid.h b/reactos/lib/3rdparty/freetype/include/ttnameid.h similarity index 99% rename from reactos/lib/3rdparty/freetype/include/freetype/ttnameid.h rename to reactos/lib/3rdparty/freetype/include/ttnameid.h index 173f88c9507..9711d1d9475 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/ttnameid.h +++ b/reactos/lib/3rdparty/freetype/include/ttnameid.h @@ -4,7 +4,7 @@ /* */ /* TrueType name ID definitions (specification only). */ /* */ -/* Copyright 1996-2004, 2006-2008, 2012 by */ +/* Copyright 1996-2004, 2006-2008, 2012, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1208,7 +1208,7 @@ FT_BEGIN_HEADER /* */ /* Here some alias #defines in order to be clearer. */ /* */ - /* These are not always #defined to stay within the 31~character limit */ + /* These are not always #defined to stay within the 31~character limit, */ /* which some compilers have. */ /* */ /* Credits go to Dave Hoo for pointing out that modern */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/tttables.h b/reactos/lib/3rdparty/freetype/include/tttables.h similarity index 97% rename from reactos/lib/3rdparty/freetype/include/freetype/tttables.h rename to reactos/lib/3rdparty/freetype/include/tttables.h index fe07117b0b4..bb49dc0dafd 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/tttables.h +++ b/reactos/lib/3rdparty/freetype/include/tttables.h @@ -5,7 +5,7 @@ /* Basic SFNT/TrueType tables definitions and interface */ /* (specification only). */ /* */ -/* Copyright 1996-2005, 2008-2012 by */ +/* Copyright 1996-2005, 2008-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -170,8 +170,8 @@ FT_BEGIN_HEADER /* */ /* */ /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ - /* be identical except for the names of their fields which */ - /* are different. */ + /* be identical except for the names of their fields, */ + /* which are different. */ /* */ /* This ensures that a single function in the `ttload' */ /* module is able to read both the horizontal and vertical */ @@ -296,8 +296,8 @@ FT_BEGIN_HEADER /* */ /* */ /* IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should */ - /* be identical except for the names of their fields which */ - /* are different. */ + /* be identical except for the names of their fields, */ + /* which are different. */ /* */ /* This ensures that a single function in the `ttload' */ /* module is able to read both the horizontal and vertical */ @@ -340,12 +340,11 @@ FT_BEGIN_HEADER /* TT_OS2 */ /* */ /* */ - /* A structure used to model a TrueType OS/2 table. This is the long */ - /* table version. All fields comply to the TrueType specification. */ + /* A structure used to model a TrueType OS/2 table. All fields */ + /* comply to the OpenType specification. */ /* */ - /* Note that we now support old Mac fonts which do not include an */ - /* OS/2 table. In this case, the `version' field is always set to */ - /* 0xFFFF. */ + /* Note that we now support old Mac fonts that do not include an OS/2 */ + /* table. In this case, the `version' field is always set to 0xFFFF. */ /* */ typedef struct TT_OS2_ { @@ -384,12 +383,12 @@ FT_BEGIN_HEADER FT_UShort usWinAscent; FT_UShort usWinDescent; - /* only version 1 tables: */ + /* only version 1 and higher: */ FT_ULong ulCodePageRange1; /* Bits 0-31 */ FT_ULong ulCodePageRange2; /* Bits 32-63 */ - /* only version 2 tables: */ + /* only version 2 and higher: */ FT_Short sxHeight; FT_Short sCapHeight; @@ -397,6 +396,11 @@ FT_BEGIN_HEADER FT_UShort usBreakChar; FT_UShort usMaxContext; + /* only version 5 and higher: */ + + FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */ + FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */ + } TT_OS2; @@ -465,7 +469,7 @@ FT_BEGIN_HEADER /* TT_MaxProfile */ /* */ /* */ - /* The maximum profile is a table containing many max values which */ + /* The maximum profile is a table containing many max values, which */ /* can be used to pre-allocate arrays. This ensures that no memory */ /* allocation occurs during a glyph load. */ /* */ @@ -672,6 +676,12 @@ FT_BEGIN_HEADER * error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); * if ( error ) { ... could not load table ... } * } + * + * Note that structures like @TT_Header or @TT_OS2 can't be used with + * this function; they are limited to @FT_Get_Sfnt_Table. Reason is that + * those structures depend on the processor architecture, with varying + * size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian). + * */ FT_EXPORT( FT_Error ) FT_Load_Sfnt_Table( FT_Face face, @@ -730,7 +740,7 @@ FT_BEGIN_HEADER /* */ /* */ /* Return TrueType/sfnt specific cmap language ID. Definitions of */ - /* language ID values are in `freetype/ttnameid.h'. */ + /* language ID values are in `ttnameid.h'. */ /* */ /* */ /* charmap :: */ diff --git a/reactos/lib/3rdparty/freetype/include/freetype/tttags.h b/reactos/lib/3rdparty/freetype/include/tttags.h similarity index 97% rename from reactos/lib/3rdparty/freetype/include/freetype/tttags.h rename to reactos/lib/3rdparty/freetype/include/tttags.h index be8c524edb8..d59aa19a338 100644 --- a/reactos/lib/3rdparty/freetype/include/freetype/tttags.h +++ b/reactos/lib/3rdparty/freetype/include/tttags.h @@ -88,6 +88,7 @@ FT_BEGIN_HEADER #define TTAG_post FT_MAKE_TAG( 'p', 'o', 's', 't' ) #define TTAG_prep FT_MAKE_TAG( 'p', 'r', 'e', 'p' ) #define TTAG_prop FT_MAKE_TAG( 'p', 'r', 'o', 'p' ) +#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' ) #define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' ) #define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' ) #define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' ) @@ -99,6 +100,7 @@ FT_BEGIN_HEADER #define TTAG_VDMX FT_MAKE_TAG( 'V', 'D', 'M', 'X' ) #define TTAG_vhea FT_MAKE_TAG( 'v', 'h', 'e', 'a' ) #define TTAG_vmtx FT_MAKE_TAG( 'v', 'm', 't', 'x' ) +#define TTAG_wOFF FT_MAKE_TAG( 'w', 'O', 'F', 'F' ) FT_END_HEADER diff --git a/reactos/lib/3rdparty/freetype/include/freetype/ttunpat.h b/reactos/lib/3rdparty/freetype/include/ttunpat.h similarity index 100% rename from reactos/lib/3rdparty/freetype/include/freetype/ttunpat.h rename to reactos/lib/3rdparty/freetype/include/ttunpat.h diff --git a/reactos/lib/3rdparty/freetype/modules.cfg b/reactos/lib/3rdparty/freetype/modules.cfg index a85378ee7ce..4e5259445fb 100644 --- a/reactos/lib/3rdparty/freetype/modules.cfg +++ b/reactos/lib/3rdparty/freetype/modules.cfg @@ -1,6 +1,6 @@ # modules.cfg # -# Copyright 2005-2007, 2009-2011 by +# Copyright 2005-2007, 2009-2011, 2013 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -19,7 +19,7 @@ # activate a module, remove the comment character. # # Note that many modules and components are further controlled with macros -# in the file `include/freetype/config/ftoption.h'. +# in the file `include/config/ftoption.h'. #### @@ -85,7 +85,7 @@ HINTING_MODULES += autofit HINTING_MODULES += pshinter # The TrueType hinting engine doesn't have a module of its own but is -# controlled in file include/freetype/config/ftoption.h +# controlled in file include/config/ftoption.h # (TT_CONFIG_OPTION_BYTECODE_INTERPRETER and friends). @@ -106,7 +106,7 @@ RASTER_MODULES += smooth # FreeType's cache sub-system (quite stable but still in beta -- this means # that its public API is subject to change if necessary). See -# include/freetype/ftcache.h. Needs ftglyph.c. +# include/ftcache.h. Needs ftglyph.c. AUX_MODULES += cache # TrueType GX/AAT table validation. Needs ftgxval.c below. @@ -114,17 +114,17 @@ AUX_MODULES += cache # Support for streams compressed with gzip (files with suffix .gz). # -# See include/freetype/ftgzip.h for the API. +# See include/ftgzip.h for the API. AUX_MODULES += gzip # Support for streams compressed with LZW (files with suffix .Z). # -# See include/freetype/ftlzw.h for the API. +# See include/ftlzw.h for the API. AUX_MODULES += lzw # Support for streams compressed with bzip2 (files with suffix .bz2). # -# See include/freetype/ftbzip2.h for the API. +# See include/ftbzip2.h for the API. AUX_MODULES += bzip2 # OpenType table validation. Needs ftotval.c below. @@ -149,95 +149,95 @@ AUX_MODULES += psnames # Exact bounding box calculation. # -# See include/freetype/ftbbox.h for the API. +# See include/ftbbox.h for the API. BASE_EXTENSIONS += ftbbox.c # Access BDF-specific strings. Needs BDF font driver. # -# See include/freetype/ftbdf.h for the API. +# See include/ftbdf.h for the API. BASE_EXTENSIONS += ftbdf.c # Utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp bitmaps into # 8bpp format, and for emboldening of bitmap glyphs. # -# See include/freetype/ftbitmap.h for the API. +# See include/ftbitmap.h for the API. BASE_EXTENSIONS += ftbitmap.c # Access CID font information. # -# See include/freetype/ftcid.h for the API. +# See include/ftcid.h for the API. BASE_EXTENSIONS += ftcid.c # Access FSType information. Needs fttype1.c. # -# See include/freetype/freetype.h for the API. +# See include/freetype.h for the API. BASE_EXTENSIONS += ftfstype.c # Support for GASP table queries. # -# See include/freetype/ftgasp.h for the API. +# See include/ftgasp.h for the API. BASE_EXTENSIONS += ftgasp.c # Convenience functions to handle glyphs. Needs ftbitmap.c. # -# See include/freetype/ftglyph.h for the API. +# See include/ftglyph.h for the API. BASE_EXTENSIONS += ftglyph.c # Interface for gxvalid module. # -# See include/freetype/ftgxval.h for the API. +# See include/ftgxval.h for the API. BASE_EXTENSIONS += ftgxval.c # Support for LCD color filtering of subpixel bitmaps. # -# See include/freetype/ftlcdfil.h for the API. +# See include/ftlcdfil.h for the API. BASE_EXTENSIONS += ftlcdfil.c # Multiple Master font interface. # -# See include/freetype/ftmm.h for the API. +# See include/ftmm.h for the API. BASE_EXTENSIONS += ftmm.c # Interface for otvalid module. # -# See include/freetype/ftotval.h for the API. +# See include/ftotval.h for the API. BASE_EXTENSIONS += ftotval.c # Support for FT_Face_CheckTrueTypePatents. # -# See include/freetype/freetype.h for the API. +# See include/freetype.h for the API. BASE_EXTENSIONS += ftpatent.c # Interface for accessing PFR-specific data. Needs PFR font driver. # -# See include/freetype/ftpfr.h for the API. +# See include/ftpfr.h for the API. BASE_EXTENSIONS += ftpfr.c # Path stroker. Needs ftglyph.c. # -# See include/freetype/ftstroke.h for the API. +# See include/ftstroke.h for the API. BASE_EXTENSIONS += ftstroke.c # Support for synthetic embolding and slanting of fonts. Needs ftbitmap.c. # -# See include/freetype/ftsynth.h for the API. +# See include/ftsynth.h for the API. BASE_EXTENSIONS += ftsynth.c # Interface to access data specific to PostScript Type 1 and Type 2 (CFF) # fonts. # -# See include/freetype/t1tables.h for the API. +# See include/t1tables.h for the API. BASE_EXTENSIONS += fttype1.c # Interface for accessing data specific to Windows FNT files. Needs winfnt # driver. # -# See include/freetype/ftwinfnt.h for the API. +# See include/ftwinfnt.h for the API. BASE_EXTENSIONS += ftwinfnt.c # Support functions for X11. # -# See include/freetype/ftxf86.h for the API. +# See include/ftxf86.h for the API. BASE_EXTENSIONS += ftxf86.c #### diff --git a/reactos/lib/3rdparty/freetype/objs/README b/reactos/lib/3rdparty/freetype/objs/README new file mode 100644 index 00000000000..befb63e0492 --- /dev/null +++ b/reactos/lib/3rdparty/freetype/objs/README @@ -0,0 +1,2 @@ +This directory contains all the object files created when building the +library. diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afblue.c b/reactos/lib/3rdparty/freetype/src/autofit/afblue.c new file mode 100644 index 00000000000..22ef6d5a87e --- /dev/null +++ b/reactos/lib/3rdparty/freetype/src/autofit/afblue.c @@ -0,0 +1,166 @@ +/* This file has been generated by the Perl script `afblue.pl', */ +/* using data from file `afblue.dat'. */ + +/***************************************************************************/ +/* */ +/* afblue.c */ +/* */ +/* Auto-fitter data for blue strings (body). */ +/* */ +/* Copyright 2013 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "aftypes.h" + + + FT_LOCAL_ARRAY_DEF( char ) + af_blue_strings[] = + { + /* */ + 'T', 'H', 'E', 'Z', 'O', 'C', 'Q', 'S', /* THEZOCQS */ + '\0', + 'H', 'E', 'Z', 'L', 'O', 'C', 'U', 'S', /* HEZLOCUS */ + '\0', + 'f', 'i', 'j', 'k', 'd', 'b', 'h', /* fijkdbh */ + '\0', + 'x', 'z', 'r', 'o', 'e', 's', 'c', /* xzroesc */ + '\0', + 'p', 'q', 'g', 'j', 'y', /* pqgjy */ + '\0', + '\xCE', '\x93', '\xCE', '\x92', '\xCE', '\x95', '\xCE', '\x96', '\xCE', '\x98', '\xCE', '\x9F', '\xCE', '\xA9', /* ΓΒΕΖΘΟΩ */ + '\0', + '\xCE', '\x92', '\xCE', '\x94', '\xCE', '\x96', '\xCE', '\x9E', '\xCE', '\x98', '\xCE', '\x9F', /* ΒΔΖΞΘΟ */ + '\0', + '\xCE', '\xB2', '\xCE', '\xB8', '\xCE', '\xB4', '\xCE', '\xB6', '\xCE', '\xBB', '\xCE', '\xBE', /* βθδζλξ */ + '\0', + '\xCE', '\xB1', '\xCE', '\xB5', '\xCE', '\xB9', '\xCE', '\xBF', '\xCF', '\x80', '\xCF', '\x83', '\xCF', '\x84', '\xCF', '\x89', /* αειοπστω */ + '\0', + '\xCE', '\xB2', '\xCE', '\xB3', '\xCE', '\xB7', '\xCE', '\xBC', '\xCF', '\x81', '\xCF', '\x86', '\xCF', '\x87', '\xCF', '\x88', /* βγημρφχψ */ + '\0', + '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\x9F', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕПЗОСЭ */ + '\0', + '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\xA8', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕШЗОСЭ */ + '\0', + '\xD1', '\x85', '\xD0', '\xBF', '\xD0', '\xBD', '\xD1', '\x88', '\xD0', '\xB5', '\xD0', '\xB7', '\xD0', '\xBE', '\xD1', '\x81', /* хпншезос */ + '\0', + '\xD1', '\x80', '\xD1', '\x83', '\xD1', '\x84', /* руф */ + '\0', + '\xD7', '\x91', '\xD7', '\x93', '\xD7', '\x94', '\xD7', '\x97', '\xD7', '\x9A', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', /* בדהחךכםס */ + '\0', + '\xD7', '\x91', '\xD7', '\x98', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', '\xD7', '\xA6', /* בטכםסצ */ + '\0', + '\xD7', '\xA7', '\xD7', '\x9A', '\xD7', '\x9F', '\xD7', '\xA3', '\xD7', '\xA5', /* קךןףץ */ +#ifdef AF_CONFIG_OPTION_CJK + '\0', + '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 他们你來們到和地 */ + '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', '\xE5', '\xB8', '\xAD', '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x83', /* 对對就席我时時會 */ + '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\x83', '\xBD', '\xE8', '\x88', '\xB0', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99', /* 来為能舰說说这這 */ + '\xE9', '\xBD', '\x8A', /* 齊 */ + '\0', + '\xE5', '\x86', '\x9B', '\xE5', '\x90', '\x8C', '\xE5', '\xB7', '\xB2', '\xE6', '\x84', '\xBF', '\xE6', '\x97', '\xA2', '\xE6', '\x98', '\x9F', '\xE6', '\x98', '\xAF', '\xE6', '\x99', '\xAF', /* 军同已愿既星是景 */ + '\xE6', '\xB0', '\x91', '\xE7', '\x85', '\xA7', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\xA8', '\xE7', '\xBD', '\xAE', '\xE8', '\xA6', '\x81', /* 民照现現理用置要 */ + '\xE8', '\xBB', '\x8D', '\xE9', '\x82', '\xA3', '\xE9', '\x85', '\x8D', '\xE9', '\x87', '\x8C', '\xE9', '\x96', '\x8B', '\xE9', '\x9B', '\xB7', '\xE9', '\x9C', '\xB2', '\xE9', '\x9D', '\xA2', /* 軍那配里開雷露面 */ + '\xE9', '\xA1', '\xBE', /* 顾 */ + '\0', + '\xE4', '\xB8', '\xAA', '\xE4', '\xB8', '\xBA', '\xE4', '\xBA', '\xBA', '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xA5', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', /* 个为人他以们你來 */ + '\xE5', '\x80', '\x8B', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\xA4', '\xA7', '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', /* 個們到和大对對就 */ + '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x89', '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\xA6', '\x81', '\xE8', '\xAA', '\xAA', /* 我时時有来為要說 */ + '\xE8', '\xAF', '\xB4', /* 说 */ + '\0', + '\xE4', '\xB8', '\xBB', '\xE4', '\xBA', '\x9B', '\xE5', '\x9B', '\xA0', '\xE5', '\xAE', '\x83', '\xE6', '\x83', '\xB3', '\xE6', '\x84', '\x8F', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\x9F', /* 主些因它想意理生 */ + '\xE7', '\x95', '\xB6', '\xE7', '\x9C', '\x8B', '\xE7', '\x9D', '\x80', '\xE7', '\xBD', '\xAE', '\xE8', '\x80', '\x85', '\xE8', '\x87', '\xAA', '\xE8', '\x91', '\x97', '\xE8', '\xA3', '\xA1', /* 當看着置者自著裡 */ + '\xE8', '\xBF', '\x87', '\xE8', '\xBF', '\x98', '\xE8', '\xBF', '\x9B', '\xE9', '\x80', '\xB2', '\xE9', '\x81', '\x8E', '\xE9', '\x81', '\x93', '\xE9', '\x82', '\x84', '\xE9', '\x87', '\x8C', /* 过还进進過道還里 */ + '\xE9', '\x9D', '\xA2', /* 面 */ +#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT + '\0', + '\xE4', '\xBA', '\x9B', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 些们你來們到和地 */ + '\xE5', '\xA5', '\xB9', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE5', '\xB0', '\xB1', '\xE5', '\xB9', '\xB4', '\xE5', '\xBE', '\x97', '\xE6', '\x83', '\x85', '\xE6', '\x9C', '\x80', /* 她将將就年得情最 */ + '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE7', '\x90', '\x86', '\xE8', '\x83', '\xBD', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99', /* 样樣理能說说这這 */ + '\xE9', '\x80', '\x9A', /* 通 */ + '\0', + '\xE5', '\x8D', '\xB3', '\xE5', '\x90', '\x97', '\xE5', '\x90', '\xA7', '\xE5', '\x90', '\xAC', '\xE5', '\x91', '\xA2', '\xE5', '\x93', '\x81', '\xE5', '\x93', '\x8D', '\xE5', '\x97', '\x8E', /* 即吗吧听呢品响嗎 */ + '\xE5', '\xB8', '\x88', '\xE5', '\xB8', '\xAB', '\xE6', '\x94', '\xB6', '\xE6', '\x96', '\xAD', '\xE6', '\x96', '\xB7', '\xE6', '\x98', '\x8E', '\xE7', '\x9C', '\xBC', '\xE9', '\x96', '\x93', /* 师師收断斷明眼間 */ + '\xE9', '\x97', '\xB4', '\xE9', '\x99', '\x85', '\xE9', '\x99', '\x88', '\xE9', '\x99', '\x90', '\xE9', '\x99', '\xA4', '\xE9', '\x99', '\xB3', '\xE9', '\x9A', '\x8F', '\xE9', '\x9A', '\x9B', /* 间际陈限除陳随際 */ + '\xE9', '\x9A', '\xA8', /* 隨 */ + '\0', + '\xE4', '\xBA', '\x8B', '\xE5', '\x89', '\x8D', '\xE5', '\xAD', '\xB8', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE6', '\x83', '\x85', '\xE6', '\x83', '\xB3', '\xE6', '\x88', '\x96', /* 事前學将將情想或 */ + '\xE6', '\x94', '\xBF', '\xE6', '\x96', '\xAF', '\xE6', '\x96', '\xB0', '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE6', '\xB0', '\x91', '\xE6', '\xB2', '\x92', '\xE6', '\xB2', '\xA1', /* 政斯新样樣民沒没 */ + '\xE7', '\x84', '\xB6', '\xE7', '\x89', '\xB9', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x83', '\xE7', '\xAC', '\xAC', '\xE7', '\xB6', '\x93', '\xE8', '\xB0', '\x81', /* 然特现現球第經谁 */ + '\xE8', '\xB5', '\xB7', /* 起 */ + '\0', + '\xE4', '\xBE', '\x8B', '\xE5', '\x88', '\xA5', '\xE5', '\x88', '\xAB', '\xE5', '\x88', '\xB6', '\xE5', '\x8A', '\xA8', '\xE5', '\x8B', '\x95', '\xE5', '\x90', '\x97', '\xE5', '\x97', '\x8E', /* 例別别制动動吗嗎 */ + '\xE5', '\xA2', '\x9E', '\xE6', '\x8C', '\x87', '\xE6', '\x98', '\x8E', '\xE6', '\x9C', '\x9D', '\xE6', '\x9C', '\x9F', '\xE6', '\x9E', '\x84', '\xE7', '\x89', '\xA9', '\xE7', '\xA1', '\xAE', /* 增指明朝期构物确 */ + '\xE7', '\xA7', '\x8D', '\xE8', '\xAA', '\xBF', '\xE8', '\xB0', '\x83', '\xE8', '\xB2', '\xBB', '\xE8', '\xB4', '\xB9', '\xE9', '\x82', '\xA3', '\xE9', '\x83', '\xBD', '\xE9', '\x96', '\x93', /* 种調调費费那都間 */ + '\xE9', '\x97', '\xB4', /* 间 */ +#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ +#endif /* AF_CONFIG_OPTION_CJK */ + '\0', + + }; + + + /* stringsets are specific to scripts */ + FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec ) + af_blue_stringsets[] = + { + /* */ + { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_LATIN_SMALL, 0 }, + { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_GREEK_SMALL, 0 }, + { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP }, + { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 }, + { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT }, + { AF_BLUE_STRING_CYRILLIC_SMALL, 0 }, + { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, + { AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_LONG }, + { AF_BLUE_STRING_HEBREW_BOTTOM, 0 }, + { AF_BLUE_STRING_HEBREW_DESCENDER, 0 }, + { AF_BLUE_STRING_MAX, 0 }, +#ifdef AF_CONFIG_OPTION_CJK + { AF_BLUE_STRING_CJK_TOP_FILL, AF_BLUE_PROPERTY_CJK_TOP | + AF_BLUE_PROPERTY_CJK_FILL }, + { AF_BLUE_STRING_CJK_TOP_UNFILL, AF_BLUE_PROPERTY_CJK_TOP }, + { AF_BLUE_STRING_CJK_BOTTOM_FILL, AF_BLUE_PROPERTY_CJK_FILL }, + { AF_BLUE_STRING_CJK_BOTTOM_UNFILL, 0 }, +#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT + { AF_BLUE_STRING_CJK_LEFT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ | + AF_BLUE_PROPERTY_CJK_FILL }, + { AF_BLUE_STRING_CJK_LEFT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ }, + { AF_BLUE_STRING_CJK_RIGHT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ | + AF_BLUE_PROPERTY_CJK_RIGHT | + AF_BLUE_PROPERTY_CJK_FILL }, + { AF_BLUE_STRING_CJK_RIGHT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ | + AF_BLUE_PROPERTY_CJK_RIGHT }, +#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ + { AF_BLUE_STRING_MAX, 0 }, +#endif /* AF_CONFIG_OPTION_CJK */ + + }; + + +/* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afblue.cin b/reactos/lib/3rdparty/freetype/src/autofit/afblue.cin new file mode 100644 index 00000000000..c693d89f701 --- /dev/null +++ b/reactos/lib/3rdparty/freetype/src/autofit/afblue.cin @@ -0,0 +1,39 @@ +/***************************************************************************/ +/* */ +/* afblue.c */ +/* */ +/* Auto-fitter data for blue strings (body). */ +/* */ +/* Copyright 2013 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#include "aftypes.h" + + + FT_LOCAL_ARRAY_DEF( char ) + af_blue_strings[] = + { + /* */ +@AF_BLUE_STRINGS_ARRAY@ + }; + + + /* stringsets are specific to scripts */ + FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec ) + af_blue_stringsets[] = + { + /* */ +@AF_BLUE_STRINGSETS_ARRAY@ + }; + + +/* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afblue.dat b/reactos/lib/3rdparty/freetype/src/autofit/afblue.dat new file mode 100644 index 00000000000..d488f3faea6 --- /dev/null +++ b/reactos/lib/3rdparty/freetype/src/autofit/afblue.dat @@ -0,0 +1,218 @@ +// afblue.dat +// +// Auto-fitter data for blue strings. +// +// Copyright 2013 by +// David Turner, Robert Wilhelm, and Werner Lemberg. +// +// This file is part of the FreeType project, and may only be used, +// modified, and distributed under the terms of the FreeType project +// license, LICENSE.TXT. By continuing to use, modify, or distribute +// this file you indicate that you have read the license and +// understand and accept it fully. + + +// This file contains data specific to blue zones. It gets processed by +// a script to simulate `jagged arrays', with enumeration values holding +// offsets into the arrays. +// +// The format of the file is rather simple: A section starts with three +// labels separated by whitespace and followed by a colon (everything in a +// single line); the first label gives the name of the enumeration template, +// the second the name of the array template, and the third the name of the +// `maximum' template, holding the size of the largest array element. The +// script then fills the corresponding templates (indicated by `@' +// characters around the name). +// +// A section contains one or more data records. Each data record consists +// of two or more lines. The first line holds the enumeration name, and the +// remaining lines the corresponding array data. +// +// There are two possible representations for array data. +// +// - A string of characters in UTF-8 encoding enclosed in double quotes, +// using C syntax. There can be only one string per line, thus the +// starting and ending double quote must be the first and last character +// in the line, respectively, ignoring whitespace before and after the +// string. If there are multiple strings (in multiple lines), they are +// concatenated to a single string. In the output, a string gets +// represented as a series of singles bytes, followed by a zero byte. The +// enumeration values simply hold byte offsets to the start of the +// corresponding strings. +// +// - Data blocks enclosed in balanced braces, which get copied verbatim and +// which can span multiple lines. The opening brace of a block must be +// the first character of a line (ignoring whitespace), and the closing +// brace the last (ignoring whitespace also). The script appends a comma +// character after each block and counts the number of blocks to set the +// enumeration values. +// +// A section can contain either strings only or data blocks only. +// +// A comment line starts with `//'; it gets removed. A preprocessor +// directive line (using the standard syntax of `cpp') starts with `#' and +// gets copied verbatim to both the enumeration and the array. Whitespace +// outside of a string is insignificant. +// +// Preprocessor directives are ignored while the script computes maximum +// values; this essentially means that the maximum values can easily be too +// large. Given that the purpose of those values is to create local +// fixed-size arrays at compile time for further processing of the blue zone +// data, this isn't a problem. Note the the final zero byte of a string is +// not counted. Note also that the count holds the number of UTF-8 encoded +// characters, not bytes. + + +AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN: + + AF_BLUE_STRING_LATIN_CAPITAL_TOP + "THEZOCQS" + AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM + "HEZLOCUS" + AF_BLUE_STRING_LATIN_SMALL_F_TOP + "fijkdbh" + AF_BLUE_STRING_LATIN_SMALL + "xzroesc" + AF_BLUE_STRING_LATIN_SMALL_DESCENDER + "pqgjy" + + AF_BLUE_STRING_GREEK_CAPITAL_TOP + "ΓΒΕΖΘΟΩ" + AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM + "ΒΔΖΞΘΟ" + AF_BLUE_STRING_GREEK_SMALL_BETA_TOP + "βθδζλξ" + AF_BLUE_STRING_GREEK_SMALL + "αειοπστω" + AF_BLUE_STRING_GREEK_SMALL_DESCENDER + "βγημρφχψ" + + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP + "БВЕПЗОСЭ" + AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM + "БВЕШЗОСЭ" + AF_BLUE_STRING_CYRILLIC_SMALL + "хпншезос" + AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER + "руф" + + AF_BLUE_STRING_HEBREW_TOP + "בדהחךכםס" + AF_BLUE_STRING_HEBREW_BOTTOM + "בטכםסצ" + AF_BLUE_STRING_HEBREW_DESCENDER + "קךןףץ" + +#ifdef AF_CONFIG_OPTION_CJK + + AF_BLUE_STRING_CJK_TOP_FILL + "他们你來們到和地" + "对對就席我时時會" + "来為能舰說说这這" + "齊" + AF_BLUE_STRING_CJK_TOP_UNFILL + "军同已愿既星是景" + "民照现現理用置要" + "軍那配里開雷露面" + "顾" + AF_BLUE_STRING_CJK_BOTTOM_FILL + "个为人他以们你來" + "個們到和大对對就" + "我时時有来為要說" + "说" + AF_BLUE_STRING_CJK_BOTTOM_UNFILL + "主些因它想意理生" + "當看着置者自著裡" + "过还进進過道還里" + "面" + +#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT + + AF_BLUE_STRING_CJK_LEFT_FILL + "些们你來們到和地" + "她将將就年得情最" + "样樣理能說说这這" + "通" + AF_BLUE_STRING_CJK_LEFT_UNFILL + "即吗吧听呢品响嗎" + "师師收断斷明眼間" + "间际陈限除陳随際" + "隨" + AF_BLUE_STRING_CJK_RIGHT_FILL + "事前學将將情想或" + "政斯新样樣民沒没" + "然特现現球第經谁" + "起" + AF_BLUE_STRING_CJK_RIGHT_UNFILL + "例別别制动動吗嗎" + "增指明朝期构物确" + "种調调費费那都間" + "间" + +#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ + +#endif /* AF_CONFIG_OPTION_CJK */ + + +AF_BLUE_STRINGSET_ENUM AF_BLUE_STRINGSETS_ARRAY AF_BLUE_STRINGSET_MAX_LEN: + + AF_BLUE_STRINGSET_LATN + { AF_BLUE_STRING_LATIN_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_LATIN_SMALL_F_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_LATIN_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_LATIN_SMALL, 0 } + { AF_BLUE_STRING_LATIN_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_GREK + { AF_BLUE_STRING_GREEK_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_GREEK_SMALL_BETA_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_GREEK_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_GREEK_SMALL, 0 } + { AF_BLUE_STRING_GREEK_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_CYRL + { AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP, AF_BLUE_PROPERTY_LATIN_TOP } + { AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM, 0 } + { AF_BLUE_STRING_CYRILLIC_SMALL, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_X_HEIGHT } + { AF_BLUE_STRING_CYRILLIC_SMALL, 0 } + { AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + + AF_BLUE_STRINGSET_HEBR + { AF_BLUE_STRING_HEBREW_TOP, AF_BLUE_PROPERTY_LATIN_TOP | + AF_BLUE_PROPERTY_LATIN_LONG } + { AF_BLUE_STRING_HEBREW_BOTTOM, 0 } + { AF_BLUE_STRING_HEBREW_DESCENDER, 0 } + { AF_BLUE_STRING_MAX, 0 } + +#ifdef AF_CONFIG_OPTION_CJK + + AF_BLUE_STRINGSET_HANI + { AF_BLUE_STRING_CJK_TOP_FILL, AF_BLUE_PROPERTY_CJK_TOP | + AF_BLUE_PROPERTY_CJK_FILL } + { AF_BLUE_STRING_CJK_TOP_UNFILL, AF_BLUE_PROPERTY_CJK_TOP } + { AF_BLUE_STRING_CJK_BOTTOM_FILL, AF_BLUE_PROPERTY_CJK_FILL } + { AF_BLUE_STRING_CJK_BOTTOM_UNFILL, 0 } +#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT + { AF_BLUE_STRING_CJK_LEFT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ | + AF_BLUE_PROPERTY_CJK_FILL } + { AF_BLUE_STRING_CJK_LEFT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ } + { AF_BLUE_STRING_CJK_RIGHT_FILL, AF_BLUE_PROPERTY_CJK_HORIZ | + AF_BLUE_PROPERTY_CJK_RIGHT | + AF_BLUE_PROPERTY_CJK_FILL } + { AF_BLUE_STRING_CJK_RIGHT_UNFILL, AF_BLUE_PROPERTY_CJK_HORIZ | + AF_BLUE_PROPERTY_CJK_RIGHT } +#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ + { AF_BLUE_STRING_MAX, 0 } + +#endif /* AF_CONFIG_OPTION_CJK */ + + +// END diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afblue.h b/reactos/lib/3rdparty/freetype/src/autofit/afblue.h new file mode 100644 index 00000000000..86a36491faf --- /dev/null +++ b/reactos/lib/3rdparty/freetype/src/autofit/afblue.h @@ -0,0 +1,199 @@ +/* This file has been generated by the Perl script `afblue.pl', */ +/* using data from file `afblue.dat'. */ + +/***************************************************************************/ +/* */ +/* afblue.h */ +/* */ +/* Auto-fitter data for blue strings (specification). */ +/* */ +/* Copyright 2013 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __AFBLUE_H__ +#define __AFBLUE_H__ + + +FT_BEGIN_HEADER + + + /* an auxiliary macro to decode a UTF-8 character -- since we only use */ + /* hard-coded, self-converted data, no error checking is performed */ +#define GET_UTF8_CHAR( ch, p ) \ + ch = (unsigned char)*p++; \ + if ( ch >= 0x80 ) \ + { \ + FT_UInt len; \ + \ + \ + if ( ch < 0xE0 ) \ + { \ + len = 1; \ + ch &= 0x1F; \ + } \ + else if ( ch < 0xF0 ) \ + { \ + len = 2; \ + ch &= 0x0F; \ + } \ + else \ + { \ + len = 3; \ + ch &= 0x07; \ + } \ + \ + for ( ; len > 0; len-- ) \ + ch = ( ch << 6 ) | ( *p++ & 0x3F ); \ + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** B L U E S T R I N G S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* At the bottommost level, we define strings for finding blue zones. */ + + +#define AF_BLUE_STRING_MAX_LEN 25 + + /* The AF_Blue_String enumeration values are offsets into the */ + /* `af_blue_strings' array. */ + + typedef enum AF_Blue_String_ + { + AF_BLUE_STRING_LATIN_CAPITAL_TOP = 0, + AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 9, + AF_BLUE_STRING_LATIN_SMALL_F_TOP = 18, + AF_BLUE_STRING_LATIN_SMALL = 26, + AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 34, + AF_BLUE_STRING_GREEK_CAPITAL_TOP = 40, + AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 55, + AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 68, + AF_BLUE_STRING_GREEK_SMALL = 81, + AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 98, + AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 115, + AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 132, + AF_BLUE_STRING_CYRILLIC_SMALL = 149, + AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 166, + AF_BLUE_STRING_HEBREW_TOP = 173, + AF_BLUE_STRING_HEBREW_BOTTOM = 190, + AF_BLUE_STRING_HEBREW_DESCENDER = 203, + af_blue_1_1 = 213, +#ifdef AF_CONFIG_OPTION_CJK + AF_BLUE_STRING_CJK_TOP_FILL = af_blue_1_1 + 1, + AF_BLUE_STRING_CJK_TOP_UNFILL = af_blue_1_1 + 77, + AF_BLUE_STRING_CJK_BOTTOM_FILL = af_blue_1_1 + 153, + AF_BLUE_STRING_CJK_BOTTOM_UNFILL = af_blue_1_1 + 229, + af_blue_1_1_1 = af_blue_1_1 + 304, +#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT + AF_BLUE_STRING_CJK_LEFT_FILL = af_blue_1_1_1 + 1, + AF_BLUE_STRING_CJK_LEFT_UNFILL = af_blue_1_1_1 + 77, + AF_BLUE_STRING_CJK_RIGHT_FILL = af_blue_1_1_1 + 153, + AF_BLUE_STRING_CJK_RIGHT_UNFILL = af_blue_1_1_1 + 229, + af_blue_1_2_1 = af_blue_1_1_1 + 304, +#else + af_blue_1_2_1 = af_blue_1_1_1 + 0, +#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ + af_blue_1_2 = af_blue_1_2_1 + 0, +#else + af_blue_1_2 = af_blue_1_2_1 + 0, +#endif /* AF_CONFIG_OPTION_CJK */ + + + AF_BLUE_STRING_MAX /* do not remove */ + + } AF_Blue_String; + + + FT_LOCAL_ARRAY( char ) + af_blue_strings[]; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** B L U E S T R I N G S E T S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* The next level is to group blue strings into script-specific sets. */ + + + /* Properties are specific to a writing system. We assume that a given */ + /* blue string can't be used in more than a single writing system, which */ + /* is a safe bet. */ +#define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) +#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 1 ) +#define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 2 ) + +#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 0 ) +#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 1 ) +#define AF_BLUE_PROPERTY_CJK_FILL ( 1 << 2 ) +#define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP + + +#define AF_BLUE_STRINGSET_MAX_LEN 9 + + /* The AF_Blue_Stringset enumeration values are offsets into the */ + /* `af_blue_stringsets' array. */ + + typedef enum AF_Blue_Stringset_ + { + AF_BLUE_STRINGSET_LATN = 0, + AF_BLUE_STRINGSET_GREK = 7, + AF_BLUE_STRINGSET_CYRL = 14, + AF_BLUE_STRINGSET_HEBR = 20, + af_blue_2_1 = 24, +#ifdef AF_CONFIG_OPTION_CJK + AF_BLUE_STRINGSET_HANI = af_blue_2_1 + 0, + af_blue_2_1_1 = af_blue_2_1 + 4, +#ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT + af_blue_2_2_1 = af_blue_2_1_1 + 4, +#else + af_blue_2_2_1 = af_blue_2_1_1 + 0, +#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ + af_blue_2_2 = af_blue_2_2_1 + 1, +#else + af_blue_2_2 = af_blue_2_2_1 + 0, +#endif /* AF_CONFIG_OPTION_CJK */ + + + AF_BLUE_STRINGSET_MAX /* do not remove */ + + } AF_Blue_Stringset; + + + typedef struct AF_Blue_StringRec_ + { + AF_Blue_String string; + FT_UShort properties; + + } AF_Blue_StringRec; + + + FT_LOCAL_ARRAY( AF_Blue_StringRec ) + af_blue_stringsets[]; + +/* */ + +FT_END_HEADER + + +#endif /* __AFBLUE_H__ */ + + +/* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afblue.hin b/reactos/lib/3rdparty/freetype/src/autofit/afblue.hin new file mode 100644 index 00000000000..00282c3bad9 --- /dev/null +++ b/reactos/lib/3rdparty/freetype/src/autofit/afblue.hin @@ -0,0 +1,142 @@ +/***************************************************************************/ +/* */ +/* afblue.h */ +/* */ +/* Auto-fitter data for blue strings (specification). */ +/* */ +/* Copyright 2013 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __AFBLUE_H__ +#define __AFBLUE_H__ + + +FT_BEGIN_HEADER + + + /* an auxiliary macro to decode a UTF-8 character -- since we only use */ + /* hard-coded, self-converted data, no error checking is performed */ +#define GET_UTF8_CHAR( ch, p ) \ + ch = (unsigned char)*p++; \ + if ( ch >= 0x80 ) \ + { \ + FT_UInt len; \ + \ + \ + if ( ch < 0xE0 ) \ + { \ + len = 1; \ + ch &= 0x1F; \ + } \ + else if ( ch < 0xF0 ) \ + { \ + len = 2; \ + ch &= 0x0F; \ + } \ + else \ + { \ + len = 3; \ + ch &= 0x07; \ + } \ + \ + for ( ; len > 0; len-- ) \ + ch = ( ch << 6 ) | ( *p++ & 0x3F ); \ + } + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** B L U E S T R I N G S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* At the bottommost level, we define strings for finding blue zones. */ + + +#define AF_BLUE_STRING_MAX_LEN @AF_BLUE_STRING_MAX_LEN@ + + /* The AF_Blue_String enumeration values are offsets into the */ + /* `af_blue_strings' array. */ + + typedef enum AF_Blue_String_ + { +@AF_BLUE_STRING_ENUM@ + + AF_BLUE_STRING_MAX /* do not remove */ + + } AF_Blue_String; + + + FT_LOCAL_ARRAY( char ) + af_blue_strings[]; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** B L U E S T R I N G S E T S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* The next level is to group blue strings into script-specific sets. */ + + + /* Properties are specific to a writing system. We assume that a given */ + /* blue string can't be used in more than a single writing system, which */ + /* is a safe bet. */ +#define AF_BLUE_PROPERTY_LATIN_TOP ( 1 << 0 ) +#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1 << 1 ) +#define AF_BLUE_PROPERTY_LATIN_LONG ( 1 << 2 ) + +#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1 << 0 ) +#define AF_BLUE_PROPERTY_CJK_TOP ( 1 << 1 ) +#define AF_BLUE_PROPERTY_CJK_FILL ( 1 << 2 ) +#define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP + + +#define AF_BLUE_STRINGSET_MAX_LEN @AF_BLUE_STRINGSET_MAX_LEN@ + + /* The AF_Blue_Stringset enumeration values are offsets into the */ + /* `af_blue_stringsets' array. */ + + typedef enum AF_Blue_Stringset_ + { +@AF_BLUE_STRINGSET_ENUM@ + + AF_BLUE_STRINGSET_MAX /* do not remove */ + + } AF_Blue_Stringset; + + + typedef struct AF_Blue_StringRec_ + { + AF_Blue_String string; + FT_UShort properties; + + } AF_Blue_StringRec; + + + FT_LOCAL_ARRAY( AF_Blue_StringRec ) + af_blue_stringsets[]; + +/* */ + +FT_END_HEADER + + +#endif /* __AFBLUE_H__ */ + + +/* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afcjk.c b/reactos/lib/3rdparty/freetype/src/autofit/afcjk.c index f69a528e3b7..7a6f835516c 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afcjk.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afcjk.c @@ -26,7 +26,7 @@ #include FT_ADVANCES_H #include FT_INTERNAL_DEBUG_H -#include "aftypes.h" +#include "afglobal.h" #include "aflatin.h" @@ -73,6 +73,12 @@ AF_GlyphHintsRec hints[1]; + FT_TRACE5(( "\n" + "cjk standard widths computation (script `%s')\n" + "===============================================\n" + "\n", + af_script_names[metrics->root.script_class->script] )); + af_glyph_hints_init( hints, face->memory ); metrics->axis[AF_DIMENSION_HORZ].width_count = 0; @@ -86,11 +92,15 @@ AF_Scaler scaler = &dummy->root.scaler; - glyph_index = FT_Get_Char_Index( face, - metrics->root.clazz->standard_char ); + glyph_index = FT_Get_Char_Index( + face, + metrics->root.script_class->standard_char ); if ( glyph_index == 0 ) goto Exit; + FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n", + metrics->root.script_class->standard_char, glyph_index )); + error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); if ( error || face->glyph->outline.n_points <= 0 ) goto Exit; @@ -122,11 +132,13 @@ FT_UInt num_widths = 0; - error = af_latin_hints_compute_segments( hints, (AF_Dimension)dim ); + error = af_latin_hints_compute_segments( hints, + (AF_Dimension)dim ); if ( error ) goto Exit; - af_latin_hints_link_segments( hints, (AF_Dimension)dim ); + af_latin_hints_link_segments( hints, + (AF_Dimension)dim ); seg = axhints->segments; limit = seg + axhints->num_segments; @@ -151,7 +163,7 @@ } /* this also replaces multiple almost identical stem widths */ - /* with a single one (the value 100 is heuristic) */ + /* with a single one (the value 100 is heuristic) */ af_sort_and_quantize_widths( &num_widths, axis->widths, dummy->units_per_em / 100 ); axis->width_count = num_widths; @@ -171,263 +183,201 @@ axis->edge_distance_threshold = stdw / 5; axis->standard_width = stdw; axis->extra_light = 0; + +#ifdef FT_DEBUG_LEVEL_TRACE + { + FT_UInt i; + + + FT_TRACE5(( "%s widths:\n", + dim == AF_DIMENSION_VERT ? "horizontal" + : "vertical" )); + + FT_TRACE5(( " %d (standard)", axis->standard_width )); + for ( i = 1; i < axis->width_count; i++ ) + FT_TRACE5(( " %d", axis->widths[i].org )); + + FT_TRACE5(( "\n" )); + } +#endif } } + FT_TRACE5(( "\n" )); + af_glyph_hints_done( hints ); } -#define AF_CJK_MAX_TEST_CHARACTERS 32 - - - /* Each blue zone has two types of fill and unfill, this is, */ - /* filling the entire glyph square or not. */ - - enum - { - AF_CJK_BLUE_TYPE_FILL, - AF_CJK_BLUE_TYPE_UNFILL, - AF_CJK_BLUE_TYPE_MAX - }; - - - /* Put some common and representative Han Ideographs characters here. */ - static const FT_ULong af_cjk_hani_blue_chars[AF_CJK_BLUE_MAX] - [AF_CJK_BLUE_TYPE_MAX] - [AF_CJK_MAX_TEST_CHARACTERS] = - { - { - { - 0x4ED6, 0x4EEC, 0x4F60, 0x4F86, 0x5011, 0x5230, 0x548C, 0x5730, - 0x5BF9, 0x5C0D, 0x5C31, 0x5E2D, 0x6211, 0x65F6, 0x6642, 0x6703, - 0x6765, 0x70BA, 0x80FD, 0x8230, 0x8AAA, 0x8BF4, 0x8FD9, 0x9019, - 0x9F4A /* top fill */ - }, - { - 0x519B, 0x540C, 0x5DF2, 0x613F, 0x65E2, 0x661F, 0x662F, 0x666F, - 0x6C11, 0x7167, 0x73B0, 0x73FE, 0x7406, 0x7528, 0x7F6E, 0x8981, - 0x8ECD, 0x90A3, 0x914D, 0x91CC, 0x958B, 0x96F7, 0x9732, 0x9762, - 0x987E /* top unfill */ - } - }, - { - { - 0x4E2A, 0x4E3A, 0x4EBA, 0x4ED6, 0x4EE5, 0x4EEC, 0x4F60, 0x4F86, - 0x500B, 0x5011, 0x5230, 0x548C, 0x5927, 0x5BF9, 0x5C0D, 0x5C31, - 0x6211, 0x65F6, 0x6642, 0x6709, 0x6765, 0x70BA, 0x8981, 0x8AAA, - 0x8BF4 /* bottom fill */ - }, - { - 0x4E3B, 0x4E9B, 0x56E0, 0x5B83, 0x60F3, 0x610F, 0x7406, 0x751F, - 0x7576, 0x770B, 0x7740, 0x7F6E, 0x8005, 0x81EA, 0x8457, 0x88E1, - 0x8FC7, 0x8FD8, 0x8FDB, 0x9032, 0x904E, 0x9053, 0x9084, 0x91CC, - 0x9762 /* bottom unfill */ - } - }, -#ifndef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT - { {0x0000}, {0x0000} }, - { {0x0000}, {0x0000} } -#else - { - { - 0x4E9B, 0x4EEC, 0x4F60, 0x4F86, 0x5011, 0x5230, 0x548C, 0x5730, - 0x5979, 0x5C06, 0x5C07, 0x5C31, 0x5E74, 0x5F97, 0x60C5, 0x6700, - 0x6837, 0x6A23, 0x7406, 0x80FD, 0x8AAA, 0x8BF4, 0x8FD9, 0x9019, - 0x901A /* left fill */ - }, - { - 0x5373, 0x5417, 0x5427, 0x542C, 0x5462, 0x54C1, 0x54CD, 0x55CE, - 0x5E08, 0x5E2B, 0x6536, 0x65AD, 0x65B7, 0x660E, 0x773C, 0x9593, - 0x95F4, 0x9645, 0x9648, 0x9650, 0x9664, 0x9673, 0x968F, 0x969B, - 0x96A8 /* left unfill */ - } - }, - { - { - 0x4E8B, 0x524D, 0x5B78, 0x5C06, 0x5C07, 0x60C5, 0x60F3, 0x6216, - 0x653F, 0x65AF, 0x65B0, 0x6837, 0x6A23, 0x6C11, 0x6C92, 0x6CA1, - 0x7136, 0x7279, 0x73B0, 0x73FE, 0x7403, 0x7B2C, 0x7D93, 0x8C01, - 0x8D77 /* right fill */ - }, - { - 0x4F8B, 0x5225, 0x522B, 0x5236, 0x52A8, 0x52D5, 0x5417, 0x55CE, - 0x589E, 0x6307, 0x660E, 0x671D, 0x671F, 0x6784, 0x7269, 0x786E, - 0x79CD, 0x8ABF, 0x8C03, 0x8CBB, 0x8D39, 0x90A3, 0x90FD, 0x9593, - 0x95F4 /* right unfill */ - } - } -#endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */ - }; - - - /* Calculate blue zones for all the CJK_BLUE_XXX's. */ + /* Find all blue zones. */ static void - af_cjk_metrics_init_blues( AF_CJKMetrics metrics, - FT_Face face, - const FT_ULong blue_chars - [AF_CJK_BLUE_MAX] - [AF_CJK_BLUE_TYPE_MAX] - [AF_CJK_MAX_TEST_CHARACTERS] ) + af_cjk_metrics_init_blues( AF_CJKMetrics metrics, + FT_Face face ) { - FT_Pos fills[AF_CJK_MAX_TEST_CHARACTERS]; - FT_Pos flats[AF_CJK_MAX_TEST_CHARACTERS]; + FT_Pos fills[AF_BLUE_STRING_MAX_LEN]; + FT_Pos flats[AF_BLUE_STRING_MAX_LEN]; - FT_Int num_fills; - FT_Int num_flats; + FT_Int num_fills; + FT_Int num_flats; - FT_Int bb; - AF_CJKBlue blue; - FT_Error error; - AF_CJKAxis axis; - FT_GlyphSlot glyph = face->glyph; + AF_CJKBlue blue; + FT_Error error; + AF_CJKAxis axis; + FT_Outline outline; + + AF_Blue_Stringset bss = metrics->root.script_class->blue_stringset; + const AF_Blue_StringRec* bs = &af_blue_stringsets[bss]; #ifdef FT_DEBUG_LEVEL_TRACE - FT_String* cjk_blue_name[AF_CJK_BLUE_MAX] = { - (FT_String*)"top", - (FT_String*)"bottom", - (FT_String*)"left", - (FT_String*)"right" + FT_String* cjk_blue_name[4] = + { + (FT_String*)"bottom", /* -- , -- */ + (FT_String*)"top", /* -- , TOP */ + (FT_String*)"left", /* HORIZ, -- */ + (FT_String*)"right" /* HORIZ, TOP */ }; - FT_String* cjk_blue_type_name[AF_CJK_BLUE_TYPE_MAX] = { - (FT_String*)"filled", - (FT_String*)"unfilled" + + FT_String* cjk_blue_type_name[2] = + { + (FT_String*)"unfilled", /* -- */ + (FT_String*)"filled" /* FILL */ }; #endif - /* We compute the blues simply by loading each character from the */ - /* `blue_chars[blues]' string, then computing its extreme points */ - /* (depending blue zone type etc.). */ + /* we walk over the blue character strings as specified in the */ + /* script's entry in the `af_blue_stringset' array, computing its */ + /* extremum points (depending on the string properties) */ - FT_TRACE5(( "cjk blue zones computation\n" )); - FT_TRACE5(( "------------------------------------------------\n" )); + FT_TRACE5(( "cjk blue zones computation\n" + "==========================\n" + "\n" )); - for ( bb = 0; bb < AF_CJK_BLUE_MAX; bb++ ) + for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ ) { - FT_Int fill_type; - FT_Pos* blue_ref; - FT_Pos* blue_shoot; + const char* p = &af_blue_strings[bs->string]; + FT_Pos* blue_ref; + FT_Pos* blue_shoot; + if ( AF_CJK_IS_HORIZ_BLUE( bs ) ) + axis = &metrics->axis[AF_DIMENSION_HORZ]; + else + axis = &metrics->axis[AF_DIMENSION_VERT]; + + FT_TRACE5(( "blue zone %d:\n", axis->blue_count )); + num_fills = 0; num_flats = 0; - for ( fill_type = 0; fill_type < AF_CJK_BLUE_TYPE_MAX; fill_type++ ) + FT_TRACE5(( " cjk blue %s/%s\n", + cjk_blue_name[AF_CJK_IS_HORIZ_BLUE( bs ) | + AF_CJK_IS_TOP_BLUE( bs ) ], + cjk_blue_type_name[!!AF_CJK_IS_FILLED_BLUE( bs )] )); + + while ( *p ) { - const FT_ULong* p = blue_chars[bb][fill_type]; - const FT_ULong* limit = p + AF_CJK_MAX_TEST_CHARACTERS; - FT_Bool fill = FT_BOOL( - fill_type == AF_CJK_BLUE_TYPE_FILL ); + FT_ULong ch; + FT_UInt glyph_index; + FT_Pos best_pos; /* same as points.y or points.x, resp. */ + FT_Int best_point; + FT_Vector* points; - FT_TRACE5(( "cjk blue %s/%s\n", cjk_blue_name[bb], - cjk_blue_type_name[fill_type] )); + GET_UTF8_CHAR( ch, p ); - - for ( ; p < limit && *p; p++ ) + /* load the character in the face -- skip unknown or empty ones */ + glyph_index = FT_Get_Char_Index( face, ch ); + if ( glyph_index == 0 ) { - FT_UInt glyph_index; - FT_Pos best_pos; /* same as points.y */ - FT_Int best_point; - FT_Vector* points; + FT_TRACE5(( " U+%04lX unavailable\n", ch )); + continue; + } + + error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); + outline = face->glyph->outline; + if ( error || outline.n_points <= 0 ) + { + FT_TRACE5(( " U+%04lX contains no outlines\n", ch )); + continue; + } + + /* now compute min or max point indices and coordinates */ + points = outline.points; + best_point = -1; + best_pos = 0; /* make compiler happy */ + + { + FT_Int nn; + FT_Int first = 0; + FT_Int last = -1; - FT_TRACE5(( " U+%lX...", *p )); - - /* load the character in the face -- skip unknown or empty ones */ - glyph_index = FT_Get_Char_Index( face, *p ); - if ( glyph_index == 0 ) + for ( nn = 0; nn < outline.n_contours; first = last + 1, nn++ ) { - FT_TRACE5(( "unavailable\n" )); - continue; - } - - error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); - if ( error || glyph->outline.n_points <= 0 ) - { - FT_TRACE5(( "no outline\n" )); - continue; - } - - /* now compute min or max point indices and coordinates */ - points = glyph->outline.points; - best_point = -1; - best_pos = 0; /* make compiler happy */ - - { - FT_Int nn; - FT_Int first = 0; - FT_Int last = -1; + FT_Int pp; - for ( nn = 0; - nn < glyph->outline.n_contours; - first = last + 1, nn++ ) + last = outline.contours[nn]; + + /* Avoid single-point contours since they are never rasterized. */ + /* In some fonts, they correspond to mark attachment points */ + /* which are way outside of the glyph's real outline. */ + if ( last <= first ) + continue; + + if ( AF_CJK_IS_HORIZ_BLUE( bs ) ) { - FT_Int pp; - - - last = glyph->outline.contours[nn]; - - /* Avoid single-point contours since they are never */ - /* rasterized. In some fonts, they correspond to mark */ - /* attachment points which are way outside of the glyph's */ - /* real outline. */ - if ( last <= first ) - continue; - - switch ( bb ) + if ( AF_CJK_IS_RIGHT_BLUE( bs ) ) { - case AF_CJK_BLUE_TOP: - for ( pp = first; pp <= last; pp++ ) - if ( best_point < 0 || points[pp].y > best_pos ) - { - best_point = pp; - best_pos = points[pp].y; - } - break; - - case AF_CJK_BLUE_BOTTOM: - for ( pp = first; pp <= last; pp++ ) - if ( best_point < 0 || points[pp].y < best_pos ) - { - best_point = pp; - best_pos = points[pp].y; - } - break; - - case AF_CJK_BLUE_LEFT: - for ( pp = first; pp <= last; pp++ ) - if ( best_point < 0 || points[pp].x < best_pos ) - { - best_point = pp; - best_pos = points[pp].x; - } - break; - - case AF_CJK_BLUE_RIGHT: for ( pp = first; pp <= last; pp++ ) if ( best_point < 0 || points[pp].x > best_pos ) { best_point = pp; best_pos = points[pp].x; } - break; - - default: - ; + } + else + { + for ( pp = first; pp <= last; pp++ ) + if ( best_point < 0 || points[pp].x < best_pos ) + { + best_point = pp; + best_pos = points[pp].x; + } + } + } + else + { + if ( AF_CJK_IS_TOP_BLUE( bs ) ) + { + for ( pp = first; pp <= last; pp++ ) + if ( best_point < 0 || points[pp].y > best_pos ) + { + best_point = pp; + best_pos = points[pp].y; + } + } + else + { + for ( pp = first; pp <= last; pp++ ) + if ( best_point < 0 || points[pp].y < best_pos ) + { + best_point = pp; + best_pos = points[pp].y; + } } } - FT_TRACE5(( "best_pos=%5ld\n", best_pos )); } - if ( fill ) - fills[num_fills++] = best_pos; - else - flats[num_flats++] = best_pos; + FT_TRACE5(( " U+%04lX: best_pos = %5ld\n", ch, best_pos )); } + + if ( AF_CJK_IS_FILLED_BLUE( bs ) ) + fills[num_fills++] = best_pos; + else + flats[num_flats++] = best_pos; } if ( num_flats == 0 && num_fills == 0 ) @@ -436,34 +386,30 @@ * we couldn't find a single glyph to compute this blue zone, * we will simply ignore it then */ - FT_TRACE5(( "empty\n" )); + FT_TRACE5(( " empty\n" )); continue; } /* we have computed the contents of the `fill' and `flats' tables, */ - /* now determine the reference position of the blue -- */ + /* now determine the reference position of the blue zone -- */ /* we simply take the median value after a simple sort */ af_sort_pos( num_flats, flats ); af_sort_pos( num_fills, fills ); - if ( AF_CJK_BLUE_TOP == bb || AF_CJK_BLUE_BOTTOM == bb ) - axis = &metrics->axis[AF_DIMENSION_VERT]; - else - axis = &metrics->axis[AF_DIMENSION_HORZ]; - - blue = & axis->blues[axis->blue_count]; - blue_ref = & blue->ref.org; - blue_shoot = & blue->shoot.org; + blue = &axis->blues[axis->blue_count]; + blue_ref = &blue->ref.org; + blue_shoot = &blue->shoot.org; axis->blue_count++; + if ( num_flats == 0 ) { - *blue_ref = fills[num_fills / 2]; + *blue_ref = *blue_shoot = fills[num_fills / 2]; } else if ( num_fills == 0 ) { - *blue_ref = flats[num_flats / 2]; + *blue_ref = *blue_shoot = flats[num_flats / 2]; } else @@ -481,26 +427,34 @@ FT_Bool under_ref = FT_BOOL( shoot < ref ); - if ( ( AF_CJK_BLUE_TOP == bb || - AF_CJK_BLUE_RIGHT == bb ) ^ under_ref ) - *blue_shoot = *blue_ref = ( shoot + ref ) / 2; + /* AF_CJK_IS_TOP_BLUE covers `right' and `top' */ + if ( AF_CJK_IS_TOP_BLUE( bs ) ^ under_ref ) + { + *blue_ref = + *blue_shoot = ( shoot + ref ) / 2; + + FT_TRACE5(( " [overshoot smaller than reference," + " taking mean value]\n" )); + } } blue->flags = 0; - if ( AF_CJK_BLUE_TOP == bb ) - blue->flags |= AF_CJK_BLUE_IS_TOP; - else if ( AF_CJK_BLUE_RIGHT == bb ) - blue->flags |= AF_CJK_BLUE_IS_RIGHT; + if ( AF_CJK_IS_TOP_BLUE( bs ) ) + blue->flags |= AF_CJK_BLUE_TOP; - FT_TRACE5(( "-- cjk %s bluezone ref = %ld shoot = %ld\n", - cjk_blue_name[bb], *blue_ref, *blue_shoot )); + FT_TRACE5(( " -> reference = %ld\n" + " overshoot = %ld\n", + *blue_ref, *blue_shoot )); } + FT_TRACE5(( "\n" )); + return; } /* Basically the Latin version with type AF_CJKMetrics for metrics. */ + FT_LOCAL_DEF( void ) af_cjk_metrics_check_digits( AF_CJKMetrics metrics, FT_Face face ) @@ -510,8 +464,7 @@ FT_Fixed advance, old_advance = 0; - /* check whether all ASCII digits have the same advance width; */ - /* digit `0' is 0x30 in all supported charmaps */ + /* digit `0' is 0x30 in all supported charmaps */ for ( i = 0x30; i <= 0x39; i++ ) { FT_UInt glyph_index; @@ -547,6 +500,8 @@ } + /* Initialize global metrics. */ + FT_LOCAL_DEF( FT_Error ) af_cjk_metrics_init( AF_CJKMetrics metrics, FT_Face face ) @@ -556,21 +511,21 @@ metrics->units_per_em = face->units_per_EM; - if ( FT_Select_Charmap( face, FT_ENCODING_UNICODE ) ) - face->charmap = NULL; - else + if ( !FT_Select_Charmap( face, FT_ENCODING_UNICODE ) ) { af_cjk_metrics_init_widths( metrics, face ); - af_cjk_metrics_init_blues( metrics, face, af_cjk_hani_blue_chars ); + af_cjk_metrics_init_blues( metrics, face ); af_cjk_metrics_check_digits( metrics, face ); } FT_Set_Charmap( face, oldmap ); - return FT_Err_Ok; } + /* Adjust scaling value, then scale and shift widths */ + /* and blue zones (if applicable) for given dimension. */ + static void af_cjk_metrics_scale_dim( AF_CJKMetrics metrics, AF_Scaler scaler, @@ -582,8 +537,6 @@ FT_UInt nn; - axis = &metrics->axis[dim]; - if ( dim == AF_DIMENSION_HORZ ) { scale = scaler->x_scale; @@ -595,6 +548,8 @@ delta = scaler->y_delta; } + axis = &metrics->axis[dim]; + if ( axis->org_scale == scale && axis->org_delta == delta ) return; @@ -650,12 +605,13 @@ blue->shoot.fit = blue->ref.fit - delta2; - FT_TRACE5(( ">> active cjk blue zone %c%d[%ld/%ld]: " - "ref: cur=%.2f fit=%.2f shoot: cur=%.2f fit=%.2f\n", - ( dim == AF_DIMENSION_HORZ ) ? 'H' : 'V', - nn, blue->ref.org, blue->shoot.org, - blue->ref.cur / 64.0, blue->ref.fit / 64.0, - blue->shoot.cur / 64.0, blue->shoot.fit / 64.0 )); + FT_TRACE5(( ">> active cjk blue zone %c%d[%ld/%ld]:\n" + " ref: cur=%.2f fit=%.2f\n" + " shoot: cur=%.2f fit=%.2f\n", + ( dim == AF_DIMENSION_HORZ ) ? 'H' : 'V', + nn, blue->ref.org, blue->shoot.org, + blue->ref.cur / 64.0, blue->ref.fit / 64.0, + blue->shoot.cur / 64.0, blue->shoot.fit / 64.0 )); blue->flags |= AF_CJK_BLUE_ACTIVE; } @@ -663,10 +619,14 @@ } + /* Scale global values in both directions. */ + FT_LOCAL_DEF( void ) af_cjk_metrics_scale( AF_CJKMetrics metrics, AF_Scaler scaler ) { + /* we copy the whole structure since the x and y scaling values */ + /* are not modified, contrary to e.g. the `latin' auto-hinter */ metrics->root.scaler = *scaler; af_cjk_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ ); @@ -682,6 +642,9 @@ /*************************************************************************/ /*************************************************************************/ + + /* Walk over all contours and compute its segments. */ + static FT_Error af_cjk_hints_compute_segments( AF_GlyphHints hints, AF_Dimension dim ) @@ -938,7 +901,7 @@ for ( seg = segments; seg < segment_limit; seg++ ) { - AF_Edge found = 0; + AF_Edge found = NULL; FT_Pos best = 0xFFFFU; FT_Int ee; @@ -1026,25 +989,26 @@ } } - /*********************************************************************/ - /* */ - /* Good, we now compute each edge's properties according to segments */ - /* found on its position. Basically, these are as follows. */ - /* */ - /* - edge's main direction */ - /* - stem edge, serif edge or both (which defaults to stem then) */ - /* - rounded edge, straight or both (which defaults to straight) */ - /* - link for edge */ - /* */ - /*********************************************************************/ + /******************************************************************/ + /* */ + /* Good, we now compute each edge's properties according to the */ + /* segments found on its position. Basically, these are */ + /* */ + /* - the edge's main direction */ + /* - stem edge, serif edge or both (which defaults to stem then) */ + /* - rounded edge, straight or both (which defaults to straight) */ + /* - link for edge */ + /* */ + /******************************************************************/ - /* first of all, set the `edge' field in each segment -- this is */ - /* required in order to compute edge links */ - /* */ - /* Note that removing this loop and setting the `edge' field of each */ - /* segment directly in the code above slows down execution speed for */ - /* some reasons on platforms like the Sun. */ + /* first of all, set the `edge' field in each segment -- this is */ + /* required in order to compute edge links */ + /* + * Note that removing this loop and setting the `edge' field of each + * segment directly in the code above slows down execution speed for + * some reasons on platforms like the Sun. + */ { AF_Edge edges = axis->edges; AF_Edge edge_limit = edges + axis->num_edges; @@ -1153,6 +1117,8 @@ } + /* Detect segments and edges for given dimension. */ + static FT_Error af_cjk_hints_detect_features( AF_GlyphHints hints, AF_Dimension dim ) @@ -1171,6 +1137,8 @@ } + /* Compute all edges which lie within blue zones. */ + FT_LOCAL_DEF( void ) af_cjk_hints_compute_blue_edges( AF_GlyphHints hints, AF_CJKMetrics metrics, @@ -1218,10 +1186,8 @@ /* zone, check for left edges */ /* */ /* of course, that's for TrueType */ - is_top_right_blue = - FT_BOOL( ( ( blue->flags & AF_CJK_BLUE_IS_TOP ) != 0 ) || - ( ( blue->flags & AF_CJK_BLUE_IS_RIGHT ) != 0 ) ); - is_major_dir = FT_BOOL( edge->dir == axis->major_dir ); + is_top_right_blue = FT_BOOL( blue->flags & AF_CJK_BLUE_TOP ); + is_major_dir = FT_BOOL( edge->dir == axis->major_dir ); /* if it is a top zone, the edge must be against the major */ /* direction; if it is a bottom zone, it must be in the major */ @@ -1258,6 +1224,8 @@ } + /* Initalize hinting engine. */ + FT_LOCAL_DEF( FT_Error ) af_cjk_hints_init( AF_GlyphHints hints, AF_CJKMetrics metrics ) @@ -1316,7 +1284,7 @@ hints->scaler_flags = scaler_flags; hints->other_flags = other_flags; - return 0; + return FT_Err_Ok; } @@ -1328,8 +1296,8 @@ /*************************************************************************/ /*************************************************************************/ - /* snap a given width in scaled coordinates to one of the */ - /* current standard widths */ + /* Snap a given width in scaled coordinates to one of the */ + /* current standard widths. */ static FT_Pos af_cjk_snap_width( AF_Width widths, @@ -1376,7 +1344,9 @@ } - /* compute the snapped width of a given stem */ + /* Compute the snapped width of a given stem. */ + /* There is a lot of voodoo in this function; changing the hard-coded */ + /* parameters influence the whole hinting process. */ static FT_Pos af_cjk_compute_stem_width( AF_GlyphHints hints, @@ -1385,8 +1355,8 @@ AF_Edge_Flags base_flags, AF_Edge_Flags stem_flags ) { - AF_CJKMetrics metrics = (AF_CJKMetrics) hints->metrics; - AF_CJKAxis axis = & metrics->axis[dim]; + AF_CJKMetrics metrics = (AF_CJKMetrics)hints->metrics; + AF_CJKAxis axis = &metrics->axis[dim]; FT_Pos dist = width; FT_Int sign = 0; FT_Bool vertical = FT_BOOL( dim == AF_DIMENSION_VERT ); @@ -1497,7 +1467,7 @@ } - /* align one stem edge relative to the previous stem edge */ + /* Align one stem edge relative to the previous stem edge. */ static void af_cjk_align_linked_edge( AF_GlyphHints hints, @@ -1517,6 +1487,9 @@ } + /* Shift the coordinates of the `serif' edge by the same amount */ + /* as the corresponding `base' edge has been moved already. */ + static void af_cjk_align_serif_edge( AF_GlyphHints hints, AF_Edge base, @@ -1670,6 +1643,8 @@ } + /* The main grid-fitting routine. */ + static void af_cjk_hint_edges( AF_GlyphHints hints, AF_Dimension dim ) @@ -1685,10 +1660,16 @@ FT_Bool has_last_stem = FALSE; FT_Pos last_stem_pos = 0; +#ifdef FT_DEBUG_LEVEL_TRACE + FT_UInt num_actions = 0; +#endif + + + FT_TRACE5(( "cjk %s edge hinting (script `%s')\n", + dim == AF_DIMENSION_VERT ? "horizontal" : "vertical", + af_script_names[hints->metrics->script_class->script] )); /* we begin by aligning all stems relative to the blue zone */ - FT_TRACE5(( "==== cjk hinting %s edges =====\n", - dim == AF_DIMENSION_HORZ ? "vertical" : "horizontal" )); if ( AF_HINTS_DO_BLUES( hints ) ) { @@ -1719,10 +1700,14 @@ if ( !edge1 ) continue; - FT_TRACE5(( "CJKBLUE: edge %d @%d (opos=%.2f) snapped to (%.2f), " - "was (%.2f)\n", - edge1-edges, edge1->fpos, edge1->opos / 64.0, blue->fit / 64.0, - edge1->pos / 64.0 )); +#ifdef FT_DEBUG_LEVEL_TRACE + FT_TRACE5(( " CJKBLUE: edge %d @%d (opos=%.2f) snapped to %.2f," + " was %.2f\n", + edge1 - edges, edge1->fpos, edge1->opos / 64.0, + blue->fit / 64.0, edge1->pos / 64.0 )); + + num_actions++; +#endif edge1->pos = blue->fit; edge1->flags |= AF_EDGE_DONE; @@ -1731,6 +1716,10 @@ { af_cjk_align_linked_edge( hints, dim, edge1, edge2 ); edge2->flags |= AF_EDGE_DONE; + +#ifdef FT_DEBUG_LEVEL_TRACE + num_actions++; +#endif } if ( !anchor ) @@ -1772,6 +1761,7 @@ } /* now align the stem */ + /* this should not happen, but it's better to be safe */ if ( edge2->blue_edge ) { @@ -1779,6 +1769,11 @@ af_cjk_align_linked_edge( hints, dim, edge2, edge ); edge->flags |= AF_EDGE_DONE; + +#ifdef FT_DEBUG_LEVEL_TRACE + num_actions++; +#endif + continue; } @@ -1786,6 +1781,11 @@ { af_cjk_align_linked_edge( hints, dim, edge2, edge ); edge->flags |= AF_EDGE_DONE; + +#ifdef FT_DEBUG_LEVEL_TRACE + num_actions++; +#endif + /* We rarely reaches here it seems; * usually the two edges belonging * to one stem are marked as DONE together @@ -1953,7 +1953,7 @@ } if ( !skipped ) - return; + goto Exit; /* * now hint the remaining edges (serifs and single) in order @@ -1973,7 +1973,7 @@ } if ( !skipped ) - return; + goto Exit; for ( edge = edges; edge < edge_limit; edge++ ) { @@ -2011,6 +2011,16 @@ } } } + + Exit: + +#ifdef FT_DEBUG_LEVEL_TRACE + if ( !num_actions ) + FT_TRACE5(( " (none)\n" )); + FT_TRACE5(( "\n" )); +#endif + + return; } @@ -2104,6 +2114,8 @@ } + /* Apply the complete hinting algorithm to a CJK glyph. */ + FT_LOCAL_DEF( FT_Error ) af_cjk_hints_apply( AF_GlyphHints hints, FT_Outline* outline, @@ -2191,9 +2203,28 @@ /*************************************************************************/ + AF_DEFINE_WRITING_SYSTEM_CLASS( + af_cjk_writing_system_class, + + AF_WRITING_SYSTEM_CJK, + + sizeof ( AF_CJKMetricsRec ), + + (AF_Script_InitMetricsFunc) af_cjk_metrics_init, + (AF_Script_ScaleMetricsFunc)af_cjk_metrics_scale, + (AF_Script_DoneMetricsFunc) NULL, + + (AF_Script_InitHintsFunc) af_cjk_hints_init, + (AF_Script_ApplyHintsFunc) af_cjk_hints_apply + ) + + /* this corresponds to Unicode 6.0 */ - static const AF_Script_UniRangeRec af_cjk_uniranges[] = + /* XXX: this should probably fine tuned to differentiate better between */ + /* scripts... */ + + static const AF_Script_UniRangeRec af_hani_uniranges[] = { AF_UNIRANGE_REC( 0x1100UL, 0x11FFUL ), /* Hangul Jamo */ AF_UNIRANGE_REC( 0x2E80UL, 0x2EFFUL ), /* CJK Radicals Supplement */ @@ -2231,33 +2262,12 @@ }; - AF_DEFINE_SCRIPT_CLASS( af_cjk_script_class, - AF_SCRIPT_CJK, - af_cjk_uniranges, - 0x7530, /* 田 */ - - sizeof ( AF_CJKMetricsRec ), - - (AF_Script_InitMetricsFunc) af_cjk_metrics_init, - (AF_Script_ScaleMetricsFunc)af_cjk_metrics_scale, - (AF_Script_DoneMetricsFunc) NULL, - - (AF_Script_InitHintsFunc) af_cjk_hints_init, - (AF_Script_ApplyHintsFunc) af_cjk_hints_apply - ) - #else /* !AF_CONFIG_OPTION_CJK */ - static const AF_Script_UniRangeRec af_cjk_uniranges[] = - { - AF_UNIRANGE_REC( 0UL, 0UL ) - }; + AF_DEFINE_WRITING_SYSTEM_CLASS( + af_cjk_writing_system_class, - - AF_DEFINE_SCRIPT_CLASS( af_cjk_script_class, - AF_SCRIPT_CJK, - af_cjk_uniranges, - 0, + AF_WRITING_SYSTEM_CJK, sizeof ( AF_CJKMetricsRec ), @@ -2269,7 +2279,25 @@ (AF_Script_ApplyHintsFunc) NULL ) + + static const AF_Script_UniRangeRec af_hani_uniranges[] = + { + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + #endif /* !AF_CONFIG_OPTION_CJK */ + AF_DEFINE_SCRIPT_CLASS( + af_hani_script_class, + + AF_SCRIPT_HANI, + AF_BLUE_STRINGSET_HANI, + AF_WRITING_SYSTEM_CJK, + + af_hani_uniranges, + 0x7530 /* 田 */ + ) + + /* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afcjk.h b/reactos/lib/3rdparty/freetype/src/autofit/afcjk.h index ab816f20b1e..6f5bdc53d99 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afcjk.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/afcjk.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for CJK script (specification). */ /* */ -/* Copyright 2006, 2007, 2011, 2012 by */ +/* Copyright 2006, 2007, 2011-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -26,39 +26,48 @@ FT_BEGIN_HEADER - /* the CJK-specific script class */ + /* the CJK-specific writing system */ - AF_DECLARE_SCRIPT_CLASS( af_cjk_script_class ) + AF_DECLARE_WRITING_SYSTEM_CLASS( af_cjk_writing_system_class ) + + + /* the CJK-specific script classes */ + + AF_DECLARE_SCRIPT_CLASS( af_hani_script_class ) + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** C J K G L O B A L M E T R I C S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ - /* CJK (global) metrics management */ /* * CJK glyphs tend to fill the square. So we have both vertical and * horizontal blue zones. But some glyphs have flat bounding strokes that * leave some space between neighbour glyphs. */ - enum - { - AF_CJK_BLUE_TOP, - AF_CJK_BLUE_BOTTOM, - AF_CJK_BLUE_LEFT, - AF_CJK_BLUE_RIGHT, - - AF_CJK_BLUE_MAX - }; +#define AF_CJK_IS_TOP_BLUE( b ) \ + ( (b)->properties & AF_BLUE_PROPERTY_CJK_TOP ) +#define AF_CJK_IS_HORIZ_BLUE( b ) \ + ( (b)->properties & AF_BLUE_PROPERTY_CJK_HORIZ ) +#define AF_CJK_IS_FILLED_BLUE( b ) \ + ( (b)->properties & AF_BLUE_PROPERTY_CJK_FILL ) +#define AF_CJK_IS_RIGHT_BLUE AF_CJK_IS_TOP_BLUE #define AF_CJK_MAX_WIDTHS 16 -#define AF_CJK_MAX_BLUES AF_CJK_BLUE_MAX enum { - AF_CJK_BLUE_ACTIVE = 1 << 0, - AF_CJK_BLUE_IS_TOP = 1 << 1, - AF_CJK_BLUE_IS_RIGHT = 1 << 2, - AF_CJK_BLUE_ADJUSTMENT = 1 << 3, /* used for scale adjustment */ - /* optimization */ + AF_CJK_BLUE_ACTIVE = 1 << 0, /* set if zone height is <= 3/4px */ + AF_CJK_BLUE_TOP = 1 << 1, /* result of AF_CJK_IS_TOP_BLUE */ + AF_CJK_BLUE_ADJUSTMENT = 1 << 2, /* used for scale adjustment */ + /* optimization */ AF_CJK_BLUE_FLAG_MAX }; @@ -77,16 +86,16 @@ FT_BEGIN_HEADER FT_Fixed scale; FT_Pos delta; - FT_UInt width_count; - AF_WidthRec widths[AF_CJK_MAX_WIDTHS]; - FT_Pos edge_distance_threshold; - FT_Pos standard_width; - FT_Bool extra_light; + FT_UInt width_count; /* number of used widths */ + AF_WidthRec widths[AF_CJK_MAX_WIDTHS]; /* widths array */ + FT_Pos edge_distance_threshold; /* used for creating edges */ + FT_Pos standard_width; /* the default stem thickness */ + FT_Bool extra_light; /* is standard width very light? */ /* used for horizontal metrics too for CJK */ FT_Bool control_overshoot; FT_UInt blue_count; - AF_CJKBlueRec blues[AF_CJK_BLUE_MAX]; + AF_CJKBlueRec blues[AF_BLUE_STRINGSET_MAX]; FT_Fixed org_scale; FT_Pos org_delta; diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afdummy.c b/reactos/lib/3rdparty/freetype/src/autofit/afdummy.c index 22944559da0..aaa034d9f92 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afdummy.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afdummy.c @@ -26,8 +26,13 @@ af_dummy_hints_init( AF_GlyphHints hints, AF_ScriptMetrics metrics ) { - af_glyph_hints_rescale( hints, - metrics ); + af_glyph_hints_rescale( hints, metrics ); + + hints->x_scale = metrics->scaler.x_scale; + hints->y_scale = metrics->scaler.y_scale; + hints->x_delta = metrics->scaler.x_delta; + hints->y_delta = metrics->scaler.y_delta; + return FT_Err_Ok; } @@ -36,17 +41,21 @@ af_dummy_hints_apply( AF_GlyphHints hints, FT_Outline* outline ) { - FT_UNUSED( hints ); - FT_UNUSED( outline ); + FT_Error error; - return FT_Err_Ok; + + error = af_glyph_hints_reload( hints, outline ); + if ( !error ) + af_glyph_hints_save( hints, outline ); + + return error; } - AF_DEFINE_SCRIPT_CLASS( af_dummy_script_class, - AF_SCRIPT_DUMMY, - NULL, - 0, + AF_DEFINE_WRITING_SYSTEM_CLASS( + af_dummy_writing_system_class, + + AF_WRITING_SYSTEM_DUMMY, sizeof ( AF_ScriptMetricsRec ), @@ -59,4 +68,16 @@ ) + AF_DEFINE_SCRIPT_CLASS( + af_dflt_script_class, + + AF_SCRIPT_DFLT, + (AF_Blue_Stringset)0, + AF_WRITING_SYSTEM_DUMMY, + + NULL, + '\0' + ) + + /* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afdummy.h b/reactos/lib/3rdparty/freetype/src/autofit/afdummy.h index 95d8f8cf190..bc34dddaf90 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afdummy.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/afdummy.h @@ -5,7 +5,7 @@ /* Auto-fitter dummy routines to be used if no hinting should be */ /* performed (specification). */ /* */ -/* Copyright 2003-2005, 2011 by */ +/* Copyright 2003-2005, 2011, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -25,11 +25,13 @@ FT_BEGIN_HEADER - /* A dummy script metrics class used when no hinting should - * be performed. This is the default for non-latin glyphs! + /* A dummy writing system and script class used when no hinting should be + * performed. */ - AF_DECLARE_SCRIPT_CLASS( af_dummy_script_class ) + AF_DECLARE_WRITING_SYSTEM_CLASS( af_dummy_writing_system_class ) + + AF_DECLARE_SCRIPT_CLASS( af_dflt_script_class ) /* */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afglobal.c b/reactos/lib/3rdparty/freetype/src/autofit/afglobal.c index 3e41465756b..dc62bd7a1f5 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afglobal.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afglobal.c @@ -17,39 +17,64 @@ #include "afglobal.h" -#include "afdummy.h" -#include "aflatin.h" -#include "afcjk.h" -#include "afindic.h" -#include "afpic.h" + + /* get writing system specific header files */ +#undef WRITING_SYSTEM +#define WRITING_SYSTEM( ws, WS ) /* empty */ +#include "afwrtsys.h" #include "aferrors.h" +#include "afpic.h" -#ifdef FT_OPTION_AUTOFIT2 -#include "aflatin2.h" -#endif #ifndef FT_CONFIG_OPTION_PIC - /* when updating this table, don't forget to update */ - /* AF_SCRIPT_CLASSES_COUNT and autofit_module_class_pic_init */ +#undef WRITING_SYSTEM +#define WRITING_SYSTEM( ws, WS ) \ + &af_ ## ws ## _writing_system_class, - /* populate this list when you add new scripts */ - static AF_ScriptClass const af_script_classes[] = + FT_LOCAL_ARRAY_DEF( AF_WritingSystemClass ) + af_writing_system_classes[] = { - &af_dummy_script_class, -#ifdef FT_OPTION_AUTOFIT2 - &af_latin2_script_class, -#endif - &af_latin_script_class, - &af_cjk_script_class, - &af_indic_script_class, + +#include "afwrtsys.h" + + NULL /* do not remove */ + }; + + +#undef SCRIPT +#define SCRIPT( s, S, d ) \ + &af_ ## s ## _script_class, + + FT_LOCAL_ARRAY_DEF( AF_ScriptClass ) + af_script_classes[] = + { + +#include "afscript.h" + NULL /* do not remove */ }; #endif /* !FT_CONFIG_OPTION_PIC */ +#ifdef FT_DEBUG_LEVEL_TRACE + +#undef SCRIPT +#define SCRIPT( s, S, d ) #s, + + FT_LOCAL_ARRAY_DEF( char* ) + af_script_names[] = + { + +#include "afscript.h" + + }; + +#endif /* FT_DEBUG_LEVEL_TRACE */ + + /* Compute the script index of each glyph within a given face. */ static FT_Error @@ -82,18 +107,20 @@ /* scan each script in a Unicode charmap */ for ( ss = 0; AF_SCRIPT_CLASSES_GET[ss]; ss++ ) { - AF_ScriptClass clazz = AF_SCRIPT_CLASSES_GET[ss]; + AF_ScriptClass script_class = AF_SCRIPT_CLASSES_GET[ss]; AF_Script_UniRange range; - if ( clazz->script_uni_ranges == NULL ) + if ( script_class->script_uni_ranges == NULL ) continue; /* * Scan all Unicode points in the range and set the corresponding * glyph script index. */ - for ( range = clazz->script_uni_ranges; range->first != 0; range++ ) + for ( range = script_class->script_uni_ranges; + range->first != 0; + range++ ) { FT_ULong charcode = range->first; FT_UInt gindex; @@ -204,13 +231,14 @@ { if ( globals->metrics[nn] ) { - AF_ScriptClass clazz = AF_SCRIPT_CLASSES_GET[nn]; + AF_ScriptClass script_class = + AF_SCRIPT_CLASSES_GET[nn]; + AF_WritingSystemClass writing_system_class = + AF_WRITING_SYSTEM_CLASSES_GET[script_class->writing_system]; - FT_ASSERT( globals->metrics[nn]->clazz == clazz ); - - if ( clazz->script_metrics_done ) - clazz->script_metrics_done( globals->metrics[nn] ); + if ( writing_system_class->script_metrics_done ) + writing_system_class->script_metrics_done( globals->metrics[nn] ); FT_FREE( globals->metrics[nn] ); } @@ -232,12 +260,12 @@ AF_ScriptMetrics *ametrics ) { AF_ScriptMetrics metrics = NULL; - FT_UInt gidx; - AF_ScriptClass clazz; - FT_UInt script = options & 15; - const FT_Offset script_max = sizeof ( AF_SCRIPT_CLASSES_GET ) / - sizeof ( AF_SCRIPT_CLASSES_GET[0] ); - FT_Error error = FT_Err_Ok; + + AF_Script script = (AF_Script)( options & 15 ); + AF_WritingSystemClass writing_system_class; + AF_ScriptClass script_class; + + FT_Error error = FT_Err_Ok; if ( gindex >= (FT_ULong)globals->glyph_count ) @@ -246,41 +274,43 @@ goto Exit; } - gidx = script; - if ( gidx == 0 || gidx + 1 >= script_max ) - gidx = globals->glyph_scripts[gindex] & AF_SCRIPT_NONE; + /* if we have a forced script (via `options'), use it, */ + /* otherwise look into `glyph_scripts' array */ + if ( script == AF_SCRIPT_DFLT || script + 1 >= AF_SCRIPT_MAX ) + script = (AF_Script)( globals->glyph_scripts[gindex] & AF_SCRIPT_NONE ); - clazz = AF_SCRIPT_CLASSES_GET[gidx]; - if ( script == 0 ) - script = clazz->script; + script_class = AF_SCRIPT_CLASSES_GET[script]; + writing_system_class = AF_WRITING_SYSTEM_CLASSES_GET + [script_class->writing_system]; - metrics = globals->metrics[clazz->script]; + metrics = globals->metrics[script]; if ( metrics == NULL ) { /* create the global metrics object if necessary */ FT_Memory memory = globals->face->memory; - if ( FT_ALLOC( metrics, clazz->script_metrics_size ) ) + if ( FT_ALLOC( metrics, writing_system_class->script_metrics_size ) ) goto Exit; - metrics->clazz = clazz; - metrics->globals = globals; + metrics->script_class = script_class; + metrics->globals = globals; - if ( clazz->script_metrics_init ) + if ( writing_system_class->script_metrics_init ) { - error = clazz->script_metrics_init( metrics, globals->face ); + error = writing_system_class->script_metrics_init( metrics, + globals->face ); if ( error ) { - if ( clazz->script_metrics_done ) - clazz->script_metrics_done( metrics ); + if ( writing_system_class->script_metrics_done ) + writing_system_class->script_metrics_done( metrics ); FT_FREE( metrics ); goto Exit; } } - globals->metrics[clazz->script] = metrics; + globals->metrics[script] = metrics; } Exit: diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afglobal.h b/reactos/lib/3rdparty/freetype/src/autofit/afglobal.h index 2e249008224..227eee752ad 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afglobal.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/afglobal.h @@ -5,7 +5,7 @@ /* Auto-fitter routines to compute global hinting values */ /* (specification). */ /* */ -/* Copyright 2003-2005, 2007, 2009, 2011-2012 by */ +/* Copyright 2003-2005, 2007, 2009, 2011-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -28,13 +28,28 @@ FT_BEGIN_HEADER + FT_LOCAL_ARRAY( AF_WritingSystemClass ) + af_writing_system_classes[]; + + FT_LOCAL_ARRAY( AF_ScriptClass ) + af_script_classes[]; + +#ifdef FT_DEBUG_LEVEL_TRACE + FT_LOCAL_ARRAY( char* ) + af_script_names[]; +#endif + /* * Default values and flags for both autofitter globals (found in * AF_ModuleRec) and face globals (in AF_FaceGlobalsRec). */ /* index of fallback script in `af_script_classes' */ -#define AF_SCRIPT_FALLBACK 2 +#ifdef AF_CONFIG_OPTION_CJK +#define AF_SCRIPT_FALLBACK AF_SCRIPT_HANI +#else +#define AF_SCRIPT_FALLBACK AF_SCRIPT_DFLT +#endif /* a bit mask indicating an uncovered glyph */ #define AF_SCRIPT_NONE 0x7F /* if this flag is set, we have an ASCII digit */ @@ -55,8 +70,8 @@ FT_BEGIN_HEADER /* - * Note that glyph_scripts[] is used to map each glyph into - * an index into the `af_script_classes' array. + * Note that glyph_scripts[] maps each glyph to an index into the + * `af_script_classes' array. * */ typedef struct AF_FaceGlobalsRec_ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afhints.c b/reactos/lib/3rdparty/freetype/src/autofit/afhints.c index e8defaa88db..ce504cccac2 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afhints.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afhints.c @@ -144,6 +144,17 @@ #include FT_CONFIG_STANDARD_LIBRARY_H + /* The dump functions are used in the `ftgrid' demo program, too. */ +#define AF_DUMP( varformat ) \ + do \ + { \ + if ( to_stdout ) \ + printf varformat; \ + else \ + FT_TRACE7( varformat ); \ + } while ( 0 ) + + static const char* af_dir_str( AF_Direction dir ) { @@ -179,34 +190,35 @@ extern "C" { #endif void - af_glyph_hints_dump_points( AF_GlyphHints hints ) + af_glyph_hints_dump_points( AF_GlyphHints hints, + FT_Bool to_stdout ) { AF_Point points = hints->points; AF_Point limit = points + hints->num_points; AF_Point point; - FT_TRACE7(( "Table of points:\n" - " [ index | xorg | yorg | xscale | yscale" - " | xfit | yfit | flags ]\n" )); + AF_DUMP(( "Table of points:\n" + " [ index | xorg | yorg | xscale | yscale" + " | xfit | yfit | flags ]\n" )); for ( point = points; point < limit; point++ ) - FT_TRACE7(( " [ %5d | %5d | %5d | %6.2f | %6.2f" - " | %5.2f | %5.2f | %c%c%c%c%c%c ]\n", - point - points, - point->fx, - point->fy, - point->ox / 64.0, - point->oy / 64.0, - point->x / 64.0, - point->y / 64.0, - ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? 'w' : ' ', - ( point->flags & AF_FLAG_INFLECTION ) ? 'i' : ' ', - ( point->flags & AF_FLAG_EXTREMA_X ) ? '<' : ' ', - ( point->flags & AF_FLAG_EXTREMA_Y ) ? 'v' : ' ', - ( point->flags & AF_FLAG_ROUND_X ) ? '(' : ' ', - ( point->flags & AF_FLAG_ROUND_Y ) ? 'u' : ' ')); - FT_TRACE7(( "\n" )); + AF_DUMP(( " [ %5d | %5d | %5d | %6.2f | %6.2f" + " | %5.2f | %5.2f | %c%c%c%c%c%c ]\n", + point - points, + point->fx, + point->fy, + point->ox / 64.0, + point->oy / 64.0, + point->x / 64.0, + point->y / 64.0, + ( point->flags & AF_FLAG_WEAK_INTERPOLATION ) ? 'w' : ' ', + ( point->flags & AF_FLAG_INFLECTION ) ? 'i' : ' ', + ( point->flags & AF_FLAG_EXTREMA_X ) ? '<' : ' ', + ( point->flags & AF_FLAG_EXTREMA_Y ) ? 'v' : ' ', + ( point->flags & AF_FLAG_ROUND_X ) ? '(' : ' ', + ( point->flags & AF_FLAG_ROUND_Y ) ? 'u' : ' ')); + AF_DUMP(( "\n" )); } #ifdef __cplusplus } @@ -247,7 +259,8 @@ extern "C" { #endif void - af_glyph_hints_dump_segments( AF_GlyphHints hints ) + af_glyph_hints_dump_segments( AF_GlyphHints hints, + FT_Bool to_stdout ) { FT_Int dimension; @@ -262,34 +275,34 @@ AF_Segment seg; - FT_TRACE7(( "Table of %s segments:\n", - dimension == AF_DIMENSION_HORZ ? "vertical" - : "horizontal" )); + AF_DUMP(( "Table of %s segments:\n", + dimension == AF_DIMENSION_HORZ ? "vertical" + : "horizontal" )); if ( axis->num_segments ) - FT_TRACE7(( " [ index | pos | dir | from" - " | to | link | serif | edge" - " | height | extra | flags ]\n" )); + AF_DUMP(( " [ index | pos | dir | from" + " | to | link | serif | edge" + " | height | extra | flags ]\n" )); else - FT_TRACE7(( " (none)\n" )); + AF_DUMP(( " (none)\n" )); for ( seg = segments; seg < limit; seg++ ) - FT_TRACE7(( " [ %5d | %5.2g | %5s | %4d" - " | %4d | %4d | %5d | %4d" - " | %6d | %5d | %11s ]\n", - seg - segments, - dimension == AF_DIMENSION_HORZ - ? (int)seg->first->ox / 64.0 - : (int)seg->first->oy / 64.0, - af_dir_str( (AF_Direction)seg->dir ), - AF_INDEX_NUM( seg->first, points ), - AF_INDEX_NUM( seg->last, points ), - AF_INDEX_NUM( seg->link, segments ), - AF_INDEX_NUM( seg->serif, segments ), - AF_INDEX_NUM( seg->edge, edges ), - seg->height, - seg->height - ( seg->max_coord - seg->min_coord ), - af_edge_flags_to_string( (AF_Edge_Flags)seg->flags ) )); - FT_TRACE7(( "\n" )); + AF_DUMP(( " [ %5d | %5.2g | %5s | %4d" + " | %4d | %4d | %5d | %4d" + " | %6d | %5d | %11s ]\n", + seg - segments, + dimension == AF_DIMENSION_HORZ + ? (int)seg->first->ox / 64.0 + : (int)seg->first->oy / 64.0, + af_dir_str( (AF_Direction)seg->dir ), + AF_INDEX_NUM( seg->first, points ), + AF_INDEX_NUM( seg->last, points ), + AF_INDEX_NUM( seg->link, segments ), + AF_INDEX_NUM( seg->serif, segments ), + AF_INDEX_NUM( seg->edge, edges ), + seg->height, + seg->height - ( seg->max_coord - seg->min_coord ), + af_edge_flags_to_string( (AF_Edge_Flags)seg->flags ) )); + AF_DUMP(( "\n" )); } } #ifdef __cplusplus @@ -366,7 +379,8 @@ extern "C" { #endif void - af_glyph_hints_dump_edges( AF_GlyphHints hints ) + af_glyph_hints_dump_edges( AF_GlyphHints hints, + FT_Bool to_stdout ) { FT_Int dimension; @@ -383,94 +397,35 @@ * note: AF_DIMENSION_HORZ corresponds to _vertical_ edges * since they have a constant X coordinate. */ - FT_TRACE7(( "Table of %s edges:\n", - dimension == AF_DIMENSION_HORZ ? "vertical" - : "horizontal" )); + AF_DUMP(( "Table of %s edges:\n", + dimension == AF_DIMENSION_HORZ ? "vertical" + : "horizontal" )); if ( axis->num_edges ) - FT_TRACE7(( " [ index | pos | dir | link" - " | serif | blue | opos | pos | flags ]\n" )); + AF_DUMP(( " [ index | pos | dir | link" + " | serif | blue | opos | pos | flags ]\n" )); else - FT_TRACE7(( " (none)\n" )); + AF_DUMP(( " (none)\n" )); for ( edge = edges; edge < limit; edge++ ) - FT_TRACE7(( " [ %5d | %5.2g | %5s | %4d" - " | %5d | %c | %5.2f | %5.2f | %11s ]\n", - edge - edges, - (int)edge->opos / 64.0, - af_dir_str( (AF_Direction)edge->dir ), - AF_INDEX_NUM( edge->link, edges ), - AF_INDEX_NUM( edge->serif, edges ), - edge->blue_edge ? 'y' : 'n', - edge->opos / 64.0, - edge->pos / 64.0, - af_edge_flags_to_string( (AF_Edge_Flags)edge->flags ) )); - FT_TRACE7(( "\n" )); + AF_DUMP(( " [ %5d | %5.2g | %5s | %4d" + " | %5d | %c | %5.2f | %5.2f | %11s ]\n", + edge - edges, + (int)edge->opos / 64.0, + af_dir_str( (AF_Direction)edge->dir ), + AF_INDEX_NUM( edge->link, edges ), + AF_INDEX_NUM( edge->serif, edges ), + edge->blue_edge ? 'y' : 'n', + edge->opos / 64.0, + edge->pos / 64.0, + af_edge_flags_to_string( (AF_Edge_Flags)edge->flags ) )); + AF_DUMP(( "\n" )); } } #ifdef __cplusplus } #endif -#else /* !FT_DEBUG_AUTOFIT */ - - /* these empty stubs are only used to link the `ftgrid' test program */ - /* if debugging is disabled */ - -#ifdef __cplusplus - extern "C" { -#endif - - void - af_glyph_hints_dump_points( AF_GlyphHints hints ) - { - FT_UNUSED( hints ); - } - - - void - af_glyph_hints_dump_segments( AF_GlyphHints hints ) - { - FT_UNUSED( hints ); - } - - - FT_Error - af_glyph_hints_get_num_segments( AF_GlyphHints hints, - FT_Int dimension, - FT_Int* num_segments ) - { - FT_UNUSED( hints ); - FT_UNUSED( dimension ); - FT_UNUSED( num_segments ); - - return 0; - } - - - FT_Error - af_glyph_hints_get_segment_offset( AF_GlyphHints hints, - FT_Int dimension, - FT_Int idx, - FT_Pos* offset ) - { - FT_UNUSED( hints ); - FT_UNUSED( dimension ); - FT_UNUSED( idx ); - FT_UNUSED( offset ); - - return 0; - } - - - void - af_glyph_hints_dump_edges( AF_GlyphHints hints ) - { - FT_UNUSED( hints ); - } - -#ifdef __cplusplus - } -#endif +#undef AF_DUMP #endif /* !FT_DEBUG_AUTOFIT */ @@ -740,6 +695,12 @@ FT_Pos in_y = 0; AF_Direction in_dir = AF_DIR_NONE; + FT_Pos last_good_in_x = 0; + FT_Pos last_good_in_y = 0; + + FT_UInt units_per_em = hints->metrics->scaler.face->units_per_EM; + FT_Int near_limit = 20 * units_per_em / 2048; + for ( point = points; point < point_limit; point++ ) { @@ -749,15 +710,59 @@ if ( point == first ) { - prev = first->prev; - in_x = first->fx - prev->fx; - in_y = first->fy - prev->fy; + prev = first->prev; + + in_x = first->fx - prev->fx; + in_y = first->fy - prev->fy; + + last_good_in_x = in_x; + last_good_in_y = in_y; + + if ( FT_ABS( in_x ) + FT_ABS( in_y ) < near_limit ) + { + /* search first non-near point to get a good `in_dir' value */ + + AF_Point point_ = prev; + + + while ( point_ != first ) + { + AF_Point prev_ = point_->prev; + + FT_Pos in_x_ = point_->fx - prev_->fx; + FT_Pos in_y_ = point_->fy - prev_->fy; + + + if ( FT_ABS( in_x_ ) + FT_ABS( in_y_ ) >= near_limit ) + { + last_good_in_x = in_x_; + last_good_in_y = in_y_; + + break; + } + + point_ = prev_; + } + } + in_dir = af_direction_compute( in_x, in_y ); first = prev + 1; } point->in_dir = (FT_Char)in_dir; + /* check whether the current point is near to the previous one */ + /* (value 20 in `near_limit' is heuristic; we use Taxicab */ + /* metrics for the test) */ + + if ( FT_ABS( in_x ) + FT_ABS( in_y ) < near_limit ) + point->flags |= AF_FLAG_NEAR; + else + { + last_good_in_x = in_x; + last_good_in_y = in_y; + } + next = point->next; out_x = next->fx - point->fx; out_y = next->fy - point->fy; @@ -765,23 +770,43 @@ in_dir = af_direction_compute( out_x, out_y ); point->out_dir = (FT_Char)in_dir; - /* check for weak points */ + /* Check for weak points. The remaining points not collected */ + /* in edges are then implicitly classified as strong points. */ if ( point->flags & AF_FLAG_CONTROL ) { + /* control points are always weak */ Is_Weak_Point: point->flags |= AF_FLAG_WEAK_INTERPOLATION; } else if ( point->out_dir == point->in_dir ) { if ( point->out_dir != AF_DIR_NONE ) + { + /* current point lies on a horizontal or */ + /* vertical segment (but doesn't start or end it) */ goto Is_Weak_Point; + } - if ( ft_corner_is_flat( in_x, in_y, out_x, out_y ) ) + /* test whether `in' and `out' direction is approximately */ + /* the same (and use the last good `in' vector in case */ + /* the current point is near to the previous one) */ + if ( ft_corner_is_flat( + point->flags & AF_FLAG_NEAR ? last_good_in_x : in_x, + point->flags & AF_FLAG_NEAR ? last_good_in_y : in_y, + out_x, + out_y ) ) + { + /* current point lies on a straight, diagonal line */ + /* (more or less) */ goto Is_Weak_Point; + } } else if ( point->in_dir == -point->out_dir ) + { + /* current point forms a spike */ goto Is_Weak_Point; + } in_x = out_x; in_y = out_y; diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afhints.h b/reactos/lib/3rdparty/freetype/src/autofit/afhints.h index 776b3c844eb..ce5232545cc 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afhints.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/afhints.h @@ -62,15 +62,19 @@ FT_BEGIN_HEADER * * by David Turner and Werner Lemberg * - * http://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf + * http://www.tug.org/TUGboat/Articles/tb24-3/lemberg.pdf + * + * with appropriate updates. * * * Segments * * `af_{cjk,latin,...}_hints_compute_segments' are the functions to - * find segments in an outline. A segment is a series of consecutive - * points that are approximately aligned along a coordinate axis. The - * analysis to do so is specific to a script. + * find segments in an outline. + * + * A segment is a series of consecutive points that are approximately + * aligned along a coordinate axis. The analysis to do so is specific + * to a writing system. * * A segment must have at least two points, except in the case of * `fake' segments that are generated to hint metrics appropriately, @@ -79,16 +83,17 @@ FT_BEGIN_HEADER * * Edges * + * `af_{cjk,latin,...}_hints_compute_edges' are the functions to find + * edges. + * * As soon as segments are defined, the auto-hinter groups them into * edges. An edge corresponds to a single position on the main * dimension that collects one or more segments (allowing for a small * threshold). * - * The auto-hinter first tries to grid fit edges, then to align - * segments on the edges unless it detects that they form a serif. - * - * `af_{cjk,latin,...}_hints_compute_edges' are the functions to find - * edges; they are specific to a script. + * As an example, the `latin' writing system first tries to grid-fit + * edges, then to align segments on the edges unless it detects that + * they form a serif. * * * A H @@ -107,6 +112,8 @@ FT_BEGIN_HEADER * * Stems * + * Stems are detected by `af_{cjk,latin,...}_hint_edges'. + * * Segments need to be `linked' to other ones in order to detect stems. * A stem is made of two segments that face each other in opposite * directions and that are sufficiently close to each other. Using @@ -127,17 +134,21 @@ FT_BEGIN_HEADER * The best candidate is stored in field `link' in structure * `AF_Segment'. * - * Stems are detected by `af_{cjk,latin,...}_hint_edges'. - * * In the above ASCII drawing, the best candidate for both AB and CD is * GH, while the best candidate for GH is AB. Similarly, the best * candidate for EF and GH is AB, while the best candidate for AB is * GH. * + * The detection and handling of stems is dependent on the writing + * system. + * * * Serifs * - * On the opposite, a serif has + * Serifs are detected by `af_{cjk,latin,...}_hint_edges'. + * + * In comparison to a stem, a serif (as handled by the auto-hinter + * module which takes care of the `latin' writing system) has * * best segment_1 = segment_2 && best segment_2 != segment_1 * @@ -147,8 +158,6 @@ FT_BEGIN_HEADER * The best candidate is stored in field `serif' in structure * `AF_Segment' (and `link' is set to NULL). * - * Serifs are detected by `af_{cjk,latin,...}_hint_edges'. - * * * Touched points * @@ -178,7 +187,8 @@ FT_BEGIN_HEADER * differ greatly) * * - inflection points (i.e., where the `in' and `out' angles are the - * same, but the curvature changes sign) + * same, but the curvature changes sign) [currently, such points + * aren't handled in the auto-hinter] * * `af_glyph_hints_align_strong_points' is the function which takes * care of such situations; it is equivalent to the TrueType `IP' @@ -226,7 +236,10 @@ FT_BEGIN_HEADER AF_FLAG_WEAK_INTERPOLATION = 1 << 8, /* all inflection points in the outline have this flag set */ - AF_FLAG_INFLECTION = 1 << 9 + AF_FLAG_INFLECTION = 1 << 9, + + /* the current point is very near to another one */ + AF_FLAG_NEAR = 1 << 10 } AF_Flags; diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afindic.c b/reactos/lib/3rdparty/freetype/src/autofit/afindic.c index 8c249725988..ef8299f89df 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afindic.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afindic.c @@ -97,26 +97,10 @@ /*************************************************************************/ - static const AF_Script_UniRangeRec af_indic_uniranges[] = - { -#if 0 - AF_UNIRANGE_REC( 0x0100UL, 0xFFFFUL ), /* why this? */ -#endif - AF_UNIRANGE_REC( 0x0900UL, 0x0DFFUL), /* Indic Range */ - AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL), /* Tibetan */ - AF_UNIRANGE_REC( 0x1900UL, 0x194FUL), /* Limbu */ - AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL), /* Sundanese */ - AF_UNIRANGE_REC( 0x1C80UL, 0x1CDFUL), /* Meetei Mayak */ - AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL), /* Syloti Nagri */ - AF_UNIRANGE_REC( 0x11800UL, 0x118DFUL), /* Sharada */ - AF_UNIRANGE_REC( 0UL, 0UL) - }; + AF_DEFINE_WRITING_SYSTEM_CLASS( + af_indic_writing_system_class, - - AF_DEFINE_SCRIPT_CLASS( af_indic_script_class, - AF_SCRIPT_INDIC, - af_indic_uniranges, - 'o', /* XXX */ + AF_WRITING_SYSTEM_INDIC, sizeof ( AF_CJKMetricsRec ), @@ -128,18 +112,28 @@ (AF_Script_ApplyHintsFunc) af_indic_hints_apply ) -#else /* !AF_CONFIG_OPTION_INDIC */ + /* XXX: this should probably fine tuned to differentiate better between */ + /* scripts... */ - static const AF_Script_UniRangeRec af_indic_uniranges[] = + static const AF_Script_UniRangeRec af_deva_uniranges[] = { - { 0, 0 } + AF_UNIRANGE_REC( 0x0900UL, 0x0DFFUL ), /* Indic Range */ + AF_UNIRANGE_REC( 0x0F00UL, 0x0FFFUL ), /* Tibetan */ + AF_UNIRANGE_REC( 0x1900UL, 0x194FUL ), /* Limbu */ + AF_UNIRANGE_REC( 0x1B80UL, 0x1BBFUL ), /* Sundanese */ + AF_UNIRANGE_REC( 0x1C80UL, 0x1CDFUL ), /* Meetei Mayak */ + AF_UNIRANGE_REC( 0xA800UL, 0xA82FUL ), /* Syloti Nagri */ + AF_UNIRANGE_REC( 0x11800UL, 0x118DFUL ), /* Sharada */ + AF_UNIRANGE_REC( 0UL, 0UL ) }; - AF_DEFINE_SCRIPT_CLASS( af_indic_script_class, - AF_SCRIPT_INDIC, - af_indic_uniranges, - 0, +#else /* !AF_CONFIG_OPTION_INDIC */ + + AF_DEFINE_WRITING_SYSTEM_CLASS( + af_indic_writing_system_class, + + AF_WRITING_SYSTEM_INDIC, sizeof ( AF_CJKMetricsRec ), @@ -151,7 +145,25 @@ (AF_Script_ApplyHintsFunc) NULL ) + + static const AF_Script_UniRangeRec af_deva_uniranges[] = + { + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + #endif /* !AF_CONFIG_OPTION_INDIC */ + AF_DEFINE_SCRIPT_CLASS( + af_deva_script_class, + + AF_SCRIPT_DEVA, + (AF_Blue_Stringset)0, /* XXX */ + AF_WRITING_SYSTEM_INDIC, + + af_deva_uniranges, + 'o' /* XXX */ + ) + + /* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afindic.h b/reactos/lib/3rdparty/freetype/src/autofit/afindic.h index c252cf20da6..db38e9674f4 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afindic.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/afindic.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for Indic scripts (specification). */ /* */ -/* Copyright 2007, 2012 by */ +/* Copyright 2007, 2012, 2013 by */ /* Rahul Bhalerao , . */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -25,9 +25,14 @@ FT_BEGIN_HEADER - /* the Indic-specific script class */ + /* the `indic' writing system */ - AF_DECLARE_SCRIPT_CLASS( af_indic_script_class ) + AF_DECLARE_WRITING_SYSTEM_CLASS( af_indic_writing_system_class ) + + + /* the indic-specific script classes */ + + AF_DECLARE_SCRIPT_CLASS( af_deva_script_class ) /* */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/aflatin.c b/reactos/lib/3rdparty/freetype/src/autofit/aflatin.c index ef0157a13ee..15a241e523a 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/aflatin.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/aflatin.c @@ -60,8 +60,11 @@ AF_GlyphHintsRec hints[1]; - FT_TRACE5(( "standard widths computation\n" - "===========================\n\n" )); + FT_TRACE5(( "\n" + "latin standard widths computation (script `%s')\n" + "=================================================\n" + "\n", + af_script_names[metrics->root.script_class->script] )); af_glyph_hints_init( hints, face->memory ); @@ -76,13 +79,14 @@ AF_Scaler scaler = &dummy->root.scaler; - glyph_index = FT_Get_Char_Index( face, - metrics->root.clazz->standard_char ); + glyph_index = FT_Get_Char_Index( + face, + metrics->root.script_class->standard_char ); if ( glyph_index == 0 ) goto Exit; - FT_TRACE5(( "standard character: 0x%X (glyph index %d)\n", - metrics->root.clazz->standard_char, glyph_index )); + FT_TRACE5(( "standard character: U+%04lX (glyph index %d)\n", + metrics->root.script_class->standard_char, glyph_index )); error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); if ( error || face->glyph->outline.n_points <= 0 ) @@ -146,22 +150,21 @@ } /* this also replaces multiple almost identical stem widths */ - /* with a single one (the value 100 is heuristic) */ + /* with a single one (the value 100 is heuristic) */ af_sort_and_quantize_widths( &num_widths, axis->widths, dummy->units_per_em / 100 ); axis->width_count = num_widths; } - Exit: + Exit: for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ ) { AF_LatinAxis axis = &metrics->axis[dim]; FT_Pos stdw; - stdw = ( axis->width_count > 0 ) - ? axis->widths[0].org - : AF_LATIN_CONSTANT( metrics, 50 ); + stdw = ( axis->width_count > 0 ) ? axis->widths[0].org + : AF_LATIN_CONSTANT( metrics, 50 ); /* let's try 20% of the smallest width */ axis->edge_distance_threshold = stdw / 5; @@ -193,22 +196,6 @@ } - -#define AF_LATIN_MAX_TEST_CHARACTERS 12 - - - static const char af_latin_blue_chars[AF_LATIN_MAX_BLUES] - [AF_LATIN_MAX_TEST_CHARACTERS + 1] = - { - "THEZOCQS", - "HEZLOCUS", - "fijkdbh", - "xzroesc", - "xzroesc", - "pqgjy" - }; - - /* Find all blue zones. Flat segments give the reference points, */ /* round segments the overshoot positions. */ @@ -216,39 +203,80 @@ af_latin_metrics_init_blues( AF_LatinMetrics metrics, FT_Face face ) { - FT_Pos flats [AF_LATIN_MAX_TEST_CHARACTERS]; - FT_Pos rounds[AF_LATIN_MAX_TEST_CHARACTERS]; + FT_Pos flats [AF_BLUE_STRING_MAX_LEN]; + FT_Pos rounds[AF_BLUE_STRING_MAX_LEN]; + FT_Int num_flats; FT_Int num_rounds; - FT_Int bb; + AF_LatinBlue blue; FT_Error error; - AF_LatinAxis axis = &metrics->axis[AF_DIMENSION_VERT]; + AF_LatinAxis axis = &metrics->axis[AF_DIMENSION_VERT]; FT_Outline outline; + AF_Blue_Stringset bss = metrics->root.script_class->blue_stringset; + const AF_Blue_StringRec* bs = &af_blue_stringsets[bss]; - /* we compute the blues simply by loading each character from the */ - /* `af_latin_blue_chars[blues]' string, then finding its top-most or */ - /* bottom-most points (depending on `AF_IS_TOP_BLUE') */ - FT_TRACE5(( "blue zones computation\n" - "======================\n\n" )); + /* we walk over the blue character strings as specified in the */ + /* script's entry in the `af_blue_stringset' array */ - for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ ) + FT_TRACE5(( "latin blue zones computation\n" + "============================\n" + "\n" )); + + for ( ; bs->string != AF_BLUE_STRING_MAX; bs++ ) { - const char* p = af_latin_blue_chars[bb]; - const char* limit = p + AF_LATIN_MAX_TEST_CHARACTERS; + const char* p = &af_blue_strings[bs->string]; FT_Pos* blue_ref; FT_Pos* blue_shoot; - FT_TRACE5(( "blue zone %d:\n", bb )); +#ifdef FT_DEBUG_LEVEL_TRACE + { + FT_Bool have_flag = 0; + + + FT_TRACE5(( "blue zone %d", axis->blue_count )); + + if ( bs->properties ) + { + FT_TRACE5(( " (" )); + + if ( AF_LATIN_IS_TOP_BLUE( bs ) ) + { + FT_TRACE5(( "top" )); + have_flag = 1; + } + + if ( AF_LATIN_IS_X_HEIGHT_BLUE( bs ) ) + { + if ( have_flag ) + FT_TRACE5(( ", " )); + FT_TRACE5(( "small top" )); + have_flag = 1; + } + + if ( AF_LATIN_IS_LONG_BLUE( bs ) ) + { + if ( have_flag ) + FT_TRACE5(( ", " )); + FT_TRACE5(( "long" )); + } + + FT_TRACE5(( ")" )); + } + + FT_TRACE5(( ":\n" )); + } +#endif /* FT_DEBUG_LEVEL_TRACE */ num_flats = 0; num_rounds = 0; - for ( ; p < limit && *p; p++ ) + while ( *p ) { + FT_ULong ch; FT_UInt glyph_index; FT_Pos best_y; /* same as points.y */ FT_Int best_point, best_contour_first, best_contour_last; @@ -256,15 +284,23 @@ FT_Bool round = 0; + GET_UTF8_CHAR( ch, p ); + /* load the character in the face -- skip unknown or empty ones */ - glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p ); + glyph_index = FT_Get_Char_Index( face, ch ); if ( glyph_index == 0 ) + { + FT_TRACE5(( " U+%04lX unavailable\n", ch )); continue; + } error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE ); outline = face->glyph->outline; if ( error || outline.n_points <= 0 ) + { + FT_TRACE5(( " U+%04lX contains no outlines\n", ch )); continue; + } /* now compute min or max point indices and coordinates */ points = outline.points; @@ -289,11 +325,11 @@ /* Avoid single-point contours since they are never rasterized. */ /* In some fonts, they correspond to mark attachment points */ - /* which are way outside of the glyph's real outline. */ + /* that are way outside of the glyph's real outline. */ if ( last <= first ) continue; - if ( AF_LATIN_IS_TOP_BLUE( bb ) ) + if ( AF_LATIN_IS_TOP_BLUE( bs ) ) { for ( pp = first; pp <= last; pp++ ) if ( best_point < 0 || points[pp].y > best_y ) @@ -318,7 +354,6 @@ best_contour_last = last; } } - FT_TRACE5(( " %c %ld", *p, best_y )); } /* now check whether the point belongs to a straight or round */ @@ -328,10 +363,14 @@ { FT_Pos best_x = points[best_point].x; FT_Int prev, next; + FT_Int best_segment_first, best_segment_last; FT_Int best_on_point_first, best_on_point_last; FT_Pos dist; + best_segment_first = best_point; + best_segment_last = best_point; + if ( FT_CURVE_TAG( outline.tags[best_point] ) == FT_CURVE_TAG_ON ) { best_on_point_first = best_point; @@ -343,8 +382,9 @@ best_on_point_last = -1; } - /* look for the previous and next points that are not on the */ - /* same Y coordinate, then threshold the `closeness'... */ + /* look for the previous and next points on the contour */ + /* that are not on the same Y coordinate, then threshold */ + /* the `closeness'... */ prev = best_point; next = prev; @@ -362,6 +402,8 @@ if ( FT_ABS( points[prev].x - best_x ) <= 20 * dist ) break; + best_segment_first = prev; + if ( FT_CURVE_TAG( outline.tags[prev] ) == FT_CURVE_TAG_ON ) { best_on_point_first = prev; @@ -383,6 +425,8 @@ if ( FT_ABS( points[next].x - best_x ) <= 20 * dist ) break; + best_segment_last = next; + if ( FT_CURVE_TAG( outline.tags[next] ) == FT_CURVE_TAG_ON ) { best_on_point_last = next; @@ -392,8 +436,186 @@ } while ( next != best_point ); - /* now set the `round' flag depending on the segment's kind */ - /* (value 8 is heuristic) */ + if ( AF_LATIN_IS_LONG_BLUE( bs ) ) + { + /* If this flag is set, we have an additional constraint to */ + /* get the blue zone distance: Find a segment of the topmost */ + /* (or bottommost) contour that is longer than a heuristic */ + /* threshold. This ensures that small bumps in the outline */ + /* are ignored (for example, the `vertical serifs' found in */ + /* many Hebrew glyph designs). */ + + /* If this segment is long enough, we are done. Otherwise, */ + /* search the segment next to the extremum that is long */ + /* enough, has the same direction, and a not too large */ + /* vertical distance from the extremum. Note that the */ + /* algorithm doesn't check whether the found segment is */ + /* actually the one (vertically) nearest to the extremum. */ + + /* heuristic threshold value */ + FT_Pos length_threshold = metrics->units_per_em / 25; + + + dist = FT_ABS( points[best_segment_last].x - + points[best_segment_first].x ); + + if ( dist < length_threshold && + best_segment_last - best_segment_first + 2 <= + best_contour_last - best_contour_first ) + { + /* heuristic threshold value */ + FT_Pos height_threshold = metrics->units_per_em / 4; + + FT_Int first; + FT_Int last; + FT_Bool hit; + + FT_Bool left2right; + + + /* compute direction */ + prev = best_point; + + do + { + if ( prev > best_contour_first ) + prev--; + else + prev = best_contour_last; + + if ( points[prev].x != best_x ) + break; + + } while ( prev != best_point ); + + /* skip glyph for the degenerate case */ + if ( prev == best_point ) + continue; + + left2right = FT_BOOL( points[prev].x < points[best_point].x ); + + first = best_segment_last; + last = first; + hit = 0; + + do + { + FT_Bool l2r; + FT_Pos d; + FT_Int p_first, p_last; + + + if ( !hit ) + { + /* no hit; adjust first point */ + first = last; + + /* also adjust first and last on point */ + if ( FT_CURVE_TAG( outline.tags[first] ) == + FT_CURVE_TAG_ON ) + { + p_first = first; + p_last = first; + } + else + { + p_first = -1; + p_last = -1; + } + + hit = 1; + } + + if ( last < best_contour_last ) + last++; + else + last = best_contour_first; + + if ( FT_ABS( best_y - points[first].y ) > height_threshold ) + { + /* vertical distance too large */ + hit = 0; + continue; + } + + /* same test as above */ + dist = FT_ABS( points[last].y - points[first].y ); + if ( dist > 5 ) + if ( FT_ABS( points[last].x - points[first].x ) <= + 20 * dist ) + { + hit = 0; + continue; + } + + if ( FT_CURVE_TAG( outline.tags[last] ) == FT_CURVE_TAG_ON ) + { + p_last = last; + if ( p_first < 0 ) + p_first = last; + } + + l2r = FT_BOOL( points[first].x < points[last].x ); + d = FT_ABS( points[last].x - points[first].x ); + + if ( l2r == left2right && + d >= length_threshold ) + { + /* all constraints are met; update segment after finding */ + /* its end */ + do + { + if ( last < best_contour_last ) + last++; + else + last = best_contour_first; + + d = FT_ABS( points[last].y - points[first].y ); + if ( d > 5 ) + if ( FT_ABS( points[next].x - points[first].x ) <= + 20 * dist ) + { + last--; + break; + } + + p_last = last; + + if ( FT_CURVE_TAG( outline.tags[last] ) == + FT_CURVE_TAG_ON ) + { + p_last = last; + if ( p_first < 0 ) + p_first = last; + } + + } while ( last != best_segment_first ); + + best_y = points[first].y; + + best_segment_first = first; + best_segment_last = last; + + best_on_point_first = p_first; + best_on_point_last = p_last; + + break; + } + + } while ( last != best_segment_first ); + } + } + + FT_TRACE5(( " U+%04lX: best_y = %5ld", ch, best_y )); + + /* now set the `round' flag depending on the segment's kind: */ + /* */ + /* - if the horizontal distance between the first and last */ + /* `on' point is larger than upem/8 (value 8 is heuristic) */ + /* we have a flat segment */ + /* - if either the first or the last point of the segment is */ + /* an `off' point, the segment is round, otherwise it is */ + /* flat */ if ( best_on_point_first >= 0 && best_on_point_last >= 0 && (FT_UInt)( FT_ABS( points[best_on_point_last].x - @@ -402,8 +624,10 @@ round = 0; else round = FT_BOOL( - FT_CURVE_TAG( outline.tags[prev] ) != FT_CURVE_TAG_ON || - FT_CURVE_TAG( outline.tags[next] ) != FT_CURVE_TAG_ON ); + FT_CURVE_TAG( outline.tags[best_segment_first] ) != + FT_CURVE_TAG_ON || + FT_CURVE_TAG( outline.tags[best_segment_last] ) != + FT_CURVE_TAG_ON ); FT_TRACE5(( " (%s)\n", round ? "round" : "flat" )); } @@ -448,7 +672,7 @@ } else { - *blue_ref = flats[num_flats / 2]; + *blue_ref = flats [num_flats / 2]; *blue_shoot = rounds[num_rounds / 2]; } @@ -462,7 +686,7 @@ FT_Bool over_ref = FT_BOOL( shoot > ref ); - if ( AF_LATIN_IS_TOP_BLUE( bb ) ^ over_ref ) + if ( AF_LATIN_IS_TOP_BLUE( bs ) ^ over_ref ) { *blue_ref = *blue_shoot = ( shoot + ref ) / 2; @@ -473,7 +697,7 @@ } blue->flags = 0; - if ( AF_LATIN_IS_TOP_BLUE( bb ) ) + if ( AF_LATIN_IS_TOP_BLUE( bs ) ) blue->flags |= AF_LATIN_BLUE_TOP; /* @@ -481,7 +705,7 @@ * in order to optimize the pixel grid alignment of the top of small * letters. */ - if ( bb == AF_LATIN_BLUE_SMALL_TOP ) + if ( AF_LATIN_IS_X_HEIGHT_BLUE( bs ) ) blue->flags |= AF_LATIN_BLUE_ADJUSTMENT; FT_TRACE5(( " -> reference = %ld\n" @@ -650,7 +874,20 @@ else #endif if ( dim == AF_DIMENSION_VERT ) + { scale = FT_MulDiv( scale, fitted, scaled ); + + FT_TRACE5(( + "af_latin_metrics_scale_dim:" + " x height alignment (script `%s'):\n" + " " + " vertical scaling changed from %.4f to %.4f (by %d%%)\n" + "\n", + af_script_names[metrics->root.script_class->script], + axis->org_scale / 65536.0, + scale / 65536.0, + ( fitted - scaled ) * 100 / scaled )); + } } } } @@ -669,6 +906,10 @@ metrics->root.scaler.y_delta = delta; } + FT_TRACE5(( "%s widths (script `%s')\n", + dim == AF_DIMENSION_HORZ ? "horizontal" : "vertical", + af_script_names[metrics->root.script_class->script] )); + /* scale the widths */ for ( nn = 0; nn < axis->width_count; nn++ ) { @@ -677,15 +918,31 @@ width->cur = FT_MulFix( width->org, scale ); width->fit = width->cur; + + FT_TRACE5(( " %d scaled to %.2f\n", + width->org, + width->cur / 64.0 )); } + FT_TRACE5(( "\n" )); + /* an extra-light axis corresponds to a standard width that is */ /* smaller than 5/8 pixels */ axis->extra_light = (FT_Bool)( FT_MulFix( axis->standard_width, scale ) < 32 + 8 ); +#ifdef FT_DEBUG_LEVEL_TRACE + if ( axis->extra_light ) + FT_TRACE5(( "`%s' script is extra light (at current resolution)\n" + "\n", + af_script_names[metrics->root.script_class->script] )); +#endif + if ( dim == AF_DIMENSION_VERT ) { + FT_TRACE5(( "blue zones (script `%s')\n", + af_script_names[metrics->root.script_class->script] )); + /* scale the blue zones */ for ( nn = 0; nn < axis->blue_count; nn++ ) { @@ -757,6 +1014,19 @@ #endif blue->flags |= AF_LATIN_BLUE_ACTIVE; + + FT_TRACE5(( " reference %d: %d scaled to %.2f%s\n" + " overshoot %d: %d scaled to %.2f%s\n", + nn, + blue->ref.org, + blue->ref.fit / 64.0, + blue->flags & AF_LATIN_BLUE_ACTIVE ? "" + : " (inactive)", + nn, + blue->shoot.org, + blue->shoot.fit / 64.0, + blue->flags & AF_LATIN_BLUE_ACTIVE ? "" + : " (inactive)" )); } } } @@ -1654,8 +1924,8 @@ AF_Edge_Flags base_flags, AF_Edge_Flags stem_flags ) { - AF_LatinMetrics metrics = (AF_LatinMetrics) hints->metrics; - AF_LatinAxis axis = & metrics->axis[dim]; + AF_LatinMetrics metrics = (AF_LatinMetrics)hints->metrics; + AF_LatinAxis axis = &metrics->axis[dim]; FT_Pos dist = width; FT_Int sign = 0; FT_Int vertical = ( dim == AF_DIMENSION_VERT ); @@ -1878,8 +2148,9 @@ #endif - FT_TRACE5(( "%s edge hinting\n", - dim == AF_DIMENSION_VERT ? "horizontal" : "vertical" )); + FT_TRACE5(( "latin %s edge hinting (script `%s')\n", + dim == AF_DIMENSION_VERT ? "horizontal" : "vertical", + af_script_names[hints->metrics->script_class->script] )); /* we begin by aligning all stems relative to the blue zone */ /* if needed -- that's only for horizontal edges */ @@ -2414,6 +2685,7 @@ af_glyph_hints_align_weak_points( hints, (AF_Dimension)dim ); } } + af_glyph_hints_save( hints, outline ); Exit: @@ -2430,47 +2702,10 @@ /*************************************************************************/ - /* XXX: this should probably fine tuned to differentiate better between */ - /* scripts... */ + AF_DEFINE_WRITING_SYSTEM_CLASS( + af_latin_writing_system_class, - static const AF_Script_UniRangeRec af_latin_uniranges[] = - { - AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */ - AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */ - AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */ - AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */ - AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */ - AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */ - AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */ - AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */ - AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */ - AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */ - AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */ - AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */ - AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */ - AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */ - AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */ - AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */ - AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */ - AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */ - AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */ - AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */ - AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */ - AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */ - AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */ - AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */ - AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */ - AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */ - AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */ - AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */ - AF_UNIRANGE_REC( 0UL, 0UL ) - }; - - - AF_DEFINE_SCRIPT_CLASS( af_latin_script_class, - AF_SCRIPT_LATIN, - af_latin_uniranges, - 'o', + AF_WRITING_SYSTEM_LATIN, sizeof ( AF_LatinMetricsRec ), @@ -2483,4 +2718,103 @@ ) + /* XXX: this should probably fine tuned to differentiate better between */ + /* scripts... */ + + static const AF_Script_UniRangeRec af_latn_uniranges[] = + { + AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */ + AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */ + AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */ + AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */ + AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */ + AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */ + AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */ + AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */ + AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */ + AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */ + AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */ + AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */ + AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */ + AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */ + AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */ + AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */ + AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */ + AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */ + AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */ + AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */ + AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */ + AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + static const AF_Script_UniRangeRec af_grek_uniranges[] = + { + AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */ + AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + static const AF_Script_UniRangeRec af_cyrl_uniranges[] = + { + AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */ + AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */ + AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */ + AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + static const AF_Script_UniRangeRec af_hebr_uniranges[] = + { + AF_UNIRANGE_REC( 0x0590UL, 0x05FFUL ), /* Hebrew */ + AF_UNIRANGE_REC( 0xFB1DUL, 0xFB4FUL ), /* Alphab. Present. Forms (Hebrew) */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + + AF_DEFINE_SCRIPT_CLASS( + af_latn_script_class, + + AF_SCRIPT_LATN, + AF_BLUE_STRINGSET_LATN, + AF_WRITING_SYSTEM_LATIN, + + af_latn_uniranges, + 'o' + ) + + AF_DEFINE_SCRIPT_CLASS( + af_grek_script_class, + + AF_SCRIPT_GREK, + AF_BLUE_STRINGSET_GREK, + AF_WRITING_SYSTEM_LATIN, + + af_grek_uniranges, + 0x3BF /* ο */ + ) + + AF_DEFINE_SCRIPT_CLASS( + af_cyrl_script_class, + + AF_SCRIPT_CYRL, + AF_BLUE_STRINGSET_CYRL, + AF_WRITING_SYSTEM_LATIN, + + af_cyrl_uniranges, + 0x43E /* о */ + ) + + AF_DEFINE_SCRIPT_CLASS( + af_hebr_script_class, + + AF_SCRIPT_HEBR, + AF_BLUE_STRINGSET_HEBR, + AF_WRITING_SYSTEM_LATIN, + + af_hebr_uniranges, + 0x5DD /* ם */ + ) + + /* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/aflatin.h b/reactos/lib/3rdparty/freetype/src/autofit/aflatin.h index d9170b3dcc6..c06cbd9a6af 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/aflatin.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/aflatin.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin script (specification). */ /* */ -/* Copyright 2003-2007, 2009, 2011-2012 by */ +/* Copyright 2003-2007, 2009, 2011-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -24,10 +24,20 @@ FT_BEGIN_HEADER + /* the `latin' writing system */ - /* the latin-specific script class */ + AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin_writing_system_class ) - AF_DECLARE_SCRIPT_CLASS( af_latin_script_class ) + + /* the latin-specific script classes */ + + AF_DECLARE_SCRIPT_CLASS( af_cyrl_script_class ) + AF_DECLARE_SCRIPT_CLASS( af_grek_script_class ) + AF_DECLARE_SCRIPT_CLASS( af_latn_script_class ) + AF_DECLARE_SCRIPT_CLASS( af_hebr_script_class ) +#if 0 + AF_DECLARE_SCRIPT_CLASS( af_armn_script_class ) +#endif /* constants are given with units_per_em == 2048 in mind */ @@ -51,27 +61,14 @@ FT_BEGIN_HEADER */ - /* Latin (global) metrics management */ - - enum - { - AF_LATIN_BLUE_CAPITAL_TOP, - AF_LATIN_BLUE_CAPITAL_BOTTOM, - AF_LATIN_BLUE_SMALL_F_TOP, - AF_LATIN_BLUE_SMALL_TOP, - AF_LATIN_BLUE_SMALL_BOTTOM, - AF_LATIN_BLUE_SMALL_MINOR, - - AF_LATIN_BLUE_MAX - }; - - -#define AF_LATIN_IS_TOP_BLUE( b ) ( (b) == AF_LATIN_BLUE_CAPITAL_TOP || \ - (b) == AF_LATIN_BLUE_SMALL_F_TOP || \ - (b) == AF_LATIN_BLUE_SMALL_TOP ) +#define AF_LATIN_IS_TOP_BLUE( b ) \ + ( (b)->properties & AF_BLUE_PROPERTY_LATIN_TOP ) +#define AF_LATIN_IS_X_HEIGHT_BLUE( b ) \ + ( (b)->properties & AF_BLUE_PROPERTY_LATIN_X_HEIGHT ) +#define AF_LATIN_IS_LONG_BLUE( b ) \ + ( (b)->properties & AF_BLUE_PROPERTY_LATIN_LONG ) #define AF_LATIN_MAX_WIDTHS 16 -#define AF_LATIN_MAX_BLUES AF_LATIN_BLUE_MAX enum @@ -106,7 +103,7 @@ FT_BEGIN_HEADER /* ignored for horizontal metrics */ FT_UInt blue_count; - AF_LatinBlueRec blues[AF_LATIN_BLUE_MAX]; + AF_LatinBlueRec blues[AF_BLUE_STRINGSET_MAX]; FT_Fixed org_scale; FT_Pos org_delta; diff --git a/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.c b/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.c index b1e9658d5d7..a6d564a28f5 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.c @@ -76,8 +76,9 @@ AF_Scaler scaler = &dummy->root.scaler; - glyph_index = FT_Get_Char_Index( face, - metrics->root.clazz->standard_char ); + glyph_index = FT_Get_Char_Index( + face, + metrics->root.script_class->standard_char ); if ( glyph_index == 0 ) goto Exit; @@ -409,11 +410,11 @@ blue->flags |= AF_LATIN_BLUE_TOP; /* - * The following flags is used later to adjust the y and x scales + * The following flag is used later to adjust the y and x scales * in order to optimize the pixel grid alignment of the top of small * letters. */ - if ( bb == AF_LATIN_BLUE_SMALL_TOP ) + if ( AF_LATIN_IS_X_HEIGHT_BLUE( bb ) ) blue->flags |= AF_LATIN_BLUE_ADJUSTMENT; FT_TRACE5(( " -> reference = %ld\n" @@ -2379,18 +2380,10 @@ /*************************************************************************/ - static const AF_Script_UniRangeRec af_latin2_uniranges[] = - { - AF_UNIRANGE_REC( 32UL, 127UL ), /* TODO: Add new Unicode ranges here! */ - AF_UNIRANGE_REC( 160UL, 255UL ), - AF_UNIRANGE_REC( 0UL, 0UL ) - }; + AF_DEFINE_WRITING_SYSTEM_CLASS( + af_latin2_writing_system_class, - - AF_DEFINE_SCRIPT_CLASS( af_latin2_script_class, - AF_SCRIPT_LATIN2, - af_latin2_uniranges, - 'o', + AF_WRITING_SYSTEM_LATIN2, sizeof ( AF_LatinMetricsRec ), @@ -2403,4 +2396,53 @@ ) + /* XXX: this should probably fine tuned to differentiate better between */ + /* scripts... */ + + static const AF_Script_UniRangeRec af_ltn2_uniranges[] = + { + AF_UNIRANGE_REC( 0x0020UL, 0x007FUL ), /* Basic Latin (no control chars) */ + AF_UNIRANGE_REC( 0x00A0UL, 0x00FFUL ), /* Latin-1 Supplement (no control chars) */ + AF_UNIRANGE_REC( 0x0100UL, 0x017FUL ), /* Latin Extended-A */ + AF_UNIRANGE_REC( 0x0180UL, 0x024FUL ), /* Latin Extended-B */ + AF_UNIRANGE_REC( 0x0250UL, 0x02AFUL ), /* IPA Extensions */ + AF_UNIRANGE_REC( 0x02B0UL, 0x02FFUL ), /* Spacing Modifier Letters */ + AF_UNIRANGE_REC( 0x0300UL, 0x036FUL ), /* Combining Diacritical Marks */ + AF_UNIRANGE_REC( 0x0370UL, 0x03FFUL ), /* Greek and Coptic */ + AF_UNIRANGE_REC( 0x0400UL, 0x04FFUL ), /* Cyrillic */ + AF_UNIRANGE_REC( 0x0500UL, 0x052FUL ), /* Cyrillic Supplement */ + AF_UNIRANGE_REC( 0x1D00UL, 0x1D7FUL ), /* Phonetic Extensions */ + AF_UNIRANGE_REC( 0x1D80UL, 0x1DBFUL ), /* Phonetic Extensions Supplement */ + AF_UNIRANGE_REC( 0x1DC0UL, 0x1DFFUL ), /* Combining Diacritical Marks Supplement */ + AF_UNIRANGE_REC( 0x1E00UL, 0x1EFFUL ), /* Latin Extended Additional */ + AF_UNIRANGE_REC( 0x1F00UL, 0x1FFFUL ), /* Greek Extended */ + AF_UNIRANGE_REC( 0x2000UL, 0x206FUL ), /* General Punctuation */ + AF_UNIRANGE_REC( 0x2070UL, 0x209FUL ), /* Superscripts and Subscripts */ + AF_UNIRANGE_REC( 0x20A0UL, 0x20CFUL ), /* Currency Symbols */ + AF_UNIRANGE_REC( 0x2150UL, 0x218FUL ), /* Number Forms */ + AF_UNIRANGE_REC( 0x2460UL, 0x24FFUL ), /* Enclosed Alphanumerics */ + AF_UNIRANGE_REC( 0x2C60UL, 0x2C7FUL ), /* Latin Extended-C */ + AF_UNIRANGE_REC( 0x2DE0UL, 0x2DFFUL ), /* Cyrillic Extended-A */ + AF_UNIRANGE_REC( 0x2E00UL, 0x2E7FUL ), /* Supplemental Punctuation */ + AF_UNIRANGE_REC( 0xA640UL, 0xA69FUL ), /* Cyrillic Extended-B */ + AF_UNIRANGE_REC( 0xA720UL, 0xA7FFUL ), /* Latin Extended-D */ + AF_UNIRANGE_REC( 0xFB00UL, 0xFB06UL ), /* Alphab. Present. Forms (Latin Ligs) */ + AF_UNIRANGE_REC( 0x1D400UL, 0x1D7FFUL ), /* Mathematical Alphanumeric Symbols */ + AF_UNIRANGE_REC( 0x1F100UL, 0x1F1FFUL ), /* Enclosed Alphanumeric Supplement */ + AF_UNIRANGE_REC( 0UL, 0UL ) + }; + + + AF_DEFINE_SCRIPT_CLASS( + af_ltn2_script_class, + + AF_SCRIPT_LTN2, + AF_BLUE_STRINGSET_LATN, + AF_WRITING_SYSTEM_LATIN2, + + af_ltn2_uniranges, + 'o' + ) + + /* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.h b/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.h index cbfa395522e..f7f6d8d7c57 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/aflatin2.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter hinting routines for latin script (specification). */ /* */ -/* Copyright 2003-2007, 2012 by */ +/* Copyright 2003-2007, 2012, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -25,9 +25,21 @@ FT_BEGIN_HEADER - /* the latin-specific script class */ + /* the `latin' writing system */ + + AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin2_writing_system_class ) + + + /* the latin-specific script classes */ + + AF_DECLARE_SCRIPT_CLASS( af_ltn2_script_class ) /* XXX */ +#if 0 + AF_DECLARE_SCRIPT_CLASS( af_arm2_script_class ) + AF_DECLARE_SCRIPT_CLASS( af_cyr2_script_class ) + AF_DECLARE_SCRIPT_CLASS( af_grk2_script_class ) + AF_DECLARE_SCRIPT_CLASS( af_hbr2_script_class ) +#endif - AF_DECLARE_SCRIPT_CLASS( af_latin2_script_class ) /* */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afloader.c b/reactos/lib/3rdparty/freetype/src/autofit/afloader.c index 17a6fb7c3b8..b49f8c096ae 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afloader.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afloader.c @@ -21,6 +21,7 @@ #include "afhints.h" #include "aferrors.h" #include "afmodule.h" +#include "afpic.h" /* Initialize glyph loader. */ @@ -180,10 +181,20 @@ /* now load the slot image into the auto-outline and run the */ /* automatic hinting process */ - if ( metrics->clazz->script_hints_apply ) - metrics->clazz->script_hints_apply( hints, - &gloader->current.outline, - metrics ); + { +#ifdef FT_CONFIG_OPTION_PIC + AF_FaceGlobals globals = loader->globals; +#endif + AF_WritingSystemClass writing_system_class = + AF_WRITING_SYSTEM_CLASSES_GET + [metrics->script_class->writing_system]; + + + if ( writing_system_class->script_hints_apply ) + writing_system_class->script_hints_apply( hints, + &gloader->current.outline, + metrics ); + } /* we now need to adjust the metrics according to the change in */ /* width/positioning that occurred during the hinting process */ @@ -519,33 +530,41 @@ if ( !error ) { AF_ScriptMetrics metrics; - FT_UInt options = 0; + FT_UInt options = AF_SCRIPT_DFLT; #ifdef FT_OPTION_AUTOFIT2 - /* XXX: undocumented hook to activate the latin2 hinter */ + /* XXX: undocumented hook to activate the latin2 writing system */ if ( load_flags & ( 1UL << 20 ) ) - options = 2; + options = AF_SCRIPT_LTN2; #endif error = af_face_globals_get_metrics( loader->globals, gindex, options, &metrics ); if ( !error ) { +#ifdef FT_CONFIG_OPTION_PIC + AF_FaceGlobals globals = loader->globals; +#endif + AF_WritingSystemClass writing_system_class = + AF_WRITING_SYSTEM_CLASSES_GET + [metrics->script_class->writing_system]; + + loader->metrics = metrics; - if ( metrics->clazz->script_metrics_scale ) - metrics->clazz->script_metrics_scale( metrics, &scaler ); + if ( writing_system_class->script_metrics_scale ) + writing_system_class->script_metrics_scale( metrics, &scaler ); else metrics->scaler = scaler; load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_IGNORE_TRANSFORM; load_flags &= ~FT_LOAD_RENDER; - if ( metrics->clazz->script_hints_init ) + if ( writing_system_class->script_hints_init ) { - error = metrics->clazz->script_hints_init( &loader->hints, - metrics ); + error = writing_system_class->script_hints_init( &loader->hints, + metrics ); if ( error ) goto Exit; } diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afpic.c b/reactos/lib/3rdparty/freetype/src/autofit/afpic.c index 45e1448c089..92d696d296d 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afpic.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/afpic.c @@ -43,13 +43,10 @@ /* forward declaration of PIC init functions from script classes */ -#include "aflatin.h" -#ifdef FT_OPTION_AUTOFIT2 -#include "aflatin2.h" -#endif -#include "afcjk.h" -#include "afdummy.h" -#include "afindic.h" +#undef WRITING_SYSTEM +#define WRITING_SYSTEM( ws, WS ) /* empty */ + +#include "afwrtsys.h" void @@ -100,27 +97,31 @@ FT_Init_Class_af_service_properties( &container->af_service_properties ); - for ( ss = 0 ; ss < AF_SCRIPT_CLASSES_REC_COUNT ; ss++ ) - { + for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX - 1; ss++ ) + container->af_writing_system_classes[ss] = + &container->af_writing_system_classes_rec[ss]; + container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX - 1] = NULL; + + for ( ss = 0; ss < AF_SCRIPT_MAX - 1; ss++ ) container->af_script_classes[ss] = &container->af_script_classes_rec[ss]; - } - container->af_script_classes[AF_SCRIPT_CLASSES_COUNT - 1] = NULL; + container->af_script_classes[AF_SCRIPT_MAX - 1] = NULL; + +#undef WRITING_SYSTEM +#define WRITING_SYSTEM( ws, WS ) \ + FT_Init_Class_af_ ## ws ## _writing_system_class( \ + &container->af_writing_system_classes_rec[ss++] ); - /* add call to initialization function when you add new scripts */ ss = 0; - FT_Init_Class_af_dummy_script_class( - &container->af_script_classes_rec[ss++] ); -#ifdef FT_OPTION_AUTOFIT2 - FT_Init_Class_af_latin2_script_class( - &container->af_script_classes_rec[ss++] ); -#endif - FT_Init_Class_af_latin_script_class( - &container->af_script_classes_rec[ss++] ); - FT_Init_Class_af_cjk_script_class( - &container->af_script_classes_rec[ss++] ); - FT_Init_Class_af_indic_script_class( - &container->af_script_classes_rec[ss++] ); +#include "afwrtsys.h" + +#undef SCRIPT +#define SCRIPT( s, S, d ) \ + FT_Init_Class_af_ ## s ## _script_class( \ + &container->af_script_classes_rec[ss++] ); + + ss = 0; +#include "afscript.h" FT_Init_Class_af_autofitter_interface( library, &container->af_autofitter_interface ); diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afpic.h b/reactos/lib/3rdparty/freetype/src/autofit/afpic.h index 0acf803894c..09f8258a2e8 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/afpic.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/afpic.h @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services for autofit module. */ /* */ -/* Copyright 2009, 2011-2012 by */ +/* Copyright 2009, 2011-2013 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -27,11 +27,12 @@ FT_BEGIN_HEADER #ifndef FT_CONFIG_OPTION_PIC -#define AF_SERVICES_GET af_services -#define AF_SERVICE_PROPERTIES_GET af_service_properties +#define AF_SERVICES_GET af_services +#define AF_SERVICE_PROPERTIES_GET af_service_properties -#define AF_SCRIPT_CLASSES_GET af_script_classes -#define AF_INTERFACE_GET af_autofitter_interface +#define AF_WRITING_SYSTEM_CLASSES_GET af_writing_system_classes +#define AF_SCRIPT_CLASSES_GET af_script_classes +#define AF_INTERFACE_GET af_autofitter_interface #else /* FT_CONFIG_OPTION_PIC */ @@ -40,24 +41,22 @@ FT_BEGIN_HEADER #include "aftypes.h" - /* increase these when you add new scripts, */ - /* and update autofit_module_class_pic_init */ -#ifdef FT_OPTION_AUTOFIT2 -#define AF_SCRIPT_CLASSES_COUNT 6 -#else -#define AF_SCRIPT_CLASSES_COUNT 5 -#endif - -#define AF_SCRIPT_CLASSES_REC_COUNT ( AF_SCRIPT_CLASSES_COUNT - 1 ) - typedef struct AFModulePIC_ { FT_ServiceDescRec* af_services; FT_Service_PropertiesRec af_service_properties; - AF_ScriptClass af_script_classes[AF_SCRIPT_CLASSES_COUNT]; - AF_ScriptClassRec af_script_classes_rec[AF_SCRIPT_CLASSES_REC_COUNT]; + AF_WritingSystemClass af_writing_system_classes + [AF_WRITING_SYSTEM_MAX]; + AF_WritingSystemClassRec af_writing_system_classes_rec + [AF_WRITING_SYSTEM_MAX - 1]; + + AF_ScriptClass af_script_classes + [AF_SCRIPT_MAX]; + AF_ScriptClassRec af_script_classes_rec + [AF_SCRIPT_MAX - 1]; + FT_AutoHinter_InterfaceRec af_autofitter_interface; } AFModulePIC; @@ -71,6 +70,8 @@ FT_BEGIN_HEADER #define AF_SERVICE_PROPERTIES_GET \ ( GET_PIC( library )->af_service_properties ) +#define AF_WRITING_SYSTEM_CLASSES_GET \ + ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_writing_system_classes ) #define AF_SCRIPT_CLASSES_GET \ ( GET_PIC( FT_FACE_LIBRARY( globals->face ) )->af_script_classes ) #define AF_INTERFACE_GET \ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afscript.h b/reactos/lib/3rdparty/freetype/src/autofit/afscript.h new file mode 100644 index 00000000000..be0169a83cb --- /dev/null +++ b/reactos/lib/3rdparty/freetype/src/autofit/afscript.h @@ -0,0 +1,37 @@ +/***************************************************************************/ +/* */ +/* afscript.h */ +/* */ +/* Auto-fitter scripts (specification only). */ +/* */ +/* Copyright 2013 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + + /* The following part can be included multiple times. */ + /* Define `SCRIPT' as needed. */ + + + /* Add new scripts here. */ + + SCRIPT( cyrl, CYRL, "Cyrillic" ) + SCRIPT( deva, DEVA, "Indic scripts" ) + SCRIPT( dflt, DFLT, "no script" ) + SCRIPT( grek, GREK, "Greek" ) + SCRIPT( hani, HANI, "CJKV ideographs" ) + SCRIPT( hebr, HEBR, "Hebrew" ) + SCRIPT( latn, LATN, "Latin" ) +#ifdef FT_OPTION_AUTOFIT2 + SCRIPT( ltn2, LTN2, "Latin 2" ) +#endif + + +/* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/aftypes.h b/reactos/lib/3rdparty/freetype/src/autofit/aftypes.h index 9acd7ad6d24..cda1f896595 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/aftypes.h +++ b/reactos/lib/3rdparty/freetype/src/autofit/aftypes.h @@ -4,7 +4,7 @@ /* */ /* Auto-fitter types (specification only). */ /* */ -/* Copyright 2003-2009, 2011-2012 by */ +/* Copyright 2003-2009, 2011-2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -20,15 +20,12 @@ * * The auto-fitter is a complete rewrite of the old auto-hinter. * Its main feature is the ability to differentiate between different - * scripts in order to apply language-specific rules. + * writing systems in order to apply script-specific rules. * * The code has also been compartmentized into several entities that * should make algorithmic experimentation easier than with the old * code. * - * Finally, we get rid of the Catharon license, since this code is - * released under the FreeType one. - * *************************************************************************/ @@ -42,6 +39,8 @@ #include FT_INTERNAL_OBJECTS_H #include FT_INTERNAL_DEBUG_H +#include "afblue.h" + FT_BEGIN_HEADER @@ -201,56 +200,21 @@ extern void* _af_debug_hints; /*************************************************************************/ /*************************************************************************/ /***** *****/ - /***** S C R I P T S *****/ + /***** S C R I P T M E T R I C S *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ - /* - * The list of known scripts. Each different script corresponds to the - * following information: - * - * - A set of Unicode ranges to test whether the face supports the - * script. - * - * - A specific global analyzer that will compute global metrics - * specific to the script. - * - * - A specific glyph analyzer that will compute segments and - * edges for each glyph covered by the script. - * - * - A specific grid-fitting algorithm that will distort the - * scaled glyph outline according to the results of the glyph - * analyzer. - * - * Note that a given analyzer and/or grid-fitting algorithm can be - * used by more than one script. - */ + /* This is the main structure which combines writing systems and script */ + /* data (for a given face object, see below). */ - typedef enum AF_Script_ - { - AF_SCRIPT_DUMMY = 0, - AF_SCRIPT_LATIN = 1, - AF_SCRIPT_CJK = 2, - AF_SCRIPT_INDIC = 3, -#ifdef FT_OPTION_AUTOFIT2 - AF_SCRIPT_LATIN2 = 4, -#endif - - /* add new scripts here. Don't forget to update the list in */ - /* `afglobal.c'. */ - - AF_SCRIPT_MAX /* do not remove */ - - } AF_Script; - - - typedef struct AF_ScriptClassRec_ const* AF_ScriptClass; - typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals; + typedef struct AF_WritingSystemClassRec_ const* AF_WritingSystemClass; + typedef struct AF_ScriptClassRec_ const* AF_ScriptClass; + typedef struct AF_FaceGlobalsRec_* AF_FaceGlobals; typedef struct AF_ScriptMetricsRec_ { - AF_ScriptClass clazz; + AF_ScriptClass script_class; AF_ScalerRec scaler; FT_Bool digits_have_same_width; @@ -284,23 +248,54 @@ extern void* _af_debug_hints; AF_ScriptMetrics metrics ); - typedef struct AF_Script_UniRangeRec_ + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** W R I T I N G S Y S T E M S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* + * In FreeType, a writing system consists of multiple scripts which can + * be handled similarly *in a typographical way*; the relationship is not + * based on history. For example, both the Greek and the unrelated + * Armenian scripts share the same features like ascender, descender, + * x-height, etc. Essentially, a writing system is covered by a + * submodule of the auto-fitter; it contains + * + * - a specific global analyzer which computes global metrics specific to + * the script (based on script-specific characters to identify ascender + * height, x-height, etc.), + * + * - a specific glyph analyzer that computes segments and edges for each + * glyph covered by the script, + * + * - a specific grid-fitting algorithm that distorts the scaled glyph + * outline according to the results of the glyph analyzer. + */ + +#define __AFWRTSYS_H__ /* don't load header files */ +#undef WRITING_SYSTEM +#define WRITING_SYSTEM( ws, WS ) \ + AF_WRITING_SYSTEM_ ## WS, + + /* The list of known writing systems. */ + typedef enum AF_WritingSystem_ { - FT_UInt32 first; - FT_UInt32 last; - } AF_Script_UniRangeRec; +#include "afwrtsys.h" -#define AF_UNIRANGE_REC( a, b ) { (FT_UInt32)(a), (FT_UInt32)(b) } + AF_WRITING_SYSTEM_MAX /* do not remove */ - typedef const AF_Script_UniRangeRec *AF_Script_UniRange; + } AF_WritingSystem; + +#undef __AFWRTSYS_H__ - typedef struct AF_ScriptClassRec_ + typedef struct AF_WritingSystemClassRec_ { - AF_Script script; - AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */ - FT_UInt32 standard_char; /* for default width and height */ + AF_WritingSystem writing_system; FT_Offset script_metrics_size; AF_Script_InitMetricsFunc script_metrics_init; @@ -310,59 +305,167 @@ extern void* _af_debug_hints; AF_Script_InitHintsFunc script_hints_init; AF_Script_ApplyHintsFunc script_hints_apply; + } AF_WritingSystemClassRec; + + + /*************************************************************************/ + /*************************************************************************/ + /***** *****/ + /***** S C R I P T S *****/ + /***** *****/ + /*************************************************************************/ + /*************************************************************************/ + + /* + * Each script is associated with a set of Unicode ranges which gets used + * to test whether the font face supports the script. It also references + * the writing system it belongs to. + * + * We use four-letter script tags from the OpenType specification. + */ + +#undef SCRIPT +#define SCRIPT( s, S, d ) \ + AF_SCRIPT_ ## S, + + /* The list of known scripts. */ + typedef enum AF_Script_ + { + +#include "afscript.h" + + AF_SCRIPT_MAX /* do not remove */ + + } AF_Script; + + + typedef struct AF_Script_UniRangeRec_ + { + FT_UInt32 first; + FT_UInt32 last; + + } AF_Script_UniRangeRec; + +#define AF_UNIRANGE_REC( a, b ) { (FT_UInt32)(a), (FT_UInt32)(b) } + + typedef const AF_Script_UniRangeRec* AF_Script_UniRange; + + + typedef struct AF_ScriptClassRec_ + { + AF_Script script; + AF_Blue_Stringset blue_stringset; + AF_WritingSystem writing_system; + + AF_Script_UniRange script_uni_ranges; /* last must be { 0, 0 } */ + FT_UInt32 standard_char; /* for default width and height */ + } AF_ScriptClassRec; /* Declare and define vtables for classes */ #ifndef FT_CONFIG_OPTION_PIC +#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \ + FT_CALLBACK_TABLE const AF_WritingSystemClassRec \ + writing_system_class; + +#define AF_DEFINE_WRITING_SYSTEM_CLASS( \ + writing_system_class, \ + system, \ + m_size, \ + m_init, \ + m_scale, \ + m_done, \ + h_init, \ + h_apply ) \ + FT_CALLBACK_TABLE_DEF \ + const AF_WritingSystemClassRec writing_system_class = \ + { \ + system, \ + \ + m_size, \ + \ + m_init, \ + m_scale, \ + m_done, \ + \ + h_init, \ + h_apply \ + }; + + #define AF_DECLARE_SCRIPT_CLASS( script_class ) \ FT_CALLBACK_TABLE const AF_ScriptClassRec \ script_class; -#define AF_DEFINE_SCRIPT_CLASS( script_class, script_, ranges, def_char, \ - m_size, \ - m_init, m_scale, m_done, h_init, h_apply ) \ - FT_CALLBACK_TABLE_DEF const AF_ScriptClassRec script_class = \ - { \ - script_, \ - ranges, \ - def_char, \ - \ - m_size, \ - \ - m_init, \ - m_scale, \ - m_done, \ - \ - h_init, \ - h_apply \ +#define AF_DEFINE_SCRIPT_CLASS( \ + script_class, \ + script_, \ + blue_stringset_, \ + writing_system_, \ + ranges, \ + std_char ) \ + FT_CALLBACK_TABLE_DEF \ + const AF_ScriptClassRec script_class = \ + { \ + script_, \ + blue_stringset_, \ + writing_system_, \ + ranges, \ + std_char \ }; #else /* FT_CONFIG_OPTION_PIC */ +#define AF_DECLARE_WRITING_SYSTEM_CLASS( writing_system_class ) \ + FT_LOCAL( void ) \ + FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac ); + +#define AF_DEFINE_WRITING_SYSTEM_CLASS( \ + writing_system_class, \ + system, \ + m_size, \ + m_init, \ + m_scale, \ + m_done, \ + h_init, \ + h_apply ) \ + FT_LOCAL_DEF( void ) \ + FT_Init_Class_ ## writing_system_class( AF_WritingSystemClassRec* ac ) \ + { \ + ac->writing_system = system; \ + \ + ac->script_metrics_size = m_size; \ + \ + ac->script_metrics_init = m_init; \ + ac->script_metrics_scale = m_scale; \ + ac->script_metrics_done = m_done; \ + \ + ac->script_hints_init = h_init; \ + ac->script_hints_apply = h_apply; \ + } + + #define AF_DECLARE_SCRIPT_CLASS( script_class ) \ FT_LOCAL( void ) \ FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ); -#define AF_DEFINE_SCRIPT_CLASS( script_class, script_, ranges, def_char, \ - m_size, \ - m_init, m_scale, m_done, h_init, h_apply ) \ - FT_LOCAL_DEF( void ) \ - FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \ - { \ - ac->script = script_; \ - ac->script_uni_ranges = ranges; \ - ac->default_char = def_char; \ - \ - ac->script_metrics_size = m_size; \ - \ - ac->script_metrics_init = m_init; \ - ac->script_metrics_scale = m_scale; \ - ac->script_metrics_done = m_done; \ - \ - ac->script_hints_init = h_init; \ - ac->script_hints_apply = h_apply; \ +#define AF_DEFINE_SCRIPT_CLASS( \ + script_class, \ + script_, \ + blue_string_set_, \ + writing_system_, \ + ranges, \ + std_char ) \ + FT_LOCAL_DEF( void ) \ + FT_Init_Class_ ## script_class( AF_ScriptClassRec* ac ) \ + { \ + ac->script = script_; \ + ac->blue_stringset = blue_stringset_; \ + ac->writing_system = writing_system_; \ + ac->script_uni_ranges = ranges; \ + ac->standard_char = std_char; \ } #endif /* FT_CONFIG_OPTION_PIC */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/afwrtsys.h b/reactos/lib/3rdparty/freetype/src/autofit/afwrtsys.h new file mode 100644 index 00000000000..602c558842e --- /dev/null +++ b/reactos/lib/3rdparty/freetype/src/autofit/afwrtsys.h @@ -0,0 +1,51 @@ +/***************************************************************************/ +/* */ +/* afwrtsys.h */ +/* */ +/* Auto-fitter writing systems (specification only). */ +/* */ +/* Copyright 2013 by */ +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ +/* */ +/* This file is part of the FreeType project, and may only be used, */ +/* modified, and distributed under the terms of the FreeType project */ +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ +/* this file you indicate that you have read the license and */ +/* understand and accept it fully. */ +/* */ +/***************************************************************************/ + + +#ifndef __AFWRTSYS_H__ +#define __AFWRTSYS_H__ + + /* Since preprocessor directives can't create other preprocessor */ + /* directives, we have to include the header files manually. */ + +#include "afdummy.h" +#include "aflatin.h" +#include "afcjk.h" +#include "afindic.h" +#ifdef FT_OPTION_AUTOFIT2 +#include "aflatin2.h" +#endif + +#endif /* __AFWRTSYS_H__ */ + + + /* The following part can be included multiple times. */ + /* Define `WRITING_SYSTEM' as needed. */ + + + /* Add new writing systems here. */ + + WRITING_SYSTEM( dummy, DUMMY ) + WRITING_SYSTEM( latin, LATIN ) + WRITING_SYSTEM( cjk, CJK ) + WRITING_SYSTEM( indic, INDIC ) +#ifdef FT_OPTION_AUTOFIT2 + WRITING_SYSTEM( latin2, LATIN2 ) +#endif + + +/* END */ diff --git a/reactos/lib/3rdparty/freetype/src/autofit/autofit.c b/reactos/lib/3rdparty/freetype/src/autofit/autofit.c index 3883a0a7060..b23374a23a1 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/autofit.c +++ b/reactos/lib/3rdparty/freetype/src/autofit/autofit.c @@ -4,7 +4,7 @@ /* */ /* Auto-fitter module (body). */ /* */ -/* Copyright 2003-2007, 2011 by */ +/* Copyright 2003-2007, 2011, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -20,6 +20,7 @@ #include #include "afpic.c" #include "afangles.c" +#include "afblue.c" #include "afglobal.c" #include "afhints.c" diff --git a/reactos/lib/3rdparty/freetype/src/autofit/rules.mk b/reactos/lib/3rdparty/freetype/src/autofit/rules.mk index b76bb79ab43..745adab25d7 100644 --- a/reactos/lib/3rdparty/freetype/src/autofit/rules.mk +++ b/reactos/lib/3rdparty/freetype/src/autofit/rules.mk @@ -3,7 +3,7 @@ # -# Copyright 2003, 2004, 2005, 2006, 2007, 2011 by +# Copyright 2003-2007, 2011, 2013 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -26,6 +26,7 @@ AUTOF_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(AUTOF_DIR)) # AUTOF driver sources (i.e., C files) # AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \ + $(AUTOF_DIR)/afblue.c \ $(AUTOF_DIR)/afcjk.c \ $(AUTOF_DIR)/afdummy.c \ $(AUTOF_DIR)/afglobal.c \ @@ -41,7 +42,9 @@ AUTOF_DRV_SRC := $(AUTOF_DIR)/afangles.c \ # AUTOF_DRV_H := $(AUTOF_DRV_SRC:%c=%h) \ $(AUTOF_DIR)/aferrors.h \ - $(AUTOF_DIR)/aftypes.h + $(AUTOF_DIR)/afscript.h \ + $(AUTOF_DIR)/aftypes.h \ + $(AUTOF_DIR)/afwrtsys.h # AUTOF driver object(s) diff --git a/reactos/lib/3rdparty/freetype/src/base/ftbbox.c b/reactos/lib/3rdparty/freetype/src/base/ftbbox.c index 6d1c44cb2e8..8d3f383b4d6 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftbbox.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftbbox.c @@ -85,7 +85,7 @@ /* BBox_Conic_Check */ /* */ /* */ - /* Finds the extrema of a 1-dimensional conic Bezier curve and update */ + /* Find the extrema of a 1-dimensional conic Bezier curve and update */ /* a bounding range. This version uses direct computation, as it */ /* doesn't need square roots. */ /* */ @@ -108,30 +108,19 @@ FT_Pos* min, FT_Pos* max ) { - if ( y1 <= y3 && y2 == y1 ) /* flat arc */ - goto Suite; + /* This function is only called when a control off-point is outside */ + /* the bbox that contains all on-points. It finds a local extremum */ + /* within the segment, equal to (y1*y3 - y2*y2)/(y1 - 2*y2 + y3). */ + /* Or, offsetting from y2, we get */ - if ( y1 < y3 ) - { - if ( y2 >= y1 && y2 <= y3 ) /* ascending arc */ - goto Suite; - } - else - { - if ( y2 >= y3 && y2 <= y1 ) /* descending arc */ - { - y2 = y1; - y1 = y3; - y3 = y2; - goto Suite; - } - } + y1 -= y2; + y3 -= y2; + y2 += FT_MulDiv( y1, y3, y1 + y3 ); - y1 = y3 = y1 - FT_MulDiv( y2 - y1, y2 - y1, y1 - 2*y2 + y3 ); - - Suite: - if ( y1 < *min ) *min = y1; - if ( y3 > *max ) *max = y3; + if ( y2 < *min ) + *min = y2; + if ( y2 > *max ) + *max = y2; } @@ -195,9 +184,9 @@ /* BBox_Cubic_Check */ /* */ /* */ - /* Finds the extrema of a 1-dimensional cubic Bezier curve and */ - /* updates a bounding range. This version uses splitting because we */ - /* don't want to use square roots and extra accuracy. */ + /* Find the extrema of a 1-dimensional cubic Bezier curve and */ + /* update a bounding range. This version uses iterative splitting */ + /* because it is faster than the exact solution with square roots. */ /* */ /* */ /* p1 :: The start coordinate. */ @@ -213,28 +202,16 @@ /* */ /* max :: The address of the current maximum. */ /* */ - -#if 0 - - static void - BBox_Cubic_Check( FT_Pos p1, - FT_Pos p2, - FT_Pos p3, - FT_Pos p4, - FT_Pos* min, - FT_Pos* max ) + static FT_Pos + update_cubic_max( FT_Pos q1, + FT_Pos q2, + FT_Pos q3, + FT_Pos q4, + FT_Pos max ) { - FT_Pos q1, q2, q3, q4; - - - q1 = p1; - q2 = p2; - q3 = p3; - q4 = p4; - - /* for a conic segment to possibly reach new maximum */ - /* one of its off-points must be above the current value */ - while ( q2 > *max || q3 > *max ) + /* for a cubic segment to possibly reach new maximum, at least */ + /* one of its off-points must stay above the current value */ + while ( q2 > max || q3 > max ) { /* determine which half contains the maximum and split */ if ( q1 + q2 > q3 + q4 ) /* first half */ @@ -260,232 +237,92 @@ q3 = q3 / 2; } - /* check if either end reached the maximum */ + /* check whether either end reached the maximum */ if ( q1 == q2 && q1 >= q3 ) { - *max = q1; + max = q1; break; } if ( q3 == q4 && q2 <= q4 ) { - *max = q4; + max = q4; break; } } - q1 = p1; - q2 = p2; - q3 = p3; - q4 = p4; - - /* for a conic segment to possibly reach new minimum */ - /* one of its off-points must be below the current value */ - while ( q2 < *min || q3 < *min ) - { - /* determine which half contains the minimum and split */ - if ( q1 + q2 < q3 + q4 ) /* first half */ - { - q4 = q4 + q3; - q3 = q3 + q2; - q2 = q2 + q1; - q4 = q4 + q3; - q3 = q3 + q2; - q4 = ( q4 + q3 ) / 8; - q3 = q3 / 4; - q2 = q2 / 2; - } - else /* second half */ - { - q1 = q1 + q2; - q2 = q2 + q3; - q3 = q3 + q4; - q1 = q1 + q2; - q2 = q2 + q3; - q1 = ( q1 + q2 ) / 8; - q2 = q2 / 4; - q3 = q3 / 2; - } - - /* check if either end reached the minimum */ - if ( q1 == q2 && q1 <= q3 ) - { - *min = q1; - break; - } - if ( q3 == q4 && q2 >= q4 ) - { - *min = q4; - break; - } - } - } - -#else - - static void - test_cubic_extrema( FT_Pos y1, - FT_Pos y2, - FT_Pos y3, - FT_Pos y4, - FT_Fixed u, - FT_Pos* min, - FT_Pos* max ) - { - /* FT_Pos a = y4 - 3*y3 + 3*y2 - y1; */ - FT_Pos b = y3 - 2*y2 + y1; - FT_Pos c = y2 - y1; - FT_Pos d = y1; - FT_Pos y; - FT_Fixed uu; - - FT_UNUSED ( y4 ); - - - /* The polynomial is */ - /* */ - /* P(x) = a*x^3 + 3b*x^2 + 3c*x + d , */ - /* */ - /* dP/dx = 3a*x^2 + 6b*x + 3c . */ - /* */ - /* However, we also have */ - /* */ - /* dP/dx(u) = 0 , */ - /* */ - /* which implies by subtraction that */ - /* */ - /* P(u) = b*u^2 + 2c*u + d . */ - - if ( u > 0 && u < 0x10000L ) - { - uu = FT_MulFix( u, u ); - y = d + FT_MulFix( c, 2*u ) + FT_MulFix( b, uu ); - - if ( y < *min ) *min = y; - if ( y > *max ) *max = y; - } + return max; } static void - BBox_Cubic_Check( FT_Pos y1, - FT_Pos y2, - FT_Pos y3, - FT_Pos y4, + BBox_Cubic_Check( FT_Pos p1, + FT_Pos p2, + FT_Pos p3, + FT_Pos p4, FT_Pos* min, FT_Pos* max ) { - /* always compare first and last points */ - if ( y1 < *min ) *min = y1; - else if ( y1 > *max ) *max = y1; + FT_Pos nmin, nmax; + FT_Int shift; - if ( y4 < *min ) *min = y4; - else if ( y4 > *max ) *max = y4; - /* now, try to see if there are split points here */ - if ( y1 <= y4 ) + /* This function is only called when a control off-point is outside */ + /* the bbox that contains all on-points. It finds a local extremum */ + /* within the segment using iterative bisection of the segment. */ + /* The fixed-point arithmetic of bisection is inherently stable */ + /* but may loose accuracy in the two lowest bits. To compensate, */ + /* we upscale the segment if there is room. Large values may need */ + /* to be downscaled to avoid overflows during bisection. */ + /* The control off-point outside the bbox is likely to have the top */ + /* absolute value among arguments. */ + + shift = 27 - FT_MSB( FT_ABS( p2 ) | FT_ABS( p3 ) ); + + if ( shift > 0 ) { - /* flat or ascending arc test */ - if ( y1 <= y2 && y2 <= y4 && y1 <= y3 && y3 <= y4 ) - return; + /* upscaling too much just wastes time */ + if ( shift > 2 ) + shift = 2; + + p1 <<= shift; + p2 <<= shift; + p3 <<= shift; + p4 <<= shift; + nmin = *min << shift; + nmax = *max << shift; } - else /* y1 > y4 */ + else { - /* descending arc test */ - if ( y1 >= y2 && y2 >= y4 && y1 >= y3 && y3 >= y4 ) - return; + p1 >>= -shift; + p2 >>= -shift; + p3 >>= -shift; + p4 >>= -shift; + nmin = *min >> -shift; + nmax = *max >> -shift; } - /* There are some split points. Find them. */ - /* We already made sure that a, b, and c below cannot be all zero. */ + nmax = update_cubic_max( p1, p2, p3, p4, nmax ); + + /* now flip the signs to update the minimum */ + nmin = -update_cubic_max( -p1, -p2, -p3, -p4, -nmin ); + + if ( shift > 0 ) { - FT_Pos a = y4 - 3*y3 + 3*y2 - y1; - FT_Pos b = y3 - 2*y2 + y1; - FT_Pos c = y2 - y1; - FT_Pos d; - FT_Fixed t; - FT_Int shift; - - - /* We need to solve `ax^2+2bx+c' here, without floating points! */ - /* The trick is to normalize to a different representation in order */ - /* to use our 16.16 fixed-point routines. */ - /* */ - /* We compute FT_MulFix(b,b) and FT_MulFix(a,c) after normalization. */ - /* These values must fit into a single 16.16 value. */ - /* */ - /* We normalize a, b, and c to `8.16' fixed-point values to ensure */ - /* that their product is held in a `16.16' value including the sign. */ - /* Necessarily, we need to shift `a', `b', and `c' so that the most */ - /* significant bit of their absolute values is at position 22. */ - /* */ - /* This also means that we are using 23 bits of precision to compute */ - /* the zeros, independently of the range of the original polynomial */ - /* coefficients. */ - /* */ - /* This algorithm should ensure reasonably accurate values for the */ - /* zeros. Note that they are only expressed with 16 bits when */ - /* computing the extrema (the zeros need to be in 0..1 exclusive */ - /* to be considered part of the arc). */ - - shift = FT_MSB( FT_ABS( a ) | FT_ABS( b ) | FT_ABS( c ) ); - - if ( shift > 22 ) - { - shift -= 22; - - /* this loses some bits of precision, but we use 23 of them */ - /* for the computation anyway */ - a >>= shift; - b >>= shift; - c >>= shift; - } - else - { - shift = 22 - shift; - - a <<= shift; - b <<= shift; - c <<= shift; - } - - /* handle a == 0 */ - if ( a == 0 ) - { - if ( b != 0 ) - { - t = - FT_DivFix( c, b ) / 2; - test_cubic_extrema( y1, y2, y3, y4, t, min, max ); - } - } - else - { - /* solve the equation now */ - d = FT_MulFix( b, b ) - FT_MulFix( a, c ); - if ( d < 0 ) - return; - - if ( d == 0 ) - { - /* there is a single split point at -b/a */ - t = - FT_DivFix( b, a ); - test_cubic_extrema( y1, y2, y3, y4, t, min, max ); - } - else - { - /* there are two solutions; we need to filter them */ - d = FT_SqrtFixed( (FT_Int32)d ); - t = - FT_DivFix( b - d, a ); - test_cubic_extrema( y1, y2, y3, y4, t, min, max ); - - t = - FT_DivFix( b + d, a ); - test_cubic_extrema( y1, y2, y3, y4, t, min, max ); - } - } + nmin >>= shift; + nmax >>= shift; } + else + { + nmin <<= -shift; + nmax <<= -shift; + } + + if ( nmin < *min ) + *min = nmin; + if ( nmax > *max ) + *max = nmax; } -#endif - /*************************************************************************/ /* */ @@ -521,8 +358,9 @@ FT_Vector* to, TBBox_Rec* user ) { - /* we don't need to check `to' since it is always an `on' point, thus */ - /* within the bbox */ + /* We don't need to check `to' since it is always an on-point, */ + /* thus within the bbox. Only segments with an off-point outside */ + /* the bbox can possibly reach new extreme values. */ if ( CHECK_X( control1, user->bbox ) || CHECK_X( control2, user->bbox ) ) diff --git a/reactos/lib/3rdparty/freetype/src/base/ftbitmap.c b/reactos/lib/3rdparty/freetype/src/base/ftbitmap.c index 01271142e27..ad8a10044f2 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftbitmap.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftbitmap.c @@ -385,6 +385,10 @@ FT_Long l; + /* Short-circuit transparent color to avoid div-by-zero. */ + if ( !a ) + return 0; + /* * Luminosity for sRGB is defined using ~0.2126,0.7152,0.0722 * coefficients for RGB channels *on the linear colors*. diff --git a/reactos/lib/3rdparty/freetype/src/base/ftcalc.c b/reactos/lib/3rdparty/freetype/src/base/ftcalc.c index 0ec0d78930f..b23b4d44a46 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftcalc.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftcalc.c @@ -816,6 +816,8 @@ } +#if 0 + /* documentation is in ftcalc.h */ FT_BASE_DEF( FT_Int32 ) @@ -850,6 +852,8 @@ return (FT_Int32)root; } +#endif /* 0 */ + /* documentation is in ftcalc.h */ @@ -945,11 +949,27 @@ FT_Pos d_in, d_out, d_corner; + /* We approximate the Euclidean metric (sqrt(x^2 + y^2)) with */ + /* the Taxicab metric (|x| + |y|), which can be computed much */ + /* faster. If one of the two vectors is much longer than the */ + /* other one, the direction of the shorter vector doesn't */ + /* influence the result any more. */ + /* */ + /* corner */ + /* x---------------------------x */ + /* \ / */ + /* \ / */ + /* in \ / out */ + /* \ / */ + /* o */ + /* Point */ + /* */ + if ( ax < 0 ) ax = -ax; if ( ay < 0 ) ay = -ay; - d_in = ax + ay; + d_in = ax + ay; /* d_in = || in || */ ax = out_x; if ( ax < 0 ) @@ -957,7 +977,7 @@ ay = out_y; if ( ay < 0 ) ay = -ay; - d_out = ax + ay; + d_out = ax + ay; /* d_out = || out || */ ax = out_x + in_x; if ( ax < 0 ) @@ -965,7 +985,11 @@ ay = out_y + in_y; if ( ay < 0 ) ay = -ay; - d_corner = ax + ay; + d_corner = ax + ay; /* d_corner = || in + out || */ + + /* now do a simple length comparison: */ + /* */ + /* d_in + d_out < 17/16 d_corner */ return ( d_in + d_out - d_corner ) < ( d_corner >> 4 ); } diff --git a/reactos/lib/3rdparty/freetype/src/base/ftdebug.c b/reactos/lib/3rdparty/freetype/src/base/ftdebug.c index b9156d15ee3..39ac6add057 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftdebug.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftdebug.c @@ -152,7 +152,7 @@ /* the memory and stream components which are set to 7 and 5, */ /* respectively. */ /* */ - /* See the file for details of the */ + /* See the file for details of the */ /* available toggle names. */ /* */ /* The level must be between 0 and 7; 0 means quiet (except for serious */ diff --git a/reactos/lib/3rdparty/freetype/src/base/ftglyph.c b/reactos/lib/3rdparty/freetype/src/base/ftglyph.c index 5dd28a8c524..c62b3db0c39 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftglyph.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftglyph.c @@ -424,15 +424,16 @@ FT_Matrix* matrix, FT_Vector* delta ) { - const FT_Glyph_Class* clazz; - FT_Error error = FT_Err_Ok; + FT_Error error = FT_Err_Ok; if ( !glyph || !glyph->clazz ) error = FT_THROW( Invalid_Argument ); else { - clazz = glyph->clazz; + const FT_Glyph_Class* clazz = glyph->clazz; + + if ( clazz->glyph_transform ) { /* transform glyph image */ @@ -466,38 +467,33 @@ if ( !glyph || !glyph->clazz ) return; - else + + clazz = glyph->clazz; + if ( !clazz->glyph_bbox ) + return; + + /* retrieve bbox in 26.6 coordinates */ + clazz->glyph_bbox( glyph, acbox ); + + /* perform grid fitting if needed */ + if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT || + bbox_mode == FT_GLYPH_BBOX_PIXELS ) { - clazz = glyph->clazz; - if ( !clazz->glyph_bbox ) - return; - else - { - /* retrieve bbox in 26.6 coordinates */ - clazz->glyph_bbox( glyph, acbox ); - - /* perform grid fitting if needed */ - if ( bbox_mode == FT_GLYPH_BBOX_GRIDFIT || - bbox_mode == FT_GLYPH_BBOX_PIXELS ) - { - acbox->xMin = FT_PIX_FLOOR( acbox->xMin ); - acbox->yMin = FT_PIX_FLOOR( acbox->yMin ); - acbox->xMax = FT_PIX_CEIL( acbox->xMax ); - acbox->yMax = FT_PIX_CEIL( acbox->yMax ); - } - - /* convert to integer pixels if needed */ - if ( bbox_mode == FT_GLYPH_BBOX_TRUNCATE || - bbox_mode == FT_GLYPH_BBOX_PIXELS ) - { - acbox->xMin >>= 6; - acbox->yMin >>= 6; - acbox->xMax >>= 6; - acbox->yMax >>= 6; - } - } + acbox->xMin = FT_PIX_FLOOR( acbox->xMin ); + acbox->yMin = FT_PIX_FLOOR( acbox->yMin ); + acbox->xMax = FT_PIX_CEIL( acbox->xMax ); + acbox->yMax = FT_PIX_CEIL( acbox->yMax ); + } + + /* convert to integer pixels if needed */ + if ( bbox_mode == FT_GLYPH_BBOX_TRUNCATE || + bbox_mode == FT_GLYPH_BBOX_PIXELS ) + { + acbox->xMin >>= 6; + acbox->yMin >>= 6; + acbox->xMax >>= 6; + acbox->yMax >>= 6; } - return; } diff --git a/reactos/lib/3rdparty/freetype/src/base/ftinit.c b/reactos/lib/3rdparty/freetype/src/base/ftinit.c index 85f321fd2d4..6176273f0a6 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftinit.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftinit.c @@ -23,8 +23,8 @@ /* FT_Add_Default_Modules(): */ /* This function is used to add the set of default modules to a */ /* fresh new library object. The set is taken from the header file */ - /* `freetype/config/ftmodule.h'. See the document `FreeType 2.0 */ - /* Build System' for more information. */ + /* `config/ftmodule.h'. See the document `FreeType 2.0 Build */ + /* System' for more information. */ /* */ /* FT_Init_FreeType(): */ /* This function creates a system object for the current platform, */ diff --git a/reactos/lib/3rdparty/freetype/src/base/ftmac.c b/reactos/lib/3rdparty/freetype/src/base/ftmac.c index 5b5aae61cce..9b49da81402 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftmac.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftmac.c @@ -963,7 +963,6 @@ if ( !pathname ) return FT_THROW( Invalid_Argument ); - error = FT_Err_Ok; *aface = NULL; /* try resourcefork based font: LWFN, FFIL */ diff --git a/reactos/lib/3rdparty/freetype/src/base/ftobjs.c b/reactos/lib/3rdparty/freetype/src/base/ftobjs.c index 157bf456349..bd0c66e4a95 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftobjs.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftobjs.c @@ -56,9 +56,7 @@ #endif /* _MSC_VER */ /* it's easiest to include `md5.c' directly */ -#define free md5_free /* suppress a shadow warning */ #include "md5.c" -#undef free #if defined( _MSC_VER ) #pragma warning( pop ) @@ -667,11 +665,18 @@ /* the check for `num_locations' assures that we actually */ /* test for instructions in a TTF and not in a CFF-based OTF */ + /* */ + /* since `maxSizeOfInstructions' might be unreliable, we */ + /* check the size of the `fpgm' and `prep' tables, too -- */ + /* the assumption is that there don't exist real TTFs where */ + /* both `fpgm' and `prep' tables are missing */ if ( mode == FT_RENDER_MODE_LIGHT || face->internal->ignore_unpatented_hinter || ( FT_IS_SFNT( face ) && ttface->num_locations && - ttface->max_profile.maxSizeOfInstructions == 0 ) ) + ttface->max_profile.maxSizeOfInstructions == 0 && + ttface->font_program_size == 0 && + ttface->cvt_program_size == 0 ) ) autohint = TRUE; } } @@ -1133,7 +1138,8 @@ /* */ static FT_Error open_face( FT_Driver driver, - FT_Stream stream, + FT_Stream *astream, + FT_Bool external_stream, FT_Long face_index, FT_Int num_params, FT_Parameter* params, @@ -1141,10 +1147,11 @@ { FT_Memory memory; FT_Driver_Class clazz; - FT_Face face = 0; - FT_Error error, error2; + FT_Face face = NULL; FT_Face_Internal internal = NULL; + FT_Error error, error2; + clazz = driver->clazz; memory = driver->root.memory; @@ -1155,7 +1162,11 @@ face->driver = driver; face->memory = memory; - face->stream = stream; + face->stream = *astream; + + /* set the FT_FACE_FLAG_EXTERNAL_STREAM bit for FT_Done_Face */ + if ( external_stream ) + face->face_flags |= FT_FACE_FLAG_EXTERNAL_STREAM; if ( FT_NEW( internal ) ) goto Fail; @@ -1177,11 +1188,12 @@ #endif if ( clazz->init_face ) - error = clazz->init_face( stream, + error = clazz->init_face( *astream, face, (FT_Int)face_index, num_params, params ); + *astream = face->stream; /* Stream may have been changed. */ if ( error ) goto Fail; @@ -2069,7 +2081,7 @@ params = args->params; } - error = open_face( driver, stream, face_index, + error = open_face( driver, &stream, external_stream, face_index, num_params, params, &face ); if ( !error ) goto Success; @@ -2105,7 +2117,7 @@ params = args->params; } - error = open_face( driver, stream, face_index, + error = open_face( driver, &stream, external_stream, face_index, num_params, params, &face ); if ( !error ) goto Success; @@ -2174,10 +2186,6 @@ Success: FT_TRACE4(( "FT_Open_Face: New face object, adding to list\n" )); - /* set the FT_FACE_FLAG_EXTERNAL_STREAM bit for FT_Done_Face */ - if ( external_stream ) - face->face_flags |= FT_FACE_FLAG_EXTERNAL_STREAM; - /* add the face object to its driver's list */ if ( FT_NEW( node ) ) goto Fail; @@ -3380,8 +3388,10 @@ FT_CMap cmap = FT_CMAP( face->charmap ); - do { + do + { gindex = cmap->clazz->char_next( cmap, &code ); + } while ( gindex >= (FT_UInt)face->num_glyphs ); result = ( gindex == 0 ) ? 0 : code; diff --git a/reactos/lib/3rdparty/freetype/src/base/ftoutln.c b/reactos/lib/3rdparty/freetype/src/base/ftoutln.c index 54ca5cdcf6e..35df0cd821b 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftoutln.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftoutln.c @@ -576,11 +576,13 @@ { char* p = outline->tags + first; char* q = outline->tags + last; - char swap; while ( p < q ) { + char swap; + + swap = *p; *p = *q; *q = swap; @@ -721,7 +723,8 @@ #if 0 #define FT_OUTLINE_GET_CONTOUR( outline, c, first, last ) \ - do { \ + do \ + { \ (first) = ( c > 0 ) ? (outline)->points + \ (outline)->contours[c - 1] + 1 \ : (outline)->points; \ diff --git a/reactos/lib/3rdparty/freetype/src/base/ftpic.c b/reactos/lib/3rdparty/freetype/src/base/ftpic.c index 1c871016969..9bd92f785a1 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftpic.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftpic.c @@ -4,7 +4,7 @@ /* */ /* The FreeType position independent code services (body). */ /* */ -/* Copyright 2009 by */ +/* Copyright 2009, 2013 by */ /* Oran Agra and Mickey Gabel. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -29,7 +29,7 @@ ft_pic_container_init( FT_Library library ) { FT_PIC_Container* pic_container = &library->pic_container; - FT_Error error = FT_Err_Ok; + FT_Error error; FT_MEM_SET( pic_container, 0, sizeof ( *pic_container ) ); diff --git a/reactos/lib/3rdparty/freetype/src/base/ftsynth.c b/reactos/lib/3rdparty/freetype/src/base/ftsynth.c index 241d37f4262..3098a60fa89 100644 --- a/reactos/lib/3rdparty/freetype/src/base/ftsynth.c +++ b/reactos/lib/3rdparty/freetype/src/base/ftsynth.c @@ -4,7 +4,7 @@ /* */ /* FreeType synthesizing code for emboldening and slanting (body). */ /* */ -/* Copyright 2000-2006, 2010, 2012 by */ +/* Copyright 2000-2006, 2010, 2012, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -139,10 +139,11 @@ if ( slot->advance.y ) slot->advance.y += ystr; - slot->metrics.width += xstr; - slot->metrics.height += ystr; - slot->metrics.horiAdvance += xstr; - slot->metrics.vertAdvance += ystr; + slot->metrics.width += xstr; + slot->metrics.height += ystr; + slot->metrics.horiAdvance += xstr; + slot->metrics.vertAdvance += ystr; + slot->metrics.horiBearingY += ystr; /* XXX: 16-bit overflow case must be excluded before here */ if ( slot->format == FT_GLYPH_FORMAT_BITMAP ) diff --git a/reactos/lib/3rdparty/freetype/src/base/md5.c b/reactos/lib/3rdparty/freetype/src/base/md5.c index 2f01c9302cb..52d96accd30 100644 --- a/reactos/lib/3rdparty/freetype/src/base/md5.c +++ b/reactos/lib/3rdparty/freetype/src/base/md5.c @@ -50,7 +50,8 @@ */ #define F(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) #define G(x, y, z) ((y) ^ ((z) & ((x) ^ (y)))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) +#define H(x, y, z) (((x) ^ (y)) ^ (z)) +#define H2(x, y, z) ((x) ^ ((y) ^ (z))) #define I(x, y, z) ((y) ^ ((x) | ~(z))) /* @@ -89,13 +90,13 @@ * This processes one or more 64-byte data blocks, but does NOT update * the bit counters. There are no alignment requirements. */ -static void *body(MD5_CTX *ctx, void *data, unsigned long size) +static const void *body(MD5_CTX *ctx, const void *data, unsigned long size) { - unsigned char *ptr; + const unsigned char *ptr; MD5_u32plus a, b, c, d; MD5_u32plus saved_a, saved_b, saved_c, saved_d; - ptr = (unsigned char *)data; + ptr = (const unsigned char *)data; a = ctx->a; b = ctx->b; @@ -146,21 +147,21 @@ static void *body(MD5_CTX *ctx, void *data, unsigned long size) /* Round 3 */ STEP(H, a, b, c, d, GET(5), 0xfffa3942, 4) - STEP(H, d, a, b, c, GET(8), 0x8771f681, 11) + STEP(H2, d, a, b, c, GET(8), 0x8771f681, 11) STEP(H, c, d, a, b, GET(11), 0x6d9d6122, 16) - STEP(H, b, c, d, a, GET(14), 0xfde5380c, 23) + STEP(H2, b, c, d, a, GET(14), 0xfde5380c, 23) STEP(H, a, b, c, d, GET(1), 0xa4beea44, 4) - STEP(H, d, a, b, c, GET(4), 0x4bdecfa9, 11) + STEP(H2, d, a, b, c, GET(4), 0x4bdecfa9, 11) STEP(H, c, d, a, b, GET(7), 0xf6bb4b60, 16) - STEP(H, b, c, d, a, GET(10), 0xbebfbc70, 23) + STEP(H2, b, c, d, a, GET(10), 0xbebfbc70, 23) STEP(H, a, b, c, d, GET(13), 0x289b7ec6, 4) - STEP(H, d, a, b, c, GET(0), 0xeaa127fa, 11) + STEP(H2, d, a, b, c, GET(0), 0xeaa127fa, 11) STEP(H, c, d, a, b, GET(3), 0xd4ef3085, 16) - STEP(H, b, c, d, a, GET(6), 0x04881d05, 23) + STEP(H2, b, c, d, a, GET(6), 0x04881d05, 23) STEP(H, a, b, c, d, GET(9), 0xd9d4d039, 4) - STEP(H, d, a, b, c, GET(12), 0xe6db99e5, 11) + STEP(H2, d, a, b, c, GET(12), 0xe6db99e5, 11) STEP(H, c, d, a, b, GET(15), 0x1fa27cf8, 16) - STEP(H, b, c, d, a, GET(2), 0xc4ac5665, 23) + STEP(H2, b, c, d, a, GET(2), 0xc4ac5665, 23) /* Round 4 */ STEP(I, a, b, c, d, GET(0), 0xf4292244, 6) @@ -207,10 +208,10 @@ void MD5_Init(MD5_CTX *ctx) ctx->hi = 0; } -void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size) +void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size) { MD5_u32plus saved_lo; - unsigned long used, free; + unsigned long used, available; saved_lo = ctx->lo; if ((ctx->lo = (saved_lo + size) & 0x1fffffff) < saved_lo) @@ -220,16 +221,16 @@ void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size) used = saved_lo & 0x3f; if (used) { - free = 64 - used; + available = 64 - used; - if (size < free) { + if (size < available) { memcpy(&ctx->buffer[used], data, size); return; } - memcpy(&ctx->buffer[used], data, free); - data = (unsigned char *)data + free; - size -= free; + memcpy(&ctx->buffer[used], data, available); + data = (const unsigned char *)data + available; + size -= available; body(ctx, ctx->buffer, 64); } @@ -243,22 +244,22 @@ void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size) void MD5_Final(unsigned char *result, MD5_CTX *ctx) { - unsigned long used, free; + unsigned long used, available; used = ctx->lo & 0x3f; ctx->buffer[used++] = 0x80; - free = 64 - used; + available = 64 - used; - if (free < 8) { - memset(&ctx->buffer[used], 0, free); + if (available < 8) { + memset(&ctx->buffer[used], 0, available); body(ctx, ctx->buffer, 64); used = 0; - free = 64; + available = 64; } - memset(&ctx->buffer[used], 0, free - 8); + memset(&ctx->buffer[used], 0, available - 8); ctx->lo <<= 3; ctx->buffer[56] = ctx->lo; diff --git a/reactos/lib/3rdparty/freetype/src/base/md5.h b/reactos/lib/3rdparty/freetype/src/base/md5.h index f1a68576401..2da44bf355a 100644 --- a/reactos/lib/3rdparty/freetype/src/base/md5.h +++ b/reactos/lib/3rdparty/freetype/src/base/md5.h @@ -39,7 +39,7 @@ typedef struct { } MD5_CTX; extern void MD5_Init(MD5_CTX *ctx); -extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size); +extern void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size); extern void MD5_Final(unsigned char *result, MD5_CTX *ctx); #endif diff --git a/reactos/lib/3rdparty/freetype/src/base/rules.mk b/reactos/lib/3rdparty/freetype/src/base/rules.mk index e932191157a..874533754fa 100644 --- a/reactos/lib/3rdparty/freetype/src/base/rules.mk +++ b/reactos/lib/3rdparty/freetype/src/base/rules.mk @@ -19,8 +19,8 @@ # BASE_OBJ_S: The single-object base layer. # BASE_OBJ_M: A list of all objects for a multiple-objects build. # BASE_EXT_OBJ: A list of base layer extensions, i.e., components found -# in `freetype/src/base' which are not compiled within the -# base layer proper. +# in `src/base' which are not compiled within the base +# layer proper. BASE_COMPILE := $(FT_COMPILE) $I$(subst /,$(COMPILER_SEP),$(SRC_DIR)/base) diff --git a/reactos/lib/3rdparty/freetype/src/bdf/Jamfile b/reactos/lib/3rdparty/freetype/src/bdf/Jamfile deleted file mode 100644 index da23ccd0add..00000000000 --- a/reactos/lib/3rdparty/freetype/src/bdf/Jamfile +++ /dev/null @@ -1,29 +0,0 @@ -# FreeType 2 src/bdf Jamfile -# -# Copyright 2002 by -# David Turner, Robert Wilhelm, and Werner Lemberg. -# -# This file is part of the FreeType project, and may only be used, modified, -# and distributed under the terms of the FreeType project license, -# LICENSE.TXT. By continuing to use, modify, or distribute this file you -# indicate that you have read the license and understand and accept it -# fully. - -SubDir FT2_TOP $(FT2_SRC_DIR) bdf ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = bdfdrivr bdflib ; - } - else - { - _sources = bdf ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/bdf Jamfile diff --git a/reactos/lib/3rdparty/freetype/src/bdf/bdfdrivr.c b/reactos/lib/3rdparty/freetype/src/bdf/bdfdrivr.c index 0ea0a5ea5eb..caa142b5ef4 100644 --- a/reactos/lib/3rdparty/freetype/src/bdf/bdfdrivr.c +++ b/reactos/lib/3rdparty/freetype/src/bdf/bdfdrivr.c @@ -351,7 +351,6 @@ THE SOFTWARE. FT_UNUSED( num_params ); FT_UNUSED( params ); - FT_UNUSED( face_index ); FT_TRACE2(( "BDF driver\n" )); @@ -375,6 +374,19 @@ THE SOFTWARE. /* we have a bdf font: let's construct the face object */ face->bdffont = font; + + /* BDF could not have multiple face in single font file. + * XXX: non-zero face_index is already invalid argument, but + * Type1, Type42 driver has a convention to return + * an invalid argument error when the font could be + * opened by the specified driver. + */ + if ( face_index > 0 ) { + FT_ERROR(( "BDF_Face_Init: invalid face index\n" )); + BDF_Face_Done( bdfface ); + return FT_THROW( Invalid_Argument ); + } + { bdf_property_t* prop = NULL; @@ -674,6 +686,8 @@ THE SOFTWARE. goto Exit; } + FT_TRACE1(( "BDF_Glyph_Load: glyph index %d\n", glyph_index )); + /* index 0 is the undefined glyph */ if ( glyph_index == 0 ) glyph_index = bdf->default_glyph; diff --git a/reactos/lib/3rdparty/freetype/src/bzip2/Jamfile b/reactos/lib/3rdparty/freetype/src/bzip2/Jamfile deleted file mode 100644 index 3da986dce65..00000000000 --- a/reactos/lib/3rdparty/freetype/src/bzip2/Jamfile +++ /dev/null @@ -1,19 +0,0 @@ -# FreeType 2 src/bzip2 Jamfile -# -# Copyright 2010 by -# Joel Klinghed -# -# Based on src/lzw/Jamfile, Copyright 2004, 2006 by -# David Turner, Robert Wilhelm, and Werner Lemberg. -# -# This file is part of the FreeType project, and may only be used, modified, -# and distributed under the terms of the FreeType project license, -# LICENSE.TXT. By continuing to use, modify, or distribute this file you -# indicate that you have read the license and understand and accept it -# fully. - -SubDir FT2_TOP $(FT2_SRC_DIR) bzip2 ; - -Library $(FT2_LIB) : ftbzip2.c ; - -# end of src/bzip2 Jamfile diff --git a/reactos/lib/3rdparty/freetype/src/cache/Jamfile b/reactos/lib/3rdparty/freetype/src/cache/Jamfile deleted file mode 100644 index 340cff77423..00000000000 --- a/reactos/lib/3rdparty/freetype/src/cache/Jamfile +++ /dev/null @@ -1,43 +0,0 @@ -# FreeType 2 src/cache Jamfile -# -# Copyright 2001, 2003, 2004 by -# David Turner, Robert Wilhelm, and Werner Lemberg. -# -# This file is part of the FreeType project, and may only be used, modified, -# and distributed under the terms of the FreeType project license, -# LICENSE.TXT. By continuing to use, modify, or distribute this file you -# indicate that you have read the license and understand and accept it -# fully. - -SubDir FT2_TOP $(FT2_SRC_DIR) cache ; - -# The file contains some macro definitions that are -# later used in #include statements related to the cache sub-system. It -# needs to be parsed through a HDRMACRO rule for macro definitions. -# -HDRMACRO [ FT2_SubDir include ftcache.h ] ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = ftcmru - ftcmanag - ftccache - ftcglyph - ftcsbits - ftcimage - ftcbasic - ftccmap - ; - } - else - { - _sources = ftcache ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/cache Jamfile diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2blues.c b/reactos/lib/3rdparty/freetype/src/cff/cf2blues.c index 5b348398af8..eec589ef036 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cf2blues.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cf2blues.c @@ -86,11 +86,13 @@ size_t i; CF2_Fixed emBoxBottom, emBoxTop; +#if 0 CF2_Int unitsPerEm = font->unitsPerEm; if ( unitsPerEm == 0 ) unitsPerEm = 1000; +#endif FT_ZERO( blues ); blues->scale = font->innerTransform.d; diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2font.c b/reactos/lib/3rdparty/freetype/src/cff/cf2font.c index 479d9125d15..718d1e27ec1 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cf2font.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cf2font.c @@ -51,10 +51,59 @@ CF2_Fixed stemWidth, CF2_Fixed* darkenAmount, CF2_Fixed boldenAmount, - FT_Bool stemDarkened ) + FT_Bool stemDarkened, + FT_Int* darkenParams ) { + /* + * Total darkening amount is computed in 1000 unit character space + * using the modified 5 part curve as Adobe's Avalon rasterizer. + * The darkening amount is smaller for thicker stems. + * It becomes zero when the stem is thicker than 2.333 pixels. + * + * By default, we use + * + * darkenAmount = 0.4 pixels if scaledStem <= 0.5 pixels, + * darkenAmount = 0.275 pixels if 1 <= scaledStem <= 1.667 pixels, + * darkenAmount = 0 pixel if scaledStem >= 2.333 pixels, + * + * and piecewise linear in-between: + * + * + * darkening + * ^ + * | + * | (x1,y1) + * |--------+ + * | \ + * | \ + * | \ (x3,y3) + * | +----------+ + * | (x2,y2) \ + * | \ + * | \ + * | +----------------- + * | (x4,y4) + * +---------------------------------------------> stem + * thickness + * + * + * This corresponds to the following values for the + * `darkening-parameters' property: + * + * (x1, y1) = (500, 400) + * (x2, y2) = (1000, 275) + * (x3, y3) = (1667, 275) + * (x4, y4) = (2333, 0) + * + */ + /* Internal calculations are done in units per thousand for */ - /* convenience. */ + /* convenience. The x axis is scaled stem width in */ + /* thousandths of a pixel. That is, 1000 is 1 pixel. */ + /* The y axis is darkening amount in thousandths of a pixel.*/ + /* In the code, below, dividing by ppem and */ + /* adjusting for emRatio converts darkenAmount to character */ + /* space (font units). */ CF2_Fixed stemWidthPer1000, scaledStem; @@ -69,6 +118,16 @@ if ( stemDarkened ) { + FT_Int x1 = darkenParams[0]; + FT_Int y1 = darkenParams[1]; + FT_Int x2 = darkenParams[2]; + FT_Int y2 = darkenParams[3]; + FT_Int x3 = darkenParams[4]; + FT_Int y3 = darkenParams[5]; + FT_Int x4 = darkenParams[6]; + FT_Int y4 = darkenParams[7]; + + /* convert from true character space to 1000 unit character space; */ /* add synthetic emboldening effect */ @@ -81,7 +140,7 @@ stemWidthPer1000 <= ( stemWidth + boldenAmount ) ) { stemWidthPer1000 = 0; /* to pacify compiler */ - scaledStem = cf2_intToFixed( 2333 ); + scaledStem = cf2_intToFixed( x4 ); } else { @@ -89,39 +148,70 @@ if ( ppem > CF2_FIXED_ONE && scaledStem <= stemWidthPer1000 ) - scaledStem = cf2_intToFixed( 2333 ); + scaledStem = cf2_intToFixed( x4 ); } - /* - * Total darkening amount is computed in 1000 unit character space - * using the modified 5 part curve as Avalon rasterizer. - * The darkening amount is smaller for thicker stems. - * It becomes zero when the stem is thicker than 2.333 pixels. - * - * In Avalon rasterizer, - * - * darkenAmount = 0.5 pixels if scaledStem <= 0.5 pixels, - * darkenAmount = 0.333 pixels if 1 <= scaledStem <= 1.667 pixels, - * darkenAmount = 0 pixel if scaledStem >= 2.333 pixels, - * - * and piecewise linear in-between. - * - */ - if ( scaledStem < cf2_intToFixed( 500 ) ) - *darkenAmount = FT_DivFix( cf2_intToFixed( 400 ), ppem ); + /* now apply the darkening parameters */ - else if ( scaledStem < cf2_intToFixed( 1000 ) ) - *darkenAmount = FT_DivFix( cf2_intToFixed( 525 ), ppem ) - - FT_MulFix( stemWidthPer1000, - cf2_floatToFixed( .25 ) ); + if ( scaledStem < cf2_intToFixed( x1 ) ) + *darkenAmount = FT_DivFix( cf2_intToFixed( y1 ), ppem ); - else if ( scaledStem < cf2_intToFixed( 1667 ) ) - *darkenAmount = FT_DivFix( cf2_intToFixed( 275 ), ppem ); + else if ( scaledStem < cf2_intToFixed( x2 ) ) + { + FT_Int xdelta = x2 - x1; + FT_Int ydelta = y2 - y1; + FT_Int x = stemWidthPer1000 - + FT_DivFix( cf2_intToFixed( x1 ), ppem ); - else if ( scaledStem < cf2_intToFixed( 2333 ) ) - *darkenAmount = FT_DivFix( cf2_intToFixed( 963 ), ppem ) - - FT_MulFix( stemWidthPer1000, - cf2_floatToFixed( .413 ) ); + + if ( !xdelta ) + goto Try_x3; + + *darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) + + FT_DivFix( cf2_intToFixed( y1 ), ppem ); + } + + else if ( scaledStem < cf2_intToFixed( x3 ) ) + { + Try_x3: + { + FT_Int xdelta = x3 - x2; + FT_Int ydelta = y3 - y2; + FT_Int x = stemWidthPer1000 - + FT_DivFix( cf2_intToFixed( x2 ), ppem ); + + + if ( !xdelta ) + goto Try_x4; + + *darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) + + FT_DivFix( cf2_intToFixed( y2 ), ppem ); + } + } + + else if ( scaledStem < cf2_intToFixed( x4 ) ) + { + Try_x4: + { + FT_Int xdelta = x4 - x3; + FT_Int ydelta = y4 - y3; + FT_Int x = stemWidthPer1000 - + FT_DivFix( cf2_intToFixed( x3 ), ppem ); + + + if ( !xdelta ) + goto Use_y4; + + *darkenAmount = FT_MulFix( x, FT_DivFix( ydelta, xdelta ) ) + + FT_DivFix( cf2_intToFixed( y3 ), ppem ); + } + } + + else + { + Use_y4: + *darkenAmount = FT_DivFix( cf2_intToFixed( y4 ), ppem ); + } /* use half the amount on each side and convert back to true */ /* character space */ @@ -268,7 +358,8 @@ font->stdVW, &font->darkenX, boldenX, - FALSE ); + FALSE, + font->darkenParams ); } else cf2_computeDarkening( emRatio, @@ -276,7 +367,8 @@ font->stdVW, &font->darkenX, 0, - font->stemDarkened ); + font->stemDarkened, + font->darkenParams ); #if 0 /* since hstem is measured in the y-direction, we use the `d' member */ @@ -303,7 +395,8 @@ font->stdHW, &font->darkenY, boldenY, - font->stemDarkened ); + font->stemDarkened, + font->darkenParams ); if ( font->darkenX != 0 || font->darkenY != 0 ) font->darkened = TRUE; diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2font.h b/reactos/lib/3rdparty/freetype/src/cff/cf2font.h index f9dd1bbd408..d8860ce8ed5 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cf2font.h +++ b/reactos/lib/3rdparty/freetype/src/cff/cf2font.h @@ -85,6 +85,8 @@ FT_BEGIN_HEADER /* i.e. darkenX != 0 || darkenY != 0 */ FT_Bool stemDarkened; + FT_Int darkenParams[8]; /* 1000 unit character space */ + /* variables that depend on both FontDict and Transform */ CF2_Fixed stdVW; /* in character space; depends on dict entry */ CF2_Fixed stdHW; /* in character space; depends on dict entry */ diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2ft.c b/reactos/lib/3rdparty/freetype/src/cff/cf2ft.c index c09a0244a83..4abbc9d798d 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cf2ft.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cf2ft.c @@ -344,6 +344,15 @@ if ( scaled && !driver->no_stem_darkening ) font->renderingFlags |= CF2_FlagsDarkened; + font->darkenParams[0] = driver->darken_params[0]; + font->darkenParams[1] = driver->darken_params[1]; + font->darkenParams[2] = driver->darken_params[2]; + font->darkenParams[3] = driver->darken_params[3]; + font->darkenParams[4] = driver->darken_params[4]; + font->darkenParams[5] = driver->darken_params[5]; + font->darkenParams[6] = driver->darken_params[6]; + font->darkenParams[7] = driver->darken_params[7]; + /* now get an outline for this glyph; */ /* also get units per em to validate scale */ font->unitsPerEm = (CF2_Int)cf2_getUnitsPerEm( decoder ); diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2hints.c b/reactos/lib/3rdparty/freetype/src/cff/cf2hints.c index 96bd49f186a..5f441616866 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cf2hints.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cf2hints.c @@ -596,22 +596,31 @@ indexInsert = 0; for ( ; indexInsert < hintmap->count; indexInsert++ ) { - if ( hintmap->edge[indexInsert].csCoord > firstHintEdge->csCoord ) + if ( hintmap->edge[indexInsert].csCoord >= firstHintEdge->csCoord ) break; } /* - * Discard any hints that overlap in character space. Most often, - * this is while building the initial map, but in theory, it can also - * occur because of darkening. + * Discard any hints that overlap in character space. Most often, this + * is while building the initial map, where captured hints from all + * zones are combined. Define overlap to include hints that `touch' + * (overlap zero). Hiragino Sans/Gothic fonts have numerous hints that + * touch. Some fonts have non-ideographic glyphs that overlap our + * synthetic hints. + * + * Overlap also occurs when darkening stem hints that are close. * */ if ( indexInsert < hintmap->count ) { - /* we are inserting before an existing edge: */ + /* we are inserting before an existing edge: */ + /* verify that an existing edge is not the same */ + if ( hintmap->edge[indexInsert].csCoord == firstHintEdge->csCoord ) + return; /* ignore overlapping stem hint */ + /* verify that a new pair does not straddle the next edge */ - if ( isPair && - hintmap->edge[indexInsert].csCoord < secondHintEdge->csCoord ) + if ( isPair && + hintmap->edge[indexInsert].csCoord <= secondHintEdge->csCoord ) return; /* ignore overlapping stem hint */ /* verify that we are not inserting between paired edges */ @@ -645,8 +654,27 @@ firstHintEdge->csCoord ); } - /* discard any hints that overlap in device space; this can occur */ - /* because locked hints have been moved to align with blue zones */ + /* + * Discard any hints that overlap in device space; this can occur + * because locked hints have been moved to align with blue zones. + * + * TODO: Although we might correct this later during adjustment, we + * don't currently have a way to delete a conflicting hint once it has + * been inserted. See v2.030 MinionPro-Regular, 12 ppem darkened, + * initial hint map for second path, glyph 945 (the perispomeni (tilde) + * in U+1F6E, Greek omega with psili and perispomeni). Darkening is + * 25. Pair 667,747 initially conflicts in design space with top edge + * 660. This is because 667 maps to 7.87, and the top edge was + * captured by a zone at 8.0. The pair is later successfully inserted + * in a zone without the top edge. In this zone it is adjusted to 8.0, + * and no longer conflicts with the top edge in design space. This + * means it can be included in yet a later zone which does have the top + * edge hint. This produces a small mismatch between the first and + * last points of this path, even though the hint masks are the same. + * The density map difference is tiny (1/256). + * + */ + if ( indexInsert > 0 ) { /* we are inserting after an existing edge */ @@ -1035,6 +1063,7 @@ glyphpath->moveIsPending = TRUE; glyphpath->pathIsOpen = FALSE; + glyphpath->pathIsClosing = FALSE; glyphpath->elemIsQueued = FALSE; } @@ -1175,12 +1204,16 @@ /* * Push the cached element (glyphpath->prevElem*) to the outline * consumer. When a darkening offset is used, the end point of the - * cached element may be adjusted to an intersection point or it may be - * connected by a line to the current element. This calculation must - * use a HintMap that was valid at the time the element was saved. For - * the first point in a subpath, that is a saved HintMap. For most - * elements, it just means the caller has delayed building a HintMap - * from the current HintMask. + * cached element may be adjusted to an intersection point or we may + * synthesize a connecting line to the current element. If we are + * closing a subpath, we may also generate a connecting line to the start + * point. + * + * This is where Character Space (CS) is converted to Device Space (DS) + * using a hint map. This calculation must use a HintMap that was valid + * at the time the element was saved. For the first point in a subpath, + * that is a saved HintMap. For most elements, it just means the caller + * has delayed building a HintMap from the current HintMask. * * Transform each point with outerTransform and call the outline * callbacks. This is a general 3x3 transform: @@ -1250,16 +1283,32 @@ params.op = CF2_PathOpLineTo; /* note: pt2 and pt3 are unused */ - cf2_glyphpath_hintPoint( glyphpath, - hintmap, - ¶ms.pt1, - glyphpath->prevElemP1.x, - glyphpath->prevElemP1.y ); - glyphpath->callbacks->lineTo( glyphpath->callbacks, ¶ms ); + if ( close ) + { + /* use first hint map if closing */ + cf2_glyphpath_hintPoint( glyphpath, + &glyphpath->firstHintMap, + ¶ms.pt1, + glyphpath->prevElemP1.x, + glyphpath->prevElemP1.y ); + } + else + { + cf2_glyphpath_hintPoint( glyphpath, + hintmap, + ¶ms.pt1, + glyphpath->prevElemP1.x, + glyphpath->prevElemP1.y ); + } - glyphpath->currentDS = params.pt1; + /* output only non-zero length lines */ + if ( params.pt0.x != params.pt1.x || params.pt0.y != params.pt1.y ) + { + glyphpath->callbacks->lineTo( glyphpath->callbacks, ¶ms ); + glyphpath->currentDS = params.pt1; + } break; case CF2_PathOpCubeTo: @@ -1296,11 +1345,24 @@ /* note: at the end of a subpath, we might do both, so use `nextP0' */ /* before we change it, below */ - cf2_glyphpath_hintPoint( glyphpath, - hintmap, - ¶ms.pt1, - nextP0->x, - nextP0->y ); + if ( close ) + { + /* if we are closing the subpath, then nextP0 is in the first */ + /* hint zone */ + cf2_glyphpath_hintPoint( glyphpath, + &glyphpath->firstHintMap, + ¶ms.pt1, + nextP0->x, + nextP0->y ); + } + else + { + cf2_glyphpath_hintPoint( glyphpath, + hintmap, + ¶ms.pt1, + nextP0->x, + nextP0->y ); + } if ( params.pt1.x != glyphpath->currentDS.x || params.pt1.y != glyphpath->currentDS.y ) @@ -1511,6 +1573,16 @@ } + /* + * The functions cf2_glyphpath_{moveTo,lineTo,curveTo,closeOpenPath} are + * called by the interpreter with Character Space (CS) coordinates. Each + * path element is placed into a queue of length one to await the + * calculation of the following element. At that time, the darkening + * offset of the following element is known and joins can be computed, + * including possible modification of this element, before mapping to + * Device Space (DS) and passing it on to the outline consumer. + * + */ FT_LOCAL_DEF( void ) cf2_glyphpath_moveTo( CF2_GlyphPath glyphpath, CF2_Fixed x, @@ -1548,10 +1620,46 @@ { CF2_Fixed xOffset, yOffset; FT_Vector P0, P1; + FT_Bool newHintMap; + /* + * New hints will be applied after cf2_glyphpath_pushPrevElem has run. + * In case this is a synthesized closing line, any new hints should be + * delayed until this path is closed (`cf2_hintmask_isNew' will be + * called again before the next line or curve). + */ - /* can't compute offset of zero length line, so ignore them */ - if ( glyphpath->currentCS.x == x && glyphpath->currentCS.y == y ) + /* true if new hint map not on close */ + newHintMap = cf2_hintmask_isNew( glyphpath->hintMask ) && + !glyphpath->pathIsClosing; + + /* + * Zero-length lines may occur in the charstring. Because we cannot + * compute darkening offsets or intersections from zero-length lines, + * it is best to remove them and avoid artifacts. However, zero-length + * lines in CS at the start of a new hint map can generate non-zero + * lines in DS due to hint substitution. We detect a change in hint + * map here and pass those zero-length lines along. + */ + + /* + * Note: Find explicitly closed paths here with a conditional + * breakpoint using + * + * !gp->pathIsClosing && gp->start.x == x && gp->start.y == y + * + */ + + if ( glyphpath->currentCS.x == x && + glyphpath->currentCS.y == y && + !newHintMap ) + /* + * Ignore zero-length lines in CS where the hint map is the same + * because the line in DS will also be zero length. + * + * Ignore zero-length lines when we synthesize a closing line because + * the close will be handled in cf2_glyphPath_pushPrevElem. + */ return; cf2_glyphpath_computeOffset( glyphpath, @@ -1597,7 +1705,7 @@ glyphpath->prevElemP1 = P1; /* update current map */ - if ( cf2_hintmask_isNew( glyphpath->hintMask ) ) + if ( newHintMap ) cf2_hintmap_build( &glyphpath->hintMap, glyphpath->hStemHintArray, glyphpath->vStemHintArray, @@ -1703,29 +1811,29 @@ { if ( glyphpath->pathIsOpen ) { - FT_ASSERT( cf2_hintmap_isValid( &glyphpath->firstHintMap ) ); + /* + * A closing line in Character Space line is always generated below + * with `cf2_glyphPath_lineTo'. It may be ignored later if it turns + * out to be zero length in Device Space. + */ + glyphpath->pathIsClosing = TRUE; - /* since we need to apply an offset to the implicit lineto, we make */ - /* it explicit here */ cf2_glyphpath_lineTo( glyphpath, glyphpath->start.x, glyphpath->start.y ); - /* Draw previous element (the explicit LineTo we just created, */ - /* above) and connect it to the start point, but with the offset we */ - /* saved from the first element. */ - /* Use the saved HintMap, too. */ - FT_ASSERT( glyphpath->elemIsQueued ); - - cf2_glyphpath_pushPrevElem( glyphpath, - &glyphpath->firstHintMap, - &glyphpath->offsetStart0, - glyphpath->offsetStart1, - TRUE ); + /* empty the final element from the queue and close the path */ + if ( glyphpath->elemIsQueued ) + cf2_glyphpath_pushPrevElem( glyphpath, + &glyphpath->hintMap, + &glyphpath->offsetStart0, + glyphpath->offsetStart1, + TRUE ); /* reset state machine */ glyphpath->moveIsPending = TRUE; glyphpath->pathIsOpen = FALSE; + glyphpath->pathIsClosing = FALSE; glyphpath->elemIsQueued = FALSE; } } diff --git a/reactos/lib/3rdparty/freetype/src/cff/cf2hints.h b/reactos/lib/3rdparty/freetype/src/cff/cf2hints.h index c4fa922a396..f25d91bf89f 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cf2hints.h +++ b/reactos/lib/3rdparty/freetype/src/cff/cf2hints.h @@ -204,6 +204,7 @@ FT_BEGIN_HEADER #endif FT_Bool pathIsOpen; /* true after MoveTo */ + FT_Bool pathIsClosing; /* true when synthesizing closepath line */ FT_Bool darken; /* true if stem darkening */ FT_Bool moveIsPending; /* true between MoveTo and offset MoveTo */ @@ -229,7 +230,8 @@ FT_BEGIN_HEADER FT_Vector currentCS; /* current point, device space */ FT_Vector currentDS; - FT_Vector start; /* start point of subpath */ + /* start point of subpath, character space */ + FT_Vector start; /* the following members constitute the `queue' of one element */ FT_Bool elemIsQueued; diff --git a/reactos/lib/3rdparty/freetype/src/cff/cffdrivr.c b/reactos/lib/3rdparty/freetype/src/cff/cffdrivr.c index c8ca96ba495..dde7d448801 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cffdrivr.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cffdrivr.c @@ -164,6 +164,8 @@ if ( !slot ) return FT_THROW( Invalid_Slot_Handle ); + FT_TRACE1(( "cff_glyph_load: glyph index %d\n", glyph_index )); + /* check whether we want a scaled outline or bitmap */ if ( !size ) load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING; @@ -586,7 +588,38 @@ CFF_Driver driver = (CFF_Driver)module; - if ( !ft_strcmp( property_name, "hinting-engine" ) ) + if ( !ft_strcmp( property_name, "darkening-parameters" ) ) + { + FT_Int* darken_params = (FT_Int*)value; + + FT_Int x1 = darken_params[0]; + FT_Int y1 = darken_params[1]; + FT_Int x2 = darken_params[2]; + FT_Int y2 = darken_params[3]; + FT_Int x3 = darken_params[4]; + FT_Int y3 = darken_params[5]; + FT_Int x4 = darken_params[6]; + FT_Int y4 = darken_params[7]; + + + if ( x1 < 0 || x2 < 0 || x3 < 0 || x4 < 0 || + y1 < 0 || y2 < 0 || y3 < 0 || y4 < 0 || + x1 > x2 || x2 > x3 || x3 > x4 || + y1 > 500 || y2 > 500 || y3 > 500 || y4 > 500 ) + return FT_THROW( Invalid_Argument ); + + driver->darken_params[0] = x1; + driver->darken_params[1] = y1; + driver->darken_params[2] = x2; + driver->darken_params[3] = y2; + driver->darken_params[4] = x3; + driver->darken_params[5] = y3; + driver->darken_params[6] = x4; + driver->darken_params[7] = y4; + + return error; + } + else if ( !ft_strcmp( property_name, "hinting-engine" ) ) { FT_UInt* hinting_engine = (FT_UInt*)value; @@ -624,13 +657,28 @@ FT_Error error = FT_Err_Ok; CFF_Driver driver = (CFF_Driver)module; - FT_UInt hinting_engine = driver->hinting_engine; - FT_Bool no_stem_darkening = driver->no_stem_darkening; - - if ( !ft_strcmp( property_name, "hinting-engine" ) ) + if ( !ft_strcmp( property_name, "darkening-parameters" ) ) { - FT_UInt* val = (FT_UInt*)value; + FT_Int* darken_params = driver->darken_params; + FT_Int* val = (FT_Int*)value; + + + val[0] = darken_params[0]; + val[1] = darken_params[1]; + val[2] = darken_params[2]; + val[3] = darken_params[3]; + val[4] = darken_params[4]; + val[5] = darken_params[5]; + val[6] = darken_params[6]; + val[7] = darken_params[7]; + + return error; + } + else if ( !ft_strcmp( property_name, "hinting-engine" ) ) + { + FT_UInt hinting_engine = driver->hinting_engine; + FT_UInt* val = (FT_UInt*)value; *val = hinting_engine; @@ -639,7 +687,8 @@ } else if ( !ft_strcmp( property_name, "no-stem-darkening" ) ) { - FT_Bool* val = (FT_Bool*)value; + FT_Bool no_stem_darkening = driver->no_stem_darkening; + FT_Bool* val = (FT_Bool*)value; *val = no_stem_darkening; diff --git a/reactos/lib/3rdparty/freetype/src/cff/cffgload.c b/reactos/lib/3rdparty/freetype/src/cff/cffgload.c index 6a8494fa9ff..c8e9f9124b6 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cffgload.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cffgload.c @@ -434,7 +434,7 @@ goto Exit; } - FT_TRACE3(( "glyph index %d (subfont %d):\n", glyph_index, fd_index )); + FT_TRACE3(( " in subfont %d:\n", fd_index )); sub = cff->subfonts[fd_index]; @@ -447,10 +447,6 @@ builder->hints_globals = (void *)internal->subfonts[fd_index]; } } -#ifdef FT_DEBUG_LEVEL_TRACE - else - FT_TRACE3(( "glyph index %d:\n", glyph_index )); -#endif decoder->num_locals = sub->local_subrs_index.count; decoder->locals = sub->local_subrs; diff --git a/reactos/lib/3rdparty/freetype/src/cff/cffload.c b/reactos/lib/3rdparty/freetype/src/cff/cffload.c index 64b497168d8..ff271f3d583 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cffload.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cffload.c @@ -414,7 +414,7 @@ cur_offset = idx->offsets[0] - 1; /* sanity check */ - if ( cur_offset >= idx->data_size ) + if ( cur_offset != 0 ) { FT_TRACE0(( "cff_index_get_pointers:" " invalid first offset value %d set to zero\n", @@ -432,11 +432,11 @@ FT_ULong next_offset = idx->offsets[n] - 1; - /* empty slot + two sanity checks for invalid offset tables */ - if ( next_offset == 0 || - next_offset < cur_offset || - ( next_offset >= idx->data_size && n < idx->count ) ) + /* two sanity checks for invalid offset tables */ + if ( next_offset < cur_offset ) next_offset = cur_offset; + else if ( next_offset > idx->data_size ) + next_offset = idx->data_size; if ( !pool ) t[n] = org_bytes + next_offset; diff --git a/reactos/lib/3rdparty/freetype/src/cff/cffobjs.c b/reactos/lib/3rdparty/freetype/src/cff/cffobjs.c index dd750d10416..29c36915084 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cffobjs.c +++ b/reactos/lib/3rdparty/freetype/src/cff/cffobjs.c @@ -1055,7 +1055,7 @@ CFF_Driver driver = (CFF_Driver)module; - /* set default property values */ + /* set default property values, cf `ftcffdrv.h' */ #ifdef CFF_CONFIG_OPTION_OLD_ENGINE driver->hinting_engine = FT_CFF_HINTING_FREETYPE; #else @@ -1063,6 +1063,15 @@ #endif driver->no_stem_darkening = FALSE; + driver->darken_params[0] = 500; + driver->darken_params[1] = 400; + driver->darken_params[2] = 1000; + driver->darken_params[3] = 275; + driver->darken_params[4] = 1667; + driver->darken_params[5] = 275; + driver->darken_params[6] = 2333; + driver->darken_params[7] = 0; + return FT_Err_Ok; } diff --git a/reactos/lib/3rdparty/freetype/src/cff/cffobjs.h b/reactos/lib/3rdparty/freetype/src/cff/cffobjs.h index b375c20c743..dfbf9a96b0b 100644 --- a/reactos/lib/3rdparty/freetype/src/cff/cffobjs.h +++ b/reactos/lib/3rdparty/freetype/src/cff/cffobjs.h @@ -121,6 +121,8 @@ FT_BEGIN_HEADER FT_UInt hinting_engine; FT_Bool no_stem_darkening; + FT_Int darken_params[8]; + } CFF_DriverRec; diff --git a/reactos/lib/3rdparty/freetype/src/cid/cidgload.c b/reactos/lib/3rdparty/freetype/src/cid/cidgload.c index a1a86586935..7febab81c41 100644 --- a/reactos/lib/3rdparty/freetype/src/cid/cidgload.c +++ b/reactos/lib/3rdparty/freetype/src/cid/cidgload.c @@ -58,7 +58,7 @@ #endif - FT_TRACE4(( "cid_load_glyph: glyph index %d\n", glyph_index )); + FT_TRACE1(( "cid_load_glyph: glyph index %d\n", glyph_index )); #ifdef FT_CONFIG_OPTION_INCREMENTAL diff --git a/reactos/lib/3rdparty/freetype/src/cid/cidload.c b/reactos/lib/3rdparty/freetype/src/cid/cidload.c index f2a18ea5105..46def71b79e 100644 --- a/reactos/lib/3rdparty/freetype/src/cid/cidload.c +++ b/reactos/lib/3rdparty/freetype/src/cid/cidload.c @@ -150,8 +150,6 @@ cid_parse_font_matrix( CID_Face face, CID_Parser* parser ) { - FT_Matrix* matrix; - FT_Vector* offset; CID_FaceDict dict; FT_Face root = (FT_Face)&face->root; FT_Fixed temp[6]; @@ -160,6 +158,10 @@ if ( parser->num_dict >= 0 && parser->num_dict < face->cid.num_dicts ) { + FT_Matrix* matrix; + FT_Vector* offset; + + dict = face->cid.font_dicts + parser->num_dict; matrix = &dict->font_matrix; offset = &dict->font_offset; diff --git a/reactos/lib/3rdparty/freetype/src/gxvalid/gxvcommn.c b/reactos/lib/3rdparty/freetype/src/gxvalid/gxvcommn.c index 2ac80be8c7a..7af52342ba0 100644 --- a/reactos/lib/3rdparty/freetype/src/gxvalid/gxvcommn.c +++ b/reactos/lib/3rdparty/freetype/src/gxvalid/gxvcommn.c @@ -1288,7 +1288,9 @@ valid ); else { +#if 0 maxState = 1; /* 0:start of text, 1:start of line are predefined */ +#endif maxEntry = 0; } @@ -1621,8 +1623,10 @@ gxv_LookupTable_validate( table + classTable, table + classTable + classTable_length, valid ); +#if 0 if ( valid->subtable_length < classTable_length ) classTable_length = valid->subtable_length; +#endif } else { @@ -1641,7 +1645,9 @@ valid ); else { +#if 0 maxState = 1; /* 0:start of text, 1:start of line are predefined */ +#endif maxEntry = 0; } @@ -1727,6 +1733,7 @@ odtect->range[j].start, odtect->range[j].length ) ) { +#ifdef FT_DEBUG_LEVEL_TRACE if ( odtect->range[i].name || odtect->range[j].name ) GXV_TRACE(( "found overlap between range %d and range %d\n", i, j )); @@ -1734,6 +1741,7 @@ GXV_TRACE(( "found overlap between `%s' and `%s\'\n", odtect->range[i].name, odtect->range[j].name )); +#endif FT_INVALID_OFFSET; } diff --git a/reactos/lib/3rdparty/freetype/src/gxvalid/gxvcommn.h b/reactos/lib/3rdparty/freetype/src/gxvalid/gxvcommn.h index 1ff87e4423c..2f44a7515e3 100644 --- a/reactos/lib/3rdparty/freetype/src/gxvalid/gxvcommn.h +++ b/reactos/lib/3rdparty/freetype/src/gxvalid/gxvcommn.h @@ -318,7 +318,7 @@ FT_BEGIN_HEADER FT_BEGIN_STMNT \ { \ if ( (a) & 3 ) \ - FT_INVALID_OFFSET ; \ + FT_INVALID_OFFSET; \ } \ FT_END_STMNT diff --git a/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmort.c b/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmort.c index 5356e67ca72..c4d49b32d35 100644 --- a/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmort.c +++ b/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmort.c @@ -123,6 +123,7 @@ { FT_UNUSED( valid ); +#ifdef FT_DEBUG_LEVEL_TRACE if ( coverage & 0x8000U ) GXV_TRACE(( " this subtable is for vertical text only\n" )); else @@ -141,6 +142,7 @@ if ( coverage & 0x1FF8 ) GXV_TRACE(( " coverage has non-zero bits in reserved area\n" )); +#endif } diff --git a/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmorx2.c b/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmorx2.c index 9d2b0bc4af0..95b8ea40b44 100644 --- a/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmorx2.c +++ b/reactos/lib/3rdparty/freetype/src/gxvalid/gxvmorx2.c @@ -5,7 +5,7 @@ /* TrueTypeGX/AAT morx table validation */ /* body for type2 (Ligature Substitution) subtable. */ /* */ -/* Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ +/* Copyright 2005, 2013 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -317,7 +317,9 @@ gxv_XStateTable_validate( p, limit, valid ); +#if 0 p += valid->subtable_length; +#endif gxv_morx_subtable_type2_ligatureTable_validate( table, valid ); GXV_EXIT; diff --git a/reactos/lib/3rdparty/freetype/src/gzip/Jamfile b/reactos/lib/3rdparty/freetype/src/gzip/Jamfile deleted file mode 100644 index a7aafa05180..00000000000 --- a/reactos/lib/3rdparty/freetype/src/gzip/Jamfile +++ /dev/null @@ -1,16 +0,0 @@ -# FreeType 2 src/gzip Jamfile -# -# Copyright 2001 by -# David Turner, Robert Wilhelm, and Werner Lemberg. -# -# This file is part of the FreeType project, and may only be used, modified, -# and distributed under the terms of the FreeType project license, -# LICENSE.TXT. By continuing to use, modify, or distribute this file you -# indicate that you have read the license and understand and accept it -# fully. - -SubDir FT2_TOP $(FT2_SRC_DIR) gzip ; - -Library $(FT2_LIB) : ftgzip.c ; - -# end of src/pcf Jamfile diff --git a/reactos/lib/3rdparty/freetype/src/gzip/ftgzip.c b/reactos/lib/3rdparty/freetype/src/gzip/ftgzip.c index f26755834f4..2c60b6c571c 100644 --- a/reactos/lib/3rdparty/freetype/src/gzip/ftgzip.c +++ b/reactos/lib/3rdparty/freetype/src/gzip/ftgzip.c @@ -596,6 +596,8 @@ } + /* documentation is in ftgzip.h */ + FT_EXPORT_DEF( FT_Error ) FT_Stream_OpenGzip( FT_Stream stream, FT_Stream source ) @@ -684,7 +686,64 @@ return error; } -#else /* !FT_CONFIG_OPTION_USE_ZLIB */ + + /* documentation is in ftgzip.h */ + + FT_EXPORT_DEF( FT_Error ) + FT_Gzip_Uncompress( FT_Memory memory, + FT_Byte* output, + FT_ULong* output_len, + const FT_Byte* input, + FT_ULong input_len ) + { + z_stream stream; + int err; + + + /* this function is modeled after zlib's `uncompress' function */ + + stream.next_in = (Bytef*)input; + stream.avail_in = (uInt)input_len; + + stream.next_out = output; + stream.avail_out = (uInt)*output_len; + + stream.zalloc = (alloc_func)ft_gzip_alloc; + stream.zfree = (free_func) ft_gzip_free; + stream.opaque = memory; + + err = inflateInit2( &stream, MAX_WBITS ); + if ( err != Z_OK ) + return FT_THROW( Invalid_Argument ); + + err = inflate( &stream, Z_FINISH ); + if ( err != Z_STREAM_END ) + { + inflateEnd( &stream ); + if ( err == Z_OK ) + err = Z_BUF_ERROR; + } + else + { + *output_len = stream.total_out; + + err = inflateEnd( &stream ); + } + + if ( err == Z_MEM_ERROR ) + return FT_THROW( Out_Of_Memory ); + + if ( err == Z_BUF_ERROR ) + return FT_THROW( Array_Too_Large ); + + if ( err == Z_DATA_ERROR ) + return FT_THROW( Invalid_Table ); + + return FT_Err_Ok; + } + + +#else /* !FT_CONFIG_OPTION_USE_ZLIB */ FT_EXPORT_DEF( FT_Error ) FT_Stream_OpenGzip( FT_Stream stream, @@ -696,6 +755,23 @@ return FT_THROW( Unimplemented_Feature ); } + + FT_EXPORT_DEF( FT_Error ) + FT_Gzip_Uncompress( FT_Memory memory, + FT_Byte* output, + FT_ULong* output_len, + const FT_Byte* input, + FT_ULong input_len ) + { + FT_UNUSED( memory ); + FT_UNUSED( output ); + FT_UNUSED( output_len ); + FT_UNUSED( input ); + FT_UNUSED( input_len ); + + return FT_THROW( Unimplemented_Feature ); + } + #endif /* !FT_CONFIG_OPTION_USE_ZLIB */ diff --git a/reactos/lib/3rdparty/freetype/src/gzip/rules.mk b/reactos/lib/3rdparty/freetype/src/gzip/rules.mk index d2a43a6a890..37cd9917653 100644 --- a/reactos/lib/3rdparty/freetype/src/gzip/rules.mk +++ b/reactos/lib/3rdparty/freetype/src/gzip/rules.mk @@ -3,7 +3,7 @@ # -# Copyright 2002, 2003 by +# Copyright 2002, 2003, 2013 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, @@ -27,49 +27,52 @@ else endif -# gzip support sources (i.e., C files) +# gzip support sources # -GZIP_DRV_SRC := $(GZIP_DIR)/ftgzip.c - -# gzip support headers +# All source and header files get loaded by `ftgzip.c' only if SYTEM_ZLIB is +# not defined (regardless whether we have a `single' or a `multi' build). +# However, it doesn't harm if we add everything as a dependency +# unconditionally. # -GZIP_DRV_H := +GZIP_DRV_SRCS := $(GZIP_DIR)/adler32.c \ + $(GZIP_DIR)/infblock.c \ + $(GZIP_DIR)/infblock.h \ + $(GZIP_DIR)/infcodes.c \ + $(GZIP_DIR)/infcodes.h \ + $(GZIP_DIR)/inffixed.h \ + $(GZIP_DIR)/inflate.c \ + $(GZIP_DIR)/inftrees.c \ + $(GZIP_DIR)/inftrees.h \ + $(GZIP_DIR)/infutil.c \ + $(GZIP_DIR)/infutil.h \ + $(GZIP_DIR)/zconf.h \ + $(GZIP_DIR)/zlib.h \ + $(GZIP_DIR)/zutil.c \ + $(GZIP_DIR)/zutil.h # gzip driver object(s) # -# GZIP_DRV_OBJ_M is used during `multi' builds -# GZIP_DRV_OBJ_S is used during `single' builds +# GZIP_DRV_OBJ is used during both `single' and `multi' builds # -ifeq ($(SYSTEM_ZLIB),) - GZIP_DRV_OBJ_M := $(GZIP_DRV_SRC:$(GZIP_DIR)/%.c=$(OBJ_DIR)/%.$O) -else - GZIP_DRV_OBJ_M := $(OBJ_DIR)/ftgzip.$O -endif -GZIP_DRV_OBJ_S := $(OBJ_DIR)/ftgzip.$O +GZIP_DRV_OBJ := $(OBJ_DIR)/ftgzip.$O -# gzip support source file for single build + +# gzip main source file # -GZIP_DRV_SRC_S := $(GZIP_DIR)/ftgzip.c +GZIP_DRV_SRC := $(GZIP_DIR)/ftgzip.c -# gzip support - single object +# gzip support - object # -$(GZIP_DRV_OBJ_S): $(GZIP_DRV_SRC_S) $(GZIP_DRV_SRC) $(FREETYPE_H) \ - $(GZIP_DRV_H) - $(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GZIP_DRV_SRC_S)) - - -# gzip support - multiple objects -# -$(OBJ_DIR)/%.$O: $(GZIP_DIR)/%.c $(FREETYPE_H) $(GZIP_DRV_H) - $(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<) +$(GZIP_DRV_OBJ): $(GZIP_DRV_SRC) $(GZIP_DRV_SRCS) $(FREETYPE_H) + $(GZIP_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(GZIP_DRV_SRC)) # update main driver object lists # -DRV_OBJS_S += $(GZIP_DRV_OBJ_S) -DRV_OBJS_M += $(GZIP_DRV_OBJ_M) +DRV_OBJS_S += $(GZIP_DRV_OBJ) +DRV_OBJS_M += $(GZIP_DRV_OBJ) # EOF diff --git a/reactos/lib/3rdparty/freetype/src/pcf/pcfdrivr.c b/reactos/lib/3rdparty/freetype/src/pcf/pcfdrivr.c index df25a645a07..748cbca8f1b 100644 --- a/reactos/lib/3rdparty/freetype/src/pcf/pcfdrivr.c +++ b/reactos/lib/3rdparty/freetype/src/pcf/pcfdrivr.c @@ -218,25 +218,24 @@ THE SOFTWARE. FT_FREE( face->metrics ); /* free properties */ + if ( face->properties ) { - PCF_Property prop; - FT_Int i; + FT_Int i; - if ( face->properties ) + for ( i = 0; i < face->nprops; i++ ) { - for ( i = 0; i < face->nprops; i++ ) - { - prop = &face->properties[i]; + PCF_Property prop = &face->properties[i]; - if ( prop ) - { - FT_FREE( prop->name ); - if ( prop->isString ) - FT_FREE( prop->value.atom ); - } + + if ( prop ) + { + FT_FREE( prop->name ); + if ( prop->isString ) + FT_FREE( prop->value.atom ); } } + FT_FREE( face->properties ); } @@ -264,11 +263,10 @@ THE SOFTWARE. FT_Parameter* params ) { PCF_Face face = (PCF_Face)pcfface; - FT_Error error = FT_Err_Ok; + FT_Error error; FT_UNUSED( num_params ); FT_UNUSED( params ); - FT_UNUSED( face_index ); FT_TRACE2(( "PCF driver\n" )); @@ -347,6 +345,18 @@ THE SOFTWARE. #endif } + /* PCF could not have multiple face in single font file. + * XXX: non-zero face_index is already invalid argument, but + * Type1, Type42 driver has a convention to return + * an invalid argument error when the font could be + * opened by the specified driver. + */ + if ( face_index > 0 ) { + FT_ERROR(( "PCF_Face_Init: invalid face index\n" )); + PCF_Face_Done( pcfface ); + return FT_THROW( Invalid_Argument ); + } + /* set up charmap */ { FT_String *charset_registry = face->charset_registry; @@ -482,7 +492,7 @@ THE SOFTWARE. FT_UNUSED( load_flags ); - FT_TRACE4(( "load_glyph %d ---", glyph_index )); + FT_TRACE1(( "PCF_Glyph_Load: glyph index %d\n", glyph_index )); if ( !face || glyph_index >= (FT_UInt)face->root.num_glyphs ) { @@ -576,8 +586,6 @@ THE SOFTWARE. ( face->accel.fontAscent + face->accel.fontDescent ) << 6 ); - FT_TRACE4(( " --- ok\n" )); - Exit: return error; } diff --git a/reactos/lib/3rdparty/freetype/src/pcf/pcfread.c b/reactos/lib/3rdparty/freetype/src/pcf/pcfread.c index 3c1bb7dfa24..ee41c5df3ae 100644 --- a/reactos/lib/3rdparty/freetype/src/pcf/pcfread.c +++ b/reactos/lib/3rdparty/freetype/src/pcf/pcfread.c @@ -1096,7 +1096,7 @@ THE SOFTWARE. pcf_load_font( FT_Stream stream, PCF_Face face ) { - FT_Error error = FT_Err_Ok; + FT_Error error; FT_Memory memory = FT_FACE( face )->memory; FT_Bool hasBDFAccelerators; diff --git a/reactos/lib/3rdparty/freetype/src/pcf/pcfutil.c b/reactos/lib/3rdparty/freetype/src/pcf/pcfutil.c index b91274f935b..0451ee8deff 100644 --- a/reactos/lib/3rdparty/freetype/src/pcf/pcfutil.c +++ b/reactos/lib/3rdparty/freetype/src/pcf/pcfutil.c @@ -66,11 +66,11 @@ in this Software without prior written authorization from The Open Group. TwoByteSwap( unsigned char* buf, size_t nbytes ) { - unsigned char c; - - for ( ; nbytes >= 2; nbytes -= 2, buf += 2 ) { + unsigned char c; + + c = buf[0]; buf[0] = buf[1]; buf[1] = c; @@ -85,11 +85,11 @@ in this Software without prior written authorization from The Open Group. FourByteSwap( unsigned char* buf, size_t nbytes ) { - unsigned char c; - - for ( ; nbytes >= 4; nbytes -= 4, buf += 4 ) { + unsigned char c; + + c = buf[0]; buf[0] = buf[3]; buf[3] = c; diff --git a/reactos/lib/3rdparty/freetype/src/pfr/pfrcmap.c b/reactos/lib/3rdparty/freetype/src/pfr/pfrcmap.c index 740c433d662..1f05640cc60 100644 --- a/reactos/lib/3rdparty/freetype/src/pfr/pfrcmap.c +++ b/reactos/lib/3rdparty/freetype/src/pfr/pfrcmap.c @@ -67,14 +67,16 @@ pfr_cmap_char_index( PFR_CMap cmap, FT_UInt32 char_code ) { - FT_UInt min = 0; - FT_UInt max = cmap->num_chars; - FT_UInt mid; - PFR_Char gchar; + FT_UInt min = 0; + FT_UInt max = cmap->num_chars; while ( min < max ) { + PFR_Char gchar; + FT_UInt mid; + + mid = min + ( max - min ) / 2; gchar = cmap->chars + mid; diff --git a/reactos/lib/3rdparty/freetype/src/pfr/pfrgload.c b/reactos/lib/3rdparty/freetype/src/pfr/pfrgload.c index 88b4d66a134..2ce093779c3 100644 --- a/reactos/lib/3rdparty/freetype/src/pfr/pfrgload.c +++ b/reactos/lib/3rdparty/freetype/src/pfr/pfrgload.c @@ -763,7 +763,7 @@ PFR_SubGlyph subglyph; - FT_TRACE4(( "subglyph %d:\n", n )); + FT_TRACE4(( " subglyph %d:\n", n )); subglyph = glyph->subs + old_count + n; old_points = base->n_points; diff --git a/reactos/lib/3rdparty/freetype/src/pfr/pfrobjs.c b/reactos/lib/3rdparty/freetype/src/pfr/pfrobjs.c index 75fc4c3f1f2..8d3cd2920b9 100644 --- a/reactos/lib/3rdparty/freetype/src/pfr/pfrobjs.c +++ b/reactos/lib/3rdparty/freetype/src/pfr/pfrobjs.c @@ -324,6 +324,8 @@ FT_ULong gps_offset; + FT_TRACE1(( "pfr_slot_load: glyph index %d\n", gindex )); + if ( gindex > 0 ) gindex--; diff --git a/reactos/lib/3rdparty/freetype/src/psaux/Jamfile b/reactos/lib/3rdparty/freetype/src/psaux/Jamfile deleted file mode 100644 index faeded90445..00000000000 --- a/reactos/lib/3rdparty/freetype/src/psaux/Jamfile +++ /dev/null @@ -1,31 +0,0 @@ -# FreeType 2 src/psaux Jamfile -# -# Copyright 2001, 2002 by -# David Turner, Robert Wilhelm, and Werner Lemberg. -# -# This file is part of the FreeType project, and may only be used, modified, -# and distributed under the terms of the FreeType project license, -# LICENSE.TXT. By continuing to use, modify, or distribute this file you -# indicate that you have read the license and understand and accept it -# fully. - -SubDir FT2_TOP $(FT2_SRC_DIR) psaux ; - -{ - local _sources ; - - if $(FT2_MULTI) - { - _sources = psauxmod psobjs t1decode t1cmap - psconv afmparse - ; - } - else - { - _sources = psaux ; - } - - Library $(FT2_LIB) : $(_sources).c ; -} - -# end of src/psaux Jamfile diff --git a/reactos/lib/3rdparty/freetype/src/pshinter/pshglob.c b/reactos/lib/3rdparty/freetype/src/pshinter/pshglob.c index 9285efc9e16..f75bae45105 100644 --- a/reactos/lib/3rdparty/freetype/src/pshinter/pshglob.c +++ b/reactos/lib/3rdparty/freetype/src/pshinter/pshglob.c @@ -5,7 +5,7 @@ /* PostScript hinter global hinting management (body). */ /* Inspired by the new auto-hinter module. */ /* */ -/* Copyright 2001-2004, 2006, 2010, 2012 by */ +/* Copyright 2001-2004, 2006, 2010, 2012, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used */ @@ -757,7 +757,7 @@ FT_Fixed x_delta, FT_Fixed y_delta ) { - PSH_Dimension dim = &globals->dimension[0]; + PSH_Dimension dim; dim = &globals->dimension[0]; diff --git a/reactos/lib/3rdparty/freetype/src/raster/ftraster.c b/reactos/lib/3rdparty/freetype/src/raster/ftraster.c index bbd503d97d2..8aa11133ab8 100644 --- a/reactos/lib/3rdparty/freetype/src/raster/ftraster.c +++ b/reactos/lib/3rdparty/freetype/src/raster/ftraster.c @@ -24,8 +24,8 @@ /* */ /* - copy `src/raster/ftraster.c' (this file) to your current directory */ /* */ - /* - copy `include/freetype/ftimage.h' and `src/raster/ftmisc.h' */ - /* to your current directory */ + /* - copy `include/ftimage.h' and `src/raster/ftmisc.h' to your current */ + /* directory */ /* */ /* - compile `ftraster' with the _STANDALONE_ macro defined, as in */ /* */ diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/pngshim.c b/reactos/lib/3rdparty/freetype/src/sfnt/pngshim.c index 408f879c348..878de1fefac 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/pngshim.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/pngshim.c @@ -122,7 +122,7 @@ error_callback( png_structp png, png_const_charp error_msg ) { - FT_Error* error = png_get_error_ptr( png ); + FT_Error* error = (FT_Error*)png_get_error_ptr( png ); FT_UNUSED( error_msg ); @@ -159,7 +159,7 @@ if ( FT_FRAME_ENTER( length ) ) { - FT_Error* e = png_get_error_ptr( png ); + FT_Error* e = (FT_Error*)png_get_error_ptr( png ); *e = FT_THROW( Invalid_Stream_Read ); @@ -174,16 +174,18 @@ } - static FT_Error - Load_SBit_Png( FT_Bitmap* map, + FT_LOCAL_DEF( FT_Error ) + Load_SBit_Png( FT_GlyphSlot slot, FT_Int x_offset, FT_Int y_offset, FT_Int pix_bits, TT_SBit_Metrics metrics, FT_Memory memory, FT_Byte* data, - FT_UInt png_len ) + FT_UInt png_len, + FT_Bool populate_map_and_metrics ) { + FT_Bitmap *map = &slot->bitmap; FT_Error error = FT_Err_Ok; FT_StreamRec stream; @@ -193,12 +195,21 @@ int bitdepth, color_type, interlace; FT_Int i; - png_byte* *rows; + png_byte* *rows = NULL; /* pacify compiler */ - if ( x_offset < 0 || x_offset + metrics->width > map->width || - y_offset < 0 || y_offset + metrics->height > map->rows || - pix_bits != 32 || map->pixel_mode != FT_PIXEL_MODE_BGRA ) + if ( x_offset < 0 || + y_offset < 0 ) + { + error = FT_THROW( Invalid_Argument ); + goto Exit; + } + + if ( !populate_map_and_metrics && + ( x_offset + metrics->width > map->width || + y_offset + metrics->height > map->rows || + pix_bits != 32 || + map->pixel_mode != FT_PIXEL_MODE_BGRA ) ) { error = FT_THROW( Invalid_Argument ); goto Exit; @@ -238,11 +249,33 @@ &bitdepth, &color_type, &interlace, NULL, NULL ); - if ( error != FT_Err_Ok || - (FT_Int)imgWidth != metrics->width || - (FT_Int)imgHeight != metrics->height ) + if ( error || + ( !populate_map_and_metrics && + ( (FT_Int)imgWidth != metrics->width || + (FT_Int)imgHeight != metrics->height ) ) ) goto DestroyExit; + if ( populate_map_and_metrics ) + { + FT_Long size; + + + metrics->width = (FT_Int)imgWidth; + metrics->height = (FT_Int)imgHeight; + + map->width = metrics->width; + map->rows = metrics->height; + map->pixel_mode = FT_PIXEL_MODE_BGRA; + map->pitch = map->width * 4; + map->num_grays = 256; + + size = map->rows * map->pitch; + + error = ft_glyphslot_alloc_bitmap( slot, size ); + if ( error ) + goto DestroyExit; + } + /* convert palette/gray image to rgb */ if ( color_type == PNG_COLOR_TYPE_PALETTE ) png_set_palette_to_rgb( png ); diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/pngshim.h b/reactos/lib/3rdparty/freetype/src/sfnt/pngshim.h index 8a2e69ccf9f..dc9ecaf9189 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/pngshim.h +++ b/reactos/lib/3rdparty/freetype/src/sfnt/pngshim.h @@ -29,14 +29,15 @@ FT_BEGIN_HEADER #ifdef FT_CONFIG_OPTION_USE_PNG FT_LOCAL( FT_Error ) - Load_SBit_Png( FT_Bitmap* map, + Load_SBit_Png( FT_GlyphSlot slot, FT_Int x_offset, FT_Int y_offset, FT_Int pix_bits, TT_SBit_Metrics metrics, FT_Memory memory, FT_Byte* data, - FT_UInt png_len ); + FT_UInt png_len, + FT_Bool populate_map_and_metrics ); #endif diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/sfdriver.c b/reactos/lib/3rdparty/freetype/src/sfnt/sfdriver.c index a368b8caeaa..e0132c920cc 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/sfdriver.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/sfdriver.c @@ -499,8 +499,8 @@ tt_face_load_hmtx, /* see `ttsbit.h' and `sfnt.h' */ - PUT_EMBEDDED_BITMAPS( tt_face_load_eblc ), - PUT_EMBEDDED_BITMAPS( tt_face_free_eblc ), + PUT_EMBEDDED_BITMAPS( tt_face_load_sbit ), + PUT_EMBEDDED_BITMAPS( tt_face_free_sbit ), PUT_EMBEDDED_BITMAPS( tt_face_set_sbit_strike ), PUT_EMBEDDED_BITMAPS( tt_face_load_strike_metrics ), diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/sfobjs.c b/reactos/lib/3rdparty/freetype/src/sfnt/sfobjs.c index f975e71c3ba..a31c77cbec6 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/sfobjs.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/sfobjs.c @@ -27,6 +27,7 @@ #include FT_TRUETYPE_TAGS_H #include FT_SERVICE_POSTSCRIPT_CMAPS_H #include FT_SFNT_NAMES_H +#include FT_GZIP_H #include "sferrors.h" #ifdef TT_CONFIG_OPTION_BDF @@ -347,6 +348,380 @@ } +#define WRITE_BYTE( p, v ) \ + do \ + { \ + *(p)++ = (v) >> 0; \ + \ + } while ( 0 ) + +#define WRITE_USHORT( p, v ) \ + do \ + { \ + *(p)++ = (v) >> 8; \ + *(p)++ = (v) >> 0; \ + \ + } while ( 0 ) + +#define WRITE_ULONG( p, v ) \ + do \ + { \ + *(p)++ = (v) >> 24; \ + *(p)++ = (v) >> 16; \ + *(p)++ = (v) >> 8; \ + *(p)++ = (v) >> 0; \ + \ + } while ( 0 ) + + + static void + sfnt_stream_close( FT_Stream stream ) + { + FT_Memory memory = stream->memory; + + + FT_FREE( stream->base ); + + stream->size = 0; + stream->base = 0; + stream->close = 0; + } + + + FT_CALLBACK_DEF( int ) + compare_offsets( const void* a, + const void* b ) + { + WOFF_Table table1 = *(WOFF_Table*)a; + WOFF_Table table2 = *(WOFF_Table*)b; + + FT_ULong offset1 = table1->Offset; + FT_ULong offset2 = table2->Offset; + + + if ( offset1 > offset2 ) + return 1; + else if ( offset1 < offset2 ) + return -1; + else + return 0; + } + + + /* Replace `face->root.stream' with a stream containing the extracted */ + /* SFNT of a WOFF font. */ + + static FT_Error + woff_open_font( FT_Stream stream, + TT_Face face ) + { + FT_Memory memory = stream->memory; + FT_Error error = FT_Err_Ok; + + WOFF_HeaderRec woff; + WOFF_Table tables = NULL; + WOFF_Table* indices = NULL; + + FT_ULong woff_offset; + + FT_Byte* sfnt = NULL; + FT_Stream sfnt_stream = NULL; + + FT_Byte* sfnt_header; + FT_ULong sfnt_offset; + + FT_Int nn; + FT_ULong old_tag = 0; + + static const FT_Frame_Field woff_header_fields[] = + { +#undef FT_STRUCTURE +#define FT_STRUCTURE WOFF_HeaderRec + + FT_FRAME_START( 44 ), + FT_FRAME_ULONG ( signature ), + FT_FRAME_ULONG ( flavor ), + FT_FRAME_ULONG ( length ), + FT_FRAME_USHORT( num_tables ), + FT_FRAME_USHORT( reserved ), + FT_FRAME_ULONG ( totalSfntSize ), + FT_FRAME_USHORT( majorVersion ), + FT_FRAME_USHORT( minorVersion ), + FT_FRAME_ULONG ( metaOffset ), + FT_FRAME_ULONG ( metaLength ), + FT_FRAME_ULONG ( metaOrigLength ), + FT_FRAME_ULONG ( privOffset ), + FT_FRAME_ULONG ( privLength ), + FT_FRAME_END + }; + + + FT_ASSERT( stream == face->root.stream ); + FT_ASSERT( FT_STREAM_POS() == 0 ); + + if ( FT_STREAM_READ_FIELDS( woff_header_fields, &woff ) ) + return error; + + /* Make sure we don't recurse back here or hit TTC code. */ + if ( woff.flavor == TTAG_wOFF || woff.flavor == TTAG_ttcf ) + return FT_THROW( Invalid_Table ); + + /* Miscellaneous checks. */ + if ( woff.length != stream->size || + woff.num_tables == 0 || + 44 + woff.num_tables * 20UL >= woff.length || + 12 + woff.num_tables * 16UL >= woff.totalSfntSize || + ( woff.totalSfntSize & 3 ) != 0 || + ( woff.metaOffset == 0 && ( woff.metaLength != 0 || + woff.metaOrigLength != 0 ) ) || + ( woff.metaLength != 0 && woff.metaOrigLength == 0 ) || + ( woff.privOffset == 0 && woff.privLength != 0 ) ) + return FT_THROW( Invalid_Table ); + + if ( FT_ALLOC( sfnt, woff.totalSfntSize ) || + FT_NEW( sfnt_stream ) ) + goto Exit; + + sfnt_header = sfnt; + + /* Write sfnt header. */ + { + FT_UInt searchRange, entrySelector, rangeShift, x; + + + x = woff.num_tables; + entrySelector = 0; + while ( x ) + { + x >>= 1; + entrySelector += 1; + } + entrySelector--; + + searchRange = ( 1 << entrySelector ) * 16; + rangeShift = woff.num_tables * 16 - searchRange; + + WRITE_ULONG ( sfnt_header, woff.flavor ); + WRITE_USHORT( sfnt_header, woff.num_tables ); + WRITE_USHORT( sfnt_header, searchRange ); + WRITE_USHORT( sfnt_header, entrySelector ); + WRITE_USHORT( sfnt_header, rangeShift ); + } + + /* While the entries in the sfnt header must be sorted by the */ + /* tag value, the tables themselves are not. We thus have to */ + /* sort them by offset and check that they don't overlap. */ + + if ( FT_NEW_ARRAY( tables, woff.num_tables ) || + FT_NEW_ARRAY( indices, woff.num_tables ) ) + goto Exit; + + FT_TRACE2(( "\n" + " tag offset compLen origLen checksum\n" + " -------------------------------------------\n" )); + + if ( FT_FRAME_ENTER( 20L * woff.num_tables ) ) + goto Exit; + + for ( nn = 0; nn < woff.num_tables; nn++ ) + { + WOFF_Table table = tables + nn; + + table->Tag = FT_GET_TAG4(); + table->Offset = FT_GET_ULONG(); + table->CompLength = FT_GET_ULONG(); + table->OrigLength = FT_GET_ULONG(); + table->CheckSum = FT_GET_ULONG(); + + FT_TRACE2(( " %c%c%c%c %08lx %08lx %08lx %08lx\n", + (FT_Char)( table->Tag >> 24 ), + (FT_Char)( table->Tag >> 16 ), + (FT_Char)( table->Tag >> 8 ), + (FT_Char)( table->Tag ), + table->Offset, + table->CompLength, + table->OrigLength, + table->CheckSum )); + + if ( table->Tag <= old_tag ) + { + FT_FRAME_EXIT(); + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + old_tag = table->Tag; + indices[nn] = table; + } + + FT_FRAME_EXIT(); + + /* Sort by offset. */ + + ft_qsort( indices, + woff.num_tables, + sizeof ( WOFF_Table ), + compare_offsets ); + + /* Check offsets and lengths. */ + + woff_offset = 44 + woff.num_tables * 20L; + sfnt_offset = 12 + woff.num_tables * 16L; + + for ( nn = 0; nn < woff.num_tables; nn++ ) + { + WOFF_Table table = indices[nn]; + + + if ( table->Offset != woff_offset || + table->Offset + table->CompLength > woff.length || + sfnt_offset + table->OrigLength > woff.totalSfntSize || + table->CompLength > table->OrigLength ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + table->OrigOffset = sfnt_offset; + + /* The offsets must be multiples of 4. */ + woff_offset += ( table->CompLength + 3 ) & ~3; + sfnt_offset += ( table->OrigLength + 3 ) & ~3; + } + + /* + * Final checks! + * + * We don't decode and check the metadata block. + * We don't check table checksums either. + * But other than those, I think we implement all + * `MUST' checks from the spec. + */ + + if ( woff.metaOffset ) + { + if ( woff.metaOffset != woff_offset || + woff.metaOffset + woff.metaLength > woff.length ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + /* We have padding only ... */ + woff_offset += woff.metaLength; + } + + if ( woff.privOffset ) + { + /* ... if it isn't the last block. */ + woff_offset = ( woff_offset + 3 ) & ~3; + + if ( woff.privOffset != woff_offset || + woff.privOffset + woff.privLength > woff.length ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + /* No padding for the last block. */ + woff_offset += woff.privLength; + } + + if ( sfnt_offset != woff.totalSfntSize || + woff_offset != woff.length ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + + /* Write the tables. */ + + for ( nn = 0; nn < woff.num_tables; nn++ ) + { + WOFF_Table table = tables + nn; + + + /* Write SFNT table entry. */ + WRITE_ULONG( sfnt_header, table->Tag ); + WRITE_ULONG( sfnt_header, table->CheckSum ); + WRITE_ULONG( sfnt_header, table->OrigOffset ); + WRITE_ULONG( sfnt_header, table->OrigLength ); + + /* Write table data. */ + if ( FT_STREAM_SEEK( table->Offset ) || + FT_FRAME_ENTER( table->CompLength ) ) + goto Exit; + + if ( table->CompLength == table->OrigLength ) + { + /* Uncompressed data; just copy. */ + ft_memcpy( sfnt + table->OrigOffset, + stream->cursor, + table->OrigLength ); + } + else + { + /* Uncompress with zlib. */ + FT_ULong output_len = table->OrigLength; + + + error = FT_Gzip_Uncompress( memory, + sfnt + table->OrigOffset, &output_len, + stream->cursor, table->CompLength ); + if ( error ) + goto Exit; + if ( output_len != table->OrigLength ) + { + error = FT_THROW( Invalid_Table ); + goto Exit; + } + } + + FT_FRAME_EXIT(); + + /* We don't check whether the padding bytes in the WOFF file are */ + /* actually '\0'. For the output, however, we do set them properly. */ + sfnt_offset = table->OrigOffset + table->OrigLength; + while ( sfnt_offset & 3 ) + { + sfnt[sfnt_offset] = '\0'; + sfnt_offset++; + } + } + + /* Ok! Finally ready. Swap out stream and return. */ + FT_Stream_OpenMemory( sfnt_stream, sfnt, woff.totalSfntSize ); + sfnt_stream->memory = stream->memory; + sfnt_stream->close = sfnt_stream_close; + + FT_Stream_Free( + face->root.stream, + ( face->root.face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 ); + + face->root.stream = sfnt_stream; + + face->root.face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM; + + Exit: + FT_FREE( tables ); + FT_FREE( indices ); + + if ( error ) + { + FT_FREE( sfnt ); + FT_Stream_Close( sfnt_stream ); + FT_FREE( sfnt_stream ); + } + + return error; + } + + +#undef WRITE_BYTE +#undef WRITE_USHORT +#undef WRITE_ULONG + + /* Fill in face->ttc_header. If the font is not a TTC, it is */ /* synthesized into a TTC with one offset table. */ static FT_Error @@ -373,11 +748,28 @@ face->ttc_header.version = 0; face->ttc_header.count = 0; + retry: offset = FT_STREAM_POS(); if ( FT_READ_ULONG( tag ) ) return error; + if ( tag == TTAG_wOFF ) + { + FT_TRACE2(( "sfnt_open_font: file is a WOFF; synthesizing SFNT\n" )); + + if ( FT_STREAM_SEEK( offset ) ) + return error; + + error = woff_open_font( stream, face ); + if ( error ) + return error; + + /* Swap out stream and retry! */ + stream = face->root.stream; + goto retry; + } + if ( tag != 0x00010000UL && tag != TTAG_ttcf && tag != TTAG_OTTO && @@ -480,6 +872,9 @@ if ( error ) return error; + /* Stream may have changed in sfnt_open_font. */ + stream = face->root.stream; + FT_TRACE2(( "sfnt_init_face: %08p, %ld\n", face, face_index )); if ( face_index < 0 ) @@ -504,7 +899,8 @@ #define LOAD_( x ) \ - do { \ + do \ + { \ FT_TRACE2(( "`" #x "' " )); \ FT_TRACE3(( "-->\n" )); \ \ @@ -519,7 +915,8 @@ } while ( 0 ) #define LOADM_( x, vertical ) \ - do { \ + do \ + { \ FT_TRACE2(( "`%s" #x "' ", \ vertical ? "vertical " : "" )); \ FT_TRACE3(( "-->\n" )); \ @@ -535,7 +932,8 @@ } while ( 0 ) #define GET_NAME( id, field ) \ - do { \ + do \ + { \ error = tt_face_get_name( face, TT_NAME_ID_ ## id, field ); \ if ( error ) \ goto Exit; \ @@ -555,6 +953,7 @@ #endif FT_Bool has_outline; FT_Bool is_apple_sbit; + FT_Bool is_apple_sbix; FT_Bool ignore_preferred_family = FALSE; FT_Bool ignore_preferred_subfamily = FALSE; @@ -608,6 +1007,14 @@ #endif is_apple_sbit = 0; + is_apple_sbix = !face->goto_table( face, TTAG_sbix, stream, 0 ); + + /* Apple 'sbix' color bitmaps are rendered scaled and then the 'glyf' + * outline rendered on top. We don't support that yet, so just ignore + * the 'glyf' outline and advertise it as a bitmap-only font. */ + if ( is_apple_sbix ) + has_outline = FALSE; + /* if this font doesn't contain outlines, we try to load */ /* a `bhed' table */ @@ -619,7 +1026,7 @@ /* load the font header (`head' table) if this isn't an Apple */ /* sbit font file */ - if ( !is_apple_sbit ) + if ( !is_apple_sbit || is_apple_sbix ) { LOAD_( head ); if ( error ) @@ -803,6 +1210,10 @@ /* */ /* Compute face flags. */ /* */ + if ( face->sbit_table_type == TT_SBIT_TABLE_TYPE_CBLC || + face->sbit_table_type == TT_SBIT_TABLE_TYPE_SBIX ) + flags |= FT_FACE_FLAG_COLOR; /* color glyphs */ + if ( has_outline == TRUE ) flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */ @@ -931,7 +1342,7 @@ if ( em_size == 0 || face->os2.version == 0xFFFFU ) { - avgwidth = 0; + avgwidth = 1; em_size = 1; } diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.c b/reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.c index 1507202ea82..9b7856ba589 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/ttcmap.c @@ -320,9 +320,8 @@ /* parse sub-headers */ for ( n = 0; n <= max_subs; n++ ) { - FT_UInt first_code, code_count, offset; - FT_Int delta; - FT_Byte* ids; + FT_UInt first_code, code_count, offset; + FT_Int delta; first_code = TT_NEXT_USHORT( p ); @@ -344,6 +343,9 @@ /* check offset */ if ( offset != 0 ) { + FT_Byte* ids; + + ids = p - 2 + offset; if ( ids < glyph_ids || ids + code_count*2 > table + length ) FT_INVALID_OFFSET; @@ -3208,7 +3210,6 @@ { FT_Byte *p = tt_cmap14_find_variant( cmap->data + 6, variantSelector ); - FT_UInt32 *ret; FT_Int i; FT_ULong defOff; FT_ULong nondefOff; @@ -3242,6 +3243,8 @@ FT_Byte* dp; FT_UInt di, ni, k; + FT_UInt32 *ret; + p = cmap->data + nondefOff; dp = cmap->data + defOff; diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/ttkern.c b/reactos/lib/3rdparty/freetype/src/sfnt/ttkern.c index 60ee546d793..32c4008b23c 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/ttkern.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/ttkern.c @@ -5,7 +5,7 @@ /* Load the basic TrueType kerning table. This doesn't handle */ /* kerning data within the GPOS table at the moment. */ /* */ -/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by */ +/* Copyright 1996-2007, 2009, 2010, 2013 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -183,7 +183,7 @@ FT_UInt right_glyph ) { FT_Int result = 0; - FT_UInt count, mask = 1; + FT_UInt count, mask; FT_Byte* p = face->kern_table; FT_Byte* p_limit = p + face->kern_table_size; @@ -196,7 +196,7 @@ count--, mask <<= 1 ) { FT_Byte* base = p; - FT_Byte* next = base; + FT_Byte* next; FT_UInt version = FT_NEXT_USHORT( p ); FT_UInt length = FT_NEXT_USHORT( p ); FT_UInt coverage = FT_NEXT_USHORT( p ); diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/ttload.c b/reactos/lib/3rdparty/freetype/src/sfnt/ttload.c index fbe70f7974a..0a3cd29dbae 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/ttload.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/ttload.c @@ -236,7 +236,8 @@ */ if ( table.Length < 0x36 ) { - FT_TRACE2(( "check_table_dir: `head' table too small\n" )); + FT_TRACE2(( "check_table_dir:" + " `head' or `bhed' table too small\n" )); error = FT_THROW( Table_Missing ); goto Exit; } @@ -246,12 +247,8 @@ goto Exit; if ( magic != 0x5F0F3CF5UL ) - { FT_TRACE2(( "check_table_dir:" - " no magic number found in `head' table\n")); - error = FT_THROW( Table_Missing ); - goto Exit; - } + " invalid magic number in `head' or `bhed' table\n")); if ( FT_STREAM_SEEK( offset + ( nn + 1 ) * 16 ) ) goto Exit; @@ -394,8 +391,8 @@ { entry->Tag = FT_GET_TAG4(); entry->CheckSum = FT_GET_ULONG(); - entry->Offset = FT_GET_LONG(); - entry->Length = FT_GET_LONG(); + entry->Offset = FT_GET_ULONG(); + entry->Length = FT_GET_ULONG(); /* ignore invalid tables */ if ( entry->Offset + entry->Length > stream->size ) @@ -1006,7 +1003,8 @@ FT_FRAME_END }; - static const FT_Frame_Field os2_fields_extra[] = + /* `OS/2' version 1 and newer */ + static const FT_Frame_Field os2_fields_extra1[] = { FT_FRAME_START( 8 ), FT_FRAME_ULONG( ulCodePageRange1 ), @@ -1014,6 +1012,7 @@ FT_FRAME_END }; + /* `OS/2' version 2 and newer */ static const FT_Frame_Field os2_fields_extra2[] = { FT_FRAME_START( 10 ), @@ -1025,6 +1024,15 @@ FT_FRAME_END }; + /* `OS/2' version 5 and newer */ + static const FT_Frame_Field os2_fields_extra5[] = + { + FT_FRAME_START( 4 ), + FT_FRAME_USHORT( usLowerOpticalPointSize ), + FT_FRAME_USHORT( usUpperOpticalPointSize ), + FT_FRAME_END + }; + /* We now support old Mac fonts where the OS/2 table doesn't */ /* exist. Simply put, we set the `version' field to 0xFFFF */ @@ -1038,18 +1046,20 @@ if ( FT_STREAM_READ_FIELDS( os2_fields, os2 ) ) goto Exit; - os2->ulCodePageRange1 = 0; - os2->ulCodePageRange2 = 0; - os2->sxHeight = 0; - os2->sCapHeight = 0; - os2->usDefaultChar = 0; - os2->usBreakChar = 0; - os2->usMaxContext = 0; + os2->ulCodePageRange1 = 0; + os2->ulCodePageRange2 = 0; + os2->sxHeight = 0; + os2->sCapHeight = 0; + os2->usDefaultChar = 0; + os2->usBreakChar = 0; + os2->usMaxContext = 0; + os2->usLowerOpticalPointSize = 0; + os2->usUpperOpticalPointSize = 0xFFFF; if ( os2->version >= 0x0001 ) { /* only version 1 tables */ - if ( FT_STREAM_READ_FIELDS( os2_fields_extra, os2 ) ) + if ( FT_STREAM_READ_FIELDS( os2_fields_extra1, os2 ) ) goto Exit; if ( os2->version >= 0x0002 ) @@ -1057,6 +1067,13 @@ /* only version 2 tables */ if ( FT_STREAM_READ_FIELDS( os2_fields_extra2, os2 ) ) goto Exit; + + if ( os2->version >= 0x0005 ) + { + /* only version 5 tables */ + if ( FT_STREAM_READ_FIELDS( os2_fields_extra5, os2 ) ) + goto Exit; + } } } @@ -1164,6 +1181,7 @@ FT_FRAME_USHORT( Style ), FT_FRAME_USHORT( TypeFamily ), FT_FRAME_USHORT( CapHeight ), + FT_FRAME_USHORT( SymbolSet ), FT_FRAME_BYTES ( TypeFace, 16 ), FT_FRAME_BYTES ( CharacterComplement, 8 ), FT_FRAME_BYTES ( FileName, 6 ), diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/ttmtx.c b/reactos/lib/3rdparty/freetype/src/sfnt/ttmtx.c index 371a9edabee..a8cc63a1151 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/ttmtx.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/ttmtx.c @@ -183,20 +183,23 @@ /* tt_face_get_metrics */ /* */ /* */ - /* Returns the horizontal or vertical metrics in font units for a */ - /* given glyph. The metrics are the left side bearing (resp. top */ - /* side bearing) and advance width (resp. advance height). */ + /* Return the horizontal or vertical metrics in font units for a */ + /* given glyph. The values are the left side bearing (top side */ + /* bearing for vertical metrics) and advance width (advance height */ + /* for vertical metrics). */ /* */ /* */ - /* header :: A pointer to either the horizontal or vertical metrics */ - /* structure. */ + /* face :: A pointer to the TrueType face structure. */ /* */ - /* idx :: The glyph index. */ + /* vertical :: If set to TRUE, get vertical metrics. */ + /* */ + /* gindex :: The glyph index. */ /* */ /* */ - /* bearing :: The bearing, either left side or top side. */ + /* abearing :: The bearing, either left side or top side. */ /* */ - /* advance :: The advance width resp. advance height. */ + /* aadvance :: The advance width or advance height, depending on */ + /* the `vertical' flag. */ /* */ FT_LOCAL_DEF( FT_Error ) tt_face_get_metrics( TT_Face face, diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.c b/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.c index cd3e5a4a004..7469ff1ecbc 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.c +++ b/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.c @@ -28,6 +28,7 @@ #include "sferrors.h" +#include "ttmtx.h" #include "pngshim.h" @@ -42,25 +43,36 @@ FT_LOCAL_DEF( FT_Error ) - tt_face_load_eblc( TT_Face face, + tt_face_load_sbit( TT_Face face, FT_Stream stream ) { - FT_Error error = FT_Err_Ok; - FT_Fixed version; - FT_ULong num_strikes, table_size; - FT_Byte* p; - FT_Byte* p_limit; - FT_UInt count; + FT_Error error; + FT_ULong table_size; + face->sbit_table = NULL; + face->sbit_table_size = 0; + face->sbit_table_type = TT_SBIT_TABLE_TYPE_NONE; face->sbit_num_strikes = 0; - /* this table is optional */ error = face->goto_table( face, TTAG_CBLC, stream, &table_size ); - if ( error ) + if ( !error ) + face->sbit_table_type = TT_SBIT_TABLE_TYPE_CBLC; + else + { error = face->goto_table( face, TTAG_EBLC, stream, &table_size ); + if ( error ) + error = face->goto_table( face, TTAG_bloc, stream, &table_size ); + if ( !error ) + face->sbit_table_type = TT_SBIT_TABLE_TYPE_EBLC; + } + if ( error ) - error = face->goto_table( face, TTAG_bloc, stream, &table_size ); + { + error = face->goto_table( face, TTAG_sbix, stream, &table_size ); + if ( !error ) + face->sbit_table_type = TT_SBIT_TABLE_TYPE_SBIX; + } if ( error ) goto Exit; @@ -71,53 +83,130 @@ goto Exit; } - if ( FT_FRAME_EXTRACT( table_size, face->sbit_table ) ) - goto Exit; - - face->sbit_table_size = table_size; - - p = face->sbit_table; - p_limit = p + table_size; - - version = FT_NEXT_ULONG( p ); - num_strikes = FT_NEXT_ULONG( p ); - - if ( version != 0x00020000UL || num_strikes >= 0x10000UL ) + switch ( (FT_UInt)face->sbit_table_type ) { - FT_ERROR(( "tt_face_load_sbit_strikes: invalid table version\n" )); - error = FT_THROW( Invalid_File_Format ); - goto Fail; + case TT_SBIT_TABLE_TYPE_EBLC: + case TT_SBIT_TABLE_TYPE_CBLC: + { + FT_Byte* p; + FT_Fixed version; + FT_ULong num_strikes; + FT_UInt count; + + + if ( FT_FRAME_EXTRACT( table_size, face->sbit_table ) ) + goto Exit; + + face->sbit_table_size = table_size; + + p = face->sbit_table; + + version = FT_NEXT_ULONG( p ); + num_strikes = FT_NEXT_ULONG( p ); + + if ( ( version & 0xFFFF0000UL ) != 0x00020000UL ) + { + error = FT_THROW( Unknown_File_Format ); + goto Exit; + } + + if ( num_strikes >= 0x10000UL ) + { + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + + /* + * Count the number of strikes available in the table. We are a bit + * paranoid there and don't trust the data. + */ + count = (FT_UInt)num_strikes; + if ( 8 + 48UL * count > table_size ) + count = (FT_UInt)( ( table_size - 8 ) / 48 ); + + face->sbit_num_strikes = count; + } + break; + + case TT_SBIT_TABLE_TYPE_SBIX: + { + FT_UShort version; + FT_UShort flags; + FT_ULong num_strikes; + FT_UInt count; + + + if ( FT_FRAME_ENTER( 8 ) ) + goto Exit; + + version = FT_GET_USHORT(); + flags = FT_GET_USHORT(); + num_strikes = FT_GET_ULONG(); + + FT_FRAME_EXIT(); + + if ( version < 1 ) + { + error = FT_THROW( Unknown_File_Format ); + goto Exit; + } + if ( flags != 0x0001 || num_strikes >= 0x10000UL ) + { + error = FT_THROW( Invalid_File_Format ); + goto Exit; + } + + /* + * Count the number of strikes available in the table. We are a bit + * paranoid there and don't trust the data. + */ + count = (FT_UInt)num_strikes; + if ( 8 + 4UL * count > table_size ) + count = (FT_UInt)( ( table_size - 8 ) / 4 ); + + if ( FT_STREAM_SEEK( FT_STREAM_POS() - 8 ) ) + goto Exit; + + face->sbit_table_size = 8 + count * 4; + if ( FT_FRAME_EXTRACT( face->sbit_table_size, face->sbit_table ) ) + goto Exit; + + face->sbit_num_strikes = count; + } + break; + + default: + error = FT_THROW( Unknown_File_Format ); + break; } - /* - * Count the number of strikes available in the table. We are a bit - * paranoid there and don't trust the data. - */ - count = (FT_UInt)num_strikes; - if ( 8 + 48UL * count > table_size ) - count = (FT_UInt)( ( p_limit - p ) / 48 ); + if ( !error ) + FT_TRACE3(( "sbit_num_strikes: %u\n", face->sbit_num_strikes )); - face->sbit_num_strikes = count; + return FT_Err_Ok; - FT_TRACE3(( "sbit_num_strikes: %u\n", count )); Exit: - return error; + if ( error ) + { + if ( face->sbit_table ) + FT_FRAME_RELEASE( face->sbit_table ); + face->sbit_table_size = 0; + face->sbit_table_type = TT_SBIT_TABLE_TYPE_NONE; + } - Fail: - FT_FRAME_RELEASE( face->sbit_table ); - face->sbit_table_size = 0; - goto Exit; + return error; } FT_LOCAL_DEF( void ) - tt_face_free_eblc( TT_Face face ) + tt_face_free_sbit( TT_Face face ) { FT_Stream stream = face->root.stream; FT_FRAME_RELEASE( face->sbit_table ); face->sbit_table_size = 0; + face->sbit_table_type = TT_SBIT_TABLE_TYPE_NONE; face->sbit_num_strikes = 0; } @@ -136,28 +225,85 @@ FT_ULong strike_index, FT_Size_Metrics* metrics ) { - FT_Byte* strike; - - if ( strike_index >= (FT_ULong)face->sbit_num_strikes ) return FT_THROW( Invalid_Argument ); - strike = face->sbit_table + 8 + strike_index * 48; + switch ( (FT_UInt)face->sbit_table_type ) + { + case TT_SBIT_TABLE_TYPE_EBLC: + case TT_SBIT_TABLE_TYPE_CBLC: + { + FT_Byte* strike; - metrics->x_ppem = (FT_UShort)strike[44]; - metrics->y_ppem = (FT_UShort)strike[45]; - metrics->ascender = (FT_Char)strike[16] << 6; /* hori.ascender */ - metrics->descender = (FT_Char)strike[17] << 6; /* hori.descender */ - metrics->height = metrics->ascender - metrics->descender; + strike = face->sbit_table + 8 + strike_index * 48; - /* XXX: Is this correct? */ - metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB */ - strike[18] + /* max_width */ - (FT_Char)strike[23] /* min_advance_SB */ - ) << 6; + metrics->x_ppem = (FT_UShort)strike[44]; + metrics->y_ppem = (FT_UShort)strike[45]; - return FT_Err_Ok; + metrics->ascender = (FT_Char)strike[16] << 6; /* hori.ascender */ + metrics->descender = (FT_Char)strike[17] << 6; /* hori.descender */ + metrics->height = metrics->ascender - metrics->descender; + + /* Is this correct? */ + metrics->max_advance = ( (FT_Char)strike[22] + /* min_origin_SB */ + strike[18] + /* max_width */ + (FT_Char)strike[23] /* min_advance_SB */ + ) << 6; + return FT_Err_Ok; + } + + case TT_SBIT_TABLE_TYPE_SBIX: + { + FT_Stream stream = face->root.stream; + FT_UInt offset, ppem, resolution, upem; + TT_HoriHeader *hori; + FT_ULong table_size; + + FT_Error error; + FT_Byte* p; + + + p = face->sbit_table + 8 + 4 * strike_index; + offset = FT_NEXT_ULONG( p ); + + error = face->goto_table( face, TTAG_sbix, stream, &table_size ); + if ( error ) + return error; + + if ( offset + 4 > table_size ) + return FT_THROW( Invalid_File_Format ); + + if ( FT_STREAM_SEEK( FT_STREAM_POS() + offset ) || + FT_FRAME_ENTER( 4 ) ) + return error; + + ppem = FT_GET_USHORT(); + resolution = FT_GET_USHORT(); + + FT_UNUSED( resolution ); /* What to do with this? */ + + FT_FRAME_EXIT(); + + upem = face->header.Units_Per_EM; + hori = &face->horizontal; + + metrics->x_ppem = ppem; + metrics->y_ppem = ppem; + + metrics->ascender = ppem * hori->Ascender * 64 / upem; + metrics->descender = ppem * hori->Descender * 64 / upem; + metrics->height = ppem * ( hori->Ascender - + hori->Descender + + hori->Line_Gap ) * 64 / upem; + metrics->max_advance = ppem * hori->advance_Width_Max * 64 / upem; + + return error; + } + + default: + return FT_THROW( Unknown_File_Format ); + } } @@ -253,8 +399,7 @@ static FT_Error - tt_sbit_decoder_alloc_bitmap( TT_SBitDecoder decoder, - FT_UInt load_flags ) + tt_sbit_decoder_alloc_bitmap( TT_SBitDecoder decoder ) { FT_Error error = FT_Err_Ok; FT_UInt width, height; @@ -301,18 +446,9 @@ break; case 32: - if ( load_flags & FT_LOAD_COLOR ) - { - map->pixel_mode = FT_PIXEL_MODE_BGRA; - map->pitch = map->width * 4; - map->num_grays = 256; - } - else - { - map->pixel_mode = FT_PIXEL_MODE_GRAY; - map->pitch = map->width; - map->num_grays = 256; - } + map->pixel_mode = FT_PIXEL_MODE_BGRA; + map->pitch = map->width * 4; + map->num_grays = 256; break; default: @@ -382,13 +518,11 @@ /* forward declaration */ static FT_Error tt_sbit_decoder_load_image( TT_SBitDecoder decoder, - FT_UInt load_flags, FT_UInt glyph_index, FT_Int x_pos, FT_Int y_pos ); typedef FT_Error (*TT_SBitDecoder_LoadFunc)( TT_SBitDecoder decoder, - FT_UInt load_flags, FT_Byte* p, FT_Byte* plimit, FT_Int x_pos, @@ -397,7 +531,6 @@ static FT_Error tt_sbit_decoder_load_byte_aligned( TT_SBitDecoder decoder, - FT_UInt load_flags, FT_Byte* p, FT_Byte* limit, FT_Int x_pos, @@ -408,8 +541,6 @@ FT_Int bit_height, bit_width, pitch, width, height, line_bits, h; FT_Bitmap* bitmap; - FT_UNUSED( load_flags ); - /* check that we can write the glyph into the bitmap */ bitmap = decoder->bitmap; @@ -538,7 +669,6 @@ static FT_Error tt_sbit_decoder_load_bit_aligned( TT_SBitDecoder decoder, - FT_UInt load_flags, FT_Byte* p, FT_Byte* limit, FT_Int x_pos, @@ -550,8 +680,6 @@ FT_Bitmap* bitmap; FT_UShort rval; - FT_UNUSED( load_flags ); - /* check that we can write the glyph into the bitmap */ bitmap = decoder->bitmap; @@ -664,7 +792,6 @@ static FT_Error tt_sbit_decoder_load_compound( TT_SBitDecoder decoder, - FT_UInt load_flags, FT_Byte* p, FT_Byte* limit, FT_Int x_pos, @@ -702,7 +829,7 @@ /* NB: a recursive call */ - error = tt_sbit_decoder_load_image( decoder, load_flags, gindex, + error = tt_sbit_decoder_load_image( decoder, gindex, x_pos + dx, y_pos + dy ); if ( error ) break; @@ -732,7 +859,6 @@ static FT_Error tt_sbit_decoder_load_png( TT_SBitDecoder decoder, - FT_UInt load_flags, FT_Byte* p, FT_Byte* limit, FT_Int x_pos, @@ -741,8 +867,6 @@ FT_Error error = FT_Err_Ok; FT_ULong png_len; - FT_UNUSED( load_flags ); - if ( limit - p < 4 ) { @@ -759,14 +883,15 @@ goto Exit; } - error = Load_SBit_Png( decoder->bitmap, + error = Load_SBit_Png( decoder->face->root.glyph, x_pos, y_pos, decoder->bit_depth, decoder->metrics, decoder->stream->memory, p, - png_len ); + png_len, + FALSE ); Exit: if ( !error ) @@ -779,7 +904,6 @@ static FT_Error tt_sbit_decoder_load_bitmap( TT_SBitDecoder decoder, - FT_UInt load_flags, FT_UInt glyph_format, FT_ULong glyph_start, FT_ULong glyph_size, @@ -845,7 +969,32 @@ case 2: case 5: case 7: - loader = tt_sbit_decoder_load_bit_aligned; + { + /* Don't trust `glyph_format'. For example, Apple's main Korean */ + /* system font, `AppleMyungJo.ttf' (version 7.0d2e6), uses glyph */ + /* format 7, but the data is format 6. We check whether we have */ + /* an excessive number of bytes in the image: If it is equal to */ + /* the value for a byte-aligned glyph, use the other loading */ + /* routine. */ + /* */ + /* Note that for some (width,height) combinations, where the */ + /* width is not a multiple of 8, the sizes for bit- and */ + /* byte-aligned data are equal, for example (7,7) or (15,6). We */ + /* then prefer what `glyph_format' specifies. */ + + FT_UInt width = decoder->metrics->width; + FT_UInt height = decoder->metrics->height; + + FT_UInt bit_size = ( width * height + 7 ) >> 3; + FT_UInt byte_size = height * ( ( width + 7 ) >> 3 ); + + + if ( bit_size < byte_size && + byte_size == (FT_UInt)( p_limit - p ) ) + loader = tt_sbit_decoder_load_byte_aligned; + else + loader = tt_sbit_decoder_load_bit_aligned; + } break; case 8: @@ -859,13 +1008,15 @@ loader = tt_sbit_decoder_load_compound; break; -#ifdef FT_CONFIG_OPTION_USE_PNG case 17: /* small metrics, PNG image data */ case 18: /* big metrics, PNG image data */ case 19: /* metrics in EBLC, PNG image data */ +#ifdef FT_CONFIG_OPTION_USE_PNG loader = tt_sbit_decoder_load_png; - break; +#else + error = FT_THROW( Unimplemented_Feature ); #endif /* FT_CONFIG_OPTION_USE_PNG */ + break; default: error = FT_THROW( Invalid_Table ); @@ -874,64 +1025,12 @@ if ( !decoder->bitmap_allocated ) { - error = tt_sbit_decoder_alloc_bitmap( decoder, load_flags ); + error = tt_sbit_decoder_alloc_bitmap( decoder ); if ( error ) goto Fail; } - if ( decoder->bit_depth == 32 && - decoder->bitmap->pixel_mode != FT_PIXEL_MODE_BGRA ) - { - /* Flatten color bitmaps if color was not requested. */ - - FT_Library library = decoder->face->root.glyph->library; - FT_Memory memory = decoder->stream->memory; - - FT_Bitmap color, *orig; - - - if ( decoder->bitmap->pixel_mode != FT_PIXEL_MODE_GRAY || - x_pos != 0 || y_pos != 0 ) - { - /* Shouldn't happen. */ - error = FT_THROW( Invalid_Table ); - goto Fail; - } - - FT_Bitmap_New( &color ); - - color.rows = decoder->bitmap->rows; - color.width = decoder->bitmap->width; - color.pitch = color.width * 4; - color.pixel_mode = FT_PIXEL_MODE_BGRA; - - if ( FT_ALLOC( color.buffer, color.rows * color.pitch ) ) - goto Fail; - - orig = decoder->bitmap; - decoder->bitmap = &color; - - error = loader( decoder, load_flags, p, p_limit, x_pos, y_pos ); - - decoder->bitmap = orig; - - /* explicitly test against FT_Err_Ok to avoid compiler warnings */ - /* (we do an assignment within a conditional) */ - if ( error || - ( error = FT_Bitmap_Convert( library, - &color, - decoder->bitmap, - 1 ) ) != FT_Err_Ok ) - { - FT_Bitmap_Done( library, &color ); - goto Fail; - } - - FT_Bitmap_Done( library, &color ); - } - - else - error = loader( decoder, load_flags, p, p_limit, x_pos, y_pos ); + error = loader( decoder, p, p_limit, x_pos, y_pos ); } Fail: @@ -944,7 +1043,6 @@ static FT_Error tt_sbit_decoder_load_image( TT_SBitDecoder decoder, - FT_UInt load_flags, FT_UInt glyph_index, FT_Int x_pos, FT_Int y_pos ) @@ -993,17 +1091,15 @@ switch ( index_format ) { case 1: /* 4-byte offsets relative to `image_offset' */ - { - p += 4 * ( glyph_index - start ); - if ( p + 8 > p_limit ) - goto NoBitmap; + p += 4 * ( glyph_index - start ); + if ( p + 8 > p_limit ) + goto NoBitmap; - image_start = FT_NEXT_ULONG( p ); - image_end = FT_NEXT_ULONG( p ); + image_start = FT_NEXT_ULONG( p ); + image_end = FT_NEXT_ULONG( p ); - if ( image_start == image_end ) /* missing glyph */ - goto NoBitmap; - } + if ( image_start == image_end ) /* missing glyph */ + goto NoBitmap; break; case 2: /* big metrics, constant image size */ @@ -1025,17 +1121,15 @@ break; case 3: /* 2-byte offsets relative to 'image_offset' */ - { - p += 2 * ( glyph_index - start ); - if ( p + 4 > p_limit ) - goto NoBitmap; + p += 2 * ( glyph_index - start ); + if ( p + 4 > p_limit ) + goto NoBitmap; - image_start = FT_NEXT_USHORT( p ); - image_end = FT_NEXT_USHORT( p ); + image_start = FT_NEXT_USHORT( p ); + image_end = FT_NEXT_USHORT( p ); - if ( image_start == image_end ) /* missing glyph */ - goto NoBitmap; - } + if ( image_start == image_end ) /* missing glyph */ + goto NoBitmap; break; case 4: /* sparse glyph array with (glyph,offset) pairs */ @@ -1124,7 +1218,6 @@ image_format, glyph_index )); return tt_sbit_decoder_load_bitmap( decoder, - load_flags, image_format, image_start, image_end, @@ -1142,6 +1235,129 @@ } + static FT_Error + tt_face_load_sbix_image( TT_Face face, + FT_ULong strike_index, + FT_UInt glyph_index, + FT_Stream stream, + FT_Bitmap *map, + TT_SBit_MetricsRec *metrics ) + { + FT_UInt sbix_pos, strike_offset, glyph_start, glyph_end; + FT_ULong table_size, data_size; + FT_Int originOffsetX, originOffsetY; + FT_Tag graphicType; + FT_Int recurse_depth = 0; + + FT_Error error; + FT_Byte* p; + + FT_UNUSED( map ); + + + metrics->width = 0; + metrics->height = 0; + + p = face->sbit_table + 8 + 4 * strike_index; + strike_offset = FT_NEXT_ULONG( p ); + + error = face->goto_table( face, TTAG_sbix, stream, &table_size ); + if ( error ) + return error; + sbix_pos = FT_STREAM_POS(); + + retry: + if ( glyph_index > (FT_UInt)face->root.num_glyphs ) + return FT_THROW( Invalid_Argument ); + + if ( strike_offset >= table_size || + table_size - strike_offset < 4 + glyph_index * 4 + 8 ) + return FT_THROW( Invalid_File_Format ); + + if ( FT_STREAM_SEEK( sbix_pos + strike_offset + 4 + glyph_index * 4 ) || + FT_FRAME_ENTER( 8 ) ) + return error; + + glyph_start = FT_GET_ULONG(); + glyph_end = FT_GET_ULONG(); + + FT_FRAME_EXIT(); + + if ( glyph_start == glyph_end ) + return FT_THROW( Invalid_Argument ); + if ( glyph_start > glyph_end || + glyph_end - glyph_start < 8 || + table_size - strike_offset < glyph_end ) + return FT_THROW( Invalid_File_Format ); + + if ( FT_STREAM_SEEK( sbix_pos + strike_offset + glyph_start ) || + FT_FRAME_ENTER( glyph_end - glyph_start ) ) + return error; + + originOffsetX = FT_GET_SHORT(); + originOffsetY = FT_GET_SHORT(); + + graphicType = FT_GET_TAG4(); + data_size = glyph_end - glyph_start - 8; + + switch ( graphicType ) + { + case FT_MAKE_TAG( 'd', 'u', 'p', 'e' ): + if ( recurse_depth < 4 ) + { + glyph_index = FT_GET_USHORT(); + FT_FRAME_EXIT(); + recurse_depth++; + goto retry; + } + error = FT_THROW( Invalid_File_Format ); + break; + + case FT_MAKE_TAG( 'p', 'n', 'g', ' ' ): +#ifdef FT_CONFIG_OPTION_USE_PNG + error = Load_SBit_Png( face->root.glyph, + 0, + 0, + 32, + metrics, + stream->memory, + stream->cursor, + data_size, + TRUE ); +#else + error = FT_THROW( Unimplemented_Feature ); +#endif + break; + + case FT_MAKE_TAG( 'j', 'p', 'g', ' ' ): + case FT_MAKE_TAG( 't', 'i', 'f', 'f' ): + error = FT_THROW( Unknown_File_Format ); + break; + + default: + error = FT_THROW( Unimplemented_Feature ); + break; + } + + FT_FRAME_EXIT(); + + if ( !error ) + { + FT_Short abearing; + FT_UShort aadvance; + + + tt_face_get_metrics( face, FALSE, glyph_index, &abearing, &aadvance ); + + metrics->horiBearingX = originOffsetX; + metrics->horiBearingY = -originOffsetY + metrics->height; + metrics->horiAdvance = aadvance * face->root.size->metrics.x_ppem / + face->header.Units_Per_EM; + } + + return error; + } + FT_LOCAL( FT_Error ) tt_face_load_sbit_image( TT_Face face, FT_ULong strike_index, @@ -1151,23 +1367,67 @@ FT_Bitmap *map, TT_SBit_MetricsRec *metrics ) { - TT_SBitDecoderRec decoder[1]; - FT_Error error; - - FT_UNUSED( load_flags ); - FT_UNUSED( stream ); - FT_UNUSED( map ); + FT_Error error = FT_Err_Ok; - error = tt_sbit_decoder_init( decoder, face, strike_index, metrics ); - if ( !error ) + switch ( (FT_UInt)face->sbit_table_type ) { - error = tt_sbit_decoder_load_image( decoder, - load_flags, - glyph_index, - 0, - 0 ); - tt_sbit_decoder_done( decoder ); + case TT_SBIT_TABLE_TYPE_EBLC: + case TT_SBIT_TABLE_TYPE_CBLC: + { + TT_SBitDecoderRec decoder[1]; + + + error = tt_sbit_decoder_init( decoder, face, strike_index, metrics ); + if ( !error ) + { + error = tt_sbit_decoder_load_image( decoder, + glyph_index, + 0, + 0 ); + tt_sbit_decoder_done( decoder ); + } + } + break; + + case TT_SBIT_TABLE_TYPE_SBIX: + error = tt_face_load_sbix_image( face, + strike_index, + glyph_index, + stream, + map, + metrics ); + break; + + default: + error = FT_THROW( Unknown_File_Format ); + break; + } + + /* Flatten color bitmaps if color was not requested. */ + if ( !error && + !( load_flags & FT_LOAD_COLOR ) && + map->pixel_mode == FT_PIXEL_MODE_BGRA ) + { + FT_Bitmap new_map; + FT_Library library = face->root.glyph->library; + + + FT_Bitmap_New( &new_map ); + + /* Convert to 8bit grayscale. */ + error = FT_Bitmap_Convert( library, map, &new_map, 1 ); + if ( error ) + FT_Bitmap_Done( library, &new_map ); + else + { + map->pixel_mode = new_map.pixel_mode; + map->pitch = new_map.pitch; + map->num_grays = new_map.num_grays; + + ft_glyphslot_set_bitmap( face->root.glyph, new_map.buffer ); + face->root.glyph->internal->flags |= FT_GLYPH_OWN_BITMAP; + } } return error; diff --git a/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.h b/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.h index ea0b5f8adae..695d0d8d02e 100644 --- a/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.h +++ b/reactos/lib/3rdparty/freetype/src/sfnt/ttsbit.h @@ -28,11 +28,11 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) - tt_face_load_eblc( TT_Face face, + tt_face_load_sbit( TT_Face face, FT_Stream stream ); FT_LOCAL( void ) - tt_face_free_eblc( TT_Face face ); + tt_face_free_sbit( TT_Face face ); FT_LOCAL( FT_Error ) diff --git a/reactos/lib/3rdparty/freetype/src/smooth/ftgrays.c b/reactos/lib/3rdparty/freetype/src/smooth/ftgrays.c index 7532a358296..2c51e9f6ebf 100644 --- a/reactos/lib/3rdparty/freetype/src/smooth/ftgrays.c +++ b/reactos/lib/3rdparty/freetype/src/smooth/ftgrays.c @@ -24,8 +24,8 @@ /* */ /* - copy `src/smooth/ftgrays.c' (this file) to your current directory */ /* */ - /* - copy `include/freetype/ftimage.h' and `src/smooth/ftgrays.h' to the */ - /* same directory */ + /* - copy `include/ftimage.h' and `src/smooth/ftgrays.h' to the same */ + /* directory */ /* */ /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */ /* */ @@ -310,6 +310,40 @@ typedef ptrdiff_t FT_PtrDist; #endif + /* Compute `dividend / divisor' and return both its quotient and */ + /* remainder, cast to a specific type. This macro also ensures that */ + /* the remainder is always positive. */ +#define FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \ + FT_BEGIN_STMNT \ + (quotient) = (type)( (dividend) / (divisor) ); \ + (remainder) = (type)( (dividend) % (divisor) ); \ + if ( (remainder) < 0 ) \ + { \ + (quotient)--; \ + (remainder) += (type)(divisor); \ + } \ + FT_END_STMNT + +#ifdef __arm__ + /* Work around a bug specific to GCC which make the compiler fail to */ + /* optimize a division and modulo operation on the same parameters */ + /* into a single call to `__aeabi_idivmod'. See */ + /* */ + /* http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43721 */ +#undef FT_DIV_MOD +#define FT_DIV_MOD( type, dividend, divisor, quotient, remainder ) \ + FT_BEGIN_STMNT \ + (quotient) = (type)( (dividend) / (divisor) ); \ + (remainder) = (type)( (dividend) - (quotient) * (divisor) ); \ + if ( (remainder) < 0 ) \ + { \ + (quotient)--; \ + (remainder) += (type)(divisor); \ + } \ + FT_END_STMNT +#endif /* __arm__ */ + + /*************************************************************************/ /* */ /* TYPE DEFINITIONS */ @@ -548,7 +582,7 @@ typedef ptrdiff_t FT_PtrDist; static void gray_record_cell( RAS_ARG ) { - if ( !ras.invalid && ( ras.area | ras.cover ) ) + if ( ras.area | ras.cover ) { PCell cell = gray_find_cell( RAS_VAR ); @@ -597,10 +631,10 @@ typedef ptrdiff_t FT_PtrDist; ras.area = 0; ras.cover = 0; + ras.ex = ex; + ras.ey = ey; } - ras.ex = ex; - ras.ey = ey; ras.invalid = ( (unsigned)ey >= (unsigned)ras.count_ey || ex >= ras.count_ex ); } @@ -686,13 +720,7 @@ typedef ptrdiff_t FT_PtrDist; dx = -dx; } - delta = (TCoord)( p / dx ); - mod = (TCoord)( p % dx ); - if ( mod < 0 ) - { - delta--; - mod += (TCoord)dx; - } + FT_DIV_MOD( TCoord, p, dx, delta, mod ); ras.area += (TArea)(( fx1 + first ) * delta); ras.cover += delta; @@ -706,14 +734,8 @@ typedef ptrdiff_t FT_PtrDist; TCoord lift, rem; - p = ONE_PIXEL * ( y2 - y1 + delta ); - lift = (TCoord)( p / dx ); - rem = (TCoord)( p % dx ); - if ( rem < 0 ) - { - lift--; - rem += (TCoord)dx; - } + p = ONE_PIXEL * ( y2 - y1 + delta ); + FT_DIV_MOD( TCoord, p, dx, lift, rem ); mod -= (int)dx; @@ -763,9 +785,6 @@ typedef ptrdiff_t FT_PtrDist; dx = to_x - ras.x; dy = to_y - ras.y; - /* XXX: we should do something about the trivial case where dx == 0, */ - /* as it happens very often! */ - /* perform vertical clipping */ { TCoord min, max; @@ -844,13 +863,7 @@ typedef ptrdiff_t FT_PtrDist; dy = -dy; } - delta = (int)( p / dy ); - mod = (int)( p % dy ); - if ( mod < 0 ) - { - delta--; - mod += (TCoord)dy; - } + FT_DIV_MOD( int, p, dy, delta, mod ); x = ras.x + delta; gray_render_scanline( RAS_VAR_ ey1, ras.x, fy1, x, (TCoord)first ); @@ -861,13 +874,7 @@ typedef ptrdiff_t FT_PtrDist; if ( ey1 != ey2 ) { p = ONE_PIXEL * dx; - lift = (int)( p / dy ); - rem = (int)( p % dy ); - if ( rem < 0 ) - { - lift--; - rem += (int)dy; - } + FT_DIV_MOD( int, p, dy, lift, rem ); mod -= (int)dy; while ( ey1 != ey2 ) @@ -1171,7 +1178,8 @@ typedef ptrdiff_t FT_PtrDist; /* record current cell, if any */ - gray_record_cell( RAS_VAR ); + if ( !ras.invalid ) + gray_record_cell( RAS_VAR ); /* start to a new position */ x = UPSCALE( to->x ); @@ -1781,7 +1789,8 @@ typedef ptrdiff_t FT_PtrDist; if ( ft_setjmp( ras.jump_buffer ) == 0 ) { error = FT_Outline_Decompose( &ras.outline, &func_interface, &ras ); - gray_record_cell( RAS_VAR ); + if ( !ras.invalid ) + gray_record_cell( RAS_VAR ); } else error = FT_THROW( Memory_Overflow ); diff --git a/reactos/lib/3rdparty/freetype/src/tools/afblue.pl b/reactos/lib/3rdparty/freetype/src/tools/afblue.pl new file mode 100644 index 00000000000..774438f84a7 --- /dev/null +++ b/reactos/lib/3rdparty/freetype/src/tools/afblue.pl @@ -0,0 +1,542 @@ +#! /usr/bin/perl -w +# -*- Perl -*- +# +# afblue.pl +# +# Process a blue zone character data file. +# +# Copyright 2013 by +# David Turner, Robert Wilhelm, and Werner Lemberg. +# +# This file is part of the FreeType project, and may only be used, +# modified, and distributed under the terms of the FreeType project +# license, LICENSE.TXT. By continuing to use, modify, or distribute +# this file you indicate that you have read the license and +# understand and accept it fully. + +use strict; +use warnings; +use English '-no_match_vars'; +use open ':std', ':locale'; + + +my $prog = $PROGRAM_NAME; +$prog =~ s| .* / ||x; # Remove path. + +die "usage: $prog datafile < infile > outfile\n" if $#ARGV != 0; + + +my $datafile = $ARGV[0]; + +my %diversions; # The extracted and massaged data from `datafile'. +my @else_stack; # Booleans to track else-clauses. +my @name_stack; # Stack of integers used for names of aux. variables. + +my $curr_enum; # Name of the current enumeration. +my $curr_array; # Name of the current array. +my $curr_max; # Name of the current maximum value. + +my $curr_enum_element; # Name of the current enumeration element. +my $curr_offset; # The offset relative to current aux. variable. +my $curr_elem_size; # The size of the current string or block. + +my $have_sections = 0; # Boolean; set if start of a section has been seen. +my $have_strings; # Boolean; set if current section contains strings. +my $have_blocks; # Boolean; set if current section contains blocks. + +my $have_enum_element; # Boolean; set if we have an enumeration element. +my $in_string; # Boolean; set if a string has been parsed. + +my $num_sections = 0; # Number of sections seen so far. + +my $last_aux; # Name of last auxiliary variable. + + +# Regular expressions. + +# [] [] ':' [] '\n' +my $section_re = qr/ ^ \s* (\S+) \s+ (\S+) \s+ (\S+) \s* : \s* $ /x; + +# [] [] '\n' +my $enum_element_re = qr/ ^ \s* ( [A-Za-z0-9_]+ ) \s* $ /x; + +# '#' '\n' +my $preprocessor_re = qr/ ^ \# /x; + +# '/' '/' '\n' +my $comment_re = qr| ^ // |x; + +# empty line +my $whitespace_only_re = qr/ ^ \s* $ /x; + +# [] '"' '"' [] '\n' ( doesn't contain newlines) +my $string_re = qr/ ^ \s* + " ( (?: [^"\\]++ | \\. )*+ ) " + \s* $ /x; + +# [] '{' '}' [] '\n' ( can contain newlines) +my $block_start_re = qr/ ^ \s* \{ /x; + +# We need the capturing group for `split' to make it return the separator +# tokens (i.e., the opening and closing brace) also. +my $brace_re = qr/ ( [{}] ) /x; + + +sub Warn +{ + my $message = shift; + warn "$datafile:$INPUT_LINE_NUMBER: warning: $message\n"; +} + + +sub Die +{ + my $message = shift; + die "$datafile:$INPUT_LINE_NUMBER: error: $message\n"; +} + + +my $warned_before = 0; + +sub warn_before +{ + Warn("data before first section gets ignored") unless $warned_before; + $warned_before = 1; +} + + +sub strip_newline +{ + chomp; + s/ \x0D $ //x; +} + + +sub end_curr_string +{ + # Append final null byte to string. + if ($have_strings) + { + push @{$diversions{$curr_array}}, " '\\0',\n" if $in_string; + + $curr_offset++; + $in_string = 0; + } +} + + +sub update_max_elem_size +{ + if ($curr_elem_size) + { + my $max = pop @{$diversions{$curr_max}}; + $max = $curr_elem_size if $curr_elem_size > $max; + push @{$diversions{$curr_max}}, $max; + } +} + + +sub convert_non_ascii_char +{ + # A UTF-8 character outside of the printable ASCII range, with possibly a + # leading backslash character. + my $s = shift; + + # Here we count characters, not bytes. + $curr_elem_size += length $s; + + utf8::encode($s); + $s = uc unpack 'H*', $s; + + $curr_offset += $s =~ s/\G(..)/'\\x$1', /sg; + + return $s; +} + + +sub convert_ascii_chars +{ + # A series of ASCII characters in the printable range. + my $s = shift; + + my $count = $s =~ s/\G(.)/'$1', /g; + $curr_offset += $count; + $curr_elem_size += $count; + + return $s; +} + + +sub convert_literal +{ + my $s = shift; + my $orig = $s; + + # ASCII printables and space + my $safe_re = '\x20-\x7E'; + # ASCII printables and space, no backslash + my $safe_no_backslash_re = '\x20-\x5B\x5D-\x7E'; + + $s =~ s{ + (?: \\? ( [^$safe_re] ) + | ( (?: [$safe_no_backslash_re] + | \\ [$safe_re] )+ ) ) + } + { + defined($1) ? convert_non_ascii_char($1) + : convert_ascii_chars($2) + }egx; + + # We assume that `$orig' doesn't contain `*/' + return $s . " /* $orig */"; +} + + +sub aux_name +{ + return "af_blue_" . $num_sections. "_" . join('_', reverse @name_stack); +} + + +sub aux_name_next +{ + $name_stack[$#name_stack]++; + my $name = aux_name(); + $name_stack[$#name_stack]--; + + return $name; +} + + +sub enum_val_string +{ + # Build string which holds code to save the current offset in an + # enumeration element. + my $aux = shift; + + my $add = ($last_aux eq "af_blue_" . $num_sections . "_0" ) + ? "" + : "$last_aux + "; + + return " $aux = $add$curr_offset,\n"; +} + + + +# Process data file. + +open(DATA, $datafile) || die "$prog: can't open \`$datafile': $OS_ERROR\n"; + +while () +{ + strip_newline(); + + next if /$comment_re/; + next if /$whitespace_only_re/; + + if (/$section_re/) + { + Warn("previous section is empty") if ($have_sections + && !$have_strings + && !$have_blocks); + + end_curr_string(); + update_max_elem_size(); + + # Save captured groups from `section_re'. + $curr_enum = $1; + $curr_array = $2; + $curr_max = $3; + + $curr_enum_element = ""; + $curr_offset = 0; + + Warn("overwriting already defined enumeration \`$curr_enum'") + if exists($diversions{$curr_enum}); + Warn("overwriting already defined array \`$curr_array'") + if exists($diversions{$curr_array}); + Warn("overwriting already defined maximum value \`$curr_max'") + if exists($diversions{$curr_max}); + + $diversions{$curr_enum} = []; + $diversions{$curr_array} = []; + $diversions{$curr_max} = []; + + push @{$diversions{$curr_max}}, 0; + + @name_stack = (); + push @name_stack, 0; + + $have_sections = 1; + $have_strings = 0; + $have_blocks = 0; + + $have_enum_element = 0; + $in_string = 0; + + $num_sections++; + $curr_elem_size = 0; + + $last_aux = aux_name(); + + next; + } + + if (/$preprocessor_re/) + { + if ($have_sections) + { + # Having preprocessor conditionals complicates the computation of + # correct offset values. We have to introduce auxiliary enumeration + # elements with the name `af_blue____...' which store + # offsets to be used in conditional clauses. `' is the number of + # sections seen so far, `' is the number of `#if' and `#endif' + # conditionals seen so far in the topmost level, `' the number of + # `#if' and `#endif' conditionals seen so far one level deeper, etc. + # As a consequence, uneven values are used within a clause, and even + # values after a clause, since the C standard doesn't allow the + # redefinition of an enumeration value. For example, the name + # `af_blue_5_1_6' is used to construct enumeration values in the fifth + # section after the third (second-level) if-clause within the first + # (top-level) if-clause. After the first top-level clause has + # finished, `af_blue_5_2' is used. The current offset is then + # relative to the value stored in the current auxiliary element. + + if (/ ^ \# \s* if /x) + { + push @else_stack, 0; + + $name_stack[$#name_stack]++; + + push @{$diversions{$curr_enum}}, enum_val_string(aux_name()); + $last_aux = aux_name(); + + push @name_stack, 0; + + $curr_offset = 0; + } + elsif (/ ^ \# \s* elif /x) + { + Die("unbalanced #elif") unless @else_stack; + + pop @name_stack; + + push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next()); + $last_aux = aux_name(); + + push @name_stack, 0; + + $curr_offset = 0; + } + elsif (/ ^ \# \s* else /x) + { + my $prev_else = pop @else_stack; + Die("unbalanced #else") unless defined($prev_else); + Die("#else already seen") if $prev_else; + push @else_stack, 1; + + pop @name_stack; + + push @{$diversions{$curr_enum}}, enum_val_string(aux_name_next()); + $last_aux = aux_name(); + + push @name_stack, 0; + + $curr_offset = 0; + } + elsif (/ ^ \# \s* endif /x) + { + my $prev_else = pop @else_stack; + Die("unbalanced #endif") unless defined($prev_else); + + pop @name_stack; + $name_stack[$#name_stack]++; + + # If there is no else-clause for an if-clause, we add one. This is + # necessary to have correct offsets. + if (!$prev_else) + { + push @{$diversions{$curr_enum}}, enum_val_string(aux_name()) + . "#else\n"; + + $curr_offset = 0; + } + + push @{$diversions{$curr_enum}}, enum_val_string(aux_name()); + $last_aux = aux_name(); + + $curr_offset = 0; + } + + # Handle (probably continued) preprocessor lines. + CONTINUED_LOOP: + { + do + { + strip_newline(); + + push @{$diversions{$curr_enum}}, $ARG . "\n"; + push @{$diversions{$curr_array}}, $ARG . "\n"; + + last CONTINUED_LOOP unless / \\ $ /x; + + } while (); + } + } + else + { + warn_before(); + } + + next; + } + + if (/$enum_element_re/) + { + end_curr_string(); + update_max_elem_size(); + + $curr_enum_element = $1; + $have_enum_element = 1; + $curr_elem_size = 0; + + next; + } + + if (/$string_re/) + { + if ($have_sections) + { + Die("strings and blocks can't be mixed in a section") if $have_blocks; + + # Save captured group from `string_re'. + my $string = $1; + + if ($have_enum_element) + { + push @{$diversions{$curr_enum}}, enum_val_string($curr_enum_element); + $have_enum_element = 0; + } + + $string = convert_literal($string); + + push @{$diversions{$curr_array}}, " $string\n"; + + $have_strings = 1; + $in_string = 1; + } + else + { + warn_before(); + } + + next; + } + + if (/$block_start_re/) + { + if ($have_sections) + { + Die("strings and blocks can't be mixed in a section") if $have_strings; + + my $depth = 0; + my $block = ""; + my $block_end = 0; + + # Count braces while getting the block. + BRACE_LOOP: + { + do + { + strip_newline(); + + foreach my $substring (split(/$brace_re/)) + { + if ($block_end) + { + Die("invalid data after last matching closing brace") + if $substring !~ /$whitespace_only_re/; + } + + $block .= $substring; + + if ($substring eq '{') + { + $depth++; + } + elsif ($substring eq '}') + { + $depth--; + + $block_end = 1 if $depth == 0; + } + } + + # If we are here, we have run out of substrings, so get next line + # or exit. + last BRACE_LOOP if $block_end; + + $block .= "\n"; + + } while (); + } + + if ($have_enum_element) + { + push @{$diversions{$curr_enum}}, enum_val_string($curr_enum_element); + $have_enum_element = 0; + } + + push @{$diversions{$curr_array}}, $block . ",\n"; + + $curr_offset++; + $curr_elem_size++; + + $have_blocks = 1; + } + else + { + warn_before(); + } + + next; + } + + # Garbage. We weren't able to parse the data. + Die("syntax error"); +} + +# Finalize data. +end_curr_string(); +update_max_elem_size(); + + +# Filter stdin to stdout, replacing `@...@' templates. + +sub emit_diversion +{ + my $diversion_name = shift; + return (exists($diversions{$1})) ? "@{$diversions{$1}}" + : "@" . $diversion_name . "@"; +} + + +$LIST_SEPARATOR = ''; + +my $s1 = "This file has been generated by the Perl script \`$prog',"; +my $s1len = length $s1; +my $s2 = "using data from file \`$datafile'."; +my $s2len = length $s2; +my $slen = ($s1len > $s2len) ? $s1len : $s2len; + +print "/* " . $s1 . " " x ($slen - $s1len) . " */\n" + . "/* " . $s2 . " " x ($slen - $s2len) . " */\n" + . "\n"; + +while () +{ + s/ @ ( [A-Za-z0-9_]+? ) @ / emit_diversion($1) /egx; + print; +} + +# EOF diff --git a/reactos/lib/3rdparty/freetype/src/tools/chktrcmp.py b/reactos/lib/3rdparty/freetype/src/tools/chktrcmp.py index d0f342e6bdd..ce6500c7e25 100644 --- a/reactos/lib/3rdparty/freetype/src/tools/chktrcmp.py +++ b/reactos/lib/3rdparty/freetype/src/tools/chktrcmp.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # # Check trace components in FreeType 2 source. -# Author: suzuki toshiya, 2009 +# Author: suzuki toshiya, 2009, 2013 # # This code is explicitly into the public domain. @@ -15,7 +15,7 @@ USED_COMPONENT = {} KNOWN_COMPONENT = {} SRC_FILE_DIRS = [ "src" ] -TRACE_DEF_FILES = [ "include/freetype/internal/fttrace.h" ] +TRACE_DEF_FILES = [ "include/internal/fttrace.h" ] # -------------------------------------------------------------- diff --git a/reactos/lib/3rdparty/freetype/src/tools/docmaker/content.py b/reactos/lib/3rdparty/freetype/src/tools/docmaker/content.py index 26087f7b88a..98025e67e5e 100644 --- a/reactos/lib/3rdparty/freetype/src/tools/docmaker/content.py +++ b/reactos/lib/3rdparty/freetype/src/tools/docmaker/content.py @@ -1,4 +1,4 @@ -# Content (c) 2002, 2004, 2006-2009, 2012 +# Content (c) 2002, 2004, 2006-2009, 2012, 2013 # David Turner # # This file contains routines used to parse the content of documentation @@ -268,15 +268,6 @@ class DocMarkup: except: return None - def get_start( self ): - try: - result = "" - for word in self.fields[0].items[0].words: - result = result + " " + word - return result[1:] - except: - return "ERROR" - def dump( self, margin ): print " " * margin + "<" + self.tag + ">" for f in self.fields: @@ -555,14 +546,6 @@ class DocBlock: return m return None - def get_markup_name( self, tag_name ): - """return the name of a given primary markup in a block""" - try: - m = self.get_markup( tag_name ) - return m.get_name() - except: - return None - def get_markup_words( self, tag_name ): try: m = self.get_markup( tag_name ) diff --git a/reactos/lib/3rdparty/freetype/src/tools/docmaker/docmaker.py b/reactos/lib/3rdparty/freetype/src/tools/docmaker/docmaker.py index 1d9de9fbff2..bf75c5d5f01 100644 --- a/reactos/lib/3rdparty/freetype/src/tools/docmaker/docmaker.py +++ b/reactos/lib/3rdparty/freetype/src/tools/docmaker/docmaker.py @@ -1,8 +1,8 @@ #!/usr/bin/env python # -# DocMaker (c) 2002, 2004, 2008 David Turner +# DocMaker (c) 2002, 2004, 2008, 2013 David Turner # -# This program is a re-write of the original DocMaker took used +# This program is a re-write of the original DocMaker tool used # to generate the API Reference of the FreeType font engine # by converting in-source comments into structured HTML. # diff --git a/reactos/lib/3rdparty/freetype/src/tools/docmaker/sources.py b/reactos/lib/3rdparty/freetype/src/tools/docmaker/sources.py index 490ba25063a..dab83497865 100644 --- a/reactos/lib/3rdparty/freetype/src/tools/docmaker/sources.py +++ b/reactos/lib/3rdparty/freetype/src/tools/docmaker/sources.py @@ -1,4 +1,4 @@ -# Sources (c) 2002-2004, 2006-2009, 2012 +# Sources (c) 2002-2004, 2006-2009, 2012, 2013 # David Turner # # @@ -132,7 +132,7 @@ re_markup_tags = [re_markup_tag1, re_markup_tag2] # # used to detect a cross-reference, after markup tags have been stripped # -re_crossref = re.compile( r'@((?:\w|-)*)(.*)' ) +re_crossref = re.compile( r'@((?:\w|-)*)(.*)' ) # @foo # # used to detect italic and bold styles in paragraph text @@ -140,6 +140,42 @@ re_crossref = re.compile( r'@((?:\w|-)*)(.*)' ) re_italic = re.compile( r"_(\w(\w|')*)_(.*)" ) # _italic_ re_bold = re.compile( r"\*(\w(\w|')*)\*(.*)" ) # *bold* +# +# this regular expression code to identify an URL has been taken from +# +# http://mail.python.org/pipermail/tutor/2002-September/017228.html +# +# (with slight modifications) +# + +urls = r'(?:https?|telnet|gopher|file|wais|ftp)' +ltrs = r'\w' +gunk = r'/#~:.?+=&%@!\-' +punc = r'.:?\-' +any = "%(ltrs)s%(gunk)s%(punc)s" % { 'ltrs' : ltrs, + 'gunk' : gunk, + 'punc' : punc } +url = r""" + ( + \b # start at word boundary + %(urls)s : # need resource and a colon + [%(any)s] +? # followed by one or more of any valid + # character, but be conservative and + # take only what you need to... + (?= # [look-ahead non-consumptive assertion] + [%(punc)s]* # either 0 or more punctuation + (?: # [non-grouping parentheses] + [^%(any)s] | $ # followed by a non-url char + # or end of the string + ) + ) + ) + """ % {'urls' : urls, + 'any' : any, + 'punc' : punc } + +re_url = re.compile( url, re.VERBOSE | re.MULTILINE ) + # # used to detect the end of commented source lines # diff --git a/reactos/lib/3rdparty/freetype/src/tools/docmaker/tohtml.py b/reactos/lib/3rdparty/freetype/src/tools/docmaker/tohtml.py index 1cbda755b8f..7944f1c995b 100644 --- a/reactos/lib/3rdparty/freetype/src/tools/docmaker/tohtml.py +++ b/reactos/lib/3rdparty/freetype/src/tools/docmaker/tohtml.py @@ -1,4 +1,4 @@ -# ToHTML (c) 2002, 2003, 2005, 2006, 2007, 2008 +# ToHTML (c) 2002, 2003, 2005-2008, 2013 # David Turner from sources import * @@ -175,25 +175,6 @@ def html_quote( line ): return result -# same as 'html_quote', but ignores left and right brackets -def html_quote0( line ): - return string.replace( line, "&", "&" ) - - -def dump_html_code( lines, prefix = "" ): - # clean the last empty lines - l = len( self.lines ) - while l > 0 and string.strip( self.lines[l - 1] ) == "": - l = l - 1 - - # The code footer should be directly appended to the last code - # line to avoid an additional blank line. - print prefix + code_header, - for line in self.lines[0 : l + 1]: - print '\n' + prefix + html_quote( line ), - print prefix + code_footer, - - class HtmlFormatter( Formatter ): @@ -242,16 +223,6 @@ class HtmlFormatter( Formatter ): def make_block_url( self, block ): return self.make_section_url( block.section ) + "#" + block.name - def make_html_words( self, words ): - """ convert a series of simple words into some HTML text """ - line = "" - if words: - line = html_quote( words[0] ) - for w in words[1:]: - line = line + " " + html_quote( w ) - - return line - def make_html_word( self, word ): """analyze a simple word to detect cross-references and styling""" # look for cross-references @@ -291,6 +262,8 @@ class HtmlFormatter( Formatter ): line = self.make_html_word( words[0] ) for word in words[1:]: line = line + " " + self.make_html_word( word ) + # handle hyperlinks + line = re_url.sub( r'\1', line ) # convert `...' quotations into real left and right single quotes line = re.sub( r"(^|\W)`(.*?)'(\W|$)", \ r'\1‘\2’\3', \ diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttdriver.c b/reactos/lib/3rdparty/freetype/src/truetype/ttdriver.c index fb25706ab83..36d23a282e8 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttdriver.c +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttdriver.c @@ -215,7 +215,8 @@ FT_UShort ah; - TT_Get_VMetrics( face, start + nn, &tsb, &ah ); + /* since we don't need `tsb', we use zero for `yMax' parameter */ + TT_Get_VMetrics( face, start + nn, 0, &tsb, &ah ); advances[nn] = ah; } } diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttgload.c b/reactos/lib/3rdparty/freetype/src/truetype/ttgload.c index f640a6c78ed..0d74248b80f 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttgload.c +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttgload.c @@ -85,51 +85,36 @@ /*************************************************************************/ /* */ /* Return the vertical metrics in font units for a given glyph. */ - /* Greg Hitchcock from Microsoft told us that if there were no `vmtx' */ - /* table, typoAscender/Descender from the `OS/2' table would be used */ - /* instead, and if there were no `OS/2' table, use ascender/descender */ - /* from the `hhea' table. But that is not what Microsoft's rasterizer */ - /* apparently does: It uses the ppem value as the advance height, and */ - /* sets the top side bearing to be zero. */ + /* See macro `TT_LOADER_SET_PP' below for explanations. */ /* */ FT_LOCAL_DEF( void ) TT_Get_VMetrics( TT_Face face, FT_UInt idx, + FT_Pos yMax, FT_Short* tsb, FT_UShort* ah ) { if ( face->vertical_info ) ( (SFNT_Service)face->sfnt )->get_metrics( face, 1, idx, tsb, ah ); -#if 1 /* Empirically determined, at variance with what MS said */ - - else - { - *tsb = 0; - *ah = face->root.units_per_EM; - } - -#else /* This is what MS said to do. It isn't what they do, however. */ - else if ( face->os2.version != 0xFFFFU ) { - *tsb = face->os2.sTypoAscender; + *tsb = face->os2.sTypoAscender - yMax; *ah = face->os2.sTypoAscender - face->os2.sTypoDescender; } + else { - *tsb = face->horizontal.Ascender; + *tsb = face->horizontal.Ascender - yMax; *ah = face->horizontal.Ascender - face->horizontal.Descender; } -#endif - FT_TRACE5(( " advance height (font units): %d\n", *ah )); FT_TRACE5(( " top side bearing (font units): %d\n", *tsb )); } - static void + static FT_Error tt_get_metrics( TT_Loader loader, FT_UInt glyph_index ) { @@ -138,17 +123,28 @@ TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face ); #endif + FT_Error error; + FT_Stream stream = loader->stream; + FT_Short left_bearing = 0, top_bearing = 0; FT_UShort advance_width = 0, advance_height = 0; + /* we must preserve the stream position */ + /* (which gets altered by the metrics functions) */ + FT_ULong pos = FT_STREAM_POS(); + TT_Get_HMetrics( face, glyph_index, &left_bearing, &advance_width ); TT_Get_VMetrics( face, glyph_index, + loader->bbox.yMax, &top_bearing, &advance_height ); + if ( FT_STREAM_SEEK( pos ) ) + return error; + loader->left_bearing = left_bearing; loader->advance = advance_width; loader->top_bearing = top_bearing; @@ -171,6 +167,8 @@ loader->linear_def = 1; loader->linear = advance_width; } + + return FT_Err_Ok; } @@ -350,9 +348,9 @@ FT_GlyphLoader gloader = load->gloader; FT_Int n_contours = load->n_contours; FT_Outline* outline; - TT_Face face = (TT_Face)load->face; FT_UShort n_ins; FT_Int n_points; + FT_ULong tmp; FT_Byte *flag, *flag_limit; FT_Byte c, count; @@ -418,14 +416,7 @@ FT_TRACE5(( " Instructions size: %u\n", n_ins )); - if ( n_ins > face->max_profile.maxSizeOfInstructions ) - { - FT_TRACE0(( "TT_Load_Simple_Glyph: too many instructions (%d)\n", - n_ins )); - error = FT_THROW( Too_Many_Hints ); - goto Fail; - } - + /* check it */ if ( ( limit - p ) < n_ins ) { FT_TRACE0(( "TT_Load_Simple_Glyph: instruction count mismatch\n" )); @@ -437,6 +428,20 @@ if ( IS_HINTED( load->load_flags ) ) { + /* we don't trust `maxSizeOfInstructions' in the `maxp' table */ + /* and thus update the bytecode array size by ourselves */ + + tmp = load->exec->glyphSize; + error = Update_Max( load->exec->memory, + &tmp, + sizeof ( FT_Byte ), + (void*)&load->exec->glyphIns, + n_ins ); + + load->exec->glyphSize = (FT_UShort)tmp; + if ( error ) + return error; + load->glyph->control_len = n_ins; load->glyph->control_data = load->exec->glyphIns; @@ -745,8 +750,8 @@ #ifdef TT_USE_BYTECODE_INTERPRETER if ( loader->glyph->control_len > 0xFFFFL ) { - FT_TRACE1(( "TT_Hint_Glyph: too long instructions " )); - FT_TRACE1(( "(0x%lx byte) is truncated\n", + FT_TRACE1(( "TT_Hint_Glyph: too long instructions" )); + FT_TRACE1(( " (0x%lx byte) is truncated\n", loader->glyph->control_len )); } n_ins = (FT_UInt)( loader->glyph->control_len ); @@ -783,9 +788,13 @@ } #endif - /* round pp2 and pp4 */ + /* round phantom points */ + zone->cur[zone->n_points - 4].x = + FT_PIX_ROUND( zone->cur[zone->n_points - 4].x ); zone->cur[zone->n_points - 3].x = FT_PIX_ROUND( zone->cur[zone->n_points - 3].x ); + zone->cur[zone->n_points - 2].y = + FT_PIX_ROUND( zone->cur[zone->n_points - 2].y ); zone->cur[zone->n_points - 1].y = FT_PIX_ROUND( zone->cur[zone->n_points - 1].y ); @@ -823,13 +832,10 @@ #endif /* save glyph phantom points */ - if ( !loader->preserve_pps ) - { - loader->pp1 = zone->cur[zone->n_points - 4]; - loader->pp2 = zone->cur[zone->n_points - 3]; - loader->pp3 = zone->cur[zone->n_points - 2]; - loader->pp4 = zone->cur[zone->n_points - 1]; - } + loader->pp1 = zone->cur[zone->n_points - 4]; + loader->pp2 = zone->cur[zone->n_points - 3]; + loader->pp3 = zone->cur[zone->n_points - 2]; + loader->pp4 = zone->cur[zone->n_points - 1]; #ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 ) @@ -1218,21 +1224,23 @@ max_ins = ((TT_Face)loader->face)->max_profile.maxSizeOfInstructions; if ( n_ins > max_ins ) { - /* acroread ignores this field, so we only do a rough safety check */ + /* don't trust `maxSizeOfInstructions'; */ + /* only do a rough safety check */ if ( (FT_Int)n_ins > loader->byte_len ) { - FT_TRACE1(( "TT_Process_Composite_Glyph: " - "too many instructions (%d) for glyph with length %d\n", + FT_TRACE1(( "TT_Process_Composite_Glyph:" + " too many instructions (%d) for glyph with length %d\n", n_ins, loader->byte_len )); return FT_THROW( Too_Many_Hints ); } - tmp = loader->exec->glyphSize; + tmp = loader->exec->glyphSize; error = Update_Max( loader->exec->memory, &tmp, sizeof ( FT_Byte ), (void*)&loader->exec->glyphIns, n_ins ); + loader->exec->glyphSize = (FT_UShort)tmp; if ( error ) return error; @@ -1254,7 +1262,7 @@ /* Some points are likely touched during execution of */ /* instructions on components. So let's untouch them. */ - for ( i = start_point; i < loader->zone.n_points; i++ ) + for ( i = 0; i < loader->zone.n_points; i++ ) loader->zone.tags[i] &= ~FT_CURVE_TAG_TOUCH_BOTH; loader->zone.n_points += 4; @@ -1263,21 +1271,131 @@ } - /* Calculate the four phantom points. */ - /* The first two stand for horizontal origin and advance. */ - /* The last two stand for vertical origin and advance. */ + /* + * Calculate the phantom points + * + * Defining the right side bearing (rsb) as + * + * rsb = aw - (lsb + xmax - xmin) + * + * (with `aw' the advance width, `lsb' the left side bearing, and `xmin' + * and `xmax' the glyph's minimum and maximum x value), the OpenType + * specification defines the initial position of horizontal phantom points + * as + * + * pp1 = (round(xmin - lsb), 0) , + * pp2 = (round(pp1 + aw), 0) . + * + * Note that the rounding to the grid is not documented currently in the + * specification. + * + * However, the specification lacks the precise definition of vertical + * phantom points. Greg Hitchcock provided the following explanation. + * + * - a `vmtx' table is present + * + * For any glyph, the minimum and maximum y values (`ymin' and `ymax') + * are given in the `glyf' table, the top side bearing (tsb) and advance + * height (ah) are given in the `vmtx' table. The bottom side bearing + * (bsb) is then calculated as + * + * bsb = ah - (tsb + ymax - ymin) , + * + * and the initial position of vertical phantom points is + * + * pp3 = (x, round(ymax + tsb)) , + * pp4 = (x, round(pp3 - ah)) . + * + * See below for value `x'. + * + * - no `vmtx' table in the font + * + * If there is an `OS/2' table, we set + * + * DefaultAscender = sTypoAscender , + * DefaultDescender = sTypoDescender , + * + * otherwise we use data from the `hhea' table: + * + * DefaultAscender = Ascender , + * DefaultDescender = Descender . + * + * With these two variables we can now set + * + * ah = DefaultAscender - sDefaultDescender , + * tsb = DefaultAscender - yMax , + * + * and proceed as if a `vmtx' table was present. + * + * Usually we have + * + * x = aw / 2 , (1) + * + * but there is one compatibility case where it can be set to + * + * x = -DefaultDescender - + * ((DefaultAscender - DefaultDescender - aw) / 2) . (2) + * + * and another one with + * + * x = 0 . (3) + * + * In Windows, the history of those values is quite complicated, + * depending on the hinting engine (that is, the graphics framework). + * + * framework from to formula + * ---------------------------------------------------------- + * GDI Windows 98 current (1) + * (Windows 2000 for NT) + * GDI+ Windows XP Windows 7 (2) + * GDI+ Windows 8 current (3) + * DWrite Windows 7 current (3) + * + * For simplicity, FreeType uses (1) for grayscale subpixel hinting and + * (3) for everything else. + * + */ +#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING + #define TT_LOADER_SET_PP( loader ) \ - do { \ + do \ + { \ + FT_Bool subpixel_ = loader->exec \ + ? loader->exec->subpixel_hinting \ + : 0; \ + FT_Bool grayscale_ = loader->exec \ + ? loader->exec->grayscale_hinting \ + : 0; \ + FT_Bool use_aw_2_ = (FT_Bool)( subpixel_ && grayscale_ ); \ + \ + \ + (loader)->pp1.x = (loader)->bbox.xMin - (loader)->left_bearing; \ + (loader)->pp1.y = 0; \ + (loader)->pp2.x = (loader)->pp1.x + (loader)->advance; \ + (loader)->pp2.y = 0; \ + (loader)->pp3.x = use_aw_2_ ? (loader)->advance / 2 : 0; \ + (loader)->pp3.y = (loader)->bbox.yMax + (loader)->top_bearing; \ + (loader)->pp4.x = use_aw_2_ ? (loader)->advance / 2 : 0; \ + (loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance; \ + } while ( 0 ) + +#else /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ + +#define TT_LOADER_SET_PP( loader ) \ + do \ + { \ (loader)->pp1.x = (loader)->bbox.xMin - (loader)->left_bearing; \ (loader)->pp1.y = 0; \ (loader)->pp2.x = (loader)->pp1.x + (loader)->advance; \ (loader)->pp2.y = 0; \ (loader)->pp3.x = 0; \ - (loader)->pp3.y = (loader)->top_bearing + (loader)->bbox.yMax; \ + (loader)->pp3.y = (loader)->bbox.yMax + (loader)->top_bearing; \ (loader)->pp4.x = 0; \ (loader)->pp4.y = (loader)->pp3.y - (loader)->vadvance; \ } while ( 0 ) +#endif /* !TT_CONFIG_OPTION_SUBPIXEL_HINTING */ + /*************************************************************************/ /* */ @@ -1341,8 +1459,6 @@ y_scale = 0x10000L; } - tt_get_metrics( loader, glyph_index ); - /* Set `offset' to the start of the glyph relative to the start of */ /* the `glyf' table, and `byte_len' to the length of the glyph in */ /* bytes. */ @@ -1402,7 +1518,17 @@ /* read glyph header first */ error = face->read_glyph_header( loader ); - if ( error || header_only ) + if ( error ) + goto Exit; + + /* the metrics must be computed after loading the glyph header */ + /* since we need the glyph's `yMax' value in case the vertical */ + /* metrics must be emulated */ + error = tt_get_metrics( loader, glyph_index ); + if ( error ) + goto Exit; + + if ( header_only ) goto Exit; } @@ -1413,6 +1539,10 @@ loader->bbox.yMin = 0; loader->bbox.yMax = 0; + error = tt_get_metrics( loader, glyph_index ); + if ( error ) + goto Exit; + if ( header_only ) goto Exit; @@ -2204,6 +2334,8 @@ error = FT_Err_Ok; + FT_TRACE1(( "TT_Load_Glyph: glyph index %d\n", glyph_index )); + #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS /* try to load embedded bitmap if any */ diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttgload.h b/reactos/lib/3rdparty/freetype/src/truetype/ttgload.h index 05f75882dc6..3f1699e6867 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttgload.h +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttgload.h @@ -43,6 +43,7 @@ FT_BEGIN_HEADER FT_LOCAL( void ) TT_Get_VMetrics( TT_Face face, FT_UInt idx, + FT_Pos yMax, FT_Short* tsb, FT_UShort* ah ); diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.c b/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.c index e7ffb987cee..92e6d43b693 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.c +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.c @@ -1437,8 +1437,107 @@ #undef PACK -#if 1 +#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER + +#if defined( __arm__ ) && \ + ( defined( __thumb2__ ) || !defined( __thumb__ ) ) + +#define TT_MulFix14 TT_MulFix14_arm + + static FT_Int32 + TT_MulFix14_arm( FT_Int32 a, + FT_Int b ) + { + register FT_Int32 t, t2; + + +#if defined( __CC_ARM ) || defined( __ARMCC__ ) + + __asm + { + smull t2, t, b, a /* (lo=t2,hi=t) = a*b */ + mov a, t, asr #31 /* a = (hi >> 31) */ + add a, a, #0x2000 /* a += 0x2000 */ + adds t2, t2, a /* t2 += a */ + adc t, t, #0 /* t += carry */ + mov a, t2, lsr #14 /* a = t2 >> 14 */ + orr a, a, t, lsl #18 /* a |= t << 18 */ + } + +#elif defined( __GNUC__ ) + + __asm__ __volatile__ ( + "smull %1, %2, %4, %3\n\t" /* (lo=%1,hi=%2) = a*b */ + "mov %0, %2, asr #31\n\t" /* %0 = (hi >> 31) */ +#ifdef __clang__ + "add.w %0, %0, #0x2000\n\t" /* %0 += 0x2000 */ +#else + "add %0, %0, #0x2000\n\t" /* %0 += 0x2000 */ +#endif + "adds %1, %1, %0\n\t" /* %1 += %0 */ + "adc %2, %2, #0\n\t" /* %2 += carry */ + "mov %0, %1, lsr #14\n\t" /* %0 = %1 >> 16 */ + "orr %0, %0, %2, lsl #18\n\t" /* %0 |= %2 << 16 */ + : "=r"(a), "=&r"(t2), "=&r"(t) + : "r"(a), "r"(b) + : "cc" ); + +#endif + + return a; + } + +#endif /* __arm__ && ( __thumb2__ || !__thumb__ ) */ + +#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */ + + +#if defined( __GNUC__ ) && \ + ( defined( __i386__ ) || defined( __x86_64__ ) ) + +#define TT_MulFix14 TT_MulFix14_long_long + + /* Temporarily disable the warning that C90 doesn't support `long long'. */ +#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406 +#pragma GCC diagnostic push +#endif +#pragma GCC diagnostic ignored "-Wlong-long" + + /* This is declared `noinline' because inlining the function results */ + /* in slower code. The `pure' attribute indicates that the result */ + /* only depends on the parameters. */ + static __attribute__(( noinline )) + __attribute__(( pure )) FT_Int32 + TT_MulFix14_long_long( FT_Int32 a, + FT_Int b ) + { + + long long ret = (long long)a * b; + + /* The following line assumes that right shifting of signed values */ + /* will actually preserve the sign bit. The exact behaviour is */ + /* undefined, but this is true on x86 and x86_64. */ + long long tmp = ret >> 63; + + + ret += 0x2000 + tmp; + + return (FT_Int32)( ret >> 14 ); + } + +#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406 +#pragma GCC diagnostic pop +#endif + +#endif /* __GNUC__ && ( __i386__ || __x86_64__ ) */ + + +#ifndef TT_MulFix14 + + /* Compute (a*b)/2^14 with maximum accuracy and rounding. */ + /* This is optimized to be faster than calling FT_MulFix() */ + /* for platforms where sizeof(int) == 2. */ static FT_Int32 TT_MulFix14( FT_Int32 a, FT_Int b ) @@ -1470,37 +1569,50 @@ return sign >= 0 ? (FT_Int32)mid : -(FT_Int32)mid; } -#else +#endif /* !TT_MulFix14 */ - /* compute (a*b)/2^14 with maximum accuracy and rounding */ - static FT_Int32 - TT_MulFix14( FT_Int32 a, - FT_Int b ) + +#if defined( __GNUC__ ) && \ + ( defined( __i386__ ) || \ + defined( __x86_64__ ) || \ + defined( __arm__ ) ) + +#define TT_DotFix14 TT_DotFix14_long_long + +#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406 +#pragma GCC diagnostic push +#endif +#pragma GCC diagnostic ignored "-Wlong-long" + + static __attribute__(( pure )) FT_Int32 + TT_DotFix14_long_long( FT_Int32 ax, + FT_Int32 ay, + FT_Int bx, + FT_Int by ) { - FT_Int32 m, s, hi; - FT_UInt32 l, lo; + /* Temporarily disable the warning that C90 doesn't support */ + /* `long long'. */ + + long long temp1 = (long long)ax * bx; + long long temp2 = (long long)ay * by; - /* compute ax*bx as 64-bit value */ - l = (FT_UInt32)( ( a & 0xFFFFU ) * b ); - m = ( a >> 16 ) * b; + temp1 += temp2; + temp2 = temp1 >> 63; + temp1 += 0x2000 + temp2; - lo = l + ( (FT_UInt32)m << 16 ); - hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l ); + return (FT_Int32)( temp1 >> 14 ); - /* divide the result by 2^14 with rounding */ - s = hi >> 31; - l = lo + (FT_UInt32)s; - hi += s + ( l < lo ); - lo = l; - - l = lo + 0x2000U; - hi += l < lo; - - return (FT_Int32)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) ); } + +#if ( __GNUC__ * 100 + __GNUC_MINOR__ ) >= 406 +#pragma GCC diagnostic pop #endif +#endif /* __GNUC__ && (__arm__ || __i386__ || __x86_64__) */ + + +#ifndef TT_DotFix14 /* compute (ax*bx+ay*by)/2^14 with maximum accuracy and rounding */ static FT_Int32 @@ -1543,6 +1655,8 @@ return (FT_Int32)( ( (FT_UInt32)hi << 18 ) | ( l >> 14 ) ); } +#endif /* TT_DotFix14 */ + /*************************************************************************/ /* */ @@ -3037,42 +3151,42 @@ } -#define DO_JROT \ - if ( args[1] != 0 ) \ - { \ - if ( args[0] == 0 && CUR.args == 0 ) \ - CUR.error = FT_THROW( Bad_Argument ); \ - CUR.IP += args[0]; \ - if ( CUR.IP < 0 || \ - ( CUR.callTop > 0 && \ - CUR.IP > CUR.callStack[CUR.callTop - 1].Cur_End ) ) \ - CUR.error = FT_THROW( Bad_Argument ); \ - CUR.step_ins = FALSE; \ +#define DO_JROT \ + if ( args[1] != 0 ) \ + { \ + if ( args[0] == 0 && CUR.args == 0 ) \ + CUR.error = FT_THROW( Bad_Argument ); \ + CUR.IP += args[0]; \ + if ( CUR.IP < 0 || \ + ( CUR.callTop > 0 && \ + CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) ) \ + CUR.error = FT_THROW( Bad_Argument ); \ + CUR.step_ins = FALSE; \ } -#define DO_JMPR \ - if ( args[0] == 0 && CUR.args == 0 ) \ - CUR.error = FT_THROW( Bad_Argument ); \ - CUR.IP += args[0]; \ - if ( CUR.IP < 0 || \ - ( CUR.callTop > 0 && \ - CUR.IP > CUR.callStack[CUR.callTop - 1].Cur_End ) ) \ - CUR.error = FT_THROW( Bad_Argument ); \ +#define DO_JMPR \ + if ( args[0] == 0 && CUR.args == 0 ) \ + CUR.error = FT_THROW( Bad_Argument ); \ + CUR.IP += args[0]; \ + if ( CUR.IP < 0 || \ + ( CUR.callTop > 0 && \ + CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) ) \ + CUR.error = FT_THROW( Bad_Argument ); \ CUR.step_ins = FALSE; -#define DO_JROF \ - if ( args[1] == 0 ) \ - { \ - if ( args[0] == 0 && CUR.args == 0 ) \ - CUR.error = FT_THROW( Bad_Argument ); \ - CUR.IP += args[0]; \ - if ( CUR.IP < 0 || \ - ( CUR.callTop > 0 && \ - CUR.IP > CUR.callStack[CUR.callTop - 1].Cur_End ) ) \ - CUR.error = FT_THROW( Bad_Argument ); \ - CUR.step_ins = FALSE; \ +#define DO_JROF \ + if ( args[1] == 0 ) \ + { \ + if ( args[0] == 0 && CUR.args == 0 ) \ + CUR.error = FT_THROW( Bad_Argument ); \ + CUR.IP += args[0]; \ + if ( CUR.IP < 0 || \ + ( CUR.callTop > 0 && \ + CUR.IP > CUR.callStack[CUR.callTop - 1].Def->end ) ) \ + CUR.error = FT_THROW( Bad_Argument ); \ + CUR.step_ins = FALSE; \ } @@ -4788,7 +4902,7 @@ if ( pRec->Cur_Count > 0 ) { CUR.callTop++; - CUR.IP = pRec->Cur_Restart; + CUR.IP = pRec->Def->start; } else /* Loop through the current function */ @@ -4878,8 +4992,7 @@ pCrec->Caller_Range = CUR.curRange; pCrec->Caller_IP = CUR.IP + 1; pCrec->Cur_Count = 1; - pCrec->Cur_Restart = def->start; - pCrec->Cur_End = def->end; + pCrec->Def = def; CUR.callTop++; @@ -4967,8 +5080,7 @@ pCrec->Caller_Range = CUR.curRange; pCrec->Caller_IP = CUR.IP + 1; pCrec->Cur_Count = (FT_Int)args[0]; - pCrec->Cur_Restart = def->start; - pCrec->Cur_End = def->end; + pCrec->Def = def; CUR.callTop++; @@ -7716,18 +7828,15 @@ if ( ( args[0] & 32 ) != 0 && CUR.grayscale_hinting ) K |= 1 << 12; - /********************************/ - /* HINTING FOR SUBPIXEL */ - /* Selector Bit: 6 */ - /* Return Bit(s): 13 */ - /* */ - if ( ( args[0] & 64 ) != 0 && - CUR.subpixel_hinting && - CUR.rasterizer_version >= 37 ) + if ( CUR.rasterizer_version >= 37 ) { - K |= 1 << 13; - - /* the stuff below is irrelevant if subpixel_hinting is not set */ + /********************************/ + /* HINTING FOR SUBPIXEL */ + /* Selector Bit: 6 */ + /* Return Bit(s): 13 */ + /* */ + if ( ( args[0] & 64 ) != 0 && CUR.subpixel_hinting ) + K |= 1 << 13; /********************************/ /* COMPATIBLE WIDTHS ENABLED */ @@ -7803,8 +7912,7 @@ call->Caller_Range = CUR.curRange; call->Caller_IP = CUR.IP + 1; call->Cur_Count = 1; - call->Cur_Restart = def->start; - call->Cur_End = def->end; + call->Def = def; INS_Goto_CodeRange( def->range, def->start ); @@ -8860,8 +8968,7 @@ callrec->Caller_Range = CUR.curRange; callrec->Caller_IP = CUR.IP + 1; callrec->Cur_Count = 1; - callrec->Cur_Restart = def->start; - callrec->Cur_End = def->end; + callrec->Def = def; if ( INS_Goto_CodeRange( def->range, def->start ) == FAILURE ) goto LErrorLabel_; diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.h b/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.h index 69f5011ed40..b3916acb699 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.h +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttinterp.h @@ -101,8 +101,8 @@ FT_BEGIN_HEADER FT_Int Caller_Range; FT_Long Caller_IP; FT_Long Cur_Count; - FT_Long Cur_Restart; - FT_Long Cur_End; + + TT_DefRecord *Def; /* either FDEF or IDEF */ } TT_CallRec, *TT_CallStack; diff --git a/reactos/lib/3rdparty/freetype/src/truetype/ttobjs.c b/reactos/lib/3rdparty/freetype/src/truetype/ttobjs.c index 7897efa77a9..4adba58f7bb 100644 --- a/reactos/lib/3rdparty/freetype/src/truetype/ttobjs.c +++ b/reactos/lib/3rdparty/freetype/src/truetype/ttobjs.c @@ -150,20 +150,21 @@ tt_check_trickyness_family( FT_String* name ) { -#define TRICK_NAMES_MAX_CHARACTERS 16 -#define TRICK_NAMES_COUNT 8 +#define TRICK_NAMES_MAX_CHARACTERS 19 +#define TRICK_NAMES_COUNT 9 static const char trick_names[TRICK_NAMES_COUNT] [TRICK_NAMES_MAX_CHARACTERS + 1] = { - "DFKaiSho-SB", /* dfkaisb.ttf */ + "DFKaiSho-SB", /* dfkaisb.ttf */ "DFKaiShu", - "DFKai-SB", /* kaiu.ttf */ - "HuaTianKaiTi?", /* htkt2.ttf */ - "HuaTianSongTi?", /* htst3.ttf */ - "MingLiU", /* mingliu.ttf & mingliu.ttc */ - "PMingLiU", /* mingliu.ttc */ - "MingLi43", /* mingli.ttf */ + "DFKai-SB", /* kaiu.ttf */ + "HuaTianKaiTi?", /* htkt2.ttf */ + "HuaTianSongTi?", /* htst3.ttf */ + "Ming(for ISO10646)", /* hkscsiic.ttf & iicore.ttf */ + "MingLiU", /* mingliu.ttf & mingliu.ttc */ + "PMingLiU", /* mingliu.ttc */ + "MingLi43", /* mingli.ttf */ }; int nn; @@ -532,6 +533,10 @@ /* check that we have a valid TrueType file */ error = sfnt->init_face( stream, face, face_index, num_params, params ); + + /* Stream may have changed. */ + stream = face->root.stream; + if ( error ) goto Exit; diff --git a/reactos/lib/3rdparty/freetype/src/type1/t1gload.c b/reactos/lib/3rdparty/freetype/src/type1/t1gload.c index 23478d12886..35f5b5795d9 100644 --- a/reactos/lib/3rdparty/freetype/src/type1/t1gload.c +++ b/reactos/lib/3rdparty/freetype/src/type1/t1gload.c @@ -300,6 +300,8 @@ goto Exit; } + FT_TRACE1(( "T1_Load_Glyph: glyph index %d\n", glyph_index )); + FT_ASSERT( ( face->len_buildchar == 0 ) == ( face->buildchar == NULL ) ); if ( load_flags & FT_LOAD_NO_RECURSE ) diff --git a/reactos/lib/3rdparty/freetype/src/type1/t1load.c b/reactos/lib/3rdparty/freetype/src/type1/t1load.c index 1c834a17bb8..4b5026bfccf 100644 --- a/reactos/lib/3rdparty/freetype/src/type1/t1load.c +++ b/reactos/lib/3rdparty/freetype/src/type1/t1load.c @@ -2209,7 +2209,6 @@ if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY ) { FT_Int charcode, idx, min_char, max_char; - FT_Byte* char_name; FT_Byte* glyph_name; @@ -2224,6 +2223,9 @@ charcode = 0; for ( ; charcode < loader.encoding_table.max_elems; charcode++ ) { + FT_Byte* char_name; + + type1->encoding.char_index[charcode] = 0; type1->encoding.char_name [charcode] = (char *)".notdef"; diff --git a/reactos/lib/3rdparty/freetype/src/type42/t42objs.c b/reactos/lib/3rdparty/freetype/src/type42/t42objs.c index 18e2c0b6250..f5aa2caf2c0 100644 --- a/reactos/lib/3rdparty/freetype/src/type42/t42objs.c +++ b/reactos/lib/3rdparty/freetype/src/type42/t42objs.c @@ -171,7 +171,6 @@ FT_UNUSED( num_params ); FT_UNUSED( params ); - FT_UNUSED( face_index ); FT_UNUSED( stream ); @@ -507,7 +506,7 @@ FT_Face face = size->face; T42_Face t42face = (T42_Face)face; FT_Size ttsize; - FT_Error error = FT_Err_Ok; + FT_Error error; error = FT_New_Size( t42face->ttf_face, &ttsize ); @@ -648,6 +647,8 @@ FT_Driver_Class ttclazz = ((T42_Driver)glyph->face->driver)->ttclazz; + FT_TRACE1(( "T42_GlyphSlot_Load: glyph index %d\n", glyph_index )); + t42_glyphslot_clear( t42slot->ttslot ); error = ttclazz->load_glyph( t42slot->ttslot, t42size->ttsize, diff --git a/reactos/lib/3rdparty/freetype/src/winfonts/winfnt.c b/reactos/lib/3rdparty/freetype/src/winfonts/winfnt.c index e8055c0898e..68432438bfb 100644 --- a/reactos/lib/3rdparty/freetype/src/winfonts/winfnt.c +++ b/reactos/lib/3rdparty/freetype/src/winfonts/winfnt.c @@ -984,6 +984,8 @@ goto Exit; } + FT_TRACE1(( "FNT_Load_Glyph: glyph index %d\n", glyph_index )); + if ( glyph_index > 0 ) glyph_index--; /* revert to real index */ else @@ -1024,7 +1026,7 @@ bitmap->rows = font->header.pixel_height; bitmap->pixel_mode = FT_PIXEL_MODE_MONO; - if ( offset + pitch * bitmap->rows >= font->header.file_size ) + if ( offset + pitch * bitmap->rows > font->header.file_size ) { FT_TRACE2(( "invalid bitmap width\n" )); error = FT_THROW( Invalid_File_Format ); diff --git a/reactos/media/doc/3rd Party Files.txt b/reactos/media/doc/3rd Party Files.txt index e145d523149..180dd48a0b0 100644 --- a/reactos/media/doc/3rd Party Files.txt +++ b/reactos/media/doc/3rd Party Files.txt @@ -15,7 +15,7 @@ Used Version: 1.1 Website: http://www.geocities.com/dborca/opengl/tc.html Title: FreeType -Used Version: 2.5.0 +Used Version: 2.5.2 Website: http://www.freetype.org Title: Mesa3D diff --git a/reactos/win32ss/gdi/ntgdi/freetype.c b/reactos/win32ss/gdi/ntgdi/freetype.c index 536d5b8838f..1e761e8f6d9 100644 --- a/reactos/win32ss/gdi/ntgdi/freetype.c +++ b/reactos/win32ss/gdi/ntgdi/freetype.c @@ -13,11 +13,11 @@ #include FT_GLYPH_H #include FT_TYPE1_TABLES_H -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #define NDEBUG #include From 73100dd557ed198c035d8591a72164e166fa243e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Tue, 4 Mar 2014 21:28:25 +0000 Subject: [PATCH 056/419] [VFATLIB] - remove useless dependency to psdk svn path=/trunk/; revision=62418 --- reactos/lib/fslib/vfatlib/CMakeLists.txt | 1 - reactos/lib/fslib/vfatlib/check/io.c | 2 +- reactos/lib/fslib/vfatlib/check/lfn.c | 1 + reactos/lib/fslib/vfatlib/vfatlib.h | 1 - 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/reactos/lib/fslib/vfatlib/CMakeLists.txt b/reactos/lib/fslib/vfatlib/CMakeLists.txt index e0f18c01d9b..7df11959eb2 100644 --- a/reactos/lib/fslib/vfatlib/CMakeLists.txt +++ b/reactos/lib/fslib/vfatlib/CMakeLists.txt @@ -15,4 +15,3 @@ list(APPEND SOURCE add_library(vfatlib ${SOURCE}) add_pch(vfatlib vfatlib.h SOURCE) -add_dependencies(vfatlib psdk) diff --git a/reactos/lib/fslib/vfatlib/check/io.c b/reactos/lib/fslib/vfatlib/check/io.c index 36e0605b01f..54ac65f308e 100644 --- a/reactos/lib/fslib/vfatlib/check/io.c +++ b/reactos/lib/fslib/vfatlib/check/io.c @@ -211,7 +211,7 @@ void fs_write(loff_t pos,int size,void *data) const size_t readsize_aligned = (size % 512) ? (size + (512 - (size % 512))) : size; const loff_t seekpos_aligned = pos - (pos % 512); const size_t seek_delta = (size_t)(pos - seekpos_aligned); - boolean use_read = (seek_delta != 0) || ((readsize_aligned-size) != 0); + BOOLEAN use_read = (seek_delta != 0) || ((readsize_aligned-size) != 0); /* Aloc temp buffer if write is not aligned */ if (use_read) diff --git a/reactos/lib/fslib/vfatlib/check/lfn.c b/reactos/lib/fslib/vfatlib/check/lfn.c index fc0b7827b8d..1fdd9fc61f1 100644 --- a/reactos/lib/fslib/vfatlib/check/lfn.c +++ b/reactos/lib/fslib/vfatlib/check/lfn.c @@ -3,6 +3,7 @@ /* Written 1998 by Roman Hodek */ #include "vfatlib.h" +#include #define NDEBUG #include diff --git a/reactos/lib/fslib/vfatlib/vfatlib.h b/reactos/lib/fslib/vfatlib/vfatlib.h index d83831d6c94..2b1302f8390 100644 --- a/reactos/lib/fslib/vfatlib/vfatlib.h +++ b/reactos/lib/fslib/vfatlib/vfatlib.h @@ -14,7 +14,6 @@ #define COM_NO_WINDOWS_H #include #include -#include #define NTOS_MODE_USER #include #include From 61d834485b86061d1a9c0a7ee95307099c2341c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 5 Mar 2014 01:53:46 +0000 Subject: [PATCH 057/419] [APITESTS:kernel32] Be more specific about which last error we expect. svn path=/trunk/; revision=62419 --- rostests/apitests/kernel32/dosdev.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rostests/apitests/kernel32/dosdev.c b/rostests/apitests/kernel32/dosdev.c index fab58ea343c..ce393248be5 100644 --- a/rostests/apitests/kernel32/dosdev.c +++ b/rostests/apitests/kernel32/dosdev.c @@ -137,7 +137,7 @@ static void test_DefineDosDeviceA(void) ok(Result, "Failed to subst drive\n"); DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports unexpected error code\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Wrong last error. Expected %lu, got %lu\n", (DWORD)(ERROR_FILE_NOT_FOUND), GetLastError()); dwMaskCur = GetLogicalDrives(); ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); @@ -168,7 +168,7 @@ static void test_DefineDosDeviceA(void) ok(Result, "Failed to subst drive\n"); DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports unexpected error code\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Wrong last error. Expected %lu, got %lu\n", (DWORD)(ERROR_FILE_NOT_FOUND), GetLastError()); dwMaskCur = GetLogicalDrives(); ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); @@ -203,7 +203,7 @@ static void test_DefineDosDeviceA(void) ok(Result, "Failed to subst drive\n"); DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports unexpected error code\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Wrong last error. Expected %lu, got %lu\n", (DWORD)(ERROR_FILE_NOT_FOUND), GetLastError()); dwMaskCur = GetLogicalDrives(); ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); @@ -266,7 +266,7 @@ static void test_DefineDosDeviceA(void) ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); hnd = FindFirstFileA(SUBST_DRIVE_SEARCH, &Data); ok(hnd == INVALID_HANDLE_VALUE, "Opened subst drive when it should fail\n"); - ok(GetLastError() == ERROR_INVALID_NAME, "GetLastError() reports unexpected error code\n"); + ok(GetLastError() == ERROR_INVALID_NAME, "Wrong last error. Expected %lu, got %lu\n", (DWORD)(ERROR_INVALID_NAME), GetLastError()); if (hnd) FindClose(hnd); Result = DefineDosDeviceA(DDD_REMOVE_DEFINITION, SUBST_DRIVE, NULL); ok(Result, "Failed to remove subst drive using NULL Target name\n"); @@ -313,7 +313,7 @@ static void test_DefineDosDeviceA(void) ok(Result, "Failed to subst drive\n"); DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports unexpected error code\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Wrong last error. Expected %lu, got %lu\n", (DWORD)(ERROR_FILE_NOT_FOUND), GetLastError()); dwMaskCur = GetLogicalDrives(); ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); @@ -333,7 +333,7 @@ static void test_DefineDosDeviceA(void) ok(Result, "Failed to subst drive\n"); DriveType1 = GetDriveTypeA(SUBST_DRIVE_WITH_TRAILING_PATH_SEPERATOR); ok(DriveType1 != SystemDriveType, "subst drive types match when it shouldn't\n"); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "GetLastError() reports unexpected error code\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Wrong last error. Expected %lu, got %lu\n", (DWORD)(ERROR_FILE_NOT_FOUND), GetLastError()); dwMaskCur = GetLogicalDrives(); ok(dwMaskCur != dwMaskPrev, "Drive masks match when it shouldn't\n"); ok((dwMaskCur & (1 << (SUBST_DRIVE_LETTER - 'A'))), "Drive bit is not set\n"); @@ -362,7 +362,7 @@ static void test_QueryDosDeviceA(void) ok(Result, "Failed to subst drive\n"); Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, 0); ok(!Result, "Should fail as the buffer passed is supposed to be small\n"); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() reports unexpected error code\n"); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Wrong last error. Expected %lu, got %lu\n", (DWORD)(ERROR_INSUFFICIENT_BUFFER), GetLastError()); Result = QueryDosDeviceA(SUBST_DRIVE, Buffer, MAX_PATH); ok(Result, "failed to get target path\n"); ok(_strnicmp(Buffer, "\\??\\", 4) == 0, "The target returned does have correct prefix set\n"); @@ -374,7 +374,7 @@ static void test_QueryDosDeviceA(void) /* This will try to retrieve all existing MS-DOS device names */ Result = QueryDosDeviceA(NULL, Buffer, 0); ok(!Result, "Should fail as the buffer passed is supposed to be small\n"); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetLastError() reports unexpected error code\n"); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Wrong last error. Expected %lu, got %lu\n", (DWORD)(ERROR_INSUFFICIENT_BUFFER), GetLastError()); } START_TEST(dosdev) From 47ce544479cb1317538608091989026fddadeaea Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 5 Mar 2014 10:42:27 +0000 Subject: [PATCH 058/419] [WIN-ICONV] * Import a library that provides iconv implementation using Win32 API. [LIBXML2][LIBXSLT][MSXML3] * Make use of this library to support Windows-1252 encoding. * Fixes some failed msxml:domdoc tests. CORE-6697 svn path=/trunk/; revision=62423 --- reactos/dll/3rdparty/libxslt/CMakeLists.txt | 2 +- reactos/dll/win32/msxml3/CMakeLists.txt | 2 +- reactos/lib/3rdparty/CMakeLists.txt | 1 + .../lib/3rdparty/libwin-iconv/CMakeLists.txt | 8 + reactos/lib/3rdparty/libwin-iconv/ChangeLog | 161 ++ reactos/lib/3rdparty/libwin-iconv/iconv.def | 23 + reactos/lib/3rdparty/libwin-iconv/iconv.h | 14 + reactos/lib/3rdparty/libwin-iconv/mlang.def | 11 + reactos/lib/3rdparty/libwin-iconv/mlang.h | 54 + reactos/lib/3rdparty/libwin-iconv/readme.txt | 20 + reactos/lib/3rdparty/libwin-iconv/win_iconv.c | 2075 +++++++++++++++++ .../3rdparty/libwin-iconv/win_iconv_test.c | 286 +++ reactos/lib/3rdparty/libxml2/CMakeLists.txt | 6 +- reactos/media/doc/3rd Party Files.txt | 4 + 14 files changed, 2664 insertions(+), 3 deletions(-) create mode 100644 reactos/lib/3rdparty/libwin-iconv/CMakeLists.txt create mode 100644 reactos/lib/3rdparty/libwin-iconv/ChangeLog create mode 100644 reactos/lib/3rdparty/libwin-iconv/iconv.def create mode 100644 reactos/lib/3rdparty/libwin-iconv/iconv.h create mode 100644 reactos/lib/3rdparty/libwin-iconv/mlang.def create mode 100644 reactos/lib/3rdparty/libwin-iconv/mlang.h create mode 100644 reactos/lib/3rdparty/libwin-iconv/readme.txt create mode 100644 reactos/lib/3rdparty/libwin-iconv/win_iconv.c create mode 100644 reactos/lib/3rdparty/libwin-iconv/win_iconv_test.c diff --git a/reactos/dll/3rdparty/libxslt/CMakeLists.txt b/reactos/dll/3rdparty/libxslt/CMakeLists.txt index 558305f0d0c..002daabc796 100644 --- a/reactos/dll/3rdparty/libxslt/CMakeLists.txt +++ b/reactos/dll/3rdparty/libxslt/CMakeLists.txt @@ -37,7 +37,7 @@ list(APPEND SOURCE add_library(libxslt SHARED ${SOURCE}) set_module_type(libxslt win32dll) -target_link_libraries(libxslt libxml2) +target_link_libraries(libxslt libxml2 iconv-static) add_importlibs(libxslt msvcrt ws2_32 kernel32) if(MSVC) add_importlibs(libxslt ntdll) diff --git a/reactos/dll/win32/msxml3/CMakeLists.txt b/reactos/dll/win32/msxml3/CMakeLists.txt index ce3e78b31f2..8a7ee4e69ef 100644 --- a/reactos/dll/win32/msxml3/CMakeLists.txt +++ b/reactos/dll/win32/msxml3/CMakeLists.txt @@ -66,7 +66,7 @@ add_library(msxml3 SHARED add_idl_headers(xmlparser_idlheader xmlparser.idl) set_module_type(msxml3 win32dll) -target_link_libraries(msxml3 libxml2 uuid wine) +target_link_libraries(msxml3 libxml2 iconv-static uuid wine) add_importlibs(msxml3 urlmon ws2_32 shlwapi oleaut32 ole32 user32 msvcrt kernel32 ntdll) add_dependencies(msxml3 xmlparser_idlheader stdole2) # msxml3_v1.tlb needs stdole2.tlb add_pch(msxml3 precomp.h SOURCE) diff --git a/reactos/lib/3rdparty/CMakeLists.txt b/reactos/lib/3rdparty/CMakeLists.txt index 13bef592b45..0048a9fcdb0 100644 --- a/reactos/lib/3rdparty/CMakeLists.txt +++ b/reactos/lib/3rdparty/CMakeLists.txt @@ -7,6 +7,7 @@ add_subdirectory(fullfat) add_subdirectory(libmpg123) add_subdirectory(libsamplerate) add_subdirectory(libwine) +add_subdirectory(libwin-iconv) add_subdirectory(libxml2) if(MSVC) add_subdirectory(stlport) diff --git a/reactos/lib/3rdparty/libwin-iconv/CMakeLists.txt b/reactos/lib/3rdparty/libwin-iconv/CMakeLists.txt new file mode 100644 index 00000000000..b99100162df --- /dev/null +++ b/reactos/lib/3rdparty/libwin-iconv/CMakeLists.txt @@ -0,0 +1,8 @@ + +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + +add_library(iconv-static win_iconv.c) +set_target_properties(iconv-static PROPERTIES OUTPUT_NAME "iconv") +add_dependencies(iconv-static psdk) diff --git a/reactos/lib/3rdparty/libwin-iconv/ChangeLog b/reactos/lib/3rdparty/libwin-iconv/ChangeLog new file mode 100644 index 00000000000..52f23ed9dbf --- /dev/null +++ b/reactos/lib/3rdparty/libwin-iconv/ChangeLog @@ -0,0 +1,161 @@ +2014-02-05 Yukihiro Nakadaira + + * win_iconv.c: Added alias. ISO_8859-* ISO_8859_* + * win_iconv.c, win_iconv_test.c: Fixed for compiler warning. + +2013-09-15 Yukihiro Nakadaira + + * iconv.h: Fixed c++ style comment. (Issue 21) (Thanks to bgilbert) + +2012-11-22 Yukihiro Nakadaira + + * win_iconv.c: Fix warnings. + (Issue 19) (Thanks to yselkowitz) + +2012-10-21 Yukihiro Nakadaira + + * win_iconv.c, win_iconv_test.c: Add //ignore and -c flag. + +2012-10-15 Yukihiro Nakadaira + + * win_iconv.c, win_iconv_test.c: cosmetic change. + +2012-09-19 Yukihiro Nakadaira + + * iconv.h, win_iconv.c, win_iconv_test.c: Change iconv(3) prototype. + "const char **inbuf" -> "char **inbuf" + (Issue 8) + + * win_iconv.c: Change to not use TEXT macro for GetProcAddress. + (Issue 17) (Thanks to EPienkowskia) + + * win_iconv_test.c: Fix for -DUNICODE. Use GetModuleFileNameA. + +2011-10-28 Yukihiro Nakadaira + + * win_iconv.c: Add UCS-2. + (Issue 14) (Thanks to j.g.rennison) + +2011-10-24 Yukihiro Nakadaira + + * win_iconv.c: Add Big5-HKSCS alias. + (Issue 13) (Thanks to timothy.ty.lee) + +2011-09-06 Yukihiro Nakadaira + + * Makefile: Improvement of the creation of the DLL. + (Issue 10) (Thanks to vincent.torri) + +2011-08-19 Yukihiro Nakadaira + + * win_iconv.c: Fixed a bug that assumption that + sizeof(DWORD)==sizeof(void*) in find_imported_module_by_funcname. + (Issue 7) (Thanks to j.g.rennison) + +2011-08-13 Yukihiro Nakadaira + + * win_iconv.c, win_iconv_test.c: Fixed a bug that //translit + flag does not work when transliterating to the default + character. + (Issue 9) (Thanks to j.g.rennison) + +2011-07-26 Yukihiro Nakadaira + + * CMakeLists.txt: fix dll name with mingw. + (Issue 6) (Thanks to kalevlember) + + +2011-05-19 Yukihiro Nakadaira + + * win_iconv.c: Add some more UCS aliases. + Merge from Tor Lillqvist version. + (Issue 4) (Thanks to mkbosmans) + +2011-05-15 Yukihiro Nakadaira + + * Makefile: use variable for tools in Makefile + (Issue 3) (Thanks to mkbosmans) + +2011-01-13 Yukihiro Nakadaira + + * win_iconv_test.c: Removed unused variable. + + * win_iconv_test.c: Added USE_ICONV_H flag to compile with -liconv. + (Issue 2) (Thanks to amorilia.gamebox) + +2010-04-14 Patrick von Reth + + * added c++ support + +2010-03-28 Patrick Spendrin + + * CMakeLists.txt, win_iconv.c: add CMake buildsystem, fix bug from issue tracker + +2009-07-25 Yukihiro Nakadaira + + * win_iconv.c, readme.txt: doc fix + +2009-07-06 Yukihiro Nakadaira + + * win_iconv.c, Makefile, readme.txt: doc fix + +2009-06-19 Yukihiro Nakadaira + + * win_iconv.c: cosmetic change + * win_iconv.c: Change Unicode BOM behavior + 1. Remove the BOM when "fromcode" is utf-16 or utf-32. + 2. Add the BOM when "tocode" is utf-16 or utf-32. + +2009-06-18 Yukihiro Nakadaira + + * win_iconv.c: Fixed a bug that invalid input may cause an + endless loop + +2009-06-18 Yukihiro Nakadaira + + * win_iconv.c: Fixed a bug that libiconv_iconv_open() doesn't + work (Christophe Benoit) + +2008-04-01 Yukihiro Nakadaira + + * win_iconv.c: Added //TRANSLIT option. + http://bugzilla.gnome.org/show_bug.cgi?id=524314 + +2008-03-20 Yukihiro Nakadaira + + * win_iconv.c: The dwFlags parameter to MultiByteToWideChars() + must be zero for some code pages (Tor Lillqvist) + +2008-03-19 Yukihiro Nakadaira + + * win_iconv.c: Added support for UCS-2 and GB18030 (Tor Lillqvist) + +2007-12-03 Yukihiro Nakadaira + + * iconv.h: #include to use size_t + +2007-11-28 Yukihiro Nakadaira + + * win_iconv.c: bug fix for two things (Tor Lillqvist) + 1) This is probably not important: Add a function + must_use_null_useddefaultchar() that checks for those + codepages for which the docs for WideCharToMultiByte() say + one has to use a NULL lpDefaultChar pointer. Don't know if + this is actually needed, but better to be safe than sorry. + 2) This is essential: In kernel_wctomb(), the code should first + check if bufsize is zero, and return the E2BIG error in that + case. + +2007-11-26 Yukihiro Nakadaira + + * win_iconv.c: ISO-8859-1 should be CP28591, not CP1252 (Tor + Lillqvist) + +2007-11-26 Yukihiro Nakadaira + + * win_iconv.c: patch from Tor Lillqvist (with alteration) + +2007-09-04 Yukihiro Nakadaira + + * : Initial import + diff --git a/reactos/lib/3rdparty/libwin-iconv/iconv.def b/reactos/lib/3rdparty/libwin-iconv/iconv.def new file mode 100644 index 00000000000..2497daca770 --- /dev/null +++ b/reactos/lib/3rdparty/libwin-iconv/iconv.def @@ -0,0 +1,23 @@ +EXPORTS + iconv + iconv_open + iconv_close + iconvctl + libiconv=iconv + libiconv_open=iconv_open + libiconv_close=iconv_close + libiconvctl=iconvctl +;; libiconv-1.11.dll +;; TODO for binary compatibility +; _libiconv_version @1 +; aliases2_lookup @2 +; aliases_lookup @3 +; iconv_canonicalize @4 +; libiconv @5 +; libiconv_close @6 +; libiconv_open @7 +; libiconv_relocate @8 +; libiconv_set_relocation_prefix @9 +; libiconvctl @10 +; libiconvlist @11 +; locale_charset @12 diff --git a/reactos/lib/3rdparty/libwin-iconv/iconv.h b/reactos/lib/3rdparty/libwin-iconv/iconv.h new file mode 100644 index 00000000000..7b35f1848ae --- /dev/null +++ b/reactos/lib/3rdparty/libwin-iconv/iconv.h @@ -0,0 +1,14 @@ +#ifndef _LIBICONV_H +#define _LIBICONV_H +#include +#ifdef __cplusplus +extern "C" { +#endif +typedef void* iconv_t; +iconv_t iconv_open(const char *tocode, const char *fromcode); +int iconv_close(iconv_t cd); +size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +#ifdef __cplusplus +} +#endif +#endif diff --git a/reactos/lib/3rdparty/libwin-iconv/mlang.def b/reactos/lib/3rdparty/libwin-iconv/mlang.def new file mode 100644 index 00000000000..95026899acd --- /dev/null +++ b/reactos/lib/3rdparty/libwin-iconv/mlang.def @@ -0,0 +1,11 @@ +LIBRARY MLANG.DLL +EXPORTS + ConvertINetMultiByteToUnicode@24 + ;; ConvertINetReset (not documented) + ConvertINetString@28 + ConvertINetUnicodeToMultiByte@24 + IsConvertINetStringAvailable@8 + LcidToRfc1766A@12 + LcidToRfc1766W@12 + Rfc1766ToLcidA@8 + Rfc1766ToLcidW@8 diff --git a/reactos/lib/3rdparty/libwin-iconv/mlang.h b/reactos/lib/3rdparty/libwin-iconv/mlang.h new file mode 100644 index 00000000000..5cbf779c927 --- /dev/null +++ b/reactos/lib/3rdparty/libwin-iconv/mlang.h @@ -0,0 +1,54 @@ +HRESULT WINAPI ConvertINetString( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + DWORD dwDstEncoding, + LPCSTR lpSrcStr, + LPINT lpnSrcSize, + LPBYTE lpDstStr, + LPINT lpnDstSize +); + +HRESULT WINAPI ConvertINetMultiByteToUnicode( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + LPCSTR lpSrcStr, + LPINT lpnMultiCharCount, + LPWSTR lpDstStr, + LPINT lpnWideCharCount +); + +HRESULT WINAPI ConvertINetUnicodeToMultiByte( + LPDWORD lpdwMode, + DWORD dwEncoding, + LPCWSTR lpSrcStr, + LPINT lpnWideCharCount, + LPSTR lpDstStr, + LPINT lpnMultiCharCount +); + +HRESULT WINAPI IsConvertINetStringAvailable( + DWORD dwSrcEncoding, + DWORD dwDstEncoding +); + +HRESULT WINAPI LcidToRfc1766A( + LCID Locale, + LPSTR pszRfc1766, + int nChar +); + +HRESULT WINAPI LcidToRfc1766W( + LCID Locale, + LPWSTR pszRfc1766, + int nChar +); + +HRESULT WINAPI Rfc1766ToLcidA( + LCID *pLocale, + LPSTR pszRfc1766 +); + +HRESULT WINAPI Rfc1766ToLcidW( + LCID *pLocale, + LPWSTR pszRfc1766 +); diff --git a/reactos/lib/3rdparty/libwin-iconv/readme.txt b/reactos/lib/3rdparty/libwin-iconv/readme.txt new file mode 100644 index 00000000000..fc0616030ff --- /dev/null +++ b/reactos/lib/3rdparty/libwin-iconv/readme.txt @@ -0,0 +1,20 @@ +win_iconv is a iconv implementation using Win32 API to convert. + +win_iconv is placed in the public domain. + +ENVIRONMENT VARIABLE: + WINICONV_LIBICONV_DLL + If $WINICONV_LIBICONV_DLL is set, win_iconv uses the DLL. If + loading the DLL or iconv_open() failed, falls back to internal + conversion. If a few DLL are specified as comma separated list, + the first loadable DLL is used. The DLL should have + iconv_open(), iconv_close() and iconv(). Or libiconv_open(), + libiconv_close() and libiconv(). + (only available when USE_LIBICONV_DLL is defined at compile time) + +Win32 API does not support strict encoding conversion for some codepage. +And MLang function drop or replace invalid bytes and does not return +useful error status as iconv. This implementation cannot be used for +encoding validation purpose. + +Yukihiro Nakadaira diff --git a/reactos/lib/3rdparty/libwin-iconv/win_iconv.c b/reactos/lib/3rdparty/libwin-iconv/win_iconv.c new file mode 100644 index 00000000000..8069e8b2dc7 --- /dev/null +++ b/reactos/lib/3rdparty/libwin-iconv/win_iconv.c @@ -0,0 +1,2075 @@ +/* + * iconv implementation using Win32 API to convert. + * + * This file is placed in the public domain. + */ + +/* for WC_NO_BEST_FIT_CHARS */ +#ifndef WINVER +# define WINVER 0x0500 +#endif + +#define STRICT +#include +#include +#include +#include + +#ifdef __GNUC__ +#define UNUSED __attribute__((unused)) +#else +#define UNUSED +#endif + +/* WORKAROUND: */ +#ifndef UNDER_CE +#define GetProcAddressA GetProcAddress +#endif + +#if 0 +# define MAKE_EXE +# define MAKE_DLL +# define USE_LIBICONV_DLL +#endif + +#if !defined(DEFAULT_LIBICONV_DLL) +# define DEFAULT_LIBICONV_DLL "" +#endif + +#define MB_CHAR_MAX 16 + +#define UNICODE_MODE_BOM_DONE 1 +#define UNICODE_MODE_SWAPPED 2 + +#define FLAG_USE_BOM 1 +#define FLAG_TRANSLIT 2 /* //TRANSLIT */ +#define FLAG_IGNORE 4 /* //IGNORE */ + +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned int uint; + +typedef void* iconv_t; + +iconv_t iconv_open(const char *tocode, const char *fromcode); +int iconv_close(iconv_t cd); +size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); + +/* libiconv interface for vim */ +#if defined(MAKE_DLL) +int +iconvctl (iconv_t cd, int request, void* argument) +{ + /* not supported */ + return 0; +} +#endif + +typedef struct compat_t compat_t; +typedef struct csconv_t csconv_t; +typedef struct rec_iconv_t rec_iconv_t; + +typedef iconv_t (*f_iconv_open)(const char *tocode, const char *fromcode); +typedef int (*f_iconv_close)(iconv_t cd); +typedef size_t (*f_iconv)(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); +typedef int* (*f_errno)(void); +typedef int (*f_mbtowc)(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +typedef int (*f_wctomb)(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +typedef int (*f_mblen)(csconv_t *cv, const uchar *buf, int bufsize); +typedef int (*f_flush)(csconv_t *cv, uchar *buf, int bufsize); + +#define COMPAT_IN 1 +#define COMPAT_OUT 2 + +/* unicode mapping for compatibility with other conversion table. */ +struct compat_t { + uint in; + uint out; + uint flag; +}; + +struct csconv_t { + int codepage; + int flags; + f_mbtowc mbtowc; + f_wctomb wctomb; + f_mblen mblen; + f_flush flush; + DWORD mode; + compat_t *compat; +}; + +struct rec_iconv_t { + iconv_t cd; + f_iconv_close iconv_close; + f_iconv iconv; + f_errno _errno; + csconv_t from; + csconv_t to; +#if defined(USE_LIBICONV_DLL) + HMODULE hlibiconv; +#endif +}; + +static int win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); +static int win_iconv_close(iconv_t cd); +static size_t win_iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); + +static int load_mlang(void); +static int make_csconv(const char *name, csconv_t *cv); +static int name_to_codepage(const char *name); +static uint utf16_to_ucs4(const ushort *wbuf); +static void ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize); +static int mbtowc_flags(int codepage); +static int must_use_null_useddefaultchar(int codepage); +static char *strrstr(const char *str, const char *token); +static char *xstrndup(const char *s, size_t n); +static int seterror(int err); + +#if defined(USE_LIBICONV_DLL) +static int libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode); +static PVOID MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size); +static HMODULE find_imported_module_by_funcname(HMODULE hModule, const char *funcname); + +static HMODULE hwiniconv; +#endif + +static int sbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int utf8_mblen(csconv_t *cv, const uchar *buf, int bufsize); +static int eucjp_mblen(csconv_t *cv, const uchar *buf, int bufsize); + +static int kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize); +static int iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize); +static int iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize); + +static struct { + int codepage; + const char *name; +} codepage_alias[] = { + {65001, "CP65001"}, + {65001, "UTF8"}, + {65001, "UTF-8"}, + + {1200, "CP1200"}, + {1200, "UTF16LE"}, + {1200, "UTF-16LE"}, + {1200, "UCS2LE"}, + {1200, "UCS-2LE"}, + + {1201, "CP1201"}, + {1201, "UTF16BE"}, + {1201, "UTF-16BE"}, + {1201, "UCS2BE"}, + {1201, "UCS-2BE"}, + {1201, "unicodeFFFE"}, + + {12000, "CP12000"}, + {12000, "UTF32LE"}, + {12000, "UTF-32LE"}, + {12000, "UCS4LE"}, + {12000, "UCS-4LE"}, + + {12001, "CP12001"}, + {12001, "UTF32BE"}, + {12001, "UTF-32BE"}, + {12001, "UCS4BE"}, + {12001, "UCS-4BE"}, + +#ifndef GLIB_COMPILATION + /* + * Default is big endian. + * See rfc2781 4.3 Interpreting text labelled as UTF-16. + */ + {1201, "UTF16"}, + {1201, "UTF-16"}, + {1201, "UCS2"}, + {1201, "UCS-2"}, + {12001, "UTF32"}, + {12001, "UTF-32"}, + {12001, "UCS-4"}, + {12001, "UCS4"}, +#else + /* Default is little endian, because the platform is */ + {1200, "UTF16"}, + {1200, "UTF-16"}, + {1200, "UCS2"}, + {1200, "UCS-2"}, + {12000, "UTF32"}, + {12000, "UTF-32"}, + {12000, "UCS4"}, + {12000, "UCS-4"}, +#endif + + /* copy from libiconv `iconv -l` */ + /* !IsValidCodePage(367) */ + {20127, "ANSI_X3.4-1968"}, + {20127, "ANSI_X3.4-1986"}, + {20127, "ASCII"}, + {20127, "CP367"}, + {20127, "IBM367"}, + {20127, "ISO-IR-6"}, + {20127, "ISO646-US"}, + {20127, "ISO_646.IRV:1991"}, + {20127, "US"}, + {20127, "US-ASCII"}, + {20127, "CSASCII"}, + + /* !IsValidCodePage(819) */ + {1252, "CP819"}, + {1252, "IBM819"}, + {28591, "ISO-8859-1"}, + {28591, "ISO-IR-100"}, + {28591, "ISO8859-1"}, + {28591, "ISO_8859-1"}, + {28591, "ISO_8859-1:1987"}, + {28591, "L1"}, + {28591, "LATIN1"}, + {28591, "CSISOLATIN1"}, + + {1250, "CP1250"}, + {1250, "MS-EE"}, + {1250, "WINDOWS-1250"}, + + {1251, "CP1251"}, + {1251, "MS-CYRL"}, + {1251, "WINDOWS-1251"}, + + {1252, "CP1252"}, + {1252, "MS-ANSI"}, + {1252, "WINDOWS-1252"}, + + {1253, "CP1253"}, + {1253, "MS-GREEK"}, + {1253, "WINDOWS-1253"}, + + {1254, "CP1254"}, + {1254, "MS-TURK"}, + {1254, "WINDOWS-1254"}, + + {1255, "CP1255"}, + {1255, "MS-HEBR"}, + {1255, "WINDOWS-1255"}, + + {1256, "CP1256"}, + {1256, "MS-ARAB"}, + {1256, "WINDOWS-1256"}, + + {1257, "CP1257"}, + {1257, "WINBALTRIM"}, + {1257, "WINDOWS-1257"}, + + {1258, "CP1258"}, + {1258, "WINDOWS-1258"}, + + {850, "850"}, + {850, "CP850"}, + {850, "IBM850"}, + {850, "CSPC850MULTILINGUAL"}, + + /* !IsValidCodePage(862) */ + {862, "862"}, + {862, "CP862"}, + {862, "IBM862"}, + {862, "CSPC862LATINHEBREW"}, + + {866, "866"}, + {866, "CP866"}, + {866, "IBM866"}, + {866, "CSIBM866"}, + + /* !IsValidCodePage(154) */ + {154, "CP154"}, + {154, "CYRILLIC-ASIAN"}, + {154, "PT154"}, + {154, "PTCP154"}, + {154, "CSPTCP154"}, + + /* !IsValidCodePage(1133) */ + {1133, "CP1133"}, + {1133, "IBM-CP1133"}, + + {874, "CP874"}, + {874, "WINDOWS-874"}, + + /* !IsValidCodePage(51932) */ + {51932, "CP51932"}, + {51932, "MS51932"}, + {51932, "WINDOWS-51932"}, + {51932, "EUC-JP"}, + + {932, "CP932"}, + {932, "MS932"}, + {932, "SHIFFT_JIS"}, + {932, "SHIFFT_JIS-MS"}, + {932, "SJIS"}, + {932, "SJIS-MS"}, + {932, "SJIS-OPEN"}, + {932, "SJIS-WIN"}, + {932, "WINDOWS-31J"}, + {932, "WINDOWS-932"}, + {932, "CSWINDOWS31J"}, + + {50221, "CP50221"}, + {50221, "ISO-2022-JP"}, + {50221, "ISO-2022-JP-MS"}, + {50221, "ISO2022-JP"}, + {50221, "ISO2022-JP-MS"}, + {50221, "MS50221"}, + {50221, "WINDOWS-50221"}, + + {936, "CP936"}, + {936, "GBK"}, + {936, "MS936"}, + {936, "WINDOWS-936"}, + + {950, "CP950"}, + {950, "BIG5"}, + {950, "BIG5HKSCS"}, + {950, "BIG5-HKSCS"}, + + {949, "CP949"}, + {949, "UHC"}, + {949, "EUC-KR"}, + + {1361, "CP1361"}, + {1361, "JOHAB"}, + + {437, "437"}, + {437, "CP437"}, + {437, "IBM437"}, + {437, "CSPC8CODEPAGE437"}, + + {737, "CP737"}, + + {775, "CP775"}, + {775, "IBM775"}, + {775, "CSPC775BALTIC"}, + + {852, "852"}, + {852, "CP852"}, + {852, "IBM852"}, + {852, "CSPCP852"}, + + /* !IsValidCodePage(853) */ + {853, "CP853"}, + + {855, "855"}, + {855, "CP855"}, + {855, "IBM855"}, + {855, "CSIBM855"}, + + {857, "857"}, + {857, "CP857"}, + {857, "IBM857"}, + {857, "CSIBM857"}, + + /* !IsValidCodePage(858) */ + {858, "CP858"}, + + {860, "860"}, + {860, "CP860"}, + {860, "IBM860"}, + {860, "CSIBM860"}, + + {861, "861"}, + {861, "CP-IS"}, + {861, "CP861"}, + {861, "IBM861"}, + {861, "CSIBM861"}, + + {863, "863"}, + {863, "CP863"}, + {863, "IBM863"}, + {863, "CSIBM863"}, + + {864, "CP864"}, + {864, "IBM864"}, + {864, "CSIBM864"}, + + {865, "865"}, + {865, "CP865"}, + {865, "IBM865"}, + {865, "CSIBM865"}, + + {869, "869"}, + {869, "CP-GR"}, + {869, "CP869"}, + {869, "IBM869"}, + {869, "CSIBM869"}, + + /* !IsValidCodePage(1152) */ + {1125, "CP1125"}, + + /* + * Code Page Identifiers + * http://msdn2.microsoft.com/en-us/library/ms776446.aspx + */ + {37, "IBM037"}, /* IBM EBCDIC US-Canada */ + {437, "IBM437"}, /* OEM United States */ + {500, "IBM500"}, /* IBM EBCDIC International */ + {708, "ASMO-708"}, /* Arabic (ASMO 708) */ + /* 709 Arabic (ASMO-449+, BCON V4) */ + /* 710 Arabic - Transparent Arabic */ + {720, "DOS-720"}, /* Arabic (Transparent ASMO); Arabic (DOS) */ + {737, "ibm737"}, /* OEM Greek (formerly 437G); Greek (DOS) */ + {775, "ibm775"}, /* OEM Baltic; Baltic (DOS) */ + {850, "ibm850"}, /* OEM Multilingual Latin 1; Western European (DOS) */ + {852, "ibm852"}, /* OEM Latin 2; Central European (DOS) */ + {855, "IBM855"}, /* OEM Cyrillic (primarily Russian) */ + {857, "ibm857"}, /* OEM Turkish; Turkish (DOS) */ + {858, "IBM00858"}, /* OEM Multilingual Latin 1 + Euro symbol */ + {860, "IBM860"}, /* OEM Portuguese; Portuguese (DOS) */ + {861, "ibm861"}, /* OEM Icelandic; Icelandic (DOS) */ + {862, "DOS-862"}, /* OEM Hebrew; Hebrew (DOS) */ + {863, "IBM863"}, /* OEM French Canadian; French Canadian (DOS) */ + {864, "IBM864"}, /* OEM Arabic; Arabic (864) */ + {865, "IBM865"}, /* OEM Nordic; Nordic (DOS) */ + {866, "cp866"}, /* OEM Russian; Cyrillic (DOS) */ + {869, "ibm869"}, /* OEM Modern Greek; Greek, Modern (DOS) */ + {870, "IBM870"}, /* IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2 */ + {874, "windows-874"}, /* ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows) */ + {875, "cp875"}, /* IBM EBCDIC Greek Modern */ + {932, "shift_jis"}, /* ANSI/OEM Japanese; Japanese (Shift-JIS) */ + {932, "shift-jis"}, /* alternative name for it */ + {936, "gb2312"}, /* ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312) */ + {949, "ks_c_5601-1987"}, /* ANSI/OEM Korean (Unified Hangul Code) */ + {950, "big5"}, /* ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5) */ + {950, "big5hkscs"}, /* ANSI/OEM Traditional Chinese (Hong Kong SAR); Chinese Traditional (Big5-HKSCS) */ + {950, "big5-hkscs"}, /* alternative name for it */ + {1026, "IBM1026"}, /* IBM EBCDIC Turkish (Latin 5) */ + {1047, "IBM01047"}, /* IBM EBCDIC Latin 1/Open System */ + {1140, "IBM01140"}, /* IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro) */ + {1141, "IBM01141"}, /* IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro) */ + {1142, "IBM01142"}, /* IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro) */ + {1143, "IBM01143"}, /* IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro) */ + {1144, "IBM01144"}, /* IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro) */ + {1145, "IBM01145"}, /* IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro) */ + {1146, "IBM01146"}, /* IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro) */ + {1147, "IBM01147"}, /* IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro) */ + {1148, "IBM01148"}, /* IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro) */ + {1149, "IBM01149"}, /* IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro) */ + {1250, "windows-1250"}, /* ANSI Central European; Central European (Windows) */ + {1251, "windows-1251"}, /* ANSI Cyrillic; Cyrillic (Windows) */ + {1252, "windows-1252"}, /* ANSI Latin 1; Western European (Windows) */ + {1253, "windows-1253"}, /* ANSI Greek; Greek (Windows) */ + {1254, "windows-1254"}, /* ANSI Turkish; Turkish (Windows) */ + {1255, "windows-1255"}, /* ANSI Hebrew; Hebrew (Windows) */ + {1256, "windows-1256"}, /* ANSI Arabic; Arabic (Windows) */ + {1257, "windows-1257"}, /* ANSI Baltic; Baltic (Windows) */ + {1258, "windows-1258"}, /* ANSI/OEM Vietnamese; Vietnamese (Windows) */ + {1361, "Johab"}, /* Korean (Johab) */ + {10000, "macintosh"}, /* MAC Roman; Western European (Mac) */ + {10001, "x-mac-japanese"}, /* Japanese (Mac) */ + {10002, "x-mac-chinesetrad"}, /* MAC Traditional Chinese (Big5); Chinese Traditional (Mac) */ + {10003, "x-mac-korean"}, /* Korean (Mac) */ + {10004, "x-mac-arabic"}, /* Arabic (Mac) */ + {10005, "x-mac-hebrew"}, /* Hebrew (Mac) */ + {10006, "x-mac-greek"}, /* Greek (Mac) */ + {10007, "x-mac-cyrillic"}, /* Cyrillic (Mac) */ + {10008, "x-mac-chinesesimp"}, /* MAC Simplified Chinese (GB 2312); Chinese Simplified (Mac) */ + {10010, "x-mac-romanian"}, /* Romanian (Mac) */ + {10017, "x-mac-ukrainian"}, /* Ukrainian (Mac) */ + {10021, "x-mac-thai"}, /* Thai (Mac) */ + {10029, "x-mac-ce"}, /* MAC Latin 2; Central European (Mac) */ + {10079, "x-mac-icelandic"}, /* Icelandic (Mac) */ + {10081, "x-mac-turkish"}, /* Turkish (Mac) */ + {10082, "x-mac-croatian"}, /* Croatian (Mac) */ + {20000, "x-Chinese_CNS"}, /* CNS Taiwan; Chinese Traditional (CNS) */ + {20001, "x-cp20001"}, /* TCA Taiwan */ + {20002, "x_Chinese-Eten"}, /* Eten Taiwan; Chinese Traditional (Eten) */ + {20003, "x-cp20003"}, /* IBM5550 Taiwan */ + {20004, "x-cp20004"}, /* TeleText Taiwan */ + {20005, "x-cp20005"}, /* Wang Taiwan */ + {20105, "x-IA5"}, /* IA5 (IRV International Alphabet No. 5, 7-bit); Western European (IA5) */ + {20106, "x-IA5-German"}, /* IA5 German (7-bit) */ + {20107, "x-IA5-Swedish"}, /* IA5 Swedish (7-bit) */ + {20108, "x-IA5-Norwegian"}, /* IA5 Norwegian (7-bit) */ + {20127, "us-ascii"}, /* US-ASCII (7-bit) */ + {20261, "x-cp20261"}, /* T.61 */ + {20269, "x-cp20269"}, /* ISO 6937 Non-Spacing Accent */ + {20273, "IBM273"}, /* IBM EBCDIC Germany */ + {20277, "IBM277"}, /* IBM EBCDIC Denmark-Norway */ + {20278, "IBM278"}, /* IBM EBCDIC Finland-Sweden */ + {20280, "IBM280"}, /* IBM EBCDIC Italy */ + {20284, "IBM284"}, /* IBM EBCDIC Latin America-Spain */ + {20285, "IBM285"}, /* IBM EBCDIC United Kingdom */ + {20290, "IBM290"}, /* IBM EBCDIC Japanese Katakana Extended */ + {20297, "IBM297"}, /* IBM EBCDIC France */ + {20420, "IBM420"}, /* IBM EBCDIC Arabic */ + {20423, "IBM423"}, /* IBM EBCDIC Greek */ + {20424, "IBM424"}, /* IBM EBCDIC Hebrew */ + {20833, "x-EBCDIC-KoreanExtended"}, /* IBM EBCDIC Korean Extended */ + {20838, "IBM-Thai"}, /* IBM EBCDIC Thai */ + {20866, "koi8-r"}, /* Russian (KOI8-R); Cyrillic (KOI8-R) */ + {20871, "IBM871"}, /* IBM EBCDIC Icelandic */ + {20880, "IBM880"}, /* IBM EBCDIC Cyrillic Russian */ + {20905, "IBM905"}, /* IBM EBCDIC Turkish */ + {20924, "IBM00924"}, /* IBM EBCDIC Latin 1/Open System (1047 + Euro symbol) */ + {20932, "EUC-JP"}, /* Japanese (JIS 0208-1990 and 0121-1990) */ + {20936, "x-cp20936"}, /* Simplified Chinese (GB2312); Chinese Simplified (GB2312-80) */ + {20949, "x-cp20949"}, /* Korean Wansung */ + {21025, "cp1025"}, /* IBM EBCDIC Cyrillic Serbian-Bulgarian */ + /* 21027 (deprecated) */ + {21866, "koi8-u"}, /* Ukrainian (KOI8-U); Cyrillic (KOI8-U) */ + {28591, "iso-8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ + {28591, "iso8859-1"}, /* ISO 8859-1 Latin 1; Western European (ISO) */ + {28591, "iso_8859-1"}, + {28591, "iso_8859_1"}, + {28592, "iso-8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ + {28592, "iso8859-2"}, /* ISO 8859-2 Central European; Central European (ISO) */ + {28592, "iso_8859-2"}, + {28592, "iso_8859_2"}, + {28593, "iso-8859-3"}, /* ISO 8859-3 Latin 3 */ + {28593, "iso8859-3"}, /* ISO 8859-3 Latin 3 */ + {28593, "iso_8859-3"}, + {28593, "iso_8859_3"}, + {28594, "iso-8859-4"}, /* ISO 8859-4 Baltic */ + {28594, "iso8859-4"}, /* ISO 8859-4 Baltic */ + {28594, "iso_8859-4"}, + {28594, "iso_8859_4"}, + {28595, "iso-8859-5"}, /* ISO 8859-5 Cyrillic */ + {28595, "iso8859-5"}, /* ISO 8859-5 Cyrillic */ + {28595, "iso_8859-5"}, + {28595, "iso_8859_5"}, + {28596, "iso-8859-6"}, /* ISO 8859-6 Arabic */ + {28596, "iso8859-6"}, /* ISO 8859-6 Arabic */ + {28596, "iso_8859-6"}, + {28596, "iso_8859_6"}, + {28597, "iso-8859-7"}, /* ISO 8859-7 Greek */ + {28597, "iso8859-7"}, /* ISO 8859-7 Greek */ + {28597, "iso_8859-7"}, + {28597, "iso_8859_7"}, + {28598, "iso-8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ + {28598, "iso8859-8"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Visual) */ + {28598, "iso_8859-8"}, + {28598, "iso_8859_8"}, + {28599, "iso-8859-9"}, /* ISO 8859-9 Turkish */ + {28599, "iso8859-9"}, /* ISO 8859-9 Turkish */ + {28599, "iso_8859-9"}, + {28599, "iso_8859_9"}, + {28603, "iso-8859-13"}, /* ISO 8859-13 Estonian */ + {28603, "iso8859-13"}, /* ISO 8859-13 Estonian */ + {28603, "iso_8859-13"}, + {28603, "iso_8859_13"}, + {28605, "iso-8859-15"}, /* ISO 8859-15 Latin 9 */ + {28605, "iso8859-15"}, /* ISO 8859-15 Latin 9 */ + {28605, "iso_8859-15"}, + {28605, "iso_8859_15"}, + {29001, "x-Europa"}, /* Europa 3 */ + {38598, "iso-8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ + {38598, "iso8859-8-i"}, /* ISO 8859-8 Hebrew; Hebrew (ISO-Logical) */ + {38598, "iso_8859-8-i"}, + {38598, "iso_8859_8-i"}, + {50220, "iso-2022-jp"}, /* ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) */ + {50221, "csISO2022JP"}, /* ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana) */ + {50222, "iso-2022-jp"}, /* ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI) */ + {50225, "iso-2022-kr"}, /* ISO 2022 Korean */ + {50225, "iso2022-kr"}, /* ISO 2022 Korean */ + {50227, "x-cp50227"}, /* ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022) */ + /* 50229 ISO 2022 Traditional Chinese */ + /* 50930 EBCDIC Japanese (Katakana) Extended */ + /* 50931 EBCDIC US-Canada and Japanese */ + /* 50933 EBCDIC Korean Extended and Korean */ + /* 50935 EBCDIC Simplified Chinese Extended and Simplified Chinese */ + /* 50936 EBCDIC Simplified Chinese */ + /* 50937 EBCDIC US-Canada and Traditional Chinese */ + /* 50939 EBCDIC Japanese (Latin) Extended and Japanese */ + {51932, "euc-jp"}, /* EUC Japanese */ + {51936, "EUC-CN"}, /* EUC Simplified Chinese; Chinese Simplified (EUC) */ + {51949, "euc-kr"}, /* EUC Korean */ + /* 51950 EUC Traditional Chinese */ + {52936, "hz-gb-2312"}, /* HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ) */ + {54936, "GB18030"}, /* Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030) */ + {57002, "x-iscii-de"}, /* ISCII Devanagari */ + {57003, "x-iscii-be"}, /* ISCII Bengali */ + {57004, "x-iscii-ta"}, /* ISCII Tamil */ + {57005, "x-iscii-te"}, /* ISCII Telugu */ + {57006, "x-iscii-as"}, /* ISCII Assamese */ + {57007, "x-iscii-or"}, /* ISCII Oriya */ + {57008, "x-iscii-ka"}, /* ISCII Kannada */ + {57009, "x-iscii-ma"}, /* ISCII Malayalam */ + {57010, "x-iscii-gu"}, /* ISCII Gujarati */ + {57011, "x-iscii-pa"}, /* ISCII Punjabi */ + + {0, NULL} +}; + +/* + * SJIS SHIFTJIS table CP932 table + * ---- --------------------------- -------------------------------- + * 5C U+00A5 YEN SIGN U+005C REVERSE SOLIDUS + * 7E U+203E OVERLINE U+007E TILDE + * 815C U+2014 EM DASH U+2015 HORIZONTAL BAR + * 815F U+005C REVERSE SOLIDUS U+FF3C FULLWIDTH REVERSE SOLIDUS + * 8160 U+301C WAVE DASH U+FF5E FULLWIDTH TILDE + * 8161 U+2016 DOUBLE VERTICAL LINE U+2225 PARALLEL TO + * 817C U+2212 MINUS SIGN U+FF0D FULLWIDTH HYPHEN-MINUS + * 8191 U+00A2 CENT SIGN U+FFE0 FULLWIDTH CENT SIGN + * 8192 U+00A3 POUND SIGN U+FFE1 FULLWIDTH POUND SIGN + * 81CA U+00AC NOT SIGN U+FFE2 FULLWIDTH NOT SIGN + * + * EUC-JP and ISO-2022-JP should be compatible with CP932. + * + * Kernel and MLang have different Unicode mapping table. Make sure + * which API is used. + */ +static compat_t cp932_compat[] = { + {0x00A5, 0x005C, COMPAT_OUT}, + {0x203E, 0x007E, COMPAT_OUT}, + {0x2014, 0x2015, COMPAT_OUT}, + {0x301C, 0xFF5E, COMPAT_OUT}, + {0x2016, 0x2225, COMPAT_OUT}, + {0x2212, 0xFF0D, COMPAT_OUT}, + {0x00A2, 0xFFE0, COMPAT_OUT}, + {0x00A3, 0xFFE1, COMPAT_OUT}, + {0x00AC, 0xFFE2, COMPAT_OUT}, + {0, 0, 0} +}; + +static compat_t cp20932_compat[] = { + {0x00A5, 0x005C, COMPAT_OUT}, + {0x203E, 0x007E, COMPAT_OUT}, + {0x2014, 0x2015, COMPAT_OUT}, + {0xFF5E, 0x301C, COMPAT_OUT|COMPAT_IN}, + {0x2225, 0x2016, COMPAT_OUT|COMPAT_IN}, + {0xFF0D, 0x2212, COMPAT_OUT|COMPAT_IN}, + {0xFFE0, 0x00A2, COMPAT_OUT|COMPAT_IN}, + {0xFFE1, 0x00A3, COMPAT_OUT|COMPAT_IN}, + {0xFFE2, 0x00AC, COMPAT_OUT|COMPAT_IN}, + {0, 0, 0} +}; + +static compat_t *cp51932_compat = cp932_compat; + +/* cp20932_compat for kernel. cp932_compat for mlang. */ +static compat_t *cp5022x_compat = cp932_compat; + +typedef HRESULT (WINAPI *CONVERTINETSTRING)( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + DWORD dwDstEncoding, + LPCSTR lpSrcStr, + LPINT lpnSrcSize, + LPBYTE lpDstStr, + LPINT lpnDstSize +); +typedef HRESULT (WINAPI *CONVERTINETMULTIBYTETOUNICODE)( + LPDWORD lpdwMode, + DWORD dwSrcEncoding, + LPCSTR lpSrcStr, + LPINT lpnMultiCharCount, + LPWSTR lpDstStr, + LPINT lpnWideCharCount +); +typedef HRESULT (WINAPI *CONVERTINETUNICODETOMULTIBYTE)( + LPDWORD lpdwMode, + DWORD dwEncoding, + LPCWSTR lpSrcStr, + LPINT lpnWideCharCount, + LPSTR lpDstStr, + LPINT lpnMultiCharCount +); +typedef HRESULT (WINAPI *ISCONVERTINETSTRINGAVAILABLE)( + DWORD dwSrcEncoding, + DWORD dwDstEncoding +); +typedef HRESULT (WINAPI *LCIDTORFC1766A)( + LCID Locale, + LPSTR pszRfc1766, + int nChar +); +typedef HRESULT (WINAPI *LCIDTORFC1766W)( + LCID Locale, + LPWSTR pszRfc1766, + int nChar +); +typedef HRESULT (WINAPI *RFC1766TOLCIDA)( + LCID *pLocale, + LPSTR pszRfc1766 +); +typedef HRESULT (WINAPI *RFC1766TOLCIDW)( + LCID *pLocale, + LPWSTR pszRfc1766 +); +static CONVERTINETSTRING ConvertINetString; +static CONVERTINETMULTIBYTETOUNICODE ConvertINetMultiByteToUnicode; +static CONVERTINETUNICODETOMULTIBYTE ConvertINetUnicodeToMultiByte; +static ISCONVERTINETSTRINGAVAILABLE IsConvertINetStringAvailable; +static LCIDTORFC1766A LcidToRfc1766A; +static RFC1766TOLCIDA Rfc1766ToLcidA; + +static int +load_mlang(void) +{ + HMODULE h; + if (ConvertINetString != NULL) + return TRUE; + h = LoadLibrary(TEXT("mlang.dll")); + if (!h) + return FALSE; + ConvertINetString = (CONVERTINETSTRING)GetProcAddressA(h, "ConvertINetString"); + ConvertINetMultiByteToUnicode = (CONVERTINETMULTIBYTETOUNICODE)GetProcAddressA(h, "ConvertINetMultiByteToUnicode"); + ConvertINetUnicodeToMultiByte = (CONVERTINETUNICODETOMULTIBYTE)GetProcAddressA(h, "ConvertINetUnicodeToMultiByte"); + IsConvertINetStringAvailable = (ISCONVERTINETSTRINGAVAILABLE)GetProcAddressA(h, "IsConvertINetStringAvailable"); + LcidToRfc1766A = (LCIDTORFC1766A)GetProcAddressA(h, "LcidToRfc1766A"); + Rfc1766ToLcidA = (RFC1766TOLCIDA)GetProcAddressA(h, "Rfc1766ToLcidA"); + return TRUE; +} + +iconv_t +iconv_open(const char *tocode, const char *fromcode) +{ + rec_iconv_t *cd; + + cd = (rec_iconv_t *)calloc(1, sizeof(rec_iconv_t)); + if (cd == NULL) + return (iconv_t)(-1); + +#if defined(USE_LIBICONV_DLL) + errno = 0; + if (libiconv_iconv_open(cd, tocode, fromcode)) + return (iconv_t)cd; +#endif + + /* reset the errno to prevent reporting wrong error code. + * 0 for unsorted error. */ + errno = 0; + if (win_iconv_open(cd, tocode, fromcode)) + return (iconv_t)cd; + + free(cd); + + return (iconv_t)(-1); +} + +int +iconv_close(iconv_t _cd) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + int r = cd->iconv_close(cd->cd); + int e = *(cd->_errno()); +#if defined(USE_LIBICONV_DLL) + if (cd->hlibiconv != NULL) + FreeLibrary(cd->hlibiconv); +#endif + free(cd); + errno = e; + return r; +} + +size_t +iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + size_t r = cd->iconv(cd->cd, inbuf, inbytesleft, outbuf, outbytesleft); + errno = *(cd->_errno()); + return r; +} + +static int +win_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) +{ + if (!make_csconv(fromcode, &cd->from) || !make_csconv(tocode, &cd->to)) + return FALSE; + cd->iconv_close = win_iconv_close; + cd->iconv = win_iconv; + cd->_errno = _errno; + cd->cd = (iconv_t)cd; + return TRUE; +} + +static int +win_iconv_close(iconv_t cd UNUSED) +{ + return 0; +} + +static size_t +win_iconv(iconv_t _cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft) +{ + rec_iconv_t *cd = (rec_iconv_t *)_cd; + ushort wbuf[MB_CHAR_MAX]; /* enough room for one character */ + int insize; + int outsize; + int wsize; + DWORD frommode; + DWORD tomode; + uint wc; + compat_t *cp; + int i; + + if (inbuf == NULL || *inbuf == NULL) + { + if (outbuf != NULL && *outbuf != NULL && cd->to.flush != NULL) + { + tomode = cd->to.mode; + outsize = cd->to.flush(&cd->to, (uchar *)*outbuf, *outbytesleft); + if (outsize == -1) + { + if ((cd->to.flags & FLAG_IGNORE) && errno != E2BIG) + { + outsize = 0; + } + else + { + cd->to.mode = tomode; + return (size_t)(-1); + } + } + *outbuf += outsize; + *outbytesleft -= outsize; + } + cd->from.mode = 0; + cd->to.mode = 0; + return 0; + } + + while (*inbytesleft != 0) + { + frommode = cd->from.mode; + tomode = cd->to.mode; + wsize = MB_CHAR_MAX; + + insize = cd->from.mbtowc(&cd->from, (const uchar *)*inbuf, *inbytesleft, wbuf, &wsize); + if (insize == -1) + { + if (cd->to.flags & FLAG_IGNORE) + { + cd->from.mode = frommode; + insize = 1; + wsize = 0; + } + else + { + cd->from.mode = frommode; + return (size_t)(-1); + } + } + + if (wsize == 0) + { + *inbuf += insize; + *inbytesleft -= insize; + continue; + } + + if (cd->from.compat != NULL) + { + wc = utf16_to_ucs4(wbuf); + cp = cd->from.compat; + for (i = 0; cp[i].in != 0; ++i) + { + if ((cp[i].flag & COMPAT_IN) && cp[i].out == wc) + { + ucs4_to_utf16(cp[i].in, wbuf, &wsize); + break; + } + } + } + + if (cd->to.compat != NULL) + { + wc = utf16_to_ucs4(wbuf); + cp = cd->to.compat; + for (i = 0; cp[i].in != 0; ++i) + { + if ((cp[i].flag & COMPAT_OUT) && cp[i].in == wc) + { + ucs4_to_utf16(cp[i].out, wbuf, &wsize); + break; + } + } + } + + outsize = cd->to.wctomb(&cd->to, wbuf, wsize, (uchar *)*outbuf, *outbytesleft); + if (outsize == -1) + { + if ((cd->to.flags & FLAG_IGNORE) && errno != E2BIG) + { + cd->to.mode = tomode; + outsize = 0; + } + else + { + cd->from.mode = frommode; + cd->to.mode = tomode; + return (size_t)(-1); + } + } + + *inbuf += insize; + *outbuf += outsize; + *inbytesleft -= insize; + *outbytesleft -= outsize; + } + + return 0; +} + +static int +make_csconv(const char *_name, csconv_t *cv) +{ + CPINFO cpinfo; + int use_compat = TRUE; + int flag = 0; + char *name; + char *p; + + name = xstrndup(_name, strlen(_name)); + if (name == NULL) + return FALSE; + + /* check for option "enc_name//opt1//opt2" */ + while ((p = strrstr(name, "//")) != NULL) + { + if (_stricmp(p + 2, "nocompat") == 0) + use_compat = FALSE; + else if (_stricmp(p + 2, "translit") == 0) + flag |= FLAG_TRANSLIT; + else if (_stricmp(p + 2, "ignore") == 0) + flag |= FLAG_IGNORE; + *p = 0; + } + + cv->mode = 0; + cv->flags = flag; + cv->mblen = NULL; + cv->flush = NULL; + cv->compat = NULL; + cv->codepage = name_to_codepage(name); + if (cv->codepage == 1200 || cv->codepage == 1201) + { + cv->mbtowc = utf16_mbtowc; + cv->wctomb = utf16_wctomb; + if (_stricmp(name, "UTF-16") == 0 || _stricmp(name, "UTF16") == 0 || + _stricmp(name, "UCS-2") == 0 || _stricmp(name, "UCS2") == 0) + cv->flags |= FLAG_USE_BOM; + } + else if (cv->codepage == 12000 || cv->codepage == 12001) + { + cv->mbtowc = utf32_mbtowc; + cv->wctomb = utf32_wctomb; + if (_stricmp(name, "UTF-32") == 0 || _stricmp(name, "UTF32") == 0 || + _stricmp(name, "UCS-4") == 0 || _stricmp(name, "UCS4") == 0) + cv->flags |= FLAG_USE_BOM; + } + else if (cv->codepage == 65001) + { + cv->mbtowc = kernel_mbtowc; + cv->wctomb = kernel_wctomb; + cv->mblen = utf8_mblen; + } + else if ((cv->codepage == 50220 || cv->codepage == 50221 || cv->codepage == 50222) && load_mlang()) + { + cv->mbtowc = iso2022jp_mbtowc; + cv->wctomb = iso2022jp_wctomb; + cv->flush = iso2022jp_flush; + } + else if (cv->codepage == 51932 && load_mlang()) + { + cv->mbtowc = mlang_mbtowc; + cv->wctomb = mlang_wctomb; + cv->mblen = eucjp_mblen; + } + else if (IsValidCodePage(cv->codepage) + && GetCPInfo(cv->codepage, &cpinfo) != 0) + { + cv->mbtowc = kernel_mbtowc; + cv->wctomb = kernel_wctomb; + if (cpinfo.MaxCharSize == 1) + cv->mblen = sbcs_mblen; + else if (cpinfo.MaxCharSize == 2) + cv->mblen = dbcs_mblen; + else + cv->mblen = mbcs_mblen; + } + else + { + /* not supported */ + free(name); + errno = EINVAL; + return FALSE; + } + + if (use_compat) + { + switch (cv->codepage) + { + case 932: cv->compat = cp932_compat; break; + case 20932: cv->compat = cp20932_compat; break; + case 51932: cv->compat = cp51932_compat; break; + case 50220: case 50221: case 50222: cv->compat = cp5022x_compat; break; + } + } + + free(name); + + return TRUE; +} + +static int +name_to_codepage(const char *name) +{ + int i; + + if (*name == '\0' || + strcmp(name, "char") == 0) + return GetACP(); + else if (strcmp(name, "wchar_t") == 0) + return 1200; + else if (_strnicmp(name, "cp", 2) == 0) + return atoi(name + 2); /* CP123 */ + else if ('0' <= name[0] && name[0] <= '9') + return atoi(name); /* 123 */ + else if (_strnicmp(name, "xx", 2) == 0) + return atoi(name + 2); /* XX123 for debug */ + + for (i = 0; codepage_alias[i].name != NULL; ++i) + if (_stricmp(name, codepage_alias[i].name) == 0) + return codepage_alias[i].codepage; + return -1; +} + +/* + * http://www.faqs.org/rfcs/rfc2781.html + */ +static uint +utf16_to_ucs4(const ushort *wbuf) +{ + uint wc = wbuf[0]; + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + wc = ((wbuf[0] & 0x3FF) << 10) + (wbuf[1] & 0x3FF) + 0x10000; + return wc; +} + +static void +ucs4_to_utf16(uint wc, ushort *wbuf, int *wbufsize) +{ + if (wc < 0x10000) + { + wbuf[0] = wc; + *wbufsize = 1; + } + else + { + wc -= 0x10000; + wbuf[0] = 0xD800 | ((wc >> 10) & 0x3FF); + wbuf[1] = 0xDC00 | (wc & 0x3FF); + *wbufsize = 2; + } +} + +/* + * Check if codepage is one of those for which the dwFlags parameter + * to MultiByteToWideChar() must be zero. Return zero or + * MB_ERR_INVALID_CHARS. The docs in Platform SDK for for Windows + * Server 2003 R2 claims that also codepage 65001 is one of these, but + * that doesn't seem to be the case. The MSDN docs for MSVS2008 leave + * out 65001 (UTF-8), and that indeed seems to be the case on XP, it + * works fine to pass MB_ERR_INVALID_CHARS in dwFlags when converting + * from UTF-8. + */ +static int +mbtowc_flags(int codepage) +{ + return (codepage == 50220 || codepage == 50221 || + codepage == 50222 || codepage == 50225 || + codepage == 50227 || codepage == 50229 || + codepage == 52936 || codepage == 54936 || + (codepage >= 57002 && codepage <= 57011) || + codepage == 65000 || codepage == 42) ? 0 : MB_ERR_INVALID_CHARS; +} + +/* + * Check if codepage is one those for which the lpUsedDefaultChar + * parameter to WideCharToMultiByte() must be NULL. The docs in + * Platform SDK for for Windows Server 2003 R2 claims that this is the + * list below, while the MSDN docs for MSVS2008 claim that it is only + * for 65000 (UTF-7) and 65001 (UTF-8). This time the earlier Platform + * SDK seems to be correct, at least for XP. + */ +static int +must_use_null_useddefaultchar(int codepage) +{ + return (codepage == 65000 || codepage == 65001 || + codepage == 50220 || codepage == 50221 || + codepage == 50222 || codepage == 50225 || + codepage == 50227 || codepage == 50229 || + codepage == 52936 || codepage == 54936 || + (codepage >= 57002 && codepage <= 57011) || + codepage == 42); +} + +static char * +strrstr(const char *str, const char *token) +{ + int len = strlen(token); + const char *p = str + strlen(str); + + while (str <= --p) + if (p[0] == token[0] && strncmp(p, token, len) == 0) + return (char *)p; + return NULL; +} + +static char * +xstrndup(const char *s, size_t n) +{ + char *p; + + p = (char *)malloc(n + 1); + if (p == NULL) + return NULL; + memcpy(p, s, n); + p[n] = '\0'; + return p; +} + +static int +seterror(int err) +{ + errno = err; + return -1; +} + +#if defined(USE_LIBICONV_DLL) +static int +libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) +{ + HMODULE hlibiconv = NULL; + HMODULE hmsvcrt = NULL; + char *dllname; + const char *p; + const char *e; + f_iconv_open _iconv_open; + + /* + * always try to load dll, so that we can switch dll in runtime. + */ + + /* XXX: getenv() can't get variable set by SetEnvironmentVariable() */ + p = getenv("WINICONV_LIBICONV_DLL"); + if (p == NULL) + p = DEFAULT_LIBICONV_DLL; + /* parse comma separated value */ + for ( ; *p != 0; p = (*e == ',') ? e + 1 : e) + { + e = strchr(p, ','); + if (p == e) + continue; + else if (e == NULL) + e = p + strlen(p); + dllname = xstrndup(p, e - p); + if (dllname == NULL) + return FALSE; + hlibiconv = LoadLibraryA(dllname); + free(dllname); + if (hlibiconv != NULL) + { + if (hlibiconv == hwiniconv) + { + FreeLibrary(hlibiconv); + hlibiconv = NULL; + continue; + } + break; + } + } + + if (hlibiconv == NULL) + goto failed; + + hmsvcrt = find_imported_module_by_funcname(hlibiconv, "_errno"); + if (hmsvcrt == NULL) + goto failed; + + _iconv_open = (f_iconv_open)GetProcAddressA(hlibiconv, "libiconv_open"); + if (_iconv_open == NULL) + _iconv_open = (f_iconv_open)GetProcAddressA(hlibiconv, "iconv_open"); + cd->iconv_close = (f_iconv_close)GetProcAddressA(hlibiconv, "libiconv_close"); + if (cd->iconv_close == NULL) + cd->iconv_close = (f_iconv_close)GetProcAddressA(hlibiconv, "iconv_close"); + cd->iconv = (f_iconv)GetProcAddressA(hlibiconv, "libiconv"); + if (cd->iconv == NULL) + cd->iconv = (f_iconv)GetProcAddressA(hlibiconv, "iconv"); + cd->_errno = (f_errno)GetProcAddressA(hmsvcrt, "_errno"); + if (_iconv_open == NULL || cd->iconv_close == NULL + || cd->iconv == NULL || cd->_errno == NULL) + goto failed; + + cd->cd = _iconv_open(tocode, fromcode); + if (cd->cd == (iconv_t)(-1)) + goto failed; + + cd->hlibiconv = hlibiconv; + return TRUE; + +failed: + if (hlibiconv != NULL) + FreeLibrary(hlibiconv); + /* do not free hmsvcrt which is obtained by GetModuleHandle() */ + return FALSE; +} + +/* + * Reference: + * http://forums.belution.com/ja/vc/000/234/78s.shtml + * http://nienie.com/~masapico/api_ImageDirectoryEntryToData.html + * + * The formal way is + * imagehlp.h or dbghelp.h + * imagehlp.lib or dbghelp.lib + * ImageDirectoryEntryToData() + */ +#define TO_DOS_HEADER(base) ((PIMAGE_DOS_HEADER)(base)) +#define TO_NT_HEADERS(base) ((PIMAGE_NT_HEADERS)((LPBYTE)(base) + TO_DOS_HEADER(base)->e_lfanew)) +static PVOID +MyImageDirectoryEntryToData(LPVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size) +{ + /* TODO: MappedAsImage? */ + PIMAGE_DATA_DIRECTORY p; + p = TO_NT_HEADERS(Base)->OptionalHeader.DataDirectory + DirectoryEntry; + if (p->VirtualAddress == 0) { + *Size = 0; + return NULL; + } + *Size = p->Size; + return (PVOID)((LPBYTE)Base + p->VirtualAddress); +} + +static HMODULE +find_imported_module_by_funcname(HMODULE hModule, const char *funcname) +{ + DWORD_PTR Base; + ULONG Size; + PIMAGE_IMPORT_DESCRIPTOR Imp; + PIMAGE_THUNK_DATA Name; /* Import Name Table */ + PIMAGE_IMPORT_BY_NAME ImpName; + + Base = (DWORD_PTR)hModule; + Imp = (PIMAGE_IMPORT_DESCRIPTOR)MyImageDirectoryEntryToData( + (LPVOID)Base, + TRUE, + IMAGE_DIRECTORY_ENTRY_IMPORT, + &Size); + if (Imp == NULL) + return NULL; + for ( ; Imp->OriginalFirstThunk != 0; ++Imp) + { + Name = (PIMAGE_THUNK_DATA)(Base + Imp->OriginalFirstThunk); + for ( ; Name->u1.Ordinal != 0; ++Name) + { + if (!IMAGE_SNAP_BY_ORDINAL(Name->u1.Ordinal)) + { + ImpName = (PIMAGE_IMPORT_BY_NAME) + (Base + (DWORD_PTR)Name->u1.AddressOfData); + if (strcmp((char *)ImpName->Name, funcname) == 0) + return GetModuleHandleA((char *)(Base + Imp->Name)); + } + } + } + return NULL; +} +#endif + +static int +sbcs_mblen(csconv_t *cv UNUSED, const uchar *buf UNUSED, int bufsize UNUSED) +{ + return 1; +} + +static int +dbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = IsDBCSLeadByteEx(cv->codepage, buf[0]) ? 2 : 1; + if (bufsize < len) + return seterror(EINVAL); + return len; +} + +static int +mbcs_mblen(csconv_t *cv, const uchar *buf, int bufsize) +{ + int len = 0; + + if (cv->codepage == 54936) { + if (buf[0] <= 0x7F) len = 1; + else if (buf[0] >= 0x81 && buf[0] <= 0xFE && + bufsize >= 2 && + ((buf[1] >= 0x40 && buf[1] <= 0x7E) || + (buf[1] >= 0x80 && buf[1] <= 0xFE))) len = 2; + else if (buf[0] >= 0x81 && buf[0] <= 0xFE && + bufsize >= 4 && + buf[1] >= 0x30 && buf[1] <= 0x39) len = 4; + else + return seterror(EINVAL); + return len; + } + else + return seterror(EINVAL); +} + +static int +utf8_mblen(csconv_t *cv UNUSED, const uchar *buf, int bufsize) +{ + int len = 0; + + if (buf[0] < 0x80) len = 1; + else if ((buf[0] & 0xE0) == 0xC0) len = 2; + else if ((buf[0] & 0xF0) == 0xE0) len = 3; + else if ((buf[0] & 0xF8) == 0xF0) len = 4; + else if ((buf[0] & 0xFC) == 0xF8) len = 5; + else if ((buf[0] & 0xFE) == 0xFC) len = 6; + + if (len == 0) + return seterror(EILSEQ); + else if (bufsize < len) + return seterror(EINVAL); + return len; +} + +static int +eucjp_mblen(csconv_t *cv UNUSED, const uchar *buf, int bufsize) +{ + if (buf[0] < 0x80) /* ASCII */ + return 1; + else if (buf[0] == 0x8E) /* JIS X 0201 */ + { + if (bufsize < 2) + return seterror(EINVAL); + else if (!(0xA1 <= buf[1] && buf[1] <= 0xDF)) + return seterror(EILSEQ); + return 2; + } + else if (buf[0] == 0x8F) /* JIS X 0212 */ + { + if (bufsize < 3) + return seterror(EINVAL); + else if (!(0xA1 <= buf[1] && buf[1] <= 0xFE) + || !(0xA1 <= buf[2] && buf[2] <= 0xFE)) + return seterror(EILSEQ); + return 3; + } + else /* JIS X 0208 */ + { + if (bufsize < 2) + return seterror(EINVAL); + else if (!(0xA1 <= buf[0] && buf[0] <= 0xFE) + || !(0xA1 <= buf[1] && buf[1] <= 0xFE)) + return seterror(EILSEQ); + return 2; + } +} + +static int +kernel_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int len; + + len = cv->mblen(cv, buf, bufsize); + if (len == -1) + return -1; + *wbufsize = MultiByteToWideChar(cv->codepage, mbtowc_flags (cv->codepage), + (const char *)buf, len, (wchar_t *)wbuf, *wbufsize); + if (*wbufsize == 0) + return seterror(EILSEQ); + return len; +} + +static int +kernel_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + BOOL usedDefaultChar = 0; + BOOL *p = NULL; + int flags = 0; + int len; + + if (bufsize == 0) + return seterror(E2BIG); + if (!must_use_null_useddefaultchar(cv->codepage)) + { + p = &usedDefaultChar; +#ifdef WC_NO_BEST_FIT_CHARS + if (!(cv->flags & FLAG_TRANSLIT)) + flags |= WC_NO_BEST_FIT_CHARS; +#endif + } + len = WideCharToMultiByte(cv->codepage, flags, + (const wchar_t *)wbuf, wbufsize, (char *)buf, bufsize, NULL, p); + if (len == 0) + { + if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) + return seterror(E2BIG); + return seterror(EILSEQ); + } + else if (usedDefaultChar && !(cv->flags & FLAG_TRANSLIT)) + return seterror(EILSEQ); + else if (cv->mblen(cv, buf, len) != len) /* validate result */ + return seterror(EILSEQ); + return len; +} + +/* + * It seems that the mode (cv->mode) is fixnum. + * For example, when converting iso-2022-jp(cp50221) to unicode: + * in ascii sequence: mode=0xC42C0000 + * in jisx0208 sequence: mode=0xC42C0001 + * "C42C" is same for each convert session. + * It should be: ((codepage-1)<<16)|state + */ +static int +mlang_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int len; + int insize; + HRESULT hr; + + len = cv->mblen(cv, buf, bufsize); + if (len == -1) + return -1; + insize = len; + hr = ConvertINetMultiByteToUnicode(&cv->mode, cv->codepage, + (const char *)buf, &insize, (wchar_t *)wbuf, wbufsize); + if (hr != S_OK || insize != len) + return seterror(EILSEQ); + return len; +} + +static int +mlang_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + char tmpbuf[MB_CHAR_MAX]; /* enough room for one character */ + int tmpsize = MB_CHAR_MAX; + int insize = wbufsize; + HRESULT hr; + + hr = ConvertINetUnicodeToMultiByte(&cv->mode, cv->codepage, + (const wchar_t *)wbuf, &wbufsize, tmpbuf, &tmpsize); + if (hr != S_OK || insize != wbufsize) + return seterror(EILSEQ); + else if (bufsize < tmpsize) + return seterror(E2BIG); + else if (cv->mblen(cv, (uchar *)tmpbuf, tmpsize) != tmpsize) + return seterror(EILSEQ); + memcpy(buf, tmpbuf, tmpsize); + return tmpsize; +} + +static int +utf16_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int codepage = cv->codepage; + + /* swap endian: 1200 <-> 1201 */ + if (cv->mode & UNICODE_MODE_SWAPPED) + codepage ^= 1; + + if (bufsize < 2) + return seterror(EINVAL); + if (codepage == 1200) /* little endian */ + wbuf[0] = (buf[1] << 8) | buf[0]; + else if (codepage == 1201) /* big endian */ + wbuf[0] = (buf[0] << 8) | buf[1]; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + cv->mode |= UNICODE_MODE_BOM_DONE; + if (wbuf[0] == 0xFFFE) + { + cv->mode |= UNICODE_MODE_SWAPPED; + *wbufsize = 0; + return 2; + } + else if (wbuf[0] == 0xFEFF) + { + *wbufsize = 0; + return 2; + } + } + + if (0xDC00 <= wbuf[0] && wbuf[0] <= 0xDFFF) + return seterror(EILSEQ); + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + { + if (bufsize < 4) + return seterror(EINVAL); + if (codepage == 1200) /* little endian */ + wbuf[1] = (buf[3] << 8) | buf[2]; + else if (codepage == 1201) /* big endian */ + wbuf[1] = (buf[2] << 8) | buf[3]; + if (!(0xDC00 <= wbuf[1] && wbuf[1] <= 0xDFFF)) + return seterror(EILSEQ); + *wbufsize = 2; + return 4; + } + *wbufsize = 1; + return 2; +} + +static int +utf16_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + int r; + + cv->mode |= UNICODE_MODE_BOM_DONE; + if (bufsize < 2) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + memcpy(buf, "\xFF\xFE", 2); + else if (cv->codepage == 1201) /* big endian */ + memcpy(buf, "\xFE\xFF", 2); + + r = utf16_wctomb(cv, wbuf, wbufsize, buf + 2, bufsize - 2); + if (r == -1) + return -1; + return r + 2; + } + + if (bufsize < 2) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + { + buf[0] = (wbuf[0] & 0x00FF); + buf[1] = (wbuf[0] & 0xFF00) >> 8; + } + else if (cv->codepage == 1201) /* big endian */ + { + buf[0] = (wbuf[0] & 0xFF00) >> 8; + buf[1] = (wbuf[0] & 0x00FF); + } + if (0xD800 <= wbuf[0] && wbuf[0] <= 0xDBFF) + { + if (bufsize < 4) + return seterror(E2BIG); + if (cv->codepage == 1200) /* little endian */ + { + buf[2] = (wbuf[1] & 0x00FF); + buf[3] = (wbuf[1] & 0xFF00) >> 8; + } + else if (cv->codepage == 1201) /* big endian */ + { + buf[2] = (wbuf[1] & 0xFF00) >> 8; + buf[3] = (wbuf[1] & 0x00FF); + } + return 4; + } + return 2; +} + +static int +utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + int codepage = cv->codepage; + uint wc; + + /* swap endian: 12000 <-> 12001 */ + if (cv->mode & UNICODE_MODE_SWAPPED) + codepage ^= 1; + + if (bufsize < 4) + return seterror(EINVAL); + if (codepage == 12000) /* little endian */ + wc = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; + else if (codepage == 12001) /* big endian */ + wc = (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + cv->mode |= UNICODE_MODE_BOM_DONE; + if (wc == 0xFFFE0000) + { + cv->mode |= UNICODE_MODE_SWAPPED; + *wbufsize = 0; + return 4; + } + else if (wc == 0x0000FEFF) + { + *wbufsize = 0; + return 4; + } + } + + if ((0xD800 <= wc && wc <= 0xDFFF) || 0x10FFFF < wc) + return seterror(EILSEQ); + ucs4_to_utf16(wc, wbuf, wbufsize); + return 4; +} + +static int +utf32_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + uint wc; + + if ((cv->flags & FLAG_USE_BOM) && !(cv->mode & UNICODE_MODE_BOM_DONE)) + { + int r; + + cv->mode |= UNICODE_MODE_BOM_DONE; + if (bufsize < 4) + return seterror(E2BIG); + if (cv->codepage == 12000) /* little endian */ + memcpy(buf, "\xFF\xFE\x00\x00", 4); + else if (cv->codepage == 12001) /* big endian */ + memcpy(buf, "\x00\x00\xFE\xFF", 4); + + r = utf32_wctomb(cv, wbuf, wbufsize, buf + 4, bufsize - 4); + if (r == -1) + return -1; + return r + 4; + } + + if (bufsize < 4) + return seterror(E2BIG); + wc = utf16_to_ucs4(wbuf); + if (cv->codepage == 12000) /* little endian */ + { + buf[0] = wc & 0x000000FF; + buf[1] = (wc & 0x0000FF00) >> 8; + buf[2] = (wc & 0x00FF0000) >> 16; + buf[3] = (wc & 0xFF000000) >> 24; + } + else if (cv->codepage == 12001) /* big endian */ + { + buf[0] = (wc & 0xFF000000) >> 24; + buf[1] = (wc & 0x00FF0000) >> 16; + buf[2] = (wc & 0x0000FF00) >> 8; + buf[3] = wc & 0x000000FF; + } + return 4; +} + +/* + * 50220: ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS) + * 50221: ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow + * 1 byte Kana) + * 50222: ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte + * Kana - SO/SI) + * + * MultiByteToWideChar() and WideCharToMultiByte() behave differently + * depending on Windows version. On XP, WideCharToMultiByte() doesn't + * terminate result sequence with ascii escape. But Vista does. + * Use MLang instead. + */ + +#define ISO2022_MODE(cs, shift) (((cs) << 8) | (shift)) +#define ISO2022_MODE_CS(mode) (((mode) >> 8) & 0xFF) +#define ISO2022_MODE_SHIFT(mode) ((mode) & 0xFF) + +#define ISO2022_SI 0 +#define ISO2022_SO 1 + +/* shift in */ +static const char iso2022_SI_seq[] = "\x0F"; +/* shift out */ +static const char iso2022_SO_seq[] = "\x0E"; + +typedef struct iso2022_esc_t iso2022_esc_t; +struct iso2022_esc_t { + const char *esc; + int esc_len; + int len; + int cs; +}; + +#define ISO2022JP_CS_ASCII 0 +#define ISO2022JP_CS_JISX0201_ROMAN 1 +#define ISO2022JP_CS_JISX0201_KANA 2 +#define ISO2022JP_CS_JISX0208_1978 3 +#define ISO2022JP_CS_JISX0208_1983 4 +#define ISO2022JP_CS_JISX0212 5 + +static iso2022_esc_t iso2022jp_esc[] = { + {"\x1B\x28\x42", 3, 1, ISO2022JP_CS_ASCII}, + {"\x1B\x28\x4A", 3, 1, ISO2022JP_CS_JISX0201_ROMAN}, + {"\x1B\x28\x49", 3, 1, ISO2022JP_CS_JISX0201_KANA}, + {"\x1B\x24\x40", 3, 2, ISO2022JP_CS_JISX0208_1983}, /* unify 1978 with 1983 */ + {"\x1B\x24\x42", 3, 2, ISO2022JP_CS_JISX0208_1983}, + {"\x1B\x24\x28\x44", 4, 2, ISO2022JP_CS_JISX0212}, + {NULL, 0, 0, 0} +}; + +static int +iso2022jp_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + char tmp[MB_CHAR_MAX]; + int insize; + HRESULT hr; + DWORD dummy = 0; + int len; + int esc_len; + int cs; + int shift; + int i; + + if (buf[0] == 0x1B) + { + for (i = 0; iesc[i].esc != NULL; ++i) + { + esc_len = iesc[i].esc_len; + if (bufsize < esc_len) + { + if (strncmp((char *)buf, iesc[i].esc, bufsize) == 0) + return seterror(EINVAL); + } + else + { + if (strncmp((char *)buf, iesc[i].esc, esc_len) == 0) + { + cv->mode = ISO2022_MODE(iesc[i].cs, ISO2022_SI); + *wbufsize = 0; + return esc_len; + } + } + } + /* not supported escape sequence */ + return seterror(EILSEQ); + } + else if (buf[0] == iso2022_SO_seq[0]) + { + cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SO); + *wbufsize = 0; + return 1; + } + else if (buf[0] == iso2022_SI_seq[0]) + { + cv->mode = ISO2022_MODE(ISO2022_MODE_CS(cv->mode), ISO2022_SI); + *wbufsize = 0; + return 1; + } + + cs = ISO2022_MODE_CS(cv->mode); + shift = ISO2022_MODE_SHIFT(cv->mode); + + /* reset the mode for informal sequence */ + if (buf[0] < 0x20) + { + cs = ISO2022JP_CS_ASCII; + shift = ISO2022_SI; + } + + len = iesc[cs].len; + if (bufsize < len) + return seterror(EINVAL); + for (i = 0; i < len; ++i) + if (!(buf[i] < 0x80)) + return seterror(EILSEQ); + esc_len = iesc[cs].esc_len; + memcpy(tmp, iesc[cs].esc, esc_len); + if (shift == ISO2022_SO) + { + memcpy(tmp + esc_len, iso2022_SO_seq, 1); + esc_len += 1; + } + memcpy(tmp + esc_len, buf, len); + + if ((cv->codepage == 50220 || cv->codepage == 50221 + || cv->codepage == 50222) && shift == ISO2022_SO) + { + /* XXX: shift-out cannot be used for mbtowc (both kernel and + * mlang) */ + esc_len = iesc[ISO2022JP_CS_JISX0201_KANA].esc_len; + memcpy(tmp, iesc[ISO2022JP_CS_JISX0201_KANA].esc, esc_len); + memcpy(tmp + esc_len, buf, len); + } + + insize = len + esc_len; + hr = ConvertINetMultiByteToUnicode(&dummy, cv->codepage, + (const char *)tmp, &insize, (wchar_t *)wbuf, wbufsize); + if (hr != S_OK || insize != len + esc_len) + return seterror(EILSEQ); + + /* Check for conversion error. Assuming defaultChar is 0x3F. */ + /* ascii should be converted from ascii */ + if (wbuf[0] == buf[0] + && cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) + return seterror(EILSEQ); + + /* reset the mode for informal sequence */ + if (cv->mode != ISO2022_MODE(cs, shift)) + cv->mode = ISO2022_MODE(cs, shift); + + return len; +} + +static int +iso2022jp_wctomb(csconv_t *cv, ushort *wbuf, int wbufsize, uchar *buf, int bufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + char tmp[MB_CHAR_MAX]; + int tmpsize = MB_CHAR_MAX; + int insize = wbufsize; + HRESULT hr; + DWORD dummy = 0; + int len; + int esc_len; + int cs; + int shift; + int i; + + /* + * MultiByte = [escape sequence] + character + [escape sequence] + * + * Whether trailing escape sequence is added depends on which API is + * used (kernel or MLang, and its version). + */ + hr = ConvertINetUnicodeToMultiByte(&dummy, cv->codepage, + (const wchar_t *)wbuf, &wbufsize, tmp, &tmpsize); + if (hr != S_OK || insize != wbufsize) + return seterror(EILSEQ); + else if (bufsize < tmpsize) + return seterror(E2BIG); + + if (tmpsize == 1) + { + cs = ISO2022JP_CS_ASCII; + esc_len = 0; + } + else + { + for (i = 1; iesc[i].esc != NULL; ++i) + { + esc_len = iesc[i].esc_len; + if (strncmp(tmp, iesc[i].esc, esc_len) == 0) + { + cs = iesc[i].cs; + break; + } + } + if (iesc[i].esc == NULL) + /* not supported escape sequence */ + return seterror(EILSEQ); + } + + shift = ISO2022_SI; + if (tmp[esc_len] == iso2022_SO_seq[0]) + { + shift = ISO2022_SO; + esc_len += 1; + } + + len = iesc[cs].len; + + /* Check for converting error. Assuming defaultChar is 0x3F. */ + /* ascii should be converted from ascii */ + if (cs == ISO2022JP_CS_ASCII && !(wbuf[0] < 0x80)) + return seterror(EILSEQ); + else if (tmpsize < esc_len + len) + return seterror(EILSEQ); + + if (cv->mode == ISO2022_MODE(cs, shift)) + { + /* remove escape sequence */ + if (esc_len != 0) + memmove(tmp, tmp + esc_len, len); + esc_len = 0; + } + else + { + if (cs == ISO2022JP_CS_ASCII) + { + esc_len = iesc[ISO2022JP_CS_ASCII].esc_len; + memmove(tmp + esc_len, tmp, len); + memcpy(tmp, iesc[ISO2022JP_CS_ASCII].esc, esc_len); + } + if (ISO2022_MODE_SHIFT(cv->mode) == ISO2022_SO) + { + /* shift-in before changing to other mode */ + memmove(tmp + 1, tmp, len + esc_len); + memcpy(tmp, iso2022_SI_seq, 1); + esc_len += 1; + } + } + + if (bufsize < len + esc_len) + return seterror(E2BIG); + memcpy(buf, tmp, len + esc_len); + cv->mode = ISO2022_MODE(cs, shift); + return len + esc_len; +} + +static int +iso2022jp_flush(csconv_t *cv, uchar *buf, int bufsize) +{ + iso2022_esc_t *iesc = iso2022jp_esc; + int esc_len; + + if (cv->mode != ISO2022_MODE(ISO2022JP_CS_ASCII, ISO2022_SI)) + { + esc_len = 0; + if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) + esc_len += 1; + if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) + esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; + if (bufsize < esc_len) + return seterror(E2BIG); + + esc_len = 0; + if (ISO2022_MODE_SHIFT(cv->mode) != ISO2022_SI) + { + memcpy(buf, iso2022_SI_seq, 1); + esc_len += 1; + } + if (ISO2022_MODE_CS(cv->mode) != ISO2022JP_CS_ASCII) + { + memcpy(buf + esc_len, iesc[ISO2022JP_CS_ASCII].esc, + iesc[ISO2022JP_CS_ASCII].esc_len); + esc_len += iesc[ISO2022JP_CS_ASCII].esc_len; + } + return esc_len; + } + return 0; +} + +#if defined(MAKE_DLL) && defined(USE_LIBICONV_DLL) +BOOL WINAPI +DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) +{ + switch( fdwReason ) + { + case DLL_PROCESS_ATTACH: + hwiniconv = (HMODULE)hinstDLL; + break; + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} +#endif + +#if defined(MAKE_EXE) +#include +#include +#include +int +main(int argc, char **argv) +{ + char *fromcode = NULL; + char *tocode = NULL; + int i; + char inbuf[BUFSIZ]; + char outbuf[BUFSIZ]; + const char *pin; + char *pout; + size_t inbytesleft; + size_t outbytesleft; + size_t rest = 0; + iconv_t cd; + size_t r; + FILE *in = stdin; + FILE *out = stdout; + int ignore = 0; + char *p; + + _setmode(_fileno(stdin), _O_BINARY); + _setmode(_fileno(stdout), _O_BINARY); + + for (i = 1; i < argc; ++i) + { + if (strcmp(argv[i], "-l") == 0) + { + for (i = 0; codepage_alias[i].name != NULL; ++i) + printf("%s\n", codepage_alias[i].name); + return 0; + } + + if (strcmp(argv[i], "-f") == 0) + fromcode = argv[++i]; + else if (strcmp(argv[i], "-t") == 0) + tocode = argv[++i]; + else if (strcmp(argv[i], "-c") == 0) + ignore = 1; + else if (strcmp(argv[i], "--output") == 0) + { + out = fopen(argv[++i], "wb"); + if(out == NULL) + { + fprintf(stderr, "cannot open %s\n", argv[i]); + return 1; + } + } + else + { + in = fopen(argv[i], "rb"); + if (in == NULL) + { + fprintf(stderr, "cannot open %s\n", argv[i]); + return 1; + } + break; + } + } + + if (fromcode == NULL || tocode == NULL) + { + printf("usage: %s [-c] -f from-enc -t to-enc [file]\n", argv[0]); + return 0; + } + + if (ignore) + { + p = tocode; + tocode = (char *)malloc(strlen(p) + strlen("//IGNORE") + 1); + if (tocode == NULL) + { + perror("fatal error"); + return 1; + } + strcpy(tocode, p); + strcat(tocode, "//IGNORE"); + } + + cd = iconv_open(tocode, fromcode); + if (cd == (iconv_t)(-1)) + { + perror("iconv_open error"); + return 1; + } + + while ((inbytesleft = fread(inbuf + rest, 1, sizeof(inbuf) - rest, in)) != 0 + || rest != 0) + { + inbytesleft += rest; + pin = inbuf; + pout = outbuf; + outbytesleft = sizeof(outbuf); + r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft); + fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, out); + if (r == (size_t)(-1) && errno != E2BIG && (errno != EINVAL || feof(in))) + { + perror("conversion error"); + return 1; + } + memmove(inbuf, pin, inbytesleft); + rest = inbytesleft; + } + pout = outbuf; + outbytesleft = sizeof(outbuf); + r = iconv(cd, NULL, NULL, &pout, &outbytesleft); + fwrite(outbuf, 1, sizeof(outbuf) - outbytesleft, out); + if (r == (size_t)(-1)) + { + perror("conversion error"); + return 1; + } + + iconv_close(cd); + + return 0; +} +#endif + diff --git a/reactos/lib/3rdparty/libwin-iconv/win_iconv_test.c b/reactos/lib/3rdparty/libwin-iconv/win_iconv_test.c new file mode 100644 index 00000000000..99a4bfc0939 --- /dev/null +++ b/reactos/lib/3rdparty/libwin-iconv/win_iconv_test.c @@ -0,0 +1,286 @@ + +#ifdef USE_ICONV_H +#include +#include +#include +#include +#include +#else +#include "win_iconv.c" +#endif + +#include + +const char * +tohex(const char *str, int size) +{ + static char buf[BUFSIZ]; + char *pbuf = buf; + int i; + buf[0] = 0; + for (i = 0; i < size; ++i) + pbuf += sprintf(pbuf, "%02X", str[i] & 0xFF); + return buf; +} + +const char * +errstr(int errcode) +{ + static char buf[BUFSIZ]; + switch (errcode) + { + case 0: return "NOERROR"; + case EINVAL: return "EINVAL"; + case EILSEQ: return "EILSEQ"; + case E2BIG: return "E2BIG"; + } + sprintf(buf, "%d\n", errcode); + return buf; +} + +#ifdef USE_LIBICONV_DLL +int use_dll; + +int +setdll(const char *dllpath) +{ + char buf[BUFSIZ]; + rec_iconv_t cd; + + sprintf(buf, "WINICONV_LIBICONV_DLL=%s", dllpath); + putenv(buf); + if (libiconv_iconv_open(&cd, "ascii", "ascii")) + { + FreeLibrary(cd.hlibiconv); + use_dll = TRUE; + return TRUE; + } + use_dll = FALSE; + return FALSE; +} +#endif + +/* + * We can test the codepage that is installed in the system. + */ +int +check_enc(const char *encname, int codepage) +{ + iconv_t cd; + int cp; + cd = iconv_open("utf-8", encname); + if (cd == (iconv_t)(-1)) + { + printf("%s(%d) IS NOT SUPPORTED: SKIP THE TEST\n", encname, codepage); + return FALSE; + } +#ifndef USE_ICONV_H + cp = ((rec_iconv_t *)cd)->from.codepage; + if (cp != codepage) + { + printf("%s(%d) ALIAS IS MAPPED TO DIFFERENT CODEPAGE (%d)\n", encname, codepage, cp); + exit(1); + } +#endif + iconv_close(cd); + return TRUE; +} + +void +test(const char *from, const char *fromstr, int fromsize, const char *to, const char *tostr, int tosize, int errcode, int bufsize, int line) +{ + char outbuf[BUFSIZ]; + const char *pin; + char *pout; + size_t inbytesleft; + size_t outbytesleft; + iconv_t cd; + size_t r; +#ifdef USE_LIBICONV_DLL + char dllpath[_MAX_PATH]; +#endif + + cd = iconv_open(to, from); + if (cd == (iconv_t)(-1)) + { + printf("%s -> %s: NG: INVALID ENCODING NAME: line=%d\n", from, to, line); + exit(1); + } + +#ifdef USE_LIBICONV_DLL + if (((rec_iconv_t *)cd)->hlibiconv != NULL) + GetModuleFileNameA(((rec_iconv_t *)cd)->hlibiconv, dllpath, sizeof(dllpath)); + + if (use_dll && ((rec_iconv_t *)cd)->hlibiconv == NULL) + { + printf("%s: %s -> %s: NG: FAILED TO USE DLL: line=%d\n", dllpath, from, to, line); + exit(1); + } + else if (!use_dll && ((rec_iconv_t *)cd)->hlibiconv != NULL) + { + printf("%s: %s -> %s: NG: DLL IS LOADED UNEXPECTEDLY: line=%d\n", dllpath, from, to, line); + exit(1); + } +#endif + + errno = 0; + + pin = (char *)fromstr; + pout = outbuf; + inbytesleft = fromsize; + outbytesleft = bufsize; + r = iconv(cd, &pin, &inbytesleft, &pout, &outbytesleft); + if (r != (size_t)(-1)) + r = iconv(cd, NULL, NULL, &pout, &outbytesleft); + *pout = 0; + +#ifdef USE_LIBICONV_DLL + if (use_dll) + printf("%s: ", dllpath); +#endif + printf("%s(%s) -> ", from, tohex(fromstr, fromsize)); + printf("%s(%s%s%s): ", to, tohex(tostr, tosize), + errcode == 0 ? "" : ":", + errcode == 0 ? "" : errstr(errcode)); + if (strcmp(outbuf, tostr) == 0 && errno == errcode) + printf("OK\n"); + else + { + printf("RESULT(%s:%s): ", tohex(outbuf, sizeof(outbuf) - outbytesleft), + errstr(errno)); + printf("NG: line=%d\n", line); + exit(1); + } +} + +#define STATIC_STRLEN(arr) (sizeof(arr) - 1) + +#define success(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), 0, BUFSIZ, __LINE__) +#define einval(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), EINVAL, BUFSIZ, __LINE__) +#define eilseq(from, fromstr, to, tostr) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), EILSEQ, BUFSIZ, __LINE__) +#define e2big(from, fromstr, to, tostr, bufsize) test(from, fromstr, STATIC_STRLEN(fromstr), to, tostr, STATIC_STRLEN(tostr), E2BIG, bufsize, __LINE__) + +int +main(int argc, char **argv) +{ +#ifdef USE_LIBICONV_DLL + /* test use of dll if $DEFAULT_LIBICONV_DLL was defined. */ + if (setdll("")) + { + success("ascii", "ABC", "ascii", "ABC"); + success("ascii", "ABC", "utf-16be", "\x00\x41\x00\x42\x00\x43"); + } + else + { + printf("\nDLL TEST IS SKIPPED\n\n"); + } + + setdll("none"); +#endif + + if (check_enc("ascii", 20127)) + { + success("ascii", "ABC", "ascii", "ABC"); + /* MSB is dropped. Hmm... */ + success("ascii", "\x80\xFF", "ascii", "\x00\x7F"); + } + + /* unicode (CP1200 CP1201 CP12000 CP12001 CP65001) */ + if (check_enc("utf-8", 65001) + && check_enc("utf-16be", 1201) && check_enc("utf-16le", 1200) + && check_enc("utf-32be", 12001) && check_enc("utf-32le", 12000) + ) + { + /* Test the BOM behavior + * 1. Remove the BOM when "fromcode" is utf-16 or utf-32. + * 2. Add the BOM when "tocode" is utf-16 or utf-32. */ + success("utf-16", "\xFE\xFF\x01\x02", "utf-16be", "\x01\x02"); + success("utf-16", "\xFF\xFE\x02\x01", "utf-16be", "\x01\x02"); + success("utf-32", "\x00\x00\xFE\xFF\x00\x00\x01\x02", "utf-32be", "\x00\x00\x01\x02"); + success("utf-32", "\xFF\xFE\x00\x00\x02\x01\x00\x00", "utf-32be", "\x00\x00\x01\x02"); + success("utf-16", "\xFE\xFF\x00\x01", "utf-8", "\x01"); +#ifndef GLIB_COMPILATION + success("utf-8", "\x01", "utf-16", "\xFE\xFF\x00\x01"); + success("utf-8", "\x01", "utf-32", "\x00\x00\xFE\xFF\x00\x00\x00\x01"); +#else + success("utf-8", "\x01", "utf-16", "\xFF\xFE\x01\x00"); + success("utf-8", "\x01", "utf-32", "\xFF\xFE\x00\x00\x01\x00\x00\x00"); +#endif + + success("utf-16be", "\xFE\xFF\x01\x02", "utf-16be", "\xFE\xFF\x01\x02"); + success("utf-16le", "\xFF\xFE\x02\x01", "utf-16be", "\xFE\xFF\x01\x02"); + success("utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02", "utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02"); + success("utf-32le", "\xFF\xFE\x00\x00\x02\x01\x00\x00", "utf-32be", "\x00\x00\xFE\xFF\x00\x00\x01\x02"); + success("utf-16be", "\xFE\xFF\x00\x01", "utf-8", "\xEF\xBB\xBF\x01"); + success("utf-8", "\xEF\xBB\xBF\x01", "utf-8", "\xEF\xBB\xBF\x01"); + + success("utf-16be", "\x01\x02", "utf-16le", "\x02\x01"); + success("utf-16le", "\x02\x01", "utf-16be", "\x01\x02"); + success("utf-16be", "\xFE\xFF", "utf-16le", "\xFF\xFE"); + success("utf-16le", "\xFF\xFE", "utf-16be", "\xFE\xFF"); + success("utf-32be", "\x00\x00\x03\x04", "utf-32le", "\x04\x03\x00\x00"); + success("utf-32le", "\x04\x03\x00\x00", "utf-32be", "\x00\x00\x03\x04"); + success("utf-32be", "\x00\x00\xFF\xFF", "utf-16be", "\xFF\xFF"); + success("utf-16be", "\xFF\xFF", "utf-32be", "\x00\x00\xFF\xFF"); + success("utf-32be", "\x00\x01\x00\x00", "utf-16be", "\xD8\x00\xDC\x00"); + success("utf-16be", "\xD8\x00\xDC\x00", "utf-32be", "\x00\x01\x00\x00"); + success("utf-32be", "\x00\x10\xFF\xFF", "utf-16be", "\xDB\xFF\xDF\xFF"); + success("utf-16be", "\xDB\xFF\xDF\xFF", "utf-32be", "\x00\x10\xFF\xFF"); + eilseq("utf-32be", "\x00\x11\x00\x00", "utf-16be", ""); + eilseq("utf-16be", "\xDB\xFF\xE0\x00", "utf-32be", ""); + success("utf-8", "\xE3\x81\x82", "utf-16be", "\x30\x42"); + einval("utf-8", "\xE3", "utf-16be", ""); + } + + /* Japanese (CP932 CP20932 CP50220 CP50221 CP50222 CP51932) */ + if (check_enc("cp932", 932) + && check_enc("cp20932", 20932) && check_enc("euc-jp", 51932) + && check_enc("cp50220", 50220) && check_enc("cp50221", 50221) + && check_enc("cp50222", 50222) && check_enc("iso-2022-jp", 50221)) + { + /* Test the compatibility for each other Japanese codepage. + * And validate the escape sequence handling for iso-2022-jp. */ + success("utf-16be", "\xFF\x5E", "cp932", "\x81\x60"); + success("utf-16be", "\x30\x1C", "cp932", "\x81\x60"); + success("utf-16be", "\xFF\x5E", "cp932//nocompat", "\x81\x60"); + eilseq("utf-16be", "\x30\x1C", "cp932//nocompat", ""); + success("euc-jp", "\xA4\xA2", "utf-16be", "\x30\x42"); + einval("euc-jp", "\xA4\xA2\xA4", "utf-16be", "\x30\x42"); + eilseq("euc-jp", "\xA4\xA2\xFF\xFF", "utf-16be", "\x30\x42"); + success("cp932", "\x81\x60", "iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42"); + success("UTF-16BE", "\xFF\x5E", "iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42"); + eilseq("UTF-16BE", "\x30\x1C", "iso-2022-jp//nocompat", ""); + success("UTF-16BE", "\x30\x42\x30\x44", "iso-2022-jp", "\x1B\x24\x42\x24\x22\x24\x24\x1B\x28\x42"); + success("iso-2022-jp", "\x1B\x24\x42\x21\x41\x1B\x28\x42", "UTF-16BE", "\xFF\x5E"); + } + + /* + * test for //translit + * U+FF41 (FULLWIDTH LATIN SMALL LETTER A) <-> U+0062 (LATIN SMALL LETTER A) + */ + eilseq("UTF-16BE", "\xFF\x41", "iso-8859-1", ""); + success("UTF-16BE", "\xFF\x41", "iso-8859-1//translit", "a"); + + /* + * test for //translit + * Some character, not in "to" encoding -> DEFAULT CHARACTER (maybe "?") + */ + eilseq("UTF-16BE", "\x30\x42", "ascii", ""); + success("UTF-16BE", "\x30\x42", "ascii//translit", "?"); + + /* + * test for //ignore + */ + eilseq("UTF-8", "\xFF A \xFF B", "ascii//ignore", " A B"); + eilseq("UTF-8", "\xEF\xBC\xA1 A \xEF\xBC\xA2 B", "ascii//ignore", " A B"); + eilseq("UTF-8", "\xEF\x01 A \xEF\x02 B", "ascii//ignore", "\x01 A \x02 B"); + + /* + * TODO: + * Test for state after iconv() failed. + * Ensure iconv() error is safe and continuable. + */ + + return 0; +} + diff --git a/reactos/lib/3rdparty/libxml2/CMakeLists.txt b/reactos/lib/3rdparty/libxml2/CMakeLists.txt index af789cb429b..a983a3659d8 100644 --- a/reactos/lib/3rdparty/libxml2/CMakeLists.txt +++ b/reactos/lib/3rdparty/libxml2/CMakeLists.txt @@ -1,5 +1,7 @@ -include_directories(include) +include_directories( + include + ${REACTOS_SOURCE_DIR}/lib/3rdparty/libwin-iconv) add_definitions( -D__MINGW32__ @@ -10,6 +12,8 @@ add_definitions( -D_WINDOWS -DWIN32 -DHAVE_CONFIG_H + -DLIBXML_ICONV_ENABLED + -DICONV_CONST=const -D_DLL -D__USE_CRTIMP) list(APPEND SOURCE diff --git a/reactos/media/doc/3rd Party Files.txt b/reactos/media/doc/3rd Party Files.txt index 180dd48a0b0..e22f8b4c4e3 100644 --- a/reactos/media/doc/3rd Party Files.txt +++ b/reactos/media/doc/3rd Party Files.txt @@ -61,3 +61,7 @@ Website: http://www.mpg123.de/ Title: STLport Used Version: 5.2.1 Website: http://stlport.sourceforge.net/ + +Title: win-iconv +Used Version: r44 +Website: https://code.google.com/p/win-iconv/ From 41202d274f63ecca8ebd3f5c2e321c65f6550e43 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 5 Mar 2014 11:39:15 +0000 Subject: [PATCH 059/419] [CMAKE] * User the proper target var name. CORE-7959 svn path=/trunk/; revision=62424 --- reactos/cmake/CMakeMacros.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/cmake/CMakeMacros.cmake b/reactos/cmake/CMakeMacros.cmake index 1229654bab5..f22723bbbef 100644 --- a/reactos/cmake/CMakeMacros.cmake +++ b/reactos/cmake/CMakeMacros.cmake @@ -460,11 +460,11 @@ function(set_module_type MODULE TYPE) # Handle hotpatchable images. # GCC has this as a function attribute so we're handling it using DECLSPEC_HOTPATCH if(__module_HOTPATCHABLE AND MSVC) - set_property(TARGET ${_target} APPEND_STRING PROPERTY COMPILE_FLAGS " /hotpatch") + set_property(TARGET ${MODULE} APPEND_STRING PROPERTY COMPILE_FLAGS " /hotpatch") if(ARCH STREQUAL "i386") - set_property(TARGET ${_target} APPEND_STRING PROPERTY LINK_FLAGS " /FUNCTIONPADMIN:5") + set_property(TARGET ${MODULE} APPEND_STRING PROPERTY LINK_FLAGS " /FUNCTIONPADMIN:5") elseif(ARCH STREQUAL "amd64") - set_property(TARGET ${_target} APPEND_STRING PROPERTY LINK_FLAGS " /FUNCTIONPADMIN:6") + set_property(TARGET ${MODULE} APPEND_STRING PROPERTY LINK_FLAGS " /FUNCTIONPADMIN:6") endif() endif() From 4e25055d9149ac19b2452fa5a2216d016c741d00 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 5 Mar 2014 11:45:39 +0000 Subject: [PATCH 060/419] [KERNEL32] * Mark as hotpatchable. CORE-7959 svn path=/trunk/; revision=62425 --- reactos/dll/win32/kernel32/CMakeLists.txt | 2 +- reactos/dll/win32/kernel32/client/loader.c | 10 +++++++++- reactos/dll/win32/kernel32/client/proc.c | 2 ++ reactos/dll/win32/kernel32/client/synch.c | 18 ++++++++++++++++++ reactos/dll/win32/kernel32/client/thread.c | 1 + 5 files changed, 31 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/kernel32/CMakeLists.txt b/reactos/dll/win32/kernel32/CMakeLists.txt index 35a3707dcb2..04982904dfa 100644 --- a/reactos/dll/win32/kernel32/CMakeLists.txt +++ b/reactos/dll/win32/kernel32/CMakeLists.txt @@ -99,7 +99,7 @@ add_library(kernel32 SHARED kernel32.rc ${CMAKE_CURRENT_BINARY_DIR}/kernel32.def) -set_module_type(kernel32 win32dll ENTRYPOINT DllMain 12) +set_module_type(kernel32 win32dll HOTPATCHABLE ENTRYPOINT DllMain 12) ############################################# ## HACK FOR MSVC COMPILATION WITH win32dll ## set_subsystem(kernel32 console) diff --git a/reactos/dll/win32/kernel32/client/loader.c b/reactos/dll/win32/kernel32/client/loader.c index d2dfce9a623..4f33ff775cc 100644 --- a/reactos/dll/win32/kernel32/client/loader.c +++ b/reactos/dll/win32/kernel32/client/loader.c @@ -107,6 +107,7 @@ DisableThreadLibraryCalls( */ HINSTANCE WINAPI +DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName) { LPSTR PathBuffer; @@ -152,6 +153,7 @@ LoadLibraryA(LPCSTR lpLibFileName) */ HINSTANCE WINAPI +DECLSPEC_HOTPATCH LoadLibraryExA(LPCSTR lpLibFileName, HANDLE hFile, DWORD dwFlags) @@ -171,6 +173,7 @@ LoadLibraryExA(LPCSTR lpLibFileName, */ HINSTANCE WINAPI +DECLSPEC_HOTPATCH LoadLibraryW(LPCWSTR lpLibFileName) { /* Call Ex version of the API */ @@ -279,6 +282,7 @@ BasepLoadLibraryAsDatafile(PWSTR Path, LPCWSTR Name, HMODULE *hModule) */ HINSTANCE WINAPI +DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags) @@ -447,7 +451,10 @@ GetProcAddress(HMODULE hModule, LPCSTR lpProcName) /* * @implemented */ -BOOL WINAPI FreeLibrary(HINSTANCE hLibModule) +BOOL +WINAPI +DECLSPEC_HOTPATCH +FreeLibrary(HINSTANCE hLibModule) { NTSTATUS Status; PIMAGE_NT_HEADERS NtHeaders; @@ -806,6 +813,7 @@ quickie: */ HMODULE WINAPI +DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName) { PUNICODE_STRING ModuleNameW; diff --git a/reactos/dll/win32/kernel32/client/proc.c b/reactos/dll/win32/kernel32/client/proc.c index 6c44e99069a..3725e27e273 100644 --- a/reactos/dll/win32/kernel32/client/proc.c +++ b/reactos/dll/win32/kernel32/client/proc.c @@ -4605,6 +4605,7 @@ Quickie: */ BOOL WINAPI +DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, @@ -4773,6 +4774,7 @@ CreateProcessInternalA(HANDLE hToken, */ BOOL WINAPI +DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, diff --git a/reactos/dll/win32/kernel32/client/synch.c b/reactos/dll/win32/kernel32/client/synch.c index 629e23adeca..4c51449e491 100644 --- a/reactos/dll/win32/kernel32/client/synch.c +++ b/reactos/dll/win32/kernel32/client/synch.c @@ -426,6 +426,7 @@ CancelWaitableTimer(IN HANDLE hTimer) */ HANDLE WINAPI +DECLSPEC_HOTPATCH CreateSemaphoreA(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, @@ -439,6 +440,7 @@ CreateSemaphoreA(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, */ HANDLE WINAPI +DECLSPEC_HOTPATCH CreateSemaphoreW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, IN LONG lInitialCount, IN LONG lMaximumCount, @@ -456,6 +458,7 @@ CreateSemaphoreW(IN LPSECURITY_ATTRIBUTES lpSemaphoreAttributes OPTIONAL, */ HANDLE WINAPI +DECLSPEC_HOTPATCH OpenSemaphoreA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpName) @@ -468,6 +471,7 @@ OpenSemaphoreA(IN DWORD dwDesiredAccess, */ HANDLE WINAPI +DECLSPEC_HOTPATCH OpenSemaphoreW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName) @@ -480,6 +484,7 @@ OpenSemaphoreW(IN DWORD dwDesiredAccess, */ BOOL WINAPI +DECLSPEC_HOTPATCH ReleaseSemaphore(IN HANDLE hSemaphore, IN LONG lReleaseCount, IN LPLONG lpPreviousCount) @@ -500,6 +505,7 @@ ReleaseSemaphore(IN HANDLE hSemaphore, */ HANDLE WINAPI +DECLSPEC_HOTPATCH CreateMutexA(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCSTR lpName OPTIONAL) @@ -512,6 +518,7 @@ CreateMutexA(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, */ HANDLE WINAPI +DECLSPEC_HOTPATCH CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, IN BOOL bInitialOwner, IN LPCWSTR lpName OPTIONAL) @@ -527,6 +534,7 @@ CreateMutexW(IN LPSECURITY_ATTRIBUTES lpMutexAttributes OPTIONAL, */ HANDLE WINAPI +DECLSPEC_HOTPATCH OpenMutexA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpName) @@ -539,6 +547,7 @@ OpenMutexA(IN DWORD dwDesiredAccess, */ HANDLE WINAPI +DECLSPEC_HOTPATCH OpenMutexW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName) @@ -551,6 +560,7 @@ OpenMutexW(IN DWORD dwDesiredAccess, */ BOOL WINAPI +DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex) { NTSTATUS Status; @@ -569,6 +579,7 @@ ReleaseMutex(IN HANDLE hMutex) */ HANDLE WINAPI +DECLSPEC_HOTPATCH CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, @@ -582,6 +593,7 @@ CreateEventA(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, */ HANDLE WINAPI +DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, @@ -599,6 +611,7 @@ CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, */ HANDLE WINAPI +DECLSPEC_HOTPATCH OpenEventA(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCSTR lpName) @@ -611,6 +624,7 @@ OpenEventA(IN DWORD dwDesiredAccess, */ HANDLE WINAPI +DECLSPEC_HOTPATCH OpenEventW(IN DWORD dwDesiredAccess, IN BOOL bInheritHandle, IN LPCWSTR lpName) @@ -623,6 +637,7 @@ OpenEventW(IN DWORD dwDesiredAccess, */ BOOL WINAPI +DECLSPEC_HOTPATCH PulseEvent(IN HANDLE hEvent) { NTSTATUS Status; @@ -641,6 +656,7 @@ PulseEvent(IN HANDLE hEvent) */ BOOL WINAPI +DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent) { NTSTATUS Status; @@ -659,6 +675,7 @@ ResetEvent(IN HANDLE hEvent) */ BOOL WINAPI +DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent) { NTSTATUS Status; @@ -715,6 +732,7 @@ InitializeCriticalSectionAndSpinCount(OUT LPCRITICAL_SECTION lpCriticalSection, */ VOID WINAPI +DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds) { /* Call the new API */ diff --git a/reactos/dll/win32/kernel32/client/thread.c b/reactos/dll/win32/kernel32/client/thread.c index e89eefd753c..dd610533947 100644 --- a/reactos/dll/win32/kernel32/client/thread.c +++ b/reactos/dll/win32/kernel32/client/thread.c @@ -131,6 +131,7 @@ BaseDispatchApc(IN PAPCFUNC ApcRoutine, */ HANDLE WINAPI +DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, From 19962054f97e7971b281cb76f51e3a51ed55ee97 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 5 Mar 2014 12:06:28 +0000 Subject: [PATCH 061/419] [NTDLL] * Mark as hotpatchable. CORE-7959 svn path=/trunk/; revision=62427 --- reactos/dll/ntdll/CMakeLists.txt | 2 +- reactos/dll/ntdll/ldr/ldrapi.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/dll/ntdll/CMakeLists.txt b/reactos/dll/ntdll/CMakeLists.txt index 8a7f11b1004..afa15fd2c24 100644 --- a/reactos/dll/ntdll/CMakeLists.txt +++ b/reactos/dll/ntdll/CMakeLists.txt @@ -42,7 +42,7 @@ add_library(ntdll SHARED def/ntdll.rc ${CMAKE_CURRENT_BINARY_DIR}/ntdll.def) -set_module_type(ntdll win32dll ENTRYPOINT 0) +set_module_type(ntdll win32dll HOTPATCHABLE ENTRYPOINT 0) ############################################# ## HACK FOR MSVC COMPILATION WITH win32dll ## set_subsystem(ntdll console) diff --git a/reactos/dll/ntdll/ldr/ldrapi.c b/reactos/dll/ntdll/ldr/ldrapi.c index a7b25f032d4..a6af75f230e 100644 --- a/reactos/dll/ntdll/ldr/ldrapi.c +++ b/reactos/dll/ntdll/ldr/ldrapi.c @@ -307,6 +307,7 @@ LdrLockLoaderLock(IN ULONG Flags, */ NTSTATUS NTAPI +DECLSPEC_HOTPATCH LdrLoadDll(IN PWSTR SearchPath OPTIONAL, IN PULONG DllCharacteristics OPTIONAL, IN PUNICODE_STRING DllName, From 1116c00fa258bed0dde3d531de07480b7a3a9baa Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 5 Mar 2014 12:12:05 +0000 Subject: [PATCH 062/419] [SHELL32] * Mark as hotpatchable. CORE-7959 svn path=/trunk/; revision=62428 --- reactos/dll/win32/shell32/CMakeLists.txt | 2 +- reactos/dll/win32/shell32/shlexec.cpp | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/reactos/dll/win32/shell32/CMakeLists.txt b/reactos/dll/win32/shell32/CMakeLists.txt index f0c920e3409..89c5417e74c 100644 --- a/reactos/dll/win32/shell32/CMakeLists.txt +++ b/reactos/dll/win32/shell32/CMakeLists.txt @@ -80,7 +80,7 @@ add_library(shell32 SHARED ${CMAKE_CURRENT_BINARY_DIR}/shell32_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/shell32.def) -set_module_type(shell32 win32dll UNICODE) +set_module_type(shell32 win32dll UNICODE HOTPATCHABLE) target_link_libraries(shell32 atlnew diff --git a/reactos/dll/win32/shell32/shlexec.cpp b/reactos/dll/win32/shell32/shlexec.cpp index cbfcabe7aff..a2707112b1e 100644 --- a/reactos/dll/win32/shell32/shlexec.cpp +++ b/reactos/dll/win32/shell32/shlexec.cpp @@ -2025,7 +2025,10 @@ HINSTANCE WINAPI ShellExecuteA(HWND hWnd, LPCSTR lpOperation, LPCSTR lpFile, * ShellExecuteExA [SHELL32.292] * */ -BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA sei) +BOOL +WINAPI +DECLSPEC_HOTPATCH +ShellExecuteExA(LPSHELLEXECUTEINFOA sei) { SHELLEXECUTEINFOW seiW; BOOL ret; @@ -2072,7 +2075,10 @@ BOOL WINAPI ShellExecuteExA(LPSHELLEXECUTEINFOA sei) * ShellExecuteExW [SHELL32.293] * */ -BOOL WINAPI ShellExecuteExW(LPSHELLEXECUTEINFOW sei) +BOOL +WINAPI +DECLSPEC_HOTPATCH +ShellExecuteExW(LPSHELLEXECUTEINFOW sei) { return SHELL_execute(sei, SHELL_ExecuteW); } From ec1dcd341ec942e8d233211d3714216d0f06a2b9 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 5 Mar 2014 12:36:04 +0000 Subject: [PATCH 063/419] [USER32] * Mark some APIs as hotpatchable. CORE-7959 svn path=/trunk/; revision=62430 --- .../win32ss/user/user32/controls/scrollbar.c | 29 ++++++++++++++----- reactos/win32ss/user/user32/misc/stubs.c | 2 ++ reactos/win32ss/user/user32/windows/class.c | 1 + .../win32ss/user/user32/windows/cursoricon.c | 2 ++ reactos/win32ss/user/user32/windows/defwnd.c | 8 +++-- reactos/win32ss/user/user32/windows/input.c | 8 +++-- reactos/win32ss/user/user32/windows/message.c | 21 ++++++++++---- .../win32ss/user/user32/windows/nonclient.c | 8 +++-- reactos/win32ss/user/user32/windows/window.c | 20 +++++++++---- 9 files changed, 76 insertions(+), 23 deletions(-) diff --git a/reactos/win32ss/user/user32/controls/scrollbar.c b/reactos/win32ss/user/user32/controls/scrollbar.c index 7edd2226589..222ec43e2e0 100644 --- a/reactos/win32ss/user/user32/controls/scrollbar.c +++ b/reactos/win32ss/user/user32/controls/scrollbar.c @@ -1438,7 +1438,10 @@ ScrollBarWndProcA(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam) /* * @implemented */ -BOOL WINAPI EnableScrollBar( HWND hwnd, UINT nBar, UINT flags ) +BOOL +WINAPI +DECLSPEC_HOTPATCH +EnableScrollBar( HWND hwnd, UINT nBar, UINT flags ) { BOOL Hook, Ret = FALSE; @@ -1499,7 +1502,9 @@ RealGetScrollInfo(HWND Wnd, INT SBType, LPSCROLLINFO Info) /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH GetScrollInfo(HWND Wnd, INT SBType, LPSCROLLINFO Info) { BOOL Hook, Ret = FALSE; @@ -1528,7 +1533,9 @@ GetScrollInfo(HWND Wnd, INT SBType, LPSCROLLINFO Info) /* * @implemented */ -INT WINAPI +INT +WINAPI +DECLSPEC_HOTPATCH GetScrollPos(HWND Wnd, INT Bar) { PWND pwnd; @@ -1563,7 +1570,9 @@ GetScrollPos(HWND Wnd, INT Bar) /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH GetScrollRange(HWND Wnd, int Bar, LPINT MinPos, LPINT MaxPos) { PWND pwnd; @@ -1615,7 +1624,9 @@ RealSetScrollInfo(HWND Wnd, int SBType, LPCSCROLLINFO Info, BOOL bRedraw) /* * @implemented */ -INT WINAPI +INT +WINAPI +DECLSPEC_HOTPATCH SetScrollInfo(HWND Wnd, int SBType, LPCSCROLLINFO Info, BOOL bRedraw) { BOOL Hook; @@ -1646,7 +1657,9 @@ SetScrollInfo(HWND Wnd, int SBType, LPCSCROLLINFO Info, BOOL bRedraw) /* * @implemented */ -INT WINAPI +INT +WINAPI +DECLSPEC_HOTPATCH SetScrollPos(HWND hWnd, INT nBar, INT nPos, BOOL bRedraw) { SCROLLINFO ScrollInfo; @@ -1661,7 +1674,9 @@ SetScrollPos(HWND hWnd, INT nBar, INT nPos, BOOL bRedraw) /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH SetScrollRange(HWND hWnd, INT nBar, INT nMinPos, INT nMaxPos, BOOL bRedraw) { PWND pWnd; diff --git a/reactos/win32ss/user/user32/misc/stubs.c b/reactos/win32ss/user/user32/misc/stubs.c index d349de50d70..aa445c91b12 100644 --- a/reactos/win32ss/user/user32/misc/stubs.c +++ b/reactos/win32ss/user/user32/misc/stubs.c @@ -297,6 +297,7 @@ DefRawInputProc( */ UINT WINAPI +DECLSPEC_HOTPATCH GetRawInputBuffer( PRAWINPUT pData, PUINT pcbSize, @@ -359,6 +360,7 @@ GetRegisteredRawInputDevices( */ BOOL WINAPI +DECLSPEC_HOTPATCH RegisterRawInputDevices( PCRAWINPUTDEVICE pRawInputDevices, UINT uiNumDevices, diff --git a/reactos/win32ss/user/user32/windows/class.c b/reactos/win32ss/user/user32/windows/class.c index 4a5e6b31f63..00d84cfa5b2 100644 --- a/reactos/win32ss/user/user32/windows/class.c +++ b/reactos/win32ss/user/user32/windows/class.c @@ -1832,6 +1832,7 @@ SetWindowWord ( HWND hWnd,int nIndex,WORD wNewWord ) */ LONG WINAPI +DECLSPEC_HOTPATCH SetWindowLongA( HWND hWnd, int nIndex, diff --git a/reactos/win32ss/user/user32/windows/cursoricon.c b/reactos/win32ss/user/user32/windows/cursoricon.c index cfe5aa0dd43..150b56f714f 100644 --- a/reactos/win32ss/user/user32/windows/cursoricon.c +++ b/reactos/win32ss/user/user32/windows/cursoricon.c @@ -2112,6 +2112,7 @@ CursorIconToCursor(HICON hIcon, */ BOOL WINAPI +DECLSPEC_HOTPATCH SetCursorPos(int X, int Y) { return NtUserxSetCursorPos(X,Y); @@ -2122,6 +2123,7 @@ SetCursorPos(int X, int Y) */ BOOL WINAPI +DECLSPEC_HOTPATCH GetCursorPos(LPPOINT lpPoint) { BOOL res; diff --git a/reactos/win32ss/user/user32/windows/defwnd.c b/reactos/win32ss/user/user32/windows/defwnd.c index e6d2e1bbba7..b15d15ba3ce 100644 --- a/reactos/win32ss/user/user32/windows/defwnd.c +++ b/reactos/win32ss/user/user32/windows/defwnd.c @@ -36,7 +36,9 @@ static short iMenuSysKey = 0; /* * @implemented */ -DWORD WINAPI +DWORD +WINAPI +DECLSPEC_HOTPATCH GetSysColor(int nIndex) { if(nIndex >= 0 && nIndex < NUM_SYSCOLORS) @@ -51,7 +53,9 @@ GetSysColor(int nIndex) /* * @implemented */ -HBRUSH WINAPI +HBRUSH +WINAPI +DECLSPEC_HOTPATCH GetSysColorBrush(int nIndex) { if(nIndex >= 0 && nIndex < NUM_SYSCOLORS) diff --git a/reactos/win32ss/user/user32/windows/input.c b/reactos/win32ss/user/user32/windows/input.c index 3e50a2901ce..78bfb670970 100644 --- a/reactos/win32ss/user/user32/windows/input.c +++ b/reactos/win32ss/user/user32/windows/input.c @@ -114,7 +114,9 @@ EnableWindow(HWND hWnd, BOOL bEnable) /* * @implemented */ -SHORT WINAPI +SHORT +WINAPI +DECLSPEC_HOTPATCH GetAsyncKeyState(int vKey) { if (vKey < 0 || vKey > 256) @@ -185,7 +187,9 @@ GetKeyNameTextW(LONG lParam, /* * @implemented */ -SHORT WINAPI +SHORT +WINAPI +DECLSPEC_HOTPATCH GetKeyState(int nVirtKey) { return (SHORT)NtUserGetKeyState((DWORD)nVirtKey); diff --git a/reactos/win32ss/user/user32/windows/message.c b/reactos/win32ss/user/user32/windows/message.c index 7e0f0b25784..afd066e1eff 100644 --- a/reactos/win32ss/user/user32/windows/message.c +++ b/reactos/win32ss/user/user32/windows/message.c @@ -1908,7 +1908,9 @@ CallWindowProcW(WNDPROC lpPrevWndFunc, /* * @implemented */ -LRESULT WINAPI +LRESULT +WINAPI +DECLSPEC_HOTPATCH DispatchMessageA(CONST MSG *lpmsg) { LRESULT Ret = 0; @@ -2000,7 +2002,9 @@ DispatchMessageA(CONST MSG *lpmsg) /* * @implemented */ -LRESULT WINAPI +LRESULT +WINAPI +DECLSPEC_HOTPATCH DispatchMessageW(CONST MSG *lpmsg) { LRESULT Ret = 0; @@ -2100,7 +2104,9 @@ IntConvertMsgToAnsi(LPMSG lpMsg) /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, @@ -2128,7 +2134,9 @@ GetMessageA(LPMSG lpMsg, /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH GetMessageW(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, @@ -2191,7 +2199,9 @@ PeekMessageWorker( PMSG pMsg, /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, @@ -2217,6 +2227,7 @@ PeekMessageA(LPMSG lpMsg, */ BOOL WINAPI +DECLSPEC_HOTPATCH PeekMessageW( LPMSG lpMsg, HWND hWnd, diff --git a/reactos/win32ss/user/user32/windows/nonclient.c b/reactos/win32ss/user/user32/windows/nonclient.c index 1f8803a4aa5..890bc2af5e3 100644 --- a/reactos/win32ss/user/user32/windows/nonclient.c +++ b/reactos/win32ss/user/user32/windows/nonclient.c @@ -1233,7 +1233,9 @@ RealAdjustWindowRectEx(LPRECT lpRect, /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH AdjustWindowRectEx(LPRECT lpRect, DWORD dwStyle, BOOL bMenu, @@ -1266,7 +1268,9 @@ AdjustWindowRectEx(LPRECT lpRect, /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH AdjustWindowRect(LPRECT lpRect, DWORD dwStyle, BOOL bMenu) diff --git a/reactos/win32ss/user/user32/windows/window.c b/reactos/win32ss/user/user32/windows/window.c index 1b479294e4b..452237951ee 100644 --- a/reactos/win32ss/user/user32/windows/window.c +++ b/reactos/win32ss/user/user32/windows/window.c @@ -322,7 +322,9 @@ cleanup: /* * @implemented */ -HWND WINAPI +HWND +WINAPI +DECLSPEC_HOTPATCH CreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, @@ -445,7 +447,9 @@ CreateWindowExA(DWORD dwExStyle, /* * @implemented */ -HWND WINAPI +HWND +WINAPI +DECLSPEC_HOTPATCH CreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassName, LPCWSTR lpWindowName, @@ -1143,7 +1147,9 @@ GetTopWindow(HWND hWnd) /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH GetWindowInfo(HWND hWnd, PWINDOWINFO pwi) { @@ -1636,7 +1642,9 @@ return NtUserCallOneParam( (DWORD_PTR)dwDefaultLayout, ONEPARAM_ROUTINE_SETPROCD /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH SetWindowTextA(HWND hWnd, LPCSTR lpString) { @@ -1659,7 +1667,9 @@ SetWindowTextA(HWND hWnd, /* * @implemented */ -BOOL WINAPI +BOOL +WINAPI +DECLSPEC_HOTPATCH SetWindowTextW(HWND hWnd, LPCWSTR lpString) { From eb5a260b2e08688d3f26ee71a8349e100c1317c8 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 5 Mar 2014 12:46:34 +0000 Subject: [PATCH 064/419] [WINMM] * Mark as hotpatchable. CORE-7959 svn path=/trunk/; revision=62431 --- reactos/dll/win32/winmm/CMakeLists.txt | 2 +- reactos/dll/win32/winmm/joystick.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/dll/win32/winmm/CMakeLists.txt b/reactos/dll/win32/winmm/CMakeLists.txt index 2394e2c9eac..507427c6829 100644 --- a/reactos/dll/win32/winmm/CMakeLists.txt +++ b/reactos/dll/win32/winmm/CMakeLists.txt @@ -22,7 +22,7 @@ add_library(winmm SHARED winmm_res.rc ${CMAKE_CURRENT_BINARY_DIR}/winmm.def) -set_module_type(winmm win32dll) +set_module_type(winmm win32dll HOTPATCHABLE) target_link_libraries(winmm wine ${PSEH_LIB}) add_importlibs(winmm advapi32 user32 msvcrt kernel32 ntdll) add_pch(winmm winemm.h SOURCE) diff --git a/reactos/dll/win32/winmm/joystick.c b/reactos/dll/win32/winmm/joystick.c index e8232ceed71..ed6054bfbf7 100644 --- a/reactos/dll/win32/winmm/joystick.c +++ b/reactos/dll/win32/winmm/joystick.c @@ -123,7 +123,7 @@ MMRESULT WINAPI joyConfigChanged(DWORD flags) /************************************************************************** * joyGetNumDevs [WINMM.@] */ -UINT WINAPI joyGetNumDevs(void) +UINT WINAPI DECLSPEC_HOTPATCH joyGetNumDevs(void) { UINT ret = 0; int i; @@ -139,7 +139,7 @@ UINT WINAPI joyGetNumDevs(void) /************************************************************************** * joyGetDevCapsW [WINMM.@] */ -MMRESULT WINAPI joyGetDevCapsW(UINT_PTR wID, LPJOYCAPSW lpCaps, UINT wSize) +MMRESULT WINAPI DECLSPEC_HOTPATCH joyGetDevCapsW(UINT_PTR wID, LPJOYCAPSW lpCaps, UINT wSize) { if (wID >= MAXJOYSTICK) return JOYERR_PARMS; if (!JOY_LoadDriver(wID)) return MMSYSERR_NODRIVER; @@ -153,7 +153,7 @@ MMRESULT WINAPI joyGetDevCapsW(UINT_PTR wID, LPJOYCAPSW lpCaps, UINT wSize) /************************************************************************** * joyGetDevCapsA [WINMM.@] */ -MMRESULT WINAPI joyGetDevCapsA(UINT_PTR wID, LPJOYCAPSA lpCaps, UINT wSize) +MMRESULT WINAPI DECLSPEC_HOTPATCH joyGetDevCapsA(UINT_PTR wID, LPJOYCAPSA lpCaps, UINT wSize) { JOYCAPSW jcw; MMRESULT ret; @@ -202,7 +202,7 @@ MMRESULT WINAPI joyGetDevCapsA(UINT_PTR wID, LPJOYCAPSA lpCaps, UINT wSize) /************************************************************************** * joyGetPosEx [WINMM.@] */ -MMRESULT WINAPI joyGetPosEx(UINT wID, LPJOYINFOEX lpInfo) +MMRESULT WINAPI DECLSPEC_HOTPATCH joyGetPosEx(UINT wID, LPJOYINFOEX lpInfo) { TRACE("(%d, %p);\n", wID, lpInfo); From ce66ff505682ee7cbd160cabc126fe3d94adb8cb Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 5 Mar 2014 14:31:26 +0000 Subject: [PATCH 065/419] [XINPUT1_3] * Mark as hotpatchable. CORE-7959 svn path=/trunk/; revision=62434 --- reactos/dll/win32/xinput1_3/CMakeLists.txt | 2 +- reactos/dll/win32/xinput1_3/xinput1_3_main.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/xinput1_3/CMakeLists.txt b/reactos/dll/win32/xinput1_3/CMakeLists.txt index 6ec93c2284f..4dd157bc34a 100644 --- a/reactos/dll/win32/xinput1_3/CMakeLists.txt +++ b/reactos/dll/win32/xinput1_3/CMakeLists.txt @@ -8,7 +8,7 @@ list(APPEND SOURCE ${CMAKE_CURRENT_BINARY_DIR}/xinput1_3.def) add_library(xinput1_3 SHARED ${SOURCE} version.rc) -set_module_type(xinput1_3 win32dll) +set_module_type(xinput1_3 win32dll HOTPATCHABLE) target_link_libraries(xinput1_3 wine) add_importlibs(xinput1_3 msvcrt kernel32 ntdll) add_cd_file(TARGET xinput1_3 DESTINATION reactos/system32 FOR all) diff --git a/reactos/dll/win32/xinput1_3/xinput1_3_main.c b/reactos/dll/win32/xinput1_3/xinput1_3_main.c index fa31d0f0194..c8595e2a69f 100644 --- a/reactos/dll/win32/xinput1_3/xinput1_3_main.c +++ b/reactos/dll/win32/xinput1_3/xinput1_3_main.c @@ -65,7 +65,7 @@ DWORD WINAPI XInputSetState(DWORD dwUserIndex, XINPUT_VIBRATION* pVibration) return ERROR_BAD_ARGUMENTS; } -DWORD WINAPI XInputGetState(DWORD dwUserIndex, XINPUT_STATE* pState) +DWORD WINAPI DECLSPEC_HOTPATCH XInputGetState(DWORD dwUserIndex, XINPUT_STATE* pState) { static int warn_once; From 623048035a2cde733481f45fcafa6b092304461e Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 7 Mar 2014 19:33:38 +0000 Subject: [PATCH 066/419] [NTOSKRNL] - Implement FsRtlNotifyFilterReportChange - Implement FsRtlNotifyUpdateBuffer - Implement FsRtlCancelNotify - Implement FsRtlNotifyGetLastPartOffset - Fix implementation of FsRtlNotifyFilterChangeDirectory This finishes the implementation of file system notifications inside the kernel. Data are properly returned to the caller on changes. CORE-2582 svn path=/trunk/; revision=62442 --- reactos/ntoskrnl/fsrtl/notify.c | 777 ++++++++++++++++++++-- reactos/ntoskrnl/include/internal/fsrtl.h | 4 +- 2 files changed, 730 insertions(+), 51 deletions(-) diff --git a/reactos/ntoskrnl/fsrtl/notify.c b/reactos/ntoskrnl/fsrtl/notify.c index f70a598902a..6c4be5b4d07 100644 --- a/reactos/ntoskrnl/fsrtl/notify.c +++ b/reactos/ntoskrnl/fsrtl/notify.c @@ -12,6 +12,55 @@ #define NDEBUG #include +/* INLINED FUNCTIONS *********************************************************/ + +/* + * @implemented + */ +FORCEINLINE +VOID +FsRtlNotifyAcquireFastMutex(IN PREAL_NOTIFY_SYNC RealNotifySync) +{ + ULONG_PTR CurrentThread = (ULONG_PTR)KeGetCurrentThread(); + + /* Only acquire fast mutex if it's not already acquired by the current thread */ + if (RealNotifySync->OwningThread != CurrentThread) + { + ExAcquireFastMutexUnsafe(&(RealNotifySync->FastMutex)); + RealNotifySync->OwningThread = CurrentThread; + } + /* Whatever the case, keep trace of the attempt to acquire fast mutex */ + RealNotifySync->OwnerCount++; +} + +/* + * @implemented + */ +FORCEINLINE +VOID +FsRtlNotifyReleaseFastMutex(IN PREAL_NOTIFY_SYNC RealNotifySync) +{ + RealNotifySync->OwnerCount--; + /* Release the fast mutex only if no other instance needs it */ + if (!RealNotifySync->OwnerCount) + { + ExReleaseFastMutexUnsafe(&(RealNotifySync->FastMutex)); + RealNotifySync->OwningThread = (ULONG_PTR)0; + } +} + +#define FsRtlNotifyGetLastPartOffset(FullLen, TargLen, Type, Chr) \ + for (FullPosition = 0; FullPosition < FullLen; ++FullPosition) \ + if (((Type)NotifyChange->FullDirectoryName->Buffer)[FullPosition] == Chr) \ + ++FullNumberOfParts; \ + for (LastPartOffset = 0; LastPartOffset < TargLen; ++LastPartOffset) { \ + if ( ((Type)TargetDirectory.Buffer)[LastPartOffset] == Chr) { \ + ++TargetNumberOfParts; \ + if (TargetNumberOfParts == FullNumberOfParts) \ + break; \ + } \ + } + /* PRIVATE FUNCTIONS *********************************************************/ VOID @@ -22,13 +71,161 @@ BOOLEAN FsRtlNotifySetCancelRoutine(IN PIRP Irp, IN PNOTIFY_CHANGE NotifyChange OPTIONAL); +/* + * @implemented + */ VOID NTAPI FsRtlCancelNotify(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { + PVOID Buffer; + PIRP NotifyIrp; + ULONG BufferLength; + PIO_STACK_LOCATION Stack; + PNOTIFY_CHANGE NotifyChange; + PREAL_NOTIFY_SYNC RealNotifySync; + PSECURITY_SUBJECT_CONTEXT SubjectContext = NULL; + + /* Get the NOTIFY_CHANGE struct and reset it */ + NotifyChange = (PNOTIFY_CHANGE)Irp->IoStatus.Information; + Irp->IoStatus.Information = 0; + /* Reset the cancel routine */ + IoSetCancelRoutine(Irp, NULL); + /* And release lock */ IoReleaseCancelSpinLock(Irp->CancelIrql); - UNIMPLEMENTED; + /* Get REAL_NOTIFY_SYNC struct */ + RealNotifySync = NotifyChange->NotifySync; + + FsRtlNotifyAcquireFastMutex(RealNotifySync); + + _SEH2_TRY + { + /* Remove the IRP from the notifications list and mark it pending */ + RemoveEntryList(&(Irp->Tail.Overlay.ListEntry)); + IoMarkIrpPending(Irp); + + /* Now, the tricky part - let's find a buffer big enough to hold the return data */ + if (NotifyChange->Buffer && NotifyChange->AllocatedBuffer == NULL && + ((Irp->MdlAddress && MmGetSystemAddressForMdl(Irp->MdlAddress) == NotifyChange->Buffer) || + NotifyChange->Buffer == Irp->AssociatedIrp.SystemBuffer)) + { + /* Assume we didn't find any */ + Buffer = NULL; + BufferLength = 0; + + /* If we don't have IRPs, check if current buffer is big enough */ + if (IsListEmpty(&NotifyChange->NotifyIrps)) + { + if (NotifyChange->BufferLength >= NotifyChange->DataLength) + { + BufferLength = NotifyChange->BufferLength; + } + } + else + { + /* Otherwise, try to look at next IRP available */ + NotifyIrp = CONTAINING_RECORD(NotifyChange->NotifyIrps.Flink, IRP, Tail.Overlay.ListEntry); + Stack = IoGetCurrentIrpStackLocation(NotifyIrp); + + /* If its buffer is big enough, get it */ + if (Stack->Parameters.NotifyDirectory.Length >= NotifyChange->BufferLength) + { + /* Is it MDL? */ + if (NotifyIrp->AssociatedIrp.SystemBuffer == NULL) + { + if (NotifyIrp->MdlAddress != NULL) + { + Buffer = MmGetSystemAddressForMdl(NotifyIrp->MdlAddress); + } + } + else + { + Buffer = NotifyIrp->AssociatedIrp.MasterIrp; + } + + /* Backup our accepted buffer length */ + BufferLength = Stack->Parameters.NotifyDirectory.Length; + if (BufferLength > NotifyChange->BufferLength) + { + BufferLength = NotifyChange->BufferLength; + } + } + } + + /* At that point, we *may* have a buffer */ + + /* If it has null length, then note that we won't use it */ + if (BufferLength == 0) + { + NotifyChange->Flags |= NOTIFY_IMMEDIATELY; + } + else + { + /* If we have a buffer length, but no buffer then allocate one */ + if (Buffer == NULL) + { + PsChargePoolQuota(NotifyChange->OwningProcess, PagedPool, BufferLength); + Buffer = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, BufferLength, 'NrSF'); + NotifyChange->AllocatedBuffer = Buffer; + } + + /* Copy data in that buffer */ + RtlCopyMemory(Buffer, NotifyChange->Buffer, NotifyChange->DataLength); + NotifyChange->ThisBufferLength = BufferLength; + NotifyChange->Buffer = Buffer; + } + + /* If we don't have valide buffer, ensure everything is 0-ed out */ + if (NotifyChange->Flags & NOTIFY_IMMEDIATELY) + { + NotifyChange->Buffer = 0; + NotifyChange->AllocatedBuffer = 0; + NotifyChange->LastEntry = 0; + NotifyChange->DataLength = 0; + NotifyChange->ThisBufferLength = 0; + } + } + + /* It's now time to complete - data are ready */ + + /* Set appropriate status and complete */ + Irp->IoStatus.Status = STATUS_CANCELLED; + IofCompleteRequest(Irp, EVENT_INCREMENT); + + /* If that notification isn't referenced any longer, drop it */ + if (!InterlockedDecrement((PLONG)&(NotifyChange->ReferenceCount))) + { + /* If it had an allocated buffer, delete */ + if (NotifyChange->AllocatedBuffer) + { + PsReturnProcessPagedPoolQuota(NotifyChange->OwningProcess, NotifyChange->ThisBufferLength); + ExFreePoolWithTag(NotifyChange->AllocatedBuffer, 'NrSF'); + } + + /* In case of full name, remember subject context for later deletion */ + if (NotifyChange->FullDirectoryName) + { + SubjectContext = NotifyChange->SubjectContext; + } + + /* We mustn't have ANY change left anymore */ + ASSERT(NotifyChange->NotifyList.Flink == NULL); + ExFreePoolWithTag(NotifyChange, 0); + } + } + _SEH2_FINALLY + { + FsRtlNotifyReleaseFastMutex(RealNotifySync); + + /* If the subject security context was captured, release and free it */ + if (SubjectContext) + { + SeReleaseSubjectContext(SubjectContext); + ExFreePool(SubjectContext); + } + } + _SEH2_END; } /* @@ -58,6 +255,9 @@ FsRtlCheckNotifyForDelete(IN PLIST_ENTRY NotifyList, } } +/* + *@implemented + */ PNOTIFY_CHANGE FsRtlIsNotifyOnList(IN PLIST_ENTRY NotifyList, IN PVOID FsContext) @@ -83,22 +283,6 @@ FsRtlIsNotifyOnList(IN PLIST_ENTRY NotifyList, return NULL; } -FORCEINLINE -VOID -FsRtlNotifyAcquireFastMutex(IN PREAL_NOTIFY_SYNC RealNotifySync) -{ - ULONG_PTR CurrentThread = (ULONG_PTR)KeGetCurrentThread(); - - /* Only acquire fast mutex if it's not already acquired by the current thread */ - if (RealNotifySync->OwningThread != CurrentThread) - { - ExAcquireFastMutexUnsafe(&(RealNotifySync->FastMutex)); - RealNotifySync->OwningThread = CurrentThread; - } - /* Whatever the case, keep trace of the attempt to acquire fast mutex */ - RealNotifySync->OwnerCount++; -} - /* * @implemented */ @@ -216,7 +400,7 @@ FsRtlNotifyCompleteIrpList(IN PNOTIFY_CHANGE NotifyChange, DataLength = NotifyChange->DataLength; - NotifyChange->Flags &= (INVALIDATE_BUFFERS | WATCH_TREE); + NotifyChange->Flags &= (NOTIFY_IMMEDIATELY | WATCH_TREE); NotifyChange->DataLength = 0; NotifyChange->LastEntry = 0; @@ -233,19 +417,6 @@ FsRtlNotifyCompleteIrpList(IN PNOTIFY_CHANGE NotifyChange, } } -FORCEINLINE -VOID -FsRtlNotifyReleaseFastMutex(IN PREAL_NOTIFY_SYNC RealNotifySync) -{ - RealNotifySync->OwnerCount--; - /* Release the fast mutex only if no other instance needs it */ - if (!RealNotifySync->OwnerCount) - { - ExReleaseFastMutexUnsafe(&(RealNotifySync->FastMutex)); - RealNotifySync->OwningThread = (ULONG_PTR)0; - } -} - /* * @implemented */ @@ -295,6 +466,91 @@ FsRtlNotifySetCancelRoutine(IN PIRP Irp, return FALSE; } +/* + * @implemented + */ +BOOLEAN +FsRtlNotifyUpdateBuffer(OUT PFILE_NOTIFY_INFORMATION OutputBuffer, + IN ULONG Action, + IN PSTRING ParentName, + IN PSTRING TargetName, + IN PSTRING StreamName, + IN BOOLEAN IsUnicode, + IN ULONG DataLength) +{ + /* Unless there's an issue with buffers, there's no reason to fail */ + BOOLEAN Succeed = TRUE; + ULONG AlreadyWritten = 0, ResultSize; + + PAGED_CODE(); + + /* Update user buffer with the change that occured + * First copy parent name if any + * Then copy target name, there's always one + * And finally, copy stream name if any + * If these names aren't unicode, then convert first + */ + _SEH2_TRY + { + OutputBuffer->NextEntryOffset = 0; + OutputBuffer->Action = Action; + OutputBuffer->FileNameLength = DataLength - sizeof(FILE_NOTIFY_INFORMATION); + if (IsUnicode) + { + if (ParentName->Length) + { + RtlCopyMemory(OutputBuffer->FileName, ParentName->Buffer, ParentName->Length); + OutputBuffer->FileName[ParentName->Length / sizeof(WCHAR)] = L'\\'; + AlreadyWritten = ParentName->Length + sizeof(WCHAR); + } + RtlCopyMemory(OutputBuffer->FileName + AlreadyWritten, TargetName->Buffer, TargetName->Length); + if (StreamName) + { + AlreadyWritten += TargetName->Length; + OutputBuffer->FileName[AlreadyWritten / sizeof(WCHAR)] = L':'; + RtlCopyMemory(OutputBuffer->FileName + AlreadyWritten + sizeof(WCHAR), + StreamName->Buffer, StreamName->Length); + } + } + else + { + if (!ParentName->Length) + { + ASSERT(StreamName); + RtlCopyMemory(OutputBuffer->FileName, StreamName->Buffer, StreamName->Length); + } + else + { + RtlOemToUnicodeN(OutputBuffer->FileName, OutputBuffer->FileNameLength, + &ResultSize, ParentName->Buffer, + ParentName->Length); + OutputBuffer->FileName[ResultSize / sizeof(WCHAR)] = L'\\'; + AlreadyWritten = ResultSize + sizeof(WCHAR); + + RtlOemToUnicodeN(OutputBuffer->FileName + AlreadyWritten, + OutputBuffer->FileNameLength, &ResultSize, + TargetName->Buffer, TargetName->Length); + + if (StreamName) + { + AlreadyWritten += ResultSize; + OutputBuffer->FileName[AlreadyWritten / sizeof(WCHAR)] = L':'; + RtlOemToUnicodeN(OutputBuffer->FileName + AlreadyWritten + sizeof(WCHAR), + OutputBuffer->FileNameLength, &ResultSize, + StreamName->Buffer, StreamName->Length); + } + } + } + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Succeed = FALSE; + } + _SEH2_END; + + return Succeed; +} + /* PUBLIC FUNCTIONS **********************************************************/ /*++ @@ -445,7 +701,7 @@ FsRtlNotifyCleanup(IN PNOTIFY_SYNC NotifySync, /*++ * @name FsRtlNotifyFilterChangeDirectory - * @unimplemented + * @implemented * * FILLME * @@ -559,16 +815,16 @@ FsRtlNotifyFilterChangeDirectory(IN PNOTIFY_SYNC NotifySync, NotifyIrp->IoStatus.Status = STATUS_DELETE_PENDING; IoCompleteRequest(NotifyIrp, EVENT_INCREMENT); } - /* Complete if there is directory enumeration and no buffer available any more */ - if ((NotifyChange->Flags & INVALIDATE_BUFFERS) && (NotifyChange->Flags & ENUMERATE_DIR)) + /* Complete now if asked to (and not asked to notify later on) */ + if ((NotifyChange->Flags & NOTIFY_IMMEDIATELY) && !(NotifyChange->Flags & NOTIFY_LATER)) { - NotifyChange->Flags &= ~INVALIDATE_BUFFERS; + NotifyChange->Flags &= ~NOTIFY_IMMEDIATELY; IoMarkIrpPending(NotifyIrp); NotifyIrp->IoStatus.Status = STATUS_NOTIFY_ENUM_DIR; IoCompleteRequest(NotifyIrp, EVENT_INCREMENT); } - /* If no data yet, or directory enumeration, handle */ - else if (NotifyChange->DataLength == 0 || (NotifyChange->Flags & ENUMERATE_DIR)) + /* If no data yet, or asked to notify later on, handle */ + else if (NotifyChange->DataLength == 0 || (NotifyChange->Flags & NOTIFY_LATER)) { goto HandleIRP; } @@ -612,20 +868,13 @@ FsRtlNotifyFilterChangeDirectory(IN PNOTIFY_SYNC NotifySync, else { /* If it can't contain WCHAR, it's ANSI */ - if (FullDirectoryName->Length < sizeof(WCHAR)) + if (FullDirectoryName->Length < sizeof(WCHAR) || ((CHAR*)FullDirectoryName->Buffer)[1] != 0) { NotifyChange->CharacterSize = sizeof(CHAR); } - /* First char is \, so in unicode, right part is 0 - * whereas in ANSI it contains next char - */ - else if (((CHAR*)FullDirectoryName->Buffer)[1] == 0) - { - NotifyChange->CharacterSize = sizeof(WCHAR); - } else { - NotifyChange->CharacterSize = sizeof(CHAR); + NotifyChange->CharacterSize = sizeof(WCHAR); } /* Now, check is user is willing to watch root */ @@ -668,7 +917,7 @@ HandleIRP: FsRtlNotifyReleaseFastMutex(RealNotifySync); /* If the subject security context was captured and there's no notify */ - if (SubjectContext && (!NotifyChange || FullDirectoryName)) + if (SubjectContext && (!NotifyChange || NotifyChange->FullDirectoryName)) { SeReleaseSubjectContext(SubjectContext); ExFreePool(SubjectContext); @@ -679,7 +928,7 @@ HandleIRP: /*++ * @name FsRtlNotifyFilterReportChange - * @unimplemented + * @implemented * * FILLME * @@ -731,7 +980,437 @@ FsRtlNotifyFilterReportChange(IN PNOTIFY_SYNC NotifySync, IN PVOID TargetContext, IN PVOID FilterContext) { - KeBugCheck(FILE_SYSTEM); + PIRP Irp; + PVOID OutputBuffer; + USHORT FullPosition; + PLIST_ENTRY NextEntry; + PIO_STACK_LOCATION Stack; + PNOTIFY_CHANGE NotifyChange; + PREAL_NOTIFY_SYNC RealNotifySync; + PFILE_NOTIFY_INFORMATION FileNotifyInfo; + BOOLEAN IsStream, IsParent, PoolQuotaCharged; + STRING TargetDirectory, TargetName, ParentName, IntNormalizedParentName; + ULONG NumberOfBytes, TargetNumberOfParts, FullNumberOfParts, LastPartOffset, ParentNameOffset, ParentNameLength; + ULONG DataLength, TargetNameLength, AlignedDataLength; + + TargetDirectory.Length = 0; + TargetDirectory.MaximumLength = 0; + TargetDirectory.Buffer = NULL; + TargetName.Length = 0; + TargetName.MaximumLength = 0; + TargetName.Buffer = NULL; + ParentName.Length = 0; + ParentName.MaximumLength = 0; + ParentName.Buffer = NULL; + IsStream = FALSE; + + PAGED_CODE(); + + DPRINT("FsRtlNotifyFilterReportChange(%p, %p, %p, %u, %p, %p, %p, %x, %x, %p, %p)\n", + NotifySync, NotifyList, FullTargetName, TargetNameOffset, StreamName, NormalizedParentName, + FilterMatch, Action, TargetContext, FilterContext); + + /* We need offset in name */ + if (!TargetNameOffset && FullTargetName) + { + return; + } + + /* Get real structure hidden behind the opaque pointer */ + RealNotifySync = (PREAL_NOTIFY_SYNC)NotifySync; + /* Acquire lock - will be released in finally block */ + FsRtlNotifyAcquireFastMutex(RealNotifySync); + _SEH2_TRY + { + /* Browse all the registered notifications we have */ + for (NextEntry = NotifyList->Flink; NextEntry != NotifyList; + NextEntry = NextEntry->Flink) + { + /* Try to find an entry matching our change */ + NotifyChange = CONTAINING_RECORD(NextEntry, NOTIFY_CHANGE, NotifyList); + if (FullTargetName != NULL) + { + ASSERT(NotifyChange->FullDirectoryName != NULL); + if (!NotifyChange->FullDirectoryName->Length) + { + continue; + } + + if (!(FilterMatch & NotifyChange->CompletionFilter)) + { + continue; + } + + /* If no normalized name provided, construct it from full target name */ + if (NormalizedParentName == NULL) + { + IntNormalizedParentName.Buffer = FullTargetName->Buffer; + if (TargetNameOffset != NotifyChange->CharacterSize) + { + IntNormalizedParentName.MaximumLength = + IntNormalizedParentName.Length = TargetNameOffset - NotifyChange->CharacterSize; + } + else + { + IntNormalizedParentName.MaximumLength = + IntNormalizedParentName.Length = TargetNameOffset; + } + NormalizedParentName = &IntNormalizedParentName; + } + + /* heh? Watched directory bigger than changed file? */ + if (NormalizedParentName->Length < NotifyChange->FullDirectoryName->Length) + { + continue; + } + + /* Same len => parent */ + if (NormalizedParentName->Length == NotifyChange->FullDirectoryName->Length) + { + IsParent = TRUE; + } + /* If not, then, we have to be watching the tree, otherwise we don't have to report such changes */ + else if (!(NotifyChange->Flags & WATCH_TREE)) + { + continue; + } + /* And finally, we've to check we're properly \-terminated */ + else + { + if (!(NotifyChange->Flags & WATCH_ROOT)) + { + if (NotifyChange->CharacterSize == sizeof(CHAR)) + { + if (((PSTR)NormalizedParentName->Buffer)[NotifyChange->FullDirectoryName->Length] != '\\') + { + continue; + } + } + else + { + if (((PWSTR)NormalizedParentName->Buffer)[NotifyChange->FullDirectoryName->Length / sizeof (WCHAR)] != L'\\') + { + continue; + } + } + } + + IsParent = FALSE; + } + + /* If len matches, then check that both name are equal */ + if (!RtlEqualMemory(NormalizedParentName->Buffer, NotifyChange->FullDirectoryName->Buffer, + NotifyChange->FullDirectoryName->Length)) + { + continue; + } + + /* Call traverse callback (only if we have to traverse ;-)) */ + if (!IsParent + && NotifyChange->TraverseCallback != NULL + && !NotifyChange->TraverseCallback(NotifyChange->FsContext, + TargetContext, + NotifyChange->SubjectContext)) + { + continue; + } + + /* And then, filter callback if provided */ + if (NotifyChange->FilterCallback != NULL + && FilterContext != NULL + && !NotifyChange->FilterCallback(NotifyChange->FsContext, FilterContext)) + { + continue; + } + } + /* We have a stream! */ + else + { + ASSERT(NotifyChange->FullDirectoryName == NULL); + if (TargetContext != NotifyChange->SubjectContext) + { + continue; + } + + ParentName.Buffer = NULL; + ParentName.Length = 0; + IsStream = TRUE; + IsParent = FALSE; + } + + /* If we don't have to notify immediately, prepare for output */ + if (!(NotifyChange->Flags & NOTIFY_IMMEDIATELY)) + { + /* If we have something to output... */ + if (NotifyChange->BufferLength) + { + /* Get size of the output */ + NumberOfBytes = 0; + Irp = NULL; + if (!NotifyChange->ThisBufferLength) + { + if (IsListEmpty(&NotifyChange->NotifyIrps)) + { + NumberOfBytes = NotifyChange->BufferLength; + } + else + { + Irp = CONTAINING_RECORD(NotifyChange->NotifyIrps.Flink, IRP, Tail.Overlay.ListEntry); + Stack = IoGetCurrentIrpStackLocation(Irp); + NumberOfBytes = Stack->Parameters.NotifyDirectory.Length; + } + } + else + { + NumberOfBytes = NotifyChange->ThisBufferLength; + } + + /* If we're matching parent, we don't care about parent (redundant) */ + if (IsParent) + { + ParentName.Length = 0; + } + else + { + /* If we don't deal with streams, some more work is required */ + if (!IsStream) + { + if (NotifyChange->Flags & WATCH_ROOT || + (NormalizedParentName->Buffer != FullTargetName->Buffer)) + { + /* Construct TargetDirectory if we don't have it yet */ + if (TargetDirectory.Buffer == NULL) + { + TargetDirectory.Buffer = FullTargetName->Buffer; + TargetDirectory.Length = TargetNameOffset; + if (TargetNameOffset != NotifyChange->CharacterSize) + { + TargetDirectory.Length = TargetNameOffset - NotifyChange->CharacterSize; + } + TargetDirectory.MaximumLength = TargetDirectory.Length; + } + /* Now, we start looking for matching parts (unless we watch root) */ + TargetNumberOfParts = 0; + if (!(NotifyChange->Flags & WATCH_ROOT)) + { + FullNumberOfParts = 1; + if (NotifyChange->CharacterSize == sizeof(CHAR)) + { + FsRtlNotifyGetLastPartOffset(NotifyChange->FullDirectoryName->Length, + TargetDirectory.Length, PSTR, '\\'); + } + else + { + FsRtlNotifyGetLastPartOffset(NotifyChange->FullDirectoryName->Length / sizeof(WCHAR), + TargetDirectory.Length / sizeof(WCHAR), PWSTR, L'\\'); + LastPartOffset *= NotifyChange->CharacterSize; + } + } + + /* Then, we can construct proper parent name */ + ParentNameOffset = NotifyChange->CharacterSize + LastPartOffset; + ParentName.Buffer = &TargetDirectory.Buffer[ParentNameOffset]; + ParentNameLength = TargetDirectory.Length; + } + else + { + /* Construct parent name even for streams */ + ParentName.Buffer = &NormalizedParentName->Buffer[NotifyChange->FullDirectoryName->Length] + NotifyChange->CharacterSize; + ParentNameLength = NormalizedParentName->Length - NotifyChange->FullDirectoryName->Length; + ParentNameOffset = NotifyChange->CharacterSize; + } + ParentNameLength -= ParentNameOffset; + ParentName.Length = ParentNameLength; + ParentName.MaximumLength = ParentNameLength; + } + } + + /* Start to count amount of data to write, we've first the structure itself */ + DataLength = FIELD_OFFSET(FILE_NOTIFY_INFORMATION, FileName); + + /* If stream, we'll just append stream name */ + if (IsStream) + { + ASSERT(StreamName != NULL); + DataLength += StreamName->Length; + } + else + { + /* If not parent, we've to append parent name */ + if (!IsParent) + { + if (NotifyChange->CharacterSize == sizeof(CHAR)) + { + DataLength += RtlOemStringToCountedUnicodeSize(&ParentName); + } + else + { + DataLength += ParentName.Length; + } + DataLength += sizeof(WCHAR); + } + + /* Look for target name & construct it, if required */ + if (TargetName.Buffer) + { + TargetNameLength = TargetName.Length; + } + else + { + TargetName.Buffer = &FullTargetName->Buffer[TargetNameOffset]; + TargetNameLength = FullTargetName->Length - TargetNameOffset; + TargetName.Length = TargetNameLength; + TargetName.MaximumLength = TargetNameLength; + } + + /* Then, we will append it as well */ + if (NotifyChange->CharacterSize == sizeof(CHAR)) + { + DataLength += RtlOemStringToCountedUnicodeSize(&TargetName); + } + else + { + DataLength += TargetName.Length; + } + + /* If we also had a stream name, then we can append it as well */ + if (StreamName != NULL) + { + if (NotifyChange->CharacterSize == sizeof(WCHAR)) + { + DataLength += StreamName->Length + sizeof(WCHAR); + } + else + { + DataLength = DataLength + RtlOemStringToCountedUnicodeSize(&TargetName) + sizeof(CHAR); + } + } + } + + /* Get the position where we can put our data (aligned!) */ + AlignedDataLength = ROUND_UP(NotifyChange->DataLength, sizeof(ULONG)); + /* If it's higher than buffer length, then, bail out without outputing */ + if (DataLength > NumberOfBytes || AlignedDataLength + DataLength > NumberOfBytes) + { + NotifyChange->Flags |= NOTIFY_IMMEDIATELY; + } + else + { + OutputBuffer = 0; + FileNotifyInfo = 0; + /* If we already had a buffer, update last entry position */ + if (NotifyChange->Buffer != NULL) + { + FileNotifyInfo = (PVOID)((ULONG_PTR)NotifyChange->Buffer + NotifyChange->LastEntry); + FileNotifyInfo->NextEntryOffset = AlignedDataLength - NotifyChange->LastEntry; + NotifyChange->LastEntry = AlignedDataLength; + /* And get our output buffer */ + OutputBuffer = (PVOID)((ULONG_PTR)NotifyChange->Buffer + AlignedDataLength); + } + /* If we hadn't buffer, try to find one */ + else if (Irp != NULL) + { + if (Irp->AssociatedIrp.SystemBuffer != NULL) + { + OutputBuffer = Irp->AssociatedIrp.SystemBuffer; + } + else if (Irp->MdlAddress != NULL) + { + OutputBuffer = MmGetSystemAddressForMdl(Irp->MdlAddress); + } + + NotifyChange->Buffer = OutputBuffer; + NotifyChange->ThisBufferLength = NumberOfBytes; + } + + /* If we couldn't find one, then allocate one */ + if (NotifyChange->Buffer == NULL) + { + PoolQuotaCharged = FALSE; + _SEH2_TRY + { + PsChargePoolQuota(NotifyChange->OwningProcess, PagedPool, NumberOfBytes); + PoolQuotaCharged = TRUE; + OutputBuffer = ExAllocatePoolWithTag(PagedPool | POOL_RAISE_IF_ALLOCATION_FAILURE, + NumberOfBytes, 'NrSF'); + NotifyChange->Buffer = OutputBuffer; + NotifyChange->AllocatedBuffer = OutputBuffer; + } + /* If something went wrong during allocation, notify immediately instead of outputing */ + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + if (PoolQuotaCharged) + { + PsReturnProcessPagedPoolQuota(NotifyChange->OwningProcess, NumberOfBytes); + } + NotifyChange->Flags |= NOTIFY_IMMEDIATELY; + } + _SEH2_END; + } + + /* Finally, if we have a buffer, fill it in! */ + if (OutputBuffer != NULL) + { + if (FsRtlNotifyUpdateBuffer((FILE_NOTIFY_INFORMATION *)OutputBuffer, + Action, &ParentName, &TargetName, + StreamName, NotifyChange->CharacterSize == sizeof(WCHAR), + DataLength)) + { + NotifyChange->DataLength = DataLength + AlignedDataLength; + } + /* If it failed, notify immediately */ + else + { + NotifyChange->Flags |= NOTIFY_IMMEDIATELY; + } + } + } + + /* If we have to notify right now (something went wrong?) */ + if (NotifyChange->Flags & NOTIFY_IMMEDIATELY) + { + /* Ensure that all our buffers are NULL */ + if (NotifyChange->Buffer != NULL) + { + if (NotifyChange->AllocatedBuffer != NULL) + { + PsReturnProcessPagedPoolQuota(NotifyChange->OwningProcess, NotifyChange->ThisBufferLength); + ExFreePoolWithTag(NotifyChange->AllocatedBuffer, 'NrSF'); + } + + NotifyChange->Buffer = NULL; + NotifyChange->AllocatedBuffer = NULL; + NotifyChange->LastEntry = 0; + NotifyChange->DataLength = 0; + NotifyChange->ThisBufferLength = 0; + } + } + } + } + + /* If asking for old name in case of a rename, notify later on, + * so that we can wait for new name. + * http://msdn.microsoft.com/en-us/library/dn392331.aspx + */ + if (Action == FILE_ACTION_RENAMED_OLD_NAME) + { + NotifyChange->Flags |= NOTIFY_LATER; + } + else + { + NotifyChange->Flags &= ~NOTIFY_LATER; + if (!IsListEmpty(&NotifyChange->NotifyIrps)) + { + FsRtlNotifyCompleteIrpList(NotifyChange, STATUS_SUCCESS); + } + } + } + } + _SEH2_FINALLY + { + FsRtlNotifyReleaseFastMutex(RealNotifySync); + } + _SEH2_END; } /*++ diff --git a/reactos/ntoskrnl/include/internal/fsrtl.h b/reactos/ntoskrnl/include/internal/fsrtl.h index 5dd98dc0697..cca4e8faeb1 100644 --- a/reactos/ntoskrnl/include/internal/fsrtl.h +++ b/reactos/ntoskrnl/include/internal/fsrtl.h @@ -53,9 +53,9 @@ // Notifications flags // #define WATCH_TREE 0x01 -#define INVALIDATE_BUFFERS 0x02 +#define NOTIFY_IMMEDIATELY 0x02 #define CLEANUP_IN_PROCESS 0x04 -#define ENUMERATE_DIR 0x08 +#define NOTIFY_LATER 0x08 #define WATCH_ROOT 0x10 #define DELETE_IN_PROCESS 0x20 From 0ef03fcf25d31701b5baf7fd2aad3e6fd6e17ad0 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 7 Mar 2014 19:38:35 +0000 Subject: [PATCH 067/419] [FASTFAT] Add required fields to handle file system notifications to device extension/VCB and properly initialize them on volume mount svn path=/trunk/; revision=62443 --- reactos/drivers/filesystems/fastfat/fsctl.c | 2 ++ reactos/drivers/filesystems/fastfat/vfat.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/reactos/drivers/filesystems/fastfat/fsctl.c b/reactos/drivers/filesystems/fastfat/fsctl.c index 24feadd906e..35e67d3893b 100644 --- a/reactos/drivers/filesystems/fastfat/fsctl.c +++ b/reactos/drivers/filesystems/fastfat/fsctl.c @@ -600,6 +600,8 @@ VfatMount( VolumeFcb->Flags |= VCB_IS_DIRTY; FsRtlNotifyVolumeEvent(DeviceExt->FATFileObject, FSRTL_VOLUME_MOUNT); + FsRtlNotifyInitializeSync(&DeviceExt->NotifySync); + InitializeListHead(&DeviceExt->NotifyList); Status = STATUS_SUCCESS; diff --git a/reactos/drivers/filesystems/fastfat/vfat.h b/reactos/drivers/filesystems/fastfat/vfat.h index 791daf29449..28a047a5b1e 100644 --- a/reactos/drivers/filesystems/fastfat/vfat.h +++ b/reactos/drivers/filesystems/fastfat/vfat.h @@ -291,6 +291,10 @@ typedef struct DEVICE_EXTENSION ULONG BaseDateYear; LIST_ENTRY VolumeListEntry; + + /* Notifications */ + LIST_ENTRY NotifyList; + PNOTIFY_SYNC NotifySync; } DEVICE_EXTENSION, VCB, *PVCB; typedef struct From d315b7bb39f5e044b4759c0674d54b752a7d776b Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 7 Mar 2014 19:42:54 +0000 Subject: [PATCH 068/419] [FASTFAT] - Implement VfatNotifyChangeDirectory which handles file system notifications registration - Also add support to dispatch routine for not queuing IRPs when pending and not required CORE-2582 svn path=/trunk/; revision=62444 --- reactos/drivers/filesystems/fastfat/dir.c | 35 +++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/reactos/drivers/filesystems/fastfat/dir.c b/reactos/drivers/filesystems/fastfat/dir.c index 2b5d8f1da52..57fda52556f 100644 --- a/reactos/drivers/filesystems/fastfat/dir.c +++ b/reactos/drivers/filesystems/fastfat/dir.c @@ -584,6 +584,32 @@ DoQuery( return Status; } +NTSTATUS VfatNotifyChangeDirectory(PVFAT_IRP_CONTEXT * IrpContext) +{ + PVCB pVcb; + PVFATFCB pFcb; + PIO_STACK_LOCATION Stack; + Stack = (*IrpContext)->Stack; + pVcb = (*IrpContext)->DeviceExt; + pFcb = (PVFATFCB) (*IrpContext)->FileObject->FsContext; + + FsRtlNotifyFullChangeDirectory(pVcb->NotifySync, + &(pVcb->NotifyList), + (*IrpContext)->FileObject->FsContext2, + (PSTRING)&(pFcb->PathNameU), + BooleanFlagOn(Stack->Flags, SL_WATCH_TREE), + FALSE, + Stack->Parameters.NotifyDirectory.CompletionFilter, + (*IrpContext)->Irp, + NULL, + NULL); + + /* We don't need the IRP context as we won't handle IRP completion */ + VfatFreeIrpContext(*IrpContext); + *IrpContext = NULL; + + return STATUS_PENDING; +} /* * FUNCTION: directory control : read/write directory informations @@ -603,8 +629,7 @@ VfatDirectoryControl( break; case IRP_MN_NOTIFY_CHANGE_DIRECTORY: - DPRINT("VFAT, dir : change\n"); - Status = STATUS_NOT_IMPLEMENTED; + Status = VfatNotifyChangeDirectory(&IrpContext); break; default: @@ -617,7 +642,11 @@ VfatDirectoryControl( if (Status == STATUS_PENDING) { - Status = VfatQueueRequest(IrpContext); + /* Only queue if there's IRP context */ + if (IrpContext) + { + Status = VfatQueueRequest(IrpContext); + } } else { From 3d38a135430f6efe5179032e948314a99453b845 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 7 Mar 2014 19:46:37 +0000 Subject: [PATCH 069/419] [FASTFAT] Add really limited support for file system notifications. In case of file creation, we report this. More cases are missing, such as: dir creation, attributes change, size change, last write change. See: http://msdn.microsoft.com/en-us/library/windows/desktop/aa364417%28v=vs.85%29.aspx as a reference CORE-2582 svn path=/trunk/; revision=62445 --- reactos/drivers/filesystems/fastfat/create.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/reactos/drivers/filesystems/fastfat/create.c b/reactos/drivers/filesystems/fastfat/create.c index fbd5231c9a5..841b7aee753 100644 --- a/reactos/drivers/filesystems/fastfat/create.c +++ b/reactos/drivers/filesystems/fastfat/create.c @@ -754,6 +754,19 @@ VfatCreateFile( &pFcb->FCBShareAccess); } + if (Irp->IoStatus.Information == FILE_CREATED) + { + FsRtlNotifyFullReportChange(DeviceExt->NotifySync, + &(DeviceExt->NotifyList), + (PSTRING)&pFcb->PathNameU, + pFcb->PathNameU.Length - pFcb->LongNameU.Length, + NULL, + NULL, + FILE_NOTIFY_CHANGE_FILE_NAME, + FILE_ACTION_ADDED, + NULL); + } + pFcb->OpenHandleCount++; /* FIXME : test write access if requested */ From a101d80ab667337ca2999bca1d15974a9abb8898 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 7 Mar 2014 20:30:29 +0000 Subject: [PATCH 070/419] [FASTFAT] Properly handle directories when notifying the kernel about creation. This makes the MS test application fully passing on ReactOS. You can find it at: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365261%28v=vs.85%29.aspx CORE-2582 svn path=/trunk/; revision=62446 --- reactos/drivers/filesystems/fastfat/create.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/filesystems/fastfat/create.c b/reactos/drivers/filesystems/fastfat/create.c index 841b7aee753..0e27105aefb 100644 --- a/reactos/drivers/filesystems/fastfat/create.c +++ b/reactos/drivers/filesystems/fastfat/create.c @@ -762,7 +762,8 @@ VfatCreateFile( pFcb->PathNameU.Length - pFcb->LongNameU.Length, NULL, NULL, - FILE_NOTIFY_CHANGE_FILE_NAME, + ((*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) ? + FILE_NOTIFY_CHANGE_DIR_NAME : FILE_NOTIFY_CHANGE_FILE_NAME), FILE_ACTION_ADDED, NULL); } From 70dc7b586e2ceb524c1b4be661e8bb34b6b9a21e Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 7 Mar 2014 21:51:11 +0000 Subject: [PATCH 071/419] [NOTSKRNL] Fix Frenchism, spotted by Christoph svn path=/trunk/; revision=62447 --- reactos/ntoskrnl/fsrtl/notify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/fsrtl/notify.c b/reactos/ntoskrnl/fsrtl/notify.c index 6c4be5b4d07..d06b81e4394 100644 --- a/reactos/ntoskrnl/fsrtl/notify.c +++ b/reactos/ntoskrnl/fsrtl/notify.c @@ -176,7 +176,7 @@ FsRtlCancelNotify(IN PDEVICE_OBJECT DeviceObject, NotifyChange->Buffer = Buffer; } - /* If we don't have valide buffer, ensure everything is 0-ed out */ + /* If we have to notify immediately, ensure that any buffer is 0-ed out */ if (NotifyChange->Flags & NOTIFY_IMMEDIATELY) { NotifyChange->Buffer = 0; From ed057abe8613503cf4c6e84a4853eb8de8dbe3cb Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 8 Mar 2014 08:47:03 +0000 Subject: [PATCH 072/419] [VGAFONTEDIT] - Fix CMake script (for PCH) [IMAGESOFT] - Fix CMake script (for PCH) [GREEN] - Add header guard - Fix CMake script (for PCH) This fixes rosapps build with RosBE 2.1.1 CORE-7716 svn path=/trunk/; revision=62454 --- rosapps/applications/devutils/vgafontedit/CMakeLists.txt | 4 ++-- rosapps/applications/imagesoft/CMakeLists.txt | 5 +++-- rosapps/drivers/green/CMakeLists.txt | 4 ++-- rosapps/drivers/green/green.h | 5 +++++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/rosapps/applications/devutils/vgafontedit/CMakeLists.txt b/rosapps/applications/devutils/vgafontedit/CMakeLists.txt index 98408f5ed97..43bab70abbb 100644 --- a/rosapps/applications/devutils/vgafontedit/CMakeLists.txt +++ b/rosapps/applications/devutils/vgafontedit/CMakeLists.txt @@ -8,10 +8,10 @@ list(APPEND SOURCE mainwnd.c misc.c opensave.c - vgafontedit.rc) + precomp.h) +add_executable(vgafontedit ${SOURCE} vgafontedit.rc) add_pch(vgafontedit precomp.h SOURCE) -add_executable(vgafontedit ${SOURCE}) set_module_type(vgafontedit win32gui UNICODE) add_importlibs(vgafontedit user32 gdi32 comdlg32 msvcrt kernel32) add_cd_file(TARGET vgafontedit DESTINATION reactos/system32 FOR all) diff --git a/rosapps/applications/imagesoft/CMakeLists.txt b/rosapps/applications/imagesoft/CMakeLists.txt index a0f22750f34..e673619d3c3 100644 --- a/rosapps/applications/imagesoft/CMakeLists.txt +++ b/rosapps/applications/imagesoft/CMakeLists.txt @@ -13,10 +13,11 @@ list(APPEND SOURCE misc.c opensave.c tooldock.c - imagesoft.rc) + precomp.h + ) +add_executable(imagesoft ${SOURCE} imagesoft.rc) add_pch(imagesoft precomp.h SOURCE) -add_executable(imagesoft ${SOURCE}) set_module_type(imagesoft win32gui UNICODE) add_importlibs(imagesoft gdi32 user32 advapi32 version comctl32 shell32 comdlg32 msvcrt kernel32) add_cd_file(TARGET imagesoft DESTINATION reactos/system32 FOR all) diff --git a/rosapps/drivers/green/CMakeLists.txt b/rosapps/drivers/green/CMakeLists.txt index 679deef762b..7c76830e83a 100644 --- a/rosapps/drivers/green/CMakeLists.txt +++ b/rosapps/drivers/green/CMakeLists.txt @@ -8,9 +8,9 @@ list(APPEND SOURCE pnp.c power.c screen.c - green.rc) + green.h) -add_library(green SHARED ${SOURCE}) +add_library(green SHARED ${SOURCE} green.rc) add_pch(green green.h SOURCE) set_module_type(green kernelmodedriver) add_importlibs(green ntoskrnl hal) diff --git a/rosapps/drivers/green/green.h b/rosapps/drivers/green/green.h index 5c3f1b20084..3eaf1696a4b 100644 --- a/rosapps/drivers/green/green.h +++ b/rosapps/drivers/green/green.h @@ -1,3 +1,6 @@ +#ifndef __GREEN_H__ +#define __GREEN_H__ + #include #include #include @@ -191,3 +194,5 @@ GreenDuplicateUnicodeString( IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString); + +#endif From b4a3df8d3f09c302d4a76afc51353b02e9e98f52 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 8 Mar 2014 09:03:59 +0000 Subject: [PATCH 073/419] [NTOSKRNL] Integrate Timo's review: - Fix pointer arithmetic - Remove unless variable CORE-2582 svn path=/trunk/; revision=62455 --- reactos/ntoskrnl/fsrtl/notify.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/reactos/ntoskrnl/fsrtl/notify.c b/reactos/ntoskrnl/fsrtl/notify.c index d06b81e4394..1018edfdaef 100644 --- a/reactos/ntoskrnl/fsrtl/notify.c +++ b/reactos/ntoskrnl/fsrtl/notify.c @@ -503,12 +503,13 @@ FsRtlNotifyUpdateBuffer(OUT PFILE_NOTIFY_INFORMATION OutputBuffer, OutputBuffer->FileName[ParentName->Length / sizeof(WCHAR)] = L'\\'; AlreadyWritten = ParentName->Length + sizeof(WCHAR); } - RtlCopyMemory(OutputBuffer->FileName + AlreadyWritten, TargetName->Buffer, TargetName->Length); + RtlCopyMemory((PVOID)((ULONG_PTR)OutputBuffer->FileName + AlreadyWritten), + TargetName->Buffer, TargetName->Length); if (StreamName) { AlreadyWritten += TargetName->Length; OutputBuffer->FileName[AlreadyWritten / sizeof(WCHAR)] = L':'; - RtlCopyMemory(OutputBuffer->FileName + AlreadyWritten + sizeof(WCHAR), + RtlCopyMemory((PVOID)((ULONG_PTR)OutputBuffer->FileName + AlreadyWritten + sizeof(WCHAR)), StreamName->Buffer, StreamName->Length); } } @@ -527,7 +528,7 @@ FsRtlNotifyUpdateBuffer(OUT PFILE_NOTIFY_INFORMATION OutputBuffer, OutputBuffer->FileName[ResultSize / sizeof(WCHAR)] = L'\\'; AlreadyWritten = ResultSize + sizeof(WCHAR); - RtlOemToUnicodeN(OutputBuffer->FileName + AlreadyWritten, + RtlOemToUnicodeN((PVOID)((ULONG_PTR)OutputBuffer->FileName + AlreadyWritten), OutputBuffer->FileNameLength, &ResultSize, TargetName->Buffer, TargetName->Length); @@ -535,7 +536,7 @@ FsRtlNotifyUpdateBuffer(OUT PFILE_NOTIFY_INFORMATION OutputBuffer, { AlreadyWritten += ResultSize; OutputBuffer->FileName[AlreadyWritten / sizeof(WCHAR)] = L':'; - RtlOemToUnicodeN(OutputBuffer->FileName + AlreadyWritten + sizeof(WCHAR), + RtlOemToUnicodeN((PVOID)((ULONG_PTR)OutputBuffer->FileName + AlreadyWritten + sizeof(WCHAR)), OutputBuffer->FileNameLength, &ResultSize, StreamName->Buffer, StreamName->Length); } @@ -991,7 +992,7 @@ FsRtlNotifyFilterReportChange(IN PNOTIFY_SYNC NotifySync, BOOLEAN IsStream, IsParent, PoolQuotaCharged; STRING TargetDirectory, TargetName, ParentName, IntNormalizedParentName; ULONG NumberOfBytes, TargetNumberOfParts, FullNumberOfParts, LastPartOffset, ParentNameOffset, ParentNameLength; - ULONG DataLength, TargetNameLength, AlignedDataLength; + ULONG DataLength, AlignedDataLength; TargetDirectory.Length = 0; TargetDirectory.MaximumLength = 0; @@ -1251,16 +1252,11 @@ FsRtlNotifyFilterReportChange(IN PNOTIFY_SYNC NotifySync, } /* Look for target name & construct it, if required */ - if (TargetName.Buffer) - { - TargetNameLength = TargetName.Length; - } - else + if (TargetName.Buffer == NULL) { TargetName.Buffer = &FullTargetName->Buffer[TargetNameOffset]; - TargetNameLength = FullTargetName->Length - TargetNameOffset; - TargetName.Length = TargetNameLength; - TargetName.MaximumLength = TargetNameLength; + TargetName.Length = + TargetName.MaximumLength = FullTargetName->Length - TargetNameOffset; } /* Then, we will append it as well */ @@ -1296,8 +1292,8 @@ FsRtlNotifyFilterReportChange(IN PNOTIFY_SYNC NotifySync, } else { - OutputBuffer = 0; - FileNotifyInfo = 0; + OutputBuffer = NULL; + FileNotifyInfo = NULL; /* If we already had a buffer, update last entry position */ if (NotifyChange->Buffer != NULL) { From 4ff9f64d52c05616d5a59f8590a1325c3d772261 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 8 Mar 2014 11:28:21 +0000 Subject: [PATCH 074/419] [ACPI] Silence some debug prints svn path=/trunk/; revision=62456 --- reactos/drivers/bus/acpi/buspdo.c | 8 ++++---- reactos/drivers/bus/acpi/main.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/drivers/bus/acpi/buspdo.c b/reactos/drivers/bus/acpi/buspdo.c index e0809bb031b..cb5965f5072 100644 --- a/reactos/drivers/bus/acpi/buspdo.c +++ b/reactos/drivers/bus/acpi/buspdo.c @@ -496,8 +496,8 @@ Bus_PDO_QueryDeviceId( { acpi_bus_get_device(DeviceData->AcpiHandle, &Device); - DPRINT1("Device name: %s\n", Device->pnp.device_name); - DPRINT1("Hardware ID: %s\n", Device->pnp.hardware_id); + DPRINT("Device name: %s\n", Device->pnp.device_name); + DPRINT("Hardware ID: %s\n", Device->pnp.hardware_id); if (strcmp(Device->pnp.hardware_id, "Processor") == 0) { @@ -755,10 +755,10 @@ Bus_PDO_QueryResources( } else { - DPRINT1("Using _BBN for bus number\n"); + DPRINT("Using _BBN for bus number\n"); } - DPRINT1("Found PCI root hub: %d\n", BusNumber); + DPRINT("Found PCI root hub: %d\n", BusNumber); ResourceListSize = sizeof(CM_RESOURCE_LIST); ResourceList = (PCM_RESOURCE_LIST)ExAllocatePoolWithTag(PagedPool, ResourceListSize, 'IPCA'); diff --git a/reactos/drivers/bus/acpi/main.c b/reactos/drivers/bus/acpi/main.c index b2da79cbd67..72879a68347 100644 --- a/reactos/drivers/bus/acpi/main.c +++ b/reactos/drivers/bus/acpi/main.c @@ -457,7 +457,7 @@ GetProcessorInformation(VOID) PWCHAR Ptr; NTSTATUS Status; - DPRINT1("GetProcessorInformation()\n"); + DPRINT("GetProcessorInformation()\n"); /* Open the key for CPU 0 */ Status = AcpiRegOpenKey(NULL, From dc64b5bd63a03cf72db1107112a09461d4bb2b11 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 8 Mar 2014 11:37:03 +0000 Subject: [PATCH 075/419] [NPFS/NTOSKRNL] Silence 2 more debug prints that are not so useful. svn path=/trunk/; revision=62457 --- reactos/drivers/filesystems/npfs/main.c | 2 +- reactos/ntoskrnl/mm/ARM3/expool.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/filesystems/npfs/main.c b/reactos/drivers/filesystems/npfs/main.c index d45e00deb72..7aeff7767a0 100644 --- a/reactos/drivers/filesystems/npfs/main.c +++ b/reactos/drivers/filesystems/npfs/main.c @@ -330,7 +330,7 @@ DriverEntry(IN PDRIVER_OBJECT DriverObject, NTSTATUS Status; UNREFERENCED_PARAMETER(RegistryPath); - DPRINT1("Next-Generation NPFS-Advanced\n"); + DPRINT("Next-Generation NPFS-Advanced\n"); Status = NpInitializeAliases(); if (!NT_SUCCESS(Status)) diff --git a/reactos/ntoskrnl/mm/ARM3/expool.c b/reactos/ntoskrnl/mm/ARM3/expool.c index 43dce905cca..4558bfa97e6 100644 --- a/reactos/ntoskrnl/mm/ARM3/expool.c +++ b/reactos/ntoskrnl/mm/ARM3/expool.c @@ -1336,7 +1336,7 @@ ExpAddTagForBigPages(IN PVOID Va, InterlockedIncrementUL(&ExpPoolBigEntriesInUse); if ((i >= 16) && (ExpPoolBigEntriesInUse > (TableSize / 4))) { - DPRINT1("Should attempt expansion since we now have %lu entries\n", + DPRINT("Should attempt expansion since we now have %lu entries\n", ExpPoolBigEntriesInUse); } From c2f825a0fec533faf9ab099a5ed62a3de7cc3a23 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 8 Mar 2014 11:51:51 +0000 Subject: [PATCH 076/419] [PSEH3] Enforce the use of a frame pointer in all functions that use PSEH, even when -fomit-frame-pointer option was specified. This way we don't need to explicitly tell PSEH with a global define, whether we have a frame pointer or not, which would also probably not have worked together with alloca(). svn path=/trunk/; revision=62458 --- reactos/include/reactos/libs/pseh/pseh3.h | 31 ++++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index 16a179089a8..3ae316f6c5c 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -94,6 +94,9 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter /* CLANG specific definitions! */ #ifdef __clang__ +/* CLANG thinks it is smart and optimizes the alloca away if it is 0 and with it the use of a frame register */ +#define _SEH3$_EnforceFramePointer() asm volatile ("#\n" : : "m"(*(char*)__builtin_alloca(4)) : "%esp", "memory") + /* CLANG doesn't have asm goto! */ #define _SEH3$_ASM_GOTO(_Label, ...) @@ -137,35 +140,31 @@ _SEH3$_RegisterTryLevelWithNonVolatiles( #else /* !__clang__ */ +/* This will make GCC use ebp, even if it was disabled by -fomit-frame-pointer */ +#define _SEH3$_EnforceFramePointer() asm volatile ("#\n" : : "m"(*(char*)__builtin_alloca(0)) : "%esp", "memory") + #define _SEH3$_ASM_GOTO(_Label, ...) asm goto ("#\n" : : : "memory", ## __VA_ARGS__ : _Label) /* This is an asm wrapper around _SEH3$_RegisterFrame */ #define _SEH3$_RegisterFrame_(_TrylevelFrame, _DataTable) \ - asm goto ("leal %1, %%edx\n" \ + asm goto ("leal %0, %%eax\n" \ + "leal %1, %%edx\n" \ "call __SEH3$_RegisterFrame\n" \ : \ - : "a" (_TrylevelFrame), "m" (*(_DataTable)) \ + : "m" (*(_TrylevelFrame)), "m" (*(_DataTable)) \ : "ecx", "edx", "memory" \ : _SEH3$_l_HandlerTarget) /* This is an asm wrapper around _SEH3$_RegisterTryLevel */ #define _SEH3$_RegisterTryLevel_(_TrylevelFrame, _DataTable) \ - asm goto ("leal %1, %%edx\n" \ + asm goto ("leal %0, %%eax\n" \ + "leal %1, %%edx\n" \ "call __SEH3$_RegisterTryLevel\n" \ : \ - : "a" (_TrylevelFrame), "m" (*(_DataTable)) \ + : "m" (*(_TrylevelFrame)), "m" (*(_DataTable)) \ : "ecx", "edx", "memory" \ : _SEH3$_l_HandlerTarget) -/* Define the registers that get clobbered, when reaching the __except block. - We specify ebp on optimized builds without frame pointer, since it will be - used by GCC as a general purpose register then. */ -#if defined(__OPTIMIZE__) && defined(_ALLOW_OMIT_FRAME_POINTER) -#define _SEH3$_CLOBBER_ON_EXCEPTION "ebp", "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" -#else -#define _SEH3$_CLOBBER_ON_EXCEPTION "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" -#endif - /* This construct scares GCC so much, that it will stop moving code around into places that are never executed. */ #define _SEH3$_SCARE_GCC() \ @@ -174,7 +173,7 @@ _SEH3$_RegisterTryLevelWithNonVolatiles( _SEH3$_ASM_GOTO(_SEH3$_l_HandlerTarget); \ _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ asm volatile ("#" : "=a"(plabel) : "p"(&&_SEH3$_l_BeforeTry), "p"(&&_SEH3$_l_HandlerTarget), "p"(&&_SEH3$_l_OnException) \ - : _SEH3$_CLOBBER_ON_EXCEPTION ); \ + : "ebx", "ecx", "edx", "esi", "edi", "flags", "memory" ); \ goto _SEH3$_l_OnException; #endif /* __clang__ */ @@ -317,11 +316,12 @@ _SEH3$_Unregister( _SEH3$_DEFINE_DUMMY_FINALLY(_SEH3$_FinallyFunction) \ \ /* Allow intrinsics for __except to be used */ \ - _SEH3$_DECLARE_EXCEPT_INTRINSICS() \ + _SEH3$_DECLARE_EXCEPT_INTRINSICS(); \ \ goto _SEH3$_l_DoTry; \ \ _SEH3$_l_HandlerTarget: (void)0; \ + _SEH3$_EnforceFramePointer(); \ \ if (1) \ { \ @@ -355,6 +355,7 @@ _SEH3$_Unregister( goto _SEH3$_l_DoTry; \ \ _SEH3$_l_HandlerTarget: (void)0; \ + _SEH3$_EnforceFramePointer(); \ \ _SEH3$_FINALLY_FUNC_OPEN(_SEH3$_FinallyFunction) \ /* This construct makes sure that the finally function returns */ \ From 7647ccfb925e54aae5c66e1ee3dd2b2d21165802 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 8 Mar 2014 12:38:12 +0000 Subject: [PATCH 077/419] [PSEH3] Move the generation of the nested filter function to a different location svn path=/trunk/; revision=62459 --- reactos/include/reactos/libs/pseh/pseh3.h | 26 +++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index 3ae316f6c5c..035c099b343 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -17,6 +17,20 @@ #define _SEH3$_FRAME_ALL_NONVOLATILES 1 #endif +enum +{ + _SEH3$_NESTED_HANDLER = 0, + _SEH3$_CPP_HANDLER = 1, + _SEH3$_CLANG_HANDLER = 2, +#ifdef __clang__ + _SEH3$_HANDLER_TYPE = _SEH3$_CLANG_HANDLER, +#elif defined(__cplusplus) + _SEH3$_HANDLER_TYPE = _SEH3$_CPP_HANDLER, +#else + _SEH3$_HANDLER_TYPE = _SEH3$_NESTED_HANDLER, +#endif +}; + typedef struct _SEH3$_SCOPE_TABLE { void *Target; @@ -270,6 +284,8 @@ _SEH3$_Unregister( __label__ _SEH3$_l_EndTry; \ __label__ _SEH3$_l_HandlerTarget; \ __label__ _SEH3$_l_OnException; \ + __label__ _SEH3$_l_FilterOrFinally; \ + (void)&&_SEH3$_l_FilterOrFinally; \ \ /* Count the try level. Outside of any __try, _SEH3$_TryLevel is 0 */ \ enum { \ @@ -303,14 +319,11 @@ _SEH3$_Unregister( _SEH3$_DECLARE_FILTER_FUNC(_SEH3$_FilterFunction); \ \ /* Create a static data table that contains the jump target and filter function */ \ - static const SEH3$_SCOPE_TABLE _SEH3$_ScopeTable = { &&_SEH3$_l_HandlerTarget, _SEH3$_FILTER(&_SEH3$_FilterFunction, (__VA_ARGS__)) }; \ + static const SEH3$_SCOPE_TABLE _SEH3$_ScopeTable = { &&_SEH3$_l_HandlerTarget, _SEH3$_FILTER(&_SEH3$_FilterFunction, (__VA_ARGS__)), _SEH3$_TryLevel, _SEH3$_HANDLER_TYPE }; \ \ /* Register the registration record. */ \ if (_SEH3$_TryLevel == 1) _SEH3$_RegisterFrame_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ else _SEH3$_RegisterTryLevel_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ -\ - /* Emit the filter function */ \ - _SEH3$_DEFINE_FILTER_FUNC(_SEH3$_FilterFunction, (__VA_ARGS__)) \ \ /* Define an empty inline finally function */ \ _SEH3$_DEFINE_DUMMY_FINALLY(_SEH3$_FinallyFunction) \ @@ -319,6 +332,10 @@ _SEH3$_Unregister( _SEH3$_DECLARE_EXCEPT_INTRINSICS(); \ \ goto _SEH3$_l_DoTry; \ +\ + _SEH3$_l_FilterOrFinally: (void)0; \ + /* Emit the filter function */ \ + _SEH3$_DEFINE_FILTER_FUNC(_SEH3$_FilterFunction, (__VA_ARGS__)) \ \ _SEH3$_l_HandlerTarget: (void)0; \ _SEH3$_EnforceFramePointer(); \ @@ -357,6 +374,7 @@ _SEH3$_Unregister( _SEH3$_l_HandlerTarget: (void)0; \ _SEH3$_EnforceFramePointer(); \ \ + _SEH3$_l_FilterOrFinally: (void)0; \ _SEH3$_FINALLY_FUNC_OPEN(_SEH3$_FinallyFunction) \ /* This construct makes sure that the finally function returns */ \ /* a proper value at the end */ \ From a0c9db761031f46935139ca957686f204db727fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 8 Mar 2014 15:31:05 +0000 Subject: [PATCH 078/419] [KERNEL32][CONSRV] Make kernel32 / winsrv console CSR structures Win2k3-compliant. The aim is to be able to put our kernel32.dll or winsrv.dll on win2k3, and vice-versa. Most of the changes consist in: - adding a HANDLE ConsoleHandle; to the structures, representing the console handle of the current application; - reorganizing the order of the members in the different structures; - few structures need to hold a event handle because it appears that some APIs create a event handle to perform some sort of synchronization with the console server (this is totally unused at the moment). - Since CsrClientCallServer returns the value of ApiMessage.Status, then just use ApiMessage.Status instead of declaring another Status variable for querying the return value of CsrClientCallServer. Part 1/X Aside: The VerifyConsoleIoHandle winetest problem is solved here (see CORE-7941 for more details). CORE-7941 #resolved #comment Fixed in revision 62460, thanks :) CORE-7931 svn path=/trunk/; revision=62460 --- .../win32/kernel32/client/console/console.c | 448 ++++++++++-------- reactos/include/psdk/wincon.h | 12 +- reactos/include/reactos/subsys/win/conmsg.h | 68 ++- .../user/winsrv/consrv/condrv/console.c | 12 +- .../user/winsrv/consrv/condrv/dummyfrontend.c | 8 +- .../win32ss/user/winsrv/consrv/condrv/text.c | 31 +- .../win32ss/user/winsrv/consrv/conoutput.c | 18 +- reactos/win32ss/user/winsrv/consrv/console.c | 30 +- .../win32ss/user/winsrv/consrv/frontendctl.c | 10 +- .../winsrv/consrv/frontends/gui/guisettings.h | 4 +- .../winsrv/consrv/frontends/gui/guiterm.c | 27 +- .../winsrv/consrv/frontends/tui/tuiterm.c | 8 +- reactos/win32ss/user/winsrv/consrv/handle.c | 17 +- .../user/winsrv/consrv/include/conio.h | 8 +- .../win32ss/user/winsrv/consrv/include/term.h | 8 +- 15 files changed, 408 insertions(+), 301 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/console/console.c b/reactos/dll/win32/kernel32/client/console/console.c index 12d820cf18a..e4a3367bf97 100644 --- a/reactos/dll/win32/kernel32/client/console/console.c +++ b/reactos/dll/win32/kernel32/client/console/console.c @@ -252,17 +252,18 @@ ConsoleMenuControl(HANDLE hConsoleOutput, CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_MENUCONTROL MenuControlRequest = &ApiMessage.Data.MenuControlRequest; - MenuControlRequest->OutputHandle = hConsoleOutput; - MenuControlRequest->dwCmdIdLow = dwCmdIdLow; - MenuControlRequest->dwCmdIdHigh = dwCmdIdHigh; - MenuControlRequest->hMenu = NULL; + MenuControlRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + MenuControlRequest->OutputHandle = hConsoleOutput; + MenuControlRequest->CmdIdLow = dwCmdIdLow; + MenuControlRequest->CmdIdHigh = dwCmdIdHigh; + MenuControlRequest->MenuHandle = NULL; CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, NULL, CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepMenuControl), - sizeof(CONSOLE_MENUCONTROL)); + sizeof(*MenuControlRequest)); - return MenuControlRequest->hMenu; + return MenuControlRequest->MenuHandle; } @@ -314,7 +315,6 @@ BOOL WINAPI GetConsoleDisplayMode(LPDWORD lpModeFlags) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_GETDISPLAYMODE GetDisplayModeRequest = &ApiMessage.Data.GetDisplayModeRequest; @@ -324,19 +324,19 @@ GetConsoleDisplayMode(LPDWORD lpModeFlags) return FALSE; } - // GetDisplayModeRequest->OutputHandle = hConsoleOutput; + GetDisplayModeRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetDisplayMode), - sizeof(CONSOLE_GETDISPLAYMODE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetDisplayMode), + sizeof(*GetDisplayModeRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } - *lpModeFlags = GetDisplayModeRequest->DisplayMode; + *lpModeFlags = GetDisplayModeRequest->DisplayMode; // ModeFlags return TRUE; } @@ -378,33 +378,34 @@ GetConsoleFontSize(HANDLE hConsoleOutput, BOOL WINAPI GetConsoleHardwareState(HANDLE hConsoleOutput, - DWORD Flags, + PDWORD Flags, PDWORD State) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_GETSETHWSTATE HardwareStateRequest = &ApiMessage.Data.HardwareStateRequest; DPRINT1("GetConsoleHardwareState(%lu, 0x%p) UNIMPLEMENTED!\n", Flags, State); - if (State == NULL) + if (Flags == NULL || State == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - HardwareStateRequest->OutputHandle = hConsoleOutput; + HardwareStateRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + HardwareStateRequest->OutputHandle = hConsoleOutput; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetHardwareState), - sizeof(CONSOLE_GETSETHWSTATE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetHardwareState), + sizeof(*HardwareStateRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } + *Flags = HardwareStateRequest->Flags; *State = HardwareStateRequest->State; return TRUE; } @@ -458,7 +459,6 @@ WINAPI InvalidateConsoleDIBits(IN HANDLE hConsoleOutput, IN PSMALL_RECT lpRect) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_INVALIDATEDIBITS InvalidateDIBitsRequest = &ApiMessage.Data.InvalidateDIBitsRequest; @@ -468,16 +468,17 @@ InvalidateConsoleDIBits(IN HANDLE hConsoleOutput, return FALSE; } - InvalidateDIBitsRequest->OutputHandle = hConsoleOutput; - InvalidateDIBitsRequest->Region = *lpRect; + InvalidateDIBitsRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + InvalidateDIBitsRequest->OutputHandle = hConsoleOutput; + InvalidateDIBitsRequest->Region = *lpRect; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepInvalidateBitMapRect), - sizeof(CONSOLE_INVALIDATEDIBITS)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepInvalidateBitMapRect), + sizeof(*InvalidateDIBitsRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -546,23 +547,23 @@ OpenConsoleW(LPCWSTR wsName, */ BOOL WINAPI -SetConsoleCursor(HANDLE hConsoleOutput, +SetConsoleCursor(HANDLE hConsoleOutput, HCURSOR hCursor) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_SETCURSOR SetCursorRequest = &ApiMessage.Data.SetCursorRequest; - SetCursorRequest->OutputHandle = hConsoleOutput; - SetCursorRequest->hCursor = hCursor; + SetCursorRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetCursorRequest->OutputHandle = hConsoleOutput; + SetCursorRequest->CursorHandle = hCursor; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCursor), - sizeof(CONSOLE_SETCURSOR)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCursor), + sizeof(*SetCursorRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -576,25 +577,26 @@ SetConsoleCursor(HANDLE hConsoleOutput, BOOL WINAPI SetConsoleDisplayMode(HANDLE hConsoleOutput, - DWORD dwFlags, + DWORD dwFlags, // dwModeFlags PCOORD lpNewScreenBufferDimensions) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_SETDISPLAYMODE SetDisplayModeRequest = &ApiMessage.Data.SetDisplayModeRequest; - SetDisplayModeRequest->OutputHandle = hConsoleOutput; - SetDisplayModeRequest->DisplayMode = dwFlags; - SetDisplayModeRequest->NewSBDim.X = 0; - SetDisplayModeRequest->NewSBDim.Y = 0; + SetDisplayModeRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetDisplayModeRequest->OutputHandle = hConsoleOutput; + SetDisplayModeRequest->DisplayMode = dwFlags; // ModeFlags ; dwModeFlags + SetDisplayModeRequest->NewSBDim.X = 0; + SetDisplayModeRequest->NewSBDim.Y = 0; + /* SetDisplayModeRequest->EventHandle; */ - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetDisplayMode), - sizeof(CONSOLE_SETDISPLAYMODE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetDisplayMode), + sizeof(*SetDisplayModeRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -628,22 +630,23 @@ SetConsoleHardwareState(HANDLE hConsoleOutput, DWORD Flags, DWORD State) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_GETSETHWSTATE HardwareStateRequest = &ApiMessage.Data.HardwareStateRequest; DPRINT1("SetConsoleHardwareState(%lu, %lu) UNIMPLEMENTED!\n", Flags, State); - HardwareStateRequest->OutputHandle = hConsoleOutput; - HardwareStateRequest->State = State; + HardwareStateRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + HardwareStateRequest->OutputHandle = hConsoleOutput; + HardwareStateRequest->Flags = Flags; + HardwareStateRequest->State = State; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetHardwareState), - sizeof(CONSOLE_GETSETHWSTATE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetHardwareState), + sizeof(*HardwareStateRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -690,19 +693,19 @@ BOOL WINAPI SetConsoleMenuClose(BOOL bEnable) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_SETMENUCLOSE SetMenuCloseRequest = &ApiMessage.Data.SetMenuCloseRequest; - SetMenuCloseRequest->Enable = bEnable; + SetMenuCloseRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetMenuCloseRequest->Enable = bEnable; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetMenuClose), - sizeof(CONSOLE_SETMENUCLOSE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetMenuClose), + sizeof(*SetMenuCloseRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -721,21 +724,21 @@ SetConsolePalette(HANDLE hConsoleOutput, HPALETTE hPalette, UINT dwUsage) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_SETPALETTE SetPaletteRequest = &ApiMessage.Data.SetPaletteRequest; + SetPaletteRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; SetPaletteRequest->OutputHandle = hConsoleOutput; SetPaletteRequest->PaletteHandle = hPalette; SetPaletteRequest->Usage = dwUsage; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetPalette), - sizeof(CONSOLE_SETPALETTE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetPalette), + sizeof(*SetPaletteRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -754,14 +757,15 @@ ShowConsoleCursor(HANDLE hConsoleOutput, CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_SHOWCURSOR ShowCursorRequest = &ApiMessage.Data.ShowCursorRequest; - ShowCursorRequest->OutputHandle = hConsoleOutput; - ShowCursorRequest->Show = bShow; - ShowCursorRequest->RefCount = 0; + ShowCursorRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + ShowCursorRequest->OutputHandle = hConsoleOutput; + ShowCursorRequest->Show = bShow; + ShowCursorRequest->RefCount = 0; CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, NULL, CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepShowCursor), - sizeof(CONSOLE_SHOWCURSOR)); + sizeof(*ShowCursorRequest)); return ShowCursorRequest->RefCount; } @@ -771,10 +775,10 @@ ShowConsoleCursor(HANDLE hConsoleOutput, * FUNCTION: Checks whether the given handle is a valid console handle. * * ARGUMENTS: - * Handle - Handle to be checked + * hIoHandle - Handle to be checked. * * RETURNS: - * TRUE: Handle is a valid console handle + * TRUE : Handle is a valid console handle. * FALSE: Handle is not a valid console handle. * * STATUS: Officially undocumented @@ -783,24 +787,29 @@ ShowConsoleCursor(HANDLE hConsoleOutput, */ BOOL WINAPI -VerifyConsoleIoHandle(HANDLE Handle) +VerifyConsoleIoHandle(HANDLE hIoHandle) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_VERIFYHANDLE VerifyHandleRequest = &ApiMessage.Data.VerifyHandleRequest; - ApiMessage.Data.VerifyHandleRequest.ConsoleHandle = Handle; + VerifyHandleRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + VerifyHandleRequest->Handle = hIoHandle; + VerifyHandleRequest->IsValid = FALSE; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepVerifyIoHandle), - sizeof(CONSOLE_VERIFYHANDLE)); - if (!NT_SUCCESS(Status)) + /* If the process is not attached to a console, return invalid handle */ + if (VerifyHandleRequest->ConsoleHandle == NULL) return FALSE; + + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepVerifyIoHandle), + sizeof(*VerifyHandleRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } - return TRUE; + return VerifyHandleRequest->IsValid; } @@ -809,20 +818,21 @@ VerifyConsoleIoHandle(HANDLE Handle) */ BOOL WINAPI -CloseConsoleHandle(HANDLE Handle) +CloseConsoleHandle(HANDLE hHandle) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_CLOSEHANDLE CloseHandleRequest = &ApiMessage.Data.CloseHandleRequest; - ApiMessage.Data.CloseHandleRequest.ConsoleHandle = Handle; + CloseHandleRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + CloseHandleRequest->Handle = hHandle; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepCloseHandle), - sizeof(CONSOLE_CLOSEHANDLE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepCloseHandle), + sizeof(*CloseHandleRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -848,21 +858,27 @@ GetStdHandle(DWORD nStdHandle) */ { PRTL_USER_PROCESS_PARAMETERS Ppb = NtCurrentPeb()->ProcessParameters; + HANDLE Handle = INVALID_HANDLE_VALUE; switch (nStdHandle) { case STD_INPUT_HANDLE: - return Ppb->StandardInput; + Handle = Ppb->StandardInput; + break; case STD_OUTPUT_HANDLE: - return Ppb->StandardOutput; + Handle = Ppb->StandardOutput; + break; case STD_ERROR_HANDLE: - return Ppb->StandardError; + Handle = Ppb->StandardError; + break; } - SetLastError(ERROR_INVALID_HANDLE); - return INVALID_HANDLE_VALUE; + /* If the returned handle is invalid, set last error */ + if (Handle == INVALID_HANDLE_VALUE) SetLastError(ERROR_INVALID_HANDLE); + + return Handle; } @@ -871,7 +887,7 @@ GetStdHandle(DWORD nStdHandle) */ BOOL WINAPI -SetStdHandle(DWORD nStdHandle, +SetStdHandle(DWORD nStdHandle, HANDLE hHandle) /* * FUNCTION: Set the handle for the standard input, standard output or @@ -886,7 +902,7 @@ SetStdHandle(DWORD nStdHandle, { PRTL_USER_PROCESS_PARAMETERS Ppb = NtCurrentPeb()->ProcessParameters; - /* no need to check if hHandle == INVALID_HANDLE_VALUE */ + /* No need to check if hHandle == INVALID_HANDLE_VALUE */ switch (nStdHandle) { @@ -903,7 +919,7 @@ SetStdHandle(DWORD nStdHandle, return TRUE; } - /* Windows for whatever reason sets the last error to ERROR_INVALID_HANDLE here */ + /* nStdHandle was invalid, bail out */ SetLastError(ERROR_INVALID_HANDLE); return FALSE; } @@ -1021,8 +1037,8 @@ WINAPI GetConsoleScreenBufferInfo(HANDLE hConsoleOutput, PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_GETSCREENBUFFERINFO ScreenBufferInfoRequest = &ApiMessage.Data.ScreenBufferInfoRequest; if (lpConsoleScreenBufferInfo == NULL) { @@ -1030,19 +1046,27 @@ GetConsoleScreenBufferInfo(HANDLE hConsoleOutput, return FALSE; } - ApiMessage.Data.ScreenBufferInfoRequest.OutputHandle = hConsoleOutput; + ScreenBufferInfoRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + ScreenBufferInfoRequest->OutputHandle = hConsoleOutput; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetScreenBufferInfo), - sizeof(CONSOLE_GETSCREENBUFFERINFO)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetScreenBufferInfo), + sizeof(*ScreenBufferInfoRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } - *lpConsoleScreenBufferInfo = ApiMessage.Data.ScreenBufferInfoRequest.Info; + lpConsoleScreenBufferInfo->dwSize = ScreenBufferInfoRequest->ScreenBufferSize; + lpConsoleScreenBufferInfo->dwCursorPosition = ScreenBufferInfoRequest->CursorPosition; + lpConsoleScreenBufferInfo->wAttributes = ScreenBufferInfoRequest->Attributes; + lpConsoleScreenBufferInfo->srWindow.Left = ScreenBufferInfoRequest->ViewOrigin.X; + lpConsoleScreenBufferInfo->srWindow.Top = ScreenBufferInfoRequest->ViewOrigin.Y; + lpConsoleScreenBufferInfo->srWindow.Right = ScreenBufferInfoRequest->ViewOrigin.X + ScreenBufferInfoRequest->ViewSize.X - 1; + lpConsoleScreenBufferInfo->srWindow.Bottom = ScreenBufferInfoRequest->ViewOrigin.Y + ScreenBufferInfoRequest->ViewSize.Y - 1; + lpConsoleScreenBufferInfo->dwMaximumWindowSize = ScreenBufferInfoRequest->MaximumViewSize; return TRUE; } @@ -1932,21 +1956,24 @@ UINT WINAPI GetConsoleCP(VOID) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest = &ApiMessage.Data.GetConsoleCPRequest; /* Get the Input Code Page */ - ApiMessage.Data.ConsoleCPRequest.InputCP = TRUE; - ApiMessage.Data.ConsoleCPRequest.CodePage = 0; + GetConsoleCPRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + GetConsoleCPRequest->OutputCP = FALSE; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetCP), - sizeof(CONSOLE_GETSETINPUTOUTPUTCP)); + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetCP), + sizeof(*GetConsoleCPRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) + { + BaseSetLastNTError(ApiMessage.Status); + return 0; + } - if (!NT_SUCCESS(Status)) BaseSetLastNTError(Status); - - return ApiMessage.Data.ConsoleCPRequest.CodePage; + return GetConsoleCPRequest->CodePage; } @@ -1959,21 +1986,26 @@ BOOL WINAPI SetConsoleCP(UINT wCodePageID) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest = &ApiMessage.Data.SetConsoleCPRequest; /* Set the Input Code Page */ - ApiMessage.Data.ConsoleCPRequest.InputCP = TRUE; - ApiMessage.Data.ConsoleCPRequest.CodePage = wCodePageID; + SetConsoleCPRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetConsoleCPRequest->CodePage = wCodePageID; + SetConsoleCPRequest->OutputCP = FALSE; + /* SetConsoleCPRequest->EventHandle; */ - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCP), - sizeof(CONSOLE_GETSETINPUTOUTPUTCP)); + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCP), + sizeof(*SetConsoleCPRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) + { + BaseSetLastNTError(ApiMessage.Status); + return FALSE; + } - if (!NT_SUCCESS(Status)) BaseSetLastNTError(Status); - - return NT_SUCCESS(Status); + return TRUE; } @@ -1986,21 +2018,24 @@ UINT WINAPI GetConsoleOutputCP(VOID) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest = &ApiMessage.Data.GetConsoleCPRequest; /* Get the Output Code Page */ - ApiMessage.Data.ConsoleCPRequest.InputCP = FALSE; - ApiMessage.Data.ConsoleCPRequest.CodePage = 0; + GetConsoleCPRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + GetConsoleCPRequest->OutputCP = TRUE; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetCP), - sizeof(CONSOLE_GETSETINPUTOUTPUTCP)); + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetCP), + sizeof(*GetConsoleCPRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) + { + BaseSetLastNTError(ApiMessage.Status); + return 0; + } - if (!NT_SUCCESS(Status)) BaseSetLastNTError(Status); - - return ApiMessage.Data.ConsoleCPRequest.CodePage; + return GetConsoleCPRequest->CodePage; } @@ -2013,21 +2048,26 @@ BOOL WINAPI SetConsoleOutputCP(UINT wCodePageID) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest = &ApiMessage.Data.SetConsoleCPRequest; /* Set the Output Code Page */ - ApiMessage.Data.ConsoleCPRequest.InputCP = FALSE; - ApiMessage.Data.ConsoleCPRequest.CodePage = wCodePageID; + SetConsoleCPRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetConsoleCPRequest->CodePage = wCodePageID; + SetConsoleCPRequest->OutputCP = TRUE; + /* SetConsoleCPRequest->EventHandle; */ - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCP), - sizeof(CONSOLE_GETSETINPUTOUTPUTCP)); + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCP), + sizeof(*SetConsoleCPRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) + { + BaseSetLastNTError(ApiMessage.Status); + return FALSE; + } - if (!NT_SUCCESS(Status)) BaseSetLastNTError(Status); - - return NT_SUCCESS(Status); + return TRUE; } @@ -2041,11 +2081,10 @@ WINAPI GetConsoleProcessList(LPDWORD lpdwProcessList, DWORD dwProcessCount) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_GETPROCESSLIST GetProcessListRequest = &ApiMessage.Data.GetProcessListRequest; PCSR_CAPTURE_BUFFER CaptureBuffer; - ULONG nProcesses; + ULONG nProcesses = 0; if (lpdwProcessList == NULL || dwProcessCount == 0) { @@ -2058,30 +2097,30 @@ GetConsoleProcessList(LPDWORD lpdwProcessList, { DPRINT1("CsrAllocateCaptureBuffer failed!\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; + return 0; } - GetProcessListRequest->nMaxIds = dwProcessCount; + GetProcessListRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + GetProcessListRequest->ProcessCount = dwProcessCount; CsrAllocateMessagePointer(CaptureBuffer, dwProcessCount * sizeof(DWORD), - (PVOID*)&GetProcessListRequest->pProcessIds); + (PVOID*)&GetProcessListRequest->ProcessIdsList); - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - CaptureBuffer, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetProcessList), - sizeof(CONSOLE_GETPROCESSLIST)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + CaptureBuffer, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetProcessList), + sizeof(*GetProcessListRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError (Status); - nProcesses = 0; + BaseSetLastNTError(ApiMessage.Status); } else { - nProcesses = GetProcessListRequest->nProcessIdsTotal; + nProcesses = GetProcessListRequest->ProcessCount; if (dwProcessCount >= nProcesses) { - memcpy(lpdwProcessList, GetProcessListRequest->pProcessIds, nProcesses * sizeof(DWORD)); + memcpy(lpdwProcessList, GetProcessListRequest->ProcessIdsList, nProcesses * sizeof(DWORD)); } } @@ -2099,8 +2138,8 @@ BOOL WINAPI GetConsoleSelectionInfo(PCONSOLE_SELECTION_INFO lpConsoleSelectionInfo) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_GETSELECTIONINFO GetSelectionInfoRequest = &ApiMessage.Data.GetSelectionInfoRequest; if (lpConsoleSelectionInfo == NULL) { @@ -2108,17 +2147,19 @@ GetConsoleSelectionInfo(PCONSOLE_SELECTION_INFO lpConsoleSelectionInfo) return FALSE; } - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetSelectionInfo), - sizeof(CONSOLE_GETSELECTIONINFO)); - if (!NT_SUCCESS(Status)) + GetSelectionInfoRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetSelectionInfo), + sizeof(*GetSelectionInfoRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } - *lpConsoleSelectionInfo = ApiMessage.Data.GetSelectionInfoRequest.Info; + *lpConsoleSelectionInfo = GetSelectionInfoRequest->Info; return TRUE; } @@ -2183,20 +2224,22 @@ HWND WINAPI GetConsoleWindow(VOID) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_GETWINDOW GetWindowRequest = &ApiMessage.Data.GetWindowRequest; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetConsoleWindow), - sizeof(CONSOLE_GETWINDOW)); - if (!NT_SUCCESS(Status)) + GetWindowRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetConsoleWindow), + sizeof(*GetWindowRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return (HWND)NULL; } - return ApiMessage.Data.GetWindowRequest.WindowHandle; + return GetWindowRequest->WindowHandle; } @@ -2207,24 +2250,25 @@ GetConsoleWindow(VOID) */ BOOL WINAPI -SetConsoleIcon(HICON hicon) +SetConsoleIcon(HICON hIcon) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_SETICON SetIconRequest = &ApiMessage.Data.SetIconRequest; - ApiMessage.Data.SetIconRequest.WindowIcon = hicon; + SetIconRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetIconRequest->IconHandle = hIcon; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetIcon), - sizeof(CONSOLE_SETICON)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetIcon), + sizeof(*SetIconRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } - return NT_SUCCESS(Status); + return TRUE; } diff --git a/reactos/include/psdk/wincon.h b/reactos/include/psdk/wincon.h index f03a8b19fad..b36712c7911 100644 --- a/reactos/include/psdk/wincon.h +++ b/reactos/include/psdk/wincon.h @@ -427,10 +427,10 @@ GetCurrentConsoleFont( #if (_WIN32_WINNT >= 0x0500) HWND WINAPI GetConsoleWindow(VOID); -BOOL APIENTRY GetConsoleDisplayMode(_Out_ LPDWORD lpModeFlags); +BOOL WINAPI GetConsoleDisplayMode(_Out_ LPDWORD lpModeFlags); BOOL -APIENTRY +WINAPI SetConsoleDisplayMode( _In_ HANDLE hConsoleOutput, _In_ DWORD dwFlags, @@ -607,8 +607,16 @@ BOOL WINAPI SetConsoleMenuClose(_In_ BOOL); BOOL WINAPI SetConsoleCursor(_In_ HANDLE, _In_ HCURSOR); /* Undocumented, see http://undoc.airesoft.co.uk/kernel32.dll/ShowConsoleCursor.php */ INT WINAPI ShowConsoleCursor(_In_ HANDLE, _In_ BOOL); +/* Undocumented */ +BOOL WINAPI SetConsoleIcon(_In_ HICON); /* Undocumented, see http://comments.gmane.org/gmane.comp.lang.harbour.devel/27844 */ BOOL WINAPI SetConsolePalette(_In_ HANDLE, _In_ HPALETTE, _In_ UINT); +/* Undocumented */ +BOOL WINAPI CloseConsoleHandle(_In_ HANDLE); +// HANDLE WINAPI GetStdHandle(_In_ DWORD); +// BOOL WINAPI SetStdHandle(_In_ DWORD, _In_ HANDLE); +/* Undocumented */ +BOOL WINAPI VerifyConsoleIoHandle(_In_ HANDLE); BOOL WINAPI diff --git a/reactos/include/reactos/subsys/win/conmsg.h b/reactos/include/reactos/subsys/win/conmsg.h index 71284ce5c47..04bb3bd65b5 100644 --- a/reactos/include/reactos/subsys/win/conmsg.h +++ b/reactos/include/reactos/subsys/win/conmsg.h @@ -197,9 +197,9 @@ C_ASSERT(sizeof(CONSRV_API_CONNECTINFO) == 0x638); typedef struct { - ULONG nMaxIds; - ULONG nProcessIdsTotal; - PDWORD pProcessIds; + HANDLE ConsoleHandle; + ULONG ProcessCount; + PDWORD ProcessIdsList; } CONSOLE_GETPROCESSLIST, *PCONSOLE_GETPROCESSLIST; typedef struct @@ -262,8 +262,14 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; - CONSOLE_SCREEN_BUFFER_INFO Info; + COORD ScreenBufferSize; + COORD CursorPosition; + COORD ViewOrigin; + WORD Attributes; + COORD ViewSize; + COORD MaximumViewSize; } CONSOLE_GETSCREENBUFFERINFO, *PCONSOLE_GETSCREENBUFFERINFO; typedef struct @@ -274,6 +280,7 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; BOOL Show; INT RefCount; @@ -281,8 +288,9 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; - HCURSOR hCursor; + HCURSOR CursorHandle; } CONSOLE_SETCURSOR, *PCONSOLE_SETCURSOR; typedef struct @@ -305,15 +313,17 @@ typedef struct typedef struct { - // HANDLE OutputHandle; - DWORD DisplayMode; + HANDLE ConsoleHandle; + DWORD DisplayMode; // ModeFlags } CONSOLE_GETDISPLAYMODE, *PCONSOLE_GETDISPLAYMODE; typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; - DWORD DisplayMode; + DWORD DisplayMode; // ModeFlags COORD NewSBDim; + HANDLE EventHandle; } CONSOLE_SETDISPLAYMODE, *PCONSOLE_SETDISPLAYMODE; /* @@ -324,7 +334,9 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; + DWORD Flags; DWORD State; } CONSOLE_GETSETHWSTATE, *PCONSOLE_GETSETHWSTATE; @@ -351,12 +363,14 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; SMALL_RECT Region; } CONSOLE_INVALIDATEDIBITS, *PCONSOLE_INVALIDATEDIBITS; typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; HPALETTE PaletteHandle; UINT Usage; @@ -501,11 +515,14 @@ typedef struct typedef struct { HANDLE ConsoleHandle; + HANDLE Handle; } CONSOLE_CLOSEHANDLE, *PCONSOLE_CLOSEHANDLE; typedef struct { + BOOL IsValid; HANDLE ConsoleHandle; + HANDLE Handle; } CONSOLE_VERIFYHANDLE, *PCONSOLE_VERIFYHANDLE; typedef struct @@ -543,15 +560,17 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; - DWORD dwCmdIdLow; - DWORD dwCmdIdHigh; - HMENU hMenu; + DWORD CmdIdLow; + DWORD CmdIdHigh; + HMENU MenuHandle; } CONSOLE_MENUCONTROL, *PCONSOLE_MENUCONTROL; typedef struct { - BOOL Enable; + HANDLE ConsoleHandle; + BOOL Enable; } CONSOLE_SETMENUCLOSE, *PCONSOLE_SETMENUCLOSE; typedef struct @@ -564,12 +583,14 @@ typedef struct typedef struct { - HWND WindowHandle; + HANDLE ConsoleHandle; + HWND WindowHandle; } CONSOLE_GETWINDOW, *PCONSOLE_GETWINDOW; typedef struct { - HICON WindowIcon; + HANDLE ConsoleHandle; + HICON IconHandle; } CONSOLE_SETICON, *PCONSOLE_SETICON; @@ -665,14 +686,24 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; CONSOLE_SELECTION_INFO Info; } CONSOLE_GETSELECTIONINFO, *PCONSOLE_GETSELECTIONINFO; typedef struct { - BOOL InputCP; // TRUE : Input Code Page ; FALSE : Output Code Page - UINT CodePage; -} CONSOLE_GETSETINPUTOUTPUTCP, *PCONSOLE_GETSETINPUTOUTPUTCP; + HANDLE ConsoleHandle; + UINT CodePage; + BOOL OutputCP; // TRUE : Output Code Page ; FALSE : Input Code Page +} CONSOLE_GETINPUTOUTPUTCP, *PCONSOLE_GETINPUTOUTPUTCP; + +typedef struct +{ + HANDLE ConsoleHandle; + UINT CodePage; + BOOL OutputCP; // TRUE : Output Code Page ; FALSE : Input Code Page + HANDLE EventHandle; +} CONSOLE_SETINPUTOUTPUTCP, *PCONSOLE_SETINPUTOUTPUTCP; typedef struct _CONSOLE_API_MESSAGE { @@ -764,7 +795,8 @@ typedef struct _CONSOLE_API_MESSAGE CONSOLE_GETNUMINPUTEVENTS GetNumInputEventsRequest; /* Input and Output Code Pages */ - CONSOLE_GETSETINPUTOUTPUTCP ConsoleCPRequest; + CONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest; + CONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest; } Data; } CONSOLE_API_MESSAGE, *PCONSOLE_API_MESSAGE; diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/console.c b/reactos/win32ss/user/winsrv/consrv/condrv/console.c index ccc1189b93b..338be5abaec 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/console.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/console.c @@ -1007,12 +1007,12 @@ ConDrvSetConsoleTitle(IN PCONSOLE Console, NTSTATUS NTAPI ConDrvGetConsoleCP(IN PCONSOLE Console, OUT PUINT CodePage, - IN BOOLEAN InputCP) + IN BOOLEAN OutputCP) { if (Console == NULL || CodePage == NULL) return STATUS_INVALID_PARAMETER; - *CodePage = (InputCP ? Console->CodePage : Console->OutputCodePage); + *CodePage = (OutputCP ? Console->OutputCodePage : Console->CodePage); return STATUS_SUCCESS; } @@ -1020,15 +1020,15 @@ ConDrvGetConsoleCP(IN PCONSOLE Console, NTSTATUS NTAPI ConDrvSetConsoleCP(IN PCONSOLE Console, IN UINT CodePage, - IN BOOLEAN InputCP) + IN BOOLEAN OutputCP) { if (Console == NULL || !IsValidCodePage(CodePage)) return STATUS_INVALID_PARAMETER; - if (InputCP) - Console->CodePage = CodePage; - else + if (OutputCP) Console->OutputCodePage = CodePage; + else + Console->CodePage = CodePage; return STATUS_SUCCESS; } diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/dummyfrontend.c b/reactos/win32ss/user/winsrv/consrv/condrv/dummyfrontend.c index 85a54be96cf..794aae2c5ff 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/dummyfrontend.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/dummyfrontend.c @@ -99,7 +99,7 @@ DummyChangeTitle(IN OUT PFRONTEND This) static BOOL NTAPI DummyChangeIcon(IN OUT PFRONTEND This, - HICON hWindowIcon) + HICON IconHandle) { return TRUE; } @@ -146,15 +146,15 @@ DummyShowMouseCursor(IN OUT PFRONTEND This, static BOOL NTAPI DummySetMouseCursor(IN OUT PFRONTEND This, - HCURSOR hCursor) + HCURSOR CursorHandle) { return TRUE; } static HMENU NTAPI DummyMenuControl(IN OUT PFRONTEND This, - UINT cmdIdLow, - UINT cmdIdHigh) + UINT CmdIdLow, + UINT CmdIdHigh) { return NULL; } diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/text.c b/reactos/win32ss/user/winsrv/consrv/condrv/text.c index 7c44235d219..5c1ab108d7e 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/text.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/text.c @@ -1153,26 +1153,33 @@ ConDrvFillConsoleOutput(IN PCONSOLE Console, } NTSTATUS NTAPI -ConDrvGetConsoleScreenBufferInfo(IN PCONSOLE Console, - IN PTEXTMODE_SCREEN_BUFFER Buffer, - OUT PCONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo) +ConDrvGetConsoleScreenBufferInfo(IN PCONSOLE Console, + IN PTEXTMODE_SCREEN_BUFFER Buffer, + OUT PCOORD ScreenBufferSize, + OUT PCOORD CursorPosition, + OUT PCOORD ViewOrigin, + OUT PCOORD ViewSize, + OUT PCOORD MaximumViewSize, + OUT PWORD Attributes) { - if (Console == NULL || Buffer == NULL || ScreenBufferInfo == NULL) + if (Console == NULL || Buffer == NULL || ScreenBufferSize == NULL || + CursorPosition == NULL || ViewOrigin == NULL || ViewSize == NULL || + MaximumViewSize == NULL || Attributes == NULL) + { return STATUS_INVALID_PARAMETER; + } /* Validity check */ ASSERT(Console == Buffer->Header.Console); - ScreenBufferInfo->dwSize = Buffer->ScreenBufferSize; - ScreenBufferInfo->dwCursorPosition = Buffer->CursorPosition; - ScreenBufferInfo->wAttributes = Buffer->ScreenDefaultAttrib; - ScreenBufferInfo->srWindow.Left = Buffer->ViewOrigin.X; - ScreenBufferInfo->srWindow.Top = Buffer->ViewOrigin.Y; - ScreenBufferInfo->srWindow.Right = Buffer->ViewOrigin.X + Buffer->ViewSize.X - 1; - ScreenBufferInfo->srWindow.Bottom = Buffer->ViewOrigin.Y + Buffer->ViewSize.Y - 1; + *ScreenBufferSize = Buffer->ScreenBufferSize; + *CursorPosition = Buffer->CursorPosition; + *ViewOrigin = Buffer->ViewOrigin; + *ViewSize = Buffer->ViewSize; + *Attributes = Buffer->ScreenDefaultAttrib; // FIXME: Refine the computation - ScreenBufferInfo->dwMaximumWindowSize = Buffer->ScreenBufferSize; + *MaximumViewSize = Buffer->ScreenBufferSize; return STATUS_SUCCESS; } diff --git a/reactos/win32ss/user/winsrv/consrv/conoutput.c b/reactos/win32ss/user/winsrv/consrv/conoutput.c index d2571b12cd9..fe04b8bd5fc 100644 --- a/reactos/win32ss/user/winsrv/consrv/conoutput.c +++ b/reactos/win32ss/user/winsrv/consrv/conoutput.c @@ -683,9 +683,14 @@ CSR_API(SrvFillConsoleOutput) } NTSTATUS NTAPI -ConDrvGetConsoleScreenBufferInfo(IN PCONSOLE Console, - IN PTEXTMODE_SCREEN_BUFFER Buffer, - OUT PCONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo); +ConDrvGetConsoleScreenBufferInfo(IN PCONSOLE Console, + IN PTEXTMODE_SCREEN_BUFFER Buffer, + OUT PCOORD ScreenBufferSize, + OUT PCOORD CursorPosition, + OUT PCOORD ViewOrigin, + OUT PCOORD ViewSize, + OUT PCOORD MaximumViewSize, + OUT PWORD Attributes); CSR_API(SrvGetConsoleScreenBufferInfo) { NTSTATUS Status; @@ -701,7 +706,12 @@ CSR_API(SrvGetConsoleScreenBufferInfo) Status = ConDrvGetConsoleScreenBufferInfo(Buffer->Header.Console, Buffer, - &ScreenBufferInfoRequest->Info); + &ScreenBufferInfoRequest->ScreenBufferSize, + &ScreenBufferInfoRequest->CursorPosition, + &ScreenBufferInfoRequest->ViewOrigin, + &ScreenBufferInfoRequest->ViewSize, + &ScreenBufferInfoRequest->MaximumViewSize, + &ScreenBufferInfoRequest->Attributes); ConSrvReleaseScreenBuffer(Buffer, TRUE); return Status; diff --git a/reactos/win32ss/user/winsrv/consrv/console.c b/reactos/win32ss/user/winsrv/consrv/console.c index f9152e0e02d..8cc401abe5b 100644 --- a/reactos/win32ss/user/winsrv/consrv/console.c +++ b/reactos/win32ss/user/winsrv/consrv/console.c @@ -543,22 +543,22 @@ CSR_API(SrvSetConsoleTitle) NTSTATUS NTAPI ConDrvGetConsoleCP(IN PCONSOLE Console, OUT PUINT CodePage, - IN BOOLEAN InputCP); + IN BOOLEAN OutputCP); CSR_API(SrvGetConsoleCP) { NTSTATUS Status; - PCONSOLE_GETSETINPUTOUTPUTCP ConsoleCPRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ConsoleCPRequest; + PCONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetConsoleCPRequest; PCONSOLE Console; DPRINT("SrvGetConsoleCP, getting %s Code Page\n", - ConsoleCPRequest->InputCP ? "Input" : "Output"); + GetConsoleCPRequest->OutputCP ? "Output" : "Input"); Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; Status = ConDrvGetConsoleCP(Console, - &ConsoleCPRequest->CodePage, - ConsoleCPRequest->InputCP); + &GetConsoleCPRequest->CodePage, + GetConsoleCPRequest->OutputCP); ConSrvReleaseConsole(Console, TRUE); return Status; @@ -567,22 +567,22 @@ CSR_API(SrvGetConsoleCP) NTSTATUS NTAPI ConDrvSetConsoleCP(IN PCONSOLE Console, IN UINT CodePage, - IN BOOLEAN InputCP); + IN BOOLEAN OutputCP); CSR_API(SrvSetConsoleCP) { NTSTATUS Status = STATUS_INVALID_PARAMETER; - PCONSOLE_GETSETINPUTOUTPUTCP ConsoleCPRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.ConsoleCPRequest; + PCONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetConsoleCPRequest; PCONSOLE Console; DPRINT("SrvSetConsoleCP, setting %s Code Page\n", - ConsoleCPRequest->InputCP ? "Input" : "Output"); + SetConsoleCPRequest->OutputCP ? "Output" : "Input"); Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; Status = ConDrvSetConsoleCP(Console, - ConsoleCPRequest->CodePage, - ConsoleCPRequest->InputCP); + SetConsoleCPRequest->CodePage, + SetConsoleCPRequest->OutputCP); ConSrvReleaseConsole(Console, TRUE); return Status; @@ -600,8 +600,8 @@ CSR_API(SrvGetConsoleProcessList) PCONSOLE Console; if (!CsrValidateMessageBuffer(ApiMessage, - (PVOID)&GetProcessListRequest->pProcessIds, - GetProcessListRequest->nMaxIds, + (PVOID)&GetProcessListRequest->ProcessIdsList, + GetProcessListRequest->ProcessCount, sizeof(DWORD))) { return STATUS_INVALID_PARAMETER; @@ -611,9 +611,9 @@ CSR_API(SrvGetConsoleProcessList) if (!NT_SUCCESS(Status)) return Status; Status = ConDrvGetConsoleProcessList(Console, - GetProcessListRequest->pProcessIds, - GetProcessListRequest->nMaxIds, - &GetProcessListRequest->nProcessIdsTotal); + GetProcessListRequest->ProcessIdsList, + GetProcessListRequest->ProcessCount, + &GetProcessListRequest->ProcessCount); ConSrvReleaseConsole(Console, TRUE); return Status; diff --git a/reactos/win32ss/user/winsrv/consrv/frontendctl.c b/reactos/win32ss/user/winsrv/consrv/frontendctl.c index 5d175b4df36..7294fa74d1b 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontendctl.c +++ b/reactos/win32ss/user/winsrv/consrv/frontendctl.c @@ -222,7 +222,7 @@ CSR_API(SrvSetConsoleCursor) Console = Buff->Header.Console; - Success = TermSetMouseCursor(Console, SetCursorRequest->hCursor); + Success = TermSetMouseCursor(Console, SetCursorRequest->CursorHandle); ConSrvReleaseScreenBuffer(Buff, TRUE); return (Success ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL); @@ -244,9 +244,9 @@ CSR_API(SrvConsoleMenuControl) Console = Buff->Header.Console; - MenuControlRequest->hMenu = TermMenuControl(Console, - MenuControlRequest->dwCmdIdLow, - MenuControlRequest->dwCmdIdHigh); + MenuControlRequest->MenuHandle = TermMenuControl(Console, + MenuControlRequest->CmdIdLow, + MenuControlRequest->CmdIdHigh); ConSrvReleaseScreenBuffer(Buff, TRUE); return STATUS_SUCCESS; @@ -293,7 +293,7 @@ CSR_API(SrvSetConsoleIcon) Status = ConSrvGetConsole(ConsoleGetPerProcessData(CsrGetClientThread()->Process), &Console, TRUE); if (!NT_SUCCESS(Status)) return Status; - Status = (TermChangeIcon(Console, SetIconRequest->WindowIcon) + Status = (TermChangeIcon(Console, SetIconRequest->IconHandle) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL); diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h index 9851a36dffe..5041dadedc1 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h @@ -64,8 +64,8 @@ typedef struct _GUI_CONSOLE_DATA BOOL IgnoreNextMouseSignal; /* Used in cases where we don't want to treat a mouse signal */ BOOL IsCloseButtonEnabled; /* TRUE if the Close button and the corresponding system menu item are enabled (default), FALSE otherwise */ - UINT cmdIdLow ; /* Lowest menu id of the user-reserved menu id range */ - UINT cmdIdHigh; /* Highest menu id of the user-reserved menu id range */ + UINT CmdIdLow ; /* Lowest menu id of the user-reserved menu id range */ + UINT CmdIdHigh; /* Highest menu id of the user-reserved menu id range */ // COLORREF Colors[16]; diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c index 7db806cff86..bffeeca0926 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c @@ -231,6 +231,7 @@ GuiSendMenuEvent(PCONSOLE Console, UINT CmdId) er.EventType = MENU_EVENT; er.Event.MenuEvent.dwCommandId = CmdId; + DPRINT1("Menu item ID: %d\n", CmdId); ConioProcessInputEvent(Console, &er); } @@ -265,7 +266,7 @@ GuiConsoleHandleSysMenuCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM * send to him a menu event and return directly. The user must handle those * reserved menu commands... */ - if (GuiData->cmdIdLow <= (UINT)wParam && (UINT)wParam <= GuiData->cmdIdHigh) + if (GuiData->CmdIdLow <= (UINT)wParam && (UINT)wParam <= GuiData->CmdIdHigh) { GuiSendMenuEvent(Console, (UINT)wParam); goto Unlock_Quit; @@ -2462,7 +2463,7 @@ GuiInitFrontEnd(IN OUT PFRONTEND This, GuiData->IsCloseButtonEnabled = TRUE; /* There is no user-reserved menu id range by default */ - GuiData->cmdIdLow = GuiData->cmdIdHigh = 0; + GuiData->CmdIdLow = GuiData->CmdIdHigh = 0; /* * We need to wait until the GUI has been fully initialized @@ -2747,7 +2748,7 @@ GuiProcessKeyCallback(IN OUT PFRONTEND This, static BOOL NTAPI GuiSetMouseCursor(IN OUT PFRONTEND This, - HCURSOR hCursor); + HCURSOR CursorHandle); static VOID NTAPI GuiRefreshInternalInfo(IN OUT PFRONTEND This) @@ -2781,20 +2782,20 @@ GuiChangeTitle(IN OUT PFRONTEND This) static BOOL NTAPI GuiChangeIcon(IN OUT PFRONTEND This, - HICON hWindowIcon) + HICON IconHandle) { PGUI_CONSOLE_DATA GuiData = This->Data; HICON hIcon, hIconSm; - if (hWindowIcon == NULL) + if (IconHandle == NULL) { hIcon = ghDefaultIcon; hIconSm = ghDefaultIconSm; } else { - hIcon = CopyIcon(hWindowIcon); - hIconSm = CopyIcon(hWindowIcon); + hIcon = CopyIcon(IconHandle); + hIconSm = CopyIcon(IconHandle); } if (hIcon == NULL) @@ -2953,7 +2954,7 @@ GuiShowMouseCursor(IN OUT PFRONTEND This, static BOOL NTAPI GuiSetMouseCursor(IN OUT PFRONTEND This, - HCURSOR hCursor) + HCURSOR CursorHandle) { PGUI_CONSOLE_DATA GuiData = This->Data; @@ -2961,7 +2962,7 @@ GuiSetMouseCursor(IN OUT PFRONTEND This, * Set the cursor's handle. If the given handle is NULL, * then restore the default cursor. */ - GuiData->hCursor = (hCursor ? hCursor : ghDefaultCursor); + GuiData->hCursor = (CursorHandle ? CursorHandle : ghDefaultCursor); /* Effectively modify the shape of the cursor (use special values for (w|l)Param) */ PostMessageW(GuiData->hWindow, WM_SETCURSOR, -1, -1); @@ -2971,13 +2972,13 @@ GuiSetMouseCursor(IN OUT PFRONTEND This, static HMENU NTAPI GuiMenuControl(IN OUT PFRONTEND This, - UINT cmdIdLow, - UINT cmdIdHigh) + UINT CmdIdLow, + UINT CmdIdHigh) { PGUI_CONSOLE_DATA GuiData = This->Data; - GuiData->cmdIdLow = cmdIdLow ; - GuiData->cmdIdHigh = cmdIdHigh; + GuiData->CmdIdLow = CmdIdLow ; + GuiData->CmdIdHigh = CmdIdHigh; return GetSystemMenu(GuiData->hWindow, FALSE); } diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c b/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c index 4586f7db0e7..0f3a8dad47d 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c @@ -726,7 +726,7 @@ TuiChangeTitle(IN OUT PFRONTEND This) static BOOL NTAPI TuiChangeIcon(IN OUT PFRONTEND This, - HICON hWindowIcon) + HICON IconHandle) { return TRUE; } @@ -778,15 +778,15 @@ TuiShowMouseCursor(IN OUT PFRONTEND This, static BOOL NTAPI TuiSetMouseCursor(IN OUT PFRONTEND This, - HCURSOR hCursor) + HCURSOR CursorHandle) { return TRUE; } static HMENU NTAPI TuiMenuControl(IN OUT PFRONTEND This, - UINT cmdIdLow, - UINT cmdIdHigh) + UINT CmdIdLow, + UINT CmdIdHigh) { return NULL; } diff --git a/reactos/win32ss/user/winsrv/consrv/handle.c b/reactos/win32ss/user/winsrv/consrv/handle.c index e51479da206..9f268d2513c 100644 --- a/reactos/win32ss/user/winsrv/consrv/handle.c +++ b/reactos/win32ss/user/winsrv/consrv/handle.c @@ -836,7 +836,7 @@ CSR_API(SrvCloseHandle) return Status; } - Status = ConSrvRemoveObject(ProcessData, CloseHandleRequest->ConsoleHandle); + Status = ConSrvRemoveObject(ProcessData, CloseHandleRequest->Handle); ConSrvReleaseConsole(Console, TRUE); return Status; @@ -849,8 +849,10 @@ CSR_API(SrvVerifyConsoleIoHandle) PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); PCONSOLE Console; - HANDLE ConsoleHandle = VerifyHandleRequest->ConsoleHandle; - ULONG Index = HandleToULong(ConsoleHandle) >> 2; + HANDLE IoHandle = VerifyHandleRequest->Handle; + ULONG Index = HandleToULong(IoHandle) >> 2; + + VerifyHandleRequest->IsValid = FALSE; Status = ConSrvGetConsole(ProcessData, &Console, TRUE); if (!NT_SUCCESS(Status)) @@ -864,18 +866,21 @@ CSR_API(SrvVerifyConsoleIoHandle) // ASSERT( (ProcessData->HandleTable == NULL && ProcessData->HandleTableSize == 0) || // (ProcessData->HandleTable != NULL && ProcessData->HandleTableSize != 0) ); - if (!IsConsoleHandle(ConsoleHandle) || + if (!IsConsoleHandle(IoHandle) || Index >= ProcessData->HandleTableSize || ProcessData->HandleTable[Index].Object == NULL) { DPRINT("SrvVerifyConsoleIoHandle failed\n"); - Status = STATUS_INVALID_HANDLE; + } + else + { + VerifyHandleRequest->IsValid = TRUE; } RtlLeaveCriticalSection(&ProcessData->HandleTableLock); ConSrvReleaseConsole(Console, TRUE); - return Status; + return STATUS_SUCCESS; } /* EOF */ diff --git a/reactos/win32ss/user/winsrv/consrv/include/conio.h b/reactos/win32ss/user/winsrv/consrv/include/conio.h index c54dab7b9cb..a60e95f8ca6 100644 --- a/reactos/win32ss/user/winsrv/consrv/include/conio.h +++ b/reactos/win32ss/user/winsrv/consrv/include/conio.h @@ -224,7 +224,7 @@ typedef struct _FRONTEND_VTBL */ VOID (NTAPI *ChangeTitle)(IN OUT PFRONTEND This); BOOL (NTAPI *ChangeIcon)(IN OUT PFRONTEND This, - HICON hWindowIcon); + HICON IconHandle); HWND (NTAPI *GetConsoleWindowHandle)(IN OUT PFRONTEND This); VOID (NTAPI *GetLargestConsoleWindowSize)(IN OUT PFRONTEND This, PCOORD pSize); @@ -237,10 +237,10 @@ typedef struct _FRONTEND_VTBL INT (NTAPI *ShowMouseCursor)(IN OUT PFRONTEND This, BOOL Show); BOOL (NTAPI *SetMouseCursor)(IN OUT PFRONTEND This, - HCURSOR hCursor); + HCURSOR CursorHandle); HMENU (NTAPI *MenuControl)(IN OUT PFRONTEND This, - UINT cmdIdLow, - UINT cmdIdHigh); + UINT CmdIdLow, + UINT CmdIdHigh); BOOL (NTAPI *SetMenuClose)(IN OUT PFRONTEND This, BOOL Enable); diff --git a/reactos/win32ss/user/winsrv/consrv/include/term.h b/reactos/win32ss/user/winsrv/consrv/include/term.h index f82025f60d0..c8c68ae82a9 100644 --- a/reactos/win32ss/user/winsrv/consrv/include/term.h +++ b/reactos/win32ss/user/winsrv/consrv/include/term.h @@ -32,8 +32,8 @@ #define TermChangeTitle(Console) \ (Console)->TermIFace.Vtbl->ChangeTitle(&(Console)->TermIFace) -#define TermChangeIcon(Console, hWindowIcon) \ - (Console)->TermIFace.Vtbl->ChangeIcon(&(Console)->TermIFace, (hWindowIcon)) +#define TermChangeIcon(Console, IconHandle) \ + (Console)->TermIFace.Vtbl->ChangeIcon(&(Console)->TermIFace, (IconHandle)) #define TermGetConsoleWindowHandle(Console) \ (Console)->TermIFace.Vtbl->GetConsoleWindowHandle(&(Console)->TermIFace) #define TermGetLargestConsoleWindowSize(Console, pSize) \ @@ -46,8 +46,8 @@ (Console)->TermIFace.Vtbl->SetDisplayMode(&(Console)->TermIFace, (NewMode)) #define TermShowMouseCursor(Console, Show) \ (Console)->TermIFace.Vtbl->ShowMouseCursor(&(Console)->TermIFace, (Show)) -#define TermSetMouseCursor(Console, hCursor) \ - (Console)->TermIFace.Vtbl->SetMouseCursor(&(Console)->TermIFace, (hCursor)) +#define TermSetMouseCursor(Console, CursorHandle) \ + (Console)->TermIFace.Vtbl->SetMouseCursor(&(Console)->TermIFace, (CursorHandle)) #define TermMenuControl(Console, CmdIdLow, CmdIdHigh) \ (Console)->TermIFace.Vtbl->MenuControl(&(Console)->TermIFace, (CmdIdLow), (CmdIdHigh)) #define TermSetMenuClose(Console, Enable) \ From 9602dba13e7d50e243eddaec7b9002168d5ad80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 8 Mar 2014 16:44:04 +0000 Subject: [PATCH 079/419] [CONSRV]: Fix menu ids for not clashing with user-defined ones. svn path=/trunk/; revision=62461 --- .../winsrv/consrv/frontends/gui/resource.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/resource.h b/reactos/win32ss/user/winsrv/consrv/frontends/gui/resource.h index 05aeefe1783..1b79e6e8ac1 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/resource.h +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/resource.h @@ -7,14 +7,16 @@ #pragma once -#define ID_SYSTEM_EDIT_MARK 1001 -#define ID_SYSTEM_EDIT_COPY 1002 -#define ID_SYSTEM_EDIT_PASTE 1003 -#define ID_SYSTEM_EDIT_SELECTALL 1004 -#define ID_SYSTEM_EDIT_SCROLL 1005 -#define ID_SYSTEM_EDIT_FIND 1006 -#define ID_SYSTEM_DEFAULTS 1007 -#define ID_SYSTEM_PROPERTIES 1008 +// Console System Menu Item IDs. +// Use IDs in the range 0xFFFx for not clashing with user-defined menu IDs. +#define ID_SYSTEM_EDIT_MARK 0xFFF0 +#define ID_SYSTEM_EDIT_COPY 0xFFF1 +#define ID_SYSTEM_EDIT_PASTE 0xFFF2 +#define ID_SYSTEM_EDIT_SELECTALL 0xFFF3 +#define ID_SYSTEM_EDIT_SCROLL 0xFFF4 +#define ID_SYSTEM_EDIT_FIND 0xFFF5 +#define ID_SYSTEM_DEFAULTS 0xFFF6 +#define ID_SYSTEM_PROPERTIES 0xFFF7 #define NCPOPUP_MENU 103 From 315180ba07b19cedfea120e098fd63e373ab4da5 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 8 Mar 2014 18:57:45 +0000 Subject: [PATCH 080/419] [PSEH3] Add a bit more code to support Clang and C++. svn path=/trunk/; revision=62462 --- reactos/include/reactos/libs/pseh/pseh3.h | 73 ++++++++++++++++++++--- 1 file changed, 66 insertions(+), 7 deletions(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index 035c099b343..cc82a0d5b04 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -12,6 +12,10 @@ #include "excpt.h" +#ifdef __cplusplus +extern "C" { +#endif + /* CLANG must safe non-volatiles, because it uses a return-twice algorithm */ #if defined(__clang__) && !defined(_SEH3$_FRAME_ALL_NONVOLATILES) #define _SEH3$_FRAME_ALL_NONVOLATILES 1 @@ -207,6 +211,46 @@ _SEH3$_Unregister( #define _SEH3$_DECLARE_FILTER_FUNC(_Name) #define _SEH3$_DEFINE_DUMMY_FINALLY(_Name) +/* The "nested" functions are a piece of code with a ret instruction at the end */ +#define _SEH3$_NESTED_FUNC_OPEN() \ + { \ + int SavedEsp, result = 0; \ +\ + /* Save esp */ \ + asm volatile ("movl %%esp, %[SavedEsp]\n" : : [SavedEsp]"m"(SavedEsp)); + +#define _SEH3$_NESTED_FUNC_CLOSE() \ + /* Restore esp and return to the caller */ \ + asm volatile ("movl %[SavedEsp], %%esp\nret\n" \ + : : "a"(result), [SavedEsp]"irm"(SavedEsp)); \ + } + +/* The filter function */ +#define _SEH3$_DEFINE_FILTER_FUNC(_Name, expression) \ + _SEH3$_NESTED_FUNC_OPEN() \ + { \ + /* Evaluate the filter expression */ \ + result = (expression); \ + } \ + _SEH3$_NESTED_FUNC_CLOSE() + +#define _SEH3$_FINALLY_FUNC_OPEN(_Name) \ + _SEH3$_NESTED_FUNC_OPEN() \ + /* This construct makes sure that the finally function returns */ \ + /* a proper value at the end */ \ + for (; ; (void)({asm volatile ("movl %[SavedEsp], %%esp\nret\n" \ + : : "a"(result), [SavedEsp]"irm"(SavedEsp)); 0;})) + +#define _SEH3$_FILTER(_Filter, _FilterExpression) (&&_SEH3$_l_FilterOrFinally) +#define _SEH3$_FINALLY(_Finally) 0 + +#define _SEH3$_DECLARE_EXCEPT_INTRINSICS() + +/* Since we cannot use nested functions, we declare these globally as macros */ +#define _abnormal_termination() (_SEH3$_TrylevelFrame.ScopeTable != 0) +#define _exception_code() (_SEH3$_TrylevelFrame.ExceptionPointers->ExceptionRecord->ExceptionCode) +#define _exception_info() (_SEH3$_TrylevelFrame.ExceptionPointers) + #else /* __cplusplus || __clang__ */ #define _SEH3$_DECLARE_EXCEPT_INTRINSICS() \ @@ -246,11 +290,17 @@ _SEH3$_Unregister( _SEH3$_NESTED_FUNC_OPEN(_Name) \ /* Declare the intrinsics for the finally function */ \ inline __attribute__((always_inline, gnu_inline)) \ - int _abnormal_termination() { return (_SEH3$_TrylevelFrame.ScopeTable != 0); } + int _abnormal_termination() { return (_SEH3$_TrylevelFrame.ScopeTable != 0); } \ +\ + /* This construct makes sure that the finally function returns */ \ + /* a proper value at the end */ \ + for (; ; (void)({return 0; 0;})) #define _SEH3$_FILTER(_Filter, _FilterExpression) \ (__builtin_constant_p(_FilterExpression) ? (void*)(unsigned long)(unsigned char)(unsigned long)(_FilterExpression) : _Filter) +#define _SEH3$_FINALLY(_Finally) (_Finally) + #define _SEH3$_DEFINE_DUMMY_FINALLY(_Name) \ auto inline __attribute__((always_inline,gnu_inline)) int _Name(int Action) { (void)Action; return 0; } @@ -284,7 +334,9 @@ _SEH3$_Unregister( __label__ _SEH3$_l_EndTry; \ __label__ _SEH3$_l_HandlerTarget; \ __label__ _SEH3$_l_OnException; \ + __label__ _SEH3$_l_BeforeFilterOrFinally; \ __label__ _SEH3$_l_FilterOrFinally; \ + (void)&&_SEH3$_l_BeforeFilterOrFinally; \ (void)&&_SEH3$_l_FilterOrFinally; \ \ /* Count the try level. Outside of any __try, _SEH3$_TryLevel is 0 */ \ @@ -332,6 +384,10 @@ _SEH3$_Unregister( _SEH3$_DECLARE_EXCEPT_INTRINSICS(); \ \ goto _SEH3$_l_DoTry; \ +\ + _SEH3$_l_BeforeFilterOrFinally: (void)0; \ + /* Make sure the filter function doesn't use esp */ \ + _SEH3$_EnforceFramePointer(); \ \ _SEH3$_l_FilterOrFinally: (void)0; \ /* Emit the filter function */ \ @@ -363,7 +419,7 @@ _SEH3$_Unregister( _SEH3$_DECLARE_FILTER_FUNC(_SEH3$_FinallyFunction); \ \ /* Create a static data table that contains the finally function */ \ - static const SEH3$_SCOPE_TABLE _SEH3$_ScopeTable = { 0, &_SEH3$_FinallyFunction }; \ + static const SEH3$_SCOPE_TABLE _SEH3$_ScopeTable = { 0, _SEH3$_FINALLY(&_SEH3$_FinallyFunction) }; \ \ /* Register the registration record. */ \ if (_SEH3$_TryLevel == 1) _SEH3$_RegisterFrame_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ @@ -374,11 +430,9 @@ _SEH3$_Unregister( _SEH3$_l_HandlerTarget: (void)0; \ _SEH3$_EnforceFramePointer(); \ \ + _SEH3$_l_BeforeFilterOrFinally: (void)0; \ _SEH3$_l_FilterOrFinally: (void)0; \ - _SEH3$_FINALLY_FUNC_OPEN(_SEH3$_FinallyFunction) \ - /* This construct makes sure that the finally function returns */ \ - /* a proper value at the end */ \ - for (; ; (void)({return 0; 0;})) + _SEH3$_FINALLY_FUNC_OPEN(_SEH3$_FinallyFunction) #define _SEH3_END \ @@ -388,7 +442,7 @@ _SEH3$_Unregister( \ _SEH3$_l_OnException: (void)0; \ /* Force GCC to create proper code pathes */ \ - _SEH3$_SCARE_GCC() \ + _SEH3$_SCARE_GCC(); \ \ _SEH3$_l_EndTry:(void)0; \ _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ @@ -402,3 +456,8 @@ _SEH3$_Unregister( #define _SEH3_LEAVE goto _SEH3$_l_AfterTry #define _SEH3_VOLATILE volatile + + +#ifdef __cplusplus +}; // extern "C" +#endif From e4fbb93e96b3df8bab75e44bc91093ff28103f3a Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 8 Mar 2014 21:12:07 +0000 Subject: [PATCH 081/419] [LSALIB] LsaLogonUser: Pass the SubStatus to the caller before leaving the function in case of an error. svn path=/trunk/; revision=62463 --- reactos/lib/lsalib/lsa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/lib/lsalib/lsa.c b/reactos/lib/lsalib/lsa.c index 7551f989cb9..210fb22854f 100644 --- a/reactos/lib/lsalib/lsa.c +++ b/reactos/lib/lsalib/lsa.c @@ -277,6 +277,8 @@ LsaLogonUser(HANDLE LsaHandle, return Status; } + *SubStatus = ApiMessage.LogonUser.Reply.SubStatus; + if (!NT_SUCCESS(ApiMessage.Status)) { return ApiMessage.Status; @@ -287,7 +289,6 @@ LsaLogonUser(HANDLE LsaHandle, *LogonId = ApiMessage.LogonUser.Reply.LogonId; *Token = ApiMessage.LogonUser.Reply.Token; *Quotas = ApiMessage.LogonUser.Reply.Quotas; - *SubStatus = ApiMessage.LogonUser.Reply.SubStatus; return Status; } From 88a9cdffba2f0dafead0f41caabfff7f67546656 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 8 Mar 2014 22:13:19 +0000 Subject: [PATCH 082/419] [MSGINA] - Split DoLoginTasks into DoLoginTasks and CreateProfile, and fix all callers of DoLoginTasks accordingly. - Make DoLoginTasks pass the SubStatus from MyLogonUser to its caller. - Move the logon code from LoggedOutWindowProc to a new function DoLogon and add some experimental code to report logon errors to the user (still WIP). svn path=/trunk/; revision=62464 --- reactos/dll/win32/msgina/gui.c | 121 ++++++++++++++++++++++-------- reactos/dll/win32/msgina/msgina.c | 68 +++++++++++------ reactos/dll/win32/msgina/msgina.h | 10 ++- reactos/dll/win32/msgina/tui.c | 14 +++- 4 files changed, 153 insertions(+), 60 deletions(-) diff --git a/reactos/dll/win32/msgina/gui.c b/reactos/dll/win32/msgina/gui.c index e9ad0a99276..0fc6b0bc0c8 100644 --- a/reactos/dll/win32/msgina/gui.c +++ b/reactos/dll/win32/msgina/gui.c @@ -920,6 +920,90 @@ GUILoggedOnSAS( return result; } + +static +INT +DoLogon( + IN HWND hwndDlg, + IN OUT PGINA_CONTEXT pgContext) +{ + LPWSTR UserName = NULL; + LPWSTR Password = NULL; + LPWSTR Domain = NULL; + INT result = WLX_SAS_ACTION_NONE; + NTSTATUS Status, SubStatus = STATUS_SUCCESS; + + if (GetTextboxText(hwndDlg, IDC_USERNAME, &UserName) && *UserName == '\0') + goto done; + + if (GetTextboxText(hwndDlg, IDC_LOGON_TO, &Domain) && *Domain == '\0') + goto done; + + if (!GetTextboxText(hwndDlg, IDC_PASSWORD, &Password)) + goto done; + + Status = DoLoginTasks(pgContext, UserName, Domain, Password, &SubStatus); + if (!NT_SUCCESS(Status)) + { +TRACE("DoLoginTasks failed! Status 0x%08lx SubStatus 0x%08lx\n", Status, SubStatus); + + if (SubStatus == STATUS_ACCOUNT_DISABLED) + { +TRACE("Account disabled!\n"); + pgContext->pWlxFuncs->WlxMessageBox(pgContext->hWlx, + hwndDlg, + L"Account disabled!", + L"Logon error", + MB_OK | MB_ICONERROR); + + goto done; + } + else if (SubStatus == STATUS_ACCOUNT_LOCKED_OUT) + { +TRACE("Account locked!\n"); + pgContext->pWlxFuncs->WlxMessageBox(pgContext->hWlx, + hwndDlg, + L"Account locked!", + L"Logon error", + MB_OK | MB_ICONERROR); + goto done; + } + else + { +TRACE("Other error!\n"); + pgContext->pWlxFuncs->WlxMessageBox(pgContext->hWlx, + hwndDlg, + L"Other error!", + L"Logon error", + MB_OK | MB_ICONERROR); + goto done; + } + } + + if (!CreateProfile(pgContext, UserName, Domain, Password)) + { + ERR("Failed to create the profile!\n"); + goto done; + } + + ZeroMemory(pgContext->Password, 256 * sizeof(WCHAR)); + wcscpy(pgContext->Password, Password); + + result = WLX_SAS_ACTION_LOGON; + +done: + if (UserName != NULL) + HeapFree(GetProcessHeap(), 0, UserName); + + if (Password != NULL) + HeapFree(GetProcessHeap(), 0, Password); + + if (Domain != NULL) + HeapFree(GetProcessHeap(), 0, Domain); + + return result; +} + static INT_PTR CALLBACK LoggedOutWindowProc( IN HWND hwndDlg, @@ -934,7 +1018,6 @@ LoggedOutWindowProc( switch (uMsg) { case WM_INITDIALOG: - { /* FIXME: take care of NoDomainUI */ pgContext = (PGINA_CONTEXT)lParam; SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)pgContext); @@ -955,7 +1038,7 @@ LoggedOutWindowProc( pgContext->hBitmap = LoadImage(hDllInstance, MAKEINTRESOURCE(IDI_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); return TRUE; - } + case WM_PAINT: { PAINTSTRUCT ps; @@ -968,51 +1051,27 @@ LoggedOutWindowProc( } return TRUE; } + case WM_DESTROY: - { DeleteObject(pgContext->hBitmap); return TRUE; - } + case WM_COMMAND: - { switch (LOWORD(wParam)) { case IDOK: - { - LPWSTR UserName = NULL, Password = NULL, Domain = NULL; - INT result = WLX_SAS_ACTION_NONE; - - if (GetTextboxText(hwndDlg, IDC_USERNAME, &UserName) && *UserName == '\0') - break; - if (GetTextboxText(hwndDlg, IDC_LOGON_TO, &Domain) && *Domain == '\0') - break; - if (GetTextboxText(hwndDlg, IDC_PASSWORD, &Password) && - DoLoginTasks(pgContext, UserName, Domain, Password)) - { - ZeroMemory(pgContext->Password, 256 * sizeof(WCHAR)); - wcscpy(pgContext->Password, Password); - - result = WLX_SAS_ACTION_LOGON; - } - HeapFree(GetProcessHeap(), 0, UserName); - HeapFree(GetProcessHeap(), 0, Password); - HeapFree(GetProcessHeap(), 0, Domain); - EndDialog(hwndDlg, result); + EndDialog(hwndDlg, DoLogon(hwndDlg, pgContext)); return TRUE; - } + case IDCANCEL: - { EndDialog(hwndDlg, WLX_SAS_ACTION_NONE); return TRUE; - } + case IDC_SHUTDOWN: - { EndDialog(hwndDlg, WLX_SAS_ACTION_SHUTDOWN); return TRUE; - } } break; - } } return FALSE; diff --git a/reactos/dll/win32/msgina/msgina.c b/reactos/dll/win32/msgina/msgina.c index 6480cbef32a..4f5d10cdd2f 100644 --- a/reactos/dll/win32/msgina/msgina.c +++ b/reactos/dll/win32/msgina/msgina.c @@ -686,8 +686,41 @@ done: } -BOOL +NTSTATUS DoLoginTasks( + IN OUT PGINA_CONTEXT pgContext, + IN PWSTR UserName, + IN PWSTR Domain, + IN PWSTR Password, + OUT PNTSTATUS SubStatus) +{ + NTSTATUS Status; + + Status = ConnectToLsa(pgContext); + if (!NT_SUCCESS(Status)) + { + WARN("ConnectToLsa() failed (Status 0x%08lx)\n", Status); + return Status; + } + + Status = MyLogonUser(pgContext->LsaHandle, + pgContext->AuthenticationPackage, + UserName, + Domain, + Password, + &pgContext->UserToken, + SubStatus); + if (!NT_SUCCESS(Status)) + { + WARN("MyLogonUser() failed (Status 0x%08lx)\n", Status); + } + + return Status; +} + + +BOOL +CreateProfile( IN OUT PGINA_CONTEXT pgContext, IN PWSTR UserName, IN PWSTR Domain, @@ -700,28 +733,6 @@ DoLoginTasks( DWORD cbStats, cbSize; DWORD dwLength; BOOL bResult; - NTSTATUS SubStatus; - NTSTATUS Status; - - Status = ConnectToLsa(pgContext); - if (!NT_SUCCESS(Status)) - { - WARN("ConnectToLsa() failed\n"); - return FALSE; - } - - Status = MyLogonUser(pgContext->LsaHandle, - pgContext->AuthenticationPackage, - UserName, - Domain, - Password, - &pgContext->UserToken, - &SubStatus); - if (!NT_SUCCESS(Status)) - { - WARN("MyLogonUser() failed\n"); - goto cleanup; - } /* Store the logon time in the context */ GetLocalTime(&pgContext->LogonTime); @@ -822,6 +833,8 @@ DoAutoLogon( LPWSTR Password = NULL; BOOL result = FALSE; LONG rc; + NTSTATUS Status; + NTSTATUS SubStatus = STATUS_SUCCESS; TRACE("DoAutoLogon(): AutoLogonState = %lu\n", pgContext->AutoLogonState); @@ -884,8 +897,15 @@ DoAutoLogon( if (rc != ERROR_SUCCESS) goto cleanup; - result = DoLoginTasks(pgContext, UserName, Domain, Password); + Status = DoLoginTasks(pgContext, UserName, Domain, Password, &SubStatus); + if (!NT_SUCCESS(Status)) + { + /* FIXME: Handle errors!!! */ + result = FALSE; + goto cleanup; + } + result = CreateProfile(pgContext, UserName, Domain, Password); if (result == TRUE) { ZeroMemory(pgContext->Password, 256 * sizeof(WCHAR)); diff --git a/reactos/dll/win32/msgina/msgina.h b/reactos/dll/win32/msgina/msgina.h index a6ba264d0cf..eaaf68d0c43 100644 --- a/reactos/dll/win32/msgina/msgina.h +++ b/reactos/dll/win32/msgina/msgina.h @@ -104,8 +104,16 @@ DoAdminUnlock( IN PWSTR Domain, IN PWSTR Password); -BOOL +NTSTATUS DoLoginTasks( + IN OUT PGINA_CONTEXT pgContext, + IN PWSTR UserName, + IN PWSTR Domain, + IN PWSTR Password, + OUT PNTSTATUS SubStatus); + +BOOL +CreateProfile( IN OUT PGINA_CONTEXT pgContext, IN PWSTR UserName, IN PWSTR Domain, diff --git a/reactos/dll/win32/msgina/tui.c b/reactos/dll/win32/msgina/tui.c index aa262232659..e01d330b752 100644 --- a/reactos/dll/win32/msgina/tui.c +++ b/reactos/dll/win32/msgina/tui.c @@ -199,6 +199,8 @@ TUILoggedOutSAS( { WCHAR UserName[256]; WCHAR Password[256]; + NTSTATUS Status; + NTSTATUS SubStatus = STATUS_SUCCESS; TRACE("TUILoggedOutSAS()\n"); @@ -208,10 +210,14 @@ TUILoggedOutSAS( if (!ReadString(IDS_ASKFORPASSWORD, Password, 256, FALSE)) return WLX_SAS_ACTION_NONE; - if (DoLoginTasks(pgContext, UserName, NULL, Password)) - return WLX_SAS_ACTION_LOGON; - else - return WLX_SAS_ACTION_NONE; + Status = DoLoginTasks(pgContext, UserName, NULL, Password, &SubStatus); + if (Status == STATUS_SUCCESS) + { + if (CreateProfile(pgContext, UserName, NULL, Password)) + return WLX_SAS_ACTION_LOGON; + } + + return WLX_SAS_ACTION_NONE; } static INT From 1ff93cb52e6f70b7a4d27fda7de5301116be12a8 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 9 Mar 2014 12:48:25 +0000 Subject: [PATCH 083/419] [WINE/TEST.H] Add explicit casts, so that the header can be used from C++ svn path=/trunk/; revision=62465 --- reactos/include/reactos/wine/test.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/include/reactos/wine/test.h b/reactos/include/reactos/wine/test.h index 5d1eb4aa7b9..04f9ab4fe15 100644 --- a/reactos/include/reactos/wine/test.h +++ b/reactos/include/reactos/wine/test.h @@ -254,10 +254,10 @@ static tls_data* get_tls_data(void) DWORD last_error; last_error=GetLastError(); - data=TlsGetValue(tls_index); + data=(tls_data*)TlsGetValue(tls_index); if (!data) { - data=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(tls_data)); + data=(tls_data*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(tls_data)); data->str_pos = data->strings; TlsSetValue(tls_index,data); } From 7165a7c35b83411cffbaf9d57d5f22a86e333e5f Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 9 Mar 2014 13:55:26 +0000 Subject: [PATCH 084/419] [PSEH3] - Add AllocaFrame field to the exception registration record. It is required for Clang and C++ handlers. - Fix the way how "nested functions" are emulated on Clang and C++, respecting the fact that the compiler can and will use a temporary esp-based stack frame below any alloca-allocations for function invocation. This uses the AllocaFrame field to calculate and setup a new temp stack frame for the "nested functions". - Make use of the HandlerType field in the exception registration record to use different methods for invoking filters / finally functions. - Write @_SEH3$_CallRtlUnwind@4 in raw asm instead of inline, because Clang cannot deal with stdcall decorations in inline asm (see http://llvm.org/bugs/show_bug.cgi?id=19027) - Make sure ExceptionPointers are properly initialized in _SEH3$_except_handler svn path=/trunk/; revision=62466 --- reactos/include/reactos/libs/pseh/pseh3.h | 76 ++++++++----- reactos/lib/pseh/i386/pseh3.c | 122 ++++++++++++++------- reactos/lib/pseh/i386/pseh3_asmdef.h | 7 +- reactos/lib/pseh/i386/pseh3_i386.S | 124 +++++++++++++++++++++- 4 files changed, 255 insertions(+), 74 deletions(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index cc82a0d5b04..66d8e9bd998 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -67,6 +67,8 @@ typedef struct _SEH3$_REGISTRATION_FRAME /* Registers that we need to save */ unsigned long Esp; unsigned long Ebp; + + char* AllocaFrame; #ifdef _SEH3$_FRAME_ALL_NONVOLATILES unsigned long Ebx; unsigned long Esi; @@ -101,10 +103,12 @@ enum _SEH3$_TryLevel = 0, }; +#ifndef __clang__ /* These are global dummy definitions, that get overwritten in the local context of __finally / __except blocks */ int __cdecl __attribute__((error ("Can only be used inside a __finally block."))) _abnormal_termination(void); unsigned long __cdecl __attribute__((error("Can only be used inside an exception filter or __except block."))) _exception_code(void); void * __cdecl __attribute__((error("Can only be used inside an exception filter."))) _exception_info(void); +#endif /* This attribute allows automatic cleanup of the registered frames */ #define _SEH3$_AUTO_CLEANUP __attribute__((cleanup(_SEH3$_Unregister))) @@ -119,15 +123,16 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter #define _SEH3$_ASM_GOTO(_Label, ...) int -__attribute__((regparm(2))) +__attribute__((regparm(3))) __attribute__((returns_twice)) _SEH3$_RegisterFrameWithNonVolatiles( volatile SEH3$_REGISTRATION_FRAME* RegistrationFrame, - const SEH3$_SCOPE_TABLE* ScopeTable); + const SEH3$_SCOPE_TABLE* ScopeTable, + void* AllocaFrame); #define _SEH3$_RegisterFrame_(_TrylevelFrame, _DataTable) \ do { \ - int result = _SEH3$_RegisterFrameWithNonVolatiles(_TrylevelFrame, _DataTable); \ + int result = _SEH3$_RegisterFrameWithNonVolatiles(_TrylevelFrame, _DataTable, __builtin_alloca(0)); \ if (__builtin_expect(result != 0, 0)) \ { \ if (result == 1) goto _SEH3$_l_FilterOrFinally; \ @@ -137,15 +142,16 @@ _SEH3$_RegisterFrameWithNonVolatiles( } while(0) int -__attribute__((regparm(2))) +__attribute__((regparm(3))) __attribute__((returns_twice)) _SEH3$_RegisterTryLevelWithNonVolatiles( volatile SEH3$_REGISTRATION_FRAME* RegistrationFrame, - const SEH3$_SCOPE_TABLE* ScopeTable); + const SEH3$_SCOPE_TABLE* ScopeTable, + void* AllocaFrame); #define _SEH3$_RegisterTryLevel_(_TrylevelFrame, _DataTable) \ do { \ - int result = _SEH3$_RegisterTryLevelWithNonVolatiles(_TrylevelFrame, _DataTable); \ + int result = _SEH3$_RegisterTryLevelWithNonVolatiles(_TrylevelFrame, _DataTable, __builtin_alloca(0)); \ if (__builtin_expect(result != 0, 0)) \ { \ if (result == 1) goto _SEH3$_l_FilterOrFinally; \ @@ -163,25 +169,34 @@ _SEH3$_RegisterTryLevelWithNonVolatiles( #define _SEH3$_ASM_GOTO(_Label, ...) asm goto ("#\n" : : : "memory", ## __VA_ARGS__ : _Label) -/* This is an asm wrapper around _SEH3$_RegisterFrame */ -#define _SEH3$_RegisterFrame_(_TrylevelFrame, _DataTable) \ +#ifdef __cplusplus +#define _SEH3$_CALL_WRAPPER(_Function, _TrylevelFrame, _DataTable) \ asm goto ("leal %0, %%eax\n" \ "leal %1, %%edx\n" \ - "call __SEH3$_RegisterFrame\n" \ + "call " #_Function "WithStackLayout\n" \ + : \ + : "m" (*(_TrylevelFrame)), "m" (*(_DataTable)), "c"(__builtin_alloca(0)) \ + : "eax", "edx", "memory" \ + : _SEH3$_l_HandlerTarget, _SEH3$_l_FilterOrFinally) + +#else +#define _SEH3$_CALL_WRAPPER(_Function, _TrylevelFrame, _DataTable) \ + asm goto ("leal %0, %%eax\n" \ + "leal %1, %%edx\n" \ + "call " #_Function "\n" \ : \ : "m" (*(_TrylevelFrame)), "m" (*(_DataTable)) \ - : "ecx", "edx", "memory" \ + : "eax", "edx", "ecx", "memory" \ : _SEH3$_l_HandlerTarget) +#endif + +/* This is an asm wrapper around _SEH3$_RegisterFrame */ +#define _SEH3$_RegisterFrame_(_TrylevelFrame, _DataTable) \ + _SEH3$_CALL_WRAPPER(__SEH3$_RegisterFrame, _TrylevelFrame, _DataTable) /* This is an asm wrapper around _SEH3$_RegisterTryLevel */ #define _SEH3$_RegisterTryLevel_(_TrylevelFrame, _DataTable) \ - asm goto ("leal %0, %%eax\n" \ - "leal %1, %%edx\n" \ - "call __SEH3$_RegisterTryLevel\n" \ - : \ - : "m" (*(_TrylevelFrame)), "m" (*(_DataTable)) \ - : "ecx", "edx", "memory" \ - : _SEH3$_l_HandlerTarget) + _SEH3$_CALL_WRAPPER(__SEH3$_RegisterTryLevel, _TrylevelFrame, _DataTable) /* This construct scares GCC so much, that it will stop moving code around into places that are never executed. */ @@ -214,15 +229,17 @@ _SEH3$_Unregister( /* The "nested" functions are a piece of code with a ret instruction at the end */ #define _SEH3$_NESTED_FUNC_OPEN() \ { \ - int SavedEsp, result = 0; \ -\ - /* Save esp */ \ - asm volatile ("movl %%esp, %[SavedEsp]\n" : : [SavedEsp]"m"(SavedEsp)); + int _SEH3$_Result = 0; \ + +/* On invocation, the AllocaFrame field is loaded with the return esp value */ +#define _SEH3$_NESTED_FUNC_RETURN() \ + /* Restore esp and return to the caller */ \ + asm volatile ("movl %[FixedEsp], %%esp\nret\n" \ + : : "a"(_SEH3$_Result), [FixedEsp]"m"(_SEH3$_TrylevelFrame.AllocaFrame) : "memory") #define _SEH3$_NESTED_FUNC_CLOSE() \ - /* Restore esp and return to the caller */ \ - asm volatile ("movl %[SavedEsp], %%esp\nret\n" \ - : : "a"(result), [SavedEsp]"irm"(SavedEsp)); \ + /* Return to the caller */ \ + _SEH3$_NESTED_FUNC_RETURN(); \ } /* The filter function */ @@ -230,7 +247,7 @@ _SEH3$_Unregister( _SEH3$_NESTED_FUNC_OPEN() \ { \ /* Evaluate the filter expression */ \ - result = (expression); \ + _SEH3$_Result = (expression); \ } \ _SEH3$_NESTED_FUNC_CLOSE() @@ -238,11 +255,10 @@ _SEH3$_Unregister( _SEH3$_NESTED_FUNC_OPEN() \ /* This construct makes sure that the finally function returns */ \ /* a proper value at the end */ \ - for (; ; (void)({asm volatile ("movl %[SavedEsp], %%esp\nret\n" \ - : : "a"(result), [SavedEsp]"irm"(SavedEsp)); 0;})) + for (; ; (void)({_SEH3$_NESTED_FUNC_RETURN(); 0;})) #define _SEH3$_FILTER(_Filter, _FilterExpression) (&&_SEH3$_l_FilterOrFinally) -#define _SEH3$_FINALLY(_Finally) 0 +#define _SEH3$_FINALLY(_Finally) (&&_SEH3$_l_FilterOrFinally) #define _SEH3$_DECLARE_EXCEPT_INTRINSICS() @@ -336,6 +352,7 @@ _SEH3$_Unregister( __label__ _SEH3$_l_OnException; \ __label__ _SEH3$_l_BeforeFilterOrFinally; \ __label__ _SEH3$_l_FilterOrFinally; \ + (void)&&_SEH3$_l_OnException; \ (void)&&_SEH3$_l_BeforeFilterOrFinally; \ (void)&&_SEH3$_l_FilterOrFinally; \ \ @@ -419,7 +436,7 @@ _SEH3$_Unregister( _SEH3$_DECLARE_FILTER_FUNC(_SEH3$_FinallyFunction); \ \ /* Create a static data table that contains the finally function */ \ - static const SEH3$_SCOPE_TABLE _SEH3$_ScopeTable = { 0, _SEH3$_FINALLY(&_SEH3$_FinallyFunction) }; \ + static const SEH3$_SCOPE_TABLE _SEH3$_ScopeTable = { 0, _SEH3$_FINALLY(&_SEH3$_FinallyFunction), _SEH3$_TryLevel, _SEH3$_HANDLER_TYPE }; \ \ /* Register the registration record. */ \ if (_SEH3$_TryLevel == 1) _SEH3$_RegisterFrame_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ @@ -431,6 +448,7 @@ _SEH3$_Unregister( _SEH3$_EnforceFramePointer(); \ \ _SEH3$_l_BeforeFilterOrFinally: (void)0; \ + _SEH3$_EnforceFramePointer(); \ _SEH3$_l_FilterOrFinally: (void)0; \ _SEH3$_FINALLY_FUNC_OPEN(_SEH3$_FinallyFunction) diff --git a/reactos/lib/pseh/i386/pseh3.c b/reactos/lib/pseh/i386/pseh3.c index 47d742d3f98..7e7d438ea1f 100644 --- a/reactos/lib/pseh/i386/pseh3.c +++ b/reactos/lib/pseh/i386/pseh3.c @@ -63,8 +63,8 @@ _SEH3$_Unregister( static inline LONG -_SEH3$_InvokeFilter( - PVOID Record, +_SEH3$_InvokeNestedFunctionFilter( + PSEH3$_REGISTRATION_FRAME RegistrationFrame, PVOID Filter) { LONG FilterResult; @@ -78,18 +78,58 @@ _SEH3$_InvokeFilter( /* The result is the frame base address that we passed in (0) plus the offset to the registration record. */ "negl %%eax\n\t" - "addl %[Record], %%eax\n\t" + "addl %[RegistrationFrame], %%eax\n\t" /* Second call to get the filter result */ "mov $1, %%ecx\n\t" "call *%[Filter]\n\t" : "=a"(FilterResult) - : [Record] "m" (Record), [Filter] "m" (Filter) + : [RegistrationFrame] "m" (RegistrationFrame), [Filter] "m" (Filter) : "ecx", "edx"); return FilterResult; } +long +__attribute__((regparm(1))) +_SEH3$_InvokeEmbeddedFilter( + PSEH3$_REGISTRATION_FRAME RegistrationFrame); + +long +__attribute__((regparm(1))) +_SEH3$_InvokeEmbeddedFilterFromRegistration( + PSEH3$_REGISTRATION_FRAME RegistrationFrame); + +static inline +LONG +_SEH3$_InvokeFilter( + PSEH3$_REGISTRATION_FRAME RegistrationFrame, + PVOID Filter) +{ + LONG FilterResult; + + if (RegistrationFrame->ScopeTable->HandlerType == _SEH3$_NESTED_HANDLER) + { + return _SEH3$_InvokeNestedFunctionFilter(RegistrationFrame, Filter); + } + else if (RegistrationFrame->ScopeTable->HandlerType == _SEH3$_CPP_HANDLER) + { + /* Call the embedded filter function */ + return _SEH3$_InvokeEmbeddedFilter(RegistrationFrame); + } + else if (RegistrationFrame->ScopeTable->HandlerType == _SEH3$_CLANG_HANDLER) + { + return _SEH3$_InvokeEmbeddedFilterFromRegistration(RegistrationFrame); + } + else + { + /* Should not happen! Skip this handler */ + FilterResult = EXCEPTION_CONTINUE_SEARCH; + } + + return FilterResult; +} + static inline LONG _SEH3$_GetFilterResult( @@ -136,45 +176,51 @@ void _SEH3$_JumpToTarget( PSEH3$_REGISTRATION_FRAME RegistrationFrame) { - asm volatile ( - /* Load the registers */ - "movl 20(%%ecx), %%esp\n" - "movl 24(%%ecx), %%ebp\n" + if (RegistrationFrame->ScopeTable->HandlerType == _SEH3$_CLANG_HANDLER) + { + asm volatile ( + /* Load the registers */ + "movl 20(%%ecx), %%esp\n" + "movl 24(%%ecx), %%ebp\n" - /* Stack pointer is 4 off from the call to __SEH3$_RegisterFrame */ - "addl $4, %%esp\n" + /* Stack pointer is 4 off from the call to __SEH3$_RegisterFrame */ + "addl $4, %%esp\n" - /* Jump into the exception handler */ - "jmp *%[Target]\n" - : : - "c" (RegistrationFrame), - "a" (RegistrationFrame->ScopeTable), - [Target] "m" (RegistrationFrame->ScopeTable->Target) - ); + /* Jump into the exception handler */ + "jmp *%[Target]\n" + : : + "c" (RegistrationFrame), + "a" (RegistrationFrame->ScopeTable), + [Target] "m" (RegistrationFrame->ScopeTable->Target) + ); + } + else + { + asm volatile ( + /* Load the registers */ + "movl 20(%%ecx), %%esp\n" + "movl 24(%%ecx), %%ebp\n" + + /* Stack pointer is 4 off from the call to __SEH3$_RegisterFrame */ + "addl $4, %%esp\n" + + /* Jump into the exception handler */ + "jmp *%[Target]\n" + : : + "c" (RegistrationFrame), + "a" (RegistrationFrame->ScopeTable), + [Target] "m" (RegistrationFrame->ScopeTable->Target) + ); + } __builtin_unreachable(); } -static inline void +__fastcall _SEH3$_CallRtlUnwind( - PSEH3$_REGISTRATION_FRAME RegistrationFrame) -{ - LONG ClobberedEax; + PSEH3$_REGISTRATION_FRAME RegistrationFrame); - asm volatile( - "push %%ebp\n" - "push $0\n" - "push $0\n" - "push $0\n" - "push %[TargetFrame]\n" - "call _RtlUnwind@16\n" - "pop %%ebp\n" - : "=a" (ClobberedEax) - : [TargetFrame] "a" (RegistrationFrame) - : "ebx", "ecx", "edx", "esi", - "edi", "flags", "memory"); -} EXCEPTION_DISPOSITION __cdecl @@ -192,6 +238,10 @@ _SEH3$_except_handler( /* Clear the direction flag. */ asm volatile ("cld\n" : : : "memory"); + /* Save the exception pointers on the stack */ + ExceptionPointers.ExceptionRecord = ExceptionRecord; + ExceptionPointers.ContextRecord = ContextRecord; + /* Check if this is an unwind */ if (ExceptionRecord->ExceptionFlags & EXCEPTION_UNWINDING) { @@ -200,10 +250,6 @@ _SEH3$_except_handler( } else { - /* Save the exception pointers on the stack */ - ExceptionPointers.ExceptionRecord = ExceptionRecord; - ExceptionPointers.ContextRecord = ContextRecord; - /* Loop all frames for this registration */ CurrentFrame = EstablisherFrame->EndOfChain; for (;;) diff --git a/reactos/lib/pseh/i386/pseh3_asmdef.h b/reactos/lib/pseh/i386/pseh3_asmdef.h index f8d847eb323..87d126fa8ca 100644 --- a/reactos/lib/pseh/i386/pseh3_asmdef.h +++ b/reactos/lib/pseh/i386/pseh3_asmdef.h @@ -7,9 +7,10 @@ #define SEH3_REGISTRATION_FRAME_ExceptionPointers 16 #define SEH3_REGISTRATION_FRAME_Esp 20 #define SEH3_REGISTRATION_FRAME_Ebp 24 -#define SEH3_REGISTRATION_FRAME_Ebx 28 -#define SEH3_REGISTRATION_FRAME_Esi 32 -#define SEH3_REGISTRATION_FRAME_Edi 36 +#define SEH3_REGISTRATION_FRAME_AllocaFrame 28 +#define SEH3_REGISTRATION_FRAME_Ebx 32 +#define SEH3_REGISTRATION_FRAME_Esi 36 +#define SEH3_REGISTRATION_FRAME_Edi 40 #define SEH3_SCOPE_TABLE_Target 0 #define SEH3_SCOPE_TABLE_Filter 4 diff --git a/reactos/lib/pseh/i386/pseh3_i386.S b/reactos/lib/pseh/i386/pseh3_i386.S index bd37a74642f..8e409fa2406 100644 --- a/reactos/lib/pseh/i386/pseh3_i386.S +++ b/reactos/lib/pseh/i386/pseh3_i386.S @@ -15,11 +15,12 @@ /* * void - * __attribute__((regparm(2))) + * __attribute__((regparm(3))) * __attribute__((returns_twice)) * _SEH3$_RegisterFrame[WithNonVolatiles]( * PSEH3$_REGISTRATION_FRAME RegistrationFrame, - * PSEH3$_SCOPE_TABLE ScopeTable); + * PSEH3$_SCOPE_TABLE ScopeTable, + * PVOID AllocaFrame); */ .global __SEH3$_RegisterFrameWithNonVolatiles __SEH3$_RegisterFrameWithNonVolatiles: @@ -29,6 +30,12 @@ __SEH3$_RegisterFrameWithNonVolatiles: mov [eax + SEH3_REGISTRATION_FRAME_Esi], esi mov [eax + SEH3_REGISTRATION_FRAME_Edi], edi +.global __SEH3$_RegisterFrameWithStackLayout +__SEH3$_RegisterFrameWithStackLayout: + + /* Save the pointer to the alloca frame */ + mov [eax + SEH3_REGISTRATION_FRAME_AllocaFrame], ecx + .global __SEH3$_RegisterFrame __SEH3$_RegisterFrame: @@ -57,11 +64,12 @@ __SEH3$_RegisterFrame: /* * void - * __attribute__((regparm(2))) + * __attribute__((regparm(3))) * __attribute__((returns_twice)) * _SEH3$_RegisterTryLevel[WithNonVolatiles]( * PSEH3$_REGISTRATION_FRAME RegistrationFrame, - * PSEH3$_SCOPE_TABLE ScopeTable); + * PSEH3$_SCOPE_TABLE ScopeTable, + * PVOID AllocaFrame); */ .global __SEH3$_RegisterTryLevelWithNonVolatiles __SEH3$_RegisterTryLevelWithNonVolatiles: @@ -71,6 +79,12 @@ __SEH3$_RegisterTryLevelWithNonVolatiles: mov [eax + SEH3_REGISTRATION_FRAME_Esi], esi mov [eax + SEH3_REGISTRATION_FRAME_Edi], edi +.global __SEH3$_RegisterTryLevelWithStackLayout +__SEH3$_RegisterTryLevelWithStackLayout: + + /* Save the pointer to the alloca frame */ + mov [eax + SEH3_REGISTRATION_FRAME_AllocaFrame], ecx + .global __SEH3$_RegisterTryLevel __SEH3$_RegisterTryLevel: @@ -98,3 +112,105 @@ __SEH3$_RegisterTryLevel: xor eax, eax ret + +.global __SEH3$_InvokeEmbeddedFilterFromRegistration +__SEH3$_InvokeEmbeddedFilterFromRegistration: + + /* Safe the current non-volatiles */ + push ebp + push ebx + push esi + push edi + + /* Load the non-volatiles from the registration invocation */ + mov ebx, [eax + SEH3_REGISTRATION_FRAME_Ebx] + mov esi, [eax + SEH3_REGISTRATION_FRAME_Esi] + mov edi, [eax + SEH3_REGISTRATION_FRAME_Edi] + mov ebp, [eax + SEH3_REGISTRATION_FRAME_Ebp] + + /* Get the saved stack pointer */ + mov edx, [eax + SEH3_REGISTRATION_FRAME_Esp] + + xor eax, eax + inc eax + call [edx] + + /* Restore the current non-volatiles */ + pop edi + pop esi + pop ebx + pop ebp + + ret + + +.global __SEH3$_InvokeEmbeddedFilter +__SEH3$_InvokeEmbeddedFilter: + + /* Safe the current non-volatiles */ + push ebp + push ebx + push esi + push edi + + /* Load ebp from the registration invocation */ + mov ebp, [eax + SEH3_REGISTRATION_FRAME_Ebp] + + /* Calculate the size of the temp stack frame region */ + mov ecx, [eax + SEH3_REGISTRATION_FRAME_AllocaFrame] + sub ecx, [eax + SEH3_REGISTRATION_FRAME_Esp] + + /* Put the return address on the stack */ + push offset __SEH3$_InvokeEmbeddedFilterReturn + + /* Save the current stack pointer in the AllocaFrame member */ + mov [eax + SEH3_REGISTRATION_FRAME_AllocaFrame], esp + + /* Allocate enough temp stack space on the stack */ + sub esp, ecx + + /* Get the scope table */ + mov edx, [eax + SEH3_REGISTRATION_FRAME_ScopeTable] + + /* Jump into the filter or finally function */ + jmp [edx + SEH3_SCOPE_TABLE_Filter] + + /* We return to this label with a cleaned up stack */ +__SEH3$_InvokeEmbeddedFilterReturn: + + /* Restore the current non-volatiles */ + pop edi + pop esi + pop ebx + pop ebp + + ret + +/* + * void + * __fastcall + * _SEH3$_CallRtlUnwind( + * PSEH3$_REGISTRATION_FRAME RegistrationFrame) + */ +.global @_SEH3$_CallRtlUnwind@4 +@_SEH3$_CallRtlUnwind@4: + + push ebp + mov ebp, esp + + push edi + push esi + push ebx + + push 0 /* ReturnValue */ + push 0 /* ExceptionRecord */ + push 0 /* TargetIp */ + push ecx /* TargetFrame */ + call _RtlUnwind@16 + + pop ebx + pop esi + pop edi + pop ebp + ret + From d9eab6f7d47a763fc59c44a3d303ea6afe07dc41 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Sun, 9 Mar 2014 14:19:56 +0000 Subject: [PATCH 085/419] [usetup] exit when no usable disks are found svn path=/trunk/; revision=62467 --- reactos/base/setup/usetup/interface/usetup.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index 74bf8e64e0a..717bad1cd03 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -1472,6 +1472,11 @@ SelectPartitionPage(PINPUT_RECORD Ir) /* FIXME: show an error dialog */ return QUIT_PAGE; } + else if (IsListEmpty (&PartitionList->DiskListHead)) + { + MUIDisplayError(ERROR_NO_HDD, Ir, POPUP_WAIT_ENTER); + return QUIT_PAGE; + } } DrawPartitionList(PartitionList); From 0e9938326d10cb9905428dbf08095901466475db Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 9 Mar 2014 17:48:42 +0000 Subject: [PATCH 086/419] [MSGINA] Display warning messages if a user tries to log on using a non-existing account name, a wrong password or if the account was disabled. svn path=/trunk/; revision=62468 --- reactos/dll/win32/msgina/gui.c | 32 ++++++++++++++++++-------- reactos/dll/win32/msgina/lang/bg-BG.rc | 7 ++++-- reactos/dll/win32/msgina/lang/cs-CZ.rc | 7 ++++-- reactos/dll/win32/msgina/lang/de-DE.rc | 7 ++++-- reactos/dll/win32/msgina/lang/en-US.rc | 9 +++++--- reactos/dll/win32/msgina/lang/es-ES.rc | 7 ++++-- reactos/dll/win32/msgina/lang/fr-FR.rc | 7 ++++-- reactos/dll/win32/msgina/lang/he-IL.rc | 7 ++++-- reactos/dll/win32/msgina/lang/id-ID.rc | 8 +++++-- reactos/dll/win32/msgina/lang/it-IT.rc | 7 ++++-- reactos/dll/win32/msgina/lang/ja-JP.rc | 7 ++++-- reactos/dll/win32/msgina/lang/no-NO.rc | 7 ++++-- reactos/dll/win32/msgina/lang/pl-PL.rc | 7 ++++-- reactos/dll/win32/msgina/lang/ro-RO.rc | 7 ++++-- reactos/dll/win32/msgina/lang/ru-RU.rc | 7 ++++-- reactos/dll/win32/msgina/lang/sk-SK.rc | 7 ++++-- reactos/dll/win32/msgina/lang/sq-AL.rc | 6 +++++ reactos/dll/win32/msgina/lang/tr-TR.rc | 3 +++ reactos/dll/win32/msgina/lang/uk-UA.rc | 3 +++ reactos/dll/win32/msgina/resource.h | 3 +++ 20 files changed, 115 insertions(+), 40 deletions(-) diff --git a/reactos/dll/win32/msgina/gui.c b/reactos/dll/win32/msgina/gui.c index 0fc6b0bc0c8..2b5911d044f 100644 --- a/reactos/dll/win32/msgina/gui.c +++ b/reactos/dll/win32/msgina/gui.c @@ -943,19 +943,26 @@ DoLogon( goto done; Status = DoLoginTasks(pgContext, UserName, Domain, Password, &SubStatus); - if (!NT_SUCCESS(Status)) + if (Status == STATUS_LOGON_FAILURE) { -TRACE("DoLoginTasks failed! Status 0x%08lx SubStatus 0x%08lx\n", Status, SubStatus); + ResourceMessageBox(pgContext, + hwndDlg, + MB_OK | MB_ICONEXCLAMATION, + IDS_LOGONTITLE, + IDS_LOGONWRONGUSERORPWD); + goto done; + } + else if (Status == STATUS_ACCOUNT_RESTRICTION) + { + TRACE("DoLoginTasks failed! Status 0x%08lx SubStatus 0x%08lx\n", Status, SubStatus); if (SubStatus == STATUS_ACCOUNT_DISABLED) { -TRACE("Account disabled!\n"); - pgContext->pWlxFuncs->WlxMessageBox(pgContext->hWlx, - hwndDlg, - L"Account disabled!", - L"Logon error", - MB_OK | MB_ICONERROR); - + ResourceMessageBox(pgContext, + hwndDlg, + MB_OK | MB_ICONEXCLAMATION, + IDS_LOGONTITLE, + IDS_LOGONUSERDISABLED); goto done; } else if (SubStatus == STATUS_ACCOUNT_LOCKED_OUT) @@ -979,6 +986,13 @@ TRACE("Other error!\n"); goto done; } } + else if (!NT_SUCCESS(Status)) + { +TRACE("DoLoginTasks failed! Status 0x%08lx\n", Status); + + goto done; + } + if (!CreateProfile(pgContext, UserName, Domain, Password)) { diff --git a/reactos/dll/win32/msgina/lang/bg-BG.rc b/reactos/dll/win32/msgina/lang/bg-BG.rc index d06701b5941..c6e41603d98 100644 --- a/reactos/dll/win32/msgina/lang/bg-BG.rc +++ b/reactos/dll/win32/msgina/lang/bg-BG.rc @@ -140,11 +140,14 @@ BEGIN IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "Logon date: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/cs-CZ.rc b/reactos/dll/win32/msgina/lang/cs-CZ.rc index 00ebf875e69..fb7c834e92c 100644 --- a/reactos/dll/win32/msgina/lang/cs-CZ.rc +++ b/reactos/dll/win32/msgina/lang/cs-CZ.rc @@ -145,11 +145,14 @@ BEGIN IDS_LOGONMSG "Jste přihlášeni jako %s." IDS_LOGONDATE "Datum přihlášení: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/de-DE.rc b/reactos/dll/win32/msgina/lang/de-DE.rc index 79710d88509..612afcf8a6e 100644 --- a/reactos/dll/win32/msgina/lang/de-DE.rc +++ b/reactos/dll/win32/msgina/lang/de-DE.rc @@ -140,11 +140,14 @@ BEGIN IDS_LOGONMSG "Sie sind angemeldet als %s." IDS_LOGONDATE "Anmeldedatum: %s %s" IDS_COMPUTERLOCKED "Computer ist gesperrt" - IDS_LOCKEDWRONGPASSWORD "Das Passwort ist falsch. Bitte geben Sie das Passwort erneut ein. Bei Buchstaben des Passworts wird Groß- und Kleinschreibung unterschieden." - IDS_LOCKEDWRONGUSER "Der Computer ist gesperrt. Nur %s\\%s oder ein Administrator kann den Computer entsperren." + IDS_LOCKEDWRONGPASSWORD "Das Passwort ist falsch. Bitte geben Sie das Passwort erneut ein. Bei Buchstaben des Passworts wird Groß- und Kleinschreibung unterschieden." + IDS_LOCKEDWRONGUSER "Der Computer ist gesperrt. Nur %s\\%s oder ein Administrator kann den Computer entsperren." IDS_CHANGEPWDTITLE "Passwort ändern" IDS_NONMATCHINGPASSWORDS "Die eingegebenen Passworte stimmen nicht überein. Geben Sie das neue Passwort in beide Textfelder ein." IDS_PASSWORDCHANGED "Ihr Passwort wurde geändert." + IDS_LOGONTITLE "Anmeldemeldung" + IDS_LOGONWRONGUSERORPWD "Sie konnten nicht angemeldet werden. Prüfen Sie Benutzername und Domäne, und geben Sie das Passwort erneut ein. Bei Passworten wird Groß- und Kleinschreibung unterschieden." + IDS_LOGONUSERDISABLED "Ihr Konto wurde deaktiviert. Wenden Sie sich an Ihren Systemadministrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/en-US.rc b/reactos/dll/win32/msgina/lang/en-US.rc index e442a6a9e49..b699b34c2b6 100644 --- a/reactos/dll/win32/msgina/lang/en-US.rc +++ b/reactos/dll/win32/msgina/lang/en-US.rc @@ -135,16 +135,19 @@ BEGIN IDS_PRESSCTRLALTDELETE "Press Control+Alt+Delete to Logon." IDS_ASKFORUSER "User name: " IDS_ASKFORPASSWORD "Password: " - IDS_FORCELOGOFF "This will log out the current user and lose all unsaved data. Continue?" + IDS_FORCELOGOFF "This will log out the current user and lose all unsaved data. Continue?" IDS_LOCKMSG "Only %s or an Administrator can unlock this computer." IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "Logon date: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/es-ES.rc b/reactos/dll/win32/msgina/lang/es-ES.rc index fff68d7c5c8..83c9cb9981f 100644 --- a/reactos/dll/win32/msgina/lang/es-ES.rc +++ b/reactos/dll/win32/msgina/lang/es-ES.rc @@ -142,11 +142,14 @@ BEGIN IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "Logon date: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/fr-FR.rc b/reactos/dll/win32/msgina/lang/fr-FR.rc index ebe178564e3..60b838c355d 100644 --- a/reactos/dll/win32/msgina/lang/fr-FR.rc +++ b/reactos/dll/win32/msgina/lang/fr-FR.rc @@ -140,11 +140,14 @@ BEGIN IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "Logon date: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/he-IL.rc b/reactos/dll/win32/msgina/lang/he-IL.rc index 0a364801c19..89be4d60945 100644 --- a/reactos/dll/win32/msgina/lang/he-IL.rc +++ b/reactos/dll/win32/msgina/lang/he-IL.rc @@ -140,11 +140,14 @@ BEGIN IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "תאריך כניסה: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/id-ID.rc b/reactos/dll/win32/msgina/lang/id-ID.rc index a8c593ba557..4e45a682551 100644 --- a/reactos/dll/win32/msgina/lang/id-ID.rc +++ b/reactos/dll/win32/msgina/lang/id-ID.rc @@ -137,13 +137,17 @@ BEGIN IDS_ASKFORPASSWORD "Kata sandi: " IDS_FORCELOGOFF "Ini akan mengeluarkan pengguna saat ini dan kehilangan data yang belum disimpan. Lanjutkan?" IDS_LOCKMSG "Only %s or an Administrator can unlock this computer." + IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "Logon date: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/it-IT.rc b/reactos/dll/win32/msgina/lang/it-IT.rc index 7ab86e7f6f9..a1e442e1024 100644 --- a/reactos/dll/win32/msgina/lang/it-IT.rc +++ b/reactos/dll/win32/msgina/lang/it-IT.rc @@ -148,11 +148,14 @@ BEGIN IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "Dati di accesso: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/ja-JP.rc b/reactos/dll/win32/msgina/lang/ja-JP.rc index a1731d0296c..b3af12c5549 100644 --- a/reactos/dll/win32/msgina/lang/ja-JP.rc +++ b/reactos/dll/win32/msgina/lang/ja-JP.rc @@ -140,11 +140,14 @@ BEGIN IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "Logon date: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/no-NO.rc b/reactos/dll/win32/msgina/lang/no-NO.rc index 41b0af8ee2d..bce3ee2d0c3 100644 --- a/reactos/dll/win32/msgina/lang/no-NO.rc +++ b/reactos/dll/win32/msgina/lang/no-NO.rc @@ -140,11 +140,14 @@ BEGIN IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "Logon date: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/pl-PL.rc b/reactos/dll/win32/msgina/lang/pl-PL.rc index aad32ffc51f..a1d56bec798 100644 --- a/reactos/dll/win32/msgina/lang/pl-PL.rc +++ b/reactos/dll/win32/msgina/lang/pl-PL.rc @@ -149,11 +149,14 @@ BEGIN IDS_LOGONMSG "Jesteś zalogowany jako %s." IDS_LOGONDATE "Data logowania: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/ro-RO.rc b/reactos/dll/win32/msgina/lang/ro-RO.rc index f63e48c638a..bafb790fe2c 100644 --- a/reactos/dll/win32/msgina/lang/ro-RO.rc +++ b/reactos/dll/win32/msgina/lang/ro-RO.rc @@ -142,11 +142,14 @@ BEGIN IDS_LOGONMSG "Sunteți autentificat ca %s." IDS_LOGONDATE "Data autentificării: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/ru-RU.rc b/reactos/dll/win32/msgina/lang/ru-RU.rc index 0c69e47cfed..398ce06d5e7 100644 --- a/reactos/dll/win32/msgina/lang/ru-RU.rc +++ b/reactos/dll/win32/msgina/lang/ru-RU.rc @@ -142,11 +142,14 @@ BEGIN IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "Дата входа: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/sk-SK.rc b/reactos/dll/win32/msgina/lang/sk-SK.rc index ead0f3a5d43..31d4ab2418f 100644 --- a/reactos/dll/win32/msgina/lang/sk-SK.rc +++ b/reactos/dll/win32/msgina/lang/sk-SK.rc @@ -145,11 +145,14 @@ BEGIN IDS_LOGONMSG "You are logged on as %s." IDS_LOGONDATE "Logon date: %s %s" IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." + IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/sq-AL.rc b/reactos/dll/win32/msgina/lang/sq-AL.rc index 8c18c16d80f..cb9a93fb962 100644 --- a/reactos/dll/win32/msgina/lang/sq-AL.rc +++ b/reactos/dll/win32/msgina/lang/sq-AL.rc @@ -145,6 +145,12 @@ BEGIN IDS_COMPUTERLOCKED "Kompjuter mbyllur" IDS_LOCKEDWRONGPASSWORD "Fjalëkalimi është gabim. Ju lutem shkruani fjalëkalimin tuaj përsëri. Gërmat në fjalëkalim duhet të shkruhen duke përdorur rastin e duhur." IDS_LOCKEDWRONGUSER "Ky kompjuter është i bllokuar. Vetëm %s\\%s ose një Administrator mund të zhbllokoj këtë kompjuter." + IDS_CHANGEPWDTITLE "Change Password" + IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." + IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/tr-TR.rc b/reactos/dll/win32/msgina/lang/tr-TR.rc index 9eebba74ed5..7c3a825357d 100644 --- a/reactos/dll/win32/msgina/lang/tr-TR.rc +++ b/reactos/dll/win32/msgina/lang/tr-TR.rc @@ -147,6 +147,9 @@ BEGIN IDS_CHANGEPWDTITLE "Şifre Değştirme" IDS_NONMATCHINGPASSWORDS "Yazıdığınız bu şifreler birbiriyle uyuşmuyor. Her iki metin kutusuna da aynı şifreyi yazınız." IDS_PASSWORDCHANGED "Şifreniz değiştirildi." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/uk-UA.rc b/reactos/dll/win32/msgina/lang/uk-UA.rc index 34be98fe154..b125c5473c9 100644 --- a/reactos/dll/win32/msgina/lang/uk-UA.rc +++ b/reactos/dll/win32/msgina/lang/uk-UA.rc @@ -153,6 +153,9 @@ BEGIN IDS_CHANGEPWDTITLE "Change Password" IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." IDS_PASSWORDCHANGED "Your password has been changed." + IDS_LOGONTITLE "Logon Message" + IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." + IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/resource.h b/reactos/dll/win32/msgina/resource.h index b8e51ed4d18..e310dcf9a07 100644 --- a/reactos/dll/win32/msgina/resource.h +++ b/reactos/dll/win32/msgina/resource.h @@ -54,6 +54,9 @@ #define IDS_CHANGEPWDTITLE 40012 #define IDS_NONMATCHINGPASSWORDS 40013 #define IDS_PASSWORDCHANGED 40014 +#define IDS_LOGONTITLE 40015 +#define IDS_LOGONWRONGUSERORPWD 40016 +#define IDS_LOGONUSERDISABLED 40017 #define IDS_SHUTDOWN_SHUTDOWN 50000 #define IDS_SHUTDOWN_LOGOFF 50001 From 32cd2f8cedfd602de0863294cb3cb39ca17336b5 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Tue, 11 Mar 2014 05:09:14 +0000 Subject: [PATCH 087/419] [comctl32] rename TBSTYLE_EX_UNDOC1 to TBSTYLE_EX_VERTICAL svn path=/trunk/; revision=62470 --- reactos/dll/win32/comctl32/toolbar.c | 12 ++++++------ reactos/include/psdk/commctrl.h | 10 ++++++---- reactos/include/reactos/wine/commctrl.h | 1 - 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/reactos/dll/win32/comctl32/toolbar.c b/reactos/dll/win32/comctl32/toolbar.c index e803c3c340e..6b6a2fd4eb3 100644 --- a/reactos/dll/win32/comctl32/toolbar.c +++ b/reactos/dll/win32/comctl32/toolbar.c @@ -205,7 +205,7 @@ typedef enum /* Used to find undocumented extended styles */ #define TBSTYLE_EX_ALL (TBSTYLE_EX_DRAWDDARROWS | \ - TBSTYLE_EX_UNDOC1 | \ + TBSTYLE_EX_VERTICAL | \ TBSTYLE_EX_MIXEDBUTTONS | \ TBSTYLE_EX_DOUBLEBUFFER | \ TBSTYLE_EX_HIDECLIPPEDBUTTONS) @@ -1257,7 +1257,7 @@ TOOLBAR_CalcStrings (const TOOLBAR_INFO *infoPtr, LPSIZE lpSize) * the toolbar wrapping on its own, it can use the TBSTYLE_WRAPABLE * flag, and set the TBSTATE_WRAP flags manually on the appropriate items. * -* Note: TBSTYLE_WRAPABLE or TBSTYLE_EX_UNDOC1 can be used also to allow +* Note: TBSTYLE_WRAPABLE or TBSTYLE_EX_VERTICAL can be used also to allow * vertical toolbar lists. */ @@ -1273,7 +1273,7 @@ TOOLBAR_WrapToolbar(TOOLBAR_INFO *infoPtr) /* no layout is necessary. Applications may use this style */ /* to perform their own layout on the toolbar. */ if( !(infoPtr->dwStyle & TBSTYLE_WRAPABLE) && - !(infoPtr->dwExStyle & TBSTYLE_EX_UNDOC1) ) return; + !(infoPtr->dwExStyle & TBSTYLE_EX_VERTICAL) ) return; btnPtr = infoPtr->buttons; x = infoPtr->nIndent; @@ -3023,7 +3023,7 @@ TOOLBAR_AutoSize (TOOLBAR_INFO *infoPtr) cy = TOP_BORDER + infoPtr->nRows * infoPtr->nButtonHeight + BOTTOM_BORDER; cx = parent_rect.right - parent_rect.left; - if ((infoPtr->dwStyle & TBSTYLE_WRAPABLE) || (infoPtr->dwExStyle & TBSTYLE_EX_UNDOC1)) + if ((infoPtr->dwStyle & TBSTYLE_WRAPABLE) || (infoPtr->dwExStyle & TBSTYLE_EX_VERTICAL)) { TOOLBAR_LayoutToolbar(infoPtr); InvalidateRect( infoPtr->hwndSelf, NULL, TRUE ); @@ -3333,7 +3333,7 @@ TOOLBAR_GetButtonInfoT(const TOOLBAR_INFO *infoPtr, INT Id, LPTBBUTTONINFOW lpTb if (lpTbInfo == NULL) return -1; - /* MSDN documents a iImageLabel field added in Vista but it is not present in + /* MSDN documents an iImageLabel field added in Vista but it is not present in * the headers and tests shows that even with comctl 6 Vista accepts only the * original TBBUTTONINFO size */ @@ -4132,7 +4132,7 @@ TOOLBAR_Restore(TOOLBAR_INFO *infoPtr, const TBSAVEPARAMSW *lpSave) { /* separator */ nmtbr.tbButton.fsStyle = TBSTYLE_SEP; - /* when inserting separators, iBitmap controls it's size. + /* when inserting separators, iBitmap controls its size. 0 sets default size (width) */ nmtbr.tbButton.iBitmap = 0; } diff --git a/reactos/include/psdk/commctrl.h b/reactos/include/psdk/commctrl.h index f2b5b334184..ebb7dda7644 100644 --- a/reactos/include/psdk/commctrl.h +++ b/reactos/include/psdk/commctrl.h @@ -949,7 +949,6 @@ extern "C" { #define TBSTYLE_CUSTOMERASE 0x2000 #define TBSTYLE_REGISTERDROP 0x4000 #define TBSTYLE_TRANSPARENT 0x8000 -#define TBSTYLE_EX_DRAWDDARROWS 0x1 #define BTNS_BUTTON TBSTYLE_BUTTON #define BTNS_SEP TBSTYLE_SEP @@ -962,9 +961,12 @@ extern "C" { #define BTNS_SHOWTEXT 0x40 #define BTNS_WHOLEDROPDOWN 0x80 -#define TBSTYLE_EX_MIXEDBUTTONS 0x8 -#define TBSTYLE_EX_HIDECLIPPEDBUTTONS 0x10 -#define TBSTYLE_EX_DOUBLEBUFFER 0x80 +#define TBSTYLE_EX_DRAWDDARROWS 0x00000001 +#define TBSTYLE_EX_MULTICOLUMN 0x00000002 +#define TBSTYLE_EX_VERTICAL 0x00000004 +#define TBSTYLE_EX_MIXEDBUTTONS 0x00000008 +#define TBSTYLE_EX_HIDECLIPPEDBUTTONS 0x00000010 /* don't show partially obscured buttons */ +#define TBSTYLE_EX_DOUBLEBUFFER 0x00000080 /* Double Buffer the toolbar */ typedef struct _NMTBCUSTOMDRAW { NMCUSTOMDRAW nmcd; diff --git a/reactos/include/reactos/wine/commctrl.h b/reactos/include/reactos/wine/commctrl.h index 28ce67f7c5b..b7dcba3eb53 100644 --- a/reactos/include/reactos/wine/commctrl.h +++ b/reactos/include/reactos/wine/commctrl.h @@ -63,7 +63,6 @@ typedef LVFINDINFOA *LPLVFINDINFOA; typedef LVFINDINFOW *LPLVFINDINFOW; #define SB_SETBORDERS (WM_USER+5) -#define TBSTYLE_EX_UNDOC1 0x00000004 /* similar to TBSTYLE_WRAPABLE */ /* these are undocumented and the names are guesses */ typedef struct From cb87e96df612b009ab0275fd45bb058bfdbdd012 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Tue, 11 Mar 2014 07:22:28 +0000 Subject: [PATCH 088/419] [FASTFAT] Add support for more notifications on file modification. CORE-2582 svn path=/trunk/; revision=62471 --- reactos/drivers/filesystems/fastfat/rw.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/reactos/drivers/filesystems/fastfat/rw.c b/reactos/drivers/filesystems/fastfat/rw.c index 7cdd511536c..7474c5ba348 100644 --- a/reactos/drivers/filesystems/fastfat/rw.c +++ b/reactos/drivers/filesystems/fastfat/rw.c @@ -1000,6 +1000,8 @@ VfatWrite( if(!(*Fcb->Attributes & FILE_ATTRIBUTE_DIRECTORY)) { LARGE_INTEGER SystemTime; + ULONG Filter; + // set dates and times KeQuerySystemTime (&SystemTime); if (Fcb->Flags & FCB_IS_FATX_ENTRY) @@ -1019,6 +1021,20 @@ VfatWrite( } /* set date and times to dirty */ Fcb->Flags |= FCB_IS_DIRTY; + + /* Time to notify the OS */ + Filter = FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_ATTRIBUTES; + if (ByteOffset.QuadPart != OldFileSize.QuadPart) Filter |= FILE_NOTIFY_CHANGE_SIZE; + + FsRtlNotifyFullReportChange(IrpContext->DeviceExt->NotifySync, + &(IrpContext->DeviceExt->NotifyList), + (PSTRING)&Fcb->PathNameU, + Fcb->PathNameU.Length - Fcb->LongNameU.Length, + NULL, + NULL, + Filter, + FILE_ACTION_MODIFIED, + NULL); } } From 3bce7d16d74e7f3b0fddd5472fd4c720adda8e66 Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Tue, 11 Mar 2014 10:53:06 +0000 Subject: [PATCH 089/419] [NTOSKRNL] - Fix the buffer size check / set svn path=/trunk/; revision=62473 --- reactos/ntoskrnl/config/cmapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/config/cmapi.c b/reactos/ntoskrnl/config/cmapi.c index c9f5cb3f5bd..ed2eda03410 100644 --- a/reactos/ntoskrnl/config/cmapi.c +++ b/reactos/ntoskrnl/config/cmapi.c @@ -1434,7 +1434,7 @@ CmpQueryKeyDataFromCache( } /* Validate buffer length (we do not copy the name!) */ - *ResultLength = sizeof(KeyCachedInfo); + *ResultLength = sizeof(*KeyCachedInfo); if (Length < *ResultLength) { return STATUS_BUFFER_TOO_SMALL; From 2c26c653a9fac5114350a2dc2e6c68f534c7b61e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Tue, 11 Mar 2014 13:06:09 +0000 Subject: [PATCH 090/419] [SHELL32_APITEST] * Plug some leaks. CIDs 1106362, 1106363 and 1106364. CORE-7975 svn path=/trunk/; revision=62474 --- rostests/apitests/shell32/menu.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rostests/apitests/shell32/menu.cpp b/rostests/apitests/shell32/menu.cpp index 8fd046a6dc1..38e15d6dcdf 100644 --- a/rostests/apitests/shell32/menu.cpp +++ b/rostests/apitests/shell32/menu.cpp @@ -11,7 +11,11 @@ BOOL CheckWindowClass(HWND hwnd, PCWSTR className) { ULONG size = (wcslen(className) + 1)* sizeof(WCHAR); PWCHAR buffer = (PWCHAR)malloc(size); - if (GetClassNameW(hwnd, buffer, size ) == 0) return FALSE; + if (GetClassNameW(hwnd, buffer, size ) == 0) + { + free(buffer); + return FALSE; + } int res = wcscmp(buffer, className); free(buffer); return res == 0; @@ -161,6 +165,7 @@ void test_CShellMenu() if (!CreateCShellMenu(&shellMenu, &dockingMenu, &menuWithSite)) { skip("failed to create CShellMenuObject\n"); + delete dummyWindow; return; } @@ -288,6 +293,7 @@ void test_CShellMenu_callbacks(IShellFolder *shellFolder, HMENU hmenu) if (!CreateCShellMenu(&shellMenu, &dockingMenu, &menuWithSite)) { skip("failed to create CShellMenuObject\n"); + delete dummyWindow; return; } From e6fb12f8ca975a3c4d1e024249f2af4b929c8b4e Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Tue, 11 Mar 2014 18:46:32 +0000 Subject: [PATCH 091/419] [NTOS] - Remove unneeded macro by David Welch in 2002 and me in 2003. svn path=/trunk/; revision=62477 --- reactos/ntoskrnl/mm/i386/page.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/reactos/ntoskrnl/mm/i386/page.c b/reactos/ntoskrnl/mm/i386/page.c index b79e10285c9..c18a0d1c5f8 100644 --- a/reactos/ntoskrnl/mm/i386/page.c +++ b/reactos/ntoskrnl/mm/i386/page.c @@ -40,23 +40,11 @@ #define PA_ACCESSED (1 << PA_BIT_ACCESSED) #define PA_GLOBAL (1 << PA_BIT_GLOBAL) -#define HYPERSPACE (0xc0400000) -#define IS_HYPERSPACE(v) (((ULONG)(v) >= HYPERSPACE && (ULONG)(v) < HYPERSPACE + 0x400000)) +#define IS_HYPERSPACE(v) (((ULONG)(v) >= HYPER_SPACE && (ULONG)(v) <= HYPER_SPACE_END)) #define PTE_TO_PFN(X) ((X) >> PAGE_SHIFT) #define PFN_TO_PTE(X) ((X) << PAGE_SHIFT) -#if defined(__GNUC__) -#define PTE_TO_PAGE(X) ((LARGE_INTEGER)(LONGLONG)(PAGE_MASK(X))) -#else -__inline LARGE_INTEGER PTE_TO_PAGE(ULONG npage) -{ - LARGE_INTEGER dummy; - dummy.QuadPart = (LONGLONG)(PAGE_MASK(npage)); - return dummy; -} -#endif - const ULONG MmProtectToPteMask[32] = From 15d43e5a94bec92cc5c9c5dfa15ae5c8e76b33f7 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 11 Mar 2014 20:33:25 +0000 Subject: [PATCH 092/419] [MSGINA] Do not close the logon dialog if the user failed to log on. svn path=/trunk/; revision=62478 --- reactos/dll/win32/msgina/gui.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/msgina/gui.c b/reactos/dll/win32/msgina/gui.c index 2b5911d044f..1bd863ea108 100644 --- a/reactos/dll/win32/msgina/gui.c +++ b/reactos/dll/win32/msgina/gui.c @@ -922,7 +922,7 @@ GUILoggedOnSAS( static -INT +BOOL DoLogon( IN HWND hwndDlg, IN OUT PGINA_CONTEXT pgContext) @@ -930,7 +930,7 @@ DoLogon( LPWSTR UserName = NULL; LPWSTR Password = NULL; LPWSTR Domain = NULL; - INT result = WLX_SAS_ACTION_NONE; + BOOL result = FALSE; NTSTATUS Status, SubStatus = STATUS_SUCCESS; if (GetTextboxText(hwndDlg, IDC_USERNAME, &UserName) && *UserName == '\0') @@ -1003,7 +1003,7 @@ TRACE("DoLoginTasks failed! Status 0x%08lx\n", Status); ZeroMemory(pgContext->Password, 256 * sizeof(WCHAR)); wcscpy(pgContext->Password, Password); - result = WLX_SAS_ACTION_LOGON; + result = TRUE; done: if (UserName != NULL) @@ -1074,7 +1074,8 @@ LoggedOutWindowProc( switch (LOWORD(wParam)) { case IDOK: - EndDialog(hwndDlg, DoLogon(hwndDlg, pgContext)); + if (DoLogon(hwndDlg, pgContext)) + EndDialog(hwndDlg, WLX_SAS_ACTION_LOGON); return TRUE; case IDCANCEL: From c82b3ee66d53ad7b6667b5df2d6f531e6386bd26 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 11 Mar 2014 22:46:49 +0000 Subject: [PATCH 093/419] [PSDK] intsafe.h: fix a comment and 2 benign "typos" svn path=/trunk/; revision=62479 --- reactos/include/psdk/intsafe.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/include/psdk/intsafe.h b/reactos/include/psdk/intsafe.h index ce64be8ec8d..9b9557cfa13 100644 --- a/reactos/include/psdk/intsafe.h +++ b/reactos/include/psdk/intsafe.h @@ -657,7 +657,7 @@ INTSAFE_NAME(ULongLongMult)( M2 = M2Low + M2Hi * 0x100000000 Then the multiplication looks like this: - M1 * M2 = (M1Low + M1Hi * 0x100000000) + (M2Low + M2Hi * 0x100000000) + M1 * M2 = (M1Low + M1Hi * 0x100000000) * (M2Low + M2Hi * 0x100000000) = M1Low * M2Low + M1Low * M2Hi * 0x100000000 + M2Low * M1Hi * 0x100000000 @@ -686,13 +686,13 @@ INTSAFE_NAME(ULongLongMult)( } else { - *pOutput = LONGLONG_ERROR; + *pOutput = ULONGLONG_ERROR; return INTSAFE_E_ARITHMETIC_OVERFLOW; } if (Temp > ULONG_MAX) { - *pOutput = LONGLONG_ERROR; + *pOutput = ULONGLONG_ERROR; return INTSAFE_E_ARITHMETIC_OVERFLOW; } From de561c683e97b9326c8dd8a0dce387c57f6bbb57 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 11 Mar 2014 22:48:04 +0000 Subject: [PATCH 094/419] [PSDK] winternl.h: Fix RtlLookupAtomInAtomTable prototype (should be sent to wine? not sure) svn path=/trunk/; revision=62480 --- reactos/include/psdk/winternl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/include/psdk/winternl.h b/reactos/include/psdk/winternl.h index 193b0798eb2..b3d59dc005d 100644 --- a/reactos/include/psdk/winternl.h +++ b/reactos/include/psdk/winternl.h @@ -632,7 +632,7 @@ typedef enum _FSINFOCLASS { FileFsMaximumInformation } FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS; -typedef enum _KEY_INFORMATION_CLASS { +typedef enum _KEY_INFORMATION_CLASS { KeyBasicInformation = 0, KeyNodeInformation = 1, KeyFullInformation = 2, @@ -2244,7 +2244,7 @@ ULONG WINAPI RtlLengthSecurityDescriptor(PSECURITY_DESCRIPTOR); DWORD WINAPI RtlLengthSid(PSID); NTSTATUS WINAPI RtlLocalTimeToSystemTime(const LARGE_INTEGER*,PLARGE_INTEGER); BOOLEAN WINAPI RtlLockHeap(HANDLE); -NTSTATUS WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE,const WCHAR*,RTL_ATOM*); +NTSTATUS WINAPI RtlLookupAtomInAtomTable(RTL_ATOM_TABLE*,const WCHAR*,RTL_ATOM*); NTSTATUS WINAPI RtlMakeSelfRelativeSD(PSECURITY_DESCRIPTOR,PSECURITY_DESCRIPTOR,LPDWORD); void WINAPI RtlMapGenericMask(PACCESS_MASK,const GENERIC_MAPPING*); From 7ceac2f6a44a18e616c3f2e68a43bf4388288d9d Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 11 Mar 2014 22:51:22 +0000 Subject: [PATCH 095/419] [NTOSKRNL] Massive cleanup of old and deprecated "Ros-Mm"-Code svn path=/trunk/; revision=62481 --- reactos/ntoskrnl/include/internal/mm.h | 393 +-------------- reactos/ntoskrnl/ke/powerpc/kiinit.c | 9 +- reactos/ntoskrnl/ke/powerpc/stubs.c | 7 - reactos/ntoskrnl/mm/amd64/page.c | 69 --- reactos/ntoskrnl/mm/arm/page.c | 26 - reactos/ntoskrnl/mm/arm/stubs.c | 145 ------ reactos/ntoskrnl/mm/freelist.c | 4 - reactos/ntoskrnl/mm/i386/page.c | 30 -- reactos/ntoskrnl/mm/i386/pagepae.c | 638 ------------------------- reactos/ntoskrnl/mm/marea.c | 2 +- reactos/ntoskrnl/mm/pagefile.c | 38 -- reactos/ntoskrnl/mm/powerpc/page.c | 130 ----- 12 files changed, 13 insertions(+), 1478 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index 1af6e97647b..af0d03d464d 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -9,9 +9,6 @@ struct _EPROCESS; extern PMMSUPPORT MmKernelAddressSpace; extern PFN_COUNT MiFreeSwapPages; extern PFN_COUNT MiUsedSwapPages; -extern SIZE_T MmTotalPagedPoolQuota; -extern SIZE_T MmTotalNonPagedPoolQuota; -extern PHYSICAL_ADDRESS MmSharedDataPagePhysicalAddress; extern PFN_COUNT MmNumberOfPhysicalPages; extern UCHAR MmDisablePagingExecutive; extern PFN_NUMBER MmLowestPhysicalPage; @@ -19,9 +16,6 @@ extern PFN_NUMBER MmHighestPhysicalPage; extern PFN_NUMBER MmAvailablePages; extern PFN_NUMBER MmResidentAvailablePages; -extern PMEMORY_ALLOCATION_DESCRIPTOR MiFreeDescriptor; -extern MEMORY_ALLOCATION_DESCRIPTOR MiFreeDescriptorOrg; - extern LIST_ENTRY MmLoadedUserImageList; extern KMUTANT MmSystemLoadLock; @@ -43,8 +37,8 @@ extern SIZE_T MmPagedPoolCommit; extern SIZE_T MmPeakCommitment; extern SIZE_T MmtotalCommitLimitMaximum; -extern PVOID MiDebugMapping; -extern PMMPTE MmDebugPte; +extern PVOID MiDebugMapping; // internal +extern PMMPTE MmDebugPte; // internal struct _KTRAP_FRAME; struct _EPROCESS; @@ -66,7 +60,7 @@ typedef ULONG_PTR SWAPENTRY; // #define MMDBG_COPY_MAX_SIZE 0x8 -#if defined(_X86_) +#if defined(_X86_) // intenal for marea.c #define MI_STATIC_MEMORY_AREAS (14) #else #define MI_STATIC_MEMORY_AREAS (13) @@ -77,19 +71,6 @@ typedef ULONG_PTR SWAPENTRY; #define MEMORY_AREA_OWNED_BY_ARM3 (15) #define MEMORY_AREA_STATIC (0x80000000) -#define MM_PHYSICAL_PAGE_MPW_PENDING (0x8) - -#define MM_CORE_DUMP_TYPE_NONE (0x0) -#define MM_CORE_DUMP_TYPE_MINIMAL (0x1) -#define MM_CORE_DUMP_TYPE_FULL (0x2) - -/* Number of list heads to use */ -#define MI_FREE_POOL_LISTS 4 - - -/* Signature of free pool blocks */ -#define MM_FREE_POOL_TAG 'lprF' - /* Although Microsoft says this isn't hardcoded anymore, they won't be able to change it. Stuff depends on it */ #define MM_VIRTMEM_GRANULARITY (64 * 1024) @@ -119,32 +100,13 @@ typedef ULONG_PTR SWAPENTRY; #define SESSION_POOL_MASK 32 #define VERIFIER_POOL_MASK 64 -#define MM_PAGED_POOL_SIZE (100*1024*1024) -#define MM_NONPAGED_POOL_SIZE (100*1024*1024) - -/* - * Paged and non-paged pools are 8-byte aligned - */ -#define MM_POOL_ALIGNMENT 8 - +// FIXME: use ALIGN_UP_BY #define MM_ROUND_UP(x,s) \ ((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1))) #define MM_ROUND_DOWN(x,s) \ ((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1))) -#define PAGE_FLAGS_VALID_FROM_USER_MODE \ - (PAGE_READONLY | \ - PAGE_READWRITE | \ - PAGE_WRITECOPY | \ - PAGE_EXECUTE | \ - PAGE_EXECUTE_READ | \ - PAGE_EXECUTE_READWRITE | \ - PAGE_EXECUTE_WRITECOPY | \ - PAGE_GUARD | \ - PAGE_NOACCESS | \ - PAGE_NOCACHE) - #define PAGE_FLAGS_VALID_FOR_SECTION \ (PAGE_READONLY | \ PAGE_READWRITE | \ @@ -331,9 +293,10 @@ typedef struct _MMPFNENTRY USHORT RemovalRequested:1; USHORT CacheAttribute:2; USHORT Rom:1; - USHORT ParityError:1; // HasRmap + USHORT ParityError:1; } MMPFNENTRY; +// Mm internal typedef struct _MMPFN { union @@ -427,6 +390,7 @@ typedef struct _MM_REGION LIST_ENTRY RegionListEntry; } MM_REGION, *PMM_REGION; +// Mm internal /* Entry describing free pool memory */ typedef struct _MMFREE_POOL_ENTRY { @@ -531,9 +495,10 @@ MmLocateMemoryAreaByAddress( PVOID Address ); +// fixme: unused? ULONG_PTR NTAPI -MmFindGapAtAddress( +MmFindGapAtAddress_( PMMSUPPORT AddressSpace, PVOID Address ); @@ -556,10 +521,6 @@ MmFreeMemoryAreaByPtr( PVOID FreePageContext ); -VOID -NTAPI -MmDumpMemoryAreas(PMMSUPPORT AddressSpace); - PMEMORY_AREA NTAPI MmLocateMemoryAreaByRegion( @@ -577,14 +538,6 @@ MmFindGap( BOOLEAN TopDown ); -VOID -NTAPI -MmReleaseMemoryAreaIfDecommitted( - struct _EPROCESS *Process, - PMMSUPPORT AddressSpace, - PVOID BaseAddress -); - VOID NTAPI MmMapMemoryArea(PVOID BaseAddress, @@ -603,14 +556,6 @@ MiCheckAllProcessMemoryAreas(VOID); /* npool.c *******************************************************************/ -VOID -NTAPI -MiDebugDumpNonPagedPool(BOOLEAN NewOnly); - -VOID -NTAPI -MiDebugDumpNonPagedPoolStats(BOOLEAN NewOnly); - VOID NTAPI MiInitializeNonPagedPool(VOID); @@ -634,71 +579,8 @@ MiFreePoolPages( IN PVOID StartingAddress ); -PVOID -NTAPI -MmGetMdlPageAddress( - PMDL Mdl, - PVOID Offset -); - /* pool.c *******************************************************************/ -PVOID -NTAPI -ExAllocateNonPagedPoolWithTag( - POOL_TYPE type, - ULONG size, - ULONG Tag, - PVOID Caller -); - -PVOID -NTAPI -ExAllocatePagedPoolWithTag( - POOL_TYPE Type, - ULONG size, - ULONG Tag -); - -VOID -NTAPI -ExFreeNonPagedPool(PVOID block); - -VOID -NTAPI -ExFreePagedPool(IN PVOID Block); - -BOOLEAN -NTAPI -ExpIsPoolTagDebuggable(ULONG Tag); - -PVOID -NTAPI -ExpAllocateDebugPool( - POOL_TYPE Type, - ULONG Size, - ULONG Tag, - PVOID Caller, - BOOLEAN EndOfPage -); - -VOID -NTAPI -ExpFreeDebugPool(PVOID Block, BOOLEAN PagedPool); - -VOID -NTAPI -MmInitializePagedPool(VOID); - -PVOID -NTAPI -MiAllocateSpecialPool( - IN POOL_TYPE PoolType, - IN SIZE_T NumberOfBytes, - IN ULONG Tag, - IN ULONG Underrun -); - BOOLEAN NTAPI MiRaisePoolQuota( @@ -718,10 +600,6 @@ MmBuildMdlFromPages( /* mminit.c ******************************************************************/ -VOID -NTAPI -MiShutdownMemoryManager(VOID); - VOID NTAPI MmInit1( @@ -733,13 +611,6 @@ NTAPI MmInitSystem(IN ULONG Phase, IN PLOADER_PARAMETER_BLOCK LoaderBlock); -VOID -NTAPI -MiFreeInitMemory(VOID); - -VOID -NTAPI -MmInitializeMdlImplementation(VOID); /* pagefile.c ****************************************************************/ @@ -747,10 +618,6 @@ SWAPENTRY NTAPI MmAllocSwapPage(VOID); -VOID -NTAPI -MmDereserveSwapPages(ULONG Nr); - VOID NTAPI MmFreeSwapPage(SWAPENTRY Entry); @@ -770,10 +637,6 @@ MmReadFromSwapPage( PFN_NUMBER Page ); -BOOLEAN -NTAPI -MmReserveSwapPages(ULONG Nr); - NTSTATUS NTAPI MmWriteToSwapPage( @@ -781,21 +644,6 @@ MmWriteToSwapPage( PFN_NUMBER Page ); -NTSTATUS -NTAPI -MmDumpToPagingFile( - ULONG BugCode, - ULONG BugCodeParameter1, - ULONG BugCodeParameter2, - ULONG BugCodeParameter3, - ULONG BugCodeParameter4, - struct _KTRAP_FRAME* TrapFrame -); - -BOOLEAN -NTAPI -MmIsAvailableSwapPage(VOID); - VOID NTAPI MmShowOutOfSpaceMessagePagingFile(VOID); @@ -908,75 +756,8 @@ MmAccessFault( IN PVOID TrapInformation ); -/* anonmem.c *****************************************************************/ - -NTSTATUS -NTAPI -MmNotPresentFaultVirtualMemory( - PMMSUPPORT AddressSpace, - MEMORY_AREA* MemoryArea, - PVOID Address -); - -NTSTATUS -NTAPI -MmPageOutVirtualMemory( - PMMSUPPORT AddressSpace, - PMEMORY_AREA MemoryArea, - PVOID Address, - PFN_NUMBER Page -); - -NTSTATUS -NTAPI -MmQueryAnonMem( - PMEMORY_AREA MemoryArea, - PVOID Address, - PMEMORY_BASIC_INFORMATION Info, - PSIZE_T ResultLength -); - -VOID -NTAPI -MmFreeVirtualMemory( - struct _EPROCESS* Process, - PMEMORY_AREA MemoryArea -); - -NTSTATUS -NTAPI -MmProtectAnonMem( - PMMSUPPORT AddressSpace, - PMEMORY_AREA MemoryArea, - PVOID BaseAddress, - SIZE_T Length, - ULONG Protect, - PULONG OldProtect -); - -NTSTATUS -NTAPI -MmWritePageVirtualMemory( - PMMSUPPORT AddressSpace, - PMEMORY_AREA MArea, - PVOID Address, - PFN_NUMBER Page -); - /* kmap.c ********************************************************************/ -PVOID -NTAPI -ExAllocatePage(VOID); - -VOID -NTAPI -ExUnmapPage(PVOID Addr); - -PVOID -NTAPI -ExAllocatePageWithPhysPage(PFN_NUMBER Page); - NTSTATUS NTAPI MiCopyFromUserPage( @@ -984,16 +765,6 @@ MiCopyFromUserPage( PFN_NUMBER OldPage ); -NTSTATUS -NTAPI -MiZeroPage(PFN_NUMBER Page); - -/* memsafe.s *****************************************************************/ - -PVOID -FASTCALL -MmSafeReadPtr(PVOID Source); - /* process.c *****************************************************************/ PVOID @@ -1149,40 +920,12 @@ VOID NTAPI MmRemoveLRUUserPage(PFN_NUMBER Page); -VOID -NTAPI -MmLockPage(PFN_NUMBER Page); - -VOID -NTAPI -MmUnlockPage(PFN_NUMBER Page); - -ULONG -NTAPI -MmGetLockCountPage(PFN_NUMBER Page); - -VOID -NTAPI -MmInitializePageList( - VOID -); - VOID NTAPI MmDumpArmPfnDatabase( IN BOOLEAN StatusOnly ); -PFN_NUMBER -NTAPI -MmGetContinuousPages( - ULONG NumberOfBytes, - PHYSICAL_ADDRESS LowestAcceptableAddress, - PHYSICAL_ADDRESS HighestAcceptableAddress, - PHYSICAL_ADDRESS BoundaryAddressMultiple, - BOOLEAN ZeroPages -); - VOID NTAPI MmZeroPageThread( @@ -1231,22 +974,6 @@ MmCreateHyperspaceMapping(IN PFN_NUMBER Page) /* i386/page.c *********************************************************/ -NTSTATUS -NTAPI -MmCreateVirtualMappingForKernel( - PVOID Address, - ULONG flProtect, - PPFN_NUMBER Pages, - ULONG PageCount -); - -NTSTATUS -NTAPI -MmCommitPagedPoolAddress( - PVOID Address, - BOOLEAN Locked -); - NTSTATUS NTAPI MmCreateVirtualMapping( @@ -1299,13 +1026,6 @@ VOID NTAPI MmInitGlobalKernelPageDirectory(VOID); -VOID -NTAPI -MmEnableVirtualMapping( - struct _EPROCESS *Process, - PVOID Address -); - VOID NTAPI MmGetPageFileMapping( @@ -1336,13 +1056,6 @@ MmIsPageSwapEntry( PVOID Address ); -VOID -NTAPI -MmTransferOwnershipPage( - PFN_NUMBER Page, - ULONG NewConsumer -); - VOID NTAPI MmSetDirtyPage( @@ -1356,16 +1069,6 @@ MmAllocPage( ULONG Consumer ); -LONG -NTAPI -MmAllocPagesSpecifyRange( - ULONG Consumer, - PHYSICAL_ADDRESS LowestAddress, - PHYSICAL_ADDRESS HighestAddress, - ULONG NumberOfPages, - PPFN_NUMBER Pages -); - VOID NTAPI MmDereferencePage(PFN_NUMBER Page); @@ -1399,10 +1102,6 @@ MmSetCleanPage( PVOID Address ); -NTSTATUS -NTAPI -MmCreatePageTable(PVOID PAddress); - VOID NTAPI MmDeletePageTable( @@ -1439,10 +1138,6 @@ MmInitializeHandBuiltProcess2( IN PEPROCESS Process ); -NTSTATUS -NTAPI -MmReleaseMmInfo(struct _EPROCESS *Process); - NTSTATUS NTAPI MmSetExecuteOptions(IN ULONG ExecuteOptions); @@ -1451,10 +1146,6 @@ NTSTATUS NTAPI MmGetExecuteOptions(IN PULONG ExecuteOptions); -VOID -NTAPI -MmDeleteProcessPageDirectory(struct _EPROCESS *Process); - VOID NTAPI MmDeleteVirtualMapping( @@ -1472,30 +1163,6 @@ MmIsDirtyPage( PVOID Address ); -VOID -NTAPI -MmMarkPageMapped(PFN_NUMBER Page); - -VOID -NTAPI -MmMarkPageUnmapped(PFN_NUMBER Page); - -VOID -NTAPI -MmUpdatePageDir( - struct _EPROCESS *Process, - PVOID Address, - ULONG Size -); - -VOID -NTAPI -MiInitPageDirectoryMap(VOID); - -ULONG -NTAPI -MiGetUserPageDirectoryCount(VOID); - /* wset.c ********************************************************************/ NTSTATUS @@ -1565,13 +1232,6 @@ MmGetFileNameForSection( OUT POBJECT_NAME_INFORMATION *ModuleName ); -PVOID -NTAPI -MmAllocateSection( - IN SIZE_T Length, - PVOID BaseAddress -); - NTSTATUS NTAPI MmQuerySectionView( @@ -1630,41 +1290,6 @@ VOID NTAPI MmFreeSectionSegments(PFILE_OBJECT FileObject); -/* mpw.c *********************************************************************/ - -NTSTATUS -NTAPI -MmInitMpwThread(VOID); - -NTSTATUS -NTAPI -MmInitBsmThread(VOID); - -/* pager.c *******************************************************************/ - -BOOLEAN -NTAPI -MiIsPagerThread(VOID); - -VOID -NTAPI -MiStartPagerThread(VOID); - -VOID -NTAPI -MiStopPagerThread(VOID); - -NTSTATUS -FASTCALL -MiQueryVirtualMemory( - IN HANDLE ProcessHandle, - IN PVOID Address, - IN MEMORY_INFORMATION_CLASS VirtualMemoryInformationClass, - OUT PVOID VirtualMemoryInformation, - IN SIZE_T Length, - OUT PSIZE_T ResultLength -); - /* sysldr.c ******************************************************************/ VOID diff --git a/reactos/ntoskrnl/ke/powerpc/kiinit.c b/reactos/ntoskrnl/ke/powerpc/kiinit.c index 1d9c68b7f3c..94ed31e51ac 100644 --- a/reactos/ntoskrnl/ke/powerpc/kiinit.c +++ b/reactos/ntoskrnl/ke/powerpc/kiinit.c @@ -189,7 +189,7 @@ KiInitializeKernel(IN PKPROCESS InitProcess, InitThread->Affinity = 1 << Number; InitThread->WaitIrql = DISPATCH_LEVEL; InitProcess->ActiveProcessors = 1 << Number; - + /* HACK for MmUpdatePageDir */ ((PETHREAD)InitThread)->ThreadsProcess = (PEPROCESS)InitProcess; @@ -228,11 +228,8 @@ KiInitializeKernel(IN PKPROCESS InitProcess, Prcb->DpcStack = DpcStack; } - /* Free Initial Memory */ - // MiFreeInitMemory(); - KfRaiseIrql(DISPATCH_LEVEL); - + KeSetPriorityThread(InitThread, 0); /* Setup decrementer exception */ KiSetupDecrementerTrap(); @@ -297,7 +294,7 @@ KiSystemStartupReal(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* Skip initial setup if this isn't the Boot CPU */ if (Cpu) goto AppCpuInit; - + /* Initialize the PCR */ RtlZeroMemory(Pcr, PAGE_SIZE); KiInitializePcr(Cpu, diff --git a/reactos/ntoskrnl/ke/powerpc/stubs.c b/reactos/ntoskrnl/ke/powerpc/stubs.c index 3f4e8983331..99744da4c6f 100644 --- a/reactos/ntoskrnl/ke/powerpc/stubs.c +++ b/reactos/ntoskrnl/ke/powerpc/stubs.c @@ -151,13 +151,6 @@ KiSwapContext(PKTHREAD CurrentThread, PKTHREAD NewThread) return TRUE; } -NTSTATUS -NTAPI -Mmi386ReleaseMmInfo(PEPROCESS Process) -{ - return STATUS_UNSUCCESSFUL; -} - VOID NTAPI KeI386VdmInitialize(VOID) diff --git a/reactos/ntoskrnl/mm/amd64/page.c b/reactos/ntoskrnl/mm/amd64/page.c index 573c9834583..315feb01e04 100644 --- a/reactos/ntoskrnl/mm/amd64/page.c +++ b/reactos/ntoskrnl/mm/amd64/page.c @@ -137,57 +137,6 @@ MiFlushTlb(PMMPTE Pte, PVOID Address) } } -static -VOID -MmDeletePageTablePfn(PFN_NUMBER PageFrameNumber, ULONG Level) -{ - PMMPTE PageTable; - KIRQL OldIrql; - PMMPFN PfnEntry; - ULONG i, NumberEntries; - - /* Check if this is a page table */ - if (Level > 0) - { - NumberEntries = (Level == 4) ? MiAddressToPxi(MmHighestUserAddress)+1 : 512; - - /* Map the page table in hyperspace */ - PageTable = (PMMPTE)MmCreateHyperspaceMapping(PageFrameNumber); - - /* Loop all page table entries */ - for (i = 0; i < NumberEntries; i++) - { - /* Check if the entry is valid */ - if (PageTable[i].u.Hard.Valid) - { - /* Recursively free the page that backs it */ - MmDeletePageTablePfn(PageTable[i].u.Hard.PageFrameNumber, Level - 1); - } - } - - /* Delete the hyperspace mapping */ - MmDeleteHyperspaceMapping(PageTable); - } - - /* Check if this is a legacy allocation */ - PfnEntry = MiGetPfnEntry(PageFrameNumber); - if (MI_IS_ROS_PFN(PfnEntry)) - { - /* Free it using the legacy API */ - MmReleasePageMemoryConsumer(MC_SYSTEM, PageFrameNumber); - } - else - { - OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock); - - /* Free it using the ARM3 API */ - MI_SET_PFN_DELETED(PfnEntry); - MiDecrementShareCount(PfnEntry, PageFrameNumber); - - KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql); - } -} - static PMMPTE MiGetPteForProcess( @@ -497,15 +446,6 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) MiFlushTlb(Pte, Address); } - -NTSTATUS -NTAPI -Mmi386ReleaseMmInfo(PEPROCESS Process) -{ - UNIMPLEMENTED; - return STATUS_UNSUCCESSFUL; -} - VOID NTAPI MmDeleteVirtualMapping( @@ -560,15 +500,6 @@ MmDeletePageFileMapping(PEPROCESS Process, PVOID Address, UNIMPLEMENTED; } - -VOID -NTAPI -MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) -{ - UNIMPLEMENTED; -} - - NTSTATUS NTAPI MmCreatePageFileMapping(PEPROCESS Process, diff --git a/reactos/ntoskrnl/mm/arm/page.c b/reactos/ntoskrnl/mm/arm/page.c index 3ae1430f89e..de76e662340 100644 --- a/reactos/ntoskrnl/mm/arm/page.c +++ b/reactos/ntoskrnl/mm/arm/page.c @@ -137,16 +137,6 @@ MmCreateProcessAddressSpace(IN ULONG MinWs, return FALSE; } -VOID -NTAPI -MmUpdatePageDir(IN PEPROCESS Process, - IN PVOID Address, - IN ULONG Size) -{ - /* Nothing to do */ - return; -} - PULONG NTAPI MmGetPageDirectory(VOID) @@ -309,19 +299,3 @@ MmInitGlobalKernelPageDirectory(VOID) } } -/* PUBLIC FUNCTIONS ***********************************************************/ - -/* - * @implemented - */ -PHYSICAL_ADDRESS -NTAPI -MmGetPhysicalAddress(IN PVOID Address) -{ - PHYSICAL_ADDRESS PhysicalAddress; - PhysicalAddress.QuadPart = 0; - - UNIMPLEMENTED_DBGBREAK(); - - return PhysicalAddress; -} diff --git a/reactos/ntoskrnl/mm/arm/stubs.c b/reactos/ntoskrnl/mm/arm/stubs.c index 2d43dfc27db..bed724de73e 100644 --- a/reactos/ntoskrnl/mm/arm/stubs.c +++ b/reactos/ntoskrnl/mm/arm/stubs.c @@ -237,58 +237,6 @@ MiGetPageEntryForProcess(IN PEPROCESS Process, return Pte; } -VOID -NTAPI -MmDeletePageTable(IN PEPROCESS Process, - IN PVOID Address) -{ - PMMPDE_HARDWARE PointerPde; - - // - // Not valid for kernel addresses - // - DPRINT("MmDeletePageTable(%p, %p)\n", Process, Address); - ASSERT(Address < MmSystemRangeStart); - - // - // Check if this is for a different process - // - if ((Process) && (Process != PsGetCurrentProcess())) - { - // - // FIXME-USER: Need to attach to the process - // - ASSERT(FALSE); - } - - // - // Get the PDE - // - PointerPde = MiGetPdeAddress(Address); - - // - // On ARM, we use a section mapping for the original low-memory mapping - // - if ((Address) || (PointerPde->u.Hard.Section.Valid == 0)) - { - // - // Make sure it's valid - // - ASSERT(PointerPde->u.Hard.Coarse.Valid == 1); - } - - // - // Clear the PDE - // - PointerPde->u.Hard.AsUlong = 0; - ASSERT(PointerPde->u.Hard.Coarse.Valid == 0); - - // - // Invalidate the TLB entry - // - MiFlushTlb((PMMPTE)PointerPde, MiGetPteAddress(Address)); -} - BOOLEAN NTAPI MmCreateProcessAddressSpace(IN ULONG MinWs, @@ -367,17 +315,6 @@ MmCreateProcessAddressSpace(IN ULONG MinWs, return TRUE; } -NTSTATUS -NTAPI -Mmi386ReleaseMmInfo(IN PEPROCESS Process) -{ - // - // FIXME-USER: Need to delete address space - // - UNIMPLEMENTED_DBGBREAK(); - return STATUS_NOT_IMPLEMENTED; -} - PULONG NTAPI MmGetPageDirectory(VOID) @@ -388,17 +325,6 @@ MmGetPageDirectory(VOID) return (PULONG)KeArmTranslationTableRegisterGet().AsUlong; } -VOID -NTAPI -MmEnableVirtualMapping(IN PEPROCESS Process, - IN PVOID Address) -{ - // - // TODO - // - UNIMPLEMENTED_DBGBREAK(); -} - NTSTATUS NTAPI MmCreateVirtualMappingInternal(IN PEPROCESS Process, @@ -482,24 +408,6 @@ MmCreateVirtualMappingInternal(IN PEPROCESS Process, return STATUS_SUCCESS; } -NTSTATUS -NTAPI -MmCreateVirtualMappingForKernel(IN PVOID Address, - IN ULONG Protection, - IN PPFN_NUMBER Pages, - IN ULONG PageCount) -{ - // - // Call the internal version - // - return MmCreateVirtualMappingInternal(NULL, - Address, - Protection, - Pages, - PageCount, - FALSE); -} - NTSTATUS NTAPI MmCreateVirtualMappingUnsafe(IN PEPROCESS Process, @@ -774,59 +682,6 @@ MmInitGlobalKernelPageDirectory(VOID) } } -VOID -NTAPI -MiInitPageDirectoryMap(VOID) -{ - MEMORY_AREA* MemoryArea = NULL; - PVOID BaseAddress; - NTSTATUS Status; - - // - // Create memory area for the PTE area - // - BaseAddress = (PVOID)PTE_BASE; - Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - MEMORY_AREA_OWNED_BY_ARM3, - &BaseAddress, - 0x1000000, - PAGE_READWRITE, - &MemoryArea, - TRUE, - 0, - PAGE_SIZE); - ASSERT(NT_SUCCESS(Status)); - - // - // Create memory area for the PDE area - // - BaseAddress = (PVOID)PDE_BASE; - Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - MEMORY_AREA_OWNED_BY_ARM3, - &BaseAddress, - 0x100000, - PAGE_READWRITE, - &MemoryArea, - TRUE, - 0, - PAGE_SIZE); - ASSERT(NT_SUCCESS(Status)); - - // - // And finally, hyperspace - // - BaseAddress = (PVOID)HYPER_SPACE; - Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - MEMORY_AREA_OWNED_BY_ARM3, - &BaseAddress, - PAGE_SIZE, - PAGE_READWRITE, - &MemoryArea, - TRUE, - 0, - PAGE_SIZE); - ASSERT(NT_SUCCESS(Status)); -} /* PUBLIC FUNCTIONS ***********************************************************/ diff --git a/reactos/ntoskrnl/mm/freelist.c b/reactos/ntoskrnl/mm/freelist.c index 62a5e6205f5..e65ba48ffbb 100644 --- a/reactos/ntoskrnl/mm/freelist.c +++ b/reactos/ntoskrnl/mm/freelist.c @@ -14,10 +14,6 @@ #define NDEBUG #include -#if defined (ALLOC_PRAGMA) -#pragma alloc_text(INIT, MmInitializePageList) -#endif - #define MODULE_INVOLVED_IN_ARM3 #include "ARM3/miarm.h" diff --git a/reactos/ntoskrnl/mm/i386/page.c b/reactos/ntoskrnl/mm/i386/page.c index c18a0d1c5f8..3ccebac2c38 100644 --- a/reactos/ntoskrnl/mm/i386/page.c +++ b/reactos/ntoskrnl/mm/i386/page.c @@ -16,7 +16,6 @@ #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) -#pragma alloc_text(INIT, MiInitPageDirectoryMap) #endif @@ -592,35 +591,6 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) } } -VOID -NTAPI -MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) -{ - PULONG Pt; - ULONG Pte; - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - if (Pt == NULL) - { - //HACK to get DPH working, waiting for MM rewrite :-/ - //KeBugCheck(MEMORY_MANAGEMENT); - return; - } - - /* Do not mark a 0 page as present */ - if(0 == InterlockedCompareExchangePte(Pt, 0, 0)) - return; - - do - { - Pte = *Pt; - } while (Pte != InterlockedCompareExchangePte(Pt, Pte | PA_PRESENT, Pte)); - - /* We don't need to flush the TLB here because it - * won't cache translations for non-present pages */ - MmUnmapPageTable(Pt); -} - BOOLEAN NTAPI MmIsPagePresent(PEPROCESS Process, PVOID Address) diff --git a/reactos/ntoskrnl/mm/i386/pagepae.c b/reactos/ntoskrnl/mm/i386/pagepae.c index f7a4c428e7f..f217e972884 100644 --- a/reactos/ntoskrnl/mm/i386/pagepae.c +++ b/reactos/ntoskrnl/mm/i386/pagepae.c @@ -15,7 +15,6 @@ #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) -#pragma alloc_text(INIT, MiInitPageDirectoryMap) #endif @@ -56,17 +55,6 @@ ULONGLONG MmGlobalKernelPageDirectoryForPAE[2048]; #define PAE_PTE_TO_PFN(X) (PAE_PAGE_MASK(X) >> PAGE_SHIFT) #define PAE_PFN_TO_PTE(X) ((X) << PAGE_SHIFT) -#if defined(__GNUC__) -#define PTE_TO_PAGE(X) ((LARGE_INTEGER)(LONGLONG)(PAGE_MASK(X))) -#else -__inline LARGE_INTEGER PTE_TO_PAGE(ULONG npage) -{ - LARGE_INTEGER dummy; - dummy.QuadPart = (LONGLONG)(PAGE_MASK(npage)); - return dummy; -} -#endif - extern BOOLEAN Ke386Pae; extern BOOLEAN Ke386NoExecute; @@ -197,149 +185,6 @@ ProtectToPTE(ULONG flProtect) #define PAE_ADDR_TO_PTE_OFFSET(v) ((((ULONG_PTR)(v)) % (512 * PAGE_SIZE)) / PAGE_SIZE) - -NTSTATUS -NTAPI -Mmi386ReleaseMmInfo(PEPROCESS Process) -{ - PUSHORT LdtDescriptor; - ULONG LdtBase; - ULONG i, j; - - DPRINT("Mmi386ReleaseMmInfo(Process %x)\n",Process); - - LdtDescriptor = (PUSHORT) &Process->Pcb.LdtDescriptor; - LdtBase = LdtDescriptor[1] | - ((LdtDescriptor[2] & 0xff) << 16) | - ((LdtDescriptor[3] & ~0xff) << 16); - - DPRINT("LdtBase: %x\n", LdtBase); - - if (LdtBase) - { - ExFreePool((PVOID) LdtBase); - } - - if (Ke386Pae) - { - PULONGLONG PageDirTable; - PULONGLONG PageDir; - PULONGLONG Pde; - ULONG k; - - PageDirTable = (PULONGLONG)MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(Process->Pcb.DirectoryTableBase.QuadPart)); - for (i = 0; i < 4; i++) - { - PageDir = (PULONGLONG)MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(PageDirTable[i])); - if (i < PAE_ADDR_TO_PDTE_OFFSET(MmSystemRangeStart)) - { - for (j = 0; j < 512; j++) - { - if (PageDir[j] != 0LL) - { - DPRINT1("ProcessId %d, Pde for %08x - %08x is not freed, RefCount %d\n", - Process->UniqueProcessId, - (i * 512 + j) * 512 * PAGE_SIZE, (i * 512 + j + 1) * 512 * PAGE_SIZE - 1, - ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable[i*512 + j]); - Pde = MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(PageDir[j])); - for (k = 0; k < 512; k++) - { - if(Pde[k] != 0) - { - if (Pde[k] & PA_PRESENT) - { - DPRINT1("Page at %08x is not freed\n", - (i * 512 + j) * 512 * PAGE_SIZE + k * PAGE_SIZE); - } - else - { - DPRINT1("Swapentry %x at %x is not freed\n", - (i * 512 + j) * 512 * PAGE_SIZE + k * PAGE_SIZE); - } - } - } - MmDeleteHyperspaceMapping(Pde); - MmReleasePageMemoryConsumer(MC_NPPOOL, PAE_PTE_TO_PFN(PageDir[j])); - } - } - } - if (i == PAE_ADDR_TO_PDTE_OFFSET(HYPERSPACE)) - { - MmReleasePageMemoryConsumer(MC_NPPOOL, PAE_PTE_TO_PFN(PageDir[PAE_ADDR_TO_PDE_PAGE_OFFSET(HYPERSPACE)])); - MmReleasePageMemoryConsumer(MC_NPPOOL, PAE_PTE_TO_PFN(PageDir[PAE_ADDR_TO_PDE_PAGE_OFFSET(HYPERSPACE)+1])); - } - MmDeleteHyperspaceMapping(PageDir); - MmReleasePageMemoryConsumer(MC_NPPOOL, PAE_PTE_TO_PFN(PageDirTable[i])); - } - MmDeleteHyperspaceMapping((PVOID)PageDirTable); - MmReleasePageMemoryConsumer(MC_NPPOOL, PAE_PTE_TO_PFN(Process->Pcb.DirectoryTableBase.QuadPart)); - } - else - { - PULONG Pde; - PULONG PageDir; - PageDir = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); - for (i = 0; i < ADDR_TO_PDE_OFFSET(MmSystemRangeStart); i++) - { - if (PageDir[i] != 0) - { - DPRINT1("Pde for %08x - %08x is not freed, RefCount %d\n", - i * 4 * 1024 * 1024, (i + 1) * 4 * 1024 * 1024 - 1, - ((PMADDRESS_SPACE)&Process->VadRoot)->PageTableRefCountTable[i]); - Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(PageDir[i])); - for (j = 0; j < 1024; j++) - { - if(Pde[j] != 0) - { - if (Pde[j] & PA_PRESENT) - { - DPRINT1("Page at %08x is not freed\n", - i * 4 * 1024 * 1024 + j * PAGE_SIZE); - } - else - { - DPRINT1("Swapentry %x at %x is not freed\n", - Pde[j], i * 4 * 1024 * 1024 + j * PAGE_SIZE); - } - } - } - MmDeleteHyperspaceMapping(Pde); - MmReleasePageMemoryConsumer(MC_NPPOOL, PTE_TO_PFN(PageDir[i])); - } - } - MmReleasePageMemoryConsumer(MC_NPPOOL, PTE_TO_PFN(PageDir[ADDR_TO_PDE_OFFSET(HYPERSPACE)])); - MmDeleteHyperspaceMapping(PageDir); - MmReleasePageMemoryConsumer(MC_NPPOOL, PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); - } - -#if defined(__GNUC__) - - Process->Pcb.DirectoryTableBase.QuadPart = 0LL; -#else - - Process->Pcb.DirectoryTableBase.QuadPart = 0; -#endif - - DPRINT("Finished Mmi386ReleaseMmInfo()\n"); - return(STATUS_SUCCESS); -} - -NTSTATUS -NTAPI -MmInitializeHandBuiltProcess(IN PEPROCESS Process, - IN PLARGE_INTEGER DirectoryTableBase) -{ - /* Share the directory base with the idle process */ - *DirectoryTableBase = PsGetCurrentProcess()->Pcb.DirectoryTableBase; - - /* Initialize the Addresss Space */ - MmInitializeAddressSpace(Process, (PMADDRESS_SPACE)&Process->VadRoot); - - /* The process now has an address space */ - Process->HasAddressSpace = TRUE; - return STATUS_SUCCESS; -} - BOOLEAN NTAPI MmCreateProcessAddressSpace(IN ULONG MinWs, @@ -420,39 +265,6 @@ MmCreateProcessAddressSpace(IN ULONG MinWs, return TRUE; } -VOID -NTAPI -MmDeletePageTable(PEPROCESS Process, PVOID Address) -{ - PEPROCESS CurrentProcess = PsGetCurrentProcess(); - - if (Process != NULL && Process != CurrentProcess) - { - KeAttachProcess(&Process->Pcb); - } - - if (Ke386Pae) - { - ULONGLONG ZeroPde = 0LL; - (void)ExfpInterlockedExchange64UL(PAE_ADDR_TO_PDE(Address), &ZeroPde); - MiFlushTlb((PULONG)PAE_ADDR_TO_PDE(Address), PAE_ADDR_TO_PTE(Address)); - } - else - { - *(ADDR_TO_PDE(Address)) = 0; - MiFlushTlb(ADDR_TO_PDE(Address), ADDR_TO_PTE(Address)); - } - if (Address >= MmSystemRangeStart) - { - ASSERT(FALSE); - // MmGlobalKernelPageDirectory[ADDR_TO_PDE_OFFSET(Address)] = 0; - } - if (Process != NULL && Process != CurrentProcess) - { - KeDetachProcess(); - } -} - VOID NTAPI MmFreePageTable(PEPROCESS Process, PVOID Address) @@ -1105,73 +917,6 @@ MmIsDirtyPage(PEPROCESS Process, PVOID Address) } } -BOOLEAN -NTAPI -MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) -{ - if (Address < MmSystemRangeStart && Process == NULL) - { - DPRINT1("MmIsAccessedAndResetAccessPage is called for user space without a process.\n"); - ASSERT(FALSE); - } - if (Ke386Pae) - { - PULONGLONG Pt; - ULONGLONG Pte; - ULONGLONG tmpPte; - - Pt = MmGetPageTableForProcessForPAE(Process, Address, FALSE); - if (Pt == NULL) - { - ASSERT(FALSE); - } - - do - { - Pte = *Pt; - tmpPte = Pte & ~PA_ACCESSED; - } while (Pte != ExfInterlockedCompareExchange64UL(Pt, &tmpPte, &Pte)); - - if (Pte & PA_ACCESSED) - { - MiFlushTlb((PULONG)Pt, Address); - return TRUE; - } - else - { - MmUnmapPageTable((PULONG)Pt); - return FALSE; - } - } - else - { - PULONG Pt; - ULONG Pte; - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - if (Pt == NULL) - { - ASSERT(FALSE); - } - - do - { - Pte = *Pt; - } while (Pte != InterlockedCompareExchangeUL(Pt, Pte & ~PA_ACCESSED, Pte)); - - if (Pte & PA_ACCESSED) - { - MiFlushTlb(Pt, Address); - return TRUE; - } - else - { - MmUnmapPageTable(Pt); - return FALSE; - } - } -} - VOID NTAPI MmSetCleanPage(PEPROCESS Process, PVOID Address) @@ -1298,62 +1043,6 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) } } -VOID -NTAPI -MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) -{ - if (Ke386Pae) - { - PULONGLONG Pt; - ULONGLONG Pte; - ULONGLONG tmpPte; - - Pt = MmGetPageTableForProcessForPAE(Process, Address, FALSE); - if (Pt == NULL) - { - ASSERT(FALSE); - } - - do - { - Pte = *Pt; - tmpPte = Pte | PA_PRESENT; - } while (Pte != ExfInterlockedCompareExchange64UL(Pt, &tmpPte, &Pte)); - if (!(Pte & PA_PRESENT)) - { - MiFlushTlb((PULONG)Pt, Address); - } - else - { - MmUnmapPageTable((PULONG)Pt); - } - } - else - { - PULONG Pt; - ULONG Pte; - - Pt = MmGetPageTableForProcess(Process, Address, FALSE); - if (Pt == NULL) - { - ASSERT(FALSE); - } - - do - { - Pte = *Pt; - } while (Pte != InterlockedCompareExchangeUL(Pt, Pte | PA_PRESENT, Pte)); - if (!(Pte & PA_PRESENT)) - { - MiFlushTlb(Pt, Address); - } - else - { - MmUnmapPageTable(Pt); - } - } -} - BOOLEAN NTAPI MmIsPagePresent(PEPROCESS Process, PVOID Address) @@ -1386,134 +1075,6 @@ MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) } } -NTSTATUS -NTAPI -MmCreateVirtualMappingForKernel(PVOID Address, - ULONG flProtect, - PPFN_NUMBER Pages, - ULONG PageCount) -{ - ULONG Attributes; - ULONG i; - PVOID Addr; - ULONG PdeOffset, oldPdeOffset; - BOOLEAN NoExecute = FALSE; - - DPRINT("MmCreateVirtualMappingForKernel(%x, %x, %x, %d)\n", - Address, flProtect, Pages, PageCount); - - if (Address < MmSystemRangeStart) - { - DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); - ASSERT(FALSE); - } - - Attributes = ProtectToPTE(flProtect); - if (Attributes & 0x80000000) - { - NoExecute = TRUE; - } - Attributes &= 0xfff; - if (Ke386GlobalPagesEnabled) - { - Attributes |= PA_GLOBAL; - } - - Addr = Address; - - if (Ke386Pae) - { - PULONGLONG Pt = NULL; - ULONGLONG Pte; - - oldPdeOffset = PAE_ADDR_TO_PDE_OFFSET(Addr) + 1; - for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) - { - if (!(Attributes & PA_PRESENT) && Pages[i] != 0) - { - DPRINT1("Setting physical address but not allowing access at address " - "0x%.8X with attributes %x/%x.\n", - Addr, Attributes, flProtect); - ASSERT(FALSE); - } - - PdeOffset = PAE_ADDR_TO_PDE_OFFSET(Addr); - if (oldPdeOffset != PdeOffset) - { - Pt = MmGetPageTableForProcessForPAE(NULL, Addr, TRUE); - if (Pt == NULL) - { - ASSERT(FALSE); - } - } - else - { - Pt++; - } - oldPdeOffset = PdeOffset; - - Pte = PFN_TO_PTE(Pages[i]) | Attributes; - if (NoExecute) - { - Pte |= 0x8000000000000000LL; - } - Pte = ExfpInterlockedExchange64UL(Pt, &Pte); - if (Pte != 0LL) - { - ASSERT(FALSE); - } - } - } - else - { - PULONG Pt; - ULONG Pte; - - oldPdeOffset = ADDR_TO_PDE_OFFSET(Addr); - Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); - if (Pt == NULL) - { - ASSERT(FALSE); - } - Pt--; - - for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) - { - if (!(Attributes & PA_PRESENT) && Pages[i] != 0) - { - DPRINT1("Setting physical address but not allowing access at address " - "0x%.8X with attributes %x/%x.\n", - Addr, Attributes, flProtect); - ASSERT(FALSE); - } - - PdeOffset = ADDR_TO_PDE_OFFSET(Addr); - if (oldPdeOffset != PdeOffset) - { - Pt = MmGetPageTableForProcess(NULL, Addr, TRUE); - if (Pt == NULL) - { - ASSERT(FALSE); - } - } - else - { - Pt++; - } - oldPdeOffset = PdeOffset; - - Pte = *Pt; - if (Pte != 0) - { - ASSERT(FALSE); - } - (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); - } - } - - return(STATUS_SUCCESS); -} - NTSTATUS NTAPI MmCreatePageFileMapping(PEPROCESS Process, @@ -1949,49 +1510,6 @@ MmSetPageProtect(PEPROCESS Process, PVOID Address, ULONG flProtect) } } -/* - * @implemented - */ -PHYSICAL_ADDRESS NTAPI -MmGetPhysicalAddress(PVOID vaddr) -/* - * FUNCTION: Returns the physical address corresponding to a virtual address - */ -{ - PHYSICAL_ADDRESS p; - - DPRINT("MmGetPhysicalAddress(vaddr %x)\n", vaddr); - if (Ke386Pae) - { - ULONGLONG Pte; - Pte = MmGetPageEntryForProcessForPAE(NULL, vaddr); - if (Pte != 0 && Pte & PA_PRESENT) - { - p.QuadPart = PAE_PAGE_MASK(Pte); - p.u.LowPart |= (ULONG_PTR)vaddr & (PAGE_SIZE - 1); - } - else - { - p.QuadPart = 0; - } - } - else - { - ULONG Pte; - Pte = MmGetPageEntryForProcess(NULL, vaddr); - if (Pte != 0 && Pte & PA_PRESENT) - { - p.QuadPart = PAGE_MASK(Pte); - p.u.LowPart |= (ULONG_PTR)vaddr & (PAGE_SIZE - 1); - } - else - { - p.QuadPart = 0; - } - } - return p; -} - PVOID NTAPI MmCreateHyperspaceMapping(PFN_NUMBER Page) @@ -2121,28 +1639,6 @@ MmCreateHyperspaceMapping(PFN_NUMBER Page) return Address; } -PFN_NUMBER -NTAPI -MmChangeHyperspaceMapping(PVOID Address, PFN_NUMBER NewPage) -{ - PFN_NUMBER Pfn; - ASSERT (IS_HYPERSPACE(Address)); - if (Ke386Pae) - { - ULONGLONG Entry = PAE_PFN_TO_PTE(NewPage) | PA_PRESENT | PA_READWRITE; - Entry = (ULONG)ExfpInterlockedExchange64UL(PAE_ADDR_TO_PTE(Address), &Entry); - Pfn = PAE_PTE_TO_PFN(Entry); - } - else - { - ULONG Entry; - Entry = InterlockedExchange((PLONG)ADDR_TO_PTE(Address), PFN_TO_PTE(NewPage) | PA_PRESENT | PA_READWRITE); - Pfn = PTE_TO_PFN(Entry); - } - __invlpg(Address); - return Pfn; -} - PFN_NUMBER NTAPI MmDeleteHyperspaceMapping(PVOID Address) @@ -2165,91 +1661,6 @@ MmDeleteHyperspaceMapping(PVOID Address) return Pfn; } -VOID -NTAPI -MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) -{ - ULONG StartOffset, EndOffset, Offset; - - if (Address < MmSystemRangeStart) - { - ASSERT(FALSE); - } - if (Ke386Pae) - { - PULONGLONG PageDirTable; - PULONGLONG Pde; - ULONGLONG ZeroPde = 0LL; - ULONG i; - - for (i = PAE_ADDR_TO_PDTE_OFFSET(Address); i <= PAE_ADDR_TO_PDTE_OFFSET((PVOID)((ULONG_PTR)Address + Size)); i++) - { - if (i == PAE_ADDR_TO_PDTE_OFFSET(Address)) - { - StartOffset = PAE_ADDR_TO_PDE_PAGE_OFFSET(Address); - } - else - { - StartOffset = 0; - } - if (i == PAE_ADDR_TO_PDTE_OFFSET((PVOID)((ULONG_PTR)Address + Size))) - { - EndOffset = PAE_ADDR_TO_PDE_PAGE_OFFSET((PVOID)((ULONG_PTR)Address + Size)); - } - else - { - EndOffset = 511; - } - - if (Process != NULL && Process != PsGetCurrentProcess()) - { - PageDirTable = MmCreateHyperspaceMapping(PAE_PTE_TO_PFN(Process->Pcb.DirectoryTableBase.QuadPart)); - Pde = (PULONGLONG)MmCreateHyperspaceMapping(PTE_TO_PFN(PageDirTable[i])); - MmDeleteHyperspaceMapping(PageDirTable); - } - else - { - Pde = (PULONGLONG)PAE_PAGEDIRECTORY_MAP + i*512; - } - - for (Offset = StartOffset; Offset <= EndOffset; Offset++) - { - if (i * 512 + Offset < PAE_ADDR_TO_PDE_OFFSET(PAGETABLE_MAP) || i * 512 + Offset >= PAE_ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)+4) - { - (void)ExfInterlockedCompareExchange64UL(&Pde[Offset], &MmGlobalKernelPageDirectoryForPAE[i*512 + Offset], &ZeroPde); - } - } - MmUnmapPageTable((PULONG)Pde); - } - } - else - { - PULONG Pde; - StartOffset = ADDR_TO_PDE_OFFSET(Address); - EndOffset = ADDR_TO_PDE_OFFSET((PVOID)((ULONG_PTR)Address + Size)); - - if (Process != NULL && Process != PsGetCurrentProcess()) - { - Pde = MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase.u.LowPart)); - } - else - { - Pde = (PULONG)PAGEDIRECTORY_MAP; - } - for (Offset = StartOffset; Offset <= EndOffset; Offset++) - { - if (Offset != ADDR_TO_PDE_OFFSET(PAGETABLE_MAP)) - { - (void)InterlockedCompareExchangeUL(&Pde[Offset], MmGlobalKernelPageDirectory[Offset], 0); - } - } - if (Pde != (PULONG)PAGEDIRECTORY_MAP) - { - MmDeleteHyperspaceMapping(Pde); - } - } -} - VOID INIT_FUNCTION NTAPI @@ -2297,53 +1708,4 @@ MmInitGlobalKernelPageDirectory(VOID) } } -ULONG -NTAPI -MiGetUserPageDirectoryCount(VOID) -{ - return Ke386Pae ? PAE_ADDR_TO_PDE_OFFSET(MmSystemRangeStart) : ADDR_TO_PDE_OFFSET(MmSystemRangeStart); -} - -VOID -INIT_FUNCTION -NTAPI -MiInitPageDirectoryMap(VOID) -{ - MEMORY_AREA* kernel_map_desc = NULL; - MEMORY_AREA* hyperspace_desc = NULL; - PVOID BaseAddress; - NTSTATUS Status; - - DPRINT("MiInitPageDirectoryMap()\n"); - - BaseAddress = (PVOID)PAGETABLE_MAP; - Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - MEMORY_AREA_SYSTEM, - &BaseAddress, - Ke386Pae ? 0x800000 : 0x400000, - PAGE_READWRITE, - &kernel_map_desc, - TRUE, - 0, - PAGE_SIZE); - if (!NT_SUCCESS(Status)) - { - ASSERT(FALSE); - } - BaseAddress = (PVOID)HYPERSPACE; - Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - MEMORY_AREA_SYSTEM, - &BaseAddress, - 0x400000, - PAGE_READWRITE, - &hyperspace_desc, - TRUE, - 0, - PAGE_SIZE); - if (!NT_SUCCESS(Status)) - { - ASSERT(FALSE); - } -} - /* EOF */ diff --git a/reactos/ntoskrnl/mm/marea.c b/reactos/ntoskrnl/mm/marea.c index 759be7aef28..5deec1abb9b 100644 --- a/reactos/ntoskrnl/mm/marea.c +++ b/reactos/ntoskrnl/mm/marea.c @@ -1205,7 +1205,7 @@ MmDeleteProcessAddressSpace(PEPROCESS Process) MmUnlockAddressSpace(&Process->Vm); - DPRINT("Finished MmReleaseMmInfo()\n"); + DPRINT("Finished MmDeleteProcessAddressSpace()\n"); MmDeleteProcessAddressSpace2(Process); return(STATUS_SUCCESS); } diff --git a/reactos/ntoskrnl/mm/pagefile.c b/reactos/ntoskrnl/mm/pagefile.c index 06563d97e32..f534a66e1df 100644 --- a/reactos/ntoskrnl/mm/pagefile.c +++ b/reactos/ntoskrnl/mm/pagefile.c @@ -351,37 +351,6 @@ MmInitPagingFile(VOID) MiPagingFileCount = 0; } -BOOLEAN -NTAPI -MmReserveSwapPages(ULONG Nr) -{ - KIRQL oldIrql; - ULONG MiAvailSwapPages; - - KeAcquireSpinLock(&PagingFileListLock, &oldIrql); - MiAvailSwapPages = - (MiFreeSwapPages * MM_PAGEFILE_COMMIT_RATIO) + MM_PAGEFILE_COMMIT_GRACE; - MiReservedSwapPages = MiReservedSwapPages + Nr; - if ((MM_PAGEFILE_COMMIT_RATIO != 0) && (MiAvailSwapPages < MiReservedSwapPages)) - { - KeReleaseSpinLock(&PagingFileListLock, oldIrql); - return(FALSE); - } - KeReleaseSpinLock(&PagingFileListLock, oldIrql); - return(TRUE); -} - -VOID -NTAPI -MmDereserveSwapPages(ULONG Nr) -{ - KIRQL oldIrql; - - KeAcquireSpinLock(&PagingFileListLock, &oldIrql); - MiReservedSwapPages = MiReservedSwapPages - Nr; - KeReleaseSpinLock(&PagingFileListLock, oldIrql); -} - static ULONG MiAllocPageFromPagingFile(PPAGINGFILE PagingFile) { @@ -439,13 +408,6 @@ MmFreeSwapPage(SWAPENTRY Entry) KeReleaseSpinLock(&PagingFileListLock, oldIrql); } -BOOLEAN -NTAPI -MmIsAvailableSwapPage(VOID) -{ - return(MiFreeSwapPages > 0); -} - SWAPENTRY NTAPI MmAllocSwapPage(VOID) diff --git a/reactos/ntoskrnl/mm/powerpc/page.c b/reactos/ntoskrnl/mm/powerpc/page.c index 33f051dc1f5..c0acc4825b2 100644 --- a/reactos/ntoskrnl/mm/powerpc/page.c +++ b/reactos/ntoskrnl/mm/powerpc/page.c @@ -17,7 +17,6 @@ #if defined (ALLOC_PRAGMA) #pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) -#pragma alloc_text(INIT, MiInitPageDirectoryMap) #endif /* GLOBALS *****************************************************************/ @@ -103,22 +102,6 @@ MmCopyMmInfo(PEPROCESS Src, return(STATUS_SUCCESS); } -NTSTATUS -NTAPI -MmInitializeHandBuiltProcess(IN PEPROCESS Process, - IN PLARGE_INTEGER DirectoryTableBase) -{ - /* Share the directory base with the idle process */ - *DirectoryTableBase = PsGetCurrentProcess()->Pcb.DirectoryTableBase; - - /* Initialize the Addresss Space */ - MmInitializeAddressSpace(Process, (PMADDRESS_SPACE)&Process->VadRoot); - - /* The process now has an address space */ - Process->HasAddressSpace = TRUE; - return STATUS_SUCCESS; -} - BOOLEAN NTAPI MmCreateProcessAddressSpace(IN ULONG MinWs, @@ -177,20 +160,6 @@ MmGetPhysicalAddressProcess(PEPROCESS Process, PVOID Addr) return (PVOID)info.phys; } -/* - * @implemented - */ -PHYSICAL_ADDRESS NTAPI -MmGetPhysicalAddress(PVOID vaddr) -/* - * FUNCTION: Returns the physical address corresponding to a virtual address - */ -{ - PHYSICAL_ADDRESS Addr; - Addr.QuadPart = (ULONG)MmGetPhysicalAddressProcess(PsGetCurrentProcess()->UniqueProcessId, vaddr); - return Addr; -} - PFN_NUMBER NTAPI MmGetPfnForProcess(PEPROCESS Process, @@ -274,24 +243,6 @@ MmIsDirtyPage(PEPROCESS Process, PVOID Address) return !!(info.flags & MMU_PAGE_DIRTY); } -BOOLEAN -NTAPI -MmIsAccessedAndResetAccessPage(PEPROCESS Process, PVOID Address) -{ - ppc_map_info_t info = { 0 }; - - if (Address < MmSystemRangeStart && Process == NULL) - { - DPRINT1("MmIsAccessedAndResetAccessPage is called for user space without a process.\n"); - ASSERT(FALSE); - } - - info.proc = Process ? (int)Process->UniqueProcessId : 0; - info.addr = (vaddr_t)Address; - MmuInqPage(&info, 1); - return !!(info.flags /*& MMU_PAGE_ACCESS*/); -} - VOID NTAPI MmSetCleanPage(PEPROCESS Process, PVOID Address) @@ -304,12 +255,6 @@ MmSetDirtyPage(PEPROCESS Process, PVOID Address) { } -VOID -NTAPI -MmEnableVirtualMapping(PEPROCESS Process, PVOID Address) -{ -} - BOOLEAN NTAPI MmIsPagePresent(PEPROCESS Process, PVOID Address) @@ -335,44 +280,6 @@ MmIsPageSwapEntry(PEPROCESS Process, PVOID Address) return !(Entry & PA_PRESENT) && Entry != 0 ? TRUE : FALSE; } -NTSTATUS -NTAPI -MmCreateVirtualMappingForKernel(PVOID Address, - ULONG flProtect, - PPFN_NUMBER Pages, - ULONG PageCount) -{ - ULONG i; - PVOID Addr; - - DPRINT("MmCreateVirtualMappingForKernel(%x, %x, %x, %d)\n", - Address, flProtect, Pages, PageCount); - - if (Address < MmSystemRangeStart) - { - DPRINT1("MmCreateVirtualMappingForKernel is called for user space\n"); - ASSERT(FALSE); - } - - Addr = Address; - - for (i = 0; i < PageCount; i++, Addr = (PVOID)((ULONG_PTR)Addr + PAGE_SIZE)) - { -#if 0 - if (!(Attributes & PA_PRESENT) && Pages[i] != 0) - { - DPRINT1("Setting physical address but not allowing access at address " - "0x%.8X with attributes %x/%x.\n", - Addr, Attributes, flProtect); - ASSERT(FALSE); - } - (void)InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); -#endif - } - - return(STATUS_SUCCESS); -} - NTSTATUS NTAPI MmCreatePageFileMapping(PEPROCESS Process, @@ -568,23 +475,6 @@ MmCreateHyperspaceMapping(PFN_NUMBER Page) return Address; } -PFN_NUMBER -NTAPI -MmChangeHyperspaceMapping(PVOID Address, PFN_NUMBER NewPage) -{ - PFN_NUMBER OldPage; - ppc_map_info_t info = { 0 }; - - info.proc = 0; - info.addr = (vaddr_t)Address; - MmuUnmapPage(&info, 1); - OldPage = info.phys; - info.phys = (paddr_t)NewPage; - MmuMapPage(&info, 1); - - return NewPage; -} - PFN_NUMBER NTAPI MmDeleteHyperspaceMapping(PVOID Address) @@ -607,26 +497,6 @@ MmInitGlobalKernelPageDirectory(VOID) { } -VOID -INIT_FUNCTION -NTAPI -MiInitPageDirectoryMap(VOID) -{ -} - -ULONG -NTAPI -MiGetUserPageDirectoryCount(VOID) -{ - return 0; -} - -VOID -NTAPI -MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size) -{ -} - /* Create a simple, primitive mapping at the specified address on a new page */ NTSTATUS MmPPCCreatePrimitiveMapping(ULONG_PTR PageAddr) { From a0173baa191ce5cf22e43ad7f348e3bdc239cce8 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 11 Mar 2014 22:56:31 +0000 Subject: [PATCH 096/419] [NTOSKRNL] Fix a bug in MmGetPhysicalAddress, that resulted in unwanted sign extension of physical addresses > 2GB. Will hopefully fix some uniata related issues. svn path=/trunk/; revision=62482 --- reactos/ntoskrnl/mm/ARM3/virtual.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/ntoskrnl/mm/ARM3/virtual.c b/reactos/ntoskrnl/mm/ARM3/virtual.c index 4630f52209d..0dc0196da34 100644 --- a/reactos/ntoskrnl/mm/ARM3/virtual.c +++ b/reactos/ntoskrnl/mm/ARM3/virtual.c @@ -5283,7 +5283,7 @@ MmGetPhysicalAddress(PVOID Address) if (TempPde.u.Hard.LargePage) { /* Physical address is base page + large page offset */ - PhysicalAddress.QuadPart = TempPde.u.Hard.PageFrameNumber << PAGE_SHIFT; + PhysicalAddress.QuadPart = (ULONG64)TempPde.u.Hard.PageFrameNumber << PAGE_SHIFT; PhysicalAddress.QuadPart += ((ULONG_PTR)Address & (PAGE_SIZE * PTE_PER_PAGE - 1)); return PhysicalAddress; } @@ -5293,7 +5293,7 @@ MmGetPhysicalAddress(PVOID Address) if (TempPte.u.Hard.Valid) { /* Physical address is base page + page offset */ - PhysicalAddress.QuadPart = TempPte.u.Hard.PageFrameNumber << PAGE_SHIFT; + PhysicalAddress.QuadPart = (ULONG64)TempPte.u.Hard.PageFrameNumber << PAGE_SHIFT; PhysicalAddress.QuadPart += ((ULONG_PTR)Address & (PAGE_SIZE - 1)); return PhysicalAddress; } From 3d31a14caae105051a26522636bfadceb60b7589 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Wed, 12 Mar 2014 19:54:08 +0000 Subject: [PATCH 097/419] [NTOSKRNL] Properly compute file name length for output buffer CORE-2582 svn path=/trunk/; revision=62484 --- reactos/ntoskrnl/fsrtl/notify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/fsrtl/notify.c b/reactos/ntoskrnl/fsrtl/notify.c index 1018edfdaef..9c2a420abae 100644 --- a/reactos/ntoskrnl/fsrtl/notify.c +++ b/reactos/ntoskrnl/fsrtl/notify.c @@ -494,7 +494,7 @@ FsRtlNotifyUpdateBuffer(OUT PFILE_NOTIFY_INFORMATION OutputBuffer, { OutputBuffer->NextEntryOffset = 0; OutputBuffer->Action = Action; - OutputBuffer->FileNameLength = DataLength - sizeof(FILE_NOTIFY_INFORMATION); + OutputBuffer->FileNameLength = DataLength - FIELD_OFFSET(FILE_NOTIFY_INFORMATION, FileName); if (IsUnicode) { if (ParentName->Length) From 6d582f3f95050c65444d6a19d473108740244778 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Wed, 12 Mar 2014 19:58:11 +0000 Subject: [PATCH 098/419] [FASTFAT] Also cleanup ongoing notifications during cleanup. This fixes kernel32:change winetests crash. This gets us from 300 tests executed, 134 failed to 312 executed, 33 failed. CORE-2582 svn path=/trunk/; revision=62485 --- reactos/drivers/filesystems/fastfat/cleanup.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reactos/drivers/filesystems/fastfat/cleanup.c b/reactos/drivers/filesystems/fastfat/cleanup.c index 4887f9dfe4f..97c2515116e 100644 --- a/reactos/drivers/filesystems/fastfat/cleanup.c +++ b/reactos/drivers/filesystems/fastfat/cleanup.c @@ -57,6 +57,11 @@ VfatCleanupFile( return STATUS_PENDING; } + /* Notify about the cleanup */ + FsRtlNotifyCleanup(IrpContext->DeviceExt->NotifySync, + &(IrpContext->DeviceExt->NotifyList), + FileObject->FsContext2); + pFcb->OpenHandleCount--; if (!(*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) && From fa0e017d2ac0a9b182709093f5d7649023581d6f Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 13 Mar 2014 01:36:31 +0000 Subject: [PATCH 099/419] [User32] - Patch by Henri Verbeet : Fix TEXT_WordBreak() when no characters fit. - Sync port from wine. svn path=/trunk/; revision=62486 --- reactos/win32ss/user/user32/windows/font.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/font.c b/reactos/win32ss/user/user32/windows/font.c index 96b50d85b0c..7b5e1431f0d 100644 --- a/reactos/win32ss/user/user32/windows/font.c +++ b/reactos/win32ss/user/user32/windows/font.c @@ -605,7 +605,7 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str, p = str + chars_fit; /* The character that doesn't fit */ word_fits = TRUE; if (!chars_fit) - ; /* we pretend that it fits anyway */ + word_fits = FALSE; else if (*p == SPACE) /* chars_fit < *len_str so this is valid */ p--; /* the word just fitted */ else @@ -615,7 +615,7 @@ static void TEXT_WordBreak (HDC hdc, WCHAR *str, unsigned int max_str, ; word_fits = (p != str || *p == SPACE || IsCJKT(p[1])); } - /* If there was one or the first character didn't fit then */ + /* If there was one. */ if (word_fits) { int next_is_space; From 4498725892b1f7d99bc6fe3a74fc74db369c210a Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 13 Mar 2014 01:39:31 +0000 Subject: [PATCH 100/419] [User32Test] - Patch by Henri Verbeet : Fix TEXT_WordBreak() when no characters fit. - Update text to wine head. svn path=/trunk/; revision=62487 --- rostests/winetests/user32/text.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/rostests/winetests/user32/text.c b/rostests/winetests/user32/text.c index 217baab89b1..19bcd72abbe 100755 --- a/rostests/winetests/user32/text.c +++ b/rostests/winetests/user32/text.c @@ -42,6 +42,8 @@ static void test_DrawTextCalcRect(void) 's','t','r','i','n','g','\0'}; static CHAR emptystring[] = ""; static WCHAR emptystringW[] = { 0 }; + static CHAR wordbreak_text[] = "line1 line2"; + static WCHAR wordbreak_textW[] = {'l','i','n','e','1',' ','l','i','n','e','2',0}; INT textlen, textheight, heightcheck; RECT rect = { 0, 0, 100, 0 }; BOOL ret; @@ -556,6 +558,20 @@ static void test_DrawTextCalcRect(void) ok(rect.bottom, "rect.bottom should not be 0\n"); } + SetRect(&rect, 0, 0, 1, 1); + heightcheck = DrawTextA(hdc, wordbreak_text, -1, &rect, DT_CALCRECT); + SetRect(&rect, 0, 0, 1, 1); + textheight = DrawTextA(hdc, wordbreak_text, -1, &rect, DT_CALCRECT | DT_WORDBREAK); + ok(textheight == heightcheck * 2, "Got unexpected textheight %d, expected %d.\n", + textheight, heightcheck * 2); + + SetRect(&rect, 0, 0, 1, 1); + heightcheck = DrawTextW(hdc, wordbreak_textW, -1, &rect, DT_CALCRECT); + SetRect(&rect, 0, 0, 1, 1); + textheight = DrawTextW(hdc, wordbreak_textW, -1, &rect, DT_CALCRECT | DT_WORDBREAK); + ok(textheight == heightcheck * 2, "Got unexpected textheight %d, expected %d.\n", + textheight, heightcheck * 2); + SelectObject(hdc, hOldFont); ret = DeleteObject(hFont); ok( ret, "DeleteObject error %u\n", GetLastError()); From 33acc4a2210a421471766dda0ac10a9453e29f1e Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Thu, 13 Mar 2014 15:04:47 +0000 Subject: [PATCH 101/419] [browseui] add partial german translation svn path=/trunk/; revision=62490 --- reactos/dll/win32/browseui/browseui.rc | 4 +- reactos/dll/win32/browseui/lang/de_DE.rc | 256 +++++++++++++++++++++++ 2 files changed, 259 insertions(+), 1 deletion(-) create mode 100644 reactos/dll/win32/browseui/lang/de_DE.rc diff --git a/reactos/dll/win32/browseui/browseui.rc b/reactos/dll/win32/browseui/browseui.rc index 63a07c00f2d..8e8b15aad20 100644 --- a/reactos/dll/win32/browseui/browseui.rc +++ b/reactos/dll/win32/browseui/browseui.rc @@ -49,7 +49,6 @@ IDR_REGTREEOPTIONS REGISTRY "res/regtreeoptions.rgs" //#include "lang/ca-ES.rc" //#include "lang/cs-CZ.rc" //#include "lang/da-DK.rc" -//#include "lang/de-DE.rc" //#include "lang/el-GR.rc" //#include "lang/en-GB.rc" //#include "lang/fi-FI.rc" @@ -74,6 +73,9 @@ IDR_REGTREEOPTIONS REGISTRY "res/regtreeoptions.rgs" #ifdef LANGUAGE_BG_BG #include "lang/bg-BG.rc" #endif +#ifdef LANGUAGE_DE_DE + #include "lang/de-DE.rc" +#endif #ifdef LANGUAGE_EN_US #include "lang/en-US.rc" #endif diff --git a/reactos/dll/win32/browseui/lang/de_DE.rc b/reactos/dll/win32/browseui/lang/de_DE.rc new file mode 100644 index 00000000000..d5bb0fdcfc4 --- /dev/null +++ b/reactos/dll/win32/browseui/lang/de_DE.rc @@ -0,0 +1,256 @@ +/* + * Copyright 2009 Andrew Hill + * + * 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 + */ + +LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL + +/* Menus */ + +IDM_CABINET_CONTEXTMENU MENUEX +BEGIN + POPUP "", 264,MFT_STRING,MFS_ENABLED + BEGIN + MENUITEM "&Standardschaltflächen", IDM_TOOLBARS_STANDARDBUTTONS, MFT_STRING, MFS_ENABLED + MENUITEM "&Adressleiste", IDM_TOOLBARS_ADDRESSBAR, MFT_STRING, MFS_ENABLED + MENUITEM "&Links", IDM_TOOLBARS_LINKSBAR, MFT_STRING, MFS_ENABLED + MENUITEM "", -1, MFT_SEPARATOR + MENUITEM "S&ymbolleisten fixieren", IDM_TOOLBARS_LOCKTOOLBARS, MFT_STRING, MFS_ENABLED + MENUITEM "&Anpassen...", IDM_TOOLBARS_CUSTOMIZE, MFT_STRING, MFS_ENABLED + MENUITEM "&Text Labels", IDM_TOOLBARS_TEXTLABELS, MFT_STRING, MFS_ENABLED + MENUITEM "&Go Button", IDM_TOOLBARS_GOBUTTON, MFT_STRING, MFS_ENABLED + END +END + +IDM_CABINET_MAINMENU MENUEX +BEGIN + POPUP "&Datei", FCIDM_MENU_FILE + BEGIN + MENUITEM "", -1, MFT_SEPARATOR + MENUITEM "&Schließen", IDM_FILE_CLOSE + END + POPUP "&Bearbeiten", FCIDM_MENU_EDIT + BEGIN + MENUITEM "", -1, MFT_SEPARATOR + END + POPUP "&Ansicht", FCIDM_MENU_VIEW + BEGIN + POPUP "&Symbolleisten", IDM_VIEW_TOOLBARS + BEGIN + MENUITEM "", -1, MFT_SEPARATOR + END + MENUITEM "S&tatusleiste", IDM_VIEW_STATUSBAR + POPUP "&Explorerleiste", IDM_VIEW_EXPLORERBAR + BEGIN + MENUITEM "Su&chen\tCtrl+E", IDM_EXPLORERBAR_SEARCH + MENUITEM "&Favoriten\tCtrl+I", IDM_EXPLORERBAR_FAVORITES + MENUITEM "&Media", IDM_EXPLORERBAR_MEDIA + MENUITEM "&Verlauf\tCtrl+H", IDM_EXPLORERBAR_HISTORY + MENUITEM "F&olders", IDM_EXPLORERBAR_FOLDERS + MENUITEM "", IDM_EXPLORERBAR_SEPARATOR + END + MENUITEM "", FCIDM_MENU_VIEW_SEP_OPTIONS, MFT_SEPARATOR + POPUP "&Wechseln zu", FCIDM_MENU_EXPLORE + BEGIN + MENUITEM "&Zurück\tAlt+Left Arrow", IDM_GOTO_BACK + MENUITEM "&Vorwärts\tAlt+Right Arrow", IDM_GOTO_FORWARD + MENUITEM "Ü&bergeordneter Ordner", IDM_GOTO_UPONELEVEL + MENUITEM "", -1, MFT_SEPARATOR + MENUITEM "&Startseite\tAlt+Home", IDM_GOTO_HOMEPAGE + END + MENUITEM "&Aktualisieren", IDM_VIEW_REFRESH + END + POPUP "F&avoriten", FCIDM_MENU_FAVORITES + BEGIN + MENUITEM "&Zu Favoriten hinzufügen...", IDM_FAVORITES_ADDTOFAVORITES + MENUITEM "Fav&oriten verwalten...", IDM_FAVORITES_ORGANIZEFAVORITES + MENUITEM "", -1, MFT_SEPARATOR + MENUITEM "(Leer)", IDM_FAVORITES_EMPTY + END + POPUP "E&xtras", FCIDM_MENU_TOOLS + BEGIN + MENUITEM "&Netzlaufwerk verbinden...", IDM_TOOLS_MAPNETWORKDRIVE + MENUITEM "Netzlaufwerk &trennen...", IDM_TOOLS_DISCONNECTNETWORKDRIVE + MENUITEM "&Synchronisieren...", IDM_TOOLS_SYNCHRONIZE + MENUITEM "", -1, MFT_SEPARATOR + MENUITEM "&Ordneroptionen...", IDM_TOOLS_FOLDEROPTIONS + END + POPUP "&?", FCIDM_MENU_HELP + BEGIN + MENUITEM "Ist diese Kopie von ReactOS &legal?", IDM_HELP_ISTHISCOPYLEGAL + MENUITEM "Ü&ber ReactOS", IDM_HELP_ABOUT + END +END + +/* Dialogs */ + +IDD_CUSTOMIZETOOLBAREX DIALOGEX 0, 0, 357, 33 +STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VISIBLE | WS_CAPTION +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + LTEXT "Te&xt Optionen:", -1, 4, 2, 48, 15 + COMBOBOX IDC_TEXTOPTIONS, 52, 0, 123, 57, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "Ico&n Optionen:", -1, 4, 20, 48, 15 + COMBOBOX IDC_ICONOPTIONS, 52, 18, 123, 57, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP +END + +/* Accelerators */ + +IDR_ACCELERATORS ACCELERATORS +BEGIN + VK_F5, IDM_VIEW_REFRESH, VIRTKEY, NOINVERT + VK_F5, IDM_VIEW_REFRESH, VIRTKEY, CONTROL, NOINVERT + "R", IDM_VIEW_REFRESH, VIRTKEY, CONTROL, NOINVERT + VK_HOME, IDM_GOTO_HOMEPAGE, VIRTKEY, ALT, NOINVERT + "D", IDM_FAVORITES_ADDTOFAVORITES, VIRTKEY, CONTROL, NOINVERT + "B", IDM_FAVORITES_ORGANIZEFAVORITES, VIRTKEY, CONTROL, NOINVERT + VK_LEFT, IDM_GOTO_BACK, VIRTKEY, ALT + VK_RIGHT, IDM_GOTO_FORWARD, VIRTKEY, ALT + "W", IDM_FILE_CLOSE, VIRTKEY, CONTROL, NOINVERT + "E", IDM_EXPLORERBAR_SEARCH, VIRTKEY, CONTROL, NOINVERT + "I", IDM_EXPLORERBAR_FAVORITES, VIRTKEY, CONTROL, NOINVERT + "H", IDM_EXPLORERBAR_HISTORY, VIRTKEY, CONTROL, NOINVERT +END + +/* Strings */ + +STRINGTABLE +BEGIN + 800 "Contains commands for manipulating the selected items." +END + +STRINGTABLE +BEGIN + 864 "Contains edit commands." +END + +STRINGTABLE +BEGIN + 928 "Contains commands for manipulating the view." +END + +STRINGTABLE +BEGIN + 992 "Contains tools commands." +END + +STRINGTABLE +BEGIN + 1056 "Contains commands for displaying Help." +END + +STRINGTABLE +BEGIN + 9025 "Closes the window." + 9026 "Goes up one level." +END + +STRINGTABLE +BEGIN + 9121 "Connects to a network drive." + 9122 "Disconnects from a network drive." +END + +STRINGTABLE +BEGIN + 9250 "Displays program information, version number, and copyright." + 9252 "Displays information for debugging." +END + +STRINGTABLE +BEGIN + 9281 "Goes to the previous page." + 9282 "Goes to the next page." + 9283 "Enables you to change settings." + 9285 "Goes to your home page." +END + +STRINGTABLE +BEGIN + 9362 "Opens the Favorites folder." + 9363 "Adds the current page to your Favorites list." +END + +STRINGTABLE +BEGIN + 9505 "Shows or hides toolbars." + 9506 "Shows or hides the status bar." + 9508 "Displays the Standard Buttons toolbar." + 9509 "Displays the Address bar." + 9510 "Displays the Quick Links bar." + 9516 "Locks the sizes and positions of the toolbars." +END + +STRINGTABLE +BEGIN + 9533 "Customizes the toolbar." +END + +STRINGTABLE +BEGIN + 9552 "Shows or hides an Explorer bar." + 9553 "Shows the Search bar." + 9554 "Shows the Favorites bar." + 9555 "Shows the History bar." + 9557 "Shows the Folders bar." + 9559 "Shows the Media Bar." +END + +STRINGTABLE +BEGIN + IDS_SMALLICONS "Kleine Symbole" + IDS_LARGEICONS "Große Symbole" + IDS_SHOWTEXTLABELS "Show text labels" +END + +STRINGTABLE +BEGIN + IDS_NOTEXTLABELS "No text labels" + IDS_SELECTIVETEXTONRIGHT "Selective text on right" +END + +STRINGTABLE +BEGIN + IDS_GOBUTTONLABEL "|Wechseln zu||" + IDS_GOBUTTONTIPTEMPLATE "Wechseln zu ""%s""" +END + +STRINGTABLE +BEGIN + IDS_SEARCHLABEL "Suchen" + IDS_ADDRESSBANDLABEL "A&dresse" +END + +STRINGTABLE +BEGIN + IDS_FOLDERSLABEL "Ordner" +END + +STRINGTABLE +BEGIN + IDS_HISTORYTEXT "&Verlauf\tCtrl+H" +END + +STRINGTABLE +BEGIN + IDS_UP "Aufwärts" +END + +STRINGTABLE +BEGIN + IDS_BACK "Zurück" + IDS_FORWARD "Vorwärts" +END From 3d21f7f3d09f540ad5ad8e4ad1c2a3895eb92da5 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Thu, 13 Mar 2014 15:07:20 +0000 Subject: [PATCH 102/419] fix build... svn path=/trunk/; revision=62491 --- reactos/dll/win32/browseui/lang/{de_DE.rc => de-DE.rc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename reactos/dll/win32/browseui/lang/{de_DE.rc => de-DE.rc} (100%) diff --git a/reactos/dll/win32/browseui/lang/de_DE.rc b/reactos/dll/win32/browseui/lang/de-DE.rc similarity index 100% rename from reactos/dll/win32/browseui/lang/de_DE.rc rename to reactos/dll/win32/browseui/lang/de-DE.rc From 5783342323f2036abca4bd986cb1a2b207b18639 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Thu, 13 Mar 2014 18:54:06 +0000 Subject: [PATCH 103/419] [uniata] update uniata to 45a3 fixes installation on ATI IXP700 SATA controller svn path=/trunk/; revision=62493 --- reactos/drivers/storage/ide/uniata/bm_devs.h | 315 +++++++++++++----- reactos/drivers/storage/ide/uniata/bsmaster.h | 63 +++- reactos/drivers/storage/ide/uniata/id_ata.cpp | 82 +++-- reactos/drivers/storage/ide/uniata/id_dma.cpp | 12 +- .../drivers/storage/ide/uniata/id_init.cpp | 249 ++++++++++++-- .../drivers/storage/ide/uniata/id_sata.cpp | 45 ++- .../drivers/storage/ide/uniata/uniata_ver.h | 18 +- 7 files changed, 627 insertions(+), 157 deletions(-) diff --git a/reactos/drivers/storage/ide/uniata/bm_devs.h b/reactos/drivers/storage/ide/uniata/bm_devs.h index dcafd391935..3c11ffe9784 100644 --- a/reactos/drivers/storage/ide/uniata/bm_devs.h +++ b/reactos/drivers/storage/ide/uniata/bm_devs.h @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2002-2012 Alexandr A. Telyatnikov (Alter) +Copyright (c) 2002-2014 Alexandr A. Telyatnikov (Alter) Module Name: bm_devs.h @@ -103,14 +103,6 @@ typedef struct _BUSMASTER_CONTROLLER_INFORMATION { #define ATA_ATP865A 0x00081191 #define ATA_ATP865R 0x00091191 -#define ATA_AMD_ID 0x1022 -#define ATA_AMD755 0x74011022 -#define ATA_AMD756 0x74091022 -#define ATA_AMD766 0x74111022 -#define ATA_AMD768 0x74411022 -#define ATA_AMD8111 0x74691022 -#define ATA_AMD5536 0x209a1022 - #define ATA_ACER_LABS_ID 0x10b9 #define ATA_ALI_1533 0x153310b9 #define ATA_ALI_5228 0x522810b9 @@ -120,6 +112,24 @@ typedef struct _BUSMASTER_CONTROLLER_INFORMATION { #define ATA_ALI_5288 0x528810b9 #define ATA_ALI_5289 0x528910b9 +#define ATA_AMD_ID 0x1022 +#define ATA_AMD755 0x74011022 +#define ATA_AMD756 0x74091022 +#define ATA_AMD766 0x74111022 +#define ATA_AMD768 0x74411022 +#define ATA_AMD8111 0x74691022 +#define ATA_AMD5536 0x209a1022 +#define ATA_AMD_HUDSON2_S1 0x78001022 +#define ATA_AMD_HUDSON2_S2 0x78011022 +#define ATA_AMD_HUDSON2_S3 0x78021022 +#define ATA_AMD_HUDSON2_S4 0x78031022 +#define ATA_AMD_HUDSON2_S5 0x78041022 +#define ATA_AMD_HUDSON2 0x780c1022 + +#define ATA_ADAPTEC_ID 0x9005 +#define ATA_ADAPTEC_1420 0x02419005 +#define ATA_ADAPTEC_1430 0x02439005 + #define ATA_ATI_ID 0x1002 #define ATA_ATI_IXP200 0x43491002 #define ATA_ATI_IXP300 0x43691002 @@ -136,6 +146,7 @@ typedef struct _BUSMASTER_CONTROLLER_INFORMATION { #define ATA_ATI_IXP700_S4 0x43931002 #define ATA_ATI_IXP800_S1 0x43941002 #define ATA_ATI_IXP800_S2 0x43951002 +#define ATA_ATI_4385 0x43851002 #define ATA_CENATEK_ID 0x16ca #define ATA_CENATEK_ROCKET 0x000116ca @@ -209,6 +220,10 @@ typedef struct _BUSMASTER_CONTROLLER_INFORMATION { #define ATA_I82801IB_AH4 0x29238086 #define ATA_I82801IB_R1 0x29258086 #define ATA_I82801IB_S2 0x29268086 +#define ATA_I82801IBM_S1 0x29288086 +#define ATA_I82801IBM_AH 0x29298086 +#define ATA_I82801IBM_R1 0x292a8086 +#define ATA_I82801IBM_S2 0x292d8086 #define ATA_I82801JIB_S1 0x3a208086 #define ATA_I82801JIB_AH 0x3a228086 #define ATA_I82801JIB_R1 0x3a258086 @@ -265,13 +280,31 @@ typedef struct _BUSMASTER_CONTROLLER_INFORMATION { #define ATA_PPT_R5 0x1e0e8086 #define ATA_PPT_R6 0x1e0f8086 +#define ATA_LPT_S1 0x8c008086 +#define ATA_LPT_S2 0x8c018086 +#define ATA_LPT_AH1 0x8c028086 +#define ATA_LPT_AH2 0x8c038086 +#define ATA_LPT_R1 0x8c048086 +#define ATA_LPT_R2 0x8c058086 +#define ATA_LPT_R3 0x8c068086 +#define ATA_LPT_R4 0x8c078086 +#define ATA_LPT_S3 0x8c088086 +#define ATA_LPT_S4 0x8c098086 +#define ATA_LPT_R5 0x8c0e8086 +#define ATA_LPT_R6 0x8c0f8086 + #define ATA_I31244 0x32008086 #define ATA_ISCH 0x811a8086 #define ATA_DH89XXCC 0x23238086 +#define ATA_COLETOCRK_AH1 0x23a38086 +#define ATA_COLETOCRK_S1 0x23a18086 +#define ATA_COLETOCRK_S2 0x23a68086 + #define ATA_JMICRON_ID 0x197b #define ATA_JMB360 0x2360197b #define ATA_JMB361 0x2361197b +#define ATA_JMB362 0x2362197b #define ATA_JMB363 0x2363197b #define ATA_JMB365 0x2365197b #define ATA_JMB366 0x2366197b @@ -596,12 +629,14 @@ typedef struct _BUSMASTER_CONTROLLER_INFORMATION { #define PRNEW 1 #define PRTX 2 #define PRMIO 3 -#define PRIDX 4 #define PRTX4 0x0100 #define PRSX4K 0x0200 #define PRSX6K 0x0400 #define PRSATA 0x0800 -#define PRDUAL 0x1000 +#define PRCMBO 0x1000 +#define PRG2 0x2000 +#define PRCMBO2 (PRCMBO | PRG2) +#define PRSATA2 (PRSATA | PRG2) #define SWKS33 0 #define SWKS66 1 @@ -611,6 +646,7 @@ typedef struct _BUSMASTER_CONTROLLER_INFORMATION { #define SIIOLD 0 #define SIICMD 1 #define SIIMIO 2 +#define ATI700 3 #define SIIINTR 0x0100 #define SIIENINTR 0x0200 @@ -644,11 +680,11 @@ typedef struct _BUSMASTER_CONTROLLER_INFORMATION { #define NV4OFF 0x0100 #define NVQ 0x0200 -#define VIA33 0 +#define VIA33 4 #define VIA66 1 #define VIA100 2 #define VIA133 3 -#define AMDNVIDIA 4 +#define AMDNVIDIA 0 #define AMDCABLE 0x0100 #define AMDBUG 0x0200 #define VIABAR 0x0400 @@ -692,12 +728,12 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 5229, 10b9, 0x20, ATA_UDMA2, "ALI M5229 UDMA2" , ALIOLD ), PCI_DEV_HW_SPEC_BM( 5229, 10b9, 0x00, ATA_WDMA2, "ALI M5229 WDMA2" , ALIOLD ), - PCI_DEV_HW_SPEC_BM( 7401, 1022, 0x00, ATA_UDMA2, "AMD 755" , AMDNVIDIA | 0x00 ), - PCI_DEV_HW_SPEC_BM( 7409, 1022, 0x00, ATA_UDMA4, "AMD 756" , AMDNVIDIA | UNIATA_NO80CHK ), - PCI_DEV_HW_SPEC_BM( 7411, 1022, 0x00, ATA_UDMA5, "AMD 766" , AMDNVIDIA | AMDBUG ), - PCI_DEV_HW_SPEC_BM( 7441, 1022, 0x00, ATA_UDMA5, "AMD 768" , AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 7469, 1022, 0x00, ATA_UDMA6, "AMD 8111" , AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 209a, 1022, 0x00, ATA_UDMA5, "AMD CS5536" , AMDNVIDIA ), + PCI_DEV_HW_SPEC_BM( 7401, 1022, 0x00, ATA_UDMA2, "AMD 755" , 0 | 0x00 ), + PCI_DEV_HW_SPEC_BM( 7409, 1022, 0x00, ATA_UDMA4, "AMD 756" , 0 | UNIATA_NO80CHK ), + PCI_DEV_HW_SPEC_BM( 7411, 1022, 0x00, ATA_UDMA5, "AMD 766" , 0 | AMDBUG ), + PCI_DEV_HW_SPEC_BM( 7441, 1022, 0x00, ATA_UDMA5, "AMD 768" , 0 ), + PCI_DEV_HW_SPEC_BM( 7469, 1022, 0x00, ATA_UDMA6, "AMD 8111" , 0 ), + PCI_DEV_HW_SPEC_BM( 209a, 1022, 0x00, ATA_UDMA5, "AMD CS5536" , 0 ), PCI_DEV_HW_SPEC_BM( 4349, 1002, 0x00, ATA_UDMA5, "ATI IXP200" , 0 ), PCI_DEV_HW_SPEC_BM( 4369, 1002, 0x00, ATA_UDMA6, "ATI IXP300" , 0 ), @@ -706,9 +742,21 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 4379, 1002, 0x00, ATA_SA150, "ATI IXP400" , SIIMIO | SIIBUG | SIINOSATAIRQ | UNIATA_SATA ), PCI_DEV_HW_SPEC_BM( 437a, 1002, 0x00, ATA_SA300, "ATI IXP400" , SIIMIO | SIIBUG | SIINOSATAIRQ | UNIATA_SATA ), PCI_DEV_HW_SPEC_BM( 438c, 1002, 0x00, ATA_UDMA6, "ATI IXP600" , 0 ), - PCI_DEV_HW_SPEC_BM( 4380, 1002, 0x00, ATA_SA150, "ATI IXP600" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 4380, 1002, 0x00, ATA_SA300, "ATI IXP600" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 439c, 1002, 0x00, ATA_UDMA6, "ATI IXP700" , 0 ), - PCI_DEV_HW_SPEC_BM( 4390, 1002, 0x00, ATA_SA150, "ATI IXP700" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 4390, 1002, 0x00, ATA_SA300, "ATI IXP700" , ATI700 | UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 4391, 1002, 0x00, ATA_SA300, "ATI IXP700" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 4392, 1002, 0x00, ATA_SA300, "ATI IXP700" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 4393, 1002, 0x00, ATA_SA300, "ATI IXP700" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 4394, 1002, 0x00, ATA_SA300, "ATI IXP700/800" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 4395, 1002, 0x00, ATA_SA300, "ATI IXP700/800" , UNIATA_SATA | UNIATA_AHCI ), + + PCI_DEV_HW_SPEC_BM( 780c, 1002, 0x00, ATA_UDMA6, "ATI Hudson-2" , 0 ), + PCI_DEV_HW_SPEC_BM( 7800, 1002, 0x00, ATA_SA300, "ATI Hudson-2" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 7801, 1002, 0x00, ATA_SA300, "ATI Hudson-2" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 7802, 1002, 0x00, ATA_SA300, "ATI Hudson-2" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 7803, 1002, 0x00, ATA_SA300, "ATI Hudson-2" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 7804, 1002, 0x00, ATA_SA300, "ATI Hudson-2" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 0004, 1103, 0x05, ATA_UDMA6, "HighPoint HPT372" , HPT372 | 0x00 | UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 0004, 1103, 0x03, ATA_UDMA5, "HighPoint HPT370" , HPT370 | 0x00 | UNIATA_RAID_CONTROLLER), @@ -778,7 +826,6 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 2920, 8086, 0x00, ATA_SA300, "Intel ICH9" , I6CH | UNIATA_SATA ), PCI_DEV_HW_SPEC_BM( 2926, 8086, 0x00, ATA_SA300, "Intel ICH9" , I6CH2 | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 282a, 8086, 0x00, ATA_SA300, "Intel ICH9" , I6CH2 | UNIATA_SATA ), PCI_DEV_HW_SPEC_BM( 2921, 8086, 0x00, ATA_SA300, "Intel ICH9" , UNIATA_SATA | UNIATA_AHCI ),/* ??? */ PCI_DEV_HW_SPEC_BM( 2922, 8086, 0x00, ATA_SA300, "Intel ICH9" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 2923, 8086, 0x00, ATA_SA300, "Intel ICH9" , UNIATA_SATA | UNIATA_AHCI ), @@ -846,56 +893,150 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 1e0e, 8086, 0x00, ATA_SA300, "Intel Panther Point" , UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 1e0f, 8086, 0x00, ATA_SA300, "Intel Panther Point" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 8c00, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , I6CH | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 8c01, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , I6CH | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 8c02, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 8c03, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 8c04, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 8c05, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 8c06, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 8c07, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 8c08, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , I6CH2 | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 8c09, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , I6CH2 | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 8c0e, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 8c0f, 8086, 0x00, ATA_SA300, "Intel Lynx Point" , UNIATA_SATA | UNIATA_AHCI ), + // PCI_DEV_HW_SPEC_BM( 3200, 8086, 0x00, ATA_SA150, "Intel 31244" , UNIATA_SATA ), PCI_DEV_HW_SPEC_BM( 811a, 8086, 0x00, ATA_UDMA5, "Intel SCH" , 0 ), PCI_DEV_HW_SPEC_BM( 2323, 8086, 0x00, ATA_SA300, "Intel DH98xxCC" , UNIATA_SATA | UNIATA_AHCI ), - PCI_DEV_HW_SPEC_BM( 2360, 197b, 0x00, ATA_SA300, "JMB360" , UNIATA_SATA | UNIATA_AHCI ), - - PCI_DEV_HW_SPEC_BM( 2361, 197b, 0x00, ATA_UDMA6, "JMB361" , 0 ), - PCI_DEV_HW_SPEC_BM( 2363, 197b, 0x00, ATA_UDMA6, "JMB363" , 0 ), - PCI_DEV_HW_SPEC_BM( 2365, 197b, 0x00, ATA_UDMA6, "JMB365" , 0 ), - PCI_DEV_HW_SPEC_BM( 2366, 197b, 0x00, ATA_UDMA6, "JMB366" , 0 ), - PCI_DEV_HW_SPEC_BM( 2368, 197b, 0x00, ATA_UDMA6, "JMB368" , 0 ), + PCI_DEV_HW_SPEC_BM( 23a3, 8086, 0x00, ATA_SA300, "COLETOCRK" , I6CH2 | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 23a1, 8086, 0x00, ATA_SA300, "COLETOCRK" , I6CH2 | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 23a6, 8086, 0x00, ATA_SA300, "COLETOCRK" , UNIATA_SATA | UNIATA_AHCI ), + + PCI_DEV_HW_SPEC_BM( 2360, 197b, 0x00, ATA_SA300, "JMB360" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 2361, 197b, 0x00, ATA_UDMA6, "JMB361" , 0 ), + PCI_DEV_HW_SPEC_BM( 2362, 197b, 0x00, ATA_SA300, "JMB362" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 2363, 197b, 0x00, ATA_UDMA6, "JMB363" , 0 ), + PCI_DEV_HW_SPEC_BM( 2365, 197b, 0x00, ATA_UDMA6, "JMB365" , 0 ), + PCI_DEV_HW_SPEC_BM( 2366, 197b, 0x00, ATA_UDMA6, "JMB366" , 0 ), + PCI_DEV_HW_SPEC_BM( 2368, 197b, 0x00, ATA_UDMA6, "JMB368" , 0 ), /* - PCI_DEV_HW_SPEC_BM( 5040, 11ab, 0x00, ATA_SA150, "Marvell 88SX5040" , UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 5041, 11ab, 0x00, ATA_SA150, "Marvell 88SX5041" , UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 5080, 11ab, 0x00, ATA_SA150, "Marvell 88SX5080" , UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 5081, 11ab, 0x00, ATA_SA150, "Marvell 88SX5081" , UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 6041, 11ab, 0x00, ATA_SA300, "Marvell 88SX6041" , UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 6081, 11ab, 0x00, ATA_SA300, "Marvell 88SX6081" , UNIATA_SATA ),*/ - PCI_DEV_HW_SPEC_BM( 6101, 11ab, 0x00, ATA_UDMA6, "Marvell 88SX6101" , 0 ), - PCI_DEV_HW_SPEC_BM( 6121, 11ab, 0x00, ATA_UDMA6, "Marvell 88SX6121" , 0 ), - PCI_DEV_HW_SPEC_BM( 6145, 11ab, 0x00, ATA_UDMA6, "Marvell 88SX6145" , 0 ), + PCI_DEV_HW_SPEC_BM( 5040, 11ab, 0x00, ATA_SA150, "Marvell 88SX5040" , UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 5041, 11ab, 0x00, ATA_SA150, "Marvell 88SX5041" , UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 5080, 11ab, 0x00, ATA_SA150, "Marvell 88SX5080" , UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 5081, 11ab, 0x00, ATA_SA150, "Marvell 88SX5081" , UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 6041, 11ab, 0x00, ATA_SA300, "Marvell 88SX6041" , UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 6081, 11ab, 0x00, ATA_SA300, "Marvell 88SX6081" , UNIATA_SATA ),*/ + PCI_DEV_HW_SPEC_BM( 6101, 11ab, 0x00, ATA_UDMA6, "Marvell 88SX6101" , 0 ), + PCI_DEV_HW_SPEC_BM( 6102, 11ab, 0x00, ATA_UDMA6, "Marvell 88SX6102" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 6111, 11ab, 0x00, ATA_UDMA6, "Marvell 88SX6111" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 6121, 11ab, 0x00, ATA_UDMA6, "Marvell 88SX6121" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 6141, 11ab, 0x00, ATA_UDMA6, "Marvell 88SX6141" , UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 6145, 11ab, 0x00, ATA_UDMA6, "Marvell 88SX6145" , UNIATA_SATA | UNIATA_AHCI ), +/* PCI_DEV_HW_SPEC_BM( 91a4, 1b4b, 0x00, ATA_UDMA6, "Marvell 88SE912x" , 0 ),*/ - PCI_DEV_HW_SPEC_BM( 01bc, 10de, 0x00, ATA_UDMA5, "nVidia nForce" , AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 0065, 10de, 0x00, ATA_UDMA6, "nVidia nForce2" , AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 0085, 10de, 0x00, ATA_UDMA6, "nVidia nForce2 Pro",AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 008e, 10de, 0x00, ATA_SA150, "nVidia nForce2 Pro S1",UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 00d5, 10de, 0x00, ATA_UDMA6, "nVidia nForce3" , AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 00e5, 10de, 0x00, ATA_UDMA6, "nVidia nForce3 Pro",AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 00e3, 10de, 0x00, ATA_SA150, "nVidia nForce3 Pro S1",UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 00ee, 10de, 0x00, ATA_SA150, "nVidia nForce3 Pro S2",UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 0035, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP", AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 0036, 10de, 0x00, ATA_SA150, "nVidia nForce MCP S1",NV4OFF | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 003e, 10de, 0x00, ATA_SA150, "nVidia nForce MCP S2",NV4OFF | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 0053, 10de, 0x00, ATA_UDMA6, "nVidia nForce CK804", AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 0054, 10de, 0x00, ATA_SA300, "nVidia nForce CK804 S1",NV4OFF | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 0055, 10de, 0x00, ATA_SA300, "nVidia nForce CK804 S2",NV4OFF | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 0265, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP51", AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 0266, 10de, 0x00, ATA_SA300, "nVidia nForce MCP51 S1",NV4OFF | NVQ | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 0267, 10de, 0x00, ATA_SA300, "nVidia nForce MCP51 S2",NV4OFF | NVQ | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 036e, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP55", AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 037e, 10de, 0x00, ATA_SA300, "nVidia nForce MCP55 S1",NV4OFF | NVQ | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 037f, 10de, 0x00, ATA_SA300, "nVidia nForce MCP55 S2",NV4OFF | NVQ | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 03ec, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP61", AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 03e7, 10de, 0x00, ATA_SA300, "nVidia nForce MCP61 S1",NV4OFF | NVQ | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 03f6, 10de, 0x00, ATA_SA300, "nVidia nForce MCP61 S2",NV4OFF | NVQ | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 03f7, 10de, 0x00, ATA_SA300, "nVidia nForce MCP61 S3",NV4OFF | NVQ | UNIATA_SATA ), - PCI_DEV_HW_SPEC_BM( 0448, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP65", AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 0560, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP67", AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 056c, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP73", AMDNVIDIA ), - PCI_DEV_HW_SPEC_BM( 0759, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP77", AMDNVIDIA ), + PCI_DEV_HW_SPEC_BM( 01bc, 10de, 0x00, ATA_UDMA5, "nVidia nForce" , 0 ), + PCI_DEV_HW_SPEC_BM( 0065, 10de, 0x00, ATA_UDMA6, "nVidia nForce2" , 0 ), + PCI_DEV_HW_SPEC_BM( 0085, 10de, 0x00, ATA_UDMA6, "nVidia nForce2 Pro",0 ), + PCI_DEV_HW_SPEC_BM( 008e, 10de, 0x00, ATA_SA150, "nVidia nForce2 Pro S1",UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 00d5, 10de, 0x00, ATA_UDMA6, "nVidia nForce3" , 0 ), + PCI_DEV_HW_SPEC_BM( 00e5, 10de, 0x00, ATA_UDMA6, "nVidia nForce3 Pro",0 ), + PCI_DEV_HW_SPEC_BM( 00e3, 10de, 0x00, ATA_SA150, "nVidia nForce3 Pro S1",UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 00ee, 10de, 0x00, ATA_SA150, "nVidia nForce3 Pro S2",UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 0035, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP", 0 ), + PCI_DEV_HW_SPEC_BM( 0036, 10de, 0x00, ATA_SA150, "nVidia nForce MCP S1",NV4OFF | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 003e, 10de, 0x00, ATA_SA150, "nVidia nForce MCP S2",NV4OFF | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 0053, 10de, 0x00, ATA_UDMA6, "nVidia nForce CK804", 0 ), + PCI_DEV_HW_SPEC_BM( 0054, 10de, 0x00, ATA_SA300, "nVidia nForce CK804 S1",NV4OFF | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 0055, 10de, 0x00, ATA_SA300, "nVidia nForce CK804 S2",NV4OFF | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 0265, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP51", 0 ), + PCI_DEV_HW_SPEC_BM( 0266, 10de, 0x00, ATA_SA300, "nVidia nForce MCP51 S1",NV4OFF | NVQ | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 0267, 10de, 0x00, ATA_SA300, "nVidia nForce MCP51 S2",NV4OFF | NVQ | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 036e, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP55", 0 ), + PCI_DEV_HW_SPEC_BM( 037e, 10de, 0x00, ATA_SA300, "nVidia nForce MCP55 S1",NV4OFF | NVQ | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 037f, 10de, 0x00, ATA_SA300, "nVidia nForce MCP55 S2",NV4OFF | NVQ | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 03ec, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP61", 0 ), + PCI_DEV_HW_SPEC_BM( 03e7, 10de, 0x00, ATA_SA300, "nVidia nForce MCP61 S1",NV4OFF | NVQ | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 03f6, 10de, 0x00, ATA_SA300, "nVidia nForce MCP61 S2",NV4OFF | NVQ | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 03f7, 10de, 0x00, ATA_SA300, "nVidia nForce MCP61 S3",NV4OFF | NVQ | UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 0448, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP65", 0 ), + PCI_DEV_HW_SPEC_BM( 044c, 10de, 0x00, ATA_SA300, "nVidia nForce MCP65 A0", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 044d, 10de, 0x00, ATA_SA300, "nVidia nForce MCP65 A1", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 044e, 10de, 0x00, ATA_SA300, "nVidia nForce MCP65 A2", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 044f, 10de, 0x00, ATA_SA300, "nVidia nForce MCP65 A3", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 045c, 10de, 0x00, ATA_SA300, "nVidia nForce MCP65 A4", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 045d, 10de, 0x00, ATA_SA300, "nVidia nForce MCP65 A5", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 045e, 10de, 0x00, ATA_SA300, "nVidia nForce MCP65 A6", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 045f, 10de, 0x00, ATA_SA300, "nVidia nForce MCP65 A7", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0560, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP67", 0 ), + PCI_DEV_HW_SPEC_BM( 0550, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 A0", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0551, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 A1", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0552, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 A2", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0553, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 A3", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0554, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 A4", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0555, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 A5", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0556, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 A6", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0557, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 A7", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0558, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 A8", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0559, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 A9", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 055A, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 AA", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 055B, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 AB", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0584, 10de, 0x00, ATA_SA300, "nVidia nForce MCP67 AC", UNIATA_SATA | UNIATA_AHCI ), + + PCI_DEV_HW_SPEC_BM( 056c, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP73", 0 ), + PCI_DEV_HW_SPEC_BM( 07f0, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 A0", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 07f1, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 A1", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 07f2, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 A2", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 07f3, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 A3", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 07f4, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 A4", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 07f5, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 A5", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 07f6, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 A6", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 07f7, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 A7", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 07f8, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 A8", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 07f9, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 A9", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 07fa, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 AA", UNIATA_SATA | UNIATA_AHCI ), + + PCI_DEV_HW_SPEC_BM( 07fb, 10de, 0x00, ATA_SA300, "nVidia nForce MCP73 AB", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0759, 10de, 0x00, ATA_UDMA6, "nVidia nForce MCP77", 0 ), + PCI_DEV_HW_SPEC_BM( 0ad0, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 A0", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ad1, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 A1", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ad2, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 A2", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ad3, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 A3", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ad4, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 A4", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ad5, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 A5", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ad6, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 A6", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ad7, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 A7", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ad8, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 A8", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ad9, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 A9", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ada, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 AA", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0adb, 10de, 0x00, ATA_SA300, "nVidia nForce MCP77 AB", UNIATA_SATA | UNIATA_AHCI ), + + PCI_DEV_HW_SPEC_BM( 0ab4, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 A0", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ab5, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 A1", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ab6, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 A2", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ab7, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 A3", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ab8, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 A4", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0ab9, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 A5", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0aba, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 A6", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0abb, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 A7", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0abc, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 A8", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0abd, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 A9", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0abe, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 AA", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0abf, 10de, 0x00, ATA_SA300, "nVidia nForce MCP79 AB", UNIATA_SATA | UNIATA_AHCI ), + + PCI_DEV_HW_SPEC_BM( 0d84, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 A0", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d85, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 A1", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d86, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 A2", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d87, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 A3", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d88, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 A4", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d89, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 A5", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d8a, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 A6", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d8b, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 A7", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d8c, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 A8", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d8d, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 A9", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d8e, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 AA", UNIATA_SATA | UNIATA_AHCI ), + PCI_DEV_HW_SPEC_BM( 0d8f, 10de, 0x00, ATA_SA300, "nVidia nForce MCP89 AB", UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( 0502, 100b, 0x00, ATA_UDMA2, "National Geode SC1100", 0 ), @@ -913,18 +1054,28 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 7275, 105a, 0x00, ATA_UDMA6, "Promise PDC20277" , PRTX | 0x00 | UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 3318, 105a, 0x00, ATA_SA150, "Promise PDC20318" , PRMIO | PRSATA | UNIATA_RAID_CONTROLLER | UNIATA_SATA), PCI_DEV_HW_SPEC_BM( 3319, 105a, 0x00, ATA_SA150, "Promise PDC20319" , PRMIO | PRSATA | UNIATA_RAID_CONTROLLER | UNIATA_SATA), - PCI_DEV_HW_SPEC_BM( 3371, 105a, 0x00, ATA_SA150, "Promise PDC20371" , PRMIO | PRSATA | UNIATA_RAID_CONTROLLER | UNIATA_SATA), - PCI_DEV_HW_SPEC_BM( 3375, 105a, 0x00, ATA_SA150, "Promise PDC20375" , PRMIO | PRSATA | UNIATA_RAID_CONTROLLER | UNIATA_SATA), - PCI_DEV_HW_SPEC_BM( 3376, 105a, 0x00, ATA_SA150, "Promise PDC20376" , PRMIO | PRSATA | UNIATA_RAID_CONTROLLER | UNIATA_SATA), - PCI_DEV_HW_SPEC_BM( 3377, 105a, 0x00, ATA_SA150, "Promise PDC20377" , PRMIO | PRSATA | UNIATA_RAID_CONTROLLER | UNIATA_SATA), - PCI_DEV_HW_SPEC_BM( 3373, 105a, 0x00, ATA_SA150, "Promise PDC20378" , PRMIO | PRSATA | UNIATA_RAID_CONTROLLER | UNIATA_SATA), - PCI_DEV_HW_SPEC_BM( 3372, 105a, 0x00, ATA_SA150, "Promise PDC20379" , PRMIO | PRSATA | UNIATA_RAID_CONTROLLER | UNIATA_SATA), - PCI_DEV_HW_SPEC_BM( 6617, 105a, 0x00, ATA_UDMA6, "Promise PDC20617" , PRMIO | PRDUAL | UNIATA_RAID_CONTROLLER), - PCI_DEV_HW_SPEC_BM( 6626, 105a, 0x00, ATA_UDMA6, "Promise PDC20618" , PRMIO | PRDUAL | UNIATA_RAID_CONTROLLER), - PCI_DEV_HW_SPEC_BM( 6629, 105a, 0x00, ATA_UDMA6, "Promise PDC20619" , PRMIO | PRDUAL | UNIATA_RAID_CONTROLLER), - PCI_DEV_HW_SPEC_BM( 6620, 105a, 0x00, ATA_UDMA6, "Promise PDC20620" , PRMIO | PRDUAL | UNIATA_RAID_CONTROLLER), + PCI_DEV_HW_SPEC_BM( 3371, 105a, 0x00, ATA_SA150, "Promise PDC20371" , PRMIO | PRCMBO | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3375, 105a, 0x00, ATA_SA150, "Promise PDC20375" , PRMIO | PRCMBO | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3376, 105a, 0x00, ATA_SA150, "Promise PDC20376" , PRMIO | PRCMBO | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3377, 105a, 0x00, ATA_SA150, "Promise PDC20377" , PRMIO | PRCMBO | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3373, 105a, 0x00, ATA_SA150, "Promise PDC20378" , PRMIO | PRCMBO | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3372, 105a, 0x00, ATA_SA150, "Promise PDC20379" , PRMIO | PRCMBO | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3571, 105a, 0x00, ATA_SA150, "Promise PDC20571" , PRMIO | PRCMBO2 | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3d75, 105a, 0x00, ATA_SA150, "Promise PDC20575" , PRMIO | PRCMBO2 | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3574, 105a, 0x00, ATA_SA150, "Promise PDC20579" , PRMIO | PRCMBO2 | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3570, 105a, 0x00, ATA_SA300, "Promise PDC20771" , PRMIO | PRCMBO2 | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3d73, 105a, 0x00, ATA_SA300, "Promise PDC40775" , PRMIO | PRCMBO2 | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 6617, 105a, 0x00, ATA_UDMA6, "Promise PDC20617" , PRMIO | 0x00 | UNIATA_RAID_CONTROLLER), + PCI_DEV_HW_SPEC_BM( 6626, 105a, 0x00, ATA_UDMA6, "Promise PDC20618" , PRMIO | 0x00 | UNIATA_RAID_CONTROLLER), + PCI_DEV_HW_SPEC_BM( 6629, 105a, 0x00, ATA_UDMA6, "Promise PDC20619" , PRMIO | 0x00 | UNIATA_RAID_CONTROLLER), + PCI_DEV_HW_SPEC_BM( 6620, 105a, 0x00, ATA_UDMA6, "Promise PDC20620" , PRMIO | 0x00 | UNIATA_RAID_CONTROLLER), /* PCI_DEV_HW_SPEC_BM( 6621, 105a, 0x00, ATA_UDMA6, "Promise PDC20621" , PRMIO | PRSX4X | UNIATA_RAID_CONTROLLER), PCI_DEV_HW_SPEC_BM( 6622, 105a, 0x00, ATA_UDMA6, "Promise PDC20622" , PRMIO | PRSX4X | UNIATA_RAID_CONTROLLER),*/ + PCI_DEV_HW_SPEC_BM( 3571, 105a, 0x00, ATA_SA150, "Promise PDC40518" , PRMIO | PRSATA2 | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3d75, 105a, 0x00, ATA_SA150, "Promise PDC40519" , PRMIO | PRSATA2 | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3574, 105a, 0x00, ATA_SA150, "Promise PDC40718" , PRMIO | PRSATA2 | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3570, 105a, 0x00, ATA_SA300, "Promise PDC40719" , PRMIO | PRSATA2 | UNIATA_RAID_CONTROLLER | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 3d73, 105a, 0x00, ATA_SA300, "Promise PDC40779" , PRMIO | PRSATA2 | UNIATA_RAID_CONTROLLER | UNIATA_SATA), PCI_DEV_HW_SPEC_BM( 0211, 1166, 0x00, ATA_UDMA2, "ServerWorks ROSB4", SWKS33 | UNIATA_NO_DPC ), PCI_DEV_HW_SPEC_BM( 0212, 1166, 0x92, ATA_UDMA5, "ServerWorks CSB5" , SWKS100 ), @@ -990,6 +1141,13 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 5513, 1039, 0x00, ATA_WDMA2, "SiS ATA-xxx" , 0 ), PCI_DEV_HW_SPEC_BM( 0601, 1039, 0x00, ATA_WDMA2, "SiS ATA-xxx" , 0 ), + PCI_DEV_HW_SPEC_BM( 1183, 1039, 0x00, ATA_UDMA6, "SiS PATA-1183" , SIS133NEW), + PCI_DEV_HW_SPEC_BM( 1182, 1039, 0x00, ATA_SA150, "SiS SATA 1182" , SISSATA | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 0183, 1039, 0x00, ATA_SA150, "SiS SATA 183" , SISSATA | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 0182, 1039, 0x00, ATA_SA150, "SiS SATA 182" , SISSATA | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 0181, 1039, 0x00, ATA_SA150, "SiS SATA 181" , SISSATA | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 0180, 1039, 0x00, ATA_SA150, "SiS SATA 180" , SISSATA | UNIATA_SATA), + /* PCI_DEV_HW_SPEC_BM( 0586, 1106, 0x41, ATA_UDMA2, "VIA 82C586B" , VIA33 | 0x00 ), PCI_DEV_HW_SPEC_BM( 0586, 1106, 0x40, ATA_UDMA2, "VIA 82C586B" , VIA33 | VIAPRQ ), PCI_DEV_HW_SPEC_BM( 0586, 1106, 0x02, ATA_UDMA2, "VIA 82C586B" , VIA33 | 0x00 ), @@ -1016,7 +1174,7 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 5337, 1106, 0x00, ATA_SA150, "VIA 8237S" , 0 | UNIATA_SATA ), PCI_DEV_HW_SPEC_BM( 5372, 1106, 0x00, ATA_SA300, "VIA 8237" , 0 | UNIATA_SATA ), PCI_DEV_HW_SPEC_BM( 7372, 1106, 0x00, ATA_SA300, "VIA 8237" , 0 | UNIATA_SATA ), - //PCI_DEV_HW_SPEC_BM( 3349, 1106, 0x00, ATA_SA150, "VIA 8251" , VIAAHCI| UNIATA_SATA ), + PCI_DEV_HW_SPEC_BM( 3349, 1106, 0x00, ATA_SA150, "VIA 8251" , 0 | UNIATA_SATA | UNIATA_AHCI ), PCI_DEV_HW_SPEC_BM( c693, 1080, 0x00, ATA_WDMA2, "Cypress 82C693" ,0 ), @@ -1045,7 +1203,8 @@ BUSMASTER_CONTROLLER_INFORMATION const BusMasterAdapters[] = { PCI_DEV_HW_SPEC_BM( 0102, 1078, 0x00, ATA_UDMA2, "Cyrix 5530" , 0 ), - PCI_DEV_HW_SPEC_BM( 0102, 1042, 0x00, ATA_PIO4, "RZ 100x" , 0 ), + PCI_DEV_HW_SPEC_BM( 1000, 1042, 0x00, ATA_PIO4, "RZ 100x" , 0 ), + PCI_DEV_HW_SPEC_BM( 1001, 1042, 0x00, ATA_PIO4, "RZ 100x" , 0 ), PCI_DEV_HW_SPEC_BM( 8172, 1283, 0x00, ATA_UDMA2, "IT8172" , 0 ), PCI_DEV_HW_SPEC_BM( 8213, 1283, 0x00, ATA_UDMA6, "IT8213F" , ITE_133_NEW ), diff --git a/reactos/drivers/storage/ide/uniata/bsmaster.h b/reactos/drivers/storage/ide/uniata/bsmaster.h index bb24ead357b..815bbe477c0 100644 --- a/reactos/drivers/storage/ide/uniata/bsmaster.h +++ b/reactos/drivers/storage/ide/uniata/bsmaster.h @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2002-2012 Alexandr A. Telyatnikov (Alter) +Copyright (c) 2002-2014 Alexandr A. Telyatnikov (Alter) Module Name: bsmaster.h @@ -31,10 +31,10 @@ Notes: Revision History: Code was created by - Alter, Copyright (c) 2002-2008 + Alter, Copyright (c) 2002-2014 - Some definitions were taken from FreeBSD 4.3-4.6 ATA driver by - Sren Schmidt, Copyright (c) 1998,1999,2000,2001 + Some definitions were taken from FreeBSD 4.3-9.2 ATA driver by + Sren Schmidt, Copyright (c) 1998-2014 --*/ @@ -245,6 +245,12 @@ typedef struct _IDE_AHCI_REGISTERS { ULONG Reserved:27; } BOHC; +#define AHCI_BOHC_BB 0x00000001 +#define AHCI_BOHC_OOC 0x00000002 +#define AHCI_BOHC_SOOE 0x00000004 +#define AHCI_BOHC_OOS 0x00000008 +#define AHCI_BOHC_BOS 0x00000010 + UCHAR Reserved2[0x74]; UCHAR VendorSpec[0x60]; @@ -289,6 +295,22 @@ typedef union _SATA_SSTATUS_REG { } SATA_SSTATUS_REG, *PSATA_SSTATUS_REG; +#define ATA_SS_DET_MASK 0x0000000f +#define ATA_SS_DET_NO_DEVICE 0x00000000 +#define ATA_SS_DET_DEV_PRESENT 0x00000001 +#define ATA_SS_DET_PHY_ONLINE 0x00000003 +#define ATA_SS_DET_PHY_OFFLINE 0x00000004 + +#define ATA_SS_SPD_MASK 0x000000f0 +#define ATA_SS_SPD_NO_SPEED 0x00000000 +#define ATA_SS_SPD_GEN1 0x00000010 +#define ATA_SS_SPD_GEN2 0x00000020 + +#define ATA_SS_IPM_MASK 0x00000f00 +#define ATA_SS_IPM_NO_DEVICE 0x00000000 +#define ATA_SS_IPM_ACTIVE 0x00000100 +#define ATA_SS_IPM_PARTIAL 0x00000200 +#define ATA_SS_IPM_SLUMBER 0x00000600 typedef union _SATA_SCONTROL_REG { @@ -322,6 +344,21 @@ typedef union _SATA_SCONTROL_REG { } SATA_SCONTROL_REG, *PSATA_SCONTROL_REG; +#define ATA_SC_DET_MASK 0x0000000f +#define ATA_SC_DET_IDLE 0x00000000 +#define ATA_SC_DET_RESET 0x00000001 +#define ATA_SC_DET_DISABLE 0x00000004 + +#define ATA_SC_SPD_MASK 0x000000f0 +#define ATA_SC_SPD_NO_SPEED 0x00000000 +#define ATA_SC_SPD_SPEED_GEN1 0x00000010 +#define ATA_SC_SPD_SPEED_GEN2 0x00000020 +#define ATA_SC_SPD_SPEED_GEN3 0x00000040 + +#define ATA_SC_IPM_MASK 0x00000f00 +#define ATA_SC_IPM_NONE 0x00000000 +#define ATA_SC_IPM_DIS_PARTIAL 0x00000100 +#define ATA_SC_IPM_DIS_SLUMBER 0x00000200 typedef union _SATA_SERROR_REG { @@ -358,6 +395,22 @@ typedef union _SATA_SERROR_REG { } SATA_SERROR_REG, *PSATA_SERROR_REG; +#define ATA_SE_DATA_CORRECTED 0x00000001 +#define ATA_SE_COMM_CORRECTED 0x00000002 +#define ATA_SE_DATA_ERR 0x00000100 +#define ATA_SE_COMM_ERR 0x00000200 +#define ATA_SE_PROT_ERR 0x00000400 +#define ATA_SE_HOST_ERR 0x00000800 +#define ATA_SE_PHY_CHANGED 0x00010000 +#define ATA_SE_PHY_IERROR 0x00020000 +#define ATA_SE_COMM_WAKE 0x00040000 +#define ATA_SE_DECODE_ERR 0x00080000 +#define ATA_SE_PARITY_ERR 0x00100000 +#define ATA_SE_CRC_ERR 0x00200000 +#define ATA_SE_HANDSHAKE_ERR 0x00400000 +#define ATA_SE_LINKSEQ_ERR 0x00800000 +#define ATA_SE_TRANSPORT_ERR 0x01000000 +#define ATA_SE_UNKNOWN_FIS 0x02000000 typedef struct _IDE_SATA_REGISTERS { union { @@ -842,6 +895,7 @@ typedef union _ATA_REQ { PIDE_AHCI_CMD ahci_cmd_ptr; ULONG in_bcount; ULONG in_status; + ULONG in_serror; USHORT io_cmd_flags; // out UCHAR in_error; } ahci; @@ -1032,6 +1086,7 @@ typedef struct _HW_CHANNEL { ULONG AhciPrevCI; ULONG AhciCompleteCI; ULONG AhciLastIS; + ULONG AhciLastSError; //PVOID AHCI_FIS; // is not actually used by UniATA now, but is required by AHCI controller //ULONGLONG AHCI_FIS_PhAddr; // Note: in contrast to FBSD, we keep PRD and CMD item in AtaReq structure diff --git a/reactos/drivers/storage/ide/uniata/id_ata.cpp b/reactos/drivers/storage/ide/uniata/id_ata.cpp index 9c535055e5a..122431b1447 100644 --- a/reactos/drivers/storage/ide/uniata/id_ata.cpp +++ b/reactos/drivers/storage/ide/uniata/id_ata.cpp @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2002-2012 Alexandr A. Telyatnikov (Alter) +Copyright (c) 2002-2014 Alexandr A. Telyatnikov (Alter) Module Name: id_ata.cpp @@ -37,8 +37,8 @@ Revision History: Some parts of code were taken from FreeBSD 4.3-6.1 ATA driver by Sren Schmidt, Copyright (c) 1998-2007 - All parts of code are greatly changed/updated by - Alter, Copyright (c) 2002-2007: + All parts of code are significantly changed/updated by + Alter, Copyright (c) 2002-2014: 1. Internal command queueing/reordering 2. Drive identification @@ -4182,23 +4182,41 @@ AtapiCheckInterrupt__( return INTERRUPT_REASON_IGNORE; } break; - case PRMIO: - status = AtapiReadPortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x0040); - if(ChipFlags & PRSATA) { - pr_status = AtapiReadPortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x006c); - AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x006c, pr_status & 0x000000ff); - } - if(pr_status & (0x11 << Channel)) { - // TODO: reset channel - KdPrint2((PRINT_PREFIX " Promise mio unexpected + reset req\n")); - return INTERRUPT_REASON_IGNORE; - } - if(!(status & (0x01 << Channel))) { + case PRMIO: { + ULONG stat_reg = (ChipFlags & PRG2) ? 0x60 : 0x6c; + status = AtapiReadPortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x40); + AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x40, status); + + if(status & (1 << (Channel+1))) { + // our + } else { KdPrint2((PRINT_PREFIX " Promise mio unexpected\n")); return INTERRUPT_REASON_IGNORE; } + + if(!(ChipFlags & UNIATA_SATA)) + break; + + pr_status = AtapiReadPortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),stat_reg); + AtapiWritePortEx4(chan, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),stat_reg, (pr_status & (0x11 << Channel))); + if(pr_status & (0x11 << Channel)) { + // TODO: reset channel + KdPrint2((PRINT_PREFIX " Promise mio unexpected + reset req\n")); + UniataSataEvent(deviceExtension, lChannel, UNIATA_SATA_EVENT_DETACH, 0); + } + if(!(status & (0x01 << Channel))) { + // Connect event + KdPrint2((PRINT_PREFIX " Promise mio unexpected attach\n")); + UniataSataEvent(deviceExtension, lChannel, UNIATA_SATA_EVENT_ATTACH, 0); + } + if(UniataSataClearErr(HwDeviceExtension, c, UNIATA_SATA_DO_CONNECT, 0)) { + OurInterrupt = INTERRUPT_REASON_UNEXPECTED; + } else { + return INTERRUPT_REASON_IGNORE; + } + AtapiWritePort4(chan, IDX_BM_DeviceSpecific0, 0x00000001); - break; + break; } } break; } case ATA_NVIDIA_ID: { @@ -4551,6 +4569,7 @@ AtapiInterrupt__( // BOOLEAN RestoreUseDpc = FALSE; BOOLEAN DataOverrun = FALSE; BOOLEAN NoStartIo = TRUE; + BOOLEAN NoRetry = FALSE; KdPrint2((PRINT_PREFIX "AtapiInterrupt:\n")); if(InDpc) { @@ -4763,12 +4782,19 @@ ServiceInterrupt: statusByte = (UCHAR)(AtaReq->ahci.in_status & IDE_STATUS_MASK); if(chan->AhciLastIS & ~(ATA_AHCI_P_IX_DHR | ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DS | ATA_AHCI_P_IX_SDB)) { - KdPrint3((PRINT_PREFIX "Err intr (%#x)\n", chan->AhciLastIS & ~(ATA_AHCI_P_IX_DHR | ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DS | ATA_AHCI_P_IX_SDB))); + KdPrint3((PRINT_PREFIX "Err intr (%#x), SE (%#x)\n", + chan->AhciLastIS & ~(ATA_AHCI_P_IX_DHR | ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DS | ATA_AHCI_P_IX_SDB), + chan->AhciLastSError)); if(chan->AhciLastIS & ~ATA_AHCI_P_IX_OF) { //KdPrint3((PRINT_PREFIX "Err mask (%#x)\n", chan->AhciLastIS & ~ATA_AHCI_P_IX_OF)); // We have some other error except Overflow // Just signal ERROR, operation will be aborted in ERROR branch. statusByte |= IDE_STATUS_ERROR; + AtaReq->ahci.in_serror = chan->AhciLastSError; + if(chan->AhciLastSError & (ATA_SE_HANDSHAKE_ERR | ATA_SE_LINKSEQ_ERR | ATA_SE_TRANSPORT_ERR | ATA_SE_UNKNOWN_FIS)) { + KdPrint2((PRINT_PREFIX "Unrecoverable\n")); + NoRetry = TRUE; + } } else { // We have only Overflow. Abort operation and continue #ifdef _DEBUG @@ -4960,6 +4986,13 @@ try_dpc_wait: UniataDumpAhciPortRegs(chan); #endif UniataAhciStatus(HwDeviceExtension, lChannel, DEVNUM_NOT_SPECIFIED); + if(NoRetry) { + AtaReq->retry += MAX_RETRIES; + if(!error && (statusByte & IDE_STATUS_ERROR)) { + KdPrint2((PRINT_PREFIX "AtapiInterrupt: force error status\n")); + error |= IDE_STATUS_ERROR; + } + } #ifdef _DEBUG UniataDumpAhciPortRegs(chan); #endif @@ -4980,7 +5013,9 @@ try_dpc_wait: KdPrint2((PRINT_PREFIX " Bad Lba unknown\n")); } - + if(deviceExtension->HwFlags & UNIATA_AHCI) { + KdPrint2((PRINT_PREFIX " no wait ready after error\n")); + } else if(!atapiDev) { KdPrint2((PRINT_PREFIX " wait 100 ready after IDE error\n")); AtapiStallExecution(100); @@ -5012,11 +5047,14 @@ continue_err: #endif //IO_STATISTICS if(DmaTransfer /*&& (error & IDE_ERROR_ICRC)*/) { + KdPrint2((PRINT_PREFIX "Errors in DMA mode\n")); if(AtaReq->retry < MAX_RETRIES) { //fallback_pio: - AtaReq->Flags &= ~REQ_FLAG_DMA_OPERATION; - AtaReq->Flags |= REQ_FLAG_FORCE_DOWNRATE; + if(!(deviceExtension->HwFlags & UNIATA_AHCI)) { + AtaReq->Flags &= ~REQ_FLAG_DMA_OPERATION; + AtaReq->Flags |= REQ_FLAG_FORCE_DOWNRATE; // LunExt->DeviceFlags |= DFLAGS_FORCE_DOWNRATE; + } AtaReq->ReqState = REQ_STATE_QUEUED; goto reenqueue_req; } @@ -10671,8 +10709,8 @@ AtapiRegCheckParameterValue( // KdPrint(( "AtapiCheckRegValue: RegistryPath %ws\n", RegistryPath->Buffer)); paramPath.Length = 0; - paramPath.MaximumLength = (USHORT)(RegistryPath->Length + - (wcslen(PathSuffix)+2)*sizeof(WCHAR)); + paramPath.MaximumLength = RegistryPath->Length + + (wcslen(PathSuffix)+2)*sizeof(WCHAR); paramPath.Buffer = (PWCHAR)ExAllocatePool(NonPagedPool, paramPath.MaximumLength); if(!paramPath.Buffer) { KdPrint(("AtapiCheckRegValue: couldn't allocate paramPath\n")); diff --git a/reactos/drivers/storage/ide/uniata/id_dma.cpp b/reactos/drivers/storage/ide/uniata/id_dma.cpp index 1adeba6946c..2f04ff488f0 100644 --- a/reactos/drivers/storage/ide/uniata/id_dma.cpp +++ b/reactos/drivers/storage/ide/uniata/id_dma.cpp @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2002-2012 Alexander A. Telyatnikov (Alter) +Copyright (c) 2002-2014 Alexander A. Telyatnikov (Alter) Module Name: id_dma.cpp @@ -296,7 +296,7 @@ AtapiDmaSetup( KdPrint2((PRINT_PREFIX " get Phys(PRD=%x)\n", &(AtaReq->dma_tab) )); dma_base = AtapiVirtToPhysAddr(HwDeviceExtension, NULL, (PUCHAR)&(AtaReq->dma_tab) /*chan->dma_tab*/, &i, &dma_baseu); } - if(dma_baseu) { + if(dma_baseu && i) { KdPrint2((PRINT_PREFIX "AtapiDmaSetup: SRB built-in PRD above 4Gb: %8.8x%8.8x\n", dma_baseu, dma_base)); if(!deviceExtension->Host64) { dma_base = chan->DB_PRD_PhAddr; @@ -312,8 +312,8 @@ AtapiDmaSetup( KdPrint2((PRINT_PREFIX " get Phys(data[0]=%x)\n", data )); dma_base = AtapiVirtToPhysAddr(HwDeviceExtension, Srb, data, &dma_count, &dma_baseu); - if(dma_baseu) { - KdPrint2((PRINT_PREFIX "AtapiDmaSetup: 1st block of buffer above 4Gb: %8.8x%8.8x\n", dma_baseu, dma_base)); + if(dma_baseu && dma_count) { + KdPrint2((PRINT_PREFIX "AtapiDmaSetup: 1st block of buffer above 4Gb: %8.8x%8.8x cnt=%x\n", dma_baseu, dma_base, dma_count)); if(!deviceExtension->Host64) { retry_DB_IO: use_DB_IO = TRUE; @@ -378,8 +378,8 @@ retry_DB_IO: } KdPrint2((PRINT_PREFIX " get Phys(data[n=%d]=%x)\n", i, data )); dma_base = AtapiVirtToPhysAddr(HwDeviceExtension, Srb, data, &dma_count, &dma_baseu); - if(dma_baseu) { - KdPrint2((PRINT_PREFIX "AtapiDmaSetup: block of buffer above 4Gb: %8.8x%8.8x\n", dma_baseu, dma_base)); + if(dma_baseu && dma_count) { + KdPrint2((PRINT_PREFIX "AtapiDmaSetup: block of buffer above 4Gb: %8.8x%8.8x, cnt=%x\n", dma_baseu, dma_base, dma_count)); if(!deviceExtension->Host64) { if(use_DB_IO) { KdPrint2((PRINT_PREFIX "AtapiDmaSetup: *ERROR* special buffer above 4Gb: %8.8x%8.8x\n", dma_baseu, dma_base)); diff --git a/reactos/drivers/storage/ide/uniata/id_init.cpp b/reactos/drivers/storage/ide/uniata/id_init.cpp index e33f1683678..cb07c2915c2 100644 --- a/reactos/drivers/storage/ide/uniata/id_init.cpp +++ b/reactos/drivers/storage/ide/uniata/id_init.cpp @@ -43,6 +43,12 @@ Revision History: #include "stdafx.h" +static BUSMASTER_CONTROLLER_INFORMATION const AtiSouthAdapters[] = { + PCI_DEV_HW_SPEC_BM( 4385, 1002, 0x00, ATA_MODE_NOT_SPEC, "ATI South", 0 ), + PCI_DEV_HW_SPEC_BM( ffff, ffff, 0xff, BMLIST_TERMINATOR, NULL , BMLIST_TERMINATOR ) + }; + + BOOLEAN NTAPI UniataChipDetectChannels( @@ -54,7 +60,7 @@ UniataChipDetectChannels( { PHW_DEVICE_EXTENSION deviceExtension = (PHW_DEVICE_EXTENSION)HwDeviceExtension; //ULONG slotNumber = deviceExtension->slotNumber; - //ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; + ULONG SystemIoBusNumber = deviceExtension->SystemIoBusNumber; ULONG VendorID = deviceExtension->DevID & 0xffff; //ULONG DeviceID = (deviceExtension->DevID >> 16) & 0xffff; //ULONG RevID = deviceExtension->RevID; @@ -97,16 +103,26 @@ UniataChipDetectChannels( if(ChipType != PRMIO) { break; } - deviceExtension->NumberChannels = 4; - KdPrint2((PRINT_PREFIX "Promise 4 chan\n")); + if(!(ChipFlags & UNIATA_SATA)) { + deviceExtension->NumberChannels = 4; + KdPrint2((PRINT_PREFIX "Promise up to 4 chan\n")); + } else + if(ChipFlags & PRCMBO) { + deviceExtension->NumberChannels = 3; + KdPrint2((PRINT_PREFIX "Promise 3 chan\n")); + } else { + deviceExtension->NumberChannels = 4; + KdPrint2((PRINT_PREFIX "Promise 4 chan\n")); + } break; case ATA_MARVELL_ID: KdPrint2((PRINT_PREFIX "Marvell\n")); + /* AHCI part has own DevID-based workaround */ switch(deviceExtension->DevID) { case 0x610111ab: /* 88SX6101 only have 1 PATA channel */ if(BMList[deviceExtension->DevIndex].channel) { - KdPrint2((PRINT_PREFIX "88SX6101 has no 2nd PATA chan\n")); + KdPrint2((PRINT_PREFIX "88SX6101/11 has no 2nd PATA chan\n")); return FALSE; } deviceExtension->NumberChannels = 1; @@ -118,8 +134,8 @@ UniataChipDetectChannels( KdPrint2((PRINT_PREFIX "ATI\n")); switch(deviceExtension->DevID) { case ATA_ATI_IXP600: - case ATA_ATI_IXP700: - /* IXP600 & IXP700 only have 1 PATA channel */ + KdPrint2((PRINT_PREFIX " IXP600\n")); + /* IXP600 only have 1 PATA channel */ if(BMList[deviceExtension->DevIndex].channel) { KdPrint2((PRINT_PREFIX "New ATI no 2nd PATA chan\n")); return FALSE; @@ -127,6 +143,52 @@ UniataChipDetectChannels( deviceExtension->NumberChannels = 1; KdPrint2((PRINT_PREFIX "New ATI PATA 1 chan\n")); break; + + case ATA_ATI_IXP700: { + UCHAR satacfg = 0; + PCI_SLOT_NUMBER slotData; + ULONG i, slotNumber; + + KdPrint2((PRINT_PREFIX " IXP700\n")); + /* + * When "combined mode" is enabled, an additional PATA channel is + * emulated with two SATA ports and appears on this device. + * This mode can only be detected via SMB controller. + */ + i = AtapiFindListedDev((BUSMASTER_CONTROLLER_INFORMATION*)&AtiSouthAdapters[0], -1, HwDeviceExtension, SystemIoBusNumber, PCISLOTNUM_NOT_SPECIFIED, &slotData); + if(i != BMLIST_TERMINATOR) { + slotNumber = slotData.u.AsULONG; + + GetPciConfig1(0xad, satacfg); + KdPrint(("SATA controller %s (%s%s channel)\n", + (satacfg & 0x01) == 0 ? "disabled" : "enabled", + (satacfg & 0x08) == 0 ? "" : "combined mode, ", + (satacfg & 0x10) == 0 ? "primary" : "secondary")); + /* + * If SATA controller is enabled but combined mode is disabled, + * we have only one PATA channel. Ignore a non-existent channel. + */ + if ((satacfg & 0x09) == 0x01) { + if(BMList[deviceExtension->DevIndex].channel) { + KdPrint2((PRINT_PREFIX "New ATI no 2nd PATA chan\n")); + return FALSE; + } + deviceExtension->NumberChannels = 1; + KdPrint2((PRINT_PREFIX "New ATI PATA 1 chan\n")); + break; + } else { + KdPrint2((PRINT_PREFIX "New ATI 2 chan\n")); + deviceExtension->NumberChannels = 2; + /* + if (BMList[deviceExtension->DevIndex].channel != ((satacfg & 0x10) >> 4)) { + ; + } + */ + + } + } + + break; } } /* FALLTHROUGH */ case ATA_SILICON_IMAGE_ID: @@ -241,6 +303,7 @@ UniataChipDetect( ULONG BaseIoAddress2; ULONG BaseIoAddressBM; BOOLEAN MemIo = FALSE; + BOOLEAN IsPata = FALSE; KdPrint2((PRINT_PREFIX "UniataChipDetect:\n" )); KdPrint2((PRINT_PREFIX "HwFlags: %#x\n", deviceExtension->HwFlags)); @@ -292,6 +355,9 @@ unknown_dev: } static BUSMASTER_CONTROLLER_INFORMATION const SiSAdapters[] = { + PCI_DEV_HW_SPEC_BM( 1183, 1039, 0x00, ATA_UDMA6, "SiS 1183" , SIS133NEW), + PCI_DEV_HW_SPEC_BM( 1182, 1039, 0x00, ATA_SA150, "SiS 1182" , SISSATA | UNIATA_SATA), + PCI_DEV_HW_SPEC_BM( 0183, 1039, 0x00, ATA_SA150, "SiS 183" , SISSATA | UNIATA_SATA), PCI_DEV_HW_SPEC_BM( 0182, 1039, 0x00, ATA_SA150, "SiS 182" , SISSATA | UNIATA_SATA), PCI_DEV_HW_SPEC_BM( 0181, 1039, 0x00, ATA_SA150, "SiS 181" , SISSATA | UNIATA_SATA), PCI_DEV_HW_SPEC_BM( 0180, 1039, 0x00, ATA_SA150, "SiS 180" , SISSATA | UNIATA_SATA), @@ -371,6 +437,10 @@ unknown_dev: switch(VendorID) { case ATA_SIS_ID: + /* + We shall get here for all SIS controllers, even unlisted. + Then perform bus scan to find SIS bridge and decide what to do with controller + */ KdPrint2((PRINT_PREFIX "ATA_SIS_ID\n")); DevTypeInfo = (BUSMASTER_CONTROLLER_INFORMATION*)&SiSAdapters[0]; i = AtapiFindListedDev(DevTypeInfo, -1, HwDeviceExtension, SystemIoBusNumber, PCISLOTNUM_NOT_SPECIFIED, NULL); @@ -505,6 +575,7 @@ for_ugly_chips: if(deviceExtension->MaxTransferMode >= ATA_SA150) { deviceExtension->HwFlags |= UNIATA_SATA; } + /* ConfigInfo->MaximumTransferLength = DEV_BSIZE*256; deviceExtension->MaximumDmaTransferLength = ConfigInfo->MaximumTransferLength; @@ -512,6 +583,25 @@ for_ugly_chips: ChipType = deviceExtension->HwFlags & CHIPTYPE_MASK; ChipFlags = deviceExtension->HwFlags & CHIPFLAG_MASK; + /* for even more ugly AHCI-capable chips */ + if(ChipFlags & UNIATA_AHCI) { + /* + Seems, some chips may have inoperable/alternative BAR5 in SATA mode + This can be detected via PCI SubClass + */ + switch(VendorID) { + case ATA_NVIDIA_ID: + case ATA_ATI_ID: + KdPrint2((PRINT_PREFIX "ATA_xxx_ID check AHCI subclass\n")); + if((pciData)->SubClass == PCI_DEV_SUBCLASS_IDE) { + KdPrint2((PRINT_PREFIX "Non-AHCI mode\n")); + ChipFlags &= ~UNIATA_AHCI; + deviceExtension->HwFlags &= ~UNIATA_AHCI; + } + break; + } + } + if(ChipFlags & UNIATA_AHCI) { deviceExtension->NumberChannels = 0; if(!UniataAhciDetect(HwDeviceExtension, pciData, ConfigInfo)) { @@ -527,9 +617,6 @@ for_ugly_chips: return STATUS_UNSUCCESSFUL; } - if(ChipFlags & UNIATA_AHCI) { - } - switch(VendorID) { case ATA_ACER_LABS_ID: if(ChipFlags & UNIATA_SATA) { @@ -571,6 +658,9 @@ for_ugly_chips: BaseMemAddress = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData, SystemIoBusNumber, 5, 0, ((ChipFlags & NV4OFF) ? 0x400 : 0) + 0x40*2); KdPrint2((PRINT_PREFIX "BaseMemAddress %x\n", BaseMemAddress)); + if(!BaseMemAddress) { + return STATUS_UNSUCCESSFUL; + } if((*ConfigInfo->AccessRanges)[5].RangeInMemory) { KdPrint2((PRINT_PREFIX "MemIo\n")); MemIo = TRUE; @@ -600,26 +690,57 @@ for_ugly_chips: break; } deviceExtension->AltRegMap = TRUE; // inform generic resource allocator + + /* BAR4 -> res1 */ BaseMemAddress = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData, SystemIoBusNumber, 4, 0, 0x4000); - KdPrint2((PRINT_PREFIX "BaseMemAddress %x\n", BaseMemAddress)); + KdPrint2((PRINT_PREFIX "BaseMemAddress[4] %x\n", BaseMemAddress)); + if(!BaseMemAddress) { + return STATUS_UNSUCCESSFUL; + } if((*ConfigInfo->AccessRanges)[4].RangeInMemory) { KdPrint2((PRINT_PREFIX "MemIo\n")); MemIo = TRUE; } + deviceExtension->BaseIoAddressSATA_0.Addr = BaseMemAddress; + deviceExtension->BaseIoAddressSATA_0.MemIo = MemIo; + + /* BAR3 -> res2 */ + BaseMemAddress = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData, SystemIoBusNumber, + 3, 0, 0xd0000); + KdPrint2((PRINT_PREFIX "BaseMemAddress[3] %x\n", BaseMemAddress)); + if(!BaseMemAddress) { + return STATUS_UNSUCCESSFUL; + } + if((*ConfigInfo->AccessRanges)[3].RangeInMemory) { + KdPrint2((PRINT_PREFIX "MemIo\n")); + MemIo = TRUE; + } deviceExtension->BaseIoAddressBM_0.Addr = BaseMemAddress; deviceExtension->BaseIoAddressBM_0.MemIo = MemIo; + + if(!(ChipFlags & UNIATA_SATA)) { + UCHAR reg48; + + reg48 = AtapiReadPortEx1(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressSATA_0),0x48); + deviceExtension->NumberChannels = ((reg48 & 0x01) ? 1 : 0) + + ((reg48 & 0x02) ? 1 : 0) + + 2; + KdPrint2((PRINT_PREFIX "Channels -> %d\n", deviceExtension->NumberChannels)); + } + for(c=0; cNumberChannels; c++) { - ULONG offs12, offs7; + /* res2-based */ + ULONG offs8, offs7; chan = &deviceExtension->chan[c]; - offs12 = c << 12; - offs7 = c << 7; + offs8 = c << 8; + offs7 = c << 7; for (i=0; i<=IDX_IO1_SZ; i++) { - chan->RegTranslation[IDX_IO1+i].Addr = BaseMemAddress + 0x200 + (i << 2) + offs12; + chan->RegTranslation[IDX_IO1+i].Addr = BaseMemAddress + 0x200 + (i << 2) + offs7; chan->RegTranslation[IDX_IO1+i].MemIo = MemIo; } chan->RegTranslation[IDX_IO2_AltStatus].Addr = BaseMemAddress + 0x238 + offs7; @@ -633,11 +754,37 @@ for_ugly_chips: chan->RegTranslation[IDX_BM_PRD_Table].MemIo = MemIo; chan->RegTranslation[IDX_BM_DeviceSpecific0].Addr = BaseMemAddress + (c << 2); chan->RegTranslation[IDX_BM_DeviceSpecific0].MemIo = MemIo; + + if((ChipFlags & PRSATA) || + ((ChipFlags & PRCMBO) && c<2)) { + KdPrint2((PRINT_PREFIX "Promise SATA\n")); + + chan->RegTranslation[IDX_SATA_SStatus].Addr = BaseMemAddress + 0x400 + offs7; + chan->RegTranslation[IDX_SATA_SStatus].MemIo = MemIo; + chan->RegTranslation[IDX_SATA_SError].Addr = BaseMemAddress + 0x404 + offs7; + chan->RegTranslation[IDX_SATA_SError].MemIo = MemIo; + chan->RegTranslation[IDX_SATA_SControl].Addr = BaseMemAddress + 0x408 + offs7; + chan->RegTranslation[IDX_SATA_SControl].MemIo = MemIo; + + chan->ChannelCtrlFlags |= CTRFLAGS_NO_SLAVE; + } else { + KdPrint2((PRINT_PREFIX "Promise PATA\n")); + chan->MaxTransferMode = min(deviceExtension->MaxTransferMode, ATA_UDMA6); + } } break; case ATA_ATI_ID: KdPrint2((PRINT_PREFIX "ATI\n")); + if(ChipType == ATI700) { + KdPrint2((PRINT_PREFIX "ATI700\n")); + if(!(ChipFlags & UNIATA_AHCI)) { + KdPrint2((PRINT_PREFIX "IXP700 PATA\n")); + chan = &deviceExtension->chan[0]; + chan->MaxTransferMode = min(deviceExtension->MaxTransferMode, ATA_UDMA5); + } + break; + } /* FALLTHROUGH */ case ATA_SILICON_IMAGE_ID: { @@ -661,6 +808,9 @@ for_ugly_chips: BaseMemAddress = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData, SystemIoBusNumber, 5, 0, 0x800); KdPrint2((PRINT_PREFIX "BaseMemAddress %x\n", BaseMemAddress)); + if(!BaseMemAddress) { + return STATUS_UNSUCCESSFUL; + } if((*ConfigInfo->AccessRanges)[5].RangeInMemory) { KdPrint2((PRINT_PREFIX "MemIo\n")); MemIo = TRUE; @@ -697,6 +847,10 @@ for_ugly_chips: chan->RegTranslation[IDX_BM_DeviceSpecific1].MemIo = MemIo; } + if(chan->MaxTransferMode < ATA_SA150) { + // do nothing for PATA part + KdPrint2((PRINT_PREFIX "No SATA regs for PATA part\n")); + } else if(ChipFlags & UNIATA_SATA) { chan->RegTranslation[IDX_SATA_SStatus].Addr = BaseMemAddress + 0x104 + (unit01 << 7) + (unit10 << 8); chan->RegTranslation[IDX_SATA_SStatus].MemIo = MemIo; @@ -725,6 +879,9 @@ for_ugly_chips: BaseMemAddress = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData, SystemIoBusNumber, 5, 0, 0x400); KdPrint2((PRINT_PREFIX "BaseMemAddress %x\n", BaseMemAddress)); + if(!BaseMemAddress) { + return STATUS_UNSUCCESSFUL; + } if((*ConfigInfo->AccessRanges)[5].RangeInMemory) { KdPrint2((PRINT_PREFIX "MemIo\n")); MemIo = TRUE; @@ -802,7 +959,8 @@ for_ugly_chips: //deviceExtension->MaxTransferMode = SiSSouthAdapters[i].MaxTransferMode; if(SiSSouthAdapters[i].RaidFlags & UNIATA_SATA) { deviceExtension->HwFlags |= UNIATA_SATA; - if(SiSSouthAdapters[i].nDeviceId == 0x1182) { + if(SiSSouthAdapters[i].nDeviceId == 0x1182 || + SiSSouthAdapters[i].nDeviceId == 0x1183) { SIS_182 = TRUE; } } @@ -827,25 +985,27 @@ for_ugly_chips: BaseMemAddress = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData, SystemIoBusNumber, 5, 0, 0x400); KdPrint2((PRINT_PREFIX "BaseMemAddress %x\n", BaseMemAddress)); - if((*ConfigInfo->AccessRanges)[5].RangeInMemory) { - KdPrint2((PRINT_PREFIX "MemIo\n")); - MemIo = TRUE; - } - deviceExtension->BaseIoAddressSATA_0.Addr = BaseMemAddress; - deviceExtension->BaseIoAddressSATA_0.MemIo = MemIo; + if(BaseMemAddress) { + if((*ConfigInfo->AccessRanges)[5].RangeInMemory) { + KdPrint2((PRINT_PREFIX "MemIo\n")); + MemIo = TRUE; + } + deviceExtension->BaseIoAddressSATA_0.Addr = BaseMemAddress; + deviceExtension->BaseIoAddressSATA_0.MemIo = MemIo; - for(c=0; cNumberChannels; c++) { - ULONG offs = c << (SIS_182 ? 5 : 6); + for(c=0; cNumberChannels; c++) { + ULONG offs = c << (SIS_182 ? 5 : 6); - chan = &deviceExtension->chan[c]; - chan->RegTranslation[IDX_SATA_SStatus].Addr = BaseMemAddress + 0 + offs; - chan->RegTranslation[IDX_SATA_SStatus].MemIo = MemIo; - chan->RegTranslation[IDX_SATA_SError].Addr = BaseMemAddress + 4 + offs; - chan->RegTranslation[IDX_SATA_SError].MemIo = MemIo; - chan->RegTranslation[IDX_SATA_SControl].Addr = BaseMemAddress + 8 + offs; - chan->RegTranslation[IDX_SATA_SControl].MemIo = MemIo; + chan = &deviceExtension->chan[c]; + chan->RegTranslation[IDX_SATA_SStatus].Addr = BaseMemAddress + 0 + offs; + chan->RegTranslation[IDX_SATA_SStatus].MemIo = MemIo; + chan->RegTranslation[IDX_SATA_SError].Addr = BaseMemAddress + 4 + offs; + chan->RegTranslation[IDX_SATA_SError].MemIo = MemIo; + chan->RegTranslation[IDX_SATA_SControl].Addr = BaseMemAddress + 8 + offs; + chan->RegTranslation[IDX_SATA_SControl].MemIo = MemIo; - chan->ChannelCtrlFlags |= CTRFLAGS_NO_SLAVE; + chan->ChannelCtrlFlags |= CTRFLAGS_NO_SLAVE; + } } } } @@ -941,7 +1101,6 @@ for_ugly_chips: break; } case ATA_INTEL_ID: { - BOOLEAN IsPata; if(!(ChipFlags & UNIATA_SATA)) { break; } @@ -953,6 +1112,9 @@ for_ugly_chips: KdPrint2((PRINT_PREFIX "UniataChipDetect: Intel 31244, DPA mode\n")); BaseMemAddress = AtapiGetIoRange(HwDeviceExtension, ConfigInfo, pciData, SystemIoBusNumber, 0, 0, 0x0c00); + if(!BaseMemAddress) { + return STATUS_UNSUCCESSFUL; + } if((*ConfigInfo->AccessRanges)[0].RangeInMemory) { KdPrint2((PRINT_PREFIX "MemIo\n")); MemIo = TRUE; @@ -1527,7 +1689,7 @@ UniAtaReadLunConfig( memcpy(LunExt->IdentifyData.FirmwareRevision, ".10", 4); if(!LunExt->IdentifyData.SectorsPerTrack || !LunExt->IdentifyData.NumberOfCylinders || - !LunExt->IdentifyData.SectorsPerTrack) { + !LunExt->IdentifyData.NumberOfHeads) { // ERROR KdPrint2((PRINT_PREFIX "Wrong CHS\n")); LunExt->opt_GeomType = GEOM_AUTO; @@ -2037,8 +2199,13 @@ AtapiChipInit( break; case PRMIO: if(c == CHAN_NOT_SPECIFIED) { - if(ChipFlags & PRSATA) { - AtapiWritePortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0),0x6c, 0x000000ff); + /* clear SATA status and unmask interrupts */ + AtapiWritePortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0), + (ChipFlags & PRG2) ? 0x60 : 0x6c, 0x000000ff); + if(ChipFlags & UNIATA_SATA) { + /* enable "long burst length" on gen2 chips */ + AtapiWritePortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0), 0x44, + AtapiReadPortEx4(NULL, (ULONGIO_PTR)(&deviceExtension->BaseIoAddressBM_0), 0x44) | 0x2000); } } else { chan = &deviceExtension->chan[c]; @@ -2072,6 +2239,7 @@ AtapiChipInit( KdPrint2((PRINT_PREFIX "ATI\n")); break; } + /* FALLTHROUGH */ case ATA_SILICON_IMAGE_ID: /* if(ChipFlags & SIIENINTR) { SetPciConfig1(0x71, 0x01); @@ -2190,7 +2358,15 @@ AtapiChipInit( } break; } - } + case ATI700: + KdPrint2((PRINT_PREFIX "ATI700\n")); + if(c == 0 && !(ChipFlags & UNIATA_AHCI)) { + KdPrint2((PRINT_PREFIX "IXP700 PATA\n")); + chan = &deviceExtension->chan[c]; + chan->MaxTransferMode = min(deviceExtension->MaxTransferMode, ATA_UDMA5); + } + break; + } /* switch(ChipType) */ break; case ATA_SIS_ID: if(c == CHAN_NOT_SPECIFIED) { @@ -2211,6 +2387,7 @@ AtapiChipInit( break; case SISSATA: ChangePciConfig2(0x04, (a & ~0x0400)); + break; } } if(ChipType == SIS133NEW) { diff --git a/reactos/drivers/storage/ide/uniata/id_sata.cpp b/reactos/drivers/storage/ide/uniata/id_sata.cpp index 649b62cea5d..9996852d55c 100644 --- a/reactos/drivers/storage/ide/uniata/id_sata.cpp +++ b/reactos/drivers/storage/ide/uniata/id_sata.cpp @@ -1,6 +1,6 @@ /*++ -Copyright (c) 2008-2012 Alexandr A. Telyatnikov (Alter) +Copyright (c) 2008-2014 Alexandr A. Telyatnikov (Alter) Module Name: id_probe.cpp @@ -649,6 +649,8 @@ UniataAhciInit( ULONG PI; #endif //DBG ULONG CAP; + ULONG CAP2; + ULONG BOHC; ULONG GHC; BOOLEAN MemIo = FALSE; @@ -658,6 +660,37 @@ UniataAhciInit( UniataDumpAhciRegs(deviceExtension); #endif //DBG + CAP2 = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_CAP2); + if(CAP2 & AHCI_CAP2_BOH) { + BOHC = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_BOHC); + KdPrint2((PRINT_PREFIX " stage 1 BOHC %#x\n", BOHC)); + UniataAhciWriteHostPort4(deviceExtension, IDX_AHCI_BOHC, + BOHC | AHCI_BOHC_OOS); + for(i=0; i<50; i++) { + AtapiStallExecution(500); + BOHC = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_BOHC); + KdPrint2((PRINT_PREFIX " BOHC %#x\n", BOHC)); + if(BOHC & AHCI_BOHC_BB) { + break; + } + if(!(BOHC & AHCI_BOHC_BOS)) { + break; + } + } + KdPrint2((PRINT_PREFIX " stage 2 BOHC %#x\n", BOHC)); + if(BOHC & AHCI_BOHC_BB) { + for(i=0; i<2000; i++) { + AtapiStallExecution(1000); + BOHC = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_BOHC); + KdPrint2((PRINT_PREFIX " BOHC %#x\n", BOHC)); + if(!(BOHC & AHCI_BOHC_BOS)) { + break; + } + } + } + KdPrint2((PRINT_PREFIX " final BOHC %#x\n", BOHC)); + } + /* disable AHCI interrupts, for MSI compatibility issue see http://www.intel.com/Assets/PDF/specupdate/307014.pdf 26. AHCI Reset and MSI Request @@ -729,7 +762,14 @@ UniataAhciInit( PI = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_PI); KdPrint2((PRINT_PREFIX " AHCI PI %#x\n", PI)); #endif //DBG - + CAP2 = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_CAP2); + if(CAP2 & AHCI_CAP2_BOH) { + KdPrint2((PRINT_PREFIX " retry BOHC\n")); + BOHC = UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_BOHC); + KdPrint2((PRINT_PREFIX " BOHC %#x\n", BOHC)); + UniataAhciWriteHostPort4(deviceExtension, IDX_AHCI_BOHC, + BOHC | AHCI_BOHC_OOS); + } /* clear interrupts */ UniataAhciWriteHostPort4(deviceExtension, IDX_AHCI_IS, UniataAhciReadHostPort4(deviceExtension, IDX_AHCI_IS)); @@ -1061,6 +1101,7 @@ UniataAhciStatus( } chan->AhciCompleteCI = (chan->AhciPrevCI ^ CI) & chan->AhciPrevCI; // only 1->0 states chan->AhciPrevCI = CI; + chan->AhciLastSError = SError.Reg; KdPrint((" AHCI: complete mask %#x\n", chan->AhciCompleteCI)); chan->AhciLastIS = IS.Reg; if(CI & (1 << tag)) { diff --git a/reactos/drivers/storage/ide/uniata/uniata_ver.h b/reactos/drivers/storage/ide/uniata/uniata_ver.h index 7352f7ba1bb..496c1d7d5d8 100644 --- a/reactos/drivers/storage/ide/uniata/uniata_ver.h +++ b/reactos/drivers/storage/ide/uniata/uniata_ver.h @@ -1,10 +1,10 @@ -#define UNIATA_VER_STR "44b1" -#define UNIATA_VER_DOT 0.44.2.1 +#define UNIATA_VER_STR "45a3" +#define UNIATA_VER_DOT 0.45.1.3 #define UNIATA_VER_MJ 0 -#define UNIATA_VER_MN 44 -#define UNIATA_VER_SUB_MJ 2 -#define UNIATA_VER_SUB_MN 1 -#define UNIATA_VER_DOT_COMMA 0,44,2,1 -#define UNIATA_VER_DOT_STR "0.44.2.1" -#define UNIATA_VER_YEAR 2013 -#define UNIATA_VER_YEAR_STR "2013" +#define UNIATA_VER_MN 45 +#define UNIATA_VER_SUB_MJ 1 +#define UNIATA_VER_SUB_MN 3 +#define UNIATA_VER_DOT_COMMA 0,45,1,3 +#define UNIATA_VER_DOT_STR "0.45.1.3" +#define UNIATA_VER_YEAR 2014 +#define UNIATA_VER_YEAR_STR "2014" From fa3242a619ac28864f02568dd732646db5503300 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Fri, 14 Mar 2014 02:39:18 +0000 Subject: [PATCH 104/419] [Win32k] - Patch by Maxim Andreyanov : CreateWindowEx have to set error when menu handle is invalid. - See CORE-7980. svn path=/trunk/; revision=62494 --- reactos/win32ss/user/ntuser/object.c | 41 ++++++++++++++++++++++++++++ reactos/win32ss/user/ntuser/object.h | 1 + reactos/win32ss/user/ntuser/window.c | 10 +++++++ 3 files changed, 52 insertions(+) diff --git a/reactos/win32ss/user/ntuser/object.c b/reactos/win32ss/user/ntuser/object.c index 363e175a28f..4f7f1da4257 100644 --- a/reactos/win32ss/user/ntuser/object.c +++ b/reactos/win32ss/user/ntuser/object.c @@ -554,6 +554,47 @@ HANDLE FASTCALL ValidateHandleNoErr(HANDLE handle, HANDLE_TYPE type) if (handle) return (PWND)UserGetObjectNoErr(gHandleTable, handle, type); return NULL; } + +PVOID FASTCALL ValidateHandle(HANDLE handle, HANDLE_TYPE type) +{ + PVOID pObj; + DWORD dwError = 0; + if (handle) + { + pObj = UserGetObjectNoErr(gHandleTable, handle, type); + if (!pObj) + { + switch (type) + { + case TYPE_WINDOW: + dwError = ERROR_INVALID_WINDOW_HANDLE; + break; + case TYPE_MENU: + dwError = ERROR_INVALID_MENU_HANDLE; + break; + case TYPE_CURSOR: + dwError = ERROR_INVALID_CURSOR_HANDLE; + break; + case TYPE_SETWINDOWPOS: + dwError = ERROR_INVALID_DWP_HANDLE; + break; + case TYPE_HOOK: + dwError = ERROR_INVALID_HOOK_HANDLE; + break; + case TYPE_ACCELTABLE: + dwError = ERROR_INVALID_ACCEL_HANDLE; + break; + default: + dwError = ERROR_INVALID_HANDLE; + break; + } + EngSetLastError(dwError); + return NULL; + } + return pObj; + } + return NULL; +} /* * NtUserValidateHandleSecure diff --git a/reactos/win32ss/user/ntuser/object.h b/reactos/win32ss/user/ntuser/object.h index bbfbde686d2..f305633dea2 100644 --- a/reactos/win32ss/user/ntuser/object.h +++ b/reactos/win32ss/user/ntuser/object.h @@ -19,6 +19,7 @@ BOOL FASTCALL UserObjectInDestroy(HANDLE); void DbgUserDumpHandleTable(); VOID FASTCALL UserSetObjectOwner(PVOID obj, HANDLE_TYPE type, PVOID owner); HANDLE FASTCALL ValidateHandleNoErr(HANDLE handle, HANDLE_TYPE type); +PVOID FASTCALL ValidateHandle(HANDLE handle, HANDLE_TYPE type); static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry) diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index 90382406243..11915109217 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -2571,6 +2571,16 @@ NtUserCreateWindowEx( ASSERT(plstrWindowName); + if ( (dwStyle & (WS_POPUP|WS_CHILD)) != WS_CHILD) + { + /* check hMenu is valid handle */ + if (hMenu && !ValidateHandle(hMenu, TYPE_MENU)) + { + /* error is set in ValidateHandle */ + return NULL; + } + } + /* Copy the window name to kernel mode */ Status = ProbeAndCaptureLargeString(&lstrWindowName, plstrWindowName); if (!NT_SUCCESS(Status)) From f78a04d72009b059aa92ba1900f8394301f0077f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 14 Mar 2014 20:59:02 +0000 Subject: [PATCH 105/419] [CARDS]: Code formatting only (tabs --> spaces). svn path=/trunk/; revision=62496 --- reactos/dll/win32/cards/cards.c | 269 ++++++++++++++++---------------- reactos/dll/win32/cards/cards.h | 36 ++--- 2 files changed, 153 insertions(+), 152 deletions(-) diff --git a/reactos/dll/win32/cards/cards.c b/reactos/dll/win32/cards/cards.c index 20de5a754b8..05ff746992a 100644 --- a/reactos/dll/win32/cards/cards.c +++ b/reactos/dll/win32/cards/cards.c @@ -1,7 +1,7 @@ /* - * ReactOS Cards + * ReactOS Cards * - * Copyright (C) 2003 Filip Navara + * Copyright (C) 2003 Filip Navara * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,8 +33,8 @@ HINSTANCE g_hModule = 0; */ BOOL WINAPI WEP(DWORD Unknown) { - UNREFERENCED_PARAMETER(Unknown); - return TRUE; + UNREFERENCED_PARAMETER(Unknown); + return TRUE; } /* @@ -45,15 +45,15 @@ BOOL WINAPI cdtInit(INT *Width, INT *Height) DWORD dwIndex; /* Report card width and height to user */ - *Width = CARD_WIDTH; - *Height = CARD_HEIGHT; + *Width = CARD_WIDTH; + *Height = CARD_HEIGHT; - /* Load images */ - for (dwIndex = 0; dwIndex < MAX_CARD_BITMAPS; ++dwIndex) - g_CardBitmaps[dwIndex] = - (HBITMAP)LoadBitmapA(g_hModule, MAKEINTRESOURCEA(dwIndex + 1)); + /* Load images */ + for (dwIndex = 0; dwIndex < MAX_CARD_BITMAPS; ++dwIndex) + g_CardBitmaps[dwIndex] = + (HBITMAP)LoadBitmapA(g_hModule, MAKEINTRESOURCEA(dwIndex + 1)); - return TRUE; + return TRUE; } /* @@ -64,8 +64,8 @@ VOID WINAPI cdtTerm(VOID) DWORD dwIndex; /* Unload images */ - for (dwIndex = 0; dwIndex < MAX_CARD_BITMAPS; dwIndex++) - DeleteObject(g_CardBitmaps[dwIndex]); + for (dwIndex = 0; dwIndex < MAX_CARD_BITMAPS; dwIndex++) + DeleteObject(g_CardBitmaps[dwIndex]); } /* @@ -73,7 +73,7 @@ VOID WINAPI cdtTerm(VOID) */ BOOL WINAPI cdtDraw(HDC hdc, INT x, INT y, INT card, INT type, COLORREF color) { - return cdtDrawExt(hdc, x, y, CARD_WIDTH, CARD_HEIGHT, card, type, color); + return cdtDrawExt(hdc, x, y, CARD_WIDTH, CARD_HEIGHT, card, type, color); } /* @@ -81,30 +81,31 @@ BOOL WINAPI cdtDraw(HDC hdc, INT x, INT y, INT card, INT type, COLORREF color) */ static __inline VOID BltCard(HDC hdc, INT x, INT y, INT dx, INT dy, HDC hdcCard, DWORD dwRasterOp, BOOL bStretch) { - if (bStretch) - { - StretchBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, CARD_WIDTH, CARD_HEIGHT, dwRasterOp); - } else - { - BitBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, dwRasterOp); + if (bStretch) + { + StretchBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, CARD_WIDTH, CARD_HEIGHT, dwRasterOp); + } + else + { + BitBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, dwRasterOp); /* * This is need when using Microsoft images, because they use two-color red/white images for * red cards and thus needs fix-up of the edge to black color. */ #if 0 - if (ISREDCARD(card)) - { - PatBlt(hdc, x, y + 2, 1, dy - 4, BLACKNESS); - PatBlt(hdc, x + dx - 1, y + 2, 1, dy - 4, BLACKNESS); - PatBlt(hdc, x + 2, y, dx - 4, 1, BLACKNESS); - PatBlt(hdc, x + 2, y + dy - 1, dx - 4, 1, BLACKNESS); - SetPixel(hdc, x + 1, y + 1, 0); - SetPixel(hdc, x + dx - 2, y + 1, 0); - SetPixel(hdc, x + 1, y + dy - 2, 0); - SetPixel(hdc, x + dx - 2, y + dy - 2, 0); - } + if (ISREDCARD(card)) + { + PatBlt(hdc, x, y + 2, 1, dy - 4, BLACKNESS); + PatBlt(hdc, x + dx - 1, y + 2, 1, dy - 4, BLACKNESS); + PatBlt(hdc, x + 2, y, dx - 4, 1, BLACKNESS); + PatBlt(hdc, x + 2, y + dy - 1, dx - 4, 1, BLACKNESS); + SetPixel(hdc, x + 1, y + 1, 0); + SetPixel(hdc, x + dx - 2, y + 1, 0); + SetPixel(hdc, x + 1, y + dy - 2, 0); + SetPixel(hdc, x + dx - 2, y + dy - 2, 0); + } #endif - } + } } /* @@ -122,106 +123,106 @@ static __inline VOID BltCard(HDC hdc, INT x, INT y, INT dx, INT dy, HDC hdcCard, */ BOOL WINAPI cdtDrawExt(HDC hdc, INT x, INT y, INT dx, INT dy, INT card, INT type, COLORREF color) { - HDC hdcCard; - DWORD dwRasterOp = SRCCOPY, OldBkColor; - BOOL bSaveEdges = TRUE; - BOOL bStretch = FALSE; + HDC hdcCard; + DWORD dwRasterOp = SRCCOPY, OldBkColor; + BOOL bSaveEdges = TRUE; + BOOL bStretch = FALSE; - if (type & ectSAVEEDGESMASK) - { - type &= ~ectSAVEEDGESMASK; - bSaveEdges = FALSE; - } + if (type & ectSAVEEDGESMASK) + { + type &= ~ectSAVEEDGESMASK; + bSaveEdges = FALSE; + } - if (dx != CARD_WIDTH || dy != CARD_HEIGHT) - { - bStretch = TRUE; - bSaveEdges = FALSE; - } + if (dx != CARD_WIDTH || dy != CARD_HEIGHT) + { + bStretch = TRUE; + bSaveEdges = FALSE; + } - switch (type) - { - case ectINVERTED: - dwRasterOp = NOTSRCCOPY; - case ectFACES: - card = (card % 4) * 13 + (card / 4); - break; - case ectBACKS: - --card; - break; - case ectEMPTYNOBG: - dwRasterOp = SRCAND; - case ectEMPTY: - card = 52; - break; - case ectERASE: - break; - case ectREDX: - card = 66; - break; - case ectGREENO: - card = 67; - break; - default: - return FALSE; - } + switch (type) + { + case ectINVERTED: + dwRasterOp = NOTSRCCOPY; + case ectFACES: + card = (card % 4) * 13 + (card / 4); + break; + case ectBACKS: + --card; + break; + case ectEMPTYNOBG: + dwRasterOp = SRCAND; + case ectEMPTY: + card = 52; + break; + case ectERASE: + break; + case ectREDX: + card = 66; + break; + case ectGREENO: + card = 67; + break; + default: + return FALSE; + } - if (type == ectEMPTY || type == ectERASE) - { - POINT pPoint; - HBRUSH hBrush; + if (type == ectEMPTY || type == ectERASE) + { + POINT pPoint; + HBRUSH hBrush; - hBrush = CreateSolidBrush(color); - GetDCOrgEx(hdc, &pPoint); - SetBrushOrgEx(hdc, pPoint.x, pPoint.y, 0); - SelectObject(hdc, hBrush); - PatBlt(hdc, x, y, dx, dy, PATCOPY); - } - if (type != ectERASE) - { - hdcCard = CreateCompatibleDC(hdc); - SelectObject(hdcCard, g_CardBitmaps[card]); - OldBkColor = SetBkColor(hdc, (type == ectFACES) ? 0xFFFFFF : color); - if (bSaveEdges) - { - COLORREF SavedPixels[12]; - SavedPixels[0] = GetPixel(hdc, x, y); - SavedPixels[1] = GetPixel(hdc, x + 1, y); - SavedPixels[2] = GetPixel(hdc, x, y + 1); - SavedPixels[3] = GetPixel(hdc, x + dx - 1, y); - SavedPixels[4] = GetPixel(hdc, x + dx - 2, y); - SavedPixels[5] = GetPixel(hdc, x + dx - 1, y + 1); - SavedPixels[6] = GetPixel(hdc, x, y + dy - 1); - SavedPixels[7] = GetPixel(hdc, x + 1, y + dy - 1); - SavedPixels[8] = GetPixel(hdc, x, y + dy - 2); - SavedPixels[9] = GetPixel(hdc, x + dx - 1, y + dy - 1); - SavedPixels[10] = GetPixel(hdc, x + dx - 2, y + dy - 1); - SavedPixels[11] = GetPixel(hdc, x + dx - 1, y + dy - 2); + hBrush = CreateSolidBrush(color); + GetDCOrgEx(hdc, &pPoint); + SetBrushOrgEx(hdc, pPoint.x, pPoint.y, 0); + SelectObject(hdc, hBrush); + PatBlt(hdc, x, y, dx, dy, PATCOPY); + } + if (type != ectERASE) + { + hdcCard = CreateCompatibleDC(hdc); + SelectObject(hdcCard, g_CardBitmaps[card]); + OldBkColor = SetBkColor(hdc, (type == ectFACES) ? 0xFFFFFF : color); + if (bSaveEdges) + { + COLORREF SavedPixels[12]; + SavedPixels[0] = GetPixel(hdc, x, y); + SavedPixels[1] = GetPixel(hdc, x + 1, y); + SavedPixels[2] = GetPixel(hdc, x, y + 1); + SavedPixels[3] = GetPixel(hdc, x + dx - 1, y); + SavedPixels[4] = GetPixel(hdc, x + dx - 2, y); + SavedPixels[5] = GetPixel(hdc, x + dx - 1, y + 1); + SavedPixels[6] = GetPixel(hdc, x, y + dy - 1); + SavedPixels[7] = GetPixel(hdc, x + 1, y + dy - 1); + SavedPixels[8] = GetPixel(hdc, x, y + dy - 2); + SavedPixels[9] = GetPixel(hdc, x + dx - 1, y + dy - 1); + SavedPixels[10] = GetPixel(hdc, x + dx - 2, y + dy - 1); + SavedPixels[11] = GetPixel(hdc, x + dx - 1, y + dy - 2); - BltCard(hdc, x, y, dx, dy, hdcCard, dwRasterOp, bStretch); + BltCard(hdc, x, y, dx, dy, hdcCard, dwRasterOp, bStretch); - SetPixel(hdc, x, y, SavedPixels[0]); - SetPixel(hdc, x + 1, y, SavedPixels[1]); - SetPixel(hdc, x, y + 1, SavedPixels[2]); - SetPixel(hdc, x + dx - 1, y, SavedPixels[3]); - SetPixel(hdc, x + dx - 2, y, SavedPixels[4]); - SetPixel(hdc, x + dx - 1, y + 1, SavedPixels[5]); - SetPixel(hdc, x, y + dy - 1, SavedPixels[6]); - SetPixel(hdc, x + 1, y + dy - 1, SavedPixels[7]); - SetPixel(hdc, x, y + dy - 2, SavedPixels[8]); - SetPixel(hdc, x + dx - 1, y + dy - 1, SavedPixels[9]); - SetPixel(hdc, x + dx - 2, y + dy - 1, SavedPixels[10]); - SetPixel(hdc, x + dx - 1, y + dy - 2, SavedPixels[11]); - } - else - { - BltCard(hdc, x, y, dx, dy, hdcCard, dwRasterOp, bStretch); - } - SetBkColor(hdc, OldBkColor); - DeleteDC(hdcCard); - } + SetPixel(hdc, x, y, SavedPixels[0]); + SetPixel(hdc, x + 1, y, SavedPixels[1]); + SetPixel(hdc, x, y + 1, SavedPixels[2]); + SetPixel(hdc, x + dx - 1, y, SavedPixels[3]); + SetPixel(hdc, x + dx - 2, y, SavedPixels[4]); + SetPixel(hdc, x + dx - 1, y + 1, SavedPixels[5]); + SetPixel(hdc, x, y + dy - 1, SavedPixels[6]); + SetPixel(hdc, x + 1, y + dy - 1, SavedPixels[7]); + SetPixel(hdc, x, y + dy - 2, SavedPixels[8]); + SetPixel(hdc, x + dx - 1, y + dy - 1, SavedPixels[9]); + SetPixel(hdc, x + dx - 2, y + dy - 1, SavedPixels[10]); + SetPixel(hdc, x + dx - 1, y + dy - 2, SavedPixels[11]); + } + else + { + BltCard(hdc, x, y, dx, dy, hdcCard, dwRasterOp, bStretch); + } + SetBkColor(hdc, OldBkColor); + DeleteDC(hdcCard); + } - return TRUE; + return TRUE; } @@ -232,19 +233,19 @@ BOOL WINAPI cdtDrawExt(HDC hdc, INT x, INT y, INT dx, INT dy, INT card, INT type */ BOOL WINAPI cdtAnimate(HDC hdc, int cardback, int x, int y, int frame) { - UNREFERENCED_PARAMETER(frame); - UNREFERENCED_PARAMETER(y); - UNREFERENCED_PARAMETER(x); - UNREFERENCED_PARAMETER(cardback); - UNREFERENCED_PARAMETER(hdc); - return TRUE; + UNREFERENCED_PARAMETER(frame); + UNREFERENCED_PARAMETER(y); + UNREFERENCED_PARAMETER(x); + UNREFERENCED_PARAMETER(cardback); + UNREFERENCED_PARAMETER(hdc); + return TRUE; } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - UNREFERENCED_PARAMETER(lpvReserved); - if (fdwReason == DLL_PROCESS_ATTACH) - g_hModule = hinstDLL; + UNREFERENCED_PARAMETER(lpvReserved); + if (fdwReason == DLL_PROCESS_ATTACH) + g_hModule = hinstDLL; - return TRUE; + return TRUE; } diff --git a/reactos/dll/win32/cards/cards.h b/reactos/dll/win32/cards/cards.h index 20be102944a..bfbcf98eec1 100644 --- a/reactos/dll/win32/cards/cards.h +++ b/reactos/dll/win32/cards/cards.h @@ -1,7 +1,7 @@ /* - * ReactOS Cards + * ReactOS Cards * - * Copyright (C) 2003 Filip Navara + * Copyright (C) 2003 Filip Navara * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,29 +28,29 @@ * FreeCard + * Joker */ -#define MAX_CARD_BITMAPS 68 +#define MAX_CARD_BITMAPS 68 -#define ectFACES 0 -#define ectBACKS 1 -#define ectINVERTED 2 -#define ectEMPTY 3 -#define ectERASE 4 -#define ectEMPTYNOBG 5 -#define ectREDX 6 -#define ectGREENO 7 -#define ectSAVEEDGESMASK 0x80000000 +#define ectFACES 0 +#define ectBACKS 1 +#define ectINVERTED 2 +#define ectEMPTY 3 +#define ectERASE 4 +#define ectEMPTYNOBG 5 +#define ectREDX 6 +#define ectGREENO 7 +#define ectSAVEEDGESMASK 0x80000000 #if defined(CARDSTYLE_DEFAULT) -# define CARD_WIDTH 72 // The original Microsoft cards are 71px wide, but ours are taken from MacSolitaireX -# define CARD_HEIGHT 96 +# define CARD_WIDTH 72 // The original Microsoft cards are 71px wide, but ours are taken from MacSolitaireX +# define CARD_HEIGHT 96 #elif defined(CARDSTYLE_BAVARIAN) -# define CARD_WIDTH 110 -# define CARD_HEIGHT 198 +# define CARD_WIDTH 110 +# define CARD_HEIGHT 198 #else -# error No or unsupported cardstyle defined +# error No or unsupported cardstyle defined #endif -#define ISREDCARD(x) (x >= 13 && x <= 39) +#define ISREDCARD(x) (x >= 13 && x <= 39) BOOL WINAPI cdtInit(int *width, int *height); BOOL WINAPI cdtDraw(HDC hdc, int x, int y, int card, int type, DWORD color); From 4314bf948da0cc912dfbe4f4fd863673c0c696ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 14 Mar 2014 22:50:03 +0000 Subject: [PATCH 106/419] [CARDS]: "Localize" some variables. svn path=/trunk/; revision=62497 --- reactos/dll/win32/cards/cards.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/reactos/dll/win32/cards/cards.c b/reactos/dll/win32/cards/cards.c index 05ff746992a..b2feb63c5b3 100644 --- a/reactos/dll/win32/cards/cards.c +++ b/reactos/dll/win32/cards/cards.c @@ -123,8 +123,7 @@ static __inline VOID BltCard(HDC hdc, INT x, INT y, INT dx, INT dy, HDC hdcCard, */ BOOL WINAPI cdtDrawExt(HDC hdc, INT x, INT y, INT dx, INT dy, INT card, INT type, COLORREF color) { - HDC hdcCard; - DWORD dwRasterOp = SRCCOPY, OldBkColor; + DWORD dwRasterOp = SRCCOPY; BOOL bSaveEdges = TRUE; BOOL bStretch = FALSE; @@ -180,22 +179,25 @@ BOOL WINAPI cdtDrawExt(HDC hdc, INT x, INT y, INT dx, INT dy, INT card, INT type } if (type != ectERASE) { + HDC hdcCard; + COLORREF OldBkColor; + hdcCard = CreateCompatibleDC(hdc); SelectObject(hdcCard, g_CardBitmaps[card]); OldBkColor = SetBkColor(hdc, (type == ectFACES) ? 0xFFFFFF : color); if (bSaveEdges) { COLORREF SavedPixels[12]; - SavedPixels[0] = GetPixel(hdc, x, y); - SavedPixels[1] = GetPixel(hdc, x + 1, y); - SavedPixels[2] = GetPixel(hdc, x, y + 1); - SavedPixels[3] = GetPixel(hdc, x + dx - 1, y); - SavedPixels[4] = GetPixel(hdc, x + dx - 2, y); - SavedPixels[5] = GetPixel(hdc, x + dx - 1, y + 1); - SavedPixels[6] = GetPixel(hdc, x, y + dy - 1); - SavedPixels[7] = GetPixel(hdc, x + 1, y + dy - 1); - SavedPixels[8] = GetPixel(hdc, x, y + dy - 2); - SavedPixels[9] = GetPixel(hdc, x + dx - 1, y + dy - 1); + SavedPixels[0] = GetPixel(hdc, x, y); + SavedPixels[1] = GetPixel(hdc, x + 1, y); + SavedPixels[2] = GetPixel(hdc, x, y + 1); + SavedPixels[3] = GetPixel(hdc, x + dx - 1, y); + SavedPixels[4] = GetPixel(hdc, x + dx - 2, y); + SavedPixels[5] = GetPixel(hdc, x + dx - 1, y + 1); + SavedPixels[6] = GetPixel(hdc, x, y + dy - 1); + SavedPixels[7] = GetPixel(hdc, x + 1, y + dy - 1); + SavedPixels[8] = GetPixel(hdc, x, y + dy - 2); + SavedPixels[9] = GetPixel(hdc, x + dx - 1, y + dy - 1); SavedPixels[10] = GetPixel(hdc, x + dx - 2, y + dy - 1); SavedPixels[11] = GetPixel(hdc, x + dx - 1, y + dy - 2); @@ -244,6 +246,7 @@ BOOL WINAPI cdtAnimate(HDC hdc, int cardback, int x, int y, int frame) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { UNREFERENCED_PARAMETER(lpvReserved); + if (fdwReason == DLL_PROCESS_ATTACH) g_hModule = hinstDLL; From 7c7bd121c5f913f57188d36f2de0d0c3e13ed99a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 14 Mar 2014 23:12:10 +0000 Subject: [PATCH 107/419] [CARDS] Fix GDI leak. Patch by mudhead. CORE-7854 #resolve #comment Fixed in revision 62498, thanks ;) svn path=/trunk/; revision=62498 --- reactos/dll/win32/cards/cards.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/cards/cards.c b/reactos/dll/win32/cards/cards.c index b2feb63c5b3..618c902e680 100644 --- a/reactos/dll/win32/cards/cards.c +++ b/reactos/dll/win32/cards/cards.c @@ -169,13 +169,15 @@ BOOL WINAPI cdtDrawExt(HDC hdc, INT x, INT y, INT dx, INT dy, INT card, INT type if (type == ectEMPTY || type == ectERASE) { POINT pPoint; - HBRUSH hBrush; + HBRUSH hBrush, hOldBrush; hBrush = CreateSolidBrush(color); GetDCOrgEx(hdc, &pPoint); SetBrushOrgEx(hdc, pPoint.x, pPoint.y, 0); - SelectObject(hdc, hBrush); + hOldBrush = SelectObject(hdc, hBrush); PatBlt(hdc, x, y, dx, dy, PATCOPY); + SelectObject(hdc, hOldBrush); + DeleteObject(hBrush); } if (type != ectERASE) { From 92514dc19ed5e9cbf16efd6123f2968aa566aab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 15 Mar 2014 00:47:09 +0000 Subject: [PATCH 108/419] [RAPPS]: Update RosBE to 2.1.1 svn path=/trunk/; revision=62499 --- reactos/base/applications/rapps/rapps/rosbe.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/base/applications/rapps/rapps/rosbe.txt b/reactos/base/applications/rapps/rapps/rosbe.txt index 2043f96b99e..56098d8d9d6 100644 --- a/reactos/base/applications/rapps/rapps/rosbe.txt +++ b/reactos/base/applications/rapps/rapps/rosbe.txt @@ -2,13 +2,13 @@ [Section] Name = ReactOS Build Environment -Version = 2.1 +Version = 2.1.1 Licence = GPL Description = Allows you to build the ReactOS Source. For more instructions see ReactOS wiki. -Size = 31.6 MB +Size = 28.3 MB Category = 7 URLSite = http://reactos.org/wiki/Build_Environment -URLDownload = http://download.sourceforge.net/project/reactos/RosBE-Windows/i386/2.1/RosBE-2.1.exe +URLDownload = http://downloads.sourceforge.net/reactos/RosBE-2.1.1.exe CDPath = none [Section.0405] @@ -21,8 +21,8 @@ Description = Erlaubt es Ihnen den ReactOS Source Code zu kompilieren. Im ReactO Description = Te permite compilar el código de ReactOS. Para más instrucciones consulta la wiki de ReactOS. [Section.040c] -Description = Vous permet de compiler le code source de ReactOS. Pour plus d'instruction, reportez-vous au wiki ReactOS. -Size = 31,6 Mo +Description = Vous permet de compiler le code source de ReactOS. Pour plus d'instructions, reportez-vous au wiki ReactOS. +Size = 28,3 Mo [Section.0410] Description = Permette di compilare i sorgenti di ReactOS. Per maggiori informazioni consultare il Wiki di ReactOS. @@ -35,12 +35,12 @@ Description = Pozwala zbudować obraz płyty ReactOS ze źródeł. Więcej infor [Section.0418] Description = Permite compilarea surselor ReactOS. Pentru instrucțiuni, consultați wiki ReactOS. -Size = 31,6 Mo +Size = 28,3 Mo [Section.041f] Name = ReactOS Derleme Ortamı Description = ReactOS Kaynak Kodları'nı derlettirir. Daha çok açıklama için ReactOS Wiki'ye bakınız. -Size = 31,6 MB +Size = 28,3 MB [Section.0422] Description = Дозволяє зібрати ReactOS з вихідних кодів. За детальною інформацією дивіться в ReactOS Вікі. From 8959204c82a5847e9884a38d36e01deef9b2848f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 15 Mar 2014 02:04:54 +0000 Subject: [PATCH 109/419] [CONSRV]: Silence some DPRINTs. svn path=/trunk/; revision=62500 --- .../win32ss/user/winsrv/consrv/frontends/gui/guiterm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c index bffeeca0926..acc870b40eb 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c @@ -231,7 +231,7 @@ GuiSendMenuEvent(PCONSOLE Console, UINT CmdId) er.EventType = MENU_EVENT; er.Event.MenuEvent.dwCommandId = CmdId; - DPRINT1("Menu item ID: %d\n", CmdId); + DPRINT("Menu item ID: %d\n", CmdId); ConioProcessInputEvent(Console, &er); } @@ -1713,7 +1713,7 @@ GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; - DPRINT1("WM_PALETTECHANGED called\n"); + DPRINT("WM_PALETTECHANGED called\n"); /* * Protects against infinite loops: @@ -1730,12 +1730,12 @@ GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) */ if ((HWND)wParam == hWnd) break; - DPRINT1("WM_PALETTECHANGED ok\n"); + DPRINT("WM_PALETTECHANGED ok\n"); // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) if (ActiveBuffer->PaletteHandle) { - DPRINT1("WM_PALETTECHANGED changing palette\n"); + DPRINT("WM_PALETTECHANGED changing palette\n"); /* Specify the use of the system palette for the framebuffer */ SetSystemPaletteUse(GuiData->hMemDC, ActiveBuffer->PaletteUsage); @@ -1744,7 +1744,7 @@ GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) RealizePalette(GuiData->hMemDC); } - DPRINT1("WM_PALETTECHANGED quit\n"); + DPRINT("WM_PALETTECHANGED quit\n"); break; } From 3643e3e2b9ed7d4ffebf1b99c65e136c01c33405 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 15 Mar 2014 13:46:33 +0000 Subject: [PATCH 110/419] [MSGINA] Update russian translation. Patch by jperm. Thanks a lot! CORE-7974 #resolve svn path=/trunk/; revision=62501 --- reactos/dll/win32/msgina/lang/ru-RU.rc | 64 +++++++++++++------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/reactos/dll/win32/msgina/lang/ru-RU.rc b/reactos/dll/win32/msgina/lang/ru-RU.rc index 398ce06d5e7..1061218abb7 100644 --- a/reactos/dll/win32/msgina/lang/ru-RU.rc +++ b/reactos/dll/win32/msgina/lang/ru-RU.rc @@ -51,7 +51,7 @@ BEGIN PUSHBUTTON "Заблокировать", IDC_LOCK, 7, 135, 86, 14 PUSHBUTTON "Завершение сеанса", IDC_LOGOFF, 102, 135, 86, 14 PUSHBUTTON "Выключение", IDC_SHUTDOWN, 198, 135, 70, 14 - PUSHBUTTON "Change Password", IDC_CHANGEPWD, 10, 154, 76, 14 + PUSHBUTTON "Изменение пароля", IDC_CHANGEPWD, 7, 155, 86, 14 PUSHBUTTON "Диспетчер задач", IDC_TASKMGR, 102, 154, 86, 14 PUSHBUTTON "Отмена", IDCANCEL, 198, 154, 70, 14 END @@ -77,9 +77,9 @@ BEGIN ICON IDI_LOCKICON, -1, 7, 59, 20, 20 LTEXT "Этот компьютер используется и заблокирован.", IDC_STATIC, 36, 61, 232, 8 LTEXT "Сообщение", IDC_LOCKMSG, 36, 75, 232, 26 - LTEXT "По&льзователь:", IDC_STATIC, 36, 107, 40, 8 + LTEXT "По&льзователь:", IDC_STATIC, 36, 107, 51, 8 EDITTEXT IDC_USERNAME, 84, 104, 119, 14, ES_AUTOHSCROLL - LTEXT "&Пароль:", IDC_STATIC, 36, 125, 42, 8 + LTEXT "&Пароль:", IDC_STATIC, 33, 125, 42, 8 EDITTEXT IDC_PASSWORD, 84, 123, 119, 14, ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK", IDOK, 80, 154, 50, 14, BS_DEFPUSHBUTTON PUSHBUTTON "Отмена", IDCANCEL, 144, 154, 50, 14 @@ -87,33 +87,33 @@ END IDD_CHANGE_PASSWORD DIALOGEX 0, 0, 275, 166 STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP -CAPTION "Change Password" +CAPTION "Изменение пароля" FONT 8, "MS Shell Dlg", 400, 0, 1 BEGIN CONTROL IDI_ROSLOGO, IDC_ROSLOGO, "Static", SS_BITMAP, 0, 0, 275, 54 - LTEXT "User name:", IDC_STATIC, 7, 61, 78, 8 + LTEXT "Имя:", IDC_STATIC, 7, 61, 78, 8 EDITTEXT IDC_CHANGEPWD_USERNAME, 90, 59, 127, 12, ES_AUTOHSCROLL - LTEXT "Log on to:", IDC_STATIC, 7, 78, 78, 8 + LTEXT "Войти на:", IDC_STATIC, 7, 78, 78, 8 COMBOBOX IDC_CHANGEPWD_DOMAIN, 90, 75, 127, 144, CBS_DROPDOWNLIST | CBS_SORT - LTEXT "Old Password:", IDC_STATIC, 7, 95, 78, 8 + LTEXT "Старый пароль:", IDC_STATIC, 7, 95, 78, 8 EDITTEXT IDC_CHANGEPWD_OLDPWD, 90, 92, 127, 12, ES_AUTOHSCROLL | ES_PASSWORD - LTEXT "New Password:", IDC_STATIC, 7, 111, 78, 8 + LTEXT "Новый пароль:", IDC_STATIC, 7, 111, 78, 8 EDITTEXT IDC_CHANGEPWD_NEWPWD1, 90, 109, 127, 12, ES_AUTOHSCROLL | ES_PASSWORD - LTEXT "Confirm new Password:", IDC_STATIC, 7, 127, 78, 8 + LTEXT "Подтвердите пароль:", IDC_STATIC, 7, 127, 78, 20 EDITTEXT IDC_CHANGEPWD_NEWPWD2, 90, 125, 127, 12, ES_AUTOHSCROLL | ES_PASSWORD PUSHBUTTON "OK", IDOK, 164, 145, 50, 14, BS_DEFPUSHBUTTON - PUSHBUTTON "Cancel", IDCANCEL, 218, 145, 50, 14 + PUSHBUTTON "Отмена", IDCANCEL, 218, 145, 50, 14 END IDD_LOGOFF_DLG DIALOGEX 0, 0, 188, 60 STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_SYSMENU | WS_POPUP -CAPTION "Log Off ReactOS" +CAPTION "Выход из ReactOS" FONT 8, "MS Shell Dlg", 400, 0, 1 BEGIN ICON IDI_LOCKICON, -1, 7, 7, 20, 20 - LTEXT "Are you sure you want to log off?", IDC_STATIC, 35, 16, 146, 8 - PUSHBUTTON "Yes", IDYES, 41, 39, 50, 14, BS_DEFPUSHBUTTON - PUSHBUTTON "No", IDNO, 95, 39, 50, 14 + LTEXT "Вы уверены, что хотите выйти?", IDC_STATIC, 35, 16, 146, 8 + PUSHBUTTON "Да", IDYES, 41, 39, 50, 14, BS_DEFPUSHBUTTON + PUSHBUTTON "Нет", IDNO, 95, 39, 50, 14 END IDD_SHUTDOWN_DLG DIALOGEX 0, 0, 275, 146 @@ -139,31 +139,31 @@ BEGIN IDS_ASKFORPASSWORD "Пароль: " IDS_FORCELOGOFF "При регистрации нового пользователя все несохраненные данные будут утеряны. Продолжить?" IDS_LOCKMSG "Только %s или Администратор могут разблокировать этот компьютер." - IDS_LOGONMSG "You are logged on as %s." + IDS_LOGONMSG "Вы вошли в систему как %s." IDS_LOGONDATE "Дата входа: %s %s" - IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." + IDS_COMPUTERLOCKED "Компьютер заблокирован" + IDS_LOCKEDWRONGPASSWORD "Неверный пароль. Пожалуйста, введите пароль еще раз. Символы в Пароли вводятся с учетом регистра." IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." - IDS_CHANGEPWDTITLE "Change Password" - IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." - IDS_PASSWORDCHANGED "Your password has been changed." + IDS_CHANGEPWDTITLE "Изменить пароль" + IDS_NONMATCHINGPASSWORDS "Введенные пароли несовпадают. Введите пароль в оба поля" + IDS_PASSWORDCHANGED "Ваш пароль был изменен." IDS_LOGONTITLE "Logon Message" - IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." - IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_LOGONWRONGUSERORPWD "Системе не удается войти в. Убедитесь в том, ваше имя пользователя и домен верны, то введите пароль еще раз. Символы в Пароли вводятся с учетом регистра" + IDS_LOGONUSERDISABLED "Ваш аккаунт был отключен. Пожалуйста, обратитесь к системному администратору." END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN - IDS_SHUTDOWN_LOGOFF "Log off ""%s""" - IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_RESTART "Restart" - IDS_SHUTDOWN_SLEEP "Sleep" - IDS_SHUTDOWN_HIBERNATE "Hibernate" + IDS_SHUTDOWN_LOGOFF "Выйти ""%s""" + IDS_SHUTDOWN_SHUTDOWN "Завершение работы" + IDS_SHUTDOWN_RESTART "Перезагрузка" + IDS_SHUTDOWN_SLEEP "Спящий режим" + IDS_SHUTDOWN_HIBERNATE "Гибернация" /* Shut down descriptions */ - IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." - IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." - IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." - IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." + IDS_SHUTDOWN_LOGOFF_DESC "Завершает текущий сеанс и позволяет другим пользователям войти в систему." + IDS_SHUTDOWN_SHUTDOWN_DESC "Завершает текущий сеанс и отключает систему так что можно спокойно выключить питание." + IDS_SHUTDOWN_RESTART_DESC "Завершает текущий сеанс и перезагружает систему." + IDS_SHUTDOWN_SLEEP_DESC "Переводит систему в режим ожидания." + IDS_SHUTDOWN_HIBERNATE_DESC "Сохраняет текущий сеанс и выключит компьютер." END From 4f523a3000b121d00f2ec5c2201410230a5444d8 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 15 Mar 2014 13:59:22 +0000 Subject: [PATCH 111/419] [SHELL32] * Implement support for file formats' drop target shell extensions. * Implement a shell extension for executable files. * Implement a shell extension for lnk files. * Change the shell notifications for moving files and folders, as they were all conflated with renaming files. * Fix up SHChangeNotification so the desktop receives notifications when files are added to common or user desktop directories. * Fix up SHChangeNotification such that folder pidls are not incorrectly assumed to be file pidls and displayed incorrectly. * Implement a drop target for My Documents. * Fix up the desktop's drop target resolution so files can be dropped on the recycle bin and my documents etc properly. * Stub IDragSourceHelper in CLSID_DragDropHelper. * Add a few additional shell change notifications. * Silence a few FIXMEs to TRACEs. * Some code clean up. * Brought to you by Huw Campbell. CORE-3760 svn path=/trunk/; revision=62502 --- reactos/boot/bootdata/hivecls.inf | 2 + reactos/dll/win32/shell32/CMakeLists.txt | 1 + reactos/dll/win32/shell32/changenotify.cpp | 58 +++- reactos/dll/win32/shell32/defcontextmenu.cpp | 35 ++- reactos/dll/win32/shell32/dragdrophelper.cpp | 12 + reactos/dll/win32/shell32/dragdrophelper.h | 6 +- .../shell32/droptargets/CexeDropHandler.cpp | 138 +++++++++ .../shell32/droptargets/CexeDropHandler.h | 66 +++++ reactos/dll/win32/shell32/folders/desktop.cpp | 53 +++- reactos/dll/win32/shell32/folders/desktop.h | 1 + reactos/dll/win32/shell32/folders/fs.cpp | 119 +++++++- reactos/dll/win32/shell32/folders/fs.h | 4 + .../dll/win32/shell32/folders/mydocuments.cpp | 51 +++- .../dll/win32/shell32/folders/mydocuments.h | 11 +- .../dll/win32/shell32/folders/recyclebin.cpp | 4 +- reactos/dll/win32/shell32/precomp.h | 1 + .../win32/shell32/res/rgs/exedrophandler.rgs | 13 + reactos/dll/win32/shell32/rgs_res.rc | 1 + reactos/dll/win32/shell32/shell32_main.cpp | 1 + reactos/dll/win32/shell32/shelllink.cpp | 62 +++++ reactos/dll/win32/shell32/shelllink.h | 261 +++++++++--------- reactos/dll/win32/shell32/shfldr.h | 14 +- reactos/dll/win32/shell32/shlfileop.cpp | 19 +- reactos/dll/win32/shell32/shlview.cpp | 12 +- reactos/dll/win32/shell32/shresdef.h | 1 + reactos/include/psdk/shlguid_undoc.h | 2 + 26 files changed, 783 insertions(+), 165 deletions(-) create mode 100644 reactos/dll/win32/shell32/droptargets/CexeDropHandler.cpp create mode 100644 reactos/dll/win32/shell32/droptargets/CexeDropHandler.h create mode 100644 reactos/dll/win32/shell32/res/rgs/exedrophandler.rgs diff --git a/reactos/boot/bootdata/hivecls.inf b/reactos/boot/bootdata/hivecls.inf index 98071809b98..10db21badfd 100644 --- a/reactos/boot/bootdata/hivecls.inf +++ b/reactos/boot/bootdata/hivecls.inf @@ -100,6 +100,7 @@ HKCR,"exefile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll HKCR,"exefile\Defaulticon","",0x00000000,"%1" HKCR,"exefile\shell\open\command","",0x00000000,"""%1"" %*" HKCR,"exefile\shell\runas\command","",0x00020000,"""%1"" %*" +HKCR,"exefile\shellex\DropHandler","",0x00020000,"{86C86720-42A0-1069-A2E8-08002B30309D}" ; Fonts HKCR,".fon","",0x00000000,"fonfile" @@ -191,6 +192,7 @@ 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\DropHandler","",0x00000000,"{00021401-0000-0000-C000-000000000046}" HKCR,"lnkfile\shellex\ContextMenuHandlers\{00021401-0000-0000-C000-000000000046}","",0x00000000,"" HKCR,"lnkfile\shellex\PropertySheetHandlers\Shellink Property Page", "", 0x00000000, "{00021401-0000-0000-C000-000000000046}" diff --git a/reactos/dll/win32/shell32/CMakeLists.txt b/reactos/dll/win32/shell32/CMakeLists.txt index 89c5417e74c..b59b679eb28 100644 --- a/reactos/dll/win32/shell32/CMakeLists.txt +++ b/reactos/dll/win32/shell32/CMakeLists.txt @@ -54,6 +54,7 @@ list(APPEND SOURCE folders/fonts.cpp folders/cpanel.cpp folders/recyclebin.cpp + droptargets/CexeDropHandler.cpp shlexec.cpp shlfileop.cpp shlfolder.cpp diff --git a/reactos/dll/win32/shell32/changenotify.cpp b/reactos/dll/win32/shell32/changenotify.cpp index e776158e3b2..71eee583fc8 100644 --- a/reactos/dll/win32/shell32/changenotify.cpp +++ b/reactos/dll/win32/shell32/changenotify.cpp @@ -264,6 +264,25 @@ static BOOL should_notify( LPCITEMIDLIST changed, LPCITEMIDLIST watched, BOOL su return TRUE; if( sub && ILIsParent( watched, changed, TRUE ) ) return TRUE; + if (sub && _ILIsDesktop(watched)) { + WCHAR wszPath[MAX_PATH]; + SHGetSpecialFolderPathW(0, wszPath, CSIDL_DESKTOPDIRECTORY, FALSE); + LPITEMIDLIST deskpidl = SHSimpleIDListFromPathW(wszPath); + if (ILIsParent(deskpidl, changed, TRUE)) + { + ILFree(deskpidl); + return TRUE; + } + ILFree(deskpidl); + SHGetSpecialFolderPathW(0, wszPath, CSIDL_COMMON_DESKTOPDIRECTORY, FALSE); + deskpidl = SHSimpleIDListFromPathW(wszPath); + if (ILIsParent(deskpidl, changed, TRUE)) + { + ILFree(deskpidl); + return TRUE; + } + ILFree(deskpidl); + } return FALSE; } @@ -272,7 +291,7 @@ static BOOL should_notify( LPCITEMIDLIST changed, LPCITEMIDLIST watched, BOOL su */ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2) { - LPCITEMIDLIST Pidls[2]; + LPITEMIDLIST Pidls[2]; LPNOTIFICATIONLIST ptr; UINT typeFlag = uFlags & SHCNF_TYPE; @@ -316,10 +335,43 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID case SHCNF_PATHW: if (dwItem1) Pidls[0] = SHSimpleIDListFromPathW((LPCWSTR)dwItem1); if (dwItem2) Pidls[1] = SHSimpleIDListFromPathW((LPCWSTR)dwItem2); + if (wEventId & (SHCNE_MKDIR | SHCNE_RMDIR | SHCNE_UPDATEDIR | SHCNE_RENAMEFOLDER)) + { + /* + * The last items in the ID are currently files. So we chop off the last + * entry, and create a new one using a find data struct. + */ + if (dwItem1 && Pidls[0]){ + ILRemoveLastID(Pidls[0]); + WIN32_FIND_DATAW wfd; + LPWSTR p = PathFindFileNameW((LPCWSTR)dwItem1); + lstrcpynW(&wfd.cFileName[0], p, MAX_PATH); + wfd.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; + LPITEMIDLIST newpidl = _ILCreateFromFindDataW(&wfd); + LPITEMIDLIST oldpidl = ILClone(Pidls[0]); + ILFree(Pidls[0]); + Pidls[0] = ILCombine(oldpidl, newpidl); + ILFree(newpidl); + ILFree(oldpidl); + } + if (dwItem2 && Pidls[1]){ + ILRemoveLastID(Pidls[1]); + WIN32_FIND_DATAW wfd; + LPWSTR p = PathFindFileNameW((LPCWSTR)dwItem2); + lstrcpynW(&wfd.cFileName[0], p, MAX_PATH); + wfd.dwFileAttributes = FILE_ATTRIBUTE_DIRECTORY; + LPITEMIDLIST newpidl = _ILCreateFromFindDataW(&wfd); + LPITEMIDLIST oldpidl = ILClone(Pidls[0]); + ILFree(Pidls[1]); + Pidls[1] = ILCombine(oldpidl, newpidl); + ILFree(newpidl); + ILFree(oldpidl); + } + } break; case SHCNF_IDLIST: - Pidls[0] = (LPCITEMIDLIST)dwItem1; - Pidls[1] = (LPCITEMIDLIST)dwItem2; + Pidls[0] = (LPITEMIDLIST)dwItem1; + Pidls[1] = (LPITEMIDLIST)dwItem2; break; case SHCNF_PRINTERA: case SHCNF_PRINTERW: diff --git a/reactos/dll/win32/shell32/defcontextmenu.cpp b/reactos/dll/win32/shell32/defcontextmenu.cpp index 72988d120aa..6c5b2b84bee 100644 --- a/reactos/dll/win32/shell32/defcontextmenu.cpp +++ b/reactos/dll/win32/shell32/defcontextmenu.cpp @@ -61,6 +61,7 @@ class CDefaultContextMenu : HRESULT DoPaste(LPCMINVOKECOMMANDINFO lpcmi, BOOL bLink); HRESULT DoOpenOrExplore(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoCreateLink(LPCMINVOKECOMMANDINFO lpcmi); + HRESULT DoRefresh(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoDelete(LPCMINVOKECOMMANDINFO lpcmi); HRESULT DoCopyOrCut(LPCMINVOKECOMMANDINFO lpcmi, BOOL bCopy); HRESULT DoRename(LPCMINVOKECOMMANDINFO lpcmi); @@ -931,19 +932,34 @@ NotifyShellViewWindow(LPCMINVOKECOMMANDINFO lpcmi, BOOL bRefresh) if (FAILED(lpSB->QueryActiveShellView(&lpSV))) return E_FAIL; - if (LOWORD(lpcmi->lpVerb) == FCIDM_SHVIEW_REFRESH || bRefresh) - lpSV->Refresh(); - else - { - HWND hwndSV = NULL; - if (SUCCEEDED(lpSV->GetWindow(&hwndSV))) - SendMessageW(hwndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0), 0); - } + HWND hwndSV = NULL; + if (SUCCEEDED(lpSV->GetWindow(&hwndSV))) + SendMessageW(hwndSV, WM_COMMAND, MAKEWPARAM(LOWORD(lpcmi->lpVerb), 0), 0); lpSV->Release(); return S_OK; } +HRESULT +CDefaultContextMenu::DoRefresh( + LPCMINVOKECOMMANDINFO lpcmi) +{ + CComPtr ppf2 = NULL; + LPITEMIDLIST pidl; + HRESULT hr = m_Dcm.psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &ppf2)); + if (SUCCEEDED(hr)) + { + hr = ppf2->GetCurFolder(&pidl); + if (SUCCEEDED(hr)) + { + SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_IDLIST, pidl, NULL); + ILFree(pidl); + } + ppf2->Release(); + } + return hr; +} + HRESULT CDefaultContextMenu::DoPaste( LPCMINVOKECOMMANDINFO lpcmi, BOOL bLink) @@ -1512,8 +1528,9 @@ CDefaultContextMenu::InvokeCommand( case 0x33: case FCIDM_SHVIEW_AUTOARRANGE: case FCIDM_SHVIEW_SNAPTOGRID: - case FCIDM_SHVIEW_REFRESH: return NotifyShellViewWindow(lpcmi, FALSE); + case FCIDM_SHVIEW_REFRESH: + return DoRefresh(lpcmi); case FCIDM_SHVIEW_INSERT: return DoPaste(lpcmi, FALSE); case FCIDM_SHVIEW_INSERTLINK: diff --git a/reactos/dll/win32/shell32/dragdrophelper.cpp b/reactos/dll/win32/shell32/dragdrophelper.cpp index 51a46dd1d2a..b042f2df068 100644 --- a/reactos/dll/win32/shell32/dragdrophelper.cpp +++ b/reactos/dll/win32/shell32/dragdrophelper.cpp @@ -36,6 +36,18 @@ CDropTargetHelper::~CDropTargetHelper() { } +HRESULT WINAPI CDropTargetHelper::InitializeFromBitmap(LPSHDRAGIMAGE pshdi, IDataObject *pDataObject) +{ + FIXME ("(%p)->()\n", this); + return E_NOTIMPL; +} +HRESULT WINAPI CDropTargetHelper::InitializeFromWindow(HWND hwnd, POINT *ppt, IDataObject *pDataObject) +{ + FIXME ("(%p)->()\n", this); + return E_NOTIMPL; +} + + HRESULT WINAPI CDropTargetHelper::DragEnter (HWND hwndTarget, IDataObject* pDataObject, POINT* ppt, DWORD dwEffect) { FIXME ("(%p)->(%p %p %p 0x%08x)\n", this, hwndTarget, pDataObject, ppt, dwEffect); diff --git a/reactos/dll/win32/shell32/dragdrophelper.h b/reactos/dll/win32/shell32/dragdrophelper.h index a520ed655f0..5cc7de9b8a3 100644 --- a/reactos/dll/win32/shell32/dragdrophelper.h +++ b/reactos/dll/win32/shell32/dragdrophelper.h @@ -26,6 +26,7 @@ class CDropTargetHelper : public CComCoClass, public CComObjectRootEx, + public IDragSourceHelper, public IDropTargetHelper { private: @@ -33,7 +34,9 @@ public: CDropTargetHelper(); ~CDropTargetHelper(); - //////// + virtual HRESULT WINAPI InitializeFromBitmap(LPSHDRAGIMAGE pshdi, IDataObject *pDataObject); + virtual HRESULT WINAPI InitializeFromWindow(HWND hwnd, POINT *ppt, IDataObject *pDataObject); + virtual HRESULT WINAPI DragEnter (HWND hwndTarget, IDataObject* pDataObject, POINT* ppt, DWORD dwEffect); virtual HRESULT WINAPI DragLeave(); virtual HRESULT WINAPI DragOver(POINT *ppt, DWORD dwEffect); @@ -46,6 +49,7 @@ DECLARE_NOT_AGGREGATABLE(CDropTargetHelper) DECLARE_PROTECT_FINAL_CONSTRUCT() BEGIN_COM_MAP(CDropTargetHelper) + COM_INTERFACE_ENTRY_IID(IID_IDragSourceHelper, IDragSourceHelper) COM_INTERFACE_ENTRY_IID(IID_IDropTargetHelper, IDropTargetHelper) END_COM_MAP() }; diff --git a/reactos/dll/win32/shell32/droptargets/CexeDropHandler.cpp b/reactos/dll/win32/shell32/droptargets/CexeDropHandler.cpp new file mode 100644 index 00000000000..06052fca503 --- /dev/null +++ b/reactos/dll/win32/shell32/droptargets/CexeDropHandler.cpp @@ -0,0 +1,138 @@ +/* + * executable drop target handler + * + * Copyright 2014 Huw Campbell + * + * 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); + +CExeDropHandler::CExeDropHandler() +{ + pclsid = (CLSID *)&CLSID_ExeDropHandler; +} + +CExeDropHandler::~CExeDropHandler() +{ + +} + +// IDropTarget +HRESULT WINAPI CExeDropHandler::DragEnter(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) +{ + TRACE ("(%p)\n", this); + *pdwEffect = DROPEFFECT_COPY; + return S_OK; +} + +HRESULT WINAPI CExeDropHandler::DragOver(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) +{ + TRACE ("(%p)\n", this); + *pdwEffect = DROPEFFECT_COPY; + return S_OK; +} + +HRESULT WINAPI CExeDropHandler::DragLeave() +{ + TRACE ("(%p)\n", this); + return S_OK; +} + +HRESULT WINAPI CExeDropHandler::Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) +{ + TRACE ("(%p)\n", this); + FORMATETC fmt; + STGMEDIUM medium; + LPWSTR pszSrcList; + InitFormatEtc (fmt, CF_HDROP, TYMED_HGLOBAL); + WCHAR wszBuf[MAX_PATH * 2 + 8], *pszEnd = wszBuf; + size_t cchRemaining = _countof(wszBuf); + + if (SUCCEEDED(pDataObject->GetData(&fmt, &medium)) /* && SUCCEEDED(pDataObject->GetData(&fmt2, &medium))*/) + { + LPDROPFILES lpdf = (LPDROPFILES) GlobalLock(medium.hGlobal); + if (!lpdf) + { + ERR("Error locking global\n"); + return E_FAIL; + } + pszSrcList = (LPWSTR) (((byte*) lpdf) + lpdf->pFiles); + while (*pszSrcList) + { + if (StrChrW(pszSrcList, L' ') && cchRemaining > 3) + StringCchPrintfExW(pszEnd, cchRemaining, &pszEnd, &cchRemaining, 0, L"\"%ls\" ", pszSrcList); + else + StringCchPrintfExW(pszEnd, cchRemaining, &pszEnd, &cchRemaining, 0, L"%ls ", pszSrcList); + + pszSrcList += wcslen(pszSrcList) + 1; + } + } + + ShellExecute(NULL, L"open", sPathTarget, wszBuf, NULL,SW_SHOWNORMAL); + + return S_OK; +} + + +// IPersistFile +HRESULT WINAPI CExeDropHandler::GetCurFile(LPOLESTR *ppszFileName) +{ + FIXME ("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT WINAPI CExeDropHandler::IsDirty() +{ + FIXME ("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT WINAPI CExeDropHandler::Load(LPCOLESTR pszFileName, DWORD dwMode) +{ + UINT len = strlenW(pszFileName); + sPathTarget = (WCHAR *)SHAlloc((len + 1) * sizeof(WCHAR)); + memcpy(sPathTarget, pszFileName, (len + 1) * sizeof(WCHAR)); + return S_OK; +} + +HRESULT WINAPI CExeDropHandler::Save(LPCOLESTR pszFileName, BOOL fRemember) +{ + FIXME ("(%p)\n", this); + return E_NOTIMPL; +} + +HRESULT WINAPI CExeDropHandler::SaveCompleted(LPCOLESTR pszFileName) +{ + FIXME ("(%p)\n", this); + return E_NOTIMPL; +} + +/************************************************************************ + * CFSFolder::GetClassID + */ +HRESULT WINAPI CExeDropHandler::GetClassID(CLSID * lpClassId) +{ + TRACE ("(%p)\n", this); + + if (!lpClassId) + return E_POINTER; + + *lpClassId = *pclsid; + + return S_OK; +} \ No newline at end of file diff --git a/reactos/dll/win32/shell32/droptargets/CexeDropHandler.h b/reactos/dll/win32/shell32/droptargets/CexeDropHandler.h new file mode 100644 index 00000000000..7a79f94aca3 --- /dev/null +++ b/reactos/dll/win32/shell32/droptargets/CexeDropHandler.h @@ -0,0 +1,66 @@ +/* + * executable drop target handler + * + * Copyright 2014 Huw Campbell + * + * 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 _CEXEDROPHANDLER_H_ +#define _CEXEDROPHANDLER_H_ + +class CExeDropHandler : + public CComCoClass, + public CComObjectRootEx, + public IDropTarget, + public IPersistFile +{ +private: + CLSID *pclsid; + LPWSTR sPathTarget; +public: + CExeDropHandler(); + ~CExeDropHandler(); + + // IDropTarget + virtual HRESULT WINAPI DragEnter(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); + virtual HRESULT WINAPI DragOver(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); + virtual HRESULT WINAPI DragLeave(); + virtual HRESULT WINAPI Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); + + // IPersist + virtual HRESULT WINAPI GetClassID(CLSID *lpClassId); + + //////// IPersistFile + virtual HRESULT WINAPI GetCurFile(LPOLESTR *ppszFileName); + virtual HRESULT WINAPI IsDirty(); + virtual HRESULT WINAPI Load(LPCOLESTR pszFileName, DWORD dwMode); + virtual HRESULT WINAPI Save(LPCOLESTR pszFileName, BOOL fRemember); + virtual HRESULT WINAPI SaveCompleted(LPCOLESTR pszFileName); + + +DECLARE_REGISTRY_RESOURCEID(IDR_EXEDROPHANDLER) +DECLARE_NOT_AGGREGATABLE(CExeDropHandler) + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CExeDropHandler) + COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist) + COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile) + COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget) +END_COM_MAP() +}; + +#endif /* _CEXEDROPHANDLER_H_ */ diff --git a/reactos/dll/win32/shell32/folders/desktop.cpp b/reactos/dll/win32/shell32/folders/desktop.cpp index 968bc35aa29..4f5ca9fe0c7 100644 --- a/reactos/dll/win32/shell32/folders/desktop.cpp +++ b/reactos/dll/win32/shell32/folders/desktop.cpp @@ -651,7 +651,7 @@ HRESULT WINAPI CDesktopFolder::GetUIObjectOf( else if (IsEqualIID (riid, IID_IDropTarget)) { /* only interested in attempting to bind to shell folders, not files, semicolon intentionate */ - if (cidl == 1 && SUCCEEDED(this->BindToObject(apidl[0], NULL, IID_IDropTarget, (LPVOID*)&pObj))); + if (cidl == 1 && SUCCEEDED(hr = this->_GetDropTarget(apidl[0], (LPVOID*)&pObj))); else hr = this->QueryInterface(IID_IDropTarget, (LPVOID*)&pObj); } @@ -1451,7 +1451,7 @@ HRESULT WINAPI CDesktopFolder::Drop(IDataObject *pDataObject, else { InitFormatEtc (formatetc, CF_HDROP, TYMED_HGLOBAL); - if SUCCEEDED(pDataObject->QueryGetData(&formatetc)); + if (SUCCEEDED(pDataObject->QueryGetData(&formatetc))) { passthroughtofs = TRUE; } @@ -1488,4 +1488,53 @@ HRESULT WINAPI CDesktopFolder::Drop(IDataObject *pDataObject, /* Todo, rewrite the registry such that the icons are well placed. Blocked by no bags implementation. */ return hr; +} + +HRESULT WINAPI CDesktopFolder::_GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut) { + HRESULT hr; + + TRACE("CFSFolder::_GetDropTarget entered\n"); + + if (_ILGetGUIDPointer (pidl) || _ILIsFolder (pidl)) + return this->BindToObject(pidl, NULL, IID_IDropTarget, ppvOut); + + LPITEMIDLIST pidlNext = NULL; + + STRRET strFile; + hr = this->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &strFile); + if (SUCCEEDED(hr)) + { + WCHAR wszPath[MAX_PATH]; + hr = StrRetToBufW(&strFile, pidl, wszPath, _countof(wszPath)); + + if (SUCCEEDED(hr)) + { + PathRemoveFileSpecW (wszPath); + hr = this->ParseDisplayName(NULL, NULL, wszPath, NULL, &pidlNext, NULL); + + if (SUCCEEDED(hr)) + { + IShellFolder *psf; + hr = this->BindToObject(pidlNext, NULL, IID_IShellFolder, (LPVOID*)&psf); + CoTaskMemFree(pidlNext); + if (SUCCEEDED(hr)) + { + hr = psf->GetUIObjectOf(NULL, 1, &pidl, IID_IDropTarget, NULL, ppvOut); + psf->Release(); + if (FAILED(hr)) + ERR("FS GetUIObjectOf failed: %x\n", hr); + } + else + ERR("BindToObject failed: %x\n", hr); + } + else + ERR("ParseDisplayName failed: %x\n", hr); + } + else + ERR("StrRetToBufW failed: %x\n", hr); + } + else + ERR("GetDisplayNameOf failed: %x\n", hr); + + return hr; } \ No newline at end of file diff --git a/reactos/dll/win32/shell32/folders/desktop.h b/reactos/dll/win32/shell32/folders/desktop.h index 6f4c723d06a..be62108ff10 100644 --- a/reactos/dll/win32/shell32/folders/desktop.h +++ b/reactos/dll/win32/shell32/folders/desktop.h @@ -40,6 +40,7 @@ class CDesktopFolder : BOOL fAcceptFmt; /* flag for pending Drop */ BOOL QueryDrop (DWORD dwKeyState, LPDWORD pdwEffect); void SF_RegisterClipFmt(); + virtual HRESULT WINAPI _GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut); public: CDesktopFolder(); diff --git a/reactos/dll/win32/shell32/folders/fs.cpp b/reactos/dll/win32/shell32/folders/fs.cpp index 5e61e7196f9..76e19a00543 100644 --- a/reactos/dll/win32/shell32/folders/fs.cpp +++ b/reactos/dll/win32/shell32/folders/fs.cpp @@ -81,6 +81,7 @@ CFSFolder::CFSFolder() cfShellIDList = 0; SF_RegisterClipFmt(); fAcceptFmt = FALSE; + m_bGroupPolicyActive = 0; } CFSFolder::~CFSFolder() @@ -502,7 +503,7 @@ HRESULT WINAPI CFSFolder::GetUIObjectOf(HWND hwndOwner, else if (IsEqualIID (riid, IID_IDropTarget)) { /* only interested in attempting to bind to shell folders, not files (except exe), so if we fail, rebind to root */ - if (cidl == 1 && SUCCEEDED(hr = this->BindToObject(apidl[0], NULL, IID_IDropTarget, (LPVOID*)&pObj))); + if (cidl == 1 && SUCCEEDED(hr = this->_GetDropTarget(apidl[0], (LPVOID*)&pObj))); else hr = this->QueryInterface(IID_IDropTarget, (LPVOID*)&pObj); } @@ -1617,6 +1618,9 @@ HRESULT WINAPI CFSFolder::_DoDrop(IDataObject *pDataObject, } hr = ppf->Save(wszTarget, FALSE); + if (FAILED(hr)) + break; + SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, wszTarget, NULL); } else { @@ -1653,6 +1657,9 @@ HRESULT WINAPI CFSFolder::_DoDrop(IDataObject *pDataObject, break; hr = ppf->Save(wszTarget, TRUE); + if (FAILED(hr)) + break; + SHChangeNotify(SHCNE_CREATE, SHCNF_PATHW, wszTarget, NULL); } } } @@ -1748,4 +1755,114 @@ DWORD WINAPI CFSFolder::_DoDropThreadProc(LPVOID lpParameter) { //Release the parameter from the heap. HeapFree(GetProcessHeap(), 0, data); return 0; +} + +HRESULT WINAPI CFSFolder::_GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut) { + HKEY hKey; + HRESULT hr; + + TRACE("CFSFolder::_GetDropTarget entered\n"); + + if (_ILGetGUIDPointer (pidl) || _ILIsFolder (pidl)) + return this->BindToObject(pidl, NULL, IID_IDropTarget, ppvOut); + + STRRET strFile; + hr = this->GetDisplayNameOf(pidl, SHGDN_FORPARSING, &strFile); + if (hr == S_OK) + { + WCHAR wszPath[MAX_PATH]; + hr = StrRetToBufW(&strFile, pidl, wszPath, _countof(wszPath)); + + if (hr == S_OK) + { + LPCWSTR pwszExt = PathFindExtensionW(wszPath); + if (pwszExt[0]) + { + /* enumerate dynamic/static for a given file class */ + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, pwszExt, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + /* load dynamic extensions from file extension key, for example .jpg */ + _LoadDynamicDropTargetHandlerForKey(hKey, wszPath, ppvOut); + RegCloseKey(hKey); + } + + WCHAR wszTemp[40]; + DWORD dwSize = sizeof(wszTemp); + if (RegGetValueW(HKEY_CLASSES_ROOT, pwszExt, NULL, RRF_RT_REG_SZ, NULL, wszTemp, &dwSize) == ERROR_SUCCESS) + { + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, wszTemp, 0, KEY_READ, &hKey) == ERROR_SUCCESS) + { + /* load dynamic extensions from progid key, for example jpegfile */ + _LoadDynamicDropTargetHandlerForKey(hKey, wszPath, ppvOut); + RegCloseKey(hKey); + } + } + } + } + } + else + ERR("GetDisplayNameOf failed: %x\n", hr); + + return hr; +} + +HRESULT WINAPI CFSFolder::_LoadDynamicDropTargetHandlerForKey(HKEY hRootKey, LPCWSTR pwcsname, LPVOID *ppvOut) +{ + TRACE("CFSFolder::_LoadDynamicDropTargetHandlerForKey entered\n"); + + WCHAR wszName[MAX_PATH], *pwszClsid; + DWORD dwSize = sizeof(wszName); + HRESULT hr; + + if (RegGetValueW(hRootKey, L"shellex\\DropHandler", NULL, RRF_RT_REG_SZ, NULL, wszName, &dwSize) == ERROR_SUCCESS) + { + CLSID clsid; + hr = CLSIDFromString(wszName, &clsid); + if (hr == S_OK) + pwszClsid = wszName; + + if (m_bGroupPolicyActive) + { + if (RegGetValueW(HKEY_LOCAL_MACHINE, + L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved", + pwszClsid, + RRF_RT_REG_SZ, + NULL, + NULL, + NULL) == ERROR_SUCCESS) + { + hr = _LoadDynamicDropTargetHandler(&clsid, pwcsname, ppvOut); + } + } + else + { + hr = _LoadDynamicDropTargetHandler(&clsid, pwcsname, ppvOut); + } + } + else + return E_FAIL; + return hr; +} + +HRESULT WINAPI CFSFolder::_LoadDynamicDropTargetHandler(const CLSID *pclsid, LPCWSTR pwcsname, LPVOID *ppvOut) +{ + TRACE("CFSFolder::_LoadDynamicDropTargetHandler entered\n"); + HRESULT hr; + + IPersistFile *pp; + hr = SHCoCreateInstance(NULL, pclsid, NULL, IID_PPV_ARG(IPersistFile, &pp)); + if (hr != S_OK) + { + ERR("SHCoCreateInstance failed %x\n", GetLastError()); + } + pp->Load(pwcsname, 0); + + hr = pp->QueryInterface(IID_PPV_ARG(IDropTarget, (IDropTarget**) ppvOut)); + if (hr != S_OK) + { + ERR("Failed to query for interface IID_IShellExtInit hr %x pclsid %s\n", hr, wine_dbgstr_guid(pclsid)); + return hr; + } + pp->Release(); + return hr; } \ No newline at end of file diff --git a/reactos/dll/win32/shell32/folders/fs.h b/reactos/dll/win32/shell32/folders/fs.h index e32ab2b7aa8..95ca362ccfe 100644 --- a/reactos/dll/win32/shell32/folders/fs.h +++ b/reactos/dll/win32/shell32/folders/fs.h @@ -44,10 +44,14 @@ class CFSFolder : UINT cfShellIDList; /* clipboardformat for IDropTarget */ BOOL fAcceptFmt; /* flag for pending Drop */ BOOL QueryDrop (DWORD dwKeyState, LPDWORD pdwEffect); + DWORD m_bGroupPolicyActive; void SF_RegisterClipFmt(); BOOL GetUniqueFileName(LPWSTR pwszBasePath, LPCWSTR pwszExt, LPWSTR pwszTarget, BOOL bShortcut); static DWORD WINAPI _DoDropThreadProc(LPVOID lpParameter); virtual HRESULT WINAPI _DoDrop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); + virtual HRESULT WINAPI _GetDropTarget(LPCITEMIDLIST pidl, LPVOID *ppvOut); + virtual HRESULT WINAPI _LoadDynamicDropTargetHandlerForKey(HKEY hRootKey, LPCWSTR pwcsname, LPVOID *ppvOut); + virtual HRESULT WINAPI _LoadDynamicDropTargetHandler(const CLSID *pclsid, LPCWSTR pwcsname, LPVOID *ppvOut); public: CFSFolder(); diff --git a/reactos/dll/win32/shell32/folders/mydocuments.cpp b/reactos/dll/win32/shell32/folders/mydocuments.cpp index 7c1cbd93e0d..f1a0238f936 100644 --- a/reactos/dll/win32/shell32/folders/mydocuments.cpp +++ b/reactos/dll/win32/shell32/folders/mydocuments.cpp @@ -78,6 +78,7 @@ CMyDocsFolder::CMyDocsFolder() { pidlRoot = NULL; sPathTarget = NULL; + mFSDropTarget = NULL; } CMyDocsFolder::~CMyDocsFolder() @@ -85,6 +86,7 @@ CMyDocsFolder::~CMyDocsFolder() TRACE ("-- destroying IShellFolder(%p)\n", this); SHFree(pidlRoot); HeapFree(GetProcessHeap(), 0, sPathTarget); + mFSDropTarget->Release(); } HRESULT WINAPI CMyDocsFolder::FinalConstruct() @@ -98,6 +100,29 @@ HRESULT WINAPI CMyDocsFolder::FinalConstruct() sPathTarget = (LPWSTR)SHAlloc((wcslen(szMyPath) + 1) * sizeof(WCHAR)); wcscpy(sPathTarget, szMyPath); + LPITEMIDLIST pidl = NULL; + + WCHAR szPath[MAX_PATH]; + lstrcpynW(szPath, sPathTarget, MAX_PATH); + PathAddBackslashW(szPath); + CComPtr psfDesktop = NULL; + + HRESULT hr = SHGetDesktopFolder(&psfDesktop); + if (SUCCEEDED(hr)) + hr = psfDesktop->ParseDisplayName(NULL, NULL, szPath, NULL, &pidl, NULL); + else + ERR("Error getting desktop folder\n"); + + if (SUCCEEDED(hr)) + { + hr = psfDesktop->BindToObject(pidl, NULL, IID_IDropTarget, (LPVOID*) &mFSDropTarget); + CoTaskMemFree(pidl); + if (FAILED(hr)) + ERR("Error Binding"); + } + else + ERR("Error creating from %s\n", debugstr_w(szPath)); + return S_OK; } @@ -271,8 +296,7 @@ HRESULT WINAPI CMyDocsFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO if (IsEqualIID (riid, IID_IDropTarget)) { - WARN ("IDropTarget not implemented\n"); - hr = E_NOTIMPL; + hr = this->QueryInterface (IID_IDropTarget, ppvOut); } else if (IsEqualIID (riid, IID_IContextMenu)) { @@ -679,3 +703,26 @@ HRESULT WINAPI CMyDocsFolder::GetCurFolder(LPITEMIDLIST *pidl) *pidl = ILClone (pidlRoot); return S_OK; } + +HRESULT WINAPI CMyDocsFolder::DragEnter(IDataObject *pDataObject, + DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) +{ + return mFSDropTarget->DragEnter(pDataObject, dwKeyState, pt, pdwEffect); +} + +HRESULT WINAPI CMyDocsFolder::DragOver(DWORD dwKeyState, POINTL pt, + DWORD *pdwEffect) +{ + return mFSDropTarget->DragOver(dwKeyState, pt, pdwEffect); +} + +HRESULT WINAPI CMyDocsFolder::DragLeave() +{ + return mFSDropTarget->DragLeave(); +} + +HRESULT WINAPI CMyDocsFolder::Drop(IDataObject *pDataObject, + DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) +{ + return mFSDropTarget->Drop(pDataObject, dwKeyState, pt, pdwEffect); +} \ No newline at end of file diff --git a/reactos/dll/win32/shell32/folders/mydocuments.h b/reactos/dll/win32/shell32/folders/mydocuments.h index c52ffe5346f..3a70e8c3d26 100644 --- a/reactos/dll/win32/shell32/folders/mydocuments.h +++ b/reactos/dll/win32/shell32/folders/mydocuments.h @@ -26,12 +26,14 @@ class CMyDocsFolder : public CComCoClass, public CComObjectRootEx, public IShellFolder2, - public IPersistFolder2 + public IPersistFolder2, + public IDropTarget { private: /* both paths are parsible from the MyDocuments */ LPWSTR sPathTarget; /* complete path to target used for enumeration and ChangeNotify */ LPITEMIDLIST pidlRoot; /* absolute pidl */ + IDropTarget *mFSDropTarget; public: CMyDocsFolder(); ~CMyDocsFolder(); @@ -67,6 +69,12 @@ class CMyDocsFolder : // IPersistFolder2 virtual HRESULT WINAPI GetCurFolder(LPITEMIDLIST * pidl); + // IDropTarget + virtual HRESULT WINAPI DragEnter(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); + virtual HRESULT WINAPI DragOver(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); + virtual HRESULT WINAPI DragLeave(); + virtual HRESULT WINAPI Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); + DECLARE_REGISTRY_RESOURCEID(IDR_MYDOCUMENTS) DECLARE_NOT_AGGREGATABLE(CMyDocsFolder) @@ -78,6 +86,7 @@ class CMyDocsFolder : COM_INTERFACE_ENTRY_IID(IID_IPersistFolder, IPersistFolder) COM_INTERFACE_ENTRY_IID(IID_IPersistFolder2, IPersistFolder2) COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersist) + COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget) END_COM_MAP() }; diff --git a/reactos/dll/win32/shell32/folders/recyclebin.cpp b/reactos/dll/win32/shell32/folders/recyclebin.cpp index 733873a807b..648debf6a47 100644 --- a/reactos/dll/win32/shell32/folders/recyclebin.cpp +++ b/reactos/dll/win32/shell32/folders/recyclebin.cpp @@ -1416,7 +1416,7 @@ BOOL CRecycleBin::QueryDrop(DWORD dwKeyState, LPDWORD pdwEffect) HRESULT WINAPI CRecycleBin::DragEnter(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) { - FIXME("Recycle bin drag over (%p)\n", this); + TRACE("Recycle bin drag over (%p)\n", this); /* The recycle bin accepts pretty much everything, and sets a CSIDL flag. */ fAcceptFmt = TRUE; @@ -1449,7 +1449,7 @@ HRESULT WINAPI CRecycleBin::DragLeave() HRESULT WINAPI CRecycleBin::Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) { - FIXME("(%p) object dropped on recycle bin, effect %u\n", this, *pdwEffect); + TRACE("(%p) object dropped on recycle bin, effect %u\n", this, *pdwEffect); /* TODO: pdwEffect should be read and make the drop object be permanently deleted in the move case (shift held) */ diff --git a/reactos/dll/win32/shell32/precomp.h b/reactos/dll/win32/shell32/precomp.h index f464d095bcf..a2a648ba3de 100644 --- a/reactos/dll/win32/shell32/precomp.h +++ b/reactos/dll/win32/shell32/precomp.h @@ -55,6 +55,7 @@ #include "folders/printers.h" #include "folders/admintools.h" #include "folders/recyclebin.h" +#include "droptargets/CexeDropHandler.h" #include "openwithmenu.h" #include "newmenu.h" #include "startmenu.h" diff --git a/reactos/dll/win32/shell32/res/rgs/exedrophandler.rgs b/reactos/dll/win32/shell32/res/rgs/exedrophandler.rgs new file mode 100644 index 00000000000..7e239c975aa --- /dev/null +++ b/reactos/dll/win32/shell32/res/rgs/exedrophandler.rgs @@ -0,0 +1,13 @@ +HKCR +{ + NoRemove CLSID + { + ForceRemove {86C86720-42A0-1069-A2E8-08002B30309D} = s 'Executable Drag and Drop target' + { + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + } + } +} diff --git a/reactos/dll/win32/shell32/rgs_res.rc b/reactos/dll/win32/shell32/rgs_res.rc index 4ded01df5eb..7cab2161e66 100644 --- a/reactos/dll/win32/shell32/rgs_res.rc +++ b/reactos/dll/win32/shell32/rgs_res.rc @@ -23,3 +23,4 @@ IDR_STARTMENU REGISTRY "res/rgs/startmenu.rgs" IDR_OPENWITHMENU REGISTRY "res/rgs/openwithmenu.rgs" IDR_FILEDEFEXT REGISTRY "res/rgs/shellfiledefext.rgs" IDR_DRVDEFEXT REGISTRY "res/rgs/shelldrvdefext.rgs" +IDR_EXEDROPHANDLER REGISTRY "res/rgs/exedrophandler.rgs" \ No newline at end of file diff --git a/reactos/dll/win32/shell32/shell32_main.cpp b/reactos/dll/win32/shell32/shell32_main.cpp index 21ccb1aa81d..beeff9dc152 100644 --- a/reactos/dll/win32/shell32/shell32_main.cpp +++ b/reactos/dll/win32/shell32/shell32_main.cpp @@ -1371,6 +1371,7 @@ BEGIN_OBJECT_MAP(ObjectMap) OBJECT_ENTRY(CLSID_MenuBandSite, CMenuBandSite) OBJECT_ENTRY(CLSID_MenuBand, CMenuBand) OBJECT_ENTRY(CLSID_MenuDeskBar, CMenuDeskBar) + OBJECT_ENTRY(CLSID_ExeDropHandler, CExeDropHandler) END_OBJECT_MAP() CShell32Module gModule; diff --git a/reactos/dll/win32/shell32/shelllink.cpp b/reactos/dll/win32/shell32/shelllink.cpp index fd54ee719fe..4982f7da306 100644 --- a/reactos/dll/win32/shell32/shelllink.cpp +++ b/reactos/dll/win32/shell32/shelllink.cpp @@ -2168,6 +2168,68 @@ HRESULT WINAPI CShellLink::GetSite(REFIID iid, void ** ppvSite) return site->QueryInterface(iid, ppvSite); } +HRESULT WINAPI CShellLink::DragEnter(IDataObject *pDataObject, + DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) +{ + TRACE("(%p)->(DataObject=%p)\n", this, pDataObject); + LPCITEMIDLIST pidlLast; + IShellFolder *psf; + + HRESULT hr = SHBindToParent(pPidl, IID_PPV_ARG(IShellFolder, &psf), &pidlLast); + + if (SUCCEEDED(hr)) + { + hr = psf->GetUIObjectOf(0, 1, &pidlLast, IID_IDropTarget, NULL, (LPVOID*)&mDropTarget); + + if (SUCCEEDED(hr)) + hr = mDropTarget->DragEnter(pDataObject, dwKeyState, pt, pdwEffect); + else + *pdwEffect = DROPEFFECT_NONE; + + psf->Release(); + } + else + *pdwEffect = DROPEFFECT_NONE; + + return S_OK; +} + + + +HRESULT WINAPI CShellLink::DragOver(DWORD dwKeyState, POINTL pt, + DWORD *pdwEffect) +{ + TRACE("(%p)\n", this); + HRESULT hr = S_OK; + if (mDropTarget) + hr = mDropTarget->DragOver(dwKeyState, pt, pdwEffect); + return hr; +} + +HRESULT WINAPI CShellLink::DragLeave() +{ + TRACE("(%p)\n", this); + HRESULT hr = S_OK; + if (mDropTarget) + { + hr = mDropTarget->DragLeave(); + mDropTarget->Release(); + } + + return hr; +} + +HRESULT WINAPI CShellLink::Drop(IDataObject *pDataObject, + DWORD dwKeyState, POINTL pt, DWORD *pdwEffect) +{ + TRACE("(%p)\n", this); + HRESULT hr = S_OK; + if (mDropTarget) + hr = mDropTarget->Drop(pDataObject, dwKeyState, pt, pdwEffect); + + return hr; +} + /************************************************************************** * IShellLink_ConstructFromFile */ diff --git a/reactos/dll/win32/shell32/shelllink.h b/reactos/dll/win32/shell32/shelllink.h index 47cb0fa8abb..3ccfd3df61a 100644 --- a/reactos/dll/win32/shell32/shelllink.h +++ b/reactos/dll/win32/shell32/shelllink.h @@ -25,140 +25,148 @@ #define _SHELLLINK_H_ class CShellLink : - public CComCoClass, - public CComObjectRootEx, - public IShellLinkA, - public IShellLinkW, - public IPersistFile, - public IPersistStream, - public IShellLinkDataList, - public IShellExtInit, - public IContextMenu, - public IObjectWithSite, - public IShellPropSheetExt + public CComCoClass, + public CComObjectRootEx, + public IShellLinkA, + public IShellLinkW, + public IPersistFile, + public IPersistStream, + public IShellLinkDataList, + public IShellExtInit, + public IContextMenu, + public IDropTarget, + public IObjectWithSite, + public IShellPropSheetExt { public: - /* link file formats */ + /* link file formats */ - #include "pshpack1.h" + #include "pshpack1.h" - struct volume_info - { - DWORD type; - DWORD serial; - WCHAR label[12]; /* assume 8.3 */ - }; + struct volume_info + { + DWORD type; + DWORD serial; + WCHAR label[12]; /* assume 8.3 */ + }; - #include "poppack.h" + #include "poppack.h" private: - /* data structures according to the information in the link */ - LPITEMIDLIST pPidl; - WORD wHotKey; - SYSTEMTIME time1; - SYSTEMTIME time2; - SYSTEMTIME time3; + /* data structures according to the information in the link */ + LPITEMIDLIST pPidl; + WORD wHotKey; + SYSTEMTIME time1; + SYSTEMTIME time2; + SYSTEMTIME time3; - DWORD iShowCmd; - LPWSTR sIcoPath; - INT iIcoNdx; - LPWSTR sPath; - LPWSTR sArgs; - LPWSTR sWorkDir; - LPWSTR sDescription; - LPWSTR sPathRel; - LPWSTR sProduct; - LPWSTR sComponent; - volume_info volume; - LPWSTR sLinkPath; - BOOL bRunAs; - BOOL bDirty; - INT iIdOpen; /* id of the "Open" entry in the context menu */ - CComPtr site; + DWORD iShowCmd; + LPWSTR sIcoPath; + INT iIcoNdx; + LPWSTR sPath; + LPWSTR sArgs; + LPWSTR sWorkDir; + LPWSTR sDescription; + LPWSTR sPathRel; + LPWSTR sProduct; + LPWSTR sComponent; + volume_info volume; + LPWSTR sLinkPath; + BOOL bRunAs; + BOOL bDirty; + INT iIdOpen; /* id of the "Open" entry in the context menu */ + CComPtr site; + IDropTarget *mDropTarget; public: - CShellLink(); - ~CShellLink(); - LPWSTR ShellLink_GetAdvertisedArg(LPCWSTR str); - HRESULT ShellLink_SetAdvertiseInfo(LPCWSTR str); - static INT_PTR CALLBACK SH_ShellLinkDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); + CShellLink(); + ~CShellLink(); + LPWSTR ShellLink_GetAdvertisedArg(LPCWSTR str); + HRESULT ShellLink_SetAdvertiseInfo(LPCWSTR str); + static INT_PTR CALLBACK SH_ShellLinkDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); - // IPersistFile - virtual HRESULT WINAPI GetClassID(CLSID *pclsid); - virtual HRESULT WINAPI IsDirty(); - virtual HRESULT WINAPI Load(LPCOLESTR pszFileName, DWORD dwMode); - virtual HRESULT WINAPI Save(LPCOLESTR pszFileName, BOOL fRemember); - virtual HRESULT WINAPI SaveCompleted(LPCOLESTR pszFileName); - virtual HRESULT WINAPI GetCurFile(LPOLESTR *ppszFileName); + // IPersistFile + virtual HRESULT WINAPI GetClassID(CLSID *pclsid); + virtual HRESULT WINAPI IsDirty(); + virtual HRESULT WINAPI Load(LPCOLESTR pszFileName, DWORD dwMode); + virtual HRESULT WINAPI Save(LPCOLESTR pszFileName, BOOL fRemember); + virtual HRESULT WINAPI SaveCompleted(LPCOLESTR pszFileName); + virtual HRESULT WINAPI GetCurFile(LPOLESTR *ppszFileName); - // IPersistStream -// virtual WINAPI HRESULT GetClassID(CLSID *pclsid); -// virtual HRESULT WINAPI IsDirty(); - virtual HRESULT WINAPI Load(IStream *stm); - virtual HRESULT WINAPI Save(IStream *stm, BOOL fClearDirty); - virtual HRESULT WINAPI GetSizeMax(ULARGE_INTEGER *pcbSize); + // IPersistStream + // virtual WINAPI HRESULT GetClassID(CLSID *pclsid); + // virtual HRESULT WINAPI IsDirty(); + virtual HRESULT WINAPI Load(IStream *stm); + virtual HRESULT WINAPI Save(IStream *stm, BOOL fClearDirty); + virtual HRESULT WINAPI GetSizeMax(ULARGE_INTEGER *pcbSize); - // IShellLinkA - virtual HRESULT WINAPI GetPath(LPSTR pszFile, INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags); - virtual HRESULT WINAPI GetIDList(LPITEMIDLIST * ppidl); - virtual HRESULT WINAPI SetIDList(LPCITEMIDLIST pidl); - virtual HRESULT WINAPI GetDescription(LPSTR pszName,INT cchMaxName); - virtual HRESULT WINAPI SetDescription(LPCSTR pszName); - virtual HRESULT WINAPI GetWorkingDirectory(LPSTR pszDir,INT cchMaxPath); - virtual HRESULT WINAPI SetWorkingDirectory(LPCSTR pszDir); - virtual HRESULT WINAPI GetArguments(LPSTR pszArgs,INT cchMaxPath); - virtual HRESULT WINAPI SetArguments(LPCSTR pszArgs); - virtual HRESULT WINAPI GetHotkey(WORD *pwHotkey); - virtual HRESULT WINAPI SetHotkey(WORD wHotkey); - virtual HRESULT WINAPI GetShowCmd(INT *piShowCmd); - virtual HRESULT WINAPI SetShowCmd(INT iShowCmd); - virtual HRESULT WINAPI GetIconLocation(LPSTR pszIconPath,INT cchIconPath,INT *piIcon); - virtual HRESULT WINAPI SetIconLocation(LPCSTR pszIconPath,INT iIcon); - virtual HRESULT WINAPI SetRelativePath(LPCSTR pszPathRel, DWORD dwReserved); - virtual HRESULT WINAPI Resolve(HWND hwnd, DWORD fFlags); - virtual HRESULT WINAPI SetPath(LPCSTR pszFile); + // IShellLinkA + virtual HRESULT WINAPI GetPath(LPSTR pszFile, INT cchMaxPath, WIN32_FIND_DATAA *pfd, DWORD fFlags); + virtual HRESULT WINAPI GetIDList(LPITEMIDLIST * ppidl); + virtual HRESULT WINAPI SetIDList(LPCITEMIDLIST pidl); + virtual HRESULT WINAPI GetDescription(LPSTR pszName,INT cchMaxName); + virtual HRESULT WINAPI SetDescription(LPCSTR pszName); + virtual HRESULT WINAPI GetWorkingDirectory(LPSTR pszDir,INT cchMaxPath); + virtual HRESULT WINAPI SetWorkingDirectory(LPCSTR pszDir); + virtual HRESULT WINAPI GetArguments(LPSTR pszArgs,INT cchMaxPath); + virtual HRESULT WINAPI SetArguments(LPCSTR pszArgs); + virtual HRESULT WINAPI GetHotkey(WORD *pwHotkey); + virtual HRESULT WINAPI SetHotkey(WORD wHotkey); + virtual HRESULT WINAPI GetShowCmd(INT *piShowCmd); + virtual HRESULT WINAPI SetShowCmd(INT iShowCmd); + virtual HRESULT WINAPI GetIconLocation(LPSTR pszIconPath,INT cchIconPath,INT *piIcon); + virtual HRESULT WINAPI SetIconLocation(LPCSTR pszIconPath,INT iIcon); + virtual HRESULT WINAPI SetRelativePath(LPCSTR pszPathRel, DWORD dwReserved); + virtual HRESULT WINAPI Resolve(HWND hwnd, DWORD fFlags); + virtual HRESULT WINAPI SetPath(LPCSTR pszFile); - // IShellLinkW - virtual HRESULT WINAPI GetPath(LPWSTR pszFile, INT cchMaxPath, WIN32_FIND_DATAW *pfd, DWORD fFlags); -// virtual HRESULT WINAPI GetIDList(LPITEMIDLIST *ppidl); -// virtual HRESULT WINAPI SetIDList(LPCITEMIDLIST pidl); - virtual HRESULT WINAPI GetDescription(LPWSTR pszName, INT cchMaxName); - virtual HRESULT WINAPI SetDescription(LPCWSTR pszName); - virtual HRESULT WINAPI GetWorkingDirectory(LPWSTR pszDir, INT cchMaxPath); - virtual HRESULT WINAPI SetWorkingDirectory(LPCWSTR pszDir); - virtual HRESULT WINAPI GetArguments(LPWSTR pszArgs,INT cchMaxPath); - virtual HRESULT WINAPI SetArguments(LPCWSTR pszArgs); -// virtual HRESULT WINAPI GetHotkey(WORD *pwHotkey); -// virtual HRESULT WINAPI SetHotkey(WORD wHotkey); -// virtual HRESULT WINAPI GetShowCmd(INT *piShowCmd); -// virtual HRESULT WINAPI SetShowCmd(INT iShowCmd); - virtual HRESULT WINAPI GetIconLocation(LPWSTR pszIconPath,INT cchIconPath,INT *piIcon); - virtual HRESULT WINAPI SetIconLocation(LPCWSTR pszIconPath,INT iIcon); - virtual HRESULT WINAPI SetRelativePath(LPCWSTR pszPathRel, DWORD dwReserved); -// virtual HRESULT WINAPI Resolve(HWND hwnd, DWORD fFlags); - virtual HRESULT WINAPI SetPath(LPCWSTR pszFile); + // IShellLinkW + virtual HRESULT WINAPI GetPath(LPWSTR pszFile, INT cchMaxPath, WIN32_FIND_DATAW *pfd, DWORD fFlags); + // virtual HRESULT WINAPI GetIDList(LPITEMIDLIST *ppidl); + // virtual HRESULT WINAPI SetIDList(LPCITEMIDLIST pidl); + virtual HRESULT WINAPI GetDescription(LPWSTR pszName, INT cchMaxName); + virtual HRESULT WINAPI SetDescription(LPCWSTR pszName); + virtual HRESULT WINAPI GetWorkingDirectory(LPWSTR pszDir, INT cchMaxPath); + virtual HRESULT WINAPI SetWorkingDirectory(LPCWSTR pszDir); + virtual HRESULT WINAPI GetArguments(LPWSTR pszArgs,INT cchMaxPath); + virtual HRESULT WINAPI SetArguments(LPCWSTR pszArgs); + // virtual HRESULT WINAPI GetHotkey(WORD *pwHotkey); + // virtual HRESULT WINAPI SetHotkey(WORD wHotkey); + // virtual HRESULT WINAPI GetShowCmd(INT *piShowCmd); + // virtual HRESULT WINAPI SetShowCmd(INT iShowCmd); + virtual HRESULT WINAPI GetIconLocation(LPWSTR pszIconPath,INT cchIconPath,INT *piIcon); + virtual HRESULT WINAPI SetIconLocation(LPCWSTR pszIconPath,INT iIcon); + virtual HRESULT WINAPI SetRelativePath(LPCWSTR pszPathRel, DWORD dwReserved); + // virtual HRESULT WINAPI Resolve(HWND hwnd, DWORD fFlags); + virtual HRESULT WINAPI SetPath(LPCWSTR pszFile); - // IShellLinkDataList - virtual HRESULT WINAPI AddDataBlock(void *pDataBlock); - virtual HRESULT WINAPI CopyDataBlock(DWORD dwSig, void **ppDataBlock); - virtual HRESULT WINAPI RemoveDataBlock(DWORD dwSig); - virtual HRESULT WINAPI GetFlags(DWORD *pdwFlags); - virtual HRESULT WINAPI SetFlags(DWORD dwFlags); + // IShellLinkDataList + virtual HRESULT WINAPI AddDataBlock(void *pDataBlock); + virtual HRESULT WINAPI CopyDataBlock(DWORD dwSig, void **ppDataBlock); + virtual HRESULT WINAPI RemoveDataBlock(DWORD dwSig); + virtual HRESULT WINAPI GetFlags(DWORD *pdwFlags); + virtual HRESULT WINAPI SetFlags(DWORD dwFlags); - // IShellExtInit - virtual HRESULT WINAPI Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID); + // IShellExtInit + virtual HRESULT WINAPI Initialize(LPCITEMIDLIST pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID); - // IContextMenu - virtual HRESULT WINAPI QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); - virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpici); - virtual HRESULT WINAPI GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax); + // IContextMenu + virtual HRESULT WINAPI QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags); + virtual HRESULT WINAPI InvokeCommand(LPCMINVOKECOMMANDINFO lpici); + virtual HRESULT WINAPI GetCommandString(UINT_PTR idCmd, UINT uType, UINT *pwReserved, LPSTR pszName, UINT cchMax); - // IShellPropSheetExt - virtual HRESULT WINAPI AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam); - virtual HRESULT WINAPI ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam); + // IShellPropSheetExt + virtual HRESULT WINAPI AddPages(LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam); + virtual HRESULT WINAPI ReplacePage(UINT uPageID, LPFNADDPROPSHEETPAGE pfnReplacePage, LPARAM lParam); - // IObjectWithSite - virtual HRESULT WINAPI SetSite(IUnknown *punk); - virtual HRESULT WINAPI GetSite(REFIID iid, void **ppvSite); + // IObjectWithSite + virtual HRESULT WINAPI SetSite(IUnknown *punk); + virtual HRESULT WINAPI GetSite(REFIID iid, void **ppvSite); + + // IDropTarget + virtual HRESULT WINAPI DragEnter(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); + virtual HRESULT WINAPI DragOver(DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); + virtual HRESULT WINAPI DragLeave(); + virtual HRESULT WINAPI Drop(IDataObject *pDataObject, DWORD dwKeyState, POINTL pt, DWORD *pdwEffect); DECLARE_REGISTRY_RESOURCEID(IDR_SHELLLINK) DECLARE_NOT_AGGREGATABLE(CShellLink) @@ -166,16 +174,17 @@ DECLARE_NOT_AGGREGATABLE(CShellLink) DECLARE_PROTECT_FINAL_CONSTRUCT() BEGIN_COM_MAP(CShellLink) - COM_INTERFACE_ENTRY2_IID(IID_IPersist, IPersist, IPersistFile) - COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile) - COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream) - COM_INTERFACE_ENTRY_IID(IID_IShellLinkA, IShellLinkA) - COM_INTERFACE_ENTRY_IID(IID_IShellLinkW, IShellLinkW) - COM_INTERFACE_ENTRY_IID(IID_IShellLinkDataList, IShellLinkDataList) - COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit) - COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu) - COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt) - COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite) + COM_INTERFACE_ENTRY2_IID(IID_IPersist, IPersist, IPersistFile) + COM_INTERFACE_ENTRY_IID(IID_IPersistFile, IPersistFile) + COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream) + COM_INTERFACE_ENTRY_IID(IID_IShellLinkA, IShellLinkA) + COM_INTERFACE_ENTRY_IID(IID_IShellLinkW, IShellLinkW) + COM_INTERFACE_ENTRY_IID(IID_IShellLinkDataList, IShellLinkDataList) + COM_INTERFACE_ENTRY_IID(IID_IShellExtInit, IShellExtInit) + COM_INTERFACE_ENTRY_IID(IID_IContextMenu, IContextMenu) + COM_INTERFACE_ENTRY_IID(IID_IDropTarget, IDropTarget) + COM_INTERFACE_ENTRY_IID(IID_IShellPropSheetExt, IShellPropSheetExt) + COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite) END_COM_MAP() }; diff --git a/reactos/dll/win32/shell32/shfldr.h b/reactos/dll/win32/shell32/shfldr.h index 8a194ce17d5..81111ce4999 100644 --- a/reactos/dll/win32/shell32/shfldr.h +++ b/reactos/dll/win32/shell32/shfldr.h @@ -1,10 +1,10 @@ /* - * Virtual Folder - * common definitions + * Virtual Folder + * common definitions * - * Copyright 1997 Marcus Meissner - * Copyright 1998, 1999, 2002 Juergen Schmied + * Copyright 1997 Marcus Meissner + * Copyright 1998, 1999, 2002 Juergen Schmied * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -40,13 +40,13 @@ BOOL SHELL32_GetCustomFolderAttribute (LPCITEMIDLIST pidl, LPCWSTR pwszHeading, LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut); HRESULT SHELL32_ParseNextElement (IShellFolder2 * psf, HWND hwndOwner, LPBC pbc, LPITEMIDLIST * pidlInOut, - LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes); + LPOLESTR szNext, DWORD * pEaten, DWORD * pdwAttributes); HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWORD pdwAttributes); HRESULT SHELL32_GetDisplayNameOfChild (IShellFolder2 * psf, LPCITEMIDLIST pidl, DWORD dwFlags, LPWSTR szOut, - DWORD dwOutLen); + DWORD dwOutLen); HRESULT SHELL32_BindToChild (LPCITEMIDLIST pidlRoot, - LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut); + LPCWSTR pathRoot, LPCITEMIDLIST pidlComplete, REFIID riid, LPVOID * ppvOut); HRESULT SHELL32_CompareIDs (IShellFolder * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2); LPITEMIDLIST SHELL32_CreatePidlFromBindCtx(IBindCtx *pbc, LPCWSTR path); diff --git a/reactos/dll/win32/shell32/shlfileop.cpp b/reactos/dll/win32/shell32/shlfileop.cpp index 1135afc258a..8fe73ffb51b 100644 --- a/reactos/dll/win32/shell32/shlfileop.cpp +++ b/reactos/dll/win32/shell32/shlfileop.cpp @@ -42,7 +42,7 @@ static const WCHAR wWildcardChars[] = {'*','?',0}; static DWORD SHNotifyCreateDirectoryW(LPCWSTR path, LPSECURITY_ATTRIBUTES sec); static DWORD SHNotifyRemoveDirectoryW(LPCWSTR path); static DWORD SHNotifyDeleteFileW(LPCWSTR path); -static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest); +static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest, BOOL isdir); static DWORD SHNotifyCopyFileW(LPCWSTR src, LPCWSTR dest, BOOL bFailIfExists); static DWORD SHFindAttrW(LPCWSTR pName, BOOL fileOnly); @@ -531,7 +531,7 @@ EXTERN_C DWORD WINAPI Win32DeleteFileW(LPCWSTR path) * RETURNS * ERORR_SUCCESS if successful */ -static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest) +static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest, BOOL isdir) { BOOL ret; @@ -559,7 +559,8 @@ static DWORD SHNotifyMoveFileW(LPCWSTR src, LPCWSTR dest) } if (ret) { - SHChangeNotify(SHCNE_RENAMEITEM, SHCNF_PATHW, src, dest); + SHChangeNotify(isdir ? SHCNE_MKDIR : SHCNE_CREATE, SHCNF_PATHW, dest, NULL); + SHChangeNotify(isdir ? SHCNE_RMDIR : SHCNE_DELETE, SHCNF_PATHW, src, NULL); return ERROR_SUCCESS; } return GetLastError(); @@ -1474,7 +1475,10 @@ static HRESULT delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) { BOOL bDelete; if (TRASH_TrashFile(fileEntry->szFullPath)) + { + SHChangeNotify(SHCNE_DELETE, SHCNF_PATHW, fileEntry->szFullPath, NULL); continue; + } /* Note: Windows silently deletes the file in such a situation, we show a dialog */ if (!(lpFileOp->fFlags & FOF_NOCONFIRMATION) || (lpFileOp->fFlags & FOF_WANTNUKEWARNING)) @@ -1491,7 +1495,10 @@ static HRESULT delete_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom) /* delete the file or directory */ if (IsAttribFile(fileEntry->attributes)) + { bPathExists = DeleteFileW(fileEntry->szFullPath); + SHChangeNotify(SHCNE_DELETE, SHCNF_PATHW, fileEntry->szFullPath, NULL); + } else bPathExists = SHELL_DeleteDirectoryW(lpFileOp->hwnd, fileEntry->szFullPath, FALSE); @@ -1548,7 +1555,7 @@ static void move_to_dir(LPSHFILEOPSTRUCTW lpFileOp, const FILE_ENTRY *feFrom, co PathCombineW(szDestPath, feTo->szFullPath, feFrom->szFilename); if (IsAttribFile(feFrom->attributes)) - SHNotifyMoveFileW(feFrom->szFullPath, szDestPath); + SHNotifyMoveFileW(feFrom->szFullPath, szDestPath, FALSE); else if (!(lpFileOp->fFlags & FOF_FILESONLY && feFrom->bFromWildcard)) move_dir_to_dir(lpFileOp, feFrom, szDestPath); } @@ -1599,7 +1606,7 @@ static HRESULT move_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, c if (fileDest->bExists && IsAttribDir(fileDest->attributes)) move_to_dir(lpFileOp, entryToMove, fileDest); else - SHNotifyMoveFileW(entryToMove->szFullPath, fileDest->szFullPath); + SHNotifyMoveFileW(entryToMove->szFullPath, fileDest->szFullPath, IsAttribDir(entryToMove->attributes)); } return ERROR_SUCCESS; @@ -1628,7 +1635,7 @@ static HRESULT rename_files(LPSHFILEOPSTRUCTW lpFileOp, const FILE_LIST *flFrom, if (feTo->bExists) return ERROR_ALREADY_EXISTS; - return SHNotifyMoveFileW(feFrom->szFullPath, feTo->szFullPath); + return SHNotifyMoveFileW(feFrom->szFullPath, feTo->szFullPath, IsAttribDir(feFrom->attributes)); } /* alert the user if an unsupported flag is used */ diff --git a/reactos/dll/win32/shell32/shlview.cpp b/reactos/dll/win32/shell32/shlview.cpp index 5cf59f3a64a..5afc0e85fe5 100644 --- a/reactos/dll/win32/shell32/shlview.cpp +++ b/reactos/dll/win32/shell32/shlview.cpp @@ -1807,9 +1807,13 @@ LRESULT CDefView::OnChangeNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & break; case SHCNE_UPDATEITEM: + LV_RenameItem(Pidls[0], Pidls[0]); + break; + + case SHCNE_UPDATEDIR: + Refresh(); break; } - return TRUE; } @@ -2493,12 +2497,10 @@ HRESULT WINAPI CDefView::Drop(IDataObject* pDataObject, DWORD grfKeyState, POINT { m_pCurDropTarget->Drop(pDataObject, grfKeyState, pt, pdwEffect); m_pCurDropTarget.Release(); - - this->Refresh(); } - m_pCurDataObject.Release(); m_iDragOverItem = 0; - + m_pCurDataObject.Release(); + m_iDragOverItem = 0; return S_OK; } diff --git a/reactos/dll/win32/shell32/shresdef.h b/reactos/dll/win32/shell32/shresdef.h index deebecb8839..607a42f01fe 100644 --- a/reactos/dll/win32/shell32/shresdef.h +++ b/reactos/dll/win32/shell32/shresdef.h @@ -523,3 +523,4 @@ #define IDR_DRVDEFEXT 148 #define IDR_MENUBAND 149 #define IDR_MENUDESKBAR 150 +#define IDR_EXEDROPHANDLER 151 diff --git a/reactos/include/psdk/shlguid_undoc.h b/reactos/include/psdk/shlguid_undoc.h index 24880ed8fdb..09eb3236f42 100644 --- a/reactos/include/psdk/shlguid_undoc.h +++ b/reactos/include/psdk/shlguid_undoc.h @@ -105,6 +105,8 @@ DEFINE_GUID(CLSID_ShellFileDefExt, 0x21B22460, 0x3AEA, 0x1069, 0xA2, 0xD DEFINE_GUID(CLSID_ShellDrvDefExt, 0x5F5295E0, 0x429F, 0x1069, 0xA2, 0xE2, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D); DEFINE_GUID(CLSID_ShellNetDefExt, 0x86422020, 0x42A0, 0x1069, 0xA2, 0xE5, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D); +DEFINE_GUID(CLSID_ExeDropHandler, 0x86C86720, 0x42A0, 0x1069, 0xA2, 0xE8, 0x08, 0x00, 0x2B, 0x30, 0x30, 0x9D); + #define CGID_IExplorerToolbar IID_IExplorerToolbar #define SID_IExplorerToolbar IID_IExplorerToolbar #define SID_ITargetFrame2 IID_ITargetFrame2 From 5d937b84a8245ff525cba4dcddeb7f88bc796360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 15 Mar 2014 17:15:23 +0000 Subject: [PATCH 112/419] [CONSRV] Fix changing foreground and background console colors via console properties dialog. Fully developed and tested in ReactOS 8^D CORE-4901 #resolve #comment Fixed in revision 62505. svn path=/trunk/; revision=62505 --- .../win32ss/user/winsrv/consrv/condrv/text.c | 76 ++++++++++++++++++- reactos/win32ss/user/winsrv/consrv/settings.c | 30 +++----- 2 files changed, 86 insertions(+), 20 deletions(-) diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/text.c b/reactos/win32ss/user/winsrv/consrv/condrv/text.c index 5c1ab108d7e..afe3afe661b 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/text.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/text.c @@ -585,6 +585,78 @@ ConioWriteConsole(PCONSOLE Console, return STATUS_SUCCESS; } +NTSTATUS NTAPI +ConDrvChangeScreenBufferAttributes(IN PCONSOLE Console, + IN PTEXTMODE_SCREEN_BUFFER Buffer, + IN USHORT NewScreenAttrib, + IN USHORT NewPopupAttrib) +{ + DWORD X, Y, Length; + PCHAR_INFO Ptr; + + COORD TopLeft = {0}; + ULONG NumCodesToWrite = Buffer->ScreenBufferSize.X * Buffer->ScreenBufferSize.Y; + USHORT OldScreenAttrib = Buffer->ScreenDefaultAttrib; + + if (Console == NULL || Buffer == NULL) + { + return STATUS_INVALID_PARAMETER; + } + + /* Validity check */ + ASSERT(Console == Buffer->Header.Console); + + X = TopLeft.X; + Y = (TopLeft.Y + Buffer->VirtualY) % Buffer->ScreenBufferSize.Y; + Length = NumCodesToWrite; + // Ptr = ConioCoordToPointer(Buffer, X, Y); // Doesn't work + // Ptr = &Buffer->Buffer[X + Y * Buffer->ScreenBufferSize.X]; // May work + + while (Length--) + { + // Ptr = ConioCoordToPointer(Buffer, X, Y); // Doesn't work either + Ptr = &Buffer->Buffer[X + Y * Buffer->ScreenBufferSize.X]; + + /* + * Change the current colors only if they are the old ones. + */ + + /* Foreground color */ + if ((Ptr->Attributes & 0x0F) == (OldScreenAttrib & 0x0F)) + Ptr->Attributes = (Ptr->Attributes & 0xFFF0) | (NewScreenAttrib & 0x0F); + + /* Background color */ + if ((Ptr->Attributes & 0xF0) == (OldScreenAttrib & 0xF0)) + Ptr->Attributes = (Ptr->Attributes & 0xFF0F) | (NewScreenAttrib & 0xF0); + + // ++Ptr; + + if (++X == Buffer->ScreenBufferSize.X) + { + X = 0; + + if (++Y == Buffer->ScreenBufferSize.Y) + { + Y = 0; + } + } + } + + /* Save foreground and background colors for both screen and popup */ + Buffer->ScreenDefaultAttrib = (NewScreenAttrib & 0x00FF); + Buffer->PopupDefaultAttrib = (NewPopupAttrib & 0x00FF); + + /* Refresh the display if needed */ + if ((PCONSOLE_SCREEN_BUFFER)Buffer == Console->ActiveBuffer) + { + SMALL_RECT UpdateRect; + ConioComputeUpdateRect(Buffer, &UpdateRect, &TopLeft, NumCodesToWrite); + TermDrawRegion(Console, &UpdateRect); + } + + return STATUS_SUCCESS; +} + /* PUBLIC DRIVER APIS *********************************************************/ @@ -947,7 +1019,6 @@ ConDrvWriteConsoleOutputString(IN PCONSOLE Console, PWCHAR tmpString = NULL; DWORD X, Y, Length; // , Written = 0; ULONG CodeSize; - SMALL_RECT UpdateRect; PCHAR_INFO Ptr; if (Console == NULL || Buffer == NULL || @@ -1046,6 +1117,7 @@ ConDrvWriteConsoleOutputString(IN PCONSOLE Console, if ((PCONSOLE_SCREEN_BUFFER)Buffer == Console->ActiveBuffer) { + SMALL_RECT UpdateRect; ConioComputeUpdateRect(Buffer, &UpdateRect, WriteCoord, NumCodesToWrite); TermDrawRegion(Console, &UpdateRect); } @@ -1071,7 +1143,6 @@ ConDrvFillConsoleOutput(IN PCONSOLE Console, { DWORD X, Y, Length; // , Written = 0; PCHAR_INFO Ptr; - SMALL_RECT UpdateRect; if (Console == NULL || Buffer == NULL || Code == NULL || WriteCoord == NULL /* || CodesWritten == NULL */) @@ -1144,6 +1215,7 @@ ConDrvFillConsoleOutput(IN PCONSOLE Console, if ((PCONSOLE_SCREEN_BUFFER)Buffer == Console->ActiveBuffer) { + SMALL_RECT UpdateRect; ConioComputeUpdateRect(Buffer, &UpdateRect, WriteCoord, NumCodesToWrite); TermDrawRegion(Console, &UpdateRect); } diff --git a/reactos/win32ss/user/winsrv/consrv/settings.c b/reactos/win32ss/user/winsrv/consrv/settings.c index f765e853d19..1775d1d3e79 100644 --- a/reactos/win32ss/user/winsrv/consrv/settings.c +++ b/reactos/win32ss/user/winsrv/consrv/settings.c @@ -436,7 +436,11 @@ ConSrvGetDefaultSettings(IN OUT PCONSOLE_INFO ConsoleInfo, } } - +NTSTATUS NTAPI +ConDrvChangeScreenBufferAttributes(IN PCONSOLE Console, + IN PTEXTMODE_SCREEN_BUFFER Buffer, + IN USHORT NewScreenAttrib, + IN USHORT NewPopupAttrib); /* * NOTE: This function explicitely references Console->ActiveBuffer. * It is possible that it should go into some frontend... @@ -455,26 +459,10 @@ ConSrvApplyUserSettings(IN PCONSOLE Console, Console->QuickEdit = ConsoleInfo->QuickEdit; Console->InsertMode = ConsoleInfo->InsertMode; - /* - * Apply foreground and background colors for both screen and popup - * and copy the new palette. - */ - if (GetType(ActiveBuffer) == TEXTMODE_BUFFER) - { - PTEXTMODE_SCREEN_BUFFER Buffer = (PTEXTMODE_SCREEN_BUFFER)ActiveBuffer; - - Buffer->ScreenDefaultAttrib = ConsoleInfo->ScreenAttrib; - Buffer->PopupDefaultAttrib = ConsoleInfo->PopupAttrib; - } - else // if (Console->ActiveBuffer->Header.Type == GRAPHICS_BUFFER) - { - } - + /* Copy the new console palette */ // FIXME: Possible buffer overflow if s_colors is bigger than pConInfo->Colors. memcpy(Console->Colors, ConsoleInfo->Colors, sizeof(s_Colors)); - // TODO: Really update the screen attributes as FillConsoleOutputAttribute does. - /* Apply cursor size */ ActiveBuffer->CursorInfo.bVisible = (ConsoleInfo->CursorSize != 0); ActiveBuffer->CursorInfo.dwSize = min(max(ConsoleInfo->CursorSize, 0), 100); @@ -537,6 +525,12 @@ ConSrvApplyUserSettings(IN PCONSOLE Console, if (SizeChanged) TermResizeTerminal(Console); } + + /* Apply foreground and background colors for both screen and popup */ + ConDrvChangeScreenBufferAttributes(Console, + Buffer, + ConsoleInfo->ScreenAttrib, + ConsoleInfo->PopupAttrib); } else // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) { From aa5ded9135ed89d544920d28e0a952e472d29687 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Sat, 15 Mar 2014 21:13:25 +0000 Subject: [PATCH 113/419] [comctl32] sync toolbar with wine head svn path=/trunk/; revision=62506 --- reactos/dll/win32/comctl32/toolbar.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/reactos/dll/win32/comctl32/toolbar.c b/reactos/dll/win32/comctl32/toolbar.c index 6b6a2fd4eb3..1cda50e1c72 100644 --- a/reactos/dll/win32/comctl32/toolbar.c +++ b/reactos/dll/win32/comctl32/toolbar.c @@ -843,8 +843,11 @@ TOOLBAR_DrawButton (const TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr, HDC hdc, /* empirical tests show that iBitmap can/will be non-zero */ /* when drawing the vertical bar... */ if ((dwStyle & TBSTYLE_FLAT) /* && (btnPtr->iBitmap == 0) */) { - if (dwStyle & CCS_VERT) - TOOLBAR_DrawFlatHorizontalSeparator (&rc, hdc, infoPtr); + if (dwStyle & CCS_VERT) { + RECT rcsep = rc; + InflateRect(&rcsep, -infoPtr->szPadding.cx, -infoPtr->szPadding.cy); + TOOLBAR_DrawFlatHorizontalSeparator (&rcsep, hdc, infoPtr); + } else TOOLBAR_DrawFlatSeparator (&rc, hdc, infoPtr); } @@ -1662,7 +1665,7 @@ TOOLBAR_LayoutToolbar(TOOLBAR_INFO *infoPtr) if (btnPtr->fsStyle & BTNS_SEP) { if (infoPtr->dwStyle & CCS_VERT) { cy = (btnPtr->iBitmap > 0) ? btnPtr->iBitmap : SEPARATOR_WIDTH; - cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nWidth; + cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nButtonWidth; } else cx = (btnPtr->cx > 0) ? btnPtr->cx : From 9899182f4812d1ecf5261f3113a27bf1ff75fbb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 15 Mar 2014 21:30:49 +0000 Subject: [PATCH 114/419] [CMAKE:MSVC] Generate uniquely-named .bin compiled messages files; this fixes broken messages inclusion in ntdll, kernel32 ... svn path=/trunk/; revision=62508 --- reactos/cmake/msvc.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/cmake/msvc.cmake b/reactos/cmake/msvc.cmake index 16949003343..f091215e58b 100644 --- a/reactos/cmake/msvc.cmake +++ b/reactos/cmake/msvc.cmake @@ -302,7 +302,7 @@ function(spec2def _dllname _spec_file) endfunction() macro(macro_mc FLAG FILE) - set(COMMAND_MC ${CMAKE_MC_COMPILER} ${FLAG} -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc) + set(COMMAND_MC ${CMAKE_MC_COMPILER} ${FLAG} -b ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos) endmacro() #pseh workaround From 90989af0c71f22d04bd3aa397c534edea644f6a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 16 Mar 2014 02:11:25 +0000 Subject: [PATCH 115/419] [CONSRV]: Code formatting only. svn path=/trunk/; revision=62512 --- reactos/win32ss/user/winsrv/consrv/condrv/graphics.c | 3 ++- reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/graphics.c b/reactos/win32ss/user/winsrv/consrv/condrv/graphics.c index 8932d3856be..3d2805b558f 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/graphics.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/graphics.c @@ -88,7 +88,8 @@ GRAPHICS_BUFFER_Initialize(OUT PCONSOLE_SCREEN_BUFFER* Buffer, /* We do not use anything else than uncompressed bitmaps */ if (GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression != BI_RGB) { - DPRINT1("biCompression == %d != BI_RGB, correct that!\n", GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression); + DPRINT1("biCompression == %d != BI_RGB, fix that!\n", + GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression); GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression = BI_RGB; } diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h index 5041dadedc1..88265cf61e8 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h @@ -52,7 +52,7 @@ typedef struct _GUI_CONSOLE_DATA HWND hWindow; /* Handle to the console's window */ HDC hMemDC; /* Memory DC holding the console framebuffer */ - HBITMAP hBitmap; /* Console framebuffer */ + HBITMAP hBitmap; /* Console framebuffer */ HPALETTE hSysPalette; /* Handle to the original system palette */ HICON hIcon; /* Handle to the console's icon (big) */ From 2b427f2fba439b1554cce5c7b1b3a86df951e261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 16 Mar 2014 02:15:53 +0000 Subject: [PATCH 116/419] [CONSRV] - Free allocated memory in case GlobalLock fails. - Implement bitmap copy of graphics screen buffers. It seems that the call to StretchDIBits doesn't work correctly (it copies the image but removes a band of height == Console->Selection.srSelection.Top at the bottom of the copied image), so in the meantime I call SetDIBitsToDevice which does correctly the job. It would be nice that some win32k guy has a look at this... :D Have fun! svn path=/trunk/; revision=62513 --- .../winsrv/consrv/frontends/gui/graphics.c | 89 ++++++++++++++++++- .../winsrv/consrv/frontends/gui/guiterm.c | 26 ++++-- .../user/winsrv/consrv/frontends/gui/text.c | 14 ++- 3 files changed, 113 insertions(+), 16 deletions(-) diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c index 3ac9cc24b66..69808518b94 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c @@ -16,19 +16,100 @@ /* FUNCTIONS ******************************************************************/ VOID -GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer) +GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData) { /* * This function supposes that the system clipboard was opened. */ - // PCONSOLE Console = Buffer->Header.Console; + PCONSOLE Console = Buffer->Header.Console; - UNIMPLEMENTED; + HDC hMemDC; + HBITMAP hBitmapTarget, hBitmapOld; + HPALETTE hPalette, hPaletteOld; + ULONG selWidth, selHeight; + + if (Buffer->BitMap == NULL) return; + + selWidth = Console->Selection.srSelection.Right - Console->Selection.srSelection.Left + 1; + selHeight = Console->Selection.srSelection.Bottom - Console->Selection.srSelection.Top + 1; + DPRINT1("Selection is (%d|%d) to (%d|%d)\n", + Console->Selection.srSelection.Left, + Console->Selection.srSelection.Top, + Console->Selection.srSelection.Right, + Console->Selection.srSelection.Bottom); + + hMemDC = CreateCompatibleDC(GuiData->hMemDC); + if (hMemDC == NULL) return; + + /* Allocate a bitmap to be given to the clipboard, so it will not be freed here */ + hBitmapTarget = CreateCompatibleBitmap(GuiData->hMemDC, selWidth, selHeight); + if (hBitmapTarget == NULL) + { + DeleteDC(hMemDC); + return; + } + + /* Select the new bitmap */ + hBitmapOld = SelectObject(hMemDC, hBitmapTarget); + + /* Change the palette in hMemDC if the current palette does exist */ + if (Buffer->PaletteHandle == NULL) + hPalette = GuiData->hSysPalette; + else + hPalette = Buffer->PaletteHandle; + + if (hPalette) hPaletteOld = SelectPalette(hMemDC, hPalette, FALSE); + + /* Grab the mutex */ + NtWaitForSingleObject(Buffer->Mutex, FALSE, NULL); + + // The equivalent of a SetDIBitsToDevice call... + // It seems to be broken: it does not copy the tail of the bitmap. + // http://wiki.allegro.cc/index.php?title=StretchDIBits +#if 0 + StretchDIBits(hMemDC, + 0, 0, + selWidth, selHeight, + Console->Selection.srSelection.Left, + Console->Selection.srSelection.Top, + selWidth, selHeight, + Buffer->BitMap, + Buffer->BitMapInfo, + Buffer->BitMapUsage, + SRCCOPY); +#else + SetDIBitsToDevice(hMemDC, + /* Coordinates / size of the repainted rectangle, in the framebuffer's frame */ + 0, 0, + selWidth, selHeight, + /* Coordinates / size of the corresponding image portion, in the graphics screen-buffer's frame */ + Console->Selection.srSelection.Left, + Console->Selection.srSelection.Top, + 0, + Buffer->ScreenBufferSize.Y, // == Buffer->BitMapInfo->bmiHeader.biHeight + Buffer->BitMap, + Buffer->BitMapInfo, + Buffer->BitMapUsage); +#endif + + /* Release the mutex */ + NtReleaseMutant(Buffer->Mutex, NULL); + + /* Restore the palette and the old bitmap */ + if (hPalette) SelectPalette(hMemDC, hPaletteOld, FALSE); + SelectObject(hMemDC, hBitmapOld); + + EmptyClipboard(); + SetClipboardData(CF_BITMAP, hBitmapTarget); + + DeleteDC(hMemDC); } VOID -GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer) +GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData) { /* * This function supposes that the system clipboard was opened. diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c index acc870b40eb..e01dbdade3f 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c @@ -1333,8 +1333,12 @@ Quit: return 0; } -VOID GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer); -VOID GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer); +VOID +GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); +VOID +GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); static VOID GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData) @@ -1346,11 +1350,11 @@ GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData) if (GetType(Buffer) == TEXTMODE_BUFFER) { - GuiCopyFromTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer); + GuiCopyFromTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer, GuiData); } else /* if (GetType(Buffer) == GRAPHICS_BUFFER) */ { - GuiCopyFromGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer); + GuiCopyFromGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer, GuiData); } CloseClipboard(); @@ -1361,8 +1365,12 @@ GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData) } } -VOID GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer); -VOID GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer); +VOID +GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); +VOID +GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); static VOID GuiConsolePaste(PGUI_CONSOLE_DATA GuiData) @@ -1373,11 +1381,11 @@ GuiConsolePaste(PGUI_CONSOLE_DATA GuiData) if (GetType(Buffer) == TEXTMODE_BUFFER) { - GuiPasteToTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer); + GuiPasteToTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer, GuiData); } else /* if (GetType(Buffer) == GRAPHICS_BUFFER) */ { - GuiPasteToGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer); + GuiPasteToGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer, GuiData); } CloseClipboard(); @@ -1909,6 +1917,8 @@ GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) EnableMenuItem(hMenu, ID_SYSTEM_EDIT_COPY , MF_BYCOMMAND | ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) && (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) ? MF_ENABLED : MF_GRAYED)); + // FIXME: Following whether the active screen buffer is text-mode + // or graphics-mode, search for CF_UNICODETEXT or CF_BITMAP formats. EnableMenuItem(hMenu, ID_SYSTEM_EDIT_PASTE, MF_BYCOMMAND | (!(Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) && IsClipboardFormatAvailable(CF_UNICODETEXT) ? MF_ENABLED : MF_GRAYED)); diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c index 79d5d9b46ff..d39fe614553 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c @@ -30,7 +30,8 @@ COLORREF RGBFromAttrib2(PCONSOLE Console, WORD Attribute) } VOID -GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer) +GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData) { /* * This function supposes that the system clipboard was opened. @@ -72,12 +73,16 @@ GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer) size += 1; /* Null-termination */ size *= sizeof(WCHAR); - /* Allocate memory, it will be passed to the system and may not be freed here */ + /* Allocate some memory area to be given to the clipboard, so it will not be freed here */ hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size); if (hData == NULL) return; data = GlobalLock(hData); - if (data == NULL) return; + if (data == NULL) + { + GlobalFree(hData); + return; + } DPRINT("Copying %dx%d selection\n", selWidth, selHeight); dstPos = data; @@ -121,7 +126,8 @@ GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer) } VOID -GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer) +GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData) { /* * This function supposes that the system clipboard was opened. From 14f804f6a4cabcd09d1022eaf6456b08ffe0d392 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Sun, 16 Mar 2014 12:57:39 +0000 Subject: [PATCH 117/419] [i8042prt] fix keyboard detection on Dell D531 notebook and on other devices with PS/2 multiplexing controllers svn path=/trunk/; revision=62517 --- reactos/drivers/input/i8042prt/pnp.c | 17 +++++++++++++---- reactos/drivers/usb/usbd/usbd.c | 2 +- reactos/ntoskrnl/io/pnpmgr/pnpmgr.c | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/reactos/drivers/input/i8042prt/pnp.c b/reactos/drivers/input/i8042prt/pnp.c index 3d707850b46..3cb70cab767 100644 --- a/reactos/drivers/input/i8042prt/pnp.c +++ b/reactos/drivers/input/i8042prt/pnp.c @@ -437,6 +437,7 @@ StartProcedure( Status = EnableInterrupts(DeviceExtension, FlagsToDisable, FlagsToEnable); if (!NT_SUCCESS(Status)) { + WARN_(I8042PRT, "EnableInterrupts failed: %lx\n", Status); DeviceExtension->Flags &= ~(KEYBOARD_PRESENT | MOUSE_PRESENT); return Status; } @@ -454,6 +455,10 @@ StartProcedure( { DeviceExtension->Flags |= KEYBOARD_INITIALIZED; } + else + { + WARN_(I8042PRT, "i8042ConnectKeyboardInterrupt failed: %lx\n", Status); + } } if (DeviceExtension->Flags & MOUSE_PRESENT && @@ -467,7 +472,11 @@ StartProcedure( { DeviceExtension->Flags |= MOUSE_INITIALIZED; } - + else + { + WARN_(I8042PRT, "i8042ConnectMouseInterrupt failed: %lx\n", Status); + } + /* Start the mouse */ Irql = KeAcquireInterruptSpinLock(DeviceExtension->HighestDIRQLInterrupt); i8042IsrWritePort(DeviceExtension, MOU_CMD_RESET, CTRL_WRITE_MOUSE); @@ -533,7 +542,7 @@ i8042PnpStartDevice( { if (ResourceDescriptor->u.Port.Length == 1) { - /* We assume that the first ressource will + /* We assume that the first resource will * be the control port and the second one * will be the data port... */ @@ -551,8 +560,8 @@ i8042PnpStartDevice( } else { - WARN_(I8042PRT, "Too much I/O ranges provided: 0x%lx\n", ResourceDescriptor->u.Port.Length); - return STATUS_INVALID_PARAMETER; + /* FIXME: implement PS/2 Active Multiplexing */ + ERR_(I8042PRT, "Unhandled I/O ranges provided: 0x%lx\n", ResourceDescriptor->u.Port.Length); } } else diff --git a/reactos/drivers/usb/usbd/usbd.c b/reactos/drivers/usb/usbd/usbd.c index 958f017f3da..f551ea9c332 100644 --- a/reactos/drivers/usb/usbd/usbd.c +++ b/reactos/drivers/usb/usbd/usbd.c @@ -17,7 +17,7 @@ * Notes: * This driver was obsoleted in Windows XP and most functions * became pure stubs. But some of them were retained for backward - * compatibilty with existing drivers. + * compatibility with existing drivers. * * Preserved functions: * diff --git a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c index 5f41772f890..5c18437a6f6 100644 --- a/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c +++ b/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c @@ -648,7 +648,7 @@ IopStartDevice2(IN PDEVICE_OBJECT DeviceObject) ASSERT(!(DeviceNode->Flags & DNF_DISABLED)); - /* Build the I/O stack locaiton */ + /* Build the I/O stack location */ RtlZeroMemory(&Stack, sizeof(IO_STACK_LOCATION)); Stack.MajorFunction = IRP_MJ_PNP; Stack.MinorFunction = IRP_MN_START_DEVICE; From efad5a595113f174c51264d11f7498019f66d436 Mon Sep 17 00:00:00 2001 From: Sylvain Petreolle Date: Sun, 16 Mar 2014 13:05:27 +0000 Subject: [PATCH 118/419] [CMD] Addendum to r28077: Fix displaying the free space on the volume in remaining languages. svn path=/trunk/; revision=62518 --- reactos/base/shell/cmd/lang/es-ES.rc | 2 +- reactos/base/shell/cmd/lang/fr-FR.rc | 2 +- reactos/base/shell/cmd/lang/hu-HU.rc | 2 +- reactos/base/shell/cmd/lang/id-ID.rc | 2 +- reactos/base/shell/cmd/lang/it-IT.rc | 2 +- reactos/base/shell/cmd/lang/no-NO.rc | 2 +- reactos/base/shell/cmd/lang/pl-PL.rc | 2 +- reactos/base/shell/cmd/lang/ru-RU.rc | 2 +- reactos/base/shell/cmd/lang/sv-SE.rc | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reactos/base/shell/cmd/lang/es-ES.rc b/reactos/base/shell/cmd/lang/es-ES.rc index 6a30490f408..7d6cb2c5715 100644 --- a/reactos/base/shell/cmd/lang/es-ES.rc +++ b/reactos/base/shell/cmd/lang/es-ES.rc @@ -182,7 +182,7 @@ ajustes previos anteponiendo a cualquier modificador - (hyphen)--por ejemplo, /- STRING_DIR_HELP3 " El volumen en la unidad %c no tiene etiqueta.\n" STRING_DIR_HELP4 " El volumen Serial Number is %04X-%04X\n" STRING_DIR_HELP5 "\n Total de archivos mostrados:\n%16i archivo(s)% 14s bytes\n" - STRING_DIR_HELP6 "%16i Directorio(s)% 15s bytes\n" + STRING_DIR_HELP6 "%16i Directorio(s)% 15s bytes libres\n" STRING_DIR_HELP7 "\n Directorio %s\n\n" STRING_DIR_HELP8 "%16i archivo(s)% 14s bytes\n" STRING_DIRSTACK_HELP1 "Almacena el directorio actual para usarlo por el comando, \n\ diff --git a/reactos/base/shell/cmd/lang/fr-FR.rc b/reactos/base/shell/cmd/lang/fr-FR.rc index 48dc63b7e6e..ac720b802ff 100644 --- a/reactos/base/shell/cmd/lang/fr-FR.rc +++ b/reactos/base/shell/cmd/lang/fr-FR.rc @@ -192,7 +192,7 @@ Modifier les paramètres mémorisés avec un - (tiret)--par exemple, /-W.\n" STRING_DIR_HELP3 " Le lecteur %c n'a pas de nom de volume\n" STRING_DIR_HELP4 " Le numéro de série du volume est %04X-%04X\n" STRING_DIR_HELP5 "\n Total de fichiers listés :\n%16i Fichier(s)% 14s octets\n" - STRING_DIR_HELP6 "%16i Rep(s)% 15s octets\n" + STRING_DIR_HELP6 "%16i Rep(s)% 15s octets libres\n" STRING_DIR_HELP7 "\n Répertoire de %s\n\n" STRING_DIR_HELP8 "%16i Fichier(s)% 14s octets\n" STRING_DIRSTACK_HELP1 "Stocke le répertoire courant pour utilisation avec la commande POPD,\n\ diff --git a/reactos/base/shell/cmd/lang/hu-HU.rc b/reactos/base/shell/cmd/lang/hu-HU.rc index e628a1f73be..bc1ef3fdfed 100644 --- a/reactos/base/shell/cmd/lang/hu-HU.rc +++ b/reactos/base/shell/cmd/lang/hu-HU.rc @@ -170,7 +170,7 @@ A kapcsolók a DIRCMD környezeti változóban is lehetnek.\n" STRING_DIR_HELP3 " A (%c) meghajtóban található kötetnek nincs címkéje.\n" STRING_DIR_HELP4 " A kötet sorozatszáma: %04X-%04X\n" STRING_DIR_HELP5 "\n Összes állomány:\n%16i Állomány(ok)% 14s bájt\n" - STRING_DIR_HELP6 "%16i Mappa %15s bájt" + STRING_DIR_HELP6 "%16i Mappa %15s bájt szabad" STRING_DIR_HELP7 "\n %s tartalma\n\n" STRING_DIR_HELP8 "%16i Állomány %14s bájt\n" STRING_DIRSTACK_HELP1 "Megjegyzi az aktuális mappát, majd átvált egy máasikra.\n\n\ diff --git a/reactos/base/shell/cmd/lang/id-ID.rc b/reactos/base/shell/cmd/lang/id-ID.rc index 5346a6f92a5..d5b707998dc 100644 --- a/reactos/base/shell/cmd/lang/id-ID.rc +++ b/reactos/base/shell/cmd/lang/id-ID.rc @@ -181,7 +181,7 @@ preset dengan mengawali setiap saklar dengan - (minus)--contohnya, /-W.\n" STRING_DIR_HELP3 " Volume di drive %c tidak berlabel.\n" STRING_DIR_HELP4 " Nomor Seri Volume adalah %04X-%04X\n" STRING_DIR_HELP5 "\n Total File Didaftar:\n%16i File% 14s byte\n" - STRING_DIR_HELP6 "%16i Dir% 15s byte\n" + STRING_DIR_HELP6 "%16i Dir% 15s byte tersisa\n" STRING_DIR_HELP7 "\n Direktori %s\n\n" STRING_DIR_HELP8 "%16i File% 14s byte\n" STRING_DIRSTACK_HELP1 "Menyimpan direktori sekarang untuk digunakan oleh perintah POPD, lalu\n\ diff --git a/reactos/base/shell/cmd/lang/it-IT.rc b/reactos/base/shell/cmd/lang/it-IT.rc index acfe18070a8..ac71fd92c17 100644 --- a/reactos/base/shell/cmd/lang/it-IT.rc +++ b/reactos/base/shell/cmd/lang/it-IT.rc @@ -178,7 +178,7 @@ le selezioni preimpostate mettendo - (trattino) prima della selezione per esempi STRING_DIR_HELP3 " Il Volume nel disco %c non ha etichetta.\n" STRING_DIR_HELP4 " Il numero di serie del Volume è %04X-%04X\n" STRING_DIR_HELP5 "\n Numero dei file elencati:\n%16i % 14s byte\n" - STRING_DIR_HELP6 "%16i Cartelle% 15s byte\n" + STRING_DIR_HELP6 "%16i Cartelle% 15s byte liberi\n" STRING_DIR_HELP7 "\n Cartelle di %s\n\n" STRING_DIR_HELP8 "%16i File% 14s byte\n" STRING_DIRSTACK_HELP1 "Salva la cartella corrente per l'uso con il comando POPD, poi\n\ diff --git a/reactos/base/shell/cmd/lang/no-NO.rc b/reactos/base/shell/cmd/lang/no-NO.rc index 557a49b18c0..c189bd61383 100644 --- a/reactos/base/shell/cmd/lang/no-NO.rc +++ b/reactos/base/shell/cmd/lang/no-NO.rc @@ -179,7 +179,7 @@ forhåndsinnstilte brytere ved å sette en bindestrek (-) foran, for eksempel, / STRING_DIR_HELP3 " Volumet i stasjon %c er uten navn.\n" STRING_DIR_HELP4 " Volumserienummeret er %04X-%04X\n" STRING_DIR_HELP5 "\n Totalt filer listet:\n%16i fil(er)% 14s byte\n" - STRING_DIR_HELP6 "%16i mappe(r)% 15s byte\n" + STRING_DIR_HELP6 "%16i mappe(r)% 15s byte ledig\n" STRING_DIR_HELP7 "\n mappe av %s\n\n" STRING_DIR_HELP8 "%16i fil(er)% 14s byte\n" STRING_DIRSTACK_HELP1 "Lagrer gjeldende mappe for bruk av POPD kommando, og\n\ diff --git a/reactos/base/shell/cmd/lang/pl-PL.rc b/reactos/base/shell/cmd/lang/pl-PL.rc index 2c3d1fffc42..88d49b18ac3 100644 --- a/reactos/base/shell/cmd/lang/pl-PL.rc +++ b/reactos/base/shell/cmd/lang/pl-PL.rc @@ -187,7 +187,7 @@ odwrócić działanie parametrów przedrostkiem - (myślnik)-- na przykład, /-W STRING_DIR_HELP3 " Wolumin w napędzie %c nie posiada etykiety.\n" STRING_DIR_HELP4 " Numer seryjny woluminu to: %04X-%04X\n" STRING_DIR_HELP5 "\n Ogółem wyświetonych:\n%16i plik(ów)% 14s bajtów\n" - STRING_DIR_HELP6 "%16i katalog(ów)% 15s bajtów\n" + STRING_DIR_HELP6 "%16i katalog(ów)% 15s bajtów wolne\n" STRING_DIR_HELP7 "\n katalog %s\n\n" STRING_DIR_HELP8 "%16i plik(ów)% 14s bajtów\n" STRING_DIRSTACK_HELP1 "Przechowuje obecny katalog dla potrzeb komendy POPD, następnie\n\ diff --git a/reactos/base/shell/cmd/lang/ru-RU.rc b/reactos/base/shell/cmd/lang/ru-RU.rc index b762569a072..6d7925996e0 100644 --- a/reactos/base/shell/cmd/lang/ru-RU.rc +++ b/reactos/base/shell/cmd/lang/ru-RU.rc @@ -180,7 +180,7 @@ DELAY [/m]n\n\n\ STRING_DIR_HELP3 " Том в устройстве %c не имеет метки.\n" STRING_DIR_HELP4 " Серийный номер тома: %04X-%04X\n" STRING_DIR_HELP5 "\n Всего:\n%16i Файл(ов)% 14s байт\n" - STRING_DIR_HELP6 "%16i Dir(s)% 15s байт\n" + STRING_DIR_HELP6 "%16i Dir(s)% 15s байт свободно\n" STRING_DIR_HELP7 "\n Каталог of %s\n\n" STRING_DIR_HELP8 "%16i файл(ов)% 14s байт\n" STRING_DIRSTACK_HELP1 "Сохраняет текущую директорию для использования командой POPD, затем\n\ diff --git a/reactos/base/shell/cmd/lang/sv-SE.rc b/reactos/base/shell/cmd/lang/sv-SE.rc index b9671865bdf..ecdd380d697 100644 --- a/reactos/base/shell/cmd/lang/sv-SE.rc +++ b/reactos/base/shell/cmd/lang/sv-SE.rc @@ -179,7 +179,7 @@ förinställda växlar med ett bindestreck (-) före, till exempel, /-W.\n" STRING_DIR_HELP3 " Volumet i enhet %c är utan namn.\n" STRING_DIR_HELP4 " Volymens serienummer är %04X-%04X\n" STRING_DIR_HELP5 "\n Totalt filer listet:\n%16i fil(är)% 14s byte\n" - STRING_DIR_HELP6 "%16i mapp(ar)% 15s byte\n" + STRING_DIR_HELP6 "%16i mapp(ar)% 15s byte ledigt\n" STRING_DIR_HELP7 "\n mapp av %s\n\n" STRING_DIR_HELP8 "%16i fil(er)% 14s byte\n" STRING_DIRSTACK_HELP1 "Sparar aktuell mapp for användning av POPD kommandot, och\n\ From 32091359d7a026a3196caab58cf1934785cc9f8f Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 16 Mar 2014 19:54:33 +0000 Subject: [PATCH 119/419] [MSV1_0] LsaApLogonUser: - Check password prior to checking account restrictions. - Add checks for expired account (disabled) and password. svn path=/trunk/; revision=62519 --- reactos/dll/win32/msv1_0/msv1_0.c | 70 ++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 16 deletions(-) diff --git a/reactos/dll/win32/msv1_0/msv1_0.c b/reactos/dll/win32/msv1_0/msv1_0.c index ec63a04368d..046f48f097d 100644 --- a/reactos/dll/win32/msv1_0/msv1_0.c +++ b/reactos/dll/win32/msv1_0/msv1_0.c @@ -966,6 +966,10 @@ LsaApLogonUser(IN PLSA_CLIENT_REQUEST ClientRequest, PSAMPR_USER_INFO_BUFFER UserInfo = NULL; UNICODE_STRING LogonServer; BOOLEAN SessionCreated = FALSE; + LARGE_INTEGER LogonTime; +// LARGE_INTEGER AccountExpires; + LARGE_INTEGER PasswordMustChange; + LARGE_INTEGER PasswordLastSet; NTSTATUS Status; TRACE("()\n"); @@ -1005,6 +1009,10 @@ LsaApLogonUser(IN PLSA_CLIENT_REQUEST ClientRequest, return STATUS_NOT_IMPLEMENTED; } + /* Get the logon time */ + NtQuerySystemTime(&LogonTime); + + /* Get the domain SID */ Status = GetDomainSid(&AccountDomainSid); if (!NT_SUCCESS(Status)) { @@ -1080,9 +1088,20 @@ LsaApLogonUser(IN PLSA_CLIENT_REQUEST ClientRequest, goto done; } - TRACE("UserName: %S\n", UserInfo->All.UserName.Buffer); + /* Check the password */ + if ((UserInfo->All.UserAccountControl & USER_PASSWORD_NOT_REQUIRED) == 0) + { + Status = MsvpCheckPassword(&(LogonInfo->Password), + UserInfo); + if (!NT_SUCCESS(Status)) + { + TRACE("MsvpCheckPassword failed (Status %08lx)\n", Status); + goto done; + } + } + /* Check account restrictions for non-administrator accounts */ if (RelativeIds.Element[0] != DOMAIN_USER_RID_ADMIN) { @@ -1098,29 +1117,48 @@ LsaApLogonUser(IN PLSA_CLIENT_REQUEST ClientRequest, /* Check if the account has been locked */ if (UserInfo->All.UserAccountControl & USER_ACCOUNT_AUTO_LOCKED) { - ERR("Account disabled!\n"); + ERR("Account locked!\n"); *SubStatus = STATUS_ACCOUNT_LOCKED_OUT; Status = STATUS_ACCOUNT_RESTRICTION; goto done; } - /* FIXME: more checks */ -// *SubStatus = STATUS_PASSWORD_EXPIRED; -// *SubStatus = STATUS_INVALID_LOGON_HOURS; -// *SubStatus = STATUS_INVALID_WORKSTATION; +#if 0 + /* Check if the account expired */ + AccountExpires.LowPart = UserInfo->All.AccountExpires.LowPart; + AccountExpires.HighPart = UserInfo->All.AccountExpires.HighPart; - } - - /* Check the password */ - if ((UserInfo->All.UserAccountControl & USER_PASSWORD_NOT_REQUIRED) == 0) - { - Status = MsvpCheckPassword(&(LogonInfo->Password), - UserInfo); - if (!NT_SUCCESS(Status)) + if (AccountExpires.QuadPart != 0 && + LogonTime.QuadPart >= AccountExpires.QuadPart) { - TRACE("MsvpCheckPassword failed (Status %08lx)\n", Status); + ERR("Account expired!\n"); + *SubStatus = STATUS_ACCOUNT_EXPIRED; + Status = STATUS_ACCOUNT_RESTRICTION; goto done; } +#endif + + /* Check if the password expired */ + PasswordMustChange.LowPart = UserInfo->All.PasswordMustChange.LowPart; + PasswordMustChange.HighPart = UserInfo->All.PasswordMustChange.HighPart; + PasswordLastSet.LowPart = UserInfo->All.PasswordLastSet.LowPart; + PasswordLastSet.HighPart = UserInfo->All.PasswordLastSet.HighPart; + + if (LogonTime.QuadPart >= PasswordMustChange.QuadPart) + { + ERR("Password expired!\n"); + if (PasswordLastSet.QuadPart == 0) + *SubStatus = STATUS_PASSWORD_MUST_CHANGE; + else + *SubStatus = STATUS_PASSWORD_EXPIRED; + + Status = STATUS_ACCOUNT_RESTRICTION; + goto done; + } + + /* FIXME: more checks */ + // STATUS_INVALID_LOGON_HOURS; + // STATUS_INVALID_WORKSTATION; } /* Return logon information */ @@ -1220,7 +1258,7 @@ done: Status = STATUS_LOGON_FAILURE; } - TRACE("LsaApLogonUser done (Status %08lx)\n", Status); + TRACE("LsaApLogonUser done (Status 0x%08lx SubStatus 0x%08lx)\n", Status, *SubStatus); return Status; } From e38dc3b038cf5227b649c2fd4faa10781e5ebeb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 17 Mar 2014 22:45:47 +0000 Subject: [PATCH 120/419] [MODE] Move mode from rosapps to reactos trunk. CORE-8001 #resolve #comment Moved from rosapps to reactos trunk in revision 62521. svn path=/trunk/; revision=62521 --- .../base}/applications/cmdutils/mode/CMakeLists.txt | 0 {rosapps => reactos/base}/applications/cmdutils/mode/mode.c | 0 {rosapps => reactos/base}/applications/cmdutils/mode/mode.rbuild | 0 {rosapps => reactos/base}/applications/cmdutils/mode/mode.rc | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {rosapps => reactos/base}/applications/cmdutils/mode/CMakeLists.txt (100%) rename {rosapps => reactos/base}/applications/cmdutils/mode/mode.c (100%) rename {rosapps => reactos/base}/applications/cmdutils/mode/mode.rbuild (100%) rename {rosapps => reactos/base}/applications/cmdutils/mode/mode.rc (100%) diff --git a/rosapps/applications/cmdutils/mode/CMakeLists.txt b/reactos/base/applications/cmdutils/mode/CMakeLists.txt similarity index 100% rename from rosapps/applications/cmdutils/mode/CMakeLists.txt rename to reactos/base/applications/cmdutils/mode/CMakeLists.txt diff --git a/rosapps/applications/cmdutils/mode/mode.c b/reactos/base/applications/cmdutils/mode/mode.c similarity index 100% rename from rosapps/applications/cmdutils/mode/mode.c rename to reactos/base/applications/cmdutils/mode/mode.c diff --git a/rosapps/applications/cmdutils/mode/mode.rbuild b/reactos/base/applications/cmdutils/mode/mode.rbuild similarity index 100% rename from rosapps/applications/cmdutils/mode/mode.rbuild rename to reactos/base/applications/cmdutils/mode/mode.rbuild diff --git a/rosapps/applications/cmdutils/mode/mode.rc b/reactos/base/applications/cmdutils/mode/mode.rc similarity index 100% rename from rosapps/applications/cmdutils/mode/mode.rc rename to reactos/base/applications/cmdutils/mode/mode.rc From f865566153788eac6ca28494ef24aa7e836f38b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 17 Mar 2014 22:48:11 +0000 Subject: [PATCH 121/419] [MODE]: Add to compilation. svn path=/trunk/; revision=62522 --- reactos/base/applications/cmdutils/CMakeLists.txt | 1 + rosapps/applications/cmdutils/CMakeLists.txt | 1 - rosapps/applications/cmdutils/cmdutils.rbuild | 3 --- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/reactos/base/applications/cmdutils/CMakeLists.txt b/reactos/base/applications/cmdutils/CMakeLists.txt index a64f6ad523a..a559623b7e4 100644 --- a/reactos/base/applications/cmdutils/CMakeLists.txt +++ b/reactos/base/applications/cmdutils/CMakeLists.txt @@ -4,6 +4,7 @@ add_subdirectory(find) add_subdirectory(help) add_subdirectory(hostname) add_subdirectory(lodctr) +add_subdirectory(mode) add_subdirectory(more) add_subdirectory(reg) add_subdirectory(taskkill) diff --git a/rosapps/applications/cmdutils/CMakeLists.txt b/rosapps/applications/cmdutils/CMakeLists.txt index 414ae3e69d2..304b472089d 100644 --- a/rosapps/applications/cmdutils/CMakeLists.txt +++ b/rosapps/applications/cmdutils/CMakeLists.txt @@ -1,6 +1,5 @@ add_subdirectory(appwiz) add_subdirectory(comp) -add_subdirectory(mode) add_subdirectory(sort) add_subdirectory(tee) add_subdirectory(touch) diff --git a/rosapps/applications/cmdutils/cmdutils.rbuild b/rosapps/applications/cmdutils/cmdutils.rbuild index 0d977f7ac18..f07953080e9 100644 --- a/rosapps/applications/cmdutils/cmdutils.rbuild +++ b/rosapps/applications/cmdutils/cmdutils.rbuild @@ -6,9 +6,6 @@ - - - From af6ab074bfeba7df6829937decb8da577cab64cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 17 Mar 2014 23:14:08 +0000 Subject: [PATCH 122/419] [CMDUTILS]: Fix some utils descriptions. svn path=/trunk/; revision=62523 --- .../applications/cmdutils/doskey/doskey.rc | 2 +- .../base/applications/cmdutils/find/find.rc | 2 +- .../applications/cmdutils/mode/CMakeLists.txt | 2 +- .../base/applications/cmdutils/mode/mode.c | 310 ++++++++++++------ .../applications/cmdutils/mode/mode.rbuild | 6 - .../base/applications/cmdutils/mode/mode.rc | 6 +- .../base/applications/cmdutils/more/more.rc | 2 +- .../base/applications/cmdutils/xcopy/rsrc.rc | 2 +- 8 files changed, 211 insertions(+), 121 deletions(-) delete mode 100644 reactos/base/applications/cmdutils/mode/mode.rbuild diff --git a/reactos/base/applications/cmdutils/doskey/doskey.rc b/reactos/base/applications/cmdutils/doskey/doskey.rc index c302f555706..52e969bfdc3 100644 --- a/reactos/base/applications/cmdutils/doskey/doskey.rc +++ b/reactos/base/applications/cmdutils/doskey/doskey.rc @@ -2,7 +2,7 @@ #include "doskey.h" -#define REACTOS_STR_FILE_DESCRIPTION "W32 doskey command" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Doskey Command" #define REACTOS_STR_INTERNAL_NAME "doskey" #define REACTOS_STR_ORIGINAL_FILENAME "doskey.exe" #include diff --git a/reactos/base/applications/cmdutils/find/find.rc b/reactos/base/applications/cmdutils/find/find.rc index ae1c5059842..5c054330d9d 100644 --- a/reactos/base/applications/cmdutils/find/find.rc +++ b/reactos/base/applications/cmdutils/find/find.rc @@ -2,7 +2,7 @@ #include "resource.h" -#define REACTOS_STR_FILE_DESCRIPTION "W32 find command" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Find Command" #define REACTOS_STR_INTERNAL_NAME "find" #define REACTOS_STR_ORIGINAL_FILENAME "find.exe" #include diff --git a/reactos/base/applications/cmdutils/mode/CMakeLists.txt b/reactos/base/applications/cmdutils/mode/CMakeLists.txt index 578fc4b345c..ed5689cdd3e 100644 --- a/reactos/base/applications/cmdutils/mode/CMakeLists.txt +++ b/reactos/base/applications/cmdutils/mode/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(mode mode.c mode.rc) set_module_type(mode win32cui) -add_importlibs(mode shell32 user32 msvcrt kernel32) +add_importlibs(mode user32 msvcrt kernel32) add_cd_file(TARGET mode DESTINATION reactos/system32 FOR all) diff --git a/reactos/base/applications/cmdutils/mode/mode.c b/reactos/base/applications/cmdutils/mode/mode.c index bdd73414b30..fd9cb773522 100644 --- a/reactos/base/applications/cmdutils/mode/mode.c +++ b/reactos/base/applications/cmdutils/mode/mode.c @@ -32,7 +32,8 @@ #define NUM_ELEMENTS(a) (sizeof(a)/sizeof(a[0])) #define ASSERT(a) -const TCHAR* const usage_strings[] = { +const TCHAR* const usage_strings[] = +{ _T("Device Status: MODE [device] [/STATUS]"), _T("Select code page: MODE CON[:] CP SELECT=yyy"), _T("Code page status: MODE CON[:] CP [/STATUS]"), @@ -45,7 +46,8 @@ const TCHAR* const usage_strings[] = { _T(" [rts=on|off|hs|tg] [idsr=on|off]"), }; -const TCHAR* const parity_strings[] = { +const TCHAR* const parity_strings[] = +{ _T("None"), // default _T("Odd"), // only symbol in this set to have a 'd' in it _T("Even"), // ... 'v' in it @@ -60,10 +62,11 @@ const TCHAR* const stopbit_strings[] = { _T("1"), _T("1.5"), _T("2") }; int Usage() { - int i; + int i; _tprintf(_T("\nConfigures system devices.\n\n")); - for (i = 0; i < NUM_ELEMENTS(usage_strings); i++) { + for (i = 0; i < NUM_ELEMENTS(usage_strings); i++) + { _tprintf(_T("%s\n"), usage_strings[i]); } _tprintf(_T("\n")); @@ -77,21 +80,32 @@ int QueryDevices() TCHAR* ptr = buffer; *ptr = '\0'; - if (QueryDosDevice(NULL, buffer, NUM_ELEMENTS(buffer))) { - while (*ptr != '\0') { + if (QueryDosDevice(NULL, buffer, NUM_ELEMENTS(buffer))) + { + while (*ptr != '\0') + { len = _tcslen(ptr); - if (_tcsstr(ptr, _T("COM"))) { + if (_tcsstr(ptr, _T("COM"))) + { _tprintf(_T(" Found serial device - %s\n"), ptr); - } else if (_tcsstr(ptr, _T("PRN"))) { + } + else if (_tcsstr(ptr, _T("PRN"))) + { _tprintf(_T(" Found printer device - %s\n"), ptr); - } else if (_tcsstr(ptr, _T("LPT"))) { + } + else if (_tcsstr(ptr, _T("LPT"))) + { _tprintf(_T(" Found parallel device - %s\n"), ptr); - } else { + } + else + { //_tprintf(_T(" Found other device - %s\n"), ptr); } ptr += (len+1); } - } else { + } + else + { _tprintf(_T(" ERROR: QueryDosDevice(...) failed.%ld\n"), GetLastError()); } return 1; @@ -105,19 +119,28 @@ int ShowParallelStatus(int nPortNum) _stprintf(szPortName, _T("LPT%d"), nPortNum); _tprintf(_T("\nStatus for device LPT%d:\n"), nPortNum); _tprintf(_T("-----------------------\n")); - if (QueryDosDevice(szPortName, buffer, NUM_ELEMENTS(buffer))) { + if (QueryDosDevice(szPortName, buffer, NUM_ELEMENTS(buffer))) + { TCHAR* ptr = _tcsrchr(buffer, '\\'); - if (ptr != NULL) { - if (0 == _tcscmp(szPortName, ++ptr)) { + if (ptr != NULL) + { + if (0 == _tcscmp(szPortName, ++ptr)) + { _tprintf(_T(" Printer output is not being rerouted.\n")); - } else { + } + else + { _tprintf(_T(" Printer output is being rerouted to serial port %s\n"), ptr); } return 0; - } else { + } + else + { _tprintf(_T(" QueryDosDevice(%s) returned unrecogised form %s.\n"), szPortName, buffer); } - } else { + } + else + { _tprintf(_T(" ERROR: QueryDosDevice(%s) failed.\n"), szPortName); } return 1; @@ -132,14 +155,17 @@ int ShowConsoleStatus() _tprintf(_T("\nStatus for device CON:\n")); _tprintf(_T("-----------------------\n")); - if (GetConsoleScreenBufferInfo(hConsoleOutput, &ConsoleScreenBufferInfo)) { + if (GetConsoleScreenBufferInfo(hConsoleOutput, &ConsoleScreenBufferInfo)) + { _tprintf(_T(" Lines: %d\n"), ConsoleScreenBufferInfo.dwSize.Y); _tprintf(_T(" Columns: %d\n"), ConsoleScreenBufferInfo.dwSize.X); } - if (SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &dwKbdDelay, 0)) { + if (SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &dwKbdDelay, 0)) + { _tprintf(_T(" Keyboard delay: %ld\n"), dwKbdDelay); } - if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &dwKbdSpeed, 0)) { + if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &dwKbdSpeed, 0)) + { _tprintf(_T(" Keyboard rate: %ld\n"), dwKbdSpeed); } _tprintf(_T(" Code page: %d\n"), GetConsoleOutputCP()); @@ -165,31 +191,29 @@ BOOL SerialPortQuery(int nPortNum, LPDCB pDCB, LPCOMMTIMEOUTS pCommTimeouts, BOO 0, // no attributes NULL); // no template - if (hPort == INVALID_HANDLE_VALUE) { + if (hPort == INVALID_HANDLE_VALUE) + { _tprintf(_T("Illegal device name - %s\n"), szPortName); _tprintf(_T("Last error = 0x%lx\n"), GetLastError()); return FALSE; } - if (bWrite) { - result = SetCommState(hPort, pDCB); - } else { - result = GetCommState(hPort, pDCB); - } - if (!result) { + + result = bWrite ? SetCommState(hPort, pDCB) + : GetCommState(hPort, pDCB); + if (!result) + { _tprintf(_T("Failed to %s the status for device COM%d:\n"), bWrite ? _T("set") : _T("get"), nPortNum); CloseHandle(hPort); return FALSE; } - if (bWrite) { - result = SetCommTimeouts(hPort, pCommTimeouts); - } else { - result = GetCommTimeouts(hPort, pCommTimeouts); - } - if (!result) { + + result = bWrite ? SetCommTimeouts(hPort, pCommTimeouts) + : GetCommTimeouts(hPort, pCommTimeouts); + if (!result) + { _tprintf(_T("Failed to %s Timeout status for device COM%d:\n"), bWrite ? _T("set") : _T("get"), nPortNum); CloseHandle(hPort); return FALSE; - } CloseHandle(hPort); return TRUE; @@ -200,14 +224,17 @@ int ShowSerialStatus(int nPortNum) DCB dcb; COMMTIMEOUTS CommTimeouts; - if (!SerialPortQuery(nPortNum, &dcb, &CommTimeouts, FALSE)) { + if (!SerialPortQuery(nPortNum, &dcb, &CommTimeouts, FALSE)) + { return 1; } - if (dcb.Parity > NUM_ELEMENTS(parity_strings)) { + if (dcb.Parity > NUM_ELEMENTS(parity_strings)) + { _tprintf(_T("ERROR: Invalid value for Parity Bits %d:\n"), dcb.Parity); dcb.Parity = 0; } - if (dcb.StopBits > NUM_ELEMENTS(stopbit_strings)) { + if (dcb.StopBits > NUM_ELEMENTS(stopbit_strings)) + { _tprintf(_T("ERROR: Invalid value for Stop Bits %d:\n"), dcb.StopBits); dcb.StopBits = 0; } @@ -234,9 +261,9 @@ int SetParallelState(int nPortNum) _stprintf(szPortName, _T("LPT%d"), nPortNum); _stprintf(szTargetPath, _T("COM%d"), nPortNum); - if (!DefineDosDevice(DDD_REMOVE_DEFINITION, szPortName, szTargetPath)) { + if (!DefineDosDevice(DDD_REMOVE_DEFINITION, szPortName, szTargetPath)) + { DWORD error = GetLastError(); - _tprintf(_T("SetParallelState(%d) - DefineDosDevice(%s) failed: 0x%lx\n"), nPortNum, szPortName, error); } return 0; @@ -260,26 +287,26 @@ DWORD QueryDosDevice( int SetConsoleState() { /* - "Select code page: MODE CON[:] CP SELECT=yyy", - "Code page status: MODE CON[:] CP [/STATUS]", - "Display mode: MODE CON[:] [COLS=c] [LINES=n]", - "Typematic rate: MODE CON[:] [RATE=r DELAY=d]", + "Select code page: MODE CON[:] CP SELECT=yyy", + "Code page status: MODE CON[:] CP [/STATUS]", + "Display mode: MODE CON[:] [COLS=c] [LINES=n]", + "Typematic rate: MODE CON[:] [RATE=r DELAY=d]", */ - return 0; + return 0; } static int ExtractModeSerialParams(const TCHAR* param) { - if ( _tcsstr(param, _T("OFF"))) { + if (_tcsstr(param, _T("OFF"))) return 0; - } else if (_tcsstr(param, _T("ON"))) { + else if (_tcsstr(param, _T("ON"))) return 1; - } else if (_tcsstr(param, _T("HS"))) { + else if (_tcsstr(param, _T("HS"))) return 2; - } else if (_tcsstr(param, _T("TG"))) { + else if (_tcsstr(param, _T("TG"))) return 3; - } + return -1; } @@ -291,88 +318,133 @@ int SetSerialState(int nPortNum, int args, TCHAR *argv[]) COMMTIMEOUTS CommTimeouts; TCHAR buf[MAX_COMPARAM_LEN+1]; - if (SerialPortQuery(nPortNum, &dcb, &CommTimeouts, FALSE)) { - for (arg = 2; arg < args; arg++) { - if (_tcslen(argv[arg]) > MAX_COMPARAM_LEN) { + if (SerialPortQuery(nPortNum, &dcb, &CommTimeouts, FALSE)) + { + for (arg = 2; arg < args; arg++) + { + if (_tcslen(argv[arg]) > MAX_COMPARAM_LEN) + { _tprintf(_T("Invalid parameter (too long) - %s\n"), argv[arg]); return 1; } _tcscpy(buf, argv[arg]); _tcslwr(buf); - if (_tcsstr(buf, _T("baud="))) { + if (_tcsstr(buf, _T("baud="))) + { _tscanf(buf+5, "%lu", &dcb.BaudRate); - } else if (_tcsstr(buf, _T("parity="))) { - if (_tcschr(buf, 'D')) { + } + else if (_tcsstr(buf, _T("parity="))) + { + if (_tcschr(buf, 'D')) dcb.Parity = 1; - } else if (_tcschr(buf, 'V')) { + else if (_tcschr(buf, 'V')) dcb.Parity = 2; - } else if (_tcschr(buf, 'M')) { + else if (_tcschr(buf, 'M')) dcb.Parity = 3; - } else if (_tcschr(buf, 'S')) { + else if (_tcschr(buf, 'S')) dcb.Parity = 4; - } else { + else dcb.Parity = 0; - } - } else if (_tcsstr(buf, _T("data="))) { + } + else if (_tcsstr(buf, _T("data="))) + { _tscanf(buf+5, "%lu", &dcb.ByteSize); - } else if (_tcsstr(buf, _T("stop="))) { - if (_tcschr(buf, '5')) { + } + else if (_tcsstr(buf, _T("stop="))) + { + if (_tcschr(buf, '5')) dcb.StopBits = 1; - } else if (_tcschr(buf, '2')) { + else if (_tcschr(buf, '2')) dcb.StopBits = 2; - } else { + else dcb.StopBits = 0; - } - } else if (_tcsstr(buf, _T("to="))) { // to=on|off + } + else if (_tcsstr(buf, _T("to="))) // to=on|off + { value = ExtractModeSerialParams(buf); - if (value != -1) { - } else { + if (value != -1) + { + } + else + { goto invalid_serial_parameter; } - } else if (_tcsstr(buf, _T("xon="))) { // xon=on|off + } + else if (_tcsstr(buf, _T("xon="))) // xon=on|off + { value = ExtractModeSerialParams(buf); - if (value != -1) { + if (value != -1) + { dcb.fOutX = value; dcb.fInX = value; - } else { + } + else + { goto invalid_serial_parameter; } - } else if (_tcsstr(buf, _T("odsr="))) { // odsr=on|off + } + else if (_tcsstr(buf, _T("odsr="))) // odsr=on|off + { value = ExtractModeSerialParams(buf); - if (value != -1) { + if (value != -1) + { dcb.fOutxDsrFlow = value; - } else { + } + else + { goto invalid_serial_parameter; } - } else if (_tcsstr(buf, _T("octs="))) { // octs=on|off + } + else if (_tcsstr(buf, _T("octs="))) // octs=on|off + { value = ExtractModeSerialParams(buf); - if (value != -1) { + if (value != -1) + { dcb.fOutxCtsFlow = value; - } else { + } + else + { goto invalid_serial_parameter; } - } else if (_tcsstr(buf, _T("dtr="))) { // dtr=on|off|hs + } + else if (_tcsstr(buf, _T("dtr="))) // dtr=on|off|hs + { value = ExtractModeSerialParams(buf); - if (value != -1) { + if (value != -1) + { dcb.fDtrControl = value; - } else { + } + else + { goto invalid_serial_parameter; } - } else if (_tcsstr(buf, _T("rts="))) { // rts=on|off|hs|tg + } + else if (_tcsstr(buf, _T("rts="))) // rts=on|off|hs|tg + { value = ExtractModeSerialParams(buf); - if (value != -1) { + if (value != -1) + { dcb.fRtsControl = value; - } else { + } + else + { goto invalid_serial_parameter; } - } else if (_tcsstr(buf, _T("idsr="))) { // idsr=on|off + } + else if (_tcsstr(buf, _T("idsr="))) // idsr=on|off + { value = ExtractModeSerialParams(buf); - if (value != -1) { + if (value != -1) + { dcb.fDsrSensitivity = value; - } else { + } + else + { goto invalid_serial_parameter; } - } else { + } + else + { invalid_serial_parameter:; _tprintf(_T("Invalid parameter - %s\n"), buf); return 1; @@ -387,9 +459,11 @@ int find_portnum(const TCHAR* cmdverb) { int portnum = -1; - if (cmdverb[3] >= '0' && cmdverb[3] <= '9') { + if (cmdverb[3] >= '0' && cmdverb[3] <= '9') + { portnum = cmdverb[3] - '0'; - if (cmdverb[4] >= '0' && cmdverb[4] <= '9') { + if (cmdverb[4] >= '0' && cmdverb[4] <= '9') + { portnum *= 10; portnum += cmdverb[4] - '0'; } @@ -403,55 +477,77 @@ int main(int argc, TCHAR *argv[]) TCHAR param1[MAX_COMPARAM_LEN+1]; TCHAR param2[MAX_COMPARAM_LEN+1]; - if (argc > 1) { - if (_tcslen(argv[1]) > MAX_COMPARAM_LEN) { + if (argc > 1) + { + if (_tcslen(argv[1]) > MAX_COMPARAM_LEN) + { _tprintf(_T("Invalid parameter (too long) - %s\n"), argv[1]); return 1; } _tcscpy(param1, argv[1]); _tcslwr(param1); - if (argc > 2) { - if (_tcslen(argv[2]) > MAX_COMPARAM_LEN) { + if (argc > 2) + { + if (_tcslen(argv[2]) > MAX_COMPARAM_LEN) + { _tprintf(_T("Invalid parameter (too long) - %s\n"), argv[2]); return 1; } _tcscpy(param2, argv[2]); _tcslwr(param2); - } else { + } + else + { param2[0] = '\0'; } - if (_tcsstr(param1, _T("/?")) || _tcsstr(param1, _T("-?"))) { + if (_tcsstr(param1, _T("/?")) || _tcsstr(param1, _T("-?"))) + { return Usage(); - } else if (_tcsstr(param1, _T("/status"))) { + } + else if (_tcsstr(param1, _T("/status"))) + { goto show_status; - } else if (_tcsstr(param1, _T("lpt"))) { + } + else if (_tcsstr(param1, _T("lpt"))) + { nPortNum = find_portnum(param1); if (nPortNum != -1) return ShowParallelStatus(nPortNum); - } else if (_tcsstr(param1, _T("con"))) { + } + else if (_tcsstr(param1, _T("con"))) + { return ShowConsoleStatus(); - } else if (_tcsstr(param1, _T("com"))) { + } + else if (_tcsstr(param1, _T("com"))) + { nPortNum = find_portnum(param1); - if (nPortNum != -1) { - if (param2[0] == '\0' || _tcsstr(param2, _T("/status"))) { + if (nPortNum != -1) + { + if (param2[0] == '\0' || _tcsstr(param2, _T("/status"))) + { return ShowSerialStatus(nPortNum); - } else { + } + else + { return SetSerialState(nPortNum, argc, argv); } } } _tprintf(_T("Invalid parameter - %s\n"), param1); return 1; - } else { + } + else + { show_status:; QueryDevices(); /* ShowParallelStatus(1); - for (nPortNum = 0; nPortNum < MAX_COMPORT_NUM; nPortNum++) { - ShowSerialStatus(nPortNum + 1); + for (nPortNum = 0; nPortNum < MAX_COMPORT_NUM; nPortNum++) + { + ShowSerialStatus(nPortNum + 1); } - ShowConsoleStatus(); + ShowConsoleStatus(); */ } return 0; diff --git a/reactos/base/applications/cmdutils/mode/mode.rbuild b/reactos/base/applications/cmdutils/mode/mode.rbuild deleted file mode 100644 index 11eb3065335..00000000000 --- a/reactos/base/applications/cmdutils/mode/mode.rbuild +++ /dev/null @@ -1,6 +0,0 @@ - - . - shell32 - user32 - mode.c - mode.rc diff --git a/reactos/base/applications/cmdutils/mode/mode.rc b/reactos/base/applications/cmdutils/mode/mode.rc index 44ca8c4d32c..60f7d212f14 100644 --- a/reactos/base/applications/cmdutils/mode/mode.rc +++ b/reactos/base/applications/cmdutils/mode/mode.rc @@ -1,5 +1,5 @@ -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS mode utility\0" -#define REACTOS_STR_INTERNAL_NAME "mode\0" -#define REACTOS_STR_ORIGINAL_FILENAME "mode.exe\0" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Mode Utility" +#define REACTOS_STR_INTERNAL_NAME "mode" +#define REACTOS_STR_ORIGINAL_FILENAME "mode.exe" #include diff --git a/reactos/base/applications/cmdutils/more/more.rc b/reactos/base/applications/cmdutils/more/more.rc index ce96958212f..d44080075c6 100644 --- a/reactos/base/applications/cmdutils/more/more.rc +++ b/reactos/base/applications/cmdutils/more/more.rc @@ -2,7 +2,7 @@ #include "resource.h" -#define REACTOS_STR_FILE_DESCRIPTION "W32 more command" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS More Command" #define REACTOS_STR_INTERNAL_NAME "more" #define REACTOS_STR_ORIGINAL_FILENAME "more.exe" #include diff --git a/reactos/base/applications/cmdutils/xcopy/rsrc.rc b/reactos/base/applications/cmdutils/xcopy/rsrc.rc index 13a1969cdeb..106e3027905 100644 --- a/reactos/base/applications/cmdutils/xcopy/rsrc.rc +++ b/reactos/base/applications/cmdutils/xcopy/rsrc.rc @@ -20,7 +20,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#define REACTOS_STR_FILE_DESCRIPTION "xcopy command" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Xcopy Command" #define REACTOS_STR_INTERNAL_NAME "xcopy" #define REACTOS_STR_ORIGINAL_FILENAME "xcopy.exe" #include From c6ba928ae3f5aafb8eafa6a5c9bec08d2034ece9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 17 Mar 2014 23:42:55 +0000 Subject: [PATCH 123/419] Previous commit (forgotten): ============================ [MODE] - Remove unneeded import lib; - Code formatting (*nix--;) - Remove .rbuild file (we now use cmake :D ) Current commit: =============== [MODE][MORE] Even if those utilities are perfect valid x86 PE executables, turn their extensions to .com for compatibility purposes with old scripts (as done on windows). svn path=/trunk/; revision=62524 --- reactos/base/applications/cmdutils/mode/CMakeLists.txt | 2 ++ reactos/base/applications/cmdutils/mode/mode.rc | 2 +- reactos/base/applications/cmdutils/more/CMakeLists.txt | 2 ++ reactos/base/applications/cmdutils/more/more.rc | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/reactos/base/applications/cmdutils/mode/CMakeLists.txt b/reactos/base/applications/cmdutils/mode/CMakeLists.txt index ed5689cdd3e..e03cde3e27c 100644 --- a/reactos/base/applications/cmdutils/mode/CMakeLists.txt +++ b/reactos/base/applications/cmdutils/mode/CMakeLists.txt @@ -1,5 +1,7 @@ add_executable(mode mode.c mode.rc) set_module_type(mode win32cui) +set_target_properties(mode PROPERTIES SUFFIX ".com") + add_importlibs(mode user32 msvcrt kernel32) add_cd_file(TARGET mode DESTINATION reactos/system32 FOR all) diff --git a/reactos/base/applications/cmdutils/mode/mode.rc b/reactos/base/applications/cmdutils/mode/mode.rc index 60f7d212f14..33c5a85f202 100644 --- a/reactos/base/applications/cmdutils/mode/mode.rc +++ b/reactos/base/applications/cmdutils/mode/mode.rc @@ -1,5 +1,5 @@ #define REACTOS_STR_FILE_DESCRIPTION "ReactOS Mode Utility" #define REACTOS_STR_INTERNAL_NAME "mode" -#define REACTOS_STR_ORIGINAL_FILENAME "mode.exe" +#define REACTOS_STR_ORIGINAL_FILENAME "mode.com" #include diff --git a/reactos/base/applications/cmdutils/more/CMakeLists.txt b/reactos/base/applications/cmdutils/more/CMakeLists.txt index f3d49efd5cc..28fab89b700 100644 --- a/reactos/base/applications/cmdutils/more/CMakeLists.txt +++ b/reactos/base/applications/cmdutils/more/CMakeLists.txt @@ -1,5 +1,7 @@ add_executable(more more.c more.rc) set_module_type(more win32cui) +set_target_properties(more PROPERTIES SUFFIX ".com") + add_importlibs(more user32 msvcrt kernel32) add_cd_file(TARGET more DESTINATION reactos/system32 FOR all) diff --git a/reactos/base/applications/cmdutils/more/more.rc b/reactos/base/applications/cmdutils/more/more.rc index d44080075c6..4d04db0baf4 100644 --- a/reactos/base/applications/cmdutils/more/more.rc +++ b/reactos/base/applications/cmdutils/more/more.rc @@ -4,7 +4,7 @@ #define REACTOS_STR_FILE_DESCRIPTION "ReactOS More Command" #define REACTOS_STR_INTERNAL_NAME "more" -#define REACTOS_STR_ORIGINAL_FILENAME "more.exe" +#define REACTOS_STR_ORIGINAL_FILENAME "more.com" #include /* UTF-8 */ From eb1db23139bb8e88222e76473178319a27c40b69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 18 Mar 2014 00:17:27 +0000 Subject: [PATCH 124/419] [MODE]: Convert into UNICODE. svn path=/trunk/; revision=62525 --- .../applications/cmdutils/mode/CMakeLists.txt | 2 +- .../base/applications/cmdutils/mode/mode.c | 291 +++++++++--------- 2 files changed, 145 insertions(+), 148 deletions(-) diff --git a/reactos/base/applications/cmdutils/mode/CMakeLists.txt b/reactos/base/applications/cmdutils/mode/CMakeLists.txt index e03cde3e27c..354c426dd2b 100644 --- a/reactos/base/applications/cmdutils/mode/CMakeLists.txt +++ b/reactos/base/applications/cmdutils/mode/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(mode mode.c mode.rc) -set_module_type(mode win32cui) +set_module_type(mode win32cui UNICODE) set_target_properties(mode PROPERTIES SUFFIX ".com") add_importlibs(mode user32 msvcrt kernel32) diff --git a/reactos/base/applications/cmdutils/mode/mode.c b/reactos/base/applications/cmdutils/mode/mode.c index fd9cb773522..aa49431ea95 100644 --- a/reactos/base/applications/cmdutils/mode/mode.c +++ b/reactos/base/applications/cmdutils/mode/mode.c @@ -21,9 +21,7 @@ */ #include -#include #include -#include #define MAX_PORTNAME_LEN 20 #define MAX_COMPORT_NUM 10 @@ -32,116 +30,116 @@ #define NUM_ELEMENTS(a) (sizeof(a)/sizeof(a[0])) #define ASSERT(a) -const TCHAR* const usage_strings[] = +const WCHAR* const usage_strings[] = { - _T("Device Status: MODE [device] [/STATUS]"), - _T("Select code page: MODE CON[:] CP SELECT=yyy"), - _T("Code page status: MODE CON[:] CP [/STATUS]"), - _T("Display mode: MODE CON[:] [COLS=c] [LINES=n]"), - _T("Typematic rate: MODE CON[:] [RATE=r DELAY=d]"), - _T("Redirect printing: MODE LPTn[:]=COMm[:]"), - _T("Serial port: MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s]\n") \ - _T(" [to=on|off] [xon=on|off] [odsr=on|off]\n") \ - _T(" [octs=on|off] [dtr=on|off|hs]\n") \ - _T(" [rts=on|off|hs|tg] [idsr=on|off]"), + L"Device Status: MODE [device] [/STATUS]", + L"Select code page: MODE CON[:] CP SELECT=yyy", + L"Code page status: MODE CON[:] CP [/STATUS]", + L"Display mode: MODE CON[:] [COLS=c] [LINES=n]", + L"Typematic rate: MODE CON[:] [RATE=r DELAY=d]", + L"Redirect printing: MODE LPTn[:]=COMm[:]", + L"Serial port: MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s]\n" \ + L" [to=on|off] [xon=on|off] [odsr=on|off]\n" \ + L" [octs=on|off] [dtr=on|off|hs]\n" \ + L" [rts=on|off|hs|tg] [idsr=on|off]", }; -const TCHAR* const parity_strings[] = +const WCHAR* const parity_strings[] = { - _T("None"), // default - _T("Odd"), // only symbol in this set to have a 'd' in it - _T("Even"), // ... 'v' in it - _T("Mark"), // ... 'm' in it - _T("Space") // ... 's' and/or a 'c' in it + L"None", // default + L"Odd", // only symbol in this set to have a 'd' in it + L"Even", // ... 'v' in it + L"Mark", // ... 'm' in it + L"Space" // ... 's' and/or a 'c' in it }; -const TCHAR* const control_strings[] = { _T("OFF"), _T("ON"), _T("HANDSHAKE"), _T("TOGGLE") }; +const WCHAR* const control_strings[] = { L"OFF", L"ON", L"HANDSHAKE", L"TOGGLE" }; -const TCHAR* const stopbit_strings[] = { _T("1"), _T("1.5"), _T("2") }; +const WCHAR* const stopbit_strings[] = { L"1", L"1.5", L"2" }; int Usage() { int i; - _tprintf(_T("\nConfigures system devices.\n\n")); + wprintf(L"\nConfigures system devices.\n\n"); for (i = 0; i < NUM_ELEMENTS(usage_strings); i++) { - _tprintf(_T("%s\n"), usage_strings[i]); + wprintf(L"%s\n", usage_strings[i]); } - _tprintf(_T("\n")); + wprintf(L"\n"); return 0; } int QueryDevices() { - TCHAR buffer[20240]; + WCHAR buffer[20240]; int len; - TCHAR* ptr = buffer; + WCHAR* ptr = buffer; - *ptr = '\0'; - if (QueryDosDevice(NULL, buffer, NUM_ELEMENTS(buffer))) + *ptr = L'\0'; + if (QueryDosDeviceW(NULL, buffer, NUM_ELEMENTS(buffer))) { - while (*ptr != '\0') + while (*ptr != L'\0') { - len = _tcslen(ptr); - if (_tcsstr(ptr, _T("COM"))) + len = wcslen(ptr); + if (wcsstr(ptr, L"COM")) { - _tprintf(_T(" Found serial device - %s\n"), ptr); + wprintf(L" Found serial device - %s\n", ptr); } - else if (_tcsstr(ptr, _T("PRN"))) + else if (wcsstr(ptr, L"PRN")) { - _tprintf(_T(" Found printer device - %s\n"), ptr); + wprintf(L" Found printer device - %s\n", ptr); } - else if (_tcsstr(ptr, _T("LPT"))) + else if (wcsstr(ptr, L"LPT")) { - _tprintf(_T(" Found parallel device - %s\n"), ptr); + wprintf(L" Found parallel device - %s\n", ptr); } else { - //_tprintf(_T(" Found other device - %s\n"), ptr); + // wprintf(L" Found other device - %s\n", ptr); } ptr += (len+1); } } else { - _tprintf(_T(" ERROR: QueryDosDevice(...) failed.%ld\n"), GetLastError()); + wprintf(L" ERROR: QueryDosDeviceW(...) failed: 0x%lx\n", GetLastError()); } return 1; } int ShowParallelStatus(int nPortNum) { - TCHAR buffer[250]; - TCHAR szPortName[MAX_PORTNAME_LEN]; + WCHAR buffer[250]; + WCHAR szPortName[MAX_PORTNAME_LEN]; - _stprintf(szPortName, _T("LPT%d"), nPortNum); - _tprintf(_T("\nStatus for device LPT%d:\n"), nPortNum); - _tprintf(_T("-----------------------\n")); - if (QueryDosDevice(szPortName, buffer, NUM_ELEMENTS(buffer))) + swprintf(szPortName, L"LPT%d", nPortNum); + wprintf(L"\nStatus for device LPT%d:\n", nPortNum); + wprintf(L"-----------------------\n"); + if (QueryDosDeviceW(szPortName, buffer, NUM_ELEMENTS(buffer))) { - TCHAR* ptr = _tcsrchr(buffer, '\\'); + WCHAR* ptr = wcsrchr(buffer, L'\\'); if (ptr != NULL) { - if (0 == _tcscmp(szPortName, ++ptr)) + if (0 == wcscmp(szPortName, ++ptr)) { - _tprintf(_T(" Printer output is not being rerouted.\n")); + wprintf(L" Printer output is not being rerouted.\n"); } else { - _tprintf(_T(" Printer output is being rerouted to serial port %s\n"), ptr); + wprintf(L" Printer output is being rerouted to serial port %s\n", ptr); } return 0; } else { - _tprintf(_T(" QueryDosDevice(%s) returned unrecogised form %s.\n"), szPortName, buffer); + wprintf(L" QueryDosDeviceW(%s) returned unrecognised form %s.\n", szPortName, buffer); } } else { - _tprintf(_T(" ERROR: QueryDosDevice(%s) failed.\n"), szPortName); + wprintf(L" ERROR: QueryDosDeviceW(%s) failed: 0x%lx\n", szPortName, GetLastError()); } return 1; } @@ -153,22 +151,22 @@ int ShowConsoleStatus() CONSOLE_SCREEN_BUFFER_INFO ConsoleScreenBufferInfo; HANDLE hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); - _tprintf(_T("\nStatus for device CON:\n")); - _tprintf(_T("-----------------------\n")); + wprintf(L"\nStatus for device CON:\n"); + wprintf(L"-----------------------\n"); if (GetConsoleScreenBufferInfo(hConsoleOutput, &ConsoleScreenBufferInfo)) { - _tprintf(_T(" Lines: %d\n"), ConsoleScreenBufferInfo.dwSize.Y); - _tprintf(_T(" Columns: %d\n"), ConsoleScreenBufferInfo.dwSize.X); + wprintf(L" Lines: %d\n", ConsoleScreenBufferInfo.dwSize.Y); + wprintf(L" Columns: %d\n", ConsoleScreenBufferInfo.dwSize.X); } if (SystemParametersInfo(SPI_GETKEYBOARDDELAY, 0, &dwKbdDelay, 0)) { - _tprintf(_T(" Keyboard delay: %ld\n"), dwKbdDelay); + wprintf(L" Keyboard delay: %ld\n", dwKbdDelay); } if (SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &dwKbdSpeed, 0)) { - _tprintf(_T(" Keyboard rate: %ld\n"), dwKbdSpeed); + wprintf(L" Keyboard rate: %ld\n", dwKbdSpeed); } - _tprintf(_T(" Code page: %d\n"), GetConsoleOutputCP()); + wprintf(L" Code page: %d\n", GetConsoleOutputCP()); return 0; } @@ -177,24 +175,24 @@ BOOL SerialPortQuery(int nPortNum, LPDCB pDCB, LPCOMMTIMEOUTS pCommTimeouts, BOO { BOOL result; HANDLE hPort; - TCHAR szPortName[MAX_PORTNAME_LEN]; + WCHAR szPortName[MAX_PORTNAME_LEN]; ASSERT(pDCB); ASSERT(pCommTimeouts); - _stprintf(szPortName, _T("COM%d"), nPortNum); - hPort = CreateFile(szPortName, - GENERIC_READ|GENERIC_WRITE, - 0, // exclusive - NULL, // sec attr - OPEN_EXISTING, - 0, // no attributes - NULL); // no template + swprintf(szPortName, L"COM%d", nPortNum); + hPort = CreateFileW(szPortName, + GENERIC_READ | GENERIC_WRITE, + 0, // exclusive + NULL, // sec attr + OPEN_EXISTING, + 0, // no attributes + NULL); // no template if (hPort == INVALID_HANDLE_VALUE) { - _tprintf(_T("Illegal device name - %s\n"), szPortName); - _tprintf(_T("Last error = 0x%lx\n"), GetLastError()); + wprintf(L"Illegal device name - %s\n", szPortName); + wprintf(L"Last error = 0x%lx\n", GetLastError()); return FALSE; } @@ -202,7 +200,7 @@ BOOL SerialPortQuery(int nPortNum, LPDCB pDCB, LPCOMMTIMEOUTS pCommTimeouts, BOO : GetCommState(hPort, pDCB); if (!result) { - _tprintf(_T("Failed to %s the status for device COM%d:\n"), bWrite ? _T("set") : _T("get"), nPortNum); + wprintf(L"Failed to %s the status for device COM%d:\n", bWrite ? L"set" : L"get", nPortNum); CloseHandle(hPort); return FALSE; } @@ -211,7 +209,7 @@ BOOL SerialPortQuery(int nPortNum, LPDCB pDCB, LPCOMMTIMEOUTS pCommTimeouts, BOO : GetCommTimeouts(hPort, pCommTimeouts); if (!result) { - _tprintf(_T("Failed to %s Timeout status for device COM%d:\n"), bWrite ? _T("set") : _T("get"), nPortNum); + wprintf(L"Failed to %s Timeout status for device COM%d:\n", bWrite ? L"set" : L"get", nPortNum); CloseHandle(hPort); return FALSE; } @@ -230,41 +228,40 @@ int ShowSerialStatus(int nPortNum) } if (dcb.Parity > NUM_ELEMENTS(parity_strings)) { - _tprintf(_T("ERROR: Invalid value for Parity Bits %d:\n"), dcb.Parity); + wprintf(L"ERROR: Invalid value for Parity Bits %d:\n", dcb.Parity); dcb.Parity = 0; } if (dcb.StopBits > NUM_ELEMENTS(stopbit_strings)) { - _tprintf(_T("ERROR: Invalid value for Stop Bits %d:\n"), dcb.StopBits); + wprintf(L"ERROR: Invalid value for Stop Bits %d:\n", dcb.StopBits); dcb.StopBits = 0; } - _tprintf(_T("\nStatus for device COM%d:\n"), nPortNum); - _tprintf(_T("-----------------------\n")); - _tprintf(_T(" Baud: %ld\n"), dcb.BaudRate); - _tprintf(_T(" Parity: %s\n"), parity_strings[dcb.Parity]); - _tprintf(_T(" Data Bits: %d\n"), dcb.ByteSize); - _tprintf(_T(" Stop Bits: %s\n"), stopbit_strings[dcb.StopBits]); - _tprintf(_T(" Timeout: %s\n"), CommTimeouts.ReadIntervalTimeout ? _T("ON") : _T("OFF")); - _tprintf(_T(" XON/XOFF: %s\n"), dcb.fOutX ? _T("ON") : _T("OFF")); - _tprintf(_T(" CTS handshaking: %s\n"), dcb.fOutxCtsFlow ? _T("ON") : _T("OFF")); - _tprintf(_T(" DSR handshaking: %s\n"), dcb.fOutxDsrFlow ? _T("ON") : _T("OFF")); - _tprintf(_T(" DSR sensitivity: %s\n"), dcb.fDsrSensitivity ? _T("ON") : _T("OFF")); - _tprintf(_T(" DTR circuit: %s\n"), control_strings[dcb.fDtrControl]); - _tprintf(_T(" RTS circuit: %s\n"), control_strings[dcb.fRtsControl]); + wprintf(L"\nStatus for device COM%d:\n", nPortNum); + wprintf(L"-----------------------\n"); + wprintf(L" Baud: %ld\n", dcb.BaudRate); + wprintf(L" Parity: %s\n", parity_strings[dcb.Parity]); + wprintf(L" Data Bits: %d\n", dcb.ByteSize); + wprintf(L" Stop Bits: %s\n", stopbit_strings[dcb.StopBits]); + wprintf(L" Timeout: %s\n", CommTimeouts.ReadIntervalTimeout ? L"ON" : L"OFF"); + wprintf(L" XON/XOFF: %s\n", dcb.fOutX ? L"ON" : L"OFF"); + wprintf(L" CTS handshaking: %s\n", dcb.fOutxCtsFlow ? L"ON" : L"OFF"); + wprintf(L" DSR handshaking: %s\n", dcb.fOutxDsrFlow ? L"ON" : L"OFF"); + wprintf(L" DSR sensitivity: %s\n", dcb.fDsrSensitivity ? L"ON" : L"OFF"); + wprintf(L" DTR circuit: %s\n", control_strings[dcb.fDtrControl]); + wprintf(L" RTS circuit: %s\n", control_strings[dcb.fRtsControl]); return 0; } int SetParallelState(int nPortNum) { - TCHAR szPortName[MAX_PORTNAME_LEN]; - TCHAR szTargetPath[MAX_PORTNAME_LEN]; + WCHAR szPortName[MAX_PORTNAME_LEN]; + WCHAR szTargetPath[MAX_PORTNAME_LEN]; - _stprintf(szPortName, _T("LPT%d"), nPortNum); - _stprintf(szTargetPath, _T("COM%d"), nPortNum); - if (!DefineDosDevice(DDD_REMOVE_DEFINITION, szPortName, szTargetPath)) + swprintf(szPortName, L"LPT%d", nPortNum); + swprintf(szTargetPath, L"COM%d", nPortNum); + if (!DefineDosDeviceW(DDD_REMOVE_DEFINITION, szPortName, szTargetPath)) { - DWORD error = GetLastError(); - _tprintf(_T("SetParallelState(%d) - DefineDosDevice(%s) failed: 0x%lx\n"), nPortNum, szPortName, error); + wprintf(L"SetParallelState(%d) - DefineDosDevice(%s) failed: 0x%lx\n", nPortNum, szPortName, GetLastError()); } return 0; } @@ -296,70 +293,70 @@ int SetConsoleState() } static -int ExtractModeSerialParams(const TCHAR* param) +int ExtractModeSerialParams(const WCHAR* param) { - if (_tcsstr(param, _T("OFF"))) + if (wcsstr(param, L"OFF")) return 0; - else if (_tcsstr(param, _T("ON"))) + else if (wcsstr(param, L"ON")) return 1; - else if (_tcsstr(param, _T("HS"))) + else if (wcsstr(param, L"HS")) return 2; - else if (_tcsstr(param, _T("TG"))) + else if (wcsstr(param, L"TG")) return 3; return -1; } -int SetSerialState(int nPortNum, int args, TCHAR *argv[]) +int SetSerialState(int nPortNum, int args, WCHAR *argv[]) { int arg; int value; DCB dcb; COMMTIMEOUTS CommTimeouts; - TCHAR buf[MAX_COMPARAM_LEN+1]; + WCHAR buf[MAX_COMPARAM_LEN+1]; if (SerialPortQuery(nPortNum, &dcb, &CommTimeouts, FALSE)) { for (arg = 2; arg < args; arg++) { - if (_tcslen(argv[arg]) > MAX_COMPARAM_LEN) + if (wcslen(argv[arg]) > MAX_COMPARAM_LEN) { - _tprintf(_T("Invalid parameter (too long) - %s\n"), argv[arg]); + wprintf(L"Invalid parameter (too long) - %s\n", argv[arg]); return 1; } - _tcscpy(buf, argv[arg]); - _tcslwr(buf); - if (_tcsstr(buf, _T("baud="))) + wcscpy(buf, argv[arg]); + _wcslwr(buf); + if (wcsstr(buf, L"baud=")) { - _tscanf(buf+5, "%lu", &dcb.BaudRate); + wscanf(buf+5, L"%lu", &dcb.BaudRate); } - else if (_tcsstr(buf, _T("parity="))) + else if (wcsstr(buf, L"parity=")) { - if (_tcschr(buf, 'D')) + if (wcschr(buf, L'D')) dcb.Parity = 1; - else if (_tcschr(buf, 'V')) + else if (wcschr(buf, L'V')) dcb.Parity = 2; - else if (_tcschr(buf, 'M')) + else if (wcschr(buf, L'M')) dcb.Parity = 3; - else if (_tcschr(buf, 'S')) + else if (wcschr(buf, L'S')) dcb.Parity = 4; else dcb.Parity = 0; } - else if (_tcsstr(buf, _T("data="))) + else if (wcsstr(buf, L"data=")) { - _tscanf(buf+5, "%lu", &dcb.ByteSize); + wscanf(buf+5, L"%lu", &dcb.ByteSize); } - else if (_tcsstr(buf, _T("stop="))) + else if (wcsstr(buf, L"stop=")) { - if (_tcschr(buf, '5')) + if (wcschr(buf, L'5')) dcb.StopBits = 1; - else if (_tcschr(buf, '2')) + else if (wcschr(buf, L'2')) dcb.StopBits = 2; else dcb.StopBits = 0; } - else if (_tcsstr(buf, _T("to="))) // to=on|off + else if (wcsstr(buf, L"to=")) // to=on|off { value = ExtractModeSerialParams(buf); if (value != -1) @@ -370,7 +367,7 @@ int SetSerialState(int nPortNum, int args, TCHAR *argv[]) goto invalid_serial_parameter; } } - else if (_tcsstr(buf, _T("xon="))) // xon=on|off + else if (wcsstr(buf, L"xon=")) // xon=on|off { value = ExtractModeSerialParams(buf); if (value != -1) @@ -383,7 +380,7 @@ int SetSerialState(int nPortNum, int args, TCHAR *argv[]) goto invalid_serial_parameter; } } - else if (_tcsstr(buf, _T("odsr="))) // odsr=on|off + else if (wcsstr(buf, L"odsr=")) // odsr=on|off { value = ExtractModeSerialParams(buf); if (value != -1) @@ -395,7 +392,7 @@ int SetSerialState(int nPortNum, int args, TCHAR *argv[]) goto invalid_serial_parameter; } } - else if (_tcsstr(buf, _T("octs="))) // octs=on|off + else if (wcsstr(buf, L"octs=")) // octs=on|off { value = ExtractModeSerialParams(buf); if (value != -1) @@ -407,7 +404,7 @@ int SetSerialState(int nPortNum, int args, TCHAR *argv[]) goto invalid_serial_parameter; } } - else if (_tcsstr(buf, _T("dtr="))) // dtr=on|off|hs + else if (wcsstr(buf, L"dtr=")) // dtr=on|off|hs { value = ExtractModeSerialParams(buf); if (value != -1) @@ -419,7 +416,7 @@ int SetSerialState(int nPortNum, int args, TCHAR *argv[]) goto invalid_serial_parameter; } } - else if (_tcsstr(buf, _T("rts="))) // rts=on|off|hs|tg + else if (wcsstr(buf, L"rts=")) // rts=on|off|hs|tg { value = ExtractModeSerialParams(buf); if (value != -1) @@ -431,7 +428,7 @@ int SetSerialState(int nPortNum, int args, TCHAR *argv[]) goto invalid_serial_parameter; } } - else if (_tcsstr(buf, _T("idsr="))) // idsr=on|off + else if (wcsstr(buf, L"idsr=")) // idsr=on|off { value = ExtractModeSerialParams(buf); if (value != -1) @@ -446,7 +443,7 @@ int SetSerialState(int nPortNum, int args, TCHAR *argv[]) else { invalid_serial_parameter:; - _tprintf(_T("Invalid parameter - %s\n"), buf); + wprintf(L"Invalid parameter - %s\n", buf); return 1; } } @@ -455,75 +452,75 @@ invalid_serial_parameter:; return 0; } -int find_portnum(const TCHAR* cmdverb) +int find_portnum(const WCHAR* cmdverb) { int portnum = -1; - if (cmdverb[3] >= '0' && cmdverb[3] <= '9') + if (cmdverb[3] >= L'0' && cmdverb[3] <= L'9') { - portnum = cmdverb[3] - '0'; - if (cmdverb[4] >= '0' && cmdverb[4] <= '9') + portnum = cmdverb[3] - L'0'; + if (cmdverb[4] >= L'0' && cmdverb[4] <= L'9') { portnum *= 10; - portnum += cmdverb[4] - '0'; + portnum += cmdverb[4] - L'0'; } } return portnum; } -int main(int argc, TCHAR *argv[]) +int wmain(int argc, WCHAR* argv[]) { int nPortNum; - TCHAR param1[MAX_COMPARAM_LEN+1]; - TCHAR param2[MAX_COMPARAM_LEN+1]; + WCHAR param1[MAX_COMPARAM_LEN+1]; + WCHAR param2[MAX_COMPARAM_LEN+1]; if (argc > 1) { - if (_tcslen(argv[1]) > MAX_COMPARAM_LEN) + if (wcslen(argv[1]) > MAX_COMPARAM_LEN) { - _tprintf(_T("Invalid parameter (too long) - %s\n"), argv[1]); + wprintf(L"Invalid parameter (too long) - %s\n", argv[1]); return 1; } - _tcscpy(param1, argv[1]); - _tcslwr(param1); + wcscpy(param1, argv[1]); + _wcslwr(param1); if (argc > 2) { - if (_tcslen(argv[2]) > MAX_COMPARAM_LEN) + if (wcslen(argv[2]) > MAX_COMPARAM_LEN) { - _tprintf(_T("Invalid parameter (too long) - %s\n"), argv[2]); + wprintf(L"Invalid parameter (too long) - %s\n", argv[2]); return 1; } - _tcscpy(param2, argv[2]); - _tcslwr(param2); + wcscpy(param2, argv[2]); + _wcslwr(param2); } else { - param2[0] = '\0'; + param2[0] = L'\0'; } - if (_tcsstr(param1, _T("/?")) || _tcsstr(param1, _T("-?"))) + if (wcsstr(param1, L"/?") || wcsstr(param1, L"-?")) { return Usage(); } - else if (_tcsstr(param1, _T("/status"))) + else if (wcsstr(param1, L"/status")) { goto show_status; } - else if (_tcsstr(param1, _T("lpt"))) + else if (wcsstr(param1, L"lpt")) { nPortNum = find_portnum(param1); if (nPortNum != -1) return ShowParallelStatus(nPortNum); } - else if (_tcsstr(param1, _T("con"))) + else if (wcsstr(param1, L"con")) { return ShowConsoleStatus(); } - else if (_tcsstr(param1, _T("com"))) + else if (wcsstr(param1, L"com")) { nPortNum = find_portnum(param1); if (nPortNum != -1) { - if (param2[0] == '\0' || _tcsstr(param2, _T("/status"))) + if (param2[0] == L'\0' || wcsstr(param2, L"/status")) { return ShowSerialStatus(nPortNum); } @@ -533,7 +530,7 @@ int main(int argc, TCHAR *argv[]) } } } - _tprintf(_T("Invalid parameter - %s\n"), param1); + wprintf(L"Invalid parameter - %s\n", param1); return 1; } else From 05f6960a49677fe10b4510a5293bb22a1e826863 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 18 Mar 2014 01:15:08 +0000 Subject: [PATCH 125/419] [NtUser|User32] - Use new menu flags. - Fix msg test_menu_messages tests. Patch from CORE-7966 breaks it. - Fix edit tests with GetMenuBarInfo. - Fix menu test_getmenubarinfo tests but the todo on line 375. svn path=/trunk/; revision=62526 --- reactos/win32ss/user/ntuser/menu.c | 374 +++++++++------------ reactos/win32ss/user/user32/windows/menu.c | 76 +++-- 2 files changed, 208 insertions(+), 242 deletions(-) diff --git a/reactos/win32ss/user/ntuser/menu.c b/reactos/win32ss/user/ntuser/menu.c index d7783d4b6d1..e387aa7018c 100644 --- a/reactos/win32ss/user/ntuser/menu.c +++ b/reactos/win32ss/user/ntuser/menu.c @@ -271,7 +271,7 @@ IntCreateMenu(PHANDLE Handle, BOOL IsMenuBar) Menu->MenuInfo.dwMenuData = 0; /* Default */ Menu->MenuInfo.Self = *Handle; Menu->MenuInfo.FocusedItem = NO_SELECTED_ITEM; - Menu->MenuInfo.Flags = (IsMenuBar ? 0 : MF_POPUP); + Menu->MenuInfo.Flags = (IsMenuBar ? 0 : MNF_POPUP); Menu->MenuInfo.Wnd = NULL; Menu->MenuInfo.WndOwner = NULL; Menu->MenuInfo.Height = 0; @@ -741,7 +741,7 @@ IntSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINF SubMenuObject = UserGetMenuObject(MenuItem->hSubMenu); if (SubMenuObject != NULL) { - SubMenuObject->MenuInfo.Flags |= MF_POPUP; + SubMenuObject->MenuInfo.Flags |= MNF_POPUP; MenuItem->fType |= MF_POPUP; } else @@ -784,7 +784,7 @@ IntSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINF } else { - if (0 == (MenuObject->MenuInfo.Flags & MF_SYSMENU)) + if (0 == (MenuObject->MenuInfo.Flags & MNF_SYSDESKMN)) { MenuItem->fType |= MF_SEPARATOR; } @@ -1733,6 +1733,50 @@ CLEANUP: END_CLEANUP; } +BOOL FASTCALL +IntGetMenuItemRect( + PWND pWnd, + PMENU_OBJECT Menu, + UINT uItem, + PRECTL Rect) +{ + LONG XMove, YMove; + PMENU_ITEM MenuItem; + int p = 0; + + if (!pWnd) + { + HWND hWnd = Menu->MenuInfo.Wnd; + if (!(pWnd = UserGetWindowObject(hWnd))) return FALSE; + } + + if ((p = IntGetMenuItemByFlag(Menu, uItem, MF_BYPOSITION, NULL, &MenuItem, NULL)) > -1) + *Rect = MenuItem->Rect; + else + { + ERR("Failed Item Lookup! %d\n", p); + return FALSE; + } + + if (Menu->MenuInfo.Flags & MNF_POPUP) + { + XMove = pWnd->rcClient.left; + YMove = pWnd->rcClient.top; + } + else + { + XMove = pWnd->rcWindow.left; + YMove = pWnd->rcWindow.top; + } + + Rect->left += XMove; + Rect->top += YMove; + Rect->right += XMove; + Rect->bottom += YMove; + + return TRUE; +} + /* * @implemented */ @@ -1743,219 +1787,126 @@ NtUserGetMenuBarInfo( LONG idItem, PMENUBARINFO pmbi) { - BOOL Res = TRUE; - PMENU_OBJECT MenuObject; - PMENU_ITEM mi; - PWND WindowObject; + PWND pWnd; HMENU hMenu; - POINT Offset; - RECTL Rect; MENUBARINFO kmbi; + BOOL Ret; + NTSTATUS Status = STATUS_SUCCESS; + PMENU_OBJECT Menu = NULL; DECLARE_RETURN(BOOL); TRACE("Enter NtUserGetMenuBarInfo\n"); UserEnterShared(); - if (!(WindowObject = UserGetWindowObject(hwnd))) - { + if (!(pWnd = UserGetWindowObject(hwnd))) + { EngSetLastError(ERROR_INVALID_WINDOW_HANDLE); RETURN(FALSE); - } - - hMenu = (HMENU)(DWORD_PTR)WindowObject->IDMenu; - - if (!(MenuObject = UserGetMenuObject(hMenu))) - { - EngSetLastError(ERROR_INVALID_MENU_HANDLE); - RETURN(FALSE); - } - - if (pmbi->cbSize != sizeof(MENUBARINFO)) - { - EngSetLastError(ERROR_INVALID_PARAMETER); - RETURN(FALSE); - } - - kmbi.cbSize = sizeof(MENUBARINFO); - kmbi.fBarFocused = FALSE; - kmbi.fFocused = FALSE; - kmbi.hwndMenu = NULL; + } switch (idObject) { - case OBJID_MENU: - { - PMENU_OBJECT SubMenuObject; - kmbi.hMenu = hMenu; - if (idItem) /* Non-Zero-Based. */ - { - if (IntGetMenuItemByFlag(MenuObject, idItem-1, MF_BYPOSITION, NULL, &mi, NULL) > -1) - kmbi.rcBar = mi->Rect; - else - { - Res = FALSE; - break; - } - } - else - { - /* If items is zero we assume info for the menu itself. */ - if (!(IntGetClientOrigin(WindowObject, &Offset))) - { - Res = FALSE; - break; - } - Rect.left = Offset.x; - Rect.right = Offset.x + MenuObject->MenuInfo.Width; - Rect.bottom = Offset.y; - Rect.top = Offset.y - MenuObject->MenuInfo.Height; - kmbi.rcBar = Rect; - TRACE("Rect top = %d bottom = %d left = %d right = %d \n", - Rect.top, Rect.bottom, Rect.left, Rect.right); - } - if (idItem) - { - if (idItem-1 == MenuObject->MenuInfo.FocusedItem) - kmbi.fFocused = TRUE; - } - if (MenuObject->MenuInfo.FocusedItem != NO_SELECTED_ITEM) - kmbi.fBarFocused = TRUE; - - if (MenuObject->MenuItemList) - { - SubMenuObject = UserGetMenuObject(MenuObject->MenuItemList->hSubMenu); - if(SubMenuObject) kmbi.hwndMenu = SubMenuObject->MenuInfo.Wnd; - } - TRACE("OBJID_MENU, idItem = %d\n",idItem); - break; - } - case OBJID_CLIENT: - { - PMENU_OBJECT SubMenuObject, XSubMenuObject; - HMENU hMenuChk; - // Windows does this! Wine checks for Atom and uses GetWindowLongPtrW. - hMenuChk = (HMENU)co_IntSendMessage(hwnd, MN_GETHMENU, 0, 0); - - if (!(MenuObject = UserGetMenuObject(hMenuChk))) - { - ERR("Window does not have a Popup Menu!\n"); + case OBJID_CLIENT: + if (!pWnd->pcls->fnid) + RETURN(FALSE); + if (pWnd->pcls->fnid != FNID_MENU) + { + WARN("called on invalid window: %d\n", pWnd->pcls->fnid); EngSetLastError(ERROR_INVALID_MENU_HANDLE); RETURN(FALSE); - } - - SubMenuObject = UserGetMenuObject(MenuObject->MenuItemList->hSubMenu); - if(SubMenuObject) kmbi.hMenu = SubMenuObject->MenuInfo.Self; - else - { - Res = FALSE; - ERR("OBJID_CLIENT, No SubMenu!\n"); - break; - } - if (idItem) - { - if (IntGetMenuItemByFlag(SubMenuObject, idItem-1, MF_BYPOSITION, NULL, &mi, NULL) > -1) - kmbi.rcBar = mi->Rect; - else - { - Res = FALSE; - break; - } - } - else - { - PWND SubWinObj; - if (!(SubWinObj = UserGetWindowObject(SubMenuObject->MenuInfo.Wnd))) - { - Res = FALSE; - break; - } - if (!(IntGetClientOrigin(SubWinObj, &Offset))) - { - Res = FALSE; - break; - } - Rect.left = Offset.x; - Rect.right = Offset.x + SubMenuObject->MenuInfo.Width; - Rect.top = Offset.y; - Rect.bottom = Offset.y + SubMenuObject->MenuInfo.Height; - kmbi.rcBar = Rect; - } - if (idItem) - { - if (idItem-1 == SubMenuObject->MenuInfo.FocusedItem) - kmbi.fFocused = TRUE; - } - if (SubMenuObject->MenuInfo.FocusedItem != NO_SELECTED_ITEM) - kmbi.fBarFocused = TRUE; - XSubMenuObject = UserGetMenuObject(SubMenuObject->MenuItemList->hSubMenu); - if (XSubMenuObject) kmbi.hwndMenu = XSubMenuObject->MenuInfo.Wnd; - TRACE("OBJID_CLIENT, idItem = %d\n",idItem); - break; - } - case OBJID_SYSMENU: - { - PMENU_OBJECT SysMenuObject, SubMenuObject; - if(!(SysMenuObject = IntGetSystemMenu(WindowObject, FALSE, FALSE))) - { - Res = FALSE; - break; - } - kmbi.hMenu = SysMenuObject->MenuInfo.Self; - if (idItem) - { - if (IntGetMenuItemByFlag(SysMenuObject, idItem-1, MF_BYPOSITION, NULL, &mi, NULL) > -1) - kmbi.rcBar = mi->Rect; - else - { - Res = FALSE; - break; - } - } - else - { - PWND SysWinObj; - if (!(SysWinObj = UserGetWindowObject(SysMenuObject->MenuInfo.Wnd))) - { - Res = FALSE; - break; - } - if (!(IntGetClientOrigin(SysWinObj, &Offset))) - { - Res = FALSE; - break; - } - Rect.left = Offset.x; - Rect.right = Offset.x + SysMenuObject->MenuInfo.Width; - Rect.top = Offset.y; - Rect.bottom = Offset.y + SysMenuObject->MenuInfo.Height; - kmbi.rcBar = Rect; - } - if (idItem) - { - if (idItem-1 == SysMenuObject->MenuInfo.FocusedItem) - kmbi.fFocused = TRUE; - } - if (SysMenuObject->MenuInfo.FocusedItem != NO_SELECTED_ITEM) - kmbi.fBarFocused = TRUE; - SubMenuObject = UserGetMenuObject(SysMenuObject->MenuItemList->hSubMenu); - if(SubMenuObject) kmbi.hwndMenu = SubMenuObject->MenuInfo.Wnd; - TRACE("OBJID_SYSMENU, idItem = %d\n",idItem); - break; - } - default: - Res = FALSE; - ERR("Unknown idObject = %d, idItem = %d\n",idObject,idItem); + } + // Windows does this! Wine checks for Atom and uses GetWindowLongPtrW. + hMenu = (HMENU)co_IntSendMessage(hwnd, MN_GETHMENU, 0, 0); + break; + case OBJID_MENU: + hMenu = UlongToHandle(pWnd->IDMenu); + break; + case OBJID_SYSMENU: + if (!(pWnd->style & WS_SYSMENU)) RETURN(FALSE); + Menu = IntGetSystemMenu(pWnd, FALSE, FALSE); + hMenu = Menu->MenuInfo.Self; + break; + default: + RETURN(FALSE); } - if (Res) - { - NTSTATUS Status = MmCopyToCaller(pmbi, &kmbi, sizeof(MENUBARINFO)); - if (! NT_SUCCESS(Status)) - { - SetLastNtError(Status); - RETURN(FALSE); - } - } - RETURN(Res); + + if (!hMenu) + RETURN(FALSE); + + _SEH2_TRY + { + kmbi.cbSize = pmbi->cbSize; + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + kmbi.cbSize = 0; + } + _SEH2_END + + if (kmbi.cbSize != sizeof(MENUBARINFO)) + { + EngSetLastError(ERROR_INVALID_PARAMETER); + RETURN(FALSE); + } + + if (!Menu) Menu = UserGetMenuObject(hMenu); + if (!Menu) + RETURN(FALSE); + + if (idItem < 0 || idItem > Menu->MenuInfo.MenuItemCount) + RETURN(FALSE); + + RECTL_vSetEmptyRect(&kmbi.rcBar); + + if (idItem == 0) + { + Ret = IntGetMenuItemRect(pWnd, Menu, -1, &kmbi.rcBar); + kmbi.rcBar.right = kmbi.rcBar.left + Menu->MenuInfo.Width; + kmbi.rcBar.bottom = kmbi.rcBar.top + Menu->MenuInfo.Height; + ERR("idItem 0 %d\n",Ret); + } + else + { + Ret = IntGetMenuItemRect(pWnd, Menu, idItem-1, &kmbi.rcBar); + ERR("idItem X %d\n", Ret); + } + + kmbi.hMenu = hMenu; + kmbi.hwndMenu = NULL; + //kmbi.fBarFocused = top_popup_hmenu == hMenu; + if (idItem) + { + PMENU_OBJECT SubMenuObject; + kmbi.fFocused = Menu->MenuInfo.FocusedItem == idItem-1; + + if ( kmbi.fFocused && Menu->MenuItemList->hSubMenu ) + { + SubMenuObject = UserGetMenuObject(Menu->MenuItemList->hSubMenu); + if (SubMenuObject) kmbi.hwndMenu = SubMenuObject->MenuInfo.Wnd; + } + } +/* else + { + kmbi.fFocused = kmbi.fBarFocused; + } +*/ + _SEH2_TRY + { + RtlCopyMemory(pmbi, &kmbi, sizeof(MENUBARINFO)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END + + if (!NT_SUCCESS(Status)) + { + SetLastNtError(Status); + RETURN(FALSE); + } + + RETURN(TRUE); CLEANUP: TRACE("Leave NtUserGetMenuBarInfo, ret=%i\n",_ret_); @@ -2011,9 +1962,9 @@ NtUserGetMenuItemRect( PWND ReferenceWnd; LONG XMove, YMove; RECTL Rect; - NTSTATUS Status; PMENU_OBJECT Menu; PMENU_ITEM MenuItem; + NTSTATUS Status = STATUS_SUCCESS; DECLARE_RETURN(BOOL); TRACE("Enter NtUserGetMenuItemRect\n"); @@ -2038,7 +1989,7 @@ NtUserGetMenuItemRect( if (!(ReferenceWnd = UserGetWindowObject(hWnd))) RETURN( FALSE); - if(MenuItem->fType & MF_POPUP) + if (Menu->MenuInfo.Flags & MNF_POPUP) { XMove = ReferenceWnd->rcClient.left; YMove = ReferenceWnd->rcClient.top; @@ -2054,13 +2005,22 @@ NtUserGetMenuItemRect( Rect.right += XMove; Rect.bottom += YMove; - Status = MmCopyToCaller(lprcItem, &Rect, sizeof(RECT)); - if (! NT_SUCCESS(Status)) + _SEH2_TRY + { + RtlCopyMemory(lprcItem, &Rect, sizeof(RECTL)); + } + _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) + { + Status = _SEH2_GetExceptionCode(); + } + _SEH2_END + + if (!NT_SUCCESS(Status)) { SetLastNtError(Status); - RETURN( FALSE); + RETURN(FALSE); } - RETURN( TRUE); + RETURN(TRUE); CLEANUP: TRACE("Leave NtUserGetMenuItemRect, ret=%i\n",_ret_); diff --git a/reactos/win32ss/user/user32/windows/menu.c b/reactos/win32ss/user/user32/windows/menu.c index 72750730709..0e3fe4f9f35 100644 --- a/reactos/win32ss/user/user32/windows/menu.c +++ b/reactos/win32ss/user/user32/windows/menu.c @@ -46,10 +46,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(menu); #define IS_MAGIC_BITMAP(id) ((id) && ((INT_PTR)(id) < 12) && ((INT_PTR)(id) >= -1)) #define IS_SYSTEM_MENU(MenuInfo) \ - (0 == ((MenuInfo)->Flags & MF_POPUP) && 0 != ((MenuInfo)->Flags & MF_SYSMENU)) + (0 == ((MenuInfo)->Flags & MNF_POPUP) && 0 != ((MenuInfo)->Flags & MNF_SYSDESKMN)) #define IS_SYSTEM_POPUP(MenuInfo) \ - (0 != ((MenuInfo)->Flags & MF_POPUP) && 0 != ((MenuInfo)->Flags & MF_SYSMENU)) + (0 != ((MenuInfo)->Flags & MNF_POPUP) && 0 != ((MenuInfo)->Flags & MNF_SYSDESKMN)) #define IS_BITMAP_ITEM(flags) (MF_BITMAP == MENU_ITEM_TYPE(flags)) @@ -507,6 +507,7 @@ static UINT FASTCALL MenuFindItemByKey(HWND WndOwner, PROSMENUINFO MenuInfo, PROSMENUITEMINFO Items, ItemInfo; LRESULT MenuChar; UINT i; + WORD Flags = 0; TRACE("\tlooking for '%c' (0x%02x) in [%p]\n", (char) Key, Key, MenuInfo); @@ -546,8 +547,11 @@ static UINT FASTCALL MenuFindItemByKey(HWND WndOwner, PROSMENUINFO MenuInfo, } } + Flags |= MenuInfo->Flags & MNF_POPUP ? MF_POPUP : 0; + Flags |= MenuInfo->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0; + MenuChar = SendMessageW(WndOwner, WM_MENUCHAR, - MAKEWPARAM(Key, MenuInfo->Flags), (LPARAM) MenuInfo->Self); + MAKEWPARAM(Key, Flags), (LPARAM) MenuInfo->Self); if (HIWORD(MenuChar) == MNC_EXECUTE) return LOWORD(MenuChar); if (HIWORD(MenuChar) == MNC_CLOSE) return (UINT)(-2); } @@ -1650,7 +1654,7 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn if (!hmenu || !hmenu->MenuItemCount || !hmenu->Wnd) return; if (hmenu->FocusedItem == wIndex) return; - if (hmenu->Flags & MF_POPUP) hdc = GetDC(hmenu->Wnd); + if (hmenu->Flags & MNF_POPUP) hdc = GetDC(hmenu->Wnd); else hdc = GetDCEx(hmenu->Wnd, 0, DCX_CACHE | DCX_WINDOW); if (!top_popup) { top_popup = hmenu->Wnd; @@ -1671,7 +1675,7 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn MenuSetRosMenuItemInfo(hmenu->Self, hmenu->FocusedItem, &ItemInfo); } MenuDrawMenuItem(hmenu->Wnd, hmenu, hwndOwner, hdc, &ItemInfo, - hmenu->Height, ! (hmenu->Flags & MF_POPUP), + hmenu->Height, !(hmenu->Flags & MNF_POPUP), ODA_SELECT); } @@ -1688,15 +1692,16 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn ItemInfo.fState |= MF_HILITE; MenuSetRosMenuItemInfo(hmenu->Self, hmenu->FocusedItem, &ItemInfo); MenuDrawMenuItem(hmenu->Wnd, hmenu, hwndOwner, hdc, - &ItemInfo, hmenu->Height, ! (hmenu->Flags & MF_POPUP), + &ItemInfo, hmenu->Height, !(hmenu->Flags & MNF_POPUP), ODA_SELECT); } if (sendMenuSelect) { - SendMessageW(hwndOwner, WM_MENUSELECT, - MAKELONG(ItemInfo.fType & MF_POPUP ? wIndex : ItemInfo.wID, - ItemInfo.fType | ItemInfo.fState | MF_MOUSESELECT | - (hmenu->Flags & MF_SYSMENU)), (LPARAM) hmenu->Self); + WPARAM wParam = MAKELONG( ItemInfo.fType & MF_POPUP ? wIndex : ItemInfo.wID, + ItemInfo.fType | ItemInfo.fState | + (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + + SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) hmenu->Self); } } } @@ -1709,11 +1714,10 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn if (MenuGetRosMenuInfo(&TopMenuInfo, topmenu) && MenuGetRosMenuItemInfo(topmenu, pos, &ItemInfo)) { - SendMessageW(hwndOwner, WM_MENUSELECT, - MAKELONG(Pos, ItemInfo.fType | ItemInfo.fState - | MF_MOUSESELECT - | (TopMenuInfo.Flags & MF_SYSMENU)), - (LPARAM) topmenu); + WPARAM wParam = MAKELONG( Pos, ItemInfo.fType | ItemInfo.fState | + (TopMenuInfo.Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + + SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) topmenu); } } } @@ -2341,7 +2345,7 @@ MenuShowSubPopup(HWND WndOwner, PROSMENUINFO MenuInfo, BOOL SelectFirst, UINT Fl /* correct item if modified as a reaction to WM_INITMENUPOPUP message */ if (0 == (ItemInfo.fState & MF_HILITE)) { - if (0 != (MenuInfo->Flags & MF_POPUP)) + if (0 != (MenuInfo->Flags & MNF_POPUP)) { Dc = GetDC(MenuInfo->Wnd); } @@ -2355,7 +2359,7 @@ MenuShowSubPopup(HWND WndOwner, PROSMENUINFO MenuInfo, BOOL SelectFirst, UINT Fl ItemInfo.fState |= MF_HILITE; MenuSetRosMenuItemInfo(MenuInfo->Self, MenuInfo->FocusedItem, &ItemInfo); MenuDrawMenuItem(MenuInfo->Wnd, MenuInfo, WndOwner, Dc, &ItemInfo, MenuInfo->Height, - ! (MenuInfo->Flags & MF_POPUP), ODA_DRAWENTIRE); + ! (MenuInfo->Flags & MNF_POPUP), ODA_DRAWENTIRE); ReleaseDC(MenuInfo->Wnd, Dc); } @@ -2382,7 +2386,7 @@ MenuShowSubPopup(HWND WndOwner, PROSMENUINFO MenuInfo, BOOL SelectFirst, UINT Fl else { GetWindowRect(MenuInfo->Wnd, &Rect); - if (0 != (MenuInfo->Flags & MF_POPUP)) + if (0 != (MenuInfo->Flags & MNF_POPUP)) { Rect.left += ItemInfo.Rect.right - GetSystemMetrics(SM_CXBORDER); Rect.top += ItemInfo.Rect.top - 3; @@ -2485,7 +2489,7 @@ MenuSwitchTracking(MTRACKER* Mt, PROSMENUINFO PtMenuInfo, UINT Index, UINT wFlag if (MenuGetRosMenuInfo(&TopMenuInfo, Mt->TopMenu) && Mt->TopMenu != PtMenuInfo->Self && - 0 == ((PtMenuInfo->Flags | TopMenuInfo.Flags) & MF_POPUP)) + 0 == ((PtMenuInfo->Flags | TopMenuInfo.Flags) & MNF_POPUP)) { /* both are top level menus (system and menu-bar) */ MenuHideSubPopups(Mt->OwnerWnd, &TopMenuInfo, FALSE, wFlags); @@ -2541,17 +2545,20 @@ MenuExecFocusedItem(MTRACKER *Mt, PROSMENUINFO MenuInfo, UINT Flags) do not send a message to the owner */ if (0 == (Flags & TPM_RETURNCMD)) { - if (0 != (MenuInfo->Flags & MF_SYSMENU)) + if (0 != (MenuInfo->Flags & MNF_SYSDESKMN)) { PostMessageW(Mt->OwnerWnd, WM_SYSCOMMAND, ItemInfo.wID, MAKELPARAM((SHORT) Mt->Pt.x, (SHORT) Mt->Pt.y)); } else { - if (MenuInfo->dwStyle & MNS_NOTIFYBYPOS) - PostMessageW(Mt->OwnerWnd, WM_MENUCOMMAND, - MenuInfo->FocusedItem, - (LPARAM)MenuInfo->Self); + BOOL ret; + ROSMENUINFO topmenuI; + ret = MenuGetRosMenuInfo(&topmenuI, Mt->TopMenu); + DWORD dwStyle = MenuInfo->dwStyle | (ret ? topmenuI.dwStyle : 0); + + if (dwStyle & MNS_NOTIFYBYPOS) + PostMessageW(Mt->OwnerWnd, WM_MENUCOMMAND, MenuInfo->FocusedItem, (LPARAM)MenuInfo->Self); else PostMessageW(Mt->OwnerWnd, WM_COMMAND, ItemInfo.wID, 0); } @@ -2727,7 +2734,7 @@ MenuPtMenu(HMENU Menu, POINT Pt) /* check the current window (avoiding WM_HITTEST) */ Ht = DefWndNCHitTest(MenuInfo.Wnd, Pt); - if (0 != (MenuInfo.Flags & MF_POPUP)) + if (0 != (MenuInfo.Flags & MNF_POPUP)) { if (HTNOWHERE != Ht && HTERROR != Ht) { @@ -3013,7 +3020,7 @@ MenuKeyEscape(MTRACKER *Mt, UINT Flags) if (Mt->CurrentMenu != Mt->TopMenu) { if (MenuGetRosMenuInfo(&MenuInfo, Mt->CurrentMenu) - && 0 != (MenuInfo.Flags & MF_POPUP)) + && 0 != (MenuInfo.Flags & MNF_POPUP)) { MenuPrev = MenuTmp = Mt->TopMenu; @@ -3085,7 +3092,7 @@ MenuKeyLeft(MTRACKER* Mt, UINT Flags) { return; } - if ((MenuPrev == Mt->TopMenu) && !(TopMenuInfo.Flags & MF_POPUP)) + if ((MenuPrev == Mt->TopMenu) && !(TopMenuInfo.Flags & MNF_POPUP)) { /* move menu bar selection if no more popups are left */ @@ -3125,7 +3132,7 @@ static void FASTCALL MenuKeyRight(MTRACKER *Mt, UINT Flags) Mt->CurrentMenu, Mt->TopMenu); if (! MenuGetRosMenuInfo(&MenuInfo, Mt->TopMenu)) return; - if ((MenuInfo.Flags & MF_POPUP) || (Mt->CurrentMenu != Mt->TopMenu)) + if ((MenuInfo.Flags & MNF_POPUP) || (Mt->CurrentMenu != Mt->TopMenu)) { /* If already displaying a popup, try to display sub-popup */ @@ -3155,7 +3162,7 @@ static void FASTCALL MenuKeyRight(MTRACKER *Mt, UINT Flags) return; } - if (!(MenuInfo.Flags & MF_POPUP)) /* menu bar tracking */ + if (!(MenuInfo.Flags & MNF_POPUP)) /* menu bar tracking */ { if (Mt->CurrentMenu != Mt->TopMenu) { @@ -3266,7 +3273,7 @@ static INT FASTCALL MenuTrackMenu(HMENU hmenu, UINT wFlags, INT x, INT y, } if (!enterIdleSent) { - HWND win = MenuInfo.Flags & MF_POPUP ? MenuInfo.Wnd : NULL; + HWND win = MenuInfo.Flags & MNF_POPUP ? MenuInfo.Wnd : NULL; enterIdleSent = TRUE; SendMessageW( mt.OwnerWnd, WM_ENTERIDLE, MSGF_MENU, (LPARAM) win); } @@ -3385,7 +3392,7 @@ static INT FASTCALL MenuTrackMenu(HMENU hmenu, UINT wFlags, INT x, INT y, case VK_DOWN: /* If on menu bar, pull-down the menu */ if (MenuGetRosMenuInfo(&MenuInfo, mt.CurrentMenu)) { - if (!(MenuInfo.Flags & MF_POPUP)) + if (!(MenuInfo.Flags & MNF_POPUP)) { if (MenuGetRosMenuInfo(&MenuInfo, mt.TopMenu)) mt.CurrentMenu = MenuShowSubPopup(mt.OwnerWnd, &MenuInfo, TRUE, wFlags); @@ -3508,16 +3515,15 @@ static INT FASTCALL MenuTrackMenu(HMENU hmenu, UINT wFlags, INT x, INT y, { MenuHideSubPopups(mt.OwnerWnd, &MenuInfo, FALSE, wFlags); - if (MenuInfo.Flags & MF_POPUP) + if (MenuInfo.Flags & MNF_POPUP) { IntNotifyWinEvent(EVENT_SYSTEM_MENUPOPUPEND, MenuInfo.Wnd, OBJID_CLIENT, CHILDID_SELF, 0); DestroyWindow(MenuInfo.Wnd); MenuInfo.Wnd = NULL; - if (!(MenuInfo.Flags & TPM_NONOTIFY)) + if (!(wFlags & TPM_NONOTIFY)) SendMessageW( mt.OwnerWnd, WM_UNINITMENUPOPUP, (WPARAM)mt.TopMenu, MAKELPARAM(0, IS_SYSTEM_MENU(&MenuInfo)) ); - } MenuSelectItem( mt.OwnerWnd, &MenuInfo, NO_SELECTED_ITEM, FALSE, 0 ); } @@ -3585,7 +3591,7 @@ static BOOL FASTCALL MenuInitTracking(HWND hWnd, HMENU hMenu, BOOL bPopup, UINT IntNotifyWinEvent( EVENT_SYSTEM_MENUSTART, hWnd, - MenuInfo.Flags & MF_SYSMENU ? OBJID_SYSMENU : OBJID_MENU, + MenuInfo.Flags & MNF_SYSDESKMN ? OBJID_SYSMENU : OBJID_MENU, CHILDID_SELF, 0); return TRUE; } From 13bd05110c2eb3125b301e7d042ee5346058ba25 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 18 Mar 2014 02:56:48 +0000 Subject: [PATCH 126/419] [Win32k] - Fix more menu tests, missed flags and fix MIM_APPLYTOSUBMENUS. svn path=/trunk/; revision=62527 --- reactos/win32ss/user/ntuser/menu.c | 12 +++++++++++- reactos/win32ss/user/ntuser/window.c | 11 ++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/reactos/win32ss/user/ntuser/menu.c b/reactos/win32ss/user/ntuser/menu.c index e387aa7018c..f87a14df836 100644 --- a/reactos/win32ss/user/ntuser/menu.c +++ b/reactos/win32ss/user/ntuser/menu.c @@ -454,7 +454,17 @@ IntSetMenuInfo(PMENU_OBJECT Menu, PROSMENUINFO lpmi) Menu->MenuInfo.dwStyle = lpmi->dwStyle; if(lpmi->fMask & MIM_APPLYTOSUBMENUS) { - /* FIXME */ + int i; + PMENU_ITEM item = Menu->MenuItemList; + for ( i = Menu->MenuInfo.MenuItemCount; i; i--, item = item->Next) + { + if ( item->fType & MF_POPUP ) // item->hSubMenu ) + { + PMENU_OBJECT SubMenu; + if (!(SubMenu = UserGetMenuObject(item->hSubMenu))) continue; + IntSetMenuInfo( SubMenu, lpmi); + } + } } if (sizeof(MENUINFO) < lpmi->cbSize) { diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index 11915109217..fa6c7aefeb2 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -931,7 +931,7 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu) if(NewMenu) { Window->SystemMenu = NewMenu->MenuInfo.Self; - NewMenu->MenuInfo.Flags |= MF_SYSMENU; + NewMenu->MenuInfo.Flags |= MNF_SYSDESKMN; NewMenu->MenuInfo.Wnd = Window->head.h; ret = NewMenu; //IntReleaseMenuObject(NewMenu); @@ -950,7 +950,7 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu) UserDestroyMenu(hSysMenu); return NULL; } - SysMenu->MenuInfo.Flags |= MF_SYSMENU; + SysMenu->MenuInfo.Flags |= MNF_SYSDESKMN; SysMenu->MenuInfo.Wnd = Window->head.h; hNewMenu = co_IntLoadSysMenuTemplate(); if(!hNewMenu) @@ -970,7 +970,8 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu) NewMenu = IntCloneMenu(Menu); if(NewMenu) { - NewMenu->MenuInfo.Flags |= MF_SYSMENU | MF_POPUP; + NewMenu->MenuInfo.Flags |= MNF_SYSDESKMN | MNF_POPUP; + NewMenu->MenuInfo.dwStyle = MNS_CHECKORBMP; IntReleaseMenuObject(NewMenu); UserSetMenuDefaultItem(NewMenu, SC_CLOSE, FALSE); @@ -1426,7 +1427,7 @@ IntSetSystemMenu(PWND Window, PMENU_OBJECT Menu) OldMenu = IntGetMenuObject(Window->SystemMenu); if(OldMenu) { - OldMenu->MenuInfo.Flags &= ~ MF_SYSMENU; + OldMenu->MenuInfo.Flags &= ~ MNF_SYSDESKMN; IntReleaseMenuObject(OldMenu); } } @@ -1435,7 +1436,7 @@ IntSetSystemMenu(PWND Window, PMENU_OBJECT Menu) { /* FIXME: Check window style, propably return FALSE? */ Window->SystemMenu = Menu->MenuInfo.Self; - Menu->MenuInfo.Flags |= MF_SYSMENU; + Menu->MenuInfo.Flags |= MNF_SYSDESKMN; } else Window->SystemMenu = (HMENU)0; From 6e6984882a6e4adfbf0e079fde8783761562d14c Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 18 Mar 2014 04:11:30 +0000 Subject: [PATCH 127/419] [User32] - Patch by Victor Martinez Calvo : Several menu.c fixes. See CORE-7967. - Sync port from wine with modifications svn path=/trunk/; revision=62528 --- reactos/win32ss/user/user32/windows/menu.c | 150 ++++++++++----------- 1 file changed, 71 insertions(+), 79 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/menu.c b/reactos/win32ss/user/user32/windows/menu.c index 0e3fe4f9f35..cc36e5b5b26 100644 --- a/reactos/win32ss/user/user32/windows/menu.c +++ b/reactos/win32ss/user/user32/windows/menu.c @@ -36,6 +36,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(menu); #define TPM_BUTTONDOWN 0x40000000 /* menu was clicked before tracking */ #define TPM_POPUPMENU 0x20000000 /* menu is a popup menu */ +/* top and bottom margins for popup menus */ +#define MENU_TOP_MARGIN 3 +#define MENU_BOTTOM_MARGIN 2 #define MENU_TYPE_MASK (MF_STRING | MF_BITMAP | MF_OWNERDRAW | MF_SEPARATOR) @@ -1303,7 +1306,7 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd HBITMAP bm; INT y = rect.top + rect.bottom; RECT rc = rect; - int checked = FALSE; + BOOL checked = FALSE; UINT check_bitmap_width = GetSystemMetrics( SM_CXMENUCHECK ); UINT check_bitmap_height = GetSystemMetrics( SM_CYMENUCHECK ); /* Draw the check mark @@ -1551,6 +1554,7 @@ static BOOL FASTCALL MenuShowPopup(HWND hwndOwner, HMENU hmenu, UINT id, UINT fl POINT pt; HMONITOR monitor; MONITORINFO info; + DWORD ex_style = 0; TRACE("owner=%p hmenu=%p id=0x%04x x=0x%04x y=0x%04x xa=0x%04x ya=0x%04x\n", hwndOwner, hmenu, id, x, y, xanchor, yanchor); @@ -1592,6 +1596,11 @@ static BOOL FASTCALL MenuShowPopup(HWND hwndOwner, HMENU hmenu, UINT id, UINT fl info.cbSize = sizeof(info); GetMonitorInfoW( monitor, &info ); + if (flags & TPM_LAYOUTRTL) + { + ex_style = WS_EX_LAYOUTRTL; + flags ^= TPM_RIGHTALIGN; + } if( flags & TPM_RIGHTALIGN ) x -= width; if( flags & TPM_CENTERALIGN ) x -= width / 2; @@ -1619,7 +1628,7 @@ static BOOL FASTCALL MenuShowPopup(HWND hwndOwner, HMENU hmenu, UINT id, UINT fl if( y < info.rcMonitor.top ) y = info.rcMonitor.top; /* NOTE: In Windows, top menu popup is not owned. */ - MenuInfo.Wnd = CreateWindowExW( 0, WC_MENU, NULL, + MenuInfo.Wnd = CreateWindowExW( ex_style, WC_MENU, NULL, WS_POPUP, x, y, width, height, hwndOwner, 0, (HINSTANCE) GetWindowLongPtrW(hwndOwner, GWLP_HINSTANCE), (LPVOID) MenuInfo.Self); @@ -1697,9 +1706,9 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn } if (sendMenuSelect) { - WPARAM wParam = MAKELONG( ItemInfo.fType & MF_POPUP ? wIndex : ItemInfo.wID, - ItemInfo.fType | ItemInfo.fState | - (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + WPARAM wParam = MAKEWPARAM( ItemInfo.fType & MF_POPUP ? wIndex : ItemInfo.wID, + ItemInfo.fType | ItemInfo.fState | + (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) hmenu->Self); } @@ -1714,8 +1723,8 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn if (MenuGetRosMenuInfo(&TopMenuInfo, topmenu) && MenuGetRosMenuItemInfo(topmenu, pos, &ItemInfo)) { - WPARAM wParam = MAKELONG( Pos, ItemInfo.fType | ItemInfo.fState | - (TopMenuInfo.Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + WPARAM wParam = MAKEWPARAM( Pos, ItemInfo.fType | ItemInfo.fState | + (TopMenuInfo.Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) topmenu); } @@ -1999,11 +2008,11 @@ PopupMenuWndProcW(HWND Wnd, UINT Message, WPARAM wParam, LPARAM lParam) * * NOTE: flags is equivalent to the mtOption field */ -static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL unicode ) +static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu) { WORD flags, id = 0; HMENU hSubMenu; - LPCSTR str; + LPCWSTR str; BOOL end = FALSE; do @@ -2020,46 +2029,19 @@ static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL unicode ) id = GET_WORD(res); res += sizeof(WORD); } - str = res; - if(!unicode) - res += strlen(str) + 1; - else - res += (strlenW((LPCWSTR)str) + 1) * sizeof(WCHAR); + str = (LPCWSTR)res; + res += (strlenW(str) + 1) * sizeof(WCHAR); + if (flags & MF_POPUP) { hSubMenu = CreatePopupMenu(); if(!hSubMenu) return NULL; - if(!(res = MENU_ParseResource(res, hSubMenu, unicode))) - return NULL; - if(!unicode) - AppendMenuA(hMenu, flags, (UINT)hSubMenu, str); - else - AppendMenuW(hMenu, flags, (UINT)hSubMenu, (LPCWSTR)str); + if(!(res = MENU_ParseResource(res, hSubMenu))) return NULL; + AppendMenuW(hMenu, flags, (UINT_PTR)hSubMenu, (LPCWSTR)str); } else /* Not a popup */ { - if(!unicode) - { - if (*str == 0) - flags = MF_SEPARATOR; - } - else - { - if (*(LPCWSTR)str == 0) - flags = MF_SEPARATOR; - } - - if (flags & MF_SEPARATOR) - { - if (!(flags & (MF_GRAYED | MF_DISABLED))) - flags |= MF_GRAYED | MF_DISABLED; - } - - if(!unicode) - AppendMenuA(hMenu, flags, id, *str ? str : NULL); - else - AppendMenuW(hMenu, flags, id, - *(LPCWSTR)str ? (LPCWSTR)str : NULL); + AppendMenuW(hMenu, flags, id, *(LPCWSTR)str ? (LPCWSTR)str : NULL); } } while(!end); return res; @@ -2075,10 +2057,10 @@ static LPCSTR MENU_ParseResource( LPCSTR res, HMENU hMenu, BOOL unicode ) static LPCSTR MENUEX_ParseResource(LPCSTR res, HMENU hMenu) { WORD resinfo; - MENUITEMINFOW mii; - do { + MENUITEMINFOW mii; + mii.cbSize = sizeof(mii); mii.fMask = MIIM_STATE | MIIM_ID | MIIM_TYPE; mii.fType = GET_DWORD(res); @@ -2119,13 +2101,12 @@ static LPCSTR MENUEX_ParseResource(LPCSTR res, HMENU hMenu) } mii.fMask |= MIIM_SUBMENU; mii.fType |= MF_POPUP; - mii.wID = (UINT)mii.hSubMenu; } - else if (!mii.dwTypeData[0]) + else if (!mii.dwTypeData[0] && !(mii.fType & MF_SEPARATOR)) + { mii.fType |= MF_SEPARATOR; - - if (!InsertMenuItemW(hMenu, -1, MF_BYPOSITION, &mii)) - ERR("InsertMenuItemW failed\n"); + } + InsertMenuItemW(hMenu, -1, MF_BYPOSITION, &mii); } while (!(resinfo & MF_END)); return res; } @@ -2332,7 +2313,7 @@ MenuShowSubPopup(HWND WndOwner, PROSMENUINFO MenuInfo, BOOL SelectFirst, UINT Fl if (0 == (Flags & TPM_NONOTIFY)) { SendMessageW(WndOwner, WM_INITMENUPOPUP, (WPARAM) ItemInfo.hSubMenu, - MAKELONG(MenuInfo->FocusedItem, IS_SYSTEM_MENU(MenuInfo))); + MAKELPARAM(MenuInfo->FocusedItem, IS_SYSTEM_MENU(MenuInfo))); } if (! MenuGetRosMenuItemInfo(MenuInfo->Self, MenuInfo->FocusedItem, &ItemInfo)) @@ -2377,38 +2358,47 @@ MenuShowSubPopup(HWND WndOwner, PROSMENUINFO MenuInfo, BOOL SelectFirst, UINT Fl { MenuInitSysMenuPopup(ItemInfo.hSubMenu, GetWindowLongPtrW(MenuInfo->Wnd, GWL_STYLE), GetClassLongPtrW(MenuInfo->Wnd, GCL_STYLE), HTSYSMENU); - + if (Flags & TPM_LAYOUTRTL) Rect.left; NcGetSysPopupPos(MenuInfo->Wnd, &Rect); Rect.top = Rect.bottom; Rect.right = GetSystemMetrics(SM_CXSIZE); Rect.bottom = GetSystemMetrics(SM_CYSIZE); } else - { + { GetWindowRect(MenuInfo->Wnd, &Rect); if (0 != (MenuInfo->Flags & MNF_POPUP)) - { - Rect.left += ItemInfo.Rect.right - GetSystemMetrics(SM_CXBORDER); - Rect.top += ItemInfo.Rect.top - 3; + { + if(Flags & TPM_LAYOUTRTL) + Rect.left += GetSystemMetrics(SM_CXBORDER); + else + Rect.left += ItemInfo.Rect.right- GetSystemMetrics(SM_CXBORDER); + Rect.top += ItemInfo.Rect.top - MENU_TOP_MARGIN;//3; Rect.right = ItemInfo.Rect.left - ItemInfo.Rect.right + GetSystemMetrics(SM_CXBORDER); - Rect.bottom = ItemInfo.Rect.top - ItemInfo.Rect.bottom - 3 - 2 - - GetSystemMetrics(SM_CYBORDER); - } + Rect.bottom = ItemInfo.Rect.top - ItemInfo.Rect.bottom - MENU_TOP_MARGIN - MENU_BOTTOM_MARGIN/*2*/ + - GetSystemMetrics(SM_CYBORDER); + } else - { - Rect.left += ItemInfo.Rect.left; + { + if(Flags & TPM_LAYOUTRTL) + Rect.left += Rect.right - ItemInfo.Rect.left; + else + Rect.left += ItemInfo.Rect.left; Rect.top += ItemInfo.Rect.bottom; Rect.right = ItemInfo.Rect.right - ItemInfo.Rect.left; Rect.bottom = ItemInfo.Rect.bottom - ItemInfo.Rect.top; - } - } + } + } + + /* use default alignment for submenus */ + Flags &= ~(TPM_CENTERALIGN | TPM_RIGHTALIGN | TPM_VCENTERALIGN | TPM_BOTTOMALIGN); MenuShowPopup(WndOwner, ItemInfo.hSubMenu, MenuInfo->FocusedItem, Flags, Rect.left, Rect.top, Rect.right, Rect.bottom ); if (SelectFirst && MenuGetRosMenuInfo(&SubMenuInfo, ItemInfo.hSubMenu)) - { + { MenuMoveSelection(WndOwner, &SubMenuInfo, ITEM_NEXT); - } + } Ret = ItemInfo.hSubMenu; MenuCleanupRosMenuItemInfo(&ItemInfo); @@ -2985,20 +2975,20 @@ MenuSuspendPopup(MTRACKER* Mt, UINT uMsg) switch( uMsg ) { - case WM_KEYDOWN: - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); - if( msg.message == WM_KEYUP || msg.message == WM_PAINT ) - { - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_REMOVE); - PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); - if( msg.message == WM_KEYDOWN && - (msg.wParam == VK_LEFT || msg.wParam == VK_RIGHT)) - { - Mt->TrackFlags |= TF_SUSPENDPOPUP; - return TRUE; - } - } - break; + case WM_KEYDOWN: + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); + if( msg.message == WM_KEYUP || msg.message == WM_PAINT ) + { + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_REMOVE); + PeekMessageW( &msg, 0, 0, 0, PM_NOYIELD | PM_NOREMOVE); + if( msg.message == WM_KEYDOWN && + (msg.wParam == VK_LEFT || msg.wParam == VK_RIGHT)) + { + Mt->TrackFlags |= TF_SUSPENDPOPUP; + return TRUE; + } + } + break; } /* failures go through this */ Mt->TrackFlags &= ~TF_SUSPENDPOPUP; @@ -3622,6 +3612,7 @@ VOID MenuTrackMouseMenuBar( HWND hWnd, ULONG ht, POINT pt) TRACE("wnd=%p ht=0x%04x (%ld,%ld)\n", hWnd, ht, pt.x, pt.y); + if (GetWindowLongW( hWnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) wFlags |= TPM_LAYOUTRTL; if (IsMenu(hMenu)) { /* map point to parent client coordinates */ @@ -3723,6 +3714,7 @@ BOOL WINAPI TrackPopupMenuEx( HMENU Menu, UINT Flags, int x, int y, /* ReactOS Check */ if (!ValidateHwnd(Wnd)) { + /* invalid window see wine menu.c test_menu_trackpopupmenu line 3146 */ return FALSE; } @@ -4823,7 +4815,7 @@ LoadMenuIndirectW(CONST MENUTEMPLATE *lpMenuTemplate) offset = GET_WORD(p); p += sizeof(WORD) + offset; if (!(hMenu = CreateMenu())) return 0; - if (!MENU_ParseResource(p, hMenu, TRUE)) + if (!MENU_ParseResource(p, hMenu)) { DestroyMenu(hMenu); return 0; From ac462053759808110b5d102f7d8de0d366b89060 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 18 Mar 2014 13:45:38 +0000 Subject: [PATCH 128/419] [Win32k] - Patch by David Quintana : Menu info fType and wID have wrong values if the menu has a submenu. See CORE-7966. svn path=/trunk/; revision=62529 --- reactos/win32ss/user/ntuser/menu.c | 17 +++------- reactos/win32ss/user/ntuser/window.c | 2 +- reactos/win32ss/user/user32/windows/menu.c | 38 ++++++++++++---------- 3 files changed, 25 insertions(+), 32 deletions(-) diff --git a/reactos/win32ss/user/ntuser/menu.c b/reactos/win32ss/user/ntuser/menu.c index f87a14df836..3ca411e65ba 100644 --- a/reactos/win32ss/user/ntuser/menu.c +++ b/reactos/win32ss/user/ntuser/menu.c @@ -458,7 +458,7 @@ IntSetMenuInfo(PMENU_OBJECT Menu, PROSMENUINFO lpmi) PMENU_ITEM item = Menu->MenuItemList; for ( i = Menu->MenuInfo.MenuItemCount; i; i--, item = item->Next) { - if ( item->fType & MF_POPUP ) // item->hSubMenu ) + if ( item->hSubMenu ) { PMENU_OBJECT SubMenu; if (!(SubMenu = UserGetMenuObject(item->hSubMenu))) continue; @@ -539,7 +539,7 @@ IntGetMenuItemByFlag(PMENU_OBJECT Menu, UINT uSearchBy, UINT fFlag, } else { - if(CurItem->fType & MF_POPUP) + if(CurItem->hSubMenu) { PMENU_OBJECT NewMenu = UserGetMenuObject(CurItem->hSubMenu); if(NewMenu) @@ -664,7 +664,7 @@ BOOL FASTCALL IntSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINFO lpmii) { PMENU_OBJECT SubMenuObject; - UINT fTypeMask = (MFT_BITMAP | MFT_MENUBARBREAK | MFT_MENUBREAK | MFT_OWNERDRAW | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_SEPARATOR | MF_POPUP); + UINT fTypeMask = (MFT_BITMAP | MFT_MENUBARBREAK | MFT_MENUBREAK | MFT_OWNERDRAW | MFT_RADIOCHECK | MFT_RIGHTJUSTIFY | MFT_SEPARATOR); if(!MenuItem || !MenuObject || !lpmii) { @@ -752,16 +752,7 @@ IntSetMenuItemInfo(PMENU_OBJECT MenuObject, PMENU_ITEM MenuItem, PROSMENUITEMINF if (SubMenuObject != NULL) { SubMenuObject->MenuInfo.Flags |= MNF_POPUP; - MenuItem->fType |= MF_POPUP; } - else - { - MenuItem->fType &= ~MF_POPUP; - } - } - else - { - MenuItem->fType &= ~MF_POPUP; } } @@ -1479,7 +1470,7 @@ UINT FASTCALL IntFindSubMenu(HMENU *hMenu, HMENU hSubTarget ) return NO_SELECTED_ITEM; } - if (!(mi->fType & MF_POPUP)) continue; + if (!(mi->hSubMenu)) continue; if (mi->hSubMenu == hSubTarget) { diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index fa6c7aefeb2..9d6e4717697 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -977,7 +977,7 @@ IntGetSystemMenu(PWND Window, BOOL bRevert, BOOL RetMenu) ItemInfo.cbSize = sizeof(MENUITEMINFOW); ItemInfo.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_STATE | MIIM_SUBMENU; - ItemInfo.fType = MF_POPUP; + ItemInfo.fType = 0; ItemInfo.fState = MFS_ENABLED; ItemInfo.dwTypeData = NULL; ItemInfo.cch = 0; diff --git a/reactos/win32ss/user/user32/windows/menu.c b/reactos/win32ss/user/user32/windows/menu.c index cc36e5b5b26..d51492201c3 100644 --- a/reactos/win32ss/user/user32/windows/menu.c +++ b/reactos/win32ss/user/user32/windows/menu.c @@ -399,7 +399,7 @@ static UINT FASTCALL MenuFindSubMenu(HMENU *hmenu, HMENU hSubTarget ) MenuCleanupRosMenuItemInfo(&item); return NO_SELECTED_ITEM; } - if (!(item.fType & MF_POPUP)) continue; + if (!(item.hSubMenu)) continue; if (item.hSubMenu == hSubTarget) { MenuCleanupRosMenuItemInfo(&item); return i; @@ -1214,7 +1214,7 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd dis.rcItem.bottom); SendMessageW(WndOwner, WM_DRAWITEM, 0, (LPARAM) &dis); /* Draw the popup-menu arrow */ - if (lpitem->fType & MF_POPUP) + if (lpitem->hSubMenu) { RECT rectTemp; CopyRect(&rectTemp, &rect); @@ -1352,7 +1352,7 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd } } /* Draw the popup-menu arrow */ - if (lpitem->fType & MF_POPUP) + if (lpitem->hSubMenu) { RECT rectTemp; CopyRect(&rectTemp, &rect); @@ -1706,16 +1706,19 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn } if (sendMenuSelect) { - WPARAM wParam = MAKEWPARAM( ItemInfo.fType & MF_POPUP ? wIndex : ItemInfo.wID, + WPARAM wParam = MAKEWPARAM( ItemInfo.hSubMenu ? wIndex : ItemInfo.wID, ItemInfo.fType | ItemInfo.fState | - (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); + (ItemInfo.hSubMenu ? MF_POPUP : 0) | + (hmenu->Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) hmenu->Self); } } } - else if (sendMenuSelect) { - if(topmenu) { + else if (sendMenuSelect) + { + if(topmenu) + { int pos; pos = MenuFindSubMenu(&topmenu, hmenu->Self); if (pos != NO_SELECTED_ITEM) @@ -1724,6 +1727,7 @@ static void FASTCALL MenuSelectItem(HWND hwndOwner, PROSMENUINFO hmenu, UINT wIn && MenuGetRosMenuItemInfo(topmenu, pos, &ItemInfo)) { WPARAM wParam = MAKEWPARAM( Pos, ItemInfo.fType | ItemInfo.fState | + (ItemInfo.hSubMenu ? MF_POPUP : 0) | (TopMenuInfo.Flags & MNF_SYSDESKMN ? MF_SYSMENU : 0 ) ); SendMessageW(hwndOwner, WM_MENUSELECT, wParam, (LPARAM) topmenu); @@ -2100,7 +2104,6 @@ static LPCSTR MENUEX_ParseResource(LPCSTR res, HMENU hMenu) return NULL; } mii.fMask |= MIIM_SUBMENU; - mii.fType |= MF_POPUP; } else if (!mii.dwTypeData[0] && !(mii.fType & MF_SEPARATOR)) { @@ -2300,7 +2303,7 @@ MenuShowSubPopup(HWND WndOwner, PROSMENUINFO MenuInfo, BOOL SelectFirst, UINT Fl MenuCleanupRosMenuItemInfo(&ItemInfo); return MenuInfo->Self; } - if (0 == (ItemInfo.fType & MF_POPUP) || 0 != (ItemInfo.fState & (MF_GRAYED | MF_DISABLED))) + if (0 == (ItemInfo.hSubMenu) || 0 != (ItemInfo.fState & (MF_GRAYED | MF_DISABLED))) { MenuCleanupRosMenuItemInfo(&ItemInfo); return MenuInfo->Self; @@ -2441,7 +2444,7 @@ MenuHideSubPopups(HWND WndOwner, PROSMENUINFO MenuInfo, MenuInitRosMenuItemInfo(&ItemInfo); ItemInfo.fMask |= MIIM_FTYPE | MIIM_STATE; if (! MenuGetRosMenuItemInfo(MenuInfo->Self, MenuInfo->FocusedItem, &ItemInfo) - || 0 == (ItemInfo.fType & MF_POPUP) + || 0 == (ItemInfo.hSubMenu) || 0 == (ItemInfo.fState & MF_MOUSESELECT)) { MenuCleanupRosMenuItemInfo(&ItemInfo); @@ -2526,7 +2529,7 @@ MenuExecFocusedItem(MTRACKER *Mt, PROSMENUINFO MenuInfo, UINT Flags) TRACE("%p %08x %p\n", MenuInfo, ItemInfo.wID, ItemInfo.hSubMenu); - if (0 == (ItemInfo.fType & MF_POPUP)) + if (0 == (ItemInfo.hSubMenu)) { if (0 == (ItemInfo.fState & (MF_GRAYED | MF_DISABLED)) && 0 == (ItemInfo.fType & MF_SEPARATOR)) @@ -2660,7 +2663,7 @@ MenuButtonUp(MTRACKER *Mt, HMENU PtMenu, UINT Flags) if (0 <= Id && MenuGetRosMenuItemInfo(MenuInfo.Self, Id, &ItemInfo) && MenuInfo.FocusedItem == Id) { - if (0 == (ItemInfo.fType & MF_POPUP)) + if (0 == (ItemInfo.hSubMenu)) { INT ExecutedMenuId = MenuExecFocusedItem(Mt, &MenuInfo, Flags); MenuCleanupRosMenuItemInfo(&ItemInfo); @@ -2709,7 +2712,7 @@ MenuPtMenu(HMENU Menu, POINT Pt) { MenuInitRosMenuItemInfo(&ItemInfo); if (MenuGetRosMenuItemInfo(MenuInfo.Self, MenuInfo.FocusedItem, &ItemInfo) && - 0 != (ItemInfo.fType & MF_POPUP) && + 0 != (ItemInfo.hSubMenu) && 0 != (ItemInfo.fState & MF_MOUSESELECT)) { Ret = MenuPtMenu(ItemInfo.hSubMenu, Pt); @@ -2823,7 +2826,7 @@ MenuGetSubPopup(HMENU Menu) MenuCleanupRosMenuItemInfo(&ItemInfo); return NULL; } - if (0 != (ItemInfo.fType & MF_POPUP) && 0 != (ItemInfo.fState & MF_MOUSESELECT)) + if (0 != (ItemInfo.hSubMenu) && 0 != (ItemInfo.fState & MF_MOUSESELECT)) { MenuCleanupRosMenuItemInfo(&ItemInfo); return ItemInfo.hSubMenu; @@ -3883,7 +3886,6 @@ MenuSetItemData( if(Flags & MF_POPUP) { - mii->fType |= MF_POPUP; mii->fMask |= MIIM_SUBMENU; mii->hSubMenu = (HMENU)IDNewItem; } @@ -3993,7 +3995,7 @@ MenuCheckMenuRadioItem(HMENU hMenu, UINT idFirst, UINT idLast, UINT idCheck, UIN if (0 != (Items[i].fType & MF_MENUBARBREAK)) continue; if (0 != (Items[i].fType & MF_SEPARATOR)) continue; - if ((Items[i].fType & MF_POPUP) && (uFlags == MF_BYCOMMAND)) + if ((Items[i].hSubMenu) && (uFlags == MF_BYCOMMAND)) { MenuCheckMenuRadioItem(Items[i].hSubMenu, idFirst, idLast, idCheck, uFlags, bCheck, pChecked, pUnchecked, pMenuChanged); continue; @@ -4897,7 +4899,7 @@ ModifyMenuA( if(!MenuGetRosMenuItemInfo( hMnu, uPosition, &rmii)) return FALSE; - if ((rmii.fType & MF_POPUP) && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) + if (rmii.hSubMenu && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) NtUserDestroyMenu( rmii.hSubMenu ); /* ModifyMenu() spec */ MenuCleanupRosMenuItemInfo( &rmii ); @@ -4944,7 +4946,7 @@ ModifyMenuW( if(!MenuGetRosMenuItemInfo( hMnu, uPosition, &rmii)) return FALSE; - if ((rmii.fType & MF_POPUP) && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) + if (rmii.hSubMenu && (uFlags & MF_POPUP) && (rmii.hSubMenu != (HMENU)uIDNewItem)) NtUserDestroyMenu( rmii.hSubMenu ); /* ModifyMenu() spec */ MenuCleanupRosMenuItemInfo( &rmii ); From 7860a3e0973c2e46e52c2ed4392b1871490e0c17 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 18 Mar 2014 21:54:59 +0000 Subject: [PATCH 129/419] [NtUser|User32] - Fix HiliteMenuItem tests, see CORE-7967. svn path=/trunk/; revision=62533 --- reactos/win32ss/user/ntuser/menu.c | 31 ++++++++++++---------- reactos/win32ss/user/user32/user32.spec | 2 +- reactos/win32ss/user/user32/windows/menu.c | 15 +++++------ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/reactos/win32ss/user/ntuser/menu.c b/reactos/win32ss/user/ntuser/menu.c index 3ca411e65ba..b22f62926ee 100644 --- a/reactos/win32ss/user/ntuser/menu.c +++ b/reactos/win32ss/user/ntuser/menu.c @@ -485,8 +485,11 @@ IntSetMenuInfo(PMENU_OBJECT Menu, PROSMENUINFO lpmi) int FASTCALL -IntGetMenuItemByFlag(PMENU_OBJECT Menu, UINT uSearchBy, UINT fFlag, - PMENU_OBJECT *SubMenu, PMENU_ITEM *MenuItem, +IntGetMenuItemByFlag(PMENU_OBJECT Menu, + UINT uSearchBy, + UINT fFlag, + PMENU_OBJECT *SubMenu, + PMENU_ITEM *MenuItem, PMENU_ITEM *PrevMenuItem) { PMENU_ITEM PrevItem = NULL; @@ -1039,17 +1042,22 @@ IntCheckMenuItem(PMENU_OBJECT MenuObject, UINT uIDCheckItem, UINT uCheck) } BOOL FASTCALL -IntHiliteMenuItem(PWND WindowObject, PMENU_OBJECT MenuObject, - UINT uItemHilite, UINT uHilite) +IntHiliteMenuItem(PWND WindowObject, + PMENU_OBJECT MenuObject, + UINT uItemHilite, + UINT uHilite) { PMENU_ITEM MenuItem; - BOOL res = IntGetMenuItemByFlag(MenuObject, uItemHilite, uHilite, NULL, &MenuItem, NULL); - if(!MenuItem || !res) + int Pos; + + Pos = IntGetMenuItemByFlag(MenuObject, uItemHilite, uHilite, NULL, &MenuItem, NULL); + + if (!MenuItem || (uHilite & MF_BYPOSITION && Pos == -1)) { return FALSE; } - if(uHilite & MF_HILITE) + if (uHilite & MF_HILITE) { MenuItem->fState |= MF_HILITE; } @@ -2058,12 +2066,7 @@ NtUserHiliteMenuItem( RETURN(FALSE); } - if(Window->IDMenu == (UINT)(UINT_PTR)hMenu) - { - RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite)); - } - - RETURN(FALSE); + RETURN( IntHiliteMenuItem(Window, Menu, uItemHilite, uHilite)); CLEANUP: TRACE("Leave NtUserHiliteMenuItem, ret=%u\n",_ret_); @@ -2224,7 +2227,7 @@ UserMenuItemInfo( EngSetLastError(ERROR_INVALID_PARAMETER); // This will crash menu (line 80) correct_behavior test! // "NT4 and below can't handle a bigger MENUITEMINFO struct" - //EngSetLastError(ERROR_MENU_ITEM_NOT_FOUND); +// EngSetLastError(ERROR_MENU_ITEM_NOT_FOUND); return( FALSE); } diff --git a/reactos/win32ss/user/user32/user32.spec b/reactos/win32ss/user/user32/user32.spec index 03330f0a54f..80f266cc604 100644 --- a/reactos/win32ss/user/user32/user32.spec +++ b/reactos/win32ss/user/user32/user32.spec @@ -387,7 +387,7 @@ @ stdcall GrayStringA(long long ptr long long long long long long) @ stdcall GrayStringW(long long ptr long long long long long long) @ stdcall HideCaret(long) NtUserHideCaret -@ stdcall HiliteMenuItem(long long long long) NtUserHiliteMenuItem +@ stdcall HiliteMenuItem(long long long long) ; Use both ReactOS and wine NtUserHiliteMenuItem @ stdcall IMPGetIMEA(long ptr) @ stdcall IMPGetIMEW(long ptr) @ stdcall IMPQueryIMEA(ptr) diff --git a/reactos/win32ss/user/user32/windows/menu.c b/reactos/win32ss/user/user32/windows/menu.c index d51492201c3..34c2a4ac2c3 100644 --- a/reactos/win32ss/user/user32/windows/menu.c +++ b/reactos/win32ss/user/user32/windows/menu.c @@ -4181,20 +4181,17 @@ EndMenu(VOID) return TRUE; } -// So this one maybe one day it will be a callback! BOOL WINAPI HiliteMenuItem( HWND hWnd, HMENU hMenu, UINT wItemID, UINT wHilite ) { ROSMENUINFO MenuInfo; - ROSMENUITEMINFO mii; TRACE("(%p, %p, %04x, %04x);\n", hWnd, hMenu, wItemID, wHilite); - if (!hWnd) - { - SetLastError(ERROR_INVALID_WINDOW_HANDLE); - return FALSE; - } - if (!NtUserMenuItemInfo(hMenu, wItemID, wHilite, &mii, FALSE)) return FALSE; - if (!NtUserMenuInfo(hMenu, &MenuInfo, FALSE)) return FALSE; + // Force bits to be set call server side.... + // This alone works and passes all the menu test_menu_hilitemenuitem tests. + if (!NtUserHiliteMenuItem(hWnd, hMenu, wItemID, wHilite)) return FALSE; + // Without the above call we fail 3 out of the wine failed todo tests, see CORE-7967 + // Now redraw menu. + if (!MenuGetRosMenuInfo(&MenuInfo, hMenu)) return FALSE; if (MenuInfo.FocusedItem == wItemID) return TRUE; MenuHideSubPopups( hWnd, &MenuInfo, FALSE, 0 ); MenuSelectItem( hWnd, &MenuInfo, wItemID, TRUE, 0 ); From 6a334be372146ecb709f4b18671d82fd9dbc3d7f Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 20 Mar 2014 02:07:55 +0000 Subject: [PATCH 130/419] [Usp10] - Sync to Wine 1.7.14. svn path=/trunk/; revision=62535 --- reactos/dll/win32/usp10/bidi.c | 1126 ++++++++++++++--------- reactos/dll/win32/usp10/indicsyllable.c | 4 +- reactos/dll/win32/usp10/linebreak.c | 168 ++-- reactos/dll/win32/usp10/shaping.c | 70 +- reactos/dll/win32/usp10/usp10.c | 2 +- reactos/media/doc/README.WINE | 2 +- 6 files changed, 802 insertions(+), 570 deletions(-) diff --git a/reactos/dll/win32/usp10/bidi.c b/reactos/dll/win32/usp10/bidi.c index 6afcf70ef35..5ac37802b3e 100644 --- a/reactos/dll/win32/usp10/bidi.c +++ b/reactos/dll/win32/usp10/bidi.c @@ -41,12 +41,16 @@ * has been modified. */ +#include + +#include + #include "usp10_internal.h" WINE_DEFAULT_DEBUG_CHANNEL(bidi); #define ASSERT(x) do { if (!(x)) FIXME("assert failed: %s\n", #x); } while(0) -#define MAX_LEVEL 61 +#define MAX_DEPTH 125 /* HELPER FUNCTIONS AND DECLARATIONS */ @@ -64,7 +68,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(bidi); enum directions { /* input types */ - /* ON MUST be zero, code relies on ON = N = 0 */ + /* ON MUST be zero, code relies on ON = NI = 0 */ ON = 0, /* Other Neutral */ L, /* Left Letter */ R, /* Right Letter */ @@ -91,12 +95,53 @@ enum directions LRE, PDF, + LRI, /* Isolate formatting characters new with 6.3 */ + RLI, + FSI, + PDI, + /* resolved types, also resolved directions */ - N = ON, /* alias, where ON, WS and S are treated the same */ + NI = ON, /* alias, where ON, WS, S and Isolates are treated the same */ +}; + +static const char debug_type[][4] = +{ + "ON", /* Other Neutral */ + "L", /* Left Letter */ + "R", /* Right Letter */ + "AN", /* Arabic Number */ + "EN", /* European Number */ + "AL", /* Arabic Letter (Right-to-left) */ + "NSM", /* Non-spacing Mark */ + "CS", /* Common Separator */ + "ES", /* European Separator */ + "ET", /* European Terminator (post/prefix e.g. $ and %) */ + "BN", /* Boundary neutral (type of RLE etc after explicit levels) */ + "S", /* Segment Separator (TAB) // used only in L1 */ + "WS", /* White space // used only in L1 */ + "B", /* Paragraph Separator (aka as PS) */ + "RLO", /* these are used only in X1-X9 */ + "RLE", + "LRO", + "LRE", + "PDF", + "LRI", /* Isolate formatting characters new with 6.3 */ + "RLI", + "FSI", + "PDI", }; /* HELPER FUNCTIONS */ +static inline void dump_types(const char* header, WORD *types, int start, int end) +{ + int i; + TRACE("%s:",header); + for (i = start; i< end; i++) + TRACE(" %s",debug_type[types[i]]); + TRACE("\n"); +} + /* Convert the libwine information to the direction enum */ static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIPT_CONTROL *c) { @@ -132,7 +177,7 @@ static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIP switch (lpString[i]) { case '-': - case '+': chartype[i] = N; break; + case '+': chartype[i] = NI; break; case '/': chartype[i] = CS; break; } break; @@ -144,23 +189,16 @@ static void classify(LPCWSTR lpString, WORD *chartype, DWORD uCount, const SCRIP case 0x202C: chartype[i] = PDF; break; case 0x202D: chartype[i] = LRO; break; case 0x202E: chartype[i] = RLO; break; + case 0x2066: chartype[i] = LRI; break; + case 0x2067: chartype[i] = RLI; break; + case 0x2068: chartype[i] = FSI; break; + case 0x2069: chartype[i] = PDI; break; } break; } } } -/* Set a run of cval values at locations all prior to, but not including */ -/* iStart, to the new value nval. */ -static void SetDeferredRun(WORD *pval, int cval, int iStart, int nval) -{ - int i = iStart - 1; - for (; i >= iStart - cval; i--) - { - pval[i] = nval; - } -} - /* RESOLVE EXPLICIT */ static WORD GreaterEven(int i) @@ -197,233 +235,269 @@ static WORD EmbeddingDirection(int level) the outermost call. The nesting counter counts the recursion depth and not the embedding level. ------------------------------------------------------------------------*/ +typedef struct tagStackItem { + int level; + int override; + BOOL isolate; +} StackItem; -static int resolveExplicit(int level, int dir, WORD *pcls, WORD *plevel, int cch, int nNest) +#define push_stack(l,o,i) \ + do { stack_top--; \ + stack[stack_top].level = l; \ + stack[stack_top].override = o; \ + stack[stack_top].isolate = i;} while(0) + +#define pop_stack() do { stack_top++; } while(0) + +#define valid_level(x) (x <= MAX_DEPTH && overflow_isolate_count == 0 && overflow_embedding_count == 0) + +static void resolveExplicit(int level, WORD *pclass, WORD *poutLevel, int count) { - /* always called with a valid nesting level - nesting levels are != embedding levels */ - int nLastValid = nNest; - int ich = 0; + /* X1 */ + int overflow_isolate_count = 0; + int overflow_embedding_count = 0; + int valid_isolate_count = 0; + int i; - /* check input values */ - ASSERT(nNest >= 0 && level >= 0 && level <= MAX_LEVEL); + StackItem stack[MAX_DEPTH+2]; + int stack_top = MAX_DEPTH+1; - /* process the text */ - for (; ich < cch; ich++) + stack[stack_top].level = level; + stack[stack_top].override = NI; + stack[stack_top].isolate = FALSE; + + for (i = 0; i < count; i++) { - WORD cls = pcls[ich]; - switch (cls) + /* X2 */ + if (pclass[i] == RLE) { - case LRO: - case LRE: - nNest++; - if (GreaterEven(level) <= MAX_LEVEL - (cls == LRO ? 2 : 0)) + int least_odd = GreaterOdd(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_odd)) + push_stack(least_odd, NI, FALSE); + else if (overflow_isolate_count == 0) + overflow_embedding_count++; + } + /* X3 */ + else if (pclass[i] == LRE) + { + int least_even = GreaterEven(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_even)) + push_stack(least_even, NI, FALSE); + else if (overflow_isolate_count == 0) + overflow_embedding_count++; + } + /* X4 */ + else if (pclass[i] == RLO) + { + int least_odd = GreaterOdd(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_odd)) + push_stack(least_odd, R, FALSE); + else if (overflow_isolate_count == 0) + overflow_embedding_count++; + } + /* X5 */ + else if (pclass[i] == LRO) + { + int least_even = GreaterEven(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_even)) + push_stack(least_even, L, FALSE); + else if (overflow_isolate_count == 0) + overflow_embedding_count++; + } + /* X5a */ + else if (pclass[i] == RLI) + { + int least_odd = GreaterOdd(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_odd)) { - plevel[ich] = GreaterEven(level); - pcls[ich] = BN; - ich += resolveExplicit(plevel[ich], (cls == LRE ? N : L), - &pcls[ich+1], &plevel[ich+1], - cch - (ich+1), nNest); - nNest--; - continue; + valid_isolate_count++; + push_stack(least_odd, NI, TRUE); } - cls = pcls[ich] = BN; - break; - - case RLO: - case RLE: - nNest++; - if (GreaterOdd(level) <= MAX_LEVEL - (cls == RLO ? 2 : 0)) + else + overflow_isolate_count++; + } + /* X5b */ + else if (pclass[i] == LRI) + { + int least_even = GreaterEven(stack[stack_top].level); + poutLevel[i] = stack[stack_top].level; + if (valid_level(least_even)) { - plevel[ich] = GreaterOdd(level); - pcls[ich] = BN; - ich += resolveExplicit(plevel[ich], (cls == RLE ? N : R), - &pcls[ich+1], &plevel[ich+1], - cch - (ich+1), nNest); - nNest--; - continue; + valid_isolate_count++; + push_stack(least_even, NI, TRUE); } - cls = pcls[ich] = BN; - break; - - case PDF: - cls = pcls[ich] = BN; - if (nNest) + else + overflow_isolate_count++; + } + /* X5c */ + else if (pclass[i] == FSI) + { + int j; + int new_level = 0; + int skipping = 0; + poutLevel[i] = stack[stack_top].level; + for (j = i+1; j < count; j++) { - if (nLastValid < nNest) + if (pclass[j] == LRI || pclass[j] == RLI || pclass[j] == FSI) { - nNest--; + skipping++; + continue; + } + else if (pclass[j] == PDI) + { + if (skipping) + skipping --; + else + break; + continue; + } + + if (skipping) continue; + + if (pclass[j] == L) + { + new_level = 0; + break; + } + else if (pclass[j] == R || pclass[j] == AL) + { + new_level = 1; + break; + } + } + if (odd(new_level)) + { + int least_odd = GreaterOdd(stack[stack_top].level); + if (valid_level(least_odd)) + { + valid_isolate_count++; + push_stack(least_odd, NI, TRUE); } else + overflow_isolate_count++; + } + else + { + int least_even = GreaterEven(stack[stack_top].level); + if (valid_level(least_even)) { - cch = ich; /* break the loop, but complete body */ + valid_isolate_count++; + push_stack(least_even, NI, TRUE); } + else + overflow_isolate_count++; } } - - /* Apply the override */ - if (dir != N) + /* X6 */ + else if (pclass[i] != B && pclass[i] != BN && pclass[i] != PDI && pclass[i] != PDF) { - cls = dir; + poutLevel[i] = stack[stack_top].level; + if (stack[stack_top].override != NI) + pclass[i] = stack[stack_top].override; } - plevel[ich] = level; - if (pcls[ich] != BN) - pcls[ich] = cls; + /* X6a */ + else if (pclass[i] == PDI) + { + if (overflow_isolate_count) overflow_isolate_count--; + else if (!valid_isolate_count) {/* do nothing */} + else + { + overflow_embedding_count = 0; + while (!stack[stack_top].isolate) pop_stack(); + pop_stack(); + valid_isolate_count --; + } + poutLevel[i] = stack[stack_top].level; + } + /* X7 */ + else if (pclass[i] == PDF) + { + poutLevel[i] = stack[stack_top].level; + if (overflow_isolate_count) {/* do nothing */} + else if (overflow_embedding_count) overflow_embedding_count--; + else if (!stack[stack_top].isolate && stack_top < (MAX_DEPTH+1)) + pop_stack(); + } + /* X8: Nothing */ } - - return ich; + /* X9: Based on 5.2 Retaining Explicit Formatting Characters */ + for (i = 0; i < count ; i++) + if (pclass[i] == RLE || pclass[i] == LRE || pclass[i] == RLO || pclass[i] == LRO || pclass[i] == PDF) + pclass[i] = BN; } -/* RESOLVE WEAK TYPES */ - -enum states /* possible states */ +static inline int previousValidChar(const WORD *pcls, int index, int back_fence) { - xa, /* Arabic letter */ - xr, /* right letter */ - xl, /* left letter */ - - ao, /* Arabic lett. foll by ON */ - ro, /* right lett. foll by ON */ - lo, /* left lett. foll by ON */ - - rt, /* ET following R */ - lt, /* ET following L */ - - cn, /* EN, AN following AL */ - ra, /* Arabic number foll R */ - re, /* European number foll R */ - la, /* Arabic number foll L */ - le, /* European number foll L */ - - ac, /* CS following cn */ - rc, /* CS following ra */ - rs, /* CS,ES following re */ - lc, /* CS following la */ - ls, /* CS,ES following le */ - - ret, /* ET following re */ - let, /* ET following le */ -} ; - -static const int stateWeak[][10] = -{ - /* N, L, R, AN, EN, AL,NSM, CS, ES, ET */ -/*xa*/ { ao, xl, xr, cn, cn, xa, xa, ao, ao, ao }, /* Arabic letter */ -/*xr*/ { ro, xl, xr, ra, re, xa, xr, ro, ro, rt }, /* right letter */ -/*xl*/ { lo, xl, xr, la, le, xa, xl, lo, lo, lt }, /* left letter */ - -/*ao*/ { ao, xl, xr, cn, cn, xa, ao, ao, ao, ao }, /* Arabic lett. foll by ON*/ -/*ro*/ { ro, xl, xr, ra, re, xa, ro, ro, ro, rt }, /* right lett. foll by ON */ -/*lo*/ { lo, xl, xr, la, le, xa, lo, lo, lo, lt }, /* left lett. foll by ON */ - -/*rt*/ { ro, xl, xr, ra, re, xa, rt, ro, ro, rt }, /* ET following R */ -/*lt*/ { lo, xl, xr, la, le, xa, lt, lo, lo, lt }, /* ET following L */ - -/*cn*/ { ao, xl, xr, cn, cn, xa, cn, ac, ao, ao }, /* EN, AN following AL */ -/*ra*/ { ro, xl, xr, ra, re, xa, ra, rc, ro, rt }, /* Arabic number foll R */ -/*re*/ { ro, xl, xr, ra, re, xa, re, rs, rs,ret }, /* European number foll R */ -/*la*/ { lo, xl, xr, la, le, xa, la, lc, lo, lt }, /* Arabic number foll L */ -/*le*/ { lo, xl, xr, la, le, xa, le, ls, ls,let }, /* European number foll L */ - -/*ac*/ { ao, xl, xr, cn, cn, xa, ao, ao, ao, ao }, /* CS following cn */ -/*rc*/ { ro, xl, xr, ra, re, xa, ro, ro, ro, rt }, /* CS following ra */ -/*rs*/ { ro, xl, xr, ra, re, xa, ro, ro, ro, rt }, /* CS,ES following re */ -/*lc*/ { lo, xl, xr, la, le, xa, lo, lo, lo, lt }, /* CS following la */ -/*ls*/ { lo, xl, xr, la, le, xa, lo, lo, lo, lt }, /* CS,ES following le */ - -/*ret*/{ ro, xl, xr, ra, re, xa,ret, ro, ro,ret }, /* ET following re */ -/*let*/{ lo, xl, xr, la, le, xa,let, lo, lo,let }, /* ET following le */ -}; - -enum actions /* possible actions */ -{ - /* primitives */ - IX = 0x100, /* increment */ - XX = 0xF, /* no-op */ - - /* actions */ - xxx = (XX << 4) + XX, /* no-op */ - xIx = IX + xxx, /* increment run */ - xxN = (XX << 4) + ON, /* set current to N */ - xxE = (XX << 4) + EN, /* set current to EN */ - xxA = (XX << 4) + AN, /* set current to AN */ - xxR = (XX << 4) + R, /* set current to R */ - xxL = (XX << 4) + L, /* set current to L */ - Nxx = (ON << 4) + 0xF, /* set run to neutral */ - Axx = (AN << 4) + 0xF, /* set run to AN */ - ExE = (EN << 4) + EN, /* set run to EN, set current to EN */ - NIx = (ON << 4) + 0xF + IX, /* set run to N, increment */ - NxN = (ON << 4) + ON, /* set run to N, set current to N */ - NxR = (ON << 4) + R, /* set run to N, set current to R */ - NxE = (ON << 4) + EN, /* set run to N, set current to EN */ - - AxA = (AN << 4) + AN, /* set run to AN, set current to AN */ - NxL = (ON << 4) + L, /* set run to N, set current to L */ - LxL = (L << 4) + L, /* set run to L, set current to L */ -} ; - -static const int actionWeak[][10] = -{ - /* N, L, R, AN, EN, AL, NSM, CS, ES, ET */ -/*xa*/ { xxx, xxx, xxx, xxx, xxA, xxR, xxR, xxN, xxN, xxN }, /* Arabic letter */ -/*xr*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxR, xxN, xxN, xIx }, /* right letter */ -/*xl*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxL, xxN, xxN, xIx }, /* left letter */ - -/*ao*/ { xxx, xxx, xxx, xxx, xxA, xxR, xxN, xxN, xxN, xxN }, /* Arabic lett. foll by ON */ -/*ro*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxN, xxN, xxN, xIx }, /* right lett. foll by ON */ -/*lo*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxN, xxN, xxN, xIx }, /* left lett. foll by ON */ - -/*rt*/ { Nxx, Nxx, Nxx, Nxx, ExE, NxR, xIx, NxN, NxN, xIx }, /* ET following R */ -/*lt*/ { Nxx, Nxx, Nxx, Nxx, LxL, NxR, xIx, NxN, NxN, xIx }, /* ET following L */ - -/*cn*/ { xxx, xxx, xxx, xxx, xxA, xxR, xxA, xIx, xxN, xxN }, /* EN, AN following AL */ -/*ra*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxA, xIx, xxN, xIx }, /* Arabic number foll R */ -/*re*/ { xxx, xxx, xxx, xxx, xxE, xxR, xxE, xIx, xIx, xxE }, /* European number foll R */ -/*la*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxA, xIx, xxN, xIx }, /* Arabic number foll L */ -/*le*/ { xxx, xxx, xxx, xxx, xxL, xxR, xxL, xIx, xIx, xxL }, /* European number foll L */ - -/*ac*/ { Nxx, Nxx, Nxx, Axx, AxA, NxR, NxN, NxN, NxN, NxN }, /* CS following cn */ -/*rc*/ { Nxx, Nxx, Nxx, Axx, NxE, NxR, NxN, NxN, NxN, NIx }, /* CS following ra */ -/*rs*/ { Nxx, Nxx, Nxx, Nxx, ExE, NxR, NxN, NxN, NxN, NIx }, /* CS,ES following re */ -/*lc*/ { Nxx, Nxx, Nxx, Axx, NxL, NxR, NxN, NxN, NxN, NIx }, /* CS following la */ -/*ls*/ { Nxx, Nxx, Nxx, Nxx, LxL, NxR, NxN, NxN, NxN, NIx }, /* CS,ES following le */ - -/*ret*/{ xxx, xxx, xxx, xxx, xxE, xxR, xxE, xxN, xxN, xxE }, /* ET following re */ -/*let*/{ xxx, xxx, xxx, xxx, xxL, xxR, xxL, xxN, xxN, xxL }, /* ET following le */ -}; - -static int GetDeferredType(int action) -{ - return (action >> 4) & 0xF; + if (index == -1 || index == back_fence) return index; + index --; + while (index > back_fence && pcls[index] == BN) index --; + return index; } -static int GetResolvedType(int action) +static inline int nextValidChar(const WORD *pcls, int index, int front_fence) { - return action & 0xF; + if (index == front_fence) return index; + index ++; + while (index < front_fence && pcls[index] == BN) index ++; + return index; } -/* Note on action table: +typedef struct tagRun +{ + int start; + int end; + WORD e; +} Run; - States can be of two kinds: - - Immediate Resolution State, where each input token - is resolved as soon as it is seen. These states have - only single action codes (xxN) or the no-op (xxx) - for static input tokens. - - Deferred Resolution State, where input tokens either - either extend the run (xIx) or resolve its Type (e.g. Nxx). +typedef struct tagIsolatedRun +{ + struct list entry; + int length; + WORD sos; + WORD eos; + WORD e; - Input classes are of three kinds - - Static Input Token, where the class of the token remains - unchanged on output (AN, L, N, R) - - Replaced Input Token, where the class of the token is - always replaced on output (AL, BN, NSM, CS, ES, ET) - - Conditional Input Token, where the class of the token is - changed on output in some, but not all, cases (EN) + WORD *ppcls[1]; +} IsolatedRun; - Where tokens are subject to change, a double action - (e.g. NxA, or NxN) is _required_ after deferred states, - resolving both the deferred state and changing the current token. -*/ +static inline int iso_nextValidChar(IsolatedRun *iso_run, int index) +{ + if (index >= (iso_run->length-1)) return -1; + index ++; + while (index < iso_run->length && *iso_run->ppcls[index] == BN) index++; + if (index == iso_run->length) return -1; + return index; +} + +static inline int iso_previousValidChar(IsolatedRun *iso_run, int index) +{ + + if (index <= 0) return -1; + index --; + while (index > -1 && *iso_run->ppcls[index] == BN) index--; + return index; +} + +static inline int iso_previousChar(IsolatedRun *iso_run, int index) +{ + if (index <= 0) return -1; + return index --; +} + +static inline void iso_dump_types(const char* header, IsolatedRun *iso_run) +{ + int i; + TRACE("%s:",header); + TRACE("[ "); + for (i = 0; i < iso_run->length; i++) + TRACE(" %s",debug_type[*iso_run->ppcls[i]]); + TRACE(" ]\n"); +} /*------------------------------------------------------------------------ Function: resolveWeak @@ -440,178 +514,142 @@ static int GetResolvedType(int action) Note: On input only these directional classes are expected AL, HL, R, L, ON, BN, NSM, AN, EN, ES, ET, CS, ------------------------------------------------------------------------*/ -static void resolveWeak(int baselevel, WORD *pcls, WORD *plevel, int cch) + +static void resolveWeak(IsolatedRun * iso_run) { - int state = odd(baselevel) ? xr : xl; - int cls; + int i; - int level = baselevel; - int action, clsRun, clsNew; - int cchRun = 0; - int ich = 0; - - for (; ich < cch; ich++) + /* W1 */ + for (i=0; i < iso_run->length; i++) { - /* ignore boundary neutrals */ - if (pcls[ich] == BN) + if (*iso_run->ppcls[i] == NSM) { - /* must flatten levels unless at a level change; */ - plevel[ich] = level; - - /* lookahead for level changes */ - if (ich + 1 == cch && level != baselevel) - { - /* have to fixup last BN before end of the loop, since - * its fix-upped value will be needed below the assert */ - pcls[ich] = EmbeddingDirection(level); - } - else if (ich + 1 < cch && level != plevel[ich+1] && pcls[ich+1] != BN) - { - /* fixup LAST BN in front / after a level run to make - * it act like the SOR/EOR in rule X10 */ - int newlevel = plevel[ich+1]; - if (level > newlevel) { - newlevel = level; - } - plevel[ich] = newlevel; - - /* must match assigned level */ - pcls[ich] = EmbeddingDirection(newlevel); - level = plevel[ich+1]; - } + int j = iso_previousValidChar(iso_run, i); + if (j == -1) + *iso_run->ppcls[i] = iso_run->sos; + else if (*iso_run->ppcls[j] >= LRI) + *iso_run->ppcls[i] = ON; else - { - /* don't interrupt runs */ - if (cchRun) - { - cchRun++; - } - continue; - } + *iso_run->ppcls[i] = *iso_run->ppcls[j]; } - - ASSERT(pcls[ich] <= BN); - cls = pcls[ich]; - - action = actionWeak[state][cls]; - - /* resolve the directionality for deferred runs */ - clsRun = GetDeferredType(action); - if (clsRun != XX) - { - SetDeferredRun(pcls, cchRun, ich, clsRun); - cchRun = 0; - } - - /* resolve the directionality class at the current location */ - clsNew = GetResolvedType(action); - if (clsNew != XX) - pcls[ich] = clsNew; - - /* increment a deferred run */ - if (IX & action) - cchRun++; - - state = stateWeak[state][cls]; } - /* resolve any deferred runs - * use the direction of the current level to emulate PDF */ - cls = EmbeddingDirection(level); + /* W2 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == EN) + { + int j = iso_previousValidChar(iso_run, i); + while (j > -1) + { + if (*iso_run->ppcls[j] == R || *iso_run->ppcls[j] == L || *iso_run->ppcls[j] == AL) + { + if (*iso_run->ppcls[j] == AL) + *iso_run->ppcls[i] = AN; + break; + } + j = iso_previousValidChar(iso_run, j); + } + } + } - /* resolve the directionality for deferred runs */ - clsRun = GetDeferredType(actionWeak[state][cls]); - if (clsRun != XX) - SetDeferredRun(pcls, cchRun, ich, clsRun); + /* W3 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == AL) + *iso_run->ppcls[i] = R; + } + + /* W4 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == ES) + { + int b = iso_previousValidChar(iso_run, i); + int f = iso_nextValidChar(iso_run, i); + + if (b > -1 && f > -1 && *iso_run->ppcls[b] == EN && *iso_run->ppcls[f] == EN) + *iso_run->ppcls[i] = EN; + } + else if (*iso_run->ppcls[i] == CS) + { + int b = iso_previousValidChar(iso_run, i); + int f = iso_nextValidChar(iso_run, i); + + if (b > -1 && f > -1 && *iso_run->ppcls[b] == EN && *iso_run->ppcls[f] == EN) + *iso_run->ppcls[i] = EN; + else if (b > -1 && f > -1 && *iso_run->ppcls[b] == AN && *iso_run->ppcls[f] == AN) + *iso_run->ppcls[i] = AN; + } + } + + /* W5 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == ET) + { + int j; + for (j = i-1 ; j > -1; j--) + { + if (*iso_run->ppcls[j] == BN) continue; + if (*iso_run->ppcls[j] == ET) continue; + else if (*iso_run->ppcls[j] == EN) *iso_run->ppcls[i] = EN; + else break; + } + if (*iso_run->ppcls[i] == ET) + { + for (j = i+1; j < iso_run->length; j++) + { + if (*iso_run->ppcls[j] == BN) continue; + if (*iso_run->ppcls[j] == ET) continue; + else if (*iso_run->ppcls[j] == EN) *iso_run->ppcls[i] = EN; + else break; + } + } + } + } + + /* W6 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == ET || *iso_run->ppcls[i] == ES || *iso_run->ppcls[i] == CS || *iso_run->ppcls[i] == ON) + { + int b = i-1; + int f = i+1; + if (b > -1 && *iso_run->ppcls[b] == BN) + *iso_run->ppcls[b] = ON; + if (f < iso_run->length && *iso_run->ppcls[f] == BN) + *iso_run->ppcls[f] = ON; + + *iso_run->ppcls[i] = ON; + } + } + + /* W7 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == EN) + { + int j; + for (j = iso_previousValidChar(iso_run, i); j > -1; j = iso_previousValidChar(iso_run, j)) + if (*iso_run->ppcls[j] == R || *iso_run->ppcls[j] == L) + { + if (*iso_run->ppcls[j] == L) + *iso_run->ppcls[i] = L; + break; + } + if (iso_run->sos == L && j == -1) + *iso_run->ppcls[i] = L; + } + } } -/* RESOLVE NEUTRAL TYPES */ - -/* action values */ -enum neutralactions -{ - /* action to resolve previous input */ - nL = L, /* resolve EN to L */ - En = 3 << 4, /* resolve neutrals run to embedding level direction */ - Rn = R << 4, /* resolve neutrals run to strong right */ - Ln = L << 4, /* resolved neutrals run to strong left */ - In = (1<<8), /* increment count of deferred neutrals */ - LnL = (1<<4)+L, /* set run and EN to L */ -}; - -static int GetDeferredNeutrals(int action, int level) -{ - action = (action >> 4) & 0xF; - if (action == (En >> 4)) - return EmbeddingDirection(level); - else - return action; -} - -static int GetResolvedNeutrals(int action) -{ - action = action & 0xF; - if (action == In) - return 0; - else - return action; -} - -/* state values */ -enum resolvestates -{ - /* new temporary class */ - r, /* R and characters resolved to R */ - l, /* L and characters resolved to L */ - rn, /* N preceded by right */ - ln, /* N preceded by left */ - a, /* AN preceded by left (the abbreviation 'la' is used up above) */ - na, /* N preceded by a */ -} ; - - -/*------------------------------------------------------------------------ - Notes: - - By rule W7, whenever a EN is 'dominated' by an L (including start of - run with embedding direction = L) it is resolved to, and further treated - as L. - - This leads to the need for 'a' and 'na' states. -------------------------------------------------------------------------*/ - -static const int actionNeutrals[][5] = -{ -/* N, L, R, AN, EN = cls */ - { In, 0, 0, 0, 0 }, /* r right */ - { In, 0, 0, 0, L }, /* l left */ - - { In, En, Rn, Rn, Rn }, /* rn N preceded by right */ - { In, Ln, En, En, LnL}, /* ln N preceded by left */ - - { In, 0, 0, 0, L }, /* a AN preceded by left */ - { In, En, Rn, Rn, En }, /* na N preceded by a */ -} ; - -static const int stateNeutrals[][5] = -{ -/* N, L, R, AN, EN */ - { rn, l, r, r, r }, /* r right */ - { ln, l, r, a, l }, /* l left */ - - { rn, l, r, r, r }, /* rn N preceded by right */ - { ln, l, r, a, l }, /* ln N preceded by left */ - - { na, l, r, a, l }, /* a AN preceded by left */ - { na, l, r, a, l }, /* na N preceded by la */ -} ; - /*------------------------------------------------------------------------ Function: resolveNeutrals Resolves the directionality of neutral character types. - Implements rules W7, N1 and N2 of the Unicode Bidi Algorithm. + Implements rules N1 and N2 of the Unicode Bidi Algorithm. Input: Array of embedding levels Character count @@ -620,70 +658,95 @@ static const int stateNeutrals[][5] = In/Out: Array of directional classes Note: On input only these directional classes are expected - R, L, N, AN, EN and BN + R, L, NI, AN, EN and BN W8 resolves a number of ENs to L ------------------------------------------------------------------------*/ -static void resolveNeutrals(int baselevel, WORD *pcls, const WORD *plevel, int cch) +static void resolveNeutrals(IsolatedRun *iso_run) { - /* the state at the start of text depends on the base level */ - int state = odd(baselevel) ? r : l; - int cls; + int i; - int cchRun = 0; - int level = baselevel; - - int action, clsRun, clsNew; - int ich = 0; - for (; ich < cch; ich++) + /* Translate isolates into NI */ + for (i = 0; i < iso_run->length; i++) { - /* ignore boundary neutrals */ - if (pcls[ich] == BN) - { - /* include in the count for a deferred run */ - if (cchRun) - cchRun++; + if (*iso_run->ppcls[i] >= LRI) + *iso_run->ppcls[i] = NI; - /* skip any further processing */ - continue; + switch(*iso_run->ppcls[i]) + { + case B: + case S: + case WS: *iso_run->ppcls[i] = NI; } - ASSERT(pcls[ich] < 5); /* "Only N, L, R, AN, EN are allowed" */ - cls = pcls[ich]; - - action = actionNeutrals[state][cls]; - - /* resolve the directionality for deferred runs */ - clsRun = GetDeferredNeutrals(action, level); - if (clsRun != N) - { - SetDeferredRun(pcls, cchRun, ich, clsRun); - cchRun = 0; - } - - /* resolve the directionality class at the current location */ - clsNew = GetResolvedNeutrals(action); - if (clsNew != N) - pcls[ich] = clsNew; - - if (In & action) - cchRun++; - - state = stateNeutrals[state][cls]; - level = plevel[ich]; + ASSERT(*iso_run->ppcls[i] < 5 || *iso_run->ppcls[i] == BN); /* "Only NI, L, R, AN, EN and BN are allowed" */ } - /* resolve any deferred runs */ - cls = EmbeddingDirection(level); /* eor has type of current level */ + /* N0: Skipping bracketed pairs for now */ - /* resolve the directionality for deferred runs */ - clsRun = GetDeferredNeutrals(actionNeutrals[state][cls], level); - if (clsRun != N) - SetDeferredRun(pcls, cchRun, ich, clsRun); + /* N1 */ + for (i = 0; i < iso_run->length; i++) + { + WORD l,r; + + if (*iso_run->ppcls[i] == NI) + { + int j; + int b = iso_previousValidChar(iso_run, i); + + if (b == -1) + { + l = iso_run->sos; + b = 0; + } + else + { + if (*iso_run->ppcls[b] == R || *iso_run->ppcls[b] == AN || *iso_run->ppcls[b] == EN) + l = R; + else if (*iso_run->ppcls[b] == L) + l = L; + else /* No string type */ + continue; + } + j = iso_nextValidChar(iso_run, i); + while (j > -1 && *iso_run->ppcls[j] == NI) j = iso_nextValidChar(iso_run, j); + + if (j == -1) + { + r = iso_run->eos; + j = iso_run->length; + } + else if (*iso_run->ppcls[j] == R || *iso_run->ppcls[j] == AN || *iso_run->ppcls[j] == EN) + r = R; + else if (*iso_run->ppcls[j] == L) + r = L; + else /* No string type */ + continue; + + if (r == l) + { + for (b = i; b < j && b < iso_run->length; b++) + *iso_run->ppcls[b] = r; + } + } + } + + /* N2 */ + for (i = 0; i < iso_run->length; i++) + { + if (*iso_run->ppcls[i] == NI) + { + int b = i-1; + int f = i+1; + *iso_run->ppcls[i] = EmbeddingDirection(iso_run->e); + if (b > -1 && *iso_run->ppcls[b] == BN) + *iso_run->ppcls[b] = EmbeddingDirection(iso_run->e); + if (f < iso_run->length && *iso_run->ppcls[f] == BN) + *iso_run->ppcls[f] = EmbeddingDirection(iso_run->e); + } + } } -/* RESOLVE IMPLICIT */ - /*------------------------------------------------------------------------ Function: resolveImplicit @@ -700,29 +763,178 @@ static void resolveNeutrals(int baselevel, WORD *pcls, const WORD *plevel, int c Accepted subset of direction classes R, L, AN, EN ------------------------------------------------------------------------*/ -static const WORD addLevel[][4] = +static void resolveImplicit(const WORD * pcls, WORD *plevel, int sos, int eos) { - /* L, R, AN, EN */ -/* even */ { 0, 1, 2, 2, }, -/* odd */ { 1, 0, 1, 1, } + int i; -}; - -static void resolveImplicit(const WORD * pcls, WORD *plevel, int cch) -{ - int ich = 0; - for (; ich < cch; ich++) + /* I1/2 */ + for (i = sos; i <= eos; i++) { - /* cannot resolve bn here, since some bn were resolved to strong - * types in resolveWeak. To remove these we need the original - * types, which are available again in resolveWhiteSpace */ - if (pcls[ich] == BN) - { + if (pcls[i] == BN) continue; + + ASSERT(pcls[i] > 0); /* "No Neutrals allowed to survive here." */ + ASSERT(pcls[i] < 5); /* "Out of range." */ + + if (odd(plevel[i]) && (pcls[i] == L || pcls[i] == EN || pcls [i] == AN)) + plevel[i]++; + else if (!odd(plevel[i]) && pcls[i] == R) + plevel[i]++; + else if (!odd(plevel[i]) && (pcls[i] == EN || pcls [i] == AN)) + plevel[i]+=2; + } +} + +static void resolveResolved(unsigned baselevel, const WORD * pcls, WORD *plevel, int sos, int eos) +{ + int i; + + /* L1 */ + for (i = sos; i <= eos; i++) + { + if (pcls[i] == B || pcls[i] == S) + { + int j = i -1; + while (i > sos && j >= sos && + (pcls[j] == WS || pcls[j] == FSI || pcls[j] == LRI || pcls[j] == RLI || + pcls[j] == PDI || pcls[j] == LRE || pcls[j] == RLE || pcls[j] == LRO || + pcls[j] == RLO || pcls[j] == PDF || pcls[j] == BN)) + plevel[j--] = baselevel; + plevel[i] = baselevel; } - ASSERT(pcls[ich] > 0); /* "No Neutrals allowed to survive here." */ - ASSERT(pcls[ich] < 5); /* "Out of range." */ - plevel[ich] += addLevel[odd(plevel[ich])][pcls[ich] - 1]; + if (i == eos && + (pcls[i] == WS || pcls[i] == FSI || pcls[i] == LRI || pcls[i] == RLI || + pcls[i] == PDI || pcls[i] == LRE || pcls[i] == RLE || pcls[i] == LRO || + pcls[i] == RLO || pcls[i] == PDF || pcls[i] == BN )) + { + int j = i; + while (j >= sos && (pcls[j] == WS || pcls[j] == FSI || pcls[j] == LRI || pcls[j] == RLI || + pcls[j] == PDI || pcls[j] == LRE || pcls[j] == RLE || pcls[j] == LRO || + pcls[j] == RLO || pcls[j] == PDF || pcls[j] == BN)) + plevel[j--] = baselevel; + } + } +} + +static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel, int uCount, struct list *set) +{ + int run_start, run_end, i; + Run runs[uCount]; + int run_count = 0; + IsolatedRun *current_isolated; + + list_init(set); + + /* Build Runs */ + run_start = 0; + while (run_start < uCount) + { + run_end = nextValidChar(pcls, run_start, uCount); + while (run_end < uCount && pLevel[run_end] == pLevel[run_start]) run_end = nextValidChar(pcls, run_end, uCount); + run_end --; + runs[run_count].start = run_start; + runs[run_count].end = run_end; + runs[run_count].e = pLevel[run_start]; + run_start = nextValidChar(pcls, run_end, uCount); + run_count++; + } + + /* Build Isolating Runs */ + i = 0; + while (i < run_count) + { + int k = i; + if (runs[k].start >= 0) + { + int type_fence, real_end; + int j; + current_isolated = HeapAlloc(GetProcessHeap(), 0, sizeof(IsolatedRun) + sizeof(WORD*)*uCount); + + run_start = runs[k].start; + current_isolated->e = runs[k].e; + current_isolated->length = (runs[k].end - runs[k].start)+1; + + for (j = 0; j < current_isolated->length; j++) + current_isolated->ppcls[j] = &pcls[runs[k].start+j]; + + run_end = runs[k].end; + + TRACE("{ [%i -- %i]",run_start, run_end); + + if (pcls[run_end] == BN) + run_end = previousValidChar(pcls, run_end, runs[k].start); + + while (run_end < uCount && (pcls[run_end] == RLI || pcls[run_end] == LRI || pcls[run_end] == FSI)) + { + j = k+1; +search: + while (j < run_count && pcls[runs[j].start] != PDI) j++; + if (j < run_count && runs[i].e != runs[j].e) + { + j++; + goto search; + } + + if (j != run_count) + { + int m; + int l = current_isolated->length; + + current_isolated->length += (runs[j].end - runs[j].start)+1; + for (m = 0; l < current_isolated->length; l++, m++) + current_isolated->ppcls[l] = &pcls[runs[j].start+m]; + + TRACE("[%i -- %i]",runs[j].start, runs[j].end); + + run_end = runs[j].end; + if (pcls[run_end] == BN) + run_end = previousValidChar(pcls, run_end, runs[i].start); + runs[j].start = -1; + k = j; + } + else + { + run_end = uCount; + break; + } + } + + type_fence = previousValidChar(pcls, run_start, -1); + + if (type_fence == -1) + current_isolated->sos = (baselevel > pLevel[run_start])?baselevel:pLevel[run_start]; + else + current_isolated->sos = (pLevel[type_fence] > pLevel[run_start])?pLevel[type_fence]:pLevel[run_start]; + + current_isolated->sos = EmbeddingDirection(current_isolated->sos); + + if (run_end == uCount) + current_isolated->eos = current_isolated->sos; + else + { + /* eos could be an BN */ + if ( pcls[run_end] == BN ) + { + real_end = previousValidChar(pcls, run_end, run_start-1); + if (real_end < run_start) + real_end = run_start; + } + else + real_end = run_end; + + type_fence = nextValidChar(pcls, run_end, uCount); + if (type_fence == uCount) + current_isolated->eos = (baselevel > pLevel[real_end])?baselevel:pLevel[real_end]; + else + current_isolated->eos = (pLevel[type_fence] > pLevel[real_end])?pLevel[type_fence]:pLevel[real_end]; + + current_isolated->eos = EmbeddingDirection(current_isolated->eos); + } + + list_add_tail(set, ¤t_isolated->entry); + TRACE(" } level %i {%s <--> %s}\n",current_isolated->e, debug_type[current_isolated->sos], debug_type[current_isolated->eos]); + } + i++; } } @@ -739,7 +951,9 @@ BOOL BIDI_DetermineLevels( { WORD *chartype; unsigned baselevel = 0; - INT j; + struct list IsolatingRuns; + IsolatedRun *iso_run, *next; + TRACE("%s, %d\n", debugstr_wn(lpString, uCount), uCount); chartype = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(WORD)); @@ -752,28 +966,38 @@ BOOL BIDI_DetermineLevels( baselevel = s->uBidiLevel; classify(lpString, chartype, uCount, c); - - for (j = 0; j < uCount; ++j) - switch(chartype[j]) - { - case B: - case S: - case WS: - case ON: chartype[j] = N; - default: continue; - } + if (TRACE_ON(bidi)) dump_types("Start ", chartype, 0, uCount); /* resolve explicit */ - resolveExplicit(baselevel, N, chartype, lpOutLevels, uCount, 0); + resolveExplicit(baselevel, chartype, lpOutLevels, uCount); + if (TRACE_ON(bidi)) dump_types("After Explicit", chartype, 0, uCount); - /* resolve weak */ - resolveWeak(baselevel, chartype, lpOutLevels, uCount); + /* X10/BD13: Computer Isolating runs */ + computeIsolatingRunsSet(baselevel, chartype, lpOutLevels, uCount, &IsolatingRuns); - /* resolve neutrals */ - resolveNeutrals(baselevel, chartype, lpOutLevels, uCount); + LIST_FOR_EACH_ENTRY_SAFE(iso_run, next, &IsolatingRuns, IsolatedRun, entry) + { + if (TRACE_ON(bidi)) iso_dump_types("Run", iso_run); + /* resolve weak */ + resolveWeak(iso_run); + if (TRACE_ON(bidi)) iso_dump_types("After Weak", iso_run); + + /* resolve neutrals */ + resolveNeutrals(iso_run); + if (TRACE_ON(bidi)) iso_dump_types("After Neutrals", iso_run); + + list_remove(&iso_run->entry); + HeapFree(GetProcessHeap(),0,iso_run); + } + + if (TRACE_ON(bidi)) dump_types("Before Implicit", chartype, 0, uCount); /* resolveImplicit */ - resolveImplicit(chartype, lpOutLevels, uCount); + resolveImplicit(chartype, lpOutLevels, 0, uCount-1); + + /* resolveResolvedLevels*/ + classify(lpString, chartype, uCount, c); + resolveResolved(baselevel, chartype, lpOutLevels, 0, uCount-1); HeapFree(GetProcessHeap(), 0, chartype); return TRUE; diff --git a/reactos/dll/win32/usp10/indicsyllable.c b/reactos/dll/win32/usp10/indicsyllable.c index 79ee0f6976e..c6beeb90436 100644 --- a/reactos/dll/win32/usp10/indicsyllable.c +++ b/reactos/dll/win32/usp10/indicsyllable.c @@ -1,6 +1,6 @@ /* Unicode Indic Syllabic Category */ -/* generated from http://www.unicode.org/Public/6.2.0/ucd/IndicSyllabicCategory.txt */ -/* and from http://www.unicode.org/Public/6.2.0/ucd/IndicMatraCategory.txt */ +/* generated from http://www.unicode.org/Public/6.3.0/ucd/IndicSyllabicCategory.txt */ +/* and from http://www.unicode.org/Public/6.3.0/ucd/IndicMatraCategory.txt */ /* DO NOT EDIT!! */ //#include "wine/unicode.h" diff --git a/reactos/dll/win32/usp10/linebreak.c b/reactos/dll/win32/usp10/linebreak.c index a7b4aee71f2..3a0bc1c0ca8 100644 --- a/reactos/dll/win32/usp10/linebreak.c +++ b/reactos/dll/win32/usp10/linebreak.c @@ -1,10 +1,10 @@ /* Unicode Line Break Properties */ -/* generated from http://www.unicode.org/Public/6.2.0/ucd/LineBreak.txt */ +/* generated from http://www.unicode.org/Public/6.3.0/ucd/LineBreak.txt */ /* DO NOT EDIT!! */ //#include "wine/unicode.h" -const unsigned short wine_linebreak_table[7056] = +const unsigned short wine_linebreak_table[7072] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0170, @@ -101,87 +101,87 @@ const unsigned short wine_linebreak_table[7056] = 0x05b0, 0x10d0, 0x05b0, 0x05b0, 0x10d0, 0x10e0, 0x05b0, 0x10f0, 0x05b0, 0x05b0, 0x05b0, 0x1100, 0x1100, 0x1110, 0x05b0, 0x1120, 0x1130, 0x1140, 0x1150, 0x1160, 0x1170, 0x1180, 0x1190, 0x11a0, - 0x11b0, 0x0ce0, 0x11c0, 0x11d0, 0x0870, 0x0580, 0x0580, 0x11e0, - 0x11f0, 0x1200, 0x1210, 0x05b0, 0x05b0, 0x1220, 0x1230, 0x1240, - 0x1250, 0x1240, 0x05b0, 0x05b0, 0x05b0, 0x1260, 0x05b0, 0x05b0, - 0x1270, 0x1280, 0x1290, 0x12a0, 0x12b0, 0x12c0, 0x12d0, 0x05b0, - 0x12e0, 0x12f0, 0x1300, 0x1310, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x1320, 0x1330, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1340, - 0x05b0, 0x05b0, 0x1350, 0x0870, 0x1360, 0x0870, 0x1370, 0x1370, - 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1370, 0x1380, - 0x1370, 0x1370, 0x1370, 0x1370, 0x1230, 0x1370, 0x1370, 0x1390, - 0x1370, 0x13a0, 0x13b0, 0x13c0, 0x13d0, 0x13e0, 0x13f0, 0x05b0, - 0x1400, 0x1410, 0x05b0, 0x1420, 0x1430, 0x05b0, 0x1440, 0x1450, - 0x05b0, 0x1460, 0x05b0, 0x1470, 0x1480, 0x1490, 0x14a0, 0x14b0, - 0x14c0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x14d0, 0x14e0, 0x14f0, - 0x1370, 0x1500, 0x05b0, 0x05b0, 0x1510, 0x05b0, 0x1520, 0x05b0, + 0x11b0, 0x0ce0, 0x11c0, 0x11d0, 0x11e0, 0x0580, 0x0580, 0x11f0, + 0x1200, 0x1210, 0x1220, 0x05b0, 0x05b0, 0x1230, 0x1240, 0x1250, + 0x1260, 0x1250, 0x05b0, 0x05b0, 0x05b0, 0x1270, 0x05b0, 0x05b0, + 0x1280, 0x1290, 0x12a0, 0x12b0, 0x12c0, 0x12d0, 0x12e0, 0x05b0, + 0x12f0, 0x1300, 0x1310, 0x1320, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x1330, 0x1340, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1350, + 0x05b0, 0x05b0, 0x1360, 0x0870, 0x1370, 0x0870, 0x1380, 0x1380, + 0x1380, 0x1380, 0x1380, 0x1380, 0x1380, 0x1380, 0x1380, 0x1390, + 0x1380, 0x1380, 0x1380, 0x1380, 0x1240, 0x1380, 0x1380, 0x13a0, + 0x1380, 0x13b0, 0x13c0, 0x13d0, 0x13e0, 0x13f0, 0x1400, 0x05b0, + 0x1410, 0x1420, 0x05b0, 0x1430, 0x1440, 0x05b0, 0x1450, 0x1460, + 0x05b0, 0x1470, 0x05b0, 0x1480, 0x1490, 0x14a0, 0x14b0, 0x14c0, + 0x14d0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x14e0, 0x14f0, 0x1500, + 0x1380, 0x1510, 0x05b0, 0x05b0, 0x1520, 0x05b0, 0x1530, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x1530, 0x1540, 0x05b0, 0x05b0, 0x05b0, 0x1550, 0x05b0, 0x1560, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0ce0, 0x1570, 0x0870, 0x0870, + 0x1540, 0x1550, 0x05b0, 0x05b0, 0x05b0, 0x1560, 0x05b0, 0x1570, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x0ce0, 0x1580, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x05b0, 0x05b0, 0x0850, 0x05b0, 0x05b0, 0x0850, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1580, 0x1590, - 0x05b0, 0x05b0, 0x0d70, 0x05b0, 0x05b0, 0x05b0, 0x15a0, 0x15b0, - 0x05b0, 0x1350, 0x15c0, 0x15c0, 0x15c0, 0x15c0, 0x0580, 0x0580, - 0x15d0, 0x15e0, 0x15f0, 0x1600, 0x0870, 0x0870, 0x0870, 0x0870, - 0x1610, 0x1620, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1340, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1630, 0x0870, 0x1640, - 0x1650, 0x1660, 0x1670, 0x1680, 0x1690, 0x1610, 0x16a0, 0x1610, - 0x16b0, 0x16c0, 0x16d0, 0x1610, 0x16a0, 0x1610, 0x16b0, 0x16e0, - 0x16f0, 0x1610, 0x1700, 0x1710, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1720, 0x1610, 0x1610, 0x1730, 0x1610, 0x1610, 0x1340, 0x1740, - 0x1610, 0x1720, 0x1610, 0x1610, 0x1750, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1720, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x1610, 0x1760, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, 0x1610, - 0x1770, 0x1610, 0x1610, 0x1610, 0x1780, 0x05b0, 0x05b0, 0x1070, - 0x1790, 0x05b0, 0x17a0, 0x0870, 0x05b0, 0x05b0, 0x1580, 0x17b0, - 0x05b0, 0x17c0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x17d0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1590, 0x15a0, + 0x05b0, 0x05b0, 0x0d70, 0x05b0, 0x05b0, 0x05b0, 0x15b0, 0x15c0, + 0x05b0, 0x1360, 0x15d0, 0x15d0, 0x15d0, 0x15d0, 0x0580, 0x0580, + 0x15e0, 0x15f0, 0x1600, 0x1610, 0x0870, 0x0870, 0x0870, 0x0870, + 0x1620, 0x1630, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1350, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1640, 0x0870, 0x1650, + 0x1660, 0x1670, 0x1680, 0x1690, 0x16a0, 0x1620, 0x16b0, 0x1620, + 0x16c0, 0x16d0, 0x16e0, 0x1620, 0x16b0, 0x1620, 0x16c0, 0x16f0, + 0x1700, 0x1620, 0x1710, 0x1720, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1730, 0x1620, 0x1620, 0x1740, 0x1620, 0x1620, 0x1350, 0x1750, + 0x1620, 0x1730, 0x1620, 0x1620, 0x1760, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1730, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x05b0, 0x05b0, 0x05b0, 0x05b0, + 0x1620, 0x1770, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, + 0x1780, 0x1620, 0x1620, 0x1620, 0x1790, 0x05b0, 0x05b0, 0x1070, + 0x17a0, 0x05b0, 0x17b0, 0x0870, 0x05b0, 0x05b0, 0x1590, 0x17c0, + 0x05b0, 0x17d0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x17e0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, - 0x0850, 0x17e0, 0x1360, 0x0870, 0x0870, 0x0870, 0x0870, 0x0b10, - 0x17f0, 0x05b0, 0x1800, 0x1810, 0x05b0, 0x05b0, 0x05b0, 0x1820, - 0x1830, 0x05b0, 0x05b0, 0x0fd0, 0x1840, 0x0ee0, 0x0580, 0x1850, - 0x07c0, 0x05b0, 0x1860, 0x05b0, 0x1870, 0x1880, 0x0d80, 0x1890, - 0x08b0, 0x05b0, 0x05b0, 0x18a0, 0x18b0, 0x18c0, 0x0870, 0x0870, - 0x05b0, 0x05b0, 0x18d0, 0x10b0, 0x18e0, 0x18f0, 0x0c10, 0x0f60, - 0x0c10, 0x0c10, 0x0c10, 0x0c10, 0x1900, 0x1910, 0x0770, 0x1920, - 0x1930, 0x1940, 0x15c0, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, - 0x0870, 0x0870, 0x0870, 0x0870, 0x05b0, 0x05b0, 0x1950, 0x0ee0, - 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, - 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, - 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, - 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, - 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, - 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, - 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, - 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, - 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, - 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, - 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, - 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, - 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, - 0x1980, 0x1960, 0x1970, 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, - 0x1980, 0x1990, 0x1980, 0x19a0, 0x1980, 0x1960, 0x1970, 0x1980, - 0x1990, 0x1980, 0x19b0, 0x0d90, 0x19c0, 0x0db0, 0x0db0, 0x19d0, - 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, - 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, 0x19e0, + 0x0850, 0x17f0, 0x1370, 0x0870, 0x0870, 0x0870, 0x0870, 0x0b10, + 0x1800, 0x05b0, 0x1810, 0x1820, 0x05b0, 0x05b0, 0x05b0, 0x1830, + 0x1840, 0x05b0, 0x05b0, 0x0fd0, 0x1850, 0x0ee0, 0x0580, 0x1860, + 0x07c0, 0x05b0, 0x1870, 0x05b0, 0x1880, 0x1890, 0x0d80, 0x18a0, + 0x08b0, 0x05b0, 0x05b0, 0x18b0, 0x18c0, 0x18d0, 0x0870, 0x0870, + 0x05b0, 0x05b0, 0x18e0, 0x10b0, 0x18f0, 0x1900, 0x0c10, 0x0f60, + 0x0c10, 0x0c10, 0x0c10, 0x0c10, 0x1910, 0x1920, 0x0770, 0x1930, + 0x1940, 0x1950, 0x15d0, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, + 0x0870, 0x0870, 0x0870, 0x0870, 0x05b0, 0x05b0, 0x1960, 0x0ee0, + 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, + 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, + 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, + 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, + 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, + 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, + 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, + 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, + 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, + 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, + 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, + 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, + 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, + 0x1990, 0x1970, 0x1980, 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, + 0x1990, 0x19a0, 0x1990, 0x19b0, 0x1990, 0x1970, 0x1980, 0x1990, + 0x19a0, 0x1990, 0x19c0, 0x0d90, 0x19d0, 0x0db0, 0x0db0, 0x19e0, + 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, + 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x19f0, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, 0x0870, - 0x1350, 0x19f0, 0x1a00, 0x1a10, 0x1a20, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1a30, 0x1a40, 0x05b0, 0x05b0, - 0x05b0, 0x05b0, 0x05b0, 0x1a50, 0x0870, 0x05b0, 0x05b0, 0x05b0, - 0x05b0, 0x1a60, 0x05b0, 0x05b0, 0x06b0, 0x0870, 0x0870, 0x1a70, - 0x0580, 0x1a80, 0x10b0, 0x1a90, 0x1aa0, 0x1ab0, 0x1ac0, 0x1100, - 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1ad0, - 0x1ae0, 0x1af0, 0x1610, 0x1b00, 0x1610, 0x1b10, 0x1b20, 0x1b30, - 0x05b0, 0x1b40, 0x05b0, 0x0850, 0x1b50, 0x1b60, 0x1b70, 0x1b80, + 0x1360, 0x1a00, 0x1a10, 0x1a20, 0x1a30, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1a40, 0x1a50, 0x05b0, 0x05b0, + 0x05b0, 0x05b0, 0x05b0, 0x1a60, 0x0870, 0x05b0, 0x05b0, 0x05b0, + 0x05b0, 0x1a70, 0x05b0, 0x05b0, 0x06b0, 0x0870, 0x0870, 0x1a80, + 0x0580, 0x1a90, 0x10b0, 0x1aa0, 0x1ab0, 0x1ac0, 0x1ad0, 0x1100, + 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x05b0, 0x1ae0, + 0x1af0, 0x1b00, 0x1620, 0x1b10, 0x1620, 0x1b20, 0x1b30, 0x1b40, + 0x05b0, 0x1b50, 0x05b0, 0x0850, 0x1b60, 0x1b70, 0x1b80, 0x1b90, /* values */ 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0022, 0x0003, 0x0001, 0x0001, 0x0002, 0x0004, 0x0004, @@ -246,7 +246,7 @@ const unsigned short wine_linebreak_table[7056] = 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x001d, 0x001d, 0x001d, 0x001b, 0x001b, 0x001b, 0x0019, 0x0019, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, - 0x0004, 0x0004, 0x0004, 0x0017, 0x0011, 0x0011, 0x0017, 0x0017, + 0x0004, 0x0004, 0x0004, 0x0017, 0x0004, 0x0011, 0x0017, 0x0017, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, 0x001c, @@ -571,8 +571,8 @@ const unsigned short wine_linebreak_table[7056] = 0x0016, 0x0016, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0022, 0x001d, 0x0022, 0x0022, 0x0022, 0x0022, 0x001d, 0x0022, 0x0022, 0x0022, - 0x000b, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0011, 0x0011, - 0x0011, 0x0011, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x000b, 0x001d, 0x001d, 0x001d, 0x001d, 0x0011, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x001d, 0x001d, 0x0011, 0x0011, 0x0024, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x001d, 0x0012, 0x0013, 0x0024, 0x001d, 0x0024, 0x0024, 0x0024, 0x0024, 0x001d, 0x001d, 0x001d, @@ -580,7 +580,9 @@ const unsigned short wine_linebreak_table[7056] = 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001b, 0x001a, - 0x001a, 0x001a, 0x001a, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, + 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x001a, 0x0004, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001d, 0x001d, 0x001d, 0x001b, 0x001d, 0x0024, 0x001d, 0x001d, @@ -723,13 +725,13 @@ const unsigned short wine_linebreak_table[7056] = 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x0011, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0011, 0x0011, 0x0011, 0x0011, - 0x001e, 0x0013, 0x0013, 0x001e, 0x001e, 0x0016, 0x001e, 0x001e, + 0x0022, 0x0013, 0x0013, 0x001e, 0x001e, 0x0016, 0x001e, 0x001e, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x001e, 0x001e, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0012, 0x0013, 0x0016, 0x0012, 0x0013, 0x0013, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, - 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, + 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0004, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x0016, 0x0016, 0x001e, 0x001e, 0x001e, 0x0011, 0x0027, 0x001e, 0x0027, 0x001e, 0x0027, 0x001e, 0x0027, 0x001e, 0x0027, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, 0x001e, diff --git a/reactos/dll/win32/usp10/shaping.c b/reactos/dll/win32/usp10/shaping.c index be416e5a2f2..4494943bfa7 100644 --- a/reactos/dll/win32/usp10/shaping.c +++ b/reactos/dll/win32/usp10/shaping.c @@ -1,10 +1,10 @@ /* Unicode Arabic shaping */ -/* generated from http://www.unicode.org/Public/6.2.0/ucd/ArabicShaping.txt */ +/* generated from http://www.unicode.org/Public/6.3.0/ucd/ArabicShaping.txt */ /* DO NOT EDIT!! */ //#include "wine/unicode.h" -const unsigned short wine_shaping_table[2752] = +const unsigned short wine_shaping_table[2800] = { /* level 1 offsets */ 0x0100, 0x0110, 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, @@ -76,42 +76,42 @@ const unsigned short wine_shaping_table[2752] = 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0820, 0x0340, 0x0820, 0x0340, 0x0610, 0x0340, 0x0610, 0x0340, 0x0340, 0x0340, 0x0830, 0x0840, 0x0850, 0x0340, 0x0340, - 0x0860, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0870, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0880, 0x0890, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0860, 0x0340, 0x0530, 0x0530, 0x0530, 0x0530, 0x0530, 0x0870, + 0x0880, 0x0530, 0x0890, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x08a0, 0x08b0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x08a0, 0x0340, 0x0340, 0x0340, 0x08b0, 0x08c0, 0x08d0, + 0x0340, 0x08c0, 0x0340, 0x0340, 0x0340, 0x08d0, 0x08e0, 0x08f0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x08e0, 0x0340, 0x0340, 0x08f0, 0x06b0, 0x0340, 0x0900, 0x08e0, - 0x0910, 0x0340, 0x0920, 0x0340, 0x0340, 0x0340, 0x0930, 0x0910, - 0x0340, 0x0340, 0x0940, 0x0950, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0960, 0x0970, 0x0980, + 0x0900, 0x0340, 0x0340, 0x0910, 0x06b0, 0x0340, 0x0920, 0x0900, + 0x0930, 0x0340, 0x0940, 0x0340, 0x0340, 0x0340, 0x0950, 0x0930, + 0x0340, 0x0340, 0x0960, 0x0970, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0980, 0x0990, 0x09a0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0360, 0x0360, 0x0990, 0x0940, - 0x09a0, 0x0340, 0x09b0, 0x0340, 0x0340, 0x0340, 0x09c0, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0360, 0x0360, 0x09b0, 0x0960, + 0x09c0, 0x0340, 0x09d0, 0x0340, 0x0340, 0x0340, 0x09e0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0360, 0x0360, 0x0510, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0910, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0930, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0360, 0x0360, - 0x0340, 0x0340, 0x09d0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x09e0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x09f0, - 0x0340, 0x0490, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0910, - 0x0a00, 0x0340, 0x06f0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0980, 0x0340, 0x0360, 0x0910, - 0x0340, 0x0340, 0x0a10, 0x0340, 0x0a20, 0x0910, 0x0340, 0x0340, - 0x05d0, 0x0340, 0x0340, 0x0a30, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0a40, 0x0a50, 0x0a60, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0a70, 0x0620, 0x0340, 0x0a80, 0x06a0, + 0x0340, 0x0340, 0x09f0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0a00, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0a10, + 0x0340, 0x0490, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0930, + 0x0a20, 0x0340, 0x06f0, 0x0340, 0x0530, 0x0530, 0x0530, 0x0a30, + 0x0340, 0x0340, 0x0340, 0x0340, 0x09a0, 0x0340, 0x0360, 0x0930, + 0x0340, 0x0340, 0x0a40, 0x0340, 0x0a50, 0x0930, 0x0340, 0x0340, + 0x05d0, 0x0340, 0x0340, 0x0a60, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0a70, 0x0a80, 0x0a90, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0aa0, 0x0620, 0x0340, 0x0ab0, 0x06a0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0a90, 0x0340, - 0x0340, 0x0aa0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0ac0, 0x0340, + 0x0340, 0x0ad0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0360, 0x0340, 0x0990, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, + 0x0360, 0x0340, 0x09b0, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0490, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, - 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0ab0, + 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0340, 0x0ae0, /* values */ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, @@ -128,7 +128,7 @@ const unsigned short wine_shaping_table[2752] = 0x0000, 0x0001, 0x0001, 0x0000, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, - 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0104, 0x0000, 0x0202, 0x0202, 0x0302, 0x0202, 0x0104, 0x0202, 0x0404, 0x0502, 0x0404, 0x0404, 0x0604, 0x0604, 0x0604, 0x0702, 0x0702, 0x0802, 0x0802, 0x0904, 0x0904, 0x0a04, 0x0a04, 0x0b04, @@ -277,16 +277,20 @@ const unsigned short wine_shaping_table[2752] = 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, + 0x0000, 0x0000, 0x0005, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, 0x0004, + 0x0004, 0x0001, 0x0004, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, - 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0001, 0x0000, 0x0001, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, @@ -331,6 +335,8 @@ const unsigned short wine_shaping_table[2752] = 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0004, 0x0004, 0x0003, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, diff --git a/reactos/dll/win32/usp10/usp10.c b/reactos/dll/win32/usp10/usp10.c index 56a74910d16..406ad1c0ee5 100644 --- a/reactos/dll/win32/usp10/usp10.c +++ b/reactos/dll/win32/usp10/usp10.c @@ -1381,7 +1381,7 @@ static HRESULT _ItemizeInternal(const WCHAR *pwcInChars, int cInChars, else { BOOL inNumber = FALSE; - static WCHAR math_punc[] = {'#','$','%','+',',','-','.','/',':',0x2212, 0x2044, 0x00a0,0}; + static const WCHAR math_punc[] = {'#','$','%','+',',','-','.','/',':',0x2212, 0x2044, 0x00a0,0}; strength = heap_alloc_zero(cInChars * sizeof(WORD)); if (!strength) diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index f6940fb9be1..4c67a396d54 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -195,7 +195,7 @@ reactos/dll/win32/unicows # Synced to Wine-1.3.32 (Win9x only, why do w reactos/dll/win32/updspapi # Synced to Wine-1.7.1 reactos/dll/win32/url # Synced to Wine-1.7.1 reactos/dll/win32/urlmon # Synced to Wine-1.7.1 -reactos/dll/win32/usp10 # Synced to Wine-1.7.1 +reactos/dll/win32/usp10 # Synced to Wine-1.7.14 reactos/dll/win32/uxtheme # Forked reactos/dll/win32/vbscript # Synced to Wine-1.7.1 reactos/dll/win32/version # Synced to Wine-1.7.1 From a509bf406e515790e864affdf441e8e028e173e1 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 20 Mar 2014 02:10:07 +0000 Subject: [PATCH 131/419] [Usp10] - Sync to Wine 1.7.14. svn path=/trunk/; revision=62536 --- rostests/winetests/usp10/testlist.c | 5 ++++- rostests/winetests/usp10/usp10.c | 27 +++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/rostests/winetests/usp10/testlist.c b/rostests/winetests/usp10/testlist.c index 9597826cee6..99ee3a360ec 100644 --- a/rostests/winetests/usp10/testlist.c +++ b/rostests/winetests/usp10/testlist.c @@ -1,4 +1,7 @@ -/* Automatically generated file; DO NOT EDIT!! */ +/* Automatically generated by make depend; DO NOT EDIT!! */ + +#define WIN32_LEAN_AND_MEAN +#include #define STANDALONE #include diff --git a/rostests/winetests/usp10/usp10.c b/rostests/winetests/usp10/usp10.c index 929ce23bf9d..afb7d1a674f 100644 --- a/rostests/winetests/usp10/usp10.c +++ b/rostests/winetests/usp10/usp10.c @@ -828,10 +828,9 @@ typedef struct tagRangeP { LOGFONTA lf; } fontEnumParam; -static int CALLBACK enumFontProc( const LOGFONT *lpelfe, const TEXTMETRIC *lpntme, - DWORD FontType, LPARAM lParam) +static int CALLBACK enumFontProc( const LOGFONTA *lpelfe, const TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam ) { - NEWTEXTMETRICEX *ntme = (NEWTEXTMETRICEX*)lpntme; + NEWTEXTMETRICEXA *ntme = (NEWTEXTMETRICEXA*)lpntme; fontEnumParam *rp = (fontEnumParam*) lParam; int idx = 0; DWORD i; @@ -853,7 +852,7 @@ static int CALLBACK enumFontProc( const LOGFONT *lpelfe, const TEXTMETRIC *lpntm if (ntme->ntmFontSig.fsUsb[idx] & mask) { - memcpy(&(rp->lf),lpelfe,sizeof(LOGFONT)); + memcpy(&(rp->lf),lpelfe,sizeof(LOGFONTA)); return 0; } return 1; @@ -865,7 +864,7 @@ static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, co fontEnumParam lParam; lParam.range = range; - memset(&lParam.lf,0,sizeof(LOGFONT)); + memset(&lParam.lf,0,sizeof(LOGFONTA)); *hfont = NULL; if (recommended) @@ -884,7 +883,7 @@ static int _find_font_for_range(HDC hdc, const CHAR *recommended, BYTE range, co if (!*hfont) { - memset(&lParam.lf,0,sizeof(LOGFONT)); + memset(&lParam.lf,0,sizeof(LOGFONTA)); lParam.lf.lfCharSet = DEFAULT_CHARSET; if (!EnumFontFamiliesExA(hdc, &lParam.lf, enumFontProc, (LPARAM)&lParam, 0) && lParam.lf.lfFaceName[0]) @@ -1812,10 +1811,10 @@ static void test_ScriptGetCMap(HDC hdc, unsigned short pwOutGlyphs[256]) struct enum_font_data { int total; - ENUMLOGFONT elf[MAX_ENUM_FONTS]; + ENUMLOGFONTA elf[MAX_ENUM_FONTS]; }; -static INT CALLBACK enum_bitmap_font_proc(const LOGFONT *lf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK enum_bitmap_font_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { struct enum_font_data *efnd = (struct enum_font_data *)lParam; @@ -1823,7 +1822,7 @@ static INT CALLBACK enum_bitmap_font_proc(const LOGFONT *lf, const TEXTMETRIC *n if (efnd->total < MAX_ENUM_FONTS) { - efnd->elf[efnd->total++] = *(ENUMLOGFONT*)lf; + efnd->elf[efnd->total++] = *(ENUMLOGFONTA*)lf; } else trace("enum tests invalid; you have more than %d fonts\n", MAX_ENUM_FONTS); @@ -1831,7 +1830,7 @@ static INT CALLBACK enum_bitmap_font_proc(const LOGFONT *lf, const TEXTMETRIC *n return 1; } -static INT CALLBACK enum_truetype_proc(const LOGFONT *lf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK enum_truetype_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { struct enum_font_data *efnd = (struct enum_font_data *)lParam; @@ -1839,7 +1838,7 @@ static INT CALLBACK enum_truetype_proc(const LOGFONT *lf, const TEXTMETRIC *ntm, if (efnd->total < MAX_ENUM_FONTS) { - efnd->elf[efnd->total++] = *(ENUMLOGFONT*)lf; + efnd->elf[efnd->total++] = *(ENUMLOGFONTA*)lf; } else trace("enum tests invalid; you have more than %d fonts\n", MAX_ENUM_FONTS); @@ -1853,7 +1852,7 @@ static void test_ScriptGetFontProperties(HDC hdc) SCRIPT_CACHE psc,old_psc; SCRIPT_FONTPROPERTIES sfp; HFONT font, oldfont; - LOGFONT lf; + LOGFONTA lf; struct enum_font_data efnd; TEXTMETRICA tmA; WORD gi[3]; @@ -1937,7 +1936,7 @@ static void test_ScriptGetFontProperties(HDC hdc) for (i = 0; i < efnd.total; i++) { lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName); - font = CreateFontIndirect(&lf); + font = CreateFontIndirectA(&lf); oldfont = SelectObject(hdc, font); sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES); @@ -1978,7 +1977,7 @@ static void test_ScriptGetFontProperties(HDC hdc) for (i = 0; i < efnd.total; i++) { lstrcpyA(lf.lfFaceName, (char *)efnd.elf[i].elfFullName); - font = CreateFontIndirect(&lf); + font = CreateFontIndirectA(&lf); oldfont = SelectObject(hdc, font); sfp.cBytes = sizeof(SCRIPT_FONTPROPERTIES); From 992f574ae35a0acfe061ffcec572f36de7864931 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 21 Mar 2014 07:24:03 +0000 Subject: [PATCH 132/419] [PSDK] - Fix GCC version of FIELD_OFFSET in ntdef.h svn path=/trunk/; revision=62538 --- reactos/include/psdk/ntdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/include/psdk/ntdef.h b/reactos/include/psdk/ntdef.h index acb7330b149..4b419969be3 100644 --- a/reactos/include/psdk/ntdef.h +++ b/reactos/include/psdk/ntdef.h @@ -199,7 +199,7 @@ #ifndef __GNUC__ #define FIELD_OFFSET(Type, Field) ((LONG)(LONG_PTR)&(((Type*) 0)->Field)) #else -#define FIELD_OFFSET(Type, Field) __builtin_offsetof(Type, Field) +#define FIELD_OFFSET(Type, Field) ((LONG)__builtin_offsetof(Type, Field)) #endif /* Returns the type's alignment */ From 833db14fa788b632221bf4f748a889e3ae3953d0 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 21 Mar 2014 11:23:47 +0000 Subject: [PATCH 133/419] [COM_APITEST] - Add MergedFolder and AugmentedShellFolder classes/interfaces svn path=/trunk/; revision=62540 --- rostests/apitests/com/browseui.c | 22 ++++++++++++++++++++++ rostests/apitests/com/com_apitest.c | 2 ++ rostests/apitests/com/com_apitest.h | 5 +++++ rostests/apitests/com/shell32.c | 16 ++++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/rostests/apitests/com/browseui.c b/rostests/apitests/com/browseui.c index 3d8dde21cd2..e276aebfe51 100644 --- a/rostests/apitests/com/browseui.c +++ b/rostests/apitests/com/browseui.c @@ -34,6 +34,28 @@ static const CLASS_AND_INTERFACES ExpectedInterfaces[] = { 0x18, &IID_IShellService }, } }, + { + ID_NAME(CLSID_AugmentedShellFolder), + { + { 0x0, &IID_IAugmentedShellFolder2 }, + { 0x0, &IID_IAugmentedShellFolder }, + { 0x0, &IID_IShellFolder }, + { 0x0, &IID_IUnknown }, + { 0x4, &IID_IShellService }, + } + }, + { + ID_NAME(CLSID_AugmentedShellFolder2), + { + { 0x0, &IID_IAugmentedShellFolder2 }, + { 0x0, &IID_IAugmentedShellFolder }, + { 0x0, &IID_IShellFolder }, + { 0x0, &IID_IUnknown }, + { 0x4, &IID_IShellFolder2 }, + { 0x8, &IID_IShellService }, + { 0x10, &IID_IDropTarget }, + } + }, { ID_NAME(CLSID_BandProxy), { diff --git a/rostests/apitests/com/com_apitest.c b/rostests/apitests/com/com_apitest.c index 10467de2e37..2561da2889c 100644 --- a/rostests/apitests/com/com_apitest.c +++ b/rostests/apitests/com/com_apitest.c @@ -40,6 +40,8 @@ static KNOWN_INTERFACE KnownInterfaces[] = ID_NAME(IID_IAddressBarParser), ID_NAME(IID_IAddressBand), ID_NAME(IID_IAddressEditBox), + ID_NAME(IID_IAugmentedShellFolder), + ID_NAME(IID_IAugmentedShellFolder2), ID_NAME(IID_IAutoComplete), ID_NAME(IID_IAutoComplete2), ID_NAME(IID_IBandNavigate), diff --git a/rostests/apitests/com/com_apitest.h b/rostests/apitests/com/com_apitest.h index 47bf156f026..e2484912db2 100644 --- a/rostests/apitests/com/com_apitest.h +++ b/rostests/apitests/com/com_apitest.h @@ -65,6 +65,8 @@ TestClasses( // TODO: fix our headers... we really shouldn't need these here DEFINE_GUID(CLSID_ActiveDesktop, 0x75048700, 0xef1f, 0x11d0, 0x98, 0x88, 0x00, 0x60, 0x97, 0xde, 0xac, 0xf9); +DEFINE_GUID(CLSID_AugmentedShellFolder, 0x91ea3f8b, 0xc99b, 0x11d0, 0x98, 0x15, 0x00, 0xc0, 0x4f, 0xd9, 0x19, 0x72); +DEFINE_GUID(CLSID_AugmentedShellFolder2, 0x6413ba2c, 0xb461, 0x11d1, 0xa1, 0x8a, 0x08, 0x00, 0x36, 0xb1, 0x1a, 0x03); DEFINE_GUID(CLSID_CopyToMenu, 0xC2FBB630, 0x2971, 0x11D1, 0xA1, 0x8C, 0x00, 0xC0, 0x4F, 0xD7, 0x5D, 0x13); DEFINE_GUID(CLSID_DeskMovr, 0x72267F6A, 0xA6F9, 0x11D0, 0xBC, 0x94, 0x00, 0xC0, 0x4F, 0xB6, 0x78, 0x63); DEFINE_GUID(CLSID_FadeTask, 0x7EB5FBE4, 0x2100, 0x49E6, 0x85, 0x93, 0x17, 0xE1, 0x30, 0x12, 0x2F, 0x91); @@ -73,6 +75,7 @@ DEFINE_GUID(CLSID_FolderItem, 0xfef10fa2, 0x355e, 0x4e06, 0x93, 0x8 DEFINE_GUID(CLSID_FolderItemsFDF, 0x53c74826, 0xab99, 0x4d33, 0xac, 0xa4, 0x31, 0x17, 0xf5, 0x1d, 0x37, 0x88); DEFINE_GUID(CLSID_FolderViewHost, 0x20b1cb23, 0x6968, 0x4eb9, 0xb7, 0xd4, 0xa6, 0x6d, 0x00, 0xd0, 0x7c, 0xee); DEFINE_GUID(CLSID_ISFBand, 0xD82BE2B0, 0x5764, 0x11D0, 0xA9, 0x6E, 0x00, 0xC0, 0x4F, 0xD7, 0x05, 0xA2); +DEFINE_GUID(CLSID_MergedFolder, 0x26fdc864, 0xbe88, 0x46e7, 0x92, 0x35, 0x03, 0x2d, 0x8e, 0xa5, 0x16, 0x2e); DEFINE_GUID(CLSID_MenuDeskBar, 0xECD4FC4F, 0x521C, 0x11D0, 0xB7, 0x92, 0x00, 0xA0, 0xC9, 0x03, 0x12, 0xE1); DEFINE_GUID(CLSID_MenuToolbarBase, 0x40b96610, 0xb522, 0x11d1, 0xb3, 0xb4, 0x00, 0xaa, 0x00, 0x6e, 0xfd, 0xe7); DEFINE_GUID(CLSID_MoveToMenu, 0xC2FBB631, 0x2971, 0x11D1, 0xA1, 0x8C, 0x00, 0xC0, 0x4F, 0xD7, 0x5D, 0x13); @@ -89,6 +92,8 @@ DEFINE_GUID(IID_IAccessor, 0x0c733a8c, 0x2a1c, 0x11ce, 0xad, 0xe DEFINE_GUID(IID_IActiveDesktop, 0xf490eb00, 0x1240, 0x11d1, 0x98, 0x88, 0x00, 0x60, 0x97, 0xde, 0xac, 0xf9); DEFINE_GUID(IID_IActiveDesktopP, 0x52502ee0, 0xec80, 0x11d0, 0x89, 0xab, 0x00, 0xc0, 0x4f, 0xc2, 0x97, 0x2d); DEFINE_GUID(IID_IAddressBarParser, 0xc9d81948, 0x443a, 0x40c7, 0x94, 0x5c, 0x5e, 0x17, 0x1b, 0x8c, 0x66, 0xb4); +DEFINE_GUID(IID_IAugmentedShellFolder, 0x91ea3f8c, 0xc99b, 0x11d0, 0x98, 0x15, 0x00, 0xc0, 0x4f, 0xd9, 0x19, 0x72); +DEFINE_GUID(IID_IAugmentedShellFolder2, 0x8db3b3f4, 0x6cfe, 0x11d1, 0x8a, 0xe9, 0x00, 0xc0, 0x4f, 0xd9, 0x18, 0xd0); DEFINE_GUID(IID_IBrowserFrameOptions, 0x10df43c8, 0x1dbe, 0x11d3, 0x8b, 0x34, 0x00, 0x60, 0x97, 0xdf, 0x5b, 0xd4); DEFINE_GUID(IID_IContext, 0x000001c0, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); DEFINE_GUID(IID_IDVGetEnum, 0x70f55181, 0x5fea, 0x4900, 0xb6, 0xb8, 0x73, 0x43, 0xcb, 0x0a, 0x34, 0x8c); diff --git a/rostests/apitests/com/shell32.c b/rostests/apitests/com/shell32.c index 0f0ea29d8b0..5b824332d82 100644 --- a/rostests/apitests/com/shell32.c +++ b/rostests/apitests/com/shell32.c @@ -208,6 +208,22 @@ static const CLASS_AND_INTERFACES ExpectedInterfaces[] = } }, #endif + { + ID_NAME(CLSID_MergedFolder), + { + { -0x8, &IID_IShellFolder2 }, + { -0x4, &IID_IStorage }, + { 0x0, &IID_IAugmentedShellFolder2 }, + { 0x0, &IID_IAugmentedShellFolder }, + { 0x0, &IID_IShellFolder }, + { 0x0, &IID_IUnknown }, + { 0x4, &IID_IShellService }, + { 0xc, &IID_IPersistFolder2 }, + { 0xc, &IID_IPersistFolder }, + { 0xc, &IID_IPersist }, + { 0x10, &IID_IPersistPropertyBag }, + } + }, { ID_NAME(CLSID_MoveToMenu), { From 2936e38c77ca36a0055af263f9e7dfa41a9930f3 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Fri, 21 Mar 2014 11:45:30 +0000 Subject: [PATCH 134/419] [COM_APITEST] - Verify interfaces against HKLM\Software\Classes\Interface svn path=/trunk/; revision=62541 --- rostests/apitests/com/com_apitest.c | 485 ++++++++++++++++------------ rostests/apitests/com/testlist.c | 2 + 2 files changed, 282 insertions(+), 205 deletions(-) diff --git a/rostests/apitests/com/com_apitest.c b/rostests/apitests/com/com_apitest.c index 2561da2889c..79fa1533e4b 100644 --- a/rostests/apitests/com/com_apitest.c +++ b/rostests/apitests/com/com_apitest.c @@ -22,219 +22,221 @@ typedef struct _KNOWN_INTERFACE { const IID *iid; PCSTR name; + PCWSTR wname; + BOOLEAN noreg; } KNOWN_INTERFACE; typedef const KNOWN_INTERFACE *PCKNOWN_INTERFACE; #undef ID_NAME -#define ID_NAME(c) { &c, #c } +#define ID_NAME(c) &c, #c, L ## #c static KNOWN_INTERFACE KnownInterfaces[] = { - ID_NAME(IID_IACList), - ID_NAME(IID_IACList2), - ID_NAME(IID_IADesktopP2), - ID_NAME(IID_IAccessible), - ID_NAME(IID_IAccessControl), - ID_NAME(IID_IAccessor), - ID_NAME(IID_IActiveDesktop), - ID_NAME(IID_IActiveDesktopP), - ID_NAME(IID_IAddressBarParser), - ID_NAME(IID_IAddressBand), - ID_NAME(IID_IAddressEditBox), - ID_NAME(IID_IAugmentedShellFolder), - ID_NAME(IID_IAugmentedShellFolder2), - ID_NAME(IID_IAutoComplete), - ID_NAME(IID_IAutoComplete2), - ID_NAME(IID_IBandNavigate), - ID_NAME(IID_IBandProxy), - ID_NAME(IID_IBandSite), - ID_NAME(IID_IBandSiteHelper), - ID_NAME(IID_IBanneredBar), - ID_NAME(IID_IBindCtx), - ID_NAME(IID_IBrowserFrameOptions), - ID_NAME(IID_IBrowserService), - ID_NAME(IID_IBrowserService2), - ID_NAME(IID_IBrowserService3), - ID_NAME(IID_IClassFactory), - ID_NAME(IID_IClassFactory2), - ID_NAME(IID_IClassFactory3), - ID_NAME(IID_IClientSecurity), - ID_NAME(IID_IComThreadingInfo), - ID_NAME(IID_IContext), - ID_NAME(IID_IContextMenu), - ID_NAME(IID_IContextMenu2), - ID_NAME(IID_IContextMenu3), - ID_NAME(IID_IContextMenuCB), - ID_NAME(IID_IContextMenuSite), - ID_NAME(IID_IContinue), - ID_NAME(IID_IDVGetEnum), - ID_NAME(IID_IDataObject), - ID_NAME(IID_IDefViewID), - ID_NAME(IID_IDefViewFrame), - ID_NAME(IID_IDefViewFrame3), - ID_NAME(IID_IDefViewFrameGroup), - ID_NAME(IID_IDefViewSafety), - ID_NAME(IID_IDefViewScript), - ID_NAME(IID_IDeskBand), - ID_NAME(IID_IDeskBandEx), - ID_NAME(IID_IDeskBar), - ID_NAME(IID_IDeskBarClient), - ID_NAME(IID_IDeskMovr), - ID_NAME(IID_IDispatch), - ID_NAME(IID_IDockingWindow), - ID_NAME(IID_IDockingWindowFrame), - ID_NAME(IID_IDockingWindowSite), - ID_NAME(IID_IDocViewSite), - ID_NAME(IID_IDragSourceHelper), - ID_NAME(IID_IDropSource), - ID_NAME(IID_IDropTarget), - ID_NAME(IID_IDropTargetHelper), - ID_NAME(IID_IEnumExtraSearch), - ID_NAME(IID_IEnumGUID), - ID_NAME(IID_IEnumIDList), - ID_NAME(IID_IEnumShellItems), - ID_NAME(IID_IEnumString), - ID_NAME(IID_IEnumUnknown), - ID_NAME(IID_IEnumVARIANT), - ID_NAME(IID_IErrorLog), - ID_NAME(IID_IExplorerToolbar), - ID_NAME(IID_IExtractIconA), - ID_NAME(IID_IExtractIconW), - ID_NAME(IID_IExtractImage), - ID_NAME(IID_IExtractImage2), - ID_NAME(IID_IFileDialog), - ID_NAME(IID_IFileDialog2), - ID_NAME(IID_IFileSearchBand), - ID_NAME(IID_IFolderBandPriv), - ID_NAME(IID_IFolderFilter), - ID_NAME(IID_IFolderFilterSite), - ID_NAME(IID_IFolderView), - ID_NAME(IID_IFolderView2), - ID_NAME(IID_IFolderViewOC), - ID_NAME(IID_IFolderViewSettings), - ID_NAME(IID_IGlobalFolderSettings), - ID_NAME(IID_IInitializeObject), - ID_NAME(IID_IInputObject), - ID_NAME(IID_IInputObjectSite), - ID_NAME(IID_IInternalUnknown), - ID_NAME(IID_IMarshal), - ID_NAME(IID_IMenuBand), - ID_NAME(IID_IMenuPopup), - ID_NAME(IID_IMoniker), - ID_NAME(IID_IMultiMonitorDockingSite), - ID_NAME(IID_IMultiQI), - ID_NAME(IID_INamespaceProxy), - ID_NAME(IID_INameSpaceTreeControl), - ID_NAME(IID_INSCTree), - ID_NAME(IID_INSCTree2), - ID_NAME(IID_IObjMgr), - ID_NAME(IID_IObjectSafety), - ID_NAME(IID_IObjectWithSite), - ID_NAME(IID_IOleCommandTarget), - ID_NAME(IID_IOleInPlaceActiveObject), - ID_NAME(IID_IOleInPlaceFrame), - ID_NAME(IID_IOleInPlaceObject), - ID_NAME(IID_IOleInPlaceObjectWindowless), - ID_NAME(IID_IOleInPlaceSite), - ID_NAME(IID_IOleInPlaceSiteEx), - ID_NAME(IID_IOleInPlaceSiteWindowless), - ID_NAME(IID_IOleInPlaceUIWindow), - ID_NAME(IID_IOleObject), - ID_NAME(IID_IOleWindow), - ID_NAME(IID_IPersist), - ID_NAME(IID_IPersistFile), - ID_NAME(IID_IPersistFolder), - ID_NAME(IID_IPersistFolder2), - ID_NAME(IID_IPersistFolder3), - ID_NAME(IID_IPersistHistory), - ID_NAME(IID_IPersistIDList), - ID_NAME(IID_IPersistMemory), - ID_NAME(IID_IPersistPropertyBag), - ID_NAME(IID_IPersistPropertyBag2), - ID_NAME(IID_IPersistStorage), - ID_NAME(IID_IPersistStream), - ID_NAME(IID_IPersistStreamInit), - ID_NAME(IID_IProgressDialog), - ID_NAME(IID_IPropertyBag), - ID_NAME(IID_IPropertyBag2), - ID_NAME(IID_IQueryAssociations), - ID_NAME(IID_IQueryInfo), - ID_NAME(IID_IRegTreeOptions), - ID_NAME(IID_IRunnableObject), - ID_NAME(IID_IServerSecurity), - ID_NAME(IID_IServiceProvider), - ID_NAME(IID_ISFHelper), - ID_NAME(IID_IShellBrowser), - ID_NAME(IID_IShellBrowserService), - ID_NAME(IID_IShellChangeNotify), - ID_NAME(IID_IShellDesktopTray), - ID_NAME(IID_IShellDispatch), - ID_NAME(IID_IShellDispatch2), - ID_NAME(IID_IShellDispatch3), - ID_NAME(IID_IShellDispatch4), - ID_NAME(IID_IShellDispatch5), - ID_NAME(IID_IShellExtInit), - ID_NAME(IID_IShellPropSheetExt), - ID_NAME(IID_IShellIconOverlayIdentifier), - ID_NAME(IID_IShellFolder), - ID_NAME(IID_IShellFolder2), - ID_NAME(IID_IShellFolderBand), - ID_NAME(IID_IShellFolderView), - ID_NAME(IID_IShellFolderViewCB), - ID_NAME(IID_IShellFolderViewDual), - ID_NAME(IID_IShellFolderViewDual2), - ID_NAME(IID_IShellIcon), - ID_NAME(IID_IShellItem), - ID_NAME(IID_IShellItem2), - ID_NAME(IID_IShellItemArray), - ID_NAME(IID_IShellItemFilter), - ID_NAME(IID_IShellLinkA), - ID_NAME(IID_IShellLinkDual), - ID_NAME(IID_IShellLinkDual2), - ID_NAME(IID_IShellLinkW), - ID_NAME(IID_IShellMenu), - ID_NAME(IID_IShellMenu2), - ID_NAME(IID_IShellMenuAcc), - ID_NAME(IID_IShellMenuCallback), - ID_NAME(IID_IShellNameSpace), - ID_NAME(IID_IShellService), - ID_NAME(IID_IShellView), - ID_NAME(IID_IShellView2), - ID_NAME(IID_IShellView3), - ID_NAME(IID_IShellWindows), - ID_NAME(IID_IStorage), - ID_NAME(IID_IStream), - ID_NAME(IID_ISurrogate), - ID_NAME(IID_ISynchronize), - ID_NAME(IID_ISynchronizeContainer), - ID_NAME(IID_ISynchronizeEvent), - ID_NAME(IID_ISynchronizeHandle), - ID_NAME(IID_ITaskbarList), - ID_NAME(IID_ITaskbarList2), - ID_NAME(IID_ITrackShellMenu), - ID_NAME(IID_ITrayPriv), - ID_NAME(IID_ITrayPriv2), - ID_NAME(IID_IUnknown), - ID_NAME(IID_IViewObject), - ID_NAME(IID_IViewObject2), - ID_NAME(IID_IViewObjectEx), - ID_NAME(IID_IWinEventHandler), + { ID_NAME(IID_IACList), TRUE }, + { ID_NAME(IID_IACList2), TRUE }, + { ID_NAME(IID_IADesktopP2), TRUE }, + { ID_NAME(IID_IAccessible) }, + { ID_NAME(IID_IAccessControl), TRUE }, + { ID_NAME(IID_IAccessor) }, + { ID_NAME(IID_IActiveDesktop), TRUE }, + { ID_NAME(IID_IActiveDesktopP), TRUE }, + { ID_NAME(IID_IAddressBarParser), TRUE }, + { ID_NAME(IID_IAddressBand), TRUE }, + { ID_NAME(IID_IAddressEditBox), TRUE }, + { ID_NAME(IID_IAugmentedShellFolder), TRUE }, + { ID_NAME(IID_IAugmentedShellFolder2), TRUE }, + { ID_NAME(IID_IAutoComplete), TRUE }, + { ID_NAME(IID_IAutoComplete2), TRUE }, + { ID_NAME(IID_IBandNavigate), TRUE }, + { ID_NAME(IID_IBandProxy), TRUE }, + { ID_NAME(IID_IBandSite) }, + { ID_NAME(IID_IBandSiteHelper), TRUE }, + { ID_NAME(IID_IBanneredBar), TRUE }, + { ID_NAME(IID_IBindCtx) }, + { ID_NAME(IID_IBrowserFrameOptions), TRUE }, + { ID_NAME(IID_IBrowserService) }, + { ID_NAME(IID_IBrowserService2), TRUE }, + { ID_NAME(IID_IBrowserService3), TRUE }, + { ID_NAME(IID_IClassFactory) }, + { ID_NAME(IID_IClassFactory2) }, + { ID_NAME(IID_IClassFactory3), TRUE }, + { ID_NAME(IID_IClientSecurity), TRUE }, + { ID_NAME(IID_IComThreadingInfo), TRUE }, + { ID_NAME(IID_IContext), TRUE }, + { ID_NAME(IID_IContextMenu), TRUE }, + { ID_NAME(IID_IContextMenu2), TRUE }, + { ID_NAME(IID_IContextMenu3), TRUE }, + { ID_NAME(IID_IContextMenuCB), TRUE }, + { ID_NAME(IID_IContextMenuSite) }, + { ID_NAME(IID_IContinue) }, + { ID_NAME(IID_IDVGetEnum), TRUE }, + { ID_NAME(IID_IDataObject) }, + //{ ID_NAME(IID_IDefViewID) }, == DefViewFrame3 + { ID_NAME(IID_IDefViewFrame), TRUE }, + { ID_NAME(IID_IDefViewFrame3) }, + { ID_NAME(IID_IDefViewFrameGroup) }, + { ID_NAME(IID_IDefViewSafety), }, + { ID_NAME(IID_IDefViewScript), TRUE }, + { ID_NAME(IID_IDeskBand) }, + { ID_NAME(IID_IDeskBandEx) }, + { ID_NAME(IID_IDeskBar), TRUE }, + { ID_NAME(IID_IDeskBarClient), TRUE }, + { ID_NAME(IID_IDeskMovr), TRUE }, + { ID_NAME(IID_IDispatch) }, + { ID_NAME(IID_IDockingWindow) }, + { ID_NAME(IID_IDockingWindowFrame), TRUE }, + { ID_NAME(IID_IDockingWindowSite), TRUE }, + { ID_NAME(IID_IDocViewSite), TRUE }, + { ID_NAME(IID_IDragSourceHelper), TRUE }, + { ID_NAME(IID_IDropSource) }, + { ID_NAME(IID_IDropTarget) }, + { ID_NAME(IID_IDropTargetHelper), TRUE }, + { ID_NAME(IID_IEnumExtraSearch) }, + { ID_NAME(IID_IEnumGUID) }, + { ID_NAME(IID_IEnumIDList) }, + { ID_NAME(IID_IEnumShellItems) }, + { ID_NAME(IID_IEnumString) }, + { ID_NAME(IID_IEnumUnknown) }, + { ID_NAME(IID_IEnumVARIANT) }, + { ID_NAME(IID_IErrorLog) }, + { ID_NAME(IID_IExplorerToolbar), TRUE }, + { ID_NAME(IID_IExtractIconA), TRUE }, + { ID_NAME(IID_IExtractIconW), TRUE }, + { ID_NAME(IID_IExtractImage) }, + { ID_NAME(IID_IExtractImage2) }, + { ID_NAME(IID_IFileDialog) }, + { ID_NAME(IID_IFileDialog2), TRUE }, + { ID_NAME(IID_IFileSearchBand) }, + { ID_NAME(IID_IFolderBandPriv) }, + { ID_NAME(IID_IFolderFilter) }, + { ID_NAME(IID_IFolderFilterSite) }, + { ID_NAME(IID_IFolderView) }, + { ID_NAME(IID_IFolderView2) }, + { ID_NAME(IID_IFolderViewOC) }, + { ID_NAME(IID_IFolderViewSettings) }, + { ID_NAME(IID_IGlobalFolderSettings), TRUE }, + { ID_NAME(IID_IInitializeObject), TRUE }, + { ID_NAME(IID_IInputObject) }, + { ID_NAME(IID_IInputObjectSite) }, + { ID_NAME(IID_IInternalUnknown), TRUE }, + { ID_NAME(IID_IMarshal) }, + { ID_NAME(IID_IMenuBand), TRUE }, + { ID_NAME(IID_IMenuPopup), TRUE }, + { ID_NAME(IID_IMoniker) }, + { ID_NAME(IID_IMultiMonitorDockingSite), TRUE }, + { ID_NAME(IID_IMultiQI), TRUE }, + { ID_NAME(IID_INamespaceProxy), TRUE }, + { ID_NAME(IID_INameSpaceTreeControl), TRUE }, + { ID_NAME(IID_INSCTree), TRUE }, + { ID_NAME(IID_INSCTree2), TRUE }, + { ID_NAME(IID_IObjMgr), TRUE }, + { ID_NAME(IID_IObjectSafety) }, + { ID_NAME(IID_IObjectWithSite) }, + { ID_NAME(IID_IOleCommandTarget) }, + { ID_NAME(IID_IOleInPlaceActiveObject) }, + { ID_NAME(IID_IOleInPlaceFrame) }, + { ID_NAME(IID_IOleInPlaceObject) }, + { ID_NAME(IID_IOleInPlaceObjectWindowless), TRUE }, + { ID_NAME(IID_IOleInPlaceSite) }, + { ID_NAME(IID_IOleInPlaceSiteEx) }, + { ID_NAME(IID_IOleInPlaceSiteWindowless), TRUE }, + { ID_NAME(IID_IOleInPlaceUIWindow) }, + { ID_NAME(IID_IOleObject) }, + { ID_NAME(IID_IOleWindow) }, + { ID_NAME(IID_IPersist) }, + { ID_NAME(IID_IPersistFile) }, + { ID_NAME(IID_IPersistFolder) }, + { ID_NAME(IID_IPersistFolder2) }, + { ID_NAME(IID_IPersistFolder3) }, + { ID_NAME(IID_IPersistHistory) }, + { ID_NAME(IID_IPersistIDList) }, + { ID_NAME(IID_IPersistMemory) }, + { ID_NAME(IID_IPersistPropertyBag) }, + { ID_NAME(IID_IPersistPropertyBag2) }, + { ID_NAME(IID_IPersistStorage) }, + { ID_NAME(IID_IPersistStream) }, + { ID_NAME(IID_IPersistStreamInit) }, + { ID_NAME(IID_IProgressDialog), TRUE }, + { ID_NAME(IID_IPropertyBag) }, + { ID_NAME(IID_IPropertyBag2) }, + { ID_NAME(IID_IQueryAssociations), TRUE }, + { ID_NAME(IID_IQueryInfo), TRUE }, + { ID_NAME(IID_IRegTreeOptions), TRUE }, + { ID_NAME(IID_IRunnableObject) }, + { ID_NAME(IID_IServerSecurity), TRUE }, + { ID_NAME(IID_IServiceProvider) }, + { ID_NAME(IID_ISFHelper), TRUE }, + { ID_NAME(IID_IShellBrowser) }, + { ID_NAME(IID_IShellBrowserService), TRUE }, + { ID_NAME(IID_IShellChangeNotify), TRUE }, + { ID_NAME(IID_IShellDesktopTray), TRUE }, + { ID_NAME(IID_IShellDispatch) }, + { ID_NAME(IID_IShellDispatch2) }, + { ID_NAME(IID_IShellDispatch3) }, + { ID_NAME(IID_IShellDispatch4) }, + { ID_NAME(IID_IShellDispatch5), TRUE }, + { ID_NAME(IID_IShellExtInit), TRUE }, + { ID_NAME(IID_IShellPropSheetExt), TRUE }, + { ID_NAME(IID_IShellIconOverlayIdentifier), TRUE }, + { ID_NAME(IID_IShellFolder) }, + { ID_NAME(IID_IShellFolder2) }, + { ID_NAME(IID_IShellFolderBand), TRUE }, + { ID_NAME(IID_IShellFolderView), TRUE }, + { ID_NAME(IID_IShellFolderViewCB), TRUE }, + { ID_NAME(IID_IShellFolderViewDual) }, + { ID_NAME(IID_IShellFolderViewDual2) }, + { ID_NAME(IID_IShellIcon) }, + { ID_NAME(IID_IShellItem) }, + { ID_NAME(IID_IShellItem2) }, + { ID_NAME(IID_IShellItemArray) }, + { ID_NAME(IID_IShellItemFilter) }, + { ID_NAME(IID_IShellLinkA) }, + { ID_NAME(IID_IShellLinkDual) }, + { ID_NAME(IID_IShellLinkDual2) }, + { ID_NAME(IID_IShellLinkW) }, + { ID_NAME(IID_IShellMenu), TRUE }, + { ID_NAME(IID_IShellMenu2), TRUE }, + { ID_NAME(IID_IShellMenuAcc), TRUE }, + { ID_NAME(IID_IShellMenuCallback), TRUE }, + { ID_NAME(IID_IShellNameSpace) }, + { ID_NAME(IID_IShellService), TRUE }, + { ID_NAME(IID_IShellView) }, + { ID_NAME(IID_IShellView2) }, + { ID_NAME(IID_IShellView3) }, + { ID_NAME(IID_IShellWindows) }, + { ID_NAME(IID_IStorage) }, + { ID_NAME(IID_IStream) }, + { ID_NAME(IID_ISurrogate) }, + { ID_NAME(IID_ISynchronize) }, + { ID_NAME(IID_ISynchronizeContainer), TRUE }, + { ID_NAME(IID_ISynchronizeEvent), TRUE }, + { ID_NAME(IID_ISynchronizeHandle), TRUE }, + { ID_NAME(IID_ITaskbarList) }, + { ID_NAME(IID_ITaskbarList2) }, + { ID_NAME(IID_ITrackShellMenu), TRUE }, + { ID_NAME(IID_ITrayPriv), TRUE }, + { ID_NAME(IID_ITrayPriv2), TRUE }, + { ID_NAME(IID_IUnknown) }, + { ID_NAME(IID_IViewObject) }, + { ID_NAME(IID_IViewObject2) }, + { ID_NAME(IID_IViewObjectEx), TRUE }, + { ID_NAME(IID_IWinEventHandler), TRUE }, - ID_NAME(IID_DFConstraint), - ID_NAME(DIID_DShellFolderViewEvents), + { ID_NAME(IID_DFConstraint), TRUE }, + { ID_NAME(DIID_DShellFolderViewEvents) }, - ID_NAME(IID_CDefView), - ID_NAME(IID_Folder), - ID_NAME(IID_Folder2), - ID_NAME(IID_Folder3), - ID_NAME(IID_FolderItem), - ID_NAME(IID_FolderItem2), - ID_NAME(IID_FolderItems), - ID_NAME(IID_FolderItems2), - ID_NAME(IID_FolderItems3), - ID_NAME(IID_FolderItemVerb), - ID_NAME(IID_FolderItemVerbs), + { ID_NAME(IID_CDefView), TRUE }, + { ID_NAME(IID_Folder) }, + { ID_NAME(IID_Folder2) }, + { ID_NAME(IID_Folder3) }, + { ID_NAME(IID_FolderItem) }, + { ID_NAME(IID_FolderItem2) }, + { ID_NAME(IID_FolderItems) }, + { ID_NAME(IID_FolderItems2) }, + { ID_NAME(IID_FolderItems3) }, + { ID_NAME(IID_FolderItemVerb) }, + { ID_NAME(IID_FolderItemVerbs) }, - ID_NAME(CLSID_ShellDesktop) + { ID_NAME(CLSID_ShellDesktop), TRUE } }; static const INT KnownInterfaceCount = RTL_NUMBER_OF(KnownInterfaces); @@ -345,7 +347,7 @@ TestModuleInterfaces( continue; offset = GetInterfaceOffset(pUnk, iface->iid); #ifdef GENERATE_TABLE_ENTRIES - ok(offset == INTF_NOT_EXPOSED, "%s: { %s%x, &%s },\n", class->name, offset < 0 ? "-" : "", offset < 0 ? -offset : offset, iface->name); + ok(offset == INTF_NOT_EXPOSED, "%s: { %s0x%x, &%s },\n", class->name, offset < 0 ? "-" : "", offset < 0 ? -offset : offset, iface->name); #else ok(offset == INTF_NOT_EXPOSED, "%s exposes %s (offset %ld), but shouldn't\n", class->name, iface->name, offset); #endif @@ -495,3 +497,76 @@ TestClasses( CoUninitialize(); } + +static +VOID +TestInterfaceRegistry( + _In_ PCKNOWN_INTERFACE Interfaces, + _In_ INT InterfaceCount) +{ + INT i; + HKEY hKeyInterface; + LONG result; + + result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Classes\\Interface", 0, KEY_ENUMERATE_SUB_KEYS, &hKeyInterface); + ok(result == NO_ERROR, "Failed to open interface key, error %lu\n", result); + if (!myskip(result == NO_ERROR, "No interface key\n")) + { + for (i = 0; i < InterfaceCount; i++) + { + HKEY hKey; + NTSTATUS status; + UNICODE_STRING iid; + DWORD type; + WCHAR data[100]; + DWORD dataSize; + PCKNOWN_INTERFACE iface; + PCWSTR expectedName; + + iface = &Interfaces[i]; + status = RtlStringFromGUID(iface->iid, &iid); + ok(status == STATUS_SUCCESS, "Failed to convert guid to string for %s, status %lx\n", iface->name, status); + if (myskip(NT_SUCCESS(status), "No guid string\n")) + continue; + + result = RegOpenKeyEx(hKeyInterface, iid.Buffer, 0, KEY_QUERY_VALUE, &hKey); + if (iface->noreg) + { + ok(result == ERROR_FILE_NOT_FOUND, "RegOpenKeyEx returned %lu for %s\n", result, iface->name); + } + else + { + ok(result == NO_ERROR, "Failed to open key for %s, error %lu\n", iface->name, result); + (void)myskip(result == NO_ERROR, "No key\n"); + } + RtlFreeUnicodeString(&iid); + if (result != NO_ERROR) + continue; + + dataSize = sizeof(data); + result = RegQueryValueEx(hKey, NULL, NULL, &type, (PBYTE)data, &dataSize); + ok(result == NO_ERROR, "Failed to query value for %s, error %lu\n", iface->name, result); + if (!myskip(result == NO_ERROR, "No module name\n")) + { + ok(type == REG_SZ, "type %lu for %s\n", type, iface->name); + ok(dataSize % sizeof(WCHAR) == 0, "size %lu for %s\n", dataSize, iface->name); + ok(dataSize <= sizeof(data), "size %lu for %s\n", dataSize, iface->name); + ok(data[dataSize / sizeof(WCHAR) - 1] == UNICODE_NULL, "Not null terminated for %s\n", iface->name); + expectedName = wcschr(iface->wname, L'_'); + if (expectedName) + expectedName++; + else + expectedName = iface->wname; + ok(!wcsicmp(data, expectedName), "Name is %ls, expected %ls\n", data, expectedName); + } + + RegCloseKey(hKey); + } + RegCloseKey(hKeyInterface); + } +} + +START_TEST(interfaces) +{ + TestInterfaceRegistry(KnownInterfaces, KnownInterfaceCount); +} diff --git a/rostests/apitests/com/testlist.c b/rostests/apitests/com/testlist.c index 100d2a9232d..9aa449d576c 100644 --- a/rostests/apitests/com/testlist.c +++ b/rostests/apitests/com/testlist.c @@ -5,6 +5,7 @@ extern void func_browseui(void); extern void func_ieframe(void); +extern void func_interfaces(void); extern void func_shdocvw(void); extern void func_shell32(void); @@ -12,6 +13,7 @@ const struct test winetest_testlist[] = { { "browseui", func_browseui }, { "ieframe", func_ieframe }, + { "interfaces", func_interfaces }, { "shdocvw", func_shdocvw }, { "shell32", func_shell32 }, From 6ef7adc1de009aa10923a2569e6a439345a90b45 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 22 Mar 2014 15:59:41 +0000 Subject: [PATCH 135/419] [KERNEL32] - Rename Keep argument of BasepIsRealtimeAllowed to something more accurate. - Properly document this function usage given its specific behavior. It's badly used in trunk atm, fixes will come in next commit svn path=/trunk/; revision=62542 --- reactos/dll/win32/kernel32/client/utils.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/utils.c b/reactos/dll/win32/kernel32/client/utils.c index f0f102a3328..228690bba4a 100644 --- a/reactos/dll/win32/kernel32/client/utils.c +++ b/reactos/dll/win32/kernel32/client/utils.c @@ -615,10 +615,15 @@ BaseInitializeContext(IN PCONTEXT Context, /* * Checks if the privilege for Real-Time Priority is there + * Beware about this function behavior: + * - In case CheckOnly is set to TRUE, then the function will only check + * whether real time is allowed and won't grant the privilege. In that case + * it will return TRUE if allowed, FALSE otherwise. Not a state! + * It means you don't have to release privilege when calling with TRUE. */ PVOID WINAPI -BasepIsRealtimeAllowed(IN BOOLEAN Keep) +BasepIsRealtimeAllowed(IN BOOLEAN CheckOnly) { ULONG Privilege = SE_INC_BASE_PRIORITY_PRIVILEGE; PVOID State; @@ -627,7 +632,7 @@ BasepIsRealtimeAllowed(IN BOOLEAN Keep) Status = RtlAcquirePrivilege(&Privilege, 1, 0, &State); if (!NT_SUCCESS(Status)) return NULL; - if (Keep) + if (CheckOnly) { RtlReleasePrivilege(State); State = (PVOID)TRUE; From d30892cbc2f64ae31500d64aab18db6ba4daea3b Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 22 Mar 2014 16:11:32 +0000 Subject: [PATCH 136/419] [KERNEL32] Actually, given how the calls were done later on, it appears that our dear Alex was missing a ! So fix the if condition in BasepIsRealtimeAllowed, restore the previous arg name, and update the doc This should fix the calls to that function. CORE-8013 #comment Should be fixed with r62543. Please retry svn path=/trunk/; revision=62543 --- reactos/dll/win32/kernel32/client/utils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/utils.c b/reactos/dll/win32/kernel32/client/utils.c index 228690bba4a..fa476de403e 100644 --- a/reactos/dll/win32/kernel32/client/utils.c +++ b/reactos/dll/win32/kernel32/client/utils.c @@ -616,14 +616,14 @@ BaseInitializeContext(IN PCONTEXT Context, /* * Checks if the privilege for Real-Time Priority is there * Beware about this function behavior: - * - In case CheckOnly is set to TRUE, then the function will only check + * - In case Keep is set to FALSE, then the function will only check * whether real time is allowed and won't grant the privilege. In that case * it will return TRUE if allowed, FALSE otherwise. Not a state! - * It means you don't have to release privilege when calling with TRUE. + * It means you don't have to release privilege when calling with FALSE. */ PVOID WINAPI -BasepIsRealtimeAllowed(IN BOOLEAN CheckOnly) +BasepIsRealtimeAllowed(IN BOOLEAN Keep) { ULONG Privilege = SE_INC_BASE_PRIORITY_PRIVILEGE; PVOID State; @@ -632,7 +632,7 @@ BasepIsRealtimeAllowed(IN BOOLEAN CheckOnly) Status = RtlAcquirePrivilege(&Privilege, 1, 0, &State); if (!NT_SUCCESS(Status)) return NULL; - if (CheckOnly) + if (!Keep) { RtlReleasePrivilege(State); State = (PVOID)TRUE; From 2e7eea80433cf41fa2d7ffb72e76cfbe145045b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 22 Mar 2014 18:46:26 +0000 Subject: [PATCH 137/419] [KERNEL32]: Fix parameter usage in RtlAcquirePrivilege. svn path=/trunk/; revision=62544 --- reactos/dll/win32/kernel32/client/proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/kernel32/client/proc.c b/reactos/dll/win32/kernel32/client/proc.c index 3725e27e273..0f3bc305d03 100644 --- a/reactos/dll/win32/kernel32/client/proc.c +++ b/reactos/dll/win32/kernel32/client/proc.c @@ -3874,7 +3874,7 @@ StartScan: { /* Acquire the required privilege so that the kernel won't fail the call */ PrivilegeValue = SE_LOCK_MEMORY_PRIVILEGE; - Status = RtlAcquirePrivilege(&PrivilegeValue, TRUE, FALSE, &PrivilegeState); + Status = RtlAcquirePrivilege(&PrivilegeValue, 1, 0, &PrivilegeState); if (NT_SUCCESS(Status)) { /* Remember to release it later */ From a44f578a6c0ed114eb37f821434ca282765815b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 22 Mar 2014 20:04:28 +0000 Subject: [PATCH 138/419] [ADVAPI32][SECUR32] Remove useless msvcrt importing. [WINSRV] Fix imports. CORE-7985 svn path=/trunk/; revision=62545 --- reactos/dll/win32/advapi32/CMakeLists.txt | 6 +++--- reactos/dll/win32/advapi32/misc/dllmain.c | 2 +- reactos/dll/win32/secur32/CMakeLists.txt | 4 ++-- reactos/win32ss/user/winsrv/CMakeLists.txt | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reactos/dll/win32/advapi32/CMakeLists.txt b/reactos/dll/win32/advapi32/CMakeLists.txt index 3c1df063134..20cbef3e218 100644 --- a/reactos/dll/win32/advapi32/CMakeLists.txt +++ b/reactos/dll/win32/advapi32/CMakeLists.txt @@ -55,10 +55,10 @@ add_library(advapi32 SHARED ${CMAKE_CURRENT_BINARY_DIR}/lsa_c.c ${CMAKE_CURRENT_BINARY_DIR}/svcctl_c.c) -set_module_type(advapi32 win32dll UNICODE) +set_module_type(advapi32 win32dll UNICODE ENTRYPOINT DllMain 12) target_link_libraries(advapi32 cryptlib wine ${PSEH_LIB}) -add_delay_importlibs(advapi32 rpcrt4) -add_importlibs(advapi32 secur32 msvcrt kernel32 ntdll) +add_delay_importlibs(advapi32 secur32) +add_importlibs(advapi32 rpcrt4 kernel32 ntdll) add_pch(advapi32 advapi32.h SOURCE) diff --git a/reactos/dll/win32/advapi32/misc/dllmain.c b/reactos/dll/win32/advapi32/misc/dllmain.c index ae7b29d7db4..d7e766a4105 100644 --- a/reactos/dll/win32/advapi32/misc/dllmain.c +++ b/reactos/dll/win32/advapi32/misc/dllmain.c @@ -36,7 +36,7 @@ DllMain( break; } - return TRUE; + return TRUE; } /* EOF */ diff --git a/reactos/dll/win32/secur32/CMakeLists.txt b/reactos/dll/win32/secur32/CMakeLists.txt index 95bece1bccd..c09dc40490d 100644 --- a/reactos/dll/win32/secur32/CMakeLists.txt +++ b/reactos/dll/win32/secur32/CMakeLists.txt @@ -17,11 +17,11 @@ add_library(secur32 SHARED ${CMAKE_CURRENT_BINARY_DIR}/secur32_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/secur32.def) -set_module_type(secur32 win32dll) +set_module_type(secur32 win32dll UNICODE ENTRYPOINT DllMain 12) target_link_libraries(secur32 lsalib) -add_importlibs(secur32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(secur32 advapi32 kernel32 ntdll) add_pch(secur32 precomp.h SOURCE) add_cd_file(TARGET secur32 DESTINATION reactos/system32 FOR all) diff --git a/reactos/win32ss/user/winsrv/CMakeLists.txt b/reactos/win32ss/user/winsrv/CMakeLists.txt index e18461bab5d..1bbd16d4f30 100644 --- a/reactos/win32ss/user/winsrv/CMakeLists.txt +++ b/reactos/win32ss/user/winsrv/CMakeLists.txt @@ -26,8 +26,8 @@ target_link_libraries(winsrv consrv usersrv) # Add win32ksys because of NtUser...() target_link_libraries(winsrv win32ksys libcntpr ${PSEH_LIB} ${CONSRV_TARGET_LINK_LIBS}) -add_delay_importlibs(winsrv advapi32 gdi32 user32 ${CONSRV_DELAY_IMPORT_LIBS}) -add_importlibs(winsrv csrsrv kernel32 ntdll ${CONSRV_IMPORT_LIBS}) +add_delay_importlibs(winsrv advapi32 ${CONSRV_DELAY_IMPORT_LIBS}) +add_importlibs(winsrv csrsrv gdi32 user32 kernel32 ntdll ${CONSRV_IMPORT_LIBS}) add_dependencies(winsrv bugcodes) add_cd_file(TARGET winsrv DESTINATION reactos/system32 FOR all) From 055a4866c39a016dcfbdb775eddef6f5fa2ba365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 22 Mar 2014 21:07:28 +0000 Subject: [PATCH 139/419] [SHELL] Allow opening .COM executables from the (explorer) shell, outside cmd.exe. Patch by Lee Schroeder. CORE-8009 #resolve #comment Fixed in revision 62546. Thanks :D svn path=/trunk/; revision=62546 --- reactos/boot/bootdata/hivecls.inf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/reactos/boot/bootdata/hivecls.inf b/reactos/boot/bootdata/hivecls.inf index 10db21badfd..e83c7182462 100644 --- a/reactos/boot/bootdata/hivecls.inf +++ b/reactos/boot/bootdata/hivecls.inf @@ -45,7 +45,7 @@ HKCR,"anifile","",0x00000000,"Animated Cursor" HKCR,"anifile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\main.cpl,-1039" HKCR,"anifile\DefaultIcon","",0x00000000,"%1" -; DOS Batch-Files +; DOS Batch Files HKCR,".bat","",0x00000000,"batfile" HKCR,"batfile","",0x00000000,"DOS Batch File" HKCR,"batfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-158" @@ -53,6 +53,7 @@ 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"" %*" +; ReactOS Cmd Script Files HKCR,".cmd","",0x00000000,"cmdfile" HKCR,"cmdfile","",0x00000000,"ReactOS Command Script" HKCR,"cmdfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-159" @@ -60,11 +61,12 @@ 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 +; DOS Applications 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" +HKCR,"comfile\shell\open\command","",0x00000000,"""%1"" %*" ; Control Panel extensions HKCR,".cpl","",0x00000000,"cplfile" @@ -93,7 +95,7 @@ HKCR,"drvfile","",0x00000000,"Device Driver" HKCR,"drvfile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-164" HKCR,"drvfile\DefaultIcon","",0x00020000,"%SystemRoot%\system32\shell32.dll,-154" -; Applicatons +; Applications HKCR,".exe","",0x00000000,"exefile" HKCR,"exefile","",0x00000000,"ReactOS Application" HKCR,"exefile","FriendlyTypeName",0x00020000,"@%SystemRoot%\system32\shell32.dll,-165" From 918e8924e77b8730502ecbf83680f3338d2f21fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 23 Mar 2014 00:23:54 +0000 Subject: [PATCH 140/419] [RTL] - Code formatting (homogeneisation of...). - For "Deadlock" DPRINT, replace the DPRINT1 by a ERROR_DBGBREAK for (user) debugging purposes only (a priori this shouldn't be hit during our automated tests). svn path=/trunk/; revision=62547 --- reactos/lib/rtl/critical.c | 178 +++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 86 deletions(-) diff --git a/reactos/lib/rtl/critical.c b/reactos/lib/rtl/critical.c index ab3590b429a..7a1870ff4ab 100644 --- a/reactos/lib/rtl/critical.c +++ b/reactos/lib/rtl/critical.c @@ -52,7 +52,6 @@ RtlpCreateCriticalSectionSem(PRTL_CRITICAL_SECTION CriticalSection) /* Check if we have an event */ if (!hEvent) { - /* No, so create it */ Status = NtCreateEvent(&hNewEvent, EVENT_ALL_ACCESS, @@ -61,11 +60,13 @@ RtlpCreateCriticalSectionSem(PRTL_CRITICAL_SECTION CriticalSection) FALSE); if (!NT_SUCCESS(Status)) { - DPRINT1("Failed to Create Event!\n"); + DPRINT1("Failed to Create Event!\n"); - /* Use INVALID_HANDLE_VALUE (-1) to signal that the global - keyed event must be used */ - hNewEvent = INVALID_HANDLE_VALUE; + /* + * Use INVALID_HANDLE_VALUE (-1) to signal that + * the global keyed event must be used. + */ + hNewEvent = INVALID_HANDLE_VALUE; } DPRINT("Created Event: %p \n", hNewEvent); @@ -111,7 +112,8 @@ RtlpWaitForCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) BOOLEAN LastChance = FALSE; /* Do we have an Event yet? */ - if (!CriticalSection->LockSemaphore) { + if (!CriticalSection->LockSemaphore) + { RtlpCreateCriticalSectionSem(CriticalSection); } @@ -123,8 +125,8 @@ RtlpWaitForCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) if (CriticalSection->DebugInfo) CriticalSection->DebugInfo->EntryCount++; - for (;;) { - + for (;;) + { /* Increase the number of times we've had contention */ if (CriticalSection->DebugInfo) CriticalSection->DebugInfo->ContentionCount++; @@ -147,12 +149,12 @@ RtlpWaitForCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) } /* We have Timed out */ - if (Status == STATUS_TIMEOUT) { - + if (Status == STATUS_TIMEOUT) + { /* Is this the 2nd time we've timed out? */ - if (LastChance) { - - DPRINT1("Deadlock: %p\n", CriticalSection); + if (LastChance) + { + ERROR_DBGBREAK("Deadlock: 0x%p\n", CriticalSection); /* Yes it is, we are raising an exception */ ExceptionRecord.ExceptionCode = STATUS_POSSIBLE_DEADLOCK; @@ -162,14 +164,13 @@ RtlpWaitForCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) ExceptionRecord.NumberParameters = 1; ExceptionRecord.ExceptionInformation[0] = (ULONG_PTR)CriticalSection; RtlRaiseException(&ExceptionRecord); - } /* One more try */ LastChance = TRUE; - - } else { - + } + else + { /* If we are here, everything went fine */ return STATUS_SUCCESS; } @@ -198,7 +199,8 @@ RtlpUnWaitCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) NTSTATUS Status; /* Do we have an Event yet? */ - if (!CriticalSection->LockSemaphore) { + if (!CriticalSection->LockSemaphore) + { RtlpCreateCriticalSectionSem(CriticalSection); } @@ -219,8 +221,8 @@ RtlpUnWaitCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) Status = NtSetEvent(CriticalSection->LockSemaphore, NULL); } - if (!NT_SUCCESS(Status)) { - + if (!NT_SUCCESS(Status)) + { /* We've failed */ DPRINT1("Signaling Failed for: %p, %p, 0x%08lx\n", CriticalSection, @@ -249,7 +251,6 @@ VOID NTAPI RtlpInitDeferedCriticalSection(VOID) { - /* Initialize the Process Critical Section List */ InitializeListHead(&RtlCriticalSectionList); @@ -283,11 +284,11 @@ RtlpAllocateDebugInfo(VOID) ULONG i; /* Try to allocate from our buffer first */ - for (i = 0; i < MAX_STATIC_CS_DEBUG_OBJECTS; i++) { - + for (i = 0; i < MAX_STATIC_CS_DEBUG_OBJECTS; i++) + { /* Check if Entry is free */ - if (!RtlpDebugInfoFreeList[i]) { - + if (!RtlpDebugInfoFreeList[i]) + { /* Mark entry in use */ DPRINT("Using entry: %lu. Buffer: %p\n", i, &RtlpStaticDebugInfo[i]); RtlpDebugInfoFreeList[i] = TRUE; @@ -295,7 +296,6 @@ RtlpAllocateDebugInfo(VOID) /* Use free entry found */ return &RtlpStaticDebugInfo[i]; } - } /* We are out of static buffer, allocate dynamic */ @@ -328,8 +328,8 @@ RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo) /* Is it part of our cached entries? */ if ((DebugInfo >= RtlpStaticDebugInfo) && - (DebugInfo <= &RtlpStaticDebugInfo[MAX_STATIC_CS_DEBUG_OBJECTS-1])) { - + (DebugInfo <= &RtlpStaticDebugInfo[MAX_STATIC_CS_DEBUG_OBJECTS-1])) + { /* Yes. zero it out */ RtlZeroMemory(DebugInfo, sizeof(RTL_CRITICAL_SECTION_DEBUG)); @@ -341,21 +341,21 @@ RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo) NtCurrentTeb()->ClientId.UniqueProcess); RtlpDebugInfoFreeList[EntryId] = FALSE; - } else if (!DebugInfo->Flags) { - + } + else if (!DebugInfo->Flags) + { /* It's a dynamic one, so free from the heap */ DPRINT("Freeing from Heap: %p inside Process: %p\n", DebugInfo, NtCurrentTeb()->ClientId.UniqueProcess); RtlFreeHeap(NtCurrentPeb()->ProcessHeap, 0, DebugInfo); - - } else { - + } + else + { /* Wine stores a section name pointer in the Flags member */ DPRINT("Assuming static: %p inside Process: %p\n", DebugInfo, NtCurrentTeb()->ClientId.UniqueProcess); - } } @@ -382,12 +382,12 @@ RtlDeleteCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) NTSTATUS Status = STATUS_SUCCESS; DPRINT("Deleting Critical Section: %p\n", CriticalSection); - /* Close the Event Object Handle if it exists */ - if (CriticalSection->LockSemaphore) { + /* Close the Event Object Handle if it exists */ + if (CriticalSection->LockSemaphore) + { /* In case NtClose fails, return the status */ Status = NtClose(CriticalSection->LockSemaphore); - } /* Protect List */ @@ -397,7 +397,8 @@ RtlDeleteCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) { /* Remove it from the list */ RemoveEntryList(&CriticalSection->DebugInfo->ProcessLocksList); -#if 0 /* We need to preserve Flags for RtlpFreeDebugInfo */ +#if 0 + /* We need to preserve Flags for RtlpFreeDebugInfo */ RtlZeroMemory(CriticalSection->DebugInfo, sizeof(RTL_CRITICAL_SECTION_DEBUG)); #endif } @@ -470,18 +471,17 @@ RtlEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) { HANDLE Thread = (HANDLE)NtCurrentTeb()->ClientId.UniqueThread; - /* Try to Lock it */ - if (InterlockedIncrement(&CriticalSection->LockCount) != 0) { - - /* - * We've failed to lock it! Does this thread - * actually own it? - */ - if (Thread == CriticalSection->OwningThread) { - - /* You own it, so you'll get it when you're done with it! No need to - use the interlocked functions as only the thread who already owns - the lock can modify this data. */ + /* Try to lock it */ + if (InterlockedIncrement(&CriticalSection->LockCount) != 0) + { + /* We've failed to lock it! Does this thread actually own it? */ + if (Thread == CriticalSection->OwningThread) + { + /* + * You own it, so you'll get it when you're done with it! No need to + * use the interlocked functions as only the thread who already owns + * the lock can modify this data. + */ CriticalSection->RecursionCount++; return STATUS_SUCCESS; } @@ -497,9 +497,11 @@ RtlEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) RtlpWaitForCriticalSection(CriticalSection); } - /* Lock successful. Changing this information has not to be serialized because - only one thread at a time can actually change it (the one who acquired - the lock)! */ + /* + * Lock successful. Changing this information has not to be serialized + * because only one thread at a time can actually change it (the one who + * acquired the lock)! + */ CriticalSection->OwningThread = Thread; CriticalSection->RecursionCount = 1; return STATUS_SUCCESS; @@ -568,8 +570,8 @@ RtlInitializeCriticalSectionAndSpinCount(PRTL_CRITICAL_SECTION CriticalSection, CritcalSectionDebugData, NtCurrentTeb()->ClientId.UniqueProcess); - if (!CritcalSectionDebugData) { - + if (!CritcalSectionDebugData) + { /* This is bad! */ DPRINT1("Couldn't allocate Debug Data for: %p\n", CriticalSection); return STATUS_NO_MEMORY; @@ -584,12 +586,12 @@ RtlInitializeCriticalSectionAndSpinCount(PRTL_CRITICAL_SECTION CriticalSection, CriticalSection->DebugInfo = CritcalSectionDebugData; /* - * Add it to the List of Critical Sections owned by the process. - * If we've initialized the Lock, then use it. If not, then probably - * this is the lock initialization itself, so insert it directly. - */ - if ((CriticalSection != &RtlCriticalSectionLock) && (RtlpCritSectInitialized)) { - + * Add it to the List of Critical Sections owned by the process. + * If we've initialized the Lock, then use it. If not, then probably + * this is the lock initialization itself, so insert it directly. + */ + if ((CriticalSection != &RtlCriticalSectionLock) && (RtlpCritSectInitialized)) + { DPRINT("Securely Inserting into ProcessLocks: %p, %p, %p\n", &CritcalSectionDebugData->ProcessLocksList, CriticalSection, @@ -603,9 +605,9 @@ RtlInitializeCriticalSectionAndSpinCount(PRTL_CRITICAL_SECTION CriticalSection, /* Unprotect */ RtlLeaveCriticalSection(&RtlCriticalSectionLock); - - } else { - + } + else + { DPRINT("Inserting into ProcessLocks: %p, %p, %p\n", &CritcalSectionDebugData->ProcessLocksList, CriticalSection, @@ -680,8 +682,10 @@ RtlLeaveCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) #if DBG HANDLE Thread = (HANDLE)NtCurrentTeb()->ClientId.UniqueThread; - /* In win this case isn't checked. However it's a valid check so it should only - be performed in debug builds! */ + /* + * In win this case isn't checked. However it's a valid check so it should + * only be performed in debug builds! + */ if (Thread != CriticalSection->OwningThread) { DPRINT1("Releasing critical section not owned!\n"); @@ -689,23 +693,28 @@ RtlLeaveCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) } #endif - /* Decrease the Recursion Count. No need to do this atomically because only - the thread who holds the lock can call this function (unless the program - is totally screwed... */ - if (--CriticalSection->RecursionCount) { - + /* + * Decrease the Recursion Count. No need to do this atomically because only + * the thread who holds the lock can call this function (unless the program + * is totally screwed... + */ + if (--CriticalSection->RecursionCount) + { /* Someone still owns us, but we are free. This needs to be done atomically. */ InterlockedDecrement(&CriticalSection->LockCount); - } else { - - /* Nobody owns us anymore. No need to do this atomically. See comment - above. */ + } + else + { + /* + * Nobody owns us anymore. No need to do this atomically. + * See comment above. + */ CriticalSection->OwningThread = 0; /* Was someone wanting us? This needs to be done atomically. */ - if (-1 != InterlockedDecrement(&CriticalSection->LockCount)) { - + if (-1 != InterlockedDecrement(&CriticalSection->LockCount)) + { /* Let him have us */ RtlpUnWaitCriticalSection(CriticalSection); } @@ -736,17 +745,15 @@ NTAPI RtlTryEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) { /* Try to take control */ - if (InterlockedCompareExchange(&CriticalSection->LockCount, - 0, - -1) == -1) { - + if (InterlockedCompareExchange(&CriticalSection->LockCount, 0, -1) == -1) + { /* It's ours */ CriticalSection->OwningThread = NtCurrentTeb()->ClientId.UniqueThread; CriticalSection->RecursionCount = 1; return TRUE; - - } else if (CriticalSection->OwningThread == NtCurrentTeb()->ClientId.UniqueThread) { - + } + else if (CriticalSection->OwningThread == NtCurrentTeb()->ClientId.UniqueThread) + { /* It's already ours */ InterlockedIncrement(&CriticalSection->LockCount); CriticalSection->RecursionCount++; @@ -759,8 +766,7 @@ RtlTryEnterCriticalSection(PRTL_CRITICAL_SECTION CriticalSection) VOID NTAPI -RtlCheckForOrphanedCriticalSections( - HANDLE ThreadHandle) +RtlCheckForOrphanedCriticalSections(HANDLE ThreadHandle) { UNIMPLEMENTED; } From 65ce2df6dfab92a40d480d0fd1f64b9a77afa6f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 23 Mar 2014 01:16:19 +0000 Subject: [PATCH 141/419] [FORMAT] As mode and more, format is a false .com (for compatibility purposes). svn path=/trunk/; revision=62548 --- reactos/base/system/format/CMakeLists.txt | 2 ++ reactos/base/system/format/format.rc | 4 ++-- rosapps/applications/sysutils/man/man/2/format.man | 14 +++++++------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/reactos/base/system/format/CMakeLists.txt b/reactos/base/system/format/CMakeLists.txt index d54a55a8d81..0907bc0490a 100644 --- a/reactos/base/system/format/CMakeLists.txt +++ b/reactos/base/system/format/CMakeLists.txt @@ -1,5 +1,7 @@ add_executable(format format.c format.rc) set_module_type(format win32cui) +set_target_properties(format PROPERTIES SUFFIX ".com") + add_importlibs(format user32 fmifs msvcrt kernel32 ntdll) add_cd_file(TARGET format DESTINATION reactos/system32 FOR all) diff --git a/reactos/base/system/format/format.rc b/reactos/base/system/format/format.rc index 6d314033fa1..3731781c989 100644 --- a/reactos/base/system/format/format.rc +++ b/reactos/base/system/format/format.rc @@ -2,9 +2,9 @@ #include "resource.h" -#define REACTOS_STR_FILE_DESCRIPTION "Formating a device with a filesystem" +#define REACTOS_STR_FILE_DESCRIPTION "Disk Format Utility" #define REACTOS_STR_INTERNAL_NAME "format" -#define REACTOS_STR_ORIGINAL_FILENAME "format.exe" +#define REACTOS_STR_ORIGINAL_FILENAME "format.com" #include /* UTF-8 */ diff --git a/rosapps/applications/sysutils/man/man/2/format.man b/rosapps/applications/sysutils/man/man/2/format.man index ec3da7ba178..0ed1dea90e8 100644 --- a/rosapps/applications/sysutils/man/man/2/format.man +++ b/rosapps/applications/sysutils/man/man/2/format.man @@ -1,22 +1,22 @@ -[]=================================[format.exe]==============================[] +[]=================================[format.com]==============================[] Author: Mark Russinovich -Purpose: Disk formating tool +Purpose: Disk Format Utility Port on ROS: Emanuele Aliberti License: GPL -Usage: format.exe drive: [-FS:file-system] [-V:label] [-Q] [-A:size] [-C] +Usage: format.com drive: [-FS:file-system] [-V:label] [-Q] [-A:size] [-C] [drive:] Specifies the drive to format. -FS:file-system Specifies the type of file system (e.g. FAT). -V:label Specifies volume label. -Q Performs a quick format. -A:size Overrides the default allocation unit size. - Default settings are strongly recommended for general - use NTFS supports 512, 1024, 2048, 4096, 8192, 16K, - 32K, 64K. FAT supports 8192, 16K, 32K, 64K, 128K, 256K. + Default settings are strongly recommended for general + use NTFS supports 512, 1024, 2048, 4096, 8192, 16K, + 32K, 64K. FAT supports 8192, 16K, 32K, 64K, 128K, 256K. NTFS compression is not supported for allocation - unit sizes above 4096. + unit sizes above 4096. -C Files created on the new volume will be compressed by default. From eab1b449bb345441850204d1ca96ea1d531ac514 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 23 Mar 2014 01:32:46 +0000 Subject: [PATCH 142/419] [COMP][SORT] Bring back COMP and SORT utilities to build. svn path=/trunk/; revision=62549 --- reactos/base/applications/cmdutils/CMakeLists.txt | 2 ++ .../base}/applications/cmdutils/comp/CMakeLists.txt | 0 {rosapps => reactos/base}/applications/cmdutils/comp/comp.c | 0 reactos/base/applications/cmdutils/comp/comp.rc | 5 +++++ .../base}/applications/cmdutils/sort/CMakeLists.txt | 2 +- {rosapps => reactos/base}/applications/cmdutils/sort/sort.c | 0 reactos/base/applications/cmdutils/sort/sort.rc | 5 +++++ rosapps/applications/cmdutils/CMakeLists.txt | 2 -- rosapps/applications/cmdutils/cmdutils.rbuild | 6 ------ rosapps/applications/cmdutils/comp/comp.rbuild | 4 ---- rosapps/applications/cmdutils/comp/comp.rc | 4 ---- rosapps/applications/cmdutils/sort/sort.rbuild | 4 ---- rosapps/applications/cmdutils/sort/sort.rc | 5 ----- 13 files changed, 13 insertions(+), 26 deletions(-) rename {rosapps => reactos/base}/applications/cmdutils/comp/CMakeLists.txt (100%) rename {rosapps => reactos/base}/applications/cmdutils/comp/comp.c (100%) create mode 100644 reactos/base/applications/cmdutils/comp/comp.rc rename {rosapps => reactos/base}/applications/cmdutils/sort/CMakeLists.txt (62%) rename {rosapps => reactos/base}/applications/cmdutils/sort/sort.c (100%) create mode 100644 reactos/base/applications/cmdutils/sort/sort.rc delete mode 100644 rosapps/applications/cmdutils/comp/comp.rbuild delete mode 100644 rosapps/applications/cmdutils/comp/comp.rc delete mode 100644 rosapps/applications/cmdutils/sort/sort.rbuild delete mode 100644 rosapps/applications/cmdutils/sort/sort.rc diff --git a/reactos/base/applications/cmdutils/CMakeLists.txt b/reactos/base/applications/cmdutils/CMakeLists.txt index a559623b7e4..a5164ec1bf6 100644 --- a/reactos/base/applications/cmdutils/CMakeLists.txt +++ b/reactos/base/applications/cmdutils/CMakeLists.txt @@ -1,3 +1,4 @@ +add_subdirectory(comp) add_subdirectory(dbgprint) add_subdirectory(doskey) add_subdirectory(find) @@ -7,6 +8,7 @@ add_subdirectory(lodctr) add_subdirectory(mode) add_subdirectory(more) add_subdirectory(reg) +add_subdirectory(sort) add_subdirectory(taskkill) add_subdirectory(wmic) add_subdirectory(xcopy) diff --git a/rosapps/applications/cmdutils/comp/CMakeLists.txt b/reactos/base/applications/cmdutils/comp/CMakeLists.txt similarity index 100% rename from rosapps/applications/cmdutils/comp/CMakeLists.txt rename to reactos/base/applications/cmdutils/comp/CMakeLists.txt diff --git a/rosapps/applications/cmdutils/comp/comp.c b/reactos/base/applications/cmdutils/comp/comp.c similarity index 100% rename from rosapps/applications/cmdutils/comp/comp.c rename to reactos/base/applications/cmdutils/comp/comp.c diff --git a/reactos/base/applications/cmdutils/comp/comp.rc b/reactos/base/applications/cmdutils/comp/comp.rc new file mode 100644 index 00000000000..b83ca54f768 --- /dev/null +++ b/reactos/base/applications/cmdutils/comp/comp.rc @@ -0,0 +1,5 @@ + +#define REACTOS_STR_FILE_DESCRIPTION "File Compare Utility" +#define REACTOS_STR_INTERNAL_NAME "comp" +#define REACTOS_STR_ORIGINAL_FILENAME "comp.exe" +#include diff --git a/rosapps/applications/cmdutils/sort/CMakeLists.txt b/reactos/base/applications/cmdutils/sort/CMakeLists.txt similarity index 62% rename from rosapps/applications/cmdutils/sort/CMakeLists.txt rename to reactos/base/applications/cmdutils/sort/CMakeLists.txt index 1429da4fed9..4e2fe0b17ff 100644 --- a/rosapps/applications/cmdutils/sort/CMakeLists.txt +++ b/reactos/base/applications/cmdutils/sort/CMakeLists.txt @@ -2,4 +2,4 @@ add_executable(sort sort.c sort.rc) set_module_type(sort win32cui) add_importlibs(sort msvcrt kernel32) -add_cd_file(TARGET sort DESTINATION reactos/system32 FOR all) \ No newline at end of file +add_cd_file(TARGET sort DESTINATION reactos/system32 FOR all) diff --git a/rosapps/applications/cmdutils/sort/sort.c b/reactos/base/applications/cmdutils/sort/sort.c similarity index 100% rename from rosapps/applications/cmdutils/sort/sort.c rename to reactos/base/applications/cmdutils/sort/sort.c diff --git a/reactos/base/applications/cmdutils/sort/sort.rc b/reactos/base/applications/cmdutils/sort/sort.rc new file mode 100644 index 00000000000..596435c864e --- /dev/null +++ b/reactos/base/applications/cmdutils/sort/sort.rc @@ -0,0 +1,5 @@ + +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Sort Command" +#define REACTOS_STR_INTERNAL_NAME "sort" +#define REACTOS_STR_ORIGINAL_FILENAME "sort.exe" +#include diff --git a/rosapps/applications/cmdutils/CMakeLists.txt b/rosapps/applications/cmdutils/CMakeLists.txt index 304b472089d..31d5ec71206 100644 --- a/rosapps/applications/cmdutils/CMakeLists.txt +++ b/rosapps/applications/cmdutils/CMakeLists.txt @@ -1,6 +1,4 @@ add_subdirectory(appwiz) -add_subdirectory(comp) -add_subdirectory(sort) add_subdirectory(tee) add_subdirectory(touch) add_subdirectory(uptime) diff --git a/rosapps/applications/cmdutils/cmdutils.rbuild b/rosapps/applications/cmdutils/cmdutils.rbuild index f07953080e9..dd8e5cd19b5 100644 --- a/rosapps/applications/cmdutils/cmdutils.rbuild +++ b/rosapps/applications/cmdutils/cmdutils.rbuild @@ -3,12 +3,6 @@ - - - - - - diff --git a/rosapps/applications/cmdutils/comp/comp.rbuild b/rosapps/applications/cmdutils/comp/comp.rbuild deleted file mode 100644 index 13d249a3aca..00000000000 --- a/rosapps/applications/cmdutils/comp/comp.rbuild +++ /dev/null @@ -1,4 +0,0 @@ - - comp.c - comp.rc - diff --git a/rosapps/applications/cmdutils/comp/comp.rc b/rosapps/applications/cmdutils/comp/comp.rc deleted file mode 100644 index 9a00c52a8ca..00000000000 --- a/rosapps/applications/cmdutils/comp/comp.rc +++ /dev/null @@ -1,4 +0,0 @@ -#define REACTOS_STR_FILE_DESCRIPTION "File Compare Utility\0" -#define REACTOS_STR_INTERNAL_NAME "comp\0" -#define REACTOS_STR_ORIGINAL_FILENAME "comp.exe\0" -#include diff --git a/rosapps/applications/cmdutils/sort/sort.rbuild b/rosapps/applications/cmdutils/sort/sort.rbuild deleted file mode 100644 index 188fd1eb282..00000000000 --- a/rosapps/applications/cmdutils/sort/sort.rbuild +++ /dev/null @@ -1,4 +0,0 @@ - - sort.c - sort.rc - diff --git a/rosapps/applications/cmdutils/sort/sort.rc b/rosapps/applications/cmdutils/sort/sort.rc deleted file mode 100644 index e3418a39524..00000000000 --- a/rosapps/applications/cmdutils/sort/sort.rc +++ /dev/null @@ -1,5 +0,0 @@ - -#define REACTOS_STR_FILE_DESCRIPTION "W32 sort command\0" -#define REACTOS_STR_INTERNAL_NAME "sort\0" -#define REACTOS_STR_ORIGINAL_FILENAME "sort.exe\0" -#include From b67dc560e6c6ba31e62ceff5ab17c79bd1d5c044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 23 Mar 2014 02:24:33 +0000 Subject: [PATCH 143/419] [NOTEVIL] - Convert our goode olde ReactOS Easter Egg "notevil" app to unicode. - Remove .rbuild file. - Code formatting. svn path=/trunk/; revision=62550 --- rosapps/applications/notevil/CMakeLists.txt | 2 +- rosapps/applications/notevil/notevil.c | 344 +++++++++----------- rosapps/applications/notevil/notevil.rbuild | 5 - rosapps/applications/notevil/notevil.rc | 108 +++--- 4 files changed, 209 insertions(+), 250 deletions(-) delete mode 100644 rosapps/applications/notevil/notevil.rbuild diff --git a/rosapps/applications/notevil/CMakeLists.txt b/rosapps/applications/notevil/CMakeLists.txt index 223aa31323d..eb0fafd9e0c 100644 --- a/rosapps/applications/notevil/CMakeLists.txt +++ b/rosapps/applications/notevil/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(notevil notevil.c notevil.rc) -set_module_type(notevil win32cui) +set_module_type(notevil win32cui UNICODE) add_importlibs(notevil user32 msvcrt kernel32) add_cd_file(TARGET notevil DESTINATION reactos/system32 FOR all) diff --git a/rosapps/applications/notevil/notevil.c b/rosapps/applications/notevil/notevil.c index 0cd86bee188..8c9cdce4cd6 100644 --- a/rosapps/applications/notevil/notevil.c +++ b/rosapps/applications/notevil/notevil.c @@ -24,243 +24,207 @@ * 19990411 EA * 19990515 EA */ -//#define UNICODE + #include #include -#include -#include #include "resource.h" -LPCTSTR app_name = _TEXT("notevil"); +// #define DISPLAY_COORD -HANDLE myself; -HANDLE ScreenBuffer; +LPCWSTR app_name = L"notevil"; + +HANDLE myself; +HANDLE ScreenBuffer; CONSOLE_SCREEN_BUFFER_INFO ScreenBufferInfo; -HANDLE WaitableTimer; +HANDLE WaitableTimer; -void -WriteStringAt( - LPTSTR lpString, - COORD xy, - WORD wColor - ) +VOID +WriteStringAt(LPWSTR lpString, + COORD xy, + WORD wColor) { - DWORD cWritten = 0; - WORD wLen = lstrlen(lpString); + DWORD cWritten = 0; + WORD wLen; - if (0 == wLen) - return; - // don't bother writing text when erasing - if( wColor ) - WriteConsoleOutputCharacter( ScreenBuffer, - lpString, - wLen, - xy, - & cWritten - ); - FillConsoleOutputAttribute( - ScreenBuffer, - wColor, - wLen, - xy, - & cWritten - ); + if (!lpString || *lpString == 0) return; + + wLen = wcslen(lpString); + + /* Don't bother writing text when erasing */ + if (wColor) + { + WriteConsoleOutputCharacterW(ScreenBuffer, + lpString, + wLen, + xy, + &cWritten); + } + + FillConsoleOutputAttribute(ScreenBuffer, + wColor, + wLen, + xy, + &cWritten); } #ifdef DISPLAY_COORD -void +VOID WriteCoord(COORD c) { - COORD xy = {0,0}; - TCHAR buf [40]; + COORD xy = {0,0}; + WCHAR buf[40]; - wsprintf( - buf, - _TEXT("x=%02d y=%02d"), - c.X, - c.Y - ); - WriteStringAt( - buf, - xy, - (BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE) - ); + wsprintf(buf, L"x=%02d y=%02d", c.X, c.Y); + + WriteStringAt(buf, xy, + BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE); } #endif /* def DISPLAY_COORD */ -INT -GetNextString( - LPTSTR Buffer, - INT BufferSize, - DWORD *Index - ) +VOID +GetNextString(LPWSTR Buffer, + INT BufferSize, + PDWORD Index) { - if (RES_LAST_INDEX == *Index) - { - *Index = RES_FIRST_INDEX; - } - else - { - ++*Index; - } - LoadString( - myself, - *Index, - Buffer, - BufferSize - ); - return 0; + if (RES_LAST_INDEX == *Index) + *Index = RES_FIRST_INDEX; + else + ++*Index; + + LoadStringW(myself, *Index, Buffer, BufferSize); } VOID DisplayTitle(VOID) { - LPTSTR szTitle = _TEXT("ReactOS Coders Console Parade"); - COORD xy; + LPWSTR szTitle = L"ReactOS Coders Console Parade"; + COORD xy; - xy.X = (ScreenBufferInfo.dwSize.X - lstrlen(szTitle)) / 2; - xy.Y = ScreenBufferInfo.dwSize.Y / 2; + xy.X = (ScreenBufferInfo.dwSize.X - wcslen(szTitle)) / 2; + xy.Y = ScreenBufferInfo.dwSize.Y / 2; - WriteStringAt( - szTitle, - xy, - (FOREGROUND_GREEN | FOREGROUND_INTENSITY) - ); + WriteStringAt(szTitle, xy, + FOREGROUND_GREEN | FOREGROUND_INTENSITY); } #define RES_DELAY_CHANGE 12 #define RES_BUFFER_SIZE 1024 -void -MainLoop(void) +VOID +MainLoop(VOID) { - TCHAR NameString [RES_BUFFER_SIZE]; - DWORD NameIndex = 1; - INT NameLength = 0; - COORD xy; - INT n = RES_DELAY_CHANGE; - INT dir_y = 1; - INT dir_x = 1; - WORD wColor = 1; + WCHAR NameString[RES_BUFFER_SIZE]; + DWORD NameIndex = 0; + INT NameLength = 0; + COORD xy; + INT n = RES_DELAY_CHANGE; + INT dir_y = 1; + INT dir_x = 1; + WORD wColor = 1; - xy.X = ScreenBufferInfo.dwSize.X / 2; - xy.Y = ScreenBufferInfo.dwSize.Y / 2; + xy.X = ScreenBufferInfo.dwSize.X / 2; + xy.Y = ScreenBufferInfo.dwSize.Y / 2; - for ( ; 1; ++n ) - { - if (n == RES_DELAY_CHANGE) - { - n = GetNextString( - NameString, - RES_BUFFER_SIZE, - & NameIndex - ); - NameLength = lstrlen(NameString); - wColor++; - if ((wColor & 0x000F) == 0) - wColor = 1; - } - if (xy.X == 0) - { - if (dir_x == -1) - dir_x = 1; - } - else if (xy.X >= ScreenBufferInfo.dwSize.X - NameLength - 1) - { - if (dir_x == 1) - dir_x = -1; - } - xy.X += dir_x; + for ( ; 1; ++n ) + { + if (n == RES_DELAY_CHANGE) + { + n = 0; + + GetNextString(NameString, + RES_BUFFER_SIZE, + &NameIndex); + NameLength = wcslen(NameString); + + wColor++; + if ((wColor & 0x000F) == 0) + wColor = 1; + } + if (xy.X == 0) + { + if (dir_x == -1) + dir_x = 1; + } + else if (xy.X >= ScreenBufferInfo.dwSize.X - NameLength - 1) + { + if (dir_x == 1) + dir_x = -1; + } + xy.X += dir_x; + + if (xy.Y == 0) + { + if (dir_y == -1) + dir_y = 1; + } + else if (xy.Y >= ScreenBufferInfo.dwSize.Y - 1) + { + if (dir_y == 1) + dir_y = -1; + } + xy.Y += dir_y; - if (xy.Y == 0) - { - if (dir_y == -1) - dir_y = 1; - } - else if (xy.Y >= ScreenBufferInfo.dwSize.Y - 1) - { - if (dir_y == 1) - dir_y = -1; - } - xy.Y += dir_y; #ifdef DISPLAY_COORD - WriteCoord(xy); + WriteCoord(xy); #endif /* def DISPLAY_COORD */ - DisplayTitle(); - WriteStringAt( - NameString, - xy, - wColor - ); - WaitForSingleObject( WaitableTimer, INFINITE ); - WriteStringAt( - NameString, - xy, - 0 - ); - } + + DisplayTitle(); + WriteStringAt(NameString, xy, wColor); + WaitForSingleObject(WaitableTimer, INFINITE); + WriteStringAt(NameString, xy, 0); + } } -int -main( - int argc, - char *argv [] - ) +int wmain(int argc, WCHAR* argv[]) { - LARGE_INTEGER lint; - DWORD Written; - COORD Coord = { 0, 0 }; + LARGE_INTEGER lint; + DWORD Written; + COORD Coord = { 0, 0 }; - myself = GetModuleHandle(NULL); + myself = GetModuleHandle(NULL); - GetConsoleScreenBufferInfo (GetStdHandle(STD_OUTPUT_HANDLE), - &ScreenBufferInfo); - ScreenBufferInfo.dwSize.X = ScreenBufferInfo.srWindow.Right - ScreenBufferInfo.srWindow.Left + 1; - ScreenBufferInfo.dwSize.Y = ScreenBufferInfo.srWindow.Bottom - ScreenBufferInfo.srWindow.Top + 1; - ScreenBuffer = CreateConsoleScreenBuffer( - GENERIC_WRITE, - 0, - NULL, - CONSOLE_TEXTMODE_BUFFER, - NULL - ); - if (INVALID_HANDLE_VALUE == ScreenBuffer) - { - _ftprintf( - stderr, - _TEXT("%s: could not create a new screen buffer\n"), - app_name - ); - return EXIT_FAILURE; - } - // Fill buffer with black background - FillConsoleOutputAttribute( ScreenBuffer, - 0, - ScreenBufferInfo.dwSize.X * ScreenBufferInfo.dwSize.Y, - Coord, - &Written ); + GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), + &ScreenBufferInfo); + ScreenBufferInfo.dwSize.X = ScreenBufferInfo.srWindow.Right - ScreenBufferInfo.srWindow.Left + 1; + ScreenBufferInfo.dwSize.Y = ScreenBufferInfo.srWindow.Bottom - ScreenBufferInfo.srWindow.Top + 1; + ScreenBuffer = CreateConsoleScreenBuffer(GENERIC_WRITE, + 0, + NULL, + CONSOLE_TEXTMODE_BUFFER, + NULL); + if (ScreenBuffer == INVALID_HANDLE_VALUE) + { + wprintf(L"%s: could not create a new screen buffer\n", app_name); + return EXIT_FAILURE; + } - WaitableTimer = CreateWaitableTimer( NULL, FALSE, NULL ); - if( WaitableTimer == INVALID_HANDLE_VALUE ) - { - printf( "CreateWaitabletimer() failed\n" ); - return 1; - } - lint.QuadPart = -2000000; - if( SetWaitableTimer( WaitableTimer, &lint, 200, NULL, NULL, FALSE ) == FALSE ) - { - printf( "SetWaitableTimer() failed: 0x%lx\n", GetLastError() ); - return 2; - } - SetConsoleActiveScreenBuffer(ScreenBuffer); - MainLoop(); - CloseHandle(ScreenBuffer); - return EXIT_SUCCESS; + /* Fill buffer with black background */ + FillConsoleOutputAttribute(ScreenBuffer, + 0, + ScreenBufferInfo.dwSize.X * ScreenBufferInfo.dwSize.Y, + Coord, + &Written); + + WaitableTimer = CreateWaitableTimer(NULL, FALSE, NULL); + if (WaitableTimer == INVALID_HANDLE_VALUE) + { + wprintf(L"CreateWaitabletimer() failed\n"); + return 1; + } + lint.QuadPart = -2000000; + if (!SetWaitableTimer(WaitableTimer, &lint, 200, NULL, NULL, FALSE)) + { + wprintf(L"SetWaitableTimer() failed: 0x%lx\n", GetLastError()); + return 2; + } + SetConsoleActiveScreenBuffer(ScreenBuffer); + MainLoop(); + CloseHandle(ScreenBuffer); + return EXIT_SUCCESS; } - /* EOF */ diff --git a/rosapps/applications/notevil/notevil.rbuild b/rosapps/applications/notevil/notevil.rbuild deleted file mode 100644 index 056d0462b75..00000000000 --- a/rosapps/applications/notevil/notevil.rbuild +++ /dev/null @@ -1,5 +0,0 @@ - - . - user32 - notevil.c - notevil.rc diff --git a/rosapps/applications/notevil/notevil.rc b/rosapps/applications/notevil/notevil.rc index ef07d1847dd..19db68ef204 100644 --- a/rosapps/applications/notevil/notevil.rc +++ b/rosapps/applications/notevil/notevil.rc @@ -1,7 +1,7 @@ -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Coders Console Parade\0" -#define REACTOS_STR_INTERNAL_NAME "notevil\0" -#define REACTOS_STR_ORIGINAL_FILENAME "notevil.exe\0" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS Coders Console Parade" +#define REACTOS_STR_INTERNAL_NAME "notevil" +#define REACTOS_STR_ORIGINAL_FILENAME "notevil.exe" #include /* @@ -20,69 +20,69 @@ STRINGTABLE MOVEABLE BEGIN - 1, "Boudewijn Dekker (Ariadne)" - 2, "Robert Bergkvist (FragDance Galore)" - 3, "Arindam Das" - 4, "Boudewijn Dekker" - 5, "Jason Eager" - 6, "Jason Filby" - 7, "Rex Jolliff" - 8, "Eric Kohl" - 9, "Hans Kremer" - 10, "Frederik Leemans" - 11, "Jean Michault" - 12, "Jim Noeth" - 13, "Brian Palmer" - 14, "Matt Pyne" - 15, "Jason Weiler" + 1, "Boudewijn Dekker (Ariadne)" + 2, "Robert Bergkvist (FragDance Galore)" + 3, "Arindam Das" + 4, "Boudewijn Dekker" + 5, "Jason Eager" + 6, "Jason Filby" + 7, "Rex Jolliff" + 8, "Eric Kohl" + 9, "Hans Kremer" + 10, "Frederik Leemans" + 11, "Jean Michault" + 12, "Jim Noeth" + 13, "Brian Palmer" + 14, "Matt Pyne" + 15, "Jason Weiler" END STRINGTABLE MOVEABLE BEGIN - 16, "David Welch" - 17, "Emanuele Aliberti" - 18, "Phillip Susi" - 19, "Paolo Pantaleo" - 20, "Hernan Ochoa" - 21, "Casper Hornstrup" - 22, "Steven Edwards" - 23, "KJK::Hyperion" - 24, "Robert Dickenson" - 25, "Eugene Ingerman" - 26, "Guido de Jong" - 27, "Jurgen van Gael" - 28, "Marty Dill" - 29, "Ge van Geldorp" - 30, "Richard Campbell" + 16, "David Welch" + 17, "Emanuele Aliberti" + 18, "Phillip Susi" + 19, "Paolo Pantaleo" + 20, "Hernan Ochoa" + 21, "Casper Hornstrup" + 22, "Steven Edwards" + 23, "KJK::Hyperion" + 24, "Robert Dickenson" + 25, "Eugene Ingerman" + 26, "Guido de Jong" + 27, "Jurgen van Gael" + 28, "Marty Dill" + 29, "Ge van Geldorp" + 30, "Richard Campbell" END STRINGTABLE MOVEABLE BEGIN - 31, "Gunnar Andre' Dalsnes" - 32, "Aleksey Bragin" - 33, "Royce Mitchell III" - 34, "Mark Tempel" - 35, "Art Yerkes" - 36, "Martin Fuchs" - 37, "Vizzini" - 38, "Filip Navara" - 39, "Andrew Greenwood" - 40, "Thomas Weidenmueller" - 41, "Jonathan Wilson" - 42, "Alex Ionescu" - 43, "Jim Tabor" - 44, "Magnus Olsen" - 45, "Herve Poussineau" + 31, "Gunnar Andre' Dalsnes" + 32, "Aleksey Bragin" + 33, "Royce Mitchell III" + 34, "Mark Tempel" + 35, "Art Yerkes" + 36, "Martin Fuchs" + 37, "Vizzini" + 38, "Filip Navara" + 39, "Andrew Greenwood" + 40, "Thomas Weidenmueller" + 41, "Jonathan Wilson" + 42, "Alex Ionescu" + 43, "Jim Tabor" + 44, "Magnus Olsen" + 45, "Herve Poussineau" END STRINGTABLE MOVEABLE BEGIN - 46, "Christoph von Wittich" - 47, "Brandon Turner" - 48, "Ged Murphy" - 49, "Klemens R. Friedl" - 50, "Maarten Bosma" - 51, "Saveliy Tretiakov" + 46, "Christoph von Wittich" + 47, "Brandon Turner" + 48, "Ged Murphy" + 49, "Klemens R. Friedl" + 50, "Maarten Bosma" + 51, "Saveliy Tretiakov" END /* EOF */ From 78d5b0bb3108e5e8d9c70a0ac60dd93c474add1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 23 Mar 2014 02:30:54 +0000 Subject: [PATCH 144/419] Fix CREDITS. svn path=/trunk/; revision=62551 --- reactos/CREDITS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/CREDITS b/reactos/CREDITS index 9267cf0b68c..7da55e81a0c 100644 --- a/reactos/CREDITS +++ b/reactos/CREDITS @@ -7,7 +7,7 @@ Andrew Greenwood Andrew Munger Arindam Das Art Yerkes -Ariadne +Boudewijn Dekker (Ariadne) Brandon Turner Brian Palmer Cameron M. Gutman From bc4526e022178fd48f1472d7616c8ef5e3733f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 23 Mar 2014 02:57:36 +0000 Subject: [PATCH 145/419] [NOTEVIL] New people from the CREDITS list. svn path=/trunk/; revision=62552 --- rosapps/applications/notevil/notevil.rc | 121 ++++++++++++++---------- rosapps/applications/notevil/resource.h | 2 +- 2 files changed, 74 insertions(+), 49 deletions(-) diff --git a/rosapps/applications/notevil/notevil.rc b/rosapps/applications/notevil/notevil.rc index 19db68ef204..54ee7bbdc6c 100644 --- a/rosapps/applications/notevil/notevil.rc +++ b/rosapps/applications/notevil/notevil.rc @@ -23,66 +23,91 @@ BEGIN 1, "Boudewijn Dekker (Ariadne)" 2, "Robert Bergkvist (FragDance Galore)" 3, "Arindam Das" - 4, "Boudewijn Dekker" - 5, "Jason Eager" - 6, "Jason Filby" - 7, "Rex Jolliff" - 8, "Eric Kohl" - 9, "Hans Kremer" - 10, "Frederik Leemans" - 11, "Jean Michault" - 12, "Jim Noeth" - 13, "Brian Palmer" - 14, "Matt Pyne" - 15, "Jason Weiler" + 4, "Jason Eager" + 5, "Jason Filby" + 6, "Rex Jolliff" + 7, "Eric Kohl" + 8, "Hans Kremer" + 9, "Frederik Leemans" + 10, "Jean Michault" + 11, "Jim Noeth" + 12, "Brian Palmer" + 13, "Matt Pyne" + 14, "Jason Weiler" + 15, "David Welch" END STRINGTABLE MOVEABLE BEGIN - 16, "David Welch" - 17, "Emanuele Aliberti" - 18, "Phillip Susi" - 19, "Paolo Pantaleo" - 20, "Hernan Ochoa" - 21, "Casper Hornstrup" - 22, "Steven Edwards" - 23, "KJK::Hyperion" - 24, "Robert Dickenson" - 25, "Eugene Ingerman" - 26, "Guido de Jong" - 27, "Jurgen van Gael" - 28, "Marty Dill" - 29, "Ge van Geldorp" - 30, "Richard Campbell" + 16, "Emanuele Aliberti" + 17, "Phillip Susi" + 18, "Paolo Pantaleo" + 19, "Hernan Ochoa" + 20, "Casper S. Hornstrup" + 21, "Steven Edwards" + 22, "KJK::Hyperion" + 23, "Robert Dickenson" + 24, "Eugene Ingerman" + 25, "Guido de Jong" + 26, "Jurgen van Gael" + 27, "Marty Dill" + 28, "Ge van Geldorp" + 29, "Richard Campbell" + 30, "Gunnar Andre' Dalsnes" END STRINGTABLE MOVEABLE BEGIN - 31, "Gunnar Andre' Dalsnes" - 32, "Aleksey Bragin" - 33, "Royce Mitchell III" - 34, "Mark Tempel" - 35, "Art Yerkes" - 36, "Martin Fuchs" - 37, "Vizzini" - 38, "Filip Navara" - 39, "Andrew Greenwood" - 40, "Thomas Weidenmueller" - 41, "Jonathan Wilson" - 42, "Alex Ionescu" - 43, "Jim Tabor" - 44, "Magnus Olsen" - 45, "Herve Poussineau" + 31, "Aleksey Bragin" + 32, "Royce Mitchell III" + 33, "Mark Tempel" + 34, "Art Yerkes" + 35, "Martin Fuchs" + 36, "Vizzini" + 37, "Filip Navara" + 38, "Andrew Greenwood" + 39, "Thomas Weidenmueller" + 40, "Jonathan Wilson" + 41, "Alex Ionescu" + 42, "James Tabor" + 43, "Magnus Olsen" + 44, "Herve Poussineau" + 45, "Christoph von Wittich" END STRINGTABLE MOVEABLE BEGIN - 46, "Christoph von Wittich" - 47, "Brandon Turner" - 48, "Ged Murphy" - 49, "Klemens R. Friedl" - 50, "Maarten Bosma" - 51, "Saveliy Tretiakov" + 46, "Brandon Turner" + 47, "Ged Murphy" + 48, "Klemens R. Friedl" + 49, "Maarten Bosma" + 50, "Saveliy Tretiakov" + 51, "Amine Khaldi" + 52, "Andrew Munger" + 53, "Cameron M. Gutman" + 54, "Daniel Reimer" + 55, "Dmitry Chapyshev" + 56, "Gregor Brunmar" + 57, "Gregor Schneider" + 58, "Iwan Fatahi" + 59, "Jeffrey Morlan" + 60, "Johannes Anderwald" +END + +STRINGTABLE MOVEABLE +BEGIN + 61, "Mark Weaver" + 62, "Matthias Kupfer" + 63, "Mike Nordell" + 64, "Nathan Woods" + 65, "Pablo Borobia" + 66, "Peter Ward" + 67, "Pierre Schweitzer" + 68, "Rafal Harabien" + 69, "Samuel Serapion" + 70, "Stefan Ginsberg" + 71, "Timo Kreuzer" + 72, "Victor Kirhenshtein" END /* EOF */ diff --git a/rosapps/applications/notevil/resource.h b/rosapps/applications/notevil/resource.h index 625598ac06c..2666fb3a890 100644 --- a/rosapps/applications/notevil/resource.h +++ b/rosapps/applications/notevil/resource.h @@ -1,2 +1,2 @@ #define RES_FIRST_INDEX 1 -#define RES_LAST_INDEX 51 +#define RES_LAST_INDEX 72 From a42481108cd3bc1c5e6fe97e2d26c806d46a8bcc Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 23 Mar 2014 17:24:10 +0000 Subject: [PATCH 146/419] [KMTEST:IO] - Disable IoRegisterDeviceInterface test, since it crashes on Windows - Add test showing that IoRegisterPlugPlayNotification's callback receives the full path to the symbolic link (this was fixed in r62249) svn path=/trunk/; revision=62553 --- rostests/kmtests/CMakeLists.txt | 1 + rostests/kmtests/kmtest_drv/guid.c | 7 ++ rostests/kmtests/ntos_io/IoDeviceInterface.c | 71 +++++++++++++++++++- 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 rostests/kmtests/kmtest_drv/guid.c diff --git a/rostests/kmtests/CMakeLists.txt b/rostests/kmtests/CMakeLists.txt index 0abd9fba8da..828a290c960 100644 --- a/rostests/kmtests/CMakeLists.txt +++ b/rostests/kmtests/CMakeLists.txt @@ -22,6 +22,7 @@ list(APPEND COMMON_SOURCE # kmtest_drv.sys driver # list(APPEND KMTEST_DRV_SOURCE + kmtest_drv/guid.c kmtest_drv/kmtest_drv.c kmtest_drv/testlist.c diff --git a/rostests/kmtests/kmtest_drv/guid.c b/rostests/kmtests/kmtest_drv/guid.c new file mode 100644 index 00000000000..f6ebc0c574d --- /dev/null +++ b/rostests/kmtests/kmtest_drv/guid.c @@ -0,0 +1,7 @@ +/* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */ + +#include +#include +#include + +/* NO CODE HERE, THIS IS JUST REQUIRED FOR THE GUID DEFINITIONS */ diff --git a/rostests/kmtests/ntos_io/IoDeviceInterface.c b/rostests/kmtests/ntos_io/IoDeviceInterface.c index 98edc8f682e..d6181cdf37e 100644 --- a/rostests/kmtests/ntos_io/IoDeviceInterface.c +++ b/rostests/kmtests/ntos_io/IoDeviceInterface.c @@ -8,6 +8,7 @@ /* TODO: what's with the prototypes at the top, what's with the if-ed out part? Doesn't process most results */ #include +#include #define NDEBUG #include @@ -85,7 +86,9 @@ static VOID DeviceInterfaceTest_Func() ExFreePool(SymbolicLinkList); } -START_TEST(IoDeviceInterface) +static +VOID +Test_IoRegisterDeviceInterface(VOID) { GUID Guid = {0x378de44c, 0x56ef, 0x11d1, {0xbc, 0x8c, 0x00, 0xa0, 0xc9, 0x14, 0x05, 0xdd}}; DEVICE_OBJECT DeviceObject; @@ -118,3 +121,69 @@ START_TEST(IoDeviceInterface) DeviceInterfaceTest_Func(); } + +static UCHAR NotificationContext; + +static DRIVER_NOTIFICATION_CALLBACK_ROUTINE NotificationCallback; +static +NTSTATUS +NTAPI +NotificationCallback( + _In_ PVOID NotificationStructure, + _Inout_opt_ PVOID Context) +{ + PDEVICE_INTERFACE_CHANGE_NOTIFICATION Notification = NotificationStructure; + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE Handle; + + ok_irql(PASSIVE_LEVEL); + ok_eq_pointer(Context, &NotificationContext); + ok_eq_uint(Notification->Version, 1); + ok_eq_uint(Notification->Size, sizeof(*Notification)); + + /* symbolic link must exist */ + trace("Interface change: %wZ\n", Notification->SymbolicLinkName); + InitializeObjectAttributes(&ObjectAttributes, + Notification->SymbolicLinkName, + OBJ_KERNEL_HANDLE, + NULL, + NULL); + Status = ZwOpenSymbolicLinkObject(&Handle, GENERIC_READ, &ObjectAttributes); + ok_eq_hex(Status, STATUS_SUCCESS); + if (!skip(NT_SUCCESS(Status), "No symbolic link\n")) + { + Status = ObCloseHandle(Handle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + } + return STATUS_SUCCESS; +} + +static +VOID +Test_IoRegisterPlugPlayNotification(VOID) +{ + NTSTATUS Status; + PVOID NotificationEntry; + + Status = IoRegisterPlugPlayNotification(EventCategoryDeviceInterfaceChange, + PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES, + (PVOID)&GUID_DEVICE_SYS_BUTTON, + KmtDriverObject, + NotificationCallback, + &NotificationContext, + &NotificationEntry); + ok_eq_hex(Status, STATUS_SUCCESS); + if (!skip(NT_SUCCESS(Status), "PlugPlayNotification not registered\n")) + { + Status = IoUnregisterPlugPlayNotification(NotificationEntry); + ok_eq_hex(Status, STATUS_SUCCESS); + } +} + +START_TEST(IoDeviceInterface) +{ + // FIXME: This test crashes in Windows + (void)Test_IoRegisterDeviceInterface; + Test_IoRegisterPlugPlayNotification(); +} \ No newline at end of file From 93e60bc7315e44b30f0c5c20d03cc32e70525c39 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 23 Mar 2014 17:33:01 +0000 Subject: [PATCH 147/419] [NTOS:PO] - Fix symbolic link name handling in PopAddRemoveSysCapsCallback. Fixes ACPI power button. CORE-8017 #resolve svn path=/trunk/; revision=62554 --- reactos/ntoskrnl/io/iomgr/deviface.c | 3 ++- reactos/ntoskrnl/po/events.c | 15 +-------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/reactos/ntoskrnl/io/iomgr/deviface.c b/reactos/ntoskrnl/io/iomgr/deviface.c index 4c4f6188e7b..f43d70f990d 100644 --- a/reactos/ntoskrnl/io/iomgr/deviface.c +++ b/reactos/ntoskrnl/io/iomgr/deviface.c @@ -739,7 +739,7 @@ IoGetDeviceInterfaces(IN CONST GUID *InterfaceClassGuid, if (ReturnBuffer.Length + KeyName.Length + sizeof(WCHAR) > ReturnBuffer.MaximumLength) { PWSTR NewBuffer; - ReturnBuffer.MaximumLength = (USHORT)max(ReturnBuffer.MaximumLength * sizeof(WCHAR), + ReturnBuffer.MaximumLength = (USHORT)max(2 * ReturnBuffer.MaximumLength, (USHORT)(ReturnBuffer.Length + KeyName.Length + 2 * sizeof(WCHAR))); @@ -800,6 +800,7 @@ NextReferenceString: } /* Add final NULL to ReturnBuffer */ + NT_ASSERT(ReturnBuffer.Length <= ReturnBuffer.MaximumLength); if (ReturnBuffer.Length >= ReturnBuffer.MaximumLength) { PWSTR NewBuffer; diff --git a/reactos/ntoskrnl/po/events.c b/reactos/ntoskrnl/po/events.c index ed549be1e8f..4e01ca1cf32 100644 --- a/reactos/ntoskrnl/po/events.c +++ b/reactos/ntoskrnl/po/events.c @@ -162,8 +162,6 @@ PopAddRemoveSysCapsCallback(IN PVOID NotificationStructure, BOOLEAN Arrival; ULONG Caps; NTSTATUS Status; - UNICODE_STRING DeviceName; - UNICODE_STRING DeviceNamePrefix = RTL_CONSTANT_STRING(L"\\??\\"); DPRINT("PopAddRemoveSysCapsCallback(%p %p)\n", NotificationStructure, Context); @@ -184,20 +182,10 @@ PopAddRemoveSysCapsCallback(IN PVOID NotificationStructure, { DPRINT("Arrival of %wZ\n", Notification->SymbolicLinkName); - DeviceName.Length = 0; - DeviceName.MaximumLength = Notification->SymbolicLinkName->MaximumLength + DeviceNamePrefix.MaximumLength; - DeviceName.Buffer = ExAllocatePool(PagedPool, DeviceName.MaximumLength); - if (!DeviceName.Buffer) return STATUS_INSUFFICIENT_RESOURCES; - - RtlCopyUnicodeString(&DeviceName, &DeviceNamePrefix); - RtlAppendUnicodeStringToString(&DeviceName, Notification->SymbolicLinkName); - - DPRINT("Opening handle to %wZ\n", &DeviceName); - /* Open the device */ InitializeObjectAttributes( &ObjectAttributes, - &DeviceName, + Notification->SymbolicLinkName, OBJ_KERNEL_HANDLE, NULL, NULL); @@ -208,7 +196,6 @@ PopAddRemoveSysCapsCallback(IN PVOID NotificationStructure, &IoStatusBlock, FILE_SHARE_READ | FILE_SHARE_WRITE, 0); - RtlFreeUnicodeString(&DeviceName); if (!NT_SUCCESS(Status)) { DPRINT1("ZwOpenFile() failed with status 0x%08lx\n", Status); From 486717eb27dbf93c946fb2f26c8f6894dc5afde4 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 24 Mar 2014 01:43:19 +0000 Subject: [PATCH 148/419] - Add CAPTUREBLT to our headers. svn path=/trunk/; revision=62555 --- reactos/include/psdk/metahost.idl | 75 +++++++++++++++++++++++++++++++ reactos/include/psdk/wingdi.h | 1 + 2 files changed, 76 insertions(+) diff --git a/reactos/include/psdk/metahost.idl b/reactos/include/psdk/metahost.idl index 51cd78415be..549d664c5fa 100644 --- a/reactos/include/psdk/metahost.idl +++ b/reactos/include/psdk/metahost.idl @@ -25,6 +25,30 @@ cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") cpp_quote("#undef LoadLibrary") cpp_quote("#endif") +typedef enum +{ + METAHOST_POLICY_HIGHCOMPAT = 0, + METAHOST_POLICY_APPLY_UPGRADE_POLICY = 0x08, + METAHOST_POLICY_EMULATE_EXE_LAUNCH = 0x10, + METAHOST_POLICY_SHOW_ERROR_DIALOG = 0x20, + METAHOST_POLICY_USE_PROCESS_IMAGE_PATH = 0x40, + METAHOST_POLICY_ENSURE_SKU_SUPPORTED = 0x80 +} METAHOST_POLICY_FLAGS; + +typedef enum +{ + CLR_DEBUGGING_MANAGED_EVENT_PENDING = 1 +} CLR_DEBUGGING_PROCESS_FLAGS; + +typedef struct _CLR_DEBUGGING_VERSION +{ + WORD wStructVersion; + WORD wMajor; + WORD wMinor; + WORD wBuild; + WORD wRevision; +} CLR_DEBUGGING_VERSION; + [ object, local, @@ -128,4 +152,55 @@ interface ICLRMetaHost : IUnknown [in] INT32 iExitCode); }; +[ + object, + local, + uuid(e2190695-77b2-492e-8e14-c4b3a7fdd593) +] +interface ICLRMetaHostPolicy : IUnknown +{ + HRESULT GetRequestedRuntime([in] METAHOST_POLICY_FLAGS dwPolicyFlags, + [in] LPCWSTR pwzBinary, [in] IStream *pCfgStream, + [in, out] LPWSTR pwzVersion, [in, out] DWORD *pcchVersion, + [out] LPWSTR pwzImageVersion, [out, in] DWORD *pcchImageVersion, + [out] DWORD *pdwConfigFlags, [in] REFIID riid, [retval, out] LPVOID *ppRuntime); +} + +[ + uuid(2ebcd49a-1b47-4a61-b13a-4a03701e594b) +] +coclass CLRMetaHostPolicy +{ + [default] interface ICLRMetaHostPolicy; +} + +[ + object, + local, + uuid(3151c08d-4d09-4f9b-8838-2880bf18fe51) +] +interface ICLRDebuggingLibraryProvider : IUnknown +{ + HRESULT ProvideLibrary([in] const WCHAR *pwszFileName, + [in] DWORD dwTimestamp, [in] DWORD dwSizeOfImage, + [out] HMODULE *phModule); +} + +[ + object, + local, + uuid(d28f3c5a-9634-4206-a509-477552eefb10) +] +interface ICLRDebugging : IUnknown +{ + HRESULT OpenVirtualProcess([in] ULONG64 moduleBaseAddress, + [in] IUnknown *pDataTarget, [in] ICLRDebuggingLibraryProvider *pLibraryProvider, + [in] CLR_DEBUGGING_VERSION *pMaxDebuggerSupportedVersion, + [in] REFIID riidProcess, [out] IUnknown **ppProcess, + [out, in] CLR_DEBUGGING_VERSION *pVersion, + [out] CLR_DEBUGGING_PROCESS_FLAGS *pdwFlags); + + HRESULT CanUnloadNow(HMODULE hModule); +} + cpp_quote("HRESULT WINAPI CLRCreateInstance(REFCLSID clsid, REFIID riid, LPVOID *ppInterface);") diff --git a/reactos/include/psdk/wingdi.h b/reactos/include/psdk/wingdi.h index d47c98daa07..762d3f9ceb5 100644 --- a/reactos/include/psdk/wingdi.h +++ b/reactos/include/psdk/wingdi.h @@ -1347,6 +1347,7 @@ extern "C" { #define LAYOUT_VBH 4 // Vertical before horizontal #define LAYOUT_ORIENTATIONMASK (LAYOUT_RTL | LAYOUT_BTT | LAYOUT_VBH) #define LAYOUT_BITMAPORIENTATIONPRESERVED 8 +#define CAPTUREBLT 0x40000000 #define NOMIRRORBITMAP 0x80000000 #if (WINVER > 0x400) #define CS_ENABLE 0x00000001 From 3f6ef52ad96f1c6426d9941e071faec6146cee3f Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 24 Mar 2014 03:28:07 +0000 Subject: [PATCH 149/419] - Fix CORE-7791. svn path=/trunk/; revision=62556 --- reactos/win32ss/gdi/ntgdi/bitblt.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/bitblt.c b/reactos/win32ss/gdi/ntgdi/bitblt.c index 7c5dba4f431..a567290dbda 100644 --- a/reactos/win32ss/gdi/ntgdi/bitblt.c +++ b/reactos/win32ss/gdi/ntgdi/bitblt.c @@ -155,8 +155,26 @@ NtGdiBitBlt( IN DWORD crBackColor, IN FLONG fl) { + DWORD dwTRop; + + if (ROP & CAPTUREBLT) + return NtGdiStretchBlt(hDCDest, + XDest, + YDest, + Width, + Height, + hDCSrc, + XSrc, + YSrc, + Width, + Height, + ROP, + crBackColor); + + dwTRop = ROP & ~(NOMIRRORBITMAP|CAPTUREBLT); + /* Forward to NtGdiMaskBlt */ - // TODO: What's fl for? + // TODO: What's fl for? LOL not to send this to MaskBit! return NtGdiMaskBlt(hDCDest, XDest, YDest, @@ -168,7 +186,7 @@ NtGdiBitBlt( NULL, 0, 0, - ROP, + dwTRop, crBackColor); } @@ -712,6 +730,8 @@ NtGdiStretchBlt( DWORD ROP, IN DWORD dwBackColor) { + DWORD dwTRop = ROP & ~(NOMIRRORBITMAP|CAPTUREBLT); + return GreStretchBltMask( hDCDest, XOriginDest, @@ -723,7 +743,7 @@ NtGdiStretchBlt( YOriginSrc, WidthSrc, HeightSrc, - ROP, + dwTRop, dwBackColor, NULL, 0, From 7d3f05d8a0312d77ab50513ac5f1cf5d136a7103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 24 Mar 2014 17:06:05 +0000 Subject: [PATCH 150/419] [BOOTDATA] Set PROMPT to $P$G$I instead of $I$P$G, so that the dumb Win cmd.exe can parse "completely" the prompt string (and succeeds in displaying the $p$g part) before failing on the $i part... See rev.59837 and CORE-7634 #comment A better fix was committed in revision 62557. svn path=/trunk/; revision=62557 --- reactos/boot/bootdata/hivesys.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/boot/bootdata/hivesys.inf b/reactos/boot/bootdata/hivesys.inf index b704b6bd28c..7d8858cb8c4 100644 --- a/reactos/boot/bootdata/hivesys.inf +++ b/reactos/boot/bootdata/hivesys.inf @@ -1214,7 +1214,7 @@ HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices","UNC",0x0000 HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","ComSpec",0x00020000,"%SystemRoot%\system32\cmd.exe" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","Path",0x00020000,"%SystemRoot%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\wbem" HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PATHEXT",0x00000000,".COM;.EXE;.BAT;.CMD" -HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PROMPT",0x00000000,"$I$P$G" +HKLM,"SYSTEM\CurrentControlSet\Control\Session Manager\Environment","PROMPT",0x00000000,"$P$G$I" 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","windir",0x00020000,"%SystemRoot%" From 94c8940bb610fbeb75352555dd6a36687a74ff40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 24 Mar 2014 17:29:40 +0000 Subject: [PATCH 151/419] [USER32]: Fix MSVC compilation. svn path=/trunk/; revision=62558 --- reactos/win32ss/user/user32/windows/menu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/menu.c b/reactos/win32ss/user/user32/windows/menu.c index 34c2a4ac2c3..2446ae3ba64 100644 --- a/reactos/win32ss/user/user32/windows/menu.c +++ b/reactos/win32ss/user/user32/windows/menu.c @@ -2545,9 +2545,8 @@ MenuExecFocusedItem(MTRACKER *Mt, PROSMENUINFO MenuInfo, UINT Flags) } else { - BOOL ret; ROSMENUINFO topmenuI; - ret = MenuGetRosMenuInfo(&topmenuI, Mt->TopMenu); + BOOL ret = MenuGetRosMenuInfo(&topmenuI, Mt->TopMenu); DWORD dwStyle = MenuInfo->dwStyle | (ret ? topmenuI.dwStyle : 0); if (dwStyle & MNS_NOTIFYBYPOS) From c1560dcc24881a9b06e0919268125650d961241d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 24 Mar 2014 20:54:01 +0000 Subject: [PATCH 152/419] [CMAKE] - GCC: Cosmetic changes only. - MSVC: * Cosmetic changes (the same as in GCC). * Only VS 10+ resource compiler supports /nologo , therefore define a rc_nologo_flag that sets /nologo for VS 10+ rc.exe, and nothing for VS < 10. CORE-6997 #comment Only VS10+ rc.exe supports /nologo, modify the fix in revision 62559. CORE-8023 svn path=/trunk/; revision=62559 --- reactos/cmake/gcc.cmake | 19 +++++++++---------- reactos/cmake/msvc.cmake | 26 ++++++++++++++++---------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index 9c31f25cce0..7098282de1c 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -139,7 +139,7 @@ endif() add_definitions(-D_inline=__inline) -# alternative arch name +# Alternative arch name if(ARCH STREQUAL "amd64") set(ARCH2 x86_64) else() @@ -268,18 +268,18 @@ if(NOT ARCH STREQUAL "i386") endif() function(generate_import_lib _libname _dllname _spec_file) - # generate the def for the import lib + # Generate the def for the import lib add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_libname}_implib.def COMMAND native-spec2def -n=${_dllname} -a=${ARCH2} --implib -d=${CMAKE_CURRENT_BINARY_DIR}/${_libname}_implib.def ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} native-spec2def) set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${_libname}_implib.def PROPERTIES EXTERNAL_OBJECT TRUE) - #create normal importlib + # Create normal importlib _add_library(${_libname} STATIC EXCLUDE_FROM_ALL ${CMAKE_CURRENT_BINARY_DIR}/${_libname}_implib.def) set_target_properties(${_libname} PROPERTIES LINKER_LANGUAGE "IMPLIB" PREFIX "") - #create delayed importlib + # Create delayed importlib _add_library(${_libname}_delayed STATIC EXCLUDE_FROM_ALL ${CMAKE_CURRENT_BINARY_DIR}/${_libname}_implib.def) set_target_properties(${_libname}_delayed PROPERTIES LINKER_LANGUAGE "IMPLIB_DELAYED" PREFIX "") endfunction() @@ -288,7 +288,7 @@ endfunction() set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def --kill-at --output-lib=") set(CMAKE_IMPLIB_DELAYED_CREATE_STATIC_LIBRARY "${CMAKE_DLLTOOL} --def --kill-at --output-delaylib=") function(spec2def _dllname _spec_file) - # do we also want to add importlib targets? + # Do we also want to add importlib targets? if(${ARGC} GREATER 2) if(${ARGN} STREQUAL "ADD_IMPORTLIB") set(__add_importlib TRUE) @@ -297,15 +297,15 @@ function(spec2def _dllname _spec_file) endif() endif() - # get library basename + # Get library basename get_filename_component(_file ${_dllname} NAME_WE) - # error out on anything else than spec + # Error out on anything else than spec if(NOT ${_spec_file} MATCHES ".*\\.spec") message(FATAL_ERROR "spec2def only takes spec files as input.") endif() - # generate exports def and stubs C file for the module + # Generate exports def and C stubs file for the DLL add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c COMMAND native-spec2def -n=${_dllname} -a=${ARCH2} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} @@ -320,7 +320,7 @@ macro(macro_mc FLAG FILE) set(COMMAND_MC ${CMAKE_MC_COMPILER} ${FLAG} -b ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos) endmacro() -#pseh lib, needed with mingw +# PSEH lib, needed with mingw set(PSEH_LIB "pseh") # Macros @@ -388,4 +388,3 @@ endfunction() macro(add_asm_files _target) list(APPEND ${_target} ${ARGN}) endmacro() - diff --git a/reactos/cmake/msvc.cmake b/reactos/cmake/msvc.cmake index f091215e58b..22bafe6b5ae 100644 --- a/reactos/cmake/msvc.cmake +++ b/reactos/cmake/msvc.cmake @@ -92,10 +92,16 @@ else() endif() if(MSVC_IDE AND (CMAKE_VERSION MATCHES "ReactOS")) - # for VS builds we'll only have en-US in resource files + # For VS builds we'll only have en-US in resource files add_definitions(/DLANGUAGE_EN_US) else() - set(CMAKE_RC_COMPILE_OBJECT " /nologo ${I18N_DEFS} /fo ") + # Only VS 10+ resource compiler supports /nologo + if(MSVC_VERSION GREATER 1599) + set(rc_nologo_flag "/nologo") + else() + set(rc_nologo_flag) + endif() + set(CMAKE_RC_COMPILE_OBJECT " ${rc_nologo_flag} ${I18N_DEFS} /fo ") set(CMAKE_ASM_COMPILE_OBJECT "cl ${cl_includes_flag} /nologo /X /I${REACTOS_SOURCE_DIR}/include/asm /I${REACTOS_BINARY_DIR}/include/asm /D__ASM__ /D_USE_ML /EP /c > .tmp" " /nologo /Cp /Fo /c /Ta .tmp") @@ -213,7 +219,7 @@ function(set_module_type_toolchain MODULE TYPE) endif() endfunction() -#define those for having real libraries +# Define those for having real libraries set(CMAKE_IMPLIB_CREATE_STATIC_LIBRARY "LINK /LIB /NOLOGO /OUT: ") set(CMAKE_STUB_ASM_COMPILE_OBJECT " /nologo /Cp /Fo /c /Ta ") function(add_delay_importlibs _module) @@ -246,12 +252,12 @@ function(generate_import_lib _libname _dllname _spec_file) COMMAND ${CMAKE_ASM_COMPILER} /Cp /Fo${_asm_stubs_file}.obj /c /Ta ${_asm_stubs_file} DEPENDS ${_asm_stubs_file}) else() - # be clear about the "language" + # Be clear about the "language" # Thanks MS for creating a stupid linker set_source_files_properties(${_asm_stubs_file} PROPERTIES LANGUAGE "STUB_ASM") endif() - # add our library + # Add our library if(MSVC_IDE) add_library(${_libname} STATIC EXCLUDE_FROM_ALL ${_asm_stubs_file}.obj) set_source_files_properties(${_asm_stubs_file}.obj PROPERTIES EXTERNAL_OBJECT 1) @@ -273,7 +279,7 @@ else() set(SPEC2DEF_ARCH i386) endif() function(spec2def _dllname _spec_file) - # do we also want to add importlib targets? + # Do we also want to add importlib targets? if(${ARGC} GREATER 2) if(${ARGN} STREQUAL "ADD_IMPORTLIB") set(__add_importlib TRUE) @@ -282,15 +288,15 @@ function(spec2def _dllname _spec_file) endif() endif() - # get library basename + # Get library basename get_filename_component(_file ${_dllname} NAME_WE) - # error out on anything else than spec + # Error out on anything else than spec if(NOT ${_spec_file} MATCHES ".*\\.spec") message(FATAL_ERROR "spec2def only takes spec files as input.") endif() - #generate def for the DLL and C stubs file + # Generate exports def and C stubs file for the DLL add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_file}.def ${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c COMMAND native-spec2def --ms -a=${SPEC2DEF_ARCH} -n=${_dllname} -d=${CMAKE_CURRENT_BINARY_DIR}/${_file}.def -s=${CMAKE_CURRENT_BINARY_DIR}/${_file}_stubs.c ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file} @@ -305,7 +311,7 @@ macro(macro_mc FLAG FILE) set(COMMAND_MC ${CMAKE_MC_COMPILER} ${FLAG} -b ${CMAKE_CURRENT_SOURCE_DIR}/${FILE}.mc -r ${REACTOS_BINARY_DIR}/include/reactos -h ${REACTOS_BINARY_DIR}/include/reactos) endmacro() -#pseh workaround +# PSEH workaround set(PSEH_LIB "pseh") # Use a full path for the x86 version of ml when using x64 VS. From edfeae46cf898c72846eeadf0f8b4c61013deef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 24 Mar 2014 21:40:16 +0000 Subject: [PATCH 153/419] [CMAKE] - Partly update/sync Windows-MSVC.cmake with RosBE 2.1.1 : few flags "fixes". Amine, can you please check whether there are other things to sync too (maybe those WinCE things, even if it's unuseful for ROS itself, and maybe some other vs. MSVC_C_ARCHITECTURE_ID _MSVC_C_ARCHITECTURE_FAMILY flags, and so on... and with syncs of other .cmake files??) - Remove unneeded manually setting of stack size, it is done automatically by the compiler. - Add a "/MANIFEST:NO" switch to the linker so that (unuseful) manifest files are not automatically created and added to the host-tools, especially, because that causes some concurrent accesses failures on MSVC 2005/2008... CORE-8023 svn path=/trunk/; revision=62560 --- reactos/cmake/Platform/Windows-MSVC.cmake | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake index 0d957237a60..baf6ad3a3bb 100644 --- a/reactos/cmake/Platform/Windows-MSVC.cmake +++ b/reactos/cmake/Platform/Windows-MSVC.cmake @@ -22,7 +22,7 @@ set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") set(CMAKE_LINK_LIBRARY_FLAG "") set(MSVC 1) -# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree +# hack: if a new cmake (which uses CMAKE_LINKER) runs on an old build tree # (where link was hardcoded) and where CMAKE_LINKER isn't in the cache # and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun) # hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex @@ -41,6 +41,7 @@ set(WIN32 1) if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE") set(CMAKE_CREATE_WIN32_EXE "/subsystem:windowsce /entry:WinMainCRTStartup") set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /entry:mainACRTStartup") + set(WINCE 1) else() set(CMAKE_CREATE_WIN32_EXE "/subsystem:windows") set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:console") @@ -80,6 +81,7 @@ if(NOT MSVC_VERSION) set(MSVC10) set(MSVC11) + set(MSVC12) set(MSVC60) set(MSVC70) set(MSVC71) @@ -87,7 +89,9 @@ if(NOT MSVC_VERSION) set(MSVC90) set(CMAKE_COMPILER_2005) set(CMAKE_COMPILER_SUPPORTS_PDBTYPE) - if(NOT "${_compiler_version}" VERSION_LESS 17) + if(NOT "${_compiler_version}" VERSION_LESS 18) + set(MSVC12 1) + elseif(NOT "${_compiler_version}" VERSION_LESS 17) set(MSVC11 1) elseif(NOT "${_compiler_version}" VERSION_LESS 16) set(MSVC10 1) @@ -106,7 +110,7 @@ if(NOT MSVC_VERSION) endif() endif() -if(MSVC_C_ARCHITECTURE_ID MATCHES 64) +if(MSVC_C_ARCHITECTURE_ID MATCHES 64 OR MSVC_CXX_ARCHITECTURE_ID MATCHES 64) set(CMAKE_CL_64 1) else() set(CMAKE_CL_64 0) @@ -160,7 +164,7 @@ set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") # executable linker flags set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") -# set the stack size and the machine type +# set the machine type set(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID}) if(NOT _MACHINE_ARCH_FLAG) set(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID}) @@ -173,7 +177,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE") endif() endif() set (CMAKE_EXE_LINKER_FLAGS_INIT - "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:${_MACHINE_ARCH_FLAG}") + "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${_MACHINE_ARCH_FLAG} /MANIFEST:NO") # add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype # on versions that support it From f329138f574279c80acecdbe9f36bb7b0a0e6209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 24 Mar 2014 21:45:04 +0000 Subject: [PATCH 154/419] [PSDK] Revert unwanted changes from revision 62555. svn path=/trunk/; revision=62561 --- reactos/include/psdk/metahost.idl | 75 ------------------------------- 1 file changed, 75 deletions(-) diff --git a/reactos/include/psdk/metahost.idl b/reactos/include/psdk/metahost.idl index 549d664c5fa..51cd78415be 100644 --- a/reactos/include/psdk/metahost.idl +++ b/reactos/include/psdk/metahost.idl @@ -25,30 +25,6 @@ cpp_quote("#ifdef WINE_NO_UNICODE_MACROS") cpp_quote("#undef LoadLibrary") cpp_quote("#endif") -typedef enum -{ - METAHOST_POLICY_HIGHCOMPAT = 0, - METAHOST_POLICY_APPLY_UPGRADE_POLICY = 0x08, - METAHOST_POLICY_EMULATE_EXE_LAUNCH = 0x10, - METAHOST_POLICY_SHOW_ERROR_DIALOG = 0x20, - METAHOST_POLICY_USE_PROCESS_IMAGE_PATH = 0x40, - METAHOST_POLICY_ENSURE_SKU_SUPPORTED = 0x80 -} METAHOST_POLICY_FLAGS; - -typedef enum -{ - CLR_DEBUGGING_MANAGED_EVENT_PENDING = 1 -} CLR_DEBUGGING_PROCESS_FLAGS; - -typedef struct _CLR_DEBUGGING_VERSION -{ - WORD wStructVersion; - WORD wMajor; - WORD wMinor; - WORD wBuild; - WORD wRevision; -} CLR_DEBUGGING_VERSION; - [ object, local, @@ -152,55 +128,4 @@ interface ICLRMetaHost : IUnknown [in] INT32 iExitCode); }; -[ - object, - local, - uuid(e2190695-77b2-492e-8e14-c4b3a7fdd593) -] -interface ICLRMetaHostPolicy : IUnknown -{ - HRESULT GetRequestedRuntime([in] METAHOST_POLICY_FLAGS dwPolicyFlags, - [in] LPCWSTR pwzBinary, [in] IStream *pCfgStream, - [in, out] LPWSTR pwzVersion, [in, out] DWORD *pcchVersion, - [out] LPWSTR pwzImageVersion, [out, in] DWORD *pcchImageVersion, - [out] DWORD *pdwConfigFlags, [in] REFIID riid, [retval, out] LPVOID *ppRuntime); -} - -[ - uuid(2ebcd49a-1b47-4a61-b13a-4a03701e594b) -] -coclass CLRMetaHostPolicy -{ - [default] interface ICLRMetaHostPolicy; -} - -[ - object, - local, - uuid(3151c08d-4d09-4f9b-8838-2880bf18fe51) -] -interface ICLRDebuggingLibraryProvider : IUnknown -{ - HRESULT ProvideLibrary([in] const WCHAR *pwszFileName, - [in] DWORD dwTimestamp, [in] DWORD dwSizeOfImage, - [out] HMODULE *phModule); -} - -[ - object, - local, - uuid(d28f3c5a-9634-4206-a509-477552eefb10) -] -interface ICLRDebugging : IUnknown -{ - HRESULT OpenVirtualProcess([in] ULONG64 moduleBaseAddress, - [in] IUnknown *pDataTarget, [in] ICLRDebuggingLibraryProvider *pLibraryProvider, - [in] CLR_DEBUGGING_VERSION *pMaxDebuggerSupportedVersion, - [in] REFIID riidProcess, [out] IUnknown **ppProcess, - [out, in] CLR_DEBUGGING_VERSION *pVersion, - [out] CLR_DEBUGGING_PROCESS_FLAGS *pdwFlags); - - HRESULT CanUnloadNow(HMODULE hModule); -} - cpp_quote("HRESULT WINAPI CLRCreateInstance(REFCLSID clsid, REFIID riid, LPVOID *ppInterface);") From fe4af53ff049f8b70adf4019705a1515494e18f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 24 Mar 2014 22:20:52 +0000 Subject: [PATCH 155/419] [EXT2] try_return() == try_return(S) with nothing in S . The code sometimes use it. Shut up MSVC warning C4003: not enough actual parameters for macro 'try_return'. svn path=/trunk/; revision=62562 --- reactos/drivers/filesystems/ext2/inc/ext2fsd.h | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/drivers/filesystems/ext2/inc/ext2fsd.h b/reactos/drivers/filesystems/ext2/inc/ext2fsd.h index dcf35d996ef..1c61f4f3224 100644 --- a/reactos/drivers/filesystems/ext2/inc/ext2fsd.h +++ b/reactos/drivers/filesystems/ext2/inc/ext2fsd.h @@ -60,6 +60,7 @@ typedef unsigned char BYTE; extern Ext2Data Ext2GlobalData; // try-finally simulation +#define try_return() { goto try_exit; } #define try_return(S) { S; goto try_exit; } #define try_return1(S) { S; goto try_exit1; } #define try_return2(S) { S; goto try_exit2; } From 79b28fc9b294f028db7ded93ea365734c42e2c0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 25 Mar 2014 19:49:35 +0000 Subject: [PATCH 156/419] [USP10]: Wine sync. SHA-1: 8fb52c7c5d711918fadf2590061d668093d14708 * usp10: Avoid non-standard array initialization. Fix this bug introduced in revision 62535. CORE-8029 #resolve #comment Fixed in revision 62563. svn path=/trunk/; revision=62563 --- reactos/dll/win32/usp10/bidi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/usp10/bidi.c b/reactos/dll/win32/usp10/bidi.c index 5ac37802b3e..8d94fd2692d 100644 --- a/reactos/dll/win32/usp10/bidi.c +++ b/reactos/dll/win32/usp10/bidi.c @@ -819,10 +819,13 @@ static void resolveResolved(unsigned baselevel, const WORD * pcls, WORD *plevel, static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel, int uCount, struct list *set) { int run_start, run_end, i; - Run runs[uCount]; int run_count = 0; + Run *runs; IsolatedRun *current_isolated; + runs = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(Run)); + if (!runs) return; + list_init(set); /* Build Runs */ @@ -849,6 +852,7 @@ static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel int type_fence, real_end; int j; current_isolated = HeapAlloc(GetProcessHeap(), 0, sizeof(IsolatedRun) + sizeof(WORD*)*uCount); + if (!current_isolated) break; run_start = runs[k].start; current_isolated->e = runs[k].e; @@ -936,6 +940,8 @@ search: } i++; } + + HeapFree(GetProcessHeap(), 0, runs); } /************************************************************* From 5399c9a10ce555b04393ac7063428c2dd99807e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 25 Mar 2014 23:16:02 +0000 Subject: [PATCH 157/419] [EXT2]: Revert the change of rev 62562 before finding a better fix... svn path=/trunk/; revision=62564 --- reactos/drivers/filesystems/ext2/inc/ext2fsd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/drivers/filesystems/ext2/inc/ext2fsd.h b/reactos/drivers/filesystems/ext2/inc/ext2fsd.h index 1c61f4f3224..dcf35d996ef 100644 --- a/reactos/drivers/filesystems/ext2/inc/ext2fsd.h +++ b/reactos/drivers/filesystems/ext2/inc/ext2fsd.h @@ -60,7 +60,6 @@ typedef unsigned char BYTE; extern Ext2Data Ext2GlobalData; // try-finally simulation -#define try_return() { goto try_exit; } #define try_return(S) { S; goto try_exit; } #define try_return1(S) { S; goto try_exit1; } #define try_return2(S) { S; goto try_exit2; } From 7872f6a066cc2ee20530d93001ae9667b0ad5895 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 26 Mar 2014 00:49:41 +0000 Subject: [PATCH 158/419] [CMAKE] Improve comparison. Needs to be send upstream, AmineKhaldi :) svn path=/trunk/; revision=62565 --- reactos/cmake/Platform/Windows-MSVC.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake index baf6ad3a3bb..bf73b791924 100644 --- a/reactos/cmake/Platform/Windows-MSVC.cmake +++ b/reactos/cmake/Platform/Windows-MSVC.cmake @@ -119,7 +119,7 @@ if(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64) set(CMAKE_CL_64 1) endif() -if("${MSVC_VERSION}" GREATER 1599) +if(MSVC_VERSION GREATER 1599) set(MSVC_INCREMENTAL_DEFAULT ON) endif() From c362a06522b21e2679050eb176271f9e791656fa Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 26 Mar 2014 11:08:45 +0000 Subject: [PATCH 159/419] [CMAKE] - Remove unnecessary allow_warnings throughout the code base - Make -Wnarrowing an error unless excepted specifically (only done in explorer) svn path=/trunk/; revision=62566 --- reactos/base/applications/atactl/CMakeLists.txt | 6 ------ reactos/base/applications/write/CMakeLists.txt | 6 ------ reactos/base/shell/explorer/CMakeLists.txt | 4 ++++ reactos/cmake/gcc.cmake | 1 - reactos/dll/3rdparty/libxslt/CMakeLists.txt | 1 - reactos/dll/win32/mciseq/CMakeLists.txt | 2 +- reactos/dll/win32/mciwave/CMakeLists.txt | 2 +- reactos/drivers/bluetooth/fbtusb/CMakeLists.txt | 4 +--- reactos/drivers/filesystems/ext2/CMakeLists.txt | 1 - reactos/drivers/storage/ide/uniata/CMakeLists.txt | 4 +--- reactos/lib/3rdparty/fullfat/CMakeLists.txt | 1 - reactos/lib/3rdparty/libmpg123/CMakeLists.txt | 1 - reactos/lib/drivers/lwip/CMakeLists.txt | 1 - reactos/lib/fslib/ext2lib/CMakeLists.txt | 1 - reactos/lib/pseh/CMakeLists.txt | 1 - reactos/lib/rossym_new/CMakeLists.txt | 1 - reactos/lib/sdk/crt/msvcrtex.cmake | 1 - reactos/win32ss/drivers/miniport/vga_new/CMakeLists.txt | 6 ------ 18 files changed, 8 insertions(+), 36 deletions(-) diff --git a/reactos/base/applications/atactl/CMakeLists.txt b/reactos/base/applications/atactl/CMakeLists.txt index 24e85a64138..c1885825833 100644 --- a/reactos/base/applications/atactl/CMakeLists.txt +++ b/reactos/base/applications/atactl/CMakeLists.txt @@ -7,10 +7,4 @@ add_executable(atactl atactl.cpp atactl.rc) set_module_type(atactl win32cui) add_importlibs(atactl advapi32 msvcrt kernel32 ntdll) -if(NOT MSVC) - # FIXME: http://www.cmake.org/Bug/view.php?id=12998 - #allow_warnings(atactl) - set_source_files_properties(atactl.cpp PROPERTIES COMPILE_FLAGS "-Wno-error") -endif() - add_cd_file(TARGET atactl DESTINATION reactos/system32 FOR all) diff --git a/reactos/base/applications/write/CMakeLists.txt b/reactos/base/applications/write/CMakeLists.txt index 11b4af9dc73..d0679a9313b 100644 --- a/reactos/base/applications/write/CMakeLists.txt +++ b/reactos/base/applications/write/CMakeLists.txt @@ -3,9 +3,3 @@ add_executable(write write.c rsrc.rc) set_module_type(write win32gui UNICODE) add_importlibs(write user32 gdi32 msvcrt kernel32) add_cd_file(TARGET write DESTINATION reactos/system32 FOR all) - -if(NOT MSVC) - # FIXME: http://www.cmake.org/Bug/view.php?id=12998 - #allow_warnings(write) - set_source_files_properties(write.c PROPERTIES COMPILE_FLAGS "-Wno-error") -endif() diff --git a/reactos/base/shell/explorer/CMakeLists.txt b/reactos/base/shell/explorer/CMakeLists.txt index 1763b276804..e9ae80abe7b 100644 --- a/reactos/base/shell/explorer/CMakeLists.txt +++ b/reactos/base/shell/explorer/CMakeLists.txt @@ -60,3 +60,7 @@ add_pch(explorer precomp.h SOURCE) add_dependencies(explorer psdk) add_cd_file(TARGET explorer DESTINATION reactos FOR all) add_cd_file(FILE ${CMAKE_CURRENT_SOURCE_DIR}/explorer-cfg-template.xml DESTINATION reactos FOR all) + +if(NOT MSVC) + add_compile_flags("-Wno-error=narrowing") +endif() diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index 7098282de1c..7f4f84f66e0 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -85,7 +85,6 @@ if(NOT CMAKE_C_COMPILER_ID STREQUAL "Clang") add_compile_flags("-Wno-error=unused-but-set-variable") endif() -add_compile_flags("-Wno-error=narrowing") add_compile_flags("-Wtype-limits -Wno-error=type-limits") if(ARCH STREQUAL "amd64") diff --git a/reactos/dll/3rdparty/libxslt/CMakeLists.txt b/reactos/dll/3rdparty/libxslt/CMakeLists.txt index 002daabc796..9a55a10adb9 100644 --- a/reactos/dll/3rdparty/libxslt/CMakeLists.txt +++ b/reactos/dll/3rdparty/libxslt/CMakeLists.txt @@ -49,5 +49,4 @@ add_cd_file(TARGET libxslt DESTINATION reactos/system32 FOR all) if(NOT MSVC) add_target_compile_flags(libxslt "-Wno-pointer-sign -Wno-unused-but-set-variable -Wno-unused-function") - allow_warnings(libxslt) endif() diff --git a/reactos/dll/win32/mciseq/CMakeLists.txt b/reactos/dll/win32/mciseq/CMakeLists.txt index 16799f9c4f6..ee5a095d385 100644 --- a/reactos/dll/win32/mciseq/CMakeLists.txt +++ b/reactos/dll/win32/mciseq/CMakeLists.txt @@ -15,5 +15,5 @@ add_importlibs(mciseq winmm user32 msvcrt kernel32 ntdll) add_cd_file(TARGET mciseq DESTINATION reactos/system32 FOR all) if(NOT MSVC) - allow_warnings(mciseq) + add_target_compile_flags(mciseq "-Wno-error=overflow") endif() diff --git a/reactos/dll/win32/mciwave/CMakeLists.txt b/reactos/dll/win32/mciwave/CMakeLists.txt index 67856b81ae9..bb7c3e13389 100644 --- a/reactos/dll/win32/mciwave/CMakeLists.txt +++ b/reactos/dll/win32/mciwave/CMakeLists.txt @@ -21,5 +21,5 @@ add_dependencies(mciwave psdk) add_cd_file(TARGET mciwave DESTINATION reactos/system32 FOR all) if(NOT MSVC) - allow_warnings(mciwave) + add_target_compile_flags(mciwave "-Wno-error=overflow") endif() diff --git a/reactos/drivers/bluetooth/fbtusb/CMakeLists.txt b/reactos/drivers/bluetooth/fbtusb/CMakeLists.txt index 255c565ff75..5b8288f5c12 100644 --- a/reactos/drivers/bluetooth/fbtusb/CMakeLists.txt +++ b/reactos/drivers/bluetooth/fbtusb/CMakeLists.txt @@ -12,10 +12,8 @@ list(APPEND SOURCE add_library(fbtusb SHARED ${SOURCE} fbtusb.rc) -# FIXME: http://www.cmake.org/Bug/view.php?id=12998 if(NOT MSVC) - #allow_warnings(fbtusb) - set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-error -Wno-unused-but-set-variable") + set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable") endif() set_module_type(fbtusb kernelmodedriver) diff --git a/reactos/drivers/filesystems/ext2/CMakeLists.txt b/reactos/drivers/filesystems/ext2/CMakeLists.txt index 54b8a2a7e13..afb66a6a2ed 100644 --- a/reactos/drivers/filesystems/ext2/CMakeLists.txt +++ b/reactos/drivers/filesystems/ext2/CMakeLists.txt @@ -28,7 +28,6 @@ if(NOT MSVC) add_compile_flags("-Wno-unused-but-set-variable") endif() -allow_warnings(ext2fs) target_link_libraries(ext2fs ${PSEH_LIB}) add_pch(ext2fs inc/ext2fsd.h SOURCE) set_module_type(ext2fs kernelmodedriver) diff --git a/reactos/drivers/storage/ide/uniata/CMakeLists.txt b/reactos/drivers/storage/ide/uniata/CMakeLists.txt index 03d8237f299..2236e470c05 100644 --- a/reactos/drivers/storage/ide/uniata/CMakeLists.txt +++ b/reactos/drivers/storage/ide/uniata/CMakeLists.txt @@ -22,9 +22,7 @@ add_library(uniata SHARED ${SOURCE} idedma.rc) if(NOT MSVC) - # FIXME: http://www.cmake.org/Bug/view.php?id=12998 - #allow_warnings(uniata) - set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-error -Wno-unused-but-set-variable -Wno-narrowing") + set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-unused-but-set-variable -Wno-narrowing") endif() add_pch(uniata stdafx.h SOURCE) diff --git a/reactos/lib/3rdparty/fullfat/CMakeLists.txt b/reactos/lib/3rdparty/fullfat/CMakeLists.txt index 5865a3cdf74..6163ff51e23 100644 --- a/reactos/lib/3rdparty/fullfat/CMakeLists.txt +++ b/reactos/lib/3rdparty/fullfat/CMakeLists.txt @@ -17,7 +17,6 @@ list(APPEND SOURCE ff_time.c) add_library(fullfat ${SOURCE}) -allow_warnings(fullfat) add_dependencies(fullfat bugcodes) if(NOT MSVC) diff --git a/reactos/lib/3rdparty/libmpg123/CMakeLists.txt b/reactos/lib/3rdparty/libmpg123/CMakeLists.txt index 969816d38a8..9a9b11a90fe 100644 --- a/reactos/lib/3rdparty/libmpg123/CMakeLists.txt +++ b/reactos/lib/3rdparty/libmpg123/CMakeLists.txt @@ -44,4 +44,3 @@ list(APPEND SOURCE add_library(libmpg123 ${SOURCE}) add_dependencies(libmpg123 psdk) add_pch(libmpg123 precomp.h SOURCE) -allow_warnings(libmpg123) diff --git a/reactos/lib/drivers/lwip/CMakeLists.txt b/reactos/lib/drivers/lwip/CMakeLists.txt index cbc6cc7ba0f..37521e3c8f0 100644 --- a/reactos/lib/drivers/lwip/CMakeLists.txt +++ b/reactos/lib/drivers/lwip/CMakeLists.txt @@ -61,7 +61,6 @@ add_library(lwip ${SOURCE}) add_dependencies(lwip bugcodes) add_pch(lwip precomp.h SOURCE) if(NOT MSVC) - allow_warnings(lwip) if(LTCG) add_compile_flags("-fno-builtin-malloc -fno-builtin-free") endif() diff --git a/reactos/lib/fslib/ext2lib/CMakeLists.txt b/reactos/lib/fslib/ext2lib/CMakeLists.txt index 7d02d4fa572..103760b751b 100644 --- a/reactos/lib/fslib/ext2lib/CMakeLists.txt +++ b/reactos/lib/fslib/ext2lib/CMakeLists.txt @@ -14,4 +14,3 @@ list(APPEND SOURCE add_library(ext2lib ${SOURCE}) add_pch(ext2lib Mke2fs.h SOURCE) add_dependencies(ext2lib psdk) -allow_warnings(ext2lib) diff --git a/reactos/lib/pseh/CMakeLists.txt b/reactos/lib/pseh/CMakeLists.txt index 6134e13681a..1c26807e8d1 100644 --- a/reactos/lib/pseh/CMakeLists.txt +++ b/reactos/lib/pseh/CMakeLists.txt @@ -20,7 +20,6 @@ if(NOT MSVC) endif() add_library(pseh ${SOURCE}) - allow_warnings(pseh) target_link_libraries(pseh chkstk) add_dependencies(pseh psdk) diff --git a/reactos/lib/rossym_new/CMakeLists.txt b/reactos/lib/rossym_new/CMakeLists.txt index e59c68bb435..afe89971330 100644 --- a/reactos/lib/rossym_new/CMakeLists.txt +++ b/reactos/lib/rossym_new/CMakeLists.txt @@ -19,4 +19,3 @@ list(APPEND SOURCE add_library(rossym ${SOURCE}) add_pch(rossym precomp.h) add_dependencies(rossym psdk bugcodes) -allow_warnings(rossym) diff --git a/reactos/lib/sdk/crt/msvcrtex.cmake b/reactos/lib/sdk/crt/msvcrtex.cmake index fb5ae7b425c..e9277cc2e24 100644 --- a/reactos/lib/sdk/crt/msvcrtex.cmake +++ b/reactos/lib/sdk/crt/msvcrtex.cmake @@ -83,7 +83,6 @@ set_source_files_properties(startup/crtexe.c if(NOT MSVC) target_link_libraries(msvcrtex oldnames) - allow_warnings(msvcrtex) endif() add_dependencies(msvcrtex psdk asm) diff --git a/reactos/win32ss/drivers/miniport/vga_new/CMakeLists.txt b/reactos/win32ss/drivers/miniport/vga_new/CMakeLists.txt index f12c71e4554..c712f12e87c 100644 --- a/reactos/win32ss/drivers/miniport/vga_new/CMakeLists.txt +++ b/reactos/win32ss/drivers/miniport/vga_new/CMakeLists.txt @@ -13,12 +13,6 @@ add_library(vga SHARED target_link_libraries(vga libcntpr) -# FIXME: http://www.cmake.org/Bug/view.php?id=12998 -if(NOT MSVC) - #allow_warnings(vga) - set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-error") -endif() - set_module_type(vga kernelmodedriver) add_importlibs(vga videoprt) From 9375945c2225a5f3d2db868318302609fc900187 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 26 Mar 2014 12:07:25 +0000 Subject: [PATCH 160/419] [NTDLL_APITEST] - Fix -Wformat warnings and enable -Wformat where possible svn path=/trunk/; revision=62568 --- rostests/apitests/ntdll/CMakeLists.txt | 4 +- .../apitests/ntdll/NtProtectVirtualMemory.c | 4 +- rostests/apitests/ntdll/RtlDosSearchPath_U.c | 2 +- .../apitests/ntdll/RtlDosSearchPath_Ustr.c | 16 +- .../apitests/ntdll/RtlGetFullPathName_U.c | 4 +- .../apitests/ntdll/RtlGetFullPathName_Ustr.c | 18 +-- .../ntdll/RtlGetFullPathName_UstrEx.c | 4 +- ...tlGetLengthWithoutTrailingPathSeperators.c | 20 +-- rostests/apitests/ntdll/RtlMemoryStream.c | 148 +++++++++--------- rostests/apitests/ntdll/Timer.c | 8 +- 10 files changed, 110 insertions(+), 118 deletions(-) diff --git a/rostests/apitests/ntdll/CMakeLists.txt b/rostests/apitests/ntdll/CMakeLists.txt index 9404d89918f..bc6b6be5ee7 100644 --- a/rostests/apitests/ntdll/CMakeLists.txt +++ b/rostests/apitests/ntdll/CMakeLists.txt @@ -36,9 +36,7 @@ set_module_type(ntdll_apitest win32cui) add_importlibs(ntdll_apitest msvcrt advapi32 kernel32 ntdll) if(NOT MSVC) - # FIXME: http://www.cmake.org/Bug/view.php?id=12998 - #add_target_compile_flags(ntdll_apitest "-Wno-format") - set_source_files_properties(${SOURCE} PROPERTIES COMPILE_FLAGS "-Wno-format") + set_source_files_properties(RtlGetFullPathName_UstrEx.c PROPERTIES COMPILE_FLAGS "-Wno-format") endif() add_cd_file(TARGET ntdll_apitest DESTINATION reactos/bin FOR all) diff --git a/rostests/apitests/ntdll/NtProtectVirtualMemory.c b/rostests/apitests/ntdll/NtProtectVirtualMemory.c index 080783acd1f..e1bbe04c57d 100644 --- a/rostests/apitests/ntdll/NtProtectVirtualMemory.c +++ b/rostests/apitests/ntdll/NtProtectVirtualMemory.c @@ -55,7 +55,7 @@ START_TEST(NtProtectVirtualMemory) PAGE_READONLY, &oldProtection); ok(NT_SUCCESS(status), "NtProtectVirtualMemory failed.\n"); - ok(oldProtection == PAGE_READWRITE, "Expected PAGE_READWRITE, got %08x.\n", oldProtection); + ok(oldProtection == PAGE_READWRITE, "Expected PAGE_READWRITE, got %08lx.\n", oldProtection); /* Try writing it */ StartSeh() @@ -76,7 +76,7 @@ START_TEST(NtProtectVirtualMemory) PAGE_NOACCESS, &oldProtection); ok(NT_SUCCESS(status), "NtProtectVirtualMemory failed.\n"); - ok(oldProtection == PAGE_READONLY, "Expected PAGE_READONLY, got %08x.\n", oldProtection); + ok(oldProtection == PAGE_READONLY, "Expected PAGE_READONLY, got %08lx.\n", oldProtection); /* Try writing it */ StartSeh() diff --git a/rostests/apitests/ntdll/RtlDosSearchPath_U.c b/rostests/apitests/ntdll/RtlDosSearchPath_U.c index b63f677a061..ee60f2100c8 100644 --- a/rostests/apitests/ntdll/RtlDosSearchPath_U.c +++ b/rostests/apitests/ntdll/RtlDosSearchPath_U.c @@ -205,7 +205,7 @@ START_TEST(RtlDosSearchPath_U) ok(Success, "DeleteFile failed, test might leave stale file\n"); swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); Success = RemoveDirectoryW(FileName); - ok(Success, "RemoveDirectory failed %(lu), test might leave stale directory\n", GetLastError()); + ok(Success, "RemoveDirectory failed (%lu), test might leave stale directory\n", GetLastError()); swprintf(FileName, L"C:\\%ls", CustomPath); Success = RemoveDirectoryW(FileName); ok(Success, "RemoveDirectory failed (%lu), test might leave stale directory\n", GetLastError()); diff --git a/rostests/apitests/ntdll/RtlDosSearchPath_Ustr.c b/rostests/apitests/ntdll/RtlDosSearchPath_Ustr.c index e71e8955ba8..df66d13db99 100644 --- a/rostests/apitests/ntdll/RtlDosSearchPath_Ustr.c +++ b/rostests/apitests/ntdll/RtlDosSearchPath_Ustr.c @@ -128,8 +128,8 @@ START_TEST(RtlDosSearchPath_Ustr) ok_eq_ustr(&CallerBuffer, &EmptyString); ok_eq_ustr(&DynamicString, &EmptyString); ok_eq_pointer(FullNameOut, NULL); - ok_eq_ulong(FilePartSize, 0); - ok_eq_ulong(LengthNeeded, 0); + ok_eq_ulong(FilePartSize, 0UL); + ok_eq_ulong(LengthNeeded, 0UL); /* Everything except FileNameString */ RtlInitUnicodeString(&PathString, NULL); @@ -156,8 +156,8 @@ START_TEST(RtlDosSearchPath_Ustr) ok_eq_ustr(&CallerBuffer, &EmptyString); ok_eq_ustr(&DynamicString, &EmptyString); ok_eq_pointer(FullNameOut, NULL); - ok_eq_ulong(FilePartSize, 0); - ok_eq_ulong(LengthNeeded, 0); + ok_eq_ulong(FilePartSize, 0UL); + ok_eq_ulong(LengthNeeded, 0UL); /* Passing CallerBuffer and DynamicString, but not FullNameOut is invalid */ RtlInitUnicodeString(&PathString, NULL); @@ -185,8 +185,8 @@ START_TEST(RtlDosSearchPath_Ustr) ok_eq_ustr(&ExtensionString, &EmptyString); ok_eq_ustr(&CallerBuffer, &EmptyString); ok_eq_ustr(&DynamicString, &EmptyString); - ok_eq_ulong(FilePartSize, 0); - ok_eq_ulong(LengthNeeded, 0); + ok_eq_ulong(FilePartSize, 0UL); + ok_eq_ulong(LengthNeeded, 0UL); /* All parameters given */ RtlInitUnicodeString(&PathString, NULL); @@ -215,6 +215,6 @@ START_TEST(RtlDosSearchPath_Ustr) ok_eq_ustr(&CallerBuffer, &EmptyString); ok_eq_ustr(&DynamicString, &EmptyString); ok_eq_pointer(FullNameOut, NULL); - ok_eq_ulong(FilePartSize, 0); - ok_eq_ulong(LengthNeeded, 0); + ok_eq_ulong(FilePartSize, 0UL); + ok_eq_ulong(LengthNeeded, 0UL); } diff --git a/rostests/apitests/ntdll/RtlGetFullPathName_U.c b/rostests/apitests/ntdll/RtlGetFullPathName_U.c index 6fc385d4bb9..f6f8e305a39 100644 --- a/rostests/apitests/ntdll/RtlGetFullPathName_U.c +++ b/rostests/apitests/ntdll/RtlGetFullPathName_U.c @@ -155,7 +155,7 @@ RunTestCases(VOID) ExpectedPathName[2] = UNICODE_NULL; break; default: - skip(0, "Invalid test!\n"); + skip("Invalid test!\n"); continue; } wcscat(ExpectedPathName, TestCases[i].FullPathName); @@ -207,7 +207,7 @@ RunTestCases(VOID) break; } default: - skip(0, "Invalid test!\n"); + skip("Invalid test!\n"); continue; } ExpectedFilePartSize += TestCases[i].FilePartSize; diff --git a/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c b/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c index 7d2eaa88880..bb3f4351de5 100644 --- a/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c +++ b/rostests/apitests/ntdll/RtlGetFullPathName_Ustr.c @@ -215,7 +215,7 @@ RunTestCases(VOID) break; } default: - skip(0, "Invalid test!\n"); + skip("Invalid test!\n"); continue; } wcscat(ExpectedPathName, TestCases[i].FullPathName); @@ -269,7 +269,7 @@ RunTestCases(VOID) break; } default: - skip(0, "Invalid test!\n"); + skip("Invalid test!\n"); continue; } ExpectedFilePartSize += TestCases[i].FilePartSize; @@ -288,7 +288,7 @@ RunTestCases(VOID) ok(PathType.Type == TestCases[i].PathType, "PathType = %d, expected %d\n", PathType.Type, TestCases[i].PathType); ok(PathType.Unknown == 1234 || broken(PathType.Unknown == 0) || - broken(PathType.Unknown == 32), "Unknown = %d\n", PathType.Unknown); + broken(PathType.Unknown == 32), "Unknown = %lu\n", PathType.Unknown); } } @@ -339,7 +339,7 @@ START_TEST(RtlGetFullPathName_Ustr) EndSeh(STATUS_ACCESS_VIOLATION); ok(PathType.Type == RtlPathTypeUnknown, "PathType = %d\n", PathType.Type); ok(PathType.Unknown == 1234 || - broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); + broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %lu\n", PathType.Unknown); /* check what else is initialized before it crashes */ PathType.Type = RtlPathTypeNotSet; @@ -354,7 +354,7 @@ START_TEST(RtlGetFullPathName_Ustr) broken(ShortName == NULL) /* Win7 */, "ShortName = %p\n", ShortName); ok(PathType.Type == RtlPathTypeUnknown, "PathType = %d\n", PathType.Type); ok(PathType.Unknown == 1234 || - broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); + broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %lu\n", PathType.Unknown); RtlInitUnicodeString(&FileName, L""); TempString = FileName; @@ -380,7 +380,7 @@ START_TEST(RtlGetFullPathName_Ustr) ok_eq_ustr(&FileName, &TempString); ok(PathType.Type == RtlPathTypeUnknown, "PathType = %d\n", PathType.Type); ok(PathType.Unknown == 1234 || - broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); + broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %lu\n", PathType.Unknown); RtlInitUnicodeString(&FileName, L""); TempString = FileName; @@ -393,7 +393,7 @@ START_TEST(RtlGetFullPathName_Ustr) ok_eq_ustr(&FileName, &TempString); ok(PathType.Type == RtlPathTypeUnknown, "PathType = %d\n", PathType.Type); ok(PathType.Unknown == 1234 || - broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); + broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %lu\n", PathType.Unknown); /* Show that NameInvalid is indeed BOOLEAN */ RtlInitUnicodeString(&FileName, L""); @@ -408,7 +408,7 @@ START_TEST(RtlGetFullPathName_Ustr) ok_eq_ustr(&FileName, &TempString); ok(PathType.Type == RtlPathTypeUnknown, "PathType = %d\n", PathType.Type); ok(PathType.Unknown == 1234 || - broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); + broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %lu\n", PathType.Unknown); ok(NameInvalidArray[0] == FALSE, "NameInvalid = %u\n", NameInvalidArray[0]); Okay = CheckBuffer(NameInvalidArray + 1, sizeof(NameInvalidArray) - sizeof(NameInvalidArray[0]), 0x55); ok(Okay, "CheckBuffer failed\n"); @@ -425,7 +425,7 @@ START_TEST(RtlGetFullPathName_Ustr) ok_eq_ustr(&FileName, &TempString); ok(PathType.Type == RtlPathTypeDriveAbsolute, "PathType = %d\n", PathType.Type); ok(PathType.Unknown == 1234 || - broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %d\n", PathType.Unknown); + broken(PathType.Unknown == 0) /* Win7 */, "Unknown = %lu\n", PathType.Unknown); /* check the actual functionality with different paths */ RunTestCases(); diff --git a/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c b/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c index acccb1594cc..7fd5adbae1e 100644 --- a/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c +++ b/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c @@ -207,7 +207,7 @@ RunTestCases(VOID) break; } default: - skip(0, "Invalid test!\n"); + skip("Invalid test!\n"); continue; } wcscat(ExpectedPathName, TestCases[i].FullPathName); @@ -268,7 +268,7 @@ RunTestCases(VOID) break; } default: - skip(0, "Invalid test!\n"); + skip("Invalid test!\n"); continue; } ExpectedFilePartSize += TestCases[i].FilePartSize; diff --git a/rostests/apitests/ntdll/RtlGetLengthWithoutTrailingPathSeperators.c b/rostests/apitests/ntdll/RtlGetLengthWithoutTrailingPathSeperators.c index 2310f733040..f336c940f77 100644 --- a/rostests/apitests/ntdll/RtlGetLengthWithoutTrailingPathSeperators.c +++ b/rostests/apitests/ntdll/RtlGetLengthWithoutTrailingPathSeperators.c @@ -110,11 +110,11 @@ START_TEST(RtlGetLengthWithoutTrailingPathSeperators) EndSeh(STATUS_SUCCESS); ok(res == pentry->expected_result, - "Unexpected result 0x%08x (expected 0x%08x) in [%d:%d]\n", + "Unexpected result 0x%08lx (expected 0x%08lx) in [%d:%d]\n", res, pentry->expected_result, i, pentry->line); ok(len == pentry->expected_output, - "Unexpected length %d (expected %d) in [%d:%d]\n", + "Unexpected length %lu (expected %lu) in [%d:%d]\n", len, pentry->expected_output, i, pentry->line); } @@ -128,10 +128,10 @@ START_TEST(RtlGetLengthWithoutTrailingPathSeperators) EndSeh(STATUS_SUCCESS); ok(res == STATUS_INVALID_PARAMETER, - "Unexpected result 0x%08x (expected STATUS_INVALID_PARAMETER)\n", + "Unexpected result 0x%08lx (expected STATUS_INVALID_PARAMETER)\n", res); ok(len == 0, - "Unexpected length %08x (expected 0)\n", + "Unexpected length %08lx (expected 0)\n", len); StartSeh() @@ -139,7 +139,7 @@ START_TEST(RtlGetLengthWithoutTrailingPathSeperators) EndSeh(STATUS_SUCCESS); ok(res == STATUS_INVALID_PARAMETER, - "Unexpected result 0x%08x (expected STATUS_INVALID_PARAMETER)\n", + "Unexpected result 0x%08lx (expected STATUS_INVALID_PARAMETER)\n", res); StartSeh() @@ -147,7 +147,7 @@ START_TEST(RtlGetLengthWithoutTrailingPathSeperators) EndSeh(STATUS_SUCCESS); ok(res == STATUS_INVALID_PARAMETER, - "Unexpected result 0x%08x (expected STATUS_INVALID_PARAMETER)\n", + "Unexpected result 0x%08lx (expected STATUS_INVALID_PARAMETER)\n", res); for(i = 0; i < 32; i++) @@ -159,11 +159,11 @@ START_TEST(RtlGetLengthWithoutTrailingPathSeperators) EndSeh(STATUS_SUCCESS); ok(res == STATUS_INVALID_PARAMETER, - "Unexpected result 0x%08x (expected STATUS_INVALID_PARAMETER)\n", + "Unexpected result 0x%08lx (expected STATUS_INVALID_PARAMETER)\n", res); ok(len == 0, - "Unexpected length %08x (expected 0)\n", + "Unexpected length %08lx (expected 0)\n", len); } @@ -174,10 +174,10 @@ START_TEST(RtlGetLengthWithoutTrailingPathSeperators) EndSeh(STATUS_SUCCESS); ok(res == STATUS_INVALID_PARAMETER, - "Unexpected result 0x%08x (expected STATUS_INVALID_PARAMETER)\n", + "Unexpected result 0x%08lx (expected STATUS_INVALID_PARAMETER)\n", res); ok(len == 0, - "Unexpected length %08x (expected 0)\n", + "Unexpected length %08lx (expected 0)\n", len); } diff --git a/rostests/apitests/ntdll/RtlMemoryStream.c b/rostests/apitests/ntdll/RtlMemoryStream.c index e2ae475d74c..5df223052c7 100644 --- a/rostests/apitests/ntdll/RtlMemoryStream.c +++ b/rostests/apitests/ntdll/RtlMemoryStream.c @@ -37,8 +37,8 @@ BOOL CompareStructsAndSaveForLater(PRTL_MEMORY_STREAM pold, PRTL_MEMORY_STREAM p // Compare if (pold->Vtbl != pnew->Vtbl) { if (equal) { trace("%s: \n", at); equal = FALSE; } trace("Vtbl changed from %p to %p\n", pold->Vtbl, pnew->Vtbl);} - if (pold->RefCount != pnew->RefCount) { if (equal) { trace("%s: \n", at); equal = FALSE; } trace("RefCount changed from %p to %p\n", pold->RefCount, pnew->RefCount); } - if (pold->Unk1 != pnew->Unk1) { if (equal) { trace("%s: \n", at); equal = FALSE; } trace("Unk1 changed from %p to %p\n", pold->Unk1, pnew->Unk1); } + if (pold->RefCount != pnew->RefCount) { if (equal) { trace("%s: \n", at); equal = FALSE; } trace("RefCount changed from %ld to %ld\n", pold->RefCount, pnew->RefCount); } + if (pold->Unk1 != pnew->Unk1) { if (equal) { trace("%s: \n", at); equal = FALSE; } trace("Unk1 changed from %lu to %lu\n", pold->Unk1, pnew->Unk1); } if (pold->Current != pnew->Current) { if (equal) { trace("%s: \n", at); equal = FALSE; } trace("Current changed from %p to %p\n", pold->Current, pnew->Current); } if (pold->Start != pnew->Start) { if (equal) { trace("%s: \n", at); equal = FALSE; } trace("Start changed from %p to %p\n", pold->Start, pnew->Start); } if (pold->End != pnew->End) { if (equal) { trace("%s: \n", at); equal = FALSE; } trace("End changed from %p to %p\n", pold->End, pnew->End); } @@ -96,7 +96,7 @@ void test_InProcess() CompareStructsAndSaveForLater(&previous, &stream, "After init"); - ok(stream.RefCount == 0, "RefCount has a wrong value: %d (expected %d).\n", stream.RefCount, 0); + ok(stream.RefCount == 0, "RefCount has a wrong value: %ld (expected %d).\n", stream.RefCount, 0); stream.Current = buffer2; stream.Start = buffer2; @@ -106,39 +106,33 @@ void test_InProcess() CompareStructsAndSaveForLater(&previous, &stream, "After assigning"); StartSeh() - res = IStream_QueryInterface((struct IStream*)&stream, NULL, NULL); - ok(res == E_INVALIDARG, "QueryInterface to IStream returned wrong hResult: 0x%08x.\n", res); - ok(stream.RefCount == 0, "RefCount has a wrong value: %d (expected %d).\n", stream.RefCount, 2); + IStream_QueryInterface((struct IStream*)&stream, NULL, NULL); EndSeh(STATUS_ACCESS_VIOLATION); StartSeh() - res = IStream_QueryInterface((struct IStream*)&stream, &IID_IStream, NULL); - ok(res == E_INVALIDARG, "QueryInterface to IStream returned wrong hResult: 0x%08x.\n", res); - ok(stream.RefCount == 1, "RefCount has a wrong value: %d (expected %d).\n", stream.RefCount, 2); + IStream_QueryInterface((struct IStream*)&stream, &IID_IStream, NULL); EndSeh(STATUS_ACCESS_VIOLATION); StartSeh() - res = IStream_QueryInterface((struct IStream*)&stream, NULL, (void**)&istream); - ok(res == E_INVALIDARG, "QueryInterface to IStream returned wrong hResult: 0x%08x.\n", res); - ok(stream.RefCount == 1, "RefCount has a wrong value: %d (expected %d).\n", stream.RefCount, 2); + IStream_QueryInterface((struct IStream*)&stream, NULL, (void**)&istream); EndSeh(STATUS_ACCESS_VIOLATION); StartSeh() res = IStream_QueryInterface((struct IStream*)&stream, &IID_IStream, (void**)&istream); - ok(res == S_OK, "QueryInterface to IStream returned wrong hResult: 0x%08x.\n", res); - ok(stream.RefCount == 2, "RefCount has a wrong value: %d (expected %d).\n", stream.RefCount, 2); + ok(res == S_OK, "QueryInterface to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(stream.RefCount == 2, "RefCount has a wrong value: %ld (expected %d).\n", stream.RefCount, 2); EndSeh(STATUS_SUCCESS); CompareStructsAndSaveForLater(&previous, &stream, "After QueryInterface"); StartSeh() res = IStream_Stat(istream, NULL, 0); - ok(res == STG_E_INVALIDPOINTER, "Stat to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == STG_E_INVALIDPOINTER, "Stat to IStream returned wrong hResult: 0x%08lx.\n", res); EndSeh(STATUS_SUCCESS); StartSeh() res = IStream_Stat(istream, &stat, STATFLAG_NONAME); - ok(res == S_OK, "Stat to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Stat to IStream returned wrong hResult: 0x%08lx.\n", res); EndSeh(STATUS_SUCCESS); ok(stream.Current == buffer2, @@ -148,56 +142,56 @@ void test_InProcess() ok(stream.End == buffer2 + sizeof(buffer2), "stream.End was changed unexpectedly\n"); ok(stat.cbSize.QuadPart == ((PUCHAR)stream.End - (PUCHAR)stream.Start), - "stat.cbSize has the wrong value %lld (expected %d)\n", + "stat.cbSize has the wrong value %I64u (expected %d)\n", stat.cbSize.QuadPart, (PUCHAR)stream.End - (PUCHAR)stream.Start); CompareStructsAndSaveForLater(&previous, &stream, "After Stat"); StartSeh() res = IStream_AddRef(istream); - ok(res == 3, "AddRef to IStream returned wrong hResult: %d.\n", res); + ok(res == 3, "AddRef to IStream returned wrong hResult: %ld.\n", res); EndSeh(STATUS_SUCCESS); StartSeh() res = IStream_AddRef(istream); - ok(res == 4, "AddRef to IStream returned wrong hResult: %d.\n", res); + ok(res == 4, "AddRef to IStream returned wrong hResult: %ld.\n", res); EndSeh(STATUS_SUCCESS); StartSeh() res = IStream_Release(istream); - ok(res == 3, "Release to IStream returned wrong hResult: %d.\n", res); + ok(res == 3, "Release to IStream returned wrong hResult: %ld.\n", res); EndSeh(STATUS_SUCCESS); StartSeh() res = IStream_AddRef(istream); - ok(res == 4, "AddRef to IStream returned wrong hResult: %d.\n", res); + ok(res == 4, "AddRef to IStream returned wrong hResult: %ld.\n", res); EndSeh(STATUS_SUCCESS); StartSeh() res = IStream_Release(istream); - ok(res == 3, "Release to IStream returned wrong hResult: %d.\n", res); + ok(res == 3, "Release to IStream returned wrong hResult: %ld.\n", res); EndSeh(STATUS_SUCCESS); StartSeh() res = IStream_Release(istream); - ok(res == 2, "Release to IStream returned wrong hResult: %d.\n", res); + ok(res == 2, "Release to IStream returned wrong hResult: %ld.\n", res); EndSeh(STATUS_SUCCESS); CompareStructsAndSaveForLater(&previous, &stream, "After AddRef"); StartSeh() res = IStream_Read(istream, NULL, 0, &bytesRead); - ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08lx.\n", res); EndSeh(STATUS_SUCCESS); StartSeh() res = IStream_Read(istream, buffer, 40, NULL); - ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08lx.\n", res); EndSeh(STATUS_ACCESS_VIOLATION); StartSeh() res = IStream_Read(istream, buffer + 40, 39, &bytesRead); - ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08lx.\n", res); EndSeh(STATUS_SUCCESS); if (SUCCEEDED(res)) @@ -205,7 +199,7 @@ void test_InProcess() bytesRead += 40; for (i = 0; i < bytesRead; i++) { - ok(buffer[i] == i, "Buffer[%d] contains a wrong number %d (expected %d).\n", i, buffer[i], i); + ok(buffer[i] == i, "Buffer[%lu] contains a wrong number %u (expected %lu).\n", i, buffer[i], i); } } @@ -222,15 +216,15 @@ void test_InProcess() StartSeh() move.QuadPart = -1; res = IStream_Seek(istream, move, STREAM_SEEK_END, &size); - ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); - ok(size.QuadPart == 0x9090909090909090ull, "Seek modified the new location in an error (0x%08x,0x%08x).\n", size.HighPart, size.LowPart); + ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(size.QuadPart == 0x9090909090909090ull, "Seek modified the new location in an error (0x%08lx,0x%08lx).\n", size.HighPart, size.LowPart); EndSeh(STATUS_SUCCESS); StartSeh() move.QuadPart = 0; res = IStream_Seek(istream, move, STREAM_SEEK_END, &size); - ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); - ok(size.QuadPart == (PUCHAR)stream.End - (PUCHAR)stream.Start, "Seek new location unexpected value: 0x%08x.\n", size.LowPart); + ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(size.QuadPart == (PUCHAR)stream.End - (PUCHAR)stream.Start, "Seek new location unexpected value: 0x%08lx.\n", size.LowPart); EndSeh(STATUS_SUCCESS); size.QuadPart = 0x9090909090909090ull; @@ -238,8 +232,8 @@ void test_InProcess() StartSeh() move.QuadPart = 1; res = IStream_Seek(istream, move, STREAM_SEEK_END, &size); - ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); - ok(size.QuadPart == (PUCHAR)stream.End - (PUCHAR)stream.Start - 1, "Seek new location unexpected value: 0x%08x.\n", size.LowPart); + ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(size.QuadPart == (PUCHAR)stream.End - (PUCHAR)stream.Start - 1, "Seek new location unexpected value: 0x%08lx.\n", size.LowPart); EndSeh(STATUS_SUCCESS); size.QuadPart = 0x9090909090909090ull; @@ -247,8 +241,8 @@ void test_InProcess() StartSeh() move.QuadPart = 2; res = IStream_Seek(istream, move, STREAM_SEEK_END, &size); - ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); - ok(size.QuadPart == (PUCHAR)stream.End - (PUCHAR)stream.Start - 2, "Seek new location unexpected value: 0x%08x.\n", size.LowPart); + ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(size.QuadPart == (PUCHAR)stream.End - (PUCHAR)stream.Start - 2, "Seek new location unexpected value: 0x%08lx.\n", size.LowPart); EndSeh(STATUS_SUCCESS); size.QuadPart = 0x9090909090909090ull; @@ -256,14 +250,14 @@ void test_InProcess() StartSeh() move.QuadPart = -20; res = IStream_Seek(istream, move, STREAM_SEEK_SET, &size); - ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); ok(size.QuadPart == 0x9090909090909090ull, "Seek modified the new location in an error.\n"); EndSeh(STATUS_SUCCESS); StartSeh() move.QuadPart = 4000; res = IStream_Seek(istream, move, STREAM_SEEK_SET, &size); - ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); ok(size.QuadPart == 0x9090909090909090ull, "Seek modified the new location in an error.\n"); EndSeh(STATUS_SUCCESS); @@ -271,11 +265,11 @@ void test_InProcess() move.QuadPart = 0x100000000ull; res = IStream_Seek(istream, move, STREAM_SEEK_SET, &size); #ifdef _WIN64 - ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); - ok(size.QuadPart == 0x9090909090909090ull, "Seek modified the new location in an error (0x%08x,0x%08x).\n", size.HighPart, size.LowPart); + ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(size.QuadPart == 0x9090909090909090ull, "Seek modified the new location in an error (0x%08lx,0x%08lx).\n", size.HighPart, size.LowPart); #else - ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); - ok(size.QuadPart == 0, "Seek new location unexpected value: 0x%08x.\n", size.LowPart); + ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(size.QuadPart == 0, "Seek new location unexpected value: 0x%08lx.\n", size.LowPart); #endif EndSeh(STATUS_SUCCESS); @@ -283,8 +277,8 @@ void test_InProcess() StartSeh() move.QuadPart = 0; res = IStream_Seek(istream, move, STREAM_SEEK_SET, &size); - ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); - ok(size.QuadPart == 0, "Seek new location unexpected value: 0x%08x.\n", size.LowPart); + ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(size.QuadPart == 0, "Seek new location unexpected value: 0x%08lx.\n", size.LowPart); EndSeh(STATUS_SUCCESS); #endif @@ -293,30 +287,30 @@ void test_InProcess() StartSeh() move.QuadPart = -20; res = IStream_Seek(istream, move, STREAM_SEEK_CUR, &size); - ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); - ok(size.QuadPart == 0x9090909090909090ull, "Seek modified the new location in an error (0x%08x,0x%08x).\n", size.HighPart, size.LowPart); + ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(size.QuadPart == 0x9090909090909090ull, "Seek modified the new location in an error (0x%08lx,0x%08lx).\n", size.HighPart, size.LowPart); EndSeh(STATUS_SUCCESS); StartSeh() move.QuadPart = 0x100000000ull; res = IStream_Seek(istream, move, STREAM_SEEK_CUR, &size); #ifdef _WIN64 - ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); - ok(size.QuadPart == 0x9090909090909090ull, "Seek modified the new location in an error (0x%08x,0x%08x).\n", size.HighPart, size.LowPart); + ok(res == STG_E_INVALIDPOINTER, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(size.QuadPart == 0x9090909090909090ull, "Seek modified the new location in an error (0x%08lx,0x%08lx).\n", size.HighPart, size.LowPart); #else - ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); - ok(size.QuadPart == 0, "Seek new location unexpected value: 0x%08x.\n", size.LowPart); + ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); + ok(size.QuadPart == 0, "Seek new location unexpected value: 0x%08lx.\n", size.LowPart); #endif EndSeh(STATUS_SUCCESS); StartSeh() move.QuadPart = 40; res = IStream_Seek(istream, move, STREAM_SEEK_SET, &size); - ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); EndSeh(STATUS_SUCCESS); ok(size.QuadPart == 40, - "Seek returned wrong offset %lld (expected %d)\n", + "Seek returned wrong offset %I64u (expected %d)\n", size.QuadPart, 40); ok(stream.Current == buffer2 + 40, @@ -329,13 +323,13 @@ void test_InProcess() res = IStream_Read(istream, buffer, sizeof(buffer), &bytesRead); - ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08lx.\n", res); if (SUCCEEDED(res)) { for (i = 0; i < bytesRead; i++) { - ok(buffer[i] == (i + 40), "Buffer[%d] contains a wrong number %d (expected %d).\n", i, buffer[i], i + 40); + ok(buffer[i] == (i + 40), "Buffer[%lu] contains a wrong number %u (expected %lu).\n", i, buffer[i], i + 40); } } @@ -349,17 +343,17 @@ void test_InProcess() res = IStream_Release(istream); - ok(res == 1, "Release to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == 1, "Release to IStream returned wrong hResult: 0x%08lx.\n", res); - ok(stream.RefCount == 1, "RefCount has a wrong value: %d (expected %d).\n", stream.RefCount, 1); + ok(stream.RefCount == 1, "RefCount has a wrong value: %ld (expected %d).\n", stream.RefCount, 1); res = IStream_Release(istream); - ok(res == S_OK, "Release to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Release to IStream returned wrong hResult: 0x%08lx.\n", res); - ok(stream.RefCount == 0, "RefCount has a wrong value: %d (expected %d).\n", stream.RefCount, 0); + ok(stream.RefCount == 0, "RefCount has a wrong value: %ld (expected %d).\n", stream.RefCount, 0); - ok(finalReleaseCallCount == 1, "FinalRelease was called %d times instead of 1.\n", finalReleaseCallCount); + ok(finalReleaseCallCount == 1, "FinalRelease was called %lu times instead of 1.\n", finalReleaseCallCount); } void test_OutOfProcess() @@ -399,7 +393,7 @@ void test_OutOfProcess() "stream.FinalRelease unexpected %p != %p.\n", stream.FinalRelease, RtlFinalReleaseOutOfProcessMemoryStream); - ok(stream.RefCount == 0, "RefCount has a wrong value: %d (expected %d).\n", stream.RefCount, 0); + ok(stream.RefCount == 0, "RefCount has a wrong value: %ld (expected %d).\n", stream.RefCount, 0); CompareStructsAndSaveForLater(&previous, &stream, "After init"); @@ -413,19 +407,19 @@ void test_OutOfProcess() res = IStream_QueryInterface((struct IStream*)&stream, &IID_IStream, (void**)&istream); - ok(res == S_OK, "QueryInterface to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "QueryInterface to IStream returned wrong hResult: 0x%08lx.\n", res); - ok(stream.RefCount == 1, "RefCount has a wrong value: %d (expected %d).\n", stream.RefCount, 1); + ok(stream.RefCount == 1, "RefCount has a wrong value: %ld (expected %d).\n", stream.RefCount, 1); ok(stream.ProcessHandle == process, - "ProcessHandle changed unexpectedly: 0x%08x (expected 0x%p)\n", + "ProcessHandle changed unexpectedly: 0x%p (expected 0x%p)\n", stream.ProcessHandle, process); CompareStructsAndSaveForLater(&previous, &stream, "After QueryInterface"); res = IStream_Stat(istream, &stat, STATFLAG_NONAME); - ok(res == S_OK, "Stat to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Stat to IStream returned wrong hResult: 0x%08lx.\n", res); ok(stream.Current == buffer2, "stream.Current points to the wrong address 0x%p (expected 0x%p)\n", @@ -433,24 +427,24 @@ void test_OutOfProcess() ok(stream.Start == buffer2, "stream.Start was changed unexpectedly\n"); ok(stream.End == buffer2 + sizeof(buffer2), "stream.End was changed unexpectedly\n"); ok(stream.ProcessHandle == process, - "ProcessHandle changed unexpectedly: 0x%08x (expected 0x%p)\n", + "ProcessHandle changed unexpectedly: 0x%p (expected 0x%p)\n", stream.ProcessHandle, process); ok(stat.cbSize.QuadPart == ((PUCHAR)stream.End - (PUCHAR)stream.Start), - "stat.cbSize has the wrong value %lld (expected %d)\n", + "stat.cbSize has the wrong value %I64u (expected %d)\n", stat.cbSize.QuadPart, (PUCHAR)stream.End - (PUCHAR)stream.Start); CompareStructsAndSaveForLater(&previous, &stream, "After Stat"); res = IStream_Read(istream, buffer, sizeof(buffer), &bytesRead); - ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08lx.\n", res); if (SUCCEEDED(res)) { for (i = 0; i < bytesRead; i++) { - ok(buffer[i] == i, "Buffer[%d] contains a wrong number %d (expected %d).\n", i, buffer[i], i); + ok(buffer[i] == i, "Buffer[%lu] contains a wrong number %u (expected %lu).\n", i, buffer[i], i); } } @@ -460,7 +454,7 @@ void test_OutOfProcess() ok(stream.Start == buffer2, "stream.Start was changed unexpectedly\n"); ok(stream.End == buffer2 + sizeof(buffer2), "stream.End was changed unexpectedly\n"); ok(stream.ProcessHandle == process, - "ProcessHandle changed unexpectedly: 0x%08x (expected 0x%p)\n", + "ProcessHandle changed unexpectedly: 0x%p (expected 0x%p)\n", stream.ProcessHandle, process); CompareStructsAndSaveForLater(&previous, &stream, "After Read 1"); @@ -469,10 +463,10 @@ void test_OutOfProcess() res = IStream_Seek(istream, move, STREAM_SEEK_SET, &size); - ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Seek to IStream returned wrong hResult: 0x%08lx.\n", res); ok(size.QuadPart == 40, - "Seek returned wrong offset %lld (expected %d)\n", + "Seek returned wrong offset %I64u (expected %d)\n", size.QuadPart, 40); ok(stream.Current == buffer2 + 40, @@ -481,20 +475,20 @@ void test_OutOfProcess() ok(stream.Start == buffer2, "stream.Start was changed unexpectedly\n"); ok(stream.End == buffer2 + sizeof(buffer2), "stream.End was changed unexpectedly\n"); ok(stream.ProcessHandle == process, - "ProcessHandle changed unexpectedly: 0x%08x (expected 0x%p)\n", + "ProcessHandle changed unexpectedly: 0x%p (expected 0x%p)\n", stream.ProcessHandle, process); CompareStructsAndSaveForLater(&previous, &stream, "After Seek"); res = IStream_Read(istream, buffer, sizeof(buffer), &bytesRead); - ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Read to IStream returned wrong hResult: 0x%08lx.\n", res); if (SUCCEEDED(res)) { for (i = 0; i < bytesRead; i++) { - ok(buffer[i] == (i + 40), "Buffer[%d] contains a wrong number %d (expected %d).\n", i, buffer[i], i + 40); + ok(buffer[i] == (i + 40), "Buffer[%lu] contains a wrong number %u (expected %lu).\n", i, buffer[i], i + 40); } } @@ -504,18 +498,18 @@ void test_OutOfProcess() ok(stream.Start == buffer2, "stream.Start was changed unexpectedly\n"); ok(stream.End == buffer2 + sizeof(buffer2), "stream.End was changed unexpectedly\n"); ok(stream.ProcessHandle == process, - "ProcessHandle changed unexpectedly: 0x%08x (expected 0x%p)\n", + "ProcessHandle changed unexpectedly: 0x%p (expected 0x%p)\n", stream.ProcessHandle, process); CompareStructsAndSaveForLater(&previous, &stream, "After Read 2"); res = IStream_Release(istream); - ok(res == S_OK, "Release to IStream returned wrong hResult: 0x%08x.\n", res); + ok(res == S_OK, "Release to IStream returned wrong hResult: 0x%08lx.\n", res); - ok(stream.RefCount == 0, "RefCount has a wrong value: %d (expected %d).\n", stream.RefCount, 0); + ok(stream.RefCount == 0, "RefCount has a wrong value: %ld (expected %d).\n", stream.RefCount, 0); - ok(finalReleaseCallCount == 1, "FinalRelease was called %d times instead of 1.\n", finalReleaseCallCount); + ok(finalReleaseCallCount == 1, "FinalRelease was called %lu times instead of 1.\n", finalReleaseCallCount); } START_TEST(RtlMemoryStream) diff --git a/rostests/apitests/ntdll/Timer.c b/rostests/apitests/ntdll/Timer.c index bfb9666dd10..0152c44b8c7 100644 --- a/rostests/apitests/ntdll/Timer.c +++ b/rostests/apitests/ntdll/Timer.c @@ -58,15 +58,15 @@ START_TEST(TimerResolution) TRUE, &CurrentResolution); ok_hex(Status, STATUS_SUCCESS); - printf("Current resolution: %d ; minimum resolution: %d\n", CurrentResolution, MinimumResolution); - ok(CurrentResolution <= MinimumResolution, "Current resolution: %d became too high! (minimum resolution: %d)\n", CurrentResolution, MinimumResolution); + printf("Current resolution: %lu ; minimum resolution: %lu\n", CurrentResolution, MinimumResolution); + ok(CurrentResolution <= MinimumResolution, "Current resolution: %lu became too high! (minimum resolution: %lu)\n", CurrentResolution, MinimumResolution); Status = NtSetTimerResolution(MaximumResolution - 1, TRUE, &CurrentResolution); ok_hex(Status, STATUS_SUCCESS); - printf("Current resolution: %d ; maximum resolution: %d\n", CurrentResolution, MaximumResolution); - ok(CurrentResolution >= MaximumResolution, "Current resolution: %d became too low! (maximum resolution: %d)\n", CurrentResolution, MaximumResolution); + printf("Current resolution: %lu ; maximum resolution: %lu\n", CurrentResolution, MaximumResolution); + ok(CurrentResolution >= MaximumResolution, "Current resolution: %lu became too low! (maximum resolution: %lu)\n", CurrentResolution, MaximumResolution); /* Get the current timer resolution */ Status = NtSetTimerResolution(0, /* Ignored */ From 2cc0229ae235f1ea6e5af9d094220cb94b97de3a Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 26 Mar 2014 12:15:55 +0000 Subject: [PATCH 161/419] [WINETESTS] - Remove unnecessary use of allow_warnings - Do not hide warnings that indicate actual problems in setuapi (non-Wine test, should move to apitests) and winmm (Wine bugs, fixed upstream) svn path=/trunk/; revision=62569 --- rostests/winetests/setupapi/CMakeLists.txt | 2 +- rostests/winetests/winmm/CMakeLists.txt | 2 +- rostests/winetests/ws2_32/CMakeLists.txt | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rostests/winetests/setupapi/CMakeLists.txt b/rostests/winetests/setupapi/CMakeLists.txt index de329a9dfaa..a703a98727f 100644 --- a/rostests/winetests/setupapi/CMakeLists.txt +++ b/rostests/winetests/setupapi/CMakeLists.txt @@ -17,5 +17,5 @@ add_importlibs(setupapi_winetest advapi32 setupapi user32 msvcrt kernel32) add_cd_file(TARGET setupapi_winetest DESTINATION reactos/bin FOR all) if(NOT MSVC) - add_target_compile_flags(setupapi_winetest "-Wno-format") + add_target_compile_flags(setupapi_winetest "-Wno-error=format") endif() diff --git a/rostests/winetests/winmm/CMakeLists.txt b/rostests/winetests/winmm/CMakeLists.txt index 914ee71e4ae..4f6743c0279 100644 --- a/rostests/winetests/winmm/CMakeLists.txt +++ b/rostests/winetests/winmm/CMakeLists.txt @@ -17,5 +17,5 @@ add_importlibs(winmm_winetest winmm user32 msvcrt kernel32 ntdll) add_cd_file(TARGET winmm_winetest DESTINATION reactos/bin FOR all) if(NOT MSVC) - add_target_compile_flags(winmm_winetest "-Wno-format -Wno-unused-but-set-variable") + add_target_compile_flags(winmm_winetest "-Wno-error=format -Wno-error=unused-but-set-variable") endif() diff --git a/rostests/winetests/ws2_32/CMakeLists.txt b/rostests/winetests/ws2_32/CMakeLists.txt index f09a62b7132..58bbfbc94c2 100644 --- a/rostests/winetests/ws2_32/CMakeLists.txt +++ b/rostests/winetests/ws2_32/CMakeLists.txt @@ -6,5 +6,4 @@ add_cd_file(TARGET ws2_32_winetest DESTINATION reactos/bin FOR all) if(NOT MSVC) add_target_compile_flags(ws2_32_winetest "-Wno-format") - allow_warnings(ws2_32_winetest) endif() From 0b12bc780bbed259d823dc8889580012f34298bb Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 26 Mar 2014 20:15:54 +0000 Subject: [PATCH 162/419] [COMCTL32][RAPPS] - Mark Str* functions as private in comctl32, they should be imported from shlwapi instead - Remove the associated hack in rapps CORE-7786 #resolve svn path=/trunk/; revision=62570 --- reactos/base/applications/rapps/rapps.h | 1 + reactos/base/applications/rapps/winmain.c | 8 +--- reactos/dll/win32/comctl32/comctl32.spec | 52 +++++++++++------------ 3 files changed, 28 insertions(+), 33 deletions(-) diff --git a/reactos/base/applications/rapps/rapps.h b/reactos/base/applications/rapps/rapps.h index 269e7dd405a..6c87803dc9f 100644 --- a/reactos/base/applications/rapps/rapps.h +++ b/reactos/base/applications/rapps/rapps.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include diff --git a/reactos/base/applications/rapps/winmain.c b/reactos/base/applications/rapps/winmain.c index f88eb942320..6fa869f506f 100644 --- a/reactos/base/applications/rapps/winmain.c +++ b/reactos/base/applications/rapps/winmain.c @@ -18,8 +18,6 @@ HIMAGELIST hImageTreeView = NULL; INT SelectedEnumType = ENUM_ALL_COMPONENTS; SETTINGS_INFO SettingsInfo; -PCWSTR (WINAPI *pStrStrIW)(PCWSTR, PCWSTR); - WCHAR szSearchPattern[MAX_STR_LEN] = L""; BOOL SearchEnabled = TRUE; @@ -29,7 +27,7 @@ SearchPatternMatch(PCWSTR szHaystack, PCWSTR szNeedle) if (!*szNeedle) return TRUE; /* TODO: Improve pattern search beyond a simple case-insensitive substring search. */ - return pStrStrIW(szHaystack, szNeedle) != NULL; + return StrStrIW(szHaystack, szNeedle) != NULL; } VOID @@ -907,10 +905,6 @@ wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nSh HANDLE hMutex = NULL; MSG Msg; - /* FIXME: CORE-7786 requires this to be loaded at runtime because we - * would get comctl32's version otherwise */ - pStrStrIW = (PVOID)GetProcAddress(GetModuleHandle(L"shlwapi"), "StrStrIW"); - switch (GetUserDefaultUILanguage()) { case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT): diff --git a/reactos/dll/win32/comctl32/comctl32.spec b/reactos/dll/win32/comctl32/comctl32.spec index 04dd54e1322..653efd71f15 100644 --- a/reactos/dll/win32/comctl32/comctl32.spec +++ b/reactos/dll/win32/comctl32/comctl32.spec @@ -62,32 +62,32 @@ 341 stdcall -noname SendNotify(long long long ptr) 342 stdcall -noname SendNotifyEx(long long long ptr long) 345 stdcall -ordinal TaskDialogIndirect(ptr ptr ptr ptr) -350 stdcall -noname StrChrA(str str) -351 stdcall -noname StrRChrA(str str long) -352 stdcall -noname StrCmpNA(str str long) -353 stdcall -noname StrCmpNIA(str str long) -354 stdcall -noname StrStrA(str str) -355 stdcall -noname StrStrIA(str str) -356 stdcall -noname StrCSpnA(str str) -357 stdcall -noname StrToIntA(str) -358 stdcall -noname StrChrW(wstr long) -359 stdcall -noname StrRChrW(wstr wstr long) -360 stdcall -noname StrCmpNW(wstr wstr long) -361 stdcall -noname StrCmpNIW(wstr wstr long) -362 stdcall -noname StrStrW(wstr wstr) -363 stdcall -noname StrStrIW(wstr wstr) -364 stdcall -noname StrCSpnW(wstr wstr) -365 stdcall -noname StrToIntW(wstr) -366 stdcall -noname StrChrIA(str long) -367 stdcall -noname StrChrIW(wstr long) -368 stdcall -noname StrRChrIA(str str long) -369 stdcall -noname StrRChrIW(wstr wstr long) -372 stdcall -noname StrRStrIA(str str str) -373 stdcall -noname StrRStrIW(wstr wstr wstr) -374 stdcall -noname StrCSpnIA(str str) -375 stdcall -noname StrCSpnIW(wstr wstr) -376 stdcall -noname IntlStrEqWorkerA(long str str long) -377 stdcall -noname IntlStrEqWorkerW(long wstr wstr long) +350 stdcall -noname -private StrChrA(str str) +351 stdcall -noname -private StrRChrA(str str long) +352 stdcall -noname -private StrCmpNA(str str long) +353 stdcall -noname -private StrCmpNIA(str str long) +354 stdcall -noname -private StrStrA(str str) +355 stdcall -noname -private StrStrIA(str str) +356 stdcall -noname -private StrCSpnA(str str) +357 stdcall -noname -private StrToIntA(str) +358 stdcall -noname -private StrChrW(wstr long) +359 stdcall -noname -private StrRChrW(wstr wstr long) +360 stdcall -noname -private StrCmpNW(wstr wstr long) +361 stdcall -noname -private StrCmpNIW(wstr wstr long) +362 stdcall -noname -private StrStrW(wstr wstr) +363 stdcall -noname -private StrStrIW(wstr wstr) +364 stdcall -noname -private StrCSpnW(wstr wstr) +365 stdcall -noname -private StrToIntW(wstr) +366 stdcall -noname -private StrChrIA(str long) +367 stdcall -noname -private StrChrIW(wstr long) +368 stdcall -noname -private StrRChrIA(str str long) +369 stdcall -noname -private StrRChrIW(wstr wstr long) +372 stdcall -noname -private StrRStrIA(str str str) +373 stdcall -noname -private StrRStrIW(wstr wstr wstr) +374 stdcall -noname -private StrCSpnIA(str str) +375 stdcall -noname -private StrCSpnIW(wstr wstr) +376 stdcall -noname -private IntlStrEqWorkerA(long str str long) +377 stdcall -noname -private IntlStrEqWorkerW(long wstr wstr long) 382 stdcall -noname SmoothScrollWindow(ptr) 383 stdcall -noname DoReaderMode(ptr) 384 stdcall -noname SetPathWordBreakProc(ptr long) From a7116b25de5daebfda28243b64c5c1b4e357fc89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 28 Mar 2014 01:05:55 +0000 Subject: [PATCH 163/419] [CMLIB][MKHIVE] (For host tools compilation only) Refine the #ifndefs, because SAL v2 annotations do not exist in MSVC < 2010. svn path=/trunk/; revision=62571 --- reactos/lib/cmlib/cmlib.h | 2 +- reactos/tools/mkhive/mkhive.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/lib/cmlib/cmlib.h b/reactos/lib/cmlib/cmlib.h index 4ea82bca508..d1b7af8dd62 100644 --- a/reactos/lib/cmlib/cmlib.h +++ b/reactos/lib/cmlib/cmlib.h @@ -23,7 +23,7 @@ #define strcasecmp _stricmp #endif//_WIN32 - #ifndef _MSC_VER + #if (!defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1600))) #define _In_ #define _Out_ #define _Inout_ diff --git a/reactos/tools/mkhive/mkhive.h b/reactos/tools/mkhive/mkhive.h index ecb4463697e..293a464a694 100644 --- a/reactos/tools/mkhive/mkhive.h +++ b/reactos/tools/mkhive/mkhive.h @@ -130,12 +130,13 @@ extern LIST_ENTRY CmiHiveListHead; #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif -#ifndef _MSC_VER +#if (!defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1600))) #define _In_ #define _Out_ #define _In_opt_ #define _In_range_(x, y) #endif + #define __drv_aliasesMem /* EOF */ From 6e64e3e58f9e17316d0a74efec31728d24ad1a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 28 Mar 2014 01:35:32 +0000 Subject: [PATCH 164/419] [MSVC] Turns C4163: "'identifier' : not available as an intrinsic function" into an error. svn path=/trunk/; revision=62572 --- reactos/cmake/msvc.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/cmake/msvc.cmake b/reactos/cmake/msvc.cmake index 22bafe6b5ae..7d3cedd4522 100644 --- a/reactos/cmake/msvc.cmake +++ b/reactos/cmake/msvc.cmake @@ -53,10 +53,11 @@ add_compile_flags("/wd4290") # - C4113: parameter lists differ # - C4129: unrecognized escape sequence # - TODO: C4133: incompatible types +# - C4163: 'identifier': not available as an intrinsic function # - C4229: modifiers on data are ignored # - C4700: uninitialized variable usage # - C4603: macro is not defined or definition is different after precompiled header use -add_compile_flags("/we4013 /we4020 /we4022 /we4047 /we4098 /we4113 /we4129 /we4229 /we4700 /we4603") +add_compile_flags("/we4013 /we4020 /we4022 /we4047 /we4098 /we4113 /we4129 /we4163 /we4229 /we4700 /we4603") # Enable warnings above the default level, but don't treat them as errors: # - C4115: named type definition in parentheses From ff83d33f52fb29f2598d4a199b1db21c0d8de43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 28 Mar 2014 02:43:29 +0000 Subject: [PATCH 165/419] Addendum to revision 62571: those SAL v2 annotations exist also in MSVC 2008 (but still not in MSVC <= 2005). svn path=/trunk/; revision=62573 --- reactos/lib/cmlib/cmlib.h | 2 +- reactos/tools/mkhive/mkhive.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/lib/cmlib/cmlib.h b/reactos/lib/cmlib/cmlib.h index d1b7af8dd62..2a44fe45387 100644 --- a/reactos/lib/cmlib/cmlib.h +++ b/reactos/lib/cmlib/cmlib.h @@ -23,7 +23,7 @@ #define strcasecmp _stricmp #endif//_WIN32 - #if (!defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1600))) + #if (!defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1500))) #define _In_ #define _Out_ #define _Inout_ diff --git a/reactos/tools/mkhive/mkhive.h b/reactos/tools/mkhive/mkhive.h index 293a464a694..cead25ecead 100644 --- a/reactos/tools/mkhive/mkhive.h +++ b/reactos/tools/mkhive/mkhive.h @@ -130,7 +130,7 @@ extern LIST_ENTRY CmiHiveListHead; #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif -#if (!defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1600))) +#if (!defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1500))) #define _In_ #define _Out_ #define _In_opt_ From fc714e32cf722d751de8c3ca7dab965cc3d32e45 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 29 Mar 2014 14:59:13 +0000 Subject: [PATCH 166/419] [COMP] - Silence warnings svn path=/trunk/; revision=62575 --- reactos/base/applications/cmdutils/comp/comp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/base/applications/cmdutils/comp/comp.c b/reactos/base/applications/cmdutils/comp/comp.c index 2446ddab5ae..0bec824bf9f 100644 --- a/reactos/base/applications/cmdutils/comp/comp.c +++ b/reactos/base/applications/cmdutils/comp/comp.c @@ -76,10 +76,10 @@ int _tmain (int argc, TCHAR *argv[]) --argc; switch (argv[i][1]) { case 'A': bAscii = TRUE; - _tprintf(_T("/a not Supported\n")); /*FIXME: needs adding */ + _tprintf(_T("/a not Supported\n")); (void)bAscii; /*FIXME: needs adding */ break; case 'L': bLineNos = TRUE; - _tprintf(_T("/l not supported\n")); /*FIXME: needs adding */ + _tprintf(_T("/l not supported\n")); (void)bLineNos; /*FIXME: needs adding */ break; case '?': Usage(); return EXIT_SUCCESS; From 2101c5afd771786ca2401301362dec3e21264ae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 29 Mar 2014 17:09:46 +0000 Subject: [PATCH 167/419] Addendum to rev 62573: simplify my story, thanks Amine ;) svn path=/trunk/; revision=62576 --- reactos/lib/cmlib/cmlib.h | 2 +- reactos/tools/mkhive/mkhive.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/lib/cmlib/cmlib.h b/reactos/lib/cmlib/cmlib.h index 2a44fe45387..0ddfabd3443 100644 --- a/reactos/lib/cmlib/cmlib.h +++ b/reactos/lib/cmlib/cmlib.h @@ -23,7 +23,7 @@ #define strcasecmp _stricmp #endif//_WIN32 - #if (!defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1500))) + #if (!defined(_MSC_VER) || (_MSC_VER < 1500)) #define _In_ #define _Out_ #define _Inout_ diff --git a/reactos/tools/mkhive/mkhive.h b/reactos/tools/mkhive/mkhive.h index cead25ecead..0cd9eb937a2 100644 --- a/reactos/tools/mkhive/mkhive.h +++ b/reactos/tools/mkhive/mkhive.h @@ -130,7 +130,7 @@ extern LIST_ENTRY CmiHiveListHead; #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif -#if (!defined(_MSC_VER) || (defined(_MSC_VER) && (_MSC_VER < 1500))) +#if (!defined(_MSC_VER) || (_MSC_VER < 1500)) #define _In_ #define _Out_ #define _In_opt_ From 79ca3bfc7f27d7419329f38367eed79649d017a6 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 29 Mar 2014 17:18:14 +0000 Subject: [PATCH 168/419] [SYSSETUP] - Store the administrator account name as the default user name. - Extend the maximum password length to 127 characters. CORE-7762 #resolve svn path=/trunk/; revision=62577 --- reactos/dll/win32/syssetup/lang/bg-BG.rc | 9 ++- reactos/dll/win32/syssetup/lang/cs-CZ.rc | 9 ++- reactos/dll/win32/syssetup/lang/de-DE.rc | 9 ++- reactos/dll/win32/syssetup/lang/el-GR.rc | 9 ++- reactos/dll/win32/syssetup/lang/en-US.rc | 9 ++- reactos/dll/win32/syssetup/lang/es-ES.rc | 9 ++- reactos/dll/win32/syssetup/lang/et-EE.rc | 9 ++- reactos/dll/win32/syssetup/lang/fr-FR.rc | 9 ++- reactos/dll/win32/syssetup/lang/he-IL.rc | 9 ++- reactos/dll/win32/syssetup/lang/hu-HU.rc | 9 ++- reactos/dll/win32/syssetup/lang/id-ID.rc | 9 ++- reactos/dll/win32/syssetup/lang/it-IT.rc | 9 ++- reactos/dll/win32/syssetup/lang/ja-JP.rc | 9 ++- reactos/dll/win32/syssetup/lang/nl-NL.rc | 9 ++- reactos/dll/win32/syssetup/lang/no-NO.rc | 9 ++- reactos/dll/win32/syssetup/lang/pl-PL.rc | 9 ++- reactos/dll/win32/syssetup/lang/pt-BR.rc | 9 ++- reactos/dll/win32/syssetup/lang/ro-RO.rc | 9 ++- reactos/dll/win32/syssetup/lang/ru-RU.rc | 9 ++- reactos/dll/win32/syssetup/lang/sk-SK.rc | 9 ++- reactos/dll/win32/syssetup/lang/sq-AL.rc | 9 ++- reactos/dll/win32/syssetup/lang/tr-TR.rc | 9 ++- reactos/dll/win32/syssetup/lang/uk-UA.rc | 9 ++- reactos/dll/win32/syssetup/lang/zh-CN.rc | 9 ++- reactos/dll/win32/syssetup/resource.h | 1 + reactos/dll/win32/syssetup/wizard.c | 75 ++++++++++++++++++++---- 26 files changed, 257 insertions(+), 35 deletions(-) diff --git a/reactos/dll/win32/syssetup/lang/bg-BG.rc b/reactos/dll/win32/syssetup/lang/bg-BG.rc index d8c94dfe5fc..53ad98af245 100644 --- a/reactos/dll/win32/syssetup/lang/bg-BG.rc +++ b/reactos/dll/win32/syssetup/lang/bg-BG.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Настройката ще създаде потребителска сметка, под името „Administrator“. Можете да използвате тази сметка, за да получите пълен достъп до компютъра.", IDC_STATIC, 45, 57, 250, 25 - LTEXT "Напишете парола за „Administrator“, не по- дълга от 14 знака.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Напишете парола за „Administrator“, не по- дълга от 127 знака.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Парола за „Administrator“:", IDC_STATIC, 45, 104, 95, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "По&твърдете паролата:", IDC_STATIC, 45, 123, 95, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "Грешка при DllInstall: " IDS_TIMEOUT "Просрочване на рагистрирането" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/cs-CZ.rc b/reactos/dll/win32/syssetup/lang/cs-CZ.rc index d7070b53216..f94b9705d0e 100644 --- a/reactos/dll/win32/syssetup/lang/cs-CZ.rc +++ b/reactos/dll/win32/syssetup/lang/cs-CZ.rc @@ -52,7 +52,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Instalátor vytvoří uživatelský účet nazvaný Administrator. Můžete tento účet použít, pokud budete potřebovat úplný přístup k Vašemu počítači.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Zadejte heslo účtu Administrator o délce 14 znaků nebo méně.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Zadejte heslo účtu Administrator o délce 127 znaků nebo méně.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Heslo:", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "&Potvrdit heslo:", IDC_STATIC, 54, 123, 75, 8 @@ -154,6 +154,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall failed: " IDS_TIMEOUT "Vypršel časový limit registrace" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/de-DE.rc b/reactos/dll/win32/syssetup/lang/de-DE.rc index 950b663d016..f39054967f8 100644 --- a/reactos/dll/win32/syssetup/lang/de-DE.rc +++ b/reactos/dll/win32/syssetup/lang/de-DE.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Das Setup wird ein Administratorkonto erstellen. Benutzen Sie es, wenn Sie vollen Zugriff auf Ihren Computer benötigen.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Geben Sie ein Passwort für das Administratorkonto mit max. 14 Zeichen ein.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Geben Sie ein Passwort für das Administratorkonto mit max. 127 Zeichen ein.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Administratorpasswort:", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "&Passwort bestätigen:", IDC_STATIC, 54, 123, 75, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall fehlgeschlagen: " IDS_TIMEOUT "Zeitüberschreitung während der Registrierung" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/el-GR.rc b/reactos/dll/win32/syssetup/lang/el-GR.rc index 331f575bf16..3bbc664c2a1 100644 --- a/reactos/dll/win32/syssetup/lang/el-GR.rc +++ b/reactos/dll/win32/syssetup/lang/el-GR.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Η εγκατάσταση θα δημιουργήσει ένα λογαριαρισμό διαχειριστή στον υπολογιστή σας με το όνομα Administrator. Με το λογιαριασμό διαχειριστή μπορείτε να αποκτήσετε τον πλήρη έλεγχο του υπολογιστή.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Εισάγετε παρακάτω τον κωδικό πρόσβασης διαχειριστή ο οποίος δεν πρέπει να ξεπερνά τους 14 χαρακτήρες.", IDC_STATIC, 54, 83, 250, 16 + LTEXT "Εισάγετε παρακάτω τον κωδικό πρόσβασης διαχειριστή ο οποίος δεν πρέπει να ξεπερνά τους 127 χαρακτήρες.", IDC_STATIC, 54, 83, 250, 16 LTEXT "&Κωδικός πρόσβασης:", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "&Επιβεβαίωση κωδικού:", IDC_STATIC, 54, 123, 75, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "Το DllInstall απέτυχε: " IDS_TIMEOUT "Λήξη χρόνου καταχώρησης" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/en-US.rc b/reactos/dll/win32/syssetup/lang/en-US.rc index 65d1cff6020..2719e43f30b 100644 --- a/reactos/dll/win32/syssetup/lang/en-US.rc +++ b/reactos/dll/win32/syssetup/lang/en-US.rc @@ -65,7 +65,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 165, 35, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Setup will create a user account on your computer called Administrator. You can use this account if you need full access to your computer.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Type an Administrator Password that is 14 characters or less.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Type an Administrator Password that is 127 characters or less.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Administrator Password:", IDC_STATIC, 54, 104, 105, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "C&onfirm Password:", IDC_STATIC, 54, 123, 105, 8 @@ -167,6 +167,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall failed: " IDS_TIMEOUT "Timeout during registration" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/es-ES.rc b/reactos/dll/win32/syssetup/lang/es-ES.rc index 9d883690c57..3abce7f236a 100644 --- a/reactos/dll/win32/syssetup/lang/es-ES.rc +++ b/reactos/dll/win32/syssetup/lang/es-ES.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "El instalador creará un perfil de usuario en su equipo llamado Administrator. Puede utilizar este perfil si necesita acceso completo a su equipo.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Escriba una contraseña para este perfil de 14 caracteres o menos.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Escriba una contraseña para este perfil de 127 caracteres o menos.", IDC_STATIC, 54, 87, 250, 8 LTEXT "Contraseña &Administrator:", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "C&onfirme contraseña:", IDC_STATIC, 54, 123, 75, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall falló: " IDS_TIMEOUT "Tiempo agotado durante la instalación" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/et-EE.rc b/reactos/dll/win32/syssetup/lang/et-EE.rc index 5d2f9e7d454..2de1a4099db 100644 --- a/reactos/dll/win32/syssetup/lang/et-EE.rc +++ b/reactos/dll/win32/syssetup/lang/et-EE.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 165, 35, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Arvuti täielikuks haldamiseks luuakse administraatori konto (Administrator). ", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Sisesta administraatori parool, mille pikkus on maksimaalselt 14 tähemärki.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Sisesta administraatori parool, mille pikkus on maksimaalselt 127 tähemärki.", IDC_STATIC, 54, 87, 250, 8 LTEXT "A&dministraatori parool:", IDC_STATIC, 54, 104, 105, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "&Kinnita parool:", IDC_STATIC, 54, 123, 105, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall ebaõnnestus: " IDS_TIMEOUT "Aeg sai registreerimise käigus otsa" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/fr-FR.rc b/reactos/dll/win32/syssetup/lang/fr-FR.rc index 03c92c70320..c55a7295f9b 100644 --- a/reactos/dll/win32/syssetup/lang/fr-FR.rc +++ b/reactos/dll/win32/syssetup/lang/fr-FR.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 165, 35, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "L'assistant va créer un compte utilisateur sur votre ordinateur appelé Administrateur. Vous pourrez utiliser ce compte pour avoir un accès complet à votre ordinateur.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Entrez le mot de passe Administrateur (14 caractères ou moins).", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Entrez le mot de passe Administrateur (127 caractères ou moins).", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Mot de passe :", IDC_STATIC, 54, 104, 105, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "Confirmation :", IDC_STATIC, 54, 123, 105, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "Échec de DllInstall : " IDS_TIMEOUT "Délai dépassé lors de l'enregistrement" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/he-IL.rc b/reactos/dll/win32/syssetup/lang/he-IL.rc index 9c79f937604..db1b34eb525 100644 --- a/reactos/dll/win32/syssetup/lang/he-IL.rc +++ b/reactos/dll/win32/syssetup/lang/he-IL.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 165, 35, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Setup will create a user account on your computer called Administrator. You can use this account if you need full access to your computer.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Type an Administrator Password that is 14 characters or less.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Type an Administrator Password that is 127 characters or less.", IDC_STATIC, 54, 87, 250, 8 LTEXT "סיסמת מנהל:", IDC_STATIC, 54, 104, 105, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "אישור סיסמה:", IDC_STATIC, 54, 123, 105, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall נכשל: " IDS_TIMEOUT "Timeout during registration" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/hu-HU.rc b/reactos/dll/win32/syssetup/lang/hu-HU.rc index 34b55b04c8a..785180396b9 100644 --- a/reactos/dll/win32/syssetup/lang/hu-HU.rc +++ b/reactos/dll/win32/syssetup/lang/hu-HU.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "A telepítõ létrehoz egy felhasználói fiókot, a Rendszergazdát. Ezzel a fiókkal teljes jogod van a számítógéped felett.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Adj meg egy jelszót, ami nem több mint 14 karakter.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Adj meg egy jelszót, ami nem több mint 127 karakter.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Jelszó:", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "&Megerõsítés:", IDC_STATIC, 54, 123, 75, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall hiba: " IDS_TIMEOUT "A regisztráció túllépte az idõkorlátot" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/id-ID.rc b/reactos/dll/win32/syssetup/lang/id-ID.rc index 2ff8c82f39d..66b85450031 100644 --- a/reactos/dll/win32/syssetup/lang/id-ID.rc +++ b/reactos/dll/win32/syssetup/lang/id-ID.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Setup will create a user account on your computer called Administrator. You can use this account if you need full access to your computer.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Type an Administrator Password that is 14 characters or less.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Type an Administrator Password that is 127 characters or less.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Administrator Password:", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "C&onfirm Password:", IDC_STATIC, 54, 123, 75, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall gagal: " IDS_TIMEOUT "Kehabisan waktu selama registrasi" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/it-IT.rc b/reactos/dll/win32/syssetup/lang/it-IT.rc index caaa448a2ae..7ce58baacc4 100644 --- a/reactos/dll/win32/syssetup/lang/it-IT.rc +++ b/reactos/dll/win32/syssetup/lang/it-IT.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 140, 35, 160, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Questa procedura creerà su questo computer un account utente chiamato Administrator. Si potrà usare questo account se si necessita l'accesso completo al computer.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Scrivere una password per Administrator che sia lunga al massimo 14 caratteri.", IDC_STATIC, 26, 87, 280, 8 + LTEXT "Scrivere una password per Administrator che sia lunga al massimo 127 caratteri.", IDC_STATIC, 26, 87, 280, 8 LTEXT "Password per &Administrator:", IDC_STATIC, 29, 105, 95, 8 EDITTEXT IDC_ADMINPASSWORD1, 140, 100, 160, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "C&onfermare la password:", IDC_STATIC, 29, 125, 95, 8 @@ -148,6 +148,13 @@ IDS_REACTOS_SETUP "Installazione di ReactOS" IDS_DLLINSTALL_FAILED "DllInstall fallito: " IDS_TIMEOUT "Tempo scaduto durante la registrazione" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/ja-JP.rc b/reactos/dll/win32/syssetup/lang/ja-JP.rc index eb41f4675e7..d15305a3b02 100644 --- a/reactos/dll/win32/syssetup/lang/ja-JP.rc +++ b/reactos/dll/win32/syssetup/lang/ja-JP.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 165, 35, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Administratorと呼ばれるユーザーアカウントを作成します。 コンピュータにフルアクセスが必要なとき、このアカウントを使用します。", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Administratorのパスワードを半角 14 文字以内で入力してください。", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Administratorのパスワードを半角 127 文字以内で入力してください。", IDC_STATIC, 54, 87, 250, 8 LTEXT "Administrator のパスワード(&A):", IDC_STATIC, 54, 104, 105, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "パスワードの確認入力(&O):", IDC_STATIC, 54, 123, 105, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstallに失敗: " IDS_TIMEOUT "登録中にタイムアウトしました" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/nl-NL.rc b/reactos/dll/win32/syssetup/lang/nl-NL.rc index ee6cde409f0..14ea0dd39fb 100644 --- a/reactos/dll/win32/syssetup/lang/nl-NL.rc +++ b/reactos/dll/win32/syssetup/lang/nl-NL.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Setup will create a user account on your computer called Administrator. You can use this account if you need full access to your computer.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Type an Administrator Password that is 14 characters or less.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Type an Administrator Password that is 127 characters or less.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Administrator Password:", IDC_STATIC, 54, 104, 105, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "C&onfirm Password:", IDC_STATIC, 54, 123, 105, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall failed: " IDS_TIMEOUT "Timeout during registration" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/no-NO.rc b/reactos/dll/win32/syssetup/lang/no-NO.rc index d760fa3c022..2b6f7911b3d 100644 --- a/reactos/dll/win32/syssetup/lang/no-NO.rc +++ b/reactos/dll/win32/syssetup/lang/no-NO.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Installasjonen vil lage en brukerkonto som blir kalt Administrator. Du kan bruke denne kontoen hvis du trenger full adgang til din datamaskin.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Skriv inn et Administrator passord som er 14 karakterer eller mindre.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Skriv inn et Administrator passord som er 127 karakterer eller mindre.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Administrator passord:", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "B&ekreft passord:", IDC_STATIC, 54, 123, 75, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall feilet: " IDS_TIMEOUT "Tidsavbrudd under registrering" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/pl-PL.rc b/reactos/dll/win32/syssetup/lang/pl-PL.rc index 14afb7c030d..c74260c9b15 100644 --- a/reactos/dll/win32/syssetup/lang/pl-PL.rc +++ b/reactos/dll/win32/syssetup/lang/pl-PL.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Program konfiguracyjny stworzy konto Administrator. Dzięki niemu uzyskasz, w razie potrzeby, pełny dostęp do systemu.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Podaj hasło administratora, nie dłuższe niż 14 znaków.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Podaj hasło administratora, nie dłuższe niż 127 znaków.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Hasło administratora:", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "&Potwierdzenie hasła:", IDC_STATIC, 54, 123, 75, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "Nieudane DllInstall: " IDS_TIMEOUT "Upłynął czas rejestracji" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/pt-BR.rc b/reactos/dll/win32/syssetup/lang/pt-BR.rc index 219312866ea..5a18fdc6410 100644 --- a/reactos/dll/win32/syssetup/lang/pt-BR.rc +++ b/reactos/dll/win32/syssetup/lang/pt-BR.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 165, 35, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "A instalação vai criar uma conta no seu computador chamada Administrator. Você pode usar esta conta se precisar de acesso total ao seu computador.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Digite uma senha para o administrador com 14 caracteres ou menos.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Digite uma senha para o administrador com 127 caracteres ou menos.", IDC_STATIC, 54, 87, 250, 8 LTEXT "Senha do &Administrador:", IDC_STATIC, 54, 104, 105, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "C&onfirma Senha:", IDC_STATIC, 54, 123, 105, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall falhou: " IDS_TIMEOUT "Tempo limite esgotado durante registro" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/ro-RO.rc b/reactos/dll/win32/syssetup/lang/ro-RO.rc index b74614b1da6..f7b8dbb13de 100644 --- a/reactos/dll/win32/syssetup/lang/ro-RO.rc +++ b/reactos/dll/win32/syssetup/lang/ro-RO.rc @@ -48,7 +48,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 165, 35, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Asistentul va crea un cont de utilizator cu numele Administrator. Îl puteți folosi când veți avea nevoie de control complet asupra calculatorului.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Introduceți o parolă pentru Administrator de maxim 14 caractere.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Introduceți o parolă pentru Administrator de maxim 127 caractere.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Parolă administrator:", IDC_STATIC, 54, 104, 105, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "&Confirmarea parolei:", IDC_STATIC, 54, 123, 105, 8 @@ -150,6 +150,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall a eșuat: " IDS_TIMEOUT "Timp expirat în timpul înregistrării" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/ru-RU.rc b/reactos/dll/win32/syssetup/lang/ru-RU.rc index a7a8f832cd1..6ad6e0b8ef9 100644 --- a/reactos/dll/win32/syssetup/lang/ru-RU.rc +++ b/reactos/dll/win32/syssetup/lang/ru-RU.rc @@ -48,7 +48,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 165, 35, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "При установке будет создан профиль пользователя с именем Administrator Вы можете использовать этот профиль, если вам нужно получить права администратора.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Введите пароль администратора (не более 14 символов).", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Введите пароль администратора (не более 127 символов).", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Пароль администратора:", IDC_STATIC, 54, 104, 96, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "П&овторите пароль:", IDC_STATIC, 54, 123, 75, 8 @@ -150,6 +150,13 @@ BEGIN IDS_DLLINSTALL_FAILED "Ошибка DllInstall: " IDS_TIMEOUT "Таймаут в ходе регистрации" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/sk-SK.rc b/reactos/dll/win32/syssetup/lang/sk-SK.rc index e2d25eb1fed..5b4dfc7a800 100644 --- a/reactos/dll/win32/syssetup/lang/sk-SK.rc +++ b/reactos/dll/win32/syssetup/lang/sk-SK.rc @@ -52,7 +52,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Inštalátor vytvorí na počítači používateľský účet nazvaný Administrator. Tento účet môžete použiť, keď budete potrebovať plný prístup k Vášmu počítaču.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Zadajte heslo účtu Administrator v dĺžke 14 znakov alebo menej.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Zadajte heslo účtu Administrator v dĺžke 127 znakov alebo menej.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Heslo:", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "&Potvrdiť heslo:", IDC_STATIC, 54, 123, 75, 8 @@ -154,6 +154,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall zlyhal: " IDS_TIMEOUT "Vypršal časový limit registrácie" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/sq-AL.rc b/reactos/dll/win32/syssetup/lang/sq-AL.rc index 5c0a7d1da9e..700cf472d7a 100644 --- a/reactos/dll/win32/syssetup/lang/sq-AL.rc +++ b/reactos/dll/win32/syssetup/lang/sq-AL.rc @@ -65,7 +65,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 165, 35, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Ndërtuesi do të krijojë një llogari përdoruesi në kompjuterin tuaj të quajtur Administrator. Ju mund të përdorni këtë llogari në qoftë se keni nevojë për akses të plotë në kompjuterin tuaj.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Shkruani një fjalëkalim Administratori që është 14 karaktere ose më pak.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Shkruani një fjalëkalim Administratori që është 127 karaktere ose më pak.", IDC_STATIC, 54, 87, 250, 8 LTEXT "Fjalëkalimi &Administratorit:", IDC_STATIC, 54, 104, 105, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "K&onfirmo Fjalëkalimin:", IDC_STATIC, 54, 123, 105, 8 @@ -167,6 +167,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall dështoj: " IDS_TIMEOUT "Timeout gjatë regjistrimit" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administratorër" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/tr-TR.rc b/reactos/dll/win32/syssetup/lang/tr-TR.rc index b1aadf44272..df3f843972f 100644 --- a/reactos/dll/win32/syssetup/lang/tr-TR.rc +++ b/reactos/dll/win32/syssetup/lang/tr-TR.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 165, 35, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Kur,'Administrator' adıyla bir yönetici hesabı oluşturacak. Bu hesabı bilgisayara tam erişim için kullanabileceksiniz.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "14 karakter yada daha az bir Yönetici Parolası yazın.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "127 karakter yada daha az bir Yönetici Parolası yazın.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Yönetici Parolası:", IDC_STATIC, 54, 104, 105, 8 EDITTEXT IDC_ADMINPASSWORD1, 165, 101, 148, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "Parolayı &Doğrula:", IDC_STATIC, 54, 123, 105, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "Dll Kurulumu başarısız oldu: " IDS_TIMEOUT "Kayıt zaman aşımına uğradı" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/uk-UA.rc b/reactos/dll/win32/syssetup/lang/uk-UA.rc index c18f4e691d1..a5c41d81f4f 100644 --- a/reactos/dll/win32/syssetup/lang/uk-UA.rc +++ b/reactos/dll/win32/syssetup/lang/uk-UA.rc @@ -54,7 +54,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "Програма встановлення створить обліковий запис користувача 'Адміністратор', який дає повні права доступу до Вашого комп'ютера.", IDC_STATIC, 54, 57, 250, 25 - LTEXT "Введіть пароль адміністратора довжиною до 14 символів.", IDC_STATIC, 54, 87, 250, 8 + LTEXT "Введіть пароль адміністратора довжиною до 127 символів.", IDC_STATIC, 54, 87, 250, 8 LTEXT "&Пароль адміністратора:", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "Пі&дтвердження:", IDC_STATIC, 54, 123, 75, 8 @@ -156,6 +156,13 @@ BEGIN IDS_DLLINSTALL_FAILED "Помилка DllInstall: " IDS_TIMEOUT "Таймаут під час реєстрації" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/lang/zh-CN.rc b/reactos/dll/win32/syssetup/lang/zh-CN.rc index 43a30bc5445..22cba322428 100644 --- a/reactos/dll/win32/syssetup/lang/zh-CN.rc +++ b/reactos/dll/win32/syssetup/lang/zh-CN.rc @@ -46,7 +46,7 @@ BEGIN EDITTEXT IDC_COMPUTERNAME, 132, 35, 163, 14, WS_VISIBLE | WS_TABSTOP | ES_AUTOHSCROLL | ES_UPPERCASE ICON IDI_ICON5, IDC_STATIC, 21, 57, 20, 20 LTEXT "安装程序会创建一个称为 Administrator (系统管理员)的用户帐户。需要完全控制计算机时,可以使用这个帐户。", IDC_STATIC, 54, 57, 250, 25 - LTEXT "请键入不超过14个字符的系统管理员密码。", IDC_STATIC, 54, 87, 250, 8 + LTEXT "请键入不超过127个字符的系统管理员密码。", IDC_STATIC, 54, 87, 250, 8 LTEXT "系统管理员密码(&A):", IDC_STATIC, 54, 104, 75, 8 EDITTEXT IDC_ADMINPASSWORD1, 132, 101, 172, 14, WS_VISIBLE | WS_TABSTOP | ES_PASSWORD LTEXT "确认密码(&O):", IDC_STATIC, 54, 123, 75, 8 @@ -148,6 +148,13 @@ BEGIN IDS_DLLINSTALL_FAILED "DllInstall 失败: " IDS_TIMEOUT "Timeout during registration" IDS_REASON_UNKNOWN "" + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_ADMINISTRATOR_NAME and + * samsrv.dll:IDS_USER_ADMINISTRATOR_NAME synchronized. + * Also check the IDD_COMPUTERPAGE dialog. + */ + IDS_ADMINISTRATOR_NAME "Administrator" END STRINGTABLE diff --git a/reactos/dll/win32/syssetup/resource.h b/reactos/dll/win32/syssetup/resource.h index ac79f97483d..d356c77ea31 100644 --- a/reactos/dll/win32/syssetup/resource.h +++ b/reactos/dll/win32/syssetup/resource.h @@ -101,6 +101,7 @@ #define IDS_DLLINSTALL_FAILED 3306 #define IDS_TIMEOUT 3307 #define IDS_REASON_UNKNOWN 3308 +#define IDS_ADMINISTRATOR_NAME 3309 #define IDS_WZD_NAME 3450 #define IDS_WZD_SETCOMPUTERNAME 3451 diff --git a/reactos/dll/win32/syssetup/wizard.c b/reactos/dll/win32/syssetup/wizard.c index 9cbcb49b6a6..1559c58cec4 100644 --- a/reactos/dll/win32/syssetup/wizard.c +++ b/reactos/dll/win32/syssetup/wizard.c @@ -566,6 +566,59 @@ WriteComputerSettings(WCHAR * ComputerName, HWND hwndDlg) return TRUE; } + +static +BOOL +WriteDefaultLogonData(LPWSTR Domain) +{ + WCHAR szAdministratorName[256]; + HKEY hKey = NULL; + LONG lError; + + if (LoadStringW(hDllInstance, + IDS_ADMINISTRATOR_NAME, + szAdministratorName, + sizeof(szAdministratorName) / sizeof(WCHAR)) == 0) + { + wcscpy(szAdministratorName, L"Administrator"); + } + + lError = RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon", + 0, + KEY_SET_VALUE, + &hKey); + if (lError != ERROR_SUCCESS) + return FALSE; + + lError = RegSetValueEx(hKey, + L"DefaultDomain", + 0, + REG_SZ, + (LPBYTE)Domain, + (wcslen(Domain)+ 1) * sizeof(WCHAR)); + if (lError != ERROR_SUCCESS) + { + DPRINT1("RegSetValueEx(\"DefaultDomain\") failed!\n"); + } + + lError = RegSetValueEx(hKey, + L"DefaultUserName", + 0, + REG_SZ, + (LPBYTE)szAdministratorName, + (wcslen(szAdministratorName)+ 1) * sizeof(WCHAR)); + if (lError != ERROR_SUCCESS) + { + DPRINT1("RegSetValueEx(\"DefaultUserName\") failed!\n"); + } + + RegCloseKey(hKey); + + return TRUE; +} + + /* lpBuffer will be filled with a 15-char string (plus the null terminator) */ static void GenerateComputerName(LPWSTR lpBuffer) @@ -592,8 +645,8 @@ ComputerPageDlgProc(HWND hwndDlg, LPARAM lParam) { WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; - WCHAR Password1[15]; - WCHAR Password2[15]; + WCHAR Password1[128]; + WCHAR Password2[128]; PWCHAR Password; WCHAR Title[64]; WCHAR EmptyComputerName[256], NotMatchPassword[256], WrongPassword[256]; @@ -607,7 +660,6 @@ ComputerPageDlgProc(HWND hwndDlg, switch (uMsg) { case WM_INITDIALOG: - { /* Generate a new pseudo-random computer name */ GenerateComputerName(ComputerName); @@ -616,8 +668,8 @@ ComputerPageDlgProc(HWND hwndDlg, /* Set text limits */ SendDlgItemMessage(hwndDlg, IDC_COMPUTERNAME, EM_LIMITTEXT, MAX_COMPUTERNAME_LENGTH, 0); - SendDlgItemMessage(hwndDlg, IDC_ADMINPASSWORD1, EM_LIMITTEXT, 14, 0); - SendDlgItemMessage(hwndDlg, IDC_ADMINPASSWORD2, EM_LIMITTEXT, 14, 0); + SendDlgItemMessage(hwndDlg, IDC_ADMINPASSWORD1, EM_LIMITTEXT, 127, 0); + SendDlgItemMessage(hwndDlg, IDC_ADMINPASSWORD2, EM_LIMITTEXT, 127, 0); /* Set focus to computer name */ SetFocus(GetDlgItem(hwndDlg, IDC_COMPUTERNAME)); @@ -630,8 +682,9 @@ ComputerPageDlgProc(HWND hwndDlg, SetAdministratorPassword(SetupData.AdminPassword); } - } - break; + /* Store the administrator account name as the default user name */ + WriteDefaultLogonData(SetupData.ComputerName); + break; case WM_NOTIFY: @@ -676,8 +729,8 @@ ComputerPageDlgProc(HWND hwndDlg, #if 0 /* Check if admin passwords have been entered */ - if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 15) == 0) || - (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 15) == 0)) + if ((GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128) == 0) || + (GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128) == 0)) { if (0 == LoadStringW(hDllInstance, IDS_WZD_PASSWORDEMPTY, EmptyPassword, sizeof(EmptyPassword) / sizeof(EmptyPassword[0]))) @@ -689,8 +742,8 @@ ComputerPageDlgProc(HWND hwndDlg, return TRUE; } #else - GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 15); - GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 15); + GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 128); + GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 128); #endif /* Check if passwords match */ if (wcscmp(Password1, Password2)) From 414a438bc541cf0ecd28980c3f17c548e685943a Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 29 Mar 2014 17:28:47 +0000 Subject: [PATCH 169/419] [SAMSRV] Add a note for translators to keep the administrator account name string resources in syssetup.dll and samsrv.dll synchonized. svn path=/trunk/; revision=62578 --- reactos/dll/win32/samsrv/lang/de-DE.rc | 5 +++++ reactos/dll/win32/samsrv/lang/en-US.rc | 5 +++++ reactos/dll/win32/samsrv/lang/pl-PL.rc | 5 +++++ reactos/dll/win32/samsrv/lang/ro-RO.rc | 5 +++++ reactos/dll/win32/samsrv/lang/sq-AL.rc | 5 +++++ 5 files changed, 25 insertions(+) diff --git a/reactos/dll/win32/samsrv/lang/de-DE.rc b/reactos/dll/win32/samsrv/lang/de-DE.rc index 5bbb554e544..be6da81a353 100644 --- a/reactos/dll/win32/samsrv/lang/de-DE.rc +++ b/reactos/dll/win32/samsrv/lang/de-DE.rc @@ -13,6 +13,11 @@ BEGIN IDS_ALIAS_POWER_USERS_COMMENT "Hauptbenutzer besitzen die meisten Rechte mit einigen Einschränkungen." IDS_ALIAS_USERS_NAME "Benutzer" IDS_ALIAS_USERS_COMMENT "Benutzer können keine Änderungen am System vornehmen." + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_USER_ADMINISTRATOR_NAME and + * syssetup.dll:IDS_ADMINISTRATOR_NAME synchronized. + */ IDS_USER_ADMINISTRATOR_NAME "Administrator" IDS_USER_ADMINISTRATOR_COMMENT "Vordefiniertes Konto für die Verwaltung des Comuters oder der Domäne." IDS_USER_GUEST_NAME "Gast" diff --git a/reactos/dll/win32/samsrv/lang/en-US.rc b/reactos/dll/win32/samsrv/lang/en-US.rc index 1a25400a7eb..484d607e75f 100644 --- a/reactos/dll/win32/samsrv/lang/en-US.rc +++ b/reactos/dll/win32/samsrv/lang/en-US.rc @@ -13,6 +13,11 @@ BEGIN IDS_ALIAS_POWER_USERS_COMMENT "Power Users have most administrative rights with some restrictions." IDS_ALIAS_USERS_NAME "Users" IDS_ALIAS_USERS_COMMENT "Users are prevented from making system-wide changes." + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_USER_ADMINISTRATOR_NAME and + * syssetup.dll:IDS_ADMINISTRATOR_NAME synchronized. + */ IDS_USER_ADMINISTRATOR_NAME "Administrator" IDS_USER_ADMINISTRATOR_COMMENT "Built-in account used to administate the computer or domain." IDS_USER_GUEST_NAME "Guest" diff --git a/reactos/dll/win32/samsrv/lang/pl-PL.rc b/reactos/dll/win32/samsrv/lang/pl-PL.rc index 975b40b1a63..550543204fc 100644 --- a/reactos/dll/win32/samsrv/lang/pl-PL.rc +++ b/reactos/dll/win32/samsrv/lang/pl-PL.rc @@ -13,6 +13,11 @@ BEGIN IDS_ALIAS_POWER_USERS_COMMENT "Użytkownicy zaawansowani maja większość uprawnień administracyjnych, z kilkoma wyjątkami." IDS_ALIAS_USERS_NAME "Użytkownicy" IDS_ALIAS_USERS_COMMENT "Użytkownicy nie mogą dokonywać istotnych zmian w systemie." + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_USER_ADMINISTRATOR_NAME and + * syssetup.dll:IDS_ADMINISTRATOR_NAME synchronized. + */ IDS_USER_ADMINISTRATOR_NAME "Administrator" IDS_USER_ADMINISTRATOR_COMMENT "Wbudowane konto do zarządzania komputerem bądź domeną." IDS_USER_GUEST_NAME "Gość" diff --git a/reactos/dll/win32/samsrv/lang/ro-RO.rc b/reactos/dll/win32/samsrv/lang/ro-RO.rc index 72f4ec6ffa5..9bbcc76dcc8 100644 --- a/reactos/dll/win32/samsrv/lang/ro-RO.rc +++ b/reactos/dll/win32/samsrv/lang/ro-RO.rc @@ -15,6 +15,11 @@ BEGIN IDS_ALIAS_POWER_USERS_COMMENT "Utilizatorii avansați posedă majoritatea drepturilor administrative cu unele restricții." IDS_ALIAS_USERS_NAME "Utilizatori" IDS_ALIAS_USERS_COMMENT "Utilizatorilor le este limitată capacitatea de a aduce modificări în sistem." + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_USER_ADMINISTRATOR_NAME and + * syssetup.dll:IDS_ADMINISTRATOR_NAME synchronized. + */ IDS_USER_ADMINISTRATOR_NAME "Administrator" IDS_USER_ADMINISTRATOR_COMMENT "Contul inerent utilizat pentru a administra acest calculator sau domeniu." IDS_USER_GUEST_NAME "Oaspete" diff --git a/reactos/dll/win32/samsrv/lang/sq-AL.rc b/reactos/dll/win32/samsrv/lang/sq-AL.rc index 957cf74ce70..3c19d95fa18 100644 --- a/reactos/dll/win32/samsrv/lang/sq-AL.rc +++ b/reactos/dll/win32/samsrv/lang/sq-AL.rc @@ -17,6 +17,11 @@ BEGIN IDS_ALIAS_POWER_USERS_COMMENT "Përdorues të Fuqishëm katë të drejta administrative me disa kufizime." IDS_ALIAS_USERS_NAME "Përdoruesit" IDS_ALIAS_USERS_COMMENT "Përdoruesit janë të penguar për ndryshim bërje të gjërave të sistemit." + /* + * ATTENTION: + * If you translate the administator account name, keep IDS_USER_ADMINISTRATOR_NAME and + * syssetup.dll:IDS_ADMINISTRATOR_NAME synchronized. + */ IDS_USER_ADMINISTRATOR_NAME "Administratorër" IDS_USER_ADMINISTRATOR_COMMENT "Llogaria Ndërtimit të përdorura për të administruar kompjuterin ose domain." IDS_USER_GUEST_NAME "Vizitorë" From 3b44e882cbd5c6d04f1a7968bd3c897a2799def9 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 29 Mar 2014 18:50:36 +0000 Subject: [PATCH 170/419] [ROSTESTS] Add a usermode test application for tunnel cache. It is based on MS article at: http://support.microsoft.com/?kbid=172190 Tested successfully on Windows 7 & NTFS. Feel free to test on w2k3 NTFS or FAT/FAT32. svn path=/trunk/; revision=62579 --- rostests/win32/fs/CMakeLists.txt | 1 + rostests/win32/fs/tunneltest/CMakeLists.txt | 8 + rostests/win32/fs/tunneltest/tunneltest.c | 163 ++++++++++++++++++++ 3 files changed, 172 insertions(+) create mode 100644 rostests/win32/fs/CMakeLists.txt create mode 100644 rostests/win32/fs/tunneltest/CMakeLists.txt create mode 100644 rostests/win32/fs/tunneltest/tunneltest.c diff --git a/rostests/win32/fs/CMakeLists.txt b/rostests/win32/fs/CMakeLists.txt new file mode 100644 index 00000000000..dbc3af3f171 --- /dev/null +++ b/rostests/win32/fs/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(tunneltest) diff --git a/rostests/win32/fs/tunneltest/CMakeLists.txt b/rostests/win32/fs/tunneltest/CMakeLists.txt new file mode 100644 index 00000000000..fe46d2fc1e2 --- /dev/null +++ b/rostests/win32/fs/tunneltest/CMakeLists.txt @@ -0,0 +1,8 @@ + +list(APPEND SOURCE + tunneltest.c) + +add_executable(tunneltest ${SOURCE}) +set_module_type(tunneltest win32cui UNICODE) +add_importlibs(tunneltest msvcrt kernel32 ntdll) +add_cd_file(TARGET tunneltest DESTINATION reactos/bin FOR all) diff --git a/rostests/win32/fs/tunneltest/tunneltest.c b/rostests/win32/fs/tunneltest/tunneltest.c new file mode 100644 index 00000000000..89c63cfb04a --- /dev/null +++ b/rostests/win32/fs/tunneltest/tunneltest.c @@ -0,0 +1,163 @@ +/* + * PROJECT: ReactOS Tests + * LICENSE: GPL - See COPYING in the top level directory + * FILE: tunneltest.c + * PURPOSE: Usermode tunnel cache testing + * PROGRAMMERS: Pierre Schweitzer (pierre@reactos.org) + * NOTES: Based on indications from: http://support.microsoft.com/?kbid=172190 + */ + +#include +#include +#include +#include +#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s } + +const UNICODE_STRING FatName = RTL_CONSTANT_STRING(L"FAT"); +const UNICODE_STRING Fat32Name = RTL_CONSTANT_STRING(L"FAT32"); +const UNICODE_STRING NtfsName = RTL_CONSTANT_STRING(L"NTFS"); + +int wmain(int argc, WCHAR * argv[]) +{ + WCHAR TempPath[MAX_PATH + 1]; + WCHAR CopyPath[MAX_PATH + 1]; + WCHAR RootPath[] = {'A', ':', '\\', '\0'}; + WCHAR FileSystemName[sizeof("FAT32")]; /* Max we should hold - fail otherwise, we don't care */ + UNICODE_STRING FSName; + WCHAR File1[] = {'\\', 'f', 'i', 'l', 'e', '1', '\0'}; + WCHAR File2[] = {'\\', 'f', 'i', 'l', 'e', '2', '\0'}; + ULONG FilePos; + HANDLE hFile; + FILETIME FileTime, File1Time; + + /* Get temp path in which will work */ + if (GetTempPathW(sizeof(TempPath) / sizeof(TempPath[0]), TempPath) == 0) + { + fprintf(stderr, "Failed to get temp path\n"); + return GetLastError(); + } + + /* Assume it's X:\ something */ + RootPath[0] = TempPath[0]; + + /* Get information about the volume */ + if (GetVolumeInformationW(RootPath, NULL, 0, NULL, NULL, NULL, FileSystemName, sizeof(FileSystemName) / sizeof(FileSystemName[0])) == 0) + { + fprintf(stderr, "Failed to get volume info\n"); + return GetLastError(); + } + + /* Convert to string */ + RtlInitUnicodeString(&FSName, FileSystemName); + + /* Bail out if that's not FAT or NTFS */ + if (RtlCompareUnicodeString(&FSName, &FatName, FALSE) != 0 && + RtlCompareUnicodeString(&FSName, &Fat32Name, FALSE) != 0 && + RtlCompareUnicodeString(&FSName, &NtfsName, FALSE) != 0) + { + fprintf(stderr, "!(FAT, FAT32, NTFS): \'%S\'\n", FSName.Buffer); + return 0; + } + + /* Ensure we can store complete path - no overrun */ + FilePos = wcslen(TempPath); + if (FilePos > MAX_PATH - sizeof(File2) / sizeof(WCHAR)) + { + fprintf(stderr, "Files won't fit\n"); + return 0; + } + + /* Create first file */ + wcscat(TempPath, File1); + hFile = CreateFileW(TempPath, 0, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile == INVALID_HANDLE_VALUE) + { + fprintf(stderr, "Failed to create file1\n"); + return GetLastError(); + } + CloseHandle(hFile); + + /* Wait a least 10ms (resolution of FAT) */ + Sleep(10 * 2); + + /* Create second file */ + /* Remove old file from buffer */ + TempPath[FilePos - 1] = 0; + wcscat(TempPath, File2); + hFile = CreateFileW(TempPath, 0, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile == INVALID_HANDLE_VALUE) + { + fprintf(stderr, "Failed to create file2\n"); + return GetLastError(); + } + CloseHandle(hFile); + + /* Rename file1 to file */ + TempPath[FilePos] = 0; + wcscat(TempPath, File1); + wcscpy(CopyPath, TempPath); + /* Remove number for dest */ + CopyPath[wcslen(TempPath) - 1] = 0; + if (MoveFileW(TempPath, CopyPath) == 0) + { + fprintf(stderr, "Failed to rename file1\n"); + return GetLastError(); + } + + /* Rename file2 to file1 */ + wcscpy(CopyPath, TempPath); + /* Change 1 to 2 */ + CopyPath[wcslen(TempPath) - 1] = L'2'; + if (MoveFileW(CopyPath, TempPath) == 0) + { + fprintf(stderr, "Failed to rename file2\n"); + return GetLastError(); + } + + /* Time to compare creation time of both file & file1 */ + CopyPath[wcslen(TempPath) - 1] = 0; + + /* Open file and get its creation time */ + hFile = CreateFileW(CopyPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile == INVALID_HANDLE_VALUE) + { + fprintf(stderr, "Failed to open file\n"); + return GetLastError(); + } + if (GetFileTime(hFile, &FileTime, NULL, NULL) == FALSE) + { + fprintf(stderr, "Failed to read creation time\n"); + CloseHandle(hFile); + return GetLastError(); + } + CloseHandle(hFile); + + /* Open file1 and get its creation time */ + hFile = CreateFileW(TempPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (hFile == INVALID_HANDLE_VALUE) + { + fprintf(stderr, "Failed to open file1\n"); + return GetLastError(); + } + if (GetFileTime(hFile, &File1Time, NULL, NULL) == FALSE) + { + fprintf(stderr, "Failed to read creation time\n"); + CloseHandle(hFile); + return GetLastError(); + } + CloseHandle(hFile); + + /* Delete file */ + DeleteFileW(TempPath); + DeleteFileW(CopyPath); + + /* Compare both, they have to be strictly identical */ + if (RtlCompareMemory(&FileTime, &File1Time, sizeof(FILETIME)) == sizeof(FILETIME)) + { + fprintf(stdout, "Tunnel cache in action\n"); + return 0; + } + + fprintf(stdout, "Tunnel cache NOT in action\n"); + return 0; +} From 385b37aba7e43cb6915968c894d2b8b8c84fb1e3 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 29 Mar 2014 20:39:50 +0000 Subject: [PATCH 171/419] [SYSSETUP] Extend the maximum password length to 127 characters for unattended setup too. CORE-7762 #comment Fixed it! Thanks a lot! svn path=/trunk/; revision=62580 --- reactos/dll/win32/syssetup/globals.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/syssetup/globals.h b/reactos/dll/win32/syssetup/globals.h index f6764808e6a..06e18aec22c 100644 --- a/reactos/dll/win32/syssetup/globals.h +++ b/reactos/dll/win32/syssetup/globals.h @@ -45,7 +45,7 @@ typedef struct _SETUPDATA WCHAR OwnerName[51]; WCHAR OwnerOrganization[51]; WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1]; /* max. 15 characters */ - WCHAR AdminPassword[15]; /* max. 14 characters */ + WCHAR AdminPassword[128]; /* max. 127 characters */ BOOL UnattendSetup; BOOL DisableVmwInst; From 12268a1b66cac5cd223a899cef6afd0106dc4866 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 29 Mar 2014 21:12:17 +0000 Subject: [PATCH 172/419] [ROSTESTS] Add notifications test application. It is: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365261%28v=vs.85%29.aspx It properly works in ReactOS since r62446 CORE-2582 svn path=/trunk/; revision=62581 --- rostests/win32/kernel32/CMakeLists.txt | 1 + .../kernel32/notificationtest/CMakeLists.txt | 9 + .../notificationtest/notificationtest.c | 157 ++++++++++++++++++ 3 files changed, 167 insertions(+) create mode 100644 rostests/win32/kernel32/CMakeLists.txt create mode 100644 rostests/win32/kernel32/notificationtest/CMakeLists.txt create mode 100644 rostests/win32/kernel32/notificationtest/notificationtest.c diff --git a/rostests/win32/kernel32/CMakeLists.txt b/rostests/win32/kernel32/CMakeLists.txt new file mode 100644 index 00000000000..19be9ece69c --- /dev/null +++ b/rostests/win32/kernel32/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(notificationtest) diff --git a/rostests/win32/kernel32/notificationtest/CMakeLists.txt b/rostests/win32/kernel32/notificationtest/CMakeLists.txt new file mode 100644 index 00000000000..79caf133740 --- /dev/null +++ b/rostests/win32/kernel32/notificationtest/CMakeLists.txt @@ -0,0 +1,9 @@ + +list(APPEND SOURCE + notificationtest.c) + +add_executable(notificationtest ${SOURCE}) +target_link_libraries(notificationtest wine ${PSEH_LIB}) +set_module_type(notificationtest win32cui) +add_importlibs(notificationtest gdi32 user32 shlwapi msvcrt kernel32 ntdll) +add_cd_file(TARGET notificationtest DESTINATION reactos/bin FOR all) diff --git a/rostests/win32/kernel32/notificationtest/notificationtest.c b/rostests/win32/kernel32/notificationtest/notificationtest.c new file mode 100644 index 00000000000..d3b84ecfdd4 --- /dev/null +++ b/rostests/win32/kernel32/notificationtest/notificationtest.c @@ -0,0 +1,157 @@ +/* + * FILE: notificationtest.c + * PURPOSE: Files notifications testing + * NOTES: MSDN code from: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365261%28v=vs.85%29.aspx + */ + +#include +#include +#include +#include + +#if defined(_tsplitpath) && !defined(_tsplitpath_s) +#define _tsplitpath_s(f, d,dl, p,pl, n,nl, e,el) _tsplitpath(f, d, p, n, e) +#else +#define _wsplitpath_s(f, d,dl, p,pl, n,nl, e,el) _wsplitpath(f, d, p, n, e) +#define _splitpath_s(f, d,dl, p,pl, n,nl, e,el) _splitpath(f, d, p, n, e) +#endif + +void RefreshDirectory(LPTSTR); +void RefreshTree(LPTSTR); +void WatchDirectory(LPTSTR); + +int _tmain(int argc, TCHAR *argv[]) +{ + if(argc != 2) + { + _tprintf(TEXT("Usage: %s \n"), argv[0]); + return -1; + } + + WatchDirectory(argv[1]); + + return 0; +} + +void WatchDirectory(LPTSTR lpDir) +{ + DWORD dwWaitStatus; + HANDLE dwChangeHandles[2]; + TCHAR lpDrive[4]; + TCHAR lpFile[_MAX_FNAME]; + TCHAR lpExt[_MAX_EXT]; + + _tsplitpath_s(lpDir, lpDrive, 4, NULL, 0, lpFile, _MAX_FNAME, lpExt, _MAX_EXT); + + lpDrive[2] = (TCHAR)'\\'; + lpDrive[3] = (TCHAR)'\0'; + +// Watch the directory for file creation and deletion. + + dwChangeHandles[0] = FindFirstChangeNotification( + lpDir, // directory to watch + FALSE, // do not watch subtree + FILE_NOTIFY_CHANGE_FILE_NAME); // watch file name changes + + if (dwChangeHandles[0] == INVALID_HANDLE_VALUE) + { + printf("\n ERROR: FindFirstChangeNotification function failed.\n"); + ExitProcess(GetLastError()); + } + +// Watch the subtree for directory creation and deletion. + + dwChangeHandles[1] = FindFirstChangeNotification( + lpDrive, // directory to watch + TRUE, // watch the subtree + FILE_NOTIFY_CHANGE_DIR_NAME); // watch dir name changes + + if (dwChangeHandles[1] == INVALID_HANDLE_VALUE) + { + printf("\n ERROR: FindFirstChangeNotification function failed.\n"); + ExitProcess(GetLastError()); + } + + +// Make a final validation check on our handles. + + if ((dwChangeHandles[0] == NULL) || (dwChangeHandles[1] == NULL)) + { + printf("\n ERROR: Unexpected NULL from FindFirstChangeNotification.\n"); + ExitProcess(GetLastError()); + } + +// Change notification is set. Now wait on both notification +// handles and refresh accordingly. + + while (TRUE) + { + // Wait for notification. + + printf("\nWaiting for notification...\n"); + + dwWaitStatus = WaitForMultipleObjects(2, dwChangeHandles, + FALSE, INFINITE); + + switch (dwWaitStatus) + { + case WAIT_OBJECT_0: + + // A file was created, renamed, or deleted in the directory. + // Refresh this directory and restart the notification. + + RefreshDirectory(lpDir); + if ( FindNextChangeNotification(dwChangeHandles[0]) == FALSE ) + { + printf("\n ERROR: FindNextChangeNotification function failed.\n"); + ExitProcess(GetLastError()); + } + break; + + case WAIT_OBJECT_0 + 1: + + // A directory was created, renamed, or deleted. + // Refresh the tree and restart the notification. + + RefreshTree(lpDrive); + if (FindNextChangeNotification(dwChangeHandles[1]) == FALSE ) + { + printf("\n ERROR: FindNextChangeNotification function failed.\n"); + ExitProcess(GetLastError()); + } + break; + + case WAIT_TIMEOUT: + + // A timeout occurred, this would happen if some value other + // than INFINITE is used in the Wait call and no changes occur. + // In a single-threaded environment you might not want an + // INFINITE wait. + + printf("\nNo changes in the timeout period.\n"); + break; + + default: + printf("\n ERROR: Unhandled dwWaitStatus.\n"); + ExitProcess(GetLastError()); + break; + } + } +} + +void RefreshDirectory(LPTSTR lpDir) +{ + // This is where you might place code to refresh your + // directory listing, but not the subtree because it + // would not be necessary. + + _tprintf(TEXT("Directory (%s) changed.\n"), lpDir); +} + +void RefreshTree(LPTSTR lpDrive) +{ + // This is where you might place code to refresh your + // directory listing, including the subtree. + + _tprintf(TEXT("Directory tree (%s) changed.\n"), lpDrive); +} From 2d721bca08dc45a65b8bde6f942bcbe5ebe76128 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 30 Mar 2014 09:17:18 +0000 Subject: [PATCH 173/419] [USBEHCI] - Fix some debug prints and some whitespace issues svn path=/trunk/; revision=62582 --- reactos/drivers/usb/usbehci/hardware.cpp | 68 ++++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/reactos/drivers/usb/usbehci/hardware.cpp b/reactos/drivers/usb/usbehci/hardware.cpp index dcd08fb83a1..bdd380b79a1 100644 --- a/reactos/drivers/usb/usbehci/hardware.cpp +++ b/reactos/drivers/usb/usbehci/hardware.cpp @@ -171,7 +171,7 @@ CUSBHardwareDevice::Initialize( // // store device objects - // + // m_DriverObject = DriverObject; m_FunctionalDeviceObject = FunctionalDeviceObject; m_PhysicalDeviceObject = PhysicalDeviceObject; @@ -357,17 +357,17 @@ CUSBHardwareDevice::PnpStart( } // - // Get controllers capabilities + // Get controllers capabilities // m_Capabilities.Length = READ_REGISTER_UCHAR((PUCHAR)ResourceBase + EHCI_CAPLENGTH); - m_Capabilities.HCIVersion = READ_REGISTER_USHORT((PUSHORT)((ULONG)ResourceBase + EHCI_HCIVERSION)); - m_Capabilities.HCSParamsLong = READ_REGISTER_ULONG((PULONG)((ULONG)ResourceBase + EHCI_HCSPARAMS)); - m_Capabilities.HCCParamsLong = READ_REGISTER_ULONG((PULONG)((ULONG)ResourceBase + EHCI_HCCPARAMS)); + m_Capabilities.HCIVersion = READ_REGISTER_USHORT((PUSHORT)((ULONG_PTR)ResourceBase + EHCI_HCIVERSION)); + m_Capabilities.HCSParamsLong = READ_REGISTER_ULONG((PULONG)((ULONG_PTR)ResourceBase + EHCI_HCSPARAMS)); + m_Capabilities.HCCParamsLong = READ_REGISTER_ULONG((PULONG)((ULONG_PTR)ResourceBase + EHCI_HCCPARAMS)); - DPRINT1("Controller has %c Length\n", m_Capabilities.Length); - DPRINT1("Controller EHCI Version %x\n", m_Capabilities.HCIVersion); - DPRINT1("Controller EHCI Caps HCSParamsLong %x\n", m_Capabilities.HCSParamsLong); - DPRINT1("Controller EHCI Caps HCCParamsLong %x\n", m_Capabilities.HCCParamsLong); + DPRINT1("Controller Capabilities Length 0x%x\n", m_Capabilities.Length); + DPRINT1("Controller EHCI Version 0x%x\n", m_Capabilities.HCIVersion); + DPRINT1("Controller EHCI Caps HCSParamsLong 0x%lx\n", m_Capabilities.HCSParamsLong); + DPRINT1("Controller EHCI Caps HCCParamsLong 0x%lx\n", m_Capabilities.HCCParamsLong); DPRINT1("Controller has %lu Ports\n", m_Capabilities.HCSParams.PortCount); // @@ -391,7 +391,7 @@ CUSBHardwareDevice::PnpStart( m_Capabilities.PortRoute[(Count*2)+1] = (Value & 0x0F); Count++; - }while(Count < PortCount); + } while(Count < PortCount); } // @@ -456,7 +456,7 @@ CUSBHardwareDevice::PnpStart( return Status; } - // + // // Create a queuehead for the Async Register // m_MemoryManager->Allocate(sizeof(QUEUE_HEAD), (PVOID*)&AsyncQueueHead, &AsyncPhysicalAddress); @@ -1250,7 +1250,7 @@ InterruptServiceRoutine( CStatus = This->EHCI_READ_REGISTER_ULONG(EHCI_USBSTS); CStatus &= (EHCI_ERROR_INT | EHCI_STS_INT | EHCI_STS_IAA | EHCI_STS_PCD | EHCI_STS_FLR); - DPRINT("CStatus %x\n", CStatus); + DPRINT("InterruptServiceRoutine CStatus %lx\n", CStatus); // // Check that it belongs to EHCI @@ -1301,7 +1301,7 @@ EhciDefferedRoutine( This = (CUSBHardwareDevice*) SystemArgument1; CStatus = (ULONG) SystemArgument2; - DPRINT("CStatus %x\n", CStatus); + DPRINT("EhciDefferedRoutine CStatus %lx\n", CStatus); // // check for completion of async schedule @@ -1318,7 +1318,7 @@ EhciDefferedRoutine( // // controller reported error // - DPRINT1("CStatus %x\n", CStatus); + DPRINT1("CStatus %lx\n", CStatus); //ASSERT(FALSE); } @@ -1330,33 +1330,33 @@ EhciDefferedRoutine( // // was a queue head completed? // - if (ShouldRingDoorBell) - { - // - // set door ring bell in progress status flag - // - This->m_DoorBellRingInProgress = TRUE; + if (ShouldRingDoorBell) + { + // + // set door ring bell in progress status flag + // + This->m_DoorBellRingInProgress = TRUE; - // - // get command register - // - This->GetCommandRegister(&UsbCmd); + // + // get command register + // + This->GetCommandRegister(&UsbCmd); - // - // set door rang bell bit - // - UsbCmd.DoorBell = TRUE; + // + // set door rang bell bit + // + UsbCmd.DoorBell = TRUE; - // - // update command status - // - This->SetCommandRegister(&UsbCmd); - } + // + // update command status + // + This->SetCommandRegister(&UsbCmd); + } } } // - // check if the controller has acknowledged the door bell + // check if the controller has acknowledged the door bell // if (CStatus & EHCI_STS_IAA) { From ea28c6ea42eee71a7a8a031e426a338d89ac9762 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 30 Mar 2014 09:17:28 +0000 Subject: [PATCH 174/419] [PCI] - Silence some noisy debug prints svn path=/trunk/; revision=62583 --- reactos/drivers/bus/pci/fdo.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/reactos/drivers/bus/pci/fdo.c b/reactos/drivers/bus/pci/fdo.c index b49fc7b658b..66dd1ae5796 100644 --- a/reactos/drivers/bus/pci/fdo.c +++ b/reactos/drivers/bus/pci/fdo.c @@ -503,7 +503,7 @@ FdoPnpControl( DPRINT("Called\n"); - DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension; + DeviceExtension = DeviceObject->DeviceExtension; IrpSp = IoGetCurrentIrpStackLocation(Irp); switch (IrpSp->MinorFunction) @@ -582,8 +582,13 @@ FdoPnpControl( Status = STATUS_SUCCESS; break; + case IRP_MN_QUERY_CAPABILITIES: + case IRP_MN_QUERY_PNP_DEVICE_STATE: + /* Don't print the warning, too much noise */ + break; + default: - DPRINT1("Unknown IOCTL 0x%lx\n", IrpSp->MinorFunction); + DPRINT1("Unknown PNP minor function 0x%x\n", IrpSp->MinorFunction); break; } @@ -591,7 +596,7 @@ FdoPnpControl( IoSkipCurrentIrpStackLocation(Irp); Status = IoCallDriver(DeviceExtension->Ldo, Irp); - DPRINT("Leaving. Status 0x%X\n", Status); + DPRINT("Leaving. Status 0x%lx\n", Status); return Status; } From 3548a3cacb6f1135688bd6ed98abccfda0e29a32 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 30 Mar 2014 09:35:50 +0000 Subject: [PATCH 175/419] [NTOS:IO] - Fix some incredibly useless debug prints svn path=/trunk/; revision=62584 --- reactos/ntoskrnl/io/iomgr/iorsrce.c | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/reactos/ntoskrnl/io/iomgr/iorsrce.c b/reactos/ntoskrnl/io/iomgr/iorsrce.c index a498d6d40fb..4b4ff345c8e 100644 --- a/reactos/ntoskrnl/io/iomgr/iorsrce.c +++ b/reactos/ntoskrnl/io/iomgr/iorsrce.c @@ -233,8 +233,8 @@ IopQueryDeviceDescription( /* How much buffer space */ Status = ZwQueryValueKey(ControllerKeyHandle, &ControllerString, KeyValueFullInformation, NULL, 0, &LenKeyFullInformation); - if(!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL && Status != STATUS_BUFFER_OVERFLOW) - continue; + if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL && Status != STATUS_BUFFER_OVERFLOW) + continue; /* Allocate it */ ControllerInformation[ControllerLoop] = ExAllocatePoolWithTag(PagedPool, LenKeyFullInformation, TAG_IO_RESOURCE); @@ -337,7 +337,7 @@ IopQueryDeviceDescription( /* Create String */ Status |= RtlAppendUnicodeToString(&ControllerRootRegName, L"\\"); - Status |= RtlAppendUnicodeStringToString(&ControllerRootRegName, &TempString); + Status |= RtlAppendUnicodeStringToString(&ControllerRootRegName, &TempString); /* Something messed up */ if (!NT_SUCCESS(Status)) break; @@ -362,11 +362,11 @@ IopQueryDeviceDescription( /* How much buffer space */ Status = ZwQueryValueKey(PeripheralKeyHandle, &PeripheralString, KeyValueFullInformation, NULL, 0, &LenKeyFullInformation); - if(!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL && Status != STATUS_BUFFER_OVERFLOW) - { - PeripheralInformation[PeripheralLoop] = NULL; - continue; - } + if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL && Status != STATUS_BUFFER_OVERFLOW) + { + PeripheralInformation[PeripheralLoop] = NULL; + continue; + } /* Allocate it */ PeripheralInformation[PeripheralLoop] = ExAllocatePoolWithTag(PagedPool, LenKeyFullInformation, TAG_IO_RESOURCE); @@ -482,7 +482,7 @@ IopQueryBusDescription( /* Allocate it */ FullInformation = ExAllocatePoolWithTag(PagedPool, LenFullInformation, TAG_IO_RESOURCE); - if(!FullInformation) + if (!FullInformation) return STATUS_NO_MEMORY; /* Get the Information */ @@ -722,7 +722,7 @@ IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceNam &ObjectAttributes); if (!NT_SUCCESS(Status)) { - DPRINT("Failed opening given symbolic link!\n"); + DPRINT("Failed to open symlink %wZ, Status=%lx\n", NtSystemPartitionDeviceName, Status); return; } @@ -742,7 +742,7 @@ IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceNam if (!NT_SUCCESS(Status)) { - DPRINT("Failed querying given symbolic link!\n"); + DPRINT("Failed querying symlink %wZ, Status=%lx\n", NtSystemPartitionDeviceName, Status); return; } @@ -756,7 +756,7 @@ IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceNam KEY_ALL_ACCESS); if (!NT_SUCCESS(Status)) { - DPRINT("Failed opening registry!\n"); + DPRINT("Failed to open HKLM\SYSTEM, Status=%lx\n", Status); return; } @@ -775,7 +775,7 @@ IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceNam if (!NT_SUCCESS(Status)) { - DPRINT("Failed opening/creating Setup key!\n"); + DPRINT("Failed opening/creating Setup key, Status=%lx\n", Status); return; } @@ -791,7 +791,7 @@ IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceNam LinkTarget.Length + sizeof(WCHAR)); if (!NT_SUCCESS(Status)) { - DPRINT("Failed writing SystemPartition value!\n"); + DPRINT("Failed writing SystemPartition value, Status=%lx\n", Status); } /* Prepare for second data writing... */ @@ -811,10 +811,10 @@ IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceNam 0, REG_SZ, OsLoaderPathName->Buffer, - OsLoaderPathName->Length + sizeof(WCHAR)); + OsLoaderPathName->Length + sizeof(UNICODE_NULL)); if (!NT_SUCCESS(Status)) { - DPRINT("Failed writing OsLoaderPath value!\n"); + DPRINT("Failed writing OsLoaderPath value, Status=%lx\n", Status); } /* We're finally done! */ @@ -870,22 +870,22 @@ IoReportResourceUsage(PUNICODE_STRING DriverClassName, { NTSTATUS Status; PCM_RESOURCE_LIST ResourceList; - + DPRINT1("IoReportResourceUsage is halfplemented!\n"); - + if (!DriverList && !DeviceList) return STATUS_INVALID_PARAMETER; - + if (DeviceList) ResourceList = DeviceList; else ResourceList = DriverList; - + Status = IopDetectResourceConflict(ResourceList, FALSE, NULL); if (Status == STATUS_CONFLICTING_ADDRESSES) { *ConflictDetected = TRUE; - + if (!OverrideConflict) { DPRINT1("Denying an attempt to claim resources currently in use by another device!\n"); @@ -902,9 +902,9 @@ IoReportResourceUsage(PUNICODE_STRING DriverClassName, } /* TODO: Claim resources in registry */ - + *ConflictDetected = FALSE; - + return STATUS_SUCCESS; } From a083c95cebda61e999b32d7387e71e0c5804d9c7 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 30 Mar 2014 09:44:02 +0000 Subject: [PATCH 176/419] [NTOS] - Try compiling before committing, Arch! svn path=/trunk/; revision=62585 --- reactos/ntoskrnl/io/iomgr/iorsrce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/io/iomgr/iorsrce.c b/reactos/ntoskrnl/io/iomgr/iorsrce.c index 4b4ff345c8e..b4befc3cbc8 100644 --- a/reactos/ntoskrnl/io/iomgr/iorsrce.c +++ b/reactos/ntoskrnl/io/iomgr/iorsrce.c @@ -756,7 +756,7 @@ IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceNam KEY_ALL_ACCESS); if (!NT_SUCCESS(Status)) { - DPRINT("Failed to open HKLM\SYSTEM, Status=%lx\n", Status); + DPRINT("Failed to open HKLM\\SYSTEM, Status=%lx\n", Status); return; } From 7528e5d67122a026bda4d1147f196e96a5e1f438 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 30 Mar 2014 09:53:29 +0000 Subject: [PATCH 177/419] [VIDEOPRT] - Add missing newlines to debug prints svn path=/trunk/; revision=62586 --- reactos/win32ss/drivers/videoprt/dispatch.c | 2 +- reactos/win32ss/drivers/videoprt/registry.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/reactos/win32ss/drivers/videoprt/dispatch.c b/reactos/win32ss/drivers/videoprt/dispatch.c index 5d6fac7ed9e..e334f5d5e7a 100644 --- a/reactos/win32ss/drivers/videoprt/dispatch.c +++ b/reactos/win32ss/drivers/videoprt/dispatch.c @@ -327,7 +327,7 @@ VideoPortUseDeviceInSesion( } else { - ERR_(VIDEOPRT, "Requested to set session, but session is already set to: 0x%lx", + ERR_(VIDEOPRT, "Requested to set session, but session is already set to: 0x%lx\n", DeviceExtension->SessionId); SessionState->bSuccess = FALSE; } diff --git a/reactos/win32ss/drivers/videoprt/registry.c b/reactos/win32ss/drivers/videoprt/registry.c index 7f62a4a4d7d..2a74018ad2b 100644 --- a/reactos/win32ss/drivers/videoprt/registry.c +++ b/reactos/win32ss/drivers/videoprt/registry.c @@ -309,7 +309,7 @@ IntSetupDeviceSettingsKey( &DevInstRegKey); if (Status != STATUS_SUCCESS) { - ERR_(VIDEOPRT, "Failed to open device software key. Status 0x%lx", Status); + ERR_(VIDEOPRT, "Failed to open device software key. Status 0x%lx\n", Status); return Status; } @@ -326,7 +326,7 @@ IntSetupDeviceSettingsKey( if (Status != STATUS_SUCCESS) { - ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx", Status); + ERR_(VIDEOPRT, "Failed to open settings key. Status 0x%lx\n", Status); return Status; } @@ -339,7 +339,7 @@ IntSetupDeviceSettingsKey( Status = ZwOpenKey(&SourceKeyHandle, KEY_WRITE, &ObjectAttributes); if (Status != STATUS_SUCCESS) { - ERR_(VIDEOPRT, "ZwOpenKey failed for settings key: status 0x%lx", Status); + ERR_(VIDEOPRT, "ZwOpenKey failed for settings key: status 0x%lx\n", Status); ObCloseHandle(DestKeyHandle, KernelMode); return Status; } @@ -615,7 +615,7 @@ IntCreateRegistryPath( } else { - WARN_(VIDEOPRT, "Unparsable registry path %wZ", DriverRegistryPath); + WARN_(VIDEOPRT, "Unparsable registry path %wZ\n", DriverRegistryPath); } /* If path doesn't point to *ControlSet*, use DriverRegistryPath directly */ From 5f0ac6952a10bec3f5074186b1e2edd0964b3ca8 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 30 Mar 2014 15:46:02 +0000 Subject: [PATCH 178/419] [CRT] - Use PeekConsoleInput in kbhit because the input buffer should not be affected. Patch by Roy Tam CORE-8030 #resolve svn path=/trunk/; revision=62587 --- reactos/lib/sdk/crt/conio/kbhit.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/reactos/lib/sdk/crt/conio/kbhit.c b/reactos/lib/sdk/crt/conio/kbhit.c index 0f29390d82a..89e3f025bd8 100644 --- a/reactos/lib/sdk/crt/conio/kbhit.c +++ b/reactos/lib/sdk/crt/conio/kbhit.c @@ -15,8 +15,6 @@ static CRITICAL_SECTION CriticalSection; volatile BOOL CriticalSectionInitialized=FALSE; /* - * FIXME Initial keyboard char not detected on first punch - * * @implemented */ @@ -71,7 +69,7 @@ int _kbhit(void) return 0; } - if (!ReadConsoleInput(StdInputHandle, InputRecord, EventsRead, &NumberRead)) + if (!PeekConsoleInput(StdInputHandle, InputRecord, EventsRead, &NumberRead)) { free(InputRecord); LeaveCriticalSection(&CriticalSection); From f6d147a5e169463041344a50baf6e068be8045db Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 30 Mar 2014 17:34:56 +0000 Subject: [PATCH 179/419] [W32KDLL] Use new macro based syscall mechanism for w32kdll_xpsp2. Fix exports svn path=/trunk/; revision=62588 --- .../w32kdll/w32kdll_xpsp2/CMakeLists.txt | 2 +- .../w32kdll/w32kdll_xpsp2/sys-stubs.S | 12 + .../w32kdll/w32kdll_xpsp2/w32k_xpsp2-x86.db | 670 --- .../w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.S | 4675 ----------------- .../w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.def | 677 --- .../w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.spec | 3 +- .../w32kdll/w32kdll_xpsp2/win32ksvc-xp.h | 671 +++ 7 files changed, 685 insertions(+), 6025 deletions(-) create mode 100644 rostests/apitests/w32kdll/w32kdll_xpsp2/sys-stubs.S delete mode 100644 rostests/apitests/w32kdll/w32kdll_xpsp2/w32k_xpsp2-x86.db delete mode 100644 rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.S delete mode 100644 rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.def create mode 100644 rostests/apitests/w32kdll/w32kdll_xpsp2/win32ksvc-xp.h diff --git a/rostests/apitests/w32kdll/w32kdll_xpsp2/CMakeLists.txt b/rostests/apitests/w32kdll/w32kdll_xpsp2/CMakeLists.txt index 1c1a4b5d078..5b3149b8c1f 100644 --- a/rostests/apitests/w32kdll/w32kdll_xpsp2/CMakeLists.txt +++ b/rostests/apitests/w32kdll/w32kdll_xpsp2/CMakeLists.txt @@ -2,7 +2,7 @@ spec2def(w32kdll_xpsp2.dll w32kdll_xpsp2.spec ADD_IMPORTLIB) add_library(w32kdll_xpsp2 SHARED main.c - w32kdll_xpsp2.S + sys-stubs.S ${CMAKE_CURRENT_BINARY_DIR}/w32kdll_xpsp2.def) set_entrypoint(w32kdll_xpsp2 0) diff --git a/rostests/apitests/w32kdll/w32kdll_xpsp2/sys-stubs.S b/rostests/apitests/w32kdll/w32kdll_xpsp2/sys-stubs.S new file mode 100644 index 00000000000..b5d5268ecf1 --- /dev/null +++ b/rostests/apitests/w32kdll/w32kdll_xpsp2/sys-stubs.S @@ -0,0 +1,12 @@ + +#include +#include + +.code + +SyscallId = HEX(1000) +#define SVC_(name, argcount) STUB_U name, argcount + +#include "win32ksvc-xp.h" + +END diff --git a/rostests/apitests/w32kdll/w32kdll_xpsp2/w32k_xpsp2-x86.db b/rostests/apitests/w32kdll/w32kdll_xpsp2/w32k_xpsp2-x86.db deleted file mode 100644 index 7db341886d9..00000000000 --- a/rostests/apitests/w32kdll/w32kdll_xpsp2/w32k_xpsp2-x86.db +++ /dev/null @@ -1,670 +0,0 @@ -# -# win32k systemcalls taken from Windows XP SP2 x86 -# -NtGdiAbortDoc 1 -NtGdiAbortPath 1 -NtGdiAddFontResourceW 6 -NtGdiAddRemoteFontToDC 4 -NtGdiAddFontMemResourceEx 5 -NtGdiRemoveMergeFont 2 -NtGdiAddRemoteMMInstanceToDC 3 -NtGdiAlphaBlend 12 -NtGdiAngleArc 6 -NtGdiAnyLinkedFonts 0 -NtGdiFontIsLinked 1 -NtGdiArcInternal 10 -NtGdiBeginPath 1 -NtGdiBitBlt 11 -NtGdiCancelDC 1 -NtGdiCheckBitmapBits 8 -NtGdiCloseFigure 1 -NtGdiClearBitmapAttributes 2 -NtGdiClearBrushAttributes 2 -NtGdiColorCorrectPalette 6 -NtGdiCombineRgn 4 -NtGdiCombineTransform 3 -NtGdiComputeXformCoefficients 1 -NtGdiConsoleTextOut 4 -NtGdiConvertMetafileRect 2 -NtGdiCreateBitmap 5 -NtGdiCreateClientObj 1 -NtGdiCreateColorSpace 1 -NtGdiCreateColorTransform 8 -NtGdiCreateCompatibleBitmap 3 -NtGdiCreateCompatibleDC 1 -NtGdiCreateDIBBrush 6 -NtGdiCreateDIBitmapInternal 11 -NtGdiCreateDIBSection 9 -NtGdiCreateEllipticRgn 4 -NtGdiCreateHalftonePalette 1 -NtGdiCreateHatchBrushInternal 3 -NtGdiCreateMetafileDC 1 -NtGdiCreatePaletteInternal 2 -NtGdiCreatePatternBrushInternal 3 -NtGdiCreatePen 4 -NtGdiCreateRectRgn 4 -NtGdiCreateRoundRectRgn 6 -NtGdiCreateServerMetaFile 6 -NtGdiCreateSolidBrush 2 -NtGdiD3dContextCreate 4 -NtGdiD3dContextDestroy 1 -NtGdiD3dContextDestroyAll 1 -NtGdiD3dValidateTextureStageState 1 -NtGdiD3dDrawPrimitives2 7 -NtGdiDdGetDriverState 1 -NtGdiDdAddAttachedSurface 3 -NtGdiDdAlphaBlt 3 -NtGdiDdAttachSurface 2 -NtGdiDdBeginMoCompFrame 2 -NtGdiDdBlt 3 -NtGdiDdCanCreateSurface 2 -NtGdiDdCanCreateD3DBuffer 2 -NtGdiDdColorControl 2 -NtGdiDdCreateDirectDrawObject 1 -NtGdiDdCreateSurface 8 -NtGdiDdCreateD3DBuffer 8 -NtGdiDdCreateMoComp 2 -NtGdiDdCreateSurfaceObject 6 -NtGdiDdDeleteDirectDrawObject 1 -NtGdiDdDeleteSurfaceObject 1 -NtGdiDdDestroyMoComp 2 -NtGdiDdDestroySurface 2 -NtGdiDdDestroyD3DBuffer 1 -NtGdiDdEndMoCompFrame 2 -NtGdiDdFlip 5 -NtGdiDdFlipToGDISurface 2 -NtGdiDdGetAvailDriverMemory 2 -NtGdiDdGetBltStatus 2 -NtGdiDdGetDC 2 -NtGdiDdGetDriverInfo 2 -NtGdiDdGetDxHandle 3 -NtGdiDdGetFlipStatus 2 -NtGdiDdGetInternalMoCompInfo 2 -NtGdiDdGetMoCompBuffInfo 2 -NtGdiDdGetMoCompGuids 2 -NtGdiDdGetMoCompFormats 2 -NtGdiDdGetScanLine 2 -NtGdiDdLock 3 -NtGdiDdLockD3D 2 -NtGdiDdQueryDirectDrawObject 11 -NtGdiDdQueryMoCompStatus 2 -NtGdiDdReenableDirectDrawObject 2 -NtGdiDdReleaseDC 1 -NtGdiDdRenderMoComp 2 -NtGdiDdResetVisrgn 2 -NtGdiDdSetColorKey 2 -NtGdiDdSetExclusiveMode 2 -NtGdiDdSetGammaRamp 3 -NtGdiDdCreateSurfaceEx 3 -NtGdiDdSetOverlayPosition 3 -NtGdiDdUnattachSurface 2 -NtGdiDdUnlock 2 -NtGdiDdUnlockD3D 2 -NtGdiDdUpdateOverlay 3 -NtGdiDdWaitForVerticalBlank 2 -NtGdiDvpCanCreateVideoPort 2 -NtGdiDvpColorControl 2 -NtGdiDvpCreateVideoPort 2 -NtGdiDvpDestroyVideoPort 2 -NtGdiDvpFlipVideoPort 4 -NtGdiDvpGetVideoPortBandwidth 2 -NtGdiDvpGetVideoPortField 2 -NtGdiDvpGetVideoPortFlipStatus 2 -NtGdiDvpGetVideoPortInputFormats 2 -NtGdiDvpGetVideoPortLine 2 -NtGdiDvpGetVideoPortOutputFormats 2 -NtGdiDvpGetVideoPortConnectInfo 2 -NtGdiDvpGetVideoSignalStatus 2 -NtGdiDvpUpdateVideoPort 4 -NtGdiDvpWaitForVideoPortSync 2 -NtGdiDvpAcquireNotification 3 -NtGdiDvpReleaseNotification 2 -NtGdiDxgGenericThunk 6 -NtGdiDeleteClientObj 1 -NtGdiDeleteColorSpace 1 -NtGdiDeleteColorTransform 2 -NtGdiDeleteObjectApp 1 -NtGdiDescribePixelFormat 4 -NtGdiGetPerBandInfo 2 -NtGdiDoBanding 4 -NtGdiDoPalette 6 -NtGdiDrawEscape 4 -NtGdiEllipse 5 -NtGdiEnableEUDC 1 -NtGdiEndDoc 1 -NtGdiEndPage 1 -NtGdiEndPath 1 -NtGdiEnumFontChunk 5 -NtGdiEnumFontClose 1 -NtGdiEnumFontOpen 7 -NtGdiEnumObjects 4 -NtGdiEqualRgn 2 -NtGdiEudcLoadUnloadLink 7 -NtGdiExcludeClipRect 5 -NtGdiExtCreatePen 11 -NtGdiExtCreateRegion 3 -NtGdiExtEscape 8 -NtGdiExtFloodFill 5 -NtGdiExtGetObjectW 3 -NtGdiExtSelectClipRgn 3 -NtGdiExtTextOutW 9 -NtGdiFillPath 1 -NtGdiFillRgn 3 -NtGdiFlattenPath 1 -NtGdiFlushUserBatch 0 -NtGdiFlush 0 -NtGdiForceUFIMapping 2 -NtGdiFrameRgn 5 -NtGdiFullscreenControl 5 -NtGdiGetAndSetDCDword 4 -NtGdiGetAppClipBox 2 -NtGdiGetBitmapBits 3 -NtGdiGetBitmapDimension 2 -NtGdiGetBoundsRect 3 -NtGdiGetCharABCWidthsW 6 -NtGdiGetCharacterPlacementW 6 -NtGdiGetCharSet 1 -NtGdiGetCharWidthW 6 -NtGdiGetCharWidthInfo 2 -NtGdiGetColorAdjustment 2 -NtGdiGetColorSpaceforBitmap 1 -NtGdiGetDCDword 3 -NtGdiGetDCforBitmap 1 -NtGdiGetDCObject 2 -NtGdiGetDCPoint 3 -NtGdiGetDeviceCaps 2 -NtGdiGetDeviceGammaRamp 2 -NtGdiGetDeviceCapsAll 2 -NtGdiGetDIBitsInternal 9 -NtGdiGetETM 2 -NtGdiGetEudcTimeStampEx 3 -NtGdiGetFontData 5 -NtGdiGetFontResourceInfoInternalW 7 -NtGdiGetGlyphIndicesW 5 -NtGdiGetGlyphIndicesWInternal 6 -NtGdiGetGlyphOutline 8 -NtGdiGetKerningPairs 3 -NtGdiGetLinkedUFIs 3 -NtGdiGetMiterLimit 2 -NtGdiGetMonitorID 3 -NtGdiGetNearestColor 2 -NtGdiGetNearestPaletteIndex 2 -NtGdiGetObjectBitmapHandle 2 -NtGdiGetOutlineTextMetricsInternalW 4 -NtGdiGetPath 4 -NtGdiGetPixel 3 -NtGdiGetRandomRgn 3 -NtGdiGetRasterizerCaps 2 -NtGdiGetRealizationInfo 3 -NtGdiGetRegionData 3 -NtGdiGetRgnBox 2 -NtGdiGetServerMetaFileBits 7 -NtGdiGetSpoolMessage 4 -NtGdiGetStats 5 -NtGdiGetStockObject 1 -NtGdiGetStringBitmapW 5 -NtGdiGetSystemPaletteUse 1 -NtGdiGetTextCharsetInfo 3 -NtGdiGetTextExtent 5 -NtGdiGetTextExtentExW 8 -NtGdiGetTextFaceW 4 -NtGdiGetTextMetricsW 3 -NtGdiGetTransform 3 -NtGdiGetUFI 6 -NtGdiGetEmbUFI 7 -NtGdiGetUFIPathname 10 -NtGdiGetEmbedFonts 0 -NtGdiChangeGhostFont 2 -NtGdiAddEmbFontToDC 2 -NtGdiGetFontUnicodeRanges 2 -NtGdiGetWidthTable 7 -NtGdiGradientFill 6 -NtGdiHfontCreate 5 -NtGdiIcmBrushInfo 8 -NtGdiInit 0 -NtGdiInitSpool 0 -NtGdiIntersectClipRect 5 -NtGdiInvertRgn 2 -NtGdiLineTo 3 -NtGdiMakeFontDir 5 -NtGdiMakeInfoDC 2 -NtGdiMaskBlt 13 -NtGdiModifyWorldTransform 3 -NtGdiMonoBitmap 1 -NtGdiMoveTo 4 -NtGdiOffsetClipRgn 3 -NtGdiOffsetRgn 3 -NtGdiOpenDCW 7 -NtGdiPatBlt 6 -NtGdiPolyPatBlt 5 -NtGdiPathToRegion 1 -NtGdiPlgBlt 11 -NtGdiPolyDraw 4 -NtGdiPolyPolyDraw 5 -NtGdiPolyTextOutW 4 -NtGdiPtInRegion 3 -NtGdiPtVisible 3 -NtGdiQueryFonts 3 -NtGdiQueryFontAssocInfo 1 -NtGdiRectangle 5 -NtGdiRectInRegion 2 -NtGdiRectVisible 2 -NtGdiRemoveFontResourceW 6 -NtGdiRemoveFontMemResourceEx 1 -NtGdiResetDC 5 -NtGdiResizePalette 2 -NtGdiRestoreDC 2 -NtGdiRoundRect 7 -NtGdiSaveDC 1 -NtGdiScaleViewportExtEx 6 -NtGdiScaleWindowExtEx 6 -NtGdiSelectBitmap 2 -NtGdiSelectBrush 2 -NtGdiSelectClipPath 2 -NtGdiSelectFont 2 -NtGdiSelectPen 2 -NtGdiSetBitmapAttributes 2 -NtGdiSetBitmapBits 3 -NtGdiSetBitmapDimension 4 -NtGdiSetBoundsRect 3 -NtGdiSetBrushAttributes 2 -NtGdiSetBrushOrg 4 -NtGdiSetColorAdjustment 2 -NtGdiSetColorSpace 2 -NtGdiSetDeviceGammaRamp 2 -NtGdiSetDIBitsToDeviceInternal 16 -NtGdiSetFontEnumeration 1 -NtGdiSetFontXform 3 -NtGdiSetIcmMode 3 -NtGdiSetLinkedUFIs 3 -NtGdiSetMagicColors 3 -NtGdiSetMetaRgn 1 -NtGdiSetMiterLimit 3 -NtGdiGetDeviceWidth 1 -NtGdiMirrorWindowOrg 1 -NtGdiSetLayout 3 -NtGdiSetPixel 4 -NtGdiSetPixelFormat 2 -NtGdiSetRectRgn 5 -NtGdiSetSystemPaletteUse 2 -NtGdiSetTextJustification 3 -NtGdiSetupPublicCFONT 3 -NtGdiSetVirtualResolution 5 -NtGdiSetSizeDevice 3 -NtGdiStartDoc 4 -NtGdiStartPage 1 -NtGdiStretchBlt 12 -NtGdiStretchDIBitsInternal 16 -NtGdiStrokeAndFillPath 1 -NtGdiStrokePath 1 -NtGdiSwapBuffers 1 -NtGdiTransformPoints 5 -NtGdiTransparentBlt 11 -NtGdiUnloadPrinterDriver 2 -NtGdiUnmapMemFont 1 -NtGdiUnrealizeObject 1 -NtGdiUpdateColors 1 -NtGdiWidenPath 1 -NtUserActivateKeyboardLayout 2 -NtUserAlterWindowStyle 3 -NtUserAssociateInputContext 3 -NtUserAttachThreadInput 3 -NtUserBeginPaint 2 -NtUserBitBltSysBmp 8 -NtUserBlockInput 1 -NtUserBuildHimcList 4 -NtUserBuildHwndList 7 -NtUserBuildNameList 4 -NtUserBuildPropList 4 -NtUserCallHwnd 2 -NtUserCallHwndLock 2 -NtUserCallHwndOpt 2 -NtUserCallHwndParam 3 -NtUserCallHwndParamLock 3 -NtUserCallMsgFilter 2 -NtUserCallNextHookEx 4 -NtUserCallNoParam 1 -NtUserCallOneParam 2 -NtUserCallTwoParam 3 -NtUserChangeClipboardChain 2 -NtUserChangeDisplaySettings 5 -NtUserCheckImeHotKey 2 -NtUserCheckMenuItem 3 -NtUserChildWindowFromPointEx 4 -NtUserClipCursor 1 -NtUserCloseClipboard 0 -NtUserCloseDesktop 1 -NtUserCloseWindowStation 1 -NtUserConsoleControl 3 -NtUserConvertMemHandle 2 -NtUserCopyAcceleratorTable 3 -NtUserCountClipboardFormats 0 -NtUserCreateAcceleratorTable 2 -NtUserCreateCaret 4 -NtUserCreateDesktop 5 -NtUserCreateInputContext 1 -NtUserCreateLocalMemHandle 4 -NtUserCreateWindowEx 15 -NtUserCreateWindowStation 7 -NtUserDdeGetQualityOfService 3 -NtUserDdeInitialize 5 -NtUserDdeSetQualityOfService 3 -NtUserDeferWindowPos 8 -NtUserDefSetText 2 -NtUserDeleteMenu 3 -NtUserDestroyAcceleratorTable 1 -NtUserDestroyCursor 2 -NtUserDestroyInputContext 1 -NtUserDestroyMenu 1 -NtUserDestroyWindow 1 -NtUserDisableThreadIme 1 -NtUserDispatchMessage 1 -NtUserDragDetect 3 -NtUserDragObject 5 -NtUserDrawAnimatedRects 4 -NtUserDrawCaption 4 -NtUserDrawCaptionTemp 7 -NtUserDrawIconEx 11 -NtUserDrawMenuBarTemp 5 -NtUserEmptyClipboard 0 -NtUserEnableMenuItem 3 -NtUserEnableScrollBar 3 -NtUserEndDeferWindowPosEx 2 -NtUserEndMenu 0 -NtUserEndPaint 2 -NtUserEnumDisplayDevices 4 -NtUserEnumDisplayMonitors 4 -NtUserEnumDisplaySettings 4 -NtUserEvent 1 -NtUserExcludeUpdateRgn 2 -NtUserFillWindow 4 -NtUserFindExistingCursorIcon 3 -NtUserFindWindowEx 5 -NtUserFlashWindowEx 1 -NtUserGetAltTabInfo 6 -NtUserGetAncestor 2 -NtUserGetAppImeLevel 1 -NtUserGetAsyncKeyState 1 -NtUserGetAtomName 2 -NtUserGetCaretBlinkTime 0 -NtUserGetCaretPos 1 -NtUserGetClassInfo 5 -NtUserGetClassName 3 -NtUserGetClipboardData 2 -NtUserGetClipboardFormatName 3 -NtUserGetClipboardOwner 0 -NtUserGetClipboardSequenceNumber 0 -NtUserGetClipboardViewer 0 -NtUserGetClipCursor 1 -NtUserGetComboBoxInfo 2 -NtUserGetControlBrush 3 -NtUserGetControlColor 4 -NtUserGetCPD 3 -NtUserGetCursorFrameInfo 4 -NtUserGetCursorInfo 1 -NtUserGetDC 1 -NtUserGetDCEx 3 -NtUserGetDoubleClickTime 0 -NtUserGetForegroundWindow 0 -NtUserGetGuiResources 2 -NtUserGetGUIThreadInfo 2 -NtUserGetIconInfo 6 -NtUserGetIconSize 4 -NtUserGetImeHotKey 4 -NtUserGetImeInfoEx 2 -NtUserGetInternalWindowPos 3 -NtUserGetKeyboardLayoutList 2 -NtUserGetKeyboardLayoutName 1 -NtUserGetKeyboardState 1 -NtUserGetKeyNameText 3 -NtUserGetKeyState 1 -NtUserGetListBoxInfo 1 -NtUserGetMenuBarInfo 4 -NtUserGetMenuIndex 2 -NtUserGetMenuItemRect 4 -NtUserGetMessage 4 -NtUserGetMouseMovePointsEx 5 -NtUserGetObjectInformation 5 -NtUserGetOpenClipboardWindow 0 -NtUserGetPriorityClipboardFormat 2 -NtUserGetProcessWindowStation 0 -NtUserGetRawInputBuffer 3 -NtUserGetRawInputData 5 -NtUserGetRawInputDeviceInfo 4 -NtUserGetRawInputDeviceList 3 -NtUserGetRegisteredRawInputDevices 3 -NtUserGetScrollBarInfo 3 -NtUserGetSystemMenu 2 -NtUserGetThreadDesktop 2 -NtUserGetThreadState 1 -NtUserGetTitleBarInfo 2 -NtUserGetUpdateRect 3 -NtUserGetUpdateRgn 3 -NtUserGetWindowDC 1 -NtUserGetWindowPlacement 2 -NtUserGetWOWClass 2 -NtUserHardErrorControl 3 -NtUserHideCaret 1 -NtUserHiliteMenuItem 4 -NtUserImpersonateDdeClientWindow 2 -NtUserInitialize 3 -NtUserInitializeClientPfnArrays 4 -NtUserInitTask 12 -NtUserInternalGetWindowText 3 -NtUserInvalidateRect 3 -NtUserInvalidateRgn 3 -NtUserIsClipboardFormatAvailable 1 -NtUserKillTimer 2 -NtUserLoadKeyboardLayoutEx 7 -NtUserLockWindowStation 1 -NtUserLockWindowUpdate 1 -NtUserLockWorkStation 0 -NtUserMapVirtualKeyEx 4 -NtUserMenuItemFromPoint 4 -NtUserMessageCall 7 -NtUserMinMaximize 3 -NtUserMNDragLeave 0 -NtUserMNDragOver 2 -NtUserModifyUserStartupInfoFlags 2 -NtUserMoveWindow 6 -NtUserNotifyIMEStatus 3 -NtUserNotifyProcessCreate 4 -NtUserNotifyWinEvent 4 -NtUserOpenClipboard 2 -NtUserOpenDesktop 3 -NtUserOpenInputDesktop 3 -NtUserOpenWindowStation 2 -NtUserPaintDesktop 1 -NtUserPeekMessage 5 -NtUserPostMessage 4 -NtUserPostThreadMessage 4 -NtUserPrintWindow 3 -NtUserProcessConnect 3 -NtUserQueryInformationThread 5 -NtUserQueryInputContext 2 -NtUserQuerySendMessage 1 -NtUserQueryUserCounters 5 -NtUserQueryWindow 2 -NtUserRealChildWindowFromPoint 3 -NtUserRealInternalGetMessage 6 -NtUserRealWaitMessageEx 2 -NtUserRedrawWindow 4 -NtUserRegisterClassExWOW 7 -NtUserRegisterUserApiHook 2 -NtUserRegisterHotKey 4 -NtUserRegisterRawInputDevices 3 -NtUserRegisterTasklist 1 -NtUserRegisterWindowMessage 1 -NtUserRemoveMenu 3 -NtUserRemoveProp 2 -NtUserResolveDesktop 4 -NtUserResolveDesktopForWOW 1 -NtUserSBGetParms 4 -NtUserScrollDC 7 -NtUserScrollWindowEx 8 -NtUserSelectPalette 3 -NtUserSendInput 3 -NtUserSetActiveWindow 1 -NtUserSetAppImeLevel 2 -NtUserSetCapture 1 -NtUserSetClassLong 4 -NtUserSetClassWord 3 -NtUserSetClipboardData 3 -NtUserSetClipboardViewer 1 -NtUserSetConsoleReserveKeys 2 -NtUserSetCursor 1 -NtUserSetCursorContents 2 -NtUserSetCursorIconData 4 -NtUserSetDbgTag 2 -NtUserSetFocus 1 -NtUserSetImeHotKey 5 -NtUserSetImeInfoEx 1 -NtUserSetImeOwnerWindow 2 -NtUserSetInformationProcess 4 -NtUserSetInformationThread 4 -NtUserSetInternalWindowPos 4 -NtUserSetKeyboardState 1 -NtUserSetLogonNotifyWindow 1 -NtUserSetMenu 3 -NtUserSetMenuContextHelpId 2 -NtUserSetMenuDefaultItem 3 -NtUserSetMenuFlagRtoL 1 -NtUserSetObjectInformation 4 -NtUserSetParent 2 -NtUserSetProcessWindowStation 1 -NtUserSetProp 3 -NtUserSetRipFlags 2 -NtUserSetScrollInfo 4 -NtUserSetShellWindowEx 2 -NtUserSetSysColors 4 -NtUserSetSystemCursor 2 -NtUserSetSystemMenu 2 -NtUserSetSystemTimer 4 -NtUserSetThreadDesktop 1 -NtUserSetThreadLayoutHandles 2 -NtUserSetThreadState 2 -NtUserSetTimer 4 -NtUserSetWindowFNID 2 -NtUserSetWindowLong 4 -NtUserSetWindowPlacement 2 -NtUserSetWindowPos 7 -NtUserSetWindowRgn 3 -NtUserSetWindowsHookAW 3 -NtUserSetWindowsHookEx 6 -NtUserSetWindowStationUser 4 -NtUserSetWindowWord 3 -NtUserSetWinEventHook 8 -NtUserShowCaret 1 -NtUserShowScrollBar 3 -NtUserShowWindow 2 -NtUserShowWindowAsync 2 -NtUserSoundSentry 0 -NtUserSwitchDesktop 1 -NtUserSystemParametersInfo 4 -NtUserTestForInteractiveUser 1 -NtUserThunkedMenuInfo 2 -NtUserThunkedMenuItemInfo 6 -NtUserToUnicodeEx 7 -NtUserTrackMouseEvent 1 -NtUserTrackPopupMenuEx 6 -NtUserCalcMenuBar 5 -NtUserPaintMenuBar 6 -NtUserTranslateAccelerator 3 -NtUserTranslateMessage 2 -NtUserUnhookWindowsHookEx 1 -NtUserUnhookWinEvent 1 -NtUserUnloadKeyboardLayout 1 -NtUserUnlockWindowStation 1 -NtUserUnregisterClass 3 -NtUserUnregisterUserApiHook 0 -NtUserUnregisterHotKey 2 -NtUserUpdateInputContext 3 -NtUserUpdateInstance 3 -NtUserUpdateLayeredWindow 9 -NtUserGetLayeredWindowAttributes 4 -NtUserSetLayeredWindowAttributes 4 -NtUserUpdatePerUserSystemParameters 2 -NtUserUserHandleGrantAccess 3 -NtUserValidateHandleSecure 1 -NtUserValidateRect 2 -NtUserValidateTimerCallback 3 -NtUserVkKeyScanEx 3 -NtUserWaitForInputIdle 3 -NtUserWaitForMsgAndEvent 1 -NtUserWaitMessage 0 -NtUserWin32PoolAllocationStats 6 -NtUserWindowFromPoint 2 -NtUserYieldTask 0 -NtUserRemoteConnect 3 -NtUserRemoteRedrawRectangle 4 -NtUserRemoteRedrawScreen 0 -NtUserRemoteStopScreenUpdates 0 -NtUserCtxDisplayIOCtl 3 -NtGdiEngAssociateSurface 3 -NtGdiEngCreateBitmap 6 -NtGdiEngCreateDeviceSurface 4 -NtGdiEngCreateDeviceBitmap 4 -NtGdiEngCreatePalette 6 -NtGdiEngComputeGlyphSet 3 -NtGdiEngCopyBits 6 -NtGdiEngDeletePalette 1 -NtGdiEngDeleteSurface 1 -NtGdiEngEraseSurface 3 -NtGdiEngUnlockSurface 1 -NtGdiEngLockSurface 1 -NtGdiEngBitBlt 11 -NtGdiEngStretchBlt 11 -NtGdiEngPlgBlt 11 -NtGdiEngMarkBandingSurface 1 -NtGdiEngStrokePath 8 -NtGdiEngFillPath 7 -NtGdiEngStrokeAndFillPath 10 -NtGdiEngPaint 5 -NtGdiEngLineTo 9 -NtGdiEngAlphaBlend 7 -NtGdiEngGradientFill 10 -NtGdiEngTransparentBlt 8 -NtGdiEngTextOut 10 -NtGdiEngStretchBltROP 13 -NtGdiXLATEOBJ_cGetPalette 4 -NtGdiXLATEOBJ_iXlate 2 -NtGdiXLATEOBJ_hGetColorTransform 1 -NtGdiCLIPOBJ_bEnum 3 -NtGdiCLIPOBJ_cEnumStart 5 -NtGdiCLIPOBJ_ppoGetPath 1 -NtGdiEngDeletePath 1 -NtGdiEngCreateClip 0 -NtGdiEngDeleteClip 1 -NtGdiBRUSHOBJ_ulGetBrushColor 1 -NtGdiBRUSHOBJ_pvAllocRbrush 2 -NtGdiBRUSHOBJ_pvGetRbrush 1 -NtGdiBRUSHOBJ_hGetColorTransform 1 -NtGdiXFORMOBJ_bApplyXform 5 -NtGdiXFORMOBJ_iGetXform 2 -NtGdiFONTOBJ_vGetInfo 3 -NtGdiFONTOBJ_pxoGetXform 1 -NtGdiFONTOBJ_cGetGlyphs 5 -NtGdiFONTOBJ_pifi 1 -NtGdiFONTOBJ_pfdg 1 -NtGdiFONTOBJ_pQueryGlyphAttrs 2 -NtGdiFONTOBJ_pvTrueTypeFontFile 2 -NtGdiFONTOBJ_cGetAllGlyphHandles 2 -NtGdiSTROBJ_bEnum 3 -NtGdiSTROBJ_bEnumPositionsOnly 3 -NtGdiSTROBJ_bGetAdvanceWidths 4 -NtGdiSTROBJ_vEnumStart 1 -NtGdiSTROBJ_dwGetCodePage 1 -NtGdiPATHOBJ_vGetBounds 2 -NtGdiPATHOBJ_bEnum 2 -NtGdiPATHOBJ_vEnumStart 1 -NtGdiPATHOBJ_vEnumStartClipLines 4 -NtGdiPATHOBJ_bEnumClipLines 3 -NtGdiGetDhpdev 1 -NtGdiEngCheckAbort 1 -NtGdiHT_Get8BPPFormatPalette 4 -NtGdiHT_Get8BPPMaskPalette 6 -NtGdiUpdateTransform 1 -NtGdiSetPUMPDOBJ 4 -NtGdiBRUSHOBJ_DeleteRbrush 2 -NtGdiUMPDEngFreeUserMem 1 -NtGdiDrawStream 3 diff --git a/rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.S b/rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.S deleted file mode 100644 index 8657456a0d8..00000000000 --- a/rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.S +++ /dev/null @@ -1,4675 +0,0 @@ -/* FILE: System Call Stubs for Windows XP SP2 Build 2600 32Bit Native API - * COPYRIGHT: See COPYING in the top level directory - */ - -#define KUSER_SHARED_SYSCALL 0x7FFE0300 - -.global _NtGdiAbortDoc@4 -_NtGdiAbortDoc@4: - movl $0x1000, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiAbortPath@4 -_NtGdiAbortPath@4: - movl $0x1001, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiAddFontResourceW@24 -_NtGdiAddFontResourceW@24: - movl $0x1002, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiAddRemoteFontToDC@16 -_NtGdiAddRemoteFontToDC@16: - movl $0x1003, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiAddFontMemResourceEx@20 -_NtGdiAddFontMemResourceEx@20: - movl $0x1004, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiRemoveMergeFont@8 -_NtGdiRemoveMergeFont@8: - movl $0x1005, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiAddRemoteMMInstanceToDC@12 -_NtGdiAddRemoteMMInstanceToDC@12: - movl $0x1006, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiAlphaBlend@48 -_NtGdiAlphaBlend@48: - movl $0x1007, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x30 - -.global _NtGdiAngleArc@24 -_NtGdiAngleArc@24: - movl $0x1008, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiAnyLinkedFonts@0 -_NtGdiAnyLinkedFonts@0: - movl $0x1009, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtGdiFontIsLinked@4 -_NtGdiFontIsLinked@4: - movl $0x100a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiArcInternal@40 -_NtGdiArcInternal@40: - movl $0x100b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x28 - -.global _NtGdiBeginPath@4 -_NtGdiBeginPath@4: - movl $0x100c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiBitBlt@44 -_NtGdiBitBlt@44: - movl $0x100d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x2c - -.global _NtGdiCancelDC@4 -_NtGdiCancelDC@4: - movl $0x100e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiCheckBitmapBits@32 -_NtGdiCheckBitmapBits@32: - movl $0x100f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtGdiCloseFigure@4 -_NtGdiCloseFigure@4: - movl $0x1010, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiClearBitmapAttributes@8 -_NtGdiClearBitmapAttributes@8: - movl $0x1011, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiClearBrushAttributes@8 -_NtGdiClearBrushAttributes@8: - movl $0x1012, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiColorCorrectPalette@24 -_NtGdiColorCorrectPalette@24: - movl $0x1013, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiCombineRgn@16 -_NtGdiCombineRgn@16: - movl $0x1014, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiCombineTransform@12 -_NtGdiCombineTransform@12: - movl $0x1015, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiComputeXformCoefficients@4 -_NtGdiComputeXformCoefficients@4: - movl $0x1016, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiConsoleTextOut@16 -_NtGdiConsoleTextOut@16: - movl $0x1017, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiConvertMetafileRect@8 -_NtGdiConvertMetafileRect@8: - movl $0x1018, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiCreateBitmap@20 -_NtGdiCreateBitmap@20: - movl $0x1019, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiCreateClientObj@4 -_NtGdiCreateClientObj@4: - movl $0x101a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiCreateColorSpace@4 -_NtGdiCreateColorSpace@4: - movl $0x101b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiCreateColorTransform@32 -_NtGdiCreateColorTransform@32: - movl $0x101c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtGdiCreateCompatibleBitmap@12 -_NtGdiCreateCompatibleBitmap@12: - movl $0x101d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiCreateCompatibleDC@4 -_NtGdiCreateCompatibleDC@4: - movl $0x101e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiCreateDIBBrush@24 -_NtGdiCreateDIBBrush@24: - movl $0x101f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiCreateDIBitmapInternal@44 -_NtGdiCreateDIBitmapInternal@44: - movl $0x1020, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x2c - -.global _NtGdiCreateDIBSection@36 -_NtGdiCreateDIBSection@36: - movl $0x1021, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x24 - -.global _NtGdiCreateEllipticRgn@16 -_NtGdiCreateEllipticRgn@16: - movl $0x1022, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiCreateHalftonePalette@4 -_NtGdiCreateHalftonePalette@4: - movl $0x1023, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiCreateHatchBrushInternal@12 -_NtGdiCreateHatchBrushInternal@12: - movl $0x1024, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiCreateMetafileDC@4 -_NtGdiCreateMetafileDC@4: - movl $0x1025, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiCreatePaletteInternal@8 -_NtGdiCreatePaletteInternal@8: - movl $0x1026, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiCreatePatternBrushInternal@12 -_NtGdiCreatePatternBrushInternal@12: - movl $0x1027, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiCreatePen@16 -_NtGdiCreatePen@16: - movl $0x1028, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiCreateRectRgn@16 -_NtGdiCreateRectRgn@16: - movl $0x1029, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiCreateRoundRectRgn@24 -_NtGdiCreateRoundRectRgn@24: - movl $0x102a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiCreateServerMetaFile@24 -_NtGdiCreateServerMetaFile@24: - movl $0x102b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiCreateSolidBrush@8 -_NtGdiCreateSolidBrush@8: - movl $0x102c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiD3dContextCreate@16 -_NtGdiD3dContextCreate@16: - movl $0x102d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiD3dContextDestroy@4 -_NtGdiD3dContextDestroy@4: - movl $0x102e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiD3dContextDestroyAll@4 -_NtGdiD3dContextDestroyAll@4: - movl $0x102f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiD3dValidateTextureStageState@4 -_NtGdiD3dValidateTextureStageState@4: - movl $0x1030, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiD3dDrawPrimitives2@28 -_NtGdiD3dDrawPrimitives2@28: - movl $0x1031, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiDdGetDriverState@4 -_NtGdiDdGetDriverState@4: - movl $0x1032, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiDdAddAttachedSurface@12 -_NtGdiDdAddAttachedSurface@12: - movl $0x1033, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiDdAlphaBlt@12 -_NtGdiDdAlphaBlt@12: - movl $0x1034, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiDdAttachSurface@8 -_NtGdiDdAttachSurface@8: - movl $0x1035, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdBeginMoCompFrame@8 -_NtGdiDdBeginMoCompFrame@8: - movl $0x1036, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdBlt@12 -_NtGdiDdBlt@12: - movl $0x1037, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiDdCanCreateSurface@8 -_NtGdiDdCanCreateSurface@8: - movl $0x1038, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdCanCreateD3DBuffer@8 -_NtGdiDdCanCreateD3DBuffer@8: - movl $0x1039, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdColorControl@8 -_NtGdiDdColorControl@8: - movl $0x103a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdCreateDirectDrawObject@4 -_NtGdiDdCreateDirectDrawObject@4: - movl $0x103b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiDdCreateSurface@32 -_NtGdiDdCreateSurface@32: - movl $0x103c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtGdiDdCreateD3DBuffer@32 -_NtGdiDdCreateD3DBuffer@32: - movl $0x103d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtGdiDdCreateMoComp@8 -_NtGdiDdCreateMoComp@8: - movl $0x103e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdCreateSurfaceObject@24 -_NtGdiDdCreateSurfaceObject@24: - movl $0x103f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiDdDeleteDirectDrawObject@4 -_NtGdiDdDeleteDirectDrawObject@4: - movl $0x1040, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiDdDeleteSurfaceObject@4 -_NtGdiDdDeleteSurfaceObject@4: - movl $0x1041, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiDdDestroyMoComp@8 -_NtGdiDdDestroyMoComp@8: - movl $0x1042, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdDestroySurface@8 -_NtGdiDdDestroySurface@8: - movl $0x1043, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdDestroyD3DBuffer@4 -_NtGdiDdDestroyD3DBuffer@4: - movl $0x1044, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiDdEndMoCompFrame@8 -_NtGdiDdEndMoCompFrame@8: - movl $0x1045, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdFlip@20 -_NtGdiDdFlip@20: - movl $0x1046, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiDdFlipToGDISurface@8 -_NtGdiDdFlipToGDISurface@8: - movl $0x1047, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdGetAvailDriverMemory@8 -_NtGdiDdGetAvailDriverMemory@8: - movl $0x1048, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdGetBltStatus@8 -_NtGdiDdGetBltStatus@8: - movl $0x1049, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdGetDC@8 -_NtGdiDdGetDC@8: - movl $0x104a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdGetDriverInfo@8 -_NtGdiDdGetDriverInfo@8: - movl $0x104b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdGetDxHandle@12 -_NtGdiDdGetDxHandle@12: - movl $0x104c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiDdGetFlipStatus@8 -_NtGdiDdGetFlipStatus@8: - movl $0x104d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdGetInternalMoCompInfo@8 -_NtGdiDdGetInternalMoCompInfo@8: - movl $0x104e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdGetMoCompBuffInfo@8 -_NtGdiDdGetMoCompBuffInfo@8: - movl $0x104f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdGetMoCompGuids@8 -_NtGdiDdGetMoCompGuids@8: - movl $0x1050, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdGetMoCompFormats@8 -_NtGdiDdGetMoCompFormats@8: - movl $0x1051, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdGetScanLine@8 -_NtGdiDdGetScanLine@8: - movl $0x1052, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdLock@12 -_NtGdiDdLock@12: - movl $0x1053, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiDdLockD3D@8 -_NtGdiDdLockD3D@8: - movl $0x1054, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdQueryDirectDrawObject@44 -_NtGdiDdQueryDirectDrawObject@44: - movl $0x1055, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x2c - -.global _NtGdiDdQueryMoCompStatus@8 -_NtGdiDdQueryMoCompStatus@8: - movl $0x1056, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdReenableDirectDrawObject@8 -_NtGdiDdReenableDirectDrawObject@8: - movl $0x1057, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdReleaseDC@4 -_NtGdiDdReleaseDC@4: - movl $0x1058, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiDdRenderMoComp@8 -_NtGdiDdRenderMoComp@8: - movl $0x1059, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdResetVisrgn@8 -_NtGdiDdResetVisrgn@8: - movl $0x105a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdSetColorKey@8 -_NtGdiDdSetColorKey@8: - movl $0x105b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdSetExclusiveMode@8 -_NtGdiDdSetExclusiveMode@8: - movl $0x105c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdSetGammaRamp@12 -_NtGdiDdSetGammaRamp@12: - movl $0x105d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiDdCreateSurfaceEx@12 -_NtGdiDdCreateSurfaceEx@12: - movl $0x105e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiDdSetOverlayPosition@12 -_NtGdiDdSetOverlayPosition@12: - movl $0x105f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiDdUnattachSurface@8 -_NtGdiDdUnattachSurface@8: - movl $0x1060, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdUnlock@8 -_NtGdiDdUnlock@8: - movl $0x1061, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdUnlockD3D@8 -_NtGdiDdUnlockD3D@8: - movl $0x1062, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDdUpdateOverlay@12 -_NtGdiDdUpdateOverlay@12: - movl $0x1063, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiDdWaitForVerticalBlank@8 -_NtGdiDdWaitForVerticalBlank@8: - movl $0x1064, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpCanCreateVideoPort@8 -_NtGdiDvpCanCreateVideoPort@8: - movl $0x1065, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpColorControl@8 -_NtGdiDvpColorControl@8: - movl $0x1066, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpCreateVideoPort@8 -_NtGdiDvpCreateVideoPort@8: - movl $0x1067, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpDestroyVideoPort@8 -_NtGdiDvpDestroyVideoPort@8: - movl $0x1068, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpFlipVideoPort@16 -_NtGdiDvpFlipVideoPort@16: - movl $0x1069, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiDvpGetVideoPortBandwidth@8 -_NtGdiDvpGetVideoPortBandwidth@8: - movl $0x106a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpGetVideoPortField@8 -_NtGdiDvpGetVideoPortField@8: - movl $0x106b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpGetVideoPortFlipStatus@8 -_NtGdiDvpGetVideoPortFlipStatus@8: - movl $0x106c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpGetVideoPortInputFormats@8 -_NtGdiDvpGetVideoPortInputFormats@8: - movl $0x106d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpGetVideoPortLine@8 -_NtGdiDvpGetVideoPortLine@8: - movl $0x106e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpGetVideoPortOutputFormats@8 -_NtGdiDvpGetVideoPortOutputFormats@8: - movl $0x106f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpGetVideoPortConnectInfo@8 -_NtGdiDvpGetVideoPortConnectInfo@8: - movl $0x1070, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpGetVideoSignalStatus@8 -_NtGdiDvpGetVideoSignalStatus@8: - movl $0x1071, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpUpdateVideoPort@16 -_NtGdiDvpUpdateVideoPort@16: - movl $0x1072, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiDvpWaitForVideoPortSync@8 -_NtGdiDvpWaitForVideoPortSync@8: - movl $0x1073, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDvpAcquireNotification@12 -_NtGdiDvpAcquireNotification@12: - movl $0x1074, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiDvpReleaseNotification@8 -_NtGdiDvpReleaseNotification@8: - movl $0x1075, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDxgGenericThunk@24 -_NtGdiDxgGenericThunk@24: - movl $0x1076, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiDeleteClientObj@4 -_NtGdiDeleteClientObj@4: - movl $0x1077, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiDeleteColorSpace@4 -_NtGdiDeleteColorSpace@4: - movl $0x1078, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiDeleteColorTransform@8 -_NtGdiDeleteColorTransform@8: - movl $0x1079, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDeleteObjectApp@4 -_NtGdiDeleteObjectApp@4: - movl $0x107a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiDescribePixelFormat@16 -_NtGdiDescribePixelFormat@16: - movl $0x107b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiGetPerBandInfo@8 -_NtGdiGetPerBandInfo@8: - movl $0x107c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiDoBanding@16 -_NtGdiDoBanding@16: - movl $0x107d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiDoPalette@24 -_NtGdiDoPalette@24: - movl $0x107e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiDrawEscape@16 -_NtGdiDrawEscape@16: - movl $0x107f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiEllipse@20 -_NtGdiEllipse@20: - movl $0x1080, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiEnableEUDC@4 -_NtGdiEnableEUDC@4: - movl $0x1081, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEndDoc@4 -_NtGdiEndDoc@4: - movl $0x1082, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEndPage@4 -_NtGdiEndPage@4: - movl $0x1083, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEndPath@4 -_NtGdiEndPath@4: - movl $0x1084, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEnumFontChunk@20 -_NtGdiEnumFontChunk@20: - movl $0x1085, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiEnumFontClose@4 -_NtGdiEnumFontClose@4: - movl $0x1086, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEnumFontOpen@28 -_NtGdiEnumFontOpen@28: - movl $0x1087, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiEnumObjects@16 -_NtGdiEnumObjects@16: - movl $0x1088, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiEqualRgn@8 -_NtGdiEqualRgn@8: - movl $0x1089, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiEudcLoadUnloadLink@28 -_NtGdiEudcLoadUnloadLink@28: - movl $0x108a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiExcludeClipRect@20 -_NtGdiExcludeClipRect@20: - movl $0x108b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiExtCreatePen@44 -_NtGdiExtCreatePen@44: - movl $0x108c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x2c - -.global _NtGdiExtCreateRegion@12 -_NtGdiExtCreateRegion@12: - movl $0x108d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiExtEscape@32 -_NtGdiExtEscape@32: - movl $0x108e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtGdiExtFloodFill@20 -_NtGdiExtFloodFill@20: - movl $0x108f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiExtGetObjectW@12 -_NtGdiExtGetObjectW@12: - movl $0x1090, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiExtSelectClipRgn@12 -_NtGdiExtSelectClipRgn@12: - movl $0x1091, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiExtTextOutW@36 -_NtGdiExtTextOutW@36: - movl $0x1092, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x24 - -.global _NtGdiFillPath@4 -_NtGdiFillPath@4: - movl $0x1093, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiFillRgn@12 -_NtGdiFillRgn@12: - movl $0x1094, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiFlattenPath@4 -_NtGdiFlattenPath@4: - movl $0x1095, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiFlushUserBatch@0 -_NtGdiFlushUserBatch@0: - movl $0x1096, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtGdiFlush@0 -_NtGdiFlush@0: - movl $0x1097, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtGdiForceUFIMapping@8 -_NtGdiForceUFIMapping@8: - movl $0x1098, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiFrameRgn@20 -_NtGdiFrameRgn@20: - movl $0x1099, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiFullscreenControl@20 -_NtGdiFullscreenControl@20: - movl $0x109a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiGetAndSetDCDword@16 -_NtGdiGetAndSetDCDword@16: - movl $0x109b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiGetAppClipBox@8 -_NtGdiGetAppClipBox@8: - movl $0x109c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetBitmapBits@12 -_NtGdiGetBitmapBits@12: - movl $0x109d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetBitmapDimension@8 -_NtGdiGetBitmapDimension@8: - movl $0x109e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetBoundsRect@12 -_NtGdiGetBoundsRect@12: - movl $0x109f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetCharABCWidthsW@24 -_NtGdiGetCharABCWidthsW@24: - movl $0x10a0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiGetCharacterPlacementW@24 -_NtGdiGetCharacterPlacementW@24: - movl $0x10a1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiGetCharSet@4 -_NtGdiGetCharSet@4: - movl $0x10a2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiGetCharWidthW@24 -_NtGdiGetCharWidthW@24: - movl $0x10a3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiGetCharWidthInfo@8 -_NtGdiGetCharWidthInfo@8: - movl $0x10a4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetColorAdjustment@8 -_NtGdiGetColorAdjustment@8: - movl $0x10a5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetColorSpaceforBitmap@4 -_NtGdiGetColorSpaceforBitmap@4: - movl $0x10a6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiGetDCDword@12 -_NtGdiGetDCDword@12: - movl $0x10a7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetDCforBitmap@4 -_NtGdiGetDCforBitmap@4: - movl $0x10a8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiGetDCObject@8 -_NtGdiGetDCObject@8: - movl $0x10a9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetDCPoint@12 -_NtGdiGetDCPoint@12: - movl $0x10aa, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetDeviceCaps@8 -_NtGdiGetDeviceCaps@8: - movl $0x10ab, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetDeviceGammaRamp@8 -_NtGdiGetDeviceGammaRamp@8: - movl $0x10ac, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetDeviceCapsAll@8 -_NtGdiGetDeviceCapsAll@8: - movl $0x10ad, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetDIBitsInternal@36 -_NtGdiGetDIBitsInternal@36: - movl $0x10ae, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x24 - -.global _NtGdiGetETM@8 -_NtGdiGetETM@8: - movl $0x10af, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetEudcTimeStampEx@12 -_NtGdiGetEudcTimeStampEx@12: - movl $0x10b0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetFontData@20 -_NtGdiGetFontData@20: - movl $0x10b1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiGetFontResourceInfoInternalW@28 -_NtGdiGetFontResourceInfoInternalW@28: - movl $0x10b2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiGetGlyphIndicesW@20 -_NtGdiGetGlyphIndicesW@20: - movl $0x10b3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiGetGlyphIndicesWInternal@24 -_NtGdiGetGlyphIndicesWInternal@24: - movl $0x10b4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiGetGlyphOutline@32 -_NtGdiGetGlyphOutline@32: - movl $0x10b5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtGdiGetKerningPairs@12 -_NtGdiGetKerningPairs@12: - movl $0x10b6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetLinkedUFIs@12 -_NtGdiGetLinkedUFIs@12: - movl $0x10b7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetMiterLimit@8 -_NtGdiGetMiterLimit@8: - movl $0x10b8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetMonitorID@12 -_NtGdiGetMonitorID@12: - movl $0x10b9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetNearestColor@8 -_NtGdiGetNearestColor@8: - movl $0x10ba, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetNearestPaletteIndex@8 -_NtGdiGetNearestPaletteIndex@8: - movl $0x10bb, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetObjectBitmapHandle@8 -_NtGdiGetObjectBitmapHandle@8: - movl $0x10bc, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetOutlineTextMetricsInternalW@16 -_NtGdiGetOutlineTextMetricsInternalW@16: - movl $0x10bd, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiGetPath@16 -_NtGdiGetPath@16: - movl $0x10be, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiGetPixel@12 -_NtGdiGetPixel@12: - movl $0x10bf, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetRandomRgn@12 -_NtGdiGetRandomRgn@12: - movl $0x10c0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetRasterizerCaps@8 -_NtGdiGetRasterizerCaps@8: - movl $0x10c1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetRealizationInfo@12 -_NtGdiGetRealizationInfo@12: - movl $0x10c2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetRegionData@12 -_NtGdiGetRegionData@12: - movl $0x10c3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetRgnBox@8 -_NtGdiGetRgnBox@8: - movl $0x10c4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetServerMetaFileBits@28 -_NtGdiGetServerMetaFileBits@28: - movl $0x10c5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiGetSpoolMessage@16 -_NtGdiGetSpoolMessage@16: - movl $0x10c6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiGetStats@20 -_NtGdiGetStats@20: - movl $0x10c7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiGetStockObject@4 -_NtGdiGetStockObject@4: - movl $0x10c8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiGetStringBitmapW@20 -_NtGdiGetStringBitmapW@20: - movl $0x10c9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiGetSystemPaletteUse@4 -_NtGdiGetSystemPaletteUse@4: - movl $0x10ca, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiGetTextCharsetInfo@12 -_NtGdiGetTextCharsetInfo@12: - movl $0x10cb, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetTextExtent@20 -_NtGdiGetTextExtent@20: - movl $0x10cc, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiGetTextExtentExW@32 -_NtGdiGetTextExtentExW@32: - movl $0x10cd, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtGdiGetTextFaceW@16 -_NtGdiGetTextFaceW@16: - movl $0x10ce, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiGetTextMetricsW@12 -_NtGdiGetTextMetricsW@12: - movl $0x10cf, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetTransform@12 -_NtGdiGetTransform@12: - movl $0x10d0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetUFI@24 -_NtGdiGetUFI@24: - movl $0x10d1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiGetEmbUFI@28 -_NtGdiGetEmbUFI@28: - movl $0x10d2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiGetUFIPathname@40 -_NtGdiGetUFIPathname@40: - movl $0x10d3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x28 - -.global _NtGdiGetEmbedFonts@0 -_NtGdiGetEmbedFonts@0: - movl $0x10d4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtGdiChangeGhostFont@8 -_NtGdiChangeGhostFont@8: - movl $0x10d5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiAddEmbFontToDC@8 -_NtGdiAddEmbFontToDC@8: - movl $0x10d6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetFontUnicodeRanges@8 -_NtGdiGetFontUnicodeRanges@8: - movl $0x10d7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiGetWidthTable@28 -_NtGdiGetWidthTable@28: - movl $0x10d8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiGradientFill@24 -_NtGdiGradientFill@24: - movl $0x10d9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiHfontCreate@20 -_NtGdiHfontCreate@20: - movl $0x10da, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiIcmBrushInfo@32 -_NtGdiIcmBrushInfo@32: - movl $0x10db, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtGdiInit@0 -_NtGdiInit@0: - movl $0x10dc, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtGdiInitSpool@0 -_NtGdiInitSpool@0: - movl $0x10dd, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtGdiIntersectClipRect@20 -_NtGdiIntersectClipRect@20: - movl $0x10de, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiInvertRgn@8 -_NtGdiInvertRgn@8: - movl $0x10df, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiLineTo@12 -_NtGdiLineTo@12: - movl $0x10e0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiMakeFontDir@20 -_NtGdiMakeFontDir@20: - movl $0x10e1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiMakeInfoDC@8 -_NtGdiMakeInfoDC@8: - movl $0x10e2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiMaskBlt@52 -_NtGdiMaskBlt@52: - movl $0x10e3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x34 - -.global _NtGdiModifyWorldTransform@12 -_NtGdiModifyWorldTransform@12: - movl $0x10e4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiMonoBitmap@4 -_NtGdiMonoBitmap@4: - movl $0x10e5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiMoveTo@16 -_NtGdiMoveTo@16: - movl $0x10e6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiOffsetClipRgn@12 -_NtGdiOffsetClipRgn@12: - movl $0x10e7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiOffsetRgn@12 -_NtGdiOffsetRgn@12: - movl $0x10e8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiOpenDCW@28 -_NtGdiOpenDCW@28: - movl $0x10e9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiPatBlt@24 -_NtGdiPatBlt@24: - movl $0x10ea, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiPolyPatBlt@20 -_NtGdiPolyPatBlt@20: - movl $0x10eb, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiPathToRegion@4 -_NtGdiPathToRegion@4: - movl $0x10ec, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiPlgBlt@44 -_NtGdiPlgBlt@44: - movl $0x10ed, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x2c - -.global _NtGdiPolyDraw@16 -_NtGdiPolyDraw@16: - movl $0x10ee, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiPolyPolyDraw@20 -_NtGdiPolyPolyDraw@20: - movl $0x10ef, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiPolyTextOutW@16 -_NtGdiPolyTextOutW@16: - movl $0x10f0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiPtInRegion@12 -_NtGdiPtInRegion@12: - movl $0x10f1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiPtVisible@12 -_NtGdiPtVisible@12: - movl $0x10f2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiQueryFonts@12 -_NtGdiQueryFonts@12: - movl $0x10f3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiQueryFontAssocInfo@4 -_NtGdiQueryFontAssocInfo@4: - movl $0x10f4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiRectangle@20 -_NtGdiRectangle@20: - movl $0x10f5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiRectInRegion@8 -_NtGdiRectInRegion@8: - movl $0x10f6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiRectVisible@8 -_NtGdiRectVisible@8: - movl $0x10f7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiRemoveFontResourceW@24 -_NtGdiRemoveFontResourceW@24: - movl $0x10f8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiRemoveFontMemResourceEx@4 -_NtGdiRemoveFontMemResourceEx@4: - movl $0x10f9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiResetDC@20 -_NtGdiResetDC@20: - movl $0x10fa, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiResizePalette@8 -_NtGdiResizePalette@8: - movl $0x10fb, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiRestoreDC@8 -_NtGdiRestoreDC@8: - movl $0x10fc, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiRoundRect@28 -_NtGdiRoundRect@28: - movl $0x10fd, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiSaveDC@4 -_NtGdiSaveDC@4: - movl $0x10fe, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiScaleViewportExtEx@24 -_NtGdiScaleViewportExtEx@24: - movl $0x10ff, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiScaleWindowExtEx@24 -_NtGdiScaleWindowExtEx@24: - movl $0x1100, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiSelectBitmap@8 -_NtGdiSelectBitmap@8: - movl $0x1101, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSelectBrush@8 -_NtGdiSelectBrush@8: - movl $0x1102, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSelectClipPath@8 -_NtGdiSelectClipPath@8: - movl $0x1103, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSelectFont@8 -_NtGdiSelectFont@8: - movl $0x1104, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSelectPen@8 -_NtGdiSelectPen@8: - movl $0x1105, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSetBitmapAttributes@8 -_NtGdiSetBitmapAttributes@8: - movl $0x1106, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSetBitmapBits@12 -_NtGdiSetBitmapBits@12: - movl $0x1107, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSetBitmapDimension@16 -_NtGdiSetBitmapDimension@16: - movl $0x1108, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiSetBoundsRect@12 -_NtGdiSetBoundsRect@12: - movl $0x1109, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSetBrushAttributes@8 -_NtGdiSetBrushAttributes@8: - movl $0x110a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSetBrushOrg@16 -_NtGdiSetBrushOrg@16: - movl $0x110b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiSetColorAdjustment@8 -_NtGdiSetColorAdjustment@8: - movl $0x110c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSetColorSpace@8 -_NtGdiSetColorSpace@8: - movl $0x110d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSetDeviceGammaRamp@8 -_NtGdiSetDeviceGammaRamp@8: - movl $0x110e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSetDIBitsToDeviceInternal@64 -_NtGdiSetDIBitsToDeviceInternal@64: - movl $0x110f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x40 - -.global _NtGdiSetFontEnumeration@4 -_NtGdiSetFontEnumeration@4: - movl $0x1110, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiSetFontXform@12 -_NtGdiSetFontXform@12: - movl $0x1111, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSetIcmMode@12 -_NtGdiSetIcmMode@12: - movl $0x1112, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSetLinkedUFIs@12 -_NtGdiSetLinkedUFIs@12: - movl $0x1113, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSetMagicColors@12 -_NtGdiSetMagicColors@12: - movl $0x1114, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSetMetaRgn@4 -_NtGdiSetMetaRgn@4: - movl $0x1115, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiSetMiterLimit@12 -_NtGdiSetMiterLimit@12: - movl $0x1116, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetDeviceWidth@4 -_NtGdiGetDeviceWidth@4: - movl $0x1117, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiMirrorWindowOrg@4 -_NtGdiMirrorWindowOrg@4: - movl $0x1118, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiSetLayout@12 -_NtGdiSetLayout@12: - movl $0x1119, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSetPixel@16 -_NtGdiSetPixel@16: - movl $0x111a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiSetPixelFormat@8 -_NtGdiSetPixelFormat@8: - movl $0x111b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSetRectRgn@20 -_NtGdiSetRectRgn@20: - movl $0x111c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiSetSystemPaletteUse@8 -_NtGdiSetSystemPaletteUse@8: - movl $0x111d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSetTextJustification@12 -_NtGdiSetTextJustification@12: - movl $0x111e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSetupPublicCFONT@12 -_NtGdiSetupPublicCFONT@12: - movl $0x111f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSetVirtualResolution@20 -_NtGdiSetVirtualResolution@20: - movl $0x1120, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiSetSizeDevice@12 -_NtGdiSetSizeDevice@12: - movl $0x1121, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiStartDoc@16 -_NtGdiStartDoc@16: - movl $0x1122, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiStartPage@4 -_NtGdiStartPage@4: - movl $0x1123, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiStretchBlt@48 -_NtGdiStretchBlt@48: - movl $0x1124, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x30 - -.global _NtGdiStretchDIBitsInternal@64 -_NtGdiStretchDIBitsInternal@64: - movl $0x1125, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x40 - -.global _NtGdiStrokeAndFillPath@4 -_NtGdiStrokeAndFillPath@4: - movl $0x1126, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiStrokePath@4 -_NtGdiStrokePath@4: - movl $0x1127, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiSwapBuffers@4 -_NtGdiSwapBuffers@4: - movl $0x1128, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiTransformPoints@20 -_NtGdiTransformPoints@20: - movl $0x1129, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiTransparentBlt@44 -_NtGdiTransparentBlt@44: - movl $0x112a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x2c - -.global _NtGdiUnloadPrinterDriver@8 -_NtGdiUnloadPrinterDriver@8: - movl $0x112b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiUnmapMemFont@4 -_NtGdiUnmapMemFont@4: - movl $0x112c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiUnrealizeObject@4 -_NtGdiUnrealizeObject@4: - movl $0x112d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiUpdateColors@4 -_NtGdiUpdateColors@4: - movl $0x112e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiWidenPath@4 -_NtGdiWidenPath@4: - movl $0x112f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserActivateKeyboardLayout@8 -_NtUserActivateKeyboardLayout@8: - movl $0x1130, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserAlterWindowStyle@12 -_NtUserAlterWindowStyle@12: - movl $0x1131, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserAssociateInputContext@12 -_NtUserAssociateInputContext@12: - movl $0x1132, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserAttachThreadInput@12 -_NtUserAttachThreadInput@12: - movl $0x1133, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserBeginPaint@8 -_NtUserBeginPaint@8: - movl $0x1134, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserBitBltSysBmp@32 -_NtUserBitBltSysBmp@32: - movl $0x1135, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtUserBlockInput@4 -_NtUserBlockInput@4: - movl $0x1136, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserBuildHimcList@16 -_NtUserBuildHimcList@16: - movl $0x1137, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserBuildHwndList@28 -_NtUserBuildHwndList@28: - movl $0x1138, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtUserBuildNameList@16 -_NtUserBuildNameList@16: - movl $0x1139, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserBuildPropList@16 -_NtUserBuildPropList@16: - movl $0x113a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserCallHwnd@8 -_NtUserCallHwnd@8: - movl $0x113b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserCallHwndLock@8 -_NtUserCallHwndLock@8: - movl $0x113c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserCallHwndOpt@8 -_NtUserCallHwndOpt@8: - movl $0x113d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserCallHwndParam@12 -_NtUserCallHwndParam@12: - movl $0x113e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserCallHwndParamLock@12 -_NtUserCallHwndParamLock@12: - movl $0x113f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserCallMsgFilter@8 -_NtUserCallMsgFilter@8: - movl $0x1140, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserCallNextHookEx@16 -_NtUserCallNextHookEx@16: - movl $0x1141, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserCallNoParam@4 -_NtUserCallNoParam@4: - movl $0x1142, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserCallOneParam@8 -_NtUserCallOneParam@8: - movl $0x1143, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserCallTwoParam@12 -_NtUserCallTwoParam@12: - movl $0x1144, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserChangeClipboardChain@8 -_NtUserChangeClipboardChain@8: - movl $0x1145, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserChangeDisplaySettings@20 -_NtUserChangeDisplaySettings@20: - movl $0x1146, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserCheckImeHotKey@8 -_NtUserCheckImeHotKey@8: - movl $0x1147, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserCheckMenuItem@12 -_NtUserCheckMenuItem@12: - movl $0x1148, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserChildWindowFromPointEx@16 -_NtUserChildWindowFromPointEx@16: - movl $0x1149, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserClipCursor@4 -_NtUserClipCursor@4: - movl $0x114a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserCloseClipboard@0 -_NtUserCloseClipboard@0: - movl $0x114b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserCloseDesktop@4 -_NtUserCloseDesktop@4: - movl $0x114c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserCloseWindowStation@4 -_NtUserCloseWindowStation@4: - movl $0x114d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserConsoleControl@12 -_NtUserConsoleControl@12: - movl $0x114e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserConvertMemHandle@8 -_NtUserConvertMemHandle@8: - movl $0x114f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserCopyAcceleratorTable@12 -_NtUserCopyAcceleratorTable@12: - movl $0x1150, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserCountClipboardFormats@0 -_NtUserCountClipboardFormats@0: - movl $0x1151, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserCreateAcceleratorTable@8 -_NtUserCreateAcceleratorTable@8: - movl $0x1152, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserCreateCaret@16 -_NtUserCreateCaret@16: - movl $0x1153, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserCreateDesktop@20 -_NtUserCreateDesktop@20: - movl $0x1154, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserCreateInputContext@4 -_NtUserCreateInputContext@4: - movl $0x1155, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserCreateLocalMemHandle@16 -_NtUserCreateLocalMemHandle@16: - movl $0x1156, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserCreateWindowEx@60 -_NtUserCreateWindowEx@60: - movl $0x1157, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x3c - -.global _NtUserCreateWindowStation@28 -_NtUserCreateWindowStation@28: - movl $0x1158, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtUserDdeGetQualityOfService@12 -_NtUserDdeGetQualityOfService@12: - movl $0x1159, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserDdeInitialize@20 -_NtUserDdeInitialize@20: - movl $0x115a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserDdeSetQualityOfService@12 -_NtUserDdeSetQualityOfService@12: - movl $0x115b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserDeferWindowPos@32 -_NtUserDeferWindowPos@32: - movl $0x115c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtUserDefSetText@8 -_NtUserDefSetText@8: - movl $0x115d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserDeleteMenu@12 -_NtUserDeleteMenu@12: - movl $0x115e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserDestroyAcceleratorTable@4 -_NtUserDestroyAcceleratorTable@4: - movl $0x115f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserDestroyCursor@8 -_NtUserDestroyCursor@8: - movl $0x1160, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserDestroyInputContext@4 -_NtUserDestroyInputContext@4: - movl $0x1161, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserDestroyMenu@4 -_NtUserDestroyMenu@4: - movl $0x1162, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserDestroyWindow@4 -_NtUserDestroyWindow@4: - movl $0x1163, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserDisableThreadIme@4 -_NtUserDisableThreadIme@4: - movl $0x1164, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserDispatchMessage@4 -_NtUserDispatchMessage@4: - movl $0x1165, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserDragDetect@12 -_NtUserDragDetect@12: - movl $0x1166, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserDragObject@20 -_NtUserDragObject@20: - movl $0x1167, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserDrawAnimatedRects@16 -_NtUserDrawAnimatedRects@16: - movl $0x1168, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserDrawCaption@16 -_NtUserDrawCaption@16: - movl $0x1169, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserDrawCaptionTemp@28 -_NtUserDrawCaptionTemp@28: - movl $0x116a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtUserDrawIconEx@44 -_NtUserDrawIconEx@44: - movl $0x116b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x2c - -.global _NtUserDrawMenuBarTemp@20 -_NtUserDrawMenuBarTemp@20: - movl $0x116c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserEmptyClipboard@0 -_NtUserEmptyClipboard@0: - movl $0x116d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserEnableMenuItem@12 -_NtUserEnableMenuItem@12: - movl $0x116e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserEnableScrollBar@12 -_NtUserEnableScrollBar@12: - movl $0x116f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserEndDeferWindowPosEx@8 -_NtUserEndDeferWindowPosEx@8: - movl $0x1170, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserEndMenu@0 -_NtUserEndMenu@0: - movl $0x1171, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserEndPaint@8 -_NtUserEndPaint@8: - movl $0x1172, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserEnumDisplayDevices@16 -_NtUserEnumDisplayDevices@16: - movl $0x1173, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserEnumDisplayMonitors@16 -_NtUserEnumDisplayMonitors@16: - movl $0x1174, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserEnumDisplaySettings@16 -_NtUserEnumDisplaySettings@16: - movl $0x1175, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserEvent@4 -_NtUserEvent@4: - movl $0x1176, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserExcludeUpdateRgn@8 -_NtUserExcludeUpdateRgn@8: - movl $0x1177, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserFillWindow@16 -_NtUserFillWindow@16: - movl $0x1178, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserFindExistingCursorIcon@12 -_NtUserFindExistingCursorIcon@12: - movl $0x1179, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserFindWindowEx@20 -_NtUserFindWindowEx@20: - movl $0x117a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserFlashWindowEx@4 -_NtUserFlashWindowEx@4: - movl $0x117b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetAltTabInfo@24 -_NtUserGetAltTabInfo@24: - movl $0x117c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtUserGetAncestor@8 -_NtUserGetAncestor@8: - movl $0x117d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetAppImeLevel@4 -_NtUserGetAppImeLevel@4: - movl $0x117e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetAsyncKeyState@4 -_NtUserGetAsyncKeyState@4: - movl $0x117f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetAtomName@8 -_NtUserGetAtomName@8: - movl $0x1180, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetCaretBlinkTime@0 -_NtUserGetCaretBlinkTime@0: - movl $0x1181, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserGetCaretPos@4 -_NtUserGetCaretPos@4: - movl $0x1182, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetClassInfo@20 -_NtUserGetClassInfo@20: - movl $0x1183, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserGetClassName@12 -_NtUserGetClassName@12: - movl $0x1184, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetClipboardData@8 -_NtUserGetClipboardData@8: - movl $0x1185, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetClipboardFormatName@12 -_NtUserGetClipboardFormatName@12: - movl $0x1186, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetClipboardOwner@0 -_NtUserGetClipboardOwner@0: - movl $0x1187, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserGetClipboardSequenceNumber@0 -_NtUserGetClipboardSequenceNumber@0: - movl $0x1188, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserGetClipboardViewer@0 -_NtUserGetClipboardViewer@0: - movl $0x1189, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserGetClipCursor@4 -_NtUserGetClipCursor@4: - movl $0x118a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetComboBoxInfo@8 -_NtUserGetComboBoxInfo@8: - movl $0x118b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetControlBrush@12 -_NtUserGetControlBrush@12: - movl $0x118c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetControlColor@16 -_NtUserGetControlColor@16: - movl $0x118d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserGetCPD@12 -_NtUserGetCPD@12: - movl $0x118e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetCursorFrameInfo@16 -_NtUserGetCursorFrameInfo@16: - movl $0x118f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserGetCursorInfo@4 -_NtUserGetCursorInfo@4: - movl $0x1190, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetDC@4 -_NtUserGetDC@4: - movl $0x1191, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetDCEx@12 -_NtUserGetDCEx@12: - movl $0x1192, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetDoubleClickTime@0 -_NtUserGetDoubleClickTime@0: - movl $0x1193, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserGetForegroundWindow@0 -_NtUserGetForegroundWindow@0: - movl $0x1194, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserGetGuiResources@8 -_NtUserGetGuiResources@8: - movl $0x1195, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetGUIThreadInfo@8 -_NtUserGetGUIThreadInfo@8: - movl $0x1196, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetIconInfo@24 -_NtUserGetIconInfo@24: - movl $0x1197, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtUserGetIconSize@16 -_NtUserGetIconSize@16: - movl $0x1198, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserGetImeHotKey@16 -_NtUserGetImeHotKey@16: - movl $0x1199, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserGetImeInfoEx@8 -_NtUserGetImeInfoEx@8: - movl $0x119a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetInternalWindowPos@12 -_NtUserGetInternalWindowPos@12: - movl $0x119b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetKeyboardLayoutList@8 -_NtUserGetKeyboardLayoutList@8: - movl $0x119c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetKeyboardLayoutName@4 -_NtUserGetKeyboardLayoutName@4: - movl $0x119d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetKeyboardState@4 -_NtUserGetKeyboardState@4: - movl $0x119e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetKeyNameText@12 -_NtUserGetKeyNameText@12: - movl $0x119f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetKeyState@4 -_NtUserGetKeyState@4: - movl $0x11a0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetListBoxInfo@4 -_NtUserGetListBoxInfo@4: - movl $0x11a1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetMenuBarInfo@16 -_NtUserGetMenuBarInfo@16: - movl $0x11a2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserGetMenuIndex@8 -_NtUserGetMenuIndex@8: - movl $0x11a3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetMenuItemRect@16 -_NtUserGetMenuItemRect@16: - movl $0x11a4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserGetMessage@16 -_NtUserGetMessage@16: - movl $0x11a5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserGetMouseMovePointsEx@20 -_NtUserGetMouseMovePointsEx@20: - movl $0x11a6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserGetObjectInformation@20 -_NtUserGetObjectInformation@20: - movl $0x11a7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserGetOpenClipboardWindow@0 -_NtUserGetOpenClipboardWindow@0: - movl $0x11a8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserGetPriorityClipboardFormat@8 -_NtUserGetPriorityClipboardFormat@8: - movl $0x11a9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetProcessWindowStation@0 -_NtUserGetProcessWindowStation@0: - movl $0x11aa, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserGetRawInputBuffer@12 -_NtUserGetRawInputBuffer@12: - movl $0x11ab, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetRawInputData@20 -_NtUserGetRawInputData@20: - movl $0x11ac, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserGetRawInputDeviceInfo@16 -_NtUserGetRawInputDeviceInfo@16: - movl $0x11ad, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserGetRawInputDeviceList@12 -_NtUserGetRawInputDeviceList@12: - movl $0x11ae, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetRegisteredRawInputDevices@12 -_NtUserGetRegisteredRawInputDevices@12: - movl $0x11af, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetScrollBarInfo@12 -_NtUserGetScrollBarInfo@12: - movl $0x11b0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetSystemMenu@8 -_NtUserGetSystemMenu@8: - movl $0x11b1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetThreadDesktop@8 -_NtUserGetThreadDesktop@8: - movl $0x11b2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetThreadState@4 -_NtUserGetThreadState@4: - movl $0x11b3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetTitleBarInfo@8 -_NtUserGetTitleBarInfo@8: - movl $0x11b4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetUpdateRect@12 -_NtUserGetUpdateRect@12: - movl $0x11b5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetUpdateRgn@12 -_NtUserGetUpdateRgn@12: - movl $0x11b6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserGetWindowDC@4 -_NtUserGetWindowDC@4: - movl $0x11b7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserGetWindowPlacement@8 -_NtUserGetWindowPlacement@8: - movl $0x11b8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserGetWOWClass@8 -_NtUserGetWOWClass@8: - movl $0x11b9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserHardErrorControl@12 -_NtUserHardErrorControl@12: - movl $0x11ba, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserHideCaret@4 -_NtUserHideCaret@4: - movl $0x11bb, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserHiliteMenuItem@16 -_NtUserHiliteMenuItem@16: - movl $0x11bc, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserImpersonateDdeClientWindow@8 -_NtUserImpersonateDdeClientWindow@8: - movl $0x11bd, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserInitialize@12 -_NtUserInitialize@12: - movl $0x11be, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserInitializeClientPfnArrays@16 -_NtUserInitializeClientPfnArrays@16: - movl $0x11bf, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserInitTask@48 -_NtUserInitTask@48: - movl $0x11c0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x30 - -.global _NtUserInternalGetWindowText@12 -_NtUserInternalGetWindowText@12: - movl $0x11c1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserInvalidateRect@12 -_NtUserInvalidateRect@12: - movl $0x11c2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserInvalidateRgn@12 -_NtUserInvalidateRgn@12: - movl $0x11c3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserIsClipboardFormatAvailable@4 -_NtUserIsClipboardFormatAvailable@4: - movl $0x11c4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserKillTimer@8 -_NtUserKillTimer@8: - movl $0x11c5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserLoadKeyboardLayoutEx@28 -_NtUserLoadKeyboardLayoutEx@28: - movl $0x11c6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtUserLockWindowStation@4 -_NtUserLockWindowStation@4: - movl $0x11c7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserLockWindowUpdate@4 -_NtUserLockWindowUpdate@4: - movl $0x11c8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserLockWorkStation@0 -_NtUserLockWorkStation@0: - movl $0x11c9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserMapVirtualKeyEx@16 -_NtUserMapVirtualKeyEx@16: - movl $0x11ca, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserMenuItemFromPoint@16 -_NtUserMenuItemFromPoint@16: - movl $0x11cb, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserMessageCall@28 -_NtUserMessageCall@28: - movl $0x11cc, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtUserMinMaximize@12 -_NtUserMinMaximize@12: - movl $0x11cd, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserMNDragLeave@0 -_NtUserMNDragLeave@0: - movl $0x11ce, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserMNDragOver@8 -_NtUserMNDragOver@8: - movl $0x11cf, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserModifyUserStartupInfoFlags@8 -_NtUserModifyUserStartupInfoFlags@8: - movl $0x11d0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserMoveWindow@24 -_NtUserMoveWindow@24: - movl $0x11d1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtUserNotifyIMEStatus@12 -_NtUserNotifyIMEStatus@12: - movl $0x11d2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserNotifyProcessCreate@16 -_NtUserNotifyProcessCreate@16: - movl $0x11d3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserNotifyWinEvent@16 -_NtUserNotifyWinEvent@16: - movl $0x11d4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserOpenClipboard@8 -_NtUserOpenClipboard@8: - movl $0x11d5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserOpenDesktop@12 -_NtUserOpenDesktop@12: - movl $0x11d6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserOpenInputDesktop@12 -_NtUserOpenInputDesktop@12: - movl $0x11d7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserOpenWindowStation@8 -_NtUserOpenWindowStation@8: - movl $0x11d8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserPaintDesktop@4 -_NtUserPaintDesktop@4: - movl $0x11d9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserPeekMessage@20 -_NtUserPeekMessage@20: - movl $0x11da, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserPostMessage@16 -_NtUserPostMessage@16: - movl $0x11db, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserPostThreadMessage@16 -_NtUserPostThreadMessage@16: - movl $0x11dc, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserPrintWindow@12 -_NtUserPrintWindow@12: - movl $0x11dd, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserProcessConnect@12 -_NtUserProcessConnect@12: - movl $0x11de, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserQueryInformationThread@20 -_NtUserQueryInformationThread@20: - movl $0x11df, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserQueryInputContext@8 -_NtUserQueryInputContext@8: - movl $0x11e0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserQuerySendMessage@4 -_NtUserQuerySendMessage@4: - movl $0x11e1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserQueryUserCounters@20 -_NtUserQueryUserCounters@20: - movl $0x11e2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserQueryWindow@8 -_NtUserQueryWindow@8: - movl $0x11e3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserRealChildWindowFromPoint@12 -_NtUserRealChildWindowFromPoint@12: - movl $0x11e4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserRealInternalGetMessage@24 -_NtUserRealInternalGetMessage@24: - movl $0x11e5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtUserRealWaitMessageEx@8 -_NtUserRealWaitMessageEx@8: - movl $0x11e6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserRedrawWindow@16 -_NtUserRedrawWindow@16: - movl $0x11e7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserRegisterClassExWOW@28 -_NtUserRegisterClassExWOW@28: - movl $0x11e8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtUserRegisterUserApiHook@8 -_NtUserRegisterUserApiHook@8: - movl $0x11e9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserRegisterHotKey@16 -_NtUserRegisterHotKey@16: - movl $0x11ea, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserRegisterRawInputDevices@12 -_NtUserRegisterRawInputDevices@12: - movl $0x11eb, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserRegisterTasklist@4 -_NtUserRegisterTasklist@4: - movl $0x11ec, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserRegisterWindowMessage@4 -_NtUserRegisterWindowMessage@4: - movl $0x11ed, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserRemoveMenu@12 -_NtUserRemoveMenu@12: - movl $0x11ee, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserRemoveProp@8 -_NtUserRemoveProp@8: - movl $0x11ef, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserResolveDesktop@16 -_NtUserResolveDesktop@16: - movl $0x11f0, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserResolveDesktopForWOW@4 -_NtUserResolveDesktopForWOW@4: - movl $0x11f1, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSBGetParms@16 -_NtUserSBGetParms@16: - movl $0x11f2, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserScrollDC@28 -_NtUserScrollDC@28: - movl $0x11f3, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtUserScrollWindowEx@32 -_NtUserScrollWindowEx@32: - movl $0x11f4, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtUserSelectPalette@12 -_NtUserSelectPalette@12: - movl $0x11f5, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserSendInput@12 -_NtUserSendInput@12: - movl $0x11f6, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserSetActiveWindow@4 -_NtUserSetActiveWindow@4: - movl $0x11f7, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetAppImeLevel@8 -_NtUserSetAppImeLevel@8: - movl $0x11f8, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetCapture@4 -_NtUserSetCapture@4: - movl $0x11f9, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetClassLong@16 -_NtUserSetClassLong@16: - movl $0x11fa, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetClassWord@12 -_NtUserSetClassWord@12: - movl $0x11fb, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserSetClipboardData@12 -_NtUserSetClipboardData@12: - movl $0x11fc, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserSetClipboardViewer@4 -_NtUserSetClipboardViewer@4: - movl $0x11fd, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetConsoleReserveKeys@8 -_NtUserSetConsoleReserveKeys@8: - movl $0x11fe, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetCursor@4 -_NtUserSetCursor@4: - movl $0x11ff, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetCursorContents@8 -_NtUserSetCursorContents@8: - movl $0x1200, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetCursorIconData@16 -_NtUserSetCursorIconData@16: - movl $0x1201, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetDbgTag@8 -_NtUserSetDbgTag@8: - movl $0x1202, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetFocus@4 -_NtUserSetFocus@4: - movl $0x1203, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetImeHotKey@20 -_NtUserSetImeHotKey@20: - movl $0x1204, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserSetImeInfoEx@4 -_NtUserSetImeInfoEx@4: - movl $0x1205, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetImeOwnerWindow@8 -_NtUserSetImeOwnerWindow@8: - movl $0x1206, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetInformationProcess@16 -_NtUserSetInformationProcess@16: - movl $0x1207, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetInformationThread@16 -_NtUserSetInformationThread@16: - movl $0x1208, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetInternalWindowPos@16 -_NtUserSetInternalWindowPos@16: - movl $0x1209, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetKeyboardState@4 -_NtUserSetKeyboardState@4: - movl $0x120a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetLogonNotifyWindow@4 -_NtUserSetLogonNotifyWindow@4: - movl $0x120b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetMenu@12 -_NtUserSetMenu@12: - movl $0x120c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserSetMenuContextHelpId@8 -_NtUserSetMenuContextHelpId@8: - movl $0x120d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetMenuDefaultItem@12 -_NtUserSetMenuDefaultItem@12: - movl $0x120e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserSetMenuFlagRtoL@4 -_NtUserSetMenuFlagRtoL@4: - movl $0x120f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetObjectInformation@16 -_NtUserSetObjectInformation@16: - movl $0x1210, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetParent@8 -_NtUserSetParent@8: - movl $0x1211, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetProcessWindowStation@4 -_NtUserSetProcessWindowStation@4: - movl $0x1212, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetProp@12 -_NtUserSetProp@12: - movl $0x1213, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserSetRipFlags@8 -_NtUserSetRipFlags@8: - movl $0x1214, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetScrollInfo@16 -_NtUserSetScrollInfo@16: - movl $0x1215, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetShellWindowEx@8 -_NtUserSetShellWindowEx@8: - movl $0x1216, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetSysColors@16 -_NtUserSetSysColors@16: - movl $0x1217, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetSystemCursor@8 -_NtUserSetSystemCursor@8: - movl $0x1218, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetSystemMenu@8 -_NtUserSetSystemMenu@8: - movl $0x1219, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetSystemTimer@16 -_NtUserSetSystemTimer@16: - movl $0x121a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetThreadDesktop@4 -_NtUserSetThreadDesktop@4: - movl $0x121b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSetThreadLayoutHandles@8 -_NtUserSetThreadLayoutHandles@8: - movl $0x121c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetThreadState@8 -_NtUserSetThreadState@8: - movl $0x121d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetTimer@16 -_NtUserSetTimer@16: - movl $0x121e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetWindowFNID@8 -_NtUserSetWindowFNID@8: - movl $0x121f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetWindowLong@16 -_NtUserSetWindowLong@16: - movl $0x1220, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetWindowPlacement@8 -_NtUserSetWindowPlacement@8: - movl $0x1221, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSetWindowPos@28 -_NtUserSetWindowPos@28: - movl $0x1222, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtUserSetWindowRgn@12 -_NtUserSetWindowRgn@12: - movl $0x1223, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserSetWindowsHookAW@12 -_NtUserSetWindowsHookAW@12: - movl $0x1224, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserSetWindowsHookEx@24 -_NtUserSetWindowsHookEx@24: - movl $0x1225, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtUserSetWindowStationUser@16 -_NtUserSetWindowStationUser@16: - movl $0x1226, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetWindowWord@12 -_NtUserSetWindowWord@12: - movl $0x1227, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserSetWinEventHook@32 -_NtUserSetWinEventHook@32: - movl $0x1228, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtUserShowCaret@4 -_NtUserShowCaret@4: - movl $0x1229, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserShowScrollBar@12 -_NtUserShowScrollBar@12: - movl $0x122a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserShowWindow@8 -_NtUserShowWindow@8: - movl $0x122b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserShowWindowAsync@8 -_NtUserShowWindowAsync@8: - movl $0x122c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserSoundSentry@0 -_NtUserSoundSentry@0: - movl $0x122d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserSwitchDesktop@4 -_NtUserSwitchDesktop@4: - movl $0x122e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserSystemParametersInfo@16 -_NtUserSystemParametersInfo@16: - movl $0x122f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserTestForInteractiveUser@4 -_NtUserTestForInteractiveUser@4: - movl $0x1230, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserThunkedMenuInfo@8 -_NtUserThunkedMenuInfo@8: - movl $0x1231, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserThunkedMenuItemInfo@24 -_NtUserThunkedMenuItemInfo@24: - movl $0x1232, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtUserToUnicodeEx@28 -_NtUserToUnicodeEx@28: - movl $0x1233, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtUserTrackMouseEvent@4 -_NtUserTrackMouseEvent@4: - movl $0x1234, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserTrackPopupMenuEx@24 -_NtUserTrackPopupMenuEx@24: - movl $0x1235, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtUserCalcMenuBar@20 -_NtUserCalcMenuBar@20: - movl $0x1236, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtUserPaintMenuBar@24 -_NtUserPaintMenuBar@24: - movl $0x1237, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtUserTranslateAccelerator@12 -_NtUserTranslateAccelerator@12: - movl $0x1238, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserTranslateMessage@8 -_NtUserTranslateMessage@8: - movl $0x1239, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserUnhookWindowsHookEx@4 -_NtUserUnhookWindowsHookEx@4: - movl $0x123a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserUnhookWinEvent@4 -_NtUserUnhookWinEvent@4: - movl $0x123b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserUnloadKeyboardLayout@4 -_NtUserUnloadKeyboardLayout@4: - movl $0x123c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserUnlockWindowStation@4 -_NtUserUnlockWindowStation@4: - movl $0x123d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserUnregisterClass@12 -_NtUserUnregisterClass@12: - movl $0x123e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserUnregisterUserApiHook@0 -_NtUserUnregisterUserApiHook@0: - movl $0x123f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserUnregisterHotKey@8 -_NtUserUnregisterHotKey@8: - movl $0x1240, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserUpdateInputContext@12 -_NtUserUpdateInputContext@12: - movl $0x1241, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserUpdateInstance@12 -_NtUserUpdateInstance@12: - movl $0x1242, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserUpdateLayeredWindow@36 -_NtUserUpdateLayeredWindow@36: - movl $0x1243, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x24 - -.global _NtUserGetLayeredWindowAttributes@16 -_NtUserGetLayeredWindowAttributes@16: - movl $0x1244, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserSetLayeredWindowAttributes@16 -_NtUserSetLayeredWindowAttributes@16: - movl $0x1245, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserUpdatePerUserSystemParameters@8 -_NtUserUpdatePerUserSystemParameters@8: - movl $0x1246, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserUserHandleGrantAccess@12 -_NtUserUserHandleGrantAccess@12: - movl $0x1247, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserValidateHandleSecure@8 -_NtUserValidateHandleSecure@8: - movl $0x1248, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserValidateRect@8 -_NtUserValidateRect@8: - movl $0x1249, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserValidateTimerCallback@12 -_NtUserValidateTimerCallback@12: - movl $0x124a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserVkKeyScanEx@12 -_NtUserVkKeyScanEx@12: - movl $0x124b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserWaitForInputIdle@12 -_NtUserWaitForInputIdle@12: - movl $0x124c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserWaitForMsgAndEvent@4 -_NtUserWaitForMsgAndEvent@4: - movl $0x124d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtUserWaitMessage@0 -_NtUserWaitMessage@0: - movl $0x124e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserWin32PoolAllocationStats@24 -_NtUserWin32PoolAllocationStats@24: - movl $0x124f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtUserWindowFromPoint@8 -_NtUserWindowFromPoint@8: - movl $0x1250, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtUserYieldTask@0 -_NtUserYieldTask@0: - movl $0x1251, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserRemoteConnect@12 -_NtUserRemoteConnect@12: - movl $0x1252, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtUserRemoteRedrawRectangle@16 -_NtUserRemoteRedrawRectangle@16: - movl $0x1253, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtUserRemoteRedrawScreen@0 -_NtUserRemoteRedrawScreen@0: - movl $0x1254, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserRemoteStopScreenUpdates@0 -_NtUserRemoteStopScreenUpdates@0: - movl $0x1255, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtUserCtxDisplayIOCtl@12 -_NtUserCtxDisplayIOCtl@12: - movl $0x1256, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiEngAssociateSurface@12 -_NtGdiEngAssociateSurface@12: - movl $0x1257, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiEngCreateBitmap@24 -_NtGdiEngCreateBitmap@24: - movl $0x1258, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiEngCreateDeviceSurface@16 -_NtGdiEngCreateDeviceSurface@16: - movl $0x1259, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiEngCreateDeviceBitmap@16 -_NtGdiEngCreateDeviceBitmap@16: - movl $0x125a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiEngCreatePalette@24 -_NtGdiEngCreatePalette@24: - movl $0x125b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiEngComputeGlyphSet@12 -_NtGdiEngComputeGlyphSet@12: - movl $0x125c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiEngCopyBits@24 -_NtGdiEngCopyBits@24: - movl $0x125d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiEngDeletePalette@4 -_NtGdiEngDeletePalette@4: - movl $0x125e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEngDeleteSurface@4 -_NtGdiEngDeleteSurface@4: - movl $0x125f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEngEraseSurface@12 -_NtGdiEngEraseSurface@12: - movl $0x1260, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiEngUnlockSurface@4 -_NtGdiEngUnlockSurface@4: - movl $0x1261, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEngLockSurface@4 -_NtGdiEngLockSurface@4: - movl $0x1262, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEngBitBlt@44 -_NtGdiEngBitBlt@44: - movl $0x1263, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x2c - -.global _NtGdiEngStretchBlt@44 -_NtGdiEngStretchBlt@44: - movl $0x1264, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x2c - -.global _NtGdiEngPlgBlt@44 -_NtGdiEngPlgBlt@44: - movl $0x1265, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x2c - -.global _NtGdiEngMarkBandingSurface@4 -_NtGdiEngMarkBandingSurface@4: - movl $0x1266, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEngStrokePath@32 -_NtGdiEngStrokePath@32: - movl $0x1267, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtGdiEngFillPath@28 -_NtGdiEngFillPath@28: - movl $0x1268, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiEngStrokeAndFillPath@40 -_NtGdiEngStrokeAndFillPath@40: - movl $0x1269, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x28 - -.global _NtGdiEngPaint@20 -_NtGdiEngPaint@20: - movl $0x126a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiEngLineTo@36 -_NtGdiEngLineTo@36: - movl $0x126b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x24 - -.global _NtGdiEngAlphaBlend@28 -_NtGdiEngAlphaBlend@28: - movl $0x126c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x1c - -.global _NtGdiEngGradientFill@40 -_NtGdiEngGradientFill@40: - movl $0x126d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x28 - -.global _NtGdiEngTransparentBlt@32 -_NtGdiEngTransparentBlt@32: - movl $0x126e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x20 - -.global _NtGdiEngTextOut@40 -_NtGdiEngTextOut@40: - movl $0x126f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x28 - -.global _NtGdiEngStretchBltROP@52 -_NtGdiEngStretchBltROP@52: - movl $0x1270, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x34 - -.global _NtGdiXLATEOBJ_cGetPalette@16 -_NtGdiXLATEOBJ_cGetPalette@16: - movl $0x1271, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiXLATEOBJ_iXlate@8 -_NtGdiXLATEOBJ_iXlate@8: - movl $0x1272, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiXLATEOBJ_hGetColorTransform@4 -_NtGdiXLATEOBJ_hGetColorTransform@4: - movl $0x1273, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiCLIPOBJ_bEnum@12 -_NtGdiCLIPOBJ_bEnum@12: - movl $0x1274, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiCLIPOBJ_cEnumStart@20 -_NtGdiCLIPOBJ_cEnumStart@20: - movl $0x1275, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiCLIPOBJ_ppoGetPath@4 -_NtGdiCLIPOBJ_ppoGetPath@4: - movl $0x1276, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEngDeletePath@4 -_NtGdiEngDeletePath@4: - movl $0x1277, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEngCreateClip@0 -_NtGdiEngCreateClip@0: - movl $0x1278, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x0 - -.global _NtGdiEngDeleteClip@4 -_NtGdiEngDeleteClip@4: - movl $0x1279, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiBRUSHOBJ_ulGetBrushColor@4 -_NtGdiBRUSHOBJ_ulGetBrushColor@4: - movl $0x127a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiBRUSHOBJ_pvAllocRbrush@8 -_NtGdiBRUSHOBJ_pvAllocRbrush@8: - movl $0x127b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiBRUSHOBJ_pvGetRbrush@4 -_NtGdiBRUSHOBJ_pvGetRbrush@4: - movl $0x127c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiBRUSHOBJ_hGetColorTransform@4 -_NtGdiBRUSHOBJ_hGetColorTransform@4: - movl $0x127d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiXFORMOBJ_bApplyXform@20 -_NtGdiXFORMOBJ_bApplyXform@20: - movl $0x127e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiXFORMOBJ_iGetXform@8 -_NtGdiXFORMOBJ_iGetXform@8: - movl $0x127f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiFONTOBJ_vGetInfo@12 -_NtGdiFONTOBJ_vGetInfo@12: - movl $0x1280, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiFONTOBJ_pxoGetXform@4 -_NtGdiFONTOBJ_pxoGetXform@4: - movl $0x1281, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiFONTOBJ_cGetGlyphs@20 -_NtGdiFONTOBJ_cGetGlyphs@20: - movl $0x1282, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x14 - -.global _NtGdiFONTOBJ_pifi@4 -_NtGdiFONTOBJ_pifi@4: - movl $0x1283, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiFONTOBJ_pfdg@4 -_NtGdiFONTOBJ_pfdg@4: - movl $0x1284, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiFONTOBJ_pQueryGlyphAttrs@8 -_NtGdiFONTOBJ_pQueryGlyphAttrs@8: - movl $0x1285, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiFONTOBJ_pvTrueTypeFontFile@8 -_NtGdiFONTOBJ_pvTrueTypeFontFile@8: - movl $0x1286, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiFONTOBJ_cGetAllGlyphHandles@8 -_NtGdiFONTOBJ_cGetAllGlyphHandles@8: - movl $0x1287, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiSTROBJ_bEnum@12 -_NtGdiSTROBJ_bEnum@12: - movl $0x1288, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSTROBJ_bEnumPositionsOnly@12 -_NtGdiSTROBJ_bEnumPositionsOnly@12: - movl $0x1289, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiSTROBJ_bGetAdvanceWidths@16 -_NtGdiSTROBJ_bGetAdvanceWidths@16: - movl $0x128a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiSTROBJ_vEnumStart@4 -_NtGdiSTROBJ_vEnumStart@4: - movl $0x128b, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiSTROBJ_dwGetCodePage@4 -_NtGdiSTROBJ_dwGetCodePage@4: - movl $0x128c, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiPATHOBJ_vGetBounds@8 -_NtGdiPATHOBJ_vGetBounds@8: - movl $0x128d, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiPATHOBJ_bEnum@8 -_NtGdiPATHOBJ_bEnum@8: - movl $0x128e, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiPATHOBJ_vEnumStart@4 -_NtGdiPATHOBJ_vEnumStart@4: - movl $0x128f, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiPATHOBJ_vEnumStartClipLines@16 -_NtGdiPATHOBJ_vEnumStartClipLines@16: - movl $0x1290, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiPATHOBJ_bEnumClipLines@12 -_NtGdiPATHOBJ_bEnumClipLines@12: - movl $0x1291, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - -.global _NtGdiGetDhpdev@4 -_NtGdiGetDhpdev@4: - movl $0x1292, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiEngCheckAbort@4 -_NtGdiEngCheckAbort@4: - movl $0x1293, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiHT_Get8BPPFormatPalette@16 -_NtGdiHT_Get8BPPFormatPalette@16: - movl $0x1294, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiHT_Get8BPPMaskPalette@24 -_NtGdiHT_Get8BPPMaskPalette@24: - movl $0x1295, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x18 - -.global _NtGdiUpdateTransform@4 -_NtGdiUpdateTransform@4: - movl $0x1296, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiSetPUMPDOBJ@16 -_NtGdiSetPUMPDOBJ@16: - movl $0x1297, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x10 - -.global _NtGdiBRUSHOBJ_DeleteRbrush@8 -_NtGdiBRUSHOBJ_DeleteRbrush@8: - movl $0x1298, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x8 - -.global _NtGdiUMPDEngFreeUserMem@4 -_NtGdiUMPDEngFreeUserMem@4: - movl $0x1299, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0x4 - -.global _NtGdiDrawStream@12 -_NtGdiDrawStream@12: - movl $0x129a, %eax - movl $KUSER_SHARED_SYSCALL, %ecx - call *(%ecx) - ret $0xc - diff --git a/rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.def b/rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.def deleted file mode 100644 index 420aa6f4903..00000000000 --- a/rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.def +++ /dev/null @@ -1,677 +0,0 @@ -; -; ReactOS Operating System -; -; This file contains all win32k native api functions from win xp -; -LIBRARY w32kdll.dll - -EXPORTS -NtGdiAbortDoc@4 -NtGdiAbortPath@4 -NtGdiAddFontResourceW@24 -NtGdiAddRemoteFontToDC@16 -NtGdiAddFontMemResourceEx@20 -NtGdiRemoveMergeFont@8 -NtGdiAddRemoteMMInstanceToDC@12 -NtGdiAlphaBlend@48 -NtGdiAngleArc@24 -NtGdiAnyLinkedFonts@0 -NtGdiFontIsLinked@4 -NtGdiArcInternal@40 -NtGdiBeginPath@4 -NtGdiBitBlt@44 -NtGdiCancelDC@4 -NtGdiCheckBitmapBits@32 -NtGdiCloseFigure@4 -NtGdiClearBitmapAttributes@8 -NtGdiClearBrushAttributes@8 -NtGdiColorCorrectPalette@24 -NtGdiCombineRgn@16 -NtGdiCombineTransform@12 -NtGdiComputeXformCoefficients@4 -NtGdiConsoleTextOut@16 -NtGdiConvertMetafileRect@8 -NtGdiCreateBitmap@20 -NtGdiCreateClientObj@4 -NtGdiCreateColorSpace@4 -NtGdiCreateColorTransform@32 -NtGdiCreateCompatibleBitmap@12 -NtGdiCreateCompatibleDC@4 -NtGdiCreateDIBBrush@24 -NtGdiCreateDIBitmapInternal@44 -NtGdiCreateDIBSection@36 -NtGdiCreateEllipticRgn@16 -NtGdiCreateHalftonePalette@4 -NtGdiCreateHatchBrushInternal@12 -NtGdiCreateMetafileDC@4 -NtGdiCreatePaletteInternal@8 -NtGdiCreatePatternBrushInternal@12 -NtGdiCreatePen@16 -NtGdiCreateRectRgn@16 -NtGdiCreateRoundRectRgn@24 -NtGdiCreateServerMetaFile@24 -NtGdiCreateSolidBrush@8 -NtGdiD3dContextCreate@16 -NtGdiD3dContextDestroy@4 -NtGdiD3dContextDestroyAll@4 -NtGdiD3dValidateTextureStageState@4 -NtGdiD3dDrawPrimitives2@28 -NtGdiDdGetDriverState@4 -NtGdiDdAddAttachedSurface@12 -NtGdiDdAlphaBlt@12 -NtGdiDdAttachSurface@8 -NtGdiDdBeginMoCompFrame@8 -NtGdiDdBlt@12 -NtGdiDdCanCreateSurface@8 -NtGdiDdCanCreateD3DBuffer@8 -NtGdiDdColorControl@8 -NtGdiDdCreateDirectDrawObject@4 -NtGdiDdCreateSurface@32 -NtGdiDdCreateD3DBuffer@32 -NtGdiDdCreateMoComp@8 -NtGdiDdCreateSurfaceObject@24 -NtGdiDdDeleteDirectDrawObject@4 -NtGdiDdDeleteSurfaceObject@4 -NtGdiDdDestroyMoComp@8 -NtGdiDdDestroySurface@8 -NtGdiDdDestroyD3DBuffer@4 -NtGdiDdEndMoCompFrame@8 -NtGdiDdFlip@20 -NtGdiDdFlipToGDISurface@8 -NtGdiDdGetAvailDriverMemory@8 -NtGdiDdGetBltStatus@8 -NtGdiDdGetDC@8 -NtGdiDdGetDriverInfo@8 -NtGdiDdGetDxHandle@12 -NtGdiDdGetFlipStatus@8 -NtGdiDdGetInternalMoCompInfo@8 -NtGdiDdGetMoCompBuffInfo@8 -NtGdiDdGetMoCompGuids@8 -NtGdiDdGetMoCompFormats@8 -NtGdiDdGetScanLine@8 -NtGdiDdLock@12 -NtGdiDdLockD3D@8 -NtGdiDdQueryDirectDrawObject@44 -NtGdiDdQueryMoCompStatus@8 -NtGdiDdReenableDirectDrawObject@8 -NtGdiDdReleaseDC@4 -NtGdiDdRenderMoComp@8 -NtGdiDdResetVisrgn@8 -NtGdiDdSetColorKey@8 -NtGdiDdSetExclusiveMode@8 -NtGdiDdSetGammaRamp@12 -NtGdiDdCreateSurfaceEx@12 -NtGdiDdSetOverlayPosition@12 -NtGdiDdUnattachSurface@8 -NtGdiDdUnlock@8 -NtGdiDdUnlockD3D@8 -NtGdiDdUpdateOverlay@12 -NtGdiDdWaitForVerticalBlank@8 -NtGdiDvpCanCreateVideoPort@8 -NtGdiDvpColorControl@8 -NtGdiDvpCreateVideoPort@8 -NtGdiDvpDestroyVideoPort@8 -NtGdiDvpFlipVideoPort@16 -NtGdiDvpGetVideoPortBandwidth@8 -NtGdiDvpGetVideoPortField@8 -NtGdiDvpGetVideoPortFlipStatus@8 -NtGdiDvpGetVideoPortInputFormats@8 -NtGdiDvpGetVideoPortLine@8 -NtGdiDvpGetVideoPortOutputFormats@8 -NtGdiDvpGetVideoPortConnectInfo@8 -NtGdiDvpGetVideoSignalStatus@8 -NtGdiDvpUpdateVideoPort@16 -NtGdiDvpWaitForVideoPortSync@8 -NtGdiDvpAcquireNotification@12 -NtGdiDvpReleaseNotification@8 -NtGdiDxgGenericThunk@24 -NtGdiDeleteClientObj@4 -NtGdiDeleteColorSpace@4 -NtGdiDeleteColorTransform@8 -NtGdiDeleteObjectApp@4 -NtGdiDescribePixelFormat@16 -NtGdiGetPerBandInfo@8 -NtGdiDoBanding@16 -NtGdiDoPalette@24 -NtGdiDrawEscape@16 -NtGdiEllipse@20 -NtGdiEnableEUDC@4 -NtGdiEndDoc@4 -NtGdiEndPage@4 -NtGdiEndPath@4 -NtGdiEnumFontChunk@20 -NtGdiEnumFontClose@4 -NtGdiEnumFontOpen@28 -NtGdiEnumObjects@16 -NtGdiEqualRgn@8 -NtGdiEudcLoadUnloadLink@28 -NtGdiExcludeClipRect@20 -NtGdiExtCreatePen@44 -NtGdiExtCreateRegion@12 -NtGdiExtEscape@32 -NtGdiExtFloodFill@20 -NtGdiExtGetObjectW@12 -NtGdiExtSelectClipRgn@12 -NtGdiExtTextOutW@36 -NtGdiFillPath@4 -NtGdiFillRgn@12 -NtGdiFlattenPath@4 -NtGdiFlushUserBatch@0 -NtGdiFlush@0 -NtGdiForceUFIMapping@8 -NtGdiFrameRgn@20 -NtGdiFullscreenControl@20 -NtGdiGetAndSetDCDword@16 -NtGdiGetAppClipBox@8 -NtGdiGetBitmapBits@12 -NtGdiGetBitmapDimension@8 -NtGdiGetBoundsRect@12 -NtGdiGetCharABCWidthsW@24 -NtGdiGetCharacterPlacementW@24 -NtGdiGetCharSet@4 -NtGdiGetCharWidthW@24 -NtGdiGetCharWidthInfo@8 -NtGdiGetColorAdjustment@8 -NtGdiGetColorSpaceforBitmap@4 -NtGdiGetDCDword@12 -NtGdiGetDCforBitmap@4 -NtGdiGetDCObject@8 -NtGdiGetDCPoint@12 -NtGdiGetDeviceCaps@8 -NtGdiGetDeviceGammaRamp@8 -NtGdiGetDeviceCapsAll@8 -NtGdiGetDIBitsInternal@36 -NtGdiGetETM@8 -NtGdiGetEudcTimeStampEx@12 -NtGdiGetFontData@20 -NtGdiGetFontResourceInfoInternalW@28 -NtGdiGetGlyphIndicesW@20 -NtGdiGetGlyphIndicesWInternal@24 -NtGdiGetGlyphOutline@32 -NtGdiGetKerningPairs@12 -NtGdiGetLinkedUFIs@12 -NtGdiGetMiterLimit@8 -NtGdiGetMonitorID@12 -NtGdiGetNearestColor@8 -NtGdiGetNearestPaletteIndex@8 -NtGdiGetObjectBitmapHandle@8 -NtGdiGetOutlineTextMetricsInternalW@16 -NtGdiGetPath@16 -NtGdiGetPixel@12 -NtGdiGetRandomRgn@12 -NtGdiGetRasterizerCaps@8 -NtGdiGetRealizationInfo@12 -NtGdiGetRegionData@12 -NtGdiGetRgnBox@8 -NtGdiGetServerMetaFileBits@28 -NtGdiGetSpoolMessage@16 -NtGdiGetStats@20 -NtGdiGetStockObject@4 -NtGdiGetStringBitmapW@20 -NtGdiGetSystemPaletteUse@4 -NtGdiGetTextCharsetInfo@12 -NtGdiGetTextExtent@20 -NtGdiGetTextExtentExW@32 -NtGdiGetTextFaceW@16 -NtGdiGetTextMetricsW@12 -NtGdiGetTransform@12 -NtGdiGetUFI@24 -NtGdiGetEmbUFI@28 -NtGdiGetUFIPathname@40 -NtGdiGetEmbedFonts@0 -NtGdiChangeGhostFont@8 -NtGdiAddEmbFontToDC@8 -NtGdiGetFontUnicodeRanges@8 -NtGdiGetWidthTable@28 -NtGdiGradientFill@24 -NtGdiHfontCreate@20 -NtGdiIcmBrushInfo@32 -NtGdiInit@0 -NtGdiInitSpool@0 -NtGdiIntersectClipRect@20 -NtGdiInvertRgn@8 -NtGdiLineTo@12 -NtGdiMakeFontDir@20 -NtGdiMakeInfoDC@8 -NtGdiMaskBlt@52 -NtGdiModifyWorldTransform@12 -NtGdiMonoBitmap@4 -NtGdiMoveTo@16 -NtGdiOffsetClipRgn@12 -NtGdiOffsetRgn@12 -NtGdiOpenDCW@28 -NtGdiPatBlt@24 -NtGdiPolyPatBlt@20 -NtGdiPathToRegion@4 -NtGdiPlgBlt@44 -NtGdiPolyDraw@16 -NtGdiPolyPolyDraw@20 -NtGdiPolyTextOutW@16 -NtGdiPtInRegion@12 -NtGdiPtVisible@12 -NtGdiQueryFonts@12 -NtGdiQueryFontAssocInfo@4 -NtGdiRectangle@20 -NtGdiRectInRegion@8 -NtGdiRectVisible@8 -NtGdiRemoveFontResourceW@24 -NtGdiRemoveFontMemResourceEx@4 -NtGdiResetDC@20 -NtGdiResizePalette@8 -NtGdiRestoreDC@8 -NtGdiRoundRect@28 -NtGdiSaveDC@4 -NtGdiScaleViewportExtEx@24 -NtGdiScaleWindowExtEx@24 -NtGdiSelectBitmap@8 -NtGdiSelectBrush@8 -NtGdiSelectClipPath@8 -NtGdiSelectFont@8 -NtGdiSelectPen@8 -NtGdiSetBitmapAttributes@8 -NtGdiSetBitmapBits@12 -NtGdiSetBitmapDimension@16 -NtGdiSetBoundsRect@12 -NtGdiSetBrushAttributes@8 -NtGdiSetBrushOrg@16 -NtGdiSetColorAdjustment@8 -NtGdiSetColorSpace@8 -NtGdiSetDeviceGammaRamp@8 -NtGdiSetDIBitsToDeviceInternal@64 -NtGdiSetFontEnumeration@4 -NtGdiSetFontXform@12 -NtGdiSetIcmMode@12 -NtGdiSetLinkedUFIs@12 -NtGdiSetMagicColors@12 -NtGdiSetMetaRgn@4 -NtGdiSetMiterLimit@12 -NtGdiGetDeviceWidth@4 -NtGdiMirrorWindowOrg@4 -NtGdiSetLayout@12 -NtGdiSetPixel@16 -NtGdiSetPixelFormat@8 -NtGdiSetRectRgn@20 -NtGdiSetSystemPaletteUse@8 -NtGdiSetTextJustification@12 -NtGdiSetupPublicCFONT@12 -NtGdiSetVirtualResolution@20 -NtGdiSetSizeDevice@12 -NtGdiStartDoc@16 -NtGdiStartPage@4 -NtGdiStretchBlt@48 -NtGdiStretchDIBitsInternal@64 -NtGdiStrokeAndFillPath@4 -NtGdiStrokePath@4 -NtGdiSwapBuffers@4 -NtGdiTransformPoints@20 -NtGdiTransparentBlt@44 -NtGdiUnloadPrinterDriver@8 -NtGdiUnmapMemFont@4 -NtGdiUnrealizeObject@4 -NtGdiUpdateColors@4 -NtGdiWidenPath@4 -NtUserActivateKeyboardLayout@8 -NtUserAlterWindowStyle@12 -NtUserAssociateInputContext@12 -NtUserAttachThreadInput@12 -NtUserBeginPaint@8 -NtUserBitBltSysBmp@32 -NtUserBlockInput@4 -NtUserBuildHimcList@16 -NtUserBuildHwndList@28 -NtUserBuildNameList@16 -NtUserBuildPropList@16 -NtUserCallHwnd@8 -NtUserCallHwndLock@8 -NtUserCallHwndOpt@8 -NtUserCallHwndParam@12 -NtUserCallHwndParamLock@12 -NtUserCallMsgFilter@8 -NtUserCallNextHookEx@16 -NtUserCallNoParam@4 -NtUserCallOneParam@8 -NtUserCallTwoParam@12 -NtUserChangeClipboardChain@8 -NtUserChangeDisplaySettings@20 -NtUserCheckImeHotKey@8 -NtUserCheckMenuItem@12 -NtUserChildWindowFromPointEx@16 -NtUserClipCursor@4 -NtUserCloseClipboard@0 -NtUserCloseDesktop@4 -NtUserCloseWindowStation@4 -NtUserConsoleControl@12 -NtUserConvertMemHandle@8 -NtUserCopyAcceleratorTable@12 -NtUserCountClipboardFormats@0 -NtUserCreateAcceleratorTable@8 -NtUserCreateCaret@16 -NtUserCreateDesktop@20 -NtUserCreateInputContext@4 -NtUserCreateLocalMemHandle@16 -NtUserCreateWindowEx@60 -NtUserCreateWindowStation@28 -NtUserDdeGetQualityOfService@12 -NtUserDdeInitialize@20 -NtUserDdeSetQualityOfService@12 -NtUserDeferWindowPos@32 -NtUserDefSetText@8 -NtUserDeleteMenu@12 -NtUserDestroyAcceleratorTable@4 -NtUserDestroyCursor@8 -NtUserDestroyInputContext@4 -NtUserDestroyMenu@4 -NtUserDestroyWindow@4 -NtUserDisableThreadIme@4 -NtUserDispatchMessage@4 -NtUserDragDetect@12 -NtUserDragObject@20 -NtUserDrawAnimatedRects@16 -NtUserDrawCaption@16 -NtUserDrawCaptionTemp@28 -NtUserDrawIconEx@44 -NtUserDrawMenuBarTemp@20 -NtUserEmptyClipboard@0 -NtUserEnableMenuItem@12 -NtUserEnableScrollBar@12 -NtUserEndDeferWindowPosEx@8 -NtUserEndMenu@0 -NtUserEndPaint@8 -NtUserEnumDisplayDevices@16 -NtUserEnumDisplayMonitors@16 -NtUserEnumDisplaySettings@16 -NtUserEvent@4 -NtUserExcludeUpdateRgn@8 -NtUserFillWindow@16 -NtUserFindExistingCursorIcon@12 -NtUserFindWindowEx@20 -NtUserFlashWindowEx@4 -NtUserGetAltTabInfo@24 -NtUserGetAncestor@8 -NtUserGetAppImeLevel@4 -NtUserGetAsyncKeyState@4 -NtUserGetAtomName@8 -NtUserGetCaretBlinkTime@0 -NtUserGetCaretPos@4 -NtUserGetClassInfo@20 -NtUserGetClassName@12 -NtUserGetClipboardData@8 -NtUserGetClipboardFormatName@12 -NtUserGetClipboardOwner@0 -NtUserGetClipboardSequenceNumber@0 -NtUserGetClipboardViewer@0 -NtUserGetClipCursor@4 -NtUserGetComboBoxInfo@8 -NtUserGetControlBrush@12 -NtUserGetControlColor@16 -NtUserGetCPD@12 -NtUserGetCursorFrameInfo@16 -NtUserGetCursorInfo@4 -NtUserGetDC@4 -NtUserGetDCEx@12 -NtUserGetDoubleClickTime@0 -NtUserGetForegroundWindow@0 -NtUserGetGuiResources@8 -NtUserGetGUIThreadInfo@8 -NtUserGetIconInfo@24 -NtUserGetIconSize@16 -NtUserGetImeHotKey@16 -NtUserGetImeInfoEx@8 -NtUserGetInternalWindowPos@12 -NtUserGetKeyboardLayoutList@8 -NtUserGetKeyboardLayoutName@4 -NtUserGetKeyboardState@4 -NtUserGetKeyNameText@12 -NtUserGetKeyState@4 -NtUserGetListBoxInfo@4 -NtUserGetMenuBarInfo@16 -NtUserGetMenuIndex@8 -NtUserGetMenuItemRect@16 -NtUserGetMessage@16 -NtUserGetMouseMovePointsEx@20 -NtUserGetObjectInformation@20 -NtUserGetOpenClipboardWindow@0 -NtUserGetPriorityClipboardFormat@8 -NtUserGetProcessWindowStation@0 -NtUserGetRawInputBuffer@12 -NtUserGetRawInputData@20 -NtUserGetRawInputDeviceInfo@16 -NtUserGetRawInputDeviceList@12 -NtUserGetRegisteredRawInputDevices@12 -NtUserGetScrollBarInfo@12 -NtUserGetSystemMenu@8 -NtUserGetThreadDesktop@8 -NtUserGetThreadState@4 -NtUserGetTitleBarInfo@8 -NtUserGetUpdateRect@12 -NtUserGetUpdateRgn@12 -NtUserGetWindowDC@4 -NtUserGetWindowPlacement@8 -NtUserGetWOWClass@8 -NtUserHardErrorControl@12 -NtUserHideCaret@4 -NtUserHiliteMenuItem@16 -NtUserImpersonateDdeClientWindow@8 -NtUserInitialize@12 -NtUserInitializeClientPfnArrays@16 -NtUserInitTask@48 -NtUserInternalGetWindowText@12 -NtUserInvalidateRect@12 -NtUserInvalidateRgn@12 -NtUserIsClipboardFormatAvailable@4 -NtUserKillTimer@8 -NtUserLoadKeyboardLayoutEx@28 -NtUserLockWindowStation@4 -NtUserLockWindowUpdate@4 -NtUserLockWorkStation@0 -NtUserMapVirtualKeyEx@16 -NtUserMenuItemFromPoint@16 -NtUserMessageCall@28 -NtUserMinMaximize@12 -NtUserMNDragLeave@0 -NtUserMNDragOver@8 -NtUserModifyUserStartupInfoFlags@8 -NtUserMoveWindow@24 -NtUserNotifyIMEStatus@12 -NtUserNotifyProcessCreate@16 -NtUserNotifyWinEvent@16 -NtUserOpenClipboard@8 -NtUserOpenDesktop@12 -NtUserOpenInputDesktop@12 -NtUserOpenWindowStation@8 -NtUserPaintDesktop@4 -NtUserPeekMessage@20 -NtUserPostMessage@16 -NtUserPostThreadMessage@16 -NtUserPrintWindow@12 -NtUserProcessConnect@12 -NtUserQueryInformationThread@20 -NtUserQueryInputContext@8 -NtUserQuerySendMessage@4 -NtUserQueryUserCounters@20 -NtUserQueryWindow@8 -NtUserRealChildWindowFromPoint@12 -NtUserRealInternalGetMessage@24 -NtUserRealWaitMessageEx@8 -NtUserRedrawWindow@16 -NtUserRegisterClassExWOW@28 -NtUserRegisterUserApiHook@8 -NtUserRegisterHotKey@16 -NtUserRegisterRawInputDevices@12 -NtUserRegisterTasklist@4 -NtUserRegisterWindowMessage@4 -NtUserRemoveMenu@12 -NtUserRemoveProp@8 -NtUserResolveDesktop@16 -NtUserResolveDesktopForWOW@4 -NtUserSBGetParms@16 -NtUserScrollDC@28 -NtUserScrollWindowEx@32 -NtUserSelectPalette@12 -NtUserSendInput@12 -NtUserSetActiveWindow@4 -NtUserSetAppImeLevel@8 -NtUserSetCapture@4 -NtUserSetClassLong@16 -NtUserSetClassWord@12 -NtUserSetClipboardData@12 -NtUserSetClipboardViewer@4 -NtUserSetConsoleReserveKeys@8 -NtUserSetCursor@4 -NtUserSetCursorContents@8 -NtUserSetCursorIconData@16 -NtUserSetDbgTag@8 -NtUserSetFocus@4 -NtUserSetImeHotKey@20 -NtUserSetImeInfoEx@4 -NtUserSetImeOwnerWindow@8 -NtUserSetInformationProcess@16 -NtUserSetInformationThread@16 -NtUserSetInternalWindowPos@16 -NtUserSetKeyboardState@4 -NtUserSetLogonNotifyWindow@4 -NtUserSetMenu@12 -NtUserSetMenuContextHelpId@8 -NtUserSetMenuDefaultItem@12 -NtUserSetMenuFlagRtoL@4 -NtUserSetObjectInformation@16 -NtUserSetParent@8 -NtUserSetProcessWindowStation@4 -NtUserSetProp@12 -NtUserSetRipFlags@8 -NtUserSetScrollInfo@16 -NtUserSetShellWindowEx@8 -NtUserSetSysColors@16 -NtUserSetSystemCursor@8 -NtUserSetSystemMenu@8 -NtUserSetSystemTimer@16 -NtUserSetThreadDesktop@4 -NtUserSetThreadLayoutHandles@8 -NtUserSetThreadState@8 -NtUserSetTimer@16 -NtUserSetWindowFNID@8 -NtUserSetWindowLong@16 -NtUserSetWindowPlacement@8 -NtUserSetWindowPos@28 -NtUserSetWindowRgn@12 -NtUserSetWindowsHookAW@12 -NtUserSetWindowsHookEx@24 -NtUserSetWindowStationUser@16 -NtUserSetWindowWord@12 -NtUserSetWinEventHook@32 -NtUserShowCaret@4 -NtUserShowScrollBar@12 -NtUserShowWindow@8 -NtUserShowWindowAsync@8 -NtUserSoundSentry@0 -NtUserSwitchDesktop@4 -NtUserSystemParametersInfo@16 -NtUserTestForInteractiveUser@4 -NtUserThunkedMenuInfo@8 -NtUserThunkedMenuItemInfo@24 -NtUserToUnicodeEx@28 -NtUserTrackMouseEvent@4 -NtUserTrackPopupMenuEx@24 -NtUserCalcMenuBar@20 -NtUserPaintMenuBar@24 -NtUserTranslateAccelerator@12 -NtUserTranslateMessage@8 -NtUserUnhookWindowsHookEx@4 -NtUserUnhookWinEvent@4 -NtUserUnloadKeyboardLayout@4 -NtUserUnlockWindowStation@4 -NtUserUnregisterClass@12 -NtUserUnregisterUserApiHook@0 -NtUserUnregisterHotKey@8 -NtUserUpdateInputContext@12 -NtUserUpdateInstance@12 -NtUserUpdateLayeredWindow@36 -NtUserGetLayeredWindowAttributes@16 -NtUserSetLayeredWindowAttributes@16 -NtUserUpdatePerUserSystemParameters@8 -NtUserUserHandleGrantAccess@12 -NtUserValidateHandleSecure@8 -NtUserValidateRect@8 -NtUserValidateTimerCallback@12 -NtUserVkKeyScanEx@12 -NtUserWaitForInputIdle@12 -NtUserWaitForMsgAndEvent@4 -NtUserWaitMessage@0 -NtUserWin32PoolAllocationStats@24 -NtUserWindowFromPoint@8 -NtUserYieldTask@0 -NtUserRemoteConnect@12 -NtUserRemoteRedrawRectangle@16 -NtUserRemoteRedrawScreen@0 -NtUserRemoteStopScreenUpdates@0 -NtUserCtxDisplayIOCtl@12 -NtGdiEngAssociateSurface@12 -NtGdiEngCreateBitmap@24 -NtGdiEngCreateDeviceSurface@16 -NtGdiEngCreateDeviceBitmap@16 -NtGdiEngCreatePalette@24 -NtGdiEngComputeGlyphSet@12 -NtGdiEngCopyBits@24 -NtGdiEngDeletePalette@4 -NtGdiEngDeleteSurface@4 -NtGdiEngEraseSurface@12 -NtGdiEngUnlockSurface@4 -NtGdiEngLockSurface@4 -NtGdiEngBitBlt@44 -NtGdiEngStretchBlt@44 -NtGdiEngPlgBlt@44 -NtGdiEngMarkBandingSurface@4 -NtGdiEngStrokePath@32 -NtGdiEngFillPath@28 -NtGdiEngStrokeAndFillPath@40 -NtGdiEngPaint@20 -NtGdiEngLineTo@36 -NtGdiEngAlphaBlend@28 -NtGdiEngGradientFill@40 -NtGdiEngTransparentBlt@32 -NtGdiEngTextOut@40 -NtGdiEngStretchBltROP@52 -NtGdiXLATEOBJ_cGetPalette@16 -NtGdiXLATEOBJ_iXlate@8 -NtGdiXLATEOBJ_hGetColorTransform@4 -NtGdiCLIPOBJ_bEnum@12 -NtGdiCLIPOBJ_cEnumStart@20 -NtGdiCLIPOBJ_ppoGetPath@4 -NtGdiEngDeletePath@4 -NtGdiEngCreateClip@0 -NtGdiEngDeleteClip@4 -NtGdiBRUSHOBJ_ulGetBrushColor@4 -NtGdiBRUSHOBJ_pvAllocRbrush@8 -NtGdiBRUSHOBJ_pvGetRbrush@4 -NtGdiBRUSHOBJ_hGetColorTransform@4 -NtGdiXFORMOBJ_bApplyXform@20 -NtGdiXFORMOBJ_iGetXform@8 -NtGdiFONTOBJ_vGetInfo@12 -NtGdiFONTOBJ_pxoGetXform@4 -NtGdiFONTOBJ_cGetGlyphs@20 -NtGdiFONTOBJ_pifi@4 -NtGdiFONTOBJ_pfdg@4 -NtGdiFONTOBJ_pQueryGlyphAttrs@8 -NtGdiFONTOBJ_pvTrueTypeFontFile@8 -NtGdiFONTOBJ_cGetAllGlyphHandles@8 -NtGdiSTROBJ_bEnum@12 -NtGdiSTROBJ_bEnumPositionsOnly@12 -NtGdiSTROBJ_bGetAdvanceWidths@16 -NtGdiSTROBJ_vEnumStart@4 -NtGdiSTROBJ_dwGetCodePage@4 -NtGdiPATHOBJ_vGetBounds@8 -NtGdiPATHOBJ_bEnum@8 -NtGdiPATHOBJ_vEnumStart@4 -NtGdiPATHOBJ_vEnumStartClipLines@16 -NtGdiPATHOBJ_bEnumClipLines@12 -NtGdiGetDhpdev@4 -NtGdiEngCheckAbort@4 -NtGdiHT_Get8BPPFormatPalette@16 -NtGdiHT_Get8BPPMaskPalette@24 -NtGdiUpdateTransform@4 -NtGdiSetPUMPDOBJ@16 -NtGdiBRUSHOBJ_DeleteRbrush@8 -NtGdiUMPDEngFreeUserMem@4 -NtGdiUnmapMemFont@4 -NtGdiDrawStream@12 - diff --git a/rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.spec b/rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.spec index b33c7d93df0..bd059a8c0e4 100644 --- a/rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.spec +++ b/rostests/apitests/w32kdll/w32kdll_xpsp2/w32kdll_xpsp2.spec @@ -133,7 +133,7 @@ @ stdcall NtGdiDoPalette(ptr long long ptr long long) @ stdcall NtGdiDrawEscape(ptr long long ptr) @ stdcall NtGdiEllipse(ptr long long long long) -@ stdcall NtGdiEnableEUDC(long) +@ stdcall NtGdiEnableEudc(long) @ stdcall NtGdiEndDoc(ptr) @ stdcall NtGdiEndPage(ptr) @ stdcall NtGdiEndPath(ptr) @@ -670,5 +670,4 @@ @ stdcall NtGdiSetPUMPDOBJ(ptr long ptr ptr) @ stdcall NtGdiBRUSHOBJ_DeleteRbrush(ptr ptr) @ stdcall NtGdiUMPDEngFreeUserMem(ptr) -@ stdcall NtGdiUnmapMemFont(ptr) @ stdcall NtGdiDrawStream(ptr long ptr) diff --git a/rostests/apitests/w32kdll/w32kdll_xpsp2/win32ksvc-xp.h b/rostests/apitests/w32kdll/w32kdll_xpsp2/win32ksvc-xp.h new file mode 100644 index 00000000000..4678f1c6eb7 --- /dev/null +++ b/rostests/apitests/w32kdll/w32kdll_xpsp2/win32ksvc-xp.h @@ -0,0 +1,671 @@ +// SVC_(, ) +// +// Syscall list for Windows XP SP0 - SP3 +// +SVC_(GdiAbortDoc, 1) +SVC_(GdiAbortPath, 1) +SVC_(GdiAddFontResourceW, 6) +SVC_(GdiAddRemoteFontToDC, 4) +SVC_(GdiAddFontMemResourceEx, 5) +SVC_(GdiRemoveMergeFont, 2) +SVC_(GdiAddRemoteMMInstanceToDC, 3) +SVC_(GdiAlphaBlend, 12) +SVC_(GdiAngleArc, 6) +SVC_(GdiAnyLinkedFonts, 0) +SVC_(GdiFontIsLinked, 1) +SVC_(GdiArcInternal, 10) +SVC_(GdiBeginPath, 1) +SVC_(GdiBitBlt, 11) +SVC_(GdiCancelDC, 1) +SVC_(GdiCheckBitmapBits, 8) +SVC_(GdiCloseFigure, 1) +SVC_(GdiClearBitmapAttributes, 2) +SVC_(GdiClearBrushAttributes, 2) +SVC_(GdiColorCorrectPalette, 6) +SVC_(GdiCombineRgn, 4) +SVC_(GdiCombineTransform, 3) +SVC_(GdiComputeXformCoefficients, 1) +SVC_(GdiConsoleTextOut, 4) +SVC_(GdiConvertMetafileRect, 2) +SVC_(GdiCreateBitmap, 5) +SVC_(GdiCreateClientObj, 1) +SVC_(GdiCreateColorSpace, 1) +SVC_(GdiCreateColorTransform, 8) +SVC_(GdiCreateCompatibleBitmap, 3) +SVC_(GdiCreateCompatibleDC, 1) +SVC_(GdiCreateDIBBrush, 6) +SVC_(GdiCreateDIBitmapInternal, 11) +SVC_(GdiCreateDIBSection, 9) +SVC_(GdiCreateEllipticRgn, 4) +SVC_(GdiCreateHalftonePalette, 1) +SVC_(GdiCreateHatchBrushInternal, 3) +SVC_(GdiCreateMetafileDC, 1) +SVC_(GdiCreatePaletteInternal, 2) +SVC_(GdiCreatePatternBrushInternal, 3) +SVC_(GdiCreatePen, 4) +SVC_(GdiCreateRectRgn, 4) +SVC_(GdiCreateRoundRectRgn, 6) +SVC_(GdiCreateServerMetaFile, 6) +SVC_(GdiCreateSolidBrush, 2) +SVC_(GdiD3dContextCreate, 4) +SVC_(GdiD3dContextDestroy, 1) +SVC_(GdiD3dContextDestroyAll, 1) +SVC_(GdiD3dValidateTextureStageState, 1) +SVC_(GdiD3dDrawPrimitives2, 7) +SVC_(GdiDdGetDriverState, 1) +SVC_(GdiDdAddAttachedSurface, 3) +SVC_(GdiDdAlphaBlt, 3) +SVC_(GdiDdAttachSurface, 2) +SVC_(GdiDdBeginMoCompFrame, 2) +SVC_(GdiDdBlt, 3) +SVC_(GdiDdCanCreateSurface, 2) +SVC_(GdiDdCanCreateD3DBuffer, 2) +SVC_(GdiDdColorControl, 2) +SVC_(GdiDdCreateDirectDrawObject, 1) +SVC_(GdiDdCreateSurface, 8) +SVC_(GdiDdCreateD3DBuffer, 8) +SVC_(GdiDdCreateMoComp, 2) +SVC_(GdiDdCreateSurfaceObject, 6) +SVC_(GdiDdDeleteDirectDrawObject, 1) +SVC_(GdiDdDeleteSurfaceObject, 1) +SVC_(GdiDdDestroyMoComp, 2) +SVC_(GdiDdDestroySurface, 2) +SVC_(GdiDdDestroyD3DBuffer, 1) +SVC_(GdiDdEndMoCompFrame, 2) +SVC_(GdiDdFlip, 5) +SVC_(GdiDdFlipToGDISurface, 2) +SVC_(GdiDdGetAvailDriverMemory, 2) +SVC_(GdiDdGetBltStatus, 2) +SVC_(GdiDdGetDC, 2) +SVC_(GdiDdGetDriverInfo, 2) +SVC_(GdiDdGetDxHandle, 3) +SVC_(GdiDdGetFlipStatus, 2) +SVC_(GdiDdGetInternalMoCompInfo, 2) +SVC_(GdiDdGetMoCompBuffInfo, 2) +SVC_(GdiDdGetMoCompGuids, 2) +SVC_(GdiDdGetMoCompFormats, 2) +SVC_(GdiDdGetScanLine, 2) +SVC_(GdiDdLock, 3) +SVC_(GdiDdLockD3D, 2) +SVC_(GdiDdQueryDirectDrawObject, 11) +SVC_(GdiDdQueryMoCompStatus, 2) +SVC_(GdiDdReenableDirectDrawObject, 2) +SVC_(GdiDdReleaseDC, 1) +SVC_(GdiDdRenderMoComp, 2) +SVC_(GdiDdResetVisrgn, 2) +SVC_(GdiDdSetColorKey, 2) +SVC_(GdiDdSetExclusiveMode, 2) +SVC_(GdiDdSetGammaRamp, 3) +SVC_(GdiDdCreateSurfaceEx, 3) +SVC_(GdiDdSetOverlayPosition, 3) +SVC_(GdiDdUnattachSurface, 2) +SVC_(GdiDdUnlock, 2) +SVC_(GdiDdUnlockD3D, 2) +SVC_(GdiDdUpdateOverlay, 3) +SVC_(GdiDdWaitForVerticalBlank, 2) +SVC_(GdiDvpCanCreateVideoPort, 2) +SVC_(GdiDvpColorControl, 2) +SVC_(GdiDvpCreateVideoPort, 2) +SVC_(GdiDvpDestroyVideoPort, 2) +SVC_(GdiDvpFlipVideoPort, 4) +SVC_(GdiDvpGetVideoPortBandwidth, 2) +SVC_(GdiDvpGetVideoPortField, 2) +SVC_(GdiDvpGetVideoPortFlipStatus, 2) +SVC_(GdiDvpGetVideoPortInputFormats, 2) +SVC_(GdiDvpGetVideoPortLine, 2) +SVC_(GdiDvpGetVideoPortOutputFormats, 2) +SVC_(GdiDvpGetVideoPortConnectInfo, 2) +SVC_(GdiDvpGetVideoSignalStatus, 2) +SVC_(GdiDvpUpdateVideoPort, 4) +SVC_(GdiDvpWaitForVideoPortSync, 2) +SVC_(GdiDvpAcquireNotification, 3) +SVC_(GdiDvpReleaseNotification, 2) +SVC_(GdiDxgGenericThunk, 6) +SVC_(GdiDeleteClientObj, 1) +SVC_(GdiDeleteColorSpace, 1) +SVC_(GdiDeleteColorTransform, 2) +SVC_(GdiDeleteObjectApp, 1) +SVC_(GdiDescribePixelFormat, 4) +SVC_(GdiGetPerBandInfo, 2) +SVC_(GdiDoBanding, 4) +SVC_(GdiDoPalette, 6) +SVC_(GdiDrawEscape, 4) +SVC_(GdiEllipse, 5) +SVC_(GdiEnableEudc, 1) +SVC_(GdiEndDoc, 1) +SVC_(GdiEndPage, 1) +SVC_(GdiEndPath, 1) +SVC_(GdiEnumFontChunk, 5) +SVC_(GdiEnumFontClose, 1) +SVC_(GdiEnumFontOpen, 7) +SVC_(GdiEnumObjects, 4) +SVC_(GdiEqualRgn, 2) +SVC_(GdiEudcLoadUnloadLink, 7) +SVC_(GdiExcludeClipRect, 5) +SVC_(GdiExtCreatePen, 11) +SVC_(GdiExtCreateRegion, 3) +SVC_(GdiExtEscape, 8) +SVC_(GdiExtFloodFill, 5) +SVC_(GdiExtGetObjectW, 3) +SVC_(GdiExtSelectClipRgn, 3) +SVC_(GdiExtTextOutW, 9) +SVC_(GdiFillPath, 1) +SVC_(GdiFillRgn, 3) +SVC_(GdiFlattenPath, 1) +SVC_(GdiFlushUserBatch, 0) +SVC_(GdiFlush, 0) +SVC_(GdiForceUFIMapping, 2) +SVC_(GdiFrameRgn, 5) +SVC_(GdiFullscreenControl, 5) +SVC_(GdiGetAndSetDCDword, 4) +SVC_(GdiGetAppClipBox, 2) +SVC_(GdiGetBitmapBits, 3) +SVC_(GdiGetBitmapDimension, 2) +SVC_(GdiGetBoundsRect, 3) +SVC_(GdiGetCharABCWidthsW, 6) +SVC_(GdiGetCharacterPlacementW, 6) +SVC_(GdiGetCharSet, 1) +SVC_(GdiGetCharWidthW, 6) +SVC_(GdiGetCharWidthInfo, 2) +SVC_(GdiGetColorAdjustment, 2) +SVC_(GdiGetColorSpaceforBitmap, 1) +SVC_(GdiGetDCDword, 3) +SVC_(GdiGetDCforBitmap, 1) +SVC_(GdiGetDCObject, 2) +SVC_(GdiGetDCPoint, 3) +SVC_(GdiGetDeviceCaps, 2) +SVC_(GdiGetDeviceGammaRamp, 2) +SVC_(GdiGetDeviceCapsAll, 2) +SVC_(GdiGetDIBitsInternal, 9) +SVC_(GdiGetETM, 2) +SVC_(GdiGetEudcTimeStampEx, 3) +SVC_(GdiGetFontData, 5) +SVC_(GdiGetFontResourceInfoInternalW, 7) +SVC_(GdiGetGlyphIndicesW, 5) +SVC_(GdiGetGlyphIndicesWInternal, 6) +SVC_(GdiGetGlyphOutline, 8) +SVC_(GdiGetKerningPairs, 3) +SVC_(GdiGetLinkedUFIs, 3) +SVC_(GdiGetMiterLimit, 2) +SVC_(GdiGetMonitorID, 3) +SVC_(GdiGetNearestColor, 2) +SVC_(GdiGetNearestPaletteIndex, 2) +SVC_(GdiGetObjectBitmapHandle, 2) +SVC_(GdiGetOutlineTextMetricsInternalW, 4) +SVC_(GdiGetPath, 4) +SVC_(GdiGetPixel, 3) +SVC_(GdiGetRandomRgn, 3) +SVC_(GdiGetRasterizerCaps, 2) +SVC_(GdiGetRealizationInfo, 3) +SVC_(GdiGetRegionData, 3) +SVC_(GdiGetRgnBox, 2) +SVC_(GdiGetServerMetaFileBits, 7) +SVC_(GdiGetSpoolMessage, 4) +SVC_(GdiGetStats, 5) +SVC_(GdiGetStockObject, 1) +SVC_(GdiGetStringBitmapW, 5) +SVC_(GdiGetSystemPaletteUse, 1) +SVC_(GdiGetTextCharsetInfo, 3) +SVC_(GdiGetTextExtent, 5) +SVC_(GdiGetTextExtentExW, 8) +SVC_(GdiGetTextFaceW, 4) +SVC_(GdiGetTextMetricsW, 3) +SVC_(GdiGetTransform, 3) +SVC_(GdiGetUFI, 6) +SVC_(GdiGetEmbUFI, 7) +SVC_(GdiGetUFIPathname, 10) +SVC_(GdiGetEmbedFonts, 0) +SVC_(GdiChangeGhostFont, 2) +SVC_(GdiAddEmbFontToDC, 2) +SVC_(GdiGetFontUnicodeRanges, 2) +SVC_(GdiGetWidthTable, 7) +SVC_(GdiGradientFill, 6) +SVC_(GdiHfontCreate, 5) +SVC_(GdiIcmBrushInfo, 8) +SVC_(GdiInit, 0) +SVC_(GdiInitSpool, 0) +SVC_(GdiIntersectClipRect, 5) +SVC_(GdiInvertRgn, 2) +SVC_(GdiLineTo, 3) +SVC_(GdiMakeFontDir, 5) +SVC_(GdiMakeInfoDC, 2) +SVC_(GdiMaskBlt, 13) +SVC_(GdiModifyWorldTransform, 3) +SVC_(GdiMonoBitmap, 1) +SVC_(GdiMoveTo, 4) +SVC_(GdiOffsetClipRgn, 3) +SVC_(GdiOffsetRgn, 3) +SVC_(GdiOpenDCW, 7) +SVC_(GdiPatBlt, 6) +SVC_(GdiPolyPatBlt, 5) +SVC_(GdiPathToRegion, 1) +SVC_(GdiPlgBlt, 11) +SVC_(GdiPolyDraw, 4) +SVC_(GdiPolyPolyDraw, 5) +SVC_(GdiPolyTextOutW, 4) +SVC_(GdiPtInRegion, 3) +SVC_(GdiPtVisible, 3) +SVC_(GdiQueryFonts, 3) +SVC_(GdiQueryFontAssocInfo, 1) +SVC_(GdiRectangle, 5) +SVC_(GdiRectInRegion, 2) +SVC_(GdiRectVisible, 2) +SVC_(GdiRemoveFontResourceW, 6) +SVC_(GdiRemoveFontMemResourceEx, 1) +SVC_(GdiResetDC, 5) +SVC_(GdiResizePalette, 2) +SVC_(GdiRestoreDC, 2) +SVC_(GdiRoundRect, 7) +SVC_(GdiSaveDC, 1) +SVC_(GdiScaleViewportExtEx, 6) +SVC_(GdiScaleWindowExtEx, 6) +SVC_(GdiSelectBitmap, 2) +SVC_(GdiSelectBrush, 2) +SVC_(GdiSelectClipPath, 2) +SVC_(GdiSelectFont, 2) +SVC_(GdiSelectPen, 2) +SVC_(GdiSetBitmapAttributes, 2) +SVC_(GdiSetBitmapBits, 3) +SVC_(GdiSetBitmapDimension, 4) +SVC_(GdiSetBoundsRect, 3) +SVC_(GdiSetBrushAttributes, 2) +SVC_(GdiSetBrushOrg, 4) +SVC_(GdiSetColorAdjustment, 2) +SVC_(GdiSetColorSpace, 2) +SVC_(GdiSetDeviceGammaRamp, 2) +SVC_(GdiSetDIBitsToDeviceInternal, 16) +SVC_(GdiSetFontEnumeration, 1) +SVC_(GdiSetFontXform, 3) +SVC_(GdiSetIcmMode, 3) +SVC_(GdiSetLinkedUFIs, 3) +SVC_(GdiSetMagicColors, 3) +SVC_(GdiSetMetaRgn, 1) +SVC_(GdiSetMiterLimit, 3) +SVC_(GdiGetDeviceWidth, 1) +SVC_(GdiMirrorWindowOrg, 1) +SVC_(GdiSetLayout, 3) +SVC_(GdiSetPixel, 4) +SVC_(GdiSetPixelFormat, 2) +SVC_(GdiSetRectRgn, 5) +SVC_(GdiSetSystemPaletteUse, 2) +SVC_(GdiSetTextJustification, 3) +SVC_(GdiSetupPublicCFONT, 3) +SVC_(GdiSetVirtualResolution, 5) +SVC_(GdiSetSizeDevice, 3) +SVC_(GdiStartDoc, 4) +SVC_(GdiStartPage, 1) +SVC_(GdiStretchBlt, 12) +SVC_(GdiStretchDIBitsInternal, 16) +SVC_(GdiStrokeAndFillPath, 1) +SVC_(GdiStrokePath, 1) +SVC_(GdiSwapBuffers, 1) +SVC_(GdiTransformPoints, 5) +SVC_(GdiTransparentBlt, 11) +SVC_(GdiUnloadPrinterDriver, 2) +SVC_(GdiUnmapMemFont, 1) +SVC_(GdiUnrealizeObject, 1) +SVC_(GdiUpdateColors, 1) +SVC_(GdiWidenPath, 1) +SVC_(UserActivateKeyboardLayout, 2) +SVC_(UserAlterWindowStyle, 3) +SVC_(UserAssociateInputContext, 3) +SVC_(UserAttachThreadInput, 3) +SVC_(UserBeginPaint, 2) +SVC_(UserBitBltSysBmp, 8) +SVC_(UserBlockInput, 1) +SVC_(UserBuildHimcList, 4) +SVC_(UserBuildHwndList, 7) +SVC_(UserBuildNameList, 4) +SVC_(UserBuildPropList, 4) +SVC_(UserCallHwnd, 2) +SVC_(UserCallHwndLock, 2) +SVC_(UserCallHwndOpt, 2) +SVC_(UserCallHwndParam, 3) +SVC_(UserCallHwndParamLock, 3) +SVC_(UserCallMsgFilter, 2) +SVC_(UserCallNextHookEx, 4) +SVC_(UserCallNoParam, 1) +SVC_(UserCallOneParam, 2) +SVC_(UserCallTwoParam, 3) +SVC_(UserChangeClipboardChain, 2) +SVC_(UserChangeDisplaySettings, 5) +SVC_(UserCheckImeHotKey, 2) +SVC_(UserCheckMenuItem, 3) +SVC_(UserChildWindowFromPointEx, 4) +SVC_(UserClipCursor, 1) +SVC_(UserCloseClipboard, 0) +SVC_(UserCloseDesktop, 1) +SVC_(UserCloseWindowStation, 1) +SVC_(UserConsoleControl, 3) +SVC_(UserConvertMemHandle, 2) +SVC_(UserCopyAcceleratorTable, 3) +SVC_(UserCountClipboardFormats, 0) +SVC_(UserCreateAcceleratorTable, 2) +SVC_(UserCreateCaret, 4) +SVC_(UserCreateDesktop, 5) +SVC_(UserCreateInputContext, 1) +SVC_(UserCreateLocalMemHandle, 4) +SVC_(UserCreateWindowEx, 15) +SVC_(UserCreateWindowStation, 7) +SVC_(UserDdeGetQualityOfService, 3) +SVC_(UserDdeInitialize, 5) +SVC_(UserDdeSetQualityOfService, 3) +SVC_(UserDeferWindowPos, 8) +SVC_(UserDefSetText, 2) +SVC_(UserDeleteMenu, 3) +SVC_(UserDestroyAcceleratorTable, 1) +SVC_(UserDestroyCursor, 2) +SVC_(UserDestroyInputContext, 1) +SVC_(UserDestroyMenu, 1) +SVC_(UserDestroyWindow, 1) +SVC_(UserDisableThreadIme, 1) +SVC_(UserDispatchMessage, 1) +SVC_(UserDragDetect, 3) +SVC_(UserDragObject, 5) +SVC_(UserDrawAnimatedRects, 4) +SVC_(UserDrawCaption, 4) +SVC_(UserDrawCaptionTemp, 7) +SVC_(UserDrawIconEx, 11) +SVC_(UserDrawMenuBarTemp, 5) +SVC_(UserEmptyClipboard, 0) +SVC_(UserEnableMenuItem, 3) +SVC_(UserEnableScrollBar, 3) +SVC_(UserEndDeferWindowPosEx, 2) +SVC_(UserEndMenu, 0) +SVC_(UserEndPaint, 2) +SVC_(UserEnumDisplayDevices, 4) +SVC_(UserEnumDisplayMonitors, 4) +SVC_(UserEnumDisplaySettings, 4) +SVC_(UserEvent, 1) +SVC_(UserExcludeUpdateRgn, 2) +SVC_(UserFillWindow, 4) +SVC_(UserFindExistingCursorIcon, 3) +SVC_(UserFindWindowEx, 5) +SVC_(UserFlashWindowEx, 1) +SVC_(UserGetAltTabInfo, 6) +SVC_(UserGetAncestor, 2) +SVC_(UserGetAppImeLevel, 1) +SVC_(UserGetAsyncKeyState, 1) +SVC_(UserGetAtomName, 2) +SVC_(UserGetCaretBlinkTime, 0) +SVC_(UserGetCaretPos, 1) +SVC_(UserGetClassInfo, 5) +SVC_(UserGetClassName, 3) +SVC_(UserGetClipboardData, 2) +SVC_(UserGetClipboardFormatName, 3) +SVC_(UserGetClipboardOwner, 0) +SVC_(UserGetClipboardSequenceNumber, 0) +SVC_(UserGetClipboardViewer, 0) +SVC_(UserGetClipCursor, 1) +SVC_(UserGetComboBoxInfo, 2) +SVC_(UserGetControlBrush, 3) +SVC_(UserGetControlColor, 4) +SVC_(UserGetCPD, 3) +SVC_(UserGetCursorFrameInfo, 4) +SVC_(UserGetCursorInfo, 1) +SVC_(UserGetDC, 1) +SVC_(UserGetDCEx, 3) +SVC_(UserGetDoubleClickTime, 0) +SVC_(UserGetForegroundWindow, 0) +SVC_(UserGetGuiResources, 2) +SVC_(UserGetGUIThreadInfo, 2) +SVC_(UserGetIconInfo, 6) +SVC_(UserGetIconSize, 4) +SVC_(UserGetImeHotKey, 4) +SVC_(UserGetImeInfoEx, 2) +SVC_(UserGetInternalWindowPos, 3) +SVC_(UserGetKeyboardLayoutList, 2) +SVC_(UserGetKeyboardLayoutName, 1) +SVC_(UserGetKeyboardState, 1) +SVC_(UserGetKeyNameText, 3) +SVC_(UserGetKeyState, 1) +SVC_(UserGetListBoxInfo, 1) +SVC_(UserGetMenuBarInfo, 4) +SVC_(UserGetMenuIndex, 2) +SVC_(UserGetMenuItemRect, 4) +SVC_(UserGetMessage, 4) +SVC_(UserGetMouseMovePointsEx, 5) +SVC_(UserGetObjectInformation, 5) +SVC_(UserGetOpenClipboardWindow, 0) +SVC_(UserGetPriorityClipboardFormat, 2) +SVC_(UserGetProcessWindowStation, 0) +SVC_(UserGetRawInputBuffer, 3) +SVC_(UserGetRawInputData, 5) +SVC_(UserGetRawInputDeviceInfo, 4) +SVC_(UserGetRawInputDeviceList, 3) +SVC_(UserGetRegisteredRawInputDevices, 3) +SVC_(UserGetScrollBarInfo, 3) +SVC_(UserGetSystemMenu, 2) +SVC_(UserGetThreadDesktop, 2) +SVC_(UserGetThreadState, 1) +SVC_(UserGetTitleBarInfo, 2) +SVC_(UserGetUpdateRect, 3) +SVC_(UserGetUpdateRgn, 3) +SVC_(UserGetWindowDC, 1) +SVC_(UserGetWindowPlacement, 2) +SVC_(UserGetWOWClass, 2) +SVC_(UserHardErrorControl, 3) +SVC_(UserHideCaret, 1) +SVC_(UserHiliteMenuItem, 4) +SVC_(UserImpersonateDdeClientWindow, 2) +SVC_(UserInitialize, 3) +SVC_(UserInitializeClientPfnArrays, 4) +SVC_(UserInitTask, 12) +SVC_(UserInternalGetWindowText, 3) +SVC_(UserInvalidateRect, 3) +SVC_(UserInvalidateRgn, 3) +SVC_(UserIsClipboardFormatAvailable, 1) +SVC_(UserKillTimer, 2) +SVC_(UserLoadKeyboardLayoutEx, 7) +SVC_(UserLockWindowStation, 1) +SVC_(UserLockWindowUpdate, 1) +SVC_(UserLockWorkStation, 0) +SVC_(UserMapVirtualKeyEx, 4) +SVC_(UserMenuItemFromPoint, 4) +SVC_(UserMessageCall, 7) +SVC_(UserMinMaximize, 3) +SVC_(UserMNDragLeave, 0) +SVC_(UserMNDragOver, 2) +SVC_(UserModifyUserStartupInfoFlags, 2) +SVC_(UserMoveWindow, 6) +SVC_(UserNotifyIMEStatus, 3) +SVC_(UserNotifyProcessCreate, 4) +SVC_(UserNotifyWinEvent, 4) +SVC_(UserOpenClipboard, 2) +SVC_(UserOpenDesktop, 3) +SVC_(UserOpenInputDesktop, 3) +SVC_(UserOpenWindowStation, 2) +SVC_(UserPaintDesktop, 1) +SVC_(UserPeekMessage, 5) +SVC_(UserPostMessage, 4) +SVC_(UserPostThreadMessage, 4) +SVC_(UserPrintWindow, 3) +SVC_(UserProcessConnect, 3) +SVC_(UserQueryInformationThread, 5) +SVC_(UserQueryInputContext, 2) +SVC_(UserQuerySendMessage, 1) +SVC_(UserQueryUserCounters, 5) +SVC_(UserQueryWindow, 2) +SVC_(UserRealChildWindowFromPoint, 3) +SVC_(UserRealInternalGetMessage, 6) +SVC_(UserRealWaitMessageEx, 2) +SVC_(UserRedrawWindow, 4) +SVC_(UserRegisterClassExWOW, 7) +SVC_(UserRegisterUserApiHook, 2) +SVC_(UserRegisterHotKey, 4) +SVC_(UserRegisterRawInputDevices, 3) +SVC_(UserRegisterTasklist, 1) +SVC_(UserRegisterWindowMessage, 1) +SVC_(UserRemoveMenu, 3) +SVC_(UserRemoveProp, 2) +SVC_(UserResolveDesktop, 4) +SVC_(UserResolveDesktopForWOW, 1) +SVC_(UserSBGetParms, 4) +SVC_(UserScrollDC, 7) +SVC_(UserScrollWindowEx, 8) +SVC_(UserSelectPalette, 3) +SVC_(UserSendInput, 3) +SVC_(UserSetActiveWindow, 1) +SVC_(UserSetAppImeLevel, 2) +SVC_(UserSetCapture, 1) +SVC_(UserSetClassLong, 4) +SVC_(UserSetClassWord, 3) +SVC_(UserSetClipboardData, 3) +SVC_(UserSetClipboardViewer, 1) +SVC_(UserSetConsoleReserveKeys, 2) +SVC_(UserSetCursor, 1) +SVC_(UserSetCursorContents, 2) +SVC_(UserSetCursorIconData, 4) +SVC_(UserSetDbgTag, 2) +SVC_(UserSetFocus, 1) +SVC_(UserSetImeHotKey, 5) +SVC_(UserSetImeInfoEx, 1) +SVC_(UserSetImeOwnerWindow, 2) +SVC_(UserSetInformationProcess, 4) +SVC_(UserSetInformationThread, 4) +SVC_(UserSetInternalWindowPos, 4) +SVC_(UserSetKeyboardState, 1) +SVC_(UserSetLogonNotifyWindow, 1) +SVC_(UserSetMenu, 3) +SVC_(UserSetMenuContextHelpId, 2) +SVC_(UserSetMenuDefaultItem, 3) +SVC_(UserSetMenuFlagRtoL, 1) +SVC_(UserSetObjectInformation, 4) +SVC_(UserSetParent, 2) +SVC_(UserSetProcessWindowStation, 1) +SVC_(UserSetProp, 3) +SVC_(UserSetRipFlags, 2) +SVC_(UserSetScrollInfo, 4) +SVC_(UserSetShellWindowEx, 2) +SVC_(UserSetSysColors, 4) +SVC_(UserSetSystemCursor, 2) +SVC_(UserSetSystemMenu, 2) +SVC_(UserSetSystemTimer, 4) +SVC_(UserSetThreadDesktop, 1) +SVC_(UserSetThreadLayoutHandles, 2) +SVC_(UserSetThreadState, 2) +SVC_(UserSetTimer, 4) +SVC_(UserSetWindowFNID, 2) +SVC_(UserSetWindowLong, 4) +SVC_(UserSetWindowPlacement, 2) +SVC_(UserSetWindowPos, 7) +SVC_(UserSetWindowRgn, 3) +SVC_(UserSetWindowsHookAW, 3) +SVC_(UserSetWindowsHookEx, 6) +SVC_(UserSetWindowStationUser, 4) +SVC_(UserSetWindowWord, 3) +SVC_(UserSetWinEventHook, 8) +SVC_(UserShowCaret, 1) +SVC_(UserShowScrollBar, 3) +SVC_(UserShowWindow, 2) +SVC_(UserShowWindowAsync, 2) +SVC_(UserSoundSentry, 0) +SVC_(UserSwitchDesktop, 1) +SVC_(UserSystemParametersInfo, 4) +SVC_(UserTestForInteractiveUser, 1) +SVC_(UserThunkedMenuInfo, 2) +SVC_(UserThunkedMenuItemInfo, 6) +SVC_(UserToUnicodeEx, 7) +SVC_(UserTrackMouseEvent, 1) +SVC_(UserTrackPopupMenuEx, 6) +SVC_(UserCalcMenuBar, 5) +SVC_(UserPaintMenuBar, 6) +SVC_(UserTranslateAccelerator, 3) +SVC_(UserTranslateMessage, 2) +SVC_(UserUnhookWindowsHookEx, 1) +SVC_(UserUnhookWinEvent, 1) +SVC_(UserUnloadKeyboardLayout, 1) +SVC_(UserUnlockWindowStation, 1) +SVC_(UserUnregisterClass, 3) +SVC_(UserUnregisterUserApiHook, 0) +SVC_(UserUnregisterHotKey, 2) +SVC_(UserUpdateInputContext, 3) +SVC_(UserUpdateInstance, 3) +SVC_(UserUpdateLayeredWindow, 9) +SVC_(UserGetLayeredWindowAttributes, 4) +SVC_(UserSetLayeredWindowAttributes, 4) +SVC_(UserUpdatePerUserSystemParameters, 2) +SVC_(UserUserHandleGrantAccess, 3) +SVC_(UserValidateHandleSecure, 2) +SVC_(UserValidateRect, 2) +SVC_(UserValidateTimerCallback, 3) +SVC_(UserVkKeyScanEx, 3) +SVC_(UserWaitForInputIdle, 3) +SVC_(UserWaitForMsgAndEvent, 1) +SVC_(UserWaitMessage, 0) +SVC_(UserWin32PoolAllocationStats, 6) +SVC_(UserWindowFromPoint, 2) +SVC_(UserYieldTask, 0) +SVC_(UserRemoteConnect, 3) +SVC_(UserRemoteRedrawRectangle, 4) +SVC_(UserRemoteRedrawScreen, 0) +SVC_(UserRemoteStopScreenUpdates, 0) +SVC_(UserCtxDisplayIOCtl, 3) +SVC_(GdiEngAssociateSurface, 3) +SVC_(GdiEngCreateBitmap, 6) +SVC_(GdiEngCreateDeviceSurface, 4) +SVC_(GdiEngCreateDeviceBitmap, 4) +SVC_(GdiEngCreatePalette, 6) +SVC_(GdiEngComputeGlyphSet, 3) +SVC_(GdiEngCopyBits, 6) +SVC_(GdiEngDeletePalette, 1) +SVC_(GdiEngDeleteSurface, 1) +SVC_(GdiEngEraseSurface, 3) +SVC_(GdiEngUnlockSurface, 1) +SVC_(GdiEngLockSurface, 1) +SVC_(GdiEngBitBlt, 11) +SVC_(GdiEngStretchBlt, 11) +SVC_(GdiEngPlgBlt, 11) +SVC_(GdiEngMarkBandingSurface, 1) +SVC_(GdiEngStrokePath, 8) +SVC_(GdiEngFillPath, 7) +SVC_(GdiEngStrokeAndFillPath, 10) +SVC_(GdiEngPaint, 5) +SVC_(GdiEngLineTo, 9) +SVC_(GdiEngAlphaBlend, 7) +SVC_(GdiEngGradientFill, 10) +SVC_(GdiEngTransparentBlt, 8) +SVC_(GdiEngTextOut, 10) +SVC_(GdiEngStretchBltROP, 13) +SVC_(GdiXLATEOBJ_cGetPalette, 4) +SVC_(GdiXLATEOBJ_iXlate, 2) +SVC_(GdiXLATEOBJ_hGetColorTransform, 1) +SVC_(GdiCLIPOBJ_bEnum, 3) +SVC_(GdiCLIPOBJ_cEnumStart, 5) +SVC_(GdiCLIPOBJ_ppoGetPath, 1) +SVC_(GdiEngDeletePath, 1) +SVC_(GdiEngCreateClip, 0) +SVC_(GdiEngDeleteClip, 1) +SVC_(GdiBRUSHOBJ_ulGetBrushColor, 1) +SVC_(GdiBRUSHOBJ_pvAllocRbrush, 2) +SVC_(GdiBRUSHOBJ_pvGetRbrush, 1) +SVC_(GdiBRUSHOBJ_hGetColorTransform, 1) +SVC_(GdiXFORMOBJ_bApplyXform, 5) +SVC_(GdiXFORMOBJ_iGetXform, 2) +SVC_(GdiFONTOBJ_vGetInfo, 3) +SVC_(GdiFONTOBJ_pxoGetXform, 1) +SVC_(GdiFONTOBJ_cGetGlyphs, 5) +SVC_(GdiFONTOBJ_pifi, 1) +SVC_(GdiFONTOBJ_pfdg, 1) +SVC_(GdiFONTOBJ_pQueryGlyphAttrs, 2) +SVC_(GdiFONTOBJ_pvTrueTypeFontFile, 2) +SVC_(GdiFONTOBJ_cGetAllGlyphHandles, 2) +SVC_(GdiSTROBJ_bEnum, 3) +SVC_(GdiSTROBJ_bEnumPositionsOnly, 3) +SVC_(GdiSTROBJ_bGetAdvanceWidths, 4) +SVC_(GdiSTROBJ_vEnumStart, 1) +SVC_(GdiSTROBJ_dwGetCodePage, 1) +SVC_(GdiPATHOBJ_vGetBounds, 2) +SVC_(GdiPATHOBJ_bEnum, 2) +SVC_(GdiPATHOBJ_vEnumStart, 1) +SVC_(GdiPATHOBJ_vEnumStartClipLines, 4) +SVC_(GdiPATHOBJ_bEnumClipLines, 3) +SVC_(GdiGetDhpdev, 1) +SVC_(GdiEngCheckAbort, 1) +SVC_(GdiHT_Get8BPPFormatPalette, 4) +SVC_(GdiHT_Get8BPPMaskPalette, 6) +SVC_(GdiUpdateTransform, 1) +SVC_(GdiSetPUMPDOBJ, 4) +SVC_(GdiBRUSHOBJ_DeleteRbrush, 2) +SVC_(GdiUMPDEngFreeUserMem, 1) +SVC_(GdiDrawStream, 3) From b6aa0990cdc57c673af489bba99e4d178f102e43 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 30 Mar 2014 18:25:13 +0000 Subject: [PATCH 180/419] [TUNNELTEST] Reshuffle the test a bit so that it clearly fails on ReactOS: - Gather creation timestamp right after the first creation and always compare to it. This is to workaround the move = copy + delete hack from ReactOS which is resetting the timestamps (and thus making the test pass ;-)). - Wait more than 20ms (1s). If Microsoft FastFAT has a creation resolution of 10ms, we don't. So it would hide the thing as well. With such changes, the test still works on Windows, whereas it fails on ReactOS CORE-7272 svn path=/trunk/; revision=62589 --- rostests/win32/fs/tunneltest/tunneltest.c | 34 ++++++++++------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/rostests/win32/fs/tunneltest/tunneltest.c b/rostests/win32/fs/tunneltest/tunneltest.c index 89c63cfb04a..e9c34d58e19 100644 --- a/rostests/win32/fs/tunneltest/tunneltest.c +++ b/rostests/win32/fs/tunneltest/tunneltest.c @@ -75,10 +75,21 @@ int wmain(int argc, WCHAR * argv[]) fprintf(stderr, "Failed to create file1\n"); return GetLastError(); } + + /* Get its creation timestamp. It will be our reference */ + /* Get it in FileTime because file1 will renamed to file */ + if (GetFileTime(hFile, &FileTime, NULL, NULL) == FALSE) + { + fprintf(stderr, "Failed to read creation time\n"); + CloseHandle(hFile); + return GetLastError(); + } + CloseHandle(hFile); /* Wait a least 10ms (resolution of FAT) */ - Sleep(10 * 2); + /* XXX: Increased to 1s for ReactOS... */ + Sleep(1000); /* Create second file */ /* Remove old file from buffer */ @@ -114,24 +125,6 @@ int wmain(int argc, WCHAR * argv[]) return GetLastError(); } - /* Time to compare creation time of both file & file1 */ - CopyPath[wcslen(TempPath) - 1] = 0; - - /* Open file and get its creation time */ - hFile = CreateFileW(CopyPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - if (hFile == INVALID_HANDLE_VALUE) - { - fprintf(stderr, "Failed to open file\n"); - return GetLastError(); - } - if (GetFileTime(hFile, &FileTime, NULL, NULL) == FALSE) - { - fprintf(stderr, "Failed to read creation time\n"); - CloseHandle(hFile); - return GetLastError(); - } - CloseHandle(hFile); - /* Open file1 and get its creation time */ hFile = CreateFileW(TempPath, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) @@ -147,7 +140,8 @@ int wmain(int argc, WCHAR * argv[]) } CloseHandle(hFile); - /* Delete file */ + /* Delete files */ + CopyPath[wcslen(TempPath) - 1] = 0; DeleteFileW(TempPath); DeleteFileW(CopyPath); From ba3759fb6b4bd83039d30deee8874c479a8f38d8 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 30 Mar 2014 21:10:04 +0000 Subject: [PATCH 181/419] [NTOS:KE] - Verify valid IRQL in KeDelayExecutionThread, just like in KeWait* - Return from KeDelayExecutionThread after yielding execution svn path=/trunk/; revision=62590 --- reactos/ntoskrnl/ke/wait.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/ke/wait.c b/reactos/ntoskrnl/ke/wait.c index 2a24c006b2f..c7bfa3eb458 100644 --- a/reactos/ntoskrnl/ke/wait.c +++ b/reactos/ntoskrnl/ke/wait.c @@ -285,6 +285,11 @@ KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, LARGE_INTEGER DueTime, NewDueTime, InterruptTime; ULONG Hand = 0; + if (Thread->WaitNext) + ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL); + else + ASSERT(KeGetCurrentIrql() <= APC_LEVEL); + /* If this is a user-mode wait of 0 seconds, yield execution */ if (!(Interval->QuadPart) && (WaitMode != KernelMode)) { @@ -292,7 +297,7 @@ KeDelayExecutionThread(IN KPROCESSOR_MODE WaitMode, if (!(Alertable) && !(Thread->ApcState.UserApcPending)) { /* Yield execution */ - NtYieldExecution(); + return NtYieldExecution(); } } From b7737eacf173f52fd99e073f8f60c92216b32246 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Mon, 31 Mar 2014 19:57:42 +0000 Subject: [PATCH 182/419] [RTL] - Fix buffer overrun in RtlNumberOfSetBits svn path=/trunk/; revision=62591 --- reactos/lib/rtl/bitmap.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reactos/lib/rtl/bitmap.c b/reactos/lib/rtl/bitmap.c index b009355dc90..6ceddf927ee 100644 --- a/reactos/lib/rtl/bitmap.c +++ b/reactos/lib/rtl/bitmap.c @@ -467,8 +467,11 @@ RtlNumberOfSetBits( BitCount += BitCountTable[*Byte++]; } - Shift = 8 - (BitMapHeader->SizeOfBitMap & 7); - BitCount += BitCountTable[((*Byte) << Shift) & 0xFF]; + if (BitMapHeader->SizeOfBitMap & 7) + { + Shift = 8 - (BitMapHeader->SizeOfBitMap & 7); + BitCount += BitCountTable[((*Byte) << Shift) & 0xFF]; + } return BitCount; } From e2359b3724ce49375e4b96d030aa0bafab428b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 31 Mar 2014 20:05:44 +0000 Subject: [PATCH 183/419] [CMLIB][MKHIVE] Move some defines where they belong (they are used in mkhive because they are employed in cmlib functions, and cmlib itself uses them too). svn path=/trunk/; revision=62592 --- reactos/lib/cmlib/cmlib.h | 8 ++++++++ reactos/tools/mkhive/mkhive.h | 17 ----------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/reactos/lib/cmlib/cmlib.h b/reactos/lib/cmlib/cmlib.h index 0ddfabd3443..44221ec0bc7 100644 --- a/reactos/lib/cmlib/cmlib.h +++ b/reactos/lib/cmlib/cmlib.h @@ -27,12 +27,20 @@ #define _In_ #define _Out_ #define _Inout_ + #define _In_opt_ + #define _In_range_(x, y) #endif + #define __drv_aliasesMem + #ifndef min #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif + // #ifndef max + // #define max(a, b) (((a) > (b)) ? (a) : (b)) + // #endif + // Definitions copied from // We only want to include host headers, so we define them manually #define STATUS_SUCCESS ((NTSTATUS)0x00000000) diff --git a/reactos/tools/mkhive/mkhive.h b/reactos/tools/mkhive/mkhive.h index 0cd9eb937a2..7ce3bb53fd9 100644 --- a/reactos/tools/mkhive/mkhive.h +++ b/reactos/tools/mkhive/mkhive.h @@ -122,21 +122,4 @@ RegOpenKeyW( extern LIST_ENTRY CmiHiveListHead; #define ABS_VALUE(V) (((V) < 0) ? -(V) : (V)) -#ifndef max -#define max(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef min -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#if (!defined(_MSC_VER) || (_MSC_VER < 1500)) -#define _In_ -#define _Out_ -#define _In_opt_ -#define _In_range_(x, y) -#endif - -#define __drv_aliasesMem - /* EOF */ From 059daa9d85caee281cedaa05b9239465c012e12b Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Mon, 31 Mar 2014 20:11:32 +0000 Subject: [PATCH 184/419] [ADVAPI32] - Fix buffer handling in CredMarshalCredential/CredUnmarshalCredential. Fixes stack corruption during advapi32:cred CORE-7242 #resolve svn path=/trunk/; revision=62593 --- reactos/dll/win32/advapi32/sec/cred.c | 39 ++++++++++----------------- 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/reactos/dll/win32/advapi32/sec/cred.c b/reactos/dll/win32/advapi32/sec/cred.c index 4c6dd287c54..a8d64933332 100644 --- a/reactos/dll/win32/advapi32/sec/cred.c +++ b/reactos/dll/win32/advapi32/sec/cred.c @@ -2008,18 +2008,13 @@ BOOL WINAPI CredMarshalCredentialW( CRED_MARSHAL_TYPE type, PVOID cred, LPWSTR * { case CertCredential: { - char hash[CERT_HASH_LENGTH + 2]; - - memcpy( hash, cert->rgbHashOfCert, sizeof(cert->rgbHashOfCert) ); - memset( hash + sizeof(cert->rgbHashOfCert), 0, sizeof(hash) - sizeof(cert->rgbHashOfCert) ); - - size = sizeof(hash) * 4 / 3; + size = (sizeof(cert->rgbHashOfCert) + 2) * 4 / 3; if (!(p = HeapAlloc( GetProcessHeap(), 0, (size + 4) * sizeof(WCHAR) ))) return FALSE; p[0] = '@'; p[1] = '@'; p[2] = 'A' + type; - len = cred_encode( (const char *)hash, sizeof(hash), p + 3 ); - p[len] = 0; + len = cred_encode( (const char *)cert->rgbHashOfCert, sizeof(cert->rgbHashOfCert), p + 3 ); + p[len + 3] = 0; break; } case UsernameTargetCredential: @@ -2105,7 +2100,6 @@ static BOOL cred_decode( const WCHAR *cred, unsigned int len, char *buf ) buf[i + 0] = (c1 << 6) | c0; buf[i + 1] = (c2 << 4) | (c1 >> 2); - buf[i + 2] = c2 >> 4; } else if (len == 2) { @@ -2113,16 +2107,10 @@ static BOOL cred_decode( const WCHAR *cred, unsigned int len, char *buf ) if ((c1 = char_decode( p[1] )) > 63) return FALSE; buf[i + 0] = (c1 << 6) | c0; - buf[i + 1] = c1 >> 2; - buf[i + 2] = 0; } else if (len == 1) { - if ((c0 = char_decode( p[0] )) > 63) return FALSE; - - buf[i + 0] = c0; - buf[i + 1] = 0; - buf[i + 2] = 0; + return FALSE; } return TRUE; } @@ -2136,17 +2124,19 @@ BOOL WINAPI CredUnmarshalCredentialW( LPCWSTR cred, PCRED_MARSHAL_TYPE type, PVO TRACE("%s, %p, %p\n", debugstr_w(cred), type, out); - if (!cred || cred[0] != '@' || cred[1] != '@' || !cred[2] || !cred[3]) + if (!cred || cred[0] != '@' || cred[1] != '@' || + char_decode( cred[2] ) > 63) { SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; } len = strlenW( cred + 3 ); - switch (cred[2] - 'A') + *type = char_decode( cred[2] ); + switch (*type) { case CertCredential: { - char hash[CERT_HASH_LENGTH + 2]; + char hash[CERT_HASH_LENGTH]; CERT_CREDENTIAL_INFO *cert; if (len != 27 || !cred_decode( cred + 3, len, hash )) @@ -2157,17 +2147,16 @@ BOOL WINAPI CredUnmarshalCredentialW( LPCWSTR cred, PCRED_MARSHAL_TYPE type, PVO if (!(cert = HeapAlloc( GetProcessHeap(), 0, sizeof(*cert) ))) return FALSE; memcpy( cert->rgbHashOfCert, hash, sizeof(cert->rgbHashOfCert) ); cert->cbSize = sizeof(*cert); - *type = CertCredential; *out = cert; break; } case UsernameTargetCredential: { USERNAME_TARGET_CREDENTIAL_INFO *target; - ULONGLONG size = 0; + DWORD size; if (len < 9 || !cred_decode( cred + 3, 6, (char *)&size ) || - !size || size % sizeof(WCHAR) || size > INT_MAX) + size % sizeof(WCHAR) || len - 6 != (size * 4 + 2) / 3) { SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; @@ -2181,7 +2170,6 @@ BOOL WINAPI CredUnmarshalCredentialW( LPCWSTR cred, PCRED_MARSHAL_TYPE type, PVO } target->UserName = (WCHAR *)(target + 1); target->UserName[size / sizeof(WCHAR)] = 0; - *type = UsernameTargetCredential; *out = target; break; } @@ -2189,7 +2177,8 @@ BOOL WINAPI CredUnmarshalCredentialW( LPCWSTR cred, PCRED_MARSHAL_TYPE type, PVO FIXME("BinaryBlobCredential not implemented\n"); return FALSE; default: - WARN("unhandled type %u\n", cred[2] - 'A'); + WARN("unhandled type %u\n", *type); + SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; } return TRUE; @@ -2213,7 +2202,7 @@ BOOL WINAPI CredIsMarshaledCredentialW(LPCWSTR name) if (name && name[0] == '@' && name[1] == '@' && name[2] > 'A' && name[3]) { - char hash[CERT_HASH_LENGTH + 2]; + char hash[CERT_HASH_LENGTH]; int len = strlenW(name + 3 ); DWORD size; From 68f7270ce51dc51e5c3c8d3570e11eda640c2f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 31 Mar 2014 20:38:05 +0000 Subject: [PATCH 185/419] [HOST-TOOLS] For host-tools, including stdint.h when using MSVC is not reliable, so use a tried-&-tested solution (see mkshelllink & geninf tools): include stdint.h if we don't use MSVC, otherwise define just what's needed. Another solution would be to create a include/host/stdint.h which does this same job, and in the host-tools, include this file. CORE-8023 svn path=/trunk/; revision=62594 --- reactos/include/host/typedefs.h | 13 +++++++++++++ reactos/tools/mkshelllink/mkshelllink.c | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/reactos/include/host/typedefs.h b/reactos/include/host/typedefs.h index 2b60d3de798..9eacf404781 100644 --- a/reactos/include/host/typedefs.h +++ b/reactos/include/host/typedefs.h @@ -13,7 +13,20 @@ #include #include #include + +#ifndef _MSC_VER #include +#else +typedef __int8 int8_t; +typedef __int16 int16_t; +typedef __int32 int32_t; +typedef __int64 int64_t; + +typedef unsigned __int8 uint8_t; +typedef unsigned __int16 uint16_t; +typedef unsigned __int32 uint32_t; +typedef unsigned __int64 uint64_t; +#endif /* Function attributes for GCC */ #if !defined(_MSC_VER) && !defined(__fastcall) diff --git a/reactos/tools/mkshelllink/mkshelllink.c b/reactos/tools/mkshelllink/mkshelllink.c index b8a00b3a13b..008dfc5bef9 100644 --- a/reactos/tools/mkshelllink/mkshelllink.c +++ b/reactos/tools/mkshelllink/mkshelllink.c @@ -9,10 +9,11 @@ #include #include #include + #ifndef _MSC_VER #include #else -typedef unsigned __int8 uint8_t; +typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; #endif From 7f4064a7880751b3439c48c5eeae3319a6297f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 31 Mar 2014 20:59:32 +0000 Subject: [PATCH 186/419] Resurrect MSVC 2008 builds. ACHTUNG! ACHTUNG! Even if you can build ROS with MSVC 2008, you cannot boot it (see the below-mentioned JIRA report) ACHTUNG! ACHTUNG! CORE-8023 #comment MSVC 2008 build resurrected in revision 62595. svn path=/trunk/; revision=62595 --- reactos/configure.cmd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reactos/configure.cmd b/reactos/configure.cmd index 77caee58e1b..db8ac5d91f8 100755 --- a/reactos/configure.cmd +++ b/reactos/configure.cmd @@ -49,6 +49,7 @@ if defined ROS_ARCH ( cl 2>&1 | find "x86" > NUL && set ARCH=i386 cl 2>&1 | find "x64" > NUL && set ARCH=amd64 cl 2>&1 | find "ARM" > NUL && set ARCH=arm + cl 2>&1 | find "15.00." > NUL && set BUILD_ENVIRONMENT=VS9 cl 2>&1 | find "16.00." > NUL && set BUILD_ENVIRONMENT=VS10 cl 2>&1 | find "17.00." > NUL && set BUILD_ENVIRONMENT=VS11 cl 2>&1 | find "18.00." > NUL && set BUILD_ENVIRONMENT=VS12 @@ -59,7 +60,13 @@ if defined ROS_ARCH ( echo Detected Visual Studio Environment !BUILD_ENVIRONMENT!-!ARCH! if /I "%1" == "VSSolution" ( - if "!BUILD_ENVIRONMENT!" == "VS10" ( + if "!BUILD_ENVIRONMENT!" == "VS9" ( + if "!ARCH!" == "amd64" ( + set CMAKE_GENERATOR="Visual Studio 9 2008 Win64" + ) else ( + set CMAKE_GENERATOR="Visual Studio 9 2008" + ) + ) else if "!BUILD_ENVIRONMENT!" == "VS10" ( if "!ARCH!" == "amd64" ( set CMAKE_GENERATOR="Visual Studio 10 Win64" ) else ( From 98c3dfa40803726bed631c5a8d54f0582796f171 Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Tue, 1 Apr 2014 08:57:58 +0000 Subject: [PATCH 187/419] [BUGCODES] - Add an error message for Proprietary Software Execution Prevention feature supported by recent CPUs. - TODO: Implement this feature in the kernel. svn path=/trunk/; revision=62598 --- reactos/include/reactos/mc/bugcodes.mc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reactos/include/reactos/mc/bugcodes.mc b/reactos/include/reactos/mc/bugcodes.mc index 5a3ed06d269..5278321235d 100644 --- a/reactos/include/reactos/mc/bugcodes.mc +++ b/reactos/include/reactos/mc/bugcodes.mc @@ -1090,6 +1090,20 @@ Run CHKDSK /F to check for hard drive corruption, and then restart your computer. . +MessageId=0x7C +Severity=Success +Facility=System +SymbolicName=MORAL_EXCEPTION_ERROR +Language=English +An attempt was made to execute a proprietary machine code instruction. +The system has been shut down to prevent damage to your conscience. + +If this is the first time you have seen this error screen, read +. + +If problems continue, remove all nonfree software from your computer. +. + MessageId=0x7D Severity=Success Facility=System From 9062d1b58a0b751d26c0e447ae27bfca0f6c22b7 Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Tue, 1 Apr 2014 08:58:08 +0000 Subject: [PATCH 188/419] Improve config.cmake slightly. svn path=/trunk/; revision=62599 --- reactos/cmake/config.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/cmake/config.cmake b/reactos/cmake/config.cmake index ccecaff6dae..4b04be8fa0c 100644 --- a/reactos/cmake/config.cmake +++ b/reactos/cmake/config.cmake @@ -12,8 +12,8 @@ set(TUNE "i686" CACHE STRING set(OPTIMIZE "4" CACHE STRING "What level of optimization to use. - 0 = off - 1 = Default option, optimize for size (-Os) with some additional options + 0 = Off + 1 = Optimize for size (-Os) with some additional options 2 = Optimize for size (-Os) 3 = Optimize debugging experience (-Og) 4 = Optimize (-O1) @@ -59,16 +59,16 @@ set(_ELF_ FALSE CACHE BOOL Do not enable unless you know what you're doing.") set(NSWPAT FALSE CACHE BOOL -"Whether to compile apps/libs with features covered software patents or not. +"Whether to build apps/libs with features covered by software patents. If you live in a country where software patents are valid/apply, don't enable this (except they/you purchased a license from the patent owner). -This settings is disabled (0) by default.") +This setting is disabled by default.") set(BUILD_MP TRUE CACHE BOOL -"Whether to compile the multi processor versions for ntoskrnl and hal.") +"Whether to build the multiprocessor versions of NTOSKRNL and HAL.") set(GENERATE_DEPENDENCY_GRAPH FALSE CACHE BOOL -"Whether to create a graphml dependency of dlls.") +"Whether to create a GraphML dependency graph of DLLs.") if(MSVC) set(_PREFAST_ FALSE CACHE BOOL From 3661d0d700ba0303309abc136767ddb679728203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 3 Apr 2014 21:12:09 +0000 Subject: [PATCH 189/419] [ACPI] Update ACPICA library from 20110922 to 20140325. Currently breaks build. Fixes are comming. CORE-8044 svn path=/trunk/; revision=62604 --- reactos/drivers/bus/acpi/CMakeLists.txt | 32 +- .../bus/acpi/acpica/dispatcher/dsargs.c | 36 +- .../bus/acpi/acpica/dispatcher/dscontrol.c | 40 +- .../bus/acpi/acpica/dispatcher/dsfield.c | 200 ++- .../bus/acpi/acpica/dispatcher/dsinit.c | 93 +- .../bus/acpi/acpica/dispatcher/dsmethod.c | 194 ++- .../bus/acpi/acpica/dispatcher/dsmthdat.c | 44 +- .../bus/acpi/acpica/dispatcher/dsobject.c | 61 +- .../bus/acpi/acpica/dispatcher/dsopcode.c | 44 +- .../bus/acpi/acpica/dispatcher/dsutils.c | 84 +- .../bus/acpi/acpica/dispatcher/dswexec.c | 59 +- .../bus/acpi/acpica/dispatcher/dswload.c | 65 +- .../bus/acpi/acpica/dispatcher/dswload2.c | 58 +- .../bus/acpi/acpica/dispatcher/dswscope.c | 28 +- .../bus/acpi/acpica/dispatcher/dswstate.c | 40 +- .../drivers/bus/acpi/acpica/events/evevent.c | 56 +- .../drivers/bus/acpi/acpica/events/evglock.c | 37 +- .../drivers/bus/acpi/acpica/events/evgpe.c | 70 +- .../drivers/bus/acpi/acpica/events/evgpeblk.c | 48 +- .../bus/acpi/acpica/events/evgpeinit.c | 46 +- .../bus/acpi/acpica/events/evgpeutil.c | 71 +- .../bus/acpi/acpica/events/evhandler.c | 657 +++++++++ .../drivers/bus/acpi/acpica/events/evmisc.c | 239 ++-- .../drivers/bus/acpi/acpica/events/evregion.c | 805 +++--------- .../drivers/bus/acpi/acpica/events/evrgnini.c | 33 +- .../drivers/bus/acpi/acpica/events/evsci.c | 119 +- .../drivers/bus/acpi/acpica/events/evxface.c | 916 +++++++------ .../drivers/bus/acpi/acpica/events/evxfevnt.c | 44 +- .../drivers/bus/acpi/acpica/events/evxfgpe.c | 160 ++- .../drivers/bus/acpi/acpica/events/evxfregn.c | 29 +- .../bus/acpi/acpica/executer/exconfig.c | 137 +- .../bus/acpi/acpica/executer/exconvrt.c | 55 +- .../bus/acpi/acpica/executer/excreate.c | 65 +- .../bus/acpi/acpica/executer/exdebug.c | 36 +- .../drivers/bus/acpi/acpica/executer/exdump.c | 334 +++-- .../bus/acpi/acpica/executer/exfield.c | 62 +- .../bus/acpi/acpica/executer/exfldio.c | 88 +- .../drivers/bus/acpi/acpica/executer/exmisc.c | 56 +- .../bus/acpi/acpica/executer/exmutex.c | 34 +- .../bus/acpi/acpica/executer/exnames.c | 36 +- .../bus/acpi/acpica/executer/exoparg1.c | 133 +- .../bus/acpi/acpica/executer/exoparg2.c | 49 +- .../bus/acpi/acpica/executer/exoparg3.c | 34 +- .../bus/acpi/acpica/executer/exoparg6.c | 38 +- .../drivers/bus/acpi/acpica/executer/exprep.c | 80 +- .../bus/acpi/acpica/executer/exregion.c | 58 +- .../bus/acpi/acpica/executer/exresnte.c | 48 +- .../bus/acpi/acpica/executer/exresolv.c | 51 +- .../bus/acpi/acpica/executer/exresop.c | 54 +- .../bus/acpi/acpica/executer/exstore.c | 203 +-- .../bus/acpi/acpica/executer/exstoren.c | 47 +- .../bus/acpi/acpica/executer/exstorob.c | 33 +- .../bus/acpi/acpica/executer/exsystem.c | 48 +- .../bus/acpi/acpica/executer/exutils.c | 167 +-- .../drivers/bus/acpi/acpica/hardware/hwacpi.c | 53 +- .../bus/acpi/acpica/hardware/hwesleep.c | 330 +++++ .../drivers/bus/acpi/acpica/hardware/hwgpe.c | 47 +- .../drivers/bus/acpi/acpica/hardware/hwpci.c | 30 +- .../drivers/bus/acpi/acpica/hardware/hwregs.c | 57 +- .../bus/acpi/acpica/hardware/hwsleep.c | 439 ++----- .../bus/acpi/acpica/hardware/hwtimer.c | 55 +- .../bus/acpi/acpica/hardware/hwvalid.c | 31 +- .../bus/acpi/acpica/hardware/hwxface.c | 265 ++-- .../bus/acpi/acpica/hardware/hwxfsleep.c | 559 ++++++++ .../drivers/bus/acpi/acpica/include/acapps.h | 51 +- .../bus/acpi/acpica/include/acbuffer.h | 318 +++++ .../bus/acpi/acpica/include/accommon.h | 26 +- .../bus/acpi/acpica/include/acconfig.h | 74 +- .../drivers/bus/acpi/acpica/include/acdebug.h | 113 +- .../bus/acpi/acpica/include/acdisasm.h | 328 +++-- .../bus/acpi/acpica/include/acdispat.h | 40 +- .../bus/acpi/acpica/include/acevents.h | 89 +- .../drivers/bus/acpi/acpica/include/acexcep.h | 454 ++++--- .../bus/acpi/acpica/include/acglobal.h | 441 ++++--- .../drivers/bus/acpi/acpica/include/achware.h | 84 +- .../bus/acpi/acpica/include/acinterp.h | 44 +- .../drivers/bus/acpi/acpica/include/aclocal.h | 202 ++- .../bus/acpi/acpica/include/acmacros.h | 287 ++-- .../drivers/bus/acpi/acpica/include/acnames.h | 58 +- .../bus/acpi/acpica/include/acnamesp.h | 139 +- .../bus/acpi/acpica/include/acobject.h | 53 +- .../bus/acpi/acpica/include/acopcode.h | 36 +- .../bus/acpi/acpica/include/acoutput.h | 215 ++- .../bus/acpi/acpica/include/acparser.h | 61 +- .../drivers/bus/acpi/acpica/include/acpi.h | 35 +- .../bus/acpi/acpica/include/acpiosxf.h | 185 ++- .../drivers/bus/acpi/acpica/include/acpixf.h | 336 +++-- .../bus/acpi/acpica/include/acpredef.h | 1170 ++++++++++++----- .../drivers/bus/acpi/acpica/include/acresrc.h | 154 ++- .../bus/acpi/acpica/include/acrestyp.h | 264 +++- .../bus/acpi/acpica/include/acstruct.h | 71 +- .../bus/acpi/acpica/include/actables.h | 125 +- .../drivers/bus/acpi/acpica/include/actbl.h | 128 +- .../drivers/bus/acpi/acpica/include/actbl1.h | 139 +- .../drivers/bus/acpi/acpica/include/actbl2.h | 250 +++- .../drivers/bus/acpi/acpica/include/actbl3.h | 811 ++++++++++++ .../drivers/bus/acpi/acpica/include/actbl71.h | 144 -- .../drivers/bus/acpi/acpica/include/actypes.h | 236 +++- .../drivers/bus/acpi/acpica/include/acutils.h | 345 +++-- .../drivers/bus/acpi/acpica/include/amlcode.h | 55 +- .../bus/acpi/acpica/include/amlresrc.h | 188 ++- .../acpi/acpica/include/platform/accygwin.h | 36 +- .../bus/acpi/acpica/include/platform/acefi.h | 26 +- .../bus/acpi/acpica/include/platform/acenv.h | 61 +- .../acpi/acpica/include/platform/acfreebsd.h | 38 +- .../bus/acpi/acpica/include/platform/acgcc.h | 82 +- .../acpi/acpica/include/platform/achaiku.h | 177 +++ .../acpi/acpica/include/platform/acintel.h | 26 +- .../acpi/acpica/include/platform/aclinux.h | 188 ++- .../platform/{acdos16.h => acmacosx.h} | 84 +- .../bus/acpi/acpica/include/platform/acmsvc.h | 49 +- .../acpi/acpica/include/platform/acnetbsd.h | 26 +- .../bus/acpi/acpica/include/platform/acos2.h | 26 +- .../bus/acpi/acpica/include/platform/acwin.h | 95 +- .../acpi/acpica/include/platform/acwin64.h | 27 +- .../bus/acpi/acpica/namespace/nsaccess.c | 39 +- .../bus/acpi/acpica/namespace/nsalloc.c | 51 +- .../bus/acpi/acpica/namespace/nsarguments.c | 375 ++++++ .../bus/acpi/acpica/namespace/nsconvert.c | 556 ++++++++ .../bus/acpi/acpica/namespace/nsdump.c | 238 +++- .../bus/acpi/acpica/namespace/nsdumpdv.c | 30 +- .../bus/acpi/acpica/namespace/nseval.c | 303 +++-- .../bus/acpi/acpica/namespace/nsinit.c | 72 +- .../bus/acpi/acpica/namespace/nsload.c | 41 +- .../bus/acpi/acpica/namespace/nsnames.c | 30 +- .../bus/acpi/acpica/namespace/nsobject.c | 45 +- .../bus/acpi/acpica/namespace/nsparse.c | 36 +- .../bus/acpi/acpica/namespace/nspredef.c | 1056 ++------------- .../bus/acpi/acpica/namespace/nsprepkg.c | 703 ++++++++++ .../bus/acpi/acpica/namespace/nsrepair.c | 635 ++++----- .../bus/acpi/acpica/namespace/nsrepair2.c | 434 ++++-- .../bus/acpi/acpica/namespace/nssearch.c | 27 +- .../bus/acpi/acpica/namespace/nsutils.c | 158 +-- .../bus/acpi/acpica/namespace/nswalk.c | 56 +- .../bus/acpi/acpica/namespace/nsxfeval.c | 284 ++-- .../bus/acpi/acpica/namespace/nsxfname.c | 109 +- .../bus/acpi/acpica/namespace/nsxfobj.c | 32 +- .../drivers/bus/acpi/acpica/parser/psargs.c | 204 ++- .../drivers/bus/acpi/acpica/parser/psloop.c | 674 +--------- .../drivers/bus/acpi/acpica/parser/psobject.c | 754 +++++++++++ .../drivers/bus/acpi/acpica/parser/psopcode.c | 221 +--- .../drivers/bus/acpi/acpica/parser/psopinfo.c | 360 +++++ .../drivers/bus/acpi/acpica/parser/psparse.c | 49 +- .../drivers/bus/acpi/acpica/parser/psscope.c | 27 +- .../drivers/bus/acpi/acpica/parser/pstree.c | 41 +- .../drivers/bus/acpi/acpica/parser/psutils.c | 42 +- .../drivers/bus/acpi/acpica/parser/pswalk.c | 26 +- .../drivers/bus/acpi/acpica/parser/psxface.c | 44 +- .../bus/acpi/acpica/resources/rsaddr.c | 28 +- .../bus/acpi/acpica/resources/rscalc.c | 127 +- .../bus/acpi/acpica/resources/rscreate.c | 183 ++- .../bus/acpi/acpica/resources/rsdump.c | 355 ++--- .../bus/acpi/acpica/resources/rsdumpinfo.c | 429 ++++++ .../bus/acpi/acpica/resources/rsinfo.c | 87 +- .../drivers/bus/acpi/acpica/resources/rsio.c | 28 +- .../drivers/bus/acpi/acpica/resources/rsirq.c | 86 +- .../bus/acpi/acpica/resources/rslist.c | 115 +- .../bus/acpi/acpica/resources/rsmemory.c | 28 +- .../bus/acpi/acpica/resources/rsmisc.c | 329 ++++- .../bus/acpi/acpica/resources/rsserial.c | 501 +++++++ .../bus/acpi/acpica/resources/rsutils.c | 100 +- .../bus/acpi/acpica/resources/rsxface.c | 191 ++- .../drivers/bus/acpi/acpica/tables/tbconvrt.c | 547 -------- .../drivers/bus/acpi/acpica/tables/tbdata.c | 888 +++++++++++++ .../drivers/bus/acpi/acpica/tables/tbfadt.c | 446 ++++--- .../drivers/bus/acpi/acpica/tables/tbfind.c | 30 +- .../drivers/bus/acpi/acpica/tables/tbget.c | 608 --------- .../drivers/bus/acpi/acpica/tables/tbinstal.c | 957 ++++++-------- .../drivers/bus/acpi/acpica/tables/tbprint.c | 351 +++++ .../drivers/bus/acpi/acpica/tables/tbutils.c | 568 +++----- .../drivers/bus/acpi/acpica/tables/tbxface.c | 268 +--- .../drivers/bus/acpi/acpica/tables/tbxfload.c | 533 ++++++++ .../drivers/bus/acpi/acpica/tables/tbxfroot.c | 51 +- .../bus/acpi/acpica/utilities/utaddress.c | 398 ++++++ .../bus/acpi/acpica/utilities/utalloc.c | 168 +-- .../bus/acpi/acpica/utilities/utbuffer.c | 292 ++++ .../bus/acpi/acpica/utilities/utcache.c | 58 +- .../bus/acpi/acpica/utilities/utclib.c | 288 ++-- .../bus/acpi/acpica/utilities/utcopy.c | 57 +- .../bus/acpi/acpica/utilities/utdebug.c | 377 ++---- .../bus/acpi/acpica/utilities/utdecode.c | 182 +-- .../bus/acpi/acpica/utilities/utdelete.c | 250 ++-- .../bus/acpi/acpica/utilities/uterror.c | 399 ++++++ .../bus/acpi/acpica/utilities/uteval.c | 41 +- .../bus/acpi/acpica/utilities/utexcep.c | 253 ++++ .../bus/acpi/acpica/utilities/utglobal.c | 96 +- .../drivers/bus/acpi/acpica/utilities/utids.c | 135 +- .../bus/acpi/acpica/utilities/utinit.c | 72 +- .../bus/acpi/acpica/utilities/utlock.c | 27 +- .../bus/acpi/acpica/utilities/utmath.c | 30 +- .../bus/acpi/acpica/utilities/utmisc.c | 992 ++------------ .../bus/acpi/acpica/utilities/utmutex.c | 60 +- .../bus/acpi/acpica/utilities/utobject.c | 55 +- .../drivers/bus/acpi/acpica/utilities/utosi.c | 175 ++- .../bus/acpi/acpica/utilities/utownerid.c | 313 +++++ .../bus/acpi/acpica/utilities/utpredef.c | 524 ++++++++ .../bus/acpi/acpica/utilities/utresrc.c | 359 ++++- .../bus/acpi/acpica/utilities/utstate.c | 70 +- .../bus/acpi/acpica/utilities/utstring.c | 834 ++++++++++++ .../bus/acpi/acpica/utilities/uttrack.c | 203 ++- .../bus/acpi/acpica/utilities/utxface.c | 531 +++----- .../bus/acpi/acpica/utilities/utxferror.c | 260 +--- .../bus/acpi/acpica/utilities/utxfinit.c | 439 +++++++ .../bus/acpi/acpica/utilities/utxfmutex.c | 285 ++++ 204 files changed, 26353 insertions(+), 14366 deletions(-) create mode 100644 reactos/drivers/bus/acpi/acpica/events/evhandler.c create mode 100644 reactos/drivers/bus/acpi/acpica/hardware/hwesleep.c create mode 100644 reactos/drivers/bus/acpi/acpica/hardware/hwxfsleep.c create mode 100644 reactos/drivers/bus/acpi/acpica/include/acbuffer.h create mode 100644 reactos/drivers/bus/acpi/acpica/include/actbl3.h delete mode 100644 reactos/drivers/bus/acpi/acpica/include/actbl71.h create mode 100644 reactos/drivers/bus/acpi/acpica/include/platform/achaiku.h rename reactos/drivers/bus/acpi/acpica/include/platform/{acdos16.h => acmacosx.h} (75%) create mode 100644 reactos/drivers/bus/acpi/acpica/namespace/nsarguments.c create mode 100644 reactos/drivers/bus/acpi/acpica/namespace/nsconvert.c create mode 100644 reactos/drivers/bus/acpi/acpica/namespace/nsprepkg.c create mode 100644 reactos/drivers/bus/acpi/acpica/parser/psobject.c create mode 100644 reactos/drivers/bus/acpi/acpica/parser/psopinfo.c create mode 100644 reactos/drivers/bus/acpi/acpica/resources/rsdumpinfo.c create mode 100644 reactos/drivers/bus/acpi/acpica/resources/rsserial.c delete mode 100644 reactos/drivers/bus/acpi/acpica/tables/tbconvrt.c create mode 100644 reactos/drivers/bus/acpi/acpica/tables/tbdata.c delete mode 100644 reactos/drivers/bus/acpi/acpica/tables/tbget.c create mode 100644 reactos/drivers/bus/acpi/acpica/tables/tbprint.c create mode 100644 reactos/drivers/bus/acpi/acpica/tables/tbxfload.c create mode 100644 reactos/drivers/bus/acpi/acpica/utilities/utaddress.c create mode 100644 reactos/drivers/bus/acpi/acpica/utilities/utbuffer.c create mode 100644 reactos/drivers/bus/acpi/acpica/utilities/uterror.c create mode 100644 reactos/drivers/bus/acpi/acpica/utilities/utexcep.c create mode 100644 reactos/drivers/bus/acpi/acpica/utilities/utownerid.c create mode 100644 reactos/drivers/bus/acpi/acpica/utilities/utpredef.c create mode 100644 reactos/drivers/bus/acpi/acpica/utilities/utstring.c create mode 100644 reactos/drivers/bus/acpi/acpica/utilities/utxfinit.c create mode 100644 reactos/drivers/bus/acpi/acpica/utilities/utxfmutex.c diff --git a/reactos/drivers/bus/acpi/CMakeLists.txt b/reactos/drivers/bus/acpi/CMakeLists.txt index 2eb4e6619f7..722bc7e72c9 100644 --- a/reactos/drivers/bus/acpi/CMakeLists.txt +++ b/reactos/drivers/bus/acpi/CMakeLists.txt @@ -28,6 +28,7 @@ list(APPEND ACPICA_SOURCE acpica/events/evgpeblk.c acpica/events/evgpeinit.c acpica/events/evgpeutil.c + acpica/events/evhandler.c acpica/events/evmisc.c acpica/events/evregion.c acpica/events/evrgnini.c @@ -40,16 +41,16 @@ list(APPEND ACPICA_SOURCE acpica/executer/exconvrt.c acpica/executer/excreate.c acpica/executer/exdebug.c - #acpica/executer/exdump.c + # acpica/executer/exdump.c acpica/executer/exfield.c acpica/executer/exfldio.c acpica/executer/exmisc.c acpica/executer/exmutex.c + acpica/executer/exnames.c acpica/executer/exoparg1.c acpica/executer/exoparg2.c acpica/executer/exoparg3.c acpica/executer/exoparg6.c - acpica/executer/exnames.c acpica/executer/exprep.c acpica/executer/exregion.c acpica/executer/exresnte.c @@ -61,6 +62,7 @@ list(APPEND ACPICA_SOURCE acpica/executer/exsystem.c acpica/executer/exutils.c acpica/hardware/hwacpi.c + acpica/hardware/hwesleep.c acpica/hardware/hwgpe.c acpica/hardware/hwpci.c acpica/hardware/hwregs.c @@ -68,10 +70,13 @@ list(APPEND ACPICA_SOURCE acpica/hardware/hwtimer.c acpica/hardware/hwvalid.c acpica/hardware/hwxface.c + acpica/hardware/hwxfsleep.c acpica/namespace/nsaccess.c acpica/namespace/nsalloc.c - #acpica/namespace/nsdump.c - #acpica/namespace/nsdumpdv.c + acpica/namespace/nsarguments.c + acpica/namespace/nsconvert.c + # acpica/namespace/nsdump.c + # acpica/namespace/nsdumpdv.c acpica/namespace/nseval.c acpica/namespace/nsinit.c acpica/namespace/nsload.c @@ -79,6 +84,7 @@ list(APPEND ACPICA_SOURCE acpica/namespace/nsobject.c acpica/namespace/nsparse.c acpica/namespace/nspredef.c + acpica/namespace/nsprepkg.c acpica/namespace/nsrepair.c acpica/namespace/nsrepair2.c acpica/namespace/nssearch.c @@ -89,7 +95,9 @@ list(APPEND ACPICA_SOURCE acpica/namespace/nsxfobj.c acpica/parser/psargs.c acpica/parser/psloop.c + acpica/parser/psobject.c acpica/parser/psopcode.c + acpica/parser/psopinfo.c acpica/parser/psparse.c acpica/parser/psscope.c acpica/parser/pstree.c @@ -99,29 +107,38 @@ list(APPEND ACPICA_SOURCE acpica/resources/rsaddr.c acpica/resources/rscalc.c acpica/resources/rscreate.c - #acpica/resources/rsdump.c + # acpica/resources/rsdump.c + # acpica/resources/rsdumpinfo.c acpica/resources/rsinfo.c acpica/resources/rsio.c acpica/resources/rsirq.c acpica/resources/rslist.c acpica/resources/rsmemory.c acpica/resources/rsmisc.c + acpica/resources/rsserial.c acpica/resources/rsutils.c acpica/resources/rsxface.c + acpica/tables/tbdata.c acpica/tables/tbfadt.c acpica/tables/tbfind.c acpica/tables/tbinstal.c + acpica/tables/tbprint.c acpica/tables/tbutils.c acpica/tables/tbxface.c + acpica/tables/tbxfload.c acpica/tables/tbxfroot.c + acpica/utilities/utaddress.c acpica/utilities/utalloc.c + acpica/utilities/utbuffer.c acpica/utilities/utcache.c acpica/utilities/utclib.c acpica/utilities/utcopy.c acpica/utilities/utdebug.c acpica/utilities/utdecode.c acpica/utilities/utdelete.c + acpica/utilities/uterror.c acpica/utilities/uteval.c + acpica/utilities/utexcep.c acpica/utilities/utids.c acpica/utilities/utinit.c acpica/utilities/utlock.c @@ -130,11 +147,16 @@ list(APPEND ACPICA_SOURCE acpica/utilities/utmutex.c acpica/utilities/utobject.c acpica/utilities/utosi.c + acpica/utilities/utownerid.c + acpica/utilities/utpredef.c acpica/utilities/utresrc.c acpica/utilities/utstate.c + acpica/utilities/utstring.c acpica/utilities/uttrack.c acpica/utilities/utxface.c acpica/utilities/utxferror.c + acpica/utilities/utxfinit.c + acpica/utilities/utxfmutex.c acpica/include/acpi.h) add_library(acpica diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dsargs.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dsargs.c index 44cc41b3398..78013413bc7 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dsargs.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dsargs.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -496,7 +496,15 @@ AcpiDsGetRegionArguments ( /* Execute the argument AML */ - Status = AcpiDsExecuteArguments (Node, Node->Parent, + Status = AcpiDsExecuteArguments (Node, ExtraDesc->Extra.ScopeNode, ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + Status = AcpiUtAddAddressRange (ObjDesc->Region.SpaceId, + ObjDesc->Region.Address, ObjDesc->Region.Length, + Node); return_ACPI_STATUS (Status); } diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dscontrol.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dscontrol.c index 41435e072c6..6ed6010db31 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dscontrol.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dscontrol.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -158,7 +158,6 @@ AcpiDsExecBeginControlOp ( switch (Op->Common.AmlOpcode) { case AML_WHILE_OP: - /* * If this is an additional iteration of a while loop, continue. * There is no need to allocate a new control state. @@ -179,7 +178,6 @@ AcpiDsExecBeginControlOp ( /*lint -fallthrough */ case AML_IF_OP: - /* * IF/WHILE: Create a new control state to manage these * constructs. We need to manage these as a stack, in order @@ -222,6 +220,7 @@ AcpiDsExecBeginControlOp ( break; default: + break; } @@ -276,12 +275,10 @@ AcpiDsExecEndControlOp ( AcpiUtDeleteGenericState (ControlState); break; - case AML_ELSE_OP: break; - case AML_WHILE_OP: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", Op)); @@ -324,7 +321,6 @@ AcpiDsExecEndControlOp ( AcpiUtDeleteGenericState (ControlState); break; - case AML_RETURN_OP: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, @@ -362,7 +358,7 @@ AcpiDsExecEndControlOp ( /* * Get the return value and save as the last result - * value. This is the only place where WalkState->ReturnDesc + * value. This is the only place where WalkState->ReturnDesc * is set to anything other than zero! */ WalkState->ReturnDesc = WalkState->Operands[0]; @@ -420,12 +416,11 @@ AcpiDsExecEndControlOp ( Status = AE_CTRL_TERMINATE; break; - case AML_NOOP_OP: /* Just do nothing! */ - break; + break; case AML_BREAK_POINT_OP: @@ -445,11 +440,9 @@ AcpiDsExecEndControlOp ( "Executed AML Breakpoint opcode"); break; - case AML_BREAK_OP: case AML_CONTINUE_OP: /* ACPI 2.0 */ - /* Pop and delete control states until we find a while */ while (WalkState->ControlState && @@ -482,7 +475,6 @@ AcpiDsExecEndControlOp ( } break; - default: ACPI_ERROR ((AE_INFO, "Unknown control opcode=0x%X Op=%p", diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dsfield.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dsfield.c index 39d2e885a04..2219952b682 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dsfield.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dsfield.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -129,6 +129,18 @@ /* Local prototypes */ +#ifdef ACPI_ASL_COMPILER +#include "acdisasm.h" + +static ACPI_STATUS +AcpiDsCreateExternalRegion ( + ACPI_STATUS LookupStatus, + ACPI_PARSE_OBJECT *Op, + char *Path, + ACPI_WALK_STATE *WalkState, + ACPI_NAMESPACE_NODE **Node); +#endif + static ACPI_STATUS AcpiDsGetFieldNames ( ACPI_CREATE_FIELD_INFO *Info, @@ -136,6 +148,69 @@ AcpiDsGetFieldNames ( ACPI_PARSE_OBJECT *Arg); +#ifdef ACPI_ASL_COMPILER +/******************************************************************************* + * + * FUNCTION: AcpiDsCreateExternalRegion (iASL Disassembler only) + * + * PARAMETERS: LookupStatus - Status from NsLookup operation + * Op - Op containing the Field definition and args + * Path - Pathname of the region + * ` WalkState - Current method state + * Node - Where the new region node is returned + * + * RETURN: Status + * + * DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new + * region node/object. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDsCreateExternalRegion ( + ACPI_STATUS LookupStatus, + ACPI_PARSE_OBJECT *Op, + char *Path, + ACPI_WALK_STATE *WalkState, + ACPI_NAMESPACE_NODE **Node) +{ + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *ObjDesc; + + + if (LookupStatus != AE_NOT_FOUND) + { + return (LookupStatus); + } + + /* + * Table disassembly: + * OperationRegion not found. Generate an External for it, and + * insert the name into the namespace. + */ + AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_REGION, 0, 0); + Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION, + ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Must create and install a region object for the new node */ + + ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION); + if (!ObjDesc) + { + return (AE_NO_MEMORY); + } + + ObjDesc->Region.Node = *Node; + Status = AcpiNsAttachObject (*Node, ObjDesc, ACPI_TYPE_REGION); + return (Status); +} +#endif + + /******************************************************************************* * * FUNCTION: AcpiDsCreateBufferField @@ -149,8 +224,8 @@ AcpiDsGetFieldNames ( * CreateBitFieldOp, * CreateByteFieldOp, * CreateWordFieldOp, - * CreateDWordFieldOp, - * CreateQWordFieldOp, + * CreateDwordFieldOp, + * CreateQwordFieldOp, * CreateFieldOp (all of which define a field in a buffer) * ******************************************************************************/ @@ -302,7 +377,7 @@ Cleanup: * * RETURN: Status * - * DESCRIPTION: Process all named fields in a field declaration. Names are + * DESCRIPTION: Process all named fields in a field declaration. Names are * entered into the namespace. * ******************************************************************************/ @@ -315,6 +390,7 @@ AcpiDsGetFieldNames ( { ACPI_STATUS Status; UINT64 Position; + ACPI_PARSE_OBJECT *Child; ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info); @@ -329,10 +405,11 @@ AcpiDsGetFieldNames ( while (Arg) { /* - * Three types of field elements are handled: - * 1) Offset - specifies a bit offset - * 2) AccessAs - changes the access mode - * 3) Name - Enters a new named field into the namespace + * Four types of field elements are handled: + * 1) Name - Enters a new named field into the namespace + * 2) Offset - specifies a bit offset + * 3) AccessAs - changes the access mode/attributes + * 4) Connection - Associate a resource template with the field */ switch (Arg->Common.AmlOpcode) { @@ -351,24 +428,67 @@ AcpiDsGetFieldNames ( Info->FieldBitPosition = (UINT32) Position; break; - case AML_INT_ACCESSFIELD_OP: - + case AML_INT_EXTACCESSFIELD_OP: /* - * Get a new AccessType and AccessAttribute -- to be used for all - * field units that follow, until field end or another AccessAs - * keyword. + * Get new AccessType, AccessAttribute, and AccessLength fields + * -- to be used for all field units that follow, until the + * end-of-field or another AccessAs keyword is encountered. + * NOTE. These three bytes are encoded in the integer value + * of the parseop for convenience. * * In FieldFlags, preserve the flag bits other than the - * ACCESS_TYPE bits + * ACCESS_TYPE bits. */ + + /* AccessType (ByteAcc, WordAcc, etc.) */ + Info->FieldFlags = (UINT8) ((Info->FieldFlags & ~(AML_FIELD_ACCESS_TYPE_MASK)) | - ((UINT8) ((UINT32) Arg->Common.Value.Integer >> 8))); + ((UINT8) ((UINT32) (Arg->Common.Value.Integer & 0x07)))); - Info->Attribute = (UINT8) (Arg->Common.Value.Integer); + /* AccessAttribute (AttribQuick, AttribByte, etc.) */ + + Info->Attribute = (UINT8) ((Arg->Common.Value.Integer >> 8) & 0xFF); + + /* AccessLength (for serial/buffer protocols) */ + + Info->AccessLength = (UINT8) ((Arg->Common.Value.Integer >> 16) & 0xFF); break; + case AML_INT_CONNECTION_OP: + /* + * Clear any previous connection. New connection is used for all + * fields that follow, similar to AccessAs + */ + Info->ResourceBuffer = NULL; + Info->ConnectionNode = NULL; + + /* + * A Connection() is either an actual resource descriptor (buffer) + * or a named reference to a resource template + */ + Child = Arg->Common.Value.Arg; + if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP) + { + Info->ResourceBuffer = Child->Named.Data; + Info->ResourceLength = (UINT16) Child->Named.Value.Integer; + } + else + { + /* Lookup the Connection() namepath, it should already exist */ + + Status = AcpiNsLookup (WalkState->ScopeInfo, + Child->Common.Value.Name, ACPI_TYPE_ANY, + ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE, + WalkState, &Info->ConnectionNode); + if (ACPI_FAILURE (Status)) + { + ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status); + return_ACPI_STATUS (Status); + } + } + break; case AML_INT_NAMEDFIELD_OP: @@ -420,7 +540,6 @@ AcpiDsGetFieldNames ( Info->FieldBitPosition += Info->FieldBitLength; break; - default: ACPI_ERROR ((AE_INFO, @@ -466,11 +585,16 @@ AcpiDsCreateField ( /* First arg is the name of the parent OpRegion (must already exist) */ Arg = Op->Common.Value.Arg; + if (!RegionNode) { Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name, ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode); +#ifdef ACPI_ASL_COMPILER + Status = AcpiDsCreateExternalRegion (Status, Arg, + Arg->Common.Value.Name, WalkState, &RegionNode); +#endif if (ACPI_FAILURE (Status)) { ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); @@ -478,6 +602,8 @@ AcpiDsCreateField ( } } + ACPI_MEMSET (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO)); + /* Second arg is the field flags */ Arg = Arg->Common.Next; @@ -490,7 +616,6 @@ AcpiDsCreateField ( Info.RegionNode = RegionNode; Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next); - return_ACPI_STATUS (Status); } @@ -546,21 +671,25 @@ AcpiDsInitFieldObjects ( switch (WalkState->Opcode) { case AML_FIELD_OP: + Arg = AcpiPsGetArg (Op, 2); Type = ACPI_TYPE_LOCAL_REGION_FIELD; break; case AML_BANK_FIELD_OP: + Arg = AcpiPsGetArg (Op, 4); Type = ACPI_TYPE_LOCAL_BANK_FIELD; break; case AML_INDEX_FIELD_OP: + Arg = AcpiPsGetArg (Op, 3); Type = ACPI_TYPE_LOCAL_INDEX_FIELD; break; default: + return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -586,8 +715,8 @@ AcpiDsInitFieldObjects ( while (Arg) { /* - * Ignore OFFSET and ACCESSAS terms here; we are only interested in the - * field names in order to enter them into the namespace. + * Ignore OFFSET/ACCESSAS/CONNECTION terms here; we are only interested + * in the field names in order to enter them into the namespace. */ if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP) { @@ -655,6 +784,10 @@ AcpiDsCreateBankField ( Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name, ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode); +#ifdef ACPI_ASL_COMPILER + Status = AcpiDsCreateExternalRegion (Status, Arg, + Arg->Common.Value.Name, WalkState, &RegionNode); +#endif if (ACPI_FAILURE (Status)) { ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status); @@ -769,8 +902,5 @@ AcpiDsCreateIndexField ( Info.RegionNode = RegionNode; Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next); - return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dsinit.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dsinit.c index f9d1e2498bc..22ed601fea1 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dsinit.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dsinit.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -124,6 +124,7 @@ #define _COMPONENT ACPI_DISPATCHER ACPI_MODULE_NAME ("dsinit") + /* Local prototypes */ static ACPI_STATUS @@ -145,7 +146,7 @@ AcpiDsInitOneObject ( * * RETURN: Status * - * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object + * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object * within the namespace. * * Currently, the only objects that require initialization are: @@ -163,8 +164,8 @@ AcpiDsInitOneObject ( { ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context; ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; - ACPI_OBJECT_TYPE Type; ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *ObjDesc; ACPI_FUNCTION_ENTRY (); @@ -183,9 +184,7 @@ AcpiDsInitOneObject ( /* And even then, we are only interested in a few object types */ - Type = AcpiNsGetType (ObjHandle); - - switch (Type) + switch (AcpiNsGetType (ObjHandle)) { case ACPI_TYPE_REGION: @@ -200,20 +199,55 @@ AcpiDsInitOneObject ( Info->OpRegionCount++; break; - case ACPI_TYPE_METHOD: - + /* + * Auto-serialization support. We will examine each method that is + * NotSerialized to determine if it creates any Named objects. If + * it does, it will be marked serialized to prevent problems if + * the method is entered by two or more threads and an attempt is + * made to create the same named object twice -- which results in + * an AE_ALREADY_EXISTS exception and method abort. + */ Info->MethodCount++; - break; + ObjDesc = AcpiNsGetAttachedObject (Node); + if (!ObjDesc) + { + break; + } + /* Ignore if already serialized */ + + if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED) + { + Info->SerialMethodCount++; + break; + } + + if (AcpiGbl_AutoSerializeMethods) + { + /* Parse/scan method and serialize it if necessary */ + + AcpiDsAutoSerializeMethod (Node, ObjDesc); + if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED) + { + /* Method was just converted to Serialized */ + + Info->SerialMethodCount++; + Info->SerializedMethodCount++; + break; + } + } + + Info->NonSerialMethodCount++; + break; case ACPI_TYPE_DEVICE: Info->DeviceCount++; break; - default: + break; } @@ -261,7 +295,6 @@ AcpiDsInitializeObjects ( ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "**** Starting initialization of namespace objects ****\n")); - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:")); /* Set all init info to zero */ @@ -297,14 +330,14 @@ AcpiDsInitializeObjects ( } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, - "\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n", - Table->Signature, OwnerId, Info.ObjectCount, - Info.DeviceCount, Info.MethodCount, Info.OpRegionCount)); + "Table [%4.4s] (id %4.4X) - %4u Objects with %3u Devices, " + "%3u Regions, %3u Methods (%u/%u/%u Serial/Non/Cvt)\n", + Table->Signature, OwnerId, Info.ObjectCount, Info.DeviceCount, + Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount, + Info.NonSerialMethodCount, Info.SerializedMethodCount)); - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "%u Methods, %u Regions\n", Info.MethodCount, Info.OpRegionCount)); + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n", + Info.MethodCount, Info.OpRegionCount)); return_ACPI_STATUS (AE_OK); } - - diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dsmethod.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dsmethod.c index 8f7d6bd15d9..5d1985ad2c6 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dsmethod.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dsmethod.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,6 +121,8 @@ #include "acinterp.h" #include "acnamesp.h" #include "acdisasm.h" +#include "acparser.h" +#include "amlcode.h" #define _COMPONENT ACPI_DISPATCHER @@ -128,11 +130,155 @@ /* Local prototypes */ +static ACPI_STATUS +AcpiDsDetectNamedOpcodes ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT **OutOp); + static ACPI_STATUS AcpiDsCreateMethodMutex ( ACPI_OPERAND_OBJECT *MethodDesc); +/******************************************************************************* + * + * FUNCTION: AcpiDsAutoSerializeMethod + * + * PARAMETERS: Node - Namespace Node of the method + * ObjDesc - Method object attached to node + * + * RETURN: Status + * + * DESCRIPTION: Parse a control method AML to scan for control methods that + * need serialization due to the creation of named objects. + * + * NOTE: It is a bit of overkill to mark all such methods serialized, since + * there is only a problem if the method actually blocks during execution. + * A blocking operation is, for example, a Sleep() operation, or any access + * to an operation region. However, it is probably not possible to easily + * detect whether a method will block or not, so we simply mark all suspicious + * methods as serialized. + * + * NOTE2: This code is essentially a generic routine for parsing a single + * control method. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDsAutoSerializeMethod ( + ACPI_NAMESPACE_NODE *Node, + ACPI_OPERAND_OBJECT *ObjDesc) +{ + ACPI_STATUS Status; + ACPI_PARSE_OBJECT *Op = NULL; + ACPI_WALK_STATE *WalkState; + + + ACPI_FUNCTION_TRACE_PTR (DsAutoSerializeMethod, Node); + + + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, + "Method auto-serialization parse [%4.4s] %p\n", + AcpiUtGetNodeName (Node), Node)); + + /* Create/Init a root op for the method parse tree */ + + Op = AcpiPsAllocOp (AML_METHOD_OP); + if (!Op) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + AcpiPsSetName (Op, Node->Name.Integer); + Op->Common.Node = Node; + + /* Create and initialize a new walk state */ + + WalkState = AcpiDsCreateWalkState (Node->OwnerId, NULL, NULL, NULL); + if (!WalkState) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart, + ObjDesc->Method.AmlLength, NULL, 0); + if (ACPI_FAILURE (Status)) + { + AcpiDsDeleteWalkState (WalkState); + return_ACPI_STATUS (Status); + } + + WalkState->DescendingCallback = AcpiDsDetectNamedOpcodes; + + /* Parse the method, scan for creation of named objects */ + + Status = AcpiPsParseAml (WalkState); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + AcpiPsDeleteParseTree (Op); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDsDetectNamedOpcodes + * + * PARAMETERS: WalkState - Current state of the parse tree walk + * OutOp - Unused, required for parser interface + * + * RETURN: Status + * + * DESCRIPTION: Descending callback used during the loading of ACPI tables. + * Currently used to detect methods that must be marked serialized + * in order to avoid problems with the creation of named objects. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiDsDetectNamedOpcodes ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT **OutOp) +{ + + ACPI_FUNCTION_NAME (AcpiDsDetectNamedOpcodes); + + + /* We are only interested in opcodes that create a new name */ + + if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_CREATE | AML_FIELD))) + { + return (AE_OK); + } + + /* + * At this point, we know we have a Named object opcode. + * Mark the method as serialized. Later code will create a mutex for + * this method to enforce serialization. + * + * Note, ACPI_METHOD_IGNORE_SYNC_LEVEL flag means that we will ignore the + * Sync Level mechanism for this method, even though it is now serialized. + * Otherwise, there can be conflicts with existing ASL code that actually + * uses sync levels. + */ + WalkState->MethodDesc->Method.SyncLevel = 0; + WalkState->MethodDesc->Method.InfoFlags |= + (ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL); + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Method serialized [%4.4s] %p - [%s] (%4.4X)\n", + WalkState->MethodNode->Name.Ascii, WalkState->MethodNode, + WalkState->OpInfo->Name, WalkState->Opcode)); + + /* Abort the parse, no need to examine this method any further */ + + return (AE_CTRL_TERMINATE); +} + + /******************************************************************************* * * FUNCTION: AcpiDsMethodError @@ -235,6 +381,7 @@ AcpiDsCreateMethodMutex ( Status = AcpiOsCreateMutex (&MutexDesc->Mutex.OsMutex); if (ACPI_FAILURE (Status)) { + AcpiUtDeleteObjectDesc (MutexDesc); return_ACPI_STATUS (Status); } @@ -255,7 +402,7 @@ AcpiDsCreateMethodMutex ( * * RETURN: Status * - * DESCRIPTION: Prepare a method for execution. Parses the method if necessary, + * DESCRIPTION: Prepare a method for execution. Parses the method if necessary, * increments the thread count, and waits at the method semaphore * for clearance to execute. * @@ -309,11 +456,16 @@ AcpiDsBeginMethodExecution ( /* * The CurrentSyncLevel (per-thread) must be less than or equal to * the sync level of the method. This mechanism provides some - * deadlock prevention + * deadlock prevention. + * + * If the method was auto-serialized, we just ignore the sync level + * mechanism, because auto-serialization of methods can interfere + * with ASL code that actually uses sync levels. * * Top-level method invocation has no walk state at this point */ if (WalkState && + (!(ObjDesc->Method.InfoFlags & ACPI_METHOD_IGNORE_SYNC_LEVEL)) && (WalkState->Thread->CurrentSyncLevel > ObjDesc->Method.Mutex->Mutex.SyncLevel)) { ACPI_ERROR ((AE_INFO, @@ -481,7 +633,8 @@ AcpiDsCallControlMethod ( Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO)); if (!Info) { - return_ACPI_STATUS (AE_NO_MEMORY); + Status = AE_NO_MEMORY; + goto Cleanup; } Info->Parameters = &ThisWalkState->Operands[0]; @@ -552,7 +705,7 @@ Cleanup: * RETURN: Status * * DESCRIPTION: Restart a method that was preempted by another (nested) method - * invocation. Handle the return value (if any) from the callee. + * invocation. Handle the return value (if any) from the callee. * ******************************************************************************/ @@ -642,7 +795,7 @@ AcpiDsRestartControlMethod ( * * RETURN: None * - * DESCRIPTION: Terminate a control method. Delete everything that the method + * DESCRIPTION: Terminate a control method. Delete everything that the method * created, delete all locals and arguments, and delete the parse * tree if requested. * @@ -780,7 +933,8 @@ AcpiDsTerminateControlMethod ( * thread exits here. */ MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_SERIALIZED_PENDING; - MethodDesc->Method.InfoFlags |= ACPI_METHOD_SERIALIZED; + MethodDesc->Method.InfoFlags |= + (ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL); MethodDesc->Method.SyncLevel = 0; } @@ -794,5 +948,3 @@ AcpiDsTerminateControlMethod ( return_VOID; } - - diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dsmthdat.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dsmthdat.c index a264b3aba15..9b664bc8c0c 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dsmthdat.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dsmthdat.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -158,7 +158,7 @@ AcpiDsMethodDataGetType ( * RETURN: Status * * DESCRIPTION: Initialize the data structures that hold the method's arguments - * and locals. The data struct is an array of namespace nodes for + * and locals. The data struct is an array of namespace nodes for * each - this allows RefOf and DeRefOf to work properly for these * special data types. * @@ -215,7 +215,7 @@ AcpiDsMethodDataInit ( * * RETURN: None * - * DESCRIPTION: Delete method locals and arguments. Arguments are only + * DESCRIPTION: Delete method locals and arguments. Arguments are only * deleted if this method was called from another method. * ******************************************************************************/ @@ -274,7 +274,7 @@ AcpiDsMethodDataDeleteAll ( * * RETURN: Status * - * DESCRIPTION: Initialize arguments for a method. The parameter list is a list + * DESCRIPTION: Initialize arguments for a method. The parameter list is a list * of ACPI operand objects, either null terminated or whose length * is defined by MaxParamCount. * @@ -387,6 +387,7 @@ AcpiDsMethodDataGetNode ( break; default: + ACPI_ERROR ((AE_INFO, "Type %u is invalid", Type)); return_ACPI_STATUS (AE_TYPE); } @@ -515,7 +516,7 @@ AcpiDsMethodDataGetValue ( * This means that either 1) The expected argument was * not passed to the method, or 2) A local variable * was referenced by the method (via the ASL) - * before it was initialized. Either case is an error. + * before it was initialized. Either case is an error. */ /* If slack enabled, init the LocalX/ArgX to an Integer of value zero */ @@ -544,7 +545,6 @@ AcpiDsMethodDataGetValue ( return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG); case ACPI_REFCLASS_LOCAL: - /* * No error message for this case, will be trapped again later to * detect and ignore cases of Store(LocalX,LocalX) @@ -580,7 +580,7 @@ AcpiDsMethodDataGetValue ( * * RETURN: None * - * DESCRIPTION: Delete the entry at Opcode:Index. Inserts + * DESCRIPTION: Delete the entry at Opcode:Index. Inserts * a null into the stack slot after the object is deleted. * ******************************************************************************/ @@ -645,7 +645,7 @@ AcpiDsMethodDataDeleteValue ( * * RETURN: Status * - * DESCRIPTION: Store a value in an Arg or Local. The ObjDesc is installed + * DESCRIPTION: Store a value in an Arg or Local. The ObjDesc is installed * as the new value for the Arg or Local and the reference count * for ObjDesc is incremented. * @@ -693,7 +693,7 @@ AcpiDsStoreObjectToLocal ( /* * If the reference count on the object is more than one, we must - * take a copy of the object before we store. A reference count + * take a copy of the object before we store. A reference count * of exactly 1 means that the object was just created during the * evaluation of an expression, and we can safely use it since it * is not used anywhere else. @@ -840,5 +840,3 @@ AcpiDsMethodDataGetType ( return_VALUE (Object->Type); } #endif - - diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dsobject.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dsobject.c index abf8672f2ed..d6260b5dfaf 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dsobject.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dsobject.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -368,7 +368,7 @@ AcpiDsBuildInternalBufferObj ( /* * Second arg is the buffer data (optional) ByteList can be either - * individual bytes or a string initializer. In either case, a + * individual bytes or a string initializer. In either case, a * ByteList appears in the AML. */ Arg = Op->Common.Value.Arg; /* skip first arg */ @@ -613,7 +613,7 @@ AcpiDsBuildInternalPackageObj ( } ACPI_INFO ((AE_INFO, - "Actual Package length (%u) is larger than NumElements field (%u), truncated\n", + "Actual Package length (%u) is larger than NumElements field (%u), truncated", i, ElementCount)); } else if (i < ElementCount) @@ -662,7 +662,7 @@ AcpiDsCreateNode ( /* * Because of the execution pass through the non-control-method - * parts of the table, we can arrive here twice. Only init + * parts of the table, we can arrive here twice. Only init * the named object node the first time through */ if (AcpiNsGetAttachedObject (Node)) @@ -715,7 +715,7 @@ AcpiDsCreateNode ( * RETURN: Status * * DESCRIPTION: Initialize a namespace object from a parser Op and its - * associated arguments. The namespace object is a more compact + * associated arguments. The namespace object is a more compact * representation of the Op and its arguments. * ******************************************************************************/ @@ -749,7 +749,6 @@ AcpiDsInitObjectFromOp ( switch (ObjDesc->Common.Type) { case ACPI_TYPE_BUFFER: - /* * Defer evaluation of Buffer TermArg operand */ @@ -759,9 +758,7 @@ AcpiDsInitObjectFromOp ( ObjDesc->Buffer.AmlLength = Op->Named.Length; break; - case ACPI_TYPE_PACKAGE: - /* * Defer evaluation of Package TermArg operand */ @@ -771,7 +768,6 @@ AcpiDsInitObjectFromOp ( ObjDesc->Package.AmlLength = Op->Named.Length; break; - case ACPI_TYPE_INTEGER: switch (OpInfo->Type) @@ -806,7 +802,7 @@ AcpiDsInitObjectFromOp ( /* Truncate value if we are executing from a 32-bit ACPI table */ #ifndef ACPI_NO_METHOD_EXECUTION - AcpiExTruncateFor32bitTable (ObjDesc); + (void) AcpiExTruncateFor32bitTable (ObjDesc); #endif break; @@ -824,17 +820,25 @@ AcpiDsInitObjectFromOp ( } break; - case AML_TYPE_LITERAL: ObjDesc->Integer.Value = Op->Common.Value.Integer; + #ifndef ACPI_NO_METHOD_EXECUTION - AcpiExTruncateFor32bitTable (ObjDesc); + if (AcpiExTruncateFor32bitTable (ObjDesc)) + { + /* Warn if we found a 64-bit constant in a 32-bit table */ + + ACPI_WARNING ((AE_INFO, + "Truncated 64-bit constant found in 32-bit table: %8.8X%8.8X => %8.8X", + ACPI_FORMAT_UINT64 (Op->Common.Value.Integer), + (UINT32) ObjDesc->Integer.Value)); + } #endif break; - default: + ACPI_ERROR ((AE_INFO, "Unknown Integer type 0x%X", OpInfo->Type)); Status = AE_AML_OPERAND_TYPE; @@ -842,7 +846,6 @@ AcpiDsInitObjectFromOp ( } break; - case ACPI_TYPE_STRING: ObjDesc->String.Pointer = Op->Common.Value.String; @@ -855,11 +858,9 @@ AcpiDsInitObjectFromOp ( ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; break; - case ACPI_TYPE_METHOD: break; - case ACPI_TYPE_LOCAL_REFERENCE: switch (OpInfo->Type) @@ -879,7 +880,6 @@ AcpiDsInitObjectFromOp ( #endif break; - case AML_TYPE_METHOD_ARGUMENT: /* Arg ID (0-6) is (AML opcode - base AML_ARG_OP) */ @@ -923,7 +923,6 @@ AcpiDsInitObjectFromOp ( } break; - default: ACPI_ERROR ((AE_INFO, "Unimplemented data type: 0x%X", @@ -935,5 +934,3 @@ AcpiDsInitObjectFromOp ( return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dsopcode.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dsopcode.c index 0f5164e96fc..83d482d4934 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dsopcode.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dsopcode.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: dsopcode - Dispatcher suport for regions and fields + * Module Name: dsopcode - Dispatcher support for regions and fields * *****************************************************************************/ @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -595,18 +595,18 @@ AcpiDsEvalTableRegionOperands ( /* - * This is where we evaluate the SignatureString and OemIDString - * and OemTableIDString of the DataTableRegion declaration + * This is where we evaluate the Signature string, OemId string, + * and OemTableId string of the Data Table Region declaration */ Node = Op->Common.Node; - /* NextOp points to SignatureString op */ + /* NextOp points to Signature string op */ NextOp = Op->Common.Value.Arg; /* - * Evaluate/create the SignatureString and OemIDString - * and OemTableIDString operands + * Evaluate/create the Signature string, OemId string, + * and OemTableId string operands */ Status = AcpiDsCreateOperands (WalkState, NextOp); if (ACPI_FAILURE (Status)) @@ -615,8 +615,8 @@ AcpiDsEvalTableRegionOperands ( } /* - * Resolve the SignatureString and OemIDString - * and OemTableIDString operands + * Resolve the Signature string, OemId string, + * and OemTableId string operands */ Status = AcpiExResolveOperands (Op->Common.AmlOpcode, ACPI_WALK_OPERANDS, WalkState); @@ -752,6 +752,7 @@ AcpiDsEvalDataObjectOperands ( break; default: + return_ACPI_STATUS (AE_AML_BAD_OPCODE); } @@ -878,4 +879,3 @@ AcpiDsEvalBankFieldOperands ( AcpiUtRemoveReference (OperandDesc); return_ACPI_STATUS (Status); } - diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dsutils.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dsutils.c index 22bd0bf900e..2553ad2aff9 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dsutils.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dsutils.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -136,7 +136,7 @@ * * RETURN: None. * - * DESCRIPTION: Clear and remove a reference on an implicit return value. Used + * DESCRIPTION: Clear and remove a reference on an implicit return value. Used * to delete "stale" return values (if enabled, the return value * from every operator is saved at least momentarily, in case the * parent method exits.) @@ -189,7 +189,7 @@ AcpiDsClearImplicitReturn ( * * DESCRIPTION: Implements the optional "implicit return". We save the result * of every ASL operator and control method invocation in case the - * parent method exit. Before storing a new return value, we + * parent method exit. Before storing a new return value, we * delete the previous return value. * ******************************************************************************/ @@ -292,7 +292,7 @@ AcpiDsIsResultUsed ( * * If there is no parent, or the parent is a ScopeOp, we are executing * at the method level. An executing method typically has no parent, - * since each method is parsed separately. A method invoked externally + * since each method is parsed separately. A method invoked externally * via ExecuteControlMethod has a ScopeOp as the parent. */ if ((!Op->Common.Parent) || @@ -317,7 +317,7 @@ AcpiDsIsResultUsed ( } /* - * Decide what to do with the result based on the parent. If + * Decide what to do with the result based on the parent. If * the parent opcode will not use the result, delete the object. * Otherwise leave it as is, it will be deleted when it is used * as an operand later. @@ -336,7 +336,6 @@ AcpiDsIsResultUsed ( case AML_IF_OP: case AML_WHILE_OP: - /* * If we are executing the predicate AND this is the predicate op, * we will use the return value @@ -349,7 +348,9 @@ AcpiDsIsResultUsed ( break; default: + /* Ignore other control opcodes */ + break; } @@ -357,16 +358,13 @@ AcpiDsIsResultUsed ( goto ResultNotUsed; - case AML_CLASS_CREATE: - /* * These opcodes allow TermArg(s) as operands and therefore - * the operands can be method calls. The result is used. + * the operands can be method calls. The result is used. */ goto ResultUsed; - case AML_CLASS_NAMED_OBJECT: if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) || @@ -379,16 +377,14 @@ AcpiDsIsResultUsed ( { /* * These opcodes allow TermArg(s) as operands and therefore - * the operands can be method calls. The result is used. + * the operands can be method calls. The result is used. */ goto ResultUsed; } goto ResultNotUsed; - default: - /* * In all other cases. the parent will actually use the return * object, so keep it. @@ -426,9 +422,9 @@ ResultNotUsed: * * RETURN: Status * - * DESCRIPTION: Used after interpretation of an opcode. If there is an internal + * DESCRIPTION: Used after interpretation of an opcode. If there is an internal * result descriptor, check if the parent opcode will actually use - * this result. If not, delete the result now so that it will + * this result. If not, delete the result now so that it will * not become orphaned. * ******************************************************************************/ @@ -480,7 +476,7 @@ AcpiDsDeleteResultIfNotUsed ( * * RETURN: Status * - * DESCRIPTION: Resolve all operands to their values. Used to prepare + * DESCRIPTION: Resolve all operands to their values. Used to prepare * arguments to a control method invocation (a call from one * method to another.) * @@ -499,7 +495,7 @@ AcpiDsResolveOperands ( /* * Attempt to resolve each of the valid operands - * Method arguments are passed by reference, not by value. This means + * Method arguments are passed by reference, not by value. This means * that the actual objects are passed, not copies of the objects. */ for (i = 0; i < WalkState->NumOperands; i++) @@ -566,7 +562,7 @@ AcpiDsClearOperands ( * RETURN: Status * * DESCRIPTION: Translate a parse tree object that is an argument to an AML - * opcode to the equivalent interpreter object. This may include + * opcode to the equivalent interpreter object. This may include * looking up a name or entering a new name into the internal * namespace. * @@ -612,11 +608,11 @@ AcpiDsCreateOperand ( /* All prefixes have been handled, and the name is in NameString */ /* - * Special handling for BufferField declarations. This is a deferred + * Special handling for BufferField declarations. This is a deferred * opcode that unfortunately defines the field name as the last - * parameter instead of the first. We get here when we are performing + * parameter instead of the first. We get here when we are performing * the deferred execution, so the actual name of the field is already - * in the namespace. We don't want to attempt to look it up again + * in the namespace. We don't want to attempt to look it up again * because we may be executing in a different scope than where the * actual opcode exists. */ @@ -723,8 +719,8 @@ AcpiDsCreateOperand ( /* * If the name is null, this means that this is an * optional result parameter that was not specified - * in the original ASL. Create a Zero Constant for a - * placeholder. (Store to a constant is a Noop.) + * in the original ASL. Create a Zero Constant for a + * placeholder. (Store to a constant is a Noop.) */ Opcode = AML_ZERO_OP; /* Has no arguments! */ @@ -855,16 +851,16 @@ AcpiDsCreateOperands ( Index++; } + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, + "NumOperands %d, ArgCount %d, Index %d\n", + WalkState->NumOperands, ArgCount, Index)); + + /* Create the interpreter arguments, in reverse order */ + Index--; - - /* It is the appropriate order to get objects from the Result stack */ - for (i = 0; i < ArgCount; i++) { Arg = Arguments[Index]; - - /* Force the filling of the operand stack in inverse order */ - WalkState->OperandIndex = (UINT8) Index; Status = AcpiDsCreateOperand (WalkState, Arg, Index); @@ -873,10 +869,10 @@ AcpiDsCreateOperands ( goto Cleanup; } + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, + "Created Arg #%u (%p) %u args total\n", + Index, Arg, ArgCount)); Index--; - - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%u (%p) done, Arg1=%p\n", - Index, Arg, FirstArg)); } return_ACPI_STATUS (Status); diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dswexec.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dswexec.c index e243c7f7694..afa707d5762 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dswexec.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dswexec.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -236,7 +236,7 @@ AcpiDsGetPredicateValue ( /* Truncate the predicate to 32-bits if necessary */ - AcpiExTruncateFor32bitTable (LocalObjDesc); + (void) AcpiExTruncateFor32bitTable (LocalObjDesc); /* * Save the result of the predicate evaluation on @@ -295,7 +295,7 @@ Cleanup: * RETURN: Status * * DESCRIPTION: Descending callback used during the execution of control - * methods. This is where most operators and operands are + * methods. This is where most operators and operands are * dispatched to the interpreter. * ****************************************************************************/ @@ -390,14 +390,13 @@ AcpiDsExecBeginOp ( Status = AcpiDsExecBeginControlOp (WalkState, Op); break; - case AML_CLASS_NAMED_OBJECT: if (WalkState->WalkType & ACPI_WALK_METHOD) { /* * Found a named object declaration during method execution; - * we must enter this object into the namespace. The created + * we must enter this object into the namespace. The created * object is temporary and will be deleted upon completion of * the execution of this method. * @@ -422,14 +421,13 @@ AcpiDsExecBeginOp ( } break; - case AML_CLASS_EXECUTE: case AML_CLASS_CREATE: break; - default: + break; } @@ -453,7 +451,7 @@ ErrorExit: * RETURN: Status * * DESCRIPTION: Ascending callback used during the execution of control - * methods. The only thing we really need to do here is to + * methods. The only thing we really need to do here is to * notice the beginning of IF, ELSE, and WHILE blocks. * ****************************************************************************/ @@ -513,7 +511,6 @@ AcpiDsExecEndOp ( } break; - case AML_CLASS_EXECUTE: /* Most operators with arguments */ /* Build resolved operand stack */ @@ -541,7 +538,7 @@ AcpiDsExecEndOp ( { /* * Dispatch the request to the appropriate interpreter handler - * routine. There is one routine per opcode "type" based upon the + * routine. There is one routine per opcode "type" based upon the * number of opcode arguments and return type. */ Status = AcpiGbl_OpTypeDispatch[OpType] (WalkState); @@ -586,7 +583,6 @@ AcpiDsExecEndOp ( } break; - default: switch (OpType) @@ -599,9 +595,7 @@ AcpiDsExecEndOp ( break; - case AML_TYPE_METHOD_CALL: - /* * If the method is referenced from within a package * declaration, it is not a invocation of the method, just @@ -619,7 +613,8 @@ AcpiDsExecEndOp ( return_ACPI_STATUS (AE_OK); } - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op)); + ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, + "Method invocation, Op=%p\n", Op)); /* * (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains @@ -668,7 +663,6 @@ AcpiDsExecEndOp ( */ return_ACPI_STATUS (Status); - case AML_TYPE_CREATE_FIELD: ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, @@ -692,7 +686,6 @@ AcpiDsExecEndOp ( switch (Op->Common.Parent->Common.AmlOpcode) { case AML_NAME_OP: - /* * Put the Node on the object stack (Contains the ACPI Name * of this object) @@ -733,7 +726,6 @@ AcpiDsExecEndOp ( } break; - case AML_TYPE_NAMED_FIELD: case AML_TYPE_NAMED_COMPLEX: case AML_TYPE_NAMED_SIMPLE: @@ -780,14 +772,12 @@ AcpiDsExecEndOp ( } break; - case AML_TYPE_UNDEFINED: ACPI_ERROR ((AE_INFO, "Undefined opcode type Op=%p", Op)); return_ACPI_STATUS (AE_NOT_IMPLEMENTED); - case AML_TYPE_BOGUS: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, @@ -795,11 +785,10 @@ AcpiDsExecEndOp ( WalkState->Opcode, Op)); break; - default: ACPI_ERROR ((AE_INFO, - "Unimplemented opcode, class=0x%X type=0x%X Opcode=-0x%X Op=%p", + "Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p", OpClass, OpType, Op->Common.AmlOpcode, Op)); Status = AE_NOT_IMPLEMENTED; @@ -811,7 +800,7 @@ AcpiDsExecEndOp ( * ACPI 2.0 support for 64-bit integers: Truncate numeric * result value if we are executing from a 32-bit ACPI table */ - AcpiExTruncateFor32bitTable (WalkState->ResultObj); + (void) AcpiExTruncateFor32bitTable (WalkState->ResultObj); /* * Check if we just completed the evaluation of a @@ -865,5 +854,3 @@ Cleanup: WalkState->NumOperands = 0; return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dswload.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dswload.c index f30bbfc1936..7f811dd843b 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dswload.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dswload.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -152,7 +152,21 @@ AcpiDsInitCallbacks ( switch (PassNumber) { + case 0: + + /* Parse only - caller will setup callbacks */ + + WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 | + ACPI_PARSE_DELETE_TREE | + ACPI_PARSE_DISASSEMBLE; + WalkState->DescendingCallback = NULL; + WalkState->AscendingCallback = NULL; + break; + case 1: + + /* Load pass 1 */ + WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE; WalkState->DescendingCallback = AcpiDsLoad1BeginOp; @@ -160,6 +174,9 @@ AcpiDsInitCallbacks ( break; case 2: + + /* Load pass 2 */ + WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 | ACPI_PARSE_DELETE_TREE; WalkState->DescendingCallback = AcpiDsLoad2BeginOp; @@ -167,6 +184,9 @@ AcpiDsInitCallbacks ( break; case 3: + + /* Execution pass */ + #ifndef ACPI_NO_METHOD_EXECUTION WalkState->ParseFlags |= ACPI_PARSE_EXECUTE | ACPI_PARSE_DELETE_TREE; @@ -176,6 +196,7 @@ AcpiDsInitCallbacks ( break; default: + return (AE_BAD_PARAMETER); } @@ -246,7 +267,6 @@ AcpiDsLoad1BeginOp ( switch (WalkState->Opcode) { case AML_SCOPE_OP: - /* * The target name of the Scope() operator must exist at this point so * that we can actually open the scope to enter new names underneath it. @@ -262,7 +282,7 @@ AcpiDsLoad1BeginOp ( * Target of Scope() not found. Generate an External for it, and * insert the name into the namespace. */ - AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0); + AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0, 0); Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType, ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, &Node); @@ -293,7 +313,6 @@ AcpiDsLoad1BeginOp ( case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: - /* * These types we will allow, but we will change the type. * This enables some existing code of the form: @@ -313,6 +332,19 @@ AcpiDsLoad1BeginOp ( WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; break; + case ACPI_TYPE_METHOD: + /* + * Allow scope change to root during execution of module-level + * code. Root is typed METHOD during this time. + */ + if ((Node == AcpiGbl_RootNode) && + (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)) + { + break; + } + + /*lint -fallthrough */ + default: /* All other types are an error */ @@ -326,7 +358,6 @@ AcpiDsLoad1BeginOp ( } break; - default: /* * For all other named opcodes, we will enter the name into diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dswload2.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dswload2.c index 8eba533977b..bef85cb8af9 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dswload2.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dswload2.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -308,13 +308,27 @@ AcpiDsLoad2BeginOp ( */ ACPI_WARNING ((AE_INFO, "Type override - [%4.4s] had invalid type (%s) " - "for Scope operator, changed to type ANY\n", + "for Scope operator, changed to type ANY", AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type))); Node->Type = ACPI_TYPE_ANY; WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY; break; + case ACPI_TYPE_METHOD: + + /* + * Allow scope change to root during execution of module-level + * code. Root is typed METHOD during this time. + */ + if ((Node == AcpiGbl_RootNode) && + (WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL)) + { + break; + } + + /*lint -fallthrough */ + default: /* All other types are an error */ @@ -324,7 +338,7 @@ AcpiDsLoad2BeginOp ( "Scope operator [%4.4s] (Cannot override)", AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node))); - return (AE_AML_OPERAND_TYPE); + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } break; @@ -554,7 +568,6 @@ AcpiDsLoad2EndOp ( Status = AcpiDsCreateBufferField (Op, WalkState); break; - case AML_TYPE_NAMED_FIELD: /* * If we are executing a method, initialize the field @@ -583,12 +596,12 @@ AcpiDsLoad2EndOp ( break; default: + /* All NAMED_FIELD opcodes must be handled above */ break; } break; - case AML_TYPE_NAMED_SIMPLE: Status = AcpiDsCreateOperands (WalkState, Arg); @@ -619,13 +632,13 @@ AcpiDsLoad2EndOp ( Status = AcpiExCreateEvent (WalkState); break; - case AML_ALIAS_OP: Status = AcpiExCreateAlias (WalkState); break; default: + /* Unknown opcode */ Status = AE_OK; @@ -683,7 +696,7 @@ AcpiDsLoad2EndOp ( RegionSpace, WalkState); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } AcpiExExitInterpreter (); @@ -710,13 +723,11 @@ AcpiDsLoad2EndOp ( } break; - case AML_NAME_OP: Status = AcpiDsCreateNode (WalkState, Node, Op); break; - case AML_METHOD_OP: /* * MethodOp PkgLength NameString MethodFlags TermList @@ -754,18 +765,17 @@ AcpiDsLoad2EndOp ( #endif /* ACPI_NO_METHOD_EXECUTION */ default: + /* All NAMED_COMPLEX opcodes must be handled above */ break; } break; - case AML_CLASS_INTERNAL: /* case AML_INT_NAMEPATH_OP: */ break; - case AML_CLASS_METHOD_CALL: ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, @@ -805,6 +815,7 @@ AcpiDsLoad2EndOp ( default: + break; } @@ -816,4 +827,3 @@ Cleanup: WalkState->NumOperands = 0; return_ACPI_STATUS (Status); } - diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dswscope.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dswscope.c index b95c42746ca..62f25965566 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dswscope.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dswscope.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -307,5 +307,3 @@ AcpiDsScopeStackPop ( AcpiUtDeleteGenericState (ScopeInfo); return_ACPI_STATUS (AE_OK); } - - diff --git a/reactos/drivers/bus/acpi/acpica/dispatcher/dswstate.c b/reactos/drivers/bus/acpi/acpica/dispatcher/dswstate.c index 07ed6d4d711..e76d4ce9c42 100644 --- a/reactos/drivers/bus/acpi/acpica/dispatcher/dswstate.c +++ b/reactos/drivers/bus/acpi/acpica/dispatcher/dswstate.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -457,7 +457,7 @@ AcpiDsObjStackPush ( * * RETURN: Status * - * DESCRIPTION: Pop this walk's object stack. Objects on the stack are NOT + * DESCRIPTION: Pop this walk's object stack. Objects on the stack are NOT * deleted by this routine. * ******************************************************************************/ @@ -621,7 +621,7 @@ AcpiDsPushWalkState ( * RETURN: A WalkState object popped from the thread's stack * * DESCRIPTION: Remove and return the walkstate object that is at the head of - * the walk stack for the given walk list. NULL indicates that + * the walk stack for the given walk list. NULL indicates that * the list is empty. * ******************************************************************************/ @@ -666,7 +666,7 @@ AcpiDsPopWalkState ( * * RETURN: Pointer to the new walk state. * - * DESCRIPTION: Allocate and initialize a new walk state. The current walk + * DESCRIPTION: Allocate and initialize a new walk state. The current walk * state is set to this new state. * ******************************************************************************/ @@ -802,7 +802,7 @@ AcpiDsInitAmlWalk ( /* * Setup the current scope. * Find a Named Op that has a namespace node associated with it. - * search upwards from this Op. Current scope is the first + * search upwards from this Op. Current scope is the first * Op with a namespace node. */ ExtraOp = ParserState->StartOp; @@ -862,14 +862,14 @@ AcpiDsDeleteWalkState ( if (!WalkState) { - return; + return_VOID; } if (WalkState->DescriptorType != ACPI_DESC_TYPE_WALK) { ACPI_ERROR ((AE_INFO, "%p is not a valid walk state", WalkState)); - return; + return_VOID; } /* There should not be any open scopes */ @@ -914,5 +914,3 @@ AcpiDsDeleteWalkState ( ACPI_FREE (WalkState); return_VOID; } - - diff --git a/reactos/drivers/bus/acpi/acpica/events/evevent.c b/reactos/drivers/bus/acpi/acpica/events/evevent.c index a85588f105e..f43eeff07a8 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evevent.c +++ b/reactos/drivers/bus/acpi/acpica/events/evevent.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -120,6 +120,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evevent") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static ACPI_STATUS @@ -153,6 +155,13 @@ AcpiEvInitializeEvents ( ACPI_FUNCTION_TRACE (EvInitializeEvents); + /* If Hardware Reduced flag is set, there are no fixed events */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* * Initialize the Fixed and General Purpose Events. This is done prior to * enabling SCIs to prevent interrupts from occurring before the handlers @@ -200,6 +209,13 @@ AcpiEvInstallXruptHandlers ( ACPI_FUNCTION_TRACE (EvInstallXruptHandlers); + /* If Hardware Reduced flag is set, there is no ACPI h/w */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* Install the SCI handler */ Status = AcpiEvInstallSciHandler (); @@ -347,6 +363,8 @@ AcpiEvFixedEventDetect ( * * DESCRIPTION: Clears the status bit for the requested event, calls the * handler that previously registered for the event. + * NOTE: If there is no handler for the event, the event is + * disabled to prevent further interrupts. * ******************************************************************************/ @@ -365,18 +383,18 @@ AcpiEvFixedEventDispatch ( ACPI_CLEAR_STATUS); /* - * Make sure we've got a handler. If not, report an error. The event is - * disabled to prevent further interrupts. + * Make sure that a handler exists. If not, report an error + * and disable the event to prevent further interrupts. */ - if (NULL == AcpiGbl_FixedEventHandlers[Event].Handler) + if (!AcpiGbl_FixedEventHandlers[Event].Handler) { (void) AcpiWriteBitRegister ( AcpiGbl_FixedEventInfo[Event].EnableRegisterId, ACPI_DISABLE_EVENT); ACPI_ERROR ((AE_INFO, - "No installed handler for fixed event [0x%08X]", - Event)); + "No installed handler for fixed event - %s (%u), disabling", + AcpiUtGetEventName (Event), Event)); return (ACPI_INTERRUPT_NOT_HANDLED); } @@ -387,4 +405,4 @@ AcpiEvFixedEventDispatch ( AcpiGbl_FixedEventHandlers[Event].Context)); } - +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evglock.c b/reactos/drivers/bus/acpi/acpica/events/evglock.c index a7a585a0ebd..fa1954aaff5 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evglock.c +++ b/reactos/drivers/bus/acpi/acpica/events/evglock.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,6 +121,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evglock") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /* Local prototypes */ @@ -151,6 +152,13 @@ AcpiEvInitGlobalLockHandler ( ACPI_FUNCTION_TRACE (EvInitGlobalLockHandler); + /* If Hardware Reduced flag is set, there is no global lock */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* Attempt installation of the global lock handler */ Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL, @@ -208,6 +216,7 @@ AcpiEvRemoveGlobalLockHandler ( Status = AcpiRemoveFixedEventHandler (ACPI_EVENT_GLOBAL, AcpiEvGlobalLockHandler); + AcpiOsDeleteLock (AcpiGbl_GlobalLockPendingLock); return_ACPI_STATUS (Status); } @@ -437,3 +446,5 @@ AcpiEvReleaseGlobalLock ( AcpiOsReleaseMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex); return_ACPI_STATUS (Status); } + +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evgpe.c b/reactos/drivers/bus/acpi/acpica/events/evgpe.c index 59e5d55879e..d27fd80299a 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evgpe.c +++ b/reactos/drivers/bus/acpi/acpica/events/evgpe.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,6 +121,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpe") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static void ACPI_SYSTEM_XFACE @@ -162,7 +164,7 @@ AcpiEvUpdateGpeEnableMask ( return_ACPI_STATUS (AE_NOT_EXIST); } - RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo); + RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); /* Clear the run bit up front */ @@ -501,6 +503,13 @@ AcpiEvGpeDetect ( if (!(GpeRegisterInfo->EnableForRun | GpeRegisterInfo->EnableForWake)) { + ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, + "Ignore disabled registers for GPE%02X-GPE%02X: " + "RunEnable=%02X, WakeEnable=%02X\n", + GpeRegisterInfo->BaseGpeNumber, + GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1), + GpeRegisterInfo->EnableForRun, + GpeRegisterInfo->EnableForWake)); continue; } @@ -521,8 +530,13 @@ AcpiEvGpeDetect ( } ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS, - "Read GPE Register at GPE%02X: Status=%02X, Enable=%02X\n", - GpeRegisterInfo->BaseGpeNumber, StatusReg, EnableReg)); + "Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, " + "RunEnable=%02X, WakeEnable=%02X\n", + GpeRegisterInfo->BaseGpeNumber, + GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1), + StatusReg, EnableReg, + GpeRegisterInfo->EnableForRun, + GpeRegisterInfo->EnableForWake)); /* Check if there is anything active at all in this register */ @@ -588,6 +602,7 @@ AcpiEvAsynchExecuteGpeMethod ( ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *LocalGpeEventInfo; ACPI_EVALUATE_INFO *Info; + ACPI_GPE_NOTIFY_INFO *Notify; ACPI_FUNCTION_TRACE (EvAsynchExecuteGpeMethod); @@ -606,6 +621,7 @@ AcpiEvAsynchExecuteGpeMethod ( Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); if (ACPI_FAILURE (Status)) { + ACPI_FREE (LocalGpeEventInfo); return_VOID; } @@ -614,6 +630,7 @@ AcpiEvAsynchExecuteGpeMethod ( if (!AcpiEvValidGpeEvent (GpeEventInfo)) { Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS); + ACPI_FREE (LocalGpeEventInfo); return_VOID; } @@ -627,6 +644,7 @@ AcpiEvAsynchExecuteGpeMethod ( Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS); if (ACPI_FAILURE (Status)) { + ACPI_FREE (LocalGpeEventInfo); return_VOID; } @@ -635,7 +653,6 @@ AcpiEvAsynchExecuteGpeMethod ( switch (LocalGpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) { case ACPI_GPE_DISPATCH_NOTIFY: - /* * Implicit notify. * Dispatch a DEVICE_WAKE notify to the appropriate handler. @@ -643,10 +660,18 @@ AcpiEvAsynchExecuteGpeMethod ( * completes. The notify handlers are NOT invoked synchronously * from this thread -- because handlers may in turn run other * control methods. + * + * June 2012: Expand implicit notify mechanism to support + * notifies on multiple device objects. */ - Status = AcpiEvQueueNotifyRequest ( - LocalGpeEventInfo->Dispatch.DeviceNode, - ACPI_NOTIFY_DEVICE_WAKE); + Notify = LocalGpeEventInfo->Dispatch.NotifyList; + while (ACPI_SUCCESS (Status) && Notify) + { + Status = AcpiEvQueueNotifyRequest (Notify->DeviceNode, + ACPI_NOTIFY_DEVICE_WAKE); + + Notify = Notify->Next; + } break; case ACPI_GPE_DISPATCH_METHOD: @@ -677,10 +702,10 @@ AcpiEvAsynchExecuteGpeMethod ( "while evaluating GPE method [%4.4s]", AcpiUtGetNodeName (LocalGpeEventInfo->Dispatch.MethodNode))); } - break; default: + return_VOID; /* Should never happen */ } @@ -867,7 +892,6 @@ AcpiEvGpeDispatch ( case ACPI_GPE_DISPATCH_METHOD: case ACPI_GPE_DISPATCH_NOTIFY: - /* * Execute the method associated with the GPE * NOTE: Level-triggered GPEs are cleared after the method completes. @@ -883,7 +907,6 @@ AcpiEvGpeDispatch ( break; default: - /* * No handler or method to run! * 03/2010: This case should no longer be possible. We will not allow @@ -898,3 +921,4 @@ AcpiEvGpeDispatch ( return_UINT32 (ACPI_INTERRUPT_HANDLED); } +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evgpeblk.c b/reactos/drivers/bus/acpi/acpica/events/evgpeblk.c index c3ea571ca4e..f1a5b1b5d27 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evgpeblk.c +++ b/reactos/drivers/bus/acpi/acpica/events/evgpeblk.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,6 +121,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpeblk") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static ACPI_STATUS @@ -167,10 +169,9 @@ AcpiEvInstallGpeBlock ( return_ACPI_STATUS (Status); } - GpeXruptBlock = AcpiEvGetGpeXruptBlock (InterruptNumber); - if (!GpeXruptBlock) + Status = AcpiEvGetGpeXruptBlock (InterruptNumber, &GpeXruptBlock); + if (ACPI_FAILURE (Status)) { - Status = AE_NO_MEMORY; goto UnlockAndExit; } @@ -198,7 +199,7 @@ AcpiEvInstallGpeBlock ( UnlockAndExit: - Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS); + (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); return_ACPI_STATUS (Status); } @@ -490,6 +491,8 @@ AcpiEvCreateGpeBlock ( Status = AcpiEvInstallGpeBlock (GpeBlock, InterruptNumber); if (ACPI_FAILURE (Status)) { + ACPI_FREE (GpeBlock->RegisterInfo); + ACPI_FREE (GpeBlock->EventInfo); ACPI_FREE (GpeBlock); return_ACPI_STATUS (Status); } @@ -513,8 +516,8 @@ AcpiEvCreateGpeBlock ( (*ReturnGpeBlock) = GpeBlock; } - ACPI_DEBUG_PRINT ((ACPI_DB_INIT, - "GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n", + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, + " Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X\n", (UINT32) GpeBlock->BlockBaseNumber, (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)), GpeDevice->Name.Ascii, GpeBlock->RegisterCount, @@ -609,11 +612,14 @@ AcpiEvInitializeGpeBlock ( if (GpeEnabledCount) { - ACPI_DEBUG_PRINT ((ACPI_DB_INIT, - "Enabled %u GPEs in this block\n", GpeEnabledCount)); + ACPI_INFO ((AE_INFO, + "Enabled %u GPEs in block %02X to %02X", GpeEnabledCount, + (UINT32) GpeBlock->BlockBaseNumber, + (UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)))); } GpeBlock->Initialized = TRUE; return_ACPI_STATUS (AE_OK); } +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evgpeinit.c b/reactos/drivers/bus/acpi/acpica/events/evgpeinit.c index 8bba11166c3..6bf32ff130a 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evgpeinit.c +++ b/reactos/drivers/bus/acpi/acpica/events/evgpeinit.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -122,6 +122,7 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evgpeinit") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /* * Note: History of _PRW support in ACPICA @@ -165,6 +166,9 @@ AcpiEvGpeInitialize ( ACPI_FUNCTION_TRACE (EvGpeInitialize); + ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, + "Initializing General Purpose Events (GPEs):\n")); + Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { @@ -202,7 +206,6 @@ AcpiEvGpeInitialize ( /* GPE block 0 exists (has both length and address > 0) */ RegisterCount0 = (UINT16) (AcpiGbl_FADT.Gpe0BlockLength / 2); - GpeNumberMax = (RegisterCount0 * ACPI_GPE_REGISTER_WIDTH) - 1; /* Install GPE Block 0 */ @@ -277,16 +280,6 @@ AcpiEvGpeInitialize ( goto Cleanup; } - /* Check for Max GPE number out-of-range */ - - if (GpeNumberMax > ACPI_GPE_MAX) - { - ACPI_ERROR ((AE_INFO, - "Maximum GPE number from FADT is too large: 0x%X", - GpeNumberMax)); - Status = AE_BAD_VALUE; - goto Cleanup; - } Cleanup: (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); @@ -450,14 +443,17 @@ AcpiEvMatchGpeMethod ( switch (Name[1]) { case 'L': + Type = ACPI_GPE_LEVEL_TRIGGERED; break; case 'E': + Type = ACPI_GPE_EDGE_TRIGGERED; break; default: + /* Unknown method type, just ignore it */ ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, @@ -529,3 +525,5 @@ AcpiEvMatchGpeMethod ( Name, GpeNumber)); return_ACPI_STATUS (AE_OK); } + +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evgpeutil.c b/reactos/drivers/bus/acpi/acpica/events/evgpeutil.c index eb422a17c61..0410bae57f0 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evgpeutil.c +++ b/reactos/drivers/bus/acpi/acpica/events/evgpeutil.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -113,7 +113,6 @@ * *****************************************************************************/ - #include "acpi.h" #include "accommon.h" #include "acevents.h" @@ -122,6 +121,7 @@ ACPI_MODULE_NAME ("evgpeutil") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: AcpiEvWalkGpeList @@ -288,9 +288,10 @@ AcpiEvGetGpeDevice ( * * FUNCTION: AcpiEvGetGpeXruptBlock * - * PARAMETERS: InterruptNumber - Interrupt for a GPE block + * PARAMETERS: InterruptNumber - Interrupt for a GPE block + * GpeXruptBlock - Where the block is returned * - * RETURN: A GPE interrupt block + * RETURN: Status * * DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt * block per unique interrupt level used for GPEs. Should be @@ -299,9 +300,10 @@ AcpiEvGetGpeDevice ( * ******************************************************************************/ -ACPI_GPE_XRUPT_INFO * +ACPI_STATUS AcpiEvGetGpeXruptBlock ( - UINT32 InterruptNumber) + UINT32 InterruptNumber, + ACPI_GPE_XRUPT_INFO **GpeXruptBlock) { ACPI_GPE_XRUPT_INFO *NextGpeXrupt; ACPI_GPE_XRUPT_INFO *GpeXrupt; @@ -319,7 +321,8 @@ AcpiEvGetGpeXruptBlock ( { if (NextGpeXrupt->InterruptNumber == InterruptNumber) { - return_PTR (NextGpeXrupt); + *GpeXruptBlock = NextGpeXrupt; + return_ACPI_STATUS (AE_OK); } NextGpeXrupt = NextGpeXrupt->Next; @@ -330,7 +333,7 @@ AcpiEvGetGpeXruptBlock ( GpeXrupt = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_XRUPT_INFO)); if (!GpeXrupt) { - return_PTR (NULL); + return_ACPI_STATUS (AE_NO_MEMORY); } GpeXrupt->InterruptNumber = InterruptNumber; @@ -353,6 +356,7 @@ AcpiEvGetGpeXruptBlock ( { AcpiGbl_GpeXruptListHead = GpeXrupt; } + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); /* Install new interrupt handler if not SCI_INT */ @@ -363,14 +367,15 @@ AcpiEvGetGpeXruptBlock ( AcpiEvGpeXruptHandler, GpeXrupt); if (ACPI_FAILURE (Status)) { - ACPI_ERROR ((AE_INFO, + ACPI_EXCEPTION ((AE_INFO, Status, "Could not install GPE interrupt handler at level 0x%X", InterruptNumber)); - return_PTR (NULL); + return_ACPI_STATUS (Status); } } - return_PTR (GpeXrupt); + *GpeXruptBlock = GpeXrupt; + return_ACPI_STATUS (AE_OK); } @@ -463,6 +468,8 @@ AcpiEvDeleteGpeHandlers ( void *Context) { ACPI_GPE_EVENT_INFO *GpeEventInfo; + ACPI_GPE_NOTIFY_INFO *Notify; + ACPI_GPE_NOTIFY_INFO *Next; UINT32 i; UINT32 j; @@ -484,13 +491,31 @@ AcpiEvDeleteGpeHandlers ( if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) { + /* Delete an installed handler block */ + ACPI_FREE (GpeEventInfo->Dispatch.Handler); GpeEventInfo->Dispatch.Handler = NULL; GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK; } + else if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == + ACPI_GPE_DISPATCH_NOTIFY) + { + /* Delete the implicit notification device list */ + + Notify = GpeEventInfo->Dispatch.NotifyList; + while (Notify) + { + Next = Notify->Next; + ACPI_FREE (Notify); + Notify = Next; + } + GpeEventInfo->Dispatch.NotifyList = NULL; + GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK; + } } } return_ACPI_STATUS (AE_OK); } +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evhandler.c b/reactos/drivers/bus/acpi/acpica/events/evhandler.c new file mode 100644 index 00000000000..d17411e942f --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/events/evhandler.c @@ -0,0 +1,657 @@ +/****************************************************************************** + * + * Module Name: evhandler - Support for Address Space handlers + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#define __EVHANDLER_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acevents.h" +#include "acnamesp.h" +#include "acinterp.h" + +#define _COMPONENT ACPI_EVENTS + ACPI_MODULE_NAME ("evhandler") + + +/* Local prototypes */ + +static ACPI_STATUS +AcpiEvInstallHandler ( + ACPI_HANDLE ObjHandle, + UINT32 Level, + void *Context, + void **ReturnValue); + +/* These are the address spaces that will get default handlers */ + +UINT8 AcpiGbl_DefaultAddressSpaces[ACPI_NUM_DEFAULT_SPACES] = +{ + ACPI_ADR_SPACE_SYSTEM_MEMORY, + ACPI_ADR_SPACE_SYSTEM_IO, + ACPI_ADR_SPACE_PCI_CONFIG, + ACPI_ADR_SPACE_DATA_TABLE +}; + + +/******************************************************************************* + * + * FUNCTION: AcpiEvInstallRegionHandlers + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Installs the core subsystem default address space handlers. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiEvInstallRegionHandlers ( + void) +{ + ACPI_STATUS Status; + UINT32 i; + + + ACPI_FUNCTION_TRACE (EvInstallRegionHandlers); + + + Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* + * All address spaces (PCI Config, EC, SMBus) are scope dependent and + * registration must occur for a specific device. + * + * In the case of the system memory and IO address spaces there is + * currently no device associated with the address space. For these we + * use the root. + * + * We install the default PCI config space handler at the root so that + * this space is immediately available even though the we have not + * enumerated all the PCI Root Buses yet. This is to conform to the ACPI + * specification which states that the PCI config space must be always + * available -- even though we are nowhere near ready to find the PCI root + * buses at this point. + * + * NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler + * has already been installed (via AcpiInstallAddressSpaceHandler). + * Similar for AE_SAME_HANDLER. + */ + for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) + { + Status = AcpiEvInstallSpaceHandler (AcpiGbl_RootNode, + AcpiGbl_DefaultAddressSpaces[i], + ACPI_DEFAULT_HANDLER, NULL, NULL); + switch (Status) + { + case AE_OK: + case AE_SAME_HANDLER: + case AE_ALREADY_EXISTS: + + /* These exceptions are all OK */ + + Status = AE_OK; + break; + + default: + + goto UnlockAndExit; + } + } + +UnlockAndExit: + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiEvHasDefaultHandler + * + * PARAMETERS: Node - Namespace node for the device + * SpaceId - The address space ID + * + * RETURN: TRUE if default handler is installed, FALSE otherwise + * + * DESCRIPTION: Check if the default handler is installed for the requested + * space ID. + * + ******************************************************************************/ + +BOOLEAN +AcpiEvHasDefaultHandler ( + ACPI_NAMESPACE_NODE *Node, + ACPI_ADR_SPACE_TYPE SpaceId) +{ + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *HandlerObj; + + + /* Must have an existing internal object */ + + ObjDesc = AcpiNsGetAttachedObject (Node); + if (ObjDesc) + { + HandlerObj = ObjDesc->Device.Handler; + + /* Walk the linked list of handlers for this object */ + + while (HandlerObj) + { + if (HandlerObj->AddressSpace.SpaceId == SpaceId) + { + if (HandlerObj->AddressSpace.HandlerFlags & + ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) + { + return (TRUE); + } + } + + HandlerObj = HandlerObj->AddressSpace.Next; + } + } + + return (FALSE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiEvInstallHandler + * + * PARAMETERS: WalkNamespace callback + * + * DESCRIPTION: This routine installs an address handler into objects that are + * of type Region or Device. + * + * If the Object is a Device, and the device has a handler of + * the same type then the search is terminated in that branch. + * + * This is because the existing handler is closer in proximity + * to any more regions than the one we are trying to install. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiEvInstallHandler ( + ACPI_HANDLE ObjHandle, + UINT32 Level, + void *Context, + void **ReturnValue) +{ + ACPI_OPERAND_OBJECT *HandlerObj; + ACPI_OPERAND_OBJECT *NextHandlerObj; + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_NAMESPACE_NODE *Node; + ACPI_STATUS Status; + + + ACPI_FUNCTION_NAME (EvInstallHandler); + + + HandlerObj = (ACPI_OPERAND_OBJECT *) Context; + + /* Parameter validation */ + + if (!HandlerObj) + { + return (AE_OK); + } + + /* Convert and validate the device handle */ + + Node = AcpiNsValidateHandle (ObjHandle); + if (!Node) + { + return (AE_BAD_PARAMETER); + } + + /* + * We only care about regions and objects that are allowed to have + * address space handlers + */ + if ((Node->Type != ACPI_TYPE_DEVICE) && + (Node->Type != ACPI_TYPE_REGION) && + (Node != AcpiGbl_RootNode)) + { + return (AE_OK); + } + + /* Check for an existing internal object */ + + ObjDesc = AcpiNsGetAttachedObject (Node); + if (!ObjDesc) + { + /* No object, just exit */ + + return (AE_OK); + } + + /* Devices are handled different than regions */ + + if (ObjDesc->Common.Type == ACPI_TYPE_DEVICE) + { + /* Check if this Device already has a handler for this address space */ + + NextHandlerObj = ObjDesc->Device.Handler; + while (NextHandlerObj) + { + /* Found a handler, is it for the same address space? */ + + if (NextHandlerObj->AddressSpace.SpaceId == + HandlerObj->AddressSpace.SpaceId) + { + ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, + "Found handler for region [%s] in device %p(%p) " + "handler %p\n", + AcpiUtGetRegionName (HandlerObj->AddressSpace.SpaceId), + ObjDesc, NextHandlerObj, HandlerObj)); + + /* + * Since the object we found it on was a device, then it + * means that someone has already installed a handler for + * the branch of the namespace from this device on. Just + * bail out telling the walk routine to not traverse this + * branch. This preserves the scoping rule for handlers. + */ + return (AE_CTRL_DEPTH); + } + + /* Walk the linked list of handlers attached to this device */ + + NextHandlerObj = NextHandlerObj->AddressSpace.Next; + } + + /* + * As long as the device didn't have a handler for this space we + * don't care about it. We just ignore it and proceed. + */ + return (AE_OK); + } + + /* Object is a Region */ + + if (ObjDesc->Region.SpaceId != HandlerObj->AddressSpace.SpaceId) + { + /* This region is for a different address space, just ignore it */ + + return (AE_OK); + } + + /* + * Now we have a region and it is for the handler's address space type. + * + * First disconnect region for any previous handler (if any) + */ + AcpiEvDetachRegion (ObjDesc, FALSE); + + /* Connect the region to the new handler */ + + Status = AcpiEvAttachRegion (HandlerObj, ObjDesc, FALSE); + return (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiEvInstallSpaceHandler + * + * PARAMETERS: Node - Namespace node for the device + * SpaceId - The address space ID + * Handler - Address of the handler + * Setup - Address of the setup function + * Context - Value passed to the handler on each access + * + * RETURN: Status + * + * DESCRIPTION: Install a handler for all OpRegions of a given SpaceId. + * Assumes namespace is locked + * + ******************************************************************************/ + +ACPI_STATUS +AcpiEvInstallSpaceHandler ( + ACPI_NAMESPACE_NODE *Node, + ACPI_ADR_SPACE_TYPE SpaceId, + ACPI_ADR_SPACE_HANDLER Handler, + ACPI_ADR_SPACE_SETUP Setup, + void *Context) +{ + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *HandlerObj; + ACPI_STATUS Status; + ACPI_OBJECT_TYPE Type; + UINT8 Flags = 0; + + + ACPI_FUNCTION_TRACE (EvInstallSpaceHandler); + + + /* + * This registration is valid for only the types below and the root. This + * is where the default handlers get placed. + */ + if ((Node->Type != ACPI_TYPE_DEVICE) && + (Node->Type != ACPI_TYPE_PROCESSOR) && + (Node->Type != ACPI_TYPE_THERMAL) && + (Node != AcpiGbl_RootNode)) + { + Status = AE_BAD_PARAMETER; + goto UnlockAndExit; + } + + if (Handler == ACPI_DEFAULT_HANDLER) + { + Flags = ACPI_ADDR_HANDLER_DEFAULT_INSTALLED; + + switch (SpaceId) + { + case ACPI_ADR_SPACE_SYSTEM_MEMORY: + + Handler = AcpiExSystemMemorySpaceHandler; + Setup = AcpiEvSystemMemoryRegionSetup; + break; + + case ACPI_ADR_SPACE_SYSTEM_IO: + + Handler = AcpiExSystemIoSpaceHandler; + Setup = AcpiEvIoSpaceRegionSetup; + break; + + case ACPI_ADR_SPACE_PCI_CONFIG: + + Handler = AcpiExPciConfigSpaceHandler; + Setup = AcpiEvPciConfigRegionSetup; + break; + + case ACPI_ADR_SPACE_CMOS: + + Handler = AcpiExCmosSpaceHandler; + Setup = AcpiEvCmosRegionSetup; + break; + + case ACPI_ADR_SPACE_PCI_BAR_TARGET: + + Handler = AcpiExPciBarSpaceHandler; + Setup = AcpiEvPciBarRegionSetup; + break; + + case ACPI_ADR_SPACE_DATA_TABLE: + + Handler = AcpiExDataTableSpaceHandler; + Setup = NULL; + break; + + default: + + Status = AE_BAD_PARAMETER; + goto UnlockAndExit; + } + } + + /* If the caller hasn't specified a setup routine, use the default */ + + if (!Setup) + { + Setup = AcpiEvDefaultRegionSetup; + } + + /* Check for an existing internal object */ + + ObjDesc = AcpiNsGetAttachedObject (Node); + if (ObjDesc) + { + /* + * The attached device object already exists. Make sure the handler + * is not already installed. + */ + HandlerObj = ObjDesc->Device.Handler; + + /* Walk the handler list for this device */ + + while (HandlerObj) + { + /* Same SpaceId indicates a handler already installed */ + + if (HandlerObj->AddressSpace.SpaceId == SpaceId) + { + if (HandlerObj->AddressSpace.Handler == Handler) + { + /* + * It is (relatively) OK to attempt to install the SAME + * handler twice. This can easily happen with the + * PCI_Config space. + */ + Status = AE_SAME_HANDLER; + goto UnlockAndExit; + } + else + { + /* A handler is already installed */ + + Status = AE_ALREADY_EXISTS; + } + goto UnlockAndExit; + } + + /* Walk the linked list of handlers */ + + HandlerObj = HandlerObj->AddressSpace.Next; + } + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, + "Creating object on Device %p while installing handler\n", Node)); + + /* ObjDesc does not exist, create one */ + + if (Node->Type == ACPI_TYPE_ANY) + { + Type = ACPI_TYPE_DEVICE; + } + else + { + Type = Node->Type; + } + + ObjDesc = AcpiUtCreateInternalObject (Type); + if (!ObjDesc) + { + Status = AE_NO_MEMORY; + goto UnlockAndExit; + } + + /* Init new descriptor */ + + ObjDesc->Common.Type = (UINT8) Type; + + /* Attach the new object to the Node */ + + Status = AcpiNsAttachObject (Node, ObjDesc, Type); + + /* Remove local reference to the object */ + + AcpiUtRemoveReference (ObjDesc); + + if (ACPI_FAILURE (Status)) + { + goto UnlockAndExit; + } + } + + ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, + "Installing address handler for region %s(%X) on Device %4.4s %p(%p)\n", + AcpiUtGetRegionName (SpaceId), SpaceId, + AcpiUtGetNodeName (Node), Node, ObjDesc)); + + /* + * Install the handler + * + * At this point there is no existing handler. Just allocate the object + * for the handler and link it into the list. + */ + HandlerObj = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_ADDRESS_HANDLER); + if (!HandlerObj) + { + Status = AE_NO_MEMORY; + goto UnlockAndExit; + } + + /* Init handler obj */ + + HandlerObj->AddressSpace.SpaceId = (UINT8) SpaceId; + HandlerObj->AddressSpace.HandlerFlags = Flags; + HandlerObj->AddressSpace.RegionList = NULL; + HandlerObj->AddressSpace.Node = Node; + HandlerObj->AddressSpace.Handler = Handler; + HandlerObj->AddressSpace.Context = Context; + HandlerObj->AddressSpace.Setup = Setup; + + /* Install at head of Device.AddressSpace list */ + + HandlerObj->AddressSpace.Next = ObjDesc->Device.Handler; + + /* + * The Device object is the first reference on the HandlerObj. + * Each region that uses the handler adds a reference. + */ + ObjDesc->Device.Handler = HandlerObj; + + /* + * Walk the namespace finding all of the regions this + * handler will manage. + * + * Start at the device and search the branch toward + * the leaf nodes until either the leaf is encountered or + * a device is detected that has an address handler of the + * same type. + * + * In either case, back up and search down the remainder + * of the branch + */ + Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, + ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, NULL, + HandlerObj, NULL); + +UnlockAndExit: + return_ACPI_STATUS (Status); +} diff --git a/reactos/drivers/bus/acpi/acpica/events/evmisc.c b/reactos/drivers/bus/acpi/acpica/events/evmisc.c index 69d6c79ded2..8b2c3ff46f5 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evmisc.c +++ b/reactos/drivers/bus/acpi/acpica/events/evmisc.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -158,6 +158,7 @@ AcpiEvIsNotifyObject ( return (TRUE); default: + return (FALSE); } } @@ -183,105 +184,82 @@ AcpiEvQueueNotifyRequest ( UINT32 NotifyValue) { ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_OPERAND_OBJECT *HandlerObj = NULL; - ACPI_GENERIC_STATE *NotifyInfo; + ACPI_OPERAND_OBJECT *HandlerListHead = NULL; + ACPI_GENERIC_STATE *Info; + UINT8 HandlerListId = 0; ACPI_STATUS Status = AE_OK; ACPI_FUNCTION_NAME (EvQueueNotifyRequest); - /* - * For value 3 (Ejection Request), some device method may need to be run. - * For value 2 (Device Wake) if _PRW exists, the _PS0 method may need - * to be run. - * For value 0x80 (Status Change) on the power button or sleep button, - * initiate soft-off or sleep operation? - */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Dispatching Notify on [%4.4s] Node %p Value 0x%2.2X (%s)\n", - AcpiUtGetNodeName (Node), Node, NotifyValue, - AcpiUtGetNotifyName (NotifyValue))); + /* Are Notifies allowed on this object? */ - /* Get the notify object attached to the NS Node */ + if (!AcpiEvIsNotifyObject (Node)) + { + return (AE_TYPE); + } + + /* Get the correct notify list type (System or Device) */ + + if (NotifyValue <= ACPI_MAX_SYS_NOTIFY) + { + HandlerListId = ACPI_SYSTEM_HANDLER_LIST; + } + else + { + HandlerListId = ACPI_DEVICE_HANDLER_LIST; + } + + /* Get the notify object attached to the namespace Node */ ObjDesc = AcpiNsGetAttachedObject (Node); if (ObjDesc) { - /* We have the notify object, Get the right handler */ + /* We have an attached object, Get the correct handler list */ - switch (Node->Type) - { - /* Notify allowed only on these types */ - - case ACPI_TYPE_DEVICE: - case ACPI_TYPE_THERMAL: - case ACPI_TYPE_PROCESSOR: - - if (NotifyValue <= ACPI_MAX_SYS_NOTIFY) - { - HandlerObj = ObjDesc->CommonNotify.SystemNotify; - } - else - { - HandlerObj = ObjDesc->CommonNotify.DeviceNotify; - } - break; - - default: - - /* All other types are not supported */ - - return (AE_TYPE); - } + HandlerListHead = ObjDesc->CommonNotify.NotifyList[HandlerListId]; } /* - * If there is any handler to run, schedule the dispatcher. - * Check for: - * 1) Global system notify handler - * 2) Global device notify handler - * 3) Per-device notify handler + * If there is no notify handler (Global or Local) + * for this object, just ignore the notify */ - if ((AcpiGbl_SystemNotify.Handler && - (NotifyValue <= ACPI_MAX_SYS_NOTIFY)) || - (AcpiGbl_DeviceNotify.Handler && - (NotifyValue > ACPI_MAX_SYS_NOTIFY)) || - HandlerObj) + if (!AcpiGbl_GlobalNotify[HandlerListId].Handler && !HandlerListHead) { - NotifyInfo = AcpiUtCreateGenericState (); - if (!NotifyInfo) - { - return (AE_NO_MEMORY); - } - - if (!HandlerObj) - { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Executing system notify handler for Notify (%4.4s, %X) " - "node %p\n", - AcpiUtGetNodeName (Node), NotifyValue, Node)); - } - - NotifyInfo->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY; - NotifyInfo->Notify.Node = Node; - NotifyInfo->Notify.Value = (UINT16) NotifyValue; - NotifyInfo->Notify.HandlerObj = HandlerObj; - - Status = AcpiOsExecute ( - OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch, NotifyInfo); - if (ACPI_FAILURE (Status)) - { - AcpiUtDeleteGenericState (NotifyInfo); - } - } - else - { - /* There is no notify handler (per-device or system) for this device */ - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "No notify handler for Notify (%4.4s, %X) node %p\n", + "No notify handler for Notify, ignoring (%4.4s, %X) node %p\n", AcpiUtGetNodeName (Node), NotifyValue, Node)); + + return (AE_OK); + } + + /* Setup notify info and schedule the notify dispatcher */ + + Info = AcpiUtCreateGenericState (); + if (!Info) + { + return (AE_NO_MEMORY); + } + + Info->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY; + + Info->Notify.Node = Node; + Info->Notify.Value = (UINT16) NotifyValue; + Info->Notify.HandlerListId = HandlerListId; + Info->Notify.HandlerListHead = HandlerListHead; + Info->Notify.Global = &AcpiGbl_GlobalNotify[HandlerListId]; + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n", + AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type), + NotifyValue, AcpiUtGetNotifyName (NotifyValue, ACPI_TYPE_ANY), Node)); + + Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch, + Info); + if (ACPI_FAILURE (Status)) + { + AcpiUtDeleteGenericState (Info); } return (Status); @@ -305,64 +283,41 @@ static void ACPI_SYSTEM_XFACE AcpiEvNotifyDispatch ( void *Context) { - ACPI_GENERIC_STATE *NotifyInfo = (ACPI_GENERIC_STATE *) Context; - ACPI_NOTIFY_HANDLER GlobalHandler = NULL; - void *GlobalContext = NULL; + ACPI_GENERIC_STATE *Info = (ACPI_GENERIC_STATE *) Context; ACPI_OPERAND_OBJECT *HandlerObj; ACPI_FUNCTION_ENTRY (); - /* - * We will invoke a global notify handler if installed. This is done - * _before_ we invoke the per-device handler attached to the device. - */ - if (NotifyInfo->Notify.Value <= ACPI_MAX_SYS_NOTIFY) - { - /* Global system notification handler */ + /* Invoke a global notify handler if installed */ - if (AcpiGbl_SystemNotify.Handler) - { - GlobalHandler = AcpiGbl_SystemNotify.Handler; - GlobalContext = AcpiGbl_SystemNotify.Context; - } - } - else + if (Info->Notify.Global->Handler) { - /* Global driver notification handler */ - - if (AcpiGbl_DeviceNotify.Handler) - { - GlobalHandler = AcpiGbl_DeviceNotify.Handler; - GlobalContext = AcpiGbl_DeviceNotify.Context; - } + Info->Notify.Global->Handler (Info->Notify.Node, + Info->Notify.Value, + Info->Notify.Global->Context); } - /* Invoke the system handler first, if present */ + /* Now invoke the local notify handler(s) if any are installed */ - if (GlobalHandler) + HandlerObj = Info->Notify.HandlerListHead; + while (HandlerObj) { - GlobalHandler (NotifyInfo->Notify.Node, NotifyInfo->Notify.Value, - GlobalContext); - } - - /* Now invoke the per-device handler, if present */ - - HandlerObj = NotifyInfo->Notify.HandlerObj; - if (HandlerObj) - { - HandlerObj->Notify.Handler (NotifyInfo->Notify.Node, - NotifyInfo->Notify.Value, + HandlerObj->Notify.Handler (Info->Notify.Node, + Info->Notify.Value, HandlerObj->Notify.Context); + + HandlerObj = HandlerObj->Notify.Next[Info->Notify.HandlerListId]; } /* All done with the info object */ - AcpiUtDeleteGenericState (NotifyInfo); + AcpiUtDeleteGenericState (Info); } +#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * * FUNCTION: AcpiEvTerminate @@ -409,21 +364,23 @@ AcpiEvTerminate ( Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL); - /* Remove SCI handler */ - - Status = AcpiEvRemoveSciHandler (); - if (ACPI_FAILURE(Status)) - { - ACPI_ERROR ((AE_INFO, - "Could not remove SCI handler")); - } - Status = AcpiEvRemoveGlobalLockHandler (); if (ACPI_FAILURE(Status)) { ACPI_ERROR ((AE_INFO, "Could not remove Global Lock handler")); } + + AcpiGbl_EventsInitialized = FALSE; + } + + /* Remove SCI handlers */ + + Status = AcpiEvRemoveAllSciHandlers (); + if (ACPI_FAILURE(Status)) + { + ACPI_ERROR ((AE_INFO, + "Could not remove SCI handler")); } /* Deallocate all handler objects installed within GPE info structs */ @@ -442,3 +399,5 @@ AcpiEvTerminate ( } return_VOID; } + +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evregion.c b/reactos/drivers/bus/acpi/acpica/events/evregion.c index bd50228df35..8f1b24b2ddf 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evregion.c +++ b/reactos/drivers/bus/acpi/acpica/events/evregion.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: evregion - ACPI AddressSpace (OpRegion) handler dispatch + * Module Name: evregion - Operation Region support * *****************************************************************************/ @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -126,16 +126,13 @@ ACPI_MODULE_NAME ("evregion") -/* Local prototypes */ +extern UINT8 AcpiGbl_DefaultAddressSpaces[]; -static BOOLEAN -AcpiEvHasDefaultHandler ( - ACPI_NAMESPACE_NODE *Node, - ACPI_ADR_SPACE_TYPE SpaceId); +/* Local prototypes */ static void AcpiEvOrphanEcRegMethod ( - void); + ACPI_NAMESPACE_NODE *EcDeviceNode); static ACPI_STATUS AcpiEvRegRun ( @@ -144,152 +141,6 @@ AcpiEvRegRun ( void *Context, void **ReturnValue); -static ACPI_STATUS -AcpiEvInstallHandler ( - ACPI_HANDLE ObjHandle, - UINT32 Level, - void *Context, - void **ReturnValue); - -/* These are the address spaces that will get default handlers */ - -#define ACPI_NUM_DEFAULT_SPACES 4 - -static UINT8 AcpiGbl_DefaultAddressSpaces[ACPI_NUM_DEFAULT_SPACES] = -{ - ACPI_ADR_SPACE_SYSTEM_MEMORY, - ACPI_ADR_SPACE_SYSTEM_IO, - ACPI_ADR_SPACE_PCI_CONFIG, - ACPI_ADR_SPACE_DATA_TABLE -}; - - -/******************************************************************************* - * - * FUNCTION: AcpiEvInstallRegionHandlers - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Installs the core subsystem default address space handlers. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiEvInstallRegionHandlers ( - void) -{ - ACPI_STATUS Status; - UINT32 i; - - - ACPI_FUNCTION_TRACE (EvInstallRegionHandlers); - - - Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* - * All address spaces (PCI Config, EC, SMBus) are scope dependent and - * registration must occur for a specific device. - * - * In the case of the system memory and IO address spaces there is - * currently no device associated with the address space. For these we - * use the root. - * - * We install the default PCI config space handler at the root so that - * this space is immediately available even though the we have not - * enumerated all the PCI Root Buses yet. This is to conform to the ACPI - * specification which states that the PCI config space must be always - * available -- even though we are nowhere near ready to find the PCI root - * buses at this point. - * - * NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler - * has already been installed (via AcpiInstallAddressSpaceHandler). - * Similar for AE_SAME_HANDLER. - */ - for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++) - { - Status = AcpiEvInstallSpaceHandler (AcpiGbl_RootNode, - AcpiGbl_DefaultAddressSpaces[i], - ACPI_DEFAULT_HANDLER, NULL, NULL); - switch (Status) - { - case AE_OK: - case AE_SAME_HANDLER: - case AE_ALREADY_EXISTS: - - /* These exceptions are all OK */ - - Status = AE_OK; - break; - - default: - - goto UnlockAndExit; - } - } - -UnlockAndExit: - (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiEvHasDefaultHandler - * - * PARAMETERS: Node - Namespace node for the device - * SpaceId - The address space ID - * - * RETURN: TRUE if default handler is installed, FALSE otherwise - * - * DESCRIPTION: Check if the default handler is installed for the requested - * space ID. - * - ******************************************************************************/ - -static BOOLEAN -AcpiEvHasDefaultHandler ( - ACPI_NAMESPACE_NODE *Node, - ACPI_ADR_SPACE_TYPE SpaceId) -{ - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_OPERAND_OBJECT *HandlerObj; - - - /* Must have an existing internal object */ - - ObjDesc = AcpiNsGetAttachedObject (Node); - if (ObjDesc) - { - HandlerObj = ObjDesc->Device.Handler; - - /* Walk the linked list of handlers for this object */ - - while (HandlerObj) - { - if (HandlerObj->AddressSpace.SpaceId == SpaceId) - { - if (HandlerObj->AddressSpace.HandlerFlags & - ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) - { - return (TRUE); - } - } - - HandlerObj = HandlerObj->AddressSpace.Next; - } - } - - return (FALSE); -} - /******************************************************************************* * @@ -345,105 +196,12 @@ AcpiEvInitializeOpRegions ( } -/******************************************************************************* - * - * FUNCTION: AcpiEvExecuteRegMethod - * - * PARAMETERS: RegionObj - Region object - * Function - Passed to _REG: On (1) or Off (0) - * - * RETURN: Status - * - * DESCRIPTION: Execute _REG method for a region - * - ******************************************************************************/ - -ACPI_STATUS -AcpiEvExecuteRegMethod ( - ACPI_OPERAND_OBJECT *RegionObj, - UINT32 Function) -{ - ACPI_EVALUATE_INFO *Info; - ACPI_OPERAND_OBJECT *Args[3]; - ACPI_OPERAND_OBJECT *RegionObj2; - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (EvExecuteRegMethod); - - - RegionObj2 = AcpiNsGetSecondaryObject (RegionObj); - if (!RegionObj2) - { - return_ACPI_STATUS (AE_NOT_EXIST); - } - - if (RegionObj2->Extra.Method_REG == NULL) - { - return_ACPI_STATUS (AE_OK); - } - - /* Allocate and initialize the evaluation information block */ - - Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO)); - if (!Info) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - Info->PrefixNode = RegionObj2->Extra.Method_REG; - Info->Pathname = NULL; - Info->Parameters = Args; - Info->Flags = ACPI_IGNORE_RETURN_VALUE; - - /* - * The _REG method has two arguments: - * - * Arg0 - Integer: - * Operation region space ID Same value as RegionObj->Region.SpaceId - * - * Arg1 - Integer: - * connection status 1 for connecting the handler, 0 for disconnecting - * the handler (Passed as a parameter) - */ - Args[0] = AcpiUtCreateIntegerObject ((UINT64) RegionObj->Region.SpaceId); - if (!Args[0]) - { - Status = AE_NO_MEMORY; - goto Cleanup1; - } - - Args[1] = AcpiUtCreateIntegerObject ((UINT64) Function); - if (!Args[1]) - { - Status = AE_NO_MEMORY; - goto Cleanup2; - } - - Args[2] = NULL; /* Terminate list */ - - /* Execute the method, no return value */ - - ACPI_DEBUG_EXEC ( - AcpiUtDisplayInitPathname (ACPI_TYPE_METHOD, Info->PrefixNode, NULL)); - - Status = AcpiNsEvaluate (Info); - AcpiUtRemoveReference (Args[1]); - -Cleanup2: - AcpiUtRemoveReference (Args[0]); - -Cleanup1: - ACPI_FREE (Info); - return_ACPI_STATUS (Status); -} - - /******************************************************************************* * * FUNCTION: AcpiEvAddressSpaceDispatch * * PARAMETERS: RegionObj - Internal region object + * FieldObj - Corresponding field. Can be NULL. * Function - Read or Write operation * RegionOffset - Where in the region to read or write * BitWidth - Field width in bits (8, 16, 32, or 64) @@ -460,6 +218,7 @@ Cleanup1: ACPI_STATUS AcpiEvAddressSpaceDispatch ( ACPI_OPERAND_OBJECT *RegionObj, + ACPI_OPERAND_OBJECT *FieldObj, UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, @@ -471,6 +230,7 @@ AcpiEvAddressSpaceDispatch ( ACPI_OPERAND_OBJECT *HandlerDesc; ACPI_OPERAND_OBJECT *RegionObj2; void *RegionContext = NULL; + ACPI_CONNECTION_INFO *Context; ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch); @@ -495,6 +255,8 @@ AcpiEvAddressSpaceDispatch ( return_ACPI_STATUS (AE_NOT_EXIST); } + Context = HandlerDesc->AddressSpace.Context; + /* * It may be the case that the region has never been initialized. * Some types of regions require special init code @@ -522,7 +284,7 @@ AcpiEvAddressSpaceDispatch ( AcpiExExitInterpreter (); Status = RegionSetup (RegionObj, ACPI_REGION_ACTIVATE, - HandlerDesc->AddressSpace.Context, &RegionContext); + Context, &RegionContext); /* Re-enter the interpreter */ @@ -544,18 +306,12 @@ AcpiEvAddressSpaceDispatch ( { RegionObj->Region.Flags |= AOPOBJ_SETUP_COMPLETE; - if (RegionObj2->Extra.RegionContext) + /* + * Save the returned context for use in all accesses to + * the handler for this particular region + */ + if (!(RegionObj2->Extra.RegionContext)) { - /* The handler for this region was already installed */ - - ACPI_FREE (RegionContext); - } - else - { - /* - * Save the returned context for use in all accesses to - * this particular region - */ RegionObj2->Extra.RegionContext = RegionContext; } } @@ -571,6 +327,26 @@ AcpiEvAddressSpaceDispatch ( ACPI_FORMAT_NATIVE_UINT (RegionObj->Region.Address + RegionOffset), AcpiUtGetRegionName (RegionObj->Region.SpaceId))); + /* + * Special handling for GenericSerialBus and GeneralPurposeIo: + * There are three extra parameters that must be passed to the + * handler via the context: + * 1) Connection buffer, a resource template from Connection() op. + * 2) Length of the above buffer. + * 3) Actual access length from the AccessAs() op. + */ + if (((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) || + (RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) && + Context && + FieldObj) + { + /* Get the Connection (ResourceTemplate) buffer */ + + Context->Connection = FieldObj->Field.ResourceBuffer; + Context->Length = FieldObj->Field.ResourceLength; + Context->AccessLength = FieldObj->Field.AccessLength; + } + if (!(HandlerDesc->AddressSpace.HandlerFlags & ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) { @@ -586,7 +362,7 @@ AcpiEvAddressSpaceDispatch ( Status = Handler (Function, (RegionObj->Region.Address + RegionOffset), BitWidth, Value, - HandlerDesc->AddressSpace.Context, RegionObj2->Extra.RegionContext); + Context, RegionObj2->Extra.RegionContext); if (ACPI_FAILURE (Status)) { @@ -629,6 +405,7 @@ AcpiEvDetachRegion( { ACPI_OPERAND_OBJECT *HandlerObj; ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *StartDesc; ACPI_OPERAND_OBJECT **LastObjPtr; ACPI_ADR_SPACE_SETUP RegionSetup; void **RegionContext; @@ -659,6 +436,7 @@ AcpiEvDetachRegion( /* Find this region in the handler's list */ ObjDesc = HandlerObj->AddressSpace.RegionList; + StartDesc = ObjDesc; LastObjPtr = &HandlerObj->AddressSpace.RegionList; while (ObjDesc) @@ -713,6 +491,15 @@ AcpiEvDetachRegion( Status = RegionSetup (RegionObj, ACPI_REGION_DEACTIVATE, HandlerObj->AddressSpace.Context, RegionContext); + /* + * RegionContext should have been released by the deactivate + * operation. We don't need access to it anymore here. + */ + if (RegionContext) + { + *RegionContext = NULL; + } + /* Init routine may fail, Just ignore errors */ if (ACPI_FAILURE (Status)) @@ -744,6 +531,16 @@ AcpiEvDetachRegion( LastObjPtr = &ObjDesc->Region.Next; ObjDesc = ObjDesc->Region.Next; + + /* Prevent infinite loop if list is corrupted */ + + if (ObjDesc == StartDesc) + { + ACPI_ERROR ((AE_INFO, + "Circular handler list in region object %p", + RegionObj)); + return_VOID; + } } /* If we get here, the region was not in the handler's region list */ @@ -808,377 +605,94 @@ AcpiEvAttachRegion ( /******************************************************************************* * - * FUNCTION: AcpiEvInstallHandler + * FUNCTION: AcpiEvExecuteRegMethod * - * PARAMETERS: WalkNamespace callback - * - * DESCRIPTION: This routine installs an address handler into objects that are - * of type Region or Device. - * - * If the Object is a Device, and the device has a handler of - * the same type then the search is terminated in that branch. - * - * This is because the existing handler is closer in proximity - * to any more regions than the one we are trying to install. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiEvInstallHandler ( - ACPI_HANDLE ObjHandle, - UINT32 Level, - void *Context, - void **ReturnValue) -{ - ACPI_OPERAND_OBJECT *HandlerObj; - ACPI_OPERAND_OBJECT *NextHandlerObj; - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_NAMESPACE_NODE *Node; - ACPI_STATUS Status; - - - ACPI_FUNCTION_NAME (EvInstallHandler); - - - HandlerObj = (ACPI_OPERAND_OBJECT *) Context; - - /* Parameter validation */ - - if (!HandlerObj) - { - return (AE_OK); - } - - /* Convert and validate the device handle */ - - Node = AcpiNsValidateHandle (ObjHandle); - if (!Node) - { - return (AE_BAD_PARAMETER); - } - - /* - * We only care about regions and objects that are allowed to have - * address space handlers - */ - if ((Node->Type != ACPI_TYPE_DEVICE) && - (Node->Type != ACPI_TYPE_REGION) && - (Node != AcpiGbl_RootNode)) - { - return (AE_OK); - } - - /* Check for an existing internal object */ - - ObjDesc = AcpiNsGetAttachedObject (Node); - if (!ObjDesc) - { - /* No object, just exit */ - - return (AE_OK); - } - - /* Devices are handled different than regions */ - - if (ObjDesc->Common.Type == ACPI_TYPE_DEVICE) - { - /* Check if this Device already has a handler for this address space */ - - NextHandlerObj = ObjDesc->Device.Handler; - while (NextHandlerObj) - { - /* Found a handler, is it for the same address space? */ - - if (NextHandlerObj->AddressSpace.SpaceId == - HandlerObj->AddressSpace.SpaceId) - { - ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, - "Found handler for region [%s] in device %p(%p) " - "handler %p\n", - AcpiUtGetRegionName (HandlerObj->AddressSpace.SpaceId), - ObjDesc, NextHandlerObj, HandlerObj)); - - /* - * Since the object we found it on was a device, then it - * means that someone has already installed a handler for - * the branch of the namespace from this device on. Just - * bail out telling the walk routine to not traverse this - * branch. This preserves the scoping rule for handlers. - */ - return (AE_CTRL_DEPTH); - } - - /* Walk the linked list of handlers attached to this device */ - - NextHandlerObj = NextHandlerObj->AddressSpace.Next; - } - - /* - * As long as the device didn't have a handler for this space we - * don't care about it. We just ignore it and proceed. - */ - return (AE_OK); - } - - /* Object is a Region */ - - if (ObjDesc->Region.SpaceId != HandlerObj->AddressSpace.SpaceId) - { - /* This region is for a different address space, just ignore it */ - - return (AE_OK); - } - - /* - * Now we have a region and it is for the handler's address space type. - * - * First disconnect region for any previous handler (if any) - */ - AcpiEvDetachRegion (ObjDesc, FALSE); - - /* Connect the region to the new handler */ - - Status = AcpiEvAttachRegion (HandlerObj, ObjDesc, FALSE); - return (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiEvInstallSpaceHandler - * - * PARAMETERS: Node - Namespace node for the device - * SpaceId - The address space ID - * Handler - Address of the handler - * Setup - Address of the setup function - * Context - Value passed to the handler on each access + * PARAMETERS: RegionObj - Region object + * Function - Passed to _REG: On (1) or Off (0) * * RETURN: Status * - * DESCRIPTION: Install a handler for all OpRegions of a given SpaceId. - * Assumes namespace is locked + * DESCRIPTION: Execute _REG method for a region * ******************************************************************************/ ACPI_STATUS -AcpiEvInstallSpaceHandler ( - ACPI_NAMESPACE_NODE *Node, - ACPI_ADR_SPACE_TYPE SpaceId, - ACPI_ADR_SPACE_HANDLER Handler, - ACPI_ADR_SPACE_SETUP Setup, - void *Context) +AcpiEvExecuteRegMethod ( + ACPI_OPERAND_OBJECT *RegionObj, + UINT32 Function) { - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_OPERAND_OBJECT *HandlerObj; + ACPI_EVALUATE_INFO *Info; + ACPI_OPERAND_OBJECT *Args[3]; + ACPI_OPERAND_OBJECT *RegionObj2; ACPI_STATUS Status; - ACPI_OBJECT_TYPE Type; - UINT8 Flags = 0; - ACPI_FUNCTION_TRACE (EvInstallSpaceHandler); + ACPI_FUNCTION_TRACE (EvExecuteRegMethod); + RegionObj2 = AcpiNsGetSecondaryObject (RegionObj); + if (!RegionObj2) + { + return_ACPI_STATUS (AE_NOT_EXIST); + } + + if (RegionObj2->Extra.Method_REG == NULL) + { + return_ACPI_STATUS (AE_OK); + } + + /* Allocate and initialize the evaluation information block */ + + Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO)); + if (!Info) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + Info->PrefixNode = RegionObj2->Extra.Method_REG; + Info->RelativePathname = NULL; + Info->Parameters = Args; + Info->Flags = ACPI_IGNORE_RETURN_VALUE; + /* - * This registration is valid for only the types below and the root. This - * is where the default handlers get placed. - */ - if ((Node->Type != ACPI_TYPE_DEVICE) && - (Node->Type != ACPI_TYPE_PROCESSOR) && - (Node->Type != ACPI_TYPE_THERMAL) && - (Node != AcpiGbl_RootNode)) - { - Status = AE_BAD_PARAMETER; - goto UnlockAndExit; - } - - if (Handler == ACPI_DEFAULT_HANDLER) - { - Flags = ACPI_ADDR_HANDLER_DEFAULT_INSTALLED; - - switch (SpaceId) - { - case ACPI_ADR_SPACE_SYSTEM_MEMORY: - Handler = AcpiExSystemMemorySpaceHandler; - Setup = AcpiEvSystemMemoryRegionSetup; - break; - - case ACPI_ADR_SPACE_SYSTEM_IO: - Handler = AcpiExSystemIoSpaceHandler; - Setup = AcpiEvIoSpaceRegionSetup; - break; - - case ACPI_ADR_SPACE_PCI_CONFIG: - Handler = AcpiExPciConfigSpaceHandler; - Setup = AcpiEvPciConfigRegionSetup; - break; - - case ACPI_ADR_SPACE_CMOS: - Handler = AcpiExCmosSpaceHandler; - Setup = AcpiEvCmosRegionSetup; - break; - - case ACPI_ADR_SPACE_PCI_BAR_TARGET: - Handler = AcpiExPciBarSpaceHandler; - Setup = AcpiEvPciBarRegionSetup; - break; - - case ACPI_ADR_SPACE_DATA_TABLE: - Handler = AcpiExDataTableSpaceHandler; - Setup = NULL; - break; - - default: - Status = AE_BAD_PARAMETER; - goto UnlockAndExit; - } - } - - /* If the caller hasn't specified a setup routine, use the default */ - - if (!Setup) - { - Setup = AcpiEvDefaultRegionSetup; - } - - /* Check for an existing internal object */ - - ObjDesc = AcpiNsGetAttachedObject (Node); - if (ObjDesc) - { - /* - * The attached device object already exists. Make sure the handler - * is not already installed. - */ - HandlerObj = ObjDesc->Device.Handler; - - /* Walk the handler list for this device */ - - while (HandlerObj) - { - /* Same SpaceId indicates a handler already installed */ - - if (HandlerObj->AddressSpace.SpaceId == SpaceId) - { - if (HandlerObj->AddressSpace.Handler == Handler) - { - /* - * It is (relatively) OK to attempt to install the SAME - * handler twice. This can easily happen with the - * PCI_Config space. - */ - Status = AE_SAME_HANDLER; - goto UnlockAndExit; - } - else - { - /* A handler is already installed */ - - Status = AE_ALREADY_EXISTS; - } - goto UnlockAndExit; - } - - /* Walk the linked list of handlers */ - - HandlerObj = HandlerObj->AddressSpace.Next; - } - } - else - { - ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, - "Creating object on Device %p while installing handler\n", Node)); - - /* ObjDesc does not exist, create one */ - - if (Node->Type == ACPI_TYPE_ANY) - { - Type = ACPI_TYPE_DEVICE; - } - else - { - Type = Node->Type; - } - - ObjDesc = AcpiUtCreateInternalObject (Type); - if (!ObjDesc) - { - Status = AE_NO_MEMORY; - goto UnlockAndExit; - } - - /* Init new descriptor */ - - ObjDesc->Common.Type = (UINT8) Type; - - /* Attach the new object to the Node */ - - Status = AcpiNsAttachObject (Node, ObjDesc, Type); - - /* Remove local reference to the object */ - - AcpiUtRemoveReference (ObjDesc); - - if (ACPI_FAILURE (Status)) - { - goto UnlockAndExit; - } - } - - ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION, - "Installing address handler for region %s(%X) on Device %4.4s %p(%p)\n", - AcpiUtGetRegionName (SpaceId), SpaceId, - AcpiUtGetNodeName (Node), Node, ObjDesc)); - - /* - * Install the handler + * The _REG method has two arguments: * - * At this point there is no existing handler. Just allocate the object - * for the handler and link it into the list. + * Arg0 - Integer: + * Operation region space ID Same value as RegionObj->Region.SpaceId + * + * Arg1 - Integer: + * connection status 1 for connecting the handler, 0 for disconnecting + * the handler (Passed as a parameter) */ - HandlerObj = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_ADDRESS_HANDLER); - if (!HandlerObj) + Args[0] = AcpiUtCreateIntegerObject ((UINT64) RegionObj->Region.SpaceId); + if (!Args[0]) { Status = AE_NO_MEMORY; - goto UnlockAndExit; + goto Cleanup1; } - /* Init handler obj */ + Args[1] = AcpiUtCreateIntegerObject ((UINT64) Function); + if (!Args[1]) + { + Status = AE_NO_MEMORY; + goto Cleanup2; + } - HandlerObj->AddressSpace.SpaceId = (UINT8) SpaceId; - HandlerObj->AddressSpace.HandlerFlags = Flags; - HandlerObj->AddressSpace.RegionList = NULL; - HandlerObj->AddressSpace.Node = Node; - HandlerObj->AddressSpace.Handler = Handler; - HandlerObj->AddressSpace.Context = Context; - HandlerObj->AddressSpace.Setup = Setup; + Args[2] = NULL; /* Terminate list */ - /* Install at head of Device.AddressSpace list */ + /* Execute the method, no return value */ - HandlerObj->AddressSpace.Next = ObjDesc->Device.Handler; + ACPI_DEBUG_EXEC ( + AcpiUtDisplayInitPathname (ACPI_TYPE_METHOD, Info->PrefixNode, NULL)); - /* - * The Device object is the first reference on the HandlerObj. - * Each region that uses the handler adds a reference. - */ - ObjDesc->Device.Handler = HandlerObj; + Status = AcpiNsEvaluate (Info); + AcpiUtRemoveReference (Args[1]); - /* - * Walk the namespace finding all of the regions this - * handler will manage. - * - * Start at the device and search the branch toward - * the leaf nodes until either the leaf is encountered or - * a device is detected that has an address handler of the - * same type. - * - * In either case, back up and search down the remainder - * of the branch - */ - Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX, - ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, NULL, - HandlerObj, NULL); +Cleanup2: + AcpiUtRemoveReference (Args[0]); -UnlockAndExit: +Cleanup1: + ACPI_FREE (Info); return_ACPI_STATUS (Status); } @@ -1222,7 +736,7 @@ AcpiEvExecuteRegMethods ( if (SpaceId == ACPI_ADR_SPACE_EC) { - AcpiEvOrphanEcRegMethod (); + AcpiEvOrphanEcRegMethod (Node); } return_ACPI_STATUS (Status); @@ -1300,7 +814,7 @@ AcpiEvRegRun ( * * FUNCTION: AcpiEvOrphanEcRegMethod * - * PARAMETERS: None + * PARAMETERS: EcDeviceNode - Namespace node for an EC device * * RETURN: None * @@ -1312,41 +826,30 @@ AcpiEvRegRun ( * detected by providing a _REG method object underneath the * Embedded Controller device." * - * To quickly access the EC device, we use the EC_ID that appears - * within the ECDT. Otherwise, we would need to perform a time- - * consuming namespace walk, executing _HID methods to find the - * EC device. + * To quickly access the EC device, we use the EcDeviceNode used + * during EC handler installation. Otherwise, we would need to + * perform a time consuming namespace walk, executing _HID + * methods to find the EC device. + * + * MUTEX: Assumes the namespace is locked * ******************************************************************************/ static void AcpiEvOrphanEcRegMethod ( - void) + ACPI_NAMESPACE_NODE *EcDeviceNode) { - ACPI_TABLE_ECDT *Table; + ACPI_HANDLE RegMethod; + ACPI_NAMESPACE_NODE *NextNode; ACPI_STATUS Status; ACPI_OBJECT_LIST Args; ACPI_OBJECT Objects[2]; - ACPI_NAMESPACE_NODE *EcDeviceNode; - ACPI_NAMESPACE_NODE *RegMethod; - ACPI_NAMESPACE_NODE *NextNode; ACPI_FUNCTION_TRACE (EvOrphanEcRegMethod); - /* Get the ECDT (if present in system) */ - - Status = AcpiGetTable (ACPI_SIG_ECDT, 0, - ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &Table)); - if (ACPI_FAILURE (Status)) - { - return_VOID; - } - - /* We need a valid EC_ID string */ - - if (!(*Table->Id)) + if (!EcDeviceNode) { return_VOID; } @@ -1355,23 +858,12 @@ AcpiEvOrphanEcRegMethod ( (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - /* Get a handle to the EC device referenced in the ECDT */ - - Status = AcpiGetHandle (NULL, - ACPI_CAST_PTR (char, Table->Id), - ACPI_CAST_PTR (ACPI_HANDLE, &EcDeviceNode)); - if (ACPI_FAILURE (Status)) - { - goto Exit; - } - /* Get a handle to a _REG method immediately under the EC device */ - Status = AcpiGetHandle (EcDeviceNode, - METHOD_NAME__REG, ACPI_CAST_PTR (ACPI_HANDLE, &RegMethod)); + Status = AcpiGetHandle (EcDeviceNode, METHOD_NAME__REG, &RegMethod); if (ACPI_FAILURE (Status)) { - goto Exit; + goto Exit; /* There is no _REG method present */ } /* @@ -1379,7 +871,7 @@ AcpiEvOrphanEcRegMethod ( * this scope with the Embedded Controller space ID. Otherwise, it * will already have been executed. Note, this allows for Regions * with other space IDs to be present; but the code below will then - * execute the _REG method with the EC space ID argument. + * execute the _REG method with the EmbeddedControl SpaceID argument. */ NextNode = AcpiNsGetNextNode (EcDeviceNode, NULL); while (NextNode) @@ -1388,12 +880,13 @@ AcpiEvOrphanEcRegMethod ( (NextNode->Object) && (NextNode->Object->Region.SpaceId == ACPI_ADR_SPACE_EC)) { - goto Exit; /* Do not execute _REG */ + goto Exit; /* Do not execute the _REG */ } + NextNode = AcpiNsGetNextNode (EcDeviceNode, NextNode); } - /* Evaluate the _REG(EC,Connect) method */ + /* Evaluate the _REG(EmbeddedControl,Connect) method */ Args.Count = 2; Args.Pointer = Objects; diff --git a/reactos/drivers/bus/acpi/acpica/events/evrgnini.c b/reactos/drivers/bus/acpi/acpica/events/evrgnini.c index cb9a2fdcd0e..ac321c7daff 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evrgnini.c +++ b/reactos/drivers/bus/acpi/acpica/events/evrgnini.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -461,8 +461,8 @@ AcpiEvIsPciRootBridge ( ACPI_NAMESPACE_NODE *Node) { ACPI_STATUS Status; - ACPI_DEVICE_ID *Hid; - ACPI_DEVICE_ID_LIST *Cid; + ACPI_PNP_DEVICE_ID *Hid; + ACPI_PNP_DEVICE_ID_LIST *Cid; UINT32 i; BOOLEAN Match; @@ -736,7 +736,9 @@ AcpiEvInitializeRegion ( break; default: + /* Ignore other objects */ + break; } @@ -801,4 +803,3 @@ AcpiEvInitializeRegion ( return_ACPI_STATUS (AE_NOT_EXIST); } - diff --git a/reactos/drivers/bus/acpi/acpica/events/evsci.c b/reactos/drivers/bus/acpi/acpica/events/evsci.c index e0d9261acfb..ec6c1c1918a 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evsci.c +++ b/reactos/drivers/bus/acpi/acpica/events/evsci.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -82,10 +82,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -94,14 +94,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -123,6 +123,8 @@ #define _COMPONENT ACPI_EVENTS ACPI_MODULE_NAME ("evsci") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static UINT32 ACPI_SYSTEM_XFACE @@ -130,6 +132,57 @@ AcpiEvSciXruptHandler ( void *Context); +/******************************************************************************* + * + * FUNCTION: AcpiEvSciDispatch + * + * PARAMETERS: None + * + * RETURN: Status code indicates whether interrupt was handled. + * + * DESCRIPTION: Dispatch the SCI to all host-installed SCI handlers. + * + ******************************************************************************/ + +UINT32 +AcpiEvSciDispatch ( + void) +{ + ACPI_SCI_HANDLER_INFO *SciHandler; + ACPI_CPU_FLAGS Flags; + UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED; + + + ACPI_FUNCTION_NAME (EvSciDispatch); + + + /* Are there any host-installed SCI handlers? */ + + if (!AcpiGbl_SciHandlerList) + { + return (IntStatus); + } + + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + + /* Invoke all host-installed SCI handlers */ + + SciHandler = AcpiGbl_SciHandlerList; + while (SciHandler) + { + /* Invoke the installed handler (at interrupt level) */ + + IntStatus |= SciHandler->Address ( + SciHandler->Context); + + SciHandler = SciHandler->Next; + } + + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + return (IntStatus); +} + + /******************************************************************************* * * FUNCTION: AcpiEvSciXruptHandler @@ -155,7 +208,7 @@ AcpiEvSciXruptHandler ( /* - * We are guaranteed by the ACPI CA initialization/shutdown code that + * We are guaranteed by the ACPICA initialization/shutdown code that * if this interrupt handler is installed, ACPI is enabled. */ @@ -171,6 +224,10 @@ AcpiEvSciXruptHandler ( */ InterruptHandled |= AcpiEvGpeDetect (GpeXruptList); + /* Invoke all host-installed SCI handlers */ + + InterruptHandled |= AcpiEvSciDispatch (); + AcpiSciCount++; return_UINT32 (InterruptHandled); } @@ -200,14 +257,13 @@ AcpiEvGpeXruptHandler ( /* - * We are guaranteed by the ACPI CA initialization/shutdown code that + * We are guaranteed by the ACPICA initialization/shutdown code that * if this interrupt handler is installed, ACPI is enabled. */ /* GPEs: Check for and dispatch any GPEs that have occurred */ InterruptHandled |= AcpiEvGpeDetect (GpeXruptList); - return_UINT32 (InterruptHandled); } @@ -242,15 +298,15 @@ AcpiEvInstallSciHandler ( /****************************************************************************** * - * FUNCTION: AcpiEvRemoveSciHandler + * FUNCTION: AcpiEvRemoveAllSciHandlers * * PARAMETERS: none * - * RETURN: E_OK if handler uninstalled OK, E_ERROR if handler was not + * RETURN: AE_OK if handler uninstalled, AE_ERROR if handler was not * installed to begin with * * DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be - * taken. + * taken. Remove all host-installed SCI handlers. * * Note: It doesn't seem important to disable all events or set the event * enable registers to their original values. The OS should disable @@ -260,13 +316,15 @@ AcpiEvInstallSciHandler ( ******************************************************************************/ ACPI_STATUS -AcpiEvRemoveSciHandler ( +AcpiEvRemoveAllSciHandlers ( void) { + ACPI_SCI_HANDLER_INFO *SciHandler; + ACPI_CPU_FLAGS Flags; ACPI_STATUS Status; - ACPI_FUNCTION_TRACE (EvRemoveSciHandler); + ACPI_FUNCTION_TRACE (EvRemoveAllSciHandlers); /* Just let the OS remove the handler and disable the level */ @@ -274,7 +332,24 @@ AcpiEvRemoveSciHandler ( Status = AcpiOsRemoveInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt, AcpiEvSciXruptHandler); + if (!AcpiGbl_SciHandlerList) + { + return (Status); + } + + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + + /* Free all host-installed SCI handlers */ + + while (AcpiGbl_SciHandlerList) + { + SciHandler = AcpiGbl_SciHandlerList; + AcpiGbl_SciHandlerList = SciHandler->Next; + ACPI_FREE (SciHandler); + } + + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); return_ACPI_STATUS (Status); } - +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evxface.c b/reactos/drivers/bus/acpi/acpica/events/evxface.c index 990ddfb0b89..85355a57c8a 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evxface.c +++ b/reactos/drivers/bus/acpi/acpica/events/evxface.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -115,6 +115,7 @@ #define __EVXFACE_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" @@ -126,6 +127,348 @@ ACPI_MODULE_NAME ("evxface") +/******************************************************************************* + * + * FUNCTION: AcpiInstallNotifyHandler + * + * PARAMETERS: Device - The device for which notifies will be handled + * HandlerType - The type of handler: + * ACPI_SYSTEM_NOTIFY: System Handler (00-7F) + * ACPI_DEVICE_NOTIFY: Device Handler (80-FF) + * ACPI_ALL_NOTIFY: Both System and Device + * Handler - Address of the handler + * Context - Value passed to the handler on each GPE + * + * RETURN: Status + * + * DESCRIPTION: Install a handler for notifications on an ACPI Device, + * ThermalZone, or Processor object. + * + * NOTES: The Root namespace object may have only one handler for each + * type of notify (System/Device). Device/Thermal/Processor objects + * may have one device notify handler, and multiple system notify + * handlers. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiInstallNotifyHandler ( + ACPI_HANDLE Device, + UINT32 HandlerType, + ACPI_NOTIFY_HANDLER Handler, + void *Context) +{ + ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Device); + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *HandlerObj; + ACPI_STATUS Status; + UINT32 i; + + + ACPI_FUNCTION_TRACE (AcpiInstallNotifyHandler); + + + /* Parameter validation */ + + if ((!Device) || (!Handler) || (!HandlerType) || + (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE)) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* + * Root Object: + * Registering a notify handler on the root object indicates that the + * caller wishes to receive notifications for all objects. Note that + * only one global handler can be registered per notify type. + * Ensure that a handler is not already installed. + */ + if (Device == ACPI_ROOT_OBJECT) + { + for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) + { + if (HandlerType & (i+1)) + { + if (AcpiGbl_GlobalNotify[i].Handler) + { + Status = AE_ALREADY_EXISTS; + goto UnlockAndExit; + } + + AcpiGbl_GlobalNotify[i].Handler = Handler; + AcpiGbl_GlobalNotify[i].Context = Context; + } + } + + goto UnlockAndExit; /* Global notify handler installed, all done */ + } + + /* + * All Other Objects: + * Caller will only receive notifications specific to the target + * object. Note that only certain object types are allowed to + * receive notifications. + */ + + /* Are Notifies allowed on this object? */ + + if (!AcpiEvIsNotifyObject (Node)) + { + Status = AE_TYPE; + goto UnlockAndExit; + } + + /* Check for an existing internal object, might not exist */ + + ObjDesc = AcpiNsGetAttachedObject (Node); + if (!ObjDesc) + { + /* Create a new object */ + + ObjDesc = AcpiUtCreateInternalObject (Node->Type); + if (!ObjDesc) + { + Status = AE_NO_MEMORY; + goto UnlockAndExit; + } + + /* Attach new object to the Node, remove local reference */ + + Status = AcpiNsAttachObject (Device, ObjDesc, Node->Type); + AcpiUtRemoveReference (ObjDesc); + if (ACPI_FAILURE (Status)) + { + goto UnlockAndExit; + } + } + + /* Ensure that the handler is not already installed in the lists */ + + for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) + { + if (HandlerType & (i+1)) + { + HandlerObj = ObjDesc->CommonNotify.NotifyList[i]; + while (HandlerObj) + { + if (HandlerObj->Notify.Handler == Handler) + { + Status = AE_ALREADY_EXISTS; + goto UnlockAndExit; + } + + HandlerObj = HandlerObj->Notify.Next[i]; + } + } + } + + /* Create and populate a new notify handler object */ + + HandlerObj = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_NOTIFY); + if (!HandlerObj) + { + Status = AE_NO_MEMORY; + goto UnlockAndExit; + } + + HandlerObj->Notify.Node = Node; + HandlerObj->Notify.HandlerType = HandlerType; + HandlerObj->Notify.Handler = Handler; + HandlerObj->Notify.Context = Context; + + /* Install the handler at the list head(s) */ + + for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) + { + if (HandlerType & (i+1)) + { + HandlerObj->Notify.Next[i] = + ObjDesc->CommonNotify.NotifyList[i]; + + ObjDesc->CommonNotify.NotifyList[i] = HandlerObj; + } + } + + /* Add an extra reference if handler was installed in both lists */ + + if (HandlerType == ACPI_ALL_NOTIFY) + { + AcpiUtAddReference (HandlerObj); + } + + +UnlockAndExit: + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiInstallNotifyHandler) + + +/******************************************************************************* + * + * FUNCTION: AcpiRemoveNotifyHandler + * + * PARAMETERS: Device - The device for which the handler is installed + * HandlerType - The type of handler: + * ACPI_SYSTEM_NOTIFY: System Handler (00-7F) + * ACPI_DEVICE_NOTIFY: Device Handler (80-FF) + * ACPI_ALL_NOTIFY: Both System and Device + * Handler - Address of the handler + * + * RETURN: Status + * + * DESCRIPTION: Remove a handler for notifies on an ACPI device + * + ******************************************************************************/ + +ACPI_STATUS +AcpiRemoveNotifyHandler ( + ACPI_HANDLE Device, + UINT32 HandlerType, + ACPI_NOTIFY_HANDLER Handler) +{ + ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Device); + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *HandlerObj; + ACPI_OPERAND_OBJECT *PreviousHandlerObj; + ACPI_STATUS Status = AE_OK; + UINT32 i; + + + ACPI_FUNCTION_TRACE (AcpiRemoveNotifyHandler); + + + /* Parameter validation */ + + if ((!Device) || (!Handler) || (!HandlerType) || + (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE)) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + /* Root Object. Global handlers are removed here */ + + if (Device == ACPI_ROOT_OBJECT) + { + for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) + { + if (HandlerType & (i+1)) + { + Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + if (!AcpiGbl_GlobalNotify[i].Handler || + (AcpiGbl_GlobalNotify[i].Handler != Handler)) + { + Status = AE_NOT_EXIST; + goto UnlockAndExit; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Removing global notify handler\n")); + + AcpiGbl_GlobalNotify[i].Handler = NULL; + AcpiGbl_GlobalNotify[i].Context = NULL; + + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + + /* Make sure all deferred notify tasks are completed */ + + AcpiOsWaitEventsComplete (); + } + } + + return_ACPI_STATUS (AE_OK); + } + + /* All other objects: Are Notifies allowed on this object? */ + + if (!AcpiEvIsNotifyObject (Node)) + { + return_ACPI_STATUS (AE_TYPE); + } + + /* Must have an existing internal object */ + + ObjDesc = AcpiNsGetAttachedObject (Node); + if (!ObjDesc) + { + return_ACPI_STATUS (AE_NOT_EXIST); + } + + /* Internal object exists. Find the handler and remove it */ + + for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) + { + if (HandlerType & (i+1)) + { + Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + HandlerObj = ObjDesc->CommonNotify.NotifyList[i]; + PreviousHandlerObj = NULL; + + /* Attempt to find the handler in the handler list */ + + while (HandlerObj && + (HandlerObj->Notify.Handler != Handler)) + { + PreviousHandlerObj = HandlerObj; + HandlerObj = HandlerObj->Notify.Next[i]; + } + + if (!HandlerObj) + { + Status = AE_NOT_EXIST; + goto UnlockAndExit; + } + + /* Remove the handler object from the list */ + + if (PreviousHandlerObj) /* Handler is not at the list head */ + { + PreviousHandlerObj->Notify.Next[i] = + HandlerObj->Notify.Next[i]; + } + else /* Handler is at the list head */ + { + ObjDesc->CommonNotify.NotifyList[i] = + HandlerObj->Notify.Next[i]; + } + + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + + /* Make sure all deferred notify tasks are completed */ + + AcpiOsWaitEventsComplete (); + AcpiUtRemoveReference (HandlerObj); + } + } + + return_ACPI_STATUS (Status); + + +UnlockAndExit: + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiRemoveNotifyHandler) + + /******************************************************************************* * * FUNCTION: AcpiInstallExceptionHandler @@ -175,6 +518,174 @@ Cleanup: ACPI_EXPORT_SYMBOL (AcpiInstallExceptionHandler) +#if (!ACPI_REDUCED_HARDWARE) +/******************************************************************************* + * + * FUNCTION: AcpiInstallSciHandler + * + * PARAMETERS: Address - Address of the handler + * Context - Value passed to the handler on each SCI + * + * RETURN: Status + * + * DESCRIPTION: Install a handler for a System Control Interrupt. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiInstallSciHandler ( + ACPI_SCI_HANDLER Address, + void *Context) +{ + ACPI_SCI_HANDLER_INFO *NewSciHandler; + ACPI_SCI_HANDLER_INFO *SciHandler; + ACPI_CPU_FLAGS Flags; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiInstallSciHandler); + + + if (!Address) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + /* Allocate and init a handler object */ + + NewSciHandler = ACPI_ALLOCATE (sizeof (ACPI_SCI_HANDLER_INFO)); + if (!NewSciHandler) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + NewSciHandler->Address = Address; + NewSciHandler->Context = Context; + + Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (Status)) + { + goto Exit; + } + + /* Lock list during installation */ + + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + SciHandler = AcpiGbl_SciHandlerList; + + /* Ensure handler does not already exist */ + + while (SciHandler) + { + if (Address == SciHandler->Address) + { + Status = AE_ALREADY_EXISTS; + goto UnlockAndExit; + } + + SciHandler = SciHandler->Next; + } + + /* Install the new handler into the global list (at head) */ + + NewSciHandler->Next = AcpiGbl_SciHandlerList; + AcpiGbl_SciHandlerList = NewSciHandler; + + +UnlockAndExit: + + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); + +Exit: + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (NewSciHandler); + } + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiInstallSciHandler) + + +/******************************************************************************* + * + * FUNCTION: AcpiRemoveSciHandler + * + * PARAMETERS: Address - Address of the handler + * + * RETURN: Status + * + * DESCRIPTION: Remove a handler for a System Control Interrupt. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiRemoveSciHandler ( + ACPI_SCI_HANDLER Address) +{ + ACPI_SCI_HANDLER_INFO *PrevSciHandler; + ACPI_SCI_HANDLER_INFO *NextSciHandler; + ACPI_CPU_FLAGS Flags; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiRemoveSciHandler); + + + if (!Address) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Remove the SCI handler with lock */ + + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); + + PrevSciHandler = NULL; + NextSciHandler = AcpiGbl_SciHandlerList; + while (NextSciHandler) + { + if (NextSciHandler->Address == Address) + { + /* Unlink and free the SCI handler info block */ + + if (PrevSciHandler) + { + PrevSciHandler->Next = NextSciHandler->Next; + } + else + { + AcpiGbl_SciHandlerList = NextSciHandler->Next; + } + + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + ACPI_FREE (NextSciHandler); + goto UnlockAndExit; + } + + PrevSciHandler = NextSciHandler; + NextSciHandler = NextSciHandler->Next; + } + + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + Status = AE_NOT_EXIST; + + +UnlockAndExit: + (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiRemoveSciHandler) + + /******************************************************************************* * * FUNCTION: AcpiInstallGlobalEventHandler @@ -276,9 +787,9 @@ AcpiInstallFixedEventHandler ( return_ACPI_STATUS (Status); } - /* Don't allow two handlers. */ + /* Do not allow multiple handlers */ - if (NULL != AcpiGbl_FixedEventHandlers[Event].Handler) + if (AcpiGbl_FixedEventHandlers[Event].Handler) { Status = AE_ALREADY_EXISTS; goto Cleanup; @@ -292,7 +803,9 @@ AcpiInstallFixedEventHandler ( Status = AcpiEnableEvent (Event, 0); if (ACPI_FAILURE (Status)) { - ACPI_WARNING ((AE_INFO, "Could not enable fixed event 0x%X", Event)); + ACPI_WARNING ((AE_INFO, + "Could not enable fixed event - %s (%u)", + AcpiUtGetEventName (Event), Event)); /* Remove the handler */ @@ -302,7 +815,8 @@ AcpiInstallFixedEventHandler ( else { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Enabled fixed event %X, Handler=%p\n", Event, Handler)); + "Enabled fixed event %s (%X), Handler=%p\n", + AcpiUtGetEventName (Event), Event, Handler)); } @@ -363,11 +877,14 @@ AcpiRemoveFixedEventHandler ( if (ACPI_FAILURE (Status)) { ACPI_WARNING ((AE_INFO, - "Could not write to fixed event enable register 0x%X", Event)); + "Could not disable fixed event - %s (%u)", + AcpiUtGetEventName (Event), Event)); } else { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Disabled fixed event %X\n", Event)); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Disabled fixed event - %s (%X)\n", + AcpiUtGetEventName (Event), Event)); } (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); @@ -377,357 +894,6 @@ AcpiRemoveFixedEventHandler ( ACPI_EXPORT_SYMBOL (AcpiRemoveFixedEventHandler) -/******************************************************************************* - * - * FUNCTION: AcpiInstallNotifyHandler - * - * PARAMETERS: Device - The device for which notifies will be handled - * HandlerType - The type of handler: - * ACPI_SYSTEM_NOTIFY: SystemHandler (00-7f) - * ACPI_DEVICE_NOTIFY: DriverHandler (80-ff) - * ACPI_ALL_NOTIFY: both system and device - * Handler - Address of the handler - * Context - Value passed to the handler on each GPE - * - * RETURN: Status - * - * DESCRIPTION: Install a handler for notifies on an ACPI device - * - ******************************************************************************/ - -ACPI_STATUS -AcpiInstallNotifyHandler ( - ACPI_HANDLE Device, - UINT32 HandlerType, - ACPI_NOTIFY_HANDLER Handler, - void *Context) -{ - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_OPERAND_OBJECT *NotifyObj; - ACPI_NAMESPACE_NODE *Node; - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiInstallNotifyHandler); - - - /* Parameter validation */ - - if ((!Device) || - (!Handler) || - (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE)) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - - Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Convert and validate the device handle */ - - Node = AcpiNsValidateHandle (Device); - if (!Node) - { - Status = AE_BAD_PARAMETER; - goto UnlockAndExit; - } - - /* - * Root Object: - * Registering a notify handler on the root object indicates that the - * caller wishes to receive notifications for all objects. Note that - * only one global handler can be regsitered (per notify type). - */ - if (Device == ACPI_ROOT_OBJECT) - { - /* Make sure the handler is not already installed */ - - if (((HandlerType & ACPI_SYSTEM_NOTIFY) && - AcpiGbl_SystemNotify.Handler) || - ((HandlerType & ACPI_DEVICE_NOTIFY) && - AcpiGbl_DeviceNotify.Handler)) - { - Status = AE_ALREADY_EXISTS; - goto UnlockAndExit; - } - - if (HandlerType & ACPI_SYSTEM_NOTIFY) - { - AcpiGbl_SystemNotify.Node = Node; - AcpiGbl_SystemNotify.Handler = Handler; - AcpiGbl_SystemNotify.Context = Context; - } - - if (HandlerType & ACPI_DEVICE_NOTIFY) - { - AcpiGbl_DeviceNotify.Node = Node; - AcpiGbl_DeviceNotify.Handler = Handler; - AcpiGbl_DeviceNotify.Context = Context; - } - - /* Global notify handler installed */ - } - - /* - * All Other Objects: - * Caller will only receive notifications specific to the target object. - * Note that only certain object types can receive notifications. - */ - else - { - /* Notifies allowed on this object? */ - - if (!AcpiEvIsNotifyObject (Node)) - { - Status = AE_TYPE; - goto UnlockAndExit; - } - - /* Check for an existing internal object */ - - ObjDesc = AcpiNsGetAttachedObject (Node); - if (ObjDesc) - { - /* Object exists - make sure there's no handler */ - - if (((HandlerType & ACPI_SYSTEM_NOTIFY) && - ObjDesc->CommonNotify.SystemNotify) || - ((HandlerType & ACPI_DEVICE_NOTIFY) && - ObjDesc->CommonNotify.DeviceNotify)) - { - Status = AE_ALREADY_EXISTS; - goto UnlockAndExit; - } - } - else - { - /* Create a new object */ - - ObjDesc = AcpiUtCreateInternalObject (Node->Type); - if (!ObjDesc) - { - Status = AE_NO_MEMORY; - goto UnlockAndExit; - } - - /* Attach new object to the Node */ - - Status = AcpiNsAttachObject (Device, ObjDesc, Node->Type); - - /* Remove local reference to the object */ - - AcpiUtRemoveReference (ObjDesc); - if (ACPI_FAILURE (Status)) - { - goto UnlockAndExit; - } - } - - /* Install the handler */ - - NotifyObj = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_NOTIFY); - if (!NotifyObj) - { - Status = AE_NO_MEMORY; - goto UnlockAndExit; - } - - NotifyObj->Notify.Node = Node; - NotifyObj->Notify.Handler = Handler; - NotifyObj->Notify.Context = Context; - - if (HandlerType & ACPI_SYSTEM_NOTIFY) - { - ObjDesc->CommonNotify.SystemNotify = NotifyObj; - } - - if (HandlerType & ACPI_DEVICE_NOTIFY) - { - ObjDesc->CommonNotify.DeviceNotify = NotifyObj; - } - - if (HandlerType == ACPI_ALL_NOTIFY) - { - /* Extra ref if installed in both */ - - AcpiUtAddReference (NotifyObj); - } - } - - -UnlockAndExit: - (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiInstallNotifyHandler) - - -/******************************************************************************* - * - * FUNCTION: AcpiRemoveNotifyHandler - * - * PARAMETERS: Device - The device for which notifies will be handled - * HandlerType - The type of handler: - * ACPI_SYSTEM_NOTIFY: SystemHandler (00-7f) - * ACPI_DEVICE_NOTIFY: DriverHandler (80-ff) - * ACPI_ALL_NOTIFY: both system and device - * Handler - Address of the handler - * - * RETURN: Status - * - * DESCRIPTION: Remove a handler for notifies on an ACPI device - * - ******************************************************************************/ - -ACPI_STATUS -AcpiRemoveNotifyHandler ( - ACPI_HANDLE Device, - UINT32 HandlerType, - ACPI_NOTIFY_HANDLER Handler) -{ - ACPI_OPERAND_OBJECT *NotifyObj; - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_NAMESPACE_NODE *Node; - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiRemoveNotifyHandler); - - - /* Parameter validation */ - - if ((!Device) || - (!Handler) || - (HandlerType > ACPI_MAX_NOTIFY_HANDLER_TYPE)) - { - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - - Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Convert and validate the device handle */ - - Node = AcpiNsValidateHandle (Device); - if (!Node) - { - Status = AE_BAD_PARAMETER; - goto UnlockAndExit; - } - - /* Root Object */ - - if (Device == ACPI_ROOT_OBJECT) - { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Removing notify handler for namespace root object\n")); - - if (((HandlerType & ACPI_SYSTEM_NOTIFY) && - !AcpiGbl_SystemNotify.Handler) || - ((HandlerType & ACPI_DEVICE_NOTIFY) && - !AcpiGbl_DeviceNotify.Handler)) - { - Status = AE_NOT_EXIST; - goto UnlockAndExit; - } - - if (HandlerType & ACPI_SYSTEM_NOTIFY) - { - AcpiGbl_SystemNotify.Node = NULL; - AcpiGbl_SystemNotify.Handler = NULL; - AcpiGbl_SystemNotify.Context = NULL; - } - - if (HandlerType & ACPI_DEVICE_NOTIFY) - { - AcpiGbl_DeviceNotify.Node = NULL; - AcpiGbl_DeviceNotify.Handler = NULL; - AcpiGbl_DeviceNotify.Context = NULL; - } - } - - /* All Other Objects */ - - else - { - /* Notifies allowed on this object? */ - - if (!AcpiEvIsNotifyObject (Node)) - { - Status = AE_TYPE; - goto UnlockAndExit; - } - - /* Check for an existing internal object */ - - ObjDesc = AcpiNsGetAttachedObject (Node); - if (!ObjDesc) - { - Status = AE_NOT_EXIST; - goto UnlockAndExit; - } - - /* Object exists - make sure there's an existing handler */ - - if (HandlerType & ACPI_SYSTEM_NOTIFY) - { - NotifyObj = ObjDesc->CommonNotify.SystemNotify; - if (!NotifyObj) - { - Status = AE_NOT_EXIST; - goto UnlockAndExit; - } - - if (NotifyObj->Notify.Handler != Handler) - { - Status = AE_BAD_PARAMETER; - goto UnlockAndExit; - } - - /* Remove the handler */ - - ObjDesc->CommonNotify.SystemNotify = NULL; - AcpiUtRemoveReference (NotifyObj); - } - - if (HandlerType & ACPI_DEVICE_NOTIFY) - { - NotifyObj = ObjDesc->CommonNotify.DeviceNotify; - if (!NotifyObj) - { - Status = AE_NOT_EXIST; - goto UnlockAndExit; - } - - if (NotifyObj->Notify.Handler != Handler) - { - Status = AE_BAD_PARAMETER; - goto UnlockAndExit; - } - - /* Remove the handler */ - - ObjDesc->CommonNotify.DeviceNotify = NULL; - AcpiUtRemoveReference (NotifyObj); - } - } - - -UnlockAndExit: - (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiRemoveNotifyHandler) - - /******************************************************************************* * * FUNCTION: AcpiInstallGpeHandler @@ -949,10 +1115,17 @@ AcpiRemoveGpeHandler ( (void) AcpiEvAddGpeReference (GpeEventInfo); } + AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + (void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS); + + /* Make sure all deferred GPE tasks are completed */ + + AcpiOsWaitEventsComplete (); + /* Now we can free the handler object */ ACPI_FREE (Handler); - + return_ACPI_STATUS (Status); UnlockAndExit: AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); @@ -1047,3 +1220,4 @@ AcpiReleaseGlobalLock ( ACPI_EXPORT_SYMBOL (AcpiReleaseGlobalLock) +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evxfevnt.c b/reactos/drivers/bus/acpi/acpica/events/evxfevnt.c index 437f6e31371..c099bdb2e1a 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evxfevnt.c +++ b/reactos/drivers/bus/acpi/acpica/events/evxfevnt.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -115,6 +115,7 @@ #define __EVXFEVNT_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" @@ -124,6 +125,7 @@ ACPI_MODULE_NAME ("evxfevnt") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: AcpiEnable @@ -153,6 +155,13 @@ AcpiEnable ( return_ACPI_STATUS (AE_NO_ACPI_TABLES); } + /* If the Hardware Reduced flag is set, machine is always in acpi mode */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* Check current mode */ if (AcpiHwGetMode() == ACPI_SYS_MODE_ACPI) @@ -202,6 +211,13 @@ AcpiDisable ( ACPI_FUNCTION_TRACE (AcpiDisable); + /* If the Hardware Reduced flag is set, machine is always in acpi mode */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + if (AcpiHwGetMode() == ACPI_SYS_MODE_LEGACY) { ACPI_DEBUG_PRINT ((ACPI_DB_INIT, @@ -449,4 +465,4 @@ AcpiGetEventStatus ( ACPI_EXPORT_SYMBOL (AcpiGetEventStatus) - +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evxfgpe.c b/reactos/drivers/bus/acpi/acpica/events/evxfgpe.c index 8cd73b36482..8ab1ed1b57c 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evxfgpe.c +++ b/reactos/drivers/bus/acpi/acpica/events/evxfgpe.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -115,6 +115,7 @@ #define __EVXFGPE_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" @@ -125,6 +126,7 @@ ACPI_MODULE_NAME ("evxfgpe") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * * FUNCTION: AcpiUpdateAllGpes @@ -154,7 +156,7 @@ AcpiUpdateAllGpes ( ACPI_STATUS Status; - ACPI_FUNCTION_TRACE (AcpiUpdateGpes); + ACPI_FUNCTION_TRACE (AcpiUpdateAllGpes); Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS); @@ -321,14 +323,17 @@ AcpiSetGpe ( switch (Action) { case ACPI_GPE_ENABLE: + Status = AcpiEvEnableGpe (GpeEventInfo); break; case ACPI_GPE_DISABLE: + Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE); break; default: + Status = AE_BAD_PARAMETER; break; } @@ -366,9 +371,11 @@ AcpiSetupGpeForWake ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber) { - ACPI_STATUS Status = AE_BAD_PARAMETER; + ACPI_STATUS Status; ACPI_GPE_EVENT_INFO *GpeEventInfo; ACPI_NAMESPACE_NODE *DeviceNode; + ACPI_GPE_NOTIFY_INFO *Notify; + ACPI_GPE_NOTIFY_INFO *NewNotify; ACPI_CPU_FLAGS Flags; @@ -404,32 +411,88 @@ AcpiSetupGpeForWake ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* + * Allocate a new notify object up front, in case it is needed. + * Memory allocation while holding a spinlock is a big no-no + * on some hosts. + */ + NewNotify = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_NOTIFY_INFO)); + if (!NewNotify) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock); /* Ensure that we have a valid GPE number */ GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber); - if (GpeEventInfo) + if (!GpeEventInfo) { - /* - * If there is no method or handler for this GPE, then the - * WakeDevice will be notified whenever this GPE fires (aka - * "implicit notify") Note: The GPE is assumed to be - * level-triggered (for windows compatibility). - */ - if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == - ACPI_GPE_DISPATCH_NONE) - { - GpeEventInfo->Flags = - (ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED); - GpeEventInfo->Dispatch.DeviceNode = DeviceNode; - } - - GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE; - Status = AE_OK; + Status = AE_BAD_PARAMETER; + goto UnlockAndExit; } + /* + * If there is no method or handler for this GPE, then the + * WakeDevice will be notified whenever this GPE fires. This is + * known as an "implicit notify". Note: The GPE is assumed to be + * level-triggered (for windows compatibility). + */ + if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == + ACPI_GPE_DISPATCH_NONE) + { + /* + * This is the first device for implicit notify on this GPE. + * Just set the flags here, and enter the NOTIFY block below. + */ + GpeEventInfo->Flags = + (ACPI_GPE_DISPATCH_NOTIFY | ACPI_GPE_LEVEL_TRIGGERED); + } + + /* + * If we already have an implicit notify on this GPE, add + * this device to the notify list. + */ + if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == + ACPI_GPE_DISPATCH_NOTIFY) + { + /* Ensure that the device is not already in the list */ + + Notify = GpeEventInfo->Dispatch.NotifyList; + while (Notify) + { + if (Notify->DeviceNode == DeviceNode) + { + Status = AE_ALREADY_EXISTS; + goto UnlockAndExit; + } + Notify = Notify->Next; + } + + /* Add this device to the notify list for this GPE */ + + NewNotify->DeviceNode = DeviceNode; + NewNotify->Next = GpeEventInfo->Dispatch.NotifyList; + GpeEventInfo->Dispatch.NotifyList = NewNotify; + NewNotify = NULL; + } + + /* Mark the GPE as a possible wake event */ + + GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE; + Status = AE_OK; + + +UnlockAndExit: AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags); + + /* Delete the notify object if it was not used above */ + + if (NewNotify) + { + ACPI_FREE (NewNotify); + } return_ACPI_STATUS (Status); } @@ -493,21 +556,24 @@ AcpiSetGpeWakeMask ( goto UnlockAndExit; } - RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo); + RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); /* Perform the action */ switch (Action) { case ACPI_GPE_ENABLE: + ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit); break; case ACPI_GPE_DISABLE: + ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit); break; default: + ACPI_ERROR ((AE_INFO, "%u, Invalid action", Action)); Status = AE_BAD_PARAMETER; break; @@ -787,7 +853,7 @@ AcpiInstallGpeBlock ( Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } Node = AcpiNsValidateHandle (GpeDevice); @@ -797,6 +863,20 @@ AcpiInstallGpeBlock ( goto UnlockAndExit; } + /* Validate the parent device */ + + if (Node->Type != ACPI_TYPE_DEVICE) + { + Status = AE_TYPE; + goto UnlockAndExit; + } + + if (Node->Object) + { + Status = AE_ALREADY_EXISTS; + goto UnlockAndExit; + } + /* * For user-installed GPE Block Devices, the GpeBlockBaseNumber * is always zero @@ -880,7 +960,7 @@ AcpiRemoveGpeBlock ( Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } Node = AcpiNsValidateHandle (GpeDevice); @@ -890,6 +970,14 @@ AcpiRemoveGpeBlock ( goto UnlockAndExit; } + /* Validate the parent device */ + + if (Node->Type != ACPI_TYPE_DEVICE) + { + Status = AE_TYPE; + goto UnlockAndExit; + } + /* Get the DeviceObject attached to the node */ ObjDesc = AcpiNsGetAttachedObject (Node); @@ -970,3 +1058,5 @@ AcpiGetGpeDevice ( } ACPI_EXPORT_SYMBOL (AcpiGetGpeDevice) + +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/events/evxfregn.c b/reactos/drivers/bus/acpi/acpica/events/evxfregn.c index 552b0e0f471..014e3757fa3 100644 --- a/reactos/drivers/bus/acpi/acpica/events/evxfregn.c +++ b/reactos/drivers/bus/acpi/acpica/events/evxfregn.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -115,6 +115,7 @@ *****************************************************************************/ #define __EVXFREGN_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" @@ -221,6 +222,7 @@ AcpiInstallAddressSpaceHandler ( break; default: + break; } @@ -382,4 +384,3 @@ UnlockAndExit: } ACPI_EXPORT_SYMBOL (AcpiRemoveAddressSpaceHandler) - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exconfig.c b/reactos/drivers/bus/acpi/acpica/executer/exconfig.c index 341a05bac39..98caa14c957 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exconfig.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exconfig.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,11 +80,11 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -123,6 +123,7 @@ #include "actables.h" #include "acdispat.h" #include "acevents.h" +#include "amlcode.h" #define _COMPONENT ACPI_EXECUTER @@ -252,20 +253,21 @@ AcpiExLoadTableOp ( ACPI_FUNCTION_TRACE (ExLoadTableOp); - /* Validate lengths for the SignatureString, OEMIDString, OEMTableID */ + /* Validate lengths for the Signature, OemId, and OemTableId strings */ if ((Operand[0]->String.Length > ACPI_NAME_SIZE) || (Operand[1]->String.Length > ACPI_OEM_ID_SIZE) || (Operand[2]->String.Length > ACPI_OEM_TABLE_ID_SIZE)) { - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_STRING_LIMIT); } /* Find the ACPI table in the RSDT/XSDT */ - Status = AcpiTbFindTable (Operand[0]->String.Pointer, - Operand[1]->String.Pointer, - Operand[2]->String.Pointer, &TableIndex); + Status = AcpiTbFindTable ( + Operand[0]->String.Pointer, + Operand[1]->String.Pointer, + Operand[2]->String.Pointer, &TableIndex); if (ACPI_FAILURE (Status)) { if (Status != AE_NOT_FOUND) @@ -295,7 +297,7 @@ AcpiExLoadTableOp ( if (Operand[3]->String.Length > 0) { /* - * Find the node referenced by the RootPathString. This is the + * Find the node referenced by the RootPathString. This is the * location within the namespace where the table will be loaded. */ Status = AcpiNsGetNode (StartNode, Operand[3]->String.Pointer, @@ -310,8 +312,8 @@ AcpiExLoadTableOp ( if (Operand[4]->String.Length > 0) { - if ((Operand[4]->String.Pointer[0] != '\\') && - (Operand[4]->String.Pointer[0] != '^')) + if ((Operand[4]->String.Pointer[0] != AML_ROOT_PREFIX) && + (Operand[4]->String.Pointer[0] != AML_PARENT_PREFIX)) { /* * Path is not absolute, so it will be relative to the node @@ -372,7 +374,7 @@ AcpiExLoadTableOp ( } *ReturnDesc = DdbHandle; - return_ACPI_STATUS (Status); + return_ACPI_STATUS (Status); } @@ -407,7 +409,7 @@ AcpiExRegionRead ( for (i = 0; i < Length; i++) { - Status = AcpiEvAddressSpaceDispatch (ObjDesc, ACPI_READ, + Status = AcpiEvAddressSpaceDispatch (ObjDesc, NULL, ACPI_READ, RegionOffset, 8, &Value); if (ACPI_FAILURE (Status)) { @@ -451,8 +453,8 @@ AcpiExLoadOp ( ACPI_WALK_STATE *WalkState) { ACPI_OPERAND_OBJECT *DdbHandle; + ACPI_TABLE_HEADER *TableHeader; ACPI_TABLE_HEADER *Table; - ACPI_TABLE_DESC TableDesc; UINT32 TableIndex; ACPI_STATUS Status; UINT32 Length; @@ -461,8 +463,6 @@ AcpiExLoadOp ( ACPI_FUNCTION_TRACE (ExLoadOp); - ACPI_MEMSET (&TableDesc, 0, sizeof (ACPI_TABLE_DESC)); - /* Source Object can be either an OpRegion or a Buffer/Field */ switch (ObjDesc->Common.Type) @@ -494,16 +494,16 @@ AcpiExLoadOp ( /* Get the table header first so we can get the table length */ - Table = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER)); - if (!Table) + TableHeader = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER)); + if (!TableHeader) { return_ACPI_STATUS (AE_NO_MEMORY); } Status = AcpiExRegionRead (ObjDesc, sizeof (ACPI_TABLE_HEADER), - ACPI_CAST_PTR (UINT8, Table)); - Length = Table->Length; - ACPI_FREE (Table); + ACPI_CAST_PTR (UINT8, TableHeader)); + Length = TableHeader->Length; + ACPI_FREE (TableHeader); if (ACPI_FAILURE (Status)) { @@ -535,8 +535,8 @@ AcpiExLoadOp ( /* Allocate a buffer for the table */ - TableDesc.Pointer = ACPI_ALLOCATE (Length); - if (!TableDesc.Pointer) + Table = ACPI_ALLOCATE (Length); + if (!Table) { return_ACPI_STATUS (AE_NO_MEMORY); } @@ -544,17 +544,14 @@ AcpiExLoadOp ( /* Read the entire table */ Status = AcpiExRegionRead (ObjDesc, Length, - ACPI_CAST_PTR (UINT8, TableDesc.Pointer)); + ACPI_CAST_PTR (UINT8, Table)); if (ACPI_FAILURE (Status)) { - ACPI_FREE (TableDesc.Pointer); + ACPI_FREE (Table); return_ACPI_STATUS (Status); } - - TableDesc.Address = ObjDesc->Region.Address; break; - case ACPI_TYPE_BUFFER: /* Buffer or resolved RegionField */ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, @@ -569,8 +566,8 @@ AcpiExLoadOp ( /* Get the actual table length from the table header */ - Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer); - Length = Table->Length; + TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer); + Length = TableHeader->Length; /* Table cannot extend beyond the buffer */ @@ -587,43 +584,45 @@ AcpiExLoadOp ( * Copy the table from the buffer because the buffer could be modified * or even deleted in the future */ - TableDesc.Pointer = ACPI_ALLOCATE (Length); - if (!TableDesc.Pointer) + Table = ACPI_ALLOCATE (Length); + if (!Table) { return_ACPI_STATUS (AE_NO_MEMORY); } - ACPI_MEMCPY (TableDesc.Pointer, Table, Length); - TableDesc.Address = ACPI_TO_INTEGER (TableDesc.Pointer); + ACPI_MEMCPY (Table, TableHeader, Length); break; - default: + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } - /* Validate table checksum (will not get validated in TbAddTable) */ - - Status = AcpiTbVerifyChecksum (TableDesc.Pointer, Length); - if (ACPI_FAILURE (Status)) - { - ACPI_FREE (TableDesc.Pointer); - return_ACPI_STATUS (Status); - } - - /* Complete the table descriptor */ - - TableDesc.Length = Length; - TableDesc.Flags = ACPI_TABLE_ORIGIN_ALLOCATED; - /* Install the new table into the local data structures */ - Status = AcpiTbAddTable (&TableDesc, &TableIndex); + ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:")); + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + + Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table), + ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE, + &TableIndex); + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); if (ACPI_FAILURE (Status)) { /* Delete allocated table buffer */ - AcpiTbDeleteTable (&TableDesc); + ACPI_FREE (Table); + return_ACPI_STATUS (Status); + } + + /* + * Note: Now table is "INSTALLED", it must be validated before + * loading. + */ + Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]); + if (ACPI_FAILURE (Status)) + { return_ACPI_STATUS (Status); } @@ -655,9 +654,6 @@ AcpiExLoadOp ( return_ACPI_STATUS (Status); } - ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:")); - AcpiTbPrintTableHeader (0, TableDesc.Pointer); - /* Remove the reference by added by AcpiExStore above */ AcpiUtRemoveReference (DdbHandle); @@ -666,7 +662,7 @@ AcpiExLoadOp ( if (AcpiGbl_TableHandler) { - (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, TableDesc.Pointer, + (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table, AcpiGbl_TableHandlerContext); } @@ -699,6 +695,14 @@ AcpiExUnloadTable ( ACPI_FUNCTION_TRACE (ExUnloadTable); + /* + * Temporarily emit a warning so that the ASL for the machine can be + * hopefully obtained. This is to say that the Unload() operator is + * extremely rare if not completely unused. + */ + ACPI_WARNING ((AE_INFO, + "Received request to unload an ACPI table")); + /* * Validate the handle * Although the handle is partially validated in AcpiExReconfiguration() @@ -714,7 +718,7 @@ AcpiExUnloadTable ( (DdbHandle->Common.Type != ACPI_TYPE_LOCAL_REFERENCE) || (!(DdbHandle->Common.Flags & AOPOBJ_DATA_VALID))) { - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } /* Get the table index from the DdbHandle */ @@ -758,4 +762,3 @@ AcpiExUnloadTable ( DdbHandle->Common.Flags &= ~AOPOBJ_DATA_VALID; return_ACPI_STATUS (AE_OK); } - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exconvrt.c b/reactos/drivers/bus/acpi/acpica/executer/exconvrt.c index 67a0a26dce8..2b2fffd6447 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exconvrt.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exconvrt.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -186,6 +186,7 @@ AcpiExConvertToInteger ( break; default: + return_ACPI_STATUS (AE_TYPE); } @@ -205,7 +206,6 @@ AcpiExConvertToInteger ( switch (ObjDesc->Common.Type) { case ACPI_TYPE_STRING: - /* * Convert string to an integer - for most cases, the string must be * hexadecimal as per the ACPI specification. The only exception (as @@ -219,7 +219,6 @@ AcpiExConvertToInteger ( } break; - case ACPI_TYPE_BUFFER: /* Check for zero-length buffer */ @@ -251,10 +250,10 @@ AcpiExConvertToInteger ( } break; - default: /* No other types can get here */ + break; } @@ -271,7 +270,7 @@ AcpiExConvertToInteger ( /* Save the Result */ - AcpiExTruncateFor32bitTable (ReturnDesc); + (void) AcpiExTruncateFor32bitTable (ReturnDesc); *ResultDesc = ReturnDesc; return_ACPI_STATUS (AE_OK); } @@ -314,7 +313,6 @@ AcpiExConvertToBuffer ( case ACPI_TYPE_INTEGER: - /* * Create a new Buffer object. * Need enough space for one integer @@ -333,9 +331,7 @@ AcpiExConvertToBuffer ( AcpiGbl_IntegerByteWidth); break; - case ACPI_TYPE_STRING: - /* * Create a new Buffer object * Size will be the string length @@ -359,8 +355,8 @@ AcpiExConvertToBuffer ( ObjDesc->String.Length); break; - default: + return_ACPI_STATUS (AE_TYPE); } @@ -416,15 +412,18 @@ AcpiExConvertToAscii ( switch (DataWidth) { case 1: + DecimalLength = ACPI_MAX8_DECIMAL_DIGITS; break; case 4: + DecimalLength = ACPI_MAX32_DECIMAL_DIGITS; break; case 8: default: + DecimalLength = ACPI_MAX64_DECIMAL_DIGITS; break; } @@ -533,7 +532,6 @@ AcpiExConvertToString ( *ResultDesc = ObjDesc; return_ACPI_STATUS (AE_OK); - case ACPI_TYPE_INTEGER: switch (Type) @@ -577,7 +575,6 @@ AcpiExConvertToString ( NewBuf [StringLength] = 0; break; - case ACPI_TYPE_BUFFER: /* Setup string length, base, and separator */ @@ -676,6 +673,7 @@ AcpiExConvertToString ( break; default: + return_ACPI_STATUS (AE_TYPE); } @@ -735,6 +733,7 @@ AcpiExConvertToTargetType ( break; default: + /* No conversion allowed for these types */ if (DestinationType != SourceDesc->Common.Type) @@ -748,7 +747,6 @@ AcpiExConvertToTargetType ( } break; - case ARGI_TARGETREF: switch (DestinationType) @@ -765,7 +763,6 @@ AcpiExConvertToTargetType ( 16); break; - case ACPI_TYPE_STRING: /* * The operand must be a String. We can convert an @@ -775,7 +772,6 @@ AcpiExConvertToTargetType ( ACPI_IMPLICIT_CONVERT_HEX); break; - case ACPI_TYPE_BUFFER: /* * The operand must be a Buffer. We can convert an @@ -784,8 +780,8 @@ AcpiExConvertToTargetType ( Status = AcpiExConvertToBuffer (SourceDesc, ResultDesc); break; - default: + ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: 0x%X", DestinationType)); Status = AE_AML_INTERNAL; @@ -793,15 +789,14 @@ AcpiExConvertToTargetType ( } break; - case ARGI_REFERENCE: /* * CreateXxxxField cases - we are storing the field object into the name */ break; - default: + ACPI_ERROR ((AE_INFO, "Unknown Target type ID 0x%X AmlOpcode 0x%X DestType %s", GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs), @@ -822,5 +817,3 @@ AcpiExConvertToTargetType ( return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/excreate.c b/reactos/drivers/bus/acpi/acpica/executer/excreate.c index a9b92c16f3f..8f7b9e72d34 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/excreate.c +++ b/reactos/drivers/bus/acpi/acpica/executer/excreate.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,11 +80,11 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -162,7 +162,7 @@ AcpiExCreateAlias ( { /* * Dereference an existing alias so that we don't create a chain - * of aliases. With this code, we guarantee that an alias is + * of aliases. With this code, we guarantee that an alias is * always exactly one level of indirection away from the * actual aliased name. */ @@ -172,7 +172,7 @@ AcpiExCreateAlias ( /* * For objects that can never change (i.e., the NS node will * permanently point to the same object), we can simply attach - * the object to the new NS node. For other objects (such as + * the object to the new NS node. For other objects (such as * Integers, buffers, etc.), we have to point the Alias node * to the original Node. */ @@ -186,7 +186,6 @@ AcpiExCreateAlias ( case ACPI_TYPE_BUFFER: case ACPI_TYPE_PACKAGE: case ACPI_TYPE_BUFFER_FIELD: - /* * These types open a new scope, so we need the NS node in order to access * any children. @@ -196,7 +195,6 @@ AcpiExCreateAlias ( case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: case ACPI_TYPE_LOCAL_SCOPE: - /* * The new alias has the type ALIAS and points to the original * NS node, not the object itself. @@ -206,7 +204,6 @@ AcpiExCreateAlias ( break; case ACPI_TYPE_METHOD: - /* * Control method aliases need to be differentiated */ @@ -220,7 +217,7 @@ AcpiExCreateAlias ( /* * The new alias assumes the type of the target, and it points - * to the same object. The reference count of the object has an + * to the same object. The reference count of the object has an * additional reference to prevent deletion out from under either the * target node or the alias Node */ @@ -357,7 +354,7 @@ Cleanup: * * PARAMETERS: AmlStart - Pointer to the region declaration AML * AmlLength - Max length of the declaration AML - * RegionSpace - SpaceID for the region + * SpaceId - Address space ID for the region * WalkState - Current state * * RETURN: Status @@ -370,7 +367,7 @@ ACPI_STATUS AcpiExCreateRegion ( UINT8 *AmlStart, UINT32 AmlLength, - UINT8 RegionSpace, + UINT8 SpaceId, ACPI_WALK_STATE *WalkState) { ACPI_STATUS Status; @@ -399,16 +396,18 @@ AcpiExCreateRegion ( * Space ID must be one of the predefined IDs, or in the user-defined * range */ - if ((RegionSpace >= ACPI_NUM_PREDEFINED_REGIONS) && - (RegionSpace < ACPI_USER_REGION_BEGIN) && - (RegionSpace != ACPI_ADR_SPACE_DATA_TABLE)) + if (!AcpiIsValidSpaceId (SpaceId)) { - ACPI_ERROR ((AE_INFO, "Invalid AddressSpace type 0x%X", RegionSpace)); - return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); + /* + * Print an error message, but continue. We don't want to abort + * a table load for this exception. Instead, if the region is + * actually used at runtime, abort the executing method. + */ + ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId)); } ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n", - AcpiUtGetRegionName (RegionSpace), RegionSpace)); + AcpiUtGetRegionName (SpaceId), SpaceId)); /* Create the region descriptor */ @@ -426,10 +425,18 @@ AcpiExCreateRegion ( RegionObj2 = ObjDesc->Common.NextObject; RegionObj2->Extra.AmlStart = AmlStart; RegionObj2->Extra.AmlLength = AmlLength; + if (WalkState->ScopeInfo) + { + RegionObj2->Extra.ScopeNode = WalkState->ScopeInfo->Scope.Node; + } + else + { + RegionObj2->Extra.ScopeNode = Node; + } /* Init the region from the operands */ - ObjDesc->Region.SpaceId = RegionSpace; + ObjDesc->Region.SpaceId = SpaceId; ObjDesc->Region.Address = 0; ObjDesc->Region.Length = 0; ObjDesc->Region.Node = Node; @@ -633,5 +640,3 @@ Exit: AcpiUtRemoveReference (Operand[1]); return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exdebug.c b/reactos/drivers/bus/acpi/acpica/executer/exdebug.c index b1d7e072de7..e374e133545 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exdebug.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exdebug.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -234,9 +234,9 @@ AcpiExDoDebugObject ( case ACPI_TYPE_BUFFER: AcpiOsPrintf ("[0x%.2X]\n", (UINT32) SourceDesc->Buffer.Length); - AcpiUtDumpBuffer2 (SourceDesc->Buffer.Pointer, + AcpiUtDumpBuffer (SourceDesc->Buffer.Pointer, (SourceDesc->Buffer.Length < 256) ? - SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY); + SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY, 0); break; case ACPI_TYPE_STRING: @@ -277,9 +277,10 @@ AcpiExDoDebugObject ( /* Case for DdbHandle */ AcpiOsPrintf ("Table Index 0x%X\n", SourceDesc->Reference.Value); - return; + return_VOID; default: + break; } @@ -313,6 +314,7 @@ AcpiExDoDebugObject ( break; default: + AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object, Level+4, 0); break; @@ -346,5 +348,3 @@ AcpiExDoDebugObject ( return_VOID; } #endif - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exdump.c b/reactos/drivers/bus/acpi/acpica/executer/exdump.c index 44f7d3ba5ae..7f66714976d 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exdump.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exdump.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -186,13 +186,14 @@ static ACPI_EXDUMP_INFO AcpiExDumpBuffer[5] = {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpBuffer), NULL}, {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Buffer.Length), "Length"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Pointer), "Pointer"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"}, + {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"}, {ACPI_EXD_BUFFER, 0, NULL} }; -static ACPI_EXDUMP_INFO AcpiExDumpPackage[5] = +static ACPI_EXDUMP_INFO AcpiExDumpPackage[6] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage), NULL}, + {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Package.Node), "Parent Node"}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Package.Flags), "Flags"}, {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Elements"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Package.Elements), "Element List"}, @@ -202,9 +203,9 @@ static ACPI_EXDUMP_INFO AcpiExDumpPackage[5] = static ACPI_EXDUMP_INFO AcpiExDumpDevice[4] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice), NULL}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.Handler), "Handler"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.SystemNotify), "System Notify"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.DeviceNotify), "Device Notify"} + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[0]), "System Notify"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"}, + {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Device.Handler), "Handler"} }; static ACPI_EXDUMP_INFO AcpiExDumpEvent[2] = @@ -226,33 +227,36 @@ static ACPI_EXDUMP_INFO AcpiExDumpMethod[9] = {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.AmlStart), "Aml Start"} }; -static ACPI_EXDUMP_INFO AcpiExDumpMutex[5] = +static ACPI_EXDUMP_INFO AcpiExDumpMutex[6] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpMutex), NULL}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.SyncLevel), "Sync Level"}, + {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.OriginalSyncLevel), "Original Sync Level"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OwnerThread), "Owner Thread"}, {ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Mutex.AcquisitionDepth), "Acquire Depth"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OsMutex), "OsMutex"} }; -static ACPI_EXDUMP_INFO AcpiExDumpRegion[7] = +static ACPI_EXDUMP_INFO AcpiExDumpRegion[8] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegion), NULL}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.SpaceId), "Space Id"}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.Flags), "Flags"}, + {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Region.Node), "Parent Node"}, {ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Region.Address), "Address"}, {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Region.Length), "Length"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Handler), "Handler"}, + {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Region.Handler), "Handler"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Next), "Next"} }; -static ACPI_EXDUMP_INFO AcpiExDumpPower[5] = +static ACPI_EXDUMP_INFO AcpiExDumpPower[6] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPower), NULL}, {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.SystemLevel), "System Level"}, {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.ResourceOrder), "Resource Order"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.SystemNotify), "System Notify"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.DeviceNotify), "Device Notify"} + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[0]), "System Notify"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.Handler), "Handler"} }; static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] = @@ -261,16 +265,16 @@ static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] = {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Processor.ProcId), "Processor ID"}, {ACPI_EXD_UINT8 , ACPI_EXD_OFFSET (Processor.Length), "Length"}, {ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Processor.Address), "Address"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.SystemNotify), "System Notify"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.DeviceNotify), "Device Notify"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.NotifyList[0]), "System Notify"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.NotifyList[1]), "Device Notify"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.Handler), "Handler"} }; static ACPI_EXDUMP_INFO AcpiExDumpThermal[4] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpThermal), NULL}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.SystemNotify), "System Notify"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.DeviceNotify), "Device Notify"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.NotifyList[0]), "System Notify"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.NotifyList[1]), "Device Notify"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.Handler), "Handler"} }; @@ -281,11 +285,13 @@ static ACPI_EXDUMP_INFO AcpiExDumpBufferField[3] = {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (BufferField.BufferObj), "Buffer Object"} }; -static ACPI_EXDUMP_INFO AcpiExDumpRegionField[3] = +static ACPI_EXDUMP_INFO AcpiExDumpRegionField[5] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField), NULL}, {ACPI_EXD_FIELD, 0, NULL}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"} + {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Field.AccessLength), "AccessLength"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.ResourceBuffer), "ResourceBuffer"} }; static ACPI_EXDUMP_INFO AcpiExDumpBankField[5] = @@ -313,7 +319,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpReference[8] = {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Reference.TargetType), "Target Type"}, {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Reference.Value), "Value"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Object), "Object Desc"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Node), "Node"}, + {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Reference.Node), "Node"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Where), "Where"}, {ACPI_EXD_REFERENCE,0, NULL} }; @@ -322,28 +328,49 @@ static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler[6] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler), NULL}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (AddressSpace.SpaceId), "Space Id"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Next), "Next"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"}, + {ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (AddressSpace.Next), "Next"}, + {ACPI_EXD_RGN_LIST, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"}, + {ACPI_EXD_NODE, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"}, {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Context), "Context"} }; -static ACPI_EXDUMP_INFO AcpiExDumpNotify[3] = +static ACPI_EXDUMP_INFO AcpiExDumpNotify[7] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify), NULL}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Node), "Node"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"} + {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Notify.Node), "Node"}, + {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Notify.HandlerType), "Handler Type"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Handler), "Handler"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[0]), "Next System Notify"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[1]), "Next Device Notify"} }; +static ACPI_EXDUMP_INFO AcpiExDumpExtra[6] = +{ + {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpExtra), NULL}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.Method_REG), "_REG Method"}, + {ACPI_EXD_NODE, ACPI_EXD_OFFSET (Extra.ScopeNode), "Scope Node"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.RegionContext), "Region Context"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.AmlStart), "Aml Start"}, + {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Extra.AmlLength), "Aml Length"} +}; + +static ACPI_EXDUMP_INFO AcpiExDumpData[3] = +{ + {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpData), NULL}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Handler), "Handler"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Pointer), "Raw Data"} +}; /* Miscellaneous tables */ -static ACPI_EXDUMP_INFO AcpiExDumpCommon[4] = +static ACPI_EXDUMP_INFO AcpiExDumpCommon[5] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon), NULL}, {ACPI_EXD_TYPE , 0, NULL}, {ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Common.ReferenceCount), "Reference Count"}, - {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"} + {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"}, + {ACPI_EXD_LIST, ACPI_EXD_OFFSET (Common.NextObject), "Object List"} }; static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] = @@ -354,16 +381,18 @@ static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] = {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BitLength), "Bit Length"}, {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (CommonField.StartFieldBitOffset),"Field Bit Offset"}, {ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BaseByteOffset), "Base Byte Offset"}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"} + {ACPI_EXD_NODE, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"} }; -static ACPI_EXDUMP_INFO AcpiExDumpNode[5] = +static ACPI_EXDUMP_INFO AcpiExDumpNode[7] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode), NULL}, {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (Flags), "Flags"}, {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (OwnerId), "Owner Id"}, - {ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET (Child), "Child List"}, - {ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET (Peer), "Next Peer"} + {ACPI_EXD_LIST, ACPI_EXD_NSOFFSET (Object), "Object List"}, + {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Parent), "Parent"}, + {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Child), "Child"}, + {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Peer), "Peer"} }; @@ -398,7 +427,9 @@ static ACPI_EXDUMP_INFO *AcpiExDumpInfo[] = AcpiExDumpAddressHandler, NULL, NULL, - NULL + NULL, + AcpiExDumpExtra, + AcpiExDumpData }; @@ -423,7 +454,12 @@ AcpiExDumpObject ( { UINT8 *Target; char *Name; + const char *ReferenceName; UINT8 Count; + ACPI_OPERAND_OBJECT *Start; + ACPI_OPERAND_OBJECT *Data = NULL; + ACPI_OPERAND_OBJECT *Next; + ACPI_NAMESPACE_NODE *Node; if (!Info) @@ -446,11 +482,13 @@ AcpiExDumpObject ( switch (Info->Opcode) { case ACPI_EXD_INIT: + break; case ACPI_EXD_TYPE: - AcpiExOutString ("Type", AcpiUtGetObjectTypeName (ObjDesc)); + AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type", + ObjDesc->Common.Type, AcpiUtGetObjectTypeName (ObjDesc)); break; case ACPI_EXD_UINT8: @@ -506,11 +544,125 @@ AcpiExDumpObject ( case ACPI_EXD_REFERENCE: - AcpiExOutString ("Class Name", - ACPI_CAST_PTR (char, AcpiUtGetReferenceName (ObjDesc))); + ReferenceName = AcpiUtGetReferenceName (ObjDesc); + AcpiExOutString ("Class Name", ACPI_CAST_PTR (char, ReferenceName)); AcpiExDumpReferenceObj (ObjDesc); break; + case ACPI_EXD_LIST: + + Start = *ACPI_CAST_PTR (void *, Target); + Next = Start; + + AcpiOsPrintf ("%20s : %p", Name, Next); + if (Next) + { + AcpiOsPrintf ("(%s %2.2X)", + AcpiUtGetObjectTypeName (Next), Next->Common.Type); + + while (Next->Common.NextObject) + { + if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) && + !Data) + { + Data = Next; + } + + Next = Next->Common.NextObject; + AcpiOsPrintf ("->%p(%s %2.2X)", Next, + AcpiUtGetObjectTypeName (Next), Next->Common.Type); + + if ((Next == Start) || (Next == Data)) + { + AcpiOsPrintf ("\n**** Error: Object list appears to be circular linked"); + break; + } + } + } + + AcpiOsPrintf ("\n", Next); + break; + + case ACPI_EXD_HDLR_LIST: + + Start = *ACPI_CAST_PTR (void *, Target); + Next = Start; + + AcpiOsPrintf ("%20s : %p", Name, Next); + if (Next) + { + AcpiOsPrintf ("(%s %2.2X)", + AcpiUtGetObjectTypeName (Next), Next->Common.Type); + + while (Next->AddressSpace.Next) + { + if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) && + !Data) + { + Data = Next; + } + + Next = Next->AddressSpace.Next; + AcpiOsPrintf ("->%p(%s %2.2X)", Next, + AcpiUtGetObjectTypeName (Next), Next->Common.Type); + + if ((Next == Start) || (Next == Data)) + { + AcpiOsPrintf ("\n**** Error: Handler list appears to be circular linked"); + break; + } + } + } + + AcpiOsPrintf ("\n", Next); + break; + + case ACPI_EXD_RGN_LIST: + + Start = *ACPI_CAST_PTR (void *, Target); + Next = Start; + + AcpiOsPrintf ("%20s : %p", Name, Next); + if (Next) + { + AcpiOsPrintf ("(%s %2.2X)", + AcpiUtGetObjectTypeName (Next), Next->Common.Type); + + while (Next->Region.Next) + { + if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) && + !Data) + { + Data = Next; + } + + Next = Next->Region.Next; + AcpiOsPrintf ("->%p(%s %2.2X)", Next, + AcpiUtGetObjectTypeName (Next), Next->Common.Type); + + if ((Next == Start) || (Next == Data)) + { + AcpiOsPrintf ("\n**** Error: Region list appears to be circular linked"); + break; + } + } + } + + AcpiOsPrintf ("\n", Next); + break; + + case ACPI_EXD_NODE: + + Node = *ACPI_CAST_PTR (ACPI_NAMESPACE_NODE *, Target); + + AcpiOsPrintf ("%20s : %p", Name, Node); + if (Node) + { + AcpiOsPrintf (" [%4.4s]", Node->Name.Ascii); + } + AcpiOsPrintf ("\n"); + break; + default: AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n", @@ -549,7 +701,9 @@ AcpiExDumpOperand ( ACPI_FUNCTION_NAME (ExDumpOperand) - if (!((ACPI_LV_EXEC & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_EXEC, _COMPONENT)) { return; } @@ -605,19 +759,16 @@ AcpiExDumpOperand ( AcpiOsPrintf ("\n"); break; - case ACPI_REFCLASS_INDEX: AcpiOsPrintf ("%p\n", ObjDesc->Reference.Object); break; - case ACPI_REFCLASS_TABLE: AcpiOsPrintf ("Table Index %X\n", ObjDesc->Reference.Value); break; - case ACPI_REFCLASS_REFOF: AcpiOsPrintf ("%p [%s]\n", ObjDesc->Reference.Object, @@ -625,20 +776,17 @@ AcpiExDumpOperand ( ObjDesc->Reference.Object)->Common.Type)); break; - case ACPI_REFCLASS_NAME: AcpiOsPrintf ("- [%4.4s]\n", ObjDesc->Reference.Node->Name.Ascii); break; - case ACPI_REFCLASS_ARG: case ACPI_REFCLASS_LOCAL: AcpiOsPrintf ("%X\n", ObjDesc->Reference.Value); break; - default: /* Unknown reference class */ AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class); @@ -646,7 +794,6 @@ AcpiExDumpOperand ( } break; - case ACPI_TYPE_BUFFER: AcpiOsPrintf ("Buffer length %.2X @ %p\n", @@ -668,14 +815,12 @@ AcpiExDumpOperand ( } break; - case ACPI_TYPE_INTEGER: AcpiOsPrintf ("Integer %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; - case ACPI_TYPE_PACKAGE: AcpiOsPrintf ("Package [Len %X] ElementArray %p\n", @@ -696,7 +841,6 @@ AcpiExDumpOperand ( } break; - case ACPI_TYPE_REGION: AcpiOsPrintf ("Region %s (%X)", @@ -719,7 +863,6 @@ AcpiExDumpOperand ( } break; - case ACPI_TYPE_STRING: AcpiOsPrintf ("String length %X @ %p ", @@ -730,13 +873,11 @@ AcpiExDumpOperand ( AcpiOsPrintf ("\n"); break; - case ACPI_TYPE_LOCAL_BANK_FIELD: AcpiOsPrintf ("BankField\n"); break; - case ACPI_TYPE_LOCAL_REGION_FIELD: AcpiOsPrintf ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at " @@ -751,13 +892,11 @@ AcpiExDumpOperand ( AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth+1); break; - case ACPI_TYPE_LOCAL_INDEX_FIELD: AcpiOsPrintf ("IndexField\n"); break; - case ACPI_TYPE_BUFFER_FIELD: AcpiOsPrintf ("BufferField: %X bits at byte %X bit %X of\n", @@ -780,13 +919,11 @@ AcpiExDumpOperand ( } break; - case ACPI_TYPE_EVENT: AcpiOsPrintf ("Event\n"); break; - case ACPI_TYPE_METHOD: AcpiOsPrintf ("Method(%X) @ %p:%X\n", @@ -795,38 +932,33 @@ AcpiExDumpOperand ( ObjDesc->Method.AmlLength); break; - case ACPI_TYPE_MUTEX: AcpiOsPrintf ("Mutex\n"); break; - case ACPI_TYPE_DEVICE: AcpiOsPrintf ("Device\n"); break; - case ACPI_TYPE_POWER: AcpiOsPrintf ("Power\n"); break; - case ACPI_TYPE_PROCESSOR: AcpiOsPrintf ("Processor\n"); break; - case ACPI_TYPE_THERMAL: AcpiOsPrintf ("Thermal\n"); break; - default: + /* Unknown Type */ AcpiOsPrintf ("Unknown Type %X\n", ObjDesc->Common.Type); @@ -894,7 +1026,7 @@ AcpiExDumpOperands ( * PARAMETERS: Title - Descriptive text * Value - Value to be displayed * - * DESCRIPTION: Object dump output formatting functions. These functions + * DESCRIPTION: Object dump output formatting functions. These functions * reduce the number of format strings required and keeps them * all in one place for easy modification. * @@ -939,16 +1071,17 @@ AcpiExDumpNamespaceNode ( if (!Flags) { - if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT)) { return; } } AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node)); - AcpiExOutString ("Type", AcpiUtGetTypeName (Node->Type)); - AcpiExOutPointer ("Attached Object", AcpiNsGetAttachedObject (Node)); - AcpiExOutPointer ("Parent", Node->Parent); + AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type", + Node->Type, AcpiUtGetTypeName (Node->Type)); AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node), AcpiExDumpNode); @@ -1067,24 +1200,19 @@ AcpiExDumpPackageObj ( ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; - case ACPI_TYPE_STRING: AcpiOsPrintf ("[String] Value: "); - for (i = 0; i < ObjDesc->String.Length; i++) - { - AcpiOsPrintf ("%c", ObjDesc->String.Pointer[i]); - } + AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX); AcpiOsPrintf ("\n"); break; - case ACPI_TYPE_BUFFER: AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length); if (ObjDesc->Buffer.Length) { - AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), + AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer), ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT); } else @@ -1093,7 +1221,6 @@ AcpiExDumpPackageObj ( } break; - case ACPI_TYPE_PACKAGE: AcpiOsPrintf ("[Package] Contains %u Elements:\n", @@ -1105,7 +1232,6 @@ AcpiExDumpPackageObj ( } break; - case ACPI_TYPE_LOCAL_REFERENCE: AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X", @@ -1114,7 +1240,6 @@ AcpiExDumpPackageObj ( AcpiExDumpReferenceObj (ObjDesc); break; - default: AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Common.Type); @@ -1149,7 +1274,9 @@ AcpiExDumpObjectDescriptor ( if (!Flags) { - if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer))) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT)) { return_VOID; } @@ -1162,24 +1289,30 @@ AcpiExDumpObjectDescriptor ( AcpiOsPrintf ("\nAttached Object (%p):\n", ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object); - AcpiExDumpObjectDescriptor ( - ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object, Flags); - return_VOID; + ObjDesc = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object; + goto DumpObject; } if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) { AcpiOsPrintf ( - "ExDumpObjectDescriptor: %p is not an ACPI operand object: [%s]\n", + "%p is not an ACPI operand object: [%s]\n", ObjDesc, AcpiUtGetDescriptorName (ObjDesc)); return_VOID; } - if (ObjDesc->Common.Type > ACPI_TYPE_NS_NODE_MAX) + /* Validate the object type */ + + if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX) { + AcpiOsPrintf ("Not a known object type: %2.2X\n", + ObjDesc->Common.Type); return_VOID; } + +DumpObject: + /* Common Fields */ AcpiExDumpObject (ObjDesc, AcpiExDumpCommon); @@ -1187,8 +1320,23 @@ AcpiExDumpObjectDescriptor ( /* Object-specific fields */ AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]); + + if (ObjDesc->Common.Type == ACPI_TYPE_REGION) + { + ObjDesc = ObjDesc->Common.NextObject; + if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX) + { + AcpiOsPrintf ("Secondary object is not a known object type: %2.2X\n", + ObjDesc->Common.Type); + + return_VOID; + } + + AcpiOsPrintf ("\nExtra attached Object (%p):\n", ObjDesc); + AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]); + } + return_VOID; } #endif - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exfield.c b/reactos/drivers/bus/acpi/acpica/executer/exfield.c index 3cec69aafc0..3cb1b124038 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exfield.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exfield.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -136,7 +136,7 @@ * * RETURN: Status * - * DESCRIPTION: Read from a named field. Returns either an Integer or a + * DESCRIPTION: Read from a named field. Returns either an Integer or a * Buffer, depending on the size of the field. * ******************************************************************************/ @@ -185,19 +185,25 @@ AcpiExReadDataFromField ( } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI)) { /* - * This is an SMBus or IPMI read. We must create a buffer to hold + * This is an SMBus, GSBus or IPMI read. We must create a buffer to hold * the data and then directly access the region handler. * - * Note: Smbus protocol value is passed in upper 16-bits of Function + * Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function */ if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS) { Length = ACPI_SMBUS_BUFFER_SIZE; Function = ACPI_READ | (ObjDesc->Field.Attribute << 16); } + else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) + { + Length = ACPI_GSBUS_BUFFER_SIZE; + Function = ACPI_READ | (ObjDesc->Field.Attribute << 16); + } else /* IPMI */ { Length = ACPI_IPMI_BUFFER_SIZE; @@ -227,7 +233,7 @@ AcpiExReadDataFromField ( * Allocate a buffer for the contents of the field. * * If the field is larger than the current integer width, create - * a BUFFER to hold it. Otherwise, use an INTEGER. This allows + * a BUFFER to hold it. Otherwise, use an INTEGER. This allows * the use of arithmetic operators on the returned value if the * field size is equal or smaller than an Integer. * @@ -346,23 +352,24 @@ AcpiExWriteDataToField ( } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI)) { /* - * This is an SMBus or IPMI write. We will bypass the entire field + * This is an SMBus, GSBus or IPMI write. We will bypass the entire field * mechanism and handoff the buffer directly to the handler. For * these address spaces, the buffer is bi-directional; on a write, * return data is returned in the same buffer. * * Source must be a buffer of sufficient size: - * ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE. + * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE. * - * Note: SMBus protocol type is passed in upper 16-bits of Function + * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function */ if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER) { ACPI_ERROR ((AE_INFO, - "SMBus or IPMI write requires Buffer, found type %s", + "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); @@ -373,6 +380,11 @@ AcpiExWriteDataToField ( Length = ACPI_SMBUS_BUFFER_SIZE; Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); } + else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) + { + Length = ACPI_GSBUS_BUFFER_SIZE; + Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); + } else /* IPMI */ { Length = ACPI_IPMI_BUFFER_SIZE; @@ -382,7 +394,7 @@ AcpiExWriteDataToField ( if (SourceDesc->Buffer.Length < Length) { ACPI_ERROR ((AE_INFO, - "SMBus or IPMI write requires Buffer of length %u, found length %u", + "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u", Length, SourceDesc->Buffer.Length)); return_ACPI_STATUS (AE_AML_BUFFER_LIMIT); @@ -420,21 +432,25 @@ AcpiExWriteDataToField ( switch (SourceDesc->Common.Type) { case ACPI_TYPE_INTEGER: + Buffer = &SourceDesc->Integer.Value; Length = sizeof (SourceDesc->Integer.Value); break; case ACPI_TYPE_BUFFER: + Buffer = SourceDesc->Buffer.Pointer; Length = SourceDesc->Buffer.Length; break; case ACPI_TYPE_STRING: + Buffer = SourceDesc->String.Pointer; Length = SourceDesc->String.Length; break; default: + return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } @@ -462,5 +478,3 @@ AcpiExWriteDataToField ( return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exfldio.c b/reactos/drivers/bus/acpi/acpica/executer/exfldio.c index 55aacef4a43..51a1e6dd382 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exfldio.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exfldio.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -158,7 +158,7 @@ AcpiExSetupRegion ( * RETURN: Status * * DESCRIPTION: Common processing for AcpiExExtractFromField and - * AcpiExInsertIntoField. Initialize the Region if necessary and + * AcpiExInsertIntoField. Initialize the Region if necessary and * validate the request. * ******************************************************************************/ @@ -170,6 +170,7 @@ AcpiExSetupRegion ( { ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *RgnDesc; + UINT8 SpaceId; ACPI_FUNCTION_TRACE_U32 (ExSetupRegion, FieldDatumByteOffset); @@ -188,6 +189,16 @@ AcpiExSetupRegion ( return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } + SpaceId = RgnDesc->Region.SpaceId; + + /* Validate the Space ID */ + + if (!AcpiIsValidSpaceId (SpaceId)) + { + ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId)); + return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); + } + /* * If the Region Address and Length have not been previously evaluated, * evaluate them now and save the results. @@ -202,11 +213,12 @@ AcpiExSetupRegion ( } /* - * Exit now for SMBus or IPMI address space, it has a non-linear + * Exit now for SMBus, GSBus or IPMI address space, it has a non-linear * address space and the request cannot be directly validated */ - if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || - RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_IPMI) + if (SpaceId == ACPI_ADR_SPACE_SMBUS || + SpaceId == ACPI_ADR_SPACE_GSBUS || + SpaceId == ACPI_ADR_SPACE_IPMI) { /* SMBus or IPMI has a non-linear address space */ @@ -228,7 +240,7 @@ AcpiExSetupRegion ( #endif /* - * Validate the request. The entire request from the byte offset for a + * Validate the request. The entire request from the byte offset for a * length of one field datum (access width) must fit within the region. * (Region length is specified in bytes) */ @@ -257,7 +269,7 @@ AcpiExSetupRegion ( { /* * This is the case where the AccessType (AccWord, etc.) is wider - * than the region itself. For example, a region of length one + * than the region itself. For example, a region of length one * byte, and a field with Dword access specified. */ ACPI_ERROR ((AE_INFO, @@ -362,7 +374,8 @@ AcpiExAccessRegion ( /* Invoke the appropriate AddressSpace/OpRegion handler */ - Status = AcpiEvAddressSpaceDispatch (RgnDesc, Function, RegionOffset, + Status = AcpiEvAddressSpaceDispatch (RgnDesc, ObjDesc, + Function, RegionOffset, ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth), Value); if (ACPI_FAILURE (Status)) @@ -398,7 +411,7 @@ AcpiExAccessRegion ( * * DESCRIPTION: Check if a value is out of range of the field being written. * Used to check if the values written to Index and Bank registers - * are out of range. Normally, the value is simply truncated + * are out of range. Normally, the value is simply truncated * to fit the field, but this case is most likely a serious * coding error in the ASL. * @@ -425,6 +438,11 @@ AcpiExRegisterOverflow ( * The Value is larger than the maximum value that can fit into * the register. */ + ACPI_ERROR ((AE_INFO, + "Index value 0x%8.8X%8.8X overflows field width 0x%X", + ACPI_FORMAT_UINT64 (Value), + ObjDesc->CommonField.BitLength)); + return (TRUE); } @@ -446,7 +464,7 @@ AcpiExRegisterOverflow ( * * RETURN: Status * - * DESCRIPTION: Read or Write a single datum of a field. The FieldType is + * DESCRIPTION: Read or Write a single datum of a field. The FieldType is * demultiplexed here to handle the different types of fields * (BufferField, RegionField, IndexField, BankField) * @@ -534,9 +552,7 @@ AcpiExFieldDatumIo ( Status = AE_OK; break; - case ACPI_TYPE_LOCAL_BANK_FIELD: - /* * Ensure that the BankValue is not beyond the capacity of * the register @@ -566,7 +582,6 @@ AcpiExFieldDatumIo ( /*lint -fallthrough */ - case ACPI_TYPE_LOCAL_REGION_FIELD: /* * For simple RegionFields, we just directly access the owning @@ -576,10 +591,7 @@ AcpiExFieldDatumIo ( ReadWrite); break; - case ACPI_TYPE_LOCAL_INDEX_FIELD: - - /* * Ensure that the IndexValue is not beyond the capacity of * the register @@ -629,7 +641,6 @@ AcpiExFieldDatumIo ( } break; - default: ACPI_ERROR ((AE_INFO, "Wrong object type in field I/O %u", @@ -820,7 +831,18 @@ AcpiExExtractFromField ( if ((ObjDesc->CommonField.StartFieldBitOffset == 0) && (ObjDesc->CommonField.BitLength == AccessBitWidth)) { - Status = AcpiExFieldDatumIo (ObjDesc, 0, Buffer, ACPI_READ); + if (BufferLength >= sizeof (UINT64)) + { + Status = AcpiExFieldDatumIo (ObjDesc, 0, Buffer, ACPI_READ); + } + else + { + /* Use RawDatum (UINT64) to handle buffers < 64 bits */ + + Status = AcpiExFieldDatumIo (ObjDesc, 0, &RawDatum, ACPI_READ); + ACPI_MEMCPY (Buffer, &RawDatum, BufferLength); + } + return_ACPI_STATUS (Status); } @@ -960,7 +982,7 @@ AcpiExInsertIntoField ( ObjDesc->CommonField.BitLength); /* * We must have a buffer that is at least as long as the field - * we are writing to. This is because individual fields are + * we are writing to. This is because individual fields are * indivisible and partial writes are not supported -- as per * the ACPI specification. */ @@ -976,7 +998,7 @@ AcpiExInsertIntoField ( /* * Copy the original data to the new buffer, starting - * at Byte zero. All unused (upper) bytes of the + * at Byte zero. All unused (upper) bytes of the * buffer will be 0. */ ACPI_MEMCPY ((char *) NewBuffer, (char *) Buffer, BufferLength); @@ -1105,5 +1127,3 @@ Exit: } return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exmisc.c b/reactos/drivers/bus/acpi/acpica/executer/exmisc.c index 41a6d3aadf0..b78425c9c08 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exmisc.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exmisc.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,11 +80,11 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -94,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -189,16 +188,13 @@ AcpiExGetObjectReference ( } break; - case ACPI_DESC_TYPE_NAMED: - /* * A named reference that has already been resolved to a Node */ ReferencedObj = ObjDesc; break; - default: ACPI_ERROR ((AE_INFO, "Invalid descriptor type 0x%X", @@ -351,7 +347,7 @@ AcpiExDoConcatenate ( /* - * Convert the second operand if necessary. The first operand + * Convert the second operand if necessary. The first operand * determines the type of the second operand, (See the Data Types * section of the ACPI specification.) Both object types are * guaranteed to be either Integer/String/Buffer by the operand @@ -360,19 +356,23 @@ AcpiExDoConcatenate ( switch (Operand0->Common.Type) { case ACPI_TYPE_INTEGER: + Status = AcpiExConvertToInteger (Operand1, &LocalOperand1, 16); break; case ACPI_TYPE_STRING: + Status = AcpiExConvertToString (Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX); break; case ACPI_TYPE_BUFFER: + Status = AcpiExConvertToBuffer (Operand1, &LocalOperand1); break; default: + ACPI_ERROR ((AE_INFO, "Invalid object type: 0x%X", Operand0->Common.Type)); Status = AE_AML_INTERNAL; @@ -524,37 +524,30 @@ AcpiExDoMathOp ( return (Integer0 + Integer1); - case AML_BIT_AND_OP: /* And (Integer0, Integer1, Result) */ return (Integer0 & Integer1); - case AML_BIT_NAND_OP: /* NAnd (Integer0, Integer1, Result) */ return (~(Integer0 & Integer1)); - case AML_BIT_OR_OP: /* Or (Integer0, Integer1, Result) */ return (Integer0 | Integer1); - case AML_BIT_NOR_OP: /* NOr (Integer0, Integer1, Result) */ return (~(Integer0 | Integer1)); - case AML_BIT_XOR_OP: /* XOr (Integer0, Integer1, Result) */ return (Integer0 ^ Integer1); - case AML_MULTIPLY_OP: /* Multiply (Integer0, Integer1, Result) */ return (Integer0 * Integer1); - case AML_SHIFT_LEFT_OP: /* ShiftLeft (Operand, ShiftCount, Result)*/ /* @@ -567,7 +560,6 @@ AcpiExDoMathOp ( } return (Integer0 << Integer1); - case AML_SHIFT_RIGHT_OP: /* ShiftRight (Operand, ShiftCount, Result) */ /* @@ -580,7 +572,6 @@ AcpiExDoMathOp ( } return (Integer0 >> Integer1); - case AML_SUBTRACT_OP: /* Subtract (Integer0, Integer1, Result) */ return (Integer0 - Integer1); @@ -645,6 +636,7 @@ AcpiExDoLogicalNumericOp ( break; default: + Status = AE_AML_INTERNAL; break; } @@ -703,7 +695,7 @@ AcpiExDoLogicalOp ( /* - * Convert the second operand if necessary. The first operand + * Convert the second operand if necessary. The first operand * determines the type of the second operand, (See the Data Types * section of the ACPI 3.0+ specification.) Both object types are * guaranteed to be either Integer/String/Buffer by the operand @@ -712,19 +704,23 @@ AcpiExDoLogicalOp ( switch (Operand0->Common.Type) { case ACPI_TYPE_INTEGER: + Status = AcpiExConvertToInteger (Operand1, &LocalOperand1, 16); break; case ACPI_TYPE_STRING: + Status = AcpiExConvertToString (Operand1, &LocalOperand1, ACPI_IMPLICIT_CONVERT_HEX); break; case ACPI_TYPE_BUFFER: + Status = AcpiExConvertToBuffer (Operand1, &LocalOperand1); break; default: + Status = AE_AML_INTERNAL; break; } @@ -773,6 +769,7 @@ AcpiExDoLogicalOp ( break; default: + Status = AE_AML_INTERNAL; break; } @@ -850,6 +847,7 @@ AcpiExDoLogicalOp ( break; default: + Status = AE_AML_INTERNAL; break; } @@ -869,5 +867,3 @@ Cleanup: *LogicalResult = LocalResult; return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exmutex.c b/reactos/drivers/bus/acpi/acpica/executer/exmutex.c index 1ce899289b9..a613c54563a 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exmutex.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exmutex.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exmutex - ASL Mutex Acquire/Release functions @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -413,7 +412,7 @@ AcpiExReleaseMutexObject ( if (ObjDesc->Mutex.AcquisitionDepth == 0) { - return (AE_NOT_ACQUIRED); + return_ACPI_STATUS (AE_NOT_ACQUIRED); } /* Match multiple Acquires with multiple Releases */ @@ -587,7 +586,7 @@ AcpiExReleaseAllMutexes ( ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_FUNCTION_ENTRY (); + ACPI_FUNCTION_NAME (ExReleaseAllMutexes); /* Traverse the list of owned mutexes, releasing each one */ @@ -601,6 +600,9 @@ AcpiExReleaseAllMutexes ( ObjDesc->Mutex.Next = NULL; ObjDesc->Mutex.AcquisitionDepth = 0; + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Force-releasing held mutex: %p\n", ObjDesc)); + /* Release the mutex, special case for Global Lock */ if (ObjDesc == AcpiGbl_GlobalLockMutex) diff --git a/reactos/drivers/bus/acpi/acpica/executer/exnames.c b/reactos/drivers/bus/acpi/acpica/executer/exnames.c index 8fd609823be..e8dc00c0dde 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exnames.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exnames.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exnames - interpreter/scanner name load/execute @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -145,7 +144,7 @@ AcpiExNameSegment ( * (-1)==root, 0==none * NumNameSegs - count of 4-character name segments * - * RETURN: A pointer to the allocated string segment. This segment must + * RETURN: A pointer to the allocated string segment. This segment must * be deleted by the caller. * * DESCRIPTION: Allocate a buffer for a name string. Ensure allocated name @@ -407,7 +406,6 @@ AcpiExGetNameString ( HasPrefix = TRUE; break; - case AML_PARENT_PREFIX: /* Increment past possibly multiple parent prefixes */ @@ -425,7 +423,6 @@ AcpiExGetNameString ( HasPrefix = TRUE; break; - default: /* Not a prefix character */ @@ -461,7 +458,6 @@ AcpiExGetNameString ( } break; - case AML_MULTI_NAME_PREFIX_OP: ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "MultiNamePrefix at %p\n", @@ -493,7 +489,6 @@ AcpiExGetNameString ( break; - case 0: /* NullName valid as of 8-12-98 ASL/AML Grammar Update */ @@ -516,7 +511,6 @@ AcpiExGetNameString ( break; - default: /* Name segment string */ @@ -556,5 +550,3 @@ AcpiExGetNameString ( return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exoparg1.c b/reactos/drivers/bus/acpi/acpica/executer/exoparg1.c index 5b37a5e0666..30fc50488de 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exoparg1.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exoparg1.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exoparg1 - AML execution - opcodes with 1 argument @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -253,37 +252,31 @@ AcpiExOpcode_1A_0T_0R ( Status = AcpiExReleaseMutex (Operand[0], WalkState); break; - case AML_RESET_OP: /* Reset (EventObject) */ Status = AcpiExSystemResetEvent (Operand[0]); break; - case AML_SIGNAL_OP: /* Signal (EventObject) */ Status = AcpiExSystemSignalEvent (Operand[0]); break; - case AML_SLEEP_OP: /* Sleep (MsecTime) */ Status = AcpiExSystemDoSleep (Operand[0]->Integer.Value); break; - case AML_STALL_OP: /* Stall (UsecTime) */ Status = AcpiExSystemDoStall ((UINT32) Operand[0]->Integer.Value); break; - case AML_UNLOAD_OP: /* Unload (Handle) */ Status = AcpiExUnloadTable (Operand[0]); break; - default: /* Unknown opcode */ ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -403,7 +396,6 @@ AcpiExOpcode_1A_1T_1R ( ReturnDesc->Integer.Value = ~Operand[0]->Integer.Value; break; - case AML_FIND_SET_LEFT_BIT_OP: /* FindSetLeftBit (Operand, Result) */ ReturnDesc->Integer.Value = Operand[0]->Integer.Value; @@ -421,7 +413,6 @@ AcpiExOpcode_1A_1T_1R ( ReturnDesc->Integer.Value = Temp32; break; - case AML_FIND_SET_RIGHT_BIT_OP: /* FindSetRightBit (Operand, Result) */ ReturnDesc->Integer.Value = Operand[0]->Integer.Value; @@ -442,9 +433,7 @@ AcpiExOpcode_1A_1T_1R ( Temp32 == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - Temp32; break; - case AML_FROM_BCD_OP: /* FromBcd (BCDValue, Result) */ - /* * The 64-bit ACPI integer can hold 16 4-bit BCD characters * (if table is 32-bit, integer can hold 8 BCD characters) @@ -489,7 +478,6 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_TO_BCD_OP: /* ToBcd (Operand, Result) */ ReturnDesc->Integer.Value = 0; @@ -521,9 +509,7 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_COND_REF_OF_OP: /* CondRefOf (SourceObject, Result) */ - /* * This op is a little strange because the internal return value is * different than the return value stored in the result descriptor @@ -558,14 +544,14 @@ AcpiExOpcode_1A_1T_1R ( default: + /* No other opcodes get here */ + break; } break; - case AML_STORE_OP: /* Store (Source, Target) */ - /* * A store operand is typically a number, string, buffer or lvalue * Be careful about deleting the source object, @@ -592,7 +578,6 @@ AcpiExOpcode_1A_1T_1R ( } return_ACPI_STATUS (Status); - /* * ACPI 2.0 Opcodes */ @@ -602,7 +587,6 @@ AcpiExOpcode_1A_1T_1R ( WalkState); break; - case AML_TO_DECSTRING_OP: /* ToDecimalString (Data, Result) */ Status = AcpiExConvertToString (Operand[0], &ReturnDesc, @@ -614,7 +598,6 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_TO_HEXSTRING_OP: /* ToHexString (Data, Result) */ Status = AcpiExConvertToString (Operand[0], &ReturnDesc, @@ -626,7 +609,6 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_TO_BUFFER_OP: /* ToBuffer (Data, Result) */ Status = AcpiExConvertToBuffer (Operand[0], &ReturnDesc); @@ -637,7 +619,6 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_TO_INTEGER_OP: /* ToInteger (Data, Result) */ Status = AcpiExConvertToInteger (Operand[0], &ReturnDesc, @@ -649,7 +630,6 @@ AcpiExOpcode_1A_1T_1R ( } break; - case AML_SHIFT_LEFT_BIT_OP: /* ShiftLeftBit (Source, BitNum) */ case AML_SHIFT_RIGHT_BIT_OP: /* ShiftRightBit (Source, BitNum) */ @@ -661,7 +641,6 @@ AcpiExOpcode_1A_1T_1R ( Status = AE_SUPPORT; goto Cleanup; - default: /* Unknown opcode */ ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -740,7 +719,7 @@ AcpiExOpcode_1A_0T_1R ( } /* - * Set result to ONES (TRUE) if Value == 0. Note: + * Set result to ONES (TRUE) if Value == 0. Note: * ReturnDesc->Integer.Value is initially == 0 (FALSE) from above. */ if (!Operand[0]->Integer.Value) @@ -749,12 +728,10 @@ AcpiExOpcode_1A_0T_1R ( } break; - case AML_DECREMENT_OP: /* Decrement (Operand) */ case AML_INCREMENT_OP: /* Increment (Operand) */ - /* - * Create a new integer. Can't just get the base integer and + * Create a new integer. Can't just get the base integer and * increment it because it may be an Arg or Field. */ ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); @@ -817,12 +794,10 @@ AcpiExOpcode_1A_0T_1R ( Status = AcpiExStore (ReturnDesc, Operand[0], WalkState); break; - case AML_TYPE_OP: /* ObjectType (SourceObject) */ - /* * Note: The operand is not resolved at this point because we want to - * get the associated object, not its value. For example, we don't + * get the associated object, not its value. For example, we don't * want to resolve a FieldUnit to its value, we want the actual * FieldUnit object. */ @@ -845,9 +820,7 @@ AcpiExOpcode_1A_0T_1R ( } break; - case AML_SIZE_OF_OP: /* SizeOf (SourceObject) */ - /* * Note: The operand is not resolved at this point because we want to * get the associated object, not its value. @@ -864,7 +837,7 @@ AcpiExOpcode_1A_0T_1R ( /* * The type of the base object must be integer, buffer, string, or - * package. All others are not supported. + * package. All others are not supported. * * NOTE: Integer is not specifically supported by the ACPI spec, * but is supported implicitly via implicit operand conversion. @@ -874,10 +847,12 @@ AcpiExOpcode_1A_0T_1R ( switch (Type) { case ACPI_TYPE_INTEGER: + Value = AcpiGbl_IntegerByteWidth; break; case ACPI_TYPE_STRING: + Value = TempDesc->String.Length; break; @@ -898,6 +873,7 @@ AcpiExOpcode_1A_0T_1R ( break; default: + ACPI_ERROR ((AE_INFO, "Operand must be Buffer/Integer/String/Package - found type %s", AcpiUtGetTypeName (Type))); @@ -1005,9 +981,11 @@ AcpiExOpcode_1A_0T_1R ( break; case ACPI_TYPE_STRING: + break; default: + Status = AE_AML_OPERAND_TYPE; goto Cleanup; } @@ -1066,7 +1044,6 @@ AcpiExOpcode_1A_0T_1R ( switch (Operand[0]->Reference.Class) { case ACPI_REFCLASS_INDEX: - /* * The target type for the Index operator must be * either a Buffer or a Package @@ -1098,20 +1075,24 @@ AcpiExOpcode_1A_0T_1R ( } break; - case ACPI_TYPE_PACKAGE: - /* - * Return the referenced element of the package. We must + * Return the referenced element of the package. We must * add another reference to the referenced object, however. */ ReturnDesc = *(Operand[0]->Reference.Where); - if (ReturnDesc) + if (!ReturnDesc) { - AcpiUtAddReference (ReturnDesc); + /* + * Element is NULL, do not allow the dereference. + * This provides compatibility with other ACPI + * implementations. + */ + return_ACPI_STATUS (AE_AML_UNINITIALIZED_ELEMENT); } - break; + AcpiUtAddReference (ReturnDesc); + break; default: @@ -1123,25 +1104,53 @@ AcpiExOpcode_1A_0T_1R ( } break; - case ACPI_REFCLASS_REFOF: ReturnDesc = Operand[0]->Reference.Object; if (ACPI_GET_DESCRIPTOR_TYPE (ReturnDesc) == - ACPI_DESC_TYPE_NAMED) + ACPI_DESC_TYPE_NAMED) { ReturnDesc = AcpiNsGetAttachedObject ( - (ACPI_NAMESPACE_NODE *) ReturnDesc); + (ACPI_NAMESPACE_NODE *) ReturnDesc); + if (!ReturnDesc) + { + break; + } + + /* + * June 2013: + * BufferFields/FieldUnits require additional resolution + */ + switch (ReturnDesc->Common.Type) + { + case ACPI_TYPE_BUFFER_FIELD: + case ACPI_TYPE_LOCAL_REGION_FIELD: + case ACPI_TYPE_LOCAL_BANK_FIELD: + case ACPI_TYPE_LOCAL_INDEX_FIELD: + + Status = AcpiExReadDataFromField (WalkState, + ReturnDesc, &TempDesc); + if (ACPI_FAILURE (Status)) + { + goto Cleanup; + } + + ReturnDesc = TempDesc; + break; + + default: + + /* Add another reference to the object */ + + AcpiUtAddReference (ReturnDesc); + break; + } } - - /* Add another reference to the object! */ - - AcpiUtAddReference (ReturnDesc); break; - default: + ACPI_ERROR ((AE_INFO, "Unknown class in reference(%p) - 0x%2.2X", Operand[0], Operand[0]->Reference.Class)); @@ -1152,7 +1161,6 @@ AcpiExOpcode_1A_0T_1R ( } break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -1180,4 +1188,3 @@ Cleanup: return_ACPI_STATUS (Status); } - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exoparg2.c b/reactos/drivers/bus/acpi/acpica/executer/exoparg2.c index b7c19ec7757..3a65485edee 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exoparg2.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exoparg2.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -209,14 +209,13 @@ AcpiExOpcode_2A_0T_0R ( /* * Dispatch the notify to the appropriate handler * NOTE: the request is queued for execution after this method - * completes. The notify handlers are NOT invoked synchronously + * completes. The notify handlers are NOT invoked synchronously * from this thread -- because handlers may in turn run other * control methods. */ Status = AcpiEvQueueNotifyRequest (Node, Value); break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -289,7 +288,6 @@ AcpiExOpcode_2A_2T_1R ( } break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -358,7 +356,7 @@ AcpiExOpcode_2A_1T_1R ( ACPI_OPERAND_OBJECT *ReturnDesc = NULL; UINT64 Index; ACPI_STATUS Status = AE_OK; - ACPI_SIZE Length; + ACPI_SIZE Length = 0; ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_1T_1R, @@ -403,16 +401,13 @@ AcpiExOpcode_2A_1T_1R ( &ReturnDesc->Integer.Value); break; - case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */ Status = AcpiExDoConcatenate (Operand[0], Operand[1], &ReturnDesc, WalkState); break; - case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */ - /* * Input object is guaranteed to be a buffer at this point (it may have * been converted.) Copy the raw buffer data to a new object of @@ -428,7 +423,6 @@ AcpiExOpcode_2A_1T_1R ( * NOTE: A length of zero is ok, and will create a zero-length, null * terminated string. */ - Length = 0; while ((Length < Operand[0]->Buffer.Length) && (Length < Operand[1]->Integer.Value) && (Operand[0]->Buffer.Pointer[Length])) @@ -453,7 +447,6 @@ AcpiExOpcode_2A_1T_1R ( Operand[0]->Buffer.Pointer, Length); break; - case AML_CONCAT_RES_OP: /* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */ @@ -462,7 +455,6 @@ AcpiExOpcode_2A_1T_1R ( &ReturnDesc, WalkState); break; - case AML_INDEX_OP: /* Index (Source Index Result) */ /* Create the internal return object */ @@ -490,6 +482,7 @@ AcpiExOpcode_2A_1T_1R ( if (Index >= Operand[0]->String.Length) { + Length = Operand[0]->String.Length; Status = AE_AML_STRING_LIMIT; } @@ -500,6 +493,7 @@ AcpiExOpcode_2A_1T_1R ( if (Index >= Operand[0]->Buffer.Length) { + Length = Operand[0]->Buffer.Length; Status = AE_AML_BUFFER_LIMIT; } @@ -510,6 +504,7 @@ AcpiExOpcode_2A_1T_1R ( if (Index >= Operand[0]->Package.Count) { + Length = Operand[0]->Package.Count; Status = AE_AML_PACKAGE_LIMIT; } @@ -528,8 +523,8 @@ AcpiExOpcode_2A_1T_1R ( if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, - "Index (0x%8.8X%8.8X) is beyond end of object", - ACPI_FORMAT_UINT64 (Index))); + "Index (0x%X%8.8X) is beyond end of object (length 0x%X)", + ACPI_FORMAT_UINT64 (Index), (UINT32) Length)); goto Cleanup; } @@ -549,7 +544,6 @@ AcpiExOpcode_2A_1T_1R ( WalkState->ResultObj = ReturnDesc; goto Cleanup; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -672,7 +666,6 @@ AcpiExOpcode_2A_0T_1R ( } break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -710,5 +703,3 @@ Cleanup: return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exoparg3.c b/reactos/drivers/bus/acpi/acpica/executer/exoparg3.c index e583c53697d..97df207658f 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exoparg3.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exoparg3.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exoparg3 - AML execution - opcodes with 3 arguments @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,11 +80,11 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -94,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -203,7 +202,6 @@ AcpiExOpcode_3A_0T_0R ( ACPI_FREE (Fatal); break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -250,9 +248,8 @@ AcpiExOpcode_3A_1T_1R ( switch (WalkState->Opcode) { case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */ - /* - * Create the return object. The Source operand is guaranteed to be + * Create the return object. The Source operand is guaranteed to be * either a String or a Buffer, so just use its type. */ ReturnDesc = AcpiUtCreateInternalObject ( @@ -342,7 +339,6 @@ AcpiExOpcode_3A_1T_1R ( ReturnDesc->Buffer.Flags |= AOPOBJ_DATA_VALID; break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", @@ -373,5 +369,3 @@ Cleanup: } return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exoparg6.c b/reactos/drivers/bus/acpi/acpica/executer/exoparg6.c index 92afffcdeaa..515fc59948d 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exoparg6.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exoparg6.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exoparg6 - AML execution - opcodes with 6 arguments @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,11 +80,11 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -94,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -204,7 +203,6 @@ AcpiExDoMatch ( break; case MATCH_MEQ: - /* * True if equal: (P[i] == M) * Change to: (M == P[i]) @@ -218,7 +216,6 @@ AcpiExDoMatch ( break; case MATCH_MLE: - /* * True if less than or equal: (P[i] <= M) (P[i] NotGreater than M) * Change to: (M >= P[i]) (M NotLess than P[i]) @@ -233,7 +230,6 @@ AcpiExDoMatch ( break; case MATCH_MLT: - /* * True if less than: (P[i] < M) * Change to: (M > P[i]) @@ -247,7 +243,6 @@ AcpiExDoMatch ( break; case MATCH_MGE: - /* * True if greater than or equal: (P[i] >= M) (P[i] NotLess than M) * Change to: (M <= P[i]) (M NotGreater than P[i]) @@ -262,7 +257,6 @@ AcpiExDoMatch ( break; case MATCH_MGT: - /* * True if greater than: (P[i] > M) * Change to: (M < P[i]) @@ -282,7 +276,7 @@ AcpiExDoMatch ( return (FALSE); } - return LogicalResult; + return (LogicalResult); } @@ -361,7 +355,7 @@ AcpiExOpcode_6A_0T_1R ( * and the next should be examined. * * Upon finding a match, the loop will terminate via "break" at - * the bottom. If it terminates "normally", MatchValue will be + * the bottom. If it terminates "normally", MatchValue will be * ACPI_UINT64_MAX (Ones) (its initial value) indicating that no * match was found. */ @@ -402,13 +396,11 @@ AcpiExOpcode_6A_0T_1R ( } break; - case AML_LOAD_TABLE_OP: Status = AcpiExLoadTableOp (WalkState, &ReturnDesc); break; - default: ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X", diff --git a/reactos/drivers/bus/acpi/acpica/executer/exprep.c b/reactos/drivers/bus/acpi/acpica/executer/exprep.c index 3355eac2e5b..f1707360fc0 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exprep.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exprep.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,6 +120,7 @@ #include "acinterp.h" #include "amlcode.h" #include "acnamesp.h" +#include "acdispat.h" #define _COMPONENT ACPI_EXECUTER @@ -158,8 +158,8 @@ AcpiExGenerateAccess ( * AnyAcc keyword. * * NOTE: Need to have the RegionLength in order to check for boundary - * conditions (end-of-region). However, the RegionLength is a deferred - * operation. Therefore, to complete this implementation, the generation + * conditions (end-of-region). However, the RegionLength is a deferred + * operation. Therefore, to complete this implementation, the generation * of this access width must be deferred until the region length has * been evaluated. * @@ -339,26 +339,31 @@ AcpiExDecodeFieldAccess ( case AML_FIELD_ACCESS_BYTE: case AML_FIELD_ACCESS_BUFFER: /* ACPI 2.0 (SMBus Buffer) */ + ByteAlignment = 1; BitLength = 8; break; case AML_FIELD_ACCESS_WORD: + ByteAlignment = 2; BitLength = 16; break; case AML_FIELD_ACCESS_DWORD: + ByteAlignment = 4; BitLength = 32; break; case AML_FIELD_ACCESS_QWORD: /* ACPI 2.0 */ + ByteAlignment = 8; BitLength = 64; break; default: + /* Invalid field access type */ ACPI_ERROR ((AE_INFO, @@ -397,7 +402,7 @@ AcpiExDecodeFieldAccess ( * RETURN: Status * * DESCRIPTION: Initialize the areas of the field object that are common - * to the various types of fields. Note: This is very "sensitive" + * to the various types of fields. Note: This is very "sensitive" * code because we are solving the general case for field * alignment. * @@ -429,13 +434,13 @@ AcpiExPrepCommonFieldObject ( ObjDesc->CommonField.BitLength = FieldBitLength; /* - * Decode the access type so we can compute offsets. The access type gives + * Decode the access type so we can compute offsets. The access type gives * two pieces of information - the width of each field access and the * necessary ByteAlignment (address granularity) of the access. * * For AnyAcc, the AccessBitWidth is the largest width that is both * necessary and possible in an attempt to access the whole field in one - * I/O operation. However, for AnyAcc, the ByteAlignment is always one + * I/O operation. However, for AnyAcc, the ByteAlignment is always one * byte. * * For all Buffer Fields, the ByteAlignment is always one byte. @@ -457,7 +462,7 @@ AcpiExPrepCommonFieldObject ( /* * BaseByteOffset is the address of the start of the field within the - * region. It is the byte address of the first *datum* (field-width data + * region. It is the byte address of the first *datum* (field-width data * unit) of the field. (i.e., the first datum that contains at least the * first *bit* of the field.) * @@ -489,8 +494,8 @@ AcpiExPrepCommonFieldObject ( * * RETURN: Status * - * DESCRIPTION: Construct an ACPI_OPERAND_OBJECT of type DefField and - * connect it to the parent Node. + * DESCRIPTION: Construct an object of type ACPI_OPERAND_OBJECT with a + * subtype of DefField and connect it to the parent Node. * ******************************************************************************/ @@ -556,6 +561,32 @@ AcpiExPrepFieldValue ( ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode); + /* Fields specific to GenericSerialBus fields */ + + ObjDesc->Field.AccessLength = Info->AccessLength; + + if (Info->ConnectionNode) + { + SecondDesc = Info->ConnectionNode->Object; + if (!(SecondDesc->Common.Flags & AOPOBJ_DATA_VALID)) + { + Status = AcpiDsGetBufferArguments (SecondDesc); + if (ACPI_FAILURE (Status)) + { + AcpiUtDeleteObjectDesc (ObjDesc); + return_ACPI_STATUS (Status); + } + } + + ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer; + ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length; + } + else if (Info->ResourceBuffer) + { + ObjDesc->Field.ResourceBuffer = Info->ResourceBuffer; + ObjDesc->Field.ResourceLength = Info->ResourceLength; + } + /* Allow full data read from EC address space */ if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) && @@ -582,7 +613,6 @@ AcpiExPrepFieldValue ( ObjDesc->Field.AccessByteWidth, ObjDesc->Field.RegionObj)); break; - case ACPI_TYPE_LOCAL_BANK_FIELD: ObjDesc->BankField.Value = Info->BankValue; @@ -617,7 +647,6 @@ AcpiExPrepFieldValue ( break; - case ACPI_TYPE_LOCAL_INDEX_FIELD: /* Get the Index and Data registers */ @@ -671,7 +700,9 @@ AcpiExPrepFieldValue ( break; default: + /* No other types should get here */ + break; } @@ -690,4 +721,3 @@ AcpiExPrepFieldValue ( AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exregion.c b/reactos/drivers/bus/acpi/acpica/executer/exregion.c index 2a308dbeeec..ea10a01ea05 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exregion.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exregion.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exregion - ACPI default OpRegion (address space) handlers @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -172,22 +171,27 @@ AcpiExSystemMemorySpaceHandler ( switch (BitWidth) { case 8: + Length = 1; break; case 16: + Length = 2; break; case 32: + Length = 4; break; case 64: + Length = 8; break; default: + ACPI_ERROR ((AE_INFO, "Invalid SystemMemory width %u", BitWidth)); return_ACPI_STATUS (AE_AML_OPERAND_VALUE); @@ -292,7 +296,7 @@ AcpiExSystemMemorySpaceHandler ( * Perform the memory read or write * * Note: For machines that do not support non-aligned transfers, the target - * address was checked for alignment above. We do not attempt to break the + * address was checked for alignment above. We do not attempt to break the * transfer up into smaller (byte-size) chunks because the AML specifically * asked for a transfer width that the hardware may require. */ @@ -304,23 +308,29 @@ AcpiExSystemMemorySpaceHandler ( switch (BitWidth) { case 8: + *Value = (UINT64) ACPI_GET8 (LogicalAddrPtr); break; case 16: + *Value = (UINT64) ACPI_GET16 (LogicalAddrPtr); break; case 32: + *Value = (UINT64) ACPI_GET32 (LogicalAddrPtr); break; case 64: + *Value = (UINT64) ACPI_GET64 (LogicalAddrPtr); break; default: + /* BitWidth was already validated */ + break; } break; @@ -330,28 +340,35 @@ AcpiExSystemMemorySpaceHandler ( switch (BitWidth) { case 8: - ACPI_SET8 (LogicalAddrPtr) = (UINT8) *Value; + + ACPI_SET8 (LogicalAddrPtr, *Value); break; case 16: - ACPI_SET16 (LogicalAddrPtr) = (UINT16) *Value; + + ACPI_SET16 (LogicalAddrPtr, *Value); break; case 32: - ACPI_SET32 ( LogicalAddrPtr) = (UINT32) *Value; + + ACPI_SET32 (LogicalAddrPtr, *Value); break; case 64: - ACPI_SET64 (LogicalAddrPtr) = (UINT64) *Value; + + ACPI_SET64 (LogicalAddrPtr, *Value); break; default: + /* BitWidth was already validated */ + break; } break; default: + Status = AE_BAD_PARAMETER; break; } @@ -416,6 +433,7 @@ AcpiExSystemIoSpaceHandler ( break; default: + Status = AE_BAD_PARAMETER; break; } @@ -633,5 +651,3 @@ AcpiExDataTableSpaceHandler ( return_ACPI_STATUS (AE_OK); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exresnte.c b/reactos/drivers/bus/acpi/acpica/executer/exresnte.c index 494d154125f..323f9db5d22 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exresnte.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exresnte.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exresnte - AML Interpreter object resolution @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -134,8 +133,8 @@ * PARAMETERS: ObjectPtr - Pointer to a location that contains * a pointer to a NS node, and will receive a * pointer to the resolved object. - * WalkState - Current state. Valid only if executing AML - * code. NULL if simply resolving an object + * WalkState - Current state. Valid only if executing AML + * code. NULL if simply resolving an object * * RETURN: Status * @@ -143,7 +142,7 @@ * * Note: for some of the data types, the pointer attached to the Node * can be either a pointer to an actual internal object or a pointer into the - * AML stream itself. These types are currently: + * AML stream itself. These types are currently: * * ACPI_TYPE_INTEGER * ACPI_TYPE_STRING @@ -170,7 +169,7 @@ AcpiExResolveNodeToValue ( /* - * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the + * The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the * object that is attached to the Node. */ Node = *ObjectPtr; @@ -207,8 +206,8 @@ AcpiExResolveNodeToValue ( if (!SourceDesc) { - ACPI_ERROR ((AE_INFO, "No object attached to node %p", - Node)); + ACPI_ERROR ((AE_INFO, "No object attached to node [%4.4s] %p", + Node->Name.Ascii, Node)); return_ACPI_STATUS (AE_AML_NO_OPERAND); } @@ -237,7 +236,6 @@ AcpiExResolveNodeToValue ( } break; - case ACPI_TYPE_BUFFER: if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER) @@ -257,7 +255,6 @@ AcpiExResolveNodeToValue ( } break; - case ACPI_TYPE_STRING: if (SourceDesc->Common.Type != ACPI_TYPE_STRING) @@ -273,7 +270,6 @@ AcpiExResolveNodeToValue ( AcpiUtAddReference (ObjDesc); break; - case ACPI_TYPE_INTEGER: if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER) @@ -289,7 +285,6 @@ AcpiExResolveNodeToValue ( AcpiUtAddReference (ObjDesc); break; - case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD: @@ -325,7 +320,6 @@ AcpiExResolveNodeToValue ( return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */ - case ACPI_TYPE_LOCAL_REFERENCE: switch (SourceDesc->Reference.Class) @@ -341,6 +335,7 @@ AcpiExResolveNodeToValue ( break; default: + /* No named references are allowed here */ ACPI_ERROR ((AE_INFO, @@ -351,7 +346,6 @@ AcpiExResolveNodeToValue ( } break; - default: /* Default case is for unknown types */ @@ -370,5 +364,3 @@ AcpiExResolveNodeToValue ( *ObjectPtr = (void *) ObjDesc; return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exresolv.c b/reactos/drivers/bus/acpi/acpica/executer/exresolv.c index 27a6c5273d1..e035918a64d 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exresolv.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exresolv.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exresolv - AML Interpreter object resolution @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -237,7 +236,7 @@ AcpiExResolveObjectToValue ( StackDesc = *StackPtr; - /* This is an ACPI_OPERAND_OBJECT */ + /* This is an object of type ACPI_OPERAND_OBJECT */ switch (StackDesc->Common.Type) { @@ -249,7 +248,6 @@ AcpiExResolveObjectToValue ( { case ACPI_REFCLASS_LOCAL: case ACPI_REFCLASS_ARG: - /* * Get the local from the method's state info * Note: this increments the local's object reference count @@ -272,7 +270,6 @@ AcpiExResolveObjectToValue ( *StackPtr = ObjDesc; break; - case ACPI_REFCLASS_INDEX: switch (StackDesc->Reference.TargetType) @@ -282,7 +279,6 @@ AcpiExResolveObjectToValue ( /* Just return - do not dereference */ break; - case ACPI_TYPE_PACKAGE: /* If method call or CopyObject - do not dereference */ @@ -320,7 +316,6 @@ AcpiExResolveObjectToValue ( } break; - default: /* Invalid reference object */ @@ -333,7 +328,6 @@ AcpiExResolveObjectToValue ( } break; - case ACPI_REFCLASS_REFOF: case ACPI_REFCLASS_DEBUG: case ACPI_REFCLASS_TABLE: @@ -373,19 +367,16 @@ AcpiExResolveObjectToValue ( } break; - case ACPI_TYPE_BUFFER: Status = AcpiDsGetBufferArguments (StackDesc); break; - case ACPI_TYPE_PACKAGE: Status = AcpiDsGetPackageArguments (StackDesc); break; - case ACPI_TYPE_BUFFER_FIELD: case ACPI_TYPE_LOCAL_REGION_FIELD: case ACPI_TYPE_LOCAL_BANK_FIELD: @@ -403,6 +394,7 @@ AcpiExResolveObjectToValue ( break; default: + break; } @@ -421,7 +413,7 @@ AcpiExResolveObjectToValue ( * * RETURN: Status * - * DESCRIPTION: Return the base object and type. Traverse a reference list if + * DESCRIPTION: Return the base object and type. Traverse a reference list if * necessary to get to the base object. * ******************************************************************************/ @@ -447,10 +439,12 @@ AcpiExResolveMultiple ( switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc)) { case ACPI_DESC_TYPE_OPERAND: + Type = ObjDesc->Common.Type; break; case ACPI_DESC_TYPE_NAMED: + Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type; ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc); @@ -527,7 +521,6 @@ AcpiExResolveMultiple ( } break; - case ACPI_REFCLASS_INDEX: /* Get the type of this reference (index into another object) */ @@ -555,13 +548,11 @@ AcpiExResolveMultiple ( } break; - case ACPI_REFCLASS_TABLE: Type = ACPI_TYPE_DDB_HANDLE; goto Exit; - case ACPI_REFCLASS_LOCAL: case ACPI_REFCLASS_ARG: @@ -593,7 +584,6 @@ AcpiExResolveMultiple ( } break; - case ACPI_REFCLASS_DEBUG: /* The Debug Object is of type "DebugObject" */ @@ -601,7 +591,6 @@ AcpiExResolveMultiple ( Type = ACPI_TYPE_DEBUG_OBJECT; goto Exit; - default: ACPI_ERROR ((AE_INFO, @@ -637,7 +626,9 @@ Exit: break; default: + /* No change to Type required */ + break; } @@ -648,5 +639,3 @@ Exit: } return_ACPI_STATUS (AE_OK); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exresop.c b/reactos/drivers/bus/acpi/acpica/executer/exresop.c index 3a6be3bba99..aafc1dce57a 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exresop.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exresop.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exresop - AML Interpreter operand/object resolution @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -170,7 +169,7 @@ AcpiExCheckObjectType ( { /* * Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference - * objects and thus allow them to be targets. (As per the ACPI + * objects and thus allow them to be targets. (As per the ACPI * specification, a store to a constant is a noop.) */ if ((ThisType == ACPI_TYPE_INTEGER) && @@ -297,7 +296,6 @@ AcpiExResolveOperands ( } break; - case ACPI_DESC_TYPE_OPERAND: /* ACPI internal object */ @@ -350,7 +348,6 @@ AcpiExResolveOperands ( } break; - default: /* Invalid descriptor */ @@ -397,7 +394,6 @@ AcpiExResolveOperands ( case ARGI_TARGETREF: /* Allows implicit conversion rules before store */ case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */ case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */ - /* * Need an operand of type ACPI_TYPE_LOCAL_REFERENCE * A Namespace Node is OK as-is @@ -415,9 +411,7 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_DATAREFOBJ: /* Store operator only */ - /* * We don't want to resolve IndexOp reference objects during * a store because this would be an implicit DeRefOf operation. @@ -433,7 +427,9 @@ AcpiExResolveOperands ( break; default: + /* All cases covered above */ + break; } @@ -526,9 +522,7 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_BUFFER: - /* * Need an operand of type ACPI_TYPE_BUFFER, * But we can implicitly convert from a STRING or INTEGER @@ -555,9 +549,7 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_STRING: - /* * Need an operand of type ACPI_TYPE_STRING, * But we can implicitly convert from a BUFFER or INTEGER @@ -585,7 +577,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_COMPUTEDATA: /* Need an operand of type INTEGER, STRING or BUFFER */ @@ -608,7 +599,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_BUFFER_OR_STRING: /* Need an operand of type STRING or BUFFER */ @@ -646,7 +636,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_DATAOBJECT: /* * ARGI_DATAOBJECT is only used by the SizeOf operator. @@ -666,6 +655,7 @@ AcpiExResolveOperands ( break; default: + ACPI_ERROR ((AE_INFO, "Needed [Buffer/String/Package/Reference], found [%s] %p", AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); @@ -674,7 +664,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_COMPLEXOBJ: /* Need a buffer or package or (ACPI 2.0) String */ @@ -689,6 +678,7 @@ AcpiExResolveOperands ( break; default: + ACPI_ERROR ((AE_INFO, "Needed [Buffer/String/Package], found [%s] %p", AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); @@ -697,7 +687,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_REGION_OR_BUFFER: /* Used by Load() only */ /* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */ @@ -711,6 +700,7 @@ AcpiExResolveOperands ( break; default: + ACPI_ERROR ((AE_INFO, "Needed [Region/Buffer], found [%s] %p", AcpiUtGetObjectTypeName (ObjDesc), ObjDesc)); @@ -719,7 +709,6 @@ AcpiExResolveOperands ( } goto NextOperand; - case ARGI_DATAREFOBJ: /* Used by the Store() operator only */ @@ -746,7 +735,7 @@ AcpiExResolveOperands ( { /* * Enable original behavior of Store(), allowing any and all - * objects as the source operand. The ACPI spec does not + * objects as the source operand. The ACPI spec does not * allow this, however. */ break; @@ -767,7 +756,6 @@ AcpiExResolveOperands ( } goto NextOperand; - default: /* Unknown type */ @@ -806,5 +794,3 @@ NextOperand: return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exstore.c b/reactos/drivers/bus/acpi/acpica/executer/exstore.c index 30414f0f7eb..97b8be82ddd 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exstore.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exstore.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -134,21 +134,27 @@ AcpiExStoreObjectToIndex ( ACPI_OPERAND_OBJECT *DestDesc, ACPI_WALK_STATE *WalkState); +static ACPI_STATUS +AcpiExStoreDirectToNode ( + ACPI_OPERAND_OBJECT *SourceDesc, + ACPI_NAMESPACE_NODE *Node, + ACPI_WALK_STATE *WalkState); + /******************************************************************************* * * FUNCTION: AcpiExStore * * PARAMETERS: *SourceDesc - Value to be stored - * *DestDesc - Where to store it. Must be an NS node - * or an ACPI_OPERAND_OBJECT of type + * *DestDesc - Where to store it. Must be an NS node + * or ACPI_OPERAND_OBJECT of type * Reference; * WalkState - Current walk state * * RETURN: Status * * DESCRIPTION: Store the value described by SourceDesc into the location - * described by DestDesc. Called by various interpreter + * described by DestDesc. Called by various interpreter * functions to store the result of an operation into * the destination operand -- not just simply the actual "Store" * ASL operator. @@ -196,6 +202,7 @@ AcpiExStore ( switch (DestDesc->Common.Type) { case ACPI_TYPE_LOCAL_REFERENCE: + break; case ACPI_TYPE_INTEGER: @@ -239,7 +246,6 @@ AcpiExStore ( WalkState, ACPI_IMPLICIT_CONVERSION); break; - case ACPI_REFCLASS_INDEX: /* Storing to an Index (pointer into a packager or buffer) */ @@ -247,7 +253,6 @@ AcpiExStore ( Status = AcpiExStoreObjectToIndex (SourceDesc, RefDesc, WalkState); break; - case ACPI_REFCLASS_LOCAL: case ACPI_REFCLASS_ARG: @@ -257,9 +262,7 @@ AcpiExStore ( RefDesc->Reference.Value, SourceDesc, WalkState); break; - case ACPI_REFCLASS_DEBUG: - /* * Storing to the Debug object causes the value stored to be * displayed and otherwise has no effect -- see ACPI Specification @@ -271,7 +274,6 @@ AcpiExStore ( ACPI_DEBUG_OBJECT (SourceDesc, 0, 0); break; - default: ACPI_ERROR ((AE_INFO, "Unknown Reference Class 0x%2.2X", @@ -380,9 +382,7 @@ AcpiExStoreObjectToIndex ( break; - case ACPI_TYPE_BUFFER_FIELD: - /* * Store into a Buffer or String (not actually a real BufferField) * at a location defined by an Index. @@ -440,7 +440,6 @@ AcpiExStoreObjectToIndex ( ObjDesc->Buffer.Pointer[IndexDesc->Reference.Value] = Value; break; - default: ACPI_ERROR ((AE_INFO, "Target is not a Package or BufferField")); @@ -470,9 +469,13 @@ AcpiExStoreObjectToIndex ( * with the input value. * * When storing into an object the data is converted to the - * target object type then stored in the object. This means + * target object type then stored in the object. This means * that the target object type (for an initialized target) will - * not be changed by a store operation. + * not be changed by a store operation. A CopyObject can change + * the target type, however. + * + * The ImplicitConversion flag is set to NO/FALSE only when + * storing to an ArgX -- as per the rules of the ACPI spec. * * Assumes parameters are already validated. * @@ -499,7 +502,7 @@ AcpiExStoreObjectToNode ( TargetType = AcpiNsGetType (Node); TargetDesc = AcpiNsGetAttachedObject (Node); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n", + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n", SourceDesc, AcpiUtGetObjectTypeName (SourceDesc), Node, AcpiUtGetTypeName (TargetType))); @@ -513,51 +516,35 @@ AcpiExStoreObjectToNode ( return_ACPI_STATUS (Status); } - /* If no implicit conversion, drop into the default case below */ - - if ((!ImplicitConversion) || - ((WalkState->Opcode == AML_COPY_OP) && - (TargetType != ACPI_TYPE_LOCAL_REGION_FIELD) && - (TargetType != ACPI_TYPE_LOCAL_BANK_FIELD) && - (TargetType != ACPI_TYPE_LOCAL_INDEX_FIELD))) - { - /* - * Force execution of default (no implicit conversion). Note: - * CopyObject does not perform an implicit conversion, as per the ACPI - * spec -- except in case of region/bank/index fields -- because these - * objects must retain their original type permanently. - */ - TargetType = ACPI_TYPE_ANY; - } - /* Do the actual store operation */ switch (TargetType) { - case ACPI_TYPE_BUFFER_FIELD: - case ACPI_TYPE_LOCAL_REGION_FIELD: - case ACPI_TYPE_LOCAL_BANK_FIELD: - case ACPI_TYPE_LOCAL_INDEX_FIELD: - - /* For fields, copy the source data to the target field. */ - - Status = AcpiExWriteDataToField (SourceDesc, TargetDesc, - &WalkState->ResultObj); - break; - - case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: - /* - * These target types are all of type Integer/String/Buffer, and - * therefore support implicit conversion before the store. - * - * Copy and/or convert the source object to a new target object + * The simple data types all support implicit source operand + * conversion before the store. */ + + if ((WalkState->Opcode == AML_COPY_OP) || + !ImplicitConversion) + { + /* + * However, CopyObject and Stores to ArgX do not perform + * an implicit conversion, as per the ACPI specification. + * A direct store is performed instead. + */ + Status = AcpiExStoreDirectToNode (SourceDesc, Node, + WalkState); + break; + } + + /* Store with implicit source operand conversion support */ + Status = AcpiExStoreObjectToObject (SourceDesc, TargetDesc, - &NewDesc, WalkState); + &NewDesc, WalkState); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -570,11 +557,12 @@ AcpiExStoreObjectToNode ( * the Name's type to that of the value being stored in it. * SourceDesc reference count is incremented by AttachObject. * - * Note: This may change the type of the node if an explicit store - * has been performed such that the node/object type has been - * changed. + * Note: This may change the type of the node if an explicit + * store has been performed such that the node/object type + * has been changed. */ - Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type); + Status = AcpiNsAttachObject (Node, NewDesc, + NewDesc->Common.Type); ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Store %s into %s via Convert/Attach\n", @@ -583,17 +571,34 @@ AcpiExStoreObjectToNode ( } break; + case ACPI_TYPE_BUFFER_FIELD: + case ACPI_TYPE_LOCAL_REGION_FIELD: + case ACPI_TYPE_LOCAL_BANK_FIELD: + case ACPI_TYPE_LOCAL_INDEX_FIELD: + /* + * For all fields, always write the source data to the target + * field. Any required implicit source operand conversion is + * performed in the function below as necessary. Note, field + * objects must retain their original type permanently. + */ + Status = AcpiExWriteDataToField (SourceDesc, TargetDesc, + &WalkState->ResultObj); + break; default: - - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Storing %s (%p) directly into node (%p) with no implicit conversion\n", - AcpiUtGetObjectTypeName (SourceDesc), SourceDesc, Node)); - - /* No conversions for all other types. Just attach the source object */ - - Status = AcpiNsAttachObject (Node, SourceDesc, - SourceDesc->Common.Type); + /* + * No conversions for all other types. Directly store a copy of + * the source object. This is the ACPI spec-defined behavior for + * the CopyObject operator. + * + * NOTE: For the Store operator, this is a departure from the + * ACPI spec, which states "If conversion is impossible, abort + * the running control method". Instead, this code implements + * "If conversion is impossible, treat the Store operation as + * a CopyObject". + */ + Status = AcpiExStoreDirectToNode (SourceDesc, Node, + WalkState); break; } @@ -601,3 +606,51 @@ AcpiExStoreObjectToNode ( } +/******************************************************************************* + * + * FUNCTION: AcpiExStoreDirectToNode + * + * PARAMETERS: SourceDesc - Value to be stored + * Node - Named object to receive the value + * WalkState - Current walk state + * + * RETURN: Status + * + * DESCRIPTION: "Store" an object directly to a node. This involves a copy + * and an attach. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiExStoreDirectToNode ( + ACPI_OPERAND_OBJECT *SourceDesc, + ACPI_NAMESPACE_NODE *Node, + ACPI_WALK_STATE *WalkState) +{ + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *NewDesc; + + + ACPI_FUNCTION_TRACE (ExStoreDirectToNode); + + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Storing [%s] (%p) directly into node [%s] (%p)" + " with no implicit conversion\n", + AcpiUtGetObjectTypeName (SourceDesc), SourceDesc, + AcpiUtGetTypeName (Node->Type), Node)); + + /* Copy the source object to a new object */ + + Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Attach the new object to the node */ + + Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type); + AcpiUtRemoveReference (NewDesc); + return_ACPI_STATUS (Status); +} diff --git a/reactos/drivers/bus/acpi/acpica/executer/exstoren.c b/reactos/drivers/bus/acpi/acpica/executer/exstoren.c index cee5bc64ce4..d1fc09f7960 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exstoren.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exstoren.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exstoren - AML Interpreter object store support, @@ -10,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -33,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -45,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -57,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -82,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -94,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -137,7 +136,7 @@ * * RETURN: Status, resolved object in SourceDescPtr. * - * DESCRIPTION: Resolve an object. If the object is a reference, dereference + * DESCRIPTION: Resolve an object. If the object is a reference, dereference * it and return the actual object in the SourceDescPtr. * ******************************************************************************/ @@ -167,14 +166,12 @@ AcpiExResolveObject ( * These cases all require only Integers or values that * can be converted to Integers (Strings or Buffers) */ - case ACPI_TYPE_INTEGER: case ACPI_TYPE_STRING: case ACPI_TYPE_BUFFER: - /* * Stores into a Field/Region or into a Integer/Buffer/String - * are all essentially the same. This case handles the + * are all essentially the same. This case handles the * "interchangeable" types Integer, String, and Buffer. */ if (SourceDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) @@ -213,10 +210,8 @@ AcpiExResolveObject ( } break; - case ACPI_TYPE_LOCAL_ALIAS: case ACPI_TYPE_LOCAL_METHOD_ALIAS: - /* * All aliases should have been resolved earlier, during the * operand resolution phase. @@ -225,10 +220,8 @@ AcpiExResolveObject ( Status = AE_AML_INTERNAL; break; - case ACPI_TYPE_PACKAGE: default: - /* * All other types than Alias and the various Fields come here, * including the untyped case - ACPI_TYPE_ANY. @@ -251,7 +244,7 @@ AcpiExResolveObject ( * * RETURN: Status * - * DESCRIPTION: "Store" an object to another object. This may include + * DESCRIPTION: "Store" an object to another object. This may include * converting the source type to the target type (implicit * conversion), and a copy of the value of the source to * the target. @@ -262,14 +255,14 @@ AcpiExResolveObject ( * with the input value. * * When storing into an object the data is converted to the - * target object type then stored in the object. This means + * target object type then stored in the object. This means * that the target object type (for an initialized target) will * not be changed by a store operation. * * This module allows destination types of Number, String, * Buffer, and Package. * - * Assumes parameters are already validated. NOTE: SourceDesc + * Assumes parameters are already validated. NOTE: SourceDesc * resolution (from a reference object) must be performed by * the caller if necessary. * @@ -342,7 +335,7 @@ AcpiExStoreObjectToObject ( /* Truncate value if we are executing from a 32-bit ACPI table */ - AcpiExTruncateFor32bitTable (DestDesc); + (void) AcpiExTruncateFor32bitTable (DestDesc); break; case ACPI_TYPE_STRING: @@ -382,5 +375,3 @@ AcpiExStoreObjectToObject ( *NewDesc = DestDesc; return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exstorob.c b/reactos/drivers/bus/acpi/acpica/executer/exstorob.c index e9adf5f7ac5..dc64e92c1b8 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exstorob.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exstorob.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exstorob - AML Interpreter object store support, store to object @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -190,7 +189,7 @@ AcpiExStoreBufferToBuffer ( #ifdef ACPI_OBSOLETE_BEHAVIOR /* * NOTE: ACPI versions up to 3.0 specified that the buffer must be - * truncated if the string is smaller than the buffer. However, "other" + * truncated if the string is smaller than the buffer. However, "other" * implementations of ACPI never did this and thus became the defacto * standard. ACPI 3.0A changes this behavior such that the buffer * is no longer truncated. @@ -199,7 +198,7 @@ AcpiExStoreBufferToBuffer ( /* * OBSOLETE BEHAVIOR: * If the original source was a string, we must truncate the buffer, - * according to the ACPI spec. Integer-to-Buffer and Buffer-to-Buffer + * according to the ACPI spec. Integer-to-Buffer and Buffer-to-Buffer * copy must not truncate the original buffer. */ if (OriginalSrcType == ACPI_TYPE_STRING) @@ -312,5 +311,3 @@ AcpiExStoreStringToString ( TargetDesc->String.Length = Length; return_ACPI_STATUS (AE_OK); } - - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exsystem.c b/reactos/drivers/bus/acpi/acpica/executer/exsystem.c index ab36f756e54..fcf3a7f130e 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exsystem.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exsystem.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exsystem - Interface to OS services @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -134,7 +133,7 @@ * RETURN: Status * * DESCRIPTION: Implements a semaphore wait with a check to see if the - * semaphore is available immediately. If it is not, the + * semaphore is available immediately. If it is not, the * interpreter is released before waiting. * ******************************************************************************/ @@ -160,7 +159,7 @@ AcpiExSystemWaitSemaphore ( { /* We must wait, so unlock the interpreter */ - AcpiExRelinquishInterpreter (); + AcpiExExitInterpreter (); Status = AcpiOsWaitSemaphore (Semaphore, 1, Timeout); @@ -170,7 +169,7 @@ AcpiExSystemWaitSemaphore ( /* Reacquire the interpreter */ - AcpiExReacquireInterpreter (); + AcpiExEnterInterpreter (); } return_ACPI_STATUS (Status); @@ -187,7 +186,7 @@ AcpiExSystemWaitSemaphore ( * RETURN: Status * * DESCRIPTION: Implements a mutex wait with a check to see if the - * mutex is available immediately. If it is not, the + * mutex is available immediately. If it is not, the * interpreter is released before waiting. * ******************************************************************************/ @@ -213,7 +212,7 @@ AcpiExSystemWaitMutex ( { /* We must wait, so unlock the interpreter */ - AcpiExRelinquishInterpreter (); + AcpiExExitInterpreter (); Status = AcpiOsAcquireMutex (Mutex, Timeout); @@ -223,7 +222,7 @@ AcpiExSystemWaitMutex ( /* Reacquire the interpreter */ - AcpiExReacquireInterpreter (); + AcpiExEnterInterpreter (); } return_ACPI_STATUS (Status); @@ -242,7 +241,7 @@ AcpiExSystemWaitMutex ( * DESCRIPTION: Suspend running thread for specified amount of time. * Note: ACPI specification requires that Stall() does not * relinquish the processor, and delays longer than 100 usec - * should use Sleep() instead. We allow stalls up to 255 usec + * should use Sleep() instead. We allow stalls up to 255 usec * for compatibility with other interpreters and existing BIOSs. * ******************************************************************************/ @@ -300,7 +299,7 @@ AcpiExSystemDoSleep ( /* Since this thread will sleep, we must release the interpreter */ - AcpiExRelinquishInterpreter (); + AcpiExExitInterpreter (); /* * For compatibility with other ACPI implementations and to prevent @@ -315,7 +314,7 @@ AcpiExSystemDoSleep ( /* And now we must get the interpreter again */ - AcpiExReacquireInterpreter (); + AcpiExEnterInterpreter (); return (AE_OK); } @@ -362,7 +361,7 @@ AcpiExSystemSignalEvent ( * RETURN: Status * * DESCRIPTION: Provides an access point to perform synchronization operations - * within the AML. This operation is a request to wait for an + * within the AML. This operation is a request to wait for an * event. * ******************************************************************************/ @@ -424,4 +423,3 @@ AcpiExSystemResetEvent ( return (Status); } - diff --git a/reactos/drivers/bus/acpi/acpica/executer/exutils.c b/reactos/drivers/bus/acpi/acpica/executer/exutils.c index 5a0a9a59dbc..1a4a943111d 100644 --- a/reactos/drivers/bus/acpi/acpica/executer/exutils.c +++ b/reactos/drivers/bus/acpi/acpica/executer/exutils.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: exutils - interpreter/scanner utilities @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -119,12 +118,12 @@ /* * DEFINE_AML_GLOBALS is tested in amlcode.h * to determine whether certain global names should be "defined" or only - * "declared" in the current compilation. This enhances maintainability + * "declared" in the current compilation. This enhances maintainability * by enabling a single header file to embody all knowledge of the names * in question. * * Exactly one module of any executable should #define DEFINE_GLOBALS - * before #including the header files which use this convention. The + * before #including the header files which use this convention. The * names in question will be defined and initialized in that module, * and declared as extern in all other modules which #include those * header files. @@ -183,42 +182,6 @@ AcpiExEnterInterpreter ( } -/******************************************************************************* - * - * FUNCTION: AcpiExReacquireInterpreter - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Reacquire the interpreter execution region from within the - * interpreter code. Failure to enter the interpreter region is a - * fatal system error. Used in conjuction with - * RelinquishInterpreter - * - ******************************************************************************/ - -void -AcpiExReacquireInterpreter ( - void) -{ - ACPI_FUNCTION_TRACE (ExReacquireInterpreter); - - - /* - * If the global serialized flag is set, do not release the interpreter, - * since it was not actually released by AcpiExRelinquishInterpreter. - * This forces the interpreter to be single threaded. - */ - if (!AcpiGbl_AllMethodsSerialized) - { - AcpiExEnterInterpreter (); - } - - return_VOID; -} - - /******************************************************************************* * * FUNCTION: AcpiExExitInterpreter @@ -229,7 +192,16 @@ AcpiExReacquireInterpreter ( * * DESCRIPTION: Exit the interpreter execution region. This is the top level * routine used to exit the interpreter when all processing has - * been completed. + * been completed, or when the method blocks. + * + * Cases where the interpreter is unlocked internally: + * 1) Method will be blocked on a Sleep() AML opcode + * 2) Method will be blocked on an Acquire() AML opcode + * 3) Method will be blocked on a Wait() AML opcode + * 4) Method will be blocked to acquire the global lock + * 5) Method will be blocked waiting to execute a serialized control + * method that is currently executing + * 6) About to invoke a user-installed opregion handler * ******************************************************************************/ @@ -253,63 +225,20 @@ AcpiExExitInterpreter ( } -/******************************************************************************* - * - * FUNCTION: AcpiExRelinquishInterpreter - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Exit the interpreter execution region, from within the - * interpreter - before attempting an operation that will possibly - * block the running thread. - * - * Cases where the interpreter is unlocked internally - * 1) Method to be blocked on a Sleep() AML opcode - * 2) Method to be blocked on an Acquire() AML opcode - * 3) Method to be blocked on a Wait() AML opcode - * 4) Method to be blocked to acquire the global lock - * 5) Method to be blocked waiting to execute a serialized control method - * that is currently executing - * 6) About to invoke a user-installed opregion handler - * - ******************************************************************************/ - -void -AcpiExRelinquishInterpreter ( - void) -{ - ACPI_FUNCTION_TRACE (ExRelinquishInterpreter); - - - /* - * If the global serialized flag is set, do not release the interpreter. - * This forces the interpreter to be single threaded. - */ - if (!AcpiGbl_AllMethodsSerialized) - { - AcpiExExitInterpreter (); - } - - return_VOID; -} - - /******************************************************************************* * * FUNCTION: AcpiExTruncateFor32bitTable * * PARAMETERS: ObjDesc - Object to be truncated * - * RETURN: none + * RETURN: TRUE if a truncation was performed, FALSE otherwise. * * DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is * 32-bit, as determined by the revision of the DSDT. * ******************************************************************************/ -void +BOOLEAN AcpiExTruncateFor32bitTable ( ACPI_OPERAND_OBJECT *ObjDesc) { @@ -319,23 +248,27 @@ AcpiExTruncateFor32bitTable ( /* * Object must be a valid number and we must be executing - * a control method. NS node could be there for AML_INT_NAMEPATH_OP. + * a control method. Object could be NS node for AML_INT_NAMEPATH_OP. */ if ((!ObjDesc) || (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) || (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)) { - return; + return (FALSE); } - if (AcpiGbl_IntegerByteWidth == 4) + if ((AcpiGbl_IntegerByteWidth == 4) && + (ObjDesc->Integer.Value > (UINT64) ACPI_UINT32_MAX)) { /* - * We are running a method that exists in a 32-bit ACPI table. + * We are executing in a 32-bit ACPI table. * Truncate the value to 32 bits by zeroing out the upper 32-bit field */ ObjDesc->Integer.Value &= (UINT64) ACPI_UINT32_MAX; + return (TRUE); } + + return (FALSE); } @@ -571,4 +504,34 @@ AcpiExIntegerToString ( } } + +/******************************************************************************* + * + * FUNCTION: AcpiIsValidSpaceId + * + * PARAMETERS: SpaceId - ID to be validated + * + * RETURN: TRUE if valid/supported ID. + * + * DESCRIPTION: Validate an operation region SpaceID. + * + ******************************************************************************/ + +BOOLEAN +AcpiIsValidSpaceId ( + UINT8 SpaceId) +{ + + if ((SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) && + (SpaceId < ACPI_USER_REGION_BEGIN) && + (SpaceId != ACPI_ADR_SPACE_DATA_TABLE) && + (SpaceId != ACPI_ADR_SPACE_FIXED_HARDWARE)) + { + return (FALSE); + } + + return (TRUE); +} + + #endif diff --git a/reactos/drivers/bus/acpi/acpica/hardware/hwacpi.c b/reactos/drivers/bus/acpi/acpica/hardware/hwacpi.c index b4ceb390ef1..1facc203a16 100644 --- a/reactos/drivers/bus/acpi/acpica/hardware/hwacpi.c +++ b/reactos/drivers/bus/acpi/acpica/hardware/hwacpi.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -124,6 +123,7 @@ ACPI_MODULE_NAME ("hwacpi") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /****************************************************************************** * * FUNCTION: AcpiHwSetMode @@ -147,6 +147,14 @@ AcpiHwSetMode ( ACPI_FUNCTION_TRACE (HwSetMode); + + /* If the Hardware Reduced flag is set, machine is always in acpi mode */ + + if (AcpiGbl_ReducedHardware) + { + return_ACPI_STATUS (AE_OK); + } + /* * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, * system does not support mode transition. @@ -184,7 +192,6 @@ AcpiHwSetMode ( break; case ACPI_SYS_MODE_LEGACY: - /* * BIOS should clear all fixed status bits and restore fixed event * enable bits to default @@ -196,6 +203,7 @@ AcpiHwSetMode ( break; default: + return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -213,13 +221,13 @@ AcpiHwSetMode ( Retry = 3000; while (Retry) { - if (AcpiHwGetMode() == Mode) + if (AcpiHwGetMode () == Mode) { ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n", Mode)); return_ACPI_STATUS (AE_OK); } - AcpiOsStall(1000); + AcpiOsStall (ACPI_USEC_PER_MSEC); Retry--; } @@ -236,7 +244,7 @@ AcpiHwSetMode ( * * RETURN: SYS_MODE_ACPI or SYS_MODE_LEGACY * - * DESCRIPTION: Return current operating state of system. Determined by + * DESCRIPTION: Return current operating state of system. Determined by * querying the SCI_EN bit. * ******************************************************************************/ @@ -252,6 +260,13 @@ AcpiHwGetMode ( ACPI_FUNCTION_TRACE (HwGetMode); + /* If the Hardware Reduced flag is set, machine is always in acpi mode */ + + if (AcpiGbl_ReducedHardware) + { + return_UINT32 (ACPI_SYS_MODE_ACPI); + } + /* * ACPI 2.0 clarified that if SMI_CMD in FADT is zero, * system does not support mode transition. @@ -276,3 +291,5 @@ AcpiHwGetMode ( return_UINT32 (ACPI_SYS_MODE_LEGACY); } } + +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/hardware/hwesleep.c b/reactos/drivers/bus/acpi/acpica/hardware/hwesleep.c new file mode 100644 index 00000000000..0dab77a721e --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/hardware/hwesleep.c @@ -0,0 +1,330 @@ +/****************************************************************************** + * + * Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the + * extended FADT-V5 sleep registers. + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#include "acpi.h" +#include "accommon.h" + +#define _COMPONENT ACPI_HARDWARE + ACPI_MODULE_NAME ("hwesleep") + + +/******************************************************************************* + * + * FUNCTION: AcpiHwExecuteSleepMethod + * + * PARAMETERS: MethodPathname - Pathname of method to execute + * IntegerArgument - Argument to pass to the method + * + * RETURN: None + * + * DESCRIPTION: Execute a sleep/wake related method with one integer argument + * and no return value. + * + ******************************************************************************/ + +void +AcpiHwExecuteSleepMethod ( + char *MethodPathname, + UINT32 IntegerArgument) +{ + ACPI_OBJECT_LIST ArgList; + ACPI_OBJECT Arg; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (HwExecuteSleepMethod); + + + /* One argument, IntegerArgument; No return value expected */ + + ArgList.Count = 1; + ArgList.Pointer = &Arg; + Arg.Type = ACPI_TYPE_INTEGER; + Arg.Integer.Value = (UINT64) IntegerArgument; + + Status = AcpiEvaluateObject (NULL, MethodPathname, &ArgList, NULL); + if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) + { + ACPI_EXCEPTION ((AE_INFO, Status, "While executing method %s", + MethodPathname)); + } + + return_VOID; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiHwExtendedSleep + * + * PARAMETERS: SleepState - Which sleep state to enter + * + * RETURN: Status + * + * DESCRIPTION: Enter a system sleep state via the extended FADT sleep + * registers (V5 FADT). + * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED + * + ******************************************************************************/ + +ACPI_STATUS +AcpiHwExtendedSleep ( + UINT8 SleepState) +{ + ACPI_STATUS Status; + UINT8 SleepTypeValue; + UINT64 SleepStatus; + + + ACPI_FUNCTION_TRACE (HwExtendedSleep); + + + /* Extended sleep registers must be valid */ + + if (!AcpiGbl_FADT.SleepControl.Address || + !AcpiGbl_FADT.SleepStatus.Address) + { + return_ACPI_STATUS (AE_NOT_EXIST); + } + + /* Clear wake status (WAK_STS) */ + + Status = AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + AcpiGbl_SystemAwakeAndRunning = FALSE; + + /* Flush caches, as per ACPI specification */ + + ACPI_FLUSH_CPU_CACHE (); + + /* + * Set the SLP_TYP and SLP_EN bits. + * + * Note: We only use the first value returned by the \_Sx method + * (AcpiGbl_SleepTypeA) - As per ACPI specification. + */ + ACPI_DEBUG_PRINT ((ACPI_DB_INIT, + "Entering sleep state [S%u]\n", SleepState)); + + SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) & + ACPI_X_SLEEP_TYPE_MASK); + + Status = AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE), + &AcpiGbl_FADT.SleepControl); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Wait for transition back to Working State */ + + do + { + Status = AcpiRead (&SleepStatus, &AcpiGbl_FADT.SleepStatus); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + } while (!(((UINT8) SleepStatus) & ACPI_X_WAKE_STATUS)); + + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiHwExtendedWakePrep + * + * PARAMETERS: SleepState - Which sleep state we just exited + * + * RETURN: Status + * + * DESCRIPTION: Perform first part of OS-independent ACPI cleanup after + * a sleep. Called with interrupts ENABLED. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiHwExtendedWakePrep ( + UINT8 SleepState) +{ + ACPI_STATUS Status; + UINT8 SleepTypeValue; + + + ACPI_FUNCTION_TRACE (HwExtendedWakePrep); + + + Status = AcpiGetSleepTypeData (ACPI_STATE_S0, + &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB); + if (ACPI_SUCCESS (Status)) + { + SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) & + ACPI_X_SLEEP_TYPE_MASK); + + (void) AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE), + &AcpiGbl_FADT.SleepControl); + } + + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiHwExtendedWake + * + * PARAMETERS: SleepState - Which sleep state we just exited + * + * RETURN: Status + * + * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep + * Called with interrupts ENABLED. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiHwExtendedWake ( + UINT8 SleepState) +{ + ACPI_FUNCTION_TRACE (HwExtendedWake); + + + /* Ensure EnterSleepStatePrep -> EnterSleepState ordering */ + + AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID; + + /* Execute the wake methods */ + + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING); + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState); + + /* + * Some BIOS code assumes that WAK_STS will be cleared on resume + * and use it to determine whether the system is rebooting or + * resuming. Clear WAK_STS for compatibility. + */ + (void) AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus); + AcpiGbl_SystemAwakeAndRunning = TRUE; + + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); + return_ACPI_STATUS (AE_OK); +} diff --git a/reactos/drivers/bus/acpi/acpica/hardware/hwgpe.c b/reactos/drivers/bus/acpi/acpica/hardware/hwgpe.c index b12bab6bca3..a777e581ffc 100644 --- a/reactos/drivers/bus/acpi/acpica/hardware/hwgpe.c +++ b/reactos/drivers/bus/acpi/acpica/hardware/hwgpe.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: hwgpe - Low level GPE enable/disable/clear functions @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,6 +120,8 @@ #define _COMPONENT ACPI_HARDWARE ACPI_MODULE_NAME ("hwgpe") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ + /* Local prototypes */ static ACPI_STATUS @@ -135,7 +136,6 @@ AcpiHwEnableWakeupGpeBlock ( * FUNCTION: AcpiHwGetGpeRegisterBit * * PARAMETERS: GpeEventInfo - Info block for the GPE - * GpeRegisterInfo - Info block for the GPE register * * RETURN: Register mask with a one in the GPE bit position * @@ -146,12 +146,11 @@ AcpiHwEnableWakeupGpeBlock ( UINT32 AcpiHwGetGpeRegisterBit ( - ACPI_GPE_EVENT_INFO *GpeEventInfo, - ACPI_GPE_REGISTER_INFO *GpeRegisterInfo) + ACPI_GPE_EVENT_INFO *GpeEventInfo) { return ((UINT32) 1 << - (GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber)); + (GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber)); } @@ -200,7 +199,7 @@ AcpiHwLowSetGpe ( /* Set or clear just the bit that corresponds to this GPE */ - RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo); + RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); switch (Action) { case ACPI_GPE_CONDITIONAL_ENABLE: @@ -215,15 +214,18 @@ AcpiHwLowSetGpe ( /*lint -fallthrough */ case ACPI_GPE_ENABLE: + ACPI_SET_BIT (EnableMask, RegisterBit); break; case ACPI_GPE_DISABLE: + ACPI_CLEAR_BIT (EnableMask, RegisterBit); break; default: - ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u\n", Action)); + + ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action)); return (AE_BAD_PARAMETER); } @@ -269,7 +271,7 @@ AcpiHwClearGpe ( * Write a one to the appropriate bit in the status register to * clear this GPE. */ - RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo); + RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); Status = AcpiHwWrite (RegisterBit, &GpeRegisterInfo->StatusAddress); @@ -317,7 +319,7 @@ AcpiHwGetGpeStatus ( /* Get the register bitmask for this GPE */ - RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo); + RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo); /* GPE currently enabled? (enabled for runtime?) */ @@ -610,3 +612,4 @@ AcpiHwEnableAllWakeupGpes ( return_ACPI_STATUS (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/hardware/hwpci.c b/reactos/drivers/bus/acpi/acpica/hardware/hwpci.c index d733b1164c5..42b5f592e08 100644 --- a/reactos/drivers/bus/acpi/acpica/hardware/hwpci.c +++ b/reactos/drivers/bus/acpi/acpica/hardware/hwpci.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -364,7 +364,7 @@ AcpiHwProcessPciList ( &BusNumber, &IsBridge); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + return (Status); } Info = Info->Next; @@ -376,7 +376,7 @@ AcpiHwProcessPciList ( PciId->Segment, PciId->Bus, PciId->Device, PciId->Function, Status, BusNumber, IsBridge)); - return_ACPI_STATUS (AE_OK); + return (AE_OK); } diff --git a/reactos/drivers/bus/acpi/acpica/hardware/hwregs.c b/reactos/drivers/bus/acpi/acpica/hardware/hwregs.c index 2e43a4af904..99505798db3 100644 --- a/reactos/drivers/bus/acpi/acpica/hardware/hwregs.c +++ b/reactos/drivers/bus/acpi/acpica/hardware/hwregs.c @@ -1,4 +1,3 @@ - /******************************************************************************* * * Module Name: hwregs - Read/write access functions for the various ACPI @@ -10,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -33,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -45,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -57,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -82,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -94,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -125,6 +124,8 @@ ACPI_MODULE_NAME ("hwregs") +#if (!ACPI_REDUCED_HARDWARE) + /* Local Prototypes */ static ACPI_STATUS @@ -139,6 +140,7 @@ AcpiHwWriteMultiple ( ACPI_GENERIC_ADDRESS *RegisterA, ACPI_GENERIC_ADDRESS *RegisterB); +#endif /* !ACPI_REDUCED_HARDWARE */ /****************************************************************************** * @@ -242,6 +244,7 @@ AcpiHwRead ( ACPI_GENERIC_ADDRESS *Reg) { UINT64 Address; + UINT64 Value64; ACPI_STATUS Status; @@ -267,7 +270,9 @@ AcpiHwRead ( if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) { Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS) - Address, Value, Reg->BitWidth); + Address, &Value64, Reg->BitWidth); + + *Value = (UINT32) Value64; } else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ { @@ -326,7 +331,7 @@ AcpiHwWrite ( if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) { Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS) - Address, Value, Reg->BitWidth); + Address, (UINT64) Value, Reg->BitWidth); } else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ { @@ -343,6 +348,7 @@ AcpiHwWrite ( } +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiHwClearAcpiStatus @@ -393,7 +399,7 @@ UnlockAndExit: /******************************************************************************* * - * FUNCTION: AcpiHwGetRegisterBitMask + * FUNCTION: AcpiHwGetBitRegisterInfo * * PARAMETERS: RegisterId - Index of ACPI Register to access * @@ -496,7 +502,6 @@ AcpiHwRegisterRead ( &AcpiGbl_XPm1bStatus); break; - case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */ Status = AcpiHwReadMultiple (&Value, @@ -504,7 +509,6 @@ AcpiHwRegisterRead ( &AcpiGbl_XPm1bEnable); break; - case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */ Status = AcpiHwReadMultiple (&Value, @@ -519,26 +523,23 @@ AcpiHwRegisterRead ( Value &= ~ACPI_PM1_CONTROL_WRITEONLY_BITS; break; - case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock); break; - case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPmTimerBlock); break; - case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ Status = AcpiHwReadPort (AcpiGbl_FADT.SmiCommand, &Value, 8); break; - default: + ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X", RegisterId)); Status = AE_BAD_PARAMETER; @@ -612,7 +613,6 @@ AcpiHwRegisterWrite ( &AcpiGbl_XPm1bStatus); break; - case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */ Status = AcpiHwWriteMultiple (Value, @@ -620,9 +620,7 @@ AcpiHwRegisterWrite ( &AcpiGbl_XPm1bEnable); break; - case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */ - /* * Perform a read first to preserve certain bits (per ACPI spec) * Note: This includes SCI_EN, we never want to change this bit @@ -646,9 +644,7 @@ AcpiHwRegisterWrite ( &AcpiGbl_FADT.XPm1bControlBlock); break; - case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ - /* * For control registers, all reserved bits must be preserved, * as per the ACPI spec. @@ -666,13 +662,11 @@ AcpiHwRegisterWrite ( Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPm2ControlBlock); break; - case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPmTimerBlock); break; - case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ /* SMI_CMD is currently always in IO space */ @@ -680,8 +674,8 @@ AcpiHwRegisterWrite ( Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand, Value, 8); break; - default: + ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X", RegisterId)); Status = AE_BAD_PARAMETER; @@ -803,3 +797,4 @@ AcpiHwWriteMultiple ( return (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/hardware/hwsleep.c b/reactos/drivers/bus/acpi/acpica/hardware/hwsleep.c index fe796ec2739..4501598e88d 100644 --- a/reactos/drivers/bus/acpi/acpica/hardware/hwsleep.c +++ b/reactos/drivers/bus/acpi/acpica/hardware/hwsleep.c @@ -1,7 +1,7 @@ - /****************************************************************************** * - * Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface + * Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the + * original/legacy sleep/PM registers. * *****************************************************************************/ @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,210 +121,36 @@ ACPI_MODULE_NAME ("hwsleep") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /******************************************************************************* * - * FUNCTION: AcpiSetFirmwareWakingVector - * - * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode - * entry point. - * - * RETURN: Status - * - * DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS - * - ******************************************************************************/ - -ACPI_STATUS -AcpiSetFirmwareWakingVector ( - UINT32 PhysicalAddress) -{ - ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector); - - - /* Set the 32-bit vector */ - - AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress; - - /* Clear the 64-bit vector if it exists */ - - if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1)) - { - AcpiGbl_FACS->XFirmwareWakingVector = 0; - } - - return_ACPI_STATUS (AE_OK); -} - -ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector) - - -#if ACPI_MACHINE_WIDTH == 64 -/******************************************************************************* - * - * FUNCTION: AcpiSetFirmwareWakingVector64 - * - * PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected - * mode entry point. - * - * RETURN: Status - * - * DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if - * it exists in the table. This function is intended for use with - * 64-bit host operating systems. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiSetFirmwareWakingVector64 ( - UINT64 PhysicalAddress) -{ - ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64); - - - /* Determine if the 64-bit vector actually exists */ - - if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1)) - { - return_ACPI_STATUS (AE_NOT_EXIST); - } - - /* Clear 32-bit vector, set the 64-bit X_ vector */ - - AcpiGbl_FACS->FirmwareWakingVector = 0; - AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress; - return_ACPI_STATUS (AE_OK); -} - -ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64) -#endif - -/******************************************************************************* - * - * FUNCTION: AcpiEnterSleepStatePrep + * FUNCTION: AcpiHwLegacySleep * * PARAMETERS: SleepState - Which sleep state to enter * * RETURN: Status * - * DESCRIPTION: Prepare to enter a system sleep state (see ACPI 2.0 spec p 231) - * This function must execute with interrupts enabled. - * We break sleeping into 2 stages so that OSPM can handle - * various OS-specific tasks between the two steps. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiEnterSleepStatePrep ( - UINT8 SleepState) -{ - ACPI_STATUS Status; - ACPI_OBJECT_LIST ArgList; - ACPI_OBJECT Arg; - - - ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep); - - - /* _PSW methods could be run here to enable wake-on keyboard, LAN, etc. */ - - Status = AcpiGetSleepTypeData (SleepState, - &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Execute the _PTS method (Prepare To Sleep) */ - - ArgList.Count = 1; - ArgList.Pointer = &Arg; - Arg.Type = ACPI_TYPE_INTEGER; - Arg.Integer.Value = SleepState; - - Status = AcpiEvaluateObject (NULL, METHOD_NAME__PTS, &ArgList, NULL); - if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) - { - return_ACPI_STATUS (Status); - } - - /* Setup the argument to the _SST method (System STatus) */ - - switch (SleepState) - { - case ACPI_STATE_S0: - Arg.Integer.Value = ACPI_SST_WORKING; - break; - - case ACPI_STATE_S1: - case ACPI_STATE_S2: - case ACPI_STATE_S3: - Arg.Integer.Value = ACPI_SST_SLEEPING; - break; - - case ACPI_STATE_S4: - Arg.Integer.Value = ACPI_SST_SLEEP_CONTEXT; - break; - - default: - Arg.Integer.Value = ACPI_SST_INDICATOR_OFF; /* Default is off */ - break; - } - - /* - * Set the system indicators to show the desired sleep state. - * _SST is an optional method (return no error if not found) - */ - Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL); - if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) - { - ACPI_EXCEPTION ((AE_INFO, Status, "While executing method _SST")); - } - - return_ACPI_STATUS (AE_OK); -} - -ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep) - - -/******************************************************************************* - * - * FUNCTION: AcpiEnterSleepState - * - * PARAMETERS: SleepState - Which sleep state to enter - * - * RETURN: Status - * - * DESCRIPTION: Enter a system sleep state + * DESCRIPTION: Enter a system sleep state via the legacy FADT PM registers * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED * ******************************************************************************/ ACPI_STATUS -AcpiEnterSleepState ( +AcpiHwLegacySleep ( UINT8 SleepState) { - UINT32 Pm1aControl; - UINT32 Pm1bControl; ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo; ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo; + UINT32 Pm1aControl; + UINT32 Pm1bControl; UINT32 InValue; - ACPI_OBJECT_LIST ArgList; - ACPI_OBJECT Arg; ACPI_STATUS Status; - ACPI_FUNCTION_TRACE (AcpiEnterSleepState); + ACPI_FUNCTION_TRACE (HwLegacySleep); - if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) || - (AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX)) - { - ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X", - AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB)); - return_ACPI_STATUS (AE_AML_OPERAND_VALUE); - } - - SleepTypeRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_TYPE); + SleepTypeRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_TYPE); SleepEnableRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_ENABLE); /* Clear wake status */ @@ -343,20 +169,6 @@ AcpiEnterSleepState ( return_ACPI_STATUS (Status); } - if (SleepState != ACPI_STATE_S5) - { - /* - * Disable BM arbitration. This feature is contained within an - * optional register (PM2 Control), so ignore a BAD_ADDRESS - * exception. - */ - Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1); - if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS)) - { - return_ACPI_STATUS (Status); - } - } - /* * 1) Disable/Clear all GPEs * 2) Enable all wakeup GPEs @@ -374,19 +186,6 @@ AcpiEnterSleepState ( return_ACPI_STATUS (Status); } - /* Execute the _GTS method (Going To Sleep) */ - - ArgList.Count = 1; - ArgList.Pointer = &Arg; - Arg.Type = ACPI_TYPE_INTEGER; - Arg.Integer.Value = SleepState; - - Status = AcpiEvaluateObject (NULL, METHOD_NAME__GTS, &ArgList, NULL); - if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) - { - return_ACPI_STATUS (Status); - } - /* Get current value of PM1A control */ Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL, @@ -452,7 +251,7 @@ AcpiEnterSleepState ( * to still read the right value. Ideally, this block would go * away entirely. */ - AcpiOsStall (10000000); + AcpiOsStall (10 * ACPI_USEC_PER_SEC); Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_CONTROL, SleepEnableRegInfo->AccessBitMask); @@ -462,7 +261,7 @@ AcpiEnterSleepState ( } } - /* Wait until we enter sleep state */ + /* Wait for transition back to Working State */ do { @@ -472,110 +271,30 @@ AcpiEnterSleepState ( return_ACPI_STATUS (Status); } - /* Spin until we wake */ - } while (!InValue); return_ACPI_STATUS (AE_OK); } -ACPI_EXPORT_SYMBOL (AcpiEnterSleepState) - /******************************************************************************* * - * FUNCTION: AcpiEnterSleepStateS4bios - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Perform a S4 bios request. - * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED - * - ******************************************************************************/ - -ACPI_STATUS -AcpiEnterSleepStateS4bios ( - void) -{ - UINT32 InValue; - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios); - - - /* Clear the wake status bit (PM1) */ - - Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - Status = AcpiHwClearAcpiStatus (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* - * 1) Disable/Clear all GPEs - * 2) Enable all wakeup GPEs - */ - Status = AcpiHwDisableAllGpes (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - AcpiGbl_SystemAwakeAndRunning = FALSE; - - Status = AcpiHwEnableAllWakeupGpes (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - ACPI_FLUSH_CPU_CACHE (); - - Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand, - (UINT32) AcpiGbl_FADT.S4BiosRequest, 8); - - do { - AcpiOsStall(1000); - Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } while (!InValue); - - return_ACPI_STATUS (AE_OK); -} - -ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios) - - -/******************************************************************************* - * - * FUNCTION: AcpiLeaveSleepState + * FUNCTION: AcpiHwLegacyWakePrep * * PARAMETERS: SleepState - Which sleep state we just exited * * RETURN: Status * - * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep + * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a + * sleep. * Called with interrupts ENABLED. * ******************************************************************************/ ACPI_STATUS -AcpiLeaveSleepState ( +AcpiHwLegacyWakePrep ( UINT8 SleepState) { - ACPI_OBJECT_LIST ArgList; - ACPI_OBJECT Arg; ACPI_STATUS Status; ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo; ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo; @@ -583,8 +302,7 @@ AcpiLeaveSleepState ( UINT32 Pm1bControl; - ACPI_FUNCTION_TRACE (AcpiLeaveSleepState); - + ACPI_FUNCTION_TRACE (HwLegacyWakePrep); /* * Set SLP_TYPE and SLP_EN to state S0. @@ -625,40 +343,42 @@ AcpiLeaveSleepState ( } } + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiHwLegacyWake + * + * PARAMETERS: SleepState - Which sleep state we just exited + * + * RETURN: Status + * + * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep + * Called with interrupts ENABLED. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiHwLegacyWake ( + UINT8 SleepState) +{ + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (HwLegacyWake); + + /* Ensure EnterSleepStatePrep -> EnterSleepState ordering */ AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID; - - /* Setup parameter object */ - - ArgList.Count = 1; - ArgList.Pointer = &Arg; - Arg.Type = ACPI_TYPE_INTEGER; - - /* Ignore any errors from these methods */ - - Arg.Integer.Value = ACPI_SST_WAKING; - Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL); - if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During Method _SST")); - } - - Arg.Integer.Value = SleepState; - Status = AcpiEvaluateObject (NULL, METHOD_NAME__BFS, &ArgList, NULL); - if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During Method _BFS")); - } - - Status = AcpiEvaluateObject (NULL, METHOD_NAME__WAK, &ArgList, NULL); - if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During Method _WAK")); - } - /* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */ + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING); /* + * GPEs must be enabled before _WAK is called as GPEs + * might get fired there + * * Restore the GPEs: * 1) Disable/Clear all GPEs * 2) Enable all runtime GPEs @@ -668,7 +388,6 @@ AcpiLeaveSleepState ( { return_ACPI_STATUS (Status); } - AcpiGbl_SystemAwakeAndRunning = TRUE; Status = AcpiHwEnableAllRuntimeGpes (); if (ACPI_FAILURE (Status)) @@ -676,6 +395,20 @@ AcpiLeaveSleepState ( return_ACPI_STATUS (Status); } + /* + * Now we can execute _WAK, etc. Some machines require that the GPEs + * are enabled before the wake methods are executed. + */ + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState); + + /* + * Some BIOS code assumes that WAK_STS will be cleared on resume + * and use it to determine whether the system is rebooting or + * resuming. Clear WAK_STS for compatibility. + */ + (void) AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS); + AcpiGbl_SystemAwakeAndRunning = TRUE; + /* Enable power button */ (void) AcpiWriteBitRegister( @@ -686,26 +419,8 @@ AcpiLeaveSleepState ( AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId, ACPI_CLEAR_STATUS); - /* - * Enable BM arbitration. This feature is contained within an - * optional register (PM2 Control), so ignore a BAD_ADDRESS - * exception. - */ - Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 0); - if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS)) - { - return_ACPI_STATUS (Status); - } - - Arg.Integer.Value = ACPI_SST_WORKING; - Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL); - if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During Method _SST")); - } - + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING); return_ACPI_STATUS (Status); } -ACPI_EXPORT_SYMBOL (AcpiLeaveSleepState) - +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/hardware/hwtimer.c b/reactos/drivers/bus/acpi/acpica/hardware/hwtimer.c index 79ddb8e540b..525a4e5a69e 100644 --- a/reactos/drivers/bus/acpi/acpica/hardware/hwtimer.c +++ b/reactos/drivers/bus/acpi/acpica/hardware/hwtimer.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Name: hwtimer.c - ACPI Power Management Timer Interface @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -114,6 +113,8 @@ * *****************************************************************************/ +#define EXPORT_ACPI_INTERFACES + #include "acpi.h" #include "accommon.h" @@ -121,6 +122,7 @@ ACPI_MODULE_NAME ("hwtimer") +#if (!ACPI_REDUCED_HARDWARE) /* Entire module */ /****************************************************************************** * * FUNCTION: AcpiGetTimerResolution @@ -187,8 +189,14 @@ AcpiGetTimer ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock); + /* ACPI 5.0A: PM Timer is optional */ + if (!AcpiGbl_FADT.XPmTimerBlock.Address) + { + return_ACPI_STATUS (AE_SUPPORT); + } + + Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock); return_ACPI_STATUS (Status); } @@ -215,7 +223,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetTimer) * a versatile and accurate timer. * * Note that this function accommodates only a single timer - * rollover. Thus for 24-bit timers, this function should only + * rollover. Thus for 24-bit timers, this function should only * be used for calculating durations less than ~4.6 seconds * (~20 minutes for 32-bit timers) -- calculations below: * @@ -243,6 +251,13 @@ AcpiGetTimerDuration ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + /* ACPI 5.0A: PM Timer is optional */ + + if (!AcpiGbl_FADT.XPmTimerBlock.Address) + { + return_ACPI_STATUS (AE_SUPPORT); + } + /* * Compute Tick Delta: * Handle (max one) timer rollovers on 24-bit versus 32-bit timers. @@ -275,10 +290,11 @@ AcpiGetTimerDuration ( /* * Compute Duration (Requires a 64-bit multiply and divide): * - * TimeElapsed = (DeltaTicks * 1000000) / PM_TIMER_FREQUENCY; + * TimeElapsed (microseconds) = + * (DeltaTicks * ACPI_USEC_PER_SEC) / ACPI_PM_TIMER_FREQUENCY; */ - Status = AcpiUtShortDivide (((UINT64) DeltaTicks) * 1000000, - PM_TIMER_FREQUENCY, &Quotient, NULL); + Status = AcpiUtShortDivide (((UINT64) DeltaTicks) * ACPI_USEC_PER_SEC, + ACPI_PM_TIMER_FREQUENCY, &Quotient, NULL); *TimeElapsed = (UINT32) Quotient; return_ACPI_STATUS (Status); @@ -286,3 +302,4 @@ AcpiGetTimerDuration ( ACPI_EXPORT_SYMBOL (AcpiGetTimerDuration) +#endif /* !ACPI_REDUCED_HARDWARE */ diff --git a/reactos/drivers/bus/acpi/acpica/hardware/hwvalid.c b/reactos/drivers/bus/acpi/acpica/hardware/hwvalid.c index 92b9a4e71ef..511a6313f8a 100644 --- a/reactos/drivers/bus/acpi/acpica/hardware/hwvalid.c +++ b/reactos/drivers/bus/acpi/acpica/hardware/hwvalid.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: hwvalid - I/O request validation @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -221,6 +220,8 @@ AcpiHwValidateIoRequest ( (BitWidth != 16) && (BitWidth != 32)) { + ACPI_ERROR ((AE_INFO, + "Bad BitWidth parameter: %8.8X", BitWidth)); return (AE_BAD_PARAMETER); } @@ -434,5 +435,3 @@ AcpiHwWritePort ( return (AE_OK); } - - diff --git a/reactos/drivers/bus/acpi/acpica/hardware/hwxface.c b/reactos/drivers/bus/acpi/acpica/hardware/hwxface.c index e7bcbe0ae99..4687ae1c419 100644 --- a/reactos/drivers/bus/acpi/acpica/hardware/hwxface.c +++ b/reactos/drivers/bus/acpi/acpica/hardware/hwxface.c @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: hwxface - Public ACPICA hardware interfaces @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -114,6 +113,8 @@ * *****************************************************************************/ +#define EXPORT_ACPI_INTERFACES + #include "acpi.h" #include "accommon.h" #include "acnamesp.h" @@ -163,9 +164,15 @@ AcpiReset ( * For I/O space, write directly to the OSL. This bypasses the port * validation mechanism, which may block a valid write to the reset * register. + * + * NOTE: + * The ACPI spec requires the reset register width to be 8, so we + * hardcode it here and ignore the FADT value. This maintains + * compatibility with other ACPI implementations that have allowed + * BIOS code with bad register width values to go unnoticed. */ Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) ResetReg->Address, - AcpiGbl_FADT.ResetValue, ResetReg->BitWidth); + AcpiGbl_FADT.ResetValue, ACPI_RESET_REGISTER_WIDTH); } else { @@ -204,7 +211,8 @@ AcpiRead ( UINT64 *ReturnValue, ACPI_GENERIC_ADDRESS *Reg) { - UINT32 Value; + UINT32 ValueLo; + UINT32 ValueHi; UINT32 Width; UINT64 Address; ACPI_STATUS Status; @@ -226,66 +234,52 @@ AcpiRead ( return (Status); } - Width = Reg->BitWidth; - if (Width == 64) - { - Width = 32; /* Break into two 32-bit transfers */ - } - - /* Initialize entire 64-bit return value to zero */ - - *ReturnValue = 0; - Value = 0; - /* - * Two address spaces supported: Memory or IO. PCI_Config is + * Two address spaces supported: Memory or I/O. PCI_Config is * not supported here because the GAS structure is insufficient */ if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) { Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS) - Address, &Value, Width); + Address, ReturnValue, Reg->BitWidth); if (ACPI_FAILURE (Status)) { return (Status); } - *ReturnValue = Value; - - if (Reg->BitWidth == 64) - { - /* Read the top 32 bits */ - - Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS) - (Address + 4), &Value, 32); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - *ReturnValue |= ((UINT64) Value << 32); - } } else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ { + ValueLo = 0; + ValueHi = 0; + + Width = Reg->BitWidth; + if (Width == 64) + { + Width = 32; /* Break into two 32-bit transfers */ + } + Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) - Address, &Value, Width); + Address, &ValueLo, Width); if (ACPI_FAILURE (Status)) { return (Status); } - *ReturnValue = Value; if (Reg->BitWidth == 64) { /* Read the top 32 bits */ Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) - (Address + 4), &Value, 32); + (Address + 4), &ValueHi, 32); if (ACPI_FAILURE (Status)) { return (Status); } - *ReturnValue |= ((UINT64) Value << 32); } + + /* Set the return value only if status is AE_OK */ + + *ReturnValue = (ValueLo | ((UINT64) ValueHi << 32)); } ACPI_DEBUG_PRINT ((ACPI_DB_IO, @@ -294,7 +288,7 @@ AcpiRead ( ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId))); - return (Status); + return (AE_OK); } ACPI_EXPORT_SYMBOL (AcpiRead) @@ -334,12 +328,6 @@ AcpiWrite ( return (Status); } - Width = Reg->BitWidth; - if (Width == 64) - { - Width = 32; /* Break into two 32-bit transfers */ - } - /* * Two address spaces supported: Memory or IO. PCI_Config is * not supported here because the GAS structure is insufficient @@ -347,24 +335,20 @@ AcpiWrite ( if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) { Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS) - Address, ACPI_LODWORD (Value), Width); + Address, Value, Reg->BitWidth); if (ACPI_FAILURE (Status)) { return (Status); } - - if (Reg->BitWidth == 64) - { - Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS) - (Address + 4), ACPI_HIDWORD (Value), 32); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - } } else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ { + Width = Reg->BitWidth; + if (Width == 64) + { + Width = 32; /* Break into two 32-bit transfers */ + } + Status = AcpiHwWritePort ((ACPI_IO_ADDRESS) Address, ACPI_LODWORD (Value), Width); if (ACPI_FAILURE (Status)) @@ -395,6 +379,7 @@ AcpiWrite ( ACPI_EXPORT_SYMBOL (AcpiWrite) +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiReadBitRegister @@ -473,7 +458,7 @@ ACPI_EXPORT_SYMBOL (AcpiReadBitRegister) * * PARAMETERS: RegisterId - ID of ACPI Bit Register to access * Value - Value to write to the register, in bit - * position zero. The bit is automaticallly + * position zero. The bit is automatically * shifted to the correct position. * * RETURN: Status @@ -577,6 +562,8 @@ UnlockAndExit: ACPI_EXPORT_SYMBOL (AcpiWriteBitRegister) +#endif /* !ACPI_REDUCED_HARDWARE */ + /******************************************************************************* * @@ -586,10 +573,33 @@ ACPI_EXPORT_SYMBOL (AcpiWriteBitRegister) * *SleepTypeA - Where SLP_TYPa is returned * *SleepTypeB - Where SLP_TYPb is returned * - * RETURN: Status - ACPI status + * RETURN: Status * - * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep - * state. + * DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested + * sleep state via the appropriate \_Sx object. + * + * The sleep state package returned from the corresponding \_Sx_ object + * must contain at least one integer. + * + * March 2005: + * Added support for a package that contains two integers. This + * goes against the ACPI specification which defines this object as a + * package with one encoded DWORD integer. However, existing practice + * by many BIOS vendors is to return a package with 2 or more integer + * elements, at least one per sleep type (A/B). + * + * January 2013: + * Therefore, we must be prepared to accept a package with either a + * single integer or multiple integers. + * + * The single integer DWORD format is as follows: + * BYTE 0 - Value for the PM1A SLP_TYP register + * BYTE 1 - Value for the PM1B SLP_TYP register + * BYTE 2-3 - Reserved + * + * The dual integer format is as follows: + * Integer 0 - Value for the PM1A SLP_TYP register + * Integer 1 - Value for the PM1A SLP_TYP register * ******************************************************************************/ @@ -599,8 +609,9 @@ AcpiGetSleepTypeData ( UINT8 *SleepTypeA, UINT8 *SleepTypeB) { - ACPI_STATUS Status = AE_OK; + ACPI_STATUS Status; ACPI_EVALUATE_INFO *Info; + ACPI_OPERAND_OBJECT **Elements; ACPI_FUNCTION_TRACE (AcpiGetSleepTypeData); @@ -609,8 +620,7 @@ AcpiGetSleepTypeData ( /* Validate parameters */ if ((SleepState > ACPI_S_STATES_MAX) || - !SleepTypeA || - !SleepTypeB) + !SleepTypeA || !SleepTypeB) { return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -623,17 +633,15 @@ AcpiGetSleepTypeData ( return_ACPI_STATUS (AE_NO_MEMORY); } - Info->Pathname = ACPI_CAST_PTR (char, AcpiGbl_SleepStateNames[SleepState]); - - /* Evaluate the namespace object containing the values for this state */ - + /* + * Evaluate the \_Sx namespace object containing the register values + * for this state + */ + Info->RelativePathname = ACPI_CAST_PTR ( + char, AcpiGbl_SleepStateNames[SleepState]); Status = AcpiNsEvaluate (Info); if (ACPI_FAILURE (Status)) { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "%s while evaluating SleepState [%s]\n", - AcpiFormatException (Status), Info->Pathname)); - goto Cleanup; } @@ -642,67 +650,74 @@ AcpiGetSleepTypeData ( if (!Info->ReturnObject) { ACPI_ERROR ((AE_INFO, "No Sleep State object returned from [%s]", - Info->Pathname)); - Status = AE_NOT_EXIST; + Info->RelativePathname)); + Status = AE_AML_NO_RETURN_VALUE; + goto Cleanup; } - /* It must be of type Package */ + /* Return object must be of type Package */ - else if (Info->ReturnObject->Common.Type != ACPI_TYPE_PACKAGE) + if (Info->ReturnObject->Common.Type != ACPI_TYPE_PACKAGE) { ACPI_ERROR ((AE_INFO, "Sleep State return object is not a Package")); Status = AE_AML_OPERAND_TYPE; + goto Cleanup1; } /* - * The package must have at least two elements. NOTE (March 2005): This - * goes against the current ACPI spec which defines this object as a - * package with one encoded DWORD element. However, existing practice - * by BIOS vendors seems to be to have 2 or more elements, at least - * one per sleep type (A/B). + * Any warnings about the package length or the object types have + * already been issued by the predefined name module -- there is no + * need to repeat them here. */ - else if (Info->ReturnObject->Package.Count < 2) + Elements = Info->ReturnObject->Package.Elements; + switch (Info->ReturnObject->Package.Count) { - ACPI_ERROR ((AE_INFO, - "Sleep State return package does not have at least two elements")); - Status = AE_AML_NO_OPERAND; - } - - /* The first two elements must both be of type Integer */ - - else if (((Info->ReturnObject->Package.Elements[0])->Common.Type - != ACPI_TYPE_INTEGER) || - ((Info->ReturnObject->Package.Elements[1])->Common.Type - != ACPI_TYPE_INTEGER)) - { - ACPI_ERROR ((AE_INFO, - "Sleep State return package elements are not both Integers " - "(%s, %s)", - AcpiUtGetObjectTypeName (Info->ReturnObject->Package.Elements[0]), - AcpiUtGetObjectTypeName (Info->ReturnObject->Package.Elements[1]))); - Status = AE_AML_OPERAND_TYPE; - } - else - { - /* Valid _Sx_ package size, type, and value */ - - *SleepTypeA = (UINT8) - (Info->ReturnObject->Package.Elements[0])->Integer.Value; - *SleepTypeB = (UINT8) - (Info->ReturnObject->Package.Elements[1])->Integer.Value; - } - - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "While evaluating SleepState [%s], bad Sleep object %p type %s", - Info->Pathname, Info->ReturnObject, - AcpiUtGetObjectTypeName (Info->ReturnObject))); + case 0: + + Status = AE_AML_PACKAGE_LIMIT; + break; + + case 1: + + if (Elements[0]->Common.Type != ACPI_TYPE_INTEGER) + { + Status = AE_AML_OPERAND_TYPE; + break; + } + + /* A valid _Sx_ package with one integer */ + + *SleepTypeA = (UINT8) Elements[0]->Integer.Value; + *SleepTypeB = (UINT8) (Elements[0]->Integer.Value >> 8); + break; + + case 2: + default: + + if ((Elements[0]->Common.Type != ACPI_TYPE_INTEGER) || + (Elements[1]->Common.Type != ACPI_TYPE_INTEGER)) + { + Status = AE_AML_OPERAND_TYPE; + break; + } + + /* A valid _Sx_ package with two integers */ + + *SleepTypeA = (UINT8) Elements[0]->Integer.Value; + *SleepTypeB = (UINT8) Elements[1]->Integer.Value; + break; } +Cleanup1: AcpiUtRemoveReference (Info->ReturnObject); Cleanup: + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "While evaluating Sleep State [%s]", Info->RelativePathname)); + } + ACPI_FREE (Info); return_ACPI_STATUS (Status); } diff --git a/reactos/drivers/bus/acpi/acpica/hardware/hwxfsleep.c b/reactos/drivers/bus/acpi/acpica/hardware/hwxfsleep.c new file mode 100644 index 00000000000..db64da61869 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/hardware/hwxfsleep.c @@ -0,0 +1,559 @@ +/****************************************************************************** + * + * Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define EXPORT_ACPI_INTERFACES + +#include "acpi.h" +#include "accommon.h" + +#define _COMPONENT ACPI_HARDWARE + ACPI_MODULE_NAME ("hwxfsleep") + +/* Local prototypes */ + +static ACPI_STATUS +AcpiHwSleepDispatch ( + UINT8 SleepState, + UINT32 FunctionId); + +/* + * Dispatch table used to efficiently branch to the various sleep + * functions. + */ +#define ACPI_SLEEP_FUNCTION_ID 0 +#define ACPI_WAKE_PREP_FUNCTION_ID 1 +#define ACPI_WAKE_FUNCTION_ID 2 + +/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */ + +static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] = +{ + {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep), AcpiHwExtendedSleep}, + {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep), AcpiHwExtendedWakePrep}, + {ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake), AcpiHwExtendedWake} +}; + + +/* + * These functions are removed for the ACPI_REDUCED_HARDWARE case: + * AcpiSetFirmwareWakingVector + * AcpiSetFirmwareWakingVector64 + * AcpiEnterSleepStateS4bios + */ + +#if (!ACPI_REDUCED_HARDWARE) +/******************************************************************************* + * + * FUNCTION: AcpiSetFirmwareWakingVector + * + * PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode + * entry point. + * + * RETURN: Status + * + * DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS + * + ******************************************************************************/ + +ACPI_STATUS +AcpiSetFirmwareWakingVector ( + UINT32 PhysicalAddress) +{ + ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector); + + + /* + * According to the ACPI specification 2.0c and later, the 64-bit + * waking vector should be cleared and the 32-bit waking vector should + * be used, unless we want the wake-up code to be called by the BIOS in + * Protected Mode. Some systems (for example HP dv5-1004nr) are known + * to fail to resume if the 64-bit vector is used. + */ + + /* Set the 32-bit vector */ + + AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress; + + /* Clear the 64-bit vector if it exists */ + + if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1)) + { + AcpiGbl_FACS->XFirmwareWakingVector = 0; + } + + return_ACPI_STATUS (AE_OK); +} + +ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector) + + +#if ACPI_MACHINE_WIDTH == 64 +/******************************************************************************* + * + * FUNCTION: AcpiSetFirmwareWakingVector64 + * + * PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected + * mode entry point. + * + * RETURN: Status + * + * DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if + * it exists in the table. This function is intended for use with + * 64-bit host operating systems. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiSetFirmwareWakingVector64 ( + UINT64 PhysicalAddress) +{ + ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64); + + + /* Determine if the 64-bit vector actually exists */ + + if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1)) + { + return_ACPI_STATUS (AE_NOT_EXIST); + } + + /* Clear 32-bit vector, set the 64-bit X_ vector */ + + AcpiGbl_FACS->FirmwareWakingVector = 0; + AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress; + return_ACPI_STATUS (AE_OK); +} + +ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64) +#endif + + +/******************************************************************************* + * + * FUNCTION: AcpiEnterSleepStateS4bios + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Perform a S4 bios request. + * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED + * + ******************************************************************************/ + +ACPI_STATUS +AcpiEnterSleepStateS4bios ( + void) +{ + UINT32 InValue; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios); + + + /* Clear the wake status bit (PM1) */ + + Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + Status = AcpiHwClearAcpiStatus (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* + * 1) Disable/Clear all GPEs + * 2) Enable all wakeup GPEs + */ + Status = AcpiHwDisableAllGpes (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + AcpiGbl_SystemAwakeAndRunning = FALSE; + + Status = AcpiHwEnableAllWakeupGpes (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + ACPI_FLUSH_CPU_CACHE (); + + Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand, + (UINT32) AcpiGbl_FADT.S4BiosRequest, 8); + + do { + AcpiOsStall (ACPI_USEC_PER_MSEC); + Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } while (!InValue); + + return_ACPI_STATUS (AE_OK); +} + +ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios) + +#endif /* !ACPI_REDUCED_HARDWARE */ + + +/******************************************************************************* + * + * FUNCTION: AcpiHwSleepDispatch + * + * PARAMETERS: SleepState - Which sleep state to enter/exit + * FunctionId - Sleep, WakePrep, or Wake + * + * RETURN: Status from the invoked sleep handling function. + * + * DESCRIPTION: Dispatch a sleep/wake request to the appropriate handling + * function. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiHwSleepDispatch ( + UINT8 SleepState, + UINT32 FunctionId) +{ + ACPI_STATUS Status; + ACPI_SLEEP_FUNCTIONS *SleepFunctions = &AcpiSleepDispatch[FunctionId]; + + +#if (!ACPI_REDUCED_HARDWARE) + /* + * If the Hardware Reduced flag is set (from the FADT), we must + * use the extended sleep registers (FADT). Note: As per the ACPI + * specification, these extended registers are to be used for HW-reduced + * platforms only. They are not general-purpose replacements for the + * legacy PM register sleep support. + */ + if (AcpiGbl_ReducedHardware) + { + Status = SleepFunctions->ExtendedFunction (SleepState); + } + else + { + /* Legacy sleep */ + + Status = SleepFunctions->LegacyFunction (SleepState); + } + + return (Status); + +#else + /* + * For the case where reduced-hardware-only code is being generated, + * we know that only the extended sleep registers are available + */ + Status = SleepFunctions->ExtendedFunction (SleepState); + return (Status); + +#endif /* !ACPI_REDUCED_HARDWARE */ +} + + +/******************************************************************************* + * + * FUNCTION: AcpiEnterSleepStatePrep + * + * PARAMETERS: SleepState - Which sleep state to enter + * + * RETURN: Status + * + * DESCRIPTION: Prepare to enter a system sleep state. + * This function must execute with interrupts enabled. + * We break sleeping into 2 stages so that OSPM can handle + * various OS-specific tasks between the two steps. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiEnterSleepStatePrep ( + UINT8 SleepState) +{ + ACPI_STATUS Status; + ACPI_OBJECT_LIST ArgList; + ACPI_OBJECT Arg; + UINT32 SstValue; + + + ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep); + + + Status = AcpiGetSleepTypeData (SleepState, + &AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Execute the _PTS method (Prepare To Sleep) */ + + ArgList.Count = 1; + ArgList.Pointer = &Arg; + Arg.Type = ACPI_TYPE_INTEGER; + Arg.Integer.Value = SleepState; + + Status = AcpiEvaluateObject (NULL, METHOD_PATHNAME__PTS, &ArgList, NULL); + if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND) + { + return_ACPI_STATUS (Status); + } + + /* Setup the argument to the _SST method (System STatus) */ + + switch (SleepState) + { + case ACPI_STATE_S0: + + SstValue = ACPI_SST_WORKING; + break; + + case ACPI_STATE_S1: + case ACPI_STATE_S2: + case ACPI_STATE_S3: + + SstValue = ACPI_SST_SLEEPING; + break; + + case ACPI_STATE_S4: + + SstValue = ACPI_SST_SLEEP_CONTEXT; + break; + + default: + + SstValue = ACPI_SST_INDICATOR_OFF; /* Default is off */ + break; + } + + /* + * Set the system indicators to show the desired sleep state. + * _SST is an optional method (return no error if not found) + */ + AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, SstValue); + return_ACPI_STATUS (AE_OK); +} + +ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep) + + +/******************************************************************************* + * + * FUNCTION: AcpiEnterSleepState + * + * PARAMETERS: SleepState - Which sleep state to enter + * + * RETURN: Status + * + * DESCRIPTION: Enter a system sleep state + * THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED + * + ******************************************************************************/ + +ACPI_STATUS +AcpiEnterSleepState ( + UINT8 SleepState) +{ + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiEnterSleepState); + + + if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) || + (AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX)) + { + ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X", + AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB)); + return_ACPI_STATUS (AE_AML_OPERAND_VALUE); + } + + Status = AcpiHwSleepDispatch (SleepState, ACPI_SLEEP_FUNCTION_ID); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiEnterSleepState) + + +/******************************************************************************* + * + * FUNCTION: AcpiLeaveSleepStatePrep + * + * PARAMETERS: SleepState - Which sleep state we are exiting + * + * RETURN: Status + * + * DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a + * sleep. Called with interrupts DISABLED. + * We break wake/resume into 2 stages so that OSPM can handle + * various OS-specific tasks between the two steps. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiLeaveSleepStatePrep ( + UINT8 SleepState) +{ + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiLeaveSleepStatePrep); + + + Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_PREP_FUNCTION_ID); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiLeaveSleepStatePrep) + + +/******************************************************************************* + * + * FUNCTION: AcpiLeaveSleepState + * + * PARAMETERS: SleepState - Which sleep state we are exiting + * + * RETURN: Status + * + * DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep + * Called with interrupts ENABLED. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiLeaveSleepState ( + UINT8 SleepState) +{ + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiLeaveSleepState); + + + Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_FUNCTION_ID); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiLeaveSleepState) diff --git a/reactos/drivers/bus/acpi/acpica/include/acapps.h b/reactos/drivers/bus/acpi/acpica/include/acapps.h index d6a19f55744..63f879e1429 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acapps.h +++ b/reactos/drivers/bus/acpi/acpica/include/acapps.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -124,7 +124,7 @@ /* Common info for tool signons */ #define ACPICA_NAME "Intel ACPI Component Architecture" -#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2011 Intel Corporation" +#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2014 Intel Corporation" #if ACPI_MACHINE_WIDTH == 64 #define ACPI_WIDTH "-64" @@ -175,11 +175,26 @@ AcpiGetopt( char **argv, char *opts); +int +AcpiGetoptArgument ( + int argc, + char **argv); + extern int AcpiGbl_Optind; extern int AcpiGbl_Opterr; +extern int AcpiGbl_SubOptChar; extern char *AcpiGbl_Optarg; +/* + * cmfsize - Common get file size function + */ +UINT32 +CmGetFileSize ( + FILE *File); + + +#ifndef ACPI_DUMP_APP /* * adisasm */ @@ -188,8 +203,7 @@ AdAmlDisassemble ( BOOLEAN OutToFile, char *Filename, char *Prefix, - char **OutFilename, - BOOLEAN GetAllTables); + char **OutFilename); void AdPrintStatistics ( @@ -206,8 +220,7 @@ AdDumpTables ( ACPI_STATUS AdGetLocalTables ( - char *Filename, - BOOLEAN GetAllTables); + void); ACPI_STATUS AdParseTable ( @@ -284,6 +297,6 @@ AdWriteTable ( UINT32 Length, char *TableName, char *OemTableId); +#endif #endif /* _ACAPPS */ - diff --git a/reactos/drivers/bus/acpi/acpica/include/acbuffer.h b/reactos/drivers/bus/acpi/acpica/include/acbuffer.h new file mode 100644 index 00000000000..3228bcad2f3 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/include/acbuffer.h @@ -0,0 +1,318 @@ +/****************************************************************************** + * + * Name: acbuffer.h - Support for buffers returned by ACPI predefined names + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#ifndef __ACBUFFER_H__ +#define __ACBUFFER_H__ + +/* + * Contains buffer structures for these predefined names: + * _FDE, _GRT, _GTM, _PLD, _SRT + */ + +/* + * Note: C bitfields are not used for this reason: + * + * "Bitfields are great and easy to read, but unfortunately the C language + * does not specify the layout of bitfields in memory, which means they are + * essentially useless for dealing with packed data in on-disk formats or + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, + * this decision was a design error in C. Ritchie could have picked an order + * and stuck with it." Norman Ramsey. + * See http://stackoverflow.com/a/1053662/41661 + */ + + +/* _FDE return value */ + +typedef struct acpi_fde_info +{ + UINT32 Floppy0; + UINT32 Floppy1; + UINT32 Floppy2; + UINT32 Floppy3; + UINT32 Tape; + +} ACPI_FDE_INFO; + +/* + * _GRT return value + * _SRT input value + */ +typedef struct acpi_grt_info +{ + UINT16 Year; + UINT8 Month; + UINT8 Day; + UINT8 Hour; + UINT8 Minute; + UINT8 Second; + UINT8 Valid; + UINT16 Milliseconds; + UINT16 Timezone; + UINT8 Daylight; + UINT8 Reserved[3]; + +} ACPI_GRT_INFO; + +/* _GTM return value */ + +typedef struct acpi_gtm_info +{ + UINT32 PioSpeed0; + UINT32 DmaSpeed0; + UINT32 PioSpeed1; + UINT32 DmaSpeed1; + UINT32 Flags; + +} ACPI_GTM_INFO; + +/* + * Formatted _PLD return value. The minimum size is a package containing + * one buffer. + * Revision 1: Buffer is 16 bytes (128 bits) + * Revision 2: Buffer is 20 bytes (160 bits) + * + * Note: This structure is returned from the AcpiDecodePldBuffer + * interface. + */ +typedef struct acpi_pld_info +{ + UINT8 Revision; + UINT8 IgnoreColor; + UINT32 Color; + UINT16 Width; + UINT16 Height; + UINT8 UserVisible; + UINT8 Dock; + UINT8 Lid; + UINT8 Panel; + UINT8 VerticalPosition; + UINT8 HorizontalPosition; + UINT8 Shape; + UINT8 GroupOrientation; + UINT8 GroupToken; + UINT8 GroupPosition; + UINT8 Bay; + UINT8 Ejectable; + UINT8 OspmEjectRequired; + UINT8 CabinetNumber; + UINT8 CardCageNumber; + UINT8 Reference; + UINT8 Rotation; + UINT8 Order; + UINT8 Reserved; + UINT16 VerticalOffset; + UINT16 HorizontalOffset; + +} ACPI_PLD_INFO; + + +/* + * Macros to: + * 1) Convert a _PLD buffer to internal ACPI_PLD_INFO format - ACPI_PLD_GET* + * (Used by AcpiDecodePldBuffer) + * 2) Construct a _PLD buffer - ACPI_PLD_SET* + * (Intended for BIOS use only) + */ +#define ACPI_PLD_REV1_BUFFER_SIZE 16 /* For Revision 1 of the buffer (From ACPI spec) */ +#define ACPI_PLD_BUFFER_SIZE 20 /* For Revision 2 of the buffer (From ACPI spec) */ + +/* First 32-bit dword, bits 0:32 */ + +#define ACPI_PLD_GET_REVISION(dword) ACPI_GET_BITS (dword, 0, ACPI_7BIT_MASK) +#define ACPI_PLD_SET_REVISION(dword,value) ACPI_SET_BITS (dword, 0, ACPI_7BIT_MASK, value) /* Offset 0, Len 7 */ + +#define ACPI_PLD_GET_IGNORE_COLOR(dword) ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK) +#define ACPI_PLD_SET_IGNORE_COLOR(dword,value) ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value) /* Offset 7, Len 1 */ + +#define ACPI_PLD_GET_COLOR(dword) ACPI_GET_BITS (dword, 8, ACPI_24BIT_MASK) +#define ACPI_PLD_SET_COLOR(dword,value) ACPI_SET_BITS (dword, 8, ACPI_24BIT_MASK, value) /* Offset 8, Len 24 */ + +/* Second 32-bit dword, bits 33:63 */ + +#define ACPI_PLD_GET_WIDTH(dword) ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK) +#define ACPI_PLD_SET_WIDTH(dword,value) ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value) /* Offset 32+0=32, Len 16 */ + +#define ACPI_PLD_GET_HEIGHT(dword) ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK) +#define ACPI_PLD_SET_HEIGHT(dword,value) ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value) /* Offset 32+16=48, Len 16 */ + +/* Third 32-bit dword, bits 64:95 */ + +#define ACPI_PLD_GET_USER_VISIBLE(dword) ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK) +#define ACPI_PLD_SET_USER_VISIBLE(dword,value) ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value) /* Offset 64+0=64, Len 1 */ + +#define ACPI_PLD_GET_DOCK(dword) ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK) +#define ACPI_PLD_SET_DOCK(dword,value) ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value) /* Offset 64+1=65, Len 1 */ + +#define ACPI_PLD_GET_LID(dword) ACPI_GET_BITS (dword, 2, ACPI_1BIT_MASK) +#define ACPI_PLD_SET_LID(dword,value) ACPI_SET_BITS (dword, 2, ACPI_1BIT_MASK, value) /* Offset 64+2=66, Len 1 */ + +#define ACPI_PLD_GET_PANEL(dword) ACPI_GET_BITS (dword, 3, ACPI_3BIT_MASK) +#define ACPI_PLD_SET_PANEL(dword,value) ACPI_SET_BITS (dword, 3, ACPI_3BIT_MASK, value) /* Offset 64+3=67, Len 3 */ + +#define ACPI_PLD_GET_VERTICAL(dword) ACPI_GET_BITS (dword, 6, ACPI_2BIT_MASK) +#define ACPI_PLD_SET_VERTICAL(dword,value) ACPI_SET_BITS (dword, 6, ACPI_2BIT_MASK, value) /* Offset 64+6=70, Len 2 */ + +#define ACPI_PLD_GET_HORIZONTAL(dword) ACPI_GET_BITS (dword, 8, ACPI_2BIT_MASK) +#define ACPI_PLD_SET_HORIZONTAL(dword,value) ACPI_SET_BITS (dword, 8, ACPI_2BIT_MASK, value) /* Offset 64+8=72, Len 2 */ + +#define ACPI_PLD_GET_SHAPE(dword) ACPI_GET_BITS (dword, 10, ACPI_4BIT_MASK) +#define ACPI_PLD_SET_SHAPE(dword,value) ACPI_SET_BITS (dword, 10, ACPI_4BIT_MASK, value) /* Offset 64+10=74, Len 4 */ + +#define ACPI_PLD_GET_ORIENTATION(dword) ACPI_GET_BITS (dword, 14, ACPI_1BIT_MASK) +#define ACPI_PLD_SET_ORIENTATION(dword,value) ACPI_SET_BITS (dword, 14, ACPI_1BIT_MASK, value) /* Offset 64+14=78, Len 1 */ + +#define ACPI_PLD_GET_TOKEN(dword) ACPI_GET_BITS (dword, 15, ACPI_8BIT_MASK) +#define ACPI_PLD_SET_TOKEN(dword,value) ACPI_SET_BITS (dword, 15, ACPI_8BIT_MASK, value) /* Offset 64+15=79, Len 8 */ + +#define ACPI_PLD_GET_POSITION(dword) ACPI_GET_BITS (dword, 23, ACPI_8BIT_MASK) +#define ACPI_PLD_SET_POSITION(dword,value) ACPI_SET_BITS (dword, 23, ACPI_8BIT_MASK, value) /* Offset 64+23=87, Len 8 */ + +#define ACPI_PLD_GET_BAY(dword) ACPI_GET_BITS (dword, 31, ACPI_1BIT_MASK) +#define ACPI_PLD_SET_BAY(dword,value) ACPI_SET_BITS (dword, 31, ACPI_1BIT_MASK, value) /* Offset 64+31=95, Len 1 */ + +/* Fourth 32-bit dword, bits 96:127 */ + +#define ACPI_PLD_GET_EJECTABLE(dword) ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK) +#define ACPI_PLD_SET_EJECTABLE(dword,value) ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value) /* Offset 96+0=96, Len 1 */ + +#define ACPI_PLD_GET_OSPM_EJECT(dword) ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK) +#define ACPI_PLD_SET_OSPM_EJECT(dword,value) ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value) /* Offset 96+1=97, Len 1 */ + +#define ACPI_PLD_GET_CABINET(dword) ACPI_GET_BITS (dword, 2, ACPI_8BIT_MASK) +#define ACPI_PLD_SET_CABINET(dword,value) ACPI_SET_BITS (dword, 2, ACPI_8BIT_MASK, value) /* Offset 96+2=98, Len 8 */ + +#define ACPI_PLD_GET_CARD_CAGE(dword) ACPI_GET_BITS (dword, 10, ACPI_8BIT_MASK) +#define ACPI_PLD_SET_CARD_CAGE(dword,value) ACPI_SET_BITS (dword, 10, ACPI_8BIT_MASK, value) /* Offset 96+10=106, Len 8 */ + +#define ACPI_PLD_GET_REFERENCE(dword) ACPI_GET_BITS (dword, 18, ACPI_1BIT_MASK) +#define ACPI_PLD_SET_REFERENCE(dword,value) ACPI_SET_BITS (dword, 18, ACPI_1BIT_MASK, value) /* Offset 96+18=114, Len 1 */ + +#define ACPI_PLD_GET_ROTATION(dword) ACPI_GET_BITS (dword, 19, ACPI_4BIT_MASK) +#define ACPI_PLD_SET_ROTATION(dword,value) ACPI_SET_BITS (dword, 19, ACPI_4BIT_MASK, value) /* Offset 96+19=115, Len 4 */ + +#define ACPI_PLD_GET_ORDER(dword) ACPI_GET_BITS (dword, 23, ACPI_5BIT_MASK) +#define ACPI_PLD_SET_ORDER(dword,value) ACPI_SET_BITS (dword, 23, ACPI_5BIT_MASK, value) /* Offset 96+23=119, Len 5 */ + +/* Fifth 32-bit dword, bits 128:159 (Revision 2 of _PLD only) */ + +#define ACPI_PLD_GET_VERT_OFFSET(dword) ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK) +#define ACPI_PLD_SET_VERT_OFFSET(dword,value) ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value) /* Offset 128+0=128, Len 16 */ + +#define ACPI_PLD_GET_HORIZ_OFFSET(dword) ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK) +#define ACPI_PLD_SET_HORIZ_OFFSET(dword,value) ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value) /* Offset 128+16=144, Len 16 */ + + +#endif /* ACBUFFER_H */ diff --git a/reactos/drivers/bus/acpi/acpica/include/accommon.h b/reactos/drivers/bus/acpi/acpica/include/accommon.h index 7a5739eb0d5..57735c5decd 100644 --- a/reactos/drivers/bus/acpi/acpica/include/accommon.h +++ b/reactos/drivers/bus/acpi/acpica/include/accommon.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in diff --git a/reactos/drivers/bus/acpi/acpica/include/acconfig.h b/reactos/drivers/bus/acpi/acpica/include/acconfig.h index 9bc00f15777..6b344845aaa 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acconfig.h +++ b/reactos/drivers/bus/acpi/acpica/include/acconfig.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -125,8 +125,8 @@ /* * ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the - * ACPI subsystem. This includes the DEBUG_PRINT output - * statements. When disabled, all DEBUG_PRINT + * ACPI subsystem. This includes the DEBUG_PRINT output + * statements. When disabled, all DEBUG_PRINT * statements are compiled out. * * ACPI_APPLICATION - Use this switch if the subsystem is going to be run @@ -135,12 +135,12 @@ */ /* - * OS name, used for the _OS object. The _OS object is essentially obsolete, + * OS name, used for the _OS object. The _OS object is essentially obsolete, * but there is a large base of ASL/AML code in existing machines that check - * for the string below. The use of this string usually guarantees that - * the ASL will execute down the most tested code path. Also, there is some + * for the string below. The use of this string usually guarantees that + * the ASL will execute down the most tested code path. Also, there is some * code that will not execute the _OSI method unless _OS matches the string - * below. Therefore, change this string at your own risk. + * below. Therefore, change this string at your own risk. */ #define ACPI_OS_NAME "Microsoft Windows NT" @@ -156,7 +156,28 @@ * Should the subsystem abort the loading of an ACPI table if the * table checksum is incorrect? */ +#ifndef ACPI_CHECKSUM_ABORT #define ACPI_CHECKSUM_ABORT FALSE +#endif + +/* + * Generate a version of ACPICA that only supports "reduced hardware" + * platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized + * version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware" + * model. In other words, no ACPI hardware is supported. + * + * If TRUE, this means no support for the following: + * PM Event and Control registers + * SCI interrupt (and handler) + * Fixed Events + * General Purpose Events (GPEs) + * Global Lock + * ACPI PM timer + * FACS table (Waking vectors and Global Lock) + */ +#ifndef ACPI_REDUCED_HARDWARE +#define ACPI_REDUCED_HARDWARE FALSE +#endif /****************************************************************************** @@ -167,7 +188,7 @@ /* Version of ACPI supported */ -#define ACPI_CA_SUPPORT_LEVEL 3 +#define ACPI_CA_SUPPORT_LEVEL 5 /* Maximum count for a semaphore object */ @@ -197,6 +218,10 @@ #define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */ +/* Address Range lists are per-SpaceId (Memory and I/O only) */ + +#define ACPI_ADDRESS_RANGE_MAX 2 + /****************************************************************************** * @@ -245,8 +270,9 @@ /* Maximum SpaceIds for Operation Regions */ #define ACPI_MAX_ADDRESS_SPACE 255 +#define ACPI_NUM_DEFAULT_SPACES 4 -/* Array sizes. Used for range checking also */ +/* Array sizes. Used for range checking also */ #define ACPI_MAX_MATCH_OPCODE 5 @@ -255,9 +281,10 @@ #define ACPI_RSDP_CHECKSUM_LENGTH 20 #define ACPI_RSDP_XCHECKSUM_LENGTH 36 -/* SMBus and IPMI bidirectional buffer size */ +/* SMBus, GSBus and IPMI bidirectional buffer size */ #define ACPI_SMBUS_BUFFER_SIZE 34 +#define ACPI_GSBUS_BUFFER_SIZE 34 #define ACPI_IPMI_BUFFER_SIZE 66 /* _SxD and _SxW control methods */ @@ -272,7 +299,7 @@ * *****************************************************************************/ -#define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 2 /* Max command line arguments */ +#define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 4 /* Max command line arguments */ #define ACPI_DB_LINE_BUFFER_SIZE 512 #define ACPI_DEBUGGER_COMMAND_PROMPT '-' @@ -280,4 +307,3 @@ #endif /* _ACCONFIG_H */ - diff --git a/reactos/drivers/bus/acpi/acpica/include/acdebug.h b/reactos/drivers/bus/acpi/acpica/include/acdebug.h index 05f9aa3e218..1807c31623f 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acdebug.h +++ b/reactos/drivers/bus/acpi/acpica/include/acdebug.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -119,25 +119,33 @@ #define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */ -typedef struct CommandInfo +typedef struct acpi_db_command_info { char *Name; /* Command Name */ UINT8 MinArgs; /* Minimum arguments required */ -} COMMAND_INFO; +} ACPI_DB_COMMAND_INFO; -typedef struct ArgumentInfo +typedef struct acpi_db_command_help +{ + UINT8 LineCount; /* Number of help lines */ + char *Invocation; /* Command Invocation */ + char *Description; /* Command Description */ + +} ACPI_DB_COMMAND_HELP; + +typedef struct acpi_db_argument_info { char *Name; /* Argument Name */ -} ARGUMENT_INFO; +} ACPI_DB_ARGUMENT_INFO; -typedef struct acpi_execute_walk +typedef struct acpi_db_execute_walk { UINT32 Count; UINT32 MaxCount; -} ACPI_EXECUTE_WALK; +} ACPI_DB_EXECUTE_WALK; #define PARAM_LIST(pl) pl @@ -178,10 +186,13 @@ void AcpiDbDisplayTableInfo ( char *TableArg); +void +AcpiDbDisplayTemplate ( + char *BufferArg); + void AcpiDbUnloadAcpiTable ( - char *TableArg, - char *InstanceArg); + char *Name); void AcpiDbSendNotify ( @@ -205,18 +216,57 @@ void AcpiDbDisplayResources ( char *ObjectArg); +ACPI_HW_DEPENDENT_RETURN_VOID ( void AcpiDbDisplayGpes ( - void); + void)) void AcpiDbDisplayHandlers ( void); +ACPI_HW_DEPENDENT_RETURN_VOID ( void AcpiDbGenerateGpe ( char *GpeArg, - char *BlockArg); + char *BlockArg)) + +ACPI_HW_DEPENDENT_RETURN_VOID ( +void +AcpiDbGenerateSci ( + void)) + +void +AcpiDbExecuteTest ( + char *TypeArg); + + +/* + * dbconvert - miscellaneous conversion routines + */ +ACPI_STATUS +AcpiDbHexCharToValue ( + int HexChar, + UINT8 *ReturnValue); + +ACPI_STATUS +AcpiDbConvertToPackage ( + char *String, + ACPI_OBJECT *Object); + +ACPI_STATUS +AcpiDbConvertToObject ( + ACPI_OBJECT_TYPE Type, + char *String, + ACPI_OBJECT *Object); + +UINT8 * +AcpiDbEncodePldBuffer ( + ACPI_PLD_INFO *PldInfo); + +void +AcpiDbDumpPldBuffer ( + ACPI_OBJECT *ObjDesc); /* @@ -264,6 +314,10 @@ AcpiDbDumpNamespace ( char *StartArg, char *DepthArg); +void +AcpiDbDumpNamespacePaths ( + void); + void AcpiDbDumpNamespaceByOwner ( char *OwnerArg, @@ -358,6 +412,11 @@ AcpiDbCreateExecutionThreads ( char *NumLoopsArg, char *MethodNameArg); +void +AcpiDbDeleteObjects ( + UINT32 Count, + ACPI_OBJECT *Objects); + #ifdef ACPI_DBG_TRACK_ALLOCATIONS UINT32 AcpiDbGetCacheInfo ( @@ -371,7 +430,7 @@ AcpiDbGetCacheInfo ( ACPI_OBJECT_TYPE AcpiDbMatchArgument ( char *UserArgument, - ARGUMENT_INFO *Arguments); + ACPI_DB_ARGUMENT_INFO *Arguments); void AcpiDbCloseDebugFile ( @@ -411,6 +470,10 @@ char * AcpiDbGetFromHistory ( char *CommandNumArg); +char * +AcpiDbGetHistoryByIndex ( + UINT32 CommanddNum); + /* * dbinput - user front-end to the AML debugger @@ -471,7 +534,7 @@ AcpiDbLocalNsLookup ( char *Name); void -AcpiDbUInt32ToHexString ( +AcpiDbUint32ToHexString ( UINT32 Value, char *Buffer); diff --git a/reactos/drivers/bus/acpi/acpica/include/acdisasm.h b/reactos/drivers/bus/acpi/acpica/include/acdisasm.h index b151ecdfa74..df8d2e795ce 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acdisasm.h +++ b/reactos/drivers/bus/acpi/acpica/include/acdisasm.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -135,74 +135,101 @@ typedef const struct acpi_dmtable_info { UINT8 Opcode; - UINT8 Offset; + UINT16 Offset; char *Name; UINT8 Flags; } ACPI_DMTABLE_INFO; +/* Values for Flags field above */ + #define DT_LENGTH 0x01 /* Field is a subtable length */ #define DT_FLAG 0x02 /* Field is a flag value */ #define DT_NON_ZERO 0x04 /* Field must be non-zero */ - -/* TBD: Not used at this time */ - -#define DT_OPTIONAL 0x08 -#define DT_COUNT 0x10 +#define DT_OPTIONAL 0x08 /* Field is optional */ +#define DT_DESCRIBES_OPTIONAL 0x10 /* Field describes an optional field (length, etc.) */ +#define DT_COUNT 0x20 /* Currently not used */ /* * Values for Opcode above. - * Note: 0-7 must not change, used as a flag shift value + * Note: 0-7 must not change, they are used as a flag shift value. Other + * than those, new values can be added wherever appropriate. */ -#define ACPI_DMT_FLAG0 0 -#define ACPI_DMT_FLAG1 1 -#define ACPI_DMT_FLAG2 2 -#define ACPI_DMT_FLAG3 3 -#define ACPI_DMT_FLAG4 4 -#define ACPI_DMT_FLAG5 5 -#define ACPI_DMT_FLAG6 6 -#define ACPI_DMT_FLAG7 7 -#define ACPI_DMT_FLAGS0 8 -#define ACPI_DMT_FLAGS2 9 -#define ACPI_DMT_UINT8 10 -#define ACPI_DMT_UINT16 11 -#define ACPI_DMT_UINT24 12 -#define ACPI_DMT_UINT32 13 -#define ACPI_DMT_UINT56 14 -#define ACPI_DMT_UINT64 15 -#define ACPI_DMT_STRING 16 -#define ACPI_DMT_NAME4 17 -#define ACPI_DMT_NAME6 18 -#define ACPI_DMT_NAME8 19 -#define ACPI_DMT_CHKSUM 20 -#define ACPI_DMT_SPACEID 21 -#define ACPI_DMT_GAS 22 -#define ACPI_DMT_ASF 23 -#define ACPI_DMT_DMAR 24 -#define ACPI_DMT_HEST 25 -#define ACPI_DMT_HESTNTFY 26 -#define ACPI_DMT_HESTNTYP 27 -#define ACPI_DMT_MADT 28 -#define ACPI_DMT_SRAT 29 -#define ACPI_DMT_EXIT 30 -#define ACPI_DMT_SIG 31 -#define ACPI_DMT_FADTPM 32 -#define ACPI_DMT_BUF16 33 -#define ACPI_DMT_IVRS 34 -#define ACPI_DMT_BUFFER 35 -#define ACPI_DMT_PCI_PATH 36 -#define ACPI_DMT_EINJACT 37 -#define ACPI_DMT_EINJINST 38 -#define ACPI_DMT_ERSTACT 39 -#define ACPI_DMT_ERSTINST 40 -#define ACPI_DMT_ACCWIDTH 41 -#define ACPI_DMT_UNICODE 42 -#define ACPI_DMT_UUID 43 -#define ACPI_DMT_DEVICE_PATH 44 -#define ACPI_DMT_LABEL 45 -#define ACPI_DMT_BUF7 46 -#define ACPI_DMT_BUF128 47 -#define ACPI_DMT_SLIC 48 +typedef enum +{ + /* Simple Data Types */ + + ACPI_DMT_FLAG0 = 0, + ACPI_DMT_FLAG1 = 1, + ACPI_DMT_FLAG2 = 2, + ACPI_DMT_FLAG3 = 3, + ACPI_DMT_FLAG4 = 4, + ACPI_DMT_FLAG5 = 5, + ACPI_DMT_FLAG6 = 6, + ACPI_DMT_FLAG7 = 7, + ACPI_DMT_FLAGS0, + ACPI_DMT_FLAGS1, + ACPI_DMT_FLAGS2, + ACPI_DMT_FLAGS4, + ACPI_DMT_UINT8, + ACPI_DMT_UINT16, + ACPI_DMT_UINT24, + ACPI_DMT_UINT32, + ACPI_DMT_UINT40, + ACPI_DMT_UINT48, + ACPI_DMT_UINT56, + ACPI_DMT_UINT64, + ACPI_DMT_BUF7, + ACPI_DMT_BUF10, + ACPI_DMT_BUF16, + ACPI_DMT_BUF128, + ACPI_DMT_SIG, + ACPI_DMT_STRING, + ACPI_DMT_NAME4, + ACPI_DMT_NAME6, + ACPI_DMT_NAME8, + + /* Types that are decoded to strings and miscellaneous */ + + ACPI_DMT_ACCWIDTH, + ACPI_DMT_CHKSUM, + ACPI_DMT_GAS, + ACPI_DMT_SPACEID, + ACPI_DMT_UNICODE, + ACPI_DMT_UUID, + + /* Types used only for the Data Table Compiler */ + + ACPI_DMT_BUFFER, + ACPI_DMT_DEVICE_PATH, + ACPI_DMT_LABEL, + ACPI_DMT_PCI_PATH, + + /* Types that are specific to particular ACPI tables */ + + ACPI_DMT_ASF, + ACPI_DMT_DMAR, + ACPI_DMT_EINJACT, + ACPI_DMT_EINJINST, + ACPI_DMT_ERSTACT, + ACPI_DMT_ERSTINST, + ACPI_DMT_FADTPM, + ACPI_DMT_HEST, + ACPI_DMT_HESTNTFY, + ACPI_DMT_HESTNTYP, + ACPI_DMT_IVRS, + ACPI_DMT_MADT, + ACPI_DMT_PCCT, + ACPI_DMT_PMTT, + ACPI_DMT_SLIC, + ACPI_DMT_SRAT, + + /* Special opcodes */ + + ACPI_DMT_EXTRA_TEXT, + ACPI_DMT_EXIT + +} ACPI_ENTRY_TYPES; typedef void (*ACPI_DMTABLE_HANDLER) ( @@ -247,6 +274,11 @@ ACPI_STATUS (*ASL_WALK_CALLBACK) ( #define ASL_WALK_CALLBACK_DEFINED #endif +typedef +void (*ACPI_RESOURCE_HANDLER) ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); typedef struct acpi_resource_tag { @@ -274,8 +306,18 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[]; @@ -284,6 +326,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[]; @@ -293,7 +336,13 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[]; @@ -326,14 +375,37 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt7[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[]; @@ -347,7 +419,10 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[]; +extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[]; extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[]; @@ -409,6 +484,14 @@ void AcpiDmDumpCpep ( ACPI_TABLE_HEADER *Table); +void +AcpiDmDumpCsrt ( + ACPI_TABLE_HEADER *Table); + +void +AcpiDmDumpDbg2 ( + ACPI_TABLE_HEADER *Table); + void AcpiDmDumpDmar ( ACPI_TABLE_HEADER *Table); @@ -425,6 +508,10 @@ void AcpiDmDumpFadt ( ACPI_TABLE_HEADER *Table); +void +AcpiDmDumpFpdt ( + ACPI_TABLE_HEADER *Table); + void AcpiDmDumpHest ( ACPI_TABLE_HEADER *Table); @@ -433,18 +520,34 @@ void AcpiDmDumpIvrs ( ACPI_TABLE_HEADER *Table); -void -AcpiDmDumpMcfg ( - ACPI_TABLE_HEADER *Table); - void AcpiDmDumpMadt ( ACPI_TABLE_HEADER *Table); +void +AcpiDmDumpMcfg ( + ACPI_TABLE_HEADER *Table); + +void +AcpiDmDumpMpst ( + ACPI_TABLE_HEADER *Table); + void AcpiDmDumpMsct ( ACPI_TABLE_HEADER *Table); +void +AcpiDmDumpMtmr ( + ACPI_TABLE_HEADER *Table); + +void +AcpiDmDumpPcct ( + ACPI_TABLE_HEADER *Table); + +void +AcpiDmDumpPmtt ( + ACPI_TABLE_HEADER *Table); + UINT32 AcpiDmDumpRsdp ( ACPI_TABLE_HEADER *Table); @@ -453,6 +556,10 @@ void AcpiDmDumpRsdt ( ACPI_TABLE_HEADER *Table); +UINT32 +AcpiDmDumpS3pt ( + ACPI_TABLE_HEADER *Table); + void AcpiDmDumpSlic ( ACPI_TABLE_HEADER *Table); @@ -465,6 +572,10 @@ void AcpiDmDumpSrat ( ACPI_TABLE_HEADER *Table); +void +AcpiDmDumpVrtc ( + ACPI_TABLE_HEADER *Table); + void AcpiDmDumpWdat ( ACPI_TABLE_HEADER *Table); @@ -512,6 +623,22 @@ void AcpiDmMethodFlags ( ACPI_PARSE_OBJECT *Op); +void +AcpiDmDisplayTargetPathname ( + ACPI_PARSE_OBJECT *Op); + +void +AcpiDmNotifyDescription ( + ACPI_PARSE_OBJECT *Op); + +void +AcpiDmPredefinedDescription ( + ACPI_PARSE_OBJECT *Op); + +void +AcpiDmFieldPredefinedDescription ( + ACPI_PARSE_OBJECT *Op); + void AcpiDmFieldFlags ( ACPI_PARSE_OBJECT *Op); @@ -584,11 +711,11 @@ AcpiDmByteList ( ACPI_PARSE_OBJECT *Op); void -AcpiDmIsEisaId ( +AcpiDmCheckForHardwareId ( ACPI_PARSE_OBJECT *Op); void -AcpiDmEisaId ( +AcpiDmDecompressEisaId ( UINT32 EncodedId); BOOLEAN @@ -599,11 +726,22 @@ BOOLEAN AcpiDmIsStringBuffer ( ACPI_PARSE_OBJECT *Op); +BOOLEAN +AcpiDmIsPldBuffer ( + ACPI_PARSE_OBJECT *Op); + + +/* + * dmdeferred + */ +ACPI_STATUS +AcpiDmParseDeferredOps ( + ACPI_PARSE_OBJECT *Root); + /* * dmextern */ - ACPI_STATUS AcpiDmAddToExternalFileList ( char *PathList); @@ -613,11 +751,19 @@ AcpiDmClearExternalFileList ( void); void -AcpiDmAddToExternalList ( +AcpiDmAddOpToExternalList ( ACPI_PARSE_OBJECT *Op, char *Path, UINT8 Type, - UINT32 Value); + UINT32 Value, + UINT16 Flags); + +void +AcpiDmAddNodeToExternalList ( + ACPI_NAMESPACE_NODE *Node, + UINT8 Type, + UINT32 Value, + UINT16 Flags); void AcpiDmAddExternalsToNamespace ( @@ -635,6 +781,13 @@ void AcpiDmEmitExternals ( void); +void +AcpiDmUnresolvedWarning ( + UINT8 Type); + +void +AcpiDmGetExternalsFromFile ( + void); /* * dmresrc @@ -668,6 +821,7 @@ AcpiDmResourceTemplate ( ACPI_STATUS AcpiDmIsResourceTemplate ( + ACPI_WALK_STATE *WalkState, ACPI_PARSE_OBJECT *Op); void @@ -742,6 +896,18 @@ AcpiDmVendorLargeDescriptor ( UINT32 Length, UINT32 Level); +void +AcpiDmGpioDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + +void +AcpiDmSerialBusDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + void AcpiDmVendorCommon ( char *Name, @@ -765,6 +931,12 @@ AcpiDmDmaDescriptor ( UINT32 Length, UINT32 Level); +void +AcpiDmFixedDmaDescriptor ( + AML_RESOURCE *Resource, + UINT32 Length, + UINT32 Level); + void AcpiDmIoDescriptor ( AML_RESOURCE *Resource, diff --git a/reactos/drivers/bus/acpi/acpica/include/acdispat.h b/reactos/drivers/bus/acpi/acpica/include/acdispat.h index 9a47d1dbe6d..bfccbf1a62f 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acdispat.h +++ b/reactos/drivers/bus/acpi/acpica/include/acdispat.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -245,13 +245,15 @@ AcpiDsInitFieldObjects ( /* - * dsload - Parser/Interpreter interface, pass 1 namespace load callbacks + * dsload - Parser/Interpreter interface */ ACPI_STATUS AcpiDsInitCallbacks ( ACPI_WALK_STATE *WalkState, UINT32 PassNumber); +/* dsload - pass 1 namespace load callbacks */ + ACPI_STATUS AcpiDsLoad1BeginOp ( ACPI_WALK_STATE *WalkState, @@ -262,9 +264,8 @@ AcpiDsLoad1EndOp ( ACPI_WALK_STATE *WalkState); -/* - * dsload - Parser/Interpreter interface, pass 2 namespace load callbacks - */ +/* dsload - pass 2 namespace load callbacks */ + ACPI_STATUS AcpiDsLoad2BeginOp ( ACPI_WALK_STATE *WalkState, @@ -329,8 +330,9 @@ AcpiDsMethodDataInit ( * dsmethod - Parser/Interpreter interface - control method parsing */ ACPI_STATUS -AcpiDsParseMethod ( - ACPI_NAMESPACE_NODE *Node); +AcpiDsAutoSerializeMethod ( + ACPI_NAMESPACE_NODE *Node, + ACPI_OPERAND_OBJECT *ObjDesc); ACPI_STATUS AcpiDsCallControlMethod ( diff --git a/reactos/drivers/bus/acpi/acpica/include/acevents.h b/reactos/drivers/bus/acpi/acpica/include/acevents.h index 9944e329d8a..731defb0bef 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acevents.h +++ b/reactos/drivers/bus/acpi/acpica/include/acevents.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -157,13 +157,15 @@ ACPI_STATUS AcpiEvInitGlobalLockHandler ( void); +ACPI_HW_DEPENDENT_RETURN_OK ( ACPI_STATUS AcpiEvAcquireGlobalLock( - UINT16 Timeout); + UINT16 Timeout)) +ACPI_HW_DEPENDENT_RETURN_OK ( ACPI_STATUS AcpiEvReleaseGlobalLock( - void); + void)) ACPI_STATUS AcpiEvRemoveGlobalLockHandler ( @@ -226,9 +228,10 @@ AcpiEvInitializeGpeBlock ( ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context); +ACPI_HW_DEPENDENT_RETURN_OK ( ACPI_STATUS AcpiEvDeleteGpeBlock ( - ACPI_GPE_BLOCK_INFO *GpeBlock); + ACPI_GPE_BLOCK_INFO *GpeBlock)) UINT32 AcpiEvGpeDispatch ( @@ -236,6 +239,7 @@ AcpiEvGpeDispatch ( ACPI_GPE_EVENT_INFO *GpeEventInfo, UINT32 GpeNumber); + /* * evgpeinit - GPE initialization and update */ @@ -243,9 +247,10 @@ ACPI_STATUS AcpiEvGpeInitialize ( void); +ACPI_HW_DEPENDENT_RETURN_VOID ( void AcpiEvUpdateGpes ( - ACPI_OWNER_ID TableOwnerId); + ACPI_OWNER_ID TableOwnerId)) ACPI_STATUS AcpiEvMatchGpeMethod ( @@ -254,6 +259,7 @@ AcpiEvMatchGpeMethod ( void *Context, void **ReturnValue); + /* * evgpeutil - GPE utilities */ @@ -272,9 +278,10 @@ AcpiEvGetGpeDevice ( ACPI_GPE_BLOCK_INFO *GpeBlock, void *Context); -ACPI_GPE_XRUPT_INFO * +ACPI_STATUS AcpiEvGetGpeXruptBlock ( - UINT32 InterruptNumber); + UINT32 InterruptNumber, + ACPI_GPE_XRUPT_INFO **GpeXruptBlock); ACPI_STATUS AcpiEvDeleteGpeXrupt ( @@ -288,19 +295,37 @@ AcpiEvDeleteGpeHandlers ( /* - * evregion - Address Space handling + * evhandler - Address space handling */ +BOOLEAN +AcpiEvHasDefaultHandler ( + ACPI_NAMESPACE_NODE *Node, + ACPI_ADR_SPACE_TYPE SpaceId); + ACPI_STATUS AcpiEvInstallRegionHandlers ( void); ACPI_STATUS +AcpiEvInstallSpaceHandler ( + ACPI_NAMESPACE_NODE *Node, + ACPI_ADR_SPACE_TYPE SpaceId, + ACPI_ADR_SPACE_HANDLER Handler, + ACPI_ADR_SPACE_SETUP Setup, + void *Context); + + +/* + * evregion - Operation region support + */ +ACPI_STATUS AcpiEvInitializeOpRegions ( void); ACPI_STATUS AcpiEvAddressSpaceDispatch ( - ACPI_OPERAND_OBJECT *RegionObj, + ACPI_OPERAND_OBJECT *RegionObj, + ACPI_OPERAND_OBJECT *FieldObj, UINT32 Function, UINT32 RegionOffset, UINT32 BitWidth, @@ -317,14 +342,6 @@ AcpiEvDetachRegion ( ACPI_OPERAND_OBJECT *RegionObj, BOOLEAN AcpiNsIsLocked); -ACPI_STATUS -AcpiEvInstallSpaceHandler ( - ACPI_NAMESPACE_NODE *Node, - ACPI_ADR_SPACE_TYPE SpaceId, - ACPI_ADR_SPACE_HANDLER Handler, - ACPI_ADR_SPACE_SETUP Setup, - void *Context); - ACPI_STATUS AcpiEvExecuteRegMethods ( ACPI_NAMESPACE_NODE *Node, @@ -394,21 +411,21 @@ UINT32 ACPI_SYSTEM_XFACE AcpiEvGpeXruptHandler ( void *Context); +UINT32 +AcpiEvSciDispatch ( + void); + UINT32 AcpiEvInstallSciHandler ( void); ACPI_STATUS -AcpiEvRemoveSciHandler ( +AcpiEvRemoveAllSciHandlers ( void); -UINT32 -AcpiEvInitializeSCI ( - UINT32 ProgramSCI); - +ACPI_HW_DEPENDENT_RETURN_VOID ( void AcpiEvTerminate ( - void); - + void)) #endif /* __ACEVENTS_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acexcep.h b/reactos/drivers/bus/acpi/acpica/include/acexcep.h index 0985258f976..89d98523beb 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acexcep.h +++ b/reactos/drivers/bus/acpi/acpica/include/acexcep.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -117,69 +117,105 @@ #define __ACEXCEP_H__ +/* This module contains all possible exception codes for ACPI_STATUS */ + /* - * Exceptions returned by external ACPI interfaces + * Exception code classes */ -#define AE_CODE_ENVIRONMENTAL 0x0000 -#define AE_CODE_PROGRAMMER 0x1000 -#define AE_CODE_ACPI_TABLES 0x2000 -#define AE_CODE_AML 0x3000 -#define AE_CODE_CONTROL 0x4000 +#define AE_CODE_ENVIRONMENTAL 0x0000 /* General ACPICA environment */ +#define AE_CODE_PROGRAMMER 0x1000 /* External ACPICA interface caller */ +#define AE_CODE_ACPI_TABLES 0x2000 /* ACPI tables */ +#define AE_CODE_AML 0x3000 /* From executing AML code */ +#define AE_CODE_CONTROL 0x4000 /* Internal control codes */ + +#define AE_CODE_MAX 0x4000 #define AE_CODE_MASK 0xF000 +/* + * Macros to insert the exception code classes + */ +#define EXCEP_ENV(code) ((ACPI_STATUS) (code | AE_CODE_ENVIRONMENTAL)) +#define EXCEP_PGM(code) ((ACPI_STATUS) (code | AE_CODE_PROGRAMMER)) +#define EXCEP_TBL(code) ((ACPI_STATUS) (code | AE_CODE_ACPI_TABLES)) +#define EXCEP_AML(code) ((ACPI_STATUS) (code | AE_CODE_AML)) +#define EXCEP_CTL(code) ((ACPI_STATUS) (code | AE_CODE_CONTROL)) +/* + * Exception info table. The "Description" field is used only by the + * ACPICA help application (acpihelp). + */ +typedef struct acpi_exception_info +{ + char *Name; + +#ifdef ACPI_HELP_APP + char *Description; +#endif +} ACPI_EXCEPTION_INFO; + +#ifdef ACPI_HELP_APP +#define EXCEP_TXT(Name,Description) {Name, Description} +#else +#define EXCEP_TXT(Name,Description) {Name} +#endif + + +/* + * Success is always zero, failure is non-zero + */ #define ACPI_SUCCESS(a) (!(a)) #define ACPI_FAILURE(a) (a) - #define AE_OK (ACPI_STATUS) 0x0000 /* * Environmental exceptions */ -#define AE_ERROR (ACPI_STATUS) (0x0001 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_ACPI_TABLES (ACPI_STATUS) (0x0002 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_NAMESPACE (ACPI_STATUS) (0x0003 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_MEMORY (ACPI_STATUS) (0x0004 | AE_CODE_ENVIRONMENTAL) -#define AE_NOT_FOUND (ACPI_STATUS) (0x0005 | AE_CODE_ENVIRONMENTAL) -#define AE_NOT_EXIST (ACPI_STATUS) (0x0006 | AE_CODE_ENVIRONMENTAL) -#define AE_ALREADY_EXISTS (ACPI_STATUS) (0x0007 | AE_CODE_ENVIRONMENTAL) -#define AE_TYPE (ACPI_STATUS) (0x0008 | AE_CODE_ENVIRONMENTAL) -#define AE_NULL_OBJECT (ACPI_STATUS) (0x0009 | AE_CODE_ENVIRONMENTAL) -#define AE_NULL_ENTRY (ACPI_STATUS) (0x000A | AE_CODE_ENVIRONMENTAL) -#define AE_BUFFER_OVERFLOW (ACPI_STATUS) (0x000B | AE_CODE_ENVIRONMENTAL) -#define AE_STACK_OVERFLOW (ACPI_STATUS) (0x000C | AE_CODE_ENVIRONMENTAL) -#define AE_STACK_UNDERFLOW (ACPI_STATUS) (0x000D | AE_CODE_ENVIRONMENTAL) -#define AE_NOT_IMPLEMENTED (ACPI_STATUS) (0x000E | AE_CODE_ENVIRONMENTAL) -#define AE_SUPPORT (ACPI_STATUS) (0x000F | AE_CODE_ENVIRONMENTAL) -#define AE_LIMIT (ACPI_STATUS) (0x0010 | AE_CODE_ENVIRONMENTAL) -#define AE_TIME (ACPI_STATUS) (0x0011 | AE_CODE_ENVIRONMENTAL) -#define AE_ACQUIRE_DEADLOCK (ACPI_STATUS) (0x0012 | AE_CODE_ENVIRONMENTAL) -#define AE_RELEASE_DEADLOCK (ACPI_STATUS) (0x0013 | AE_CODE_ENVIRONMENTAL) -#define AE_NOT_ACQUIRED (ACPI_STATUS) (0x0014 | AE_CODE_ENVIRONMENTAL) -#define AE_ALREADY_ACQUIRED (ACPI_STATUS) (0x0015 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_HARDWARE_RESPONSE (ACPI_STATUS) (0x0016 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_GLOBAL_LOCK (ACPI_STATUS) (0x0017 | AE_CODE_ENVIRONMENTAL) -#define AE_ABORT_METHOD (ACPI_STATUS) (0x0018 | AE_CODE_ENVIRONMENTAL) -#define AE_SAME_HANDLER (ACPI_STATUS) (0x0019 | AE_CODE_ENVIRONMENTAL) -#define AE_NO_HANDLER (ACPI_STATUS) (0x001A | AE_CODE_ENVIRONMENTAL) -#define AE_OWNER_ID_LIMIT (ACPI_STATUS) (0x001B | AE_CODE_ENVIRONMENTAL) +#define AE_ERROR EXCEP_ENV (0x0001) +#define AE_NO_ACPI_TABLES EXCEP_ENV (0x0002) +#define AE_NO_NAMESPACE EXCEP_ENV (0x0003) +#define AE_NO_MEMORY EXCEP_ENV (0x0004) +#define AE_NOT_FOUND EXCEP_ENV (0x0005) +#define AE_NOT_EXIST EXCEP_ENV (0x0006) +#define AE_ALREADY_EXISTS EXCEP_ENV (0x0007) +#define AE_TYPE EXCEP_ENV (0x0008) +#define AE_NULL_OBJECT EXCEP_ENV (0x0009) +#define AE_NULL_ENTRY EXCEP_ENV (0x000A) +#define AE_BUFFER_OVERFLOW EXCEP_ENV (0x000B) +#define AE_STACK_OVERFLOW EXCEP_ENV (0x000C) +#define AE_STACK_UNDERFLOW EXCEP_ENV (0x000D) +#define AE_NOT_IMPLEMENTED EXCEP_ENV (0x000E) +#define AE_SUPPORT EXCEP_ENV (0x000F) +#define AE_LIMIT EXCEP_ENV (0x0010) +#define AE_TIME EXCEP_ENV (0x0011) +#define AE_ACQUIRE_DEADLOCK EXCEP_ENV (0x0012) +#define AE_RELEASE_DEADLOCK EXCEP_ENV (0x0013) +#define AE_NOT_ACQUIRED EXCEP_ENV (0x0014) +#define AE_ALREADY_ACQUIRED EXCEP_ENV (0x0015) +#define AE_NO_HARDWARE_RESPONSE EXCEP_ENV (0x0016) +#define AE_NO_GLOBAL_LOCK EXCEP_ENV (0x0017) +#define AE_ABORT_METHOD EXCEP_ENV (0x0018) +#define AE_SAME_HANDLER EXCEP_ENV (0x0019) +#define AE_NO_HANDLER EXCEP_ENV (0x001A) +#define AE_OWNER_ID_LIMIT EXCEP_ENV (0x001B) +#define AE_NOT_CONFIGURED EXCEP_ENV (0x001C) +#define AE_ACCESS EXCEP_ENV (0x001D) -#define AE_CODE_ENV_MAX 0x001B +#define AE_CODE_ENV_MAX 0x001D /* * Programmer exceptions */ -#define AE_BAD_PARAMETER (ACPI_STATUS) (0x0001 | AE_CODE_PROGRAMMER) -#define AE_BAD_CHARACTER (ACPI_STATUS) (0x0002 | AE_CODE_PROGRAMMER) -#define AE_BAD_PATHNAME (ACPI_STATUS) (0x0003 | AE_CODE_PROGRAMMER) -#define AE_BAD_DATA (ACPI_STATUS) (0x0004 | AE_CODE_PROGRAMMER) -#define AE_BAD_HEX_CONSTANT (ACPI_STATUS) (0x0005 | AE_CODE_PROGRAMMER) -#define AE_BAD_OCTAL_CONSTANT (ACPI_STATUS) (0x0006 | AE_CODE_PROGRAMMER) -#define AE_BAD_DECIMAL_CONSTANT (ACPI_STATUS) (0x0007 | AE_CODE_PROGRAMMER) -#define AE_MISSING_ARGUMENTS (ACPI_STATUS) (0x0008 | AE_CODE_PROGRAMMER) -#define AE_BAD_ADDRESS (ACPI_STATUS) (0x0009 | AE_CODE_PROGRAMMER) +#define AE_BAD_PARAMETER EXCEP_PGM (0x0001) +#define AE_BAD_CHARACTER EXCEP_PGM (0x0002) +#define AE_BAD_PATHNAME EXCEP_PGM (0x0003) +#define AE_BAD_DATA EXCEP_PGM (0x0004) +#define AE_BAD_HEX_CONSTANT EXCEP_PGM (0x0005) +#define AE_BAD_OCTAL_CONSTANT EXCEP_PGM (0x0006) +#define AE_BAD_DECIMAL_CONSTANT EXCEP_PGM (0x0007) +#define AE_MISSING_ARGUMENTS EXCEP_PGM (0x0008) +#define AE_BAD_ADDRESS EXCEP_PGM (0x0009) #define AE_CODE_PGM_MAX 0x0009 @@ -187,52 +223,52 @@ /* * Acpi table exceptions */ -#define AE_BAD_SIGNATURE (ACPI_STATUS) (0x0001 | AE_CODE_ACPI_TABLES) -#define AE_BAD_HEADER (ACPI_STATUS) (0x0002 | AE_CODE_ACPI_TABLES) -#define AE_BAD_CHECKSUM (ACPI_STATUS) (0x0003 | AE_CODE_ACPI_TABLES) -#define AE_BAD_VALUE (ACPI_STATUS) (0x0004 | AE_CODE_ACPI_TABLES) -#define AE_INVALID_TABLE_LENGTH (ACPI_STATUS) (0x0005 | AE_CODE_ACPI_TABLES) +#define AE_BAD_SIGNATURE EXCEP_TBL (0x0001) +#define AE_BAD_HEADER EXCEP_TBL (0x0002) +#define AE_BAD_CHECKSUM EXCEP_TBL (0x0003) +#define AE_BAD_VALUE EXCEP_TBL (0x0004) +#define AE_INVALID_TABLE_LENGTH EXCEP_TBL (0x0005) #define AE_CODE_TBL_MAX 0x0005 /* - * AML exceptions. These are caused by problems with + * AML exceptions. These are caused by problems with * the actual AML byte stream */ -#define AE_AML_BAD_OPCODE (ACPI_STATUS) (0x0001 | AE_CODE_AML) -#define AE_AML_NO_OPERAND (ACPI_STATUS) (0x0002 | AE_CODE_AML) -#define AE_AML_OPERAND_TYPE (ACPI_STATUS) (0x0003 | AE_CODE_AML) -#define AE_AML_OPERAND_VALUE (ACPI_STATUS) (0x0004 | AE_CODE_AML) -#define AE_AML_UNINITIALIZED_LOCAL (ACPI_STATUS) (0x0005 | AE_CODE_AML) -#define AE_AML_UNINITIALIZED_ARG (ACPI_STATUS) (0x0006 | AE_CODE_AML) -#define AE_AML_UNINITIALIZED_ELEMENT (ACPI_STATUS) (0x0007 | AE_CODE_AML) -#define AE_AML_NUMERIC_OVERFLOW (ACPI_STATUS) (0x0008 | AE_CODE_AML) -#define AE_AML_REGION_LIMIT (ACPI_STATUS) (0x0009 | AE_CODE_AML) -#define AE_AML_BUFFER_LIMIT (ACPI_STATUS) (0x000A | AE_CODE_AML) -#define AE_AML_PACKAGE_LIMIT (ACPI_STATUS) (0x000B | AE_CODE_AML) -#define AE_AML_DIVIDE_BY_ZERO (ACPI_STATUS) (0x000C | AE_CODE_AML) -#define AE_AML_BAD_NAME (ACPI_STATUS) (0x000D | AE_CODE_AML) -#define AE_AML_NAME_NOT_FOUND (ACPI_STATUS) (0x000E | AE_CODE_AML) -#define AE_AML_INTERNAL (ACPI_STATUS) (0x000F | AE_CODE_AML) -#define AE_AML_INVALID_SPACE_ID (ACPI_STATUS) (0x0010 | AE_CODE_AML) -#define AE_AML_STRING_LIMIT (ACPI_STATUS) (0x0011 | AE_CODE_AML) -#define AE_AML_NO_RETURN_VALUE (ACPI_STATUS) (0x0012 | AE_CODE_AML) -#define AE_AML_METHOD_LIMIT (ACPI_STATUS) (0x0013 | AE_CODE_AML) -#define AE_AML_NOT_OWNER (ACPI_STATUS) (0x0014 | AE_CODE_AML) -#define AE_AML_MUTEX_ORDER (ACPI_STATUS) (0x0015 | AE_CODE_AML) -#define AE_AML_MUTEX_NOT_ACQUIRED (ACPI_STATUS) (0x0016 | AE_CODE_AML) -#define AE_AML_INVALID_RESOURCE_TYPE (ACPI_STATUS) (0x0017 | AE_CODE_AML) -#define AE_AML_INVALID_INDEX (ACPI_STATUS) (0x0018 | AE_CODE_AML) -#define AE_AML_REGISTER_LIMIT (ACPI_STATUS) (0x0019 | AE_CODE_AML) -#define AE_AML_NO_WHILE (ACPI_STATUS) (0x001A | AE_CODE_AML) -#define AE_AML_ALIGNMENT (ACPI_STATUS) (0x001B | AE_CODE_AML) -#define AE_AML_NO_RESOURCE_END_TAG (ACPI_STATUS) (0x001C | AE_CODE_AML) -#define AE_AML_BAD_RESOURCE_VALUE (ACPI_STATUS) (0x001D | AE_CODE_AML) -#define AE_AML_CIRCULAR_REFERENCE (ACPI_STATUS) (0x001E | AE_CODE_AML) -#define AE_AML_BAD_RESOURCE_LENGTH (ACPI_STATUS) (0x001F | AE_CODE_AML) -#define AE_AML_ILLEGAL_ADDRESS (ACPI_STATUS) (0x0020 | AE_CODE_AML) -#define AE_AML_INFINITE_LOOP (ACPI_STATUS) (0x0021 | AE_CODE_AML) +#define AE_AML_BAD_OPCODE EXCEP_AML (0x0001) +#define AE_AML_NO_OPERAND EXCEP_AML (0x0002) +#define AE_AML_OPERAND_TYPE EXCEP_AML (0x0003) +#define AE_AML_OPERAND_VALUE EXCEP_AML (0x0004) +#define AE_AML_UNINITIALIZED_LOCAL EXCEP_AML (0x0005) +#define AE_AML_UNINITIALIZED_ARG EXCEP_AML (0x0006) +#define AE_AML_UNINITIALIZED_ELEMENT EXCEP_AML (0x0007) +#define AE_AML_NUMERIC_OVERFLOW EXCEP_AML (0x0008) +#define AE_AML_REGION_LIMIT EXCEP_AML (0x0009) +#define AE_AML_BUFFER_LIMIT EXCEP_AML (0x000A) +#define AE_AML_PACKAGE_LIMIT EXCEP_AML (0x000B) +#define AE_AML_DIVIDE_BY_ZERO EXCEP_AML (0x000C) +#define AE_AML_BAD_NAME EXCEP_AML (0x000D) +#define AE_AML_NAME_NOT_FOUND EXCEP_AML (0x000E) +#define AE_AML_INTERNAL EXCEP_AML (0x000F) +#define AE_AML_INVALID_SPACE_ID EXCEP_AML (0x0010) +#define AE_AML_STRING_LIMIT EXCEP_AML (0x0011) +#define AE_AML_NO_RETURN_VALUE EXCEP_AML (0x0012) +#define AE_AML_METHOD_LIMIT EXCEP_AML (0x0013) +#define AE_AML_NOT_OWNER EXCEP_AML (0x0014) +#define AE_AML_MUTEX_ORDER EXCEP_AML (0x0015) +#define AE_AML_MUTEX_NOT_ACQUIRED EXCEP_AML (0x0016) +#define AE_AML_INVALID_RESOURCE_TYPE EXCEP_AML (0x0017) +#define AE_AML_INVALID_INDEX EXCEP_AML (0x0018) +#define AE_AML_REGISTER_LIMIT EXCEP_AML (0x0019) +#define AE_AML_NO_WHILE EXCEP_AML (0x001A) +#define AE_AML_ALIGNMENT EXCEP_AML (0x001B) +#define AE_AML_NO_RESOURCE_END_TAG EXCEP_AML (0x001C) +#define AE_AML_BAD_RESOURCE_VALUE EXCEP_AML (0x001D) +#define AE_AML_CIRCULAR_REFERENCE EXCEP_AML (0x001E) +#define AE_AML_BAD_RESOURCE_LENGTH EXCEP_AML (0x001F) +#define AE_AML_ILLEGAL_ADDRESS EXCEP_AML (0x0020) +#define AE_AML_INFINITE_LOOP EXCEP_AML (0x0021) #define AE_CODE_AML_MAX 0x0021 @@ -240,143 +276,145 @@ /* * Internal exceptions used for control */ -#define AE_CTRL_RETURN_VALUE (ACPI_STATUS) (0x0001 | AE_CODE_CONTROL) -#define AE_CTRL_PENDING (ACPI_STATUS) (0x0002 | AE_CODE_CONTROL) -#define AE_CTRL_TERMINATE (ACPI_STATUS) (0x0003 | AE_CODE_CONTROL) -#define AE_CTRL_TRUE (ACPI_STATUS) (0x0004 | AE_CODE_CONTROL) -#define AE_CTRL_FALSE (ACPI_STATUS) (0x0005 | AE_CODE_CONTROL) -#define AE_CTRL_DEPTH (ACPI_STATUS) (0x0006 | AE_CODE_CONTROL) -#define AE_CTRL_END (ACPI_STATUS) (0x0007 | AE_CODE_CONTROL) -#define AE_CTRL_TRANSFER (ACPI_STATUS) (0x0008 | AE_CODE_CONTROL) -#define AE_CTRL_BREAK (ACPI_STATUS) (0x0009 | AE_CODE_CONTROL) -#define AE_CTRL_CONTINUE (ACPI_STATUS) (0x000A | AE_CODE_CONTROL) -#define AE_CTRL_SKIP (ACPI_STATUS) (0x000B | AE_CODE_CONTROL) -#define AE_CTRL_PARSE_CONTINUE (ACPI_STATUS) (0x000C | AE_CODE_CONTROL) -#define AE_CTRL_PARSE_PENDING (ACPI_STATUS) (0x000D | AE_CODE_CONTROL) +#define AE_CTRL_RETURN_VALUE EXCEP_CTL (0x0001) +#define AE_CTRL_PENDING EXCEP_CTL (0x0002) +#define AE_CTRL_TERMINATE EXCEP_CTL (0x0003) +#define AE_CTRL_TRUE EXCEP_CTL (0x0004) +#define AE_CTRL_FALSE EXCEP_CTL (0x0005) +#define AE_CTRL_DEPTH EXCEP_CTL (0x0006) +#define AE_CTRL_END EXCEP_CTL (0x0007) +#define AE_CTRL_TRANSFER EXCEP_CTL (0x0008) +#define AE_CTRL_BREAK EXCEP_CTL (0x0009) +#define AE_CTRL_CONTINUE EXCEP_CTL (0x000A) +#define AE_CTRL_SKIP EXCEP_CTL (0x000B) +#define AE_CTRL_PARSE_CONTINUE EXCEP_CTL (0x000C) +#define AE_CTRL_PARSE_PENDING EXCEP_CTL (0x000D) #define AE_CODE_CTRL_MAX 0x000D /* Exception strings for AcpiFormatException */ -#ifdef DEFINE_ACPI_GLOBALS +#ifdef ACPI_DEFINE_EXCEPTION_TABLE /* * String versions of the exception codes above * These strings must match the corresponding defines exactly */ -char const *AcpiGbl_ExceptionNames_Env[] = +static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Env[] = { - "AE_OK", - "AE_ERROR", - "AE_NO_ACPI_TABLES", - "AE_NO_NAMESPACE", - "AE_NO_MEMORY", - "AE_NOT_FOUND", - "AE_NOT_EXIST", - "AE_ALREADY_EXISTS", - "AE_TYPE", - "AE_NULL_OBJECT", - "AE_NULL_ENTRY", - "AE_BUFFER_OVERFLOW", - "AE_STACK_OVERFLOW", - "AE_STACK_UNDERFLOW", - "AE_NOT_IMPLEMENTED", - "AE_SUPPORT", - "AE_LIMIT", - "AE_TIME", - "AE_ACQUIRE_DEADLOCK", - "AE_RELEASE_DEADLOCK", - "AE_NOT_ACQUIRED", - "AE_ALREADY_ACQUIRED", - "AE_NO_HARDWARE_RESPONSE", - "AE_NO_GLOBAL_LOCK", - "AE_ABORT_METHOD", - "AE_SAME_HANDLER", - "AE_NO_HANDLER", - "AE_OWNER_ID_LIMIT" + EXCEP_TXT ("AE_OK", "No error"), + EXCEP_TXT ("AE_ERROR", "Unspecified error"), + EXCEP_TXT ("AE_NO_ACPI_TABLES", "ACPI tables could not be found"), + EXCEP_TXT ("AE_NO_NAMESPACE", "A namespace has not been loaded"), + EXCEP_TXT ("AE_NO_MEMORY", "Insufficient dynamic memory"), + EXCEP_TXT ("AE_NOT_FOUND", "A requested entity is not found"), + EXCEP_TXT ("AE_NOT_EXIST", "A required entity does not exist"), + EXCEP_TXT ("AE_ALREADY_EXISTS", "An entity already exists"), + EXCEP_TXT ("AE_TYPE", "The object type is incorrect"), + EXCEP_TXT ("AE_NULL_OBJECT", "A required object was missing"), + EXCEP_TXT ("AE_NULL_ENTRY", "The requested object does not exist"), + EXCEP_TXT ("AE_BUFFER_OVERFLOW", "The buffer provided is too small"), + EXCEP_TXT ("AE_STACK_OVERFLOW", "An internal stack overflowed"), + EXCEP_TXT ("AE_STACK_UNDERFLOW", "An internal stack underflowed"), + EXCEP_TXT ("AE_NOT_IMPLEMENTED", "The feature is not implemented"), + EXCEP_TXT ("AE_SUPPORT", "The feature is not supported"), + EXCEP_TXT ("AE_LIMIT", "A predefined limit was exceeded"), + EXCEP_TXT ("AE_TIME", "A time limit or timeout expired"), + EXCEP_TXT ("AE_ACQUIRE_DEADLOCK", "Internal error, attempt was made to acquire a mutex in improper order"), + EXCEP_TXT ("AE_RELEASE_DEADLOCK", "Internal error, attempt was made to release a mutex in improper order"), + EXCEP_TXT ("AE_NOT_ACQUIRED", "An attempt to release a mutex or Global Lock without a previous acquire"), + EXCEP_TXT ("AE_ALREADY_ACQUIRED", "Internal error, attempt was made to acquire a mutex twice"), + EXCEP_TXT ("AE_NO_HARDWARE_RESPONSE", "Hardware did not respond after an I/O operation"), + EXCEP_TXT ("AE_NO_GLOBAL_LOCK", "There is no FACS Global Lock"), + EXCEP_TXT ("AE_ABORT_METHOD", "A control method was aborted"), + EXCEP_TXT ("AE_SAME_HANDLER", "Attempt was made to install the same handler that is already installed"), + EXCEP_TXT ("AE_NO_HANDLER", "A handler for the operation is not installed"), + EXCEP_TXT ("AE_OWNER_ID_LIMIT", "There are no more Owner IDs available for ACPI tables or control methods"), + EXCEP_TXT ("AE_NOT_CONFIGURED", "The interface is not part of the current subsystem configuration"), + EXCEP_TXT ("AE_ACCESS", "Permission denied for the requested operation") }; -char const *AcpiGbl_ExceptionNames_Pgm[] = +static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Pgm[] = { - NULL, - "AE_BAD_PARAMETER", - "AE_BAD_CHARACTER", - "AE_BAD_PATHNAME", - "AE_BAD_DATA", - "AE_BAD_HEX_CONSTANT", - "AE_BAD_OCTAL_CONSTANT", - "AE_BAD_DECIMAL_CONSTANT", - "AE_MISSING_ARGUMENTS", - "AE_BAD_ADDRESS" + EXCEP_TXT (NULL, NULL), + EXCEP_TXT ("AE_BAD_PARAMETER", "A parameter is out of range or invalid"), + EXCEP_TXT ("AE_BAD_CHARACTER", "An invalid character was found in a name"), + EXCEP_TXT ("AE_BAD_PATHNAME", "An invalid character was found in a pathname"), + EXCEP_TXT ("AE_BAD_DATA", "A package or buffer contained incorrect data"), + EXCEP_TXT ("AE_BAD_HEX_CONSTANT", "Invalid character in a Hex constant"), + EXCEP_TXT ("AE_BAD_OCTAL_CONSTANT", "Invalid character in an Octal constant"), + EXCEP_TXT ("AE_BAD_DECIMAL_CONSTANT", "Invalid character in a Decimal constant"), + EXCEP_TXT ("AE_MISSING_ARGUMENTS", "Too few arguments were passed to a control method"), + EXCEP_TXT ("AE_BAD_ADDRESS", "An illegal null I/O address") }; -char const *AcpiGbl_ExceptionNames_Tbl[] = +static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Tbl[] = { - NULL, - "AE_BAD_SIGNATURE", - "AE_BAD_HEADER", - "AE_BAD_CHECKSUM", - "AE_BAD_VALUE", - "AE_INVALID_TABLE_LENGTH" + EXCEP_TXT (NULL, NULL), + EXCEP_TXT ("AE_BAD_SIGNATURE", "An ACPI table has an invalid signature"), + EXCEP_TXT ("AE_BAD_HEADER", "Invalid field in an ACPI table header"), + EXCEP_TXT ("AE_BAD_CHECKSUM", "An ACPI table checksum is not correct"), + EXCEP_TXT ("AE_BAD_VALUE", "An invalid value was found in a table"), + EXCEP_TXT ("AE_INVALID_TABLE_LENGTH", "The FADT or FACS has improper length") }; -char const *AcpiGbl_ExceptionNames_Aml[] = +static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Aml[] = { - NULL, - "AE_AML_BAD_OPCODE", - "AE_AML_NO_OPERAND", - "AE_AML_OPERAND_TYPE", - "AE_AML_OPERAND_VALUE", - "AE_AML_UNINITIALIZED_LOCAL", - "AE_AML_UNINITIALIZED_ARG", - "AE_AML_UNINITIALIZED_ELEMENT", - "AE_AML_NUMERIC_OVERFLOW", - "AE_AML_REGION_LIMIT", - "AE_AML_BUFFER_LIMIT", - "AE_AML_PACKAGE_LIMIT", - "AE_AML_DIVIDE_BY_ZERO", - "AE_AML_BAD_NAME", - "AE_AML_NAME_NOT_FOUND", - "AE_AML_INTERNAL", - "AE_AML_INVALID_SPACE_ID", - "AE_AML_STRING_LIMIT", - "AE_AML_NO_RETURN_VALUE", - "AE_AML_METHOD_LIMIT", - "AE_AML_NOT_OWNER", - "AE_AML_MUTEX_ORDER", - "AE_AML_MUTEX_NOT_ACQUIRED", - "AE_AML_INVALID_RESOURCE_TYPE", - "AE_AML_INVALID_INDEX", - "AE_AML_REGISTER_LIMIT", - "AE_AML_NO_WHILE", - "AE_AML_ALIGNMENT", - "AE_AML_NO_RESOURCE_END_TAG", - "AE_AML_BAD_RESOURCE_VALUE", - "AE_AML_CIRCULAR_REFERENCE", - "AE_AML_BAD_RESOURCE_LENGTH", - "AE_AML_ILLEGAL_ADDRESS", - "AE_AML_INFINITE_LOOP" + EXCEP_TXT (NULL, NULL), + EXCEP_TXT ("AE_AML_BAD_OPCODE", "Invalid AML opcode encountered"), + EXCEP_TXT ("AE_AML_NO_OPERAND", "A required operand is missing"), + EXCEP_TXT ("AE_AML_OPERAND_TYPE", "An operand of an incorrect type was encountered"), + EXCEP_TXT ("AE_AML_OPERAND_VALUE", "The operand had an inappropriate or invalid value"), + EXCEP_TXT ("AE_AML_UNINITIALIZED_LOCAL", "Method tried to use an uninitialized local variable"), + EXCEP_TXT ("AE_AML_UNINITIALIZED_ARG", "Method tried to use an uninitialized argument"), + EXCEP_TXT ("AE_AML_UNINITIALIZED_ELEMENT", "Method tried to use an empty package element"), + EXCEP_TXT ("AE_AML_NUMERIC_OVERFLOW", "Overflow during BCD conversion or other"), + EXCEP_TXT ("AE_AML_REGION_LIMIT", "Tried to access beyond the end of an Operation Region"), + EXCEP_TXT ("AE_AML_BUFFER_LIMIT", "Tried to access beyond the end of a buffer"), + EXCEP_TXT ("AE_AML_PACKAGE_LIMIT", "Tried to access beyond the end of a package"), + EXCEP_TXT ("AE_AML_DIVIDE_BY_ZERO", "During execution of AML Divide operator"), + EXCEP_TXT ("AE_AML_BAD_NAME", "An ACPI name contains invalid character(s)"), + EXCEP_TXT ("AE_AML_NAME_NOT_FOUND", "Could not resolve a named reference"), + EXCEP_TXT ("AE_AML_INTERNAL", "An internal error within the interprete"), + EXCEP_TXT ("AE_AML_INVALID_SPACE_ID", "An Operation Region SpaceID is invalid"), + EXCEP_TXT ("AE_AML_STRING_LIMIT", "String is longer than 200 characters"), + EXCEP_TXT ("AE_AML_NO_RETURN_VALUE", "A method did not return a required value"), + EXCEP_TXT ("AE_AML_METHOD_LIMIT", "A control method reached the maximum reentrancy limit of 255"), + EXCEP_TXT ("AE_AML_NOT_OWNER", "A thread tried to release a mutex that it does not own"), + EXCEP_TXT ("AE_AML_MUTEX_ORDER", "Mutex SyncLevel release mismatch"), + EXCEP_TXT ("AE_AML_MUTEX_NOT_ACQUIRED", "Attempt to release a mutex that was not previously acquired"), + EXCEP_TXT ("AE_AML_INVALID_RESOURCE_TYPE", "Invalid resource type in resource list"), + EXCEP_TXT ("AE_AML_INVALID_INDEX", "Invalid Argx or Localx (x too large)"), + EXCEP_TXT ("AE_AML_REGISTER_LIMIT", "Bank value or Index value beyond range of register"), + EXCEP_TXT ("AE_AML_NO_WHILE", "Break or Continue without a While"), + EXCEP_TXT ("AE_AML_ALIGNMENT", "Non-aligned memory transfer on platform that does not support this"), + EXCEP_TXT ("AE_AML_NO_RESOURCE_END_TAG", "No End Tag in a resource list"), + EXCEP_TXT ("AE_AML_BAD_RESOURCE_VALUE", "Invalid value of a resource element"), + EXCEP_TXT ("AE_AML_CIRCULAR_REFERENCE", "Two references refer to each other"), + EXCEP_TXT ("AE_AML_BAD_RESOURCE_LENGTH", "The length of a Resource Descriptor in the AML is incorrect"), + EXCEP_TXT ("AE_AML_ILLEGAL_ADDRESS", "A memory, I/O, or PCI configuration address is invalid"), + EXCEP_TXT ("AE_AML_INFINITE_LOOP", "An apparent infinite AML While loop, method was aborted") }; -char const *AcpiGbl_ExceptionNames_Ctrl[] = +static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Ctrl[] = { - NULL, - "AE_CTRL_RETURN_VALUE", - "AE_CTRL_PENDING", - "AE_CTRL_TERMINATE", - "AE_CTRL_TRUE", - "AE_CTRL_FALSE", - "AE_CTRL_DEPTH", - "AE_CTRL_END", - "AE_CTRL_TRANSFER", - "AE_CTRL_BREAK", - "AE_CTRL_CONTINUE", - "AE_CTRL_SKIP", - "AE_CTRL_PARSE_CONTINUE", - "AE_CTRL_PARSE_PENDING" + EXCEP_TXT (NULL, NULL), + EXCEP_TXT ("AE_CTRL_RETURN_VALUE", "A Method returned a value"), + EXCEP_TXT ("AE_CTRL_PENDING", "Method is calling another method"), + EXCEP_TXT ("AE_CTRL_TERMINATE", "Terminate the executing method"), + EXCEP_TXT ("AE_CTRL_TRUE", "An If or While predicate result"), + EXCEP_TXT ("AE_CTRL_FALSE", "An If or While predicate result"), + EXCEP_TXT ("AE_CTRL_DEPTH", "Maximum search depth has been reached"), + EXCEP_TXT ("AE_CTRL_END", "An If or While predicate is false"), + EXCEP_TXT ("AE_CTRL_TRANSFER", "Transfer control to called method"), + EXCEP_TXT ("AE_CTRL_BREAK", "A Break has been executed"), + EXCEP_TXT ("AE_CTRL_CONTINUE", "A Continue has been executed"), + EXCEP_TXT ("AE_CTRL_SKIP", "Not currently used"), + EXCEP_TXT ("AE_CTRL_PARSE_CONTINUE", "Used to skip over bad opcodes"), + EXCEP_TXT ("AE_CTRL_PARSE_PENDING", "Used to implement AML While loops") }; -#endif /* ACPI GLOBALS */ +#endif /* EXCEPTION_TABLE */ #endif /* __ACEXCEP_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acglobal.h b/reactos/drivers/bus/acpi/acpica/include/acglobal.h index 1d55d7e9863..a3ae36a3f11 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acglobal.h +++ b/reactos/drivers/bus/acpi/acpica/include/acglobal.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -124,11 +124,19 @@ * to simplify maintenance of the code. */ #ifdef DEFINE_ACPI_GLOBALS -#define ACPI_EXTERN -#define ACPI_INIT_GLOBAL(a,b) a=b +#define ACPI_GLOBAL(type,name) \ + extern type name; \ + type name + +#define ACPI_INIT_GLOBAL(type,name,value) \ + type name=value + #else -#define ACPI_EXTERN extern -#define ACPI_INIT_GLOBAL(a,b) a +#define ACPI_GLOBAL(type,name) \ + extern type name + +#define ACPI_INIT_GLOBAL(type,name,value) \ + extern type name #endif @@ -144,7 +152,7 @@ /* * Enable "slack" in the AML interpreter? Default is FALSE, and the - * interpreter strictly follows the ACPI specification. Setting to TRUE + * interpreter strictly follows the ACPI specification. Setting to TRUE * allows the interpreter to ignore certain errors and/or bad AML constructs. * * Currently, these features are enabled by this flag: @@ -156,33 +164,34 @@ * 5) Allow unresolved references (invalid target name) in package objects * 6) Enable warning messages for behavior that is not ACPI spec compliant */ -UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableInterpreterSlack, FALSE); +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableInterpreterSlack, FALSE); /* - * Automatically serialize ALL control methods? Default is FALSE, meaning - * to use the Serialized/NotSerialized method flags on a per method basis. - * Only change this if the ASL code is poorly written and cannot handle - * reentrancy even though methods are marked "NotSerialized". + * Automatically serialize all methods that create named objects? Default + * is TRUE, meaning that all NonSerialized methods are scanned once at + * table load time to determine those that create named objects. Methods + * that create named objects are marked Serialized in order to prevent + * possible run-time problems if they are entered by more than one thread. */ -UINT8 ACPI_INIT_GLOBAL (AcpiGbl_AllMethodsSerialized, FALSE); +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_AutoSerializeMethods, TRUE); /* * Create the predefined _OSI method in the namespace? Default is TRUE - * because ACPI CA is fully compatible with other ACPI implementations. - * Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior. + * because ACPICA is fully compatible with other ACPI implementations. + * Changing this will revert ACPICA (and machine ASL) to pre-OSI behavior. */ -UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CreateOsiMethod, TRUE); +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CreateOsiMethod, TRUE); /* * Optionally use default values for the ACPI register widths. Set this to * TRUE to use the defaults, if an FADT contains incorrect widths/lengths. */ -UINT8 ACPI_INIT_GLOBAL (AcpiGbl_UseDefaultRegisterWidths, TRUE); +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_UseDefaultRegisterWidths, TRUE); /* * Optionally enable output from the AML Debug Object. */ -UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableAmlDebugObject, FALSE); +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_EnableAmlDebugObject, FALSE); /* * Optionally copy the entire DSDT to local memory (instead of simply @@ -190,7 +199,25 @@ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableAmlDebugObject, FALSE); * DSDT, creating the need for this option. Default is FALSE, do not copy * the DSDT. */ -UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CopyDsdtLocally, FALSE); +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_CopyDsdtLocally, FALSE); + +/* + * Optionally ignore an XSDT if present and use the RSDT instead. + * Although the ACPI specification requires that an XSDT be used instead + * of the RSDT, the XSDT has been found to be corrupt or ill-formed on + * some machines. Default behavior is to use the XSDT if present. + */ +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE); + +/* + * Optionally use 32-bit FADT addresses if and when there is a conflict + * (address mismatch) between the 32-bit and 64-bit versions of the + * address. Although ACPICA adheres to the ACPI specification which + * requires the use of the corresponding 64-bit address if it is non-zero, + * some machines have been found to have a corrupted non-zero 64-bit + * address. Default is FALSE, do not favor the 32-bit addresses. + */ +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE); /* * Optionally truncate I/O addresses to 16 bits. Provides compatibility @@ -198,24 +225,28 @@ UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CopyDsdtLocally, FALSE); * this value is set to TRUE if any Windows OSI strings have been * requested by the BIOS. */ -UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE); +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_TruncateIoAddresses, FALSE); /* * Disable runtime checking and repair of values returned by control methods. * Use only if the repair is causing a problem on a particular machine. */ -UINT8 ACPI_INIT_GLOBAL (AcpiGbl_DisableAutoRepair, FALSE); +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE); +/* + * Optionally do not install any SSDTs from the RSDT/XSDT during initialization. + * This can be useful for debugging ACPI problems on some machines. + */ +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE); -/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */ +/* + * We keep track of the latest version of Windows that has been requested by + * the BIOS. + */ +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_OsiData, 0); -ACPI_TABLE_FADT AcpiGbl_FADT; -UINT32 AcpiCurrentGpeCount; -UINT32 AcpiGbl_TraceFlags; -ACPI_NAME AcpiGbl_TraceMethodName; -BOOLEAN AcpiGbl_SystemAwakeAndRunning; +#endif /* DEFINE_ACPI_GLOBALS */ -#endif /***************************************************************************** * @@ -224,38 +255,41 @@ BOOLEAN AcpiGbl_SystemAwakeAndRunning; ****************************************************************************/ /* - * AcpiGbl_RootTableList is the master list of ACPI tables that were - * found in the RSDT/XSDT. + * Master list of all ACPI tables that were found in the RSDT/XSDT. */ -ACPI_EXTERN ACPI_TABLE_LIST AcpiGbl_RootTableList; -ACPI_EXTERN ACPI_TABLE_FACS *AcpiGbl_FACS; - -/* These addresses are calculated from the FADT Event Block addresses */ - -ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aStatus; -ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aEnable; - -ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1bStatus; -ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1bEnable; +ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList); /* DSDT information. Used to check for DSDT corruption */ -ACPI_EXTERN ACPI_TABLE_HEADER *AcpiGbl_DSDT; -ACPI_EXTERN ACPI_TABLE_HEADER AcpiGbl_OriginalDsdtHeader; +ACPI_GLOBAL (ACPI_TABLE_HEADER *, AcpiGbl_DSDT); +ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader); + +#if (!ACPI_REDUCED_HARDWARE) +ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS); + +#endif /* !ACPI_REDUCED_HARDWARE */ + +/* These addresses are calculated from the FADT Event Block addresses */ + +ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aStatus); +ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aEnable); + +ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bStatus); +ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bEnable); /* - * Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is + * Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is * determined by the revision of the DSDT: If the DSDT revision is less than * 2, use only the lower 32 bits of the internal 64-bit Integer. */ -ACPI_EXTERN UINT8 AcpiGbl_IntegerBitWidth; -ACPI_EXTERN UINT8 AcpiGbl_IntegerByteWidth; -ACPI_EXTERN UINT8 AcpiGbl_IntegerNybbleWidth; +ACPI_GLOBAL (UINT8, AcpiGbl_IntegerBitWidth); +ACPI_GLOBAL (UINT8, AcpiGbl_IntegerByteWidth); +ACPI_GLOBAL (UINT8, AcpiGbl_IntegerNybbleWidth); /***************************************************************************** * - * Mutual exlusion within ACPICA subsystem + * Mutual exclusion within ACPICA subsystem * ****************************************************************************/ @@ -264,35 +298,36 @@ ACPI_EXTERN UINT8 AcpiGbl_IntegerNybbleWidth; * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. * (The table maps local handles to the real OS handles) */ -ACPI_EXTERN ACPI_MUTEX_INFO AcpiGbl_MutexInfo[ACPI_NUM_MUTEX]; +ACPI_GLOBAL (ACPI_MUTEX_INFO, AcpiGbl_MutexInfo[ACPI_NUM_MUTEX]); /* * Global lock mutex is an actual AML mutex object * Global lock semaphore works in conjunction with the actual global lock * Global lock spinlock is used for "pending" handshake */ -ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_GlobalLockMutex; -ACPI_EXTERN ACPI_SEMAPHORE AcpiGbl_GlobalLockSemaphore; -ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GlobalLockPendingLock; -ACPI_EXTERN UINT16 AcpiGbl_GlobalLockHandle; -ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockAcquired; -ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPresent; -ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPending; +ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_GlobalLockMutex); +ACPI_GLOBAL (ACPI_SEMAPHORE, AcpiGbl_GlobalLockSemaphore); +ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GlobalLockPendingLock); +ACPI_GLOBAL (UINT16, AcpiGbl_GlobalLockHandle); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockAcquired); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPresent); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPending); /* * Spinlocks are used for interfaces that can be possibly called at * interrupt level */ -ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GpeLock; /* For GPE data structs and registers */ -ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_HardwareLock; /* For ACPI H/W except GPE registers */ +ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GpeLock); /* For GPE data structs and registers */ +ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_HardwareLock); /* For ACPI H/W except GPE registers */ +ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_ReferenceCountLock); /* Mutex for _OSI support */ -ACPI_EXTERN ACPI_MUTEX AcpiGbl_OsiMutex; +ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_OsiMutex); /* Reader/Writer lock is used for namespace walk and dynamic table unload */ -ACPI_EXTERN ACPI_RW_LOCK AcpiGbl_NamespaceRwLock; +ACPI_GLOBAL (ACPI_RW_LOCK, AcpiGbl_NamespaceRwLock); /***************************************************************************** @@ -303,78 +338,69 @@ ACPI_EXTERN ACPI_RW_LOCK AcpiGbl_NamespaceRwLock; /* Object caches */ -ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_NamespaceCache; -ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_StateCache; -ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_PsNodeCache; -ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_PsNodeExtCache; -ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_OperandCache; +ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_NamespaceCache); +ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_StateCache); +ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeCache); +ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeExtCache); +ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_OperandCache); + +/* System */ + +ACPI_INIT_GLOBAL (UINT32, AcpiGbl_StartupFlags, 0); +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_Shutdown, TRUE); /* Global handlers */ -ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_DeviceNotify; -ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_SystemNotify; -ACPI_EXTERN ACPI_EXCEPTION_HANDLER AcpiGbl_ExceptionHandler; -ACPI_EXTERN ACPI_INIT_HANDLER AcpiGbl_InitHandler; -ACPI_EXTERN ACPI_TABLE_HANDLER AcpiGbl_TableHandler; -ACPI_EXTERN void *AcpiGbl_TableHandlerContext; -ACPI_EXTERN ACPI_WALK_STATE *AcpiGbl_BreakpointWalk; -ACPI_EXTERN ACPI_INTERFACE_HANDLER AcpiGbl_InterfaceHandler; +ACPI_GLOBAL (ACPI_GLOBAL_NOTIFY_HANDLER,AcpiGbl_GlobalNotify[2]); +ACPI_GLOBAL (ACPI_EXCEPTION_HANDLER, AcpiGbl_ExceptionHandler); +ACPI_GLOBAL (ACPI_INIT_HANDLER, AcpiGbl_InitHandler); +ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler); +ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext); +ACPI_GLOBAL (ACPI_WALK_STATE *, AcpiGbl_BreakpointWalk); +ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler); +ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList); /* Owner ID support */ -ACPI_EXTERN UINT32 AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS]; -ACPI_EXTERN UINT8 AcpiGbl_LastOwnerIdIndex; -ACPI_EXTERN UINT8 AcpiGbl_NextOwnerIdOffset; +ACPI_GLOBAL (UINT32, AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS]); +ACPI_GLOBAL (UINT8, AcpiGbl_LastOwnerIdIndex); +ACPI_GLOBAL (UINT8, AcpiGbl_NextOwnerIdOffset); /* Initialization sequencing */ -ACPI_EXTERN BOOLEAN AcpiGbl_RegMethodsExecuted; +ACPI_GLOBAL (BOOLEAN, AcpiGbl_RegMethodsExecuted); /* Misc */ -ACPI_EXTERN UINT32 AcpiGbl_OriginalMode; -ACPI_EXTERN UINT32 AcpiGbl_RsdpOriginalLocation; -ACPI_EXTERN UINT32 AcpiGbl_NsLookupCount; -ACPI_EXTERN UINT32 AcpiGbl_PsFindCount; -ACPI_EXTERN UINT16 AcpiGbl_Pm1EnableRegisterSave; -ACPI_EXTERN UINT8 AcpiGbl_DebuggerConfiguration; -ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall; -ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent; -ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized; -ACPI_EXTERN UINT8 AcpiGbl_OsiData; -ACPI_EXTERN ACPI_INTERFACE_INFO *AcpiGbl_SupportedInterfaces; +ACPI_GLOBAL (UINT32, AcpiGbl_OriginalMode); +ACPI_GLOBAL (UINT32, AcpiGbl_RsdpOriginalLocation); +ACPI_GLOBAL (UINT32, AcpiGbl_NsLookupCount); +ACPI_GLOBAL (UINT32, AcpiGbl_PsFindCount); +ACPI_GLOBAL (UINT16, AcpiGbl_Pm1EnableRegisterSave); +ACPI_GLOBAL (UINT8, AcpiGbl_DebuggerConfiguration); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_StepToNextCall); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_AcpiHardwarePresent); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_EventsInitialized); +ACPI_GLOBAL (ACPI_INTERFACE_INFO *, AcpiGbl_SupportedInterfaces); +ACPI_GLOBAL (ACPI_ADDRESS_RANGE *, AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX]); +/* Other miscellaneous, declared and initialized in utglobal */ -#ifndef DEFINE_ACPI_GLOBALS - -/* Exception codes */ - -extern char const *AcpiGbl_ExceptionNames_Env[]; -extern char const *AcpiGbl_ExceptionNames_Pgm[]; -extern char const *AcpiGbl_ExceptionNames_Tbl[]; -extern char const *AcpiGbl_ExceptionNames_Aml[]; -extern char const *AcpiGbl_ExceptionNames_Ctrl[]; - -/* Other miscellaneous */ - -extern BOOLEAN AcpiGbl_Shutdown; -extern UINT32 AcpiGbl_StartupFlags; extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT]; extern const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS]; extern const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS]; -extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES]; extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS]; -#endif +extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES]; #ifdef ACPI_DBG_TRACK_ALLOCATIONS -/* Lists for tracking memory allocations */ +/* Lists for tracking memory allocations (debug only) */ -ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_GlobalList; -ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_NsNodeList; -ACPI_EXTERN BOOLEAN AcpiGbl_DisplayFinalMemStats; -ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking; +ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_GlobalList); +ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_NsNodeList); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisplayFinalMemStats); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisableMemTracking); #endif @@ -390,22 +416,23 @@ ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking; #define NUM_PREDEFINED_NAMES 9 #endif -ACPI_EXTERN ACPI_NAMESPACE_NODE AcpiGbl_RootNodeStruct; -ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_RootNode; -ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_FadtGpeDevice; -ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_ModuleCodeList; +ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct); +ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode); +ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_FadtGpeDevice); +ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_ModuleCodeList); extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES]; extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES]; #ifdef ACPI_DEBUG_OUTPUT -ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeCount; -ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeSize; -ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentNodeCount; -ACPI_EXTERN ACPI_SIZE *AcpiGbl_EntryStackPointer; -ACPI_EXTERN ACPI_SIZE *AcpiGbl_LowestStackPointer; -ACPI_EXTERN UINT32 AcpiGbl_DeepestNesting; +ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeCount); +ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeSize); +ACPI_GLOBAL (UINT32, AcpiGbl_MaxConcurrentNodeCount); +ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer); +ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_LowestStackPointer); +ACPI_GLOBAL (UINT32, AcpiGbl_DeepestNesting); +ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0); #endif @@ -415,12 +442,11 @@ ACPI_EXTERN UINT32 AcpiGbl_DeepestNesting; * ****************************************************************************/ - -ACPI_EXTERN ACPI_THREAD_STATE *AcpiGbl_CurrentWalkList; +ACPI_GLOBAL (ACPI_THREAD_STATE *, AcpiGbl_CurrentWalkList); /* Control method single step flag */ -ACPI_EXTERN UINT8 AcpiGbl_CmSingleStep; +ACPI_GLOBAL (UINT8, AcpiGbl_CmSingleStep); /***************************************************************************** @@ -429,9 +455,10 @@ ACPI_EXTERN UINT8 AcpiGbl_CmSingleStep; * ****************************************************************************/ -extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG]; -ACPI_EXTERN UINT8 AcpiGbl_SleepTypeA; -ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB; +extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG]; + +ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeA); +ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeB); /***************************************************************************** @@ -440,14 +467,18 @@ ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB; * ****************************************************************************/ -ACPI_EXTERN UINT8 AcpiGbl_AllGpesInitialized; -ACPI_EXTERN ACPI_GPE_XRUPT_INFO *AcpiGbl_GpeXruptListHead; -ACPI_EXTERN ACPI_GPE_BLOCK_INFO *AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]; -ACPI_EXTERN ACPI_GBL_EVENT_HANDLER AcpiGbl_GlobalEventHandler; -ACPI_EXTERN void *AcpiGbl_GlobalEventHandlerContext; -ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]; -extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS]; +#if (!ACPI_REDUCED_HARDWARE) +ACPI_GLOBAL (UINT8, AcpiGbl_AllGpesInitialized); +ACPI_GLOBAL (ACPI_GPE_XRUPT_INFO *, AcpiGbl_GpeXruptListHead); +ACPI_GLOBAL (ACPI_GPE_BLOCK_INFO *, AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]); +ACPI_GLOBAL (ACPI_GBL_EVENT_HANDLER, AcpiGbl_GlobalEventHandler); +ACPI_GLOBAL (void *, AcpiGbl_GlobalEventHandlerContext); +ACPI_GLOBAL (ACPI_FIXED_EVENT_HANDLER, AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]); + +extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS]; + +#endif /* !ACPI_REDUCED_HARDWARE */ /***************************************************************************** * @@ -455,82 +486,110 @@ extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EV * ****************************************************************************/ -/* Procedure nesting level for debug output */ - -extern UINT32 AcpiGbl_NestingLevel; - /* Event counters */ -ACPI_EXTERN UINT32 AcpiMethodCount; -ACPI_EXTERN UINT32 AcpiGpeCount; -ACPI_EXTERN UINT32 AcpiSciCount; -ACPI_EXTERN UINT32 AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]; +ACPI_GLOBAL (UINT32, AcpiMethodCount); +ACPI_GLOBAL (UINT32, AcpiGpeCount); +ACPI_GLOBAL (UINT32, AcpiSciCount); +ACPI_GLOBAL (UINT32, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]); /* Support for dynamic control method tracing mechanism */ -ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLevel; -ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLayer; -ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLevel; -ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLayer; +ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLevel); +ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLayer); +ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLevel); +ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLayer); /***************************************************************************** * - * Debugger globals + * Debugger and Disassembler globals * ****************************************************************************/ -ACPI_EXTERN UINT8 AcpiGbl_DbOutputFlags; +ACPI_GLOBAL (UINT8, AcpiGbl_DbOutputFlags); #ifdef ACPI_DISASSEMBLER -ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_disasm; -ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_verbose; -ACPI_EXTERN ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList; -ACPI_EXTERN ACPI_EXTERNAL_FILE *AcpiGbl_ExternalFileList; -#endif +/* Do not disassemble buffers to resource descriptors */ +ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE); +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE); + +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_disasm); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_verbose); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods); +ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods); +ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList); +ACPI_GLOBAL (ACPI_EXTERNAL_FILE *, AcpiGbl_ExternalFileList); +#endif #ifdef ACPI_DEBUGGER -extern BOOLEAN AcpiGbl_MethodExecuting; -extern BOOLEAN AcpiGbl_AbortMethod; -extern BOOLEAN AcpiGbl_DbTerminateThreads; +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateThreads, FALSE); +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE); +ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE); -ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_tables; -ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_stats; -ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_ini_methods; -ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_NoRegionSupport; +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_tables); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_stats); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_ini_methods); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport); +ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile); +ACPI_GLOBAL (char *, AcpiGbl_DbBuffer); +ACPI_GLOBAL (char *, AcpiGbl_DbFilename); +ACPI_GLOBAL (UINT32, AcpiGbl_DbDebugLevel); +ACPI_GLOBAL (UINT32, AcpiGbl_DbConsoleDebugLevel); +ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_DbScopeNode); -ACPI_EXTERN char *AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]; -ACPI_EXTERN ACPI_OBJECT_TYPE AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]; -ACPI_EXTERN char AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE]; -ACPI_EXTERN char AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE]; -ACPI_EXTERN char AcpiGbl_DbScopeBuf[80]; -ACPI_EXTERN char AcpiGbl_DbDebugFilename[80]; -ACPI_EXTERN BOOLEAN AcpiGbl_DbOutputToFile; -ACPI_EXTERN char *AcpiGbl_DbBuffer; -ACPI_EXTERN char *AcpiGbl_DbFilename; -ACPI_EXTERN UINT32 AcpiGbl_DbDebugLevel; -ACPI_EXTERN UINT32 AcpiGbl_DbConsoleDebugLevel; -ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_DbScopeNode; +ACPI_GLOBAL (char *, AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]); +ACPI_GLOBAL (ACPI_OBJECT_TYPE, AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]); + +/* These buffers should all be the same size */ + +ACPI_GLOBAL (char, AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE]); +ACPI_GLOBAL (char, AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE]); +ACPI_GLOBAL (char, AcpiGbl_DbScopeBuf[ACPI_DB_LINE_BUFFER_SIZE]); +ACPI_GLOBAL (char, AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUFFER_SIZE]); /* * Statistic globals */ -ACPI_EXTERN UINT16 AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1]; -ACPI_EXTERN UINT16 AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1]; -ACPI_EXTERN UINT16 AcpiGbl_ObjTypeCountMisc; -ACPI_EXTERN UINT16 AcpiGbl_NodeTypeCountMisc; -ACPI_EXTERN UINT32 AcpiGbl_NumNodes; -ACPI_EXTERN UINT32 AcpiGbl_NumObjects; +ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1]); +ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1]); +ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCountMisc); +ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc); +ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes); +ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects); - -ACPI_EXTERN UINT32 AcpiGbl_SizeOfParseTree; -ACPI_EXTERN UINT32 AcpiGbl_SizeOfMethodTrees; -ACPI_EXTERN UINT32 AcpiGbl_SizeOfNodeEntries; -ACPI_EXTERN UINT32 AcpiGbl_SizeOfAcpiObjects; +ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfParseTree); +ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfMethodTrees); +ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfNodeEntries); +ACPI_GLOBAL (UINT32, AcpiGbl_SizeOfAcpiObjects); #endif /* ACPI_DEBUGGER */ + +/***************************************************************************** + * + * Application globals + * + ****************************************************************************/ + +#ifdef ACPI_APPLICATION + +ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_DebugFile, NULL); + +#endif /* ACPI_APPLICATION */ + + +/***************************************************************************** + * + * Info/help support + * + ****************************************************************************/ + +extern const AH_PREDEFINED_NAME AslPredefinedInfo[]; +extern const AH_DEVICE_ID AslDeviceIds[]; + + #endif /* __ACGLOBAL_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/achware.h b/reactos/drivers/bus/acpi/acpica/include/achware.h index 32b9a0110a9..ed39a36e252 100644 --- a/reactos/drivers/bus/acpi/acpica/include/achware.h +++ b/reactos/drivers/bus/acpi/acpica/include/achware.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -181,6 +181,43 @@ AcpiHwClearAcpiStatus ( void); +/* + * hwsleep - sleep/wake support (Legacy sleep registers) + */ +ACPI_STATUS +AcpiHwLegacySleep ( + UINT8 SleepState); + +ACPI_STATUS +AcpiHwLegacyWakePrep ( + UINT8 SleepState); + +ACPI_STATUS +AcpiHwLegacyWake ( + UINT8 SleepState); + + +/* + * hwesleep - sleep/wake support (Extended FADT-V5 sleep registers) + */ +void +AcpiHwExecuteSleepMethod ( + char *MethodName, + UINT32 IntegerArgument); + +ACPI_STATUS +AcpiHwExtendedSleep ( + UINT8 SleepState); + +ACPI_STATUS +AcpiHwExtendedWakePrep ( + UINT8 SleepState); + +ACPI_STATUS +AcpiHwExtendedWake ( + UINT8 SleepState); + + /* * hwvalid - Port I/O with validation */ @@ -202,8 +239,7 @@ AcpiHwWritePort ( */ UINT32 AcpiHwGetGpeRegisterBit ( - ACPI_GPE_EVENT_INFO *GpeEventInfo, - ACPI_GPE_REGISTER_INFO *GpeRegisterInfo); + ACPI_GPE_EVENT_INFO *GpeEventInfo); ACPI_STATUS AcpiHwLowSetGpe ( @@ -260,22 +296,4 @@ AcpiHwDerivePciId ( ACPI_HANDLE PciRegion); -/* - * hwtimer - ACPI Timer prototypes - */ -ACPI_STATUS -AcpiGetTimerResolution ( - UINT32 *Resolution); - -ACPI_STATUS -AcpiGetTimer ( - UINT32 *Ticks); - -ACPI_STATUS -AcpiGetTimerDuration ( - UINT32 StartTicks, - UINT32 EndTicks, - UINT32 *TimeElapsed); - - #endif /* __ACHWARE_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acinterp.h b/reactos/drivers/bus/acpi/acpica/include/acinterp.h index 8cb1e3b1d01..739a0de40c1 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acinterp.h +++ b/reactos/drivers/bus/acpi/acpica/include/acinterp.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -161,6 +161,10 @@ typedef const struct acpi_exdump_info #define ACPI_EXD_PACKAGE 11 #define ACPI_EXD_FIELD 12 #define ACPI_EXD_REFERENCE 13 +#define ACPI_EXD_LIST 14 /* Operand object list */ +#define ACPI_EXD_HDLR_LIST 15 /* Address Handler list */ +#define ACPI_EXD_RGN_LIST 16 /* Region list */ +#define ACPI_EXD_NODE 17 /* Namespace Node */ /* restore default alignment */ @@ -684,15 +688,7 @@ void AcpiExExitInterpreter ( void); -void -AcpiExReacquireInterpreter ( - void); - -void -AcpiExRelinquishInterpreter ( - void); - -void +BOOLEAN AcpiExTruncateFor32bitTable ( ACPI_OPERAND_OBJECT *ObjDesc); @@ -714,6 +710,10 @@ AcpiExIntegerToString ( char *Dest, UINT64 Value); +BOOLEAN +AcpiIsValidSpaceId ( + UINT8 SpaceId); + /* * exregion - default OpRegion handlers diff --git a/reactos/drivers/bus/acpi/acpica/include/aclocal.h b/reactos/drivers/bus/acpi/acpica/include/aclocal.h index b1b1d05a9e4..147d0fb5a25 100644 --- a/reactos/drivers/bus/acpi/acpica/include/aclocal.h +++ b/reactos/drivers/bus/acpi/acpica/include/aclocal.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -126,7 +126,7 @@ typedef UINT32 ACPI_MUTEX_HANDLE; /* Total number of aml opcodes defined */ -#define AML_NUM_OPCODES 0x7F +#define AML_NUM_OPCODES 0x81 /* Forward declarations */ @@ -357,12 +357,16 @@ typedef struct acpi_create_field_info ACPI_NAMESPACE_NODE *FieldNode; ACPI_NAMESPACE_NODE *RegisterNode; ACPI_NAMESPACE_NODE *DataRegisterNode; + ACPI_NAMESPACE_NODE *ConnectionNode; + UINT8 *ResourceBuffer; UINT32 BankValue; UINT32 FieldBitPosition; UINT32 FieldBitLength; + UINT16 ResourceLength; UINT8 FieldFlags; UINT8 Attribute; UINT8 FieldType; + UINT8 AccessLength; } ACPI_CREATE_FIELD_INFO; @@ -373,7 +377,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( /* - * Bitmapped ACPI types. Used internally only + * Bitmapped ACPI types. Used internally only */ #define ACPI_BTYPE_ANY 0x00000000 #define ACPI_BTYPE_INTEGER 0x00000001 @@ -403,6 +407,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( #define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */ #define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF +#pragma pack(1) /* * Information structure for ACPI predefined names. @@ -415,7 +420,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) ( typedef struct acpi_name_info { char Name[ACPI_NAME_SIZE]; - UINT8 ParamCount; + UINT16 ArgumentList; UINT8 ExpectedBtypes; } ACPI_NAME_INFO; @@ -430,7 +435,8 @@ typedef struct acpi_name_info /* * Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2, - * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT + * ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT, + * ACPI_PTYPE2_FIX_VAR */ typedef struct acpi_package_info { @@ -439,7 +445,7 @@ typedef struct acpi_package_info UINT8 Count1; UINT8 ObjectType2; UINT8 Count2; - UINT8 Reserved; + UINT16 Reserved; } ACPI_PACKAGE_INFO; @@ -450,6 +456,7 @@ typedef struct acpi_package_info2 UINT8 Type; UINT8 Count; UINT8 ObjectType[4]; + UINT8 Reserved; } ACPI_PACKAGE_INFO2; @@ -461,7 +468,7 @@ typedef struct acpi_package_info3 UINT8 Count; UINT8 ObjectType[2]; UINT8 TailObjectType; - UINT8 Reserved; + UINT16 Reserved; } ACPI_PACKAGE_INFO3; @@ -474,23 +481,25 @@ typedef union acpi_predefined_info } ACPI_PREDEFINED_INFO; +/* Reset to default packing */ -/* Data block used during object validation */ +#pragma pack() -typedef struct acpi_predefined_data + +/* Return object auto-repair info */ + +typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) ( + union acpi_operand_object *OriginalObject, + union acpi_operand_object **ConvertedObject); + +typedef struct acpi_simple_repair_info { - char *Pathname; - const ACPI_PREDEFINED_INFO *Predefined; - union acpi_operand_object *ParentPackage; - ACPI_NAMESPACE_NODE *Node; - UINT32 Flags; - UINT8 NodeFlags; + char Name[ACPI_NAME_SIZE]; + UINT32 UnexpectedBtypes; + UINT32 PackageIndex; + ACPI_OBJECT_CONVERTER ObjectConverter; -} ACPI_PREDEFINED_DATA; - -/* Defines for Flags field above */ - -#define ACPI_OBJECT_REPAIRED 1 +} ACPI_SIMPLE_REPAIR_INFO; /* @@ -516,6 +525,16 @@ typedef struct acpi_predefined_data * ****************************************************************************/ +/* Dispatch info for each host-installed SCI handler */ + +typedef struct acpi_sci_handler_info +{ + struct acpi_sci_handler_info *Next; + ACPI_SCI_HANDLER Address; /* Address of handler */ + void *Context; /* Context to be passed to handler */ + +} ACPI_SCI_HANDLER_INFO; + /* Dispatch info for each GPE -- either a method or handler, cannot be both */ typedef struct acpi_gpe_handler_info @@ -528,6 +547,15 @@ typedef struct acpi_gpe_handler_info } ACPI_GPE_HANDLER_INFO; +/* Notify info for implicit notify, multiple device objects */ + +typedef struct acpi_gpe_notify_info +{ + ACPI_NAMESPACE_NODE *DeviceNode; /* Device to be notified */ + struct acpi_gpe_notify_info *Next; + +} ACPI_GPE_NOTIFY_INFO; + /* * GPE dispatch info. At any time, the GPE can have at most one type * of dispatch - Method, Handler, or Implicit Notify. @@ -535,8 +563,8 @@ typedef struct acpi_gpe_handler_info typedef union acpi_gpe_dispatch_info { ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */ - struct acpi_gpe_handler_info *Handler; /* Installed GPE handler */ - ACPI_NAMESPACE_NODE *DeviceNode; /* Parent _PRW device for implicit notify */ + ACPI_GPE_HANDLER_INFO *Handler; /* Installed GPE handler */ + ACPI_GPE_NOTIFY_INFO *NotifyList; /* List of _PRW devices for implicit notifies */ } ACPI_GPE_DISPATCH_INFO; @@ -546,7 +574,7 @@ typedef union acpi_gpe_dispatch_info */ typedef struct acpi_gpe_event_info { - union acpi_gpe_dispatch_info Dispatch; /* Either Method or Handler */ + union acpi_gpe_dispatch_info Dispatch; /* Either Method, Handler, or NotifyList */ struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */ UINT8 Flags; /* Misc info about this GPE */ UINT8 GpeNumber; /* This GPE */ @@ -746,7 +774,7 @@ typedef struct acpi_pscope_state /* - * Thread state - one per thread across multiple walk states. Multiple walk + * Thread state - one per thread across multiple walk states. Multiple walk * states are created when there are nested control methods executing. */ typedef struct acpi_thread_state @@ -782,6 +810,15 @@ ACPI_STATUS (*ACPI_PARSE_UPWARDS) ( struct acpi_walk_state *WalkState); +/* Global handlers for AML Notifies */ + +typedef struct acpi_global_notify_handler +{ + ACPI_NOTIFY_HANDLER Handler; + void *Context; + +} ACPI_GLOBAL_NOTIFY_HANDLER; + /* * Notify info - used to pass info to the deferred notify * handler/dispatcher. @@ -789,8 +826,10 @@ ACPI_STATUS (*ACPI_PARSE_UPWARDS) ( typedef struct acpi_notify_info { ACPI_STATE_COMMON + UINT8 HandlerListId; ACPI_NAMESPACE_NODE *Node; - union acpi_operand_object *HandlerObj; + union acpi_operand_object *HandlerListHead; + ACPI_GLOBAL_NOTIFY_HANDLER *Global; } ACPI_NOTIFY_INFO; @@ -822,6 +861,17 @@ typedef ACPI_STATUS (*ACPI_EXECUTE_OP) ( struct acpi_walk_state *WalkState); +/* Address Range info block */ + +typedef struct acpi_address_range +{ + struct acpi_address_range *Next; + ACPI_NAMESPACE_NODE *RegionNode; + ACPI_PHYSICAL_ADDRESS StartAddress; + ACPI_PHYSICAL_ADDRESS EndAddress; + +} ACPI_ADDRESS_RANGE; + /***************************************************************************** * @@ -892,15 +942,19 @@ typedef union acpi_parse_value char AmlOpName[16]) /* Op name (debug only) */ -#define ACPI_DASM_BUFFER 0x00 -#define ACPI_DASM_RESOURCE 0x01 -#define ACPI_DASM_STRING 0x02 -#define ACPI_DASM_UNICODE 0x03 -#define ACPI_DASM_EISAID 0x04 -#define ACPI_DASM_MATCHOP 0x05 -#define ACPI_DASM_LNOT_PREFIX 0x06 -#define ACPI_DASM_LNOT_SUFFIX 0x07 -#define ACPI_DASM_IGNORE 0x08 +/* Flags for DisasmFlags field above */ + +#define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */ +#define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */ +#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */ +#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */ +#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */ +#define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */ +#define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */ +#define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a LNotEqual (etc.) pair of opcodes */ +#define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a LNotEqual (etc.) pair of opcodes */ +#define ACPI_DASM_HID_STRING 0x09 /* String is a _HID or _CID */ +#define ACPI_DASM_IGNORE 0x0A /* Not used at this time */ /* * Generic operation (for example: If, While, Store) @@ -1004,6 +1058,7 @@ typedef struct acpi_parse_state #define ACPI_PARSEOP_IGNORE 0x01 #define ACPI_PARSEOP_PARAMLIST 0x02 #define ACPI_PARSEOP_EMPTY_TERMLIST 0x04 +#define ACPI_PARSEOP_PREDEF_CHECKED 0x08 #define ACPI_PARSEOP_SPECIAL 0x10 @@ -1128,18 +1183,6 @@ typedef struct acpi_bit_register_info /* Structs and definitions for _OSI support and I/O port validation */ -#define ACPI_OSI_WIN_2000 0x01 -#define ACPI_OSI_WIN_XP 0x02 -#define ACPI_OSI_WIN_XP_SP1 0x03 -#define ACPI_OSI_WINSRV_2003 0x04 -#define ACPI_OSI_WIN_XP_SP2 0x05 -#define ACPI_OSI_WINSRV_2003_SP1 0x06 -#define ACPI_OSI_WIN_VISTA 0x07 -#define ACPI_OSI_WINSRV_2008 0x08 -#define ACPI_OSI_WIN_VISTA_SP1 0x09 -#define ACPI_OSI_WIN_VISTA_SP2 0x0A -#define ACPI_OSI_WIN_7 0x0B - #define ACPI_ALWAYS_ILLEGAL 0x00 typedef struct acpi_interface_info @@ -1153,6 +1196,9 @@ typedef struct acpi_interface_info #define ACPI_OSI_INVALID 0x01 #define ACPI_OSI_DYNAMIC 0x02 +#define ACPI_OSI_FEATURE 0x04 +#define ACPI_OSI_DEFAULT_INVALID 0x08 +#define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID) typedef struct acpi_port_info { @@ -1196,7 +1242,7 @@ typedef struct acpi_port_info #define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38 #define ACPI_RESOURCE_NAME_IO 0x40 #define ACPI_RESOURCE_NAME_FIXED_IO 0x48 -#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50 +#define ACPI_RESOURCE_NAME_FIXED_DMA 0x50 #define ACPI_RESOURCE_NAME_RESERVED_S2 0x58 #define ACPI_RESOURCE_NAME_RESERVED_S3 0x60 #define ACPI_RESOURCE_NAME_RESERVED_S4 0x68 @@ -1218,7 +1264,9 @@ typedef struct acpi_port_info #define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89 #define ACPI_RESOURCE_NAME_ADDRESS64 0x8A #define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B -#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B +#define ACPI_RESOURCE_NAME_GPIO 0x8C +#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E +#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E /***************************************************************************** @@ -1243,14 +1291,17 @@ typedef struct acpi_external_list struct acpi_external_list *Next; UINT32 Value; UINT16 Length; + UINT16 Flags; UINT8 Type; - UINT8 Flags; } ACPI_EXTERNAL_LIST; /* Values for Flags field above */ -#define ACPI_IPATH_ALLOCATED 0x01 +#define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */ +#define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */ +#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */ +#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */ typedef struct acpi_external_file @@ -1269,6 +1320,7 @@ typedef struct acpi_external_file typedef struct acpi_db_method_info { + ACPI_HANDLE Method; ACPI_HANDLE MainThreadGate; ACPI_HANDLE ThreadCompleteGate; ACPI_HANDLE InfoGate; @@ -1280,7 +1332,7 @@ typedef struct acpi_db_method_info char *Name; UINT32 Flags; UINT32 NumLoops; - char Pathname[128]; + char Pathname[ACPI_DB_LINE_BUFFER_SIZE]; char **Args; ACPI_OBJECT_TYPE *Types; @@ -1307,6 +1359,7 @@ typedef struct acpi_integrity_info } ACPI_INTEGRITY_INFO; +#define ACPI_DB_DISABLE_OUTPUT 0x00 #define ACPI_DB_REDIRECTABLE_OUTPUT 0x01 #define ACPI_DB_CONSOLE_OUTPUT 0x02 #define ACPI_DB_DUPLICATE_OUTPUT 0x03 @@ -1353,4 +1406,27 @@ typedef struct acpi_debug_mem_block #define ACPI_NUM_MEM_LISTS 2 +/***************************************************************************** + * + * Info/help support + * + ****************************************************************************/ + +typedef struct ah_predefined_name +{ + char *Name; + char *Description; +#ifndef ACPI_ASL_COMPILER + char *Action; +#endif + +} AH_PREDEFINED_NAME; + +typedef struct ah_device_id +{ + char *Name; + char *Description; + +} AH_DEVICE_ID; + #endif /* __ACLOCAL_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acmacros.h b/reactos/drivers/bus/acpi/acpica/include/acmacros.h index 5cc284efdf2..aa8bd563c63 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acmacros.h +++ b/reactos/drivers/bus/acpi/acpica/include/acmacros.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -122,27 +122,35 @@ * get into potential aligment issues -- see the STORE macros below. * Use with care. */ -#define ACPI_GET8(ptr) *ACPI_CAST_PTR (UINT8, ptr) -#define ACPI_GET16(ptr) *ACPI_CAST_PTR (UINT16, ptr) -#define ACPI_GET32(ptr) *ACPI_CAST_PTR (UINT32, ptr) -#define ACPI_GET64(ptr) *ACPI_CAST_PTR (UINT64, ptr) -#define ACPI_SET8(ptr) *ACPI_CAST_PTR (UINT8, ptr) -#define ACPI_SET16(ptr) *ACPI_CAST_PTR (UINT16, ptr) -#define ACPI_SET32(ptr) *ACPI_CAST_PTR (UINT32, ptr) -#define ACPI_SET64(ptr) *ACPI_CAST_PTR (UINT64, ptr) +#define ACPI_CAST8(ptr) ACPI_CAST_PTR (UINT8, (ptr)) +#define ACPI_CAST16(ptr) ACPI_CAST_PTR (UINT16, (ptr)) +#define ACPI_CAST32(ptr) ACPI_CAST_PTR (UINT32, (ptr)) +#define ACPI_CAST64(ptr) ACPI_CAST_PTR (UINT64, (ptr)) +#define ACPI_GET8(ptr) (*ACPI_CAST8 (ptr)) +#define ACPI_GET16(ptr) (*ACPI_CAST16 (ptr)) +#define ACPI_GET32(ptr) (*ACPI_CAST32 (ptr)) +#define ACPI_GET64(ptr) (*ACPI_CAST64 (ptr)) +#define ACPI_SET8(ptr, val) (*ACPI_CAST8 (ptr) = (UINT8) (val)) +#define ACPI_SET16(ptr, val) (*ACPI_CAST16 (ptr) = (UINT16) (val)) +#define ACPI_SET32(ptr, val) (*ACPI_CAST32 (ptr) = (UINT32) (val)) +#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (UINT64) (val)) /* - * printf() format helpers + * printf() format helpers. These macros are workarounds for the difficulties + * with emitting 64-bit integers and 64-bit pointers with the same code + * for both 32-bit and 64-bit hosts. */ - -/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ - #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) #if ACPI_MACHINE_WIDTH == 64 #define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i) +#define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i) +#define ACPI_PRINTF_UINT "0x%8.8X%8.8X" + #else -#define ACPI_FORMAT_NATIVE_UINT(i) 0, (i) +#define ACPI_FORMAT_NATIVE_UINT(i) 0, (UINT32) (i) +#define ACPI_FORMAT_TO_UINT(i) (UINT32) (i) +#define ACPI_PRINTF_UINT "0x%8.8X" #endif @@ -340,20 +348,65 @@ /* Bitfields within ACPI registers */ -#define ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) ((Val << Pos) & Mask) -#define ACPI_REGISTER_INSERT_VALUE(Reg, Pos, Mask, Val) Reg = (Reg & (~(Mask))) | ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) +#define ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) \ + ((Val << Pos) & Mask) -#define ACPI_INSERT_BITS(Target, Mask, Source) Target = ((Target & (~(Mask))) | (Source & Mask)) +#define ACPI_REGISTER_INSERT_VALUE(Reg, Pos, Mask, Val) \ + Reg = (Reg & (~(Mask))) | ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) + +#define ACPI_INSERT_BITS(Target, Mask, Source) \ + Target = ((Target & (~(Mask))) | (Source & Mask)) + +/* Generic bitfield macros and masks */ + +#define ACPI_GET_BITS(SourcePtr, Position, Mask) \ + ((*SourcePtr >> Position) & Mask) + +#define ACPI_SET_BITS(TargetPtr, Position, Mask, Value) \ + (*TargetPtr |= ((Value & Mask) << Position)) + +#define ACPI_1BIT_MASK 0x00000001 +#define ACPI_2BIT_MASK 0x00000003 +#define ACPI_3BIT_MASK 0x00000007 +#define ACPI_4BIT_MASK 0x0000000F +#define ACPI_5BIT_MASK 0x0000001F +#define ACPI_6BIT_MASK 0x0000003F +#define ACPI_7BIT_MASK 0x0000007F +#define ACPI_8BIT_MASK 0x000000FF +#define ACPI_16BIT_MASK 0x0000FFFF +#define ACPI_24BIT_MASK 0x00FFFFFF + +/* Macros to extract flag bits from position zero */ + +#define ACPI_GET_1BIT_FLAG(Value) ((Value) & ACPI_1BIT_MASK) +#define ACPI_GET_2BIT_FLAG(Value) ((Value) & ACPI_2BIT_MASK) +#define ACPI_GET_3BIT_FLAG(Value) ((Value) & ACPI_3BIT_MASK) +#define ACPI_GET_4BIT_FLAG(Value) ((Value) & ACPI_4BIT_MASK) + +/* Macros to extract flag bits from position one and above */ + +#define ACPI_EXTRACT_1BIT_FLAG(Field, Position) (ACPI_GET_1BIT_FLAG ((Field) >> Position)) +#define ACPI_EXTRACT_2BIT_FLAG(Field, Position) (ACPI_GET_2BIT_FLAG ((Field) >> Position)) +#define ACPI_EXTRACT_3BIT_FLAG(Field, Position) (ACPI_GET_3BIT_FLAG ((Field) >> Position)) +#define ACPI_EXTRACT_4BIT_FLAG(Field, Position) (ACPI_GET_4BIT_FLAG ((Field) >> Position)) + +/* ACPI Pathname helpers */ + +#define ACPI_IS_ROOT_PREFIX(c) ((c) == (UINT8) 0x5C) /* Backslash */ +#define ACPI_IS_PARENT_PREFIX(c) ((c) == (UINT8) 0x5E) /* Carat */ +#define ACPI_IS_PATH_SEPARATOR(c) ((c) == (UINT8) 0x2E) /* Period (dot) */ /* - * An ACPI_NAMESPACE_NODE can appear in some contexts - * where a pointer to an ACPI_OPERAND_OBJECT can also + * An object of type ACPI_NAMESPACE_NODE can appear in some contexts + * where a pointer to an object of type ACPI_OPERAND_OBJECT can also * appear. This macro is used to distinguish them. * - * The "Descriptor" field is the first field in both structures. + * The "DescriptorType" field is the second field in both structures. */ +#define ACPI_GET_DESCRIPTOR_PTR(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer) +#define ACPI_SET_DESCRIPTOR_PTR(d, p) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer = (p)) #define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType) -#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = t) +#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = (t)) /* * Macros for the master AML opcode table @@ -400,10 +453,11 @@ * the plist contains a set of parens to allow variable-length lists. * These macros are used for both the debug and non-debug versions of the code. */ -#define ACPI_ERROR_NAMESPACE(s, e) AcpiUtNamespaceError (AE_INFO, s, e); -#define ACPI_ERROR_METHOD(s, n, p, e) AcpiUtMethodError (AE_INFO, s, n, p, e); -#define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist -#define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist +#define ACPI_ERROR_NAMESPACE(s, e) AcpiUtNamespaceError (AE_INFO, s, e); +#define ACPI_ERROR_METHOD(s, n, p, e) AcpiUtMethodError (AE_INFO, s, n, p, e); +#define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist +#define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist +#define ACPI_BIOS_ERROR_PREDEFINED(plist) AcpiUtPredefinedBiosError plist #else @@ -413,141 +467,16 @@ #define ACPI_ERROR_METHOD(s, n, p, e) #define ACPI_WARN_PREDEFINED(plist) #define ACPI_INFO_PREDEFINED(plist) +#define ACPI_BIOS_ERROR_PREDEFINED(plist) #endif /* ACPI_NO_ERROR_MESSAGES */ -/* - * Debug macros that are conditionally compiled - */ -#ifdef ACPI_DEBUG_OUTPUT -/* - * Function entry tracing - */ -#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ - AcpiUtTrace(ACPI_DEBUG_PARAMETERS) -#define ACPI_FUNCTION_TRACE_PTR(a, b) ACPI_FUNCTION_NAME(a) \ - AcpiUtTracePtr(ACPI_DEBUG_PARAMETERS, (void *)b) -#define ACPI_FUNCTION_TRACE_U32(a, b) ACPI_FUNCTION_NAME(a) \ - AcpiUtTraceU32(ACPI_DEBUG_PARAMETERS, (UINT32)b) -#define ACPI_FUNCTION_TRACE_STR(a, b) ACPI_FUNCTION_NAME(a) \ - AcpiUtTraceStr(ACPI_DEBUG_PARAMETERS, (char *)b) - -#define ACPI_FUNCTION_ENTRY() AcpiUtTrackStackPtr() - -/* - * Function exit tracing. - * WARNING: These macros include a return statement. This is usually considered - * bad form, but having a separate exit macro is very ugly and difficult to maintain. - * One of the FUNCTION_TRACE macros above must be used in conjunction with these macros - * so that "_AcpiFunctionName" is defined. - * - * Note: the DO_WHILE0 macro is used to prevent some compilers from complaining - * about these constructs. - */ -#ifdef ACPI_USE_DO_WHILE_0 -#define ACPI_DO_WHILE0(a) do a while(0) +#if (!ACPI_REDUCED_HARDWARE) +#define ACPI_HW_OPTIONAL_FUNCTION(addr) addr #else -#define ACPI_DO_WHILE0(a) a +#define ACPI_HW_OPTIONAL_FUNCTION(addr) NULL #endif -#define return_VOID ACPI_DO_WHILE0 ({ \ - AcpiUtExit (ACPI_DEBUG_PARAMETERS); \ - return;}) -/* - * There are two versions of most of the return macros. The default version is - * safer, since it avoids side-effects by guaranteeing that the argument will - * not be evaluated twice. - * - * A less-safe version of the macros is provided for optional use if the - * compiler uses excessive CPU stack (for example, this may happen in the - * debug case if code optimzation is disabled.) - */ -#ifndef ACPI_SIMPLE_RETURN_MACROS - -#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \ - register ACPI_STATUS _s = (s); \ - AcpiUtStatusExit (ACPI_DEBUG_PARAMETERS, _s); \ - return (_s); }) -#define return_PTR(s) ACPI_DO_WHILE0 ({ \ - register void *_s = (void *) (s); \ - AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) _s); \ - return (_s); }) -#define return_VALUE(s) ACPI_DO_WHILE0 ({ \ - register UINT64 _s = (s); \ - AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, _s); \ - return (_s); }) -#define return_UINT8(s) ACPI_DO_WHILE0 ({ \ - register UINT8 _s = (UINT8) (s); \ - AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) _s); \ - return (_s); }) -#define return_UINT32(s) ACPI_DO_WHILE0 ({ \ - register UINT32 _s = (UINT32) (s); \ - AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) _s); \ - return (_s); }) -#else /* Use original less-safe macros */ - -#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \ - AcpiUtStatusExit (ACPI_DEBUG_PARAMETERS, (s)); \ - return((s)); }) -#define return_PTR(s) ACPI_DO_WHILE0 ({ \ - AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) (s)); \ - return((s)); }) -#define return_VALUE(s) ACPI_DO_WHILE0 ({ \ - AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) (s)); \ - return((s)); }) -#define return_UINT8(s) return_VALUE(s) -#define return_UINT32(s) return_VALUE(s) - -#endif /* ACPI_SIMPLE_RETURN_MACROS */ - - -/* Conditional execution */ - -#define ACPI_DEBUG_EXEC(a) a -#define ACPI_DEBUG_ONLY_MEMBERS(a) a; -#define _VERBOSE_STRUCTURES - - -/* Various object display routines for debug */ - -#define ACPI_DUMP_STACK_ENTRY(a) AcpiExDumpOperand((a), 0) -#define ACPI_DUMP_OPERANDS(a, b ,c) AcpiExDumpOperands(a, b, c) -#define ACPI_DUMP_ENTRY(a, b) AcpiNsDumpEntry (a, b) -#define ACPI_DUMP_PATHNAME(a, b, c, d) AcpiNsDumpPathname(a, b, c, d) -#define ACPI_DUMP_BUFFER(a, b) AcpiUtDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) - -#else -/* - * This is the non-debug case -- make everything go away, - * leaving no executable debug code! - */ -#define ACPI_DEBUG_EXEC(a) -#define ACPI_DEBUG_ONLY_MEMBERS(a) -#define ACPI_FUNCTION_TRACE(a) -#define ACPI_FUNCTION_TRACE_PTR(a, b) -#define ACPI_FUNCTION_TRACE_U32(a, b) -#define ACPI_FUNCTION_TRACE_STR(a, b) -#define ACPI_FUNCTION_EXIT -#define ACPI_FUNCTION_STATUS_EXIT(s) -#define ACPI_FUNCTION_VALUE_EXIT(s) -#define ACPI_FUNCTION_ENTRY() -#define ACPI_DUMP_STACK_ENTRY(a) -#define ACPI_DUMP_OPERANDS(a, b, c) -#define ACPI_DUMP_ENTRY(a, b) -#define ACPI_DUMP_TABLES(a, b) -#define ACPI_DUMP_PATHNAME(a, b, c, d) -#define ACPI_DUMP_BUFFER(a, b) -#define ACPI_DEBUG_PRINT(pl) -#define ACPI_DEBUG_PRINT_RAW(pl) - -#define return_VOID return -#define return_ACPI_STATUS(s) return(s) -#define return_VALUE(s) return(s) -#define return_UINT8(s) return(s) -#define return_UINT32(s) return(s) -#define return_PTR(s) return(s) - -#endif /* ACPI_DEBUG_OUTPUT */ /* * Some code only gets executed when the debugger is built in. @@ -561,32 +490,6 @@ #endif -/* - * Memory allocation tracking (DEBUG ONLY) - */ -#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__ - -#ifndef ACPI_DBG_TRACK_ALLOCATIONS - -/* Memory allocation */ - -#define ACPI_ALLOCATE(a) AcpiUtAllocate((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) -#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroed((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) -#define ACPI_FREE(a) AcpiOsFree(a) -#define ACPI_MEM_TRACKING(a) - -#else - -/* Memory allocation */ - -#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) -#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) -#define ACPI_FREE(a) AcpiUtFreeAndTrack(a, ACPI_MEM_PARAMETERS) -#define ACPI_MEM_TRACKING(a) a - -#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ - - /* * Macros used for ACPICA utilities only */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acnames.h b/reactos/drivers/bus/acpi/acpica/include/acnames.h index 3fbc61cc9b9..bde34f5160f 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acnames.h +++ b/reactos/drivers/bus/acpi/acpica/include/acnames.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -118,28 +118,31 @@ /* Method names - these methods can appear anywhere in the namespace */ -#define METHOD_NAME__HID "_HID" -#define METHOD_NAME__CID "_CID" -#define METHOD_NAME__UID "_UID" #define METHOD_NAME__ADR "_ADR" -#define METHOD_NAME__INI "_INI" -#define METHOD_NAME__STA "_STA" -#define METHOD_NAME__REG "_REG" -#define METHOD_NAME__SEG "_SEG" +#define METHOD_NAME__AEI "_AEI" #define METHOD_NAME__BBN "_BBN" -#define METHOD_NAME__PRT "_PRT" +#define METHOD_NAME__CBA "_CBA" +#define METHOD_NAME__CID "_CID" #define METHOD_NAME__CRS "_CRS" +#define METHOD_NAME__HID "_HID" +#define METHOD_NAME__INI "_INI" +#define METHOD_NAME__PLD "_PLD" #define METHOD_NAME__PRS "_PRS" +#define METHOD_NAME__PRT "_PRT" #define METHOD_NAME__PRW "_PRW" +#define METHOD_NAME__REG "_REG" +#define METHOD_NAME__SB_ "_SB_" +#define METHOD_NAME__SEG "_SEG" #define METHOD_NAME__SRS "_SRS" +#define METHOD_NAME__STA "_STA" +#define METHOD_NAME__SUB "_SUB" +#define METHOD_NAME__UID "_UID" /* Method names - these methods must appear at the namespace root */ -#define METHOD_NAME__BFS "\\_BFS" -#define METHOD_NAME__GTS "\\_GTS" -#define METHOD_NAME__PTS "\\_PTS" -#define METHOD_NAME__SST "\\_SI._SST" -#define METHOD_NAME__WAK "\\_WAK" +#define METHOD_PATHNAME__PTS "\\_PTS" +#define METHOD_PATHNAME__SST "\\_SI._SST" +#define METHOD_PATHNAME__WAK "\\_WAK" /* Definitions of the predefined namespace names */ @@ -150,8 +153,5 @@ #define ACPI_PREFIX_LOWER (UINT32) 0x69706361 /* "acpi" */ #define ACPI_NS_ROOT_PATH "\\" -#define ACPI_NS_SYSTEM_BUS "_SB_" #endif /* __ACNAMES_H__ */ - - diff --git a/reactos/drivers/bus/acpi/acpica/include/acnamesp.h b/reactos/drivers/bus/acpi/acpica/include/acnamesp.h index 0437a277fe6..883e9c41c28 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acnamesp.h +++ b/reactos/drivers/bus/acpi/acpica/include/acnamesp.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -189,8 +189,8 @@ AcpiNsWalkNamespace ( ACPI_HANDLE StartObject, UINT32 MaxDepth, UINT32 Flags, - ACPI_WALK_CALLBACK PreOrderVisit, - ACPI_WALK_CALLBACK PostOrderVisit, + ACPI_WALK_CALLBACK DescendingCallback, + ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue); @@ -275,6 +275,35 @@ AcpiNsCompareNames ( char *Name2); +/* + * nsconvert - Dynamic object conversion routines + */ +ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +ACPI_STATUS +AcpiNsConvertToBuffer ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +ACPI_STATUS +AcpiNsConvertToUnicode ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + +ACPI_STATUS +AcpiNsConvertToResource ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject); + + /* * nsdump - Namespace dump/print utilities */ @@ -315,6 +344,14 @@ AcpiNsDumpObjects ( ACPI_OWNER_ID OwnerId, ACPI_HANDLE StartHandle); +void +AcpiNsDumpObjectPaths ( + ACPI_OBJECT_TYPE Type, + UINT8 DisplayType, + UINT32 MaxDepth, + ACPI_OWNER_ID OwnerId, + ACPI_HANDLE StartHandle); + /* * nseval - Namespace evaluation functions @@ -329,26 +366,53 @@ AcpiNsExecModuleCodeList ( /* - * nspredef - Support for predefined/reserved names + * nsarguments - Argument count/type checking for predefined/reserved names */ -ACPI_STATUS -AcpiNsCheckPredefinedNames ( - ACPI_NAMESPACE_NODE *Node, - UINT32 UserParamCount, - ACPI_STATUS ReturnStatus, - ACPI_OPERAND_OBJECT **ReturnObject); - -const ACPI_PREDEFINED_INFO * -AcpiNsCheckForPredefinedName ( - ACPI_NAMESPACE_NODE *Node); - void -AcpiNsCheckParameterCount ( +AcpiNsCheckArgumentCount ( char *Pathname, ACPI_NAMESPACE_NODE *Node, UINT32 UserParamCount, const ACPI_PREDEFINED_INFO *Info); +void +AcpiNsCheckAcpiCompliance ( + char *Pathname, + ACPI_NAMESPACE_NODE *Node, + const ACPI_PREDEFINED_INFO *Predefined); + +void +AcpiNsCheckArgumentTypes ( + ACPI_EVALUATE_INFO *Info); + + +/* + * nspredef - Return value checking for predefined/reserved names + */ +ACPI_STATUS +AcpiNsCheckReturnValue ( + ACPI_NAMESPACE_NODE *Node, + ACPI_EVALUATE_INFO *Info, + UINT32 UserParamCount, + ACPI_STATUS ReturnStatus, + ACPI_OPERAND_OBJECT **ReturnObject); + +ACPI_STATUS +AcpiNsCheckObjectType ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr, + UINT32 ExpectedBtypes, + UINT32 PackageIndex); + + +/* + * nsprepkg - Validation of predefined name packages + */ +ACPI_STATUS +AcpiNsCheckPackage ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + /* * nsnames - Name and Scope manipulation @@ -433,27 +497,28 @@ AcpiNsGetAttachedData ( * predefined methods/objects */ ACPI_STATUS -AcpiNsRepairObject ( - ACPI_PREDEFINED_DATA *Data, +AcpiNsSimpleRepair ( + ACPI_EVALUATE_INFO *Info, UINT32 ExpectedBtypes, UINT32 PackageIndex, ACPI_OPERAND_OBJECT **ReturnObjectPtr); ACPI_STATUS -AcpiNsRepairPackageList ( - ACPI_PREDEFINED_DATA *Data, +AcpiNsWrapWithPackage ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT *OriginalObject, ACPI_OPERAND_OBJECT **ObjDescPtr); ACPI_STATUS AcpiNsRepairNullElement ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, UINT32 ExpectedBtypes, UINT32 PackageIndex, ACPI_OPERAND_OBJECT **ReturnObjectPtr); void AcpiNsRemoveNullElements ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, UINT8 PackageType, ACPI_OPERAND_OBJECT *ObjDesc); @@ -464,7 +529,7 @@ AcpiNsRemoveNullElements ( */ ACPI_STATUS AcpiNsComplexRepairs ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_NAMESPACE_NODE *Node, ACPI_STATUS ValidateStatus, ACPI_OPERAND_OBJECT **ReturnObjectPtr); @@ -501,10 +566,6 @@ AcpiNsInstallNode ( /* * nsutils - Utility functions */ -BOOLEAN -AcpiNsValidRootPrefix ( - char Prefix); - ACPI_OBJECT_TYPE AcpiNsGetType ( ACPI_NAMESPACE_NODE *Node); diff --git a/reactos/drivers/bus/acpi/acpica/include/acobject.h b/reactos/drivers/bus/acpi/acpica/include/acobject.h index 6a6ad334e7b..e90af0b52d7 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acobject.h +++ b/reactos/drivers/bus/acpi/acpica/include/acobject.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only) @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -166,7 +165,7 @@ #define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */ #define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */ -#define AOPOBJ_DATA_VALID 0x04 /* Object is intialized and data is valid */ +#define AOPOBJ_DATA_VALID 0x04 /* Object is initialized and data is valid */ #define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */ #define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */ #define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */ @@ -195,8 +194,8 @@ typedef struct acpi_object_integer /* - * Note: The String and Buffer object must be identical through the Pointer - * and length elements. There is code that depends on this. + * Note: The String and Buffer object must be identical through the + * pointer and length elements. There is code that depends on this. * * Fields common to both Strings and Buffers */ @@ -305,12 +304,13 @@ typedef struct acpi_object_method #define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */ #define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */ #define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */ -#define ACPI_METHOD_MODIFIED_NAMESPACE 0x10 /* Method modified the namespace */ +#define ACPI_METHOD_IGNORE_SYNC_LEVEL 0x10 /* Method was auto-serialized at table load time */ +#define ACPI_METHOD_MODIFIED_NAMESPACE 0x20 /* Method modified the namespace */ /****************************************************************************** * - * Objects that can be notified. All share a common NotifyInfo area. + * Objects that can be notified. All share a common NotifyInfo area. * *****************************************************************************/ @@ -318,8 +318,7 @@ typedef struct acpi_object_method * Common fields for objects that support ASL notifications */ #define ACPI_COMMON_NOTIFY_INFO \ - union acpi_operand_object *SystemNotify; /* Handler for system notifies */\ - union acpi_operand_object *DeviceNotify; /* Handler for driver notifies */\ + union acpi_operand_object *NotifyList[2]; /* Handlers for system/device notifies */\ union acpi_operand_object *Handler; /* Handler for Address space */ @@ -374,7 +373,7 @@ typedef struct acpi_object_thermal_zone /****************************************************************************** * - * Fields. All share a common header/info field. + * Fields. All share a common header/info field. * *****************************************************************************/ @@ -392,6 +391,7 @@ typedef struct acpi_object_thermal_zone UINT32 BaseByteOffset; /* Byte offset within containing object */\ UINT32 Value; /* Value to store into the Bank or Index register */\ UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\ + UINT8 AccessLength; /* For serial regions/fields */ typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */ @@ -407,7 +407,9 @@ typedef struct acpi_object_region_field { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO + UINT16 ResourceLength; union acpi_operand_object *RegionObj; /* Containing OpRegion object */ + UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */ } ACPI_OBJECT_REGION_FIELD; @@ -458,8 +460,10 @@ typedef struct acpi_object_notify_handler { ACPI_OBJECT_COMMON_HEADER ACPI_NAMESPACE_NODE *Node; /* Parent device */ - ACPI_NOTIFY_HANDLER Handler; + UINT32 HandlerType; /* Type: Device/System/Both */ + ACPI_NOTIFY_HANDLER Handler; /* Handler address */ void *Context; + union acpi_operand_object *Next[2]; /* Device and System handler lists */ } ACPI_OBJECT_NOTIFY_HANDLER; @@ -473,7 +477,7 @@ typedef struct acpi_object_addr_handler ACPI_NAMESPACE_NODE *Node; /* Parent device */ void *Context; ACPI_ADR_SPACE_SETUP Setup; - union acpi_operand_object *RegionList; /* regions using this handler */ + union acpi_operand_object *RegionList; /* Regions using this handler */ union acpi_operand_object *Next; } ACPI_OBJECT_ADDR_HANDLER; @@ -535,6 +539,7 @@ typedef struct acpi_object_extra { ACPI_OBJECT_COMMON_HEADER ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */ + ACPI_NAMESPACE_NODE *ScopeNode; void *RegionContext; /* Region-specific data */ UINT8 *AmlStart; UINT32 AmlLength; diff --git a/reactos/drivers/bus/acpi/acpica/include/acopcode.h b/reactos/drivers/bus/acpi/acpica/include/acopcode.h index 5e42cc5b803..4ee04975e4d 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acopcode.h +++ b/reactos/drivers/bus/acpi/acpica/include/acopcode.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -126,7 +126,7 @@ #define _UNK 0x6B /* - * Reserved ASCII characters. Do not use any of these for + * Reserved ASCII characters. Do not use any of these for * internal opcodes, since they are used to differentiate * name strings from AML opcodes */ @@ -136,7 +136,7 @@ /* - * All AML opcodes and the parse-time arguments for each. Used by the AML + * All AML opcodes and the parse-time arguments for each. Used by the AML * parser Each list is compressed into a 32-bit number and stored in the * master opcode table (in psopcode.c). */ @@ -166,6 +166,7 @@ #define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME) +#define ARGP_CONNECTFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING) #define ARGP_CONTINUE_OP ARG_NONE #define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME) #define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME) @@ -237,6 +238,7 @@ #define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG) #define ARGP_REVISION_OP ARG_NONE #define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST) +#define ARGP_SERIALFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING) #define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET) #define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME) @@ -265,7 +267,7 @@ /* - * All AML opcodes and the runtime arguments for each. Used by the AML + * All AML opcodes and the runtime arguments for each. Used by the AML * interpreter Each list is compressed into a 32-bit number and stored * in the master opcode table (in psopcode.c). * @@ -297,6 +299,7 @@ #define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF) #define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF) #define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF) +#define ARGI_CONNECTFIELD_OP ARGI_INVALID_OPCODE #define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE #define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET) #define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE) @@ -368,6 +371,7 @@ #define ARGI_RETURN_OP ARGI_INVALID_OPCODE #define ARGI_REVISION_OP ARG_NONE #define ARGI_SCOPE_OP ARGI_INVALID_OPCODE +#define ARGI_SERIALFIELD_OP ARGI_INVALID_OPCODE #define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF) #define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT) diff --git a/reactos/drivers/bus/acpi/acpica/include/acoutput.h b/reactos/drivers/bus/acpi/acpica/include/acoutput.h index 0b319c8b109..2311c441c96 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acoutput.h +++ b/reactos/drivers/bus/acpi/acpica/include/acoutput.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -144,6 +144,7 @@ #define ACPI_EXAMPLE 0x00004000 #define ACPI_DRIVER 0x00008000 #define DT_COMPILER 0x00010000 +#define ASL_PREPROCESSOR 0x00020000 #define ACPI_ALL_COMPONENTS 0x0001FFFF #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) @@ -288,6 +289,8 @@ #define ACPI_WARNING(plist) AcpiWarning plist #define ACPI_EXCEPTION(plist) AcpiException plist #define ACPI_ERROR(plist) AcpiError plist +#define ACPI_BIOS_WARNING(plist) AcpiBiosWarning plist +#define ACPI_BIOS_ERROR(plist) AcpiBiosError plist #define ACPI_DEBUG_OBJECT(obj,l,i) AcpiExDoDebugObject(obj,l,i) #else @@ -298,6 +301,8 @@ #define ACPI_WARNING(plist) #define ACPI_EXCEPTION(plist) #define ACPI_ERROR(plist) +#define ACPI_BIOS_WARNING(plist) +#define ACPI_BIOS_ERROR(plist) #define ACPI_DEBUG_OBJECT(obj,l,i) #endif /* ACPI_NO_ERROR_MESSAGES */ @@ -334,25 +339,199 @@ * Common parameters used for debug output functions: * line number, function name, module(file) name, component ID */ -#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _AcpiModuleName, _COMPONENT +#define ACPI_DEBUG_PARAMETERS \ + __LINE__, ACPI_GET_FUNCTION_NAME, _AcpiModuleName, _COMPONENT + +/* Check if debug output is currently dynamically enabled */ + +#define ACPI_IS_DEBUG_ENABLED(Level, Component) \ + ((Level & AcpiDbgLevel) && (Component & AcpiDbgLayer)) /* * Master debug print macros * Print message if and only if: * 1) Debug print for the current component is enabled * 2) Debug error level or trace level for the print statement is enabled + * + * November 2012: Moved the runtime check for whether to actually emit the + * debug message outside of the print function itself. This improves overall + * performance at a relatively small code cost. Implementation involves the + * use of variadic macros supported by C99. + * + * Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from + * complaining about these constructs. On other compilers the do...while + * adds some extra code, so this feature is optional. */ -#define ACPI_DEBUG_PRINT(plist) AcpiDebugPrint plist -#define ACPI_DEBUG_PRINT_RAW(plist) AcpiDebugPrintRaw plist - +#ifdef ACPI_USE_DO_WHILE_0 +#define ACPI_DO_WHILE0(a) do a while(0) #else +#define ACPI_DO_WHILE0(a) a +#endif + +/* DEBUG_PRINT functions */ + +#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist +#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist + +/* Helper macros for DEBUG_PRINT */ + +#define ACPI_DO_DEBUG_PRINT(Function, Level, Line, Filename, Modulename, Component, ...) \ + ACPI_DO_WHILE0 ({ \ + if (ACPI_IS_DEBUG_ENABLED (Level, Component)) \ + { \ + Function (Level, Line, Filename, Modulename, Component, __VA_ARGS__); \ + } \ + }) + +#define ACPI_ACTUAL_DEBUG(Level, Line, Filename, Modulename, Component, ...) \ + ACPI_DO_DEBUG_PRINT (AcpiDebugPrint, Level, Line, \ + Filename, Modulename, Component, __VA_ARGS__) + +#define ACPI_ACTUAL_DEBUG_RAW(Level, Line, Filename, Modulename, Component, ...) \ + ACPI_DO_DEBUG_PRINT (AcpiDebugPrintRaw, Level, Line, \ + Filename, Modulename, Component, __VA_ARGS__) + + +/* + * Function entry tracing + * + * The name of the function is emitted as a local variable that is + * intended to be used by both the entry trace and the exit trace. + */ + +/* Helper macro */ + +#define ACPI_TRACE_ENTRY(Name, Function, Type, Param) \ + ACPI_FUNCTION_NAME (Name) \ + Function (ACPI_DEBUG_PARAMETERS, (Type) (Param)) + +/* The actual entry trace macros */ + +#define ACPI_FUNCTION_TRACE(Name) \ + ACPI_FUNCTION_NAME(Name) \ + AcpiUtTrace (ACPI_DEBUG_PARAMETERS) + +#define ACPI_FUNCTION_TRACE_PTR(Name, Pointer) \ + ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, void *, Pointer) + +#define ACPI_FUNCTION_TRACE_U32(Name, Value) \ + ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, UINT32, Value) + +#define ACPI_FUNCTION_TRACE_STR(Name, String) \ + ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, char *, String) + +#define ACPI_FUNCTION_ENTRY() \ + AcpiUtTrackStackPtr() + + +/* + * Function exit tracing + * + * These macros include a return statement. This is usually considered + * bad form, but having a separate exit macro before the actual return + * is very ugly and difficult to maintain. + * + * One of the FUNCTION_TRACE macros above must be used in conjunction + * with these macros so that "_AcpiFunctionName" is defined. + * + * There are two versions of most of the return macros. The default version is + * safer, since it avoids side-effects by guaranteeing that the argument will + * not be evaluated twice. + * + * A less-safe version of the macros is provided for optional use if the + * compiler uses excessive CPU stack (for example, this may happen in the + * debug case if code optimzation is disabled.) + */ + +/* Exit trace helper macro */ + +#ifndef ACPI_SIMPLE_RETURN_MACROS + +#define ACPI_TRACE_EXIT(Function, Type, Param) \ + ACPI_DO_WHILE0 ({ \ + register Type _Param = (Type) (Param); \ + Function (ACPI_DEBUG_PARAMETERS, _Param); \ + return (_Param); \ + }) + +#else /* Use original less-safe macros */ + +#define ACPI_TRACE_EXIT(Function, Type, Param) \ + ACPI_DO_WHILE0 ({ \ + Function (ACPI_DEBUG_PARAMETERS, (Type) (Param)); \ + return (Param); \ + }) + +#endif /* ACPI_SIMPLE_RETURN_MACROS */ + +/* The actual exit macros */ + +#define return_VOID \ + ACPI_DO_WHILE0 ({ \ + AcpiUtExit (ACPI_DEBUG_PARAMETERS); \ + return; \ + }) + +#define return_ACPI_STATUS(Status) \ + ACPI_TRACE_EXIT (AcpiUtStatusExit, ACPI_STATUS, Status) + +#define return_PTR(Pointer) \ + ACPI_TRACE_EXIT (AcpiUtPtrExit, void *, Pointer) + +#define return_VALUE(Value) \ + ACPI_TRACE_EXIT (AcpiUtValueExit, UINT64, Value) + +#define return_UINT32(Value) \ + ACPI_TRACE_EXIT (AcpiUtValueExit, UINT32, Value) + +#define return_UINT8(Value) \ + ACPI_TRACE_EXIT (AcpiUtValueExit, UINT8, Value) + +/* Conditional execution */ + +#define ACPI_DEBUG_EXEC(a) a +#define ACPI_DEBUG_ONLY_MEMBERS(a) a; +#define _VERBOSE_STRUCTURES + + +/* Various object display routines for debug */ + +#define ACPI_DUMP_STACK_ENTRY(a) AcpiExDumpOperand((a), 0) +#define ACPI_DUMP_OPERANDS(a, b ,c) AcpiExDumpOperands(a, b, c) +#define ACPI_DUMP_ENTRY(a, b) AcpiNsDumpEntry (a, b) +#define ACPI_DUMP_PATHNAME(a, b, c, d) AcpiNsDumpPathname(a, b, c, d) +#define ACPI_DUMP_BUFFER(a, b) AcpiUtDebugDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) + +#else /* ACPI_DEBUG_OUTPUT */ /* * This is the non-debug case -- make everything go away, * leaving no executable debug code! */ -#define ACPI_FUNCTION_NAME(a) #define ACPI_DEBUG_PRINT(pl) #define ACPI_DEBUG_PRINT_RAW(pl) +#define ACPI_DEBUG_EXEC(a) +#define ACPI_DEBUG_ONLY_MEMBERS(a) +#define ACPI_FUNCTION_NAME(a) +#define ACPI_FUNCTION_TRACE(a) +#define ACPI_FUNCTION_TRACE_PTR(a, b) +#define ACPI_FUNCTION_TRACE_U32(a, b) +#define ACPI_FUNCTION_TRACE_STR(a, b) +#define ACPI_FUNCTION_ENTRY() +#define ACPI_DUMP_STACK_ENTRY(a) +#define ACPI_DUMP_OPERANDS(a, b, c) +#define ACPI_DUMP_ENTRY(a, b) +#define ACPI_DUMP_PATHNAME(a, b, c, d) +#define ACPI_DUMP_BUFFER(a, b) +#define ACPI_IS_DEBUG_ENABLED(Level, Component) 0 + +/* Return macros must have a return statement at the minimum */ + +#define return_VOID return +#define return_ACPI_STATUS(s) return(s) +#define return_PTR(s) return(s) +#define return_VALUE(s) return(s) +#define return_UINT8(s) return(s) +#define return_UINT32(s) return(s) #endif /* ACPI_DEBUG_OUTPUT */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acparser.h b/reactos/drivers/bus/acpi/acpica/include/acparser.h index 3ea2096c9c7..5827a8cc999 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acparser.h +++ b/reactos/drivers/bus/acpi/acpica/include/acparser.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -201,7 +201,36 @@ AcpiPsGetParent ( /* - * psopcode - AML Opcode information + * psobject - support for parse object processing + */ +ACPI_STATUS +AcpiPsBuildNamedOp ( + ACPI_WALK_STATE *WalkState, + UINT8 *AmlOpStart, + ACPI_PARSE_OBJECT *UnnamedOp, + ACPI_PARSE_OBJECT **Op); + +ACPI_STATUS +AcpiPsCreateOp ( + ACPI_WALK_STATE *WalkState, + UINT8 *AmlOpStart, + ACPI_PARSE_OBJECT **NewOp); + +ACPI_STATUS +AcpiPsCompleteOp ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT **Op, + ACPI_STATUS Status); + +ACPI_STATUS +AcpiPsCompleteFinalOp ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT *Op, + ACPI_STATUS Status); + + +/* + * psopinfo - AML Opcode information */ const ACPI_OPCODE_INFO * AcpiPsGetOpcodeInfo ( @@ -366,10 +395,6 @@ BOOLEAN AcpiPsIsLeadingChar ( UINT32 c); -BOOLEAN -AcpiPsIsPrefixChar ( - UINT32 c); - UINT32 AcpiPsGetName( ACPI_PARSE_OBJECT *op); diff --git a/reactos/drivers/bus/acpi/acpica/include/acpi.h b/reactos/drivers/bus/acpi/acpica/include/acpi.h index afbbb0f40dc..9c8bc8d61a6 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acpi.h +++ b/reactos/drivers/bus/acpi/acpica/include/acpi.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -125,9 +125,6 @@ * * Note: The order of these include files is important. */ -#include -#include - #include "platform/acenv.h" /* Environment-specific items */ #include "acnames.h" /* Common ACPI names and strings */ #include "actypes.h" /* ACPICA data types and structures */ @@ -137,8 +134,8 @@ #include "acrestyp.h" /* Resource Descriptor structs */ #include "acpiosxf.h" /* OSL interfaces (ACPICA-to-OS) */ #include "acpixf.h" /* ACPI core subsystem external interfaces */ - -#include "acconfig.h" -#include "acmacros.h" +#ifdef ACPI_NATIVE_INTERFACE_HEADER +#include ACPI_NATIVE_INTERFACE_HEADER +#endif #endif /* __ACPI_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acpiosxf.h b/reactos/drivers/bus/acpi/acpica/include/acpiosxf.h index 9f7fc4207c4..00922c7ebf3 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acpiosxf.h +++ b/reactos/drivers/bus/acpi/acpica/include/acpiosxf.h @@ -1,24 +1,22 @@ - /****************************************************************************** * - * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These + * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These * interfaces must be implemented by OSL to interface the * ACPI components to the host operating system. * *****************************************************************************/ - /****************************************************************************** * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -33,10 +31,9 @@ * license (with the right to sublicense), under only those claims of Intel * patents that are infringed by the Original Intel Code, to make, use, sell, * offer to sell, and import the Covered Code and derivative works thereof - * solely to the minimum extent necessary to exer - se the above copyright + * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -48,11 +45,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -60,7 +57,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -85,10 +82,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -97,14 +94,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -159,77 +156,111 @@ typedef struct acpi_signal_fatal_info /* * OSL Initialization and shutdown primitives */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize ACPI_STATUS AcpiOsInitialize ( void); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate ACPI_STATUS AcpiOsTerminate ( void); +#endif /* * ACPI Table interfaces */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetRootPointer ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer ( void); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPredefinedOverride ACPI_STATUS AcpiOsPredefinedOverride ( const ACPI_PREDEFINED_NAMES *InitVal, ACPI_STRING *NewVal); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTableOverride ACPI_STATUS AcpiOsTableOverride ( ACPI_TABLE_HEADER *ExistingTable, ACPI_TABLE_HEADER **NewTable); +#endif + +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPhysicalTableOverride +ACPI_STATUS +AcpiOsPhysicalTableOverride ( + ACPI_TABLE_HEADER *ExistingTable, + ACPI_PHYSICAL_ADDRESS *NewAddress, + UINT32 *NewTableLength); +#endif /* * Spinlock primitives */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock ACPI_STATUS AcpiOsCreateLock ( ACPI_SPINLOCK *OutHandle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteLock void AcpiOsDeleteLock ( ACPI_SPINLOCK Handle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireLock ACPI_CPU_FLAGS AcpiOsAcquireLock ( ACPI_SPINLOCK Handle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseLock void AcpiOsReleaseLock ( ACPI_SPINLOCK Handle, ACPI_CPU_FLAGS Flags); +#endif /* * Semaphore primitives */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateSemaphore ACPI_STATUS AcpiOsCreateSemaphore ( UINT32 MaxUnits, UINT32 InitialUnits, ACPI_SEMAPHORE *OutHandle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteSemaphore ACPI_STATUS AcpiOsDeleteSemaphore ( ACPI_SEMAPHORE Handle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitSemaphore ACPI_STATUS AcpiOsWaitSemaphore ( ACPI_SEMAPHORE Handle, UINT32 Units, UINT16 Timeout); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignalSemaphore ACPI_STATUS AcpiOsSignalSemaphore ( ACPI_SEMAPHORE Handle, UINT32 Units); +#endif /* @@ -238,151 +269,208 @@ AcpiOsSignalSemaphore ( */ #if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE) +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateMutex ACPI_STATUS AcpiOsCreateMutex ( ACPI_MUTEX *OutHandle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteMutex void AcpiOsDeleteMutex ( ACPI_MUTEX Handle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireMutex ACPI_STATUS AcpiOsAcquireMutex ( ACPI_MUTEX Handle, UINT16 Timeout); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseMutex void AcpiOsReleaseMutex ( ACPI_MUTEX Handle); #endif +#endif + /* * Memory allocation and mapping */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate void * AcpiOsAllocate ( ACPI_SIZE Size); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed +void * +AcpiOsAllocateZeroed ( + ACPI_SIZE Size); +#endif + +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree void AcpiOsFree ( void * Memory); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory void * AcpiOsMapMemory ( ACPI_PHYSICAL_ADDRESS Where, ACPI_SIZE Length); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory void AcpiOsUnmapMemory ( void *LogicalAddress, ACPI_SIZE Size); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetPhysicalAddress ACPI_STATUS AcpiOsGetPhysicalAddress ( void *LogicalAddress, ACPI_PHYSICAL_ADDRESS *PhysicalAddress); +#endif /* * Memory/Object Cache */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateCache ACPI_STATUS AcpiOsCreateCache ( char *CacheName, UINT16 ObjectSize, UINT16 MaxDepth, ACPI_CACHE_T **ReturnCache); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteCache ACPI_STATUS AcpiOsDeleteCache ( ACPI_CACHE_T *Cache); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPurgeCache ACPI_STATUS AcpiOsPurgeCache ( ACPI_CACHE_T *Cache); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject void * AcpiOsAcquireObject ( ACPI_CACHE_T *Cache); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseObject ACPI_STATUS AcpiOsReleaseObject ( ACPI_CACHE_T *Cache, void *Object); +#endif /* * Interrupt handlers */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInstallInterruptHandler ACPI_STATUS AcpiOsInstallInterruptHandler ( UINT32 InterruptNumber, ACPI_OSD_HANDLER ServiceRoutine, void *Context); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRemoveInterruptHandler ACPI_STATUS AcpiOsRemoveInterruptHandler ( UINT32 InterruptNumber, ACPI_OSD_HANDLER ServiceRoutine); +#endif /* * Threads and Scheduling */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId ACPI_THREAD_ID AcpiOsGetThreadId ( void); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsExecute ACPI_STATUS AcpiOsExecute ( ACPI_EXECUTE_TYPE Type, ACPI_OSD_EXEC_CALLBACK Function, void *Context); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitEventsComplete void AcpiOsWaitEventsComplete ( - void *Context); + void); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSleep void AcpiOsSleep ( UINT64 Milliseconds); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsStall void AcpiOsStall ( UINT32 Microseconds); +#endif /* * Platform and hardware-independent I/O interfaces */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPort ACPI_STATUS AcpiOsReadPort ( ACPI_IO_ADDRESS Address, UINT32 *Value, UINT32 Width); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePort ACPI_STATUS AcpiOsWritePort ( ACPI_IO_ADDRESS Address, UINT32 Value, UINT32 Width); +#endif /* * Platform and hardware-independent physical memory interfaces */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadMemory ACPI_STATUS AcpiOsReadMemory ( ACPI_PHYSICAL_ADDRESS Address, - UINT32 *Value, + UINT64 *Value, UINT32 Width); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteMemory ACPI_STATUS AcpiOsWriteMemory ( ACPI_PHYSICAL_ADDRESS Address, - UINT32 Value, + UINT64 Value, UINT32 Width); +#endif /* @@ -390,80 +478,131 @@ AcpiOsWriteMemory ( * Note: Can't use "Register" as a parameter, changed to "Reg" -- * certain compilers complain. */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPciConfiguration ACPI_STATUS AcpiOsReadPciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Reg, UINT64 *Value, UINT32 Width); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePciConfiguration ACPI_STATUS AcpiOsWritePciConfiguration ( ACPI_PCI_ID *PciId, UINT32 Reg, UINT64 Value, UINT32 Width); +#endif /* * Miscellaneous */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable BOOLEAN AcpiOsReadable ( void *Pointer, ACPI_SIZE Length); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable BOOLEAN AcpiOsWritable ( void *Pointer, ACPI_SIZE Length); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTimer UINT64 AcpiOsGetTimer ( void); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignal ACPI_STATUS AcpiOsSignal ( UINT32 Function, void *Info); +#endif /* * Debug print routines */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPrintf void ACPI_INTERNAL_VAR_XFACE AcpiOsPrintf ( const char *Format, ...); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsVprintf void AcpiOsVprintf ( const char *Format, va_list Args); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput void AcpiOsRedirectOutput ( void *Destination); +#endif /* * Debug input */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine ACPI_STATUS AcpiOsGetLine ( char *Buffer, UINT32 BufferLength, UINT32 *BytesRead); +#endif + + +/* + * Obtain ACPI table(s) + */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName +ACPI_STATUS +AcpiOsGetTableByName ( + char *Signature, + UINT32 Instance, + ACPI_TABLE_HEADER **Table, + ACPI_PHYSICAL_ADDRESS *Address); +#endif + +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex +ACPI_STATUS +AcpiOsGetTableByIndex ( + UINT32 Index, + ACPI_TABLE_HEADER **Table, + UINT32 *Instance, + ACPI_PHYSICAL_ADDRESS *Address); +#endif + +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress +ACPI_STATUS +AcpiOsGetTableByAddress ( + ACPI_PHYSICAL_ADDRESS Address, + ACPI_TABLE_HEADER **Table); +#endif /* * Directory manipulation */ +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory void * AcpiOsOpenDirectory ( char *Pathname, char *WildcardSpec, char RequestedFileType); +#endif /* RequesteFileType values */ @@ -471,13 +610,17 @@ AcpiOsOpenDirectory ( #define REQUEST_DIR_ONLY 1 +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename char * AcpiOsGetNextFilename ( void *DirHandle); +#endif +#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory void AcpiOsCloseDirectory ( void *DirHandle); +#endif #endif /* __ACPIOSXF_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acpixf.h b/reactos/drivers/bus/acpi/acpica/include/acpixf.h index 34f84b166de..61125f1d8f6 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acpixf.h +++ b/reactos/drivers/bus/acpi/acpica/include/acpixf.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Name: acpixf.h - External interfaces to the ACPI subsystem @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -120,10 +119,12 @@ /* Current ACPICA subsystem version in YYYYMMDD format */ -#define ACPI_CA_VERSION 0x20110922 +#define ACPI_CA_VERSION 0x20140325 +#include "acconfig.h" #include "actypes.h" #include "actbl.h" +#include "acbuffer.h" /* * Globals that are publically available @@ -131,6 +132,8 @@ extern UINT32 AcpiCurrentGpeCount; extern ACPI_TABLE_FADT AcpiGbl_FADT; extern BOOLEAN AcpiGbl_SystemAwakeAndRunning; +extern BOOLEAN AcpiGbl_ReducedHardware; /* ACPI 5.0 */ +extern UINT8 AcpiGbl_OsiData; /* Runtime configuration of debug print levels */ @@ -139,16 +142,47 @@ extern UINT32 AcpiDbgLayer; /* ACPICA runtime options */ -extern UINT8 AcpiGbl_EnableInterpreterSlack; -extern UINT8 AcpiGbl_AllMethodsSerialized; -extern UINT8 AcpiGbl_CreateOsiMethod; -extern UINT8 AcpiGbl_UseDefaultRegisterWidths; -extern ACPI_NAME AcpiGbl_TraceMethodName; -extern UINT32 AcpiGbl_TraceFlags; -extern UINT8 AcpiGbl_EnableAmlDebugObject; +extern UINT8 AcpiGbl_AutoSerializeMethods; extern UINT8 AcpiGbl_CopyDsdtLocally; -extern UINT8 AcpiGbl_TruncateIoAddresses; +extern UINT8 AcpiGbl_CreateOsiMethod; extern UINT8 AcpiGbl_DisableAutoRepair; +extern UINT8 AcpiGbl_DisableSsdtTableInstall; +extern UINT8 AcpiGbl_DoNotUseXsdt; +extern UINT8 AcpiGbl_EnableAmlDebugObject; +extern UINT8 AcpiGbl_EnableInterpreterSlack; +extern UINT32 AcpiGbl_TraceFlags; +extern ACPI_NAME AcpiGbl_TraceMethodName; +extern UINT8 AcpiGbl_TruncateIoAddresses; +extern UINT8 AcpiGbl_Use32BitFadtAddresses; +extern UINT8 AcpiGbl_UseDefaultRegisterWidths; + + +/* + * Hardware-reduced prototypes. All interfaces that use these macros will + * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag + * is set to TRUE. + */ +#if (!ACPI_REDUCED_HARDWARE) +#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \ + Prototype; + +#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \ + Prototype; + +#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \ + Prototype; + +#else +#define ACPI_HW_DEPENDENT_RETURN_STATUS(Prototype) \ + static ACPI_INLINE Prototype {return(AE_NOT_CONFIGURED);} + +#define ACPI_HW_DEPENDENT_RETURN_OK(Prototype) \ + static ACPI_INLINE Prototype {return(AE_OK);} + +#define ACPI_HW_DEPENDENT_RETURN_VOID(Prototype) \ + static ACPI_INLINE Prototype {return;} + +#endif /* !ACPI_REDUCED_HARDWARE */ /* @@ -180,13 +214,15 @@ AcpiTerminate ( /* * Miscellaneous global interfaces */ +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnable ( - void); + void)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiDisable ( - void); + void)) ACPI_STATUS AcpiSubsystemStatus ( @@ -216,21 +252,43 @@ ACPI_STATUS AcpiRemoveInterface ( ACPI_STRING InterfaceName); +ACPI_STATUS +AcpiUpdateInterfaces ( + UINT8 Action); + +UINT32 +AcpiCheckAddressRange ( + ACPI_ADR_SPACE_TYPE SpaceId, + ACPI_PHYSICAL_ADDRESS Address, + ACPI_SIZE Length, + BOOLEAN Warn); + +ACPI_STATUS +AcpiDecodePldBuffer ( + UINT8 *InBuffer, + ACPI_SIZE Length, + ACPI_PLD_INFO **ReturnBuffer); + /* - * ACPI Memory management + * ACPI table load/unload interfaces */ -void * -AcpiAllocate ( - UINT32 Size); +ACPI_STATUS +AcpiInstallTable ( + ACPI_PHYSICAL_ADDRESS Address, + BOOLEAN Physical); -void * -AcpiCallocate ( - UINT32 Size); +ACPI_STATUS +AcpiLoadTable ( + ACPI_TABLE_HEADER *Table); -void -AcpiFree ( - void *Address); +ACPI_STATUS +AcpiUnloadParentTable ( + ACPI_HANDLE Object); + +ACPI_STATUS +AcpiLoadTables ( + void); /* @@ -244,10 +302,6 @@ ACPI_STATUS AcpiFindRootPointer ( ACPI_SIZE *RsdpAddress); -ACPI_STATUS -AcpiLoadTables ( - void); - ACPI_STATUS AcpiGetTableHeader ( ACPI_STRING Signature, @@ -283,8 +337,8 @@ AcpiWalkNamespace ( ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, - ACPI_WALK_CALLBACK PreOrderVisit, - ACPI_WALK_CALLBACK PostOrderVisit, + ACPI_WALK_CALLBACK DescendingCallback, + ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue); @@ -385,35 +439,51 @@ AcpiInstallInitializationHandler ( ACPI_INIT_HANDLER Handler, UINT32 Function); +ACPI_HW_DEPENDENT_RETURN_STATUS ( +ACPI_STATUS +AcpiInstallSciHandler ( + ACPI_SCI_HANDLER Address, + void *Context)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( +ACPI_STATUS +AcpiRemoveSciHandler ( + ACPI_SCI_HANDLER Address)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiInstallGlobalEventHandler ( ACPI_GBL_EVENT_HANDLER Handler, - void *Context); + void *Context)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiInstallFixedEventHandler ( UINT32 AcpiEvent, ACPI_EVENT_HANDLER Handler, - void *Context); + void *Context)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiRemoveFixedEventHandler ( UINT32 AcpiEvent, - ACPI_EVENT_HANDLER Handler); + ACPI_EVENT_HANDLER Handler)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiInstallGpeHandler ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, UINT32 Type, ACPI_GPE_HANDLER Address, - void *Context); + void *Context)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiRemoveGpeHandler ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, - ACPI_GPE_HANDLER Address); + ACPI_GPE_HANDLER Address)) ACPI_STATUS AcpiInstallNotifyHandler ( @@ -454,113 +524,148 @@ AcpiInstallInterfaceHandler ( /* * Global Lock interfaces */ +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiAcquireGlobalLock ( UINT16 Timeout, - UINT32 *Handle); + UINT32 *Handle)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiReleaseGlobalLock ( - UINT32 Handle); + UINT32 Handle)) + + +/* + * Interfaces to AML mutex objects + */ +ACPI_STATUS +AcpiAcquireMutex ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname, + UINT16 Timeout); + +ACPI_STATUS +AcpiReleaseMutex ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname); /* * Fixed Event interfaces */ +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnableEvent ( UINT32 Event, - UINT32 Flags); + UINT32 Flags)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiDisableEvent ( UINT32 Event, - UINT32 Flags); + UINT32 Flags)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiClearEvent ( - UINT32 Event); + UINT32 Event)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiGetEventStatus ( UINT32 Event, - ACPI_EVENT_STATUS *EventStatus); + ACPI_EVENT_STATUS *EventStatus)) /* * General Purpose Event (GPE) Interfaces */ +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiUpdateAllGpes ( - void); + void)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnableGpe ( ACPI_HANDLE GpeDevice, - UINT32 GpeNumber); + UINT32 GpeNumber)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiDisableGpe ( ACPI_HANDLE GpeDevice, - UINT32 GpeNumber); + UINT32 GpeNumber)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiClearGpe ( ACPI_HANDLE GpeDevice, - UINT32 GpeNumber); + UINT32 GpeNumber)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiSetGpe ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, - UINT8 Action); + UINT8 Action)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiFinishGpe ( ACPI_HANDLE GpeDevice, - UINT32 GpeNumber); + UINT32 GpeNumber)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiSetupGpeForWake ( ACPI_HANDLE ParentDevice, ACPI_HANDLE GpeDevice, - UINT32 GpeNumber); + UINT32 GpeNumber)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiSetGpeWakeMask ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, - UINT8 Action); + UINT8 Action)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiGetGpeStatus ( ACPI_HANDLE GpeDevice, UINT32 GpeNumber, - ACPI_EVENT_STATUS *EventStatus); + ACPI_EVENT_STATUS *EventStatus)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiDisableAllGpes ( - void); + void)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnableAllRuntimeGpes ( - void); + void)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiGetGpeDevice ( UINT32 GpeIndex, - ACPI_HANDLE *GpeDevice); + ACPI_HANDLE *GpeDevice)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiInstallGpeBlock ( ACPI_HANDLE GpeDevice, ACPI_GENERIC_ADDRESS *GpeBlockAddress, UINT32 RegisterCount, - UINT32 InterruptNumber); + UINT32 InterruptNumber)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiRemoveGpeBlock ( - ACPI_HANDLE GpeDevice); + ACPI_HANDLE GpeDevice)) /* @@ -588,6 +693,17 @@ AcpiGetPossibleResources ( ACPI_HANDLE Device, ACPI_BUFFER *RetBuffer); +ACPI_STATUS +AcpiGetEventResources ( + ACPI_HANDLE DeviceHandle, + ACPI_BUFFER *RetBuffer); + +ACPI_STATUS +AcpiWalkResourceBuffer ( + ACPI_BUFFER *Buffer, + ACPI_WALK_RESOURCE_CALLBACK UserFunction, + void *Context); + ACPI_STATUS AcpiWalkResources ( ACPI_HANDLE Device, @@ -610,6 +726,12 @@ AcpiResourceToAddress64 ( ACPI_RESOURCE *Resource, ACPI_RESOURCE_ADDRESS64 *Out); +ACPI_STATUS +AcpiBufferToResource ( + UINT8 *AmlBuffer, + UINT16 AmlBufferLength, + ACPI_RESOURCE **ResourcePtr); + /* * Hardware (ACPI device) interfaces @@ -628,16 +750,22 @@ AcpiWrite ( UINT64 Value, ACPI_GENERIC_ADDRESS *Reg); +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiReadBitRegister ( UINT32 RegisterId, - UINT32 *ReturnValue); + UINT32 *ReturnValue)) +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiWriteBitRegister ( UINT32 RegisterId, - UINT32 Value); + UINT32 Value)) + +/* + * Sleep/Wake interfaces + */ ACPI_STATUS AcpiGetSleepTypeData ( UINT8 SleepState, @@ -652,56 +780,104 @@ ACPI_STATUS AcpiEnterSleepState ( UINT8 SleepState); +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiEnterSleepStateS4bios ( - void); + void)) + +ACPI_STATUS +AcpiLeaveSleepStatePrep ( + UINT8 SleepState); ACPI_STATUS AcpiLeaveSleepState ( - UINT8 SleepState) - ; + UINT8 SleepState); + +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiSetFirmwareWakingVector ( - UINT32 PhysicalAddress); + UINT32 PhysicalAddress)) #if ACPI_MACHINE_WIDTH == 64 +ACPI_HW_DEPENDENT_RETURN_STATUS ( ACPI_STATUS AcpiSetFirmwareWakingVector64 ( - UINT64 PhysicalAddress); + UINT64 PhysicalAddress)) #endif +/* + * ACPI Timer interfaces + */ +ACPI_HW_DEPENDENT_RETURN_STATUS ( +ACPI_STATUS +AcpiGetTimerResolution ( + UINT32 *Resolution)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( +ACPI_STATUS +AcpiGetTimer ( + UINT32 *Ticks)) + +ACPI_HW_DEPENDENT_RETURN_STATUS ( +ACPI_STATUS +AcpiGetTimerDuration ( + UINT32 StartTicks, + UINT32 EndTicks, + UINT32 *TimeElapsed)) + + /* * Error/Warning output */ +ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiError ( const char *ModuleName, UINT32 LineNumber, const char *Format, - ...) ACPI_PRINTF_LIKE(3); + ...); +ACPI_PRINTF_LIKE(4) void ACPI_INTERNAL_VAR_XFACE AcpiException ( const char *ModuleName, UINT32 LineNumber, ACPI_STATUS Status, const char *Format, - ...) ACPI_PRINTF_LIKE(4); + ...); +ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiWarning ( const char *ModuleName, UINT32 LineNumber, const char *Format, - ...) ACPI_PRINTF_LIKE(3); + ...); +ACPI_PRINTF_LIKE(3) void ACPI_INTERNAL_VAR_XFACE AcpiInfo ( const char *ModuleName, UINT32 LineNumber, const char *Format, - ...) ACPI_PRINTF_LIKE(3); + ...); + +ACPI_PRINTF_LIKE(3) +void ACPI_INTERNAL_VAR_XFACE +AcpiBiosError ( + const char *ModuleName, + UINT32 LineNumber, + const char *Format, + ...); + +ACPI_PRINTF_LIKE(3) +void ACPI_INTERNAL_VAR_XFACE +AcpiBiosWarning ( + const char *ModuleName, + UINT32 LineNumber, + const char *Format, + ...); /* @@ -709,6 +885,7 @@ AcpiInfo ( */ #ifdef ACPI_DEBUG_OUTPUT +ACPI_PRINTF_LIKE(6) void ACPI_INTERNAL_VAR_XFACE AcpiDebugPrint ( UINT32 RequestedDebugLevel, @@ -717,8 +894,9 @@ AcpiDebugPrint ( const char *ModuleName, UINT32 ComponentId, const char *Format, - ...) ACPI_PRINTF_LIKE(6); + ...); +ACPI_PRINTF_LIKE(6) void ACPI_INTERNAL_VAR_XFACE AcpiDebugPrintRaw ( UINT32 RequestedDebugLevel, @@ -727,7 +905,7 @@ AcpiDebugPrintRaw ( const char *ModuleName, UINT32 ComponentId, const char *Format, - ...) ACPI_PRINTF_LIKE(6); + ...); #endif #endif /* __ACXFACE_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acpredef.h b/reactos/drivers/bus/acpi/acpica/include/acpredef.h index 5b3227083fa..7e804f36964 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acpredef.h +++ b/reactos/drivers/bus/acpi/acpica/include/acpredef.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,7 +121,7 @@ * * Return Package types * - * 1) PTYPE1 packages do not contain sub-packages. + * 1) PTYPE1 packages do not contain subpackages. * * ACPI_PTYPE1_FIXED: Fixed-length length, 1 or 2 object types: * object type @@ -129,24 +129,26 @@ * object type * count * - * ACPI_PTYPE1_VAR: Variable-length length: + * ACPI_PTYPE1_VAR: Variable-length length. Zero-length package is allowed: * object type (Int/Buf/Ref) * * ACPI_PTYPE1_OPTION: Package has some required and some optional elements * (Used for _PRW) * * - * 2) PTYPE2 packages contain a Variable-length number of sub-packages. Each - * of the different types describe the contents of each of the sub-packages. + * 2) PTYPE2 packages contain a Variable-length number of subpackages. Each + * of the different types describe the contents of each of the subpackages. * - * ACPI_PTYPE2: Each subpackage contains 1 or 2 object types: + * ACPI_PTYPE2: Each subpackage contains 1 or 2 object types. Zero-length + * parent package is allowed: * object type * count * object type * count * (Used for _ALR,_MLS,_PSS,_TRT,_TSS) * - * ACPI_PTYPE2_COUNT: Each subpackage has a count as first element: + * ACPI_PTYPE2_COUNT: Each subpackage has a count as first element. + * Zero-length parent package is allowed: * object type * (Used for _CSD,_PSD,_TSD) * @@ -157,15 +159,25 @@ * count * (Used for _CST) * - * ACPI_PTYPE2_FIXED: Each subpackage is of Fixed-length + * ACPI_PTYPE2_FIXED: Each subpackage is of Fixed-length. Zero-length + * parent package is allowed. * (Used for _PRT) * - * ACPI_PTYPE2_MIN: Each subpackage has a Variable-length but minimum length + * ACPI_PTYPE2_MIN: Each subpackage has a Variable-length but minimum length. + * Zero-length parent package is allowed: * (Used for _HPX) * * ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length * (Used for _ART, _FPS) * + * ACPI_PTYPE2_FIX_VAR: Each subpackage consists of some fixed-length elements + * followed by an optional element. Zero-length parent package is allowed. + * object type + * count + * object type + * count = 0 (optional) + * (Used for _DLM) + * *****************************************************************************/ enum AcpiReturnPackageTypes @@ -178,12 +190,54 @@ enum AcpiReturnPackageTypes ACPI_PTYPE2_PKG_COUNT = 6, ACPI_PTYPE2_FIXED = 7, ACPI_PTYPE2_MIN = 8, - ACPI_PTYPE2_REV_FIXED = 9 + ACPI_PTYPE2_REV_FIXED = 9, + ACPI_PTYPE2_FIX_VAR = 10 }; +/* Support macros for users of the predefined info table */ + +#define METHOD_PREDEF_ARGS_MAX 4 +#define METHOD_ARG_BIT_WIDTH 3 +#define METHOD_ARG_MASK 0x0007 +#define ARG_COUNT_IS_MINIMUM 0x8000 +#define METHOD_MAX_ARG_TYPE ACPI_TYPE_PACKAGE + +#define METHOD_GET_ARG_COUNT(ArgList) ((ArgList) & METHOD_ARG_MASK) +#define METHOD_GET_NEXT_TYPE(ArgList) (((ArgList) >>= METHOD_ARG_BIT_WIDTH) & METHOD_ARG_MASK) + +/* Macros used to build the predefined info table */ + +#define METHOD_0ARGS 0 +#define METHOD_1ARGS(a1) (1 | (a1 << 3)) +#define METHOD_2ARGS(a1,a2) (2 | (a1 << 3) | (a2 << 6)) +#define METHOD_3ARGS(a1,a2,a3) (3 | (a1 << 3) | (a2 << 6) | (a3 << 9)) +#define METHOD_4ARGS(a1,a2,a3,a4) (4 | (a1 << 3) | (a2 << 6) | (a3 << 9) | (a4 << 12)) + +#define METHOD_RETURNS(type) (type) +#define METHOD_NO_RETURN_VALUE 0 + +#define PACKAGE_INFO(a,b,c,d,e,f) {{{(a),(b),(c),(d)}, ((((UINT16)(f)) << 8) | (e)), 0}} + + +/* Support macros for the resource descriptor info table */ + +#define WIDTH_1 0x0001 +#define WIDTH_2 0x0002 +#define WIDTH_3 0x0004 +#define WIDTH_8 0x0008 +#define WIDTH_16 0x0010 +#define WIDTH_32 0x0020 +#define WIDTH_64 0x0040 +#define VARIABLE_DATA 0x0080 +#define NUM_RESOURCE_WIDTHS 8 + +#define WIDTH_ADDRESS WIDTH_16 | WIDTH_32 | WIDTH_64 + + #ifdef ACPI_CREATE_PREDEFINED_TABLE -/* +/****************************************************************************** + * * Predefined method/object information table. * * These are the names that can actually be evaluated via AcpiEvaluateObject. @@ -194,6 +248,7 @@ enum AcpiReturnPackageTypes * _Lxx and _Exx GPE methods * _Qxx EC methods * _T_x compiler temporary variables + * _Wxx wake events * * 2) Predefined names that never actually exist within the AML code: * Predefined resource descriptor field names @@ -201,13 +256,13 @@ enum AcpiReturnPackageTypes * 3) Predefined names that are implemented within ACPICA: * _OSI * - * 4) Some predefined names that are not documented within the ACPI spec. - * _WDG, _WED - * * The main entries in the table each contain the following items: * * Name - The ACPI reserved name - * ParamCount - Number of arguments to the method + * ArgumentList - Contains (in 16 bits), the number of required + * arguments to the method (3 bits), and a 3-bit type + * field for each argument (up to 4 arguments). The + * METHOD_?ARGS macros generate the correct packed data. * ExpectedBtypes - Allowed type(s) for the return value. * 0 means that no return value is expected. * @@ -217,228 +272,498 @@ enum AcpiReturnPackageTypes * overall size of the stored data. * * Note: The additional braces are intended to promote portability. - */ -static const ACPI_PREDEFINED_INFO PredefinedNames[] = + * + * Note2: Table is used by the kernel-resident subsystem, the iASL compiler, + * and the AcpiHelp utility. + * + * TBD: _PRT - currently ignore reversed entries. Attempt to fix in nsrepair. + * Possibly fixing package elements like _BIF, etc. + * + *****************************************************************************/ + +const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] = { - {{"_AC0", 0, ACPI_RTYPE_INTEGER}}, - {{"_AC1", 0, ACPI_RTYPE_INTEGER}}, - {{"_AC2", 0, ACPI_RTYPE_INTEGER}}, - {{"_AC3", 0, ACPI_RTYPE_INTEGER}}, - {{"_AC4", 0, ACPI_RTYPE_INTEGER}}, - {{"_AC5", 0, ACPI_RTYPE_INTEGER}}, - {{"_AC6", 0, ACPI_RTYPE_INTEGER}}, - {{"_AC7", 0, ACPI_RTYPE_INTEGER}}, - {{"_AC8", 0, ACPI_RTYPE_INTEGER}}, - {{"_AC9", 0, ACPI_RTYPE_INTEGER}}, - {{"_ADR", 0, ACPI_RTYPE_INTEGER}}, - {{"_AL0", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AC0", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_AL1", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AC1", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_AL2", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AC2", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_AL3", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AC3", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_AL4", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AC4", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_AL5", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AC5", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_AL6", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AC6", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_AL7", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AC7", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_AL8", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AC8", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_AL9", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AC9", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_ALC", 0, ACPI_RTYPE_INTEGER}}, - {{"_ALI", 0, ACPI_RTYPE_INTEGER}}, - {{"_ALP", 0, ACPI_RTYPE_INTEGER}}, - {{"_ALR", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 2 (Ints) */ - {{{ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 2,0}, 0,0}}, + {{"_ADR", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_ALT", 0, ACPI_RTYPE_INTEGER}}, - {{"_ART", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(rev), n Pkg (2 Ref/11 Int) */ - {{{ACPI_PTYPE2_REV_FIXED,ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER}, 11,0}}, + {{"_AEI", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, - {{"_BBN", 0, ACPI_RTYPE_INTEGER}}, - {{"_BCL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}}, + {{"_AL0", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), - {{"_BCM", 1, 0}}, - {{"_BCT", 1, ACPI_RTYPE_INTEGER}}, - {{"_BDN", 0, ACPI_RTYPE_INTEGER}}, - {{"_BFS", 1, 0}}, - {{"_BIF", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (9 Int),(4 Str) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 9, ACPI_RTYPE_STRING}, 4,0}}, + {{"_AL1", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), - {{"_BIX", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int),(4 Str) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16, ACPI_RTYPE_STRING}, 4,0}}, + {{"_AL2", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), - {{"_BLT", 3, 0}}, - {{"_BMA", 1, ACPI_RTYPE_INTEGER}}, - {{"_BMC", 1, 0}}, - {{"_BMD", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (5 Int) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, + {{"_AL3", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), - {{"_BMS", 1, ACPI_RTYPE_INTEGER}}, - {{"_BQC", 0, ACPI_RTYPE_INTEGER}}, - {{"_BST", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0}, 0,0}}, + {{"_AL4", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), - {{"_BTM", 1, ACPI_RTYPE_INTEGER}}, - {{"_BTP", 1, 0}}, - {{"_CBA", 0, ACPI_RTYPE_INTEGER}}, /* See PCI firmware spec 3.0 */ - {{"_CDM", 0, ACPI_RTYPE_INTEGER}}, - {{"_CID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints/Strs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING, 0,0}, 0,0}}, + {{"_AL5", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), - {{"_CRS", 0, ACPI_RTYPE_BUFFER}}, - {{"_CRT", 0, ACPI_RTYPE_INTEGER}}, - {{"_CSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n-1 Int) */ - {{{ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER, 0,0}, 0,0}}, + {{"_AL6", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), - {{"_CST", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(n), n Pkg (1 Buf/3 Int) */ - {{{ACPI_PTYPE2_PKG_COUNT,ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_INTEGER}, 3,0}}, + {{"_AL7", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), - {{"_DCK", 1, ACPI_RTYPE_INTEGER}}, - {{"_DCS", 0, ACPI_RTYPE_INTEGER}}, - {{"_DDC", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER}}, - {{"_DDN", 0, ACPI_RTYPE_STRING}}, - {{"_DGS", 0, ACPI_RTYPE_INTEGER}}, - {{"_DIS", 0, 0}}, - {{"_DMA", 0, ACPI_RTYPE_BUFFER}}, - {{"_DOD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}}, + {{"_AL8", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), - {{"_DOS", 1, 0}}, - {{"_DSM", 4, ACPI_RTYPE_ALL}}, /* Must return a type, but it can be of any type */ - {{"_DSS", 1, 0}}, - {{"_DSW", 3, 0}}, - {{"_DTI", 1, 0}}, - {{"_EC_", 0, ACPI_RTYPE_INTEGER}}, - {{"_EDL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs)*/ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_AL9", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), - {{"_EJ0", 1, 0}}, - {{"_EJ1", 1, 0}}, - {{"_EJ2", 1, 0}}, - {{"_EJ3", 1, 0}}, - {{"_EJ4", 1, 0}}, - {{"_EJD", 0, ACPI_RTYPE_STRING}}, - {{"_FDE", 0, ACPI_RTYPE_BUFFER}}, - {{"_FDI", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (16 Int) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,0}, 0,0}}, + {{"_ALC", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_FDM", 1, 0}}, - {{"_FIF", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0}, 0,0}}, + {{"_ALI", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_FIX", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Ints) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0}, 0,0}}, + {{"_ALP", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_FPS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (1 Int(rev), n Pkg (5 Int) */ - {{{ACPI_PTYPE2_REV_FIXED,ACPI_RTYPE_INTEGER, 5, 0}, 0,0}}, + {{"_ALR", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each 2 (Ints) */ + PACKAGE_INFO (ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 2,0,0,0), - {{"_FSL", 1, 0}}, - {{"_FST", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (3 Int) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3,0}, 0,0}}, + {{"_ALT", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + {{"_ART", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(rev), n Pkg (2 Ref/11 Int) */ + PACKAGE_INFO (ACPI_PTYPE2_REV_FIXED, ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER, 11,0), - {{"_GAI", 0, ACPI_RTYPE_INTEGER}}, - {{"_GHL", 0, ACPI_RTYPE_INTEGER}}, - {{"_GLK", 0, ACPI_RTYPE_INTEGER}}, - {{"_GPD", 0, ACPI_RTYPE_INTEGER}}, - {{"_GPE", 0, ACPI_RTYPE_INTEGER}}, /* _GPE method, not _GPE scope */ - {{"_GSB", 0, ACPI_RTYPE_INTEGER}}, - {{"_GTF", 0, ACPI_RTYPE_BUFFER}}, - {{"_GTM", 0, ACPI_RTYPE_BUFFER}}, - {{"_GTS", 1, 0}}, - {{"_HID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING}}, - {{"_HOT", 0, ACPI_RTYPE_INTEGER}}, - {{"_HPP", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0}, 0,0}}, + {{"_BBN", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_BCL", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0,0,0), + + {{"_BCM", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_BCT", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_BDN", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_BFS", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_BIF", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (9 Int),(4 Str) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 9, ACPI_RTYPE_STRING, 4,0), + + {{"_BIX", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (16 Int),(4 Str) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16, ACPI_RTYPE_STRING, 4,0), + + {{"_BLT", METHOD_3ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_BMA", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_BMC", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_BMD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (5 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5,0,0,0), + + {{"_BMS", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_BQC", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_BST", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0), + + {{"_BTM", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_BTP", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_CBA", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */ + + {{"_CDM", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_CID", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints/Strs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING, 0,0,0,0), + + {{"_CLS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (3 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3,0,0,0), + + {{"_CPC", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints/Bufs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER, 0,0,0,0), + + {{"_CRS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + + {{"_CRT", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_CSD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(n), n-1 Int) */ + PACKAGE_INFO (ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER, 0,0,0,0), + + {{"_CST", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(n), n Pkg (1 Buf/3 Int) */ + PACKAGE_INFO (ACPI_PTYPE2_PKG_COUNT,ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_INTEGER, 3,0), + + {{"_CWS", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_DCK", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_DCS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_DDC", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER)}}, + + {{"_DDN", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_STRING)}}, + + {{"_DEP", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_DGS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_DIS", METHOD_0ARGS, + METHOD_NO_RETURN_VALUE}}, + + {{"_DLM", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each (1 Ref, 0/1 Optional Buf/Ref) */ + PACKAGE_INFO (ACPI_PTYPE2_FIX_VAR, ACPI_RTYPE_REFERENCE, 1, ACPI_RTYPE_REFERENCE | ACPI_RTYPE_BUFFER, 0,0), + + {{"_DMA", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + + {{"_DOD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0,0,0), + + {{"_DOS", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_DSM", METHOD_4ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_PACKAGE), + METHOD_RETURNS (ACPI_RTYPE_ALL)}}, /* Must return a value, but it can be of any type */ + + {{"_DSS", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_DSW", METHOD_3ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_DTI", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_EC_", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_EDL", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs)*/ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_EJ0", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_EJ1", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_EJ2", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_EJ3", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_EJ4", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_EJD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_STRING)}}, + + {{"_ERR", METHOD_3ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_STRING, ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* Internal use only, used by ACPICA test suites */ + + {{"_EVT", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_FDE", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + + {{"_FDI", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (16 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 16,0,0,0), + + {{"_FDM", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_FIF", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0), + + {{"_FIX", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 0,0,0,0), + + {{"_FPS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(rev), n Pkg (5 Int) */ + PACKAGE_INFO (ACPI_PTYPE2_REV_FIXED,ACPI_RTYPE_INTEGER, 5, 0,0,0), + + {{"_FSL", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_FST", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (3 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3,0,0,0), + + {{"_GAI", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_GCP", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_GHL", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_GLK", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_GPD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_GPE", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* _GPE method, not _GPE scope */ + + {{"_GRT", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + + {{"_GSB", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_GTF", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + + {{"_GTM", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + + {{"_GTS", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_GWS", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_HID", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING)}}, + + {{"_HOT", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_HPP", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0), /* - * For _HPX, a single package is returned, containing a Variable-length number - * of sub-packages. Each sub-package contains a PCI record setting. + * For _HPX, a single package is returned, containing a variable-length number + * of subpackages. Each subpackage contains a PCI record setting. * There are several different type of record settings, of different * lengths, but all elements of all settings are Integers. */ - {{"_HPX", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (var Ints) */ - {{{ACPI_PTYPE2_MIN, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, + {{"_HPX", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each (var Ints) */ + PACKAGE_INFO (ACPI_PTYPE2_MIN, ACPI_RTYPE_INTEGER, 5,0,0,0), - {{"_IFT", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */ - {{"_INI", 0, 0}}, - {{"_IRC", 0, 0}}, - {{"_LCK", 1, 0}}, - {{"_LID", 0, ACPI_RTYPE_INTEGER}}, - {{"_MAT", 0, ACPI_RTYPE_BUFFER}}, - {{"_MBM", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (8 Int) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 8,0}, 0,0}}, + {{"_HRV", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_MLS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (2 Str) */ - {{{ACPI_PTYPE2, ACPI_RTYPE_STRING, 2,0}, 0,0}}, + {{"_IFT", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* See IPMI spec */ - {{"_MSG", 1, 0}}, - {{"_MSM", 4, ACPI_RTYPE_INTEGER}}, - {{"_NTT", 0, ACPI_RTYPE_INTEGER}}, - {{"_OFF", 0, 0}}, - {{"_ON_", 0, 0}}, - {{"_OS_", 0, ACPI_RTYPE_STRING}}, - {{"_OSC", 4, ACPI_RTYPE_BUFFER}}, - {{"_OST", 3, 0}}, - {{"_PAI", 1, ACPI_RTYPE_INTEGER}}, - {{"_PCL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_INI", METHOD_0ARGS, + METHOD_NO_RETURN_VALUE}}, - {{"_PCT", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (2 Buf) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2,0}, 0,0}}, + {{"_IRC", METHOD_0ARGS, + METHOD_NO_RETURN_VALUE}}, - {{"_PDC", 1, 0}}, - {{"_PDL", 0, ACPI_RTYPE_INTEGER}}, - {{"_PIC", 1, 0}}, - {{"_PIF", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (3 Int),(3 Str) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, ACPI_RTYPE_STRING}, 3,0}}, + {{"_LCK", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, - {{"_PLD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Bufs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_BUFFER, 0,0}, 0,0}}, + {{"_LID", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_PMC", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (11 Int),(3 Str) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 11, ACPI_RTYPE_STRING}, 3,0}}, + {{"_MAT", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, - {{"_PMD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_MBM", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (8 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 8,0,0,0), - {{"_PMM", 0, ACPI_RTYPE_INTEGER}}, - {{"_PPC", 0, ACPI_RTYPE_INTEGER}}, - {{"_PPE", 0, ACPI_RTYPE_INTEGER}}, /* See dig64 spec */ - {{"_PR0", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_MLS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each (1 Str/1 Buf) */ + PACKAGE_INFO (ACPI_PTYPE2, ACPI_RTYPE_STRING, 1, ACPI_RTYPE_BUFFER, 1,0), - {{"_PR1", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_MSG", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, - {{"_PR2", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_MSM", METHOD_4ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_PR3", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_NTT", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_PRL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_OFF", METHOD_0ARGS, + METHOD_NO_RETURN_VALUE}}, - {{"_PRS", 0, ACPI_RTYPE_BUFFER}}, + {{"_ON_", METHOD_0ARGS, + METHOD_NO_RETURN_VALUE}}, + + {{"_OS_", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_STRING)}}, + + {{"_OSC", METHOD_4ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_BUFFER), + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + + {{"_OST", METHOD_3ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_BUFFER), + METHOD_NO_RETURN_VALUE}}, + + {{"_PAI", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_PCL", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_PCT", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (2 Buf) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2,0,0,0), + + {{"_PDC", METHOD_1ARGS (ACPI_TYPE_BUFFER), + METHOD_NO_RETURN_VALUE}}, + + {{"_PDL", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_PIC", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_PIF", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (3 Int),(3 Str) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, ACPI_RTYPE_STRING, 3,0), + + {{"_PLD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Bufs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_BUFFER, 0,0,0,0), + + {{"_PMC", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (11 Int),(3 Str) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 11, ACPI_RTYPE_STRING, 3,0), + + {{"_PMD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_PMM", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_PPC", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_PPE", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* See dig64 spec */ + + {{"_PR0", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_PR1", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_PR2", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_PR3", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_PRE", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_PRL", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_PRP", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Str, 1 Int/Str/Pkg */ + PACKAGE_INFO (ACPI_PTYPE2, ACPI_RTYPE_STRING, 1, + ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | + ACPI_RTYPE_PACKAGE | ACPI_RTYPE_REFERENCE, 1,0), + + {{"_PRS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, /* * For _PRT, many BIOSs reverse the 3rd and 4th Package elements (Source @@ -448,46 +773,86 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] = * warning, add the ACPI_RTYPE_REFERENCE type to the 4th element (index 3) * in the statement below. */ - {{"_PRT", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (4): Int,Int,Int/Ref,Int */ - {{{ACPI_PTYPE2_FIXED, 4, ACPI_RTYPE_INTEGER,ACPI_RTYPE_INTEGER}, - ACPI_RTYPE_INTEGER | ACPI_RTYPE_REFERENCE, - ACPI_RTYPE_INTEGER}}, + {{"_PRT", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each (4): Int,Int,Int/Ref,Int */ + PACKAGE_INFO (ACPI_PTYPE2_FIXED, 4, ACPI_RTYPE_INTEGER, ACPI_RTYPE_INTEGER, + ACPI_RTYPE_INTEGER | ACPI_RTYPE_REFERENCE, ACPI_RTYPE_INTEGER), - {{"_PRW", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each: Pkg/Int,Int,[Variable-length Refs] (Pkg is Ref/Int) */ - {{{ACPI_PTYPE1_OPTION, 2, ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE, - ACPI_RTYPE_INTEGER}, ACPI_RTYPE_REFERENCE,0}}, + {{"_PRW", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: Pkg/Int,Int,[Variable-length Refs] (Pkg is Ref/Int) */ + PACKAGE_INFO (ACPI_PTYPE1_OPTION, 2, ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE, + ACPI_RTYPE_INTEGER, ACPI_RTYPE_REFERENCE, 0), - {{"_PS0", 0, 0}}, - {{"_PS1", 0, 0}}, - {{"_PS2", 0, 0}}, - {{"_PS3", 0, 0}}, - {{"_PSC", 0, ACPI_RTYPE_INTEGER}}, - {{"_PSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (5 Int) with count */ - {{{ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER,0,0}, 0,0}}, + {{"_PS0", METHOD_0ARGS, + METHOD_NO_RETURN_VALUE}}, - {{"_PSL", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_PS1", METHOD_0ARGS, + METHOD_NO_RETURN_VALUE}}, - {{"_PSR", 0, ACPI_RTYPE_INTEGER}}, - {{"_PSS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each (6 Int) */ - {{{ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 6,0}, 0,0}}, + {{"_PS2", METHOD_0ARGS, + METHOD_NO_RETURN_VALUE}}, - {{"_PSV", 0, ACPI_RTYPE_INTEGER}}, - {{"_PSW", 1, 0}}, - {{"_PTC", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (2 Buf) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2,0}, 0,0}}, + {{"_PS3", METHOD_0ARGS, + METHOD_NO_RETURN_VALUE}}, - {{"_PTP", 2, ACPI_RTYPE_INTEGER}}, - {{"_PTS", 1, 0}}, - {{"_PUR", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (2 Int) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0}, 0,0}}, + {{"_PSC", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_PXM", 0, ACPI_RTYPE_INTEGER}}, - {{"_REG", 2, 0}}, - {{"_REV", 0, ACPI_RTYPE_INTEGER}}, - {{"_RMV", 0, ACPI_RTYPE_INTEGER}}, - {{"_ROM", 2, ACPI_RTYPE_BUFFER}}, - {{"_RTV", 0, ACPI_RTYPE_INTEGER}}, + {{"_PSD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each (5 Int) with count */ + PACKAGE_INFO (ACPI_PTYPE2_COUNT, ACPI_RTYPE_INTEGER, 0,0,0,0), + + {{"_PSE", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_PSL", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_PSR", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_PSS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each (6 Int) */ + PACKAGE_INFO (ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 6,0,0,0), + + {{"_PSV", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_PSW", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_PTC", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (2 Buf) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_BUFFER, 2,0,0,0), + + {{"_PTP", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_PTS", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_PUR", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (2 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0), + + {{"_PXM", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_REG", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_REV", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_RMV", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_ROM", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + + {{"_RTV", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* * For _S0_ through _S5_, the ACPI spec defines a return Package @@ -495,106 +860,283 @@ static const ACPI_PREDEFINED_INFO PredefinedNames[] = * Allow this by making the objects "Variable-length length", but all elements * must be Integers. */ - {{"_S0_", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (1 Int) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0}, 0,0}}, + {{"_S0_", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0), - {{"_S1_", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (1 Int) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0}, 0,0}}, + {{"_S1_", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0), - {{"_S2_", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (1 Int) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0}, 0,0}}, + {{"_S2_", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0), - {{"_S3_", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (1 Int) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0}, 0,0}}, + {{"_S3_", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0), - {{"_S4_", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (1 Int) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0}, 0,0}}, + {{"_S4_", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0), - {{"_S5_", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (1 Int) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0}, 0,0}}, + {{"_S5_", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER, 1,0,0,0), - {{"_S1D", 0, ACPI_RTYPE_INTEGER}}, - {{"_S2D", 0, ACPI_RTYPE_INTEGER}}, - {{"_S3D", 0, ACPI_RTYPE_INTEGER}}, - {{"_S4D", 0, ACPI_RTYPE_INTEGER}}, - {{"_S0W", 0, ACPI_RTYPE_INTEGER}}, - {{"_S1W", 0, ACPI_RTYPE_INTEGER}}, - {{"_S2W", 0, ACPI_RTYPE_INTEGER}}, - {{"_S3W", 0, ACPI_RTYPE_INTEGER}}, - {{"_S4W", 0, ACPI_RTYPE_INTEGER}}, - {{"_SBS", 0, ACPI_RTYPE_INTEGER}}, - {{"_SCP", 0x13, 0}}, /* Acpi 1.0 allowed 1 arg. Acpi 3.0 expanded to 3 args. Allow both. */ - /* Note: the 3-arg definition may be removed for ACPI 4.0 */ - {{"_SDD", 1, 0}}, - {{"_SEG", 0, ACPI_RTYPE_INTEGER}}, - {{"_SHL", 1, ACPI_RTYPE_INTEGER}}, - {{"_SLI", 0, ACPI_RTYPE_BUFFER}}, - {{"_SPD", 1, ACPI_RTYPE_INTEGER}}, - {{"_SRS", 1, 0}}, - {{"_SRV", 0, ACPI_RTYPE_INTEGER}}, /* See IPMI spec */ - {{"_SST", 1, 0}}, - {{"_STA", 0, ACPI_RTYPE_INTEGER}}, - {{"_STM", 3, 0}}, - {{"_STP", 2, ACPI_RTYPE_INTEGER}}, - {{"_STR", 0, ACPI_RTYPE_BUFFER}}, - {{"_STV", 2, ACPI_RTYPE_INTEGER}}, - {{"_SUN", 0, ACPI_RTYPE_INTEGER}}, - {{"_SWS", 0, ACPI_RTYPE_INTEGER}}, - {{"_TC1", 0, ACPI_RTYPE_INTEGER}}, - {{"_TC2", 0, ACPI_RTYPE_INTEGER}}, - {{"_TDL", 0, ACPI_RTYPE_INTEGER}}, - {{"_TIP", 1, ACPI_RTYPE_INTEGER}}, - {{"_TIV", 1, ACPI_RTYPE_INTEGER}}, - {{"_TMP", 0, ACPI_RTYPE_INTEGER}}, - {{"_TPC", 0, ACPI_RTYPE_INTEGER}}, - {{"_TPT", 1, 0}}, - {{"_TRT", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 2Ref/6Int */ - {{{ACPI_PTYPE2, ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER}, 6, 0}}, + {{"_S1D", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_TSD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5Int with count */ - {{{ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, + {{"_S2D", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_TSP", 0, ACPI_RTYPE_INTEGER}}, - {{"_TSS", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Pkgs) each 5Int */ - {{{ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 5,0}, 0,0}}, + {{"_S3D", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_TST", 0, ACPI_RTYPE_INTEGER}}, - {{"_TTS", 1, 0}}, - {{"_TZD", 0, ACPI_RTYPE_PACKAGE}}, /* Variable-length (Refs) */ - {{{ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0}, 0,0}}, + {{"_S4D", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_TZM", 0, ACPI_RTYPE_REFERENCE}}, - {{"_TZP", 0, ACPI_RTYPE_INTEGER}}, - {{"_UID", 0, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING}}, - {{"_UPC", 0, ACPI_RTYPE_PACKAGE}}, /* Fixed-length (4 Int) */ - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0}, 0,0}}, + {{"_S0W", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, - {{"_UPD", 0, ACPI_RTYPE_INTEGER}}, - {{"_UPP", 0, ACPI_RTYPE_INTEGER}}, - {{"_VPO", 0, ACPI_RTYPE_INTEGER}}, + {{"_S1W", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_S2W", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_S3W", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_S4W", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_SBS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_SCP", METHOD_1ARGS (ACPI_TYPE_INTEGER) | ARG_COUNT_IS_MINIMUM, + METHOD_NO_RETURN_VALUE}}, /* Acpi 1.0 allowed 1 integer arg. Acpi 3.0 expanded to 3 args. Allow both. */ + + {{"_SDD", METHOD_1ARGS (ACPI_TYPE_BUFFER), + METHOD_NO_RETURN_VALUE}}, + + {{"_SEG", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_SHL", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_SLI", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + + {{"_SPD", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_SRS", METHOD_1ARGS (ACPI_TYPE_BUFFER), + METHOD_NO_RETURN_VALUE}}, + + {{"_SRT", METHOD_1ARGS (ACPI_TYPE_BUFFER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_SRV", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* See IPMI spec */ + + {{"_SST", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_STA", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_STM", METHOD_3ARGS (ACPI_TYPE_BUFFER, ACPI_TYPE_BUFFER, ACPI_TYPE_BUFFER), + METHOD_NO_RETURN_VALUE}}, + + {{"_STP", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_STR", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, + + {{"_STV", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_SUB", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_STRING)}}, + + {{"_SUN", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_SWS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_TC1", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_TC2", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_TDL", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_TIP", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_TIV", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_TMP", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_TPC", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_TPT", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_TRT", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each 2 Ref/6 Int */ + PACKAGE_INFO (ACPI_PTYPE2, ACPI_RTYPE_REFERENCE, 2, ACPI_RTYPE_INTEGER, 6, 0), + + {{"_TSD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each 5 Int with count */ + PACKAGE_INFO (ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0,0,0), + + {{"_TSP", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_TSS", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each 5 Int */ + PACKAGE_INFO (ACPI_PTYPE2, ACPI_RTYPE_INTEGER, 5,0,0,0), + + {{"_TST", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_TTS", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_NO_RETURN_VALUE}}, + + {{"_TZD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */ + PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0), + + {{"_TZM", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_REFERENCE)}}, + + {{"_TZP", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_UID", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING)}}, + + {{"_UPC", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */ + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0), + + {{"_UPD", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_UPP", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, + + {{"_VPO", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_INTEGER)}}, /* Acpi 1.0 defined _WAK with no return value. Later, it was changed to return a package */ - {{"_WAK", 1, ACPI_RTYPE_NONE | ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE}}, - {{{ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0}, 0,0}}, /* Fixed-length (2 Int), but is optional */ + {{"_WAK", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_NONE | ACPI_RTYPE_INTEGER | ACPI_RTYPE_PACKAGE)}}, + PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0), /* Fixed-length (2 Int), but is optional */ /* _WDG/_WED are MS extensions defined by "Windows Instrumentation" */ - {{"_WDG", 0, ACPI_RTYPE_BUFFER}}, - {{"_WED", 1, ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER}}, + {{"_WDG", METHOD_0ARGS, + METHOD_RETURNS (ACPI_RTYPE_BUFFER)}}, - {{{0,0,0,0}, 0,0}} /* Table terminator */ + {{"_WED", METHOD_1ARGS (ACPI_TYPE_INTEGER), + METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER)}}, + + PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */ +}; +#else +extern const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[]; +#endif + + +#if (defined ACPI_CREATE_RESOURCE_TABLE && defined ACPI_APPLICATION) +/****************************************************************************** + * + * Predefined names for use in Resource Descriptors. These names do not + * appear in the global Predefined Name table (since these names never + * appear in actual AML byte code, only in the original ASL) + * + * Note: Used by iASL compiler and AcpiHelp utility only. + * + *****************************************************************************/ + +const ACPI_PREDEFINED_INFO AcpiGbl_ResourceNames[] = +{ + {{"_ADR", WIDTH_16 | WIDTH_64, 0}}, + {{"_ALN", WIDTH_8 | WIDTH_16 | WIDTH_32, 0}}, + {{"_ASI", WIDTH_8, 0}}, + {{"_ASZ", WIDTH_8, 0}}, + {{"_ATT", WIDTH_64, 0}}, + {{"_BAS", WIDTH_16 | WIDTH_32, 0}}, + {{"_BM_", WIDTH_1, 0}}, + {{"_DBT", WIDTH_16, 0}}, /* Acpi 5.0 */ + {{"_DEC", WIDTH_1, 0}}, + {{"_DMA", WIDTH_8, 0}}, + {{"_DPL", WIDTH_1, 0}}, /* Acpi 5.0 */ + {{"_DRS", WIDTH_16, 0}}, /* Acpi 5.0 */ + {{"_END", WIDTH_1, 0}}, /* Acpi 5.0 */ + {{"_FLC", WIDTH_2, 0}}, /* Acpi 5.0 */ + {{"_GRA", WIDTH_ADDRESS, 0}}, + {{"_HE_", WIDTH_1, 0}}, + {{"_INT", WIDTH_16 | WIDTH_32, 0}}, + {{"_IOR", WIDTH_2, 0}}, /* Acpi 5.0 */ + {{"_LEN", WIDTH_8 | WIDTH_ADDRESS, 0}}, + {{"_LIN", WIDTH_8, 0}}, /* Acpi 5.0 */ + {{"_LL_", WIDTH_1, 0}}, + {{"_MAF", WIDTH_1, 0}}, + {{"_MAX", WIDTH_ADDRESS, 0}}, + {{"_MEM", WIDTH_2, 0}}, + {{"_MIF", WIDTH_1, 0}}, + {{"_MIN", WIDTH_ADDRESS, 0}}, + {{"_MOD", WIDTH_1, 0}}, /* Acpi 5.0 */ + {{"_MTP", WIDTH_2, 0}}, + {{"_PAR", WIDTH_8, 0}}, /* Acpi 5.0 */ + {{"_PHA", WIDTH_1, 0}}, /* Acpi 5.0 */ + {{"_PIN", WIDTH_16, 0}}, /* Acpi 5.0 */ + {{"_PPI", WIDTH_8, 0}}, /* Acpi 5.0 */ + {{"_POL", WIDTH_1 | WIDTH_2, 0}}, /* Acpi 5.0 */ + {{"_RBO", WIDTH_8, 0}}, + {{"_RBW", WIDTH_8, 0}}, + {{"_RNG", WIDTH_1, 0}}, + {{"_RT_", WIDTH_8, 0}}, /* Acpi 3.0 */ + {{"_RW_", WIDTH_1, 0}}, + {{"_RXL", WIDTH_16, 0}}, /* Acpi 5.0 */ + {{"_SHR", WIDTH_2, 0}}, + {{"_SIZ", WIDTH_2, 0}}, + {{"_SLV", WIDTH_1, 0}}, /* Acpi 5.0 */ + {{"_SPE", WIDTH_32, 0}}, /* Acpi 5.0 */ + {{"_STB", WIDTH_2, 0}}, /* Acpi 5.0 */ + {{"_TRA", WIDTH_ADDRESS, 0}}, + {{"_TRS", WIDTH_1, 0}}, + {{"_TSF", WIDTH_8, 0}}, /* Acpi 3.0 */ + {{"_TTP", WIDTH_1, 0}}, + {{"_TXL", WIDTH_16, 0}}, /* Acpi 5.0 */ + {{"_TYP", WIDTH_2 | WIDTH_16, 0}}, + {{"_VEN", VARIABLE_DATA, 0}}, /* Acpi 5.0 */ + PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */ }; -#if 0 - - /* This is an internally implemented control method, no need to check */ - {{"_OSI", 1, ACPI_RTYPE_INTEGER}}, - - /* TBD: */ - - _PRT - currently ignore reversed entries. Attempt to fix here? - Think about possibly fixing package elements like _BIF, etc. -#endif +static const ACPI_PREDEFINED_INFO AcpiGbl_ScopeNames[] = { + {{"_GPE", 0, 0}}, + {{"_PR_", 0, 0}}, + {{"_SB_", 0, 0}}, + {{"_SI_", 0, 0}}, + {{"_TZ_", 0, 0}}, + PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */ +}; +#else +extern const ACPI_PREDEFINED_INFO AcpiGbl_ResourceNames[]; #endif + #endif diff --git a/reactos/drivers/bus/acpi/acpica/include/acresrc.h b/reactos/drivers/bus/acpi/acpica/include/acresrc.h index 05ff90c0c1c..d1366f0814c 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acresrc.h +++ b/reactos/drivers/bus/acpi/acpica/include/acresrc.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -148,28 +148,42 @@ typedef const struct acpi_rsconvert_info /* Resource conversion opcodes */ -#define ACPI_RSC_INITGET 0 -#define ACPI_RSC_INITSET 1 -#define ACPI_RSC_FLAGINIT 2 -#define ACPI_RSC_1BITFLAG 3 -#define ACPI_RSC_2BITFLAG 4 -#define ACPI_RSC_COUNT 5 -#define ACPI_RSC_COUNT16 6 -#define ACPI_RSC_LENGTH 7 -#define ACPI_RSC_MOVE8 8 -#define ACPI_RSC_MOVE16 9 -#define ACPI_RSC_MOVE32 10 -#define ACPI_RSC_MOVE64 11 -#define ACPI_RSC_SET8 12 -#define ACPI_RSC_DATA8 13 -#define ACPI_RSC_ADDRESS 14 -#define ACPI_RSC_SOURCE 15 -#define ACPI_RSC_SOURCEX 16 -#define ACPI_RSC_BITMASK 17 -#define ACPI_RSC_BITMASK16 18 -#define ACPI_RSC_EXIT_NE 19 -#define ACPI_RSC_EXIT_LE 20 -#define ACPI_RSC_EXIT_EQ 21 +typedef enum +{ + ACPI_RSC_INITGET = 0, + ACPI_RSC_INITSET, + ACPI_RSC_FLAGINIT, + ACPI_RSC_1BITFLAG, + ACPI_RSC_2BITFLAG, + ACPI_RSC_3BITFLAG, + ACPI_RSC_ADDRESS, + ACPI_RSC_BITMASK, + ACPI_RSC_BITMASK16, + ACPI_RSC_COUNT, + ACPI_RSC_COUNT16, + ACPI_RSC_COUNT_GPIO_PIN, + ACPI_RSC_COUNT_GPIO_RES, + ACPI_RSC_COUNT_GPIO_VEN, + ACPI_RSC_COUNT_SERIAL_RES, + ACPI_RSC_COUNT_SERIAL_VEN, + ACPI_RSC_DATA8, + ACPI_RSC_EXIT_EQ, + ACPI_RSC_EXIT_LE, + ACPI_RSC_EXIT_NE, + ACPI_RSC_LENGTH, + ACPI_RSC_MOVE_GPIO_PIN, + ACPI_RSC_MOVE_GPIO_RES, + ACPI_RSC_MOVE_SERIAL_RES, + ACPI_RSC_MOVE_SERIAL_VEN, + ACPI_RSC_MOVE8, + ACPI_RSC_MOVE16, + ACPI_RSC_MOVE32, + ACPI_RSC_MOVE64, + ACPI_RSC_SET8, + ACPI_RSC_SOURCE, + ACPI_RSC_SOURCEX + +} ACPI_RSCONVERT_OPCODES; /* Resource Conversion sub-opcodes */ @@ -182,6 +196,9 @@ typedef const struct acpi_rsconvert_info #define AML_OFFSET(f) (UINT8) ACPI_OFFSET (AML_RESOURCE,f) +/* + * Individual entry for the resource dump tables + */ typedef const struct acpi_rsdump_info { UINT8 Opcode; @@ -193,20 +210,27 @@ typedef const struct acpi_rsdump_info /* Values for the Opcode field above */ -#define ACPI_RSD_TITLE 0 -#define ACPI_RSD_LITERAL 1 -#define ACPI_RSD_STRING 2 -#define ACPI_RSD_UINT8 3 -#define ACPI_RSD_UINT16 4 -#define ACPI_RSD_UINT32 5 -#define ACPI_RSD_UINT64 6 -#define ACPI_RSD_1BITFLAG 7 -#define ACPI_RSD_2BITFLAG 8 -#define ACPI_RSD_SHORTLIST 9 -#define ACPI_RSD_LONGLIST 10 -#define ACPI_RSD_DWORDLIST 11 -#define ACPI_RSD_ADDRESS 12 -#define ACPI_RSD_SOURCE 13 +typedef enum +{ + ACPI_RSD_TITLE = 0, + ACPI_RSD_1BITFLAG, + ACPI_RSD_2BITFLAG, + ACPI_RSD_3BITFLAG, + ACPI_RSD_ADDRESS, + ACPI_RSD_DWORDLIST, + ACPI_RSD_LITERAL, + ACPI_RSD_LONGLIST, + ACPI_RSD_SHORTLIST, + ACPI_RSD_SHORTLISTX, + ACPI_RSD_SOURCE, + ACPI_RSD_STRING, + ACPI_RSD_UINT8, + ACPI_RSD_UINT16, + ACPI_RSD_UINT32, + ACPI_RSD_UINT64, + ACPI_RSD_WORDLIST + +} ACPI_RSDUMP_OPCODES; /* restore default alignment */ @@ -216,13 +240,16 @@ typedef const struct acpi_rsdump_info /* Resource tables indexed by internal resource type */ extern const UINT8 AcpiGbl_AmlResourceSizes[]; +extern const UINT8 AcpiGbl_AmlResourceSerialBusSizes[]; extern ACPI_RSCONVERT_INFO *AcpiGbl_SetResourceDispatch[]; /* Resource tables indexed by raw AML resource descriptor type */ extern const UINT8 AcpiGbl_ResourceStructSizes[]; +extern const UINT8 AcpiGbl_ResourceStructSerialBusSizes[]; extern ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[]; +extern ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[]; typedef struct acpi_vendor_walk_info { @@ -243,7 +270,7 @@ AcpiRsCreateResourceList ( ACPI_STATUS AcpiRsCreateAmlResources ( - ACPI_RESOURCE *LinkedListBuffer, + ACPI_BUFFER *ResourceList, ACPI_BUFFER *OutputBuffer); ACPI_STATUS @@ -281,6 +308,10 @@ AcpiRsSetSrsMethodData ( ACPI_NAMESPACE_NODE *Node, ACPI_BUFFER *RetBuffer); +ACPI_STATUS +AcpiRsGetAeiMethodData ( + ACPI_NAMESPACE_NODE *Node, + ACPI_BUFFER *RetBuffer); /* * rscalc @@ -293,7 +324,8 @@ AcpiRsGetListLength ( ACPI_STATUS AcpiRsGetAmlLength ( - ACPI_RESOURCE *LinkedListBuffer, + ACPI_RESOURCE *ResourceList, + ACPI_SIZE ResourceListSize, ACPI_SIZE *SizeNeeded); ACPI_STATUS @@ -307,7 +339,7 @@ AcpiRsConvertAmlToResources ( UINT32 Length, UINT32 Offset, UINT8 ResourceIndex, - void *Context); + void **Context); ACPI_STATUS AcpiRsConvertResourcesToAml ( @@ -421,6 +453,11 @@ extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[]; extern ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertGpio[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[]; +extern ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[]; /* These resources require separate get/set tables */ @@ -439,20 +476,24 @@ extern ACPI_RSCONVERT_INFO AcpiRsSetVendor[]; * rsinfo */ extern ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[]; +extern ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[]; /* - * rsdump + * rsdumpinfo */ extern ACPI_RSDUMP_INFO AcpiRsDumpIrq[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpPrt[]; extern ACPI_RSDUMP_INFO AcpiRsDumpDma[]; extern ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[]; extern ACPI_RSDUMP_INFO AcpiRsDumpEndDpf[]; extern ACPI_RSDUMP_INFO AcpiRsDumpIo[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[]; extern ACPI_RSDUMP_INFO AcpiRsDumpFixedIo[]; extern ACPI_RSDUMP_INFO AcpiRsDumpVendor[]; extern ACPI_RSDUMP_INFO AcpiRsDumpEndTag[]; extern ACPI_RSDUMP_INFO AcpiRsDumpMemory24[]; extern ACPI_RSDUMP_INFO AcpiRsDumpMemory32[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[]; extern ACPI_RSDUMP_INFO AcpiRsDumpFixedMemory32[]; extern ACPI_RSDUMP_INFO AcpiRsDumpAddress16[]; extern ACPI_RSDUMP_INFO AcpiRsDumpAddress32[]; @@ -460,6 +501,13 @@ extern ACPI_RSDUMP_INFO AcpiRsDumpAddress64[]; extern ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[]; extern ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[]; extern ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpGpio[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[]; +extern ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[]; #endif #endif /* __ACRESRC_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acrestyp.h b/reactos/drivers/bus/acpi/acpica/include/acrestyp.h index d85e4a9b30f..9cf948bc72f 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acrestyp.h +++ b/reactos/drivers/bus/acpi/acpica/include/acrestyp.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -134,11 +134,14 @@ typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descr #define ACPI_WRITE_COMBINING_MEMORY (UINT8) 0x02 #define ACPI_PREFETCHABLE_MEMORY (UINT8) 0x03 +/*! [Begin] no source code translation */ /* * IO Attributes * The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh. * The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh. */ +/*! [End] no source code translation !*/ + #define ACPI_NON_ISA_ONLY_RANGES (UINT8) 0x01 #define ACPI_ISA_ONLY_RANGES (UINT8) 0x02 #define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES) @@ -154,17 +157,30 @@ typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descr #define ACPI_DECODE_16 (UINT8) 0x01 /* 16-bit IO address decode */ /* - * IRQ Attributes + * Interrupt attributes - used in multiple descriptors */ + +/* Triggering */ + #define ACPI_LEVEL_SENSITIVE (UINT8) 0x00 #define ACPI_EDGE_SENSITIVE (UINT8) 0x01 +/* Polarity */ + #define ACPI_ACTIVE_HIGH (UINT8) 0x00 #define ACPI_ACTIVE_LOW (UINT8) 0x01 +#define ACPI_ACTIVE_BOTH (UINT8) 0x02 + +/* Sharing */ #define ACPI_EXCLUSIVE (UINT8) 0x00 #define ACPI_SHARED (UINT8) 0x01 +/* Wake */ + +#define ACPI_NOT_WAKE_CAPABLE (UINT8) 0x00 +#define ACPI_WAKE_CAPABLE (UINT8) 0x01 + /* * DMA Attributes */ @@ -200,6 +216,8 @@ typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descr #define ACPI_POS_DECODE (UINT8) 0x00 #define ACPI_SUB_DECODE (UINT8) 0x01 +/* Producer/Consumer */ + #define ACPI_PRODUCER (UINT8) 0x00 #define ACPI_CONSUMER (UINT8) 0x01 @@ -234,12 +252,13 @@ typedef struct acpi_resource_irq UINT8 Triggering; UINT8 Polarity; UINT8 Sharable; + UINT8 WakeCapable; UINT8 InterruptCount; UINT8 Interrupts[1]; } ACPI_RESOURCE_IRQ; -typedef struct ACPI_RESOURCE_DMA +typedef struct acpi_resource_dma { UINT8 Type; UINT8 BusMaster; @@ -281,6 +300,24 @@ typedef struct acpi_resource_fixed_io } ACPI_RESOURCE_FIXED_IO; +typedef struct acpi_resource_fixed_dma +{ + UINT16 RequestLines; + UINT16 Channels; + UINT8 Width; + +} ACPI_RESOURCE_FIXED_DMA; + +/* Values for Width field above */ + +#define ACPI_DMA_WIDTH8 0 +#define ACPI_DMA_WIDTH16 1 +#define ACPI_DMA_WIDTH32 2 +#define ACPI_DMA_WIDTH64 3 +#define ACPI_DMA_WIDTH128 4 +#define ACPI_DMA_WIDTH256 5 + + typedef struct acpi_resource_vendor { UINT16 ByteLength; @@ -441,6 +478,7 @@ typedef struct acpi_resource_extended_irq UINT8 Triggering; UINT8 Polarity; UINT8 Sharable; + UINT8 WakeCapable; UINT8 InterruptCount; ACPI_RESOURCE_SOURCE ResourceSource; UINT32 Interrupts[1]; @@ -457,6 +495,185 @@ typedef struct acpi_resource_generic_register } ACPI_RESOURCE_GENERIC_REGISTER; +typedef struct acpi_resource_gpio +{ + UINT8 RevisionId; + UINT8 ConnectionType; + UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */ + UINT8 PinConfig; + UINT8 Sharable; /* For values, see Interrupt Attributes above */ + UINT8 WakeCapable; /* For values, see Interrupt Attributes above */ + UINT8 IoRestriction; + UINT8 Triggering; /* For values, see Interrupt Attributes above */ + UINT8 Polarity; /* For values, see Interrupt Attributes above */ + UINT16 DriveStrength; + UINT16 DebounceTimeout; + UINT16 PinTableLength; + UINT16 VendorLength; + ACPI_RESOURCE_SOURCE ResourceSource; + UINT16 *PinTable; + UINT8 *VendorData; + +} ACPI_RESOURCE_GPIO; + +/* Values for GPIO ConnectionType field above */ + +#define ACPI_RESOURCE_GPIO_TYPE_INT 0 +#define ACPI_RESOURCE_GPIO_TYPE_IO 1 + +/* Values for PinConfig field above */ + +#define ACPI_PIN_CONFIG_DEFAULT 0 +#define ACPI_PIN_CONFIG_PULLUP 1 +#define ACPI_PIN_CONFIG_PULLDOWN 2 +#define ACPI_PIN_CONFIG_NOPULL 3 + +/* Values for IoRestriction field above */ + +#define ACPI_IO_RESTRICT_NONE 0 +#define ACPI_IO_RESTRICT_INPUT 1 +#define ACPI_IO_RESTRICT_OUTPUT 2 +#define ACPI_IO_RESTRICT_NONE_PRESERVE 3 + + +/* Common structure for I2C, SPI, and UART serial descriptors */ + +#define ACPI_RESOURCE_SERIAL_COMMON \ + UINT8 RevisionId; \ + UINT8 Type; \ + UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */\ + UINT8 SlaveMode; \ + UINT8 TypeRevisionId; \ + UINT16 TypeDataLength; \ + UINT16 VendorLength; \ + ACPI_RESOURCE_SOURCE ResourceSource; \ + UINT8 *VendorData; + +typedef struct acpi_resource_common_serialbus +{ + ACPI_RESOURCE_SERIAL_COMMON + +} ACPI_RESOURCE_COMMON_SERIALBUS; + +/* Values for the Type field above */ + +#define ACPI_RESOURCE_SERIAL_TYPE_I2C 1 +#define ACPI_RESOURCE_SERIAL_TYPE_SPI 2 +#define ACPI_RESOURCE_SERIAL_TYPE_UART 3 + +/* Values for SlaveMode field above */ + +#define ACPI_CONTROLLER_INITIATED 0 +#define ACPI_DEVICE_INITIATED 1 + + +typedef struct acpi_resource_i2c_serialbus +{ + ACPI_RESOURCE_SERIAL_COMMON + UINT8 AccessMode; + UINT16 SlaveAddress; + UINT32 ConnectionSpeed; + +} ACPI_RESOURCE_I2C_SERIALBUS; + +/* Values for AccessMode field above */ + +#define ACPI_I2C_7BIT_MODE 0 +#define ACPI_I2C_10BIT_MODE 1 + + +typedef struct acpi_resource_spi_serialbus +{ + ACPI_RESOURCE_SERIAL_COMMON + UINT8 WireMode; + UINT8 DevicePolarity; + UINT8 DataBitLength; + UINT8 ClockPhase; + UINT8 ClockPolarity; + UINT16 DeviceSelection; + UINT32 ConnectionSpeed; + +} ACPI_RESOURCE_SPI_SERIALBUS; + +/* Values for WireMode field above */ + +#define ACPI_SPI_4WIRE_MODE 0 +#define ACPI_SPI_3WIRE_MODE 1 + +/* Values for DevicePolarity field above */ + +#define ACPI_SPI_ACTIVE_LOW 0 +#define ACPI_SPI_ACTIVE_HIGH 1 + +/* Values for ClockPhase field above */ + +#define ACPI_SPI_FIRST_PHASE 0 +#define ACPI_SPI_SECOND_PHASE 1 + +/* Values for ClockPolarity field above */ + +#define ACPI_SPI_START_LOW 0 +#define ACPI_SPI_START_HIGH 1 + + +typedef struct acpi_resource_uart_serialbus +{ + ACPI_RESOURCE_SERIAL_COMMON + UINT8 Endian; + UINT8 DataBits; + UINT8 StopBits; + UINT8 FlowControl; + UINT8 Parity; + UINT8 LinesEnabled; + UINT16 RxFifoSize; + UINT16 TxFifoSize; + UINT32 DefaultBaudRate; + +} ACPI_RESOURCE_UART_SERIALBUS; + +/* Values for Endian field above */ + +#define ACPI_UART_LITTLE_ENDIAN 0 +#define ACPI_UART_BIG_ENDIAN 1 + +/* Values for DataBits field above */ + +#define ACPI_UART_5_DATA_BITS 0 +#define ACPI_UART_6_DATA_BITS 1 +#define ACPI_UART_7_DATA_BITS 2 +#define ACPI_UART_8_DATA_BITS 3 +#define ACPI_UART_9_DATA_BITS 4 + +/* Values for StopBits field above */ + +#define ACPI_UART_NO_STOP_BITS 0 +#define ACPI_UART_1_STOP_BIT 1 +#define ACPI_UART_1P5_STOP_BITS 2 +#define ACPI_UART_2_STOP_BITS 3 + +/* Values for FlowControl field above */ + +#define ACPI_UART_FLOW_CONTROL_NONE 0 +#define ACPI_UART_FLOW_CONTROL_HW 1 +#define ACPI_UART_FLOW_CONTROL_XON_XOFF 2 + +/* Values for Parity field above */ + +#define ACPI_UART_PARITY_NONE 0 +#define ACPI_UART_PARITY_EVEN 1 +#define ACPI_UART_PARITY_ODD 2 +#define ACPI_UART_PARITY_MARK 3 +#define ACPI_UART_PARITY_SPACE 4 + +/* Values for LinesEnabled bitfield above */ + +#define ACPI_UART_CARRIER_DETECT (1<<2) +#define ACPI_UART_RING_INDICATOR (1<<3) +#define ACPI_UART_DATA_SET_READY (1<<4) +#define ACPI_UART_DATA_TERMINAL_READY (1<<5) +#define ACPI_UART_CLEAR_TO_SEND (1<<6) +#define ACPI_UART_REQUEST_TO_SEND (1<<7) + /* ACPI_RESOURCE_TYPEs */ @@ -477,7 +694,10 @@ typedef struct acpi_resource_generic_register #define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */ #define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15 #define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16 -#define ACPI_RESOURCE_TYPE_MAX 16 +#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */ +#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */ +#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */ +#define ACPI_RESOURCE_TYPE_MAX 19 /* Master union for resource descriptors */ @@ -488,6 +708,7 @@ typedef union acpi_resource_data ACPI_RESOURCE_START_DEPENDENT StartDpf; ACPI_RESOURCE_IO Io; ACPI_RESOURCE_FIXED_IO FixedIo; + ACPI_RESOURCE_FIXED_DMA FixedDma; ACPI_RESOURCE_VENDOR Vendor; ACPI_RESOURCE_VENDOR_TYPED VendorTyped; ACPI_RESOURCE_END_TAG EndTag; @@ -500,6 +721,11 @@ typedef union acpi_resource_data ACPI_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64; ACPI_RESOURCE_EXTENDED_IRQ ExtendedIrq; ACPI_RESOURCE_GENERIC_REGISTER GenericReg; + ACPI_RESOURCE_GPIO Gpio; + ACPI_RESOURCE_I2C_SERIALBUS I2cSerialBus; + ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus; + ACPI_RESOURCE_UART_SERIALBUS UartSerialBus; + ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus; /* Common fields */ @@ -527,7 +753,10 @@ typedef struct acpi_resource #define ACPI_RS_SIZE_MIN (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) #define ACPI_RS_SIZE(Type) (UINT32) (ACPI_RS_SIZE_NO_DATA + sizeof (Type)) -#define ACPI_NEXT_RESOURCE(Res) (ACPI_RESOURCE *)((UINT8 *) Res + Res->Length) +/* Macro for walking resource templates with multiple descriptors */ + +#define ACPI_NEXT_RESOURCE(Res) \ + ACPI_ADD_PTR (ACPI_RESOURCE, (Res), (Res)->Length) typedef struct acpi_pci_routing_table @@ -541,4 +770,3 @@ typedef struct acpi_pci_routing_table } ACPI_PCI_ROUTING_TABLE; #endif /* __ACRESTYP_H__ */ - diff --git a/reactos/drivers/bus/acpi/acpica/include/acstruct.h b/reactos/drivers/bus/acpi/acpica/include/acstruct.h index e90d8ecedfa..fd8eab016d1 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acstruct.h +++ b/reactos/drivers/bus/acpi/acpica/include/acstruct.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -126,7 +126,7 @@ /* - * Walk state - current state of a parse tree walk. Used for both a leisurely + * Walk state - current state of a parse tree walk. Used for both a leisurely * stroll through the tree (for whatever reason), and for control method * execution. */ @@ -211,6 +211,9 @@ typedef struct acpi_init_walk_info UINT32 TableIndex; UINT32 ObjectCount; UINT32 MethodCount; + UINT32 SerialMethodCount; + UINT32 NonSerialMethodCount; + UINT32 SerializedMethodCount; UINT32 DeviceCount; UINT32 OpRegionCount; UINT32 FieldCount; @@ -267,27 +270,43 @@ typedef union acpi_aml_operands /* - * Structure used to pass object evaluation parameters. + * Structure used to pass object evaluation information and parameters. * Purpose is to reduce CPU stack use. */ typedef struct acpi_evaluate_info { - ACPI_NAMESPACE_NODE *PrefixNode; - char *Pathname; - ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_OPERAND_OBJECT **Parameters; - ACPI_NAMESPACE_NODE *ResolvedNode; - ACPI_OPERAND_OBJECT *ReturnObject; - UINT8 ParamCount; - UINT8 PassNumber; - UINT8 ReturnObjectType; - UINT8 Flags; + /* The first 3 elements are passed by the caller to AcpiNsEvaluate */ + + ACPI_NAMESPACE_NODE *PrefixNode; /* Input: starting node */ + char *RelativePathname; /* Input: path relative to PrefixNode */ + ACPI_OPERAND_OBJECT **Parameters; /* Input: argument list */ + + ACPI_NAMESPACE_NODE *Node; /* Resolved node (PrefixNode:RelativePathname) */ + ACPI_OPERAND_OBJECT *ObjDesc; /* Object attached to the resolved node */ + char *FullPathname; /* Full pathname of the resolved node */ + + const ACPI_PREDEFINED_INFO *Predefined; /* Used if Node is a predefined name */ + ACPI_OPERAND_OBJECT *ReturnObject; /* Object returned from the evaluation */ + union acpi_operand_object *ParentPackage; /* Used if return object is a Package */ + + UINT32 ReturnFlags; /* Used for return value analysis */ + UINT32 ReturnBtype; /* Bitmapped type of the returned object */ + UINT16 ParamCount; /* Count of the input argument list */ + UINT8 PassNumber; /* Parser pass number */ + UINT8 ReturnObjectType; /* Object type of the returned object */ + UINT8 NodeFlags; /* Same as Node->Flags */ + UINT8 Flags; /* General flags */ } ACPI_EVALUATE_INFO; /* Values for Flags above */ -#define ACPI_IGNORE_RETURN_VALUE 1 +#define ACPI_IGNORE_RETURN_VALUE 1 + +/* Defines for ReturnFlags field above */ + +#define ACPI_OBJECT_REPAIRED 1 +#define ACPI_OBJECT_WRAPPED 2 /* Info used by AcpiNsInitializeDevices */ diff --git a/reactos/drivers/bus/acpi/acpica/include/actables.h b/reactos/drivers/bus/acpi/acpica/include/actables.h index d19e6845d77..3bcfd94d941 100644 --- a/reactos/drivers/bus/acpi/acpica/include/actables.h +++ b/reactos/drivers/bus/acpi/acpica/include/actables.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,6 +121,53 @@ ACPI_STATUS AcpiAllocateRootTable ( UINT32 InitialTableCount); +/* + * tbxfroot - Root pointer utilities + */ +ACPI_STATUS +AcpiTbValidateRsdp ( + ACPI_TABLE_RSDP *Rsdp); + +UINT8 * +AcpiTbScanMemoryForRsdp ( + UINT8 *StartAddress, + UINT32 Length); + + +/* + * tbdata - table data structure management + */ +ACPI_STATUS +AcpiTbGetNextRootIndex ( + UINT32 *TableIndex); + +void +AcpiTbInitTableDescriptor ( + ACPI_TABLE_DESC *TableDesc, + ACPI_PHYSICAL_ADDRESS Address, + UINT8 Flags, + ACPI_TABLE_HEADER *Table); + +ACPI_STATUS +AcpiTbAcquireTempTable ( + ACPI_TABLE_DESC *TableDesc, + ACPI_PHYSICAL_ADDRESS Address, + UINT8 Flags); + +void +AcpiTbReleaseTempTable ( + ACPI_TABLE_DESC *TableDesc); + +BOOLEAN +AcpiTbIsTableLoaded ( + UINT32 TableIndex); + +void +AcpiTbSetTableLoadedFlag ( + UINT32 TableIndex, + BOOLEAN IsLoaded); + + /* * tbfadt - FADT parse/convert/validate */ @@ -153,12 +200,41 @@ AcpiTbResizeRootTableList ( void); ACPI_STATUS -AcpiTbVerifyTable ( +AcpiTbValidateTable ( + ACPI_TABLE_DESC *TableDesc); + +void +AcpiTbInvalidateTable ( ACPI_TABLE_DESC *TableDesc); ACPI_STATUS -AcpiTbAddTable ( +AcpiTbVerifyTable ( ACPI_TABLE_DESC *TableDesc, + char *Signature); + +void +AcpiTbOverrideTable ( + ACPI_TABLE_DESC *OldTableDesc); + +ACPI_STATUS +AcpiTbAcquireTable ( + ACPI_TABLE_DESC *TableDesc, + ACPI_TABLE_HEADER **TablePtr, + UINT32 *TableLength, + UINT8 *TableFlags); + +void +AcpiTbReleaseTable ( + ACPI_TABLE_HEADER *Table, + UINT32 TableLength, + UINT8 TableFlags); + +ACPI_STATUS +AcpiTbInstallStandardTable ( + ACPI_PHYSICAL_ADDRESS Address, + UINT8 Flags, + BOOLEAN Reload, + BOOLEAN Override, UINT32 *TableIndex); ACPI_STATUS @@ -170,7 +246,7 @@ AcpiTbStoreTable ( UINT32 *TableIndex); void -AcpiTbDeleteTable ( +AcpiTbUninstallTable ( ACPI_TABLE_DESC *TableDesc); void @@ -194,15 +270,6 @@ AcpiTbGetOwnerId ( UINT32 TableIndex, ACPI_OWNER_ID *OwnerId); -BOOLEAN -AcpiTbIsTableLoaded ( - UINT32 TableIndex); - -void -AcpiTbSetTableLoadedFlag ( - UINT32 TableIndex, - BOOLEAN IsLoaded); - /* * tbutils - table manager utilities @@ -239,7 +306,13 @@ AcpiTbCopyDsdt ( UINT32 TableIndex); void -AcpiTbInstallTable ( +AcpiTbInstallTableWithOverride ( + UINT32 TableIndex, + ACPI_TABLE_DESC *NewTableDesc, + BOOLEAN Override); + +ACPI_STATUS +AcpiTbInstallFixedTable ( ACPI_PHYSICAL_ADDRESS Address, char *Signature, UINT32 TableIndex); diff --git a/reactos/drivers/bus/acpi/acpica/include/actbl.h b/reactos/drivers/bus/acpi/acpica/include/actbl.h index 3cec93028f8..9a6625c2fa8 100644 --- a/reactos/drivers/bus/acpi/acpica/include/actbl.h +++ b/reactos/drivers/bus/acpi/acpica/include/actbl.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -154,9 +154,15 @@ #pragma pack(1) /* - * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables. - * This is the only type that is even remotely portable. Anything else is not - * portable, so do not use any other bitfield types. + * Note: C bitfields are not used for this reason: + * + * "Bitfields are great and easy to read, but unfortunately the C language + * does not specify the layout of bitfields in memory, which means they are + * essentially useless for dealing with packed data in on-disk formats or + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, + * this decision was a design error in C. Ritchie could have picked an order + * and stuck with it." Norman Ramsey. + * See http://stackoverflow.com/a/1053662/41661 */ @@ -171,7 +177,7 @@ typedef struct acpi_table_header { char Signature[ACPI_NAME_SIZE]; /* ASCII table signature */ UINT32 Length; /* Length of table in bytes, including this header */ - UINT8 Revision; /* ACPI Specification minor version # */ + UINT8 Revision; /* ACPI Specification minor version number */ UINT8 Checksum; /* To make sum of entire table == 0 */ char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */ char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */ @@ -187,7 +193,7 @@ typedef struct acpi_table_header * GAS - Generic Address Structure (ACPI 2.0+) * * Note: Since this structure is used in the ACPI tables, it is byte aligned. - * If misaliged access is not supported by the hardware, accesses to the + * If misaligned access is not supported by the hardware, accesses to the * 64-bit Address field must be performed with care. * ******************************************************************************/ @@ -269,6 +275,9 @@ typedef struct acpi_table_xsdt } ACPI_TABLE_XSDT; +#define ACPI_RSDT_ENTRY_SIZE (sizeof (UINT32)) +#define ACPI_XSDT_ENTRY_SIZE (sizeof (UINT64)) + /******************************************************************************* * @@ -325,18 +334,18 @@ typedef struct acpi_table_fadt UINT8 PreferredProfile; /* Conveys preferred power management profile to OSPM. */ UINT16 SciInterrupt; /* System vector of SCI interrupt */ UINT32 SmiCommand; /* 32-bit Port address of SMI command port */ - UINT8 AcpiEnable; /* Value to write to smi_cmd to enable ACPI */ - UINT8 AcpiDisable; /* Value to write to smi_cmd to disable ACPI */ - UINT8 S4BiosRequest; /* Value to write to SMI CMD to enter S4BIOS state */ + UINT8 AcpiEnable; /* Value to write to SMI_CMD to enable ACPI */ + UINT8 AcpiDisable; /* Value to write to SMI_CMD to disable ACPI */ + UINT8 S4BiosRequest; /* Value to write to SMI_CMD to enter S4BIOS state */ UINT8 PstateControl; /* Processor performance state control*/ - UINT32 Pm1aEventBlock; /* 32-bit Port address of Power Mgt 1a Event Reg Blk */ - UINT32 Pm1bEventBlock; /* 32-bit Port address of Power Mgt 1b Event Reg Blk */ - UINT32 Pm1aControlBlock; /* 32-bit Port address of Power Mgt 1a Control Reg Blk */ - UINT32 Pm1bControlBlock; /* 32-bit Port address of Power Mgt 1b Control Reg Blk */ - UINT32 Pm2ControlBlock; /* 32-bit Port address of Power Mgt 2 Control Reg Blk */ - UINT32 PmTimerBlock; /* 32-bit Port address of Power Mgt Timer Ctrl Reg Blk */ - UINT32 Gpe0Block; /* 32-bit Port address of General Purpose Event 0 Reg Blk */ - UINT32 Gpe1Block; /* 32-bit Port address of General Purpose Event 1 Reg Blk */ + UINT32 Pm1aEventBlock; /* 32-bit port address of Power Mgt 1a Event Reg Blk */ + UINT32 Pm1bEventBlock; /* 32-bit port address of Power Mgt 1b Event Reg Blk */ + UINT32 Pm1aControlBlock; /* 32-bit port address of Power Mgt 1a Control Reg Blk */ + UINT32 Pm1bControlBlock; /* 32-bit port address of Power Mgt 1b Control Reg Blk */ + UINT32 Pm2ControlBlock; /* 32-bit port address of Power Mgt 2 Control Reg Blk */ + UINT32 PmTimerBlock; /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */ + UINT32 Gpe0Block; /* 32-bit port address of General Purpose Event 0 Reg Blk */ + UINT32 Gpe1Block; /* 32-bit port address of General Purpose Event 1 Reg Blk */ UINT8 Pm1EventLength; /* Byte Length of ports at Pm1xEventBlock */ UINT8 Pm1ControlLength; /* Byte Length of ports at Pm1xControlBlock */ UINT8 Pm2ControlLength; /* Byte Length of ports at Pm2ControlBlock */ @@ -344,12 +353,12 @@ typedef struct acpi_table_fadt UINT8 Gpe0BlockLength; /* Byte Length of ports at Gpe0Block */ UINT8 Gpe1BlockLength; /* Byte Length of ports at Gpe1Block */ UINT8 Gpe1Base; /* Offset in GPE number space where GPE1 events start */ - UINT8 CstControl; /* Support for the _CST object and C States change notification */ + UINT8 CstControl; /* Support for the _CST object and C-States change notification */ UINT16 C2Latency; /* Worst case HW latency to enter/exit C2 state */ UINT16 C3Latency; /* Worst case HW latency to enter/exit C3 state */ - UINT16 FlushSize; /* Processor's memory cache line width, in bytes */ + UINT16 FlushSize; /* Processor memory cache line width, in bytes */ UINT16 FlushStride; /* Number of flush strides that need to be read */ - UINT8 DutyOffset; /* Processor duty cycle index in processor's P_CNT reg */ + UINT8 DutyOffset; /* Processor duty cycle index in processor P_CNT reg */ UINT8 DutyWidth; /* Processor duty cycle value bit width in P_CNT register */ UINT8 DayAlarm; /* Index to day-of-month alarm in RTC CMOS RAM */ UINT8 MonthAlarm; /* Index to month-of-year alarm in RTC CMOS RAM */ @@ -370,27 +379,30 @@ typedef struct acpi_table_fadt ACPI_GENERIC_ADDRESS XPmTimerBlock; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */ ACPI_GENERIC_ADDRESS XGpe0Block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */ ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */ + ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register (ACPI 5.0) */ + ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register (ACPI 5.0) */ } ACPI_TABLE_FADT; -/* Masks for FADT Boot Architecture Flags (BootFlags) */ +/* Masks for FADT Boot Architecture Flags (BootFlags) [Vx]=Introduced in this FADT revision */ #define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ #define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ #define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */ #define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */ #define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */ +#define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */ /* Masks for FADT flags */ -#define ACPI_FADT_WBINVD (1) /* 00: [V1] The wbinvd instruction works properly */ -#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] wbinvd flushes but does not invalidate caches */ +#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */ +#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] WBINVD flushes but does not invalidate caches */ #define ACPI_FADT_C1_SUPPORTED (1<<2) /* 02: [V1] All processors support C1 state */ #define ACPI_FADT_C2_MP_SUPPORTED (1<<3) /* 03: [V1] C2 state works on MP system */ #define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: [V1] Power button is handled as a control method device */ #define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: [V1] Sleep button is handled as a control method device */ -#define ACPI_FADT_FIXED_RTC (1<<6) /* 06: [V1] RTC wakeup status not in fixed register space */ +#define ACPI_FADT_FIXED_RTC (1<<6) /* 06: [V1] RTC wakeup status is not in fixed register space */ #define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: [V1] RTC alarm can wake system from S4 */ #define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: [V1] ACPI timer width is 32-bit (0=24-bit) */ #define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: [V1] Docking supported */ @@ -404,11 +416,13 @@ typedef struct acpi_table_fadt #define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */ #define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */ #define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */ +#define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */ +#define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */ -/* Values for PreferredProfile (Prefered Power Management Profiles) */ +/* Values for PreferredProfile (Preferred Power Management Profiles) */ -enum AcpiPreferedPmProfiles +enum AcpiPreferredPmProfiles { PM_UNSPECIFIED = 0, PM_DESKTOP = 1, @@ -416,9 +430,18 @@ enum AcpiPreferedPmProfiles PM_WORKSTATION = 3, PM_ENTERPRISE_SERVER = 4, PM_SOHO_SERVER = 5, - PM_APPLIANCE_PC = 6 + PM_APPLIANCE_PC = 6, + PM_PERFORMANCE_SERVER = 7, + PM_TABLET = 8 }; +/* Values for SleepStatus and SleepControl registers (V5 FADT) */ + +#define ACPI_X_WAKE_STATUS 0x80 +#define ACPI_X_SLEEP_TYPE_MASK 0x1C +#define ACPI_X_SLEEP_TYPE_POSITION 0x02 +#define ACPI_X_SLEEP_ENABLE 0x20 + /* Reset to default packing */ @@ -442,7 +465,7 @@ typedef struct acpi_table_desc { ACPI_PHYSICAL_ADDRESS Address; ACPI_TABLE_HEADER *Pointer; - UINT32 Length; /* Length fixed at 32 bits */ + UINT32 Length; /* Length fixed at 32 bits (fixed in table header) */ ACPI_NAME_UNION Signature; ACPI_OWNER_ID OwnerId; UINT8 Flags; @@ -451,12 +474,11 @@ typedef struct acpi_table_desc /* Masks for Flags field above */ -#define ACPI_TABLE_ORIGIN_UNKNOWN (0) -#define ACPI_TABLE_ORIGIN_MAPPED (1) -#define ACPI_TABLE_ORIGIN_ALLOCATED (2) -#define ACPI_TABLE_ORIGIN_OVERRIDE (4) -#define ACPI_TABLE_ORIGIN_MASK (7) -#define ACPI_TABLE_IS_LOADED (8) +#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (0) /* Virtual address, external maintained */ +#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (1) /* Physical address, internally mapped */ +#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL (2) /* Virtual address, internallly allocated */ +#define ACPI_TABLE_ORIGIN_MASK (3) +#define ACPI_TABLE_IS_LOADED (8) /* @@ -464,10 +486,11 @@ typedef struct acpi_table_desc */ #include "actbl1.h" #include "actbl2.h" +#include "actbl3.h" /* Macros used to generate offsets to specific table fields */ -#define ACPI_FADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_FADT, f) +#define ACPI_FADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FADT, f) /* * Sizes of the various flavors of FADT. We need to look closely @@ -477,12 +500,15 @@ typedef struct acpi_table_desc * FADT is the bottom line as to what the version really is. * * For reference, the values below are as follows: - * FADT V1 size: 0x74 - * FADT V2 size: 0x84 - * FADT V3+ size: 0xF4 + * FADT V1 size: 0x074 + * FADT V2 size: 0x084 + * FADT V3 size: 0x0F4 + * FADT V4 size: 0x0F4 + * FADT V5 size: 0x10C */ #define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4) #define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (Reserved4[0]) + 3) -#define ACPI_FADT_V3_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) +#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl)) +#define ACPI_FADT_V5_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT)) #endif /* __ACTBL_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/actbl1.h b/reactos/drivers/bus/acpi/acpica/include/actbl1.h index a593f44170a..47106722c07 100644 --- a/reactos/drivers/bus/acpi/acpica/include/actbl1.h +++ b/reactos/drivers/bus/acpi/acpica/include/actbl1.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -154,9 +154,15 @@ #pragma pack(1) /* - * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables. - * This is the only type that is even remotely portable. Anything else is not - * portable, so do not use any other bitfield types. + * Note: C bitfields are not used for this reason: + * + * "Bitfields are great and easy to read, but unfortunately the C language + * does not specify the layout of bitfields in memory, which means they are + * essentially useless for dealing with packed data in on-disk formats or + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, + * this decision was a design error in C. Ritchie could have picked an order + * and stuck with it." Norman Ramsey. + * See http://stackoverflow.com/a/1053662/41661 */ @@ -202,7 +208,7 @@ typedef struct acpi_table_bert { ACPI_TABLE_HEADER Header; /* Common ACPI table header */ UINT32 RegionLength; /* Length of the boot error region */ - UINT64 Address; /* Physical addresss of the error region */ + UINT64 Address; /* Physical address of the error region */ } ACPI_TABLE_BERT; @@ -324,16 +330,17 @@ typedef struct acpi_einj_entry enum AcpiEinjActions { - ACPI_EINJ_BEGIN_OPERATION = 0, - ACPI_EINJ_GET_TRIGGER_TABLE = 1, - ACPI_EINJ_SET_ERROR_TYPE = 2, - ACPI_EINJ_GET_ERROR_TYPE = 3, - ACPI_EINJ_END_OPERATION = 4, - ACPI_EINJ_EXECUTE_OPERATION = 5, - ACPI_EINJ_CHECK_BUSY_STATUS = 6, - ACPI_EINJ_GET_COMMAND_STATUS = 7, - ACPI_EINJ_ACTION_RESERVED = 8, /* 8 and greater are reserved */ - ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ + ACPI_EINJ_BEGIN_OPERATION = 0, + ACPI_EINJ_GET_TRIGGER_TABLE = 1, + ACPI_EINJ_SET_ERROR_TYPE = 2, + ACPI_EINJ_GET_ERROR_TYPE = 3, + ACPI_EINJ_END_OPERATION = 4, + ACPI_EINJ_EXECUTE_OPERATION = 5, + ACPI_EINJ_CHECK_BUSY_STATUS = 6, + ACPI_EINJ_GET_COMMAND_STATUS = 7, + ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8, + ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */ + ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ }; /* Values for Instruction field above */ @@ -345,9 +352,33 @@ enum AcpiEinjInstructions ACPI_EINJ_WRITE_REGISTER = 2, ACPI_EINJ_WRITE_REGISTER_VALUE = 3, ACPI_EINJ_NOOP = 4, - ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */ + ACPI_EINJ_FLUSH_CACHELINE = 5, + ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */ }; +typedef struct acpi_einj_error_type_with_addr +{ + UINT32 ErrorType; + UINT32 VendorStructOffset; + UINT32 Flags; + UINT32 ApicId; + UINT64 Address; + UINT64 Range; + UINT32 PcieId; + +} ACPI_EINJ_ERROR_TYPE_WITH_ADDR; + +typedef struct acpi_einj_vendor +{ + UINT32 Length; + UINT32 PcieId; + UINT16 VendorId; + UINT16 DeviceId; + UINT8 RevisionId; + UINT8 Reserved[3]; + +} ACPI_EINJ_VENDOR; + /* EINJ Trigger Error Action Table */ @@ -385,6 +416,7 @@ enum AcpiEinjCommandStatus #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9) #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10) #define ACPI_EINJ_PLATFORM_FATAL (1<<11) +#define ACPI_EINJ_VENDOR_DEFINED (1<<31) /******************************************************************************* @@ -564,7 +596,7 @@ typedef struct acpi_hest_aer_common UINT8 Enabled; UINT32 RecordsToPreallocate; UINT32 MaxSectionsPerRecord; - UINT32 Bus; + UINT32 Bus; /* Bus and Segment numbers */ UINT16 Device; UINT16 Function; UINT16 DeviceControl; @@ -581,6 +613,14 @@ typedef struct acpi_hest_aer_common #define ACPI_HEST_FIRMWARE_FIRST (1) #define ACPI_HEST_GLOBAL (1<<1) +/* + * Macros to access the bus/segment numbers in Bus field above: + * Bus number is encoded in bits 7:0 + * Segment number is encoded in bits 23:8 + */ +#define ACPI_HEST_BUS(Bus) ((Bus) & 0xFF) +#define ACPI_HEST_SEGMENT(Bus) (((Bus) >> 8) & 0xFFFF) + /* Hardware Error Notification */ @@ -607,7 +647,9 @@ enum AcpiHestNotifyTypes ACPI_HEST_NOTIFY_LOCAL = 2, ACPI_HEST_NOTIFY_SCI = 3, ACPI_HEST_NOTIFY_NMI = 4, - ACPI_HEST_NOTIFY_RESERVED = 5 /* 5 and greater are reserved */ + ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */ + ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */ + ACPI_HEST_NOTIFY_RESERVED = 7 /* 7 and greater are reserved */ }; /* Values for ConfigWriteEnable bitfield above */ @@ -803,7 +845,9 @@ enum AcpiMadtType ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8, ACPI_MADT_TYPE_LOCAL_X2APIC = 9, ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, - ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */ + ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, + ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, + ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */ }; @@ -958,11 +1002,42 @@ typedef struct acpi_madt_local_x2apic_nmi } ACPI_MADT_LOCAL_X2APIC_NMI; +/* 11: Generic Interrupt (ACPI 5.0) */ + +typedef struct acpi_madt_generic_interrupt +{ + ACPI_SUBTABLE_HEADER Header; + UINT16 Reserved; /* Reserved - must be zero */ + UINT32 GicId; + UINT32 Uid; + UINT32 Flags; + UINT32 ParkingVersion; + UINT32 PerformanceInterrupt; + UINT64 ParkedAddress; + UINT64 BaseAddress; + +} ACPI_MADT_GENERIC_INTERRUPT; + + +/* 12: Generic Distributor (ACPI 5.0) */ + +typedef struct acpi_madt_generic_distributor +{ + ACPI_SUBTABLE_HEADER Header; + UINT16 Reserved; /* Reserved - must be zero */ + UINT32 GicId; + UINT64 BaseAddress; + UINT32 GlobalIrqBase; + UINT32 Reserved2; /* Reserved - must be zero */ + +} ACPI_MADT_GENERIC_DISTRIBUTOR; + + /* * Common flags fields for MADT subtables */ -/* MADT Local APIC flags (LapicFlags) */ +/* MADT Local APIC flags (LapicFlags) and GIC flags */ #define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ diff --git a/reactos/drivers/bus/acpi/acpica/include/actbl2.h b/reactos/drivers/bus/acpi/acpica/include/actbl2.h index a093e85847b..2ae8ce3d159 100644 --- a/reactos/drivers/bus/acpi/acpica/include/actbl2.h +++ b/reactos/drivers/bus/acpi/acpica/include/actbl2.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -137,6 +137,8 @@ */ #define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */ #define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ +#define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */ +#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */ #define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ #define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */ #define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ @@ -144,11 +146,13 @@ #define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */ #define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ #define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */ +#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */ #define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */ #define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ #define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ #define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ #define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */ +#define ACPI_SIG_VRTC "VRTC" /* Virtual Real Time Clock Table */ #define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */ #define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */ #define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */ @@ -170,9 +174,15 @@ #pragma pack(1) /* - * Note about bitfields: The UINT8 type is used for bitfields in ACPI tables. - * This is the only type that is even remotely portable. Anything else is not - * portable, so do not use any other bitfield types. + * Note: C bitfields are not used for this reason: + * + * "Bitfields are great and easy to read, but unfortunately the C language + * does not specify the layout of bitfields in memory, which means they are + * essentially useless for dealing with packed data in on-disk formats or + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, + * this decision was a design error in C. Ritchie could have picked an order + * and stuck with it." Norman Ramsey. + * See http://stackoverflow.com/a/1053662/41661 */ @@ -334,6 +344,158 @@ typedef struct acpi_table_boot } ACPI_TABLE_BOOT; +/******************************************************************************* + * + * CSRT - Core System Resource Table + * Version 0 + * + * Conforms to the "Core System Resource Table (CSRT)", November 14, 2011 + * + ******************************************************************************/ + +typedef struct acpi_table_csrt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + +} ACPI_TABLE_CSRT; + + +/* Resource Group subtable */ + +typedef struct acpi_csrt_group +{ + UINT32 Length; + UINT32 VendorId; + UINT32 SubvendorId; + UINT16 DeviceId; + UINT16 SubdeviceId; + UINT16 Revision; + UINT16 Reserved; + UINT32 SharedInfoLength; + + /* Shared data immediately follows (Length = SharedInfoLength) */ + +} ACPI_CSRT_GROUP; + +/* Shared Info subtable */ + +typedef struct acpi_csrt_shared_info +{ + UINT16 MajorVersion; + UINT16 MinorVersion; + UINT32 MmioBaseLow; + UINT32 MmioBaseHigh; + UINT32 GsiInterrupt; + UINT8 InterruptPolarity; + UINT8 InterruptMode; + UINT8 NumChannels; + UINT8 DmaAddressWidth; + UINT16 BaseRequestLine; + UINT16 NumHandshakeSignals; + UINT32 MaxBlockSize; + + /* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength) */ + +} ACPI_CSRT_SHARED_INFO; + +/* Resource Descriptor subtable */ + +typedef struct acpi_csrt_descriptor +{ + UINT32 Length; + UINT16 Type; + UINT16 Subtype; + UINT32 Uid; + + /* Resource-specific information immediately follows */ + +} ACPI_CSRT_DESCRIPTOR; + + +/* Resource Types */ + +#define ACPI_CSRT_TYPE_INTERRUPT 0x0001 +#define ACPI_CSRT_TYPE_TIMER 0x0002 +#define ACPI_CSRT_TYPE_DMA 0x0003 + +/* Resource Subtypes */ + +#define ACPI_CSRT_XRUPT_LINE 0x0000 +#define ACPI_CSRT_XRUPT_CONTROLLER 0x0001 +#define ACPI_CSRT_TIMER 0x0000 +#define ACPI_CSRT_DMA_CHANNEL 0x0000 +#define ACPI_CSRT_DMA_CONTROLLER 0x0001 + + +/******************************************************************************* + * + * DBG2 - Debug Port Table 2 + * Version 0 (Both main table and subtables) + * + * Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012. + * + ******************************************************************************/ + +typedef struct acpi_table_dbg2 +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 InfoOffset; + UINT32 InfoCount; + +} ACPI_TABLE_DBG2; + + +typedef struct acpi_dbg2_header +{ + UINT32 InfoOffset; + UINT32 InfoCount; + +} ACPI_DBG2_HEADER; + + +/* Debug Device Information Subtable */ + +typedef struct acpi_dbg2_device +{ + UINT8 Revision; + UINT16 Length; + UINT8 RegisterCount; /* Number of BaseAddress registers */ + UINT16 NamepathLength; + UINT16 NamepathOffset; + UINT16 OemDataLength; + UINT16 OemDataOffset; + UINT16 PortType; + UINT16 PortSubtype; + UINT16 Reserved; + UINT16 BaseAddressOffset; + UINT16 AddressSizeOffset; + /* + * Data that follows: + * BaseAddress (required) - Each in 12-byte Generic Address Structure format. + * AddressSize (required) - Array of UINT32 sizes corresponding to each BaseAddress register. + * Namepath (required) - Null terminated string. Single dot if not supported. + * OemData (optional) - Length is OemDataLength. + */ +} ACPI_DBG2_DEVICE; + +/* Types for PortType field above */ + +#define ACPI_DBG2_SERIAL_PORT 0x8000 +#define ACPI_DBG2_1394_PORT 0x8001 +#define ACPI_DBG2_USB_PORT 0x8002 +#define ACPI_DBG2_NET_PORT 0x8003 + +/* Subtypes for PortSubtype field above */ + +#define ACPI_DBG2_16550_COMPATIBLE 0x0000 +#define ACPI_DBG2_16550_SUBSET 0x0001 + +#define ACPI_DBG2_1394_STANDARD 0x0000 + +#define ACPI_DBG2_USB_XHCI 0x0000 +#define ACPI_DBG2_USB_EHCI 0x0001 + + /******************************************************************************* * * DBGP - Debug Port table @@ -901,6 +1063,34 @@ typedef struct acpi_table_mchi } ACPI_TABLE_MCHI; +/******************************************************************************* + * + * MTMR - MID Timer Table + * Version 1 + * + * Conforms to "Simple Firmware Interface Specification", + * Draft 0.8.2, Oct 19, 2010 + * NOTE: The ACPI MTMR is equivalent to the SFI MTMR table. + * + ******************************************************************************/ + +typedef struct acpi_table_mtmr +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + +} ACPI_TABLE_MTMR; + +/* MTMR entry */ + +typedef struct acpi_mtmr_entry +{ + ACPI_GENERIC_ADDRESS PhysicalAddress; + UINT32 Frequency; + UINT32 Irq; + +} ACPI_MTMR_ENTRY; + + /******************************************************************************* * * SLIC - Software Licensing Description Table @@ -1100,6 +1290,33 @@ typedef struct acpi_table_uefi } ACPI_TABLE_UEFI; +/******************************************************************************* + * + * VRTC - Virtual Real Time Clock Table + * Version 1 + * + * Conforms to "Simple Firmware Interface Specification", + * Draft 0.8.2, Oct 19, 2010 + * NOTE: The ACPI VRTC is equivalent to The SFI MRTC table. + * + ******************************************************************************/ + +typedef struct acpi_table_vrtc +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + +} ACPI_TABLE_VRTC; + +/* VRTC entry */ + +typedef struct acpi_vrtc_entry +{ + ACPI_GENERIC_ADDRESS PhysicalAddress; + UINT32 Irq; + +} ACPI_VRTC_ENTRY; + + /******************************************************************************* * * WAET - Windows ACPI Emulated devices Table @@ -1276,4 +1493,3 @@ typedef struct acpi_table_wdrt #pragma pack() #endif /* __ACTBL2_H__ */ - diff --git a/reactos/drivers/bus/acpi/acpica/include/actbl3.h b/reactos/drivers/bus/acpi/acpica/include/actbl3.h new file mode 100644 index 00000000000..efec7e8fb0b --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/include/actbl3.h @@ -0,0 +1,811 @@ +/****************************************************************************** + * + * Name: actbl3.h - ACPI Table Definitions + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#ifndef __ACTBL3_H__ +#define __ACTBL3_H__ + + +/******************************************************************************* + * + * Additional ACPI Tables (3) + * + * These tables are not consumed directly by the ACPICA subsystem, but are + * included here to support device drivers and the AML disassembler. + * + * The tables in this file are fully defined within the ACPI specification. + * + ******************************************************************************/ + + +/* + * Values for description table header signatures for tables defined in this + * file. Useful because they make it more difficult to inadvertently type in + * the wrong signature. + */ +#define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */ +#define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */ +#define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */ +#define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */ +#define ACPI_SIG_MPST "MPST" /* Memory Power State Table */ +#define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ +#define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ +#define ACPI_SIG_RASF "RASF" /* RAS Feature table */ +#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ + +#define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ +#define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ + +/* Reserved table signatures */ + +#define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ +#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ +#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ + +/* + * All tables must be byte-packed to match the ACPI specification, since + * the tables are provided by the system BIOS. + */ +#pragma pack(1) + +/* + * Note: C bitfields are not used for this reason: + * + * "Bitfields are great and easy to read, but unfortunately the C language + * does not specify the layout of bitfields in memory, which means they are + * essentially useless for dealing with packed data in on-disk formats or + * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me, + * this decision was a design error in C. Ritchie could have picked an order + * and stuck with it." Norman Ramsey. + * See http://stackoverflow.com/a/1053662/41661 + */ + + +/******************************************************************************* + * + * BGRT - Boot Graphics Resource Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_bgrt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT16 Version; + UINT8 Status; + UINT8 ImageType; + UINT64 ImageAddress; + UINT32 ImageOffsetX; + UINT32 ImageOffsetY; + +} ACPI_TABLE_BGRT; + + +/******************************************************************************* + * + * DRTM - Dynamic Root of Trust for Measurement table + * + ******************************************************************************/ + +typedef struct acpi_table_drtm +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT64 EntryBaseAddress; + UINT64 EntryLength; + UINT32 EntryAddress32; + UINT64 EntryAddress64; + UINT64 ExitAddress; + UINT64 LogAreaAddress; + UINT32 LogAreaLength; + UINT64 ArchDependentAddress; + UINT32 Flags; + +} ACPI_TABLE_DRTM; + +/* 1) Validated Tables List */ + +typedef struct acpi_drtm_vtl_list +{ + UINT32 ValidatedTableListCount; + +} ACPI_DRTM_VTL_LIST; + +/* 2) Resources List */ + +typedef struct acpi_drtm_resource_list +{ + UINT32 ResourceListCount; + +} ACPI_DRTM_RESOURCE_LIST; + +/* 3) Platform-specific Identifiers List */ + +typedef struct acpi_drtm_id_list +{ + UINT32 IdListCount; + +} ACPI_DRTM_ID_LIST; + + +/******************************************************************************* + * + * FPDT - Firmware Performance Data Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_fpdt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + +} ACPI_TABLE_FPDT; + + +/* FPDT subtable header */ + +typedef struct acpi_fpdt_header +{ + UINT16 Type; + UINT8 Length; + UINT8 Revision; + +} ACPI_FPDT_HEADER; + +/* Values for Type field above */ + +enum AcpiFpdtType +{ + ACPI_FPDT_TYPE_BOOT = 0, + ACPI_FPDT_TYPE_S3PERF = 1 +}; + + +/* + * FPDT subtables + */ + +/* 0: Firmware Basic Boot Performance Record */ + +typedef struct acpi_fpdt_boot +{ + ACPI_FPDT_HEADER Header; + UINT8 Reserved[4]; + UINT64 ResetEnd; + UINT64 LoadStart; + UINT64 StartupStart; + UINT64 ExitServicesEntry; + UINT64 ExitServicesExit; + +} ACPI_FPDT_BOOT; + + +/* 1: S3 Performance Table Pointer Record */ + +typedef struct acpi_fpdt_s3pt_ptr +{ + ACPI_FPDT_HEADER Header; + UINT8 Reserved[4]; + UINT64 Address; + +} ACPI_FPDT_S3PT_PTR; + + +/* + * S3PT - S3 Performance Table. This table is pointed to by the + * FPDT S3 Pointer Record above. + */ +typedef struct acpi_table_s3pt +{ + UINT8 Signature[4]; /* "S3PT" */ + UINT32 Length; + +} ACPI_TABLE_S3PT; + + +/* + * S3PT Subtables + */ +typedef struct acpi_s3pt_header +{ + UINT16 Type; + UINT8 Length; + UINT8 Revision; + +} ACPI_S3PT_HEADER; + +/* Values for Type field above */ + +enum AcpiS3ptType +{ + ACPI_S3PT_TYPE_RESUME = 0, + ACPI_S3PT_TYPE_SUSPEND = 1 +}; + +typedef struct acpi_s3pt_resume +{ + ACPI_S3PT_HEADER Header; + UINT32 ResumeCount; + UINT64 FullResume; + UINT64 AverageResume; + +} ACPI_S3PT_RESUME; + +typedef struct acpi_s3pt_suspend +{ + ACPI_S3PT_HEADER Header; + UINT64 SuspendStart; + UINT64 SuspendEnd; + +} ACPI_S3PT_SUSPEND; + + +/******************************************************************************* + * + * GTDT - Generic Timer Description Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_gtdt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT64 Address; + UINT32 Flags; + UINT32 SecurePl1Interrupt; + UINT32 SecurePl1Flags; + UINT32 NonSecurePl1Interrupt; + UINT32 NonSecurePl1Flags; + UINT32 VirtualTimerInterrupt; + UINT32 VirtualTimerFlags; + UINT32 NonSecurePl2Interrupt; + UINT32 NonSecurePl2Flags; + +} ACPI_TABLE_GTDT; + +/* Values for Flags field above */ + +#define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1 + +/* Values for all "TimerFlags" fields above */ + +#define ACPI_GTDT_INTERRUPT_MODE 1 +#define ACPI_GTDT_INTERRUPT_POLARITY 2 + + +/******************************************************************************* + * + * MPST - Memory Power State Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +#define ACPI_MPST_CHANNEL_INFO \ + UINT8 ChannelId; \ + UINT8 Reserved1[3]; \ + UINT16 PowerNodeCount; \ + UINT16 Reserved2; + +/* Main table */ + +typedef struct acpi_table_mpst +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ + +} ACPI_TABLE_MPST; + + +/* Memory Platform Communication Channel Info */ + +typedef struct acpi_mpst_channel +{ + ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */ + +} ACPI_MPST_CHANNEL; + + +/* Memory Power Node Structure */ + +typedef struct acpi_mpst_power_node +{ + UINT8 Flags; + UINT8 Reserved1; + UINT16 NodeId; + UINT32 Length; + UINT64 RangeAddress; + UINT64 RangeLength; + UINT32 NumPowerStates; + UINT32 NumPhysicalComponents; + +} ACPI_MPST_POWER_NODE; + +/* Values for Flags field above */ + +#define ACPI_MPST_ENABLED 1 +#define ACPI_MPST_POWER_MANAGED 2 +#define ACPI_MPST_HOT_PLUG_CAPABLE 4 + + +/* Memory Power State Structure (follows POWER_NODE above) */ + +typedef struct acpi_mpst_power_state +{ + UINT8 PowerState; + UINT8 InfoIndex; + +} ACPI_MPST_POWER_STATE; + + +/* Physical Component ID Structure (follows POWER_STATE above) */ + +typedef struct acpi_mpst_component +{ + UINT16 ComponentId; + +} ACPI_MPST_COMPONENT; + + +/* Memory Power State Characteristics Structure (follows all POWER_NODEs) */ + +typedef struct acpi_mpst_data_hdr +{ + UINT16 CharacteristicsCount; + UINT16 Reserved; + +} ACPI_MPST_DATA_HDR; + +typedef struct acpi_mpst_power_data +{ + UINT8 StructureId; + UINT8 Flags; + UINT16 Reserved1; + UINT32 AveragePower; + UINT32 PowerSaving; + UINT64 ExitLatency; + UINT64 Reserved2; + +} ACPI_MPST_POWER_DATA; + +/* Values for Flags field above */ + +#define ACPI_MPST_PRESERVE 1 +#define ACPI_MPST_AUTOENTRY 2 +#define ACPI_MPST_AUTOEXIT 4 + + +/* Shared Memory Region (not part of an ACPI table) */ + +typedef struct acpi_mpst_shared +{ + UINT32 Signature; + UINT16 PccCommand; + UINT16 PccStatus; + UINT32 CommandRegister; + UINT32 StatusRegister; + UINT32 PowerStateId; + UINT32 PowerNodeId; + UINT64 EnergyConsumed; + UINT64 AveragePower; + +} ACPI_MPST_SHARED; + + +/******************************************************************************* + * + * PCCT - Platform Communications Channel Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_pcct +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 Flags; + UINT64 Reserved; + +} ACPI_TABLE_PCCT; + +/* Values for Flags field above */ + +#define ACPI_PCCT_DOORBELL 1 + +/* Values for subtable type in ACPI_SUBTABLE_HEADER */ + +enum AcpiPcctType +{ + ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, + ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */ +}; + +/* + * PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER + */ + +/* 0: Generic Communications Subspace */ + +typedef struct acpi_pcct_subspace +{ + ACPI_SUBTABLE_HEADER Header; + UINT8 Reserved[6]; + UINT64 BaseAddress; + UINT64 Length; + ACPI_GENERIC_ADDRESS DoorbellRegister; + UINT64 PreserveMask; + UINT64 WriteMask; + UINT32 Latency; + UINT32 MaxAccessRate; + UINT16 MinTurnaroundTime; + +} ACPI_PCCT_SUBSPACE; + + +/* + * PCC memory structures (not part of the ACPI table) + */ + +/* Shared Memory Region */ + +typedef struct acpi_pcct_shared_memory +{ + UINT32 Signature; + UINT16 Command; + UINT16 Status; + +} ACPI_PCCT_SHARED_MEMORY; + + +/******************************************************************************* + * + * PMTT - Platform Memory Topology Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_pmtt +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 Reserved; + +} ACPI_TABLE_PMTT; + + +/* Common header for PMTT subtables that follow main table */ + +typedef struct acpi_pmtt_header +{ + UINT8 Type; + UINT8 Reserved1; + UINT16 Length; + UINT16 Flags; + UINT16 Reserved2; + +} ACPI_PMTT_HEADER; + +/* Values for Type field above */ + +#define ACPI_PMTT_TYPE_SOCKET 0 +#define ACPI_PMTT_TYPE_CONTROLLER 1 +#define ACPI_PMTT_TYPE_DIMM 2 +#define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */ + +/* Values for Flags field above */ + +#define ACPI_PMTT_TOP_LEVEL 0x0001 +#define ACPI_PMTT_PHYSICAL 0x0002 +#define ACPI_PMTT_MEMORY_TYPE 0x000C + + +/* + * PMTT subtables, correspond to Type in acpi_pmtt_header + */ + + +/* 0: Socket Structure */ + +typedef struct acpi_pmtt_socket +{ + ACPI_PMTT_HEADER Header; + UINT16 SocketId; + UINT16 Reserved; + +} ACPI_PMTT_SOCKET; + + +/* 1: Memory Controller subtable */ + +typedef struct acpi_pmtt_controller +{ + ACPI_PMTT_HEADER Header; + UINT32 ReadLatency; + UINT32 WriteLatency; + UINT32 ReadBandwidth; + UINT32 WriteBandwidth; + UINT16 AccessWidth; + UINT16 Alignment; + UINT16 Reserved; + UINT16 DomainCount; + +} ACPI_PMTT_CONTROLLER; + +/* 1a: Proximity Domain substructure */ + +typedef struct acpi_pmtt_domain +{ + UINT32 ProximityDomain; + +} ACPI_PMTT_DOMAIN; + + +/* 2: Physical Component Identifier (DIMM) */ + +typedef struct acpi_pmtt_physical_component +{ + ACPI_PMTT_HEADER Header; + UINT16 ComponentId; + UINT16 Reserved; + UINT32 MemorySize; + UINT32 BiosHandle; + +} ACPI_PMTT_PHYSICAL_COMPONENT; + + +/******************************************************************************* + * + * RASF - RAS Feature Table (ACPI 5.0) + * Version 1 + * + ******************************************************************************/ + +typedef struct acpi_table_rasf +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT8 ChannelId[12]; + +} ACPI_TABLE_RASF; + +/* RASF Platform Communication Channel Shared Memory Region */ + +typedef struct acpi_rasf_shared_memory +{ + UINT32 Signature; + UINT16 Command; + UINT16 Status; + UINT16 Version; + UINT8 Capabilities[16]; + UINT8 SetCapabilities[16]; + UINT16 NumParameterBlocks; + UINT32 SetCapabilitiesStatus; + +} ACPI_RASF_SHARED_MEMORY; + +/* RASF Parameter Block Structure Header */ + +typedef struct acpi_rasf_parameter_block +{ + UINT16 Type; + UINT16 Version; + UINT16 Length; + +} ACPI_RASF_PARAMETER_BLOCK; + +/* RASF Parameter Block Structure for PATROL_SCRUB */ + +typedef struct acpi_rasf_patrol_scrub_parameter +{ + ACPI_RASF_PARAMETER_BLOCK Header; + UINT16 PatrolScrubCommand; + UINT64 RequestedAddressRange[2]; + UINT64 ActualAddressRange[2]; + UINT16 Flags; + UINT8 RequestedSpeed; + +} ACPI_RASF_PATROL_SCRUB_PARAMETER; + +/* Masks for Flags and Speed fields above */ + +#define ACPI_RASF_SCRUBBER_RUNNING 1 +#define ACPI_RASF_SPEED (7<<1) +#define ACPI_RASF_SPEED_SLOW (0<<1) +#define ACPI_RASF_SPEED_MEDIUM (4<<1) +#define ACPI_RASF_SPEED_FAST (7<<1) + +/* Channel Commands */ + +enum AcpiRasfCommands +{ + ACPI_RASF_EXECUTE_RASF_COMMAND = 1 +}; + +/* Platform RAS Capabilities */ + +enum AcpiRasfCapabiliities +{ + ACPI_HW_PATROL_SCRUB_SUPPORTED = 0, + ACPI_SW_PATROL_SCRUB_EXPOSED = 1 +}; + +/* Patrol Scrub Commands */ + +enum AcpiRasfPatrolScrubCommands +{ + ACPI_RASF_GET_PATROL_PARAMETERS = 1, + ACPI_RASF_START_PATROL_SCRUBBER = 2, + ACPI_RASF_STOP_PATROL_SCRUBBER = 3 +}; + +/* Channel Command flags */ + +#define ACPI_RASF_GENERATE_SCI (1<<15) + +/* Status values */ + +enum AcpiRasfStatus +{ + ACPI_RASF_SUCCESS = 0, + ACPI_RASF_NOT_VALID = 1, + ACPI_RASF_NOT_SUPPORTED = 2, + ACPI_RASF_BUSY = 3, + ACPI_RASF_FAILED = 4, + ACPI_RASF_ABORTED = 5, + ACPI_RASF_INVALID_DATA = 6 +}; + +/* Status flags */ + +#define ACPI_RASF_COMMAND_COMPLETE (1) +#define ACPI_RASF_SCI_DOORBELL (1<<1) +#define ACPI_RASF_ERROR (1<<2) +#define ACPI_RASF_STATUS (0x1F<<3) + + +/******************************************************************************* + * + * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table + * Version 3 + * + * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011 + * + ******************************************************************************/ + +typedef struct acpi_table_tpm2 +{ + ACPI_TABLE_HEADER Header; /* Common ACPI table header */ + UINT32 Flags; + UINT64 ControlAddress; + UINT32 StartMethod; + +} ACPI_TABLE_TPM2; + +/* Control area structure (not part of table, pointed to by ControlAddress) */ + +typedef struct acpi_tpm2_control +{ + UINT32 Reserved; + UINT32 Error; + UINT32 Cancel; + UINT32 Start; + UINT64 InterruptControl; + UINT32 CommandSize; + UINT64 CommandAddress; + UINT32 ResponseSize; + UINT64 ResponseAddress; + +} ACPI_TPM2_CONTROL; + + +/* Reset to default packing */ + +#pragma pack() + +#endif /* __ACTBL3_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/actbl71.h b/reactos/drivers/bus/acpi/acpica/include/actbl71.h deleted file mode 100644 index 0390d6f8de6..00000000000 --- a/reactos/drivers/bus/acpi/acpica/include/actbl71.h +++ /dev/null @@ -1,144 +0,0 @@ -/****************************************************************************** - * - * Name: actbl71.h - IA-64 Extensions to the ACPI Spec Rev. 0.71 - * This file includes tables specific to this - * specification revision. - * $Revision: 1.1 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 R. Byron Moore - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __ACTBL71_H__ -#define __ACTBL71_H__ - -/* 0.71 FADT Address_space data item bitmasks defines */ -/* If the associated bit is zero then it is in memory space else in io space */ -#define SMI_CMD_ADDRESS_SPACE 0x01 -#define PM1_BLK_ADDRESS_SPACE 0x02 -#define PM2_CNT_BLK_ADDRESS_SPACE 0x04 -#define PM_TMR_BLK_ADDRESS_SPACE 0x08 -#define GPE0_BLK_ADDRESS_SPACE 0x10 -#define GPE1_BLK_ADDRESS_SPACE 0x20 - -/* Only for clarity in declarations */ -typedef UINT64 IO_ADDRESS; - -#pragma pack(1) - -typedef struct /* Root System Descriptor Pointer */ -{ - NATIVE_CHAR signature [8]; /* contains "RSD PTR " */ - u8 checksum; /* to make sum of struct == 0 */ - NATIVE_CHAR oem_id [6]; /* OEM identification */ - u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */ - UINT64 rsdt_physical_address; /* 64-bit physical address of RSDT */ -} RSDP_DESCRIPTOR_REV071; - - -/*****************************************/ -/* IA64 Extensions to ACPI Spec Rev 0.71 */ -/* for the Root System Description Table */ -/*****************************************/ -typedef struct -{ - ACPI_TABLE_HEADER header; /* Table header */ - u32 reserved_pad; /* IA64 alignment, must be 0 */ - UINT64 table_offset_entry [1]; /* Array of pointers to other */ - /* tables' headers */ -} RSDT_DESCRIPTOR_REV071; - - -/*******************************************/ -/* IA64 Extensions to ACPI Spec Rev 0.71 */ -/* for the Firmware ACPI Control Structure */ -/*******************************************/ -typedef struct -{ - NATIVE_CHAR signature[4]; /* signature "FACS" */ - u32 length; /* length of structure, in bytes */ - u32 hardware_signature; /* hardware configuration signature */ - u32 reserved4; /* must be 0 */ - UINT64 firmware_waking_vector; /* ACPI OS waking vector */ - UINT64 global_lock; /* Global Lock */ - u32 S4_bios_f : 1; /* Indicates if S4_bIOS support is present */ - u32 reserved1 : 31; /* must be 0 */ - u8 reserved3 [28]; /* reserved - must be zero */ - -} FACS_DESCRIPTOR_REV071; - - -/******************************************/ -/* IA64 Extensions to ACPI Spec Rev 0.71 */ -/* for the Fixed ACPI Description Table */ -/******************************************/ -typedef struct -{ - ACPI_TABLE_HEADER header; /* table header */ - u32 reserved_pad; /* IA64 alignment, must be 0 */ - UINT64 firmware_ctrl; /* 64-bit Physical address of FACS */ - UINT64 dsdt; /* 64-bit Physical address of DSDT */ - u8 model; /* System Interrupt Model */ - u8 address_space; /* Address Space Bitmask */ - u16 sci_int; /* System vector of SCI interrupt */ - u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */ - u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */ - u8 S4_bios_req; /* Value to write to SMI CMD to enter S4_bIOS state */ - u8 reserved2; /* reserved - must be zero */ - UINT64 smi_cmd; /* Port address of SMI command port */ - UINT64 pm1a_evt_blk; /* Port address of Power Mgt 1a Acpi_event Reg Blk */ - UINT64 pm1b_evt_blk; /* Port address of Power Mgt 1b Acpi_event Reg Blk */ - UINT64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ - UINT64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ - UINT64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ - UINT64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ - UINT64 gpe0blk; /* Port addr of General Purpose Acpi_event 0 Reg Blk */ - UINT64 gpe1_blk; /* Port addr of General Purpose Acpi_event 1 Reg Blk */ - u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ - u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ - u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ - u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ - u8 gpe0blk_len; /* Byte Length of ports at gpe0_blk */ - u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ - u8 gpe1_base; /* offset in gpe model where gpe1 events start */ - u8 reserved3; /* reserved */ - u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */ - u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */ - u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */ - u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */ - u8 century; /* index to century in RTC CMOS RAM */ - u8 reserved4; /* reserved */ - u32 flush_cash : 1; /* PAL_FLUSH_CACHE is correctly supported */ - u32 reserved5 : 1; /* reserved - must be zero */ - u32 proc_c1 : 1; /* all processors support C1 state */ - u32 plvl2_up : 1; /* C2 state works on MP system */ - u32 pwr_button : 1; /* Power button is handled as a generic feature */ - u32 sleep_button : 1; /* Sleep button is handled as a generic feature, or not present */ - u32 fixed_rTC : 1; /* RTC wakeup stat not in fixed register space */ - u32 rtcs4 : 1; /* RTC wakeup stat not possible from S4 */ - u32 tmr_val_ext : 1; /* tmr_val is 32 bits */ - u32 dock_cap : 1; /* Supports Docking */ - u32 reserved6 : 22; /* reserved - must be zero */ - -} FADT_DESCRIPTOR_REV071; - -#pragma pack() - -#endif /* __ACTBL71_H__ */ - diff --git a/reactos/drivers/bus/acpi/acpica/include/actypes.h b/reactos/drivers/bus/acpi/acpica/include/actypes.h index 467e50ad8cb..a02cd108d01 100644 --- a/reactos/drivers/bus/acpi/acpica/include/actypes.h +++ b/reactos/drivers/bus/acpi/acpica/include/actypes.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -196,11 +196,11 @@ * ******************************************************************************/ -//typedef unsigned char BOOLEAN; -//typedef unsigned char UINT8; -//typedef unsigned short UINT16; -//typedef COMPILER_DEPENDENT_UINT64 UINT64; -//typedef COMPILER_DEPENDENT_INT64 INT64; +typedef unsigned char BOOLEAN; +typedef unsigned char UINT8; +typedef unsigned short UINT16; +typedef COMPILER_DEPENDENT_UINT64 UINT64; +typedef COMPILER_DEPENDENT_INT64 INT64; /*! [End] no source code translation !*/ @@ -225,8 +225,8 @@ /*! [Begin] no source code translation (keep the typedefs as-is) */ -//typedef unsigned int UINT32; -//typedef int INT32; +typedef unsigned int UINT32; +typedef int INT32; /*! [End] no source code translation !*/ @@ -264,8 +264,8 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS; /*! [Begin] no source code translation (keep the typedefs as-is) */ -//typedef unsigned int UINT32; -//typedef int INT32; +typedef unsigned int UINT32; +typedef int INT32; /*! [End] no source code translation !*/ @@ -367,7 +367,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS; /* * Some compilers complain about unused variables. Sometimes we don't want to * use all the variables (for example, _AcpiModuleName). This allows us - * to to tell the compiler in a per-variable manner that a variable + * to tell the compiler in a per-variable manner that a variable * is unused */ #ifndef ACPI_UNUSED_VAR @@ -375,13 +375,58 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS; #endif /* - * All ACPICA functions that are available to the rest of the kernel are - * tagged with this macro which can be defined as appropriate for the host. + * All ACPICA external functions that are available to the rest of the kernel + * are tagged with thes macros which can be defined as appropriate for the host. + * + * Notes: + * ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination + * interfaces that may need special processing. + * ACPI_EXPORT_SYMBOL is used for all other public external functions. */ +#ifndef ACPI_EXPORT_SYMBOL_INIT +#define ACPI_EXPORT_SYMBOL_INIT(Symbol) +#endif + #ifndef ACPI_EXPORT_SYMBOL #define ACPI_EXPORT_SYMBOL(Symbol) #endif +/* + * Compiler/Clibrary-dependent debug initialization. Used for ACPICA + * utilities only. + */ +#ifndef ACPI_DEBUG_INITIALIZE +#define ACPI_DEBUG_INITIALIZE() +#endif + + +/******************************************************************************* + * + * Configuration + * + ******************************************************************************/ + +#ifdef ACPI_DBG_TRACK_ALLOCATIONS +/* + * Memory allocation tracking (used by AcpiExec to detect memory leaks) + */ +#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__ +#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) +#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS) +#define ACPI_FREE(a) AcpiUtFreeAndTrack (a, ACPI_MEM_PARAMETERS) +#define ACPI_MEM_TRACKING(a) a + +#else +/* + * Normal memory allocation directly via the OS services layer + */ +#define ACPI_ALLOCATE(a) AcpiOsAllocate ((ACPI_SIZE) (a)) +#define ACPI_ALLOCATE_ZEROED(a) AcpiOsAllocateZeroed ((ACPI_SIZE) (a)) +#define ACPI_FREE(a) AcpiOsFree (a) +#define ACPI_MEM_TRACKING(a) + +#endif /* ACPI_DBG_TRACK_ALLOCATIONS */ + /****************************************************************************** * @@ -399,6 +444,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS; #define ACPI_PM1_REGISTER_WIDTH 16 #define ACPI_PM2_REGISTER_WIDTH 8 #define ACPI_PM_TIMER_WIDTH 32 +#define ACPI_RESET_REGISTER_WIDTH 8 /* Names within the namespace are 4 bytes long */ @@ -418,7 +464,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS; /* PM Timer ticks per second (HZ) */ -#define PM_TIMER_FREQUENCY 3579545 +#define ACPI_PM_TIMER_FREQUENCY 3579545 /******************************************************************************* @@ -453,6 +499,22 @@ typedef char * ACPI_STRING; /* Null terminated ASCII typedef void * ACPI_HANDLE; /* Actually a ptr to a NS Node */ +/* Time constants for timer calculations */ + +#define ACPI_MSEC_PER_SEC 1000L + +#define ACPI_USEC_PER_MSEC 1000L +#define ACPI_USEC_PER_SEC 1000000L + +#define ACPI_100NSEC_PER_USEC 10L +#define ACPI_100NSEC_PER_MSEC 10000L +#define ACPI_100NSEC_PER_SEC 10000000L + +#define ACPI_NSEC_PER_USEC 1000L +#define ACPI_NSEC_PER_MSEC 1000000L +#define ACPI_NSEC_PER_SEC 1000000000L + + /* Owner IDs are used to track namespace nodes for selective deletion */ typedef UINT8 ACPI_OWNER_ID; @@ -526,12 +588,21 @@ typedef UINT64 ACPI_INTEGER; #define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) #define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) +/* Optimizations for 4-character (32-bit) ACPI_NAME manipulation */ + #ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED #define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b))) +#define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src))) #else #define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) +#define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE)) #endif +/* Support for the special RSDP signature (8 characters) */ + +#define ACPI_VALIDATE_RSDP_SIG(a) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8)) +#define ACPI_MAKE_RSDP_SIG(dest) (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8)) + /******************************************************************************* * @@ -606,8 +677,9 @@ typedef UINT64 ACPI_INTEGER; #define ACPI_NOTIFY_DEVICE_PLD_CHECK (UINT8) 0x09 #define ACPI_NOTIFY_RESERVED (UINT8) 0x0A #define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B +#define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C -#define ACPI_NOTIFY_MAX 0x0B +#define ACPI_NOTIFY_MAX 0x0C /* * Types associated with ACPI names and objects. The first group of @@ -663,7 +735,7 @@ typedef UINT32 ACPI_OBJECT_TYPE; /* * These are special object types that never appear in - * a Namespace node, only in an ACPI_OPERAND_OBJECT + * a Namespace node, only in an object of ACPI_OPERAND_OBJECT */ #define ACPI_TYPE_LOCAL_EXTRA 0x1C #define ACPI_TYPE_LOCAL_DATA 0x1D @@ -723,13 +795,6 @@ typedef UINT32 ACPI_EVENT_STATUS; #define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02 #define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x04 -/* - * General Purpose Events (GPE) - */ -#define ACPI_GPE_INVALID 0xFF -#define ACPI_GPE_MAX 0xFF -#define ACPI_NUM_GPE 256 - /* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */ #define ACPI_GPE_ENABLE 0 @@ -772,8 +837,13 @@ typedef UINT32 ACPI_EVENT_STATUS; #define ACPI_DEVICE_NOTIFY 0x2 #define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY) #define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 +#define ACPI_NUM_NOTIFY_TYPES 2 -#define ACPI_MAX_SYS_NOTIFY 0x7f +#define ACPI_MAX_SYS_NOTIFY 0x7F +#define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF + +#define ACPI_SYSTEM_HANDLER_LIST 0 /* Used as index, must be SYSTEM_NOTIFY -1 */ +#define ACPI_DEVICE_HANDLER_LIST 1 /* Used as index, must be DEVICE_NOTIFY -1 */ /* Address Space (Operation Region) Types */ @@ -788,8 +858,11 @@ typedef UINT8 ACPI_ADR_SPACE_TYPE; #define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5 #define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6 #define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7 +#define ACPI_ADR_SPACE_GPIO (ACPI_ADR_SPACE_TYPE) 8 +#define ACPI_ADR_SPACE_GSBUS (ACPI_ADR_SPACE_TYPE) 9 +#define ACPI_ADR_SPACE_PLATFORM_COMM (ACPI_ADR_SPACE_TYPE) 10 -#define ACPI_NUM_PREDEFINED_REGIONS 8 +#define ACPI_NUM_PREDEFINED_REGIONS 11 /* * Special Address Spaces @@ -862,6 +935,19 @@ typedef UINT8 ACPI_ADR_SPACE_TYPE; #define ACPI_DISABLE_EVENT 0 +/* Sleep function dispatch */ + +typedef ACPI_STATUS (*ACPI_SLEEP_FUNCTION) ( + UINT8 SleepState); + +typedef struct acpi_sleep_functions +{ + ACPI_SLEEP_FUNCTION LegacyFunction; + ACPI_SLEEP_FUNCTION ExtendedFunction; + +} ACPI_SLEEP_FUNCTIONS; + + /* * External ACPI object definition */ @@ -940,8 +1026,8 @@ typedef struct acpi_object_list * Miscellaneous common Data Structures used by the interfaces */ #define ACPI_NO_BUFFER 0 -#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) -#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) +#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) /* Let ACPICA allocate buffer */ +#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) /* For internal use only (enables tracking) */ typedef struct acpi_buffer { @@ -1031,6 +1117,10 @@ typedef void * Various handlers and callback procedures */ typedef +UINT32 (*ACPI_SCI_HANDLER) ( + void *Context); + +typedef void (*ACPI_GBL_EVENT_HANDLER) ( UINT32 EventType, ACPI_HANDLE Device, @@ -1102,6 +1192,17 @@ ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) ( #define ACPI_DEFAULT_HANDLER NULL +/* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */ + +typedef struct acpi_connection_info +{ + UINT8 *Connection; + UINT16 Length; + UINT8 AccessLength; + +} ACPI_CONNECTION_INFO; + + typedef ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) ( ACPI_HANDLE RegionHandle, @@ -1144,22 +1245,22 @@ UINT32 (*ACPI_INTERFACE_HANDLER) ( #define ACPI_UUID_LENGTH 16 -/* Structures used for device/processor HID, UID, CID */ +/* Structures used for device/processor HID, UID, CID, and SUB */ -typedef struct acpi_device_id +typedef struct acpi_pnp_device_id { UINT32 Length; /* Length of string + null */ char *String; -} ACPI_DEVICE_ID; +} ACPI_PNP_DEVICE_ID; -typedef struct acpi_device_id_list +typedef struct acpi_pnp_device_id_list { UINT32 Count; /* Number of IDs in Ids array */ UINT32 ListSize; /* Size of list, including ID strings */ - ACPI_DEVICE_ID Ids[1]; /* ID array */ + ACPI_PNP_DEVICE_ID Ids[1]; /* ID array */ -} ACPI_DEVICE_ID_LIST; +} ACPI_PNP_DEVICE_ID_LIST; /* * Structure returned from AcpiGetObjectInfo. @@ -1177,9 +1278,10 @@ typedef struct acpi_device_info UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */ UINT32 CurrentStatus; /* _STA value */ UINT64 Address; /* _ADR value */ - ACPI_DEVICE_ID HardwareId; /* _HID value */ - ACPI_DEVICE_ID UniqueId; /* _UID value */ - ACPI_DEVICE_ID_LIST CompatibleIdList; /* _CID list */ + ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */ + ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */ + ACPI_PNP_DEVICE_ID SubsystemId; /* _SUB value */ + ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list */ } ACPI_DEVICE_INFO; @@ -1193,11 +1295,12 @@ typedef struct acpi_device_info #define ACPI_VALID_ADR 0x02 #define ACPI_VALID_HID 0x04 #define ACPI_VALID_UID 0x08 -#define ACPI_VALID_CID 0x10 -#define ACPI_VALID_SXDS 0x20 -#define ACPI_VALID_SXWS 0x40 +#define ACPI_VALID_SUB 0x10 +#define ACPI_VALID_CID 0x20 +#define ACPI_VALID_SXDS 0x40 +#define ACPI_VALID_SXWS 0x80 -/* Flags for _STA method */ +/* Flags for _STA return value (CurrentStatus above) */ #define ACPI_STA_DEVICE_PRESENT 0x01 #define ACPI_STA_DEVICE_ENABLED 0x02 @@ -1239,7 +1342,6 @@ typedef struct acpi_memory_list UINT16 ObjectSize; UINT16 MaxDepth; UINT16 CurrentDepth; - UINT16 LinkOffset; #ifdef ACPI_DBG_TRACK_ALLOCATIONS @@ -1257,4 +1359,32 @@ typedef struct acpi_memory_list } ACPI_MEMORY_LIST; +/* Definitions of _OSI support */ + +#define ACPI_VENDOR_STRINGS 0x01 +#define ACPI_FEATURE_STRINGS 0x02 +#define ACPI_ENABLE_INTERFACES 0x00 +#define ACPI_DISABLE_INTERFACES 0x04 + +#define ACPI_DISABLE_ALL_VENDOR_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS) +#define ACPI_DISABLE_ALL_FEATURE_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_FEATURE_STRINGS) +#define ACPI_DISABLE_ALL_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS) +#define ACPI_ENABLE_ALL_VENDOR_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS) +#define ACPI_ENABLE_ALL_FEATURE_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_FEATURE_STRINGS) +#define ACPI_ENABLE_ALL_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS) + +#define ACPI_OSI_WIN_2000 0x01 +#define ACPI_OSI_WIN_XP 0x02 +#define ACPI_OSI_WIN_XP_SP1 0x03 +#define ACPI_OSI_WINSRV_2003 0x04 +#define ACPI_OSI_WIN_XP_SP2 0x05 +#define ACPI_OSI_WINSRV_2003_SP1 0x06 +#define ACPI_OSI_WIN_VISTA 0x07 +#define ACPI_OSI_WINSRV_2008 0x08 +#define ACPI_OSI_WIN_VISTA_SP1 0x09 +#define ACPI_OSI_WIN_VISTA_SP2 0x0A +#define ACPI_OSI_WIN_7 0x0B +#define ACPI_OSI_WIN_8 0x0C + + #endif /* __ACTYPES_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/acutils.h b/reactos/drivers/bus/acpi/acpica/include/acutils.h index cef6ab3e6fb..b1c512b4a16 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acutils.h +++ b/reactos/drivers/bus/acpi/acpica/include/acutils.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -118,10 +118,11 @@ extern const UINT8 AcpiGbl_ResourceAmlSizes[]; +extern const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[]; /* Strings used by the disassembler and debugger resource dump routines */ -#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) +#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) extern const char *AcpiGbl_BmDecode[]; extern const char *AcpiGbl_ConfigDecode[]; @@ -141,8 +142,67 @@ extern const char *AcpiGbl_SizDecode[]; extern const char *AcpiGbl_TrsDecode[]; extern const char *AcpiGbl_TtpDecode[]; extern const char *AcpiGbl_TypDecode[]; +extern const char *AcpiGbl_PpcDecode[]; +extern const char *AcpiGbl_IorDecode[]; +extern const char *AcpiGbl_DtsDecode[]; +extern const char *AcpiGbl_CtDecode[]; +extern const char *AcpiGbl_SbtDecode[]; +extern const char *AcpiGbl_AmDecode[]; +extern const char *AcpiGbl_SmDecode[]; +extern const char *AcpiGbl_WmDecode[]; +extern const char *AcpiGbl_CphDecode[]; +extern const char *AcpiGbl_CpoDecode[]; +extern const char *AcpiGbl_DpDecode[]; +extern const char *AcpiGbl_EdDecode[]; +extern const char *AcpiGbl_BpbDecode[]; +extern const char *AcpiGbl_SbDecode[]; +extern const char *AcpiGbl_FcDecode[]; +extern const char *AcpiGbl_PtDecode[]; #endif +/* + * For the iASL compiler case, the output is redirected to stderr so that + * any of the various ACPI errors and warnings do not appear in the output + * files, for either the compiler or disassembler portions of the tool. + */ +#ifdef ACPI_ASL_COMPILER + +#include +extern FILE *AcpiGbl_OutputFile; + +#define ACPI_MSG_REDIRECT_BEGIN \ + FILE *OutputFile = AcpiGbl_OutputFile; \ + AcpiOsRedirectOutput (stderr); + +#define ACPI_MSG_REDIRECT_END \ + AcpiOsRedirectOutput (OutputFile); + +#else +/* + * non-iASL case - no redirection, nothing to do + */ +#define ACPI_MSG_REDIRECT_BEGIN +#define ACPI_MSG_REDIRECT_END +#endif + +/* + * Common error message prefixes + */ +#define ACPI_MSG_ERROR "ACPI Error: " +#define ACPI_MSG_EXCEPTION "ACPI Exception: " +#define ACPI_MSG_WARNING "ACPI Warning: " +#define ACPI_MSG_INFO "ACPI: " + +#define ACPI_MSG_BIOS_ERROR "ACPI BIOS Error (bug): " +#define ACPI_MSG_BIOS_WARNING "ACPI BIOS Warning (bug): " + +/* + * Common message suffix + */ +#define ACPI_MSG_SUFFIX \ + AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber) + + /* Types for Resource descriptor entries */ #define ACPI_INVALID_RESOURCE 0 @@ -156,7 +216,7 @@ ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) ( UINT32 Length, UINT32 Offset, UINT8 ResourceIndex, - void *Context); + void **Context); typedef ACPI_STATUS (*ACPI_PKG_CALLBACK) ( @@ -174,9 +234,10 @@ typedef struct acpi_pkg_info } ACPI_PKG_INFO; +/* Object reference counts */ + #define REF_INCREMENT (UINT16) 0 #define REF_DECREMENT (UINT16) 1 -#define REF_FORCE_DELETE (UINT16) 2 /* AcpiUtDumpBuffer */ @@ -185,7 +246,6 @@ typedef struct acpi_pkg_info #define DB_DWORD_DISPLAY 4 #define DB_QWORD_DISPLAY 8 - /* * utglobal - Global data structures and procedures */ @@ -201,8 +261,8 @@ AcpiUtGetMutexName ( const char * AcpiUtGetNotifyName ( - UINT32 NotifyValue); - + UINT32 NotifyValue, + ACPI_OBJECT_TYPE Type); #endif char * @@ -480,18 +540,19 @@ AcpiUtPtrExit ( UINT32 ComponentId, UINT8 *Ptr); +void +AcpiUtDebugDumpBuffer ( + UINT8 *Buffer, + UINT32 Count, + UINT32 Display, + UINT32 ComponentId); + void AcpiUtDumpBuffer ( UINT8 *Buffer, UINT32 Count, UINT32 Display, - UINT32 componentId); - -void -AcpiUtDumpBuffer2 ( - UINT8 *Buffer, - UINT32 Count, - UINT32 Display); + UINT32 Offset); void AcpiUtReportError ( @@ -567,17 +628,22 @@ AcpiUtExecutePowerMethods ( ACPI_STATUS AcpiUtExecute_HID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID **ReturnId); + ACPI_PNP_DEVICE_ID **ReturnId); ACPI_STATUS AcpiUtExecute_UID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID **ReturnId); + ACPI_PNP_DEVICE_ID **ReturnId); + +ACPI_STATUS +AcpiUtExecute_SUB ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_PNP_DEVICE_ID **ReturnId); ACPI_STATUS AcpiUtExecute_CID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID_LIST **ReturnCidList); + ACPI_PNP_DEVICE_ID_LIST **ReturnCidList); /* @@ -664,7 +730,7 @@ ACPI_STATUS AcpiUtInitializeInterfaces ( void); -void +ACPI_STATUS AcpiUtInterfaceTerminate ( void); @@ -676,6 +742,10 @@ ACPI_STATUS AcpiUtRemoveInterface ( ACPI_STRING InterfaceName); +ACPI_STATUS +AcpiUtUpdateInterfaces ( + UINT8 Action); + ACPI_INTERFACE_INFO * AcpiUtGetInterface ( ACPI_STRING InterfaceName); @@ -685,6 +755,38 @@ AcpiUtOsiImplementation ( ACPI_WALK_STATE *WalkState); +/* + * utpredef - support for predefined names + */ +const ACPI_PREDEFINED_INFO * +AcpiUtGetNextPredefinedMethod ( + const ACPI_PREDEFINED_INFO *ThisName); + +const ACPI_PREDEFINED_INFO * +AcpiUtMatchPredefinedMethod ( + char *Name); + +const ACPI_PREDEFINED_INFO * +AcpiUtMatchResourceName ( + char *Name); + +void +AcpiUtDisplayPredefinedMethod ( + char *Buffer, + const ACPI_PREDEFINED_INFO *ThisName, + BOOLEAN MultiLine); + +void +AcpiUtGetExpectedReturnTypes ( + char *Buffer, + UINT32 ExpectedBtypes); + +UINT32 +AcpiUtGetResourceBitWidth ( + char *Buffer, + UINT16 Types); + + /* * utstate - Generic state creation/cache routines */ @@ -756,10 +858,11 @@ AcpiUtShortDivide ( UINT64 *OutQuotient, UINT32 *OutRemainder); + /* * utmisc */ -const char * +const ACPI_EXCEPTION_INFO * AcpiUtValidateException ( ACPI_STATUS Status); @@ -771,14 +874,6 @@ BOOLEAN AcpiUtIsAmlTable ( ACPI_TABLE_HEADER *Table); -ACPI_STATUS -AcpiUtAllocateOwnerId ( - ACPI_OWNER_ID *OwnerId); - -void -AcpiUtReleaseOwnerId ( - ACPI_OWNER_ID *OwnerId); - ACPI_STATUS AcpiUtWalkPackageTree ( ACPI_OPERAND_OBJECT *SourceObject, @@ -786,37 +881,6 @@ AcpiUtWalkPackageTree ( ACPI_PKG_CALLBACK WalkCallback, void *Context); -void -AcpiUtStrupr ( - char *SrcString); - -void -AcpiUtStrlwr ( - char *SrcString); - -void -AcpiUtPrintString ( - char *String, - UINT8 MaxLength); - -BOOLEAN -AcpiUtValidAcpiName ( - UINT32 Name); - -void -AcpiUtRepairName ( - char *Name); - -BOOLEAN -AcpiUtValidAcpiChar ( - char Character, - UINT32 Position); - -ACPI_STATUS -AcpiUtStrtoul64 ( - char *String, - UINT32 Base, - UINT64 *RetInteger); /* Values for Base above (16=Hex, 10=Decimal) */ @@ -839,18 +903,32 @@ AcpiUtDisplayInitPathname ( #endif +/* + * utownerid - Support for Table/Method Owner IDs + */ +ACPI_STATUS +AcpiUtAllocateOwnerId ( + ACPI_OWNER_ID *OwnerId); + +void +AcpiUtReleaseOwnerId ( + ACPI_OWNER_ID *OwnerId); + + /* * utresrc */ ACPI_STATUS AcpiUtWalkAmlResources ( + ACPI_WALK_STATE *WalkState, UINT8 *Aml, ACPI_SIZE AmlLength, ACPI_WALK_AML_CALLBACK UserFunction, - void *Context); + void **Context); ACPI_STATUS AcpiUtValidateResource ( + ACPI_WALK_STATE *WalkState, void *Aml, UINT8 *ReturnIndex); @@ -876,6 +954,72 @@ AcpiUtGetResourceEndTag ( UINT8 **EndTag); +/* + * utstring - String and character utilities + */ +void +AcpiUtStrupr ( + char *SrcString); + +void +AcpiUtStrlwr ( + char *SrcString); + +int +AcpiUtStricmp ( + char *String1, + char *String2); + +ACPI_STATUS +AcpiUtStrtoul64 ( + char *String, + UINT32 Base, + UINT64 *RetInteger); + +void +AcpiUtPrintString ( + char *String, + UINT16 MaxLength); + +void +UtConvertBackslashes ( + char *Pathname); + +BOOLEAN +AcpiUtValidAcpiName ( + char *Name); + +BOOLEAN +AcpiUtValidAcpiChar ( + char Character, + UINT32 Position); + +void +AcpiUtRepairName ( + char *Name); + +#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION) +BOOLEAN +AcpiUtSafeStrcpy ( + char *Dest, + ACPI_SIZE DestSize, + char *Source); + +BOOLEAN +AcpiUtSafeStrcat ( + char *Dest, + ACPI_SIZE DestSize, + char *Source); + +BOOLEAN +AcpiUtSafeStrncat ( + char *Dest, + ACPI_SIZE DestSize, + char *Source, + ACPI_SIZE MaxTransferLength); +#endif + + /* * utmutex - mutex support */ @@ -916,20 +1060,6 @@ AcpiUtInitializeBuffer ( ACPI_BUFFER *Buffer, ACPI_SIZE RequiredLength); -void * -AcpiUtAllocate ( - ACPI_SIZE Size, - UINT32 Component, - const char *Module, - UINT32 Line); - -void * -AcpiUtAllocateZeroed ( - ACPI_SIZE Size, - UINT32 Component, - const char *Module, - UINT32 Line); - #ifdef ACPI_DBG_TRACK_ALLOCATIONS void * AcpiUtAllocateAndTrack ( @@ -969,6 +1099,31 @@ AcpiUtCreateList ( #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ +/* + * utaddress - address range check + */ +ACPI_STATUS +AcpiUtAddAddressRange ( + ACPI_ADR_SPACE_TYPE SpaceId, + ACPI_PHYSICAL_ADDRESS Address, + UINT32 Length, + ACPI_NAMESPACE_NODE *RegionNode); + +void +AcpiUtRemoveAddressRange ( + ACPI_ADR_SPACE_TYPE SpaceId, + ACPI_NAMESPACE_NODE *RegionNode); + +UINT32 +AcpiUtCheckAddressRange ( + ACPI_ADR_SPACE_TYPE SpaceId, + ACPI_PHYSICAL_ADDRESS Address, + UINT32 Length, + BOOLEAN Warn); + +void +AcpiUtDeleteAddressLists ( + void); /* * utxferror - various error/warning output functions @@ -991,6 +1146,15 @@ AcpiUtPredefinedInfo ( const char *Format, ...); +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedBiosError ( + const char *ModuleName, + UINT32 LineNumber, + char *Pathname, + UINT8 NodeFlags, + const char *Format, + ...); + void AcpiUtNamespaceError ( const char *ModuleName, @@ -1007,4 +1171,15 @@ AcpiUtMethodError ( const char *Path, ACPI_STATUS LookupStatus); +/* + * Utility functions for ACPI names and IDs + */ +const AH_PREDEFINED_NAME * +AcpiAhMatchPredefinedName ( + char *Nameseg); + +const AH_DEVICE_ID * +AcpiAhMatchHardwareId ( + char *Hid); + #endif /* _ACUTILS_H */ diff --git a/reactos/drivers/bus/acpi/acpica/include/amlcode.h b/reactos/drivers/bus/acpi/acpica/include/amlcode.h index c6c62ea9f04..5eaf30c6033 100644 --- a/reactos/drivers/bus/acpi/acpica/include/amlcode.h +++ b/reactos/drivers/bus/acpi/acpica/include/amlcode.h @@ -10,13 +10,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -33,7 +33,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -45,11 +45,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -57,7 +57,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -82,10 +82,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -94,14 +94,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -262,6 +262,15 @@ #define AML_LNOTEQUAL_OP (UINT16) 0x9293 +/* + * Opcodes for "Field" operators + */ +#define AML_FIELD_OFFSET_OP (UINT8) 0x00 +#define AML_FIELD_ACCESS_OP (UINT8) 0x01 +#define AML_FIELD_CONNECTION_OP (UINT8) 0x02 /* ACPI 5.0 */ +#define AML_FIELD_EXT_ACCESS_OP (UINT8) 0x03 /* ACPI 5.0 */ + + /* * Internal opcodes * Use only "Unknown" AML opcodes, don't attempt to use @@ -276,7 +285,8 @@ #define AML_INT_METHODCALL_OP (UINT16) 0x0035 #define AML_INT_RETURN_VALUE_OP (UINT16) 0x0036 #define AML_INT_EVAL_SUBTREE_OP (UINT16) 0x0037 - +#define AML_INT_CONNECTION_OP (UINT16) 0x0038 +#define AML_INT_EXTACCESSFIELD_OP (UINT16) 0x0039 #define ARG_NONE 0x0 @@ -550,13 +560,16 @@ typedef enum */ typedef enum { - AML_FIELD_ATTRIB_SMB_QUICK = 0x02, - AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04, - AML_FIELD_ATTRIB_SMB_BYTE = 0x06, - AML_FIELD_ATTRIB_SMB_WORD = 0x08, - AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A, - AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C, - AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D + AML_FIELD_ATTRIB_QUICK = 0x02, + AML_FIELD_ATTRIB_SEND_RCV = 0x04, + AML_FIELD_ATTRIB_BYTE = 0x06, + AML_FIELD_ATTRIB_WORD = 0x08, + AML_FIELD_ATTRIB_BLOCK = 0x0A, + AML_FIELD_ATTRIB_MULTIBYTE = 0x0B, + AML_FIELD_ATTRIB_WORD_CALL = 0x0C, + AML_FIELD_ATTRIB_BLOCK_CALL = 0x0D, + AML_FIELD_ATTRIB_RAW_BYTES = 0x0E, + AML_FIELD_ATTRIB_RAW_PROCESS = 0x0F } AML_ACCESS_ATTRIBUTE; diff --git a/reactos/drivers/bus/acpi/acpica/include/amlresrc.h b/reactos/drivers/bus/acpi/acpica/include/amlresrc.h index ba0e324f131..3fcd9edd611 100644 --- a/reactos/drivers/bus/acpi/acpica/include/amlresrc.h +++ b/reactos/drivers/bus/acpi/acpica/include/amlresrc.h @@ -1,4 +1,3 @@ - /****************************************************************************** * * Module Name: amlresrc.h - AML resource descriptors @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -131,29 +130,48 @@ #define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT" #define ACPI_RESTAG_BASEADDRESS "_BAS" #define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */ +#define ACPI_RESTAG_DEBOUNCETIME "_DBT" #define ACPI_RESTAG_DECODE "_DEC" +#define ACPI_RESTAG_DEVICEPOLARITY "_DPL" #define ACPI_RESTAG_DMA "_DMA" #define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */ +#define ACPI_RESTAG_DRIVESTRENGTH "_DRS" +#define ACPI_RESTAG_ENDIANNESS "_END" +#define ACPI_RESTAG_FLOWCONTROL "_FLC" #define ACPI_RESTAG_GRANULARITY "_GRA" #define ACPI_RESTAG_INTERRUPT "_INT" #define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */ #define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), NoShare(0) */ #define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */ +#define ACPI_RESTAG_IORESTRICTION "_IOR" #define ACPI_RESTAG_LENGTH "_LEN" +#define ACPI_RESTAG_LINE "_LIN" #define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */ #define ACPI_RESTAG_MEMTYPE "_MEM" /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */ #define ACPI_RESTAG_MAXADDR "_MAX" #define ACPI_RESTAG_MINADDR "_MIN" #define ACPI_RESTAG_MAXTYPE "_MAF" #define ACPI_RESTAG_MINTYPE "_MIF" +#define ACPI_RESTAG_MODE "_MOD" +#define ACPI_RESTAG_PARITY "_PAR" +#define ACPI_RESTAG_PHASE "_PHA" +#define ACPI_RESTAG_PIN "_PIN" +#define ACPI_RESTAG_PINCONFIG "_PPI" +#define ACPI_RESTAG_POLARITY "_POL" #define ACPI_RESTAG_REGISTERBITOFFSET "_RBO" #define ACPI_RESTAG_REGISTERBITWIDTH "_RBW" #define ACPI_RESTAG_RANGETYPE "_RNG" #define ACPI_RESTAG_READWRITETYPE "_RW_" /* ReadOnly(0), Writeable (1) */ +#define ACPI_RESTAG_LENGTH_RX "_RXL" +#define ACPI_RESTAG_LENGTH_TX "_TXL" +#define ACPI_RESTAG_SLAVEMODE "_SLV" +#define ACPI_RESTAG_SPEED "_SPE" +#define ACPI_RESTAG_STOPBITS "_STB" #define ACPI_RESTAG_TRANSLATION "_TRA" #define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */ #define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */ #define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */ +#define ACPI_RESTAG_VENDORDATA "_VEN" /* Default sizes for "small" resource descriptors */ @@ -164,6 +182,7 @@ #define ASL_RDESC_END_DEPEND_SIZE 0x00 #define ASL_RDESC_IO_SIZE 0x07 #define ASL_RDESC_FIXED_IO_SIZE 0x03 +#define ASL_RDESC_FIXED_DMA_SIZE 0x05 #define ASL_RDESC_END_TAG_SIZE 0x01 @@ -286,6 +305,16 @@ typedef struct aml_resource_end_tag } AML_RESOURCE_END_TAG; +typedef struct aml_resource_fixed_dma +{ + AML_RESOURCE_SMALL_HEADER_COMMON + UINT16 RequestLines; + UINT16 Channels; + UINT8 Width; + +} AML_RESOURCE_FIXED_DMA; + + /* * LARGE descriptors */ @@ -440,6 +469,130 @@ typedef struct aml_resource_generic_register } AML_RESOURCE_GENERIC_REGISTER; + +/* Common descriptor for GpioInt and GpioIo (ACPI 5.0) */ + +typedef struct aml_resource_gpio +{ + AML_RESOURCE_LARGE_HEADER_COMMON + UINT8 RevisionId; + UINT8 ConnectionType; + UINT16 Flags; + UINT16 IntFlags; + UINT8 PinConfig; + UINT16 DriveStrength; + UINT16 DebounceTimeout; + UINT16 PinTableOffset; + UINT8 ResSourceIndex; + UINT16 ResSourceOffset; + UINT16 VendorOffset; + UINT16 VendorLength; + /* + * Optional fields follow immediately: + * 1) PIN list (Words) + * 2) Resource Source String + * 3) Vendor Data bytes + */ + +} AML_RESOURCE_GPIO; + +#define AML_RESOURCE_GPIO_REVISION 1 /* ACPI 5.0 */ + +/* Values for ConnectionType above */ + +#define AML_RESOURCE_GPIO_TYPE_INT 0 +#define AML_RESOURCE_GPIO_TYPE_IO 1 +#define AML_RESOURCE_MAX_GPIOTYPE 1 + + +/* Common preamble for all serial descriptors (ACPI 5.0) */ + +#define AML_RESOURCE_SERIAL_COMMON \ + UINT8 RevisionId; \ + UINT8 ResSourceIndex; \ + UINT8 Type; \ + UINT8 Flags; \ + UINT16 TypeSpecificFlags; \ + UINT8 TypeRevisionId; \ + UINT16 TypeDataLength; \ + +/* Values for the type field above */ + +#define AML_RESOURCE_I2C_SERIALBUSTYPE 1 +#define AML_RESOURCE_SPI_SERIALBUSTYPE 2 +#define AML_RESOURCE_UART_SERIALBUSTYPE 3 +#define AML_RESOURCE_MAX_SERIALBUSTYPE 3 +#define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */ + +typedef struct aml_resource_common_serialbus +{ + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_SERIAL_COMMON + +} AML_RESOURCE_COMMON_SERIALBUS; + +typedef struct aml_resource_i2c_serialbus +{ + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_SERIAL_COMMON + UINT32 ConnectionSpeed; + UINT16 SlaveAddress; + /* + * Optional fields follow immediately: + * 1) Vendor Data bytes + * 2) Resource Source String + */ + +} AML_RESOURCE_I2C_SERIALBUS; + +#define AML_RESOURCE_I2C_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_I2C_TYPE_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_I2C_MIN_DATA_LEN 6 + +typedef struct aml_resource_spi_serialbus +{ + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_SERIAL_COMMON + UINT32 ConnectionSpeed; + UINT8 DataBitLength; + UINT8 ClockPhase; + UINT8 ClockPolarity; + UINT16 DeviceSelection; + /* + * Optional fields follow immediately: + * 1) Vendor Data bytes + * 2) Resource Source String + */ + +} AML_RESOURCE_SPI_SERIALBUS; + +#define AML_RESOURCE_SPI_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_SPI_TYPE_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_SPI_MIN_DATA_LEN 9 + + +typedef struct aml_resource_uart_serialbus +{ + AML_RESOURCE_LARGE_HEADER_COMMON + AML_RESOURCE_SERIAL_COMMON + UINT32 DefaultBaudRate; + UINT16 RxFifoSize; + UINT16 TxFifoSize; + UINT8 Parity; + UINT8 LinesEnabled; + /* + * Optional fields follow immediately: + * 1) Vendor Data bytes + * 2) Resource Source String + */ + +} AML_RESOURCE_UART_SERIALBUS; + +#define AML_RESOURCE_UART_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */ +#define AML_RESOURCE_UART_MIN_DATA_LEN 10 + + /* restore default alignment */ #pragma pack() @@ -462,6 +615,7 @@ typedef union aml_resource AML_RESOURCE_END_DEPENDENT EndDpf; AML_RESOURCE_IO Io; AML_RESOURCE_FIXED_IO FixedIo; + AML_RESOURCE_FIXED_DMA FixedDma; AML_RESOURCE_VENDOR_SMALL VendorSmall; AML_RESOURCE_END_TAG EndTag; @@ -477,6 +631,11 @@ typedef union aml_resource AML_RESOURCE_ADDRESS64 Address64; AML_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64; AML_RESOURCE_EXTENDED_IRQ ExtendedIrq; + AML_RESOURCE_GPIO Gpio; + AML_RESOURCE_I2C_SERIALBUS I2cSerialBus; + AML_RESOURCE_SPI_SERIALBUS SpiSerialBus; + AML_RESOURCE_UART_SERIALBUS UartSerialBus; + AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus; /* Utility overlays */ @@ -488,4 +647,3 @@ typedef union aml_resource } AML_RESOURCE; #endif - diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/accygwin.h b/reactos/drivers/bus/acpi/acpica/include/platform/accygwin.h index 624dfdff110..41e80fe46ee 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/accygwin.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/accygwin.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -122,6 +122,7 @@ #define ACPI_USE_SYSTEM_CLIBRARY #define ACPI_USE_DO_WHILE_0 #define ACPI_FLUSH_CPU_CACHE() + /* * This is needed since sem_timedwait does not appear to work properly * on cygwin (always hangs forever). @@ -161,4 +162,13 @@ #include "acgcc.h" + +/* + * The vsnprintf function is defined by c99, but cygwin/gcc does not + * enable this prototype when the -ansi flag is set. Also related to + * __STRICT_ANSI__. So, we just declare the prototype here. + */ +int +vsnprintf (char *s, size_t n, const char *format, va_list ap); + #endif /* __ACCYGWIN_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acefi.h b/reactos/drivers/bus/acpi/acpica/include/platform/acefi.h index 6ecda765dd4..ef46761cbc9 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acefi.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acefi.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h b/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h index 7046c683477..16960799517 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -169,20 +169,22 @@ #endif /* - * AcpiBin/AcpiHelp/AcpiSrc configuration. All single threaded, with - * no debug output. + * AcpiBin/AcpiDump/AcpiSrc/AcpiXtract/Example configuration. All single + * threaded, with no debug output. */ -#if (defined ACPI_BIN_APP) || \ - (defined ACPI_SRC_APP) || \ - (defined ACPI_XTRACT_APP) +#if (defined ACPI_BIN_APP) || \ + (defined ACPI_DUMP_APP) || \ + (defined ACPI_SRC_APP) || \ + (defined ACPI_XTRACT_APP) || \ + (defined ACPI_EXAMPLE_APP) #define ACPI_APPLICATION #define ACPI_SINGLE_THREADED #endif #ifdef ACPI_HELP_APP -#define ACPI_DEBUG_OUTPUT #define ACPI_APPLICATION #define ACPI_SINGLE_THREADED +#define ACPI_NO_ERROR_MESSAGES #endif /* Linkable ACPICA library */ @@ -219,6 +221,9 @@ #if defined(_LINUX) || defined(__linux__) #include "aclinux.h" +#elif defined(_APPLE) || defined(__APPLE__) +#include "acmacosx.h" + #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) #include "acfreebsd.h" @@ -252,6 +257,9 @@ #elif defined(_AED_EFI) #include "acefi.h" +#elif defined(__HAIKU__) +#include "achaiku.h" + #else /* Unknown environment */ @@ -282,7 +290,7 @@ /* Type of mutex supported by host. Default is binary semaphores. */ #ifndef ACPI_MUTEX_TYPE -#define ACPI_MUTEX_TYPE ACPI_OSL_MUTEX +#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE #endif /* Global Lock acquire/release */ @@ -369,7 +377,7 @@ */ #ifdef ACPI_USE_SYSTEM_CLIBRARY -/* Use the standard C library headers. We want to keep these to a minimum */ +/* Use the standard C library headers. We want to keep these to a minimum. */ #ifdef ACPI_USE_STANDARD_HEADERS @@ -436,7 +444,7 @@ typedef char *va_list; #define _Bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) #define va_arg(ap, T) (*(T *)(((ap) += (_Bnd (T, _AUPBND))) - (_Bnd (T,_ADNBND)))) -#define va_end(ap) (void) 0 +#define va_end(ap) (ap = (va_list) NULL) #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_Bnd (A,_AUPBND)))) #endif /* va_arg */ @@ -461,4 +469,13 @@ typedef char *va_list; #endif /* ACPI_USE_SYSTEM_CLIBRARY */ +#ifndef ACPI_FILE +#ifdef ACPI_APPLICATION +#include +#define ACPI_FILE FILE * +#else +#define ACPI_FILE void * +#endif /* ACPI_APPLICATION */ +#endif /* ACPI_FILE */ + #endif /* __ACENV_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acfreebsd.h b/reactos/drivers/bus/acpi/acpica/include/platform/acfreebsd.h index 19e6911afc4..2c5ae95b51b 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acfreebsd.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acfreebsd.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,12 +121,21 @@ #include "acgcc.h" #include -#include + +#ifdef __LP64__ +#define ACPI_MACHINE_WIDTH 64 +#else +#define ACPI_MACHINE_WIDTH 32 +#endif + +#define COMPILER_DEPENDENT_INT64 int64_t +#define COMPILER_DEPENDENT_UINT64 uint64_t #define ACPI_UINTPTR_T uintptr_t #define ACPI_USE_DO_WHILE_0 #define ACPI_USE_LOCAL_CACHE +#define ACPI_USE_NATIVE_DIVIDE #define ACPI_USE_SYSTEM_CLIBRARY #ifdef _KERNEL @@ -135,6 +144,7 @@ #include #include #include +#include #include #include "opt_acpi.h" diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h b/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h index a6f2ba1c848..9cb3cbe5c00 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -120,7 +120,7 @@ /* Function name is used for debug output. Non-ANSI, compiler-dependent */ -#define ACPI_GET_FUNCTION_NAME __FUNCTION__ +#define ACPI_GET_FUNCTION_NAME __func__ /* * This macro is used to tag functions as "printf-like" because @@ -131,54 +131,20 @@ /* * Some compilers complain about unused variables. Sometimes we don't want to * use all the variables (for example, _AcpiModuleName). This allows us - * to to tell the compiler warning in a per-variable manner that a variable + * to tell the compiler warning in a per-variable manner that a variable * is unused. */ #define ACPI_UNUSED_VAR __attribute__ ((unused)) -#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ - do { \ - int dummy; \ - asm("1: movl (%1),%%eax;" \ - "movl %%eax,%%edx;" \ - "andl %2,%%edx;" \ - "btsl $0x1,%%edx;" \ - "adcl $0x0,%%edx;" \ - "lock; cmpxchgl %%edx,(%1);" \ - "jnz 1b;" \ - "cmpb $0x3,%%dl;" \ - "sbbl %%eax,%%eax" \ - :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~1L):"dx"); \ - } while(0) - -#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ - do { \ - int dummy; \ - asm("1: movl (%1),%%eax;" \ - "movl %%eax,%%edx;" \ - "andl %2,%%edx;" \ - "lock; cmpxchgl %%edx,(%1);" \ - "jnz 1b;" \ - "andl $0x1,%%eax" \ - :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~3L):"dx"); \ - } while(0) - -#ifdef ACPI_APPLICATION -#define ACPI_FLUSH_CPU_CACHE() -#else -#define ACPI_FLUSH_CPU_CACHE() asm ("WBINVD") +/* + * Some versions of gcc implement strchr() with a buggy macro. So, + * undef it here. Prevents error messages of this form (usually from the + * file getopt.c): + * + * error: logical '&&' with non-zero constant will always evaluate as true + */ +#ifdef strchr +#undef strchr #endif -#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \ -{ \ - q32 = n_hi / d32; \ - r32 = n_lo / d32; \ -} - -#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \ -{ \ - n_hi >>= 1; \ - n_lo >>= 1; \ -} - #endif /* __ACGCC_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/achaiku.h b/reactos/drivers/bus/acpi/acpica/include/platform/achaiku.h new file mode 100644 index 00000000000..859b336a53e --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/include/platform/achaiku.h @@ -0,0 +1,177 @@ +/****************************************************************************** + * + * Name: achaiku.h - OS specific defines, etc. for Haiku (www.haiku-os.org) + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#ifndef __ACHAIKU_H__ +#define __ACHAIKU_H__ + +#include "acgcc.h" +#include + +struct mutex; + + +/* Host-dependent types and defines for user- and kernel-space ACPICA */ + +#define ACPI_USE_SYSTEM_CLIBRARY +#define ACPI_USE_STANDARD_HEADERS + +#define ACPI_MUTEX_TYPE ACPI_OSL_MUTEX +#define ACPI_MUTEX struct mutex * + +#define ACPI_USE_NATIVE_DIVIDE + +// #define ACPI_THREAD_ID thread_id +#define ACPI_SEMAPHORE sem_id +#define ACPI_SPINLOCK spinlock * +#define ACPI_CPU_FLAGS cpu_status + +#define COMPILER_DEPENDENT_INT64 int64 +#define COMPILER_DEPENDENT_UINT64 uint64 + + +#ifdef B_HAIKU_64_BIT +#define ACPI_MACHINE_WIDTH 64 +#else +#define ACPI_MACHINE_WIDTH 32 +#endif + + +#ifdef _KERNEL_MODE +/* Host-dependent types and defines for in-kernel ACPICA */ + +/* ACPICA cache implementation is adequate. */ +#define ACPI_USE_LOCAL_CACHE + +#define ACPI_FLUSH_CPU_CACHE() __asm __volatile("wbinvd"); + +/* Based on FreeBSD's due to lack of documentation */ +extern int AcpiOsAcquireGlobalLock(uint32 *lock); +extern int AcpiOsReleaseGlobalLock(uint32 *lock); + +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) do { \ + (Acq) = AcpiOsAcquireGlobalLock(&((GLptr)->GlobalLock)); \ +} while (0) + +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) do { \ + (Acq) = AcpiOsReleaseGlobalLock(&((GLptr)->GlobalLock)); \ +} while (0) + +#else /* _KERNEL_MODE */ +/* Host-dependent types and defines for user-space ACPICA */ + +#error "We only support kernel mode ACPI atm." + +#endif /* _KERNEL_MODE */ +#endif /* __ACHAIKU_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acintel.h b/reactos/drivers/bus/acpi/acpica/include/platform/acintel.h index a93ccf89760..b64146712bd 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acintel.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acintel.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/aclinux.h b/reactos/drivers/bus/acpi/acpica/include/platform/aclinux.h index f1e30088129..c7ca2874ec2 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/aclinux.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/aclinux.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -127,16 +127,16 @@ #include #include -#include #include #include -#include -#include -#include -#include +#include +#include #include #include -#include +#ifdef EXPORT_ACPI_INTERFACES +#include +#endif +#include /* Host-dependent types and defines for in-kernel ACPICA */ @@ -156,21 +156,31 @@ #include #include +/* Define/disable kernel-specific declarators */ + +#ifndef __init +#define __init +#endif + +#ifndef __iomem +#define __iomem +#endif + /* Host-dependent types and defines for user-space ACPICA */ #define ACPI_FLUSH_CPU_CACHE() +#define ACPI_CAST_PTHREAD_T(Pthread) ((ACPI_THREAD_ID) (Pthread)) -#if defined(__ia64__) || defined(__x86_64__) +#if defined(__ia64__) || defined(__x86_64__) ||\ + defined(__aarch64__) || defined(__PPC64__) #define ACPI_MACHINE_WIDTH 64 #define COMPILER_DEPENDENT_INT64 long #define COMPILER_DEPENDENT_UINT64 unsigned long -#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (pthread)) #else #define ACPI_MACHINE_WIDTH 32 #define COMPILER_DEPENDENT_INT64 long long #define COMPILER_DEPENDENT_UINT64 unsigned long long #define ACPI_USE_NATIVE_DIVIDE -#define ACPI_CAST_PTHREAD_T(pthread) ((ACPI_THREAD_ID) (UINT32) (void *) (pthread)) #endif #ifndef __cdecl @@ -185,13 +195,30 @@ #ifdef __KERNEL__ + +/* + * FIXME: Inclusion of actypes.h + * Linux kernel need this before defining inline OSL interfaces as + * actypes.h need to be included to find ACPICA type definitions. + * Since from ACPICA's perspective, the actypes.h should be included after + * acenv.h (aclinux.h), this leads to a inclusion mis-ordering issue. + */ +#include + /* * Overrides for in-kernel ACPICA */ -static inline acpi_thread_id acpi_os_get_thread_id(void) -{ - return current; -} +ACPI_STATUS __init AcpiOsInitialize ( + void); +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize + +ACPI_STATUS AcpiOsTerminate ( + void); +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate + +/* + * Memory allocation/deallocation + */ /* * The irqs_disabled() check is for resume from RAM. @@ -199,35 +226,120 @@ static inline acpi_thread_id acpi_os_get_thread_id(void) * However, boot has (system_state != SYSTEM_RUNNING) * to quiet __might_sleep() in kmalloc() and resume does not. */ -#include -static inline void *acpi_os_allocate(acpi_size size) +static inline void * +AcpiOsAllocate ( + ACPI_SIZE Size) { - return kmalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); + return kmalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL); } +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate -static inline void *acpi_os_allocate_zeroed(acpi_size size) +/* Use native linux version of AcpiOsAllocateZeroed */ + +static inline void * +AcpiOsAllocateZeroed ( + ACPI_SIZE Size) { - return kzalloc(size, irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); + return kzalloc (Size, irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL); } +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed +#define USE_NATIVE_ALLOCATE_ZEROED -static inline void *acpi_os_acquire_object(acpi_cache_t * cache) +static inline void +AcpiOsFree ( + void *Memory) { - return kmem_cache_zalloc(cache, - irqs_disabled() ? GFP_ATOMIC : GFP_KERNEL); + kfree (Memory); } +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree -#define ACPI_ALLOCATE(a) acpi_os_allocate(a) -#define ACPI_ALLOCATE_ZEROED(a) acpi_os_allocate_zeroed(a) -#define ACPI_FREE(a) kfree(a) +static inline void * +AcpiOsAcquireObject ( + ACPI_CACHE_T *Cache) +{ + return kmem_cache_zalloc (Cache, + irqs_disabled () ? GFP_ATOMIC : GFP_KERNEL); +} +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject -/* Used within ACPICA to show where it is safe to preempt execution */ +static inline ACPI_THREAD_ID +AcpiOsGetThreadId ( + void) +{ + return (ACPI_THREAD_ID) (unsigned long) current; +} +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId +#ifndef CONFIG_PREEMPT + +/* + * Used within ACPICA to show where it is safe to preempt execution + * when CONFIG_PREEMPT=n + */ #define ACPI_PREEMPTION_POINT() \ do { \ if (!irqs_disabled()) \ cond_resched(); \ } while (0) +#endif + +/* + * When lockdep is enabled, the spin_lock_init() macro stringifies it's + * argument and uses that as a name for the lock in debugging. + * By executing spin_lock_init() in a macro the key changes from "lock" for + * all locks to the name of the argument of acpi_os_create_lock(), which + * prevents lockdep from reporting false positives for ACPICA locks. + */ +#define AcpiOsCreateLock(__Handle) \ + ({ \ + spinlock_t *Lock = ACPI_ALLOCATE(sizeof(*Lock)); \ + if (Lock) { \ + *(__Handle) = Lock; \ + spin_lock_init(*(__Handle)); \ + } \ + Lock ? AE_OK : AE_NO_MEMORY; \ + }) +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock + +void __iomem * +AcpiOsMapMemory ( + ACPI_PHYSICAL_ADDRESS Where, + ACPI_SIZE Length); +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory + +void +AcpiOsUnmapMemory ( + void __iomem *LogicalAddress, + ACPI_SIZE Size); +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory + +/* + * OSL interfaces used by debugger/disassembler + */ +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable + +/* + * OSL interfaces used by utilities + */ +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename +#define ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory + +/* + * OSL interfaces added by Linux + */ +void +EarlyAcpiOsUnmapMemory ( + void __iomem *Virt, + ACPI_SIZE Size); + #endif /* __KERNEL__ */ #endif /* __ACLINUX_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acdos16.h b/reactos/drivers/bus/acpi/acpica/include/platform/acmacosx.h similarity index 75% rename from reactos/drivers/bus/acpi/acpica/include/platform/acdos16.h rename to reactos/drivers/bus/acpi/acpica/include/platform/acmacosx.h index f3aead6084b..e82d08bd2f2 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acdos16.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acmacosx.h @@ -1,7 +1,6 @@ /****************************************************************************** * - * Name: acdos16.h - DOS specific defines, etc. - * $Revision: 1.18 $ + * Name: acmacosx.h - OS specific defines, etc. for Mac OS X * *****************************************************************************/ @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2008, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -114,51 +113,18 @@ * *****************************************************************************/ -#ifndef __ACDOS16_H__ -#define __ACDOS16_H__ +#ifndef __ACMACOSX_H__ +#define __ACMACOSX_H__ +#include "aclinux.h" -/* NOTE: 16-bit ACPICA is no longer supported, December 2006 */ +#ifdef __APPLE__ +#define sem_destroy sem_close +#define ACPI_USE_ALTERNATE_TIMEOUT +#endif /* __APPLE__ */ -#define ACPI_USE_STANDARD_HEADERS -#define ACPI_MACHINE_WIDTH 16 +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wformat-nonliteral" +#endif -/* Use a struct for 64-bit integers */ - -typedef struct -{ - unsigned long Lo; - unsigned long Hi; - -} COMPILER_DEPENDENT_UINT64; - -typedef struct -{ - long Lo; - long Hi; - -} COMPILER_DEPENDENT_INT64; - -/* - * Calling conventions: - * - * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) - * ACPI_EXTERNAL_XFACE - External ACPI interfaces - * ACPI_INTERNAL_XFACE - Internal ACPI interfaces - * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces - */ -#define ACPI_SYSTEM_XFACE __cdecl -#define ACPI_EXTERNAL_XFACE -#define ACPI_INTERNAL_XFACE -#define ACPI_INTERNAL_VAR_XFACE __cdecl - -#define ACPI_ASM_MACROS -#define BREAKPOINT3 -#define ACPI_DISABLE_IRQS() -#define ACPI_ENABLE_IRQS() -#define halt() -#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) -#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) - - -#endif /* __ACDOS16_H__ */ +#endif /* __ACMACOSX_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h b/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h index 3d6f4ab3fdb..c9475eadd3c 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -202,11 +202,6 @@ } #endif -#ifdef ACPI_APPLICATION -#define ACPI_FLUSH_CPU_CACHE() -#else -#define ACPI_FLUSH_CPU_CACHE() __asm {WBINVD} -#endif /* warn C4100: unreferenced formal parameter */ #pragma warning(disable:4100) @@ -223,4 +218,22 @@ #pragma warning( disable : 4295 ) /* needed for acpredef.h array */ #endif + +/* Debug support. Must be last in this file, do not move. */ + +#ifdef _DEBUG +#include + +/* + * Debugging memory corruption issues with windows: + * Add #include to accommon.h if necessary. + * Add _ASSERTE(_CrtCheckMemory()); where needed to test memory integrity. + * This can quickly localize the memory corruption. + */ +#define ACPI_DEBUG_INITIALIZE() \ + _CrtSetDbgFlag (_CRTDBG_CHECK_ALWAYS_DF | \ + _CRTDBG_ALLOC_MEM_DF | _CRTDBG_CHECK_CRT_DF | \ + _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG)) +#endif + #endif /* __ACMSVC_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acnetbsd.h b/reactos/drivers/bus/acpi/acpica/include/platform/acnetbsd.h index b6af23eec86..376d1157d0f 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acnetbsd.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acnetbsd.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acos2.h b/reactos/drivers/bus/acpi/acpica/include/platform/acos2.h index 5d692040da6..5ddd22cf73b 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acos2.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acos2.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h b/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h index cb046845c3c..cf1a5eea2ea 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,10 +121,7 @@ /* Windows uses VC */ #ifdef _MSC_VER #include "acmsvc.h" -#elif __GNUC__ -#include "acgcc.h" #endif - /*! [End] no source code translation !*/ #define ACPI_MACHINE_WIDTH 32 @@ -144,6 +141,7 @@ typedef unsigned int u32; typedef COMPILER_DEPENDENT_UINT64 u64; #endif + /* * Handle platform- and compiler-specific assembly language differences. * @@ -152,4 +150,69 @@ typedef COMPILER_DEPENDENT_UINT64 u64; * 2) Interrupts are turned off during ACPI register setup */ +/*! [Begin] no source code translation */ + +#ifdef ACPI_APPLICATION +#define ACPI_FLUSH_CPU_CACHE() +#else +#define ACPI_FLUSH_CPU_CACHE() __asm {WBINVD} +#endif + +#ifdef _DEBUG +#define ACPI_SIMPLE_RETURN_MACROS +#endif + +/*! [End] no source code translation !*/ + +/* + * Global Lock acquire/release code + * + * Note: Handles case where the FACS pointer is null + */ +#define ACPI_ACQUIRE_GLOBAL_LOCK(FacsPtr, Acq) __asm \ +{ \ + __asm mov eax, 0xFF \ + __asm mov ecx, FacsPtr \ + __asm or ecx, ecx \ + __asm jz exit_acq \ + __asm lea ecx, [ecx].GlobalLock \ + \ + __asm acq10: \ + __asm mov eax, [ecx] \ + __asm mov edx, eax \ + __asm and edx, 0xFFFFFFFE \ + __asm bts edx, 1 \ + __asm adc edx, 0 \ + __asm lock cmpxchg dword ptr [ecx], edx \ + __asm jnz acq10 \ + \ + __asm cmp dl, 3 \ + __asm sbb eax, eax \ + \ + __asm exit_acq: \ + __asm mov Acq, al \ +} + +#define ACPI_RELEASE_GLOBAL_LOCK(FacsPtr, Pnd) __asm \ +{ \ + __asm xor eax, eax \ + __asm mov ecx, FacsPtr \ + __asm or ecx, ecx \ + __asm jz exit_rel \ + __asm lea ecx, [ecx].GlobalLock \ + \ + __asm Rel10: \ + __asm mov eax, [ecx] \ + __asm mov edx, eax \ + __asm and edx, 0xFFFFFFFC \ + __asm lock cmpxchg dword ptr [ecx], edx \ + __asm jnz Rel10 \ + \ + __asm cmp dl, 3 \ + __asm and eax, 1 \ + \ + __asm exit_rel: \ + __asm mov Pnd, al \ +} + #endif /* __ACWIN_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acwin64.h b/reactos/drivers/bus/acpi/acpica/include/platform/acwin64.h index d67f4cde66e..575134bde8e 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acwin64.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acwin64.h @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -151,5 +151,6 @@ #endif +/*! [End] no source code translation !*/ #endif /* __ACWIN_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c b/reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c index e098e52b0e4..4c8bd30b339 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsaccess.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -193,12 +193,12 @@ AcpiNsRootInitialize ( Status = AcpiNsLookup (NULL, InitVal->Name, InitVal->Type, ACPI_IMODE_LOAD_PASS2, ACPI_NS_NO_UPSEARCH, NULL, &NewNode); - - if (ACPI_FAILURE (Status) || (!NewNode)) /* Must be on same line for code converter */ + if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, "Could not create predefined name %s", InitVal->Name)); + continue; } /* @@ -239,6 +239,7 @@ AcpiNsRootInitialize ( switch (InitVal->Type) { case ACPI_TYPE_METHOD: + ObjDesc->Method.ParamCount = (UINT8) ACPI_TO_INTEGER (Val); ObjDesc->Common.Flags |= AOPOBJ_DATA_VALID; @@ -260,7 +261,6 @@ AcpiNsRootInitialize ( ObjDesc->Integer.Value = ACPI_TO_INTEGER (Val); break; - case ACPI_TYPE_STRING: /* Build an object around the static string */ @@ -270,7 +270,6 @@ AcpiNsRootInitialize ( ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER; break; - case ACPI_TYPE_MUTEX: ObjDesc->Mutex.Node = NewNode; @@ -303,7 +302,6 @@ AcpiNsRootInitialize ( } break; - default: ACPI_ERROR ((AE_INFO, "Unsupported initial type value 0x%X", @@ -522,8 +520,8 @@ AcpiNsLookup ( /* Current scope has no parent scope */ ACPI_ERROR ((AE_INFO, - "ACPI path has too many parent prefixes (^) " - "- reached beyond root node")); + "%s: Path has too many parent prefixes (^) " + "- reached beyond root node", Pathname)); return_ACPI_STATUS (AE_NOT_FOUND); } } @@ -769,4 +767,3 @@ AcpiNsLookup ( *ReturnNode = ThisNode; return_ACPI_STATUS (AE_OK); } - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsalloc.c b/reactos/drivers/bus/acpi/acpica/namespace/nsalloc.c index de9f2293b00..d1701b8dab1 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsalloc.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsalloc.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -193,6 +193,7 @@ AcpiNsDeleteNode ( ACPI_NAMESPACE_NODE *Node) { ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *NextDesc; ACPI_FUNCTION_NAME (NsDeleteNode); @@ -203,12 +204,13 @@ AcpiNsDeleteNode ( AcpiNsDetachObject (Node); /* - * Delete an attached data object if present (an object that was created - * and attached via AcpiAttachData). Note: After any normal object is - * detached above, the only possible remaining object is a data object. + * Delete an attached data object list if present (objects that were + * attached via AcpiAttachData). Note: After any normal object is + * detached above, the only possible remaining object(s) are data + * objects, in a linked list. */ ObjDesc = Node->Object; - if (ObjDesc && + while (ObjDesc && (ObjDesc->Common.Type == ACPI_TYPE_LOCAL_DATA)) { /* Invoke the attached data deletion handler if present */ @@ -218,7 +220,16 @@ AcpiNsDeleteNode ( ObjDesc->Data.Handler (Node, ObjDesc->Data.Pointer); } + NextDesc = ObjDesc->Common.NextObject; AcpiUtRemoveReference (ObjDesc); + ObjDesc = NextDesc; + } + + /* Special case for the statically allocated root node */ + + if (Node == AcpiGbl_RootNode) + { + return; } /* Now we can delete the node */ @@ -448,7 +459,7 @@ AcpiNsDeleteChildren ( * * RETURN: None. * - * DESCRIPTION: Delete a subtree of the namespace. This includes all objects + * DESCRIPTION: Delete a subtree of the namespace. This includes all objects * stored within the subtree. * ******************************************************************************/ @@ -544,7 +555,7 @@ AcpiNsDeleteNamespaceSubtree ( * RETURN: Status * * DESCRIPTION: Delete entries within the namespace that are owned by a - * specific ID. Used to delete entire ACPI tables. All + * specific ID. Used to delete entire ACPI tables. All * reference counts are updated. * * MUTEX: Locks namespace during deletion walk. @@ -656,5 +667,3 @@ AcpiNsDeleteNamespaceByOwner ( (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); return_VOID; } - - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsarguments.c b/reactos/drivers/bus/acpi/acpica/namespace/nsarguments.c new file mode 100644 index 00000000000..792cd596a3c --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsarguments.c @@ -0,0 +1,375 @@ +/****************************************************************************** + * + * Module Name: nsarguments - Validation of args for ACPI predefined methods + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" +#include "acpredef.h" + + +#define _COMPONENT ACPI_NAMESPACE + ACPI_MODULE_NAME ("nsarguments") + + +/******************************************************************************* + * + * FUNCTION: AcpiNsCheckArgumentTypes + * + * PARAMETERS: Info - Method execution information block + * + * RETURN: None + * + * DESCRIPTION: Check the incoming argument count and all argument types + * against the argument type list for a predefined name. + * + ******************************************************************************/ + +void +AcpiNsCheckArgumentTypes ( + ACPI_EVALUATE_INFO *Info) +{ + UINT16 ArgTypeList; + UINT8 ArgCount; + UINT8 ArgType; + UINT8 UserArgType; + UINT32 i; + + + /* If not a predefined name, cannot typecheck args */ + + if (!Info->Predefined) + { + return; + } + + ArgTypeList = Info->Predefined->Info.ArgumentList; + ArgCount = METHOD_GET_ARG_COUNT (ArgTypeList); + + /* Typecheck all arguments */ + + for (i = 0; ((i < ArgCount) && (i < Info->ParamCount)); i++) + { + ArgType = METHOD_GET_NEXT_TYPE (ArgTypeList); + UserArgType = Info->Parameters[i]->Common.Type; + + if (UserArgType != ArgType) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, ACPI_WARN_ALWAYS, + "Argument #%u type mismatch - " + "Found [%s], ACPI requires [%s]", (i + 1), + AcpiUtGetTypeName (UserArgType), + AcpiUtGetTypeName (ArgType))); + } + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsCheckAcpiCompliance + * + * PARAMETERS: Pathname - Full pathname to the node (for error msgs) + * Node - Namespace node for the method/object + * Predefined - Pointer to entry in predefined name table + * + * RETURN: None + * + * DESCRIPTION: Check that the declared parameter count (in ASL/AML) for a + * predefined name is what is expected (matches what is defined in + * the ACPI specification for this predefined name.) + * + ******************************************************************************/ + +void +AcpiNsCheckAcpiCompliance ( + char *Pathname, + ACPI_NAMESPACE_NODE *Node, + const ACPI_PREDEFINED_INFO *Predefined) +{ + UINT32 AmlParamCount; + UINT32 RequiredParamCount; + + + if (!Predefined) + { + return; + } + + /* Get the ACPI-required arg count from the predefined info table */ + + RequiredParamCount = METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList); + + /* + * If this object is not a control method, we can check if the ACPI + * spec requires that it be a method. + */ + if (Node->Type != ACPI_TYPE_METHOD) + { + if (RequiredParamCount > 0) + { + /* Object requires args, must be implemented as a method */ + + ACPI_BIOS_ERROR_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Object (%s) must be a control method with %u arguments", + AcpiUtGetTypeName (Node->Type), RequiredParamCount)); + } + else if (!RequiredParamCount && !Predefined->Info.ExpectedBtypes) + { + /* Object requires no args and no return value, must be a method */ + + ACPI_BIOS_ERROR_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Object (%s) must be a control method " + "with no arguments and no return value", + AcpiUtGetTypeName (Node->Type))); + } + + return; + } + + /* + * This is a control method. + * Check that the ASL/AML-defined parameter count for this method + * matches the ACPI-required parameter count + * + * Some methods are allowed to have a "minimum" number of args (_SCP) + * because their definition in ACPI has changed over time. + * + * Note: These are BIOS errors in the declaration of the object + */ + AmlParamCount = Node->Object->Method.ParamCount; + + if (AmlParamCount < RequiredParamCount) + { + ACPI_BIOS_ERROR_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Insufficient arguments - " + "ASL declared %u, ACPI requires %u", + AmlParamCount, RequiredParamCount)); + } + else if ((AmlParamCount > RequiredParamCount) && + !(Predefined->Info.ArgumentList & ARG_COUNT_IS_MINIMUM)) + { + ACPI_BIOS_ERROR_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Excess arguments - " + "ASL declared %u, ACPI requires %u", + AmlParamCount, RequiredParamCount)); + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsCheckArgumentCount + * + * PARAMETERS: Pathname - Full pathname to the node (for error msgs) + * Node - Namespace node for the method/object + * UserParamCount - Number of args passed in by the caller + * Predefined - Pointer to entry in predefined name table + * + * RETURN: None + * + * DESCRIPTION: Check that incoming argument count matches the declared + * parameter count (in the ASL/AML) for an object. + * + ******************************************************************************/ + +void +AcpiNsCheckArgumentCount ( + char *Pathname, + ACPI_NAMESPACE_NODE *Node, + UINT32 UserParamCount, + const ACPI_PREDEFINED_INFO *Predefined) +{ + UINT32 AmlParamCount; + UINT32 RequiredParamCount; + + + if (!Predefined) + { + /* + * Not a predefined name. Check the incoming user argument count + * against the count that is specified in the method/object. + */ + if (Node->Type != ACPI_TYPE_METHOD) + { + if (UserParamCount) + { + ACPI_INFO_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "%u arguments were passed to a non-method ACPI object (%s)", + UserParamCount, AcpiUtGetTypeName (Node->Type))); + } + + return; + } + + /* + * This is a control method. Check the parameter count. + * We can only check the incoming argument count against the + * argument count declared for the method in the ASL/AML. + * + * Emit a message if too few or too many arguments have been passed + * by the caller. + * + * Note: Too many arguments will not cause the method to + * fail. However, the method will fail if there are too few + * arguments and the method attempts to use one of the missing ones. + */ + AmlParamCount = Node->Object->Method.ParamCount; + + if (UserParamCount < AmlParamCount) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Insufficient arguments - " + "Caller passed %u, method requires %u", + UserParamCount, AmlParamCount)); + } + else if (UserParamCount > AmlParamCount) + { + ACPI_INFO_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Excess arguments - " + "Caller passed %u, method requires %u", + UserParamCount, AmlParamCount)); + } + + return; + } + + /* + * This is a predefined name. Validate the user-supplied parameter + * count against the ACPI specification. We don't validate against + * the method itself because what is important here is that the + * caller is in conformance with the spec. (The arg count for the + * method was checked against the ACPI spec earlier.) + * + * Some methods are allowed to have a "minimum" number of args (_SCP) + * because their definition in ACPI has changed over time. + */ + RequiredParamCount = METHOD_GET_ARG_COUNT (Predefined->Info.ArgumentList); + + if (UserParamCount < RequiredParamCount) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Insufficient arguments - " + "Caller passed %u, ACPI requires %u", + UserParamCount, RequiredParamCount)); + } + else if ((UserParamCount > RequiredParamCount) && + !(Predefined->Info.ArgumentList & ARG_COUNT_IS_MINIMUM)) + { + ACPI_INFO_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Excess arguments - " + "Caller passed %u, ACPI requires %u", + UserParamCount, RequiredParamCount)); + } +} diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsconvert.c b/reactos/drivers/bus/acpi/acpica/namespace/nsconvert.c new file mode 100644 index 00000000000..5bd686819ba --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsconvert.c @@ -0,0 +1,556 @@ +/****************************************************************************** + * + * Module Name: nsconvert - Object conversions for objects returned by + * predefined methods + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __NSCONVERT_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" +#include "acinterp.h" +#include "acpredef.h" +#include "amlresrc.h" + +#define _COMPONENT ACPI_NAMESPACE + ACPI_MODULE_NAME ("nsconvert") + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToInteger + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a String/Buffer object to an Integer. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiNsConvertToInteger ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_STATUS Status; + UINT64 Value = 0; + UINT32 i; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_STRING: + + /* String-to-Integer conversion */ + + Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer, + ACPI_ANY_BASE, &Value); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + case ACPI_TYPE_BUFFER: + + /* Buffer-to-Integer conversion. Max buffer size is 64 bits. */ + + if (OriginalObject->Buffer.Length > 8) + { + return (AE_AML_OPERAND_TYPE); + } + + /* Extract each buffer byte to create the integer */ + + for (i = 0; i < OriginalObject->Buffer.Length; i++) + { + Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8)); + } + break; + + default: + + return (AE_AML_OPERAND_TYPE); + } + + NewObject = AcpiUtCreateIntegerObject (Value); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToString + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Integer/Buffer object to a String. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiNsConvertToString ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_SIZE Length; + ACPI_STATUS Status; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_INTEGER: + /* + * Integer-to-String conversion. Commonly, convert + * an integer of value 0 to a NULL string. The last element of + * _BIF and _BIX packages occasionally need this fix. + */ + if (OriginalObject->Integer.Value == 0) + { + /* Allocate a new NULL string object */ + + NewObject = AcpiUtCreateStringObject (0); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + } + else + { + Status = AcpiExConvertToString (OriginalObject, &NewObject, + ACPI_IMPLICIT_CONVERT_HEX); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + break; + + case ACPI_TYPE_BUFFER: + /* + * Buffer-to-String conversion. Use a ToString + * conversion, no transform performed on the buffer data. The best + * example of this is the _BIF method, where the string data from + * the battery is often (incorrectly) returned as buffer object(s). + */ + Length = 0; + while ((Length < OriginalObject->Buffer.Length) && + (OriginalObject->Buffer.Pointer[Length])) + { + Length++; + } + + /* Allocate a new string object */ + + NewObject = AcpiUtCreateStringObject (Length); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + /* + * Copy the raw buffer data with no transform. String is already NULL + * terminated at Length+1. + */ + ACPI_MEMCPY (NewObject->String.Pointer, + OriginalObject->Buffer.Pointer, Length); + break; + + default: + + return (AE_AML_OPERAND_TYPE); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToBuffer + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a Integer/String/Package object to a Buffer. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiNsConvertToBuffer ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT **Elements; + UINT32 *DwordBuffer; + UINT32 Count; + UINT32 i; + + + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_INTEGER: + /* + * Integer-to-Buffer conversion. + * Convert the Integer to a packed-byte buffer. _MAT and other + * objects need this sometimes, if a read has been performed on a + * Field object that is less than or equal to the global integer + * size (32 or 64 bits). + */ + Status = AcpiExConvertToBuffer (OriginalObject, &NewObject); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + case ACPI_TYPE_STRING: + + /* String-to-Buffer conversion. Simple data copy */ + + NewObject = AcpiUtCreateBufferObject (OriginalObject->String.Length); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + ACPI_MEMCPY (NewObject->Buffer.Pointer, + OriginalObject->String.Pointer, OriginalObject->String.Length); + break; + + case ACPI_TYPE_PACKAGE: + /* + * This case is often seen for predefined names that must return a + * Buffer object with multiple DWORD integers within. For example, + * _FDE and _GTM. The Package can be converted to a Buffer. + */ + + /* All elements of the Package must be integers */ + + Elements = OriginalObject->Package.Elements; + Count = OriginalObject->Package.Count; + + for (i = 0; i < Count; i++) + { + if ((!*Elements) || + ((*Elements)->Common.Type != ACPI_TYPE_INTEGER)) + { + return (AE_AML_OPERAND_TYPE); + } + Elements++; + } + + /* Create the new buffer object to replace the Package */ + + NewObject = AcpiUtCreateBufferObject (ACPI_MUL_4 (Count)); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + /* Copy the package elements (integers) to the buffer as DWORDs */ + + Elements = OriginalObject->Package.Elements; + DwordBuffer = ACPI_CAST_PTR (UINT32, NewObject->Buffer.Pointer); + + for (i = 0; i < Count; i++) + { + *DwordBuffer = (UINT32) (*Elements)->Integer.Value; + DwordBuffer++; + Elements++; + } + break; + + default: + + return (AE_AML_OPERAND_TYPE); + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToUnicode + * + * PARAMETERS: OriginalObject - ASCII String Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful. + * + * DESCRIPTION: Attempt to convert a String object to a Unicode string Buffer. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiNsConvertToUnicode ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + char *AsciiString; + UINT16 *UnicodeBuffer; + UINT32 UnicodeLength; + UINT32 i; + + + if (!OriginalObject) + { + return (AE_OK); + } + + /* If a Buffer was returned, it must be at least two bytes long */ + + if (OriginalObject->Common.Type == ACPI_TYPE_BUFFER) + { + if (OriginalObject->Buffer.Length < 2) + { + return (AE_AML_OPERAND_VALUE); + } + + *ReturnObject = NULL; + return (AE_OK); + } + + /* + * The original object is an ASCII string. Convert this string to + * a unicode buffer. + */ + AsciiString = OriginalObject->String.Pointer; + UnicodeLength = (OriginalObject->String.Length * 2) + 2; + + /* Create a new buffer object for the Unicode data */ + + NewObject = AcpiUtCreateBufferObject (UnicodeLength); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + UnicodeBuffer = ACPI_CAST_PTR (UINT16, NewObject->Buffer.Pointer); + + /* Convert ASCII to Unicode */ + + for (i = 0; i < OriginalObject->String.Length; i++) + { + UnicodeBuffer[i] = (UINT16) AsciiString[i]; + } + + *ReturnObject = NewObject; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsConvertToResource + * + * PARAMETERS: OriginalObject - Object to be converted + * ReturnObject - Where the new converted object is returned + * + * RETURN: Status. AE_OK if conversion was successful + * + * DESCRIPTION: Attempt to convert a Integer object to a ResourceTemplate + * Buffer. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiNsConvertToResource ( + ACPI_OPERAND_OBJECT *OriginalObject, + ACPI_OPERAND_OBJECT **ReturnObject) +{ + ACPI_OPERAND_OBJECT *NewObject; + UINT8 *Buffer; + + + /* + * We can fix the following cases for an expected resource template: + * 1. No return value (interpreter slack mode is disabled) + * 2. A "Return (Zero)" statement + * 3. A "Return empty buffer" statement + * + * We will return a buffer containing a single EndTag + * resource descriptor. + */ + if (OriginalObject) + { + switch (OriginalObject->Common.Type) + { + case ACPI_TYPE_INTEGER: + + /* We can only repair an Integer==0 */ + + if (OriginalObject->Integer.Value) + { + return (AE_AML_OPERAND_TYPE); + } + break; + + case ACPI_TYPE_BUFFER: + + if (OriginalObject->Buffer.Length) + { + /* Additional checks can be added in the future */ + + *ReturnObject = NULL; + return (AE_OK); + } + break; + + case ACPI_TYPE_STRING: + default: + + return (AE_AML_OPERAND_TYPE); + } + } + + /* Create the new buffer object for the resource descriptor */ + + NewObject = AcpiUtCreateBufferObject (2); + if (!NewObject) + { + return (AE_NO_MEMORY); + } + + Buffer = ACPI_CAST_PTR (UINT8, NewObject->Buffer.Pointer); + + /* Initialize the Buffer with a single EndTag descriptor */ + + Buffer[0] = (ACPI_RESOURCE_NAME_END_TAG | ASL_RDESC_END_TAG_SIZE); + Buffer[1] = 0x00; + + *ReturnObject = NewObject; + return (AE_OK); +} diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsdump.c b/reactos/drivers/bus/acpi/acpica/namespace/nsdump.c index 2bc0eba9a0e..48230465437 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsdump.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsdump.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -119,6 +119,7 @@ #include "acpi.h" #include "accommon.h" #include "acnamesp.h" +#include "acoutput.h" #define _COMPONENT ACPI_NAMESPACE @@ -141,6 +142,22 @@ AcpiNsDumpOneDevice ( #if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) + +static ACPI_STATUS +AcpiNsDumpOneObjectPath ( + ACPI_HANDLE ObjHandle, + UINT32 Level, + void *Context, + void **ReturnValue); + +static ACPI_STATUS +AcpiNsGetMaxDepth ( + ACPI_HANDLE ObjHandle, + UINT32 Level, + void *Context, + void **ReturnValue); + + /******************************************************************************* * * FUNCTION: AcpiNsPrintPathname @@ -165,7 +182,9 @@ AcpiNsPrintPathname ( ACPI_FUNCTION_NAME (NsPrintPathname); - if (!(AcpiDbgLevel & ACPI_LV_NAMES) || !(AcpiDbgLayer & ACPI_NAMESPACE)) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_NAMES, ACPI_NAMESPACE)) { return; } @@ -224,7 +243,7 @@ AcpiNsDumpPathname ( /* Do this only if the requested debug level and component are enabled */ - if (!(AcpiDbgLevel & Level) || !(AcpiDbgLayer & Component)) + if (!ACPI_IS_DEBUG_ENABLED (Level, Component)) { return_VOID; } @@ -343,7 +362,23 @@ AcpiNsDumpOneObject ( if (!ObjDesc) { - /* No attached object, we are done */ + /* No attached object. Some types should always have an object */ + + switch (Type) + { + case ACPI_TYPE_INTEGER: + case ACPI_TYPE_PACKAGE: + case ACPI_TYPE_BUFFER: + case ACPI_TYPE_STRING: + case ACPI_TYPE_METHOD: + + AcpiOsPrintf (""); + break; + + default: + + break; + } AcpiOsPrintf ("\n"); return (AE_OK); @@ -353,18 +388,16 @@ AcpiNsDumpOneObject ( { case ACPI_TYPE_PROCESSOR: - AcpiOsPrintf ("ID %X Len %.4X Addr %p\n", + AcpiOsPrintf ("ID %02X Len %02X Addr %p\n", ObjDesc->Processor.ProcId, ObjDesc->Processor.Length, ACPI_CAST_PTR (void, ObjDesc->Processor.Address)); break; - case ACPI_TYPE_DEVICE: AcpiOsPrintf ("Notify Object: %p\n", ObjDesc); break; - case ACPI_TYPE_METHOD: AcpiOsPrintf ("Args %X Len %.4X Aml %p\n", @@ -372,14 +405,12 @@ AcpiNsDumpOneObject ( ObjDesc->Method.AmlLength, ObjDesc->Method.AmlStart); break; - case ACPI_TYPE_INTEGER: AcpiOsPrintf ("= %8.8X%8.8X\n", ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value)); break; - case ACPI_TYPE_PACKAGE: if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID) @@ -393,7 +424,6 @@ AcpiNsDumpOneObject ( } break; - case ACPI_TYPE_BUFFER: if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID) @@ -419,7 +449,6 @@ AcpiNsDumpOneObject ( } break; - case ACPI_TYPE_STRING: AcpiOsPrintf ("Len %.2X ", ObjDesc->String.Length); @@ -427,7 +456,6 @@ AcpiNsDumpOneObject ( AcpiOsPrintf ("\n"); break; - case ACPI_TYPE_REGION: AcpiOsPrintf ("[%s]", @@ -444,13 +472,11 @@ AcpiNsDumpOneObject ( } break; - case ACPI_TYPE_LOCAL_REFERENCE: AcpiOsPrintf ("[%s]\n", AcpiUtGetReferenceName (ObjDesc)); break; - case ACPI_TYPE_BUFFER_FIELD: if (ObjDesc->BufferField.BufferObj && @@ -462,7 +488,6 @@ AcpiNsDumpOneObject ( } break; - case ACPI_TYPE_LOCAL_REGION_FIELD: AcpiOsPrintf ("Rgn [%4.4s]", @@ -470,7 +495,6 @@ AcpiNsDumpOneObject ( ObjDesc->CommonField.RegionObj->Region.Node)); break; - case ACPI_TYPE_LOCAL_BANK_FIELD: AcpiOsPrintf ("Rgn [%4.4s] Bnk [%4.4s]", @@ -480,7 +504,6 @@ AcpiNsDumpOneObject ( ObjDesc->BankField.BankObj->CommonField.Node)); break; - case ACPI_TYPE_LOCAL_INDEX_FIELD: AcpiOsPrintf ("Idx [%4.4s] Dat [%4.4s]", @@ -490,7 +513,6 @@ AcpiNsDumpOneObject ( ObjDesc->IndexField.DataObj->CommonField.Node)); break; - case ACPI_TYPE_LOCAL_ALIAS: case ACPI_TYPE_LOCAL_METHOD_ALIAS: @@ -521,11 +543,11 @@ AcpiNsDumpOneObject ( break; default: + break; } break; - case ACPI_DISPLAY_OBJECTS: AcpiOsPrintf ("O:%p", ObjDesc); @@ -574,7 +596,6 @@ AcpiNsDumpOneObject ( } break; - default: AcpiOsPrintf ("\n"); break; @@ -661,30 +682,37 @@ AcpiNsDumpOneObject ( goto Cleanup; case ACPI_TYPE_BUFFER_FIELD: + ObjDesc = (ACPI_OPERAND_OBJECT *) ObjDesc->BufferField.BufferObj; break; case ACPI_TYPE_PACKAGE: + ObjDesc = (void *) ObjDesc->Package.Elements; break; case ACPI_TYPE_METHOD: + ObjDesc = (void *) ObjDesc->Method.AmlStart; break; case ACPI_TYPE_LOCAL_REGION_FIELD: + ObjDesc = (void *) ObjDesc->Field.RegionObj; break; case ACPI_TYPE_LOCAL_BANK_FIELD: + ObjDesc = (void *) ObjDesc->BankField.RegionObj; break; case ACPI_TYPE_LOCAL_INDEX_FIELD: + ObjDesc = (void *) ObjDesc->IndexField.IndexObj; break; default: + goto Cleanup; } @@ -756,6 +784,149 @@ AcpiNsDumpObjects ( } +/******************************************************************************* + * + * FUNCTION: AcpiNsDumpOneObjectPath, AcpiNsGetMaxDepth + * + * PARAMETERS: ObjHandle - Node to be dumped + * Level - Nesting level of the handle + * Context - Passed into WalkNamespace + * ReturnValue - Not used + * + * RETURN: Status + * + * DESCRIPTION: Dump the full pathname to a namespace object. AcpNsGetMaxDepth + * computes the maximum nesting depth in the namespace tree, in + * order to simplify formatting in AcpiNsDumpOneObjectPath. + * These procedures are UserFunctions called by AcpiNsWalkNamespace. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsDumpOneObjectPath ( + ACPI_HANDLE ObjHandle, + UINT32 Level, + void *Context, + void **ReturnValue) +{ + UINT32 MaxLevel = *((UINT32 *) Context); + char *Pathname; + ACPI_NAMESPACE_NODE *Node; + int PathIndent; + + + if (!ObjHandle) + { + return (AE_OK); + } + + Node = AcpiNsValidateHandle (ObjHandle); + if (!Node) + { + /* Ignore bad node during namespace walk */ + + return (AE_OK); + } + + Pathname = AcpiNsGetExternalPathname (Node); + + PathIndent = 1; + if (Level <= MaxLevel) + { + PathIndent = MaxLevel - Level + 1; + } + + AcpiOsPrintf ("%2d%*s%-12s%*s", + Level, Level, " ", AcpiUtGetTypeName (Node->Type), + PathIndent, " "); + + AcpiOsPrintf ("%s\n", &Pathname[1]); + ACPI_FREE (Pathname); + return (AE_OK); +} + + +static ACPI_STATUS +AcpiNsGetMaxDepth ( + ACPI_HANDLE ObjHandle, + UINT32 Level, + void *Context, + void **ReturnValue) +{ + UINT32 *MaxLevel = (UINT32 *) Context; + + + if (Level > *MaxLevel) + { + *MaxLevel = Level; + } + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsDumpObjectPaths + * + * PARAMETERS: Type - Object type to be dumped + * DisplayType - 0 or ACPI_DISPLAY_SUMMARY + * MaxDepth - Maximum depth of dump. Use ACPI_UINT32_MAX + * for an effectively unlimited depth. + * OwnerId - Dump only objects owned by this ID. Use + * ACPI_UINT32_MAX to match all owners. + * StartHandle - Where in namespace to start/end search + * + * RETURN: None + * + * DESCRIPTION: Dump full object pathnames within the loaded namespace. Uses + * AcpiNsWalkNamespace in conjunction with AcpiNsDumpOneObjectPath. + * + ******************************************************************************/ + +void +AcpiNsDumpObjectPaths ( + ACPI_OBJECT_TYPE Type, + UINT8 DisplayType, + UINT32 MaxDepth, + ACPI_OWNER_ID OwnerId, + ACPI_HANDLE StartHandle) +{ + ACPI_STATUS Status; + UINT32 MaxLevel = 0; + + + ACPI_FUNCTION_ENTRY (); + + + /* + * Just lock the entire namespace for the duration of the dump. + * We don't want any changes to the namespace during this time, + * especially the temporary nodes since we are going to display + * them also. + */ + Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("Could not acquire namespace mutex\n"); + return; + } + + /* Get the max depth of the namespace tree, for formatting later */ + + (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, + ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES, + AcpiNsGetMaxDepth, NULL, (void *) &MaxLevel, NULL); + + /* Now dump the entire namespace */ + + (void) AcpiNsWalkNamespace (Type, StartHandle, MaxDepth, + ACPI_NS_WALK_NO_UNLOCK | ACPI_NS_WALK_TEMP_NODES, + AcpiNsDumpOneObjectPath, NULL, (void *) &MaxLevel, NULL); + + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); +} + + /******************************************************************************* * * FUNCTION: AcpiNsDumpEntry @@ -795,7 +966,7 @@ AcpiNsDumpEntry ( * * PARAMETERS: SearchBase - Root of subtree to be dumped, or * NS_ALL to dump the entire namespace - * MaxDepth - Maximum depth of dump. Use INT_MAX + * MaxDepth - Maximum depth of dump. Use INT_MAX * for an effectively unlimited depth. * * RETURN: None @@ -839,4 +1010,3 @@ AcpiNsDumpTables ( } #endif #endif - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsdumpdv.c b/reactos/drivers/bus/acpi/acpica/namespace/nsdumpdv.c index 98fb8bd0a64..ed1b8a9964c 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsdumpdv.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsdumpdv.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -214,7 +214,7 @@ AcpiNsDumpRootDevices ( return; } - Status = AcpiGetHandle (NULL, ACPI_NS_SYSTEM_BUS, &SysBusHandle); + Status = AcpiGetHandle (NULL, METHOD_NAME__SB_, &SysBusHandle); if (ACPI_FAILURE (Status)) { return; @@ -230,5 +230,3 @@ AcpiNsDumpRootDevices ( #endif #endif - - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nseval.c b/reactos/drivers/bus/acpi/acpica/namespace/nseval.c index c200e92b051..227a10326f8 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nseval.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nseval.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -140,7 +140,7 @@ AcpiNsExecModuleCode ( * * PARAMETERS: Info - Evaluation info block, contains: * PrefixNode - Prefix or Method/Object Node to execute - * Pathname - Name of method to execute, If NULL, the + * RelativePath - Name of method to execute, If NULL, the * Node is the object to execute * Parameters - List of parameters to pass to the method, * terminated by NULL. Params itself may be @@ -166,7 +166,6 @@ AcpiNsEvaluate ( ACPI_EVALUATE_INFO *Info) { ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; ACPI_FUNCTION_TRACE (NsEvaluate); @@ -177,80 +176,141 @@ AcpiNsEvaluate ( return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Initialize the return value to an invalid object */ - - Info->ReturnObject = NULL; - Info->ParamCount = 0; - - /* - * Get the actual namespace node for the target object. Handles these cases: - * - * 1) Null node, Pathname (absolute path) - * 2) Node, Pathname (path relative to Node) - * 3) Node, Null Pathname - */ - Status = AcpiNsGetNode (Info->PrefixNode, Info->Pathname, - ACPI_NS_NO_UPSEARCH, &Info->ResolvedNode); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* - * For a method alias, we must grab the actual method node so that proper - * scoping context will be established before execution. - */ - if (AcpiNsGetType (Info->ResolvedNode) == ACPI_TYPE_LOCAL_METHOD_ALIAS) - { - Info->ResolvedNode = - ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Info->ResolvedNode->Object); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n", Info->Pathname, - Info->ResolvedNode, AcpiNsGetAttachedObject (Info->ResolvedNode))); - - Node = Info->ResolvedNode; - - /* - * Two major cases here: - * - * 1) The object is a control method -- execute it - * 2) The object is not a method -- just return it's current value - */ - if (AcpiNsGetType (Info->ResolvedNode) == ACPI_TYPE_METHOD) + if (!Info->Node) { /* - * 1) Object is a control method - execute it + * Get the actual namespace node for the target object if we + * need to. Handles these cases: + * + * 1) Null node, valid pathname from root (absolute path) + * 2) Node and valid pathname (path relative to Node) + * 3) Node, Null pathname + */ + Status = AcpiNsGetNode (Info->PrefixNode, Info->RelativePathname, + ACPI_NS_NO_UPSEARCH, &Info->Node); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + /* + * For a method alias, we must grab the actual method node so that + * proper scoping context will be established before execution. + */ + if (AcpiNsGetType (Info->Node) == ACPI_TYPE_LOCAL_METHOD_ALIAS) + { + Info->Node = ACPI_CAST_PTR ( + ACPI_NAMESPACE_NODE, Info->Node->Object); + } + + /* Complete the info block initialization */ + + Info->ReturnObject = NULL; + Info->NodeFlags = Info->Node->Flags; + Info->ObjDesc = AcpiNsGetAttachedObject (Info->Node); + + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "%s [%p] Value %p\n", + Info->RelativePathname, Info->Node, + AcpiNsGetAttachedObject (Info->Node))); + + /* Get info if we have a predefined name (_HID, etc.) */ + + Info->Predefined = AcpiUtMatchPredefinedMethod (Info->Node->Name.Ascii); + + /* Get the full pathname to the object, for use in warning messages */ + + Info->FullPathname = AcpiNsGetExternalPathname (Info->Node); + if (!Info->FullPathname) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* Count the number of arguments being passed in */ + + Info->ParamCount = 0; + if (Info->Parameters) + { + while (Info->Parameters[Info->ParamCount]) + { + Info->ParamCount++; + } + + /* Warn on impossible argument count */ + + if (Info->ParamCount > ACPI_METHOD_NUM_ARGS) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, ACPI_WARN_ALWAYS, + "Excess arguments (%u) - using only %u", + Info->ParamCount, ACPI_METHOD_NUM_ARGS)); + + Info->ParamCount = ACPI_METHOD_NUM_ARGS; + } + } + + /* + * For predefined names: Check that the declared argument count + * matches the ACPI spec -- otherwise this is a BIOS error. + */ + AcpiNsCheckAcpiCompliance (Info->FullPathname, Info->Node, + Info->Predefined); + + /* + * For all names: Check that the incoming argument count for + * this method/object matches the actual ASL/AML definition. + */ + AcpiNsCheckArgumentCount (Info->FullPathname, Info->Node, + Info->ParamCount, Info->Predefined); + + /* For predefined names: Typecheck all incoming arguments */ + + AcpiNsCheckArgumentTypes (Info); + + /* + * Three major evaluation cases: + * + * 1) Object types that cannot be evaluated by definition + * 2) The object is a control method -- execute it + * 3) The object is not a method -- just return it's current value + */ + switch (AcpiNsGetType (Info->Node)) + { + case ACPI_TYPE_DEVICE: + case ACPI_TYPE_EVENT: + case ACPI_TYPE_MUTEX: + case ACPI_TYPE_REGION: + case ACPI_TYPE_THERMAL: + case ACPI_TYPE_LOCAL_SCOPE: + /* + * 1) Disallow evaluation of certain object types. For these, + * object evaluation is undefined and not supported. + */ + ACPI_ERROR ((AE_INFO, + "%s: Evaluation of object type [%s] is not supported", + Info->FullPathname, + AcpiUtGetTypeName (Info->Node->Type))); + + Status = AE_TYPE; + goto Cleanup; + + case ACPI_TYPE_METHOD: + /* + * 2) Object is a control method - execute it */ /* Verify that there is a method object associated with this node */ - Info->ObjDesc = AcpiNsGetAttachedObject (Info->ResolvedNode); if (!Info->ObjDesc) { - ACPI_ERROR ((AE_INFO, "Control method has no attached sub-object")); - return_ACPI_STATUS (AE_NULL_OBJECT); + ACPI_ERROR ((AE_INFO, "%s: Method has no attached sub-object", + Info->FullPathname)); + Status = AE_NULL_OBJECT; + goto Cleanup; } - /* Count the number of arguments being passed to the method */ - - if (Info->Parameters) - { - while (Info->Parameters[Info->ParamCount]) - { - if (Info->ParamCount > ACPI_METHOD_MAX_ARG) - { - return_ACPI_STATUS (AE_LIMIT); - } - Info->ParamCount++; - } - } - - ACPI_DUMP_PATHNAME (Info->ResolvedNode, "ACPI: Execute Method", - ACPI_LV_INFO, _COMPONENT); - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Method at AML address %p Length %X\n", + "**** Execute method [%s] at AML address %p length %X\n", + Info->FullPathname, Info->ObjDesc->Method.AmlStart + 1, Info->ObjDesc->Method.AmlLength - 1)); @@ -265,80 +325,58 @@ AcpiNsEvaluate ( AcpiExEnterInterpreter (); Status = AcpiPsExecuteMethod (Info); AcpiExExitInterpreter (); - } - else - { + break; + + default: /* - * 2) Object is not a method, return its current value - * - * Disallow certain object types. For these, "evaluation" is undefined. + * 3) All other non-method objects -- get the current object value */ - switch (Info->ResolvedNode->Type) - { - case ACPI_TYPE_DEVICE: - case ACPI_TYPE_EVENT: - case ACPI_TYPE_MUTEX: - case ACPI_TYPE_REGION: - case ACPI_TYPE_THERMAL: - case ACPI_TYPE_LOCAL_SCOPE: - - ACPI_ERROR ((AE_INFO, - "[%4.4s] Evaluation of object type [%s] is not supported", - Info->ResolvedNode->Name.Ascii, - AcpiUtGetTypeName (Info->ResolvedNode->Type))); - - return_ACPI_STATUS (AE_TYPE); - - default: - break; - } /* - * Objects require additional resolution steps (e.g., the Node may be - * a field that must be read, etc.) -- we can't just grab the object - * out of the node. + * Some objects require additional resolution steps (e.g., the Node + * may be a field that must be read, etc.) -- we can't just grab + * the object out of the node. * * Use ResolveNodeToValue() to get the associated value. * * NOTE: we can get away with passing in NULL for a walk state because - * ResolvedNode is guaranteed to not be a reference to either a method + * the Node is guaranteed to not be a reference to either a method * local or a method argument (because this interface is never called * from a running method.) * * Even though we do not directly invoke the interpreter for object - * resolution, we must lock it because we could access an opregion. - * The opregion access code assumes that the interpreter is locked. + * resolution, we must lock it because we could access an OpRegion. + * The OpRegion access code assumes that the interpreter is locked. */ AcpiExEnterInterpreter (); - /* Function has a strange interface */ + /* TBD: ResolveNodeToValue has a strange interface, fix */ - Status = AcpiExResolveNodeToValue (&Info->ResolvedNode, NULL); + Info->ReturnObject = ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Info->Node); + + Status = AcpiExResolveNodeToValue (ACPI_CAST_INDIRECT_PTR ( + ACPI_NAMESPACE_NODE, &Info->ReturnObject), NULL); AcpiExExitInterpreter (); - /* - * If AcpiExResolveNodeToValue() succeeded, the return value was placed - * in ResolvedNode. - */ - if (ACPI_SUCCESS (Status)) + if (ACPI_FAILURE (Status)) { - Status = AE_CTRL_RETURN_VALUE; - Info->ReturnObject = - ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Info->ResolvedNode); - - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returning object %p [%s]\n", - Info->ReturnObject, - AcpiUtGetObjectTypeName (Info->ReturnObject))); + goto Cleanup; } + + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, "Returned object %p [%s]\n", + Info->ReturnObject, + AcpiUtGetObjectTypeName (Info->ReturnObject))); + + Status = AE_CTRL_RETURN_VALUE; /* Always has a "return value" */ + break; } /* - * Check input argument count against the ASL-defined count for a method. - * Also check predefined names: argument count and return value against - * the ACPI specification. Some incorrect return value types are repaired. + * For predefined names, check the return value against the ACPI + * specification. Some incorrect return value types are repaired. */ - (void) AcpiNsCheckPredefinedNames (Node, Info->ParamCount, - Status, &Info->ReturnObject); + (void) AcpiNsCheckReturnValue (Info->Node, Info, Info->ParamCount, + Status, &Info->ReturnObject); /* Check if there is a return value that must be dealt with */ @@ -358,12 +396,16 @@ AcpiNsEvaluate ( } ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "*** Completed evaluation of object %s ***\n", Info->Pathname)); + "*** Completed evaluation of object %s ***\n", + Info->RelativePathname)); +Cleanup: /* * Namespace was unlocked by the handling AcpiNs* function, so we - * just return + * just free the pathname and return */ + ACPI_FREE (Info->FullPathname); + Info->FullPathname = NULL; return_ACPI_STATUS (Status); } @@ -555,4 +597,3 @@ Exit: } return_VOID; } - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsinit.c b/reactos/drivers/bus/acpi/acpica/namespace/nsinit.c index d5f9daafbbf..2e35355b107 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsinit.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsinit.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -176,7 +176,7 @@ AcpiNsInitializeObjects ( ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "**** Starting initialization of namespace objects ****\n")); ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, - "Completing Region/Field/Buffer/Package initialization:")); + "Completing Region/Field/Buffer/Package initialization:\n")); /* Set all init info to zero */ @@ -193,7 +193,7 @@ AcpiNsInitializeObjects ( } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, - "\nInitialized %u/%u Regions %u/%u Fields %u/%u " + " Initialized %u/%u Regions %u/%u Fields %u/%u " "Buffers %u/%u Packages (%u nodes)\n", Info.OpRegionInit, Info.OpRegionCount, Info.FieldInit, Info.FieldCount, @@ -201,9 +201,8 @@ AcpiNsInitializeObjects ( Info.PackageInit, Info.PackageCount, Info.ObjectCount)); ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "%u Control Methods found\n", Info.MethodCount)); - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, - "%u Op Regions found\n", Info.OpRegionCount)); + "%u Control Methods found\n%u Op Regions found\n", + Info.MethodCount, Info.OpRegionCount)); return_ACPI_STATUS (AE_OK); } @@ -244,7 +243,7 @@ AcpiNsInitializeDevices ( ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Initializing Device/Processor/Thermal objects " - "by executing _INI methods:")); + "and executing _INI/_STA methods:\n")); /* Tree analysis: find all subtrees that contain _INI methods */ @@ -270,7 +269,7 @@ AcpiNsInitializeDevices ( * part of the ACPI specification. */ Info.EvaluateInfo->PrefixNode = AcpiGbl_RootNode; - Info.EvaluateInfo->Pathname = METHOD_NAME__INI; + Info.EvaluateInfo->RelativePathname = METHOD_NAME__INI; Info.EvaluateInfo->Parameters = NULL; Info.EvaluateInfo->Flags = ACPI_IGNORE_RETURN_VALUE; @@ -302,7 +301,7 @@ AcpiNsInitializeDevices ( } ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, - "\nExecuted %u _INI methods requiring %u _STA executions " + " Executed %u _INI methods requiring %u _STA executions " "(examined %u objects)\n", Info.Num_INI, Info.Num_STA, Info.DeviceCount)); @@ -326,7 +325,7 @@ ErrorExit: * * RETURN: Status * - * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object + * DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object * within the namespace. * * Currently, the only objects that require initialization are: @@ -368,28 +367,34 @@ AcpiNsInitOneObject ( switch (Type) { case ACPI_TYPE_REGION: + Info->OpRegionCount++; break; case ACPI_TYPE_BUFFER_FIELD: + Info->FieldCount++; break; case ACPI_TYPE_LOCAL_BANK_FIELD: + Info->FieldCount++; break; case ACPI_TYPE_BUFFER: + Info->BufferCount++; break; case ACPI_TYPE_PACKAGE: + Info->PackageCount++; break; default: /* No init required, just exit now */ + return (AE_OK); } @@ -441,7 +446,9 @@ AcpiNsInitOneObject ( break; default: + /* No other types can get here */ + break; } @@ -452,15 +459,6 @@ AcpiNsInitOneObject ( AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Type))); } - /* - * Print a dot for each object unless we are going to print the entire - * pathname - */ - if (!(AcpiDbgLevel & ACPI_LV_INIT_NAMES)) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, ".")); - } - /* * We ignore errors from above, and always return OK, since we don't want * to abort the walk on any single error. @@ -537,6 +535,7 @@ AcpiNsFindIniMethods ( break; default: + break; } @@ -690,8 +689,9 @@ AcpiNsInitOneDevice ( ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname ( ACPI_TYPE_METHOD, DeviceNode, METHOD_NAME__INI)); + ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO)); Info->PrefixNode = DeviceNode; - Info->Pathname = METHOD_NAME__INI; + Info->RelativePathname = METHOD_NAME__INI; Info->Parameters = NULL; Info->Flags = ACPI_IGNORE_RETURN_VALUE; @@ -699,12 +699,6 @@ AcpiNsInitOneDevice ( if (ACPI_SUCCESS (Status)) { WalkInfo->Num_INI++; - - if ((AcpiDbgLevel <= ACPI_LV_ALL_EXCEPTIONS) && - (!(AcpiDbgLevel & ACPI_LV_INFO))) - { - ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, ".")); - } } #ifdef ACPI_DEBUG_OUTPUT @@ -712,7 +706,7 @@ AcpiNsInitOneDevice ( { /* Ignore error and move on to next device */ - char *ScopeName = AcpiNsGetExternalPathname (Info->ResolvedNode); + char *ScopeName = AcpiNsGetExternalPathname (Info->Node); ACPI_EXCEPTION ((AE_INFO, Status, "during %s._INI execution", ScopeName)); diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsload.c b/reactos/drivers/bus/acpi/acpica/namespace/nsload.c index 45ab0dfc2d2..7d68af7ccbf 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsload.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsload.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -165,8 +165,8 @@ AcpiNsLoadTable ( /* * Parse the table and load the namespace with all named - * objects found within. Control methods are NOT parsed - * at this time. In fact, the control methods cannot be + * objects found within. Control methods are NOT parsed + * at this time. In fact, the control methods cannot be * parsed until the entire namespace is loaded, because * if a control method makes a forward reference (call) * to another control method, we can't continue parsing @@ -214,18 +214,18 @@ Unlock: } /* - * Now we can parse the control methods. We always parse + * Now we can parse the control methods. We always parse * them here for a sanity check, and if configured for * just-in-time parsing, we delete the control method * parse trees. */ ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "**** Begin Table Method Parsing and Object Initialization\n")); + "**** Begin Table Object Initialization\n")); Status = AcpiDsInitializeObjects (TableIndex, Node); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "**** Completed Table Method Parsing and Object Initialization\n")); + "**** Completed Table Object Initialization\n")); return_ACPI_STATUS (Status); } @@ -264,7 +264,7 @@ AcpiNsLoadNamespace ( } /* - * Load the namespace. The DSDT is required, + * Load the namespace. The DSDT is required, * but the SSDT and PSDT tables are optional. */ Status = AcpiNsLoadTableByType (ACPI_TABLE_ID_DSDT); @@ -390,7 +390,7 @@ AcpiNsDeleteSubtree ( * RETURN: Status * * DESCRIPTION: Shrinks the namespace, typically in response to an undocking - * event. Deletes an entire subtree starting from (and + * event. Deletes an entire subtree starting from (and * including) the given handle. * ******************************************************************************/ @@ -425,4 +425,3 @@ AcpiNsUnloadNamespace ( } #endif #endif - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsnames.c b/reactos/drivers/bus/acpi/acpica/namespace/nsnames.c index 59ecfd69a81..f345d9032c6 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsnames.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsnames.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -295,7 +295,7 @@ AcpiNsGetPathnameLength ( ACPI_ERROR ((AE_INFO, "Invalid Namespace Node (%p) while traversing namespace", NextNode)); - return 0; + return (0); } Size += ACPI_PATH_SEGMENT_LENGTH; NextNode = NextNode->Parent; @@ -371,5 +371,3 @@ AcpiNsHandleToPathname ( (char *) Buffer->Pointer, (UINT32) RequiredSize)); return_ACPI_STATUS (AE_OK); } - - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsobject.c b/reactos/drivers/bus/acpi/acpica/namespace/nsobject.c index d2747f32a95..7981e62b18f 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsobject.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsobject.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -138,7 +138,7 @@ * RETURN: Status * * DESCRIPTION: Record the given object as the value associated with the - * name whose ACPI_HANDLE is passed. If Object is NULL + * name whose ACPI_HANDLE is passed. If Object is NULL * and Type is ACPI_TYPE_ANY, set the name as having no value. * Note: Future may require that the Node->Flags field be passed * as a parameter. @@ -218,7 +218,7 @@ AcpiNsAttachObject ( { /* * Value passed is a name handle and that name has a - * non-null value. Use that name's value and type. + * non-null value. Use that name's value and type. */ ObjDesc = ((ACPI_NAMESPACE_NODE *) Object)->Object; ObjectType = ((ACPI_NAMESPACE_NODE *) Object)->Type; @@ -319,14 +319,19 @@ AcpiNsDetachObject ( } } - /* Clear the entry in all cases */ + /* Clear the Node entry in all cases */ Node->Object = NULL; if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND) { + /* Unlink object from front of possible object list */ + Node->Object = ObjDesc->Common.NextObject; + + /* Handle possible 2-descriptor object */ + if (Node->Object && - ((Node->Object)->Common.Type != ACPI_TYPE_LOCAL_DATA)) + (Node->Object->Common.Type != ACPI_TYPE_LOCAL_DATA)) { Node->Object = Node->Object->Common.NextObject; } @@ -426,7 +431,7 @@ AcpiNsGetSecondaryObject ( * * RETURN: Status * - * DESCRIPTION: Low-level attach data. Create and attach a Data object. + * DESCRIPTION: Low-level attach data. Create and attach a Data object. * ******************************************************************************/ @@ -492,7 +497,7 @@ AcpiNsAttachData ( * * RETURN: Status * - * DESCRIPTION: Low-level detach data. Delete the data node, but the caller + * DESCRIPTION: Low-level detach data. Delete the data node, but the caller * is responsible for the actual data. * ******************************************************************************/ @@ -573,5 +578,3 @@ AcpiNsGetAttachedData ( return (AE_NOT_FOUND); } - - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsparse.c b/reactos/drivers/bus/acpi/acpica/namespace/nsparse.c index cd4794079c7..847e61b2860 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsparse.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsparse.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -259,11 +259,11 @@ AcpiNsParseTable ( /* * AML Parse, pass 1 * - * In this pass, we load most of the namespace. Control methods - * are not parsed until later. A parse tree is not created. Instead, - * each Parser Op subtree is deleted when it is finished. This saves + * In this pass, we load most of the namespace. Control methods + * are not parsed until later. A parse tree is not created. Instead, + * each Parser Op subtree is deleted when it is finished. This saves * a great deal of memory, and allows a small cache of parse objects - * to service the entire parse. The second pass of the parse then + * to service the entire parse. The second pass of the parse then * performs another complete parse of the AML. */ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n")); @@ -293,5 +293,3 @@ AcpiNsParseTable ( return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nspredef.c b/reactos/drivers/bus/acpi/acpica/namespace/nspredef.c index 4c0cc821cfd..820710d99d7 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nspredef.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nspredef.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -135,12 +135,12 @@ * There are several areas that are validated: * * 1) The number of input arguments as defined by the method/object in the - * ASL is validated against the ACPI specification. + * ASL is validated against the ACPI specification. * 2) The type of the return object (if any) is validated against the ACPI - * specification. + * specification. * 3) For returned package objects, the count of package elements is - * validated, as well as the type of each package element. Nested - * packages are supported. + * validated, as well as the type of each package element. Nested + * packages are supported. * * For any problems found, a warning message is issued. * @@ -149,64 +149,22 @@ /* Local prototypes */ -static ACPI_STATUS -AcpiNsCheckPackage ( - ACPI_PREDEFINED_DATA *Data, - ACPI_OPERAND_OBJECT **ReturnObjectPtr); - -static ACPI_STATUS -AcpiNsCheckPackageList ( - ACPI_PREDEFINED_DATA *Data, - const ACPI_PREDEFINED_INFO *Package, - ACPI_OPERAND_OBJECT **Elements, - UINT32 Count); - -static ACPI_STATUS -AcpiNsCheckPackageElements ( - ACPI_PREDEFINED_DATA *Data, - ACPI_OPERAND_OBJECT **Elements, - UINT8 Type1, - UINT32 Count1, - UINT8 Type2, - UINT32 Count2, - UINT32 StartIndex); - -static ACPI_STATUS -AcpiNsCheckObjectType ( - ACPI_PREDEFINED_DATA *Data, - ACPI_OPERAND_OBJECT **ReturnObjectPtr, - UINT32 ExpectedBtypes, - UINT32 PackageIndex); - static ACPI_STATUS AcpiNsCheckReference ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT *ReturnObject); -static void -AcpiNsGetExpectedTypes ( - char *Buffer, - UINT32 ExpectedBtypes); - -/* - * Names for the types that can be returned by the predefined objects. - * Used for warning messages. Must be in the same order as the ACPI_RTYPEs - */ -static const char *AcpiRtypeNames[] = -{ - "/Integer", - "/String", - "/Buffer", - "/Package", - "/Reference", -}; +static UINT32 +AcpiNsGetBitmappedType ( + ACPI_OPERAND_OBJECT *ReturnObject); /******************************************************************************* * - * FUNCTION: AcpiNsCheckPredefinedNames + * FUNCTION: AcpiNsCheckReturnValue * * PARAMETERS: Node - Namespace node for the method/object + * Info - Method execution information block * UserParamCount - Number of parameters actually passed * ReturnStatus - Status from the object evaluation * ReturnObjectPtr - Pointer to the object returned from the @@ -214,77 +172,38 @@ static const char *AcpiRtypeNames[] = * * RETURN: Status * - * DESCRIPTION: Check an ACPI name for a match in the predefined name list. + * DESCRIPTION: Check the value returned from a predefined name. * ******************************************************************************/ ACPI_STATUS -AcpiNsCheckPredefinedNames ( +AcpiNsCheckReturnValue ( ACPI_NAMESPACE_NODE *Node, + ACPI_EVALUATE_INFO *Info, UINT32 UserParamCount, ACPI_STATUS ReturnStatus, ACPI_OPERAND_OBJECT **ReturnObjectPtr) { - ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; - ACPI_STATUS Status = AE_OK; + ACPI_STATUS Status; const ACPI_PREDEFINED_INFO *Predefined; - char *Pathname; - ACPI_PREDEFINED_DATA *Data; - /* Match the name for this method/object against the predefined list */ - - Predefined = AcpiNsCheckForPredefinedName (Node); - - /* Get the full pathname to the object, for use in warning messages */ - - Pathname = AcpiNsGetExternalPathname (Node); - if (!Pathname) - { - return (AE_OK); /* Could not get pathname, ignore */ - } - - /* - * Check that the parameter count for this method matches the ASL - * definition. For predefined names, ensure that both the caller and - * the method itself are in accordance with the ACPI specification. - */ - AcpiNsCheckParameterCount (Pathname, Node, UserParamCount, Predefined); - /* If not a predefined name, we cannot validate the return object */ + Predefined = Info->Predefined; if (!Predefined) { - goto Cleanup; + return (AE_OK); } /* * If the method failed or did not actually return an object, we cannot * validate the return object */ - if ((ReturnStatus != AE_OK) && (ReturnStatus != AE_CTRL_RETURN_VALUE)) + if ((ReturnStatus != AE_OK) && + (ReturnStatus != AE_CTRL_RETURN_VALUE)) { - goto Cleanup; - } - - /* - * If there is no return value, check if we require a return value for - * this predefined name. Either one return value is expected, or none, - * for both methods and other objects. - * - * Exit now if there is no return object. Warning if one was expected. - */ - if (!ReturnObject) - { - if ((Predefined->Info.ExpectedBtypes) && - (!(Predefined->Info.ExpectedBtypes & ACPI_RTYPE_NONE))) - { - ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, - "Missing expected return value")); - - Status = AE_AML_NO_RETURN_VALUE; - } - goto Cleanup; + return (AE_OK); } /* @@ -304,43 +223,47 @@ AcpiNsCheckPredefinedNames ( (!Predefined->Info.ExpectedBtypes) || (Predefined->Info.ExpectedBtypes == ACPI_RTYPE_ALL)) { - goto Cleanup; + return (AE_OK); } - /* Create the parameter data block for object validation */ - - Data = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PREDEFINED_DATA)); - if (!Data) - { - goto Cleanup; - } - Data->Predefined = Predefined; - Data->Node = Node; - Data->NodeFlags = Node->Flags; - Data->Pathname = Pathname; - /* * Check that the type of the main return object is what is expected * for this predefined name */ - Status = AcpiNsCheckObjectType (Data, ReturnObjectPtr, - Predefined->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT); + Status = AcpiNsCheckObjectType (Info, ReturnObjectPtr, + Predefined->Info.ExpectedBtypes, ACPI_NOT_PACKAGE_ELEMENT); if (ACPI_FAILURE (Status)) { goto Exit; } + /* + * + * 4) If there is no return value and it is optional, just return + * AE_OK (_WAK). + */ + if (!(*ReturnObjectPtr)) + { + goto Exit; + } + /* * For returned Package objects, check the type of all sub-objects. * Note: Package may have been newly created by call above. */ if ((*ReturnObjectPtr)->Common.Type == ACPI_TYPE_PACKAGE) { - Data->ParentPackage = *ReturnObjectPtr; - Status = AcpiNsCheckPackage (Data, ReturnObjectPtr); + Info->ParentPackage = *ReturnObjectPtr; + Status = AcpiNsCheckPackage (Info, ReturnObjectPtr); if (ACPI_FAILURE (Status)) { - goto Exit; + /* We might be able to fix some errors */ + + if ((Status != AE_AML_OPERAND_TYPE) && + (Status != AE_AML_OPERAND_VALUE)) + { + goto Exit; + } } } @@ -352,7 +275,7 @@ AcpiNsCheckPredefinedNames ( * performed on a per-name basis, i.e., the code is specific to * particular predefined names. */ - Status = AcpiNsComplexRepairs (Data, Node, Status, ReturnObjectPtr); + Status = AcpiNsComplexRepairs (Info, Node, Status, ReturnObjectPtr); Exit: /* @@ -360,707 +283,13 @@ Exit: * or more objects, mark the parent node to suppress further warning * messages during the next evaluation of the same method/object. */ - if (ACPI_FAILURE (Status) || (Data->Flags & ACPI_OBJECT_REPAIRED)) + if (ACPI_FAILURE (Status) || + (Info->ReturnFlags & ACPI_OBJECT_REPAIRED)) { Node->Flags |= ANOBJ_EVALUATED; } - ACPI_FREE (Data); - -Cleanup: - ACPI_FREE (Pathname); - return (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiNsCheckParameterCount - * - * PARAMETERS: Pathname - Full pathname to the node (for error msgs) - * Node - Namespace node for the method/object - * UserParamCount - Number of args passed in by the caller - * Predefined - Pointer to entry in predefined name table - * - * RETURN: None - * - * DESCRIPTION: Check that the declared (in ASL/AML) parameter count for a - * predefined name is what is expected (i.e., what is defined in - * the ACPI specification for this predefined name.) - * - ******************************************************************************/ - -void -AcpiNsCheckParameterCount ( - char *Pathname, - ACPI_NAMESPACE_NODE *Node, - UINT32 UserParamCount, - const ACPI_PREDEFINED_INFO *Predefined) -{ - UINT32 ParamCount; - UINT32 RequiredParamsCurrent; - UINT32 RequiredParamsOld; - - - /* Methods have 0-7 parameters. All other types have zero. */ - - ParamCount = 0; - if (Node->Type == ACPI_TYPE_METHOD) - { - ParamCount = Node->Object->Method.ParamCount; - } - - if (!Predefined) - { - /* - * Check the parameter count for non-predefined methods/objects. - * - * Warning if too few or too many arguments have been passed by the - * caller. An incorrect number of arguments may not cause the method - * to fail. However, the method will fail if there are too few - * arguments and the method attempts to use one of the missing ones. - */ - if (UserParamCount < ParamCount) - { - ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, - "Insufficient arguments - needs %u, found %u", - ParamCount, UserParamCount)); - } - else if (UserParamCount > ParamCount) - { - ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, - "Excess arguments - needs %u, found %u", - ParamCount, UserParamCount)); - } - return; - } - - /* - * Validate the user-supplied parameter count. - * Allow two different legal argument counts (_SCP, etc.) - */ - RequiredParamsCurrent = Predefined->Info.ParamCount & 0x0F; - RequiredParamsOld = Predefined->Info.ParamCount >> 4; - - if (UserParamCount != ACPI_UINT32_MAX) - { - if ((UserParamCount != RequiredParamsCurrent) && - (UserParamCount != RequiredParamsOld)) - { - ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, - "Parameter count mismatch - " - "caller passed %u, ACPI requires %u", - UserParamCount, RequiredParamsCurrent)); - } - } - - /* - * Check that the ASL-defined parameter count is what is expected for - * this predefined name (parameter count as defined by the ACPI - * specification) - */ - if ((ParamCount != RequiredParamsCurrent) && - (ParamCount != RequiredParamsOld)) - { - ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, Node->Flags, - "Parameter count mismatch - ASL declared %u, ACPI requires %u", - ParamCount, RequiredParamsCurrent)); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiNsCheckForPredefinedName - * - * PARAMETERS: Node - Namespace node for the method/object - * - * RETURN: Pointer to entry in predefined table. NULL indicates not found. - * - * DESCRIPTION: Check an object name against the predefined object list. - * - ******************************************************************************/ - -const ACPI_PREDEFINED_INFO * -AcpiNsCheckForPredefinedName ( - ACPI_NAMESPACE_NODE *Node) -{ - const ACPI_PREDEFINED_INFO *ThisName; - - - /* Quick check for a predefined name, first character must be underscore */ - - if (Node->Name.Ascii[0] != '_') - { - return (NULL); - } - - /* Search info table for a predefined method/object name */ - - ThisName = PredefinedNames; - while (ThisName->Info.Name[0]) - { - if (ACPI_COMPARE_NAME (Node->Name.Ascii, ThisName->Info.Name)) - { - return (ThisName); - } - - /* - * Skip next entry in the table if this name returns a Package - * (next entry contains the package info) - */ - if (ThisName->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE) - { - ThisName++; - } - - ThisName++; - } - - return (NULL); /* Not found */ -} - - -/******************************************************************************* - * - * FUNCTION: AcpiNsCheckPackage - * - * PARAMETERS: Data - Pointer to validation data structure - * ReturnObjectPtr - Pointer to the object returned from the - * evaluation of a method or object - * - * RETURN: Status - * - * DESCRIPTION: Check a returned package object for the correct count and - * correct type of all sub-objects. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiNsCheckPackage ( - ACPI_PREDEFINED_DATA *Data, - ACPI_OPERAND_OBJECT **ReturnObjectPtr) -{ - ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; - const ACPI_PREDEFINED_INFO *Package; - ACPI_OPERAND_OBJECT **Elements; - ACPI_STATUS Status = AE_OK; - UINT32 ExpectedCount; - UINT32 Count; - UINT32 i; - - - ACPI_FUNCTION_NAME (NsCheckPackage); - - - /* The package info for this name is in the next table entry */ - - Package = Data->Predefined + 1; - - ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, - "%s Validating return Package of Type %X, Count %X\n", - Data->Pathname, Package->RetInfo.Type, ReturnObject->Package.Count)); - - /* - * For variable-length Packages, we can safely remove all embedded - * and trailing NULL package elements - */ - AcpiNsRemoveNullElements (Data, Package->RetInfo.Type, ReturnObject); - - /* Extract package count and elements array */ - - Elements = ReturnObject->Package.Elements; - Count = ReturnObject->Package.Count; - - /* The package must have at least one element, else invalid */ - - if (!Count) - { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Return Package has no elements (empty)")); - - return (AE_AML_OPERAND_VALUE); - } - - /* - * Decode the type of the expected package contents - * - * PTYPE1 packages contain no subpackages - * PTYPE2 packages contain sub-packages - */ - switch (Package->RetInfo.Type) - { - case ACPI_PTYPE1_FIXED: - - /* - * The package count is fixed and there are no sub-packages - * - * If package is too small, exit. - * If package is larger than expected, issue warning but continue - */ - ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2; - if (Count < ExpectedCount) - { - goto PackageTooSmall; - } - else if (Count > ExpectedCount) - { - ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, - "%s: Return Package is larger than needed - " - "found %u, expected %u\n", - Data->Pathname, Count, ExpectedCount)); - } - - /* Validate all elements of the returned package */ - - Status = AcpiNsCheckPackageElements (Data, Elements, - Package->RetInfo.ObjectType1, Package->RetInfo.Count1, - Package->RetInfo.ObjectType2, Package->RetInfo.Count2, 0); - break; - - - case ACPI_PTYPE1_VAR: - - /* - * The package count is variable, there are no sub-packages, and all - * elements must be of the same type - */ - for (i = 0; i < Count; i++) - { - Status = AcpiNsCheckObjectType (Data, Elements, - Package->RetInfo.ObjectType1, i); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - Elements++; - } - break; - - - case ACPI_PTYPE1_OPTION: - - /* - * The package count is variable, there are no sub-packages. There are - * a fixed number of required elements, and a variable number of - * optional elements. - * - * Check if package is at least as large as the minimum required - */ - ExpectedCount = Package->RetInfo3.Count; - if (Count < ExpectedCount) - { - goto PackageTooSmall; - } - - /* Variable number of sub-objects */ - - for (i = 0; i < Count; i++) - { - if (i < Package->RetInfo3.Count) - { - /* These are the required package elements (0, 1, or 2) */ - - Status = AcpiNsCheckObjectType (Data, Elements, - Package->RetInfo3.ObjectType[i], i); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - } - else - { - /* These are the optional package elements */ - - Status = AcpiNsCheckObjectType (Data, Elements, - Package->RetInfo3.TailObjectType, i); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - } - Elements++; - } - break; - - - case ACPI_PTYPE2_REV_FIXED: - - /* First element is the (Integer) revision */ - - Status = AcpiNsCheckObjectType (Data, Elements, - ACPI_RTYPE_INTEGER, 0); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - Elements++; - Count--; - - /* Examine the sub-packages */ - - Status = AcpiNsCheckPackageList (Data, Package, Elements, Count); - break; - - - case ACPI_PTYPE2_PKG_COUNT: - - /* First element is the (Integer) count of sub-packages to follow */ - - Status = AcpiNsCheckObjectType (Data, Elements, - ACPI_RTYPE_INTEGER, 0); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - /* - * Count cannot be larger than the parent package length, but allow it - * to be smaller. The >= accounts for the Integer above. - */ - ExpectedCount = (UINT32) (*Elements)->Integer.Value; - if (ExpectedCount >= Count) - { - goto PackageTooSmall; - } - - Count = ExpectedCount; - Elements++; - - /* Examine the sub-packages */ - - Status = AcpiNsCheckPackageList (Data, Package, Elements, Count); - break; - - - case ACPI_PTYPE2: - case ACPI_PTYPE2_FIXED: - case ACPI_PTYPE2_MIN: - case ACPI_PTYPE2_COUNT: - - /* - * These types all return a single Package that consists of a - * variable number of sub-Packages. - * - * First, ensure that the first element is a sub-Package. If not, - * the BIOS may have incorrectly returned the object as a single - * package instead of a Package of Packages (a common error if - * there is only one entry). We may be able to repair this by - * wrapping the returned Package with a new outer Package. - */ - if (*Elements && ((*Elements)->Common.Type != ACPI_TYPE_PACKAGE)) - { - /* Create the new outer package and populate it */ - - Status = AcpiNsRepairPackageList (Data, ReturnObjectPtr); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - /* Update locals to point to the new package (of 1 element) */ - - ReturnObject = *ReturnObjectPtr; - Elements = ReturnObject->Package.Elements; - Count = 1; - } - - /* Examine the sub-packages */ - - Status = AcpiNsCheckPackageList (Data, Package, Elements, Count); - break; - - - default: - - /* Should not get here if predefined info table is correct */ - - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Invalid internal return type in table entry: %X", - Package->RetInfo.Type)); - - return (AE_AML_INTERNAL); - } return (Status); - - -PackageTooSmall: - - /* Error exit for the case with an incorrect package count */ - - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Return Package is too small - found %u elements, expected %u", - Count, ExpectedCount)); - - return (AE_AML_OPERAND_VALUE); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiNsCheckPackageList - * - * PARAMETERS: Data - Pointer to validation data structure - * Package - Pointer to package-specific info for method - * Elements - Element list of parent package. All elements - * of this list should be of type Package. - * Count - Count of subpackages - * - * RETURN: Status - * - * DESCRIPTION: Examine a list of subpackages - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiNsCheckPackageList ( - ACPI_PREDEFINED_DATA *Data, - const ACPI_PREDEFINED_INFO *Package, - ACPI_OPERAND_OBJECT **Elements, - UINT32 Count) -{ - ACPI_OPERAND_OBJECT *SubPackage; - ACPI_OPERAND_OBJECT **SubElements; - ACPI_STATUS Status; - UINT32 ExpectedCount; - UINT32 i; - UINT32 j; - - - /* - * Validate each sub-Package in the parent Package - * - * NOTE: assumes list of sub-packages contains no NULL elements. - * Any NULL elements should have been removed by earlier call - * to AcpiNsRemoveNullElements. - */ - for (i = 0; i < Count; i++) - { - SubPackage = *Elements; - SubElements = SubPackage->Package.Elements; - Data->ParentPackage = SubPackage; - - /* Each sub-object must be of type Package */ - - Status = AcpiNsCheckObjectType (Data, &SubPackage, - ACPI_RTYPE_PACKAGE, i); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - /* Examine the different types of expected sub-packages */ - - Data->ParentPackage = SubPackage; - switch (Package->RetInfo.Type) - { - case ACPI_PTYPE2: - case ACPI_PTYPE2_PKG_COUNT: - case ACPI_PTYPE2_REV_FIXED: - - /* Each subpackage has a fixed number of elements */ - - ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2; - if (SubPackage->Package.Count < ExpectedCount) - { - goto PackageTooSmall; - } - - Status = AcpiNsCheckPackageElements (Data, SubElements, - Package->RetInfo.ObjectType1, - Package->RetInfo.Count1, - Package->RetInfo.ObjectType2, - Package->RetInfo.Count2, 0); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - break; - - - case ACPI_PTYPE2_FIXED: - - /* Each sub-package has a fixed length */ - - ExpectedCount = Package->RetInfo2.Count; - if (SubPackage->Package.Count < ExpectedCount) - { - goto PackageTooSmall; - } - - /* Check the type of each sub-package element */ - - for (j = 0; j < ExpectedCount; j++) - { - Status = AcpiNsCheckObjectType (Data, &SubElements[j], - Package->RetInfo2.ObjectType[j], j); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - } - break; - - - case ACPI_PTYPE2_MIN: - - /* Each sub-package has a variable but minimum length */ - - ExpectedCount = Package->RetInfo.Count1; - if (SubPackage->Package.Count < ExpectedCount) - { - goto PackageTooSmall; - } - - /* Check the type of each sub-package element */ - - Status = AcpiNsCheckPackageElements (Data, SubElements, - Package->RetInfo.ObjectType1, - SubPackage->Package.Count, 0, 0, 0); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - break; - - - case ACPI_PTYPE2_COUNT: - - /* - * First element is the (Integer) count of elements, including - * the count field (the ACPI name is NumElements) - */ - Status = AcpiNsCheckObjectType (Data, SubElements, - ACPI_RTYPE_INTEGER, 0); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - - /* - * Make sure package is large enough for the Count and is - * is as large as the minimum size - */ - ExpectedCount = (UINT32) (*SubElements)->Integer.Value; - if (SubPackage->Package.Count < ExpectedCount) - { - goto PackageTooSmall; - } - if (SubPackage->Package.Count < Package->RetInfo.Count1) - { - ExpectedCount = Package->RetInfo.Count1; - goto PackageTooSmall; - } - if (ExpectedCount == 0) - { - /* - * Either the NumEntries element was originally zero or it was - * a NULL element and repaired to an Integer of value zero. - * In either case, repair it by setting NumEntries to be the - * actual size of the subpackage. - */ - ExpectedCount = SubPackage->Package.Count; - (*SubElements)->Integer.Value = ExpectedCount; - } - - /* Check the type of each sub-package element */ - - Status = AcpiNsCheckPackageElements (Data, (SubElements + 1), - Package->RetInfo.ObjectType1, - (ExpectedCount - 1), 0, 0, 1); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - break; - - - default: /* Should not get here, type was validated by caller */ - - return (AE_AML_INTERNAL); - } - - Elements++; - } - - return (AE_OK); - - -PackageTooSmall: - - /* The sub-package count was smaller than required */ - - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, - "Return Sub-Package[%u] is too small - found %u elements, expected %u", - i, SubPackage->Package.Count, ExpectedCount)); - - return (AE_AML_OPERAND_VALUE); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiNsCheckPackageElements - * - * PARAMETERS: Data - Pointer to validation data structure - * Elements - Pointer to the package elements array - * Type1 - Object type for first group - * Count1 - Count for first group - * Type2 - Object type for second group - * Count2 - Count for second group - * StartIndex - Start of the first group of elements - * - * RETURN: Status - * - * DESCRIPTION: Check that all elements of a package are of the correct object - * type. Supports up to two groups of different object types. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiNsCheckPackageElements ( - ACPI_PREDEFINED_DATA *Data, - ACPI_OPERAND_OBJECT **Elements, - UINT8 Type1, - UINT32 Count1, - UINT8 Type2, - UINT32 Count2, - UINT32 StartIndex) -{ - ACPI_OPERAND_OBJECT **ThisElement = Elements; - ACPI_STATUS Status; - UINT32 i; - - - /* - * Up to two groups of package elements are supported by the data - * structure. All elements in each group must be of the same type. - * The second group can have a count of zero. - */ - for (i = 0; i < Count1; i++) - { - Status = AcpiNsCheckObjectType (Data, ThisElement, - Type1, i + StartIndex); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - ThisElement++; - } - - for (i = 0; i < Count2; i++) - { - Status = AcpiNsCheckObjectType (Data, ThisElement, - Type2, (i + Count1 + StartIndex)); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - ThisElement++; - } - - return (AE_OK); } @@ -1068,7 +297,7 @@ AcpiNsCheckPackageElements ( * * FUNCTION: AcpiNsCheckObjectType * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object * ExpectedBtypes - Bitmap of expected return type(s) @@ -1083,41 +312,24 @@ AcpiNsCheckPackageElements ( * ******************************************************************************/ -static ACPI_STATUS +ACPI_STATUS AcpiNsCheckObjectType ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr, UINT32 ExpectedBtypes, UINT32 PackageIndex) { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_STATUS Status = AE_OK; - UINT32 ReturnBtype; char TypeBuffer[48]; /* Room for 5 types */ - /* - * If we get a NULL ReturnObject here, it is a NULL package element. - * Since all extraneous NULL package elements were removed earlier by a - * call to AcpiNsRemoveNullElements, this is an unexpected NULL element. - * We will attempt to repair it. - */ - if (!ReturnObject) - { - Status = AcpiNsRepairNullElement (Data, ExpectedBtypes, - PackageIndex, ReturnObjectPtr); - if (ACPI_SUCCESS (Status)) - { - return (AE_OK); /* Repair was successful */ - } - goto TypeErrorExit; - } - /* A Namespace node should not get here, but make sure */ - if (ACPI_GET_DESCRIPTOR_TYPE (ReturnObject) == ACPI_DESC_TYPE_NAMED) + if (ReturnObject && + ACPI_GET_DESCRIPTOR_TYPE (ReturnObject) == ACPI_DESC_TYPE_NAMED) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Invalid return type - Found a Namespace node [%4.4s] type %s", ReturnObject->Node.Name.Ascii, AcpiUtGetTypeName (ReturnObject->Node.Type))); @@ -1132,55 +344,28 @@ AcpiNsCheckObjectType ( * from all of the predefined names (including elements of returned * packages) */ - switch (ReturnObject->Common.Type) + Info->ReturnBtype = AcpiNsGetBitmappedType (ReturnObject); + if (Info->ReturnBtype == ACPI_RTYPE_ANY) { - case ACPI_TYPE_INTEGER: - ReturnBtype = ACPI_RTYPE_INTEGER; - break; - - case ACPI_TYPE_BUFFER: - ReturnBtype = ACPI_RTYPE_BUFFER; - break; - - case ACPI_TYPE_STRING: - ReturnBtype = ACPI_RTYPE_STRING; - break; - - case ACPI_TYPE_PACKAGE: - ReturnBtype = ACPI_RTYPE_PACKAGE; - break; - - case ACPI_TYPE_LOCAL_REFERENCE: - ReturnBtype = ACPI_RTYPE_REFERENCE; - break; - - default: /* Not one of the supported objects, must be incorrect */ - goto TypeErrorExit; } - /* Is the object one of the expected types? */ + /* For reference objects, check that the reference type is correct */ - if (ReturnBtype & ExpectedBtypes) + if ((Info->ReturnBtype & ExpectedBtypes) == ACPI_RTYPE_REFERENCE) { - /* For reference objects, check that the reference type is correct */ - - if (ReturnObject->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) - { - Status = AcpiNsCheckReference (Data, ReturnObject); - } - + Status = AcpiNsCheckReference (Info, ReturnObject); return (Status); } - /* Type mismatch -- attempt repair of the returned object */ + /* Attempt simple repair of the returned object if necessary */ - Status = AcpiNsRepairObject (Data, ExpectedBtypes, - PackageIndex, ReturnObjectPtr); + Status = AcpiNsSimpleRepair (Info, ExpectedBtypes, + PackageIndex, ReturnObjectPtr); if (ACPI_SUCCESS (Status)) { - return (AE_OK); /* Repair was successful */ + return (AE_OK); /* Successful repair */ } @@ -1188,17 +373,23 @@ TypeErrorExit: /* Create a string with all expected types for this predefined object */ - AcpiNsGetExpectedTypes (TypeBuffer, ExpectedBtypes); + AcpiUtGetExpectedReturnTypes (TypeBuffer, ExpectedBtypes); - if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) + if (!ReturnObject) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "Expected return object of type %s", + TypeBuffer)); + } + else if (PackageIndex == ACPI_NOT_PACKAGE_ELEMENT) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Return type mismatch - found %s, expected %s", AcpiUtGetObjectTypeName (ReturnObject), TypeBuffer)); } else { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Return Package type mismatch at index %u - " "found %s, expected %s", PackageIndex, AcpiUtGetObjectTypeName (ReturnObject), TypeBuffer)); @@ -1212,7 +403,7 @@ TypeErrorExit: * * FUNCTION: AcpiNsCheckReference * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ReturnObject - Object returned from the evaluation of a * method or object * @@ -1226,7 +417,7 @@ TypeErrorExit: static ACPI_STATUS AcpiNsCheckReference ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT *ReturnObject) { @@ -1240,7 +431,7 @@ AcpiNsCheckReference ( return (AE_OK); } - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Return type mismatch - unexpected reference object type [%s] %2.2X", AcpiUtGetReferenceName (ReturnObject), ReturnObject->Reference.Class)); @@ -1251,41 +442,66 @@ AcpiNsCheckReference ( /******************************************************************************* * - * FUNCTION: AcpiNsGetExpectedTypes + * FUNCTION: AcpiNsGetBitmappedType * - * PARAMETERS: Buffer - Pointer to where the string is returned - * ExpectedBtypes - Bitmap of expected return type(s) + * PARAMETERS: ReturnObject - Object returned from method/obj evaluation * - * RETURN: Buffer is populated with type names. + * RETURN: Object return type. ACPI_RTYPE_ANY indicates that the object + * type is not supported. ACPI_RTYPE_NONE indicates that no + * object was returned (ReturnObject is NULL). * - * DESCRIPTION: Translate the expected types bitmap into a string of ascii - * names of expected types, for use in warning messages. + * DESCRIPTION: Convert object type into a bitmapped object return type. * ******************************************************************************/ -static void -AcpiNsGetExpectedTypes ( - char *Buffer, - UINT32 ExpectedBtypes) +static UINT32 +AcpiNsGetBitmappedType ( + ACPI_OPERAND_OBJECT *ReturnObject) { - UINT32 ThisRtype; - UINT32 i; - UINT32 j; + UINT32 ReturnBtype; - j = 1; - Buffer[0] = 0; - ThisRtype = ACPI_RTYPE_INTEGER; - - for (i = 0; i < ACPI_NUM_RTYPES; i++) + if (!ReturnObject) { - /* If one of the expected types, concatenate the name of this type */ - - if (ExpectedBtypes & ThisRtype) - { - ACPI_STRCAT (Buffer, &AcpiRtypeNames[i][j]); - j = 0; /* Use name separator from now on */ - } - ThisRtype <<= 1; /* Next Rtype */ + return (ACPI_RTYPE_NONE); } + + /* Map ACPI_OBJECT_TYPE to internal bitmapped type */ + + switch (ReturnObject->Common.Type) + { + case ACPI_TYPE_INTEGER: + + ReturnBtype = ACPI_RTYPE_INTEGER; + break; + + case ACPI_TYPE_BUFFER: + + ReturnBtype = ACPI_RTYPE_BUFFER; + break; + + case ACPI_TYPE_STRING: + + ReturnBtype = ACPI_RTYPE_STRING; + break; + + case ACPI_TYPE_PACKAGE: + + ReturnBtype = ACPI_RTYPE_PACKAGE; + break; + + case ACPI_TYPE_LOCAL_REFERENCE: + + ReturnBtype = ACPI_RTYPE_REFERENCE; + break; + + default: + + /* Not one of the supported objects, must be incorrect */ + + ReturnBtype = ACPI_RTYPE_ANY; + break; + } + + return (ReturnBtype); } diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsprepkg.c b/reactos/drivers/bus/acpi/acpica/namespace/nsprepkg.c new file mode 100644 index 00000000000..41dc5a7124f --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsprepkg.c @@ -0,0 +1,703 @@ +/****************************************************************************** + * + * Module Name: nsprepkg - Validation of package objects for predefined names + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" +#include "acpredef.h" + + +#define _COMPONENT ACPI_NAMESPACE + ACPI_MODULE_NAME ("nsprepkg") + + +/* Local prototypes */ + +static ACPI_STATUS +AcpiNsCheckPackageList ( + ACPI_EVALUATE_INFO *Info, + const ACPI_PREDEFINED_INFO *Package, + ACPI_OPERAND_OBJECT **Elements, + UINT32 Count); + +static ACPI_STATUS +AcpiNsCheckPackageElements ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **Elements, + UINT8 Type1, + UINT32 Count1, + UINT8 Type2, + UINT32 Count2, + UINT32 StartIndex); + + +/******************************************************************************* + * + * FUNCTION: AcpiNsCheckPackage + * + * PARAMETERS: Info - Method execution information block + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status + * + * DESCRIPTION: Check a returned package object for the correct count and + * correct type of all sub-objects. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiNsCheckPackage ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + const ACPI_PREDEFINED_INFO *Package; + ACPI_OPERAND_OBJECT **Elements; + ACPI_STATUS Status = AE_OK; + UINT32 ExpectedCount; + UINT32 Count; + UINT32 i; + + + ACPI_FUNCTION_NAME (NsCheckPackage); + + + /* The package info for this name is in the next table entry */ + + Package = Info->Predefined + 1; + + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "%s Validating return Package of Type %X, Count %X\n", + Info->FullPathname, Package->RetInfo.Type, + ReturnObject->Package.Count)); + + /* + * For variable-length Packages, we can safely remove all embedded + * and trailing NULL package elements + */ + AcpiNsRemoveNullElements (Info, Package->RetInfo.Type, ReturnObject); + + /* Extract package count and elements array */ + + Elements = ReturnObject->Package.Elements; + Count = ReturnObject->Package.Count; + + /* + * Most packages must have at least one element. The only exception + * is the variable-length package (ACPI_PTYPE1_VAR). + */ + if (!Count) + { + if (Package->RetInfo.Type == ACPI_PTYPE1_VAR) + { + return (AE_OK); + } + + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "Return Package has no elements (empty)")); + + return (AE_AML_OPERAND_VALUE); + } + + /* + * Decode the type of the expected package contents + * + * PTYPE1 packages contain no subpackages + * PTYPE2 packages contain subpackages + */ + switch (Package->RetInfo.Type) + { + case ACPI_PTYPE1_FIXED: + /* + * The package count is fixed and there are no subpackages + * + * If package is too small, exit. + * If package is larger than expected, issue warning but continue + */ + ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2; + if (Count < ExpectedCount) + { + goto PackageTooSmall; + } + else if (Count > ExpectedCount) + { + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Return Package is larger than needed - " + "found %u, expected %u\n", + Info->FullPathname, Count, ExpectedCount)); + } + + /* Validate all elements of the returned package */ + + Status = AcpiNsCheckPackageElements (Info, Elements, + Package->RetInfo.ObjectType1, Package->RetInfo.Count1, + Package->RetInfo.ObjectType2, Package->RetInfo.Count2, 0); + break; + + case ACPI_PTYPE1_VAR: + /* + * The package count is variable, there are no subpackages, and all + * elements must be of the same type + */ + for (i = 0; i < Count; i++) + { + Status = AcpiNsCheckObjectType (Info, Elements, + Package->RetInfo.ObjectType1, i); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + Elements++; + } + break; + + case ACPI_PTYPE1_OPTION: + /* + * The package count is variable, there are no subpackages. There are + * a fixed number of required elements, and a variable number of + * optional elements. + * + * Check if package is at least as large as the minimum required + */ + ExpectedCount = Package->RetInfo3.Count; + if (Count < ExpectedCount) + { + goto PackageTooSmall; + } + + /* Variable number of sub-objects */ + + for (i = 0; i < Count; i++) + { + if (i < Package->RetInfo3.Count) + { + /* These are the required package elements (0, 1, or 2) */ + + Status = AcpiNsCheckObjectType (Info, Elements, + Package->RetInfo3.ObjectType[i], i); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + else + { + /* These are the optional package elements */ + + Status = AcpiNsCheckObjectType (Info, Elements, + Package->RetInfo3.TailObjectType, i); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + Elements++; + } + break; + + case ACPI_PTYPE2_REV_FIXED: + + /* First element is the (Integer) revision */ + + Status = AcpiNsCheckObjectType (Info, Elements, + ACPI_RTYPE_INTEGER, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Elements++; + Count--; + + /* Examine the subpackages */ + + Status = AcpiNsCheckPackageList (Info, Package, Elements, Count); + break; + + case ACPI_PTYPE2_PKG_COUNT: + + /* First element is the (Integer) count of subpackages to follow */ + + Status = AcpiNsCheckObjectType (Info, Elements, + ACPI_RTYPE_INTEGER, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* + * Count cannot be larger than the parent package length, but allow it + * to be smaller. The >= accounts for the Integer above. + */ + ExpectedCount = (UINT32) (*Elements)->Integer.Value; + if (ExpectedCount >= Count) + { + goto PackageTooSmall; + } + + Count = ExpectedCount; + Elements++; + + /* Examine the subpackages */ + + Status = AcpiNsCheckPackageList (Info, Package, Elements, Count); + break; + + case ACPI_PTYPE2: + case ACPI_PTYPE2_FIXED: + case ACPI_PTYPE2_MIN: + case ACPI_PTYPE2_COUNT: + case ACPI_PTYPE2_FIX_VAR: + /* + * These types all return a single Package that consists of a + * variable number of subpackages. + * + * First, ensure that the first element is a subpackage. If not, + * the BIOS may have incorrectly returned the object as a single + * package instead of a Package of Packages (a common error if + * there is only one entry). We may be able to repair this by + * wrapping the returned Package with a new outer Package. + */ + if (*Elements && ((*Elements)->Common.Type != ACPI_TYPE_PACKAGE)) + { + /* Create the new outer package and populate it */ + + Status = AcpiNsWrapWithPackage (Info, ReturnObject, ReturnObjectPtr); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Update locals to point to the new package (of 1 element) */ + + ReturnObject = *ReturnObjectPtr; + Elements = ReturnObject->Package.Elements; + Count = 1; + } + + /* Examine the subpackages */ + + Status = AcpiNsCheckPackageList (Info, Package, Elements, Count); + break; + + default: + + /* Should not get here if predefined info table is correct */ + + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "Invalid internal return type in table entry: %X", + Package->RetInfo.Type)); + + return (AE_AML_INTERNAL); + } + + return (Status); + + +PackageTooSmall: + + /* Error exit for the case with an incorrect package count */ + + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "Return Package is too small - found %u elements, expected %u", + Count, ExpectedCount)); + + return (AE_AML_OPERAND_VALUE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsCheckPackageList + * + * PARAMETERS: Info - Method execution information block + * Package - Pointer to package-specific info for method + * Elements - Element list of parent package. All elements + * of this list should be of type Package. + * Count - Count of subpackages + * + * RETURN: Status + * + * DESCRIPTION: Examine a list of subpackages + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsCheckPackageList ( + ACPI_EVALUATE_INFO *Info, + const ACPI_PREDEFINED_INFO *Package, + ACPI_OPERAND_OBJECT **Elements, + UINT32 Count) +{ + ACPI_OPERAND_OBJECT *SubPackage; + ACPI_OPERAND_OBJECT **SubElements; + ACPI_STATUS Status; + UINT32 ExpectedCount; + UINT32 i; + UINT32 j; + + + /* + * Validate each subpackage in the parent Package + * + * NOTE: assumes list of subpackages contains no NULL elements. + * Any NULL elements should have been removed by earlier call + * to AcpiNsRemoveNullElements. + */ + for (i = 0; i < Count; i++) + { + SubPackage = *Elements; + SubElements = SubPackage->Package.Elements; + Info->ParentPackage = SubPackage; + + /* Each sub-object must be of type Package */ + + Status = AcpiNsCheckObjectType (Info, &SubPackage, + ACPI_RTYPE_PACKAGE, i); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Examine the different types of expected subpackages */ + + Info->ParentPackage = SubPackage; + switch (Package->RetInfo.Type) + { + case ACPI_PTYPE2: + case ACPI_PTYPE2_PKG_COUNT: + case ACPI_PTYPE2_REV_FIXED: + + /* Each subpackage has a fixed number of elements */ + + ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2; + if (SubPackage->Package.Count < ExpectedCount) + { + goto PackageTooSmall; + } + + Status = AcpiNsCheckPackageElements (Info, SubElements, + Package->RetInfo.ObjectType1, + Package->RetInfo.Count1, + Package->RetInfo.ObjectType2, + Package->RetInfo.Count2, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + case ACPI_PTYPE2_FIX_VAR: + /* + * Each subpackage has a fixed number of elements and an + * optional element + */ + ExpectedCount = Package->RetInfo.Count1 + Package->RetInfo.Count2; + if (SubPackage->Package.Count < ExpectedCount) + { + goto PackageTooSmall; + } + + Status = AcpiNsCheckPackageElements (Info, SubElements, + Package->RetInfo.ObjectType1, + Package->RetInfo.Count1, + Package->RetInfo.ObjectType2, + SubPackage->Package.Count - Package->RetInfo.Count1, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + case ACPI_PTYPE2_FIXED: + + /* Each subpackage has a fixed length */ + + ExpectedCount = Package->RetInfo2.Count; + if (SubPackage->Package.Count < ExpectedCount) + { + goto PackageTooSmall; + } + + /* Check the type of each subpackage element */ + + for (j = 0; j < ExpectedCount; j++) + { + Status = AcpiNsCheckObjectType (Info, &SubElements[j], + Package->RetInfo2.ObjectType[j], j); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + break; + + case ACPI_PTYPE2_MIN: + + /* Each subpackage has a variable but minimum length */ + + ExpectedCount = Package->RetInfo.Count1; + if (SubPackage->Package.Count < ExpectedCount) + { + goto PackageTooSmall; + } + + /* Check the type of each subpackage element */ + + Status = AcpiNsCheckPackageElements (Info, SubElements, + Package->RetInfo.ObjectType1, + SubPackage->Package.Count, 0, 0, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + case ACPI_PTYPE2_COUNT: + /* + * First element is the (Integer) count of elements, including + * the count field (the ACPI name is NumElements) + */ + Status = AcpiNsCheckObjectType (Info, SubElements, + ACPI_RTYPE_INTEGER, 0); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* + * Make sure package is large enough for the Count and is + * is as large as the minimum size + */ + ExpectedCount = (UINT32) (*SubElements)->Integer.Value; + if (SubPackage->Package.Count < ExpectedCount) + { + goto PackageTooSmall; + } + if (SubPackage->Package.Count < Package->RetInfo.Count1) + { + ExpectedCount = Package->RetInfo.Count1; + goto PackageTooSmall; + } + if (ExpectedCount == 0) + { + /* + * Either the NumEntries element was originally zero or it was + * a NULL element and repaired to an Integer of value zero. + * In either case, repair it by setting NumEntries to be the + * actual size of the subpackage. + */ + ExpectedCount = SubPackage->Package.Count; + (*SubElements)->Integer.Value = ExpectedCount; + } + + /* Check the type of each subpackage element */ + + Status = AcpiNsCheckPackageElements (Info, (SubElements + 1), + Package->RetInfo.ObjectType1, + (ExpectedCount - 1), 0, 0, 1); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + break; + + default: /* Should not get here, type was validated by caller */ + + return (AE_AML_INTERNAL); + } + + Elements++; + } + + return (AE_OK); + + +PackageTooSmall: + + /* The subpackage count was smaller than required */ + + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "Return SubPackage[%u] is too small - found %u elements, expected %u", + i, SubPackage->Package.Count, ExpectedCount)); + + return (AE_AML_OPERAND_VALUE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiNsCheckPackageElements + * + * PARAMETERS: Info - Method execution information block + * Elements - Pointer to the package elements array + * Type1 - Object type for first group + * Count1 - Count for first group + * Type2 - Object type for second group + * Count2 - Count for second group + * StartIndex - Start of the first group of elements + * + * RETURN: Status + * + * DESCRIPTION: Check that all elements of a package are of the correct object + * type. Supports up to two groups of different object types. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiNsCheckPackageElements ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **Elements, + UINT8 Type1, + UINT32 Count1, + UINT8 Type2, + UINT32 Count2, + UINT32 StartIndex) +{ + ACPI_OPERAND_OBJECT **ThisElement = Elements; + ACPI_STATUS Status; + UINT32 i; + + + /* + * Up to two groups of package elements are supported by the data + * structure. All elements in each group must be of the same type. + * The second group can have a count of zero. + */ + for (i = 0; i < Count1; i++) + { + Status = AcpiNsCheckObjectType (Info, ThisElement, + Type1, i + StartIndex); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + ThisElement++; + } + + for (i = 0; i < Count2; i++) + { + Status = AcpiNsCheckObjectType (Info, ThisElement, + Type2, (i + Count1 + StartIndex)); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + ThisElement++; + } + + return (AE_OK); +} diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsrepair.c b/reactos/drivers/bus/acpi/acpica/namespace/nsrepair.c index 702e53e84f8..11a43b1d040 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsrepair.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsrepair.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -120,6 +120,7 @@ #include "acnamesp.h" #include "acinterp.h" #include "acpredef.h" +#include "amlresrc.h" #define _COMPONENT ACPI_NAMESPACE ACPI_MODULE_NAME ("nsrepair") @@ -147,42 +148,62 @@ * Buffer -> Package of Integers * Package -> Package of one Package * - * Additional possible repairs: + * Additional conversions that are available: + * Convert a null return or zero return value to an EndTag descriptor + * Convert an ASCII string to a Unicode buffer * + * An incorrect standalone object is wrapped with required outer package + * + * Additional possible repairs: * Required package elements that are NULL replaced by Integer/String/Buffer - * Incorrect standalone package wrapped with required outer package * ******************************************************************************/ /* Local prototypes */ -static ACPI_STATUS -AcpiNsConvertToInteger ( - ACPI_OPERAND_OBJECT *OriginalObject, - ACPI_OPERAND_OBJECT **ReturnObject); +static const ACPI_SIMPLE_REPAIR_INFO * +AcpiNsMatchSimpleRepair ( + ACPI_NAMESPACE_NODE *Node, + UINT32 ReturnBtype, + UINT32 PackageIndex); -static ACPI_STATUS -AcpiNsConvertToString ( - ACPI_OPERAND_OBJECT *OriginalObject, - ACPI_OPERAND_OBJECT **ReturnObject); -static ACPI_STATUS -AcpiNsConvertToBuffer ( - ACPI_OPERAND_OBJECT *OriginalObject, - ACPI_OPERAND_OBJECT **ReturnObject); +/* + * Special but simple repairs for some names. + * + * 2nd argument: Unexpected types that can be repaired + */ +static const ACPI_SIMPLE_REPAIR_INFO AcpiObjectRepairInfo[] = +{ + /* Resource descriptor conversions */ -static ACPI_STATUS -AcpiNsConvertToPackage ( - ACPI_OPERAND_OBJECT *OriginalObject, - ACPI_OPERAND_OBJECT **ReturnObject); + { "_CRS", ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER | ACPI_RTYPE_NONE, + ACPI_NOT_PACKAGE_ELEMENT, + AcpiNsConvertToResource }, + { "_DMA", ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER | ACPI_RTYPE_NONE, + ACPI_NOT_PACKAGE_ELEMENT, + AcpiNsConvertToResource }, + { "_PRS", ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER | ACPI_RTYPE_NONE, + ACPI_NOT_PACKAGE_ELEMENT, + AcpiNsConvertToResource }, + + /* Unicode conversions */ + + { "_MLS", ACPI_RTYPE_STRING, 1, + AcpiNsConvertToUnicode }, + { "_STR", ACPI_RTYPE_STRING | ACPI_RTYPE_BUFFER, + ACPI_NOT_PACKAGE_ELEMENT, + AcpiNsConvertToUnicode }, + { {0,0,0,0}, 0, 0, NULL } /* Table terminator */ +}; /******************************************************************************* * - * FUNCTION: AcpiNsRepairObject + * FUNCTION: AcpiNsSimpleRepair * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ExpectedBtypes - Object types expected * PackageIndex - Index of object within parent package (if * applicable - ACPI_NOT_PACKAGE_ELEMENT @@ -198,26 +219,99 @@ AcpiNsConvertToPackage ( ******************************************************************************/ ACPI_STATUS -AcpiNsRepairObject ( - ACPI_PREDEFINED_DATA *Data, +AcpiNsSimpleRepair ( + ACPI_EVALUATE_INFO *Info, UINT32 ExpectedBtypes, UINT32 PackageIndex, ACPI_OPERAND_OBJECT **ReturnObjectPtr) { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; - ACPI_OPERAND_OBJECT *NewObject; + ACPI_OPERAND_OBJECT *NewObject = NULL; ACPI_STATUS Status; + const ACPI_SIMPLE_REPAIR_INFO *Predefined; - ACPI_FUNCTION_NAME (NsRepairObject); + ACPI_FUNCTION_NAME (NsSimpleRepair); + /* + * Special repairs for certain names that are in the repair table. + * Check if this name is in the list of repairable names. + */ + Predefined = AcpiNsMatchSimpleRepair (Info->Node, + Info->ReturnBtype, PackageIndex); + if (Predefined) + { + if (!ReturnObject) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, + ACPI_WARN_ALWAYS, "Missing expected return value")); + } + + Status = Predefined->ObjectConverter (ReturnObject, &NewObject); + if (ACPI_FAILURE (Status)) + { + /* A fatal error occurred during a conversion */ + + ACPI_EXCEPTION ((AE_INFO, Status, + "During return object analysis")); + return (Status); + } + if (NewObject) + { + goto ObjectRepaired; + } + } + + /* + * Do not perform simple object repair unless the return type is not + * expected. + */ + if (Info->ReturnBtype & ExpectedBtypes) + { + return (AE_OK); + } + /* * At this point, we know that the type of the returned object was not * one of the expected types for this predefined name. Attempt to * repair the object by converting it to one of the expected object * types for this predefined name. */ + + /* + * If there is no return value, check if we require a return value for + * this predefined name. Either one return value is expected, or none, + * for both methods and other objects. + * + * Try to fix if there was no return object. Warning if failed to fix. + */ + if (!ReturnObject) + { + if (ExpectedBtypes && (!(ExpectedBtypes & ACPI_RTYPE_NONE))) + { + if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, + ACPI_WARN_ALWAYS, "Found unexpected NULL package element")); + + Status = AcpiNsRepairNullElement (Info, ExpectedBtypes, + PackageIndex, ReturnObjectPtr); + if (ACPI_SUCCESS (Status)) + { + return (AE_OK); /* Repair was successful */ + } + } + else + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, + ACPI_WARN_ALWAYS, "Missing expected return value")); + } + + return (AE_AML_NO_RETURN_VALUE); + } + } + if (ExpectedBtypes & ACPI_RTYPE_INTEGER) { Status = AcpiNsConvertToInteger (ReturnObject, &NewObject); @@ -244,10 +338,24 @@ AcpiNsRepairObject ( } if (ExpectedBtypes & ACPI_RTYPE_PACKAGE) { - Status = AcpiNsConvertToPackage (ReturnObject, &NewObject); + /* + * A package is expected. We will wrap the existing object with a + * new package object. It is often the case that if a variable-length + * package is required, but there is only a single object needed, the + * BIOS will return that object instead of wrapping it with a Package + * object. Note: after the wrapping, the package will be validated + * for correct contents (expected object type or types). + */ + Status = AcpiNsWrapWithPackage (Info, ReturnObject, &NewObject); if (ACPI_SUCCESS (Status)) { - goto ObjectRepaired; + /* + * The original object just had its reference count + * incremented for being inserted into the new package. + */ + *ReturnObjectPtr = NewObject; /* New Package object */ + Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; + return (AE_OK); } } @@ -260,32 +368,38 @@ ObjectRepaired: /* Object was successfully repaired */ - /* - * If the original object is a package element, we need to: - * 1. Set the reference count of the new object to match the - * reference count of the old object. - * 2. Decrement the reference count of the original object. - */ if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT) { - NewObject->Common.ReferenceCount = - ReturnObject->Common.ReferenceCount; - - if (ReturnObject->Common.ReferenceCount > 1) + /* + * The original object is a package element. We need to + * decrement the reference count of the original object, + * for removing it from the package. + * + * However, if the original object was just wrapped with a + * package object as part of the repair, we don't need to + * change the reference count. + */ + if (!(Info->ReturnFlags & ACPI_OBJECT_WRAPPED)) { - ReturnObject->Common.ReferenceCount--; + NewObject->Common.ReferenceCount = + ReturnObject->Common.ReferenceCount; + + if (ReturnObject->Common.ReferenceCount > 1) + { + ReturnObject->Common.ReferenceCount--; + } } ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, - "%s: Converted %s to expected %s at index %u\n", - Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), + "%s: Converted %s to expected %s at Package index %u\n", + Info->FullPathname, AcpiUtGetObjectTypeName (ReturnObject), AcpiUtGetObjectTypeName (NewObject), PackageIndex)); } else { ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Converted %s to expected %s\n", - Data->Pathname, AcpiUtGetObjectTypeName (ReturnObject), + Info->FullPathname, AcpiUtGetObjectTypeName (ReturnObject), AcpiUtGetObjectTypeName (NewObject))); } @@ -293,343 +407,57 @@ ObjectRepaired: AcpiUtRemoveReference (ReturnObject); *ReturnObjectPtr = NewObject; - Data->Flags |= ACPI_OBJECT_REPAIRED; + Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; return (AE_OK); } -/******************************************************************************* +/****************************************************************************** * - * FUNCTION: AcpiNsConvertToInteger + * FUNCTION: AcpiNsMatchSimpleRepair * - * PARAMETERS: OriginalObject - Object to be converted - * ReturnObject - Where the new converted object is returned + * PARAMETERS: Node - Namespace node for the method/object + * ReturnBtype - Object type that was returned + * PackageIndex - Index of object within parent package (if + * applicable - ACPI_NOT_PACKAGE_ELEMENT + * otherwise) * - * RETURN: Status. AE_OK if conversion was successful. + * RETURN: Pointer to entry in repair table. NULL indicates not found. * - * DESCRIPTION: Attempt to convert a String/Buffer object to an Integer. + * DESCRIPTION: Check an object name against the repairable object list. * - ******************************************************************************/ + *****************************************************************************/ -static ACPI_STATUS -AcpiNsConvertToInteger ( - ACPI_OPERAND_OBJECT *OriginalObject, - ACPI_OPERAND_OBJECT **ReturnObject) +static const ACPI_SIMPLE_REPAIR_INFO * +AcpiNsMatchSimpleRepair ( + ACPI_NAMESPACE_NODE *Node, + UINT32 ReturnBtype, + UINT32 PackageIndex) { - ACPI_OPERAND_OBJECT *NewObject; - ACPI_STATUS Status; - UINT64 Value = 0; - UINT32 i; + const ACPI_SIMPLE_REPAIR_INFO *ThisName; - switch (OriginalObject->Common.Type) + /* Search info table for a repairable predefined method/object name */ + + ThisName = AcpiObjectRepairInfo; + while (ThisName->ObjectConverter) { - case ACPI_TYPE_STRING: - - /* String-to-Integer conversion */ - - Status = AcpiUtStrtoul64 (OriginalObject->String.Pointer, - ACPI_ANY_BASE, &Value); - if (ACPI_FAILURE (Status)) + if (ACPI_COMPARE_NAME (Node->Name.Ascii, ThisName->Name)) { - return (Status); - } - break; + /* Check if we can actually repair this name/type combination */ - case ACPI_TYPE_BUFFER: - - /* Buffer-to-Integer conversion. Max buffer size is 64 bits. */ - - if (OriginalObject->Buffer.Length > 8) - { - return (AE_AML_OPERAND_TYPE); - } - - /* Extract each buffer byte to create the integer */ - - for (i = 0; i < OriginalObject->Buffer.Length; i++) - { - Value |= ((UINT64) OriginalObject->Buffer.Pointer[i] << (i * 8)); - } - break; - - default: - return (AE_AML_OPERAND_TYPE); - } - - NewObject = AcpiUtCreateIntegerObject (Value); - if (!NewObject) - { - return (AE_NO_MEMORY); - } - - *ReturnObject = NewObject; - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiNsConvertToString - * - * PARAMETERS: OriginalObject - Object to be converted - * ReturnObject - Where the new converted object is returned - * - * RETURN: Status. AE_OK if conversion was successful. - * - * DESCRIPTION: Attempt to convert a Integer/Buffer object to a String. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiNsConvertToString ( - ACPI_OPERAND_OBJECT *OriginalObject, - ACPI_OPERAND_OBJECT **ReturnObject) -{ - ACPI_OPERAND_OBJECT *NewObject; - ACPI_SIZE Length; - ACPI_STATUS Status; - - - switch (OriginalObject->Common.Type) - { - case ACPI_TYPE_INTEGER: - /* - * Integer-to-String conversion. Commonly, convert - * an integer of value 0 to a NULL string. The last element of - * _BIF and _BIX packages occasionally need this fix. - */ - if (OriginalObject->Integer.Value == 0) - { - /* Allocate a new NULL string object */ - - NewObject = AcpiUtCreateStringObject (0); - if (!NewObject) + if ((ReturnBtype & ThisName->UnexpectedBtypes) && + (PackageIndex == ThisName->PackageIndex)) { - return (AE_NO_MEMORY); + return (ThisName); } + + return (NULL); } - else - { - Status = AcpiExConvertToString (OriginalObject, &NewObject, - ACPI_IMPLICIT_CONVERT_HEX); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - } - break; - - case ACPI_TYPE_BUFFER: - /* - * Buffer-to-String conversion. Use a ToString - * conversion, no transform performed on the buffer data. The best - * example of this is the _BIF method, where the string data from - * the battery is often (incorrectly) returned as buffer object(s). - */ - Length = 0; - while ((Length < OriginalObject->Buffer.Length) && - (OriginalObject->Buffer.Pointer[Length])) - { - Length++; - } - - /* Allocate a new string object */ - - NewObject = AcpiUtCreateStringObject (Length); - if (!NewObject) - { - return (AE_NO_MEMORY); - } - - /* - * Copy the raw buffer data with no transform. String is already NULL - * terminated at Length+1. - */ - ACPI_MEMCPY (NewObject->String.Pointer, - OriginalObject->Buffer.Pointer, Length); - break; - - default: - return (AE_AML_OPERAND_TYPE); + ThisName++; } - *ReturnObject = NewObject; - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiNsConvertToBuffer - * - * PARAMETERS: OriginalObject - Object to be converted - * ReturnObject - Where the new converted object is returned - * - * RETURN: Status. AE_OK if conversion was successful. - * - * DESCRIPTION: Attempt to convert a Integer/String/Package object to a Buffer. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiNsConvertToBuffer ( - ACPI_OPERAND_OBJECT *OriginalObject, - ACPI_OPERAND_OBJECT **ReturnObject) -{ - ACPI_OPERAND_OBJECT *NewObject; - ACPI_STATUS Status; - ACPI_OPERAND_OBJECT **Elements; - UINT32 *DwordBuffer; - UINT32 Count; - UINT32 i; - - - switch (OriginalObject->Common.Type) - { - case ACPI_TYPE_INTEGER: - /* - * Integer-to-Buffer conversion. - * Convert the Integer to a packed-byte buffer. _MAT and other - * objects need this sometimes, if a read has been performed on a - * Field object that is less than or equal to the global integer - * size (32 or 64 bits). - */ - Status = AcpiExConvertToBuffer (OriginalObject, &NewObject); - if (ACPI_FAILURE (Status)) - { - return (Status); - } - break; - - case ACPI_TYPE_STRING: - - /* String-to-Buffer conversion. Simple data copy */ - - NewObject = AcpiUtCreateBufferObject (OriginalObject->String.Length); - if (!NewObject) - { - return (AE_NO_MEMORY); - } - - ACPI_MEMCPY (NewObject->Buffer.Pointer, - OriginalObject->String.Pointer, OriginalObject->String.Length); - break; - - case ACPI_TYPE_PACKAGE: - /* - * This case is often seen for predefined names that must return a - * Buffer object with multiple DWORD integers within. For example, - * _FDE and _GTM. The Package can be converted to a Buffer. - */ - - /* All elements of the Package must be integers */ - - Elements = OriginalObject->Package.Elements; - Count = OriginalObject->Package.Count; - - for (i = 0; i < Count; i++) - { - if ((!*Elements) || - ((*Elements)->Common.Type != ACPI_TYPE_INTEGER)) - { - return (AE_AML_OPERAND_TYPE); - } - Elements++; - } - - /* Create the new buffer object to replace the Package */ - - NewObject = AcpiUtCreateBufferObject (ACPI_MUL_4 (Count)); - if (!NewObject) - { - return (AE_NO_MEMORY); - } - - /* Copy the package elements (integers) to the buffer as DWORDs */ - - Elements = OriginalObject->Package.Elements; - DwordBuffer = ACPI_CAST_PTR (UINT32, NewObject->Buffer.Pointer); - - for (i = 0; i < Count; i++) - { - *DwordBuffer = (UINT32) (*Elements)->Integer.Value; - DwordBuffer++; - Elements++; - } - break; - - default: - return (AE_AML_OPERAND_TYPE); - } - - *ReturnObject = NewObject; - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiNsConvertToPackage - * - * PARAMETERS: OriginalObject - Object to be converted - * ReturnObject - Where the new converted object is returned - * - * RETURN: Status. AE_OK if conversion was successful. - * - * DESCRIPTION: Attempt to convert a Buffer object to a Package. Each byte of - * the buffer is converted to a single integer package element. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiNsConvertToPackage ( - ACPI_OPERAND_OBJECT *OriginalObject, - ACPI_OPERAND_OBJECT **ReturnObject) -{ - ACPI_OPERAND_OBJECT *NewObject; - ACPI_OPERAND_OBJECT **Elements; - UINT32 Length; - UINT8 *Buffer; - - - switch (OriginalObject->Common.Type) - { - case ACPI_TYPE_BUFFER: - - /* Buffer-to-Package conversion */ - - Length = OriginalObject->Buffer.Length; - NewObject = AcpiUtCreatePackageObject (Length); - if (!NewObject) - { - return (AE_NO_MEMORY); - } - - /* Convert each buffer byte to an integer package element */ - - Elements = NewObject->Package.Elements; - Buffer = OriginalObject->Buffer.Pointer; - - while (Length--) - { - *Elements = AcpiUtCreateIntegerObject ((UINT64) *Buffer); - if (!*Elements) - { - AcpiUtRemoveReference (NewObject); - return (AE_NO_MEMORY); - } - Elements++; - Buffer++; - } - break; - - default: - return (AE_AML_OPERAND_TYPE); - } - - *ReturnObject = NewObject; - return (AE_OK); + return (NULL); /* Name was not found in the repair table */ } @@ -637,7 +465,7 @@ AcpiNsConvertToPackage ( * * FUNCTION: AcpiNsRepairNullElement * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ExpectedBtypes - Object types expected * PackageIndex - Index of object within parent package (if * applicable - ACPI_NOT_PACKAGE_ELEMENT @@ -653,7 +481,7 @@ AcpiNsConvertToPackage ( ACPI_STATUS AcpiNsRepairNullElement ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, UINT32 ExpectedBtypes, UINT32 PackageIndex, ACPI_OPERAND_OBJECT **ReturnObjectPtr) @@ -710,14 +538,14 @@ AcpiNsRepairNullElement ( /* Set the reference count according to the parent Package object */ - NewObject->Common.ReferenceCount = Data->ParentPackage->Common.ReferenceCount; + NewObject->Common.ReferenceCount = Info->ParentPackage->Common.ReferenceCount; ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Converted NULL package element to expected %s at index %u\n", - Data->Pathname, AcpiUtGetObjectTypeName (NewObject), PackageIndex)); + Info->FullPathname, AcpiUtGetObjectTypeName (NewObject), PackageIndex)); *ReturnObjectPtr = NewObject; - Data->Flags |= ACPI_OBJECT_REPAIRED; + Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; return (AE_OK); } @@ -726,21 +554,21 @@ AcpiNsRepairNullElement ( * * FUNCTION: AcpiNsRemoveNullElements * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * PackageType - An AcpiReturnPackageTypes value * ObjDesc - A Package object * * RETURN: None. * * DESCRIPTION: Remove all NULL package elements from packages that contain - * a variable number of sub-packages. For these types of + * a variable number of subpackages. For these types of * packages, NULL elements can be safely removed. * *****************************************************************************/ void AcpiNsRemoveNullElements ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, UINT8 PackageType, ACPI_OPERAND_OBJECT *ObjDesc) { @@ -757,7 +585,7 @@ AcpiNsRemoveNullElements ( /* * We can safely remove all NULL elements from these package types: * PTYPE1_VAR packages contain a variable number of simple data types. - * PTYPE2 packages contain a variable number of sub-packages. + * PTYPE2 packages contain a variable number of subpackages. */ switch (PackageType) { @@ -768,6 +596,8 @@ AcpiNsRemoveNullElements ( case ACPI_PTYPE2_FIXED: case ACPI_PTYPE2_MIN: case ACPI_PTYPE2_REV_FIXED: + case ACPI_PTYPE2_FIX_VAR: + break; default: @@ -804,7 +634,7 @@ AcpiNsRemoveNullElements ( { ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Found and removed %u NULL elements\n", - Data->Pathname, (Count - NewCount))); + Info->FullPathname, (Count - NewCount))); /* NULL terminate list and update the package count */ @@ -816,42 +646,43 @@ AcpiNsRemoveNullElements ( /******************************************************************************* * - * FUNCTION: AcpiNsRepairPackageList + * FUNCTION: AcpiNsWrapWithPackage * - * PARAMETERS: Data - Pointer to validation data structure - * ObjDescPtr - Pointer to the object to repair. The new - * package object is returned here, - * overwriting the old object. + * PARAMETERS: Info - Method execution information block + * OriginalObject - Pointer to the object to repair. + * ObjDescPtr - The new package object is returned here * * RETURN: Status, new object in *ObjDescPtr * - * DESCRIPTION: Repair a common problem with objects that are defined to return - * a variable-length Package of Packages. If the variable-length - * is one, some BIOS code mistakenly simply declares a single - * Package instead of a Package with one sub-Package. This - * function attempts to repair this error by wrapping a Package - * object around the original Package, creating the correct - * Package with one sub-Package. + * DESCRIPTION: Repair a common problem with objects that are defined to + * return a variable-length Package of sub-objects. If there is + * only one sub-object, some BIOS code mistakenly simply declares + * the single object instead of a Package with one sub-object. + * This function attempts to repair this error by wrapping a + * Package object around the original object, creating the + * correct and expected Package with one sub-object. * * Names that can be repaired in this manner include: - * _ALR, _CSD, _HPX, _MLS, _PRT, _PSS, _TRT, TSS + * _ALR, _CSD, _HPX, _MLS, _PLD, _PRT, _PSS, _TRT, _TSS, + * _BCL, _DOD, _FIX, _Sx * ******************************************************************************/ ACPI_STATUS -AcpiNsRepairPackageList ( - ACPI_PREDEFINED_DATA *Data, +AcpiNsWrapWithPackage ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT *OriginalObject, ACPI_OPERAND_OBJECT **ObjDescPtr) { ACPI_OPERAND_OBJECT *PkgObjDesc; - ACPI_FUNCTION_NAME (NsRepairPackageList); + ACPI_FUNCTION_NAME (NsWrapWithPackage); /* * Create the new outer package and populate it. The new package will - * have a single element, the lone subpackage. + * have a single element, the lone sub-object. */ PkgObjDesc = AcpiUtCreatePackageObject (1); if (!PkgObjDesc) @@ -859,15 +690,15 @@ AcpiNsRepairPackageList ( return (AE_NO_MEMORY); } - PkgObjDesc->Package.Elements[0] = *ObjDescPtr; + PkgObjDesc->Package.Elements[0] = OriginalObject; + + ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, + "%s: Wrapped %s with expected Package object\n", + Info->FullPathname, AcpiUtGetObjectTypeName (OriginalObject))); /* Return the new object in the object pointer */ *ObjDescPtr = PkgObjDesc; - Data->Flags |= ACPI_OBJECT_REPAIRED; - - ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, - "%s: Repaired incorrectly formed Package\n", Data->Pathname)); - + Info->ReturnFlags |= ACPI_OBJECT_REPAIRED | ACPI_OBJECT_WRAPPED; return (AE_OK); } diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsrepair2.c b/reactos/drivers/bus/acpi/acpica/namespace/nsrepair2.c index 7f8862dc5f0..ea7c0be467c 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsrepair2.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsrepair2.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -130,7 +130,7 @@ */ typedef ACPI_STATUS (*ACPI_REPAIR_FUNCTION) ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr); typedef struct acpi_repair_info @@ -144,48 +144,69 @@ typedef struct acpi_repair_info /* Local prototypes */ static const ACPI_REPAIR_INFO * -AcpiNsMatchRepairableName ( +AcpiNsMatchComplexRepair ( ACPI_NAMESPACE_NODE *Node); static ACPI_STATUS AcpiNsRepair_ALR ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr); static ACPI_STATUS AcpiNsRepair_CID ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +static ACPI_STATUS +AcpiNsRepair_CST ( + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr); static ACPI_STATUS AcpiNsRepair_FDE ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr); static ACPI_STATUS AcpiNsRepair_HID ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr); + +static ACPI_STATUS +AcpiNsRepair_PRT ( + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr); static ACPI_STATUS AcpiNsRepair_PSS ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr); static ACPI_STATUS AcpiNsRepair_TSS ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr); static ACPI_STATUS AcpiNsCheckSortedList ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT *ReturnObject, + UINT32 StartIndex, UINT32 ExpectedCount, UINT32 SortIndex, UINT8 SortDirection, char *SortKeyName); +/* Values for SortDirection above */ + +#define ACPI_SORT_ASCENDING 0 +#define ACPI_SORT_DESCENDING 1 + +static void +AcpiNsRemoveElement ( + ACPI_OPERAND_OBJECT *ObjDesc, + UINT32 Index); + static void AcpiNsSortList ( ACPI_OPERAND_OBJECT **Elements, @@ -193,11 +214,6 @@ AcpiNsSortList ( UINT32 Index, UINT8 SortDirection); -/* Values for SortDirection above */ - -#define ACPI_SORT_ASCENDING 0 -#define ACPI_SORT_DESCENDING 1 - /* * This table contains the names of the predefined methods for which we can @@ -207,9 +223,11 @@ AcpiNsSortList ( * * _ALR: Sort the list ascending by AmbientIlluminance * _CID: Strings: uppercase all, remove any leading asterisk + * _CST: Sort the list ascending by C state type * _FDE: Convert Buffer of BYTEs to a Buffer of DWORDs * _GTM: Convert Buffer of BYTEs to a Buffer of DWORDs * _HID: Strings: uppercase all, remove any leading asterisk + * _PRT: Fix reversed SourceName and SourceIndex * _PSS: Sort the list descending by Power * _TSS: Sort the list descending by Power * @@ -224,9 +242,11 @@ static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] = { {"_ALR", AcpiNsRepair_ALR}, {"_CID", AcpiNsRepair_CID}, + {"_CST", AcpiNsRepair_CST}, {"_FDE", AcpiNsRepair_FDE}, {"_GTM", AcpiNsRepair_FDE}, /* _GTM has same repair as _FDE */ {"_HID", AcpiNsRepair_HID}, + {"_PRT", AcpiNsRepair_PRT}, {"_PSS", AcpiNsRepair_PSS}, {"_TSS", AcpiNsRepair_TSS}, {{0,0,0,0}, NULL} /* Table terminator */ @@ -242,7 +262,7 @@ static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] = * * FUNCTION: AcpiNsComplexRepairs * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * Node - Namespace node for the method/object * ValidateStatus - Original status of earlier validation * ReturnObjectPtr - Pointer to the object returned from the @@ -258,7 +278,7 @@ static const ACPI_REPAIR_INFO AcpiNsRepairableNames[] = ACPI_STATUS AcpiNsComplexRepairs ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_NAMESPACE_NODE *Node, ACPI_STATUS ValidateStatus, ACPI_OPERAND_OBJECT **ReturnObjectPtr) @@ -269,20 +289,20 @@ AcpiNsComplexRepairs ( /* Check if this name is in the list of repairable names */ - Predefined = AcpiNsMatchRepairableName (Node); + Predefined = AcpiNsMatchComplexRepair (Node); if (!Predefined) { return (ValidateStatus); } - Status = Predefined->RepairFunction (Data, ReturnObjectPtr); + Status = Predefined->RepairFunction (Info, ReturnObjectPtr); return (Status); } /****************************************************************************** * - * FUNCTION: AcpiNsMatchRepairableName + * FUNCTION: AcpiNsMatchComplexRepair * * PARAMETERS: Node - Namespace node for the method/object * @@ -293,7 +313,7 @@ AcpiNsComplexRepairs ( *****************************************************************************/ static const ACPI_REPAIR_INFO * -AcpiNsMatchRepairableName ( +AcpiNsMatchComplexRepair ( ACPI_NAMESPACE_NODE *Node) { const ACPI_REPAIR_INFO *ThisName; @@ -319,7 +339,7 @@ AcpiNsMatchRepairableName ( * * FUNCTION: AcpiNsRepair_ALR * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object * @@ -332,14 +352,14 @@ AcpiNsMatchRepairableName ( static ACPI_STATUS AcpiNsRepair_ALR ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr) { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; ACPI_STATUS Status; - Status = AcpiNsCheckSortedList (Data, ReturnObject, 2, 1, + Status = AcpiNsCheckSortedList (Info, ReturnObject, 0, 2, 1, ACPI_SORT_ASCENDING, "AmbientIlluminance"); return (Status); @@ -350,7 +370,7 @@ AcpiNsRepair_ALR ( * * FUNCTION: AcpiNsRepair_FDE * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object * @@ -365,7 +385,7 @@ AcpiNsRepair_ALR ( static ACPI_STATUS AcpiNsRepair_FDE ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr) { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; @@ -393,7 +413,7 @@ AcpiNsRepair_FDE ( if (ReturnObject->Buffer.Length != ACPI_FDE_BYTE_BUFFER_SIZE) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Incorrect return buffer length %u, expected %u", ReturnObject->Buffer.Length, ACPI_FDE_DWORD_BUFFER_SIZE)); @@ -422,10 +442,11 @@ AcpiNsRepair_FDE ( ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s Expanded Byte Buffer to expected DWord Buffer\n", - Data->Pathname)); + Info->FullPathname)); break; default: + return (AE_AML_OPERAND_TYPE); } @@ -434,7 +455,7 @@ AcpiNsRepair_FDE ( AcpiUtRemoveReference (ReturnObject); *ReturnObjectPtr = BufferObject; - Data->Flags |= ACPI_OBJECT_REPAIRED; + Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; return (AE_OK); } @@ -443,7 +464,7 @@ AcpiNsRepair_FDE ( * * FUNCTION: AcpiNsRepair_CID * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object * @@ -457,7 +478,7 @@ AcpiNsRepair_FDE ( static ACPI_STATUS AcpiNsRepair_CID ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr) { ACPI_STATUS Status; @@ -472,7 +493,7 @@ AcpiNsRepair_CID ( if (ReturnObject->Common.Type == ACPI_TYPE_STRING) { - Status = AcpiNsRepair_HID (Data, ReturnObjectPtr); + Status = AcpiNsRepair_HID (Info, ReturnObjectPtr); return (Status); } @@ -491,7 +512,7 @@ AcpiNsRepair_CID ( OriginalElement = *ElementPtr; OriginalRefCount = OriginalElement->Common.ReferenceCount; - Status = AcpiNsRepair_HID (Data, ElementPtr); + Status = AcpiNsRepair_HID (Info, ElementPtr); if (ACPI_FAILURE (Status)) { return (Status); @@ -516,11 +537,104 @@ AcpiNsRepair_CID ( } +/****************************************************************************** + * + * FUNCTION: AcpiNsRepair_CST + * + * PARAMETERS: Info - Method execution information block + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if object is OK or was repaired successfully + * + * DESCRIPTION: Repair for the _CST object: + * 1. Sort the list ascending by C state type + * 2. Ensure type cannot be zero + * 3. A subpackage count of zero means _CST is meaningless + * 4. Count must match the number of C state subpackages + * + *****************************************************************************/ + +static ACPI_STATUS +AcpiNsRepair_CST ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_OPERAND_OBJECT **OuterElements; + UINT32 OuterElementCount; + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_STATUS Status; + BOOLEAN Removing; + UINT32 i; + + + ACPI_FUNCTION_NAME (NsRepair_CST); + + + /* + * Check if the C-state type values are proportional. + */ + OuterElementCount = ReturnObject->Package.Count - 1; + i = 0; + while (i < OuterElementCount) + { + OuterElements = &ReturnObject->Package.Elements[i + 1]; + Removing = FALSE; + + if ((*OuterElements)->Package.Count == 0) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "SubPackage[%u] - removing entry due to zero count", i)); + Removing = TRUE; + goto RemoveElement; + } + + ObjDesc = (*OuterElements)->Package.Elements[1]; /* Index1 = Type */ + if ((UINT32) ObjDesc->Integer.Value == 0) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, + "SubPackage[%u] - removing entry due to invalid Type(0)", i)); + Removing = TRUE; + } + +RemoveElement: + if (Removing) + { + AcpiNsRemoveElement (ReturnObject, i + 1); + OuterElementCount--; + } + else + { + i++; + } + } + + /* Update top-level package count, Type "Integer" checked elsewhere */ + + ObjDesc = ReturnObject->Package.Elements[0]; + ObjDesc->Integer.Value = OuterElementCount; + + /* + * Entries (subpackages) in the _CST Package must be sorted by the + * C-state type, in ascending order. + */ + Status = AcpiNsCheckSortedList (Info, ReturnObject, 1, 4, 1, + ACPI_SORT_ASCENDING, "C-State Type"); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + return (AE_OK); +} + + /****************************************************************************** * * FUNCTION: AcpiNsRepair_HID * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object * @@ -533,7 +647,7 @@ AcpiNsRepair_CID ( static ACPI_STATUS AcpiNsRepair_HID ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr) { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; @@ -554,12 +668,12 @@ AcpiNsRepair_HID ( if (ReturnObject->String.Length == 0) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "Invalid zero-length _HID or _CID string")); /* Return AE_OK anyway, let driver handle it */ - Data->Flags |= ACPI_OBJECT_REPAIRED; + Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; return (AE_OK); } @@ -584,15 +698,16 @@ AcpiNsRepair_HID ( NewString->String.Length--; ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, - "%s: Removed invalid leading asterisk\n", Data->Pathname)); + "%s: Removed invalid leading asterisk\n", Info->FullPathname)); } /* - * Copy and uppercase the string. From the ACPI specification: + * Copy and uppercase the string. From the ACPI 5.0 specification: * * A valid PNP ID must be of the form "AAA####" where A is an uppercase * letter and # is a hex digit. A valid ACPI ID must be of the form - * "ACPI####" where # is a hex digit. + * "NNNN####" where N is an uppercase letter or decimal digit, and + * # is a hex digit. */ for (Dest = NewString->String.Pointer; *Source; Dest++, Source++) { @@ -607,47 +722,73 @@ AcpiNsRepair_HID ( /****************************************************************************** * - * FUNCTION: AcpiNsRepair_TSS + * FUNCTION: AcpiNsRepair_PRT * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object * * RETURN: Status. AE_OK if object is OK or was repaired successfully * - * DESCRIPTION: Repair for the _TSS object. If necessary, sort the object list - * descending by the power dissipation values. + * DESCRIPTION: Repair for the _PRT object. If necessary, fix reversed + * SourceName and SourceIndex field, a common BIOS bug. * *****************************************************************************/ static ACPI_STATUS -AcpiNsRepair_TSS ( - ACPI_PREDEFINED_DATA *Data, +AcpiNsRepair_PRT ( + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr) { - ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node; + ACPI_OPERAND_OBJECT *PackageObject = *ReturnObjectPtr; + ACPI_OPERAND_OBJECT **TopObjectList; + ACPI_OPERAND_OBJECT **SubObjectList; + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_OPERAND_OBJECT *SubPackage; + UINT32 ElementCount; + UINT32 Index; - /* - * We can only sort the _TSS return package if there is no _PSS in the - * same scope. This is because if _PSS is present, the ACPI specification - * dictates that the _TSS Power Dissipation field is to be ignored, and - * therefore some BIOSs leave garbage values in the _TSS Power field(s). - * In this case, it is best to just return the _TSS package as-is. - * (May, 2011) - */ - Status = AcpiNsGetNode (Data->Node, "^_PSS", ACPI_NS_NO_UPSEARCH, &Node); - if (ACPI_SUCCESS (Status)) + /* Each element in the _PRT package is a subpackage */ + + TopObjectList = PackageObject->Package.Elements; + ElementCount = PackageObject->Package.Count; + + /* Examine each subpackage */ + + for (Index = 0; Index < ElementCount; Index++, TopObjectList++) { - return (AE_OK); + SubPackage = *TopObjectList; + SubObjectList = SubPackage->Package.Elements; + + /* Check for minimum required element count */ + + if (SubPackage->Package.Count < 4) + { + continue; + } + + /* + * If the BIOS has erroneously reversed the _PRT SourceName (index 2) + * and the SourceIndex (index 3), fix it. _PRT is important enough to + * workaround this BIOS error. This also provides compatibility with + * other ACPI implementations. + */ + ObjDesc = SubObjectList[3]; + if (!ObjDesc || (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)) + { + SubObjectList[3] = SubObjectList[2]; + SubObjectList[2] = ObjDesc; + Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; + + ACPI_WARN_PREDEFINED ((AE_INFO, + Info->FullPathname, Info->NodeFlags, + "PRT[%X]: Fixed reversed SourceName and SourceIndex", + Index)); + } } - Status = AcpiNsCheckSortedList (Data, ReturnObject, 5, 1, - ACPI_SORT_DESCENDING, "PowerDissipation"); - - return (Status); + return (AE_OK); } @@ -655,7 +796,7 @@ AcpiNsRepair_TSS ( * * FUNCTION: AcpiNsRepair_PSS * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ReturnObjectPtr - Pointer to the object returned from the * evaluation of a method or object * @@ -670,7 +811,7 @@ AcpiNsRepair_TSS ( static ACPI_STATUS AcpiNsRepair_PSS ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT **ReturnObjectPtr) { ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; @@ -684,12 +825,12 @@ AcpiNsRepair_PSS ( /* - * Entries (sub-packages) in the _PSS Package must be sorted by power + * Entries (subpackages) in the _PSS Package must be sorted by power * dissipation, in descending order. If it appears that the list is * incorrectly sorted, sort it. We sort by CpuFrequency, since this * should be proportional to the power. */ - Status =AcpiNsCheckSortedList (Data, ReturnObject, 6, 0, + Status =AcpiNsCheckSortedList (Info, ReturnObject, 0, 6, 0, ACPI_SORT_DESCENDING, "CpuFrequency"); if (ACPI_FAILURE (Status)) { @@ -711,7 +852,7 @@ AcpiNsRepair_PSS ( if ((UINT32) ObjDesc->Integer.Value > PreviousValue) { - ACPI_WARN_PREDEFINED ((AE_INFO, Data->Pathname, Data->NodeFlags, + ACPI_WARN_PREDEFINED ((AE_INFO, Info->FullPathname, Info->NodeFlags, "SubPackage[%u,%u] - suspicious power dissipation values", i-1, i)); } @@ -724,14 +865,62 @@ AcpiNsRepair_PSS ( } +/****************************************************************************** + * + * FUNCTION: AcpiNsRepair_TSS + * + * PARAMETERS: Info - Method execution information block + * ReturnObjectPtr - Pointer to the object returned from the + * evaluation of a method or object + * + * RETURN: Status. AE_OK if object is OK or was repaired successfully + * + * DESCRIPTION: Repair for the _TSS object. If necessary, sort the object list + * descending by the power dissipation values. + * + *****************************************************************************/ + +static ACPI_STATUS +AcpiNsRepair_TSS ( + ACPI_EVALUATE_INFO *Info, + ACPI_OPERAND_OBJECT **ReturnObjectPtr) +{ + ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr; + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + + + /* + * We can only sort the _TSS return package if there is no _PSS in the + * same scope. This is because if _PSS is present, the ACPI specification + * dictates that the _TSS Power Dissipation field is to be ignored, and + * therefore some BIOSs leave garbage values in the _TSS Power field(s). + * In this case, it is best to just return the _TSS package as-is. + * (May, 2011) + */ + Status = AcpiNsGetNode (Info->Node, "^_PSS", + ACPI_NS_NO_UPSEARCH, &Node); + if (ACPI_SUCCESS (Status)) + { + return (AE_OK); + } + + Status = AcpiNsCheckSortedList (Info, ReturnObject, 0, 5, 1, + ACPI_SORT_DESCENDING, "PowerDissipation"); + + return (Status); +} + + /****************************************************************************** * * FUNCTION: AcpiNsCheckSortedList * - * PARAMETERS: Data - Pointer to validation data structure + * PARAMETERS: Info - Method execution information block * ReturnObject - Pointer to the top-level returned object - * ExpectedCount - Minimum length of each sub-package - * SortIndex - Sub-package entry to sort on + * StartIndex - Index of the first subpackage + * ExpectedCount - Minimum length of each subpackage + * SortIndex - Subpackage entry to sort on * SortDirection - Ascending or descending * SortKeyName - Name of the SortIndex field * @@ -745,8 +934,9 @@ AcpiNsRepair_PSS ( static ACPI_STATUS AcpiNsCheckSortedList ( - ACPI_PREDEFINED_DATA *Data, + ACPI_EVALUATE_INFO *Info, ACPI_OPERAND_OBJECT *ReturnObject, + UINT32 StartIndex, UINT32 ExpectedCount, UINT32 SortIndex, UINT8 SortDirection, @@ -771,17 +961,19 @@ AcpiNsCheckSortedList ( } /* - * NOTE: assumes list of sub-packages contains no NULL elements. + * NOTE: assumes list of subpackages contains no NULL elements. * Any NULL elements should have been removed by earlier call * to AcpiNsRemoveNullElements. */ - OuterElements = ReturnObject->Package.Elements; OuterElementCount = ReturnObject->Package.Count; - if (!OuterElementCount) + if (!OuterElementCount || StartIndex >= OuterElementCount) { return (AE_AML_PACKAGE_LIMIT); } + OuterElements = &ReturnObject->Package.Elements[StartIndex]; + OuterElementCount -= StartIndex; + PreviousValue = 0; if (SortDirection == ACPI_SORT_DESCENDING) { @@ -799,7 +991,7 @@ AcpiNsCheckSortedList ( return (AE_AML_OPERAND_TYPE); } - /* Each sub-package must have the minimum length */ + /* Each subpackage must have the minimum length */ if ((*OuterElements)->Package.Count < ExpectedCount) { @@ -823,14 +1015,14 @@ AcpiNsCheckSortedList ( ((SortDirection == ACPI_SORT_DESCENDING) && (ObjDesc->Integer.Value > PreviousValue))) { - AcpiNsSortList (ReturnObject->Package.Elements, + AcpiNsSortList (&ReturnObject->Package.Elements[StartIndex], OuterElementCount, SortIndex, SortDirection); - Data->Flags |= ACPI_OBJECT_REPAIRED; + Info->ReturnFlags |= ACPI_OBJECT_REPAIRED; ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR, "%s: Repaired unsorted list - now sorted by %s\n", - Data->Pathname, SortKeyName)); + Info->FullPathname, SortKeyName)); return (AE_OK); } @@ -896,3 +1088,61 @@ AcpiNsSortList ( } } } + + +/****************************************************************************** + * + * FUNCTION: AcpiNsRemoveElement + * + * PARAMETERS: ObjDesc - Package object element list + * Index - Index of element to remove + * + * RETURN: None + * + * DESCRIPTION: Remove the requested element of a package and delete it. + * + *****************************************************************************/ + +static void +AcpiNsRemoveElement ( + ACPI_OPERAND_OBJECT *ObjDesc, + UINT32 Index) +{ + ACPI_OPERAND_OBJECT **Source; + ACPI_OPERAND_OBJECT **Dest; + UINT32 Count; + UINT32 NewCount; + UINT32 i; + + + ACPI_FUNCTION_NAME (NsRemoveElement); + + + Count = ObjDesc->Package.Count; + NewCount = Count - 1; + + Source = ObjDesc->Package.Elements; + Dest = Source; + + /* Examine all elements of the package object, remove matched index */ + + for (i = 0; i < Count; i++) + { + if (i == Index) + { + AcpiUtRemoveReference (*Source); /* Remove one ref for being in pkg */ + AcpiUtRemoveReference (*Source); + } + else + { + *Dest = *Source; + Dest++; + } + Source++; + } + + /* NULL terminate list and update the package count */ + + *Dest = NULL; + ObjDesc->Package.Count = NewCount; +} diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nssearch.c b/reactos/drivers/bus/acpi/acpica/namespace/nssearch.c index c1ba96ede5c..1632f2e0e07 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nssearch.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nssearch.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -493,4 +493,3 @@ AcpiNsSearchAndEnter ( *ReturnNode = NewNode; return_ACPI_STATUS (AE_OK); } - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsutils.c b/reactos/drivers/bus/acpi/acpica/namespace/nsutils.c index 603a00ffe72..cf4214e4797 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsutils.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsutils.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -126,10 +126,6 @@ /* Local prototypes */ -static BOOLEAN -AcpiNsValidPathSeparator ( - char Sep); - #ifdef ACPI_OBSOLETE_FUNCTIONS ACPI_NAME AcpiNsFindParentName ( @@ -182,48 +178,6 @@ AcpiNsPrintNodePathname ( } -/******************************************************************************* - * - * FUNCTION: AcpiNsValidRootPrefix - * - * PARAMETERS: Prefix - Character to be checked - * - * RETURN: TRUE if a valid prefix - * - * DESCRIPTION: Check if a character is a valid ACPI Root prefix - * - ******************************************************************************/ - -BOOLEAN -AcpiNsValidRootPrefix ( - char Prefix) -{ - - return ((BOOLEAN) (Prefix == '\\')); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiNsValidPathSeparator - * - * PARAMETERS: Sep - Character to be checked - * - * RETURN: TRUE if a valid path separator - * - * DESCRIPTION: Check if a character is a valid ACPI path separator - * - ******************************************************************************/ - -static BOOLEAN -AcpiNsValidPathSeparator ( - char Sep) -{ - - return ((BOOLEAN) (Sep == '.')); -} - - /******************************************************************************* * * FUNCTION: AcpiNsGetType @@ -246,10 +200,10 @@ AcpiNsGetType ( if (!Node) { ACPI_WARNING ((AE_INFO, "Null Node parameter")); - return_UINT32 (ACPI_TYPE_ANY); + return_UINT8 (ACPI_TYPE_ANY); } - return_UINT32 ((ACPI_OBJECT_TYPE) Node->Type); + return_UINT8 (Node->Type); } @@ -281,7 +235,7 @@ AcpiNsLocal ( return_UINT32 (ACPI_NS_NORMAL); } - return_UINT32 ((UINT32) AcpiGbl_NsProperties[Type] & ACPI_NS_LOCAL); + return_UINT32 (AcpiGbl_NsProperties[Type] & ACPI_NS_LOCAL); } @@ -322,14 +276,14 @@ AcpiNsGetInternalNameLength ( * * strlen() + 1 covers the first NameSeg, which has no path separator */ - if (AcpiNsValidRootPrefix (*NextExternalChar)) + if (ACPI_IS_ROOT_PREFIX (*NextExternalChar)) { Info->FullyQualified = TRUE; NextExternalChar++; /* Skip redundant RootPrefix, like \\_SB.PCI0.SBRG.EC0 */ - while (AcpiNsValidRootPrefix (*NextExternalChar)) + while (ACPI_IS_ROOT_PREFIX (*NextExternalChar)) { NextExternalChar++; } @@ -338,7 +292,7 @@ AcpiNsGetInternalNameLength ( { /* Handle Carat prefixes */ - while (*NextExternalChar == '^') + while (ACPI_IS_PARENT_PREFIX (*NextExternalChar)) { Info->NumCarats++; NextExternalChar++; @@ -355,7 +309,7 @@ AcpiNsGetInternalNameLength ( Info->NumSegments = 1; for (i = 0; NextExternalChar[i]; i++) { - if (AcpiNsValidPathSeparator (NextExternalChar[i])) + if (ACPI_IS_PATH_SEPARATOR (NextExternalChar[i])) { Info->NumSegments++; } @@ -400,7 +354,7 @@ AcpiNsBuildInternalName ( if (Info->FullyQualified) { - InternalName[0] = '\\'; + InternalName[0] = AML_ROOT_PREFIX; if (NumSegments <= 1) { @@ -429,7 +383,7 @@ AcpiNsBuildInternalName ( { for (i = 0; i < Info->NumCarats; i++) { - InternalName[i] = '^'; + InternalName[i] = AML_PARENT_PREFIX; } } @@ -456,7 +410,7 @@ AcpiNsBuildInternalName ( { for (i = 0; i < ACPI_NAME_SIZE; i++) { - if (AcpiNsValidPathSeparator (*ExternalName) || + if (ACPI_IS_PATH_SEPARATOR (*ExternalName) || (*ExternalName == 0)) { /* Pad the segment with underscore(s) if segment is short */ @@ -474,10 +428,10 @@ AcpiNsBuildInternalName ( /* Now we must have a path separator, or the pathname is bad */ - if (!AcpiNsValidPathSeparator (*ExternalName) && + if (!ACPI_IS_PATH_SEPARATOR (*ExternalName) && (*ExternalName != 0)) { - return_ACPI_STATUS (AE_BAD_PARAMETER); + return_ACPI_STATUS (AE_BAD_PATHNAME); } /* Move on the next segment */ @@ -614,14 +568,16 @@ AcpiNsExternalizeName ( switch (InternalName[0]) { - case '\\': + case AML_ROOT_PREFIX: + PrefixLength = 1; break; - case '^': + case AML_PARENT_PREFIX: + for (i = 0; i < InternalNameLength; i++) { - if (InternalName[i] == '^') + if (ACPI_IS_PARENT_PREFIX (InternalName[i])) { PrefixLength = i + 1; } @@ -639,6 +595,7 @@ AcpiNsExternalizeName ( break; default: + break; } @@ -694,7 +651,7 @@ AcpiNsExternalizeName ( ((NumSegments > 0) ? (NumSegments - 1) : 0) + 1; /* - * Check to see if we're still in bounds. If not, there's a problem + * Check to see if we're still in bounds. If not, there's a problem * with InternalName (invalid format). */ if (RequiredLength > InternalNameLength) @@ -727,10 +684,13 @@ AcpiNsExternalizeName ( (*ConvertedName)[j++] = '.'; } - (*ConvertedName)[j++] = InternalName[NamesIndex++]; - (*ConvertedName)[j++] = InternalName[NamesIndex++]; - (*ConvertedName)[j++] = InternalName[NamesIndex++]; - (*ConvertedName)[j++] = InternalName[NamesIndex++]; + /* Copy and validate the 4-char name segment */ + + ACPI_MOVE_NAME (&(*ConvertedName)[j], &InternalName[NamesIndex]); + AcpiUtRepairName (&(*ConvertedName)[j]); + + j += ACPI_NAME_SIZE; + NamesIndex += ACPI_NAME_SIZE; } } @@ -805,27 +765,29 @@ void AcpiNsTerminate ( void) { - ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_STATUS Status; ACPI_FUNCTION_TRACE (NsTerminate); /* - * 1) Free the entire namespace -- all nodes and objects - * - * Delete all object descriptors attached to namepsace nodes + * Free the entire namespace -- all nodes and all objects + * attached to the nodes */ AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode); - /* Detach any objects attached to the root */ + /* Delete any objects attached to the root node */ - ObjDesc = AcpiNsGetAttachedObject (AcpiGbl_RootNode); - if (ObjDesc) + Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (Status)) { - AcpiNsDetachObject (AcpiGbl_RootNode); + return_VOID; } + AcpiNsDeleteNode (AcpiGbl_RootNode); + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Namespace freed\n")); return_VOID; } @@ -846,18 +808,18 @@ UINT32 AcpiNsOpensScope ( ACPI_OBJECT_TYPE Type) { - ACPI_FUNCTION_TRACE_STR (NsOpensScope, AcpiUtGetTypeName (Type)); + ACPI_FUNCTION_ENTRY (); - if (!AcpiUtValidObjectType (Type)) + if (Type > ACPI_TYPE_LOCAL_MAX) { /* type code out of range */ ACPI_WARNING ((AE_INFO, "Invalid Object Type 0x%X", Type)); - return_UINT32 (ACPI_NS_NORMAL); + return (ACPI_NS_NORMAL); } - return_UINT32 (((UINT32) AcpiGbl_NsProperties[Type]) & ACPI_NS_NEWSCOPE); + return (((UINT32) AcpiGbl_NsProperties[Type]) & ACPI_NS_NEWSCOPE); } @@ -869,7 +831,7 @@ AcpiNsOpensScope ( * \ (backslash) and ^ (carat) prefixes, and the * . (period) to separate segments are supported. * PrefixNode - Root of subtree to be searched, or NS_ALL for the - * root of the name space. If Name is fully + * root of the name space. If Name is fully * qualified (first INT8 is '\'), the passed value * of Scope will not be accessed. * Flags - Used to indicate whether to perform upsearch or @@ -877,7 +839,7 @@ AcpiNsOpensScope ( * ReturnNode - Where the Node is returned * * DESCRIPTION: Look up a name relative to a given scope and return the - * corresponding Node. NOTE: Scope can be null. + * corresponding Node. NOTE: Scope can be null. * * MUTEX: Locks namespace * @@ -898,6 +860,8 @@ AcpiNsGetNode ( ACPI_FUNCTION_TRACE_PTR (NsGetNode, ACPI_CAST_PTR (char, Pathname)); + /* Simplest case is a null pathname */ + if (!Pathname) { *ReturnNode = PrefixNode; @@ -908,6 +872,14 @@ AcpiNsGetNode ( return_ACPI_STATUS (AE_OK); } + /* Quick check for a reference to the root */ + + if (ACPI_IS_ROOT_PREFIX (Pathname[0]) && (!Pathname[1])) + { + *ReturnNode = AcpiGbl_RootNode; + return_ACPI_STATUS (AE_OK); + } + /* Convert path to internal representation */ Status = AcpiNsInternalizeName (Pathname, &InternalPath); diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nswalk.c b/reactos/drivers/bus/acpi/acpica/namespace/nswalk.c index c7d95e89cf4..c6c5663f8ea 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nswalk.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nswalk.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -137,8 +137,8 @@ * RETURN: ACPI_NAMESPACE_NODE - Pointer to the NEXT child or NULL if * none is found. * - * DESCRIPTION: Return the next peer node within the namespace. If Handle - * is valid, Scope is ignored. Otherwise, the first node + * DESCRIPTION: Return the next peer node within the namespace. If Handle + * is valid, Scope is ignored. Otherwise, the first node * within Scope is returned. * ******************************************************************************/ @@ -177,8 +177,8 @@ AcpiNsGetNextNode ( * RETURN: ACPI_NAMESPACE_NODE - Pointer to the NEXT child or NULL if * none is found. * - * DESCRIPTION: Return the next peer node within the namespace. If Handle - * is valid, Scope is ignored. Otherwise, the first node + * DESCRIPTION: Return the next peer node within the namespace. If Handle + * is valid, Scope is ignored. Otherwise, the first node * within Scope is returned. * ******************************************************************************/ @@ -237,9 +237,9 @@ AcpiNsGetNextNodeTyped ( * MaxDepth - Depth to which search is to reach * Flags - Whether to unlock the NS before invoking * the callback routine - * PreOrderVisit - Called during tree pre-order visit + * DescendingCallback - Called during tree descent * when an object of "Type" is found - * PostOrderVisit - Called during tree post-order visit + * AscendingCallback - Called during tree ascent * when an object of "Type" is found * Context - Passed to user function(s) above * ReturnValue - from the UserFunction if terminated @@ -267,8 +267,8 @@ AcpiNsWalkNamespace ( ACPI_HANDLE StartNode, UINT32 MaxDepth, UINT32 Flags, - ACPI_WALK_CALLBACK PreOrderVisit, - ACPI_WALK_CALLBACK PostOrderVisit, + ACPI_WALK_CALLBACK DescendingCallback, + ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue) { @@ -346,22 +346,22 @@ AcpiNsWalkNamespace ( } /* - * Invoke the user function, either pre-order or post-order + * Invoke the user function, either descending, ascending, * or both. */ if (!NodePreviouslyVisited) { - if (PreOrderVisit) + if (DescendingCallback) { - Status = PreOrderVisit (ChildNode, Level, + Status = DescendingCallback (ChildNode, Level, Context, ReturnValue); } } else { - if (PostOrderVisit) + if (AscendingCallback) { - Status = PostOrderVisit (ChildNode, Level, + Status = AscendingCallback (ChildNode, Level, Context, ReturnValue); } } @@ -399,7 +399,7 @@ AcpiNsWalkNamespace ( /* * Depth first search: Attempt to go down another level in the - * namespace if we are allowed to. Don't go any further if we have + * namespace if we are allowed to. Don't go any further if we have * reached the caller specified maximum depth or if the user * function has specified that the maximum depth has been reached. */ @@ -454,5 +454,3 @@ AcpiNsWalkNamespace ( return_ACPI_STATUS (AE_OK); } - - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsxfeval.c b/reactos/drivers/bus/acpi/acpica/namespace/nsxfeval.c index c3b96e30b88..4864e610b76 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsxfeval.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsxfeval.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -116,6 +116,7 @@ #define __NSXFEVAL_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" @@ -140,16 +141,16 @@ AcpiNsResolveReferences ( * PARAMETERS: Handle - Object handle (optional) * Pathname - Object pathname (optional) * ExternalParams - List of parameters to pass to method, - * terminated by NULL. May be NULL + * terminated by NULL. May be NULL * if no parameters are being passed. * ReturnBuffer - Where to put method's return value (if - * any). If NULL, no value is returned. + * any). If NULL, no value is returned. * ReturnType - Expected type of return object * * RETURN: Status * * DESCRIPTION: Find and evaluate the given object, passing the given - * parameters if necessary. One of "Handle" or "Pathname" must + * parameters if necessary. One of "Handle" or "Pathname" must * be valid (non-null) * ******************************************************************************/ @@ -163,7 +164,7 @@ AcpiEvaluateObjectTyped ( ACPI_OBJECT_TYPE ReturnType) { ACPI_STATUS Status; - BOOLEAN MustFree = FALSE; + BOOLEAN FreeBufferOnError = FALSE; ACPI_FUNCTION_TRACE (AcpiEvaluateObjectTyped); @@ -178,12 +179,13 @@ AcpiEvaluateObjectTyped ( if (ReturnBuffer->Length == ACPI_ALLOCATE_BUFFER) { - MustFree = TRUE; + FreeBufferOnError = TRUE; } /* Evaluate the object */ - Status = AcpiEvaluateObject (Handle, Pathname, ExternalParams, ReturnBuffer); + Status = AcpiEvaluateObject (Handle, Pathname, + ExternalParams, ReturnBuffer); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -218,10 +220,15 @@ AcpiEvaluateObjectTyped ( AcpiUtGetTypeName (((ACPI_OBJECT *) ReturnBuffer->Pointer)->Type), AcpiUtGetTypeName (ReturnType))); - if (MustFree) + if (FreeBufferOnError) { - /* Caller used ACPI_ALLOCATE_BUFFER, free the return buffer */ - + /* + * Free a buffer created via ACPI_ALLOCATE_BUFFER. + * Note: We use AcpiOsFree here because AcpiOsAllocate was used + * to allocate the buffer. This purposefully bypasses the + * (optionally enabled) allocation tracking mechanism since we + * only want to track internal allocations. + */ AcpiOsFree (ReturnBuffer->Pointer); ReturnBuffer->Pointer = NULL; } @@ -240,15 +247,15 @@ ACPI_EXPORT_SYMBOL (AcpiEvaluateObjectTyped) * PARAMETERS: Handle - Object handle (optional) * Pathname - Object pathname (optional) * ExternalParams - List of parameters to pass to method, - * terminated by NULL. May be NULL + * terminated by NULL. May be NULL * if no parameters are being passed. * ReturnBuffer - Where to put method's return value (if - * any). If NULL, no value is returned. + * any). If NULL, no value is returned. * * RETURN: Status * * DESCRIPTION: Find and evaluate the given object, passing the given - * parameters if necessary. One of "Handle" or "Pathname" must + * parameters if necessary. One of "Handle" or "Pathname" must * be valid (non-null) * ******************************************************************************/ @@ -277,8 +284,6 @@ AcpiEvaluateObject ( return_ACPI_STATUS (AE_NO_MEMORY); } - Info->Pathname = Pathname; - /* Convert and validate the device handle */ Info->PrefixNode = AcpiNsValidateHandle (Handle); @@ -289,57 +294,26 @@ AcpiEvaluateObject ( } /* - * If there are parameters to be passed to a control method, the external - * objects must all be converted to internal objects - */ - if (ExternalParams && ExternalParams->Count) - { - /* - * Allocate a new parameter block for the internal objects - * Add 1 to count to allow for null terminated internal list - */ - Info->Parameters = ACPI_ALLOCATE_ZEROED ( - ((ACPI_SIZE) ExternalParams->Count + 1) * sizeof (void *)); - if (!Info->Parameters) - { - Status = AE_NO_MEMORY; - goto Cleanup; - } - - /* Convert each external object in the list to an internal object */ - - for (i = 0; i < ExternalParams->Count; i++) - { - Status = AcpiUtCopyEobjectToIobject ( - &ExternalParams->Pointer[i], &Info->Parameters[i]); - if (ACPI_FAILURE (Status)) - { - goto Cleanup; - } - } - Info->Parameters[ExternalParams->Count] = NULL; - } - - /* - * Three major cases: - * 1) Fully qualified pathname - * 2) No handle, not fully qualified pathname (error) - * 3) Valid handle + * Get the actual namespace node for the target object. + * Handles these cases: + * + * 1) Null node, valid pathname from root (absolute path) + * 2) Node and valid pathname (path relative to Node) + * 3) Node, Null pathname */ if ((Pathname) && - (AcpiNsValidRootPrefix (Pathname[0]))) + (ACPI_IS_ROOT_PREFIX (Pathname[0]))) { /* The path is fully qualified, just evaluate by name */ Info->PrefixNode = NULL; - Status = AcpiNsEvaluate (Info); } else if (!Handle) { /* * A handle is optional iff a fully qualified pathname is specified. * Since we've already handled fully qualified names above, this is - * an error + * an error. */ if (!Pathname) { @@ -353,14 +327,148 @@ AcpiEvaluateObject ( } Status = AE_BAD_PARAMETER; + goto Cleanup; } - else - { - /* We have a namespace a node and a possible relative path */ - Status = AcpiNsEvaluate (Info); + Info->RelativePathname = Pathname; + + /* + * Convert all external objects passed as arguments to the + * internal version(s). + */ + if (ExternalParams && ExternalParams->Count) + { + Info->ParamCount = (UINT16) ExternalParams->Count; + + /* Warn on impossible argument count */ + + if (Info->ParamCount > ACPI_METHOD_NUM_ARGS) + { + ACPI_WARN_PREDEFINED ((AE_INFO, Pathname, ACPI_WARN_ALWAYS, + "Excess arguments (%u) - using only %u", + Info->ParamCount, ACPI_METHOD_NUM_ARGS)); + + Info->ParamCount = ACPI_METHOD_NUM_ARGS; + } + + /* + * Allocate a new parameter block for the internal objects + * Add 1 to count to allow for null terminated internal list + */ + Info->Parameters = ACPI_ALLOCATE_ZEROED ( + ((ACPI_SIZE) Info->ParamCount + 1) * sizeof (void *)); + if (!Info->Parameters) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* Convert each external object in the list to an internal object */ + + for (i = 0; i < Info->ParamCount; i++) + { + Status = AcpiUtCopyEobjectToIobject ( + &ExternalParams->Pointer[i], &Info->Parameters[i]); + if (ACPI_FAILURE (Status)) + { + goto Cleanup; + } + } + + Info->Parameters[Info->ParamCount] = NULL; } + +#if 0 + + /* + * Begin incoming argument count analysis. Check for too few args + * and too many args. + */ + + switch (AcpiNsGetType (Info->Node)) + { + case ACPI_TYPE_METHOD: + + /* Check incoming argument count against the method definition */ + + if (Info->ObjDesc->Method.ParamCount > Info->ParamCount) + { + ACPI_ERROR ((AE_INFO, + "Insufficient arguments (%u) - %u are required", + Info->ParamCount, + Info->ObjDesc->Method.ParamCount)); + + Status = AE_MISSING_ARGUMENTS; + goto Cleanup; + } + + else if (Info->ObjDesc->Method.ParamCount < Info->ParamCount) + { + ACPI_WARNING ((AE_INFO, + "Excess arguments (%u) - only %u are required", + Info->ParamCount, + Info->ObjDesc->Method.ParamCount)); + + /* Just pass the required number of arguments */ + + Info->ParamCount = Info->ObjDesc->Method.ParamCount; + } + + /* + * Any incoming external objects to be passed as arguments to the + * method must be converted to internal objects + */ + if (Info->ParamCount) + { + /* + * Allocate a new parameter block for the internal objects + * Add 1 to count to allow for null terminated internal list + */ + Info->Parameters = ACPI_ALLOCATE_ZEROED ( + ((ACPI_SIZE) Info->ParamCount + 1) * sizeof (void *)); + if (!Info->Parameters) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* Convert each external object in the list to an internal object */ + + for (i = 0; i < Info->ParamCount; i++) + { + Status = AcpiUtCopyEobjectToIobject ( + &ExternalParams->Pointer[i], &Info->Parameters[i]); + if (ACPI_FAILURE (Status)) + { + goto Cleanup; + } + } + + Info->Parameters[Info->ParamCount] = NULL; + } + break; + + default: + + /* Warn if arguments passed to an object that is not a method */ + + if (Info->ParamCount) + { + ACPI_WARNING ((AE_INFO, + "%u arguments were passed to a non-method ACPI object", + Info->ParamCount)); + } + break; + } + +#endif + + + /* Now we can evaluate the object */ + + Status = AcpiNsEvaluate (Info); + /* * If we are expecting a return value, and all went well above, * copy the return value to an external object. @@ -521,6 +629,7 @@ AcpiNsResolveReferences ( break; default: + return; } @@ -544,9 +653,9 @@ AcpiNsResolveReferences ( * PARAMETERS: Type - ACPI_OBJECT_TYPE to search for * StartObject - Handle in namespace where search begins * MaxDepth - Depth to which search is to reach - * PreOrderVisit - Called during tree pre-order visit + * DescendingCallback - Called during tree descent * when an object of "Type" is found - * PostOrderVisit - Called during tree post-order visit + * AscendingCallback - Called during tree ascent * when an object of "Type" is found * Context - Passed to user function(s) above * ReturnValue - Location where return value of @@ -575,8 +684,8 @@ AcpiWalkNamespace ( ACPI_OBJECT_TYPE Type, ACPI_HANDLE StartObject, UINT32 MaxDepth, - ACPI_WALK_CALLBACK PreOrderVisit, - ACPI_WALK_CALLBACK PostOrderVisit, + ACPI_WALK_CALLBACK DescendingCallback, + ACPI_WALK_CALLBACK AscendingCallback, void *Context, void **ReturnValue) { @@ -590,7 +699,7 @@ AcpiWalkNamespace ( if ((Type > ACPI_TYPE_LOCAL_MAX) || (!MaxDepth) || - (!PreOrderVisit && !PostOrderVisit)) + (!DescendingCallback && !AscendingCallback)) { return_ACPI_STATUS (AE_BAD_PARAMETER); } @@ -609,7 +718,7 @@ AcpiWalkNamespace ( Status = AcpiUtAcquireReadLock (&AcpiGbl_NamespaceRwLock); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } /* @@ -624,10 +733,19 @@ AcpiWalkNamespace ( goto UnlockAndExit; } - Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth, - ACPI_NS_WALK_UNLOCK, PreOrderVisit, - PostOrderVisit, Context, ReturnValue); + /* Now we can validate the starting node */ + if (!AcpiNsValidateHandle (StartObject)) + { + Status = AE_BAD_PARAMETER; + goto UnlockAndExit2; + } + + Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth, + ACPI_NS_WALK_UNLOCK, DescendingCallback, + AscendingCallback, Context, ReturnValue); + +UnlockAndExit2: (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); UnlockAndExit: @@ -663,8 +781,8 @@ AcpiNsGetDeviceCallback ( ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; UINT32 Flags; - ACPI_DEVICE_ID *Hid; - ACPI_DEVICE_ID_LIST *Cid; + ACPI_PNP_DEVICE_ID *Hid; + ACPI_PNP_DEVICE_ID_LIST *Cid; UINT32 i; BOOLEAN Found; int NoMatch; @@ -798,7 +916,7 @@ AcpiNsGetDeviceCallback ( * DESCRIPTION: Performs a modified depth-first walk of the namespace tree, * starting (and ending) at the object specified by StartHandle. * The UserFunction is called whenever an object of type - * Device is found. If the user function returns + * Device is found. If the user function returns * a non-zero value, the search is terminated immediately and this * value is returned to the caller. * @@ -1028,5 +1146,3 @@ UnlockAndExit: } ACPI_EXPORT_SYMBOL (AcpiGetData) - - diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsxfname.c b/reactos/drivers/bus/acpi/acpica/namespace/nsxfname.c index 911fad40868..475491cb035 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsxfname.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsxfname.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -115,6 +115,7 @@ *****************************************************************************/ #define __NSXFNAME_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" @@ -130,8 +131,8 @@ static char * AcpiNsCopyDeviceId ( - ACPI_DEVICE_ID *Dest, - ACPI_DEVICE_ID *Source, + ACPI_PNP_DEVICE_ID *Dest, + ACPI_PNP_DEVICE_ID *Source, char *StringArea); @@ -147,8 +148,8 @@ AcpiNsCopyDeviceId ( * RETURN: Status * * DESCRIPTION: This routine will search for a caller specified name in the - * name space. The caller can restrict the search region by - * specifying a non NULL parent. The parent value is itself a + * name space. The caller can restrict the search region by + * specifying a non NULL parent. The parent value is itself a * namespace handle. * ******************************************************************************/ @@ -192,7 +193,7 @@ AcpiGetHandle ( * * Error for */ - if (AcpiNsValidRootPrefix (Pathname[0])) + if (ACPI_IS_ROOT_PREFIX (Pathname[0])) { /* Pathname is fully qualified (starts with '\') */ @@ -236,7 +237,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetHandle) * RETURN: Pointer to a string containing the fully qualified Name. * * DESCRIPTION: This routine returns the fully qualified name associated with - * the Handle parameter. This and the AcpiPathnameToHandle are + * the Handle parameter. This and the AcpiPathnameToHandle are * complementary functions. * ******************************************************************************/ @@ -249,6 +250,7 @@ AcpiGetName ( { ACPI_STATUS Status; ACPI_NAMESPACE_NODE *Node; + char *NodeName; /* Parameter validation */ @@ -299,8 +301,8 @@ AcpiGetName ( /* Just copy the ACPI name from the Node and zero terminate it */ - ACPI_STRNCPY (Buffer->Pointer, AcpiUtGetNodeName (Node), - ACPI_NAME_SIZE); + NodeName = AcpiUtGetNodeName (Node); + ACPI_MOVE_NAME (Buffer->Pointer, NodeName); ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0; Status = AE_OK; @@ -318,23 +320,24 @@ ACPI_EXPORT_SYMBOL (AcpiGetName) * * FUNCTION: AcpiNsCopyDeviceId * - * PARAMETERS: Dest - Pointer to the destination DEVICE_ID - * Source - Pointer to the source DEVICE_ID + * PARAMETERS: Dest - Pointer to the destination PNP_DEVICE_ID + * Source - Pointer to the source PNP_DEVICE_ID * StringArea - Pointer to where to copy the dest string * * RETURN: Pointer to the next string area * - * DESCRIPTION: Copy a single DEVICE_ID, including the string data. + * DESCRIPTION: Copy a single PNP_DEVICE_ID, including the string data. * ******************************************************************************/ static char * AcpiNsCopyDeviceId ( - ACPI_DEVICE_ID *Dest, - ACPI_DEVICE_ID *Source, + ACPI_PNP_DEVICE_ID *Dest, + ACPI_PNP_DEVICE_ID *Source, char *StringArea) { - /* Create the destination DEVICE_ID */ + + /* Create the destination PNP_DEVICE_ID */ Dest->String = StringArea; Dest->Length = Source->Length; @@ -359,8 +362,8 @@ AcpiNsCopyDeviceId ( * namespace node and possibly by running several standard * control methods (Such as in the case of a device.) * - * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA, - * _ADR, _SxW, and _SxD methods. + * For Device and Processor objects, run the Device _HID, _UID, _CID, _SUB, + * _STA, _ADR, _SxW, and _SxD methods. * * Note: Allocates the return buffer, must be freed by the caller. * @@ -373,9 +376,10 @@ AcpiGetObjectInfo ( { ACPI_NAMESPACE_NODE *Node; ACPI_DEVICE_INFO *Info; - ACPI_DEVICE_ID_LIST *CidList = NULL; - ACPI_DEVICE_ID *Hid = NULL; - ACPI_DEVICE_ID *Uid = NULL; + ACPI_PNP_DEVICE_ID_LIST *CidList = NULL; + ACPI_PNP_DEVICE_ID *Hid = NULL; + ACPI_PNP_DEVICE_ID *Uid = NULL; + ACPI_PNP_DEVICE_ID *Sub = NULL; char *NextIdString; ACPI_OBJECT_TYPE Type; ACPI_NAME Name; @@ -396,7 +400,7 @@ AcpiGetObjectInfo ( Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); if (ACPI_FAILURE (Status)) { - goto Cleanup; + return (Status); } Node = AcpiNsValidateHandle (Handle); @@ -428,7 +432,7 @@ AcpiGetObjectInfo ( { /* * Get extra info for ACPI Device/Processor objects only: - * Run the Device _HID, _UID, and _CID methods. + * Run the Device _HID, _UID, _SUB, and _CID methods. * * Note: none of these methods are required, so they may or may * not be present for this device. The Info->Valid bitfield is used @@ -453,6 +457,15 @@ AcpiGetObjectInfo ( Valid |= ACPI_VALID_UID; } + /* Execute the Device._SUB method */ + + Status = AcpiUtExecute_SUB (Node, &Sub); + if (ACPI_SUCCESS (Status)) + { + InfoSize += Sub->Length; + Valid |= ACPI_VALID_SUB; + } + /* Execute the Device._CID method */ Status = AcpiUtExecute_CID (Node, &CidList); @@ -460,7 +473,7 @@ AcpiGetObjectInfo ( { /* Add size of CID strings and CID pointer array */ - InfoSize += (CidList->ListSize - sizeof (ACPI_DEVICE_ID_LIST)); + InfoSize += (CidList->ListSize - sizeof (ACPI_PNP_DEVICE_ID_LIST)); Valid |= ACPI_VALID_CID; } } @@ -485,9 +498,14 @@ AcpiGetObjectInfo ( * Get extra info for ACPI Device/Processor objects only: * Run the _STA, _ADR and, SxW, and _SxD methods. * - * Note: none of these methods are required, so they may or may + * Notes: none of these methods are required, so they may or may * not be present for this device. The Info->Valid bitfield is used * to indicate which methods were found and run successfully. + * + * For _STA, if the method does not exist, then (as per the ACPI + * specification), the returned CurrentStatus flags will indicate + * that the device is present/functional/enabled. Otherwise, the + * CurrentStatus flags reflect the value returned from _STA. */ /* Execute the Device._STA method */ @@ -535,14 +553,15 @@ AcpiGetObjectInfo ( NextIdString = ACPI_CAST_PTR (char, Info->CompatibleIdList.Ids); if (CidList) { - /* Point past the CID DEVICE_ID array */ + /* Point past the CID PNP_DEVICE_ID array */ - NextIdString += ((ACPI_SIZE) CidList->Count * sizeof (ACPI_DEVICE_ID)); + NextIdString += ((ACPI_SIZE) CidList->Count * sizeof (ACPI_PNP_DEVICE_ID)); } /* - * Copy the HID, UID, and CIDs to the return buffer. The variable-length - * strings are copied to the reserved area at the end of the buffer. + * Copy the HID, UID, SUB, and CIDs to the return buffer. + * The variable-length strings are copied to the reserved area + * at the end of the buffer. * * For HID and CID, check if the ID is a PCI Root Bridge. */ @@ -563,6 +582,12 @@ AcpiGetObjectInfo ( Uid, NextIdString); } + if (Sub) + { + NextIdString = AcpiNsCopyDeviceId (&Info->SubsystemId, + Sub, NextIdString); + } + if (CidList) { Info->CompatibleIdList.Count = CidList->Count; @@ -603,6 +628,10 @@ Cleanup: { ACPI_FREE (Uid); } + if (Sub) + { + ACPI_FREE (Sub); + } if (CidList) { ACPI_FREE (CidList); diff --git a/reactos/drivers/bus/acpi/acpica/namespace/nsxfobj.c b/reactos/drivers/bus/acpi/acpica/namespace/nsxfobj.c index 5dca29cd815..0f61a7100ab 100644 --- a/reactos/drivers/bus/acpi/acpica/namespace/nsxfobj.c +++ b/reactos/drivers/bus/acpi/acpica/namespace/nsxfobj.c @@ -9,13 +9,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +32,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +44,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +56,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +81,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +93,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -116,6 +116,7 @@ #define __NSXFOBJ_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" @@ -274,8 +275,8 @@ ACPI_EXPORT_SYMBOL (AcpiGetParent) * * RETURN: Status * - * DESCRIPTION: Return the next peer object within the namespace. If Handle is - * valid, Scope is ignored. Otherwise, the first object within + * DESCRIPTION: Return the next peer object within the namespace. If Handle is + * valid, Scope is ignored. Otherwise, the first object within * Scope is returned. * ******************************************************************************/ @@ -354,4 +355,3 @@ UnlockAndExit: } ACPI_EXPORT_SYMBOL (AcpiGetNextObject) - diff --git a/reactos/drivers/bus/acpi/acpica/parser/psargs.c b/reactos/drivers/bus/acpi/acpica/parser/psargs.c index 1dcb1b77b0b..5e2e43414df 100644 --- a/reactos/drivers/bus/acpi/acpica/parser/psargs.c +++ b/reactos/drivers/bus/acpi/acpica/parser/psargs.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -203,7 +203,7 @@ AcpiPsGetNextPackageLength ( * RETURN: Pointer to end-of-package +1 * * DESCRIPTION: Get next package length and return a pointer past the end of - * the package. Consumes the package length field + * the package. Consumes the package length field * ******************************************************************************/ @@ -235,8 +235,8 @@ AcpiPsGetNextPackageEnd ( * RETURN: Pointer to the start of the name string (pointer points into * the AML. * - * DESCRIPTION: Get next raw namestring within the AML stream. Handles all name - * prefix characters. Set parser state to point past the string. + * DESCRIPTION: Get next raw namestring within the AML stream. Handles all name + * prefix characters. Set parser state to point past the string. * (Name is consumed from the AML.) * ******************************************************************************/ @@ -254,7 +254,8 @@ AcpiPsGetNextNamestring ( /* Point past any namestring prefix characters (backslash or carat) */ - while (AcpiPsIsPrefixChar (*End)) + while (ACPI_IS_ROOT_PREFIX (*End) || + ACPI_IS_PARENT_PREFIX (*End)) { End++; } @@ -316,7 +317,7 @@ AcpiPsGetNextNamestring ( * * DESCRIPTION: Get next name (if method call, return # of required args). * Names are looked up in the internal namespace to determine - * if the name represents a control method. If a method + * if the name represents a control method. If a method * is found, the number of arguments to the method is returned. * This information is critical for parsing to continue correctly. * @@ -518,7 +519,6 @@ AcpiPsGetNextSimpleArg ( Length = 1; break; - case ARGP_WORDDATA: /* Get 2 bytes from the AML stream */ @@ -528,7 +528,6 @@ AcpiPsGetNextSimpleArg ( Length = 2; break; - case ARGP_DWORDDATA: /* Get 4 bytes from the AML stream */ @@ -538,7 +537,6 @@ AcpiPsGetNextSimpleArg ( Length = 4; break; - case ARGP_QWORDDATA: /* Get 8 bytes from the AML stream */ @@ -548,7 +546,6 @@ AcpiPsGetNextSimpleArg ( Length = 8; break; - case ARGP_CHARLIST: /* Get a pointer to the string, point past the string */ @@ -566,7 +563,6 @@ AcpiPsGetNextSimpleArg ( Length++; break; - case ARGP_NAME: case ARGP_NAMESTRING: @@ -574,7 +570,6 @@ AcpiPsGetNextSimpleArg ( Arg->Common.Value.Name = AcpiPsGetNextNamestring (ParserState); return_VOID; - default: ACPI_ERROR ((AE_INFO, "Invalid ArgType 0x%X", ArgType)); @@ -603,37 +598,57 @@ static ACPI_PARSE_OBJECT * AcpiPsGetNextField ( ACPI_PARSE_STATE *ParserState) { - UINT32 AmlOffset = (UINT32) - ACPI_PTR_DIFF (ParserState->Aml, - ParserState->AmlStart); + UINT32 AmlOffset; ACPI_PARSE_OBJECT *Field; + ACPI_PARSE_OBJECT *Arg = NULL; UINT16 Opcode; UINT32 Name; + UINT8 AccessType; + UINT8 AccessAttribute; + UINT8 AccessLength; + UINT32 PkgLength; + UINT8 *PkgEnd; + UINT32 BufferLength; ACPI_FUNCTION_TRACE (PsGetNextField); + AmlOffset = (UINT32) ACPI_PTR_DIFF ( + ParserState->Aml, ParserState->AmlStart); + /* Determine field type */ switch (ACPI_GET8 (ParserState->Aml)) { - default: - - Opcode = AML_INT_NAMEDFIELD_OP; - break; - - case 0x00: + case AML_FIELD_OFFSET_OP: Opcode = AML_INT_RESERVEDFIELD_OP; ParserState->Aml++; break; - case 0x01: + case AML_FIELD_ACCESS_OP: Opcode = AML_INT_ACCESSFIELD_OP; ParserState->Aml++; break; + + case AML_FIELD_CONNECTION_OP: + + Opcode = AML_INT_CONNECTION_OP; + ParserState->Aml++; + break; + + case AML_FIELD_EXT_ACCESS_OP: + + Opcode = AML_INT_EXTACCESSFIELD_OP; + ParserState->Aml++; + break; + + default: + + Opcode = AML_INT_NAMEDFIELD_OP; + break; } /* Allocate a new field op */ @@ -673,17 +688,122 @@ AcpiPsGetNextField ( case AML_INT_ACCESSFIELD_OP: + case AML_INT_EXTACCESSFIELD_OP: /* * Get AccessType and AccessAttrib and merge into the field Op - * AccessType is first operand, AccessAttribute is second + * AccessType is first operand, AccessAttribute is second. stuff + * these bytes into the node integer value for convenience. */ - Field->Common.Value.Integer = (((UINT32) ACPI_GET8 (ParserState->Aml) << 8)); + + /* Get the two bytes (Type/Attribute) */ + + AccessType = ACPI_GET8 (ParserState->Aml); ParserState->Aml++; - Field->Common.Value.Integer |= ACPI_GET8 (ParserState->Aml); + AccessAttribute = ACPI_GET8 (ParserState->Aml); ParserState->Aml++; + + Field->Common.Value.Integer = (UINT8) AccessType; + Field->Common.Value.Integer |= (UINT16) (AccessAttribute << 8); + + /* This opcode has a third byte, AccessLength */ + + if (Opcode == AML_INT_EXTACCESSFIELD_OP) + { + AccessLength = ACPI_GET8 (ParserState->Aml); + ParserState->Aml++; + + Field->Common.Value.Integer |= (UINT32) (AccessLength << 16); + } break; + + case AML_INT_CONNECTION_OP: + + /* + * Argument for Connection operator can be either a Buffer + * (resource descriptor), or a NameString. + */ + if (ACPI_GET8 (ParserState->Aml) == AML_BUFFER_OP) + { + ParserState->Aml++; + + PkgEnd = ParserState->Aml; + PkgLength = AcpiPsGetNextPackageLength (ParserState); + PkgEnd += PkgLength; + + if (ParserState->Aml < PkgEnd) + { + /* Non-empty list */ + + Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP); + if (!Arg) + { + AcpiPsFreeOp (Field); + return_PTR (NULL); + } + + /* Get the actual buffer length argument */ + + Opcode = ACPI_GET8 (ParserState->Aml); + ParserState->Aml++; + + switch (Opcode) + { + case AML_BYTE_OP: /* AML_BYTEDATA_ARG */ + + BufferLength = ACPI_GET8 (ParserState->Aml); + ParserState->Aml += 1; + break; + + case AML_WORD_OP: /* AML_WORDDATA_ARG */ + + BufferLength = ACPI_GET16 (ParserState->Aml); + ParserState->Aml += 2; + break; + + case AML_DWORD_OP: /* AML_DWORDATA_ARG */ + + BufferLength = ACPI_GET32 (ParserState->Aml); + ParserState->Aml += 4; + break; + + default: + + BufferLength = 0; + break; + } + + /* Fill in bytelist data */ + + Arg->Named.Value.Size = BufferLength; + Arg->Named.Data = ParserState->Aml; + } + + /* Skip to End of byte data */ + + ParserState->Aml = PkgEnd; + } + else + { + Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP); + if (!Arg) + { + AcpiPsFreeOp (Field); + return_PTR (NULL); + } + + /* Get the Namestring argument */ + + Arg->Common.Value.Name = AcpiPsGetNextNamestring (ParserState); + } + + /* Link the buffer/namestring to parent (CONNECTION_OP) */ + + AcpiPsAppendArg (Field, Arg); + break; + + default: /* Opcode was set in previous switch */ @@ -746,7 +866,6 @@ AcpiPsGetNextArg ( AcpiPsGetNextSimpleArg (ParserState, ArgType, Arg); break; - case ARGP_PKGLENGTH: /* Package length, nothing returned */ @@ -754,7 +873,6 @@ AcpiPsGetNextArg ( ParserState->PkgEnd = AcpiPsGetNextPackageEnd (ParserState); break; - case ARGP_FIELDLIST: if (ParserState->Aml < ParserState->PkgEnd) @@ -786,7 +904,6 @@ AcpiPsGetNextArg ( } break; - case ARGP_BYTELIST: if (ParserState->Aml < ParserState->PkgEnd) @@ -811,7 +928,6 @@ AcpiPsGetNextArg ( } break; - case ARGP_TARGET: case ARGP_SUPERNAME: case ARGP_SIMPLENAME: @@ -819,7 +935,8 @@ AcpiPsGetNextArg ( Subop = AcpiPsPeekOpcode (ParserState); if (Subop == 0 || AcpiPsIsLeadingChar (Subop) || - AcpiPsIsPrefixChar (Subop)) + ACPI_IS_ROOT_PREFIX (Subop) || + ACPI_IS_PARENT_PREFIX (Subop)) { /* NullName or NameString */ @@ -858,7 +975,6 @@ AcpiPsGetNextArg ( } break; - case ARGP_DATAOBJ: case ARGP_TERMARG: @@ -867,7 +983,6 @@ AcpiPsGetNextArg ( WalkState->ArgCount = 1; break; - case ARGP_DATAOBJLIST: case ARGP_TERMLIST: case ARGP_OBJLIST: @@ -880,7 +995,6 @@ AcpiPsGetNextArg ( } break; - default: ACPI_ERROR ((AE_INFO, "Invalid ArgType: 0x%X", ArgType)); diff --git a/reactos/drivers/bus/acpi/acpica/parser/psloop.c b/reactos/drivers/bus/acpi/acpica/parser/psloop.c index 9791efcc78a..ec7db254971 100644 --- a/reactos/drivers/bus/acpi/acpica/parser/psloop.c +++ b/reactos/drivers/bus/acpi/acpica/parser/psloop.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -131,46 +131,15 @@ #define _COMPONENT ACPI_PARSER ACPI_MODULE_NAME ("psloop") -static UINT32 AcpiGbl_Depth = 0; - /* Local prototypes */ -static ACPI_STATUS -AcpiPsGetAmlOpcode ( - ACPI_WALK_STATE *WalkState); - -static ACPI_STATUS -AcpiPsBuildNamedOp ( - ACPI_WALK_STATE *WalkState, - UINT8 *AmlOpStart, - ACPI_PARSE_OBJECT *UnnamedOp, - ACPI_PARSE_OBJECT **Op); - -static ACPI_STATUS -AcpiPsCreateOp ( - ACPI_WALK_STATE *WalkState, - UINT8 *AmlOpStart, - ACPI_PARSE_OBJECT **NewOp); - static ACPI_STATUS AcpiPsGetArguments ( ACPI_WALK_STATE *WalkState, UINT8 *AmlOpStart, ACPI_PARSE_OBJECT *Op); -static ACPI_STATUS -AcpiPsCompleteOp ( - ACPI_WALK_STATE *WalkState, - ACPI_PARSE_OBJECT **Op, - ACPI_STATUS Status); - -static ACPI_STATUS -AcpiPsCompleteFinalOp ( - ACPI_WALK_STATE *WalkState, - ACPI_PARSE_OBJECT *Op, - ACPI_STATUS Status); - static void AcpiPsLinkModuleCode ( ACPI_PARSE_OBJECT *ParentOp, @@ -179,314 +148,6 @@ AcpiPsLinkModuleCode ( ACPI_OWNER_ID OwnerId); -/******************************************************************************* - * - * FUNCTION: AcpiPsGetAmlOpcode - * - * PARAMETERS: WalkState - Current state - * - * RETURN: Status - * - * DESCRIPTION: Extract the next AML opcode from the input stream. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiPsGetAmlOpcode ( - ACPI_WALK_STATE *WalkState) -{ - - ACPI_FUNCTION_TRACE_PTR (PsGetAmlOpcode, WalkState); - - - WalkState->AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->ParserState.Aml, - WalkState->ParserState.AmlStart); - WalkState->Opcode = AcpiPsPeekOpcode (&(WalkState->ParserState)); - - /* - * First cut to determine what we have found: - * 1) A valid AML opcode - * 2) A name string - * 3) An unknown/invalid opcode - */ - WalkState->OpInfo = AcpiPsGetOpcodeInfo (WalkState->Opcode); - - switch (WalkState->OpInfo->Class) - { - case AML_CLASS_ASCII: - case AML_CLASS_PREFIX: - /* - * Starts with a valid prefix or ASCII char, this is a name - * string. Convert the bare name string to a namepath. - */ - WalkState->Opcode = AML_INT_NAMEPATH_OP; - WalkState->ArgTypes = ARGP_NAMESTRING; - break; - - case AML_CLASS_UNKNOWN: - - /* The opcode is unrecognized. Just skip unknown opcodes */ - - ACPI_ERROR ((AE_INFO, - "Found unknown opcode 0x%X at AML address %p offset 0x%X, ignoring", - WalkState->Opcode, WalkState->ParserState.Aml, WalkState->AmlOffset)); - - ACPI_DUMP_BUFFER (WalkState->ParserState.Aml, 128); - - /* Assume one-byte bad opcode */ - - WalkState->ParserState.Aml++; - return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); - - default: - - /* Found opcode info, this is a normal opcode */ - - WalkState->ParserState.Aml += AcpiPsGetOpcodeSize (WalkState->Opcode); - WalkState->ArgTypes = WalkState->OpInfo->ParseArgs; - break; - } - - return_ACPI_STATUS (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiPsBuildNamedOp - * - * PARAMETERS: WalkState - Current state - * AmlOpStart - Begin of named Op in AML - * UnnamedOp - Early Op (not a named Op) - * Op - Returned Op - * - * RETURN: Status - * - * DESCRIPTION: Parse a named Op - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiPsBuildNamedOp ( - ACPI_WALK_STATE *WalkState, - UINT8 *AmlOpStart, - ACPI_PARSE_OBJECT *UnnamedOp, - ACPI_PARSE_OBJECT **Op) -{ - ACPI_STATUS Status = AE_OK; - ACPI_PARSE_OBJECT *Arg = NULL; - - - ACPI_FUNCTION_TRACE_PTR (PsBuildNamedOp, WalkState); - - - UnnamedOp->Common.Value.Arg = NULL; - UnnamedOp->Common.ArgListLength = 0; - UnnamedOp->Common.AmlOpcode = WalkState->Opcode; - - /* - * Get and append arguments until we find the node that contains - * the name (the type ARGP_NAME). - */ - while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) && - (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) != ARGP_NAME)) - { - Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState), - GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - AcpiPsAppendArg (UnnamedOp, Arg); - INCREMENT_ARG_LIST (WalkState->ArgTypes); - } - - /* - * Make sure that we found a NAME and didn't run out of arguments - */ - if (!GET_CURRENT_ARG_TYPE (WalkState->ArgTypes)) - { - return_ACPI_STATUS (AE_AML_NO_OPERAND); - } - - /* We know that this arg is a name, move to next arg */ - - INCREMENT_ARG_LIST (WalkState->ArgTypes); - - /* - * Find the object. This will either insert the object into - * the namespace or simply look it up - */ - WalkState->Op = NULL; - - Status = WalkState->DescendingCallback (WalkState, Op); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During name lookup/catalog")); - return_ACPI_STATUS (Status); - } - - if (!*Op) - { - return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); - } - - Status = AcpiPsNextParseState (WalkState, *Op, Status); - if (ACPI_FAILURE (Status)) - { - if (Status == AE_CTRL_PENDING) - { - return_ACPI_STATUS (AE_CTRL_PARSE_PENDING); - } - return_ACPI_STATUS (Status); - } - - AcpiPsAppendArg (*Op, UnnamedOp->Common.Value.Arg); - AcpiGbl_Depth++; - - if ((*Op)->Common.AmlOpcode == AML_REGION_OP || - (*Op)->Common.AmlOpcode == AML_DATA_REGION_OP) - { - /* - * Defer final parsing of an OperationRegion body, because we don't - * have enough info in the first pass to parse it correctly (i.e., - * there may be method calls within the TermArg elements of the body.) - * - * However, we must continue parsing because the opregion is not a - * standalone package -- we don't know where the end is at this point. - * - * (Length is unknown until parse of the body complete) - */ - (*Op)->Named.Data = AmlOpStart; - (*Op)->Named.Length = 0; - } - - return_ACPI_STATUS (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiPsCreateOp - * - * PARAMETERS: WalkState - Current state - * AmlOpStart - Op start in AML - * NewOp - Returned Op - * - * RETURN: Status - * - * DESCRIPTION: Get Op from AML - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiPsCreateOp ( - ACPI_WALK_STATE *WalkState, - UINT8 *AmlOpStart, - ACPI_PARSE_OBJECT **NewOp) -{ - ACPI_STATUS Status = AE_OK; - ACPI_PARSE_OBJECT *Op; - ACPI_PARSE_OBJECT *NamedOp = NULL; - ACPI_PARSE_OBJECT *ParentScope; - UINT8 ArgumentCount; - const ACPI_OPCODE_INFO *OpInfo; - - - ACPI_FUNCTION_TRACE_PTR (PsCreateOp, WalkState); - - - Status = AcpiPsGetAmlOpcode (WalkState); - if (Status == AE_CTRL_PARSE_CONTINUE) - { - return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); - } - - /* Create Op structure and append to parent's argument list */ - - WalkState->OpInfo = AcpiPsGetOpcodeInfo (WalkState->Opcode); - Op = AcpiPsAllocOp (WalkState->Opcode); - if (!Op) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - if (WalkState->OpInfo->Flags & AML_NAMED) - { - Status = AcpiPsBuildNamedOp (WalkState, AmlOpStart, Op, &NamedOp); - AcpiPsFreeOp (Op); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - *NewOp = NamedOp; - return_ACPI_STATUS (AE_OK); - } - - /* Not a named opcode, just allocate Op and append to parent */ - - if (WalkState->OpInfo->Flags & AML_CREATE) - { - /* - * Backup to beginning of CreateXXXfield declaration - * BodyLength is unknown until we parse the body - */ - Op->Named.Data = AmlOpStart; - Op->Named.Length = 0; - } - - if (WalkState->Opcode == AML_BANK_FIELD_OP) - { - /* - * Backup to beginning of BankField declaration - * BodyLength is unknown until we parse the body - */ - Op->Named.Data = AmlOpStart; - Op->Named.Length = 0; - } - - ParentScope = AcpiPsGetParentScope (&(WalkState->ParserState)); - AcpiPsAppendArg (ParentScope, Op); - - if (ParentScope) - { - OpInfo = AcpiPsGetOpcodeInfo (ParentScope->Common.AmlOpcode); - if (OpInfo->Flags & AML_HAS_TARGET) - { - ArgumentCount = AcpiPsGetArgumentCount (OpInfo->Type); - if (ParentScope->Common.ArgListLength > ArgumentCount) - { - Op->Common.Flags |= ACPI_PARSEOP_TARGET; - } - } - else if (ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) - { - Op->Common.Flags |= ACPI_PARSEOP_TARGET; - } - } - - if (WalkState->DescendingCallback != NULL) - { - /* - * Find the object. This will either insert the object into - * the namespace or simply look it up - */ - WalkState->Op = *NewOp = Op; - - Status = WalkState->DescendingCallback (WalkState, &Op); - Status = AcpiPsNextParseState (WalkState, Op, Status); - if (Status == AE_CTRL_PENDING) - { - Status = AE_CTRL_PARSE_PENDING; - } - } - - return_ACPI_STATUS (Status); -} - - /******************************************************************************* * * FUNCTION: AcpiPsGetArguments @@ -585,7 +246,6 @@ AcpiPsGetArguments ( case AML_IF_OP: case AML_ELSE_OP: case AML_WHILE_OP: - /* * Currently supported module-level opcodes are: * IF/ELSE/WHILE. These appear to be the most common, @@ -623,8 +283,8 @@ AcpiPsGetArguments ( (!Arg)) { ACPI_WARNING ((AE_INFO, - "Detected an unsupported executable opcode " - "at module-level: [0x%.4X] at table offset 0x%.4X", + "Unsupported module-level executable opcode " + "0x%.2X at table offset 0x%.4X", Op->Common.AmlOpcode, (UINT32) (ACPI_PTR_DIFF (AmlOpStart, WalkState->ParserState.AmlStart) + @@ -691,6 +351,7 @@ AcpiPsGetArguments ( default: /* No action for all other opcodes */ + break; } @@ -791,298 +452,6 @@ AcpiPsLinkModuleCode ( } } - -/******************************************************************************* - * - * FUNCTION: AcpiPsCompleteOp - * - * PARAMETERS: WalkState - Current state - * Op - Returned Op - * Status - Parse status before complete Op - * - * RETURN: Status - * - * DESCRIPTION: Complete Op - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiPsCompleteOp ( - ACPI_WALK_STATE *WalkState, - ACPI_PARSE_OBJECT **Op, - ACPI_STATUS Status) -{ - ACPI_STATUS Status2; - - - ACPI_FUNCTION_TRACE_PTR (PsCompleteOp, WalkState); - - - /* - * Finished one argument of the containing scope - */ - WalkState->ParserState.Scope->ParseScope.ArgCount--; - - /* Close this Op (will result in parse subtree deletion) */ - - Status2 = AcpiPsCompleteThisOp (WalkState, *Op); - if (ACPI_FAILURE (Status2)) - { - return_ACPI_STATUS (Status2); - } - - *Op = NULL; - - switch (Status) - { - case AE_OK: - break; - - - case AE_CTRL_TRANSFER: - - /* We are about to transfer to a called method */ - - WalkState->PrevOp = NULL; - WalkState->PrevArgTypes = WalkState->ArgTypes; - return_ACPI_STATUS (Status); - - - case AE_CTRL_END: - - AcpiPsPopScope (&(WalkState->ParserState), Op, - &WalkState->ArgTypes, &WalkState->ArgCount); - - if (*Op) - { - WalkState->Op = *Op; - WalkState->OpInfo = AcpiPsGetOpcodeInfo ((*Op)->Common.AmlOpcode); - WalkState->Opcode = (*Op)->Common.AmlOpcode; - - Status = WalkState->AscendingCallback (WalkState); - Status = AcpiPsNextParseState (WalkState, *Op, Status); - - Status2 = AcpiPsCompleteThisOp (WalkState, *Op); - if (ACPI_FAILURE (Status2)) - { - return_ACPI_STATUS (Status2); - } - } - - Status = AE_OK; - break; - - - case AE_CTRL_BREAK: - case AE_CTRL_CONTINUE: - - /* Pop off scopes until we find the While */ - - while (!(*Op) || ((*Op)->Common.AmlOpcode != AML_WHILE_OP)) - { - AcpiPsPopScope (&(WalkState->ParserState), Op, - &WalkState->ArgTypes, &WalkState->ArgCount); - } - - /* Close this iteration of the While loop */ - - WalkState->Op = *Op; - WalkState->OpInfo = AcpiPsGetOpcodeInfo ((*Op)->Common.AmlOpcode); - WalkState->Opcode = (*Op)->Common.AmlOpcode; - - Status = WalkState->AscendingCallback (WalkState); - Status = AcpiPsNextParseState (WalkState, *Op, Status); - - Status2 = AcpiPsCompleteThisOp (WalkState, *Op); - if (ACPI_FAILURE (Status2)) - { - return_ACPI_STATUS (Status2); - } - - Status = AE_OK; - break; - - - case AE_CTRL_TERMINATE: - - /* Clean up */ - do - { - if (*Op) - { - Status2 = AcpiPsCompleteThisOp (WalkState, *Op); - if (ACPI_FAILURE (Status2)) - { - return_ACPI_STATUS (Status2); - } - - AcpiUtDeleteGenericState ( - AcpiUtPopGenericState (&WalkState->ControlState)); - } - - AcpiPsPopScope (&(WalkState->ParserState), Op, - &WalkState->ArgTypes, &WalkState->ArgCount); - - } while (*Op); - - return_ACPI_STATUS (AE_OK); - - - default: /* All other non-AE_OK status */ - - do - { - if (*Op) - { - Status2 = AcpiPsCompleteThisOp (WalkState, *Op); - if (ACPI_FAILURE (Status2)) - { - return_ACPI_STATUS (Status2); - } - } - - AcpiPsPopScope (&(WalkState->ParserState), Op, - &WalkState->ArgTypes, &WalkState->ArgCount); - - } while (*Op); - - -#if 0 - /* - * TBD: Cleanup parse ops on error - */ - if (*Op == NULL) - { - AcpiPsPopScope (ParserState, Op, - &WalkState->ArgTypes, &WalkState->ArgCount); - } -#endif - WalkState->PrevOp = NULL; - WalkState->PrevArgTypes = WalkState->ArgTypes; - return_ACPI_STATUS (Status); - } - - /* This scope complete? */ - - if (AcpiPsHasCompletedScope (&(WalkState->ParserState))) - { - AcpiPsPopScope (&(WalkState->ParserState), Op, - &WalkState->ArgTypes, &WalkState->ArgCount); - ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", *Op)); - } - else - { - *Op = NULL; - } - - return_ACPI_STATUS (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiPsCompleteFinalOp - * - * PARAMETERS: WalkState - Current state - * Op - Current Op - * Status - Current parse status before complete last - * Op - * - * RETURN: Status - * - * DESCRIPTION: Complete last Op. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiPsCompleteFinalOp ( - ACPI_WALK_STATE *WalkState, - ACPI_PARSE_OBJECT *Op, - ACPI_STATUS Status) -{ - ACPI_STATUS Status2; - - - ACPI_FUNCTION_TRACE_PTR (PsCompleteFinalOp, WalkState); - - - /* - * Complete the last Op (if not completed), and clear the scope stack. - * It is easily possible to end an AML "package" with an unbounded number - * of open scopes (such as when several ASL blocks are closed with - * sequential closing braces). We want to terminate each one cleanly. - */ - ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "AML package complete at Op %p\n", Op)); - do - { - if (Op) - { - if (WalkState->AscendingCallback != NULL) - { - WalkState->Op = Op; - WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); - WalkState->Opcode = Op->Common.AmlOpcode; - - Status = WalkState->AscendingCallback (WalkState); - Status = AcpiPsNextParseState (WalkState, Op, Status); - if (Status == AE_CTRL_PENDING) - { - Status = AcpiPsCompleteOp (WalkState, &Op, AE_OK); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - - if (Status == AE_CTRL_TERMINATE) - { - Status = AE_OK; - - /* Clean up */ - do - { - if (Op) - { - Status2 = AcpiPsCompleteThisOp (WalkState, Op); - if (ACPI_FAILURE (Status2)) - { - return_ACPI_STATUS (Status2); - } - } - - AcpiPsPopScope (&(WalkState->ParserState), &Op, - &WalkState->ArgTypes, &WalkState->ArgCount); - - } while (Op); - - return_ACPI_STATUS (Status); - } - - else if (ACPI_FAILURE (Status)) - { - /* First error is most important */ - - (void) AcpiPsCompleteThisOp (WalkState, Op); - return_ACPI_STATUS (Status); - } - } - - Status2 = AcpiPsCompleteThisOp (WalkState, Op); - if (ACPI_FAILURE (Status2)) - { - return_ACPI_STATUS (Status2); - } - } - - AcpiPsPopScope (&(WalkState->ParserState), &Op, &WalkState->ArgTypes, - &WalkState->ArgCount); - - } while (Op); - - return_ACPI_STATUS (Status); -} - - /******************************************************************************* * * FUNCTION: AcpiPsParseLoop @@ -1192,6 +561,11 @@ AcpiPsParseLoop ( Status = AE_OK; } + if (Status == AE_CTRL_TERMINATE) + { + return_ACPI_STATUS (Status); + } + Status = AcpiPsCompleteOp (WalkState, &Op, Status); if (ACPI_FAILURE (Status)) { @@ -1270,11 +644,6 @@ AcpiPsParseLoop ( WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); if (WalkState->OpInfo->Flags & AML_NAMED) { - if (AcpiGbl_Depth) - { - AcpiGbl_Depth--; - } - if (Op->Common.AmlOpcode == AML_REGION_OP || Op->Common.AmlOpcode == AML_DATA_REGION_OP) { @@ -1337,4 +706,3 @@ AcpiPsParseLoop ( Status = AcpiPsCompleteFinalOp (WalkState, Op, Status); return_ACPI_STATUS (Status); } - diff --git a/reactos/drivers/bus/acpi/acpica/parser/psobject.c b/reactos/drivers/bus/acpi/acpica/parser/psobject.c new file mode 100644 index 00000000000..f4ecc33899d --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/parser/psobject.c @@ -0,0 +1,754 @@ +/****************************************************************************** + * + * Module Name: psobject - Support for parse objects + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#include "acpi.h" +#include "accommon.h" +#include "acparser.h" +#include "amlcode.h" + +#define _COMPONENT ACPI_PARSER + ACPI_MODULE_NAME ("psobject") + + +/* Local prototypes */ + +static ACPI_STATUS +AcpiPsGetAmlOpcode ( + ACPI_WALK_STATE *WalkState); + + +/******************************************************************************* + * + * FUNCTION: AcpiPsGetAmlOpcode + * + * PARAMETERS: WalkState - Current state + * + * RETURN: Status + * + * DESCRIPTION: Extract the next AML opcode from the input stream. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiPsGetAmlOpcode ( + ACPI_WALK_STATE *WalkState) +{ + + ACPI_FUNCTION_TRACE_PTR (PsGetAmlOpcode, WalkState); + + + WalkState->AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->ParserState.Aml, + WalkState->ParserState.AmlStart); + WalkState->Opcode = AcpiPsPeekOpcode (&(WalkState->ParserState)); + + /* + * First cut to determine what we have found: + * 1) A valid AML opcode + * 2) A name string + * 3) An unknown/invalid opcode + */ + WalkState->OpInfo = AcpiPsGetOpcodeInfo (WalkState->Opcode); + + switch (WalkState->OpInfo->Class) + { + case AML_CLASS_ASCII: + case AML_CLASS_PREFIX: + /* + * Starts with a valid prefix or ASCII char, this is a name + * string. Convert the bare name string to a namepath. + */ + WalkState->Opcode = AML_INT_NAMEPATH_OP; + WalkState->ArgTypes = ARGP_NAMESTRING; + break; + + case AML_CLASS_UNKNOWN: + + /* The opcode is unrecognized. Complain and skip unknown opcodes */ + + if (WalkState->PassNumber == 2) + { + ACPI_ERROR ((AE_INFO, + "Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring", + WalkState->Opcode, + (UINT32) (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER)))); + + ACPI_DUMP_BUFFER ((WalkState->ParserState.Aml - 16), 48); + +#ifdef ACPI_ASL_COMPILER + /* + * This is executed for the disassembler only. Output goes + * to the disassembled ASL output file. + */ + AcpiOsPrintf ( + "/*\nError: Unknown opcode 0x%.2X at table offset 0x%.4X, context:\n", + WalkState->Opcode, + (UINT32) (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER))); + + /* Dump the context surrounding the invalid opcode */ + + AcpiUtDumpBuffer (((UINT8 *) WalkState->ParserState.Aml - 16), + 48, DB_BYTE_DISPLAY, + (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16)); + AcpiOsPrintf (" */\n"); +#endif + } + + /* Increment past one-byte or two-byte opcode */ + + WalkState->ParserState.Aml++; + if (WalkState->Opcode > 0xFF) /* Can only happen if first byte is 0x5B */ + { + WalkState->ParserState.Aml++; + } + + return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); + + default: + + /* Found opcode info, this is a normal opcode */ + + WalkState->ParserState.Aml += AcpiPsGetOpcodeSize (WalkState->Opcode); + WalkState->ArgTypes = WalkState->OpInfo->ParseArgs; + break; + } + + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiPsBuildNamedOp + * + * PARAMETERS: WalkState - Current state + * AmlOpStart - Begin of named Op in AML + * UnnamedOp - Early Op (not a named Op) + * Op - Returned Op + * + * RETURN: Status + * + * DESCRIPTION: Parse a named Op + * + ******************************************************************************/ + +ACPI_STATUS +AcpiPsBuildNamedOp ( + ACPI_WALK_STATE *WalkState, + UINT8 *AmlOpStart, + ACPI_PARSE_OBJECT *UnnamedOp, + ACPI_PARSE_OBJECT **Op) +{ + ACPI_STATUS Status = AE_OK; + ACPI_PARSE_OBJECT *Arg = NULL; + + + ACPI_FUNCTION_TRACE_PTR (PsBuildNamedOp, WalkState); + + + UnnamedOp->Common.Value.Arg = NULL; + UnnamedOp->Common.ArgListLength = 0; + UnnamedOp->Common.AmlOpcode = WalkState->Opcode; + + /* + * Get and append arguments until we find the node that contains + * the name (the type ARGP_NAME). + */ + while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) && + (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) != ARGP_NAME)) + { + Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState), + GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + AcpiPsAppendArg (UnnamedOp, Arg); + INCREMENT_ARG_LIST (WalkState->ArgTypes); + } + + /* + * Make sure that we found a NAME and didn't run out of arguments + */ + if (!GET_CURRENT_ARG_TYPE (WalkState->ArgTypes)) + { + return_ACPI_STATUS (AE_AML_NO_OPERAND); + } + + /* We know that this arg is a name, move to next arg */ + + INCREMENT_ARG_LIST (WalkState->ArgTypes); + + /* + * Find the object. This will either insert the object into + * the namespace or simply look it up + */ + WalkState->Op = NULL; + + Status = WalkState->DescendingCallback (WalkState, Op); + if (ACPI_FAILURE (Status)) + { + if (Status != AE_CTRL_TERMINATE) + { + ACPI_EXCEPTION ((AE_INFO, Status, "During name lookup/catalog")); + } + return_ACPI_STATUS (Status); + } + + if (!*Op) + { + return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); + } + + Status = AcpiPsNextParseState (WalkState, *Op, Status); + if (ACPI_FAILURE (Status)) + { + if (Status == AE_CTRL_PENDING) + { + Status = AE_CTRL_PARSE_PENDING; + } + return_ACPI_STATUS (Status); + } + + AcpiPsAppendArg (*Op, UnnamedOp->Common.Value.Arg); + + if ((*Op)->Common.AmlOpcode == AML_REGION_OP || + (*Op)->Common.AmlOpcode == AML_DATA_REGION_OP) + { + /* + * Defer final parsing of an OperationRegion body, because we don't + * have enough info in the first pass to parse it correctly (i.e., + * there may be method calls within the TermArg elements of the body.) + * + * However, we must continue parsing because the opregion is not a + * standalone package -- we don't know where the end is at this point. + * + * (Length is unknown until parse of the body complete) + */ + (*Op)->Named.Data = AmlOpStart; + (*Op)->Named.Length = 0; + } + + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiPsCreateOp + * + * PARAMETERS: WalkState - Current state + * AmlOpStart - Op start in AML + * NewOp - Returned Op + * + * RETURN: Status + * + * DESCRIPTION: Get Op from AML + * + ******************************************************************************/ + +ACPI_STATUS +AcpiPsCreateOp ( + ACPI_WALK_STATE *WalkState, + UINT8 *AmlOpStart, + ACPI_PARSE_OBJECT **NewOp) +{ + ACPI_STATUS Status = AE_OK; + ACPI_PARSE_OBJECT *Op; + ACPI_PARSE_OBJECT *NamedOp = NULL; + ACPI_PARSE_OBJECT *ParentScope; + UINT8 ArgumentCount; + const ACPI_OPCODE_INFO *OpInfo; + + + ACPI_FUNCTION_TRACE_PTR (PsCreateOp, WalkState); + + + Status = AcpiPsGetAmlOpcode (WalkState); + if (Status == AE_CTRL_PARSE_CONTINUE) + { + return_ACPI_STATUS (AE_CTRL_PARSE_CONTINUE); + } + + /* Create Op structure and append to parent's argument list */ + + WalkState->OpInfo = AcpiPsGetOpcodeInfo (WalkState->Opcode); + Op = AcpiPsAllocOp (WalkState->Opcode); + if (!Op) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + if (WalkState->OpInfo->Flags & AML_NAMED) + { + Status = AcpiPsBuildNamedOp (WalkState, AmlOpStart, Op, &NamedOp); + AcpiPsFreeOp (Op); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + *NewOp = NamedOp; + return_ACPI_STATUS (AE_OK); + } + + /* Not a named opcode, just allocate Op and append to parent */ + + if (WalkState->OpInfo->Flags & AML_CREATE) + { + /* + * Backup to beginning of CreateXXXfield declaration + * BodyLength is unknown until we parse the body + */ + Op->Named.Data = AmlOpStart; + Op->Named.Length = 0; + } + + if (WalkState->Opcode == AML_BANK_FIELD_OP) + { + /* + * Backup to beginning of BankField declaration + * BodyLength is unknown until we parse the body + */ + Op->Named.Data = AmlOpStart; + Op->Named.Length = 0; + } + + ParentScope = AcpiPsGetParentScope (&(WalkState->ParserState)); + AcpiPsAppendArg (ParentScope, Op); + + if (ParentScope) + { + OpInfo = AcpiPsGetOpcodeInfo (ParentScope->Common.AmlOpcode); + if (OpInfo->Flags & AML_HAS_TARGET) + { + ArgumentCount = AcpiPsGetArgumentCount (OpInfo->Type); + if (ParentScope->Common.ArgListLength > ArgumentCount) + { + Op->Common.Flags |= ACPI_PARSEOP_TARGET; + } + } + else if (ParentScope->Common.AmlOpcode == AML_INCREMENT_OP) + { + Op->Common.Flags |= ACPI_PARSEOP_TARGET; + } + } + + if (WalkState->DescendingCallback != NULL) + { + /* + * Find the object. This will either insert the object into + * the namespace or simply look it up + */ + WalkState->Op = *NewOp = Op; + + Status = WalkState->DescendingCallback (WalkState, &Op); + Status = AcpiPsNextParseState (WalkState, Op, Status); + if (Status == AE_CTRL_PENDING) + { + Status = AE_CTRL_PARSE_PENDING; + } + } + + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiPsCompleteOp + * + * PARAMETERS: WalkState - Current state + * Op - Returned Op + * Status - Parse status before complete Op + * + * RETURN: Status + * + * DESCRIPTION: Complete Op + * + ******************************************************************************/ + +ACPI_STATUS +AcpiPsCompleteOp ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT **Op, + ACPI_STATUS Status) +{ + ACPI_STATUS Status2; + + + ACPI_FUNCTION_TRACE_PTR (PsCompleteOp, WalkState); + + + /* + * Finished one argument of the containing scope + */ + WalkState->ParserState.Scope->ParseScope.ArgCount--; + + /* Close this Op (will result in parse subtree deletion) */ + + Status2 = AcpiPsCompleteThisOp (WalkState, *Op); + if (ACPI_FAILURE (Status2)) + { + return_ACPI_STATUS (Status2); + } + + *Op = NULL; + + switch (Status) + { + case AE_OK: + + break; + + case AE_CTRL_TRANSFER: + + /* We are about to transfer to a called method */ + + WalkState->PrevOp = NULL; + WalkState->PrevArgTypes = WalkState->ArgTypes; + return_ACPI_STATUS (Status); + + case AE_CTRL_END: + + AcpiPsPopScope (&(WalkState->ParserState), Op, + &WalkState->ArgTypes, &WalkState->ArgCount); + + if (*Op) + { + WalkState->Op = *Op; + WalkState->OpInfo = AcpiPsGetOpcodeInfo ((*Op)->Common.AmlOpcode); + WalkState->Opcode = (*Op)->Common.AmlOpcode; + + Status = WalkState->AscendingCallback (WalkState); + Status = AcpiPsNextParseState (WalkState, *Op, Status); + + Status2 = AcpiPsCompleteThisOp (WalkState, *Op); + if (ACPI_FAILURE (Status2)) + { + return_ACPI_STATUS (Status2); + } + } + + Status = AE_OK; + break; + + case AE_CTRL_BREAK: + case AE_CTRL_CONTINUE: + + /* Pop off scopes until we find the While */ + + while (!(*Op) || ((*Op)->Common.AmlOpcode != AML_WHILE_OP)) + { + AcpiPsPopScope (&(WalkState->ParserState), Op, + &WalkState->ArgTypes, &WalkState->ArgCount); + } + + /* Close this iteration of the While loop */ + + WalkState->Op = *Op; + WalkState->OpInfo = AcpiPsGetOpcodeInfo ((*Op)->Common.AmlOpcode); + WalkState->Opcode = (*Op)->Common.AmlOpcode; + + Status = WalkState->AscendingCallback (WalkState); + Status = AcpiPsNextParseState (WalkState, *Op, Status); + + Status2 = AcpiPsCompleteThisOp (WalkState, *Op); + if (ACPI_FAILURE (Status2)) + { + return_ACPI_STATUS (Status2); + } + + Status = AE_OK; + break; + + case AE_CTRL_TERMINATE: + + /* Clean up */ + do + { + if (*Op) + { + Status2 = AcpiPsCompleteThisOp (WalkState, *Op); + if (ACPI_FAILURE (Status2)) + { + return_ACPI_STATUS (Status2); + } + + AcpiUtDeleteGenericState ( + AcpiUtPopGenericState (&WalkState->ControlState)); + } + + AcpiPsPopScope (&(WalkState->ParserState), Op, + &WalkState->ArgTypes, &WalkState->ArgCount); + + } while (*Op); + + return_ACPI_STATUS (AE_OK); + + default: /* All other non-AE_OK status */ + + do + { + if (*Op) + { + Status2 = AcpiPsCompleteThisOp (WalkState, *Op); + if (ACPI_FAILURE (Status2)) + { + return_ACPI_STATUS (Status2); + } + } + + AcpiPsPopScope (&(WalkState->ParserState), Op, + &WalkState->ArgTypes, &WalkState->ArgCount); + + } while (*Op); + + +#if 0 + /* + * TBD: Cleanup parse ops on error + */ + if (*Op == NULL) + { + AcpiPsPopScope (ParserState, Op, + &WalkState->ArgTypes, &WalkState->ArgCount); + } +#endif + WalkState->PrevOp = NULL; + WalkState->PrevArgTypes = WalkState->ArgTypes; + return_ACPI_STATUS (Status); + } + + /* This scope complete? */ + + if (AcpiPsHasCompletedScope (&(WalkState->ParserState))) + { + AcpiPsPopScope (&(WalkState->ParserState), Op, + &WalkState->ArgTypes, &WalkState->ArgCount); + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "Popped scope, Op=%p\n", *Op)); + } + else + { + *Op = NULL; + } + + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiPsCompleteFinalOp + * + * PARAMETERS: WalkState - Current state + * Op - Current Op + * Status - Current parse status before complete last + * Op + * + * RETURN: Status + * + * DESCRIPTION: Complete last Op. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiPsCompleteFinalOp ( + ACPI_WALK_STATE *WalkState, + ACPI_PARSE_OBJECT *Op, + ACPI_STATUS Status) +{ + ACPI_STATUS Status2; + + + ACPI_FUNCTION_TRACE_PTR (PsCompleteFinalOp, WalkState); + + + /* + * Complete the last Op (if not completed), and clear the scope stack. + * It is easily possible to end an AML "package" with an unbounded number + * of open scopes (such as when several ASL blocks are closed with + * sequential closing braces). We want to terminate each one cleanly. + */ + ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "AML package complete at Op %p\n", Op)); + do + { + if (Op) + { + if (WalkState->AscendingCallback != NULL) + { + WalkState->Op = Op; + WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); + WalkState->Opcode = Op->Common.AmlOpcode; + + Status = WalkState->AscendingCallback (WalkState); + Status = AcpiPsNextParseState (WalkState, Op, Status); + if (Status == AE_CTRL_PENDING) + { + Status = AcpiPsCompleteOp (WalkState, &Op, AE_OK); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + if (Status == AE_CTRL_TERMINATE) + { + Status = AE_OK; + + /* Clean up */ + do + { + if (Op) + { + Status2 = AcpiPsCompleteThisOp (WalkState, Op); + if (ACPI_FAILURE (Status2)) + { + return_ACPI_STATUS (Status2); + } + } + + AcpiPsPopScope (&(WalkState->ParserState), &Op, + &WalkState->ArgTypes, &WalkState->ArgCount); + + } while (Op); + + return_ACPI_STATUS (Status); + } + + else if (ACPI_FAILURE (Status)) + { + /* First error is most important */ + + (void) AcpiPsCompleteThisOp (WalkState, Op); + return_ACPI_STATUS (Status); + } + } + + Status2 = AcpiPsCompleteThisOp (WalkState, Op); + if (ACPI_FAILURE (Status2)) + { + return_ACPI_STATUS (Status2); + } + } + + AcpiPsPopScope (&(WalkState->ParserState), &Op, &WalkState->ArgTypes, + &WalkState->ArgCount); + + } while (Op); + + return_ACPI_STATUS (Status); +} diff --git a/reactos/drivers/bus/acpi/acpica/parser/psopcode.c b/reactos/drivers/bus/acpi/acpica/parser/psopcode.c index 30a393f1ef4..0af5e9ae3b0 100644 --- a/reactos/drivers/bus/acpi/acpica/parser/psopcode.c +++ b/reactos/drivers/bus/acpi/acpica/parser/psopcode.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -116,7 +116,6 @@ #include "acpi.h" #include "accommon.h" -#include "acparser.h" #include "acopcode.h" #include "amlcode.h" @@ -125,16 +124,13 @@ ACPI_MODULE_NAME ("psopcode") -static const UINT8 AcpiGbl_ArgumentCount[] = {0,1,1,1,1,2,2,2,2,3,3,6}; - - /******************************************************************************* * * NAME: AcpiGbl_AmlOpInfo * * DESCRIPTION: Opcode table. Each entry contains * The name is a simple ascii string, the operand specifier is an - * ascii string with one letter per operand. The letter specifies + * ascii string with one letter per operand. The letter specifies * the operand type. * ******************************************************************************/ @@ -259,7 +255,7 @@ static const UINT8 AcpiGbl_ArgumentCount[] = {0,1,1,1,1,2,2,2,2,3,3,6}; /* - * Master Opcode information table. A summary of everything we know about each + * Master Opcode information table. A summary of everything we know about each * opcode, all in one place. */ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] = @@ -400,190 +396,17 @@ const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES] = /* 79 */ ACPI_OP ("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R, AML_FLAGS_EXEC_3A_1T_1R | AML_CONSTANT), /* 7A */ ACPI_OP ("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP, ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0), /* 7B */ ACPI_OP ("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R), -/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), +/* 7C */ ACPI_OP ("DataTableRegion", ARGP_DATA_REGION_OP, ARGI_DATA_REGION_OP, ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED | AML_DEFER), /* 7D */ ACPI_OP ("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP, ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ, AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE), /* ACPI 3.0 opcodes */ -/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R) +/* 7E */ ACPI_OP ("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY, AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R, AML_FLAGS_EXEC_0A_0T_1R), + +/* ACPI 5.0 opcodes */ + +/* 7F */ ACPI_OP ("-ConnectField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, AML_HAS_ARGS), +/* 80 */ ACPI_OP ("-ExtAccessField-", ARGP_CONNECTFIELD_OP, ARGI_CONNECTFIELD_OP, ACPI_TYPE_ANY, AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0) /*! [End] no source code translation !*/ }; - -/* - * This table is directly indexed by the opcodes, and returns an - * index into the table above - */ -static const UINT8 AcpiGbl_ShortOpIndex[256] = -{ -/* 0 1 2 3 4 5 6 7 */ -/* 8 9 A B C D E F */ -/* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK, -/* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK, -/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, _UNK, _UNK, _UNK, -/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX, -/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D, -/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, -/* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, -/* 0x50 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, -/* 0x58 */ _ASC, _ASC, _ASC, _UNK, _PFX, _UNK, _PFX, _ASC, -/* 0x60 */ 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, -/* 0x68 */ 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, _UNK, -/* 0x70 */ 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, -/* 0x78 */ 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, -/* 0x80 */ 0x2b, 0x2c, 0x2d, 0x2e, 0x70, 0x71, 0x2f, 0x30, -/* 0x88 */ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x72, -/* 0x90 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x73, 0x74, -/* 0x98 */ 0x75, 0x76, _UNK, _UNK, 0x77, 0x78, 0x79, 0x7A, -/* 0xA0 */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x60, 0x61, -/* 0xA8 */ 0x62, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0xB0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0xB8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0xC0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0xC8 */ _UNK, _UNK, _UNK, _UNK, 0x44, _UNK, _UNK, _UNK, -/* 0xD0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0xD8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0xE0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0xE8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0xF0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0xF8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 0x45, -}; - -/* - * This table is indexed by the second opcode of the extended opcode - * pair. It returns an index into the opcode table (AcpiGbl_AmlOpInfo) - */ -static const UINT8 AcpiGbl_LongOpIndex[NUM_EXTENDED_OPCODE] = -{ -/* 0 1 2 3 4 5 6 7 */ -/* 8 9 A B C D E F */ -/* 0x00 */ _UNK, 0x46, 0x47, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x08 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x10 */ _UNK, _UNK, 0x48, 0x49, _UNK, _UNK, _UNK, _UNK, -/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 0x7B, -/* 0x20 */ 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, -/* 0x28 */ 0x52, 0x53, 0x54, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x30 */ 0x55, 0x56, 0x57, 0x7e, _UNK, _UNK, _UNK, _UNK, -/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x40 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x48 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x50 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x58 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x60 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x68 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x70 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x78 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, -/* 0x80 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, -/* 0x88 */ 0x7C, -}; - - -/******************************************************************************* - * - * FUNCTION: AcpiPsGetOpcodeInfo - * - * PARAMETERS: Opcode - The AML opcode - * - * RETURN: A pointer to the info about the opcode. - * - * DESCRIPTION: Find AML opcode description based on the opcode. - * NOTE: This procedure must ALWAYS return a valid pointer! - * - ******************************************************************************/ - -const ACPI_OPCODE_INFO * -AcpiPsGetOpcodeInfo ( - UINT16 Opcode) -{ - ACPI_FUNCTION_NAME (PsGetOpcodeInfo); - - - /* - * Detect normal 8-bit opcode or extended 16-bit opcode - */ - if (!(Opcode & 0xFF00)) - { - /* Simple (8-bit) opcode: 0-255, can't index beyond table */ - - return (&AcpiGbl_AmlOpInfo [AcpiGbl_ShortOpIndex [(UINT8) Opcode]]); - } - - if (((Opcode & 0xFF00) == AML_EXTENDED_OPCODE) && - (((UINT8) Opcode) <= MAX_EXTENDED_OPCODE)) - { - /* Valid extended (16-bit) opcode */ - - return (&AcpiGbl_AmlOpInfo [AcpiGbl_LongOpIndex [(UINT8) Opcode]]); - } - - /* Unknown AML opcode */ - - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "Unknown AML opcode [%4.4X]\n", Opcode)); - - return (&AcpiGbl_AmlOpInfo [_UNK]); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiPsGetOpcodeName - * - * PARAMETERS: Opcode - The AML opcode - * - * RETURN: A pointer to the name of the opcode (ASCII String) - * Note: Never returns NULL. - * - * DESCRIPTION: Translate an opcode into a human-readable string - * - ******************************************************************************/ - -char * -AcpiPsGetOpcodeName ( - UINT16 Opcode) -{ -#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT) - - const ACPI_OPCODE_INFO *Op; - - - Op = AcpiPsGetOpcodeInfo (Opcode); - - /* Always guaranteed to return a valid pointer */ - - return (Op->Name); - -#else - return ("OpcodeName unavailable"); - -#endif -} - - -/******************************************************************************* - * - * FUNCTION: AcpiPsGetArgumentCount - * - * PARAMETERS: OpType - Type associated with the AML opcode - * - * RETURN: Argument count - * - * DESCRIPTION: Obtain the number of expected arguments for an AML opcode - * - ******************************************************************************/ - -UINT8 -AcpiPsGetArgumentCount ( - UINT32 OpType) -{ - - if (OpType <= AML_TYPE_EXEC_6A_0T_1R) - { - return (AcpiGbl_ArgumentCount[OpType]); - } - - return (0); -} diff --git a/reactos/drivers/bus/acpi/acpica/parser/psopinfo.c b/reactos/drivers/bus/acpi/acpica/parser/psopinfo.c new file mode 100644 index 00000000000..5118ccdc228 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/parser/psopinfo.c @@ -0,0 +1,360 @@ +/****************************************************************************** + * + * Module Name: psopinfo - AML opcode information functions and dispatch tables + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#include "acpi.h" +#include "accommon.h" +#include "acparser.h" +#include "acopcode.h" +#include "amlcode.h" + + +#define _COMPONENT ACPI_PARSER + ACPI_MODULE_NAME ("psopinfo") + + +extern const UINT8 AcpiGbl_ShortOpIndex[]; +extern const UINT8 AcpiGbl_LongOpIndex[]; + +static const UINT8 AcpiGbl_ArgumentCount[] = {0,1,1,1,1,2,2,2,2,3,3,6}; + + +/******************************************************************************* + * + * FUNCTION: AcpiPsGetOpcodeInfo + * + * PARAMETERS: Opcode - The AML opcode + * + * RETURN: A pointer to the info about the opcode. + * + * DESCRIPTION: Find AML opcode description based on the opcode. + * NOTE: This procedure must ALWAYS return a valid pointer! + * + ******************************************************************************/ + +const ACPI_OPCODE_INFO * +AcpiPsGetOpcodeInfo ( + UINT16 Opcode) +{ +#ifdef ACPI_DEBUG_OUTPUT + const char *OpcodeName = "Unknown AML opcode"; +#endif + + ACPI_FUNCTION_NAME (PsGetOpcodeInfo); + + + /* + * Detect normal 8-bit opcode or extended 16-bit opcode + */ + if (!(Opcode & 0xFF00)) + { + /* Simple (8-bit) opcode: 0-255, can't index beyond table */ + + return (&AcpiGbl_AmlOpInfo [AcpiGbl_ShortOpIndex [(UINT8) Opcode]]); + } + + if (((Opcode & 0xFF00) == AML_EXTENDED_OPCODE) && + (((UINT8) Opcode) <= MAX_EXTENDED_OPCODE)) + { + /* Valid extended (16-bit) opcode */ + + return (&AcpiGbl_AmlOpInfo [AcpiGbl_LongOpIndex [(UINT8) Opcode]]); + } + +#if defined ACPI_ASL_COMPILER && defined ACPI_DEBUG_OUTPUT +#include "asldefine.h" + + switch (Opcode) + { + case AML_RAW_DATA_BYTE: + OpcodeName = "-Raw Data Byte-"; + break; + + case AML_RAW_DATA_WORD: + OpcodeName = "-Raw Data Word-"; + break; + + case AML_RAW_DATA_DWORD: + OpcodeName = "-Raw Data Dword-"; + break; + + case AML_RAW_DATA_QWORD: + OpcodeName = "-Raw Data Qword-"; + break; + + case AML_RAW_DATA_BUFFER: + OpcodeName = "-Raw Data Buffer-"; + break; + + case AML_RAW_DATA_CHAIN: + OpcodeName = "-Raw Data Buffer Chain-"; + break; + + case AML_PACKAGE_LENGTH: + OpcodeName = "-Package Length-"; + break; + + case AML_UNASSIGNED_OPCODE: + OpcodeName = "-Unassigned Opcode-"; + break; + + case AML_DEFAULT_ARG_OP: + OpcodeName = "-Default Arg-"; + break; + + default: + break; + } +#endif + + /* Unknown AML opcode */ + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "%s [%4.4X]\n", OpcodeName, Opcode)); + + return (&AcpiGbl_AmlOpInfo [_UNK]); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiPsGetOpcodeName + * + * PARAMETERS: Opcode - The AML opcode + * + * RETURN: A pointer to the name of the opcode (ASCII String) + * Note: Never returns NULL. + * + * DESCRIPTION: Translate an opcode into a human-readable string + * + ******************************************************************************/ + +char * +AcpiPsGetOpcodeName ( + UINT16 Opcode) +{ +#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT) + + const ACPI_OPCODE_INFO *Op; + + + Op = AcpiPsGetOpcodeInfo (Opcode); + + /* Always guaranteed to return a valid pointer */ + + return (Op->Name); + +#else + return ("OpcodeName unavailable"); + +#endif +} + + +/******************************************************************************* + * + * FUNCTION: AcpiPsGetArgumentCount + * + * PARAMETERS: OpType - Type associated with the AML opcode + * + * RETURN: Argument count + * + * DESCRIPTION: Obtain the number of expected arguments for an AML opcode + * + ******************************************************************************/ + +UINT8 +AcpiPsGetArgumentCount ( + UINT32 OpType) +{ + + if (OpType <= AML_TYPE_EXEC_6A_0T_1R) + { + return (AcpiGbl_ArgumentCount[OpType]); + } + + return (0); +} + + +/* + * This table is directly indexed by the opcodes It returns + * an index into the opcode table (AcpiGbl_AmlOpInfo) + */ +const UINT8 AcpiGbl_ShortOpIndex[256] = +{ +/* 0 1 2 3 4 5 6 7 */ +/* 8 9 A B C D E F */ +/* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK, +/* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK, +/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, _UNK, _UNK, _UNK, +/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX, +/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D, +/* 0x38 */ 0x7F, 0x80, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, +/* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, +/* 0x50 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, +/* 0x58 */ _ASC, _ASC, _ASC, _UNK, _PFX, _UNK, _PFX, _ASC, +/* 0x60 */ 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, +/* 0x68 */ 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, _UNK, +/* 0x70 */ 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, +/* 0x78 */ 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, +/* 0x80 */ 0x2b, 0x2c, 0x2d, 0x2e, 0x70, 0x71, 0x2f, 0x30, +/* 0x88 */ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x72, +/* 0x90 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x73, 0x74, +/* 0x98 */ 0x75, 0x76, _UNK, _UNK, 0x77, 0x78, 0x79, 0x7A, +/* 0xA0 */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x60, 0x61, +/* 0xA8 */ 0x62, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0xB0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0xB8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0xC0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0xC8 */ _UNK, _UNK, _UNK, _UNK, 0x44, _UNK, _UNK, _UNK, +/* 0xD0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0xD8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0xE0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0xE8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0xF0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0xF8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 0x45, +}; + +/* + * This table is indexed by the second opcode of the extended opcode + * pair. It returns an index into the opcode table (AcpiGbl_AmlOpInfo) + */ +const UINT8 AcpiGbl_LongOpIndex[NUM_EXTENDED_OPCODE] = +{ +/* 0 1 2 3 4 5 6 7 */ +/* 8 9 A B C D E F */ +/* 0x00 */ _UNK, 0x46, 0x47, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x08 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x10 */ _UNK, _UNK, 0x48, 0x49, _UNK, _UNK, _UNK, _UNK, +/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 0x7B, +/* 0x20 */ 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, +/* 0x28 */ 0x52, 0x53, 0x54, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x30 */ 0x55, 0x56, 0x57, 0x7e, _UNK, _UNK, _UNK, _UNK, +/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x40 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x48 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x50 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x58 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x60 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x68 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x70 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x78 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, +/* 0x80 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, +/* 0x88 */ 0x7C, +}; diff --git a/reactos/drivers/bus/acpi/acpica/parser/psparse.c b/reactos/drivers/bus/acpi/acpica/parser/psparse.c index 59af839beca..b9038f1a2f8 100644 --- a/reactos/drivers/bus/acpi/acpica/parser/psparse.c +++ b/reactos/drivers/bus/acpi/acpica/parser/psparse.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -116,9 +116,9 @@ /* * Parse the AML and build an operation tree as most interpreters, - * like Perl, do. Parsing is done by hand rather than with a YACC + * like Perl, do. Parsing is done by hand rather than with a YACC * generated parser to tightly constrain stack and dynamic memory - * usage. At the same time, parsing is kept flexible and the code + * usage. At the same time, parsing is kept flexible and the code * fairly compact by parsing based on a list of AML opcode * templates in AmlOpInfo[] */ @@ -263,12 +263,12 @@ AcpiPsCompleteThisOp ( switch (ParentInfo->Class) { case AML_CLASS_CONTROL: + break; case AML_CLASS_CREATE: - /* - * These opcodes contain TermArg operands. The current + * These opcodes contain TermArg operands. The current * op must be replaced by a placeholder return op */ ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP); @@ -279,9 +279,8 @@ AcpiPsCompleteThisOp ( break; case AML_CLASS_NAMED_OBJECT: - /* - * These opcodes contain TermArg operands. The current + * These opcodes contain TermArg operands. The current * op must be replaced by a placeholder return op */ if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) || @@ -424,7 +423,6 @@ AcpiPsNextParseState ( Status = AE_CTRL_TERMINATE; break; - case AE_CTRL_BREAK: ParserState->Aml = WalkState->AmlLastWhile; @@ -432,14 +430,12 @@ AcpiPsNextParseState ( Status = AE_CTRL_BREAK; break; - case AE_CTRL_CONTINUE: ParserState->Aml = WalkState->AmlLastWhile; Status = AE_CTRL_CONTINUE; break; - case AE_CTRL_PENDING: ParserState->Aml = WalkState->AmlLastWhile; @@ -462,11 +458,10 @@ AcpiPsNextParseState ( Status = AE_CTRL_PENDING; break; - case AE_CTRL_FALSE: /* * Either an IF/WHILE Predicate was false or we encountered a BREAK - * opcode. In both cases, we do not execute the rest of the + * opcode. In both cases, we do not execute the rest of the * package; We simply close out the parent (finishing the walk of * this branch of the tree) and continue execution at the parent * level. @@ -479,7 +474,6 @@ AcpiPsNextParseState ( Status = AE_CTRL_END; break; - case AE_CTRL_TRANSFER: /* A method call (invocation) -- transfer control */ @@ -494,7 +488,6 @@ AcpiPsNextParseState ( WalkState->ReturnUsed = AcpiDsIsResultUsed (Op, WalkState); break; - default: Status = CallbackStatus; @@ -580,7 +573,7 @@ AcpiPsParseAml ( AcpiGbl_CurrentWalkList = Thread; /* - * Execute the walk loop as long as there is a valid Walk State. This + * Execute the walk loop as long as there is a valid Walk State. This * handles nested control method invocations without recursion. */ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "State=%p\n", WalkState)); @@ -779,5 +772,3 @@ AcpiPsParseAml ( AcpiGbl_CurrentWalkList = PrevWalkList; return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/parser/psscope.c b/reactos/drivers/bus/acpi/acpica/parser/psscope.c index 10fe18690ff..45a5768f8b3 100644 --- a/reactos/drivers/bus/acpi/acpica/parser/psscope.c +++ b/reactos/drivers/bus/acpi/acpica/parser/psscope.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -371,4 +371,3 @@ AcpiPsCleanupScope ( return_VOID; } - diff --git a/reactos/drivers/bus/acpi/acpica/parser/pstree.c b/reactos/drivers/bus/acpi/acpica/parser/pstree.c index 950dedf6c20..4a6403d55ef 100644 --- a/reactos/drivers/bus/acpi/acpica/parser/pstree.c +++ b/reactos/drivers/bus/acpi/acpica/parser/pstree.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -157,7 +157,12 @@ AcpiPsGetArg ( ACPI_FUNCTION_ENTRY (); - +/* + if (Op->Common.AmlOpcode == AML_INT_CONNECTION_OP) + { + return (Op->Common.Value.Arg); + } +*/ /* Get the info structure for this opcode */ OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode); @@ -389,7 +394,6 @@ AcpiPsGetChild ( Child = AcpiPsGetArg (Op, 0); break; - case AML_BUFFER_OP: case AML_PACKAGE_OP: case AML_METHOD_OP: @@ -400,28 +404,25 @@ AcpiPsGetChild ( Child = AcpiPsGetArg (Op, 1); break; - case AML_POWER_RES_OP: case AML_INDEX_FIELD_OP: Child = AcpiPsGetArg (Op, 2); break; - case AML_PROCESSOR_OP: case AML_BANK_FIELD_OP: Child = AcpiPsGetArg (Op, 3); break; - default: + /* All others have no children */ + break; } return (Child); } #endif - - diff --git a/reactos/drivers/bus/acpi/acpica/parser/psutils.c b/reactos/drivers/bus/acpi/acpica/parser/psutils.c index e676a4023a3..12d74a95874 100644 --- a/reactos/drivers/bus/acpi/acpica/parser/psutils.c +++ b/reactos/drivers/bus/acpi/acpica/parser/psutils.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -192,7 +192,7 @@ AcpiPsInitOp ( * RETURN: Pointer to the new Op, null on failure * * DESCRIPTION: Allocate an acpi_op, choose op type (and thus size) based on - * opcode. A cache of opcodes is available for the pure + * opcode. A cache of opcodes is available for the pure * GENERIC_OP, since this is by far the most commonly used. * ******************************************************************************/ @@ -261,7 +261,7 @@ AcpiPsAllocOp ( * * RETURN: None. * - * DESCRIPTION: Free an Op object. Either put it on the GENERIC_OP cache list + * DESCRIPTION: Free an Op object. Either put it on the GENERIC_OP cache list * or actually free it. * ******************************************************************************/ @@ -309,17 +309,6 @@ AcpiPsIsLeadingChar ( } -/* - * Is "c" a namestring prefix character? - */ -BOOLEAN -AcpiPsIsPrefixChar ( - UINT32 c) -{ - return ((BOOLEAN) (c == '\\' || c == '^')); -} - - /* * Get op's name (4-byte name segment) or 0 if unnamed */ @@ -359,4 +348,3 @@ AcpiPsSetName ( Op->Named.Name = name; } - diff --git a/reactos/drivers/bus/acpi/acpica/parser/pswalk.c b/reactos/drivers/bus/acpi/acpica/parser/pswalk.c index 0de366c4a03..7226e48f3d4 100644 --- a/reactos/drivers/bus/acpi/acpica/parser/pswalk.c +++ b/reactos/drivers/bus/acpi/acpica/parser/pswalk.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in diff --git a/reactos/drivers/bus/acpi/acpica/parser/psxface.c b/reactos/drivers/bus/acpi/acpica/parser/psxface.c index 54af318284c..65758fcdc7f 100644 --- a/reactos/drivers/bus/acpi/acpica/parser/psxface.c +++ b/reactos/drivers/bus/acpi/acpica/parser/psxface.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -222,7 +222,7 @@ AcpiPsStartTrace ( } if ((!AcpiGbl_TraceMethodName) || - (AcpiGbl_TraceMethodName != Info->ResolvedNode->Name.Integer)) + (AcpiGbl_TraceMethodName != Info->Node->Name.Integer)) { goto Exit; } @@ -277,7 +277,7 @@ AcpiPsStopTrace ( } if ((!AcpiGbl_TraceMethodName) || - (AcpiGbl_TraceMethodName != Info->ResolvedNode->Name.Integer)) + (AcpiGbl_TraceMethodName != Info->Node->Name.Integer)) { goto Exit; } @@ -340,14 +340,14 @@ AcpiPsExecuteMethod ( /* Validate the Info and method Node */ - if (!Info || !Info->ResolvedNode) + if (!Info || !Info->Node) { return_ACPI_STATUS (AE_NULL_ENTRY); } /* Init for new method, wait on concurrency semaphore */ - Status = AcpiDsBeginMethodExecution (Info->ResolvedNode, Info->ObjDesc, NULL); + Status = AcpiDsBeginMethodExecution (Info->Node, Info->ObjDesc, NULL); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -367,7 +367,7 @@ AcpiPsExecuteMethod ( */ ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Begin Method Parse/Execute [%4.4s] **** Node=%p Obj=%p\n", - Info->ResolvedNode->Name.Ascii, Info->ResolvedNode, Info->ObjDesc)); + Info->Node->Name.Ascii, Info->Node, Info->ObjDesc)); /* Create and init a Root Node */ @@ -389,7 +389,7 @@ AcpiPsExecuteMethod ( goto Cleanup; } - Status = AcpiDsInitAmlWalk (WalkState, Op, Info->ResolvedNode, + Status = AcpiDsInitAmlWalk (WalkState, Op, Info->Node, Info->ObjDesc->Method.AmlStart, Info->ObjDesc->Method.AmlLength, Info, Info->PassNumber); if (ACPI_FAILURE (Status)) @@ -420,8 +420,8 @@ AcpiPsExecuteMethod ( } /* - * Start method evaluation with an implicit return of zero. This is done - * for Windows compatibility. + * Start method evaluation with an implicit return of zero. + * This is done for Windows compatibility. */ if (AcpiGbl_EnableInterpreterSlack) { @@ -510,5 +510,3 @@ AcpiPsUpdateParameterList ( } } } - - diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsaddr.c b/reactos/drivers/bus/acpi/acpica/resources/rsaddr.c index 0ee032c799d..d29307d9f3b 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rsaddr.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rsaddr.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -475,5 +475,3 @@ AcpiRsSetAddressCommon ( Aml->Address.SpecificFlags = Resource->Data.Address.Info.TypeSpecific; } } - - diff --git a/reactos/drivers/bus/acpi/acpica/resources/rscalc.c b/reactos/drivers/bus/acpi/acpica/resources/rscalc.c index ceb8cd92152..b2742ae713b 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rscalc.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rscalc.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -269,6 +269,7 @@ AcpiRsStreamOptionLength ( * FUNCTION: AcpiRsGetAmlLength * * PARAMETERS: Resource - Pointer to the resource linked list + * ResourceListSize - Size of the resource linked list * SizeNeeded - Where the required size is returned * * RETURN: Status @@ -282,9 +283,11 @@ AcpiRsStreamOptionLength ( ACPI_STATUS AcpiRsGetAmlLength ( ACPI_RESOURCE *Resource, + ACPI_SIZE ResourceListSize, ACPI_SIZE *SizeNeeded) { ACPI_SIZE AmlSizeNeeded = 0; + ACPI_RESOURCE *ResourceEnd; ACPI_RS_LENGTH TotalSize; @@ -293,7 +296,8 @@ AcpiRsGetAmlLength ( /* Traverse entire list of internal resource descriptors */ - while (Resource) + ResourceEnd = ACPI_ADD_PTR (ACPI_RESOURCE, Resource, ResourceListSize); + while (Resource < ResourceEnd) { /* Validate the descriptor type */ @@ -302,6 +306,13 @@ AcpiRsGetAmlLength ( return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); } + /* Sanity check the length. It must not be zero, or we loop forever */ + + if (!Resource->Length) + { + return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH); + } + /* Get the base size of the (external stream) resource descriptor */ TotalSize = AcpiGbl_AmlResourceSizes [Resource->Type]; @@ -417,7 +428,27 @@ AcpiRsGetAmlLength ( break; + case ACPI_RESOURCE_TYPE_GPIO: + + TotalSize = (ACPI_RS_LENGTH) (TotalSize + (Resource->Data.Gpio.PinTableLength * 2) + + Resource->Data.Gpio.ResourceSource.StringLength + + Resource->Data.Gpio.VendorLength); + + break; + + + case ACPI_RESOURCE_TYPE_SERIAL_BUS: + + TotalSize = AcpiGbl_AmlResourceSerialBusSizes [Resource->Data.CommonSerialBus.Type]; + + TotalSize = (ACPI_RS_LENGTH) (TotalSize + + Resource->Data.I2cSerialBus.ResourceSource.StringLength + + Resource->Data.I2cSerialBus.VendorLength); + + break; + default: + break; } @@ -467,12 +498,13 @@ AcpiRsGetListLength ( UINT32 ExtraStructBytes; UINT8 ResourceIndex; UINT8 MinimumAmlResourceLength; + AML_RESOURCE *AmlResource; ACPI_FUNCTION_TRACE (RsGetListLength); - *SizeNeeded = 0; + *SizeNeeded = ACPI_RS_SIZE_MIN; /* Minimum size is one EndTag */ EndAml = AmlBuffer + AmlBufferLength; /* Walk the list of AML resource descriptors */ @@ -481,12 +513,18 @@ AcpiRsGetListLength ( { /* Validate the Resource Type and Resource Length */ - Status = AcpiUtValidateResource (AmlBuffer, &ResourceIndex); + Status = AcpiUtValidateResource (NULL, AmlBuffer, &ResourceIndex); if (ACPI_FAILURE (Status)) { + /* + * Exit on failure. Cannot continue because the descriptor length + * may be bogus also. + */ return_ACPI_STATUS (Status); } + AmlResource = (void *) AmlBuffer; + /* Get the resource length and base (minimum) AML size */ ResourceLength = AcpiUtGetResourceLength (AmlBuffer); @@ -527,15 +565,23 @@ AcpiRsGetListLength ( * Get the number of vendor data bytes */ ExtraStructBytes = ResourceLength; + + /* + * There is already one byte included in the minimum + * descriptor size. If there are extra struct bytes, + * subtract one from the count. + */ + if (ExtraStructBytes) + { + ExtraStructBytes--; + } break; case ACPI_RESOURCE_NAME_END_TAG: /* - * End Tag: - * This is the normal exit, add size of EndTag + * End Tag: This is the normal exit */ - *SizeNeeded += ACPI_RS_SIZE_MIN; return_ACPI_STATUS (AE_OK); @@ -566,8 +612,33 @@ AcpiRsGetListLength ( ResourceLength - ExtraStructBytes, MinimumAmlResourceLength); break; + case ACPI_RESOURCE_NAME_GPIO: + + /* Vendor data is optional */ + + if (AmlResource->Gpio.VendorLength) + { + ExtraStructBytes += AmlResource->Gpio.VendorOffset - + AmlResource->Gpio.PinTableOffset + AmlResource->Gpio.VendorLength; + } + else + { + ExtraStructBytes += AmlResource->LargeHeader.ResourceLength + + sizeof (AML_RESOURCE_LARGE_HEADER) - + AmlResource->Gpio.PinTableOffset; + } + break; + + case ACPI_RESOURCE_NAME_SERIAL_BUS: + + MinimumAmlResourceLength = AcpiGbl_ResourceAmlSerialBusSizes[ + AmlResource->CommonSerialBus.Type]; + ExtraStructBytes += AmlResource->CommonSerialBus.ResourceLength - + MinimumAmlResourceLength; + break; default: + break; } @@ -577,8 +648,16 @@ AcpiRsGetListLength ( * Important: Round the size up for the appropriate alignment. This * is a requirement on IA64. */ - BufferSize = AcpiGbl_ResourceStructSizes[ResourceIndex] + + if (AcpiUtGetResourceType (AmlBuffer) == ACPI_RESOURCE_NAME_SERIAL_BUS) + { + BufferSize = AcpiGbl_ResourceStructSerialBusSizes[ + AmlResource->CommonSerialBus.Type] + ExtraStructBytes; + } + else + { + BufferSize = AcpiGbl_ResourceStructSizes[ResourceIndex] + ExtraStructBytes; + } BufferSize = (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (BufferSize); *SizeNeeded += BufferSize; @@ -641,7 +720,7 @@ AcpiRsGetPciRoutingTableLength ( /* * Calculate the size of the return buffer. * The base size is the number of elements * the sizes of the - * structures. Additional space for the strings is added below. + * structures. Additional space for the strings is added below. * The minus one is to subtract the size of the UINT8 Source[1] * member because it is added below. * @@ -652,7 +731,7 @@ AcpiRsGetPciRoutingTableLength ( for (Index = 0; Index < NumberOfElements; Index++) { - /* Dereference the sub-package */ + /* Dereference the subpackage */ PackageElement = *TopObjectList; @@ -674,7 +753,9 @@ AcpiRsGetPciRoutingTableLength ( NameFound = FALSE; - for (TableIndex = 0; TableIndex < 4 && !NameFound; TableIndex++) + for (TableIndex = 0; + TableIndex < PackageElement->Package.Count && !NameFound; + TableIndex++) { if (*SubObjectList && /* Null object allowed */ diff --git a/reactos/drivers/bus/acpi/acpica/resources/rscreate.c b/reactos/drivers/bus/acpi/acpica/resources/rscreate.c index 11db3a44f14..7c23893967f 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rscreate.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rscreate.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -124,6 +124,79 @@ ACPI_MODULE_NAME ("rscreate") +/******************************************************************************* + * + * FUNCTION: AcpiBufferToResource + * + * PARAMETERS: AmlBuffer - Pointer to the resource byte stream + * AmlBufferLength - Length of the AmlBuffer + * ResourcePtr - Where the converted resource is returned + * + * RETURN: Status + * + * DESCRIPTION: Convert a raw AML buffer to a resource list + * + ******************************************************************************/ + +ACPI_STATUS +AcpiBufferToResource ( + UINT8 *AmlBuffer, + UINT16 AmlBufferLength, + ACPI_RESOURCE **ResourcePtr) +{ + ACPI_STATUS Status; + ACPI_SIZE ListSizeNeeded; + void *Resource; + void *CurrentResourcePtr; + + /* + * Note: we allow AE_AML_NO_RESOURCE_END_TAG, since an end tag + * is not required here. + */ + + /* Get the required length for the converted resource */ + + Status = AcpiRsGetListLength (AmlBuffer, AmlBufferLength, + &ListSizeNeeded); + if (Status == AE_AML_NO_RESOURCE_END_TAG) + { + Status = AE_OK; + } + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Allocate a buffer for the converted resource */ + + Resource = ACPI_ALLOCATE_ZEROED (ListSizeNeeded); + CurrentResourcePtr = Resource; + if (!Resource) + { + return (AE_NO_MEMORY); + } + + /* Perform the AML-to-Resource conversion */ + + Status = AcpiUtWalkAmlResources (NULL, AmlBuffer, AmlBufferLength, + AcpiRsConvertAmlToResources, &CurrentResourcePtr); + if (Status == AE_AML_NO_RESOURCE_END_TAG) + { + Status = AE_OK; + } + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (Resource); + } + else + { + *ResourcePtr = Resource; + } + + return (Status); +} + + /******************************************************************************* * * FUNCTION: AcpiRsCreateResourceList @@ -191,7 +264,7 @@ AcpiRsCreateResourceList ( /* Do the conversion */ Resource = OutputBuffer->Pointer; - Status = AcpiUtWalkAmlResources (AmlStart, AmlBufferLength, + Status = AcpiUtWalkAmlResources (NULL, AmlStart, AmlBufferLength, AcpiRsConvertAmlToResources, &Resource); if (ACPI_FAILURE (Status)) { @@ -208,8 +281,8 @@ AcpiRsCreateResourceList ( * * FUNCTION: AcpiRsCreatePciRoutingTable * - * PARAMETERS: PackageObject - Pointer to an ACPI_OPERAND_OBJECT - * package + * PARAMETERS: PackageObject - Pointer to a package containing one + * of more ACPI_OPERAND_OBJECTs * OutputBuffer - Pointer to the user's buffer * * RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code. @@ -217,7 +290,7 @@ AcpiRsCreateResourceList ( * AE_BUFFER_OVERFLOW and OutputBuffer->Length will point * to the size buffer needed. * - * DESCRIPTION: Takes the ACPI_OPERAND_OBJECT package and creates a + * DESCRIPTION: Takes the ACPI_OPERAND_OBJECT package and creates a * linked list of PCI interrupt descriptions * * NOTE: It is the caller's responsibility to ensure that the start of the @@ -296,17 +369,7 @@ AcpiRsCreatePciRoutingTable ( */ UserPrt->Length = (sizeof (ACPI_PCI_ROUTING_TABLE) - 4); - /* Each element of the top-level package must also be a package */ - - if ((*TopObjectList)->Common.Type != ACPI_TYPE_PACKAGE) - { - ACPI_ERROR ((AE_INFO, - "(PRT[%u]) Need sub-package, found %s", - Index, AcpiUtGetObjectTypeName (*TopObjectList))); - return_ACPI_STATUS (AE_AML_OPERAND_TYPE); - } - - /* Each sub-package must be of length 4 */ + /* Each subpackage must be of length 4 */ if ((*TopObjectList)->Package.Count != 4) { @@ -317,7 +380,7 @@ AcpiRsCreatePciRoutingTable ( } /* - * Dereference the sub-package. + * Dereference the subpackage. * The SubObjectList will now point to an array of the four IRQ * elements: [Address, Pin, Source, SourceIndex] */ @@ -326,7 +389,7 @@ AcpiRsCreatePciRoutingTable ( /* 1) First subobject: Dereference the PRT.Address */ ObjDesc = SubObjectList[0]; - if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) + if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%u].Address) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); @@ -338,7 +401,7 @@ AcpiRsCreatePciRoutingTable ( /* 2) Second subobject: Dereference the PRT.Pin */ ObjDesc = SubObjectList[1]; - if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) + if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%u].Pin) Need Integer, found %s", Index, AcpiUtGetObjectTypeName (ObjDesc))); @@ -347,23 +410,6 @@ AcpiRsCreatePciRoutingTable ( UserPrt->Pin = (UINT32) ObjDesc->Integer.Value; - /* - * If the BIOS has erroneously reversed the _PRT SourceName (index 2) - * and the SourceIndex (index 3), fix it. _PRT is important enough to - * workaround this BIOS error. This also provides compatibility with - * other ACPI implementations. - */ - ObjDesc = SubObjectList[3]; - if (!ObjDesc || (ObjDesc->Common.Type != ACPI_TYPE_INTEGER)) - { - SubObjectList[3] = SubObjectList[2]; - SubObjectList[2] = ObjDesc; - - ACPI_WARNING ((AE_INFO, - "(PRT[%X].Source) SourceName and SourceIndex are reversed, fixed", - Index)); - } - /* * 3) Third subobject: Dereference the PRT.SourceName * The name may be unresolved (slack mode), so allow a null object @@ -399,7 +445,6 @@ AcpiRsCreatePciRoutingTable ( UserPrt->Length += (UINT32) ACPI_STRLEN (UserPrt->Source) + 1; break; - case ACPI_TYPE_STRING: ACPI_STRCPY (UserPrt->Source, ObjDesc->String.Pointer); @@ -411,7 +456,6 @@ AcpiRsCreatePciRoutingTable ( UserPrt->Length += ObjDesc->String.Length + 1; break; - case ACPI_TYPE_INTEGER: /* * If this is a number, then the Source Name is NULL, since the @@ -422,7 +466,6 @@ AcpiRsCreatePciRoutingTable ( UserPrt->Length += sizeof (UINT32); break; - default: ACPI_ERROR ((AE_INFO, @@ -439,7 +482,7 @@ AcpiRsCreatePciRoutingTable ( /* 4) Fourth subobject: Dereference the PRT.SourceIndex */ ObjDesc = SubObjectList[3]; - if (ObjDesc->Common.Type != ACPI_TYPE_INTEGER) + if (!ObjDesc || ObjDesc->Common.Type != ACPI_TYPE_INTEGER) { ACPI_ERROR ((AE_INFO, "(PRT[%u].SourceIndex) Need Integer, found %s", @@ -464,23 +507,22 @@ AcpiRsCreatePciRoutingTable ( * * FUNCTION: AcpiRsCreateAmlResources * - * PARAMETERS: LinkedListBuffer - Pointer to the resource linked list - * OutputBuffer - Pointer to the user's buffer + * PARAMETERS: ResourceList - Pointer to the resource list buffer + * OutputBuffer - Where the AML buffer is returned * * RETURN: Status AE_OK if okay, else a valid ACPI_STATUS code. * If the OutputBuffer is too small, the error will be * AE_BUFFER_OVERFLOW and OutputBuffer->Length will point * to the size buffer needed. * - * DESCRIPTION: Takes the linked list of device resources and - * creates a bytestream to be used as input for the - * _SRS control method. + * DESCRIPTION: Converts a list of device resources to an AML bytestream + * to be used as input for the _SRS control method. * ******************************************************************************/ ACPI_STATUS AcpiRsCreateAmlResources ( - ACPI_RESOURCE *LinkedListBuffer, + ACPI_BUFFER *ResourceList, ACPI_BUFFER *OutputBuffer) { ACPI_STATUS Status; @@ -490,17 +532,15 @@ AcpiRsCreateAmlResources ( ACPI_FUNCTION_TRACE (RsCreateAmlResources); - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "LinkedListBuffer = %p\n", - LinkedListBuffer)); + /* Params already validated, no need to re-validate here */ - /* - * Params already validated, so we don't re-validate here - * - * Pass the LinkedListBuffer into a module that calculates - * the buffer size needed for the byte stream. - */ - Status = AcpiRsGetAmlLength (LinkedListBuffer, - &AmlSizeNeeded); + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ResourceList Buffer = %p\n", + ResourceList->Pointer)); + + /* Get the buffer size needed for the AML byte stream */ + + Status = AcpiRsGetAmlLength (ResourceList->Pointer, + ResourceList->Length, &AmlSizeNeeded); ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "AmlSizeNeeded=%X, %s\n", (UINT32) AmlSizeNeeded, AcpiFormatException (Status))); @@ -519,15 +559,14 @@ AcpiRsCreateAmlResources ( /* Do the conversion */ - Status = AcpiRsConvertResourcesToAml (LinkedListBuffer, AmlSizeNeeded, - OutputBuffer->Pointer); + Status = AcpiRsConvertResourcesToAml (ResourceList->Pointer, + AmlSizeNeeded, OutputBuffer->Pointer); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "OutputBuffer %p Length %X\n", - OutputBuffer->Pointer, (UINT32) OutputBuffer->Length)); + OutputBuffer->Pointer, (UINT32) OutputBuffer->Length)); return_ACPI_STATUS (AE_OK); } - diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsdump.c b/reactos/drivers/bus/acpi/acpica/resources/rsdump.c index d2db725b2ed..ae295fae303 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rsdump.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rsdump.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -124,7 +124,7 @@ ACPI_MODULE_NAME ("rsdump") -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER) /* Local prototypes */ @@ -162,6 +162,11 @@ AcpiRsDumpByteList ( UINT16 Length, UINT8 *Data); +static void +AcpiRsDumpWordList ( + UINT16 Length, + UINT16 *Data); + static void AcpiRsDumpDwordList ( UINT8 Length, @@ -186,234 +191,16 @@ AcpiRsDumpDescriptor ( ACPI_RSDUMP_INFO *Table); -#define ACPI_RSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE_DATA,f) -#define ACPI_PRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PCI_ROUTING_TABLE,f) -#define ACPI_RSD_TABLE_SIZE(name) (sizeof(name) / sizeof (ACPI_RSDUMP_INFO)) - - -/******************************************************************************* - * - * Resource Descriptor info tables - * - * Note: The first table entry must be a Title or Literal and must contain - * the table length (number of table entries) - * - ******************************************************************************/ - -ACPI_RSDUMP_INFO AcpiRsDumpIrq[7] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIrq), "IRQ", NULL}, - {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (Irq.DescriptorLength), "Descriptor Length", NULL}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Triggering), "Triggering", AcpiGbl_HeDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Polarity), "Polarity", AcpiGbl_LlDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Sharable), "Sharing", AcpiGbl_ShrDecode}, - {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (Irq.InterruptCount), "Interrupt Count", NULL}, - {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.Interrupts[0]), "Interrupt List", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpDma[6] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpDma), "DMA", NULL}, - {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Type), "Speed", AcpiGbl_TypDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Dma.BusMaster), "Mastering", AcpiGbl_BmDecode}, - {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Transfer), "Transfer Type", AcpiGbl_SizDecode}, - {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Dma.ChannelCount), "Channel Count", NULL}, - {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.Channels[0]), "Channel List", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[4] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpStartDpf), "Start-Dependent-Functions",NULL}, - {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (StartDpf.DescriptorLength), "Descriptor Length", NULL}, - {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.CompatibilityPriority), "Compatibility Priority", AcpiGbl_ConfigDecode}, - {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.PerformanceRobustness), "Performance/Robustness", AcpiGbl_ConfigDecode} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpEndDpf[1] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpEndDpf), "End-Dependent-Functions", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpIo[6] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIo), "I/O", NULL}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Io.IoDecode), "Address Decoding", AcpiGbl_IoDecode}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Io.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Io.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Io.Alignment), "Alignment", NULL}, - {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Io.AddressLength), "Address Length", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpFixedIo[3] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedIo), "Fixed I/O", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (FixedIo.Address), "Address", NULL}, - {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (FixedIo.AddressLength), "Address Length", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpVendor[3] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpVendor), "Vendor Specific", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Vendor.ByteLength), "Length", NULL}, - {ACPI_RSD_LONGLIST, ACPI_RSD_OFFSET (Vendor.ByteData[0]), "Vendor Data", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpEndTag[1] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpEndTag), "EndTag", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpMemory24[6] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemory24), "24-Bit Memory Range", NULL}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Memory24.WriteProtect), "Write Protect", AcpiGbl_RwDecode}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Alignment), "Alignment", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.AddressLength), "Address Length", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpMemory32[6] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemory32), "32-Bit Memory Range", NULL}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Memory32.WriteProtect), "Write Protect", AcpiGbl_RwDecode}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Alignment), "Alignment", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.AddressLength), "Address Length", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpFixedMemory32[4] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedMemory32), "32-Bit Fixed Memory Range",NULL}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (FixedMemory32.WriteProtect), "Write Protect", AcpiGbl_RwDecode}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (FixedMemory32.Address), "Address", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (FixedMemory32.AddressLength), "Address Length", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpAddress16[8] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress16), "16-Bit WORD Address Space",NULL}, - {ACPI_RSD_ADDRESS, 0, NULL, NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Granularity), "Granularity", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.TranslationOffset), "Translation Offset", NULL}, - {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.AddressLength), "Address Length", NULL}, - {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address16.ResourceSource), NULL, NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpAddress32[8] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress32), "32-Bit DWORD Address Space", NULL}, - {ACPI_RSD_ADDRESS, 0, NULL, NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Granularity), "Granularity", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.TranslationOffset), "Translation Offset", NULL}, - {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.AddressLength), "Address Length", NULL}, - {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address32.ResourceSource), NULL, NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpAddress64[8] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress64), "64-Bit QWORD Address Space", NULL}, - {ACPI_RSD_ADDRESS, 0, NULL, NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Granularity), "Granularity", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.TranslationOffset), "Translation Offset", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.AddressLength), "Address Length", NULL}, - {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address64.ResourceSource), NULL, NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[8] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtAddress64), "64-Bit Extended Address Space", NULL}, - {ACPI_RSD_ADDRESS, 0, NULL, NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Granularity), "Granularity", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Minimum), "Address Minimum", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Maximum), "Address Maximum", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TranslationOffset), "Translation Offset", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.AddressLength), "Address Length", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TypeSpecific), "Type-Specific Attribute", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[8] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtIrq), "Extended IRQ", NULL}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.ProducerConsumer), "Type", AcpiGbl_ConsumeDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Triggering), "Triggering", AcpiGbl_HeDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Polarity), "Polarity", AcpiGbl_LlDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Sharable), "Sharing", AcpiGbl_ShrDecode}, - {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (ExtendedIrq.ResourceSource), NULL, NULL}, - {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (ExtendedIrq.InterruptCount), "Interrupt Count", NULL}, - {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.Interrupts[0]), "Interrupt List", NULL} -}; - -ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[6] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGenericReg), "Generic Register", NULL}, - {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.SpaceId), "Space ID", NULL}, - {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.BitWidth), "Bit Width", NULL}, - {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.BitOffset), "Bit Offset", NULL}, - {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.AccessSize), "Access Size", NULL}, - {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (GenericReg.Address), "Address", NULL} -}; - - -/* - * Tables used for common address descriptor flag fields - */ -static ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[5] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGeneralFlags), NULL, NULL}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.ProducerConsumer), "Consumer/Producer", AcpiGbl_ConsumeDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Decode), "Address Decode", AcpiGbl_DecDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MinAddressFixed), "Min Relocatability", AcpiGbl_MinDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MaxAddressFixed), "Max Relocatability", AcpiGbl_MaxDecode} -}; - -static ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[5] = -{ - {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemoryFlags), "Resource Type", (void *) "Memory Range"}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.WriteProtect), "Write Protect", AcpiGbl_RwDecode}, - {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Caching), "Caching", AcpiGbl_MemDecode}, - {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.RangeType), "Range Type", AcpiGbl_MtpDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Translation), "Translation", AcpiGbl_TtpDecode} -}; - -static ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[4] = -{ - {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIoFlags), "Resource Type", (void *) "I/O Range"}, - {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.RangeType), "Range Type", AcpiGbl_RngDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.Translation), "Translation", AcpiGbl_TtpDecode}, - {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.TranslationType), "Translation Type", AcpiGbl_TrsDecode} -}; - - -/* - * Table used to dump _PRT contents - */ -static ACPI_RSDUMP_INFO AcpiRsDumpPrt[5] = -{ - {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPrt), NULL, NULL}, - {ACPI_RSD_UINT64, ACPI_PRT_OFFSET (Address), "Address", NULL}, - {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (Pin), "Pin", NULL}, - {ACPI_RSD_STRING, ACPI_PRT_OFFSET (Source[0]), "Source", NULL}, - {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (SourceIndex), "Source Index", NULL} -}; - - /******************************************************************************* * * FUNCTION: AcpiRsDumpDescriptor * - * PARAMETERS: Resource + * PARAMETERS: Resource - Buffer containing the resource + * Table - Table entry to decode the resource * * RETURN: None * - * DESCRIPTION: + * DESCRIPTION: Dump a resource descriptor based on a dump table entry. * ******************************************************************************/ @@ -453,43 +240,65 @@ AcpiRsDumpDescriptor ( /* Strings */ case ACPI_RSD_LITERAL: + AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer)); break; case ACPI_RSD_STRING: + AcpiRsOutString (Name, ACPI_CAST_PTR (char, Target)); break; /* Data items, 8/16/32/64 bit */ case ACPI_RSD_UINT8: - AcpiRsOutInteger8 (Name, ACPI_GET8 (Target)); + + if (Table->Pointer) + { + AcpiRsOutString (Name, ACPI_CAST_PTR (char, + Table->Pointer [*Target])); + } + else + { + AcpiRsOutInteger8 (Name, ACPI_GET8 (Target)); + } break; case ACPI_RSD_UINT16: + AcpiRsOutInteger16 (Name, ACPI_GET16 (Target)); break; case ACPI_RSD_UINT32: + AcpiRsOutInteger32 (Name, ACPI_GET32 (Target)); break; case ACPI_RSD_UINT64: + AcpiRsOutInteger64 (Name, ACPI_GET64 (Target)); break; /* Flags: 1-bit and 2-bit flags supported */ case ACPI_RSD_1BITFLAG: + AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer [*Target & 0x01])); break; case ACPI_RSD_2BITFLAG: + AcpiRsOutString (Name, ACPI_CAST_PTR (char, Table->Pointer [*Target & 0x03])); break; + case ACPI_RSD_3BITFLAG: + + AcpiRsOutString (Name, ACPI_CAST_PTR (char, + Table->Pointer [*Target & 0x07])); + break; + case ACPI_RSD_SHORTLIST: /* * Short byte list (single line output) for DMA and IRQ resources @@ -502,6 +311,19 @@ AcpiRsDumpDescriptor ( } break; + case ACPI_RSD_SHORTLISTX: + /* + * Short byte list (single line output) for GPIO vendor data + * Note: The list length is obtained from the previous table entry + */ + if (PreviousTarget) + { + AcpiRsOutTitle (Name); + AcpiRsDumpShortByteList (*PreviousTarget, + *(ACPI_CAST_INDIRECT_PTR (UINT8, Target))); + } + break; + case ACPI_RSD_LONGLIST: /* * Long byte list for Vendor resource data @@ -525,6 +347,18 @@ AcpiRsDumpDescriptor ( } break; + case ACPI_RSD_WORDLIST: + /* + * Word list for GPIO Pin Table + * Note: The list length is obtained from the previous table entry + */ + if (PreviousTarget) + { + AcpiRsDumpWordList (*PreviousTarget, + *(ACPI_CAST_INDIRECT_PTR (UINT16, Target))); + } + break; + case ACPI_RSD_ADDRESS: /* * Common flags for all Address resources @@ -540,6 +374,7 @@ AcpiRsDumpDescriptor ( break; default: + AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n", Table->Opcode); return; @@ -660,7 +495,9 @@ AcpiRsDumpResourceList ( ACPI_FUNCTION_ENTRY (); - if (!(AcpiDbgLevel & ACPI_LV_RESOURCES) || !( _COMPONENT & AcpiDbgLayer)) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT)) { return; } @@ -683,15 +520,31 @@ AcpiRsDumpResourceList ( return; } + /* Sanity check the length. It must not be zero, or we loop forever */ + + if (!ResourceList->Length) + { + AcpiOsPrintf ( + "Invalid zero length descriptor in resource list\n"); + return; + } + /* Dump the resource descriptor */ - AcpiRsDumpDescriptor (&ResourceList->Data, - AcpiGbl_DumpResourceDispatch[Type]); + if (Type == ACPI_RESOURCE_TYPE_SERIAL_BUS) + { + AcpiRsDumpDescriptor (&ResourceList->Data, + AcpiGbl_DumpSerialBusDispatch[ResourceList->Data.CommonSerialBus.Type]); + } + else + { + AcpiRsDumpDescriptor (&ResourceList->Data, + AcpiGbl_DumpResourceDispatch[Type]); + } /* Point to the next resource structure */ - ResourceList = ACPI_ADD_PTR (ACPI_RESOURCE, ResourceList, - ResourceList->Length); + ResourceList = ACPI_NEXT_RESOURCE (ResourceList); /* Exit when END_TAG descriptor is reached */ @@ -722,7 +575,9 @@ AcpiRsDumpIrqList ( ACPI_FUNCTION_ENTRY (); - if (!(AcpiDbgLevel & ACPI_LV_RESOURCES) || !( _COMPONENT & AcpiDbgLayer)) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_RESOURCES, _COMPONENT)) { return; } @@ -868,5 +723,19 @@ AcpiRsDumpDwordList ( } } -#endif +static void +AcpiRsDumpWordList ( + UINT16 Length, + UINT16 *Data) +{ + UINT16 i; + + for (i = 0; i < Length; i++) + { + AcpiOsPrintf ("%25s%2.2X : %4.4X\n", + "Word", i, Data[i]); + } +} + +#endif diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsdumpinfo.c b/reactos/drivers/bus/acpi/acpica/resources/rsdumpinfo.c new file mode 100644 index 00000000000..2aef0e586cb --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/resources/rsdumpinfo.c @@ -0,0 +1,429 @@ +/******************************************************************************* + * + * Module Name: rsdumpinfo - Tables used to display resource descriptors. + * + ******************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#define __RSDUMPINFO_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acresrc.h" + +#define _COMPONENT ACPI_RESOURCES + ACPI_MODULE_NAME ("rsdumpinfo") + + +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER) + + +#define ACPI_RSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE_DATA,f) +#define ACPI_PRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PCI_ROUTING_TABLE,f) +#define ACPI_RSD_TABLE_SIZE(name) (sizeof(name) / sizeof (ACPI_RSDUMP_INFO)) + + +/******************************************************************************* + * + * Resource Descriptor info tables + * + * Note: The first table entry must be a Title or Literal and must contain + * the table length (number of table entries) + * + ******************************************************************************/ + +ACPI_RSDUMP_INFO AcpiRsDumpIrq[7] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIrq), "IRQ", NULL}, + {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (Irq.DescriptorLength), "Descriptor Length", NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Triggering), "Triggering", AcpiGbl_HeDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Irq.Polarity), "Polarity", AcpiGbl_LlDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Irq.Sharable), "Sharing", AcpiGbl_ShrDecode}, + {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (Irq.InterruptCount), "Interrupt Count", NULL}, + {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Irq.Interrupts[0]), "Interrupt List", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpDma[6] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpDma), "DMA", NULL}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Type), "Speed", AcpiGbl_TypDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Dma.BusMaster), "Mastering", AcpiGbl_BmDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Dma.Transfer), "Transfer Type", AcpiGbl_SizDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Dma.ChannelCount), "Channel Count", NULL}, + {ACPI_RSD_SHORTLIST,ACPI_RSD_OFFSET (Dma.Channels[0]), "Channel List", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[4] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpStartDpf), "Start-Dependent-Functions",NULL}, + {ACPI_RSD_UINT8 , ACPI_RSD_OFFSET (StartDpf.DescriptorLength), "Descriptor Length", NULL}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.CompatibilityPriority), "Compatibility Priority", AcpiGbl_ConfigDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (StartDpf.PerformanceRobustness), "Performance/Robustness", AcpiGbl_ConfigDecode} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpEndDpf[1] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpEndDpf), "End-Dependent-Functions", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpIo[6] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIo), "I/O", NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Io.IoDecode), "Address Decoding", AcpiGbl_IoDecode}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Io.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Io.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Io.Alignment), "Alignment", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Io.AddressLength), "Address Length", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpFixedIo[3] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedIo), "Fixed I/O", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (FixedIo.Address), "Address", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (FixedIo.AddressLength), "Address Length", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpVendor[3] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpVendor), "Vendor Specific", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Vendor.ByteLength), "Length", NULL}, + {ACPI_RSD_LONGLIST, ACPI_RSD_OFFSET (Vendor.ByteData[0]), "Vendor Data", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpEndTag[1] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpEndTag), "EndTag", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpMemory24[6] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemory24), "24-Bit Memory Range", NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Memory24.WriteProtect), "Write Protect", AcpiGbl_RwDecode}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.Alignment), "Alignment", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Memory24.AddressLength), "Address Length", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpMemory32[6] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemory32), "32-Bit Memory Range", NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Memory32.WriteProtect), "Write Protect", AcpiGbl_RwDecode}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.Alignment), "Alignment", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Memory32.AddressLength), "Address Length", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpFixedMemory32[4] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedMemory32), "32-Bit Fixed Memory Range",NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (FixedMemory32.WriteProtect), "Write Protect", AcpiGbl_RwDecode}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (FixedMemory32.Address), "Address", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (FixedMemory32.AddressLength), "Address Length", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpAddress16[8] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress16), "16-Bit WORD Address Space",NULL}, + {ACPI_RSD_ADDRESS, 0, NULL, NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Granularity), "Granularity", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.TranslationOffset), "Translation Offset", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Address16.AddressLength), "Address Length", NULL}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address16.ResourceSource), NULL, NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpAddress32[8] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress32), "32-Bit DWORD Address Space", NULL}, + {ACPI_RSD_ADDRESS, 0, NULL, NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Granularity), "Granularity", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.TranslationOffset), "Translation Offset", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (Address32.AddressLength), "Address Length", NULL}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address32.ResourceSource), NULL, NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpAddress64[8] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpAddress64), "64-Bit QWORD Address Space", NULL}, + {ACPI_RSD_ADDRESS, 0, NULL, NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Granularity), "Granularity", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.TranslationOffset), "Translation Offset", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (Address64.AddressLength), "Address Length", NULL}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Address64.ResourceSource), NULL, NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[8] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtAddress64), "64-Bit Extended Address Space", NULL}, + {ACPI_RSD_ADDRESS, 0, NULL, NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Granularity), "Granularity", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Minimum), "Address Minimum", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.Maximum), "Address Maximum", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TranslationOffset), "Translation Offset", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.AddressLength), "Address Length", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (ExtAddress64.TypeSpecific), "Type-Specific Attribute", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[8] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpExtIrq), "Extended IRQ", NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.ProducerConsumer), "Type", AcpiGbl_ConsumeDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Triggering), "Triggering", AcpiGbl_HeDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Polarity), "Polarity", AcpiGbl_LlDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (ExtendedIrq.Sharable), "Sharing", AcpiGbl_ShrDecode}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (ExtendedIrq.ResourceSource), NULL, NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (ExtendedIrq.InterruptCount), "Interrupt Count", NULL}, + {ACPI_RSD_DWORDLIST,ACPI_RSD_OFFSET (ExtendedIrq.Interrupts[0]), "Interrupt List", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[6] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGenericReg), "Generic Register", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.SpaceId), "Space ID", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.BitWidth), "Bit Width", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.BitOffset), "Bit Offset", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (GenericReg.AccessSize), "Access Size", NULL}, + {ACPI_RSD_UINT64, ACPI_RSD_OFFSET (GenericReg.Address), "Address", NULL} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpGpio[16] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGpio), "GPIO", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Gpio.RevisionId), "RevisionId", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Gpio.ConnectionType), "ConnectionType", AcpiGbl_CtDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Gpio.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (Gpio.PinConfig), "PinConfig", AcpiGbl_PpcDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Gpio.Sharable), "Sharing", AcpiGbl_ShrDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Gpio.IoRestriction), "IoRestriction", AcpiGbl_IorDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Gpio.Triggering), "Triggering", AcpiGbl_HeDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Gpio.Polarity), "Polarity", AcpiGbl_LlDecode}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.DriveStrength), "DriveStrength", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.DebounceTimeout), "DebounceTimeout", NULL}, + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (Gpio.ResourceSource), "ResourceSource", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.PinTableLength), "PinTableLength", NULL}, + {ACPI_RSD_WORDLIST, ACPI_RSD_OFFSET (Gpio.PinTable), "PinTable", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (Gpio.VendorLength), "VendorLength", NULL}, + {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (Gpio.VendorData), "VendorData", NULL}, +}; + +ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[4] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpFixedDma), "FixedDma", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (FixedDma.RequestLines), "RequestLines", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (FixedDma.Channels), "Channels", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (FixedDma.Width), "TransferWidth", AcpiGbl_DtsDecode}, +}; + +#define ACPI_RS_DUMP_COMMON_SERIAL_BUS \ + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.RevisionId), "RevisionId", NULL}, \ + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.Type), "Type", AcpiGbl_SbtDecode}, \ + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (CommonSerialBus.ProducerConsumer), "ProducerConsumer", AcpiGbl_ConsumeDecode}, \ + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (CommonSerialBus.SlaveMode), "SlaveMode", AcpiGbl_SmDecode}, \ + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (CommonSerialBus.TypeRevisionId), "TypeRevisionId", NULL}, \ + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (CommonSerialBus.TypeDataLength), "TypeDataLength", NULL}, \ + {ACPI_RSD_SOURCE, ACPI_RSD_OFFSET (CommonSerialBus.ResourceSource), "ResourceSource", NULL}, \ + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (CommonSerialBus.VendorLength), "VendorLength", NULL}, \ + {ACPI_RSD_SHORTLISTX,ACPI_RSD_OFFSET (CommonSerialBus.VendorData), "VendorData", NULL}, + +ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[10] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpCommonSerialBus), "Common Serial Bus", NULL}, + ACPI_RS_DUMP_COMMON_SERIAL_BUS +}; + +ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[13] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpI2cSerialBus), "I2C Serial Bus", NULL}, + ACPI_RS_DUMP_COMMON_SERIAL_BUS + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (I2cSerialBus.AccessMode), "AccessMode", AcpiGbl_AmDecode}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (I2cSerialBus.ConnectionSpeed), "ConnectionSpeed", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (I2cSerialBus.SlaveAddress), "SlaveAddress", NULL}, +}; + +ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[17] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpSpiSerialBus), "Spi Serial Bus", NULL}, + ACPI_RS_DUMP_COMMON_SERIAL_BUS + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (SpiSerialBus.WireMode), "WireMode", AcpiGbl_WmDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (SpiSerialBus.DevicePolarity), "DevicePolarity", AcpiGbl_DpDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (SpiSerialBus.DataBitLength), "DataBitLength", NULL}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (SpiSerialBus.ClockPhase), "ClockPhase", AcpiGbl_CphDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (SpiSerialBus.ClockPolarity), "ClockPolarity", AcpiGbl_CpoDecode}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (SpiSerialBus.DeviceSelection), "DeviceSelection", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (SpiSerialBus.ConnectionSpeed), "ConnectionSpeed", NULL}, +}; + +ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[19] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpUartSerialBus), "Uart Serial Bus", NULL}, + ACPI_RS_DUMP_COMMON_SERIAL_BUS + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.FlowControl), "FlowControl", AcpiGbl_FcDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.StopBits), "StopBits", AcpiGbl_SbDecode}, + {ACPI_RSD_3BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.DataBits), "DataBits", AcpiGbl_BpbDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (UartSerialBus.Endian), "Endian", AcpiGbl_EdDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (UartSerialBus.Parity), "Parity", AcpiGbl_PtDecode}, + {ACPI_RSD_UINT8, ACPI_RSD_OFFSET (UartSerialBus.LinesEnabled), "LinesEnabled", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (UartSerialBus.RxFifoSize), "RxFifoSize", NULL}, + {ACPI_RSD_UINT16, ACPI_RSD_OFFSET (UartSerialBus.TxFifoSize), "TxFifoSize", NULL}, + {ACPI_RSD_UINT32, ACPI_RSD_OFFSET (UartSerialBus.DefaultBaudRate), "ConnectionSpeed", NULL}, +}; + +/* + * Tables used for common address descriptor flag fields + */ +ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[5] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpGeneralFlags), NULL, NULL}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.ProducerConsumer), "Consumer/Producer", AcpiGbl_ConsumeDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Decode), "Address Decode", AcpiGbl_DecDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MinAddressFixed), "Min Relocatability", AcpiGbl_MinDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.MaxAddressFixed), "Max Relocatability", AcpiGbl_MaxDecode} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[5] = +{ + {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpMemoryFlags), "Resource Type", (void *) "Memory Range"}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.WriteProtect), "Write Protect", AcpiGbl_RwDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Caching), "Caching", AcpiGbl_MemDecode}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.RangeType), "Range Type", AcpiGbl_MtpDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Mem.Translation), "Translation", AcpiGbl_TtpDecode} +}; + +ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[4] = +{ + {ACPI_RSD_LITERAL, ACPI_RSD_TABLE_SIZE (AcpiRsDumpIoFlags), "Resource Type", (void *) "I/O Range"}, + {ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.RangeType), "Range Type", AcpiGbl_RngDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.Translation), "Translation", AcpiGbl_TtpDecode}, + {ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET (Address.Info.Io.TranslationType), "Translation Type", AcpiGbl_TrsDecode} +}; + + +/* + * Table used to dump _PRT contents + */ +ACPI_RSDUMP_INFO AcpiRsDumpPrt[5] = +{ + {ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE (AcpiRsDumpPrt), NULL, NULL}, + {ACPI_RSD_UINT64, ACPI_PRT_OFFSET (Address), "Address", NULL}, + {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (Pin), "Pin", NULL}, + {ACPI_RSD_STRING, ACPI_PRT_OFFSET (Source[0]), "Source", NULL}, + {ACPI_RSD_UINT32, ACPI_PRT_OFFSET (SourceIndex), "Source Index", NULL} +}; + +#endif diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsinfo.c b/reactos/drivers/bus/acpi/acpica/resources/rsinfo.c index 5fca428e3df..05f02a85da4 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rsinfo.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rsinfo.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -154,7 +154,10 @@ ACPI_RSCONVERT_INFO *AcpiGbl_SetResourceDispatch[] = AcpiRsConvertAddress64, /* 0x0D, ACPI_RESOURCE_TYPE_ADDRESS64 */ AcpiRsConvertExtAddress64, /* 0x0E, ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ AcpiRsConvertExtIrq, /* 0x0F, ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ - AcpiRsConvertGenericReg /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ + AcpiRsConvertGenericReg, /* 0x10, ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ + AcpiRsConvertGpio, /* 0x11, ACPI_RESOURCE_TYPE_GPIO */ + AcpiRsConvertFixedDma, /* 0x12, ACPI_RESOURCE_TYPE_FIXED_DMA */ + NULL, /* 0x13, ACPI_RESOURCE_TYPE_SERIAL_BUS - Use subtype table below */ }; /* Dispatch tables for AML-to-resource (Get Resource) conversion functions */ @@ -173,7 +176,7 @@ ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[] = AcpiRsConvertEndDpf, /* 0x07, ACPI_RESOURCE_NAME_END_DEPENDENT */ AcpiRsConvertIo, /* 0x08, ACPI_RESOURCE_NAME_IO */ AcpiRsConvertFixedIo, /* 0x09, ACPI_RESOURCE_NAME_FIXED_IO */ - NULL, /* 0x0A, Reserved */ + AcpiRsConvertFixedDma, /* 0x0A, ACPI_RESOURCE_NAME_FIXED_DMA */ NULL, /* 0x0B, Reserved */ NULL, /* 0x0C, Reserved */ NULL, /* 0x0D, Reserved */ @@ -193,11 +196,24 @@ ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[] = AcpiRsConvertAddress16, /* 0x08, ACPI_RESOURCE_NAME_ADDRESS16 */ AcpiRsConvertExtIrq, /* 0x09, ACPI_RESOURCE_NAME_EXTENDED_IRQ */ AcpiRsConvertAddress64, /* 0x0A, ACPI_RESOURCE_NAME_ADDRESS64 */ - AcpiRsConvertExtAddress64 /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ + AcpiRsConvertExtAddress64, /* 0x0B, ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 */ + AcpiRsConvertGpio, /* 0x0C, ACPI_RESOURCE_NAME_GPIO */ + NULL, /* 0x0D, Reserved */ + NULL, /* 0x0E, ACPI_RESOURCE_NAME_SERIAL_BUS - Use subtype table below */ +}; + +/* Subtype table for SerialBus -- I2C, SPI, and UART */ + +ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[] = +{ + NULL, + AcpiRsConvertI2cSerialBus, + AcpiRsConvertSpiSerialBus, + AcpiRsConvertUartSerialBus, }; -#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER) +#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER) /* Dispatch table for resource dump functions */ @@ -220,6 +236,17 @@ ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[] = AcpiRsDumpExtAddress64, /* ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ AcpiRsDumpExtIrq, /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ AcpiRsDumpGenericReg, /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ + AcpiRsDumpGpio, /* ACPI_RESOURCE_TYPE_GPIO */ + AcpiRsDumpFixedDma, /* ACPI_RESOURCE_TYPE_FIXED_DMA */ + NULL, /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ +}; + +ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[] = +{ + NULL, + AcpiRsDumpI2cSerialBus, /* AML_RESOURCE_I2C_BUS_TYPE */ + AcpiRsDumpSpiSerialBus, /* AML_RESOURCE_SPI_BUS_TYPE */ + AcpiRsDumpUartSerialBus, /* AML_RESOURCE_UART_BUS_TYPE */ }; #endif @@ -247,7 +274,10 @@ const UINT8 AcpiGbl_AmlResourceSizes[] = sizeof (AML_RESOURCE_ADDRESS64), /* ACPI_RESOURCE_TYPE_ADDRESS64 */ sizeof (AML_RESOURCE_EXTENDED_ADDRESS64),/*ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 */ sizeof (AML_RESOURCE_EXTENDED_IRQ), /* ACPI_RESOURCE_TYPE_EXTENDED_IRQ */ - sizeof (AML_RESOURCE_GENERIC_REGISTER) /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ + sizeof (AML_RESOURCE_GENERIC_REGISTER), /* ACPI_RESOURCE_TYPE_GENERIC_REGISTER */ + sizeof (AML_RESOURCE_GPIO), /* ACPI_RESOURCE_TYPE_GPIO */ + sizeof (AML_RESOURCE_FIXED_DMA), /* ACPI_RESOURCE_TYPE_FIXED_DMA */ + sizeof (AML_RESOURCE_COMMON_SERIALBUS), /* ACPI_RESOURCE_TYPE_SERIAL_BUS */ }; @@ -265,7 +295,7 @@ const UINT8 AcpiGbl_ResourceStructSizes[] = ACPI_RS_SIZE_MIN, ACPI_RS_SIZE (ACPI_RESOURCE_IO), ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_IO), - 0, + ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_DMA), 0, 0, 0, @@ -285,6 +315,23 @@ const UINT8 AcpiGbl_ResourceStructSizes[] = ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS16), ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_IRQ), ACPI_RS_SIZE (ACPI_RESOURCE_ADDRESS64), - ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64) + ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_ADDRESS64), + ACPI_RS_SIZE (ACPI_RESOURCE_GPIO), + ACPI_RS_SIZE (ACPI_RESOURCE_COMMON_SERIALBUS) }; +const UINT8 AcpiGbl_AmlResourceSerialBusSizes[] = +{ + 0, + sizeof (AML_RESOURCE_I2C_SERIALBUS), + sizeof (AML_RESOURCE_SPI_SERIALBUS), + sizeof (AML_RESOURCE_UART_SERIALBUS), +}; + +const UINT8 AcpiGbl_ResourceStructSerialBusSizes[] = +{ + 0, + ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS), + ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS), + ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS), +}; diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsio.c b/reactos/drivers/bus/acpi/acpica/resources/rsio.c index 26e7988644e..b0e6f1dc94e 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rsio.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rsio.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -372,5 +372,3 @@ ACPI_RSCONVERT_INFO AcpiRsSetStartDpf[10] = {ACPI_RSC_LENGTH, 0, 0, sizeof (AML_RESOURCE_START_DEPENDENT_NOPRIO)} }; - - diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsirq.c b/reactos/drivers/bus/acpi/acpica/resources/rsirq.c index d424d1215ca..1bd887b6bf8 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rsirq.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rsirq.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -129,7 +129,7 @@ * ******************************************************************************/ -ACPI_RSCONVERT_INFO AcpiRsGetIrq[8] = +ACPI_RSCONVERT_INFO AcpiRsGetIrq[9] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ, ACPI_RS_SIZE (ACPI_RESOURCE_IRQ), @@ -157,7 +157,7 @@ ACPI_RSCONVERT_INFO AcpiRsGetIrq[8] = {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3}, - /* Get flags: Triggering[0], Polarity[3], Sharing[4] */ + /* Get flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Triggering), AML_OFFSET (Irq.Flags), @@ -169,7 +169,11 @@ ACPI_RSCONVERT_INFO AcpiRsGetIrq[8] = {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Sharable), AML_OFFSET (Irq.Flags), - 4} + 4}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.WakeCapable), + AML_OFFSET (Irq.Flags), + 5} }; @@ -179,7 +183,7 @@ ACPI_RSCONVERT_INFO AcpiRsGetIrq[8] = * ******************************************************************************/ -ACPI_RSCONVERT_INFO AcpiRsSetIrq[13] = +ACPI_RSCONVERT_INFO AcpiRsSetIrq[14] = { /* Start with a default descriptor of length 3 */ @@ -193,7 +197,7 @@ ACPI_RSCONVERT_INFO AcpiRsSetIrq[13] = AML_OFFSET (Irq.IrqMask), ACPI_RS_OFFSET (Data.Irq.InterruptCount)}, - /* Set the flags byte */ + /* Set flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.Triggering), AML_OFFSET (Irq.Flags), @@ -207,6 +211,10 @@ ACPI_RSCONVERT_INFO AcpiRsSetIrq[13] = AML_OFFSET (Irq.Flags), 4}, + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Irq.WakeCapable), + AML_OFFSET (Irq.Flags), + 5}, + /* * All done if the output descriptor length is required to be 3 * (i.e., optimization to 2 bytes cannot be attempted) @@ -261,7 +269,7 @@ ACPI_RSCONVERT_INFO AcpiRsSetIrq[13] = * ******************************************************************************/ -ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[9] = +ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[10] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_IRQ, ACPI_RS_SIZE (ACPI_RESOURCE_EXTENDED_IRQ), @@ -271,8 +279,10 @@ ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[9] = sizeof (AML_RESOURCE_EXTENDED_IRQ), 0}, - /* Flag bits */ - + /* + * Flags: Producer/Consumer[0], Triggering[1], Polarity[2], + * Sharing[3], Wake[4] + */ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.ProducerConsumer), AML_OFFSET (ExtendedIrq.Flags), 0}, @@ -289,6 +299,10 @@ ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[9] = AML_OFFSET (ExtendedIrq.Flags), 3}, + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ExtendedIrq.WakeCapable), + AML_OFFSET (ExtendedIrq.Flags), + 4}, + /* IRQ Table length (Byte4) */ {ACPI_RSC_COUNT, ACPI_RS_OFFSET (Data.ExtendedIrq.InterruptCount), @@ -346,3 +360,33 @@ ACPI_RSCONVERT_INFO AcpiRsConvertDma[6] = ACPI_RS_OFFSET (Data.Dma.ChannelCount)} }; + +/******************************************************************************* + * + * AcpiRsConvertFixedDma + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[4] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_DMA, + ACPI_RS_SIZE (ACPI_RESOURCE_FIXED_DMA), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertFixedDma)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_DMA, + sizeof (AML_RESOURCE_FIXED_DMA), + 0}, + + /* + * These fields are contiguous in both the source and destination: + * RequestLines + * Channels + */ + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.FixedDma.RequestLines), + AML_OFFSET (FixedDma.RequestLines), + 2}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.FixedDma.Width), + AML_OFFSET (FixedDma.Width), + 1}, +}; diff --git a/reactos/drivers/bus/acpi/acpica/resources/rslist.c b/reactos/drivers/bus/acpi/acpica/resources/rslist.c index 58bd3951141..71e31645fbe 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rslist.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rslist.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -144,11 +144,13 @@ AcpiRsConvertAmlToResources ( UINT32 Length, UINT32 Offset, UINT8 ResourceIndex, - void *Context) + void **Context) { ACPI_RESOURCE **ResourcePtr = ACPI_CAST_INDIRECT_PTR ( ACPI_RESOURCE, Context); ACPI_RESOURCE *Resource; + AML_RESOURCE *AmlResource; + ACPI_RSCONVERT_INFO *ConversionTable; ACPI_STATUS Status; @@ -166,11 +168,42 @@ AcpiRsConvertAmlToResources ( "Misaligned resource pointer %p", Resource)); } - /* Convert the AML byte stream resource to a local resource struct */ + /* Get the appropriate conversion info table */ + + AmlResource = ACPI_CAST_PTR (AML_RESOURCE, Aml); + if (AcpiUtGetResourceType (Aml) == ACPI_RESOURCE_NAME_SERIAL_BUS) + { + if (AmlResource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE) + { + ConversionTable = NULL; + } + else + { + /* This is an I2C, SPI, or UART SerialBus descriptor */ + + ConversionTable = + AcpiGbl_ConvertResourceSerialBusDispatch[ + AmlResource->CommonSerialBus.Type]; + } + } + else + { + ConversionTable = + AcpiGbl_GetResourceDispatch[ResourceIndex]; + } + + if (!ConversionTable) + { + ACPI_ERROR ((AE_INFO, + "Invalid/unsupported resource descriptor: Type 0x%2.2X", + ResourceIndex)); + return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); + } + + /* Convert the AML byte stream resource to a local resource struct */ Status = AcpiRsConvertAmlToResource ( - Resource, ACPI_CAST_PTR (AML_RESOURCE, Aml), - AcpiGbl_GetResourceDispatch[ResourceIndex]); + Resource, AmlResource, ConversionTable); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, @@ -185,7 +218,7 @@ AcpiRsConvertAmlToResources ( /* Point to the next structure in the output buffer */ - *ResourcePtr = ACPI_ADD_PTR (void, Resource, Resource->Length); + *ResourcePtr = ACPI_NEXT_RESOURCE (Resource); return_ACPI_STATUS (AE_OK); } @@ -217,6 +250,7 @@ AcpiRsConvertResourcesToAml ( { UINT8 *Aml = OutputBuffer; UINT8 *EndAml = OutputBuffer + AmlSizeNeeded; + ACPI_RSCONVERT_INFO *ConversionTable; ACPI_STATUS Status; @@ -237,11 +271,47 @@ AcpiRsConvertResourcesToAml ( return_ACPI_STATUS (AE_BAD_DATA); } + /* Sanity check the length. It must not be zero, or we loop forever */ + + if (!Resource->Length) + { + ACPI_ERROR ((AE_INFO, + "Invalid zero length descriptor in resource list\n")); + return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH); + } + /* Perform the conversion */ + if (Resource->Type == ACPI_RESOURCE_TYPE_SERIAL_BUS) + { + if (Resource->Data.CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE) + { + ConversionTable = NULL; + } + else + { + /* This is an I2C, SPI, or UART SerialBus descriptor */ + + ConversionTable = AcpiGbl_ConvertResourceSerialBusDispatch[ + Resource->Data.CommonSerialBus.Type]; + } + } + else + { + ConversionTable = AcpiGbl_SetResourceDispatch[Resource->Type]; + } + + if (!ConversionTable) + { + ACPI_ERROR ((AE_INFO, + "Invalid/unsupported resource descriptor: Type 0x%2.2X", + Resource->Type)); + return_ACPI_STATUS (AE_AML_INVALID_RESOURCE_TYPE); + } + Status = AcpiRsConvertResourceToAml (Resource, - ACPI_CAST_PTR (AML_RESOURCE, Aml), - AcpiGbl_SetResourceDispatch[Resource->Type]); + ACPI_CAST_PTR (AML_RESOURCE, Aml), + ConversionTable); if (ACPI_FAILURE (Status)) { ACPI_EXCEPTION ((AE_INFO, Status, @@ -252,7 +322,7 @@ AcpiRsConvertResourcesToAml ( /* Perform final sanity check on the new AML resource descriptor */ - Status = AcpiUtValidateResource ( + Status = AcpiUtValidateResource (NULL, ACPI_CAST_PTR (AML_RESOURCE, Aml), NULL); if (ACPI_FAILURE (Status)) { @@ -276,11 +346,10 @@ AcpiRsConvertResourcesToAml ( /* Point to the next input resource descriptor */ - Resource = ACPI_ADD_PTR (ACPI_RESOURCE, Resource, Resource->Length); + Resource = ACPI_NEXT_RESOURCE (Resource); } /* Completed buffer, but did not find an EndTag resource descriptor */ return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); } - diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsmemory.c b/reactos/drivers/bus/acpi/acpica/resources/rsmemory.c index 708e604c510..727d3ee7c75 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rsmemory.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rsmemory.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -319,5 +319,3 @@ ACPI_RSCONVERT_INFO AcpiRsSetVendor[7] = sizeof (AML_RESOURCE_LARGE_HEADER), 0} }; - - diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsmisc.c b/reactos/drivers/bus/acpi/acpica/resources/rsmisc.c index 89c59a531bc..a6976028f65 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rsmisc.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rsmisc.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -166,6 +166,11 @@ AcpiRsConvertAmlToResource ( ACPI_FUNCTION_TRACE (RsConvertAmlToResource); + if (!Info) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + if (((ACPI_SIZE) Resource) & 0x3) { /* Each internal resource struct is expected to be 32-bit aligned */ @@ -184,7 +189,6 @@ AcpiRsConvertAmlToResource ( * table length (# of table entries) */ Count = INIT_TABLE_LENGTH (Info); - while (Count) { /* @@ -205,61 +209,124 @@ AcpiRsConvertAmlToResource ( Resource->Length = INIT_RESOURCE_LENGTH (Info); break; - case ACPI_RSC_INITSET: break; - case ACPI_RSC_FLAGINIT: FlagsMode = TRUE; break; - case ACPI_RSC_1BITFLAG: /* * Mask and shift the flag bit */ - ACPI_SET8 (Destination) = (UINT8) - ((ACPI_GET8 (Source) >> Info->Value) & 0x01); + ACPI_SET8 (Destination, + ((ACPI_GET8 (Source) >> Info->Value) & 0x01)); break; - case ACPI_RSC_2BITFLAG: /* * Mask and shift the flag bits */ - ACPI_SET8 (Destination) = (UINT8) - ((ACPI_GET8 (Source) >> Info->Value) & 0x03); + ACPI_SET8 (Destination, + ((ACPI_GET8 (Source) >> Info->Value) & 0x03)); break; + case ACPI_RSC_3BITFLAG: + /* + * Mask and shift the flag bits + */ + ACPI_SET8 (Destination, + ((ACPI_GET8 (Source) >> Info->Value) & 0x07)); + break; case ACPI_RSC_COUNT: ItemCount = ACPI_GET8 (Source); - ACPI_SET8 (Destination) = (UINT8) ItemCount; + ACPI_SET8 (Destination, ItemCount); Resource->Length = Resource->Length + (Info->Value * (ItemCount - 1)); break; - case ACPI_RSC_COUNT16: ItemCount = AmlResourceLength; - ACPI_SET16 (Destination) = ItemCount; + ACPI_SET16 (Destination, ItemCount); Resource->Length = Resource->Length + (Info->Value * (ItemCount - 1)); break; + case ACPI_RSC_COUNT_GPIO_PIN: + + Target = ACPI_ADD_PTR (void, Aml, Info->Value); + ItemCount = ACPI_GET16 (Target) - ACPI_GET16 (Source); + + Resource->Length = Resource->Length + ItemCount; + ItemCount = ItemCount / 2; + ACPI_SET16 (Destination, ItemCount); + break; + + case ACPI_RSC_COUNT_GPIO_VEN: + + ItemCount = ACPI_GET8 (Source); + ACPI_SET8 (Destination, ItemCount); + + Resource->Length = Resource->Length + + (Info->Value * ItemCount); + break; + + case ACPI_RSC_COUNT_GPIO_RES: + /* + * Vendor data is optional (length/offset may both be zero) + * Examine vendor data length field first + */ + Target = ACPI_ADD_PTR (void, Aml, (Info->Value + 2)); + if (ACPI_GET16 (Target)) + { + /* Use vendor offset to get resource source length */ + + Target = ACPI_ADD_PTR (void, Aml, Info->Value); + ItemCount = ACPI_GET16 (Target) - ACPI_GET16 (Source); + } + else + { + /* No vendor data to worry about */ + + ItemCount = Aml->LargeHeader.ResourceLength + + sizeof (AML_RESOURCE_LARGE_HEADER) - + ACPI_GET16 (Source); + } + + Resource->Length = Resource->Length + ItemCount; + ACPI_SET16 (Destination, ItemCount); + break; + + case ACPI_RSC_COUNT_SERIAL_VEN: + + ItemCount = ACPI_GET16 (Source) - Info->Value; + + Resource->Length = Resource->Length + ItemCount; + ACPI_SET16 (Destination, ItemCount); + break; + + case ACPI_RSC_COUNT_SERIAL_RES: + + ItemCount = (AmlResourceLength + + sizeof (AML_RESOURCE_LARGE_HEADER)) - + ACPI_GET16 (Source) - Info->Value; + + Resource->Length = Resource->Length + ItemCount; + ACPI_SET16 (Destination, ItemCount); + break; case ACPI_RSC_LENGTH: Resource->Length = Resource->Length + Info->Value; break; - case ACPI_RSC_MOVE8: case ACPI_RSC_MOVE16: case ACPI_RSC_MOVE32: @@ -275,20 +342,73 @@ AcpiRsConvertAmlToResource ( AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; + case ACPI_RSC_MOVE_GPIO_PIN: + + /* Generate and set the PIN data pointer */ + + Target = (char *) ACPI_ADD_PTR (void, Resource, + (Resource->Length - ItemCount * 2)); + *(UINT16 **) Destination = ACPI_CAST_PTR (UINT16, Target); + + /* Copy the PIN data */ + + Source = ACPI_ADD_PTR (void, Aml, ACPI_GET16 (Source)); + AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); + break; + + case ACPI_RSC_MOVE_GPIO_RES: + + /* Generate and set the ResourceSource string pointer */ + + Target = (char *) ACPI_ADD_PTR (void, Resource, + (Resource->Length - ItemCount)); + *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target); + + /* Copy the ResourceSource string */ + + Source = ACPI_ADD_PTR (void, Aml, ACPI_GET16 (Source)); + AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); + break; + + case ACPI_RSC_MOVE_SERIAL_VEN: + + /* Generate and set the Vendor Data pointer */ + + Target = (char *) ACPI_ADD_PTR (void, Resource, + (Resource->Length - ItemCount)); + *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target); + + /* Copy the Vendor Data */ + + Source = ACPI_ADD_PTR (void, Aml, Info->Value); + AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); + break; + + case ACPI_RSC_MOVE_SERIAL_RES: + + /* Generate and set the ResourceSource string pointer */ + + Target = (char *) ACPI_ADD_PTR (void, Resource, + (Resource->Length - ItemCount)); + *(UINT8 **) Destination = ACPI_CAST_PTR (UINT8, Target); + + /* Copy the ResourceSource string */ + + Source = ACPI_ADD_PTR (void, Aml, (ACPI_GET16 (Source) + Info->Value)); + AcpiRsMoveData (Target, Source, ItemCount, Info->Opcode); + break; case ACPI_RSC_SET8: ACPI_MEMSET (Destination, Info->AmlOffset, Info->Value); break; - case ACPI_RSC_DATA8: Target = ACPI_ADD_PTR (char, Resource, Info->Value); ACPI_MEMCPY (Destination, Source, ACPI_GET16 (Target)); break; - case ACPI_RSC_ADDRESS: /* * Common handler for address descriptor flags @@ -299,7 +419,6 @@ AcpiRsConvertAmlToResource ( } break; - case ACPI_RSC_SOURCE: /* * Optional ResourceSource (Index and String) @@ -309,21 +428,20 @@ AcpiRsConvertAmlToResource ( Destination, Aml, NULL); break; - case ACPI_RSC_SOURCEX: /* * Optional ResourceSource (Index and String). This is the more * complicated case used by the Interrupt() macro */ - Target = ACPI_ADD_PTR (char, Resource, Info->AmlOffset + (ItemCount * 4)); + Target = ACPI_ADD_PTR (char, Resource, + Info->AmlOffset + (ItemCount * 4)); Resource->Length += - AcpiRsGetResourceSource (AmlResourceLength, - (ACPI_RS_LENGTH) (((ItemCount - 1) * sizeof (UINT32)) + Info->Value), + AcpiRsGetResourceSource (AmlResourceLength, (ACPI_RS_LENGTH) + (((ItemCount - 1) * sizeof (UINT32)) + Info->Value), Destination, Aml, Target); break; - case ACPI_RSC_BITMASK: /* * 8-bit encoded bitmask (DMA macro) @@ -335,10 +453,9 @@ AcpiRsConvertAmlToResource ( } Target = ACPI_ADD_PTR (char, Resource, Info->Value); - ACPI_SET8 (Target) = (UINT8) ItemCount; + ACPI_SET8 (Target, ItemCount); break; - case ACPI_RSC_BITMASK16: /* * 16-bit encoded bitmask (IRQ macro) @@ -352,10 +469,9 @@ AcpiRsConvertAmlToResource ( } Target = ACPI_ADD_PTR (char, Resource, Info->Value); - ACPI_SET8 (Target) = (UINT8) ItemCount; + ACPI_SET8 (Target, ItemCount); break; - case ACPI_RSC_EXIT_NE: /* * Control - Exit conversion if not equal @@ -363,6 +479,7 @@ AcpiRsConvertAmlToResource ( switch (Info->ResourceOffset) { case ACPI_RSC_COMPARE_AML_LENGTH: + if (AmlResourceLength != Info->Value) { goto Exit; @@ -370,6 +487,7 @@ AcpiRsConvertAmlToResource ( break; case ACPI_RSC_COMPARE_VALUE: + if (ACPI_GET8 (Source) != Info->Value) { goto Exit; @@ -383,7 +501,6 @@ AcpiRsConvertAmlToResource ( } break; - default: ACPI_ERROR ((AE_INFO, "Invalid conversion opcode")); @@ -428,6 +545,7 @@ AcpiRsConvertResourceToAml ( { void *Source = NULL; void *Destination; + char *Target; ACPI_RSDESC_SIZE AmlLength = 0; UINT8 Count; UINT16 Temp16 = 0; @@ -437,6 +555,11 @@ AcpiRsConvertResourceToAml ( ACPI_FUNCTION_TRACE (RsConvertResourceToAml); + if (!Info) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + /* * First table entry must be ACPI_RSC_INITxxx and must contain the * table length (# of table entries) @@ -461,46 +584,48 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceHeader (INIT_RESOURCE_TYPE (Info), AmlLength, Aml); break; - case ACPI_RSC_INITGET: break; - case ACPI_RSC_FLAGINIT: /* * Clear the flag byte */ - ACPI_SET8 (Destination) = 0; + ACPI_SET8 (Destination, 0); break; - case ACPI_RSC_1BITFLAG: /* * Mask and shift the flag bit */ - ACPI_SET8 (Destination) |= (UINT8) - ((ACPI_GET8 (Source) & 0x01) << Info->Value); + ACPI_SET_BIT (*ACPI_CAST8 (Destination), (UINT8) + ((ACPI_GET8 (Source) & 0x01) << Info->Value)); break; - case ACPI_RSC_2BITFLAG: /* * Mask and shift the flag bits */ - ACPI_SET8 (Destination) |= (UINT8) - ((ACPI_GET8 (Source) & 0x03) << Info->Value); + ACPI_SET_BIT (*ACPI_CAST8 (Destination), (UINT8) + ((ACPI_GET8 (Source) & 0x03) << Info->Value)); break; + case ACPI_RSC_3BITFLAG: + /* + * Mask and shift the flag bits + */ + ACPI_SET_BIT (*ACPI_CAST8 (Destination), (UINT8) + ((ACPI_GET8 (Source) & 0x07) << Info->Value)); + break; case ACPI_RSC_COUNT: ItemCount = ACPI_GET8 (Source); - ACPI_SET8 (Destination) = (UINT8) ItemCount; + ACPI_SET8 (Destination, ItemCount); AmlLength = (UINT16) (AmlLength + (Info->Value * (ItemCount - 1))); break; - case ACPI_RSC_COUNT16: ItemCount = ACPI_GET16 (Source); @@ -508,13 +633,68 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; + case ACPI_RSC_COUNT_GPIO_PIN: + + ItemCount = ACPI_GET16 (Source); + ACPI_SET16 (Destination, AmlLength); + + AmlLength = (UINT16) (AmlLength + ItemCount * 2); + Target = ACPI_ADD_PTR (void, Aml, Info->Value); + ACPI_SET16 (Target, AmlLength); + AcpiRsSetResourceLength (AmlLength, Aml); + break; + + case ACPI_RSC_COUNT_GPIO_VEN: + + ItemCount = ACPI_GET16 (Source); + ACPI_SET16 (Destination, ItemCount); + + AmlLength = (UINT16) (AmlLength + (Info->Value * ItemCount)); + AcpiRsSetResourceLength (AmlLength, Aml); + break; + + case ACPI_RSC_COUNT_GPIO_RES: + + /* Set resource source string length */ + + ItemCount = ACPI_GET16 (Source); + ACPI_SET16 (Destination, AmlLength); + + /* Compute offset for the Vendor Data */ + + AmlLength = (UINT16) (AmlLength + ItemCount); + Target = ACPI_ADD_PTR (void, Aml, Info->Value); + + /* Set vendor offset only if there is vendor data */ + + if (Resource->Data.Gpio.VendorLength) + { + ACPI_SET16 (Target, AmlLength); + } + + AcpiRsSetResourceLength (AmlLength, Aml); + break; + + case ACPI_RSC_COUNT_SERIAL_VEN: + + ItemCount = ACPI_GET16 (Source); + ACPI_SET16 (Destination, ItemCount + Info->Value); + AmlLength = (UINT16) (AmlLength + ItemCount); + AcpiRsSetResourceLength (AmlLength, Aml); + break; + + case ACPI_RSC_COUNT_SERIAL_RES: + + ItemCount = ACPI_GET16 (Source); + AmlLength = (UINT16) (AmlLength + ItemCount); + AcpiRsSetResourceLength (AmlLength, Aml); + break; case ACPI_RSC_LENGTH: AcpiRsSetResourceLength (Info->Value, Aml); break; - case ACPI_RSC_MOVE8: case ACPI_RSC_MOVE16: case ACPI_RSC_MOVE32: @@ -527,6 +707,39 @@ AcpiRsConvertResourceToAml ( AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); break; + case ACPI_RSC_MOVE_GPIO_PIN: + + Destination = (char *) ACPI_ADD_PTR (void, Aml, + ACPI_GET16 (Destination)); + Source = * (UINT16 **) Source; + AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); + break; + + case ACPI_RSC_MOVE_GPIO_RES: + + /* Used for both ResourceSource string and VendorData */ + + Destination = (char *) ACPI_ADD_PTR (void, Aml, + ACPI_GET16 (Destination)); + Source = * (UINT8 **) Source; + AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); + break; + + case ACPI_RSC_MOVE_SERIAL_VEN: + + Destination = (char *) ACPI_ADD_PTR (void, Aml, + (AmlLength - ItemCount)); + Source = * (UINT8 **) Source; + AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); + break; + + case ACPI_RSC_MOVE_SERIAL_RES: + + Destination = (char *) ACPI_ADD_PTR (void, Aml, + (AmlLength - ItemCount)); + Source = * (UINT8 **) Source; + AcpiRsMoveData (Destination, Source, ItemCount, Info->Opcode); + break; case ACPI_RSC_ADDRESS: @@ -535,7 +748,6 @@ AcpiRsConvertResourceToAml ( AcpiRsSetAddressCommon (Aml, Resource); break; - case ACPI_RSC_SOURCEX: /* * Optional ResourceSource (Index and String) @@ -545,7 +757,6 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; - case ACPI_RSC_SOURCE: /* * Optional ResourceSource (Index and String). This is the more @@ -555,17 +766,15 @@ AcpiRsConvertResourceToAml ( AcpiRsSetResourceLength (AmlLength, Aml); break; - case ACPI_RSC_BITMASK: /* * 8-bit encoded bitmask (DMA macro) */ - ACPI_SET8 (Destination) = (UINT8) + ACPI_SET8 (Destination, AcpiRsEncodeBitmask (Source, - *ACPI_ADD_PTR (UINT8, Resource, Info->Value)); + *ACPI_ADD_PTR (UINT8, Resource, Info->Value))); break; - case ACPI_RSC_BITMASK16: /* * 16-bit encoded bitmask (IRQ macro) @@ -575,7 +784,6 @@ AcpiRsConvertResourceToAml ( ACPI_MOVE_16_TO_16 (Destination, &Temp16); break; - case ACPI_RSC_EXIT_LE: /* * Control - Exit conversion if less than or equal @@ -586,7 +794,6 @@ AcpiRsConvertResourceToAml ( } break; - case ACPI_RSC_EXIT_NE: /* * Control - Exit conversion if not equal @@ -609,7 +816,6 @@ AcpiRsConvertResourceToAml ( } break; - case ACPI_RSC_EXIT_EQ: /* * Control - Exit conversion if equal @@ -621,7 +827,6 @@ AcpiRsConvertResourceToAml ( } break; - default: ACPI_ERROR ((AE_INFO, "Invalid conversion opcode")); @@ -679,5 +884,3 @@ Exit: return_ACPI_STATUS (AE_BAD_DATA); } #endif - - diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsserial.c b/reactos/drivers/bus/acpi/acpica/resources/rsserial.c new file mode 100644 index 00000000000..2eee1a2a1e3 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/resources/rsserial.c @@ -0,0 +1,501 @@ +/******************************************************************************* + * + * Module Name: rsserial - GPIO/SerialBus resource descriptors + * + ******************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __RSIRQ_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acresrc.h" + +#define _COMPONENT ACPI_RESOURCES + ACPI_MODULE_NAME ("rsserial") + + +/******************************************************************************* + * + * AcpiRsConvertGpio + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertGpio[18] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_GPIO, + ACPI_RS_SIZE (ACPI_RESOURCE_GPIO), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertGpio)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_GPIO, + sizeof (AML_RESOURCE_GPIO), + 0}, + + /* + * These fields are contiguous in both the source and destination: + * RevisionId + * ConnectionType + */ + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.RevisionId), + AML_OFFSET (Gpio.RevisionId), + 2}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.ProducerConsumer), + AML_OFFSET (Gpio.Flags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Sharable), + AML_OFFSET (Gpio.IntFlags), + 3}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.WakeCapable), + AML_OFFSET (Gpio.IntFlags), + 4}, + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.IoRestriction), + AML_OFFSET (Gpio.IntFlags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Triggering), + AML_OFFSET (Gpio.IntFlags), + 0}, + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Polarity), + AML_OFFSET (Gpio.IntFlags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.PinConfig), + AML_OFFSET (Gpio.PinConfig), + 1}, + + /* + * These fields are contiguous in both the source and destination: + * DriveStrength + * DebounceTimeout + */ + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Gpio.DriveStrength), + AML_OFFSET (Gpio.DriveStrength), + 2}, + + /* Pin Table */ + + {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTableLength), + AML_OFFSET (Gpio.PinTableOffset), + AML_OFFSET (Gpio.ResSourceOffset)}, + + {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTable), + AML_OFFSET (Gpio.PinTableOffset), + 0}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.Index), + AML_OFFSET (Gpio.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringLength), + AML_OFFSET (Gpio.ResSourceOffset), + AML_OFFSET (Gpio.VendorOffset)}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringPtr), + AML_OFFSET (Gpio.ResSourceOffset), + 0}, + + /* Vendor Data */ + + {ACPI_RSC_COUNT_GPIO_VEN, ACPI_RS_OFFSET (Data.Gpio.VendorLength), + AML_OFFSET (Gpio.VendorLength), + 1}, + + {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.Gpio.VendorData), + AML_OFFSET (Gpio.VendorOffset), + 0}, +}; + + +/******************************************************************************* + * + * AcpiRsConvertI2cSerialBus + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[16] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, + ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertI2cSerialBus)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS, + sizeof (AML_RESOURCE_I2C_SERIALBUS), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId), + AML_OFFSET (CommonSerialBus.RevisionId), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type), + AML_OFFSET (CommonSerialBus.Type), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode), + AML_OFFSET (CommonSerialBus.Flags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer), + AML_OFFSET (CommonSerialBus.Flags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId), + AML_OFFSET (CommonSerialBus.TypeRevisionId), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + 1}, + + /* Vendor data */ + + {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + AML_RESOURCE_I2C_MIN_DATA_LEN}, + + {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData), + 0, + sizeof (AML_RESOURCE_I2C_SERIALBUS)}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index), + AML_OFFSET (CommonSerialBus.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + /* I2C bus type specific */ + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.I2cSerialBus.AccessMode), + AML_OFFSET (I2cSerialBus.TypeSpecificFlags), + 0}, + + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.I2cSerialBus.ConnectionSpeed), + AML_OFFSET (I2cSerialBus.ConnectionSpeed), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.I2cSerialBus.SlaveAddress), + AML_OFFSET (I2cSerialBus.SlaveAddress), + 1}, +}; + + +/******************************************************************************* + * + * AcpiRsConvertSpiSerialBus + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[20] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, + ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertSpiSerialBus)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS, + sizeof (AML_RESOURCE_SPI_SERIALBUS), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId), + AML_OFFSET (CommonSerialBus.RevisionId), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type), + AML_OFFSET (CommonSerialBus.Type), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode), + AML_OFFSET (CommonSerialBus.Flags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer), + AML_OFFSET (CommonSerialBus.Flags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId), + AML_OFFSET (CommonSerialBus.TypeRevisionId), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + 1}, + + /* Vendor data */ + + {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + AML_RESOURCE_SPI_MIN_DATA_LEN}, + + {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData), + 0, + sizeof (AML_RESOURCE_SPI_SERIALBUS)}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index), + AML_OFFSET (CommonSerialBus.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + /* Spi bus type specific */ + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.WireMode), + AML_OFFSET (SpiSerialBus.TypeSpecificFlags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.DevicePolarity), + AML_OFFSET (SpiSerialBus.TypeSpecificFlags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.DataBitLength), + AML_OFFSET (SpiSerialBus.DataBitLength), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPhase), + AML_OFFSET (SpiSerialBus.ClockPhase), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPolarity), + AML_OFFSET (SpiSerialBus.ClockPolarity), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.SpiSerialBus.DeviceSelection), + AML_OFFSET (SpiSerialBus.DeviceSelection), + 1}, + + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.SpiSerialBus.ConnectionSpeed), + AML_OFFSET (SpiSerialBus.ConnectionSpeed), + 1}, +}; + + +/******************************************************************************* + * + * AcpiRsConvertUartSerialBus + * + ******************************************************************************/ + +ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[22] = +{ + {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS, + ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS), + ACPI_RSC_TABLE_SIZE (AcpiRsConvertUartSerialBus)}, + + {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS, + sizeof (AML_RESOURCE_UART_SERIALBUS), + 0}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId), + AML_OFFSET (CommonSerialBus.RevisionId), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.Type), + AML_OFFSET (CommonSerialBus.Type), + 1}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode), + AML_OFFSET (CommonSerialBus.Flags), + 0}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer), + AML_OFFSET (CommonSerialBus.Flags), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId), + AML_OFFSET (CommonSerialBus.TypeRevisionId), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + 1}, + + /* Vendor data */ + + {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + AML_RESOURCE_UART_MIN_DATA_LEN}, + + {ACPI_RSC_MOVE_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData), + 0, + sizeof (AML_RESOURCE_UART_SERIALBUS)}, + + /* Resource Source */ + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index), + AML_OFFSET (CommonSerialBus.ResSourceIndex), + 1}, + + {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + {ACPI_RSC_MOVE_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr), + AML_OFFSET (CommonSerialBus.TypeDataLength), + sizeof (AML_RESOURCE_COMMON_SERIALBUS)}, + + /* Uart bus type specific */ + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.FlowControl), + AML_OFFSET (UartSerialBus.TypeSpecificFlags), + 0}, + + {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.StopBits), + AML_OFFSET (UartSerialBus.TypeSpecificFlags), + 2}, + + {ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.DataBits), + AML_OFFSET (UartSerialBus.TypeSpecificFlags), + 4}, + + {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.Endian), + AML_OFFSET (UartSerialBus.TypeSpecificFlags), + 7}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.Parity), + AML_OFFSET (UartSerialBus.Parity), + 1}, + + {ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.UartSerialBus.LinesEnabled), + AML_OFFSET (UartSerialBus.LinesEnabled), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.RxFifoSize), + AML_OFFSET (UartSerialBus.RxFifoSize), + 1}, + + {ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.UartSerialBus.TxFifoSize), + AML_OFFSET (UartSerialBus.TxFifoSize), + 1}, + + {ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.UartSerialBus.DefaultBaudRate), + AML_OFFSET (UartSerialBus.DefaultBaudRate), + 1}, +}; diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsutils.c b/reactos/drivers/bus/acpi/acpica/resources/rsutils.c index f3c73f8fd46..e9952f0dd3e 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rsutils.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rsutils.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -245,30 +245,39 @@ AcpiRsMoveData ( * since there are no alignment or endian issues */ case ACPI_RSC_MOVE8: + case ACPI_RSC_MOVE_GPIO_RES: + case ACPI_RSC_MOVE_SERIAL_VEN: + case ACPI_RSC_MOVE_SERIAL_RES: + ACPI_MEMCPY (Destination, Source, ItemCount); return; /* * 16-, 32-, and 64-bit cases must use the move macros that perform - * endian conversion and/or accomodate hardware that cannot perform + * endian conversion and/or accommodate hardware that cannot perform * misaligned memory transfers */ case ACPI_RSC_MOVE16: + case ACPI_RSC_MOVE_GPIO_PIN: + ACPI_MOVE_16_TO_16 (&ACPI_CAST_PTR (UINT16, Destination)[i], &ACPI_CAST_PTR (UINT16, Source)[i]); break; case ACPI_RSC_MOVE32: + ACPI_MOVE_32_TO_32 (&ACPI_CAST_PTR (UINT32, Destination)[i], &ACPI_CAST_PTR (UINT32, Source)[i]); break; case ACPI_RSC_MOVE64: + ACPI_MOVE_64_TO_64 (&ACPI_CAST_PTR (UINT64, Destination)[i], &ACPI_CAST_PTR (UINT64, Source)[i]); break; default: + return; } } @@ -723,6 +732,61 @@ AcpiRsGetPrsMethodData ( } +/******************************************************************************* + * + * FUNCTION: AcpiRsGetAeiMethodData + * + * PARAMETERS: Node - Device node + * RetBuffer - Pointer to a buffer structure for the + * results + * + * RETURN: Status + * + * DESCRIPTION: This function is called to get the _AEI value of an object + * contained in an object specified by the handle passed in + * + * If the function fails an appropriate status will be returned + * and the contents of the callers buffer is undefined. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiRsGetAeiMethodData ( + ACPI_NAMESPACE_NODE *Node, + ACPI_BUFFER *RetBuffer) +{ + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (RsGetAeiMethodData); + + + /* Parameters guaranteed valid by caller */ + + /* Execute the method, no parameters */ + + Status = AcpiUtEvaluateObject (Node, METHOD_NAME__AEI, + ACPI_BTYPE_BUFFER, &ObjDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* + * Make the call to create a resource linked list from the + * byte stream buffer that comes back from the _CRS method + * execution. + */ + Status = AcpiRsCreateResourceList (ObjDesc, RetBuffer); + + /* On exit, we must delete the object returned by evaluateObject */ + + AcpiUtRemoveReference (ObjDesc); + return_ACPI_STATUS (Status); +} + + /******************************************************************************* * * FUNCTION: AcpiRsGetMethodData @@ -759,7 +823,8 @@ AcpiRsGetMethodData ( /* Execute the method, no parameters */ - Status = AcpiUtEvaluateObject (Handle, Path, ACPI_BTYPE_BUFFER, &ObjDesc); + Status = AcpiUtEvaluateObject (ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Handle), + Path, ACPI_BTYPE_BUFFER, &ObjDesc); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -822,7 +887,7 @@ AcpiRsSetSrsMethodData ( } Info->PrefixNode = Node; - Info->Pathname = METHOD_NAME__SRS; + Info->RelativePathname = METHOD_NAME__SRS; Info->Parameters = Args; Info->Flags = ACPI_IGNORE_RETURN_VALUE; @@ -834,7 +899,7 @@ AcpiRsSetSrsMethodData ( * Convert the linked list into a byte stream */ Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiRsCreateAmlResources (InBuffer->Pointer, &Buffer); + Status = AcpiRsCreateAmlResources (InBuffer, &Buffer); if (ACPI_FAILURE (Status)) { goto Cleanup; @@ -871,4 +936,3 @@ Cleanup: ACPI_FREE (Info); return_ACPI_STATUS (Status); } - diff --git a/reactos/drivers/bus/acpi/acpica/resources/rsxface.c b/reactos/drivers/bus/acpi/acpica/resources/rsxface.c index 6646ef18ed8..2ae63b37b18 100644 --- a/reactos/drivers/bus/acpi/acpica/resources/rsxface.c +++ b/reactos/drivers/bus/acpi/acpica/resources/rsxface.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -115,6 +115,7 @@ #define __RSXFACE_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" @@ -423,6 +424,52 @@ AcpiSetCurrentResources ( ACPI_EXPORT_SYMBOL (AcpiSetCurrentResources) +/******************************************************************************* + * + * FUNCTION: AcpiGetEventResources + * + * PARAMETERS: DeviceHandle - Handle to the device object for the + * device we are getting resources + * InBuffer - Pointer to a buffer containing the + * resources to be set for the device + * + * RETURN: Status + * + * DESCRIPTION: This function is called to get the event resources for a + * specific device. The caller must first acquire a handle for + * the desired device. The resource data is passed to the routine + * the buffer pointed to by the InBuffer variable. Uses the + * _AEI method. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiGetEventResources ( + ACPI_HANDLE DeviceHandle, + ACPI_BUFFER *RetBuffer) +{ + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node; + + + ACPI_FUNCTION_TRACE (AcpiGetEventResources); + + + /* Validate parameters then dispatch to internal routine */ + + Status = AcpiRsValidateParameters (DeviceHandle, RetBuffer, &Node); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + Status = AcpiRsGetAeiMethodData (Node, RetBuffer); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiGetEventResources) + + /****************************************************************************** * * FUNCTION: AcpiResourceToAddress64 @@ -478,6 +525,7 @@ AcpiResourceToAddress64 ( break; default: + return (AE_BAD_PARAMETER); } @@ -500,7 +548,7 @@ ACPI_EXPORT_SYMBOL (AcpiResourceToAddress64) * * RETURN: Status * - * DESCRIPTION: Walk a resource template for the specified evice to find a + * DESCRIPTION: Walk a resource template for the specified device to find a * vendor-defined resource that matches the supplied UUID and * UUID subtype. Returns a ACPI_RESOURCE of type Vendor. * @@ -612,67 +660,51 @@ AcpiRsMatchVendorResource ( /******************************************************************************* * - * FUNCTION: AcpiWalkResources + * FUNCTION: AcpiWalkResourceBuffer * - * PARAMETERS: DeviceHandle - Handle to the device object for the - * device we are querying - * Name - Method name of the resources we want - * (METHOD_NAME__CRS or METHOD_NAME__PRS) + * PARAMETERS: Buffer - Formatted buffer returned by one of the + * various Get*Resource functions * UserFunction - Called for each resource * Context - Passed to UserFunction * * RETURN: Status * - * DESCRIPTION: Retrieves the current or possible resource list for the - * specified device. The UserFunction is called once for - * each resource in the list. + * DESCRIPTION: Walks the input resource template. The UserFunction is called + * once for each resource in the list. * ******************************************************************************/ ACPI_STATUS -AcpiWalkResources ( - ACPI_HANDLE DeviceHandle, - char *Name, +AcpiWalkResourceBuffer ( + ACPI_BUFFER *Buffer, ACPI_WALK_RESOURCE_CALLBACK UserFunction, void *Context) { - ACPI_STATUS Status; - ACPI_BUFFER Buffer; + ACPI_STATUS Status = AE_OK; ACPI_RESOURCE *Resource; ACPI_RESOURCE *ResourceEnd; - ACPI_FUNCTION_TRACE (AcpiWalkResources); + ACPI_FUNCTION_TRACE (AcpiWalkResourceBuffer); /* Parameter validation */ - if (!DeviceHandle || !UserFunction || !Name || - (!ACPI_COMPARE_NAME (Name, METHOD_NAME__CRS) && - !ACPI_COMPARE_NAME (Name, METHOD_NAME__PRS))) + if (!Buffer || !Buffer->Pointer || !UserFunction) { return_ACPI_STATUS (AE_BAD_PARAMETER); } - /* Get the _CRS or _PRS resource list */ + /* Buffer contains the resource list and length */ - Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiRsGetMethodData (DeviceHandle, Name, &Buffer); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Buffer now contains the resource list */ - - Resource = ACPI_CAST_PTR (ACPI_RESOURCE, Buffer.Pointer); - ResourceEnd = ACPI_ADD_PTR (ACPI_RESOURCE, Buffer.Pointer, Buffer.Length); + Resource = ACPI_CAST_PTR (ACPI_RESOURCE, Buffer->Pointer); + ResourceEnd = ACPI_ADD_PTR (ACPI_RESOURCE, Buffer->Pointer, Buffer->Length); /* Walk the resource list until the EndTag is found (or buffer end) */ while (Resource < ResourceEnd) { - /* Sanity check the resource */ + /* Sanity check the resource type */ if (Resource->Type > ACPI_RESOURCE_TYPE_MAX) { @@ -680,6 +712,13 @@ AcpiWalkResources ( break; } + /* Sanity check the length. It must not be zero, or we loop forever */ + + if (!Resource->Length) + { + return_ACPI_STATUS (AE_AML_BAD_RESOURCE_LENGTH); + } + /* Invoke the user function, abort on any error returned */ Status = UserFunction (Resource, Context); @@ -703,9 +742,71 @@ AcpiWalkResources ( /* Get the next resource descriptor */ - Resource = ACPI_ADD_PTR (ACPI_RESOURCE, Resource, Resource->Length); + Resource = ACPI_NEXT_RESOURCE (Resource); } + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiWalkResourceBuffer) + + +/******************************************************************************* + * + * FUNCTION: AcpiWalkResources + * + * PARAMETERS: DeviceHandle - Handle to the device object for the + * device we are querying + * Name - Method name of the resources we want. + * (METHOD_NAME__CRS, METHOD_NAME__PRS, or + * METHOD_NAME__AEI) + * UserFunction - Called for each resource + * Context - Passed to UserFunction + * + * RETURN: Status + * + * DESCRIPTION: Retrieves the current or possible resource list for the + * specified device. The UserFunction is called once for + * each resource in the list. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiWalkResources ( + ACPI_HANDLE DeviceHandle, + char *Name, + ACPI_WALK_RESOURCE_CALLBACK UserFunction, + void *Context) +{ + ACPI_STATUS Status; + ACPI_BUFFER Buffer; + + + ACPI_FUNCTION_TRACE (AcpiWalkResources); + + + /* Parameter validation */ + + if (!DeviceHandle || !UserFunction || !Name || + (!ACPI_COMPARE_NAME (Name, METHOD_NAME__CRS) && + !ACPI_COMPARE_NAME (Name, METHOD_NAME__PRS) && + !ACPI_COMPARE_NAME (Name, METHOD_NAME__AEI))) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + /* Get the _CRS/_PRS/_AEI resource list */ + + Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; + Status = AcpiRsGetMethodData (DeviceHandle, Name, &Buffer); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Walk the resource list and cleanup */ + + Status = AcpiWalkResourceBuffer (&Buffer, UserFunction, Context); ACPI_FREE (Buffer.Pointer); return_ACPI_STATUS (Status); } diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbconvrt.c b/reactos/drivers/bus/acpi/acpica/tables/tbconvrt.c deleted file mode 100644 index 77ece2ae07a..00000000000 --- a/reactos/drivers/bus/acpi/acpica/tables/tbconvrt.c +++ /dev/null @@ -1,547 +0,0 @@ -/****************************************************************************** - * - * Module Name: tbconvrt - ACPI Table conversion utilities - * $Revision: 1.1 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 R. Byron Moore - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include - -#define _COMPONENT ACPI_TABLES - MODULE_NAME ("tbconvrt") - - -/* - * Build a GAS structure from earlier ACPI table entries (V1.0 and 0.71 extensions) - * - * 1) Address space - * 2) Length in bytes -- convert to length in bits - * 3) Bit offset is zero - * 4) Reserved field is zero - * 5) Expand address to 64 bits - */ -#define ASL_BUILD_GAS_FROM_ENTRY(a,b,c,d) {a.address_space_id = (u8) d;\ - a.register_bit_width = (u8) MUL_8 (b);\ - a.register_bit_offset = 0;\ - a.reserved = 0;\ - ACPI_STORE_ADDRESS (a.address,c);} - - -/* ACPI V1.0 entries -- address space is always I/O */ - -#define ASL_BUILD_GAS_FROM_V1_ENTRY(a,b,c) ASL_BUILD_GAS_FROM_ENTRY(a,b,c,ADDRESS_SPACE_SYSTEM_IO) - - -/******************************************************************************* - * - * FUNCTION: Acpi_tb_convert_to_xsdt - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ******************************************************************************/ - -ACPI_STATUS -acpi_tb_convert_to_xsdt ( - ACPI_TABLE_DESC *table_info, - u32 *number_of_tables) { - u32 table_size; - u32 pointer_size; - u32 i; - XSDT_DESCRIPTOR *new_table; - - -#ifndef _IA64 - - if (acpi_gbl_RSDP->revision < 2) { - pointer_size = sizeof (u32); - } - - else -#endif - { - pointer_size = sizeof (UINT64); - } - - /* - * Determine the number of tables pointed to by the RSDT/XSDT. - * This is defined by the ACPI Specification to be the number of - * pointers contained within the RSDT/XSDT. The size of the pointers - * is architecture-dependent. - */ - - table_size = table_info->pointer->length; - *number_of_tables = (table_size - - sizeof (ACPI_TABLE_HEADER)) / pointer_size; - - /* Compute size of the converted XSDT */ - - table_size = (*number_of_tables * sizeof (UINT64)) + sizeof (ACPI_TABLE_HEADER); - - - /* Allocate an XSDT */ - - new_table = acpi_cm_callocate (table_size); - if (!new_table) { - return (AE_NO_MEMORY); - } - - /* Copy the header and set the length */ - - MEMCPY (new_table, table_info->pointer, sizeof (ACPI_TABLE_HEADER)); - new_table->header.length = table_size; - - /* Copy the table pointers */ - - for (i = 0; i < *number_of_tables; i++) { - if (acpi_gbl_RSDP->revision < 2) { -#ifdef _IA64 - new_table->table_offset_entry[i] = - ((RSDT_DESCRIPTOR_REV071 *) table_info->pointer)->table_offset_entry[i]; -#else - ACPI_STORE_ADDRESS (new_table->table_offset_entry[i], - ((RSDT_DESCRIPTOR_REV1 *) table_info->pointer)->table_offset_entry[i]); -#endif - } - else { - new_table->table_offset_entry[i] = - ((XSDT_DESCRIPTOR *) table_info->pointer)->table_offset_entry[i]; - } - } - - - /* Delete the original table (either mapped or in a buffer) */ - - acpi_tb_delete_single_table (table_info); - - - /* Point the table descriptor to the new table */ - - table_info->pointer = (ACPI_TABLE_HEADER *) new_table; - table_info->base_pointer = (ACPI_TABLE_HEADER *) new_table; - table_info->length = table_size; - table_info->allocation = ACPI_MEM_ALLOCATED; - - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_tb_convert_table_fadt - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * Converts BIOS supplied 1.0 and 0.71 ACPI FADT to an intermediate - * ACPI 2.0 FADT. If the BIOS supplied a 2.0 FADT then it is simply - * copied to the intermediate FADT. The ACPI CA software uses this - * intermediate FADT. Thus a significant amount of special #ifdef - * type codeing is saved. This intermediate FADT will need to be - * freed at some point. - * - ******************************************************************************/ - -ACPI_STATUS -acpi_tb_convert_table_fadt (void) -{ - -#ifdef _IA64 - FADT_DESCRIPTOR_REV071 *FADT71; - u8 pm1_address_space; - u8 pm2_address_space; - u8 pm_timer_address_space; - u8 gpe0address_space; - u8 gpe1_address_space; -#else - FADT_DESCRIPTOR_REV1 *FADT1; -#endif - - FADT_DESCRIPTOR_REV2 *FADT2; - ACPI_TABLE_DESC *table_desc; - - - /* Acpi_gbl_FADT is valid */ - /* Allocate and zero the 2.0 buffer */ - - FADT2 = acpi_cm_callocate (sizeof (FADT_DESCRIPTOR_REV2)); - if (FADT2 == NULL) { - return (AE_NO_MEMORY); - } - - - /* The ACPI FADT revision number is FADT2_REVISION_ID=3 */ - /* So, if the current table revision is less than 3 it is type 1.0 or 0.71 */ - - if (acpi_gbl_FADT->header.revision >= FADT2_REVISION_ID) { - /* We have an ACPI 2.0 FADT but we must copy it to our local buffer */ - - *FADT2 = *((FADT_DESCRIPTOR_REV2*) acpi_gbl_FADT); - - } - - else { - -#ifdef _IA64 - /* - * For the 64-bit case only, a revision ID less than V2.0 means the - * tables are the 0.71 extensions - */ - - /* The BIOS stored FADT should agree with Revision 0.71 */ - - FADT71 = (FADT_DESCRIPTOR_REV071 *) acpi_gbl_FADT; - - /* Copy the table header*/ - - FADT2->header = FADT71->header; - - /* Copy the common fields */ - - FADT2->sci_int = FADT71->sci_int; - FADT2->acpi_enable = FADT71->acpi_enable; - FADT2->acpi_disable = FADT71->acpi_disable; - FADT2->S4_bios_req = FADT71->S4_bios_req; - FADT2->plvl2_lat = FADT71->plvl2_lat; - FADT2->plvl3_lat = FADT71->plvl3_lat; - FADT2->day_alrm = FADT71->day_alrm; - FADT2->mon_alrm = FADT71->mon_alrm; - FADT2->century = FADT71->century; - FADT2->gpe1_base = FADT71->gpe1_base; - - /* - * We still use the block length registers even though - * the GAS structure should obsolete them. This is because - * these registers are byte lengths versus the GAS which - * contains a bit width - */ - FADT2->pm1_evt_len = FADT71->pm1_evt_len; - FADT2->pm1_cnt_len = FADT71->pm1_cnt_len; - FADT2->pm2_cnt_len = FADT71->pm2_cnt_len; - FADT2->pm_tm_len = FADT71->pm_tm_len; - FADT2->gpe0blk_len = FADT71->gpe0blk_len; - FADT2->gpe1_blk_len = FADT71->gpe1_blk_len; - FADT2->gpe1_base = FADT71->gpe1_base; - - /* Copy the existing 0.71 flags to 2.0. The other bits are zero.*/ - - FADT2->wb_invd = FADT71->flush_cash; - FADT2->proc_c1 = FADT71->proc_c1; - FADT2->plvl2_up = FADT71->plvl2_up; - FADT2->pwr_button = FADT71->pwr_button; - FADT2->sleep_button = FADT71->sleep_button; - FADT2->fixed_rTC = FADT71->fixed_rTC; - FADT2->rtcs4 = FADT71->rtcs4; - FADT2->tmr_val_ext = FADT71->tmr_val_ext; - FADT2->dock_cap = FADT71->dock_cap; - - - /* We should not use these next two addresses */ - /* Since our buffer is pre-zeroed nothing to do for */ - /* the next three data items in the structure */ - /* FADT2->Firmware_ctrl = 0; */ - /* FADT2->Dsdt = 0; */ - - /* System Interrupt Model isn't used in ACPI 2.0*/ - /* FADT2->Reserved1 = 0; */ - - /* This field is set by the OEM to convey the preferred */ - /* power management profile to OSPM. It doesn't have any*/ - /* 0.71 equivalence. Since we don't know what kind of */ - /* 64-bit system this is, we will pick unspecified. */ - - FADT2->prefer_PM_profile = PM_UNSPECIFIED; - - - /* Port address of SMI command port */ - /* We shouldn't use this port because IA64 doesn't */ - /* have or use SMI. It has PMI. */ - - FADT2->smi_cmd = (u32)(FADT71->smi_cmd & 0xFFFFFFFF); - - - /* processor performance state control*/ - /* The value OSPM writes to the SMI_CMD register to assume */ - /* processor performance state control responsibility. */ - /* There isn't any equivalence in 0.71 */ - /* Again this should be meaningless for IA64 */ - /* FADT2->Pstate_cnt = 0; */ - - /* The 32-bit Power management and GPE registers are */ - /* not valid in IA-64 and we are not going to use them */ - /* so leaving them pre-zeroed. */ - - /* Support for the _CST object and C States change notification.*/ - /* This data item hasn't any 0.71 equivalence so leaving it zero.*/ - /* FADT2->Cst_cnt = 0; */ - - /* number of flush strides that need to be read */ - /* No 0.71 equivalence. Leave pre-zeroed. */ - /* FADT2->Flush_size = 0; */ - - /* Processor's memory cache line width, in bytes */ - /* No 0.71 equivalence. Leave pre-zeroed. */ - /* FADT2->Flush_stride = 0; */ - - /* Processor's duty cycle index in processor's P_CNT reg*/ - /* No 0.71 equivalence. Leave pre-zeroed. */ - /* FADT2->Duty_offset = 0; */ - - /* Processor's duty cycle value bit width in P_CNT register.*/ - /* No 0.71 equivalence. Leave pre-zeroed. */ - /* FADT2->Duty_width = 0; */ - - - /* Since there isn't any equivalence in 0.71 */ - /* and since Big_sur had to support legacy */ - - FADT2->iapc_boot_arch = BAF_LEGACY_DEVICES; - - /* Copy to ACPI 2.0 64-BIT Extended Addresses */ - - FADT2->Xfirmware_ctrl = FADT71->firmware_ctrl; - FADT2->Xdsdt = FADT71->dsdt; - - - /* Extract the address space IDs */ - - pm1_address_space = (u8)((FADT71->address_space & PM1_BLK_ADDRESS_SPACE) >> 1); - pm2_address_space = (u8)((FADT71->address_space & PM2_CNT_BLK_ADDRESS_SPACE) >> 2); - pm_timer_address_space = (u8)((FADT71->address_space & PM_TMR_BLK_ADDRESS_SPACE) >> 3); - gpe0address_space = (u8)((FADT71->address_space & GPE0_BLK_ADDRESS_SPACE) >> 4); - gpe1_address_space = (u8)((FADT71->address_space & GPE1_BLK_ADDRESS_SPACE) >> 5); - - /* - * Convert the 0.71 (non-GAS style) Block addresses to V2.0 GAS structures, - * in this order: - * - * PM 1_a Events - * PM 1_b Events - * PM 1_a Control - * PM 1_b Control - * PM 2 Control - * PM Timer Control - * GPE Block 0 - * GPE Block 1 - */ - - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm1a_evt_blk, FADT71->pm1_evt_len, FADT71->pm1a_evt_blk, pm1_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm1b_evt_blk, FADT71->pm1_evt_len, FADT71->pm1b_evt_blk, pm1_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm1a_cnt_blk, FADT71->pm1_cnt_len, FADT71->pm1a_cnt_blk, pm1_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm1b_cnt_blk, FADT71->pm1_cnt_len, FADT71->pm1b_cnt_blk, pm1_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm2_cnt_blk, FADT71->pm2_cnt_len, FADT71->pm2_cnt_blk, pm2_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xpm_tmr_blk, FADT71->pm_tm_len, FADT71->pm_tmr_blk, pm_timer_address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xgpe0blk, FADT71->gpe0blk_len, FADT71->gpe0blk, gpe0address_space); - ASL_BUILD_GAS_FROM_ENTRY (FADT2->Xgpe1_blk, FADT71->gpe1_blk_len, FADT71->gpe1_blk, gpe1_address_space); - -#else - - /* ACPI 1.0 FACS */ - - - /* The BIOS stored FADT should agree with Revision 1.0 */ - - FADT1 = (FADT_DESCRIPTOR_REV1*) acpi_gbl_FADT; - - /* - * Copy the table header and the common part of the tables - * The 2.0 table is an extension of the 1.0 table, so the - * entire 1.0 table can be copied first, then expand some - * fields to 64 bits. - */ - - MEMCPY (FADT2, FADT1, sizeof (FADT_DESCRIPTOR_REV1)); - - - /* Convert table pointers to 64-bit fields */ - - ACPI_STORE_ADDRESS (FADT2->Xfirmware_ctrl, FADT1->firmware_ctrl); - ACPI_STORE_ADDRESS (FADT2->Xdsdt, FADT1->dsdt); - - /* System Interrupt Model isn't used in ACPI 2.0*/ - /* FADT2->Reserved1 = 0; */ - - /* This field is set by the OEM to convey the preferred */ - /* power management profile to OSPM. It doesn't have any*/ - /* 1.0 equivalence. Since we don't know what kind of */ - /* 32-bit system this is, we will pick unspecified. */ - - FADT2->prefer_PM_profile = PM_UNSPECIFIED; - - - /* Processor Performance State Control. This is the value */ - /* OSPM writes to the SMI_CMD register to assume processor */ - /* performance state control responsibility. There isn't */ - /* any equivalence in 1.0. So leave it zeroed. */ - - FADT2->pstate_cnt = 0; - - - /* Support for the _CST object and C States change notification.*/ - /* This data item hasn't any 1.0 equivalence so leaving it zero.*/ - - FADT2->cst_cnt = 0; - - - /* Since there isn't any equivalence in 1.0 and since it */ - /* is highly likely that a 1.0 system has legacy support. */ - - FADT2->iapc_boot_arch = BAF_LEGACY_DEVICES; - - - /* - * Convert the V1.0 Block addresses to V2.0 GAS structures - * in this order: - * - * PM 1_a Events - * PM 1_b Events - * PM 1_a Control - * PM 1_b Control - * PM 2 Control - * PM Timer Control - * GPE Block 0 - * GPE Block 1 - */ - - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm1a_evt_blk, FADT1->pm1_evt_len, FADT1->pm1a_evt_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm1b_evt_blk, FADT1->pm1_evt_len, FADT1->pm1b_evt_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm1a_cnt_blk, FADT1->pm1_cnt_len, FADT1->pm1a_cnt_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm1b_cnt_blk, FADT1->pm1_cnt_len, FADT1->pm1b_cnt_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm2_cnt_blk, FADT1->pm2_cnt_len, FADT1->pm2_cnt_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xpm_tmr_blk, FADT1->pm_tm_len, FADT1->pm_tmr_blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xgpe0blk, FADT1->gpe0blk_len, FADT1->gpe0blk); - ASL_BUILD_GAS_FROM_V1_ENTRY (FADT2->Xgpe1_blk, FADT1->gpe1_blk_len, FADT1->gpe1_blk); -#endif - } - - - /* - * Global FADT pointer will point to the common V2.0 FADT - */ - acpi_gbl_FADT = FADT2; - acpi_gbl_FADT->header.length = sizeof (FADT_DESCRIPTOR); - - - /* Free the original table */ - - table_desc = &acpi_gbl_acpi_tables[ACPI_TABLE_FADT]; - acpi_tb_delete_single_table (table_desc); - - - /* Install the new table */ - - table_desc->pointer = (ACPI_TABLE_HEADER *) acpi_gbl_FADT; - table_desc->base_pointer = acpi_gbl_FADT; - table_desc->allocation = ACPI_MEM_ALLOCATED; - table_desc->length = sizeof (FADT_DESCRIPTOR_REV2); - - - /* Dump the entire FADT */ - - - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_tb_convert_table_facs - * - * PARAMETERS: - * - * RETURN: - * - * DESCRIPTION: - * - ******************************************************************************/ - -ACPI_STATUS -acpi_tb_build_common_facs ( - ACPI_TABLE_DESC *table_info) -{ - ACPI_COMMON_FACS *common_facs; - -#ifdef _IA64 - FACS_DESCRIPTOR_REV071 *FACS71; -#else - FACS_DESCRIPTOR_REV1 *FACS1; -#endif - - FACS_DESCRIPTOR_REV2 *FACS2; - - - /* Allocate a common FACS */ - - common_facs = acpi_cm_callocate (sizeof (ACPI_COMMON_FACS)); - if (!common_facs) { - return (AE_NO_MEMORY); - } - - - /* Copy fields to the new FACS */ - - if (acpi_gbl_RSDP->revision < 2) { -#ifdef _IA64 - /* 0.71 FACS */ - - FACS71 = (FACS_DESCRIPTOR_REV071 *) acpi_gbl_FACS; - - common_facs->global_lock = (u32 *) &(FACS71->global_lock); - common_facs->firmware_waking_vector = &FACS71->firmware_waking_vector; - common_facs->vector_width = 64; -#else - /* ACPI 1.0 FACS */ - - FACS1 = (FACS_DESCRIPTOR_REV1 *) acpi_gbl_FACS; - - common_facs->global_lock = &(FACS1->global_lock); - common_facs->firmware_waking_vector = (UINT64 *) &FACS1->firmware_waking_vector; - common_facs->vector_width = 32; - -#endif - } - - else { - /* ACPI 2.0 FACS */ - - FACS2 = (FACS_DESCRIPTOR_REV2 *) acpi_gbl_FACS; - - common_facs->global_lock = &(FACS2->global_lock); - common_facs->firmware_waking_vector = &FACS2->Xfirmware_waking_vector; - common_facs->vector_width = 64; - } - - - /* Set the global FACS pointer to point to the common FACS */ - - - acpi_gbl_FACS = common_facs; - - return (AE_OK); -} - - diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbdata.c b/reactos/drivers/bus/acpi/acpica/tables/tbdata.c new file mode 100644 index 00000000000..818637e87e1 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/tables/tbdata.c @@ -0,0 +1,888 @@ +/****************************************************************************** + * + * Module Name: tbdata - Table manager data structure functions + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __TBDATA_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" +#include "actables.h" + +#define _COMPONENT ACPI_TABLES + ACPI_MODULE_NAME ("tbdata") + + +/******************************************************************************* + * + * FUNCTION: AcpiTbInitTableDescriptor + * + * PARAMETERS: TableDesc - Table descriptor + * Address - Physical address of the table + * Flags - Allocation flags of the table + * Table - Pointer to the table + * + * RETURN: None + * + * DESCRIPTION: Initialize a new table descriptor + * + ******************************************************************************/ + +void +AcpiTbInitTableDescriptor ( + ACPI_TABLE_DESC *TableDesc, + ACPI_PHYSICAL_ADDRESS Address, + UINT8 Flags, + ACPI_TABLE_HEADER *Table) +{ + + /* + * Initialize the table descriptor. Set the pointer to NULL, since the + * table is not fully mapped at this time. + */ + ACPI_MEMSET (TableDesc, 0, sizeof (ACPI_TABLE_DESC)); + TableDesc->Address = Address; + TableDesc->Length = Table->Length; + TableDesc->Flags = Flags; + ACPI_MOVE_32_TO_32 (TableDesc->Signature.Ascii, Table->Signature); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbAcquireTable + * + * PARAMETERS: TableDesc - Table descriptor + * TablePtr - Where table is returned + * TableLength - Where table length is returned + * TableFlags - Where table allocation flags are returned + * + * RETURN: Status + * + * DESCRIPTION: Acquire an ACPI table. It can be used for tables not + * maintained in the AcpiGbl_RootTableList. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbAcquireTable ( + ACPI_TABLE_DESC *TableDesc, + ACPI_TABLE_HEADER **TablePtr, + UINT32 *TableLength, + UINT8 *TableFlags) +{ + ACPI_TABLE_HEADER *Table = NULL; + + + switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) + { + case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: + + Table = AcpiOsMapMemory (TableDesc->Address, TableDesc->Length); + break; + + case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: + case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: + + Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, TableDesc->Address); + break; + + default: + + break; + } + + /* Table is not valid yet */ + + if (!Table) + { + return (AE_NO_MEMORY); + } + + /* Fill the return values */ + + *TablePtr = Table; + *TableLength = TableDesc->Length; + *TableFlags = TableDesc->Flags; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbReleaseTable + * + * PARAMETERS: Table - Pointer for the table + * TableLength - Length for the table + * TableFlags - Allocation flags for the table + * + * RETURN: None + * + * DESCRIPTION: Release a table. The inverse of AcpiTbAcquireTable(). + * + ******************************************************************************/ + +void +AcpiTbReleaseTable ( + ACPI_TABLE_HEADER *Table, + UINT32 TableLength, + UINT8 TableFlags) +{ + + switch (TableFlags & ACPI_TABLE_ORIGIN_MASK) + { + case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: + + AcpiOsUnmapMemory (Table, TableLength); + break; + + case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: + case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: + default: + + break; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbAcquireTempTable + * + * PARAMETERS: TableDesc - Table descriptor to be acquired + * Address - Address of the table + * Flags - Allocation flags of the table + * + * RETURN: Status + * + * DESCRIPTION: This function validates the table header to obtain the length + * of a table and fills the table descriptor to make its state as + * "INSTALLED". Such a table descriptor is only used for verified + * installation. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbAcquireTempTable ( + ACPI_TABLE_DESC *TableDesc, + ACPI_PHYSICAL_ADDRESS Address, + UINT8 Flags) +{ + ACPI_TABLE_HEADER *TableHeader; + + + switch (Flags & ACPI_TABLE_ORIGIN_MASK) + { + case ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL: + + /* Get the length of the full table from the header */ + + TableHeader = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER)); + if (!TableHeader) + { + return (AE_NO_MEMORY); + } + + AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader); + AcpiOsUnmapMemory (TableHeader, sizeof (ACPI_TABLE_HEADER)); + return (AE_OK); + + case ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL: + case ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL: + + TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, Address); + if (!TableHeader) + { + return (AE_NO_MEMORY); + } + + AcpiTbInitTableDescriptor (TableDesc, Address, Flags, TableHeader); + return (AE_OK); + + default: + + break; + } + + /* Table is not valid yet */ + + return (AE_NO_MEMORY); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbReleaseTempTable + * + * PARAMETERS: TableDesc - Table descriptor to be released + * + * RETURN: Status + * + * DESCRIPTION: The inverse of AcpiTbAcquireTempTable(). + * + *****************************************************************************/ + +void +AcpiTbReleaseTempTable ( + ACPI_TABLE_DESC *TableDesc) +{ + + /* + * Note that the .Address is maintained by the callers of + * AcpiTbAcquireTempTable(), thus do not invoke AcpiTbUninstallTable() + * where .Address will be freed. + */ + AcpiTbInvalidateTable (TableDesc); +} + + +/****************************************************************************** + * + * FUNCTION: AcpiTbValidateTable + * + * PARAMETERS: TableDesc - Table descriptor + * + * RETURN: Status + * + * DESCRIPTION: This function is called to validate the table, the returned + * table descriptor is in "VALIDATED" state. + * + *****************************************************************************/ + +ACPI_STATUS +AcpiTbValidateTable ( + ACPI_TABLE_DESC *TableDesc) +{ + ACPI_STATUS Status = AE_OK; + + + ACPI_FUNCTION_TRACE (TbValidateTable); + + + /* Validate the table if necessary */ + + if (!TableDesc->Pointer) + { + Status = AcpiTbAcquireTable (TableDesc, &TableDesc->Pointer, + &TableDesc->Length, &TableDesc->Flags); + if (!TableDesc->Pointer) + { + Status = AE_NO_MEMORY; + } + } + + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbInvalidateTable + * + * PARAMETERS: TableDesc - Table descriptor + * + * RETURN: None + * + * DESCRIPTION: Invalidate one internal ACPI table, this is the inverse of + * AcpiTbValidateTable(). + * + ******************************************************************************/ + +void +AcpiTbInvalidateTable ( + ACPI_TABLE_DESC *TableDesc) +{ + + ACPI_FUNCTION_TRACE (TbInvalidateTable); + + + /* Table must be validated */ + + if (!TableDesc->Pointer) + { + return_VOID; + } + + AcpiTbReleaseTable (TableDesc->Pointer, TableDesc->Length, + TableDesc->Flags); + TableDesc->Pointer = NULL; + + return_VOID; +} + + +/****************************************************************************** + * + * FUNCTION: AcpiTbVerifyTable + * + * PARAMETERS: TableDesc - Table descriptor + * Signature - Table signature to verify + * + * RETURN: Status + * + * DESCRIPTION: This function is called to validate and verify the table, the + * returned table descriptor is in "VALIDATED" state. + * + *****************************************************************************/ + +ACPI_STATUS +AcpiTbVerifyTable ( + ACPI_TABLE_DESC *TableDesc, + char *Signature) +{ + ACPI_STATUS Status = AE_OK; + + + ACPI_FUNCTION_TRACE (TbVerifyTable); + + + /* Validate the table */ + + Status = AcpiTbValidateTable (TableDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* If a particular signature is expected (DSDT/FACS), it must match */ + + if (Signature && + !ACPI_COMPARE_NAME (&TableDesc->Signature, Signature)) + { + ACPI_BIOS_ERROR ((AE_INFO, + "Invalid signature 0x%X for ACPI table, expected [%s]", + TableDesc->Signature.Integer, Signature)); + Status = AE_BAD_SIGNATURE; + goto InvalidateAndExit; + } + + /* Verify the checksum */ + + Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, AE_NO_MEMORY, + "%4.4s " ACPI_PRINTF_UINT + " Attempted table install failed", + AcpiUtValidAcpiName (TableDesc->Signature.Ascii) ? + TableDesc->Signature.Ascii : "????", + ACPI_FORMAT_TO_UINT (TableDesc->Address))); + goto InvalidateAndExit; + } + + return_ACPI_STATUS (AE_OK); + +InvalidateAndExit: + AcpiTbInvalidateTable (TableDesc); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbResizeRootTableList + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Expand the size of global table array + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbResizeRootTableList ( + void) +{ + ACPI_TABLE_DESC *Tables; + UINT32 TableCount; + + + ACPI_FUNCTION_TRACE (TbResizeRootTableList); + + + /* AllowResize flag is a parameter to AcpiInitializeTables */ + + if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE)) + { + ACPI_ERROR ((AE_INFO, "Resize of Root Table Array is not allowed")); + return_ACPI_STATUS (AE_SUPPORT); + } + + /* Increase the Table Array size */ + + if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) + { + TableCount = AcpiGbl_RootTableList.MaxTableCount; + } + else + { + TableCount = AcpiGbl_RootTableList.CurrentTableCount; + } + + Tables = ACPI_ALLOCATE_ZEROED ( + ((ACPI_SIZE) TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT) * + sizeof (ACPI_TABLE_DESC)); + if (!Tables) + { + ACPI_ERROR ((AE_INFO, "Could not allocate new root table array")); + return_ACPI_STATUS (AE_NO_MEMORY); + } + + /* Copy and free the previous table array */ + + if (AcpiGbl_RootTableList.Tables) + { + ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables, + (ACPI_SIZE) TableCount * sizeof (ACPI_TABLE_DESC)); + + if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) + { + ACPI_FREE (AcpiGbl_RootTableList.Tables); + } + } + + AcpiGbl_RootTableList.Tables = Tables; + AcpiGbl_RootTableList.MaxTableCount = + TableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT; + AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ORIGIN_ALLOCATED; + + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbGetNextRootIndex + * + * PARAMETERS: TableIndex - Where table index is returned + * + * RETURN: Status and table index. + * + * DESCRIPTION: Allocate a new ACPI table entry to the global table list + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbGetNextRootIndex ( + UINT32 *TableIndex) +{ + ACPI_STATUS Status; + + + /* Ensure that there is room for the table in the Root Table List */ + + if (AcpiGbl_RootTableList.CurrentTableCount >= + AcpiGbl_RootTableList.MaxTableCount) + { + Status = AcpiTbResizeRootTableList(); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + + *TableIndex = AcpiGbl_RootTableList.CurrentTableCount; + AcpiGbl_RootTableList.CurrentTableCount++; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbTerminate + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Delete all internal ACPI tables + * + ******************************************************************************/ + +void +AcpiTbTerminate ( + void) +{ + UINT32 i; + + + ACPI_FUNCTION_TRACE (TbTerminate); + + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + + /* Delete the individual tables */ + + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) + { + AcpiTbUninstallTable (&AcpiGbl_RootTableList.Tables[i]); + } + + /* + * Delete the root table array if allocated locally. Array cannot be + * mapped, so we don't need to check for that flag. + */ + if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) + { + ACPI_FREE (AcpiGbl_RootTableList.Tables); + } + + AcpiGbl_RootTableList.Tables = NULL; + AcpiGbl_RootTableList.Flags = 0; + AcpiGbl_RootTableList.CurrentTableCount = 0; + + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n")); + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + return_VOID; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbDeleteNamespaceByOwner + * + * PARAMETERS: TableIndex - Table index + * + * RETURN: Status + * + * DESCRIPTION: Delete all namespace objects created when this table was loaded. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbDeleteNamespaceByOwner ( + UINT32 TableIndex) +{ + ACPI_OWNER_ID OwnerId; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (TbDeleteNamespaceByOwner); + + + Status = AcpiUtAcquireMutex (ACPI_MTX_TABLES); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount) + { + /* The table index does not exist */ + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + return_ACPI_STATUS (AE_NOT_EXIST); + } + + /* Get the owner ID for this table, used to delete namespace nodes */ + + OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId; + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + + /* + * Need to acquire the namespace writer lock to prevent interference + * with any concurrent namespace walks. The interpreter must be + * released during the deletion since the acquisition of the deletion + * lock may block, and also since the execution of a namespace walk + * must be allowed to use the interpreter. + */ + (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER); + Status = AcpiUtAcquireWriteLock (&AcpiGbl_NamespaceRwLock); + + AcpiNsDeleteNamespaceByOwner (OwnerId); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock); + + Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbAllocateOwnerId + * + * PARAMETERS: TableIndex - Table index + * + * RETURN: Status + * + * DESCRIPTION: Allocates OwnerId in TableDesc + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbAllocateOwnerId ( + UINT32 TableIndex) +{ + ACPI_STATUS Status = AE_BAD_PARAMETER; + + + ACPI_FUNCTION_TRACE (TbAllocateOwnerId); + + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) + { + Status = AcpiUtAllocateOwnerId ( + &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId)); + } + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbReleaseOwnerId + * + * PARAMETERS: TableIndex - Table index + * + * RETURN: Status + * + * DESCRIPTION: Releases OwnerId in TableDesc + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbReleaseOwnerId ( + UINT32 TableIndex) +{ + ACPI_STATUS Status = AE_BAD_PARAMETER; + + + ACPI_FUNCTION_TRACE (TbReleaseOwnerId); + + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) + { + AcpiUtReleaseOwnerId ( + &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId)); + Status = AE_OK; + } + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbGetOwnerId + * + * PARAMETERS: TableIndex - Table index + * OwnerId - Where the table OwnerId is returned + * + * RETURN: Status + * + * DESCRIPTION: returns OwnerId for the ACPI table + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbGetOwnerId ( + UINT32 TableIndex, + ACPI_OWNER_ID *OwnerId) +{ + ACPI_STATUS Status = AE_BAD_PARAMETER; + + + ACPI_FUNCTION_TRACE (TbGetOwnerId); + + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) + { + *OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId; + Status = AE_OK; + } + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbIsTableLoaded + * + * PARAMETERS: TableIndex - Index into the root table + * + * RETURN: Table Loaded Flag + * + ******************************************************************************/ + +BOOLEAN +AcpiTbIsTableLoaded ( + UINT32 TableIndex) +{ + BOOLEAN IsLoaded = FALSE; + + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) + { + IsLoaded = (BOOLEAN) + (AcpiGbl_RootTableList.Tables[TableIndex].Flags & + ACPI_TABLE_IS_LOADED); + } + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + return (IsLoaded); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbSetTableLoadedFlag + * + * PARAMETERS: TableIndex - Table index + * IsLoaded - TRUE if table is loaded, FALSE otherwise + * + * RETURN: None + * + * DESCRIPTION: Sets the table loaded flag to either TRUE or FALSE. + * + ******************************************************************************/ + +void +AcpiTbSetTableLoadedFlag ( + UINT32 TableIndex, + BOOLEAN IsLoaded) +{ + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) + { + if (IsLoaded) + { + AcpiGbl_RootTableList.Tables[TableIndex].Flags |= + ACPI_TABLE_IS_LOADED; + } + else + { + AcpiGbl_RootTableList.Tables[TableIndex].Flags &= + ~ACPI_TABLE_IS_LOADED; + } + } + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); +} diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbfadt.c b/reactos/drivers/bus/acpi/acpica/tables/tbfadt.c index fae64285823..980927444ba 100644 --- a/reactos/drivers/bus/acpi/acpica/tables/tbfadt.c +++ b/reactos/drivers/bus/acpi/acpica/tables/tbfadt.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -124,39 +124,43 @@ /* Local prototypes */ -static ACPI_INLINE void +static void AcpiTbInitGenericAddress ( ACPI_GENERIC_ADDRESS *GenericAddress, UINT8 SpaceId, UINT8 ByteWidth, - UINT64 Address); + UINT64 Address, + char *RegisterName); static void AcpiTbConvertFadt ( void); -static void -AcpiTbValidateFadt ( - void); - static void AcpiTbSetupFadtRegisters ( void); +static UINT64 +AcpiTbSelectAddress ( + char *RegisterName, + UINT32 Address32, + UINT64 Address64); + /* Table for conversion of FADT to common internal format and FADT validation */ typedef struct acpi_fadt_info { char *Name; - UINT8 Address64; - UINT8 Address32; - UINT8 Length; + UINT16 Address64; + UINT16 Address32; + UINT16 Length; UINT8 DefaultLength; UINT8 Type; } ACPI_FADT_INFO; +#define ACPI_FADT_OPTIONAL 0 #define ACPI_FADT_REQUIRED 1 #define ACPI_FADT_SEPARATE_LENGTH 2 @@ -174,7 +178,7 @@ static ACPI_FADT_INFO FadtInfoTable[] = ACPI_FADT_OFFSET (Pm1bEventBlock), ACPI_FADT_OFFSET (Pm1EventLength), ACPI_PM1_REGISTER_WIDTH * 2, /* Enable + Status register */ - 0}, + ACPI_FADT_OPTIONAL}, {"Pm1aControlBlock", ACPI_FADT_OFFSET (XPm1aControlBlock), @@ -188,7 +192,7 @@ static ACPI_FADT_INFO FadtInfoTable[] = ACPI_FADT_OFFSET (Pm1bControlBlock), ACPI_FADT_OFFSET (Pm1ControlLength), ACPI_PM1_REGISTER_WIDTH, - 0}, + ACPI_FADT_OPTIONAL}, {"Pm2ControlBlock", ACPI_FADT_OFFSET (XPm2ControlBlock), @@ -202,7 +206,7 @@ static ACPI_FADT_INFO FadtInfoTable[] = ACPI_FADT_OFFSET (PmTimerBlock), ACPI_FADT_OFFSET (PmTimerLength), ACPI_PM_TIMER_WIDTH, - ACPI_FADT_REQUIRED}, + ACPI_FADT_SEPARATE_LENGTH}, /* ACPI 5.0A: Timer is optional */ {"Gpe0Block", ACPI_FADT_OFFSET (XGpe0Block), @@ -228,7 +232,7 @@ static ACPI_FADT_INFO FadtInfoTable[] = typedef struct acpi_fadt_pm_info { ACPI_GENERIC_ADDRESS *Target; - UINT8 Source; + UINT16 Source; UINT8 RegisterNum; } ACPI_FADT_PM_INFO; @@ -262,8 +266,9 @@ static ACPI_FADT_PM_INFO FadtPmInfoTable[] = * * PARAMETERS: GenericAddress - GAS struct to be initialized * SpaceId - ACPI Space ID for this register - * ByteWidth - Width of this register, in bytes + * ByteWidth - Width of this register * Address - Address of the register + * RegisterName - ASCII name of the ACPI register * * RETURN: None * @@ -273,13 +278,30 @@ static ACPI_FADT_PM_INFO FadtPmInfoTable[] = * ******************************************************************************/ -static ACPI_INLINE void +static void AcpiTbInitGenericAddress ( ACPI_GENERIC_ADDRESS *GenericAddress, UINT8 SpaceId, UINT8 ByteWidth, - UINT64 Address) + UINT64 Address, + char *RegisterName) { + UINT8 BitWidth; + + + /* Bit width field in the GAS is only one byte long, 255 max */ + + BitWidth = (UINT8) (ByteWidth * 8); + + if (ByteWidth > 31) /* (31*8)=248 */ + { + ACPI_ERROR ((AE_INFO, + "%s - 32-bit FADT register is too long (%u bytes, %u bits) " + "to convert to GAS struct - 255 bits max, truncating", + RegisterName, ByteWidth, (ByteWidth * 8))); + + BitWidth = 255; + } /* * The 64-bit Address field is non-aligned in the byte packed @@ -290,12 +312,78 @@ AcpiTbInitGenericAddress ( /* All other fields are byte-wide */ GenericAddress->SpaceId = SpaceId; - GenericAddress->BitWidth = (UINT8) ACPI_MUL_8 (ByteWidth); + GenericAddress->BitWidth = BitWidth; GenericAddress->BitOffset = 0; GenericAddress->AccessWidth = 0; /* Access width ANY */ } +/******************************************************************************* + * + * FUNCTION: AcpiTbSelectAddress + * + * PARAMETERS: RegisterName - ASCII name of the ACPI register + * Address32 - 32-bit address of the register + * Address64 - 64-bit address of the register + * + * RETURN: The resolved 64-bit address + * + * DESCRIPTION: Select between 32-bit and 64-bit versions of addresses within + * the FADT. Used for the FACS and DSDT addresses. + * + * NOTES: + * + * Check for FACS and DSDT address mismatches. An address mismatch between + * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and + * DSDT/X_DSDT) could be a corrupted address field or it might indicate + * the presence of two FACS or two DSDT tables. + * + * November 2013: + * By default, as per the ACPICA specification, a valid 64-bit address is + * used regardless of the value of the 32-bit address. However, this + * behavior can be overridden via the AcpiGbl_Use32BitFadtAddresses flag. + * + ******************************************************************************/ + +static UINT64 +AcpiTbSelectAddress ( + char *RegisterName, + UINT32 Address32, + UINT64 Address64) +{ + + if (!Address64) + { + /* 64-bit address is zero, use 32-bit address */ + + return ((UINT64) Address32); + } + + if (Address32 && + (Address64 != (UINT64) Address32)) + { + /* Address mismatch between 32-bit and 64-bit versions */ + + ACPI_BIOS_WARNING ((AE_INFO, + "32/64X %s address mismatch in FADT: " + "0x%8.8X/0x%8.8X%8.8X, using %u-bit address", + RegisterName, Address32, ACPI_FORMAT_UINT64 (Address64), + AcpiGbl_Use32BitFadtAddresses ? 32 : 64)); + + /* 32-bit address override */ + + if (AcpiGbl_Use32BitFadtAddresses) + { + return ((UINT64) Address32); + } + } + + /* Default is to use the 64-bit address */ + + return (Address64); +} + + /******************************************************************************* * * FUNCTION: AcpiTbParseFadt @@ -349,11 +437,16 @@ AcpiTbParseFadt ( /* Obtain the DSDT and FACS tables via their addresses within the FADT */ - AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt, + AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XDsdt, ACPI_SIG_DSDT, ACPI_TABLE_INDEX_DSDT); - AcpiTbInstallTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, - ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); + /* If Hardware Reduced flag is set, there is no FACS */ + + if (!AcpiGbl_ReducedHardware) + { + AcpiTbInstallFixedTable ((ACPI_PHYSICAL_ADDRESS) AcpiGbl_FADT.XFacs, + ACPI_SIG_FACS, ACPI_TABLE_INDEX_FACS); + } } @@ -381,13 +474,13 @@ AcpiTbCreateLocalFadt ( /* * Check if the FADT is larger than the largest table that we expect - * (the ACPI 2.0/3.0 version). If so, truncate the table, and issue + * (the ACPI 5.0 version). If so, truncate the table, and issue * a warning. */ if (Length > sizeof (ACPI_TABLE_FADT)) { - ACPI_WARNING ((AE_INFO, - "FADT (revision %u) is longer than ACPI 2.0 version, " + ACPI_BIOS_WARNING ((AE_INFO, + "FADT (revision %u) is longer than ACPI 5.0 version, " "truncating length %u to %u", Table->Revision, Length, (UINT32) sizeof (ACPI_TABLE_FADT))); } @@ -401,14 +494,18 @@ AcpiTbCreateLocalFadt ( ACPI_MEMCPY (&AcpiGbl_FADT, Table, ACPI_MIN (Length, sizeof (ACPI_TABLE_FADT))); + /* Take a copy of the Hardware Reduced flag */ + + AcpiGbl_ReducedHardware = FALSE; + if (AcpiGbl_FADT.Flags & ACPI_FADT_HW_REDUCED) + { + AcpiGbl_ReducedHardware = TRUE; + } + /* Convert the local copy of the FADT to the common internal format */ AcpiTbConvertFadt (); - /* Validate FADT values now, before we make any changes */ - - AcpiTbValidateFadt (); - /* Initialize the global ACPI register structures */ AcpiTbSetupFadtRegisters (); @@ -419,33 +516,43 @@ AcpiTbCreateLocalFadt ( * * FUNCTION: AcpiTbConvertFadt * - * PARAMETERS: None, uses AcpiGbl_FADT + * PARAMETERS: None - AcpiGbl_FADT is used. * * RETURN: None * * DESCRIPTION: Converts all versions of the FADT to a common internal format. - * Expand 32-bit addresses to 64-bit as necessary. + * Expand 32-bit addresses to 64-bit as necessary. Also validate + * important fields within the FADT. * - * NOTE: AcpiGbl_FADT must be of size (ACPI_TABLE_FADT), - * and must contain a copy of the actual FADT. + * NOTE: AcpiGbl_FADT must be of size (ACPI_TABLE_FADT), and must + * contain a copy of the actual BIOS-provided FADT. * * Notes on 64-bit register addresses: * * After this FADT conversion, later ACPICA code will only use the 64-bit "X" * fields of the FADT for all ACPI register addresses. * - * The 64-bit "X" fields are optional extensions to the original 32-bit FADT + * The 64-bit X fields are optional extensions to the original 32-bit FADT * V1.0 fields. Even if they are present in the FADT, they are optional and * are unused if the BIOS sets them to zero. Therefore, we must copy/expand - * 32-bit V1.0 fields if the corresponding X field is zero. + * 32-bit V1.0 fields to the 64-bit X fields if the the 64-bit X field is + * originally zero. * - * For ACPI 1.0 FADTs, all 32-bit address fields are expanded to the - * corresponding "X" fields in the internal FADT. + * For ACPI 1.0 FADTs (that contain no 64-bit addresses), all 32-bit address + * fields are expanded to the corresponding 64-bit X fields in the internal + * common FADT. * * For ACPI 2.0+ FADTs, all valid (non-zero) 32-bit address fields are expanded - * to the corresponding 64-bit X fields. For compatibility with other ACPI - * implementations, we ignore the 64-bit field if the 32-bit field is valid, - * regardless of whether the host OS is 32-bit or 64-bit. + * to the corresponding 64-bit X fields, if the 64-bit field is originally + * zero. Adhering to the ACPI specification, we completely ignore the 32-bit + * field if the 64-bit field is valid, regardless of whether the host OS is + * 32-bit or 64-bit. + * + * Possible additional checks: + * (AcpiGbl_FADT.Pm1EventLength >= 4) + * (AcpiGbl_FADT.Pm1ControlLength >= 2) + * (AcpiGbl_FADT.PmTimerLength >= 4) + * Gpe block lengths must be multiple of 2 * ******************************************************************************/ @@ -453,28 +560,13 @@ static void AcpiTbConvertFadt ( void) { + char *Name; ACPI_GENERIC_ADDRESS *Address64; UINT32 Address32; + UINT8 Length; UINT32 i; - /* Update the local FADT table header length */ - - AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT); - - /* - * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary. - * Later code will always use the X 64-bit field. - */ - if (!AcpiGbl_FADT.XFacs) - { - AcpiGbl_FADT.XFacs = (UINT64) AcpiGbl_FADT.Facs; - } - if (!AcpiGbl_FADT.XDsdt) - { - AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt; - } - /* * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which * should be zero are indeed zero. This will workaround BIOSs that @@ -495,111 +587,27 @@ AcpiTbConvertFadt ( } /* - * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X" - * generic address structures as necessary. Later code will always use - * the 64-bit address structures. - * - * March 2009: - * We now always use the 32-bit address if it is valid (non-null). This - * is not in accordance with the ACPI specification which states that - * the 64-bit address supersedes the 32-bit version, but we do this for - * compatibility with other ACPI implementations. Most notably, in the - * case where both the 32 and 64 versions are non-null, we use the 32-bit - * version. This is the only address that is guaranteed to have been - * tested by the BIOS manufacturer. + * Now we can update the local FADT length to the length of the + * current FADT version as defined by the ACPI specification. + * Thus, we will have a common FADT internally. */ - for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) - { - Address32 = *ACPI_ADD_PTR (UINT32, - &AcpiGbl_FADT, FadtInfoTable[i].Address32); - - Address64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS, - &AcpiGbl_FADT, FadtInfoTable[i].Address64); - - /* - * If both 32- and 64-bit addresses are valid (non-zero), - * they must match. - */ - if (Address64->Address && Address32 && - (Address64->Address != (UINT64) Address32)) - { - ACPI_ERROR ((AE_INFO, - "32/64X address mismatch in %s: 0x%8.8X/0x%8.8X%8.8X, using 32", - FadtInfoTable[i].Name, Address32, - ACPI_FORMAT_UINT64 (Address64->Address))); - } - - /* Always use 32-bit address if it is valid (non-null) */ - - if (Address32) - { - /* - * Copy the 32-bit address to the 64-bit GAS structure. The - * Space ID is always I/O for 32-bit legacy address fields - */ - AcpiTbInitGenericAddress (Address64, ACPI_ADR_SPACE_SYSTEM_IO, - *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, FadtInfoTable[i].Length), - (UINT64) Address32); - } - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbValidateFadt - * - * PARAMETERS: Table - Pointer to the FADT to be validated - * - * RETURN: None - * - * DESCRIPTION: Validate various important fields within the FADT. If a problem - * is found, issue a message, but no status is returned. - * Used by both the table manager and the disassembler. - * - * Possible additional checks: - * (AcpiGbl_FADT.Pm1EventLength >= 4) - * (AcpiGbl_FADT.Pm1ControlLength >= 2) - * (AcpiGbl_FADT.PmTimerLength >= 4) - * Gpe block lengths must be multiple of 2 - * - ******************************************************************************/ - -static void -AcpiTbValidateFadt ( - void) -{ - char *Name; - ACPI_GENERIC_ADDRESS *Address64; - UINT8 Length; - UINT32 i; - + AcpiGbl_FADT.Header.Length = sizeof (ACPI_TABLE_FADT); /* - * Check for FACS and DSDT address mismatches. An address mismatch between - * the 32-bit and 64-bit address fields (FIRMWARE_CTRL/X_FIRMWARE_CTRL and - * DSDT/X_DSDT) would indicate the presence of two FACS or two DSDT tables. + * Expand the 32-bit FACS and DSDT addresses to 64-bit as necessary. + * Later ACPICA code will always use the X 64-bit field. */ - if (AcpiGbl_FADT.Facs && - (AcpiGbl_FADT.XFacs != (UINT64) AcpiGbl_FADT.Facs)) + AcpiGbl_FADT.XFacs = AcpiTbSelectAddress ("FACS", + AcpiGbl_FADT.Facs, AcpiGbl_FADT.XFacs); + + AcpiGbl_FADT.XDsdt = AcpiTbSelectAddress ("DSDT", + AcpiGbl_FADT.Dsdt, AcpiGbl_FADT.XDsdt); + + /* If Hardware Reduced flag is set, we are all done */ + + if (AcpiGbl_ReducedHardware) { - ACPI_WARNING ((AE_INFO, - "32/64X FACS address mismatch in FADT - " - "0x%8.8X/0x%8.8X%8.8X, using 32", - AcpiGbl_FADT.Facs, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XFacs))); - - AcpiGbl_FADT.XFacs = (UINT64) AcpiGbl_FADT.Facs; - } - - if (AcpiGbl_FADT.Dsdt && - (AcpiGbl_FADT.XDsdt != (UINT64) AcpiGbl_FADT.Dsdt)) - { - ACPI_WARNING ((AE_INFO, - "32/64X DSDT address mismatch in FADT - " - "0x%8.8X/0x%8.8X%8.8X, using 32", - AcpiGbl_FADT.Dsdt, ACPI_FORMAT_UINT64 (AcpiGbl_FADT.XDsdt))); - - AcpiGbl_FADT.XDsdt = (UINT64) AcpiGbl_FADT.Dsdt; + return; } /* Examine all of the 64-bit extended address fields (X fields) */ @@ -607,38 +615,108 @@ AcpiTbValidateFadt ( for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { /* - * Generate pointer to the 64-bit address, get the register - * length (width) and the register name + * Get the 32-bit and 64-bit addresses, as well as the register + * length and register name. */ + Address32 = *ACPI_ADD_PTR (UINT32, + &AcpiGbl_FADT, FadtInfoTable[i].Address32); + Address64 = ACPI_ADD_PTR (ACPI_GENERIC_ADDRESS, - &AcpiGbl_FADT, FadtInfoTable[i].Address64); + &AcpiGbl_FADT, FadtInfoTable[i].Address64); + Length = *ACPI_ADD_PTR (UINT8, - &AcpiGbl_FADT, FadtInfoTable[i].Length); + &AcpiGbl_FADT, FadtInfoTable[i].Length); + Name = FadtInfoTable[i].Name; + /* + * Expand the ACPI 1.0 32-bit addresses to the ACPI 2.0 64-bit "X" + * generic address structures as necessary. Later code will always use + * the 64-bit address structures. + * + * November 2013: + * Now always use the 64-bit address if it is valid (non-zero), in + * accordance with the ACPI specification which states that a 64-bit + * address supersedes the 32-bit version. This behavior can be + * overridden by the AcpiGbl_Use32BitFadtAddresses flag. + * + * During 64-bit address construction and verification, + * these cases are handled: + * + * Address32 zero, Address64 [don't care] - Use Address64 + * + * Address32 non-zero, Address64 zero - Copy/use Address32 + * Address32 non-zero == Address64 non-zero - Use Address64 + * Address32 non-zero != Address64 non-zero - Warning, use Address64 + * + * Override: if AcpiGbl_Use32BitFadtAddresses is TRUE, and: + * Address32 non-zero != Address64 non-zero - Warning, copy/use Address32 + * + * Note: SpaceId is always I/O for 32-bit legacy address fields + */ + if (Address32) + { + if (!Address64->Address) + { + /* 64-bit address is zero, use 32-bit address */ + + AcpiTbInitGenericAddress (Address64, + ACPI_ADR_SPACE_SYSTEM_IO, + *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, + FadtInfoTable[i].Length), + (UINT64) Address32, Name); + } + else if (Address64->Address != (UINT64) Address32) + { + /* Address mismatch */ + + ACPI_BIOS_WARNING ((AE_INFO, + "32/64X address mismatch in FADT/%s: " + "0x%8.8X/0x%8.8X%8.8X, using %u-bit address", + Name, Address32, + ACPI_FORMAT_UINT64 (Address64->Address), + AcpiGbl_Use32BitFadtAddresses ? 32 : 64)); + + if (AcpiGbl_Use32BitFadtAddresses) + { + /* 32-bit address override */ + + AcpiTbInitGenericAddress (Address64, + ACPI_ADR_SPACE_SYSTEM_IO, + *ACPI_ADD_PTR (UINT8, &AcpiGbl_FADT, + FadtInfoTable[i].Length), + (UINT64) Address32, Name); + } + } + } + /* * For each extended field, check for length mismatch between the * legacy length field and the corresponding 64-bit X length field. + * Note: If the legacy length field is > 0xFF bits, ignore this + * check. (GPE registers can be larger than the 64-bit GAS structure + * can accomodate, 0xFF bits). */ if (Address64->Address && + (ACPI_MUL_8 (Length) <= ACPI_UINT8_MAX) && (Address64->BitWidth != ACPI_MUL_8 (Length))) { - ACPI_WARNING ((AE_INFO, - "32/64X length mismatch in %s: %u/%u", + ACPI_BIOS_WARNING ((AE_INFO, + "32/64X length mismatch in FADT/%s: %u/%u", Name, ACPI_MUL_8 (Length), Address64->BitWidth)); } if (FadtInfoTable[i].Type & ACPI_FADT_REQUIRED) { /* - * Field is required (PM1aEvent, PM1aControl, PmTimer). + * Field is required (PM1aEvent, PM1aControl). * Both the address and length must be non-zero. */ if (!Address64->Address || !Length) { - ACPI_ERROR ((AE_INFO, - "Required field %s has zero address and/or length:" - " 0x%8.8X%8.8X/0x%X", + ACPI_BIOS_ERROR ((AE_INFO, + "Required FADT field %s has zero address and/or length: " + "0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } } @@ -652,8 +730,8 @@ AcpiTbValidateFadt ( if ((Address64->Address && !Length) || (!Address64->Address && Length)) { - ACPI_WARNING ((AE_INFO, - "Optional field %s has zero address or length: " + ACPI_BIOS_WARNING ((AE_INFO, + "Optional FADT field %s has zero address or length: " "0x%8.8X%8.8X/0x%X", Name, ACPI_FORMAT_UINT64 (Address64->Address), Length)); } @@ -704,8 +782,8 @@ AcpiTbSetupFadtRegisters ( (FadtInfoTable[i].DefaultLength > 0) && (FadtInfoTable[i].DefaultLength != Target64->BitWidth)) { - ACPI_WARNING ((AE_INFO, - "Invalid length for %s: %u, using default %u", + ACPI_BIOS_WARNING ((AE_INFO, + "Invalid length for FADT/%s: %u, using default %u", FadtInfoTable[i].Name, Target64->BitWidth, FadtInfoTable[i].DefaultLength)); @@ -748,8 +826,8 @@ AcpiTbSetupFadtRegisters ( AcpiTbInitGenericAddress (FadtPmInfoTable[i].Target, Source64->SpaceId, Pm1RegisterByteWidth, Source64->Address + - (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth)); + (FadtPmInfoTable[i].RegisterNum * Pm1RegisterByteWidth), + "PmRegisters"); } } } - diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbfind.c b/reactos/drivers/bus/acpi/acpica/tables/tbfind.c index 48ef81756c5..42ce1818939 100644 --- a/reactos/drivers/bus/acpi/acpica/tables/tbfind.c +++ b/reactos/drivers/bus/acpi/acpica/tables/tbfind.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -158,7 +158,7 @@ AcpiTbFindTable ( /* Normalize the input strings */ ACPI_MEMSET (&Header, 0, sizeof (ACPI_TABLE_HEADER)); - ACPI_STRNCPY (Header.Signature, Signature, ACPI_NAME_SIZE); + ACPI_MOVE_NAME (Header.Signature, Signature); ACPI_STRNCPY (Header.OemId, OemId, ACPI_OEM_ID_SIZE); ACPI_STRNCPY (Header.OemTableId, OemTableId, ACPI_OEM_TABLE_ID_SIZE); @@ -180,7 +180,7 @@ AcpiTbFindTable ( { /* Table is not currently mapped, map it */ - Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]); + Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbget.c b/reactos/drivers/bus/acpi/acpica/tables/tbget.c deleted file mode 100644 index e16db9d26b3..00000000000 --- a/reactos/drivers/bus/acpi/acpica/tables/tbget.c +++ /dev/null @@ -1,608 +0,0 @@ -/****************************************************************************** - * - * Module Name: tbget - ACPI Table get* routines - * $Revision: 1.1 $ - * - *****************************************************************************/ - -/* - * Copyright (C) 2000, 2001 R. Byron Moore - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - - -#include - -#define _COMPONENT ACPI_TABLES - MODULE_NAME ("tbget") - -#define RSDP_CHECKSUM_LENGTH 20 - -/******************************************************************************* - * - * FUNCTION: Acpi_tb_get_table_ptr - * - * PARAMETERS: Table_type - one of the defined table types - * Instance - Which table of this type - * Table_ptr_loc - pointer to location to place the pointer for - * return - * - * RETURN: Status - * - * DESCRIPTION: This function is called to get the pointer to an ACPI table. - * - ******************************************************************************/ - -ACPI_STATUS -acpi_tb_get_table_ptr ( - ACPI_TABLE_TYPE table_type, - u32 instance, - ACPI_TABLE_HEADER **table_ptr_loc) -{ - ACPI_TABLE_DESC *table_desc; - u32 i; - - - if (!acpi_gbl_DSDT) { - return (AE_NO_ACPI_TABLES); - } - - if (table_type > ACPI_TABLE_MAX) { - return (AE_BAD_PARAMETER); - } - - - /* - * For all table types (Single/Multiple), the first - * instance is always in the list head. - */ - - if (instance == 1) { - /* - * Just pluck the pointer out of the global table! - * Will be null if no table is present - */ - - *table_ptr_loc = acpi_gbl_acpi_tables[table_type].pointer; - return (AE_OK); - } - - - /* - * Check for instance out of range - */ - if (instance > acpi_gbl_acpi_tables[table_type].count) { - return (AE_NOT_EXIST); - } - - /* Walk the list to get the desired table - * Since the if (Instance == 1) check above checked for the - * first table, setting Table_desc equal to the .Next member - * is actually pointing to the second table. Therefore, we - * need to walk from the 2nd table until we reach the Instance - * that the user is looking for and return its table pointer. - */ - table_desc = acpi_gbl_acpi_tables[table_type].next; - for (i = 2; i < instance; i++) { - table_desc = table_desc->next; - } - - /* We are now pointing to the requested table's descriptor */ - - *table_ptr_loc = table_desc->pointer; - - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_tb_get_table - * - * PARAMETERS: Physical_address - Physical address of table to retrieve - * *Buffer_ptr - If Buffer_ptr is valid, read data from - * buffer rather than searching memory - * *Table_info - Where the table info is returned - * - * RETURN: Status - * - * DESCRIPTION: Maps the physical address of table into a logical address - * - ******************************************************************************/ - -ACPI_STATUS -acpi_tb_get_table ( - ACPI_PHYSICAL_ADDRESS physical_address, - ACPI_TABLE_HEADER *buffer_ptr, - ACPI_TABLE_DESC *table_info) -{ - ACPI_TABLE_HEADER *table_header = NULL; - ACPI_TABLE_HEADER *full_table = NULL; - u32 size; - u8 allocation; - ACPI_STATUS status = AE_OK; - - - if (!table_info) { - return (AE_BAD_PARAMETER); - } - - - if (buffer_ptr) { - /* - * Getting data from a buffer, not BIOS tables - */ - - table_header = buffer_ptr; - status = acpi_tb_validate_table_header (table_header); - if (ACPI_FAILURE (status)) { - /* Table failed verification, map all errors to BAD_DATA */ - - return (AE_BAD_DATA); - } - - /* Allocate buffer for the entire table */ - - full_table = acpi_cm_allocate (table_header->length); - if (!full_table) { - return (AE_NO_MEMORY); - } - - /* Copy the entire table (including header) to the local buffer */ - - size = table_header->length; - MEMCPY (full_table, buffer_ptr, size); - - /* Save allocation type */ - - allocation = ACPI_MEM_ALLOCATED; - } - - - /* - * Not reading from a buffer, just map the table's physical memory - * into our address space. - */ - else { - size = SIZE_IN_HEADER; - - status = acpi_tb_map_acpi_table (physical_address, &size, - (void **) &full_table); - if (ACPI_FAILURE (status)) { - return (status); - } - - /* Save allocation type */ - - allocation = ACPI_MEM_MAPPED; - } - - - /* Return values */ - - table_info->pointer = full_table; - table_info->length = size; - table_info->allocation = allocation; - table_info->base_pointer = full_table; - - return (status); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_tb_get_all_tables - * - * PARAMETERS: Number_of_tables - Number of tables to get - * Table_ptr - Input buffer pointer, optional - * - * RETURN: Status - * - * DESCRIPTION: Load and validate all tables other than the RSDT. The RSDT must - * already be loaded and validated. - * - ******************************************************************************/ - -ACPI_STATUS -acpi_tb_get_all_tables ( - u32 number_of_tables, - ACPI_TABLE_HEADER *table_ptr) -{ - ACPI_STATUS status = AE_OK; - u32 index; - ACPI_TABLE_DESC table_info; - - - /* - * Loop through all table pointers found in RSDT. - * This will NOT include the FACS and DSDT - we must get - * them after the loop - */ - - for (index = 0; index < number_of_tables; index++) { - /* Clear the Table_info each time */ - - MEMSET (&table_info, 0, sizeof (ACPI_TABLE_DESC)); - - /* Get the table via the XSDT */ - - status = acpi_tb_get_table ((ACPI_PHYSICAL_ADDRESS) - ACPI_GET_ADDRESS (acpi_gbl_XSDT->table_offset_entry[index]), - table_ptr, &table_info); - - /* Ignore a table that failed verification */ - - if (status == AE_BAD_DATA) { - continue; - } - - /* However, abort on serious errors */ - - if (ACPI_FAILURE (status)) { - return (status); - } - - /* Recognize and install the table */ - - status = acpi_tb_install_table (table_ptr, &table_info); - if (ACPI_FAILURE (status)) { - /* - * Unrecognized or unsupported table, delete it and ignore the - * error. Just get as many tables as we can, later we will - * determine if there are enough tables to continue. - */ - - acpi_tb_uninstall_table (&table_info); - } - } - - - /* - * Convert the FADT to a common format. This allows earlier revisions of the - * table to coexist with newer versions, using common access code. - */ - status = acpi_tb_convert_table_fadt (); - if (ACPI_FAILURE (status)) { - return (status); - } - - - /* - * Get the minimum set of ACPI tables, namely: - * - * 1) FADT (via RSDT in loop above) - * 2) FACS - * 3) DSDT - * - */ - - - /* - * Get the FACS (must have the FADT first, from loop above) - * Acpi_tb_get_table_facs will fail if FADT pointer is not valid - */ - - status = acpi_tb_get_table_facs (table_ptr, &table_info); - if (ACPI_FAILURE (status)) { - return (status); - } - - - /* Install the FACS */ - - status = acpi_tb_install_table (table_ptr, &table_info); - if (ACPI_FAILURE (status)) { - return (status); - } - - /* - * Create the common FACS pointer table - * (Contains pointers to the original table) - */ - - status = acpi_tb_build_common_facs (&table_info); - if (ACPI_FAILURE (status)) { - return (status); - } - - - /* - * Get the DSDT (We know that the FADT is valid now) - */ - - status = acpi_tb_get_table ((ACPI_PHYSICAL_ADDRESS) ACPI_GET_ADDRESS (acpi_gbl_FADT->Xdsdt), - table_ptr, &table_info); - if (ACPI_FAILURE (status)) { - return (status); - } - - /* Install the DSDT */ - - status = acpi_tb_install_table (table_ptr, &table_info); - if (ACPI_FAILURE (status)) { - return (status); - } - - /* Dump the DSDT Header */ - - /* Dump the entire DSDT */ - - /* - * Initialize the capabilities flags. - * Assumes that platform supports ACPI_MODE since we have tables! - */ - acpi_gbl_system_flags |= acpi_hw_get_mode_capabilities (); - - - /* Always delete the RSDP mapping, we are done with it */ - - acpi_tb_delete_acpi_table (ACPI_TABLE_RSDP); - - return (status); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_tb_verify_rsdp - * - * PARAMETERS: Number_of_tables - Where the table count is placed - * - * RETURN: Status - * - * DESCRIPTION: Load and validate the RSDP (ptr) and RSDT (table) - * - ******************************************************************************/ - -ACPI_STATUS -acpi_tb_verify_rsdp ( - ACPI_PHYSICAL_ADDRESS rsdp_physical_address) -{ - ACPI_TABLE_DESC table_info; - ACPI_STATUS status; - u8 *table_ptr; - - - /* - * Obtain access to the RSDP structure - */ - status = acpi_os_map_memory (rsdp_physical_address, - sizeof (RSDP_DESCRIPTOR), - (void **) &table_ptr); - if (ACPI_FAILURE (status)) { - return (status); - } - - /* - * The signature and checksum must both be correct - */ - if (STRNCMP ((NATIVE_CHAR *) table_ptr, RSDP_SIG, sizeof (RSDP_SIG)-1) != 0) { - /* Nope, BAD Signature */ - - status = AE_BAD_SIGNATURE; - goto cleanup; - } - - if (acpi_tb_checksum (table_ptr, RSDP_CHECKSUM_LENGTH) != 0) { - /* Nope, BAD Checksum */ - - status = AE_BAD_CHECKSUM; - goto cleanup; - } - - /* TBD: Check extended checksum if table version >= 2 */ - - /* The RSDP supplied is OK */ - - table_info.pointer = (ACPI_TABLE_HEADER *) table_ptr; - table_info.length = sizeof (RSDP_DESCRIPTOR); - table_info.allocation = ACPI_MEM_MAPPED; - table_info.base_pointer = table_ptr; - - /* Save the table pointers and allocation info */ - - status = acpi_tb_init_table_descriptor (ACPI_TABLE_RSDP, &table_info); - if (ACPI_FAILURE (status)) { - goto cleanup; - } - - - /* Save the RSDP in a global for easy access */ - - acpi_gbl_RSDP = (RSDP_DESCRIPTOR *) table_info.pointer; - return (status); - - - /* Error exit */ -cleanup: - - acpi_os_unmap_memory (table_ptr, sizeof (RSDP_DESCRIPTOR)); - return (status); -} - - -/******************************************************************************* - * - * FUNCTION: Acpi_tb_get_table_rsdt - * - * PARAMETERS: Number_of_tables - Where the table count is placed - * - * RETURN: Status - * - * DESCRIPTION: Load and validate the RSDP (ptr) and RSDT (table) - * - ******************************************************************************/ - -ACPI_STATUS -acpi_tb_get_table_rsdt ( - u32 *number_of_tables) -{ - ACPI_TABLE_DESC table_info; - ACPI_STATUS status = AE_OK; - ACPI_PHYSICAL_ADDRESS physical_address; - u32 signature_length; - char *table_signature; - - - /* - * Get the RSDT from the RSDP - */ - - /* - * For RSDP revision 0 or 1, we use the RSDT. - * For RSDP revision 2 (and above), we use the XSDT - */ - if (acpi_gbl_RSDP->revision < 2) { -#ifdef _IA64 - /* 0.71 RSDP has 64bit Rsdt address field */ - physical_address = ((RSDP_DESCRIPTOR_REV071 *)acpi_gbl_RSDP)->rsdt_physical_address; -#else - physical_address = (ACPI_PHYSICAL_ADDRESS) acpi_gbl_RSDP->rsdt_physical_address; -#endif - table_signature = RSDT_SIG; - signature_length = sizeof (RSDT_SIG) -1; - } - else { - physical_address = (ACPI_PHYSICAL_ADDRESS) - ACPI_GET_ADDRESS (acpi_gbl_RSDP->xsdt_physical_address); - table_signature = XSDT_SIG; - signature_length = sizeof (XSDT_SIG) -1; - } - - - /* Get the RSDT/XSDT */ - - status = acpi_tb_get_table (physical_address, NULL, &table_info); - if (ACPI_FAILURE (status)) { - return (status); - } - - - /* Check the RSDT or XSDT signature */ - - if (STRNCMP ((char *) table_info.pointer, table_signature, - signature_length)) { - /* Invalid RSDT or XSDT signature */ - - REPORT_ERROR (("Invalid signature where RSDP indicates %s should be located\n", - table_signature)); - - return (AE_NO_ACPI_TABLES); - } - - - /* Valid RSDT signature, verify the checksum */ - - status = acpi_tb_verify_table_checksum (table_info.pointer); - - - /* Convert and/or copy to an XSDT structure */ - - status = acpi_tb_convert_to_xsdt (&table_info, number_of_tables); - if (ACPI_FAILURE (status)) { - return (status); - } - - /* Save the table pointers and allocation info */ - - status = acpi_tb_init_table_descriptor (ACPI_TABLE_XSDT, &table_info); - if (ACPI_FAILURE (status)) { - return (status); - } - - acpi_gbl_XSDT = (XSDT_DESCRIPTOR *) table_info.pointer; - - return (status); -} - - -/****************************************************************************** - * - * FUNCTION: Acpi_tb_get_table_facs - * - * PARAMETERS: *Buffer_ptr - If Buffer_ptr is valid, read data from - * buffer rather than searching memory - * *Table_info - Where the table info is returned - * - * RETURN: Status - * - * DESCRIPTION: Returns a pointer to the FACS as defined in FADT. This - * function assumes the global variable FADT has been - * correctly initialized. The value of FADT->Firmware_ctrl - * into a far pointer which is returned. - * - *****************************************************************************/ - -ACPI_STATUS -acpi_tb_get_table_facs ( - ACPI_TABLE_HEADER *buffer_ptr, - ACPI_TABLE_DESC *table_info) -{ - void *table_ptr = NULL; - u32 size; - u8 allocation; - ACPI_STATUS status = AE_OK; - - - /* Must have a valid FADT pointer */ - - if (!acpi_gbl_FADT) { - return (AE_NO_ACPI_TABLES); - } - - size = sizeof (FACS_DESCRIPTOR); - if (buffer_ptr) { - /* - * Getting table from a file -- allocate a buffer and - * read the table. - */ - table_ptr = acpi_cm_allocate (size); - if(!table_ptr) { - return (AE_NO_MEMORY); - } - - MEMCPY (table_ptr, buffer_ptr, size); - - /* Save allocation type */ - - allocation = ACPI_MEM_ALLOCATED; - } - - else { - /* Just map the physical memory to our address space */ - - status = acpi_tb_map_acpi_table ((ACPI_PHYSICAL_ADDRESS) ACPI_GET_ADDRESS (acpi_gbl_FADT->Xfirmware_ctrl), - &size, &table_ptr); - if (ACPI_FAILURE(status)) { - return (status); - } - - /* Save allocation type */ - - allocation = ACPI_MEM_MAPPED; - } - - - /* Return values */ - - table_info->pointer = table_ptr; - table_info->length = size; - table_info->allocation = allocation; - table_info->base_pointer = table_ptr; - - return (status); -} - diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbinstal.c b/reactos/drivers/bus/acpi/acpica/tables/tbinstal.c index da3ccf497a7..4560d0fe25a 100644 --- a/reactos/drivers/bus/acpi/acpica/tables/tbinstal.c +++ b/reactos/drivers/bus/acpi/acpica/tables/tbinstal.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -113,306 +113,447 @@ * *****************************************************************************/ - #define __TBINSTAL_C__ #include "acpi.h" #include "accommon.h" -#include "acnamesp.h" #include "actables.h" - #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbinstal") +/* Local prototypes */ -/****************************************************************************** - * - * FUNCTION: AcpiTbVerifyTable - * - * PARAMETERS: TableDesc - table - * - * RETURN: Status - * - * DESCRIPTION: this function is called to verify and map table - * - *****************************************************************************/ +static BOOLEAN +AcpiTbCompareTables ( + ACPI_TABLE_DESC *TableDesc, + UINT32 TableIndex); -ACPI_STATUS -AcpiTbVerifyTable ( - ACPI_TABLE_DESC *TableDesc) + +/******************************************************************************* + * + * FUNCTION: AcpiTbCompareTables + * + * PARAMETERS: TableDesc - Table 1 descriptor to be compared + * TableIndex - Index of table 2 to be compared + * + * RETURN: TRUE if both tables are identical. + * + * DESCRIPTION: This function compares a table with another table that has + * already been installed in the root table list. + * + ******************************************************************************/ + +static BOOLEAN +AcpiTbCompareTables ( + ACPI_TABLE_DESC *TableDesc, + UINT32 TableIndex) { ACPI_STATUS Status = AE_OK; + BOOLEAN IsIdentical; + ACPI_TABLE_HEADER *Table; + UINT32 TableLength; + UINT8 TableFlags; - ACPI_FUNCTION_TRACE (TbVerifyTable); - - - /* Map the table if necessary */ - - if (!TableDesc->Pointer) + Status = AcpiTbAcquireTable (&AcpiGbl_RootTableList.Tables[TableIndex], + &Table, &TableLength, &TableFlags); + if (ACPI_FAILURE (Status)) { - if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) == - ACPI_TABLE_ORIGIN_MAPPED) - { - TableDesc->Pointer = AcpiOsMapMemory ( - TableDesc->Address, TableDesc->Length); - } - - if (!TableDesc->Pointer) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } + return (FALSE); } - /* FACS is the odd table, has no standard ACPI header and no checksum */ + /* + * Check for a table match on the entire table length, + * not just the header. + */ + IsIdentical = (BOOLEAN)((TableDesc->Length != TableLength || + ACPI_MEMCMP (TableDesc->Pointer, Table, TableLength)) ? + FALSE : TRUE); - if (!ACPI_COMPARE_NAME (&TableDesc->Signature, ACPI_SIG_FACS)) - { - /* Always calculate checksum, ignore bad checksum if requested */ + /* Release the acquired table */ - Status = AcpiTbVerifyChecksum (TableDesc->Pointer, TableDesc->Length); - } - - return_ACPI_STATUS (Status); + AcpiTbReleaseTable (Table, TableLength, TableFlags); + return (IsIdentical); } /******************************************************************************* * - * FUNCTION: AcpiTbAddTable + * FUNCTION: AcpiTbInstallTableWithOverride * - * PARAMETERS: TableDesc - Table descriptor - * TableIndex - Where the table index is returned + * PARAMETERS: TableIndex - Index into root table array + * NewTableDesc - New table descriptor to install + * Override - Whether override should be performed * - * RETURN: Status + * RETURN: None * - * DESCRIPTION: This function is called to add an ACPI table. It is used to - * dynamically load tables via the Load and LoadTable AML - * operators. + * DESCRIPTION: Install an ACPI table into the global data structure. The + * table override mechanism is called to allow the host + * OS to replace any table before it is installed in the root + * table array. * ******************************************************************************/ -ACPI_STATUS -AcpiTbAddTable ( - ACPI_TABLE_DESC *TableDesc, - UINT32 *TableIndex) +void +AcpiTbInstallTableWithOverride ( + UINT32 TableIndex, + ACPI_TABLE_DESC *NewTableDesc, + BOOLEAN Override) { - UINT32 i; - ACPI_STATUS Status = AE_OK; - ACPI_TABLE_HEADER *OverrideTable = NULL; - - ACPI_FUNCTION_TRACE (TbAddTable); - - - if (!TableDesc->Pointer) + if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount) { - Status = AcpiTbVerifyTable (TableDesc); - if (ACPI_FAILURE (Status) || !TableDesc->Pointer) - { - return_ACPI_STATUS (Status); - } - } - - /* - * Validate the incoming table signature. - * - * 1) Originally, we checked the table signature for "SSDT" or "PSDT". - * 2) We added support for OEMx tables, signature "OEM". - * 3) Valid tables were encountered with a null signature, so we just - * gave up on validating the signature, (05/2008). - * 4) We encountered non-AML tables such as the MADT, which caused - * interpreter errors and kernel faults. So now, we once again allow - * only "SSDT", "OEMx", and now, also a null signature. (05/2011). - */ - if ((TableDesc->Pointer->Signature[0] != 0x00) && - (!ACPI_COMPARE_NAME (TableDesc->Pointer->Signature, ACPI_SIG_SSDT)) && - (ACPI_STRNCMP (TableDesc->Pointer->Signature, "OEM", 3))) - { - ACPI_ERROR ((AE_INFO, - "Table has invalid signature [%4.4s] (0x%8.8X), must be SSDT or OEMx", - AcpiUtValidAcpiName (*(UINT32 *) TableDesc->Pointer->Signature) ? - TableDesc->Pointer->Signature : "????", - *(UINT32 *) TableDesc->Pointer->Signature)); - - return_ACPI_STATUS (AE_BAD_SIGNATURE); - } - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - - /* Check if table is already registered */ - - for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) - { - if (!AcpiGbl_RootTableList.Tables[i].Pointer) - { - Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]); - if (ACPI_FAILURE (Status) || - !AcpiGbl_RootTableList.Tables[i].Pointer) - { - continue; - } - } - - /* - * Check for a table match on the entire table length, - * not just the header. - */ - if (TableDesc->Length != AcpiGbl_RootTableList.Tables[i].Length) - { - continue; - } - - if (ACPI_MEMCMP (TableDesc->Pointer, - AcpiGbl_RootTableList.Tables[i].Pointer, - AcpiGbl_RootTableList.Tables[i].Length)) - { - continue; - } - - /* - * Note: the current mechanism does not unregister a table if it is - * dynamically unloaded. The related namespace entries are deleted, - * but the table remains in the root table list. - * - * The assumption here is that the number of different tables that - * will be loaded is actually small, and there is minimal overhead - * in just keeping the table in case it is needed again. - * - * If this assumption changes in the future (perhaps on large - * machines with many table load/unload operations), tables will - * need to be unregistered when they are unloaded, and slots in the - * root table list should be reused when empty. - */ - - /* - * Table is already registered. - * We can delete the table that was passed as a parameter. - */ - AcpiTbDeleteTable (TableDesc); - *TableIndex = i; - - if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED) - { - /* Table is still loaded, this is an error */ - - Status = AE_ALREADY_EXISTS; - goto Release; - } - else - { - /* Table was unloaded, allow it to be reloaded */ - - TableDesc->Pointer = AcpiGbl_RootTableList.Tables[i].Pointer; - TableDesc->Address = AcpiGbl_RootTableList.Tables[i].Address; - Status = AE_OK; - goto PrintHeader; - } + return; } /* * ACPI Table Override: - * Allow the host to override dynamically loaded tables. + * + * Before we install the table, let the host OS override it with a new + * one if desired. Any table within the RSDT/XSDT can be replaced, + * including the DSDT which is pointed to by the FADT. */ - Status = AcpiOsTableOverride (TableDesc->Pointer, &OverrideTable); - if (ACPI_SUCCESS (Status) && OverrideTable) + if (Override) { - ACPI_INFO ((AE_INFO, - "%4.4s @ 0x%p Table override, replaced with:", - TableDesc->Pointer->Signature, - ACPI_CAST_PTR (void, TableDesc->Address))); - - /* We can delete the table that was passed as a parameter */ - - AcpiTbDeleteTable (TableDesc); - - /* Setup descriptor for the new table */ - - TableDesc->Address = ACPI_PTR_TO_PHYSADDR (OverrideTable); - TableDesc->Pointer = OverrideTable; - TableDesc->Length = OverrideTable->Length; - TableDesc->Flags = ACPI_TABLE_ORIGIN_OVERRIDE; + AcpiTbOverrideTable (NewTableDesc); } - /* Add the table to the global root table list */ + AcpiTbInitTableDescriptor (&AcpiGbl_RootTableList.Tables[TableIndex], + NewTableDesc->Address, NewTableDesc->Flags, NewTableDesc->Pointer); - Status = AcpiTbStoreTable (TableDesc->Address, TableDesc->Pointer, - TableDesc->Length, TableDesc->Flags, TableIndex); + AcpiTbPrintTableHeader (NewTableDesc->Address, NewTableDesc->Pointer); + + /* Set the global integer width (based upon revision of the DSDT) */ + + if (TableIndex == ACPI_TABLE_INDEX_DSDT) + { + AcpiUtSetIntegerWidth (NewTableDesc->Pointer->Revision); + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbInstallFixedTable + * + * PARAMETERS: Address - Physical address of DSDT or FACS + * Signature - Table signature, NULL if no need to + * match + * TableIndex - Index into root table array + * + * RETURN: Status + * + * DESCRIPTION: Install a fixed ACPI table (DSDT/FACS) into the global data + * structure. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbInstallFixedTable ( + ACPI_PHYSICAL_ADDRESS Address, + char *Signature, + UINT32 TableIndex) +{ + ACPI_TABLE_DESC NewTableDesc; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (TbInstallFixedTable); + + + if (!Address) + { + ACPI_ERROR ((AE_INFO, "Null physical address for ACPI table [%s]", + Signature)); + return (AE_NO_MEMORY); + } + + /* Fill a table descriptor for validation */ + + Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, + ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL); if (ACPI_FAILURE (Status)) { - goto Release; + ACPI_ERROR ((AE_INFO, "Could not acquire table length at %p", + ACPI_CAST_PTR (void, Address))); + return_ACPI_STATUS (Status); } -PrintHeader: - AcpiTbPrintTableHeader (TableDesc->Address, TableDesc->Pointer); + /* Validate and verify a table before installation */ -Release: - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + Status = AcpiTbVerifyTable (&NewTableDesc, Signature); + if (ACPI_FAILURE (Status)) + { + goto ReleaseAndExit; + } + + AcpiTbInstallTableWithOverride (TableIndex, &NewTableDesc, TRUE); + +ReleaseAndExit: + + /* Release the temporary table descriptor */ + + AcpiTbReleaseTempTable (&NewTableDesc); return_ACPI_STATUS (Status); } /******************************************************************************* * - * FUNCTION: AcpiTbResizeRootTableList + * FUNCTION: AcpiTbInstallStandardTable * - * PARAMETERS: None + * PARAMETERS: Address - Address of the table (might be a virtual + * address depending on the TableFlags) + * Flags - Flags for the table + * Reload - Whether reload should be performed + * Override - Whether override should be performed + * TableIndex - Where the table index is returned * * RETURN: Status * - * DESCRIPTION: Expand the size of global table array + * DESCRIPTION: This function is called to install an ACPI table that is + * neither DSDT nor FACS (a "standard" table.) + * When this function is called by "Load" or "LoadTable" opcodes, + * or by AcpiLoadTable() API, the "Reload" parameter is set. + * After sucessfully returning from this function, table is + * "INSTALLED" but not "VALIDATED". * ******************************************************************************/ ACPI_STATUS -AcpiTbResizeRootTableList ( - void) +AcpiTbInstallStandardTable ( + ACPI_PHYSICAL_ADDRESS Address, + UINT8 Flags, + BOOLEAN Reload, + BOOLEAN Override, + UINT32 *TableIndex) { - ACPI_TABLE_DESC *Tables; + UINT32 i; + ACPI_STATUS Status = AE_OK; + ACPI_TABLE_DESC NewTableDesc; - ACPI_FUNCTION_TRACE (TbResizeRootTableList); + ACPI_FUNCTION_TRACE (TbInstallStandardTable); - /* AllowResize flag is a parameter to AcpiInitializeTables */ + /* Acquire a temporary table descriptor for validation */ - if (!(AcpiGbl_RootTableList.Flags & ACPI_ROOT_ALLOW_RESIZE)) + Status = AcpiTbAcquireTempTable (&NewTableDesc, Address, Flags); + if (ACPI_FAILURE (Status)) { - ACPI_ERROR ((AE_INFO, "Resize of Root Table Array is not allowed")); - return_ACPI_STATUS (AE_SUPPORT); + ACPI_ERROR ((AE_INFO, "Could not acquire table length at %p", + ACPI_CAST_PTR (void, Address))); + return_ACPI_STATUS (Status); } - /* Increase the Table Array size */ - - Tables = ACPI_ALLOCATE_ZEROED ( - ((ACPI_SIZE) AcpiGbl_RootTableList.MaxTableCount + - ACPI_ROOT_TABLE_SIZE_INCREMENT) * - sizeof (ACPI_TABLE_DESC)); - if (!Tables) + /* + * Optionally do not load any SSDTs from the RSDT/XSDT. This can + * be useful for debugging ACPI problems on some machines. + */ + if (!Reload && + AcpiGbl_DisableSsdtTableInstall && + ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT)) { - ACPI_ERROR ((AE_INFO, "Could not allocate new root table array")); - return_ACPI_STATUS (AE_NO_MEMORY); + ACPI_INFO ((AE_INFO, "Ignoring installation of %4.4s at %p", + NewTableDesc.Signature.Ascii, ACPI_CAST_PTR (void, Address))); + goto ReleaseAndExit; } - /* Copy and free the previous table array */ + /* Validate and verify a table before installation */ - if (AcpiGbl_RootTableList.Tables) + Status = AcpiTbVerifyTable (&NewTableDesc, NULL); + if (ACPI_FAILURE (Status)) { - ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables, - (ACPI_SIZE) AcpiGbl_RootTableList.MaxTableCount * sizeof (ACPI_TABLE_DESC)); + goto ReleaseAndExit; + } - if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) + if (Reload) + { + /* + * Validate the incoming table signature. + * + * 1) Originally, we checked the table signature for "SSDT" or "PSDT". + * 2) We added support for OEMx tables, signature "OEM". + * 3) Valid tables were encountered with a null signature, so we just + * gave up on validating the signature, (05/2008). + * 4) We encountered non-AML tables such as the MADT, which caused + * interpreter errors and kernel faults. So now, we once again allow + * only "SSDT", "OEMx", and now, also a null signature. (05/2011). + */ + if ((NewTableDesc.Signature.Ascii[0] != 0x00) && + (!ACPI_COMPARE_NAME (&NewTableDesc.Signature, ACPI_SIG_SSDT)) && + (ACPI_STRNCMP (NewTableDesc.Signature.Ascii, "OEM", 3))) { - ACPI_FREE (AcpiGbl_RootTableList.Tables); + ACPI_BIOS_ERROR ((AE_INFO, + "Table has invalid signature [%4.4s] (0x%8.8X), " + "must be SSDT or OEMx", + AcpiUtValidAcpiName (NewTableDesc.Signature.Ascii) ? + NewTableDesc.Signature.Ascii : "????", + NewTableDesc.Signature.Integer)); + + Status = AE_BAD_SIGNATURE; + goto ReleaseAndExit; + } + + /* Check if table is already registered */ + + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) + { + /* + * Check for a table match on the entire table length, + * not just the header. + */ + if (!AcpiTbCompareTables (&NewTableDesc, i)) + { + continue; + } + + /* + * Note: the current mechanism does not unregister a table if it is + * dynamically unloaded. The related namespace entries are deleted, + * but the table remains in the root table list. + * + * The assumption here is that the number of different tables that + * will be loaded is actually small, and there is minimal overhead + * in just keeping the table in case it is needed again. + * + * If this assumption changes in the future (perhaps on large + * machines with many table load/unload operations), tables will + * need to be unregistered when they are unloaded, and slots in the + * root table list should be reused when empty. + */ + if (AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_IS_LOADED) + { + /* Table is still loaded, this is an error */ + + Status = AE_ALREADY_EXISTS; + goto ReleaseAndExit; + } + else + { + /* + * Table was unloaded, allow it to be reloaded. + * As we are going to return AE_OK to the caller, we should + * take the responsibility of freeing the input descriptor. + * Refill the input descriptor to ensure + * AcpiTbInstallTableWithOverride() can be called again to + * indicate the re-installation. + */ + AcpiTbUninstallTable (&NewTableDesc); + *TableIndex = i; + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + return_ACPI_STATUS (AE_OK); + } } } - AcpiGbl_RootTableList.Tables = Tables; - AcpiGbl_RootTableList.MaxTableCount += ACPI_ROOT_TABLE_SIZE_INCREMENT; - AcpiGbl_RootTableList.Flags |= (UINT8) ACPI_ROOT_ORIGIN_ALLOCATED; + /* Add the table to the global root table list */ - return_ACPI_STATUS (AE_OK); + Status = AcpiTbGetNextRootIndex (&i); + if (ACPI_FAILURE (Status)) + { + goto ReleaseAndExit; + } + + *TableIndex = i; + AcpiTbInstallTableWithOverride (i, &NewTableDesc, Override); + +ReleaseAndExit: + + /* Release the temporary table descriptor */ + + AcpiTbReleaseTempTable (&NewTableDesc); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbOverrideTable + * + * PARAMETERS: OldTableDesc - Validated table descriptor to be + * overridden + * + * RETURN: None + * + * DESCRIPTION: Attempt table override by calling the OSL override functions. + * Note: If the table is overridden, then the entire new table + * is acquired and returned by this function. + * Before/after invocation, the table descriptor is in a state + * that is "VALIDATED". + * + ******************************************************************************/ + +void +AcpiTbOverrideTable ( + ACPI_TABLE_DESC *OldTableDesc) +{ + ACPI_STATUS Status; + char *OverrideType; + ACPI_TABLE_DESC NewTableDesc; + ACPI_TABLE_HEADER *Table; + ACPI_PHYSICAL_ADDRESS Address; + UINT32 Length; + + + /* (1) Attempt logical override (returns a logical address) */ + + Status = AcpiOsTableOverride (OldTableDesc->Pointer, &Table); + if (ACPI_SUCCESS (Status) && Table) + { + AcpiTbAcquireTempTable (&NewTableDesc, ACPI_PTR_TO_PHYSADDR (Table), + ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL); + OverrideType = "Logical"; + goto FinishOverride; + } + + /* (2) Attempt physical override (returns a physical address) */ + + Status = AcpiOsPhysicalTableOverride (OldTableDesc->Pointer, + &Address, &Length); + if (ACPI_SUCCESS (Status) && Address && Length) + { + AcpiTbAcquireTempTable (&NewTableDesc, Address, + ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL); + OverrideType = "Physical"; + goto FinishOverride; + } + + return; /* There was no override */ + + +FinishOverride: + + /* Validate and verify a table before overriding */ + + Status = AcpiTbVerifyTable (&NewTableDesc, NULL); + if (ACPI_FAILURE (Status)) + { + return; + } + + ACPI_INFO ((AE_INFO, "%4.4s " ACPI_PRINTF_UINT + " %s table override, new table: " ACPI_PRINTF_UINT, + OldTableDesc->Signature.Ascii, + ACPI_FORMAT_TO_UINT (OldTableDesc->Address), + OverrideType, ACPI_FORMAT_TO_UINT (NewTableDesc.Address))); + + /* We can now uninstall the original table */ + + AcpiTbUninstallTable (OldTableDesc); + + /* + * Replace the original table descriptor and keep its state as + * "VALIDATED". + */ + AcpiTbInitTableDescriptor (OldTableDesc, NewTableDesc.Address, + NewTableDesc.Flags, NewTableDesc.Pointer); + AcpiTbValidateTable (OldTableDesc); + + /* Release the temporary table descriptor */ + + AcpiTbReleaseTempTable (&NewTableDesc); } @@ -423,7 +564,8 @@ AcpiTbResizeRootTableList ( * PARAMETERS: Address - Table address * Table - Table header * Length - Table length - * Flags - flags + * Flags - Install flags + * TableIndex - Where the table index is returned * * RETURN: Status and table index. * @@ -440,44 +582,29 @@ AcpiTbStoreTable ( UINT32 *TableIndex) { ACPI_STATUS Status; - ACPI_TABLE_DESC *NewTable; + ACPI_TABLE_DESC *TableDesc; - /* Ensure that there is room for the table in the Root Table List */ - - if (AcpiGbl_RootTableList.CurrentTableCount >= - AcpiGbl_RootTableList.MaxTableCount) + Status = AcpiTbGetNextRootIndex (TableIndex); + if (ACPI_FAILURE (Status)) { - Status = AcpiTbResizeRootTableList(); - if (ACPI_FAILURE (Status)) - { - return (Status); - } + return (Status); } - NewTable = &AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.CurrentTableCount]; - /* Initialize added table */ - NewTable->Address = Address; - NewTable->Pointer = Table; - NewTable->Length = Length; - NewTable->OwnerId = 0; - NewTable->Flags = Flags; - - ACPI_MOVE_32_TO_32 (&NewTable->Signature, Table->Signature); - - *TableIndex = AcpiGbl_RootTableList.CurrentTableCount; - AcpiGbl_RootTableList.CurrentTableCount++; + TableDesc = &AcpiGbl_RootTableList.Tables[*TableIndex]; + AcpiTbInitTableDescriptor (TableDesc, Address, Flags, Table); + TableDesc->Pointer = Table; return (AE_OK); } /******************************************************************************* * - * FUNCTION: AcpiTbDeleteTable + * FUNCTION: AcpiTbUninstallTable * - * PARAMETERS: TableIndex - Table index + * PARAMETERS: TableDesc - Table descriptor * * RETURN: None * @@ -486,318 +613,28 @@ AcpiTbStoreTable ( ******************************************************************************/ void -AcpiTbDeleteTable ( +AcpiTbUninstallTable ( ACPI_TABLE_DESC *TableDesc) { - /* Table must be mapped or allocated */ + ACPI_FUNCTION_TRACE (TbUninstallTable); - if (!TableDesc->Pointer) + + /* Table must be installed */ + + if (!TableDesc->Address) { - return; + return_VOID; } - switch (TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) + AcpiTbInvalidateTable (TableDesc); + + if ((TableDesc->Flags & ACPI_TABLE_ORIGIN_MASK) == + ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL) { - case ACPI_TABLE_ORIGIN_MAPPED: - AcpiOsUnmapMemory (TableDesc->Pointer, TableDesc->Length); - break; - - case ACPI_TABLE_ORIGIN_ALLOCATED: - ACPI_FREE (TableDesc->Pointer); - break; - - default: - break; + ACPI_FREE (ACPI_CAST_PTR (void, TableDesc->Address)); } - TableDesc->Pointer = NULL; + TableDesc->Address = ACPI_PTR_TO_PHYSADDR (NULL); + return_VOID; } - - -/******************************************************************************* - * - * FUNCTION: AcpiTbTerminate - * - * PARAMETERS: None - * - * RETURN: None - * - * DESCRIPTION: Delete all internal ACPI tables - * - ******************************************************************************/ - -void -AcpiTbTerminate ( - void) -{ - UINT32 i; - - - ACPI_FUNCTION_TRACE (TbTerminate); - - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - - /* Delete the individual tables */ - - for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) - { - AcpiTbDeleteTable (&AcpiGbl_RootTableList.Tables[i]); - } - - /* - * Delete the root table array if allocated locally. Array cannot be - * mapped, so we don't need to check for that flag. - */ - if (AcpiGbl_RootTableList.Flags & ACPI_ROOT_ORIGIN_ALLOCATED) - { - ACPI_FREE (AcpiGbl_RootTableList.Tables); - } - - AcpiGbl_RootTableList.Tables = NULL; - AcpiGbl_RootTableList.Flags = 0; - AcpiGbl_RootTableList.CurrentTableCount = 0; - - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "ACPI Tables freed\n")); - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbDeleteNamespaceByOwner - * - * PARAMETERS: TableIndex - Table index - * - * RETURN: Status - * - * DESCRIPTION: Delete all namespace objects created when this table was loaded. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiTbDeleteNamespaceByOwner ( - UINT32 TableIndex) -{ - ACPI_OWNER_ID OwnerId; - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (TbDeleteNamespaceByOwner); - - - Status = AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - if (TableIndex >= AcpiGbl_RootTableList.CurrentTableCount) - { - /* The table index does not exist */ - - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - return_ACPI_STATUS (AE_NOT_EXIST); - } - - /* Get the owner ID for this table, used to delete namespace nodes */ - - OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId; - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - - /* - * Need to acquire the namespace writer lock to prevent interference - * with any concurrent namespace walks. The interpreter must be - * released during the deletion since the acquisition of the deletion - * lock may block, and also since the execution of a namespace walk - * must be allowed to use the interpreter. - */ - (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER); - Status = AcpiUtAcquireWriteLock (&AcpiGbl_NamespaceRwLock); - - AcpiNsDeleteNamespaceByOwner (OwnerId); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - AcpiUtReleaseWriteLock (&AcpiGbl_NamespaceRwLock); - - Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbAllocateOwnerId - * - * PARAMETERS: TableIndex - Table index - * - * RETURN: Status - * - * DESCRIPTION: Allocates OwnerId in TableDesc - * - ******************************************************************************/ - -ACPI_STATUS -AcpiTbAllocateOwnerId ( - UINT32 TableIndex) -{ - ACPI_STATUS Status = AE_BAD_PARAMETER; - - - ACPI_FUNCTION_TRACE (TbAllocateOwnerId); - - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) - { - Status = AcpiUtAllocateOwnerId - (&(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId)); - } - - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbReleaseOwnerId - * - * PARAMETERS: TableIndex - Table index - * - * RETURN: Status - * - * DESCRIPTION: Releases OwnerId in TableDesc - * - ******************************************************************************/ - -ACPI_STATUS -AcpiTbReleaseOwnerId ( - UINT32 TableIndex) -{ - ACPI_STATUS Status = AE_BAD_PARAMETER; - - - ACPI_FUNCTION_TRACE (TbReleaseOwnerId); - - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) - { - AcpiUtReleaseOwnerId ( - &(AcpiGbl_RootTableList.Tables[TableIndex].OwnerId)); - Status = AE_OK; - } - - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbGetOwnerId - * - * PARAMETERS: TableIndex - Table index - * OwnerId - Where the table OwnerId is returned - * - * RETURN: Status - * - * DESCRIPTION: returns OwnerId for the ACPI table - * - ******************************************************************************/ - -ACPI_STATUS -AcpiTbGetOwnerId ( - UINT32 TableIndex, - ACPI_OWNER_ID *OwnerId) -{ - ACPI_STATUS Status = AE_BAD_PARAMETER; - - - ACPI_FUNCTION_TRACE (TbGetOwnerId); - - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) - { - *OwnerId = AcpiGbl_RootTableList.Tables[TableIndex].OwnerId; - Status = AE_OK; - } - - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbIsTableLoaded - * - * PARAMETERS: TableIndex - Table index - * - * RETURN: Table Loaded Flag - * - ******************************************************************************/ - -BOOLEAN -AcpiTbIsTableLoaded ( - UINT32 TableIndex) -{ - BOOLEAN IsLoaded = FALSE; - - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) - { - IsLoaded = (BOOLEAN) - (AcpiGbl_RootTableList.Tables[TableIndex].Flags & - ACPI_TABLE_IS_LOADED); - } - - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - return (IsLoaded); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbSetTableLoadedFlag - * - * PARAMETERS: TableIndex - Table index - * IsLoaded - TRUE if table is loaded, FALSE otherwise - * - * RETURN: None - * - * DESCRIPTION: Sets the table loaded flag to either TRUE or FALSE. - * - ******************************************************************************/ - -void -AcpiTbSetTableLoadedFlag ( - UINT32 TableIndex, - BOOLEAN IsLoaded) -{ - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - if (TableIndex < AcpiGbl_RootTableList.CurrentTableCount) - { - if (IsLoaded) - { - AcpiGbl_RootTableList.Tables[TableIndex].Flags |= - ACPI_TABLE_IS_LOADED; - } - else - { - AcpiGbl_RootTableList.Tables[TableIndex].Flags &= - ~ACPI_TABLE_IS_LOADED; - } - } - - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); -} - diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbprint.c b/reactos/drivers/bus/acpi/acpica/tables/tbprint.c new file mode 100644 index 00000000000..553daf91852 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/tables/tbprint.c @@ -0,0 +1,351 @@ +/****************************************************************************** + * + * Module Name: tbprint - Table output utilities + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __TBPRINT_C__ + +#include "acpi.h" +#include "accommon.h" +#include "actables.h" + +#define _COMPONENT ACPI_TABLES + ACPI_MODULE_NAME ("tbprint") + + +/* Local prototypes */ + +static void +AcpiTbFixString ( + char *String, + ACPI_SIZE Length); + +static void +AcpiTbCleanupTableHeader ( + ACPI_TABLE_HEADER *OutHeader, + ACPI_TABLE_HEADER *Header); + + +/******************************************************************************* + * + * FUNCTION: AcpiTbFixString + * + * PARAMETERS: String - String to be repaired + * Length - Maximum length + * + * RETURN: None + * + * DESCRIPTION: Replace every non-printable or non-ascii byte in the string + * with a question mark '?'. + * + ******************************************************************************/ + +static void +AcpiTbFixString ( + char *String, + ACPI_SIZE Length) +{ + + while (Length && *String) + { + if (!ACPI_IS_PRINT (*String)) + { + *String = '?'; + } + String++; + Length--; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbCleanupTableHeader + * + * PARAMETERS: OutHeader - Where the cleaned header is returned + * Header - Input ACPI table header + * + * RETURN: Returns the cleaned header in OutHeader + * + * DESCRIPTION: Copy the table header and ensure that all "string" fields in + * the header consist of printable characters. + * + ******************************************************************************/ + +static void +AcpiTbCleanupTableHeader ( + ACPI_TABLE_HEADER *OutHeader, + ACPI_TABLE_HEADER *Header) +{ + + ACPI_MEMCPY (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); + + AcpiTbFixString (OutHeader->Signature, ACPI_NAME_SIZE); + AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE); + AcpiTbFixString (OutHeader->OemTableId, ACPI_OEM_TABLE_ID_SIZE); + AcpiTbFixString (OutHeader->AslCompilerId, ACPI_NAME_SIZE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbPrintTableHeader + * + * PARAMETERS: Address - Table physical address + * Header - Table header + * + * RETURN: None + * + * DESCRIPTION: Print an ACPI table header. Special cases for FACS and RSDP. + * + ******************************************************************************/ + +void +AcpiTbPrintTableHeader ( + ACPI_PHYSICAL_ADDRESS Address, + ACPI_TABLE_HEADER *Header) +{ + ACPI_TABLE_HEADER LocalHeader; + + + /* + * The reason that we use ACPI_PRINTF_UINT and ACPI_FORMAT_TO_UINT is to + * support both 32-bit and 64-bit hosts/addresses in a consistent manner. + * The %p specifier does not emit uniform output on all hosts. On some, + * leading zeros are not supported. + */ + if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_FACS)) + { + /* FACS only has signature and length fields */ + + ACPI_INFO ((AE_INFO, "%-4.4s " ACPI_PRINTF_UINT " %06X", + Header->Signature, ACPI_FORMAT_TO_UINT (Address), + Header->Length)); + } + else if (ACPI_VALIDATE_RSDP_SIG (Header->Signature)) + { + /* RSDP has no common fields */ + + ACPI_MEMCPY (LocalHeader.OemId, + ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE); + AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE); + + ACPI_INFO ((AE_INFO, "RSDP " ACPI_PRINTF_UINT " %06X (v%.2d %-6.6s)", + ACPI_FORMAT_TO_UINT (Address), + (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ? + ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20, + ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision, + LocalHeader.OemId)); + } + else + { + /* Standard ACPI table with full common header */ + + AcpiTbCleanupTableHeader (&LocalHeader, Header); + + ACPI_INFO ((AE_INFO, + "%-4.4s " ACPI_PRINTF_UINT + " %06X (v%.2d %-6.6s %-8.8s %08X %-4.4s %08X)", + LocalHeader.Signature, ACPI_FORMAT_TO_UINT (Address), + LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId, + LocalHeader.OemTableId, LocalHeader.OemRevision, + LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision)); + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbValidateChecksum + * + * PARAMETERS: Table - ACPI table to verify + * Length - Length of entire table + * + * RETURN: Status + * + * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns + * exception on bad checksum. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiTbVerifyChecksum ( + ACPI_TABLE_HEADER *Table, + UINT32 Length) +{ + UINT8 Checksum; + + + /* + * FACS/S3PT: + * They are the odd tables, have no standard ACPI header and no checksum + */ + + if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_S3PT) || + ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_FACS)) + { + return (AE_OK); + } + + /* Compute the checksum on the table */ + + Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Length); + + /* Checksum ok? (should be zero) */ + + if (Checksum) + { + ACPI_BIOS_WARNING ((AE_INFO, + "Incorrect checksum in table [%4.4s] - 0x%2.2X, " + "should be 0x%2.2X", + Table->Signature, Table->Checksum, + (UINT8) (Table->Checksum - Checksum))); + +#if (ACPI_CHECKSUM_ABORT) + return (AE_BAD_CHECKSUM); +#endif + } + + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiTbChecksum + * + * PARAMETERS: Buffer - Pointer to memory region to be checked + * Length - Length of this memory region + * + * RETURN: Checksum (UINT8) + * + * DESCRIPTION: Calculates circular checksum of memory region. + * + ******************************************************************************/ + +UINT8 +AcpiTbChecksum ( + UINT8 *Buffer, + UINT32 Length) +{ + UINT8 Sum = 0; + UINT8 *End = Buffer + Length; + + + while (Buffer < End) + { + Sum = (UINT8) (Sum + *(Buffer++)); + } + + return (Sum); +} diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbutils.c b/reactos/drivers/bus/acpi/acpica/tables/tbutils.c index 3cb3cc204c5..73cf76ecc5f 100644 --- a/reactos/drivers/bus/acpi/acpica/tables/tbutils.c +++ b/reactos/drivers/bus/acpi/acpica/tables/tbutils.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: tbutils - table utilities + * Module Name: tbutils - ACPI Table utilities * *****************************************************************************/ @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -122,17 +122,12 @@ #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbutils") + /* Local prototypes */ -static void -AcpiTbFixString ( - char *String, - ACPI_SIZE Length); - -static void -AcpiTbCleanupTableHeader ( - ACPI_TABLE_HEADER *OutHeader, - ACPI_TABLE_HEADER *Header); +static ACPI_STATUS +AcpiTbValidateXsdt ( + ACPI_PHYSICAL_ADDRESS Address); static ACPI_PHYSICAL_ADDRESS AcpiTbGetRootTableEntry ( @@ -140,6 +135,7 @@ AcpiTbGetRootTableEntry ( UINT32 TableEntrySize); +#if (!ACPI_REDUCED_HARDWARE) /******************************************************************************* * * FUNCTION: AcpiTbInitializeFacs @@ -160,10 +156,19 @@ AcpiTbInitializeFacs ( ACPI_STATUS Status; + /* If Hardware Reduced flag is set, there is no FACS */ + + if (AcpiGbl_ReducedHardware) + { + AcpiGbl_FACS = NULL; + return (AE_OK); + } + Status = AcpiGetTableByIndex (ACPI_TABLE_INDEX_FACS, ACPI_CAST_INDIRECT_PTR (ACPI_TABLE_HEADER, &AcpiGbl_FACS)); return (Status); } +#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* @@ -193,206 +198,6 @@ AcpiTbTablesLoaded ( } -/******************************************************************************* - * - * FUNCTION: AcpiTbFixString - * - * PARAMETERS: String - String to be repaired - * Length - Maximum length - * - * RETURN: None - * - * DESCRIPTION: Replace every non-printable or non-ascii byte in the string - * with a question mark '?'. - * - ******************************************************************************/ - -static void -AcpiTbFixString ( - char *String, - ACPI_SIZE Length) -{ - - while (Length && *String) - { - if (!ACPI_IS_PRINT (*String)) - { - *String = '?'; - } - String++; - Length--; - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbCleanupTableHeader - * - * PARAMETERS: OutHeader - Where the cleaned header is returned - * Header - Input ACPI table header - * - * RETURN: Returns the cleaned header in OutHeader - * - * DESCRIPTION: Copy the table header and ensure that all "string" fields in - * the header consist of printable characters. - * - ******************************************************************************/ - -static void -AcpiTbCleanupTableHeader ( - ACPI_TABLE_HEADER *OutHeader, - ACPI_TABLE_HEADER *Header) -{ - - ACPI_MEMCPY (OutHeader, Header, sizeof (ACPI_TABLE_HEADER)); - - AcpiTbFixString (OutHeader->Signature, ACPI_NAME_SIZE); - AcpiTbFixString (OutHeader->OemId, ACPI_OEM_ID_SIZE); - AcpiTbFixString (OutHeader->OemTableId, ACPI_OEM_TABLE_ID_SIZE); - AcpiTbFixString (OutHeader->AslCompilerId, ACPI_NAME_SIZE); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbPrintTableHeader - * - * PARAMETERS: Address - Table physical address - * Header - Table header - * - * RETURN: None - * - * DESCRIPTION: Print an ACPI table header. Special cases for FACS and RSDP. - * - ******************************************************************************/ - -void -AcpiTbPrintTableHeader ( - ACPI_PHYSICAL_ADDRESS Address, - ACPI_TABLE_HEADER *Header) -{ - ACPI_TABLE_HEADER LocalHeader; - - - /* - * The reason that the Address is cast to a void pointer is so that we - * can use %p which will work properly on both 32-bit and 64-bit hosts. - */ - if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_FACS)) - { - /* FACS only has signature and length fields */ - - ACPI_INFO ((AE_INFO, "%4.4s %p %05X", - Header->Signature, ACPI_CAST_PTR (void, Address), - Header->Length)); - } - else if (ACPI_COMPARE_NAME (Header->Signature, ACPI_SIG_RSDP)) - { - /* RSDP has no common fields */ - - ACPI_MEMCPY (LocalHeader.OemId, - ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->OemId, ACPI_OEM_ID_SIZE); - AcpiTbFixString (LocalHeader.OemId, ACPI_OEM_ID_SIZE); - - ACPI_INFO ((AE_INFO, "RSDP %p %05X (v%.2d %6.6s)", - ACPI_CAST_PTR (void, Address), - (ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision > 0) ? - ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Length : 20, - ACPI_CAST_PTR (ACPI_TABLE_RSDP, Header)->Revision, - LocalHeader.OemId)); - } - else - { - /* Standard ACPI table with full common header */ - - AcpiTbCleanupTableHeader (&LocalHeader, Header); - - ACPI_INFO ((AE_INFO, - "%4.4s %p %05X (v%.2d %6.6s %8.8s %08X %4.4s %08X)", - LocalHeader.Signature, ACPI_CAST_PTR (void, Address), - LocalHeader.Length, LocalHeader.Revision, LocalHeader.OemId, - LocalHeader.OemTableId, LocalHeader.OemRevision, - LocalHeader.AslCompilerId, LocalHeader.AslCompilerRevision)); - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbValidateChecksum - * - * PARAMETERS: Table - ACPI table to verify - * Length - Length of entire table - * - * RETURN: Status - * - * DESCRIPTION: Verifies that the table checksums to zero. Optionally returns - * exception on bad checksum. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiTbVerifyChecksum ( - ACPI_TABLE_HEADER *Table, - UINT32 Length) -{ - UINT8 Checksum; - - - /* Compute the checksum on the table */ - - Checksum = AcpiTbChecksum (ACPI_CAST_PTR (UINT8, Table), Length); - - /* Checksum ok? (should be zero) */ - - if (Checksum) - { - ACPI_WARNING ((AE_INFO, - "Incorrect checksum in table [%4.4s] - 0x%2.2X, should be 0x%2.2X", - Table->Signature, Table->Checksum, - (UINT8) (Table->Checksum - Checksum))); - -#if (ACPI_CHECKSUM_ABORT) - return (AE_BAD_CHECKSUM); -#endif - } - - return (AE_OK); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiTbChecksum - * - * PARAMETERS: Buffer - Pointer to memory region to be checked - * Length - Length of this memory region - * - * RETURN: Checksum (UINT8) - * - * DESCRIPTION: Calculates circular checksum of memory region. - * - ******************************************************************************/ - -UINT8 -AcpiTbChecksum ( - UINT8 *Buffer, - UINT32 Length) -{ - UINT8 Sum = 0; - UINT8 *End = Buffer + Length; - - - while (Buffer < End) - { - Sum = (UINT8) (Sum + *(Buffer++)); - } - - return Sum; -} - - /******************************************************************************* * * FUNCTION: AcpiTbCheckDsdtHeader @@ -417,8 +222,9 @@ AcpiTbCheckDsdtHeader ( if (AcpiGbl_OriginalDsdtHeader.Length != AcpiGbl_DSDT->Length || AcpiGbl_OriginalDsdtHeader.Checksum != AcpiGbl_DSDT->Checksum) { - ACPI_ERROR ((AE_INFO, - "The DSDT has been corrupted or replaced - old, new headers below")); + ACPI_BIOS_ERROR ((AE_INFO, + "The DSDT has been corrupted or replaced - " + "old, new headers below")); AcpiTbPrintTableHeader (0, &AcpiGbl_OriginalDsdtHeader); AcpiTbPrintTableHeader (0, AcpiGbl_DSDT); @@ -463,9 +269,12 @@ AcpiTbCopyDsdt ( } ACPI_MEMCPY (NewTable, TableDesc->Pointer, TableDesc->Length); - AcpiTbDeleteTable (TableDesc); - TableDesc->Pointer = NewTable; - TableDesc->Flags = ACPI_TABLE_ORIGIN_ALLOCATED; + AcpiTbUninstallTable (TableDesc); + + AcpiTbInitTableDescriptor ( + &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT], + ACPI_PTR_TO_PHYSADDR (NewTable), ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, + NewTable); ACPI_INFO ((AE_INFO, "Forced DSDT copy: length 0x%05X copied locally, original unmapped", @@ -475,113 +284,6 @@ AcpiTbCopyDsdt ( } -/******************************************************************************* - * - * FUNCTION: AcpiTbInstallTable - * - * PARAMETERS: Address - Physical address of DSDT or FACS - * Signature - Table signature, NULL if no need to - * match - * TableIndex - Index into root table array - * - * RETURN: None - * - * DESCRIPTION: Install an ACPI table into the global data structure. The - * table override mechanism is implemented here to allow the host - * OS to replace any table before it is installed in the root - * table array. - * - ******************************************************************************/ - -void -AcpiTbInstallTable ( - ACPI_PHYSICAL_ADDRESS Address, - char *Signature, - UINT32 TableIndex) -{ - UINT8 Flags; - ACPI_STATUS Status; - ACPI_TABLE_HEADER *TableToInstall; - ACPI_TABLE_HEADER *MappedTable; - ACPI_TABLE_HEADER *OverrideTable = NULL; - - - if (!Address) - { - ACPI_ERROR ((AE_INFO, "Null physical address for ACPI table [%s]", - Signature)); - return; - } - - /* Map just the table header */ - - MappedTable = AcpiOsMapMemory (Address, sizeof (ACPI_TABLE_HEADER)); - if (!MappedTable) - { - return; - } - - /* If a particular signature is expected (DSDT/FACS), it must match */ - - if (Signature && - !ACPI_COMPARE_NAME (MappedTable->Signature, Signature)) - { - ACPI_ERROR ((AE_INFO, - "Invalid signature 0x%X for ACPI table, expected [%s]", - *ACPI_CAST_PTR (UINT32, MappedTable->Signature), Signature)); - goto UnmapAndExit; - } - - /* - * ACPI Table Override: - * - * Before we install the table, let the host OS override it with a new - * one if desired. Any table within the RSDT/XSDT can be replaced, - * including the DSDT which is pointed to by the FADT. - */ - Status = AcpiOsTableOverride (MappedTable, &OverrideTable); - if (ACPI_SUCCESS (Status) && OverrideTable) - { - ACPI_INFO ((AE_INFO, - "%4.4s @ 0x%p Table override, replaced with:", - MappedTable->Signature, ACPI_CAST_PTR (void, Address))); - - AcpiGbl_RootTableList.Tables[TableIndex].Pointer = OverrideTable; - Address = ACPI_PTR_TO_PHYSADDR (OverrideTable); - - TableToInstall = OverrideTable; - Flags = ACPI_TABLE_ORIGIN_OVERRIDE; - } - else - { - TableToInstall = MappedTable; - Flags = ACPI_TABLE_ORIGIN_MAPPED; - } - - /* Initialize the table entry */ - - AcpiGbl_RootTableList.Tables[TableIndex].Address = Address; - AcpiGbl_RootTableList.Tables[TableIndex].Length = TableToInstall->Length; - AcpiGbl_RootTableList.Tables[TableIndex].Flags = Flags; - - ACPI_MOVE_32_TO_32 ( - &(AcpiGbl_RootTableList.Tables[TableIndex].Signature), - TableToInstall->Signature); - - AcpiTbPrintTableHeader (Address, TableToInstall); - - if (TableIndex == ACPI_TABLE_INDEX_DSDT) - { - /* Global integer width is based upon revision of the DSDT */ - - AcpiUtSetIntegerWidth (TableToInstall->Revision); - } - -UnmapAndExit: - AcpiOsUnmapMemory (MappedTable, sizeof (ACPI_TABLE_HEADER)); -} - - /******************************************************************************* * * FUNCTION: AcpiTbGetRootTableEntry @@ -611,7 +313,7 @@ AcpiTbGetRootTableEntry ( * Get the table physical address (32-bit for RSDT, 64-bit for XSDT): * Note: Addresses are 32-bit aligned (not 64) in both RSDT and XSDT */ - if (TableEntrySize == sizeof (UINT32)) + if (TableEntrySize == ACPI_RSDT_ENTRY_SIZE) { /* * 32-bit platform, RSDT: Return 32-bit table entry @@ -633,7 +335,7 @@ AcpiTbGetRootTableEntry ( { /* Will truncate 64-bit address to 32 bits, issue warning */ - ACPI_WARNING ((AE_INFO, + ACPI_BIOS_WARNING ((AE_INFO, "64-bit Physical Address in XSDT is too large (0x%8.8X%8.8X)," " truncating", ACPI_FORMAT_UINT64 (Address64))); @@ -644,6 +346,92 @@ AcpiTbGetRootTableEntry ( } +/******************************************************************************* + * + * FUNCTION: AcpiTbValidateXsdt + * + * PARAMETERS: Address - Physical address of the XSDT (from RSDP) + * + * RETURN: Status. AE_OK if the table appears to be valid. + * + * DESCRIPTION: Validate an XSDT to ensure that it is of minimum size and does + * not contain any NULL entries. A problem that is seen in the + * field is that the XSDT exists, but is actually useless because + * of one or more (or all) NULL entries. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiTbValidateXsdt ( + ACPI_PHYSICAL_ADDRESS XsdtAddress) +{ + ACPI_TABLE_HEADER *Table; + UINT8 *NextEntry; + ACPI_PHYSICAL_ADDRESS Address; + UINT32 Length; + UINT32 EntryCount; + ACPI_STATUS Status; + UINT32 i; + + + /* Get the XSDT length */ + + Table = AcpiOsMapMemory (XsdtAddress, sizeof (ACPI_TABLE_HEADER)); + if (!Table) + { + return (AE_NO_MEMORY); + } + + Length = Table->Length; + AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER)); + + /* + * Minimum XSDT length is the size of the standard ACPI header + * plus one physical address entry + */ + if (Length < (sizeof (ACPI_TABLE_HEADER) + ACPI_XSDT_ENTRY_SIZE)) + { + return (AE_INVALID_TABLE_LENGTH); + } + + /* Map the entire XSDT */ + + Table = AcpiOsMapMemory (XsdtAddress, Length); + if (!Table) + { + return (AE_NO_MEMORY); + } + + /* Get the number of entries and pointer to first entry */ + + Status = AE_OK; + NextEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER)); + EntryCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) / + ACPI_XSDT_ENTRY_SIZE); + + /* Validate each entry (physical address) within the XSDT */ + + for (i = 0; i < EntryCount; i++) + { + Address = AcpiTbGetRootTableEntry (NextEntry, ACPI_XSDT_ENTRY_SIZE); + if (!Address) + { + /* Detected a NULL entry, XSDT is invalid */ + + Status = AE_NULL_ENTRY; + break; + } + + NextEntry += ACPI_XSDT_ENTRY_SIZE; + } + + /* Unmap table */ + + AcpiOsUnmapMemory (Table, Length); + return (Status); +} + + /******************************************************************************* * * FUNCTION: AcpiTbParseRootTable @@ -674,14 +462,14 @@ AcpiTbParseRootTable ( UINT32 Length; UINT8 *TableEntry; ACPI_STATUS Status; + UINT32 TableIndex; ACPI_FUNCTION_TRACE (TbParseRootTable); - /* - * Map the entire RSDP and extract the address of the RSDT or XSDT - */ + /* Map the entire RSDP and extract the address of the RSDT or XSDT */ + Rsdp = AcpiOsMapMemory (RsdpAddress, sizeof (ACPI_TABLE_RSDP)); if (!Rsdp) { @@ -691,24 +479,26 @@ AcpiTbParseRootTable ( AcpiTbPrintTableHeader (RsdpAddress, ACPI_CAST_PTR (ACPI_TABLE_HEADER, Rsdp)); - /* Differentiate between RSDT and XSDT root tables */ + /* Use XSDT if present and not overridden. Otherwise, use RSDT */ - if (Rsdp->Revision > 1 && Rsdp->XsdtPhysicalAddress) + if ((Rsdp->Revision > 1) && + Rsdp->XsdtPhysicalAddress && + !AcpiGbl_DoNotUseXsdt) { /* - * Root table is an XSDT (64-bit physical addresses). We must use the - * XSDT if the revision is > 1 and the XSDT pointer is present, as per - * the ACPI specification. + * RSDP contains an XSDT (64-bit physical addresses). We must use + * the XSDT if the revision is > 1 and the XSDT pointer is present, + * as per the ACPI specification. */ Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->XsdtPhysicalAddress; - TableEntrySize = sizeof (UINT64); + TableEntrySize = ACPI_XSDT_ENTRY_SIZE; } else { /* Root table is an RSDT (32-bit physical addresses) */ Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress; - TableEntrySize = sizeof (UINT32); + TableEntrySize = ACPI_RSDT_ENTRY_SIZE; } /* @@ -717,6 +507,24 @@ AcpiTbParseRootTable ( */ AcpiOsUnmapMemory (Rsdp, sizeof (ACPI_TABLE_RSDP)); + /* + * If it is present and used, validate the XSDT for access/size + * and ensure that all table entries are at least non-NULL + */ + if (TableEntrySize == ACPI_XSDT_ENTRY_SIZE) + { + Status = AcpiTbValidateXsdt (Address); + if (ACPI_FAILURE (Status)) + { + ACPI_BIOS_WARNING ((AE_INFO, "XSDT is invalid (%s), using RSDT", + AcpiFormatException (Status))); + + /* Fall back to the RSDT */ + + Address = (ACPI_PHYSICAL_ADDRESS) Rsdp->RsdtPhysicalAddress; + TableEntrySize = ACPI_RSDT_ENTRY_SIZE; + } + } /* Map the RSDT/XSDT table header to get the full table length */ @@ -728,14 +536,17 @@ AcpiTbParseRootTable ( AcpiTbPrintTableHeader (Address, Table); - /* Get the length of the full table, verify length and map entire table */ - + /* + * Validate length of the table, and map entire table. + * Minimum length table must contain at least one entry. + */ Length = Table->Length; AcpiOsUnmapMemory (Table, sizeof (ACPI_TABLE_HEADER)); - if (Length < sizeof (ACPI_TABLE_HEADER)) + if (Length < (sizeof (ACPI_TABLE_HEADER) + TableEntrySize)) { - ACPI_ERROR ((AE_INFO, "Invalid length 0x%X in RSDT/XSDT", Length)); + ACPI_BIOS_ERROR ((AE_INFO, + "Invalid table length 0x%X in RSDT/XSDT", Length)); return_ACPI_STATUS (AE_INVALID_TABLE_LENGTH); } @@ -754,46 +565,37 @@ AcpiTbParseRootTable ( return_ACPI_STATUS (Status); } - /* Calculate the number of tables described in the root table */ + /* Get the number of entries and pointer to first entry */ TableCount = (UINT32) ((Table->Length - sizeof (ACPI_TABLE_HEADER)) / TableEntrySize); + TableEntry = ACPI_ADD_PTR (UINT8, Table, sizeof (ACPI_TABLE_HEADER)); /* * First two entries in the table array are reserved for the DSDT * and FACS, which are not actually present in the RSDT/XSDT - they * come from the FADT */ - TableEntry = ACPI_CAST_PTR (UINT8, Table) + sizeof (ACPI_TABLE_HEADER); AcpiGbl_RootTableList.CurrentTableCount = 2; - /* - * Initialize the root table array from the RSDT/XSDT - */ + /* Initialize the root table array from the RSDT/XSDT */ + for (i = 0; i < TableCount; i++) { - if (AcpiGbl_RootTableList.CurrentTableCount >= - AcpiGbl_RootTableList.MaxTableCount) - { - /* There is no more room in the root table array, attempt resize */ - - Status = AcpiTbResizeRootTableList (); - if (ACPI_FAILURE (Status)) - { - ACPI_WARNING ((AE_INFO, "Truncating %u table entries!", - (unsigned) (TableCount - - (AcpiGbl_RootTableList.CurrentTableCount - 2)))); - break; - } - } - /* Get the table physical address (32-bit for RSDT, 64-bit for XSDT) */ - AcpiGbl_RootTableList.Tables[AcpiGbl_RootTableList.CurrentTableCount].Address = - AcpiTbGetRootTableEntry (TableEntry, TableEntrySize); + Status = AcpiTbInstallStandardTable ( + AcpiTbGetRootTableEntry (TableEntry, TableEntrySize), + ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL, FALSE, TRUE, &TableIndex); + + if (ACPI_SUCCESS (Status) && + ACPI_COMPARE_NAME (&AcpiGbl_RootTableList.Tables[TableIndex].Signature, + ACPI_SIG_FADT)) + { + AcpiTbParseFadt (TableIndex); + } TableEntry += TableEntrySize; - AcpiGbl_RootTableList.CurrentTableCount++; } /* @@ -802,23 +604,5 @@ AcpiTbParseRootTable ( */ AcpiOsUnmapMemory (Table, Length); - /* - * Complete the initialization of the root table array by examining - * the header of each table - */ - for (i = 2; i < AcpiGbl_RootTableList.CurrentTableCount; i++) - { - AcpiTbInstallTable (AcpiGbl_RootTableList.Tables[i].Address, - NULL, i); - - /* Special case for FADT - get the DSDT and FACS */ - - if (ACPI_COMPARE_NAME ( - &AcpiGbl_RootTableList.Tables[i].Signature, ACPI_SIG_FADT)) - { - AcpiTbParseFadt (i); - } - } - return_ACPI_STATUS (AE_OK); } diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbxface.c b/reactos/drivers/bus/acpi/acpica/tables/tbxface.c index 507ea0bd683..cbdede5204b 100644 --- a/reactos/drivers/bus/acpi/acpica/tables/tbxface.c +++ b/reactos/drivers/bus/acpi/acpica/tables/tbxface.c @@ -1,7 +1,6 @@ /****************************************************************************** * - * Module Name: tbxface - Public interfaces to the ACPI subsystem - * ACPI table oriented interfaces + * Module Name: tbxface - ACPI table-oriented external interfaces * *****************************************************************************/ @@ -9,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -32,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -44,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -56,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -81,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -93,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -115,21 +114,15 @@ *****************************************************************************/ #define __TBXFACE_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" -#include "acnamesp.h" #include "actables.h" #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbxface") -/* Local prototypes */ - -static ACPI_STATUS -AcpiTbLoadNamespace ( - void); - /******************************************************************************* * @@ -166,7 +159,7 @@ AcpiAllocateRootTable ( * array is dynamically allocated. * InitialTableCount - Size of InitialTableArray, in number of * ACPI_TABLE_DESC structures - * AllowRealloc - Flag to tell Table Manager if resize of + * AllowResize - Flag to tell Table Manager if resize of * pre-allocated array is allowed. Ignored * if InitialTableArray is NULL. * @@ -197,8 +190,8 @@ AcpiInitializeTables ( /* - * Set up the Root Table Array - * Allocate the table array if requested + * Setup the Root Table Array and allocate the table array + * if requested */ if (!InitialTableArray) { @@ -241,7 +234,7 @@ AcpiInitializeTables ( return_ACPI_STATUS (Status); } -ACPI_EXPORT_SYMBOL (AcpiInitializeTables) +ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeTables) /******************************************************************************* @@ -255,7 +248,7 @@ ACPI_EXPORT_SYMBOL (AcpiInitializeTables) * DESCRIPTION: Reallocate Root Table List into dynamic memory. Copies the * root list from the previously provided scratch area. Should * be called once dynamic memory allocation is available in the - * kernel + * kernel. * ******************************************************************************/ @@ -263,9 +256,7 @@ ACPI_STATUS AcpiReallocateRootTable ( void) { - ACPI_TABLE_DESC *Tables; - ACPI_SIZE NewSize; - ACPI_SIZE CurrentSize; + ACPI_STATUS Status; ACPI_FUNCTION_TRACE (AcpiReallocateRootTable); @@ -280,41 +271,13 @@ AcpiReallocateRootTable ( return_ACPI_STATUS (AE_SUPPORT); } - /* - * Get the current size of the root table and add the default - * increment to create the new table size. - */ - CurrentSize = (ACPI_SIZE) - AcpiGbl_RootTableList.CurrentTableCount * sizeof (ACPI_TABLE_DESC); + AcpiGbl_RootTableList.Flags |= ACPI_ROOT_ALLOW_RESIZE; - NewSize = CurrentSize + - (ACPI_ROOT_TABLE_SIZE_INCREMENT * sizeof (ACPI_TABLE_DESC)); - - /* Create new array and copy the old array */ - - Tables = ACPI_ALLOCATE_ZEROED (NewSize); - if (!Tables) - { - return_ACPI_STATUS (AE_NO_MEMORY); - } - - ACPI_MEMCPY (Tables, AcpiGbl_RootTableList.Tables, CurrentSize); - - /* - * Update the root table descriptor. The new size will be the current - * number of tables plus the increment, independent of the reserved - * size of the original table list. - */ - AcpiGbl_RootTableList.Tables = Tables; - AcpiGbl_RootTableList.MaxTableCount = - AcpiGbl_RootTableList.CurrentTableCount + ACPI_ROOT_TABLE_SIZE_INCREMENT; - AcpiGbl_RootTableList.Flags = - ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE; - - return_ACPI_STATUS (AE_OK); + Status = AcpiTbResizeRootTableList (); + return_ACPI_STATUS (Status); } -ACPI_EXPORT_SYMBOL (AcpiReallocateRootTable) +ACPI_EXPORT_SYMBOL_INIT (AcpiReallocateRootTable) /******************************************************************************* @@ -371,29 +334,30 @@ AcpiGetTableHeader ( { if ((AcpiGbl_RootTableList.Tables[i].Flags & ACPI_TABLE_ORIGIN_MASK) == - ACPI_TABLE_ORIGIN_MAPPED) + ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL) { Header = AcpiOsMapMemory ( AcpiGbl_RootTableList.Tables[i].Address, sizeof (ACPI_TABLE_HEADER)); if (!Header) { - return AE_NO_MEMORY; + return (AE_NO_MEMORY); } - ACPI_MEMCPY (OutTableHeader, Header, sizeof(ACPI_TABLE_HEADER)); - AcpiOsUnmapMemory (Header, sizeof(ACPI_TABLE_HEADER)); + ACPI_MEMCPY (OutTableHeader, Header, + sizeof (ACPI_TABLE_HEADER)); + AcpiOsUnmapMemory (Header, sizeof (ACPI_TABLE_HEADER)); } else { - return AE_NOT_FOUND; + return (AE_NOT_FOUND); } } else { ACPI_MEMCPY (OutTableHeader, AcpiGbl_RootTableList.Tables[i].Pointer, - sizeof(ACPI_TABLE_HEADER)); + sizeof (ACPI_TABLE_HEADER)); } return (AE_OK); @@ -413,9 +377,10 @@ ACPI_EXPORT_SYMBOL (AcpiGetTableHeader) * Instance - Which instance (for SSDTs) * OutTable - Where the pointer to the table is returned * - * RETURN: Status and pointer to table + * RETURN: Status and pointer to the requested table * - * DESCRIPTION: Finds and verifies an ACPI table. + * DESCRIPTION: Finds and verifies an ACPI table. Table must be in the + * RSDT/XSDT. * ******************************************************************************/ @@ -452,7 +417,7 @@ AcpiGetTable ( continue; } - Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[i]); + Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[i]); if (ACPI_SUCCESS (Status)) { *OutTable = AcpiGbl_RootTableList.Tables[i].Pointer; @@ -474,9 +439,10 @@ ACPI_EXPORT_SYMBOL (AcpiGetTable) * PARAMETERS: TableIndex - Table index * Table - Where the pointer to the table is returned * - * RETURN: Status and pointer to the table + * RETURN: Status and pointer to the requested table * - * DESCRIPTION: Obtain a table by an index into the global table list. + * DESCRIPTION: Obtain a table by an index into the global table list. Used + * internally also. * ******************************************************************************/ @@ -512,7 +478,7 @@ AcpiGetTableByIndex ( { /* Table is not mapped, map it */ - Status = AcpiTbVerifyTable (&AcpiGbl_RootTableList.Tables[TableIndex]); + Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]); if (ACPI_FAILURE (Status)) { (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); @@ -528,155 +494,6 @@ AcpiGetTableByIndex ( ACPI_EXPORT_SYMBOL (AcpiGetTableByIndex) -/******************************************************************************* - * - * FUNCTION: AcpiTbLoadNamespace - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in - * the RSDT/XSDT. - * - ******************************************************************************/ - -static ACPI_STATUS -AcpiTbLoadNamespace ( - void) -{ - ACPI_STATUS Status; - UINT32 i; - ACPI_TABLE_HEADER *NewDsdt; - - - ACPI_FUNCTION_TRACE (TbLoadNamespace); - - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - - /* - * Load the namespace. The DSDT is required, but any SSDT and - * PSDT tables are optional. Verify the DSDT. - */ - if (!AcpiGbl_RootTableList.CurrentTableCount || - !ACPI_COMPARE_NAME ( - &(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature), - ACPI_SIG_DSDT) || - ACPI_FAILURE (AcpiTbVerifyTable ( - &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT]))) - { - Status = AE_NO_ACPI_TABLES; - goto UnlockAndExit; - } - - /* - * Save the DSDT pointer for simple access. This is the mapped memory - * address. We must take care here because the address of the .Tables - * array can change dynamically as tables are loaded at run-time. Note: - * .Pointer field is not validated until after call to AcpiTbVerifyTable. - */ - AcpiGbl_DSDT = AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer; - - /* - * Optionally copy the entire DSDT to local memory (instead of simply - * mapping it.) There are some BIOSs that corrupt or replace the original - * DSDT, creating the need for this option. Default is FALSE, do not copy - * the DSDT. - */ - if (AcpiGbl_CopyDsdtLocally) - { - NewDsdt = AcpiTbCopyDsdt (ACPI_TABLE_INDEX_DSDT); - if (NewDsdt) - { - AcpiGbl_DSDT = NewDsdt; - } - } - - /* - * Save the original DSDT header for detection of table corruption - * and/or replacement of the DSDT from outside the OS. - */ - ACPI_MEMCPY (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT, - sizeof (ACPI_TABLE_HEADER)); - - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - - /* Load and parse tables */ - - Status = AcpiNsLoadTable (ACPI_TABLE_INDEX_DSDT, AcpiGbl_RootNode); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ - - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) - { - if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), - ACPI_SIG_SSDT) && - !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), - ACPI_SIG_PSDT)) || - ACPI_FAILURE (AcpiTbVerifyTable ( - &AcpiGbl_RootTableList.Tables[i]))) - { - continue; - } - - /* Ignore errors while loading tables, get as many as possible */ - - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - (void) AcpiNsLoadTable (i, AcpiGbl_RootNode); - (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); - } - - ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "ACPI Tables successfully acquired\n")); - -UnlockAndExit: - (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiLoadTables - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT - * - ******************************************************************************/ - -ACPI_STATUS -AcpiLoadTables ( - void) -{ - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiLoadTables); - - - /* Load the namespace from the tables */ - - Status = AcpiTbLoadNamespace (); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, - "While loading namespace from ACPI tables")); - } - - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiLoadTables) - - /******************************************************************************* * * FUNCTION: AcpiInstallTableHandler @@ -686,7 +503,7 @@ ACPI_EXPORT_SYMBOL (AcpiLoadTables) * * RETURN: Status * - * DESCRIPTION: Install table event handler + * DESCRIPTION: Install a global table event handler. * ******************************************************************************/ @@ -742,7 +559,7 @@ ACPI_EXPORT_SYMBOL (AcpiInstallTableHandler) * * RETURN: Status * - * DESCRIPTION: Remove table event handler + * DESCRIPTION: Remove a table event handler * ******************************************************************************/ @@ -781,4 +598,3 @@ Cleanup: } ACPI_EXPORT_SYMBOL (AcpiRemoveTableHandler) - diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbxfload.c b/reactos/drivers/bus/acpi/acpica/tables/tbxfload.c new file mode 100644 index 00000000000..77c1be6df96 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/tables/tbxfload.c @@ -0,0 +1,533 @@ +/****************************************************************************** + * + * Module Name: tbxfload - Table load/unload external interfaces + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __TBXFLOAD_C__ +#define EXPORT_ACPI_INTERFACES + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" +#include "actables.h" + +#define _COMPONENT ACPI_TABLES + ACPI_MODULE_NAME ("tbxfload") + +/* Local prototypes */ + +static ACPI_STATUS +AcpiTbLoadNamespace ( + void); + + +/******************************************************************************* + * + * FUNCTION: AcpiLoadTables + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Load the ACPI tables from the RSDT/XSDT + * + ******************************************************************************/ + +ACPI_STATUS +AcpiLoadTables ( + void) +{ + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiLoadTables); + + + /* Load the namespace from the tables */ + + Status = AcpiTbLoadNamespace (); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, + "While loading namespace from ACPI tables")); + } + + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL_INIT (AcpiLoadTables) + + +/******************************************************************************* + * + * FUNCTION: AcpiTbLoadNamespace + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Load the namespace from the DSDT and all SSDTs/PSDTs found in + * the RSDT/XSDT. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiTbLoadNamespace ( + void) +{ + ACPI_STATUS Status; + UINT32 i; + ACPI_TABLE_HEADER *NewDsdt; + + + ACPI_FUNCTION_TRACE (TbLoadNamespace); + + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + + /* + * Load the namespace. The DSDT is required, but any SSDT and + * PSDT tables are optional. Verify the DSDT. + */ + if (!AcpiGbl_RootTableList.CurrentTableCount || + !ACPI_COMPARE_NAME ( + &(AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Signature), + ACPI_SIG_DSDT) || + ACPI_FAILURE (AcpiTbValidateTable ( + &AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT]))) + { + Status = AE_NO_ACPI_TABLES; + goto UnlockAndExit; + } + + /* + * Save the DSDT pointer for simple access. This is the mapped memory + * address. We must take care here because the address of the .Tables + * array can change dynamically as tables are loaded at run-time. Note: + * .Pointer field is not validated until after call to AcpiTbValidateTable. + */ + AcpiGbl_DSDT = AcpiGbl_RootTableList.Tables[ACPI_TABLE_INDEX_DSDT].Pointer; + + /* + * Optionally copy the entire DSDT to local memory (instead of simply + * mapping it.) There are some BIOSs that corrupt or replace the original + * DSDT, creating the need for this option. Default is FALSE, do not copy + * the DSDT. + */ + if (AcpiGbl_CopyDsdtLocally) + { + NewDsdt = AcpiTbCopyDsdt (ACPI_TABLE_INDEX_DSDT); + if (NewDsdt) + { + AcpiGbl_DSDT = NewDsdt; + } + } + + /* + * Save the original DSDT header for detection of table corruption + * and/or replacement of the DSDT from outside the OS. + */ + ACPI_MEMCPY (&AcpiGbl_OriginalDsdtHeader, AcpiGbl_DSDT, + sizeof (ACPI_TABLE_HEADER)); + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + + /* Load and parse tables */ + + Status = AcpiNsLoadTable (ACPI_TABLE_INDEX_DSDT, AcpiGbl_RootNode); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Load any SSDT or PSDT tables. Note: Loop leaves tables locked */ + + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; ++i) + { + if ((!ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), + ACPI_SIG_SSDT) && + !ACPI_COMPARE_NAME (&(AcpiGbl_RootTableList.Tables[i].Signature), + ACPI_SIG_PSDT)) || + ACPI_FAILURE (AcpiTbValidateTable ( + &AcpiGbl_RootTableList.Tables[i]))) + { + continue; + } + + /* Ignore errors while loading tables, get as many as possible */ + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + (void) AcpiNsLoadTable (i, AcpiGbl_RootNode); + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + } + + ACPI_INFO ((AE_INFO, "All ACPI Tables successfully acquired")); + +UnlockAndExit: + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiInstallTable + * + * PARAMETERS: Address - Address of the ACPI table to be installed. + * Physical - Whether the address is a physical table + * address or not + * + * RETURN: Status + * + * DESCRIPTION: Dynamically install an ACPI table. + * Note: This function should only be invoked after + * AcpiInitializeTables() and before AcpiLoadTables(). + * + ******************************************************************************/ + +ACPI_STATUS +AcpiInstallTable ( + ACPI_PHYSICAL_ADDRESS Address, + BOOLEAN Physical) +{ + ACPI_STATUS Status; + UINT8 Flags; + UINT32 TableIndex; + + + ACPI_FUNCTION_TRACE (AcpiInstallTable); + + + if (Physical) + { + Flags = ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL; + } + else + { + Flags = ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL; + } + + Status = AcpiTbInstallStandardTable (Address, Flags, + FALSE, FALSE, &TableIndex); + + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL_INIT (AcpiInstallTable) + + +/******************************************************************************* + * + * FUNCTION: AcpiLoadTable + * + * PARAMETERS: Table - Pointer to a buffer containing the ACPI + * table to be loaded. + * + * RETURN: Status + * + * DESCRIPTION: Dynamically load an ACPI table from the caller's buffer. Must + * be a valid ACPI table with a valid ACPI table header. + * Note1: Mainly intended to support hotplug addition of SSDTs. + * Note2: Does not copy the incoming table. User is responsible + * to ensure that the table is not deleted or unmapped. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiLoadTable ( + ACPI_TABLE_HEADER *Table) +{ + ACPI_STATUS Status; + UINT32 TableIndex; + + + ACPI_FUNCTION_TRACE (AcpiLoadTable); + + + /* Parameter validation */ + + if (!Table) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + /* Must acquire the interpreter lock during this operation */ + + Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Install the table and load it into the namespace */ + + ACPI_INFO ((AE_INFO, "Host-directed Dynamic ACPI Table Load:")); + (void) AcpiUtAcquireMutex (ACPI_MTX_TABLES); + + Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table), + ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL, TRUE, FALSE, + &TableIndex); + + (void) AcpiUtReleaseMutex (ACPI_MTX_TABLES); + if (ACPI_FAILURE (Status)) + { + goto UnlockAndExit; + } + + /* + * Note: Now table is "INSTALLED", it must be validated before + * using. + */ + Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]); + if (ACPI_FAILURE (Status)) + { + goto UnlockAndExit; + } + + Status = AcpiNsLoadTable (TableIndex, AcpiGbl_RootNode); + + /* Invoke table handler if present */ + + if (AcpiGbl_TableHandler) + { + (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table, + AcpiGbl_TableHandlerContext); + } + +UnlockAndExit: + (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiLoadTable) + + +/******************************************************************************* + * + * FUNCTION: AcpiUnloadParentTable + * + * PARAMETERS: Object - Handle to any namespace object owned by + * the table to be unloaded + * + * RETURN: Status + * + * DESCRIPTION: Via any namespace object within an SSDT or OEMx table, unloads + * the table and deletes all namespace objects associated with + * that table. Unloading of the DSDT is not allowed. + * Note: Mainly intended to support hotplug removal of SSDTs. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUnloadParentTable ( + ACPI_HANDLE Object) +{ + ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Object); + ACPI_STATUS Status = AE_NOT_EXIST; + ACPI_OWNER_ID OwnerId; + UINT32 i; + + + ACPI_FUNCTION_TRACE (AcpiUnloadParentTable); + + + /* Parameter validation */ + + if (!Object) + { + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + /* + * The node OwnerId is currently the same as the parent table ID. + * However, this could change in the future. + */ + OwnerId = Node->OwnerId; + if (!OwnerId) + { + /* OwnerId==0 means DSDT is the owner. DSDT cannot be unloaded */ + + return_ACPI_STATUS (AE_TYPE); + } + + /* Must acquire the interpreter lock during this operation */ + + Status = AcpiUtAcquireMutex (ACPI_MTX_INTERPRETER); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Find the table in the global table list */ + + for (i = 0; i < AcpiGbl_RootTableList.CurrentTableCount; i++) + { + if (OwnerId != AcpiGbl_RootTableList.Tables[i].OwnerId) + { + continue; + } + + /* + * Allow unload of SSDT and OEMx tables only. Do not allow unload + * of the DSDT. No other types of tables should get here, since + * only these types can contain AML and thus are the only types + * that can create namespace objects. + */ + if (ACPI_COMPARE_NAME ( + AcpiGbl_RootTableList.Tables[i].Signature.Ascii, + ACPI_SIG_DSDT)) + { + Status = AE_TYPE; + break; + } + + /* Ensure the table is actually loaded */ + + if (!AcpiTbIsTableLoaded (i)) + { + Status = AE_NOT_EXIST; + break; + } + + /* Invoke table handler if present */ + + if (AcpiGbl_TableHandler) + { + (void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_UNLOAD, + AcpiGbl_RootTableList.Tables[i].Pointer, + AcpiGbl_TableHandlerContext); + } + + /* + * Delete all namespace objects owned by this table. Note that + * these objects can appear anywhere in the namespace by virtue + * of the AML "Scope" operator. Thus, we need to track ownership + * by an ID, not simply a position within the hierarchy. + */ + Status = AcpiTbDeleteNamespaceByOwner (i); + if (ACPI_FAILURE (Status)) + { + break; + } + + Status = AcpiTbReleaseOwnerId (i); + AcpiTbSetTableLoadedFlag (i, FALSE); + break; + } + + (void) AcpiUtReleaseMutex (ACPI_MTX_INTERPRETER); + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL (AcpiUnloadParentTable) diff --git a/reactos/drivers/bus/acpi/acpica/tables/tbxfroot.c b/reactos/drivers/bus/acpi/acpica/tables/tbxfroot.c index 7319a18376d..81d08a956dd 100644 --- a/reactos/drivers/bus/acpi/acpica/tables/tbxfroot.c +++ b/reactos/drivers/bus/acpi/acpica/tables/tbxfroot.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -123,17 +123,6 @@ #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbxfroot") -/* Local prototypes */ - -static UINT8 * -AcpiTbScanMemoryForRsdp ( - UINT8 *StartAddress, - UINT32 Length); - -static ACPI_STATUS -AcpiTbValidateRsdp ( - ACPI_TABLE_RSDP *Rsdp); - /******************************************************************************* * @@ -147,12 +136,10 @@ AcpiTbValidateRsdp ( * ******************************************************************************/ -static ACPI_STATUS +ACPI_STATUS AcpiTbValidateRsdp ( ACPI_TABLE_RSDP *Rsdp) { - ACPI_FUNCTION_ENTRY (); - /* * The signature and checksum must both be correct @@ -160,8 +147,7 @@ AcpiTbValidateRsdp ( * Note: Sometimes there exists more than one RSDP in memory; the valid * RSDP has a valid checksum, all others have an invalid checksum. */ - if (ACPI_STRNCMP ((char *) Rsdp, ACPI_SIG_RSDP, - sizeof (ACPI_SIG_RSDP)-1) != 0) + if (!ACPI_VALIDATE_RSDP_SIG (Rsdp->Signature)) { /* Nope, BAD Signature */ @@ -196,7 +182,7 @@ AcpiTbValidateRsdp ( * RETURN: Status, RSDP physical address * * DESCRIPTION: Search lower 1Mbyte of memory for the root system descriptor - * pointer structure. If it is found, set *RSDP to point to it. + * pointer structure. If it is found, set *RSDP to point to it. * * NOTE1: The RSDP must be either in the first 1K of the Extended * BIOS Data Area or between E0000 and FFFFF (From ACPI Spec.) @@ -306,7 +292,7 @@ AcpiFindRootPointer ( /* A valid RSDP was not found */ - ACPI_ERROR ((AE_INFO, "A valid RSDP was not found")); + ACPI_BIOS_ERROR ((AE_INFO, "A valid RSDP was not found")); return_ACPI_STATUS (AE_NOT_FOUND); } @@ -326,7 +312,7 @@ ACPI_EXPORT_SYMBOL (AcpiFindRootPointer) * ******************************************************************************/ -static UINT8 * +UINT8 * AcpiTbScanMemoryForRsdp ( UINT8 *StartAddress, UINT32 Length) @@ -368,4 +354,3 @@ AcpiTbScanMemoryForRsdp ( StartAddress)); return_PTR (NULL); } - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utaddress.c b/reactos/drivers/bus/acpi/acpica/utilities/utaddress.c new file mode 100644 index 00000000000..750f47c794e --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/utilities/utaddress.c @@ -0,0 +1,398 @@ +/****************************************************************************** + * + * Module Name: utaddress - OpRegion address range check + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __UTADDRESS_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" + + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utaddress") + + +/******************************************************************************* + * + * FUNCTION: AcpiUtAddAddressRange + * + * PARAMETERS: SpaceId - Address space ID + * Address - OpRegion start address + * Length - OpRegion length + * RegionNode - OpRegion namespace node + * + * RETURN: Status + * + * DESCRIPTION: Add the Operation Region address range to the global list. + * The only supported Space IDs are Memory and I/O. Called when + * the OpRegion address/length operands are fully evaluated. + * + * MUTEX: Locks the namespace + * + * NOTE: Because this interface is only called when an OpRegion argument + * list is evaluated, there cannot be any duplicate RegionNodes. + * Duplicate Address/Length values are allowed, however, so that multiple + * address conflicts can be detected. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUtAddAddressRange ( + ACPI_ADR_SPACE_TYPE SpaceId, + ACPI_PHYSICAL_ADDRESS Address, + UINT32 Length, + ACPI_NAMESPACE_NODE *RegionNode) +{ + ACPI_ADDRESS_RANGE *RangeInfo; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (UtAddAddressRange); + + + if ((SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) && + (SpaceId != ACPI_ADR_SPACE_SYSTEM_IO)) + { + return_ACPI_STATUS (AE_OK); + } + + /* Allocate/init a new info block, add it to the appropriate list */ + + RangeInfo = ACPI_ALLOCATE (sizeof (ACPI_ADDRESS_RANGE)); + if (!RangeInfo) + { + return_ACPI_STATUS (AE_NO_MEMORY); + } + + RangeInfo->StartAddress = Address; + RangeInfo->EndAddress = (Address + Length - 1); + RangeInfo->RegionNode = RegionNode; + + Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (Status)) + { + ACPI_FREE (RangeInfo); + return_ACPI_STATUS (Status); + } + + RangeInfo->Next = AcpiGbl_AddressRangeList[SpaceId]; + AcpiGbl_AddressRangeList[SpaceId] = RangeInfo; + + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "\nAdded [%4.4s] address range: 0x%p-0x%p\n", + AcpiUtGetNodeName (RangeInfo->RegionNode), + ACPI_CAST_PTR (void, Address), + ACPI_CAST_PTR (void, RangeInfo->EndAddress))); + + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtRemoveAddressRange + * + * PARAMETERS: SpaceId - Address space ID + * RegionNode - OpRegion namespace node + * + * RETURN: None + * + * DESCRIPTION: Remove the Operation Region from the global list. The only + * supported Space IDs are Memory and I/O. Called when an + * OpRegion is deleted. + * + * MUTEX: Assumes the namespace is locked + * + ******************************************************************************/ + +void +AcpiUtRemoveAddressRange ( + ACPI_ADR_SPACE_TYPE SpaceId, + ACPI_NAMESPACE_NODE *RegionNode) +{ + ACPI_ADDRESS_RANGE *RangeInfo; + ACPI_ADDRESS_RANGE *Prev; + + + ACPI_FUNCTION_TRACE (UtRemoveAddressRange); + + + if ((SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) && + (SpaceId != ACPI_ADR_SPACE_SYSTEM_IO)) + { + return_VOID; + } + + /* Get the appropriate list head and check the list */ + + RangeInfo = Prev = AcpiGbl_AddressRangeList[SpaceId]; + while (RangeInfo) + { + if (RangeInfo->RegionNode == RegionNode) + { + if (RangeInfo == Prev) /* Found at list head */ + { + AcpiGbl_AddressRangeList[SpaceId] = RangeInfo->Next; + } + else + { + Prev->Next = RangeInfo->Next; + } + + ACPI_DEBUG_PRINT ((ACPI_DB_NAMES, + "\nRemoved [%4.4s] address range: 0x%p-0x%p\n", + AcpiUtGetNodeName (RangeInfo->RegionNode), + ACPI_CAST_PTR (void, RangeInfo->StartAddress), + ACPI_CAST_PTR (void, RangeInfo->EndAddress))); + + ACPI_FREE (RangeInfo); + return_VOID; + } + + Prev = RangeInfo; + RangeInfo = RangeInfo->Next; + } + + return_VOID; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtCheckAddressRange + * + * PARAMETERS: SpaceId - Address space ID + * Address - Start address + * Length - Length of address range + * Warn - TRUE if warning on overlap desired + * + * RETURN: Count of the number of conflicts detected. Zero is always + * returned for Space IDs other than Memory or I/O. + * + * DESCRIPTION: Check if the input address range overlaps any of the + * ASL operation region address ranges. The only supported + * Space IDs are Memory and I/O. + * + * MUTEX: Assumes the namespace is locked. + * + ******************************************************************************/ + +UINT32 +AcpiUtCheckAddressRange ( + ACPI_ADR_SPACE_TYPE SpaceId, + ACPI_PHYSICAL_ADDRESS Address, + UINT32 Length, + BOOLEAN Warn) +{ + ACPI_ADDRESS_RANGE *RangeInfo; + ACPI_PHYSICAL_ADDRESS EndAddress; + char *Pathname; + UINT32 OverlapCount = 0; + + + ACPI_FUNCTION_TRACE (UtCheckAddressRange); + + + if ((SpaceId != ACPI_ADR_SPACE_SYSTEM_MEMORY) && + (SpaceId != ACPI_ADR_SPACE_SYSTEM_IO)) + { + return_UINT32 (0); + } + + RangeInfo = AcpiGbl_AddressRangeList[SpaceId]; + EndAddress = Address + Length - 1; + + /* Check entire list for all possible conflicts */ + + while (RangeInfo) + { + /* + * Check if the requested address/length overlaps this + * address range. There are four cases to consider: + * + * 1) Input address/length is contained completely in the + * address range + * 2) Input address/length overlaps range at the range start + * 3) Input address/length overlaps range at the range end + * 4) Input address/length completely encompasses the range + */ + if ((Address <= RangeInfo->EndAddress) && + (EndAddress >= RangeInfo->StartAddress)) + { + /* Found an address range overlap */ + + OverlapCount++; + if (Warn) /* Optional warning message */ + { + Pathname = AcpiNsGetExternalPathname (RangeInfo->RegionNode); + + ACPI_WARNING ((AE_INFO, + "%s range 0x%p-0x%p conflicts with OpRegion 0x%p-0x%p (%s)", + AcpiUtGetRegionName (SpaceId), + ACPI_CAST_PTR (void, Address), + ACPI_CAST_PTR (void, EndAddress), + ACPI_CAST_PTR (void, RangeInfo->StartAddress), + ACPI_CAST_PTR (void, RangeInfo->EndAddress), + Pathname)); + ACPI_FREE (Pathname); + } + } + + RangeInfo = RangeInfo->Next; + } + + return_UINT32 (OverlapCount); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtDeleteAddressLists + * + * PARAMETERS: None + * + * RETURN: None + * + * DESCRIPTION: Delete all global address range lists (called during + * subsystem shutdown). + * + ******************************************************************************/ + +void +AcpiUtDeleteAddressLists ( + void) +{ + ACPI_ADDRESS_RANGE *Next; + ACPI_ADDRESS_RANGE *RangeInfo; + int i; + + + /* Delete all elements in all address range lists */ + + for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++) + { + Next = AcpiGbl_AddressRangeList[i]; + + while (Next) + { + RangeInfo = Next; + Next = RangeInfo->Next; + ACPI_FREE (RangeInfo); + } + + AcpiGbl_AddressRangeList[i] = NULL; + } +} diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utalloc.c b/reactos/drivers/bus/acpi/acpica/utilities/utalloc.c index 7a276f82038..00345fcff78 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utalloc.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utalloc.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -123,6 +123,45 @@ ACPI_MODULE_NAME ("utalloc") +#if !defined (USE_NATIVE_ALLOCATE_ZEROED) +/******************************************************************************* + * + * FUNCTION: AcpiOsAllocateZeroed + * + * PARAMETERS: Size - Size of the allocation + * + * RETURN: Address of the allocated memory on success, NULL on failure. + * + * DESCRIPTION: Subsystem equivalent of calloc. Allocate and zero memory. + * This is the default implementation. Can be overridden via the + * USE_NATIVE_ALLOCATE_ZEROED flag. + * + ******************************************************************************/ + +void * +AcpiOsAllocateZeroed ( + ACPI_SIZE Size) +{ + void *Allocation; + + + ACPI_FUNCTION_ENTRY (); + + + Allocation = AcpiOsAllocate (Size); + if (Allocation) + { + /* Clear the memory block */ + + ACPI_MEMSET (Allocation, 0, Size); + } + + return (Allocation); +} + +#endif /* !USE_NATIVE_ALLOCATE_ZEROED */ + + /******************************************************************************* * * FUNCTION: AcpiUtCreateCaches @@ -357,9 +396,13 @@ AcpiUtInitializeBuffer ( return (AE_BUFFER_OVERFLOW); case ACPI_ALLOCATE_BUFFER: - - /* Allocate a new buffer */ - + /* + * Allocate a new buffer. We directectly call AcpiOsAllocate here to + * purposefully bypass the (optionally enabled) internal allocation + * tracking mechanism since we only want to track internal + * allocations. Note: The caller should use AcpiOsFree to free this + * buffer created via ACPI_ALLOCATE_BUFFER. + */ Buffer->Pointer = AcpiOsAllocate (RequiredLength); break; @@ -393,96 +436,3 @@ AcpiUtInitializeBuffer ( ACPI_MEMSET (Buffer->Pointer, 0, RequiredLength); return (AE_OK); } - - -/******************************************************************************* - * - * FUNCTION: AcpiUtAllocate - * - * PARAMETERS: Size - Size of the allocation - * Component - Component type of caller - * Module - Source file name of caller - * Line - Line number of caller - * - * RETURN: Address of the allocated memory on success, NULL on failure. - * - * DESCRIPTION: Subsystem equivalent of malloc. - * - ******************************************************************************/ - -void * -AcpiUtAllocate ( - ACPI_SIZE Size, - UINT32 Component, - const char *Module, - UINT32 Line) -{ - void *Allocation; - - - ACPI_FUNCTION_TRACE_U32 (UtAllocate, Size); - - - /* Check for an inadvertent size of zero bytes */ - - if (!Size) - { - ACPI_WARNING ((Module, Line, - "Attempt to allocate zero bytes, allocating 1 byte")); - Size = 1; - } - - Allocation = AcpiOsAllocate (Size); - if (!Allocation) - { - /* Report allocation error */ - - ACPI_WARNING ((Module, Line, - "Could not allocate size %u", (UINT32) Size)); - - return_PTR (NULL); - } - - return_PTR (Allocation); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtAllocateZeroed - * - * PARAMETERS: Size - Size of the allocation - * Component - Component type of caller - * Module - Source file name of caller - * Line - Line number of caller - * - * RETURN: Address of the allocated memory on success, NULL on failure. - * - * DESCRIPTION: Subsystem equivalent of calloc. Allocate and zero memory. - * - ******************************************************************************/ - -void * -AcpiUtAllocateZeroed ( - ACPI_SIZE Size, - UINT32 Component, - const char *Module, - UINT32 Line) -{ - void *Allocation; - - - ACPI_FUNCTION_ENTRY (); - - - Allocation = AcpiUtAllocate (Size, Component, Module, Line); - if (Allocation) - { - /* Clear the memory block */ - - ACPI_MEMSET (Allocation, 0, Size); - } - - return (Allocation); -} - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utbuffer.c b/reactos/drivers/bus/acpi/acpica/utilities/utbuffer.c new file mode 100644 index 00000000000..c241f7de3b0 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/utilities/utbuffer.c @@ -0,0 +1,292 @@ +/****************************************************************************** + * + * Module Name: utbuffer - Buffer dump routines + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __UTBUFFER_C__ + +#include "acpi.h" +#include "accommon.h" + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utbuffer") + + +/******************************************************************************* + * + * FUNCTION: AcpiUtDumpBuffer + * + * PARAMETERS: Buffer - Buffer to dump + * Count - Amount to dump, in bytes + * Display - BYTE, WORD, DWORD, or QWORD display: + * DB_BYTE_DISPLAY + * DB_WORD_DISPLAY + * DB_DWORD_DISPLAY + * DB_QWORD_DISPLAY + * BaseOffset - Beginning buffer offset (display only) + * + * RETURN: None + * + * DESCRIPTION: Generic dump buffer in both hex and ascii. + * + ******************************************************************************/ + +void +AcpiUtDumpBuffer ( + UINT8 *Buffer, + UINT32 Count, + UINT32 Display, + UINT32 BaseOffset) +{ + UINT32 i = 0; + UINT32 j; + UINT32 Temp32; + UINT8 BufChar; + + + if (!Buffer) + { + AcpiOsPrintf ("Null Buffer Pointer in DumpBuffer!\n"); + return; + } + + if ((Count < 4) || (Count & 0x01)) + { + Display = DB_BYTE_DISPLAY; + } + + /* Nasty little dump buffer routine! */ + + while (i < Count) + { + /* Print current offset */ + + AcpiOsPrintf ("%6.4X: ", (BaseOffset + i)); + + /* Print 16 hex chars */ + + for (j = 0; j < 16;) + { + if (i + j >= Count) + { + /* Dump fill spaces */ + + AcpiOsPrintf ("%*s", ((Display * 2) + 1), " "); + j += Display; + continue; + } + + switch (Display) + { + case DB_BYTE_DISPLAY: + default: /* Default is BYTE display */ + + AcpiOsPrintf ("%02X ", Buffer[(ACPI_SIZE) i + j]); + break; + + case DB_WORD_DISPLAY: + + ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); + AcpiOsPrintf ("%04X ", Temp32); + break; + + case DB_DWORD_DISPLAY: + + ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); + AcpiOsPrintf ("%08X ", Temp32); + break; + + case DB_QWORD_DISPLAY: + + ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); + AcpiOsPrintf ("%08X", Temp32); + + ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]); + AcpiOsPrintf ("%08X ", Temp32); + break; + } + + j += Display; + } + + /* + * Print the ASCII equivalent characters but watch out for the bad + * unprintable ones (printable chars are 0x20 through 0x7E) + */ + AcpiOsPrintf (" "); + for (j = 0; j < 16; j++) + { + if (i + j >= Count) + { + AcpiOsPrintf ("\n"); + return; + } + + BufChar = Buffer[(ACPI_SIZE) i + j]; + if (ACPI_IS_PRINT (BufChar)) + { + AcpiOsPrintf ("%c", BufChar); + } + else + { + AcpiOsPrintf ("."); + } + } + + /* Done with that line. */ + + AcpiOsPrintf ("\n"); + i += 16; + } + + return; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtDebugDumpBuffer + * + * PARAMETERS: Buffer - Buffer to dump + * Count - Amount to dump, in bytes + * Display - BYTE, WORD, DWORD, or QWORD display: + * DB_BYTE_DISPLAY + * DB_WORD_DISPLAY + * DB_DWORD_DISPLAY + * DB_QWORD_DISPLAY + * ComponentID - Caller's component ID + * + * RETURN: None + * + * DESCRIPTION: Generic dump buffer in both hex and ascii. + * + ******************************************************************************/ + +void +AcpiUtDebugDumpBuffer ( + UINT8 *Buffer, + UINT32 Count, + UINT32 Display, + UINT32 ComponentId) +{ + + /* Only dump the buffer if tracing is enabled */ + + if (!((ACPI_LV_TABLES & AcpiDbgLevel) && + (ComponentId & AcpiDbgLayer))) + { + return; + } + + AcpiUtDumpBuffer (Buffer, Count, Display, 0); +} diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utcache.c b/reactos/drivers/bus/acpi/acpica/utilities/utcache.c index ba131014b6f..1bd2c542ae7 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utcache.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utcache.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -167,7 +167,6 @@ AcpiOsCreateCache ( /* Populate the cache object and return it */ ACPI_MEMSET (Cache, 0, sizeof (ACPI_MEMORY_LIST)); - Cache->LinkOffset = 8; Cache->ListName = CacheName; Cache->ObjectSize = ObjectSize; Cache->MaxDepth = MaxDepth; @@ -193,7 +192,7 @@ ACPI_STATUS AcpiOsPurgeCache ( ACPI_MEMORY_LIST *Cache) { - char *Next; + void *Next; ACPI_STATUS Status; @@ -217,8 +216,7 @@ AcpiOsPurgeCache ( { /* Delete and unlink one cached state object */ - Next = *(ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Cache->ListHead)[Cache->LinkOffset]))); + Next = ACPI_GET_DESCRIPTOR_PTR (Cache->ListHead); ACPI_FREE (Cache->ListHead); Cache->ListHead = Next; @@ -277,7 +275,7 @@ AcpiOsDeleteCache ( * * RETURN: None * - * DESCRIPTION: Release an object to the specified cache. If cache is full, + * DESCRIPTION: Release an object to the specified cache. If cache is full, * the object is deleted. * ******************************************************************************/ @@ -323,8 +321,7 @@ AcpiOsReleaseObject ( /* Put the object at the head of the cache list */ - * (ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Object)[Cache->LinkOffset]))) = Cache->ListHead; + ACPI_SET_DESCRIPTOR_PTR (Object, Cache->ListHead); Cache->ListHead = Object; Cache->CurrentDepth++; @@ -341,9 +338,9 @@ AcpiOsReleaseObject ( * * PARAMETERS: Cache - Handle to cache object * - * RETURN: the acquired object. NULL on error + * RETURN: the acquired object. NULL on error * - * DESCRIPTION: Get an object from the specified cache. If cache is empty, + * DESCRIPTION: Get an object from the specified cache. If cache is empty, * the object is allocated. * ******************************************************************************/ @@ -361,13 +358,13 @@ AcpiOsAcquireObject ( if (!Cache) { - return (NULL); + return_PTR (NULL); } Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES); if (ACPI_FAILURE (Status)) { - return (NULL); + return_PTR (NULL); } ACPI_MEM_TRACKING (Cache->Requests++); @@ -379,8 +376,7 @@ AcpiOsAcquireObject ( /* There is an object available, use it */ Object = Cache->ListHead; - Cache->ListHead = *(ACPI_CAST_INDIRECT_PTR (char, - &(((char *) Object)[Cache->LinkOffset]))); + Cache->ListHead = ACPI_GET_DESCRIPTOR_PTR (Object); Cache->CurrentDepth--; @@ -391,7 +387,7 @@ AcpiOsAcquireObject ( Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); if (ACPI_FAILURE (Status)) { - return (NULL); + return_PTR (NULL); } /* Clear (zero) the previously used Object */ @@ -416,18 +412,16 @@ AcpiOsAcquireObject ( Status = AcpiUtReleaseMutex (ACPI_MTX_CACHES); if (ACPI_FAILURE (Status)) { - return (NULL); + return_PTR (NULL); } Object = ACPI_ALLOCATE_ZEROED (Cache->ObjectSize); if (!Object) { - return (NULL); + return_PTR (NULL); } } - return (Object); + return_PTR (Object); } #endif /* ACPI_USE_LOCAL_CACHE */ - - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utclib.c b/reactos/drivers/bus/acpi/acpica/utilities/utclib.c index 340e5b5d4a2..da2c83337ef 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utclib.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utclib.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -121,7 +121,7 @@ /* * These implementations of standard C Library routines can optionally be - * used if a C library is not available. In general, they are less efficient + * used if a C library is not available. In general, they are less efficient * than an inline or assembly implementation */ @@ -817,134 +817,134 @@ AcpiUtToLower ( ******************************************************************************/ const UINT8 _acpi_ctype[257] = { - _ACPI_CN, /* 0x0 0. */ - _ACPI_CN, /* 0x1 1. */ - _ACPI_CN, /* 0x2 2. */ - _ACPI_CN, /* 0x3 3. */ - _ACPI_CN, /* 0x4 4. */ - _ACPI_CN, /* 0x5 5. */ - _ACPI_CN, /* 0x6 6. */ - _ACPI_CN, /* 0x7 7. */ - _ACPI_CN, /* 0x8 8. */ - _ACPI_CN|_ACPI_SP, /* 0x9 9. */ - _ACPI_CN|_ACPI_SP, /* 0xA 10. */ - _ACPI_CN|_ACPI_SP, /* 0xB 11. */ - _ACPI_CN|_ACPI_SP, /* 0xC 12. */ - _ACPI_CN|_ACPI_SP, /* 0xD 13. */ - _ACPI_CN, /* 0xE 14. */ - _ACPI_CN, /* 0xF 15. */ - _ACPI_CN, /* 0x10 16. */ - _ACPI_CN, /* 0x11 17. */ - _ACPI_CN, /* 0x12 18. */ - _ACPI_CN, /* 0x13 19. */ - _ACPI_CN, /* 0x14 20. */ - _ACPI_CN, /* 0x15 21. */ - _ACPI_CN, /* 0x16 22. */ - _ACPI_CN, /* 0x17 23. */ - _ACPI_CN, /* 0x18 24. */ - _ACPI_CN, /* 0x19 25. */ - _ACPI_CN, /* 0x1A 26. */ - _ACPI_CN, /* 0x1B 27. */ - _ACPI_CN, /* 0x1C 28. */ - _ACPI_CN, /* 0x1D 29. */ - _ACPI_CN, /* 0x1E 30. */ - _ACPI_CN, /* 0x1F 31. */ - _ACPI_XS|_ACPI_SP, /* 0x20 32. ' ' */ - _ACPI_PU, /* 0x21 33. '!' */ - _ACPI_PU, /* 0x22 34. '"' */ - _ACPI_PU, /* 0x23 35. '#' */ - _ACPI_PU, /* 0x24 36. '$' */ - _ACPI_PU, /* 0x25 37. '%' */ - _ACPI_PU, /* 0x26 38. '&' */ - _ACPI_PU, /* 0x27 39. ''' */ - _ACPI_PU, /* 0x28 40. '(' */ - _ACPI_PU, /* 0x29 41. ')' */ - _ACPI_PU, /* 0x2A 42. '*' */ - _ACPI_PU, /* 0x2B 43. '+' */ - _ACPI_PU, /* 0x2C 44. ',' */ - _ACPI_PU, /* 0x2D 45. '-' */ - _ACPI_PU, /* 0x2E 46. '.' */ - _ACPI_PU, /* 0x2F 47. '/' */ - _ACPI_XD|_ACPI_DI, /* 0x30 48. '0' */ - _ACPI_XD|_ACPI_DI, /* 0x31 49. '1' */ - _ACPI_XD|_ACPI_DI, /* 0x32 50. '2' */ - _ACPI_XD|_ACPI_DI, /* 0x33 51. '3' */ - _ACPI_XD|_ACPI_DI, /* 0x34 52. '4' */ - _ACPI_XD|_ACPI_DI, /* 0x35 53. '5' */ - _ACPI_XD|_ACPI_DI, /* 0x36 54. '6' */ - _ACPI_XD|_ACPI_DI, /* 0x37 55. '7' */ - _ACPI_XD|_ACPI_DI, /* 0x38 56. '8' */ - _ACPI_XD|_ACPI_DI, /* 0x39 57. '9' */ - _ACPI_PU, /* 0x3A 58. ':' */ - _ACPI_PU, /* 0x3B 59. ';' */ - _ACPI_PU, /* 0x3C 60. '<' */ - _ACPI_PU, /* 0x3D 61. '=' */ - _ACPI_PU, /* 0x3E 62. '>' */ - _ACPI_PU, /* 0x3F 63. '?' */ - _ACPI_PU, /* 0x40 64. '@' */ - _ACPI_XD|_ACPI_UP, /* 0x41 65. 'A' */ - _ACPI_XD|_ACPI_UP, /* 0x42 66. 'B' */ - _ACPI_XD|_ACPI_UP, /* 0x43 67. 'C' */ - _ACPI_XD|_ACPI_UP, /* 0x44 68. 'D' */ - _ACPI_XD|_ACPI_UP, /* 0x45 69. 'E' */ - _ACPI_XD|_ACPI_UP, /* 0x46 70. 'F' */ - _ACPI_UP, /* 0x47 71. 'G' */ - _ACPI_UP, /* 0x48 72. 'H' */ - _ACPI_UP, /* 0x49 73. 'I' */ - _ACPI_UP, /* 0x4A 74. 'J' */ - _ACPI_UP, /* 0x4B 75. 'K' */ - _ACPI_UP, /* 0x4C 76. 'L' */ - _ACPI_UP, /* 0x4D 77. 'M' */ - _ACPI_UP, /* 0x4E 78. 'N' */ - _ACPI_UP, /* 0x4F 79. 'O' */ - _ACPI_UP, /* 0x50 80. 'P' */ - _ACPI_UP, /* 0x51 81. 'Q' */ - _ACPI_UP, /* 0x52 82. 'R' */ - _ACPI_UP, /* 0x53 83. 'S' */ - _ACPI_UP, /* 0x54 84. 'T' */ - _ACPI_UP, /* 0x55 85. 'U' */ - _ACPI_UP, /* 0x56 86. 'V' */ - _ACPI_UP, /* 0x57 87. 'W' */ - _ACPI_UP, /* 0x58 88. 'X' */ - _ACPI_UP, /* 0x59 89. 'Y' */ - _ACPI_UP, /* 0x5A 90. 'Z' */ - _ACPI_PU, /* 0x5B 91. '[' */ - _ACPI_PU, /* 0x5C 92. '\' */ - _ACPI_PU, /* 0x5D 93. ']' */ - _ACPI_PU, /* 0x5E 94. '^' */ - _ACPI_PU, /* 0x5F 95. '_' */ - _ACPI_PU, /* 0x60 96. '`' */ - _ACPI_XD|_ACPI_LO, /* 0x61 97. 'a' */ - _ACPI_XD|_ACPI_LO, /* 0x62 98. 'b' */ - _ACPI_XD|_ACPI_LO, /* 0x63 99. 'c' */ - _ACPI_XD|_ACPI_LO, /* 0x64 100. 'd' */ - _ACPI_XD|_ACPI_LO, /* 0x65 101. 'e' */ - _ACPI_XD|_ACPI_LO, /* 0x66 102. 'f' */ - _ACPI_LO, /* 0x67 103. 'g' */ - _ACPI_LO, /* 0x68 104. 'h' */ - _ACPI_LO, /* 0x69 105. 'i' */ - _ACPI_LO, /* 0x6A 106. 'j' */ - _ACPI_LO, /* 0x6B 107. 'k' */ - _ACPI_LO, /* 0x6C 108. 'l' */ - _ACPI_LO, /* 0x6D 109. 'm' */ - _ACPI_LO, /* 0x6E 110. 'n' */ - _ACPI_LO, /* 0x6F 111. 'o' */ - _ACPI_LO, /* 0x70 112. 'p' */ - _ACPI_LO, /* 0x71 113. 'q' */ - _ACPI_LO, /* 0x72 114. 'r' */ - _ACPI_LO, /* 0x73 115. 's' */ - _ACPI_LO, /* 0x74 116. 't' */ - _ACPI_LO, /* 0x75 117. 'u' */ - _ACPI_LO, /* 0x76 118. 'v' */ - _ACPI_LO, /* 0x77 119. 'w' */ - _ACPI_LO, /* 0x78 120. 'x' */ - _ACPI_LO, /* 0x79 121. 'y' */ - _ACPI_LO, /* 0x7A 122. 'z' */ - _ACPI_PU, /* 0x7B 123. '{' */ - _ACPI_PU, /* 0x7C 124. '|' */ - _ACPI_PU, /* 0x7D 125. '}' */ - _ACPI_PU, /* 0x7E 126. '~' */ - _ACPI_CN, /* 0x7F 127. */ + _ACPI_CN, /* 0x00 0 NUL */ + _ACPI_CN, /* 0x01 1 SOH */ + _ACPI_CN, /* 0x02 2 STX */ + _ACPI_CN, /* 0x03 3 ETX */ + _ACPI_CN, /* 0x04 4 EOT */ + _ACPI_CN, /* 0x05 5 ENQ */ + _ACPI_CN, /* 0x06 6 ACK */ + _ACPI_CN, /* 0x07 7 BEL */ + _ACPI_CN, /* 0x08 8 BS */ + _ACPI_CN|_ACPI_SP, /* 0x09 9 TAB */ + _ACPI_CN|_ACPI_SP, /* 0x0A 10 LF */ + _ACPI_CN|_ACPI_SP, /* 0x0B 11 VT */ + _ACPI_CN|_ACPI_SP, /* 0x0C 12 FF */ + _ACPI_CN|_ACPI_SP, /* 0x0D 13 CR */ + _ACPI_CN, /* 0x0E 14 SO */ + _ACPI_CN, /* 0x0F 15 SI */ + _ACPI_CN, /* 0x10 16 DLE */ + _ACPI_CN, /* 0x11 17 DC1 */ + _ACPI_CN, /* 0x12 18 DC2 */ + _ACPI_CN, /* 0x13 19 DC3 */ + _ACPI_CN, /* 0x14 20 DC4 */ + _ACPI_CN, /* 0x15 21 NAK */ + _ACPI_CN, /* 0x16 22 SYN */ + _ACPI_CN, /* 0x17 23 ETB */ + _ACPI_CN, /* 0x18 24 CAN */ + _ACPI_CN, /* 0x19 25 EM */ + _ACPI_CN, /* 0x1A 26 SUB */ + _ACPI_CN, /* 0x1B 27 ESC */ + _ACPI_CN, /* 0x1C 28 FS */ + _ACPI_CN, /* 0x1D 29 GS */ + _ACPI_CN, /* 0x1E 30 RS */ + _ACPI_CN, /* 0x1F 31 US */ + _ACPI_XS|_ACPI_SP, /* 0x20 32 ' ' */ + _ACPI_PU, /* 0x21 33 '!' */ + _ACPI_PU, /* 0x22 34 '"' */ + _ACPI_PU, /* 0x23 35 '#' */ + _ACPI_PU, /* 0x24 36 '$' */ + _ACPI_PU, /* 0x25 37 '%' */ + _ACPI_PU, /* 0x26 38 '&' */ + _ACPI_PU, /* 0x27 39 ''' */ + _ACPI_PU, /* 0x28 40 '(' */ + _ACPI_PU, /* 0x29 41 ')' */ + _ACPI_PU, /* 0x2A 42 '*' */ + _ACPI_PU, /* 0x2B 43 '+' */ + _ACPI_PU, /* 0x2C 44 ',' */ + _ACPI_PU, /* 0x2D 45 '-' */ + _ACPI_PU, /* 0x2E 46 '.' */ + _ACPI_PU, /* 0x2F 47 '/' */ + _ACPI_XD|_ACPI_DI, /* 0x30 48 '0' */ + _ACPI_XD|_ACPI_DI, /* 0x31 49 '1' */ + _ACPI_XD|_ACPI_DI, /* 0x32 50 '2' */ + _ACPI_XD|_ACPI_DI, /* 0x33 51 '3' */ + _ACPI_XD|_ACPI_DI, /* 0x34 52 '4' */ + _ACPI_XD|_ACPI_DI, /* 0x35 53 '5' */ + _ACPI_XD|_ACPI_DI, /* 0x36 54 '6' */ + _ACPI_XD|_ACPI_DI, /* 0x37 55 '7' */ + _ACPI_XD|_ACPI_DI, /* 0x38 56 '8' */ + _ACPI_XD|_ACPI_DI, /* 0x39 57 '9' */ + _ACPI_PU, /* 0x3A 58 ':' */ + _ACPI_PU, /* 0x3B 59 ';' */ + _ACPI_PU, /* 0x3C 60 '<' */ + _ACPI_PU, /* 0x3D 61 '=' */ + _ACPI_PU, /* 0x3E 62 '>' */ + _ACPI_PU, /* 0x3F 63 '?' */ + _ACPI_PU, /* 0x40 64 '@' */ + _ACPI_XD|_ACPI_UP, /* 0x41 65 'A' */ + _ACPI_XD|_ACPI_UP, /* 0x42 66 'B' */ + _ACPI_XD|_ACPI_UP, /* 0x43 67 'C' */ + _ACPI_XD|_ACPI_UP, /* 0x44 68 'D' */ + _ACPI_XD|_ACPI_UP, /* 0x45 69 'E' */ + _ACPI_XD|_ACPI_UP, /* 0x46 70 'F' */ + _ACPI_UP, /* 0x47 71 'G' */ + _ACPI_UP, /* 0x48 72 'H' */ + _ACPI_UP, /* 0x49 73 'I' */ + _ACPI_UP, /* 0x4A 74 'J' */ + _ACPI_UP, /* 0x4B 75 'K' */ + _ACPI_UP, /* 0x4C 76 'L' */ + _ACPI_UP, /* 0x4D 77 'M' */ + _ACPI_UP, /* 0x4E 78 'N' */ + _ACPI_UP, /* 0x4F 79 'O' */ + _ACPI_UP, /* 0x50 80 'P' */ + _ACPI_UP, /* 0x51 81 'Q' */ + _ACPI_UP, /* 0x52 82 'R' */ + _ACPI_UP, /* 0x53 83 'S' */ + _ACPI_UP, /* 0x54 84 'T' */ + _ACPI_UP, /* 0x55 85 'U' */ + _ACPI_UP, /* 0x56 86 'V' */ + _ACPI_UP, /* 0x57 87 'W' */ + _ACPI_UP, /* 0x58 88 'X' */ + _ACPI_UP, /* 0x59 89 'Y' */ + _ACPI_UP, /* 0x5A 90 'Z' */ + _ACPI_PU, /* 0x5B 91 '[' */ + _ACPI_PU, /* 0x5C 92 '\' */ + _ACPI_PU, /* 0x5D 93 ']' */ + _ACPI_PU, /* 0x5E 94 '^' */ + _ACPI_PU, /* 0x5F 95 '_' */ + _ACPI_PU, /* 0x60 96 '`' */ + _ACPI_XD|_ACPI_LO, /* 0x61 97 'a' */ + _ACPI_XD|_ACPI_LO, /* 0x62 98 'b' */ + _ACPI_XD|_ACPI_LO, /* 0x63 99 'c' */ + _ACPI_XD|_ACPI_LO, /* 0x64 100 'd' */ + _ACPI_XD|_ACPI_LO, /* 0x65 101 'e' */ + _ACPI_XD|_ACPI_LO, /* 0x66 102 'f' */ + _ACPI_LO, /* 0x67 103 'g' */ + _ACPI_LO, /* 0x68 104 'h' */ + _ACPI_LO, /* 0x69 105 'i' */ + _ACPI_LO, /* 0x6A 106 'j' */ + _ACPI_LO, /* 0x6B 107 'k' */ + _ACPI_LO, /* 0x6C 108 'l' */ + _ACPI_LO, /* 0x6D 109 'm' */ + _ACPI_LO, /* 0x6E 110 'n' */ + _ACPI_LO, /* 0x6F 111 'o' */ + _ACPI_LO, /* 0x70 112 'p' */ + _ACPI_LO, /* 0x71 113 'q' */ + _ACPI_LO, /* 0x72 114 'r' */ + _ACPI_LO, /* 0x73 115 's' */ + _ACPI_LO, /* 0x74 116 't' */ + _ACPI_LO, /* 0x75 117 'u' */ + _ACPI_LO, /* 0x76 118 'v' */ + _ACPI_LO, /* 0x77 119 'w' */ + _ACPI_LO, /* 0x78 120 'x' */ + _ACPI_LO, /* 0x79 121 'y' */ + _ACPI_LO, /* 0x7A 122 'z' */ + _ACPI_PU, /* 0x7B 123 '{' */ + _ACPI_PU, /* 0x7C 124 '|' */ + _ACPI_PU, /* 0x7D 125 '}' */ + _ACPI_PU, /* 0x7E 126 '~' */ + _ACPI_CN, /* 0x7F 127 DEL */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x80 to 0x8F */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x90 to 0x9F */ @@ -953,9 +953,9 @@ const UINT8 _acpi_ctype[257] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xC0 to 0xCF */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xD0 to 0xDF */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xE0 to 0xEF */ - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* 0xF0 to 0x100 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0xF0 to 0xFF */ + 0 /* 0x100 */ }; #endif /* ACPI_USE_SYSTEM_CLIBRARY */ - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utcopy.c b/reactos/drivers/bus/acpi/acpica/utilities/utcopy.c index 64484ad0239..4ca33bcacb6 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utcopy.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utcopy.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -244,7 +244,6 @@ AcpiUtCopyIsimpleToEsimple ( (ACPI_SIZE) InternalObject->String.Length + 1); break; - case ACPI_TYPE_BUFFER: ExternalObject->Buffer.Pointer = DataSpace; @@ -257,13 +256,11 @@ AcpiUtCopyIsimpleToEsimple ( InternalObject->Buffer.Length); break; - case ACPI_TYPE_INTEGER: ExternalObject->Integer.Value = InternalObject->Integer.Value; break; - case ACPI_TYPE_LOCAL_REFERENCE: /* This is an object reference. */ @@ -271,7 +268,6 @@ AcpiUtCopyIsimpleToEsimple ( switch (InternalObject->Reference.Class) { case ACPI_REFCLASS_NAME: - /* * For namepath, return the object handle ("reference") * We are referring to the namespace node @@ -290,7 +286,6 @@ AcpiUtCopyIsimpleToEsimple ( } break; - case ACPI_TYPE_PROCESSOR: ExternalObject->Processor.ProcId = @@ -301,7 +296,6 @@ AcpiUtCopyIsimpleToEsimple ( InternalObject->Processor.Length; break; - case ACPI_TYPE_POWER: ExternalObject->PowerResource.SystemLevel = @@ -311,7 +305,6 @@ AcpiUtCopyIsimpleToEsimple ( InternalObject->PowerResource.ResourceOrder; break; - default: /* * There is no corresponding external object type @@ -363,7 +356,6 @@ AcpiUtCopyIelementToEelement ( switch (ObjectType) { case ACPI_COPY_TYPE_SIMPLE: - /* * This is a simple or null object */ @@ -375,9 +367,7 @@ AcpiUtCopyIelementToEelement ( } break; - case ACPI_COPY_TYPE_PACKAGE: - /* * Build the package object */ @@ -400,8 +390,8 @@ AcpiUtCopyIelementToEelement ( sizeof (ACPI_OBJECT)); break; - default: + return (AE_BAD_PARAMETER); } @@ -586,6 +576,7 @@ AcpiUtCopyEsimpleToIsimple ( return_ACPI_STATUS (AE_OK); default: + /* All other types are not supported */ ACPI_ERROR ((AE_INFO, @@ -618,7 +609,6 @@ AcpiUtCopyEsimpleToIsimple ( InternalObject->String.Length = ExternalObject->String.Length; break; - case ACPI_TYPE_BUFFER: InternalObject->Buffer.Pointer = @@ -639,7 +629,6 @@ AcpiUtCopyEsimpleToIsimple ( InternalObject->Buffer.Flags |= AOPOBJ_DATA_VALID; break; - case ACPI_TYPE_INTEGER: InternalObject->Integer.Value = ExternalObject->Integer.Value; @@ -647,14 +636,16 @@ AcpiUtCopyEsimpleToIsimple ( case ACPI_TYPE_LOCAL_REFERENCE: - /* TBD: should validate incoming handle */ + /* An incoming reference is defined to be a namespace node */ - InternalObject->Reference.Class = ACPI_REFCLASS_NAME; - InternalObject->Reference.Node = ExternalObject->Reference.Handle; + InternalObject->Reference.Class = ACPI_REFCLASS_REFOF; + InternalObject->Reference.Object = ExternalObject->Reference.Handle; break; default: + /* Other types can't get here */ + break; } @@ -927,7 +918,9 @@ AcpiUtCopySimpleObject ( break; default: + /* Nothing to do for other simple objects */ + break; } @@ -1001,9 +994,7 @@ AcpiUtCopyIelementToIelement ( } break; - case ACPI_COPY_TYPE_PACKAGE: - /* * This object is a package - go down another nesting level * Create and build the package object @@ -1025,8 +1016,8 @@ AcpiUtCopyIelementToIelement ( *ThisTargetPtr = TargetObject; break; - default: + return (AE_BAD_PARAMETER); } @@ -1146,5 +1137,3 @@ AcpiUtCopyIobjectToIobject ( return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utdebug.c b/reactos/drivers/bus/acpi/acpica/utilities/utdebug.c index b21f07fc9ed..5a1f981070b 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utdebug.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utdebug.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: utdebug - Debug print routines + * Module Name: utdebug - Debug print/trace routines * *****************************************************************************/ @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -114,6 +114,7 @@ *****************************************************************************/ #define __UTDEBUG_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" @@ -261,11 +262,9 @@ AcpiDebugPrint ( va_list args; - /* - * Stay silent if the debug level or component ID is disabled - */ - if (!(RequestedDebugLevel & AcpiDbgLevel) || - !(ComponentId & AcpiDbgLayer)) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (RequestedDebugLevel, ComponentId)) { return; } @@ -284,21 +283,31 @@ AcpiDebugPrint ( } AcpiGbl_PrevThreadId = ThreadId; + AcpiGbl_NestingLevel = 0; } /* * Display the module name, current line number, thread ID (if requested), * current procedure nesting level, and the current procedure name */ - AcpiOsPrintf ("%8s-%04ld ", ModuleName, LineNumber); + AcpiOsPrintf ("%9s-%04ld ", ModuleName, LineNumber); +#ifdef ACPI_APPLICATION + /* + * For AcpiExec/iASL only, emit the thread ID and nesting level. + * Note: nesting level is really only useful during a single-thread + * execution. Otherwise, multiple threads will keep resetting the + * level. + */ if (ACPI_LV_THREADS & AcpiDbgLevel) { AcpiOsPrintf ("[%u] ", (UINT32) ThreadId); } - AcpiOsPrintf ("[%02ld] %-22.22s: ", - AcpiGbl_NestingLevel, AcpiUtTrimFunctionName (FunctionName)); + AcpiOsPrintf ("[%02ld] ", AcpiGbl_NestingLevel); +#endif + + AcpiOsPrintf ("%-22.22s: ", AcpiUtTrimFunctionName (FunctionName)); va_start (args, Format); AcpiOsVprintf (Format, args); @@ -322,7 +331,7 @@ ACPI_EXPORT_SYMBOL (AcpiDebugPrint) * * RETURN: None * - * DESCRIPTION: Print message with no headers. Has same interface as + * DESCRIPTION: Print message with no headers. Has same interface as * DebugPrint so that the same macros can be used. * ******************************************************************************/ @@ -340,8 +349,9 @@ AcpiDebugPrintRaw ( va_list args; - if (!(RequestedDebugLevel & AcpiDbgLevel) || - !(ComponentId & AcpiDbgLayer)) + /* Check if debug output enabled */ + + if (!ACPI_IS_DEBUG_ENABLED (RequestedDebugLevel, ComponentId)) { return; } @@ -365,7 +375,7 @@ ACPI_EXPORT_SYMBOL (AcpiDebugPrintRaw) * * RETURN: None * - * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is + * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is * set in DebugLevel * ******************************************************************************/ @@ -381,9 +391,14 @@ AcpiUtTrace ( AcpiGbl_NestingLevel++; AcpiUtTrackStackPtr (); - AcpiDebugPrint (ACPI_LV_FUNCTIONS, - LineNumber, FunctionName, ModuleName, ComponentId, - "%s\n", AcpiGbl_FnEntryStr); + /* Check if enabled up-front for performance */ + + if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) + { + AcpiDebugPrint (ACPI_LV_FUNCTIONS, + LineNumber, FunctionName, ModuleName, ComponentId, + "%s\n", AcpiGbl_FnEntryStr); + } } ACPI_EXPORT_SYMBOL (AcpiUtTrace) @@ -401,7 +416,7 @@ ACPI_EXPORT_SYMBOL (AcpiUtTrace) * * RETURN: None * - * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is + * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is * set in DebugLevel * ******************************************************************************/ @@ -414,12 +429,18 @@ AcpiUtTracePtr ( UINT32 ComponentId, void *Pointer) { + AcpiGbl_NestingLevel++; AcpiUtTrackStackPtr (); - AcpiDebugPrint (ACPI_LV_FUNCTIONS, - LineNumber, FunctionName, ModuleName, ComponentId, - "%s %p\n", AcpiGbl_FnEntryStr, Pointer); + /* Check if enabled up-front for performance */ + + if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) + { + AcpiDebugPrint (ACPI_LV_FUNCTIONS, + LineNumber, FunctionName, ModuleName, ComponentId, + "%s %p\n", AcpiGbl_FnEntryStr, Pointer); + } } @@ -435,7 +456,7 @@ AcpiUtTracePtr ( * * RETURN: None * - * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is + * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is * set in DebugLevel * ******************************************************************************/ @@ -452,9 +473,14 @@ AcpiUtTraceStr ( AcpiGbl_NestingLevel++; AcpiUtTrackStackPtr (); - AcpiDebugPrint (ACPI_LV_FUNCTIONS, - LineNumber, FunctionName, ModuleName, ComponentId, - "%s %s\n", AcpiGbl_FnEntryStr, String); + /* Check if enabled up-front for performance */ + + if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) + { + AcpiDebugPrint (ACPI_LV_FUNCTIONS, + LineNumber, FunctionName, ModuleName, ComponentId, + "%s %s\n", AcpiGbl_FnEntryStr, String); + } } @@ -470,7 +496,7 @@ AcpiUtTraceStr ( * * RETURN: None * - * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is + * DESCRIPTION: Function entry trace. Prints only if TRACE_FUNCTIONS bit is * set in DebugLevel * ******************************************************************************/ @@ -487,9 +513,14 @@ AcpiUtTraceU32 ( AcpiGbl_NestingLevel++; AcpiUtTrackStackPtr (); - AcpiDebugPrint (ACPI_LV_FUNCTIONS, - LineNumber, FunctionName, ModuleName, ComponentId, - "%s %08X\n", AcpiGbl_FnEntryStr, Integer); + /* Check if enabled up-front for performance */ + + if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) + { + AcpiDebugPrint (ACPI_LV_FUNCTIONS, + LineNumber, FunctionName, ModuleName, ComponentId, + "%s %08X\n", AcpiGbl_FnEntryStr, Integer); + } } @@ -504,7 +535,7 @@ AcpiUtTraceU32 ( * * RETURN: None * - * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is + * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is * set in DebugLevel * ******************************************************************************/ @@ -517,11 +548,19 @@ AcpiUtExit ( UINT32 ComponentId) { - AcpiDebugPrint (ACPI_LV_FUNCTIONS, - LineNumber, FunctionName, ModuleName, ComponentId, - "%s\n", AcpiGbl_FnExitStr); + /* Check if enabled up-front for performance */ - AcpiGbl_NestingLevel--; + if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) + { + AcpiDebugPrint (ACPI_LV_FUNCTIONS, + LineNumber, FunctionName, ModuleName, ComponentId, + "%s\n", AcpiGbl_FnExitStr); + } + + if (AcpiGbl_NestingLevel) + { + AcpiGbl_NestingLevel--; + } } ACPI_EXPORT_SYMBOL (AcpiUtExit) @@ -539,8 +578,8 @@ ACPI_EXPORT_SYMBOL (AcpiUtExit) * * RETURN: None * - * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is - * set in DebugLevel. Prints exit status also. + * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is + * set in DebugLevel. Prints exit status also. * ******************************************************************************/ @@ -553,22 +592,30 @@ AcpiUtStatusExit ( ACPI_STATUS Status) { - if (ACPI_SUCCESS (Status)) + /* Check if enabled up-front for performance */ + + if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) { - AcpiDebugPrint (ACPI_LV_FUNCTIONS, - LineNumber, FunctionName, ModuleName, ComponentId, - "%s %s\n", AcpiGbl_FnExitStr, - AcpiFormatException (Status)); - } - else - { - AcpiDebugPrint (ACPI_LV_FUNCTIONS, - LineNumber, FunctionName, ModuleName, ComponentId, - "%s ****Exception****: %s\n", AcpiGbl_FnExitStr, - AcpiFormatException (Status)); + if (ACPI_SUCCESS (Status)) + { + AcpiDebugPrint (ACPI_LV_FUNCTIONS, + LineNumber, FunctionName, ModuleName, ComponentId, + "%s %s\n", AcpiGbl_FnExitStr, + AcpiFormatException (Status)); + } + else + { + AcpiDebugPrint (ACPI_LV_FUNCTIONS, + LineNumber, FunctionName, ModuleName, ComponentId, + "%s ****Exception****: %s\n", AcpiGbl_FnExitStr, + AcpiFormatException (Status)); + } } - AcpiGbl_NestingLevel--; + if (AcpiGbl_NestingLevel) + { + AcpiGbl_NestingLevel--; + } } ACPI_EXPORT_SYMBOL (AcpiUtStatusExit) @@ -586,8 +633,8 @@ ACPI_EXPORT_SYMBOL (AcpiUtStatusExit) * * RETURN: None * - * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is - * set in DebugLevel. Prints exit value also. + * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is + * set in DebugLevel. Prints exit value also. * ******************************************************************************/ @@ -600,12 +647,20 @@ AcpiUtValueExit ( UINT64 Value) { - AcpiDebugPrint (ACPI_LV_FUNCTIONS, - LineNumber, FunctionName, ModuleName, ComponentId, - "%s %8.8X%8.8X\n", AcpiGbl_FnExitStr, - ACPI_FORMAT_UINT64 (Value)); + /* Check if enabled up-front for performance */ - AcpiGbl_NestingLevel--; + if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) + { + AcpiDebugPrint (ACPI_LV_FUNCTIONS, + LineNumber, FunctionName, ModuleName, ComponentId, + "%s %8.8X%8.8X\n", AcpiGbl_FnExitStr, + ACPI_FORMAT_UINT64 (Value)); + } + + if (AcpiGbl_NestingLevel) + { + AcpiGbl_NestingLevel--; + } } ACPI_EXPORT_SYMBOL (AcpiUtValueExit) @@ -623,8 +678,8 @@ ACPI_EXPORT_SYMBOL (AcpiUtValueExit) * * RETURN: None * - * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is - * set in DebugLevel. Prints exit value also. + * DESCRIPTION: Function exit trace. Prints only if TRACE_FUNCTIONS bit is + * set in DebugLevel. Prints exit value also. * ******************************************************************************/ @@ -637,177 +692,19 @@ AcpiUtPtrExit ( UINT8 *Ptr) { - AcpiDebugPrint (ACPI_LV_FUNCTIONS, - LineNumber, FunctionName, ModuleName, ComponentId, - "%s %p\n", AcpiGbl_FnExitStr, Ptr); + /* Check if enabled up-front for performance */ - AcpiGbl_NestingLevel--; + if (ACPI_IS_DEBUG_ENABLED (ACPI_LV_FUNCTIONS, ComponentId)) + { + AcpiDebugPrint (ACPI_LV_FUNCTIONS, + LineNumber, FunctionName, ModuleName, ComponentId, + "%s %p\n", AcpiGbl_FnExitStr, Ptr); + } + + if (AcpiGbl_NestingLevel) + { + AcpiGbl_NestingLevel--; + } } #endif - - -/******************************************************************************* - * - * FUNCTION: AcpiUtDumpBuffer - * - * PARAMETERS: Buffer - Buffer to dump - * Count - Amount to dump, in bytes - * Display - BYTE, WORD, DWORD, or QWORD display - * ComponentID - Caller's component ID - * - * RETURN: None - * - * DESCRIPTION: Generic dump buffer in both hex and ascii. - * - ******************************************************************************/ - -void -AcpiUtDumpBuffer2 ( - UINT8 *Buffer, - UINT32 Count, - UINT32 Display) -{ - UINT32 i = 0; - UINT32 j; - UINT32 Temp32; - UINT8 BufChar; - - - if (!Buffer) - { - AcpiOsPrintf ("Null Buffer Pointer in DumpBuffer!\n"); - return; - } - - if ((Count < 4) || (Count & 0x01)) - { - Display = DB_BYTE_DISPLAY; - } - - /* Nasty little dump buffer routine! */ - - while (i < Count) - { - /* Print current offset */ - - AcpiOsPrintf ("%6.4X: ", i); - - /* Print 16 hex chars */ - - for (j = 0; j < 16;) - { - if (i + j >= Count) - { - /* Dump fill spaces */ - - AcpiOsPrintf ("%*s", ((Display * 2) + 1), " "); - j += Display; - continue; - } - - switch (Display) - { - case DB_BYTE_DISPLAY: - default: /* Default is BYTE display */ - - AcpiOsPrintf ("%02X ", Buffer[(ACPI_SIZE) i + j]); - break; - - - case DB_WORD_DISPLAY: - - ACPI_MOVE_16_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); - AcpiOsPrintf ("%04X ", Temp32); - break; - - - case DB_DWORD_DISPLAY: - - ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); - AcpiOsPrintf ("%08X ", Temp32); - break; - - - case DB_QWORD_DISPLAY: - - ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j]); - AcpiOsPrintf ("%08X", Temp32); - - ACPI_MOVE_32_TO_32 (&Temp32, &Buffer[(ACPI_SIZE) i + j + 4]); - AcpiOsPrintf ("%08X ", Temp32); - break; - } - - j += Display; - } - - /* - * Print the ASCII equivalent characters but watch out for the bad - * unprintable ones (printable chars are 0x20 through 0x7E) - */ - AcpiOsPrintf (" "); - for (j = 0; j < 16; j++) - { - if (i + j >= Count) - { - AcpiOsPrintf ("\n"); - return; - } - - BufChar = Buffer[(ACPI_SIZE) i + j]; - if (ACPI_IS_PRINT (BufChar)) - { - AcpiOsPrintf ("%c", BufChar); - } - else - { - AcpiOsPrintf ("."); - } - } - - /* Done with that line. */ - - AcpiOsPrintf ("\n"); - i += 16; - } - - return; -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtDumpBuffer - * - * PARAMETERS: Buffer - Buffer to dump - * Count - Amount to dump, in bytes - * Display - BYTE, WORD, DWORD, or QWORD display - * ComponentID - Caller's component ID - * - * RETURN: None - * - * DESCRIPTION: Generic dump buffer in both hex and ascii. - * - ******************************************************************************/ - -void -AcpiUtDumpBuffer ( - UINT8 *Buffer, - UINT32 Count, - UINT32 Display, - UINT32 ComponentId) -{ - - /* Only dump the buffer if tracing is enabled */ - - if (!((ACPI_LV_TABLES & AcpiDbgLevel) && - (ComponentId & AcpiDbgLayer))) - { - return; - } - - AcpiUtDumpBuffer2 (Buffer, Count, Display); -} - - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utdecode.c b/reactos/drivers/bus/acpi/acpica/utilities/utdecode.c index 94b53d80d23..8566819d1b4 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utdecode.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utdecode.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -123,47 +123,6 @@ ACPI_MODULE_NAME ("utdecode") -/******************************************************************************* - * - * FUNCTION: AcpiFormatException - * - * PARAMETERS: Status - The ACPI_STATUS code to be formatted - * - * RETURN: A string containing the exception text. A valid pointer is - * always returned. - * - * DESCRIPTION: This function translates an ACPI exception into an ASCII string - * It is here instead of utxface.c so it is always present. - * - ******************************************************************************/ - -const char * -AcpiFormatException ( - ACPI_STATUS Status) -{ - const char *Exception = NULL; - - - ACPI_FUNCTION_ENTRY (); - - - Exception = AcpiUtValidateException (Status); - if (!Exception) - { - /* Exception code was not recognized */ - - ACPI_ERROR ((AE_INFO, - "Unknown exception code: 0x%8.8X", Status)); - - Exception = "UNKNOWN_STATUS_CODE"; - } - - return (ACPI_CAST_PTR (const char, Exception)); -} - -ACPI_EXPORT_SYMBOL (AcpiFormatException) - - /* * Properties of the ACPI Object Types, both internal and external. * The table is indexed by values of ACPI_OBJECT_TYPE @@ -252,14 +211,17 @@ AcpiUtHexToAsciiChar ( const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] = { - "SystemMemory", - "SystemIO", - "PCI_Config", - "EmbeddedControl", - "SMBus", - "SystemCMOS", - "PCIBARTarget", - "IPMI" + "SystemMemory", /* 0x00 */ + "SystemIO", /* 0x01 */ + "PCI_Config", /* 0x02 */ + "EmbeddedControl", /* 0x03 */ + "SMBus", /* 0x04 */ + "SystemCMOS", /* 0x05 */ + "PCIBARTarget", /* 0x06 */ + "IPMI", /* 0x07 */ + "GeneralPurposeIo", /* 0x08 */ + "GenericSerialBus", /* 0x09 */ + "PCC" /* 0x0A */ }; @@ -637,39 +599,99 @@ AcpiUtGetMutexName ( /* Names for Notify() values, used for debug output */ -static const char *AcpiGbl_NotifyValueNames[] = +static const char *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] = { - "Bus Check", - "Device Check", - "Device Wake", - "Eject Request", - "Device Check Light", - "Frequency Mismatch", - "Bus Mode Mismatch", - "Power Fault", - "Capabilities Check", - "Device PLD Check", - "Reserved", - "System Locality Update" + /* 00 */ "Bus Check", + /* 01 */ "Device Check", + /* 02 */ "Device Wake", + /* 03 */ "Eject Request", + /* 04 */ "Device Check Light", + /* 05 */ "Frequency Mismatch", + /* 06 */ "Bus Mode Mismatch", + /* 07 */ "Power Fault", + /* 08 */ "Capabilities Check", + /* 09 */ "Device PLD Check", + /* 0A */ "Reserved", + /* 0B */ "System Locality Update", + /* 0C */ "Shutdown Request" }; +static const char *AcpiGbl_DeviceNotify[4] = +{ + /* 80 */ "Status Change", + /* 81 */ "Information Change", + /* 82 */ "Device-Specific Change", + /* 83 */ "Device-Specific Change" +}; + +static const char *AcpiGbl_ProcessorNotify[4] = +{ + /* 80 */ "Performance Capability Change", + /* 81 */ "C-State Change", + /* 82 */ "Throttling Capability Change", + /* 83 */ "Device-Specific Change" +}; + +static const char *AcpiGbl_ThermalNotify[4] = +{ + /* 80 */ "Thermal Status Change", + /* 81 */ "Thermal Trip Point Change", + /* 82 */ "Thermal Device List Change", + /* 83 */ "Thermal Relationship Change" +}; + + const char * AcpiUtGetNotifyName ( - UINT32 NotifyValue) + UINT32 NotifyValue, + ACPI_OBJECT_TYPE Type) { + /* 00 - 0C are common to all object types */ + if (NotifyValue <= ACPI_NOTIFY_MAX) { - return (AcpiGbl_NotifyValueNames[NotifyValue]); + return (AcpiGbl_GenericNotify[NotifyValue]); } - else if (NotifyValue <= ACPI_MAX_SYS_NOTIFY) + + /* 0D - 7F are reserved */ + + if (NotifyValue <= ACPI_MAX_SYS_NOTIFY) { return ("Reserved"); } - else /* Greater or equal to 0x80 */ + + /* 80 - 83 are per-object-type */ + + if (NotifyValue <= 0x83) { - return ("**Device Specific**"); + switch (Type) + { + case ACPI_TYPE_ANY: + case ACPI_TYPE_DEVICE: + return (AcpiGbl_DeviceNotify [NotifyValue - 0x80]); + + case ACPI_TYPE_PROCESSOR: + return (AcpiGbl_ProcessorNotify [NotifyValue - 0x80]); + + case ACPI_TYPE_THERMAL: + return (AcpiGbl_ThermalNotify [NotifyValue - 0x80]); + + default: + return ("Target object type does not support notifies"); + } } + + /* 84 - BF are device-specific */ + + if (NotifyValue <= ACPI_MAX_DEVICE_SPECIFIC_NOTIFY) + { + return ("Device-Specific"); + } + + /* C0 and above are hardware-specific */ + + return ("Hardware-Specific"); } #endif diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utdelete.c b/reactos/drivers/bus/acpi/acpica/utilities/utdelete.c index 801f957d49b..d42d8a75551 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utdelete.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utdelete.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -158,6 +158,7 @@ AcpiUtDeleteInternalObj ( ACPI_OPERAND_OBJECT *HandlerDesc; ACPI_OPERAND_OBJECT *SecondDesc; ACPI_OPERAND_OBJECT *NextDesc; + ACPI_OPERAND_OBJECT *StartDesc; ACPI_OPERAND_OBJECT **LastObjPtr; @@ -190,7 +191,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_BUFFER: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "**** Buffer %p, ptr %p\n", @@ -206,7 +206,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_PACKAGE: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, " **** Package of count %X\n", @@ -222,7 +221,6 @@ AcpiUtDeleteInternalObj ( ObjPointer = Object->Package.Elements; break; - /* * These objects have a possible list of notify handlers. * Device object also may have a GPE block. @@ -239,7 +237,7 @@ AcpiUtDeleteInternalObj ( case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_THERMAL: - /* Walk the notify handler list for this object */ + /* Walk the address handler list for this object */ HandlerDesc = Object->CommonNotify.Handler; while (HandlerDesc) @@ -250,7 +248,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_MUTEX: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -274,7 +271,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_EVENT: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -285,7 +281,6 @@ AcpiUtDeleteInternalObj ( Object->Event.OsSemaphore = NULL; break; - case ACPI_TYPE_METHOD: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -301,12 +296,21 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_REGION: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "***** Region %p\n", Object)); + /* + * Update AddressRange list. However, only permanent regions + * are installed in this list. (Not created within a method) + */ + if (!(Object->Region.Node->Flags & ANOBJ_TEMPORARY)) + { + AcpiUtRemoveAddressRange (Object->Region.SpaceId, + Object->Region.Node); + } + SecondDesc = AcpiNsGetSecondaryObject (Object); if (SecondDesc) { @@ -319,9 +323,10 @@ AcpiUtDeleteInternalObj ( if (HandlerDesc) { NextDesc = HandlerDesc->AddressSpace.RegionList; + StartDesc = NextDesc; LastObjPtr = &HandlerDesc->AddressSpace.RegionList; - /* Remove the region object from the handler's list */ + /* Remove the region object from the handler list */ while (NextDesc) { @@ -331,10 +336,20 @@ AcpiUtDeleteInternalObj ( break; } - /* Walk the linked list of handler */ + /* Walk the linked list of handlers */ LastObjPtr = &NextDesc->Region.Next; NextDesc = NextDesc->Region.Next; + + /* Prevent infinite loop if list is corrupted */ + + if (NextDesc == StartDesc) + { + ACPI_ERROR ((AE_INFO, + "Circular region list in address handler object %p", + HandlerDesc)); + return_VOID; + } } if (HandlerDesc->AddressSpace.HandlerFlags & @@ -360,7 +375,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_BUFFER_FIELD: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -373,7 +387,6 @@ AcpiUtDeleteInternalObj ( } break; - case ACPI_TYPE_LOCAL_BANK_FIELD: ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -386,8 +399,8 @@ AcpiUtDeleteInternalObj ( } break; - default: + break; } @@ -430,7 +443,7 @@ AcpiUtDeleteInternalObjectList ( ACPI_OPERAND_OBJECT **InternalObj; - ACPI_FUNCTION_TRACE (UtDeleteInternalObjectList); + ACPI_FUNCTION_ENTRY (); /* Walk the null-terminated internal list */ @@ -443,7 +456,7 @@ AcpiUtDeleteInternalObjectList ( /* Free the combined parameter pointer list and object array */ ACPI_FREE (ObjList); - return_VOID; + return; } @@ -452,11 +465,11 @@ AcpiUtDeleteInternalObjectList ( * FUNCTION: AcpiUtUpdateRefCount * * PARAMETERS: Object - Object whose ref count is to be updated - * Action - What to do + * Action - What to do (REF_INCREMENT or REF_DECREMENT) * - * RETURN: New ref count + * RETURN: None. Sets new reference count within the object * - * DESCRIPTION: Modify the ref count and return it. + * DESCRIPTION: Modify the reference count for an internal acpi object * ******************************************************************************/ @@ -465,8 +478,9 @@ AcpiUtUpdateRefCount ( ACPI_OPERAND_OBJECT *Object, UINT32 Action) { - UINT16 Count; - UINT16 NewCount; + UINT16 OriginalCount; + UINT16 NewCount = 0; + ACPI_CPU_FLAGS LockFlags; ACPI_FUNCTION_NAME (UtUpdateRefCount); @@ -477,80 +491,85 @@ AcpiUtUpdateRefCount ( return; } - Count = Object->Common.ReferenceCount; - NewCount = Count; - /* - * Perform the reference count action (increment, decrement, force delete) + * Always get the reference count lock. Note: Interpreter and/or + * Namespace is not always locked when this function is called. */ + LockFlags = AcpiOsAcquireLock (AcpiGbl_ReferenceCountLock); + OriginalCount = Object->Common.ReferenceCount; + + /* Perform the reference count action (increment, decrement) */ + switch (Action) { case REF_INCREMENT: - NewCount++; + NewCount = OriginalCount + 1; Object->Common.ReferenceCount = NewCount; + AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags); + + /* The current reference count should never be zero here */ + + if (!OriginalCount) + { + ACPI_WARNING ((AE_INFO, + "Obj %p, Reference Count was zero before increment\n", + Object)); + } ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, - "Obj %p Refs=%X, [Incremented]\n", - Object, NewCount)); + "Obj %p Type %.2X Refs %.2X [Incremented]\n", + Object, Object->Common.Type, NewCount)); break; case REF_DECREMENT: - if (Count < 1) - { - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, - "Obj %p Refs=%X, can't decrement! (Set to 0)\n", - Object, NewCount)); + /* The current reference count must be non-zero */ - NewCount = 0; - } - else + if (OriginalCount) { - NewCount--; - - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, - "Obj %p Refs=%X, [Decremented]\n", - Object, NewCount)); + NewCount = OriginalCount - 1; + Object->Common.ReferenceCount = NewCount; } - if (Object->Common.Type == ACPI_TYPE_METHOD) + AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags); + + if (!OriginalCount) { - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, - "Method Obj %p Refs=%X, [Decremented]\n", Object, NewCount)); + ACPI_WARNING ((AE_INFO, + "Obj %p, Reference Count is already zero, cannot decrement\n", + Object)); } - Object->Common.ReferenceCount = NewCount; + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, + "Obj %p Type %.2X Refs %.2X [Decremented]\n", + Object, Object->Common.Type, NewCount)); + + /* Actually delete the object on a reference count of zero */ + if (NewCount == 0) { AcpiUtDeleteInternalObj (Object); } break; - case REF_FORCE_DELETE: - - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, - "Obj %p Refs=%X, Force delete! (Set to 0)\n", Object, Count)); - - NewCount = 0; - Object->Common.ReferenceCount = NewCount; - AcpiUtDeleteInternalObj (Object); - break; - default: - ACPI_ERROR ((AE_INFO, "Unknown action (0x%X)", Action)); - break; + AcpiOsReleaseLock (AcpiGbl_ReferenceCountLock, LockFlags); + ACPI_ERROR ((AE_INFO, "Unknown Reference Count action (0x%X)", + Action)); + return; } /* * Sanity check the reference count, for debug purposes only. * (A deleted object will have a huge reference count) */ - if (Count > ACPI_MAX_REFERENCE_COUNT) + if (NewCount > ACPI_MAX_REFERENCE_COUNT) { ACPI_WARNING ((AE_INFO, - "Large Reference Count (0x%X) in object %p", Count, Object)); + "Large Reference Count (0x%X) in object %p, Type=0x%.2X", + NewCount, Object, Object->Common.Type)); } } @@ -561,8 +580,7 @@ AcpiUtUpdateRefCount ( * * PARAMETERS: Object - Increment ref count for this object * and all sub-objects - * Action - Either REF_INCREMENT or REF_DECREMENT or - * REF_FORCE_DELETE + * Action - Either REF_INCREMENT or REF_DECREMENT * * RETURN: Status * @@ -585,11 +603,12 @@ AcpiUtUpdateObjectReference ( ACPI_STATUS Status = AE_OK; ACPI_GENERIC_STATE *StateList = NULL; ACPI_OPERAND_OBJECT *NextObject = NULL; + ACPI_OPERAND_OBJECT *PrevObject; ACPI_GENERIC_STATE *State; UINT32 i; - ACPI_FUNCTION_TRACE_PTR (UtUpdateObjectReference, Object); + ACPI_FUNCTION_NAME (UtUpdateObjectReference); while (Object) @@ -600,7 +619,7 @@ AcpiUtUpdateObjectReference ( { ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Object %p is NS handle\n", Object)); - return_ACPI_STATUS (AE_OK); + return (AE_OK); } /* @@ -613,11 +632,20 @@ AcpiUtUpdateObjectReference ( case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_POWER: case ACPI_TYPE_THERMAL: - - /* Update the notify objects for these types (if present) */ - - AcpiUtUpdateRefCount (Object->CommonNotify.SystemNotify, Action); - AcpiUtUpdateRefCount (Object->CommonNotify.DeviceNotify, Action); + /* + * Update the notify objects for these types (if present) + * Two lists, system and device notify handlers. + */ + for (i = 0; i < ACPI_NUM_NOTIFY_TYPES; i++) + { + PrevObject = Object->CommonNotify.NotifyList[i]; + while (PrevObject) + { + NextObject = PrevObject->Notify.Next[i]; + AcpiUtUpdateRefCount (PrevObject, Action); + PrevObject = NextObject; + } + } break; case ACPI_TYPE_PACKAGE: @@ -628,17 +656,43 @@ AcpiUtUpdateObjectReference ( for (i = 0; i < Object->Package.Count; i++) { /* - * Push each element onto the stack for later processing. - * Note: There can be null elements within the package, - * these are simply ignored + * Null package elements are legal and can be simply + * ignored. */ - Status = AcpiUtCreateUpdateStateAndPush ( - Object->Package.Elements[i], Action, &StateList); - if (ACPI_FAILURE (Status)) + NextObject = Object->Package.Elements[i]; + if (!NextObject) { - goto ErrorExit; + continue; + } + + switch (NextObject->Common.Type) + { + case ACPI_TYPE_INTEGER: + case ACPI_TYPE_STRING: + case ACPI_TYPE_BUFFER: + /* + * For these very simple sub-objects, we can just + * update the reference count here and continue. + * Greatly increases performance of this operation. + */ + AcpiUtUpdateRefCount (NextObject, Action); + break; + + default: + /* + * For complex sub-objects, push them onto the stack + * for later processing (this eliminates recursion.) + */ + Status = AcpiUtCreateUpdateStateAndPush ( + NextObject, Action, &StateList); + if (ACPI_FAILURE (Status)) + { + goto ErrorExit; + } + break; } } + NextObject = NULL; break; case ACPI_TYPE_BUFFER_FIELD: @@ -688,6 +742,7 @@ AcpiUtUpdateObjectReference ( case ACPI_TYPE_REGION: default: + break; /* No subobjects for all other types */ } @@ -714,7 +769,7 @@ AcpiUtUpdateObjectReference ( } } - return_ACPI_STATUS (AE_OK); + return (AE_OK); ErrorExit: @@ -730,7 +785,7 @@ ErrorExit: AcpiUtDeleteGenericState (State); } - return_ACPI_STATUS (Status); + return (Status); } @@ -752,14 +807,14 @@ AcpiUtAddReference ( ACPI_OPERAND_OBJECT *Object) { - ACPI_FUNCTION_TRACE_PTR (UtAddReference, Object); + ACPI_FUNCTION_NAME (UtAddReference); /* Ensure that we have a valid object */ if (!AcpiUtValidInternalObject (Object)) { - return_VOID; + return; } ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -769,7 +824,7 @@ AcpiUtAddReference ( /* Increment the reference count */ (void) AcpiUtUpdateObjectReference (Object, REF_INCREMENT); - return_VOID; + return; } @@ -790,26 +845,25 @@ AcpiUtRemoveReference ( ACPI_OPERAND_OBJECT *Object) { - ACPI_FUNCTION_TRACE_PTR (UtRemoveReference, Object); + ACPI_FUNCTION_NAME (UtRemoveReference); /* * Allow a NULL pointer to be passed in, just ignore it. This saves * each caller from having to check. Also, ignore NS nodes. - * */ if (!Object || (ACPI_GET_DESCRIPTOR_TYPE (Object) == ACPI_DESC_TYPE_NAMED)) { - return_VOID; + return; } /* Ensure that we have a valid object */ if (!AcpiUtValidInternalObject (Object)) { - return_VOID; + return; } ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, @@ -822,7 +876,5 @@ AcpiUtRemoveReference ( * of all subobjects!) */ (void) AcpiUtUpdateObjectReference (Object, REF_DECREMENT); - return_VOID; + return; } - - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/uterror.c b/reactos/drivers/bus/acpi/acpica/utilities/uterror.c new file mode 100644 index 00000000000..b590af75ac0 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/utilities/uterror.c @@ -0,0 +1,399 @@ +/******************************************************************************* + * + * Module Name: uterror - Various internal error/warning output functions + * + ******************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __UTERROR_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" + + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("uterror") + + +/* + * This module contains internal error functions that may + * be configured out. + */ +#if !defined (ACPI_NO_ERROR_MESSAGES) + +/******************************************************************************* + * + * FUNCTION: AcpiUtPredefinedWarning + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Pathname - Full pathname to the node + * NodeFlags - From Namespace node for the method/object + * Format - Printf format string + additional args + * + * RETURN: None + * + * DESCRIPTION: Warnings for the predefined validation module. Messages are + * only emitted the first time a problem with a particular + * method/object is detected. This prevents a flood of error + * messages for methods that are repeatedly evaluated. + * + ******************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedWarning ( + const char *ModuleName, + UINT32 LineNumber, + char *Pathname, + UINT8 NodeFlags, + const char *Format, + ...) +{ + va_list ArgList; + + + /* + * Warning messages for this method/object will be disabled after the + * first time a validation fails or an object is successfully repaired. + */ + if (NodeFlags & ANOBJ_EVALUATED) + { + return; + } + + AcpiOsPrintf (ACPI_MSG_WARNING "%s: ", Pathname); + + va_start (ArgList, Format); + AcpiOsVprintf (Format, ArgList); + ACPI_MSG_SUFFIX; + va_end (ArgList); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtPredefinedInfo + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Pathname - Full pathname to the node + * NodeFlags - From Namespace node for the method/object + * Format - Printf format string + additional args + * + * RETURN: None + * + * DESCRIPTION: Info messages for the predefined validation module. Messages + * are only emitted the first time a problem with a particular + * method/object is detected. This prevents a flood of + * messages for methods that are repeatedly evaluated. + * + ******************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedInfo ( + const char *ModuleName, + UINT32 LineNumber, + char *Pathname, + UINT8 NodeFlags, + const char *Format, + ...) +{ + va_list ArgList; + + + /* + * Warning messages for this method/object will be disabled after the + * first time a validation fails or an object is successfully repaired. + */ + if (NodeFlags & ANOBJ_EVALUATED) + { + return; + } + + AcpiOsPrintf (ACPI_MSG_INFO "%s: ", Pathname); + + va_start (ArgList, Format); + AcpiOsVprintf (Format, ArgList); + ACPI_MSG_SUFFIX; + va_end (ArgList); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtPredefinedBiosError + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Pathname - Full pathname to the node + * NodeFlags - From Namespace node for the method/object + * Format - Printf format string + additional args + * + * RETURN: None + * + * DESCRIPTION: BIOS error message for predefined names. Messages + * are only emitted the first time a problem with a particular + * method/object is detected. This prevents a flood of + * messages for methods that are repeatedly evaluated. + * + ******************************************************************************/ + +void ACPI_INTERNAL_VAR_XFACE +AcpiUtPredefinedBiosError ( + const char *ModuleName, + UINT32 LineNumber, + char *Pathname, + UINT8 NodeFlags, + const char *Format, + ...) +{ + va_list ArgList; + + + /* + * Warning messages for this method/object will be disabled after the + * first time a validation fails or an object is successfully repaired. + */ + if (NodeFlags & ANOBJ_EVALUATED) + { + return; + } + + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR "%s: ", Pathname); + + va_start (ArgList, Format); + AcpiOsVprintf (Format, ArgList); + ACPI_MSG_SUFFIX; + va_end (ArgList); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtNamespaceError + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * InternalName - Name or path of the namespace node + * LookupStatus - Exception code from NS lookup + * + * RETURN: None + * + * DESCRIPTION: Print error message with the full pathname for the NS node. + * + ******************************************************************************/ + +void +AcpiUtNamespaceError ( + const char *ModuleName, + UINT32 LineNumber, + const char *InternalName, + ACPI_STATUS LookupStatus) +{ + ACPI_STATUS Status; + UINT32 BadName; + char *Name = NULL; + + + ACPI_MSG_REDIRECT_BEGIN; + AcpiOsPrintf (ACPI_MSG_ERROR); + + if (LookupStatus == AE_BAD_CHARACTER) + { + /* There is a non-ascii character in the name */ + + ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName)); + AcpiOsPrintf ("[0x%.8X] (NON-ASCII)", BadName); + } + else + { + /* Convert path to external format */ + + Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, + InternalName, NULL, &Name); + + /* Print target name */ + + if (ACPI_SUCCESS (Status)) + { + AcpiOsPrintf ("[%s]", Name); + } + else + { + AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]"); + } + + if (Name) + { + ACPI_FREE (Name); + } + } + + AcpiOsPrintf (" Namespace lookup failure, %s", + AcpiFormatException (LookupStatus)); + + ACPI_MSG_SUFFIX; + ACPI_MSG_REDIRECT_END; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtMethodError + * + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Message - Error message to use on failure + * PrefixNode - Prefix relative to the path + * Path - Path to the node (optional) + * MethodStatus - Execution status + * + * RETURN: None + * + * DESCRIPTION: Print error message with the full pathname for the method. + * + ******************************************************************************/ + +void +AcpiUtMethodError ( + const char *ModuleName, + UINT32 LineNumber, + const char *Message, + ACPI_NAMESPACE_NODE *PrefixNode, + const char *Path, + ACPI_STATUS MethodStatus) +{ + ACPI_STATUS Status; + ACPI_NAMESPACE_NODE *Node = PrefixNode; + + + ACPI_MSG_REDIRECT_BEGIN; + AcpiOsPrintf (ACPI_MSG_ERROR); + + if (Path) + { + Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH, + &Node); + if (ACPI_FAILURE (Status)) + { + AcpiOsPrintf ("[Could not get node by pathname]"); + } + } + + AcpiNsPrintNodePathname (Node, Message); + AcpiOsPrintf (", %s", AcpiFormatException (MethodStatus)); + + ACPI_MSG_SUFFIX; + ACPI_MSG_REDIRECT_END; +} + +#endif /* ACPI_NO_ERROR_MESSAGES */ diff --git a/reactos/drivers/bus/acpi/acpica/utilities/uteval.c b/reactos/drivers/bus/acpi/acpica/utilities/uteval.c index eeaaebbbe06..b3a734149d6 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/uteval.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/uteval.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -167,7 +167,7 @@ AcpiUtEvaluateObject ( } Info->PrefixNode = PrefixNode; - Info->Pathname = Path; + Info->RelativePathname = Path; /* Evaluate the object/method */ @@ -208,22 +208,27 @@ AcpiUtEvaluateObject ( switch ((Info->ReturnObject)->Common.Type) { case ACPI_TYPE_INTEGER: + ReturnBtype = ACPI_BTYPE_INTEGER; break; case ACPI_TYPE_BUFFER: + ReturnBtype = ACPI_BTYPE_BUFFER; break; case ACPI_TYPE_STRING: + ReturnBtype = ACPI_BTYPE_STRING; break; case ACPI_TYPE_PACKAGE: + ReturnBtype = ACPI_BTYPE_PACKAGE; break; default: + ReturnBtype = 0; break; } @@ -327,7 +332,8 @@ AcpiUtEvaluateNumericObject ( * RETURN: Status * * DESCRIPTION: Executes _STA for selected device and stores results in - * *Flags. + * *Flags. If _STA does not exist, then the device is assumed + * to be present/functional/enabled (as per the ACPI spec). * * NOTE: Internal function, no parameter validation * @@ -351,6 +357,11 @@ AcpiUtExecute_STA ( { if (AE_NOT_FOUND == Status) { + /* + * if _STA does not exist, then (as per the ACPI specification), + * the returned flags will indicate that the device is present, + * functional, and enabled. + */ ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "_STA on %4.4s was not found, assuming device is present\n", AcpiUtGetNodeName (DeviceNode))); diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utexcep.c b/reactos/drivers/bus/acpi/acpica/utilities/utexcep.c new file mode 100644 index 00000000000..d9f047197fc --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/utilities/utexcep.c @@ -0,0 +1,253 @@ +/******************************************************************************* + * + * Module Name: utexcep - Exception code support + * + ******************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#define __UTEXCEP_C__ +#define EXPORT_ACPI_INTERFACES + +#define ACPI_DEFINE_EXCEPTION_TABLE +#include "acpi.h" +#include "accommon.h" + + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utexcep") + + +/******************************************************************************* + * + * FUNCTION: AcpiFormatException + * + * PARAMETERS: Status - The ACPI_STATUS code to be formatted + * + * RETURN: A string containing the exception text. A valid pointer is + * always returned. + * + * DESCRIPTION: This function translates an ACPI exception into an ASCII + * string. Returns "unknown status" string for invalid codes. + * + ******************************************************************************/ + +const char * +AcpiFormatException ( + ACPI_STATUS Status) +{ + const ACPI_EXCEPTION_INFO *Exception; + + + ACPI_FUNCTION_ENTRY (); + + + Exception = AcpiUtValidateException (Status); + if (!Exception) + { + /* Exception code was not recognized */ + + ACPI_ERROR ((AE_INFO, + "Unknown exception code: 0x%8.8X", Status)); + + return ("UNKNOWN_STATUS_CODE"); + } + + return (Exception->Name); +} + +ACPI_EXPORT_SYMBOL (AcpiFormatException) + + +/******************************************************************************* + * + * FUNCTION: AcpiUtValidateException + * + * PARAMETERS: Status - The ACPI_STATUS code to be formatted + * + * RETURN: A string containing the exception text. NULL if exception is + * not valid. + * + * DESCRIPTION: This function validates and translates an ACPI exception into + * an ASCII string. + * + ******************************************************************************/ + +const ACPI_EXCEPTION_INFO * +AcpiUtValidateException ( + ACPI_STATUS Status) +{ + UINT32 SubStatus; + const ACPI_EXCEPTION_INFO *Exception = NULL; + + + ACPI_FUNCTION_ENTRY (); + + + /* + * Status is composed of two parts, a "type" and an actual code + */ + SubStatus = (Status & ~AE_CODE_MASK); + + switch (Status & AE_CODE_MASK) + { + case AE_CODE_ENVIRONMENTAL: + + if (SubStatus <= AE_CODE_ENV_MAX) + { + Exception = &AcpiGbl_ExceptionNames_Env [SubStatus]; + } + break; + + case AE_CODE_PROGRAMMER: + + if (SubStatus <= AE_CODE_PGM_MAX) + { + Exception = &AcpiGbl_ExceptionNames_Pgm [SubStatus]; + } + break; + + case AE_CODE_ACPI_TABLES: + + if (SubStatus <= AE_CODE_TBL_MAX) + { + Exception = &AcpiGbl_ExceptionNames_Tbl [SubStatus]; + } + break; + + case AE_CODE_AML: + + if (SubStatus <= AE_CODE_AML_MAX) + { + Exception = &AcpiGbl_ExceptionNames_Aml [SubStatus]; + } + break; + + case AE_CODE_CONTROL: + + if (SubStatus <= AE_CODE_CTRL_MAX) + { + Exception = &AcpiGbl_ExceptionNames_Ctrl [SubStatus]; + } + break; + + default: + + break; + } + + if (!Exception || !Exception->Name) + { + return (NULL); + } + + return (Exception); +} diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utglobal.c b/reactos/drivers/bus/acpi/acpica/utilities/utglobal.c index 30da582a98e..77294c482f1 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utglobal.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utglobal.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -114,6 +114,7 @@ *****************************************************************************/ #define __UTGLOBAL_C__ +#define EXPORT_ACPI_INTERFACES #define DEFINE_ACPI_GLOBALS #include "acpi.h" @@ -129,12 +130,7 @@ * ******************************************************************************/ -/* - * We want the debug switches statically initialized so they - * are already set when the debugger is entered. - */ - -/* Debug switch - level and trace mask */ +/* Debug output control masks */ #ifdef ACPI_DEBUG_OUTPUT UINT32 AcpiDbgLevel = ACPI_DEBUG_DEFAULT; @@ -142,24 +138,24 @@ UINT32 AcpiDbgLevel = ACPI_DEBUG_DEFAULT; UINT32 AcpiDbgLevel = ACPI_NORMAL_DEFAULT; #endif -/* Debug switch - layer (component) mask */ - UINT32 AcpiDbgLayer = ACPI_COMPONENT_DEFAULT; -UINT32 AcpiGbl_NestingLevel = 0; -/* Debugger globals */ +/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */ -BOOLEAN AcpiGbl_DbTerminateThreads = FALSE; -BOOLEAN AcpiGbl_AbortMethod = FALSE; -BOOLEAN AcpiGbl_MethodExecuting = FALSE; +ACPI_TABLE_FADT AcpiGbl_FADT; +UINT32 AcpiGbl_TraceFlags; +ACPI_NAME AcpiGbl_TraceMethodName; +BOOLEAN AcpiGbl_SystemAwakeAndRunning; +UINT32 AcpiCurrentGpeCount; -/* System flags */ +/* + * ACPI 5.0 introduces the concept of a "reduced hardware platform", meaning + * that the ACPI hardware is no longer required. A flag in the FADT indicates + * a reduced HW machine, and that flag is duplicated here for convenience. + */ +BOOLEAN AcpiGbl_ReducedHardware; -UINT32 AcpiGbl_StartupFlags = 0; - -/* System starts uninitialized */ - -BOOLEAN AcpiGbl_Shutdown = TRUE; +/* Various state name strings */ const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT] = { @@ -227,6 +223,7 @@ const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames[] = }; +#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * * Event and Hardware globals @@ -271,6 +268,7 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = /* ACPI_EVENT_SLEEP_BUTTON */ {ACPI_BITREG_SLEEP_BUTTON_STATUS, ACPI_BITREG_SLEEP_BUTTON_ENABLE, ACPI_BITMASK_SLEEP_BUTTON_STATUS, ACPI_BITMASK_SLEEP_BUTTON_ENABLE}, /* ACPI_EVENT_RTC */ {ACPI_BITREG_RT_CLOCK_STATUS, ACPI_BITREG_RT_CLOCK_ENABLE, ACPI_BITMASK_RT_CLOCK_STATUS, ACPI_BITMASK_RT_CLOCK_ENABLE}, }; +#endif /* !ACPI_REDUCED_HARDWARE */ /******************************************************************************* @@ -281,8 +279,9 @@ ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS] = * * RETURN: Status * - * DESCRIPTION: Init ACPICA globals. All globals that require specific - * initialization should be initialized here! + * DESCRIPTION: Initialize ACPICA globals. All globals that require specific + * initialization should be initialized here. This allows for + * a warm restart. * ******************************************************************************/ @@ -305,6 +304,13 @@ AcpiUtInitGlobals ( return_ACPI_STATUS (Status); } + /* Address Range lists */ + + for (i = 0; i < ACPI_ADDRESS_RANGE_MAX; i++) + { + AcpiGbl_AddressRangeList[i] = NULL; + } + /* Mutex locked flags */ for (i = 0; i < ACPI_NUM_MUTEX; i++) @@ -334,7 +340,9 @@ AcpiUtInitGlobals ( AcpiFixedEventCount[i] = 0; } - /* GPE support */ +#if (!ACPI_REDUCED_HARDWARE) + + /* GPE/SCI support */ AcpiGbl_AllGpesInitialized = FALSE; AcpiGbl_GpeXruptListHead = NULL; @@ -342,15 +350,19 @@ AcpiUtInitGlobals ( AcpiGbl_GpeFadtBlocks[1] = NULL; AcpiCurrentGpeCount = 0; + AcpiGbl_GlobalEventHandler = NULL; + AcpiGbl_SciHandlerList = NULL; + +#endif /* !ACPI_REDUCED_HARDWARE */ + /* Global handlers */ - AcpiGbl_SystemNotify.Handler = NULL; - AcpiGbl_DeviceNotify.Handler = NULL; + AcpiGbl_GlobalNotify[0].Handler = NULL; + AcpiGbl_GlobalNotify[1].Handler = NULL; AcpiGbl_ExceptionHandler = NULL; AcpiGbl_InitHandler = NULL; AcpiGbl_TableHandler = NULL; AcpiGbl_InterfaceHandler = NULL; - AcpiGbl_GlobalEventHandler = NULL; /* Global Lock support */ @@ -364,7 +376,6 @@ AcpiUtInitGlobals ( AcpiGbl_DSDT = NULL; AcpiGbl_CmSingleStep = FALSE; - AcpiGbl_DbTerminateThreads = FALSE; AcpiGbl_Shutdown = FALSE; AcpiGbl_NsLookupCount = 0; AcpiGbl_PsFindCount = 0; @@ -376,7 +387,6 @@ AcpiUtInitGlobals ( AcpiGbl_TraceDbgLayer = 0; AcpiGbl_DebuggerConfiguration = DEBUGGER_THREADING; AcpiGbl_DbOutputFlags = ACPI_DB_CONSOLE_OUTPUT; - AcpiGbl_OsiData = 0; AcpiGbl_OsiMutex = NULL; AcpiGbl_RegMethodsExecuted = FALSE; @@ -400,6 +410,8 @@ AcpiUtInitGlobals ( #ifdef ACPI_DISASSEMBLER AcpiGbl_ExternalList = NULL; + AcpiGbl_NumExternalMethods = 0; + AcpiGbl_ResolvedExternalMethods = 0; #endif #ifdef ACPI_DEBUG_OUTPUT @@ -411,6 +423,10 @@ AcpiUtInitGlobals ( AcpiGbl_DisableMemTracking = FALSE; #endif +#ifdef ACPI_DEBUGGER + AcpiGbl_DbTerminateThreads = FALSE; +#endif + return_ACPI_STATUS (AE_OK); } diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utids.c b/reactos/drivers/bus/acpi/acpica/utilities/utids.c index c24541da86f..4cf84e8edb0 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utids.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utids.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -145,10 +145,10 @@ ACPI_STATUS AcpiUtExecute_HID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID **ReturnId) + ACPI_PNP_DEVICE_ID **ReturnId) { ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_DEVICE_ID *Hid; + ACPI_PNP_DEVICE_ID *Hid; UINT32 Length; ACPI_STATUS Status; @@ -176,16 +176,16 @@ AcpiUtExecute_HID ( /* Allocate a buffer for the HID */ - Hid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_DEVICE_ID) + (ACPI_SIZE) Length); + Hid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); if (!Hid) { Status = AE_NO_MEMORY; goto Cleanup; } - /* Area for the string starts after DEVICE_ID struct */ + /* Area for the string starts after PNP_DEVICE_ID struct */ - Hid->String = ACPI_ADD_PTR (char, Hid, sizeof (ACPI_DEVICE_ID)); + Hid->String = ACPI_ADD_PTR (char, Hid, sizeof (ACPI_PNP_DEVICE_ID)); /* Convert EISAID to a string or simply copy existing string */ @@ -211,6 +211,77 @@ Cleanup: } +/******************************************************************************* + * + * FUNCTION: AcpiUtExecute_SUB + * + * PARAMETERS: DeviceNode - Node for the device + * ReturnId - Where the _SUB is returned + * + * RETURN: Status + * + * DESCRIPTION: Executes the _SUB control method that returns the subsystem + * ID of the device. The _SUB value is always a string containing + * either a valid PNP or ACPI ID. + * + * NOTE: Internal function, no parameter validation + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUtExecute_SUB ( + ACPI_NAMESPACE_NODE *DeviceNode, + ACPI_PNP_DEVICE_ID **ReturnId) +{ + ACPI_OPERAND_OBJECT *ObjDesc; + ACPI_PNP_DEVICE_ID *Sub; + UINT32 Length; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (UtExecute_SUB); + + + Status = AcpiUtEvaluateObject (DeviceNode, METHOD_NAME__SUB, + ACPI_BTYPE_STRING, &ObjDesc); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* Get the size of the String to be returned, includes null terminator */ + + Length = ObjDesc->String.Length + 1; + + /* Allocate a buffer for the SUB */ + + Sub = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); + if (!Sub) + { + Status = AE_NO_MEMORY; + goto Cleanup; + } + + /* Area for the string starts after PNP_DEVICE_ID struct */ + + Sub->String = ACPI_ADD_PTR (char, Sub, sizeof (ACPI_PNP_DEVICE_ID)); + + /* Simply copy existing string */ + + ACPI_STRCPY (Sub->String, ObjDesc->String.Pointer); + Sub->Length = Length; + *ReturnId = Sub; + + +Cleanup: + + /* On exit, we must delete the return object */ + + AcpiUtRemoveReference (ObjDesc); + return_ACPI_STATUS (Status); +} + + /******************************************************************************* * * FUNCTION: AcpiUtExecute_UID @@ -232,10 +303,10 @@ Cleanup: ACPI_STATUS AcpiUtExecute_UID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID **ReturnId) + ACPI_PNP_DEVICE_ID **ReturnId) { ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_DEVICE_ID *Uid; + ACPI_PNP_DEVICE_ID *Uid; UINT32 Length; ACPI_STATUS Status; @@ -263,16 +334,16 @@ AcpiUtExecute_UID ( /* Allocate a buffer for the UID */ - Uid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_DEVICE_ID) + (ACPI_SIZE) Length); + Uid = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PNP_DEVICE_ID) + (ACPI_SIZE) Length); if (!Uid) { Status = AE_NO_MEMORY; goto Cleanup; } - /* Area for the string starts after DEVICE_ID struct */ + /* Area for the string starts after PNP_DEVICE_ID struct */ - Uid->String = ACPI_ADD_PTR (char, Uid, sizeof (ACPI_DEVICE_ID)); + Uid->String = ACPI_ADD_PTR (char, Uid, sizeof (ACPI_PNP_DEVICE_ID)); /* Convert an Integer to string, or just copy an existing string */ @@ -324,11 +395,11 @@ Cleanup: ACPI_STATUS AcpiUtExecute_CID ( ACPI_NAMESPACE_NODE *DeviceNode, - ACPI_DEVICE_ID_LIST **ReturnCidList) + ACPI_PNP_DEVICE_ID_LIST **ReturnCidList) { ACPI_OPERAND_OBJECT **CidObjects; ACPI_OPERAND_OBJECT *ObjDesc; - ACPI_DEVICE_ID_LIST *CidList; + ACPI_PNP_DEVICE_ID_LIST *CidList; char *NextIdString; UINT32 StringAreaSize; UINT32 Length; @@ -376,14 +447,17 @@ AcpiUtExecute_CID ( switch (CidObjects[i]->Common.Type) { case ACPI_TYPE_INTEGER: + StringAreaSize += ACPI_EISAID_STRING_SIZE; break; case ACPI_TYPE_STRING: + StringAreaSize += CidObjects[i]->String.Length + 1; break; default: + Status = AE_TYPE; goto Cleanup; } @@ -392,11 +466,11 @@ AcpiUtExecute_CID ( /* * Now that we know the length of the CIDs, allocate return buffer: * 1) Size of the base structure + - * 2) Size of the CID DEVICE_ID array + + * 2) Size of the CID PNP_DEVICE_ID array + * 3) Size of the actual CID strings */ - CidListSize = sizeof (ACPI_DEVICE_ID_LIST) + - ((Count - 1) * sizeof (ACPI_DEVICE_ID)) + + CidListSize = sizeof (ACPI_PNP_DEVICE_ID_LIST) + + ((Count - 1) * sizeof (ACPI_PNP_DEVICE_ID)) + StringAreaSize; CidList = ACPI_ALLOCATE_ZEROED (CidListSize); @@ -406,10 +480,10 @@ AcpiUtExecute_CID ( goto Cleanup; } - /* Area for CID strings starts after the CID DEVICE_ID array */ + /* Area for CID strings starts after the CID PNP_DEVICE_ID array */ NextIdString = ACPI_CAST_PTR (char, CidList->Ids) + - ((ACPI_SIZE) Count * sizeof (ACPI_DEVICE_ID)); + ((ACPI_SIZE) Count * sizeof (ACPI_PNP_DEVICE_ID)); /* Copy/convert the CIDs to the return buffer */ @@ -449,4 +523,3 @@ Cleanup: AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utinit.c b/reactos/drivers/bus/acpi/acpica/utilities/utinit.c index 9e06711f475..46df0abc2c3 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utinit.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utinit.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -130,21 +130,33 @@ static void AcpiUtTerminate ( void); +#if (!ACPI_REDUCED_HARDWARE) +static void +AcpiUtFreeGpeLists ( + void); + +#else + +#define AcpiUtFreeGpeLists() +#endif /* !ACPI_REDUCED_HARDWARE */ + + +#if (!ACPI_REDUCED_HARDWARE) /****************************************************************************** * - * FUNCTION: AcpiUtTerminate + * FUNCTION: AcpiUtFreeGpeLists * * PARAMETERS: none * * RETURN: none * - * DESCRIPTION: Free global memory + * DESCRIPTION: Free global GPE lists * ******************************************************************************/ static void -AcpiUtTerminate ( +AcpiUtFreeGpeLists ( void) { ACPI_GPE_BLOCK_INFO *GpeBlock; @@ -153,9 +165,6 @@ AcpiUtTerminate ( ACPI_GPE_XRUPT_INFO *NextGpeXruptInfo; - ACPI_FUNCTION_TRACE (UtTerminate); - - /* Free global GPE blocks and related info structures */ GpeXruptInfo = AcpiGbl_GpeXruptListHead; @@ -175,7 +184,30 @@ AcpiUtTerminate ( ACPI_FREE (GpeXruptInfo); GpeXruptInfo = NextGpeXruptInfo; } +} +#endif /* !ACPI_REDUCED_HARDWARE */ + +/****************************************************************************** + * + * FUNCTION: AcpiUtTerminate + * + * PARAMETERS: none + * + * RETURN: none + * + * DESCRIPTION: Free global memory + * + ******************************************************************************/ + +static void +AcpiUtTerminate ( + void) +{ + ACPI_FUNCTION_TRACE (UtTerminate); + + AcpiUtFreeGpeLists (); + AcpiUtDeleteAddressLists (); return_VOID; } @@ -228,5 +260,3 @@ AcpiUtSubsystemShutdown ( (void) AcpiUtDeleteCaches (); return_VOID; } - - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utlock.c b/reactos/drivers/bus/acpi/acpica/utilities/utlock.c index 6e68ec00435..b3e4cb4e3e7 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utlock.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utlock.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -274,4 +274,3 @@ AcpiUtReleaseWriteLock ( AcpiOsReleaseMutex (Lock->WriterMutex); } - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utmath.c b/reactos/drivers/bus/acpi/acpica/utilities/utmath.c index 5c6d20e3c9c..c781c7e1a0d 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utmath.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utmath.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -162,7 +162,7 @@ typedef union uint64_overlay * RETURN: Status (Checks for divide-by-zero) * * DESCRIPTION: Perform a short (maximum 64 bits divided by 32 bits) - * divide and modulo. The result is a 64-bit quotient and a + * divide and modulo. The result is a 64-bit quotient and a * 32-bit remainder. * ******************************************************************************/ @@ -447,5 +447,3 @@ AcpiUtDivide ( } #endif - - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utmisc.c b/reactos/drivers/bus/acpi/acpica/utilities/utmisc.c index d379a220d3d..69d8350666f 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utmisc.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utmisc.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -125,86 +125,6 @@ ACPI_MODULE_NAME ("utmisc") -/******************************************************************************* - * - * FUNCTION: AcpiUtValidateException - * - * PARAMETERS: Status - The ACPI_STATUS code to be formatted - * - * RETURN: A string containing the exception text. NULL if exception is - * not valid. - * - * DESCRIPTION: This function validates and translates an ACPI exception into - * an ASCII string. - * - ******************************************************************************/ - -const char * -AcpiUtValidateException ( - ACPI_STATUS Status) -{ - UINT32 SubStatus; - const char *Exception = NULL; - - - ACPI_FUNCTION_ENTRY (); - - - /* - * Status is composed of two parts, a "type" and an actual code - */ - SubStatus = (Status & ~AE_CODE_MASK); - - switch (Status & AE_CODE_MASK) - { - case AE_CODE_ENVIRONMENTAL: - - if (SubStatus <= AE_CODE_ENV_MAX) - { - Exception = AcpiGbl_ExceptionNames_Env [SubStatus]; - } - break; - - case AE_CODE_PROGRAMMER: - - if (SubStatus <= AE_CODE_PGM_MAX) - { - Exception = AcpiGbl_ExceptionNames_Pgm [SubStatus]; - } - break; - - case AE_CODE_ACPI_TABLES: - - if (SubStatus <= AE_CODE_TBL_MAX) - { - Exception = AcpiGbl_ExceptionNames_Tbl [SubStatus]; - } - break; - - case AE_CODE_AML: - - if (SubStatus <= AE_CODE_AML_MAX) - { - Exception = AcpiGbl_ExceptionNames_Aml [SubStatus]; - } - break; - - case AE_CODE_CONTROL: - - if (SubStatus <= AE_CODE_CTRL_MAX) - { - Exception = AcpiGbl_ExceptionNames_Ctrl [SubStatus]; - } - break; - - default: - break; - } - - return (ACPI_CAST_PTR (const char, Exception)); -} - - /******************************************************************************* * * FUNCTION: AcpiUtIsPciRootBridge @@ -271,373 +191,6 @@ AcpiUtIsAmlTable ( } -/******************************************************************************* - * - * FUNCTION: AcpiUtAllocateOwnerId - * - * PARAMETERS: OwnerId - Where the new owner ID is returned - * - * RETURN: Status - * - * DESCRIPTION: Allocate a table or method owner ID. The owner ID is used to - * track objects created by the table or method, to be deleted - * when the method exits or the table is unloaded. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiUtAllocateOwnerId ( - ACPI_OWNER_ID *OwnerId) -{ - UINT32 i; - UINT32 j; - UINT32 k; - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (UtAllocateOwnerId); - - - /* Guard against multiple allocations of ID to the same location */ - - if (*OwnerId) - { - ACPI_ERROR ((AE_INFO, "Owner ID [0x%2.2X] already exists", *OwnerId)); - return_ACPI_STATUS (AE_ALREADY_EXISTS); - } - - /* Mutex for the global ID mask */ - - Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - - /* - * Find a free owner ID, cycle through all possible IDs on repeated - * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index may have - * to be scanned twice. - */ - for (i = 0, j = AcpiGbl_LastOwnerIdIndex; - i < (ACPI_NUM_OWNERID_MASKS + 1); - i++, j++) - { - if (j >= ACPI_NUM_OWNERID_MASKS) - { - j = 0; /* Wraparound to start of mask array */ - } - - for (k = AcpiGbl_NextOwnerIdOffset; k < 32; k++) - { - if (AcpiGbl_OwnerIdMask[j] == ACPI_UINT32_MAX) - { - /* There are no free IDs in this mask */ - - break; - } - - if (!(AcpiGbl_OwnerIdMask[j] & (1 << k))) - { - /* - * Found a free ID. The actual ID is the bit index plus one, - * making zero an invalid Owner ID. Save this as the last ID - * allocated and update the global ID mask. - */ - AcpiGbl_OwnerIdMask[j] |= (1 << k); - - AcpiGbl_LastOwnerIdIndex = (UINT8) j; - AcpiGbl_NextOwnerIdOffset = (UINT8) (k + 1); - - /* - * Construct encoded ID from the index and bit position - * - * Note: Last [j].k (bit 255) is never used and is marked - * permanently allocated (prevents +1 overflow) - */ - *OwnerId = (ACPI_OWNER_ID) ((k + 1) + ACPI_MUL_32 (j)); - - ACPI_DEBUG_PRINT ((ACPI_DB_VALUES, - "Allocated OwnerId: %2.2X\n", (unsigned int) *OwnerId)); - goto Exit; - } - } - - AcpiGbl_NextOwnerIdOffset = 0; - } - - /* - * All OwnerIds have been allocated. This typically should - * not happen since the IDs are reused after deallocation. The IDs are - * allocated upon table load (one per table) and method execution, and - * they are released when a table is unloaded or a method completes - * execution. - * - * If this error happens, there may be very deep nesting of invoked control - * methods, or there may be a bug where the IDs are not released. - */ - Status = AE_OWNER_ID_LIMIT; - ACPI_ERROR ((AE_INFO, - "Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT")); - -Exit: - (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); - return_ACPI_STATUS (Status); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtReleaseOwnerId - * - * PARAMETERS: OwnerIdPtr - Pointer to a previously allocated OwnerID - * - * RETURN: None. No error is returned because we are either exiting a - * control method or unloading a table. Either way, we would - * ignore any error anyway. - * - * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 255 - * - ******************************************************************************/ - -void -AcpiUtReleaseOwnerId ( - ACPI_OWNER_ID *OwnerIdPtr) -{ - ACPI_OWNER_ID OwnerId = *OwnerIdPtr; - ACPI_STATUS Status; - UINT32 Index; - UINT32 Bit; - - - ACPI_FUNCTION_TRACE_U32 (UtReleaseOwnerId, OwnerId); - - - /* Always clear the input OwnerId (zero is an invalid ID) */ - - *OwnerIdPtr = 0; - - /* Zero is not a valid OwnerID */ - - if (OwnerId == 0) - { - ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%2.2X", OwnerId)); - return_VOID; - } - - /* Mutex for the global ID mask */ - - Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES); - if (ACPI_FAILURE (Status)) - { - return_VOID; - } - - /* Normalize the ID to zero */ - - OwnerId--; - - /* Decode ID to index/offset pair */ - - Index = ACPI_DIV_32 (OwnerId); - Bit = 1 << ACPI_MOD_32 (OwnerId); - - /* Free the owner ID only if it is valid */ - - if (AcpiGbl_OwnerIdMask[Index] & Bit) - { - AcpiGbl_OwnerIdMask[Index] ^= Bit; - } - else - { - ACPI_ERROR ((AE_INFO, - "Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1)); - } - - (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); - return_VOID; -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtStrupr (strupr) - * - * PARAMETERS: SrcString - The source string to convert - * - * RETURN: None - * - * DESCRIPTION: Convert string to uppercase - * - * NOTE: This is not a POSIX function, so it appears here, not in utclib.c - * - ******************************************************************************/ - -void -AcpiUtStrupr ( - char *SrcString) -{ - char *String; - - - ACPI_FUNCTION_ENTRY (); - - - if (!SrcString) - { - return; - } - - /* Walk entire string, uppercasing the letters */ - - for (String = SrcString; *String; String++) - { - *String = (char) ACPI_TOUPPER (*String); - } - - return; -} - - -#ifdef ACPI_ASL_COMPILER -/******************************************************************************* - * - * FUNCTION: AcpiUtStrlwr (strlwr) - * - * PARAMETERS: SrcString - The source string to convert - * - * RETURN: None - * - * DESCRIPTION: Convert string to lowercase - * - * NOTE: This is not a POSIX function, so it appears here, not in utclib.c - * - ******************************************************************************/ - -void -AcpiUtStrlwr ( - char *SrcString) -{ - char *String; - - - ACPI_FUNCTION_ENTRY (); - - - if (!SrcString) - { - return; - } - - /* Walk entire string, lowercasing the letters */ - - for (String = SrcString; *String; String++) - { - *String = (char) ACPI_TOLOWER (*String); - } - - return; -} -#endif - - -/******************************************************************************* - * - * FUNCTION: AcpiUtPrintString - * - * PARAMETERS: String - Null terminated ASCII string - * MaxLength - Maximum output length - * - * RETURN: None - * - * DESCRIPTION: Dump an ASCII string with support for ACPI-defined escape - * sequences. - * - ******************************************************************************/ - -void -AcpiUtPrintString ( - char *String, - UINT8 MaxLength) -{ - UINT32 i; - - - if (!String) - { - AcpiOsPrintf ("<\"NULL STRING PTR\">"); - return; - } - - AcpiOsPrintf ("\""); - for (i = 0; String[i] && (i < MaxLength); i++) - { - /* Escape sequences */ - - switch (String[i]) - { - case 0x07: - AcpiOsPrintf ("\\a"); /* BELL */ - break; - - case 0x08: - AcpiOsPrintf ("\\b"); /* BACKSPACE */ - break; - - case 0x0C: - AcpiOsPrintf ("\\f"); /* FORMFEED */ - break; - - case 0x0A: - AcpiOsPrintf ("\\n"); /* LINEFEED */ - break; - - case 0x0D: - AcpiOsPrintf ("\\r"); /* CARRIAGE RETURN*/ - break; - - case 0x09: - AcpiOsPrintf ("\\t"); /* HORIZONTAL TAB */ - break; - - case 0x0B: - AcpiOsPrintf ("\\v"); /* VERTICAL TAB */ - break; - - case '\'': /* Single Quote */ - case '\"': /* Double Quote */ - case '\\': /* Backslash */ - AcpiOsPrintf ("\\%c", (int) String[i]); - break; - - default: - - /* Check for printable character or hex escape */ - - if (ACPI_IS_PRINT (String[i])) - { - /* This is a normal character */ - - AcpiOsPrintf ("%c", (int) String[i]); - } - else - { - /* All others will be Hex escapes */ - - AcpiOsPrintf ("\\x%2.2X", (INT32) String[i]); - } - break; - } - } - AcpiOsPrintf ("\""); - - if (i == MaxLength && String[i]) - { - AcpiOsPrintf ("..."); - } -} - - /******************************************************************************* * * FUNCTION: AcpiUtDwordByteSwap @@ -689,8 +242,8 @@ AcpiUtDwordByteSwap ( * RETURN: None * * DESCRIPTION: Set the global integer bit width based upon the revision - * of the DSDT. For Revision 1 and 0, Integers are 32 bits. - * For Revision 2 and above, Integers are 64 bits. Yes, this + * of the DSDT. For Revision 1 and 0, Integers are 32 bits. + * For Revision 2 and above, Integers are 64 bits. Yes, this * makes a difference. * ******************************************************************************/ @@ -719,439 +272,6 @@ AcpiUtSetIntegerWidth ( } -#ifdef ACPI_DEBUG_OUTPUT -/******************************************************************************* - * - * FUNCTION: AcpiUtDisplayInitPathname - * - * PARAMETERS: Type - Object type of the node - * ObjHandle - Handle whose pathname will be displayed - * Path - Additional path string to be appended. - * (NULL if no extra path) - * - * RETURN: ACPI_STATUS - * - * DESCRIPTION: Display full pathname of an object, DEBUG ONLY - * - ******************************************************************************/ - -void -AcpiUtDisplayInitPathname ( - UINT8 Type, - ACPI_NAMESPACE_NODE *ObjHandle, - char *Path) -{ - ACPI_STATUS Status; - ACPI_BUFFER Buffer; - - - ACPI_FUNCTION_ENTRY (); - - - /* Only print the path if the appropriate debug level is enabled */ - - if (!(AcpiDbgLevel & ACPI_LV_INIT_NAMES)) - { - return; - } - - /* Get the full pathname to the node */ - - Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; - Status = AcpiNsHandleToPathname (ObjHandle, &Buffer); - if (ACPI_FAILURE (Status)) - { - return; - } - - /* Print what we're doing */ - - switch (Type) - { - case ACPI_TYPE_METHOD: - AcpiOsPrintf ("Executing "); - break; - - default: - AcpiOsPrintf ("Initializing "); - break; - } - - /* Print the object type and pathname */ - - AcpiOsPrintf ("%-12s %s", - AcpiUtGetTypeName (Type), (char *) Buffer.Pointer); - - /* Extra path is used to append names like _STA, _INI, etc. */ - - if (Path) - { - AcpiOsPrintf (".%s", Path); - } - AcpiOsPrintf ("\n"); - - ACPI_FREE (Buffer.Pointer); -} -#endif - - -/******************************************************************************* - * - * FUNCTION: AcpiUtValidAcpiChar - * - * PARAMETERS: Char - The character to be examined - * Position - Byte position (0-3) - * - * RETURN: TRUE if the character is valid, FALSE otherwise - * - * DESCRIPTION: Check for a valid ACPI character. Must be one of: - * 1) Upper case alpha - * 2) numeric - * 3) underscore - * - * We allow a '!' as the last character because of the ASF! table - * - ******************************************************************************/ - -BOOLEAN -AcpiUtValidAcpiChar ( - char Character, - UINT32 Position) -{ - - if (!((Character >= 'A' && Character <= 'Z') || - (Character >= '0' && Character <= '9') || - (Character == '_'))) - { - /* Allow a '!' in the last position */ - - if (Character == '!' && Position == 3) - { - return (TRUE); - } - - return (FALSE); - } - - return (TRUE); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtValidAcpiName - * - * PARAMETERS: Name - The name to be examined - * - * RETURN: TRUE if the name is valid, FALSE otherwise - * - * DESCRIPTION: Check for a valid ACPI name. Each character must be one of: - * 1) Upper case alpha - * 2) numeric - * 3) underscore - * - ******************************************************************************/ - -BOOLEAN -AcpiUtValidAcpiName ( - UINT32 Name) -{ - UINT32 i; - - - ACPI_FUNCTION_ENTRY (); - - - for (i = 0; i < ACPI_NAME_SIZE; i++) - { - if (!AcpiUtValidAcpiChar ((ACPI_CAST_PTR (char, &Name))[i], i)) - { - return (FALSE); - } - } - - return (TRUE); -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtRepairName - * - * PARAMETERS: Name - The ACPI name to be repaired - * - * RETURN: Repaired version of the name - * - * DESCRIPTION: Repair an ACPI name: Change invalid characters to '*' and - * return the new name. NOTE: the Name parameter must reside in - * read/write memory, cannot be a const. - * - * An ACPI Name must consist of valid ACPI characters. We will repair the name - * if necessary because we don't want to abort because of this, but we want - * all namespace names to be printable. A warning message is appropriate. - * - * This issue came up because there are in fact machines that exhibit - * this problem, and we want to be able to enable ACPI support for them, - * even though there are a few bad names. - * - ******************************************************************************/ - -void -AcpiUtRepairName ( - char *Name) -{ - UINT32 i; - BOOLEAN FoundBadChar = FALSE; - - - ACPI_FUNCTION_NAME (UtRepairName); - - - /* Check each character in the name */ - - for (i = 0; i < ACPI_NAME_SIZE; i++) - { - if (AcpiUtValidAcpiChar (Name[i], i)) - { - continue; - } - - /* - * Replace a bad character with something printable, yet technically - * still invalid. This prevents any collisions with existing "good" - * names in the namespace. - */ - Name[i] = '*'; - FoundBadChar = TRUE; - } - - if (FoundBadChar) - { - /* Report warning only if in strict mode or debug mode */ - - if (!AcpiGbl_EnableInterpreterSlack) - { - ACPI_WARNING ((AE_INFO, - "Found bad character(s) in name, repaired: [%4.4s]\n", Name)); - } - else - { - ACPI_DEBUG_PRINT ((ACPI_DB_INFO, - "Found bad character(s) in name, repaired: [%4.4s]\n", Name)); - } - } -} - - -/******************************************************************************* - * - * FUNCTION: AcpiUtStrtoul64 - * - * PARAMETERS: String - Null terminated string - * Base - Radix of the string: 16 or ACPI_ANY_BASE; - * ACPI_ANY_BASE means 'in behalf of ToInteger' - * RetInteger - Where the converted integer is returned - * - * RETURN: Status and Converted value - * - * DESCRIPTION: Convert a string into an unsigned value. Performs either a - * 32-bit or 64-bit conversion, depending on the current mode - * of the interpreter. - * NOTE: Does not support Octal strings, not needed. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiUtStrtoul64 ( - char *String, - UINT32 Base, - UINT64 *RetInteger) -{ - UINT32 ThisDigit = 0; - UINT64 ReturnValue = 0; - UINT64 Quotient; - UINT64 Dividend; - UINT32 ToIntegerOp = (Base == ACPI_ANY_BASE); - UINT32 Mode32 = (AcpiGbl_IntegerByteWidth == 4); - UINT8 ValidDigits = 0; - UINT8 SignOf0x = 0; - UINT8 Term = 0; - - - ACPI_FUNCTION_TRACE_STR (UtStroul64, String); - - - switch (Base) - { - case ACPI_ANY_BASE: - case 16: - break; - - default: - /* Invalid Base */ - return_ACPI_STATUS (AE_BAD_PARAMETER); - } - - if (!String) - { - goto ErrorExit; - } - - /* Skip over any white space in the buffer */ - - while ((*String) && (ACPI_IS_SPACE (*String) || *String == '\t')) - { - String++; - } - - if (ToIntegerOp) - { - /* - * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. - * We need to determine if it is decimal or hexadecimal. - */ - if ((*String == '0') && (ACPI_TOLOWER (*(String + 1)) == 'x')) - { - SignOf0x = 1; - Base = 16; - - /* Skip over the leading '0x' */ - String += 2; - } - else - { - Base = 10; - } - } - - /* Any string left? Check that '0x' is not followed by white space. */ - - if (!(*String) || ACPI_IS_SPACE (*String) || *String == '\t') - { - if (ToIntegerOp) - { - goto ErrorExit; - } - else - { - goto AllDone; - } - } - - /* - * Perform a 32-bit or 64-bit conversion, depending upon the current - * execution mode of the interpreter - */ - Dividend = (Mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX; - - /* Main loop: convert the string to a 32- or 64-bit integer */ - - while (*String) - { - if (ACPI_IS_DIGIT (*String)) - { - /* Convert ASCII 0-9 to Decimal value */ - - ThisDigit = ((UINT8) *String) - '0'; - } - else if (Base == 10) - { - /* Digit is out of range; possible in ToInteger case only */ - - Term = 1; - } - else - { - ThisDigit = (UINT8) ACPI_TOUPPER (*String); - if (ACPI_IS_XDIGIT ((char) ThisDigit)) - { - /* Convert ASCII Hex char to value */ - - ThisDigit = ThisDigit - 'A' + 10; - } - else - { - Term = 1; - } - } - - if (Term) - { - if (ToIntegerOp) - { - goto ErrorExit; - } - else - { - break; - } - } - else if ((ValidDigits == 0) && (ThisDigit == 0) && !SignOf0x) - { - /* Skip zeros */ - String++; - continue; - } - - ValidDigits++; - - if (SignOf0x && ((ValidDigits > 16) || ((ValidDigits > 8) && Mode32))) - { - /* - * This is ToInteger operation case. - * No any restrictions for string-to-integer conversion, - * see ACPI spec. - */ - goto ErrorExit; - } - - /* Divide the digit into the correct position */ - - (void) AcpiUtShortDivide ((Dividend - (UINT64) ThisDigit), - Base, &Quotient, NULL); - - if (ReturnValue > Quotient) - { - if (ToIntegerOp) - { - goto ErrorExit; - } - else - { - break; - } - } - - ReturnValue *= Base; - ReturnValue += ThisDigit; - String++; - } - - /* All done, normal exit */ - -AllDone: - - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n", - ACPI_FORMAT_UINT64 (ReturnValue))); - - *RetInteger = ReturnValue; - return_ACPI_STATUS (AE_OK); - - -ErrorExit: - /* Base was set/validated above */ - - if (Base == 10) - { - return_ACPI_STATUS (AE_BAD_DECIMAL_CONSTANT); - } - else - { - return_ACPI_STATUS (AE_BAD_HEX_CONSTANT); - } -} - - /******************************************************************************* * * FUNCTION: AcpiUtCreateUpdateStateAndPush @@ -1244,10 +364,10 @@ AcpiUtWalkPackageTree ( /* * Check for: - * 1) An uninitialized package element. It is completely + * 1) An uninitialized package element. It is completely * legal to declare a package and leave it uninitialized * 2) Not an internal object - can be a namespace node instead - * 3) Any type other than a package. Packages are handled in else + * 3) Any type other than a package. Packages are handled in else * case below. */ if ((!ThisSourceObj) || @@ -1266,7 +386,7 @@ AcpiUtWalkPackageTree ( { /* * We've handled all of the objects at this level, This means - * that we have just completed a package. That package may + * that we have just completed a package. That package may * have contained one or more packages itself. * * Delete this state and pop the previous state (package). @@ -1331,3 +451,79 @@ AcpiUtWalkPackageTree ( } +#ifdef ACPI_DEBUG_OUTPUT +/******************************************************************************* + * + * FUNCTION: AcpiUtDisplayInitPathname + * + * PARAMETERS: Type - Object type of the node + * ObjHandle - Handle whose pathname will be displayed + * Path - Additional path string to be appended. + * (NULL if no extra path) + * + * RETURN: ACPI_STATUS + * + * DESCRIPTION: Display full pathname of an object, DEBUG ONLY + * + ******************************************************************************/ + +void +AcpiUtDisplayInitPathname ( + UINT8 Type, + ACPI_NAMESPACE_NODE *ObjHandle, + char *Path) +{ + ACPI_STATUS Status; + ACPI_BUFFER Buffer; + + + ACPI_FUNCTION_ENTRY (); + + + /* Only print the path if the appropriate debug level is enabled */ + + if (!(AcpiDbgLevel & ACPI_LV_INIT_NAMES)) + { + return; + } + + /* Get the full pathname to the node */ + + Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER; + Status = AcpiNsHandleToPathname (ObjHandle, &Buffer); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Print what we're doing */ + + switch (Type) + { + case ACPI_TYPE_METHOD: + + AcpiOsPrintf ("Executing "); + break; + + default: + + AcpiOsPrintf ("Initializing "); + break; + } + + /* Print the object type and pathname */ + + AcpiOsPrintf ("%-12s %s", + AcpiUtGetTypeName (Type), (char *) Buffer.Pointer); + + /* Extra path is used to append names like _STA, _INI, etc. */ + + if (Path) + { + AcpiOsPrintf (".%s", Path); + } + AcpiOsPrintf ("\n"); + + ACPI_FREE (Buffer.Pointer); +} +#endif diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utmutex.c b/reactos/drivers/bus/acpi/acpica/utilities/utmutex.c index 01a2422e93c..168afa3e084 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utmutex.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utmutex.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -168,7 +168,7 @@ AcpiUtMutexInitialize ( } } - /* Create the spinlocks for use at interrupt level */ + /* Create the spinlocks for use at interrupt level or for speed */ Status = AcpiOsCreateLock (&AcpiGbl_GpeLock); if (ACPI_FAILURE (Status)) @@ -182,7 +182,14 @@ AcpiUtMutexInitialize ( return_ACPI_STATUS (Status); } + Status = AcpiOsCreateLock (&AcpiGbl_ReferenceCountLock); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + /* Mutex for _OSI support */ + Status = AcpiOsCreateMutex (&AcpiGbl_OsiMutex); if (ACPI_FAILURE (Status)) { @@ -232,6 +239,7 @@ AcpiUtMutexTerminate ( AcpiOsDeleteLock (AcpiGbl_GpeLock); AcpiOsDeleteLock (AcpiGbl_HardwareLock); + AcpiOsDeleteLock (AcpiGbl_ReferenceCountLock); /* Delete the reader/writer lock */ @@ -297,6 +305,8 @@ AcpiUtDeleteMutex ( AcpiGbl_MutexInfo[MutexId].Mutex = NULL; AcpiGbl_MutexInfo[MutexId].ThreadId = ACPI_MUTEX_NOT_ACQUIRED; + + return_VOID; } @@ -336,9 +346,9 @@ AcpiUtAcquireMutex ( /* * Mutex debug code, for internal debugging only. * - * Deadlock prevention. Check if this thread owns any mutexes of value - * greater than or equal to this one. If so, the thread has violated - * the mutex ordering rule. This indicates a coding error somewhere in + * Deadlock prevention. Check if this thread owns any mutexes of value + * greater than or equal to this one. If so, the thread has violated + * the mutex ordering rule. This indicates a coding error somewhere in * the ACPI subsystem code. */ for (i = MutexId; i < ACPI_NUM_MUTEX; i++) @@ -407,15 +417,11 @@ ACPI_STATUS AcpiUtReleaseMutex ( ACPI_MUTEX_HANDLE MutexId) { - ACPI_THREAD_ID ThisThreadId; - - ACPI_FUNCTION_NAME (UtReleaseMutex); - ThisThreadId = AcpiOsGetThreadId (); ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Thread %u releasing Mutex [%s]\n", - (UINT32) ThisThreadId, AcpiUtGetMutexName (MutexId))); + (UINT32) AcpiOsGetThreadId (), AcpiUtGetMutexName (MutexId))); if (MutexId > ACPI_MAX_MUTEX) { @@ -439,14 +445,14 @@ AcpiUtReleaseMutex ( /* * Mutex debug code, for internal debugging only. * - * Deadlock prevention. Check if this thread owns any mutexes of value - * greater than this one. If so, the thread has violated the mutex - * ordering rule. This indicates a coding error somewhere in + * Deadlock prevention. Check if this thread owns any mutexes of value + * greater than this one. If so, the thread has violated the mutex + * ordering rule. This indicates a coding error somewhere in * the ACPI subsystem code. */ for (i = MutexId; i < ACPI_NUM_MUTEX; i++) { - if (AcpiGbl_MutexInfo[i].ThreadId == ThisThreadId) + if (AcpiGbl_MutexInfo[i].ThreadId == AcpiOsGetThreadId ()) { if (i == MutexId) { @@ -470,5 +476,3 @@ AcpiUtReleaseMutex ( AcpiOsReleaseMutex (AcpiGbl_MutexInfo[MutexId].Mutex); return (AE_OK); } - - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utobject.c b/reactos/drivers/bus/acpi/acpica/utilities/utobject.c index f62ebe01a83..c32782b4553 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utobject.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utobject.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -158,7 +158,7 @@ AcpiUtGetElementLength ( * * NOTE: We always allocate the worst-case object descriptor because * these objects are cached, and we want them to be - * one-size-satisifies-any-request. This in itself may not be + * one-size-satisifies-any-request. This in itself may not be * the most memory efficient, but the efficiency of the object * cache should more than make up for this! * @@ -212,6 +212,7 @@ AcpiUtCreateInternalObjectDbg ( break; default: + /* All others have no secondary object */ break; } @@ -438,7 +439,7 @@ AcpiUtCreateStringObject ( * * RETURN: TRUE if object is valid, FALSE otherwise * - * DESCRIPTION: Validate a pointer to be an ACPI_OPERAND_OBJECT + * DESCRIPTION: Validate a pointer to be of type ACPI_OPERAND_OBJECT * ******************************************************************************/ @@ -464,11 +465,12 @@ AcpiUtValidInternalObject ( { case ACPI_DESC_TYPE_OPERAND: - /* The object appears to be a valid ACPI_OPERAND_OBJECT */ + /* The object appears to be a valid ACPI_OPERAND_OBJECT */ return (TRUE); default: + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%p is not not an ACPI operand obj [%s]\n", Object, AcpiUtGetDescriptorName (Object))); @@ -487,9 +489,9 @@ AcpiUtValidInternalObject ( * LineNumber - Caller's line number (for error output) * ComponentId - Caller's component ID (for error output) * - * RETURN: Pointer to newly allocated object descriptor. Null on error + * RETURN: Pointer to newly allocated object descriptor. Null on error * - * DESCRIPTION: Allocate a new object descriptor. Gracefully handle + * DESCRIPTION: Allocate a new object descriptor. Gracefully handle * error conditions. * ******************************************************************************/ @@ -545,7 +547,7 @@ AcpiUtDeleteObjectDesc ( ACPI_FUNCTION_TRACE_PTR (UtDeleteObjectDesc, Object); - /* Object must be an ACPI_OPERAND_OBJECT */ + /* Object must be of type ACPI_OPERAND_OBJECT */ if (ACPI_GET_DESCRIPTOR_TYPE (Object) != ACPI_DESC_TYPE_OPERAND) { @@ -628,13 +630,11 @@ AcpiUtGetSimpleObjectSize ( Length += (ACPI_SIZE) InternalObject->String.Length + 1; break; - case ACPI_TYPE_BUFFER: Length += (ACPI_SIZE) InternalObject->Buffer.Length; break; - case ACPI_TYPE_INTEGER: case ACPI_TYPE_PROCESSOR: case ACPI_TYPE_POWER: @@ -643,13 +643,11 @@ AcpiUtGetSimpleObjectSize ( break; - case ACPI_TYPE_LOCAL_REFERENCE: switch (InternalObject->Reference.Class) { case ACPI_REFCLASS_NAME: - /* * Get the actual length of the full pathname to this object. * The reference will be converted to the pathname to the object @@ -664,7 +662,6 @@ AcpiUtGetSimpleObjectSize ( break; default: - /* * No other reference opcodes are supported. * Notably, Locals and Args are not supported, but this may be @@ -679,7 +676,6 @@ AcpiUtGetSimpleObjectSize ( } break; - default: ACPI_ERROR ((AE_INFO, "Cannot convert to external object - " @@ -692,7 +688,7 @@ AcpiUtGetSimpleObjectSize ( /* * Account for the space required by the object rounded up to the next - * multiple of the machine word size. This keeps each object aligned + * multiple of the machine word size. This keeps each object aligned * on a machine word boundary. (preventing alignment faults on some * machines.) */ @@ -728,7 +724,6 @@ AcpiUtGetElementLength ( switch (ObjectType) { case ACPI_COPY_TYPE_SIMPLE: - /* * Simple object - just get the size (Null object/entry is handled * here also) and sum it into the running package length @@ -742,7 +737,6 @@ AcpiUtGetElementLength ( Info->Length += ObjectSpace; break; - case ACPI_COPY_TYPE_PACKAGE: /* Package object - nothing much to do here, let the walk handle it */ @@ -751,7 +745,6 @@ AcpiUtGetElementLength ( State->Pkg.ThisTargetObj = NULL; break; - default: /* No other types allowed */ @@ -797,7 +790,7 @@ AcpiUtGetPackageObjectSize ( Info.NumPackages = 1; Status = AcpiUtWalkPackageTree (InternalObject, NULL, - AcpiUtGetElementLength, &Info); + AcpiUtGetElementLength, &Info); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); @@ -855,5 +848,3 @@ AcpiUtGetObjectSize ( return (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utosi.c b/reactos/drivers/bus/acpi/acpica/utilities/utosi.c index 2b64d674b2f..a001d06bd87 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utosi.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utosi.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -122,6 +122,34 @@ #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utosi") + +/****************************************************************************** + * + * ACPICA policy for new _OSI strings: + * + * It is the stated policy of ACPICA that new _OSI strings will be integrated + * into this module as soon as possible after they are defined. It is strongly + * recommended that all ACPICA hosts mirror this policy and integrate any + * changes to this module as soon as possible. There are several historical + * reasons behind this policy: + * + * 1) New BIOSs tend to test only the case where the host responds TRUE to + * the latest version of Windows, which would respond to the latest/newest + * _OSI string. Not responding TRUE to the latest version of Windows will + * risk executing untested code paths throughout the DSDT and SSDTs. + * + * 2) If a new _OSI string is recognized only after a significant delay, this + * has the potential to cause problems on existing working machines because + * of the possibility that a new and different path through the ASL code + * will be executed. + * + * 3) New _OSI strings are tending to come out about once per year. A delay + * in recognizing a new string for a significant amount of time risks the + * release of another string which only compounds the initial problem. + * + *****************************************************************************/ + + /* * Strings supported by the _OSI predefined control method (which is * implemented internally within this module.) @@ -149,24 +177,25 @@ static ACPI_INTERFACE_INFO AcpiDefaultSupportedInterfaces[] = {"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */ {"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */ {"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */ + {"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */ + {"Windows 2013", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */ /* Feature Group Strings */ - {"Extended Address Space Descriptor", NULL, 0, 0} + {"Extended Address Space Descriptor", NULL, ACPI_OSI_FEATURE, 0}, /* * All "optional" feature group strings (features that are implemented - * by the host) should be dynamically added by the host via - * AcpiInstallInterface and should not be manually added here. - * - * Examples of optional feature group strings: - * - * "Module Device" - * "Processor Device" - * "3.0 Thermal Model" - * "3.0 _SCP Extensions" - * "Processor Aggregator Device" + * by the host) should be dynamically modified to VALID by the host via + * AcpiInstallInterface or AcpiUpdateInterfaces. Such optional feature + * group strings are set as INVALID by default here. */ + + {"Module Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}, + {"Processor Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}, + {"3.0 Thermal Model", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}, + {"3.0 _SCP Extensions", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0}, + {"Processor Aggregator Device", NULL, ACPI_OSI_OPTIONAL_FEATURE, 0} }; @@ -186,10 +215,16 @@ ACPI_STATUS AcpiUtInitializeInterfaces ( void) { + ACPI_STATUS Status; UINT32 i; - (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + AcpiGbl_SupportedInterfaces = AcpiDefaultSupportedInterfaces; /* Link the static list of supported interfaces */ @@ -211,39 +246,58 @@ AcpiUtInitializeInterfaces ( * * PARAMETERS: None * - * RETURN: None + * RETURN: Status * * DESCRIPTION: Delete all interfaces in the global list. Sets * AcpiGbl_SupportedInterfaces to NULL. * ******************************************************************************/ -void +ACPI_STATUS AcpiUtInterfaceTerminate ( void) { + ACPI_STATUS Status; ACPI_INTERFACE_INFO *NextInterface; - (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); - NextInterface = AcpiGbl_SupportedInterfaces; + Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + NextInterface = AcpiGbl_SupportedInterfaces; while (NextInterface) { AcpiGbl_SupportedInterfaces = NextInterface->Next; - /* Only interfaces added at runtime can be freed */ - if (NextInterface->Flags & ACPI_OSI_DYNAMIC) { + /* Only interfaces added at runtime can be freed */ + ACPI_FREE (NextInterface->Name); ACPI_FREE (NextInterface); } + else + { + /* Interface is in static list. Reset it to invalid or valid. */ + + if (NextInterface->Flags & ACPI_OSI_DEFAULT_INVALID) + { + NextInterface->Flags |= ACPI_OSI_INVALID; + } + else + { + NextInterface->Flags &= ~ACPI_OSI_INVALID; + } + } NextInterface = AcpiGbl_SupportedInterfaces; } AcpiOsReleaseMutex (AcpiGbl_OsiMutex); + return (AE_OK); } @@ -364,6 +418,57 @@ AcpiUtRemoveInterface ( } +/******************************************************************************* + * + * FUNCTION: AcpiUtUpdateInterfaces + * + * PARAMETERS: Action - Actions to be performed during the + * update + * + * RETURN: Status + * + * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor + * strings or/and feature group strings. + * Caller MUST hold AcpiGbl_OsiMutex + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUtUpdateInterfaces ( + UINT8 Action) +{ + ACPI_INTERFACE_INFO *NextInterface; + + + NextInterface = AcpiGbl_SupportedInterfaces; + while (NextInterface) + { + if (((NextInterface->Flags & ACPI_OSI_FEATURE) && + (Action & ACPI_FEATURE_STRINGS)) || + (!(NextInterface->Flags & ACPI_OSI_FEATURE) && + (Action & ACPI_VENDOR_STRINGS))) + { + if (Action & ACPI_DISABLE_INTERFACES) + { + /* Mark the interfaces as invalid */ + + NextInterface->Flags |= ACPI_OSI_INVALID; + } + else + { + /* Mark the interfaces as valid */ + + NextInterface->Flags &= ~ACPI_OSI_INVALID; + } + } + + NextInterface = NextInterface->Next; + } + + return (AE_OK); +} + + /******************************************************************************* * * FUNCTION: AcpiUtGetInterface @@ -421,6 +526,7 @@ AcpiUtOsiImplementation ( ACPI_OPERAND_OBJECT *ReturnDesc; ACPI_INTERFACE_INFO *InterfaceInfo; ACPI_INTERFACE_HANDLER InterfaceHandler; + ACPI_STATUS Status; UINT32 ReturnValue; @@ -447,7 +553,12 @@ AcpiUtOsiImplementation ( /* Default return value is 0, NOT SUPPORTED */ ReturnValue = 0; - (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + if (ACPI_FAILURE (Status)) + { + AcpiUtRemoveReference (ReturnDesc); + return_ACPI_STATUS (Status); + } /* Lookup the interface in the global _OSI list */ diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utownerid.c b/reactos/drivers/bus/acpi/acpica/utilities/utownerid.c new file mode 100644 index 00000000000..ae42970eac7 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/utilities/utownerid.c @@ -0,0 +1,313 @@ +/******************************************************************************* + * + * Module Name: utownerid - Support for Table/Method Owner IDs + * + ******************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#define __UTOWNERID_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" + + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utownerid") + + +/******************************************************************************* + * + * FUNCTION: AcpiUtAllocateOwnerId + * + * PARAMETERS: OwnerId - Where the new owner ID is returned + * + * RETURN: Status + * + * DESCRIPTION: Allocate a table or method owner ID. The owner ID is used to + * track objects created by the table or method, to be deleted + * when the method exits or the table is unloaded. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUtAllocateOwnerId ( + ACPI_OWNER_ID *OwnerId) +{ + UINT32 i; + UINT32 j; + UINT32 k; + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (UtAllocateOwnerId); + + + /* Guard against multiple allocations of ID to the same location */ + + if (*OwnerId) + { + ACPI_ERROR ((AE_INFO, "Owner ID [0x%2.2X] already exists", *OwnerId)); + return_ACPI_STATUS (AE_ALREADY_EXISTS); + } + + /* Mutex for the global ID mask */ + + Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + + /* + * Find a free owner ID, cycle through all possible IDs on repeated + * allocations. (ACPI_NUM_OWNERID_MASKS + 1) because first index may have + * to be scanned twice. + */ + for (i = 0, j = AcpiGbl_LastOwnerIdIndex; + i < (ACPI_NUM_OWNERID_MASKS + 1); + i++, j++) + { + if (j >= ACPI_NUM_OWNERID_MASKS) + { + j = 0; /* Wraparound to start of mask array */ + } + + for (k = AcpiGbl_NextOwnerIdOffset; k < 32; k++) + { + if (AcpiGbl_OwnerIdMask[j] == ACPI_UINT32_MAX) + { + /* There are no free IDs in this mask */ + + break; + } + + if (!(AcpiGbl_OwnerIdMask[j] & (1 << k))) + { + /* + * Found a free ID. The actual ID is the bit index plus one, + * making zero an invalid Owner ID. Save this as the last ID + * allocated and update the global ID mask. + */ + AcpiGbl_OwnerIdMask[j] |= (1 << k); + + AcpiGbl_LastOwnerIdIndex = (UINT8) j; + AcpiGbl_NextOwnerIdOffset = (UINT8) (k + 1); + + /* + * Construct encoded ID from the index and bit position + * + * Note: Last [j].k (bit 255) is never used and is marked + * permanently allocated (prevents +1 overflow) + */ + *OwnerId = (ACPI_OWNER_ID) ((k + 1) + ACPI_MUL_32 (j)); + + ACPI_DEBUG_PRINT ((ACPI_DB_VALUES, + "Allocated OwnerId: %2.2X\n", (unsigned int) *OwnerId)); + goto Exit; + } + } + + AcpiGbl_NextOwnerIdOffset = 0; + } + + /* + * All OwnerIds have been allocated. This typically should + * not happen since the IDs are reused after deallocation. The IDs are + * allocated upon table load (one per table) and method execution, and + * they are released when a table is unloaded or a method completes + * execution. + * + * If this error happens, there may be very deep nesting of invoked control + * methods, or there may be a bug where the IDs are not released. + */ + Status = AE_OWNER_ID_LIMIT; + ACPI_ERROR ((AE_INFO, + "Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT")); + +Exit: + (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); + return_ACPI_STATUS (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtReleaseOwnerId + * + * PARAMETERS: OwnerIdPtr - Pointer to a previously allocated OwnerID + * + * RETURN: None. No error is returned because we are either exiting a + * control method or unloading a table. Either way, we would + * ignore any error anyway. + * + * DESCRIPTION: Release a table or method owner ID. Valid IDs are 1 - 255 + * + ******************************************************************************/ + +void +AcpiUtReleaseOwnerId ( + ACPI_OWNER_ID *OwnerIdPtr) +{ + ACPI_OWNER_ID OwnerId = *OwnerIdPtr; + ACPI_STATUS Status; + UINT32 Index; + UINT32 Bit; + + + ACPI_FUNCTION_TRACE_U32 (UtReleaseOwnerId, OwnerId); + + + /* Always clear the input OwnerId (zero is an invalid ID) */ + + *OwnerIdPtr = 0; + + /* Zero is not a valid OwnerID */ + + if (OwnerId == 0) + { + ACPI_ERROR ((AE_INFO, "Invalid OwnerId: 0x%2.2X", OwnerId)); + return_VOID; + } + + /* Mutex for the global ID mask */ + + Status = AcpiUtAcquireMutex (ACPI_MTX_CACHES); + if (ACPI_FAILURE (Status)) + { + return_VOID; + } + + /* Normalize the ID to zero */ + + OwnerId--; + + /* Decode ID to index/offset pair */ + + Index = ACPI_DIV_32 (OwnerId); + Bit = 1 << ACPI_MOD_32 (OwnerId); + + /* Free the owner ID only if it is valid */ + + if (AcpiGbl_OwnerIdMask[Index] & Bit) + { + AcpiGbl_OwnerIdMask[Index] ^= Bit; + } + else + { + ACPI_ERROR ((AE_INFO, + "Release of non-allocated OwnerId: 0x%2.2X", OwnerId + 1)); + } + + (void) AcpiUtReleaseMutex (ACPI_MTX_CACHES); + return_VOID; +} diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utpredef.c b/reactos/drivers/bus/acpi/acpica/utilities/utpredef.c new file mode 100644 index 00000000000..d20e90583ac --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/utilities/utpredef.c @@ -0,0 +1,524 @@ +/****************************************************************************** + * + * Module Name: utpredef - support functions for predefined names + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __UTPREDEF_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acpredef.h" + + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utpredef") + + +/* + * Names for the types that can be returned by the predefined objects. + * Used for warning messages. Must be in the same order as the ACPI_RTYPEs + */ +static const char *UtRtypeNames[] = +{ + "/Integer", + "/String", + "/Buffer", + "/Package", + "/Reference", +}; + + +/******************************************************************************* + * + * FUNCTION: AcpiUtGetNextPredefinedMethod + * + * PARAMETERS: ThisName - Entry in the predefined method/name table + * + * RETURN: Pointer to next entry in predefined table. + * + * DESCRIPTION: Get the next entry in the predefine method table. Handles the + * cases where a package info entry follows a method name that + * returns a package. + * + ******************************************************************************/ + +const ACPI_PREDEFINED_INFO * +AcpiUtGetNextPredefinedMethod ( + const ACPI_PREDEFINED_INFO *ThisName) +{ + + /* + * Skip next entry in the table if this name returns a Package + * (next entry contains the package info) + */ + if ((ThisName->Info.ExpectedBtypes & ACPI_RTYPE_PACKAGE) && + (ThisName->Info.ExpectedBtypes != ACPI_RTYPE_ALL)) + { + ThisName++; + } + + ThisName++; + return (ThisName); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtMatchPredefinedMethod + * + * PARAMETERS: Name - Name to find + * + * RETURN: Pointer to entry in predefined table. NULL indicates not found. + * + * DESCRIPTION: Check an object name against the predefined object list. + * + ******************************************************************************/ + +const ACPI_PREDEFINED_INFO * +AcpiUtMatchPredefinedMethod ( + char *Name) +{ + const ACPI_PREDEFINED_INFO *ThisName; + + + /* Quick check for a predefined name, first character must be underscore */ + + if (Name[0] != '_') + { + return (NULL); + } + + /* Search info table for a predefined method/object name */ + + ThisName = AcpiGbl_PredefinedMethods; + while (ThisName->Info.Name[0]) + { + if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name)) + { + return (ThisName); + } + + ThisName = AcpiUtGetNextPredefinedMethod (ThisName); + } + + return (NULL); /* Not found */ +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtGetExpectedReturnTypes + * + * PARAMETERS: Buffer - Where the formatted string is returned + * ExpectedBTypes - Bitfield of expected data types + * + * RETURN: Formatted string in Buffer. + * + * DESCRIPTION: Format the expected object types into a printable string. + * + ******************************************************************************/ + +void +AcpiUtGetExpectedReturnTypes ( + char *Buffer, + UINT32 ExpectedBtypes) +{ + UINT32 ThisRtype; + UINT32 i; + UINT32 j; + + + if (!ExpectedBtypes) + { + ACPI_STRCPY (Buffer, "NONE"); + return; + } + + j = 1; + Buffer[0] = 0; + ThisRtype = ACPI_RTYPE_INTEGER; + + for (i = 0; i < ACPI_NUM_RTYPES; i++) + { + /* If one of the expected types, concatenate the name of this type */ + + if (ExpectedBtypes & ThisRtype) + { + ACPI_STRCAT (Buffer, &UtRtypeNames[i][j]); + j = 0; /* Use name separator from now on */ + } + + ThisRtype <<= 1; /* Next Rtype */ + } +} + + +/******************************************************************************* + * + * The remaining functions are used by iASL and AcpiHelp only + * + ******************************************************************************/ + +#if (defined ACPI_ASL_COMPILER || defined ACPI_HELP_APP) +#include +#include + +/* Local prototypes */ + +static UINT32 +AcpiUtGetArgumentTypes ( + char *Buffer, + UINT16 ArgumentTypes); + + +/* Types that can be returned externally by a predefined name */ + +static const char *UtExternalTypeNames[] = /* Indexed by ACPI_TYPE_* */ +{ + ", UNSUPPORTED-TYPE", + ", Integer", + ", String", + ", Buffer", + ", Package" +}; + +/* Bit widths for resource descriptor predefined names */ + +static const char *UtResourceTypeNames[] = +{ + "/1", + "/2", + "/3", + "/8", + "/16", + "/32", + "/64", + "/variable", +}; + + +/******************************************************************************* + * + * FUNCTION: AcpiUtMatchResourceName + * + * PARAMETERS: Name - Name to find + * + * RETURN: Pointer to entry in the resource table. NULL indicates not + * found. + * + * DESCRIPTION: Check an object name against the predefined resource + * descriptor object list. + * + ******************************************************************************/ + +const ACPI_PREDEFINED_INFO * +AcpiUtMatchResourceName ( + char *Name) +{ + const ACPI_PREDEFINED_INFO *ThisName; + + + /* Quick check for a predefined name, first character must be underscore */ + + if (Name[0] != '_') + { + return (NULL); + } + + /* Search info table for a predefined method/object name */ + + ThisName = AcpiGbl_ResourceNames; + while (ThisName->Info.Name[0]) + { + if (ACPI_COMPARE_NAME (Name, ThisName->Info.Name)) + { + return (ThisName); + } + + ThisName++; + } + + return (NULL); /* Not found */ +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtDisplayPredefinedMethod + * + * PARAMETERS: Buffer - Scratch buffer for this function + * ThisName - Entry in the predefined method/name table + * MultiLine - TRUE if output should be on >1 line + * + * RETURN: None + * + * DESCRIPTION: Display information about a predefined method. Number and + * type of the input arguments, and expected type(s) for the + * return value, if any. + * + ******************************************************************************/ + +void +AcpiUtDisplayPredefinedMethod ( + char *Buffer, + const ACPI_PREDEFINED_INFO *ThisName, + BOOLEAN MultiLine) +{ + UINT32 ArgCount; + + /* + * Get the argument count and the string buffer + * containing all argument types + */ + ArgCount = AcpiUtGetArgumentTypes (Buffer, + ThisName->Info.ArgumentList); + + if (MultiLine) + { + printf (" "); + } + + printf ("%4.4s Requires %s%u argument%s", + ThisName->Info.Name, + (ThisName->Info.ArgumentList & ARG_COUNT_IS_MINIMUM) ? + "(at least) " : "", + ArgCount, ArgCount != 1 ? "s" : ""); + + /* Display the types for any arguments */ + + if (ArgCount > 0) + { + printf (" (%s)", Buffer); + } + + if (MultiLine) + { + printf ("\n "); + } + + /* Get the return value type(s) allowed */ + + if (ThisName->Info.ExpectedBtypes) + { + AcpiUtGetExpectedReturnTypes (Buffer, ThisName->Info.ExpectedBtypes); + printf (" Return value types: %s\n", Buffer); + } + else + { + printf (" No return value\n"); + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtGetArgumentTypes + * + * PARAMETERS: Buffer - Where to return the formatted types + * ArgumentTypes - Types field for this method + * + * RETURN: Count - the number of arguments required for this method + * + * DESCRIPTION: Format the required data types for this method (Integer, + * String, Buffer, or Package) and return the required argument + * count. + * + ******************************************************************************/ + +static UINT32 +AcpiUtGetArgumentTypes ( + char *Buffer, + UINT16 ArgumentTypes) +{ + UINT16 ThisArgumentType; + UINT16 SubIndex; + UINT16 ArgCount; + UINT32 i; + + + *Buffer = 0; + SubIndex = 2; + + /* First field in the types list is the count of args to follow */ + + ArgCount = METHOD_GET_ARG_COUNT (ArgumentTypes); + if (ArgCount > METHOD_PREDEF_ARGS_MAX) + { + printf ("**** Invalid argument count (%u) " + "in predefined info structure\n", ArgCount); + return (ArgCount); + } + + /* Get each argument from the list, convert to ascii, store to buffer */ + + for (i = 0; i < ArgCount; i++) + { + ThisArgumentType = METHOD_GET_NEXT_TYPE (ArgumentTypes); + + if (!ThisArgumentType || (ThisArgumentType > METHOD_MAX_ARG_TYPE)) + { + printf ("**** Invalid argument type (%u) " + "in predefined info structure\n", ThisArgumentType); + return (ArgCount); + } + + strcat (Buffer, UtExternalTypeNames[ThisArgumentType] + SubIndex); + SubIndex = 0; + } + + return (ArgCount); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtGetResourceBitWidth + * + * PARAMETERS: Buffer - Where the formatted string is returned + * Types - Bitfield of expected data types + * + * RETURN: Count of return types. Formatted string in Buffer. + * + * DESCRIPTION: Format the resource bit widths into a printable string. + * + ******************************************************************************/ + +UINT32 +AcpiUtGetResourceBitWidth ( + char *Buffer, + UINT16 Types) +{ + UINT32 i; + UINT16 SubIndex; + UINT32 Found; + + + *Buffer = 0; + SubIndex = 1; + Found = 0; + + for (i = 0; i < NUM_RESOURCE_WIDTHS; i++) + { + if (Types & 1) + { + strcat (Buffer, &(UtResourceTypeNames[i][SubIndex])); + SubIndex = 0; + Found++; + } + + Types >>= 1; + } + + return (Found); +} +#endif diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utresrc.c b/reactos/drivers/bus/acpi/acpica/utilities/utresrc.c index a6b6d9c810f..f5af86f9726 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utresrc.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utresrc.c @@ -1,6 +1,6 @@ /******************************************************************************* * - * Module Name: utresrc - Resource managment utilities + * Module Name: utresrc - Resource management utilities * ******************************************************************************/ @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -118,18 +118,18 @@ #include "acpi.h" #include "accommon.h" -#include "amlresrc.h" +#include "acresrc.h" #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utresrc") -#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) +#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER) /* * Strings used to decode resource descriptors. - * Used by both the disasssembler and the debugger resource dump routines + * Used by both the disassembler and the debugger resource dump routines */ const char *AcpiGbl_BmDecode[] = { @@ -220,7 +220,9 @@ const char *AcpiGbl_RwDecode[] = const char *AcpiGbl_ShrDecode[] = { "Exclusive", - "Shared" + "Shared", + "ExclusiveAndWake", /* ACPI 5.0 */ + "SharedAndWake" /* ACPI 5.0 */ }; const char *AcpiGbl_SizDecode[] = @@ -251,6 +253,154 @@ const char *AcpiGbl_TypDecode[] = "TypeF" }; +const char *AcpiGbl_PpcDecode[] = +{ + "PullDefault", + "PullUp", + "PullDown", + "PullNone" +}; + +const char *AcpiGbl_IorDecode[] = +{ + "IoRestrictionNone", + "IoRestrictionInputOnly", + "IoRestrictionOutputOnly", + "IoRestrictionNoneAndPreserve" +}; + +const char *AcpiGbl_DtsDecode[] = +{ + "Width8bit", + "Width16bit", + "Width32bit", + "Width64bit", + "Width128bit", + "Width256bit", +}; + +/* GPIO connection type */ + +const char *AcpiGbl_CtDecode[] = +{ + "Interrupt", + "I/O" +}; + +/* Serial bus type */ + +const char *AcpiGbl_SbtDecode[] = +{ + "/* UNKNOWN serial bus type */", + "I2C", + "SPI", + "UART" +}; + +/* I2C serial bus access mode */ + +const char *AcpiGbl_AmDecode[] = +{ + "AddressingMode7Bit", + "AddressingMode10Bit" +}; + +/* I2C serial bus slave mode */ + +const char *AcpiGbl_SmDecode[] = +{ + "ControllerInitiated", + "DeviceInitiated" +}; + +/* SPI serial bus wire mode */ + +const char *AcpiGbl_WmDecode[] = +{ + "FourWireMode", + "ThreeWireMode" +}; + +/* SPI serial clock phase */ + +const char *AcpiGbl_CphDecode[] = +{ + "ClockPhaseFirst", + "ClockPhaseSecond" +}; + +/* SPI serial bus clock polarity */ + +const char *AcpiGbl_CpoDecode[] = +{ + "ClockPolarityLow", + "ClockPolarityHigh" +}; + +/* SPI serial bus device polarity */ + +const char *AcpiGbl_DpDecode[] = +{ + "PolarityLow", + "PolarityHigh" +}; + +/* UART serial bus endian */ + +const char *AcpiGbl_EdDecode[] = +{ + "LittleEndian", + "BigEndian" +}; + +/* UART serial bus bits per byte */ + +const char *AcpiGbl_BpbDecode[] = +{ + "DataBitsFive", + "DataBitsSix", + "DataBitsSeven", + "DataBitsEight", + "DataBitsNine", + "/* UNKNOWN Bits per byte */", + "/* UNKNOWN Bits per byte */", + "/* UNKNOWN Bits per byte */" +}; + +/* UART serial bus stop bits */ + +const char *AcpiGbl_SbDecode[] = +{ + "StopBitsNone", + "StopBitsOne", + "StopBitsOnePlusHalf", + "StopBitsTwo" +}; + +/* UART serial bus flow control */ + +const char *AcpiGbl_FcDecode[] = +{ + "FlowControlNone", + "FlowControlHardware", + "FlowControlXON", + "/* UNKNOWN flow control keyword */" +}; + +/* UART serial bus parity type */ + +const char *AcpiGbl_PtDecode[] = +{ + "ParityTypeNone", + "ParityTypeEven", + "ParityTypeOdd", + "ParityTypeMark", + "ParityTypeSpace", + "/* UNKNOWN parity keyword */", + "/* UNKNOWN parity keyword */", + "/* UNKNOWN parity keyword */" +}; + #endif @@ -272,7 +422,7 @@ const UINT8 AcpiGbl_ResourceAmlSizes[] = ACPI_AML_SIZE_SMALL (AML_RESOURCE_END_DEPENDENT), ACPI_AML_SIZE_SMALL (AML_RESOURCE_IO), ACPI_AML_SIZE_SMALL (AML_RESOURCE_FIXED_IO), - 0, + ACPI_AML_SIZE_SMALL (AML_RESOURCE_FIXED_DMA), 0, 0, 0, @@ -292,7 +442,18 @@ const UINT8 AcpiGbl_ResourceAmlSizes[] = ACPI_AML_SIZE_LARGE (AML_RESOURCE_ADDRESS16), ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_IRQ), ACPI_AML_SIZE_LARGE (AML_RESOURCE_ADDRESS64), - ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_ADDRESS64) + ACPI_AML_SIZE_LARGE (AML_RESOURCE_EXTENDED_ADDRESS64), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_GPIO), + 0, + ACPI_AML_SIZE_LARGE (AML_RESOURCE_COMMON_SERIALBUS), +}; + +const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[] = +{ + 0, + ACPI_AML_SIZE_LARGE (AML_RESOURCE_I2C_SERIALBUS), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_SPI_SERIALBUS), + ACPI_AML_SIZE_LARGE (AML_RESOURCE_UART_SERIALBUS), }; @@ -310,33 +471,36 @@ static const UINT8 AcpiGbl_ResourceTypes[] = 0, 0, 0, - ACPI_SMALL_VARIABLE_LENGTH, - ACPI_FIXED_LENGTH, - ACPI_SMALL_VARIABLE_LENGTH, - ACPI_FIXED_LENGTH, - ACPI_FIXED_LENGTH, - ACPI_FIXED_LENGTH, + ACPI_SMALL_VARIABLE_LENGTH, /* 04 IRQ */ + ACPI_FIXED_LENGTH, /* 05 DMA */ + ACPI_SMALL_VARIABLE_LENGTH, /* 06 StartDependentFunctions */ + ACPI_FIXED_LENGTH, /* 07 EndDependentFunctions */ + ACPI_FIXED_LENGTH, /* 08 IO */ + ACPI_FIXED_LENGTH, /* 09 FixedIO */ + ACPI_FIXED_LENGTH, /* 0A FixedDMA */ 0, 0, 0, - 0, - ACPI_VARIABLE_LENGTH, - ACPI_FIXED_LENGTH, + ACPI_VARIABLE_LENGTH, /* 0E VendorShort */ + ACPI_FIXED_LENGTH, /* 0F EndTag */ /* Large descriptors */ 0, - ACPI_FIXED_LENGTH, - ACPI_FIXED_LENGTH, + ACPI_FIXED_LENGTH, /* 01 Memory24 */ + ACPI_FIXED_LENGTH, /* 02 GenericRegister */ 0, - ACPI_VARIABLE_LENGTH, - ACPI_FIXED_LENGTH, - ACPI_FIXED_LENGTH, - ACPI_VARIABLE_LENGTH, - ACPI_VARIABLE_LENGTH, - ACPI_VARIABLE_LENGTH, - ACPI_VARIABLE_LENGTH, - ACPI_FIXED_LENGTH + ACPI_VARIABLE_LENGTH, /* 04 VendorLong */ + ACPI_FIXED_LENGTH, /* 05 Memory32 */ + ACPI_FIXED_LENGTH, /* 06 Memory32Fixed */ + ACPI_VARIABLE_LENGTH, /* 07 Dword* address */ + ACPI_VARIABLE_LENGTH, /* 08 Word* address */ + ACPI_VARIABLE_LENGTH, /* 09 ExtendedIRQ */ + ACPI_VARIABLE_LENGTH, /* 0A Qword* address */ + ACPI_FIXED_LENGTH, /* 0B Extended* address */ + ACPI_VARIABLE_LENGTH, /* 0C Gpio* */ + 0, + ACPI_VARIABLE_LENGTH /* 0E *SerialBus */ }; @@ -344,11 +508,12 @@ static const UINT8 AcpiGbl_ResourceTypes[] = * * FUNCTION: AcpiUtWalkAmlResources * - * PARAMETERS: Aml - Pointer to the raw AML resource template - * AmlLength - Length of the entire template - * UserFunction - Called once for each descriptor found. If - * NULL, a pointer to the EndTag is returned - * Context - Passed to UserFunction + * PARAMETERS: WalkState - Current walk info + * PARAMETERS: Aml - Pointer to the raw AML resource template + * AmlLength - Length of the entire template + * UserFunction - Called once for each descriptor found. If + * NULL, a pointer to the EndTag is returned + * Context - Passed to UserFunction * * RETURN: Status * @@ -359,16 +524,18 @@ static const UINT8 AcpiGbl_ResourceTypes[] = ACPI_STATUS AcpiUtWalkAmlResources ( + ACPI_WALK_STATE *WalkState, UINT8 *Aml, ACPI_SIZE AmlLength, ACPI_WALK_AML_CALLBACK UserFunction, - void *Context) + void **Context) { ACPI_STATUS Status; UINT8 *EndAml; UINT8 ResourceIndex; UINT32 Length; UINT32 Offset = 0; + UINT8 EndTag[2] = {0x79, 0x00}; ACPI_FUNCTION_TRACE (UtWalkAmlResources); @@ -391,9 +558,13 @@ AcpiUtWalkAmlResources ( { /* Validate the Resource Type and Resource Length */ - Status = AcpiUtValidateResource (Aml, &ResourceIndex); + Status = AcpiUtValidateResource (WalkState, Aml, &ResourceIndex); if (ACPI_FAILURE (Status)) { + /* + * Exit on failure. Cannot continue because the descriptor length + * may be bogus also. + */ return_ACPI_STATUS (Status); } @@ -408,7 +579,7 @@ AcpiUtWalkAmlResources ( Status = UserFunction (Aml, Length, Offset, ResourceIndex, Context); if (ACPI_FAILURE (Status)) { - return (Status); + return_ACPI_STATUS (Status); } } @@ -429,7 +600,7 @@ AcpiUtWalkAmlResources ( if (!UserFunction) { - *(void **) Context = Aml; + *Context = Aml; } /* Normal exit */ @@ -443,7 +614,19 @@ AcpiUtWalkAmlResources ( /* Did not find an EndTag descriptor */ - return (AE_AML_NO_RESOURCE_END_TAG); + if (UserFunction) + { + /* Insert an EndTag anyway. AcpiRsGetListLength always leaves room */ + + (void) AcpiUtValidateResource (WalkState, EndTag, &ResourceIndex); + Status = UserFunction (EndTag, 2, Offset, ResourceIndex, Context); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG); } @@ -451,9 +634,10 @@ AcpiUtWalkAmlResources ( * * FUNCTION: AcpiUtValidateResource * - * PARAMETERS: Aml - Pointer to the raw AML resource descriptor - * ReturnIndex - Where the resource index is returned. NULL - * if the index is not required. + * PARAMETERS: WalkState - Current walk info + * Aml - Pointer to the raw AML resource descriptor + * ReturnIndex - Where the resource index is returned. NULL + * if the index is not required. * * RETURN: Status, and optionally the Index into the global resource tables * @@ -465,9 +649,11 @@ AcpiUtWalkAmlResources ( ACPI_STATUS AcpiUtValidateResource ( + ACPI_WALK_STATE *WalkState, void *Aml, UINT8 *ReturnIndex) { + AML_RESOURCE *AmlResource; UINT8 ResourceType; UINT8 ResourceIndex; ACPI_RS_LENGTH ResourceLength; @@ -492,7 +678,7 @@ AcpiUtValidateResource ( if (ResourceType > ACPI_RESOURCE_NAME_LARGE_MAX) { - return (AE_AML_INVALID_RESOURCE_TYPE); + goto InvalidResource; } /* @@ -511,17 +697,18 @@ AcpiUtValidateResource ( ((ResourceType & ACPI_RESOURCE_NAME_SMALL_MASK) >> 3); } - /* Check validity of the resource type, zero indicates name is invalid */ - + /* + * Check validity of the resource type, via AcpiGbl_ResourceTypes. Zero + * indicates an invalid resource. + */ if (!AcpiGbl_ResourceTypes[ResourceIndex]) { - return (AE_AML_INVALID_RESOURCE_TYPE); + goto InvalidResource; } - /* - * 2) Validate the ResourceLength field. This ensures that the length - * is at least reasonable, and guarantees that it is non-zero. + * Validate the ResourceLength field. This ensures that the length + * is at least reasonable, and guarantees that it is non-zero. */ ResourceLength = AcpiUtGetResourceLength (Aml); MinimumResourceLength = AcpiGbl_ResourceAmlSizes[ResourceIndex]; @@ -536,7 +723,7 @@ AcpiUtValidateResource ( if (ResourceLength != MinimumResourceLength) { - return (AE_AML_BAD_RESOURCE_LENGTH); + goto BadResourceLength; } break; @@ -546,7 +733,7 @@ AcpiUtValidateResource ( if (ResourceLength < MinimumResourceLength) { - return (AE_AML_BAD_RESOURCE_LENGTH); + goto BadResourceLength; } break; @@ -557,7 +744,7 @@ AcpiUtValidateResource ( if ((ResourceLength > MinimumResourceLength) || (ResourceLength < (MinimumResourceLength - 1))) { - return (AE_AML_BAD_RESOURCE_LENGTH); + goto BadResourceLength; } break; @@ -565,7 +752,25 @@ AcpiUtValidateResource ( /* Shouldn't happen (because of validation earlier), but be sure */ - return (AE_AML_INVALID_RESOURCE_TYPE); + goto InvalidResource; + } + + AmlResource = ACPI_CAST_PTR (AML_RESOURCE, Aml); + if (ResourceType == ACPI_RESOURCE_NAME_SERIAL_BUS) + { + /* Validate the BusType field */ + + if ((AmlResource->CommonSerialBus.Type == 0) || + (AmlResource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE)) + { + if (WalkState) + { + ACPI_ERROR ((AE_INFO, + "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X", + AmlResource->CommonSerialBus.Type)); + } + return (AE_AML_INVALID_RESOURCE_TYPE); + } } /* Optionally return the resource table index */ @@ -576,6 +781,28 @@ AcpiUtValidateResource ( } return (AE_OK); + + +InvalidResource: + + if (WalkState) + { + ACPI_ERROR ((AE_INFO, + "Invalid/unsupported resource descriptor: Type 0x%2.2X", + ResourceType)); + } + return (AE_AML_INVALID_RESOURCE_TYPE); + +BadResourceLength: + + if (WalkState) + { + ACPI_ERROR ((AE_INFO, + "Invalid resource descriptor length: Type " + "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X", + ResourceType, ResourceLength, MinimumResourceLength)); + } + return (AE_AML_BAD_RESOURCE_LENGTH); } @@ -763,10 +990,8 @@ AcpiUtGetResourceEndTag ( /* Validate the template and get a pointer to the EndTag */ - Status = AcpiUtWalkAmlResources (ObjDesc->Buffer.Pointer, - ObjDesc->Buffer.Length, NULL, EndTag); + Status = AcpiUtWalkAmlResources (NULL, ObjDesc->Buffer.Pointer, + ObjDesc->Buffer.Length, NULL, (void **) EndTag); return_ACPI_STATUS (Status); } - - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utstate.c b/reactos/drivers/bus/acpi/acpica/utilities/utstate.c index c23c7017871..fc99c564243 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utstate.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utstate.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -179,15 +179,14 @@ AcpiUtPushGenericState ( ACPI_GENERIC_STATE **ListHead, ACPI_GENERIC_STATE *State) { - ACPI_FUNCTION_TRACE (UtPushGenericState); + ACPI_FUNCTION_ENTRY (); /* Push the state object onto the front of the list (stack) */ State->Common.Next = *ListHead; *ListHead = State; - - return_VOID; + return; } @@ -210,7 +209,7 @@ AcpiUtPopGenericState ( ACPI_GENERIC_STATE *State; - ACPI_FUNCTION_TRACE (UtPopGenericState); + ACPI_FUNCTION_ENTRY (); /* Remove the state object at the head of the list (stack) */ @@ -223,7 +222,7 @@ AcpiUtPopGenericState ( *ListHead = State->Common.Next; } - return_PTR (State); + return (State); } @@ -235,7 +234,7 @@ AcpiUtPopGenericState ( * * RETURN: The new state object. NULL on failure. * - * DESCRIPTION: Create a generic state object. Attempt to obtain one from + * DESCRIPTION: Create a generic state object. Attempt to obtain one from * the global state cache; If none available, create a new one. * ******************************************************************************/ @@ -281,7 +280,7 @@ AcpiUtCreateThreadState ( ACPI_GENERIC_STATE *State; - ACPI_FUNCTION_TRACE (UtCreateThreadState); + ACPI_FUNCTION_ENTRY (); /* Create the generic state object */ @@ -289,7 +288,7 @@ AcpiUtCreateThreadState ( State = AcpiUtCreateGenericState (); if (!State) { - return_PTR (NULL); + return (NULL); } /* Init fields specific to the update struct */ @@ -305,7 +304,7 @@ AcpiUtCreateThreadState ( State->Thread.ThreadId = (ACPI_THREAD_ID) 1; } - return_PTR ((ACPI_THREAD_STATE *) State); + return ((ACPI_THREAD_STATE *) State); } @@ -332,7 +331,7 @@ AcpiUtCreateUpdateState ( ACPI_GENERIC_STATE *State; - ACPI_FUNCTION_TRACE_PTR (UtCreateUpdateState, Object); + ACPI_FUNCTION_ENTRY (); /* Create the generic state object */ @@ -340,7 +339,7 @@ AcpiUtCreateUpdateState ( State = AcpiUtCreateGenericState (); if (!State) { - return_PTR (NULL); + return (NULL); } /* Init fields specific to the update struct */ @@ -348,8 +347,7 @@ AcpiUtCreateUpdateState ( State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_UPDATE; State->Update.Object = Object; State->Update.Value = Action; - - return_PTR (State); + return (State); } @@ -375,7 +373,7 @@ AcpiUtCreatePkgState ( ACPI_GENERIC_STATE *State; - ACPI_FUNCTION_TRACE_PTR (UtCreatePkgState, InternalObject); + ACPI_FUNCTION_ENTRY (); /* Create the generic state object */ @@ -383,7 +381,7 @@ AcpiUtCreatePkgState ( State = AcpiUtCreateGenericState (); if (!State) { - return_PTR (NULL); + return (NULL); } /* Init fields specific to the update struct */ @@ -393,8 +391,7 @@ AcpiUtCreatePkgState ( State->Pkg.DestObject = ExternalObject; State->Pkg.Index= Index; State->Pkg.NumPackages = 1; - - return_PTR (State); + return (State); } @@ -418,7 +415,7 @@ AcpiUtCreateControlState ( ACPI_GENERIC_STATE *State; - ACPI_FUNCTION_TRACE (UtCreateControlState); + ACPI_FUNCTION_ENTRY (); /* Create the generic state object */ @@ -426,15 +423,14 @@ AcpiUtCreateControlState ( State = AcpiUtCreateGenericState (); if (!State) { - return_PTR (NULL); + return (NULL); } /* Init fields specific to the control struct */ State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_CONTROL; State->Common.State = ACPI_CONTROL_CONDITIONAL_EXECUTING; - - return_PTR (State); + return (State); } @@ -455,7 +451,7 @@ void AcpiUtDeleteGenericState ( ACPI_GENERIC_STATE *State) { - ACPI_FUNCTION_TRACE (UtDeleteGenericState); + ACPI_FUNCTION_ENTRY (); /* Ignore null state */ @@ -464,7 +460,5 @@ AcpiUtDeleteGenericState ( { (void) AcpiOsReleaseObject (AcpiGbl_StateCache, State); } - return_VOID; + return; } - - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utstring.c b/reactos/drivers/bus/acpi/acpica/utilities/utstring.c new file mode 100644 index 00000000000..c4ead029f30 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/utilities/utstring.c @@ -0,0 +1,834 @@ +/******************************************************************************* + * + * Module Name: utstring - Common functions for strings and characters + * + ******************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#define __UTSTRING_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" + + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utstring") + + +/* + * Non-ANSI C library functions - strlwr, strupr, stricmp, and a 64-bit + * version of strtoul. + */ + +#ifdef ACPI_ASL_COMPILER +/******************************************************************************* + * + * FUNCTION: AcpiUtStrlwr (strlwr) + * + * PARAMETERS: SrcString - The source string to convert + * + * RETURN: None + * + * DESCRIPTION: Convert string to lowercase + * + * NOTE: This is not a POSIX function, so it appears here, not in utclib.c + * + ******************************************************************************/ + +void +AcpiUtStrlwr ( + char *SrcString) +{ + char *String; + + + ACPI_FUNCTION_ENTRY (); + + + if (!SrcString) + { + return; + } + + /* Walk entire string, lowercasing the letters */ + + for (String = SrcString; *String; String++) + { + *String = (char) ACPI_TOLOWER (*String); + } + + return; +} + + +/****************************************************************************** + * + * FUNCTION: AcpiUtStricmp (stricmp) + * + * PARAMETERS: String1 - first string to compare + * String2 - second string to compare + * + * RETURN: int that signifies string relationship. Zero means strings + * are equal. + * + * DESCRIPTION: Implementation of the non-ANSI stricmp function (compare + * strings with no case sensitivity) + * + ******************************************************************************/ + +int +AcpiUtStricmp ( + char *String1, + char *String2) +{ + int c1; + int c2; + + + do + { + c1 = tolower ((int) *String1); + c2 = tolower ((int) *String2); + + String1++; + String2++; + } + while ((c1 == c2) && (c1)); + + return (c1 - c2); +} +#endif + + +/******************************************************************************* + * + * FUNCTION: AcpiUtStrupr (strupr) + * + * PARAMETERS: SrcString - The source string to convert + * + * RETURN: None + * + * DESCRIPTION: Convert string to uppercase + * + * NOTE: This is not a POSIX function, so it appears here, not in utclib.c + * + ******************************************************************************/ + +void +AcpiUtStrupr ( + char *SrcString) +{ + char *String; + + + ACPI_FUNCTION_ENTRY (); + + + if (!SrcString) + { + return; + } + + /* Walk entire string, uppercasing the letters */ + + for (String = SrcString; *String; String++) + { + *String = (char) ACPI_TOUPPER (*String); + } + + return; +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtStrtoul64 + * + * PARAMETERS: String - Null terminated string + * Base - Radix of the string: 16 or ACPI_ANY_BASE; + * ACPI_ANY_BASE means 'in behalf of ToInteger' + * RetInteger - Where the converted integer is returned + * + * RETURN: Status and Converted value + * + * DESCRIPTION: Convert a string into an unsigned value. Performs either a + * 32-bit or 64-bit conversion, depending on the current mode + * of the interpreter. + * NOTE: Does not support Octal strings, not needed. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiUtStrtoul64 ( + char *String, + UINT32 Base, + UINT64 *RetInteger) +{ + UINT32 ThisDigit = 0; + UINT64 ReturnValue = 0; + UINT64 Quotient; + UINT64 Dividend; + UINT32 ToIntegerOp = (Base == ACPI_ANY_BASE); + UINT32 Mode32 = (AcpiGbl_IntegerByteWidth == 4); + UINT8 ValidDigits = 0; + UINT8 SignOf0x = 0; + UINT8 Term = 0; + + + ACPI_FUNCTION_TRACE_STR (UtStroul64, String); + + + switch (Base) + { + case ACPI_ANY_BASE: + case 16: + + break; + + default: + + /* Invalid Base */ + + return_ACPI_STATUS (AE_BAD_PARAMETER); + } + + if (!String) + { + goto ErrorExit; + } + + /* Skip over any white space in the buffer */ + + while ((*String) && (ACPI_IS_SPACE (*String) || *String == '\t')) + { + String++; + } + + if (ToIntegerOp) + { + /* + * Base equal to ACPI_ANY_BASE means 'ToInteger operation case'. + * We need to determine if it is decimal or hexadecimal. + */ + if ((*String == '0') && (ACPI_TOLOWER (*(String + 1)) == 'x')) + { + SignOf0x = 1; + Base = 16; + + /* Skip over the leading '0x' */ + String += 2; + } + else + { + Base = 10; + } + } + + /* Any string left? Check that '0x' is not followed by white space. */ + + if (!(*String) || ACPI_IS_SPACE (*String) || *String == '\t') + { + if (ToIntegerOp) + { + goto ErrorExit; + } + else + { + goto AllDone; + } + } + + /* + * Perform a 32-bit or 64-bit conversion, depending upon the current + * execution mode of the interpreter + */ + Dividend = (Mode32) ? ACPI_UINT32_MAX : ACPI_UINT64_MAX; + + /* Main loop: convert the string to a 32- or 64-bit integer */ + + while (*String) + { + if (ACPI_IS_DIGIT (*String)) + { + /* Convert ASCII 0-9 to Decimal value */ + + ThisDigit = ((UINT8) *String) - '0'; + } + else if (Base == 10) + { + /* Digit is out of range; possible in ToInteger case only */ + + Term = 1; + } + else + { + ThisDigit = (UINT8) ACPI_TOUPPER (*String); + if (ACPI_IS_XDIGIT ((char) ThisDigit)) + { + /* Convert ASCII Hex char to value */ + + ThisDigit = ThisDigit - 'A' + 10; + } + else + { + Term = 1; + } + } + + if (Term) + { + if (ToIntegerOp) + { + goto ErrorExit; + } + else + { + break; + } + } + else if ((ValidDigits == 0) && (ThisDigit == 0) && !SignOf0x) + { + /* Skip zeros */ + String++; + continue; + } + + ValidDigits++; + + if (SignOf0x && ((ValidDigits > 16) || ((ValidDigits > 8) && Mode32))) + { + /* + * This is ToInteger operation case. + * No any restrictions for string-to-integer conversion, + * see ACPI spec. + */ + goto ErrorExit; + } + + /* Divide the digit into the correct position */ + + (void) AcpiUtShortDivide ((Dividend - (UINT64) ThisDigit), + Base, &Quotient, NULL); + + if (ReturnValue > Quotient) + { + if (ToIntegerOp) + { + goto ErrorExit; + } + else + { + break; + } + } + + ReturnValue *= Base; + ReturnValue += ThisDigit; + String++; + } + + /* All done, normal exit */ + +AllDone: + + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Converted value: %8.8X%8.8X\n", + ACPI_FORMAT_UINT64 (ReturnValue))); + + *RetInteger = ReturnValue; + return_ACPI_STATUS (AE_OK); + + +ErrorExit: + /* Base was set/validated above */ + + if (Base == 10) + { + return_ACPI_STATUS (AE_BAD_DECIMAL_CONSTANT); + } + else + { + return_ACPI_STATUS (AE_BAD_HEX_CONSTANT); + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtPrintString + * + * PARAMETERS: String - Null terminated ASCII string + * MaxLength - Maximum output length. Used to constrain the + * length of strings during debug output only. + * + * RETURN: None + * + * DESCRIPTION: Dump an ASCII string with support for ACPI-defined escape + * sequences. + * + ******************************************************************************/ + +void +AcpiUtPrintString ( + char *String, + UINT16 MaxLength) +{ + UINT32 i; + + + if (!String) + { + AcpiOsPrintf ("<\"NULL STRING PTR\">"); + return; + } + + AcpiOsPrintf ("\""); + for (i = 0; (i < MaxLength) && String[i]; i++) + { + /* Escape sequences */ + + switch (String[i]) + { + case 0x07: + + AcpiOsPrintf ("\\a"); /* BELL */ + break; + + case 0x08: + + AcpiOsPrintf ("\\b"); /* BACKSPACE */ + break; + + case 0x0C: + + AcpiOsPrintf ("\\f"); /* FORMFEED */ + break; + + case 0x0A: + + AcpiOsPrintf ("\\n"); /* LINEFEED */ + break; + + case 0x0D: + + AcpiOsPrintf ("\\r"); /* CARRIAGE RETURN*/ + break; + + case 0x09: + + AcpiOsPrintf ("\\t"); /* HORIZONTAL TAB */ + break; + + case 0x0B: + + AcpiOsPrintf ("\\v"); /* VERTICAL TAB */ + break; + + case '\'': /* Single Quote */ + case '\"': /* Double Quote */ + case '\\': /* Backslash */ + + AcpiOsPrintf ("\\%c", (int) String[i]); + break; + + default: + + /* Check for printable character or hex escape */ + + if (ACPI_IS_PRINT (String[i])) + { + /* This is a normal character */ + + AcpiOsPrintf ("%c", (int) String[i]); + } + else + { + /* All others will be Hex escapes */ + + AcpiOsPrintf ("\\x%2.2X", (INT32) String[i]); + } + break; + } + } + AcpiOsPrintf ("\""); + + if (i == MaxLength && String[i]) + { + AcpiOsPrintf ("..."); + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtValidAcpiChar + * + * PARAMETERS: Char - The character to be examined + * Position - Byte position (0-3) + * + * RETURN: TRUE if the character is valid, FALSE otherwise + * + * DESCRIPTION: Check for a valid ACPI character. Must be one of: + * 1) Upper case alpha + * 2) numeric + * 3) underscore + * + * We allow a '!' as the last character because of the ASF! table + * + ******************************************************************************/ + +BOOLEAN +AcpiUtValidAcpiChar ( + char Character, + UINT32 Position) +{ + + if (!((Character >= 'A' && Character <= 'Z') || + (Character >= '0' && Character <= '9') || + (Character == '_'))) + { + /* Allow a '!' in the last position */ + + if (Character == '!' && Position == 3) + { + return (TRUE); + } + + return (FALSE); + } + + return (TRUE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtValidAcpiName + * + * PARAMETERS: Name - The name to be examined. Does not have to + * be NULL terminated string. + * + * RETURN: TRUE if the name is valid, FALSE otherwise + * + * DESCRIPTION: Check for a valid ACPI name. Each character must be one of: + * 1) Upper case alpha + * 2) numeric + * 3) underscore + * + ******************************************************************************/ + +BOOLEAN +AcpiUtValidAcpiName ( + char *Name) +{ + UINT32 i; + + + ACPI_FUNCTION_ENTRY (); + + + for (i = 0; i < ACPI_NAME_SIZE; i++) + { + if (!AcpiUtValidAcpiChar (Name[i], i)) + { + return (FALSE); + } + } + + return (TRUE); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiUtRepairName + * + * PARAMETERS: Name - The ACPI name to be repaired + * + * RETURN: Repaired version of the name + * + * DESCRIPTION: Repair an ACPI name: Change invalid characters to '*' and + * return the new name. NOTE: the Name parameter must reside in + * read/write memory, cannot be a const. + * + * An ACPI Name must consist of valid ACPI characters. We will repair the name + * if necessary because we don't want to abort because of this, but we want + * all namespace names to be printable. A warning message is appropriate. + * + * This issue came up because there are in fact machines that exhibit + * this problem, and we want to be able to enable ACPI support for them, + * even though there are a few bad names. + * + ******************************************************************************/ + +void +AcpiUtRepairName ( + char *Name) +{ + UINT32 i; + BOOLEAN FoundBadChar = FALSE; + UINT32 OriginalName; + + + ACPI_FUNCTION_NAME (UtRepairName); + + + ACPI_MOVE_NAME (&OriginalName, Name); + + /* Check each character in the name */ + + for (i = 0; i < ACPI_NAME_SIZE; i++) + { + if (AcpiUtValidAcpiChar (Name[i], i)) + { + continue; + } + + /* + * Replace a bad character with something printable, yet technically + * still invalid. This prevents any collisions with existing "good" + * names in the namespace. + */ + Name[i] = '*'; + FoundBadChar = TRUE; + } + + if (FoundBadChar) + { + /* Report warning only if in strict mode or debug mode */ + + if (!AcpiGbl_EnableInterpreterSlack) + { + ACPI_WARNING ((AE_INFO, + "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]", + OriginalName, Name)); + } + else + { + ACPI_DEBUG_PRINT ((ACPI_DB_INFO, + "Invalid character(s) in name (0x%.8X), repaired: [%4.4s]", + OriginalName, Name)); + } + } +} + + +#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP +/******************************************************************************* + * + * FUNCTION: UtConvertBackslashes + * + * PARAMETERS: Pathname - File pathname string to be converted + * + * RETURN: Modifies the input Pathname + * + * DESCRIPTION: Convert all backslashes (0x5C) to forward slashes (0x2F) within + * the entire input file pathname string. + * + ******************************************************************************/ + +void +UtConvertBackslashes ( + char *Pathname) +{ + + if (!Pathname) + { + return; + } + + while (*Pathname) + { + if (*Pathname == '\\') + { + *Pathname = '/'; + } + + Pathname++; + } +} +#endif + +#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION) +/******************************************************************************* + * + * FUNCTION: AcpiUtSafeStrcpy, AcpiUtSafeStrcat, AcpiUtSafeStrncat + * + * PARAMETERS: Adds a "DestSize" parameter to each of the standard string + * functions. This is the size of the Destination buffer. + * + * RETURN: TRUE if the operation would overflow the destination buffer. + * + * DESCRIPTION: Safe versions of standard Clib string functions. Ensure that + * the result of the operation will not overflow the output string + * buffer. + * + * NOTE: These functions are typically only helpful for processing + * user input and command lines. For most ACPICA code, the + * required buffer length is precisely calculated before buffer + * allocation, so the use of these functions is unnecessary. + * + ******************************************************************************/ + +BOOLEAN +AcpiUtSafeStrcpy ( + char *Dest, + ACPI_SIZE DestSize, + char *Source) +{ + + if (ACPI_STRLEN (Source) >= DestSize) + { + return (TRUE); + } + + ACPI_STRCPY (Dest, Source); + return (FALSE); +} + +BOOLEAN +AcpiUtSafeStrcat ( + char *Dest, + ACPI_SIZE DestSize, + char *Source) +{ + + if ((ACPI_STRLEN (Dest) + ACPI_STRLEN (Source)) >= DestSize) + { + return (TRUE); + } + + ACPI_STRCAT (Dest, Source); + return (FALSE); +} + +BOOLEAN +AcpiUtSafeStrncat ( + char *Dest, + ACPI_SIZE DestSize, + char *Source, + ACPI_SIZE MaxTransferLength) +{ + ACPI_SIZE ActualTransferLength; + + + ActualTransferLength = ACPI_MIN (MaxTransferLength, ACPI_STRLEN (Source)); + + if ((ACPI_STRLEN (Dest) + ActualTransferLength) >= DestSize) + { + return (TRUE); + } + + ACPI_STRNCAT (Dest, Source, MaxTransferLength); + return (FALSE); +} +#endif diff --git a/reactos/drivers/bus/acpi/acpica/utilities/uttrack.c b/reactos/drivers/bus/acpi/acpica/utilities/uttrack.c index f5599b792f5..df04aa3a572 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/uttrack.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/uttrack.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -117,9 +117,9 @@ * These procedures are used for tracking memory leaks in the subsystem, and * they get compiled out when the ACPI_DBG_TRACK_ALLOCATIONS is not set. * - * Each memory allocation is tracked via a doubly linked list. Each + * Each memory allocation is tracked via a doubly linked list. Each * element contains the caller's component, module name, function name, and - * line number. AcpiUtAllocate and AcpiUtAllocateZeroed call + * line number. AcpiUtAllocate and AcpiUtAllocateZeroed call * AcpiUtTrackAllocation to add an element to the list; deletion * occurs in the body of AcpiUtFree. */ @@ -134,11 +134,12 @@ #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("uttrack") + /* Local prototypes */ static ACPI_DEBUG_MEM_BLOCK * AcpiUtFindAllocation ( - void *Allocation); + ACPI_DEBUG_MEM_BLOCK *Allocation); static ACPI_STATUS AcpiUtTrackAllocation ( @@ -222,10 +223,23 @@ AcpiUtAllocateAndTrack ( ACPI_STATUS Status; - Allocation = AcpiUtAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER), - Component, Module, Line); + /* Check for an inadvertent size of zero bytes */ + + if (!Size) + { + ACPI_WARNING ((Module, Line, + "Attempt to allocate zero bytes, allocating 1 byte")); + Size = 1; + } + + Allocation = AcpiOsAllocate (Size + sizeof (ACPI_DEBUG_MEM_HEADER)); if (!Allocation) { + /* Report allocation error */ + + ACPI_WARNING ((Module, Line, + "Could not allocate size %u", (UINT32) Size)); + return (NULL); } @@ -275,8 +289,16 @@ AcpiUtAllocateZeroedAndTrack ( ACPI_STATUS Status; - Allocation = AcpiUtAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER), - Component, Module, Line); + /* Check for an inadvertent size of zero bytes */ + + if (!Size) + { + ACPI_WARNING ((Module, Line, + "Attempt to allocate zero bytes, allocating 1 byte")); + Size = 1; + } + + Allocation = AcpiOsAllocateZeroed (Size + sizeof (ACPI_DEBUG_MEM_HEADER)); if (!Allocation) { /* Report allocation error */ @@ -357,7 +379,8 @@ AcpiUtFreeAndTrack ( } AcpiOsFree (DebugBlock); - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed\n", Allocation)); + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "%p freed (block %p)\n", + Allocation, DebugBlock)); return_VOID; } @@ -368,29 +391,52 @@ AcpiUtFreeAndTrack ( * * PARAMETERS: Allocation - Address of allocated memory * - * RETURN: A list element if found; NULL otherwise. + * RETURN: Three cases: + * 1) List is empty, NULL is returned. + * 2) Element was found. Returns Allocation parameter. + * 3) Element was not found. Returns position where it should be + * inserted into the list. * * DESCRIPTION: Searches for an element in the global allocation tracking list. + * If the element is not found, returns the location within the + * list where the element should be inserted. + * + * Note: The list is ordered by larger-to-smaller addresses. + * + * This global list is used to detect memory leaks in ACPICA as + * well as other issues such as an attempt to release the same + * internal object more than once. Although expensive as far + * as cpu time, this list is much more helpful for finding these + * types of issues than using memory leak detectors outside of + * the ACPICA code. * ******************************************************************************/ static ACPI_DEBUG_MEM_BLOCK * AcpiUtFindAllocation ( - void *Allocation) + ACPI_DEBUG_MEM_BLOCK *Allocation) { ACPI_DEBUG_MEM_BLOCK *Element; - ACPI_FUNCTION_ENTRY (); - - Element = AcpiGbl_GlobalList->ListHead; - - /* Search for the address. */ - - while (Element) + if (!Element) { - if (Element == Allocation) + return (NULL); + } + + /* + * Search for the address. + * + * Note: List is ordered by larger-to-smaller addresses, on the + * assumption that a new allocation usually has a larger address + * than previous allocations. + */ + while (Element > Allocation) + { + /* Check for end-of-list */ + + if (!Element->Next) { return (Element); } @@ -398,7 +444,12 @@ AcpiUtFindAllocation ( Element = Element->Next; } - return (NULL); + if (Element == Allocation) + { + return (Element); + } + + return (Element->Previous); } @@ -413,7 +464,7 @@ AcpiUtFindAllocation ( * Module - Source file name of caller * Line - Line number of caller * - * RETURN: None. + * RETURN: Status * * DESCRIPTION: Inserts an element into the global allocation tracking list. * @@ -449,23 +500,19 @@ AcpiUtTrackAllocation ( } /* - * Search list for this address to make sure it is not already on the list. - * This will catch several kinds of problems. + * Search the global list for this address to make sure it is not + * already present. This will catch several kinds of problems. */ Element = AcpiUtFindAllocation (Allocation); - if (Element) + if (Element == Allocation) { ACPI_ERROR ((AE_INFO, - "UtTrackAllocation: Allocation already present in list! (%p)", + "UtTrackAllocation: Allocation (%p) already present in global list!", Allocation)); - - ACPI_ERROR ((AE_INFO, "Element %p Address %p", - Element, Allocation)); - goto UnlockAndExit; } - /* Fill in the instance data. */ + /* Fill in the instance data */ Allocation->Size = (UINT32) Size; Allocation->AllocType = AllocType; @@ -475,17 +522,34 @@ AcpiUtTrackAllocation ( ACPI_STRNCPY (Allocation->Module, Module, ACPI_MAX_MODULE_NAME); Allocation->Module[ACPI_MAX_MODULE_NAME-1] = 0; - /* Insert at list head */ - - if (MemList->ListHead) + if (!Element) { - ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous = Allocation; + /* Insert at list head */ + + if (MemList->ListHead) + { + ((ACPI_DEBUG_MEM_BLOCK *)(MemList->ListHead))->Previous = Allocation; + } + + Allocation->Next = MemList->ListHead; + Allocation->Previous = NULL; + + MemList->ListHead = Allocation; } + else + { + /* Insert after element */ - Allocation->Next = MemList->ListHead; - Allocation->Previous = NULL; + Allocation->Next = Element->Next; + Allocation->Previous = Element; - MemList->ListHead = Allocation; + if (Element->Next) + { + (Element->Next)->Previous = Allocation; + } + + Element->Next = Allocation; + } UnlockAndExit: @@ -503,7 +567,7 @@ UnlockAndExit: * Module - Source file name of caller * Line - Line number of caller * - * RETURN: + * RETURN: Status * * DESCRIPTION: Deletes an element from the global allocation tracking list. * @@ -520,12 +584,12 @@ AcpiUtRemoveAllocation ( ACPI_STATUS Status; - ACPI_FUNCTION_TRACE (UtRemoveAllocation); + ACPI_FUNCTION_NAME (UtRemoveAllocation); if (AcpiGbl_DisableMemTracking) { - return_ACPI_STATUS (AE_OK); + return (AE_OK); } MemList = AcpiGbl_GlobalList; @@ -536,13 +600,13 @@ AcpiUtRemoveAllocation ( ACPI_ERROR ((Module, Line, "Empty allocation list, nothing to free!")); - return_ACPI_STATUS (AE_OK); + return (AE_OK); } Status = AcpiUtAcquireMutex (ACPI_MTX_MEMORY); if (ACPI_FAILURE (Status)) { - return_ACPI_STATUS (Status); + return (Status); } /* Unlink */ @@ -561,15 +625,15 @@ AcpiUtRemoveAllocation ( (Allocation->Next)->Previous = Allocation->Previous; } + ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing %p, size 0%X\n", + &Allocation->UserSpace, Allocation->Size)); + /* Mark the segment as deleted */ ACPI_MEMSET (&Allocation->UserSpace, 0xEA, Allocation->Size); - ACPI_DEBUG_PRINT ((ACPI_DB_ALLOCATIONS, "Freeing size 0%X\n", - Allocation->Size)); - Status = AcpiUtReleaseMutex (ACPI_MTX_MEMORY); - return_ACPI_STATUS (Status); + return (Status); } @@ -577,7 +641,7 @@ AcpiUtRemoveAllocation ( * * FUNCTION: AcpiUtDumpAllocationInfo * - * PARAMETERS: + * PARAMETERS: None * * RETURN: None * @@ -638,7 +702,7 @@ AcpiUtDumpAllocationInfo ( * FUNCTION: AcpiUtDumpAllocations * * PARAMETERS: Component - Component(s) to dump info for. - * Module - Module to dump info for. NULL means all. + * Module - Module to dump info for. NULL means all. * * RETURN: None * @@ -662,7 +726,7 @@ AcpiUtDumpAllocations ( if (AcpiGbl_DisableMemTracking) { - return; + return_VOID; } /* @@ -670,7 +734,7 @@ AcpiUtDumpAllocations ( */ if (ACPI_FAILURE (AcpiUtAcquireMutex (ACPI_MTX_MEMORY))) { - return; + return_VOID; } Element = AcpiGbl_GlobalList->ListHead; @@ -705,27 +769,31 @@ AcpiUtDumpAllocations ( switch (ACPI_GET_DESCRIPTOR_TYPE (Descriptor)) { case ACPI_DESC_TYPE_OPERAND: - if (Element->Size == sizeof (ACPI_DESC_TYPE_OPERAND)) + + if (Element->Size == sizeof (ACPI_OPERAND_OBJECT)) { DescriptorType = ACPI_DESC_TYPE_OPERAND; } break; case ACPI_DESC_TYPE_PARSER: - if (Element->Size == sizeof (ACPI_DESC_TYPE_PARSER)) + + if (Element->Size == sizeof (ACPI_PARSE_OBJECT)) { DescriptorType = ACPI_DESC_TYPE_PARSER; } break; case ACPI_DESC_TYPE_NAMED: - if (Element->Size == sizeof (ACPI_DESC_TYPE_NAMED)) + + if (Element->Size == sizeof (ACPI_NAMESPACE_NODE)) { DescriptorType = ACPI_DESC_TYPE_NAMED; } break; default: + break; } @@ -734,22 +802,26 @@ AcpiUtDumpAllocations ( switch (DescriptorType) { case ACPI_DESC_TYPE_OPERAND: + AcpiOsPrintf ("%12.12s RefCount 0x%04X\n", AcpiUtGetTypeName (Descriptor->Object.Common.Type), Descriptor->Object.Common.ReferenceCount); break; case ACPI_DESC_TYPE_PARSER: + AcpiOsPrintf ("AmlOpcode 0x%04hX\n", Descriptor->Op.Asl.AmlOpcode); break; case ACPI_DESC_TYPE_NAMED: + AcpiOsPrintf ("%4.4s\n", AcpiUtGetNodeName (&Descriptor->Node)); break; default: + AcpiOsPrintf ( "\n"); break; } @@ -780,4 +852,3 @@ AcpiUtDumpAllocations ( } #endif /* ACPI_DBG_TRACK_ALLOCATIONS */ - diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utxface.c b/reactos/drivers/bus/acpi/acpica/utilities/utxface.c index d65c8210e14..e915b843856 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utxface.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utxface.c @@ -1,6 +1,6 @@ /****************************************************************************** * - * Module Name: utxface - External interfaces for "global" ACPI functions + * Module Name: utxface - External interfaces, miscellaneous utility functions * *****************************************************************************/ @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -115,318 +115,16 @@ #define __UTXFACE_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" -#include "acevents.h" -#include "acnamesp.h" #include "acdebug.h" -#include "actables.h" #define _COMPONENT ACPI_UTILITIES ACPI_MODULE_NAME ("utxface") -#ifndef ACPI_ASL_COMPILER - -/******************************************************************************* - * - * FUNCTION: AcpiInitializeSubsystem - * - * PARAMETERS: None - * - * RETURN: Status - * - * DESCRIPTION: Initializes all global variables. This is the first function - * called, so any early initialization belongs here. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiInitializeSubsystem ( - void) -{ - ACPI_STATUS Status; - - - ACPI_FUNCTION_TRACE (AcpiInitializeSubsystem); - - - AcpiGbl_StartupFlags = ACPI_SUBSYSTEM_INITIALIZE; - ACPI_DEBUG_EXEC (AcpiUtInitStackPtrTrace ()); - - /* Initialize the OS-Dependent layer */ - - Status = AcpiOsInitialize (); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During OSL initialization")); - return_ACPI_STATUS (Status); - } - - /* Initialize all globals used by the subsystem */ - - Status = AcpiUtInitGlobals (); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During initialization of globals")); - return_ACPI_STATUS (Status); - } - - /* Create the default mutex objects */ - - Status = AcpiUtMutexInitialize (); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During Global Mutex creation")); - return_ACPI_STATUS (Status); - } - - /* - * Initialize the namespace manager and - * the root of the namespace tree - */ - Status = AcpiNsRootInitialize (); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During Namespace initialization")); - return_ACPI_STATUS (Status); - } - - /* Initialize the global OSI interfaces list with the static names */ - - Status = AcpiUtInitializeInterfaces (); - if (ACPI_FAILURE (Status)) - { - ACPI_EXCEPTION ((AE_INFO, Status, "During OSI interfaces initialization")); - return_ACPI_STATUS (Status); - } - - /* If configured, initialize the AML debugger */ - - ACPI_DEBUGGER_EXEC (Status = AcpiDbInitialize ()); - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiInitializeSubsystem) - - -/******************************************************************************* - * - * FUNCTION: AcpiEnableSubsystem - * - * PARAMETERS: Flags - Init/enable Options - * - * RETURN: Status - * - * DESCRIPTION: Completes the subsystem initialization including hardware. - * Puts system into ACPI mode if it isn't already. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiEnableSubsystem ( - UINT32 Flags) -{ - ACPI_STATUS Status = AE_OK; - - - ACPI_FUNCTION_TRACE (AcpiEnableSubsystem); - - - /* Enable ACPI mode */ - - if (!(Flags & ACPI_NO_ACPI_ENABLE)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n")); - - AcpiGbl_OriginalMode = AcpiHwGetMode(); - - Status = AcpiEnable (); - if (ACPI_FAILURE (Status)) - { - ACPI_WARNING ((AE_INFO, "AcpiEnable failed")); - return_ACPI_STATUS (Status); - } - } - - /* - * Obtain a permanent mapping for the FACS. This is required for the - * Global Lock and the Firmware Waking Vector - */ - Status = AcpiTbInitializeFacs (); - if (ACPI_FAILURE (Status)) - { - ACPI_WARNING ((AE_INFO, "Could not map the FACS table")); - return_ACPI_STATUS (Status); - } - - /* - * Install the default OpRegion handlers. These are installed unless - * other handlers have already been installed via the - * InstallAddressSpaceHandler interface. - */ - if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "[Init] Installing default address space handlers\n")); - - Status = AcpiEvInstallRegionHandlers (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - - /* - * Initialize ACPI Event handling (Fixed and General Purpose) - * - * Note1: We must have the hardware and events initialized before we can - * execute any control methods safely. Any control method can require - * ACPI hardware support, so the hardware must be fully initialized before - * any method execution! - * - * Note2: Fixed events are initialized and enabled here. GPEs are - * initialized, but cannot be enabled until after the hardware is - * completely initialized (SCI and GlobalLock activated) and the various - * initialization control methods are run (_REG, _STA, _INI) on the - * entire namespace. - */ - if (!(Flags & ACPI_NO_EVENT_INIT)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "[Init] Initializing ACPI events\n")); - - Status = AcpiEvInitializeEvents (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - - /* - * Install the SCI handler and Global Lock handler. This completes the - * hardware initialization. - */ - if (!(Flags & ACPI_NO_HANDLER_INIT)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "[Init] Installing SCI/GL handlers\n")); - - Status = AcpiEvInstallXruptHandlers (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiEnableSubsystem) - - -/******************************************************************************* - * - * FUNCTION: AcpiInitializeObjects - * - * PARAMETERS: Flags - Init/enable Options - * - * RETURN: Status - * - * DESCRIPTION: Completes namespace initialization by initializing device - * objects and executing AML code for Regions, buffers, etc. - * - ******************************************************************************/ - -ACPI_STATUS -AcpiInitializeObjects ( - UINT32 Flags) -{ - ACPI_STATUS Status = AE_OK; - - - ACPI_FUNCTION_TRACE (AcpiInitializeObjects); - - - /* - * Run all _REG methods - * - * Note: Any objects accessed by the _REG methods will be automatically - * initialized, even if they contain executable AML (see the call to - * AcpiNsInitializeObjects below). - */ - if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "[Init] Executing _REG OpRegion methods\n")); - - Status = AcpiEvInitializeOpRegions (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - - /* - * Execute any module-level code that was detected during the table load - * phase. Although illegal since ACPI 2.0, there are many machines that - * contain this type of code. Each block of detected executable AML code - * outside of any control method is wrapped with a temporary control - * method object and placed on a global list. The methods on this list - * are executed below. - */ - AcpiNsExecModuleCodeList (); - - /* - * Initialize the objects that remain uninitialized. This runs the - * executable AML that may be part of the declaration of these objects: - * OperationRegions, BufferFields, Buffers, and Packages. - */ - if (!(Flags & ACPI_NO_OBJECT_INIT)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "[Init] Completing Initialization of ACPI Objects\n")); - - Status = AcpiNsInitializeObjects (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - - /* - * Initialize all device objects in the namespace. This runs the device - * _STA and _INI methods. - */ - if (!(Flags & ACPI_NO_DEVICE_INIT)) - { - ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, - "[Init] Initializing ACPI Devices\n")); - - Status = AcpiNsInitializeDevices (); - if (ACPI_FAILURE (Status)) - { - return_ACPI_STATUS (Status); - } - } - - /* - * Empty the caches (delete the cached objects) on the assumption that - * the table load filled them up more than they will be at runtime -- - * thus wasting non-paged memory. - */ - Status = AcpiPurgeCachedObjects (); - - AcpiGbl_StartupFlags |= ACPI_INITIALIZED_OK; - return_ACPI_STATUS (Status); -} - -ACPI_EXPORT_SYMBOL (AcpiInitializeObjects) - - -#endif - /******************************************************************************* * * FUNCTION: AcpiTerminate @@ -489,7 +187,7 @@ AcpiTerminate ( return_ACPI_STATUS (Status); } -ACPI_EXPORT_SYMBOL (AcpiTerminate) +ACPI_EXPORT_SYMBOL_INIT (AcpiTerminate) #ifndef ACPI_ASL_COMPILER @@ -535,7 +233,7 @@ ACPI_EXPORT_SYMBOL (AcpiSubsystemStatus) * RETURN: Status - the status of the call * * DESCRIPTION: This function is called to get information about the current - * state of the ACPI subsystem. It will return system information + * state of the ACPI subsystem. It will return system information * in the OutBuffer. * * If the function fails an appropriate status will be returned @@ -685,7 +383,7 @@ AcpiInstallInitializationHandler ( } AcpiGbl_InitHandler = Handler; - return AE_OK; + return (AE_OK); } ACPI_EXPORT_SYMBOL (AcpiInstallInitializationHandler) @@ -709,10 +407,12 @@ AcpiPurgeCachedObjects ( { ACPI_FUNCTION_TRACE (AcpiPurgeCachedObjects); + (void) AcpiOsPurgeCache (AcpiGbl_StateCache); (void) AcpiOsPurgeCache (AcpiGbl_OperandCache); (void) AcpiOsPurgeCache (AcpiGbl_PsNodeCache); (void) AcpiOsPurgeCache (AcpiGbl_PsNodeExtCache); + return_ACPI_STATUS (AE_OK); } @@ -746,7 +446,11 @@ AcpiInstallInterface ( return (AE_BAD_PARAMETER); } - (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + if (ACPI_FAILURE (Status)) + { + return (Status); + } /* Check if the interface name is already in the global list */ @@ -807,7 +511,11 @@ AcpiRemoveInterface ( return (AE_BAD_PARAMETER); } - (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + if (ACPI_FAILURE (Status)) + { + return (Status); + } Status = AcpiUtRemoveInterface (InterfaceName); @@ -837,10 +545,14 @@ ACPI_STATUS AcpiInstallInterfaceHandler ( ACPI_INTERFACE_HANDLER Handler) { - ACPI_STATUS Status = AE_OK; + ACPI_STATUS Status; - (void) AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + if (ACPI_FAILURE (Status)) + { + return (Status); + } if (Handler && AcpiGbl_InterfaceHandler) { @@ -857,5 +569,176 @@ AcpiInstallInterfaceHandler ( ACPI_EXPORT_SYMBOL (AcpiInstallInterfaceHandler) + +/***************************************************************************** + * + * FUNCTION: AcpiUpdateInterfaces + * + * PARAMETERS: Action - Actions to be performed during the + * update + * + * RETURN: Status + * + * DESCRIPTION: Update _OSI interface strings, disabling or enabling OS vendor + * string or/and feature group strings. + * + ****************************************************************************/ + +ACPI_STATUS +AcpiUpdateInterfaces ( + UINT8 Action) +{ + ACPI_STATUS Status; + + + Status = AcpiOsAcquireMutex (AcpiGbl_OsiMutex, ACPI_WAIT_FOREVER); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + Status = AcpiUtUpdateInterfaces (Action); + + AcpiOsReleaseMutex (AcpiGbl_OsiMutex); + return (Status); +} + + +/***************************************************************************** + * + * FUNCTION: AcpiCheckAddressRange + * + * PARAMETERS: SpaceId - Address space ID + * Address - Start address + * Length - Length + * Warn - TRUE if warning on overlap desired + * + * RETURN: Count of the number of conflicts detected. + * + * DESCRIPTION: Check if the input address range overlaps any of the + * ASL operation region address ranges. + * + ****************************************************************************/ + +UINT32 +AcpiCheckAddressRange ( + ACPI_ADR_SPACE_TYPE SpaceId, + ACPI_PHYSICAL_ADDRESS Address, + ACPI_SIZE Length, + BOOLEAN Warn) +{ + UINT32 Overlaps; + ACPI_STATUS Status; + + + Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); + if (ACPI_FAILURE (Status)) + { + return (0); + } + + Overlaps = AcpiUtCheckAddressRange (SpaceId, Address, + (UINT32) Length, Warn); + + (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE); + return (Overlaps); +} + +ACPI_EXPORT_SYMBOL (AcpiCheckAddressRange) + #endif /* !ACPI_ASL_COMPILER */ + +/******************************************************************************* + * + * FUNCTION: AcpiDecodePldBuffer + * + * PARAMETERS: InBuffer - Buffer returned by _PLD method + * Length - Length of the InBuffer + * ReturnBuffer - Where the decode buffer is returned + * + * RETURN: Status and the decoded _PLD buffer. User must deallocate + * the buffer via ACPI_FREE. + * + * DESCRIPTION: Decode the bit-packed buffer returned by the _PLD method into + * a local struct that is much more useful to an ACPI driver. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiDecodePldBuffer ( + UINT8 *InBuffer, + ACPI_SIZE Length, + ACPI_PLD_INFO **ReturnBuffer) +{ + ACPI_PLD_INFO *PldInfo; + UINT32 *Buffer = ACPI_CAST_PTR (UINT32, InBuffer); + UINT32 Dword; + + + /* Parameter validation */ + + if (!InBuffer || !ReturnBuffer || (Length < 16)) + { + return (AE_BAD_PARAMETER); + } + + PldInfo = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PLD_INFO)); + if (!PldInfo) + { + return (AE_NO_MEMORY); + } + + /* First 32-bit DWord */ + + ACPI_MOVE_32_TO_32 (&Dword, &Buffer[0]); + PldInfo->Revision = ACPI_PLD_GET_REVISION (&Dword); + PldInfo->IgnoreColor = ACPI_PLD_GET_IGNORE_COLOR (&Dword); + PldInfo->Color = ACPI_PLD_GET_COLOR (&Dword); + + /* Second 32-bit DWord */ + + ACPI_MOVE_32_TO_32 (&Dword, &Buffer[1]); + PldInfo->Width = ACPI_PLD_GET_WIDTH (&Dword); + PldInfo->Height = ACPI_PLD_GET_HEIGHT(&Dword); + + /* Third 32-bit DWord */ + + ACPI_MOVE_32_TO_32 (&Dword, &Buffer[2]); + PldInfo->UserVisible = ACPI_PLD_GET_USER_VISIBLE (&Dword); + PldInfo->Dock = ACPI_PLD_GET_DOCK (&Dword); + PldInfo->Lid = ACPI_PLD_GET_LID (&Dword); + PldInfo->Panel = ACPI_PLD_GET_PANEL (&Dword); + PldInfo->VerticalPosition = ACPI_PLD_GET_VERTICAL (&Dword); + PldInfo->HorizontalPosition = ACPI_PLD_GET_HORIZONTAL (&Dword); + PldInfo->Shape = ACPI_PLD_GET_SHAPE (&Dword); + PldInfo->GroupOrientation = ACPI_PLD_GET_ORIENTATION (&Dword); + PldInfo->GroupToken = ACPI_PLD_GET_TOKEN (&Dword); + PldInfo->GroupPosition = ACPI_PLD_GET_POSITION (&Dword); + PldInfo->Bay = ACPI_PLD_GET_BAY (&Dword); + + /* Fourth 32-bit DWord */ + + ACPI_MOVE_32_TO_32 (&Dword, &Buffer[3]); + PldInfo->Ejectable = ACPI_PLD_GET_EJECTABLE (&Dword); + PldInfo->OspmEjectRequired = ACPI_PLD_GET_OSPM_EJECT (&Dword); + PldInfo->CabinetNumber = ACPI_PLD_GET_CABINET (&Dword); + PldInfo->CardCageNumber = ACPI_PLD_GET_CARD_CAGE (&Dword); + PldInfo->Reference = ACPI_PLD_GET_REFERENCE (&Dword); + PldInfo->Rotation = ACPI_PLD_GET_ROTATION (&Dword); + PldInfo->Order = ACPI_PLD_GET_ORDER (&Dword); + + if (Length >= ACPI_PLD_BUFFER_SIZE) + { + /* Fifth 32-bit DWord (Revision 2 of _PLD) */ + + ACPI_MOVE_32_TO_32 (&Dword, &Buffer[4]); + PldInfo->VerticalOffset = ACPI_PLD_GET_VERT_OFFSET (&Dword); + PldInfo->HorizontalOffset = ACPI_PLD_GET_HORIZ_OFFSET (&Dword); + } + + *ReturnBuffer = PldInfo; + return (AE_OK); +} + +ACPI_EXPORT_SYMBOL (AcpiDecodePldBuffer) diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utxferror.c b/reactos/drivers/bus/acpi/acpica/utilities/utxferror.c index 60e62171351..af396c646d7 100644 --- a/reactos/drivers/bus/acpi/acpica/utilities/utxferror.c +++ b/reactos/drivers/bus/acpi/acpica/utilities/utxferror.c @@ -8,13 +8,13 @@ * * 1. Copyright Notice * - * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. * All rights reserved. * * 2. License * * 2.1. This is your license from Intel Corp. under its intellectual property - * rights. You may have additional license terms from the party that provided + * rights. You may have additional license terms from the party that provided * you this software, covering your right to use that party's intellectual * property rights. * @@ -31,7 +31,7 @@ * offer to sell, and import the Covered Code and derivative works thereof * solely to the minimum extent necessary to exercise the above copyright * license, and in no event shall the patent license extend to any additions - * to or modifications of the Original Intel Code. No other license or right + * to or modifications of the Original Intel Code. No other license or right * is granted directly or by implication, estoppel or otherwise; * * The above copyright and patent license is granted only if the following @@ -43,11 +43,11 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification with rights to further distribute source must include * the above Copyright Notice, the above License, this list of Conditions, - * and the following Disclaimer and Export Compliance provision. In addition, + * and the following Disclaimer and Export Compliance provision. In addition, * Licensee must cause all Covered Code to which Licensee contributes to * contain a file documenting the changes Licensee made to create that Covered - * Code and the date of any change. Licensee must include in that file the - * documentation of any changes made by any predecessor Licensee. Licensee + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee * must include a prominent statement that the modification is derived, * directly or indirectly, from Original Intel Code. * @@ -55,7 +55,7 @@ * Redistribution of source code of any substantial portion of the Covered * Code or modification without rights to further distribute source must * include the following Disclaimer and Export Compliance provision in the - * documentation and/or other materials provided with distribution. In + * documentation and/or other materials provided with distribution. In * addition, Licensee may not authorize further sublicense of source of any * portion of the Covered Code, and must include terms to the effect that the * license from Licensee to its licensee is limited to the intellectual @@ -80,10 +80,10 @@ * 4. Disclaimer and Export Compliance * * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED - * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE - * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, - * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY - * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A * PARTICULAR PURPOSE. * @@ -92,14 +92,14 @@ * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL - * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY * LIMITED REMEDY. * * 4.3. Licensee shall not export, either directly or indirectly, any of this * software or system incorporating such software without first obtaining any * required license or other approval from the U. S. Department of Commerce or - * any other agency or department of the United States Government. In the + * any other agency or department of the United States Government. In the * event Licensee exports any such software from the United States or * re-exports any such software from a foreign destination, Licensee shall * ensure that the distribution and export/re-export of the software is in @@ -114,10 +114,10 @@ *****************************************************************************/ #define __UTXFERROR_C__ +#define EXPORT_ACPI_INTERFACES #include "acpi.h" #include "accommon.h" -#include "acnamesp.h" #define _COMPONENT ACPI_UTILITIES @@ -126,45 +126,7 @@ /* * This module is used for the in-kernel ACPICA as well as the ACPICA * tools/applications. - * - * For the iASL compiler case, the output is redirected to stderr so that - * any of the various ACPI errors and warnings do not appear in the output - * files, for either the compiler or disassembler portions of the tool. */ -#ifdef ACPI_ASL_COMPILER -#include - -extern FILE *AcpiGbl_OutputFile; - -#define ACPI_MSG_REDIRECT_BEGIN \ - FILE *OutputFile = AcpiGbl_OutputFile; \ - AcpiOsRedirectOutput (stderr); - -#define ACPI_MSG_REDIRECT_END \ - AcpiOsRedirectOutput (OutputFile); - -#else -/* - * non-iASL case - no redirection, nothing to do - */ -#define ACPI_MSG_REDIRECT_BEGIN -#define ACPI_MSG_REDIRECT_END -#endif - -/* - * Common message prefixes - */ -#define ACPI_MSG_ERROR "ACPI Error: " -#define ACPI_MSG_EXCEPTION "ACPI Exception: " -#define ACPI_MSG_WARNING "ACPI Warning: " -#define ACPI_MSG_INFO "ACPI: " - -/* - * Common message suffix - */ -#define ACPI_MSG_SUFFIX \ - AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber) - /******************************************************************************* * @@ -324,227 +286,79 @@ AcpiInfo ( ACPI_EXPORT_SYMBOL (AcpiInfo) -/* - * The remainder of this module contains internal error functions that may - * be configured out. - */ -#if !defined (ACPI_NO_ERROR_MESSAGES) && !defined (ACPI_BIN_APP) - /******************************************************************************* * - * FUNCTION: AcpiUtPredefinedWarning + * FUNCTION: AcpiBiosError * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * Pathname - Full pathname to the node - * NodeFlags - From Namespace node for the method/object - * Format - Printf format string + additional args + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Format - Printf format string + additional args * * RETURN: None * - * DESCRIPTION: Warnings for the predefined validation module. Messages are - * only emitted the first time a problem with a particular - * method/object is detected. This prevents a flood of error - * messages for methods that are repeatedly evaluated. + * DESCRIPTION: Print "ACPI Firmware Error" message with module/line/version + * info * ******************************************************************************/ void ACPI_INTERNAL_VAR_XFACE -AcpiUtPredefinedWarning ( +AcpiBiosError ( const char *ModuleName, UINT32 LineNumber, - char *Pathname, - UINT8 NodeFlags, const char *Format, ...) { va_list ArgList; - /* - * Warning messages for this method/object will be disabled after the - * first time a validation fails or an object is successfully repaired. - */ - if (NodeFlags & ANOBJ_EVALUATED) - { - return; - } - - AcpiOsPrintf (ACPI_MSG_WARNING "For %s: ", Pathname); + ACPI_MSG_REDIRECT_BEGIN; + AcpiOsPrintf (ACPI_MSG_BIOS_ERROR); va_start (ArgList, Format); AcpiOsVprintf (Format, ArgList); ACPI_MSG_SUFFIX; va_end (ArgList); + + ACPI_MSG_REDIRECT_END; } +ACPI_EXPORT_SYMBOL (AcpiBiosError) + /******************************************************************************* * - * FUNCTION: AcpiUtPredefinedInfo + * FUNCTION: AcpiBiosWarning * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * Pathname - Full pathname to the node - * NodeFlags - From Namespace node for the method/object - * Format - Printf format string + additional args + * PARAMETERS: ModuleName - Caller's module name (for error output) + * LineNumber - Caller's line number (for error output) + * Format - Printf format string + additional args * * RETURN: None * - * DESCRIPTION: Info messages for the predefined validation module. Messages - * are only emitted the first time a problem with a particular - * method/object is detected. This prevents a flood of - * messages for methods that are repeatedly evaluated. + * DESCRIPTION: Print "ACPI Firmware Warning" message with module/line/version + * info * ******************************************************************************/ void ACPI_INTERNAL_VAR_XFACE -AcpiUtPredefinedInfo ( +AcpiBiosWarning ( const char *ModuleName, UINT32 LineNumber, - char *Pathname, - UINT8 NodeFlags, const char *Format, ...) { va_list ArgList; - /* - * Warning messages for this method/object will be disabled after the - * first time a validation fails or an object is successfully repaired. - */ - if (NodeFlags & ANOBJ_EVALUATED) - { - return; - } - - AcpiOsPrintf (ACPI_MSG_INFO "For %s: ", Pathname); + ACPI_MSG_REDIRECT_BEGIN; + AcpiOsPrintf (ACPI_MSG_BIOS_WARNING); va_start (ArgList, Format); AcpiOsVprintf (Format, ArgList); ACPI_MSG_SUFFIX; va_end (ArgList); -} - -/******************************************************************************* - * - * FUNCTION: AcpiUtNamespaceError - * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * InternalName - Name or path of the namespace node - * LookupStatus - Exception code from NS lookup - * - * RETURN: None - * - * DESCRIPTION: Print error message with the full pathname for the NS node. - * - ******************************************************************************/ - -void -AcpiUtNamespaceError ( - const char *ModuleName, - UINT32 LineNumber, - const char *InternalName, - ACPI_STATUS LookupStatus) -{ - ACPI_STATUS Status; - UINT32 BadName; - char *Name = NULL; - - - ACPI_MSG_REDIRECT_BEGIN; - AcpiOsPrintf (ACPI_MSG_ERROR); - - if (LookupStatus == AE_BAD_CHARACTER) - { - /* There is a non-ascii character in the name */ - - ACPI_MOVE_32_TO_32 (&BadName, ACPI_CAST_PTR (UINT32, InternalName)); - AcpiOsPrintf ("[0x%4.4X] (NON-ASCII)", BadName); - } - else - { - /* Convert path to external format */ - - Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, - InternalName, NULL, &Name); - - /* Print target name */ - - if (ACPI_SUCCESS (Status)) - { - AcpiOsPrintf ("[%s]", Name); - } - else - { - AcpiOsPrintf ("[COULD NOT EXTERNALIZE NAME]"); - } - - if (Name) - { - ACPI_FREE (Name); - } - } - - AcpiOsPrintf (" Namespace lookup failure, %s", - AcpiFormatException (LookupStatus)); - - ACPI_MSG_SUFFIX; ACPI_MSG_REDIRECT_END; } - -/******************************************************************************* - * - * FUNCTION: AcpiUtMethodError - * - * PARAMETERS: ModuleName - Caller's module name (for error output) - * LineNumber - Caller's line number (for error output) - * Message - Error message to use on failure - * PrefixNode - Prefix relative to the path - * Path - Path to the node (optional) - * MethodStatus - Execution status - * - * RETURN: None - * - * DESCRIPTION: Print error message with the full pathname for the method. - * - ******************************************************************************/ - -void -AcpiUtMethodError ( - const char *ModuleName, - UINT32 LineNumber, - const char *Message, - ACPI_NAMESPACE_NODE *PrefixNode, - const char *Path, - ACPI_STATUS MethodStatus) -{ - ACPI_STATUS Status; - ACPI_NAMESPACE_NODE *Node = PrefixNode; - - - ACPI_MSG_REDIRECT_BEGIN; - AcpiOsPrintf (ACPI_MSG_ERROR); - - if (Path) - { - Status = AcpiNsGetNode (PrefixNode, Path, ACPI_NS_NO_UPSEARCH, - &Node); - if (ACPI_FAILURE (Status)) - { - AcpiOsPrintf ("[Could not get node by pathname]"); - } - } - - AcpiNsPrintNodePathname (Node, Message); - AcpiOsPrintf (", %s", AcpiFormatException (MethodStatus)); - - ACPI_MSG_SUFFIX; - ACPI_MSG_REDIRECT_END; -} - -#endif /* ACPI_NO_ERROR_MESSAGES */ +ACPI_EXPORT_SYMBOL (AcpiBiosWarning) diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utxfinit.c b/reactos/drivers/bus/acpi/acpica/utilities/utxfinit.c new file mode 100644 index 00000000000..b9b1326cc39 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/utilities/utxfinit.c @@ -0,0 +1,439 @@ +/****************************************************************************** + * + * Module Name: utxfinit - External interfaces for ACPICA initialization + * + *****************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + + +#define __UTXFINIT_C__ +#define EXPORT_ACPI_INTERFACES + +#include "acpi.h" +#include "accommon.h" +#include "acevents.h" +#include "acnamesp.h" +#include "acdebug.h" +#include "actables.h" + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utxfinit") + + +/******************************************************************************* + * + * FUNCTION: AcpiInitializeSubsystem + * + * PARAMETERS: None + * + * RETURN: Status + * + * DESCRIPTION: Initializes all global variables. This is the first function + * called, so any early initialization belongs here. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiInitializeSubsystem ( + void) +{ + ACPI_STATUS Status; + + + ACPI_FUNCTION_TRACE (AcpiInitializeSubsystem); + + + AcpiGbl_StartupFlags = ACPI_SUBSYSTEM_INITIALIZE; + ACPI_DEBUG_EXEC (AcpiUtInitStackPtrTrace ()); + + /* Initialize the OS-Dependent layer */ + + Status = AcpiOsInitialize (); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, "During OSL initialization")); + return_ACPI_STATUS (Status); + } + + /* Initialize all globals used by the subsystem */ + + Status = AcpiUtInitGlobals (); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, "During initialization of globals")); + return_ACPI_STATUS (Status); + } + + /* Create the default mutex objects */ + + Status = AcpiUtMutexInitialize (); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, "During Global Mutex creation")); + return_ACPI_STATUS (Status); + } + + /* + * Initialize the namespace manager and + * the root of the namespace tree + */ + Status = AcpiNsRootInitialize (); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, "During Namespace initialization")); + return_ACPI_STATUS (Status); + } + + /* Initialize the global OSI interfaces list with the static names */ + + Status = AcpiUtInitializeInterfaces (); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, "During OSI interfaces initialization")); + return_ACPI_STATUS (Status); + } + + /* If configured, initialize the AML debugger */ + +#ifdef ACPI_DEBUGGER + Status = AcpiDbInitialize (); + if (ACPI_FAILURE (Status)) + { + ACPI_EXCEPTION ((AE_INFO, Status, "During Debugger initialization")); + return_ACPI_STATUS (Status); + } +#endif + + return_ACPI_STATUS (AE_OK); +} + +ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeSubsystem) + + +/******************************************************************************* + * + * FUNCTION: AcpiEnableSubsystem + * + * PARAMETERS: Flags - Init/enable Options + * + * RETURN: Status + * + * DESCRIPTION: Completes the subsystem initialization including hardware. + * Puts system into ACPI mode if it isn't already. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiEnableSubsystem ( + UINT32 Flags) +{ + ACPI_STATUS Status = AE_OK; + + + ACPI_FUNCTION_TRACE (AcpiEnableSubsystem); + + +#if (!ACPI_REDUCED_HARDWARE) + + /* Enable ACPI mode */ + + if (!(Flags & ACPI_NO_ACPI_ENABLE)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[Init] Going into ACPI mode\n")); + + AcpiGbl_OriginalMode = AcpiHwGetMode(); + + Status = AcpiEnable (); + if (ACPI_FAILURE (Status)) + { + ACPI_WARNING ((AE_INFO, "AcpiEnable failed")); + return_ACPI_STATUS (Status); + } + } + + /* + * Obtain a permanent mapping for the FACS. This is required for the + * Global Lock and the Firmware Waking Vector + */ + Status = AcpiTbInitializeFacs (); + if (ACPI_FAILURE (Status)) + { + ACPI_WARNING ((AE_INFO, "Could not map the FACS table")); + return_ACPI_STATUS (Status); + } + +#endif /* !ACPI_REDUCED_HARDWARE */ + + /* + * Install the default OpRegion handlers. These are installed unless + * other handlers have already been installed via the + * InstallAddressSpaceHandler interface. + */ + if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "[Init] Installing default address space handlers\n")); + + Status = AcpiEvInstallRegionHandlers (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + +#if (!ACPI_REDUCED_HARDWARE) + /* + * Initialize ACPI Event handling (Fixed and General Purpose) + * + * Note1: We must have the hardware and events initialized before we can + * execute any control methods safely. Any control method can require + * ACPI hardware support, so the hardware must be fully initialized before + * any method execution! + * + * Note2: Fixed events are initialized and enabled here. GPEs are + * initialized, but cannot be enabled until after the hardware is + * completely initialized (SCI and GlobalLock activated) and the various + * initialization control methods are run (_REG, _STA, _INI) on the + * entire namespace. + */ + if (!(Flags & ACPI_NO_EVENT_INIT)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "[Init] Initializing ACPI events\n")); + + Status = AcpiEvInitializeEvents (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + /* + * Install the SCI handler and Global Lock handler. This completes the + * hardware initialization. + */ + if (!(Flags & ACPI_NO_HANDLER_INIT)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "[Init] Installing SCI/GL handlers\n")); + + Status = AcpiEvInstallXruptHandlers (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + +#endif /* !ACPI_REDUCED_HARDWARE */ + + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL_INIT (AcpiEnableSubsystem) + + +/******************************************************************************* + * + * FUNCTION: AcpiInitializeObjects + * + * PARAMETERS: Flags - Init/enable Options + * + * RETURN: Status + * + * DESCRIPTION: Completes namespace initialization by initializing device + * objects and executing AML code for Regions, buffers, etc. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiInitializeObjects ( + UINT32 Flags) +{ + ACPI_STATUS Status = AE_OK; + + + ACPI_FUNCTION_TRACE (AcpiInitializeObjects); + + + /* + * Run all _REG methods + * + * Note: Any objects accessed by the _REG methods will be automatically + * initialized, even if they contain executable AML (see the call to + * AcpiNsInitializeObjects below). + */ + if (!(Flags & ACPI_NO_ADDRESS_SPACE_INIT)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "[Init] Executing _REG OpRegion methods\n")); + + Status = AcpiEvInitializeOpRegions (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + /* + * Execute any module-level code that was detected during the table load + * phase. Although illegal since ACPI 2.0, there are many machines that + * contain this type of code. Each block of detected executable AML code + * outside of any control method is wrapped with a temporary control + * method object and placed on a global list. The methods on this list + * are executed below. + */ + AcpiNsExecModuleCodeList (); + + /* + * Initialize the objects that remain uninitialized. This runs the + * executable AML that may be part of the declaration of these objects: + * OperationRegions, BufferFields, Buffers, and Packages. + */ + if (!(Flags & ACPI_NO_OBJECT_INIT)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "[Init] Completing Initialization of ACPI Objects\n")); + + Status = AcpiNsInitializeObjects (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + /* + * Initialize all device objects in the namespace. This runs the device + * _STA and _INI methods. + */ + if (!(Flags & ACPI_NO_DEVICE_INIT)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "[Init] Initializing ACPI Devices\n")); + + Status = AcpiNsInitializeDevices (); + if (ACPI_FAILURE (Status)) + { + return_ACPI_STATUS (Status); + } + } + + /* + * Empty the caches (delete the cached objects) on the assumption that + * the table load filled them up more than they will be at runtime -- + * thus wasting non-paged memory. + */ + Status = AcpiPurgeCachedObjects (); + + AcpiGbl_StartupFlags |= ACPI_INITIALIZED_OK; + return_ACPI_STATUS (Status); +} + +ACPI_EXPORT_SYMBOL_INIT (AcpiInitializeObjects) diff --git a/reactos/drivers/bus/acpi/acpica/utilities/utxfmutex.c b/reactos/drivers/bus/acpi/acpica/utilities/utxfmutex.c new file mode 100644 index 00000000000..52ca318db00 --- /dev/null +++ b/reactos/drivers/bus/acpi/acpica/utilities/utxfmutex.c @@ -0,0 +1,285 @@ +/******************************************************************************* + * + * Module Name: utxfmutex - external AML mutex access functions + * + ******************************************************************************/ + +/****************************************************************************** + * + * 1. Copyright Notice + * + * Some or all of this work - Copyright (c) 1999 - 2014, Intel Corp. + * All rights reserved. + * + * 2. License + * + * 2.1. This is your license from Intel Corp. under its intellectual property + * rights. You may have additional license terms from the party that provided + * you this software, covering your right to use that party's intellectual + * property rights. + * + * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a + * copy of the source code appearing in this file ("Covered Code") an + * irrevocable, perpetual, worldwide license under Intel's copyrights in the + * base code distributed originally by Intel ("Original Intel Code") to copy, + * make derivatives, distribute, use and display any portion of the Covered + * Code in any form, with the right to sublicense such rights; and + * + * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent + * license (with the right to sublicense), under only those claims of Intel + * patents that are infringed by the Original Intel Code, to make, use, sell, + * offer to sell, and import the Covered Code and derivative works thereof + * solely to the minimum extent necessary to exercise the above copyright + * license, and in no event shall the patent license extend to any additions + * to or modifications of the Original Intel Code. No other license or right + * is granted directly or by implication, estoppel or otherwise; + * + * The above copyright and patent license is granted only if the following + * conditions are met: + * + * 3. Conditions + * + * 3.1. Redistribution of Source with Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification with rights to further distribute source must include + * the above Copyright Notice, the above License, this list of Conditions, + * and the following Disclaimer and Export Compliance provision. In addition, + * Licensee must cause all Covered Code to which Licensee contributes to + * contain a file documenting the changes Licensee made to create that Covered + * Code and the date of any change. Licensee must include in that file the + * documentation of any changes made by any predecessor Licensee. Licensee + * must include a prominent statement that the modification is derived, + * directly or indirectly, from Original Intel Code. + * + * 3.2. Redistribution of Source with no Rights to Further Distribute Source. + * Redistribution of source code of any substantial portion of the Covered + * Code or modification without rights to further distribute source must + * include the following Disclaimer and Export Compliance provision in the + * documentation and/or other materials provided with distribution. In + * addition, Licensee may not authorize further sublicense of source of any + * portion of the Covered Code, and must include terms to the effect that the + * license from Licensee to its licensee is limited to the intellectual + * property embodied in the software Licensee provides to its licensee, and + * not to intellectual property embodied in modifications its licensee may + * make. + * + * 3.3. Redistribution of Executable. Redistribution in executable form of any + * substantial portion of the Covered Code or modification must reproduce the + * above Copyright Notice, and the following Disclaimer and Export Compliance + * provision in the documentation and/or other materials provided with the + * distribution. + * + * 3.4. Intel retains all right, title, and interest in and to the Original + * Intel Code. + * + * 3.5. Neither the name Intel nor any other trademark owned or controlled by + * Intel shall be used in advertising or otherwise to promote the sale, use or + * other dealings in products derived from or relating to the Covered Code + * without prior written authorization from Intel. + * + * 4. Disclaimer and Export Compliance + * + * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED + * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE + * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE, + * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY + * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY + * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A + * PARTICULAR PURPOSE. + * + * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES + * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR + * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT, + * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY + * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL + * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS + * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY + * LIMITED REMEDY. + * + * 4.3. Licensee shall not export, either directly or indirectly, any of this + * software or system incorporating such software without first obtaining any + * required license or other approval from the U. S. Department of Commerce or + * any other agency or department of the United States Government. In the + * event Licensee exports any such software from the United States or + * re-exports any such software from a foreign destination, Licensee shall + * ensure that the distribution and export/re-export of the software is in + * compliance with all laws, regulations, orders, or other restrictions of the + * U.S. Export Administration Regulations. Licensee agrees that neither it nor + * any of its subsidiaries will export/re-export any technical data, process, + * software, or service, directly or indirectly, to any country for which the + * United States government or any agency thereof requires an export license, + * other governmental approval, or letter of assurance, without first obtaining + * such license, approval or letter. + * + *****************************************************************************/ + +#define __UTXFMUTEX_C__ + +#include "acpi.h" +#include "accommon.h" +#include "acnamesp.h" + + +#define _COMPONENT ACPI_UTILITIES + ACPI_MODULE_NAME ("utxfmutex") + + +/* Local prototypes */ + +static ACPI_STATUS +AcpiUtGetMutexObject ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname, + ACPI_OPERAND_OBJECT **RetObj); + + +/******************************************************************************* + * + * FUNCTION: AcpiUtGetMutexObject + * + * PARAMETERS: Handle - Mutex or prefix handle (optional) + * Pathname - Mutex pathname (optional) + * RetObj - Where the mutex object is returned + * + * RETURN: Status + * + * DESCRIPTION: Get an AML mutex object. The mutex node is pointed to by + * Handle:Pathname. Either Handle or Pathname can be NULL, but + * not both. + * + ******************************************************************************/ + +static ACPI_STATUS +AcpiUtGetMutexObject ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname, + ACPI_OPERAND_OBJECT **RetObj) +{ + ACPI_NAMESPACE_NODE *MutexNode; + ACPI_OPERAND_OBJECT *MutexObj; + ACPI_STATUS Status; + + + /* Parameter validation */ + + if (!RetObj || (!Handle && !Pathname)) + { + return (AE_BAD_PARAMETER); + } + + /* Get a the namespace node for the mutex */ + + MutexNode = Handle; + if (Pathname != NULL) + { + Status = AcpiGetHandle (Handle, Pathname, + ACPI_CAST_PTR (ACPI_HANDLE, &MutexNode)); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + } + + /* Ensure that we actually have a Mutex object */ + + if (!MutexNode || + (MutexNode->Type != ACPI_TYPE_MUTEX)) + { + return (AE_TYPE); + } + + /* Get the low-level mutex object */ + + MutexObj = AcpiNsGetAttachedObject (MutexNode); + if (!MutexObj) + { + return (AE_NULL_OBJECT); + } + + *RetObj = MutexObj; + return (AE_OK); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiAcquireMutex + * + * PARAMETERS: Handle - Mutex or prefix handle (optional) + * Pathname - Mutex pathname (optional) + * Timeout - Max time to wait for the lock (millisec) + * + * RETURN: Status + * + * DESCRIPTION: Acquire an AML mutex. This is a device driver interface to + * AML mutex objects, and allows for transaction locking between + * drivers and AML code. The mutex node is pointed to by + * Handle:Pathname. Either Handle or Pathname can be NULL, but + * not both. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiAcquireMutex ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname, + UINT16 Timeout) +{ + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *MutexObj; + + + /* Get the low-level mutex associated with Handle:Pathname */ + + Status = AcpiUtGetMutexObject (Handle, Pathname, &MutexObj); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Acquire the OS mutex */ + + Status = AcpiOsAcquireMutex (MutexObj->Mutex.OsMutex, Timeout); + return (Status); +} + + +/******************************************************************************* + * + * FUNCTION: AcpiReleaseMutex + * + * PARAMETERS: Handle - Mutex or prefix handle (optional) + * Pathname - Mutex pathname (optional) + * + * RETURN: Status + * + * DESCRIPTION: Release an AML mutex. This is a device driver interface to + * AML mutex objects, and allows for transaction locking between + * drivers and AML code. The mutex node is pointed to by + * Handle:Pathname. Either Handle or Pathname can be NULL, but + * not both. + * + ******************************************************************************/ + +ACPI_STATUS +AcpiReleaseMutex ( + ACPI_HANDLE Handle, + ACPI_STRING Pathname) +{ + ACPI_STATUS Status; + ACPI_OPERAND_OBJECT *MutexObj; + + + /* Get the low-level mutex associated with Handle:Pathname */ + + Status = AcpiUtGetMutexObject (Handle, Pathname, &MutexObj); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + + /* Release the OS mutex */ + + AcpiOsReleaseMutex (MutexObj->Mutex.OsMutex); + return (AE_OK); +} From 7ffce2077e4d1ee30308e539aca38c05152e7aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 3 Apr 2014 22:03:14 +0000 Subject: [PATCH 190/419] [ACPICA] Do not assume that, when compiling from Windows, we cannot use GCC. In fact we can, and this is what we did before... Move asm-specific code to where it should belong. I've checked that: MSVC_asm_code(old_acpica_version) == MSVC_asm_code(new_acpica_version), so that I took its GCC equivalent from our old version of ACPICA and placed it there. Part 1 of our modifications to ACPICA code. CORE-8044 svn path=/trunk/; revision=62605 --- .../bus/acpi/acpica/include/platform/acgcc.h | 61 ++++++++++++++++++ .../bus/acpi/acpica/include/platform/acmsvc.h | 61 ++++++++++++++++++ .../bus/acpi/acpica/include/platform/acwin.h | 63 ++----------------- 3 files changed, 126 insertions(+), 59 deletions(-) diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h b/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h index 9cb3cbe5c00..e03b9bace60 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acgcc.h @@ -147,4 +147,65 @@ #undef strchr #endif + +/* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ + +#ifdef ACPI_APPLICATION +#define ACPI_FLUSH_CPU_CACHE() +#else +#define ACPI_FLUSH_CPU_CACHE() asm ("WBINVD") +#endif + +/* + * Global Lock acquire/release code + * + * Note: Taken from our old adaptation. + * TODO: Check whether it is equivalent to the MSVC code + * (which was also the same in the older version). + */ +#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ +do { \ + int dummy; \ + asm("1: movl (%1),%%eax;" \ + "movl %%eax,%%edx;" \ + "andl %2,%%edx;" \ + "btsl $0x1,%%edx;" \ + "adcl $0x0,%%edx;" \ + "lock; cmpxchgl %%edx,(%1);" \ + "jnz 1b;" \ + "cmpb $0x3,%%dl;" \ + "sbbl %%eax,%%eax" \ + :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~1L):"dx"); \ +} while(0) + +#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ +do { \ + int dummy; \ + asm("1: movl (%1),%%eax;" \ + "movl %%eax,%%edx;" \ + "andl %2,%%edx;" \ + "lock; cmpxchgl %%edx,(%1);" \ + "jnz 1b;" \ + "andl $0x1,%%eax" \ + :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~3L):"dx"); \ +} while(0) + + +/* + * Note: This is also taken from our old adaptation. + * See acmsvc.h for where it came originally. + */ +#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \ +{ \ + q32 = n_hi / d32; \ + r32 = n_lo / d32; \ +} + +#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \ +{ \ + n_hi >>= 1; \ + n_lo >>= 1; \ +} + + #endif /* __ACGCC_H__ */ diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h b/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h index c9475eadd3c..1748c9a65fc 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acmsvc.h @@ -202,6 +202,67 @@ } #endif + +/* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ + +#ifdef ACPI_APPLICATION +#define ACPI_FLUSH_CPU_CACHE() +#else +#define ACPI_FLUSH_CPU_CACHE() __asm {WBINVD} +#endif + +/* + * Global Lock acquire/release code + * + * Note: Handles case where the FACS pointer is null + */ +#define ACPI_ACQUIRE_GLOBAL_LOCK(FacsPtr, Acq) __asm \ +{ \ + __asm mov eax, 0xFF \ + __asm mov ecx, FacsPtr \ + __asm or ecx, ecx \ + __asm jz exit_acq \ + __asm lea ecx, [ecx].GlobalLock \ + \ + __asm acq10: \ + __asm mov eax, [ecx] \ + __asm mov edx, eax \ + __asm and edx, 0xFFFFFFFE \ + __asm bts edx, 1 \ + __asm adc edx, 0 \ + __asm lock cmpxchg dword ptr [ecx], edx \ + __asm jnz acq10 \ + \ + __asm cmp dl, 3 \ + __asm sbb eax, eax \ + \ + __asm exit_acq: \ + __asm mov Acq, al \ +} + +#define ACPI_RELEASE_GLOBAL_LOCK(FacsPtr, Pnd) __asm \ +{ \ + __asm xor eax, eax \ + __asm mov ecx, FacsPtr \ + __asm or ecx, ecx \ + __asm jz exit_rel \ + __asm lea ecx, [ecx].GlobalLock \ + \ + __asm Rel10: \ + __asm mov eax, [ecx] \ + __asm mov edx, eax \ + __asm and edx, 0xFFFFFFFC \ + __asm lock cmpxchg dword ptr [ecx], edx \ + __asm jnz Rel10 \ + \ + __asm cmp dl, 3 \ + __asm and eax, 1 \ + \ + __asm exit_rel: \ + __asm mov Pnd, al \ +} + + /* warn C4100: unreferenced formal parameter */ #pragma warning(disable:4100) diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h b/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h index cf1a5eea2ea..d6645ab5bd9 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acwin.h @@ -118,9 +118,11 @@ /*! [Begin] no source code translation (Keep the include) */ -/* Windows uses VC */ -#ifdef _MSC_VER +/* Windows uses VC or GCC */ +#if defined(_MSC_VER) #include "acmsvc.h" +#elif defined(__GNUC__) +#include "acgcc.h" #endif /*! [End] no source code translation !*/ @@ -152,67 +154,10 @@ typedef COMPILER_DEPENDENT_UINT64 u64; /*! [Begin] no source code translation */ -#ifdef ACPI_APPLICATION -#define ACPI_FLUSH_CPU_CACHE() -#else -#define ACPI_FLUSH_CPU_CACHE() __asm {WBINVD} -#endif - #ifdef _DEBUG #define ACPI_SIMPLE_RETURN_MACROS #endif /*! [End] no source code translation !*/ -/* - * Global Lock acquire/release code - * - * Note: Handles case where the FACS pointer is null - */ -#define ACPI_ACQUIRE_GLOBAL_LOCK(FacsPtr, Acq) __asm \ -{ \ - __asm mov eax, 0xFF \ - __asm mov ecx, FacsPtr \ - __asm or ecx, ecx \ - __asm jz exit_acq \ - __asm lea ecx, [ecx].GlobalLock \ - \ - __asm acq10: \ - __asm mov eax, [ecx] \ - __asm mov edx, eax \ - __asm and edx, 0xFFFFFFFE \ - __asm bts edx, 1 \ - __asm adc edx, 0 \ - __asm lock cmpxchg dword ptr [ecx], edx \ - __asm jnz acq10 \ - \ - __asm cmp dl, 3 \ - __asm sbb eax, eax \ - \ - __asm exit_acq: \ - __asm mov Acq, al \ -} - -#define ACPI_RELEASE_GLOBAL_LOCK(FacsPtr, Pnd) __asm \ -{ \ - __asm xor eax, eax \ - __asm mov ecx, FacsPtr \ - __asm or ecx, ecx \ - __asm jz exit_rel \ - __asm lea ecx, [ecx].GlobalLock \ - \ - __asm Rel10: \ - __asm mov eax, [ecx] \ - __asm mov edx, eax \ - __asm and edx, 0xFFFFFFFC \ - __asm lock cmpxchg dword ptr [ecx], edx \ - __asm jnz Rel10 \ - \ - __asm cmp dl, 3 \ - __asm and eax, 1 \ - \ - __asm exit_rel: \ - __asm mov Pnd, al \ -} - #endif /* __ACWIN_H__ */ From ba1329cf880421a3bd947cf50bad7ebf6c3d1f01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 3 Apr 2014 22:09:20 +0000 Subject: [PATCH 191/419] [ACPICA] Disable redundant typedefs that we already got from the inclusion of ntddk.h from elsewhere (and it was done like that in our old modifications of ACPICA). Personally I don't like this way to go, but for the moment just apply something that (seemed to) worked before... Part 2 of our modifications to ACPICA code. CORE-8044 svn path=/trunk/; revision=62606 --- .../drivers/bus/acpi/acpica/include/actypes.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/reactos/drivers/bus/acpi/acpica/include/actypes.h b/reactos/drivers/bus/acpi/acpica/include/actypes.h index a02cd108d01..2218921fb87 100644 --- a/reactos/drivers/bus/acpi/acpica/include/actypes.h +++ b/reactos/drivers/bus/acpi/acpica/include/actypes.h @@ -196,11 +196,11 @@ * ******************************************************************************/ -typedef unsigned char BOOLEAN; -typedef unsigned char UINT8; -typedef unsigned short UINT16; -typedef COMPILER_DEPENDENT_UINT64 UINT64; -typedef COMPILER_DEPENDENT_INT64 INT64; +// typedef unsigned char BOOLEAN; +// typedef unsigned char UINT8; +// typedef unsigned short UINT16; +// typedef COMPILER_DEPENDENT_UINT64 UINT64; +// typedef COMPILER_DEPENDENT_INT64 INT64; /*! [End] no source code translation !*/ @@ -225,8 +225,8 @@ typedef COMPILER_DEPENDENT_INT64 INT64; /*! [Begin] no source code translation (keep the typedefs as-is) */ -typedef unsigned int UINT32; -typedef int INT32; +// typedef unsigned int UINT32; +// typedef int INT32; /*! [End] no source code translation !*/ @@ -264,8 +264,8 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS; /*! [Begin] no source code translation (keep the typedefs as-is) */ -typedef unsigned int UINT32; -typedef int INT32; +// typedef unsigned int UINT32; +// typedef int INT32; /*! [End] no source code translation !*/ From 97ab12262b94b9dd695c1555911450f81b91c302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 3 Apr 2014 23:32:58 +0000 Subject: [PATCH 192/419] [ACPICA] Addendum to revision 62606 : because of typedefs redefinitions (we, after, include acpi.h and co. together with DDK in other acpi bus drivers), we hackishly needed to disable them in actypes.h, and now we need to include ntddk *inside* acpi.h ... Everything would be nice only if ACPICA would not have the "clever" (read: dumb) idea to define a ACPI_BIOS_ERROR macro, which is (you guessed it) already defined.... in the DDK via the standard bugcheck code macros. So we introduce two hacks: the firs one right after the inclusion of ntddk.h *in* acpi.h to first undefine the macro (coming from bugcheck.h), *then*, we re-undefine it *after* the inclusion of acpi.h (in the precompiled header) so that drivers that need to use acpi (via the header) can after, include the ntddk.h ... What a hack :DD Part 2bis of our modifications to ACPICA code. CORE-8044 svn path=/trunk/; revision=62607 --- reactos/drivers/bus/acpi/acpica/include/acpi.h | 6 ++++++ reactos/drivers/bus/acpi/precomp.h | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/reactos/drivers/bus/acpi/acpica/include/acpi.h b/reactos/drivers/bus/acpi/acpica/include/acpi.h index 9c8bc8d61a6..e39627b8de2 100644 --- a/reactos/drivers/bus/acpi/acpica/include/acpi.h +++ b/reactos/drivers/bus/acpi/acpica/include/acpi.h @@ -116,6 +116,12 @@ #ifndef __ACPI_H__ #define __ACPI_H__ +/* + * Header inclusion HACK (see modifications to actypes.h too). + */ +#include +#undef ACPI_BIOS_ERROR // ACPI_BIOS_ERROR is redefined in acoutput.h + /* * Public include files for use by code that will interface to ACPICA. * diff --git a/reactos/drivers/bus/acpi/precomp.h b/reactos/drivers/bus/acpi/precomp.h index fcb766d3eeb..43c15b6a49f 100644 --- a/reactos/drivers/bus/acpi/precomp.h +++ b/reactos/drivers/bus/acpi/precomp.h @@ -1,7 +1,14 @@ #ifndef _ACPI_PCH_ #define _ACPI_PCH_ +#include + #include + +// ACPI_BIOS_ERROR was defined in acoutput.h, but is +// redefined in bugcodes.h included from the DDK. +#undef ACPI_BIOS_ERROR + #include #include #include From 1f753ef84f07ed0596a04360dac079e8b25e7dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 3 Apr 2014 23:44:20 +0000 Subject: [PATCH 193/419] [ACPICA][ACPI] Finally... - Specify that we use MUTEXes instead of binary semaphores, - Change two interface names in our code: ACPI_DEVICE_ID_LIST --> ACPI_PNP_DEVICE_ID_LIST and acpi_device_id --> acpi_pnp_device_id (only those names were changed in ACPICA). - Implement AcpiOsPhysicalTableOverride which doesn't any table override (same behaviour as AcpiOsTableOverride). - Latest ACPICA versions introduce the AcpiOsWaitEventsComplete API, which is used to wait for all asynchronous events to complete. But we do nothing at the moment ("inspired" from the behaviour from http://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/sys/dev/acpi/acpica/OsdSchedule.c , but I'm sure ReactOS ACPI specialists know better than me whether or not it is judicious to do so !!!) - Extend AcpiOsRead/WriteMemory to be able to read/write 64-bit values, as required by the ACPICA implementation. Fix the build. Now, only warnings from our code (not ACPICA) need to be fixed. Real HW testers, please retest your real HW with this revision (or above) !! CORE-8044 #comment Everything updated in revisions 62604 to 62608. svn path=/trunk/; revision=62608 --- .../bus/acpi/acpica/include/platform/acenv.h | 2 +- reactos/drivers/bus/acpi/busmgr/bus.c | 4 +- reactos/drivers/bus/acpi/include/acpi_bus.h | 4 +- reactos/drivers/bus/acpi/osl.c | 145 +++++++++++------- 4 files changed, 97 insertions(+), 58 deletions(-) diff --git a/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h b/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h index 16960799517..6e2eba6e8d1 100644 --- a/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h +++ b/reactos/drivers/bus/acpi/acpica/include/platform/acenv.h @@ -290,7 +290,7 @@ /* Type of mutex supported by host. Default is binary semaphores. */ #ifndef ACPI_MUTEX_TYPE -#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE +#define ACPI_MUTEX_TYPE ACPI_OSL_MUTEX #endif /* Global Lock acquire/release */ diff --git a/reactos/drivers/bus/acpi/busmgr/bus.c b/reactos/drivers/bus/acpi/busmgr/bus.c index 7f408effcad..77b822d2149 100644 --- a/reactos/drivers/bus/acpi/busmgr/bus.c +++ b/reactos/drivers/bus/acpi/busmgr/bus.c @@ -827,7 +827,7 @@ acpi_bus_match ( goto Done; if (device->flags.compatible_ids) { - ACPI_DEVICE_ID_LIST *cid_list = device->pnp.cid_list; + ACPI_PNP_DEVICE_ID_LIST *cid_list = device->pnp.cid_list; int i; /* compare multiple _CID entries against driver ids */ @@ -1140,7 +1140,7 @@ acpi_bus_add ( ACPI_DEVICE_INFO *info; char *hid = NULL; char *uid = NULL; - ACPI_DEVICE_ID_LIST *cid_list = NULL; + ACPI_PNP_DEVICE_ID_LIST *cid_list = NULL; int i = 0; char static_uid_buffer[5]; diff --git a/reactos/drivers/bus/acpi/include/acpi_bus.h b/reactos/drivers/bus/acpi/include/acpi_bus.h index c75f16a48af..4320f63a1dd 100644 --- a/reactos/drivers/bus/acpi/include/acpi_bus.h +++ b/reactos/drivers/bus/acpi/include/acpi_bus.h @@ -175,7 +175,7 @@ struct acpi_device_pnp { acpi_bus_id bus_id; /* Object name */ acpi_bus_address bus_address; /* _ADR */ acpi_hardware_id hardware_id; /* _HID */ - ACPI_DEVICE_ID_LIST *cid_list; /* _CIDs */ + ACPI_PNP_DEVICE_ID_LIST *cid_list; /* _CIDs */ acpi_unique_id unique_id; /* _UID */ acpi_device_name device_name; /* Driver-determined */ acpi_device_class device_class; /* " */ @@ -330,7 +330,7 @@ int acpi_bus_trim(struct acpi_device *start, int rmdevice); int acpi_bus_start(struct acpi_device *device); ACPI_STATUS acpi_bus_get_ejd(ACPI_HANDLE handle, ACPI_HANDLE * ejd); int acpi_match_device_ids(struct acpi_device *device, - const struct acpi_device_id *ids); + const struct acpi_pnp_device_id *ids); int acpi_bus_get_device(ACPI_HANDLE handle, struct acpi_device **device); int acpi_init(void); ACPI_STATUS acpi_suspend (UINT32 state); diff --git a/reactos/drivers/bus/acpi/osl.c b/reactos/drivers/bus/acpi/osl.c index 06055ba840e..7b64a971d27 100644 --- a/reactos/drivers/bus/acpi/osl.c +++ b/reactos/drivers/bus/acpi/osl.c @@ -46,7 +46,7 @@ AcpiOsGetRootPointer ( ACPI_PHYSICAL_ADDRESS pa = 0; DPRINT("AcpiOsGetRootPointer\n"); - + AcpiFindRootPointer(&pa); return pa; } @@ -64,7 +64,7 @@ AcpiOsPredefinedOverride( /* No override */ *NewValue = NULL; - + return AE_OK; } @@ -81,7 +81,26 @@ AcpiOsTableOverride( /* No override */ *NewTable = NULL; - + + return AE_OK; +} + +ACPI_STATUS +AcpiOsPhysicalTableOverride( + ACPI_TABLE_HEADER *ExistingTable, + ACPI_PHYSICAL_ADDRESS *NewAddress, + UINT32 *NewTableLength) +{ + if (!ExistingTable || !NewAddress || !NewTableLength) + { + DPRINT1("Invalid parameter\n"); + return AE_BAD_PARAMETER; + } + + /* No override */ + *NewAddress = 0; + *NewTableLength = 0; + return AE_OK; } @@ -92,9 +111,9 @@ AcpiOsMapMemory ( { PHYSICAL_ADDRESS Address; PVOID Ptr; - + DPRINT("AcpiOsMapMemory(phys 0x%p size 0x%X)\n", phys, length); - + ASSERT(phys); Address.QuadPart = (ULONG)phys; @@ -103,7 +122,7 @@ AcpiOsMapMemory ( { DPRINT1("Mapping failed\n"); } - + return Ptr; } @@ -150,7 +169,7 @@ void AcpiOsFree(void *ptr) { if (!ptr) - DPRINT1("Attempt to free null pointer!!!\n"); + DPRINT1("Attempt to free null pointer!!!\n"); ExFreePoolWithTag(ptr, 'IPCA'); } @@ -164,7 +183,6 @@ AcpiOsReadable( _SEH2_TRY { ProbeForRead(Memory, Length, sizeof(UCHAR)); - Ret = TRUE; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) @@ -172,7 +190,7 @@ AcpiOsReadable( Ret = FALSE; } _SEH2_END; - + return Ret; } @@ -186,7 +204,6 @@ AcpiOsWritable( _SEH2_TRY { ProbeForWrite(Memory, Length, sizeof(UCHAR)); - Ret = TRUE; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) @@ -194,7 +211,7 @@ AcpiOsWritable( Ret = FALSE; } _SEH2_END; - + return Ret; } @@ -215,14 +232,14 @@ AcpiOsExecute ( OBJECT_ATTRIBUTES ObjectAttributes; NTSTATUS Status; - DPRINT("AcpiOsExecute\n"); + DPRINT("AcpiOsExecute\n"); - InitializeObjectAttributes(&ObjectAttributes, + InitializeObjectAttributes(&ObjectAttributes, NULL, OBJ_KERNEL_HANDLE, NULL, NULL); - + Status = PsCreateSystemThread(&ThreadHandle, THREAD_ALL_ACCESS, &ObjectAttributes, @@ -234,7 +251,7 @@ AcpiOsExecute ( return AE_ERROR; ZwClose(ThreadHandle); - + return AE_OK; } @@ -242,7 +259,7 @@ void AcpiOsSleep (UINT64 milliseconds) { DPRINT("AcpiOsSleep %d\n", milliseconds); - KeStallExecutionProcessor(milliseconds*1000); + KeStallExecutionProcessor(milliseconds*1000); } void @@ -263,14 +280,14 @@ AcpiOsCreateMutex( DPRINT1("Bad parameter\n"); return AE_BAD_PARAMETER; } - + Mutex = ExAllocatePool(NonPagedPool, sizeof(FAST_MUTEX)); if (!Mutex) return AE_NO_MEMORY; - + ExInitializeFastMutex(Mutex); - + *OutHandle = (ACPI_MUTEX)Mutex; - + return AE_OK; } @@ -283,7 +300,7 @@ AcpiOsDeleteMutex( DPRINT1("Bad parameter\n"); return; } - + ExFreePool(Handle); } @@ -323,7 +340,7 @@ AcpiOsReleaseMutex( DPRINT1("Bad parameter\n"); return; } - + ExReleaseFastMutex((PFAST_MUTEX)Handle); } @@ -346,16 +363,16 @@ AcpiOsCreateSemaphore( DPRINT1("Bad parameter\n"); return AE_BAD_PARAMETER; } - + Sem = ExAllocatePool(NonPagedPool, sizeof(ACPI_SEM)); if (!Sem) return AE_NO_MEMORY; Sem->CurrentUnits = InitialUnits; KeInitializeEvent(&Sem->Event, SynchronizationEvent, Sem->CurrentUnits != 0); KeInitializeSpinLock(&Sem->Lock); - + *OutHandle = (ACPI_SEMAPHORE)Sem; - + return AE_OK; } @@ -368,9 +385,9 @@ AcpiOsDeleteSemaphore( DPRINT1("Bad parameter\n"); return AE_BAD_PARAMETER; } - + ExFreePool(Handle); - + return AE_OK; } @@ -410,13 +427,13 @@ AcpiOsWaitSemaphore( NULL); KeAcquireSpinLock(&Sem->Lock, &OldIrql); } - + Sem->CurrentUnits -= Units; - + if (Sem->CurrentUnits != 0) KeSetEvent(&Sem->Event, IO_NO_INCREMENT, FALSE); - + KeReleaseSpinLock(&Sem->Lock, OldIrql); - + return AE_OK; } @@ -435,12 +452,12 @@ AcpiOsSignalSemaphore( } KeAcquireSpinLock(&Sem->Lock, &OldIrql); - + Sem->CurrentUnits += Units; KeSetEvent(&Sem->Event, IO_NO_INCREMENT, FALSE); - + KeReleaseSpinLock(&Sem->Lock, OldIrql); - + return AE_OK; } @@ -455,14 +472,14 @@ AcpiOsCreateLock( DPRINT1("Bad parameter\n"); return AE_BAD_PARAMETER; } - + SpinLock = ExAllocatePool(NonPagedPool, sizeof(KSPIN_LOCK)); if (!SpinLock) return AE_NO_MEMORY; - + KeInitializeSpinLock(SpinLock); - + *OutHandle = (ACPI_SPINLOCK)SpinLock; - + return AE_OK; } @@ -475,7 +492,7 @@ AcpiOsDeleteLock( DPRINT1("Bad parameter\n"); return; } - + ExFreePool(Handle); } @@ -484,7 +501,7 @@ AcpiOsAcquireLock( ACPI_SPINLOCK Handle) { KIRQL OldIrql; - + if ((OldIrql = KeGetCurrentIrql()) >= DISPATCH_LEVEL) { KeAcquireSpinLockAtDpcLevel((PKSPIN_LOCK)Handle); @@ -493,7 +510,7 @@ AcpiOsAcquireLock( { KeAcquireSpinLock((PKSPIN_LOCK)Handle, &OldIrql); } - + return (ACPI_CPU_FLAGS)OldIrql; } @@ -503,7 +520,7 @@ AcpiOsReleaseLock( ACPI_CPU_FLAGS Flags) { KIRQL OldIrql = (KIRQL)Flags; - + if (OldIrql >= DISPATCH_LEVEL) { KeReleaseSpinLockFromDpcLevel((PKSPIN_LOCK)Handle); @@ -539,13 +556,13 @@ AcpiOsInstallInterruptHandler ( KIRQL DIrql; KAFFINITY Affinity; NTSTATUS Status; - + if (AcpiInterruptHandlerRegistered) { DPRINT1("Reregister interrupt attempt failed\n"); return AE_ALREADY_EXISTS; } - + if (!ServiceRoutine) { DPRINT1("Bad parameter\n"); @@ -593,13 +610,13 @@ AcpiOsRemoveInterruptHandler ( ACPI_OSD_HANDLER ServiceRoutine) { DPRINT("AcpiOsRemoveInterruptHandler()\n"); - + if (!ServiceRoutine) { DPRINT1("Bad parameter\n"); return AE_BAD_PARAMETER; } - + if (AcpiInterruptHandlerRegistered) { IoDisconnectInterrupt(AcpiInterrupt); @@ -618,7 +635,7 @@ AcpiOsRemoveInterruptHandler ( ACPI_STATUS AcpiOsReadMemory ( ACPI_PHYSICAL_ADDRESS Address, - UINT32 *Value, + UINT64 *Value, UINT32 Width) { DPRINT("AcpiOsReadMemory %p\n", Address); @@ -627,13 +644,19 @@ AcpiOsReadMemory ( case 8: *Value = (*(PUCHAR)(ULONG_PTR)Address); break; + case 16: *Value = (*(PUSHORT)(ULONG_PTR)Address); break; + case 32: *Value = (*(PULONG)(ULONG_PTR)Address); break; + case 64: + *Value = (*(PULONGLONG)(ULONG_PTR)Address); + break; + default: DPRINT1("AcpiOsReadMemory got bad width: %d\n",Width); return (AE_BAD_PARAMETER); @@ -645,7 +668,7 @@ AcpiOsReadMemory ( ACPI_STATUS AcpiOsWriteMemory ( ACPI_PHYSICAL_ADDRESS Address, - UINT32 Value, + UINT64 Value, UINT32 Width) { DPRINT("AcpiOsWriteMemory %p\n", Address); @@ -654,13 +677,19 @@ AcpiOsWriteMemory ( case 8: *(PUCHAR)(ULONG_PTR)Address = Value; break; + case 16: *(PUSHORT)(ULONG_PTR)Address = Value; break; + case 32: *(PULONG)(ULONG_PTR)Address = Value; break; + case 64: + *(PULONGLONG)(ULONG_PTR)Address = Value; + break; + default: DPRINT1("AcpiOsWriteMemory got bad width: %d\n",Width); return (AE_BAD_PARAMETER); @@ -691,6 +720,7 @@ AcpiOsReadPort ( case 32: *Value = READ_PORT_ULONG((PULONG)Address); break; + default: DPRINT1("AcpiOsReadPort got bad width: %d\n",Width); return (AE_BAD_PARAMETER); @@ -719,7 +749,7 @@ AcpiOsWritePort ( case 32: WRITE_PORT_ULONG((PULONG)Address, Value); break; - + default: DPRINT1("AcpiOsWritePort got bad width: %d\n",Width); return (AE_BAD_PARAMETER); @@ -857,19 +887,28 @@ AcpiOsGetTimer( void) { LARGE_INTEGER CurrentTime; - + KeQuerySystemTime(&CurrentTime); - return CurrentTime.QuadPart; } +void +AcpiOsWaitEventsComplete(void) +{ + /* + * Wait for all asynchronous events to complete. + * This implementation does nothing. + */ + return; +} + ACPI_STATUS AcpiOsSignal ( UINT32 Function, void *Info) { ACPI_SIGNAL_FATAL_INFO *FatalInfo = Info; - + switch (Function) { case ACPI_SIGNAL_FATAL: @@ -885,7 +924,7 @@ AcpiOsSignal ( DPRINT1 ("AcpiOsBreakpoint ****\n"); break; } - + ASSERT(FALSE); return (AE_OK); From 2fce3630ab79422cdcbf2aec56b7f059309c00cf Mon Sep 17 00:00:00 2001 From: James Tabor Date: Fri, 4 Apr 2014 14:40:51 +0000 Subject: [PATCH 194/419] [User32] - Patch by Javier Cantero : Fix side effect in SubtractRect(). - Sync port from wine with modifications svn path=/trunk/; revision=62609 --- reactos/win32ss/user/user32/windows/rect.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/rect.c b/reactos/win32ss/user/user32/windows/rect.c index 451407c3eb6..7ca28fbe227 100644 --- a/reactos/win32ss/user/user32/windows/rect.c +++ b/reactos/win32ss/user/user32/windows/rect.c @@ -193,16 +193,20 @@ SubtractRect(LPRECT lprcDst, if(lprcDst == NULL || lprcSrc1 == NULL || lprcSrc2 == NULL) return(FALSE); - CopyRect(lprcDst, lprcSrc1); - if(!IntersectRect(&tempRect, lprcSrc1, lprcSrc2)) + { + *lprcDst = *lprcSrc1; return(TRUE); + } - if (EqualRect(&tempRect, lprcDst)) + if (EqualRect(&tempRect, lprcSrc1)) { SetRectEmpty(lprcDst); return FALSE; } + + *lprcDst = *lprcSrc1; + if(lprcDst->top == tempRect.top && lprcDst->bottom == tempRect.bottom) { if(lprcDst->left == tempRect.left) From 82b5418f455b304c72cea90f026e38e034b642b8 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Fri, 4 Apr 2014 14:49:22 +0000 Subject: [PATCH 195/419] [User32] - Patch by Piotr Caban : Make it possible to activate a window with parent and no WS_CHILD flag in WS_NCLBUTTONDOWN function. - Sync port from wine with modifications and addons. svn path=/trunk/; revision=62610 --- .../win32ss/user/user32/windows/nonclient.c | 49 ++++++++++++++----- 1 file changed, 37 insertions(+), 12 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/nonclient.c b/reactos/win32ss/user/user32/windows/nonclient.c index 890bc2af5e3..4dab2d0bfd1 100644 --- a/reactos/win32ss/user/user32/windows/nonclient.c +++ b/reactos/win32ss/user/user32/windows/nonclient.c @@ -980,26 +980,44 @@ DefWndDoButton(HWND hWnd, WPARAM wParam) LRESULT DefWndNCLButtonDown(HWND hWnd, WPARAM wParam, LPARAM lParam) { + PWND Wnd = ValidateHwnd(hWnd); + switch (wParam) { case HTCAPTION: { - HWND hTopWnd = GetAncestor(hWnd, GA_ROOT); - if ( NtUserCallHwndLock(hTopWnd, HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE) || - GetActiveWindow() == hTopWnd) - { - SendMessageW(hWnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, lParam); - } - break; + HWND hTopWnd = hWnd, parent; + while(1) + { + if ((GetWindowLongW( hTopWnd, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) != WS_CHILD) + break; + parent = GetAncestor( hTopWnd, GA_PARENT ); + if (!parent || parent == GetDesktopWindow()) break; + hTopWnd = parent; + } + + if ( NtUserCallHwndLock(hTopWnd, HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE) || + GetActiveWindow() == hTopWnd) + { + SendMessageW(hWnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, lParam); + } + break; } case HTSYSMENU: { LONG style = GetWindowLongPtrW( hWnd, GWL_STYLE ); if (style & WS_SYSMENU) - { - SendMessageW(hWnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, - lParam); - } + { + if( Wnd && !(style & WS_MINIMIZE) ) + { + RECT rect; + HDC hDC = GetWindowDC(hWnd); + UserGetInsideRectNC(Wnd, &rect); + UserDrawSysMenuButton(hWnd, hDC, &rect, TRUE); + ReleaseDC( hWnd, hDC ); + } + SendMessageW(hWnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, lParam); + } break; } case HTMENU: @@ -1070,7 +1088,14 @@ DefWndNCLButtonDblClk(HWND hWnd, WPARAM wParam, LPARAM lParam) } case HTSYSMENU: { - SendMessageW(hWnd, WM_SYSCOMMAND, SC_CLOSE, 0); + HMENU hSysMenu = GetSystemMenu(hWnd, FALSE); + UINT state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); + + /* If the close item of the sysmenu is disabled or not present do nothing */ + if ((state & (MF_DISABLED | MF_GRAYED)) || (state == 0xFFFFFFFF)) + break; + + SendMessageW(hWnd, WM_SYSCOMMAND, SC_CLOSE, lParam); break; } default: From 6dfbda58e802d25ed51f952e29faa658ffbbcef5 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Fri, 4 Apr 2014 14:59:19 +0000 Subject: [PATCH 196/419] [User32] - Add more to GetInsideRect NC. - Sync port from wine with modifications. svn path=/trunk/; revision=62611 --- reactos/win32ss/user/user32/windows/defwnd.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/defwnd.c b/reactos/win32ss/user/user32/windows/defwnd.c index b15d15ba3ce..7794329ff20 100644 --- a/reactos/win32ss/user/user32/windows/defwnd.c +++ b/reactos/win32ss/user/user32/windows/defwnd.c @@ -123,15 +123,13 @@ UserGetInsideRectNC(PWND Wnd, RECT *rect) /* Remove frame from rectangle */ if (UserHasThickFrameStyle(Style, ExStyle )) { - InflateRect(rect, -GetSystemMetrics(SM_CXFRAME), - -GetSystemMetrics(SM_CYFRAME)); + InflateRect(rect, -GetSystemMetrics(SM_CXFRAME), -GetSystemMetrics(SM_CYFRAME)); } else { if (UserHasDlgFrameStyle(Style, ExStyle )) { - InflateRect(rect, -GetSystemMetrics(SM_CXDLGFRAME), - -GetSystemMetrics(SM_CYDLGFRAME)); + InflateRect(rect, -GetSystemMetrics(SM_CXDLGFRAME), -GetSystemMetrics(SM_CYDLGFRAME)); /* FIXME: this isn't in NC_AdjustRect? why not? */ if (ExStyle & WS_EX_DLGMODALFRAME) InflateRect( rect, -1, 0 ); @@ -140,11 +138,19 @@ UserGetInsideRectNC(PWND Wnd, RECT *rect) { if (UserHasThinFrameStyle(Style, ExStyle)) { - InflateRect(rect, -GetSystemMetrics(SM_CXBORDER), - -GetSystemMetrics(SM_CYBORDER)); + InflateRect(rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER)); } } } + /* We have additional border information if the window + * is a child (but not an MDI child) */ + if ((Style & WS_CHILD) && !(ExStyle & WS_EX_MDICHILD)) + { + if (ExStyle & WS_EX_CLIENTEDGE) + InflateRect (rect, -GetSystemMetrics(SM_CXEDGE), -GetSystemMetrics(SM_CYEDGE)); + if (ExStyle & WS_EX_STATICEDGE) + InflateRect (rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER)); + } } @@ -1086,7 +1092,6 @@ DefWndScreenshot(HWND hWnd) ReleaseDC(hWnd, hdc2); CloseClipboard(); - } From 785a8b7ebe9b2815545efce3fbebd0c83bc8cad5 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Fri, 4 Apr 2014 17:52:23 +0000 Subject: [PATCH 197/419] [Win32k] - Notify FIXME HACK Alert! Are we setting parent to early? svn path=/trunk/; revision=62612 --- reactos/win32ss/user/ntuser/window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index 9d6e4717697..c9d7c7986cf 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -1776,6 +1776,7 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, */ if ( Class->fnid != FNID_DIALOG ) { + ERR("No parent and not a dialog Fix HACK\n"); if (pti->ppi->dwLayout & LAYOUT_RTL) { Cs->dwExStyle |= WS_EX_LAYOUTRTL; @@ -2114,7 +2115,10 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs, } /* Now find the parent and the owner window */ + /////////////// + // FIXME!!!! Breaks wine win.c test_CreateWindow line 5470! hWndParent = pti->rpdesk->pDeskInfo->spwnd->head.h; + /////////////// hWndOwner = NULL; if (Cs->hwndParent == HWND_MESSAGE) From 15f4004f9ffd351d58f33c57ebd09cb7b2b6d8eb Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sat, 5 Apr 2014 05:06:48 +0000 Subject: [PATCH 198/419] [Win32k] - Fix wine win.c test_CreateWindow line 5470, pass all those tests. svn path=/trunk/; revision=62613 --- reactos/win32ss/user/ntuser/window.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index c9d7c7986cf..7cf2f36f93a 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -1353,7 +1353,7 @@ co_IntSetParent(PWND Wnd, PWND WndNewParent) co_WinPosSetWindowPos( Wnd, (0 == (Wnd->ExStyle & WS_EX_TOPMOST) ? HWND_TOP : HWND_TOPMOST), pt.x, pt.y, 0, 0, swFlags); - //ERR("IntSetParent SetWindowPos 2\n"); + //ERR("IntSetParent SetWindowPos 2 X %d Y %d\n",pt.x, pt.y); if (WasVisible) co_WinPosShowWindow(Wnd, SW_SHOWNORMAL); return WndOldParent; @@ -1742,12 +1742,12 @@ IntFixWindowCoordinates(CREATESTRUCTW* Cs, PWND ParentWindow, DWORD* dwShowMode) /* Allocates and initializes a window */ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, - PLARGE_STRING WindowName, - PCLS Class, - PWND ParentWindow, - PWND OwnerWindow, - PVOID acbiBuffer, - PDESKTOP pdeskCreated) + PLARGE_STRING WindowName, + PCLS Class, + PWND ParentWindow, + PWND OwnerWindow, + PVOID acbiBuffer, + PDESKTOP pdeskCreated) { PWND pWnd = NULL; HWND hWnd; @@ -1759,8 +1759,8 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, pti = pdeskCreated ? gptiDesktopThread : GetW32ThreadInfo(); if (!(Cs->dwExStyle & WS_EX_LAYOUTRTL)) - { - if (ParentWindow) + { // Need both here for wine win.c test_CreateWindow. + if (Cs->hwndParent && ParentWindow) { if ( (Cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD && ParentWindow->ExStyle & WS_EX_LAYOUTRTL && @@ -1776,7 +1776,6 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, */ if ( Class->fnid != FNID_DIALOG ) { - ERR("No parent and not a dialog Fix HACK\n"); if (pti->ppi->dwLayout & LAYOUT_RTL) { Cs->dwExStyle |= WS_EX_LAYOUTRTL; @@ -2115,10 +2114,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs, } /* Now find the parent and the owner window */ - /////////////// - // FIXME!!!! Breaks wine win.c test_CreateWindow line 5470! hWndParent = pti->rpdesk->pDeskInfo->spwnd->head.h; - /////////////// hWndOwner = NULL; if (Cs->hwndParent == HWND_MESSAGE) From a98a284868ae14b55db5885d4a4f6e8b256dbec2 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 09:17:21 +0000 Subject: [PATCH 199/419] [EPSAPI] Fix double free in PsaCaptureSystemModules() CID #1106329 svn path=/trunk/; revision=62614 --- reactos/lib/epsapi/enum/drivers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/lib/epsapi/enum/drivers.c b/reactos/lib/epsapi/enum/drivers.c index fa87c5418c2..9fdbe939b2f 100644 --- a/reactos/lib/epsapi/enum/drivers.c +++ b/reactos/lib/epsapi/enum/drivers.c @@ -100,6 +100,7 @@ PsaCaptureSystemModules(OUT PRTL_PROCESS_MODULES *SystemModules) ignore the buffer's content at this point, there's no point in a realloc, that could end up copying a large chunk of data we'd discard anyway */ PsaiFree(psmModules); + psmModules = NULL; pTmp = PsaiMalloc(nSize); if(pTmp == NULL) @@ -138,7 +139,7 @@ PsaCaptureSystemModules(OUT PRTL_PROCESS_MODULES *SystemModules) } while(0); #endif /* in case of failure, free the buffer */ - if(!NT_SUCCESS(Status)) + if(!NT_SUCCESS(Status) && psmModules != NULL) { PsaiFree(psmModules); } From b929ccd22ffd67e1db6ac016f765ab7c41ac92c8 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 10:02:32 +0000 Subject: [PATCH 200/419] [RTL] --MagicValues; svn path=/trunk/; revision=62615 --- reactos/lib/rtl/priv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/lib/rtl/priv.c b/reactos/lib/rtl/priv.c index 5d925af85bb..2b4cadd9f3b 100644 --- a/reactos/lib/rtl/priv.c +++ b/reactos/lib/rtl/priv.c @@ -260,7 +260,7 @@ RtlAcquirePrivilege(IN PULONG Privilege, * There's NO overflow risks (OldPrivileges is always used with its size) */ State->OldPrivileges = (PTOKEN_PRIVILEGES)State->OldPrivBuffer; - State->NewPrivileges = (PTOKEN_PRIVILEGES)(State->OldPrivBuffer + 1024); + State->NewPrivileges = (PTOKEN_PRIVILEGES)(State->OldPrivBuffer + (sizeof(State->OldPrivBuffer) / sizeof(State->OldPrivBuffer[0]))); /* Assign all the privileges to be acquired */ State->NewPrivileges->PrivilegeCount = NumPriv; From f71529c32efa5e65a496c7bb67a6eeb50ae39ccc Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 12:44:27 +0000 Subject: [PATCH 201/419] [RTL] Prevent buffer overflow on copy: provide the correct copy size CID #731655 svn path=/trunk/; revision=62616 --- reactos/lib/rtl/rangelist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/lib/rtl/rangelist.c b/reactos/lib/rtl/rangelist.c index 1b8c7948dce..ab2de3e0369 100644 --- a/reactos/lib/rtl/rangelist.c +++ b/reactos/lib/rtl/rangelist.c @@ -165,7 +165,7 @@ RtlCopyRangeList(OUT PRTL_RANGE_LIST CopyRangeList, RtlCopyMemory(&NewEntry->Range, &Current->Range, - sizeof(RTL_RANGE_ENTRY)); + sizeof(RTL_RANGE)); InsertTailList(&CopyRangeList->ListHead, &NewEntry->Entry); From 9d713d990a920ce94c99f44458794a31f659bc5e Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 12:58:10 +0000 Subject: [PATCH 202/419] [RAPPS] Don't leak handle CID #716310 svn path=/trunk/; revision=62617 --- reactos/base/applications/rapps/parser.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/base/applications/rapps/parser.c b/reactos/base/applications/rapps/parser.c index 0bd162c6fea..60a3fb0b86b 100644 --- a/reactos/base/applications/rapps/parser.c +++ b/reactos/base/applications/rapps/parser.c @@ -617,7 +617,10 @@ ParserOpen(LPCWSTR filename, BOOL write_access) cch = wcslen(buffer) + 1; CurProfile->filename = HeapAlloc(GetProcessHeap(), 0, cch * sizeof(WCHAR)); if (CurProfile->filename == NULL) + { + if (hFile != INVALID_HANDLE_VALUE) CloseHandle(hFile); return FALSE; + } StringCchCopyW(CurProfile->filename, cch, buffer); From 283ab16ed6f33072eff5989cf8d38f0de38f4235 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 13:13:01 +0000 Subject: [PATCH 203/419] [RTL] Properly check for total length in LdrpGetProcedureAddress(). It contains more than just a name. Fixes a buffer overrun. CID #716122 svn path=/trunk/; revision=62618 --- reactos/dll/ntdll/ldr/ldrutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/ntdll/ldr/ldrutils.c b/reactos/dll/ntdll/ldr/ldrutils.c index 3c45605b5b4..8c192c08742 100644 --- a/reactos/dll/ntdll/ldr/ldrutils.c +++ b/reactos/dll/ntdll/ldr/ldrutils.c @@ -2267,7 +2267,7 @@ LdrpGetProcedureAddress(IN PVOID BaseAddress, } /* Check if our buffer is large enough */ - if (Name->Length > sizeof(ImportBuffer)) + if (Length > sizeof(ImportBuffer)) { /* Allocate from heap, plus 2 bytes for the Hint */ ImportName = RtlAllocateHeap(RtlGetProcessHeap(), From 34eddff2f19332270a79fa9e792d3710903698aa Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 14:11:03 +0000 Subject: [PATCH 204/419] [ACPI] Disable PCH as it breaks build (when globally enabled) svn path=/trunk/; revision=62619 --- reactos/drivers/bus/acpi/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/drivers/bus/acpi/CMakeLists.txt b/reactos/drivers/bus/acpi/CMakeLists.txt index 722bc7e72c9..5d6aacc9e44 100644 --- a/reactos/drivers/bus/acpi/CMakeLists.txt +++ b/reactos/drivers/bus/acpi/CMakeLists.txt @@ -163,7 +163,7 @@ add_library(acpica ${ACPICA_SOURCE} acpica/utilities/utglobal.c) -add_pch(acpica acpica/include/acpi.h ACPICA_SOURCE) +#add_pch(acpica acpica/include/acpi.h ACPICA_SOURCE) set_target_properties(acpica PROPERTIES COMPILE_DEFINITIONS "ACPI_USE_LOCAL_CACHE") add_dependencies(acpica bugcodes) From 2afcfa6dbd6504cbc3b776ee97cdc1c14bc262e7 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 5 Apr 2014 14:24:16 +0000 Subject: [PATCH 205/419] [PSEH2_TEST} Use the tests with C++, too. svn path=/trunk/; revision=62620 --- rostests/tests/pseh2/CMakeLists.txt | 11 ++++++++++ rostests/tests/pseh2/psehtest.c | 30 ++++++++++++++++++++++++++- rostests/tests/pseh2/psehtest_cpp.cpp | 3 +++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 rostests/tests/pseh2/psehtest_cpp.cpp diff --git a/rostests/tests/pseh2/CMakeLists.txt b/rostests/tests/pseh2/CMakeLists.txt index 38b627f093c..6c551df3710 100644 --- a/rostests/tests/pseh2/CMakeLists.txt +++ b/rostests/tests/pseh2/CMakeLists.txt @@ -8,3 +8,14 @@ add_cd_file(TARGET pseh2_test DESTINATION reactos/bin FOR all) if(NOT MSVC) add_target_compile_flags(pseh2_test "-Wno-format") endif() + + +add_executable(pseh2_test_cpp psehtest_cpp.cpp psehtest2.c) +target_link_libraries(pseh2_test_cpp wine ${PSEH_LIB}) +set_module_type(pseh2_test_cpp win32cui) +add_importlibs(pseh2_test_cpp msvcrt kernel32 ntdll) +add_cd_file(TARGET pseh2_test_cpp DESTINATION reactos/bin FOR all) + +if(NOT MSVC) + add_target_compile_flags(pseh2_test_cpp "-Wno-format") +endif() diff --git a/rostests/tests/pseh2/psehtest.c b/rostests/tests/pseh2/psehtest.c index 66cd6e5620e..e23dc7376c1 100644 --- a/rostests/tests/pseh2/psehtest.c +++ b/rostests/tests/pseh2/psehtest.c @@ -22,6 +22,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + #define STANDALONE #include @@ -54,7 +58,11 @@ extern int return_minusone_4(void *, int); extern void set_positive(int *); -static int call_test(int (*)(void)); +//static int call_test(int (*)(void)); + +#ifdef __cplusplus +} // extern "C" +#endif #define DEFINE_TEST(NAME_) static int NAME_(void) @@ -2487,6 +2495,25 @@ DEFINE_TEST(test_unvolatile_3) return FALSE; } +DEFINE_TEST(test_unvolatile_4) +{ + unsigned result = 0xdeadbeef; + + _SEH2_TRY + { + *(char*)0x80000000 = 1; + } + _SEH2_EXCEPT(result == 0xdeadbeef) + { + result = 2; + } + _SEH2_END; + + result = (result == 0xdeadbeef) ? 0 : result + 1; + + return result == 3; +} + DEFINE_TEST(test_finally_goto) { volatile int val = 0; @@ -2814,6 +2841,7 @@ void testsuite_syntax(void) USE_TEST(test_unvolatile), USE_TEST(test_unvolatile_2), USE_TEST(test_unvolatile_3), + USE_TEST(test_unvolatile_4), USE_TEST(test_finally_goto), USE_TEST(test_nested_exception), USE_TEST(test_PSEH3_bug), diff --git a/rostests/tests/pseh2/psehtest_cpp.cpp b/rostests/tests/pseh2/psehtest_cpp.cpp new file mode 100644 index 00000000000..d6fe2e51d75 --- /dev/null +++ b/rostests/tests/pseh2/psehtest_cpp.cpp @@ -0,0 +1,3 @@ + + +#include "psehtest.c" From 578a9174d948b26ddce070771b5e4692dded9cf9 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 14:30:22 +0000 Subject: [PATCH 206/419] [BASESRV] Properly call RtlFillMemory in BaseSrvNLSInit. This fixes incomplete NlsUserInfo init CID #1102265 svn path=/trunk/; revision=62621 --- reactos/subsystems/win/basesrv/nls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/subsystems/win/basesrv/nls.c b/reactos/subsystems/win/basesrv/nls.c index 26de88cd9d8..88b42b8f47a 100644 --- a/reactos/subsystems/win/basesrv/nls.c +++ b/reactos/subsystems/win/basesrv/nls.c @@ -116,7 +116,7 @@ BaseSrvNLSInit(IN PBASE_STATIC_SERVER_DATA StaticData) /* Initialize the data with all F's */ pNlsRegUserInfo = &StaticData->NlsUserInfo; - RtlFillMemory(&StaticData->NlsUserInfo, 0xFF, sizeof(StaticData->NlsUserInfo)); + RtlFillMemory(&StaticData->NlsUserInfo, sizeof(StaticData->NlsUserInfo), 0xFF); /* Set empty LCID */ pNlsRegUserInfo->UserLocaleId = 0; From 9ad09cfd873b1c5e61e54a7a632bbb9a7beee312 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 5 Apr 2014 14:38:42 +0000 Subject: [PATCH 207/419] [PSEH3] Simplify some code svn path=/trunk/; revision=62622 --- reactos/include/reactos/libs/pseh/pseh3.h | 30 +++++++---------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index 66d8e9bd998..c1ab215e4e2 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -226,36 +226,24 @@ _SEH3$_Unregister( #define _SEH3$_DECLARE_FILTER_FUNC(_Name) #define _SEH3$_DEFINE_DUMMY_FINALLY(_Name) -/* The "nested" functions are a piece of code with a ret instruction at the end */ -#define _SEH3$_NESTED_FUNC_OPEN() \ - { \ - int _SEH3$_Result = 0; \ - /* On invocation, the AllocaFrame field is loaded with the return esp value */ -#define _SEH3$_NESTED_FUNC_RETURN() \ +#define _SEH3$_NESTED_FUNC_RETURN(_Result) \ /* Restore esp and return to the caller */ \ asm volatile ("movl %[FixedEsp], %%esp\nret\n" \ - : : "a"(_SEH3$_Result), [FixedEsp]"m"(_SEH3$_TrylevelFrame.AllocaFrame) : "memory") + : : "a"(_Result), [FixedEsp]"m"(_SEH3$_TrylevelFrame.AllocaFrame) : "memory") -#define _SEH3$_NESTED_FUNC_CLOSE() \ - /* Return to the caller */ \ - _SEH3$_NESTED_FUNC_RETURN(); \ +/* The filter "function" */ +#define _SEH3$_DEFINE_FILTER_FUNC(_Name, expression) \ + { \ + /* Evaluate and return the filter expression */ \ + _SEH3$_NESTED_FUNC_RETURN((expression)); \ } -/* The filter function */ -#define _SEH3$_DEFINE_FILTER_FUNC(_Name, expression) \ - _SEH3$_NESTED_FUNC_OPEN() \ - { \ - /* Evaluate the filter expression */ \ - _SEH3$_Result = (expression); \ - } \ - _SEH3$_NESTED_FUNC_CLOSE() - #define _SEH3$_FINALLY_FUNC_OPEN(_Name) \ - _SEH3$_NESTED_FUNC_OPEN() \ + { \ /* This construct makes sure that the finally function returns */ \ /* a proper value at the end */ \ - for (; ; (void)({_SEH3$_NESTED_FUNC_RETURN(); 0;})) + for (; ; (void)({_SEH3$_NESTED_FUNC_RETURN(0); 0;})) #define _SEH3$_FILTER(_Filter, _FilterExpression) (&&_SEH3$_l_FilterOrFinally) #define _SEH3$_FINALLY(_Finally) (&&_SEH3$_l_FilterOrFinally) From e9cd63fb67f5ee4736b4e525a14ee603b0bffa45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 5 Apr 2014 14:56:41 +0000 Subject: [PATCH 208/419] [RTL] Some fixes for RtlGetFullPathName_U(str): - Start to polish RtlpCollapsePath (Work in progress) - Correctly zero-out the path destination buffer They fix the following tests: * ntdll:RtlGetFullPathName_U (2 failures to full success) * ntdll:RtlGetFullPathName_UstrEx (2 failures to full success) svn path=/trunk/; revision=62623 --- reactos/lib/rtl/path.c | 123 +++++++++++++++++++++++++---------------- 1 file changed, 76 insertions(+), 47 deletions(-) diff --git a/reactos/lib/rtl/path.c b/reactos/lib/rtl/path.c index ef9c250e094..ca06f3f041e 100644 --- a/reactos/lib/rtl/path.c +++ b/reactos/lib/rtl/path.c @@ -10,7 +10,7 @@ * Pierre Schweitzer (pierre@reactos.org) */ -/* INCLUDES *****************************************************************/ +/* INCLUDES *******************************************************************/ #include @@ -289,102 +289,137 @@ RtlpCheckDeviceName(IN PUNICODE_STRING FileName, /****************************************************************** * RtlpCollapsePath (from WINE) * - * Helper for RtlGetFullPathName_U. - * 1) Convert slashes into backslashes - * 2) Get rid of duplicate backslashes - * 3) Get rid of . and .. components in the path. + * Helper for RtlGetFullPathName_U + * + * 1) Converts slashes into backslashes and gets rid of duplicated ones; + * 2) Gets rid of . and .. components in the path. + * + * Returns the full path length without its terminating NULL character. */ -static VOID -RtlpCollapsePath(PWSTR path, ULONG mark, BOOLEAN SkipTrailingPathSeparators) +static ULONG +RtlpCollapsePath(PWSTR Path, /* ULONG PathBufferSize, ULONG PathLength, */ ULONG mark, BOOLEAN SkipTrailingPathSeparators) { PWSTR p, next; - /* convert every / into a \ */ - for (p = path; *p; p++) + // FIXME: Do not suppose NULL-terminated strings!! + + ULONG PathLength = wcslen(Path); + PWSTR EndBuffer = Path + PathLength; // Path + PathBufferSize / sizeof(WCHAR); + PWSTR EndPath; + + /* Convert slashes into backslashes */ + for (p = Path; *p; p++) { if (*p == L'/') *p = L'\\'; } - /* collapse duplicate backslashes */ - next = path + max( 1, mark ); + /* Collapse duplicate backslashes */ + next = Path + max( 1, mark ); for (p = next; *p; p++) { if (*p != L'\\' || next[-1] != L'\\') *next++ = *p; } *next = UNICODE_NULL; + EndPath = next; - p = path + mark; + p = Path + mark; while (*p) { if (*p == L'.') { - switch(p[1]) + switch (p[1]) { case UNICODE_NULL: /* final . */ - if (p > path + mark) p--; + if (p > Path + mark) p--; *p = UNICODE_NULL; + EndPath = p; continue; + case L'\\': /* .\ component */ next = p + 2; - RtlMoveMemory( p, next, (wcslen(next) + 1) * sizeof(WCHAR) ); + // ASSERT(EndPath - next == wcslen(next)); + RtlMoveMemory(p, next, (EndPath - next + 1) * sizeof(WCHAR)); + EndPath -= (next - p); continue; + case L'.': if (p[2] == L'\\') /* ..\ component */ { next = p + 3; - if (p > path + mark) + if (p > Path + mark) { p--; - while (p > path + mark && p[-1] != L'\\') p--; + while (p > Path + mark && p[-1] != L'\\') p--; } - RtlMoveMemory( p, next, (wcslen(next) + 1) * sizeof(WCHAR) ); + // ASSERT(EndPath - next == wcslen(next)); + RtlMoveMemory(p, next, (EndPath - next + 1) * sizeof(WCHAR)); + EndPath -= (next - p); continue; } - else if (!p[2]) /* final .. */ + else if (p[2] == UNICODE_NULL) /* final .. */ { - if (p > path + mark) + if (p > Path + mark) { p--; - while (p > path + mark && p[-1] != L'\\') p--; - if (p > path + mark) p--; + while (p > Path + mark && p[-1] != L'\\') p--; + if (p > Path + mark) p--; } *p = UNICODE_NULL; + EndPath = p; continue; } break; } } - /* skip to the next component */ + + /* Skip to the next component */ while (*p && *p != L'\\') p++; if (*p == L'\\') { - /* remove last dot in previous dir name */ - if (p > path + mark && p[-1] == L'.') - RtlMoveMemory( p-1, p, (wcslen(p) + 1) * sizeof(WCHAR) ); + /* Remove last dot in previous dir name */ + if (p > Path + mark && p[-1] == L'.') + { + // ASSERT(EndPath - p == wcslen(p)); + RtlMoveMemory(p - 1, p, (EndPath - p + 1) * sizeof(WCHAR)); + EndPath--; + } else + { p++; + } } } /* Remove trailing backslashes if needed (after the UNC part if it exists) */ if (SkipTrailingPathSeparators) { - while (p > path + mark && IS_PATH_SEPARATOR(p[-1])) *p-- = UNICODE_NULL; + while (p > Path + mark && IS_PATH_SEPARATOR(p[-1])) p--; } /* Remove trailing spaces and dots (for all the path) */ - while (p > path && (p[-1] == L' ' || p[-1] == L'.')) *p-- = UNICODE_NULL; + while (p > Path && (p[-1] == L' ' || p[-1] == L'.')) p--; - /* Null-terminate the string */ - *p = UNICODE_NULL; + /* + * Zero-out the discarded buffer zone, starting just after + * the path string and going up to the end of the buffer. + * It also NULL-terminate the path string. + */ + ASSERT(EndBuffer >= p); + RtlZeroMemory(p, (EndBuffer - p + 1) * sizeof(WCHAR)); + + /* Return the real path length */ + PathLength = (p - Path); + // ASSERT(PathLength == wcslen(Path)); + return (PathLength * sizeof(WCHAR)); } /****************************************************************** * RtlpSkipUNCPrefix (from WINE) * * Helper for RtlGetFullPathName_U - * Skip the \\share\dir part of a file name and return the new position - * (which can point on the last backslash of "dir\") + * + * Skips the \\share\dir part of a file name and returns the new position + * (which can point on the last backslash of "dir\"). */ static SIZE_T RtlpSkipUNCPrefix(PCWSTR FileNameBuffer) @@ -542,7 +577,7 @@ RtlGetFullPathName_Ustr( return FullLength + sizeof(UNICODE_NULL); } - /* Zero out the destination buffer. FileName must be different from Buffer */ + /* Zero-out the destination buffer. FileName must be different from Buffer */ RtlZeroMemory(Buffer, Size); /* Get the path type */ @@ -551,7 +586,7 @@ RtlGetFullPathName_Ustr( /********************************************** - ** CODE REWRITTEN IS HAPPENING THERE ** + ** CODE REWRITING IS HAPPENING THERE ** **********************************************/ Source = FileNameBuffer; SourceLength = FileNameLength; @@ -619,7 +654,7 @@ RtlGetFullPathName_Ustr( * FIXME: Win2k seems to check that the environment * variable actually points to an existing directory. * If not, root of the drive is used (this seems also - * to be the only spot in RtlGetFullPathName that the + * to be the only place in RtlGetFullPathName that the * existence of a part of a path is checked). */ EnvVarValue.Buffer[EnvVarValue.Length / sizeof(WCHAR)] = L'\\'; @@ -709,13 +744,10 @@ RtlGetFullPathName_Ustr( /* * Build the full path */ - // if (ShortName) DPRINT1("buffer(1) = %S\n", Buffer); /* Copy the path's prefix */ if (PrefixLength) RtlMoveMemory(Buffer, Prefix, PrefixLength); - // if (ShortName) DPRINT1("buffer(2) = %S\n", Buffer); /* Copy the remaining part of the path */ RtlMoveMemory(Buffer + PrefixLength / sizeof(WCHAR), Source, SourceLength + sizeof(WCHAR)); - // if (ShortName) DPRINT1("buffer(3) = %S\n", Buffer); /* Some cleanup */ Prefix = NULL; @@ -726,15 +758,11 @@ RtlGetFullPathName_Ustr( } /* - * Finally, put the path in canonical form, - * i.e. simplify redundant . and .., etc... + * Finally, put the path in canonical form (remove redundant . and .., + * (back)slashes...) and retrieve the length of the full path name + * (without its terminating null character) (in chars). */ - // if (*PathType == RtlPathTypeUncAbsolute) DPRINT1("RtlpCollapsePath('%S', %lu)\n", Buffer, PrefixCut); - RtlpCollapsePath(Buffer, PrefixCut, SkipTrailingPathSeparators); - // if (ShortName) DPRINT1("buffer(4) = %S\n", Buffer); - - /* Get the length of the full path name, without its terminating null character */ - reqsize = wcslen(Buffer) * sizeof(WCHAR); + reqsize = RtlpCollapsePath(Buffer, /* Size, reqsize, */ PrefixCut, SkipTrailingPathSeparators); /* Find the file part, which is present after the last path separator */ if (ShortName) @@ -761,7 +789,8 @@ RtlGetFullPathName_Ustr( Quit: /* Release PEB lock */ RtlReleasePebLock(); - return (ULONG)reqsize; + + return reqsize; } NTSTATUS From 05e2f0e9db7dbaec6a273ce0bc19b4f586127ee6 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 15:26:12 +0000 Subject: [PATCH 209/419] [DISKPART] Fix leak CID #716329 svn path=/trunk/; revision=62624 --- reactos/base/system/diskpart/diskpart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/base/system/diskpart/diskpart.c b/reactos/base/system/diskpart/diskpart.c index bb27c49b9c3..62426a6bbd3 100644 --- a/reactos/base/system/diskpart/diskpart.c +++ b/reactos/base/system/diskpart/diskpart.c @@ -73,7 +73,10 @@ RunScript(LPCWSTR filename) while (fgetws(tmp_string, MAX_STRING_SIZE, script) != NULL) { if (InterpretScript(tmp_string) == FALSE) + { + fclose(script); return FALSE; + } } /* Close the file */ From 9f2427ba20ad2fe2ab6117a715c2bf32179fda00 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 15:39:09 +0000 Subject: [PATCH 210/419] [VFATLIB] --MagicValues; svn path=/trunk/; revision=62625 --- reactos/lib/fslib/vfatlib/fat12.c | 2 +- reactos/lib/fslib/vfatlib/fat16.c | 2 +- reactos/lib/fslib/vfatlib/fat32.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/lib/fslib/vfatlib/fat12.c b/reactos/lib/fslib/vfatlib/fat12.c index b9f8bad46f2..da0e0ae4741 100644 --- a/reactos/lib/fslib/vfatlib/fat12.c +++ b/reactos/lib/fslib/vfatlib/fat12.c @@ -72,7 +72,7 @@ Fat12WriteBootSector(IN HANDLE FileHandle, /* Copy FAT16 BPB to new bootsector */ memcpy(&NewBootSector->OEMName[0], &BootSector->OEMName[0], - 59); /* FAT16 BPB length (up to (not including) Res2) */ + FIELD_OFFSET(FAT16_BOOT_SECTOR, Res2) - FIELD_OFFSET(FAT16_BOOT_SECTOR, OEMName)); /* FAT16 BPB length (up to (not including) Res2) */ /* Write the boot sector signature */ NewBootSector->Signature1 = 0xAA550000; diff --git a/reactos/lib/fslib/vfatlib/fat16.c b/reactos/lib/fslib/vfatlib/fat16.c index 8cd7551d938..8f4d89202b4 100644 --- a/reactos/lib/fslib/vfatlib/fat16.c +++ b/reactos/lib/fslib/vfatlib/fat16.c @@ -72,7 +72,7 @@ Fat16WriteBootSector(IN HANDLE FileHandle, /* Copy FAT16 BPB to new bootsector */ memcpy(&NewBootSector->OEMName[0], &BootSector->OEMName[0], - 59); /* FAT16 BPB length (up to (not including) Res2) */ + FIELD_OFFSET(FAT16_BOOT_SECTOR, Res2) - FIELD_OFFSET(FAT16_BOOT_SECTOR, OEMName)); /* FAT16 BPB length (up to (not including) Res2) */ /* Write the boot sector signature */ NewBootSector->Signature1 = 0xAA550000; diff --git a/reactos/lib/fslib/vfatlib/fat32.c b/reactos/lib/fslib/vfatlib/fat32.c index cd1cfaf7209..17f13e27c5a 100644 --- a/reactos/lib/fslib/vfatlib/fat32.c +++ b/reactos/lib/fslib/vfatlib/fat32.c @@ -72,7 +72,7 @@ Fat32WriteBootSector(IN HANDLE FileHandle, /* Copy FAT32 BPB to new bootsector */ memcpy(&NewBootSector->OEMName[0], &BootSector->OEMName[0], - 87); /* FAT32 BPB length (up to (not including) Res2) */ + FIELD_OFFSET(FAT32_BOOT_SECTOR, Res2) - FIELD_OFFSET(FAT32_BOOT_SECTOR, OEMName)); /* FAT32 BPB length (up to (not including) Res2) */ /* Write the boot sector signature */ NewBootSector->Signature1 = 0xAA550000; From b938bfc00145ba6dd39b913d74bfa746358e1baa Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 5 Apr 2014 15:41:03 +0000 Subject: [PATCH 211/419] [PSEH3] Implement __finally support for C++ svn path=/trunk/; revision=62626 --- reactos/include/reactos/libs/pseh/pseh3.h | 18 +++++++++--------- reactos/lib/pseh/i386/pseh3.c | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index c1ab215e4e2..8b7ca201242 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -10,7 +10,7 @@ #pragma once #define _PSEH3_H_ -#include "excpt.h" +#include #ifdef __cplusplus extern "C" { @@ -111,7 +111,7 @@ void * __cdecl __attribute__((error("Can only be used inside an exception filter #endif /* This attribute allows automatic cleanup of the registered frames */ -#define _SEH3$_AUTO_CLEANUP __attribute__((cleanup(_SEH3$_Unregister))) +#define _SEH3$_AUTO_CLEANUP __attribute__((cleanup(_SEH3$_AutoCleanup))) /* CLANG specific definitions! */ #ifdef __clang__ @@ -217,7 +217,7 @@ _SEH3$_RegisterTryLevelWithNonVolatiles( /* Use the global unregister function */ void __attribute__((regparm(1))) -_SEH3$_Unregister( +_SEH3$_AutoCleanup( volatile SEH3$_REGISTRATION_FRAME *Frame); /* These are only dummies here */ @@ -251,7 +251,7 @@ _SEH3$_Unregister( #define _SEH3$_DECLARE_EXCEPT_INTRINSICS() /* Since we cannot use nested functions, we declare these globally as macros */ -#define _abnormal_termination() (_SEH3$_TrylevelFrame.ScopeTable != 0) +#define _abnormal_termination() (_SEH3$_TrylevelFrame.ExceptionPointers != 0) #define _exception_code() (_SEH3$_TrylevelFrame.ExceptionPointers->ExceptionRecord->ExceptionCode) #define _exception_info() (_SEH3$_TrylevelFrame.ExceptionPointers) @@ -294,7 +294,7 @@ _SEH3$_Unregister( _SEH3$_NESTED_FUNC_OPEN(_Name) \ /* Declare the intrinsics for the finally function */ \ inline __attribute__((always_inline, gnu_inline)) \ - int _abnormal_termination() { return (_SEH3$_TrylevelFrame.ScopeTable != 0); } \ + int _abnormal_termination() { return (_SEH3$_TrylevelFrame.ExceptionPointers != 0); } \ \ /* This construct makes sure that the finally function returns */ \ /* a proper value at the end */ \ @@ -351,7 +351,7 @@ _SEH3$_Unregister( }; \ \ /* Forward declaration of the auto cleanup function */ \ - _SEH3$_DECLARE_CLEANUP_FUNC(_SEH3$_Unregister); \ + _SEH3$_DECLARE_CLEANUP_FUNC(_SEH3$_AutoCleanup); \ \ /* Allocate a registration frame */ \ volatile SEH3$_REGISTRATION_FRAME _SEH3$_AUTO_CLEANUP _SEH3$_TrylevelFrame; \ @@ -412,8 +412,8 @@ _SEH3$_Unregister( /* End the try block */ \ while (0); \ _SEH3$_l_AfterTry: (void)0; \ - /* Set ScopeTable to 0, this is used by _abnormal_termination() */ \ - _SEH3$_TrylevelFrame.ScopeTable = 0; \ + /* Set ExceptionPointers to 0, this is used by _abnormal_termination() */ \ + _SEH3$_TrylevelFrame.ExceptionPointers = 0; \ \ goto _SEH3$_l_EndTry; \ \ @@ -454,7 +454,7 @@ _SEH3$_Unregister( _SEH3$_ASM_GOTO(_SEH3$_l_OnException); \ \ /* Implementation of the auto cleanup function */ \ - _SEH3$_DEFINE_CLEANUP_FUNC(_SEH3$_Unregister); \ + _SEH3$_DEFINE_CLEANUP_FUNC(_SEH3$_AutoCleanup); \ \ /* Close the outer scope */ \ } while (0); diff --git a/reactos/lib/pseh/i386/pseh3.c b/reactos/lib/pseh/i386/pseh3.c index 7e7d438ea1f..b4856174135 100644 --- a/reactos/lib/pseh/i386/pseh3.c +++ b/reactos/lib/pseh/i386/pseh3.c @@ -130,6 +130,23 @@ _SEH3$_InvokeFilter( return FilterResult; } +void +__attribute__((regparm(1))) +_SEH3$_AutoCleanup( + SEH3$_REGISTRATION_FRAME *Frame) +{ + /* Check for __finally frames */ + if (Frame->ScopeTable->Target == NULL) + { + _SEH3$_InvokeFilter(Frame, Frame->ScopeTable->Filter); + } + + if (Frame->Handler) + _SEH3$_UnregisterFrame(Frame); + else + _SEH3$_UnregisterTryLevel(Frame); +} + static inline LONG _SEH3$_GetFilterResult( From a370953bd41d06cbcb47731a158b6696be754374 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 15:47:49 +0000 Subject: [PATCH 212/419] [SETUP16] Fix invalid free CID #715830 svn path=/trunk/; revision=62627 --- reactos/base/applications/setup16/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/base/applications/setup16/main.c b/reactos/base/applications/setup16/main.c index a3b2ae40f04..8c0ffe29052 100644 --- a/reactos/base/applications/setup16/main.c +++ b/reactos/base/applications/setup16/main.c @@ -48,7 +48,7 @@ BOOL DeleteDirectory(LPWSTR lpszDir) fileop.hNameMappings = NULL; ret = SHFileOperation(&fileop); - HeapFree(GetProcessHeap(), 0, &pszFrom); + HeapFree(GetProcessHeap(), 0, pszFrom); return (ret == 0); } From e76390da3e69d5ef572bb8164db8095016d864a4 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 5 Apr 2014 16:46:40 +0000 Subject: [PATCH 213/419] [NTOS:INVB] - Do not use KeDelayExecutionThread while holding a spin lock CORE-8052 #resolve svn path=/trunk/; revision=62628 --- reactos/ntoskrnl/inbv/inbv.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/inbv/inbv.c b/reactos/ntoskrnl/inbv/inbv.c index 901b770b33b..b569ad29f65 100644 --- a/reactos/ntoskrnl/inbv/inbv.c +++ b/reactos/ntoskrnl/inbv/inbv.c @@ -39,7 +39,7 @@ typedef struct tagRGBQUAD static RGBQUAD _MainPalette[16]; #define PALETTE_FADE_STEPS 15 -#define PALETTE_FADE_TIME 20 * 10000 /* 20ms */ +#define PALETTE_FADE_TIME 20 * 1000 /* 20ms */ /** From bootvid/precomp.h **/ // @@ -76,9 +76,6 @@ BootImageFadeIn(VOID) LPRGBQUAD Palette = (LPRGBQUAD)(PaletteBitmapBuffer + sizeof(BITMAPINFOHEADER)); ULONG Iteration, Index, ClrUsed; - LARGE_INTEGER Interval; - - Interval.QuadPart = -PALETTE_FADE_TIME; /* Check if we're installed and we own it */ if ((InbvBootDriverInstalled) && @@ -115,14 +112,14 @@ BootImageFadeIn(VOID) VidBitBlt(PaletteBitmapBuffer, 0, 0); /* Wait for a bit. */ - KeDelayExecutionThread(KernelMode, FALSE, &Interval); + KeStallExecutionProcessor(PALETTE_FADE_TIME); } /* Release the lock */ InbvReleaseLock(); /* Wait for a bit. */ - KeDelayExecutionThread(KernelMode, FALSE, &Interval); + KeStallExecutionProcessor(PALETTE_FADE_TIME); } } From 73512e7ad460a2f3bef00dcee83fdec7c16bf78c Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 5 Apr 2014 16:49:17 +0000 Subject: [PATCH 214/419] [PSEH_TEST] #if out a test for C++. This test only shows the limitations of PSEH and does not provide a satisfying result anyway. svn path=/trunk/; revision=62629 --- rostests/tests/pseh2/psehtest.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rostests/tests/pseh2/psehtest.c b/rostests/tests/pseh2/psehtest.c index e23dc7376c1..3fc2160efa3 100644 --- a/rostests/tests/pseh2/psehtest.c +++ b/rostests/tests/pseh2/psehtest.c @@ -2447,6 +2447,15 @@ DEFINE_TEST(test_unvolatile_2) return (val == 3) || (val == 4) || (val == 5); } +/* This test is mainly for documentation purpose. As can be seen it doesn't + provide a satisfying result. In fact the compiler could do even more + crazy things like reusing val1 between the assignment to 0 and the last + assignment to 3. This DOES happen with C++ and it's NOT a PSEH bug, but + rather an unavoidable consequence of how the compiler works. + The conclusion: Do not use assignments to a variable inside a __try block + that is being used later inside the __except block, unless it is declared + volatile! */ +#ifndef __cplusplus DEFINE_TEST(test_unvolatile_3) { int register val1 = 0, val2 = 0; @@ -2494,6 +2503,7 @@ DEFINE_TEST(test_unvolatile_3) return FALSE; } +#endif // __cplusplus DEFINE_TEST(test_unvolatile_4) { @@ -2840,7 +2850,9 @@ void testsuite_syntax(void) USE_TEST(test_unvolatile), USE_TEST(test_unvolatile_2), +#ifndef __cplusplus USE_TEST(test_unvolatile_3), +#endif USE_TEST(test_unvolatile_4), USE_TEST(test_finally_goto), USE_TEST(test_nested_exception), From 913e1ed8b9be2707877dc6777b29fb0964399532 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sat, 5 Apr 2014 16:56:00 +0000 Subject: [PATCH 215/419] [PSEH3] Make sure _abnormal_termination() returns the correct result and make sure the compiler does not rely on register values in the finally and filter function. The C++ PSEH tests now all pass. => We now have PSEH support for C++. svn path=/trunk/; revision=62630 --- reactos/include/reactos/libs/pseh/pseh3.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/reactos/include/reactos/libs/pseh/pseh3.h b/reactos/include/reactos/libs/pseh/pseh3.h index 8b7ca201242..4fe95d45238 100644 --- a/reactos/include/reactos/libs/pseh/pseh3.h +++ b/reactos/include/reactos/libs/pseh/pseh3.h @@ -230,17 +230,19 @@ _SEH3$_AutoCleanup( #define _SEH3$_NESTED_FUNC_RETURN(_Result) \ /* Restore esp and return to the caller */ \ asm volatile ("movl %[FixedEsp], %%esp\nret\n" \ - : : "a"(_Result), [FixedEsp]"m"(_SEH3$_TrylevelFrame.AllocaFrame) : "memory") + : : "a"(_Result), [FixedEsp]"m"(_SEH3$_TrylevelFrame.AllocaFrame) : "ebx", "ecx", "edx", "esi", "edi", "flags", "memory") /* The filter "function" */ #define _SEH3$_DEFINE_FILTER_FUNC(_Name, expression) \ { \ /* Evaluate and return the filter expression */ \ + asm volatile ("#\n" : : : "eax", "ebx", "ecx", "edx", "esi", "edi", "flags", "memory"); \ _SEH3$_NESTED_FUNC_RETURN((expression)); \ } #define _SEH3$_FINALLY_FUNC_OPEN(_Name) \ { \ + asm volatile ("#\n" : : : "eax", "ebx", "ecx", "edx", "esi", "edi", "flags", "memory"); \ /* This construct makes sure that the finally function returns */ \ /* a proper value at the end */ \ for (; ; (void)({_SEH3$_NESTED_FUNC_RETURN(0); 0;})) @@ -429,6 +431,7 @@ _SEH3$_AutoCleanup( /* Register the registration record. */ \ if (_SEH3$_TryLevel == 1) _SEH3$_RegisterFrame_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ else _SEH3$_RegisterTryLevel_(&_SEH3$_TrylevelFrame, &_SEH3$_ScopeTable); \ + _SEH3$_TrylevelFrame.ExceptionPointers = (PSEH3$_EXCEPTION_POINTERS)1; \ \ goto _SEH3$_l_DoTry; \ \ From 3bf3d743b5dbe032e3e62f94f0d44fc15884445a Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 5 Apr 2014 17:17:47 +0000 Subject: [PATCH 216/419] [NDK][DDK][XDK] - Move BITMAP_RANGE structure to NDK where it belongs svn path=/trunk/; revision=62631 --- reactos/include/ddk/ntifs.h | 9 --------- reactos/include/ndk/cctypes.h | 13 ++++++++++++- reactos/include/xdk/ntifs.template.h | 9 --------- 3 files changed, 12 insertions(+), 19 deletions(-) diff --git a/reactos/include/ddk/ntifs.h b/reactos/include/ddk/ntifs.h index fa7d3fe7984..df190c10d0a 100644 --- a/reactos/include/ddk/ntifs.h +++ b/reactos/include/ddk/ntifs.h @@ -11290,15 +11290,6 @@ typedef struct _OBJECT_BASIC_INFORMATION LARGE_INTEGER CreationTime; } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION; -typedef struct _BITMAP_RANGE { - LIST_ENTRY Links; - LONGLONG BasePage; - ULONG FirstDirtyPage; - ULONG LastDirtyPage; - ULONG DirtyPages; - PULONG Bitmap; -} BITMAP_RANGE, *PBITMAP_RANGE; - typedef struct _FILE_COPY_ON_WRITE_INFORMATION { BOOLEAN ReplaceIfExists; HANDLE RootDirectory; diff --git a/reactos/include/ndk/cctypes.h b/reactos/include/ndk/cctypes.h index b94738fdccc..22533cdaab0 100644 --- a/reactos/include/ndk/cctypes.h +++ b/reactos/include/ndk/cctypes.h @@ -81,7 +81,18 @@ typedef struct _PRIVATE_CACHE_MAP LIST_ENTRY PrivateLinks; } PRIVATE_CACHE_MAP, *PPRIVATE_CACHE_MAP; -typedef struct _MBCB { +typedef struct _BITMAP_RANGE +{ + LIST_ENTRY Links; + LONGLONG BasePage; + ULONG FirstDirtyPage; + ULONG LastDirtyPage; + ULONG DirtyPages; + PULONG Bitmap; +} BITMAP_RANGE, *PBITMAP_RANGE; + +typedef struct _MBCB +{ CSHORT NodeTypeCode; CSHORT NodeIsInZone; ULONG PagesToWrite; diff --git a/reactos/include/xdk/ntifs.template.h b/reactos/include/xdk/ntifs.template.h index a7908988416..dfff253e59e 100644 --- a/reactos/include/xdk/ntifs.template.h +++ b/reactos/include/xdk/ntifs.template.h @@ -1409,15 +1409,6 @@ typedef struct _OBJECT_BASIC_INFORMATION LARGE_INTEGER CreationTime; } OBJECT_BASIC_INFORMATION, *POBJECT_BASIC_INFORMATION; -typedef struct _BITMAP_RANGE { - LIST_ENTRY Links; - LONGLONG BasePage; - ULONG FirstDirtyPage; - ULONG LastDirtyPage; - ULONG DirtyPages; - PULONG Bitmap; -} BITMAP_RANGE, *PBITMAP_RANGE; - typedef struct _FILE_COPY_ON_WRITE_INFORMATION { BOOLEAN ReplaceIfExists; HANDLE RootDirectory; From ece6628139cdc8af4490ff17de1d0e97a34debbb Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 21:08:10 +0000 Subject: [PATCH 217/419] [MMEBUDDY] Fix use after free. CID #716804 svn path=/trunk/; revision=62632 --- reactos/lib/drivers/sound/mmebuddy/deviceinstance.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reactos/lib/drivers/sound/mmebuddy/deviceinstance.c b/reactos/lib/drivers/sound/mmebuddy/deviceinstance.c index 33f23e3105f..2e34aa6dc4c 100644 --- a/reactos/lib/drivers/sound/mmebuddy/deviceinstance.c +++ b/reactos/lib/drivers/sound/mmebuddy/deviceinstance.c @@ -306,15 +306,16 @@ DestroyAllSoundDeviceInstances( IN PSOUND_DEVICE SoundDevice) { MMRESULT Result; - PSOUND_DEVICE_INSTANCE SoundDeviceInstance; + PSOUND_DEVICE_INSTANCE SoundDeviceInstance, NextDeviceInstance; SoundDeviceInstance = SoundDevice->HeadInstance; while ( SoundDeviceInstance ) { + NextDeviceInstance = SoundDeviceInstance->Next; Result = DestroySoundDeviceInstance(SoundDeviceInstance); SND_ASSERT( MMSUCCESS(Result) ); - SoundDeviceInstance = SoundDeviceInstance->Next; + SoundDeviceInstance = NextDeviceInstance; } return MMSYSERR_NOERROR; From 849f7cf1d13cb57d0e8f48c40791bd0a006f98fb Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 21:27:12 +0000 Subject: [PATCH 218/419] [SVCHOST] Fix buffer overruns in LanaFlagIsSet() and SetLanaFlag(). Normally, i shouldn't be > 7, MAX_LANA is set to 254. CID #1102306 CID #1102305 svn path=/trunk/; revision=62633 --- reactos/base/services/svchost/netbios.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/base/services/svchost/netbios.c b/reactos/base/services/svchost/netbios.c index 8537e61a66d..f2015d329ed 100644 --- a/reactos/base/services/svchost/netbios.c +++ b/reactos/base/services/svchost/netbios.c @@ -64,7 +64,7 @@ LanaFlagIsSet ( DWORD i = Lana / 32; /* Clear the flag for this LANA */ - return (i <= 8) ? LanaFlags[i] & (1 << (Lana - 32 * i)) : FALSE; + return (i <= 7) ? LanaFlags[i] & (1 << (Lana - 32 * i)) : FALSE; } VOID @@ -76,7 +76,7 @@ SetLanaFlag ( DWORD i = Lana / 32; /* Set the flag for this LANA */ - if (i <= 8) LanaFlags[i] |= 1 << (Lana - 32 * i); + if (i <= 7) LanaFlags[i] |= 1 << (Lana - 32 * i); } VOID From 8e01ed0bd8e3b5638db4140ffe0c3b7968490e6a Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 21:42:48 +0000 Subject: [PATCH 219/419] [WIN32SS] Don't dereference an object that wasn't referenced CID #1102086 svn path=/trunk/; revision=62634 --- reactos/win32ss/user/ntuser/clipboard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/user/ntuser/clipboard.c b/reactos/win32ss/user/ntuser/clipboard.c index 28bb21325c2..30ab59ce9b5 100644 --- a/reactos/win32ss/user/ntuser/clipboard.c +++ b/reactos/win32ss/user/ntuser/clipboard.c @@ -304,10 +304,10 @@ IntAddSynthesizedFormats(PWINSTATION_OBJECT pWinStaObj) pMemObj->cbData = sizeof(LCID); *((LCID*)pMemObj->Data) = NtCurrentTeb()->CurrentLocale; IntAddFormatedData(pWinStaObj, CF_LOCALE, hMem, TRUE, TRUE); - } - /* Release the extra reference (UserCreateObject added 2 references) */ - UserDereferenceObject(pMemObj); + /* Release the extra reference (UserCreateObject added 2 references) */ + UserDereferenceObject(pMemObj); + } } /* Add CF_TEXT. Note: it is synthesized in user32.dll */ From 5ce3089b36900338fdda8a9676e82ba52c575fe4 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 21:56:15 +0000 Subject: [PATCH 220/419] [ROSAUTOTEST] Use matching delete operator CID #1102027 CID #1102028 svn path=/trunk/; revision=62635 --- rostests/rosautotest/CWineTest.cpp | 2 +- rostests/rosautotest/tools.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rostests/rosautotest/CWineTest.cpp b/rostests/rosautotest/CWineTest.cpp index 853204ab6f3..119b87d7645 100644 --- a/rostests/rosautotest/CWineTest.cpp +++ b/rostests/rosautotest/CWineTest.cpp @@ -178,7 +178,7 @@ CWineTest::GetNextTest() m_CurrentFile.clear(); /* Also free the memory for the list buffer */ - delete m_ListBuffer; + delete[] m_ListBuffer; m_ListBuffer = NULL; return false; diff --git a/rostests/rosautotest/tools.cpp b/rostests/rosautotest/tools.cpp index 0a58850af21..413a2b8aa18 100644 --- a/rostests/rosautotest/tools.cpp +++ b/rostests/rosautotest/tools.cpp @@ -196,7 +196,7 @@ GetINIValue(PCWCH AppName, PCWCH KeyName, PCWCH FileName) WideCharToMultiByte(CP_ACP, 0, Buffer, Length + 1, AsciiBuffer, Length + 1, NULL, NULL); ReturnedString = AsciiBuffer; - delete AsciiBuffer; + delete[] AsciiBuffer; } return ReturnedString; From 76c78c7e263ef84e68e7ecd1b2b2a34623ade77f Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 22:08:57 +0000 Subject: [PATCH 221/419] [CHARMAP] Remove useless checks CID #1102274 svn path=/trunk/; revision=62636 --- reactos/base/applications/charmap/settings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/base/applications/charmap/settings.c b/reactos/base/applications/charmap/settings.c index e326df5adff..ef2d5302c2b 100644 --- a/reactos/base/applications/charmap/settings.c +++ b/reactos/base/applications/charmap/settings.c @@ -122,13 +122,13 @@ extern void SaveSettings(void) hWnd = GetDlgItem(hCharmapDlg, IDC_FONTCOMBO); ComboBox_GetText(hWnd, szBuffer, MAX_PATH); - if(szBuffer != NULL && *szBuffer != '\0') + if(*szBuffer != '\0') RegSetValueEx(hKey, _T("Font"), 0, REG_SZ, (LPBYTE) szBuffer, (DWORD) MAX_PATH); hWnd = GetDlgItem(hCharmapDlg, IDC_COMBO_CHARSET); ComboBox_GetText(hWnd, szBuffer, MAX_PATH); - if(szBuffer != NULL && *szBuffer != '\0') + if(*szBuffer != '\0') RegSetValueEx(hKey, _T("CodePage"), 0, REG_SZ, (LPBYTE) szBuffer, (DWORD) MAX_PATH); RegSetValueEx(hKey, _T("Advanced"), 0, REG_DWORD, (LPBYTE)&Settings.IsAdvancedView, (DWORD) sizeof(DWORD)); From 28313aeb0c790b54650186078b7b543e876caff9 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 22:14:53 +0000 Subject: [PATCH 222/419] [KBSWITCH] Fix buffer overflow. Static strings are already \0 terminated. CID #515202 svn path=/trunk/; revision=62637 --- reactos/base/applications/kbswitch/kbswitch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/base/applications/kbswitch/kbswitch.c b/reactos/base/applications/kbswitch/kbswitch.c index 42f02391de9..94489314079 100644 --- a/reactos/base/applications/kbswitch/kbswitch.c +++ b/reactos/base/applications/kbswitch/kbswitch.c @@ -43,7 +43,7 @@ CreateTrayIcon(LPTSTR szLCID) szBuf, sizeof(szBuf) / sizeof(TCHAR)) == 0) { - lstrcpy(szBuf, _T("??\0")); + lstrcpy(szBuf, _T("??")); } hdcsrc = GetDC(NULL); From 9300d44ca7bc043e3d784d82e4fa059760e03798 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 22:31:19 +0000 Subject: [PATCH 223/419] [SERVMAN] - Call LocalFree() to free memory allocated with LocalAlloc() - Fix leak CID #716291 CID #1101891 CID #1101892 CID #1101893 CID #1101894 CID #1101895 CID #1101896 svn path=/trunk/; revision=62638 --- reactos/base/applications/mscutils/servman/create.c | 4 +--- reactos/base/applications/mscutils/servman/delete.c | 4 +--- .../base/applications/mscutils/servman/dependencies_tv1.c | 4 +--- .../base/applications/mscutils/servman/dependencies_tv2.c | 6 +++--- reactos/base/applications/mscutils/servman/listview.c | 4 +--- .../base/applications/mscutils/servman/stop_dependencies.c | 4 +--- 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/reactos/base/applications/mscutils/servman/create.c b/reactos/base/applications/mscutils/servman/create.c index 3f4ed747e15..2042901d62a 100644 --- a/reactos/base/applications/mscutils/servman/create.c +++ b/reactos/base/applications/mscutils/servman/create.c @@ -65,9 +65,7 @@ DoCreate(PCREATE_DATA Data) { DisplayString(lpSuccess); - HeapFree(ProcessHeap, - 0, - lpSuccess); + LocalFree(lpSuccess); } CloseServiceHandle(hSc); diff --git a/reactos/base/applications/mscutils/servman/delete.c b/reactos/base/applications/mscutils/servman/delete.c index c17a49d7a47..b041c15b73e 100644 --- a/reactos/base/applications/mscutils/servman/delete.c +++ b/reactos/base/applications/mscutils/servman/delete.c @@ -38,9 +38,7 @@ DoDeleteService(PMAIN_WND_INFO Info, { DisplayString(lpSuccess); - HeapFree(ProcessHeap, - 0, - lpSuccess); + LocalFree(lpSuccess); } bRet = TRUE; diff --git a/reactos/base/applications/mscutils/servman/dependencies_tv1.c b/reactos/base/applications/mscutils/servman/dependencies_tv1.c index 9c686e252b1..1c6918a36b9 100644 --- a/reactos/base/applications/mscutils/servman/dependencies_tv1.c +++ b/reactos/base/applications/mscutils/servman/dependencies_tv1.c @@ -163,9 +163,7 @@ TV1_AddDependantsToTree(PSERVICEPROPSHEET pDlgInfo, 0, FALSE); - HeapFree(ProcessHeap, - 0, - lpNoDepends); + LocalFree(lpNoDepends); /* Disable the window */ EnableWindow(pDlgInfo->hDependsTreeView1, FALSE); diff --git a/reactos/base/applications/mscutils/servman/dependencies_tv2.c b/reactos/base/applications/mscutils/servman/dependencies_tv2.c index d8ddc0e5783..3e2351eb779 100644 --- a/reactos/base/applications/mscutils/servman/dependencies_tv2.c +++ b/reactos/base/applications/mscutils/servman/dependencies_tv2.c @@ -41,6 +41,8 @@ TV2_HasDependantServices(LPWSTR lpServiceName) bRet = TRUE; } } + + CloseServiceHandle(hService); } CloseServiceHandle(hSCManager); @@ -163,9 +165,7 @@ TV2_AddDependantsToTree(PSERVICEPROPSHEET pDlgInfo, 0, FALSE); - HeapFree(ProcessHeap, - 0, - lpNoDepends); + LocalFree(lpNoDepends); /* Disable the window */ EnableWindow(pDlgInfo->hDependsTreeView2, FALSE); diff --git a/reactos/base/applications/mscutils/servman/listview.c b/reactos/base/applications/mscutils/servman/listview.c index 14523d8f788..48f4c130677 100644 --- a/reactos/base/applications/mscutils/servman/listview.c +++ b/reactos/base/applications/mscutils/servman/listview.c @@ -192,9 +192,7 @@ ChangeListViewText(PMAIN_WND_INFO Info, lvItem.iItem, (LPARAM)&lvItem); - HeapFree(ProcessHeap, - 0, - lpStartup); + LocalFree(lpStartup); HeapFree(ProcessHeap, 0, lpServiceConfig); diff --git a/reactos/base/applications/mscutils/servman/stop_dependencies.c b/reactos/base/applications/mscutils/servman/stop_dependencies.c index 941b0ad9c83..5ef227663f6 100644 --- a/reactos/base/applications/mscutils/servman/stop_dependencies.c +++ b/reactos/base/applications/mscutils/servman/stop_dependencies.c @@ -238,9 +238,7 @@ DoInitDependsDialog(PMAIN_WND_INFO pInfo, bRet = TRUE; } - HeapFree(ProcessHeap, - 0, - lpPartialStr); + LocalFree(lpPartialStr); } /* Display the list of services which need stopping */ From 9483e8b29c52616f2ff71215ece79c29ecd80b75 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 5 Apr 2014 22:49:18 +0000 Subject: [PATCH 224/419] [RAPPS] Don't pass structures by copy, give a pointer instead CID #502621 CID #502622 CID #502623 svn path=/trunk/; revision=62639 --- reactos/base/applications/rapps/available.c | 2 +- reactos/base/applications/rapps/installed.c | 2 +- reactos/base/applications/rapps/rapps.h | 4 ++-- reactos/base/applications/rapps/settingsdlg.c | 16 +++++++-------- reactos/base/applications/rapps/winmain.c | 20 +++++++++---------- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/reactos/base/applications/rapps/available.c b/reactos/base/applications/rapps/available.c index e4f4193adee..effde531fa3 100644 --- a/reactos/base/applications/rapps/available.c +++ b/reactos/base/applications/rapps/available.c @@ -219,7 +219,7 @@ EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc) GET_STRING2(L"URLSite", Info.szUrlSite); GET_STRING2(L"CDPath", Info.szCDPath); - if (!lpEnumProc(Info)) break; + if (!lpEnumProc(&Info)) break; } while (FindNextFileW(hFind, &FindFileData) != 0); FindClose(hFind); diff --git a/reactos/base/applications/rapps/installed.c b/reactos/base/applications/rapps/installed.c index fe244727505..e5b5b87f7ac 100644 --- a/reactos/base/applications/rapps/installed.c +++ b/reactos/base/applications/rapps/installed.c @@ -279,7 +279,7 @@ EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc) ((EnumType == ENUM_APPLICATIONS) && (!bIsUpdate)) || /* Applications only */ ((EnumType == ENUM_UPDATES) && (bIsUpdate))) /* Updates only */ { - if (!lpEnumProc(ItemIndex, pszDisplayName, Info)) + if (!lpEnumProc(ItemIndex, pszDisplayName, &Info)) break; } } diff --git a/reactos/base/applications/rapps/rapps.h b/reactos/base/applications/rapps/rapps.h index 6c87803dc9f..853d991eb30 100644 --- a/reactos/base/applications/rapps/rapps.h +++ b/reactos/base/applications/rapps/rapps.h @@ -107,7 +107,7 @@ typedef struct } SETTINGS_INFO, *PSETTINGS_INFO; /* available.c */ -typedef BOOL (CALLBACK *AVAILENUMPROC)(APPLICATION_INFO Info); +typedef BOOL (CALLBACK *AVAILENUMPROC)(PAPPLICATION_INFO Info); BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc); BOOL ShowAvailableAppInfo(INT Index); BOOL UpdateAppsDB(VOID); @@ -116,7 +116,7 @@ BOOL UpdateAppsDB(VOID); BOOL InstallApplication(INT Index); /* installed.c */ -typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, LPWSTR lpName, INSTALLED_INFO Info); +typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO Info); BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc); BOOL GetApplicationString(HKEY hKey, LPWSTR lpKeyName, LPWSTR lpString); BOOL ShowInstalledAppInfo(INT Index); diff --git a/reactos/base/applications/rapps/settingsdlg.c b/reactos/base/applications/rapps/settingsdlg.c index 7f3a5fba409..271bf560816 100644 --- a/reactos/base/applications/rapps/settingsdlg.c +++ b/reactos/base/applications/rapps/settingsdlg.c @@ -48,15 +48,15 @@ ChooseFolder(HWND hwnd) } static VOID -InitSettingsControls(HWND hDlg, SETTINGS_INFO Info) +InitSettingsControls(HWND hDlg, PSETTINGS_INFO Info) { - SendDlgItemMessage(hDlg, IDC_SAVE_WINDOW_POS, BM_SETCHECK, Info.bSaveWndPos, 0); - SendDlgItemMessage(hDlg, IDC_UPDATE_AVLIST, BM_SETCHECK, Info.bUpdateAtStart, 0); - SendDlgItemMessage(hDlg, IDC_LOG_ENABLED, BM_SETCHECK, Info.bLogEnabled, 0); - SendDlgItemMessage(hDlg, IDC_DEL_AFTER_INSTALL, BM_SETCHECK, Info.bDelInstaller, 0); + SendDlgItemMessage(hDlg, IDC_SAVE_WINDOW_POS, BM_SETCHECK, Info->bSaveWndPos, 0); + SendDlgItemMessage(hDlg, IDC_UPDATE_AVLIST, BM_SETCHECK, Info->bUpdateAtStart, 0); + SendDlgItemMessage(hDlg, IDC_LOG_ENABLED, BM_SETCHECK, Info->bLogEnabled, 0); + SendDlgItemMessage(hDlg, IDC_DEL_AFTER_INSTALL, BM_SETCHECK, Info->bDelInstaller, 0); SetWindowTextW(GetDlgItem(hDlg, IDC_DOWNLOAD_DIR_EDIT), - Info.szDownloadDir); + Info->szDownloadDir); } static @@ -68,7 +68,7 @@ SettingsDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: { NewSettingsInfo = SettingsInfo; - InitSettingsControls(hDlg, SettingsInfo); + InitSettingsControls(hDlg, &SettingsInfo); } break; @@ -98,7 +98,7 @@ SettingsDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) case IDC_DEFAULT_SETTINGS: FillDefaultSettings(&NewSettingsInfo); - InitSettingsControls(hDlg, NewSettingsInfo); + InitSettingsControls(hDlg, &NewSettingsInfo); break; case IDOK: diff --git a/reactos/base/applications/rapps/winmain.c b/reactos/base/applications/rapps/winmain.c index 6fa869f506f..f7b3dbd8d42 100644 --- a/reactos/base/applications/rapps/winmain.c +++ b/reactos/base/applications/rapps/winmain.c @@ -115,7 +115,7 @@ FreeInstalledAppList(VOID) BOOL CALLBACK -EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, INSTALLED_INFO Info) +EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO Info) { PINSTALLED_INFO ItemInfo; WCHAR szText[MAX_PATH]; @@ -127,7 +127,7 @@ EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, INSTALLED_INFO Info) ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(INSTALLED_INFO)); if (!ItemInfo) return FALSE; - *ItemInfo = Info; + RtlCopyMemory(ItemInfo, Info, sizeof(INSTALLED_INFO)); Index = ListViewAddItem(ItemIndex, 0, lpName, (LPARAM)ItemInfo); @@ -158,13 +158,13 @@ FreeAvailableAppList(VOID) BOOL CALLBACK -EnumAvailableAppProc(APPLICATION_INFO Info) +EnumAvailableAppProc(PAPPLICATION_INFO Info) { PAPPLICATION_INFO ItemInfo; INT Index; - if (!SearchPatternMatch(Info.szName, szSearchPattern) && - !SearchPatternMatch(Info.szDesc, szSearchPattern)) + if (!SearchPatternMatch(Info->szName, szSearchPattern) && + !SearchPatternMatch(Info->szDesc, szSearchPattern)) { return TRUE; } @@ -173,16 +173,16 @@ EnumAvailableAppProc(APPLICATION_INFO Info) - no RegName was supplied (so we cannot determine whether the application is installed or not) or - a RegName was supplied and the application is not installed */ - if (!*Info.szRegName || (!IsInstalledApplication(Info.szRegName, FALSE) && !IsInstalledApplication(Info.szRegName, TRUE))) + if (!*Info->szRegName || (!IsInstalledApplication(Info->szRegName, FALSE) && !IsInstalledApplication(Info->szRegName, TRUE))) { ItemInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(APPLICATION_INFO)); if (!ItemInfo) return FALSE; - *ItemInfo = Info; + RtlCopyMemory(ItemInfo, Info, sizeof(APPLICATION_INFO)); - Index = ListViewAddItem(Info.Category, 0, Info.szName, (LPARAM)ItemInfo); - ListView_SetItemText(hListView, Index, 1, Info.szVersion); - ListView_SetItemText(hListView, Index, 2, Info.szDesc); + Index = ListViewAddItem(Info->Category, 0, Info->szName, (LPARAM)ItemInfo); + ListView_SetItemText(hListView, Index, 1, Info->szVersion); + ListView_SetItemText(hListView, Index, 2, Info->szDesc); } return TRUE; From df6836cce4f7f371ba39c16d8e88dbe07cadbec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 5 Apr 2014 23:58:54 +0000 Subject: [PATCH 225/419] [NTDLL_APITEST] Add/refine RtlDoesFileExists* and RtlDosSearchPath_U APIs tests. CORE-6373 #comment Tests for RtlDoesFileExists* and RtlDosSearchPath_U APIs added in revision 62640. svn path=/trunk/; revision=62640 --- rostests/apitests/ntdll/RtlDoesFileExists.c | 47 ++- rostests/apitests/ntdll/RtlDosSearchPath_U.c | 316 +++++++++++++++---- 2 files changed, 300 insertions(+), 63 deletions(-) diff --git a/rostests/apitests/ntdll/RtlDoesFileExists.c b/rostests/apitests/ntdll/RtlDoesFileExists.c index b54ff5b9dca..20d594b6f49 100644 --- a/rostests/apitests/ntdll/RtlDoesFileExists.c +++ b/rostests/apitests/ntdll/RtlDoesFileExists.c @@ -139,11 +139,27 @@ START_TEST(RtlDoesFileExists) { L"C:\\/\\%ls", TRUE }, { L"C:\\%ls\\", TRUE }, { L"C:\\%ls\\ThisFolderExists", TRUE }, + { L"C:\\%ls\\ThisFolderExists ", TRUE }, + { L"C:\\%ls\\ThisFolderExists ", TRUE }, + { L"C:\\%ls\\ThisFolderExists ", TRUE }, + { L"C:\\%ls\\ThisFolderExists:", FALSE }, + { L"C:\\%ls\\ThisFolderExists\t", FALSE }, + { L"C:\\%ls\\ThisFolderExists\n", FALSE }, + { L"C:\\%ls\\ThisFolderExists\r", FALSE }, + { L" C:\\%ls\\ThisFolderExists", FALSE }, + { L"C:\\%ls\\ ThisFolderExists", FALSE }, + { L"C:\\%ls \\ThisFolderExists", FALSE }, { L"C:\\%ls\\ThisDoesntExist", FALSE }, { L"C:\\\\%ls\\\\ThisFolderExists", TRUE }, { L"C:\\%ls\\ThisFolderExists\\ThisFileExists", TRUE }, { L"c:\\%ls\\thisfolderexists\\thisfileexists", TRUE }, { L"C:\\%ls\\THISFOLDEREXISTS\\THISFILEEXISTS", TRUE }, + { L"C:\\%ls\\ThisFolderExists\\SomeProgram.exe",TRUE }, + { L"C:\\%ls\\ThisFolderExists\\SomeProgram", FALSE }, + { L"C:\\%ls\\ThisFolderExists\\With", FALSE }, + { L"C:\\%ls\\ThisFolderExists\\With Space", TRUE }, + { L"C:\\%ls\\ThisFolderExists\\Without", TRUE }, + { L"C:\\%ls\\ThisFolderExists\\Without Space", FALSE }, { L"C:\\%ls abc", FALSE }, { L"\"C:\\%ls\" abc", FALSE }, { L"\"C:\\\"", FALSE }, @@ -251,6 +267,21 @@ START_TEST(RtlDoesFileExists) CloseHandle(Handle); } + swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\SomeProgram.exe", CustomPath); + Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); + ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n"); + if (Handle != INVALID_HANDLE_VALUE) CloseHandle(Handle); + + swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\With Space", CustomPath); + Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); + ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n"); + if (Handle != INVALID_HANDLE_VALUE) CloseHandle(Handle); + + swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\Without", CustomPath); + Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); + ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n"); + if (Handle != INVALID_HANDLE_VALUE) CloseHandle(Handle); + for (i = 0; i < sizeof(Tests) / sizeof(Tests[0]); i++) { swprintf(FileName, Tests[i].FileName, CustomPath); @@ -301,13 +332,23 @@ START_TEST(RtlDoesFileExists) } } + swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\Without", CustomPath); + Success = DeleteFileW(FileName); + ok(Success, "DeleteFile failed (%lu), test might leave stale file\n", GetLastError()); + swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\With Space", CustomPath); + Success = DeleteFileW(FileName); + ok(Success, "DeleteFile failed (%lu), test might leave stale file\n", GetLastError()); + swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\SomeProgram.exe", CustomPath); + Success = DeleteFileW(FileName); + ok(Success, "DeleteFile failed (%lu), test might leave stale file\n", GetLastError()); + swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath); Success = DeleteFileW(FileName); - ok(Success, "DeleteFile failed, test might leave stale file\n"); + ok(Success, "DeleteFile failed (%lu), test might leave stale file\n", GetLastError()); swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); Success = RemoveDirectoryW(FileName); - ok(Success, "RemoveDirectory failed, test might leave stale directory\n"); + ok(Success, "RemoveDirectory failed (%lu), test might leave stale directory\n", GetLastError()); swprintf(FileName, L"C:\\%ls", CustomPath); Success = RemoveDirectoryW(FileName); - ok(Success, "RemoveDirectory failed, test might leave stale directory\n"); + ok(Success, "RemoveDirectory failed (%lu), test might leave stale directory\n", GetLastError()); } diff --git a/rostests/apitests/ntdll/RtlDosSearchPath_U.c b/rostests/apitests/ntdll/RtlDosSearchPath_U.c index ee60f2100c8..d785ac1a35b 100644 --- a/rostests/apitests/ntdll/RtlDosSearchPath_U.c +++ b/rostests/apitests/ntdll/RtlDosSearchPath_U.c @@ -24,6 +24,8 @@ RtlDosSearchPath_U( ); */ +#define PrintablePointer(p) ((p) == InvalidPointer ? NULL : (p)) + static BOOLEAN CheckStringBuffer( @@ -92,6 +94,218 @@ CheckBuffer( return TRUE; } +static +VOID +RunTestCases( + PCWSTR CustomPath) +{ + struct + { + PCWSTR SearchPath; + PCWSTR FileName; + PCWSTR Extension; + PCWSTR ResultPath; + PCWSTR ResultFileName; + } Tests[] = + { + { L"", L"", NULL, NULL, NULL }, + { L"C:\\%ls\\Folder1", L"File1", NULL, L"C:\\%ls\\Folder1\\", L"File1" }, + /* No path: current directory */ + { L"", L"File1", NULL, L"C:\\%ls\\CurrentDirectory\\", L"File1" }, + /* Full path as FileName */ + { L"", L"C:\\", NULL, L"C:\\", NULL }, + { L"", L"C:\\%ls\\Folder1", NULL, L"C:\\%ls\\", L"Folder1" }, + /* No FileName */ + { L"C:\\", L"", NULL, L"C:\\", NULL }, + { L"C:\\%ls\\Folder1", L"", NULL, L"C:\\%ls\\Folder1\\", NULL }, + /* Full path as FileName */ + { L"", L"C:\\%ls\\Folder1\\SomeProgram.exe", NULL, L"C:\\%ls\\Folder1\\", L"SomeProgram.exe" }, + { L"", L"C:\\%ls\\Folder1\\SomeProgram.exe", L".exe", L"C:\\%ls\\Folder1\\", L"SomeProgram.exe" }, + { L"", L"C:\\%ls\\Folder1\\SomeProgram", NULL, NULL, NULL }, + // 10 + { L"", L"C:\\%ls\\Folder1\\SomeProgram", L".exe", NULL, NULL }, + /* Both SearchPath and FileName */ + { L"C:\\%ls\\Folder1\\", L"SomeProgram.exe", NULL, L"C:\\%ls\\Folder1\\", L"SomeProgram.exe" }, + { L"C:\\%ls\\Folder1\\", L"SomeProgram.exe", L".exe", L"C:\\%ls\\Folder1\\", L"SomeProgram.exe" }, + { L"C:\\%ls\\Folder1\\", L"SomeProgram", NULL, NULL, NULL }, + { L"C:\\%ls\\Folder1\\", L"SomeProgram", L".exe", L"C:\\%ls\\Folder1\\", L"SomeProgram.exe" }, + { L"C:\\%ls\\Folder1", L"SomeProgram.exe", NULL, L"C:\\%ls\\Folder1\\", L"SomeProgram.exe" }, + { L"C:\\%ls\\Folder1", L"SomeProgram.exe", L".exe", L"C:\\%ls\\Folder1\\", L"SomeProgram.exe" }, + { L"C:\\%ls\\Folder1", L"SomeProgram", NULL, NULL, NULL }, + { L"C:\\%ls\\Folder1", L"SomeProgram", L".exe", L"C:\\%ls\\Folder1\\", L"SomeProgram.exe" }, + /* Full path to file in SearchPath doesn't work */ + { L"C:\\%ls\\Folder1\\SomeProgram.exe", L"", NULL, NULL, NULL }, + // 20 + { L"C:\\%ls\\Folder1\\SomeProgram.exe", L"", L".exe", NULL, NULL }, + { L"C:\\%ls\\Folder1\\SomeProgram", L"", NULL, NULL, NULL }, + { L"C:\\%ls\\Folder1\\SomeProgram", L"", L".exe", NULL, NULL }, + /* */ + { L"C:\\%ls\\Folder1", L"File1", NULL, L"C:\\%ls\\Folder1\\", L"File1" }, + { L"C:\\%ls\\CurrentDirectory", L"File1", NULL, L"C:\\%ls\\CurrentDirectory\\", L"File1" }, + { L"C:\\%ls\\Folder1 ", L"File1", NULL, NULL, NULL }, + { L"C:\\%ls\\CurrentDirectory ",L"File1", NULL, NULL, NULL }, + { L" C:\\%ls\\Folder1", L"File1", NULL, NULL, NULL }, + { L" C:\\%ls\\CurrentDirectory",L"File1", NULL, NULL, NULL }, + { L" C:\\%ls\\Folder1 ", L"File1", NULL, NULL, NULL }, + // 30 + { L" C:\\%ls\\CurrentDirectory ",L"File1", NULL, NULL, NULL }, + /* Multiple search paths */ + { L"C:\\%ls\\Folder1;C:\\%ls\\CurrentDirectory", + L"File1", NULL, L"C:\\%ls\\Folder1\\", L"File1" }, + { L"C:\\%ls\\CurrentDirectory;C:\\%ls\\Folder1", + L"File1", NULL, L"C:\\%ls\\CurrentDirectory\\", L"File1" }, + { L"C:\\%ls\\CurrentDirectory ; C:\\%ls\\Folder1", + L"File1", NULL, NULL, NULL }, + { L"C:\\%ls\\CurrentDirectory ;C:\\%ls\\Folder1", + L"File1", NULL, L"C:\\%ls\\Folder1\\", L"File1" }, + { L"C:\\%ls\\CurrentDirectory; C:\\%ls\\Folder1", + L"File1", NULL, L"C:\\%ls\\CurrentDirectory\\", L"File1" }, + { L";C:\\%ls\\Folder1", L"File1", NULL, L"C:\\%ls\\CurrentDirectory\\", L"File1" }, + { L";C:\\%ls\\Folder1;", L"File1", NULL, L"C:\\%ls\\CurrentDirectory\\", L"File1" }, + { L";C:\\%ls\\Folder1;", L"File1", NULL, L"C:\\%ls\\CurrentDirectory\\", L"File1" }, + { L"C:\\%ls\\Folder1", L"OnlyInCurr", NULL, NULL, NULL }, + // 40 + { L"", L"OnlyInCurr", NULL, L"C:\\%ls\\CurrentDirectory\\", L"OnlyInCurr" }, + { L"", L"OnlyInCurr ", NULL, L"C:\\%ls\\CurrentDirectory\\", L"OnlyInCurr" }, + { L"", L" OnlyInCurr", NULL, NULL, NULL }, + { L" ", L"OnlyInCurr", NULL, NULL, NULL }, + { L";", L"OnlyInCurr", NULL, L"C:\\%ls\\CurrentDirectory\\", L"OnlyInCurr" }, + { L"; ", L"OnlyInCurr", NULL, L"C:\\%ls\\CurrentDirectory\\", L"OnlyInCurr" }, + { L" ;", L"OnlyInCurr", NULL, NULL, NULL }, + { L" ; ", L"OnlyInCurr", NULL, NULL, NULL }, + { L";C:\\%ls\\Folder1", L"OnlyInCurr", NULL, L"C:\\%ls\\CurrentDirectory\\", L"OnlyInCurr" }, + { L"C:\\%ls\\Folder1;", L"OnlyInCurr", NULL, NULL, NULL }, + // 50 + { L"C:\\%ls\\Folder1;;", L"OnlyInCurr", NULL, L"C:\\%ls\\CurrentDirectory\\", L"OnlyInCurr" }, + { L";C:\\%ls\\Folder1;", L"OnlyInCurr", NULL, L"C:\\%ls\\CurrentDirectory\\", L"OnlyInCurr" }, + { L"C:\\%ls\\Folder1;C:\\%ls\\Folder2", + L"OnlyInCurr", NULL, NULL, NULL }, + { L";C:\\%ls\\Folder1;C:\\%ls\\Folder2", + L"OnlyInCurr", NULL, L"C:\\%ls\\CurrentDirectory\\", L"OnlyInCurr" }, + { L"C:\\%ls\\Folder1;;C:\\%ls\\Folder2", + L"OnlyInCurr", NULL, L"C:\\%ls\\CurrentDirectory\\", L"OnlyInCurr" }, + { L"C:\\%ls\\Folder1;C:\\%ls\\Folder2;", + L"OnlyInCurr", NULL, NULL, NULL }, + { L"C:\\%ls\\Folder1;C:\\%ls\\Folder2;;", + L"OnlyInCurr", NULL, L"C:\\%ls\\CurrentDirectory\\", L"OnlyInCurr" }, + /* Spaces in FileName! */ + { L"", L"C:\\%ls\\Folder1\\SomeProgram With Spaces", + L".exe", NULL, NULL }, + { L"", L"C:\\%ls\\Folder1\\SomeProgram With Spaces.exe", + L".exe", NULL, NULL }, + { L"", L"C:\\%ls\\Folder1\\Program", L".exe", NULL, NULL }, + // 60 + { L"", L"C:\\%ls\\Folder1\\Program.exe", L".exe", L"C:\\%ls\\Folder1\\", L"Program.exe" }, + { L"", L"C:\\%ls\\Folder1\\Program With", L".exe", NULL, NULL }, + { L"", L"C:\\%ls\\Folder1\\Program With.exe", L".exe", L"C:\\%ls\\Folder1\\", L"Program With.exe" }, + { L"", L"C:\\%ls\\Folder1\\Program With Spaces",L".exe", NULL, NULL }, + { L"", L"C:\\%ls\\Folder1\\Program With Spaces.exe", + L".exe", L"C:\\%ls\\Folder1\\", L"Program With Spaces.exe" }, + /* Same tests with path in SearchPath - now extensions are appended */ + { L"C:\\%ls\\Folder1", L"SomeProgram With Spaces", + L".exe", NULL, NULL }, + { L"C:\\%ls\\Folder1", L"SomeProgram With Spaces.exe", + L".exe", NULL, NULL }, + { L"C:\\%ls\\Folder1", L"Program", L".exe", L"C:\\%ls\\Folder1\\", L"Program.exe" }, + { L"C:\\%ls\\Folder1", L"Program.exe", L".exe", L"C:\\%ls\\Folder1\\", L"Program.exe" }, + { L"C:\\%ls\\Folder1", L"Program With", L".exe", L"C:\\%ls\\Folder1\\", L"Program With.exe" }, + // 70 + { L"C:\\%ls\\Folder1", L"Program With.exe", L".exe", L"C:\\%ls\\Folder1\\", L"Program With.exe" }, + { L"C:\\%ls\\Folder1", L"Program With Spaces", L".exe", L"C:\\%ls\\Folder1\\", L"Program With Spaces.exe" }, + { L"C:\\%ls\\Folder1", L"Program With Spaces.exe", + L".exe", L"C:\\%ls\\Folder1\\", L"Program With Spaces.exe" }, + }; + + ULONG i; + ULONG Length; + PWSTR PartName; + WCHAR SearchPath[MAX_PATH]; + WCHAR FileName[MAX_PATH]; + WCHAR ResultPath[MAX_PATH]; + WCHAR Buffer[MAX_PATH]; + BOOLEAN Okay; + + for (i = 0; i < sizeof(Tests) / sizeof(Tests[0]); i++) + { + swprintf(SearchPath, Tests[i].SearchPath, CustomPath, CustomPath, CustomPath, CustomPath); + swprintf(FileName, Tests[i].FileName, CustomPath, CustomPath, CustomPath, CustomPath); + RtlFillMemory(Buffer, sizeof(Buffer), 0x55); + PartName = InvalidPointer; + + StartSeh() + Length = RtlDosSearchPath_U(SearchPath, + FileName, + Tests[i].Extension, + sizeof(Buffer), + Buffer, + &PartName); + EndSeh(STATUS_SUCCESS); + + if (Tests[i].ResultPath) + { + swprintf(ResultPath, Tests[i].ResultPath, CustomPath, CustomPath, CustomPath, CustomPath); + if (Tests[i].ResultFileName) + { + ok(PartName == &Buffer[wcslen(ResultPath)], + "PartName = %p (%ls), expected %p\n", + PartName, PrintablePointer(PartName), &Buffer[wcslen(ResultPath)]); + wcscat(ResultPath, Tests[i].ResultFileName); + } + else + { + ok(PartName == NULL, + "PartName = %p (%ls), expected NULL\n", + PartName, PrintablePointer(PartName)); + } + Okay = CheckStringBuffer(Buffer, Length, sizeof(Buffer), ResultPath); + ok(Okay == TRUE, "CheckStringBuffer failed. Got '%ls', expected '%ls'\n", Buffer, ResultPath); + } + else + { + Okay = CheckBuffer(Buffer, sizeof(Buffer), 0x55); + ok(Okay == TRUE, "CheckBuffer failed\n"); + ok(Length == 0, "Length = %lu\n", Length); + ok(PartName == InvalidPointer, + "PartName = %p (%ls), expected %p\n", + PartName, PrintablePointer(PartName), InvalidPointer); + } + } +} + +#define MAKE_DIRECTORY(path) \ +do { \ + swprintf(FileName, path, CustomPath); \ + Success = CreateDirectoryW(FileName, NULL); \ + ok(Success, "CreateDirectory failed, results might not be accurate\n"); \ +} while (0) + +#define MAKE_FILE(path) \ +do { \ + swprintf(FileName, path, CustomPath); \ + Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); \ + ok(Handle != INVALID_HANDLE_VALUE, \ + "CreateFile failed, results might not be accurate\n"); \ + if (Handle != INVALID_HANDLE_VALUE) CloseHandle(Handle); \ +} while (0) + +#define DELETE_DIRECTORY(path) \ +do { \ + swprintf(FileName, path, CustomPath); \ + Success = RemoveDirectoryW(FileName); \ + ok(Success, \ + "RemoveDirectory failed (%lu), test might leave stale directory\n", \ + GetLastError()); \ +} while (0) + +#define DELETE_FILE(path) \ +do { \ + swprintf(FileName, path, CustomPath); \ + Success = DeleteFileW(FileName); \ + ok(Success, \ + "DeleteFile failed (%lu), test might leave stale file\n", \ + GetLastError()); \ +} while (0) + START_TEST(RtlDosSearchPath_U) { ULONG Length = 0; @@ -112,22 +326,30 @@ START_TEST(RtlDosSearchPath_U) } Success = CreateDirectoryW(FileName, NULL); ok(Success, "CreateDirectory failed, results might not be accurate\n"); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); - Success = CreateDirectoryW(FileName, NULL); - ok(Success, "CreateDirectory failed, results might not be accurate\n"); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath); - Handle = CreateFileW(FileName, 0, 0, NULL, CREATE_NEW, 0, NULL); - ok(Handle != INVALID_HANDLE_VALUE, "CreateFile failed, results might not be accurate\n"); - if (Handle != INVALID_HANDLE_VALUE) - CloseHandle(Handle); + + MAKE_DIRECTORY(L"C:\\%ls\\Folder1"); + MAKE_DIRECTORY(L"C:\\%ls\\Folder2"); + MAKE_DIRECTORY(L"C:\\%ls\\CurrentDirectory"); + Success = SetCurrentDirectoryW(FileName); + ok(Success, "SetCurrentDirectory failed\n"); + MAKE_FILE(L"C:\\%ls\\Folder1\\File1"); + MAKE_FILE(L"C:\\%ls\\Folder1\\SomeProgram.exe"); + MAKE_FILE(L"C:\\%ls\\Folder1\\SomeProgram2.exe"); + MAKE_FILE(L"C:\\%ls\\Folder1\\SomeProgram2.exe.exe"); + MAKE_FILE(L"C:\\%ls\\Folder1\\SomeProgram3.exe.exe"); + MAKE_FILE(L"C:\\%ls\\Folder1\\Program.exe"); + MAKE_FILE(L"C:\\%ls\\Folder1\\Program With.exe"); + MAKE_FILE(L"C:\\%ls\\Folder1\\Program With Spaces.exe"); + MAKE_FILE(L"C:\\%ls\\CurrentDirectory\\File1"); + MAKE_FILE(L"C:\\%ls\\CurrentDirectory\\OnlyInCurr"); /* NULL parameters */ - StartSeh() RtlDosSearchPath_U(NULL, NULL, NULL, 0, NULL, NULL); EndSeh(STATUS_ACCESS_VIOLATION); - StartSeh() Length = RtlDosSearchPath_U(NULL, L"", NULL, 0, NULL, NULL); EndSeh(STATUS_ACCESS_VIOLATION); - StartSeh() Length = RtlDosSearchPath_U(NULL, L"", NULL, 0, Buffer, NULL); EndSeh(STATUS_ACCESS_VIOLATION); - StartSeh() Length = RtlDosSearchPath_U(NULL, L"", NULL, 1, Buffer, NULL); EndSeh(STATUS_ACCESS_VIOLATION); - StartSeh() Length = RtlDosSearchPath_U(NULL, L"", NULL, 2, Buffer, NULL); EndSeh(STATUS_ACCESS_VIOLATION); - StartSeh() Length = RtlDosSearchPath_U(L"", NULL, NULL, 0, NULL, NULL); EndSeh(STATUS_ACCESS_VIOLATION); + StartSeh() RtlDosSearchPath_U(NULL, NULL, NULL, 0, NULL , NULL); EndSeh(STATUS_ACCESS_VIOLATION); + StartSeh() RtlDosSearchPath_U(NULL, L"" , NULL, 0, NULL , NULL); EndSeh(STATUS_ACCESS_VIOLATION); + StartSeh() RtlDosSearchPath_U(NULL, L"" , NULL, 0, Buffer, NULL); EndSeh(STATUS_ACCESS_VIOLATION); + StartSeh() RtlDosSearchPath_U(NULL, L"" , NULL, 1, Buffer, NULL); EndSeh(STATUS_ACCESS_VIOLATION); + StartSeh() RtlDosSearchPath_U(NULL, L"" , NULL, 2, Buffer, NULL); EndSeh(STATUS_ACCESS_VIOLATION); + StartSeh() RtlDosSearchPath_U(L"" , NULL, NULL, 0, NULL , NULL); EndSeh(STATUS_ACCESS_VIOLATION); /* Empty strings - first one that doesn't crash */ StartSeh() @@ -161,52 +383,26 @@ START_TEST(RtlDosSearchPath_U) Okay = CheckBuffer(Buffer, sizeof(Buffer), 0x55); ok(Okay, "CheckBuffer failed\n"); - /* Empty path string searches in current directory */ - swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); - Success = SetCurrentDirectoryW(FileName); - ok(Success, "SetCurrentDirectory failed\n"); - PartName = InvalidPointer; - RtlFillMemory(Buffer, sizeof(Buffer), 0x55); - StartSeh() - Length = RtlDosSearchPath_U(L"", L"ThisFileExists", NULL, sizeof(Buffer), Buffer, &PartName); - ok(Length == wcslen(FileName) * sizeof(WCHAR) + sizeof(L"\\ThisFileExists") - sizeof(UNICODE_NULL), "Length %lu\n", Length); - EndSeh(STATUS_SUCCESS); - ok(PartName == &Buffer[wcslen(FileName) + 1], "PartName = %p\n", PartName); - wcscat(FileName, L"\\ThisFileExists"); - Okay = CheckStringBuffer(Buffer, Length, sizeof(Buffer), FileName); - ok(Okay, "CheckStringBuffer failed\n"); + /* Now test the actual functionality */ + RunTestCases(CustomPath); - /* Absolute path in FileName is also okay */ - PartName = InvalidPointer; - RtlFillMemory(Buffer, sizeof(Buffer), 0x55); - StartSeh() - Length = RtlDosSearchPath_U(L"", L"C:\\", NULL, sizeof(Buffer), Buffer, &PartName); - ok(Length == sizeof(L"C:\\") - sizeof(UNICODE_NULL), "Length %lu\n", Length); - EndSeh(STATUS_SUCCESS); - ok(PartName == NULL, "PartName = %p\n", PartName); - Okay = CheckStringBuffer(Buffer, Length, sizeof(Buffer), L"C:\\"); - ok(Okay, "CheckStringBuffer failed\n"); - - /* Empty FileName also works */ - PartName = InvalidPointer; - RtlFillMemory(Buffer, sizeof(Buffer), 0x55); - StartSeh() - Length = RtlDosSearchPath_U(L"C:\\", L"", NULL, sizeof(Buffer), Buffer, &PartName); - ok(Length == sizeof(L"C:\\") - sizeof(UNICODE_NULL), "Length %lu\n", Length); - EndSeh(STATUS_SUCCESS); - ok(PartName == NULL, "PartName = %p\n", PartName); - Okay = CheckStringBuffer(Buffer, Length, sizeof(Buffer), L"C:\\"); - ok(Okay, "CheckStringBuffer failed\n"); - - /* Clean up test folder */ + /* + * Clean up test folder - We can't delete it + * if our current directory is inside. + */ SetCurrentDirectoryW(L"C:\\"); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists\\ThisFileExists", CustomPath); - Success = DeleteFileW(FileName); - ok(Success, "DeleteFile failed, test might leave stale file\n"); - swprintf(FileName, L"C:\\%ls\\ThisFolderExists", CustomPath); - Success = RemoveDirectoryW(FileName); - ok(Success, "RemoveDirectory failed (%lu), test might leave stale directory\n", GetLastError()); - swprintf(FileName, L"C:\\%ls", CustomPath); - Success = RemoveDirectoryW(FileName); - ok(Success, "RemoveDirectory failed (%lu), test might leave stale directory\n", GetLastError()); + DELETE_FILE(L"C:\\%ls\\CurrentDirectory\\OnlyInCurr"); + DELETE_FILE(L"C:\\%ls\\CurrentDirectory\\File1"); + DELETE_FILE(L"C:\\%ls\\Folder1\\Program With Spaces.exe"); + DELETE_FILE(L"C:\\%ls\\Folder1\\Program With.exe"); + DELETE_FILE(L"C:\\%ls\\Folder1\\Program.exe"); + DELETE_FILE(L"C:\\%ls\\Folder1\\SomeProgram3.exe.exe"); + DELETE_FILE(L"C:\\%ls\\Folder1\\SomeProgram2.exe.exe"); + DELETE_FILE(L"C:\\%ls\\Folder1\\SomeProgram2.exe"); + DELETE_FILE(L"C:\\%ls\\Folder1\\SomeProgram.exe"); + DELETE_FILE(L"C:\\%ls\\Folder1\\File1"); + DELETE_DIRECTORY(L"C:\\%ls\\CurrentDirectory"); + DELETE_DIRECTORY(L"C:\\%ls\\Folder2"); + DELETE_DIRECTORY(L"C:\\%ls\\Folder1"); + DELETE_DIRECTORY(L"C:\\%ls"); } From f3d151acd3dea5cf5c7990b8d23556b0f8624b65 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 6 Apr 2014 07:54:57 +0000 Subject: [PATCH 226/419] [NPFS] - Fix some uninitialized and over-initialized variables and some DPRINTs. CID 1102515 svn path=/trunk/; revision=62641 --- reactos/drivers/filesystems/npfs/create.c | 36 +++++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/reactos/drivers/filesystems/npfs/create.c b/reactos/drivers/filesystems/npfs/create.c index d1b6479d1f6..7fde99d3e29 100644 --- a/reactos/drivers/filesystems/npfs/create.c +++ b/reactos/drivers/filesystems/npfs/create.c @@ -96,7 +96,7 @@ NpOpenNamedPipeRootDirectory(IN PNP_DCB Dcb, IoStatus.Information = 0; } - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } @@ -122,7 +122,6 @@ NpCreateClientEnd(IN PNP_FCB Fcb, PNP_CCB Ccb = NULL; TRACE("Entered\n"); - IoStatus.Status = STATUS_SUCCESS; IoStatus.Information = 0; Privileges = NULL; @@ -172,7 +171,7 @@ NpCreateClientEnd(IN PNP_FCB Fcb, ((GrantedAccess & FILE_WRITE_DATA) && (NamedPipeConfiguration == FILE_PIPE_OUTBOUND))) { IoStatus.Status = STATUS_ACCESS_DENIED; - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } @@ -191,7 +190,7 @@ NpCreateClientEnd(IN PNP_FCB Fcb, if (NextEntry == ListHead) { IoStatus.Status = STATUS_PIPE_NOT_AVAILABLE; - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } @@ -202,7 +201,7 @@ NpCreateClientEnd(IN PNP_FCB Fcb, if (!NT_SUCCESS(IoStatus.Status)) { NpUninitializeSecurity(Ccb); - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } @@ -211,7 +210,7 @@ NpCreateClientEnd(IN PNP_FCB Fcb, IoStatus.Information = FILE_OPENED; IoStatus.Status = STATUS_SUCCESS; - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } @@ -373,7 +372,6 @@ NpFsdCreate(IN PDEVICE_OBJECT DeviceObject, ACCESS_MASK DesiredAccess; LIST_ENTRY DeferredList; UNICODE_STRING Prefix; - NTSTATUS Status; TRACE("Entered\n"); InitializeListHead(&DeferredList); @@ -384,7 +382,6 @@ NpFsdCreate(IN PDEVICE_OBJECT DeviceObject, DesiredAccess = IoStack->Parameters.CreatePipe.SecurityContext->DesiredAccess; IoStatus.Information = 0; - IoStatus.Status = STATUS_SUCCESS; FsRtlEnterFileSystem(); ExAcquireResourceExclusiveLite(&NpVcb->Lock, TRUE); @@ -428,8 +425,8 @@ NpFsdCreate(IN PDEVICE_OBJECT DeviceObject, goto Quickie; } - Status = NpTranslateAlias(&FileName); - if (!NT_SUCCESS(Status)) goto Quickie; + IoStatus.Status = NpTranslateAlias(&FileName); + if (!NT_SUCCESS(IoStatus.Status)) goto Quickie; if (RelatedFileObject) { @@ -543,6 +540,8 @@ NpCreateExistingNamedPipe(IN PNP_FCB Fcb, SubjectSecurityContext = &AccessState->SubjectSecurityContext; SeLockSubjectContext(SubjectSecurityContext); + IoStatus.Information = 0; + AccessGranted = SeAccessCheck(Fcb->SecurityDescriptor, SubjectSecurityContext, TRUE, @@ -581,21 +580,21 @@ NpCreateExistingNamedPipe(IN PNP_FCB Fcb, SeUnlockSubjectContext(SubjectSecurityContext); if (!AccessGranted) { - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } if (Fcb->CurrentInstances >= Fcb->MaximumInstances) { IoStatus.Status = STATUS_INSTANCE_NOT_AVAILABLE; - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } if (Disposition == FILE_CREATE) { IoStatus.Status = STATUS_ACCESS_DENIED; - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } @@ -616,7 +615,7 @@ NpCreateExistingNamedPipe(IN PNP_FCB Fcb, if (CheckShareAccess != ShareAccess) { IoStatus.Status = STATUS_ACCESS_DENIED; - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } @@ -638,7 +637,7 @@ NpCreateExistingNamedPipe(IN PNP_FCB Fcb, { --Ccb->Fcb->CurrentInstances; NpDeleteCcb(Ccb, List); - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } @@ -647,8 +646,8 @@ NpCreateExistingNamedPipe(IN PNP_FCB Fcb, NpCheckForNotify(Fcb->ParentDcb, 0, List); IoStatus.Status = STATUS_SUCCESS; - IoStatus.Information = 1; - TRACE("Leaving, IoStatus = %lx\n", IoStatus); + IoStatus.Information = FILE_OPENED; + TRACE("Leaving, IoStatus.Status = %lx\n", IoStatus.Status); return IoStatus; } @@ -664,7 +663,7 @@ NpCreateNewNamedPipe(IN PNP_DCB Dcb, IN PNAMED_PIPE_CREATE_PARAMETERS Parameters, IN PEPROCESS Process, IN PLIST_ENTRY List, - IN PIO_STATUS_BLOCK IoStatus) + OUT PIO_STATUS_BLOCK IoStatus) { NTSTATUS Status; USHORT NamedPipeConfiguration; @@ -817,7 +816,6 @@ NpFsdCreateNamedPipe(IN PDEVICE_OBJECT DeviceObject, FileName = FileObject->FileName; - IoStatus.Status = STATUS_SUCCESS; IoStatus.Information = 0; FsRtlEnterFileSystem(); From 4d992804291cdc908c82b76135093496acb02eee Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 6 Apr 2014 08:55:44 +0000 Subject: [PATCH 227/419] [ACPI] Add some DPRINTs on failure svn path=/trunk/; revision=62642 --- reactos/drivers/bus/acpi/main.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/reactos/drivers/bus/acpi/main.c b/reactos/drivers/bus/acpi/main.c index 72879a68347..afc9a1f2e4f 100644 --- a/reactos/drivers/bus/acpi/main.c +++ b/reactos/drivers/bus/acpi/main.c @@ -465,7 +465,10 @@ GetProcessorInformation(VOID) KEY_READ, &ProcessorHandle); if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to open CentralProcessor registry key: 0x%lx\n", Status); goto done; + } /* Query the processor identifier length */ Status = AcpiRegQueryValue(ProcessorHandle, @@ -474,7 +477,10 @@ GetProcessorInformation(VOID) NULL, &Length); if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to query Identifier value: 0x%lx\n", Status); goto done; + } /* Remember the length as fallback for level 1-3 length */ Level1Length = Level2Length = Level3Length = Length; @@ -484,6 +490,7 @@ GetProcessorInformation(VOID) ProcessorIdentifier = ExAllocatePoolWithTag(PagedPool, Length, 'IPCA'); if (ProcessorIdentifier == NULL) { + DPRINT1("Failed to allocate 0x%lx bytes\n", Length); Status = STATUS_INSUFFICIENT_RESOURCES; goto done; } @@ -495,7 +502,10 @@ GetProcessorInformation(VOID) ProcessorIdentifier, &Length); if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to query Identifier value: 0x%lx\n", Status); goto done; + } /* Query the processor name length */ Length = 0; @@ -505,13 +515,17 @@ GetProcessorInformation(VOID) NULL, &Length); if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to query ProcessorNameString value: 0x%lx\n", Status); goto done; + } /* Allocate a buffer large enough to be zero terminated */ Length += sizeof(UNICODE_NULL); ProcessorNameString = ExAllocatePoolWithTag(PagedPool, Length, 'IPCA'); if (ProcessorNameString == NULL) { + DPRINT1("Failed to allocate 0x%lx bytes\n", Length); Status = STATUS_INSUFFICIENT_RESOURCES; goto done; } @@ -523,7 +537,10 @@ GetProcessorInformation(VOID) ProcessorNameString, &Length); if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to query ProcessorNameString value: 0x%lx\n", Status); goto done; + } /* Query the vendor identifier length */ Length = 0; @@ -533,13 +550,17 @@ GetProcessorInformation(VOID) NULL, &Length); if (!NT_SUCCESS(Status) || (Length == 0)) + { + DPRINT1("Failed to query VendorIdentifier value: 0x%lx\n", Status); goto done; + } /* Allocate a buffer large enough to be zero terminated */ Length += sizeof(UNICODE_NULL); ProcessorVendorIdentifier = ExAllocatePoolWithTag(PagedPool, Length, 'IPCA'); if (ProcessorVendorIdentifier == NULL) { + DPRINT1("Failed to allocate 0x%lx bytes\n", Length); Status = STATUS_INSUFFICIENT_RESOURCES; goto done; } @@ -551,7 +572,10 @@ GetProcessorInformation(VOID) ProcessorVendorIdentifier, &Length); if (!NT_SUCCESS(Status)) + { + DPRINT1("Failed to query VendorIdentifier value: 0x%lx\n", Status); goto done; + } /* Change spaces to underscores */ for (i = 0; i < wcslen(ProcessorIdentifier); i++) From afac85a42b796b7539fafc47c7da4206f1490e11 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 6 Apr 2014 10:52:17 +0000 Subject: [PATCH 228/419] [NTOS:CC] - Remove unused CACHE_BITMAP feature that adds unnecessary complexity svn path=/trunk/; revision=62643 --- reactos/ntoskrnl/cc/view.c | 119 +------------------------------------ 1 file changed, 3 insertions(+), 116 deletions(-) diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index 46c14a504fa..7c4196978ab 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -41,14 +41,6 @@ /* GLOBALS *******************************************************************/ -/* - * If CACHE_BITMAP is defined, the cache manager uses one large memory region - * within the kernel address space and allocate/deallocate space from this block - * over a bitmap. If CACHE_BITMAP is used, the size of the mdl mapping region - * must be reduced (ntoskrnl\mm\mdl.c, MI_MDLMAPPING_REGION_SIZE). - */ -//#define CACHE_BITMAP - static LIST_ENTRY DirtySegmentListHead; static LIST_ENTRY CacheSegmentListHead; static LIST_ENTRY CacheSegmentLRUListHead; @@ -57,15 +49,6 @@ ULONG DirtyPageCount = 0; KGUARDED_MUTEX ViewLock; -#ifdef CACHE_BITMAP -#define CI_CACHESEG_MAPPING_REGION_SIZE (128*1024*1024) - -static PVOID CiCacheSegMappingRegionBase = NULL; -static RTL_BITMAP CiCacheSegMappingRegionAllocMap; -static ULONG CiCacheSegMappingRegionHint; -static KSPIN_LOCK CiCacheSegMappingRegionLock; -#endif - NPAGED_LOOKASIDE_LIST iBcbLookasideList; static NPAGED_LOOKASIDE_LIST BcbLookasideList; static NPAGED_LOOKASIDE_LIST CacheSegLookasideList; @@ -608,9 +591,6 @@ CcRosCreateCacheSegment ( PLIST_ENTRY current_entry; NTSTATUS Status; KIRQL oldIrql; -#ifdef CACHE_BITMAP - ULONG StartingOffset; -#endif ASSERT(Bcb); @@ -708,28 +688,7 @@ CcRosCreateCacheSegment ( InsertTailList(&CacheSegmentListHead, ¤t->CacheSegmentListEntry); InsertTailList(&CacheSegmentLRUListHead, ¤t->CacheSegmentLRUListEntry); KeReleaseGuardedMutex(&ViewLock); -#ifdef CACHE_BITMAP - KeAcquireSpinLock(&CiCacheSegMappingRegionLock, &oldIrql); - StartingOffset = RtlFindClearBitsAndSet(&CiCacheSegMappingRegionAllocMap, - VACB_MAPPING_GRANULARITY / PAGE_SIZE, - CiCacheSegMappingRegionHint); - - if (StartingOffset == 0xffffffff) - { - DPRINT1("Out of CacheSeg mapping space\n"); - KeBugCheck(CACHE_MANAGER); - } - - current->BaseAddress = CiCacheSegMappingRegionBase + StartingOffset * PAGE_SIZE; - - if (CiCacheSegMappingRegionHint == StartingOffset) - { - CiCacheSegMappingRegionHint += VACB_MAPPING_GRANULARITY / PAGE_SIZE; - } - - KeReleaseSpinLock(&CiCacheSegMappingRegionLock, oldIrql); -#else MmLockAddressSpace(MmGetKernelAddressSpace()); current->BaseAddress = NULL; Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), @@ -746,7 +705,6 @@ CcRosCreateCacheSegment ( { KeBugCheck(CACHE_MANAGER); } -#endif /* Create a virtual mapping for this memory area */ MI_SET_USAGE(MI_USAGE_CACHE); @@ -916,8 +874,7 @@ CcRosRequestCacheSegment ( UptoDate, CacheSeg); } -#ifdef CACHE_BITMAP -#else + static VOID CcFreeCachePage ( @@ -935,7 +892,7 @@ CcFreeCachePage ( MmReleasePageMemoryConsumer(MC_CACHE, Page); } } -#endif + NTSTATUS CcRosInternalFreeCacheSegment ( PCACHE_SEGMENT CacheSeg) @@ -943,13 +900,6 @@ CcRosInternalFreeCacheSegment ( * FUNCTION: Releases a cache segment associated with a BCB */ { -#ifdef CACHE_BITMAP - ULONG i; - ULONG RegionSize; - ULONG Base; - PFN_NUMBER Page; - KIRQL oldIrql; -#endif DPRINT("Freeing cache segment 0x%p\n", CacheSeg); #if DBG if ( CacheSeg->Bcb->Trace ) @@ -957,37 +907,14 @@ CcRosInternalFreeCacheSegment ( DPRINT1("CacheMap 0x%p: deleting Cache Segment: 0x%p\n", CacheSeg->Bcb, CacheSeg ); } #endif -#ifdef CACHE_BITMAP - RegionSize = VACB_MAPPING_GRANULARITY / PAGE_SIZE; - /* Unmap all the pages. */ - for (i = 0; i < RegionSize; i++) - { - MmDeleteVirtualMapping(NULL, - CacheSeg->BaseAddress + (i * PAGE_SIZE), - FALSE, - NULL, - &Page); - MmReleasePageMemoryConsumer(MC_CACHE, Page); - } - - KeAcquireSpinLock(&CiCacheSegMappingRegionLock, &oldIrql); - /* Deallocate all the pages used. */ - Base = (ULONG)(CacheSeg->BaseAddress - CiCacheSegMappingRegionBase) / PAGE_SIZE; - - RtlClearBits(&CiCacheSegMappingRegionAllocMap, Base, RegionSize); - - CiCacheSegMappingRegionHint = min(CiCacheSegMappingRegionHint, Base); - - KeReleaseSpinLock(&CiCacheSegMappingRegionLock, oldIrql); -#else MmLockAddressSpace(MmGetKernelAddressSpace()); MmFreeMemoryArea(MmGetKernelAddressSpace(), CacheSeg->MemoryArea, CcFreeCachePage, NULL); MmUnlockAddressSpace(MmGetKernelAddressSpace()); -#endif + ExFreeToNPagedLookasideList(&CacheSegLookasideList, CacheSeg); return STATUS_SUCCESS; } @@ -1365,48 +1292,8 @@ NTAPI CcInitView ( VOID) { -#ifdef CACHE_BITMAP - PMEMORY_AREA marea; - PVOID Buffer; -#endif - DPRINT("CcInitView()\n"); -#ifdef CACHE_BITMAP - CiCacheSegMappingRegionHint = 0; - CiCacheSegMappingRegionBase = NULL; - MmLockAddressSpace(MmGetKernelAddressSpace()); - - Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - MEMORY_AREA_CACHE_SEGMENT, - &CiCacheSegMappingRegionBase, - CI_CACHESEG_MAPPING_REGION_SIZE, - PAGE_READWRITE, - &marea, - FALSE, - 0, - PAGE_SIZE); - MmUnlockAddressSpace(MmGetKernelAddressSpace()); - if (!NT_SUCCESS(Status)) - { - KeBugCheck(CACHE_MANAGER); - } - - Buffer = ExAllocatePoolWithTag(NonPagedPool, - CI_CACHESEG_MAPPING_REGION_SIZE / (PAGE_SIZE * 8), - TAG_CC); - if (!Buffer) - { - KeBugCheck(CACHE_MANAGER); - } - - RtlInitializeBitMap(&CiCacheSegMappingRegionAllocMap, - Buffer, - CI_CACHESEG_MAPPING_REGION_SIZE / PAGE_SIZE); - RtlClearAllBits(&CiCacheSegMappingRegionAllocMap); - - KeInitializeSpinLock(&CiCacheSegMappingRegionLock); -#endif InitializeListHead(&CacheSegmentListHead); InitializeListHead(&DirtySegmentListHead); InitializeListHead(&CacheSegmentLRUListHead); From ab56f03e58c65c49946bef67699d17f4705ebaf2 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 6 Apr 2014 11:02:52 +0000 Subject: [PATCH 229/419] [NTOS:CC] - Correctly set output parameter in CcRosCreateCacheSegment failure case svn path=/trunk/; revision=62644 --- reactos/ntoskrnl/cc/view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index 7c4196978ab..e296348cb0a 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -598,7 +598,7 @@ CcRosCreateCacheSegment ( if (FileOffset >= Bcb->FileSize.u.LowPart) { - CacheSeg = NULL; + *CacheSeg = NULL; return STATUS_INVALID_PARAMETER; } From 35ab776df7b6a5436a8062463a2697f2f4f2752c Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 12:18:05 +0000 Subject: [PATCH 230/419] [SC] - Remove dead code - Fix check for memory deallocation - Don't leak resource CID #500056 CID #500057 CID #501497 CID #716313 svn path=/trunk/; revision=62645 --- reactos/base/applications/sc/query.c | 8 ++++---- reactos/base/applications/sc/start.c | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/reactos/base/applications/sc/query.c b/reactos/base/applications/sc/query.c index a0d8abae009..3df799425ce 100644 --- a/reactos/base/applications/sc/query.c +++ b/reactos/base/applications/sc/query.c @@ -135,15 +135,18 @@ EnumServices(ENUM_SERVICE_STATUS_PROCESS **pServiceStatus, &ResumeHandle, 0)) { + CloseServiceHandle(hSCManager); return NumServices; } } } ReportLastError(); - if (pServiceStatus) + if (*pServiceStatus) HeapFree(GetProcessHeap(), 0, *pServiceStatus); + CloseServiceHandle(hSCManager); + return NumServices; } @@ -237,8 +240,5 @@ Query(LPCTSTR *ServiceArgs, } } - if (pServiceStatus) - HeapFree(GetProcessHeap(), 0, pServiceStatus); - return TRUE; } diff --git a/reactos/base/applications/sc/start.c b/reactos/base/applications/sc/start.c index bc1c9100c5a..a5510561178 100644 --- a/reactos/base/applications/sc/start.c +++ b/reactos/base/applications/sc/start.c @@ -74,7 +74,6 @@ BOOL Start(LPCTSTR ServiceName, LPCTSTR *ServiceArgs, INT ArgCount) fail: ReportLastError(); - if (pServiceInfo) HeapFree(GetProcessHeap(), 0, pServiceInfo); if (hSc) CloseServiceHandle(hSc); if (hSCManager) CloseServiceHandle(hSCManager); return FALSE; From e37f56bfbb4e88a9b6d830c8378d43db8e8c3831 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 12:28:25 +0000 Subject: [PATCH 231/419] [TASKMGR] Don't leak handle CID #716315 svn path=/trunk/; revision=62646 --- reactos/base/applications/taskmgr/taskmgr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/base/applications/taskmgr/taskmgr.c b/reactos/base/applications/taskmgr/taskmgr.c index 23ccc39fcd3..5fec61407b2 100644 --- a/reactos/base/applications/taskmgr/taskmgr.c +++ b/reactos/base/applications/taskmgr/taskmgr.c @@ -130,6 +130,8 @@ int APIENTRY wWinMain(HINSTANCE hInstance, SendMessage(hTaskMgr, WM_SYSCOMMAND, SC_RESTORE, 0); SetForegroundWindow(hTaskMgr); } + + CloseHandle(hMutex); return 0; } else if (!hMutex) @@ -175,6 +177,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, /* Save our settings to the registry */ SaveSettings(); PerfDataUninitialize(); + CloseHandle(hMutex); return 0; } From ad8c33fa0084c50a6fa56cc1499036ffb9bd26f5 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 12:35:54 +0000 Subject: [PATCH 232/419] [EVENTLOG] - Fix memory leak - Fix null pointer dereference CID #515253 CID #716316 svn path=/trunk/; revision=62647 --- reactos/base/services/eventlog/file.c | 1 + reactos/base/services/eventlog/rpc.c | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/reactos/base/services/eventlog/file.c b/reactos/base/services/eventlog/file.c index 75ba6946374..31793a055b4 100644 --- a/reactos/base/services/eventlog/file.c +++ b/reactos/base/services/eventlog/file.c @@ -979,6 +979,7 @@ BOOL LogfWriteData(PLOGFILE LogFile, DWORD BufSize, PBYTE Buffer) if (RecBuf->Reserved != LOGFILE_SIGNATURE) { DPRINT1("LogFile corrupt!\n"); + HeapFree(GetProcessHeap(), 0, RecBuf); RtlReleaseResource(&LogFile->Lock); return FALSE; } diff --git a/reactos/base/services/eventlog/rpc.c b/reactos/base/services/eventlog/rpc.c index faac4609161..b33a119c5e5 100644 --- a/reactos/base/services/eventlog/rpc.c +++ b/reactos/base/services/eventlog/rpc.c @@ -921,20 +921,22 @@ NTSTATUS ElfrReportEventA( } Done: - for (i = 0; i < NumStrings; i++) + if (StringsArrayW != NULL) { - if (StringsArrayW[i] != NULL) + for (i = 0; i < NumStrings; i++) { - if (StringsArrayW[i]->Buffer) + if (StringsArrayW[i] != NULL) { - RtlFreeUnicodeString(StringsArrayW[i]); - HeapFree(MyHeap, 0, StringsArrayW[i]); + if (StringsArrayW[i]->Buffer) + { + RtlFreeUnicodeString(StringsArrayW[i]); + HeapFree(MyHeap, 0, StringsArrayW[i]); + } } } - } - if (StringsArrayW != NULL) HeapFree(MyHeap, 0, StringsArrayW); + } RtlFreeUnicodeString(&ComputerNameW); From 75555432ba7036a27b7beb0671c8de05700198c0 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 12:44:10 +0000 Subject: [PATCH 233/419] [TCPSVCS] - Fix buffer overrun - Fix memory leak - Properly init memory CID #511073 CID #1102322 CID #1102405 svn path=/trunk/; revision=62648 --- reactos/base/services/tcpsvcs/qotd.c | 6 +++++- reactos/base/services/tcpsvcs/skelserver.c | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/reactos/base/services/tcpsvcs/qotd.c b/reactos/base/services/tcpsvcs/qotd.c index 51cfb9e5796..710013aab52 100644 --- a/reactos/base/services/tcpsvcs/qotd.c +++ b/reactos/base/services/tcpsvcs/qotd.c @@ -58,7 +58,7 @@ RetrieveQuote(SOCKET sock) else { DWORD dwSize = GetFileSize(hFile, NULL); - lpQuotes = (LPSTR)HeapAlloc(GetProcessHeap(), 0, dwSize); + lpQuotes = (LPSTR)HeapAlloc(GetProcessHeap(), 0, dwSize + 1); if (!lpQuotes) { CloseHandle(hFile); @@ -75,7 +75,10 @@ RetrieveQuote(SOCKET sock) lpQuotes[dwSize] = 0; if (dwBytesRead != dwSize) + { + HeapFree(GetProcessHeap(), 0, lpQuotes); return FALSE; + } lpStr = lpQuotes; while (*lpStr) @@ -120,6 +123,7 @@ RetrieveQuote(SOCKET sock) } } + HeapFree(GetProcessHeap(), 0, lpQuotes); return TRUE; } diff --git a/reactos/base/services/tcpsvcs/skelserver.c b/reactos/base/services/tcpsvcs/skelserver.c index 7d0666db5aa..20bf8e374be 100644 --- a/reactos/base/services/tcpsvcs/skelserver.c +++ b/reactos/base/services/tcpsvcs/skelserver.c @@ -21,6 +21,7 @@ SetUpListener(USHORT Port) sock = socket(AF_INET, SOCK_STREAM, 0); if (sock != INVALID_SOCKET) { + ZeroMemory(&server, sizeof(SOCKADDR_IN)); server.sin_family = AF_INET; server.sin_addr.s_addr = htonl(INADDR_ANY); server.sin_port = Port; From 6e7450938fef23fc6178ec0e344fa1a44ae0d5e2 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 12:59:01 +0000 Subject: [PATCH 234/419] [FORMAT] - Check LoadLibrary() return - In case it doesn't match, free library CID #716330 svn path=/trunk/; revision=62649 --- reactos/base/system/format/format.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/reactos/base/system/format/format.c b/reactos/base/system/format/format.c index 9b4962d0d22..3a298d9d42b 100644 --- a/reactos/base/system/format/format.c +++ b/reactos/base/system/format/format.c @@ -238,20 +238,24 @@ FormatExCallback ( BOOLEAN LoadFMIFSEntryPoints() { HMODULE hFmifs = LoadLibrary( _T("fmifs.dll") ); - if( !(void*) GetProcAddress( hFmifs, "FormatEx" ) ) { + if (hFmifs == NULL) { + return FALSE; + } + if( !(void*) GetProcAddress( hFmifs, "FormatEx" ) ) { + FreeLibrary(hFmifs); return FALSE; } if( !((void *) GetProcAddress( hFmifs, "EnableVolumeCompression" )) ) { - + FreeLibrary(hFmifs); return FALSE; } if( !((void *) GetProcAddress( hFmifs, "QueryAvailableFileSystemFormat" )) ) { - + FreeLibrary(hFmifs); return FALSE; } From ab07d0dfbecd9b4c02ddb7bcd1d1939cdab1f0e2 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 13:01:41 +0000 Subject: [PATCH 235/419] [RUNDLL32] Fix resource leak CID #716331 svn path=/trunk/; revision=62650 --- reactos/base/system/rundll32/rundll32.c | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/base/system/rundll32/rundll32.c b/reactos/base/system/rundll32/rundll32.c index be5b364f880..45fb32edea9 100644 --- a/reactos/base/system/rundll32/rundll32.c +++ b/reactos/base/system/rundll32/rundll32.c @@ -428,6 +428,7 @@ int WINAPI _tWinMain( if (!RegisterBlankClass(hInstance, hPrevInstance)) { + FreeLibrary(hDll); return 0; } // Create a window so we can pass a window handle to From d141ce54b6d61baf01f35b191bdf6c9da3765fd4 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Sun, 6 Apr 2014 13:09:04 +0000 Subject: [PATCH 236/419] [WIN32K] - Fix a possible out of bounds read. CID 731665 svn path=/trunk/; revision=62651 --- reactos/win32ss/gdi/ntgdi/freetype.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/freetype.c b/reactos/win32ss/gdi/ntgdi/freetype.c index 1e761e8f6d9..953b9e4c2be 100644 --- a/reactos/win32ss/gdi/ntgdi/freetype.c +++ b/reactos/win32ss/gdi/ntgdi/freetype.c @@ -533,19 +533,19 @@ IntTranslateCharsetInfo(PDWORD Src, /* [in] switch (Flags) { case TCI_SRCFONTSIG: - while (0 == (*Src >> Index & 0x0001) && Index < MAXTCIINDEX) + while (Index < MAXTCIINDEX && 0 == (*Src >> Index & 0x0001)) { Index++; } break; case TCI_SRCCODEPAGE: - while ( *Src != FontTci[Index].ciACP && Index < MAXTCIINDEX) + while (Index < MAXTCIINDEX && *Src != FontTci[Index].ciACP) { Index++; } break; case TCI_SRCCHARSET: - while ( *Src != FontTci[Index].ciCharset && Index < MAXTCIINDEX) + while (Index < MAXTCIINDEX && *Src != FontTci[Index].ciCharset) { Index++; } From 362bca1c4a7d0a9c11e5e7f27a80315b8f49efd5 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 13:22:21 +0000 Subject: [PATCH 237/419] [FREELDR] Don't call strlen to get max len of an uninit string CID #731721 CID #731722 svn path=/trunk/; revision=62652 --- reactos/boot/freeldr/freeldr/disk/disk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/disk/disk.c b/reactos/boot/freeldr/freeldr/disk/disk.c index 67e962706bb..c6e061c2089 100644 --- a/reactos/boot/freeldr/freeldr/disk/disk.c +++ b/reactos/boot/freeldr/freeldr/disk/disk.c @@ -114,7 +114,7 @@ DiskGetBootPath(char *BootPath, unsigned Size) { /* This is a floppy */ - if (Size <= sizeof(Path) + 7 + strlen(Device)) + if (Size <= sizeof(Path) + 7 + sizeof(Device)) { return FALSE; } @@ -142,7 +142,7 @@ DiskGetBootPath(char *BootPath, unsigned Size) FrldrBootPartition = BootPartition; - if (Size <= sizeof(Path) + 18 + strlen(Device) + strlen(Partition)) + if (Size <= sizeof(Path) + 18 + sizeof(Device) + sizeof(Partition)) { return FALSE; } @@ -165,7 +165,7 @@ DiskGetBootPath(char *BootPath, unsigned Size) { /* This is a CD-ROM drive */ - if (Size <= sizeof(Path) + 7 + strlen(Device)) + if (Size <= sizeof(Path) + 7 + sizeof(Device)) { return FALSE; } From a322341b4cc17175ffb922f26ae8226a777a197e Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 13:25:28 +0000 Subject: [PATCH 238/419] [ACCESS] Don't leak memory CID #716335 svn path=/trunk/; revision=62653 --- reactos/dll/cpl/access/access.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/dll/cpl/access/access.c b/reactos/dll/cpl/access/access.c index 403f79f7dc2..efd61954df6 100644 --- a/reactos/dll/cpl/access/access.c +++ b/reactos/dll/cpl/access/access.c @@ -184,7 +184,10 @@ SystemApplet(VOID) return 0; if (!ReadSettings(pGlobalData)) + { + HeapFree(GetProcessHeap(), 0, pGlobalData); return 0; + } ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); From abab3274cd36469f669264e1764c4a79a7788ed5 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 13:38:06 +0000 Subject: [PATCH 239/419] [DESK] Fix leaks CID #716336 CID #716337 svn path=/trunk/; revision=62654 --- reactos/dll/cpl/desk/background.c | 2 +- reactos/dll/cpl/desk/screensaver.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/reactos/dll/cpl/desk/background.c b/reactos/dll/cpl/desk/background.c index 76773fe8a42..e0b62963b42 100644 --- a/reactos/dll/cpl/desk/background.c +++ b/reactos/dll/cpl/desk/background.c @@ -288,7 +288,7 @@ AddListViewItems(HWND hwndDlg, PDATA pData) } if(!FindNextFile(hFind, &fd)) - hFind = INVALID_HANDLE_VALUE; + break; } token = _tcstok(NULL, separators); diff --git a/reactos/dll/cpl/desk/screensaver.c b/reactos/dll/cpl/desk/screensaver.c index 7eb59818bd0..02958c14b6e 100644 --- a/reactos/dll/cpl/desk/screensaver.c +++ b/reactos/dll/cpl/desk/screensaver.c @@ -65,7 +65,10 @@ GetCurrentScreenSaverValue(LPTSTR lpValue) (LPBYTE)lpBuf, &BufSize); if (Ret != ERROR_SUCCESS) + { + HeapFree(GetProcessHeap(), 0, lpBuf); lpBuf = NULL; + } } } From 360df6d05d01f21b32251272deb705698c8f1052 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 13:42:27 +0000 Subject: [PATCH 240/419] [INPUT] Fix buffer overrun CID #716118 svn path=/trunk/; revision=62655 --- reactos/dll/cpl/input/add.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/cpl/input/add.c b/reactos/dll/cpl/input/add.c index e7e357a7880..690525f8bed 100644 --- a/reactos/dll/cpl/input/add.c +++ b/reactos/dll/cpl/input/add.c @@ -221,7 +221,7 @@ LanguagesEnumProc(LPTSTR lpLanguage) Lcid = _tcstoul(lpLanguage, NULL, 16); - GetLocaleInfo(Lcid, LOCALE_SLANGUAGE, Lang, sizeof(Lang)); + GetLocaleInfo(Lcid, LOCALE_SLANGUAGE, Lang, sizeof(Lang) / sizeof(Lang[0])); Index = (INT)SendMessage(hLangList, CB_ADDSTRING, 0, (LPARAM)Lang); From cfbaed3a3399e7b4f4ea70769d462d54683bb538 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 13:50:53 +0000 Subject: [PATCH 241/419] [SYSDM] Fix memory leaks CID #716341 CID #716342 svn path=/trunk/; revision=62656 --- reactos/dll/cpl/sysdm/environment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/dll/cpl/sysdm/environment.c b/reactos/dll/cpl/sysdm/environment.c index ba59a1c948e..02e34760020 100644 --- a/reactos/dll/cpl/sysdm/environment.c +++ b/reactos/dll/cpl/sysdm/environment.c @@ -199,7 +199,7 @@ GetEnvironmentVariables(HWND hwndListView, lpData = GlobalAlloc(GPTR, (dwMaxValueDataLength + 1) * sizeof(TCHAR)); if (lpData == NULL) { - GlobalFree(lpData); + GlobalFree(lpName); RegCloseKey(hKey); return; } @@ -227,6 +227,7 @@ GetEnvironmentVariables(HWND hwndListView, (LPBYTE)lpData, &dwDataLength)) { + GlobalFree(lpExpandData); GlobalFree(lpName); GlobalFree(lpData); RegCloseKey(hKey); From c7548b6c43a711cc7d11417e795bec0716e88631 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 14:24:00 +0000 Subject: [PATCH 242/419] [KERNEL32] - Fix buffer overrun - Fix incorrect return check CID #514675 CID #716130 CID #731615 svn path=/trunk/; revision=62657 --- reactos/dll/win32/kernel32/client/compname.c | 8 +++++--- reactos/dll/win32/kernel32/client/file/copy.c | 2 +- reactos/dll/win32/kernel32/client/vdm.c | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/compname.c b/reactos/dll/win32/kernel32/client/compname.c index 8b5784f7b69..aadd7455a7b 100644 --- a/reactos/dll/win32/kernel32/client/compname.c +++ b/reactos/dll/win32/kernel32/client/compname.c @@ -301,10 +301,12 @@ WINAPI GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize) { BOOL ret; + ret = GetComputerNameExA(ComputerNameNetBIOS, lpBuffer, lpnSize); - if(!ret && GetLastError() == ERROR_MORE_DATA) - SetLastError(ERROR_BUFFER_OVERFLOW); - return ret; + if (!ret && GetLastError() == ERROR_MORE_DATA) + SetLastError(ERROR_BUFFER_OVERFLOW); + + return ret; } diff --git a/reactos/dll/win32/kernel32/client/file/copy.c b/reactos/dll/win32/kernel32/client/file/copy.c index a5f3d30ee36..9601e108267 100644 --- a/reactos/dll/win32/kernel32/client/file/copy.c +++ b/reactos/dll/win32/kernel32/client/file/copy.c @@ -325,7 +325,7 @@ CopyFileExA(IN LPCSTR lpExistingFileName, PUNICODE_STRING lpExistingFileNameW; lpExistingFileNameW = Basep8BitStringToStaticUnicodeString(lpExistingFileName); - if (!lpExistingFileName) + if (!lpExistingFileNameW) { return FALSE; } diff --git a/reactos/dll/win32/kernel32/client/vdm.c b/reactos/dll/win32/kernel32/client/vdm.c index 81a42d37f4e..3ff2c466168 100644 --- a/reactos/dll/win32/kernel32/client/vdm.c +++ b/reactos/dll/win32/kernel32/client/vdm.c @@ -232,7 +232,7 @@ BaseGetVdmConfigInfo(IN LPCWSTR CommandLineReserved, * %s%c : Nothing if DOS VDM, -w if WoW VDM, -ws if separate WoW VDM. */ _snwprintf(CommandLine, - sizeof(CommandLine), + sizeof(CommandLine) / sizeof(CommandLine[0]), L"\"%s\\ntvdm.exe\" -i%lx %s%c", Buffer, DosSeqId, @@ -246,7 +246,7 @@ BaseGetVdmConfigInfo(IN LPCWSTR CommandLineReserved, * %s%c : Nothing if DOS VDM, -w if WoW VDM, -ws if separate WoW VDM. */ _snwprintf(CommandLine, - sizeof(CommandLine), + sizeof(CommandLine) / sizeof(CommandLine[0]), L"\"%s\\ntvdm.exe\" %s%c", Buffer, (BinaryType == BINARY_TYPE_DOS) ? L" " : L"-w", From 7c66fc782d7f4bec558cf0aad09f6ed0bbd554f8 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 15:11:09 +0000 Subject: [PATCH 243/419] [LSASRV] Fix broken if statements CID #513328 CID #1102024 svn path=/trunk/; revision=62658 --- reactos/dll/win32/lsasrv/privileges.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/lsasrv/privileges.c b/reactos/dll/win32/lsasrv/privileges.c index 19378e5e697..8fabdbf6cd8 100644 --- a/reactos/dll/win32/lsasrv/privileges.c +++ b/reactos/dll/win32/lsasrv/privileges.c @@ -101,7 +101,7 @@ LsarpLookupPrivilegeName(PLUID Value, NameBuffer->MaximumLength = NameBuffer->Length + sizeof(WCHAR); NameBuffer->Buffer = MIDL_user_allocate(NameBuffer->MaximumLength); - if (NameBuffer == NULL) + if (NameBuffer->Buffer == NULL) { MIDL_user_free(NameBuffer); return STATUS_NO_MEMORY; @@ -257,7 +257,7 @@ LsapLookupAccountRightName(ULONG RightValue, NameBuffer->MaximumLength = NameBuffer->Length + sizeof(WCHAR); NameBuffer->Buffer = MIDL_user_allocate(NameBuffer->MaximumLength); - if (NameBuffer == NULL) + if (NameBuffer->Buffer == NULL) { MIDL_user_free(NameBuffer); return STATUS_INSUFFICIENT_RESOURCES; From cf4a5c8d11862bff89b159622c808e37a1a3377b Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 15:31:06 +0000 Subject: [PATCH 244/419] [SYSSETUP] Fix buffer overrun CID #716146 svn path=/trunk/; revision=62659 --- reactos/dll/win32/syssetup/logfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/syssetup/logfile.c b/reactos/dll/win32/syssetup/logfile.c index 5a941d03865..724683f7574 100644 --- a/reactos/dll/win32/syssetup/logfile.c +++ b/reactos/dll/win32/syssetup/logfile.c @@ -45,11 +45,11 @@ InitializeSetupActionLog (BOOL bDeleteOldLogFile) { wcsncat(szFileName, L"\\", - MAX_PATH); + (sizeof(szFileName) / sizeof(szFileName[0])) - wcslen(szFileName)); } wcsncat(szFileName, L"setuplog.txt", - MAX_PATH); + (sizeof(szFileName) / sizeof(szFileName[0])) - wcslen(szFileName)); if (bDeleteOldLogFile) { From 9315f42c8f970f6e42b6821e28df4b52f8422e66 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 15:43:06 +0000 Subject: [PATCH 245/419] [CDFS] - Fix broken if statement - Remove deadcode CID #502181 CID #502438 CID #716663 svn path=/trunk/; revision=62660 --- reactos/drivers/filesystems/cdfs/dirctl.c | 2 +- reactos/drivers/filesystems/cdfs/fsctl.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/reactos/drivers/filesystems/cdfs/dirctl.c b/reactos/drivers/filesystems/cdfs/dirctl.c index 9cccc3f319b..e8568e31d23 100644 --- a/reactos/drivers/filesystems/cdfs/dirctl.c +++ b/reactos/drivers/filesystems/cdfs/dirctl.c @@ -303,7 +303,7 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt, if (FsRtlIsNameInExpression(&FileToFindUpcase, &LongName, TRUE, NULL) || FsRtlIsNameInExpression(&FileToFindUpcase, &ShortName, TRUE, NULL)) { - if (Parent && Parent->PathName) + if (Parent->PathName[0]) { len = wcslen(Parent->PathName); memcpy(Fcb->PathName, Parent->PathName, len*sizeof(WCHAR)); diff --git a/reactos/drivers/filesystems/cdfs/fsctl.c b/reactos/drivers/filesystems/cdfs/fsctl.c index 29cf1eddab3..9b658c76aaf 100644 --- a/reactos/drivers/filesystems/cdfs/fsctl.c +++ b/reactos/drivers/filesystems/cdfs/fsctl.c @@ -439,8 +439,6 @@ ByeBye: ObDereferenceObject(DeviceExt->StreamFileObject); if (Fcb) ExFreePool(Fcb); - if (Ccb) - ExFreePool(Ccb); if (NewDeviceObject) IoDeleteDevice(NewDeviceObject); } From c58c9e039ca0807550a631b37b5e111fa181d00c Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 15:49:38 +0000 Subject: [PATCH 246/419] [FASTFAT] Remove dead code CID #502185 svn path=/trunk/; revision=62661 --- reactos/drivers/filesystems/fastfat/fsctl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/reactos/drivers/filesystems/fastfat/fsctl.c b/reactos/drivers/filesystems/fastfat/fsctl.c index 35e67d3893b..e196282d2a6 100644 --- a/reactos/drivers/filesystems/fastfat/fsctl.c +++ b/reactos/drivers/filesystems/fastfat/fsctl.c @@ -617,8 +617,6 @@ ByeBye: vfatDestroyCCB(Ccb); if (DeviceObject) IoDeleteDevice(DeviceObject); - if (VolumeFcb) - vfatDestroyFCB(VolumeFcb); } return Status; From 4a7e08075138b1e9d29c5ede46bd6a9ef458028a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 6 Apr 2014 15:51:38 +0000 Subject: [PATCH 247/419] [NTDLL_APITEST]: Add braces and remove an unneeded trace. svn path=/trunk/; revision=62662 --- rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c b/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c index 7fd5adbae1e..41d08508386 100644 --- a/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c +++ b/rostests/apitests/ntdll/RtlGetFullPathName_UstrEx.c @@ -102,11 +102,13 @@ CheckBuffer( SIZE_T i; for (i = 0; i < Size; i++) + { if (Array[i] != Value) { trace("Expected %x, found %x at offset %lu\n", Value, Array[i], (ULONG)i); return FALSE; } + } return TRUE; } @@ -188,7 +190,6 @@ RunTestCases(VOID) for (i = 0; i < TestCount; i++) { - trace("i = %d\n", i); switch (TestCases[i].PrefixType) { case PrefixNone: From f7bab18907faacd2346aea34f41b327c54568959 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 16:15:06 +0000 Subject: [PATCH 248/419] [NPFS] - Also call NpQueryNameInfo() in FileAllInformation and return its status. This prevents from returning uninit status - By default, return STATUS_ILLEGAL_FUNCTION in NpImpersonate(). This prevents from returning uninit status - Fix comparison in NpQueryFsVolumeInfo() (remaining len is to be used) - Properly set the string without space. This allows setting the complete string with 18 bytes. CID #1102019 CID #1102505 CID #1102506 svn path=/trunk/; revision=62663 --- reactos/drivers/filesystems/npfs/fileinfo.c | 1 + reactos/drivers/filesystems/npfs/fsctrl.c | 15 ++++++--------- reactos/drivers/filesystems/npfs/volinfo.c | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/reactos/drivers/filesystems/npfs/fileinfo.c b/reactos/drivers/filesystems/npfs/fileinfo.c index e39feb9ef5f..d6f2a103082 100644 --- a/reactos/drivers/filesystems/npfs/fileinfo.c +++ b/reactos/drivers/filesystems/npfs/fileinfo.c @@ -440,6 +440,7 @@ NpCommonQueryInformation(IN PDEVICE_OBJECT DeviceObject, NpQueryInternalInfo(Ccb, &AllInfo->InternalInformation, &Length); NpQueryEaInfo(Ccb, &AllInfo->EaInformation, &Length); NpQueryPositionInfo(Ccb, &AllInfo->PositionInformation, &Length, NamedPipeEnd); + Status = NpQueryNameInfo(Ccb, &AllInfo->NameInformation, &Length); Length += 96; break; diff --git a/reactos/drivers/filesystems/npfs/fsctrl.c b/reactos/drivers/filesystems/npfs/fsctrl.c index dc3526d35ea..74826f828d7 100644 --- a/reactos/drivers/filesystems/npfs/fsctrl.c +++ b/reactos/drivers/filesystems/npfs/fsctrl.c @@ -241,16 +241,13 @@ NpImpersonate(IN PDEVICE_OBJECT DeviceObject, IoStack = IoGetCurrentIrpStackLocation(Irp); NodeTypeCode = NpDecodeFileObject(IoStack->FileObject, NULL, &Ccb, &NamedPipeEnd); - if (NodeTypeCode == NPFS_NTC_CCB) + if (NodeTypeCode == NPFS_NTC_CCB && NamedPipeEnd == FILE_PIPE_SERVER_END) { - if (NamedPipeEnd == FILE_PIPE_SERVER_END) - { - Status = NpImpersonateClientContext(Ccb); - } - else - { - Status = STATUS_ILLEGAL_FUNCTION; - } + Status = NpImpersonateClientContext(Ccb); + } + else + { + Status = STATUS_ILLEGAL_FUNCTION; } return Status; diff --git a/reactos/drivers/filesystems/npfs/volinfo.c b/reactos/drivers/filesystems/npfs/volinfo.c index 54c9240e51c..a8449ef9a84 100644 --- a/reactos/drivers/filesystems/npfs/volinfo.c +++ b/reactos/drivers/filesystems/npfs/volinfo.c @@ -35,7 +35,7 @@ NpQueryFsVolumeInfo(IN PVOID Buffer, NameLength = 18; InfoBuffer->VolumeLabelLength = 18; - if (NameLength < 18) + if (*Length < 18) { NameLength = (USHORT)*Length; Status = STATUS_BUFFER_OVERFLOW; @@ -45,7 +45,7 @@ NpQueryFsVolumeInfo(IN PVOID Buffer, Status = STATUS_SUCCESS; } - RtlCopyMemory(InfoBuffer->VolumeLabel, L"Named Pipe", NameLength); + RtlCopyMemory(InfoBuffer->VolumeLabel, L"NamedPipe", NameLength); *Length -= NameLength; TRACE("Leaving, Status = %lx\n", Status); From 369fcf0bf3831c8b9d0f3e4228df223286137383 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 16:30:29 +0000 Subject: [PATCH 249/419] [MOUNTMGR] - Fix broken logic in OnlineMountedVolumes() - Add missing return in MountMgrNotifyNameChange() CID #515247 CID #716002 svn path=/trunk/; revision=62664 --- reactos/drivers/filters/mountmgr/database.c | 11 ++++++----- reactos/drivers/filters/mountmgr/notify.c | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/reactos/drivers/filters/mountmgr/database.c b/reactos/drivers/filters/mountmgr/database.c index f6a730c4965..77b9e214623 100644 --- a/reactos/drivers/filters/mountmgr/database.c +++ b/reactos/drivers/filters/mountmgr/database.c @@ -746,10 +746,11 @@ OnlineMountedVolumes(IN PDEVICE_EXTENSION DeviceExtension, return; } + RestartScan = TRUE; + /* Query mount points */ while (TRUE) { - RestartScan = TRUE; SymbolicName.Length = 0; SymbolicName.MaximumLength = sizeof(SymbolicNameBuffer); SymbolicName.Buffer = SymbolicNameBuffer; @@ -771,8 +772,7 @@ OnlineMountedVolumes(IN PDEVICE_EXTENSION DeviceExtension, if (ReparsePointInformation.FileReference == SavedReparsePointInformation.FileReference && ReparsePointInformation.Tag == SavedReparsePointInformation.Tag) { - ZwClose(Handle); - return; + break; } } else @@ -782,8 +782,7 @@ OnlineMountedVolumes(IN PDEVICE_EXTENSION DeviceExtension, if (!NT_SUCCESS(Status) || ReparsePointInformation.Tag != IO_REPARSE_TAG_MOUNT_POINT) { - ZwClose(Handle); - return; + break; } /* Get the volume name associated to the mount point */ @@ -813,6 +812,8 @@ OnlineMountedVolumes(IN PDEVICE_EXTENSION DeviceExtension, PostOnlineNotification(DeviceExtension, &VolumeDeviceInformation->SymbolicName); } } + + ZwClose(Handle); } /* diff --git a/reactos/drivers/filters/mountmgr/notify.c b/reactos/drivers/filters/mountmgr/notify.c index 60f9f78e4c3..de1e573b868 100644 --- a/reactos/drivers/filters/mountmgr/notify.c +++ b/reactos/drivers/filters/mountmgr/notify.c @@ -414,6 +414,7 @@ MountMgrNotifyNameChange(IN PDEVICE_EXTENSION DeviceExtension, { ObDereferenceObject(DeviceObject); ObDereferenceObject(FileObject); + return; } Stack = IoGetNextIrpStackLocation(Irp); From aaba242bd591061886578f4196d81cabf3a488ea Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Sun, 6 Apr 2014 16:45:21 +0000 Subject: [PATCH 250/419] [MAIN] - fix a copypasta - fix a possible buffer overrun (x5) - fix a negative array index access svn path=/trunk/; revision=62665 --- reactos/dll/cpl/main/mouse.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/reactos/dll/cpl/main/mouse.c b/reactos/dll/cpl/main/mouse.c index 282ff5a67ee..a8a97f52850 100644 --- a/reactos/dll/cpl/main/mouse.c +++ b/reactos/dll/cpl/main/mouse.c @@ -499,7 +499,7 @@ EnumerateCursorSchemes(HWND hwndDlg) /* Remove quotation marks */ if (szTempData[0] == _T('"')) { - lpStart = szValueData + 1; + lpStart = szTempData + 1; szTempData[_tcslen(szTempData) - 1] = 0; } else @@ -1022,9 +1022,9 @@ LoadNewCursorScheme(HWND hwndDlg) static VOID LoadInitialCursorScheme(HWND hwndDlg) { - TCHAR szSchemeName[256]; - TCHAR szSystemScheme[256]; - TCHAR szCursorPath[256]; + TCHAR szSchemeName[MAX_PATH]; + TCHAR szSystemScheme[MAX_PATH]; + TCHAR szCursorPath[MAX_PATH]; HKEY hCursorKey; LONG lError; DWORD dwDataSize; @@ -1057,7 +1057,7 @@ LoadInitialCursorScheme(HWND hwndDlg) if (dwSchemeSource != 0) { - dwDataSize = 256 * sizeof(TCHAR); + dwDataSize = MAX_PATH * sizeof(TCHAR); lError = RegQueryValueEx(hCursorKey, NULL, NULL, @@ -1101,8 +1101,8 @@ LoadInitialCursorScheme(HWND hwndDlg) else if (dwSchemeSource == 2) { LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH); - _tcscat(szSchemeName, _T(" ")); - _tcscat(szSchemeName, szSystemScheme); + _tcsncat(szSchemeName, _T(" "), MAX_PATH - _tcslen(szSchemeName)); + _tcsncat(szSchemeName, szSystemScheme, MAX_PATH - _tcslen(szSchemeName)); } /* Search and select the curent scheme name from the scheme list */ @@ -1276,6 +1276,10 @@ PointerProc(IN HWND hwndDlg, { case LBN_SELCHANGE: nSel = SendMessage((HWND)lParam, LB_GETCURSEL, 0, 0); + + if(nSel == LB_ERR) + break; + SendDlgItemMessage(hwndDlg, IDC_IMAGE_CURRENT_CURSOR, STM_SETIMAGE, IMAGE_CURSOR, (LPARAM)g_CursorData[nSel].hCursor); EnableWindow(GetDlgItem(hwndDlg,IDC_BUTTON_USE_DEFAULT_CURSOR), From 3cf4d36849590891fa60e36bec2666572952b1fa Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 16:55:53 +0000 Subject: [PATCH 251/419] [MMEBUDDY] Prevent double close of a handle CID #731736 svn path=/trunk/; revision=62666 --- reactos/lib/drivers/sound/mmebuddy/thread.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/reactos/lib/drivers/sound/mmebuddy/thread.c b/reactos/lib/drivers/sound/mmebuddy/thread.c index 484758279c0..d835e65fccb 100644 --- a/reactos/lib/drivers/sound/mmebuddy/thread.c +++ b/reactos/lib/drivers/sound/mmebuddy/thread.c @@ -143,10 +143,6 @@ TerminateSoundThread( WaitResult = WaitForSingleObject(Thread->Handle, INFINITE); SND_ASSERT( WaitResult == WAIT_OBJECT_0 ); - /* Close the thread and invalidate the handle */ - CloseHandle(Thread->Handle); /* Is this needed? */ - Thread->Handle = INVALID_HANDLE_VALUE; - return MMSYSERR_NOERROR; } From 0bd2bad093d15bfce705f07962812c7dbe5fbec3 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Sun, 6 Apr 2014 17:09:47 +0000 Subject: [PATCH 252/419] [MAIN] - fix a memory leak CID #716340 - initialize the new cursor scheme name so it doesn't show garbage in the save dialog The previous commit fixed: CID #716120 CID #715936 CID #515183 svn path=/trunk/; revision=62667 --- reactos/dll/cpl/main/mouse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/reactos/dll/cpl/main/mouse.c b/reactos/dll/cpl/main/mouse.c index a8a97f52850..71d11f5cdb5 100644 --- a/reactos/dll/cpl/main/mouse.c +++ b/reactos/dll/cpl/main/mouse.c @@ -718,6 +718,7 @@ SaveCursorScheme(HWND hwndDlg) if (nSel == 0) { szSchemeName[0] = 0; + szNewSchemeName[0] = 0; } else { @@ -775,6 +776,9 @@ SaveCursorScheme(HWND hwndDlg) lpSchemeData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength * sizeof(TCHAR)); + if(!lpSchemeData) + return FALSE; + for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++) { CompressPath(szTempPath, g_CursorData[i].szCursorPath); @@ -784,11 +788,15 @@ SaveCursorScheme(HWND hwndDlg) } if (RegOpenCurrentUser(KEY_READ | KEY_SET_VALUE, &hCuKey) != ERROR_SUCCESS) + { + HeapFree(GetProcessHeap(), 0, lpSchemeData); return FALSE; + } if (RegOpenKeyEx(hCuKey, _T("Control Panel\\Cursors\\Schemes"), 0, KEY_READ | KEY_SET_VALUE, &hCuCursorKey) != ERROR_SUCCESS) { RegCloseKey(hCuKey); + HeapFree(GetProcessHeap(), 0, lpSchemeData); return FALSE; } From 02d348bf34227a8c176546fd05bb9555ae04178e Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 17:18:55 +0000 Subject: [PATCH 253/419] [NTOSKRNL] Fix overflow CID #701303 svn path=/trunk/; revision=62668 --- reactos/ntoskrnl/fstub/fstubex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/fstub/fstubex.c b/reactos/ntoskrnl/fstub/fstubex.c index beb66fb254b..e864c1f09cd 100644 --- a/reactos/ntoskrnl/fstub/fstubex.c +++ b/reactos/ntoskrnl/fstub/fstubex.c @@ -2474,7 +2474,7 @@ IoWritePartitionTableEx(IN PDEVICE_OBJECT DeviceObject, NumberOfEntries = EfiHeader->NumberOfEntries; RtlCopyMemory(&DiskGuid, &EfiHeader->DiskGUID, sizeof(GUID)); /* Count number of sectors needed to store partitions */ - SectorsForPartitions = (NumberOfEntries * PARTITION_ENTRY_SIZE) / Disk->SectorSize; + SectorsForPartitions = ((ULONGLONG)NumberOfEntries * PARTITION_ENTRY_SIZE) / Disk->SectorSize; /* Set first usable LBA: Legacy MBR + GPT header + Partitions entries */ FirstUsableLBA = SectorsForPartitions + 2; /* Set last usable LBA: Last sector - GPT header - Partitions entries */ From 0888fb5cb539f00c108c500ca9b5f05524644f49 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Sun, 6 Apr 2014 17:33:12 +0000 Subject: [PATCH 254/419] [DXDIAG] - fix a buffer overrun CID #1102308 svn path=/trunk/; revision=62669 --- reactos/base/applications/dxdiag/network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/base/applications/dxdiag/network.c b/reactos/base/applications/dxdiag/network.c index 63a937681f5..772c72f2a61 100644 --- a/reactos/base/applications/dxdiag/network.c +++ b/reactos/base/applications/dxdiag/network.c @@ -282,7 +282,7 @@ EnumerateServiceProviders(HKEY hKey, HWND hDlgCtrl, DIRECTPLAY_GUID * PreDefProv { RegProviders |= (1 << ProviderIndex); szResult[0] = L'\0'; - LoadStringW(hInst, IDS_REG_SUCCESS, szResult, sizeof(szResult)); + LoadStringW(hInst, IDS_REG_SUCCESS, szResult, sizeof(szResult) / sizeof(WCHAR)); Item.iSubItem = 1; Item.iItem = ProviderIndex + ItemCount; From 0c43ce824ac3ee296c2d097c920ac8345c70d156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 6 Apr 2014 17:46:49 +0000 Subject: [PATCH 255/419] [CONSRV] - text.c: Few code formatting, and remove a warning. - guiterm.c: Implement basic word selection. svn path=/trunk/; revision=62670 --- .../winsrv/consrv/frontends/gui/guiterm.c | 37 ++++++++++++++++++- .../user/winsrv/consrv/frontends/gui/text.c | 6 +-- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c index e01dbdade3f..a9070b3c90b 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c @@ -1162,7 +1162,42 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM case WM_LBUTTONDBLCLK: { - DPRINT1("Handle left-double-click for selecting a word\n"); + PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; + + if (GetType(Buffer) == TEXTMODE_BUFFER) + { +#define IS_WHITESPACE(c) \ + ((c) == L'\0' || (c) == L' ' || (c) == L'\t' || (c) == L'\r' || (c) == L'\n') + + PTEXTMODE_SCREEN_BUFFER TextBuffer = (PTEXTMODE_SCREEN_BUFFER)Buffer; + COORD cL, cR; + PCHAR_INFO ptrL, ptrR; + + /* Starting point */ + cL = cR = PointToCoord(GuiData, lParam); + ptrL = ptrR = ConioCoordToPointer(TextBuffer, cL.X, cL.Y); + + /* Enlarge the selection by checking for whitespace */ + while ((0 < cL.X) && !IS_WHITESPACE(ptrL->Char.UnicodeChar) + && !IS_WHITESPACE((ptrL-1)->Char.UnicodeChar)) + { + --cL.X; + --ptrL; + } + while ((cR.X < TextBuffer->ScreenBufferSize.X - 1) && + !IS_WHITESPACE(ptrR->Char.UnicodeChar) && + !IS_WHITESPACE((ptrR+1)->Char.UnicodeChar)) + { + ++cR.X; + ++ptrR; + } + + Console->Selection.dwSelectionAnchor = cL; + Console->dwSelectionCursor = cR; + + GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); + } + break; } diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c index d39fe614553..24526d51c13 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c @@ -89,9 +89,9 @@ GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, for (yPos = 0; yPos < selHeight; yPos++) { - ptr = ConioCoordToPointer(Buffer, + ptr = ConioCoordToPointer(Buffer, Console->Selection.srSelection.Left, - yPos + Console->Selection.srSelection.Top); + Console->Selection.srSelection.Top + yPos); /* Copy only the characters, leave attributes alone */ for (xPos = 0; xPos < selWidth; xPos++) { @@ -139,7 +139,7 @@ GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, LPWSTR str; WCHAR CurChar = 0; - SHORT VkKey; // MAKEWORD(low = vkey_code, high = shift_state); + USHORT VkKey; // MAKEWORD(low = vkey_code, high = shift_state); INPUT_RECORD er; hData = GetClipboardData(CF_UNICODETEXT); From ebf479fc8718b87d493e17f4d3669743d8649a5a Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Sun, 6 Apr 2014 18:57:16 +0000 Subject: [PATCH 256/419] [FONTVIEW] - add czech translation - fix a leak CID #731443 svn path=/trunk/; revision=62671 --- reactos/base/applications/fontview/fontview.c | 10 ++-------- reactos/base/applications/fontview/fontview.rc | 3 +++ reactos/base/applications/fontview/lang/cs-CZ.rc | 13 +++++++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 reactos/base/applications/fontview/lang/cs-CZ.rc diff --git a/reactos/base/applications/fontview/fontview.c b/reactos/base/applications/fontview/fontview.c index fd3f844c7fa..667bdadb6e2 100644 --- a/reactos/base/applications/fontview/fontview.c +++ b/reactos/base/applications/fontview/fontview.c @@ -34,8 +34,8 @@ LPCWSTR g_fileName; static const WCHAR g_szFontViewClassName[] = L"FontViewWClass"; -/* Tye definition for the GetFontResourceInfo function */ -typedef BOOL (WINAPI *PGFRI)(LPCWSTR, DWORD *, LPVOID, DWORD); +/* GetFontResourceInfoW is undocumented */ +BOOL WINAPI GetFontResourceInfoW(LPCWSTR lpFileName, DWORD *pdwBufSize, void* lpBuffer, DWORD dwType); DWORD FormatString( @@ -97,8 +97,6 @@ WinMain (HINSTANCE hThisInstance, HWND hMainWnd; MSG msg; WNDCLASSEXW wincl; - HINSTANCE hDLL; - PGFRI GetFontResourceInfoW; LPCWSTR fileName; switch (GetUserDefaultUILanguage()) @@ -165,10 +163,6 @@ WinMain (HINSTANCE hThisInstance, return -1; } - /* Load the GetFontResourceInfo function from gdi32.dll */ - hDLL = LoadLibraryW(L"GDI32.DLL"); - GetFontResourceInfoW = (PGFRI)GetProcAddress(hDLL, "GetFontResourceInfoW"); - /* Get the font name */ dwSize = sizeof(g_ExtLogFontW.elfFullName); if (!GetFontResourceInfoW(fileName, &dwSize, g_ExtLogFontW.elfFullName, 1)) diff --git a/reactos/base/applications/fontview/fontview.rc b/reactos/base/applications/fontview/fontview.rc index 2ffdce3f8a8..622ed719199 100644 --- a/reactos/base/applications/fontview/fontview.rc +++ b/reactos/base/applications/fontview/fontview.rc @@ -24,6 +24,9 @@ END #ifdef LANGUAGE_BG_BG #include "lang/bg-BG.rc" #endif +#ifdef LANGUAGE_CS_CZ + #include "lang/cs-CZ.rc" +#endif #ifdef LANGUAGE_DE_DE #include "lang/de-DE.rc" #endif diff --git a/reactos/base/applications/fontview/lang/cs-CZ.rc b/reactos/base/applications/fontview/lang/cs-CZ.rc new file mode 100644 index 00000000000..77350196d77 --- /dev/null +++ b/reactos/base/applications/fontview/lang/cs-CZ.rc @@ -0,0 +1,13 @@ +LANGUAGE LANG_CZECH, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + IDS_INSTALL "Nainstalovat" + IDS_PRINT "Tisk" + IDS_STRING "Příliš žluťoučký kůň úpěl ďábelské ódy. 1234567890" + IDS_OPEN "Otevřít soubor písma..." + IDS_ERROR "Chyba" + IDS_ERROR_NOMEM "K dokončení operace není dostatek paměti." + IDS_ERROR_NOFONT "Soubor %1 není platným souborem písma." + IDS_ERROR_NOCLASS "Inicializace okna aplikace selhala." +END From 40b46adcc657aa2a78f4d6a66f932f6d6aa2e138 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 19:48:22 +0000 Subject: [PATCH 257/419] [ATACTL] - Fix resource leak - Fix uninit field in struct CID #716281 CID #716748 CID #716749 CID #716751 CID #716752 CID #716753 CID #731454 svn path=/trunk/; revision=62672 --- reactos/base/applications/atactl/atactl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reactos/base/applications/atactl/atactl.cpp b/reactos/base/applications/atactl/atactl.cpp index 72452d9b1ca..1a0f4689178 100644 --- a/reactos/base/applications/atactl/atactl.cpp +++ b/reactos/base/applications/atactl/atactl.cpp @@ -727,6 +727,7 @@ ata_check_unit( } */ + addr.Length = sizeof(addr); addr.PortNumber = -1; addr.PathId = inquiryData->PathId; addr.TargetId = inquiryData->TargetId; @@ -986,12 +987,14 @@ ata_adapter_info( h = ata_open_dev(dev_name); if(!h) return FALSE; + addr.Length = sizeof(addr); addr.PortNumber = bus_id; len = sizeof(ADAPTERINFO)+sizeof(CHANINFO)*AHCI_MAX_PORT; if(!g_AdapterInfo) { AdapterInfo = (PADAPTERINFO)GlobalAlloc(GMEM_FIXED, len); if(!AdapterInfo) { + ata_close_dev(h); return FALSE; } } else { @@ -1111,6 +1114,7 @@ ata_mode( h = ata_open_dev(dev_name); if(!h) return FALSE; + addr.Length = sizeof(addr); addr.PortNumber = bus_id; addr.PathId = (UCHAR)(dev_id >> 16); addr.TargetId = (UCHAR)(dev_id >> 8); @@ -1155,6 +1159,7 @@ ata_reset( h = ata_open_dev(dev_name); if(!h) return FALSE; + addr.Length = sizeof(addr); addr.PortNumber = bus_id; addr.PathId = (UCHAR)(dev_id >> 16); addr.TargetId = (UCHAR)(dev_id >> 8); @@ -1213,6 +1218,7 @@ ata_hide( h = ata_open_dev(dev_name); if(!h) return FALSE; + addr.Length = sizeof(addr); addr.PortNumber = bus_id; addr.PathId = (UCHAR)(dev_id >> 16); addr.TargetId = (UCHAR)(dev_id >> 8); @@ -1268,6 +1274,7 @@ ata_scan( if((UCHAR)(dev_id) != 0xff && (UCHAR)(dev_id >> 8) != 0xff) { + addr.Length = sizeof(addr); addr.PortNumber = bus_id; addr.PathId = (UCHAR)(dev_id >> 16); addr.TargetId = 0; From cd5a6ed95ef812e898b00e5feb0a5d0bfc8ff19d Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Sun, 6 Apr 2014 20:10:24 +0000 Subject: [PATCH 258/419] [KBSWITCH] - fix possible buffer overrun CID #716051 CID #716052 svn path=/trunk/; revision=62673 --- reactos/base/applications/kbswitch/kbswitch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/base/applications/kbswitch/kbswitch.c b/reactos/base/applications/kbswitch/kbswitch.c index 94489314079..5d0849d65e6 100644 --- a/reactos/base/applications/kbswitch/kbswitch.c +++ b/reactos/base/applications/kbswitch/kbswitch.c @@ -113,7 +113,7 @@ AddTrayIcon(HWND hwnd) tnid.uCallbackMessage = WM_NOTIFYICONMSG; tnid.hIcon = CreateTrayIcon(szLCID); - lstrcpyn(tnid.szTip, szName, sizeof(tnid.szTip)); + lstrcpyn(tnid.szTip, szName, sizeof(tnid.szTip) / sizeof(TCHAR)); Shell_NotifyIcon(NIM_ADD, &tnid); } @@ -142,7 +142,7 @@ UpdateTrayIcon(HWND hwnd, LPTSTR szLCID, LPTSTR szName) tnid.uCallbackMessage = WM_NOTIFYICONMSG; tnid.hIcon = CreateTrayIcon(szLCID); - lstrcpyn(tnid.szTip, szName, sizeof(tnid.szTip)); + lstrcpyn(tnid.szTip, szName, sizeof(tnid.szTip) / sizeof(TCHAR)); Shell_NotifyIcon(NIM_MODIFY, &tnid); } From b2ec16885cdeac20a0c4d77fa8b26df2fa304ec4 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 20:14:16 +0000 Subject: [PATCH 259/419] [CHARMAP] Fix buffer overruns. Dedicated to Thomas :-). CID #515199 CID #512920 svn path=/trunk/; revision=62674 --- reactos/base/applications/charmap/lrgcell.c | 5 +++-- reactos/base/applications/charmap/map.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/reactos/base/applications/charmap/lrgcell.c b/reactos/base/applications/charmap/lrgcell.c index b5fef4dbb11..23b253aae70 100644 --- a/reactos/base/applications/charmap/lrgcell.c +++ b/reactos/base/applications/charmap/lrgcell.c @@ -48,8 +48,9 @@ SetLrgFont(PMAP infoPtr) hdc); lf.lfCharSet = DEFAULT_CHARSET; - wcscpy(lf.lfFaceName, - lpFontName); + wcscpy_s(lf.lfFaceName, + sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]), + lpFontName); hFont = CreateFontIndirectW(&lf); diff --git a/reactos/base/applications/charmap/map.c b/reactos/base/applications/charmap/map.c index 0029656cd1f..43aefcfe783 100644 --- a/reactos/base/applications/charmap/map.c +++ b/reactos/base/applications/charmap/map.c @@ -228,8 +228,9 @@ SetFont(PMAP infoPtr, ReleaseDC(infoPtr->hMapWnd, hdc); infoPtr->CurrentFont.lfCharSet = DEFAULT_CHARSET; - wcscpy(infoPtr->CurrentFont.lfFaceName, - lpFontName); + wcscpy_s(infoPtr->CurrentFont.lfFaceName, + sizeof(infoPtr->CurrentFont.lfFaceName) / sizeof(infoPtr->CurrentFont.lfFaceName[0]), + lpFontName); infoPtr->hFont = CreateFontIndirectW(&infoPtr->CurrentFont); From dc8ea64b3ff712e5ba0faaa7f291fb2d835c258b Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 20:20:39 +0000 Subject: [PATCH 260/419] [CHARMAP] Use rather wcsncpy(). A bit less safe, but at least, data are copied till possible svn path=/trunk/; revision=62675 --- reactos/base/applications/charmap/lrgcell.c | 6 +++--- reactos/base/applications/charmap/map.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/reactos/base/applications/charmap/lrgcell.c b/reactos/base/applications/charmap/lrgcell.c index 23b253aae70..0e12b3a7f99 100644 --- a/reactos/base/applications/charmap/lrgcell.c +++ b/reactos/base/applications/charmap/lrgcell.c @@ -48,9 +48,9 @@ SetLrgFont(PMAP infoPtr) hdc); lf.lfCharSet = DEFAULT_CHARSET; - wcscpy_s(lf.lfFaceName, - sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]), - lpFontName); + wcsncpy(lf.lfFaceName, + lpFontName, + sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0])); hFont = CreateFontIndirectW(&lf); diff --git a/reactos/base/applications/charmap/map.c b/reactos/base/applications/charmap/map.c index 43aefcfe783..9c7b3ee06c7 100644 --- a/reactos/base/applications/charmap/map.c +++ b/reactos/base/applications/charmap/map.c @@ -228,9 +228,9 @@ SetFont(PMAP infoPtr, ReleaseDC(infoPtr->hMapWnd, hdc); infoPtr->CurrentFont.lfCharSet = DEFAULT_CHARSET; - wcscpy_s(infoPtr->CurrentFont.lfFaceName, - sizeof(infoPtr->CurrentFont.lfFaceName) / sizeof(infoPtr->CurrentFont.lfFaceName[0]), - lpFontName); + wcsncpy(infoPtr->CurrentFont.lfFaceName, + lpFontName, + sizeof(infoPtr->CurrentFont.lfFaceName) / sizeof(infoPtr->CurrentFont.lfFaceName[0])); infoPtr->hFont = CreateFontIndirectW(&infoPtr->CurrentFont); From 1f6df38614c09bcdaa291694cc4d63e9b225a084 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 21:02:21 +0000 Subject: [PATCH 261/419] [CDFS] - Fix CdfsWSubString() prototype - Use it in CdfsCreateFCB() for string copy CID #511047 svn path=/trunk/; revision=62676 --- reactos/drivers/filesystems/cdfs/fcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/filesystems/cdfs/fcb.c b/reactos/drivers/filesystems/cdfs/fcb.c index 61635558474..66570085db5 100644 --- a/reactos/drivers/filesystems/cdfs/fcb.c +++ b/reactos/drivers/filesystems/cdfs/fcb.c @@ -57,7 +57,7 @@ CdfsGetNextPathElement(PWCHAR FileName) static VOID -CdfsWSubString(PWCHAR pTarget, const PWCHAR pSource, size_t pLength) +CdfsWSubString(LPWSTR pTarget, LPCWSTR pSource, size_t pLength) { wcsncpy (pTarget, pSource, pLength); pTarget [pLength] = L'\0'; @@ -76,7 +76,7 @@ CdfsCreateFCB(PCWSTR FileName) if (FileName) { - wcscpy(Fcb->PathName, FileName); + CdfsWSubString(Fcb->PathName, FileName, sizeof(Fcb->PathName) / sizeof(Fcb->PathName[0]) - 1); if (wcsrchr(Fcb->PathName, '\\') != 0) { Fcb->ObjectName = wcsrchr(Fcb->PathName, '\\'); From 094caa6e2a44ffb5f995d8c7c66d3979889dfcbe Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Sun, 6 Apr 2014 21:13:18 +0000 Subject: [PATCH 262/419] [MSCONFIG] - fix possible leaks CID #716286 CID #716287 svn path=/trunk/; revision=62677 --- reactos/base/applications/msconfig/srvpage.c | 9 +++++++++ reactos/base/applications/msconfig/startuppage.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/reactos/base/applications/msconfig/srvpage.c b/reactos/base/applications/msconfig/srvpage.c index 88b1d74be2c..4cfd62e6cc9 100644 --- a/reactos/base/applications/msconfig/srvpage.c +++ b/reactos/base/applications/msconfig/srvpage.c @@ -109,17 +109,22 @@ GetServices ( void ) /* reserve memory for service info array */ pServiceStatus = HeapAlloc(GetProcessHeap(), 0, BytesNeeded); if (!pServiceStatus) + { + CloseServiceHandle(ScHandle); return; + } /* fill array with service info */ if (EnumServicesStatusEx(ScHandle, SC_ENUM_PROCESS_INFO, SERVICE_WIN32, SERVICE_STATE_ALL, (LPBYTE)pServiceStatus, BytesNeeded, &BytesNeeded, &NumServices, &ResumeHandle, 0) == 0) { HeapFree(GetProcessHeap(), 0, pServiceStatus); + CloseServiceHandle(ScHandle); return; } } else /* exit on failure */ { + CloseServiceHandle(ScHandle); return; } } @@ -127,7 +132,11 @@ GetServices ( void ) if (NumServices) { if (!pServiceStatus) + { + CloseServiceHandle(ScHandle); return; + } + for (Index = 0; Index < NumServices; Index++) { memset(&item, 0, sizeof(LV_ITEM)); diff --git a/reactos/base/applications/msconfig/startuppage.c b/reactos/base/applications/msconfig/startuppage.c index e14cb9da870..4d65a0fb12e 100644 --- a/reactos/base/applications/msconfig/startuppage.c +++ b/reactos/base/applications/msconfig/startuppage.c @@ -137,7 +137,7 @@ GetDisabledAutostartEntriesFromRegistry (TCHAR * szBasePath) HeapFree(GetProcessHeap(), 0, Data); } } - RegCloseKey(hKey); + RegCloseKey(hKey); } } @@ -199,8 +199,8 @@ GetAutostartEntriesFromRegistry ( HKEY hRootKey, TCHAR* KeyName ) item.pszText = Path; item.iSubItem = 2; SendMessage(hStartupListCtrl, LVM_SETITEMTEXT, item.iItem, (LPARAM) &item); - HeapFree(GetProcessHeap(), 0, Data); } + HeapFree(GetProcessHeap(), 0, Data); } } RegCloseKey(hKey); From 7fa40b22e6a96d26c26a5ba6c7a87f97ee98da70 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 6 Apr 2014 21:35:21 +0000 Subject: [PATCH 263/419] [FTFD] Fix memory leak CID #1102396 svn path=/trunk/; revision=62678 --- reactos/win32ss/drivers/font/ftfd/font.c | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/win32ss/drivers/font/ftfd/font.c b/reactos/win32ss/drivers/font/ftfd/font.c index 36d49bd1c93..fa69a7087ad 100644 --- a/reactos/win32ss/drivers/font/ftfd/font.c +++ b/reactos/win32ss/drivers/font/ftfd/font.c @@ -420,6 +420,7 @@ FtfdQueryFontTree( if (!pGlyphSet) { DbgPrint("EngAllocMem() failed.\n"); + EngFreeMem(pcp); return NULL; } From 3f110fd47ba5e6b05b999314d9ba78c86f239030 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 7 Apr 2014 02:29:03 +0000 Subject: [PATCH 264/419] - Fix win tests. WIP see r62613. svn path=/trunk/; revision=62679 --- reactos/win32ss/user/ntuser/window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index 7cf2f36f93a..102b4962aee 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -1760,7 +1760,8 @@ PWND FASTCALL IntCreateWindow(CREATESTRUCTW* Cs, if (!(Cs->dwExStyle & WS_EX_LAYOUTRTL)) { // Need both here for wine win.c test_CreateWindow. - if (Cs->hwndParent && ParentWindow) + //if (Cs->hwndParent && ParentWindow) + if (ParentWindow) // It breaks more tests..... WIP. { if ( (Cs->style & (WS_CHILD|WS_POPUP)) == WS_CHILD && ParentWindow->ExStyle & WS_EX_LAYOUTRTL && From c2276e1b0c9029d89e2c7e525655933c931873b5 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Mon, 7 Apr 2014 22:02:26 +0000 Subject: [PATCH 265/419] [SHUTDOWN] - fix a typo in the czech translation [CONSOLE] - fix a buffer overrun CID #1102302 - update and fix the czech translation [MAIN] - fix the fix by taking the null terminator into account svn path=/trunk/; revision=62682 --- reactos/base/applications/shutdown/lang/cs-CZ.rc | 2 +- reactos/dll/cpl/console/console.c | 6 +++--- reactos/dll/cpl/console/lang/cs-CZ.rc | 14 +++++++------- reactos/dll/cpl/main/mouse.c | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/reactos/base/applications/shutdown/lang/cs-CZ.rc b/reactos/base/applications/shutdown/lang/cs-CZ.rc index 4ceeb099741..cb02b2c96c0 100644 --- a/reactos/base/applications/shutdown/lang/cs-CZ.rc +++ b/reactos/base/applications/shutdown/lang/cs-CZ.rc @@ -8,7 +8,7 @@ LANGUAGE LANG_CZECH, SUBLANG_DEFAULT /* Dialog */ IDD_GUI DIALOGEX 0, 0, 240, 255 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Vzrálené vypnutí" +CAPTION "Vzdálené vypnutí" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&OK", IDC_OK, 125, 232, 50, 14 diff --git a/reactos/dll/cpl/console/console.c b/reactos/dll/cpl/console/console.c index 5c674f6640e..02cf7bfa7d9 100644 --- a/reactos/dll/cpl/console/console.c +++ b/reactos/dll/cpl/console/console.c @@ -327,9 +327,9 @@ InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam) if (pConInfo->ci.ConsoleTitle[0] != L'\0') { - wcsncpy(szTitle, L"\"", sizeof(szTitle) / sizeof(szTitle[0])); - wcsncat(szTitle, pConInfo->ci.ConsoleTitle, sizeof(szTitle) / sizeof(szTitle[0])); - wcsncat(szTitle, L"\"", sizeof(szTitle) / sizeof(szTitle[0])); + wcsncpy(szTitle, L"\"", MAX_PATH); + wcsncat(szTitle, pConInfo->ci.ConsoleTitle, MAX_PATH - wcslen(szTitle)); + wcsncat(szTitle, L"\"", MAX_PATH - wcslen(szTitle)); } else { diff --git a/reactos/dll/cpl/console/lang/cs-CZ.rc b/reactos/dll/cpl/console/lang/cs-CZ.rc index a0e9d137034..dd06891e245 100644 --- a/reactos/dll/cpl/console/lang/cs-CZ.rc +++ b/reactos/dll/cpl/console/lang/cs-CZ.rc @@ -1,4 +1,4 @@ -/* +/* * FILE: dll/cpl/console/lang/cs-CZ.rc * TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com) * UPDATED: 2011-03-31 @@ -19,11 +19,11 @@ BEGIN CONTROL "&Okno", IDC_RADIO_DISPLAY_WINDOW, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 142, 20, 70, 10 CONTROL "&Celá obrazovka", IDC_RADIO_DISPLAY_FULL, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 142, 40, 70, 10 GROUPBOX "Historie příkazů", -1, 7, 85, 120, 77, WS_CHILD | WS_VISIBLE | WS_GROUP - LTEXT "Velikost v&yrovnávací paměti:", -1, 14, 101, 70, 12 + LTEXT "&Velikost paměti:", -1, 14, 101, 70, 12 EDITTEXT IDC_EDIT_BUFFER_SIZE, 90, 97, 30, 15, ES_RIGHT | ES_NUMBER | WS_GROUP CONTROL "", IDC_UPDOWN_BUFFER_SIZE, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_GROUP, 119, 97, 12, 15 - LTEXT "&Počet vyrovnávacích pamětí:", -1, 14, 124, 70, 12 + LTEXT "&Počet pamětí:", -1, 14, 124, 70, 12 EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | ES_NUMBER | WS_GROUP CONTROL "", IDC_UPDOWN_NUM_BUFFER, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_GROUP, 119, 120, 12, 15 @@ -60,7 +60,7 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Náhled okna:", -1, 8, 6, 95, 10 CONTROL "", IDC_STATIC_LAYOUT_WINDOW_PREVIEW, "Static", SS_SUNKEN | SS_OWNERDRAW, 8, 16, 115, 70 - GROUPBOX "Velikost bufferu zobrazení", -1, 130, 12, 115, 50 + GROUPBOX "Velikost paměti zobrazení", -1, 130, 12, 115, 50 LTEXT "&Šířka:", -1, 140, 28, 40, 10 LTEXT "&Výška:", -1, 140, 46, 39, 10 EDITTEXT IDC_EDIT_SCREEN_BUFFER_WIDTH, 203, 25, 35, 14, ES_RIGHT | ES_NUMBER | WS_GROUP @@ -103,7 +103,7 @@ BEGIN WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 48, 112, 10 CONTROL "Pozadí vý&běru", IDC_RADIO_POPUP_BACKGROUND, "Button", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 10, 67, 112, 10 - GROUPBOX "Selected Color Components", -1, 129, 7, 118, 73 + GROUPBOX "Zvolené barevné složky", -1, 129, 7, 118, 73 LTEXT "Če&rvená:", -1, 140, 25, 48, 10 EDITTEXT IDC_EDIT_COLOR_RED, 210, 22, 30, 14, ES_RIGHT | ES_NUMBER | WS_GROUP CONTROL "", IDC_UPDOWN_COLOR_RED, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | @@ -132,9 +132,9 @@ BEGIN CONTROL "", IDC_STATIC_COLOR14, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 199, 90, 12, 12 CONTROL "", IDC_STATIC_COLOR15, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 213, 90, 12, 12 CONTROL "", IDC_STATIC_COLOR16, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 227, 90, 12, 12 - GROUPBOX "Preview (Screen)", -1, 7, 111, 240, 40 + GROUPBOX "Náhled (obrazovka)", -1, 7, 111, 240, 40 CONTROL "", IDC_STATIC_SCREEN_COLOR, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 124, 224, 20 - GROUPBOX "Preview (Popup)", -1, 7, 162, 240, 40 + GROUPBOX "Náhled (místní nabídka)", -1, 7, 162, 240, 40 CONTROL "", IDC_STATIC_POPUP_COLOR, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 176, 224, 20 END diff --git a/reactos/dll/cpl/main/mouse.c b/reactos/dll/cpl/main/mouse.c index 71d11f5cdb5..0b8914a6a2f 100644 --- a/reactos/dll/cpl/main/mouse.c +++ b/reactos/dll/cpl/main/mouse.c @@ -1109,8 +1109,8 @@ LoadInitialCursorScheme(HWND hwndDlg) else if (dwSchemeSource == 2) { LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH); - _tcsncat(szSchemeName, _T(" "), MAX_PATH - _tcslen(szSchemeName)); - _tcsncat(szSchemeName, szSystemScheme, MAX_PATH - _tcslen(szSchemeName)); + _tcsncat(szSchemeName, _T(" "), MAX_PATH - _tcslen(szSchemeName) - 1); + _tcsncat(szSchemeName, szSystemScheme, MAX_PATH - _tcslen(szSchemeName) - 1); } /* Search and select the curent scheme name from the scheme list */ From 5cd83d03a142b1e363f7df7ae275a91a0b7189cc Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Mon, 7 Apr 2014 23:36:39 +0000 Subject: [PATCH 266/419] [DESK] - fix a bunch of buffer overruns, negative array index accesses and uninitialized variables CID #1102296 CID #501468 CID #716755 CID #716756 CID #1102323 svn path=/trunk/; revision=62684 --- reactos/dll/cpl/desk/advappdlg.c | 2 +- reactos/dll/cpl/desk/draw.c | 129 ++++++++++++++++------------- reactos/dll/cpl/desk/general.c | 2 +- reactos/dll/cpl/desk/screensaver.c | 1 - 4 files changed, 74 insertions(+), 60 deletions(-) diff --git a/reactos/dll/cpl/desk/advappdlg.c b/reactos/dll/cpl/desk/advappdlg.c index 6876acfdcd2..2efb7265586 100644 --- a/reactos/dll/cpl/desk/advappdlg.c +++ b/reactos/dll/cpl/desk/advappdlg.c @@ -275,7 +275,7 @@ SaveCurrentValues(HWND hwndDlg, GLOBALS *g) plfFont->lfHeight = -MulDiv(GetDlgItemInt(hwndDlg, IDC_ADVAPPEARANCE_FONTSIZE_E, &bTranslated, FALSE), GetDeviceCaps(hdcDlg, LOGPIXELSY), 72); plfFont->lfWeight = (SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTBOLD, BM_GETCHECK, 0, 0) == 1) ? FW_BOLD : FW_NORMAL; plfFont->lfItalic = (BYTE)SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_FONTITALIC, BM_GETCHECK, 0, 0); - GetDlgItemText(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, plfFont->lfFaceName, LF_FACESIZE * sizeof(TCHAR)); + GetDlgItemText(hwndDlg, IDC_ADVAPPEARANCE_FONT_C, plfFont->lfFaceName, LF_FACESIZE); } ReleaseDC(hwndDlg, hdcDlg); diff --git a/reactos/dll/cpl/desk/draw.c b/reactos/dll/cpl/desk/draw.c index ef70338c16f..d151f5e53b4 100644 --- a/reactos/dll/cpl/desk/draw.c +++ b/reactos/dll/cpl/desk/draw.c @@ -69,6 +69,8 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, COLOR_SCHEME *sch int LTpenplus = 0; int RTpenplus = 0; int RBpenplus = 0; + HBRUSH hbr; + /* Init some vars */ LTInnerPen = LTOuterPen = RBInnerPen = RBOuterPen = (HPEN)GetStockObject(NULL_PEN); SavePen = (HPEN)SelectObject(hdc, LTInnerPen); @@ -88,76 +90,84 @@ MyIntDrawRectEdge(HDC hdc, LPRECT rc, UINT uType, UINT uFlags, COLOR_SCHEME *sch if((uFlags & BF_TOPLEFT) == BF_TOPLEFT) LTpenplus = 1; - if(LTInnerI != -1) - LTInnerPen = GetStockObject(DC_PEN); - if(LTOuterI != -1) - LTOuterPen = GetStockObject(DC_PEN); - if(RBInnerI != -1) - RBInnerPen = GetStockObject(DC_PEN); - if(RBOuterI != -1) - RBOuterPen = GetStockObject(DC_PEN); - { - HBRUSH hbr; + if((uFlags & MY_BF_ACTIVEBORDER)) + hbr = CreateSolidBrush(scheme->crColor[COLOR_ACTIVEBORDER]); + else + hbr = CreateSolidBrush(scheme->crColor[COLOR_BTNFACE]); + + FillRect(hdc, &InnerRect, hbr); + DeleteObject(hbr); - if((uFlags & MY_BF_ACTIVEBORDER)) - hbr = CreateSolidBrush(scheme->crColor[COLOR_ACTIVEBORDER]); - else - hbr = CreateSolidBrush(scheme->crColor[COLOR_BTNFACE]); - FillRect(hdc, &InnerRect, hbr); - DeleteObject(hbr); - } MoveToEx(hdc, 0, 0, &SavePoint); /* Draw the outer edge */ - SelectObject(hdc, LTOuterPen); - SetDCPenColor(hdc, scheme->crColor[LTOuterI]); - if(uFlags & BF_TOP) + if(LTOuterI != -1) { - MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); - LineTo(hdc, InnerRect.right, InnerRect.top); + LTOuterPen = GetStockObject(DC_PEN); + SelectObject(hdc, LTOuterPen); + SetDCPenColor(hdc, scheme->crColor[LTOuterI]); + if(uFlags & BF_TOP) + { + MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); + LineTo(hdc, InnerRect.right, InnerRect.top); + } + if(uFlags & BF_LEFT) + { + MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); + LineTo(hdc, InnerRect.left, InnerRect.bottom); + } } - if(uFlags & BF_LEFT) + + if(RBOuterI != -1) { - MoveToEx(hdc, InnerRect.left, InnerRect.top, NULL); - LineTo(hdc, InnerRect.left, InnerRect.bottom); - } - SelectObject(hdc, RBOuterPen); - SetDCPenColor(hdc, scheme->crColor[RBOuterI]); - if(uFlags & BF_BOTTOM) - { - MoveToEx(hdc, InnerRect.left, InnerRect.bottom-1, NULL); - LineTo(hdc, InnerRect.right, InnerRect.bottom-1); - } - if(uFlags & BF_RIGHT) - { - MoveToEx(hdc, InnerRect.right-1, InnerRect.top, NULL); - LineTo(hdc, InnerRect.right-1, InnerRect.bottom); + RBOuterPen = GetStockObject(DC_PEN); + SelectObject(hdc, RBOuterPen); + SetDCPenColor(hdc, scheme->crColor[RBOuterI]); + if(uFlags & BF_BOTTOM) + { + MoveToEx(hdc, InnerRect.left, InnerRect.bottom-1, NULL); + LineTo(hdc, InnerRect.right, InnerRect.bottom-1); + } + if(uFlags & BF_RIGHT) + { + MoveToEx(hdc, InnerRect.right-1, InnerRect.top, NULL); + LineTo(hdc, InnerRect.right-1, InnerRect.bottom); + } } /* Draw the inner edge */ - SelectObject(hdc, LTInnerPen); - SetDCPenColor(hdc, scheme->crColor[LTInnerI]); - if(uFlags & BF_TOP) + if(LTInnerI != -1) { - MoveToEx(hdc, InnerRect.left+LTpenplus, InnerRect.top+1, NULL); - LineTo(hdc, InnerRect.right-RTpenplus, InnerRect.top+1); + LTInnerPen = GetStockObject(DC_PEN); + SelectObject(hdc, LTInnerPen); + SetDCPenColor(hdc, scheme->crColor[LTInnerI]); + if(uFlags & BF_TOP) + { + MoveToEx(hdc, InnerRect.left+LTpenplus, InnerRect.top+1, NULL); + LineTo(hdc, InnerRect.right-RTpenplus, InnerRect.top+1); + } + if(uFlags & BF_LEFT) + { + MoveToEx(hdc, InnerRect.left+1, InnerRect.top+LTpenplus, NULL); + LineTo(hdc, InnerRect.left+1, InnerRect.bottom-LBpenplus); + } } - if(uFlags & BF_LEFT) + + if(RBInnerI != -1) { - MoveToEx(hdc, InnerRect.left+1, InnerRect.top+LTpenplus, NULL); - LineTo(hdc, InnerRect.left+1, InnerRect.bottom-LBpenplus); - } - SelectObject(hdc, RBInnerPen); - SetDCPenColor(hdc, scheme->crColor[RBInnerI]); - if(uFlags & BF_BOTTOM) - { - MoveToEx(hdc, InnerRect.left+LBpenplus, InnerRect.bottom-2, NULL); - LineTo(hdc, InnerRect.right-RBpenplus, InnerRect.bottom-2); - } - if(uFlags & BF_RIGHT) - { - MoveToEx(hdc, InnerRect.right-2, InnerRect.top+RTpenplus, NULL); - LineTo(hdc, InnerRect.right-2, InnerRect.bottom-RBpenplus); + RBInnerPen = GetStockObject(DC_PEN); + SelectObject(hdc, RBInnerPen); + SetDCPenColor(hdc, scheme->crColor[RBInnerI]); + if(uFlags & BF_BOTTOM) + { + MoveToEx(hdc, InnerRect.left+LBpenplus, InnerRect.bottom-2, NULL); + LineTo(hdc, InnerRect.right-RBpenplus, InnerRect.bottom-2); + } + if(uFlags & BF_RIGHT) + { + MoveToEx(hdc, InnerRect.right-2, InnerRect.top+RTpenplus, NULL); + LineTo(hdc, InnerRect.right-2, InnerRect.bottom-RBpenplus); + } } if (uFlags & BF_ADJUST) @@ -245,6 +255,8 @@ MyDrawFrameCaption(HDC dc, LPRECT r, UINT uFlags, COLOR_SCHEME *scheme) case DFCS_CAPTIONRESTORE: Symbol = '2'; break; + default: + return FALSE; } MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, BF_RECT | BF_MIDDLE | BF_SOFT, scheme); ZeroMemory(&lf, sizeof(LOGFONT)); @@ -313,6 +325,9 @@ MyDrawFrameScroll(HDC dc, LPRECT r, UINT uFlags, COLOR_SCHEME *scheme) case DFCS_SCROLLRIGHT: Symbol = '4'; break; + + default: + return FALSE; } MyIntDrawRectEdge(dc, r, (uFlags & DFCS_PUSHED) ? EDGE_SUNKEN : EDGE_RAISED, (uFlags&DFCS_FLAT) | BF_MIDDLE | BF_RECT, scheme); ZeroMemory(&lf, sizeof(LOGFONT)); diff --git a/reactos/dll/cpl/desk/general.c b/reactos/dll/cpl/desk/general.c index 8340c47a18a..4bd48e2439a 100644 --- a/reactos/dll/cpl/desk/general.c +++ b/reactos/dll/cpl/desk/general.c @@ -33,7 +33,7 @@ InitFontSizeList(HWND hWnd) TCHAR Buffer[LINE_LEN]; TCHAR Desc[LINE_LEN]; - if (SetupGetStringField(&Context, 0, Buffer, sizeof(Buffer), NULL) && + if (SetupGetStringField(&Context, 0, Buffer, sizeof(Buffer) / sizeof(TCHAR), NULL) && SetupGetIntField(&Context, 1, &ci)) { _stprintf(Desc, _T("%s (%d DPI)"), Buffer, ci); diff --git a/reactos/dll/cpl/desk/screensaver.c b/reactos/dll/cpl/desk/screensaver.c index 02958c14b6e..ce089bb5141 100644 --- a/reactos/dll/cpl/desk/screensaver.c +++ b/reactos/dll/cpl/desk/screensaver.c @@ -340,7 +340,6 @@ SearchScreenSavers(HWND hwndScreenSavers, ScreenSaverCount = pData->ScreenSaverCount; - hr = StringCbCopy(szSearchPath, sizeof(szSearchPath), pszSearchPath); if (FAILED(hr)) return; From 7fe5a44dfaa499b18344d0867789e66f70797502 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Tue, 8 Apr 2014 00:14:44 +0000 Subject: [PATCH 267/419] [INTL] - fix a leak - fix a buffer overrun CID #503741 CID #716119 svn path=/trunk/; revision=62685 --- reactos/dll/cpl/intl/date.c | 15 ++++++++++++--- reactos/dll/cpl/intl/sort.c | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/reactos/dll/cpl/intl/date.c b/reactos/dll/cpl/intl/date.c index 4330d8af371..674f155a107 100644 --- a/reactos/dll/cpl/intl/date.c +++ b/reactos/dll/cpl/intl/date.c @@ -57,6 +57,9 @@ FindDateSep(const TCHAR *szSourceStr) pszFoundSep = (LPTSTR)malloc(MAX_SAMPLES_STR_SIZE * sizeof(TCHAR)); + if(!pszFoundSep) + return NULL; + _tcscpy(pszFoundSep,STD_DATE_SEP); while (nDateCompCount < _tcslen(szSourceStr)) @@ -121,8 +124,9 @@ SetShortDateFormat(HWND hwndDlg, LCID lcid) { TCHAR szShortDateFmt[MAX_SAMPLES_STR_SIZE]; TCHAR szShortDateSep[MAX_SAMPLES_STR_SIZE]; - TCHAR szFindedDateSep[MAX_SAMPLES_STR_SIZE]; + TCHAR szFoundDateSep[MAX_SAMPLES_STR_SIZE]; LPTSTR pszResultStr; + LPTSTR pszFoundSep; BOOL OpenApostFlg = FALSE; INT nFmtStrSize; INT nDateCompCount; @@ -166,12 +170,17 @@ SetShortDateFormat(HWND hwndDlg, LCID lcid) return FALSE; } + pszFoundSep = FindDateSep(szShortDateFmt); + /* Substring replacement of separator */ - _tcscpy(szFindedDateSep, FindDateSep(szShortDateFmt)); - pszResultStr = ReplaceSubStr(szShortDateFmt, szShortDateSep, szFindedDateSep); + _tcscpy(szFoundDateSep, pszFoundSep); + pszResultStr = ReplaceSubStr(szShortDateFmt, szShortDateSep, szFoundDateSep); _tcscpy(szShortDateFmt, pszResultStr); free(pszResultStr); + if(pszFoundSep) + free(pszFoundSep); + /* Save short date format */ SetLocaleInfo(lcid, LOCALE_SSHORTDATE, szShortDateFmt); diff --git a/reactos/dll/cpl/intl/sort.c b/reactos/dll/cpl/intl/sort.c index 52a6fad2bbb..c45ff97e287 100644 --- a/reactos/dll/cpl/intl/sort.c +++ b/reactos/dll/cpl/intl/sort.c @@ -134,7 +134,7 @@ CreateSortList(HWND hwnd, LCID lcid) /* Select current locale */ /* or should it be System and not user? */ - GetLocaleInfo(lcid, LOCALE_SSORTNAME, lang, sizeof(lang)); + GetLocaleInfo(lcid, LOCALE_SSORTNAME, lang, sizeof(lang)/sizeof(TCHAR)); SendMessage(hwnd, CB_SELECTSTRING, From 2e786d24d0dcfa0bab8456163da17a5a45ff29dd Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Tue, 8 Apr 2014 18:35:29 +0000 Subject: [PATCH 268/419] [NTDLL_APITEST] - Use guarded memory for bitmap buffers in RtlBitmap test - Add a few tests that check for buffer boundaries (which would have spotted the issue fixed in r62591) svn path=/trunk/; revision=62689 --- rostests/apitests/ntdll/RtlBitmap.c | 167 +++++++++++++++++++++++----- 1 file changed, 137 insertions(+), 30 deletions(-) diff --git a/rostests/apitests/ntdll/RtlBitmap.c b/rostests/apitests/ntdll/RtlBitmap.c index a3b221ecdb6..c01795db475 100644 --- a/rostests/apitests/ntdll/RtlBitmap.c +++ b/rostests/apitests/ntdll/RtlBitmap.c @@ -2,8 +2,56 @@ #include #define WIN32_NO_STATUS +#include #include +static +PVOID +AllocateGuarded( + _In_ SIZE_T SizeRequested) +{ + NTSTATUS Status; + SIZE_T Size = PAGE_ROUND_UP(SizeRequested + PAGE_SIZE); + PVOID VirtualMemory = NULL; + PCHAR StartOfBuffer; + + Status = NtAllocateVirtualMemory(NtCurrentProcess(), &VirtualMemory, 0, &Size, MEM_RESERVE, PAGE_NOACCESS); + + if (!NT_SUCCESS(Status)) + return NULL; + + Size -= PAGE_SIZE; + if (Size) + { + Status = NtAllocateVirtualMemory(NtCurrentProcess(), &VirtualMemory, 0, &Size, MEM_COMMIT, PAGE_READWRITE); + if (!NT_SUCCESS(Status)) + { + Size = 0; + Status = NtFreeVirtualMemory(NtCurrentProcess(), &VirtualMemory, &Size, MEM_RELEASE); + ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status); + return NULL; + } + } + + StartOfBuffer = VirtualMemory; + StartOfBuffer += Size - SizeRequested; + + return StartOfBuffer; +} + +static +VOID +FreeGuarded( + _In_ PVOID Pointer) +{ + NTSTATUS Status; + PVOID VirtualMemory = (PVOID)PAGE_ROUND_DOWN((SIZE_T)Pointer); + SIZE_T Size = 0; + + Status = NtFreeVirtualMemory(NtCurrentProcess(), &VirtualMemory, &Size, MEM_RELEASE); + ok(Status == STATUS_SUCCESS, "Status = %lx\n", Status); +} + void Test_RtlFindMostSignificantBit(void) { @@ -65,130 +113,155 @@ void Test_RtlClearAllBits(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + ULONG BufferSize = 2 * sizeof(*Buffer); + Buffer = AllocateGuarded(BufferSize); RtlInitializeBitMap(&BitMapHeader, Buffer, 19); - memset(Buffer, 0xcc, sizeof(Buffer)); + memset(Buffer, 0xcc, BufferSize); RtlClearAllBits(&BitMapHeader); ok_hex(Buffer[0], 0x00000000); ok_hex(Buffer[1], 0xcccccccc); RtlInitializeBitMap(&BitMapHeader, Buffer, 0); - memset(Buffer, 0xcc, sizeof(Buffer)); + memset(Buffer, 0xcc, BufferSize); RtlClearAllBits(&BitMapHeader); ok_hex(Buffer[0], 0xcccccccc); ok_hex(Buffer[1], 0xcccccccc); + + RtlInitializeBitMap(&BitMapHeader, Buffer, 64); + memset(Buffer, 0xcc, BufferSize); + RtlClearAllBits(&BitMapHeader); + ok_hex(Buffer[0], 0x00000000); + ok_hex(Buffer[1], 0x00000000); + FreeGuarded(Buffer); } void Test_RtlSetAllBits(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + ULONG BufferSize = 2 * sizeof(*Buffer); + Buffer = AllocateGuarded(BufferSize); RtlInitializeBitMap(&BitMapHeader, Buffer, 19); - memset(Buffer, 0xcc, sizeof(Buffer)); + memset(Buffer, 0xcc, BufferSize); RtlSetAllBits(&BitMapHeader); ok_hex(Buffer[0], 0xffffffff); ok_hex(Buffer[1], 0xcccccccc); RtlInitializeBitMap(&BitMapHeader, Buffer, 0); - memset(Buffer, 0xcc, sizeof(Buffer)); + memset(Buffer, 0xcc, BufferSize); RtlSetAllBits(&BitMapHeader); ok_hex(Buffer[0], 0xcccccccc); ok_hex(Buffer[1], 0xcccccccc); + + RtlInitializeBitMap(&BitMapHeader, Buffer, 64); + memset(Buffer, 0xcc, BufferSize); + RtlSetAllBits(&BitMapHeader); + ok_hex(Buffer[0], 0xffffffff); + ok_hex(Buffer[1], 0xffffffff); + FreeGuarded(Buffer); } void Test_RtlClearBits(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + ULONG BufferSize = 2 * sizeof(*Buffer); + Buffer = AllocateGuarded(BufferSize); RtlInitializeBitMap(&BitMapHeader, Buffer, 19); - memset(Buffer, 0xff, sizeof(Buffer)); + memset(Buffer, 0xff, BufferSize); RtlClearBits(&BitMapHeader, 0, 0); ok_hex(Buffer[0], 0xffffffff); ok_hex(Buffer[1], 0xffffffff); - memset(Buffer, 0xff, sizeof(Buffer)); + memset(Buffer, 0xff, BufferSize); RtlClearBits(&BitMapHeader, 0, 1); ok_hex(Buffer[0], 0xfffffffe); ok_hex(Buffer[1], 0xffffffff); - memset(Buffer, 0xff, sizeof(Buffer)); + memset(Buffer, 0xff, BufferSize); RtlClearBits(&BitMapHeader, 21, 1); ok_hex(Buffer[0], 0xffdfffff); ok_hex(Buffer[1], 0xffffffff); - memset(Buffer, 0xff, sizeof(Buffer)); + memset(Buffer, 0xff, BufferSize); RtlClearBits(&BitMapHeader, 7, 9); ok_hex(Buffer[0], 0xffff007f); ok_hex(Buffer[1], 0xffffffff); - memset(Buffer, 0xff, sizeof(Buffer)); + memset(Buffer, 0xff, BufferSize); RtlClearBits(&BitMapHeader, 13, 22); ok_hex(Buffer[0], 0x00001fff); ok_hex(Buffer[1], 0xfffffff8); - memset(Buffer, 0xcc, sizeof(Buffer)); + memset(Buffer, 0xcc, BufferSize); RtlClearBits(&BitMapHeader, 3, 6); RtlClearBits(&BitMapHeader, 11, 5); RtlClearBits(&BitMapHeader, 21, 7); RtlClearBits(&BitMapHeader, 37, 4); ok_hex(Buffer[0], 0xc00c0404); ok_hex(Buffer[1], 0xcccccc0c); + FreeGuarded(Buffer); } void Test_RtlSetBits(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + ULONG BufferSize = 2 * sizeof(*Buffer); + Buffer = AllocateGuarded(BufferSize); RtlInitializeBitMap(&BitMapHeader, Buffer, 19); - memset(Buffer, 0x00, sizeof(Buffer)); + memset(Buffer, 0x00, BufferSize); RtlSetBits(&BitMapHeader, 0, 0); ok_hex(Buffer[0], 0x00000000); ok_hex(Buffer[1], 0x00000000); - memset(Buffer, 0x00, sizeof(Buffer)); + memset(Buffer, 0x00, BufferSize); RtlSetBits(&BitMapHeader, 0, 1); ok_hex(Buffer[0], 0x00000001); ok_hex(Buffer[1], 0x00000000); - memset(Buffer, 0x00, sizeof(Buffer)); + memset(Buffer, 0x00, BufferSize); RtlSetBits(&BitMapHeader, 21, 1); ok_hex(Buffer[0], 0x00200000); ok_hex(Buffer[1], 0x00000000); - memset(Buffer, 0x00, sizeof(Buffer)); + memset(Buffer, 0x00, BufferSize); RtlSetBits(&BitMapHeader, 7, 9); ok_hex(Buffer[0], 0x0000ff80); ok_hex(Buffer[1], 0x00000000); - memset(Buffer, 0x00, sizeof(Buffer)); + memset(Buffer, 0x00, BufferSize); RtlSetBits(&BitMapHeader, 13, 22); ok_hex(Buffer[0], 0xffffe000); ok_hex(Buffer[1], 0x00000007); - memset(Buffer, 0xcc, sizeof(Buffer)); + memset(Buffer, 0xcc, BufferSize); RtlSetBits(&BitMapHeader, 3, 6); RtlSetBits(&BitMapHeader, 11, 5); RtlSetBits(&BitMapHeader, 21, 7); RtlSetBits(&BitMapHeader, 37, 4); ok_hex(Buffer[0], 0xcfecfdfc); ok_hex(Buffer[1], 0xcccccdec); + FreeGuarded(Buffer); } void Test_RtlAreBitsClear(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + Buffer = AllocateGuarded(2 * sizeof(*Buffer)); RtlInitializeBitMap(&BitMapHeader, Buffer, 19); Buffer[0] = 0x00ff00ff; Buffer[1] = 0xc0cfc0cf; @@ -204,14 +277,18 @@ Test_RtlAreBitsClear(void) ok_hex(RtlAreBitsClear(&BitMapHeader, 24, 7), TRUE); ok_hex(RtlAreBitsClear(&BitMapHeader, 24, 8), FALSE); + RtlInitializeBitMap(&BitMapHeader, Buffer, 64); + ok_hex(RtlAreBitsClear(&BitMapHeader, 60, 4), FALSE); + FreeGuarded(Buffer); } void Test_RtlAreBitsSet(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + Buffer = AllocateGuarded(2 * sizeof(*Buffer)); RtlInitializeBitMap(&BitMapHeader, Buffer, 19); Buffer[0] = 0xff00ff00; Buffer[1] = 0x3F303F30; @@ -227,14 +304,18 @@ Test_RtlAreBitsSet(void) ok_hex(RtlAreBitsSet(&BitMapHeader, 24, 7), TRUE); ok_hex(RtlAreBitsSet(&BitMapHeader, 24, 8), FALSE); + RtlInitializeBitMap(&BitMapHeader, Buffer, 64); + ok_hex(RtlAreBitsSet(&BitMapHeader, 60, 4), FALSE); + FreeGuarded(Buffer); } void Test_RtlNumberOfSetBits(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + Buffer = AllocateGuarded(2 * sizeof(*Buffer)); Buffer[0] = 0xff00ff0f; Buffer[1] = 0x3F303F30; @@ -249,14 +330,19 @@ Test_RtlNumberOfSetBits(void) RtlInitializeBitMap(&BitMapHeader, Buffer, 56); ok_int(RtlNumberOfSetBits(&BitMapHeader), 30); + + RtlInitializeBitMap(&BitMapHeader, Buffer, 64); + ok_int(RtlNumberOfSetBits(&BitMapHeader), 36); + FreeGuarded(Buffer); } void Test_RtlNumberOfClearBits(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + Buffer = AllocateGuarded(2 * sizeof(*Buffer)); Buffer[0] = 0xff00fff0; Buffer[1] = 0x3F303F30; @@ -271,14 +357,19 @@ Test_RtlNumberOfClearBits(void) RtlInitializeBitMap(&BitMapHeader, Buffer, 56); ok_int(RtlNumberOfClearBits(&BitMapHeader), 26); + + RtlInitializeBitMap(&BitMapHeader, Buffer, 64); + ok_int(RtlNumberOfClearBits(&BitMapHeader), 28); + FreeGuarded(Buffer); } void Test_RtlFindClearBits(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + Buffer = AllocateGuarded(2 * sizeof(*Buffer)); Buffer[0] = 0x060F874D; Buffer[1] = 0x3F303F30; @@ -314,14 +405,20 @@ Test_RtlFindClearBits(void) ok_int(RtlFindClearBits(&BitMapHeader, 4, 32), 11); ok_int(RtlFindClearBits(&BitMapHeader, 5, 32), 20); + RtlInitializeBitMap(&BitMapHeader, Buffer, 64); + ok_int(RtlFindClearBits(&BitMapHeader, 5, 64), 20); + ok_int(RtlFindClearBits(&BitMapHeader, 9, 28), 27); + ok_int(RtlFindClearBits(&BitMapHeader, 10, 0), -1); + FreeGuarded(Buffer); } void Test_RtlFindSetBits(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + Buffer = AllocateGuarded(2 * sizeof(*Buffer)); Buffer[0] = 0xF9F078B2; Buffer[1] = 0x3F303F30; @@ -356,14 +453,20 @@ Test_RtlFindSetBits(void) ok_int(RtlFindSetBits(&BitMapHeader, 4, 32), 11); ok_int(RtlFindSetBits(&BitMapHeader, 5, 32), 20); + RtlInitializeBitMap(&BitMapHeader, Buffer, 64); + ok_int(RtlFindSetBits(&BitMapHeader, 5, 64), 20); + ok_int(RtlFindSetBits(&BitMapHeader, 6, 57), 40); + ok_int(RtlFindSetBits(&BitMapHeader, 7, 0), -1); + FreeGuarded(Buffer); } void Test_RtlFindClearBitsAndSet(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + Buffer = AllocateGuarded(2 * sizeof(*Buffer)); Buffer[0] = 0x060F874D; Buffer[1] = 0x3F303F30; @@ -401,14 +504,16 @@ Test_RtlFindClearBitsAndSet(void) ok_hex(Buffer[0], 0x6ff9f4d); ok_int(RtlFindClearBitsAndSet(&BitMapHeader, 2, 12), 13); ok_hex(Buffer[0], 0x6ffff4d); + FreeGuarded(Buffer); } void Test_RtlFindSetBitsAndClear(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; + Buffer = AllocateGuarded(2 * sizeof(*Buffer)); Buffer[0] = 0xF9F078B2; Buffer[1] = 0x3F303F30; @@ -446,16 +551,17 @@ Test_RtlFindSetBitsAndClear(void) ok_hex(Buffer[0], 0xf90060b2); ok_int(RtlFindSetBitsAndClear(&BitMapHeader, 2, 12), 13); ok_hex(Buffer[0], 0xf90000b2); - + FreeGuarded(Buffer); } void Test_RtlFindNextForwardRunClear(void) { RTL_BITMAP BitMapHeader; - ULONG Buffer[2]; + ULONG *Buffer; ULONG Index; + Buffer = AllocateGuarded(2 * sizeof(*Buffer)); Buffer[0] = 0xF9F078B2; Buffer[1] = 0x3F303F30; @@ -477,6 +583,7 @@ Test_RtlFindNextForwardRunClear(void) ok_int(Index, 17); ok_int(RtlFindNextForwardRunClear(&BitMapHeader, 39, &Index), 0); ok_int(Index, 39); + FreeGuarded(Buffer); } void From e2ce9d5f37e7370f9f04502427fda26676a7711b Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Tue, 8 Apr 2014 20:57:03 +0000 Subject: [PATCH 269/419] [NTDLL_APITEST] - Add two test cases for RtlFindClearBits/RtlFindSetBits that crash on ROS svn path=/trunk/; revision=62690 --- rostests/apitests/ntdll/RtlBitmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rostests/apitests/ntdll/RtlBitmap.c b/rostests/apitests/ntdll/RtlBitmap.c index c01795db475..70e0b7afb5c 100644 --- a/rostests/apitests/ntdll/RtlBitmap.c +++ b/rostests/apitests/ntdll/RtlBitmap.c @@ -409,6 +409,8 @@ Test_RtlFindClearBits(void) ok_int(RtlFindClearBits(&BitMapHeader, 5, 64), 20); ok_int(RtlFindClearBits(&BitMapHeader, 9, 28), 27); ok_int(RtlFindClearBits(&BitMapHeader, 10, 0), -1); + Buffer[1] = 0xFF303F30; + ok_int(RtlFindClearBits(&BitMapHeader, 1, 56), 1); FreeGuarded(Buffer); } @@ -457,6 +459,7 @@ Test_RtlFindSetBits(void) ok_int(RtlFindSetBits(&BitMapHeader, 5, 64), 20); ok_int(RtlFindSetBits(&BitMapHeader, 6, 57), 40); ok_int(RtlFindSetBits(&BitMapHeader, 7, 0), -1); + ok_int(RtlFindSetBits(&BitMapHeader, 1, 62), 1); FreeGuarded(Buffer); } From b7eda7987915461a8480a4e17376e163dcbdd970 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Tue, 8 Apr 2014 21:04:47 +0000 Subject: [PATCH 270/419] [RTL] - Fix apitest crashes in RtlFindClearBits/RtlFindSetBits svn path=/trunk/; revision=62691 --- reactos/lib/rtl/bitmap.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/reactos/lib/rtl/bitmap.c b/reactos/lib/rtl/bitmap.c index 6ceddf927ee..350e182191c 100644 --- a/reactos/lib/rtl/bitmap.c +++ b/reactos/lib/rtl/bitmap.c @@ -101,6 +101,11 @@ RtlpGetLengthOfRunClear( BITMAP_INDEX Value, BitPos, Length; PBITMAP_BUFFER Buffer, MaxBuffer; + /* If we are already at the end, the length of the run is zero */ + ASSERT(StartingIndex <= BitMapHeader->SizeOfBitMap); + if (StartingIndex >= BitMapHeader->SizeOfBitMap) + return 0; + /* Calculate positions */ Buffer = BitMapHeader->Buffer + StartingIndex / _BITCOUNT; BitPos = StartingIndex & (_BITCOUNT - 1); @@ -150,6 +155,11 @@ RtlpGetLengthOfRunSet( BITMAP_INDEX InvValue, BitPos, Length; PBITMAP_BUFFER Buffer, MaxBuffer; + /* If we are already at the end, the length of the run is zero */ + ASSERT(StartingIndex <= BitMapHeader->SizeOfBitMap); + if (StartingIndex >= BitMapHeader->SizeOfBitMap) + return 0; + /* Calculate positions */ Buffer = BitMapHeader->Buffer + StartingIndex / _BITCOUNT; BitPos = StartingIndex & (_BITCOUNT - 1); From 707b9ab918b13b4e7b79847137ac5fbdd2e40bc3 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Wed, 9 Apr 2014 01:26:19 +0000 Subject: [PATCH 271/419] [NtUser|User32] - Start moving system control functions into Win32k. See CORE-7447. - Sync port from wine to update code before move and test. svn path=/trunk/; revision=62692 --- reactos/win32ss/user/ntuser/defwnd.c | 77 ++++++ reactos/win32ss/user/ntuser/message.c | 2 +- reactos/win32ss/user/ntuser/window.h | 1 + reactos/win32ss/user/user32/windows/defwnd.c | 247 +++++++++++-------- 4 files changed, 218 insertions(+), 109 deletions(-) diff --git a/reactos/win32ss/user/ntuser/defwnd.c b/reactos/win32ss/user/ntuser/defwnd.c index feea3b57457..e617021f37e 100644 --- a/reactos/win32ss/user/ntuser/defwnd.c +++ b/reactos/win32ss/user/ntuser/defwnd.c @@ -134,6 +134,72 @@ DefWndControlColor(HDC hDC, UINT ctlType) } +LRESULT FASTCALL +DefWndHandleWindowPosChanging(PWND pWnd, WINDOWPOS* Pos) +{ + POINT maxTrack, minTrack; + LONG style = pWnd->style; + + if (Pos->flags & SWP_NOSIZE) return 0; + if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0)) + { + co_WinPosGetMinMaxInfo(pWnd, NULL, NULL, &minTrack, &maxTrack); + Pos->cx = min(Pos->cx, maxTrack.x); + Pos->cy = min(Pos->cy, maxTrack.y); + if (!(style & WS_MINIMIZE)) + { + if (Pos->cx < minTrack.x) Pos->cx = minTrack.x; + if (Pos->cy < minTrack.y) Pos->cy = minTrack.y; + } + } + else + { + Pos->cx = max(Pos->cx, 0); + Pos->cy = max(Pos->cy, 0); + } + return 0; +} + +LRESULT FASTCALL +DefWndHandleWindowPosChanged(PWND pWnd, WINDOWPOS* Pos) +{ + RECT Rect; + LONG style = pWnd->style; + + IntGetClientRect(pWnd, &Rect); + IntMapWindowPoints(pWnd, (style & WS_CHILD ? IntGetParent(pWnd) : NULL), (LPPOINT) &Rect, 2); + + if (! (Pos->flags & SWP_NOCLIENTMOVE)) + { + co_IntSendMessage(UserHMGetHandle(pWnd), WM_MOVE, 0, MAKELONG(Rect.left, Rect.top)); + } + + if (! (Pos->flags & SWP_NOCLIENTSIZE)) + { + WPARAM wp = SIZE_RESTORED; + + if (style & WS_MAXIMIZE) wp = SIZE_MAXIMIZED; + else if (style & WS_MINIMIZE) wp = SIZE_MINIMIZED; + + co_IntSendMessage(UserHMGetHandle(pWnd), WM_SIZE, wp, MAKELONG(Rect.right - Rect.left, Rect.bottom - Rect.top)); + } + return 0; +} + +VOID FASTCALL +UserDrawWindowFrame(HDC hdc, + RECTL *rect, + ULONG width, + ULONG height) +{ + HBRUSH hbrush = NtGdiSelectBrush( hdc, gpsi->hbrGray ); + NtGdiPatBlt( hdc, rect->left, rect->top, rect->right - rect->left - width, height, PATINVERT ); + NtGdiPatBlt( hdc, rect->left, rect->top + height, width, rect->bottom - rect->top - height, PATINVERT ); + NtGdiPatBlt( hdc, rect->left + width, rect->bottom - 1, rect->right - rect->left - width, -height, PATINVERT ); + NtGdiPatBlt( hdc, rect->right - 1, rect->top, -width, rect->bottom - rect->top - height, PATINVERT ); + NtGdiSelectBrush( hdc, hbrush ); +} + LRESULT FASTCALL DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam) { @@ -264,6 +330,7 @@ IntDefWindowProc( } case WM_SETREDRAW: + ERR("WM_SETREDRAW\n"); if (wParam) { if (!(Wnd->style & WS_VISIBLE)) @@ -282,6 +349,16 @@ IntDefWindowProc( } return 0; + case WM_WINDOWPOSCHANGING: + { + return (DefWndHandleWindowPosChanging(Wnd, (WINDOWPOS*)lParam)); + } + + case WM_WINDOWPOSCHANGED: + { + return (DefWndHandleWindowPosChanged(Wnd, (WINDOWPOS*)lParam)); + } + /* ReactOS only. */ case WM_CBT: { diff --git a/reactos/win32ss/user/ntuser/message.c b/reactos/win32ss/user/ntuser/message.c index c8b207bceb4..4162008a35e 100644 --- a/reactos/win32ss/user/ntuser/message.c +++ b/reactos/win32ss/user/ntuser/message.c @@ -134,7 +134,7 @@ static MSGMEMORY g_MsgMemory[] = { WM_SETTINGCHANGE, MMS_SIZE_LPARAMSZ, MMS_FLAG_READ }, { WM_COPYDATA, MMS_SIZE_SPECIAL, MMS_FLAG_READ }, { WM_COPYGLOBALDATA, MMS_SIZE_WPARAM, MMS_FLAG_READ }, - { WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READ }, + { WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READWRITE }, { WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE }, }; diff --git a/reactos/win32ss/user/ntuser/window.h b/reactos/win32ss/user/ntuser/window.h index 776fa840fd7..ea20ec89ac4 100644 --- a/reactos/win32ss/user/ntuser/window.h +++ b/reactos/win32ss/user/ntuser/window.h @@ -39,6 +39,7 @@ BOOL FASTCALL UserUpdateUiState(PWND Wnd, WPARAM wParam); BOOL FASTCALL IntIsWindow(HWND hWnd); HWND* FASTCALL IntWinListChildren(PWND Window); VOID FASTCALL IntGetClientRect (PWND WindowObject, RECTL *Rect); +INT FASTCALL IntMapWindowPoints(PWND FromWnd, PWND ToWnd, LPPOINT lpPoints, UINT cPoints); BOOL FASTCALL IntIsChildWindow (PWND Parent, PWND Child); VOID FASTCALL IntUnlinkWindow(PWND Wnd); VOID FASTCALL IntLinkHwnd(PWND Wnd, HWND hWndPrev); diff --git a/reactos/win32ss/user/user32/windows/defwnd.c b/reactos/win32ss/user/user32/windows/defwnd.c index 7794329ff20..40cf0b6424a 100644 --- a/reactos/win32ss/user/user32/windows/defwnd.c +++ b/reactos/win32ss/user/user32/windows/defwnd.c @@ -153,7 +153,7 @@ UserGetInsideRectNC(PWND Wnd, RECT *rect) } } - +#if 0 // Moved to Win32k VOID DefWndSetRedraw(HWND hWnd, WPARAM wParam) { @@ -177,7 +177,7 @@ DefWndSetRedraw(HWND hWnd, WPARAM wParam) } return; } - +#endif LRESULT DefWndHandleSetCursor(HWND hWnd, WPARAM wParam, LPARAM lParam, ULONG Style) @@ -277,8 +277,11 @@ DefWndStartSizeMove(HWND hWnd, PWND Wnd, WPARAM wParam, POINT *capturePoint) rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; if (Style & WS_MAXIMIZEBOX) rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; - pt.x = rectWindow.left + (rect.right - rect.left) / 2; - pt.y = rectWindow.top + rect.top + GetSystemMetrics(SM_CYSIZE)/2; + //pt.x = rectWindow.left + (rect.right - rect.left) / 2; + //pt.y = rectWindow.top + rect.top + GetSystemMetrics(SM_CYSIZE)/2; + pt.x = (rect.right + rect.left) / 2; + pt.y = rect.top + GetSystemMetrics(SM_CYSIZE)/2; + ERR("SC_MOVE\n"); hittest = HTCAPTION; *capturePoint = pt; } @@ -293,9 +296,12 @@ DefWndStartSizeMove(HWND hWnd, PWND Wnd, WPARAM wParam, POINT *capturePoint) switch(msg.message) { case WM_MOUSEMOVE: + //// Clamp the mouse position to the window rectangle when starting a window resize. + //pt.x = min( max( msg.pt.x, rectWindow.left ), rectWindow.right - 1 ); + //pt.y = min( max( msg.pt.y, rectWindow.top ), rectWindow.bottom - 1 ); + //// Breaks a win test. hittest = DefWndNCHitTest(hWnd, msg.pt); - if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT)) - hittest = 0; + if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT)) hittest = 0; break; case WM_LBUTTONUP: @@ -354,19 +360,8 @@ static VOID UserDrawWindowFrame(HDC hdc, const RECT *rect, ULONG width, ULONG height) { - static HBRUSH hDraggingRectBrush = NULL; - HBRUSH hbrush; + HBRUSH hbrush = SelectObject( hdc, gpsi->hbrGray ); - if(!hDraggingRectBrush) - { - static HBITMAP hDraggingPattern = NULL; - const DWORD Pattern[4] = {0x5555AAAA, 0x5555AAAA, 0x5555AAAA, 0x5555AAAA}; - - hDraggingPattern = CreateBitmap(8, 8, 1, 1, Pattern); - hDraggingRectBrush = CreatePatternBrush(hDraggingPattern); - } - - hbrush = SelectObject( hdc, hDraggingRectBrush ); PatBlt( hdc, rect->left, rect->top, rect->right - rect->left - width, height, PATINVERT ); PatBlt( hdc, rect->left, rect->top + height, width, @@ -410,6 +405,8 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) BOOL DragFullWindows = FALSE; HWND hWndParent = NULL; PWND Wnd; + WPARAM syscommand = wParam & 0xfff0; + HMONITOR mon = 0; Wnd = ValidateHwnd(hwnd); if (!Wnd) @@ -419,36 +416,32 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) ExStyle = Wnd->ExStyle; iconic = (Style & WS_MINIMIZE) != 0; + // + // Show window contents while dragging the window, get flag from registry data. + // SystemParametersInfoA(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0); pt.x = GET_X_LPARAM(dwPoint); pt.y = GET_Y_LPARAM(dwPoint); capturePoint = pt; - if ((Style & WS_MAXIMIZE) || !IsWindowVisible(hwnd)) - { - return; - } + TRACE("hwnd %p command %04lx, hittest %d, pos %d,%d\n", + hwnd, syscommand, hittest, pt.x, pt.y); - thickframe = UserHasThickFrameStyle(Style, ExStyle) && !(Style & WS_MINIMIZE); - if ((wParam & 0xfff0) == SC_MOVE) - { - if (!hittest) - { - hittest = DefWndStartSizeMove(hwnd, Wnd, wParam, &capturePoint); - } - if (!hittest) - { - return; - } - } + if ((Style & WS_MAXIMIZE) || !IsWindowVisible(hwnd)) return; + + thickframe = UserHasThickFrameStyle(Style, ExStyle) && !iconic; + + if (syscommand == SC_MOVE) + { + ERR("SC_MOVE\n"); + if (!hittest) hittest = DefWndStartSizeMove(hwnd, Wnd, wParam, &capturePoint); + if (!hittest) return; + } else /* SC_SIZE */ - { - if (!thickframe) - { - return; - } - if (hittest && ((wParam & 0xfff0) != SC_MOUSEMENU)) + { + if (!thickframe) return; + if (hittest && (syscommand != SC_MOUSEMENU)) { hittest += (HTLEFT - WMSZ_LEFT); } @@ -462,23 +455,24 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) return; } } - } + } /* Get min/max info */ WinPosGetMinMaxInfo(hwnd, NULL, NULL, &minTrack, &maxTrack); sizingRect = Wnd->rcWindow; + ERR("x %d y %d X %d Y %d\n",pt.x,pt.y,sizingRect.left,sizingRect.top); if (Style & WS_CHILD) - { + { hWndParent = GetParent(hwnd); MapWindowPoints( 0, hWndParent, (LPPOINT)&sizingRect, 2 ); unmodRect = sizingRect; GetClientRect(hWndParent, &mouseRect ); clipRect = mouseRect; MapWindowPoints(hWndParent, HWND_DESKTOP, (LPPOINT)&clipRect, 2); - } + } else - { + { if(!(ExStyle & WS_EX_TOPMOST)) { SystemParametersInfoW(SPI_GETWORKAREA, 0, &clipRect, 0); @@ -489,70 +483,72 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) SetRect(&mouseRect, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); clipRect = mouseRect; } + mon = MonitorFromPoint( pt, MONITOR_DEFAULTTONEAREST ); unmodRect = sizingRect; - } + } ClipCursor(&clipRect); origRect = sizingRect; if (ON_LEFT_BORDER(hittest)) - { + { mouseRect.left = max( mouseRect.left, sizingRect.right-maxTrack.x ); mouseRect.right = min( mouseRect.right, sizingRect.right-minTrack.x ); - } + } else if (ON_RIGHT_BORDER(hittest)) - { + { mouseRect.left = max( mouseRect.left, sizingRect.left+minTrack.x ); mouseRect.right = min( mouseRect.right, sizingRect.left+maxTrack.x ); - } + } if (ON_TOP_BORDER(hittest)) - { + { mouseRect.top = max( mouseRect.top, sizingRect.bottom-maxTrack.y ); mouseRect.bottom = min( mouseRect.bottom,sizingRect.bottom-minTrack.y); - } + } else if (ON_BOTTOM_BORDER(hittest)) - { + { mouseRect.top = max( mouseRect.top, sizingRect.top+minTrack.y ); mouseRect.bottom = min( mouseRect.bottom, sizingRect.top+maxTrack.y ); - } + } if (Style & WS_CHILD) - { + { MapWindowPoints( hWndParent, 0, (LPPOINT)&mouseRect, 2 ); - } + } + IntNotifyWinEvent( EVENT_SYSTEM_MOVESIZESTART, hwnd, OBJID_WINDOW, CHILDID_SELF, 0); SendMessageA( hwnd, WM_ENTERSIZEMOVE, 0, 0 ); NtUserxSetGUIThreadHandle(MSQ_STATE_MOVESIZE, hwnd); if (GetCapture() != hwnd) SetCapture( hwnd ); if (Style & WS_CHILD) - { + { /* Retrieve a default cache DC (without using the window style) */ hdc = GetDCEx(hWndParent, 0, DCX_CACHE); DesktopRgn = NULL; - } + } else - { + { hdc = GetDC( 0 ); DesktopRgn = CreateRectRgnIndirect(&clipRect); - } + } SelectObject(hdc, DesktopRgn); if( iconic ) /* create a cursor for dragging */ - { + { HICON hIcon = (HICON)GetClassLongPtrW(hwnd, GCL_HICON); if(!hIcon) hIcon = (HICON)SendMessageW( hwnd, WM_QUERYDRAGICON, 0, 0L); if( hIcon ) hDragCursor = CursorIconToCursor( hIcon, TRUE ); if( !hDragCursor ) iconic = FALSE; - } + } /* invert frame if WIN31_LOOK to indicate mouse click on caption */ if( !iconic && !DragFullWindows) - { + { UserDrawMovingFrame( hdc, &sizingRect, thickframe); - } + } for(;;) - { + { int dx = 0, dy = 0; if (!GetMessageW(&msg, 0, 0, 0)) break; @@ -564,12 +560,12 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) ((msg.wParam == VK_RETURN) || (msg.wParam == VK_ESCAPE)))) break; if (msg.message == WM_PAINT) - { + { if(!iconic && !DragFullWindows) UserDrawMovingFrame( hdc, &sizingRect, thickframe ); UpdateWindow( msg.hwnd ); if(!iconic && !DragFullWindows) UserDrawMovingFrame( hdc, &sizingRect, thickframe ); continue; - } + } if ((msg.message != WM_KEYDOWN) && (msg.message != WM_MOUSEMOVE)) { @@ -581,39 +577,56 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) pt = msg.pt; if (msg.message == WM_KEYDOWN) switch(msg.wParam) - { + { case VK_UP: pt.y -= 8; break; case VK_DOWN: pt.y += 8; break; case VK_LEFT: pt.x -= 8; break; case VK_RIGHT: pt.x += 8; break; - } + } pt.x = max( pt.x, mouseRect.left ); - pt.x = min( pt.x, mouseRect.right ); + pt.x = min( pt.x, mouseRect.right - 1 ); pt.y = max( pt.y, mouseRect.top ); - pt.y = min( pt.y, mouseRect.bottom ); + pt.y = min( pt.y, mouseRect.bottom - 1 ); + + if (!hWndParent) + { + HMONITOR newmon; + MONITORINFO info; + + if ((newmon = MonitorFromPoint( pt, MONITOR_DEFAULTTONULL ))) + mon = newmon; + + info.cbSize = sizeof(info); + if (mon && GetMonitorInfoW( mon, &info )) + { + pt.x = max( pt.x, info.rcWork.left ); + pt.x = min( pt.x, info.rcWork.right - 1 ); + pt.y = max( pt.y, info.rcWork.top ); + pt.y = min( pt.y, info.rcWork.bottom - 1 ); + } + } dx = pt.x - capturePoint.x; dy = pt.y - capturePoint.y; if (dx || dy) - { + { if( !moved ) - { + { moved = TRUE; if( iconic ) /* ok, no system popup tracking */ - { + { hOldCursor = SetCursor(hDragCursor); ShowCursor( TRUE ); - } - } + } + } if (msg.message == WM_KEYDOWN) SetCursorPos( pt.x, pt.y ); else - { + { RECT newRect = unmodRect; - WPARAM wpSizingHit = 0; if (hittest == HTCAPTION) OffsetRect( &newRect, dx, dy ); if (ON_LEFT_BORDER(hittest)) newRect.left += dx; @@ -624,18 +637,26 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) capturePoint = pt; /* determine the hit location */ - if (hittest >= HTLEFT && hittest <= HTBOTTOMRIGHT) - wpSizingHit = WMSZ_LEFT + (hittest - HTLEFT); unmodRect = newRect; - SendMessageA( hwnd, WM_SIZING, wpSizingHit, (LPARAM)&newRect ); + if (syscommand == SC_SIZE) + { + WPARAM wpSizingHit = 0; + + if (hittest >= HTLEFT && hittest <= HTBOTTOMRIGHT) + wpSizingHit = WMSZ_LEFT + (hittest - HTLEFT); + SendMessageW( hwnd, WM_SIZING, wpSizingHit, (LPARAM)&newRect ); + } + else + SendMessageW( hwnd, WM_MOVING, 0, (LPARAM)&newRect ); if (!iconic) { if(!DragFullWindows) UserDrawMovingFrame( hdc, &newRect, thickframe ); - else { - /* To avoid any deadlocks, all the locks on the windows + else + { /* To avoid any deadlocks, all the locks on the windows structures must be suspended before the SetWindowPos */ + //ERR("SWP 1\n"); SetWindowPos( hwnd, 0, newRect.left, newRect.top, newRect.right - newRect.left, newRect.bottom - newRect.top, @@ -643,21 +664,21 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) } } sizingRect = newRect; - } - } - } + } + } + } ReleaseCapture(); ClipCursor(NULL); if( iconic ) - { + { if( moved ) /* restore cursors, show icon title later on */ - { + { ShowCursor( FALSE ); SetCursor( hOldCursor ); - } + } DestroyCursor( hDragCursor ); - } + } else if(!DragFullWindows) UserDrawMovingFrame( hdc, &sizingRect, thickframe ); @@ -671,6 +692,8 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) DeleteObject(DesktopRgn); } } + //// This causes the mdi child window to jump up when it is moved. + //if (hWndParent) MapWindowPoints( 0, hWndParent, (POINT *)&sizingRect, 2 ); if (ISITHOOKED(WH_CBT)) { @@ -685,40 +708,45 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) /* window moved or resized */ if (moved) - { + { /* if the moving/resizing isn't canceled call SetWindowPos * with the new position or the new size of the window */ if (!((msg.message == WM_KEYDOWN) && (msg.wParam == VK_ESCAPE)) ) - { + { /* NOTE: SWP_NOACTIVATE prevents document window activation in Word 6 */ - if(!DragFullWindows) + if(!DragFullWindows )//|| iconic) breaks 2 win tests. + { + //ERR("SWP 2\n"); SetWindowPos( hwnd, 0, sizingRect.left, sizingRect.top, sizingRect.right - sizingRect.left, sizingRect.bottom - sizingRect.top, ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ); - } - else { /* restore previous size/position */ + } + } + else + { /* restore previous size/position */ if(DragFullWindows) + { + //ERR("SWP 3\n"); SetWindowPos( hwnd, 0, origRect.left, origRect.top, origRect.right - origRect.left, origRect.bottom - origRect.top, ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ); + } } - } + } if( IsWindow(hwnd) ) - if( Style & WS_MINIMIZE ) - { + if( iconic ) + { /* Single click brings up the system menu when iconized */ - if( !moved ) - { + { if( Style & WS_SYSMENU ) - SendMessageA( hwnd, WM_SYSCOMMAND, - SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y)); - } - } + SendMessageA( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y)); + } + } } @@ -858,7 +886,7 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) return(0); } - +#if 0 // Move to Win32k LRESULT DefWndHandleWindowPosChanging(HWND hWnd, WINDOWPOS* Pos) { @@ -916,6 +944,7 @@ DefWndHandleWindowPosChanged(HWND hWnd, WINDOWPOS* Pos) return 0; } +#endif /*********************************************************************** * DefWndControlColor @@ -1165,7 +1194,7 @@ User32DefWindowProc(HWND hWnd, { return (DefWndNCLButtonDblClk(hWnd, wParam, lParam)); } - +/* Moved to Win32k case WM_WINDOWPOSCHANGING: { return (DefWndHandleWindowPosChanging(hWnd, (WINDOWPOS*)lParam)); @@ -1175,7 +1204,7 @@ User32DefWindowProc(HWND hWnd, { return (DefWndHandleWindowPosChanged(hWnd, (WINDOWPOS*)lParam)); } - +*/ case WM_NCRBUTTONDOWN: return NC_HandleNCRButtonDown( hWnd, wParam, lParam ); @@ -1314,7 +1343,7 @@ User32DefWindowProc(HWND hWnd, } return (0); } -/* +/* Moved to Win32k case WM_SYNCPAINT: { HRGN hRgn; @@ -1845,7 +1874,7 @@ User32DefWindowProc(HWND hWnd, break; } -/* Move to win32k !*/ +/* Move to Win32k !*/ case WM_SHOWWINDOW: if (!lParam) break; // Call when it is necessary. case WM_SYNCPAINT: @@ -1853,6 +1882,8 @@ User32DefWindowProc(HWND hWnd, case WM_CLIENTSHUTDOWN: case WM_GETHOTKEY: case WM_SETHOTKEY: + case WM_WINDOWPOSCHANGING: + case WM_WINDOWPOSCHANGED: { LRESULT lResult; NtUserMessageCall( hWnd, Msg, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, !bUnicode); From 9ef6a8868b90d80fae8059478843811a9a01feb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 9 Apr 2014 12:29:57 +0000 Subject: [PATCH 272/419] [CONTROL] - Remove undeeded files. - Fully convert the app to UNICODE. - Code cleanup. svn path=/trunk/; revision=62694 --- .../base/applications/control/CMakeLists.txt | 2 +- reactos/base/applications/control/control.c | 230 ++++++++++-------- reactos/base/applications/control/control.dsp | 137 ----------- reactos/base/applications/control/control.dsw | 29 --- reactos/base/applications/control/control.h | 23 -- 5 files changed, 130 insertions(+), 291 deletions(-) delete mode 100644 reactos/base/applications/control/control.dsp delete mode 100644 reactos/base/applications/control/control.dsw delete mode 100644 reactos/base/applications/control/control.h diff --git a/reactos/base/applications/control/CMakeLists.txt b/reactos/base/applications/control/CMakeLists.txt index 7f74b8ef81e..0818fce4aee 100644 --- a/reactos/base/applications/control/CMakeLists.txt +++ b/reactos/base/applications/control/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(control control.c control.rc) set_module_type(control win32gui UNICODE) -add_importlibs(control advapi32 shell32 msvcrt kernel32) +add_importlibs(control advapi32 shell32 user32 msvcrt kernel32) add_cd_file(TARGET control DESTINATION reactos/system32 FOR all) diff --git a/reactos/base/applications/control/control.c b/reactos/base/applications/control/control.c index f98eb13f209..0984e987202 100644 --- a/reactos/base/applications/control/control.c +++ b/reactos/base/applications/control/control.c @@ -6,154 +6,182 @@ * Colin Finck (mail@colinfinck.de) */ -#include "control.h" +#include -static const TCHAR szWindowClass[] = _T("DummyControlClass"); +#define WIN32_NO_STATUS -HANDLE hProcessHeap; -HINSTANCE hInst; +#include +#include +#include +#include +#include -static -INT -OpenShellFolder(LPTSTR lpFolderCLSID) -{ - TCHAR szParameters[MAX_PATH]; +#include "resource.h" - /* Open a shell folder using "explorer.exe". - The passed CLSID's are all subfolders of the "Control Panel" shell folder. */ - _tcscpy(szParameters, _T("/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}")); - _tcscat(szParameters, lpFolderCLSID); +#define MAX_VALUE_NAME 16383 - return (INT_PTR)ShellExecute(NULL, - _T("open"), - _T("explorer.exe"), - szParameters, - NULL, - SW_SHOWDEFAULT) > 32; -} +/* + * Macro for calling "rundll32.exe" + * According to MSDN, ShellExecute returns a value greater than 32 + * if the operation was successful. + */ +#define RUNDLL(param) \ + ((INT_PTR)ShellExecuteW(NULL, L"open", L"rundll32.exe", (param), NULL, SW_SHOWDEFAULT) > 32) -static -INT -RunControlPanel(LPTSTR lpCmd) -{ - TCHAR szParameters[MAX_PATH]; - - _tcscpy(szParameters, _T("shell32.dll,Control_RunDLL ")); - _tcscat(szParameters, lpCmd); - - return RUNDLL(szParameters); -} - -int +VOID WINAPI -_tWinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPTSTR lpCmdLine, - int nCmdShow) +Control_RunDLLW(HWND hWnd, HINSTANCE hInst, LPCWSTR cmd, DWORD nCmdShow); + +static INT +OpenShellFolder(LPWSTR lpFolderCLSID) +{ + WCHAR szParameters[MAX_PATH]; + + /* + * Open a shell folder using "explorer.exe". The passed CLSIDs + * are all subfolders of the "Control Panel" shell folder. + */ + wcscpy(szParameters, L"/n,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"); + wcscat(szParameters, lpFolderCLSID); + + return (INT_PTR)ShellExecuteW(NULL, + L"open", + L"explorer.exe", + szParameters, + NULL, + SW_SHOWDEFAULT) > 32; +} + +static INT +RunControlPanel(LPCWSTR lpCmd) +{ + /* + * Old method: + * + WCHAR szParameters[MAX_PATH]; + wcscpy(szParameters, L"shell32.dll,Control_RunDLL "); + wcscat(szParameters, lpCmd); + return RUNDLL(szParameters); + */ + + /* New method: */ + Control_RunDLLW(GetDesktopWindow(), 0, lpCmd, SW_SHOW); + return 1; +} + +INT +WINAPI +wWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPWSTR lpCmdLine, + INT nCmdShow) { HKEY hKey; - hInst = hInstance; - hProcessHeap = GetProcessHeap(); - /* Show the control panel window if no argument or "panel" was passed */ - if(lpCmdLine[0] == 0 || !_tcsicmp(lpCmdLine, _T("panel"))) - return OpenShellFolder(_T("")); + if (*lpCmdLine == 0 || !_wcsicmp(lpCmdLine, L"panel")) + return OpenShellFolder(L""); /* Check one of the built-in control panel handlers */ - if (!_tcsicmp(lpCmdLine, _T("admintools"))) return OpenShellFolder(_T("\\::{D20EA4E1-3957-11d2-A40B-0C5020524153}")); - else if (!_tcsicmp(lpCmdLine, _T("color"))) return RunControlPanel(_T("desk.cpl")); /* TODO: Switch to the "Apperance" tab */ - else if (!_tcsicmp(lpCmdLine, _T("date/time"))) return RunControlPanel(_T("timedate.cpl")); - else if (!_tcsicmp(lpCmdLine, _T("desktop"))) return RunControlPanel(_T("desk.cpl")); - else if (!_tcsicmp(lpCmdLine, _T("folders"))) return RUNDLL(_T("shell32.dll,Options_RunDLL")); - else if (!_tcsicmp(lpCmdLine, _T("fonts"))) return OpenShellFolder(_T("\\::{D20EA4E1-3957-11d2-A40B-0C5020524152}")); - else if (!_tcsicmp(lpCmdLine, _T("infrared"))) return RunControlPanel(_T("irprops.cpl")); - else if (!_tcsicmp(lpCmdLine, _T("international"))) return RunControlPanel(_T("intl.cpl")); - else if (!_tcsicmp(lpCmdLine, _T("keyboard"))) return RunControlPanel(_T("main.cpl @1")); - else if (!_tcsicmp(lpCmdLine, _T("mouse"))) return RunControlPanel(_T("main.cpl @0")); - else if (!_tcsicmp(lpCmdLine, _T("netconnections"))) return OpenShellFolder(_T("\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}")); - else if (!_tcsicmp(lpCmdLine, _T("netware"))) return RunControlPanel(_T("nwc.cpl")); - else if (!_tcsicmp(lpCmdLine, _T("ports"))) return RunControlPanel(_T("sysdm.cpl")); /* TODO: Switch to the "Computer Name" tab */ - else if (!_tcsicmp(lpCmdLine, _T("printers"))) return OpenShellFolder(_T("\\::{2227A280-3AEA-1069-A2DE-08002B30309D}")); - else if (!_tcsicmp(lpCmdLine, _T("scannercamera"))) return OpenShellFolder(_T("\\::{E211B736-43FD-11D1-9EFB-0000F8757FCD}")); - else if (!_tcsicmp(lpCmdLine, _T("schedtasks"))) return OpenShellFolder(_T("\\::{D6277990-4C6A-11CF-8D87-00AA0060F5BF}")); - else if (!_tcsicmp(lpCmdLine, _T("telephony"))) return RunControlPanel(_T("telephon.cpl")); - else if (!_tcsicmp(lpCmdLine, _T("userpasswords"))) return RunControlPanel(_T("nusrmgr.cpl")); /* Graphical User Account Manager */ - else if (!_tcsicmp(lpCmdLine, _T("userpasswords2"))) return RUNDLL(_T("netplwiz.dll,UsersRunDll")); /* Dialog based advanced User Account Manager */ + if (!_wcsicmp(lpCmdLine, L"admintools")) return OpenShellFolder(L"\\::{D20EA4E1-3957-11d2-A40B-0C5020524153}"); + else if (!_wcsicmp(lpCmdLine, L"color")) return RunControlPanel(L"desk.cpl"); /* TODO: Switch to the "Apperance" tab */ + else if (!_wcsicmp(lpCmdLine, L"date/time")) return RunControlPanel(L"timedate.cpl"); + else if (!_wcsicmp(lpCmdLine, L"desktop")) return RunControlPanel(L"desk.cpl"); + else if (!_wcsicmp(lpCmdLine, L"folders")) return RUNDLL(L"shell32.dll,Options_RunDLL"); + else if (!_wcsicmp(lpCmdLine, L"fonts")) return OpenShellFolder(L"\\::{D20EA4E1-3957-11d2-A40B-0C5020524152}"); + else if (!_wcsicmp(lpCmdLine, L"infrared")) return RunControlPanel(L"irprops.cpl"); + else if (!_wcsicmp(lpCmdLine, L"international")) return RunControlPanel(L"intl.cpl"); + else if (!_wcsicmp(lpCmdLine, L"keyboard")) return RunControlPanel(L"main.cpl @1"); + else if (!_wcsicmp(lpCmdLine, L"mouse")) return RunControlPanel(L"main.cpl @0"); + else if (!_wcsicmp(lpCmdLine, L"netconnections")) return OpenShellFolder(L"\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}"); + else if (!_wcsicmp(lpCmdLine, L"netware")) return RunControlPanel(L"nwc.cpl"); + else if (!_wcsicmp(lpCmdLine, L"ports")) return RunControlPanel(L"sysdm.cpl"); /* TODO: Switch to the "Computer Name" tab */ + else if (!_wcsicmp(lpCmdLine, L"printers")) return OpenShellFolder(L"\\::{2227A280-3AEA-1069-A2DE-08002B30309D}"); + else if (!_wcsicmp(lpCmdLine, L"scannercamera")) return OpenShellFolder(L"\\::{E211B736-43FD-11D1-9EFB-0000F8757FCD}"); + else if (!_wcsicmp(lpCmdLine, L"schedtasks")) return OpenShellFolder(L"\\::{D6277990-4C6A-11CF-8D87-00AA0060F5BF}"); + else if (!_wcsicmp(lpCmdLine, L"telephony")) return RunControlPanel(L"telephon.cpl"); + else if (!_wcsicmp(lpCmdLine, L"userpasswords")) return RunControlPanel(L"nusrmgr.cpl"); /* Graphical User Account Manager */ + else if (!_wcsicmp(lpCmdLine, L"userpasswords2")) return RUNDLL(L"netplwiz.dll,UsersRunDll"); /* Dialog based advanced User Account Manager */ /* It is none of them, so look for a handler in the registry */ - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, - _T("Software\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"), - 0, - KEY_QUERY_VALUE, - &hKey) == ERROR_SUCCESS) + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, + L"Software\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls", + 0, + KEY_QUERY_VALUE, + &hKey) == ERROR_SUCCESS) { DWORD dwIndex; - for(dwIndex = 0; ; ++dwIndex) + for (dwIndex = 0; ; ++dwIndex) { DWORD dwDataSize; DWORD dwValueSize = MAX_VALUE_NAME; - TCHAR szValueName[MAX_VALUE_NAME]; + WCHAR szValueName[MAX_VALUE_NAME]; /* Get the value name and data size */ - if(RegEnumValue(hKey, - dwIndex, - szValueName, - &dwValueSize, - 0, - NULL, - NULL, - &dwDataSize) != ERROR_SUCCESS) + if (RegEnumValueW(hKey, + dwIndex, + szValueName, + &dwValueSize, + 0, + NULL, + NULL, + &dwDataSize) != ERROR_SUCCESS) + { break; + } /* Check if the parameter is the value name */ - if(!_tcsicmp(lpCmdLine, szValueName)) + if (!_wcsicmp(lpCmdLine, szValueName)) { - LPTSTR pszData; - - /* Allocate memory for the data plus two more characters, so we can quote the file name if required */ - pszData = (LPTSTR) HeapAlloc(hProcessHeap, - 0, - dwDataSize + 2 * sizeof(TCHAR)); + /* + * Allocate memory for the data plus two more characters, + * so we can quote the file name if required. + */ + LPWSTR pszData; + pszData = HeapAlloc(GetProcessHeap(), + 0, + dwDataSize + 2 * sizeof(WCHAR)); ++pszData; - /* This value is the one we are looking for, so get the data. It is the path to a .cpl file */ - if(RegQueryValueEx(hKey, - szValueName, - 0, - NULL, - (LPBYTE)pszData, - &dwDataSize) == ERROR_SUCCESS) + /* + * This value is the one we are looking for, so get the data. + * It is the path to a .cpl file. + */ + if (RegQueryValueExW(hKey, + szValueName, + 0, + NULL, + (LPBYTE)pszData, + &dwDataSize) == ERROR_SUCCESS) { INT nReturnValue; /* Quote the file name if required */ - if(*pszData != '\"') + if (*pszData != L'\"') { - *(--pszData) = '\"'; - pszData[dwDataSize / sizeof(TCHAR)] = '\"'; - pszData[(dwDataSize / sizeof(TCHAR)) + 1] = 0; + *(--pszData) = L'\"'; + pszData[dwDataSize / sizeof(WCHAR)] = L'\"'; + pszData[(dwDataSize / sizeof(WCHAR)) + 1] = 0; } nReturnValue = RunControlPanel(pszData); - HeapFree(hProcessHeap, - 0, - pszData); + HeapFree(GetProcessHeap(), 0, pszData); RegCloseKey(hKey); return nReturnValue; } - HeapFree(hProcessHeap, - 0, - pszData); + HeapFree(GetProcessHeap(), 0, pszData); } } RegCloseKey(hKey); } - /* It's none of the known parameters, so interpret the parameter as the file name of a control panel applet */ + /* + * It's none of the known parameters, so interpret the parameter + * as the file name of a control panel applet. + */ return RunControlPanel(lpCmdLine); } diff --git a/reactos/base/applications/control/control.dsp b/reactos/base/applications/control/control.dsp deleted file mode 100644 index c2cdcea4439..00000000000 --- a/reactos/base/applications/control/control.dsp +++ /dev/null @@ -1,137 +0,0 @@ -# Microsoft Developer Studio Project File - Name="control" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=control - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "control.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "control.mak" CFG="control - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "control - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "control - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "control - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release" -# PROP Intermediate_Dir "Release" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /W3 /GX /O2 /I "../../../" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "NDEBUG" -# ADD RSC /l 0x407 /d "NDEBUG" /d "MS_COMPILER" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /subsystem:windows /machine:I386 -# Begin Custom Build -TargetDir=.\Release -TargetName=control -InputPath=.\Release\control.exe -InputName=control -SOURCE="$(InputPath)" - -"C:\reactos\reactos\$(InputName).EXE" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\$(TargetName).EXE C:\reactos\reactos - -# End Custom Build - -!ELSEIF "$(CFG)" == "control - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "../../../" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x407 /d "_DEBUG" -# ADD RSC /l 0x407 /d "_DEBUG" /d "MS_COMPILER" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# Begin Custom Build -TargetDir=.\Debug -TargetName=control -InputPath=.\Debug\control.exe -InputName=control -SOURCE="$(InputPath)" - -"C:\reactos\reactos\$(InputName).EXE" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" - copy $(TargetDir)\$(TargetName).EXE C:\reactos\reactos - -# End Custom Build - -!ENDIF - -# Begin Target - -# Name "control - Win32 Release" -# Name "control - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\control.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\config.ico -# End Source File -# Begin Source File - -SOURCE=.\control.rc -# End Source File -# End Group -# End Target -# End Project diff --git a/reactos/base/applications/control/control.dsw b/reactos/base/applications/control/control.dsw deleted file mode 100644 index d7d3aa5df4e..00000000000 --- a/reactos/base/applications/control/control.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "control"=.\control.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/reactos/base/applications/control/control.h b/reactos/base/applications/control/control.h deleted file mode 100644 index e82432bbf5b..00000000000 --- a/reactos/base/applications/control/control.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * PROJECT: ReactOS System Control Panel - * FILE: base/applications/control/control.h - * PURPOSE: ReactOS System Control Panel - * PROGRAMMERS: Gero Kuehn (reactos.filter@gkware.com) - * Colin Finck (mail@colinfinck.de) - */ - -#include -#include -#include -#include -#include -#include - -#include "resource.h" - -#define CCH_UINT_MAX 11 -#define MAX_VALUE_NAME 16383 - -/* Macro for calling "rundll32.exe" - According to MSDN, ShellExecute returns a value greater than 32 if the operation was successful. */ -#define RUNDLL(param) ((INT_PTR)ShellExecute(NULL, _T("open"), _T("rundll32.exe"), (param), NULL, SW_SHOWDEFAULT) > 32) From 08df30bc8b7967a26c02e0ea45adebda70d05441 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Wed, 9 Apr 2014 18:00:33 +0000 Subject: [PATCH 273/419] [KMTESTS:NPFS] - Add some (pretty incomplete) tests for NPFS Create, Connect and Read/Write operations CORE-7451 svn path=/trunk/; revision=62695 --- rostests/kmtests/CMakeLists.txt | 4 + rostests/kmtests/kmtest_drv/testlist.c | 6 + rostests/kmtests/npfs/NpfsConnect.c | 272 +++++++++ rostests/kmtests/npfs/NpfsCreate.c | 118 ++++ rostests/kmtests/npfs/NpfsHelpers.c | 774 +++++++++++++++++++++++++ rostests/kmtests/npfs/NpfsReadWrite.c | 598 +++++++++++++++++++ rostests/kmtests/npfs/npfs.h | 225 +++++++ 7 files changed, 1997 insertions(+) create mode 100644 rostests/kmtests/npfs/NpfsConnect.c create mode 100644 rostests/kmtests/npfs/NpfsCreate.c create mode 100644 rostests/kmtests/npfs/NpfsHelpers.c create mode 100644 rostests/kmtests/npfs/NpfsReadWrite.c create mode 100644 rostests/kmtests/npfs/npfs.h diff --git a/rostests/kmtests/CMakeLists.txt b/rostests/kmtests/CMakeLists.txt index 828a290c960..11d13698407 100644 --- a/rostests/kmtests/CMakeLists.txt +++ b/rostests/kmtests/CMakeLists.txt @@ -28,6 +28,10 @@ list(APPEND KMTEST_DRV_SOURCE example/Example.c example/KernelType.c + npfs/NpfsConnect.c + npfs/NpfsCreate.c + npfs/NpfsHelpers.c + npfs/NpfsReadWrite.c ntos_ex/ExCallback.c ntos_ex/ExDoubleList.c ntos_ex/ExFastMutex.c diff --git a/rostests/kmtests/kmtest_drv/testlist.c b/rostests/kmtests/kmtest_drv/testlist.c index 0920bdf858d..8cb7c06725b 100644 --- a/rostests/kmtests/kmtest_drv/testlist.c +++ b/rostests/kmtests/kmtest_drv/testlist.c @@ -38,6 +38,9 @@ KMT_TESTFUNC Test_KeProcessor; KMT_TESTFUNC Test_KeTimer; KMT_TESTFUNC Test_KernelType; KMT_TESTFUNC Test_MmSection; +KMT_TESTFUNC Test_NpfsConnect; +KMT_TESTFUNC Test_NpfsCreate; +KMT_TESTFUNC Test_NpfsReadWrite; KMT_TESTFUNC Test_ObReference; KMT_TESTFUNC Test_ObType; KMT_TESTFUNC Test_ObTypeClean; @@ -89,6 +92,9 @@ const KMT_TEST TestList[] = { "KeTimer", Test_KeTimer }, { "-KernelType", Test_KernelType }, { "MmSection", Test_MmSection }, + { "NpfsConnect", Test_NpfsConnect }, + { "NpfsCreate", Test_NpfsCreate }, + { "NpfsReadWrite", Test_NpfsReadWrite }, { "ObReference", Test_ObReference }, { "ObType", Test_ObType }, { "-ObTypeClean", Test_ObTypeClean }, diff --git a/rostests/kmtests/npfs/NpfsConnect.c b/rostests/kmtests/npfs/NpfsConnect.c new file mode 100644 index 00000000000..2c539719754 --- /dev/null +++ b/rostests/kmtests/npfs/NpfsConnect.c @@ -0,0 +1,272 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory + * PURPOSE: Kernel-Mode Test Suite NPFS Connect test + * PROGRAMMER: Thomas Faber + */ + +#include +#include "npfs.h" + +#define MAX_INSTANCES 5 +#define IN_QUOTA 4096 +#define OUT_QUOTA 4096 + +#define CheckServer(ServerHandle, State) \ + NpCheckServerPipe(ServerHandle, \ + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, \ + MAX_INSTANCES, 1, \ + IN_QUOTA, 0, \ + OUT_QUOTA, OUT_QUOTA, \ + State) + +#define CheckClient(ClientHandle, State) \ + NpCheckClientPipe(ClientHandle, \ + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, \ + MAX_INSTANCES, 1, \ + IN_QUOTA, 0, \ + OUT_QUOTA, OUT_QUOTA, \ + State) + +static +VOID +ConnectPipe( + IN OUT PTHREAD_CONTEXT Context) +{ + HANDLE ClientHandle; + + ClientHandle = NULL; + Context->Connect.Status = NpOpenPipe(&ClientHandle, + Context->Connect.PipePath, + FILE_PIPE_FULL_DUPLEX); + Context->Connect.ClientHandle = ClientHandle; +} + +static +VOID +ListenPipe( + IN OUT PTHREAD_CONTEXT Context) +{ + Context->Listen.Status = NpListenPipe(Context->Listen.ServerHandle); +} + +static +BOOLEAN +CheckConnectPipe( + IN PTHREAD_CONTEXT Context, + IN PCWSTR PipePath, + IN ULONG MilliSeconds) +{ + Context->Work = ConnectPipe; + Context->Connect.PipePath = PipePath; + return TriggerWork(Context, MilliSeconds); +} + +static +BOOLEAN +CheckListenPipe( + IN PTHREAD_CONTEXT Context, + IN HANDLE ServerHandle, + IN ULONG MilliSeconds) +{ + Context->Work = ListenPipe; + Context->Listen.ServerHandle = ServerHandle; + return TriggerWork(Context, MilliSeconds); +} + +static +VOID +TestConnect( + IN HANDLE ServerHandle, + IN PCWSTR PipePath) +{ + NTSTATUS Status; + THREAD_CONTEXT ConnectContext; + THREAD_CONTEXT ListenContext; + BOOLEAN Okay; + HANDLE ClientHandle; + + StartWorkerThread(&ConnectContext); + StartWorkerThread(&ListenContext); + + /* Server should start out listening */ + CheckServer(ServerHandle, FILE_PIPE_LISTENING_STATE); + + /* Connect a client */ + ClientHandle = NULL; + Okay = CheckConnectPipe(&ConnectContext, PipePath, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_SUCCESS); + if (NT_SUCCESS(ConnectContext.Connect.Status)) + { + ClientHandle = ConnectContext.Connect.ClientHandle; + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + } + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /* Connect another client */ + Okay = CheckConnectPipe(&ConnectContext, PipePath, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_PIPE_NOT_AVAILABLE); + if (NT_SUCCESS(ConnectContext.Connect.Status)) + ObCloseHandle(ConnectContext.Connect.ClientHandle, KernelMode); + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /* Disconnecting the client should fail */ + Status = NpDisconnectPipe(ClientHandle); + ok_eq_hex(Status, STATUS_ILLEGAL_FUNCTION); + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /* Listening on the client should fail */ + Status = NpListenPipe(ClientHandle); + ok_eq_hex(Status, STATUS_ILLEGAL_FUNCTION); + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /* Close client */ + if (ClientHandle) + ObCloseHandle(ClientHandle, KernelMode); + CheckServer(ServerHandle, FILE_PIPE_CLOSING_STATE); + + /* Connecting a client now should fail */ + Okay = CheckConnectPipe(&ConnectContext, PipePath, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_PIPE_NOT_AVAILABLE); + if (NT_SUCCESS(ConnectContext.Connect.Status)) + ObCloseHandle(ConnectContext.Connect.ClientHandle, KernelMode); + CheckServer(ServerHandle, FILE_PIPE_CLOSING_STATE); + + /* Listening should fail */ + Okay = CheckListenPipe(&ListenContext, ServerHandle, 100); + ok_bool_true(Okay, "CheckListenPipe returned"); + if (!skip(Okay, "Listen succeeded unexpectedly\n")) + CheckServer(ServerHandle, FILE_PIPE_CLOSING_STATE); + + /* Disconnect server */ + Status = NpDisconnectPipe(ServerHandle); + ok_eq_hex(Status, STATUS_SUCCESS); + CheckServer(ServerHandle, FILE_PIPE_DISCONNECTED_STATE); + + /* Disconnecting again should fail */ + Status = NpDisconnectPipe(ServerHandle); + ok_eq_hex(Status, STATUS_PIPE_DISCONNECTED); + CheckServer(ServerHandle, FILE_PIPE_DISCONNECTED_STATE); + + /* Connecting a client now should fail */ + Okay = CheckConnectPipe(&ConnectContext, PipePath, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_PIPE_NOT_AVAILABLE); + if (NT_SUCCESS(ConnectContext.Connect.Status)) + ObCloseHandle(ConnectContext.Connect.ClientHandle, KernelMode); + CheckServer(ServerHandle, FILE_PIPE_DISCONNECTED_STATE); + + /**************************************************************************/ + /* Now listen again */ + Okay = CheckListenPipe(&ListenContext, ServerHandle, 100); + ok_bool_false(Okay, "CheckListenPipe returned"); + //blocks: CheckServer(ServerHandle, FILE_PIPE_LISTENING_STATE); + + /* Connect client */ + ClientHandle = NULL; + Okay = CheckConnectPipe(&ConnectContext, PipePath, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_SUCCESS); + if (NT_SUCCESS(ConnectContext.Connect.Status)) + { + ClientHandle = ConnectContext.Connect.ClientHandle; + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + } + Okay = WaitForWork(&ListenContext, 100); + ok_bool_true(Okay, "WaitForWork returned"); + ok_eq_hex(ListenContext.Listen.Status, STATUS_SUCCESS); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /* Listening again should fail */ + Okay = CheckListenPipe(&ListenContext, ServerHandle, 100); + ok_bool_true(Okay, "CheckListenPipe returned"); + ok_eq_hex(ListenContext.Listen.Status, STATUS_PIPE_CONNECTED); + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /* Disconnect server */ + Status = NpDisconnectPipe(ServerHandle); + ok_eq_hex(Status, STATUS_SUCCESS); + NpQueryPipe(ClientHandle, STATUS_PIPE_DISCONNECTED); + CheckServer(ServerHandle, FILE_PIPE_DISCONNECTED_STATE); + + /* Close client */ + if (ClientHandle) + ObCloseHandle(ClientHandle, KernelMode); + CheckServer(ServerHandle, FILE_PIPE_DISCONNECTED_STATE); + + /**************************************************************************/ + /* Listen once more */ + Okay = CheckListenPipe(&ListenContext, ServerHandle, 100); + ok_bool_false(Okay, "CheckListenPipe returned"); + //blocks: CheckServer(ServerHandle, FILE_PIPE_LISTENING_STATE); + + /* Connect client */ + ClientHandle = NULL; + Okay = CheckConnectPipe(&ConnectContext, PipePath, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_SUCCESS); + if (NT_SUCCESS(ConnectContext.Connect.Status)) + { + ClientHandle = ConnectContext.Connect.ClientHandle; + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + } + Okay = WaitForWork(&ListenContext, 100); + ok_bool_true(Okay, "WaitForWork returned"); + ok_eq_hex(ListenContext.Listen.Status, STATUS_SUCCESS); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /* Close server */ + Status = ObCloseHandle(ServerHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + CheckClient(ClientHandle, FILE_PIPE_CLOSING_STATE); + + /* Close client */ + if (ClientHandle) + ObCloseHandle(ClientHandle, KernelMode); + + FinishWorkerThread(&ListenContext); + FinishWorkerThread(&ConnectContext); +} + +static KSTART_ROUTINE RunTest; +static +VOID +NTAPI +RunTest( + IN PVOID Context) +{ + NTSTATUS Status; + HANDLE ServerHandle; + + UNREFERENCED_PARAMETER(Context); + + ServerHandle = INVALID_HANDLE_VALUE; + Status = NpCreatePipe(&ServerHandle, + DEVICE_NAMED_PIPE L"\\KmtestNpfsConnectTestPipe", + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, + MAX_INSTANCES, + IN_QUOTA, + OUT_QUOTA); + ok_eq_hex(Status, STATUS_SUCCESS); + ok(ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE, "ServerHandle = %p\n", ServerHandle); + if (!skip(NT_SUCCESS(Status) && ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE, "No pipe\n")) + { + CheckServer(ServerHandle, FILE_PIPE_LISTENING_STATE); + TestConnect(ServerHandle, DEVICE_NAMED_PIPE L"\\KmtestNpfsConnectTestPipe"); + } +} + +START_TEST(NpfsConnect) +{ + PKTHREAD Thread; + + Thread = KmtStartThread(RunTest, NULL); + KmtFinishThread(Thread, NULL); +} diff --git a/rostests/kmtests/npfs/NpfsCreate.c b/rostests/kmtests/npfs/NpfsCreate.c new file mode 100644 index 00000000000..1c104cae2f6 --- /dev/null +++ b/rostests/kmtests/npfs/NpfsCreate.c @@ -0,0 +1,118 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory + * PURPOSE: Kernel-Mode Test Suite NPFS Create test + * PROGRAMMER: Thomas Faber + */ + +#include +#include "npfs.h" + +static +VOID +TestCreateNamedPipe(VOID) +{ + NTSTATUS Status; + HANDLE ServerHandle; + ULONG MaxInstances; + ULONG InQuota, OutQuota; + ULONG Quotas[] = { 0, 1, 2, 1024, PAGE_SIZE - 1, PAGE_SIZE, PAGE_SIZE + 1, 2 * PAGE_SIZE, 8 * PAGE_SIZE, 64 * PAGE_SIZE, 64 * PAGE_SIZE + 1, 128 * PAGE_SIZE }; + ULONG i; + LARGE_INTEGER Timeout; + + /* Invalid pipe name */ + MaxInstances = 1; + InQuota = 4096; + OutQuota = 4096; + ServerHandle = INVALID_HANDLE_VALUE; + Status = NpCreatePipe(&ServerHandle, + DEVICE_NAMED_PIPE L"", + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, + MaxInstances, + InQuota, + OutQuota); + ok_eq_hex(Status, STATUS_OBJECT_NAME_INVALID); + ok_eq_pointer(ServerHandle, INVALID_HANDLE_VALUE); + if (ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE) + ObCloseHandle(ServerHandle, KernelMode); + + ServerHandle = INVALID_HANDLE_VALUE; + Status = NpCreatePipe(&ServerHandle, + DEVICE_NAMED_PIPE L"\\", + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, + MaxInstances, + InQuota, + OutQuota); + ok_eq_hex(Status, STATUS_OBJECT_NAME_INVALID); + ok_eq_pointer(ServerHandle, INVALID_HANDLE_VALUE); + if (ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE) + ObCloseHandle(ServerHandle, KernelMode); + + ServerHandle = INVALID_HANDLE_VALUE; + Status = NpCreatePipe(&ServerHandle, + DEVICE_NAMED_PIPE L"\\\\", + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, + MaxInstances, + InQuota, + OutQuota); + ok_eq_hex(Status, STATUS_OBJECT_NAME_INVALID); + ok_eq_pointer(ServerHandle, INVALID_HANDLE_VALUE); + if (ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE) + ObCloseHandle(ServerHandle, KernelMode); + + /* Test in-quota */ + MaxInstances = 1; + OutQuota = 4096; + for (i = 0; i < RTL_NUMBER_OF(Quotas); i++) + { + InQuota = Quotas[i]; + ServerHandle = INVALID_HANDLE_VALUE; + Status = NpCreatePipe(&ServerHandle, + DEVICE_NAMED_PIPE L"\\KmtestNpfsCreateTestPipe", + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, + MaxInstances, + InQuota, + OutQuota); + ok_eq_hex(Status, STATUS_SUCCESS); + ok(ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE, "ServerHandle = %p\n", ServerHandle); + if (!skip(NT_SUCCESS(Status) && ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE, "No pipe\n")) + { + NpCheckServerPipe(ServerHandle, + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, + MaxInstances, 1, + InQuota, 0, + OutQuota, OutQuota, + FILE_PIPE_LISTENING_STATE); + ObCloseHandle(ServerHandle, KernelMode); + Timeout.QuadPart = -100 * 1000 * 10; + Status = KeDelayExecutionThread(KernelMode, FALSE, &Timeout); + ok_eq_hex(Status, STATUS_SUCCESS); + } + } +} + +static +VOID +TestCreate(VOID) +{ +} + +static KSTART_ROUTINE RunTest; +static +VOID +NTAPI +RunTest( + IN PVOID Context) +{ + UNREFERENCED_PARAMETER(Context); + TestCreateNamedPipe(); + TestCreate(); +} + +START_TEST(NpfsCreate) +{ + PKTHREAD Thread; + + Thread = KmtStartThread(RunTest, NULL); + KmtFinishThread(Thread, NULL); +} diff --git a/rostests/kmtests/npfs/NpfsHelpers.c b/rostests/kmtests/npfs/NpfsHelpers.c new file mode 100644 index 00000000000..f81c61a6309 --- /dev/null +++ b/rostests/kmtests/npfs/NpfsHelpers.c @@ -0,0 +1,774 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory + * PURPOSE: Kernel-Mode Test Suite Helper functions for NPFS tests + * PROGRAMMER: Thomas Faber + */ + +#include +#include "npfs.h" + +NTSTATUS +NpCreatePipeEx( + OUT PHANDLE ServerHandle, + IN PCWSTR PipePath, + IN ULONG ReadMode, + IN ULONG CompletionMode, + IN ULONG NamedPipeType, + IN ULONG ShareAccess, + IN ULONG MaximumInstances, + IN ULONG InboundQuota, + IN ULONG OutboundQuota, + IN ACCESS_MASK DesiredAccess, + IN ULONG Disposition, + IN ULONG CreateOptions, + IN PLARGE_INTEGER DefaultTimeout OPTIONAL) +{ + UNICODE_STRING ObjectName; + OBJECT_ATTRIBUTES ObjectAttributes; + NAMED_PIPE_CREATE_PARAMETERS Params; + IO_STATUS_BLOCK IoStatusBlock; + NTSTATUS Status; + + RtlInitUnicodeString(&ObjectName, PipePath); + InitializeObjectAttributes(&ObjectAttributes, + &ObjectName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + NULL, + NULL); + + Params.NamedPipeType = NamedPipeType; + Params.ReadMode = ReadMode; + Params.CompletionMode = CompletionMode; + Params.MaximumInstances = MaximumInstances; + Params.InboundQuota = InboundQuota; + Params.OutboundQuota = OutboundQuota; + if (DefaultTimeout) + { + Params.DefaultTimeout.QuadPart = DefaultTimeout->QuadPart; + Params.TimeoutSpecified = TRUE; + } + else + { + Params.DefaultTimeout.QuadPart = 0; + Params.TimeoutSpecified = FALSE; + } + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + Status = IoCreateFile(ServerHandle, + DesiredAccess, + &ObjectAttributes, + &IoStatusBlock, + NULL, /* AllocationSize */ + 0, /* FileAttributes */ + ShareAccess, + Disposition, + CreateOptions, + NULL, /* EaBuffer */ + 0, /* EaLength */ + CreateFileTypeNamedPipe, + &Params, + 0); + if (NT_SUCCESS(Status)) + { + ok_eq_hex(IoStatusBlock.Status, Status); + ok_eq_ulongptr(IoStatusBlock.Information, FILE_CREATED); + } + else + { + ok_eq_hex(IoStatusBlock.Status, 0x55555555UL); + ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL); + } + return Status; +} + +NTSTATUS +NpCreatePipe( + OUT PHANDLE ServerHandle, + PCWSTR PipePath, + ULONG ReadMode, + ULONG CompletionMode, + ULONG NamedPipeType, + ULONG NamedPipeConfiguration, + ULONG MaximumInstances, + ULONG InboundQuota, + ULONG OutboundQuota) +{ + ULONG ShareAccess; + LARGE_INTEGER DefaultTimeout; + + if (NamedPipeConfiguration == FILE_PIPE_INBOUND) + ShareAccess = FILE_SHARE_WRITE; + else if (NamedPipeConfiguration == FILE_PIPE_OUTBOUND) + ShareAccess = FILE_SHARE_READ; + else if (NamedPipeConfiguration == FILE_PIPE_FULL_DUPLEX) + ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE; + + DefaultTimeout.QuadPart = -50 * 1000 * 10; + + return NpCreatePipeEx(ServerHandle, + PipePath, + ReadMode, + CompletionMode, + NamedPipeType, + ShareAccess, + MaximumInstances, + InboundQuota, + OutboundQuota, + SYNCHRONIZE | GENERIC_READ | GENERIC_WRITE, + FILE_OPEN_IF, + FILE_SYNCHRONOUS_IO_NONALERT, + &DefaultTimeout); +} + +NTSTATUS +NpOpenPipeEx( + OUT PHANDLE ClientHandle, + IN PCWSTR PipePath, + IN ACCESS_MASK DesiredAccess, + IN ULONG ShareAccess, + IN ULONG Disposition, + IN ULONG CreateOptions) +{ + UNICODE_STRING ObjectName; + OBJECT_ATTRIBUTES ObjectAttributes; + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + + RtlInitUnicodeString(&ObjectName, PipePath); + InitializeObjectAttributes(&ObjectAttributes, + &ObjectName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + NULL, + NULL); + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + Status = IoCreateFile(ClientHandle, + DesiredAccess, + &ObjectAttributes, + &IoStatusBlock, + NULL, /* AllocationSize */ + 0, /* FileAttributes */ + ShareAccess, + Disposition, + CreateOptions, + NULL, /* EaBuffer */ + 0, /* EaLength */ + CreateFileTypeNone, + NULL, + 0); + if (NT_SUCCESS(Status)) + { + ok(Status != STATUS_PENDING, "IoCreateFile returned pending\n"); + ok_eq_hex(IoStatusBlock.Status, Status); + ok_eq_ulongptr(IoStatusBlock.Information, FILE_OPENED); + } + else + { + ok_eq_hex(IoStatusBlock.Status, 0x55555555UL); + ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL); + } + return Status; +} + +NTSTATUS +NpOpenPipe( + OUT PHANDLE ClientHandle, + IN PCWSTR PipePath, + IN ULONG NamedPipeConfiguration) +{ + ULONG ShareAccess; + + if (NamedPipeConfiguration == FILE_PIPE_INBOUND) + ShareAccess = FILE_SHARE_WRITE; + else if (NamedPipeConfiguration == FILE_PIPE_OUTBOUND) + ShareAccess = FILE_SHARE_READ; + else if (NamedPipeConfiguration == FILE_PIPE_FULL_DUPLEX) + ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE; + + return NpOpenPipeEx(ClientHandle, + PipePath, + SYNCHRONIZE | GENERIC_READ | GENERIC_WRITE, + ShareAccess, + FILE_OPEN, + FILE_SYNCHRONOUS_IO_NONALERT); +} + +NTSTATUS +NpControlPipe( + IN HANDLE ServerHandle, + IN ULONG FsControlCode, + IN PVOID InputBuffer, + IN ULONG InputBufferLength) +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + Status = ZwFsControlFile(ServerHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + FsControlCode, + InputBuffer, + InputBufferLength, + NULL, + 0); + if (Status == STATUS_PENDING) + { + Status = ZwWaitForSingleObject(ServerHandle, + FALSE, + NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + Status = IoStatusBlock.Status; + } + if (NT_SUCCESS(Status)) + { + ok_eq_hex(IoStatusBlock.Status, Status); + ok_eq_ulongptr(IoStatusBlock.Information, 0); + } + else + { + ok_eq_hex(IoStatusBlock.Status, 0x55555555UL); + ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL); + } + return Status; +} + +NTSTATUS +NpWaitPipe( + IN PCWSTR PipeName, + IN PLARGE_INTEGER Timeout) +{ + NTSTATUS Status; + HANDLE RootHandle; + UNICODE_STRING RootDirectoryName = RTL_CONSTANT_STRING(DEVICE_NAMED_PIPE); + OBJECT_ATTRIBUTES ObjectAttributes; + IO_STATUS_BLOCK IoStatusBlock; + PFILE_PIPE_WAIT_FOR_BUFFER WaitForBuffer; + ULONG NameLength; + ULONG BufferSize; + + InitializeObjectAttributes(&ObjectAttributes, + &RootDirectoryName, + OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, + NULL, + NULL); + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + Status = IoCreateFile(&RootHandle, + FILE_READ_ATTRIBUTES | SYNCHRONIZE, + &ObjectAttributes, + &IoStatusBlock, + NULL, + 0, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_OPEN, + FILE_SYNCHRONOUS_IO_NONALERT, + NULL, + 0, + CreateFileTypeNone, + NULL, + 0); + if (!NT_SUCCESS(Status)) + { + ok_eq_hex(IoStatusBlock.Status, 0x55555555UL); + ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL); + return Status; + } + ok(Status != STATUS_PENDING, "IoCreateFile returned pending\n"); + ok_eq_hex(IoStatusBlock.Status, Status); + ok_eq_ulongptr(IoStatusBlock.Information, FILE_OPENED); + + NameLength = wcslen(PipeName) * sizeof(WCHAR); + BufferSize = FIELD_OFFSET(FILE_PIPE_WAIT_FOR_BUFFER, + Name[NameLength / sizeof(WCHAR)]); + WaitForBuffer = ExAllocatePoolWithTag(NonPagedPool, BufferSize, 'WPmK'); + if (WaitForBuffer == NULL) + return STATUS_INSUFFICIENT_RESOURCES; + + if (Timeout) + { + WaitForBuffer->Timeout.QuadPart = Timeout->QuadPart; + WaitForBuffer->TimeoutSpecified = TRUE; + } + else + { + WaitForBuffer->Timeout.QuadPart = 0; + WaitForBuffer->TimeoutSpecified = FALSE; + } + WaitForBuffer->NameLength = NameLength; + RtlCopyMemory(WaitForBuffer->Name, PipeName, NameLength); + Status = NpControlPipe(RootHandle, + FSCTL_PIPE_WAIT, + WaitForBuffer, + BufferSize); + ExFreePoolWithTag(WaitForBuffer, 'WPmK'); + return Status; +} + +NTSTATUS +NpReadPipe( + IN HANDLE PipeHandle, + OUT PVOID Buffer, + IN ULONG BufferSize, + OUT PULONG_PTR BytesRead) +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + BOOLEAN PendingReturned = FALSE; + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + Status = ZwReadFile(PipeHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + Buffer, + BufferSize, + NULL, + NULL); + if (Status == STATUS_PENDING) + { + Status = ZwWaitForSingleObject(PipeHandle, + FALSE, + NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + Status = IoStatusBlock.Status; + PendingReturned = TRUE; + } + if (NT_SUCCESS(Status)) + { + ok_eq_hex(IoStatusBlock.Status, Status); + *BytesRead = IoStatusBlock.Information; + } + else + { + if (PendingReturned) + { + ok_eq_hex(IoStatusBlock.Status, Status); + ok_eq_ulongptr(IoStatusBlock.Information, 0); + } + else + { + ok_eq_hex(IoStatusBlock.Status, 0x55555555UL); + ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL); + } + *BytesRead = 0; + } + return Status; +} + +NTSTATUS +NpWritePipe( + IN HANDLE PipeHandle, + IN const VOID *Buffer, + IN ULONG BufferSize, + OUT PULONG_PTR BytesWritten) +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + Status = ZwWriteFile(PipeHandle, + NULL, + NULL, + NULL, + &IoStatusBlock, + (PVOID)Buffer, + BufferSize, + NULL, + NULL); + if (Status == STATUS_PENDING) + { + Status = ZwWaitForSingleObject(PipeHandle, + FALSE, + NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + Status = IoStatusBlock.Status; + } + if (NT_SUCCESS(Status)) + { + ok_eq_hex(IoStatusBlock.Status, Status); + *BytesWritten = IoStatusBlock.Information; + } + else + { + ok_eq_hex(IoStatusBlock.Status, 0x55555555UL); + ok_eq_ulongptr(IoStatusBlock.Information, 0x5555555555555555ULL); + *BytesWritten = 0; + } + return Status; +} + +static +BOOLEAN +CheckBuffer( + PVOID Buffer, + SIZE_T Size, + UCHAR Value) +{ + PUCHAR Array = Buffer; + SIZE_T i; + + for (i = 0; i < Size; i++) + if (Array[i] != Value) + { + trace("Expected %x, found %x at offset %lu\n", Value, Array[i], (ULONG)i); + return FALSE; + } + return TRUE; +} + +#define ok_eq_print_(value, expected, spec, FileAndLine) \ + KmtOk((value) == (expected), FileAndLine, #value " = " spec ", expected " spec "\n", value, expected) +#define ok_eq_ulong_(value, expected) ok_eq_print_(value, expected, "%lu", FileAndLine) +#define ok_eq_ulonglong_(value, expected) ok_eq_print_(value, expected, "%I64u", FileAndLine) +#ifndef _WIN64 +#define ok_eq_ulongptr_(value, expected) ok_eq_print_(value, (ULONG_PTR)(expected), "%lu", FileAndLine) +#elif defined _WIN64 +#define ok_eq_ulongptr_(value, expected) ok_eq_print_(value, (ULONG_PTR)(expected), "%I64u", FileAndLine) +#endif +#define ok_eq_hex_(value, expected) ok_eq_print_(value, expected, "0x%08lx", FileAndLine) + +VOID +NpCheckServerPipe_( + IN HANDLE ServerHandle, + /* PipeInformation */ + IN ULONG ReadMode, + IN ULONG CompletionMode, + /* PipeLocalInformation */ + IN ULONG NamedPipeType, + IN ULONG NamedPipeConfiguration, + IN ULONG MaximumInstances, + IN ULONG CurrentInstances, + IN ULONG InboundQuota, + IN ULONG ReadDataAvailable, + IN ULONG OutboundQuota, + IN ULONG WriteQuotaAvailable, + IN ULONG NamedPipeState, + /* PipeRemoteInformation */ + /* */ + IN PCSTR FileAndLine) +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + FILE_PIPE_INFORMATION PipeInfo; + FILE_PIPE_LOCAL_INFORMATION PipeLocalInfo; + FILE_PIPE_REMOTE_INFORMATION PipeRemoteInfo; + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + RtlFillMemory(&PipeInfo, sizeof(PipeInfo), 0x55); + Status = ZwQueryInformationFile(ServerHandle, + &IoStatusBlock, + &PipeInfo, + sizeof(PipeInfo), + FilePipeInformation); + ok_eq_hex_(Status, STATUS_SUCCESS); + ok_eq_hex_(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_ulongptr_(IoStatusBlock.Information, sizeof(PipeInfo)); + ok_eq_ulong_(PipeInfo.ReadMode, ReadMode); + ok_eq_ulong_(PipeInfo.CompletionMode, CompletionMode); + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + RtlFillMemory(&PipeLocalInfo, sizeof(PipeLocalInfo), 0x55); + Status = ZwQueryInformationFile(ServerHandle, + &IoStatusBlock, + &PipeLocalInfo, + sizeof(PipeLocalInfo), + FilePipeLocalInformation); + ok_eq_hex_(Status, STATUS_SUCCESS); + ok_eq_hex_(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_ulongptr_(IoStatusBlock.Information, sizeof(PipeLocalInfo)); + ok_eq_ulong_(PipeLocalInfo.NamedPipeType, NamedPipeType); + ok_eq_ulong_(PipeLocalInfo.NamedPipeConfiguration, NamedPipeConfiguration); + ok_eq_ulong_(PipeLocalInfo.MaximumInstances, MaximumInstances); + ok_eq_ulong_(PipeLocalInfo.CurrentInstances, CurrentInstances); + ok_eq_ulong_(PipeLocalInfo.InboundQuota, InboundQuota); + ok_eq_ulong_(PipeLocalInfo.ReadDataAvailable, ReadDataAvailable); + ok_eq_ulong_(PipeLocalInfo.OutboundQuota, OutboundQuota); + ok_eq_ulong_(PipeLocalInfo.WriteQuotaAvailable, WriteQuotaAvailable); + ok_eq_ulong_(PipeLocalInfo.NamedPipeState, NamedPipeState); + ok_eq_ulong_(PipeLocalInfo.NamedPipeEnd, (ULONG)FILE_PIPE_SERVER_END); + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + RtlFillMemory(&PipeRemoteInfo, sizeof(PipeRemoteInfo), 0x55); + Status = ZwQueryInformationFile(ServerHandle, + &IoStatusBlock, + &PipeRemoteInfo, + sizeof(PipeRemoteInfo), + FilePipeInformation); + ok_eq_hex_(Status, STATUS_SUCCESS); + ok_eq_hex_(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_ulongptr_(IoStatusBlock.Information, RTL_SIZEOF_THROUGH_FIELD(FILE_PIPE_REMOTE_INFORMATION, CollectDataTime)); + ok_eq_ulonglong_(PipeRemoteInfo.CollectDataTime.QuadPart, 0ULL); + ok_eq_ulong_(PipeRemoteInfo.MaximumCollectionCount, 0x55555555UL); +} + +VOID +NpCheckClientPipe_( + IN HANDLE ClientHandle, + /* PipeInformation */ + IN ULONG ReadMode, + IN ULONG CompletionMode, + /* PipeLocalInformation */ + IN ULONG NamedPipeType, + IN ULONG NamedPipeConfiguration, + IN ULONG MaximumInstances, + IN ULONG CurrentInstances, + IN ULONG InboundQuota, + IN ULONG ReadDataAvailable, + IN ULONG OutboundQuota, + IN ULONG WriteQuotaAvailable, + IN ULONG NamedPipeState, + /* PipeRemoteInformation */ + /* */ + IN PCSTR FileAndLine) +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + FILE_PIPE_INFORMATION PipeInfo; + FILE_PIPE_LOCAL_INFORMATION PipeLocalInfo; + FILE_PIPE_REMOTE_INFORMATION PipeRemoteInfo; + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + RtlFillMemory(&PipeInfo, sizeof(PipeInfo), 0x55); + Status = ZwQueryInformationFile(ClientHandle, + &IoStatusBlock, + &PipeInfo, + sizeof(PipeInfo), + FilePipeInformation); + ok_eq_hex_(Status, STATUS_SUCCESS); + ok_eq_hex_(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_ulongptr_(IoStatusBlock.Information, sizeof(PipeInfo)); + ok_eq_ulong_(PipeInfo.ReadMode, ReadMode); + ok_eq_ulong_(PipeInfo.CompletionMode, CompletionMode); + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + RtlFillMemory(&PipeLocalInfo, sizeof(PipeLocalInfo), 0x55); + Status = ZwQueryInformationFile(ClientHandle, + &IoStatusBlock, + &PipeLocalInfo, + sizeof(PipeLocalInfo), + FilePipeLocalInformation); + ok_eq_hex_(Status, STATUS_SUCCESS); + ok_eq_hex_(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_ulongptr_(IoStatusBlock.Information, sizeof(PipeLocalInfo)); + ok_eq_ulong_(PipeLocalInfo.NamedPipeType, NamedPipeType); + ok_eq_ulong_(PipeLocalInfo.NamedPipeConfiguration, NamedPipeConfiguration); + ok_eq_ulong_(PipeLocalInfo.MaximumInstances, MaximumInstances); + ok_eq_ulong_(PipeLocalInfo.CurrentInstances, CurrentInstances); + ok_eq_ulong_(PipeLocalInfo.InboundQuota, InboundQuota); + ok_eq_ulong_(PipeLocalInfo.ReadDataAvailable, ReadDataAvailable); + ok_eq_ulong_(PipeLocalInfo.OutboundQuota, OutboundQuota); + ok_eq_ulong_(PipeLocalInfo.WriteQuotaAvailable, WriteQuotaAvailable); + ok_eq_ulong_(PipeLocalInfo.NamedPipeState, NamedPipeState); + ok_eq_ulong_(PipeLocalInfo.NamedPipeEnd, (ULONG)FILE_PIPE_CLIENT_END); + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + RtlFillMemory(&PipeRemoteInfo, sizeof(PipeRemoteInfo), 0x55); + Status = ZwQueryInformationFile(ClientHandle, + &IoStatusBlock, + &PipeRemoteInfo, + sizeof(PipeRemoteInfo), + FilePipeInformation); + ok_eq_hex_(Status, STATUS_SUCCESS); + ok_eq_hex_(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_ulongptr_(IoStatusBlock.Information, RTL_SIZEOF_THROUGH_FIELD(FILE_PIPE_REMOTE_INFORMATION, CollectDataTime)); + ok_eq_ulonglong_(PipeRemoteInfo.CollectDataTime.QuadPart, 0ULL); + ok_eq_ulong_(PipeRemoteInfo.MaximumCollectionCount, 0x55555555UL); +} + +VOID +NpQueryPipe_( + IN HANDLE PipeHandle, + IN NTSTATUS ExpectedStatus, + IN PCSTR FileAndLine) +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + FILE_PIPE_INFORMATION PipeInfo; + FILE_PIPE_LOCAL_INFORMATION PipeLocalInfo; + FILE_PIPE_REMOTE_INFORMATION PipeRemoteInfo; + + ASSERT(!NT_SUCCESS(ExpectedStatus)); + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + RtlFillMemory(&PipeInfo, sizeof(PipeInfo), 0x55); + Status = ZwQueryInformationFile(PipeHandle, + &IoStatusBlock, + &PipeInfo, + sizeof(PipeInfo), + FilePipeInformation); + ok_eq_hex_(Status, ExpectedStatus); + ok_bool_true(CheckBuffer(&IoStatusBlock, sizeof(IoStatusBlock), 0x55), "CheckBuffer returned"); + ok_bool_true(CheckBuffer(&PipeInfo, sizeof(PipeInfo), 0x55), "CheckBuffer returned"); + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + RtlFillMemory(&PipeLocalInfo, sizeof(PipeLocalInfo), 0x55); + Status = ZwQueryInformationFile(PipeHandle, + &IoStatusBlock, + &PipeLocalInfo, + sizeof(PipeLocalInfo), + FilePipeLocalInformation); + ok_eq_hex_(Status, ExpectedStatus); + ok_bool_true(CheckBuffer(&IoStatusBlock, sizeof(IoStatusBlock), 0x55), "CheckBuffer returned"); + ok_bool_true(CheckBuffer(&PipeLocalInfo, sizeof(PipeLocalInfo), 0x55), "CheckBuffer returned"); + + RtlFillMemory(&IoStatusBlock, sizeof(IoStatusBlock), 0x55); + RtlFillMemory(&PipeRemoteInfo, sizeof(PipeRemoteInfo), 0x55); + Status = ZwQueryInformationFile(PipeHandle, + &IoStatusBlock, + &PipeRemoteInfo, + sizeof(PipeRemoteInfo), + FilePipeInformation); + ok_eq_hex_(Status, ExpectedStatus); + ok_bool_true(CheckBuffer(&IoStatusBlock, sizeof(IoStatusBlock), 0x55), "CheckBuffer returned"); + ok_bool_true(CheckBuffer(&PipeRemoteInfo, sizeof(PipeRemoteInfo), 0x55), "CheckBuffer returned"); +} + +static KSTART_ROUTINE PipeWorkerThread; +static +VOID +NTAPI +PipeWorkerThread( + IN PVOID ThreadContext) +{ + PTHREAD_CONTEXT Context = ThreadContext; + PVOID WaitEvents[2] = { &Context->ThreadDoneEvent, + &Context->StartWorkEvent }; + NTSTATUS Status; + + while (TRUE) + { + Status = KeWaitForMultipleObjects(RTL_NUMBER_OF(WaitEvents), + WaitEvents, + WaitAny, + Executive, + KernelMode, + FALSE, + NULL, + NULL); + if (Status == STATUS_WAIT_0) + break; + ASSERT(Status == STATUS_WAIT_1); + + Context->Work(Context); + + KeSetEvent(&Context->WorkCompleteEvent, IO_NO_INCREMENT, TRUE); + } +} + +VOID +StartWorkerThread( + OUT PTHREAD_CONTEXT Context) +{ + KeInitializeEvent(&Context->ThreadDoneEvent, NotificationEvent, FALSE); + KeInitializeEvent(&Context->StartWorkEvent, SynchronizationEvent, FALSE); + KeInitializeEvent(&Context->WorkCompleteEvent, NotificationEvent, TRUE); + + Context->Thread = KmtStartThread(PipeWorkerThread, Context); +} + +VOID +FinishWorkerThread( + IN PTHREAD_CONTEXT Context) +{ + KmtFinishThread(Context->Thread, &Context->ThreadDoneEvent); +} + +BOOLEAN +WaitForWork( + IN PTHREAD_CONTEXT Context, + IN ULONG MilliSeconds) +{ + LARGE_INTEGER Timeout; + NTSTATUS Status; + + Timeout.QuadPart = -10 * 1000 * (LONGLONG)MilliSeconds; + Status = KeWaitForSingleObject(&Context->WorkCompleteEvent, + Executive, + KernelMode, + FALSE, + &Timeout); + ok(Status == STATUS_SUCCESS || Status == STATUS_TIMEOUT, "Wait status %lx\n", Status); + return Status != STATUS_TIMEOUT; +} + +BOOLEAN +TriggerWork( + IN PTHREAD_CONTEXT Context, + IN ULONG MilliSeconds) +{ + NTSTATUS Status; + + Status = KeWaitForSingleObject(&Context->WorkCompleteEvent, + Executive, + KernelMode, + FALSE, + NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + KeResetEvent(&Context->WorkCompleteEvent); + KeSetEvent(&Context->StartWorkEvent, IO_NO_INCREMENT, TRUE); + return WaitForWork(Context, MilliSeconds); +} + +PKTHREAD +KmtStartThread( + IN PKSTART_ROUTINE StartRoutine, + IN PVOID StartContext OPTIONAL) +{ + NTSTATUS Status; + OBJECT_ATTRIBUTES ObjectAttributes; + HANDLE ThreadHandle; + PVOID ThreadObject = NULL; + + InitializeObjectAttributes(&ObjectAttributes, + NULL, + OBJ_KERNEL_HANDLE, + NULL, + NULL); + ThreadHandle = INVALID_HANDLE_VALUE; + Status = PsCreateSystemThread(&ThreadHandle, + SYNCHRONIZE, + &ObjectAttributes, + NULL, + NULL, + StartRoutine, + StartContext); + ok_eq_hex(Status, STATUS_SUCCESS); + if (!skip(NT_SUCCESS(Status) && ThreadHandle != NULL && ThreadHandle != INVALID_HANDLE_VALUE, "No thread\n")) + { + Status = ObReferenceObjectByHandle(ThreadHandle, + SYNCHRONIZE, + PsThreadType, + KernelMode, + &ThreadObject, + NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + ObCloseHandle(ThreadHandle, KernelMode); + } + return ThreadObject; +} + +VOID +KmtFinishThread( + IN PKTHREAD Thread OPTIONAL, + IN PKEVENT Event OPTIONAL) +{ + NTSTATUS Status; + + if (skip(Thread != NULL, "No thread\n")) + return; + + if (Event) + KeSetEvent(Event, IO_NO_INCREMENT, TRUE); + Status = KeWaitForSingleObject(Thread, + Executive, + KernelMode, + FALSE, + NULL); + ok_eq_hex(Status, STATUS_SUCCESS); + ObDereferenceObject(Thread); +} diff --git a/rostests/kmtests/npfs/NpfsReadWrite.c b/rostests/kmtests/npfs/NpfsReadWrite.c new file mode 100644 index 00000000000..bfbd0096128 --- /dev/null +++ b/rostests/kmtests/npfs/NpfsReadWrite.c @@ -0,0 +1,598 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory + * PURPOSE: Kernel-Mode Test Suite NPFS Read/Write test + * PROGRAMMER: Thomas Faber + */ + +#include +#include "npfs.h" + +typedef struct _READ_WRITE_TEST_CONTEXT +{ + PCWSTR PipePath; + BOOLEAN ServerSynchronous; + BOOLEAN ClientSynchronous; +} READ_WRITE_TEST_CONTEXT, *PREAD_WRITE_TEST_CONTEXT; + +#define MAX_INSTANCES 5 +#define IN_QUOTA 4096 +#define OUT_QUOTA 4096 + +#define MakeServer(ServerHandle, PipePath, ServerSynchronous) \ + NpCreatePipeEx(ServerHandle, \ + PipePath, \ + BYTE_STREAM, \ + QUEUE, \ + BYTE_STREAM, \ + FILE_SHARE_READ | FILE_SHARE_WRITE, \ + MAX_INSTANCES, \ + IN_QUOTA, \ + OUT_QUOTA, \ + SYNCHRONIZE | GENERIC_READ | GENERIC_WRITE, \ + FILE_OPEN_IF, \ + (ServerSynchronous) ? FILE_SYNCHRONOUS_IO_NONALERT \ + : 0, \ + &DefaultTimeout) + +#define CheckServer(ServerHandle, State) \ + NpCheckServerPipe(ServerHandle, \ + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, \ + MAX_INSTANCES, 1, \ + IN_QUOTA, 0, \ + OUT_QUOTA, OUT_QUOTA, \ + State) + +#define CheckClient(ClientHandle, State) \ + NpCheckClientPipe(ClientHandle, \ + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, \ + MAX_INSTANCES, 1, \ + IN_QUOTA, 0, \ + OUT_QUOTA, OUT_QUOTA, \ + State) + +#define CheckServerQuota(ServerHandle, InQ, OutQ) \ + NpCheckServerPipe(ServerHandle, \ + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, \ + MAX_INSTANCES, 1, \ + IN_QUOTA, InQ, \ + OUT_QUOTA, OUT_QUOTA - (OutQ), \ + FILE_PIPE_CONNECTED_STATE) + +#define CheckClientQuota(ClientHandle, InQ, OutQ) \ + NpCheckClientPipe(ClientHandle, \ + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, \ + MAX_INSTANCES, 1, \ + IN_QUOTA, InQ, \ + OUT_QUOTA, OUT_QUOTA - (OutQ), \ + FILE_PIPE_CONNECTED_STATE) + +#define CheckPipeContext(Context, ExpectedStatus, ExpectedBytes) do \ +{ \ + ok_bool_true(Okay, "CheckPipeContext"); \ + ok_eq_hex((Context)->ReadWrite.Status, ExpectedStatus); \ + ok_eq_ulongptr((Context)->ReadWrite.BytesTransferred, ExpectedBytes); \ +} while (0) + +static +VOID +ConnectPipe( + IN OUT PTHREAD_CONTEXT Context) +{ + HANDLE ClientHandle; + + ClientHandle = NULL; + Context->Connect.Status = NpOpenPipeEx(&ClientHandle, + Context->Connect.PipePath, + SYNCHRONIZE | GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, + FILE_OPEN, + Context->Connect.ClientSynchronous ? FILE_SYNCHRONOUS_IO_NONALERT + : 0); + Context->Connect.ClientHandle = ClientHandle; +} + +static +VOID +ListenPipe( + IN OUT PTHREAD_CONTEXT Context) +{ + Context->Listen.Status = NpListenPipe(Context->Listen.ServerHandle); +} + +static +VOID +ReadPipe( + IN OUT PTHREAD_CONTEXT Context) +{ + Context->ReadWrite.Status = NpReadPipe(Context->ReadWrite.PipeHandle, + Context->ReadWrite.Buffer, + Context->ReadWrite.BufferSize, + (PULONG_PTR)&Context->ReadWrite.BytesTransferred); +} + +static +VOID +WritePipe( + IN OUT PTHREAD_CONTEXT Context) +{ + Context->ReadWrite.Status = NpWritePipe(Context->ReadWrite.PipeHandle, + Context->ReadWrite.Buffer, + Context->ReadWrite.BufferSize, + (PULONG_PTR)&Context->ReadWrite.BytesTransferred); +} + +static +BOOLEAN +CheckConnectPipe( + IN PTHREAD_CONTEXT Context, + IN PCWSTR PipePath, + IN BOOLEAN ClientSynchronous, + IN ULONG MilliSeconds) +{ + Context->Work = ConnectPipe; + Context->Connect.PipePath = PipePath; + Context->Connect.ClientSynchronous = ClientSynchronous; + return TriggerWork(Context, MilliSeconds); +} + +static +BOOLEAN +CheckListenPipe( + IN PTHREAD_CONTEXT Context, + IN HANDLE ServerHandle, + IN ULONG MilliSeconds) +{ + Context->Work = ListenPipe; + Context->Listen.ServerHandle = ServerHandle; + return TriggerWork(Context, MilliSeconds); +} + +static +BOOLEAN +CheckReadPipe( + IN PTHREAD_CONTEXT Context, + IN HANDLE PipeHandle, + OUT PVOID Buffer, + IN ULONG BufferSize, + IN ULONG MilliSeconds) +{ + Context->Work = ReadPipe; + Context->ReadWrite.PipeHandle = PipeHandle; + Context->ReadWrite.Buffer = Buffer; + Context->ReadWrite.BufferSize = BufferSize; + return TriggerWork(Context, MilliSeconds); +} + +static +BOOLEAN +CheckWritePipe( + IN PTHREAD_CONTEXT Context, + IN HANDLE PipeHandle, + IN const VOID *Buffer, + IN ULONG BufferSize, + IN ULONG MilliSeconds) +{ + Context->Work = WritePipe; + Context->ReadWrite.PipeHandle = PipeHandle; + Context->ReadWrite.Buffer = (PVOID)Buffer; + Context->ReadWrite.BufferSize = BufferSize; + return TriggerWork(Context, MilliSeconds); +} + +static KSTART_ROUTINE TestReadWrite; +static +VOID +NTAPI +TestReadWrite( + IN PVOID Context) +{ + PREAD_WRITE_TEST_CONTEXT TestContext = Context; + PCWSTR PipePath = TestContext->PipePath; + BOOLEAN ServerSynchronous = TestContext->ServerSynchronous; + BOOLEAN ClientSynchronous = TestContext->ClientSynchronous; + NTSTATUS Status; + HANDLE ServerHandle; + LARGE_INTEGER DefaultTimeout; + THREAD_CONTEXT ConnectContext; + THREAD_CONTEXT ListenContext; + THREAD_CONTEXT ClientReadContext; + THREAD_CONTEXT ClientWriteContext; + THREAD_CONTEXT ServerReadContext; + THREAD_CONTEXT ServerWriteContext; + BOOLEAN Okay; + HANDLE ClientHandle; + UCHAR ReadBuffer[128]; + UCHAR WriteBuffer[128]; + + StartWorkerThread(&ConnectContext); + StartWorkerThread(&ListenContext); + StartWorkerThread(&ClientReadContext); + StartWorkerThread(&ClientWriteContext); + StartWorkerThread(&ServerReadContext); + StartWorkerThread(&ServerWriteContext); + + DefaultTimeout.QuadPart = -50 * 1000 * 10; + + /* Server should start out listening */ + Status = MakeServer(&ServerHandle, PipePath, ServerSynchronous); + ok_eq_hex(Status, STATUS_SUCCESS); + CheckServer(ServerHandle, FILE_PIPE_LISTENING_STATE); + + Okay = CheckWritePipe(&ServerWriteContext, ServerHandle, NULL, 0, 100); + ok_bool_true(Okay, "CheckWritePipe returned"); + ok_eq_ulongptr(ServerWriteContext.ReadWrite.BytesTransferred, 0); + ok_eq_hex(ServerWriteContext.ReadWrite.Status, STATUS_PIPE_LISTENING); + + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, NULL, 0, 100); + ok_bool_true(Okay, "CheckReadPipe returned"); + ok_eq_ulongptr(ServerReadContext.ReadWrite.BytesTransferred, 0); + ok_eq_hex(ServerReadContext.ReadWrite.Status, STATUS_PIPE_LISTENING); + + /* Connect a client */ + Okay = CheckConnectPipe(&ConnectContext, PipePath, ClientSynchronous, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_SUCCESS); + ClientHandle = ConnectContext.Connect.ClientHandle; + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /** Server to client, write first, 1 byte */ + WriteBuffer[0] = 'A'; + ReadBuffer[0] = 'X'; + Okay = CheckWritePipe(&ServerWriteContext, ServerHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ServerWriteContext, STATUS_SUCCESS, 1); + CheckServerQuota(ServerHandle, 0, 1); CheckClientQuota(ClientHandle, 1, 0); + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ClientReadContext, STATUS_SUCCESS, 1); + ok_eq_uint(ReadBuffer[0], 'A'); + CheckServerQuota(ServerHandle, 0, 0); CheckClientQuota(ClientHandle, 0, 0); + + /** Server to client, read first, 1 byte */ + WriteBuffer[0] = 'B'; + ReadBuffer[0] = 'X'; + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + ok_bool_false(Okay, "CheckReadPipe returned"); + CheckServerQuota(ServerHandle, 0, 1); + Okay = CheckWritePipe(&ServerWriteContext, ServerHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ServerWriteContext, STATUS_SUCCESS, 1); + Okay = WaitForWork(&ClientReadContext, 100); + CheckPipeContext(&ClientReadContext, STATUS_SUCCESS, 1); + ok_eq_uint(ReadBuffer[0], 'B'); + CheckServerQuota(ServerHandle, 0, 0); CheckClientQuota(ClientHandle, 0, 0); + + /** Client to server, write first, 1 byte */ + WriteBuffer[0] = 'C'; + ReadBuffer[0] = 'X'; + Okay = CheckWritePipe(&ClientWriteContext, ClientHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ClientWriteContext, STATUS_SUCCESS, 1); + CheckClientQuota(ClientHandle, 0, 1); CheckServerQuota(ServerHandle, 1, 0); + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ServerReadContext, STATUS_SUCCESS, 1); + ok_eq_uint(ReadBuffer[0], 'C'); + CheckClientQuota(ClientHandle, 0, 0); CheckServerQuota(ServerHandle, 0, 0); + + /** Client to server, read first, 1 byte */ + WriteBuffer[0] = 'D'; + ReadBuffer[0] = 'X'; + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, ReadBuffer, 1, 100); + ok_bool_false(Okay, "CheckReadPipe returned"); + CheckClientQuota(ClientHandle, 0, 1); + Okay = CheckWritePipe(&ClientWriteContext, ClientHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ClientWriteContext, STATUS_SUCCESS, 1); + Okay = WaitForWork(&ServerReadContext, 100); + CheckPipeContext(&ServerReadContext, STATUS_SUCCESS, 1); + ok_eq_uint(ReadBuffer[0], 'D'); + CheckClientQuota(ClientHandle, 0, 0); CheckServerQuota(ServerHandle, 0, 0); + + /** Server to client, write 0 bytes */ + Okay = CheckWritePipe(&ServerWriteContext, ServerHandle, (PVOID)1, 0, 100); + CheckPipeContext(&ServerWriteContext, STATUS_SUCCESS, 0); + CheckServerQuota(ServerHandle, 0, 0); CheckClientQuota(ClientHandle, 0, 0); + + /** Client to Server, write 0 bytes */ + Okay = CheckWritePipe(&ClientWriteContext, ClientHandle, (PVOID)1, 0, 100); + CheckPipeContext(&ClientWriteContext, STATUS_SUCCESS, 0); + CheckClientQuota(ClientHandle, 0, 0); CheckServerQuota(ServerHandle, 0, 0); + + /** Server to client, read 0 bytes blocks, write 0 bytes does not unblock, write 1 byte unblocks */ + WriteBuffer[0] = 'E'; + ReadBuffer[0] = 'X'; + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, (PVOID)1, 0, 100); + ok_bool_false(Okay, "CheckReadPipe returned"); + CheckServerQuota(ServerHandle, 0, 0); + Okay = CheckWritePipe(&ServerWriteContext, ServerHandle, (PVOID)1, 0, 100); + CheckPipeContext(&ServerWriteContext, STATUS_SUCCESS, 0); + Okay = WaitForWork(&ClientReadContext, 100); + ok_bool_false(Okay, "WaitForWork returned"); + CheckServerQuota(ServerHandle, 0, 0); + Okay = CheckWritePipe(&ServerWriteContext, ServerHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ServerWriteContext, STATUS_SUCCESS, 1); + Okay = WaitForWork(&ClientReadContext, 100); + CheckPipeContext(&ClientReadContext, STATUS_SUCCESS, 0); + ok_eq_uint(ReadBuffer[0], 'X'); + CheckServerQuota(ServerHandle, 0, 1); CheckClientQuota(ClientHandle, 1, 0); + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ClientReadContext, STATUS_SUCCESS, 1); + ok_eq_uint(ReadBuffer[0], 'E'); + CheckServerQuota(ServerHandle, 0, 0); CheckClientQuota(ClientHandle, 0, 0); + + /** Client to server, read 0 bytes blocks, write 0 bytes does not unblock, write 1 byte unblocks */ + WriteBuffer[0] = 'F'; + ReadBuffer[0] = 'X'; + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, (PVOID)1, 0, 100); + ok_bool_false(Okay, "CheckReadPipe returned"); + CheckClientQuota(ClientHandle, 0, 0); + Okay = CheckWritePipe(&ClientWriteContext, ClientHandle, (PVOID)1, 0, 100); + CheckPipeContext(&ClientWriteContext, STATUS_SUCCESS, 0); + Okay = WaitForWork(&ServerReadContext, 100); + ok_bool_false(Okay, "WaitForWork returned"); + CheckClientQuota(ClientHandle, 0, 0); + Okay = CheckWritePipe(&ClientWriteContext, ClientHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ClientWriteContext, STATUS_SUCCESS, 1); + Okay = WaitForWork(&ServerReadContext, 100); + CheckPipeContext(&ServerReadContext, STATUS_SUCCESS, 0); + ok_eq_uint(ReadBuffer[0], 'X'); + CheckClientQuota(ClientHandle, 0, 1); CheckServerQuota(ServerHandle, 1, 0); + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ServerReadContext, STATUS_SUCCESS, 1); + ok_eq_uint(ReadBuffer[0], 'F'); + CheckClientQuota(ClientHandle, 0, 0); CheckServerQuota(ServerHandle, 0, 0); + + /** Disconnect server with pending read on client */ + WriteBuffer[0] = 'G'; + ReadBuffer[0] = 'X'; + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + ok_bool_false(Okay, "CheckReadPipe returned"); + CheckServerQuota(ServerHandle, 0, 1); + Status = NpDisconnectPipe(ServerHandle); + ok_eq_hex(Status, STATUS_SUCCESS); + Okay = WaitForWork(&ClientReadContext, 100); + CheckPipeContext(&ClientReadContext, STATUS_PIPE_DISCONNECTED, 0); + ok_eq_uint(ReadBuffer[0], 'X'); + + /* Read from server when disconnected */ + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ServerReadContext, STATUS_PIPE_DISCONNECTED, 0); + + /* Write to server when disconnected */ + Okay = CheckWritePipe(&ServerWriteContext, ServerHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ServerWriteContext, STATUS_PIPE_DISCONNECTED, 0); + + /* Read from client when disconnected */ + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ClientReadContext, STATUS_PIPE_DISCONNECTED, 0); + + /* Write to client when disconnected */ + Okay = CheckWritePipe(&ClientWriteContext, ClientHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ClientWriteContext, STATUS_PIPE_DISCONNECTED, 0); + Status = ObCloseHandle(ClientHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + + /* Restore the connection */ + Okay = CheckListenPipe(&ListenContext, ServerHandle, 100); + ok_bool_false(Okay, "CheckListenPipe returned"); + Okay = CheckConnectPipe(&ConnectContext, PipePath, ClientSynchronous, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_SUCCESS); + Okay = WaitForWork(&ListenContext, 100); + ok_bool_true(Okay, "WaitForWork returned"); + ok_eq_hex(ListenContext.Listen.Status, STATUS_SUCCESS); + ClientHandle = ConnectContext.Connect.ClientHandle; + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /** Close server with pending read on client */ + WriteBuffer[0] = 'H'; + ReadBuffer[0] = 'X'; + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + ok_bool_false(Okay, "CheckReadPipe returned"); + Status = ObCloseHandle(ServerHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + Okay = WaitForWork(&ClientReadContext, 100); + CheckPipeContext(&ClientReadContext, STATUS_PIPE_BROKEN, 0); + ok_eq_uint(ReadBuffer[0], 'X'); + + /* Read from client when closed */ + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ClientReadContext, STATUS_PIPE_BROKEN, 0); + + /* Write to client when closed */ + Okay = CheckWritePipe(&ClientWriteContext, ClientHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ClientWriteContext, STATUS_PIPE_CLOSING, 0); + Status = ObCloseHandle(ClientHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + + /* Restore the connection */ + Status = MakeServer(&ServerHandle, PipePath, ServerSynchronous); + ok_eq_hex(Status, STATUS_SUCCESS); + Okay = CheckConnectPipe(&ConnectContext, PipePath, ClientSynchronous, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_SUCCESS); + ClientHandle = ConnectContext.Connect.ClientHandle; + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /** Close client with pending read on server */ + WriteBuffer[0] = 'I'; + ReadBuffer[0] = 'X'; + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, ReadBuffer, 1, 100); + ok_bool_false(Okay, "CheckReadPipe returned"); + Status = ObCloseHandle(ClientHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + Okay = WaitForWork(&ServerReadContext, 100); + CheckPipeContext(&ServerReadContext, STATUS_PIPE_BROKEN, 0); + ok_eq_uint(ReadBuffer[0], 'X'); + + /* Read from server when closed */ + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ServerReadContext, STATUS_PIPE_BROKEN, 0); + + /* Write to server when closed */ + Okay = CheckWritePipe(&ServerWriteContext, ServerHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ServerWriteContext, STATUS_PIPE_CLOSING, 0); + Status = ObCloseHandle(ServerHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + + /* Restore the connection */ + Status = MakeServer(&ServerHandle, PipePath, ServerSynchronous); + ok_eq_hex(Status, STATUS_SUCCESS); + Okay = CheckConnectPipe(&ConnectContext, PipePath, ClientSynchronous, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_SUCCESS); + ClientHandle = ConnectContext.Connect.ClientHandle; + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /** Write to server and disconnect, then read from client */ + WriteBuffer[0] = 'J'; + ReadBuffer[0] = 'X'; + Okay = CheckWritePipe(&ServerWriteContext, ServerHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ServerWriteContext, STATUS_SUCCESS, 1); + CheckServerQuota(ServerHandle, 0, 1); CheckClientQuota(ClientHandle, 1, 0); + Status = NpDisconnectPipe(ServerHandle); + ok_eq_hex(Status, STATUS_SUCCESS); + NpQueryPipe(ClientHandle, STATUS_PIPE_DISCONNECTED); + CheckServer(ServerHandle, FILE_PIPE_DISCONNECTED_STATE); + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ClientReadContext, STATUS_PIPE_DISCONNECTED, 0); + ok_eq_uint(ReadBuffer[0], 'X'); + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ClientReadContext, STATUS_PIPE_DISCONNECTED, 0); + Status = ObCloseHandle(ClientHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + + /* Restore the connection */ + Okay = CheckListenPipe(&ListenContext, ServerHandle, 100); + ok_bool_false(Okay, "CheckListenPipe returned"); + Okay = CheckConnectPipe(&ConnectContext, PipePath, ClientSynchronous, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_SUCCESS); + Okay = WaitForWork(&ListenContext, 100); + ok_bool_true(Okay, "WaitForWork returned"); + ok_eq_hex(ListenContext.Listen.Status, STATUS_SUCCESS); + ClientHandle = ConnectContext.Connect.ClientHandle; + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /** Write to server and close, then read from client */ + WriteBuffer[0] = 'K'; + ReadBuffer[0] = 'X'; + Okay = CheckWritePipe(&ServerWriteContext, ServerHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ServerWriteContext, STATUS_SUCCESS, 1); + CheckServerQuota(ServerHandle, 0, 1); CheckClientQuota(ClientHandle, 1, 0); + Status = ObCloseHandle(ServerHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + NpCheckClientPipe(ClientHandle, + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, + MAX_INSTANCES, 1, + IN_QUOTA, 1, + OUT_QUOTA, OUT_QUOTA, + FILE_PIPE_CLOSING_STATE); + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ClientReadContext, STATUS_SUCCESS, 1); + ok_eq_uint(ReadBuffer[0], 'K'); + Okay = CheckReadPipe(&ClientReadContext, ClientHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ClientReadContext, STATUS_PIPE_BROKEN, 0); + Status = ObCloseHandle(ClientHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + + /* Restore the connection */ + Status = MakeServer(&ServerHandle, PipePath, ServerSynchronous); + ok_eq_hex(Status, STATUS_SUCCESS); + Okay = CheckConnectPipe(&ConnectContext, PipePath, ClientSynchronous, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_SUCCESS); + ClientHandle = ConnectContext.Connect.ClientHandle; + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + + /** Write to client and close, then read from server */ + WriteBuffer[0] = 'L'; + ReadBuffer[0] = 'X'; + Okay = CheckWritePipe(&ClientWriteContext, ClientHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ClientWriteContext, STATUS_SUCCESS, 1); + CheckClientQuota(ClientHandle, 0, 1); CheckServerQuota(ServerHandle, 1, 0); + Status = ObCloseHandle(ClientHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + NpCheckServerPipe(ServerHandle, + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, + MAX_INSTANCES, 1, + IN_QUOTA, 1, + OUT_QUOTA, OUT_QUOTA, + FILE_PIPE_CLOSING_STATE); + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ServerReadContext, STATUS_SUCCESS, 1); + ok_eq_uint(ReadBuffer[0], 'L'); + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ServerReadContext, STATUS_PIPE_BROKEN, 0); + Status = ObCloseHandle(ServerHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + + /* Restore the connection */ + Status = MakeServer(&ServerHandle, PipePath, ServerSynchronous); + ok_eq_hex(Status, STATUS_SUCCESS); + Okay = CheckConnectPipe(&ConnectContext, PipePath, ClientSynchronous, 100); + ok_bool_true(Okay, "CheckConnectPipe returned"); + ok_eq_hex(ConnectContext.Connect.Status, STATUS_SUCCESS); + ClientHandle = ConnectContext.Connect.ClientHandle; + CheckClient(ClientHandle, FILE_PIPE_CONNECTED_STATE); + CheckServer(ServerHandle, FILE_PIPE_CONNECTED_STATE); + + /** Write to client and disconnect server, then read from server */ + WriteBuffer[0] = 'M'; + ReadBuffer[0] = 'X'; + Okay = CheckWritePipe(&ClientWriteContext, ClientHandle, WriteBuffer, 1, 100); + CheckPipeContext(&ClientWriteContext, STATUS_SUCCESS, 1); + CheckClientQuota(ClientHandle, 0, 1); CheckServerQuota(ServerHandle, 1, 0); + Status = NpDisconnectPipe(ServerHandle); + ok_eq_hex(Status, STATUS_SUCCESS); + NpQueryPipe(ClientHandle, STATUS_PIPE_DISCONNECTED); + CheckServer(ServerHandle, FILE_PIPE_DISCONNECTED_STATE); + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ServerReadContext, STATUS_PIPE_DISCONNECTED, 0); + ok_eq_uint(ReadBuffer[0], 'X'); + Okay = CheckReadPipe(&ServerReadContext, ServerHandle, ReadBuffer, 1, 100); + CheckPipeContext(&ServerReadContext, STATUS_PIPE_DISCONNECTED, 0); + Status = ObCloseHandle(ClientHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + + Status = ObCloseHandle(ServerHandle, KernelMode); + ok_eq_hex(Status, STATUS_SUCCESS); + + FinishWorkerThread(&ServerWriteContext); + FinishWorkerThread(&ServerReadContext); + FinishWorkerThread(&ClientWriteContext); + FinishWorkerThread(&ClientReadContext); + FinishWorkerThread(&ListenContext); + FinishWorkerThread(&ConnectContext); +} + +START_TEST(NpfsReadWrite) +{ + PKTHREAD Thread; + READ_WRITE_TEST_CONTEXT TestContext; + + TestContext.PipePath = DEVICE_NAMED_PIPE L"\\KmtestNpfsReadWriteTestPipe"; + + TestContext.ServerSynchronous = TRUE; + TestContext.ClientSynchronous = TRUE; + Thread = KmtStartThread(TestReadWrite, &TestContext); + KmtFinishThread(Thread, NULL); + + TestContext.ServerSynchronous = FALSE; + TestContext.ClientSynchronous = TRUE; + Thread = KmtStartThread(TestReadWrite, &TestContext); + KmtFinishThread(Thread, NULL); + + TestContext.ServerSynchronous = TRUE; + TestContext.ClientSynchronous = FALSE; + Thread = KmtStartThread(TestReadWrite, &TestContext); + KmtFinishThread(Thread, NULL); + + TestContext.ServerSynchronous = FALSE; + TestContext.ClientSynchronous = FALSE; + Thread = KmtStartThread(TestReadWrite, &TestContext); + KmtFinishThread(Thread, NULL); +} diff --git a/rostests/kmtests/npfs/npfs.h b/rostests/kmtests/npfs/npfs.h new file mode 100644 index 00000000000..dd28c839120 --- /dev/null +++ b/rostests/kmtests/npfs/npfs.h @@ -0,0 +1,225 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory + * PURPOSE: Kernel-Mode Test Suite NPFS helper declarations + * PROGRAMMER: Thomas Faber + */ + +#ifndef _KMTEST_NPFS_H_ +#define _KMTEST_NPFS_H_ + +#define DEVICE_NAMED_PIPE L"\\Device\\NamedPipe" + +#define BYTE_STREAM FILE_PIPE_BYTE_STREAM_MODE +C_ASSERT(FILE_PIPE_BYTE_STREAM_MODE == FILE_PIPE_BYTE_STREAM_TYPE); +#define MESSAGE FILE_PIPE_MESSAGE_MODE +C_ASSERT(FILE_PIPE_MESSAGE_MODE == FILE_PIPE_MESSAGE_TYPE); +#define QUEUE FILE_PIPE_QUEUE_OPERATION +#define COMPLETE FILE_PIPE_COMPLETE_OPERATION +#define INBOUND FILE_PIPE_INBOUND +#define OUTBOUND FILE_PIPE_OUTBOUND +#define DUPLEX FILE_PIPE_FULL_DUPLEX + +NTSTATUS +NpCreatePipeEx( + OUT PHANDLE ServerHandle, + IN PCWSTR PipePath, + IN ULONG ReadMode, + IN ULONG CompletionMode, + IN ULONG NamedPipeType, + IN ULONG ShareAccess, + IN ULONG MaximumInstances, + IN ULONG InboundQuota, + IN ULONG OutboundQuota, + IN ACCESS_MASK DesiredAccess, + IN ULONG Disposition, + IN ULONG CreateOptions, + IN PLARGE_INTEGER DefaultTimeout OPTIONAL); + +NTSTATUS +NpCreatePipe( + OUT PHANDLE ServerHandle, + IN PCWSTR PipePath, + IN ULONG ReadMode, + IN ULONG CompletionMode, + IN ULONG NamedPipeType, + IN ULONG NamedPipeConfiguration, + IN ULONG MaximumInstances, + IN ULONG InboundQuota, + IN ULONG OutboundQuota); + +NTSTATUS +NpOpenPipeEx( + OUT PHANDLE ClientHandle, + IN PCWSTR PipePath, + IN ACCESS_MASK DesiredAccess, + IN ULONG ShareAccess, + IN ULONG Disposition, + IN ULONG CreateOptions); + +NTSTATUS +NpOpenPipe( + OUT PHANDLE ClientHandle, + IN PCWSTR PipePath, + IN ULONG NamedPipeConfiguration); + +NTSTATUS +NpControlPipe( + IN HANDLE PipeHandle, + IN ULONG FsControlCode, + IN PVOID InputBuffer, + IN ULONG InputBufferLength); + +#define NpListenPipe(ServerHandle) NpControlPipe(ServerHandle, FSCTL_PIPE_LISTEN, NULL, 0) +#define NpDisconnectPipe(ServerHandle) NpControlPipe(ServerHandle, FSCTL_PIPE_DISCONNECT, NULL, 0) + +NTSTATUS +NpWaitPipe( + IN PCWSTR PipeName, + IN PLARGE_INTEGER Timeout); + +NTSTATUS +NpReadPipe( + IN HANDLE PipeHandle, + OUT PVOID Buffer, + IN ULONG BufferSize, + OUT PULONG_PTR BytesRead); + +NTSTATUS +NpWritePipe( + IN HANDLE PipeHandle, + IN const VOID *Buffer, + IN ULONG BufferSize, + OUT PULONG_PTR BytesWritten); + +#define NpCheckServerPipe(h, rm, cm, npt, npc, mi, ci, iq, rsa, oq, wqa, nps) \ + NpCheckServerPipe__(h, rm, cm, npt, npc, mi, ci, iq, rsa, oq, wqa, nps, __FILE__, __LINE__) + +#define NpCheckServerPipe__(h, rm, cm, npt, npc, mi, ci, iq, rsa, oq, wqa, nps, file, line) \ + NpCheckServerPipe_(h, rm, cm, npt, npc, mi, ci, iq, rsa, oq, wqa, nps, file ":" KMT_STRINGIZE(line)) + +VOID +NpCheckServerPipe_( + IN HANDLE ServerHandle, + /* PipeInformation */ + IN ULONG ReadMode, + IN ULONG CompletionMode, + /* PipeLocalInformation */ + IN ULONG NamedPipeType, + IN ULONG NamedPipeConfiguration, + IN ULONG MaximumInstances, + IN ULONG CurrentInstances, + IN ULONG InboundQuota, + IN ULONG ReadDataAvailable, + IN ULONG OutboundQuota, + IN ULONG WriteQuotaAvailable, + IN ULONG NamedPipeState, + /* PipeRemoteInformation */ + /* */ + IN PCSTR FileAndLine); + +#define NpCheckClientPipe(h, rm, cm, npt, npc, mi, ci, iq, rsa, oq, wqa, nps) \ + NpCheckClientPipe__(h, rm, cm, npt, npc, mi, ci, iq, rsa, oq, wqa, nps, __FILE__, __LINE__) + +#define NpCheckClientPipe__(h, rm, cm, npt, npc, mi, ci, iq, rsa, oq, wqa, nps, file, line) \ + NpCheckClientPipe_(h, rm, cm, npt, npc, mi, ci, iq, rsa, oq, wqa, nps, file ":" KMT_STRINGIZE(line)) + +VOID +NpCheckClientPipe_( + IN HANDLE ClientHandle, + /* PipeInformation */ + IN ULONG ReadMode, + IN ULONG CompletionMode, + /* PipeLocalInformation */ + IN ULONG NamedPipeType, + IN ULONG NamedPipeConfiguration, + IN ULONG MaximumInstances, + IN ULONG CurrentInstances, + IN ULONG InboundQuota, + IN ULONG ReadDataAvailable, + IN ULONG OutboundQuota, + IN ULONG WriteQuotaAvailable, + IN ULONG NamedPipeState, + /* PipeRemoteInformation */ + /* */ + IN PCSTR FileAndLine); + +#define NpQueryPipe(h, es) \ + NpQueryPipe__(h, es, __FILE__, __LINE__) + +#define NpQueryPipe__(h, es, file, line) \ + NpQueryPipe_(h, es, file ":" KMT_STRINGIZE(line)) + +VOID +NpQueryPipe_( + IN HANDLE Handle, + IN NTSTATUS ExpectedStatus, + IN PCSTR FileAndLine); + + +struct _THREAD_CONTEXT; +typedef VOID (WORK_FUNCTION)(IN OUT struct _THREAD_CONTEXT *); +typedef WORK_FUNCTION *PWORK_FUNCTION; + +typedef struct _THREAD_CONTEXT +{ + volatile PWORK_FUNCTION Work; + volatile union + { + struct + { + PCWSTR PipePath; + BOOLEAN ClientSynchronous; + HANDLE ClientHandle; + NTSTATUS Status; + } Connect; + struct + { + HANDLE ServerHandle; + NTSTATUS Status; + } Listen; + struct + { + HANDLE PipeHandle; + PVOID Buffer; + ULONG BufferSize; + ULONG_PTR BytesTransferred; + NTSTATUS Status; + } ReadWrite; + }; + KEVENT ThreadDoneEvent; + KEVENT StartWorkEvent; + KEVENT WorkCompleteEvent; + PKTHREAD Thread; +} THREAD_CONTEXT, *PTHREAD_CONTEXT; + +VOID +StartWorkerThread( + OUT PTHREAD_CONTEXT Context); + +VOID +FinishWorkerThread( + IN PTHREAD_CONTEXT Context); + +BOOLEAN +WaitForWork( + IN PTHREAD_CONTEXT Context, + IN ULONG MilliSeconds); + +BOOLEAN +TriggerWork( + IN PTHREAD_CONTEXT Context, + IN ULONG MilliSeconds); + + +PKTHREAD +KmtStartThread( + IN PKSTART_ROUTINE StartRoutine, + IN PVOID StartContext OPTIONAL); + +VOID +KmtFinishThread( + IN PKTHREAD Thread OPTIONAL, + IN PKEVENT Event OPTIONAL); + +#endif /* !defined _KMTEST_NPFS_H_ */ From b3d69a19ac7771ad10b0d19b8dd46aa70c4532cd Mon Sep 17 00:00:00 2001 From: James Tabor Date: Wed, 9 Apr 2014 20:50:03 +0000 Subject: [PATCH 274/419] [NtUser|User32] - Sync port (more) from wine to update code before move and test. See CORE-7447. svn path=/trunk/; revision=62696 --- reactos/win32ss/user/ntuser/defwnd.c | 33 +++++++++++++++----- reactos/win32ss/user/user32/windows/defwnd.c | 19 +++++------ 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/reactos/win32ss/user/ntuser/defwnd.c b/reactos/win32ss/user/ntuser/defwnd.c index e617021f37e..ea2e385792c 100644 --- a/reactos/win32ss/user/ntuser/defwnd.c +++ b/reactos/win32ss/user/ntuser/defwnd.c @@ -169,19 +169,19 @@ DefWndHandleWindowPosChanged(PWND pWnd, WINDOWPOS* Pos) IntGetClientRect(pWnd, &Rect); IntMapWindowPoints(pWnd, (style & WS_CHILD ? IntGetParent(pWnd) : NULL), (LPPOINT) &Rect, 2); - if (! (Pos->flags & SWP_NOCLIENTMOVE)) + if (!(Pos->flags & SWP_NOCLIENTMOVE)) { co_IntSendMessage(UserHMGetHandle(pWnd), WM_MOVE, 0, MAKELONG(Rect.left, Rect.top)); } - if (! (Pos->flags & SWP_NOCLIENTSIZE)) + if (!(Pos->flags & SWP_NOCLIENTSIZE) || (Pos->flags & SWP_STATECHANGED)) { - WPARAM wp = SIZE_RESTORED; - - if (style & WS_MAXIMIZE) wp = SIZE_MAXIMIZED; - else if (style & WS_MINIMIZE) wp = SIZE_MINIMIZED; - - co_IntSendMessage(UserHMGetHandle(pWnd), WM_SIZE, wp, MAKELONG(Rect.right - Rect.left, Rect.bottom - Rect.top)); + if (style & WS_MINIMIZE) co_IntSendMessage(UserHMGetHandle(pWnd), WM_SIZE, SIZE_MINIMIZED, 0 ); + else + { + WPARAM wp = (style & WS_MAXIMIZE) ? SIZE_MAXIMIZED : SIZE_RESTORED; + co_IntSendMessage(UserHMGetHandle(pWnd), WM_SIZE, wp, MAKELONG(Rect.right - Rect.left, Rect.bottom - Rect.top)); + } } return 0; } @@ -200,6 +200,15 @@ UserDrawWindowFrame(HDC hdc, NtGdiSelectBrush( hdc, hbrush ); } +VOID FASTCALL +UserDrawMovingFrame(HDC hdc, + RECTL *rect, + BOOL thickframe) +{ + if (thickframe) UserDrawWindowFrame(hdc, rect, UserGetSystemMetrics(SM_CXFRAME), UserGetSystemMetrics(SM_CYFRAME)); + else UserDrawWindowFrame(hdc, rect, 1, 1); +} + LRESULT FASTCALL DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam) { @@ -216,6 +225,12 @@ DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam) switch (wParam & 0xfff0) { + case SC_MOVE: + case SC_SIZE: + //DefWndDoSizeMove(pWnd, wParam); + ERR("SC_MOVESIZE\n"); + break; + case SC_SCREENSAVE: ERR("Screensaver Called!\n"); UserPostMessage(hwndSAS, WM_LOGONNOTIFY, LN_START_SCREENSAVE, 0); // always lParam 0 == not Secure @@ -302,8 +317,10 @@ IntDefWindowProc( return (LRESULT) DefWndControlColor((HDC)wParam, HIWORD(lParam)); case WM_GETHOTKEY: + //ERR("WM_GETHOTKEY\n"); return DefWndGetHotKey(Wnd); case WM_SETHOTKEY: + //ERR("WM_SETHOTKEY\n"); return DefWndSetHotKey(Wnd, wParam); case WM_NCHITTEST: diff --git a/reactos/win32ss/user/user32/windows/defwnd.c b/reactos/win32ss/user/user32/windows/defwnd.c index 40cf0b6424a..37459991a14 100644 --- a/reactos/win32ss/user/user32/windows/defwnd.c +++ b/reactos/win32ss/user/user32/windows/defwnd.c @@ -153,7 +153,7 @@ UserGetInsideRectNC(PWND Wnd, RECT *rect) } } -#if 0 // Moved to Win32k +#if 0 VOID DefWndSetRedraw(HWND hWnd, WPARAM wParam) { @@ -344,6 +344,7 @@ DefWndStartSizeMove(HWND hWnd, PWND Wnd, WPARAM wParam, POINT *capturePoint) } SetCursorPos( pt.x, pt.y ); DefWndHandleSetCursor(hWnd, (WPARAM)hWnd, MAKELONG(hittest, WM_MOUSEMOVE), Style); + //SendMessageW(hWnd, WM_SETCURSOR, (WPARAM)hWnd, MAKELONG(hittest, WM_MOUSEMOVE)); return hittest; } @@ -419,7 +420,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) // // Show window contents while dragging the window, get flag from registry data. // - SystemParametersInfoA(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0); + SystemParametersInfoW(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0); pt.x = GET_X_LPARAM(dwPoint); pt.y = GET_Y_LPARAM(dwPoint); @@ -450,11 +451,11 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) SetCapture(hwnd); hittest = DefWndStartSizeMove(hwnd, Wnd, wParam, &capturePoint); if (!hittest) - { + { ReleaseCapture(); return; - } - } + } + } } /* Get min/max info */ @@ -515,7 +516,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) } IntNotifyWinEvent( EVENT_SYSTEM_MOVESIZESTART, hwnd, OBJID_WINDOW, CHILDID_SELF, 0); - SendMessageA( hwnd, WM_ENTERSIZEMOVE, 0, 0 ); + SendMessageW( hwnd, WM_ENTERSIZEMOVE, 0, 0 ); NtUserxSetGUIThreadHandle(MSQ_STATE_MOVESIZE, hwnd); if (GetCapture() != hwnd) SetCapture( hwnd ); @@ -703,8 +704,8 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) } NtUserxSetGUIThreadHandle(MSQ_STATE_MOVESIZE, NULL); - SendMessageA( hwnd, WM_EXITSIZEMOVE, 0, 0 ); - SendMessageA( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L); + SendMessageW( hwnd, WM_EXITSIZEMOVE, 0, 0 ); + SendMessageW( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L); /* window moved or resized */ if (moved) @@ -744,7 +745,7 @@ DefWndDoSizeMove(HWND hwnd, WORD wParam) if( !moved ) { if( Style & WS_SYSMENU ) - SendMessageA( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y)); + SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y)); } } } From 32f91150484a333a3638c9e90a16921308793dfd Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Wed, 9 Apr 2014 21:49:30 +0000 Subject: [PATCH 275/419] [USETUP] Add a default pagefile entry to the registry. svn path=/trunk/; revision=62697 --- reactos/base/setup/usetup/interface/usetup.c | 7 ++++ reactos/base/setup/usetup/registry.c | 34 ++++++++++++++++++++ reactos/base/setup/usetup/registry.h | 3 ++ 3 files changed, 44 insertions(+) diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index 717bad1cd03..b1a09be80dc 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -70,6 +70,8 @@ static UNICODE_STRING DestinationPath; static UNICODE_STRING DestinationArcPath; static UNICODE_STRING DestinationRootPath; +static WCHAR DestinationDriveLetter; + /* Path to the active partition (boot manager) */ static UNICODE_STRING SystemRootPath; @@ -1589,6 +1591,8 @@ SelectPartitionPage(PINPUT_RECORD Ir) TRUE); } + DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter[0]; + return SELECT_FILE_SYSTEM_PAGE; } else if (Ir->Event.KeyEvent.wVirtualKeyCode == 'C') /* C */ @@ -3335,6 +3339,9 @@ RegistryPage(PINPUT_RECORD Ir) return QUIT_PAGE; } + /* Set the default pagefile entry */ + SetDefaultPagefile(DestinationDriveLetter); + /* Update the mounted devices list */ SetMountedDeviceValues(PartitionList); diff --git a/reactos/base/setup/usetup/registry.c b/reactos/base/setup/usetup/registry.c index 0ae7ab72817..493a17a4a83 100644 --- a/reactos/base/setup/usetup/registry.c +++ b/reactos/base/setup/usetup/registry.c @@ -763,4 +763,38 @@ SetMountedDeviceValue(CHAR Letter, ULONG Signature, LARGE_INTEGER StartingOffset return TRUE; } + +VOID +SetDefaultPagefile(WCHAR Drive) +{ + OBJECT_ATTRIBUTES ObjectAttributes; + UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management"); + UNICODE_STRING ValueName = RTL_CONSTANT_STRING(L"PagingFiles"); + WCHAR ValueBuffer[] = L"?:\\pagefile.sys 0 0\0"; + HANDLE KeyHandle; + NTSTATUS Status; + + InitializeObjectAttributes(&ObjectAttributes, + &KeyName, + OBJ_CASE_INSENSITIVE, + NULL, + NULL); + Status = NtOpenKey(&KeyHandle, + KEY_ALL_ACCESS, + &ObjectAttributes); + if (!NT_SUCCESS(Status)) + return; + + ValueBuffer[0] = Drive; + + NtSetValueKey(KeyHandle, + &ValueName, + 0, + REG_MULTI_SZ, + (PVOID)&ValueBuffer, + sizeof(ValueBuffer)); + + NtClose(KeyHandle); +} + /* EOF */ diff --git a/reactos/base/setup/usetup/registry.h b/reactos/base/setup/usetup/registry.h index 0d62ac9c25b..2b23cd8d33d 100644 --- a/reactos/base/setup/usetup/registry.h +++ b/reactos/base/setup/usetup/registry.h @@ -38,4 +38,7 @@ SetInstallPathValue(PUNICODE_STRING InstallPath); BOOLEAN SetMountedDeviceValue(CHAR Letter, ULONG Signature, LARGE_INTEGER StartingOffset); +VOID +SetDefaultPagefile(WCHAR Drive); + /* EOF */ From 1f9a5645ad37af28fcdffc55f6a0100806bf0d89 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 10 Apr 2014 01:29:26 +0000 Subject: [PATCH 276/419] [Win32k] - Create call message filter for internal use. svn path=/trunk/; revision=62698 --- reactos/win32ss/user/ntuser/message.c | 16 ++++++++++++++++ reactos/win32ss/user/ntuser/msgqueue.h | 1 + 2 files changed, 17 insertions(+) diff --git a/reactos/win32ss/user/ntuser/message.c b/reactos/win32ss/user/ntuser/message.c index 4162008a35e..50deea3e44c 100644 --- a/reactos/win32ss/user/ntuser/message.c +++ b/reactos/win32ss/user/ntuser/message.c @@ -1906,6 +1906,22 @@ IntUninitMessagePumpHook() return FALSE; } +BOOL FASTCALL +IntCallMsgFilter( LPMSG lpmsg, INT code) +{ + BOOL Ret = FALSE; + + if ( co_HOOK_CallHooks( WH_SYSMSGFILTER, code, 0, (LPARAM)lpmsg)) + { + Ret = TRUE; + } + else + { + Ret = co_HOOK_CallHooks( WH_MSGFILTER, code, 0, (LPARAM)lpmsg); + } + return Ret; +} + /** Functions ******************************************************************/ BOOL diff --git a/reactos/win32ss/user/ntuser/msgqueue.h b/reactos/win32ss/user/ntuser/msgqueue.h index decf12301e0..e2882f84cbc 100644 --- a/reactos/win32ss/user/ntuser/msgqueue.h +++ b/reactos/win32ss/user/ntuser/msgqueue.h @@ -254,6 +254,7 @@ VOID FASTCALL IdlePong(VOID); BOOL FASTCALL co_MsqReplyMessage(LRESULT); VOID FASTCALL MsqWakeQueue(PTHREADINFO,DWORD,BOOL); VOID FASTCALL ClearMsgBitsMask(PTHREADINFO,UINT); +BOOL FASTCALL IntCallMsgFilter(LPMSG,INT); int UserShowCursor(BOOL bShow); PCURICON_OBJECT From cd05473bf942ca50c318e0203387e46a4ba39442 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 10 Apr 2014 13:33:27 +0000 Subject: [PATCH 277/419] [TRANSLATIONS] * Turkish translation update by Erdem Ersoy. CORE-7861 svn path=/trunk/; revision=62699 --- reactos/base/applications/calc/lang/tr-TR.rc | 66 +++--- reactos/base/applications/calc/resource.rc | 6 +- reactos/base/applications/charmap/charmap.rc | 6 +- .../base/applications/charmap/lang/tr-TR.rc | 16 +- reactos/base/applications/dxdiag/dxdiag.rc | 6 +- .../base/applications/dxdiag/lang/tr-TR.rc | 46 ++-- .../base/applications/fontview/fontview.rc | 6 +- .../base/applications/fontview/lang/tr-TR.rc | 10 +- .../games/solitaire/lang/tr-TR.rc | 4 +- .../applications/games/spider/lang/tr-TR.rc | 4 +- .../applications/games/winmine/lang/tr-TR.rc | 4 +- .../base/applications/kbswitch/kbswitch.rc | 6 +- .../base/applications/kbswitch/lang/tr-TR.rc | 2 +- .../base/applications/magnify/lang/tr-TR.rc | 6 +- reactos/base/applications/mmc/lang/tr-TR.rc | 6 +- reactos/base/applications/mmc/mmc.rc | 6 +- .../base/applications/mplay32/lang/tr-TR.rc | 12 +- reactos/base/applications/mplay32/mplay32.rc | 6 +- .../base/applications/msconfig/lang/tr-TR.rc | 58 ++--- .../base/applications/msconfig/msconfig.rc | 6 +- .../applications/mscutils/devmgmt/devmgmt.rc | 6 +- .../mscutils/devmgmt/lang/tr-TR.rc | 31 ++- .../mscutils/devmgmt_new/lang/tr-TR.rc | 39 ++-- .../mscutils/eventvwr/eventvwr.rc | 6 +- .../mscutils/eventvwr/lang/tr-TR.rc | 28 ++- .../mscutils/servman/lang/tr-TR.rc | 94 ++++---- .../applications/mscutils/servman/servman.rc | 6 +- .../base/applications/mspaint/lang/tr-TR.rc | 70 +++--- reactos/base/applications/mspaint/rsrc.rc | 6 +- reactos/base/applications/mstsc/lang/tr-TR.rc | 24 +-- reactos/base/applications/mstsc/rdc.rc | 6 +- .../base/applications/notepad/lang/tr-TR.rc | 24 +-- reactos/base/applications/rapps/lang/tr-TR.rc | 78 +++---- reactos/base/applications/rapps/rapps.rc | 6 +- reactos/base/applications/regedit/clb/clb.rc | 6 +- .../applications/regedit/clb/lang/tr-TR.rc | 14 +- .../base/applications/regedit/lang/tr-TR.rc | 200 +++++++++--------- reactos/base/applications/regedit/regedit.rc | 6 +- .../screensavers/3dtext/lang/tr-TR.rc | 4 +- .../applications/screensavers/3dtext/rsrc.rc | 6 +- .../screensavers/logon/lang/tr-TR.rc | 4 +- .../applications/screensavers/logon/logon.rc | 6 +- .../base/applications/sndrec32/lang/tr-TR.rc | 14 +- reactos/base/applications/sndrec32/rsrc.rc | 6 +- .../base/applications/sndvol32/lang/tr-TR.rc | 14 +- .../base/applications/sndvol32/sndvol32.rc | 6 +- .../base/applications/taskmgr/lang/tr-TR.rc | 104 ++++----- reactos/base/applications/taskmgr/taskmgr.rc | 6 +- reactos/base/applications/winhlp32/lang/Tr.rc | 66 ++++-- reactos/base/applications/winhlp32/rsrc.rc | 6 +- reactos/base/applications/wordpad/lang/Tr.rc | 142 ++++++------- reactos/base/applications/wordpad/rsrc.rc | 6 +- reactos/base/applications/write/lang/Tr.rc | 4 +- reactos/base/applications/write/rsrc.rc | 6 +- reactos/base/setup/reactos/lang/tr-TR.rc | 4 +- reactos/base/setup/vmwinst/lang/tr-TR.rc | 6 +- reactos/base/setup/welcome/lang/tr-TR.rc | 2 +- reactos/base/shell/explorer-new/lang/tr-TR.rc | 8 +- reactos/base/system/rundll32/lang/tr-TR.rc | 2 +- reactos/base/system/runonce/lang/tr-TR.rc | 2 +- reactos/base/system/userinit/lang/tr-TR.rc | 2 +- reactos/base/system/winlogon/lang/tr-TR.rc | 2 +- reactos/boot/freeldr/fdebug/lang/tr-TR.rc | 8 +- reactos/dll/cpl/access/lang/tr-TR.rc | 18 +- reactos/dll/cpl/appwiz/lang/tr-TR.rc | 4 +- reactos/dll/cpl/console/lang/tr-TR.rc | 20 +- reactos/dll/cpl/desk/lang/tr-TR.rc | 22 +- reactos/dll/cpl/hdwwiz/lang/tr-TR.rc | 2 +- reactos/dll/cpl/inetcpl/lang/tr-TR.rc | 12 +- reactos/dll/cpl/input/lang/tr-TR.rc | 16 +- reactos/dll/cpl/intl/lang/tr-TR.rc | 26 +-- reactos/dll/cpl/joy/lang/tr-TR.rc | 4 +- reactos/dll/cpl/liccpa/lang/tr-TR.rc | 2 +- reactos/dll/cpl/main/lang/tr-TR.rc | 22 +- reactos/dll/cpl/mmsys/lang/tr-TR.rc | 24 +-- reactos/dll/cpl/powercfg/lang/tr-TR.rc | 12 +- reactos/dll/cpl/sysdm/lang/tr-TR.rc | 10 +- reactos/dll/cpl/telephon/lang/tr-TR.rc | 2 +- reactos/dll/cpl/timedate/lang/tr-TR.rc | 8 +- reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc | 2 +- reactos/dll/shellext/deskadp/lang/tr-TR.rc | 4 +- reactos/dll/shellext/deskmon/lang/tr-TR.rc | 4 +- reactos/dll/shellext/slayer/lang/tr-TR.rc | 8 +- reactos/dll/win32/comdlg32/lang/cdlg_Tr.rc | 32 +-- reactos/dll/win32/credui/lang/credui_Tr.rc | 6 +- reactos/dll/win32/crypt32/lang/crypt32_Tr.rc | 6 +- reactos/dll/win32/cryptui/lang/cryptui_Tr.rc | 38 ++-- reactos/dll/win32/devmgr/lang/tr-TR.rc | 10 +- reactos/dll/win32/hhctrl.ocx/lang/Tr.rc | 2 +- reactos/dll/win32/iccvid/lang/iccvid_Tr.rc | 2 +- reactos/dll/win32/jscript/lang/jscript_Tr.rc | 45 ++++ reactos/dll/win32/jscript/rsrc.rc | 3 + reactos/dll/win32/kernel32/kernel32.rc | 3 + .../dll/win32/kernel32/winnls/lang/tr-TR.rc | 165 +++++++++++++++ reactos/dll/win32/localspl/lang/spl_Tr.rc | 27 +++ reactos/dll/win32/localspl/localspl.rc | 3 + reactos/dll/win32/localui/lang/ui_Tr.rc | 56 +++++ reactos/dll/win32/localui/localui.rc | 3 + reactos/dll/win32/msgina/lang/tr-TR.rc | 6 +- reactos/dll/win32/mshtml/lang/Tr.rc | 2 +- reactos/dll/win32/msrle32/lang/msrle_Tr.rc | 2 +- reactos/dll/win32/msvfw32/lang/msvfw32_Tr.rc | 6 +- .../dll/win32/msvidc32/lang/msvidc32_Tr.rc | 2 +- reactos/dll/win32/oledlg/lang/oledlg_Tr.rc | 6 +- reactos/dll/win32/syssetup/lang/tr-TR.rc | 4 +- 105 files changed, 1184 insertions(+), 835 deletions(-) create mode 100644 reactos/dll/win32/jscript/lang/jscript_Tr.rc create mode 100644 reactos/dll/win32/kernel32/winnls/lang/tr-TR.rc create mode 100644 reactos/dll/win32/localspl/lang/spl_Tr.rc create mode 100644 reactos/dll/win32/localui/lang/ui_Tr.rc diff --git a/reactos/base/applications/calc/lang/tr-TR.rc b/reactos/base/applications/calc/lang/tr-TR.rc index daa77611be1..f7246aec919 100644 --- a/reactos/base/applications/calc/lang/tr-TR.rc +++ b/reactos/base/applications/calc/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -66,7 +66,7 @@ BEGIN BS_NOTIFY | BS_OWNERDRAW | WS_TABSTOP PUSHBUTTON "BK", IDC_BUTTON_MS, 123, 100, 24, 18, BS_CENTER | BS_VCENTER | BS_NOTIFY | BS_OWNERDRAW | WS_TABSTOP - PUSHBUTTON "BA", IDC_BUTTON_MP, 123, 120, 24, 18, BS_CENTER | BS_VCENTER | + PUSHBUTTON "BE", IDC_BUTTON_MP, 123, 120, 24, 18, BS_CENTER | BS_VCENTER | BS_NOTIFY | BS_OWNERDRAW | WS_TABSTOP PUSHBUTTON "pi", IDC_BUTTON_PI, 123, 140, 24, 18, BS_CENTER | BS_VCENTER | BS_NOTIFY | BS_OWNERDRAW | WS_TABSTOP @@ -212,7 +212,7 @@ BEGIN BS_NOTIFY | BS_OWNERDRAW | WS_TABSTOP PUSHBUTTON "BK", IDC_BUTTON_MS, 5, 85, 24, 18, BS_CENTER | BS_VCENTER | BS_NOTIFY | BS_OWNERDRAW | WS_TABSTOP - PUSHBUTTON "BA", IDC_BUTTON_MP, 5, 105, 24, 18, BS_CENTER | BS_VCENTER | + PUSHBUTTON "BE", IDC_BUTTON_MP, 5, 105, 24, 18, BS_CENTER | BS_VCENTER | BS_NOTIFY | BS_OWNERDRAW | WS_TABSTOP DEFPUSHBUTTON "", IDC_BUTTON_FOCUS, 0, 0, 5, 5, NOT WS_VISIBLE END @@ -226,13 +226,13 @@ BEGIN PUSHBUTTON "Dönüştür:", IDC_BUTTON_CONVERT, 35, 105, 76, 17 COMBOBOX IDC_COMBO_CATEGORY, 5, 31, 140, 168, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | CBS_SORT - LTEXT "Tür:", IDC_STATIC, 5, 20, 56, 8 + LTEXT "Ulam:", IDC_STATIC, 5, 20, 56, 8 COMBOBOX IDC_COMBO_FROM, 5, 60, 140, 168, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | CBS_SORT - LTEXT "Şundan:", IDC_STATIC, 5, 49, 56, 8 + LTEXT "Şundan Dönüştür:", IDC_STATIC, 5, 49, 56, 8 COMBOBOX IDC_COMBO_TO, 5, 87, 140, 168, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP | CBS_SORT - LTEXT "Şuna:", IDC_STATIC, 5, 76, 56, 8 + LTEXT "Şuna Dönüştür:", IDC_STATIC, 5, 76, 56, 8 CONTROL "Baştan", IDC_BUTTON_CANC, "Button", BS_OWNERDRAW | BS_CENTER | BS_VCENTER | BS_NOTIFY | WS_TABSTOP, 276, 24, 40, 17 CONTROL "Sil", IDC_BUTTON_CE, "Button", BS_OWNERDRAW | BS_CENTER | @@ -287,14 +287,14 @@ BEGIN BS_VCENTER | BS_NOTIFY | WS_TABSTOP, 152, 67, 24, 18 CONTROL "BK", IDC_BUTTON_MS, "Button", BS_OWNERDRAW | BS_CENTER | BS_VCENTER | BS_NOTIFY | WS_TABSTOP, 152, 86, 24, 18 - CONTROL "BA", IDC_BUTTON_MP, "Button", BS_OWNERDRAW | BS_CENTER | + CONTROL "BE", IDC_BUTTON_MP, "Button", BS_OWNERDRAW | BS_CENTER | BS_VCENTER | BS_NOTIFY | WS_TABSTOP, 152, 105, 24, 18 DEFPUSHBUTTON "", IDC_BUTTON_FOCUS, 0, 0, 5, 5, NOT WS_VISIBLE END IDD_DIALOG_ABOUT DIALOGEX 0, 0, 264, 169 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Hesap Makinesi Hakkında" +CAPTION "Hesap Makinesi Üzerine" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "Tamam", IDOK, 105, 148, 52, 16 @@ -302,7 +302,7 @@ BEGIN SS_REALSIZEIMAGE | WS_BORDER, 4, 4, 104, 48 LTEXT "Hesap Makinesi", IDC_STATIC, 120, 12, 132, 8, SS_CENTERIMAGE LTEXT "Sürüm: ", IDC_TEXT_VERSION, 120, 20, 132, 8, SS_CENTERIMAGE - LTEXT "Carlo Bramini tarafndan yapılmıştır.", IDC_STATIC, 120, 32, 132, 8, SS_CENTERIMAGE + LTEXT "Carlo Bramini eliyle yapılmıştır.", IDC_STATIC, 120, 32, 132, 8, SS_CENTERIMAGE GROUPBOX "", IDC_STATIC, 112, 0, 148, 52 GROUPBOX "", IDC_STATIC, 5, 56, 256, 88 EDITTEXT IDC_EDIT_LICENSE, 12, 68, 240, 68, ES_MULTILINE | ES_READONLY | WS_VSCROLL @@ -314,10 +314,10 @@ CAPTION "Sayımlama Kutusu" FONT 8, "MS Shell Dlg" BEGIN LISTBOX IDC_LIST_STAT, 4, 4, 156, 40, LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "&Dön", IDC_BUTTON_RET, 4, 48, 36, 16 + PUSHBUTTON "&Geri Dön", IDC_BUTTON_RET, 4, 48, 36, 16 PUSHBUTTON "&Yükle", IDC_BUTTON_LOAD, 44, 48, 36, 16 PUSHBUTTON "&Sil", IDC_BUTTON_CD, 84, 48, 36, 16 - PUSHBUTTON "&Hepsini Sil", IDC_BUTTON_CAD, 124, 48, 36, 16 + PUSHBUTTON "&Tümünü Sil", IDC_BUTTON_CAD, 124, 48, 36, 16 CTEXT "n=0", IDC_TEXT_NITEMS, 4, 68, 156, 12, SS_CENTERIMAGE | SS_SUNKEN END @@ -325,7 +325,7 @@ END IDR_MENU_SCIENTIFIC_1 MENU BEGIN - POPUP "&Düzen" + POPUP "&Düzenleme" BEGIN MENUITEM "&Çoğalt\tCtrl+C", IDM_EDIT_COPY MENUITEM "&Yapıştır\tCtrl+V", IDM_EDIT_PASTE @@ -334,9 +334,9 @@ BEGIN BEGIN MENUITEM "&Ölçünlü", IDM_VIEW_STANDARD, CHECKED MENUITEM "&Bilimlik", IDM_VIEW_SCIENTIFIC, CHECKED - MENUITEM "&Dönüştürücü", IDM_VIEW_CONVERSION + MENUITEM "&Dönüştürme", IDM_VIEW_CONVERSION MENUITEM SEPARATOR - MENUITEM "%Onaltılık\tF5", IDM_VIEW_HEX, CHECKED + MENUITEM "&Onaltılık\tF5", IDM_VIEW_HEX, CHECKED MENUITEM "O&nluk\tF6", IDM_VIEW_DEC, CHECKED MENUITEM "&Sekizlik\tF7", IDM_VIEW_OCT, CHECKED MENUITEM "&İkilik\tF8", IDM_VIEW_BIN, CHECKED @@ -345,19 +345,19 @@ BEGIN MENUITEM "&Radyan\tF3", IDM_VIEW_RAD, CHECKED MENUITEM "&Gradyan\tF4", IDM_VIEW_GRAD, CHECKED MENUITEM SEPARATOR - MENUITEM "B&asamak Ayırıcısı", IDM_VIEW_GROUP, CHECKED + MENUITEM "B&asamakları Takımla", IDM_VIEW_GROUP, CHECKED END POPUP "&Yardım" BEGIN MENUITEM "&Yardım Konuları", IDM_HELP_HELP MENUITEM SEPARATOR - MENUITEM "&Hakkında", IDM_HELP_ABOUT + MENUITEM "&Üzerine...", IDM_HELP_ABOUT END END IDR_MENU_SCIENTIFIC_2 MENU BEGIN - POPUP "&Düzen" + POPUP "&Düzenleme" BEGIN MENUITEM "&Çoğalt\tCtrl+C", IDM_EDIT_COPY MENUITEM "&Yapıştır\tCtrl+V", IDM_EDIT_PASTE @@ -366,7 +366,7 @@ BEGIN BEGIN MENUITEM "&Ölçünlü", IDM_VIEW_STANDARD, CHECKED MENUITEM "&Bilimlik", IDM_VIEW_SCIENTIFIC, CHECKED - MENUITEM "&Dönüştürücü", IDM_VIEW_CONVERSION + MENUITEM "&Dönüştürme", IDM_VIEW_CONVERSION MENUITEM SEPARATOR MENUITEM "&Onaltılık\tF5", IDM_VIEW_HEX, CHECKED MENUITEM "O&nluk\tF6", IDM_VIEW_DEC, CHECKED @@ -378,19 +378,19 @@ BEGIN MENUITEM "Sö&zcük\tF3", IDM_VIEW_WORD, CHECKED MENUITEM "&Çoklu\tF4", IDM_VIEW_BYTE, CHECKED MENUITEM SEPARATOR - MENUITEM "B&asamak Ayırıcısı", IDM_VIEW_GROUP, CHECKED + MENUITEM "B&asamakları Takımla", IDM_VIEW_GROUP, CHECKED END POPUP "&Yardım" BEGIN - MENUITEM "%Yardım Konuları", IDM_HELP_HELP + MENUITEM "&Yardım Konuları", IDM_HELP_HELP MENUITEM SEPARATOR - MENUITEM "&Hakkında", IDM_HELP_ABOUT + MENUITEM "&Üzerine...", IDM_HELP_ABOUT END END IDR_MENU_STANDARD MENU BEGIN - POPUP "&Düzen" + POPUP "&Düzenleme" BEGIN MENUITEM "&Çoğalt\tCtrl+C", IDM_EDIT_COPY MENUITEM "&Yapıştır\tCtrl+V", IDM_EDIT_PASTE @@ -399,15 +399,15 @@ BEGIN BEGIN MENUITEM "&Ölçünlü", IDM_VIEW_STANDARD, CHECKED MENUITEM "&Bilimlik", IDM_VIEW_SCIENTIFIC, CHECKED - MENUITEM "&Dönüştürücü", IDM_VIEW_CONVERSION + MENUITEM "&Dönüştürme", IDM_VIEW_CONVERSION MENUITEM SEPARATOR - MENUITEM "B&asamak Ayırıcısı", IDM_VIEW_GROUP, CHECKED + MENUITEM "B&asamakları Takımla", IDM_VIEW_GROUP, CHECKED END POPUP "&Yardım" BEGIN MENUITEM "&Yardım Konuları", IDM_HELP_HELP MENUITEM SEPARATOR - MENUITEM "&Hakkında", IDM_HELP_ABOUT + MENUITEM "&Üzerine...", IDM_HELP_ABOUT END END @@ -415,7 +415,7 @@ END STRINGTABLE BEGIN - IDS_STRING_LICENSE "Hesap Makinesi, GNU GPL ile yayınlanan özgür bir yazılımdır.\r\n\r\nGNU GPL'nin bir sûretini buradan elde edebilirsiniz:\r\nhttp://www.gnu.org/licenses/gpl.html\r\n\r\nBir de GNU GPL'nin çevirilerini buradan elde edebilirsiniz:\r\nhttp://www.gnu.org/licenses/translations.html" + IDS_STRING_LICENSE "Hesap Makinesi, GNU GPL ruhsatıyla yayımlanan bir özgür yazılımdır.\r\n\r\nGNU GPL ruhsatının bir kopyasını buradan elde edebilirsiniz:\r\nhttp://www.gnu.org/licenses/gpl.html\r\n\r\nBir de GNU GPL ruhsatının bir çevirisini buradan elde edebilirsiniz:\r\nhttp://www.gnu.org/licenses/translations.html" IDS_MATH_ERROR "Yanlışlık" IDS_QUICKHELP "Hızlı Yardım" END @@ -467,7 +467,7 @@ BEGIN IDS_AREA_RAI "Rai" IDS_AREA_SE "Se" IDS_AREA_SQUARE_CENTIMETERS "Santimetrekare" - IDS_AREA_SQUARE_CHR "Chrkare" + IDS_AREA_SQUARE_CHR "Çırkare" IDS_AREA_SQUARE_FATHOMS "Kulaçkare" IDS_AREA_SQUARE_FATHOMS_HUNGARY "Kulaçkare (Macaristan)" IDS_AREA_SQUARE_FEET "Ayakkare" @@ -520,7 +520,7 @@ END /* Energies */ STRINGTABLE BEGIN - IDS_ENERGY_15_C_CALORIES "Kalori (15°C)" + IDS_ENERGY_15_C_CALORIES "Kalori (15°C'luk)" IDS_ENERGY_BTUS "İngiliz Isı Birimi" IDS_ENERGY_ERGS "Erg" IDS_ENERGY_EVS "Elektronvolt" @@ -544,7 +544,7 @@ BEGIN IDS_LENGTH_CHAINS_UK "Zincir (BB)" IDS_LENGTH_CHI "Çi" IDS_LENGTH_CHOU "Çou" - IDS_LENGTH_CHR "Chr" + IDS_LENGTH_CHR "Çır" IDS_LENGTH_CUN "Cun" IDS_LENGTH_FATHOMS "Kulaç" IDS_LENGTH_FATHOMS_HUNGARY "Kulaç (Macaristan)" @@ -600,7 +600,7 @@ END /* Pressures */ STRINGTABLE BEGIN - IDS_PRESSURE_ATMOSPHERES "Gaz yuvarı" + IDS_PRESSURE_ATMOSPHERES "Hava yuvarı" IDS_PRESSURE_BARS "Bar" IDS_PRESSURE_HECTOPASCALS "Hektopaskal" IDS_PRESSURE_KILOPASCALS "Kilopaskal" @@ -639,7 +639,7 @@ BEGIN IDS_VELOCITY_FEET_HOUR "Ayak/Saat" IDS_VELOCITY_FEET_SECOND "Ayak/Sâniye" IDS_VELOCITY_KILOMETERS_HOUR "Kilometre/Saat" - IDS_VELOCITY_KNOTS "Düğüm" + IDS_VELOCITY_KNOTS "Deniz mili" IDS_VELOCITY_MACH "Maç" IDS_VELOCITY_METERS_SECOND "Metre/Saat" IDS_VELOCITY_MILES_HOUR "Mil/Saat" @@ -703,10 +703,10 @@ BEGIN IDS_WEIGHT_LIANG_CHINA "Liang (Çin)" IDS_WEIGHT_LIANG_TAIWAN "Liang (Tayvan)" IDS_WEIGHT_MONME "Monme" - IDS_WEIGHT_OUNCES_AVOIRDUPOIS "Ons, İngiliz tarısı" + IDS_WEIGHT_OUNCES_AVOIRDUPOIS "Ons, İngiliz tartısı" IDS_WEIGHT_OUNCES_TROY "Ons, kuyumcu tartısı" IDS_WEIGHT_POUNDS "Pond" - IDS_WEIGHT_QUINTAL_METRIC "Kental (ölçümlü)" + IDS_WEIGHT_QUINTAL_METRIC "Kental (metrelik)" IDS_WEIGHT_SALOUNG "Salong" IDS_WEIGHT_STONES "Taş" IDS_WEIGHT_TAMLUNG "Tamlung" diff --git a/reactos/base/applications/calc/resource.rc b/reactos/base/applications/calc/resource.rc index e2d46ed0080..d30f208a16f 100644 --- a/reactos/base/applications/calc/resource.rc +++ b/reactos/base/applications/calc/resource.rc @@ -91,12 +91,12 @@ IDB_BITMAP_ROS BITMAP "res/ROS_logo.bmp" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif -#ifdef LANGUAGE_SV_SE - #include "lang/sv-SE.rc" -#endif #ifdef LANGUAGE_SQ_AL #include "lang/sq-AL.rc" #endif +#ifdef LANGUAGE_SV_SE + #include "lang/sv-SE.rc" +#endif #ifdef LANGUAGE_TH_TH #include "lang/th-TH.rc" #endif diff --git a/reactos/base/applications/charmap/charmap.rc b/reactos/base/applications/charmap/charmap.rc index 0deadadc3bf..502a476cb90 100644 --- a/reactos/base/applications/charmap/charmap.rc +++ b/reactos/base/applications/charmap/charmap.rc @@ -81,15 +81,15 @@ IDI_ICON ICON "res/charmap.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/charmap/lang/tr-TR.rc b/reactos/base/applications/charmap/lang/tr-TR.rc index 6a8e3ac344f..8abff7d2017 100644 --- a/reactos/base/applications/charmap/lang/tr-TR.rc +++ b/reactos/base/applications/charmap/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -6,7 +6,7 @@ IDD_CHARMAP DIALOGEX 6, 6, 292, 224 FONT 8, "MS Shell Dlg", 0, 0 STYLE DS_SHELLFONT | WS_CHILD | WS_VISIBLE BEGIN - LTEXT "Yazı Türü:", IDC_STATIC, 6, 7, 24, 9 + LTEXT "Yazı Tipi:", IDC_STATIC, 6, 7, 24, 9 COMBOBOX IDC_FONTCOMBO, 36, 5, 210, 210, WS_CHILD | WS_VISIBLE | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_SORT | CBS_HASSTRINGS PUSHBUTTON "Yardım", IDC_CMHELP, 249, 5, 35, 13 @@ -25,7 +25,7 @@ IDD_ADVANCED DIALOGEX 0, 0, 292, 64 STYLE DS_SHELLFONT | WS_CHILD FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Damga Kümesi:", IDC_STATIC, 8, 8, 48, 8 + LTEXT "Damga Öbeği:", IDC_STATIC, 8, 8, 48, 8 COMBOBOX IDC_COMBO_CHARSET, 72, 4, 116, 80, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Takımla:", IDC_STATIC, 8, 28, 50, 8 COMBOBOX IDC_COMBO_GROUPBY, 72, 24, 116, 80, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP @@ -37,11 +37,11 @@ BEGIN END IDD_ABOUTBOX DIALOGEX 22, 16, 210, 182 -CAPTION "Karakter Eşlem Hakkında" +CAPTION "Damga Eşlemi Üzerine" FONT 8, "MS Shell Dlg", 0, 0 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME BEGIN - LTEXT "Karakter Eşlem - Sürüm: 0.1\nTelif Hakkı: 2007 - Ged Murphy (gedmurphy@reactos.org)", IDC_STATIC, 48, 7, 150, 36 + LTEXT "Damga Eşlemi - Sürüm: 0.1\nTelif Hakkı: 2007 - Ged Murphy (gedmurphy@reactos.org)", IDC_STATIC, 48, 7, 150, 36 PUSHBUTTON "Tamam", IDOK, 75, 162, 44, 15 ICON IDI_ICON, IDC_STATIC, 10, 10, 7, 30 EDITTEXT IDC_LICENSE_EDIT, 8, 44, 194, 107, WS_VISIBLE | WS_VSCROLL | @@ -50,7 +50,7 @@ END STRINGTABLE BEGIN - IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." - IDS_ABOUT "&Hakkında" - IDS_TITLE "Karakter Eşlem" + IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu izlence özgür yazılımdır; bunu, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu izlence, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu izlencenin HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen güvencesi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu izlenceyle birlikte GNU Umûmî Kamu Ruhsatı'nın bir kopyasını almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + IDS_ABOUT "&Üzerine..." + IDS_TITLE "Damga Eşlemi" END diff --git a/reactos/base/applications/dxdiag/dxdiag.rc b/reactos/base/applications/dxdiag/dxdiag.rc index 3e8400ca315..cd4065c597f 100644 --- a/reactos/base/applications/dxdiag/dxdiag.rc +++ b/reactos/base/applications/dxdiag/dxdiag.rc @@ -69,15 +69,15 @@ IDI_APPICON ICON "res/dxdiag.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/dxdiag/lang/tr-TR.rc b/reactos/base/applications/dxdiag/lang/tr-TR.rc index 439359be220..39a43a1a75c 100644 --- a/reactos/base/applications/dxdiag/lang/tr-TR.rc +++ b/reactos/base/applications/dxdiag/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATORS: 2012 - Arda Tanrıkulu (ardatan) (ardatanrikulu@gmail.com); 2013, 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATORS: 2012 Arda Tanrıkulu (ardatan) (ardatanrikulu@gmail.com); 2013, 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -19,15 +19,15 @@ IDD_SYSTEM_DIALOG DIALOGEX 0, 0, 462, 220 STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Bu araç, dizgenizdeki yüklü ReactX bileşenleri ve sürücüleri hakkında ayrıntılı bilgi toplar.", -1, 10, 10, 443, 17 - LTEXT "Soruna hangi bölümün neden olduğunu biliyorsanız yukarıdaki uygun sekmeyi tıklatınız. Bilmiyorsanız sırayla her bölüme gitmek için aşağıdaki ""Sonraki Bölüm"" düğmesini kullanabilirsiniz.", -1, 10, 30, 443, 25 - GROUPBOX "Bilgisayar Bilgisi", -1, 10, 55, 443, 130, SS_RIGHT + LTEXT "Bu araç, dizgenizdeki yüklü ReactX bileşenleri ve sürücüleri üzerine ayrıntılı bilgi raporlar.", -1, 10, 10, 443, 17 + LTEXT "Soruna neden olan bölümü biliyorsanız yukarıdaki uygun sekmeyi tıklayınız. Yoksa sırayla her bir bölüme gitmek için aşağıdaki ""Sonraki Bölüm"" düğmesini kullanabilirsiniz.", -1, 10, 30, 443, 25 + GROUPBOX "Dizge Bilgisi", -1, 10, 55, 443, 130, SS_RIGHT LTEXT "Geçerli Zaman:", -1, 70, 70, 80, 10, SS_RIGHT - LTEXT "Ad:", -1, 70, 80, 80, 10, SS_RIGHT + LTEXT "Bilgisayar Adı:", -1, 70, 80, 80, 10, SS_RIGHT LTEXT "İşletim Dizgesi:", -1, 70, 90, 80, 10, SS_RIGHT LTEXT "Dil:", -1, 70, 100, 80, 10, SS_RIGHT - LTEXT "Üretici:", -1, 70, 110, 80, 10, SS_RIGHT - LTEXT "Biçim:", -1, 70, 120, 80, 10, SS_RIGHT + LTEXT "Dizge Üreticisi:", -1, 70, 110, 80, 10, SS_RIGHT + LTEXT "Dizge Modeli:", -1, 70, 120, 80, 10, SS_RIGHT LTEXT "BIOS:", -1, 70, 130, 80, 10, SS_RIGHT LTEXT "İşlemci:", -1, 70, 140, 80, 10, SS_RIGHT LTEXT "Bellek:", -1, 70, 150, 80, 10, SS_RIGHT @@ -56,7 +56,7 @@ BEGIN RTEXT "Yonga Türü:", -1, 20, 45, 70, 10 RTEXT "DAC Türü:", -1, 20, 55, 70, 10 RTEXT "Yaklaşık Toplam Bellek:", -1, 14, 65, 75, 10 - RTEXT "Geçerli Görüntü Seçeneği:", -1, 14, 75, 75, 10 + RTEXT "Şimdiki Görüntü Kipi:", -1, 14, 75, 75, 10 RTEXT "Göstergeç:", -1, 20, 85, 70, 10 LTEXT "", IDC_STATIC_ADAPTER_ID, 95, 25, 150, 10 LTEXT "", IDC_STATIC_ADAPTER_VENDOR, 95, 35, 150, 10 @@ -65,7 +65,7 @@ BEGIN LTEXT "", IDC_STATIC_ADAPTER_MEM, 95, 65, 150, 10 LTEXT "", IDC_STATIC_ADAPTER_MODE, 95, 75, 150, 10 LTEXT "", IDC_STATIC_ADAPTER_MONITOR, 95, 85, 150, 10 - GROUPBOX "Sürücüler", -1, 270, 10, 190, 100 + GROUPBOX "Sürücü", -1, 270, 10, 190, 100 RTEXT "Ana Sürücü:", -1, 275, 25, 55, 10 RTEXT "Sürüm:", -1, 275, 35, 55, 10 RTEXT "Zaman:", -1, 275, 45, 55, 10 @@ -128,7 +128,7 @@ BEGIN LTEXT "", IDC_STATIC_ADAPTER_PROVIDER, 335, 75, 100, 10 GROUPBOX "ReactX Husûsiyetleri", -1, 10, 115, 450, 60 CONTROL "", IDC_SLIDER_DSOUND, "msctls_trackbar32", TBS_BOTTOM | TBS_AUTOTICKS | WS_TABSTOP, 120, 135, 80, 17 - RTEXT "Donanım İvmesi:", -1, 20, 135, 90, 20 + RTEXT "Donanım Ses\nİvme Düzeyi:", -1, 20, 135, 90, 20 PUSHBUTTON "&ReactSound'u Sına", IDC_BUTTON_TESTDSOUND, 270, 134, 80, 14 GROUPBOX "Notlar", -1, 10, 180, 450, 40 EDITTEXT IDC_TEXT_DSOUNDINFO, 20, 192, 432, 20, WS_DISABLED | WS_TABSTOP @@ -178,46 +178,46 @@ BEGIN IDS_NETWORK_DIALOG "Ağ" IDS_HELP_DIALOG "Yardım" IDS_FORMAT_MB "%I64u MB RAM" - IDS_FORMAT_SWAP "%I64u MB kullanıldı, %I64u MB kullanılabilir" + IDS_FORMAT_SWAP "%I64u MB kullanılan, %I64u MB kullanılabilir." IDS_FORMAT_UNIPROC "%s (%u CPU)" IDS_FORMAT_MPPROC "%s (%u CPU)" IDS_VERSION_UNKNOWN "Bilinmeyen Sürüm" IDS_DEVICE_STATUS_ATTACHED "Bağlı" - IDS_DEVICE_STATUS_MISSING "Bağlı değil" + IDS_DEVICE_STATUS_MISSING "Bağlı Değil" IDS_DEVICE_STATUS_UNKNOWN "Bilinmiyor" IDS_DEVICE_NAME "Aygıt Adı" IDS_DEVICE_STATUS "Durum" IDS_DEVICE_CONTROLLER "Denetleyici Kimliği" IDS_DEVICE_MANUFACTURER "Üretici Kimliği" IDS_DEVICE_PRODUCT "Ürün Kimliği" - IDS_DEVICE_FORCEFEEDBACK "Güç Dönütlü Sürücüsü" + IDS_DEVICE_FORCEFEEDBACK "Güç Dönütlü Sürücü" IDS_NOT_APPLICABLE "Uygulanamaz" IDS_OPTION_YES "Evet" IDS_DIRECTPLAY_COL_NAME1 "Ad" - IDS_DIRECTPLAY_COL_NAME2 "Değer" + IDS_DIRECTPLAY_COL_NAME2 "Kayıt" IDS_DIRECTPLAY_COL_NAME3 "Kütük" IDS_DIRECTPLAY_COL_NAME4 "Sürüm" IDS_DIRECTPLAY8_MODEMSP "ReactPlay8 Çevirge Hizmeti Sağlayıcısı" IDS_DIRECTPLAY8_SERIALSP "ReactPlay8 Dizilik Hizmeti Sağlayıcısı" IDS_DIRECTPLAY8_IPXSP "ReactPlay8 IPX Hizmeti Sağlayıcısı" IDS_DIRECTPLAY8_TCPSP "ReactPlay8 TCP/IP Hizmeti Sağlayıcısı" - IDS_DIRECTPLAY_TCPCONN "ReactPlay için Örütbağ TCP/IP Bağlantısı" + IDS_DIRECTPLAY_TCPCONN "ReactPlay için Umûmî Ağ TCP/IP Bağlantısı" IDS_DIRECTPLAY_IPXCONN "ReactPlay için IPX Bağlantısı" IDS_DIRECTPLAY_MODEMCONN "ReactPlay için Çeivrge Bağlantısı" IDS_DIRECTPLAY_SERIALCONN "ReactPlay için Dizilik Bağlantı" IDS_REG_SUCCESS "Tamam" IDS_REG_FAIL "Yanlışlık" IDS_DDTEST_ERROR "Sınama başarısız oldu." - IDS_DDTEST_DESCRIPTION "ReactDraw arayüz sınaması başlatılacak. Sürdürülsün mü?" - IDS_DDPRIMARY_DESCRIPTION "Bu sınama, ReactDraw'ı birincil yüzeye çizmek için kullanacak. Görüntülüğe ak ve kara dikdörtgenler çizilecek. Sürdürülsün mü?" - IDS_DDPRIMARY_RESULT "Görüntülükte ak ve kara dikdörtgenler gördünüz mü?" - IDS_DDOFFSCREEN_DESCRIPTION "Bu sınama, ReactDraw'ı görüntülük dışı arabelleğe çizmek için kullanacak. Görüntülükte devinen bir ak dikdörtgen göreceksiniz. Sürdürülsün mü?" - IDS_DDOFFSCREEN_RESULT "Görüntülükte devinen bir ak dikdörtgen gördünüz mü?" - IDS_DDFULLSCREEN_DESCRIPTION "Bu sınama, ReactDraw'ı tüm görüntülükte çizmek için kullanacak. Tüm görüntülükte devinen bir ak dikdörtgen göreceksiniz. Sürdürülsün mü?" + IDS_DDTEST_DESCRIPTION "Bu, ReactDraw arayüz sınamasını başlatacak. Sürdürülsün mü?" + IDS_DDPRIMARY_DESCRIPTION "Bu sınama, ReactDraw'ı ana yüzeye çizmek için kullanacak. Ak ve kara dikdörtgenler çizilecektir. Sürdürülsün mü?" + IDS_DDPRIMARY_RESULT "Ak ve kara dikdörtgenler gördünüz mü?" + IDS_DDOFFSCREEN_DESCRIPTION "Bu sınama, ReactDraw'ı görüntülük dışı arabelleğe çizmek için kullanacak. Devinen bir ak dikdörtgen çizilecektir. Sürdürülsün mü?" + IDS_DDOFFSCREEN_RESULT "Devinen bir ak dikdörtgen gördünüz mü?" + IDS_DDFULLSCREEN_DESCRIPTION "Bu sınama, ReactDraw'ı tüm görüntülükte çizmek için kullanacak. Devinen bir ak dikdörtgen göreceksiniz. Sürdürülsün mü?" IDS_DDFULLSCREEN_RESULT "Tüm görüntülükte devinen bir ak dikdörtgen gördünüz mü?" IDS_FORMAT_ADAPTER_MEM "%u MB" - IDS_FORMAT_ADAPTER_MODE "%04u x %04u (%u bitlik) (%uHz)" + IDS_FORMAT_ADAPTER_MODE "%04u*%04u (%u bitlik) (%uHz)" IDS_OPTION_NO "Hayır" - IDS_D3DTEST_DESCRIPTION "React3D arayüz sınaması başlatılacak. Sürdürülsün mü?" + IDS_D3DTEST_DESCRIPTION "Bu, React3D arayüz sınamasını başlatılacak. Sürdürülsün mü?" IDS_D3DTEST_D3Dx "Bu sınama, donanım hızlandırmalı React3D %u arayüzünü kullanacak." END diff --git a/reactos/base/applications/fontview/fontview.rc b/reactos/base/applications/fontview/fontview.rc index 622ed719199..a04847298a4 100644 --- a/reactos/base/applications/fontview/fontview.rc +++ b/reactos/base/applications/fontview/fontview.rc @@ -66,15 +66,15 @@ END #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/fontview/lang/tr-TR.rc b/reactos/base/applications/fontview/lang/tr-TR.rc index 1630ff6cead..19755a4f403 100644 --- a/reactos/base/applications/fontview/lang/tr-TR.rc +++ b/reactos/base/applications/fontview/lang/tr-TR.rc @@ -1,14 +1,14 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT STRINGTABLE BEGIN IDS_INSTALL "Kur..." IDS_PRINT "Yazdır..." - IDS_STRING "ABCÇDEFGĞHIİJKLMNOÖPRSŞTUÜVYZ 1234567890" - IDS_OPEN "Yazı Türü Aç..." + IDS_STRING "Küçük karga, benim büyük kuvars sfenksimi seviyor. 1234567890" + IDS_OPEN "Yazı Tipi Aç..." IDS_ERROR "Yanlışlık" - IDS_ERROR_NOMEM "Bu işlemin bitirilmesi için yeterli bellek yok." - IDS_ERROR_NOFONT "%1 kütüğü, geçerli bir yazı türü kütüğü değil." + IDS_ERROR_NOMEM "Bu işlemi bitirmek için yeterli bellek yok." + IDS_ERROR_NOFONT "%1 kütüğü, geçerli bir yazı tipi kütüğü değil." IDS_ERROR_NOCLASS "Pencere sınıfı başlatılamadı." END diff --git a/reactos/base/applications/games/solitaire/lang/tr-TR.rc b/reactos/base/applications/games/solitaire/lang/tr-TR.rc index 26eb43921ab..5df4d84d81f 100644 --- a/reactos/base/applications/games/solitaire/lang/tr-TR.rc +++ b/reactos/base/applications/games/solitaire/lang/tr-TR.rc @@ -3,7 +3,7 @@ * LICENSE: Freeware, permission to use under Public Domain * FILE: base/applications/games/solitaire/lang/tr-TR.rc * PURPOSE: Turkish Resource File for ReactOS Solitaire - * TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -72,7 +72,7 @@ BEGIN POPUP "&Yardım" BEGIN MENUITEM "&İçindekiler\tF1", IDM_HELP_CONTENTS - MENUITEM "&Hakkında", IDM_HELP_ABOUT + MENUITEM "&Üzerine...", IDM_HELP_ABOUT END END diff --git a/reactos/base/applications/games/spider/lang/tr-TR.rc b/reactos/base/applications/games/spider/lang/tr-TR.rc index 515d791e30a..f6df4f09f76 100644 --- a/reactos/base/applications/games/spider/lang/tr-TR.rc +++ b/reactos/base/applications/games/spider/lang/tr-TR.rc @@ -3,7 +3,7 @@ * LICENSE: See COPYING in top level directory * FILE: base/applications/games/spider/lang/tr-TR.rc * PURPOSE: Turkish Resource File for ReactOS Spider Solitaire - * TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -69,7 +69,7 @@ BEGIN POPUP "&Yardım" BEGIN MENUITEM "&İçindekiler\tF1", IDM_HELP_CONTENTS - MENUITEM "&Hakkında", IDM_HELP_ABOUT + MENUITEM "&Üzerine...", IDM_HELP_ABOUT END END diff --git a/reactos/base/applications/games/winmine/lang/tr-TR.rc b/reactos/base/applications/games/winmine/lang/tr-TR.rc index b75af37a7c6..3a6cc118919 100644 --- a/reactos/base/applications/games/winmine/lang/tr-TR.rc +++ b/reactos/base/applications/games/winmine/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATORS: 2006 - Fatih Aşıcı, 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATORS: 2006 Fatih Aşıcı, 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -27,7 +27,7 @@ BEGIN POPUP "&Yardım" BEGIN MENUITEM "&En Kısa Süreler...", IDM_TIMES - MENUITEM "&Hakkında", IDM_ABOUT + MENUITEM "&Üzerine...", IDM_ABOUT END END diff --git a/reactos/base/applications/kbswitch/kbswitch.rc b/reactos/base/applications/kbswitch/kbswitch.rc index c8bfdd80b62..06d00ca9089 100644 --- a/reactos/base/applications/kbswitch/kbswitch.rc +++ b/reactos/base/applications/kbswitch/kbswitch.rc @@ -62,15 +62,15 @@ IDI_MAIN ICON "res/kbswitch.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/kbswitch/lang/tr-TR.rc b/reactos/base/applications/kbswitch/lang/tr-TR.rc index e31710ffb63..612c24585e7 100644 --- a/reactos/base/applications/kbswitch/lang/tr-TR.rc +++ b/reactos/base/applications/kbswitch/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT diff --git a/reactos/base/applications/magnify/lang/tr-TR.rc b/reactos/base/applications/magnify/lang/tr-TR.rc index 3bfd90af38f..5eb162d02f0 100644 --- a/reactos/base/applications/magnify/lang/tr-TR.rc +++ b/reactos/base/applications/magnify/lang/tr-TR.rc @@ -3,7 +3,7 @@ * LICENSE: GPL - See COPYING in the top level directory * FILE: base/applications/magnify/lang/tr-TR.rc * PURPOSE: Turkish Resource File for RecatOS Magnifier - * TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -15,7 +15,7 @@ BEGIN MENUITEM "&Çıkış", IDM_EXIT MENUITEM "&Seçenekler...", IDM_OPTIONS MENUITEM SEPARATOR - MENUITEM "&Hakkında", IDM_ABOUT + MENUITEM "&Üzerine...", IDM_ABOUT END END @@ -27,7 +27,7 @@ END IDD_ABOUTBOX DIALOGEX 22, 17, 220, 75 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Hakkında" +CAPTION "Üzerine" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN ICON IDI_ICON, IDC_MYICON, 14, 9, 20, 20 diff --git a/reactos/base/applications/mmc/lang/tr-TR.rc b/reactos/base/applications/mmc/lang/tr-TR.rc index ce784400633..517b0249cd1 100644 --- a/reactos/base/applications/mmc/lang/tr-TR.rc +++ b/reactos/base/applications/mmc/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -12,7 +12,7 @@ BEGIN END POPUP "&Yardım" BEGIN - MENUITEM "&Hakkında...", IDM_HELP_ABOUT + MENUITEM "&Üzerine...", IDM_HELP_ABOUT END END @@ -30,7 +30,7 @@ BEGIN END POPUP "&Yardım" BEGIN - MENUITEM "&Hakkında...", IDM_HELP_ABOUT + MENUITEM "&Üzerine...", IDM_HELP_ABOUT END END diff --git a/reactos/base/applications/mmc/mmc.rc b/reactos/base/applications/mmc/mmc.rc index be7acf77406..91d9e99ed2b 100644 --- a/reactos/base/applications/mmc/mmc.rc +++ b/reactos/base/applications/mmc/mmc.rc @@ -68,15 +68,15 @@ IDI_MAINAPP ICON "resources/mmc.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/mplay32/lang/tr-TR.rc b/reactos/base/applications/mplay32/lang/tr-TR.rc index 2f1e2f9d0a4..bdf4b2521cc 100644 --- a/reactos/base/applications/mplay32/lang/tr-TR.rc +++ b/reactos/base/applications/mplay32/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013, 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013, 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -15,11 +15,11 @@ BEGIN BEGIN MENUITEM "&Husûsiyetler", IDM_DEVPROPS MENUITEM SEPARATOR - MENUITEM "&Ses Düzeyi Denetleyicisi", IDM_VOLUMECTL + MENUITEM "&Ses Düzeyi Denetimi", IDM_VOLUMECTL END POPUP "&Yardım" BEGIN - MENUITEM "&Hakkında", IDM_ABOUT + MENUITEM "&Üzerine...", IDM_ABOUT END END @@ -29,12 +29,12 @@ BEGIN IDS_TOOLTIP_PLAY "Çal" IDS_TOOLTIP_STOP "Durdur" IDS_TOOLTIP_EJECT "Çıkar" - IDS_TOOLTIP_BACKWARD "Bir Önceki" + IDS_TOOLTIP_BACKWARD "Bir Öncekine Geç" IDS_TOOLTIP_SEEKBACK "Geri Sar" IDS_TOOLTIP_SEEKFORW "İleri Sar" - IDS_TOOLTIP_FORWARD "Bir Sonraki" + IDS_TOOLTIP_FORWARD "Bir Sonrakine Geç" IDS_APPTITLE "Ortam Oynatıcısı" IDS_PLAY "Çal" - IDS_DEFAULTMCIERRMSG "Bu yanlışlığın tanımı yoktur." + IDS_DEFAULTMCIERRMSG "Bu yanlışlığın hiçbir tanımı yoktur." IDS_UNKNOWNFILEEXT "Verilen kütük türünden aygıt türü belirlenemiyor." END diff --git a/reactos/base/applications/mplay32/mplay32.rc b/reactos/base/applications/mplay32/mplay32.rc index ae94fbdfc3c..f55f31288e3 100644 --- a/reactos/base/applications/mplay32/mplay32.rc +++ b/reactos/base/applications/mplay32/mplay32.rc @@ -75,15 +75,15 @@ IDB_PAUSEICON BITMAP "resources/pause.bmp" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/msconfig/lang/tr-TR.rc b/reactos/base/applications/msconfig/lang/tr-TR.rc index 7d5cd240e18..a96b9fb9fe2 100644 --- a/reactos/base/applications/msconfig/lang/tr-TR.rc +++ b/reactos/base/applications/msconfig/lang/tr-TR.rc @@ -1,11 +1,11 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT IDD_MSCONFIG_DIALOG DIALOGEX 0, 0, 378, 220 STYLE DS_SHELLFONT | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU -CAPTION "Dizge Yapılandırıcı" +CAPTION "Dizge Yapılandırma İzlencesi" FONT 8, "MS Shell Dlg" BEGIN CONTROL "Tab1", IDC_TAB, "SysTabControl32", WS_TABSTOP, 2, 2, 374, 195 @@ -21,8 +21,8 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "List3", IDC_STARTUP_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 2, 1, 360, 148 - PUSHBUTTON "&Hepsini Etkinleştir", IDC_BTN_STARTUP_ACTIVATE, 223, 155, 66, 14 - PUSHBUTTON "H&epsini Edilginleştir", IDC_BTN_STARTUP_DEACTIVATE, 295, 155, 66, 14 + PUSHBUTTON "&Tümünü Etkinleştir", IDC_BTN_STARTUP_ACTIVATE, 223, 155, 66, 14 + PUSHBUTTON "T&ümünü Edilginleştir", IDC_BTN_STARTUP_DEACTIVATE, 295, 155, 66, 14 END IDD_SYSTEM_PAGE DIALOGEX 0, 0, 362, 175 @@ -32,15 +32,15 @@ BEGIN CONTROL "", IDC_SYSTEM_TREE, "SysTreeView32", TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS | TVS_SHOWSELALWAYS | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 2, 1, 280, 148 - PUSHBUTTON "B&ir Yukarı Taşı", IDC_BTN_SYSTEM_UP, 290, 5, 66, 14 - PUSHBUTTON "Bi&r Aşağı Taşı", IDC_BTN_SYSTEM_DOWN, 290, 25, 66, 14 - PUSHBUTTON "E&tkinleştir", IDC_BTN_SYSTEM_ENABLE, 290, 50, 66, 14 + PUSHBUTTON "&Yukarı Taşı", IDC_BTN_SYSTEM_UP, 290, 5, 66, 14 + PUSHBUTTON "&Aşağı Taşı", IDC_BTN_SYSTEM_DOWN, 290, 25, 66, 14 + PUSHBUTTON "&Etkinleştir", IDC_BTN_SYSTEM_ENABLE, 290, 50, 66, 14 PUSHBUTTON "E&dilginleştir", IDC_BTN_SYSTEM_DISABLE, 290, 70, 66, 14 - PUSHBUTTON "&Ara", IDC_BTN_SYSTEM_FIND, 290, 95, 66, 14 - PUSHBUTTON "&Yeni", IDC_BTN_SYSTEM_NEW, 290, 115, 66, 14 + PUSHBUTTON "A&ra", IDC_BTN_SYSTEM_FIND, 290, 95, 66, 14 + PUSHBUTTON "Ye&ni", IDC_BTN_SYSTEM_NEW, 290, 115, 66, 14 PUSHBUTTON "De&ğiştir", IDC_BTN_SYSTEM_EDIT, 290, 135, 66, 14 - PUSHBUTTON "&Hepsini Etkinleştir", IDC_BTN_SYSTEM_ACTIVATE, 123, 155, 66, 14 - PUSHBUTTON "H&epsini Edilginleştir", IDC_BTN_SYSTEM_DEACTIVATE, 195, 155, 66, 14 + PUSHBUTTON "&Tümünü Etkinleştir", IDC_BTN_SYSTEM_ACTIVATE, 123, 155, 66, 14 + PUSHBUTTON "T&ümünü Edilginleştir", IDC_BTN_SYSTEM_DEACTIVATE, 195, 155, 66, 14 END IDD_TOOLS_PAGE DIALOGEX 0, 0, 362, 175 @@ -59,21 +59,21 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "List1", IDC_SERVICES_LIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 2, 1, 360, 148 - PUSHBUTTON "&Hepsini Etkinleştir", IDC_BTN_SERVICES_ACTIVATE, 223, 155, 66, 14 - PUSHBUTTON "H&epsini Edilginleştir", IDC_BTN_SERVICES_DEACTIVATE, 295, 155, 66, 14 + PUSHBUTTON "&Tümünü Etkinleştir", IDC_BTN_SERVICES_ACTIVATE, 223, 155, 66, 14 + PUSHBUTTON "T&ümünü Edilginleştir", IDC_BTN_SERVICES_DEACTIVATE, 295, 155, 66, 14 END IDD_GENERAL_PAGE DIALOGEX 0, 0, 362, 175 STYLE DS_SHELLFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Başlangıç Seçenekleri", -1, 10, 10, 340, 150,0, WS_EX_TRANSPARENT - CONTROL "&Bilindik Başlangıç (Sürücülerin ve hizmetlerin tümü yüklensin.)", IDC_CBX_NORMAL_START, "Button", 0x50010009, 20, 30, 260, 10 - CONTROL "&Tanılık Başlangıç (Yalnızca sürücülerin ve hizmetlerin zorunluları yüklensin.)", IDC_CBX_DIAGNOSTIC_START, "Button", 0x50010009, 20, 45, 260, 10 + GROUPBOX "Başlangıç Seçimi", -1, 10, 10, 340, 150,0, WS_EX_TRANSPARENT + CONTROL "&Düzgülü Başlangıç - Tüm aygıt sürücülerini ve hizmetleri yükle.", IDC_CBX_NORMAL_START, "Button", 0x50010009, 20, 30, 260, 10 + CONTROL "&Tanılama Başlangıcı - Yalnızca ana aygıtları ve ana hizmetleri yükle.", IDC_CBX_DIAGNOSTIC_START, "Button", 0x50010009, 20, 45, 260, 10 CONTROL "&Seçmeli Başlangıç", IDC_CBX_SELECTIVE_STARTUP, "Button", 0x50010009, 20, 60, 260, 10 - AUTOCHECKBOX "syst&em.ini Kütüğünü Yükle", IDC_CBX_SYSTEM_INI, 30, 80, 260, 10 - AUTOCHECKBOX "&Hizmetleri Yükle", IDC_CBX_SYSTEM_SERVICE, 30, 95, 260, 10 - AUTOCHECKBOX "B&aşlangıç Öğelerini Yükle", IDC_CBX_STARTUP_ITEM, 30, 110, 260, 10 + AUTOCHECKBOX "S&YSTEM.INI Kütüğünü İşle", IDC_CBX_SYSTEM_INI, 30, 80, 260, 10 + AUTOCHECKBOX "D&izge Hizmetlerini Yükle", IDC_CBX_SYSTEM_SERVICE, 30, 95, 260, 10 + AUTOCHECKBOX "&Başlangıç Öğelerini Yükle", IDC_CBX_STARTUP_ITEM, 30, 110, 260, 10 END IDD_FREELDR_PAGE DIALOGEX 0, 0, 362, 175 @@ -83,9 +83,9 @@ BEGIN LISTBOX IDC_LIST_BOX, 10, 10, 340, 50, WS_CHILD | WS_VISIBLE | WS_TABSTOP | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL PUSHBUTTON "&Tüm Ön Yükleme Yollarını Denetle", IDC_BTN_CHECK_BOOT_PATH, 10, 65, 70, 12 - PUSHBUTTON "&Öntanımlı Yap", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 - PUSHBUTTON "B&ir Yukarı Taşı", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 - PUSHBUTTON "Bi&r Aşağı Taşı", IDC_BTN_MOVE_DOWN_BOOT_OPTION, 280, 65, 70, 12 + PUSHBUTTON "&Ön Tanımlı Olarak Ayarla", IDC_BTN_SET_DEFAULT_BOOT, 100, 65, 70, 12 + PUSHBUTTON "&Yukarı Taşı", IDC_BTN_MOVE_UP_BOOT_OPTION, 190, 65, 70, 12 + PUSHBUTTON "&Aşağı Taşı", IDC_BTN_MOVE_DOWN_BOOT_OPTION, 280, 65, 70, 12 GROUPBOX "Ön Yükleme Seçenekleri", -1, 10, 80, 250, 90, 0, WS_EX_TRANSPARENT CHECKBOX "/SA&FEBOOT", IDC_CBX_SAFE_BOOT, 15, 90, 55, 10 CHECKBOX "/&NOGUIBOOT", IDC_CBX_NO_GUI_BOOT, 15, 105, 60, 10 @@ -93,9 +93,9 @@ BEGIN CHECKBOX "/BAS&EVIDEO", IDC_CBX_BASE_VIDEO, 15, 135, 55, 10 CHECKBOX "/S&OS", IDC_CBX_SOS, 15, 150, 50, 10 PUSHBUTTON "&Gelişmiş Seçenekler...", IDC_BTN_ADVANCED_OPTIONS, 100, 150, 70, 12 - LTEXT "&Verilen Süre:", -1, 280, 91, 30, 10 + LTEXT "&Süre Aşımı:", -1, 280, 91, 30, 10 EDITTEXT IDC_TXT_BOOT_TIMEOUT, 310, 90, 25, 12, ES_LEFT - LTEXT "sec.", -1, 340, 91, 15, 10 + LTEXT "s", -1, 340, 91, 15, 10 END IDD_FREELDR_ADVANCED_PAGE DIALOGEX 0, 0, 175, 175 @@ -125,7 +125,7 @@ END STRINGTABLE BEGIN - IDS_MSCONFIG "Dizge Yapılandırıcı" + IDS_MSCONFIG "Dizge Yapılandırma İzlencesi" IDS_TAB_GENERAL "Umûmî" IDS_TAB_SYSTEM "SYSTEM.INI" IDS_TAB_FREELDR "FREELDR.INI" @@ -145,12 +145,12 @@ END STRINGTABLE BEGIN IDS_TOOLS_COLUMN_NAME "Ad" - IDS_TOOLS_COLUMN_DESCR "Tanım" + IDS_TOOLS_COLUMN_DESCR "Açıklama" IDS_TOOLS_CMD_NAME "Komut İstemi" IDS_TOOLS_CMD_DESCR "Komut İstemi'ni açar." IDS_TOOLS_CMD_CMD "cmd.exe" - IDS_TOOLS_INFO_NAME "ReactOS Sürümü Bilgisi" - IDS_TOOLS_INFO_DESCR "ReactOS'un sürüm bilgisini görüntüler." + IDS_TOOLS_INFO_NAME "Sürüm" + IDS_TOOLS_INFO_DESCR "Sürüm bilgisini görüntüler." IDS_TOOLS_INFO_CMD "winver.exe" IDS_TOOLS_REGEDIT_NAME "Değer Defteri Düzenleyicisi" IDS_TOOLS_REGEDIT_DESCR "Değer Defteri Düzenleyicisi'ni açar." @@ -169,5 +169,5 @@ BEGIN IDS_SERVICES_STATUS_RUNNING "Çalışıyor" IDS_SERVICES_STATUS_STOPPED "Durduruldu" IDS_SERVICES_YES "Evet" - IDS_SERVICES_UNKNOWN "Bilinmiyor" + IDS_SERVICES_UNKNOWN "Bilinmeyen" END diff --git a/reactos/base/applications/msconfig/msconfig.rc b/reactos/base/applications/msconfig/msconfig.rc index 1173da05cb7..df7d1839e5b 100644 --- a/reactos/base/applications/msconfig/msconfig.rc +++ b/reactos/base/applications/msconfig/msconfig.rc @@ -78,6 +78,9 @@ IDI_APPICON ICON "res/msconfig.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif @@ -87,9 +90,6 @@ IDI_APPICON ICON "res/msconfig.ico" #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/mscutils/devmgmt/devmgmt.rc b/reactos/base/applications/mscutils/devmgmt/devmgmt.rc index a4a61fd9942..b535652f158 100644 --- a/reactos/base/applications/mscutils/devmgmt/devmgmt.rc +++ b/reactos/base/applications/mscutils/devmgmt/devmgmt.rc @@ -78,6 +78,9 @@ IDB_EXIT BITMAP "res/exit.bmp" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif @@ -87,9 +90,6 @@ IDB_EXIT BITMAP "res/exit.bmp" #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/mscutils/devmgmt/lang/tr-TR.rc b/reactos/base/applications/mscutils/devmgmt/lang/tr-TR.rc index 33f09cc9783..8d1e5ef8434 100644 --- a/reactos/base/applications/mscutils/devmgmt/lang/tr-TR.rc +++ b/reactos/base/applications/mscutils/devmgmt/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -28,7 +28,7 @@ BEGIN POPUP "&Yardım" BEGIN MENUITEM "&Yardım", IDC_PROGHELP - MENUITEM "&Hakkında", IDC_ABOUT + MENUITEM "&Üzerine...", IDC_ABOUT END END @@ -43,11 +43,11 @@ BEGIN END IDD_ABOUTBOX DIALOGEX 22,16,190,182 -CAPTION "Aygıt Yöneticisi Hakkında" +CAPTION "Aygıt Yöneticisi Üzerine" FONT 8,"MS Shell Dlg",0,0 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME BEGIN - LTEXT "Aygıt Yöneticisi - Sürüm: 0.1\nTelif Hakkı: 2006\nGed Murphy (gedmurphy@gmail.com) eliyle yazılmıştır.", IDC_STATIC, 48, 7, 130, 30 + LTEXT "Aygıt Yöneticisi - Sürüm: 0.1\nTelif Hakkı: 2006\nGed Murphy (gedmurphy@gmail.com) eliyle.", IDC_STATIC, 48, 7, 130, 30 PUSHBUTTON "Tamam", IDOK, 75, 162, 44, 15 ICON IDI_MAIN_ICON, IDC_STATIC, 10, 10, 7, 30 EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE @@ -55,7 +55,7 @@ END STRINGTABLE BEGIN - IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu izlence özgür yazılımdır; bunu, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu izlence, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu izlencenin HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen güvencesi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu izlenceyle birlikte GNU Umûmî Kamu Ruhsatı'nın bir kopyasını almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." END STRINGTABLE @@ -71,16 +71,15 @@ STRINGTABLE BEGIN IDS_APPNAME "Aygıt Yöneticisi" IDS_HINT_BLANK " " - IDS_HINT_EXIT " Yazılımdan çıkar." + IDS_HINT_EXIT " İzlenceden çıkar." IDS_HINT_REFRESH " Hizmet dizelgesini yeniler." - IDS_HINT_PROP " Seçilen öğenin husûsiyetlerini gösterir." - IDS_HINT_HELP " Yardım konularını açar." - IDS_HINT_ABOUT " Aygıt Yöneticisi hakkında bilgi görüntüler." - - IDS_HINT_SYS_RESTORE " Pencerenin boyutlarını, eski durumuna döndürür." - IDS_HINT_SYS_MOVE " Pencerenin konumunu değiştirir." - IDS_HINT_SYS_SIZE " Pencerenin boyutlarını değiştirir." - IDS_HINT_SYS_MINIMIZE " Pencereyi, simge durumuna küçültür." - IDS_HINT_SYS_MAXIMIZE " Pencereyle görüntülüğü kaplatır." - IDS_HINT_SYS_CLOSE " Pencereyi kapatır." + IDS_HINT_PROP " Seçilen için husûsiyetler penceresini açar." + IDS_HINT_HELP " Yardım penceresini açar." + IDS_HINT_ABOUT " Aygıt Yöneticisi üzerine." + IDS_HINT_SYS_RESTORE " Bu pencereyi eski boyutlarına döndürür." + IDS_HINT_SYS_MOVE " Bu pencereyi devindirir." + IDS_HINT_SYS_SIZE " Bu pencerenin boyutlarını değiştirir." + IDS_HINT_SYS_MINIMIZE " Bu pencereyi simge durumuna küçültür." + IDS_HINT_SYS_MAXIMIZE " Bu pencereyi, bu görüntülüğü kaplatana dek genişletir." + IDS_HINT_SYS_CLOSE " Bu pencereyi kapatır." END diff --git a/reactos/base/applications/mscutils/devmgmt_new/lang/tr-TR.rc b/reactos/base/applications/mscutils/devmgmt_new/lang/tr-TR.rc index b56b11ce701..f21d6341a43 100644 --- a/reactos/base/applications/mscutils/devmgmt_new/lang/tr-TR.rc +++ b/reactos/base/applications/mscutils/devmgmt_new/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -16,14 +16,14 @@ BEGIN END POPUP "&Görünüm" BEGIN - MENUITEM "&Türe Göre Aygıtlar", IDC_DEVBYTYPE, CHECKED - MENUITEM "&Bağlantıya Göre Aygıtlar", IDC_STATIC, GRAYED - MENUITEM "T&üre Göre Kaynaklar", IDC_STATIC, GRAYED - MENUITEM "B&ağlantıya Göre Kaynaklar", IDC_STATIC, GRAYED + MENUITEM "&Türe Göre Aygıtlar", IDC_DEVBYTYPE, CHECKED + MENUITEM "&Bağlantıya Göre Aygıtlar", IDC_STATIC, GRAYED + MENUITEM "T&üre Göre Kaynaklar", IDC_STATIC, GRAYED + MENUITEM "B&ağlantıya Göre Kaynaklar", IDC_STATIC, GRAYED END POPUP "&Yardım" BEGIN - MENUITEM "&Hakkında", IDC_ABOUT + MENUITEM "&Üzerine...", IDC_ABOUT END END @@ -36,11 +36,11 @@ BEGIN END IDD_ABOUTBOX DIALOGEX 22,16,190,182 -CAPTION "Aygıt Yöneticisi Hakkında" +CAPTION "Aygıt Yöneticisi Üzerine" FONT 8,"MS Shell Dlg",0,0 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME BEGIN - LTEXT "Aygıt Yöneticisi - Sürüm: 0.1\nTelif Hakkı: 2006\nGed Murphy (gedmurphy@gmail.com) eliyle yazılmıştır.", IDC_STATIC, 48, 7, 130, 30 + LTEXT "Aygıt Yöneticisi - Sürüm: 0.1\nTelif Hakkı: 2006\nGed Murphy (gedmurphy@gmail.com) eliyle.", IDC_STATIC, 48, 7, 130, 30 PUSHBUTTON "Tamam", IDOK, 75, 162, 44, 15 ICON IDI_MAIN_ICON, IDC_STATIC, 10, 10, 7, 30 EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE @@ -48,7 +48,7 @@ END STRINGTABLE BEGIN - IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu izlence özgür yazılımdır; bunu, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu izlence, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu izlencenin HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen güvencesi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu izlenceyle birlikte GNU Umûmî Kamu Ruhsatı'nın bir kopyasını almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." END STRINGTABLE @@ -64,16 +64,15 @@ STRINGTABLE BEGIN IDS_APPNAME "Aygıt Yöneticisi" IDS_HINT_BLANK " " - IDS_HINT_EXIT " Yazılımdan çıkar." + IDS_HINT_EXIT " İzlenceden çıkar." IDS_HINT_REFRESH " Hizmet dizelgesini yeniler." - IDS_HINT_PROP " Seçilen öğenin husûsiyetlerini gösterir." - IDS_HINT_HELP " Yardım konularını açar." - IDS_HINT_ABOUT " Aygıt Yöneticisi hakkında bilgi görüntüler." - - IDS_HINT_SYS_RESTORE " Pencerenin boyutlarını, eski durumuna döndürür." - IDS_HINT_SYS_MOVE " Pencerenin konumunu değiştirir." - IDS_HINT_SYS_SIZE " Pencerenin boyutlarını değiştirir." - IDS_HINT_SYS_MINIMIZE " Pencereyi, simge durumuna küçültür." - IDS_HINT_SYS_MAXIMIZE " Pencereyle görüntülüğü kaplatır." - IDS_HINT_SYS_CLOSE " Pencereyi kapatır." + IDS_HINT_PROP " Seçilen için husûsiyetler penceresini açar." + IDS_HINT_HELP " Yardım penceresini açar." + IDS_HINT_ABOUT " Aygıt Yöneticisi üzerine." + IDS_HINT_SYS_RESTORE " Bu pencereyi eski boyutlarına döndürür." + IDS_HINT_SYS_MOVE " Bu pencereyi devindirir." + IDS_HINT_SYS_SIZE " Bu pencerenin boyutlarını değiştirir." + IDS_HINT_SYS_MINIMIZE " Bu pencereyi simge durumuna küçültür." + IDS_HINT_SYS_MAXIMIZE " Bu pencereyi, bu görüntülüğü kaplatana dek genişletir." + IDS_HINT_SYS_CLOSE " Bu pencereyi kapatır." END diff --git a/reactos/base/applications/mscutils/eventvwr/eventvwr.rc b/reactos/base/applications/mscutils/eventvwr/eventvwr.rc index aaf38ce9fa2..29058175908 100644 --- a/reactos/base/applications/mscutils/eventvwr/eventvwr.rc +++ b/reactos/base/applications/mscutils/eventvwr/eventvwr.rc @@ -69,15 +69,15 @@ IDI_ERRORICON ICON "res/error.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/mscutils/eventvwr/lang/tr-TR.rc b/reactos/base/applications/mscutils/eventvwr/lang/tr-TR.rc index 39fbbdad68d..50cc321270c 100644 --- a/reactos/base/applications/mscutils/eventvwr/lang/tr-TR.rc +++ b/reactos/base/applications/mscutils/eventvwr/lang/tr-TR.rc @@ -1,10 +1,16 @@ -/* TRANSLATOR: 2013, 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* + * PROJECT: ReactOS Event Viewer + * LICENSE: GPL - See COPYING in the top level directory + * FILE: base/applications/mscutils/eventvwr/lang/tr-TR.rc + * PURPOSE: Turkish Language File for ReactOS Event Viewer + * TRANSLATOR: 2013, 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) + */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT IDC_EVENTVWR MENU BEGIN - POPUP "&Olaylar" + POPUP "&Kayıt" BEGIN MENUITEM "&Uygulama", ID_LOG_APPLICATION MENUITEM "&Güvenlik", ID_LOG_SECURITY @@ -21,7 +27,7 @@ BEGIN BEGIN MENUITEM "&Yardım", IDM_HELP MENUITEM SEPARATOR - MENUITEM "&Hakkında", IDM_ABOUT + MENUITEM "&Üzerine...", IDM_ABOUT END END @@ -33,7 +39,7 @@ END IDD_ABOUTBOX DIALOGEX 0, 0, 230, 75 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_CAPTION | WS_SYSMENU -CAPTION "Hakkında" +CAPTION "Üzerine" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN ICON IDI_EVENTVWR, IDC_MYICON, 14, 9, 21, 20 @@ -47,7 +53,7 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER CAPTION "Yükleniyor" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - CTEXT "Olaylar yükleniyor, bekleyiniz.", IDC_STATIC, 0, 15, 230, 8, SS_NOPREFIX + CTEXT "Olay kayıtları yükleniyor. Lütfen bekleyiniz.", IDC_STATIC, 0, 15, 230, 8, SS_NOPREFIX END IDD_EVENTDETAILDIALOG DIALOGEX 0, 0, 276, 282 @@ -57,8 +63,8 @@ CAPTION "Olay Ayrıntıları" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "&Kapat", IDOK, 12, 258, 50, 14 - PUSHBUTTON "Bir &Önceki", IDPREVIOUS, 78, 258, 50, 14 - PUSHBUTTON "Bir &Sonraki", IDNEXT, 144, 258, 50, 14 + PUSHBUTTON "&Önceki", IDPREVIOUS, 78, 258, 50, 14 + PUSHBUTTON "&Sonraki", IDNEXT, 144, 258, 50, 14 PUSHBUTTON "&Yardım", IDHELP, 210, 258, 50, 14 EDITTEXT IDC_EVENTTEXTEDIT, 14, 81, 247, 108, ES_MULTILINE | ES_READONLY LTEXT "Açıklama:", IDC_STATIC, 15, 70, 39, 8 @@ -79,7 +85,7 @@ BEGIN LTEXT "Ulam:", IDC_STATIC, 133, 55, 36, 8 EDITTEXT IDC_EVENTCATEGORYSTATIC, 175, 55, 87, 8, ES_LEFT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP | ES_AUTOHSCROLL EDITTEXT IDC_EVENTDATAEDIT, 14, 204, 247, 44, ES_MULTILINE | ES_READONLY - LTEXT "&Veri:", IDC_STATIC, 14, 194, 20, 8 + LTEXT "Veri:", IDC_STATIC, 14, 194, 20, 8 CONTROL "&Çoklu", IDC_BYTESRADIO, "Button", BS_AUTORADIOBUTTON, 39, 194, 34, 8 CONTROL "Sö&zcük", IDC_WORDRADIO, "Button", BS_AUTORADIOBUTTON, 77, 194, 33, 8 END @@ -88,8 +94,8 @@ STRINGTABLE BEGIN IDS_APP_TITLE "Olay Görüntüleyicisi" IDS_APP_TITLE_EX "%s - %s Oturum Aç \\\\" - IDS_STATUS_MSG "%s'nin %lu olayı vardır." - IDS_EVENTSTRINGIDNOTFOUND "Kaynaktaki olay kimliği (%lu) için açıklama (%s) bulunamadı. Yerli bilgisayarda, uzaktaki bilgisayardan ileti görüntülemesi için gerekli, değer bilgileri veyâ kitaplıklar olmayabilir." + IDS_STATUS_MSG "%s'nin %lu olayı var." + IDS_EVENTSTRINGIDNOTFOUND "%s kaynağındaki %lu olay kimliği için açıklama bulunamıyor. Yerli bilgisayarda, uzak bilgisayardan iletileri görüntülemesi için gerekli Değer Defteri bilgisi veyâ ileti DLL kütükleri olmayabilir." IDS_EVENTLOG_ERROR_TYPE "Yanlışlık" IDS_EVENTLOG_WARNING_TYPE "Uyarı" IDS_EVENTLOG_INFORMATION_TYPE "Bilgi" @@ -106,7 +112,7 @@ BEGIN IDS_COLUMNTIME "Saat" IDS_COLUMNSOURCE "Kaynak" IDS_COLUMNCATEGORY "Ulam" - IDS_COLUMNEVENT "Olay Kimliği" + IDS_COLUMNEVENT "Olay" IDS_COLUMNUSER "Kullanıcı" IDS_COLUMNCOMPUTER "Bilgisayar" IDS_COLUMNEVENTDATA "Olay Verisi" diff --git a/reactos/base/applications/mscutils/servman/lang/tr-TR.rc b/reactos/base/applications/mscutils/servman/lang/tr-TR.rc index 59c53842235..6d90b1c12aa 100644 --- a/reactos/base/applications/mscutils/servman/lang/tr-TR.rc +++ b/reactos/base/applications/mscutils/servman/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -40,7 +40,7 @@ BEGIN POPUP "&Yardım" BEGIN MENUITEM "&Yardım", ID_HELP - MENUITEM "&Hakkında", ID_ABOUT + MENUITEM "&Üzerine...", ID_ABOUT END END @@ -66,18 +66,18 @@ BEGIN END IDD_ABOUTBOX DIALOGEX 22, 16, 190, 182 -CAPTION "Hakkında" +CAPTION "Himet Yöneticisi Üzerine" FONT 8, "MS Shell Dlg", 0, 0 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME BEGIN - LTEXT "Hizmet Yöneticisi - Sürüm: 0.8\nTelif Hakkı: 2005-2007\nGed Murphy (gedmurphy@reactos.org) eliyle yazılmıştır.", IDC_STATIC, 48, 7, 135, 30 + LTEXT "Hizmet Yöneticisi - Sürüm: 0.8\nTelif Hakkı: 2005-2007\nGed Murphy (gedmurphy@reactos.org) eliyle.", IDC_STATIC, 48, 7, 135, 30 PUSHBUTTON "Tamam", IDOK, 75, 162, 44, 15 ICON IDI_SM_ICON, IDC_STATIC, 10, 10, 7, 30 EDITTEXT IDC_LICENSE_EDIT, 8, 44, 174, 107, WS_VISIBLE | WS_VSCROLL | WS_TABSTOP | ES_READONLY | ES_MULTILINE END IDD_DLG_GENERAL DIALOGEX 6, 6, 253, 232 -CAPTION "Başlıca" +CAPTION "Umûmî" FONT 8, "MS Shell Dlg", 0, 0 STYLE DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_DLGFRAME | WS_SYSMENU | WS_GROUP | WS_TABSTOP BEGIN @@ -90,15 +90,15 @@ BEGIN PUSHBUTTON "&Durdur", IDC_STOP, 68, 155, 54, 15, WS_DISABLED PUSHBUTTON "D&uraklat", IDC_PAUSE , 130, 155, 54, 15, WS_DISABLED PUSHBUTTON "&Sürdür", IDC_RESUME, 192, 155, 54, 15, WS_DISABLED - LTEXT "Gerçek Adı:", IDC_STATIC, 4, 11, 53, 11 + LTEXT "Hizmet Adı:", IDC_STATIC, 4, 11, 53, 11 LTEXT "Görüntülenen Adı:", IDC_STATIC, 4, 29, 53, 11 LTEXT "Açıklama:", IDC_STATIC, 4, 51, 53, 11 LTEXT "Çalıştırma Yolu:", IDC_STATIC, 6, 73, 82, 9 LTEXT "B&aşlama Türü:", IDC_STATIC, 6, 108, 53, 11 - LTEXT "Durum:", IDC_STATIC, 4, 138, 53, 11 + LTEXT "Hizmet Durumu:", IDC_STATIC, 4, 138, 53, 11 LTEXT "", IDC_SERV_STATUS, 70, 138, 176, 11, WS_CHILD | WS_VISIBLE - LTEXT "Burada, buradan başlatılan hizmete uygulanacak olan başlangıç eklemelerini yazabilirsiniz.", IDC_STATIC, 6, 177, 240, 15 - LTEXT "Ba&şlangıç ekleri:", IDC_STATIC, 6, 200, 58, 11 + LTEXT "Buradan hizmeti başlattığınız zaman uygulanan başlangıç değişkenlerini belirtebilirsiniz.", IDC_STATIC, 6, 177, 240, 15 + LTEXT "Ba&şlangıç Değişkenleri:", IDC_STATIC, 6, 200, 58, 11 EDITTEXT IDC_START_PARAM, 68, 199, 178, 13, WS_CHILD | WS_VISIBLE | WS_TABSTOP PUSHBUTTON "D&üzenle", IDC_EDIT, 192, 215, 54, 15, WS_DISABLED END @@ -114,8 +114,8 @@ BEGIN CONTROL "", IDC_DEPEND_TREE2, "SysTreeView32", WS_BORDER | WS_CHILDWINDOW | WS_VISIBLE | WS_TABSTOP | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_DISABLEDRAGDROP, 8, 151, 234, 67 - LTEXT "Birtakım hizmetler, birtakım dizge bileşenlerine bağımlıdır. Eğer bir dizge bileşeni, durdurulmuşsa ya da uygun bir şekilde çalışmıyorsa buna bağımlı olan hizmetler etkilenebilir.", IDC_STATIC, 8, 7, 238, 26 - LTEXT "Bu hizmet, aşağıdaki dizge bileşenlerine bağımlıdır:", IDC_STATIC, 8, 57, 236, 9 + LTEXT "Birtakım hizmetler, diğer hizmetlere, dizge sürücülerine ve yükleme sıra öbeklerine bağımlıdır. Eğer bir dizge bileşeni, durdurulmuşsa ya da düzgün bir şekilde çalışmıyorsa bağımlı hizmetler etkilenebilir.", IDC_STATIC, 8, 7, 238, 26 + LTEXT "Bu hizmet aşağıdaki bileşenlere bağımlıdır:", IDC_STATIC, 8, 57, 236, 9 LTEXT "", IDC_DEPEND_SERVICE, 8, 38, 236, 13 END @@ -129,10 +129,10 @@ BEGIN EDITTEXT IDC_CREATE_PATH, 10, 62, 210, 13, WS_CHILD | WS_VISIBLE EDITTEXT IDC_CREATE_DESC, 10, 97, 210, 48, WS_CHILD | WS_VISIBLE EDITTEXT IDC_CREATE_OPTIONS, 10, 162, 210, 13, WS_CHILD | WS_VISIBLE - LTEXT "&Gerçek Adı*:", IDC_STATIC, 12, 12, 54, 9 - LTEXT "G&örüntülenen Adı*:", IDC_STATIC, 12, 33, 54, 9 + LTEXT "&Hizmet Adı*:", IDC_STATIC, 12, 12, 54, 9 + LTEXT "&Görüntülenen Adı*:", IDC_STATIC, 12, 33, 54, 9 LTEXT "&Çalıştırma Yolu*:", IDC_STATIC, 10, 51, 68, 9 - LTEXT "&Açıklaması:", IDC_STATIC, 12, 86, 44, 9 + LTEXT "&Açıklama:", IDC_STATIC, 12, 86, 44, 9 PUSHBUTTON "Tamam", IDOK, 126, 192, 44, 13 PUSHBUTTON "İptal", IDCANCEL, 176, 192, 46, 13 LTEXT "&Ek Seçenekler (Ayrıntılar için Yardım'a tıklayınız.)", IDC_STATIC, 10, 151, 134, 9 @@ -140,31 +140,31 @@ BEGIN END IDD_DLG_DELETE DIALOGEX 6, 6, 185, 148 -CAPTION "Seçili Hizmeti Silme" +CAPTION "Bir Hizmet Silme" FONT 8, "MS Shell Dlg", 0, 0 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | DS_MODALFRAME BEGIN ICON IDI_WARNING, IDC_STATIC, 10, 8, 24, 22 - LTEXT "Aşağıdaki hizmeti silmeyi onaylıyor musunuz? BU İŞLEM GERİ ALINAMAZ!", IDC_STATIC, 50, 6, 125, 25 - LTEXT "Seçili Hizmetin Adı:", IDC_STATIC, 6, 40, 80, 9 + LTEXT "Aşağıdaki hizmeti silmek istemeyi doğruluyor musunuz? Bu silinme geri alınamaz!", IDC_STATIC, 50, 6, 125, 25 + LTEXT "Hizmet Adı:", IDC_STATIC, 6, 40, 80, 9 LTEXT "", IDC_DEL_NAME, 15, 53, 160, 15 EDITTEXT IDC_DEL_DESC, 6, 73, 174, 48, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_EX_STATICEDGE | ES_MULTILINE | ES_READONLY - PUSHBUTTON "&Evet", IDOK, 26, 129, 54, 13 - DEFPUSHBUTTON "&Hayır", IDCANCEL, 102, 129, 54, 13 + PUSHBUTTON "Evet", IDOK, 26, 129, 54, 13 + DEFPUSHBUTTON "Hayır", IDCANCEL, 102, 129, 54, 13 END IDD_DLG_DEPEND_STOP DIALOGEX 6, 6, 240, 148 -CAPTION "Diğer Hizmetleri Kapat" +CAPTION "Diğer Hizmetleri Kapatma" FONT 8, "MS Shell Dlg", 0, 0 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | DS_MODALFRAME BEGIN ICON IDI_WARNING, IDC_STATIC, 10, 8, 24, 22 LTEXT "", IDC_STOP_DEPENDS, 40, 8, 170, 25 LISTBOX IDC_STOP_DEPENDS_LB, 15, 40, 210, 70, WS_CHILD | WS_VISIBLE | WS_EX_STATICEDGE | LBS_NOSEL - LTEXT "Bu hizmetleri de kapatmak ister misiniz?", IDC_STATIC, 15, 110, 150, 10 - DEFPUSHBUTTON "&Evet", IDOK, 60, 129, 54, 14 - PUSHBUTTON "&Hayır", IDCANCEL, 120, 129, 54, 14 + LTEXT "Bu hizmetleri kapatmak ister misiniz?", IDC_STATIC, 15, 110, 150, 10 + DEFPUSHBUTTON "Evet", IDOK, 60, 129, 54, 14 + PUSHBUTTON "Hayır", IDCANCEL, 120, 129, 54, 14 END IDD_DLG_HELP_OPTIONS DIALOGEX 6, 6, 200, 150 @@ -191,7 +191,7 @@ END STRINGTABLE BEGIN IDS_FIRSTCOLUMN "Ad" - IDS_SECONDCOLUMN "Tanım" + IDS_SECONDCOLUMN "Açıklama" IDS_THIRDCOLUMN "Durum" IDS_FOURTHCOLUMN "Başlangıç Türü" IDS_FITHCOLUMN "Olarak Oturum Aç" @@ -209,9 +209,9 @@ END STRINGTABLE BEGIN IDS_NUM_SERVICES "Hizmet Sayısı: %d" - IDS_STOP_DEPENDS "%s durduğunda, bu hizmetler de durur:" + IDS_STOP_DEPENDS "%s durduğunda bu hizmetler de duracaktır:" IDS_NO_DEPENDS "" - IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu izlence özgür yazılımdır; bunu, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu izlence, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu izlencenin HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen güvencesi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu izlenceyle birlikte GNU Umûmî Kamu Ruhsatı'nın bir kopyasını almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." END STRINGTABLE @@ -235,45 +235,45 @@ BEGIN IDS_PROGRESS_INFO_RESUME "ReactOS, aşağıdaki hizmeti sürdürmeye çalışıyor:" IDS_CREATE_SUCCESS "Hizmet, başarılı bir şekilde oluşturuldu." IDS_DELETE_SUCCESS "Hizmet, başarılı bir şekilde silindi." - IDS_CREATE_REQ "Yıldızla imlenen\nyerlerin doldurulması, zorunludur." - IDS_DELETE_STOP "Hizmeti silmeden önce onu, elle durdurmalısınız." + IDS_CREATE_REQ "Yıldızla imlenen\nyerler zorunludur." + IDS_DELETE_STOP "Hizmeti silmeden önce onu elle durdurmalısınız." END STRINGTABLE BEGIN - IDS_HELP_OPTIONS "EK SEÇENEKLER:\r\nUYARI: Seçenek adı, eşittir imini de kapsar.\r\n type= \r\n (Öntanımlı = own)\r\n start= \r\n (Öntanımlı = demand) \r\n error= \r\n (Öntanımlı = normal)\r\n group= \r\n tag= \r\n depend= \r\n obj= \r\n (Öntanımlı = LocalSystem)\r\n password= <Şifre>\r\n" + IDS_HELP_OPTIONS "OLUŞTURMA SEÇENEKLERİ:\r\nÖNEMLİ: Seçenek adı, eşittir imini kapsar.\r\n type= \r\n (Ön tanımlı = own)\r\n start= \r\n (Ön tanımlı = demand) \r\n error= \r\n (Ön tanımlı = normal)\r\n group= \r\n tag= \r\n depend= \r\n obj= \r\n (Ön tanımlı = LocalSystem)\r\n password= <Şifre>\r\n" END /* Hints */ STRINGTABLE BEGIN IDS_HINT_BLANK " " - IDS_HINT_EXPORT " Şimdiki dizelgeyi, bir kütüğe aktarır." - IDS_HINT_EXIT " Yazılımdan çıkar." - IDS_HINT_CONNECT " Başka bir bilgisayarı yönetir." + IDS_HINT_EXPORT " Şimdiki dizelgeyi bir kütüğe verir." + IDS_HINT_EXIT " İzlenceden çıkar." + IDS_HINT_CONNECT " Ayrı bir bilgisayarı yönetir." IDS_HINT_START " Seçili hizmeti başlatır." IDS_HINT_STOP " Seçili hizmeti durdurur." IDS_HINT_PAUSE " Seçili hizmeti duraklatır." IDS_HINT_RESUME " Seçili hizmeti sürdürür." - IDS_HINT_RESTART " Seçili hizmeti durdurup yeniden başlatır." + IDS_HINT_RESTART " Seçili hizmeti durdurup başlatır." IDS_HINT_REFRESH " Hizmet dizelgesini yeniler." - IDS_HINT_EDIT " Seçili hizmetin husûsiyetlerini değiştirir." + IDS_HINT_EDIT " Seçili hizmetin husûsiyetlerini düzenler." IDS_HINT_CREATE " Yeni bir hizmet oluşturur." IDS_HINT_DELETE " Seçili hizmeti siler." - IDS_HINT_PROP " Seçili hizmetin husûsiyetlerini gösterir." - IDS_HINT_LARGE " Ögeleri, büyük simgelerle gösterir." - IDS_HINT_SMALL " Ögeleri, küçük simgelerle gösterir." - IDS_HINT_LIST " Ögeleri, dizelge olarak gösterir." - IDS_HINT_DETAILS " Ögeleri, dizelge olarak, ayrıntılı bir şekilde gösterir." + IDS_HINT_PROP " Seçilen için husûsiyetler penceresini açar." + IDS_HINT_LARGE " Öğeleri büyük simgelerle görüntüler." + IDS_HINT_SMALL " Öğeleri küçük simgelerle görüntüler." + IDS_HINT_LIST " Öğeleri bir dizelge olarak görüntüler." + IDS_HINT_DETAILS " Bir pencere içinde her bir öğe üzerine bilgi görüntüler." IDS_HINT_CUST " Görünümü husûsileştirir." - IDS_HINT_HELP " Yardım konularını görüntüler." - IDS_HINT_ABOUT " Hizmet Yöneticisi hakkında bilgi görüntüler." - IDS_HINT_SYS_RESTORE " Pencerenin boyutlarını, eski durumuna döndürür." - IDS_HINT_SYS_MOVE " Pencerenin konumunu değiştirir." - IDS_HINT_SYS_SIZE " Pencerenin boyutlarını değiştirir." - IDS_HINT_SYS_MINIMIZE " Pencereyi, simge durumuna küçültür." - IDS_HINT_SYS_MAXIMIZE " Pencereyle görüntülüğü kaplatır." - IDS_HINT_SYS_CLOSE " Pencereyi kapatır." + IDS_HINT_HELP " Yardım penceresini açar." + IDS_HINT_ABOUT " Hizmet Yöneticisi üzerine." + IDS_HINT_SYS_RESTORE " Bu pencereyi eski boyutlarına döndürür." + IDS_HINT_SYS_MOVE " Bu pencereyi devindirir." + IDS_HINT_SYS_SIZE " Bu pencerenin boyutlarını değiştirir." + IDS_HINT_SYS_MINIMIZE " Bu pencereyi simge durumuna küçültür." + IDS_HINT_SYS_MAXIMIZE " Bu pencereyi bu görüntülüğü kaplatana dek genişletir." + IDS_HINT_SYS_CLOSE " Bu pencereyi kapatır." END /* Application title */ diff --git a/reactos/base/applications/mscutils/servman/servman.rc b/reactos/base/applications/mscutils/servman/servman.rc index a84661a6fb2..0959200ec13 100644 --- a/reactos/base/applications/mscutils/servman/servman.rc +++ b/reactos/base/applications/mscutils/servman/servman.rc @@ -81,6 +81,9 @@ IDI_DRIVER ICON "res/driver.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif @@ -90,9 +93,6 @@ IDI_DRIVER ICON "res/driver.ico" #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/mspaint/lang/tr-TR.rc b/reactos/base/applications/mspaint/lang/tr-TR.rc index 16fdaeb6aab..3312dd81872 100644 --- a/reactos/base/applications/mspaint/lang/tr-TR.rc +++ b/reactos/base/applications/mspaint/lang/tr-TR.rc @@ -3,7 +3,7 @@ * LICENSE: LGPL * FILE: base/applications/mspaint/lang/tr-TR.rc * PURPOSE: Turkish Resource file for ReactOS Paint - * TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -23,7 +23,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Çıkış\tAlt+F4", IDM_FILEEXIT END - POPUP "&Düzen" + POPUP "&Düzenleme" BEGIN MENUITEM "&Geri Al\tCtrl+Z", IDM_EDITUNDO MENUITEM "&Yinele\tCtrl+Y", IDM_EDITREDO @@ -33,7 +33,7 @@ BEGIN MENUITEM "Y&apıştır\tCtrl+V", IDM_EDITPASTE MENUITEM "&Seçimi Sil\tDel", IDM_EDITDELETESELECTION MENUITEM "S&eçimi Evir", IDM_EDITINVERTSELECTION - MENUITEM "&Hepsini Seç\tCtrl+A", IDM_EDITSELECTALL + MENUITEM "&Tümünü Seç\tCtrl+A", IDM_EDITSELECTALL MENUITEM SEPARATOR MENUITEM "Se&çimi Şuraya Çoğalt...", IDM_EDITCOPYTO MENUITEM "&Şuradan Yapıştır...", IDM_EDITPASTEFROM @@ -45,7 +45,7 @@ BEGIN MENUITEM "&Durum Çubuğu", IDM_VIEWSTATUSBAR, CHECKED MENUITEM "&Metin Çubuğu", IDM_FORMATICONBAR, CHECKED, GRAYED MENUITEM SEPARATOR - POPUP "&Büyüt" + POPUP "&Yakınlaştırma" BEGIN POPUP "&Kullanıcı Tanımlı" BEGIN @@ -63,7 +63,7 @@ BEGIN END MENUITEM "&Tüm Görüntülük\tCtrl+F", IDM_VIEWFULLSCREEN END - POPUP "G&örüntü" + POPUP "&Resim" BEGIN MENUITEM "&Döndür ya da Evir...\tCtrl+R", IDM_IMAGEROTATEMIRROR MENUITEM "&Yeniden Boyutlandır veyâ Eğrilt...\tCtrl+W", IDM_IMAGESTRETCHSKEW @@ -73,18 +73,18 @@ BEGIN MENUITEM "R&esmi Temizle\tCtrl+Shft+N", IDM_IMAGEDELETEIMAGE MENUITEM "D&onuk Çiz", IDM_IMAGEDRAWOPAQUE END - POPUP "&Renkler" + POPUP "R&enkler" BEGIN MENUITEM "&Renkliği Düzenle...", IDM_COLORSEDITPALETTE MENUITEM SEPARATOR - MENUITEM "&Yeni Renklik", IDM_COLORSMODERNPALETTE + MENUITEM "&Çağdaş Renklik", IDM_COLORSMODERNPALETTE MENUITEM "&Eski Renklik", IDM_COLORSOLDPALETTE END POPUP "&Yardım" BEGIN MENUITEM "&Yardım Konuları", IDM_HELPHELPTOPICS MENUITEM SEPARATOR - MENUITEM "&Hakkında", IDM_HELPINFO + MENUITEM "&Üzerine...", IDM_HELPINFO END END @@ -119,10 +119,10 @@ BEGIN GROUPBOX "Döndür ya da Evir", IDD_MIRRORROTATEGROUP, 6, 6, 112, 86 AUTORADIOBUTTON "&Yatay Evir", IDD_MIRRORROTATERB1, 12, 18, 100, 10, WS_GROUP AUTORADIOBUTTON "&Dikey Evir", IDD_MIRRORROTATERB2, 12, 30, 100, 10 - AUTORADIOBUTTON "D&öndür", IDD_MIRRORROTATERB3, 12, 42, 100, 10 + AUTORADIOBUTTON "&Bir Açıyla Döndür", IDD_MIRRORROTATERB3, 12, 42, 100, 10 AUTORADIOBUTTON "&90°", IDD_MIRRORROTATERB4, 42, 54, 50, 10, WS_GROUP | WS_DISABLED - AUTORADIOBUTTON "1&80°", IDD_MIRRORROTATERB5, 42, 66, 50, 10, WS_DISABLED - AUTORADIOBUTTON "2&70°", IDD_MIRRORROTATERB6, 42, 78, 50, 10, WS_DISABLED + AUTORADIOBUTTON "&180°", IDD_MIRRORROTATERB5, 42, 66, 50, 10, WS_DISABLED + AUTORADIOBUTTON "&270°", IDD_MIRRORROTATERB6, 42, 78, 50, 10, WS_DISABLED DEFPUSHBUTTON "Tamam", IDOK, 125, 8, 48, 14 PUSHBUTTON "İptal", IDCANCEL, 125, 24, 48, 14 END @@ -134,27 +134,27 @@ CAPTION "Öz Nitelikler" BEGIN EDITTEXT IDD_ATTRIBUTESEDIT1, 48, 40, 35, 12 EDITTEXT IDD_ATTRIBUTESEDIT2, 128, 40, 35, 12 - LTEXT "En:", IDD_ATTRIBUTESTEXT1, 10, 40, 35, 10 - LTEXT "Boy:", IDD_ATTRIBUTESTEXT2, 90, 40, 35, 10 - LTEXT "Kütüğün Zamanı:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 + LTEXT "&En:", IDD_ATTRIBUTESTEXT1, 10, 40, 35, 10 + LTEXT "&Boy:", IDD_ATTRIBUTESTEXT2, 90, 40, 35, 10 + LTEXT "Kütüğün Zamânı:", IDD_ATTRIBUTESTEXT3, 10, 5, 60, 10 LTEXT "Kütüğün Boyutu:", IDD_ATTRIBUTESTEXT4, 10, 15, 60, 10 LTEXT "Çözünürlük:", IDD_ATTRIBUTESTEXT5, 10, 25, 60, 10 - LTEXT "(Daha yok.)", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10 - LTEXT "(Daha yok.)", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10 - LTEXT "(Daha yok.)", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10 + LTEXT "Yok", IDD_ATTRIBUTESTEXT6, 60, 5, 90, 10 + LTEXT "Yok", IDD_ATTRIBUTESTEXT7, 60, 15, 90, 10 + LTEXT "Yok", IDD_ATTRIBUTESTEXT8, 60, 25, 90, 10 GROUPBOX "Birim", IDD_ATTRIBUTESGROUP1, 6, 57, 158, 27 - AUTORADIOBUTTON "İnç", IDD_ATTRIBUTESRB1, 12, 69, 45, 10, WS_GROUP - AUTORADIOBUTTON "cm", IDD_ATTRIBUTESRB2, 62, 69, 45, 10 - AUTORADIOBUTTON "Nokta", IDD_ATTRIBUTESRB3, 112, 69, 45, 10 + AUTORADIOBUTTON "&İnç", IDD_ATTRIBUTESRB1, 12, 69, 45, 10, WS_GROUP + AUTORADIOBUTTON "&cm", IDD_ATTRIBUTESRB2, 62, 69, 45, 10 + AUTORADIOBUTTON "&Nokta", IDD_ATTRIBUTESRB3, 112, 69, 45, 10 GROUPBOX "Renk", IDD_ATTRIBUTESGROUP2, 6, 88, 158, 27 - AUTORADIOBUTTON "Kara ve Ak", IDD_ATTRIBUTESRB4, 12, 100, 70, 10, WS_GROUP - AUTORADIOBUTTON "Renkli", IDD_ATTRIBUTESRB5, 92, 100, 35, 10 + AUTORADIOBUTTON "&Kara ve Ak", IDD_ATTRIBUTESRB4, 12, 100, 70, 10, WS_GROUP + AUTORADIOBUTTON "&Renkli", IDD_ATTRIBUTESRB5, 92, 100, 35, 10 DEFPUSHBUTTON "Tamam", IDOK, 170, 8, 48, 14 PUSHBUTTON "İptal", IDCANCEL, 170, 24, 48, 14 - PUSHBUTTON "Öntanımlı", IDD_ATTRIBUTESSTANDARD, 170, 40, 48, 14 + PUSHBUTTON "Ön Tanımlı", IDD_ATTRIBUTESSTANDARD, 170, 40, 48, 14 END -IDD_STRETCHSKEW DIALOGEX 100, 100, 225, 80 +IDD_STRETCHSKEW DIALOGEX 100, 100, 225, 150 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg" CAPTION "Yeniden Boyutlandır veyâ Eğrilt" @@ -183,11 +183,11 @@ END STRINGTABLE BEGIN - IDS_PROGRAMNAME "Görüntü Düzenleyicisi" - IDS_WINDOWTITLE "%s - Görüntü Düzenleyicisi" - IDS_INFOTITLE "Görüntü Düzenleyicisi" - IDS_INFOTEXT "Görüntü Düzenleyicisi, GNU Kısıtlı Umûmî Kamu Ruhsatı'yla (LGPL'yle) ruhsatlıdır. (bkz: www.gnu.org)" - IDS_SAVEPROMPTTEXT "%s için yapılan değişiklikler kaydedilsin mi?" + IDS_PROGRAMNAME "Boyama" + IDS_WINDOWTITLE "%s - Boyama" + IDS_INFOTITLE "Boyama" + IDS_INFOTEXT "Boyama, GNU Kısıtlı Umûmî Kamu Ruhsatı (LGPL) altında vardır. (LGPL için bakınız: www.gnu.org)" + IDS_SAVEPROMPTTEXT "%s için yapılan değişiklikleri kaydetmek ister misiniz?" IDS_DEFAULTFILENAME "Adsız.bmp" IDS_MINIATURETITLE "Küçüğü" IDS_TOOLTIP1 "Özgür Seçim" @@ -206,12 +206,12 @@ BEGIN IDS_TOOLTIP14 "Çokgen" IDS_TOOLTIP15 "Söbek" IDS_TOOLTIP16 "Yuvarlatılmış Dikdörtgen" - IDS_OPENFILTER "Bit Eşlem Görüntüleri (*.bmp; *.dib)\1*.bmp;*.dib\1Tüm Kütükler (*.*)\1*.*\1" - IDS_SAVEFILTER "24 Bitlik Bit Eşlem Görüntüsü (*.bmp; *.dib)\1*.bmp;*.dib\1" + IDS_OPENFILTER "Bit Eşlem Resimleri (*.bmp, *.dib)\1*.bmp;*.dib\1Tüm Kütükler (*.*)\1*.*\1" + IDS_SAVEFILTER "24 Bitlik Bit Eşlem Resmi (*.bmp, *.dib)\1*.bmp;*.dib\1" IDS_FILESIZE "%d çoklu" - IDS_PRINTRES "Her metrekarede %d x %d nokta" - IDS_INTNUMBERS "Buraya yalnızca tamsayı girilmelidir." - IDS_PERCENTAGE "Buradaki değer 1 ilâ 500 olmalıdır." - IDS_ANGLE "Buradaki değer -89 ilâ 89 olmalıdır." + IDS_PRINTRES "Her metrekarede %d*%d nokta" + IDS_INTNUMBERS "Yalnızca tam sayı giriniz." + IDS_PERCENTAGE "Yüzde 1 ilâ 500 olmalıdır." + IDS_ANGLE "Açı -89 ilâ 89 olmalıdır." IDS_LOADERRORTEXT "%s kütüğü yüklenemedi." END diff --git a/reactos/base/applications/mspaint/rsrc.rc b/reactos/base/applications/mspaint/rsrc.rc index 792dace7a9e..cece6304bf4 100644 --- a/reactos/base/applications/mspaint/rsrc.rc +++ b/reactos/base/applications/mspaint/rsrc.rc @@ -104,15 +104,15 @@ IDI_VERTSKEW ICON "icons/vertskew.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/mstsc/lang/tr-TR.rc b/reactos/base/applications/mstsc/lang/tr-TR.rc index f07c7451048..4758d9db1e9 100644 --- a/reactos/base/applications/mstsc/lang/tr-TR.rc +++ b/reactos/base/applications/mstsc/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -9,7 +9,7 @@ BEGIN GROUPBOX "Oturum Açma Seçenkeleri", IDC_STATIC, 7, 7, 228, 89 GROUPBOX "Bağlantı Seçenekleri", IDC_STATIC, 7, 103, 228, 65 ICON "", IDC_LOGONICON, 15, 19, 20, 20 - LTEXT "Sunucu adresini giriniz:", IDC_STATIC, 47, 24, 81, 8 + LTEXT "Sunucu adresini giriniz.", IDC_STATIC, 47, 24, 81, 8 LTEXT "Sunucu:", IDC_STATIC, 47, 41, 25, 8 LTEXT "Kullanıcı Adı:", IDC_STATIC, 47, 58, 38, 8 COMBOBOX IDC_SERVERCOMBO, 79, 39, 141, 150, CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP @@ -18,7 +18,7 @@ BEGIN PUSHBUTTON "Ayrı Kaydet...", IDC_SAVEAS, 123, 139, 50, 14 PUSHBUTTON "Aç...", IDC_OPEN, 177, 139, 50, 14 ICON "", IDC_CONNICON, 16, 114, 20, 20 - LTEXT "Şimdiki seçenekleri kaydedebilir ya da var olan bir seçenek kütüğünü açabilirsiniz.", IDC_STATIC, 50, 115, 172, 20 + LTEXT "Şimdiki bağlantı ayarlarını kaydedebilir ya da var olan bir ayar kütüğünü açabilirsiniz.", IDC_STATIC, 50, 115, 172, 20 END IDD_DISPLAY DIALOGEX 0, 0, 242, 175 @@ -29,11 +29,11 @@ BEGIN GROUPBOX "Uzak Masaüstü Renk Sayısı", IDC_STATIC, 7, 83, 228, 85 ICON "", IDC_REMICON, 15, 19, 20, 20 ICON "", IDC_COLORSICON, 15, 98, 20, 20 - LTEXT "Uzak Masaüstü boyutunu seçebilirsiniz. Tüm görüntülüğe geçmek için sürgüyü en sağa kaydırınız.", IDC_STATIC, 53, 22, 175, 21 + LTEXT "Uzak masaüstünüzün boyutunu belirleyebilirsiniz. Tüm görüntülüğe geçmek için sürgüyü en sağa kaydırınız.", IDC_STATIC, 53, 22, 175, 21 CONTROL "", IDC_GEOSLIDER, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 56, 42, 124, 17 COMBOBOX IDC_BPPCOMBO, 56, 102, 128, 80, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "", IDC_COLORIMAGE, "Static", SS_OWNERDRAW | SS_SUNKEN, 56, 121, 127, 10 - LTEXT "ÖNEMLİ: Uzaktaki bilgisayar, bu seçeneği geçersiz kılabilir.", IDC_STATIC, 56, 143, 165, 18 + LTEXT "ÖNEMLİ: Uzak bilgisayarın ayarları bu ayârı geçersiz kılabilir.", IDC_STATIC, 56, 143, 165, 18 LTEXT "Daha Küçük", IDC_STATIC, 35, 42, 15, 8 LTEXT "Daha Büyük", IDC_STATIC, 189, 42, 17, 8 LTEXT "", IDC_SETTINGS_RESOLUTION_TEXT, 56, 62, 120, 10, SS_CENTER @@ -41,7 +41,7 @@ END IDD_CONNECTDIALOG DIALOGEX 0, 0, 260, 262 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Uzak Masaüstü Bağlayıcısı" +CAPTION "Uzak Masaüstü Bağlantısı" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Bağlan", IDOK, 147, 245, 50, 14 @@ -54,12 +54,12 @@ BEGIN IDS_TAB_GENERAL "Umûmî" IDS_TAB_DISPLAY "Görüntü" IDS_256COLORS "256 Renk" - IDS_HIGHCOLOR15 "32,768 (15 İkillik) Renk" - IDS_HIGHCOLOR16 "65,536 (16 İkillik) Renk" - IDS_HIGHCOLOR24 "16,777,216 (24 İkillik) Renk" - IDS_PIXEL "%lux%lu Nokta" + IDS_HIGHCOLOR15 "32,768 (15 Bitlik) Renk" + IDS_HIGHCOLOR16 "65,536 (16 Bitlik) Renk" + IDS_HIGHCOLOR24 "16,777,216 (24 Bitlik) Renk" + IDS_PIXEL "%lu*%lu Nokta" IDS_FULLSCREEN "Tüm Görüntülük" - IDS_BROWSESERVER "(Daha Çok...)" + IDS_BROWSESERVER "(Daha Çoğu İçin Göz At...)" IDS_HEADERTEXT1 "Uzak Masaüstü" - IDS_HEADERTEXT2 "Bağlayıcısı" + IDS_HEADERTEXT2 "Bağlantısı" END diff --git a/reactos/base/applications/mstsc/rdc.rc b/reactos/base/applications/mstsc/rdc.rc index 7723b630def..f25a4c2d482 100644 --- a/reactos/base/applications/mstsc/rdc.rc +++ b/reactos/base/applications/mstsc/rdc.rc @@ -77,15 +77,15 @@ IDB_SPECT BITMAP "res/spectrum.bmp" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/notepad/lang/tr-TR.rc b/reactos/base/applications/notepad/lang/tr-TR.rc index 479194a757d..5934566c445 100644 --- a/reactos/base/applications/notepad/lang/tr-TR.rc +++ b/reactos/base/applications/notepad/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATORS: 2012 - Arda Tanrıkulu (ardatan) (ardatanrikulu@gmail.com), 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATORS: 2012 Arda Tanrıkulu (ardatan) (ardatanrikulu@gmail.com), 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -29,13 +29,13 @@ BEGIN MENUITEM "&Kaydet\tCtrl+S", CMD_SAVE MENUITEM "Ay&rı Kaydet...", CMD_SAVE_AS MENUITEM SEPARATOR - MENUITEM "&Sayfa Yapısı...", CMD_PAGE_SETUP + MENUITEM "&Sayfa Ayarla...", CMD_PAGE_SETUP MENUITEM "Ya&zdır...\tCtrl+P", CMD_PRINT - MENUITEM "Yaz&ıcı Ayarları...", CMD_PRINTER_SETUP + MENUITEM "Yaz&ıcı Ayarla...", CMD_PRINTER_SETUP MENUITEM SEPARATOR MENUITEM "&Çıkış", CMD_EXIT END - POPUP "&Düzen" + POPUP "&Düzenleme" BEGIN MENUITEM "&Geri Al\tCtrl+Z", CMD_UNDO MENUITEM SEPARATOR @@ -55,7 +55,7 @@ BEGIN POPUP "&Biçim" BEGIN MENUITEM "&Uzun Yataçları Kaydır", CMD_WRAP - MENUITEM "&Yazı Türü...", CMD_FONT + MENUITEM "&Yazı Tipi...", CMD_FONT END POPUP "&Görünüm" BEGIN @@ -67,8 +67,8 @@ BEGIN MENUITEM "&Ara", CMD_HELP_SEARCH MENUITEM "&Yardım İçin Yardım", CMD_HELP_ON_HELP MENUITEM SEPARATOR - MENUITEM "&Bilgi", CMD_ABOUT - MENUITEM "&Hakkında", CMD_ABOUT_WINE + MENUITEM "&Bilgi...", CMD_ABOUT + MENUITEM "&Üzerine...", CMD_ABOUT_WINE END END @@ -122,10 +122,10 @@ END IDD_ABOUTBOX DIALOGEX 22, 16, 284, 170 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "Metin Düzenleyicisi Hakkında" +CAPTION "Not Defteri Üzerine" FONT 8, "MS Shell Dlg" BEGIN - CONTROL "Metin Düzenleyicisi - Sürüm: 1.0\r\nTelif Hakları:\r\n1997,98 - Marcel Baur (mbaur@g26.ethz.ch)\r\n2000 - Mike McCormack (Mike_McCormack@looksmart.com.au)\r\n2002 - Sylvain Petreolle (spetreolle@yahoo.fr)\r\n2002 - Andriy Palamarchuk\r\n", -1, "Static", SS_LEFTNOWORDWRAP | WS_GROUP, 46, 7, 232, 39 + CONTROL "Not Defteri - Sürüm: 1.0\r\nTelif Hakları:\r\n1997,98 - Marcel Baur (mbaur@g26.ethz.ch)\r\n2000 - Mike McCormack (Mike_McCormack@looksmart.com.au)\r\n2002 - Sylvain Petreolle (spetreolle@yahoo.fr)\r\n2002 - Andriy Palamarchuk\r\n", -1, "Static", SS_LEFTNOWORDWRAP | WS_GROUP, 46, 7, 232, 39 CONTROL " ", -1, "Static", 0x50000000, 8, 48, 272, 11 DEFPUSHBUTTON "Kapat", IDOK, 114, 149, 44, 15, WS_GROUP ICON IDI_NPICON, -1, 12, 9, 20, 30 @@ -134,7 +134,7 @@ END STRINGTABLE BEGIN - STRING_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + STRING_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu izlence özgür yazılımdır; bunu, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu izlence, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu izlencenin HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen güvencesi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu izlenceyle birlikte GNU Umûmî Kamu Ruhsatı'nın bir kopyasını almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." END STRINGTABLE @@ -145,14 +145,14 @@ BEGIN STRING_PAGESETUP_RIGHTVALUE "20 mm" /* FIXME */ STRING_PAGESETUP_TOPVALUE "25 mm" /* FIXME */ STRING_PAGESETUP_BOTTOMVALUE "25 mm" /* FIXME */ - STRING_NOTEPAD "Metin Düzenleyicisi" + STRING_NOTEPAD "Not Defteri" STRING_ERROR "YANLIŞLIK" STRING_WARNING "UYARI" STRING_INFO "Bilgi" STRING_UNTITLED "Adsız" STRING_ALL_FILES "Tüm Kütükler (*.*)" STRING_TEXT_FILES_TXT "Metin Belgeleri (*.txt)" - STRING_TOOLARGE "%s kütüğü Metin Düzenleyicisi için çok büyük. Başka bir düzenleyici kullanınız." + STRING_TOOLARGE "%s kütüğü Not Defteri için çok büyük. Başka bir düzenleyici kullanınız." STRING_NOTEXT "Hiçbir metin girmediniz. Birşeyler yazıp yeniden deneyiniz." STRING_DOESNOTEXIST "%s kütüğü yok. Yeni bir kütük oluşturmak ister misiniz?" STRING_NOTSAVED "%s kütüğü değiştirilmiş. Değişiklikleri kaydetmek ister misiniz?" diff --git a/reactos/base/applications/rapps/lang/tr-TR.rc b/reactos/base/applications/rapps/lang/tr-TR.rc index 71eb177d30b..fe22b4c7f1e 100644 --- a/reactos/base/applications/rapps/lang/tr-TR.rc +++ b/reactos/base/applications/rapps/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -10,7 +10,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Çıkış", ID_EXIT END - POPUP "&Yazılım" + POPUP "Y&azılım" BEGIN MENUITEM "&Kur", ID_INSTALL MENUITEM "K&aldır", ID_UNINSTALL @@ -20,12 +20,12 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Yenile", ID_REFRESH MENUITEM SEPARATOR - MENUITEM "Y&azılım Veritabanını Yenile", ID_RESETDB + MENUITEM "Ya&zılım Veri Tabanını Yenile", ID_RESETDB END - POPUP "Y&ardım" + POPUP "&Yardım" BEGIN MENUITEM "&Yardım", ID_HELP, GRAYED - MENUITEM "&Hakkında", ID_ABOUT + MENUITEM "&Üzerine...", ID_ABOUT END END @@ -33,8 +33,8 @@ IDR_LINKMENU MENU BEGIN POPUP "popup" BEGIN - MENUITEM "&Tarayıcıda Aç", ID_OPEN_LINK - MENUITEM "&Panoya Çoğalt", ID_COPY_LINK + MENUITEM "&Bağlantıyı Tarayıcıda Aç", ID_OPEN_LINK + MENUITEM "&Bağlantıyı Panoya Çoğalt", ID_COPY_LINK END END @@ -50,7 +50,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Yenile", ID_REFRESH MENUITEM SEPARATOR - MENUITEM "Y&azılım Veritabanını Yenile", ID_RESETDB + MENUITEM "Ya&zılım Veri Tabanını Yenile", ID_RESETDB END END @@ -61,25 +61,25 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Umûmî", -1, 4, 2, 240, 61 AUTOCHECKBOX "&Pencere Konumunu Kaydet", IDC_SAVE_WINDOW_POS, 15, 12, 219, 12 - AUTOCHECKBOX "&Her Başlangıçta Erişilebilir Yazılım Dizelgesini Yenile", IDC_UPDATE_AVLIST, 15, 29, 222, 12 - AUTOCHECKBOX "&Yazılımların Kuruluş ve Kaldırılışlarını Kaydet", IDC_LOG_ENABLED, 15, 46, 219, 12 + AUTOCHECKBOX "&Başlangıçta Erişilebilir İzlencelerin Dizelgesini Yenile", IDC_UPDATE_AVLIST, 15, 29, 222, 12 + AUTOCHECKBOX "&İzlencelerin Kuruluşlarını ve Kaldırılışlarını Kaydet", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "İndirme", -1, 4, 65, 240, 51 LTEXT "İndirme Dizini:", -1, 16, 75, 100, 9 EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP PUSHBUTTON "&Seç", IDC_CHOOSE, 187, 85, 50, 14 - AUTOCHECKBOX "&Kurulumdan Sonra Yazılımın Kurulum Kütüğünü Sil", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 - PUSHBUTTON "Öntanımlılar", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 + AUTOCHECKBOX "&Kurulumdan Sonra İzlencenin Kurulum Kütüğünü Sil", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 + PUSHBUTTON "Ön Tanımlılar", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 PUSHBUTTON "Tamam", IDOK, 116, 124, 60, 14 PUSHBUTTON "İptal", IDCANCEL, 181, 124, 60, 14 END IDD_INSTALL_DIALOG DIALOGEX 0, 0, 216, 97 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Yazılım Kurulumu" +CAPTION "İzlence Kurulumu" FONT 8, "MS Shell Dlg" BEGIN LTEXT "...", IDC_INSTALL_TEXT, 4, 5, 209, 35 - AUTORADIOBUTTON "&Bir Diskten Kur", IDC_CD_INSTALL, 10, 46, 197, 11, WS_GROUP + AUTORADIOBUTTON "&Bir Diskten (CD'den veyâ DVD'den) Kur", IDC_CD_INSTALL, 10, 46, 197, 11, WS_GROUP AUTORADIOBUTTON "&İndir ve Kur", IDC_DOWNLOAD_INSTALL, 10, 59, 197, 11, NOT WS_TABSTOP PUSHBUTTON "Tamam", IDOK, 86, 78, 60, 14 PUSHBUTTON "İptal", IDCANCEL, 150, 78, 60, 14 @@ -97,10 +97,10 @@ END IDD_ABOUT_DIALOG DIALOGEX 22, 16, 190, 66 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -CAPTION "Hakkında" +CAPTION "Üzerine" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "ReactOS Yazılım Yöneticisi\nTelif Hakkı: 2009 - \nDmitry Chapyshev (dmitry@reactos.org) eliyle yazılmıştır.", IDC_STATIC, 48, 7, 130, 39 + LTEXT "ReactOS Uygulama Yöneticisi\nTelif Hakkı: 2009 - \nDmitry Chapyshev (dmitry@reactos.org) eliyle yazılmıştır.", IDC_STATIC, 48, 7, 130, 39 PUSHBUTTON "Tamam", IDOK, 133, 46, 50, 14 ICON IDI_MAIN, IDC_STATIC, 10, 10, 7, 30 END @@ -117,24 +117,24 @@ END STRINGTABLE BEGIN - IDS_APP_NAME "Yazılımın Adı" + IDS_APP_NAME "Ad" IDS_APP_INST_VERSION "Sürüm" - IDS_APP_DESCRIPTION "Ek Bilgi" + IDS_APP_DESCRIPTION "Açıklama" END STRINGTABLE BEGIN - IDS_INFO_VERSION "\nSürüm: " - IDS_INFO_DESCRIPTION "\nEk Bilgi: " - IDS_INFO_PUBLISHER "\nYayımcı: " + IDS_INFO_VERSION "\nSürümü: " + IDS_INFO_DESCRIPTION "\nAçıklaması: " + IDS_INFO_PUBLISHER "\nYayımcısı: " IDS_INFO_HELPLINK "\nYardım Bağlantısı: " IDS_INFO_HELPPHONE "\nYardım Telefonu: " - IDS_INFO_README "\nBenioku: " + IDS_INFO_README "\nBenioku Kütüğü: " IDS_INFO_REGOWNER "\nKayıtlı Olduğu Kullanıcısı: " IDS_INFO_PRODUCTID "\nÜrün Kimliği: " IDS_INFO_CONTACT "\nİletişim: " IDS_INFO_UPDATEINFO "\nYenileme Bilgisi: " - IDS_INFO_INFOABOUT "\nHakkında Bilgi: " + IDS_INFO_INFOABOUT "\nÜzerine Bilgisi: " IDS_INFO_COMMENTS "\nYorumlar: " IDS_INFO_INSTLOCATION "\nKurulum Konumu: " IDS_INFO_INSTALLSRC "\nKurulum Kaynağı: " @@ -145,11 +145,11 @@ END STRINGTABLE BEGIN - IDS_AINFO_VERSION "\nSürüm: " - IDS_AINFO_DESCRIPTION "\nEk Bilgi: " - IDS_AINFO_SIZE "\nBoyut: " - IDS_AINFO_URLSITE "\nAna Sayfa: " - IDS_AINFO_LICENCE "\nRuhsat: " + IDS_AINFO_VERSION "\nSürümü: " + IDS_AINFO_DESCRIPTION "\nAçıklaması: " + IDS_AINFO_SIZE "\nBüyüklüğü: " + IDS_AINFO_URLSITE "\nAna Sayfası: " + IDS_AINFO_LICENCE "\nRuhsatı: " END STRINGTABLE @@ -159,7 +159,7 @@ BEGIN IDS_CAT_DRIVERS "Sürücüler" IDS_CAT_EDU "Eğitim" IDS_CAT_ENGINEER "Mühendislik" - IDS_CAT_FINANCE "Mâli" + IDS_CAT_FINANCE "Mâlî" IDS_CAT_GAMES "Oyun ve Eğlence" IDS_CAT_GRAPHICS "Çizge" IDS_CAT_INTERNET "Ağ" @@ -173,22 +173,22 @@ END STRINGTABLE BEGIN - IDS_APPTITLE "ReactOS Yazılım Yöneticisi" + IDS_APPTITLE "ReactOS Uygulama Yöneticisi" IDS_SEARCH_TEXT "Ara" IDS_INSTALL "Kur" IDS_UNINSTALL "Kaldır" IDS_MODIFY "Değiştir" - IDS_APPS_COUNT "Yazılım Sayısı: %d" - IDS_WELCOME_TITLE "ReactOS Yazılım Yöneticisi'ne hoşgeldiniz.\n\n" - IDS_WELCOME_TEXT "Soldaki herhangi bir ulamı seçip ulamdaki herhangi bir yazılımı kaldırabilir veyâ kurabilrisiniz.\nReactOS'un örütbağ sitesi: " + IDS_APPS_COUNT "Uygulama Sayısı: %d" + IDS_WELCOME_TITLE "ReactOS Uygulama Yöneticisi'ne hoşgeldiniz.\n\n" + IDS_WELCOME_TEXT "Solda bir ulam seçiniz, ardından kurmak ya da kaldırmak için bir uygulama seçiniz.\nReactOS'un Umûmî Ağ sitesi: " IDS_WELCOME_URL "http://www.reactos.org" IDS_INSTALLED "Kurulanlar" - IDS_AVAILABLEFORINST "Kurulabilenler" - IDS_UPDATES "Yenilemeler" - IDS_APPLICATIONS "Yazılımlar" - IDS_CHOOSE_FOLDER_TEXT "İndirme dizinini seçiniz:" + IDS_AVAILABLEFORINST "Kurulum İçin Bulunanlar" + IDS_UPDATES "Şimdikileştirmeler" + IDS_APPLICATIONS "Uygulamalar" + IDS_CHOOSE_FOLDER_TEXT "İndirilenlerin saklanacağı bir dizin seçiniz:" IDS_CHOOSE_FOLDER_ERROR "Belirttiğiniz dizin yok. Belirttiğiniz dizin oluşturulsun mu?" - IDS_APP_REG_REMOVE "Bu yazılımın bilgilerini Değer Defteri'nden kaldırmayı onaylıyor musunuz?" + IDS_APP_REG_REMOVE "Kurulan izlencenin girişini Değer Defteri'nden silmeyi doğruluyor musunuz?" IDS_INFORMATION "Bilgi" - IDS_UNABLE_TO_REMOVE "Bu yazılımın bilgileri Değer Defteri'nden kaldırılamıyor." + IDS_UNABLE_TO_REMOVE "İzlencenin girişi Değer Defteri'nden silinemiyor." END diff --git a/reactos/base/applications/rapps/rapps.rc b/reactos/base/applications/rapps/rapps.rc index 79b6dcf8812..6d9f883aae6 100644 --- a/reactos/base/applications/rapps/rapps.rc +++ b/reactos/base/applications/rapps/rapps.rc @@ -91,15 +91,15 @@ IDI_CAT_VIDEO ICON "res/cats/video.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/regedit/clb/clb.rc b/reactos/base/applications/regedit/clb/clb.rc index f62f2029e68..8f80653dc7c 100644 --- a/reactos/base/applications/regedit/clb/clb.rc +++ b/reactos/base/applications/regedit/clb/clb.rc @@ -48,9 +48,6 @@ #ifdef LANGUAGE_TH_TH #include "lang/th-TH.rc" #endif -#ifdef LANGUAGE_TR_TR - #include "lang/tr-TR.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif @@ -64,3 +61,6 @@ #ifdef LANGUAGE_PL_PL #include "lang/pl-PL.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "lang/tr-TR.rc" +#endif diff --git a/reactos/base/applications/regedit/clb/lang/tr-TR.rc b/reactos/base/applications/regedit/clb/lang/tr-TR.rc index 11189ec10ae..5007bd09564 100644 --- a/reactos/base/applications/regedit/clb/lang/tr-TR.rc +++ b/reactos/base/applications/regedit/clb/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -9,9 +9,9 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN GROUPBOX "Dikeçli Dizelge Kutusu Biçimleri", -1, 6, 7, 158, 71 CHECKBOX "&Ölçünlü", 1710, 10, 20, 42, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "&Sınırlar", 1713, 10, 30, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "S&ırala", 1705, 10, 40, 26, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "&Bildirme", 1706, 10, 50, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Hudut", 1713, 10, 30, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Sırala", 1705, 10, 40, 26, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Bildir", 1706, 10, 50, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Dikey Kaydırma Çubuğu", 1707, 10, 60, 64, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP CHECKBOX "&Çoklu Seçim", -1, 79, 20, 72, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP | WS_DISABLED CHECKBOX "&Genişletilmiş Seçim", -1, 79, 30, 77, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP | WS_DISABLED @@ -19,9 +19,9 @@ BEGIN CHECKBOX "&Esnek Dikeçler", 1715, 79, 50, 66, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP GROUPBOX "Başlıca Biçimler", -1, 6, 80, 158, 34 CHECKBOX "Gö&rünür", 1701, 10, 92, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "De&vre Dışı", 1702, 10, 102, 41, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "K&üme", 1703, 79, 92, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "Se&kme Durağı", 1704, 79, 102, 44, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Ed&ilgin", 1702, 10, 102, 41, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Öbe&kleme", 1703, 79, 92, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Sek&me Durağı", 1704, 79, 102, 44, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP PUSHBUTTON "Tamam", IDOK, 37, 125, 40, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP PUSHBUTTON "İptal", IDCANCEL, 93, 125, 40, 14, BS_PUSHBUTTON | WS_GROUP | WS_TABSTOP CHECKBOX "Ka&ydırmayı Etkinleştir", 1708, 79, 60, 66, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP diff --git a/reactos/base/applications/regedit/lang/tr-TR.rc b/reactos/base/applications/regedit/lang/tr-TR.rc index 6d480365bf0..b24e5566779 100644 --- a/reactos/base/applications/regedit/lang/tr-TR.rc +++ b/reactos/base/applications/regedit/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -22,7 +22,7 @@ BEGIN END POPUP "&Yardım" BEGIN - MENUITEM "&Hakkında", ID_HELP_ABOUT + MENUITEM "&Üzerine...", ID_HELP_ABOUT END END @@ -36,14 +36,14 @@ BEGIN MENUITEM "&Yığın Yükle...", ID_REGISTRY_LOADHIVE, GRAYED MENUITEM "Y&ığını kaldır...", ID_REGISTRY_UNLOADHIVE, GRAYED MENUITEM SEPARATOR - MENUITEM "A&ğ Değerlerine Bağlan...", ID_REGISTRY_CONNECTNETWORKREGISTRY - MENUITEM "Ağ &Değerlerine Bağlantıyı Kes...", ID_REGISTRY_DISCONNECTNETWORKREGISTRY, GRAYED + MENUITEM "A&ğdaki Değer Defteri'ne Bağlan...", ID_REGISTRY_CONNECTNETWORKREGISTRY + MENUITEM "Ağ&daki Değer Defteri'ne Bağlantıyı Kes...", ID_REGISTRY_DISCONNECTNETWORKREGISTRY, GRAYED MENUITEM SEPARATOR MENUITEM "Ya&zdır...\tCtrl+P", ID_REGISTRY_PRINT, GRAYED MENUITEM SEPARATOR MENUITEM "&Çıkış", ID_REGISTRY_EXIT END - POPUP "&Düzen" + POPUP "&Düzenleme" BEGIN MENUITEM "&Değiştir...", ID_EDIT_MODIFY MENUITEM SEPARATOR @@ -53,7 +53,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "D&izgi Değeri", ID_EDIT_NEW_STRINGVALUE MENUITEM "İ&kili Değer", ID_EDIT_NEW_BINARYVALUE - MENUITEM "&32 İkillik Değer", ID_EDIT_NEW_DWORDVALUE + MENUITEM "&32 Bitlik Değer", ID_EDIT_NEW_DWORDVALUE MENUITEM "&Çok Dizeli Dizgi Değeri", ID_EDIT_NEW_MULTISTRINGVALUE MENUITEM "&Genişletilebilir Dizgi Değeri", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END @@ -63,29 +63,29 @@ BEGIN MENUITEM "&Sil\tDel", ID_EDIT_DELETE MENUITEM "&Adını Değiştir", ID_EDIT_RENAME MENUITEM SEPARATOR - MENUITEM "Y&olunu Çoğalt", ID_EDIT_COPYKEYNAME + MENUITEM "Di&zin Yolunu Çoğalt", ID_EDIT_COPYKEYNAME MENUITEM SEPARATOR MENUITEM "A&ra...\tCtrl+F", ID_EDIT_FIND - MENUITEM "So&nrakini Ara\tF3", ID_EDIT_FINDNEXT + MENUITEM "S&onrakini Ara\tF3", ID_EDIT_FINDNEXT END POPUP "&Görünüm" BEGIN MENUITEM "&Durum Çubuğu", ID_VIEW_STATUSBAR MENUITEM SEPARATOR - MENUITEM "&Ayırıcının Yerini Değiştir", ID_VIEW_SPLIT + MENUITEM "&Böl", ID_VIEW_SPLIT MENUITEM SEPARATOR MENUITEM "&Yenile\tF5", ID_VIEW_REFRESH END POPUP "Y&er İmleri" BEGIN MENUITEM "&Yer İmlerine Ekle...", ID_FAVOURITES_ADDTOFAVOURITES, GRAYED - MENUITEM "Y&er İmlerinden Çıkar...", ID_FAVOURITES_REMOVEFAVOURITE, GRAYED + MENUITEM "Y&er İmlerinden Sil...", ID_FAVOURITES_REMOVEFAVOURITE, GRAYED END POPUP "&Yardım" BEGIN MENUITEM "&Yardım Konuları\tF1", ID_HELP_HELPTOPICS MENUITEM SEPARATOR - MENUITEM "&Hakkında", ID_HELP_ABOUT + MENUITEM "&Üzerine...", ID_HELP_ABOUT END END @@ -94,7 +94,7 @@ BEGIN POPUP "" BEGIN MENUITEM "&Değiştir...", ID_EDIT_MODIFY - MENUITEM "&İkili Olarak Değiştir...", ID_EDIT_MODIFY_BIN + MENUITEM "&İkili Veriyi Değiştir...", ID_EDIT_MODIFY_BIN MENUITEM SEPARATOR MENUITEM "&Sil\tDel", ID_EDIT_DELETE MENUITEM "&Adını Değiştir", ID_EDIT_RENAME @@ -107,7 +107,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "D&izgi Değeri", ID_EDIT_NEW_STRINGVALUE MENUITEM "İ&kili Değer", ID_EDIT_NEW_BINARYVALUE - MENUITEM "&32 İkillik Değer", ID_EDIT_NEW_DWORDVALUE + MENUITEM "&32 Bitlik Değer", ID_EDIT_NEW_DWORDVALUE MENUITEM "&Çok Dizeli Dizgi Değeri", ID_EDIT_NEW_MULTISTRINGVALUE MENUITEM "&Genişletilebilir Dizgi Değeri", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END @@ -121,7 +121,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "D&izgi Değeri", ID_EDIT_NEW_STRINGVALUE MENUITEM "İ&kili Değer", ID_EDIT_NEW_BINARYVALUE - MENUITEM "&32 İkillik Değer", ID_EDIT_NEW_DWORDVALUE + MENUITEM "&32 Bitlik Değer", ID_EDIT_NEW_DWORDVALUE MENUITEM "&Çok Dizeli Dizgi Değeri", ID_EDIT_NEW_MULTISTRINGVALUE MENUITEM "&Genişletilebilir Dizgi Değeri", ID_EDIT_NEW_EXPANDABLESTRINGVALUE END @@ -155,7 +155,7 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Değer Adı:", IDC_STATIC, 6, 6, 134, 8 EDITTEXT IDC_VALUE_NAME, 6, 17, 240, 12, ES_AUTOHSCROLL | ES_READONLY - LTEXT "D&eğer Bilgisi:", IDC_STATIC, 6, 35, 161, 8 + LTEXT "D&eğer Verisi:", IDC_STATIC, 6, 35, 161, 8 EDITTEXT IDC_VALUE_DATA, 6, 46, 240, 12, ES_AUTOHSCROLL DEFPUSHBUTTON "Tamam", IDOK, 142, 64, 50, 14 PUSHBUTTON "İptal", IDCANCEL, 196, 64, 50, 14 @@ -168,7 +168,7 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Değer Adı:", IDC_STATIC, 6, 6, 134, 8 EDITTEXT IDC_VALUE_NAME, 6, 17, 240, 12, ES_AUTOHSCROLL | ES_READONLY - LTEXT "D&eğer Bilgisi:", IDC_STATIC, 6, 35, 161, 8 + LTEXT "D&eğer Verisi:", IDC_STATIC, 6, 35, 161, 8 EDITTEXT IDC_VALUE_DATA, 6, 46, 240, 102, ES_AUTOHSCROLL | ES_MULTILINE | ES_WANTRETURN | ES_AUTOVSCROLL | WS_VSCROLL DEFPUSHBUTTON "Tamam", IDOK, 142, 154, 50, 14 @@ -182,7 +182,7 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Değer Adı:", IDC_STATIC, 6, 6, 134, 8 EDITTEXT IDC_VALUE_NAME, 6, 17, 240, 12, ES_AUTOHSCROLL | ES_READONLY - LTEXT "D&eğer Bilgisi:", IDC_STATIC, 6, 35, 161, 8 + LTEXT "D&eğer Verisi:", IDC_STATIC, 6, 35, 161, 8 CONTROL "", IDC_VALUE_DATA, "HexEdit32", WS_VSCROLL | WS_BORDER | WS_TABSTOP, 6, 46, 240, 102 DEFPUSHBUTTON "Tamam", IDOK, 142, 154, 50, 14 PUSHBUTTON "İptal", IDCANCEL, 196, 154, 50, 14 @@ -190,14 +190,14 @@ END IDD_EDIT_DWORD DIALOGEX 32, 24, 252, 104 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "32 İkillik Değeri Düzenle" +CAPTION "32 Bitlik Değeri Düzenle" FONT 8, "MS Shell Dlg" BEGIN LTEXT "&Değer Adı:", IDC_STATIC, 6, 6, 134, 8 EDITTEXT IDC_VALUE_NAME, 6, 17, 240, 12, ES_AUTOHSCROLL | ES_READONLY - LTEXT "D&eğer:", IDC_STATIC, 6, 35, 161, 8 + LTEXT "D&eğer Verisi:", IDC_STATIC, 6, 35, 161, 8 EDITTEXT IDC_VALUE_DATA, 6, 46, 116, 12, ES_AUTOHSCROLL - GROUPBOX "Şimdi Girilen Değer", IDC_STATIC, 130, 35, 116, 39 + GROUPBOX "Taban", IDC_STATIC, 130, 35, 116, 39 AUTORADIOBUTTON "&Onaltılık", IDC_FORMAT_HEX, 141, 46, 60, 10, WS_GROUP AUTORADIOBUTTON "O&nluk", IDC_FORMAT_DEC, 141, 59, 60, 10 DEFPUSHBUTTON "Tamam", IDOK, 142, 82, 50, 14 @@ -232,7 +232,7 @@ BEGIN LTEXT "Giriş:", IDC_STATIC, 10, 134, 38, 8 CONTROL "", IDC_PORT_LIST, "SysListView32", LVS_REPORT | LVS_NOSORTHEADER | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 10, 144, 261, 31 - LTEXT "Husûsî Aygıt Bilgisi:", IDC_STATIC, 10, 177, 80, 8 + LTEXT "Husûsî Aygıt Verisi:", IDC_STATIC, 10, 177, 80, 8 CONTROL "", IDC_DEVICE_LIST, "SysListView32", LVS_REPORT | LVS_NOSORTHEADER | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 10, 188, 261, 31 GROUPBOX "Kullanım", IDC_STATIC, 10, 219, 125, 39 @@ -249,16 +249,16 @@ BEGIN RTEXT "Düzeltme:", IDC_STATIC, 151, 250, 51, 8 LTEXT "", IDC_REVISION, 205, 250, 66, 8 DEFPUSHBUTTON "Tamam",IDOK, 92, 263, 40, 14 - PUSHBUTTON "Kaynak Bilgisi...", IDC_SHOW_RESOURCE_DATA, 148, 263, 40, 14, WS_DISABLED + PUSHBUTTON "Veri...", IDC_SHOW_RESOURCE_DATA, 148, 263, 40, 14, WS_DISABLED END /* String Tables */ STRINGTABLE BEGIN - IDS_LIST_COLUMN_NAME "Değerin Adı" - IDS_LIST_COLUMN_TYPE "Değerin Türü" - IDS_LIST_COLUMN_DATA "Değer" + IDS_LIST_COLUMN_NAME "Değer Adı" + IDS_LIST_COLUMN_TYPE "Değer Türü" + IDS_LIST_COLUMN_DATA "Değer Verisi" END STRINGTABLE @@ -270,45 +270,45 @@ END STRINGTABLE BEGIN - ID_REGISTRY_MENU "Bu seçke, bütün Değer Defteri ile çalışma komutlarını içerir." - ID_EDIT_MENU "Bu seçke, dizinleri veyâ değerleri düzenleme komutlarını içerir." - ID_VIEW_MENU "Bu seçke, Değer Defteri Düzenleyicisi'nin penceresini değiştirme komutlarını içerir." - ID_FAVOURITES_MENU "Bu seçke, yer imleri ile ilgili komutları içerir." - ID_HELP_MENU "Bu seçke, Değer Defteri Düzenleyicisi ile ilgili bilgi veyâ yardım alma komutlarını içerir." - ID_EDIT_NEW_MENU "Bu seçke, yeni bir dizin veyâ yeni bir değer oluşturma komutlarını içerir." + ID_REGISTRY_MENU "Bütün Değer Defteri ile çalışma komutlarını içerir." + ID_EDIT_MENU "Dizinleri veyâ değerleri düzenleme komutlarını içerir." + ID_VIEW_MENU "Değer Defteri penceresinin husûsileştirme komutlarını içerir." + ID_FAVOURITES_MENU "Sık kullanılan dizinleri kullanma komutlarını içerir." + ID_HELP_MENU "Değer Defteri Düzenleyicisi ile ilgili bilgiyi ya da yardımı görüntüleme komutlarını içerir." + ID_EDIT_NEW_MENU "Yeni bir dizin ya da yeni bir değer oluşturma komutlarını içerir." END STRINGTABLE BEGIN - ID_EDIT_MODIFY "Değeri değiştirir." - ID_EDIT_NEW_KEY "Yeni bir dizin oluşturur." - ID_EDIT_NEW_STRINGVALUE "Yeni bir dizgi değeri oluşturur." - ID_EDIT_NEW_BINARYVALUE "Yeni bir ikili değer oluşturur." - ID_EDIT_NEW_DWORDVALUE "Yeni bir 32 bitlik değer oluşturur." - ID_REGISTRY_IMPORTREGISTRYFILE "Uygun bir kütükten bilgiler alır." - ID_REGISTRY_EXPORTREGISTRYFILE "Değer Defteri'nin tümünü ya da bir bölümünü bir kütüğe kaydeder." - ID_REGISTRY_LOADHIVE "Değer Defteri'ne bir yığın yükler." + ID_EDIT_MODIFY "Değerin verisini değiştirir." + ID_EDIT_NEW_KEY "Yeni bir dizin ekler." + ID_EDIT_NEW_STRINGVALUE "Yeni bir dizgi değeri ekler." + ID_EDIT_NEW_BINARYVALUE "Yeni bir ikili değer ekler." + ID_EDIT_NEW_DWORDVALUE "Yeni bir 32 bitlik değer ekler." + ID_REGISTRY_IMPORTREGISTRYFILE "Bir metin kütüğünü Değer Defteri'ne alır." + ID_REGISTRY_EXPORTREGISTRYFILE "Değer Defteri'nin tümünü ya da bir bölümünü bir metin kütüğüne verir." + ID_REGISTRY_LOADHIVE "Değer Defteri'ne bir yığın kütüğü yükler." ID_REGISTRY_UNLOADHIVE "Değer Defteri'nden bir yığın kaldırır." - ID_REGISTRY_CONNECTNETWORKREGISTRY "Uzaktaki bir bilgisyarın değerlerine bağlanır." - ID_REGISTRY_DISCONNECTNETWORKREGISTRY "Uzaktaki bir bilgisayarın değerlerine olan bağlantıyı keser." + ID_REGISTRY_CONNECTNETWORKREGISTRY "Uzaktaki bir bilgisyarın Değer Defteri'sine bağlanır." + ID_REGISTRY_DISCONNECTNETWORKREGISTRY "Uzaktaki bir bilgisayarın Değer Defteri'sine olan bağlantıyı keser." ID_REGISTRY_PRINT "Değer Defteri'nin tümünü ya da bir bölümünü yazdırır." -/* ID_HELP_HELPTOPICS "Değer Defteri Düzenleyicisi ile ilgili yardım konularını açar."*/ - ID_HELP_ABOUT "Değer Defteri Düzenleyicisi ile ilgili bilgi görüntüler." +/* ID_HELP_HELPTOPICS "Değer Defteri Düzenleyicisi Yardımı'nı açar." */ + ID_HELP_ABOUT "İzlenceyle ilgili bilgi görüntüler." END STRINGTABLE BEGIN ID_REGISTRY_EXIT "Değer Defteri Düzenleyicisi'nden çıkar." - ID_FAVOURITES_ADDTOFAVOURITES "Bir dizini yer imlerine ekler." - ID_FAVOURITES_REMOVEFAVOURITE "Dizinleri yer imlerinden kaldırır." - ID_VIEW_STATUSBAR "Durum çubuğunu gizler ya da gösterir." - ID_VIEW_SPLIT "Ayırıcının yerini değiştirir." + ID_FAVOURITES_ADDTOFAVOURITES "Dizinleri yer imleri dizelgesine ekler." + ID_FAVOURITES_REMOVEFAVOURITE "Dizinleri yer imleri dizelgesinden kaldırır." + ID_VIEW_STATUSBAR "Durum çubuğunu gösterir ya da gizler." + ID_VIEW_SPLIT "İki levhâ arasındaki ayırıcının konumunu değiştirir." ID_VIEW_REFRESH "Pencereyi yeniler." - ID_EDIT_DELETE "Seçilen öğeyi siler." - ID_EDIT_RENAME "Seçilen öğenin adını değiştirir." - ID_EDIT_COPYKEYNAME "Seçilen öğenin dizin yolunu çoğaltır." - ID_EDIT_FIND "Belirtilen dizgiyi dizinlerin adlarında, değerlerde veyâ değer adlarında arar." - ID_EDIT_FINDNEXT "Bulunan dizgiyi bulunduğu yerden başlayarak bir daha arar." + ID_EDIT_DELETE "Seçileni siler." + ID_EDIT_RENAME "Seçilenin adını değiştirir." + ID_EDIT_COPYKEYNAME "Seçilen dizinin adını panoya çoğaltır." + ID_EDIT_FIND "Bir dizgiyi dizinlerin adlarında, değer adlarında veyâ değer verilerinde arar." + ID_EDIT_FINDNEXT "Önceki aramada belirtilmiş metni sonraki aramada arar." END STRINGTABLE @@ -317,37 +317,37 @@ BEGIN IDS_WARNING "Uyarı" IDS_BAD_KEY "Dizin sorgulanamıyor: %s" IDS_BAD_VALUE "Değer sorgulanamıyor: %s" - IDS_UNSUPPORTED_TYPE "Bu türdeki dizinler değiştirilemez: %ld" + IDS_UNSUPPORTED_TYPE "Bu türdeki dizinler değiştirilemiyor: %ld" IDS_TOO_BIG_VALUE "Değer çok büyük: %ld" - IDS_MULTI_SZ_EMPTY_STRING "REG_MULTI_SZ boş dizgi içeremez.\nBoş dizgiler dizelgeden silinmiştir." - IDS_QUERY_DELETE_KEY_ONE "Bu dizini silmeyi onaylıyor musunuz?" - IDS_QUERY_DELETE_KEY_MORE "Bu dizinleri silmeyi onaylıyor musunuz?" - IDS_QUERY_DELETE_KEY_CONFIRM "Onaylıyor musunuz?" - IDS_QUERY_DELETE_ONE "Bu değeri silmeyi onaylıyor musunuz?" - IDS_QUERY_DELETE_MORE "Bu değerleri silmeyi onaylıyor musunuz?" - IDS_QUERY_DELETE_CONFIRM "Onaylıyor musunuz?" - IDS_ERR_DELVAL_CAPTION "Değerlerin Silinmesi" - IDS_ERR_DELETEVALUE "Belirtilmiş değerler silinemiyor." - IDS_ERR_RENVAL_CAPTION "Değerin Adının Değiştirilmesi" - IDS_ERR_RENVAL_TOEMPTY "Yeni bir ad girmediğinizden dolayı bu değerin adı değiştirilemiyor: %s" - IDS_QUERY_IMPORT_HIVE_CAPTION "Onaylıyor musunuz?" - IDS_QUERY_IMPORT_HIVE_MSG "Bu dizin, seçili dizinle yenilenecektir.\nBu yüzden bu dizinin tüm alt dizinleri ve değerleri silinecektir.\nİşlemi sürdürmek istiyor musunuz?" + IDS_MULTI_SZ_EMPTY_STRING "REG_MULTI_SZ veri türü boş dizgi içeremez.\nBoş dizgiler dizelgeden silinmiştir." + IDS_QUERY_DELETE_KEY_ONE "Bu dizini silmeyi doğruluyor musunuz?" + IDS_QUERY_DELETE_KEY_MORE "Bu dizinleri silmeyi doğruluyor musunuz?" + IDS_QUERY_DELETE_KEY_CONFIRM "Dizin Silme Doğrulaması" + IDS_QUERY_DELETE_ONE "Bu değeri silmeyi doğruluyor musunuz?" + IDS_QUERY_DELETE_MORE "Bu değerleri silmeyi doğruluyor musunuz?" + IDS_QUERY_DELETE_CONFIRM "Değer Silme Doğrulaması" + IDS_ERR_DELVAL_CAPTION "Değerler Silinmesi Yanlışlığı" + IDS_ERR_DELETEVALUE "Tüm belirtilmiş değerler silinemiyor." + IDS_ERR_RENVAL_CAPTION "Değer Adı Değiştirilmesi Yanlışlığı" + IDS_ERR_RENVAL_TOEMPTY "Adı değiştirilemiyor: %s. Belirtilen değer adı boş. Başka bir ad yazıp yeniden deneyiniz." + IDS_QUERY_IMPORT_HIVE_CAPTION "Dizin Yenileme Doğrulaması" + IDS_QUERY_IMPORT_HIVE_MSG "Bir dizin seçili dizinle yenilenecektir.\nBu dizinin tüm alt dizinleri ve değerleri silinecektir.\nEylemi sürdürmek istiyor musunuz?" IDS_NEW_KEY "%d. Yeni Dizin" IDS_NEW_VALUE "%d. Yeni Değer" END STRINGTABLE BEGIN - IDS_BINARY_EMPTY "(Bu değer sıfır uzunluktadır.)" - IDS_DEFAULT_VALUE_NAME "(Öntanımlı)" - IDS_VALUE_NOT_SET "(Bu değer belirtilmemiştir.)" + IDS_BINARY_EMPTY "(Sıfır uzunluktaki ikili değer)" + IDS_DEFAULT_VALUE_NAME "(Ön tanımlı)" + IDS_VALUE_NOT_SET "(Değer belirtilmemiştir.)" IDS_UNKNOWN_TYPE "Bilinmeyen tür: (0x%lx)" IDS_MY_COMPUTER "Bilgisayar" IDS_IMPORT_REG_FILE "Değer Kütüğünden Al" IDS_EXPORT_REG_FILE "Değer Kütüğüne Ver" IDS_LOAD_HIVE "Yığın Yükle" IDS_UNLOAD_HIVE "Yığını Kaldır" - IDS_INVALID_DWORD "(Bu 32 bitlik değer geçersizdir.)" + IDS_INVALID_DWORD "(Geçersiz 32 bitlik değer)" END STRINGTABLE @@ -355,9 +355,9 @@ BEGIN IDS_FLT_REGFILE "Değer Kütüğü" IDS_FLT_REGFILES "Değer Kütükleri (*.reg)" IDS_FLT_REGFILES_FLT "*.reg" - IDS_FLT_HIVFILES "Yığın Dosyaları (*.*)" + IDS_FLT_HIVFILES "Yığın Kütükleri (*.*)" IDS_FLT_HIVFILES_FLT "*.*" - IDS_FLT_REGEDIT4 "Windows 9x ve Windows NT 4.0 Türündeki Değer Kütükleri (*.reg)" + IDS_FLT_REGEDIT4 "Windows 9x ve Windows NT 4.0 Türündeki Değer Kütükleri (REGEDIT4) (*.reg)" IDS_FLT_REGEDIT4_FLT "*.reg" IDS_FLT_ALLFILES "Tüm Kütükler (*.*)" IDS_FLT_ALLFILES_FLT "*.*" @@ -368,22 +368,22 @@ BEGIN IDS_ACCESS_FULLCONTROL "Tüm Denetim" IDS_ACCESS_READ "Okuma" IDS_ACCESS_QUERYVALUE "Değer Sorgulama" - IDS_ACCESS_SETVALUE "Değer Atama" + IDS_ACCESS_SETVALUE "Değer Belirleme" IDS_ACCESS_CREATESUBKEY "Alt Dizin Oluşturma" - IDS_ACCESS_ENUMERATESUBKEYS "Alt Dizinleri Sıralama" + IDS_ACCESS_ENUMERATESUBKEYS "Alt Dizinleri Numaralandırma" IDS_ACCESS_NOTIFY "Bildirme" IDS_ACCESS_CREATELINK "Bağlantı Oluşturma" IDS_ACCESS_DELETE "Silme" IDS_ACCESS_WRITEDAC "DAC Yazma" - IDS_ACCESS_WRITEOWNER "Sâhibi Yazma" + IDS_ACCESS_WRITEOWNER "İyeyi Yazma" IDS_ACCESS_READCONTROL "Okuma Denetimi" END STRINGTABLE BEGIN - IDS_INHERIT_THISKEYONLY "Yalnızca bu dizin" - IDS_INHERIT_THISKEYANDSUBKEYS "Alt dizinleriyle birlikte bu dizin" - IDS_INHERIT_SUBKEYSONLY "Yalnızca bu dizinin alt dizinleri" + IDS_INHERIT_THISKEYONLY "Yalnızca Bu Dizin" + IDS_INHERIT_THISKEYANDSUBKEYS "Bu Dizin ve Alt Dizinler" + IDS_INHERIT_SUBKEYSONLY "Yalnızca Alt Dizinler" END STRINGTABLE @@ -391,15 +391,15 @@ BEGIN IDS_EXPAND "&Genişlet" IDS_COLLAPSE "&Daralt" IDS_GOTO_SUGGESTED_KEY "G&it: %s" - IDS_FINISHEDFIND "Değer Defteri'nde arama bitti." + IDS_FINISHEDFIND "Değer Defteri boyunca arama bitti." END STRINGTABLE BEGIN - IDS_IMPORT_PROMPT "Eklenen bilgiler, değerleri değiştirebilir veyâ bileşenlerin doğru çalışmasını engelleyebilir.\nEğer %s kütüğündeki bilgilerin kaynağını bilmiyorsanız bu bilgileri Değer Defteri'ne eklemeyiniz.\n\nSürdürmek istiyor musunuz?" - IDS_IMPORT_OK "Bilgiler, %s kütüğünden başarıyla alındı." - IDS_IMPORT_ERROR "%s alınamıyor. Disk yanlışlığı, kütük dizgesi yanlışlığı ya da belirtilen kütüğün olmamasından dolayı bilgi alınacak kütük açılamıyor." - IDS_EXPORT_ERROR "%s verilemiyor. Disk yanlışlığı ya da kütük dizgesi yanlışlığından dolayı belirtilen kütük oluşturulamıyor ya da bilgiler, bu kütüğün üzerine yazılamıyor." + IDS_IMPORT_PROMPT "Bilgi ekleme, yanlışlıkla değerleri değiştirebilir ya da silebilir ve bileşenlerin doğru çalışmasını engelleyebilir.\nEğer ""%s"" içindeki bilginin kaynağına güvenmiyorsanız onu Değer Defteri'ne eklemeyiniz.\n\nSürdürmek istediğinizi doğruluyor musunuz?" + IDS_IMPORT_OK "%s içinde bulunan dizinler ve değerler Değer Defteri'ne başarıyla eklendi." + IDS_IMPORT_ERROR """%s"" alınamıyor: Kütüğü açmada yanlışlık. Bir disk yanlışlığı, bir kütük dizgesi yanlışlığı ya da kütüğün olmaması olabilir." + IDS_EXPORT_ERROR """%s"" verilemiyor: Kütüğü oluşturmada ya da kütüğe yazmada yanlışlık. Bir disk yanlışlığı ya da bir kütük dizgesi yanlışlığı olabilir." END STRINGTABLE @@ -420,24 +420,24 @@ BEGIN IDS_PORT_ACCESS "Erişim" IDS_SPECIFIC_RESERVED1 "Ayrılmış 1" IDS_SPECIFIC_RESERVED2 "Ayrılmış 2" - IDS_SPECIFIC_DATASIZE "Veri Niceliği" + IDS_SPECIFIC_DATASIZE "Veri Büyüklüğü" END STRINGTABLE BEGIN IDS_PORT_PORT_IO "Giriş" IDS_PORT_MEMORY_IO "Bellek" - IDS_INTERRUPT_EDGE_SENSITIVE "Kıyı Duyarlılığı" - IDS_INTERRUPT_LEVEL_SENSITIVE "Düzey Duyarlılığı" - IDS_MEMORY_READ_ONLY "Salt Okunur" - IDS_MEMORY_WRITE_ONLY "Salt Yazılır" + IDS_INTERRUPT_EDGE_SENSITIVE "Kıyı Duyarlı" + IDS_INTERRUPT_LEVEL_SENSITIVE "Düzey Duyarlı" + IDS_MEMORY_READ_ONLY "Yalnızca Okunur" + IDS_MEMORY_WRITE_ONLY "Yalnızca Yazılır" IDS_MEMORY_READ_WRITE "Okuma/Yazma" END STRINGTABLE BEGIN IDS_BUS_UNDEFINED "Tanımlanmamış" - IDS_BUS_INTERNAL "Dâhilî" + IDS_BUS_INTERNAL "İç" IDS_BUS_ISA "ISA" IDS_BUS_EISA "EISA" IDS_BUS_MICROCHANNEL "MikroKanal" @@ -449,8 +449,8 @@ BEGIN IDS_BUS_CBUS "C Veri Yolu" IDS_BUS_MPIBUS "MPI Veri Yolu" IDS_BUS_MPSABUS "MPSA Veri Yolu" - IDS_BUS_PROCESSORINTERNAL "Dâhilî İşlemci" - IDS_BUS_INTERNALPOWERBUS "Dâhilî Güç Veri Yolu" + IDS_BUS_PROCESSORINTERNAL "İç İşlemci" + IDS_BUS_INTERNALPOWERBUS "İç Güç Veri Yolu" IDS_BUS_PNPISABUS "PnP-ISA Veri Yolu" IDS_BUS_PNPBUS "PnP Veri Yolu" IDS_BUS_UNKNOWNTYPE "Bilinmeyen Arayüz Türü" @@ -501,7 +501,7 @@ BEGIN PUSHBUTTON "İptal", IDCANCEL, 7, 114, 50, 14 CONTROL "List1", IDC_FAVORITESLIST, "SysListView32", LVS_LIST | WS_BORDER | WS_TABSTOP, 7, 20, 150, 90 - LTEXT "Yer İmlerini Seç:", IDC_STATIC, 7, 7, 99, 12 + LTEXT "Yer imlerini seçiniz.", IDC_STATIC, 7, 7, 99, 12 END IDD_FIND DIALOGEX 0, 0, 254, 82 @@ -511,18 +511,18 @@ FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "&Sonrakini Ara", IDOK, 197, 7, 50, 14 PUSHBUTTON "İptal", IDCANCEL, 197, 24, 50, 14 - GROUPBOX "Şunlara Bak", IDC_STATIC, 7, 25, 63, 51 - LTEXT "Şunu Ara:", IDC_STATIC, 7, 8, 37, 10 + GROUPBOX "Bak", IDC_STATIC, 7, 25, 63, 51 + LTEXT "Bakılacaklar", IDC_STATIC, 7, 8, 37, 10 EDITTEXT IDC_FINDWHAT, 47, 7, 142, 13, ES_AUTOHSCROLL CONTROL "D&iznler", IDC_LOOKAT_KEYS, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 36, 35, 8 CONTROL "D&eğer Adları", IDC_LOOKAT_VALUES, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 48, 36, 8 - CONTROL "&Değerler", IDC_LOOKAT_DATA, "Button", BS_AUTOCHECKBOX | + CONTROL "&Değer Verileri", IDC_LOOKAT_DATA, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 14, 60, 42, 8 - CONTROL "Yalnızca Tüm Dizgi", IDC_MATCHSTRING, "Button", BS_AUTOCHECKBOX | + CONTROL "&Yalnızca Tüm Dizgiyi Karşılaştır", IDC_MATCHSTRING, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 83, 32, 94, 13 - CONTROL "Büyük-küçük Hârf Ayrımı", IDC_MATCHCASE, "Button", BS_AUTOCHECKBOX | + CONTROL "&Büyük-Küçük Harfliği Karşılaştır", IDC_MATCHCASE, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 83, 48, 90, 12 END @@ -533,14 +533,14 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN ICON IDI_REGEDIT, IDC_STATIC, 7, 7, 20, 20 DEFPUSHBUTTON "İptal", IDCANCEL, 93, 29, 45, 14 - LTEXT "Aranıyor...", IDC_STATIC, 33, 12, 83, 8 + LTEXT "Değer Defteri Aranıyor...", IDC_STATIC, 33, 12, 83, 8 END /* String Table */ /* *STRINGTABLE *BEGIN - * ID_HELP_HELPTOPICS "Değer Defteri Düzenleyicisi ile ilgili yardım konularını açar." - * ID_HELP_ABOUT "Değer Defteri Düzenleyicisi ile ilgili bilgi görüntüler." + * ID_HELP_HELPTOPICS "Değer Defteri Düzenleyicisi Yardımı'nı açar." + * ID_HELP_ABOUT "İzlenceyle ilgili bilgi görüntüler." *END */ diff --git a/reactos/base/applications/regedit/regedit.rc b/reactos/base/applications/regedit/regedit.rc index 750b3c52637..216d4956bd8 100644 --- a/reactos/base/applications/regedit/regedit.rc +++ b/reactos/base/applications/regedit/regedit.rc @@ -110,6 +110,9 @@ IDI_REGFILE ICON "res/regfile.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif @@ -119,9 +122,6 @@ IDI_REGFILE ICON "res/regfile.ico" #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/screensavers/3dtext/lang/tr-TR.rc b/reactos/base/applications/screensavers/3dtext/lang/tr-TR.rc index 96a55878614..aab24a011c8 100644 --- a/reactos/base/applications/screensavers/3dtext/lang/tr-TR.rc +++ b/reactos/base/applications/screensavers/3dtext/lang/tr-TR.rc @@ -1,10 +1,10 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT DLG_SCRNSAVECONFIGURE DIALOGEX 0, 0, 273, 178 STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "3D Metin Görüntülük Koruyucusu Seçenekleri" +CAPTION "3D Metin Görüntülük Koruyucusu Ayarları" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Tamam", IDOK, 216, 7, 50, 14 diff --git a/reactos/base/applications/screensavers/3dtext/rsrc.rc b/reactos/base/applications/screensavers/3dtext/rsrc.rc index 12ce4ae86f7..5ab87e80a95 100644 --- a/reactos/base/applications/screensavers/3dtext/rsrc.rc +++ b/reactos/base/applications/screensavers/3dtext/rsrc.rc @@ -68,15 +68,15 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/screensavers/logon/lang/tr-TR.rc b/reactos/base/applications/screensavers/logon/lang/tr-TR.rc index aa09ee5328e..23dc509993a 100644 --- a/reactos/base/applications/screensavers/logon/lang/tr-TR.rc +++ b/reactos/base/applications/screensavers/logon/lang/tr-TR.rc @@ -1,9 +1,9 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT STRINGTABLE BEGIN IDS_DESCRIPTION "Oturum Açma Görüntülük Koruyucusu" - IDS_TEXT "Bu görüntülük koruyucusu için hiçbir seçenek yok." + IDS_TEXT "Ayarlanması gereken hiçbir seçenek yok." END diff --git a/reactos/base/applications/screensavers/logon/logon.rc b/reactos/base/applications/screensavers/logon/logon.rc index 9b7620e3021..2bce64aaee4 100644 --- a/reactos/base/applications/screensavers/logon/logon.rc +++ b/reactos/base/applications/screensavers/logon/logon.rc @@ -77,15 +77,15 @@ IDB_SERVER BITMAP "res/1.bmp" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/sndrec32/lang/tr-TR.rc b/reactos/base/applications/sndrec32/lang/tr-TR.rc index c7035f77b5e..b4cf3226b94 100644 --- a/reactos/base/applications/sndrec32/lang/tr-TR.rc +++ b/reactos/base/applications/sndrec32/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013, 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013, 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -10,7 +10,7 @@ END IDD_ABOUTBOX DIALOGEX 0, 0, 196, 75 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Ses Kaydedicisi Hakkında" +CAPTION "Ses Kaydedicisi Üzerine" FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN ICON IDI_SNDREC32, -1, 19, 14, 21, 20 @@ -27,12 +27,12 @@ BEGIN MENUITEM "&Aç...", ID_FILE_OPEN MENUITEM "&Kaydet", ID_FILE_SAVE, GRAYED MENUITEM "Ay&rı Kaydet...", ID_FILE_SAVEAS, GRAYED - MENUITEM "Y&eniden Yükle...", ID_FILE_RESTORE, GRAYED + MENUITEM "&Eski Durumuna Döndür...", ID_FILE_RESTORE, GRAYED MENUITEM "&Husûsiyetler", ID_FILE_PROPERTIES MENUITEM SEPARATOR MENUITEM "&Çıkış", ID_FILE_EXIT END - POPUP "&Düzen" + POPUP "&Düzenleme" BEGIN MENUITEM "&Çoğalt", ID_EDIT_COPY MENUITEM "&Ekleyerek Yapıştır", ID_EDIT_PASTE, GRAYED @@ -55,11 +55,11 @@ BEGIN MENUITEM "H&ızı Düşür", ID_EFFECTS_DECSPD MENUITEM SEPARATOR MENUITEM "&Yankı Ekle", ID_EFFECTS_ECHO - MENUITEM "&Tersine Çevir", ID_EFFECTS_REVERSE + MENUITEM "&Evir", ID_EFFECTS_REVERSE END POPUP "&Yardım" BEGIN - MENUITEM "&Hakkında", ID_ABOUT + MENUITEM "&Üzerine...", ID_ABOUT END END @@ -76,6 +76,6 @@ BEGIN IDS_STRBUF "Ara Bellek: %.2f KB" IDS_STRFMT "%.1f kHz, %u bitlik" IDS_STRMONO "Tek Yollu" - IDS_STRSTEREO "Çift Yollu" + IDS_STRSTEREO "Çok Yollu" IDS_STRCHAN "%s" END diff --git a/reactos/base/applications/sndrec32/rsrc.rc b/reactos/base/applications/sndrec32/rsrc.rc index 6f9b1d14a72..5132c80590c 100644 --- a/reactos/base/applications/sndrec32/rsrc.rc +++ b/reactos/base/applications/sndrec32/rsrc.rc @@ -56,15 +56,15 @@ IDB_BITMAP2_STOP_DIS BITMAP "resources/but_stop_dis.bmp" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/sndvol32/lang/tr-TR.rc b/reactos/base/applications/sndvol32/lang/tr-TR.rc index f834dd9eef6..81ca9ed6a30 100644 --- a/reactos/base/applications/sndvol32/lang/tr-TR.rc +++ b/reactos/base/applications/sndvol32/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -15,14 +15,14 @@ BEGIN BEGIN MENUITEM "&Yardım Konuları", IDC_HELP_TOPICS MENUITEM SEPARATOR - MENUITEM "&Hakkında", IDC_ABOUT + MENUITEM "&Üzerine...", IDC_ABOUT END END STRINGTABLE BEGIN - IDS_SNDVOL32 "Ses Düzeyi Denetleyicisi" - IDS_NOMIXERDEVICES "Etkin bir karıştırıcı aygıt yok. Uygulamadan çıkılacaktır." + IDS_SNDVOL32 "Ses Düzeyi Denetimi" + IDS_NOMIXERDEVICES "Burada etkin karıştırıcı aygıt yok. Uygulama şimdi çıkacak." END IDD_PREFERENCES DIALOGEX 0, 0, 224, 250 @@ -30,14 +30,14 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS CAPTION "Husûsiyetler" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "K&arıştırıcı Aygıt:", -1, 7, 8, 48, 9 + LTEXT "&Karıştırıcı Aygıt:", -1, 7, 8, 48, 9 COMBOBOX IDC_MIXERDEVICE, 55, 8, 162, 80, CBS_DROPDOWNLIST | WS_TABSTOP GROUPBOX "Ses Düzeyi Düzenlenecekler", -1, 7, 25, 211, 77 PUSHBUTTON "&Çalma", IDC_PLAYBACK, 13, 43, 47, 8, BS_AUTORADIOBUTTON - PUSHBUTTON "&Kaydetme", IDC_RECORDING, 13, 61, 47, 8, BS_AUTORADIOBUTTON + PUSHBUTTON "K&aydetme", IDC_RECORDING, 13, 61, 47, 8, BS_AUTORADIOBUTTON PUSHBUTTON "&Diğer:", IDC_OTHER, 13, 80, 42, 8, BS_AUTORADIOBUTTON | WS_DISABLED COMBOBOX IDC_LINE, 55, 80, 155, 50, CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED - LTEXT "Gösterilecek Ses Düzeyi Denetimleri:", IDC_LABELCONTROLS, 7, 109, 162, 8 + LTEXT "Aşağıdaki ses düzeyi denetimlerini göster:", IDC_LABELCONTROLS, 7, 109, 162, 8 CONTROL "", IDC_CONTROLS, "SysListView32", LVS_REPORT | LVS_NOCOLUMNHEADER | WS_TABSTOP | WS_BORDER, 7, 122, 211, 96 PUSHBUTTON "Tamam", IDOK, 114, 226, 50, 14 PUSHBUTTON "İptal", IDCANCEL, 168, 226, 50, 14 diff --git a/reactos/base/applications/sndvol32/sndvol32.rc b/reactos/base/applications/sndvol32/sndvol32.rc index 2a2a797566d..9545cdde309 100644 --- a/reactos/base/applications/sndvol32/sndvol32.rc +++ b/reactos/base/applications/sndvol32/sndvol32.rc @@ -81,6 +81,9 @@ IDI_MAINAPP ICON "resources/sndvol32.ico" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif @@ -90,9 +93,6 @@ IDI_MAINAPP ICON "resources/sndvol32.ico" #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/taskmgr/lang/tr-TR.rc b/reactos/base/applications/taskmgr/lang/tr-TR.rc index 9f3f569af05..c0715aaf2e7 100644 --- a/reactos/base/applications/taskmgr/lang/tr-TR.rc +++ b/reactos/base/applications/taskmgr/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -6,26 +6,26 @@ IDR_TASKMANAGER MENU BEGIN POPUP "&Kütük" BEGIN - MENUITEM "&Yeni Görev Çalıştır...", ID_FILE_NEW + MENUITEM "&Yeni Görev (Çalıştır...)", ID_FILE_NEW MENUITEM SEPARATOR MENUITEM "&Çıkış", ID_FILE_EXIT END POPUP "&Seçenekler" BEGIN - MENUITEM "&Her Zaman Üstte", ID_OPTIONS_ALWAYSONTOP, CHECKED + MENUITEM "&Sürekli Üstte", ID_OPTIONS_ALWAYSONTOP, CHECKED MENUITEM "&Kullanımda Simge Durumuna Küçült", ID_OPTIONS_MINIMIZEONUSE, CHECKED - MENUITEM "&Simge Durumuna Küçültüldüğünde Gizle", ID_OPTIONS_HIDEWHENMINIMIZED, CHECKED - MENUITEM "&16 İkillik Görevleri Göster", ID_OPTIONS_SHOW16BITTASKS, CHECKED + MENUITEM "S&imge Durumuna Küçültüldüğünde Gizle", ID_OPTIONS_HIDEWHENMINIMIZED, CHECKED + MENUITEM "&16 Bitlik Görevleri Göster", ID_OPTIONS_SHOW16BITTASKS, CHECKED END POPUP "&Görünüm" BEGIN - MENUITEM "&Yenile", ID_VIEW_REFRESH + MENUITEM "&Şimdi Yenile", ID_VIEW_REFRESH POPUP "&Yenilenme Hızı" BEGIN MENUITEM "&Yüksek", ID_VIEW_UPDATESPEED_HIGH MENUITEM "&Orta", ID_VIEW_UPDATESPEED_NORMAL, CHECKED MENUITEM "&Düşük", ID_VIEW_UPDATESPEED_LOW - MENUITEM "&Sıfır", ID_VIEW_UPDATESPEED_PAUSED + MENUITEM "D&uraklatılmış", ID_VIEW_UPDATESPEED_PAUSED END MENUITEM SEPARATOR MENUITEM "&Büyük Simgeler", ID_VIEW_LARGE @@ -34,43 +34,43 @@ BEGIN MENUITEM "&Dikeçleri Seç...", ID_VIEW_SELECTCOLUMNS POPUP "&CPU Geçmişi" BEGIN - MENUITEM "&Tüm CPU'lar İçin Aynı Çizge", ID_VIEW_CPUHISTORY_ONEGRAPHALL - MENUITEM "&Her CPU'ya Birer Çizge", ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, CHECKED + MENUITEM "&Tek Çizge, Tüm CPU'lar", ID_VIEW_CPUHISTORY_ONEGRAPHALL + MENUITEM "&CPU Başına Bir Çizge", ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU, CHECKED END - MENUITEM "&Çekirdek Zamanlarını Göster", ID_VIEW_SHOWKERNELTIMES + MENUITEM "&Çekirdek Sürelerini Göster", ID_VIEW_SHOWKERNELTIMES END POPUP "&Pencereler" BEGIN - MENUITEM "&Yatay Olarak Sırala", ID_WINDOWS_TILEHORIZONTALLY - MENUITEM "&Dikey Olarak Sırala", ID_WINDOWS_TILEVERTICALLY - MENUITEM "&Küçült", ID_WINDOWS_MINIMIZE + MENUITEM "&Yatay Olarak Döşe", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "&Dikey Olarak Döşe", ID_WINDOWS_TILEVERTICALLY + MENUITEM "&Simge Durumuna Küçült", ID_WINDOWS_MINIMIZE MENUITEM "&Büyüt", ID_WINDOWS_MAXIMIZE - MENUITEM "B&asamakla", ID_WINDOWS_CASCADE + MENUITEM "B&asamaklandır", ID_WINDOWS_CASCADE MENUITEM "&Öne Getir", ID_WINDOWS_BRINGTOFRONT END POPUP "&Yardım" BEGIN MENUITEM "&Yardım Konuları", ID_HELP_TOPICS MENUITEM SEPARATOR - MENUITEM "&Hakkında", ID_HELP_ABOUT + MENUITEM "&Üzerine...", ID_HELP_ABOUT END END IDR_WINDOWSMENU MENU BEGIN - MENUITEM "&Yatay Olarak Sırala", ID_WINDOWS_TILEHORIZONTALLY - MENUITEM "&Dikey Olarak Sırala", ID_WINDOWS_TILEVERTICALLY - MENUITEM "&Küçült", ID_WINDOWS_MINIMIZE + MENUITEM "&Yatay Olarak Döşe", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "&Dikey Olarak Döşe", ID_WINDOWS_TILEVERTICALLY + MENUITEM "&Simge Durumuna Küçült", ID_WINDOWS_MINIMIZE MENUITEM "&Büyüt", ID_WINDOWS_MAXIMIZE - MENUITEM "B&asamakla", ID_WINDOWS_CASCADE + MENUITEM "B&asamaklandır", ID_WINDOWS_CASCADE MENUITEM "&Öne Getir", ID_WINDOWS_BRINGTOFRONT END IDR_APPLICATION_PAGE_CONTEXT1 MENU BEGIN - POPUP "SAHTE" + POPUP "DUMMY" BEGIN - MENUITEM "&Yeni Görev Çalıştır...", ID_FILE_NEW + MENUITEM "&Yeni Görev (Çalıştır...)", ID_FILE_NEW MENUITEM SEPARATOR MENUITEM "&Büyük Simgeler", ID_VIEW_LARGE MENUITEM "&Küçük Simgeler", ID_VIEW_SMALL @@ -80,16 +80,16 @@ END IDR_APPLICATION_PAGE_CONTEXT2 MENU BEGIN - POPUP "SAHTE" + POPUP "DUMMY" BEGIN - MENUITEM "&Geçiş Yap", ID_APPLICATION_PAGE_SWITCHTO + MENUITEM "&Geç", ID_APPLICATION_PAGE_SWITCHTO MENUITEM "&Öne Getir", ID_WINDOWS_BRINGTOFRONT MENUITEM SEPARATOR - MENUITEM "&Yatay Olarak Sırala", ID_WINDOWS_TILEHORIZONTALLY - MENUITEM "&Dikey Olarak Sırala", ID_WINDOWS_TILEVERTICALLY - MENUITEM "&Küçült", ID_WINDOWS_MINIMIZE + MENUITEM "&Yatay Olarak Döşe", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "&Dikey Olarak Döşe", ID_WINDOWS_TILEVERTICALLY + MENUITEM "&Simge Durumuna Küçült", ID_WINDOWS_MINIMIZE MENUITEM "&Büyüt", ID_WINDOWS_MAXIMIZE - MENUITEM "B&asamakla", ID_WINDOWS_CASCADE + MENUITEM "B&asamaklandır", ID_WINDOWS_CASCADE MENUITEM SEPARATOR MENUITEM "Gö&revi Sonlandır", ID_APPLICATION_PAGE_ENDTASK MENUITEM "&İşleme Git", ID_APPLICATION_PAGE_GOTOPROCESS @@ -98,34 +98,34 @@ END IDR_TRAY_POPUP MENU BEGIN - POPUP "SAHTE" + POPUP "DUMMY" BEGIN - MENUITEM "&Önceki Boyutuna Getir", ID_RESTORE + MENUITEM "&Eski Durumuna Getir", ID_RESTORE MENUITEM "&Kapat", ID_FILE_EXIT MENUITEM SEPARATOR - MENUITEM "&Her Zaman Üstte", ID_OPTIONS_ALWAYSONTOP + MENUITEM "&Sürekli Üstte", ID_OPTIONS_ALWAYSONTOP END END IDR_PROCESS_PAGE_CONTEXT MENU BEGIN - POPUP "SAHTE" + POPUP "DUMMY" BEGIN MENUITEM "&İşlemi Sonlandır", ID_PROCESS_PAGE_ENDPROCESS MENUITEM "İ&şlem Ağacını Sonlandır", ID_PROCESS_PAGE_ENDPROCESSTREE MENUITEM "&Yanlışlık Ayıkla", ID_PROCESS_PAGE_DEBUG MENUITEM SEPARATOR - POPUP "&Öncelik Ata" + POPUP "&Önceliği Aayarla" BEGIN MENUITEM "&Eş Zamanlı", ID_PROCESS_PAGE_SETPRIORITY_REALTIME MENUITEM "&Yüksek", ID_PROCESS_PAGE_SETPRIORITY_HIGH - MENUITEM "&Orta-Yüksek", ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL - MENUITEM "O&rta", ID_PROCESS_PAGE_SETPRIORITY_NORMAL - MENUITEM "Or&ta-Düşük", ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL - MENUITEM "&Düşük", ID_PROCESS_PAGE_SETPRIORITY_LOW + MENUITEM "&Düzgülü Üstü", ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL + MENUITEM "D&üzgülü", ID_PROCESS_PAGE_SETPRIORITY_NORMAL + MENUITEM "Dü&zgülü Altı", ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL + MENUITEM "Dü&şük", ID_PROCESS_PAGE_SETPRIORITY_LOW END - MENUITEM "&CPU'larla İlişkisini Değiştir...", ID_PROCESS_PAGE_SETAFFINITY - MENUITEM "H&atâ Ayıklama Kanallarını Düzenle...", ID_PROCESS_PAGE_DEBUGCHANNELS + MENUITEM "İ&lişkiyi Ayarla...", ID_PROCESS_PAGE_SETAFFINITY + MENUITEM "Y&anlışlık Ayıklama Kanallarını Düzenle...", ID_PROCESS_PAGE_DEBUGCHANNELS END END @@ -148,7 +148,7 @@ BEGIN CONTROL "List2", IDC_APPLIST, "SysListView32", LVS_REPORT | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 7, 7, 233, 177 PUSHBUTTON "&Yeni Görev...", IDC_NEWTASK, 187, 189, 53, 14 - PUSHBUTTON "&Geçiş Yap", IDC_SWITCHTO, 131, 189, 53, 14, WS_DISABLED + PUSHBUTTON "&Geç", IDC_SWITCHTO, 131, 189, 53, 14, WS_DISABLED PUSHBUTTON "G&örevi Sonlandır", IDC_ENDTASK, 75, 189, 53, 14, WS_DISABLED END @@ -159,7 +159,7 @@ BEGIN CONTROL "List2", IDC_PROCESSLIST, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP, 7, 7, 233, 177 PUSHBUTTON "&İşlemi Sonlandır", IDC_ENDPROCESS, 171, 189, 69, 14 - CONTROL "&Her Kullanıcıda Çalışan İşlemleri Göster", IDC_SHOWALLPROCESSES, "Button", + CONTROL "&Her Kullanıcının İşlemlerini Göster", IDC_SHOWALLPROCESSES, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 191, 111, 10 END @@ -172,7 +172,7 @@ BEGIN GROUPBOX "Bellek Kullanımı", IDC_MEM_USAGE_FRAME, 5, 63, 60, 54, BS_LEFTTEXT, WS_EX_TRANSPARENT GROUPBOX "Toplam", IDC_TOTALS_FRAME, 5, 122, 111, 39, 0, WS_EX_TRANSPARENT GROUPBOX "Ayrılmış Bellek (KB)", IDC_COMMIT_CHARGE_FRAME, 5, 166, 111, 39, 0, WS_EX_TRANSPARENT - GROUPBOX "Fizikî Bellek (KB)", IDC_PHYSICAL_MEMORY_FRAME, 131, 122, 111, 39, 0, WS_EX_TRANSPARENT + GROUPBOX "Fizîkî Bellek (KB)", IDC_PHYSICAL_MEMORY_FRAME, 131, 122, 111, 39, 0, WS_EX_TRANSPARENT GROUPBOX "Çekirdek Belleği (KB)", IDC_KERNEL_MEMORY_FRAME, 131, 166, 111, 39, 0, WS_EX_TRANSPARENT LTEXT "İşleçler", IDS_TOTALS_HANDLE_COUNT, 12, 131, 27, 8 LTEXT "İş Parçacıkları", IDS_TOTALS_THREAD_COUNT, 12, 140, 27, 8 @@ -184,7 +184,7 @@ BEGIN EDITTEXT IDC_TOTALS_PROCESS_COUNT, 65, 149, 45, 8, ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER | NOT WS_TABSTOP LTEXT "Toplam", IDS_COMMIT_CHARGE_TOTAL, 12, 175, 27, 8 - LTEXT "Sınır", IDS_COMMIT_CHARGE_LIMIT, 12, 184, 15, 8, NOT WS_BORDER + LTEXT "Hudut", IDS_COMMIT_CHARGE_LIMIT, 12, 184, 15, 8, NOT WS_BORDER LTEXT "En Yüksek", IDS_COMMIT_CHARGE_PEAK, 12, 193, 34, 8 EDITTEXT IDC_COMMIT_CHARGE_TOTAL, 65, 174, 45, 8, ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER | NOT WS_TABSTOP @@ -211,11 +211,11 @@ BEGIN EDITTEXT IDC_KERNEL_MEMORY_NONPAGED, 185, 193, 48, 8, ES_RIGHT | ES_READONLY | ES_NUMBER | NOT WS_BORDER | NOT WS_TABSTOP GROUPBOX "CPU Kullanım Geçmişi", IDC_CPU_USAGE_HISTORY_FRAME, 74, 5, 168, 54, 0, WS_EX_TRANSPARENT - GROUPBOX "Sayfalama Dosyası Kullanım Geçmişi", IDC_MEMORY_USAGE_HISTORY_FRAME, 74, 63, 168, 54, 0, WS_EX_TRANSPARENT + GROUPBOX "Bellek Kullanım Geçmişi", IDC_MEMORY_USAGE_HISTORY_FRAME, 74, 63, 168, 54, 0, WS_EX_TRANSPARENT PUSHBUTTON "CPU Kullanım Çizgesi", IDC_CPU_USAGE_GRAPH, 12, 17, 47, 37, NOT WS_TABSTOP, WS_EX_CLIENTEDGE - PUSHBUTTON "Sayfalama Dosyası Kullanım Çizgesi", IDC_MEM_USAGE_GRAPH, 12, 75, 47, 37, NOT WS_TABSTOP, WS_EX_CLIENTEDGE + PUSHBUTTON "Bellek Kullanım Çizgesi", IDC_MEM_USAGE_GRAPH, 12, 75, 47, 37, NOT WS_TABSTOP, WS_EX_CLIENTEDGE PUSHBUTTON "CPU Kullanım Geçmişi Çizgesi", IDC_CPU_USAGE_HISTORY_GRAPH, 81, 17, 153, 37, NOT WS_TABSTOP, WS_EX_CLIENTEDGE - PUSHBUTTON "Sayfalama Dosyası Kullanım Geçmişi Çizgesi", IDC_MEM_USAGE_HISTORY_GRAPH, 81, 75, 153, 37, NOT WS_TABSTOP, WS_EX_CLIENTEDGE + PUSHBUTTON "Bellek Kullanım Geçmişi Çizgesi", IDC_MEM_USAGE_HISTORY_GRAPH, 81, 75, 153, 37, NOT WS_TABSTOP, WS_EX_CLIENTEDGE END IDD_DEBUG_CHANNELS_DIALOG DIALOGEX 0, 0, 247, 210 @@ -230,12 +230,12 @@ END IDD_AFFINITY_DIALOG DIALOGEX 0, 0, 231, 154 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "CPU'larla İlişkisini Değiştir" +CAPTION "İşlemci İlişkisi" FONT 8, "MS Shell Dlg" BEGIN DEFPUSHBUTTON "Tamam", IDOK, 120, 133, 50, 14 PUSHBUTTON "İptal", IDCANCEL, 174, 133, 50, 14 - LTEXT "Bu seçenekler, bu işlemin hangi CPU'larla yürütüleceğini belirler.", IDC_STATIC, 5, 5, 220, 16 + LTEXT "İşlemci İlişkisi ayârı, işleme hangi CPU'ların üzerinde çalışmasına izin verileceğini denetler.", IDC_STATIC, 5, 5, 220, 16 CONTROL "CPU 0", IDC_CPU0, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 11, 28, 37, 10 CONTROL "CPU 1", IDC_CPU1, "Button", BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP, 11, 41, 37, 10 CONTROL "CPU 2", IDC_CPU2, "Button", BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP, 11, 54, 37, 10 @@ -341,7 +341,7 @@ BEGIN ID_HELP_TOPICS "Görev Yöneticisi ile ilgili yardım konularını görüntüler." ID_HELP_ABOUT "Görev Yöneticisi ile ilgili bilgi görüntüler." ID_FILE_EXIT "Görev Yöneticisi'nden çıkar." - ID_OPTIONS_SHOW16BITTASKS "Farazî DOS makinesi (ntvdm.exe) altında çalışan 16 bitlik uygulamaları da görüntüler." + ID_OPTIONS_SHOW16BITTASKS "Farazî DOS Makinesi (ntvdm.exe) altında çalışan 16 bitlik uygulamaları da görüntüler." ID_VIEW_SELECTCOLUMNS """İşlemler"" sekmesinde hangi dikeçlerin görüntülenip görüntülenmeyeceğini belirler." ID_VIEW_SHOWKERNELTIMES "İşlemci çizgelerinde çekirdek zamanlarını gösterir." ID_VIEW_CPUHISTORY_ONEGRAPHALL "Toplam CPU kullanımını tek çizgede gösterir." @@ -399,7 +399,7 @@ BEGIN IDS_TAB_IOWRITESBYTES "G/Ç Yazma Çokluları" IDS_TAB_IOOTHERBYTES "G/Ç Diğer Çoklular" IDS_MENU_SELECTCOLUMNS "&Dikeçleri Seç..." - IDS_MENU_16BITTASK "&16 İkillik Görevleri Göster" + IDS_MENU_16BITTASK "&16 Bitlik Görevleri Göster" IDS_MENU_WINDOWS "&Pencereler" IDS_MENU_LARGEICONS "&Büyük Simgeler" IDS_MENU_SMALLICONS "&Küçük Simgeler" @@ -414,12 +414,12 @@ BEGIN IDS_MSG_PROCESSONEPRO "Herhangi bir işlem, en az bir CPU ile ilişkili olmalıdır." IDS_MSG_INVALIDOPTION "Geçersiz seçenek." IDS_MSG_UNABLEDEBUGPROCESS "Yanlışlık ayıklama işlemi yapılamaz." - IDS_MSG_WARNINGDEBUG "UYARI: Bu işlemde yanlışlık ayıklama, veri yitimine neden olabilir.\nBu işleme bir yanlışlık ayıklayıcı bağlamayı onaylıyor musunuz?" + IDS_MSG_WARNINGDEBUG "UYARI: Bu işlemde yanlışlık ayıklama, veri yitimine neden olabilir.\nBu işleme bir yanlışlık ayıklayıcı bağlamayı doğruluyor musunuz?" IDS_MSG_TASKMGRWARNING "Uyarı" - IDS_MSG_WARNINGTERMINATING "UYARI: Bir işlemin sonlandırılması, dizge\nkararsızlığı veyâ veri yitimi gibi istenmeyen durumlara neden olabilir. Bu\nişlemi sonlandırmayı onaylıyor musunuz?" + IDS_MSG_WARNINGTERMINATING "UYARI: Bir işlemin sonlandırılması, dizge\nkararsızlığı veyâ veri yitimi gibi istenmeyen durumlara neden olabilir. Bu\nişlemi sonlandırmayı doğruluyor musunuz?" IDS_MSG_UNABLETERMINATEPRO "İşlem sonlandırma yapılamaz." IDS_MSG_UNABLECHANGEPRIORITY "İşlemci önceliği değiştirilemez." - IDS_MSG_WARNINGCHANGEPRIORITY "UYARI: İşlemci önceliğinin değiştirilmesi, dizge\nkararsızlığı gibi istenmeyen durumlara neden olabilir. Bu işlemin\nişlemci önceliğini değiştirmeyi onaylıyor musunuz?" + IDS_MSG_WARNINGCHANGEPRIORITY "UYARI: İşlemci önceliğinin değiştirilmesi, dizge\nkararsızlığı gibi istenmeyen durumlara neden olabilir. Bu işlemin\nişlemci önceliğini değiştirmeyi doğruluyor musunuz?" IDS_MSG_TRAYICONCPUUSAGE "CPU Kullanımı: %%%d" IDS_STATUS_MEMUSAGE "Bellek Kullanımı: %d KB / %d KB" IDS_STATUS_CPUUSAGE "CPU Kullanımı: %%%3d" diff --git a/reactos/base/applications/taskmgr/taskmgr.rc b/reactos/base/applications/taskmgr/taskmgr.rc index faf65988989..d151e48c785 100644 --- a/reactos/base/applications/taskmgr/taskmgr.rc +++ b/reactos/base/applications/taskmgr/taskmgr.rc @@ -78,15 +78,15 @@ IDB_TRAYICON BITMAP "res/trayicon.bmp" #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/sq-AL.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/sv-SE.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/tr-TR.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/sq-AL.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/uk-UA.rc" #endif diff --git a/reactos/base/applications/winhlp32/lang/Tr.rc b/reactos/base/applications/winhlp32/lang/Tr.rc index 90aa19ebad2..1de9609571c 100644 --- a/reactos/base/applications/winhlp32/lang/Tr.rc +++ b/reactos/base/applications/winhlp32/lang/Tr.rc @@ -1,7 +1,7 @@ /* * Turkish Resources for ReactOS Winhlp32 * - * Copyrights: 2006 - Fatih Aşıcı (fasici@linux-sevenler.org), 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyrights: 2006 Fatih Aşıcı (fasici@linux-sevenler.org), 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,42 +28,58 @@ MAIN_MENU MENU MENUITEM "&Aç...", MNID_FILE_OPEN MENUITEM SEPARATOR MENUITEM "&Yazdır...", MNID_FILE_PRINT - MENUITEM "Ya&zıcı Ayarları...", MNID_FILE_SETUP + MENUITEM "Ya&zıcı Ayarla...", MNID_FILE_SETUP MENUITEM SEPARATOR MENUITEM "&Çıkış", MNID_FILE_EXIT } - POPUP "&Düzen" { + POPUP "&Düzenleme" { MENUITEM "&Çoğalt", MNID_EDIT_COPYDLG MENUITEM SEPARATOR MENUITEM "&Hâşiye Ekle...", MNID_EDIT_ANNOTATE } POPUP "Y&er İmleri" { - MENUITEM "&Düzenle...", MNID_BKMK_DEFINE + MENUITEM "&Belirle...", MNID_BKMK_DEFINE } POPUP "&Seçenekler" { - POPUP "&Her Zaman Üstte Olma" + POPUP "&Sürekli Görünür" BEGIN - MENUITEM "&Öntanımlı", MNID_OPTS_HELP_DEFAULT + MENUITEM "&Ön Tanımlı", MNID_OPTS_HELP_DEFAULT MENUITEM "&Evet", MNID_OPTS_HELP_VISIBLE MENUITEM "&Hayır", MNID_OPTS_HELP_NONVISIBLE END MENUITEM "&Geçmiş", MNID_OPTS_HISTORY - POPUP "&Metin Boyutu" + POPUP "&Yazı Tipi" BEGIN MENUITEM "&Küçük", MNID_OPTS_FONTS_SMALL - MENUITEM "&Orta", MNID_OPTS_FONTS_NORMAL + MENUITEM "&Düzgülü", MNID_OPTS_FONTS_NORMAL MENUITEM "&Büyük", MNID_OPTS_FONTS_LARGE END MENUITEM "&Dizge Renklerini Kullan", MNID_OPTS_SYSTEM_COLORS } POPUP "&Yardım" { MENUITEM "&Yardım İçin Yardım", MNID_HELP_HELPON - MENUITEM "H&er Zaman Üstte", MNID_HELP_HELPTOP + MENUITEM "&Sürekli Üstte", MNID_HELP_HELPTOP MENUITEM SEPARATOR - MENUITEM "&Hakkında", MNID_HELP_ABOUT + MENUITEM "&Üzerine...", MNID_HELP_ABOUT } } +IDD_INDEX DIALOG 0, 0, 200, 190 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +FONT 8, "MS Shell Dlg" +CAPTION "Dizin" +{ + LISTBOX IDC_INDEXLIST, 10, 10, 180, 150, LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_BORDER +} + +IDD_SEARCH DIALOG 0, 0, 200, 190 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +FONT 8, "MS Shell Dlg" +CAPTION "Bul" +{ + LTEXT "Daha bitirilmemiştir.", -1, 10, 10, 180, 150 +} + /* Strings */ STRINGTABLE { @@ -72,12 +88,36 @@ STID_WHERROR, "YANLIŞLIK" STID_WARNING, "UYARI" STID_INFO, "Bilgi" STID_NOT_IMPLEMENTED, "Daha bitirilmemiştir." -STID_HLPFILE_ERROR_s, "%s kütüğü açılırken bir yanlışlık oluştu." +STID_HLPFILE_ERROR_s, """%s"" kütüğü okunurken bir yanlışlık oldu." STID_INDEX, "D&izin" STID_CONTENTS, "İ&çindekiler" STID_BACK, "&Geri" STID_ALL_FILES, "Tüm Kütükler (*.*)" STID_HELP_FILES_HLP, "Yardım Kütükleri (*.hlp)" -STID_FILE_NOT_FOUND_s, "%s kütüğü bulunamıyor. Bu kütüğü kendiniz bulmak istiyor musunuz?" -STID_NO_RICHEDIT, "Zengin metin kitaplığı bulunamadı." +STID_FILE_NOT_FOUND_s, """%s"" bulunamıyor. Bu kütüğü kendiniz bulmak istiyor musunuz?" +STID_NO_RICHEDIT, "Zengin metin kitaplığı bulunamıyor. Çıkılacaktır." +STID_PSH_INDEX, "Yardım Konuları: " } + +CONTEXT_MENU MENU +BEGIN + POPUP "" + BEGIN + MENUITEM "&Hâşiye Ekleme...", MNID_CTXT_ANNOTATE + MENUITEM "&Çoğalt", MNID_CTXT_COPY + MENUITEM "&Yazdır...", MNID_CTXT_PRINT + POPUP "Y&azı Tipi" + BEGIN + MENUITEM "&Küçük", MNID_CTXT_FONTS_SMALL + MENUITEM "&Düzgülü", MNID_CTXT_FONTS_NORMAL + MENUITEM "&Büyük", MNID_CTXT_FONTS_LARGE + END + POPUP "&Sürekli Görünür" + BEGIN + MENUITEM "&Ön Tanımlı", MNID_CTXT_HELP_DEFAULT + MENUITEM "&Evet", MNID_CTXT_HELP_VISIBLE + MENUITEM "&Hayır", MNID_CTXT_HELP_NONVISIBLE + END + MENUITEM "&Dizge Renklerini Kullan", MNID_CTXT_SYSTEM_COLORS + END +END diff --git a/reactos/base/applications/winhlp32/rsrc.rc b/reactos/base/applications/winhlp32/rsrc.rc index 346b85d7447..c18863531f6 100644 --- a/reactos/base/applications/winhlp32/rsrc.rc +++ b/reactos/base/applications/winhlp32/rsrc.rc @@ -103,15 +103,15 @@ IDI_WINHELP ICON "res/winhelp.ico" #ifdef LANGUAGE_SL_SI #include "lang/Si.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/Sq.rc" +#endif #ifdef LANGUAGE_SR_SP #include "lang/Sr.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/Tr.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/Sq.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/Uk.rc" #endif diff --git a/reactos/base/applications/wordpad/lang/Tr.rc b/reactos/base/applications/wordpad/lang/Tr.rc index 82915da531c..e30d8658f53 100644 --- a/reactos/base/applications/wordpad/lang/Tr.rc +++ b/reactos/base/applications/wordpad/lang/Tr.rc @@ -1,7 +1,7 @@ /* * Turkish Resources for ReactOS Wordpad * - * Copyrights: 2006 - Fatih Aşıcı (fasici@linux-sevenler.org), 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyrights: 2006 Fatih Aşıcı (fasici@linux-sevenler.org), 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,57 +32,57 @@ BEGIN MENUITEM "Ay&rı Kaydet...", ID_FILE_SAVEAS MENUITEM SEPARATOR MENUITEM "Ya&zdır...\tCtrl+P", ID_PRINT - MENUITEM "&Baskı Önizleme...", ID_PREVIEW - MENUITEM "&Sayfa Yapısı...", ID_PRINTSETUP + MENUITEM "&Baskı Ön İzlemesi...", ID_PREVIEW + MENUITEM "&Sayfa Ayarla...", ID_PRINTSETUP MENUITEM SEPARATOR MENUITEM "&Çıkış", ID_FILE_EXIT END - POPUP "&Düzen" + POPUP "&Düzenleme" BEGIN - MENUITEM "&Geri Al\tCtrl+Z", ID_EDIT_UNDO - MENUITEM "&Yinele\tCtrl+Y", ID_EDIT_REDO + MENUITEM "&Geri Al\tCtrl+Z", ID_EDIT_UNDO + MENUITEM "&Yinele\tCtrl+Y", ID_EDIT_REDO MENUITEM SEPARATOR - MENUITEM "&Kes\tCtrl+X", ID_EDIT_CUT - MENUITEM "&Çoğalt\tCtrl+C", ID_EDIT_COPY - MENUITEM "Ya&pıştır\tCtrl+V", ID_EDIT_PASTE - MENUITEM "&Sil\tDel", ID_EDIT_CLEAR - MENUITEM "&Tümünü Seç\tCtrl+A", ID_EDIT_SELECTALL + MENUITEM "&Kes\tCtrl+X", ID_EDIT_CUT + MENUITEM "&Çoğalt\tCtrl+C", ID_EDIT_COPY + MENUITEM "Ya&pıştır\tCtrl+V", ID_EDIT_PASTE + MENUITEM "&Sil\tDel", ID_EDIT_CLEAR + MENUITEM "&Tümünü Seç\tCtrl+A", ID_EDIT_SELECTALL MENUITEM SEPARATOR - MENUITEM "&Ara...\tCtrl+F", ID_FIND - MENUITEM "S&onrakini Ara\tF3", ID_FIND_NEXT - MENUITEM "&Değiştir...\tCtrl+H", ID_REPLACE + MENUITEM "&Ara...\tCtrl+F", ID_FIND + MENUITEM "S&onrakini Ara\tF3", ID_FIND_NEXT + MENUITEM "&Değiştir...\tCtrl+H", ID_REPLACE MENUITEM SEPARATOR - MENUITEM "Sa< Okunur", ID_EDIT_READONLY - MENUITEM "D&eğiştirilmiş", ID_EDIT_MODIFIED + MENUITEM "Ya&lnızca Okunur", ID_EDIT_READONLY + MENUITEM "D&eğiştirilmiş", ID_EDIT_MODIFIED MENUITEM SEPARATOR - POPUP "D&iğer Seçenekler" + POPUP "D&iğer" BEGIN MENUITEM "&Seçim Bilgisi", ID_EDIT_SELECTIONINFO MENUITEM "&Damga Biçimi", ID_EDIT_CHARFORMAT - MENUITEM "&Öntanımlı Damga Biçimi", ID_EDIT_DEFCHARFORMAT + MENUITEM "&Ön Tanımlı Damga Biçimi", ID_EDIT_DEFCHARFORMAT MENUITEM "&Paragraf Biçimi", ID_EDIT_PARAFORMAT MENUITEM "&Metni Al", ID_EDIT_GETTEXT END END POPUP "&Görünüm" BEGIN - MENUITEM "&Araç Çubuğu", ID_TOGGLE_TOOLBAR - MENUITEM "&Biçim Çubuğu", ID_TOGGLE_FORMATBAR - MENUITEM "&Çizgilik", ID_TOGGLE_RULER - MENUITEM "&Durum Çubuğu", ID_TOGGLE_STATUSBAR + MENUITEM "&Araç Çubuğu", ID_TOGGLE_TOOLBAR + MENUITEM "&Biçim Çubuğu", ID_TOGGLE_FORMATBAR + MENUITEM "&Çizgilik", ID_TOGGLE_RULER + MENUITEM "&Durum Çubuğu", ID_TOGGLE_STATUSBAR MENUITEM SEPARATOR - MENUITEM "&Husûsiyetler...", ID_VIEWPROPERTIES + MENUITEM "&Husûsiyetler...", ID_VIEWPROPERTIES END POPUP "&Ekle" BEGIN - MENUITEM "&Târih veyâ Saat...",ID_DATETIME + MENUITEM "&Târih veyâ Saat...", ID_DATETIME END POPUP "&Biçim" BEGIN - MENUITEM "&Yazı Türü...", ID_FONTSETTINGS - MENUITEM "&Öğe İmi", ID_BULLET - MENUITEM "&Paragraf...", ID_PARAFORMAT - MENUITEM "&Sekme Durakları...", ID_TABSTOPS + MENUITEM "&Yazı Tipi...", ID_FONTSETTINGS + MENUITEM "&Öğe İmleri", ID_BULLET + MENUITEM "&Paragraf...", ID_PARAFORMAT + MENUITEM "&Sekme Durakları...", ID_TABSTOPS POPUP "&Arka Plan" BEGIN MENUITEM "&Dizge Rengi\tCtrl+1", ID_BACK_1 @@ -91,7 +91,7 @@ BEGIN END POPUP "&Yardım" BEGIN - MENUITEM "&Hakkında", ID_ABOUT + MENUITEM "&Üzerine...", ID_ABOUT END END @@ -99,12 +99,12 @@ IDM_POPUP MENU BEGIN POPUP "" BEGIN - MENUITEM "&Kes", ID_EDIT_CUT - MENUITEM "&Çoğalt", ID_EDIT_COPY - MENUITEM "&Yapıştır", ID_EDIT_PASTE + MENUITEM "&Kes", ID_EDIT_CUT + MENUITEM "&Çoğalt", ID_EDIT_COPY + MENUITEM "&Yapıştır", ID_EDIT_PASTE MENUITEM SEPARATOR - MENUITEM "&Öğe İmi", ID_BULLET - MENUITEM "&Paragraf...", ID_PARAFORMAT + MENUITEM "&Öğe İmleri", ID_BULLET + MENUITEM "&Paragraf...", ID_PARAFORMAT END END @@ -112,23 +112,23 @@ IDM_COLOR_POPUP MENU BEGIN POPUP "" BEGIN - MENUITEM "Kara", ID_COLOR_BLACK - MENUITEM "Vişne Çürüğü", ID_COLOR_MAROON - MENUITEM "Yeşil", ID_COLOR_GREEN - MENUITEM "Zeytinyağı", ID_COLOR_OLIVE - MENUITEM "Deniz Mâvisi", ID_COLOR_NAVY - MENUITEM "Mor", ID_COLOR_PURPLE - MENUITEM "Çamurcun", ID_COLOR_TEAL - MENUITEM "Kül Rengi", ID_COLOR_GRAY - MENUITEM "Gümüş", ID_COLOR_SILVER - MENUITEM "Al", ID_COLOR_RED - MENUITEM "Misket Limonu", ID_COLOR_LIME - MENUITEM "Sarı", ID_COLOR_YELLOW - MENUITEM "Mavi", ID_COLOR_BLUE - MENUITEM "Küpe Çiçeği", ID_COLOR_FUCHSIA - MENUITEM "Firûze", ID_COLOR_AQUA - MENUITEM "Ak", ID_COLOR_WHITE - MENUITEM "Dizge Rengi", ID_COLOR_AUTOMATIC + MENUITEM "Kara", ID_COLOR_BLACK + MENUITEM "Vişne Çürüğü", ID_COLOR_MAROON + MENUITEM "Yeşil", ID_COLOR_GREEN + MENUITEM "Zeytinyağı", ID_COLOR_OLIVE + MENUITEM "Deniz Mâvisi", ID_COLOR_NAVY + MENUITEM "Mor", ID_COLOR_PURPLE + MENUITEM "Çamurcun", ID_COLOR_TEAL + MENUITEM "Kül Rengi", ID_COLOR_GRAY + MENUITEM "Gümüş", ID_COLOR_SILVER + MENUITEM "Al", ID_COLOR_RED + MENUITEM "Misket Limonu", ID_COLOR_LIME + MENUITEM "Sarı", ID_COLOR_YELLOW + MENUITEM "Mâvi", ID_COLOR_BLUE + MENUITEM "Küpe Çiçeği", ID_COLOR_FUCHSIA + MENUITEM "Turkuaz", ID_COLOR_AQUA + MENUITEM "Ak", ID_COLOR_WHITE + MENUITEM "Dizge Rengi", ID_COLOR_AUTOMATIC END END @@ -164,7 +164,7 @@ BEGIN EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13 LTEXT "Sağdan", -1, 15, 40, 40, 13 EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13 - LTEXT "İlk Yataç", -1, 15, 58, 40, 13 + LTEXT "İlk Yataçtan", -1, 15, 58, 40, 13 EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13 LTEXT "Hizâlama", -1, 15, 87, 40, 13 COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST @@ -179,11 +179,11 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Sekme Durakları", -1, 10, 10, 120, 90 COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE - DEFPUSHBUTTON "Ekle", ID_TAB_ADD, 20, 80, 45, 15 - PUSHBUTTON "Sil", ID_TAB_DEL, 72, 80, 45, 15 + DEFPUSHBUTTON "&Ekle", ID_TAB_ADD, 20, 80, 45, 15 + PUSHBUTTON "&Sil", ID_TAB_DEL, 72, 80, 45, 15 PUSHBUTTON "Tamam", IDOK, 137, 15, 50, 15 PUSHBUTTON "İptal", IDCANCEL, 137, 33, 50, 15 - PUSHBUTTON "Hepsini Sil", ID_TAB_EMPTY, 137, 51, 50, 15 + PUSHBUTTON "&Tümünü Sil", ID_TAB_EMPTY, 137, 51, 50, 15 END IDD_FORMATOPTS DIALOG 0, 0, 280, 110 @@ -192,9 +192,9 @@ CAPTION "" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Yataç Kaydırma", -1, 10, 10, 130, 85 - RADIOBUTTON "&Kaydırma Yok", IDC_PAGEFMT_WN, 18, 25, 117, 15 - RADIOBUTTON "&Pencere Kıyılığına Kadar", IDC_PAGEFMT_WW, 18, 45, 117, 15 - RADIOBUTTON "Ç&izgiliğe Kadar", IDC_PAGEFMT_WM, 18, 65, 117, 15 + RADIOBUTTON "&Yataç Kaydırma Yok", IDC_PAGEFMT_WN, 18, 25, 117, 15 + RADIOBUTTON "&Metni Pencere Kıyılığıyla Kaydır", IDC_PAGEFMT_WW, 18, 45, 117, 15 + RADIOBUTTON "M&etni Çizgilikle Kaydır", IDC_PAGEFMT_WM, 18, 65, 117, 15 GROUPBOX "Çubuklar", -1, 150, 10, 120, 85 CHECKBOX "&Araç Çubuğu", IDC_PAGEFMT_TB, 160, 20, 80, 15 CHECKBOX "&Biçim Çubuğu", IDC_PAGEFMT_FB, 160, 38, 80, 15 @@ -208,8 +208,8 @@ BEGIN STRING_ALL_FILES, "Tüm Kütükler (*.*)" STRING_TEXT_FILES_TXT, "Metin Belgeleri (*.txt)" STRING_TEXT_FILES_UNICODE_TXT, "Evrenlik Kodlu Metin Belgeleri (*.txt)" - STRING_RICHTEXT_FILES_RTF, "Gelişmiş Metin Belgeleri (*.rtf)" - STRING_NEWFILE_RICHTEXT, "Gelişmiş Metin Belgesi" + STRING_RICHTEXT_FILES_RTF, "Zengin Metin Belgeleri (*.rtf)" + STRING_NEWFILE_RICHTEXT, "Zengin Metin Belgesi" STRING_NEWFILE_TXT, "Metin Belgesi" STRING_NEWFILE_TXT_UNICODE, "Evrenlik Kodlu Metin Belgesi" STRING_PRINTER_FILES_PRN, "Yazıcı Kütükleri (*.PRN)" @@ -226,14 +226,14 @@ STRINGTABLE BEGIN STRING_VIEWPROPS_TITLE, "Husûsiyetler" STRING_VIEWPROPS_TEXT, "Metin" - STRING_VIEWPROPS_RICHTEXT, "Gelişmiş Metin" + STRING_VIEWPROPS_RICHTEXT, "Zengin Metin" END STRINGTABLE BEGIN STRING_PREVIEW_PRINT, "Yazdır" - STRING_PREVIEW_NEXTPAGE, "Sonraki" - STRING_PREVIEW_PREVPAGE, "Önceki" + STRING_PREVIEW_NEXTPAGE, "Sonraki Sayfa" + STRING_PREVIEW_PREVPAGE, "Önceki Sayfa" STRING_PREVIEW_TWOPAGES, "İkili" STRING_PREVIEW_ONEPAGE, "Tekli" STRING_PREVIEW_ZOOMIN, "Yakınlaştır" @@ -249,17 +249,17 @@ END STRINGTABLE BEGIN - STRING_DEFAULT_FILENAME, "Adsız" + STRING_DEFAULT_FILENAME, "Belge" STRING_PROMPT_SAVE_CHANGES, "%s için değişiklikler kaydedilsin mi?" STRING_SEARCH_FINISHED, "Belge araması bitti." - STRING_LOAD_RICHED_FAILED, "Gelişmiş metin kitaplığının yüklenmesi başarısız oldu." - STRING_SAVE_LOSEFORMATTING, "Eğer düz metin belgesi olarak kaydedilirse yapılan hemen hemen tüm biçimlendirmeler yitirilecek. Sürdürmek istiyor musunuz?" + STRING_LOAD_RICHED_FAILED, "Zengin metin kitaplığının yüklenmesi başarısız oldu." + STRING_SAVE_LOSEFORMATTING, "Tüm biçimlendirmelerin yitirilmesine neden olacağı düz metin biçimiyle kaydetmeyi seçtiniz. Bunu yapmak istediğinizi doğruluyor musunuz?" STRING_INVALID_NUMBER, "Geçersiz sayı biçimi." STRING_OLE_STORAGE_NOT_SUPPORTED, "OLE içeren belgeler desteklenmiyor." - STRING_WRITE_FAILED, "Belgenin kaydedilmesi başarısız oldu." - STRING_WRITE_ACCESS_DENIED, "Bu belgeyi kaydetme yetkiniz yok." - STRING_OPEN_FAILED, "Belgenin açılması başarısız oldu." - STRING_OPEN_ACCESS_DENIED, "Bu belgeyi açma yetkiniz yok." + STRING_WRITE_FAILED, "Kütük kaydedilemedi." + STRING_WRITE_ACCESS_DENIED, "Bu kütüğü kaydetme yetkiniz yok." + STRING_OPEN_FAILED, "Kütük açılamadı." + STRING_OPEN_ACCESS_DENIED, "Bu kütüğü açma yetkiniz yok." STRING_PRINTING_NOT_IMPLEMENTED, "Yazdırma seçeneği daha bitirilmemiştir." - STRING_MAX_TAB_STOPS, "En çok 32 adet sekme durağı ekleyebilirsiniz." + STRING_MAX_TAB_STOPS, "32 sekme durağından çoğunu ekleyemezsiniz." END diff --git a/reactos/base/applications/wordpad/rsrc.rc b/reactos/base/applications/wordpad/rsrc.rc index eb885edbd27..3f5d3e6481e 100644 --- a/reactos/base/applications/wordpad/rsrc.rc +++ b/reactos/base/applications/wordpad/rsrc.rc @@ -119,15 +119,15 @@ IDC_ZOOM CURSOR "res/zoom.cur" #ifdef LANGUAGE_SL_SI #include "lang/Si.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/Sq.rc" +#endif #ifdef LANGUAGE_SV_SE #include "lang/Sv.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/Tr.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/Sq.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/Uk.rc" #endif diff --git a/reactos/base/applications/write/lang/Tr.rc b/reactos/base/applications/write/lang/Tr.rc index 5ec5bda8586..44f6220d9cd 100644 --- a/reactos/base/applications/write/lang/Tr.rc +++ b/reactos/base/applications/write/lang/Tr.rc @@ -1,7 +1,7 @@ /* * Turkish Resources for ReactOS Write * - * Copyright: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyright: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,5 +24,5 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT STRINGTABLE { - IDS_FAILED, "Kelime İşlemci'nin açılması başarısız oldu." + IDS_FAILED, "WordPad'in açılması başarısız oldu." } diff --git a/reactos/base/applications/write/rsrc.rc b/reactos/base/applications/write/rsrc.rc index ed149bb38c2..359718d2115 100644 --- a/reactos/base/applications/write/rsrc.rc +++ b/reactos/base/applications/write/rsrc.rc @@ -83,15 +83,15 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #ifdef LANGUAGE_SL_SI #include "lang/Si.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/Sq.rc" +#endif #ifdef LANGUAGE_SR_SP #include "lang/Sr.rc" #endif #ifdef LANGUAGE_TR_TR #include "lang/Tr.rc" #endif -#ifdef LANGUAGE_SQ_AL - #include "lang/Sq.rc" -#endif #ifdef LANGUAGE_UK_UA #include "lang/Uk.rc" #endif diff --git a/reactos/base/setup/reactos/lang/tr-TR.rc b/reactos/base/setup/reactos/lang/tr-TR.rc index fdb64c9a98d..b7860ff9ced 100644 --- a/reactos/base/setup/reactos/lang/tr-TR.rc +++ b/reactos/base/setup/reactos/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATORS: 2012 - Arda Tanrıkulu (ardatan) (ardatanrikulu@gmail.com), 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATORS: 2012 Arda Tanrıkulu (ardatan) (ardatanrikulu@gmail.com), 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -144,6 +144,6 @@ BEGIN IDS_RESTARTSUBTITLE "Kurulumun ilk aşaması bitti. İkincisine geçmek için bilgisayarı yeniden başlatınız." IDS_SUMMARYTITLE "Kurulum Özeti" IDS_SUMMARYSUBTITLE "Kurulumdan önce, dizelgelenen kurulum seçeneklerini gözden geçiriniz." - IDS_ABORTSETUP "ReactOS kurulumu bitmedi. Eğer Kur'dan çıkarsanız, ReactOS'u kurmak için Kur'u yeniden çalıştırabilirsiniz. Çıkmayı onaylıyor musunuz?" + IDS_ABORTSETUP "ReactOS kurulumu bitmedi. Eğer Kur'dan çıkarsanız, ReactOS'u kurmak için Kur'u yeniden çalıştırabilirsiniz. Çıkmayı doğruluyor musunuz?" IDS_ABORTSETUP2 "Kurulum iptal edilsin mi?" END diff --git a/reactos/base/setup/vmwinst/lang/tr-TR.rc b/reactos/base/setup/vmwinst/lang/tr-TR.rc index 605112f96ae..9a1528d50a3 100644 --- a/reactos/base/setup/vmwinst/lang/tr-TR.rc +++ b/reactos/base/setup/vmwinst/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -91,8 +91,8 @@ END STRINGTABLE BEGIN IDS_WIZARD_NAME "VMware(r) algılandı." - IDS_FAILEDTOLOCATEDRIVERS "ReactOS Kur, gerekli kütükleri bulamadı.\nVMWare(r) Araç CD'sini bağladığınızı onaylayın." - IDS_FAILEDTOCOPYFILES "ReactOS Kur, gerekli kütükleri çoğaltamadı.\nVMWare(r) Araç CD'sini bağladığınızı onaylayın.\n" + IDS_FAILEDTOLOCATEDRIVERS "ReactOS Kur, gerekli kütükleri bulamadı.\nVMWare(r) Araç CD'sini bağladığınızı doğrulayınız." + IDS_FAILEDTOCOPYFILES "ReactOS Kur, gerekli kütükleri çoğaltamadı.\nVMWare(r) Araç CD'sini bağladığınızı doğrulayınız.\n" IDS_FAILEDTOACTIVATEDRIVER "VMware(r) SVGA sürücüsünün etkinleştirilmesi başarısız oldu." IDS_FAILEDTOSELVGADRIVER "ReactOS VGA sürücüsünün etkinleştirilmesi başarısız oldu." IDS_FAILEDTOSELVBEDRIVER "ReactOS VBE sürücüsünün etkinleştirilmesi başarısız oldu." diff --git a/reactos/base/setup/welcome/lang/tr-TR.rc b/reactos/base/setup/welcome/lang/tr-TR.rc index 72dd2612a9f..d91b20872ea 100644 --- a/reactos/base/setup/welcome/lang/tr-TR.rc +++ b/reactos/base/setup/welcome/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT diff --git a/reactos/base/shell/explorer-new/lang/tr-TR.rc b/reactos/base/shell/explorer-new/lang/tr-TR.rc index b3baccd2173..5258caec0b5 100644 --- a/reactos/base/shell/explorer-new/lang/tr-TR.rc +++ b/reactos/base/shell/explorer-new/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -74,7 +74,7 @@ BEGIN AUTOCHECKBOX "&Görev Çubuğunu Kilitle", IDC_TASKBARPROP_LOCK, 13, 45, 200, 10 AUTOCHECKBOX "G&örev Çubuğunu Kendiliğinden Gizle", IDC_TASKBARPROP_HIDE, 13, 58, 200, 10 AUTOCHECKBOX "Gö&rev Çubuğunu Pencerelerin Üstünde Tut", IDC_TASKBARPROP_ONTOP, 13, 71, 200, 10 - AUTOCHECKBOX "&Benzer Görev Çubuğu Düğmelerini Kümeleştir", IDC_TASKBARPROP_GROUP, 13, 84, 200, 10 + AUTOCHECKBOX "&Benzer Görev Çubuğu Düğmelerini Öbekleştir", IDC_TASKBARPROP_GROUP, 13, 84, 200, 10 AUTOCHECKBOX "&Hızlı Başlat'ı Göster", IDC_TASKBARPROP_SHOWQL, 13, 97, 200, 10 END @@ -105,7 +105,7 @@ BEGIN AUTOCHECKBOX "E&dilgin Simgeleri Gizle", IDC_TASKBARPROP_HIDEICONS, 13, 70, 125, 10, WS_DISABLED PUSHBUTTON "&Husûsileştir...", IDC_TASKBARPROP_ICONCUST, 188, 70, 50, 14, WS_DISABLED GROUPBOX "Dizge Simgeleri", IDC_STATIC, 6, 97, 240, 84, WS_DISABLED - LTEXT "Her zaman görüntülenecek dizge simgelerini seçiniz:", IDC_STATIC, 13, 112, 223, 16, WS_DISABLED + LTEXT "Sürekli görüntülenecek dizge simgelerini seçiniz:", IDC_STATIC, 13, 112, 223, 16, WS_DISABLED AUTOCHECKBOX "&Saat", IDC_TASKBARPROP_CLOCK, 13, 126, 200, 10, WS_DISABLED AUTOCHECKBOX "S&es Ayârı", IDC_TASKBARPROP_VOLUME, 13, 139, 200, 10, WS_DISABLED AUTOCHECKBOX "&Ağ", IDC_TASKBARPROP_NETWORK, 13, 152, 200, 10, WS_DISABLED @@ -128,7 +128,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN GROUPBOX "Gelişmiş Seçenekler", IDC_STATIC, 6, 6, 240, 121 AUTOCHECKBOX "&Sâniyeleri Göster", IDC_TASKBARPROP_SECONDS, 13, 18, 200, 10 - AUTOCHECKBOX "&Pencere Önizlemelerini Göster", IDC_TASKBARPROP_WNDPREV, 13, 31, 200, 10 + AUTOCHECKBOX "&Pencere Ön İzlemelerini Göster", IDC_TASKBARPROP_WNDPREV, 13, 31, 200, 10 END STRINGTABLE diff --git a/reactos/base/system/rundll32/lang/tr-TR.rc b/reactos/base/system/rundll32/lang/tr-TR.rc index ce4a9c91897..65b747ef844 100644 --- a/reactos/base/system/rundll32/lang/tr-TR.rc +++ b/reactos/base/system/rundll32/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT STRINGTABLE diff --git a/reactos/base/system/runonce/lang/tr-TR.rc b/reactos/base/system/runonce/lang/tr-TR.rc index 0dfac056869..1e629c8c447 100644 --- a/reactos/base/system/runonce/lang/tr-TR.rc +++ b/reactos/base/system/runonce/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT diff --git a/reactos/base/system/userinit/lang/tr-TR.rc b/reactos/base/system/userinit/lang/tr-TR.rc index 0def3c0e117..c7d2d068ff4 100644 --- a/reactos/base/system/userinit/lang/tr-TR.rc +++ b/reactos/base/system/userinit/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT diff --git a/reactos/base/system/winlogon/lang/tr-TR.rc b/reactos/base/system/winlogon/lang/tr-TR.rc index 41e038bb358..8ea502ef894 100644 --- a/reactos/base/system/winlogon/lang/tr-TR.rc +++ b/reactos/base/system/winlogon/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT diff --git a/reactos/boot/freeldr/fdebug/lang/tr-TR.rc b/reactos/boot/freeldr/fdebug/lang/tr-TR.rc index 7153091a68a..8531e5e28c0 100644 --- a/reactos/boot/freeldr/fdebug/lang/tr-TR.rc +++ b/reactos/boot/freeldr/fdebug/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATORS: 2005 - un.real, 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATORS: 2005 un.real, 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -21,7 +21,7 @@ BEGIN END POPUP "&Yardım" BEGIN - MENUITEM "&Hakkında...", IDM_ABOUT + MENUITEM "&Üzerine...", IDM_ABOUT END END @@ -36,7 +36,7 @@ END IDD_ABOUTBOX DIALOGEX 22, 17, 259, 210 STYLE DS_SHELLFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU -CAPTION "FreeLoader Yanlışlık Ayıklayıcı Hakkında" +CAPTION "FreeLoader Yanlışlık Ayıklayıcı Üzerine" FONT 8, "MS Shell Dlg" BEGIN CONTROL "FreeLoader Yanlışlık Ayıklayıcı - Sürüm 1.0\nTelif Hakkı: 2003 - Brian Palmer\n(brianp@reactos.org)", IDC_STATIC, "Static", SS_LEFTNOWORDWRAP | WS_GROUP, 53, 28, 122, 26 @@ -81,5 +81,5 @@ END STRINGTABLE BEGIN - IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu yazılım özgür yazılımdır; bu yazılımı, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu yazılım, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu yazılımın HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen garantisi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu yazılımla birlikte GNU Umûmî Kamu Ruhsatı'nın bir sûretini almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." + IDS_LICENSE "ÖNEMLİ: Aşağıdaki metin, özgün metnin resmî olmayan çevirisidir. Çeviri metniyle özgün metin arasında ayrım olabilir. Özgün metin, çeviri metninin altındadır.\r\n\r\n***\r\n\r\nBu izlence özgür yazılımdır; bunu, Özgür Yazılım Vakfı'nın yayımladığı GNU Umûmî Kamu Ruhsatı'nın, 2. sürümünün ya da daha sonraki herhangi bir sürümünün (Orası size bağlı.) koşulları altında yeniden dağıtabilir veyâ değiştirebilirsiniz.\r\n\r\nBu izlence, kullanışlı olabileceği beklentisiyle dağıtılmıştır ancak bu izlencenin HİÇBİR GÜVENCESİ YOKTUR, SATILABİLİRLİĞİN ve BELİRLİ BİR AMACA UYGUNLUĞUN demek istenilen güvencesi bile. Daha çok bilgi için GNU Umûmî Kamu Ruhsatı'na bakınız.\r\n\r\nBu izlenceyle birlikte GNU Umûmî Kamu Ruhsatı'nın bir kopyasını almış olmalısınız, eğer yoksa Özgür Yazılım Vakfı AŞ'ye (51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 ABD) yazınız.\r\n\r\n***\r\n\r\nThis 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.\r\n\r\nThis 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.\r\n\r\nYou should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA." END diff --git a/reactos/dll/cpl/access/lang/tr-TR.rc b/reactos/dll/cpl/access/lang/tr-TR.rc index 0ce1f511efc..fc62f56e062 100644 --- a/reactos/dll/cpl/access/lang/tr-TR.rc +++ b/reactos/dll/cpl/access/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -18,11 +18,11 @@ BEGIN AUTOCHECKBOX "&Süzgeç Düğmeleri'ni Kullan", IDC_FILTER_BOX, PROPSHEETPADDING(2), LABELLINE(13) + 2, PROPSHEETWIDTH - PROPSHEETPADDING(20), 14 PUSHBUTTON "Aya&rlar", IDC_FILTER_BUTTON, PROPSHEETWIDTH - PROPSHEETPADDING(17), LABELLINE(13) + 2, PROPSHEETPADDING(15), 14 GROUPBOX "Geçiş Düğmeleri", -1, PROPSHEETPADDING(1), LABELLINE(16) + 3, PROPSHEETWIDTH - PROPSHEETPADDING(2), LABELLINE(6) + PROPSHEETPADDING(1) - LTEXT "Büyük Hârf Kilidi'ni, Sayılık Kilit'i ve Kaydırma Kilidi'ni basarken ses çıkması için Geçiş Düğmeleri'ni kullanınız.", + LTEXT "Büyük Harf Kilidi'ni, Sayılık Kilit'i ve Kaydırma Kilidi'ni basarken ses çıkması için Geçiş Düğmeleri'ni kullanınız.", -1, PROPSHEETPADDING(2), LABELLINE(18) - 3, PROPSHEETWIDTH - PROPSHEETPADDING(4), LABELLINE(2) AUTOCHECKBOX "&Geçiş Düğmeleri'ni Kullan", IDC_TOGGLE_BOX, PROPSHEETPADDING(2), LABELLINE(20) + 2, PROPSHEETWIDTH - PROPSHEETPADDING(20), 14 PUSHBUTTON "Ayar&lar", IDC_TOGGLE_BUTTON, PROPSHEETWIDTH - PROPSHEETPADDING(17), LABELLINE(20) + 2, PROPSHEETPADDING(15), 14 - AUTOCHECKBOX "&Çizeylemlerde Ek Düğme Takımı Yardımı Göster", IDC_KEYBOARD_EXTRA, + AUTOCHECKBOX "&İzlencelerde Ek Düğme Takımı Yardımı Göster", IDC_KEYBOARD_EXTRA, PROPSHEETPADDING(1), LABELLINE(23) + 3, PROPSHEETWIDTH - PROPSHEETPADDING(2), 14 END @@ -39,7 +39,7 @@ BEGIN COMBOBOX IDC_SENTRY_COMBO, PROPSHEETPADDING(2), LABELLINE(9), PROPSHEETWIDTH - PROPSHEETPADDING(4), LABELLINE(6), CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE | WS_TABSTOP GROUPBOX "ShowSounds", -1, PROPSHEETPADDING(1), LABELLINE(12) + 5, PROPSHEETWIDTH - PROPSHEETPADDING(2), LABELLINE(7) + 2 - LTEXT "Çizeylemlerin ürettiği seslerle konuşma altyazılarını göstermek için ShowSounds kullanınız.", + LTEXT "İzlencelerin ürettiği seslerle konuşma altyazılarını göstermek için ShowSounds kullanınız.", -1, PROPSHEETPADDING(2), LABELLINE(14) - 3, PROPSHEETWIDTH - PROPSHEETPADDING(4), LABELLINE(3) AUTOCHECKBOX "S&howSounds Kullan", IDC_SSHOW_BOX, PROPSHEETPADDING(2), LABELLINE(16) + 2, PROPSHEETWIDTH - PROPSHEETPADDING(4), 14 END @@ -50,7 +50,7 @@ CAPTION "Görünüm" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN GROUPBOX "Yüksek Karşıtlık", -1, PROPSHEETPADDING(1), LABELLINE(1), PROPSHEETWIDTH - PROPSHEETPADDING(2), LABELLINE(6) + PROPSHEETPADDING(1) - LTEXT "Kolay okunum için tasarlanmış renklerle yazı türleri için bu seçeneği kullanınız.", + LTEXT "Kolay okuma için tasarlanmış renklerle yazı tipleri için bu seçeneği kullanınız.", -1, PROPSHEETPADDING(2), LABELLINE(2), PROPSHEETWIDTH - PROPSHEETPADDING(4), LABELLINE(3) AUTOCHECKBOX "&Yüksek Karşıtlık Kullan", IDC_CONTRAST_BOX, PROPSHEETPADDING(2), LABELLINE(5) + 2, PROPSHEETWIDTH - PROPSHEETPADDING(20), 14 PUSHBUTTON "&Ayarlar", IDC_CONTRAST_BUTTON, PROPSHEETWIDTH - PROPSHEETPADDING(17), LABELLINE(5) + 2, PROPSHEETPADDING(15), 14 @@ -88,7 +88,7 @@ CAPTION "Umûmî" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN GROUPBOX "Kendiliğinden Yeniden Ayarla", -1, PROPSHEETPADDING(1), LABELLINE(1), PROPSHEETWIDTH - PROPSHEETPADDING(2), LABELLINE(5) - AUTOCHECKBOX "&Şu Kadar Boşta Kalındığında Tüm Erişilebilirlik Husûsiyetlerini Kapat:", + AUTOCHECKBOX "&Şu Denli Boşta Kalındığında Tüm Erişilebilirlik Husûsiyetlerini Kapat:", IDC_RESET_BOX, PROPSHEETPADDING(2), LABELLINE(2) - 2, PROPSHEETWIDTH - PROPSHEETPADDING(4), 14 COMBOBOX IDC_RESET_COMBO, PROPSHEETPADDING(4), LABELLINE(4), PROPSHEETPADDING(10), LABELLINE(5), CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE | WS_TABSTOP @@ -105,7 +105,7 @@ BEGIN GROUPBOX "Yönetim Ayarları", -1, PROPSHEETPADDING(1), LABELLINE(19) - 4, PROPSHEETWIDTH - PROPSHEETPADDING(2), LABELLINE(5) AUTOCHECKBOX "&Tüm Ayarları Oturum Açma Masaüstüne Uygula", IDC_ADMIN_LOGON_BOX, PROPSHEETPADDING(2), LABELLINE(20) - 4, PROPSHEETWIDTH - PROPSHEETPADDING(4), 14 - AUTOCHECKBOX "T&üm Ayarları Yeni Oluşturulacak Kullanıcıların Öntanımlılarına Uygula", IDC_ADMIN_USERS_BOX, + AUTOCHECKBOX "T&üm Ayarları Yeni Oluşturulacak Kullanıcıların Ön Tanımlılarına Uygula", IDC_ADMIN_USERS_BOX, PROPSHEETPADDING(2), LABELLINE(22) - 4, PROPSHEETWIDTH - PROPSHEETPADDING(4), 14 END @@ -151,7 +151,7 @@ BEGIN LTEXT "Ayar&ları sınamak için buraya tıklayıp birşeyler yazınız:", -1, PROPSHEETPADDING(2), LABELLINE(14) + 1, PROPSHEETWIDTH - PROPSHEETPADDING(4), LABELLINE(1) EDITTEXT IDC_FILTER_TEST_EDIT, PROPSHEETPADDING(2), LABELLINE(15) + 1, PROPSHEETWIDTH - PROPSHEETPADDING(4), 14, WS_GROUP | ES_AUTOHSCROLL GROUPBOX "Bildirimler", -1, PROPSHEETPADDING(1), LABELLINE(17) + 6, PROPSHEETWIDTH - PROPSHEETPADDING(2), LABELLINE(4) + 3 - AUTOCHECKBOX "&Düğmelere Basıldığında veyâ Onaylandığında Ses Çıkar", IDC_FILTER_SOUND_CHECK, + AUTOCHECKBOX "&Düğmelere Basıldığında veyâ Doğrulandığında Ses Çıkar", IDC_FILTER_SOUND_CHECK, PROPSHEETPADDING(2), LABELLINE(19), PROPSHEETWIDTH - PROPSHEETPADDING(4), 10 AUTOCHECKBOX "&Görüntülükte Süzgeç Düğmeleri'nin Durumunu Göster", IDC_FILTER_STATUS_CHECK, PROPSHEETPADDING(2), LABELLINE(20) + 6, PROPSHEETWIDTH - PROPSHEETPADDING(4), 10 @@ -253,7 +253,7 @@ BEGIN COMBOBOX IDC_REPEAT_REPEAT_COMBO, PROPSHEETPADDING(4), LABELLINE(10) + 8, PROPSHEETWIDTH - PROPSHEETPADDING(6), LABELLINE(7), CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE | WS_TABSTOP GROUPBOX "Yavaşlatma Düğmeleri", -1, PROPSHEETPADDING(1), LABELLINE(14), PROPSHEETWIDTH - PROPSHEETPADDING(2), LABELLINE(4) + 4 - LTEXT "Dü&ğmeler Şu Kadar Basılı Tutulmalıdır:", -1, PROPSHEETPADDING(2), LABELLINE(15), PROPSHEETWIDTH - PROPSHEETPADDING(4), LABELLINE(1) + LTEXT "Dü&ğmeler Şu Denli Basılı Tutulmalıdır:", -1, PROPSHEETPADDING(2), LABELLINE(15), PROPSHEETWIDTH - PROPSHEETPADDING(4), LABELLINE(1) COMBOBOX IDC_REPEAT_WAIT_COMBO, PROPSHEETPADDING(2), LABELLINE(16) + 4, PROPSHEETWIDTH - PROPSHEETPADDING(4), LABELLINE(8), CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE | WS_TABSTOP LTEXT "&Sınama Yeri:", -1, PROPSHEETPADDING(1), LABELLINE(20), PROPSHEETPADDING(8), LABELLINE(1) diff --git a/reactos/dll/cpl/appwiz/lang/tr-TR.rc b/reactos/dll/cpl/appwiz/lang/tr-TR.rc index 2878dbd431b..6f0f7a45899 100644 --- a/reactos/dll/cpl/appwiz/lang/tr-TR.rc +++ b/reactos/dll/cpl/appwiz/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -26,7 +26,7 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Kısayol Oluştur" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - LTEXT "Bu yardımcı, ağdaki ya da yakındaki çizeylemlere, kütüklere,\ndizinlere, bilgisayarlara ve örütbağ adreslerine\nkısayol oluşturmanıza yardımcı olur.", -1, 120, 15, 200, 30 + LTEXT "Bu yardımcı, ağdaki ya da yakındaki izlencelere, kütüklere,\ndizinlere, bilgisayarlara ve Umûmî Ağ adreslerine\nkısayol oluşturmanıza yardımcı olur.", -1, 120, 15, 200, 30 LTEXT "Nesnenin konumunu yazınız:", -1, 120, 50, 120, 10 EDITTEXT IDC_SHORTCUT_LOCATION, 120, 65, 150, 15, ES_LEFT PUSHBUTTON "&Göz At...", IDC_SHORTCUT_BROWSE, 272, 65, 55, 15, ES_LEFT diff --git a/reactos/dll/cpl/console/lang/tr-TR.rc b/reactos/dll/cpl/console/lang/tr-TR.rc index e38dc41f53c..b4675588107 100644 --- a/reactos/dll/cpl/console/lang/tr-TR.rc +++ b/reactos/dll/cpl/console/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -23,7 +23,7 @@ BEGIN EDITTEXT IDC_EDIT_NUM_BUFFER, 90, 120, 30, 15, ES_RIGHT | ES_NUMBER | WS_GROUP CONTROL "", IDC_UPDOWN_NUM_BUFFER, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_GROUP, 119, 120, 12, 15 - CHECKBOX "&Eski Sûretleri At", IDC_CHECK_DISCARD_DUPLICATES, 12, 140, 110, 15 + CHECKBOX "&Eski Kopyaları At", IDC_CHECK_DISCARD_DUPLICATES, 12, 140, 110, 15 GROUPBOX "Düzenleme Seçenekleri", -1, 133, 85, 112, 77, BS_GROUPBOX | WS_CHILD | WS_VISIBLE | WS_GROUP CHECKBOX "&Hızlı Düzenleme Kipi", IDC_CHECK_QUICK_EDIT, 140, 97, 102, 15, WS_CHILD | WS_VISIBLE | WS_TABSTOP CHECKBOX "Ek&leme Kipi", IDC_CHECK_INSERT_MODE, 140, 113, 76, 15, WS_CHILD | WS_VISIBLE | WS_TABSTOP @@ -31,15 +31,15 @@ END IDD_PROPPAGEFONT DIALOGEX 0, 0, 253, 220 STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION -CAPTION "Yazı Türü" +CAPTION "Yazı Tipi" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Pencere Önizlemesi:", -1, 10, 10, 94, 10 + LTEXT "Pencere Ön İzlemesi:", -1, 10, 10, 94, 10 LTEXT "Boyutlar:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL - LTEXT "&Yazı Türü:", -1, 10, 105, 33, 10 - CHECKBOX "&Kalın Yazı Türleri", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 + LTEXT "&Yazı Tipi:", -1, 10, 105, 33, 10 + CHECKBOX "&Kalın Yazı Tipleri", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 @@ -54,7 +54,7 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_CAPTION CAPTION "Yerleşim" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Pencere Önizlemesi:", -1, 8, 6, 95, 10 + LTEXT "Pencere Ön İzlemesi:", -1, 8, 6, 95, 10 CONTROL "", IDC_STATIC_LAYOUT_WINDOW_PREVIEW, "Static", SS_SUNKEN | SS_OWNERDRAW, 8, 16, 115, 70 GROUPBOX "Görüntülük Arabelleği Boyutları", -1, 130, 12, 115, 50 LTEXT "&Genişlik:", -1, 140, 28, 40, 10 @@ -128,9 +128,9 @@ BEGIN CONTROL "", IDC_STATIC_COLOR14, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 192, 80, 12, 12 CONTROL "", IDC_STATIC_COLOR15, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 205, 80, 12, 12 CONTROL "", IDC_STATIC_COLOR16, "Static", SS_NOTIFY | SS_SUNKEN | SS_OWNERDRAW, 218, 80, 12, 12 - GROUPBOX "Görüntülük Önizlemesi", -1, 8, 100, 237, 55 + GROUPBOX "Görüntülük Ön İzlemesi", -1, 8, 100, 237, 55 CONTROL "", IDC_STATIC_SCREEN_COLOR, "Static", SS_OWNERDRAW | SS_SUNKEN, 13, 110, 227, 40 - GROUPBOX "Açılan Önizlemesi", -1, 8, 160, 237, 55 + GROUPBOX "Açılan Ön İzlemesi", -1, 8, 160, 237, 55 CONTROL "", IDC_STATIC_POPUP_COLOR, "Static", SS_OWNERDRAW | SS_SUNKEN, 13, 170, 227, 40 END @@ -152,5 +152,5 @@ BEGIN IDS_CPLNAME "Konsol" IDS_CPLDESCRIPTION "Konsol husûsiyetlerini yapılandırır." IDS_APPLY_SHORTCUT_ALL "&Bu Pencereyi Başlatan Kısayolu Değiştir" - IDS_RASTERFONTS "Taramalı Yazı Türleri" + IDS_RASTERFONTS "Taramalı Yazı Tipleri" END diff --git a/reactos/dll/cpl/desk/lang/tr-TR.rc b/reactos/dll/cpl/desk/lang/tr-TR.rc index d235f51c71f..1a810be39ca 100644 --- a/reactos/dll/cpl/desk/lang/tr-TR.rc +++ b/reactos/dll/cpl/desk/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -26,7 +26,7 @@ BEGIN GROUPBOX "&Görüntülük Koruyucu", IDC_SCREENS_DUMMY, 8, 92, 230, 52 COMBOBOX IDC_SCREENS_LIST, 14, 103, 100, 100, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Ayarlar", IDC_SCREENS_SETTINGS, 120, 103, 50, 13, WS_GROUP - PUSHBUTTON "&Önizleme", IDC_SCREENS_TESTSC, 175, 103, 50, 13 + PUSHBUTTON "&Ön İzleme", IDC_SCREENS_TESTSC, 175, 103, 50, 13 LTEXT "&Bekleme:", IDC_WAITTEXT, 14, 125, 20, 9 EDITTEXT IDC_SCREENS_TIMEDELAY, 36, 123, 32, 13, ES_RIGHT | WS_GROUP CONTROL "", IDC_SCREENS_TIME, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | @@ -76,10 +76,10 @@ BEGIN CHECKBOX "-", IDC_ADVAPPEARANCE_COLOR1_B, 184, 170, 28, 13, BS_PUSHLIKE | BS_BITMAP LTEXT "2. Renk", IDC_ADVAPPEARANCE_COLOR2_T, 216, 160, 40, 9 CHECKBOX "-", IDC_ADVAPPEARANCE_COLOR2_B, 216, 170, 28, 13, BS_PUSHLIKE | BS_BITMAP - LTEXT "Yazı Türü", IDC_ADVAPPEARANCE_FONT_T, 5, 190, 50, 9 + LTEXT "Yazı Tipi", IDC_ADVAPPEARANCE_FONT_T, 5, 190, 50, 9 COMBOBOX IDC_ADVAPPEARANCE_FONT_C, 5, 200, 130, 90, CBS_DROPDOWN | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP - LTEXT "Yazı Türü Boyutu", IDC_ADVAPPEARANCE_FONTSIZE_T, 142, 190, 39, 9 + LTEXT "Yazı Tipi Boyutu", IDC_ADVAPPEARANCE_FONTSIZE_T, 142, 190, 39, 9 COMBOBOX IDC_ADVAPPEARANCE_FONTSIZE_E, 142, 200, 38, 200, CBS_DROPDOWN | WS_VSCROLL LTEXT "Renk", IDC_ADVAPPEARANCE_FONTCOLOR_T, 184, 190, 28, 9 CHECKBOX "", IDC_ADVAPPEARANCE_FONTCOLOR_B, 184, 200, 28, 13, BS_PUSHLIKE | BS_BITMAP @@ -99,7 +99,7 @@ BEGIN IDC_EFFAPPEARANCE_ANIMATION, "button", BS_AUTOCHECKBOX | WS_TABSTOP, 10, 5, 267, 19 COMBOBOX IDC_EFFAPPEARANCE_ANIMATIONTYPE, 20, 25, 80, 19, CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_CHILD | WS_VSCROLL | WS_TABSTOP - CONTROL "&Görüntülük Yazı Türlerinin Kenarlarını Düzgünleştirmeyi Etkinleştir", IDC_EFFAPPEARANCE_SMOOTHING, + CONTROL "&Görüntülük Yazı Tiplerinin Kıyılarını Düzgünleştirmeyi Etkinleştir", IDC_EFFAPPEARANCE_SMOOTHING, "button", BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED, 10, 42, 267, 19 COMBOBOX IDC_EFFAPPEARANCE_SMOOTHINGTYPE, 20, 62, 80, 19, CBS_DROPDOWNLIST | CBS_HASSTRINGS | CBS_SORT | WS_VSCROLL | WS_TABSTOP | WS_DISABLED @@ -109,7 +109,7 @@ BEGIN "button", BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED, 10, 95, 267, 19 CONTROL "S&ürüklerken Pencere İçeriğini Göster", IDC_EFFAPPEARANCE_DRAGFULLWINDOWS, "button", BS_AUTOCHECKBOX | WS_TABSTOP, 10, 110, 267, 19 - CONTROL "S&eçenek Düğmesine Basana Kadar Düğme Takımı ile Yönlendirme Çizgilerini Gizle", + CONTROL "S&eçenek Düğmesine Basana Dek Düğme Takımı ile Yönlendirme Çizgilerini Gizle", IDC_EFFAPPEARANCE_KEYBOARDCUES, "button", BS_AUTOCHECKBOX | WS_TABSTOP, 10, 125, 267, 19 PUSHBUTTON "İptal", IDCANCEL, 226, 165, 50, 14 DEFPUSHBUTTON "Tamam", IDOK, 172, 165, 50, 14 @@ -142,11 +142,11 @@ CAPTION "Umûmî" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Görüntü", -1, 7, 6, 237, 56, WS_GROUP - LTEXT "Yazı Türü Boyutu", -1, 14, 20, 222, 9 + LTEXT "Yazı Tipi Boyutu", -1, 14, 20, 222, 9 COMBOBOX IDC_FONTSIZE_COMBO, 14, 30, 223, 80, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "", IDC_FONTSIZE_CUSTOM, 14, 46, 223, 12 GROUPBOX "Uyumluluk", -1, 7, 67, 237, 97 - LTEXT "Birtakım çizeylemler, renk ayarlarını değiştirdikten sonra yeniden başlatılmazsa eksiksiz olarak çalışmayabilir.\r\n\nRenk ayarları değiştirildikten sonra:", -1, 12, 78, 228, 34 + LTEXT "Birtakım izlenceler, renk ayarlarını değiştirdikten sonra yeniden başlatılmazsa eksiksiz olarak çalışmayabilir.\r\n\nRenk ayarları değiştirildikten sonra:", -1, 12, 78, 228, 34 AUTORADIOBUTTON "¥i renk ayarları uygulanmadan önce bilgisayar yeniden başlatılsın.", IDC_RESTART_RB, 14, 116, 228, 10 AUTORADIOBUTTON "y&eniden başlatılmadan yeni renk ayarları uygulansın.", IDC_WITHOUTREBOOT_RB, 14, 131, 228, 10 AUTORADIOBUTTON "ye&ni renk ayarlarının uygulanıp uygulanmayacağı kullanıcıya sorulsun.", IDC_ASKME_RB, 14, 146, 228, 10 @@ -204,9 +204,9 @@ STRINGTABLE BEGIN IDS_COLOR_4BIT "16 Renk" IDS_COLOR_8BIT "256 Renk" - IDS_COLOR_16BIT "Yüksek Renk (16 İkillik)" - IDS_COLOR_24BIT "Gerçek Renk (24 İkillik)" - IDS_COLOR_32BIT "Gerçek Renk (32 İkillik)" + IDS_COLOR_16BIT "Yüksek Renk (16 Bitlik)" + IDS_COLOR_24BIT "Gerçek Renk (24 Bitlik)" + IDS_COLOR_32BIT "Gerçek Renk (32 Bitlik)" IDS_PIXEL "%lux%lu Nokta" END diff --git a/reactos/dll/cpl/hdwwiz/lang/tr-TR.rc b/reactos/dll/cpl/hdwwiz/lang/tr-TR.rc index 87c0e876e69..9d7a7c85250 100644 --- a/reactos/dll/cpl/hdwwiz/lang/tr-TR.rc +++ b/reactos/dll/cpl/hdwwiz/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT diff --git a/reactos/dll/cpl/inetcpl/lang/tr-TR.rc b/reactos/dll/cpl/inetcpl/lang/tr-TR.rc index 6e4ce61f353..21b6eefd6fb 100644 --- a/reactos/dll/cpl/inetcpl/lang/tr-TR.rc +++ b/reactos/dll/cpl/inetcpl/lang/tr-TR.rc @@ -1,7 +1,7 @@ /* * Turkish resources for the Internet control panel applet * - * Copyright: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyright: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -36,7 +36,7 @@ BEGIN IDC_STATIC, 58, 10, 252, 10 EDITTEXT IDC_HOME_EDIT, 58, 22, 252, 12, WS_VISIBLE | ES_AUTOHSCROLL PUSHBUTTON "&Şimdiki Sayfa", IDC_HOME_CURRENT, 58, 36, 80, 14 - PUSHBUTTON "&Öntanımlı Sayfa", IDC_HOME_DEFAULT, 144, 36, 80, 14 + PUSHBUTTON "&Ön Tanımlı Sayfa", IDC_HOME_DEFAULT, 144, 36, 80, 14 PUSHBUTTON "&Boş Sayfa", IDC_HOME_BLANK, 230, 36, 80, 14 GROUPBOX " Tarama Geçmişi ", IDC_STATIC, 4, 60, 312, 46 LTEXT "Saklanan sayfaları, yemişleri ve diğer verileri silebilirsiniz.", @@ -53,9 +53,9 @@ FONT 8, "MS Shell Dlg" CAPTION "Tarama Geçmişini Silme" BEGIN - AUTOCHECKBOX "Geçici Örütbağ Kütüleri:\nSaklanan sayfa sûretleri, resimler ve onay belgeleri.", + AUTOCHECKBOX "Geçici Umûmî Ağ Kütüleri:\nSaklanan sayfa kopyaları, resimler ve onay belgeleri.", IDC_DELETE_TEMP_FILES, 10, 8, 230, 30, BS_TOP | BS_MULTILINE - AUTOCHECKBOX "Yemişler:\nÖrütbağ siteleri eliyle bilgisayara kaydedilmiş, kullanıcı yeğlemeleri ve oturum açma bilgileri gibi şeyleri saklayan kütükler.", + AUTOCHECKBOX "Yemişler:\nUmûmî Ağ siteleri eliyle bilgisayara kaydedilmiş, kullanıcı yeğlemeleri ve oturum açma bilgileri gibi şeyleri saklayan kütükler.", IDC_DELETE_COOKIES, 10, 38, 230, 30, BS_TOP | BS_MULTILINE AUTOCHECKBOX "Geçmiş:\nErişilen sayfaların dizelgesi.", IDC_DELETE_HISTORY, 10, 68, 230, 30, BS_TOP | BS_MULTILINE @@ -103,8 +103,8 @@ END STRINGTABLE BEGIN - IDS_CPL_NAME "Örütbağ Ayarları" - IDS_CPL_INFO "Wine Örütbağ Tarayıcısı'nı ve bununla ilişkili ayarları yapılandırır." + IDS_CPL_NAME "Umûmî Ağ Ayarları" + IDS_CPL_INFO "Wine Umûmî Ağ Tarayıcısı'nı ve bununla ilişkili ayarları yapılandırır." IDS_SEC_SETTINGS "Bölgeye Göre Güvenlik Ayarları: " IDS_SEC_LEVEL0 "Değişik" IDS_SEC_LEVEL1 "Çok Düşük" diff --git a/reactos/dll/cpl/input/lang/tr-TR.rc b/reactos/dll/cpl/input/lang/tr-TR.rc index 55c4375481d..2f48d90e6bd 100644 --- a/reactos/dll/cpl/input/lang/tr-TR.rc +++ b/reactos/dll/cpl/input/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -9,7 +9,7 @@ FONT 8, "MS Shell Dlg" BEGIN LTEXT "Dizelgede gösterilen her bir giriş dili için istediğiniz hizmetleri seçiniz.\nDizelgeyi değiştirmek için ""Ekle..."" veyâ ""Sil..."" düğmelerini kullanınız.", -1, 9, 6, 238, 25 CONTROL "TEXT", IDC_KEYLAYOUT_LIST, "SYSLISTVIEW32", WS_BORDER | WS_VSCROLL | WS_TABSTOP | LVS_SORTASCENDING | LVS_REPORT | 0x0000808D, 8, 36, 237, 101 - PUSHBUTTON "&Öntanımlı Yap", IDC_SET_DEFAULT, 101, 159, 144, 14 + PUSHBUTTON "&Ön Tanımlı Yap", IDC_SET_DEFAULT, 101, 159, 144, 14 PUSHBUTTON "&Ekle...", IDC_ADD_BUTTON, 27, 142, 70, 14 PUSHBUTTON "&Sil...", IDC_REMOVE_BUTTON, 101, 142, 70, 14 PUSHBUTTON "&Husûsiyetler...", IDC_PROP_BUTTON, 175, 142, 70, 14 @@ -24,7 +24,7 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Dizge Yapılandırması", -1, 7, 7, 240, 70 AUTOCHECKBOX "&Gelişmiş Metin Hizmetlerini Kapat", IDC_TURNOFFTEXTSVCS_CB, 14, 20, 220, 12 - LTEXT "Tüm çizeylemlerdeki gelişmiş metin hizmetlerini kapatmak için bu kutucuğu seçiniz.\nBu ayar, dil çubuğunuu kapatacağından Doğu Asya kulanıcıları için önerilmez.", -1, 14, 40, 230, 35 + LTEXT "Tüm izlencelerdeki gelişmiş metin hizmetlerini kapatmak için bu kutucuğu seçiniz.\nBu ayar, dil çubuğunuu kapatacağından Doğu Asya kulanıcıları için önerilmez.", -1, 14, 40, 230, 35 END IDD_KEYSETTINGS DIALOGEX 0, 0, 272, 163 @@ -32,8 +32,8 @@ STYLE DS_SHELLFONT | DS_MODALFRAME | DS_NOIDLEMSG | DS_CONTEXTHELP | WS_POPUPWIN CAPTION "Gelişmiş Düğme Ayarları" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Büyük Hârf Kilidini Kapatmak İçin", -1, 7, 7, 258, 26 - AUTORADIOBUTTON "&Büyük Hârf düğmesine basılsın.", IDC_PRESS_CL_KEY_RB, 14, 17, 120, 11, WS_GROUP + GROUPBOX "Büyük Harf Kilidi'ni Kapatmak İçin", -1, 7, 7, 258, 26 + AUTORADIOBUTTON "&Büyük Harf düğmesine basılsın.", IDC_PRESS_CL_KEY_RB, 14, 17, 120, 11, WS_GROUP AUTORADIOBUTTON "&Üst Damga düğmesine basılsın.", IDC_PRESS_SHIFT_KEY_RB, 144, 17, 120, 11, NOT WS_TABSTOP GROUPBOX "Giriş Dilleri İçin Kısayol Düğmeleri", -1, 7, 37, 258, 95 LTEXT "Eylem", -1, 14, 47, 60, 9 @@ -101,7 +101,7 @@ BEGIN IDS_WHATS_THIS "Bu nedir?" IDS_LANGUAGE "Dil" IDS_LAYOUT "Düğme Takımı Düzeni" - IDS_REM_QUESTION "Seçili düğme takımı düzenini silmeyi onaylıyor musunuz?" + IDS_REM_QUESTION "Seçili düğme takımı düzenini silmeyi doğruluyor musunuz?" IDS_CONFIRMATION "Doğrulama" IDS_LAYOUT_EXISTS "Bu düzen önceden var." IDS_LAYOUT_EXISTS2 "Bu düzen önceden var ve eklenemez." @@ -142,7 +142,7 @@ BEGIN IDS_CHINESE_SIMPLIFIED_SHUANGPIN_LAYOUT "Çince (Bayağılaştırılmış) - ŞuangPin" IDS_CHINESE_SIMPLIFIED_USKEYBOARD_LAYOUT "Çince (Bayağılaştırılmış) - ABD Düğme Takımı" IDS_CHINESE_SIMPLIFIED_ZHENGMA_LAYOUT "Çince (Bayağılaştırılmış) - ZengMa" - IDS_CHINESE_TRADITIONAL_ALPHANUMERIC_LAYOUT "Çince (Geleneklik) - Hârflik ve Sayılık" + IDS_CHINESE_TRADITIONAL_ALPHANUMERIC_LAYOUT "Çince (Geleneklik) - Harflik ve Sayılık" IDS_CHINESE_TRADITIONAL_ARRAY_LAYOUT "Çince (Geleneklik) - Düzen" IDS_CHINESE_TRADITIONAL_BIG5CODE_LAYOUT "Çince (Geleneklik) - Big5 Kodu" IDS_CHINESE_TRADITIONAL_CHANGJIE_LAYOUT "Çince (Geleneklik) - ÇangJi" @@ -158,7 +158,7 @@ BEGIN IDS_CZECH_PROGRAMMERS_LAYOUT "Çekçe Yazılımcılar" IDS_CZECH_QWERTY_LAYOUT "Çekçe (QWERTY)" IDS_DANISH_LAYOUT "Danca" - IDS_DEVANAGARI_INSCRIPT_LAYOUT "Devanagari Hârfliği - INSCRIPT" + IDS_DEVANAGARI_INSCRIPT_LAYOUT "Devanagari Harfliği - INSCRIPT" IDS_DIVEHI_PHONETIC_LAYOUT "Divehi (Tam Seslik)" IDS_DIVEHI_TYPEWRITER_LAYOUT "Divehi (Yazı Makinesi)" IDS_DUTCH_LAYOUT "Flemenkçe" diff --git a/reactos/dll/cpl/intl/lang/tr-TR.rc b/reactos/dll/cpl/intl/lang/tr-TR.rc index 26b34ee69c5..16a084a2171 100644 --- a/reactos/dll/cpl/intl/lang/tr-TR.rc +++ b/reactos/dll/cpl/intl/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013, 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013, 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -8,13 +8,13 @@ CAPTION "Bölgelik Seçenekler" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Ölçünler ve Biçimler", -1, 5, 5, 234, 162 - LTEXT "Bu seçenek, birtakım çizeylemlerdeki sayıların, para birimlerinin, târihlerin ve saatlerin biçimlerini etkiler.", -1, 14, 17, 220, 25 + LTEXT "Bu seçenek, birtakım izlencelerdeki sayıların, nakit birimlerinin, târihlerin ve saatlerin biçimlerini etkiler.", -1, 14, 17, 220, 25 LTEXT "Husûsiyetleri karşılaştırmak için bir öğe seçiniz veyâ ""Husûsileştir..."" düğmesine tıklayarak kendi biçiminizi değiştiriniz.", -1, 14, 37, 220, 22 COMBOBOX IDC_LANGUAGELIST, 14, 56, 160, 160, CBS_DROPDOWNLIST | CBS_SORT | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL PUSHBUTTON "&Husûsileştir...", IDC_SETUP_BUTTON, 178, 56, 52, 13 LTEXT "Örnekler", -1, 14, 73, 70, 10 LTEXT "Sayı:", -1, 16, 86, 48, 10 - LTEXT "Para Birimi:", -1, 16, 101, 48, 10 + LTEXT "Nakit Birimi:", -1, 16, 101, 48, 10 LTEXT "Saat:", -1, 16, 116, 48, 10 LTEXT "Kısa Târih:", -1, 16, 131, 48, 10 LTEXT "Uzun Târih:", -1, 16, 146, 48, 10 @@ -24,7 +24,7 @@ BEGIN EDITTEXT IDC_SHORTTIMESAMPLE_EDIT, 89, 131, 140, 12, ES_READONLY | WS_CHILD | WS_VISIBLE | WS_GROUP | NOT WS_TABSTOP EDITTEXT IDC_FULLTIMESAMPLE_EDIT, 89, 146, 140, 12, ES_READONLY | WS_CHILD | WS_VISIBLE | WS_GROUP | NOT WS_TABSTOP GROUPBOX "Coğrâfî Konum", -1, 5, 172, 234, 55 - LTEXT "Birtakım hizmetlerin size haberler, hava durumları gibi mahallî bilgileri sağlayabilmesi için konumunuzu belirleyiniz.", -1, 14, 184, 210, 24 + LTEXT "Birtakım hizmetlerin size haberler, hava durumları gibi yerli bilgileri sağlayabilmesi için konumunuzu belirleyiniz.", -1, 14, 184, 210, 24 COMBOBOX IDC_LOCATION_COMBO, 14, 207, 217, 160, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP | CBS_SORT END @@ -37,7 +37,7 @@ BEGIN LTEXT "Dil veyâ metin giriş yöntemlerini değiştirmek için ""Ayrıntılar..."" düğmesine tıklayınız.", -1, 12, 15, 220, 18 PUSHBUTTON "&Ayrıntılar...", IDC_DETAIL_BUTTON, 177, 34, 54, 14 GROUPBOX "Ek Dil Desteği", -1, 5, 62, 234, 82 - LTEXT "Birçok dil öntanımlı olarak yüklenmiştir. Ek dilleri yüklemek için aşağıdaki uygun seçme kutucuklarını imleyiniz.", -1, 12, 72, 220, 18 + LTEXT "Birçok dil ön tanımlı olarak yüklenmiştir. Ek dilleri yüklemek için aşağıdaki uygun seçme kutucuklarını imleyiniz.", -1, 12, 72, 220, 18 CHECKBOX "&Karmaşık El Yazısı ve Sağdan Sola Doğru Yazılan Diller İçin Gereken Kütükleri Yükle", IDC_INST_FILES_FOR_RTOL_LANG, 12, 92, 215, 22, BS_MULTILINE CHECKBOX "&Doğu Asya Dilleri İçin Gereken Kütükleri Yükle", IDC_INST_FILES_FOR_ASIAN, 12, 114, 180, 22, BS_MULTILINE END @@ -47,14 +47,14 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Gelişmiş" FONT 8, "MS Shell Dlg" BEGIN - GROUPBOX "Evrenlik Kodlu Olmayan Çizeylemler İçin Dil", -1, 5, 5, 234, 90 + GROUPBOX "Evrenlik Kodlu Olmayan İzlenceler İçin Dil", -1, 5, 5, 234, 90 COMBOBOX IDC_LANGUAGE_COMBO, 14, 75, 217, 160, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP | CBS_SORT - LTEXT "Bu dizge ayârı, Evrenlik Kodlu olmayan çizeylemlerin seçkelerinin ve iletişim kutularının kendi dillerinde görüntülenmesini etkinleştirir. Bu ayar, Evrenlik Kodlu çizeylemleri etkilemez ve bu ayar, bu bilgisayardaki tüm kullanıcıları etkiler.", -1, 14, 18, 223, 33 - LTEXT "Kullanmak istediğiniz Evrenlik Kodlu olmayan çizeylemlerin dil sürümlerini karşılaştırmak için bir dil seçiniz:", -1, 14, 55, 223, 18 + LTEXT "Bu dizge ayârı, Evrenlik Kodlu olmayan izlencelerin seçkelerinin ve iletişim kutularının kendi dillerinde görüntülenmesini etkinleştirir. Bu ayar, Evrenlik Kodlu izlenceleri etkilemez ve bu ayar, bu bilgisayardaki tüm kullanıcıları etkiler.", -1, 14, 18, 223, 33 + LTEXT "Kullanmak istediğiniz Evrenlik Kodlu olmayan izlencelerin dil sürümlerini karşılaştırmak için bir dil seçiniz:", -1, 14, 55, 223, 18 GROUPBOX "Kod Sayfası Dönüştürme Çizelgesi", -1, 5, 101, 234, 88 CONTROL "", IDC_CONV_TABLES, "SysListView32", LVS_REPORT | LVS_SORTASCENDING | LVS_NOCOLUMNHEADER | WS_BORDER | WS_TABSTOP, 14, 114, 217, 70 - GROUPBOX "Öntanımlı Kullanıcı Hesâbı Ayarları", -1, 5, 193, 234, 30 - CHECKBOX "Bu Kullanıcının Tüm Ayarlarını Öntanımlı Olarak Ayarla", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22, BS_MULTILINE + GROUPBOX "Ön Tanımlı Kullanıcı Hesâbı Ayarları", -1, 5, 193, 234, 30 + CHECKBOX "Bu Kullanıcının Tüm Ayarlarını Ön Tanımlı Olarak Ayarla", IDC_APPLY_CUR_USER_DEF_PROFILE, 12, 200, 220, 22, BS_MULTILINE END IDD_NUMBERSPAGE DIALOGEX 0, 0, 246, 234 @@ -89,7 +89,7 @@ END IDD_CURRENCYPAGE DIALOGEX 0, 0, 246, 234 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Para Birimi" +CAPTION "Nakit Birimi" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Görünüm Örenkleri", -1, 7, 7, 230, 33, WS_CHILD | WS_VISIBLE @@ -97,7 +97,7 @@ BEGIN EDITTEXT IDC_CURRENCYPOSSAMPLE, 43, 19, 72, 14, ES_READONLY | WS_CHILD | WS_VISIBLE | WS_GROUP | NOT WS_TABSTOP LTEXT "Eksi:", -1, 120, 21, 30, 10, WS_CHILD | WS_VISIBLE | WS_GROUP EDITTEXT IDC_CURRENCYNEGSAMPLE, 154, 19, 72, 14, ES_READONLY | WS_CHILD | WS_VISIBLE | WS_GROUP | NOT WS_TABSTOP - LTEXT "&Para Birimi Simgesi:", -1, 10, 51, 121, 10, WS_CHILD | WS_VISIBLE | WS_GROUP + LTEXT "&Nakit Birimi Simgesi:", -1, 10, 51, 121, 10, WS_CHILD | WS_VISIBLE | WS_GROUP COMBOBOX IDC_CURRENCYSYMBOL, 134, 49, 100, 83, CBS_DROPDOWN | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL LTEXT "&Artı Nicelik:", -1, 10, 68, 121, 10, WS_CHILD | WS_VISIBLE | WS_GROUP COMBOBOX IDC_CURRENCYPOSVALUE, 134, 66, 100, 83, CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL @@ -191,7 +191,7 @@ END STRINGTABLE BEGIN IDS_CPLNAME "Bölgelik Ayarlar" - IDS_CPLDESCRIPTION "Dilleri ve sayı, para birimi, saat ve târih biçimlerini seçer." + IDS_CPLDESCRIPTION "Dilleri ve sayı, nakit birimi, saat ve târih biçimlerini seçer." END STRINGTABLE diff --git a/reactos/dll/cpl/joy/lang/tr-TR.rc b/reactos/dll/cpl/joy/lang/tr-TR.rc index acc3004c476..7f5a44972ef 100644 --- a/reactos/dll/cpl/joy/lang/tr-TR.rc +++ b/reactos/dll/cpl/joy/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -72,7 +72,7 @@ BEGIN ICON IDI_CPLSYSTEM, -1, 7, 24, 20, 20 DEFPUSHBUTTON "Tamam", IDOK, 106, 65, 50, 14 PUSHBUTTON "İptal", IDCANCEL, 163, 65, 50, 14 - LTEXT "Daha eski çizeylemlerle kullanmak için bir aygıt seçiniz.", -1, 7, 7, 208, 10 + LTEXT "Daha eski izlencelerle kullanmak için bir aygıt seçiniz.", -1, 7, 7, 208, 10 LTEXT "&Yeğlenen Aygıt:", -1, 34, 24, 70, 10 COMBOBOX IDC_PREFERRED_DEV_COMBO, 34, 38, 179, 75, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL END diff --git a/reactos/dll/cpl/liccpa/lang/tr-TR.rc b/reactos/dll/cpl/liccpa/lang/tr-TR.rc index 80124480dc7..becf8694c5e 100644 --- a/reactos/dll/cpl/liccpa/lang/tr-TR.rc +++ b/reactos/dll/cpl/liccpa/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT diff --git a/reactos/dll/cpl/main/lang/tr-TR.rc b/reactos/dll/cpl/main/lang/tr-TR.rc index 6eb7b9a4b72..4df5a20d3d4 100644 --- a/reactos/dll/cpl/main/lang/tr-TR.rc +++ b/reactos/dll/cpl/main/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -44,7 +44,7 @@ BEGIN CONTROL "", IDC_SLIDER_CLICK_LOCK, "msctls_trackbar32", TBS_AUTOTICKS | WS_TABSTOP, 78, 35, 70, 17 PUSHBUTTON "Tamam", IDOK, 110, 59, 60, 14 PUSHBUTTON "İptal", IDCANCEL, 174, 59, 60, 14 - LTEXT "&Tıklamanız kilitlenmeden önce bir fâre düğmesinin ya da bir fâre tekerinin ne kadar basılı tutulacağını ayarlayınız:", -1, 37, 5, 200, 27 + LTEXT "&Tıklamanız kilitlenmeden önce bir fâre düğmesinin ya da bir fâre tekerinin ne denli basılı tutulacağını ayarlayınız:", -1, 37, 5, 200, 27 ICON IDI_LOOK_KEY, IDC_ICON_CLICK_LOCK, 5, 5, 15, 15 END @@ -82,7 +82,7 @@ BEGIN LTEXT "&Husûsileştir", -1, 5, 57, 60, 10 LISTBOX IDC_LISTBOX_CURSOR, 5, 68, 236, 124, WS_VISIBLE | WS_BORDER | WS_TABSTOP | WS_VSCROLL | LBS_OWNERDRAWFIXED | LBS_NOTIFY CHECKBOX "&İmleç Gölgesini Etkinleştir", IDC_CHECK_CURSOR_SHADOW, 5, 198, 105, 10 - PUSHBUTTON "&Öntanımlıyı Kullan", IDC_BUTTON_USE_DEFAULT_CURSOR, 117, 196, 65, 14 + PUSHBUTTON "&Ön Tanımlıyı Kullan", IDC_BUTTON_USE_DEFAULT_CURSOR, 117, 196, 65, 14 PUSHBUTTON "&Göz At...", IDC_BUTTON_BROWSE_CURSOR, 186, 196, 55, 14 END @@ -110,7 +110,7 @@ BEGIN ICON IDI_MOUSE_SPEED, IDC_ICON_MOUSE_SPEED, 18, 20, 32, 32 CHECKBOX "İ&mleç Duyarlılığını Arttır", IDC_CHECK_POINTER_PRECISION, 52, 50, 140, 10 GROUPBOX "Çabukluk", -1, 5, 70, 236, 40 - CHECKBOX "İm&leci İletişim Kutularında Kendiliğinden Öntanımlı Düğmenin Üzerine Getir", + CHECKBOX "İm&leci İletişim Kutularında Kendiliğinden Ön Tanımlı Düğmenin Üzerine Getir", IDC_CHECK_SNAP_TO, 52, 84, 183, 20, BS_MULTILINE | BS_TOP ICON IDI_MOUSE_BUTTON, IDC_ICON_SNAP_TO, 18, 83, 15, 15 GROUPBOX "Görünürlük", -1, 5, 115, 236, 95 @@ -133,9 +133,9 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Kaydırma", -1, 5, 5, 236, 80 ICON IDI_MOUSE_WHEEL, IDC_ICON_WHEEL, 20, 20, 32, 32 - LTEXT "Tekerlek bir dişli döndüğünde şu kadar kaydır:", -1, 60, 15, 150, 10 - RADIOBUTTON "&Bir kerede şu kadar yataç:", IDC_RADIO_WHEEL_SCROLL_LINES, 60, 30, 150, 10, WS_VISIBLE | WS_GROUP | WS_TABSTOP - RADIOBUTTON "B&ir kerede bir görüntülük.", IDC_RADIO_WHEEL_SCROLL_PAGE, 60, 65, 90, 10 + LTEXT "Tekerlek bir dişli döndüğünde şu denli kaydır:", -1, 60, 15, 150, 10 + RADIOBUTTON "&Bir kezde şu denli yataç:", IDC_RADIO_WHEEL_SCROLL_LINES, 60, 30, 150, 10, WS_VISIBLE | WS_GROUP | WS_TABSTOP + RADIOBUTTON "B&ir kezde bir görüntülük.", IDC_RADIO_WHEEL_SCROLL_PAGE, 60, 65, 90, 10 EDITTEXT IDC_EDIT_WHEEL_SCROLL_LINES, 70, 45, 60, 15, ES_RIGHT | WS_VISIBLE | WS_GROUP | WS_TABSTOP CONTROL "", IDC_UPDOWN_WHEEL_SCROLL_LINES, UPDOWN_CLASS, UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | WS_BORDER, 125, 45, 12, 12 END @@ -165,9 +165,9 @@ BEGIN IDS_SYSTEM_SCHEME "(Dizge Düzeni)" IDS_BROWSE_FILTER "İmleçler (*.ani, *.cur)\0*.ani;*.cur\0Devingen İmleçler (*.ani)\0*.ani\0Durgun İmleçler (*.cur)\0*.cur\0Tüm Kütükler\0*.*\0\0" IDS_BROWSE_TITLE "Göz At" - IDS_REMOVE_TITLE "İmleç Düzenini Silmeyi Onaylama" - IDS_REMOVE_TEXT """%s"" imleç düzenini silmeyi onaylıyor musunuz?" - IDS_OVERWRITE_TITLE "İmleç Düzeninin Üzerine Yazmayı Onaylama" - IDS_OVERWRITE_TEXT "Bu imleç düzeni adı kullanımda. Var olan imleç düzeninin üzerine yazmayı onaylıyor musunuz?" + IDS_REMOVE_TITLE "İmleç Düzenini Silmeyi Doğrulama" + IDS_REMOVE_TEXT """%s"" imleç düzenini silmeyi doğruluyor musunuz?" + IDS_OVERWRITE_TITLE "İmleç Düzeninin Üzerine Yazmayı Doğrulama" + IDS_OVERWRITE_TEXT "Bu imleç düzeni adı kullanımda. Var olan imleç düzeninin üzerine yazmayı doğruluyor musunuz?" IDS_ANIMATE_CURSOR "Devingen İmleç" END diff --git a/reactos/dll/cpl/mmsys/lang/tr-TR.rc b/reactos/dll/cpl/mmsys/lang/tr-TR.rc index 4a6445d5226..494f4f01191 100644 --- a/reactos/dll/cpl/mmsys/lang/tr-TR.rc +++ b/reactos/dll/cpl/mmsys/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -29,7 +29,7 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Sesler" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Ses düzenleri, ReactOS'un ve çizeylemlerin içindeki olaylara sesler atayan sesler takımıdır. Var olan bir düzeni seçebilir veyâ değiştirdiğinizi kaydedebilirsiniz.", -1, 8, 7, 230, 30 + LTEXT "Ses düzenleri, ReactOS'un ve izlencelerin içindeki olaylara sesler atayan sesler takımıdır. Var olan bir düzeni seçebilir veyâ değiştirdiğinizi kaydedebilirsiniz.", -1, 8, 7, 230, 30 LTEXT "&Ses Düzeni:", -1, 8, 42, 150, 9 COMBOBOX IDC_SOUND_SCHEME, 8, 53, 230, 46, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "&Ayrı Kaydet...", IDC_SAVEAS_BTN, 134, 70, 50, 15 @@ -50,7 +50,7 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Kayıttan Yürütme", -1, 7, 7, 230, 60 ICON IDI_CPLICON, IDI_CPLICON, 15, 20, 32, 32 - LTEXT "&Öntanımlı Aygıt:", -1, 50, 20, 80, 9 + LTEXT "&Ön Tanımlı Aygıt:", -1, 50, 20, 80, 9 COMBOBOX IDC_DEVICE_PLAY_LIST, 50, 30, 180, 46, CBS_DROPDOWNLIST PUSHBUTTON "&Ses Düzeyi...", IDC_VOLUME1_BTN, 85, 47, 70, 15 PUSHBUTTON "&Gelişmiş...", IDC_ADV2_BTN, 160, 47, 70, 15 @@ -65,8 +65,8 @@ BEGIN LTEXT "Ön&tanımlı Aygıt:", -1, 50, 158, 80, 9 COMBOBOX IDC_DEVICE_MIDI_LIST, 50, 168, 180, 46, CBS_DROPDOWNLIST PUSHBUTTON "Ses &Düzeyi...", IDC_VOLUME3_BTN, 85, 185, 70, 15 - PUSHBUTTON "&Hakkında...", IDC_ADV3_BTN, 160, 185, 70, 15 - CHECKBOX "&Yalnızca Öntanımlı Aygıtları Kullan", IDC_DEFAULT_DEV_CHECKBOX, 7, 212, 140, 10 + PUSHBUTTON "&Üzerine...", IDC_ADV3_BTN, 160, 185, 70, 15 + CHECKBOX "&Yalnızca Ön Tanımlı Aygıtları Kullan", IDC_DEFAULT_DEV_CHECKBOX, 7, 212, 140, 10 END IDD_VOICE DIALOGEX 0, 0, 246, 228 @@ -77,7 +77,7 @@ BEGIN LTEXT "Bu ayarlar, seçili yürütme veyâ kaydetme aygıtının ses düzeyini ve gelişmiş seçeneklerini denetler.", -1, 8, 7, 230, 40 GROUPBOX "Yürütme", -1, 7, 37, 230, 60 ICON IDI_CPLICON, IDI_CPLICON, 15, 50, 32, 32 - LTEXT "&Öntanımlı Aygıt:", -1, 50, 50, 80, 9 + LTEXT "&Ön Tanımlı Aygıt:", -1, 50, 50, 80, 9 COMBOBOX IDC_DEVICE_VOICE_LIST, 50, 60, 180, 46, CBS_DROPDOWNLIST PUSHBUTTON "&Ses Düzeyi...", IDC_VOLUME4_BTN, 85, 77, 70, 15 PUSHBUTTON "&Gelişmiş...", IDC_ADV4_BTN, 160, 77, 70, 15 @@ -215,7 +215,7 @@ BEGIN CONTROL "Slider1", 9503, "MSCTLS_TRACKBAR32", WS_TABSTOP | 0x00000401, 87, 162, 108, 17 LTEXT "Yüksek", 9502, 202, 164, 17, 8 AUTOCHECKBOX "&Tüm sürgüleri aynı anda devindir.", 9504, 5, 185, 216, 9 - PUSHBUTTON "&Öntanımlılara Geri Dön", 9505, 110, 199, 110, 14 + PUSHBUTTON "&Ön Tanımlılara Geri Dön", 9505, 110, 199, 110, 14 END IDD_SETUP2 DIALOG 0, 0, 227, 206 @@ -225,7 +225,7 @@ FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "ReactOS Ses", 10259, 7, 5, 213, 192 ICON 4394, 10257, 25, 25, 20, 20 - LTEXT "ReactOS Ses Hizmeti şimdi etkinleştirildi. Bununla birlikte ReactOS'u yeniden başlatana kadar sesler düzgün bir şekilde çalınamayabilir. Eğer şimdi bilgisayarı yeniden başlatmak isterseniz ilk önce çalışmalarınızı kaydediniz, ardından tüm çizeylemleri kapatınız.", 10261, 60, 25, 150, 50 + LTEXT "ReactOS Ses Hizmeti şimdi etkinleştirildi. Bununla birlikte ReactOS'u yeniden başlatana dek sesler düzgün bir şekilde çalınamayabilir. Eğer şimdi bilgisayarı yeniden başlatmak isterseniz ilk önce çalışmalarınızı kaydediniz, ardından tüm izlenceleri kapatınız.", 10261, 60, 25, 150, 50 LTEXT "ReactOS'u yeniden başlatmak için ""Tamam"" düğmesine tıklayınız.", 10262, 60, 75, 150, 20 LTEXT "Eğer iptal ederseniz ReactOS Ses'in uygun bir şekilde çalışması için bilgisayarı yeniden başlatmaya gereksinim duyacaksınız.", 10263, 60, 100, 150, 40 END @@ -236,8 +236,8 @@ BEGIN IDS_CPLDESCRIPTION "Bilgisayarın ses düzenini değiştirir ve hoparlörlerle kayıt aygıtları için ayarları yapılandırır." IDS_NO_SOUND "(Yok)" IDS_NO_DEVICES "Aygıt Yok" - 5825 "Çizeylem Yanlışlığı" - 5826 "Çizeylemi Kapatma" + 5825 "İzlence Yanlışlığı" + 5826 "İzlenceyi Kapatma" 5827 "Çok Az Kalan Pil Uyarısı" 5828 "Aygıt Bağlandı" 5829 "Aygıt Çıkarıldı" @@ -250,12 +250,12 @@ BEGIN 5836 "Simge Durumuna Küçültme" 5837 "Yeni E-Posta Bildirimi" 5838 "Gezinmeyi Başlatma" - 5839 "Çizeylem Açma" + 5839 "İzlence Açma" 5840 "Yazdırma Bitirildi" 5841 "Aşağı Geri Getirme" 5842 "Yukarı Geri Getirme" 5843 "Yıldız İmi" - 5844 "Öntanımlı Ses" + 5844 "Ön Tanımlı Ses" 5845 "Ünlem" 5846 "ReactOS'tan Çıkma" 5847 "Önemli Durma" diff --git a/reactos/dll/cpl/powercfg/lang/tr-TR.rc b/reactos/dll/cpl/powercfg/lang/tr-TR.rc index 27aa9fcb69c..40a1dd9847f 100644 --- a/reactos/dll/cpl/powercfg/lang/tr-TR.rc +++ b/reactos/dll/cpl/powercfg/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013, 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013, 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -49,7 +49,7 @@ BEGIN LTEXT "Bilinmiyor", IDC_ALARMMSG1, 154, 71, 84, 10 LTEXT "Eylem:", -1, 95, 83, 55, 10 LTEXT "Bilinmiyor", IDC_ALARMAKTION1, 154, 83, 84, 10 - LTEXT "Çizeylem Çalıştır:", -1, 95, 95, 55, 10 + LTEXT "İzlence Çalıştır:", -1, 95, 95, 55, 10 LTEXT "Bilinmiyor", IDC_ALARMPROG1, 154, 95, 84, 10 GROUPBOX "Çok Az Kalan Pil Uyarısı", -1, 6, 120, 239, 106 CONTROL "G&üç düzeyi şuraya gelirse çok az kalan pil uyarısını etkinleştir:", IDC_ALARM2, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 15, 131, 180, 15 @@ -62,7 +62,7 @@ BEGIN LTEXT "Bilinmiyor", IDC_ALARMMSG2, 154, 185, 84, 10 LTEXT "Eylem:", -1, 95, 198, 45, 10 LTEXT "Bilinmiyor", IDC_ALARMAKTION2, 154, 198, 84, 10 - LTEXT "Çizeylem Çalıştır:", -1, 95, 211, 50, 10 + LTEXT "İzlence Çalıştır:", -1, 95, 211, 50, 10 LTEXT "Bilinmiyor", IDC_ALARMPROG2, 154, 211, 84, 10 END @@ -74,7 +74,7 @@ BEGIN ICON IDI_ACDC, IDI_ACDC, 7, 7, 20, 20 LTEXT "Kullanılacak güç kullanımı ayarlarını seçiniz.", -1, 37, 6, 207, 20 GROUPBOX "Seçenekler", -1, 6, 30, 240, 65 - CONTROL "&Görev Çubuğunda Simgeyi Her Zaman Göster", IDC_SYSTRAYBATTERYMETER, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 17, 43, 220, 10 + CONTROL "&Görev Çubuğunda Simgeyi Sürekli Göster", IDC_SYSTRAYBATTERYMETER, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 17, 43, 220, 10 CONTROL "&Bilgisayar Uykudan Döndüğünde Şifre Sor", IDC_PASSWORDLOGON, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 17, 60, 220, 10 CONTROL "&Pilde Çalışırken Görüntülüğün Parlaklığını Azalt", IDC_VIDEODIMDISPLAY, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 17, 78, 220, 10 GROUPBOX "Güç Düğmeleri", -1, 6, 101, 240, 127 @@ -100,7 +100,7 @@ BEGIN LTEXT "Bilinmiyor", IDC_FREESPACE, 160, 95, 80, 10 LTEXT "Anıkta Bekletmek İçin Gereken Disk Alanı:", -1, 15, 115, 140, 10 LTEXT "Bilinmiyor", IDC_SPACEFORHIBERNATEFILE, 160, 115, 80, 10 - LTEXT "Bilgisayarın anıkta bekleyebilmesi için yeteri kadar disk boşluğu oluşturulması gerekir.", IDC_TOLESSFREESPACE, 15, 135, 224, 20 + LTEXT "Bilgisayarın anıkta bekleyebilmesi için yeterli disk boşluğu oluşturulması gerekir.", IDC_TOLESSFREESPACE, 15, 135, 224, 20 END STRINGTABLE @@ -140,6 +140,6 @@ BEGIN IDS_TIMEOUT14 "4 Saat Sonra" IDS_TIMEOUT15 "5 Saat Sonra" IDS_TIMEOUT16 "Hiçbir Zaman" - IDS_DEL_SCHEME "Bu güç düzenini silmeyi onaylıyor musunuz?" + IDS_DEL_SCHEME "Bu güç düzenini silmeyi doğruluyor musunuz?" IDS_DEL_SCHEME_TITLE "Düzeni Sil" END diff --git a/reactos/dll/cpl/sysdm/lang/tr-TR.rc b/reactos/dll/cpl/sysdm/lang/tr-TR.rc index fbbacf56c97..0c2719b9b9a 100644 --- a/reactos/dll/cpl/sysdm/lang/tr-TR.rc +++ b/reactos/dll/cpl/sysdm/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -90,7 +90,7 @@ BEGIN PUSHBUTTON "&Sil", IDC_HRDPROFDEL, 173, 106, 50, 14, WS_DISABLED GROUPBOX "Donanım Ayarlıklarının Seçimi", IDC_STATIC, 7, 130, 240, 75 LTEXT "ReactOS Başladığında:", IDC_STATIC, 14, 142, 210, 8 - AUTORADIOBUTTON "&Bir donanım ayarlığı seçilene kadar beklenilsin.", IDC_HRDPROFWAIT, 14, 158, 133, 8, WS_GROUP + AUTORADIOBUTTON "&Bir donanım ayarlığı seçilene dek beklenilsin.", IDC_HRDPROFWAIT, 14, 158, 133, 8, WS_GROUP AUTORADIOBUTTON "B&ir ayarlık seçilmediğinde dizelgedeki ilk ayarlık seçilsin:", IDC_HRDPROFSELECT, 14, 173, 190, 8 LTEXT "Sâniye Sonra", IDC_STATIC, 65, 187, 35, 8 EDITTEXT IDC_HRDPROFEDIT, 25, 185, 35, 12 @@ -151,7 +151,7 @@ CAPTION "Başlangıç ve Kurtarma" FONT 8, "MS Shell Dlg" BEGIN GROUPBOX "Dizge Başlangıcı", IDC_STATIC, 7, 12, 238, 95 - LTEXT "&Öntanımlı İşletim Dizgesi:", IDC_STATIC, 14, 26, 100, 8 + LTEXT "&Ön Tanımlı İşletim Dizgesi:", IDC_STATIC, 14, 26, 100, 8 COMBOBOX IDC_STRECOSCOMBO, 14, 37, 224, 46, CBS_DROPDOWNLIST AUTOCHECKBOX "İ&şletim Dizgeleri Dizelgesini Görüntüleme Süresi:", IDC_STRECLIST, 14, 56, 160, 8 EDITTEXT IDC_STRRECLISTEDIT, 185, 54, 30, 12, ES_NUMBER @@ -256,7 +256,7 @@ END STRINGTABLE BEGIN IDS_CPLSYSTEMNAME "Dizge" - IDS_CPLSYSTEMDESCRIPTION "Bilgisayar hakkında ayrıntılı bilgi görüntüler ve dizge ve donanım ayarlarını değiştirir." + IDS_CPLSYSTEMDESCRIPTION "Bilgisayar üzerine ayrıntılı bilgi görüntüler ve dizge ve donanım ayarlarını değiştirir." IDS_MEGABYTE "MB Bellek" IDS_GIGABYTE "GB Bellek" IDS_TERABYTE "TB Bellek" @@ -277,5 +277,5 @@ BEGIN IDS_WARNMAXIMUMSIZE "Sayfalama kütüğünün azamî büyüklüğünü giriniz." IDS_WARNINITIALRANGE "Sayfalama kütüğünün başlangıç büyüklüğü, 2 MB'tan küçük, seçili sürücüdeki boşluğun büyüklüğünden büyük olamaz." IDS_WARNMAXIMUMRANGE "Sayfalama kütüğünün azamî büyüklüğü, başlangıç büyüklüğünden küçük, seçili sürücüdeki boşluğun büyüklüğünden büyük olamaz." - IDS_DEVS "\nReactOS Takımı\n\nTasarı Eş Güdümcüsü:\n\nAleksey Bragin\n\nGeliştirme Takımı:\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nSürüm Tasarlayıcıları:\n\nColin Finck\nZ98\n\nÖrütbağ Sitesi Takımı:\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedya Takımı:\n\nMindflyer\nWierd_W\n\nAyrıca, diğer tüm katkıda bulunanlara teşekkürler:\nWine Takımı\n\n" + IDS_DEVS "\nReactOS Takımı\n\nTasarı Eş Güdümcüsü:\n\nAleksey Bragin\n\nGeliştirme Takımı:\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nSürüm Tasarlayıcıları:\n\nColin Finck\nZ98\n\nUmûmî Ağ Sitesi Takımı:\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedya Takımı:\n\nMindflyer\nWierd_W\n\nAyrıca, diğer tüm katkıda bulunanlara teşekkürler:\nWine Takımı\n\n" END diff --git a/reactos/dll/cpl/telephon/lang/tr-TR.rc b/reactos/dll/cpl/telephon/lang/tr-TR.rc index f71f1006806..a9aaf87b778 100644 --- a/reactos/dll/cpl/telephon/lang/tr-TR.rc +++ b/reactos/dll/cpl/telephon/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT diff --git a/reactos/dll/cpl/timedate/lang/tr-TR.rc b/reactos/dll/cpl/timedate/lang/tr-TR.rc index 4e4de0c5008..2c44dea872f 100644 --- a/reactos/dll/cpl/timedate/lang/tr-TR.rc +++ b/reactos/dll/cpl/timedate/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -32,17 +32,17 @@ END IDD_INETTIMEPAGE DIALOGEX 0, 0, 252, 146 STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION -CAPTION "Örütbağ Zamânı" +CAPTION "Umûmî Ağ Zamânı" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN COMBOBOX IDC_SERVERLIST, 65, 22, 117, 136, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - AUTOCHECKBOX "Zamânı, Örütbağ Zaman Sunucusuyla Kendiliğinden Eşleştir", + AUTOCHECKBOX "Zamânı, Umûmî Ağ Zaman Sunucusuyla Kendiliğinden Eşleştir", IDC_AUTOSYNC, 11, 7, 241, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP LTEXT "Sunucu:", IDC_SERVERTEXT, 34, 22, 28, 13 PUSHBUTTON "&Eşleştir", IDC_UPDATEBUTTON, 187, 22, 49, 14 LTEXT "", IDC_SUCSYNC, 12, 54, 214, 23 LTEXT "", IDC_NEXTSYNC, 12, 96, 137, 12 - LTEXT "Eşleme, yalnızca bilgisayar örütbağa bağlandığında olur.", -1, 12, 114, 225, 25 + LTEXT "Eşleme, yalnızca bilgisayar Umûmî Ağ'a bağlandığında olur.", -1, 12, 114, 225, 25 END STRINGTABLE diff --git a/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc b/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc index 4f3f4bbc77c..8f70b5579c0 100644 --- a/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc +++ b/reactos/dll/cpl/wined3dcfg/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT diff --git a/reactos/dll/shellext/deskadp/lang/tr-TR.rc b/reactos/dll/shellext/deskadp/lang/tr-TR.rc index 4322ec6ded2..0ba5eb03e2f 100644 --- a/reactos/dll/shellext/deskadp/lang/tr-TR.rc +++ b/reactos/dll/shellext/deskadp/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -38,7 +38,7 @@ END STRINGTABLE BEGIN IDS_MODEFMT "%d, %s, %s eliyle %d" - IDS_DEFREFRESHRATE "Öntanımlı Yenileme" + IDS_DEFREFRESHRATE "Ön Tanımlı Yenileme" IDES_REFRESHRATEFMT "%d Hertz" IDS_4BPP "16 Renk" IDS_8BPP "256 Renk" diff --git a/reactos/dll/shellext/deskmon/lang/tr-TR.rc b/reactos/dll/shellext/deskmon/lang/tr-TR.rc index b8bbc7546dc..21676d2bfca 100644 --- a/reactos/dll/shellext/deskmon/lang/tr-TR.rc +++ b/reactos/dll/shellext/deskmon/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -19,6 +19,6 @@ END STRINGTABLE BEGIN - IDS_USEDEFFRQUENCY "Öntanımlı Donanım Ayarlarını Kullan" + IDS_USEDEFFRQUENCY "Ön Tanımlı Donanım Ayarlarını Kullan" IDS_FREQFMT "%u Hertz" END diff --git a/reactos/dll/shellext/slayer/lang/tr-TR.rc b/reactos/dll/shellext/slayer/lang/tr-TR.rc index 9e765ba9354..0c0f5725cc6 100644 --- a/reactos/dll/shellext/slayer/lang/tr-TR.rc +++ b/reactos/dll/shellext/slayer/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -7,16 +7,16 @@ STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Uyumluluk" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - LTEXT "Eğer ReactOS'ta bir çizeylemi çalıştırmada sorunlar varsa ReactOS'un çizeyleme bildireceği bir işletim dizgesi seçiniz.", -1, 7, 7, 210, 31 + LTEXT "Eğer ReactOS'ta bir izlenceyi çalıştırmada sorunlar varsa ReactOS'un izlenceye bildireceği bir işletim dizgesi seçiniz.", -1, 7, 7, 210, 31 GROUPBOX "Uyumluluk Kipleri", IDC_COMPATGROUP, 7, 41, 210, 49 - CHECKBOX "B&u çizeylemi şu uyumluluk kipinde çalıştır:", IDC_CHKRUNCOMPATIBILITY, 18, 57, 188, 10, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "B&u izlenceyi şu uyumluluk kipinde çalıştır:", IDC_CHKRUNCOMPATIBILITY, 18, 57, 188, 10, BS_AUTOCHECKBOX | WS_TABSTOP COMBOBOX IDC_COMPATIBILITYMODE, 18, 70, 188, 85, CBS_HASSTRINGS | CBS_DROPDOWNLIST | WS_TABSTOP | WS_DISABLED GROUPBOX "Görüntü Ayarları", -1, 7, 99, 210, 61, BS_GROUPBOX | WS_DISABLED CHECKBOX "&256 Renkte Çalıştır", IDC_CHKRUNIN256COLORS, 18, 114, 188, 10, BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED CHECKBOX "&640'a 480 Çözünürlüğünde Çalıştır", IDC_CHKRUNIN640480RES, 18, 129, 188, 10, BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED CHECKBOX "&Basarî Temaları Edilginleştir", IDC_CHKDISABLEVISUALTHEMES, 18, 144, 188, 10, BS_AUTOCHECKBOX | WS_TABSTOP | WS_DISABLED PUSHBUTTON "&Uyumluluk Kiplerini Düzenle...", IDC_EDITCOMPATIBILITYMODES, 117, 167, 100, 15 - /* CONTROL "Uygulama Uyumluluğu Hakkında Daha Çok Bilgi Edin", IDC_INFOLINK, "SysLink", WS_CHILD | WS_TABSTOP | WS_VISIBLE, 7, 207, 210, 10, WS_EX_NOPARENTNOTIFY */ + /* CONTROL "Uygulama Uyumluluğu Üzerine Daha Çok Bilgi Edin", IDC_INFOLINK, "SysLink", WS_CHILD | WS_TABSTOP | WS_VISIBLE, 7, 207, 210, 10, WS_EX_NOPARENTNOTIFY */ END IDD_EDITCOMPATIBILITYMODES DIALOGEX 0, 0, 230, 139 diff --git a/reactos/dll/win32/comdlg32/lang/cdlg_Tr.rc b/reactos/dll/win32/comdlg32/lang/cdlg_Tr.rc index 6a63d71ffbc..b360eb6f9fe 100644 --- a/reactos/dll/win32/comdlg32/lang/cdlg_Tr.rc +++ b/reactos/dll/win32/comdlg32/lang/cdlg_Tr.rc @@ -55,20 +55,20 @@ STRINGTABLE PD32_INVALID_PAGE_RANGE "Bu değer sayfa aralığında değil.\n\ %1!d! ile %2!d! arasında bir değer giriniz." PD32_FROM_NOT_ABOVE_TO "'Şuradan' değeri 'Şuraya' değerini geçemez." - PD32_MARGINS_OVERLAP "Kenarlıklar örtüşüyor ya da kâğıt sınırlarının dışına çıkıyor.\n\ + PD32_MARGINS_OVERLAP "Kenarlıklar örtüşüyor ya da kâğıt hudutlarının dışına çıkıyor.\n\ Kenarlıkları yeniden giriniz." - PD32_NR_OF_COPIES_EMPTY "'Sûret Sayısı' girişi boş olamaz." - PD32_TOO_LARGE_COPIES "Bu kadar çok sûret yazıcı eliyle desteklenmiyor.\n\ + PD32_NR_OF_COPIES_EMPTY "'Kopya Sayısı' girişi boş olamaz." + PD32_TOO_LARGE_COPIES "Bu denli çok kopya yazıcı eliyle desteklenmiyor.\n\ 1 ile %d arasında bir değer giriniz." PD32_PRINT_ERROR "Bir yazıcı yanlışlığı oluştu." - PD32_NO_DEFAULT_PRINTER "Öntanımlı yazıcı tanımlanmamış." + PD32_NO_DEFAULT_PRINTER "Ön tanımlı yazıcı tanımlanmamış." PD32_CANT_FIND_PRINTER "Yazıcı bulunamıyor." PD32_OUT_OF_MEMORY "Bellek dolu." PD32_GENERIC_ERROR "Bir yanlışlık oluştu." PD32_DRIVER_UNKNOWN "Bilinmeyen yazıcı sürücüsü." PD32_NO_DEVICES "Sayfa ayarlamak veyâ belge yazdırmak gibi yazıcıyla ilgili işlemleri yapmadan önce bir yazıcı kurmalısınız. Önce bir yazıcı kurunuz, ardından yeniden deneyiniz." - PD32_DEFAULT_PRINTER "Öntanımlı yazıcı; " + PD32_DEFAULT_PRINTER "Ön tanımlı yazıcı; " PD32_NR_OF_DOCUMENTS_IN_QUEUE "Kuyrukta %d belge var." PD32_MARGINS_IN_INCHES "Kıyılıklar (inç olarak)" PD32_MARGINS_IN_MILLIMETERS "Kıyılıklar (mm olarak)" @@ -126,13 +126,13 @@ STRINGTABLE /* Color names */ IDS_COLOR_YELLOW "Sarı" IDS_COLOR_BLUE "Mâvi" IDS_COLOR_FUCHSIA "Küpe Çiçeği" - IDS_COLOR_AQUA "Firûze" + IDS_COLOR_AQUA "Turkuaz" IDS_COLOR_WHITE "Ak" } STRINGTABLE { - IDS_FONT_SIZE "%1!d! ile %2!d! arasında bir yazı türü büyüklüğü seçiniz." + IDS_FONT_SIZE "%1!d! ile %2!d! arasında bir yazı tipi büyüklüğü seçiniz." IDS_SAVE_BUTTON "&Kaydet" IDS_SAVE_IN "K&ayıt Yeri:" IDS_SAVE "Kaydet" @@ -217,7 +217,7 @@ CAPTION "Yazdırma Ayarları" FONT 8, "MS Shell Dlg" { GROUPBOX "Yazıcı", grp1, 6, 6, 180, 72, BS_GROUPBOX - RADIOBUTTON "&Öntanımlı Yazıcı", rad1, 16, 16, 150, 12 + RADIOBUTTON "&Ön Tanımlı Yazıcı", rad1, 16, 16, 150, 12 LTEXT "[Yok]", stc1, 35, 30, 120, 9 RADIOBUTTON "&Husûsî Yazıcı", rad2, 16, 44, 150, 12 COMBOBOX cmb1, 35, 58, 145, 68, CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | CBS_AUTOHSCROLL | CBS_SORT | CBS_HASSTRINGS | WS_BORDER | WS_VSCROLL | WS_TABSTOP @@ -239,13 +239,13 @@ FONT 8, "MS Shell Dlg" CHOOSE_FONT DIALOG 13, 54, 274, 147 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Yazı Türü" +CAPTION "Yazı Tipi" FONT 8, "MS Shell Dlg" { - LTEXT "Ya&zı Türü:",stc1 ,6,3,90,9 + LTEXT "Ya&zı Tipi:",stc1 ,6,3,90,9 COMBOBOX cmb1, 6,13,94,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE - LTEXT "Yaz&ı Türü Biçemi:",stc2 ,108,3,60,9 + LTEXT "Yaz&ı Tipi Biçemi:",stc2 ,108,3,60,9 COMBOBOX cmb2,108,13,64,54, CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | CBS_DISABLENOSCROLL | WS_VSCROLL | WS_TABSTOP | CBS_SIMPLE LTEXT "&Büyüklük:",stc3,179,3,32,9 @@ -311,7 +311,7 @@ FONT 8, "MS Shell Dlg" LTEXT "A&ranacak:", -1, 4, 8, 52, 8 EDITTEXT edt1, 57, 7, 148, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP CHECKBOX "Ya&lnızca Dizginin Tümünü Ara", chx1, 4, 26, 140, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "&Büyük ya da Küçük Hârf Duyarlılığı", chx2, 4, 42, 140, 12, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "&Büyük ya da Küçük Harf Duyarlılığı", chx2, 4, 42, 140, 12, BS_AUTOCHECKBOX | WS_TABSTOP GROUPBOX "Yön", grp1, 147, 21, 58, 38 CONTROL "Y&ukarı", rad1, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 151, 30, 48, 12 CONTROL "&Aşağı", rad2, "BUTTON", BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 151, 44, 48, 12 @@ -332,7 +332,7 @@ FONT 8, "MS Shell Dlg" LTEXT "Y&eni Dizgi:", -1, 4, 26, 52, 8 EDITTEXT edt2, 57, 24, 148, 12, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP CHECKBOX "Ya&lnızca Dizginin Tümünü Ara", chx1, 5, 46, 120, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP - CHECKBOX "&Büyük ya da Küçük Hârf Duyarlılığı", chx2, 5, 62, 120, 12, BS_AUTOCHECKBOX | WS_TABSTOP + CHECKBOX "&Büyük ya da Küçük Harf Duyarlılığı", chx2, 5, 62, 120, 12, BS_AUTOCHECKBOX | WS_TABSTOP DEFPUSHBUTTON "Sonrakini Ara", IDOK, 212, 6, 60, 14, WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON PUSHBUTTON "&Değiştir", psh1 , 212, 24, 60, 14, WS_GROUP | WS_TABSTOP @@ -366,8 +366,8 @@ FONT 8, "MS Shell Dlg" LTEXT "Açıklama:", stc9, 16, 72, 47,10, SS_NOPREFIX LTEXT "", stc13, 65, 72, 212,10, SS_NOPREFIX | SS_LEFTNOWORDWRAP - GROUPBOX "Sûretler", grp2, 160, 92, 120,64, WS_GROUP - LTEXT "Sû&ret Sayısı:",stc5,168,105,68,8 + GROUPBOX "Kopyalar", grp2, 160, 92, 120,64, WS_GROUP + LTEXT "&Kopya Sayısı:",stc5,168,105,68,8 ICON "", ico3, 170,131, 76,24, WS_GROUP | SS_CENTERIMAGE CONTROL "H&armanla", chx2,"Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,168,118,100,12 EDITTEXT edt3, 240,103, 32,12, WS_GROUP | ES_NUMBER @@ -464,7 +464,7 @@ FONT 8, "MS Shell Dlg" LTEXT "K&ütük Türü:",IDC_FILETYPESTATIC,5,130,56,16, SS_NOTIFY COMBOBOX IDC_FILETYPE,63,128,150,53,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "&Salt Okunur Olarak Aç",IDC_OPENREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63,148,150,10 + CONTROL "Y&alnızca Okunur Olarak Aç",IDC_OPENREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63,148,150,10 DEFPUSHBUTTON "Aç", IDOK,222,110,54,14 PUSHBUTTON "İptal", IDCANCEL,222,128,54,14 diff --git a/reactos/dll/win32/credui/lang/credui_Tr.rc b/reactos/dll/win32/credui/lang/credui_Tr.rc index 3fc1fa2afaf..e2d070d33c5 100644 --- a/reactos/dll/win32/credui/lang/credui_Tr.rc +++ b/reactos/dll/win32/credui/lang/credui_Tr.rc @@ -1,7 +1,7 @@ /* * Turkish language resource file for Credentials UI * - * Copyright: 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyright: 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -47,6 +47,6 @@ STRINGTABLE IDS_MESSAGEFORMAT "Bağlanıyor: %s" IDS_INCORRECTPASSWORDTITLE "Oturum açma başarısız oldu." IDS_INCORRECTPASSWORD "Kullanıcı adınızın ve şifrenizin\ndoğrulundan emin olunuz." - IDS_CAPSLOCKONTITLE "Büyük Hârf Kilidi açık." - IDS_CAPSLOCKON "Büyük Hârf Kilidi'nin açık olması girdiğiniz şifrenin yanlış olmasına neden olabilir.\n\nŞifrenizi girmeden önce Büyük Hârf Kilidi'ni kapatmak için düğme takımınızdaki Büyük Hârf Kilidi düğmesine basınız." + IDS_CAPSLOCKONTITLE "Büyük Harf Kilidi açık." + IDS_CAPSLOCKON "Büyük Harf Kilidi'nin açık olması girdiğiniz şifrenin yanlış olmasına neden olabilir.\n\nŞifrenizi girmeden önce Büyük Harf Kilidi'ni kapatmak için düğme takımınızdaki Büyük Harf Kilidi düğmesine basınız." } diff --git a/reactos/dll/win32/crypt32/lang/crypt32_Tr.rc b/reactos/dll/win32/crypt32/lang/crypt32_Tr.rc index dc2d15ab2f6..dd8e0ecbaed 100644 --- a/reactos/dll/win32/crypt32/lang/crypt32_Tr.rc +++ b/reactos/dll/win32/crypt32/lang/crypt32_Tr.rc @@ -56,7 +56,7 @@ STRINGTABLE IDS_CA_ISSUER "Onaylama Yetkilisi Dağıtıcısı" IDS_CERT_TEMPLATE_NAME "Onay Belgesi Örnek Adı" IDS_CERT_TYPE "Onay Belgesi Türü" - IDS_CERT_MANIFOLD "Onay Belgesi Sûreti" + IDS_CERT_MANIFOLD "Onay Belgesi Kopyası" IDS_NETSCAPE_CERT_TYPE "Netscape Onay Belgesi Türü" IDS_NETSCAPE_BASE_URL "Netscape Tabanlı URL" IDS_NETSCAPE_REVOCATION_URL "Netscape İptal URL'si" @@ -73,7 +73,7 @@ STRINGTABLE IDS_STATE_OR_PROVINCE "İl veyâ Eyâlet" IDS_TITLE "Başlık" IDS_GIVEN_NAME "Verilen Ad" - IDS_INITIALS "Baş Hârfleri" + IDS_INITIALS "Baş Harfleri" IDS_SUR_NAME "Soyadı" IDS_DOMAIN_COMPONENT "Etki Alanı Bileşeni" IDS_STREET_ADDRESS "Sokak Adresi" @@ -158,7 +158,7 @@ STRINGTABLE IDS_FILE_RECOVERY "Kütük Kurtarma" IDS_ROOT_LIST_SIGNER "Kök Dizelgesi İmzâlayıcısı" IDS_ANY_APPLICATION_POLICIES "Tüm Uygulama İlkeleri" - IDS_DS_EMAIL_REPLICATION "Dizin Hizmeti E-Posta Sûreti" + IDS_DS_EMAIL_REPLICATION "Dizin Hizmeti E-Posta Kopyası" IDS_ENROLLMENT_AGENT "Onay Belgesi İstek Yardımcısı" IDS_LIFETIME_SIGNING "Yaşam Boyu İmzâlama" IDS_ANY_CERT_POLICY "Tüm Yayımlama İlkeleri" diff --git a/reactos/dll/win32/cryptui/lang/cryptui_Tr.rc b/reactos/dll/win32/cryptui/lang/cryptui_Tr.rc index 9ec86034f09..1ea47233de8 100644 --- a/reactos/dll/win32/cryptui/lang/cryptui_Tr.rc +++ b/reactos/dll/win32/cryptui/lang/cryptui_Tr.rc @@ -73,20 +73,20 @@ STRINGTABLE IDS_IMPORT_FILE_SUBTITLE "Almak istediğiniz kütüğü belirtiniz." IDS_IMPORT_STORE_TITLE "Onay Belgesi Deposu" IDS_IMPORT_STORE_SUBTITLE "Onay belgesi depoları; onay belgelerinden, onay belgesi iptal dizelgelerinden ve onay belgesi güven dizelgelerinden oluşan derlemlerdir." - IDS_IMPORT_FILTER_CERT "X.509 Onay Belgesi (*.cer; *.crt)" - IDS_IMPORT_FILTER_PFX "Şahsî Bilgi Değiştirmesi (*.pfx; *.p12)" + IDS_IMPORT_FILTER_CERT "X.509 Onay Belgesi (*.cer, *.crt)" + IDS_IMPORT_FILTER_PFX "Şahsî Bilgi Değiştirmesi (*.pfx, *.p12)" IDS_IMPORT_FILTER_CRL "Onay Belgesi İptal Dizelgesi (*.crl)" IDS_IMPORT_FILTER_CTL "Onay Belgesi Güven Dizelgesi (*.stl)" IDS_IMPORT_FILTER_SERIALIZED_STORE "Microsoft Dizilendirilmiş Onay Belgesi Deposu (*.sst)" - IDS_IMPORT_FILTER_CMS "CMS/PKCS #7 İletileri (*.spc; *.p7b)" + IDS_IMPORT_FILTER_CMS "CMS/PKCS #7 İletileri (*.spc, *.p7b)" IDS_IMPORT_FILTER_ALL "Tüm Kütükler (*.*)" IDS_IMPORT_EMPTY_FILE "Bir kütük seçiniz." IDS_IMPORT_BAD_FORMAT "Bu kütük biçimi tanınmış değil. Başka bir kütük seçiniz." IDS_IMPORT_OPEN_FAILED "Açılmadı." - IDS_IMPORT_DEST_DETERMINED "Çizeylem eliyle karar verildi." + IDS_IMPORT_DEST_DETERMINED "İzlence eliyle karar verildi." IDS_IMPORT_SELECT_STORE "Bir depo seçiniz." IDS_IMPORT_STORE_SELECTION "Onay belgesi deposu seçildi." - IDS_IMPORT_DEST_AUTOMATIC "Çizeylem eliyle kendilğinden karar verildi." + IDS_IMPORT_DEST_AUTOMATIC "İzlence eliyle kendilğinden karar verildi." IDS_IMPORT_FILE "Kütük" IDS_IMPORT_CONTENT "İçerik" IDS_IMPORT_CONTENT_CERT "Onay Belgesi" @@ -107,27 +107,27 @@ STRINGTABLE IDS_ALLOWED_PURPOSE_ALL "" IDS_ALLOWED_PURPOSE_NONE "" IDS_WARN_REMOVE_MY "Artık bu onay belgesiyle, iletileri çözemeyeceksiniz veyâ iletileri imzâlayamayacaksınız.\n\ -Bu onay belgesini silmeyi onaylıyor musunuz?" +Bu onay belgesini silmeyi doğruluyor musunuz?" IDS_WARN_REMOVE_PLURAL_MY "Artık bu onay belgeleriyle, iletileri çözemeyeceksiniz veyâ iletileri imzâlayamayacaksınız.\n\ -Bu onay belgelerini silmeyi onaylıyor musunuz?" +Bu onay belgelerini silmeyi doğruluyor musunuz?" IDS_WARN_REMOVE_ADDRESSBOOK "Artık bu onay belgesiyle, iletileri şifreleyemeyeceksiniz veyâ imzâlanmış iletileri doğrulayamayacaksınız.\n\ -Bu onay belgesini silmeyi onaylıyor musunuz?" +Bu onay belgesini silmeyi doğruluyor musunuz?" IDS_WARN_REMOVE_PLURAL_ADDRESSBOOK "Artık bu onay belgeleriyle, iletileri şifreleyemeyeceksiniz veyâ imzâlanmış iletileri doğrulayamayacaksınız.\n\ -Bu onay belgelerini silmeyi onaylıyor musunuz?" +Bu onay belgelerini silmeyi doğruluyor musunuz?" IDS_WARN_REMOVE_CA "Artık bu onaylama yetkilisiyle dağıtılan onay belgeleri güvenilir olmayacaktır.\n\ -Bu onay belgesini silmeyi onaylıyor musunuz?" +Bu onay belgesini silmeyi doğruluyor musunuz?" IDS_WARN_REMOVE_PLURAL_CA "Artık bu onaylama yetkilileriyle dağıtılan onay belgeleri güvenilir olmayacaktır.\n\ -Bu onay belgelerini silmeyi onaylıyor musunuz?" +Bu onay belgelerini silmeyi doğruluyor musunuz?" IDS_WARN_REMOVE_ROOT "Artık, bu kök onaylama yetkilisiyle dağıtılan onay belgeleri ve dağıtan bu onaylama yetkilisi güvenilir olmayacaktır.\n\ -Bu güvenilir kök onay belgesini silmeyi onaylıyor musunuz?" +Bu güvenilir kök onay belgesini silmeyi doğruluyor musunuz?" IDS_WARN_REMOVE_PLURAL_ROOT "Artık, bu kök onaylama yetkilileriyle dağıtılan onay belgeleri ve dağıtan bu onaylama yetkilileri güvenilir olmayacaktır.\n\ -Bu güvenilir kök onay belgelerini silmeyi onaylıyor musunuz?" +Bu güvenilir kök onay belgelerini silmeyi doğruluyor musunuz?" IDS_WARN_REMOVE_TRUSTEDPUBLISHER "Artık, bu yayımcının imzâladığı yazılım güvenilir olmayacaktır.\n\ -Bu onay belgesini silmeyi onaylıyor musunuz?" +Bu onay belgesini silmeyi doğruluyor musunuz?" IDS_WARN_REMOVE_PLURAL_TRUSTEDPUBLISHER "Artık, bu yayımcılarnın imzâladığı yazılım güvenilir olmayacaktır.\n\ -Bu onay belgelerini silmeyi onaylıyor musunuz?" - IDS_WARN_REMOVE_DEFAULT "Bu onay belgesini silmeyi onaylıyor musunuz?" - IDS_WARN_REMOVE_PLURAL_DEFAULT "Bu onay belgelerini silmeyi onaylıyor musunuz?" +Bu onay belgelerini silmeyi doğruluyor musunuz?" + IDS_WARN_REMOVE_DEFAULT "Bu onay belgesini silmeyi doğruluyor musunuz?" + IDS_WARN_REMOVE_PLURAL_DEFAULT "Bu onay belgelerini silmeyi doğruluyor musunuz?" IDS_CERT_MGR "Onay Belgeleri" IDS_FRIENDLY_NAME_NONE "" IDS_PURPOSE_SERVER_AUTH "Uzaktaki bilgisayarın kimliğini sağlar." @@ -135,7 +135,7 @@ Bu onay belgelerini silmeyi onaylıyor musunuz?" IDS_PURPOSE_CODE_SIGNING "Yazılım yayımcısından gelen yazılımı korur.\n\ Yazılımı yayımlamadan sonraki değişikliklerden korur." IDS_PURPOSE_EMAIL_PROTECTION "E-posta iletilerini korur." - IDS_PURPOSE_IPSEC "Örütbağ üzerinden güvenli iletişim sağlar." + IDS_PURPOSE_IPSEC "Umûmî Ağ üzerinden güvenli iletişim sağlar." IDS_PURPOSE_TIMESTAMP_SIGNING "Verilerin şimdiki zamanla imzâlanmasını sağlar." IDS_PURPOSE_CTL_USAGE_SIGNING "Onay belgesi güven dizelgesini sayılık olarak imzâlamanızı sağlar." IDS_PURPOSE_EFS "Diskteki verilerin şifrelenmesini sağlar." @@ -156,7 +156,7 @@ Yazılımı yayımlamadan sonraki değişikliklerden korur." IDS_PURPOSE_SMARTCARD_LOGON "Akıllı Kart ile Oturum Açma" IDS_PURPOSE_CA_EXCHANGE "Husûsî Anahtar Belgelikliği" IDS_PURPOSE_KEY_RECOVERY_AGENT "Anahtar Kurtarma Yardımcısı" - IDS_PURPOSE_DS_EMAIL_REPLICATION "Dizin Hizmeti E-Posta Sûreti" + IDS_PURPOSE_DS_EMAIL_REPLICATION "Dizin Hizmeti E-Posta Kopyası" IDS_EXPORT_WIZARD "Onay Belgesi Verme Yardımcısı" IDS_EXPORT_FORMAT_TITLE "Verme Biçimi" IDS_EXPORT_FORMAT_SUBTITLE "İçeriğin kaydedileceği biçimi seçiniz." diff --git a/reactos/dll/win32/devmgr/lang/tr-TR.rc b/reactos/dll/win32/devmgr/lang/tr-TR.rc index 9a2716d83a8..ce943da5a0d 100644 --- a/reactos/dll/win32/devmgr/lang/tr-TR.rc +++ b/reactos/dll/win32/devmgr/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -56,7 +56,7 @@ BEGIN IDS_DEV_LIAR "ReactOS, bu aygıtı başlatırken yanıt vermeyi durdurdu, bu yüzden bu aygıt bir daha başlatılmayacak." IDS_DEV_NORMAL_CONFLICT "Bu aygıt, kullanmak için hiç boş %1 kaynaklarını bulamıyor." IDS_DEV_NOT_VERIFIED "Bu aygıt ya yok, ya düzgün çalışmıyor, ya da bu aygıtın kurulu tüm sürücüleri yok." - IDS_DEV_NEED_RESTART "Bu aygıt bilgisayarınızı yeniden başlatana kadar düzgün çalışamaz." + IDS_DEV_NEED_RESTART "Bu aygıt bilgisayarınızı yeniden başlatana dek düzgün çalışamaz." IDS_DEV_REENUMERATION "Bu aygıt, kaynak çakışmasına neden oldu." IDS_DEV_PARTIAL_LOG_CONF "ReactOS, bu aygıtın kullandığı tüm kaynakları tanılayamadı." IDS_DEV_UNKNOWN_RESOURCE "%1 sürücü bilgi kütüğü, bu alt aygıtın, bu üst aygıtın iye olmadığı ya da tanımadığı kaynağı kullandığını gösteriyor." @@ -80,7 +80,7 @@ BEGIN IDS_DEV_TRANSLATION_FAILED "Bu aygıt sürücüsüne yanıt vermiyor." IDS_DEV_NO_SOFTCONFIG "ReactOS, bu aygıtın ayarlarını belirleyemiyor. Bu aygıtla gelen belgelere bakınız ve yapılandırmayı ayarlamak için ""Kaynaklar"" sekmesini kullanınız." IDS_DEV_BIOS_TABLE "Bilgisayarınızın dizge bellenimi, bu aygıtı, düzgün olarak, yapılandırmak ve kullanmak için yeterli bilgi içermiyor.\nBu aygıtı kullanmak için, bellenim veyâ BIOS güncellemesi elde etmek için bilgisayarınızın üreticisiyle iletişime geçiniz." - IDS_DEV_IRQ_TRANSLATION_FAILED "Bu aygıt, bir PCI kesmesi istemektedir ancak bir ISA kesmesi için yapılandırılmıştır (ya da tersi).\nBu aygıtın kesmesini yapılandırmak için bilgisayarın dizge kurulum çizeylemini kullanınız." + IDS_DEV_IRQ_TRANSLATION_FAILED "Bu aygıt, bir PCI kesmesi istemektedir ancak bir ISA kesmesi için yapılandırılmıştır (ya da tersi).\nBu aygıtın kesmesini yapılandırmak için bilgisayarın dizge kurulum izlencesini kullanınız." IDS_DEV_FAILED_DRIVER_ENTRY "ReactOS, bu donanımın aygıt sürücüsünü başlatamıyor." IDS_DEV_DRIVER_FAILED_PRIOR_UNLOAD "ReactOS, bellekte hâlâ aygıt sürücüsünün bir önceki tıpkısı olduğundan dolayı bu donanımın aygıt sürücüsünü yükleyemiyor." IDS_DEV_DRIVER_FAILED_LOAD "ReactOS, bu donanımın aygıt sürücüsünü yükleyemiyor. Sürücü eksik ya da bozulmuş olabilir." @@ -93,7 +93,7 @@ BEGIN IDS_DEV_SYSTEM_SHUTDOWN "ReactOS, işletim dizgesinin kapatma işleminde olmasından dolayı bu donanım aygıtının erişimini elde edemiyor." IDS_DEV_HELD_FOR_EJECT "ReactOS, bu donanım aygıtının, güvenli kaldırılmaya anıklandığından ancak bilgisayardan kaldırılmadığından dolayı onu kullanamıyor." IDS_DEV_DRIVER_BLOCKED "Bu aygıtın yazılımı, ReactOS'la sorunları olduğu bilindiğinden dolayı başlatmaktan engellendi. Yeni bir donanım için donanımın satıcısıyla iletişime geçiniz." - IDS_DEV_REGISTRY_TOO_LARGE "ReactOS, dizge yığınının çok büyük olmasından dolayı yeni donanım aygıtlarını başlatamıyor. (Değer Defteri Büyüklük Sınırı'nı aşar.)" + IDS_DEV_REGISTRY_TOO_LARGE "ReactOS, dizge yığınının çok büyük olmasından dolayı yeni donanım aygıtlarını başlatamıyor. (Değer Defteri Büyüklük Hudûdu'nu aşar.)" IDS_DEV_SETPROPERTIES_FAILED "ReactOS, bu aygıtın ayarlarını değiştiremez." END @@ -176,7 +176,7 @@ BEGIN LTEXT "Sürücü İmzâlayıcısı:", -1, 37, 81, 60, 8, SS_NOPREFIX EDITTEXT IDC_DIGITALSIGNER, 100, 81, 145, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY PUSHBUTTON "&Sürücü Ayrıntıları...", IDC_DRIVERDETAILS, 7, 106, 75, 15 - LTEXT "Sürücü kütükleri hakkında ayrıntıları görmek için.", -1, 91, 110, 154, 17, SS_NOPREFIX + LTEXT "Sürücü kütükleri üzerine ayrıntıları görmek için.", -1, 91, 110, 154, 17, SS_NOPREFIX PUSHBUTTON "S&ürücüyü Şimdikileştir...", IDC_UPDATEDRIVER, 7, 126, 75, 15 LTEXT "Bu aygıtın sürücüsünü şimdikileştir.", -1, 91, 130, 154, 17, SS_NOPREFIX END diff --git a/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc b/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc index 4c4a6daccfb..806e5e3e694 100644 --- a/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc +++ b/reactos/dll/win32/hhctrl.ocx/lang/Tr.rc @@ -2,7 +2,7 @@ * HTML Help resources * Turkish Language Support * - * Copyrights: 2006 - Fatih Aşıcı (fasici@linux-sevenler.org), 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyrights: 2006 Fatih Aşıcı (fasici@linux-sevenler.org), 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/iccvid/lang/iccvid_Tr.rc b/reactos/dll/win32/iccvid/lang/iccvid_Tr.rc index f24b5b6717a..c0a60dcb412 100644 --- a/reactos/dll/win32/iccvid/lang/iccvid_Tr.rc +++ b/reactos/dll/win32/iccvid/lang/iccvid_Tr.rc @@ -1,5 +1,5 @@ /* - * Copyrights: 2006 - Fatih Aşıcı, 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyrights: 2006 Fatih Aşıcı, 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/jscript/lang/jscript_Tr.rc b/reactos/dll/win32/jscript/lang/jscript_Tr.rc new file mode 100644 index 00000000000..22db53e1b8e --- /dev/null +++ b/reactos/dll/win32/jscript/lang/jscript_Tr.rc @@ -0,0 +1,45 @@ +/* + * Copyright: 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT + +STRINGTABLE +{ + IDS_TO_PRIMITIVE "Nesneyi ilk türe dönüştürürken yanlışlık oldu." + IDS_INVALID_CALL_ARG "Geçersiz yordam çağrısı ya da geçersiz değiştirgen." + IDS_CREATE_OBJ_ERROR "Öz devinim sunucusu nesne oluşturamadı." + IDS_NO_PROPERTY "Nesne bu husûsiyeti/yöntemi desteklemiyor." + IDS_ARG_NOT_OPT "Değiştirgen, isteğe bağlı değil." + IDS_SYNTAX_ERROR "Yazım yanlışlığı." + IDS_SEMICOLON """;"" bekleniyordu." + IDS_LBRACKET """("" bekleniyordu." + IDS_RBRACKET """)"" bekleniyordu." + IDS_UNTERMINATED_STR "Sonlandırılmamış dizgi değişmezi." + IDS_NOT_FUNC "İşleç bekleniyordu." + IDS_NOT_DATE """[nesne]"" bir zaman nesnesi değil." + IDS_NOT_NUM "Sayı bekleniyordu." + IDS_OBJECT_EXPECTED "Nesne bekleniyordu." + IDS_ILLEGAL_ASSIGN "Geçersiz atama." + IDS_UNDEFINED """|"" tanımlanmamış." + IDS_NOT_BOOL "Boolean nesnesi bekleniyordu." + IDS_JSCRIPT_EXPECTED "JScript nesnesi bekleniyordu." + IDS_REGEXP_SYNTAX_ERROR "Düzenli deyişte yazım yanlışlığı." + IDS_URI_INVALID_CHAR "Şifrelenmiş URI geçersiz damgalar içeriyor." + IDS_INVALID_LENGTH "Dizi büyüklüğü sonlu artı tam sayı olmalı." + IDS_ARRAY_EXPECTED "Dizi nesnesi bekleniyordu." +} diff --git a/reactos/dll/win32/jscript/rsrc.rc b/reactos/dll/win32/jscript/rsrc.rc index 033d8ba82cc..2caffa91e77 100644 --- a/reactos/dll/win32/jscript/rsrc.rc +++ b/reactos/dll/win32/jscript/rsrc.rc @@ -96,6 +96,9 @@ #ifdef LANGUAGE_SQ_AL #include "lang/jscript_Sq.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "lang/jscript_Tr.rc" +#endif #ifdef LANGUAGE_UK_UA #include "lang/jscript_Uk.rc" #endif diff --git a/reactos/dll/win32/kernel32/kernel32.rc b/reactos/dll/win32/kernel32/kernel32.rc index 3b0105424ec..6afdc0cc661 100644 --- a/reactos/dll/win32/kernel32/kernel32.rc +++ b/reactos/dll/win32/kernel32/kernel32.rc @@ -31,6 +31,9 @@ #ifdef LANGUAGE_RU_RU #include "winnls/lang/ru-RU.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "winnls/lang/tr-TR.rc" +#endif #ifdef LANGUAGE_UK_UA #include "winnls/lang/uk-UA.rc" #endif diff --git a/reactos/dll/win32/kernel32/winnls/lang/tr-TR.rc b/reactos/dll/win32/kernel32/winnls/lang/tr-TR.rc new file mode 100644 index 00000000000..5df45e85745 --- /dev/null +++ b/reactos/dll/win32/kernel32/winnls/lang/tr-TR.rc @@ -0,0 +1,165 @@ +/* TRANSLATOR: 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ + +#pragma code_page(1252) + +LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT + +STRINGTABLE +BEGIN + /* Names of code pages */ + 1250 "1250 (ANSI - Merkezî Avrupa)" + 1251 "1251 (ANSI - Kiril)" + 1252 "1252 (ANSI - Latin I)" + 1253 "1253 (ANSI - Yunanca)" + 1254 "1254 (ANSI - Türkçe)" + 1255 "1255 (ANSI - İbrânice)" + 1256 "1256 (ANSI - Arapça)" + 1257 "1257 (ANSI - Baltık)" + 1258 "1258 (ANSI/OEM - Vietnam)" + 874 "874 (ANSI/OEM - Tayca)" + 932 "932 (ANSI/OEM - Japonca Üst Damga-JIS)" + 936 "936 (ANSI/OEM - Bayağılaştırılmış Çince GBK)" + 949 "949 (ANSI/OEM - Korece)" + 950 "950 (ANSI/OEM - Geleneklik Çince Big5)" + + 437 "437 (OEM - Amerika Birleşik Devletleri)" + 737 "737 (OEM - Yunanca 437G)" + 775 "775 (OEM - Baltık)" + 850 "850 (OEM - Çok Dilli Latin I)" + 852 "852 (OEM - Latin II)" + 855 "855 (OEM - Kiril)" + 857 "857 (OEM - Türkçe)" + 858 "858 (OEM - Çok Dilli Latin I + Avro)" + 860 "860 (OEM - Portekizce)" + 861 "861 (OEM - İzlandaca)" + 862 "862 (OEM - İbrânice)" + 863 "863 (OEM - Kanada Fransızcası)" + 864 "864 (OEM - Arapça)" + 865 "865 (OEM - Nordik)" + 866 "866 (OEM - Rusça)" + 869 "869 (OEM - Çağdaş Yunanca)" + + 10000 "10000 (MAC - Roma)" + 10001 "10001 (MAC - Japonca)" + 10002 "10002 (MAC - Geleneklik Çince Big5)" + 10003 "10003 (MAC - Korece)" + 10004 "10004 (MAC - Arapça)" + 10005 "10005 (MAC - İbrânice)" + 10006 "10006 (MAC - Yunanca I)" + 10007 "10007 (MAC - Kiril)" + 10008 "10008 (MAC - Bayağılaştırılmış Çince GB 2312)" + 10010 "10010 (MAC - Romanya)" + 10017 "10017 (MAC - Ukrayna)" + 10021 "10021 (MAC - Tayca)" + 10029 "10029 (MAC - Latin II)" + 10079 "10079 (MAC - İzlandaca)" + 10081 "10081 (MAC - Türkçe)" + 10082 "10082 (MAC - Hırvatistan)" + + 65000 "65000 (UTF-7)" + 65001 "65001 (UTF-8)" + + 3700 "37 (IBM EBCDIC - ABD/Kanada)" /* FIXME */ + 1026 "1026 (IBM EBCDIC - Türkçe (Latin-5))" + 1047 "1047 (IBM EBCDIC - Latin-1/Açık Dizge)" + 1140 "1140 (IBM EBCDIC - ABD/Kanada (37 + Avro))" + 1141 "1141 (IBM EBCDIC - Almanya (20273 + Avro))" + 1142 "1142 (IBM EBCDIC - Danimarka/Norveç (20277 + Avro))" + 1143 "1143 (IBM EBCDIC - Finlandiya/İsveç (20278 + Avro))" + 1144 "1144 (IBM EBCDIC - İtalya (20280 + Avro))" + 1145 "1145 (IBM EBCDIC - Latin Amerika/İspanya (20284 + Avro))" + 1146 "1146 (IBM EBCDIC - Birleşik Krallık (20285 + Avro))" + 1147 "1147 (IBM EBCDIC - Fransa (20297 + Avro))" + 1148 "1148 (IBM EBCDIC - Uluslararası (500 + Avro))" + 1149 "1149 (IBM EBCDIC - İzlandaca (20871 + Avro))" + 20273 "20273 (IBM EBCDIC - Almanya)" + 20277 "20277 (IBM EBCDIC - Danimarka/Norveç)" + 20278 "20278 (IBM EBCDIC - Finlandiya/İsveç)" + 20280 "20280 (IBM EBCDIC - İtalya)" + 20284 "20284 (IBM EBCDIC - Latin Amerika/İspanya)" + 20285 "20285 (IBM EBCDIC - Birleşik Krallık)" + 20290 "20290 (IBM EBCDIC - Japonca Katakana Genişletilmiş)" + 20297 "20297 (IBM EBCDIC - Fransa)" + 20420 "20420 (IBM EBCDIC - Arapça)" + 20423 "20423 (IBM EBCDIC - Yunanca)" + 20424 "20424 (IBM EBCDIC - İbrânice)" + 20833 "20833 (IBM EBCDIC - Korece Genişletilmiş)" + 20838 "20838 (IBM EBCDIC - Tayca)" + 20871 "20871 (IBM EBCDIC - İzlandaca)" + 20880 "20880 (IBM EBCDIC - Kiril (Rusça))" + 20905 "20905 (IBM EBCDIC - Türkçe)" + 20924 "20924 (IBM EBCDIC - Latin-1/Açık Dizge (1047 + Avro))" + 21025 "21025 (IBM EBCDIC - Kiril (Sırpça, Bulgarca))" + 500 "500 (IBM EBCDIC - Uluslararası)" + 870 "870 (IBM EBCDIC - Çok Dilli/ROECE (Latin-2))" + 875 "875 (IBM EBCDIC - Çağdaş Yunanca)" + + 20269 "20269 (ISO 6937 Aralıksız Vurgu)" + 28591 "28591 (ISO 8859-1 Latin I)" + 28592 "28592 (ISO 8859-2 Merkezî Avrupa)" + 28593 "28593 (ISO 8859-3 Latin 3)" + 28594 "28594 (ISO 8859-4 Baltık)" + 28595 "28595 (ISO 8859-5 Kiril)" + 28596 "28596 (ISO 8859-6 Arapça)" + 28597 "28597 (ISO 8859-7 Yunanca)" + 28598 "28598 (ISO 8859-8 İbrânice: Basarî Sıralama)" + 28599 "28599 (ISO 8859-9 Latin 5)" + 28605 "28605 (ISO 8859-15 Latin 9)" + 38598 "38598 (ISO 8859-8 İbrânice: Mantıklık Sıralama)" + + 20105 "20105 (IA5 IRV Uluslararası Harflik Nu: 5)" + 20106 "20106 (IA5 Almanca)" + 20107 "20107 (IA5 İsveççe)" + 20108 "20108 (IA5 Norveççe)" + + 1361 "1361 (Korece - Johab)" + 20000 "20000 (CNS - Tayland)" + 20001 "20001 (TCA - Tayland)" + 20002 "20002 (Eten - Tayland)" + 20003 "20003 (IBM5550 - Tayland)" + 20004 "20004 (TeleTekst - Tayland)" + 20005 "20005 (Vang - Tayland)" + 20127 "20127 (US-ASCII)" + 20261 "20261 (T.61)" + 20866 "20866 (Rusça - KOI8)" + 21027 "21027 (Genişletilmiş Alfa Küçük Harf)" + 21866 "21866 (Ukraynaca - KOI8-U)" + 708 "708 (Arapça - ASMO)" + 720 "720 (Arapça - Açık ASMO)" + 20932 "20932 (JIS X 0208-1990 & 0212-1990)" + 20936 "20936 (Bayağılaştırılmış Çince GB2312)" + 20949 "20949 (Korece Vansung)" + + 57002 "57002 (ISCII Devanagari Harfliği)" + 57003 "57003 (ISCII Bengalce)" + 57004 "57004 (ISCII Tâmilce)" + 57005 "57005 (ISCII Telugu Dili)" + 57006 "57006 (ISCII Assamca)" + 57007 "57007 (ISCII Oriya Dili)" + 57008 "57008 (ISCII Kannada Dili)" + 57009 "57009 (ISCII Malayalam Dili)" + 57010 "57010 (ISCII Gucaratça)" + 57011 "57011 (ISCII Gurmukhi Dili)" + + 50930 "50930 (IBM EBCDIC - Japonca Katakana Genişletilmiş ve Japonca)" + 50931 "50931 (IBM EBCDIC - ABD/Kanada ve Japonca)" + 50933 "50933 (IBM EBCDIC - Korece Genişletilmiş ve Korece)" + 50935 "50935 (IBM EBCDIC - Bayağılaştırılmış Çince)" + 50937 "50937 (IBM EBCDIC - ABD/Kanada ve Geleneklik Çince)" + 50939 "50939 (IBM EBCDIC - Japonca Latin Genişletlmiş ve Japonca)" + + 50220 "50220 (ISO-2022 Japonca (yarım genişlikte olmayan Katakana ile))" + 50221 "50221 (ISO-2022 Japonca (yarım genişlikteki Katakana ile))" + 50222 "50222 (ISO-2022 Japonca JIS X 0201-1989)" + 50225 "50225 (ISO-2022 Korece)" + 50227 "50227 (ISO-2022 Bayağılaştırılmış Çince)" + 50229 "50229 (ISO-2022 Geleneklik Çince)" + + 51932 "51932 (EUC-Japonca)" + 51936 "51936 (EUC-Bayağılaştırılmış Çince)" + 51949 "51949 (EUC-Korece)" + 51950 "51950 (EUC-Geleneklik Çince)" + + 52936 "52936 (HZ-GB2312 Bayağılaştırılmış Çince)" + 54936 "54936 (GB18030 Bayağılaştırılmış Çince)" +END diff --git a/reactos/dll/win32/localspl/lang/spl_Tr.rc b/reactos/dll/win32/localspl/lang/spl_Tr.rc new file mode 100644 index 00000000000..2a9f96f95d1 --- /dev/null +++ b/reactos/dll/win32/localspl/lang/spl_Tr.rc @@ -0,0 +1,27 @@ +/* + * Turkish resources for localspl + * + * Copyright: 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT + +STRINGTABLE +{ + IDS_LOCALPORT "Yerli Giriş" + IDS_LOCALMONITOR "Yerli İzleyici" +} diff --git a/reactos/dll/win32/localspl/localspl.rc b/reactos/dll/win32/localspl/localspl.rc index 5c1b002929e..e7d3a4e3d20 100644 --- a/reactos/dll/win32/localspl/localspl.rc +++ b/reactos/dll/win32/localspl/localspl.rc @@ -95,6 +95,9 @@ #ifdef LANGUAGE_SQ_AL #include "lang/spl_Sq.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "lang/spl_Tr.rc" +#endif #ifdef LANGUAGE_UK_UA #include "lang/spl_Uk.rc" #endif diff --git a/reactos/dll/win32/localui/lang/ui_Tr.rc b/reactos/dll/win32/localui/lang/ui_Tr.rc new file mode 100644 index 00000000000..b05892444b2 --- /dev/null +++ b/reactos/dll/win32/localui/lang/ui_Tr.rc @@ -0,0 +1,56 @@ +/* + * Turkish resources for localui + * + * Copyright: 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "localui.h" + +LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT + +ADDPORT_DIALOG DIALOG 6, 18, 245, 47 +STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION +CAPTION "Yerli Giriş Ekleme" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&Eklenecek giriş adını giriniz:", -1, 7, 13, 194, 13, WS_VISIBLE + EDITTEXT ADDPORT_EDIT, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL + DEFPUSHBUTTON "Tamam", IDOK, 199, 10, 40, 14, WS_VISIBLE + PUSHBUTTON "İptal", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE +END + + +LPTCONFIG_DIALOG DIALOG 6, 18, 220, 47 +STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION +CAPTION "LPT Girişini Yapılandırma" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Süre Aşımı (Sâniye)", LPTCONFIG_GROUP, 6, 6, 150, 35, BS_GROUPBOX + LTEXT "&İletimi Yeniden Deneme:", -1, 14, 22, 90, 13, WS_VISIBLE + EDITTEXT LPTCONFIG_EDIT, 112, 20, 32, 13, WS_VISIBLE | ES_NUMBER + DEFPUSHBUTTON "Tamam", IDOK, 164, 10, 50, 14, WS_VISIBLE + PUSHBUTTON "İptal", IDCANCEL, 164, 27, 50, 14, WS_VISIBLE +END + + +STRINGTABLE +{ + IDS_LOCALPORT "Yerli Giriş" + IDS_INVALIDNAME "'%s', geçerli bir giriş adı değildir." + IDS_PORTEXISTS "%s girişi önceden var." + IDS_NOTHINGTOCONFIG "Bu girişin, yapılandırmak için hiçbir seçeneği yoktur." +} diff --git a/reactos/dll/win32/localui/localui.rc b/reactos/dll/win32/localui/localui.rc index fa13e35155f..6d3ecdd1b1e 100644 --- a/reactos/dll/win32/localui/localui.rc +++ b/reactos/dll/win32/localui/localui.rc @@ -99,6 +99,9 @@ #ifdef LANGUAGE_SQ_AL #include "lang/ui_Sq.rc" #endif +#ifdef LANGUAGE_TR_TR + #include "lang/ui_Tr.rc" +#endif #ifdef LANGUAGE_UK_UA #include "lang/ui_Uk.rc" #endif diff --git a/reactos/dll/win32/msgina/lang/tr-TR.rc b/reactos/dll/win32/msgina/lang/tr-TR.rc index 7c3a825357d..c216ef7b5f6 100644 --- a/reactos/dll/win32/msgina/lang/tr-TR.rc +++ b/reactos/dll/win32/msgina/lang/tr-TR.rc @@ -1,4 +1,4 @@ -/* TRANSLATOR: 2013, 2014 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ +/* TRANSLATOR: 2013, 2014 Erdem Ersoy (eersoy93) (erdemersoy@live.com) */ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT @@ -111,7 +111,7 @@ CAPTION "Oturumu Kapatma" FONT 8, "MS Shell Dlg", 400, 0, 1 BEGIN ICON IDI_LOCKICON, -1, 7, 7, 20, 20 - LTEXT "Oturumu kapatmayı onaylıyor musunuz?", IDC_STATIC, 35, 16, 146, 8 + LTEXT "Oturumu kapatmayı doğruluyor musunuz?", IDC_STATIC, 35, 16, 146, 8 PUSHBUTTON "Evet", IDYES, 41, 39, 50, 14, BS_DEFPUSHBUTTON PUSHBUTTON "Hayır", IDNO, 95, 39, 50, 14 END @@ -142,7 +142,7 @@ BEGIN IDS_LOGONMSG "%s olarak oturum açtınız." IDS_LOGONDATE "Oturum Açma Zamânı: %s %s" IDS_COMPUTERLOCKED "Bilgisayar kilitlendi." - IDS_LOCKEDWRONGPASSWORD "Şifre yanlıştır. Şifrenizi yine giriniz. Şifredeki hârfler doğru büyük-küçük ayrımıyla yazılmalıdır." + IDS_LOCKEDWRONGPASSWORD "Şifre yanlıştır. Şifrenizi yine giriniz. Şifredeki harfler doğru büyük-küçük ayrımıyla yazılmalıdır." IDS_LOCKEDWRONGUSER "Bu bilgisayar kilitli. Bu bilgisayarın kilidini yalnızca %s\\%s veyâ bir yönetici açabilir." IDS_CHANGEPWDTITLE "Şifre Değştirme" IDS_NONMATCHINGPASSWORDS "Yazıdığınız bu şifreler birbiriyle uyuşmuyor. Her iki metin kutusuna da aynı şifreyi yazınız." diff --git a/reactos/dll/win32/mshtml/lang/Tr.rc b/reactos/dll/win32/mshtml/lang/Tr.rc index 5d25ec6afbc..88d2e38ae3e 100644 --- a/reactos/dll/win32/mshtml/lang/Tr.rc +++ b/reactos/dll/win32/mshtml/lang/Tr.rc @@ -1,5 +1,5 @@ /* - * Copyrights: 2006 - Fatih Aşıcı (fasici@linux-sevenler.org), 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyrights: 2006 Fatih Aşıcı (fasici@linux-sevenler.org), 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/msrle32/lang/msrle_Tr.rc b/reactos/dll/win32/msrle32/lang/msrle_Tr.rc index a604efa5fea..215c739123a 100644 --- a/reactos/dll/win32/msrle32/lang/msrle_Tr.rc +++ b/reactos/dll/win32/msrle32/lang/msrle_Tr.rc @@ -1,7 +1,7 @@ /* * Turkish resource file for MS-RLE * - * Copyrights: 2006 - Fatih Aşıcı (fasici@linux-sevenler.org), 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyrights: 2006 Fatih Aşıcı (fasici@linux-sevenler.org), 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/msvfw32/lang/msvfw32_Tr.rc b/reactos/dll/win32/msvfw32/lang/msvfw32_Tr.rc index 1d06aebace2..14321d58c31 100644 --- a/reactos/dll/win32/msvfw32/lang/msvfw32_Tr.rc +++ b/reactos/dll/win32/msvfw32/lang/msvfw32_Tr.rc @@ -1,7 +1,7 @@ /* * Turkish Resources * - * Copyrights: 2006 - Fatih Aşıcı (fasici@linux-sevenler.org), 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyrights: 2006 Fatih Aşıcı (fasici@linux-sevenler.org), 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -32,13 +32,13 @@ FONT 8, "MS Shell Dlg" COMBOBOX 880,9,16,111,67,CBS_DROPDOWNLIST|WS_VSCROLL|WS_TABSTOP PUSHBUTTON "&Yapılandır...",882,129,36,49,14 - PUSHBUTTON "&Hakkında...",883,129,52,49,14 + PUSHBUTTON "&Üzerine...",883,129,52,49,14 SCROLLBAR 884,9,44,111,9,WS_TABSTOP LTEXT "S&ıkıştırma Niteliği:",886,9,34,80,8 - CONTROL "H&er Anahtar Kare",887,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,60,66,12 + CONTROL "&Her Anahtar Kare",887,"Button",BS_AUTOCHECKBOX|WS_TABSTOP,9,60,66,12 EDITTEXT 888,78,60,22,12 LTEXT "kareler",889,103,62,26,10 diff --git a/reactos/dll/win32/msvidc32/lang/msvidc32_Tr.rc b/reactos/dll/win32/msvidc32/lang/msvidc32_Tr.rc index 07226db2b44..4493db022a9 100644 --- a/reactos/dll/win32/msvidc32/lang/msvidc32_Tr.rc +++ b/reactos/dll/win32/msvidc32/lang/msvidc32_Tr.rc @@ -1,7 +1,7 @@ /* * Turkish Resources * - * Copyrights: 2006 - Fatih Aşıcı (fasici@linux-sevenler.org), 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyrights: 2006 Fatih Aşıcı (fasici@linux-sevenler.org), 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/win32/oledlg/lang/oledlg_Tr.rc b/reactos/dll/win32/oledlg/lang/oledlg_Tr.rc index b49063d3dd4..8f69dd681bb 100644 --- a/reactos/dll/win32/oledlg/lang/oledlg_Tr.rc +++ b/reactos/dll/win32/oledlg/lang/oledlg_Tr.rc @@ -1,7 +1,7 @@ /* * Turkish Resources * - * Copyrights: 2006 - Fatih Aşıcı (fasici@linux-sevenler.org), 2013 - Erdem Ersoy (eersoy93) (erdemersoy@live.com) + * Copyrights: 2006 Fatih Aşıcı (fasici@linux-sevenler.org), 2013 Erdem Ersoy (eersoy93) (erdemersoy@live.com) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -50,7 +50,7 @@ END STRINGTABLE { IDS_RESULTOBJDESC "Belgeye yeni bir %s nesnesi ekle." - IDS_RESULTFILEOBJDESC "Kütük içeriğini belgenize nesne olarak ekleyiniz, böylece kendisini oluşturan çizeylemi kullanarak onu etkinleştirebilirsiniz." + IDS_RESULTFILEOBJDESC "Kütük içeriğini belgenize nesne olarak ekleyiniz, böylece kendisini oluşturan izlenceyi kullanarak onu etkinleştirebilirsiniz." IDS_BROWSE "Göz At" IDS_NOTOLEMOD "Kütük, geçerli bir OLE parçası olarak görünmüyor. OLE denetimi kaydedilemiyor." IDS_NOTOLEMODCAPTION "Denetim Ekle" @@ -93,5 +93,5 @@ STRINGTABLE IDS_PS_NON_OLE "Belgeye panonun içeriğini ekler." IDS_PS_UNKNOWN_TYPE "Bilinmeyen Tür" IDS_PS_UNKNOWN_SRC "Bilinmeyen Kaynak" - IDS_PS_UNKNOWN_APP "onu oluşturan çizeylem" + IDS_PS_UNKNOWN_APP "onu oluşturan izlence" } diff --git a/reactos/dll/win32/syssetup/lang/tr-TR.rc b/reactos/dll/win32/syssetup/lang/tr-TR.rc index df3f843972f..fcd7ef66a2c 100644 --- a/reactos/dll/win32/syssetup/lang/tr-TR.rc +++ b/reactos/dll/win32/syssetup/lang/tr-TR.rc @@ -6,7 +6,7 @@ CAPTION "ReactOS Kur" FONT 8, "MS Shell Dlg" BEGIN LTEXT "ReactOS Kurulum Sihirbazı'na Hoşgeldiniz.", IDC_WELCOMETITLE, 115, 8, 195, 24 - LTEXT "Bu sihirbaz bilgisayarınıza ReactOS kurar. Sihirbaz'ın düzgün kurulum için bilgisayarınız hakkında bilgi toplaması gerekmekte.", IDC_STATIC, 115, 40, 195, 100 + LTEXT "Bu sihirbaz bilgisayarınıza ReactOS kurar. Sihirbaz'ın düzgün kurulum için bilgisayarınız üzerine bilgi toplaması gerekmekte.", IDC_STATIC, 115, 40, 195, 100 LTEXT "Kur'a devam etmek için İleri'ye basın.", IDC_STATIC, 115, 169, 195, 17 END @@ -146,7 +146,7 @@ BEGIN IDS_GETPROCADDR_FAILED "Eylem adresi alınamadı: " IDS_REGSVR_FAILED "Dll Hizmet Kaydı başarısız oldu: " IDS_DLLINSTALL_FAILED "Dll Kurulumu başarısız oldu: " - IDS_TIMEOUT "Kayıt zaman aşımına uğradı" + IDS_TIMEOUT "Kayıt, süre aşımına uğradı" IDS_REASON_UNKNOWN "" /* * ATTENTION: From 1f1924d7f1fc1750831d93b665a01377d83fddf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 10 Apr 2014 20:24:49 +0000 Subject: [PATCH 278/419] [CONSRV] Fix Insert mode. svn path=/trunk/; revision=62700 --- reactos/win32ss/user/winsrv/consrv/condrv/coninput.c | 2 +- reactos/win32ss/user/winsrv/consrv/condrv/console.c | 3 ++- reactos/win32ss/user/winsrv/consrv/condrv/text.c | 2 +- reactos/win32ss/user/winsrv/consrv/lineinput.c | 4 ++-- reactos/win32ss/user/winsrv/consrv/settings.c | 8 ++++---- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c b/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c index b009c84f006..3b4777c1468 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c @@ -260,7 +260,7 @@ ConDrvReadConsole(IN PCONSOLE Console, Console->LineComplete = FALSE; Console->LineUpPressed = FALSE; - Console->LineInsertToggle = 0; + Console->LineInsertToggle = Console->InsertMode; Console->LineWakeupMask = ReadControl->dwCtrlWakeupMask; Console->LineSize = ReadControl->nInitialChars; Console->LinePos = Console->LineSize; diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/console.c b/reactos/win32ss/user/winsrv/consrv/condrv/console.c index 338be5abaec..e756eb526cb 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/console.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/console.c @@ -569,7 +569,8 @@ ConDrvInitConsole(OUT PHANDLE NewConsoleHandle, Console->InsertMode = ConsoleInfo->InsertMode; Console->LineBuffer = NULL; Console->LineMaxSize = Console->LineSize = Console->LinePos = 0; - Console->LineComplete = Console->LineUpPressed = Console->LineInsertToggle = FALSE; + Console->LineComplete = Console->LineUpPressed = FALSE; + Console->LineInsertToggle = Console->InsertMode; // LineWakeupMask // FIXME: This is terminal-specific !! VV diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/text.c b/reactos/win32ss/user/winsrv/consrv/condrv/text.c index afe3afe661b..fe99b38e67d 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/text.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/text.c @@ -298,7 +298,7 @@ ConioEffectiveCursorSize(PCONSOLE Console, DWORD Scale) { DWORD Size = (Console->ActiveBuffer->CursorInfo.dwSize * Scale + 99) / 100; /* If line input in progress, perhaps adjust for insert toggle */ - if (Console->LineBuffer && !Console->LineComplete && Console->LineInsertToggle) + if (Console->LineBuffer && !Console->LineComplete && (Console->InsertMode ? !Console->LineInsertToggle : Console->LineInsertToggle)) return (Size * 2 <= Scale) ? (Size * 2) : (Size / 2); return Size; } diff --git a/reactos/win32ss/user/winsrv/consrv/lineinput.c b/reactos/win32ss/user/winsrv/consrv/lineinput.c index dcd53d60cd2..a9ffc8dd191 100644 --- a/reactos/win32ss/user/winsrv/consrv/lineinput.c +++ b/reactos/win32ss/user/winsrv/consrv/lineinput.c @@ -444,8 +444,8 @@ LineInputKeyDown(PCONSOLE Console, KEY_EVENT_RECORD *KeyEvent) else { /* Normal character */ - BOOL Overstrike = Console->LineInsertToggle && Console->LinePos != Console->LineSize; - LineInputEdit(Console, Overstrike, 1, &KeyEvent->uChar.UnicodeChar); + BOOL Overstrike = !Console->LineInsertToggle && (Console->LinePos != Console->LineSize); + LineInputEdit(Console, (Overstrike ? 1 : 0), 1, &KeyEvent->uChar.UnicodeChar); } } } diff --git a/reactos/win32ss/user/winsrv/consrv/settings.c b/reactos/win32ss/user/winsrv/consrv/settings.c index 1775d1d3e79..ec7042a65e3 100644 --- a/reactos/win32ss/user/winsrv/consrv/settings.c +++ b/reactos/win32ss/user/winsrv/consrv/settings.c @@ -267,17 +267,17 @@ ConSrvReadUserSettings(IN OUT PCONSOLE_INFO ConsoleInfo, } else if (!wcscmp(szValueName, L"HistoryNoDup")) { - ConsoleInfo->HistoryNoDup = (BOOLEAN)Value; + ConsoleInfo->HistoryNoDup = !!Value; RetVal = TRUE; } else if (!wcscmp(szValueName, L"QuickEdit")) { - ConsoleInfo->QuickEdit = (BOOLEAN)Value; + ConsoleInfo->QuickEdit = !!Value; RetVal = TRUE; } else if (!wcscmp(szValueName, L"InsertMode")) { - ConsoleInfo->InsertMode = (BOOLEAN)Value; + ConsoleInfo->InsertMode = !!Value; RetVal = TRUE; } else if (!wcscmp(szValueName, L"ScreenBufferSize")) @@ -421,7 +421,7 @@ ConSrvGetDefaultSettings(IN OUT PCONSOLE_INFO ConsoleInfo, memcpy(ConsoleInfo->Colors, s_Colors, sizeof(s_Colors)); - // ConsoleInfo->CodePage; + ConsoleInfo->CodePage = 0; ConsoleInfo->ConsoleTitle[0] = L'\0'; From 0ca9991ce7f5892b51df9bf6538da794a07ca235 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Thu, 10 Apr 2014 21:51:29 +0000 Subject: [PATCH 279/419] [SYSDM] - Improve the paging file management code. - Display no paging file and system managed paging file in the list. - Do not display the total paging file size because the calculated value is rubbish. Will be fixed next. svn path=/trunk/; revision=62701 --- reactos/dll/cpl/sysdm/lang/bg-BG.rc | 2 + reactos/dll/cpl/sysdm/lang/cs-CZ.rc | 2 + reactos/dll/cpl/sysdm/lang/da-DK.rc | 2 + reactos/dll/cpl/sysdm/lang/de-DE.rc | 2 + reactos/dll/cpl/sysdm/lang/el-GR.rc | 2 + reactos/dll/cpl/sysdm/lang/en-US.rc | 2 + reactos/dll/cpl/sysdm/lang/es-ES.rc | 2 + reactos/dll/cpl/sysdm/lang/fr-FR.rc | 2 + reactos/dll/cpl/sysdm/lang/he-IL.rc | 2 + reactos/dll/cpl/sysdm/lang/hu-HU.rc | 2 + reactos/dll/cpl/sysdm/lang/id-ID.rc | 2 + reactos/dll/cpl/sysdm/lang/it-IT.rc | 2 + reactos/dll/cpl/sysdm/lang/ja-JP.rc | 2 + reactos/dll/cpl/sysdm/lang/nl-NL.rc | 2 + reactos/dll/cpl/sysdm/lang/no-NO.rc | 2 + reactos/dll/cpl/sysdm/lang/pl-PL.rc | 2 + reactos/dll/cpl/sysdm/lang/ro-RO.rc | 2 + reactos/dll/cpl/sysdm/lang/ru-RU.rc | 2 + reactos/dll/cpl/sysdm/lang/sk-SK.rc | 2 + reactos/dll/cpl/sysdm/lang/sq-AL.rc | 2 + reactos/dll/cpl/sysdm/lang/sv-SE.rc | 2 + reactos/dll/cpl/sysdm/lang/tr-TR.rc | 2 + reactos/dll/cpl/sysdm/lang/uk-UA.rc | 2 + reactos/dll/cpl/sysdm/lang/zh-CN.rc | 2 + reactos/dll/cpl/sysdm/precomp.h | 1 + reactos/dll/cpl/sysdm/resource.h | 2 + reactos/dll/cpl/sysdm/virtmem.c | 307 +++++++++++++++++++--------- 27 files changed, 258 insertions(+), 100 deletions(-) diff --git a/reactos/dll/cpl/sysdm/lang/bg-BG.rc b/reactos/dll/cpl/sysdm/lang/bg-BG.rc index f468f9acd41..1a6655dfdd7 100644 --- a/reactos/dll/cpl/sysdm/lang/bg-BG.rc +++ b/reactos/dll/cpl/sysdm/lang/bg-BG.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Въведете числена стойност за върховия размер на страниращия файл." IDS_WARNINITIALRANGE "Началният размер на страниращия файл не трябва да е по-малък от 2 МБ и не трябва да надхвърля свободното пространство на избраното устройство." IDS_WARNMAXIMUMRANGE "Върховият размер на страниращия файл не трябва да е по-малък от началния и не трябва да надвишава свободното пространство на избраното устройство" + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/cs-CZ.rc b/reactos/dll/cpl/sysdm/lang/cs-CZ.rc index 7750eb26b5e..1725a2f7a47 100644 --- a/reactos/dll/cpl/sysdm/lang/cs-CZ.rc +++ b/reactos/dll/cpl/sysdm/lang/cs-CZ.rc @@ -280,5 +280,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Zadejte číselnou hodnotu pro maximální velikost stránkovacího souboru." IDS_WARNINITIALRANGE "Výchozí velikost stránkovacího souboru nesmí být menší než 2 MB a nesmí překročit množství volného místa na zvolené diskové jednotce." IDS_WARNMAXIMUMRANGE "Maximální velikost stránkovacího souboru nesmí být menší než velikost výchozí a nesmí překročit množství volného místa na zvolené diskové jednotce." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/da-DK.rc b/reactos/dll/cpl/sysdm/lang/da-DK.rc index 6bc6028a90c..1f15f3d3570 100644 --- a/reactos/dll/cpl/sysdm/lang/da-DK.rc +++ b/reactos/dll/cpl/sysdm/lang/da-DK.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/de-DE.rc b/reactos/dll/cpl/sysdm/lang/de-DE.rc index 57c04fee39f..166a96ad946 100644 --- a/reactos/dll/cpl/sysdm/lang/de-DE.rc +++ b/reactos/dll/cpl/sysdm/lang/de-DE.rc @@ -284,5 +284,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Geben Sie einen numerischen Wert für die Maximalgröße der Auslagerungsdatei an." IDS_WARNINITIALRANGE "Die Anfangsgröße der Auslagerungsdatei darf nicht kleiner als 2 MB sein und darf den verfügbaren Speicherplatz auf dem gewählten Laufwerk nicht überschreiten." IDS_WARNMAXIMUMRANGE "Die Maximalgröße der Auslagerungsdatei darf nicht kleiner als die Anfangsgröße sein und darf den verfügbaren Speicherplatz auf dem gewählten Laufwerk nicht überschreiten." + IDS_PAGEFILE_NONE "Keine" + IDS_PAGEFILE_SYSTEM "Systemverwaltet" IDS_DEVS "\nReactOS Team\n\nProjektkoordinator\n\nAleksey Bragin\n\nEntwicklerteam\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Verantwortliche\n\nColin Finck\nZ98\n\nWebseitenteam\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedienteam\n\nMindflyer\nWierd_W\n\nweiterer Dank geht an\n\nalle Mitwirkenden\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/el-GR.rc b/reactos/dll/cpl/sysdm/lang/el-GR.rc index dbda3cbe701..ad2e95ec810 100644 --- a/reactos/dll/cpl/sysdm/lang/el-GR.rc +++ b/reactos/dll/cpl/sysdm/lang/el-GR.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/en-US.rc b/reactos/dll/cpl/sysdm/lang/en-US.rc index 406d47208d2..b89c9e59911 100644 --- a/reactos/dll/cpl/sysdm/lang/en-US.rc +++ b/reactos/dll/cpl/sysdm/lang/en-US.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/es-ES.rc b/reactos/dll/cpl/sysdm/lang/es-ES.rc index a0249cd8443..284d2b8a450 100644 --- a/reactos/dll/cpl/sysdm/lang/es-ES.rc +++ b/reactos/dll/cpl/sysdm/lang/es-ES.rc @@ -277,5 +277,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Ingresar el tamaño máximo del archivo de paginación." IDS_WARNINITIALRANGE "El tamaño inicial del archivo de paginación no puede ser inferior a 2 MB y no puede exceder el espacio disponible en la unidad seleccionada." IDS_WARNMAXIMUMRANGE "El tamaño máximo del archivo de paginación no puede ser inferior al tamaño inicial y no puede exceder el espacio disponible en la unidad seleccionada." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/fr-FR.rc b/reactos/dll/cpl/sysdm/lang/fr-FR.rc index 71d7263aeaf..dfaa518cbf0 100644 --- a/reactos/dll/cpl/sysdm/lang/fr-FR.rc +++ b/reactos/dll/cpl/sysdm/lang/fr-FR.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/he-IL.rc b/reactos/dll/cpl/sysdm/lang/he-IL.rc index f65bf37b8e2..5502680ee10 100644 --- a/reactos/dll/cpl/sysdm/lang/he-IL.rc +++ b/reactos/dll/cpl/sysdm/lang/he-IL.rc @@ -277,5 +277,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/hu-HU.rc b/reactos/dll/cpl/sysdm/lang/hu-HU.rc index 07fd421915f..5616e317d7f 100644 --- a/reactos/dll/cpl/sysdm/lang/hu-HU.rc +++ b/reactos/dll/cpl/sysdm/lang/hu-HU.rc @@ -277,5 +277,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/id-ID.rc b/reactos/dll/cpl/sysdm/lang/id-ID.rc index f14568811f6..1e09507a12b 100644 --- a/reactos/dll/cpl/sysdm/lang/id-ID.rc +++ b/reactos/dll/cpl/sysdm/lang/id-ID.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/it-IT.rc b/reactos/dll/cpl/sysdm/lang/it-IT.rc index 6dbf3155338..74a01b4bdff 100644 --- a/reactos/dll/cpl/sysdm/lang/it-IT.rc +++ b/reactos/dll/cpl/sysdm/lang/it-IT.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Immettere la dimensione massima del file di paging." IDS_WARNINITIALRANGE "La dimensione iniziale del file di paging non può essere inferiore a 2 MB e non può superare lo spazio disponibile nell'unità selezionata." IDS_WARNMAXIMUMRANGE "La dimensione massima del file di paging non può essere inferiore a quella iniziale e non può superare lo spazio disponibile nell'unità selezionata." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nCoordinatore\n\nAleksey Bragin\n\nGruppo di sviluppo\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nUlteriori ringraziamenti\n\na tutti i Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/ja-JP.rc b/reactos/dll/cpl/sysdm/lang/ja-JP.rc index d1d1716c539..5dac2c21488 100644 --- a/reactos/dll/cpl/sysdm/lang/ja-JP.rc +++ b/reactos/dll/cpl/sysdm/lang/ja-JP.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/nl-NL.rc b/reactos/dll/cpl/sysdm/lang/nl-NL.rc index ecc906f1d04..6e383126049 100644 --- a/reactos/dll/cpl/sysdm/lang/nl-NL.rc +++ b/reactos/dll/cpl/sysdm/lang/nl-NL.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/no-NO.rc b/reactos/dll/cpl/sysdm/lang/no-NO.rc index e23eaf14775..fca80a1a614 100644 --- a/reactos/dll/cpl/sysdm/lang/no-NO.rc +++ b/reactos/dll/cpl/sysdm/lang/no-NO.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/pl-PL.rc b/reactos/dll/cpl/sysdm/lang/pl-PL.rc index 6525ed6f716..413fe64ca9b 100644 --- a/reactos/dll/cpl/sysdm/lang/pl-PL.rc +++ b/reactos/dll/cpl/sysdm/lang/pl-PL.rc @@ -284,5 +284,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Wprowadź wielkość dla maksymalnego rozmiaru pliku stronicowania." IDS_WARNINITIALRANGE "Początkowy rozmiar pliku stronicowania nie może być mniejszy niż 2MB i nie może przekraczać dostępnej ilości miejsca w wybranym napędzie." IDS_WARNMAXIMUMRANGE "Maksymalny rozmiar pliku stronicowania nie może być mniejszy niż jego rozmiar początkowy i nie może przekraczać dostępnej ilości miejsca w wybranym napędzie." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nEkipa ReactOS\n\nKoordynator Projektu\n\nAleksey Bragin\n\nEkipa Programistów\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nInżynierowie Wydań\n\nColin Finck\nZ98\n\nEkipa WWW\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nEkipa PR\n\nMindflyer\nWierd_W\n\nPodziękowania dla\n\nwszystkich współpracowników\nEkipy Wine\n\n"//FIXME END diff --git a/reactos/dll/cpl/sysdm/lang/ro-RO.rc b/reactos/dll/cpl/sysdm/lang/ro-RO.rc index f8e12fec5da..90c1da1278d 100644 --- a/reactos/dll/cpl/sysdm/lang/ro-RO.rc +++ b/reactos/dll/cpl/sysdm/lang/ro-RO.rc @@ -277,5 +277,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Introduceți o valoare numerică pentru dimensiunea maximă a fișierului de paginare." IDS_WARNINITIALRANGE "Dimensiunea inițială a fișierului de paginare trebuie să fie încadrată între 2 Mo și spațiul liber disponibil al unității selectate." IDS_WARNMAXIMUMRANGE "Dimensiunea maximă a fișierului de paginare trebuie să fie încadrată între dimensiunea inițială și spațiul liber disponibil al unității selectate." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nEchipa ReactOS\n\nCoordonator de proiect\n\nAleksey Bragin\n\nEchipa de dezvoltare\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nIngineri de distribuție\n\nColin Finck\nZ98\n\nEchipa paginii web\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nEchipa multimedia\n\nMindflyer\nWierd_W\n\nmulțumiri adresate către\n\ntoți Contribuitorii\nEchipa Wine\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/ru-RU.rc b/reactos/dll/cpl/sysdm/lang/ru-RU.rc index 0e174016acb..1ced85f967b 100644 --- a/reactos/dll/cpl/sysdm/lang/ru-RU.rc +++ b/reactos/dll/cpl/sysdm/lang/ru-RU.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Введите числовое значение для параметра максимальный размер файла подкачки." IDS_WARNINITIALRANGE "Начальный размер файла подкачки должен быть не меньше, чем 2 МБ и не должен превышать свободного места на выбранном диске." IDS_WARNMAXIMUMRANGE "Максимальный размер файла подкачки должен быть не меньше, чем начальный размер, который не должен превышать свободного места на выбранном диске." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nКоманда ReactOS\n\nКоординатор проекта\n\nАлексей Брагин\n\nКоллектив разработчиков\n\nАлексей Брагин\nЭндрю Гринвуд\nАндрей Коротаев\nАрт Йеркс\nКристоф фон Виттих\nКолин Финк\nДаниэль Раймер\nДмитрий Чапышев\nЭрик Коль\nГед Мёрфи\nГрегор Брюнмар\nЭрве Поссино\nДжеймс Тэбор\nДжеффри Морлан\nЙоханнес Андервальд\nKJK::Гиперион\nМаартен Босма\nМагнус Олсен\nМарк Пиулахс\nМаттиас Купфер\nМайк Норделл\nПитер Вард\nПьер Швейцер\nСавелий Третьяков\nСтефан Гинсберг\nСильвейн Петреоль\nТомас Блюмель\nТимо Кройцер\n\nАлекс Ионеску\nФилип Навара\nГуннар Далснес\nМартин Фукс\nРойс Митчелл III\nБрэндон Тёрнер\nБрайан Палмер\nКаспер Хорнструп\nДэвид Велч\nЭмануэль Алиберти\nГе ван Гельдорп\nГрегор Анич\nДжейсон Филби\nЙенс Коллин\nМихаэль Вирт\nНатан Вудс\nРоберт Дикенсон\nРекс Джоллифф\nVizzini\n\nРелиз-инженеры\n\nКолин Финк\nЦзылян Гуо\n\nРазработка веб-сайта\n\nКолин Финк\nЯн Блумквист Кинандер\nКлеменс Фридл\nЦзылян Гуо\n\nГрафический дизайн\n\nMindflyer\nWierd_W\n\nБлагодарности\n\nвсем участникам проекта\nКоманде Wine\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/sk-SK.rc b/reactos/dll/cpl/sysdm/lang/sk-SK.rc index 3c2928373a7..533383bef30 100644 --- a/reactos/dll/cpl/sysdm/lang/sk-SK.rc +++ b/reactos/dll/cpl/sysdm/lang/sk-SK.rc @@ -283,5 +283,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/sq-AL.rc b/reactos/dll/cpl/sysdm/lang/sq-AL.rc index 24297c9520c..03cf9795a17 100644 --- a/reactos/dll/cpl/sysdm/lang/sq-AL.rc +++ b/reactos/dll/cpl/sysdm/lang/sq-AL.rc @@ -275,5 +275,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Futni një vlerë numerike për madhësinë maksimale e faqeve të dokumentave." IDS_WARNINITIALRANGE "Madhësia fillestare e faqes së dokumentit nuk duhet të jetë më e vogël se 2 MB dhe nuk duhet të kalojë hapësirën në dispozicion në driver-in e përzgjedhur." IDS_WARNMAXIMUMRANGE "Madhësia maksimale e faqes së dokumenit nuk duhet të jetë më e vogël se madhësia e saj fillestare dhe nuk duhet të kalojë hapësirën në dispozicion në driver-in e përzgjedhur." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/sv-SE.rc b/reactos/dll/cpl/sysdm/lang/sv-SE.rc index c419d5c7e53..a30843301dd 100644 --- a/reactos/dll/cpl/sysdm/lang/sv-SE.rc +++ b/reactos/dll/cpl/sysdm/lang/sv-SE.rc @@ -277,5 +277,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/tr-TR.rc b/reactos/dll/cpl/sysdm/lang/tr-TR.rc index 0c2719b9b9a..2a2f9562b9f 100644 --- a/reactos/dll/cpl/sysdm/lang/tr-TR.rc +++ b/reactos/dll/cpl/sysdm/lang/tr-TR.rc @@ -277,5 +277,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Sayfalama kütüğünün azamî büyüklüğünü giriniz." IDS_WARNINITIALRANGE "Sayfalama kütüğünün başlangıç büyüklüğü, 2 MB'tan küçük, seçili sürücüdeki boşluğun büyüklüğünden büyük olamaz." IDS_WARNMAXIMUMRANGE "Sayfalama kütüğünün azamî büyüklüğü, başlangıç büyüklüğünden küçük, seçili sürücüdeki boşluğun büyüklüğünden büyük olamaz." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Takımı\n\nTasarı Eş Güdümcüsü:\n\nAleksey Bragin\n\nGeliştirme Takımı:\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nSürüm Tasarlayıcıları:\n\nColin Finck\nZ98\n\nUmûmî Ağ Sitesi Takımı:\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedya Takımı:\n\nMindflyer\nWierd_W\n\nAyrıca, diğer tüm katkıda bulunanlara teşekkürler:\nWine Takımı\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/uk-UA.rc b/reactos/dll/cpl/sysdm/lang/uk-UA.rc index 793362b083e..0027acdfe51 100644 --- a/reactos/dll/cpl/sysdm/lang/uk-UA.rc +++ b/reactos/dll/cpl/sysdm/lang/uk-UA.rc @@ -283,5 +283,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Введіть числове значення для максимального розміру файлу довантаження." IDS_WARNINITIALRANGE "Початковий розмір файлу довантаження не повинен бути меншим 2 Мб і не повинен перевищувати об'єм вільного місця на обраному диску." IDS_WARNMAXIMUMRANGE "Максимальний розмір файлу довантаження не повинен бути меншим від початкового та не повинен перевищувати об'єм вільного місця на обраному диску." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/zh-CN.rc b/reactos/dll/cpl/sysdm/lang/zh-CN.rc index d25c7445893..162f729e1b9 100644 --- a/reactos/dll/cpl/sysdm/lang/zh-CN.rc +++ b/reactos/dll/cpl/sysdm/lang/zh-CN.rc @@ -277,5 +277,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Enter a numeric value for the maximum size of the paging file." IDS_WARNINITIALRANGE "The initial size of the paging file must not be smaller than 2 MB and must not exceed the available space on the selected drive." IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." + IDS_PAGEFILE_NONE "none" + IDS_PAGEFILE_SYSTEM "system managed" IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/precomp.h b/reactos/dll/cpl/sysdm/precomp.h index 4b5151f6698..97c30ba8ded 100644 --- a/reactos/dll/cpl/sysdm/precomp.h +++ b/reactos/dll/cpl/sysdm/precomp.h @@ -51,6 +51,7 @@ INT_PTR CALLBACK LicenceDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l typedef struct _PAGEFILE { TCHAR szDrive[3]; + LPTSTR pszVolume; UINT InitialSize; UINT MaximumSize; UINT FreeSize; diff --git a/reactos/dll/cpl/sysdm/resource.h b/reactos/dll/cpl/sysdm/resource.h index eacbcd54cc6..6ef3de200a3 100644 --- a/reactos/dll/cpl/sysdm/resource.h +++ b/reactos/dll/cpl/sysdm/resource.h @@ -37,6 +37,8 @@ #define IDS_WARNMAXIMUMSIZE 79 #define IDS_WARNINITIALRANGE 80 #define IDS_WARNMAXIMUMRANGE 81 +#define IDS_PAGEFILE_NONE 82 +#define IDS_PAGEFILE_SYSTEM 83 /* Propsheet - general */ #define IDD_PROPPAGEGENERAL 100 diff --git a/reactos/dll/cpl/sysdm/virtmem.c b/reactos/dll/cpl/sysdm/virtmem.c index 4603a4c910d..53f69828ca1 100644 --- a/reactos/dll/cpl/sysdm/virtmem.c +++ b/reactos/dll/cpl/sysdm/virtmem.c @@ -107,24 +107,18 @@ ParseMemSettings(PVIRTMEM pVirtMem) TCHAR szDrives[1024]; // All drives LPTSTR DrivePtr = szDrives; TCHAR szDrive[3]; // Single drive - TCHAR szVolume[MAX_PATH]; - TCHAR *szDisplayString; - INT InitialSize = 0; - INT MaximumSize = 0; + TCHAR szVolume[MAX_PATH + 1]; + INT InitialSize; + INT MaximumSize; INT DriveLen; INT PgCnt = 0; + INT Len; DriveLen = GetLogicalDriveStrings(1023, szDrives); - szDisplayString = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (MAX_PATH * 2 + 69) * sizeof(TCHAR)); - if (szDisplayString == NULL) - return; - while (DriveLen != 0) { - INT Len; - Len = lstrlen(DrivePtr) + 1; DriveLen -= Len; @@ -135,68 +129,47 @@ ParseMemSettings(PVIRTMEM pVirtMem) if (GetDriveType(DrivePtr) == DRIVE_FIXED) { + InitialSize = -1; + MaximumSize = -1; + /* Does drive match the one in the registry ? */ if (!_tcsncmp(pVirtMem->szPagingFiles, szDrive, 2)) { - /* FIXME: We only check the first available pagefile in the reg */ GetPageFileSizes(pVirtMem->szPagingFiles, &InitialSize, &MaximumSize); - - pVirtMem->Pagefile[PgCnt].InitialSize = InitialSize; - pVirtMem->Pagefile[PgCnt].MaximumSize = MaximumSize; - pVirtMem->Pagefile[PgCnt].bUsed = TRUE; - lstrcpy(pVirtMem->Pagefile[PgCnt].szDrive, szDrive); - } - else - { - pVirtMem->Pagefile[PgCnt].InitialSize = 0; - pVirtMem->Pagefile[PgCnt].MaximumSize = 0; - pVirtMem->Pagefile[PgCnt].bUsed = FALSE; - lstrcpy(pVirtMem->Pagefile[PgCnt].szDrive, szDrive); } - _tcscpy(szDisplayString, szDrive); - _tcscat(szDisplayString, _T("\t")); + pVirtMem->Pagefile[PgCnt].InitialSize = InitialSize; + pVirtMem->Pagefile[PgCnt].MaximumSize = MaximumSize; + pVirtMem->Pagefile[PgCnt].bUsed = TRUE; + lstrcpy(pVirtMem->Pagefile[PgCnt].szDrive, szDrive); - /* Set a volume label if there is one */ + + /* Get the volume label if there is one */ if (GetVolumeInformation(DrivePtr, szVolume, - 255, + MAX_PATH + 1, NULL, NULL, NULL, NULL, 0)) { - if (szVolume[0] != _T('\0')) - { - TCHAR szVol[MAX_PATH + 2]; - _stprintf(szVol, _T("[%s]"), szVolume); - _tcscat(szDisplayString, szVol); - } + pVirtMem->Pagefile[PgCnt].pszVolume = HeapAlloc(GetProcessHeap(), + 0, + (_tcslen(szVolume) + 1) * sizeof(TCHAR)); + if (pVirtMem->Pagefile[PgCnt].pszVolume != NULL) + _tcscpy(pVirtMem->Pagefile[PgCnt].pszVolume, szVolume); } - if ((InitialSize != 0) || (MaximumSize != 0)) - { - TCHAR szSize[64]; - - _stprintf(szSize, _T("%i - %i"), InitialSize, MaximumSize); - _tcscat(szDisplayString, _T("\t")); - _tcscat(szDisplayString, szSize); - } - - SendMessage(pVirtMem->hListBox, LB_ADDSTRING, (WPARAM)0, (LPARAM)szDisplayString); PgCnt++; } DrivePtr += Len; } - SendMessage(pVirtMem->hListBox, LB_SETCURSEL, (WPARAM)0, (LPARAM)0); - HeapFree(GetProcessHeap(), 0, szDisplayString); pVirtMem->Count = PgCnt; - OnSelChange(pVirtMem->hSelf, pVirtMem); } @@ -211,9 +184,12 @@ WritePageFileSettings(PVIRTMEM pVirtMem) for (i = 0; i < pVirtMem->Count; ++i) { - if (pVirtMem->Pagefile[i].bUsed) + if (pVirtMem->Pagefile[i].bUsed && + pVirtMem->Pagefile[i].InitialSize != -1 && + pVirtMem->Pagefile[i].MaximumSize != -1) { - _stprintf(szText, _T("%s\\pagefile.sys %i %i"), + _stprintf(szText, + _T("%s\\pagefile.sys %i %i"), pVirtMem->Pagefile[i].szDrive, pVirtMem->Pagefile[i].InitialSize, pVirtMem->Pagefile[i].MaximumSize); @@ -261,9 +237,10 @@ WritePageFileSettings(PVIRTMEM pVirtMem) static VOID SetListBoxColumns(HWND hwndListBox) { - const INT tabs[2] = {30, 120}; + RECT rect = {0, 0, 103, 0}; + MapDialogRect(hwndListBox, &rect); - SendMessage(hwndListBox, LB_SETTABSTOPS, (WPARAM)2, (LPARAM)&tabs[0]); + SendMessage(hwndListBox, LB_SETTABSTOPS, (WPARAM)1, (LPARAM)&rect.right); } @@ -294,6 +271,102 @@ OnCustom(PVIRTMEM pVirtMem) } +static VOID +InitPagefileList(PVIRTMEM pVirtMem) +{ + TCHAR szDisplayString[256]; + TCHAR szSize[64]; + INT Index; + INT i; + + for (i = 0; i < 26; i++) + { + if (pVirtMem->Pagefile[i].bUsed) + { + if ((pVirtMem->Pagefile[i].InitialSize == -1) && + (pVirtMem->Pagefile[i].MaximumSize == -1)) + { + LoadString(hApplet, + IDS_PAGEFILE_NONE, + szSize, + sizeof(szSize) / sizeof(szSize[0])); + } + else if ((pVirtMem->Pagefile[i].InitialSize == 0) && + (pVirtMem->Pagefile[i].MaximumSize == 0)) + { + LoadString(hApplet, + IDS_PAGEFILE_SYSTEM, + szSize, + sizeof(szSize) / sizeof(szSize[0])); + } + else + { + _stprintf(szSize, _T("%d - %d"), + pVirtMem->Pagefile[i].InitialSize, + pVirtMem->Pagefile[i].MaximumSize); + } + + _stprintf(szDisplayString, + _T("%s [%s]\t%s"), + pVirtMem->Pagefile[i].szDrive, + pVirtMem->Pagefile[i].pszVolume ? pVirtMem->Pagefile[i].pszVolume : _T(""), + szSize); + + Index = SendMessage(pVirtMem->hListBox, LB_ADDSTRING, (WPARAM)0, (LPARAM)szDisplayString); + SendMessage(pVirtMem->hListBox, LB_SETITEMDATA, Index, i); + } + } + + SendMessage(pVirtMem->hListBox, LB_SETCURSEL, (WPARAM)0, (LPARAM)0); + + OnSelChange(pVirtMem->hSelf, pVirtMem); +} + + +static VOID +UpdatePagefileEntry(PVIRTMEM pVirtMem, + INT ListIndex, + INT DriveIndex) +{ + TCHAR szDisplayString[256]; + TCHAR szSize[64]; + + if ((pVirtMem->Pagefile[DriveIndex].InitialSize == -1) && + (pVirtMem->Pagefile[DriveIndex].MaximumSize == -1)) + { + LoadString(hApplet, + IDS_PAGEFILE_NONE, + szSize, + sizeof(szSize) / sizeof(szSize[0])); + } + else if ((pVirtMem->Pagefile[DriveIndex].InitialSize == 0) && + (pVirtMem->Pagefile[DriveIndex].MaximumSize == 0)) + { + LoadString(hApplet, + IDS_PAGEFILE_SYSTEM, + szSize, + sizeof(szSize) / sizeof(szSize[0])); + } + else + { + _stprintf(szSize, + _T("%d - %d"), + pVirtMem->Pagefile[DriveIndex].InitialSize, + pVirtMem->Pagefile[DriveIndex].MaximumSize); + } + + _stprintf(szDisplayString, + _T("%s [%s]\t%s"), + pVirtMem->Pagefile[DriveIndex].szDrive, + pVirtMem->Pagefile[DriveIndex].pszVolume ? pVirtMem->Pagefile[DriveIndex].pszVolume : L"", + szSize); + + SendMessage(pVirtMem->hListBox, LB_DELETESTRING, (WPARAM)ListIndex, 0); + SendMessage(pVirtMem->hListBox, LB_INSERTSTRING, (WPARAM)ListIndex, (LPARAM)szDisplayString); + SendMessage(pVirtMem->hListBox, LB_SETCURSEL, (WPARAM)ListIndex, 0); +} + + static VOID OnSet(PVIRTMEM pVirtMem) { @@ -303,6 +376,7 @@ OnSet(PVIRTMEM pVirtMem) BOOL bTranslated; TCHAR szTitle[64]; TCHAR szMessage[256]; + INT DriveIndex = 0; pVirtMem->bSave = TRUE; @@ -313,6 +387,12 @@ OnSet(PVIRTMEM pVirtMem) 0); if (Index >= 0 && Index < pVirtMem->Count) { + DriveIndex = SendDlgItemMessage(pVirtMem->hSelf, + IDC_PAGEFILELIST, + LB_GETITEMDATA, + 0, + 0); + /* Check if custom settings are checked */ if (IsDlgButtonChecked(pVirtMem->hSelf, IDC_CUSTOM) == BST_CHECKED) @@ -369,7 +449,7 @@ OnSet(PVIRTMEM pVirtMem) /* Check the valid range of the inial size */ if (InitialSize < 2 || - InitialSize > pVirtMem->Pagefile[Index].FreeSize) + InitialSize > pVirtMem->Pagefile[DriveIndex].FreeSize) { if (LoadString(hApplet, IDS_MESSAGEBOXTITLE, @@ -391,7 +471,7 @@ OnSet(PVIRTMEM pVirtMem) /* Check the valid range of the maximum size */ if (MaximumSize < InitialSize || - MaximumSize > pVirtMem->Pagefile[Index].FreeSize) + MaximumSize > pVirtMem->Pagefile[DriveIndex].FreeSize) { if (LoadString(hApplet, IDS_MESSAGEBOXTITLE, @@ -411,27 +491,26 @@ OnSet(PVIRTMEM pVirtMem) return; } - pVirtMem->Pagefile[Index].InitialSize = InitialSize; - pVirtMem->Pagefile[Index].MaximumSize = MaximumSize; - pVirtMem->Pagefile[Index].bUsed = TRUE; + pVirtMem->Pagefile[DriveIndex].InitialSize = InitialSize; + pVirtMem->Pagefile[DriveIndex].MaximumSize = MaximumSize; + pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; + } + else if (IsDlgButtonChecked(pVirtMem->hSelf, + IDC_NOPAGEFILE) == BST_CHECKED) + { + /* Set sizes to -1 */ + pVirtMem->Pagefile[DriveIndex].InitialSize = -1; + pVirtMem->Pagefile[DriveIndex].MaximumSize = -1; + pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; } else { - /* Set sizes to 0 */ - pVirtMem->Pagefile[Index].InitialSize = 0; - pVirtMem->Pagefile[Index].MaximumSize = 0; - - // Check to see if this drive is used for a paging file - if (IsDlgButtonChecked(pVirtMem->hSelf, - IDC_NOPAGEFILE) == BST_UNCHECKED) - { - pVirtMem->Pagefile[Index].bUsed = TRUE; - } - else - { - pVirtMem->Pagefile[Index].bUsed = FALSE; - } + pVirtMem->Pagefile[DriveIndex].InitialSize = 0; + pVirtMem->Pagefile[DriveIndex].MaximumSize = 0; + pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; } + + UpdatePagefileEntry(pVirtMem, Index, DriveIndex); } } @@ -442,7 +521,7 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem) TCHAR szBuffer[64]; MEMORYSTATUSEX MemoryStatus; ULARGE_INTEGER FreeDiskSpace; - UINT i, FreeMemMb, PageFileSizeMb; + UINT /*i,*/ FreeMemMb /*, PageFileSizeMb*/; INT Index; Index = (INT)SendDlgItemMessage(hwndDlg, @@ -465,9 +544,30 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem) SetDlgItemText(hwndDlg, IDC_SPACEAVAIL, szBuffer); } - if (pVirtMem->Pagefile[Index].InitialSize != 0 && - pVirtMem->Pagefile[Index].MaximumSize != 0) + if (pVirtMem->Pagefile[Index].InitialSize == -1 && + pVirtMem->Pagefile[Index].MaximumSize == -1) { + /* No pagefile */ + + EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE); + EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE); + + CheckDlgButton(pVirtMem->hSelf, IDC_NOPAGEFILE, BST_CHECKED); + } + else if (pVirtMem->Pagefile[Index].InitialSize == 0 && + pVirtMem->Pagefile[Index].MaximumSize == 0) + { + /* System managed size*/ + + EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE); + EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE); + + CheckDlgButton(pVirtMem->hSelf, IDC_SYSMANSIZE, BST_CHECKED); + } + else + { + /* Custom size */ + /* Enable and fill the custom values */ EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), TRUE); EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), TRUE); @@ -486,26 +586,6 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem) IDC_CUSTOM, BST_CHECKED); } - else - { - /* It's not a custom value */ - EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_MAXSIZE), FALSE); - EnableWindow(GetDlgItem(pVirtMem->hSelf, IDC_INITIALSIZE), FALSE); - - /* Is it system managed */ - if (pVirtMem->Pagefile[Index].bUsed) - { - CheckDlgButton(pVirtMem->hSelf, - IDC_SYSMANSIZE, - BST_CHECKED); - } - else - { - CheckDlgButton(pVirtMem->hSelf, - IDC_NOPAGEFILE, - BST_CHECKED); - } - } /* Set minimum pagefile size */ SetDlgItemText(hwndDlg, IDC_MINIMUM, _T("2 MB")); @@ -520,6 +600,7 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem) } /* Set current pagefile size */ +#if 0 PageFileSizeMb = 0; for (i = 0; i < 26; i++) { @@ -527,6 +608,7 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem) } _stprintf(szBuffer, _T("%u MB"), PageFileSizeMb); SetDlgItemText(hwndDlg, IDC_CURRENT, szBuffer); +#endif } return TRUE; @@ -546,18 +628,46 @@ OnOk(PVIRTMEM pVirtMem) static VOID OnInitDialog(HWND hwnd, PVIRTMEM pVirtMem) { + INT i; + pVirtMem->hSelf = hwnd; pVirtMem->hListBox = GetDlgItem(hwnd, IDC_PAGEFILELIST); pVirtMem->bSave = FALSE; SetListBoxColumns(pVirtMem->hListBox); - /* Load the pagefile systems from the reg */ - if (ReadPageFileSettings(pVirtMem)) + for (i = 0; i < 26; i++) { - /* Parse our settings and set up dialog */ - ParseMemSettings(pVirtMem); + pVirtMem->Pagefile[i].bUsed = FALSE; + pVirtMem->Pagefile[i].InitialSize = -1; + pVirtMem->Pagefile[i].MaximumSize = -1; } + + /* Load the pagefile systems from the reg */ + ReadPageFileSettings(pVirtMem); + + /* Parse our settings and set up dialog */ + ParseMemSettings(pVirtMem); + + InitPagefileList(pVirtMem); +} + + +static VOID +OnDestroy(PVIRTMEM pVirtMem) +{ + INT i; + + for (i = 0; i < 26; i++) + { + if (pVirtMem->Pagefile[i].pszVolume != NULL) + HeapFree(GetProcessHeap(), 0, pVirtMem->Pagefile[i].pszVolume); + } + + if (pVirtMem->szPagingFiles) + HeapFree(GetProcessHeap(), 0, pVirtMem->szPagingFiles); + + HeapFree(GetProcessHeap(), 0, pVirtMem); } @@ -589,10 +699,7 @@ VirtMemDlgProc(HWND hwndDlg, break; case WM_DESTROY: - if (pVirtMem->szPagingFiles) - HeapFree(GetProcessHeap(), 0, - pVirtMem->szPagingFiles); - HeapFree(GetProcessHeap(), 0, pVirtMem); + OnDestroy(pVirtMem); break; case WM_COMMAND: From 7fd362dacc3231585bd7501ad82e70d754d423bd Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 10 Apr 2014 23:32:34 +0000 Subject: [PATCH 280/419] [Win32k] - Add write back for HCBT_MOVESIZE. svn path=/trunk/; revision=62702 --- reactos/win32ss/user/ntuser/callback.c | 35 ++++++++++++++++---------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/reactos/win32ss/user/ntuser/callback.c b/reactos/win32ss/user/ntuser/callback.c index 7f068628c89..d8f81e83e94 100644 --- a/reactos/win32ss/user/ntuser/callback.c +++ b/reactos/win32ss/user/ntuser/callback.c @@ -736,21 +736,30 @@ co_IntCallHookProc(INT HookId, switch (HookId) { case WH_CBT: - if (Code == HCBT_CREATEWND) + { + switch (Code) { - if (CbtCreatewndExtra) - {/* - The parameters could have been changed, include the coordinates - and dimensions of the window. We copy it back. - */ - CbtCreateWnd->hwndInsertAfter = CbtCreatewndExtra->WndInsertAfter; - CbtCreateWnd->lpcs->x = CbtCreatewndExtra->Cs.x; - CbtCreateWnd->lpcs->y = CbtCreatewndExtra->Cs.y; - CbtCreateWnd->lpcs->cx = CbtCreatewndExtra->Cs.cx; - CbtCreateWnd->lpcs->cy = CbtCreatewndExtra->Cs.cy; - } + case HCBT_CREATEWND: + if (CbtCreatewndExtra) + {/* + The parameters could have been changed, include the coordinates + and dimensions of the window. We copy it back. + */ + CbtCreateWnd->hwndInsertAfter = CbtCreatewndExtra->WndInsertAfter; + CbtCreateWnd->lpcs->x = CbtCreatewndExtra->Cs.x; + CbtCreateWnd->lpcs->y = CbtCreatewndExtra->Cs.y; + CbtCreateWnd->lpcs->cx = CbtCreatewndExtra->Cs.cx; + CbtCreateWnd->lpcs->cy = CbtCreatewndExtra->Cs.cy; + } + break; + case HCBT_MOVESIZE: + if (Common->lParam && lParam) + { + RtlCopyMemory((PVOID) lParam, (PVOID) Common->lParam, sizeof(RECTL)); + } + break; } - break; + } // "The GetMsgProc hook procedure can examine or modify the message." case WH_GETMESSAGE: if (pMsg) From fe7aa873bec04a06990b650cb76303e53ada87d0 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Fri, 11 Apr 2014 00:24:30 +0000 Subject: [PATCH 281/419] - Fix penitential crash. svn path=/trunk/; revision=62703 --- reactos/win32ss/user/ntuser/callback.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/ntuser/callback.c b/reactos/win32ss/user/ntuser/callback.c index d8f81e83e94..a6112e87e1e 100644 --- a/reactos/win32ss/user/ntuser/callback.c +++ b/reactos/win32ss/user/ntuser/callback.c @@ -753,9 +753,9 @@ co_IntCallHookProc(INT HookId, } break; case HCBT_MOVESIZE: - if (Common->lParam && lParam) + if (Extra && lParam) { - RtlCopyMemory((PVOID) lParam, (PVOID) Common->lParam, sizeof(RECTL)); + RtlCopyMemory((PVOID) lParam, Extra, sizeof(RECTL)); } break; } From 92276d765dc550c7833507767b8aac08451ed863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Fri, 11 Apr 2014 02:06:03 +0000 Subject: [PATCH 282/419] [WINSRV]: Update the description. svn path=/trunk/; revision=62704 --- reactos/win32ss/user/winsrv/winsrv.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/win32ss/user/winsrv/winsrv.rc b/reactos/win32ss/user/winsrv/winsrv.rc index c4ce8a33884..e7dcc093dd1 100644 --- a/reactos/win32ss/user/winsrv/winsrv.rc +++ b/reactos/win32ss/user/winsrv/winsrv.rc @@ -4,7 +4,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #define REACTOS_VERSION_DLL -#define REACTOS_STR_FILE_DESCRIPTION "ReactOS User API & Console Server & Terminal Emulator DLL" +#define REACTOS_STR_FILE_DESCRIPTION "ReactOS User & Console API Server + Terminal Emulator DLL" #define REACTOS_STR_INTERNAL_NAME "winsrv" #define REACTOS_STR_ORIGINAL_FILENAME "winsrv.dll" #include From e2fea810c4b617057c7c2c1b0da2b2b03bc57cd3 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 11 Apr 2014 15:49:48 +0000 Subject: [PATCH 283/419] =?UTF-8?q?[TRANSLATIONS]=20*=20General=20maintena?= =?UTF-8?q?nce=20of=20Romanian=20resources.=20By=20=C8=98tefan=20Fulea.=20?= =?UTF-8?q?CORE-7908?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=62705 --- .../base/applications/charmap/lang/ro-RO.rc | 9 ++--- .../base/applications/magnify/lang/ro-RO.rc | 2 +- .../base/applications/mplay32/lang/ro-RO.rc | 2 +- reactos/base/applications/mstsc/lang/ro-RO.rc | 2 +- reactos/base/applications/rapps/lang/ro-RO.rc | 14 +++---- reactos/base/applications/regedit/clb/clb.rc | 3 ++ .../applications/regedit/clb/lang/ro-RO.rc | 28 +++++++++++++ reactos/base/applications/wordpad/lang/Ro.rc | 2 +- reactos/base/shell/cmd/lang/ro-RO.rc | 16 ++++---- reactos/base/system/diskpart/lang/ro-RO.rc | 6 +-- reactos/dll/cpl/appwiz/lang/ro-RO.rc | 4 +- reactos/dll/cpl/intl/lang/ro-RO.rc | 23 +++++------ reactos/dll/cpl/sysdm/lang/ro-RO.rc | 4 +- reactos/dll/win32/browseui/lang/ro-RO.rc | 6 +-- reactos/dll/win32/comctl32/lang/comctl_Ro.rc | 4 +- reactos/dll/win32/comdlg32/lang/cdlg_Ro.rc | 11 ++--- reactos/dll/win32/devmgr/lang/ro-RO.rc | 6 +-- reactos/dll/win32/msgina/lang/ro-RO.rc | 40 +++++++++---------- reactos/dll/win32/shell32/lang/ro-RO.rc | 12 +++--- reactos/dll/win32/syssetup/lang/ro-RO.rc | 6 +-- .../winsrv/consrv/frontends/gui/lang/ro-RO.rc | 2 +- 21 files changed, 116 insertions(+), 86 deletions(-) create mode 100644 reactos/base/applications/regedit/clb/lang/ro-RO.rc diff --git a/reactos/base/applications/charmap/lang/ro-RO.rc b/reactos/base/applications/charmap/lang/ro-RO.rc index 40d6753c193..746e5d8e814 100644 --- a/reactos/base/applications/charmap/lang/ro-RO.rc +++ b/reactos/base/applications/charmap/lang/ro-RO.rc @@ -1,8 +1,7 @@ /* * FILE: base/applications/charmap/lang/ro-RO.rc * ReactOS Project (http://www.reactos.org) - * TRANSLATOR: Fulea Ștefan (PM on ReactOS Forum at fulea.stefan) - * LAST CHANGE: 2011-12-19 corrections + * TRANSLATOR: Ștefan Fulea (stefan dot fulea at mail dot md) */ LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL @@ -42,11 +41,11 @@ BEGIN END IDD_ABOUTBOX DIALOGEX 22, 16, 270, 182 -CAPTION "Despre Harta caracterelor" +CAPTION "Despre" FONT 8, "MS Shell Dlg", 0, 0 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME BEGIN - LTEXT "Harta caracterelor v0.1\nDrept de autor (C) 2007 Ged Murphy (gedmurphy@reactos.org)\nTraducere de Fulea Ștefan", IDC_STATIC, 48, 7, 210, 36 + LTEXT "Hartă a caracterelor v0.1\nDrept de autor (C) 2007 Ged Murphy (gedmurphy@reactos.org)\nTraducere de Ștefan Fulea (stefan.fulea@mail.md)", IDC_STATIC, 48, 7, 210, 36 PUSHBUTTON "Î&nchide", IDOK, 105, 162, 44, 15 ICON IDI_ICON, IDC_STATIC, 10, 10, 7, 30 EDITTEXT IDC_LICENSE_EDIT, 8, 44, 254, 107, WS_VISIBLE | WS_VSCROLL | @@ -57,5 +56,5 @@ STRINGTABLE BEGIN IDS_LICENSE "Această aplicație este publică; fiind permisă modificarea și/sau (re)distribuția sa în termenii Licenței Publice Generale GNU publicată de Free Software Foundation; sau versiunea 2 a Licenței, sau (la alegere) a oricărei versiuni ulterioare.\r\n\r\nAceastă aplicație este distribuită doar în speranța de a fi utilă, FĂRĂ însă NICI O GARANȚIE; nici măcar cu garanția implicită a VANDABILITĂȚII sau a UTILITĂȚII ÎNTR-UN SCOP ANUME. Pentru mai multe detalii consultați Licența Publică Generală GNU.\r\n\r\nPuteți vedea această licență aici:\r\nhttp://www.gnu.org/licenses/gpl.html\r\n\r\nDe asemenea puteți consulta traduceri neoficiale ale acestei licențe aici:\r\nhttp://www.gnu.org/licenses/translations.html" IDS_ABOUT "&Despre…" - IDS_TITLE "Harta caracterelor" + IDS_TITLE "Hartă a caracterelor" END diff --git a/reactos/base/applications/magnify/lang/ro-RO.rc b/reactos/base/applications/magnify/lang/ro-RO.rc index 7fa925d7e09..8120ca10419 100644 --- a/reactos/base/applications/magnify/lang/ro-RO.rc +++ b/reactos/base/applications/magnify/lang/ro-RO.rc @@ -62,7 +62,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Î&nchide", IDOK, 193, 76, 50, 14 ICON IDI_ICON, IDC_STATIC, 7, 17, 20, 20 - LTEXT "Acest instrument este destinat celor cu deficiențe vizuale minore. Pentru rezultate mai bune, folosiți un instrument mai sofisticat.", IDC_STATIC, 36, 7, 207, 33 + LTEXT "Acest instrument este destinat persoanelor cu deficiențe vizuale minore. Pentru rezultate mai bune, folosiți un instrument mai sofisticat.", IDC_STATIC, 36, 7, 207, 33 CONTROL "N&u doresc recurența acestui mesaj", IDC_SHOWWARNINGCHECK, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 43, 80, 137, 10 END diff --git a/reactos/base/applications/mplay32/lang/ro-RO.rc b/reactos/base/applications/mplay32/lang/ro-RO.rc index 6490db17f23..b2c224c8174 100644 --- a/reactos/base/applications/mplay32/lang/ro-RO.rc +++ b/reactos/base/applications/mplay32/lang/ro-RO.rc @@ -40,5 +40,5 @@ BEGIN IDS_APPTITLE "Lector multimedia" IDS_PLAY "Lecturare" IDS_DEFAULTMCIERRMSG "Nu există descriere pentru această eroare" - IDS_UNKNOWNFILEEXT "Cannot determine the device type from the given filename extension." + IDS_UNKNOWNFILEEXT "Nu se poate determina tipul dispozitivului din extensia fișierului." END diff --git a/reactos/base/applications/mstsc/lang/ro-RO.rc b/reactos/base/applications/mstsc/lang/ro-RO.rc index a1002b73964..dfcf4648fa7 100644 --- a/reactos/base/applications/mstsc/lang/ro-RO.rc +++ b/reactos/base/applications/mstsc/lang/ro-RO.rc @@ -39,7 +39,7 @@ BEGIN COMBOBOX IDC_BPPCOMBO, 56, 102, 128, 80, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "", IDC_COLORIMAGE, "Static", SS_OWNERDRAW | SS_SUNKEN, 56, 121, 127, 10 LTEXT "Notă: Această preferință poate fi sau nu compatibilă cu configurația calculatorului gazdă. Preferințele incompatibile vor fi ignorate.", IDC_STATIC, 56, 138, 155, 27 - LTEXT "Mic", IDC_STATIC, 35, 42, 15, 8 + LTEXT "Mică", IDC_STATIC, 35, 42, 15, 8 LTEXT "Mare", IDC_STATIC, 189, 42, 17, 8 LTEXT "", IDC_SETTINGS_RESOLUTION_TEXT, 56, 62, 120, 10, SS_CENTER END diff --git a/reactos/base/applications/rapps/lang/ro-RO.rc b/reactos/base/applications/rapps/lang/ro-RO.rc index 55011b8938f..b555380193c 100644 --- a/reactos/base/applications/rapps/lang/ro-RO.rc +++ b/reactos/base/applications/rapps/lang/ro-RO.rc @@ -91,7 +91,7 @@ END IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 76 STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE -CAPTION "Descărcare…" +CAPTION "Se descarcă…" FONT 8, "MS Shell Dlg" BEGIN CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 @@ -101,10 +101,10 @@ END IDD_ABOUT_DIALOG DIALOGEX 22, 16, 190, 66 STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME -CAPTION "Despre gestionarul de aplicații ReactOS" +CAPTION "Despre gestionarul de programe" FONT 8, "MS Shell Dlg" BEGIN - LTEXT "Gestionar de aplicații ReactOS\nDrept de autor (C) 2009\nde către Dmitry Chapyshev (dmitry@reactos.org)", IDC_STATIC, 48, 7, 130, 39 + LTEXT "Gestionar de programe ReactOS\nDrept de autor (C) 2009\nde către Dmitry Chapyshev (dmitry@reactos.org)", IDC_STATIC, 48, 7, 130, 39 PUSHBUTTON "Î&nchide", IDOK, 133, 46, 50, 14 ICON IDI_MAIN, IDC_STATIC, 10, 10, 7, 30 END @@ -177,13 +177,13 @@ END STRINGTABLE BEGIN - IDS_APPTITLE "Gestionar de aplicații ReactOS" + IDS_APPTITLE "Gestionar de programe" IDS_SEARCH_TEXT "Căutare…" IDS_INSTALL "Instalează" IDS_UNINSTALL "Dezinstalează" IDS_MODIFY "Modifică" - IDS_APPS_COUNT "Numărul de aplicații: %d" - IDS_WELCOME_TITLE "Bun venit la gestionarul de aplicații ReactOS!\n\n" + IDS_APPS_COUNT "Numărul de programe: %d" + IDS_WELCOME_TITLE "Bun venit la gestionarul de programe ReactOS!\n\n" IDS_WELCOME_TEXT "Alegeți o categorie din stânga, apoi alegeți o aplicație pentru a o instala sau dezinstala.\nArdesa web ReactOS: " IDS_WELCOME_URL "http://www.reactos.org" IDS_INSTALLED "Instalate" @@ -194,5 +194,5 @@ BEGIN IDS_CHOOSE_FOLDER_ERROR "Dosarul specificat nu există. Doriți crearea lui?" IDS_APP_REG_REMOVE "Sigur doriți să ștergeți datele din registru pentru această aplicațe?" IDS_INFORMATION "Informație" - IDS_UNABLE_TO_REMOVE "Nu se pot elimina datele din registru pentru această aplicație!" + IDS_UNABLE_TO_REMOVE "Nu se pot elimina datele din registru pentru acest program!" END diff --git a/reactos/base/applications/regedit/clb/clb.rc b/reactos/base/applications/regedit/clb/clb.rc index 8f80653dc7c..8165a6be782 100644 --- a/reactos/base/applications/regedit/clb/clb.rc +++ b/reactos/base/applications/regedit/clb/clb.rc @@ -42,6 +42,9 @@ #ifdef LANGUAGE_NB_NO #include "lang/no-NO.rc" #endif +#ifdef LANGUAGE_RO_RO + #include "lang/ro-RO.rc" +#endif #ifdef LANGUAGE_SK_SK #include "lang/sk-SK.rc" #endif diff --git a/reactos/base/applications/regedit/clb/lang/ro-RO.rc b/reactos/base/applications/regedit/clb/lang/ro-RO.rc new file mode 100644 index 00000000000..fc680d38312 --- /dev/null +++ b/reactos/base/applications/regedit/clb/lang/ro-RO.rc @@ -0,0 +1,28 @@ +/* Translator: Ștefan Fulea (stefan dot fulea at mail dot md) */ + +LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL + +IDD_COLUMNLISTBOXSTYLES DIALOGEX 0, 0, 227, 215 +STYLE DS_SHELLFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Stiluri de câmp-listă coloană" +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Stiluri de câmp-listă coloană", -1, 6, 7, 158, 71 + CHECKBOX "&Standard", 1710, 10, 20, 42, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Margine", 1713, 10, 30, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Ordonat", 1705, 10, 40, 26, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Notifi&cantă", 1706, 10, 50, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "De&rulantă vert.", 1707, 10, 60, 64, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Sel. m&ultiplă", -1, 79, 20, 72, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP | WS_DISABLED + CHECKBOX "Sel. e&xtinsă", -1, 79, 30, 77, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP | WS_DISABLED + CHECKBOX "Titluri &evidente", 1714, 79, 40, 68, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Coloane flexi&bile", 1715, 79, 50, 66, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + GROUPBOX "Stiluri de bază", -1, 6, 80, 158, 34 + CHECKBOX "&Vizibil", 1701, 10, 92, 34, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Dezactivat", 1702, 10, 102, 41, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "&Grup", 1703, 79, 92, 32, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Cooptează &tab", 1704, 79, 102, 44, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Con&firmă", IDOK, 37, 125, 40, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "A&nulează", IDCANCEL, 93, 125, 40, 14, BS_PUSHBUTTON | WS_GROUP | WS_TABSTOP + CHECKBOX "De&zact. ne-derulare", 1708, 79, 60, 66, 10, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP +END diff --git a/reactos/base/applications/wordpad/lang/Ro.rc b/reactos/base/applications/wordpad/lang/Ro.rc index 3c49dd8c47c..b56f0ce6949 100644 --- a/reactos/base/applications/wordpad/lang/Ro.rc +++ b/reactos/base/applications/wordpad/lang/Ro.rc @@ -55,7 +55,7 @@ BEGIN MENUITEM "Caută u&rmătorul\tF3", ID_FIND_NEXT MENUITEM "Î&nlocuire…\tCtrl+H", ID_REPLACE MENUITEM SEPARATOR - MENUITEM "D&oar citire", ID_EDIT_READONLY + MENUITEM "Nem&odificabil", ID_EDIT_READONLY MENUITEM "&Modificat", ID_EDIT_MODIFIED MENUITEM SEPARATOR POPUP "&Suplimente" diff --git a/reactos/base/shell/cmd/lang/ro-RO.rc b/reactos/base/shell/cmd/lang/ro-RO.rc index 40f18cc9d1a..112b4fe0984 100644 --- a/reactos/base/shell/cmd/lang/ro-RO.rc +++ b/reactos/base/shell/cmd/lang/ro-RO.rc @@ -21,8 +21,8 @@ ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] fișier ...\n\ [/S [/D]]\n\n\ + Consimte atributul\n\ - Reprobă atributul\n\ - R Atributul fișierelor protejate la scriere\n\ - A Atributul fișierelor pentru arhivare\n\ + R Atributul fișierelor nemodificabile\n\ + A Atributul fișierelor arhivabile\n\ S Atributul fișierelor de sistem\n\ H Atributul fișierelor ascunse\n\ /S Aplică și pentru fișierele din subdirectoare\n\ @@ -145,12 +145,12 @@ ERASE [/N /P /T /Q /S /W /Y /Z /A[[:]atribute]] fișier ...\n\n\ /Q Suprimă orice mesaj.\n\ /W Suprascrie fișierele cu informații aleatoare înainte de a le șterge.\n\ /Y Preconfirmă toate ștergerile.\n\ - /F Șterge și fișierelor ascunse, de sistem sau protejate la scriere.\n\ + /F Șterge și fișierelor ascunse, nemodificabile și de sistem.\n\ /S Șterge fișierul specificat din toate subdirectoarele.\n\ /A Selectează fișierele după atribute.\n\ Atribute:\n\ - R Protejat la scriere\n\ - S Sistem\n\ + R Nemodificabil\n\ + S De sistem\n\ A Arhivabil\n\ H Ascuns\n\ - Prefix de negație\n" @@ -166,7 +166,7 @@ DELAY [/m]n\n\n\ [unitate:][cale][fișier]\n\ Specifică unitatea, directorul și/sau fișierele de enumerat.\n\n\ /A Afișează fișierele după atributele specificate.\n\ - atribute D Directoare R Fișiere protejate la scriere\n\ + atribute D Directoare R Fișiere nemodificabile\n\ H Fișiere ascunse A Fișiere arhivabile\n\ S Fișiere de sistem - Prefix pentru negație\n\ /B Preferă format minim (fără sumar sau informații de titlu).\n\ @@ -383,8 +383,8 @@ REPLACE [unitate1:][cale1]fișier [unitate2:][cale2] [/P] [/R] [/S] [/W] [/U]\n\ poate folosi cu argumentele /S sau /U\n\ /P Cere confirmare înaintea înlocuirii unui fișier sau\n\ a adăugării unui fișier sursă.\n\ - /R Înlocuiește atât fișierele neprotejate, cât și cele\n\ - protejate la scriere.\n\ + /R Înlocuiește atât fișierele modificabile, cât și\n\ + fișierele nemodificabile.\n\ /S Înlocuiește fișierele în toate subdirectoarele\n\ directorului destinație. Nu se poate folosi cu\n\ argumentul /A.\n\ diff --git a/reactos/base/system/diskpart/lang/ro-RO.rc b/reactos/base/system/diskpart/lang/ro-RO.rc index 14520fba935..31c0f8ffb6e 100644 --- a/reactos/base/system/diskpart/lang/ro-RO.rc +++ b/reactos/base/system/diskpart/lang/ro-RO.rc @@ -1,4 +1,4 @@ -/* Romanian translation by Fulea Ștefan */ +/* Romanian translation by Ștefan Fulea */ LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL @@ -26,8 +26,8 @@ BEGIN IDS_DETAIL_INFO_TARGET "Țintă" IDS_DETAIL_INFO_LUN_ID "LUN ID" IDS_DETAIL_INFO_LOC_PATH "Localizat în" - IDS_DETAIL_INFO_CURR_RO_STATE "Stare curentă doar-citire" - IDS_DETAIL_INFO_RO "Protejat-la-scriere" + IDS_DETAIL_INFO_CURR_RO_STATE "Stare curentă nemodificabilă" + IDS_DETAIL_INFO_RO "Nemodificabil" IDS_DETAIL_INFO_BOOT_DSK "Disc inițializator" IDS_DETAIL_INFO_PAGE_FILE_DSK "Disc cu fișier de paginare" IDS_DETAIL_INFO_HIBER_FILE_DSK "Disc cu fișier de hibernare" diff --git a/reactos/dll/cpl/appwiz/lang/ro-RO.rc b/reactos/dll/cpl/appwiz/lang/ro-RO.rc index 5518f09c621..40c05fa8e33 100644 --- a/reactos/dll/cpl/appwiz/lang/ro-RO.rc +++ b/reactos/dll/cpl/appwiz/lang/ro-RO.rc @@ -49,7 +49,7 @@ END STRINGTABLE BEGIN - IDS_CPLSYSTEMNAME "Gestionar de aplicații" + IDS_CPLSYSTEMNAME "Gestionar de programe" IDS_CPLSYSTEMDESCRIPTION "Instalează programe și crează scurtături." IDS_CREATE_SHORTCUT "Asistentul pentru creare de scurtătură" IDS_ERROR_NOT_FOUND "Elementul „%s” nu poate fi localizat." @@ -64,7 +64,7 @@ END ID_DWL_GECKO_DIALOG DIALOG 0, 0, 260, 95 STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Instalarea Wine Gecko" +CAPTION "Instalare Wine Gecko" FONT 8, "MS Shell Dlg" BEGIN CONTROL "Pachetul Wine Gecko, necesar pentru funcționarea corectă a aplicațiilor cu HTML încorporat, nu este există local. ReactOS permite totuși descărcarea și instalarea automată a acestuia.", diff --git a/reactos/dll/cpl/intl/lang/ro-RO.rc b/reactos/dll/cpl/intl/lang/ro-RO.rc index 2c5d5423a26..ea20e7b16f3 100644 --- a/reactos/dll/cpl/intl/lang/ro-RO.rc +++ b/reactos/dll/cpl/intl/lang/ro-RO.rc @@ -196,16 +196,15 @@ END STRINGTABLE BEGIN - IDS_ERROR "Error" - IDS_ERROR_SYMBOL_SEPARATE "The short date components separator contains incorrect symbol(s)" - IDS_ERROR_SYMBOL_FORMAT_SHORT "The short date format contains incorrect symbol(s)" - IDS_ERROR_SYMBOL_FORMAT_LONG "The long date format contains incorrect symbol(s)" - IDS_ERROR_OEM_CODE_PAGE "There was a problem reading the OEM code page" - IDS_ERROR_ANSI_CODE_PAGE "There was a problem reading the ANSI code page" - IDS_ERROR_INT_KEY_REG "Problem opening key: HKCU\\Control Panel\\International" - IDS_ERROR_DEF_INT_KEY_REG "Problem opening key: HKU\\.DEFAULT\\Control Panel\\International" - IDS_ERROR_NLS_KEY_REG "Problem opening key: HKLM\\SYSTEM\\CurrentControlSet\\Control\\NLS\\Language" - IDS_ERROR_NLS_CODE_REG "Problem opening key: HKLM\\SYSTEM\\CurrentControlSet\\Control\\NLS\\CodePage" - IDS_ERROR_INPUT_DLL "Unable to start input.dll" + IDS_ERROR "Eroare" + IDS_ERROR_SYMBOL_SEPARATE "Separatorul de dată prescurtată introdus conține simbol(uri) incorect(e)" + IDS_ERROR_SYMBOL_FORMAT_SHORT "Formatul de dată prescurtată introdus conține simbol(uri) incorect(e)" + IDS_ERROR_SYMBOL_FORMAT_LONG "Formatul de dată completă introdus conține simbol(uri) incorect(e)" + IDS_ERROR_OEM_CODE_PAGE "Problemă la citirea codului de pagină OEM" + IDS_ERROR_ANSI_CODE_PAGE "Problemă la citirea codului de pagină ANSI" + IDS_ERROR_INT_KEY_REG "Problemă la deschiderea cheii: HKCU\\Control Panel\\International" + IDS_ERROR_DEF_INT_KEY_REG "Problemă la deschiderea cheii: HKU\\.DEFAULT\\Control Panel\\International" + IDS_ERROR_NLS_KEY_REG "Problemă la deschiderea cheii: HKU\\.DEFAULT\\Control Panel\\International" + IDS_ERROR_NLS_CODE_REG "Problemă la deschiderea cheii: HKU\\.DEFAULT\\Control Panel\\International" + IDS_ERROR_INPUT_DLL "Nu se poate lansa input.dll" END - diff --git a/reactos/dll/cpl/sysdm/lang/ro-RO.rc b/reactos/dll/cpl/sysdm/lang/ro-RO.rc index 90c1da1278d..eba3d3a70f5 100644 --- a/reactos/dll/cpl/sysdm/lang/ro-RO.rc +++ b/reactos/dll/cpl/sysdm/lang/ro-RO.rc @@ -277,7 +277,7 @@ BEGIN IDS_WARNMAXIMUMSIZE "Introduceți o valoare numerică pentru dimensiunea maximă a fișierului de paginare." IDS_WARNINITIALRANGE "Dimensiunea inițială a fișierului de paginare trebuie să fie încadrată între 2 Mo și spațiul liber disponibil al unității selectate." IDS_WARNMAXIMUMRANGE "Dimensiunea maximă a fișierului de paginare trebuie să fie încadrată între dimensiunea inițială și spațiul liber disponibil al unității selectate." - IDS_PAGEFILE_NONE "none" - IDS_PAGEFILE_SYSTEM "system managed" + IDS_PAGEFILE_NONE "nespecificat" + IDS_PAGEFILE_SYSTEM "gestionat de sistem" IDS_DEVS "\nEchipa ReactOS\n\nCoordonator de proiect\n\nAleksey Bragin\n\nEchipa de dezvoltare\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nIngineri de distribuție\n\nColin Finck\nZ98\n\nEchipa paginii web\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nEchipa multimedia\n\nMindflyer\nWierd_W\n\nmulțumiri adresate către\n\ntoți Contribuitorii\nEchipa Wine\n\n" END diff --git a/reactos/dll/win32/browseui/lang/ro-RO.rc b/reactos/dll/win32/browseui/lang/ro-RO.rc index 24c6574c8e3..11bb527b753 100644 --- a/reactos/dll/win32/browseui/lang/ro-RO.rc +++ b/reactos/dll/win32/browseui/lang/ro-RO.rc @@ -1,4 +1,4 @@ -/* Translated by Fulea Ștefan */ +/* Ștefan Fulea (stefan dot fulea at mail dot md) */ LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL @@ -49,8 +49,8 @@ BEGIN MENUITEM "", FCIDM_MENU_VIEW_SEP_OPTIONS, MFT_SEPARATOR POPUP "&Navigare", FCIDM_MENU_EXPLORE BEGIN - MENUITEM "Î&napoi\tAlt+Left Arrow", IDM_GOTO_BACK - MENUITEM "Îna&poi\tAlt+Right Arrow", IDM_GOTO_FORWARD + MENUITEM "Înap&oi\tAlt+Left Arrow", IDM_GOTO_BACK + MENUITEM "În&ainte\tAlt+Right Arrow", IDM_GOTO_FORWARD MENUITEM "Un nivel în s&us", IDM_GOTO_UPONELEVEL MENUITEM "", -1, MFT_SEPARATOR MENUITEM "Pagină &inițială\tAlt+Home", IDM_GOTO_HOMEPAGE diff --git a/reactos/dll/win32/comctl32/lang/comctl_Ro.rc b/reactos/dll/win32/comctl32/lang/comctl_Ro.rc index a42295126e5..50d7bba2fae 100644 --- a/reactos/dll/win32/comctl32/lang/comctl_Ro.rc +++ b/reactos/dll/win32/comctl32/lang/comctl_Ro.rc @@ -4,7 +4,7 @@ * Copyright 1999 Bertho Stultiens * Copyright 1999 Eric Kohl * Copyright 2008 Michael Stefaniuc - * 2012 Fulea Ștefan + * 2012 Ștefan Fulea * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -59,7 +59,7 @@ END IDD_WIZARD DIALOG 0, 0, 290, 159 STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE -CAPTION "Expert" +CAPTION "Asistent" FONT 8, "MS Shell Dlg" BEGIN PUSHBUTTON "< Înap&oi", IDC_BACK_BUTTON,56,138,55,14 diff --git a/reactos/dll/win32/comdlg32/lang/cdlg_Ro.rc b/reactos/dll/win32/comdlg32/lang/cdlg_Ro.rc index 3d51ec8c39f..420a717ce88 100644 --- a/reactos/dll/win32/comdlg32/lang/cdlg_Ro.rc +++ b/reactos/dll/win32/comdlg32/lang/cdlg_Ro.rc @@ -152,7 +152,7 @@ FONT 8, "MS Shell Dlg" LTEXT "N&ume fișier:", stc3, 6, 6, 76, 9 EDITTEXT edt1, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP LISTBOX lst1, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "D&osare:", -1, 110, 6, 92, 9 + LTEXT "Dos&ar:", -1, 110, 6, 92, 9 LTEXT "", stc1, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP LISTBOX lst2, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP LTEXT "&Tip de fișier:", stc2, 6, 104, 90, 9 @@ -162,7 +162,7 @@ FONT 8, "MS Shell Dlg" DEFPUSHBUTTON "&Deschide", IDOK, 208, 6, 60, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP PUSHBUTTON "A&nulează", IDCANCEL, 208, 24, 60, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&Manual…", pshHelp, 208, 46, 60, 14, WS_GROUP | WS_TABSTOP - CHECKBOX "Do&ar-citire", chx1, 208, 68, 65, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Nem&odificabil", chx1, 208, 68, 65, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP } @@ -174,7 +174,7 @@ FONT 8, "MS Shell Dlg" LTEXT "N&ume fișier:", stc3, 6, 6, 76, 9 EDITTEXT edt1, 6, 16, 90, 12, ES_AUTOHSCROLL | ES_OEMCONVERT | WS_BORDER | WS_TABSTOP LISTBOX lst1, 6, 32, 90, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP - LTEXT "D&osare:", -1, 110, 6, 92, 9 + LTEXT "Dos&ar:", -1, 110, 6, 92, 9 LTEXT "", stc1, 110, 18, 92, 9, SS_NOPREFIX | WS_GROUP LISTBOX lst2, 110, 32, 92, 68, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_TABSTOP LTEXT "&Tip de fișier:", stc2, 6, 104, 90, 9 @@ -184,7 +184,7 @@ FONT 8, "MS Shell Dlg" DEFPUSHBUTTON "&Păstrează", IDOK, 208, 6, 60, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP PUSHBUTTON "A&nulează", IDCANCEL, 208, 24, 60, 14, WS_GROUP | WS_TABSTOP PUSHBUTTON "&Manual…", pshHelp, 208, 46, 60, 14, WS_GROUP | WS_TABSTOP - CHECKBOX "Do&ar-citire", chx1, 208, 68, 65, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP + CHECKBOX "Nem&odificabil", chx1, 208, 68, 65, 12, BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP } @@ -459,11 +459,12 @@ FONT 8, "MS Shell Dlg" LTEXT "N&ume fișier:", IDC_FILENAMESTATIC,5,112,56,16, SS_NOTIFY EDITTEXT IDC_FILENAME,63,110,150,12,ES_AUTOHSCROLL + CONTROL "", cmb13, "ComboBoxEx32", CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP, 63,110,150,150 LTEXT "&Tip de fișier:", IDC_FILETYPESTATIC,5,130,56,16, SS_NOTIFY COMBOBOX IDC_FILETYPE,63,128,150,53,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Do&ar-citire", IDC_OPENREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63,148,150,10 + CONTROL "Nem&odificabil", IDC_OPENREADONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,63,148,150,10 DEFPUSHBUTTON "&Deschide", IDOK,222,110,54,14 PUSHBUTTON "A&nulează", IDCANCEL,222,128,54,14 diff --git a/reactos/dll/win32/devmgr/lang/ro-RO.rc b/reactos/dll/win32/devmgr/lang/ro-RO.rc index 61ec4660991..26076c174b5 100644 --- a/reactos/dll/win32/devmgr/lang/ro-RO.rc +++ b/reactos/dll/win32/devmgr/lang/ro-RO.rc @@ -1,4 +1,4 @@ -/* Romanian translation by Petru Dimitriu, Fulea Ștefan */ +/* Romanian translation by Petru Dimitriu, Ștefan Fulea */ LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL @@ -177,8 +177,8 @@ BEGIN EDITTEXT IDC_DIGITALSIGNER, 100, 81, 145, 12, NOT WS_TABSTOP | NOT WS_BORDER | ES_AUTOHSCROLL | ES_READONLY PUSHBUTTON "&Detalii…", IDC_DRIVERDETAILS, 7, 106, 75, 15 LTEXT "Mai multe detalii despre modulele pilot.", -1, 91, 110, 154, 17, SS_NOPREFIX - PUSHBUTTON "&Actualizare modul-pilot…", IDC_UPDATEDRIVER, 7, 126, 75, 15 - LTEXT "Actualizare modulului-pilot pentru dispozitiv.", -1, 91, 130, 154, 17, SS_NOPREFIX + PUSHBUTTON "&Actualizare…", IDC_UPDATEDRIVER, 7, 126, 75, 15 + LTEXT "Actualizați modulul-pilot pentru dispozitiv.", -1, 91, 130, 154, 17, SS_NOPREFIX END IDD_DRIVERDETAILS DIALOGEX 0, 0, 224, 230 diff --git a/reactos/dll/win32/msgina/lang/ro-RO.rc b/reactos/dll/win32/msgina/lang/ro-RO.rc index bafb790fe2c..4e517e63095 100644 --- a/reactos/dll/win32/msgina/lang/ro-RO.rc +++ b/reactos/dll/win32/msgina/lang/ro-RO.rc @@ -31,7 +31,7 @@ BEGIN EDITTEXT IDC_USERNAME, 60, 57, 155, 14, ES_AUTOHSCROLL LTEXT "Parola:", IDC_STATIC, 6, 78, 52, 8 EDITTEXT IDC_PASSWORD, 60, 76, 155, 14, ES_AUTOHSCROLL | ES_PASSWORD - LTEXT "Log on to:", IDC_STATIC, 6, 96, 52, 8 + LTEXT "Vă autentificați la:", IDC_STATIC, 6, 96, 52, 8 COMBOBOX IDC_LOGON_TO, 60, 95, 155, 14, CBS_DROPDOWNLIST | WS_VSCROLL PUSHBUTTON "Con&firmă", IDOK, 106, 122, 50, 14, BS_DEFPUSHBUTTON PUSHBUTTON "A&nulează", IDCANCEL, 160, 122, 50, 14 @@ -141,29 +141,29 @@ BEGIN IDS_LOCKMSG "Doar %s sau un Administrator poate debloca acest calculator." IDS_LOGONMSG "Sunteți autentificat ca %s." IDS_LOGONDATE "Data autentificării: %s %s" - IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." - IDS_CHANGEPWDTITLE "Change Password" - IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." - IDS_PASSWORDCHANGED "Your password has been changed." - IDS_LOGONTITLE "Logon Message" - IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." - IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_COMPUTERLOCKED "Calculator blocat" + IDS_LOCKEDWRONGPASSWORD "Parola este eronată. Încercați din nou. Literele din parola necesită atenție la capitalizare." + IDS_LOCKEDWRONGUSER "Acest calculator a fost blocat. Doar %s\\%s sau un Administrator pot debloca acest calculator." + IDS_CHANGEPWDTITLE "Modifică parola" + IDS_NONMATCHINGPASSWORDS "Parolele tastate nu corespund. Tastați aceiași parolă în ambele câmpuri de intrpducere." + IDS_PASSWORDCHANGED "Parola dumneavoastră a fost modificată." + IDS_LOGONTITLE "Mesaj de autentificare" + IDS_LOGONWRONGUSERORPWD "Sistemul nu vă poate autentifica. Asigurați-vă că numele și domeniul sunt corecte apoi tastați din nou parola. În parolă se face distincție între majuscule și minuscule." + IDS_LOGONUSERDISABLED "Contul dumneavoastră a fost dezactivat. Contactați administratorul de sistem." END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN - IDS_SHUTDOWN_LOGOFF "Log off ""%s""" - IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_RESTART "Restart" - IDS_SHUTDOWN_SLEEP "Sleep" - IDS_SHUTDOWN_HIBERNATE "Hibernate" + IDS_SHUTDOWN_LOGOFF "Deautentificare ""%s""" + IDS_SHUTDOWN_SHUTDOWN "Închidere" + IDS_SHUTDOWN_RESTART "Repornire" + IDS_SHUTDOWN_SLEEP "Stare de veghe" + IDS_SHUTDOWN_HIBERNATE "Hibernare" /* Shut down descriptions */ - IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." - IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." - IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." - IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." + IDS_SHUTDOWN_LOGOFF_DESC "Închide sesiunea curentă permițând altor utilizatori autentificarea în sistem." + IDS_SHUTDOWN_SHUTDOWN_DESC "Închide atât sesiunea curentă cât și sistemul de operare pentru a puta opri în siguranță alimentarea electrică." + IDS_SHUTDOWN_RESTART_DESC "Închide sesiunea curentă și repornește sistemul." + IDS_SHUTDOWN_SLEEP_DESC "Induce sistemul în starea de veghe." + IDS_SHUTDOWN_HIBERNATE_DESC "Păstrează sesiunea curentă și oprește calculatorul." END diff --git a/reactos/dll/win32/shell32/lang/ro-RO.rc b/reactos/dll/win32/shell32/lang/ro-RO.rc index 931d71c8f75..4ebf552799e 100644 --- a/reactos/dll/win32/shell32/lang/ro-RO.rc +++ b/reactos/dll/win32/shell32/lang/ro-RO.rc @@ -213,9 +213,9 @@ BEGIN EDITTEXT 14015, 68, 128, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP | ES_AUTOHSCROLL LTEXT "", -1, 8, 144, 221, 1, SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE LTEXT "Atribute:", 14020, 8, 152, 46, 10 - AUTOCHECKBOX "&Doar-citire", 14021, 56, 152, 70, 10 + AUTOCHECKBOX "Nem&odificabil", 14021, 56, 152, 70, 10 AUTOCHECKBOX "Asc&uns", 14022, 56, 166, 70, 10 - AUTOCHECKBOX "Ar&hivă", 14023, 56, 180, 70, 10 + AUTOCHECKBOX "Ar&hivabil", 14023, 56, 180, 70, 10 PUSHBUTTON "A&vansate…", 14028, 158, 150, 70, 14, WS_CHILD | WS_VISIBLE | WS_TABSTOP END @@ -249,9 +249,9 @@ BEGIN EDITTEXT 14019, 68, 163, 160, 10, ES_LEFT | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP LTEXT "", -1, 8, 179, 221, 1, SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE LTEXT "Atribute:", 14020, 8, 189, 45, 10 - AUTOCHECKBOX "&Doar-citire", 14021, 58, 189, 67, 10 + AUTOCHECKBOX "Nem&odificabil", 14021, 58, 189, 67, 10 AUTOCHECKBOX "Asc&uns", 14022, 126, 189, 50, 10 - AUTOCHECKBOX "Ar&hivă", 14023, 181, 189, 49, 10 + AUTOCHECKBOX "Ar&hivabil", 14023, 181, 189, 49, 10 PUSHBUTTON "A&vansate…", 14028, 180, 185, 50, 15, WS_TABSTOP END @@ -455,7 +455,7 @@ BEGIN PUSHBUTTON "A&nulează", IDCANCEL, 215, 122, 60, 14 ICON 146, -1, 11, 10, 21, 20, SS_REALSIZECONTROL LTEXT "Dosarul curent deja conține un fișier cu numele „%2”.", 12291, 44, 10, 231, 22, SS_NOPREFIX - LTEXT "Dosarul curent deja conține un fișier doar-citire cu numele „%2”.", 12292, 41, 10, 222, 22, SS_NOPREFIX + LTEXT "Dosarul curent deja conține un fișier nemodificabil cu numele „%2”.", 12292, 41, 10, 222, 22, SS_NOPREFIX LTEXT "Dosarul curent deja conține un fișier de sistem cu numele „%2”.", 12293, 41, 10, 222, 22, SS_NOPREFIX LTEXT "Doriți să înlocuiți acest fișier?", -1, 44, 35, 228, 10, SS_NOPREFIX LTEXT "(mărime/dată necunoscută)", 12302, 79, 51, 198, 20, SS_NOPREFIX @@ -730,7 +730,7 @@ BEGIN IDS_OPEN_WITH_OTHER "Alte programe:" IDS_SHELL_ABOUT_AUTHORS "&Autori" - IDS_SHELL_ABOUT_BACK "< Îna&poi" + IDS_SHELL_ABOUT_BACK "< Înap&oi" FCIDM_SHVIEW_NEW "N&ou" FCIDM_SHVIEW_NEWFOLDER "&Dosar" FCIDM_SHVIEW_NEWLINK "Sc&urtătură" diff --git a/reactos/dll/win32/syssetup/lang/ro-RO.rc b/reactos/dll/win32/syssetup/lang/ro-RO.rc index f7b8dbb13de..6c8bf00b9a4 100644 --- a/reactos/dll/win32/syssetup/lang/ro-RO.rc +++ b/reactos/dll/win32/syssetup/lang/ro-RO.rc @@ -127,15 +127,15 @@ STRINGTABLE BEGIN IDS_ACKTITLE "Conștientizări" IDS_ACKSUBTITLE "Contribuții aduse și informații despre licență" - IDS_OWNERTITLE "Personalizarea sistemului de operare" + IDS_OWNERTITLE "Personalizare sistem" IDS_OWNERSUBTITLE "Asistentul va folosi câteva informații pentru a personaliza ReactOS." - IDS_COMPUTERTITLE "Numele calculatorului și parola de administrator" + IDS_COMPUTERTITLE "Nume calculator și parolă de administrator" IDS_COMPUTERSUBTITLE "Pentru calculator sunt necesare un nume și o parolă de administrator." IDS_LOCALETITLE "Particularizări regionale" IDS_LOCALESUBTITLE "Particularizarea ReactOS pentru anumite regiuni sau limbi." IDS_DATETIMETITLE "Dată și oră" IDS_DATETIMESUBTITLE "Stabiliți data și ora corectă pentru calculator." - IDS_PROCESSTITLE "Înregistrarea componentelor" + IDS_PROCESSTITLE "Înregistrare componente" IDS_PROCESSSUBTITLE "Așteptați…" END diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/ro-RO.rc b/reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/ro-RO.rc index 9f92234d6d5..46c2de95ad8 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/ro-RO.rc +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/lang/ro-RO.rc @@ -22,5 +22,5 @@ BEGIN IDS_SCROLLUP "Derulează în sus" IDS_SCROLLDOWN "Derulează în jos" */ - IDS_TERMINAL_TITLE "ReactOS Console" + IDS_TERMINAL_TITLE "Consola ReactOS" END From 48735ca2a7aab2f449d0d6ec940a8677813de4bf Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 11 Apr 2014 15:53:03 +0000 Subject: [PATCH 284/419] =?UTF-8?q?[RAPPS]=20*=20Romanian=20translation=20?= =?UTF-8?q?update.=20By=20=C8=98tefan=20Fulea.=20CORE-7908?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=62706 --- reactos/base/applications/rapps/rapps/7zip.txt | 4 ++-- reactos/base/applications/rapps/rapps/stamina.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/base/applications/rapps/rapps/7zip.txt b/reactos/base/applications/rapps/rapps/7zip.txt index b0fb16ead28..b35159b9881 100644 --- a/reactos/base/applications/rapps/rapps/7zip.txt +++ b/reactos/base/applications/rapps/rapps/7zip.txt @@ -1,4 +1,4 @@ -; UTF-8 +; UTF-8 [Section] Name = 7-Zip @@ -31,7 +31,7 @@ Description = Gereedschap voor het maken en openen van 7z, zip, tar, rar and and Description = Narzędzie do tworzenia i otwierania plików typu 7zip, zip, tar, i innych plików archiwizacyjnych. (FIXME) [Section.0418] -Description = Utilitar pentru crearea și deschiderea arhivelor 7zip, zip, tar, rar și altele. (FIXME) +Description = Un utilitar de arhivare a fișierelor, compatibil cu 7zip, zip, tar, rar și multe alte formate de arhive. Size = 1,1 Mo [Section.041f] diff --git a/reactos/base/applications/rapps/rapps/stamina.txt b/reactos/base/applications/rapps/rapps/stamina.txt index 449af53f0c2..63adea0ed73 100644 --- a/reactos/base/applications/rapps/rapps/stamina.txt +++ b/reactos/base/applications/rapps/rapps/stamina.txt @@ -1,4 +1,4 @@ -; UTF-8 +; UTF-8 [Section] Name = Stamina 2.5 @@ -13,7 +13,7 @@ CDPath = none Description = Ein freies Schreiblernprogramm. Um dieses Programm nutzen zu können, müssen Sie das Microsoft Visual C++ 6 Redistributable Package installieren. [Section.0418] -Description = Tutor gratuit pentru dactilografiere. (FIXME) +Description = Tutor gratuit pentru dactilografiere. Pentru a putea lansa acest program, asigurați-vă că aveți instalat pachetul Microsoft Visual C++ 6 Redistributable. Size = 4,7 Mo [Section.041f] From 435846f00f286be37b96c240643c67aaaf726b96 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 11 Apr 2014 15:56:16 +0000 Subject: [PATCH 285/419] =?UTF-8?q?[MEDIA/INF]=20*=20Romanian=20translatio?= =?UTF-8?q?n=20update.=20By=20=C8=98tefan=20Fulea.=20CORE-7908=20#resolve?= =?UTF-8?q?=20#comment=20Thanks!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=62707 --- reactos/media/inf/bth.inf | Bin 3050 -> 3316 bytes reactos/media/inf/c_image.inf | Bin 1182 -> 1330 bytes reactos/media/inf/flpydisk.inf | 6 ++++++ reactos/media/inf/shortcuts.inf | Bin 85910 -> 86750 bytes 4 files changed, 6 insertions(+) diff --git a/reactos/media/inf/bth.inf b/reactos/media/inf/bth.inf index 9e8c3aed5b50866399f912613473f4d9ae874d39..4a61fae886c60c436a15345254c4dd062783c31d 100644 GIT binary patch delta 168 zcmaDQ{zY=bEAGjkxI~=w7z`Lp7z`OK7-AWC8MqjN7*ZJ$8Il=F82lN68EhGp7+it8 z42DdG0-(48n!FN7&*b^cio76|K|mELK$ZEEs0yS* dkwtiN0F%(<1Kce9a9s?gAT>a}qHJJQ3;-e!A7TIi delta 7 Ocmew&`AU4lD{cS~CIhqp diff --git a/reactos/media/inf/c_image.inf b/reactos/media/inf/c_image.inf index 3c9ab3ccc4c3d50d6c61475ac17286505a394b48..0d6ba858e269f0ddfa249e16ea7b3dfc07e35fc7 100644 GIT binary patch delta 96 zcmbQoxruATJQi7A1}=tZhG2#gh9ZVchCGIJhGGUi1_K5Y215pm$@(m^imnXF3>iSV o0)|8e1%@DoR3M!URPPVerNjW#Ke>=uc5)kw01rriDnyI{0F6EoGynhq delta 7 OcmdnQHIH+{JQe^8s{*zF diff --git a/reactos/media/inf/flpydisk.inf b/reactos/media/inf/flpydisk.inf index 2dca16d470b..6a1aeebf05c 100644 --- a/reactos/media/inf/flpydisk.inf +++ b/reactos/media/inf/flpydisk.inf @@ -63,3 +63,9 @@ ReactOS = "ReactOS Team" FloppyClassName = "Floppy disk drives" GenericMfg = "(Generic floppy disk drives)" Floppy.DeviceDesc = "Generic floppy disk drive" + +[Strings.0418] +ReactOS = "Echipa ReactOS" +FloppyClassName = "Unitate de disc flexibil" +GenericMfg = "(unități generice de disc flexibil)" +Floppy.DeviceDesc = "Unitate de disc flexibil" diff --git a/reactos/media/inf/shortcuts.inf b/reactos/media/inf/shortcuts.inf index 8c7415e6f3996854d4a2643cbf08c71bb23da30e..013a54e56727b3805f5d9265a8798dd7e831f543 100644 GIT binary patch delta 2100 zcma)7O>9(U6#Z^H)1S$JP8w3$p`Cd`ToC(;S}is;F~MRmX#~3fq?nG=p&6adOy&oT z3jqy@VPS+D`z^5vF5Jl{b0)`{5pau>R4BS(7u1CU5E{ZEE=b1)g=2F$Mh2 zx@gIi5w9TTG7&G}d(l+!WJVhKd@_osp4>=@ua|UCkG~ezoAbMMePdW}Z|pmL94IBT zvt&kpE~%`5M9&R=r5HLxoIHRIS3p^A9LoJTy1 zzq~0}5gCFMS3maD-yGH(PbbFzFLWKyXi-<64kZI=(txDsHI$^(l-}1n6N5h-lKBgr zaf3|Ckaa^O-5jV=mb_VZpTr9*mC;CJP~n&Z>8r>fiyZQNv&+QHteLYvzalSOTNqst zncCIDMK3HQ-)IcAIlGQ}b)ba?Y8Z{@ef{Td(q0ppc)JA<$6M#g`4!L@;poF<{4U}b zqkyqj$Hdb|YZ1G*OAe0DIJeiF+n5m+XG8Qp=SWHD$T~=@Wk&49E}4Fg!dYhq>dX0% z|CXr$m;n&sX~Dd+H7SQ@g0)SJ&u>*Gsj<(N(M%0Pc8=AtIP_E35CJI@vm zNRR!pSJFEi7^>5ND`LB;ZEIuC+Wx?=ywJHSv_eQRvvu)u>jNYX6V~Y2@! z?+7mVIcHc5IyI#4BqR1>zr2)sAHgh+1&Wmc$O&_iI91NX;CI8#F5mITbHAPXWq7i8D3%X2@_f%a< z*wXln#?7U%eeJeD+Z!sVt?kCjS%tF?ZRt#}hG&uxqE{+JDgeX(w@CpA;EDGURI47U z1M~@u^&dH2nfKEwfP%m0eY9wRy_*^6kpZHp1Qkjcp=V3)h!MQ_L<`U}BOJn&;00W% zn(#&0M)yr{pp|FC_e`-8-_8gsp$TI6ZNEa39pIz|GX&^{86unP^rm(|nnrw_crxjv zuV&~HeSaehHmoNr@)B9ieT-TM^twnn3mg<+cN09(Y(;TE@t|68P}~Y*-eWAsF6q`Z zZZF5lN-Rr9tq`P7R&Mru2lP<4Z9R`hTGN^zm9&!*Hn3p%dk9^(4hzX>Q&ODH`k9ru zK$`y*b?TjV=!9L^TkE8<9aP&Of6en;&~=xG+rk6nJi#VUR?n_s4XZUj_KipIt=B|< zT0lR Date: Sat, 12 Apr 2014 09:31:07 +0000 Subject: [PATCH 286/419] [NTOS:CC] - Rename the CACHE_SEGMENT structure to ROS_VACB. This should eventually become NDK's VACB. CORE-8065 svn path=/trunk/; revision=62708 --- reactos/ntoskrnl/cc/copy.c | 187 +++++----- reactos/ntoskrnl/cc/fs.c | 32 +- reactos/ntoskrnl/cc/pin.c | 42 +-- reactos/ntoskrnl/cc/view.c | 456 ++++++++++++------------- reactos/ntoskrnl/include/internal/cc.h | 79 +++-- reactos/ntoskrnl/mm/section.c | 106 +++--- 6 files changed, 450 insertions(+), 452 deletions(-) diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index 697272aaace..87a7fc1b5d0 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -56,17 +56,17 @@ CcInitCacheZeroPage ( NTSTATUS NTAPI -ReadCacheSegmentChain ( +ReadVacbChain ( PBCB Bcb, ULONG ReadOffset, ULONG Length, PVOID Buffer) { - PCACHE_SEGMENT head; - PCACHE_SEGMENT current; - PCACHE_SEGMENT previous; + PROS_VACB head; + PROS_VACB current; + PROS_VACB previous; IO_STATUS_BLOCK Iosb; - LARGE_INTEGER SegOffset; + LARGE_INTEGER VacbOffset; NTSTATUS Status; ULONG TempLength; KEVENT Event; @@ -74,7 +74,7 @@ ReadCacheSegmentChain ( Mdl = _alloca(MmSizeOfMdl(NULL, MAX_RW_LENGTH)); - Status = CcRosGetCacheSegmentChain(Bcb, ReadOffset, Length, &head); + Status = CcRosGetVacbChain(Bcb, ReadOffset, Length, &head); if (!NT_SUCCESS(Status)) { return Status; @@ -83,8 +83,7 @@ ReadCacheSegmentChain ( while (current != NULL) { /* - * If the current segment is valid then copy it into the - * user buffer. + * If the current VACB is valid then copy it into the user buffer. */ if (current->Valid) { @@ -96,21 +95,21 @@ ReadCacheSegmentChain ( Length = Length - TempLength; previous = current; current = current->NextInChain; - CcRosReleaseCacheSegment(Bcb, previous, TRUE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, previous, TRUE, FALSE, FALSE); } /* * Otherwise read in as much as we can. */ else { - PCACHE_SEGMENT current2; + PROS_VACB current2; ULONG current_size; ULONG i; PPFN_NUMBER MdlPages; /* * Count the maximum number of bytes we could read starting - * from the current segment. + * from the current VACB. */ current2 = current; current_size = 0; @@ -142,11 +141,11 @@ ReadCacheSegmentChain ( /* * Read in the information. */ - SegOffset.QuadPart = current->FileOffset; + VacbOffset.QuadPart = current->FileOffset; KeInitializeEvent(&Event, NotificationEvent, FALSE); Status = IoPageRead(Bcb->FileObject, Mdl, - &SegOffset, + &VacbOffset, &Event, &Iosb); if (Status == STATUS_PENDING) @@ -164,7 +163,7 @@ ReadCacheSegmentChain ( { previous = current; current = current->NextInChain; - CcRosReleaseCacheSegment(Bcb, previous, FALSE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, previous, FALSE, FALSE, FALSE); } return Status; } @@ -179,7 +178,7 @@ ReadCacheSegmentChain ( Buffer = (PVOID)((ULONG_PTR)Buffer + TempLength); Length = Length - TempLength; - CcRosReleaseCacheSegment(Bcb, previous, TRUE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, previous, TRUE, FALSE, FALSE); current_size += VACB_MAPPING_GRANULARITY; } } @@ -189,24 +188,24 @@ ReadCacheSegmentChain ( NTSTATUS NTAPI -ReadCacheSegment ( - PCACHE_SEGMENT CacheSeg) +CcReadVirtualAddress ( + PROS_VACB Vacb) { ULONG Size; PMDL Mdl; NTSTATUS Status; - LARGE_INTEGER SegOffset; + LARGE_INTEGER VacbOffset; IO_STATUS_BLOCK IoStatus; KEVENT Event; - SegOffset.QuadPart = CacheSeg->FileOffset; - Size = (ULONG)(CacheSeg->Bcb->AllocationSize.QuadPart - CacheSeg->FileOffset); + VacbOffset.QuadPart = Vacb->FileOffset; + Size = (ULONG)(Vacb->Bcb->AllocationSize.QuadPart - Vacb->FileOffset); if (Size > VACB_MAPPING_GRANULARITY) { Size = VACB_MAPPING_GRANULARITY; } - Mdl = IoAllocateMdl(CacheSeg->BaseAddress, Size, FALSE, FALSE, NULL); + Mdl = IoAllocateMdl(Vacb->BaseAddress, Size, FALSE, FALSE, NULL); if (!Mdl) { return STATUS_INSUFFICIENT_RESOURCES; @@ -215,7 +214,7 @@ ReadCacheSegment ( MmBuildMdlForNonPagedPool(Mdl); Mdl->MdlFlags |= MDL_IO_PAGE_READ; KeInitializeEvent(&Event, NotificationEvent, FALSE); - Status = IoPageRead(CacheSeg->Bcb->FileObject, Mdl, &SegOffset, &Event, &IoStatus); + Status = IoPageRead(Vacb->Bcb->FileObject, Mdl, &VacbOffset, &Event, &IoStatus); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -232,7 +231,7 @@ ReadCacheSegment ( if (Size < VACB_MAPPING_GRANULARITY) { - RtlZeroMemory((char*)CacheSeg->BaseAddress + Size, + RtlZeroMemory((char*)Vacb->BaseAddress + Size, VACB_MAPPING_GRANULARITY - Size); } @@ -241,19 +240,19 @@ ReadCacheSegment ( NTSTATUS NTAPI -WriteCacheSegment ( - PCACHE_SEGMENT CacheSeg) +CcWriteVirtualAddress ( + PROS_VACB Vacb) { ULONG Size; PMDL Mdl; NTSTATUS Status; IO_STATUS_BLOCK IoStatus; - LARGE_INTEGER SegOffset; + LARGE_INTEGER VacbOffset; KEVENT Event; - CacheSeg->Dirty = FALSE; - SegOffset.QuadPart = CacheSeg->FileOffset; - Size = (ULONG)(CacheSeg->Bcb->AllocationSize.QuadPart - CacheSeg->FileOffset); + Vacb->Dirty = FALSE; + VacbOffset.QuadPart = Vacb->FileOffset; + Size = (ULONG)(Vacb->Bcb->AllocationSize.QuadPart - Vacb->FileOffset); if (Size > VACB_MAPPING_GRANULARITY) { Size = VACB_MAPPING_GRANULARITY; @@ -266,11 +265,11 @@ WriteCacheSegment ( ULONG i = 0; do { - MmGetPfnForProcess(NULL, (PVOID)((ULONG_PTR)CacheSeg->BaseAddress + (i << PAGE_SHIFT))); + MmGetPfnForProcess(NULL, (PVOID)((ULONG_PTR)Vacb->BaseAddress + (i << PAGE_SHIFT))); } while (++i < (Size >> PAGE_SHIFT)); } - Mdl = IoAllocateMdl(CacheSeg->BaseAddress, Size, FALSE, FALSE, NULL); + Mdl = IoAllocateMdl(Vacb->BaseAddress, Size, FALSE, FALSE, NULL); if (!Mdl) { return STATUS_INSUFFICIENT_RESOURCES; @@ -278,7 +277,7 @@ WriteCacheSegment ( MmBuildMdlForNonPagedPool(Mdl); Mdl->MdlFlags |= MDL_IO_PAGE_READ; KeInitializeEvent(&Event, NotificationEvent, FALSE); - Status = IoSynchronousPageWrite(CacheSeg->Bcb->FileObject, Mdl, &SegOffset, &Event, &IoStatus); + Status = IoSynchronousPageWrite(Vacb->Bcb->FileObject, Mdl, &VacbOffset, &Event, &IoStatus); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -288,7 +287,7 @@ WriteCacheSegment ( if (!NT_SUCCESS(Status) && (Status != STATUS_END_OF_FILE)) { DPRINT1("IoPageWrite failed, Status %x\n", Status); - CacheSeg->Dirty = TRUE; + Vacb->Dirty = TRUE; return Status; } @@ -329,13 +328,13 @@ CcCopyRead ( ULONG TempLength; NTSTATUS Status = STATUS_SUCCESS; PVOID BaseAddress; - PCACHE_SEGMENT CacheSeg; + PROS_VACB Vacb; BOOLEAN Valid; ULONG ReadLength = 0; PBCB Bcb; KIRQL oldirql; PLIST_ENTRY current_entry; - PCACHE_SEGMENT current; + PROS_VACB current; DPRINT("CcCopyRead(FileObject 0x%p, FileOffset %I64x, " "Length %lu, Wait %u, Buffer 0x%p, IoStatus 0x%p)\n", @@ -350,22 +349,22 @@ CcCopyRead ( Bcb->FileSize.QuadPart); /* - * Check for the nowait case that all the cache segments that would + * Check for the nowait case that all the cache VACBs that would * cover this read are in memory. */ if (!Wait) { KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); /* FIXME: this loop doesn't take into account areas that don't have - * a segment in the list yet */ - current_entry = Bcb->BcbSegmentListHead.Flink; - while (current_entry != &Bcb->BcbSegmentListHead) + * a VACB in the list yet */ + current_entry = Bcb->BcbVacbListHead.Flink; + while (current_entry != &Bcb->BcbVacbListHead) { - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, - BcbSegmentListEntry); + current = CONTAINING_RECORD(current_entry, ROS_VACB, + BcbVacbListEntry); if (!current->Valid && - DoSegmentsIntersect(current->FileOffset, VACB_MAPPING_GRANULARITY, - ReadOffset, Length)) + DoRangesIntersect(current->FileOffset, VACB_MAPPING_GRANULARITY, + ReadOffset, Length)) { KeReleaseSpinLock(&Bcb->BcbLock, oldirql); IoStatus->Status = STATUS_UNSUCCESSFUL; @@ -383,32 +382,32 @@ CcCopyRead ( if (TempLength != 0) { TempLength = min(Length, VACB_MAPPING_GRANULARITY - TempLength); - Status = CcRosRequestCacheSegment(Bcb, - ROUND_DOWN(ReadOffset, - VACB_MAPPING_GRANULARITY), - &BaseAddress, &Valid, &CacheSeg); + Status = CcRosRequestVacb(Bcb, + ROUND_DOWN(ReadOffset, + VACB_MAPPING_GRANULARITY), + &BaseAddress, &Valid, &Vacb); if (!NT_SUCCESS(Status)) { IoStatus->Information = 0; IoStatus->Status = Status; - DPRINT("CcRosRequestCacheSegment faild, Status %x\n", Status); + DPRINT("CcRosRequestVacb failed, Status %x\n", Status); return FALSE; } if (!Valid) { - Status = ReadCacheSegment(CacheSeg); + Status = CcReadVirtualAddress(Vacb); if (!NT_SUCCESS(Status)) { IoStatus->Information = 0; IoStatus->Status = Status; - CcRosReleaseCacheSegment(Bcb, CacheSeg, FALSE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); return FALSE; } } RtlCopyMemory(Buffer, (char*)BaseAddress + ReadOffset % VACB_MAPPING_GRANULARITY, TempLength); - CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE); ReadLength += TempLength; Length -= TempLength; ReadOffset += TempLength; @@ -418,12 +417,12 @@ CcCopyRead ( while (Length > 0) { TempLength = min(VACB_MAPPING_GRANULARITY, Length); - Status = ReadCacheSegmentChain(Bcb, ReadOffset, TempLength, Buffer); + Status = ReadVacbChain(Bcb, ReadOffset, TempLength, Buffer); if (!NT_SUCCESS(Status)) { IoStatus->Information = 0; IoStatus->Status = Status; - DPRINT("ReadCacheSegmentChain failed, Status %x\n", Status); + DPRINT("ReadVacbChain failed, Status %x\n", Status); return FALSE; } @@ -457,7 +456,7 @@ CcCopyWrite ( KIRQL oldirql; PBCB Bcb; PLIST_ENTRY current_entry; - PCACHE_SEGMENT CacheSeg; + PROS_VACB Vacb; ULONG TempLength; PVOID BaseAddress; BOOLEAN Valid; @@ -474,21 +473,22 @@ CcCopyWrite ( /* testing, if the requested datas are available */ KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); /* FIXME: this loop doesn't take into account areas that don't have - * a segment in the list yet */ - current_entry = Bcb->BcbSegmentListHead.Flink; - while (current_entry != &Bcb->BcbSegmentListHead) + * a VACB in the list yet */ + current_entry = Bcb->BcbVacbListHead.Flink; + while (current_entry != &Bcb->BcbVacbListHead) { - CacheSeg = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, - BcbSegmentListEntry); - if (!CacheSeg->Valid && - DoSegmentsIntersect(CacheSeg->FileOffset, VACB_MAPPING_GRANULARITY, - WriteOffset, Length)) + Vacb = CONTAINING_RECORD(current_entry, + ROS_VACB, + BcbVacbListEntry); + if (!Vacb->Valid && + DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY, + WriteOffset, Length)) { KeReleaseSpinLock(&Bcb->BcbLock, oldirql); /* datas not available */ return FALSE; } - if (CacheSeg->FileOffset >= WriteOffset + Length) + if (Vacb->FileOffset >= WriteOffset + Length) break; current_entry = current_entry->Flink; } @@ -501,15 +501,15 @@ CcCopyWrite ( ULONG ROffset; ROffset = ROUND_DOWN(WriteOffset, VACB_MAPPING_GRANULARITY); TempLength = min(Length, VACB_MAPPING_GRANULARITY - TempLength); - Status = CcRosRequestCacheSegment(Bcb, ROffset, - &BaseAddress, &Valid, &CacheSeg); + Status = CcRosRequestVacb(Bcb, ROffset, + &BaseAddress, &Valid, &Vacb); if (!NT_SUCCESS(Status)) { return FALSE; } if (!Valid) { - if (!NT_SUCCESS(ReadCacheSegment(CacheSeg))) + if (!NT_SUCCESS(CcReadVirtualAddress(Vacb))) { return FALSE; } @@ -517,7 +517,7 @@ CcCopyWrite ( RtlCopyMemory((char*)BaseAddress + WriteOffset % VACB_MAPPING_GRANULARITY, Buffer, TempLength); - CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, TRUE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, TRUE, TRUE, FALSE); Length -= TempLength; WriteOffset += TempLength; @@ -528,25 +528,25 @@ CcCopyWrite ( while (Length > 0) { TempLength = min(VACB_MAPPING_GRANULARITY, Length); - Status = CcRosRequestCacheSegment(Bcb, - WriteOffset, - &BaseAddress, - &Valid, - &CacheSeg); + Status = CcRosRequestVacb(Bcb, + WriteOffset, + &BaseAddress, + &Valid, + &Vacb); if (!NT_SUCCESS(Status)) { return FALSE; } if (!Valid && TempLength < VACB_MAPPING_GRANULARITY) { - if (!NT_SUCCESS(ReadCacheSegment(CacheSeg))) + if (!NT_SUCCESS(CcReadVirtualAddress(Vacb))) { - CcRosReleaseCacheSegment(Bcb, CacheSeg, FALSE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); return FALSE; } } RtlCopyMemory(BaseAddress, Buffer, TempLength); - CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, TRUE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, TRUE, TRUE, FALSE); Length -= TempLength; WriteOffset += TempLength; @@ -686,7 +686,7 @@ CcZeroData ( KIRQL oldirql; PBCB Bcb; PLIST_ENTRY current_entry; - PCACHE_SEGMENT CacheSeg, current, previous; + PROS_VACB Vacb, current, previous; ULONG TempLength; Bcb = FileObject->SectionObjectPointer->SharedCacheMap; @@ -695,21 +695,22 @@ CcZeroData ( /* testing, if the requested datas are available */ KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); /* FIXME: this loop doesn't take into account areas that don't have - * a segment in the list yet */ - current_entry = Bcb->BcbSegmentListHead.Flink; - while (current_entry != &Bcb->BcbSegmentListHead) + * a VACB in the list yet */ + current_entry = Bcb->BcbVacbListHead.Flink; + while (current_entry != &Bcb->BcbVacbListHead) { - CacheSeg = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, - BcbSegmentListEntry); - if (!CacheSeg->Valid && - DoSegmentsIntersect(CacheSeg->FileOffset, VACB_MAPPING_GRANULARITY, - WriteOffset.u.LowPart, Length)) + Vacb = CONTAINING_RECORD(current_entry, + ROS_VACB, + BcbVacbListEntry); + if (!Vacb->Valid && + DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY, + WriteOffset.u.LowPart, Length)) { KeReleaseSpinLock(&Bcb->BcbLock, oldirql); /* datas not available */ return FALSE; } - if (CacheSeg->FileOffset >= WriteOffset.u.LowPart + Length) + if (Vacb->FileOffset >= WriteOffset.u.LowPart + Length) break; current_entry = current_entry->Flink; } @@ -728,13 +729,13 @@ CcZeroData ( { CurrentLength = Length; } - Status = CcRosGetCacheSegmentChain (Bcb, WriteOffset.u.LowPart - Offset, - Offset + CurrentLength, &CacheSeg); + Status = CcRosGetVacbChain(Bcb, WriteOffset.u.LowPart - Offset, + Offset + CurrentLength, &Vacb); if (!NT_SUCCESS(Status)) { return FALSE; } - current = CacheSeg; + current = Vacb; while (current != NULL) { @@ -744,11 +745,11 @@ CcZeroData ( { if (!current->Valid) { - /* read the segment */ - Status = ReadCacheSegment(current); + /* read the block */ + Status = CcReadVirtualAddress(current); if (!NT_SUCCESS(Status)) { - DPRINT1("ReadCacheSegment failed, status %x\n", + DPRINT1("CcReadVirtualAddress failed, status %x\n", Status); } } @@ -768,12 +769,12 @@ CcZeroData ( current = current->NextInChain; } - current = CacheSeg; + current = Vacb; while (current != NULL) { previous = current; current = current->NextInChain; - CcRosReleaseCacheSegment(Bcb, previous, TRUE, TRUE, FALSE); + CcRosReleaseVacb(Bcb, previous, TRUE, TRUE, FALSE); } } } diff --git a/reactos/ntoskrnl/cc/fs.c b/reactos/ntoskrnl/cc/fs.c index fdb9e62b7fe..1ee69d5d96b 100644 --- a/reactos/ntoskrnl/cc/fs.c +++ b/reactos/ntoskrnl/cc/fs.c @@ -22,7 +22,7 @@ extern KGUARDED_MUTEX ViewLock; extern ULONG DirtyPageCount; -NTSTATUS CcRosInternalFreeCacheSegment(PCACHE_SEGMENT CacheSeg); +NTSTATUS CcRosInternalFreeVacb(PROS_VACB Vacb); /* FUNCTIONS *****************************************************************/ @@ -52,7 +52,7 @@ CcGetFileObjectFromBcb ( IN PVOID Bcb) { PINTERNAL_BCB iBcb = (PINTERNAL_BCB)Bcb; - return iBcb->CacheSegment->Bcb->FileObject; + return iBcb->Vacb->Bcb->FileObject; } /* @@ -130,7 +130,7 @@ CcSetFileSizes ( KIRQL oldirql; PBCB Bcb; PLIST_ENTRY current_entry; - PCACHE_SEGMENT current; + PROS_VACB current; LIST_ENTRY FreeListHead; NTSTATUS Status; @@ -156,30 +156,30 @@ CcSetFileSizes ( KeAcquireGuardedMutex(&ViewLock); KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); - current_entry = Bcb->BcbSegmentListHead.Flink; - while (current_entry != &Bcb->BcbSegmentListHead) + current_entry = Bcb->BcbVacbListHead.Flink; + while (current_entry != &Bcb->BcbVacbListHead) { current = CONTAINING_RECORD(current_entry, - CACHE_SEGMENT, - BcbSegmentListEntry); + ROS_VACB, + BcbVacbListEntry); current_entry = current_entry->Flink; if (current->FileOffset >= FileSizes->AllocationSize.QuadPart) { if ((current->ReferenceCount == 0) || ((current->ReferenceCount == 1) && current->Dirty)) { - RemoveEntryList(¤t->BcbSegmentListEntry); - RemoveEntryList(¤t->CacheSegmentListEntry); - RemoveEntryList(¤t->CacheSegmentLRUListEntry); + RemoveEntryList(¤t->BcbVacbListEntry); + RemoveEntryList(¤t->VacbListEntry); + RemoveEntryList(¤t->VacbLruListEntry); if (current->Dirty) { - RemoveEntryList(¤t->DirtySegmentListEntry); + RemoveEntryList(¤t->DirtyVacbListEntry); DirtyPageCount -= VACB_MAPPING_GRANULARITY / PAGE_SIZE; } - InsertHeadList(&FreeListHead, ¤t->BcbSegmentListEntry); + InsertHeadList(&FreeListHead, ¤t->BcbVacbListEntry); } else { - DPRINT1("Anyone has referenced a cache segment behind the new size.\n"); + DPRINT1("Someone has referenced a VACB behind the new size.\n"); KeBugCheck(CACHE_MANAGER); } } @@ -193,12 +193,12 @@ CcSetFileSizes ( current_entry = FreeListHead.Flink; while(current_entry != &FreeListHead) { - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); + current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry); current_entry = current_entry->Flink; - Status = CcRosInternalFreeCacheSegment(current); + Status = CcRosInternalFreeVacb(current); if (!NT_SUCCESS(Status)) { - DPRINT1("CcRosInternalFreeCacheSegment failed, status = %x\n", Status); + DPRINT1("CcRosInternalFreeVacb failed, status = %x\n", Status); KeBugCheck(CACHE_MANAGER); } } diff --git a/reactos/ntoskrnl/cc/pin.c b/reactos/ntoskrnl/cc/pin.c index 26d375e2932..29e7d65606b 100644 --- a/reactos/ntoskrnl/cc/pin.c +++ b/reactos/ntoskrnl/cc/pin.c @@ -35,7 +35,7 @@ CcMapData ( ULONG ReadOffset; BOOLEAN Valid; PBCB Bcb; - PCACHE_SEGMENT CacheSeg; + PROS_VACB Vacb; NTSTATUS Status; PINTERNAL_BCB iBcb; ULONG ROffset; @@ -63,11 +63,11 @@ CcMapData ( } ROffset = ROUND_DOWN(ReadOffset, VACB_MAPPING_GRANULARITY); - Status = CcRosRequestCacheSegment(Bcb, - ROffset, - pBuffer, - &Valid, - &CacheSeg); + Status = CcRosRequestVacb(Bcb, + ROffset, + pBuffer, + &Valid, + &Vacb); if (!NT_SUCCESS(Status)) { return FALSE; @@ -77,13 +77,13 @@ CcMapData ( { if (!(Flags & MAP_WAIT)) { - CcRosReleaseCacheSegment(Bcb, CacheSeg, FALSE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); return FALSE; } - if (!NT_SUCCESS(ReadCacheSegment(CacheSeg))) + if (!NT_SUCCESS(CcReadVirtualAddress(Vacb))) { - CcRosReleaseCacheSegment(Bcb, CacheSeg, FALSE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); return FALSE; } } @@ -92,7 +92,7 @@ CcMapData ( iBcb = ExAllocateFromNPagedLookasideList(&iBcbLookasideList); if (iBcb == NULL) { - CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE); return FALSE; } @@ -101,7 +101,7 @@ CcMapData ( iBcb->PFCB.NodeByteSize = sizeof(PUBLIC_BCB); iBcb->PFCB.MappedLength = Length; iBcb->PFCB.MappedFileOffset = *FileOffset; - iBcb->CacheSegment = CacheSeg; + iBcb->Vacb = Vacb; iBcb->Dirty = FALSE; iBcb->RefCount = 1; *pBcb = (PVOID)iBcb; @@ -165,7 +165,7 @@ CcPreparePinWrite ( /* * FIXME: This is function is similar to CcPinRead, but doesn't * read the data if they're not present. Instead it should just - * prepare the cache segments and zero them out if Zero == TRUE. + * prepare the VACBs and zero them out if Zero == TRUE. * * For now calling CcPinRead is better than returning error or * just having UNIMPLEMENTED here. @@ -195,11 +195,11 @@ CcUnpinData ( { PINTERNAL_BCB iBcb = Bcb; - CcRosReleaseCacheSegment(iBcb->CacheSegment->Bcb, - iBcb->CacheSegment, - TRUE, - iBcb->Dirty, - FALSE); + CcRosReleaseVacb(iBcb->Vacb->Bcb, + iBcb->Vacb, + TRUE, + iBcb->Dirty, + FALSE); if (--iBcb->RefCount == 0) { ExFreeToNPagedLookasideList(&iBcbLookasideList, iBcb); @@ -248,20 +248,20 @@ CcUnpinRepinnedBcb ( IoStatus->Information = 0; if (WriteThrough) { - KeWaitForSingleObject(&iBcb->CacheSegment->Mutex, + KeWaitForSingleObject(&iBcb->Vacb->Mutex, Executive, KernelMode, FALSE, NULL); - if (iBcb->CacheSegment->Dirty) + if (iBcb->Vacb->Dirty) { - IoStatus->Status = CcRosFlushCacheSegment(iBcb->CacheSegment); + IoStatus->Status = CcRosFlushVacb(iBcb->Vacb); } else { IoStatus->Status = STATUS_SUCCESS; } - KeReleaseMutex(&iBcb->CacheSegment->Mutex, FALSE); + KeReleaseMutex(&iBcb->Vacb->Mutex, FALSE); } else { diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index e296348cb0a..c3eeae0ee14 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -41,9 +41,9 @@ /* GLOBALS *******************************************************************/ -static LIST_ENTRY DirtySegmentListHead; -static LIST_ENTRY CacheSegmentListHead; -static LIST_ENTRY CacheSegmentLRUListHead; +static LIST_ENTRY DirtyVacbListHead; +static LIST_ENTRY VacbListHead; +static LIST_ENTRY VacbLruListHead; static LIST_ENTRY ClosedListHead; ULONG DirtyPageCount = 0; @@ -51,36 +51,36 @@ KGUARDED_MUTEX ViewLock; NPAGED_LOOKASIDE_LIST iBcbLookasideList; static NPAGED_LOOKASIDE_LIST BcbLookasideList; -static NPAGED_LOOKASIDE_LIST CacheSegLookasideList; +static NPAGED_LOOKASIDE_LIST VacbLookasideList; #if DBG -static void CcRosCacheSegmentIncRefCount_ ( PCACHE_SEGMENT cs, const char* file, int line ) +static void CcRosVacbIncRefCount_(PROS_VACB vacb, const char* file, int line) { - ++cs->ReferenceCount; - if ( cs->Bcb->Trace ) + ++vacb->ReferenceCount; + if (vacb->Bcb->Trace) { - DbgPrint("(%s:%i) CacheSegment %p ++RefCount=%lu, Dirty %u, PageOut %lu\n", - file, line, cs, cs->ReferenceCount, cs->Dirty, cs->PageOut ); + DbgPrint("(%s:%i) VACB %p ++RefCount=%lu, Dirty %u, PageOut %lu\n", + file, line, vacb, vacb->ReferenceCount, vacb->Dirty, vacb->PageOut); } } -static void CcRosCacheSegmentDecRefCount_ ( PCACHE_SEGMENT cs, const char* file, int line ) +static void CcRosVacbDecRefCount_(PROS_VACB vacb, const char* file, int line) { - --cs->ReferenceCount; - if ( cs->Bcb->Trace ) + --vacb->ReferenceCount; + if (vacb->Bcb->Trace) { - DbgPrint("(%s:%i) CacheSegment %p --RefCount=%lu, Dirty %u, PageOut %lu\n", - file, line, cs, cs->ReferenceCount, cs->Dirty, cs->PageOut ); + DbgPrint("(%s:%i) VACB %p --RefCount=%lu, Dirty %u, PageOut %lu\n", + file, line, vacb, vacb->ReferenceCount, vacb->Dirty, vacb->PageOut); } } -#define CcRosCacheSegmentIncRefCount(cs) CcRosCacheSegmentIncRefCount_(cs,__FILE__,__LINE__) -#define CcRosCacheSegmentDecRefCount(cs) CcRosCacheSegmentDecRefCount_(cs,__FILE__,__LINE__) +#define CcRosVacbIncRefCount(vacb) CcRosVacbIncRefCount_(vacb,__FILE__,__LINE__) +#define CcRosVacbDecRefCount(vacb) CcRosVacbDecRefCount_(vacb,__FILE__,__LINE__) #else -#define CcRosCacheSegmentIncRefCount(cs) (++((cs)->ReferenceCount)) -#define CcRosCacheSegmentDecRefCount(cs) (--((cs)->ReferenceCount)) +#define CcRosVacbIncRefCount(vacb) (++((vacb)->ReferenceCount)) +#define CcRosVacbDecRefCount(vacb) (--((vacb)->ReferenceCount)) #endif NTSTATUS -CcRosInternalFreeCacheSegment(PCACHE_SEGMENT CacheSeg); +CcRosInternalFreeVacb(PROS_VACB Vacb); /* FUNCTIONS *****************************************************************/ @@ -94,7 +94,7 @@ CcRosTraceCacheMap ( #if DBG KIRQL oldirql; PLIST_ENTRY current_entry; - PCACHE_SEGMENT current; + PROS_VACB current; if ( !Bcb ) return; @@ -108,13 +108,13 @@ CcRosTraceCacheMap ( KeAcquireGuardedMutex(&ViewLock); KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); - current_entry = Bcb->BcbSegmentListHead.Flink; - while (current_entry != &Bcb->BcbSegmentListHead) + current_entry = Bcb->BcbVacbListHead.Flink; + while (current_entry != &Bcb->BcbVacbListHead) { - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); + current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry); current_entry = current_entry->Flink; - DPRINT1(" CacheSegment 0x%p enabled, RefCount %lu, Dirty %u, PageOut %lu\n", + DPRINT1(" VACB 0x%p enabled, RefCount %lu, Dirty %u, PageOut %lu\n", current, current->ReferenceCount, current->Dirty, current->PageOut ); } KeReleaseSpinLock(&Bcb->BcbLock, oldirql); @@ -133,24 +133,24 @@ CcRosTraceCacheMap ( NTSTATUS NTAPI -CcRosFlushCacheSegment ( - PCACHE_SEGMENT CacheSegment) +CcRosFlushVacb ( + PROS_VACB Vacb) { NTSTATUS Status; KIRQL oldIrql; - Status = WriteCacheSegment(CacheSegment); + Status = CcWriteVirtualAddress(Vacb); if (NT_SUCCESS(Status)) { KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(&CacheSegment->Bcb->BcbLock, &oldIrql); + KeAcquireSpinLock(&Vacb->Bcb->BcbLock, &oldIrql); - CacheSegment->Dirty = FALSE; - RemoveEntryList(&CacheSegment->DirtySegmentListEntry); + Vacb->Dirty = FALSE; + RemoveEntryList(&Vacb->DirtyVacbListEntry); DirtyPageCount -= VACB_MAPPING_GRANULARITY / PAGE_SIZE; - CcRosCacheSegmentDecRefCount(CacheSegment); + CcRosVacbDecRefCount(Vacb); - KeReleaseSpinLock(&CacheSegment->Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&Vacb->Bcb->BcbLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); } @@ -165,8 +165,7 @@ CcRosFlushDirtyPages ( BOOLEAN Wait) { PLIST_ENTRY current_entry; - PCACHE_SEGMENT current; - ULONG PagesPerSegment; + PROS_VACB current; BOOLEAN Locked; NTSTATUS Status; LARGE_INTEGER ZeroTimeout; @@ -179,25 +178,26 @@ CcRosFlushDirtyPages ( KeEnterCriticalRegion(); KeAcquireGuardedMutex(&ViewLock); - current_entry = DirtySegmentListHead.Flink; - if (current_entry == &DirtySegmentListHead) + current_entry = DirtyVacbListHead.Flink; + if (current_entry == &DirtyVacbListHead) { DPRINT("No Dirty pages\n"); } - while ((current_entry != &DirtySegmentListHead) && (Target > 0)) + while ((current_entry != &DirtyVacbListHead) && (Target > 0)) { - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, - DirtySegmentListEntry); + current = CONTAINING_RECORD(current_entry, + ROS_VACB, + DirtyVacbListEntry); current_entry = current_entry->Flink; - CcRosCacheSegmentIncRefCount(current); + CcRosVacbIncRefCount(current); Locked = current->Bcb->Callbacks->AcquireForLazyWrite( current->Bcb->LazyWriteContext, Wait); if (!Locked) { - CcRosCacheSegmentDecRefCount(current); + CcRosVacbDecRefCount(current); continue; } @@ -210,7 +210,7 @@ CcRosFlushDirtyPages ( { current->Bcb->Callbacks->ReleaseFromLazyWrite( current->Bcb->LazyWriteContext); - CcRosCacheSegmentDecRefCount(current); + CcRosVacbDecRefCount(current); continue; } @@ -222,34 +222,32 @@ CcRosFlushDirtyPages ( KeReleaseMutex(¤t->Mutex, FALSE); current->Bcb->Callbacks->ReleaseFromLazyWrite( current->Bcb->LazyWriteContext); - CcRosCacheSegmentDecRefCount(current); + CcRosVacbDecRefCount(current); continue; } - PagesPerSegment = VACB_MAPPING_GRANULARITY / PAGE_SIZE; - KeReleaseGuardedMutex(&ViewLock); - Status = CcRosFlushCacheSegment(current); + Status = CcRosFlushVacb(current); KeReleaseMutex(¤t->Mutex, FALSE); current->Bcb->Callbacks->ReleaseFromLazyWrite( current->Bcb->LazyWriteContext); KeAcquireGuardedMutex(&ViewLock); - CcRosCacheSegmentDecRefCount(current); + CcRosVacbDecRefCount(current); if (!NT_SUCCESS(Status) && (Status != STATUS_END_OF_FILE)) { - DPRINT1("CC: Failed to flush cache segment.\n"); + DPRINT1("CC: Failed to flush VACB.\n"); } else { - (*Count) += PagesPerSegment; - Target -= PagesPerSegment; + (*Count) += VACB_MAPPING_GRANULARITY / PAGE_SIZE; + Target -= VACB_MAPPING_GRANULARITY / PAGE_SIZE; } - current_entry = DirtySegmentListHead.Flink; + current_entry = DirtyVacbListHead.Flink; } KeReleaseGuardedMutex(&ViewLock); @@ -274,8 +272,7 @@ CcRosTrimCache ( */ { PLIST_ENTRY current_entry; - PCACHE_SEGMENT current; - ULONG PagesPerSegment; + PROS_VACB current; ULONG PagesFreed; KIRQL oldIrql; LIST_ENTRY FreeList; @@ -292,17 +289,18 @@ CcRosTrimCache ( retry: KeAcquireGuardedMutex(&ViewLock); - current_entry = CacheSegmentLRUListHead.Flink; - while (current_entry != &CacheSegmentLRUListHead) + current_entry = VacbLruListHead.Flink; + while (current_entry != &VacbLruListHead) { - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, - CacheSegmentLRUListEntry); + current = CONTAINING_RECORD(current_entry, + ROS_VACB, + VacbLruListEntry); current_entry = current_entry->Flink; KeAcquireSpinLock(¤t->Bcb->BcbLock, &oldIrql); - /* Reference the cache segment */ - CcRosCacheSegmentIncRefCount(current); + /* Reference the VACB */ + CcRosVacbIncRefCount(current); /* Check if it's mapped and not dirty */ if (current->MappedCount > 0 && !current->Dirty) @@ -311,7 +309,7 @@ retry: KeReleaseSpinLock(¤t->Bcb->BcbLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); - /* Page out the segment */ + /* Page out the VACB */ for (i = 0; i < VACB_MAPPING_GRANULARITY / PAGE_SIZE; i++) { Page = (PFN_NUMBER)(MmGetPhysicalAddress((PUCHAR)current->BaseAddress + (i * PAGE_SIZE)).QuadPart >> PAGE_SHIFT); @@ -324,8 +322,8 @@ retry: KeAcquireSpinLock(¤t->Bcb->BcbLock, &oldIrql); } - /* Dereference the cache segment */ - CcRosCacheSegmentDecRefCount(current); + /* Dereference the VACB */ + CcRosVacbDecRefCount(current); /* Check if we can free this entry now */ if (current->ReferenceCount == 0) @@ -333,14 +331,13 @@ retry: ASSERT(!current->Dirty); ASSERT(!current->MappedCount); - RemoveEntryList(¤t->BcbSegmentListEntry); - RemoveEntryList(¤t->CacheSegmentListEntry); - RemoveEntryList(¤t->CacheSegmentLRUListEntry); - InsertHeadList(&FreeList, ¤t->BcbSegmentListEntry); + RemoveEntryList(¤t->BcbVacbListEntry); + RemoveEntryList(¤t->VacbListEntry); + RemoveEntryList(¤t->VacbLruListEntry); + InsertHeadList(&FreeList, ¤t->BcbVacbListEntry); /* Calculate how many pages we freed for Mm */ - PagesPerSegment = VACB_MAPPING_GRANULARITY / PAGE_SIZE; - PagesFreed = min(PagesPerSegment, Target); + PagesFreed = min(VACB_MAPPING_GRANULARITY / PAGE_SIZE, Target); Target -= PagesFreed; (*NrFreed) += PagesFreed; } @@ -372,9 +369,10 @@ retry: while (!IsListEmpty(&FreeList)) { current_entry = RemoveHeadList(&FreeList); - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, - BcbSegmentListEntry); - CcRosInternalFreeCacheSegment(current); + current = CONTAINING_RECORD(current_entry, + ROS_VACB, + BcbVacbListEntry); + CcRosInternalFreeVacb(current); } DPRINT("Evicted %lu cache pages\n", (*NrFreed)); @@ -384,9 +382,9 @@ retry: NTSTATUS NTAPI -CcRosReleaseCacheSegment ( +CcRosReleaseVacb ( PBCB Bcb, - PCACHE_SEGMENT CacheSeg, + PROS_VACB Vacb, BOOLEAN Valid, BOOLEAN Dirty, BOOLEAN Mapped) @@ -396,71 +394,72 @@ CcRosReleaseCacheSegment ( ASSERT(Bcb); - DPRINT("CcReleaseCacheSegment(Bcb 0x%p, CacheSeg 0x%p, Valid %u)\n", - Bcb, CacheSeg, Valid); + DPRINT("CcRosReleaseVacb(Bcb 0x%p, Vacb 0x%p, Valid %u)\n", + Bcb, Vacb, Valid); KeAcquireGuardedMutex(&ViewLock); KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - CacheSeg->Valid = Valid; + Vacb->Valid = Valid; - WasDirty = CacheSeg->Dirty; - CacheSeg->Dirty = CacheSeg->Dirty || Dirty; + WasDirty = Vacb->Dirty; + Vacb->Dirty = Vacb->Dirty || Dirty; - if (!WasDirty && CacheSeg->Dirty) + if (!WasDirty && Vacb->Dirty) { - InsertTailList(&DirtySegmentListHead, &CacheSeg->DirtySegmentListEntry); + InsertTailList(&DirtyVacbListHead, &Vacb->DirtyVacbListEntry); DirtyPageCount += VACB_MAPPING_GRANULARITY / PAGE_SIZE; } if (Mapped) { - CacheSeg->MappedCount++; + Vacb->MappedCount++; } - CcRosCacheSegmentDecRefCount(CacheSeg); - if (Mapped && (CacheSeg->MappedCount == 1)) + CcRosVacbDecRefCount(Vacb); + if (Mapped && (Vacb->MappedCount == 1)) { - CcRosCacheSegmentIncRefCount(CacheSeg); + CcRosVacbIncRefCount(Vacb); } - if (!WasDirty && CacheSeg->Dirty) + if (!WasDirty && Vacb->Dirty) { - CcRosCacheSegmentIncRefCount(CacheSeg); + CcRosVacbIncRefCount(Vacb); } KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); - KeReleaseMutex(&CacheSeg->Mutex, FALSE); + KeReleaseMutex(&Vacb->Mutex, FALSE); return STATUS_SUCCESS; } -/* Returns with Cache Segment Lock Held! */ -PCACHE_SEGMENT +/* Returns with VACB Lock Held! */ +PROS_VACB NTAPI -CcRosLookupCacheSegment ( +CcRosLookupVacb ( PBCB Bcb, ULONG FileOffset) { PLIST_ENTRY current_entry; - PCACHE_SEGMENT current; + PROS_VACB current; KIRQL oldIrql; ASSERT(Bcb); - DPRINT("CcRosLookupCacheSegment(Bcb -x%p, FileOffset %lu)\n", Bcb, FileOffset); + DPRINT("CcRosLookupVacb(Bcb -x%p, FileOffset %lu)\n", Bcb, FileOffset); KeAcquireGuardedMutex(&ViewLock); KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - current_entry = Bcb->BcbSegmentListHead.Flink; - while (current_entry != &Bcb->BcbSegmentListHead) + current_entry = Bcb->BcbVacbListHead.Flink; + while (current_entry != &Bcb->BcbVacbListHead) { - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, - BcbSegmentListEntry); - if (IsPointInSegment(current->FileOffset, VACB_MAPPING_GRANULARITY, - FileOffset)) + current = CONTAINING_RECORD(current_entry, + ROS_VACB, + BcbVacbListEntry); + if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY, + FileOffset)) { - CcRosCacheSegmentIncRefCount(current); + CcRosVacbIncRefCount(current); KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); KeWaitForSingleObject(¤t->Mutex, @@ -483,19 +482,19 @@ CcRosLookupCacheSegment ( NTSTATUS NTAPI -CcRosMarkDirtyCacheSegment ( +CcRosMarkDirtyVacb ( PBCB Bcb, ULONG FileOffset) { - PCACHE_SEGMENT CacheSeg; + PROS_VACB Vacb; KIRQL oldIrql; ASSERT(Bcb); - DPRINT("CcRosMarkDirtyCacheSegment(Bcb 0x%p, FileOffset %lu)\n", Bcb, FileOffset); + DPRINT("CcRosMarkDirtyVacb(Bcb 0x%p, FileOffset %lu)\n", Bcb, FileOffset); - CacheSeg = CcRosLookupCacheSegment(Bcb, FileOffset); - if (CacheSeg == NULL) + Vacb = CcRosLookupVacb(Bcb, FileOffset); + if (Vacb == NULL) { KeBugCheck(CACHE_MANAGER); } @@ -503,47 +502,47 @@ CcRosMarkDirtyCacheSegment ( KeAcquireGuardedMutex(&ViewLock); KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - if (!CacheSeg->Dirty) + if (!Vacb->Dirty) { - InsertTailList(&DirtySegmentListHead, &CacheSeg->DirtySegmentListEntry); + InsertTailList(&DirtyVacbListHead, &Vacb->DirtyVacbListEntry); DirtyPageCount += VACB_MAPPING_GRANULARITY / PAGE_SIZE; } else { - CcRosCacheSegmentDecRefCount(CacheSeg); + CcRosVacbDecRefCount(Vacb); } /* Move to the tail of the LRU list */ - RemoveEntryList(&CacheSeg->CacheSegmentLRUListEntry); - InsertTailList(&CacheSegmentLRUListHead, &CacheSeg->CacheSegmentLRUListEntry); + RemoveEntryList(&Vacb->VacbLruListEntry); + InsertTailList(&VacbLruListHead, &Vacb->VacbLruListEntry); - CacheSeg->Dirty = TRUE; + Vacb->Dirty = TRUE; KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); - KeReleaseMutex(&CacheSeg->Mutex, FALSE); + KeReleaseMutex(&Vacb->Mutex, FALSE); return STATUS_SUCCESS; } NTSTATUS NTAPI -CcRosUnmapCacheSegment ( +CcRosUnmapVacb ( PBCB Bcb, ULONG FileOffset, BOOLEAN NowDirty) { - PCACHE_SEGMENT CacheSeg; + PROS_VACB Vacb; BOOLEAN WasDirty; KIRQL oldIrql; ASSERT(Bcb); - DPRINT("CcRosUnmapCacheSegment(Bcb 0x%p, FileOffset %lu, NowDirty %u)\n", + DPRINT("CcRosUnmapVacb(Bcb 0x%p, FileOffset %lu, NowDirty %u)\n", Bcb, FileOffset, NowDirty); - CacheSeg = CcRosLookupCacheSegment(Bcb, FileOffset); - if (CacheSeg == NULL) + Vacb = CcRosLookupVacb(Bcb, FileOffset); + if (Vacb == NULL) { return STATUS_UNSUCCESSFUL; } @@ -551,58 +550,58 @@ CcRosUnmapCacheSegment ( KeAcquireGuardedMutex(&ViewLock); KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - WasDirty = CacheSeg->Dirty; - CacheSeg->Dirty = CacheSeg->Dirty || NowDirty; + WasDirty = Vacb->Dirty; + Vacb->Dirty = Vacb->Dirty || NowDirty; - CacheSeg->MappedCount--; + Vacb->MappedCount--; if (!WasDirty && NowDirty) { - InsertTailList(&DirtySegmentListHead, &CacheSeg->DirtySegmentListEntry); + InsertTailList(&DirtyVacbListHead, &Vacb->DirtyVacbListEntry); DirtyPageCount += VACB_MAPPING_GRANULARITY / PAGE_SIZE; } - CcRosCacheSegmentDecRefCount(CacheSeg); + CcRosVacbDecRefCount(Vacb); if (!WasDirty && NowDirty) { - CcRosCacheSegmentIncRefCount(CacheSeg); + CcRosVacbIncRefCount(Vacb); } - if (CacheSeg->MappedCount == 0) + if (Vacb->MappedCount == 0) { - CcRosCacheSegmentDecRefCount(CacheSeg); + CcRosVacbDecRefCount(Vacb); } KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); - KeReleaseMutex(&CacheSeg->Mutex, FALSE); + KeReleaseMutex(&Vacb->Mutex, FALSE); return STATUS_SUCCESS; } static NTSTATUS -CcRosCreateCacheSegment ( +CcRosCreateVacb ( PBCB Bcb, ULONG FileOffset, - PCACHE_SEGMENT* CacheSeg) + PROS_VACB *Vacb) { - PCACHE_SEGMENT current; - PCACHE_SEGMENT previous; + PROS_VACB current; + PROS_VACB previous; PLIST_ENTRY current_entry; NTSTATUS Status; KIRQL oldIrql; ASSERT(Bcb); - DPRINT("CcRosCreateCacheSegment()\n"); + DPRINT("CcRosCreateVacb()\n"); if (FileOffset >= Bcb->FileSize.u.LowPart) { - *CacheSeg = NULL; + *Vacb = NULL; return STATUS_INVALID_PARAMETER; } - current = ExAllocateFromNPagedLookasideList(&CacheSegLookasideList); + current = ExAllocateFromNPagedLookasideList(&VacbLookasideList); current->Valid = FALSE; current->Dirty = FALSE; current->PageOut = FALSE; @@ -611,12 +610,12 @@ CcRosCreateCacheSegment ( #if DBG if ( Bcb->Trace ) { - DPRINT1("CacheMap 0x%p: new Cache Segment: 0x%p\n", Bcb, current ); + DPRINT1("CacheMap 0x%p: new VACB: 0x%p\n", Bcb, current ); } #endif current->MappedCount = 0; - current->DirtySegmentListEntry.Flink = NULL; - current->DirtySegmentListEntry.Blink = NULL; + current->DirtyVacbListEntry.Flink = NULL; + current->DirtyVacbListEntry.Blink = NULL; current->ReferenceCount = 1; KeInitializeMutex(¤t->Mutex, 0); KeWaitForSingleObject(¤t->Mutex, @@ -626,37 +625,38 @@ CcRosCreateCacheSegment ( NULL); KeAcquireGuardedMutex(&ViewLock); - *CacheSeg = current; - /* There is window between the call to CcRosLookupCacheSegment - * and CcRosCreateCacheSegment. We must check if a segment on - * the fileoffset exist. If there exist a segment, we release - * our new created segment and return the existing one. + *Vacb = current; + /* There is window between the call to CcRosLookupVacb + * and CcRosCreateVacb. We must check if a VACB for the + * file offset exist. If there is a VACB, we release + * our newly created VACB and return the existing one. */ KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - current_entry = Bcb->BcbSegmentListHead.Flink; + current_entry = Bcb->BcbVacbListHead.Flink; previous = NULL; - while (current_entry != &Bcb->BcbSegmentListHead) + while (current_entry != &Bcb->BcbVacbListHead) { - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, - BcbSegmentListEntry); - if (IsPointInSegment(current->FileOffset, VACB_MAPPING_GRANULARITY, - FileOffset)) + current = CONTAINING_RECORD(current_entry, + ROS_VACB, + BcbVacbListEntry); + if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY, + FileOffset)) { - CcRosCacheSegmentIncRefCount(current); + CcRosVacbIncRefCount(current); KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); #if DBG if ( Bcb->Trace ) { - DPRINT1("CacheMap 0x%p: deleting newly created Cache Segment 0x%p ( found existing one 0x%p )\n", + DPRINT1("CacheMap 0x%p: deleting newly created VACB 0x%p ( found existing one 0x%p )\n", Bcb, - (*CacheSeg), + (*Vacb), current ); } #endif - KeReleaseMutex(&(*CacheSeg)->Mutex, FALSE); + KeReleaseMutex(&(*Vacb)->Mutex, FALSE); KeReleaseGuardedMutex(&ViewLock); - ExFreeToNPagedLookasideList(&CacheSegLookasideList, *CacheSeg); - *CacheSeg = current; + ExFreeToNPagedLookasideList(&VacbLookasideList, *Vacb); + *Vacb = current; KeWaitForSingleObject(¤t->Mutex, Executive, KernelMode, @@ -674,25 +674,25 @@ CcRosCreateCacheSegment ( break; current_entry = current_entry->Flink; } - /* There was no existing segment. */ - current = *CacheSeg; + /* There was no existing VACB. */ + current = *Vacb; if (previous) { - InsertHeadList(&previous->BcbSegmentListEntry, ¤t->BcbSegmentListEntry); + InsertHeadList(&previous->BcbVacbListEntry, ¤t->BcbVacbListEntry); } else { - InsertHeadList(&Bcb->BcbSegmentListHead, ¤t->BcbSegmentListEntry); + InsertHeadList(&Bcb->BcbVacbListHead, ¤t->BcbVacbListEntry); } KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); - InsertTailList(&CacheSegmentListHead, ¤t->CacheSegmentListEntry); - InsertTailList(&CacheSegmentLRUListHead, ¤t->CacheSegmentLRUListEntry); + InsertTailList(&VacbListHead, ¤t->VacbListEntry); + InsertTailList(&VacbLruListHead, ¤t->VacbLruListEntry); KeReleaseGuardedMutex(&ViewLock); MmLockAddressSpace(MmGetKernelAddressSpace()); current->BaseAddress = NULL; Status = MmCreateMemoryArea(MmGetKernelAddressSpace(), - 0, // nothing checks for cache_segment mareas, so set to 0 + 0, // nothing checks for VACB mareas, so set to 0 ¤t->BaseAddress, VACB_MAPPING_GRANULARITY, PAGE_READWRITE, @@ -727,49 +727,49 @@ CcRosCreateCacheSegment ( NTSTATUS NTAPI -CcRosGetCacheSegmentChain ( +CcRosGetVacbChain ( PBCB Bcb, ULONG FileOffset, ULONG Length, - PCACHE_SEGMENT* CacheSeg) + PROS_VACB *Vacb) { - PCACHE_SEGMENT current; + PROS_VACB current; ULONG i; - PCACHE_SEGMENT* CacheSegList; - PCACHE_SEGMENT Previous = NULL; + PROS_VACB *VacbList; + PROS_VACB Previous = NULL; ASSERT(Bcb); - DPRINT("CcRosGetCacheSegmentChain()\n"); + DPRINT("CcRosGetVacbChain()\n"); Length = ROUND_UP(Length, VACB_MAPPING_GRANULARITY); - CacheSegList = _alloca(sizeof(PCACHE_SEGMENT) * - (Length / VACB_MAPPING_GRANULARITY)); + VacbList = _alloca(sizeof(PROS_VACB) * + (Length / VACB_MAPPING_GRANULARITY)); /* - * Look for a cache segment already mapping the same data. + * Look for a VACB already mapping the same data. */ for (i = 0; i < (Length / VACB_MAPPING_GRANULARITY); i++) { ULONG CurrentOffset = FileOffset + (i * VACB_MAPPING_GRANULARITY); - current = CcRosLookupCacheSegment(Bcb, CurrentOffset); + current = CcRosLookupVacb(Bcb, CurrentOffset); if (current != NULL) { KeAcquireGuardedMutex(&ViewLock); /* Move to tail of LRU list */ - RemoveEntryList(¤t->CacheSegmentLRUListEntry); - InsertTailList(&CacheSegmentLRUListHead, ¤t->CacheSegmentLRUListEntry); + RemoveEntryList(¤t->VacbLruListEntry); + InsertTailList(&VacbLruListHead, ¤t->VacbLruListEntry); KeReleaseGuardedMutex(&ViewLock); - CacheSegList[i] = current; + VacbList[i] = current; } else { - CcRosCreateCacheSegment(Bcb, CurrentOffset, ¤t); - CacheSegList[i] = current; + CcRosCreateVacb(Bcb, CurrentOffset, ¤t); + VacbList[i] = current; } } @@ -777,13 +777,13 @@ CcRosGetCacheSegmentChain ( { if (i == 0) { - *CacheSeg = CacheSegList[i]; - Previous = CacheSegList[i]; + *Vacb = VacbList[i]; + Previous = VacbList[i]; } else { - Previous->NextInChain = CacheSegList[i]; - Previous = CacheSegList[i]; + Previous->NextInChain = VacbList[i]; + Previous = VacbList[i]; } } ASSERT(Previous); @@ -794,31 +794,31 @@ CcRosGetCacheSegmentChain ( NTSTATUS NTAPI -CcRosGetCacheSegment ( +CcRosGetVacb ( PBCB Bcb, ULONG FileOffset, PULONG BaseOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, - PCACHE_SEGMENT* CacheSeg) + PROS_VACB *Vacb) { - PCACHE_SEGMENT current; + PROS_VACB current; NTSTATUS Status; ASSERT(Bcb); - DPRINT("CcRosGetCacheSegment()\n"); + DPRINT("CcRosGetVacb()\n"); /* - * Look for a cache segment already mapping the same data. + * Look for a VACB already mapping the same data. */ - current = CcRosLookupCacheSegment(Bcb, FileOffset); + current = CcRosLookupVacb(Bcb, FileOffset); if (current == NULL) { /* - * Otherwise create a new segment. + * Otherwise create a new VACB. */ - Status = CcRosCreateCacheSegment(Bcb, FileOffset, ¤t); + Status = CcRosCreateVacb(Bcb, FileOffset, ¤t); if (!NT_SUCCESS(Status)) { return Status; @@ -828,30 +828,30 @@ CcRosGetCacheSegment ( KeAcquireGuardedMutex(&ViewLock); /* Move to the tail of the LRU list */ - RemoveEntryList(¤t->CacheSegmentLRUListEntry); - InsertTailList(&CacheSegmentLRUListHead, ¤t->CacheSegmentLRUListEntry); + RemoveEntryList(¤t->VacbLruListEntry); + InsertTailList(&VacbLruListHead, ¤t->VacbLruListEntry); KeReleaseGuardedMutex(&ViewLock); /* - * Return information about the segment to the caller. + * Return information about the VACB to the caller. */ *UptoDate = current->Valid; *BaseAddress = current->BaseAddress; DPRINT("*BaseAddress %p\n", *BaseAddress); - *CacheSeg = current; + *Vacb = current; *BaseOffset = current->FileOffset; return STATUS_SUCCESS; } NTSTATUS NTAPI -CcRosRequestCacheSegment ( +CcRosRequestVacb ( PBCB Bcb, ULONG FileOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, - PCACHE_SEGMENT* CacheSeg) + PROS_VACB *Vacb) /* * FUNCTION: Request a page mapping for a BCB */ @@ -867,12 +867,12 @@ CcRosRequestCacheSegment ( KeBugCheck(CACHE_MANAGER); } - return CcRosGetCacheSegment(Bcb, - FileOffset, - &BaseOffset, - BaseAddress, - UptoDate, - CacheSeg); + return CcRosGetVacb(Bcb, + FileOffset, + &BaseOffset, + BaseAddress, + UptoDate, + Vacb); } static @@ -894,28 +894,28 @@ CcFreeCachePage ( } NTSTATUS -CcRosInternalFreeCacheSegment ( - PCACHE_SEGMENT CacheSeg) +CcRosInternalFreeVacb ( + PROS_VACB Vacb) /* - * FUNCTION: Releases a cache segment associated with a BCB + * FUNCTION: Releases a VACB associated with a BCB */ { - DPRINT("Freeing cache segment 0x%p\n", CacheSeg); + DPRINT("Freeing VACB 0x%p\n", Vacb); #if DBG - if ( CacheSeg->Bcb->Trace ) + if (Vacb->Bcb->Trace) { - DPRINT1("CacheMap 0x%p: deleting Cache Segment: 0x%p\n", CacheSeg->Bcb, CacheSeg ); + DPRINT1("CacheMap 0x%p: deleting VACB: 0x%p\n", Vacb->Bcb, Vacb); } #endif MmLockAddressSpace(MmGetKernelAddressSpace()); MmFreeMemoryArea(MmGetKernelAddressSpace(), - CacheSeg->MemoryArea, + Vacb->MemoryArea, CcFreeCachePage, NULL); MmUnlockAddressSpace(MmGetKernelAddressSpace()); - ExFreeToNPagedLookasideList(&CacheSegLookasideList, CacheSeg); + ExFreeToNPagedLookasideList(&VacbLookasideList, Vacb); return STATUS_SUCCESS; } @@ -932,7 +932,7 @@ CcFlushCache ( { PBCB Bcb; LARGE_INTEGER Offset; - PCACHE_SEGMENT current; + PROS_VACB current; NTSTATUS Status; KIRQL oldIrql; @@ -961,12 +961,12 @@ CcFlushCache ( while (Length > 0) { - current = CcRosLookupCacheSegment (Bcb, Offset.u.LowPart); + current = CcRosLookupVacb(Bcb, Offset.u.LowPart); if (current != NULL) { if (current->Dirty) { - Status = CcRosFlushCacheSegment(current); + Status = CcRosFlushVacb(current); if (!NT_SUCCESS(Status) && IoStatus != NULL) { IoStatus->Status = Status; @@ -976,7 +976,7 @@ CcFlushCache ( KeAcquireGuardedMutex(&ViewLock); KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - CcRosCacheSegmentDecRefCount(current); + CcRosVacbDecRefCount(current); KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); } @@ -1011,7 +1011,7 @@ CcRosDeleteFileCache ( */ { PLIST_ENTRY current_entry; - PCACHE_SEGMENT current; + PROS_VACB current; LIST_ENTRY FreeList; KIRQL oldIrql; @@ -1035,23 +1035,23 @@ CcRosDeleteFileCache ( FileObject->SectionObjectPointer->SharedCacheMap = NULL; /* - * Release all cache segments. + * Release all VACBs */ InitializeListHead(&FreeList); KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - while (!IsListEmpty(&Bcb->BcbSegmentListHead)) + while (!IsListEmpty(&Bcb->BcbVacbListHead)) { - current_entry = RemoveTailList(&Bcb->BcbSegmentListHead); - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); - RemoveEntryList(¤t->CacheSegmentListEntry); - RemoveEntryList(¤t->CacheSegmentLRUListEntry); + current_entry = RemoveTailList(&Bcb->BcbVacbListHead); + current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry); + RemoveEntryList(¤t->VacbListEntry); + RemoveEntryList(¤t->VacbLruListEntry); if (current->Dirty) { - RemoveEntryList(¤t->DirtySegmentListEntry); + RemoveEntryList(¤t->DirtyVacbListEntry); DirtyPageCount -= VACB_MAPPING_GRANULARITY / PAGE_SIZE; - DPRINT1("Freeing dirty segment\n"); + DPRINT1("Freeing dirty VACB\n"); } - InsertHeadList(&FreeList, ¤t->BcbSegmentListEntry); + InsertHeadList(&FreeList, ¤t->BcbVacbListEntry); } #if DBG Bcb->Trace = FALSE; @@ -1064,8 +1064,8 @@ CcRosDeleteFileCache ( while (!IsListEmpty(&FreeList)) { current_entry = RemoveTailList(&FreeList); - current = CONTAINING_RECORD(current_entry, CACHE_SEGMENT, BcbSegmentListEntry); - CcRosInternalFreeCacheSegment(current); + current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry); + CcRosInternalFreeVacb(current); } ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb); KeAcquireGuardedMutex(&ViewLock); @@ -1250,7 +1250,7 @@ CcRosInitializeFileCache ( ((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize; } KeInitializeSpinLock(&Bcb->BcbLock); - InitializeListHead(&Bcb->BcbSegmentListHead); + InitializeListHead(&Bcb->BcbVacbListHead); FileObject->SectionObjectPointer->SharedCacheMap = Bcb; } if (FileObject->PrivateCacheMap == NULL) @@ -1294,9 +1294,9 @@ CcInitView ( { DPRINT("CcInitView()\n"); - InitializeListHead(&CacheSegmentListHead); - InitializeListHead(&DirtySegmentListHead); - InitializeListHead(&CacheSegmentLRUListHead); + InitializeListHead(&VacbListHead); + InitializeListHead(&DirtyVacbListHead); + InitializeListHead(&VacbLruListHead); InitializeListHead(&ClosedListHead); KeInitializeGuardedMutex(&ViewLock); ExInitializeNPagedLookasideList (&iBcbLookasideList, @@ -1313,11 +1313,11 @@ CcInitView ( sizeof(BCB), TAG_BCB, 20); - ExInitializeNPagedLookasideList (&CacheSegLookasideList, + ExInitializeNPagedLookasideList (&VacbLookasideList, NULL, NULL, 0, - sizeof(CACHE_SEGMENT), + sizeof(ROS_VACB), TAG_CSEG, 20); diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index 439ffa311cd..121240d5db9 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -103,7 +103,7 @@ typedef struct _PFSN_PREFETCHER_GLOBALS typedef struct _BCB { - LIST_ENTRY BcbSegmentListHead; + LIST_ENTRY BcbVacbListHead; LIST_ENTRY BcbRemoveListEntry; BOOLEAN RemoveOnClose; ULONG TimeStamp; @@ -115,49 +115,46 @@ typedef struct _BCB KSPIN_LOCK BcbLock; ULONG RefCount; #if DBG - BOOLEAN Trace; /* enable extra trace output for this BCB and it's cache segments */ + BOOLEAN Trace; /* enable extra trace output for this BCB and it's VACBs */ #endif } BCB, *PBCB; -typedef struct _CACHE_SEGMENT +typedef struct _ROS_VACB { - /* Base address of the region where the cache segment data is mapped. */ + /* Base address of the region where the view's data is mapped. */ PVOID BaseAddress; - /* - * Memory area representing the region where the cache segment data is - * mapped. - */ + /* Memory area representing the region where the view's data is mapped. */ struct _MEMORY_AREA* MemoryArea; - /* Are the contents of the cache segment data valid. */ + /* Are the contents of the view valid. */ BOOLEAN Valid; - /* Are the contents of the cache segment data newer than those on disk. */ + /* Are the contents of the view newer than those on disk. */ BOOLEAN Dirty; /* Page out in progress */ BOOLEAN PageOut; ULONG MappedCount; - /* Entry in the list of segments for this BCB. */ - LIST_ENTRY BcbSegmentListEntry; - /* Entry in the list of segments which are dirty. */ - LIST_ENTRY DirtySegmentListEntry; - /* Entry in the list of segments. */ - LIST_ENTRY CacheSegmentListEntry; - LIST_ENTRY CacheSegmentLRUListEntry; - /* Offset in the file which this cache segment maps. */ + /* Entry in the list of VACBs for this BCB. */ + LIST_ENTRY BcbVacbListEntry; + /* Entry in the list of VACBs which are dirty. */ + LIST_ENTRY DirtyVacbListEntry; + /* Entry in the list of VACBs. */ + LIST_ENTRY VacbListEntry; + LIST_ENTRY VacbLruListEntry; + /* Offset in the file which this view maps. */ ULONG FileOffset; /* Mutex */ KMUTEX Mutex; /* Number of references. */ ULONG ReferenceCount; - /* Pointer to the BCB for the file which this cache segment maps data for. */ + /* Pointer to the BCB for the file which this view maps data for. */ PBCB Bcb; - /* Pointer to the next cache segment in a chain. */ - struct _CACHE_SEGMENT* NextInChain; -} CACHE_SEGMENT, *PCACHE_SEGMENT; + /* Pointer to the next VACB in a chain. */ + struct _ROS_VACB *NextInChain; +} ROS_VACB, *PROS_VACB; typedef struct _INTERNAL_BCB { PUBLIC_BCB PFCB; - PCACHE_SEGMENT CacheSegment; + PROS_VACB Vacb; BOOLEAN Dirty; CSHORT RefCount; /* (At offset 0x34 on WinNT4) */ } INTERNAL_BCB, *PINTERNAL_BCB; @@ -185,17 +182,17 @@ CcMdlWriteComplete2( NTSTATUS NTAPI -CcRosFlushCacheSegment(PCACHE_SEGMENT CacheSegment); +CcRosFlushVacb(PROS_VACB Vacb); NTSTATUS NTAPI -CcRosGetCacheSegment( +CcRosGetVacb( PBCB Bcb, ULONG FileOffset, PULONG BaseOffset, PVOID *BaseAddress, PBOOLEAN UptoDate, - PCACHE_SEGMENT *CacheSeg + PROS_VACB *Vacb ); VOID @@ -204,11 +201,11 @@ CcInitView(VOID); NTSTATUS NTAPI -ReadCacheSegment(PCACHE_SEGMENT CacheSeg); +CcReadVirtualAddress(PROS_VACB Vacb); NTSTATUS NTAPI -WriteCacheSegment(PCACHE_SEGMENT CacheSeg); +CcWriteVirtualAddress(PROS_VACB Vacb); BOOLEAN NTAPI @@ -216,26 +213,26 @@ CcInitializeCacheManager(VOID); NTSTATUS NTAPI -CcRosUnmapCacheSegment( +CcRosUnmapVacb( PBCB Bcb, ULONG FileOffset, BOOLEAN NowDirty ); -PCACHE_SEGMENT +PROS_VACB NTAPI -CcRosLookupCacheSegment( +CcRosLookupVacb( PBCB Bcb, ULONG FileOffset ); NTSTATUS NTAPI -CcRosGetCacheSegmentChain( +CcRosGetVacbChain( PBCB Bcb, ULONG FileOffset, ULONG Length, - PCACHE_SEGMENT* CacheSeg + PROS_VACB *Vacb ); VOID @@ -244,7 +241,7 @@ CcInitCacheZeroPage(VOID); NTSTATUS NTAPI -CcRosMarkDirtyCacheSegment( +CcRosMarkDirtyVacb( PBCB Bcb, ULONG FileOffset ); @@ -271,9 +268,9 @@ CcRosSetRemoveOnClose(PSECTION_OBJECT_POINTERS SectionObjectPointer); NTSTATUS NTAPI -CcRosReleaseCacheSegment( +CcRosReleaseVacb( BCB* Bcb, - CACHE_SEGMENT *CacheSeg, + PROS_VACB Vacb, BOOLEAN Valid, BOOLEAN Dirty, BOOLEAN Mapped @@ -281,12 +278,12 @@ CcRosReleaseCacheSegment( NTSTATUS NTAPI -CcRosRequestCacheSegment( +CcRosRequestVacb( BCB *Bcb, ULONG FileOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, - CACHE_SEGMENT **CacheSeg + PROS_VACB *Vacb ); NTSTATUS @@ -309,7 +306,7 @@ CcTryToInitializeFileCache(PFILE_OBJECT FileObject); FORCEINLINE BOOLEAN -DoSegmentsIntersect( +DoRangesIntersect( _In_ ULONG Offset1, _In_ ULONG Length1, _In_ ULONG Offset2, @@ -324,10 +321,10 @@ DoSegmentsIntersect( FORCEINLINE BOOLEAN -IsPointInSegment( +IsPointInRange( _In_ ULONG Offset1, _In_ ULONG Length1, _In_ ULONG Point) { - return DoSegmentsIntersect(Offset1, Length1, Point, 1); + return DoRangesIntersect(Offset1, Length1, Point, 1); } diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 243a837bd76..2e7c2e45bd7 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -921,13 +921,13 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, Bcb = FileObject->SectionObjectPointer->SharedCacheMap; IsDirectMapped = TRUE; #ifndef NEWCC - Status = CcRosUnmapCacheSegment(Bcb, FileOffset.LowPart, Dirty); + Status = CcRosUnmapVacb(Bcb, FileOffset.LowPart, Dirty); #else Status = STATUS_SUCCESS; #endif if (!NT_SUCCESS(Status)) { - DPRINT1("CcRosUnmapCacheSegment failed, status = %x\n", Status); + DPRINT1("CcRosUnmapVacb failed, status = %x\n", Status); KeBugCheck(MEMORY_MANAGEMENT); } } @@ -1016,12 +1016,12 @@ BOOLEAN MiIsPageFromCache(PMEMORY_AREA MemoryArea, if (!(MemoryArea->Data.SectionData.Segment->Image.Characteristics & IMAGE_SCN_MEM_SHARED)) { PBCB Bcb; - PCACHE_SEGMENT CacheSeg; + PROS_VACB Vacb; Bcb = MemoryArea->Data.SectionData.Section->FileObject->SectionObjectPointer->SharedCacheMap; - CacheSeg = CcRosLookupCacheSegment(Bcb, (ULONG)(SegOffset + MemoryArea->Data.SectionData.Segment->Image.FileOffset)); - if (CacheSeg) + Vacb = CcRosLookupVacb(Bcb, (ULONG)(SegOffset + MemoryArea->Data.SectionData.Segment->Image.FileOffset)); + if (Vacb) { - CcRosReleaseCacheSegment(Bcb, CacheSeg, CacheSeg->Valid, FALSE, TRUE); + CcRosReleaseVacb(Bcb, Vacb, Vacb->Valid, FALSE, TRUE); return TRUE; } } @@ -1070,7 +1070,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, ULONGLONG FileOffset; PVOID BaseAddress; BOOLEAN UptoDate; - PCACHE_SEGMENT CacheSeg; + PROS_VACB Vacb; PFILE_OBJECT FileObject; NTSTATUS Status; ULONG_PTR RawLength; @@ -1091,7 +1091,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, /* * If the file system is letting us go directly to the cache and the * memory area was mapped at an offset in the file which is page aligned - * then get the related cache segment. + * then get the related VACB. */ if (((FileOffset % PAGE_SIZE) == 0) && ((SegOffset + PAGE_SIZE <= RawLength) || !IsImageSection) && @@ -1099,16 +1099,16 @@ MiReadPage(PMEMORY_AREA MemoryArea, { /* - * Get the related cache segment; we use a lower level interface than - * filesystems do because it is safe for us to use an offset with a + * Get the related VACB; we use a lower level interface than + * filesystems do because it is safe for us to use an offset with an * alignment less than the file system block size. */ - Status = CcRosGetCacheSegment(Bcb, - (ULONG)FileOffset, - &BaseOffset, - &BaseAddress, - &UptoDate, - &CacheSeg); + Status = CcRosGetVacb(Bcb, + (ULONG)FileOffset, + &BaseOffset, + &BaseAddress, + &UptoDate, + &Vacb); if (!NT_SUCCESS(Status)) { return(Status); @@ -1116,13 +1116,13 @@ MiReadPage(PMEMORY_AREA MemoryArea, if (!UptoDate) { /* - * If the cache segment isn't up to date then call the file + * If the VACB isn't up to date then call the file * system to read in the data. */ - Status = ReadCacheSegment(CacheSeg); + Status = CcReadVirtualAddress(Vacb); if (!NT_SUCCESS(Status)) { - CcRosReleaseCacheSegment(Bcb, CacheSeg, FALSE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); return Status; } } @@ -1131,19 +1131,19 @@ MiReadPage(PMEMORY_AREA MemoryArea, (void)*((volatile char*)BaseAddress + FileOffset - BaseOffset); /* - * Retrieve the page from the cache segment that we actually want. + * Retrieve the page from the view that we actually want. */ (*Page) = MmGetPhysicalAddress((char*)BaseAddress + FileOffset - BaseOffset).LowPart >> PAGE_SHIFT; - CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, TRUE); + CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, TRUE); } else { PEPROCESS Process; KIRQL Irql; PVOID PageAddr; - ULONG_PTR CacheSegOffset; + ULONG_PTR VacbOffset; /* * Allocate a page, this is rather complicated by the possibility @@ -1156,12 +1156,12 @@ MiReadPage(PMEMORY_AREA MemoryArea, { return(Status); } - Status = CcRosGetCacheSegment(Bcb, - (ULONG)FileOffset, - &BaseOffset, - &BaseAddress, - &UptoDate, - &CacheSeg); + Status = CcRosGetVacb(Bcb, + (ULONG)FileOffset, + &BaseOffset, + &BaseAddress, + &UptoDate, + &Vacb); if (!NT_SUCCESS(Status)) { return(Status); @@ -1169,40 +1169,40 @@ MiReadPage(PMEMORY_AREA MemoryArea, if (!UptoDate) { /* - * If the cache segment isn't up to date then call the file + * If the VACB isn't up to date then call the file * system to read in the data. */ - Status = ReadCacheSegment(CacheSeg); + Status = CcReadVirtualAddress(Vacb); if (!NT_SUCCESS(Status)) { - CcRosReleaseCacheSegment(Bcb, CacheSeg, FALSE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); return Status; } } Process = PsGetCurrentProcess(); PageAddr = MiMapPageInHyperSpace(Process, *Page, &Irql); - CacheSegOffset = (ULONG_PTR)(BaseOffset + VACB_MAPPING_GRANULARITY - FileOffset); + VacbOffset = (ULONG_PTR)(BaseOffset + VACB_MAPPING_GRANULARITY - FileOffset); Length = RawLength - SegOffset; - if (Length <= CacheSegOffset && Length <= PAGE_SIZE) + if (Length <= VacbOffset && Length <= PAGE_SIZE) { memcpy(PageAddr, (char*)BaseAddress + FileOffset - BaseOffset, Length); } - else if (CacheSegOffset >= PAGE_SIZE) + else if (VacbOffset >= PAGE_SIZE) { memcpy(PageAddr, (char*)BaseAddress + FileOffset - BaseOffset, PAGE_SIZE); } else { - memcpy(PageAddr, (char*)BaseAddress + FileOffset - BaseOffset, CacheSegOffset); + memcpy(PageAddr, (char*)BaseAddress + FileOffset - BaseOffset, VacbOffset); MiUnmapPageInHyperSpace(Process, PageAddr, Irql); - CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, FALSE); - Status = CcRosGetCacheSegment(Bcb, - (ULONG)(FileOffset + CacheSegOffset), - &BaseOffset, - &BaseAddress, - &UptoDate, - &CacheSeg); + CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE); + Status = CcRosGetVacb(Bcb, + (ULONG)(FileOffset + VacbOffset), + &BaseOffset, + &BaseAddress, + &UptoDate, + &Vacb); if (!NT_SUCCESS(Status)) { return(Status); @@ -1210,28 +1210,28 @@ MiReadPage(PMEMORY_AREA MemoryArea, if (!UptoDate) { /* - * If the cache segment isn't up to date then call the file + * If the VACB isn't up to date then call the file * system to read in the data. */ - Status = ReadCacheSegment(CacheSeg); + Status = CcReadVirtualAddress(Vacb); if (!NT_SUCCESS(Status)) { - CcRosReleaseCacheSegment(Bcb, CacheSeg, FALSE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); return Status; } } PageAddr = MiMapPageInHyperSpace(Process, *Page, &Irql); if (Length < PAGE_SIZE) { - memcpy((char*)PageAddr + CacheSegOffset, BaseAddress, Length - CacheSegOffset); + memcpy((char*)PageAddr + VacbOffset, BaseAddress, Length - VacbOffset); } else { - memcpy((char*)PageAddr + CacheSegOffset, BaseAddress, PAGE_SIZE - CacheSegOffset); + memcpy((char*)PageAddr + VacbOffset, BaseAddress, PAGE_SIZE - VacbOffset); } } MiUnmapPageInHyperSpace(Process, PageAddr, Irql); - CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, FALSE); + CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE); } return(STATUS_SUCCESS); } @@ -1970,7 +1970,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace, } /* - * Take an additional reference to the page or the cache segment. + * Take an additional reference to the page or the VACB. */ if (DirectMapped && !Context.Private) { @@ -2066,14 +2066,14 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace, KeBugCheckEx(MEMORY_MANAGEMENT, STATUS_UNSUCCESSFUL, SwapEntry, (ULONG_PTR)Process, (ULONG_PTR)Address); } #ifndef NEWCC - Status = CcRosUnmapCacheSegment(Bcb, (ULONG)FileOffset, FALSE); + Status = CcRosUnmapVacb(Bcb, (ULONG)FileOffset, FALSE); #else Status = STATUS_SUCCESS; #endif #ifndef NEWCC if (!NT_SUCCESS(Status)) { - DPRINT1("CCRosUnmapCacheSegment failed, status = %x\n", Status); + DPRINT1("CcRosUnmapVacb failed, status = %x\n", Status); KeBugCheckEx(MEMORY_MANAGEMENT, Status, (ULONG_PTR)Bcb, (ULONG_PTR)FileOffset, (ULONG_PTR)Address); } #endif @@ -2366,7 +2366,7 @@ MmWritePageSectionView(PMMSUPPORT AddressSpace, ASSERT(SwapEntry == 0); //SOffset.QuadPart = Offset.QuadPart + Segment->Image.FileOffset; #ifndef NEWCC - CcRosMarkDirtyCacheSegment(Bcb, Offset.LowPart); + CcRosMarkDirtyVacb(Bcb, Offset.LowPart); #endif MmLockSectionSegment(Segment); MmSetPageEntrySectionSegment(Segment, &Offset, PageEntry); @@ -4013,7 +4013,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, FileObject = MemoryArea->Data.SectionData.Section->FileObject; Bcb = FileObject->SectionObjectPointer->SharedCacheMap; #ifndef NEWCC - CcRosMarkDirtyCacheSegment(Bcb, (ULONG)(Offset.QuadPart + Segment->Image.FileOffset)); + CcRosMarkDirtyVacb(Bcb, (ULONG)(Offset.QuadPart + Segment->Image.FileOffset)); #endif ASSERT(SwapEntry == 0); } From 04c489af7563a0a9b6c53f9f22ec5be5f58360aa Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 12 Apr 2014 10:25:03 +0000 Subject: [PATCH 287/419] [RAPPS] * Some improvements and fixes by Erdem Ersoy. CORE-7710 svn path=/trunk/; revision=62709 --- .../base/applications/rapps/rapps/7zip.txt | 2 +- .../base/applications/rapps/rapps/abiword.txt | 2 +- .../applications/rapps/rapps/abiword26.txt | 2 +- .../base/applications/rapps/rapps/abyss.txt | 4 +-- .../base/applications/rapps/rapps/ants.txt | 1 - .../applications/rapps/rapps/audiograbber.txt | 1 - .../base/applications/rapps/rapps/boswars.txt | 3 +-- .../applications/rapps/rapps/comctl32ocx.txt | 2 +- .../base/applications/rapps/rapps/diablo2.txt | 3 +-- .../rapps/rapps/doublecommander.txt | 3 +-- .../applications/rapps/rapps/dvdwritenow.txt | 3 +-- .../applications/rapps/rapps/excelview.txt | 4 ++- reactos/base/applications/rapps/rapps/fap.txt | 2 +- .../base/applications/rapps/rapps/fira.txt | 4 +-- .../base/applications/rapps/rapps/firefox.txt | 3 +-- .../applications/rapps/rapps/firefox2.txt | 3 +-- .../applications/rapps/rapps/firefox3.txt | 3 +-- .../applications/rapps/rapps/firefox36.txt | 3 +-- .../rapps/rapps/glidewrapzbag.txt | 2 +- .../base/applications/rapps/rapps/hover.txt | 2 +- .../base/applications/rapps/rapps/kdewin.txt | 2 +- .../applications/rapps/rapps/lazaruside.txt | 2 +- .../base/applications/rapps/rapps/mfc40.txt | 2 +- .../base/applications/rapps/rapps/mirc.txt | 2 +- .../base/applications/rapps/rapps/mirc6.txt | 2 +- .../base/applications/rapps/rapps/mpxplay.txt | 2 +- .../base/applications/rapps/rapps/msxml3.txt | 2 +- .../base/applications/rapps/rapps/net11.txt | 4 +-- .../base/applications/rapps/rapps/net20.txt | 4 +-- .../applications/rapps/rapps/net20sp2.txt | 4 +-- .../base/applications/rapps/rapps/openttd.txt | 2 +- .../applications/rapps/rapps/photofiltre.txt | 2 +- .../base/applications/rapps/rapps/pingus.txt | 2 +- .../base/applications/rapps/rapps/pptview.txt | 4 ++- .../base/applications/rapps/rapps/ptanks.txt | 3 +-- .../base/applications/rapps/rapps/python.txt | 3 +-- .../base/applications/rapps/rapps/python2.txt | 3 +-- .../base/applications/rapps/rapps/qb64sdl.txt | 2 +- .../base/applications/rapps/rapps/qmmp.txt | 4 +-- .../base/applications/rapps/rapps/remood.txt | 2 +- .../base/applications/rapps/rapps/reshack.txt | 3 +-- .../base/applications/rapps/rapps/rocks.txt | 2 +- .../applications/rapps/rapps/rosbeamd64.txt | 2 +- .../applications/rapps/rapps/rosbearm.txt | 2 +- .../applications/rapps/rapps/sambatng.txt | 2 +- .../base/applications/rapps/rapps/scite.txt | 2 +- .../base/applications/rapps/rapps/scummvm.txt | 2 +- .../applications/rapps/rapps/sdl_mixer.txt | 2 +- .../applications/rapps/rapps/sdl_runtime.txt | 2 +- .../base/applications/rapps/rapps/stamina.txt | 2 +- .../applications/rapps/rapps/superdxb.txt | 3 +-- .../applications/rapps/rapps/superfinder.txt | 1 - .../base/applications/rapps/rapps/tahoma.txt | 4 +-- .../applications/rapps/rapps/thunderbird.txt | 1 - .../applications/rapps/rapps/thunderbird3.txt | 1 - .../applications/rapps/rapps/tileworld.txt | 3 +-- .../rapps/rapps/totalcommander.txt | 3 +-- .../applications/rapps/rapps/tuxpaint.txt | 2 +- .../base/applications/rapps/rapps/vb5run.txt | 26 +++++++++---------- .../base/applications/rapps/rapps/vb6run.txt | 26 +++++++++---------- .../applications/rapps/rapps/vc2005sp1run.txt | 24 ++++++++--------- .../applications/rapps/rapps/vc2008sp1run.txt | 24 ++++++++--------- .../applications/rapps/rapps/vc2010run.txt | 24 ++++++++--------- .../base/applications/rapps/rapps/vc6run.txt | 24 ++++++++--------- .../applications/rapps/rapps/winboard.txt | 2 +- .../base/applications/rapps/rapps/wme9.txt | 4 +-- .../applications/rapps/rapps/wordview.txt | 4 ++- 67 files changed, 144 insertions(+), 158 deletions(-) diff --git a/reactos/base/applications/rapps/rapps/7zip.txt b/reactos/base/applications/rapps/rapps/7zip.txt index b35159b9881..2fc922e8590 100644 --- a/reactos/base/applications/rapps/rapps/7zip.txt +++ b/reactos/base/applications/rapps/rapps/7zip.txt @@ -35,7 +35,7 @@ Description = Un utilitar de arhivare a fișierelor, compatibil cu 7zip, zip, ta Size = 1,1 Mo [Section.041f] -Description = 7zip, zip, tar, rar ve diğer birçok türdeki belgelikleri destekleyen bir belgelikleme aracıdır. +Description = 7zip, zip, tar, rar ve diğer birçok belgelik biçimini destekleyen bir belgelikleme aracıdır. Size = 1,1 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/abiword.txt b/reactos/base/applications/rapps/rapps/abiword.txt index 356a10f4b24..844f68f59ac 100644 --- a/reactos/base/applications/rapps/rapps/abiword.txt +++ b/reactos/base/applications/rapps/rapps/abiword.txt @@ -35,7 +35,7 @@ Description = Procesor de text. Size = 9,4 Mo [Section.041f] -Description = Bir kelime işlemci. +Description = Bir zengin metin düzenleyicisi. Size = 9,4 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/abiword26.txt b/reactos/base/applications/rapps/rapps/abiword26.txt index eb45f14f9b1..0c97d941fbc 100644 --- a/reactos/base/applications/rapps/rapps/abiword26.txt +++ b/reactos/base/applications/rapps/rapps/abiword26.txt @@ -35,7 +35,7 @@ Description = Procesor de text. Size = 5,64 Mo [Section.041f] -Description = Bir kelime işlemci. +Description = Bir zengin metin düzenleyicisi. Size = 5,64 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/abyss.txt b/reactos/base/applications/rapps/rapps/abyss.txt index 2fb03a2cd95..69d4c65955d 100644 --- a/reactos/base/applications/rapps/rapps/abyss.txt +++ b/reactos/base/applications/rapps/rapps/abyss.txt @@ -38,9 +38,9 @@ Description = Abyss Web Server vă permite găzduirea de pagini Web pe calculato Size = 2,1 Mo [Section.041f] -Name = Abyss Örütbağ Sunucusu X1 +Name = Abyss Umûmî Ağ Sunucusu X1 Licence = Ücretsiz -Description = Abyss Örütbağ Sunucusu, bilgisayarda örütbağ sitelerinin yayınlanmasını sağlar. Abyss Örütbağ Sunucusu, güvenli SSL/TLS bağlantılarını (HTTPS), örütbağ teknikbiliminin geniş yelpâzesiyle destekler. Abyss Örütbağ Sunucusu; MySQL, SQLite, MS SQL Server, MS Access, ve Oracle gibi veritabanlarını destekleyen gelişmiş PHP, Perl, Python, ASP, ASP.NET ve Rails üzerinde Ruby örütbağ uygulamalarını çalıştırabilir. +Description = Abyss Umûmî Ağ Sunucusu, bilgisayarda Umûmî Ağ sitelerinin yayınlanmasını sağlar. Abyss Umûmî Ağ Sunucusu, güvenli SSL/TLS bağlantılarını (HTTPS), Umûmî Ağ uygulayım biliminin geniş yelpâzesiyle destekler. Abyss Umûmî Ağ Sunucusu; MySQL, SQLite, MS SQL Server, MS Access, ve Oracle gibi veri tabanlarını destekleyen gelişmiş PHP, Perl, Python, ASP, ASP.NET ve Rails üzerinde Ruby Umûmî Ağ uygulamalarını çalıştırabilir. Size = 2,1 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/ants.txt b/reactos/base/applications/rapps/rapps/ants.txt index 29c27704643..9710f3f604f 100644 --- a/reactos/base/applications/rapps/rapps/ants.txt +++ b/reactos/base/applications/rapps/rapps/ants.txt @@ -20,7 +20,6 @@ Description = Un joc strategic de cărți. Jucătorul își va construi un caste Size = 632 ko [Section.041f] -Name = Karıncalar Licence = Ücretsiz Description = Bir kartlarla izlem oyunu. Kalenizi bitirmeye veyâ rakip kaleyi yıkmaya çalışın. Yazılımı kurmak için ZIP biçiminde çıkartma yeteneği olan bir yazılım gerekir. Size = 632 KB diff --git a/reactos/base/applications/rapps/rapps/audiograbber.txt b/reactos/base/applications/rapps/rapps/audiograbber.txt index 7081db56330..6a2d08aebe7 100644 --- a/reactos/base/applications/rapps/rapps/audiograbber.txt +++ b/reactos/base/applications/rapps/rapps/audiograbber.txt @@ -36,7 +36,6 @@ Description = Program de extragere conținuturi CD audio și de conversie a fiș Size = 4,35 Mo [Section.041f] -Name = Ses Yakalayıcısı Licence = Ücretsiz Description = Çok iyi bir CD ripleyicisi ve ses biçimi dönüştürücüsü. Size = 4,35 MB diff --git a/reactos/base/applications/rapps/rapps/boswars.txt b/reactos/base/applications/rapps/rapps/boswars.txt index a0375716540..9985088fb71 100644 --- a/reactos/base/applications/rapps/rapps/boswars.txt +++ b/reactos/base/applications/rapps/rapps/boswars.txt @@ -22,6 +22,5 @@ Description = Bos Wars e o strategie în timp real, futuristă. Pentru a porni j Size = 62,3 Mo [Section.041f] -Name = Bos Savaşları -Description = Bos Savaşları, gelecekçi ve gerçek zamanlı bir izlem oyunudur. Oyunu başlatmak için Mikroyazılım Basarî C++ 2008 Yürütücüsü'nü kurunuz. +Description = Bos Wars, gelecekçi ve gerçek zamanlı bir izlem oyunudur. Oyunu başlatmak için Microsoft Visual C++ 2008 Yürütücüsü'nü kurunuz. Size = 62,3 MB diff --git a/reactos/base/applications/rapps/rapps/comctl32ocx.txt b/reactos/base/applications/rapps/rapps/comctl32ocx.txt index 3002d2efcd6..b9f10def161 100644 --- a/reactos/base/applications/rapps/rapps/comctl32ocx.txt +++ b/reactos/base/applications/rapps/rapps/comctl32ocx.txt @@ -42,7 +42,7 @@ Description = Modul logic necesar unor aplicații. Conține: comctl32.ocx, mscom Size = 913,73 ko [Section.041f] -Name = Mikroyazılım Basarî Basic 6.0 Ortak Denetimler +Name = Microsoft Visual Basic 6.0 Ortak Denetimler Licence = Bilinmiyor Description = Birtakım uygulamalar için gereklidir. Şunları içerir: comctl32.ocx, mscomctl.ocx, advpack.dll. Size = 913,73 KB diff --git a/reactos/base/applications/rapps/rapps/diablo2.txt b/reactos/base/applications/rapps/rapps/diablo2.txt index 3c2e3007cb3..c266f55b2f3 100644 --- a/reactos/base/applications/rapps/rapps/diablo2.txt +++ b/reactos/base/applications/rapps/rapps/diablo2.txt @@ -36,9 +36,8 @@ Description = Diablo 2 Shareware. Pentru execuție este necesar (pachetul) zecke Size = 131,9 Mo [Section.041f] -Name = Şeytan II Licence = Kısıtlı -Description = Şeytan 2'nin kısıtlısı. Çalıştırmak için zeckensack'ın glide çeviricisi gereklidir. +Description = Diablo 2'nin kısıtlısı. Çalıştırmak için zeckensack'ın glide çeviricisi gereklidir. Size = 131,9 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/doublecommander.txt b/reactos/base/applications/rapps/rapps/doublecommander.txt index 3aa43ec9b74..fe5df184479 100644 --- a/reactos/base/applications/rapps/rapps/doublecommander.txt +++ b/reactos/base/applications/rapps/rapps/doublecommander.txt @@ -31,9 +31,8 @@ Size = 7,5 Mo Description = Double Commander - это открытый двухпанельный файловый менеджер. Вам нужен 7-Zip или подобная утилита для его распаковки. [Section.041f] -Name = İkili Komutan Version = 0.5.8 Gelişme -Description = İkili Komutan, yan yana duran iki bölmenin bulunduğu bir açık kaynak kütük yöneticisidir. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. +Description = Double Commander, yan yana duran iki bölmenin bulunduğu bir açık kaynak kütük yöneticisidir. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. Size = 7,5 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/dvdwritenow.txt b/reactos/base/applications/rapps/rapps/dvdwritenow.txt index aba9a65cdcb..9d9ce9898d2 100644 --- a/reactos/base/applications/rapps/rapps/dvdwritenow.txt +++ b/reactos/base/applications/rapps/rapps/dvdwritenow.txt @@ -27,7 +27,6 @@ Description = DVD Write Now - бесплатная программа для п URLSite = http://dwn.alter.org.ua/ru/ [Section.041f] -Name = DVD Şimdi Yaz Licence = Ücretsiz -Description = Ücretsiz bir doğrudan CD/DVD kaydedicisi. Kurulur kurulmaz CD/DVD RW'leri çıkartılabilir disk olarak kullanabilirsiniz. Bununla birlikte CD/DVD RW'leri UDF kütük dizgesiyle kaydedebilirsiniz. Ayrıca, Mikroyazılım DVD−ROM'ları, Ahead InCD ile kaydedilen RW diskleri gibi diğer yazılımlarla oluşturulan UDF diskleri okutabilirsiniz. Yazılımı kurmak için ZIP biçiminde çıkartma yeteneği olan bir yazılım gerekir. +Description = Ücretsiz bir doğrudan CD/DVD kaydedicisi. Kurulur kurulmaz CD/DVD RW'leri çıkartılabilir disk olarak kullanabilirsiniz. Bununla birlikte CD/DVD RW'leri UDF kütük dizgesiyle kaydedebilirsiniz. Ayrıca, Microsoft DVD−ROM'ları, Ahead InCD ile kaydedilen RW diskleri gibi diğer yazılımlarla oluşturulan UDF diskleri okutabilirsiniz. Yazılımı kurmak için ZIP biçiminde çıkartma yeteneği olan bir yazılım gerekir. Size = 1,2 MB diff --git a/reactos/base/applications/rapps/rapps/excelview.txt b/reactos/base/applications/rapps/rapps/excelview.txt index fe21025526a..653e7d0bd0a 100644 --- a/reactos/base/applications/rapps/rapps/excelview.txt +++ b/reactos/base/applications/rapps/rapps/excelview.txt @@ -1,7 +1,7 @@ ; UTF-8 [Section] -Name = Excel Viewer +Name = Microsoft Excel Viewer Version = 2010 Licence = Unknown Description = Microsoft Excel Viewer @@ -47,7 +47,9 @@ Size = 51,14 Mo URLDownload = http://download.microsoft.com/download/D/D/2/DD28D077-97F3-47C0-9389-0B987918888B/ExcelViewer.exe [Section.041f] +Name = Microsoft Excel Görüntüleyici Licence = Bilinmiyor +Description = Microsoft Excel Görüntüleyici Size = 51.1 MB URLDownload = http://download.microsoft.com/download/8/5/D/85DCDD24-8237-4334-866D-417F74F37C47/ExcelViewer.exe diff --git a/reactos/base/applications/rapps/rapps/fap.txt b/reactos/base/applications/rapps/rapps/fap.txt index 601ca9a06ce..0c4631a7d29 100644 --- a/reactos/base/applications/rapps/rapps/fap.txt +++ b/reactos/base/applications/rapps/rapps/fap.txt @@ -35,7 +35,7 @@ Description = Un lector audio simplu și ușor. Size = 1,89 Mo [Section.041f] -Name = Tilki Ses Oynatıcısı +Name = Fox Ses Oynatıcısı Description = Bayağı ve yeğni bir ses oynatıcısı. Size = 1,89 MB diff --git a/reactos/base/applications/rapps/rapps/fira.txt b/reactos/base/applications/rapps/rapps/fira.txt index e91fb167492..de6649f3d71 100644 --- a/reactos/base/applications/rapps/rapps/fira.txt +++ b/reactos/base/applications/rapps/rapps/fira.txt @@ -21,7 +21,7 @@ Description = Pachetul Mozilla Fira Font, include fonturile Mono și Sans. Dezar Size = 543 ko [Section.041f] -Name = Mozilla Fira Yazı Türü +Name = Mozilla Fira Yazı Tipi Licence = Bilinmiyor -Description = Mozilla Fira Yazı Türü Paketi, Mono ve Sans yazı türlerini kapsar. ReactOS dizinine çıkartınız. +Description = Mozilla Fira Yazı Tipi Paketi, Mono ve Sans yazı tiplerini kapsar. ReactOS dizinine çıkartınız. Size = 543 KB diff --git a/reactos/base/applications/rapps/rapps/firefox.txt b/reactos/base/applications/rapps/rapps/firefox.txt index 4e75115d041..32c2681f22a 100644 --- a/reactos/base/applications/rapps/rapps/firefox.txt +++ b/reactos/base/applications/rapps/rapps/firefox.txt @@ -71,8 +71,7 @@ URLSite = http://www.mozilla.org/sk/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/sk/Firefox%20Setup%2026.0.exe [Section.041f] -Name = Mozilla Ateştilkisi 26 -Description = Özgür örütbağ tarayıcıları arasında en tutulanı ve en iyisi. +Description = Özgür Umûmî Ağ tarayıcıları arasında en tutulanı ve en iyisi. Size = 22,8 MB URLSite = http://www.mozilla.org/tr/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/tr/Firefox%20Setup%2026.0.exe diff --git a/reactos/base/applications/rapps/rapps/firefox2.txt b/reactos/base/applications/rapps/rapps/firefox2.txt index 86f1e790f61..141348b7ca6 100644 --- a/reactos/base/applications/rapps/rapps/firefox2.txt +++ b/reactos/base/applications/rapps/rapps/firefox2.txt @@ -77,8 +77,7 @@ URLSite = http://www.mozilla.org/sk/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.20/win32/sk/Firefox%20Setup%202.0.0.20.exe [Section.041f] -Name = Mozilla Ateştilkisi 2.0 -Description = Özgür örütbağ tarayıcıları arasında en tutulanı ve en iyisi. +Description = Özgür Umûmî Ağ tarayıcıları arasında en tutulanı ve en iyisi. Size = 5,58 MB URLSite = http://www.mozilla.org/tr/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.20/win32/tr/Firefox%20Setup%202.0.0.20.exe diff --git a/reactos/base/applications/rapps/rapps/firefox3.txt b/reactos/base/applications/rapps/rapps/firefox3.txt index 40651a50cb0..94770847870 100644 --- a/reactos/base/applications/rapps/rapps/firefox3.txt +++ b/reactos/base/applications/rapps/rapps/firefox3.txt @@ -77,8 +77,7 @@ URLSite = http://www.mozilla.org/sk/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/sk/Firefox%20Setup%203.0.19.exe [Section.041f] -Name = Mozilla Ateştilkisi 3.0 -Description = Özgür örütbağ tarayıcıları arasında en tutulanı ve en iyisi. +Description = Özgür Umûmî Ağ tarayıcıları arasında en tutulanı ve en iyisi. Size = 7,00 MB URLSite = http://www.mozilla.org/tr/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.0.19-real-real/win32/tr/Firefox%20Setup%203.0.19.exe diff --git a/reactos/base/applications/rapps/rapps/firefox36.txt b/reactos/base/applications/rapps/rapps/firefox36.txt index 5e787924f77..74af5cb753d 100644 --- a/reactos/base/applications/rapps/rapps/firefox36.txt +++ b/reactos/base/applications/rapps/rapps/firefox36.txt @@ -71,8 +71,7 @@ URLSite = http://www.mozilla.org/sk/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.6.28/win32/sk/Firefox%20Setup%203.6.28.exe [Section.041f] -Name = Mozilla Ateştilkisi 3.6 -Description = Özgür örütbağ tarayıcıları arasında en tutulanı ve en iyisi. +Description = Özgür Umûmî Ağ tarayıcıları arasında en tutulanı ve en iyisi. Size = 8,07 MB URLSite = http://www.mozilla.org/tr/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/3.6.28/win32/tr/Firefox%20Setup%203.6.28.exe diff --git a/reactos/base/applications/rapps/rapps/glidewrapzbag.txt b/reactos/base/applications/rapps/rapps/glidewrapzbag.txt index f9f977b04e4..803f7fbf18e 100644 --- a/reactos/base/applications/rapps/rapps/glidewrapzbag.txt +++ b/reactos/base/applications/rapps/rapps/glidewrapzbag.txt @@ -37,7 +37,7 @@ Size = 249,02 ko [Section.041f] Licence = Ücretsiz -Description = glidewrapper, ReactOS'ta Şeytan 2'yi çalıştırmak için gereklidir. +Description = glidewrapper, ReactOS'ta Diablo 2'yi çalıştırmak için gereklidir. Size = 249,02 KB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/hover.txt b/reactos/base/applications/rapps/rapps/hover.txt index dba58628637..526b6f66960 100644 --- a/reactos/base/applications/rapps/rapps/hover.txt +++ b/reactos/base/applications/rapps/rapps/hover.txt @@ -21,5 +21,5 @@ Description = Jocul clasic Hover CTF, care se găsea pe CD-ul Windows 95. Size = 6,2 Mo [Section.041f] -Description = Pencereler 95 CD'sinde bulunan bir bayrak kapmaca oyunu. +Description = Windows 95 CD'sinde bulunan bir bayrak kapmaca oyunu. Size = 6,2 MB diff --git a/reactos/base/applications/rapps/rapps/kdewin.txt b/reactos/base/applications/rapps/rapps/kdewin.txt index e1f234cd9e7..c78c757f65e 100644 --- a/reactos/base/applications/rapps/rapps/kdewin.txt +++ b/reactos/base/applications/rapps/rapps/kdewin.txt @@ -36,7 +36,7 @@ Size = 2,16 Mo [Section.041f] Name = K Masaüstü Ortamı -Description = Pencereler için KDE. +Description = Windows için KDE. Size = 2,16 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/lazaruside.txt b/reactos/base/applications/rapps/rapps/lazaruside.txt index 3c881a465ae..517eba86618 100644 --- a/reactos/base/applications/rapps/rapps/lazaruside.txt +++ b/reactos/base/applications/rapps/rapps/lazaruside.txt @@ -24,4 +24,4 @@ Size = 111 Mo [Section.041f] Licence = Değiştirilmiş LGPL, GPL -Description = Basarî ve basarî olmayan Nesne Paskal çizeylemleri oluşturmayı sağlayan, Özgür Paskal derleyicisini kullanarak çalıştırabilir kütük oluşturan bir çapraz platform tümleşik geliştirme ortamı. +Description = Basarî ve basarî olmayan Nesne Paskal izlenceleri oluşturmayı sağlayan, Özgür Paskal derleyicisini kullanarak çalıştırabilir kütük oluşturan bir çapraz platform tümleşik geliştirme ortamı. diff --git a/reactos/base/applications/rapps/rapps/mfc40.txt b/reactos/base/applications/rapps/rapps/mfc40.txt index 6bb813a3aae..fc79d4f1828 100644 --- a/reactos/base/applications/rapps/rapps/mfc40.txt +++ b/reactos/base/applications/rapps/rapps/mfc40.txt @@ -46,7 +46,7 @@ Description = MFC 4 este necesară unor aplicații. Conține: mfc40.dll, msvcrt4 Size = 865,04 ko [Section.041f] -Name = OLE Görüntüleyicisi ve Mikroyazılım Ana Sınıfları (MFC) Sürüm 4 +Name = OLE Görüntüleyicisi ve Microsoft Ana Sınıfları (MFC) Sürüm 4 Licence = Bilinmiyor Description = Birtakım uygulamalar için gereklidir. Şunları içerir: mfc40.dll, msvcrt40.dll. Size = 865,04 KB diff --git a/reactos/base/applications/rapps/rapps/mirc.txt b/reactos/base/applications/rapps/rapps/mirc.txt index 1a68d8d72e4..68e24783903 100644 --- a/reactos/base/applications/rapps/rapps/mirc.txt +++ b/reactos/base/applications/rapps/rapps/mirc.txt @@ -37,7 +37,7 @@ Size = 1,85 Mo [Section.041f] Licence = Kısıtlı -Description = Örütbağ Eşzamanlı Söyleşi (IRC) istemcileri arasında en tutulanı. +Description = Umûmî Ağ Eşzamanlı Söyleşi (IRC) istemcileri arasında en tutulanı. Size = 1,85 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/mirc6.txt b/reactos/base/applications/rapps/rapps/mirc6.txt index 066732fa237..874ba2a2705 100644 --- a/reactos/base/applications/rapps/rapps/mirc6.txt +++ b/reactos/base/applications/rapps/rapps/mirc6.txt @@ -37,7 +37,7 @@ Size = 1,67 Mo [Section.041f] Licence = Kısıtlı -Description = Örütbağ Eşzamanlı Söyleşi (IRC) istemcileri arasında en tutulanı. +Description = Umûmî Ağ Eşzamanlı Söyleşi (IRC) istemcileri arasında en tutulanı. Size = 1,67 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/mpxplay.txt b/reactos/base/applications/rapps/rapps/mpxplay.txt index 46f0a11b4e0..1b785603dc4 100644 --- a/reactos/base/applications/rapps/rapps/mpxplay.txt +++ b/reactos/base/applications/rapps/rapps/mpxplay.txt @@ -22,5 +22,5 @@ Size = 520 ko Description = Mpxplay - 32-разрядный консольный аудиоплеер для Windows. Вам нужен 7-Zip или подобная утилита для его распаковки. [Section.041f] -Description = Mpxplay, Pencereler için 32 ikillik, konsolluk bir ses oynatıcısıdır. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. +Description = Mpxplay, Windows için 32 bitlik, konsolluk bir ses oynatıcısıdır. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. Size = 520 KB diff --git a/reactos/base/applications/rapps/rapps/msxml3.txt b/reactos/base/applications/rapps/rapps/msxml3.txt index 9666ac34a4a..c7c3cbc3bf6 100644 --- a/reactos/base/applications/rapps/rapps/msxml3.txt +++ b/reactos/base/applications/rapps/rapps/msxml3.txt @@ -43,7 +43,7 @@ Size = 1,85 Mo [Section.041f] Licence = Bilinmiyor -Description = Birtakım Mikroyazılım Yükleyicileri için gereklidir. Şunları içerir: msxml3.dll, msxml3a.dll, msxml3r.dll. +Description = Birtakım Microsoft Yükleyicileri için gereklidir. Şunları içerir: msxml3.dll, msxml3a.dll, msxml3r.dll. Size = 1,85 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/net11.txt b/reactos/base/applications/rapps/rapps/net11.txt index 101d6c1b10d..34eadb61190 100644 --- a/reactos/base/applications/rapps/rapps/net11.txt +++ b/reactos/base/applications/rapps/rapps/net11.txt @@ -33,7 +33,7 @@ Description = Platforma Microsoft .NET versiunea 1.1 - Pachet redistributabl. Size = 23,14 Mo [Section.041f] -Name = Mikroyazılım .NET Çatısı Sürüm 1.1 Yeniden Dağıtılabilir Paket +Name = Microsoft .NET Çatısı Sürüm 1.1 Yeniden Dağıtılabilir Paket Licence = Bilinmiyor -Description = Mikroyazılım .NET Çatısı Sürüm 1.1 - Yeniden Dağıtılabilir Paket +Description = Microsoft .NET Çatısı Sürüm 1.1 - Yeniden Dağıtılabilir Paket Size = 23,14 MB diff --git a/reactos/base/applications/rapps/rapps/net20.txt b/reactos/base/applications/rapps/rapps/net20.txt index 74a8e2dee5a..1a3dd4ce86d 100644 --- a/reactos/base/applications/rapps/rapps/net20.txt +++ b/reactos/base/applications/rapps/rapps/net20.txt @@ -30,7 +30,7 @@ Description = Platforma Microsoft .NET versiunea 2.0 - Pachet redistributabl. Size = 22,42 Mo [Section.041f] -Name = Mikroyazılım .NET Çatısı Sürüm 2.0 Yeniden Dağıtılabilir Paket +Name = Microsoft .NET Çatısı Sürüm 2.0 Yeniden Dağıtılabilir Paket Licence = Bilinmiyor -Description = Mikroyazılım .NET Çatısı Sürüm 2.0 - Yeniden Dağıtılabilir Paket +Description = Microsoft .NET Çatısı Sürüm 2.0 - Yeniden Dağıtılabilir Paket Size = 22,42 MB diff --git a/reactos/base/applications/rapps/rapps/net20sp2.txt b/reactos/base/applications/rapps/rapps/net20sp2.txt index 7c4f2fb8fd7..a6a18a44962 100644 --- a/reactos/base/applications/rapps/rapps/net20sp2.txt +++ b/reactos/base/applications/rapps/rapps/net20sp2.txt @@ -30,7 +30,7 @@ Description = Platforma Microsoft .NET versiunea 2.0 - Service Pack 2. Size = 23,84 Mo [Section.041f] -Name = Mikroyazılım .NET Çatısı Sürüm 2.0 Hizmet Paketi 2 +Name = Microsoft .NET Çatısı Sürüm 2.0 Hizmet Paketi 2 Licence = Bilinmiyor -Description = Mikroyazılım .NET Çatısı Sürüm 2.0 - Hizmet Paketi 2 +Description = Microsoft .NET Çatısı Sürüm 2.0 - Hizmet Paketi 2 Size = 23,84 MB diff --git a/reactos/base/applications/rapps/rapps/openttd.txt b/reactos/base/applications/rapps/rapps/openttd.txt index 4652b1bd887..7f4b0358d6c 100644 --- a/reactos/base/applications/rapps/rapps/openttd.txt +++ b/reactos/base/applications/rapps/rapps/openttd.txt @@ -35,7 +35,7 @@ Description = Clona (open-source a) motorului de joc "Transport Tycoon Deluxe". Size = 6,75 Mo [Section.041f] -Description = Transport Tycoon Deluxe oyun motorunun bir açık kaynak taklidi. Transport Tycoon'un bir sûreti gerekir. +Description = Transport Tycoon Deluxe oyun motorunun bir açık kaynak taklidi. Transport Tycoon'un bir kopyası gerekir. Size = 6,75 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/photofiltre.txt b/reactos/base/applications/rapps/rapps/photofiltre.txt index 9de00912f13..2ed9682f28f 100644 --- a/reactos/base/applications/rapps/rapps/photofiltre.txt +++ b/reactos/base/applications/rapps/rapps/photofiltre.txt @@ -21,5 +21,5 @@ Size = 4,99 Mo [Section.041f] Licence = Ücretsiz -Description = Bu sürüm, katmanlarla gelmektedir ancak Stüdyo X sürümünden daha kısıtlıdır. PhotoFiltre Stüdyo, eksiksiz bir resim düzeltme yazılımıdır. +Description = Bu sürüm, katmanlarla gelmektedir ancak Studio X sürümünden daha kısıtlıdır. PhotoFiltre Studio, eksiksiz bir resim düzeltme yazılımıdır. Size = 4,99 MB diff --git a/reactos/base/applications/rapps/rapps/pingus.txt b/reactos/base/applications/rapps/rapps/pingus.txt index 85bdcaf95c5..af175849314 100644 --- a/reactos/base/applications/rapps/rapps/pingus.txt +++ b/reactos/base/applications/rapps/rapps/pingus.txt @@ -22,5 +22,5 @@ Description = Pingus este un joc-enigmă asemănător cu Lemmings. Size = 16,0 Mo [Section.041f] -Description = Pingus, ücretsiz, Yaban Sıçanları gibi bir bulmaca oyunudur. +Description = Pingus, ücretsiz, Lemmings gibi bir bulmaca oyunudur. Size = 16,0 MB diff --git a/reactos/base/applications/rapps/rapps/pptview.txt b/reactos/base/applications/rapps/rapps/pptview.txt index c5507519cd5..b5a4988c98f 100644 --- a/reactos/base/applications/rapps/rapps/pptview.txt +++ b/reactos/base/applications/rapps/rapps/pptview.txt @@ -1,7 +1,7 @@ ; UTF-8 [Section] -Name = Powerpoint Viewer +Name = Microsoft Powerpoint Viewer Version = 2010 Licence = Unknown Description = Microsoft Powerpoint Viewer @@ -47,7 +47,9 @@ Size = 60,4 Mo URLDownload = http://download.microsoft.com/download/5/6/E/56E4DBA3-D725-43EA-B1E5-DC148022999C/PowerPointViewer.exe [Section.041f] +Name = Microsoft Powerpoint Görüntüleyici Licence = Bilinmiyor +Description = Microsoft Powerpoint Görüntüleyici Size = 60.4 MB URLDownload = http://download.microsoft.com/download/4/6/4/4641DACB-5DE8-4E3A-B8F4-39A1C73889D3/PowerPointViewer.exe diff --git a/reactos/base/applications/rapps/rapps/ptanks.txt b/reactos/base/applications/rapps/rapps/ptanks.txt index 491157b55b2..ef8bfaa0063 100644 --- a/reactos/base/applications/rapps/rapps/ptanks.txt +++ b/reactos/base/applications/rapps/rapps/ptanks.txt @@ -20,7 +20,6 @@ Description = Cel mai rapid joc de artilerie pe care-l veți juca vreodată. Size = 2,86 Mo [Section.041f] -Name = Küçük Tanklar Licence = Kısıtlı -Description = Bu güne kadar oynadığınız en hızlı topçu oyunu. +Description = Bu güne dek oynadığınız en hızlı topçu oyunu. Size = 2,86 MB diff --git a/reactos/base/applications/rapps/rapps/python.txt b/reactos/base/applications/rapps/rapps/python.txt index d5878b1b9b4..69d5e276f64 100644 --- a/reactos/base/applications/rapps/rapps/python.txt +++ b/reactos/base/applications/rapps/rapps/python.txt @@ -35,8 +35,7 @@ Description = Un limbaj de programare dinamic și puternic. Size = 19,6 Mo [Section.041f] -Name = Piton 3 -Description = İlgi çekici, güçlü ve devingen bir çizeylemleme dili. +Description = İlgi çekici, güçlü ve devingen bir izlenceleme dili. Size = 19,6 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/python2.txt b/reactos/base/applications/rapps/rapps/python2.txt index 754428707ed..fd9eeea1a36 100644 --- a/reactos/base/applications/rapps/rapps/python2.txt +++ b/reactos/base/applications/rapps/rapps/python2.txt @@ -35,8 +35,7 @@ Description = Un limbaj de programare dinamic și puternic. Size = 15,48 Mo [Section.041f] -Name = Piton 2 -Description = İlgi çekici, güçlü ve devingen bir çizeylemleme dili. +Description = İlgi çekici, güçlü ve devingen bir izlenceleme dili. Size = 15,48 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/qb64sdl.txt b/reactos/base/applications/rapps/rapps/qb64sdl.txt index 090bf8a8b66..91ec3cd06ad 100644 --- a/reactos/base/applications/rapps/rapps/qb64sdl.txt +++ b/reactos/base/applications/rapps/rapps/qb64sdl.txt @@ -22,5 +22,5 @@ Size = 33,1 Mo [Section.041f] Name = QB64 (SDL Sürümü) Licence = Ücretsiz -Description = QB64; Mikroyazılım Pencereler, Linux ve Mac OS X için yapılmış, Mikroyazılım QBasic ve Mikroyazılım QuickBASIC ile uyumlu olarak tasarlanan, kendi kendini derleyen bir BASIC derleyicisidir. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. +Description = QB64; Microsoft Windows, Linux ve Mac OS X için yapılmış, Microsoft QBasic ve Microsoft QuickBASIC ile uyumlu olarak tasarlanan, kendi kendini derleyen bir BASIC derleyicisidir. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. Size = 33,1 MB diff --git a/reactos/base/applications/rapps/rapps/qmmp.txt b/reactos/base/applications/rapps/rapps/qmmp.txt index 22287f43813..465f29cda7c 100644 --- a/reactos/base/applications/rapps/rapps/qmmp.txt +++ b/reactos/base/applications/rapps/rapps/qmmp.txt @@ -1,7 +1,7 @@ ; UTF-8 [Section] -Name = Qt-based Multimedia Player +Name = Qmmp (Qt-based Multimedia Player) Version = 0.7.3 Licence = GPL Description = Qmmp is an audio-player, written with the help of the Qt library. The user interface is similar to WinAMP or XMMS. Alternative user interfaces also are available. @@ -22,6 +22,6 @@ Size = 16,0 Mo Description = Аудиоплеер Qmmp (Qt-based Multimedia Player). [Section.041f] -Name = Qt Tabanlı Çokluortam Oynatıcısı +Name = Qmmp (Qt Tabanlı Çokluortam Oynatıcısı) Description = Qmmp, Qt kitaplığının yardımıyla yazılan bir ses oynatıcısıdır. Kullanıcı arayüzüsü WinAMP'ınkine ve XMMS'ninkine benzer. Ayrıca değişik kullanıcı arayüzleri de vardır. Size = 16,0 MB diff --git a/reactos/base/applications/rapps/rapps/remood.txt b/reactos/base/applications/rapps/rapps/remood.txt index 80301db70bc..8a5f1d530d1 100644 --- a/reactos/base/applications/rapps/rapps/remood.txt +++ b/reactos/base/applications/rapps/rapps/remood.txt @@ -35,7 +35,7 @@ Description = ReMooD este o portare a codului Doom Legacy. Scopul e de a oferi c Size = 1,15 Mo [Section.041f] -Description = ReMooD, Doom Legacy'in kaynak düzgülerinin bir uyarlamasıdır. Bilindik Legacy deneyimiyle yeni husûsiyetler ve daha fazla kararlılık sağlamayı amaçlar. +Description = ReMooD, Doom Legacy'in kaynak kodlarının bir uyarlamasıdır. Bilindik Legacy deneyimiyle yeni husûsiyetler ve daha fazla kararlılık sağlamayı amaçlar. Size = 1,15 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/reshack.txt b/reactos/base/applications/rapps/rapps/reshack.txt index edbd5350c8e..6751dfe16c3 100644 --- a/reactos/base/applications/rapps/rapps/reshack.txt +++ b/reactos/base/applications/rapps/rapps/reshack.txt @@ -20,7 +20,6 @@ Description = Resource Hacker este un utilitar gratuit pentru inspectarea, modif Size = 730 ko [Section.041f] -Name = Kaynak Korsancısı Licence = Ücretsiz -Description = Kaynak Korsancısı, 32 ya da 64 ikillik Pencereler çaılştırabilirlerini ve .res uzantılı kaynak kütüklerindeki kaynakları görüntüleyen, değiştiren, yeniden adlandıran, ekleyen, silen ve çıkartan ücretsiz bir araçtır. +Description = Resource Hacker, 32 ya da 64 bitlik Windows çaılştırabilirlerini ve .res uzantılı kaynak kütüklerindeki kaynakları görüntüleyen, değiştiren, yeniden adlandıran, ekleyen, silen ve çıkartan ücretsiz bir araçtır. Size = 730 KB diff --git a/reactos/base/applications/rapps/rapps/rocks.txt b/reactos/base/applications/rapps/rapps/rocks.txt index 9eeeed89b0e..743a9c238ae 100644 --- a/reactos/base/applications/rapps/rapps/rocks.txt +++ b/reactos/base/applications/rapps/rapps/rocks.txt @@ -19,5 +19,5 @@ Description = Un joc de tip arcadă pentru UNIX, Mac OS X, Windows și DOS; resp Size = 2,42 Mo [Section.041f] -Description = UNIX, Mac OS X, Pencereler ve DOS için yapılmış, atari oyun salonu türünde bir oyun. Şu gelenekleri içerir: "Boulder Dash" (C64), "Zümrüt Mâdeni" (Amiga), "Supaplex" (Amiga ve PC), "Sokoban" (PC). Yazılımı kurmak için ZIP biçiminde çıkartma yeteneği olan bir yazılım gerekir. +Description = UNIX, Mac OS X, Windows ve DOS için yapılmış, atari oyun salonu türünde bir oyun. Şu gelenekleri içerir: "Boulder Dash" (C64), "Emerald Mine" (Amiga), "Supaplex" (Amiga ve PC), "Sokoban" (PC). Yazılımı kurmak için ZIP biçiminde çıkartma yeteneği olan bir yazılım gerekir. Size = 2,42 MB diff --git a/reactos/base/applications/rapps/rapps/rosbeamd64.txt b/reactos/base/applications/rapps/rapps/rosbeamd64.txt index 3fcba8b18fa..d2cb1c9a5fd 100644 --- a/reactos/base/applications/rapps/rapps/rosbeamd64.txt +++ b/reactos/base/applications/rapps/rapps/rosbeamd64.txt @@ -38,7 +38,7 @@ Description = Permite compilarea surselor ReactOS pentru AMD64. Pentru instrucț Size = 15,83 Mo [Section.041f] -Name = ReactOS Derleme Ortamı +Name = ReactOS Derleme Ortamı AMD64 Eklentisi Description = ReactOS AMD64 Kaynak Kodları'nı derlettirir. Daha çok açıklama için ReactOS Wiki'ye bakınız. Size = 15,83 MB diff --git a/reactos/base/applications/rapps/rapps/rosbearm.txt b/reactos/base/applications/rapps/rapps/rosbearm.txt index f74fb5bff4b..258000ada33 100644 --- a/reactos/base/applications/rapps/rapps/rosbearm.txt +++ b/reactos/base/applications/rapps/rapps/rosbearm.txt @@ -35,7 +35,7 @@ Description = Permite compilarea surselor ReactOS pentru ARM. Pentru instrucțiu Size = 11,15 Mo [Section.041f] -Name = ReactOS Derleme Ortamı +Name = ReactOS Derleme Ortamı ARM Eklentisi Description = ReactOS ARM Kaynak Kodları'nı derlettirir. Daha çok açıklama için ReactOS Wiki'ye bakınız. Size = 11,15 MB diff --git a/reactos/base/applications/rapps/rapps/sambatng.txt b/reactos/base/applications/rapps/rapps/sambatng.txt index a2e430cd731..b004377749c 100644 --- a/reactos/base/applications/rapps/rapps/sambatng.txt +++ b/reactos/base/applications/rapps/rapps/sambatng.txt @@ -35,7 +35,7 @@ Description = Acest instrument permite accesarea în ReactOS a dosarelor/imprima Size = 2,13 Mo [Section.041f] -Description = Bu araç, ReactOS'ta Pencereler'in paylaşılan yazıcılarıyla paylaşılan dizinlerine erişimi sağlar. +Description = Bu araç, ReactOS'ta Windows'un paylaşılan yazıcılarıyla paylaşılan dizinlerine erişimi sağlar. Size = 2,13 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/scite.txt b/reactos/base/applications/rapps/rapps/scite.txt index a469b5e4a46..0b4789cbf80 100644 --- a/reactos/base/applications/rapps/rapps/scite.txt +++ b/reactos/base/applications/rapps/rapps/scite.txt @@ -37,7 +37,7 @@ Size = 722 ko [Section.041f] Licence = Ücretsiz -Description = SciTE, Scintilla tabanlı bir metin düzenleyicisidir. Başlangıçta, Scintilla'yı göstermek için yapılmıştır ancak umûmiyetle çizeylemleri yapmak ve çalıştırmak yetenekleriyle birlikte kullanışlı bir düzenleyici olarak geliştirilmiştir. +Description = SciTE, Scintilla tabanlı bir metin düzenleyicisidir. Başlangıçta, Scintilla'yı göstermek için yapılmıştır ancak umûmiyetle izlenceleri yapmak ve çalıştırmak yetenekleriyle birlikte kullanışlı bir düzenleyici olarak geliştirilmiştir. Size = 722 KB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/scummvm.txt b/reactos/base/applications/rapps/rapps/scummvm.txt index 920b62f84eb..c976de62309 100644 --- a/reactos/base/applications/rapps/rapps/scummvm.txt +++ b/reactos/base/applications/rapps/rapps/scummvm.txt @@ -35,7 +35,7 @@ Description = Motor de execuție pentru jocuri SCUMM. Size = 6,28 Mo [Section.041f] -Description = ReactOS üzerinde Sam ve Max, Dokunaç Günü vb. +Description = ReactOS üzerinde Sam ve Max, Day of the Tentacle vb. Size = 6,28 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/sdl_mixer.txt b/reactos/base/applications/rapps/rapps/sdl_mixer.txt index d21327c07f3..4837a287d1e 100644 --- a/reactos/base/applications/rapps/rapps/sdl_mixer.txt +++ b/reactos/base/applications/rapps/rapps/sdl_mixer.txt @@ -38,7 +38,7 @@ Description = Necesar pentru execuția unor jocuri (open-source). Dezarhivați c Size = 548,02 ko [Section.041f] -Name = Bayağı Doğrudan Ortam Katmanı (SDL) Karıştırıcısı +Name = SDL (Bayağı Doğrudan Ortam Katmanı) Karıştırıcısı Description = Birtakım açık kaynak uygulamalar için gereklidir. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. Size = 548,02 KB diff --git a/reactos/base/applications/rapps/rapps/sdl_runtime.txt b/reactos/base/applications/rapps/rapps/sdl_runtime.txt index 5b5a21c9608..0412ae5d9ed 100644 --- a/reactos/base/applications/rapps/rapps/sdl_runtime.txt +++ b/reactos/base/applications/rapps/rapps/sdl_runtime.txt @@ -39,7 +39,7 @@ Description = Necesar pentru execuția multor jocuri (open-source). Dezarhivați Size = 136,67 ko [Section.041f] -Name = Bayağı Doğrudan Ortam Katmanı (SDL) Yürütücüsü +Name = SDL (Bayağı Doğrudan Ortam Katmanı) Yürütücüsü Description = Birtakım açık kaynak uygulamalar için gereklidir. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. Size = 136,67 KB diff --git a/reactos/base/applications/rapps/rapps/stamina.txt b/reactos/base/applications/rapps/rapps/stamina.txt index 63adea0ed73..2fd20f0c050 100644 --- a/reactos/base/applications/rapps/rapps/stamina.txt +++ b/reactos/base/applications/rapps/rapps/stamina.txt @@ -17,5 +17,5 @@ Description = Tutor gratuit pentru dactilografiere. Pentru a putea lansa acest p Size = 4,7 Mo [Section.041f] -Description = Ücretsiz bir düğme takımında yazma öğreticisi. Yazılımı çalıştırmk için Mikroyazılım Basarî C++ 6 Yeniden Dağıtılabilir Paket'i kurunuz. +Description = Ücretsiz bir düğme takımında yazma öğreticisi. Yazılımı çalıştırmk için Microsoft Visual C++ 6 Yeniden Dağıtılabilir Paket'i kurunuz. Size = 4,7 MB diff --git a/reactos/base/applications/rapps/rapps/superdxb.txt b/reactos/base/applications/rapps/rapps/superdxb.txt index 8c51970b5f5..1db2325cadc 100644 --- a/reactos/base/applications/rapps/rapps/superdxb.txt +++ b/reactos/base/applications/rapps/rapps/superdxb.txt @@ -20,7 +20,6 @@ Description = Un joc ce implică spargerea de cărămizi. Size = 3,8 Mo [Section.041f] -Name = Süper DX-Ball Licence = Kısıtlı -Description = Süper DX-Ball, canlı ve renkli bir tuğla kırma oyunudur. +Description = Super DX-Ball, canlı ve renkli bir tuğla kırma oyunudur. Size = 3,8 MB diff --git a/reactos/base/applications/rapps/rapps/superfinder.txt b/reactos/base/applications/rapps/rapps/superfinder.txt index 1dcc2cde4b3..96829073322 100644 --- a/reactos/base/applications/rapps/rapps/superfinder.txt +++ b/reactos/base/applications/rapps/rapps/superfinder.txt @@ -36,7 +36,6 @@ Description = Aplicație rapidă de căutări complexe de text. Size = 4,94 Mo [Section.041f] -Name = Süper Bulucu XT Licence = Ücretsiz Description = Hızlı ve husûsiyet zengini bir arama uygulaması. Size = 4,94 MB diff --git a/reactos/base/applications/rapps/rapps/tahoma.txt b/reactos/base/applications/rapps/rapps/tahoma.txt index ff9123d1585..73d8134515a 100644 --- a/reactos/base/applications/rapps/rapps/tahoma.txt +++ b/reactos/base/applications/rapps/rapps/tahoma.txt @@ -40,9 +40,9 @@ Description = Pachetul Tahoma Font, necesar unor aplicații (Steam). Conține: T Size = 305,12 ko [Section.041f] -Name = Mikroyazılım Tahoma Yazı Türü +Name = Microsoft Tahoma Yazı Tipi Licence = Bilinmiyor -Description = Tahoma Yazı Türleri. Steam gibi birtakım yazılımlar için gereklidir. Şunları içerir: Tahoma.ttf, Tahomabd.ttf. +Description = Tahoma Yazı Tipleri. Steam gibi birtakım yazılımlar için gereklidir. Şunları içerir: Tahoma.ttf, Tahomabd.ttf. Size = 305,12 KB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/thunderbird.txt b/reactos/base/applications/rapps/rapps/thunderbird.txt index 1171b496f39..5c8dd295d07 100644 --- a/reactos/base/applications/rapps/rapps/thunderbird.txt +++ b/reactos/base/applications/rapps/rapps/thunderbird.txt @@ -60,7 +60,6 @@ URLSite = https://www.mozilla.org/ru/thunderbird/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/ru/Thunderbird%20Setup%2024.2.0.exe [Section.041f] -Name = Mozilla Yıldırımkuşu Description = Özgür mail istemcileri arasında en tutulanı ve en iyisi. Size = 20,99 MB URLSite = https://www.mozilla.org/tr/thunderbird/ diff --git a/reactos/base/applications/rapps/rapps/thunderbird3.txt b/reactos/base/applications/rapps/rapps/thunderbird3.txt index d97583b0fcc..201a4bf2826 100644 --- a/reactos/base/applications/rapps/rapps/thunderbird3.txt +++ b/reactos/base/applications/rapps/rapps/thunderbird3.txt @@ -60,7 +60,6 @@ URLSite = https://www.mozilla.org/ru/thunderbird/ URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.20/win32/ru/Thunderbird%20Setup%203.1.20.exe [Section.041f] -Name = Mozilla Yıldırımkuşu Description = Özgür mail istemcileri arasında en tutulanı ve en iyisi. Size = 8,91 MB URLSite = https://www.mozilla.org/tr/thunderbird/ diff --git a/reactos/base/applications/rapps/rapps/tileworld.txt b/reactos/base/applications/rapps/rapps/tileworld.txt index 2cea96d2a5f..dd3011cdbb1 100644 --- a/reactos/base/applications/rapps/rapps/tileworld.txt +++ b/reactos/base/applications/rapps/rapps/tileworld.txt @@ -35,8 +35,7 @@ Description = Clonă a Chip's Challenge, creată inițial pentru Atari Lynx. Inc Size = 1,16 Mo [Section.041f] -Name = Karolu Dünyâ -Description = Başlangıçta Atari Lynx için yapılan Çip'in Düellosu adlı oyunun iyi bir taklidi. Ücretsiz CCLP2 Çizge Paketi'ni de kapsadığından bunun ruhsatlı özgününe gerek yoktur. +Description = Başlangıçta Atari Lynx için yapılan Chip's Challenge adlı oyunun iyi bir taklidi. Ücretsiz CCLP2 Çizge Paketi'ni de kapsadığından bunun telifli özgününe gerek yoktur. Size = 1,16 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/totalcommander.txt b/reactos/base/applications/rapps/rapps/totalcommander.txt index 98acbb3d891..9623432847f 100644 --- a/reactos/base/applications/rapps/rapps/totalcommander.txt +++ b/reactos/base/applications/rapps/rapps/totalcommander.txt @@ -29,9 +29,8 @@ Description = Total Commander este un gestionar de fișiere după modelul «dou Size = 3,3 Mo [Section.041f] -Name = Eksiksiz Komutan Licence = Kısıtlı -Description = Eksiksiz Komutan, yan yana iki bölmenin bulunduğu bir kütük yöneticisidir. +Description = Total Commander, yan yana iki bölmenin bulunduğu bir kütük yöneticisidir. Size = 3,3 MB [Section.0813] diff --git a/reactos/base/applications/rapps/rapps/tuxpaint.txt b/reactos/base/applications/rapps/rapps/tuxpaint.txt index 9417f43c32d..de7bc9b11d0 100644 --- a/reactos/base/applications/rapps/rapps/tuxpaint.txt +++ b/reactos/base/applications/rapps/rapps/tuxpaint.txt @@ -38,7 +38,7 @@ Description = Un editor grafic bitmap, adresat copiilor. Size = 10,42 Mo [Section.041f] -Description = Çocuklar için açık kaynak ikil eşlem çizge düzenleyicisi. +Description = Çocuklar için açık kaynak bit eşlem çizge düzenleyicisi. Size = 10,42 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/vb5run.txt b/reactos/base/applications/rapps/rapps/vb5run.txt index 2d50e14e8c6..cfdc4712208 100644 --- a/reactos/base/applications/rapps/rapps/vb5run.txt +++ b/reactos/base/applications/rapps/rapps/vb5run.txt @@ -1,10 +1,10 @@ ; UTF-8 [Section] -Name = Visual Basic 5 Runtime +Name = Microsoft Visual Basic 5 Runtime Version = 5.0 Licence = Unknown -Description = Visual Basic 5 Runtime. Contains: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 5 Runtime. Contains: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. Size = 969.59 kB Category = 14 URLSite = http://support.microsoft.com/kb/180071/ @@ -13,44 +13,44 @@ CDPath = none [Section.0407] Licence = Unbekannt -Description = Visual Basic 5 Laufzeitsystem. Beinhaltet: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 5 Laufzeitsystem. Beinhaltet: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. [Section.040a] Licence = Desconocida -Description = Librerias Visual Basic 5. Incluye: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Librerias Microsoft Visual Basic 5. Incluye: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. [Section.040c] Licence = Inconnue -Description = Bibliothèque Visual Basic 5. Contient: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Bibliothèque Microsoft Visual Basic 5. Contient: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. Size = 969,59 ko [Section.0410] Licence = Sconosciuta -Description = Libreria Visual Basic 5. Contiene: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Libreria Microsoft Visual Basic 5. Contiene: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. [Section.0413] Licence = Ongekend -Description = Visual Basic 5 Runtime. Bevat: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 5 Runtime. Bevat: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. [Section.0415] Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Basic 5. Zawiera: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Biblioteki uruchomieniowe Microsoft Visual Basic 5. Zawiera: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. [Section.0418] Licence = Necunoscută -Description = Visual Basic 5 Runtime. Conține: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 5 Runtime. Conține: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. Size = 969,59 ko [Section.041f] -Name = Basarî Basic 5 Yürütücüsü +Name = Microsoft Visual Basic 5 Yürütücüsü Licence = Bilinmiyor -Description = Basarî Basic 5 Yürütücüsü. Şunları içerir: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 5 Yürütücüsü. Şunları içerir: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. Size = 969,59 KB [Section.0422] Licence = Невідома -Description = Бібліотеки Visual Basic 5. включає: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Бібліотеки Microsoft Visual Basic 5. включає: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. [Section.0813] Licence = Ongekend -Description = Visual Basic 5 Runtime. Bevat: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 5 Runtime. Bevat: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. diff --git a/reactos/base/applications/rapps/rapps/vb6run.txt b/reactos/base/applications/rapps/rapps/vb6run.txt index 0eeb5e92a0a..1ae706e6d56 100644 --- a/reactos/base/applications/rapps/rapps/vb6run.txt +++ b/reactos/base/applications/rapps/rapps/vb6run.txt @@ -1,10 +1,10 @@ ; UTF-8 [Section] -Name = Visual Basic 6 Runtime +Name = Microsoft Visual Basic 6 Runtime Version = 6.0 Licence = Unknown -Description = Visual Basic 6 Runtime. Contains: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 6 Runtime. Contains: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. Size = 1.02 MB Category = 14 URLSite = http://support.microsoft.com/kb/192461/ @@ -13,44 +13,44 @@ CDPath = none [Section.0407] Licence = Unbekannt -Description = Visual Basic 6 Laufzeitsystem. Beinhaltet: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 6 Laufzeitsystem. Beinhaltet: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. [Section.040a] Licence = Desconocida -Description = Librerias Visual Basic 6. Incluye: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Librerias Microsoft Visual Basic 6. Incluye: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. [Section.040c] Licence = Inconnue -Description = Bibliothèque Visual Basic 6. Contient: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Bibliothèque Microsoft Visual Basic 6. Contient: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. Size = 1,02 Mo [Section.0410] Licence = Sconosciuta -Description = Libreria Visual Basic 6.Contiene: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. +Description = Libreria Microsoft Visual Basic 6.Contiene: advpack.dll, asycfilt.dll, comcat.dll, msvbvm50.dll, oleaut32.dll, olepro32.dll. [Section.0413] Licence = Ongekend -Description = Visual Basic 6 Runtime. Bevat: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 6 Runtime. Bevat: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. [Section.0415] Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Basic 6. Zawiera: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Biblioteki uruchomieniowe Microsoft Visual Basic 6. Zawiera: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. [Section.0418] Licence = Necunoscută -Description = Visual Basic 6 Runtime. Conține: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 6 Runtime. Conține: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. Size = 1,02 Mo [Section.041f] -Name = Basarî Basic 6 Yürütücüsü +Name = Microsoft Visual Basic 6 Yürütücüsü Licence = Bilinmiyor -Description = Basarî Basic 6 Yürütücüsü. Şunları içerir: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 6 Yürütücüsü. Şunları içerir: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. Size = 1,02 MB [Section.0422] Licence = Невідома -Description = Бібліотеки Visual Basic 6. включає: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Бібліотеки Microsoft Visual Basic 6. включає: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. [Section.0813] Licence = Ongekend -Description = Visual Basic 6 Runtime. Bevat: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Basic 6 Runtime. Bevat: advpack.dll, asycfilt.dll, comcat.dll, msvbvm60.dll, oleaut32.dll, olepro32.dll. diff --git a/reactos/base/applications/rapps/rapps/vc2005sp1run.txt b/reactos/base/applications/rapps/rapps/vc2005sp1run.txt index 8e15cf3e9c3..58693a9430a 100644 --- a/reactos/base/applications/rapps/rapps/vc2005sp1run.txt +++ b/reactos/base/applications/rapps/rapps/vc2005sp1run.txt @@ -4,7 +4,7 @@ Name = Microsoft Visual C++ 2005 SP1 Redistributable Package Version = 7.1 Licence = Unknown -Description = Visual Studio 2005 Runtime SP1. Contains: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Microsoft Visual Studio 2005 Runtime SP1. Contains: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. Size = 2.6 MB Category = 14 URLSite = http://www.microsoft.com/en-us/download/details.aspx?id=5638 @@ -13,44 +13,44 @@ CDPath = none [Section.0407] Licence = Unbekannt -Description = Visual Studio 2005 Laufzeitsystem SP1. Beinhaltet: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Microsoft Visual Studio 2005 Laufzeitsystem SP1. Beinhaltet: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. [Section.040a] Licence = Desconocida -Description = Librerias Visual Studio 2005 SP1. Incluye: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Librerias Microsoft Visual Studio 2005 SP1. Incluye: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. [Section.040c] Licence = Inconnue -Description = Bibliothèque Visual Studio 2005 SP1. Contient: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Bibliothèque Microsoft Visual Studio 2005 SP1. Contient: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. Size = 2,6 Mo [Section.0410] Licence = Sconosciuta -Description = Visual Studio 2005 Runtime SP1. Contiene: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Microsoft Visual Studio 2005 Runtime SP1. Contiene: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. [Section.0413] Licence = Ongekend -Description = Visual Studio 2005 Runtime SP1. Bevat: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Microsoft Visual Studio 2005 Runtime SP1. Bevat: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. [Section.0415] Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Studio 2005 SP1. Zawiera: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Biblioteki uruchomieniowe Microsoft Visual Studio 2005 SP1. Zawiera: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. [Section.0418] Licence = Necunoscută -Description = Visual Studio 2005 Runtime SP1. Conține: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Microsoft Visual Studio 2005 Runtime SP1. Conține: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. Size = 2,6 Mo [Section.041f] -Name = Mikroyazılım Basarî C++ 2005 SP1 Yeniden Dağıtılabilir Paket +Name = Microsoft Visual C++ 2005 SP1 Yeniden Dağıtılabilir Paket Licence = Bilinmiyor -Description = Basarî Stüdyo 2005 SP1 Yürütücüsü. Şunları içerir: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Microsoft Visual Studio 2005 SP1 Yürütücüsü. Şunları içerir: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. Size = 2,6 MB [Section.0422] Licence = Невідома -Description = Бібліотеки Visual Studio 2005 SP1. включає: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Бібліотеки Microsoft Visual Studio 2005 SP1. включає: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. [Section.0813] Licence = Ongekend -Description = Visual Studio 2005 Runtime SP1. Bevat: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. +Description = Microsoft Visual Studio 2005 Runtime SP1. Bevat: atl80.dll, mfc80.dll, mfcm80.dll, mfcm80u.dll, msdia80.dll, msvcm80.dll, msvcp80.dll, msvcr80.dll, vcomp.dll. diff --git a/reactos/base/applications/rapps/rapps/vc2008sp1run.txt b/reactos/base/applications/rapps/rapps/vc2008sp1run.txt index 1e2ae5a0b71..74c0f3bf4ce 100644 --- a/reactos/base/applications/rapps/rapps/vc2008sp1run.txt +++ b/reactos/base/applications/rapps/rapps/vc2008sp1run.txt @@ -4,7 +4,7 @@ Name = Microsoft Visual C++ 2008 SP1 Redistributable Package Version = 8.0 Licence = Unknown -Description = Visual Studio 2008 SP1 Runtime. Contains: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Microsoft Visual Studio 2008 SP1 Runtime. Contains: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. Size = 4.02 MB Category = 14 URLSite = http://www.microsoft.com/en-us/download/details.aspx?id=5582 @@ -13,44 +13,44 @@ CDPath = none [Section.0407] Licence = Unbekannt -Description = Visual Studio 2008 SP1 Laufzeitsystem. Enthält: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Microsoft Visual Studio 2008 SP1 Laufzeitsystem. Enthält: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. [Section.040a] Licence = Desconocida -Description = Librerias Visual Studio 2008 SP1. Incluye: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Librerias Microsoft Visual Studio 2008 SP1. Incluye: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. [Section.040c] Licence = Inconnue -Description = Bibliothèque Visual Studio 2008 SP1. Contient: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Bibliothèque Microsoft Visual Studio 2008 SP1. Contient: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. Size = 4,02 Mo [Section.0410] Licence = Sconosciuta -Description = Visual Studio 2008 Runtime SP1. Contiene: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Microsoft Visual Studio 2008 Runtime SP1. Contiene: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. [Section.0413] Licence = Ongekend -Description = Visual Studio 2008 SP1 Runtime. Bevat: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Microsoft Visual Studio 2008 SP1 Runtime. Bevat: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. [Section.0415] Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Studio 2008 SP1. Zawiera: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Biblioteki uruchomieniowe Microsoft Visual Studio 2008 SP1. Zawiera: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. [Section.0418] Licence = Necunoscută -Description = Visual Studio 2008 SP1 Runtime. Conține: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Microsoft Visual Studio 2008 SP1 Runtime. Conține: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. Size = 4,02 Mo [Section.041f] -Name = Mikroyazılım Basarî C++ 2008 SP1 Yeniden Dağıtılabilir Paket +Name = Microsoft Visual C++ 2008 SP1 Yeniden Dağıtılabilir Paket Licence = Bilinmiyor -Description = Basarî Stüdyo 2008 SP1 Yürütücüsü. Şunları içerir: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Microsoft Visual Studio 2008 SP1 Yürütücüsü. Şunları içerir: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. Size = 4,02 MB [Section.0422] Licence = Невідома -Description = Бібліотеки Visual Studio 2008 SP1. включає: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Бібліотеки Microsoft Visual Studio 2008 SP1. включає: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. [Section.0813] Licence = Ongekend -Description = Visual Studio 2008 SP1 Runtime. Bevat: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. +Description = Microsoft Visual Studio 2008 SP1 Runtime. Bevat: atl90.dll, mfc90.dll, mfc90u.dll, mfcm90.dll, mfcm90u.dll, msdia90.dll, msvcm90.dll, msvcp90.dll, msvcr90.dll, vcomp90.dll. diff --git a/reactos/base/applications/rapps/rapps/vc2010run.txt b/reactos/base/applications/rapps/rapps/vc2010run.txt index acab1a71a60..e944533ec75 100644 --- a/reactos/base/applications/rapps/rapps/vc2010run.txt +++ b/reactos/base/applications/rapps/rapps/vc2010run.txt @@ -4,7 +4,7 @@ Name = Microsoft Visual C++ 2010 Redistributable Package Version = 8.0 Licence = Unknown -Description = Visual Studio 2010 Runtime. Contains: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Microsoft Visual Studio 2010 Runtime. Contains: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. Size = 4.8 MB Category = 14 URLSite = http://www.microsoft.com/en-us/download/details.aspx?id=5555 @@ -13,44 +13,44 @@ CDPath = none [Section.0407] Licence = Unbekannt -Description = Visual Studio 2010 Laufzeitsystem. Beinhaltet: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Microsoft Visual Studio 2010 Laufzeitsystem. Beinhaltet: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. [Section.040a] Licence = Desconocida -Description = Librerias Visual Studio 2010. Incluye: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Librerias Microsoft Visual Studio 2010. Incluye: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. [Section.040c] Licence = Inconnue -Description = Bibliothèque Visual Studio 2010. Contient: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Bibliothèque Microsoft Visual Studio 2010. Contient: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. Size = 4.8 Mo [Section.0410] Licence = Sconosciuta -Description = Libreria Visual Studio 2010. Include: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Libreria Microsoft Visual Studio 2010. Include: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. [Section.0413] Licence = Ongekend -Description = Visual Studio 2010 Runtime. Bevat: atl100.dll, mfc100.dll, mfc90u.dll, mfcm100.dll, mfcm90u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Microsoft Visual Studio 2010 Runtime. Bevat: atl100.dll, mfc100.dll, mfc90u.dll, mfcm100.dll, mfcm90u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. [Section.0415] Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Studio 2010. Zawiera: atl100.dll, mfc100.dll, mfc90u.dll, mfcm100.dll, mfcm90u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Biblioteki uruchomieniowe Microsoft Visual Studio 2010. Zawiera: atl100.dll, mfc100.dll, mfc90u.dll, mfcm100.dll, mfcm90u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. [Section.0418] Licence = Necunoscută -Description = Visual Studio 2010 Runtime. Conține: atl100.dll, mfc100.dll, mfc90u.dll, mfcm100.dll, mfcm90u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Microsoft Visual Studio 2010 Runtime. Conține: atl100.dll, mfc100.dll, mfc90u.dll, mfcm100.dll, mfcm90u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. Size = 4,8 Mo [Section.041f] -Name = Mikroyazılım Basarî C++ 2010 Yeniden Dağıtılabilir Paket +Name = Microsoft Visual C++ 2010 Yeniden Dağıtılabilir Paket Licence = Bilinmiyor -Description = Basarî Stüdyo 2010 Yürütücüsü. Şunları içerir: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Microsoft Visual Studio 2010 Yürütücüsü. Şunları içerir: atl100.dll, mfc100.dll, mfc100u.dll, mfcm100.dll, mfcm100u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. Size = 4,8 MB [Section.0422] Licence = Невідома -Description = Бібліотеки Visual Studio 2010. включає: atl100.dll, mfc100.dll, mfc90u.dll, mfcm100.dll, mfcm90u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Бібліотеки Microsoft Visual Studio 2010. включає: atl100.dll, mfc100.dll, mfc90u.dll, mfcm100.dll, mfcm90u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. [Section.0813] Licence = Ongekend -Description = Visual Studio 2010 Runtime. Bevat: atl100.dll, mfc100.dll, mfc90u.dll, mfcm100.dll, mfcm90u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. +Description = Microsoft Visual Studio 2010 Runtime. Bevat: atl100.dll, mfc100.dll, mfc90u.dll, mfcm100.dll, mfcm90u.dll, msdia100.dll, msvcm100.dll, msvcp100.dll, msvcr100.dll, vcomp100.dll. diff --git a/reactos/base/applications/rapps/rapps/vc6run.txt b/reactos/base/applications/rapps/rapps/vc6run.txt index 5a75d5223ab..1e580af953c 100644 --- a/reactos/base/applications/rapps/rapps/vc6run.txt +++ b/reactos/base/applications/rapps/rapps/vc6run.txt @@ -4,7 +4,7 @@ Name = Microsoft Visual C++ 6 Redistributable Package Version = 6.0 Licence = Unknown -Description = Visual Studio 6 Runtime. Contains: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Studio 6 Runtime. Contains: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. Size = 1.75 MB Category = 14 URLSite = http://support.microsoft.com/kb/259403/ @@ -13,44 +13,44 @@ CDPath = none [Section.0407] Licence = Unbekannt -Description = Visual Studio 6 Laufzeitsystem. Beinhaltet: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Studio 6 Laufzeitsystem. Beinhaltet: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. [Section.040a] Licence = Desconocida -Description = Librerias Visual Studio 2006. Incluye: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Librerias Microsoft Visual Studio 6. Incluye: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. [Section.040c] Licence = Inconnue -Description = Bibliothèque Visual Studio 6. Contient: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Bibliothèque Microsoft Visual Studio 6. Contient: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. Size = 1,75 Mo [Section.0410] Licence = Sconosciuta -Description = Visual Studio 6 Runtime. Contiene: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Studio 6 Runtime. Contiene: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. [Section.0413] Licence = Ongekend -Description = Visual Studio 6 Runtime. Bevat: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Studio 6 Runtime. Bevat: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. [Section.0415] Licence = Nieznana -Description = Biblioteki uruchomieniowe Visual Studio 6. Zawiera: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Biblioteki uruchomieniowe Microsoft Visual Studio 6. Zawiera: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. [Section.0418] Licence = Necunoscută -Description = Visual Studio 6 Runtime. Conține: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Studio 6 Runtime. Conține: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. Size = 1,75 Mo [Section.041f] -Name = Mikroyazılım Basarî C++ 6 Yeniden Dağıtılabilir Paket +Name = Microsoft Visual C++ 6 Yeniden Dağıtılabilir Paket Licence = Bilinmiyor -Description = Basarî Stüdyo 6 Yürütücüsü. Şunları içerir: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Studio 6 Yürütücüsü. Şunları içerir: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. Size = 1,75 MB [Section.0422] Licence = Невідома -Description = Бібліотеки Visual Studio 6. включає: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Бібліотеки Microsoft Visual Studio 6. включає: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. [Section.0813] Licence = Ongekend -Description = Visual Studio 6 Runtime. Bevat: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. +Description = Microsoft Visual Studio 6 Runtime. Bevat: advpack.dll, asycfilt.dll, atla.dll, atlu.dll, comcat.dll, mfc42.dll, mfc42u.dll, msvcirt.dll, msvcp60.dll, msvcrt.dll, oleaut32.dll, olepro32.dll. diff --git a/reactos/base/applications/rapps/rapps/winboard.txt b/reactos/base/applications/rapps/rapps/winboard.txt index 771db62df32..bdc18892789 100644 --- a/reactos/base/applications/rapps/rapps/winboard.txt +++ b/reactos/base/applications/rapps/rapps/winboard.txt @@ -35,7 +35,7 @@ Description = WinBoard este o tablă de șah grafică pentru Windows/ReactOS ce Size = 5,93 Mo [Section.041f] -Description = WinBoard; GNU Satranç, Crafty ve diğer satranç motorlarını örütbağ satranç sunucuları ve maille yazışmalı satranç için bir arayüz olarak sunan, Pencereler/ReactOS için bir çizgelik satranç tahtasıdır. +Description = WinBoard; GNU Chess, Crafty ve diğer satranç motorlarını Umûmî Ağ satranç sunucuları ve maille yazışmalı satranç için bir arayüz olarak sunan, Windows/ReactOS için bir çizgelik satranç tahtasıdır. Size = 5,93 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/wme9.txt b/reactos/base/applications/rapps/rapps/wme9.txt index e9f7e30e9bc..96a0becc5d8 100644 --- a/reactos/base/applications/rapps/rapps/wme9.txt +++ b/reactos/base/applications/rapps/rapps/wme9.txt @@ -38,9 +38,9 @@ Size = 9,46 Mo Description = Neznáma [Section.041f] -Name = Pencereler Ortam Düzgüleyicisi 9 +Name = Windows Ortam Kodlayıcısı 9 Licence = Bilinmiyor -Description = Pencereler Ortam Düzgüleyicisi 9 +Description = Windows Ortam Kodlayıcısı 9 Size = 9,46 MB [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/wordview.txt b/reactos/base/applications/rapps/rapps/wordview.txt index a75326f97c6..7d3884e8bba 100644 --- a/reactos/base/applications/rapps/rapps/wordview.txt +++ b/reactos/base/applications/rapps/rapps/wordview.txt @@ -1,7 +1,7 @@ ; UTF-8 [Section] -Name = Word Viewer +Name = Microsoft Word Viewer Version = 2010 Licence = Unknown Description = Microsoft Word Viewer @@ -47,7 +47,9 @@ Size = 24,56 Mo URLDownload = http://download.microsoft.com/download/1/2/3/123d3dc8-6f3f-473f-ac1d-3e38969605e8/wordview_ro-ro.exe [Section.041f] +Name = Microsoft Word Görüntüleyici Licence = Bilinmiyor +Description = Microsoft Word Görüntüleyici Size = 24.55 MB URLDownload = http://download.microsoft.com/download/7/6/e/76efefb4-9575-4903-ac2a-180c280ab6c7/wordview_tr-tr.exe From aa5418c1d0b8e725ce2c81a198cb2081a8a074af Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 12 Apr 2014 10:33:35 +0000 Subject: [PATCH 288/419] [BROWSEUI] * German translation by Robert Naumann. CORE-7555 #resolve #comment Committed in r62710. Thanks! svn path=/trunk/; revision=62710 --- reactos/dll/win32/browseui/lang/de-DE.rc | 80 ++++++++++++------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/reactos/dll/win32/browseui/lang/de-DE.rc b/reactos/dll/win32/browseui/lang/de-DE.rc index d5bb0fdcfc4..96ec652c264 100644 --- a/reactos/dll/win32/browseui/lang/de-DE.rc +++ b/reactos/dll/win32/browseui/lang/de-DE.rc @@ -30,8 +30,8 @@ BEGIN MENUITEM "", -1, MFT_SEPARATOR MENUITEM "S&ymbolleisten fixieren", IDM_TOOLBARS_LOCKTOOLBARS, MFT_STRING, MFS_ENABLED MENUITEM "&Anpassen...", IDM_TOOLBARS_CUSTOMIZE, MFT_STRING, MFS_ENABLED - MENUITEM "&Text Labels", IDM_TOOLBARS_TEXTLABELS, MFT_STRING, MFS_ENABLED - MENUITEM "&Go Button", IDM_TOOLBARS_GOBUTTON, MFT_STRING, MFS_ENABLED + MENUITEM "Symboltitel", IDM_TOOLBARS_TEXTLABELS, MFT_STRING, MFS_ENABLED + MENUITEM "Schaltfläche Wechseln zu", IDM_TOOLBARS_GOBUTTON, MFT_STRING, MFS_ENABLED END END @@ -57,9 +57,9 @@ BEGIN BEGIN MENUITEM "Su&chen\tCtrl+E", IDM_EXPLORERBAR_SEARCH MENUITEM "&Favoriten\tCtrl+I", IDM_EXPLORERBAR_FAVORITES - MENUITEM "&Media", IDM_EXPLORERBAR_MEDIA + MENUITEM "Medien", IDM_EXPLORERBAR_MEDIA MENUITEM "&Verlauf\tCtrl+H", IDM_EXPLORERBAR_HISTORY - MENUITEM "F&olders", IDM_EXPLORERBAR_FOLDERS + MENUITEM "&Ordner", IDM_EXPLORERBAR_FOLDERS MENUITEM "", IDM_EXPLORERBAR_SEPARATOR END MENUITEM "", FCIDM_MENU_VIEW_SEP_OPTIONS, MFT_SEPARATOR @@ -90,8 +90,8 @@ BEGIN END POPUP "&?", FCIDM_MENU_HELP BEGIN - MENUITEM "Ist diese Kopie von ReactOS &legal?", IDM_HELP_ISTHISCOPYLEGAL - MENUITEM "Ü&ber ReactOS", IDM_HELP_ABOUT + MENUITEM "Ist dies eine &legale ReactOS-Kopie?", IDM_HELP_ISTHISCOPYLEGAL + MENUITEM "Inf&o", IDM_HELP_ABOUT END END @@ -103,7 +103,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN LTEXT "Te&xt Optionen:", -1, 4, 2, 48, 15 COMBOBOX IDC_TEXTOPTIONS, 52, 0, 123, 57, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "Ico&n Optionen:", -1, 4, 20, 48, 15 + LTEXT "Symboloptio&nen:", -1, 4, 20, 48, 15 COMBOBOX IDC_ICONOPTIONS, 52, 18, 123, 57, CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP END @@ -129,97 +129,97 @@ END STRINGTABLE BEGIN - 800 "Contains commands for manipulating the selected items." + 800 "Enthält Befehle, um das ausgewählte Objekt zu bearbeiten." END STRINGTABLE BEGIN - 864 "Contains edit commands." + 864 "Enthält Befehle zum Bearbeiten." END STRINGTABLE BEGIN - 928 "Contains commands for manipulating the view." + 928 "Enthält Befehle, um die Ansicht zu bearbeiten." END STRINGTABLE BEGIN - 992 "Contains tools commands." + 992 "Enthält Werkzeugbefehle." END STRINGTABLE BEGIN - 1056 "Contains commands for displaying Help." + 1056 "Enthält Befehle, um die Hilfe anzuzeigen." END STRINGTABLE BEGIN - 9025 "Closes the window." - 9026 "Goes up one level." + 9025 "Schließt das Fenster." + 9026 "Wechselt zur übergeordneten Ebene." END STRINGTABLE BEGIN - 9121 "Connects to a network drive." - 9122 "Disconnects from a network drive." + 9121 "Verbindet ein Netzlaufwerk." + 9122 "Trennt ein Netzlaufwerk." END STRINGTABLE BEGIN - 9250 "Displays program information, version number, and copyright." - 9252 "Displays information for debugging." + 9250 "Zeigt Programminformationen, Versionsnummer, und Copyright-Informationen." + 9252 "Zeigt Informationen zum Debuggen." END STRINGTABLE BEGIN - 9281 "Goes to the previous page." - 9282 "Goes to the next page." - 9283 "Enables you to change settings." - 9285 "Goes to your home page." + 9281 "Wechselt zur vorherigen Seite." + 9282 "Wechselt zur nächsten Seite." + 9283 "Erlaubt es Ihnen Einstellungen zu ändern." + 9285 "Wechselt zur Startseite." END STRINGTABLE BEGIN - 9362 "Opens the Favorites folder." - 9363 "Adds the current page to your Favorites list." + 9362 "Öffnet den Ordner Favoriten." + 9363 "Fügt die aktuelle Seite der Favoritenliste hinzu." END STRINGTABLE BEGIN - 9505 "Shows or hides toolbars." - 9506 "Shows or hides the status bar." - 9508 "Displays the Standard Buttons toolbar." - 9509 "Displays the Address bar." - 9510 "Displays the Quick Links bar." - 9516 "Locks the sizes and positions of the toolbars." + 9505 "Zeigt oder versteckt Symbolleisten." + 9506 "Zeigt oder versteckt die Statusleiste." + 9508 "Zeigt oder versteckt die Standardschaltfächensymbole." + 9509 "Zeigt die Adressleiste." + 9510 "Zeigt die Quick Links Leiste." + 9516 "Fixiert Größe und Position der Symbolleisten." END STRINGTABLE BEGIN - 9533 "Customizes the toolbar." + 9533 "Passt die Symbolleiste an." END STRINGTABLE BEGIN - 9552 "Shows or hides an Explorer bar." - 9553 "Shows the Search bar." - 9554 "Shows the Favorites bar." - 9555 "Shows the History bar." - 9557 "Shows the Folders bar." - 9559 "Shows the Media Bar." + 9552 "Zeigt oder versteckt die Explorer-Leiste." + 9553 "Zeigt die Suchleiste." + 9554 "Zeigt die Favoritenleiste." + 9555 "Zeigt die Verlaufsleiste." + 9557 "Zeigt die Ordnerleiste." + 9559 "Zeigt die Medienleiste." END STRINGTABLE BEGIN IDS_SMALLICONS "Kleine Symbole" IDS_LARGEICONS "Große Symbole" - IDS_SHOWTEXTLABELS "Show text labels" + IDS_SHOWTEXTLABELS "Symboltitel anzeigen" END STRINGTABLE BEGIN - IDS_NOTEXTLABELS "No text labels" - IDS_SELECTIVETEXTONRIGHT "Selective text on right" + IDS_NOTEXTLABELS "Keine Symboltitel" + IDS_SELECTIVETEXTONRIGHT "Symboltitel rechts" END STRINGTABLE From 467aa6f5859d2b11cc3aba15a1fabcd22672523e Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 12 Apr 2014 10:37:08 +0000 Subject: [PATCH 289/419] [NTOS:CC] - Remove remnants of long-unused delayed remove/close feature (added in r3970, removed in r39663) svn path=/trunk/; revision=62711 --- reactos/ntoskrnl/cc/view.c | 42 +++----------------------- reactos/ntoskrnl/include/internal/cc.h | 4 +-- reactos/ntoskrnl/mm/section.c | 2 +- 3 files changed, 7 insertions(+), 41 deletions(-) diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index c3eeae0ee14..146659d67fb 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -44,7 +44,6 @@ static LIST_ENTRY DirtyVacbListHead; static LIST_ENTRY VacbListHead; static LIST_ENTRY VacbLruListHead; -static LIST_ENTRY ClosedListHead; ULONG DirtyPageCount = 0; KGUARDED_MUTEX ViewLock; @@ -1026,12 +1025,6 @@ CcRosDeleteFileCache ( Bcb->RefCount--; if (Bcb->RefCount == 0) { - if (Bcb->BcbRemoveListEntry.Flink != NULL) - { - RemoveEntryList(&Bcb->BcbRemoveListEntry); - Bcb->BcbRemoveListEntry.Flink = NULL; - } - FileObject->SectionObjectPointer->SharedCacheMap = NULL; /* @@ -1082,37 +1075,23 @@ CcRosReferenceCache ( KeAcquireGuardedMutex(&ViewLock); Bcb = (PBCB)FileObject->SectionObjectPointer->SharedCacheMap; ASSERT(Bcb); - if (Bcb->RefCount == 0) - { - ASSERT(Bcb->BcbRemoveListEntry.Flink != NULL); - RemoveEntryList(&Bcb->BcbRemoveListEntry); - Bcb->BcbRemoveListEntry.Flink = NULL; - - } - else - { - ASSERT(Bcb->BcbRemoveListEntry.Flink == NULL); - } + ASSERT(Bcb->RefCount != 0); Bcb->RefCount++; KeReleaseGuardedMutex(&ViewLock); } VOID NTAPI -CcRosSetRemoveOnClose ( +CcRosRemoveIfClosed ( PSECTION_OBJECT_POINTERS SectionObjectPointer) { PBCB Bcb; - DPRINT("CcRosSetRemoveOnClose()\n"); + DPRINT("CcRosRemoveIfClosed()\n"); KeAcquireGuardedMutex(&ViewLock); Bcb = (PBCB)SectionObjectPointer->SharedCacheMap; - if (Bcb) + if (Bcb && Bcb->RefCount == 0) { - Bcb->RemoveOnClose = TRUE; - if (Bcb->RefCount == 0) - { - CcRosDeleteFileCache(Bcb->FileObject, Bcb); - } + CcRosDeleteFileCache(Bcb->FileObject, Bcb); } KeReleaseGuardedMutex(&ViewLock); } @@ -1196,11 +1175,6 @@ CcTryToInitializeFileCache ( FileObject->PrivateCacheMap = Bcb; Bcb->RefCount++; } - if (Bcb->BcbRemoveListEntry.Flink != NULL) - { - RemoveEntryList(&Bcb->BcbRemoveListEntry); - Bcb->BcbRemoveListEntry.Flink = NULL; - } Status = STATUS_SUCCESS; } KeReleaseGuardedMutex(&ViewLock); @@ -1258,11 +1232,6 @@ CcRosInitializeFileCache ( FileObject->PrivateCacheMap = Bcb; Bcb->RefCount++; } - if (Bcb->BcbRemoveListEntry.Flink != NULL) - { - RemoveEntryList(&Bcb->BcbRemoveListEntry); - Bcb->BcbRemoveListEntry.Flink = NULL; - } KeReleaseGuardedMutex(&ViewLock); return STATUS_SUCCESS; @@ -1297,7 +1266,6 @@ CcInitView ( InitializeListHead(&VacbListHead); InitializeListHead(&DirtyVacbListHead); InitializeListHead(&VacbLruListHead); - InitializeListHead(&ClosedListHead); KeInitializeGuardedMutex(&ViewLock); ExInitializeNPagedLookasideList (&iBcbLookasideList, NULL, diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index 121240d5db9..291701b2590 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -104,8 +104,6 @@ typedef struct _PFSN_PREFETCHER_GLOBALS typedef struct _BCB { LIST_ENTRY BcbVacbListHead; - LIST_ENTRY BcbRemoveListEntry; - BOOLEAN RemoveOnClose; ULONG TimeStamp; PFILE_OBJECT FileObject; LARGE_INTEGER AllocationSize; @@ -264,7 +262,7 @@ CcRosReferenceCache(PFILE_OBJECT FileObject); VOID NTAPI -CcRosSetRemoveOnClose(PSECTION_OBJECT_POINTERS SectionObjectPointer); +CcRosRemoveIfClosed(PSECTION_OBJECT_POINTERS SectionObjectPointer); NTSTATUS NTAPI diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 2e7c2e45bd7..acde62a6796 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -4720,7 +4720,7 @@ MmFlushImageSection (IN PSECTION_OBJECT_POINTERS SectionObjectPointer, return FALSE; } #ifndef NEWCC - CcRosSetRemoveOnClose(SectionObjectPointer); + CcRosRemoveIfClosed(SectionObjectPointer); #endif return TRUE; case MmFlushForWrite: From 4168725e49319e8b55452a95648c32227cdd6261 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 12 Apr 2014 10:49:06 +0000 Subject: [PATCH 290/419] [WINMM][WLDAP32] * Add Albanian translation. By Ardit Dani. CORE-7930 #resolve #comment Committed in r62712. Thanks! svn path=/trunk/; revision=62712 --- reactos/dll/win32/winmm/lang/winmm_Sq.rc | 126 +++++++++++++++++++ reactos/dll/win32/winmm/winmm_res.rc | 3 + reactos/dll/win32/wldap32/lang/wldap32_Sq.rc | 122 ++++++++++++++++++ reactos/dll/win32/wldap32/wldap32.rc | 3 + 4 files changed, 254 insertions(+) create mode 100644 reactos/dll/win32/winmm/lang/winmm_Sq.rc create mode 100644 reactos/dll/win32/wldap32/lang/wldap32_Sq.rc diff --git a/reactos/dll/win32/winmm/lang/winmm_Sq.rc b/reactos/dll/win32/winmm/lang/winmm_Sq.rc new file mode 100644 index 00000000000..5710d668cef --- /dev/null +++ b/reactos/dll/win32/winmm/lang/winmm_Sq.rc @@ -0,0 +1,126 @@ +/* + * Copyright 1999 Eric Pouech + * + * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +STRINGTABLE LANGUAGE LANG_ALBANIAN, SUBLANG_NEUTRAL +BEGIN + +/* MMSYS errors */ +MMSYSERR_NOERROR, "Komanda e përcaktuar është kryer." +MMSYSERR_ERROR, "Gabim i jashtëm i papërcaktuar." +MMSYSERR_BADDEVICEID, "Një ID pajisje është përdorur që është jashtë diapazonit për sistemin tuaj." +MMSYSERR_NOTENABLED, "Drejtuesi nuk është i aktivizuar." +MMSYSERR_ALLOCATED, "Pajisja specifikuar është tashmë në përdorim. Prisni deri sa ajo është e lirë, dhe pastaj provoni përsëri." +MMSYSERR_INVALHANDLE, "Trajtimi i pajisjes së specifikuar është e pavlefshme." +MMSYSERR_NODRIVER, "Nuk ka drejtues të instaluar në sistemin tuaj !\n" +MMSYSERR_NOMEM, "Memoria e pamjaftueshme në dispozicion për këtë detyrë. Nxjerr një ose më shumë aplikime për të rritur memorien në dispozicion, dhe pastaj provoni përsëri." +MMSYSERR_NOTSUPPORTED, "Ky funksion nuk është i mbështetur. Përdorni funksionin për Aftësitë për të përcaktuar se cilat funksione dhe mesazhe të mbështet drejtuesin." +MMSYSERR_BADERRNUM, "Një numër gabime është përcaktuar që nuk është përcaktuar në sistemin." +MMSYSERR_INVALFLAG, "Një flamur i pavlefshëm u miratua në një funksion të sistemit." +MMSYSERR_INVALPARAM, "Një parametër i pavlefshëm u miratua në një funksion të sistemit." + +/* WAVE errors */ +WAVERR_BADFORMAT, "Formati i specifikuar nuk është i mbështetur ose nuk mund të përkthehet. Përdorni funksionin për Aftësitë për të përcaktuar formate të mbështetur" +WAVERR_STILLPLAYING, "Nuk mund të kryesh këtë operacion, ndërsa të dhënat e media's është ende duke luajtur. Rivë pajisjen, ose prisni deri të dhënave është përfunduar duke luajtur." +WAVERR_UNPREPARED, "Vala kokës nuk është përgatitur. Përdorni funksionin Përgatitja për të përgatitur kokën, dhe pastaj provoni përsëri." +WAVERR_SYNC, "Nuk mund të hapni pajisjen pa përdorur WAVE_ALLOWSYNC flamuri. Përdorimi flamurin, dhe pastaj provoni përsëri." + +/* MIDI errors */ +MIDIERR_UNPREPARED, "Koka MIDI nuk ishte i përgatitur. Përdorni funksionin Përgatitja për të përgatitur koka, dhe pastaj provoni përsëri." +MIDIERR_STILLPLAYING, "Nuk mund të ktheni këtë operacion, ndërsa të dhënat e media's është ende duke luajtur. Rivë pajisjen, ose prisni deri të dhënave është përfunduar duke luajtur." +MIDIERR_NOMAP, "Një hartë MIDI nuk u gjet. Nuk mund të jetë një problem me të shoferit, ose fotografi MIDIMAP.CFG mund të jenë të korruptuar ose të humbur." +MIDIERR_NOTREADY, "Porti është duke transmetuar të dhënat për pajisjen. Prisni derisa të dhënat janë transmetuar, dhe pastaj provoni përsëri." +MIDIERR_NODEVICE, "Ndërtuesi aktual MIDI Mapper i referohet një pajisje MIDI që nuk është i instaluar në sistemin. Përdorimi MIDI Mapper për të redaktuar ndërtuesin." +MIDIERR_INVALIDSETUP, "Skema aktuale MIDI është i dëmtuar. Kopjoni origjinal MIDIMAP.CFG dokument e skedarëve të SISTEMIT ReactOS, dhe pastaj provoni përsëri." + +/* MCI errors */ +MCIERR_INVALID_DEVICE_ID, "ID MCI pajisje pavlefshme. Përdorimi ID kthyer kur hapni pajisjen MCI." +MCIERR_UNRECOGNIZED_KEYWORD, "Drejtuesi nuk mund të njohin parametër specifikuar komanduese." +MCIERR_UNRECOGNIZED_COMMAND, "Drejtuesi nuk mund të njohin komandën e specifikuar." +MCIERR_HARDWARE, "Ka një problem me pajisjen tuaj të media's. Sigurohuni që ajo është duke punuar si duhet ose kontaktoni prodhuesin e pajisjes." +MCIERR_INVALID_DEVICE_NAME, "Pajisja specifikuar nuk është e hapur ose nuk njihet nga MCI." +MCIERR_OUT_OF_MEMORY, "Memoria e pamjaftueshme në dispozicion për këtë detyrë. \nNxjirr një ose më shumë aplikime për të rritur memorien në dispozicion, dhe pastaj provoni përsëri." +MCIERR_DEVICE_OPEN, "Emri Pajisjes tashmë është duke u përdorur si një pseudonim me këtë kërkesë. Përdorni një pseudonim të veçantë." +MCIERR_CANNOT_LOAD_DRIVER, "Nuk është një problem i pa-dallueshëm në ngarkimin e aparatit drejtues të specifikuar." +MCIERR_MISSING_COMMAND_STRING, "Komandë jo e specifikuar." +MCIERR_PARAM_OVERFLOW, "Varg nxjerrje ishte shumë e madhe për të përshtatur një zbutës në kthimi. Rrit madhësinë e zbutësit." +MCIERR_MISSING_STRING_ARGUMENT, "Komanda e përcaktuar kërkon një parametër karakter-string. Ju lutemi të sigurojë një." +MCIERR_BAD_INTEGER, "Numër i plotë specifikuar është i pavlefshëm për këtë komandë." +MCIERR_PARSER_INTERNAL, "Aparati drejtues ka kthyer një lloj të vlefshëm e kthimit. Kontrolloni me prodhuesit të pajisjes për marrjen e një drejtuesi të ri." +MCIERR_DRIVER_INTERNAL, "Ka një problem me drejtuesin e pajisjes. Kontrolloni me prodhuesit të pajisjes për marrjen e një drejtues të ri." +MCIERR_MISSING_PARAMETER, "Komanda e përcaktuar kërkon një parametër. Ju lutemi ofroni një." +MCIERR_UNSUPPORTED_FUNCTION, "Pajisja MCI që ju jeni duke përdorur nuk ka mbështetjen e komandës së specifikuar." +MCIERR_FILE_NOT_FOUND, "Nuk mund të gjeni skedarin e specifikuar. Sigurohuni që rruga dhe emri dokumentit janë të sakta." +MCIERR_DEVICE_NOT_READY, "Drejtuesi i pjesës nuk është i gatshëm." +MCIERR_INTERNAL, "Një problem i ndodhur në inicializimin e MCI. Provoni të rifilloni ReactOS." +MCIERR_DRIVER, "Ka një problem me drejtuesin e pajisjes. Drejtuesi ka mbyllur. Gabim, nuk mund të hyni." +MCIERR_CANNOT_USE_ALL, "Nuk mund të përdorni 'të gjithë' si emer të pajisjes me komandën e specifikuar." +MCIERR_MULTIPLE, "Gabimet ndodhen në më shumë se një pajisje. Specifikoni çdo komandën dhe pajisje veçmas për të përcaktuar se cilat pajisje shkaktuan gabim" +MCIERR_EXTENSION_NOT_FOUND, "Nuk mund të përcaktuar llojin e pajisjes e dhënë në prapashtesën e emrit të dokumentit." +MCIERR_OUTOFRANGE, "Parametri i specifikuar është jashtë vargut për komandën e specifikuar." +MCIERR_FLAGS_NOT_COMPATIBLE, "Parametrat e specifikuara nuk mund të përdoret së bashku." +MCIERR_FILE_NOT_SAVED, "Nuk mund të ruajtur dokumentin specifikuar. Sigurohuni që ju keni hapësirë ​​të mjaftueshme në disk, ose janë ende të lidhura me rrjetin." +MCIERR_DEVICE_TYPE_REQUIRED, "Nuk mund të gjeni pajisjen specifikuar. Sigurohuni që ajo është instaluar ose që emri pajisja është shkruar drejt." +MCIERR_DEVICE_LOCKED, "Pajisja specifikuar tani është duke u mbyllur. Prisni disa sekonda, dhe pastaj provoni përsëri." +MCIERR_DUPLICATE_ALIAS, "Pseudonimi i ​​specifikuar tashmë është duke u përdorur në këtë aplikim. Përdorni një pseudonim të veçantë." +MCIERR_BAD_CONSTANT, "Parametri i specifikuar është i pavlefshëm për këtë komandë." +MCIERR_MUST_USE_SHAREABLE, "Drejtuesi pajisjes është tashmë në përdorim. Për të ndarë atë, përdorin 'shpërndarje' parametër me secilin 'hap' komandë." +MCIERR_MISSING_DEVICE_NAME, "Komanda e përcaktuar kërkon një pseudonim, dokument, drejtues, ose emri pajisje. Ju lutemi të ofrojë një." +MCIERR_BAD_TIME_FORMAT, "Vlera e caktuar për kohë të formatit është e pavlefshme. Referojuni dokumentacionit MCI për formate të vlefshme." +MCIERR_NO_CLOSING_QUOTE, "Një shenjë-mbyllje me dy citate mungon nga vlera e parametrit. Ju lutemi të ofrojë një." +MCIERR_DUPLICATE_FLAGS, "Një parametër ose vlerë është specifikuar dy herë. Vetëm specifikoni një herë." +MCIERR_INVALID_FILE, "Skedari i caktuar nuk mund të luhet në pajisje të specifikuar MCI. Skedari mund të jetë i korruptuar, ose jo në formatin e duhur." +MCIERR_NULL_PARAMETER_BLOCK, "Një bllok null parametër u miratua me MCI." +MCIERR_UNNAMED_RESOURCE, "Nuk mund të ruash një skedar pa emër. Furnizo me një emër kartelën." +MCIERR_NEW_REQUIRES_ALIAS, "Ju duhet të specifikoni një pseudonim kur duke përdorur parametrin 'ri'." +MCIERR_NOTIFY_ON_AUTO_OPEN, "Nuk mund të përdorë flamurin 'njofto' me pajisje auto-hapur." +MCIERR_NO_ELEMENT_ALLOWED, "Nuk mund të përdorni një emër kartele me pajisjen e specifikuar." +MCIERR_NONAPPLICABLE_FUNCTION, "Nuk mund të kryejnë komandat sipas radhës së detajuar. Korrigjoni rendin e komandës, dhe pastaj provoni përsëri." +MCIERR_ILLEGAL_FOR_AUTO_OPEN, "Nuk mund të kryejnë një komandë të specifikuar në një pajisje auto-hapur. Prisni derisa pajisja është e mbyllur, dhe pastaj provoni përsëri." +MCIERR_FILENAME_REQUIRED, "Emri i skedarit është i pavlefshëm. Sigurohuni që emri i skedarit nuk është më e gjatë se 8 karaktere, e ndjekur nga një periudhë dhe një zgjatje." +MCIERR_EXTRA_CHARACTERS, "Nuk mund të specifikojë karaktere shtesë pas një varg të mbyllur në thonjëza." +MCIERR_DEVICE_NOT_INSTALLED, "Pajisja specifikuar nuk është i instaluar në sistem. Përdorni opsionin e drejtuesin në Panelin e Kontrollit për të instaluar pajisjen." +MCIERR_GET_CD, "Nuk mund të hyni në dokumentin e caktuar apo pajisjet MCI. Provoni ndryshimin skedarit ose rifilloni kompjuterin tuaj." +MCIERR_SET_CD, "Nuk mund të hyni në dokumentin e caktuar apo pajisje MCI për shkak se kërkesa nuk mund të ndryshojë skedarë." +MCIERR_SET_DRIVE, "Nuk mund të keni hyrje në dokumentet ose pajisjet e specifikuara të MCI për shkak se kërkesa nuk mund të ndryshojë drejtuesin." +MCIERR_DEVICE_LENGTH, "Specifikoni një pajisje ose emrin drejtues që është më pak se 79 karaktere." +MCIERR_DEVICE_ORD_LENGTH, "Specifikoni një pajisje ose emrin e drejtuesit që është më pak se 69 karaktere." +MCIERR_NO_INTEGER, "Komanda e përcaktuar kërkon një parametër numër i plotë. Ju lutemi të sigurojë një." +MCIERR_WAVE_OUTPUTSINUSE, "Të gjitha pajisjet valë që mund të luajë dokumentet në formatin e tanishëm janë në përdorim. Prisni derisa një pajisje valë është i lirë, dhe pastaj provoni përsëri." +MCIERR_WAVE_SETOUTPUTINUSE, "Nuk mund të vendos pajisjen aktuale valë për të luajtur përsëri për shkak se ajo është në përdorim. Prisni derisa pajisja është i lirë, dhe pastaj provoni përsëri." +MCIERR_WAVE_INPUTSINUSE, "Të gjitha pajisjet valë që mund të regjistroni dokumentet në formatin e tanishëm janë në përdorim. Prisni derisa një pajisje valë është i lirë, dhe pastaj provoni përsëri." +MCIERR_WAVE_SETINPUTINUSE, "Nuk mund të vendos pajisjen aktuale valë për regjistrim për shkak se ajo është në përdorim. Prisni derisa pajisja është i lirë, dhe pastaj provoni përsëri." +MCIERR_WAVE_OUTPUTUNSPECIFIED, "Çdo pajisja pajtueshme luaj-mbrapa valë-formë mund të përdoret." +MCIERR_WAVE_INPUTUNSPECIFIED, "Çdo pajisje pajtueshme regjistrimi valë-formë mund të përdoren." +MCIERR_WAVE_OUTPUTSUNSUITABLE, "Nuk ka pajisje valë që mund të luajë dokumentet në formatin aktual të instaluar. Përdorni opsionin e drejtuesit të instaluar të pajisjes valë." +MCIERR_WAVE_SETOUTPUTUNSUITABLE,"Pajisja që ju jeni duke u përpjekur për të luajtur për të nuk mund të njohin formatin aktual skedarëve." +MCIERR_WAVE_INPUTSUNSUITABLE, "Nuk ka pajisje valë që mund të regjistrojë dokumente në formatin aktual të instaluar. Përdorni opsionin drejtues për të instaluar pajisjen valë." +MCIERR_WAVE_SETINPUTUNSUITABLE, "Pajisja që ju jeni duke u përpjekur për të regjistruar nga nuk mund të njohin formatin aktual të skedarëve." +MCIERR_NO_WINDOW, "Nuk ka asnjë dritare ekrani." +MCIERR_CREATEWINDOW, "Nuk mund të krijohet ose të përdoret dritarja." +MCIERR_FILE_READ, "Nuk mund të lexoni dosjen e specifikuar. Sigurohuni që skedari është ende e pranishme, ose kontrolloni diskun ose rrjetit tuaj lidhje." +MCIERR_FILE_WRITE, "Nuk mund të shkruaj në kartelën specifikuar. Sigurohuni që ju keni hapësirë ​​të mjaftueshme në disk, ose janë ende të lidhura me rrjetin." +MCIERR_SEQ_DIV_INCOMPATIBLE, "Koha e Formateve e ""treguesin e këngës"" dhe SMPTE janë reciprokisht ekskluzive. Ju nuk mund të përdorni ato së bashku." +MCIERR_SEQ_NOMIDIPRESENT, "Sistemi nuk ka instaluar pajisje MIDI. Përdorni opsionin drejtues nga Paneli Kontrollit për të instaluar një drejtues MIDI." +MCIERR_SEQ_PORT_INUSE, "Port specifikuar MIDI është tashmë në përdorim. Prisni deri sa ajo është e lirë; provoni përsëri." +MCIERR_SEQ_PORT_MAPNODEVICE, "Ndërtuesi Aktual MIDI Mapper i referohet një pajisje MIDI që nuk është i instaluar në sistemin. Përdorni opsionin MIDI Mapper nga Paneli Kontrollit për të redaktuar ndërtuesin." +MCIERR_SEQ_PORT_MISCERROR, "Një gabim ka ndodhur me portin e specifikuar." +MCIERR_SEQ_PORT_NONEXISTENT, "Pajisja specifikuar MIDI nuk është i instaluar në sistemin. Përdorni opsionin Drestues nga Paneli Kontrollit për të instaluar një pajisje MIDI." +MCIERR_SEQ_PORTUNSPECIFIED, "Sistemi nuk ka një port aktuale MIDI të specifikuar." +MCIERR_SEQ_TIMER, "Të gjitha kohët multimediale janë duke u përdorur nga aplikacionet e tjera. Dil nga një nga këto aplikime; pastaj, provoni përsëri." + +END diff --git a/reactos/dll/win32/winmm/winmm_res.rc b/reactos/dll/win32/winmm/winmm_res.rc index 23da1b66d1a..fc65e872d70 100644 --- a/reactos/dll/win32/winmm/winmm_res.rc +++ b/reactos/dll/win32/winmm/winmm_res.rc @@ -75,6 +75,9 @@ #ifdef LANGUAGE_SK_SK #include "lang/winmm_Sk.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/winmm_Sq.rc" +#endif //#include "winmm_Hu.rc" #ifdef LANGUAGE_UK_UA #include "lang/winmm_Uk.rc" diff --git a/reactos/dll/win32/wldap32/lang/wldap32_Sq.rc b/reactos/dll/win32/wldap32/lang/wldap32_Sq.rc new file mode 100644 index 00000000000..a5368dd613d --- /dev/null +++ b/reactos/dll/win32/wldap32/lang/wldap32_Sq.rc @@ -0,0 +1,122 @@ +/* + * Albanian resources for WLDAP32 + * + * + * 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 + */ + +LANGUAGE LANG_ALBANIAN, SUBLANG_NEUTRAL + +STRINGTABLE +{ + 0 "Sukses" + 1 "Gabim operacioni" + 2 "Gabim protokolli" + 3 "Limiti Kohor Tejkaluar" + 4 "Limiti Masës Tejkaluar" + 5 "Krahasim i Rremë" + 6 "Krahasim i Vërtetë" + 7 "Metoda Vërtetuese jo e Mbështetur" + 8 "Vërtetim i Fortë Nevojitet" + 9 "Referim (v2)" + 10 "Referim" + 11 "Limiti Administrimit Tejkaluar" + 12 "Zgjerim i Padiskutueshëm Kritik" + 13 "Konfidencialiteti i kërkuar" + 14 "" + 15 "" + 16 "Nuk ka atribut të tillë" + 17 "Lloji i papërcaktuar" + 18 "Përshtatshmërisë pa kriter" + 19 "Shkelje Detyrimi" + 20 "Atribut Ose Vlera Ekziston" + 21 "Sintaks Pavlefshëm" + 22 "" + 23 "" + 24 "" + 25 "" + 26 "" + 27 "" + 28 "" + 29 "" + 30 "" + 31 "" + 32 "Nuk ka Objekt tillë" + 33 "​​Problem Pseudonimi" + 34 "Sintaksa DN PavlefshëmSyntax" + 35 "A është Fletë" + 36 "Problem Diference Pseudonimi" + 37 "" + 38 "" + 39 "" + 40 "" + 41 "" + 42 "" + 43 "" + 44 "" + 45 "" + 46 "" + 47 "" + 48 "Vërtetim pa kriter" + 49 "Kredenciale të pavlefshme" + 50 "Drejtat e pamjaftueshme" + 51 "Zënë" + 52 "Pa-disponueshëm" + 53 "Duke mos dashur që të kryejnë" + 54 "Loop zbuluar" + 55 "" + 56 "" + 57 "" + 58 "" + 59 "" + 60 "Rendit Kontrollit Zhdukur" + 61 "Gabim në vargun e indeksit" + 62 "" + 63 "" + 64 "Emërtimi Shkeljeve" + 65 "Klasa Objektiv Shkelje" + 66 "Nuk lejohet në jo-fletë" + 67 "Nuk lejohet në RDN" + 68 "Tashmë Ekziston" + 69 "Nuk ka Objekt Klasa Mods" + 70 "Rezultatet Të mëdha" + 71 "Ndikon Disa DSAs" + 72 "" + 73 "" + 74 "" + 75 "" + 76 "" + 77 "" + 78 "" + 79 "" + 80 "Tjetër" + 81 "Serveri Ra" + 82 "Gabim Vendorë" + 83 "Gabim Kodim" + 84 "Gabim Ç'kodim" + 85 "Mbaroj" + 86 "Verf Panjohur" + 87 "Gabim Filtri" + 88 "Ndaluar nga Përdoruesi" + 89 "Gabim Parametri" + 90 "Ska Memie" + 91 "Nuk mund të lidheni me serverin LDAP" + 92 "Operacioni nuk përkrahet nga ky version i protokollit LDAP" + 93 "Kontrolli i specifikuar nuk u gjet në mesazh" + 94 "Asnjë rezultat i pranishëm në mesazh" + 95 "Më shumë rezultate kthyen" + 96 "Pusho ndërsa trajton referimet" + 97 "Kufiri i Referimit hop tejkaluar" +} diff --git a/reactos/dll/win32/wldap32/wldap32.rc b/reactos/dll/win32/wldap32/wldap32.rc index fa5f04a4649..518777ffef3 100644 --- a/reactos/dll/win32/wldap32/wldap32.rc +++ b/reactos/dll/win32/wldap32/wldap32.rc @@ -76,6 +76,9 @@ #ifdef LANGUAGE_RU_RU #include "lang/wldap32_Ru.rc" #endif +#ifdef LANGUAGE_SQ_AL + #include "lang/wldap32_Sq.rc" +#endif #ifdef LANGUAGE_UK_UA #include "lang/wldap32_Uk.rc" #endif From 6d7fbc887fe838b7832fc3b1e62d1510dfd7114e Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 12 Apr 2014 10:59:48 +0000 Subject: [PATCH 291/419] [NTOS:CC] - Rename the BCB structure to ROS_SHARED_CACHE_MAP. This should eventually become NDK's SHARED_CACHE_MAP. CORE-8065 svn path=/trunk/; revision=62713 --- reactos/ntoskrnl/cc/copy.c | 97 +++---- reactos/ntoskrnl/cc/fs.c | 48 ++-- reactos/ntoskrnl/cc/pin.c | 20 +- reactos/ntoskrnl/cc/view.c | 346 +++++++++++++------------ reactos/ntoskrnl/include/internal/cc.h | 32 +-- reactos/ntoskrnl/mm/section.c | 62 ++--- 6 files changed, 304 insertions(+), 301 deletions(-) diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index 87a7fc1b5d0..ed1bb8a374b 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -57,7 +57,7 @@ CcInitCacheZeroPage ( NTSTATUS NTAPI ReadVacbChain ( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG ReadOffset, ULONG Length, PVOID Buffer) @@ -74,7 +74,7 @@ ReadVacbChain ( Mdl = _alloca(MmSizeOfMdl(NULL, MAX_RW_LENGTH)); - Status = CcRosGetVacbChain(Bcb, ReadOffset, Length, &head); + Status = CcRosGetVacbChain(SharedCacheMap, ReadOffset, Length, &head); if (!NT_SUCCESS(Status)) { return Status; @@ -95,7 +95,7 @@ ReadVacbChain ( Length = Length - TempLength; previous = current; current = current->NextInChain; - CcRosReleaseVacb(Bcb, previous, TRUE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, previous, TRUE, FALSE, FALSE); } /* * Otherwise read in as much as we can. @@ -143,7 +143,7 @@ ReadVacbChain ( */ VacbOffset.QuadPart = current->FileOffset; KeInitializeEvent(&Event, NotificationEvent, FALSE); - Status = IoPageRead(Bcb->FileObject, + Status = IoPageRead(SharedCacheMap->FileObject, Mdl, &VacbOffset, &Event, @@ -163,7 +163,7 @@ ReadVacbChain ( { previous = current; current = current->NextInChain; - CcRosReleaseVacb(Bcb, previous, FALSE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, previous, FALSE, FALSE, FALSE); } return Status; } @@ -178,7 +178,7 @@ ReadVacbChain ( Buffer = (PVOID)((ULONG_PTR)Buffer + TempLength); Length = Length - TempLength; - CcRosReleaseVacb(Bcb, previous, TRUE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, previous, TRUE, FALSE, FALSE); current_size += VACB_MAPPING_GRANULARITY; } } @@ -199,7 +199,7 @@ CcReadVirtualAddress ( KEVENT Event; VacbOffset.QuadPart = Vacb->FileOffset; - Size = (ULONG)(Vacb->Bcb->AllocationSize.QuadPart - Vacb->FileOffset); + Size = (ULONG)(Vacb->SharedCacheMap->AllocationSize.QuadPart - Vacb->FileOffset); if (Size > VACB_MAPPING_GRANULARITY) { Size = VACB_MAPPING_GRANULARITY; @@ -214,7 +214,7 @@ CcReadVirtualAddress ( MmBuildMdlForNonPagedPool(Mdl); Mdl->MdlFlags |= MDL_IO_PAGE_READ; KeInitializeEvent(&Event, NotificationEvent, FALSE); - Status = IoPageRead(Vacb->Bcb->FileObject, Mdl, &VacbOffset, &Event, &IoStatus); + Status = IoPageRead(Vacb->SharedCacheMap->FileObject, Mdl, &VacbOffset, &Event, &IoStatus); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -252,7 +252,7 @@ CcWriteVirtualAddress ( Vacb->Dirty = FALSE; VacbOffset.QuadPart = Vacb->FileOffset; - Size = (ULONG)(Vacb->Bcb->AllocationSize.QuadPart - Vacb->FileOffset); + Size = (ULONG)(Vacb->SharedCacheMap->AllocationSize.QuadPart - Vacb->FileOffset); if (Size > VACB_MAPPING_GRANULARITY) { Size = VACB_MAPPING_GRANULARITY; @@ -277,7 +277,7 @@ CcWriteVirtualAddress ( MmBuildMdlForNonPagedPool(Mdl); Mdl->MdlFlags |= MDL_IO_PAGE_READ; KeInitializeEvent(&Event, NotificationEvent, FALSE); - Status = IoSynchronousPageWrite(Vacb->Bcb->FileObject, Mdl, &VacbOffset, &Event, &IoStatus); + Status = IoSynchronousPageWrite(Vacb->SharedCacheMap->FileObject, Mdl, &VacbOffset, &Event, &IoStatus); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -331,7 +331,7 @@ CcCopyRead ( PROS_VACB Vacb; BOOLEAN Valid; ULONG ReadLength = 0; - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; KIRQL oldirql; PLIST_ENTRY current_entry; PROS_VACB current; @@ -341,12 +341,12 @@ CcCopyRead ( FileObject, FileOffset->QuadPart, Length, Wait, Buffer, IoStatus); - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; ReadOffset = (ULONG)FileOffset->QuadPart; DPRINT("AllocationSize %I64d, FileSize %I64d\n", - Bcb->AllocationSize.QuadPart, - Bcb->FileSize.QuadPart); + SharedCacheMap->AllocationSize.QuadPart, + SharedCacheMap->FileSize.QuadPart); /* * Check for the nowait case that all the cache VACBs that would @@ -354,19 +354,20 @@ CcCopyRead ( */ if (!Wait) { - KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql); /* FIXME: this loop doesn't take into account areas that don't have * a VACB in the list yet */ - current_entry = Bcb->BcbVacbListHead.Flink; - while (current_entry != &Bcb->BcbVacbListHead) + current_entry = SharedCacheMap->CacheMapVacbListHead.Flink; + while (current_entry != &SharedCacheMap->CacheMapVacbListHead) { - current = CONTAINING_RECORD(current_entry, ROS_VACB, - BcbVacbListEntry); + current = CONTAINING_RECORD(current_entry, + ROS_VACB, + CacheMapVacbListEntry); if (!current->Valid && DoRangesIntersect(current->FileOffset, VACB_MAPPING_GRANULARITY, ReadOffset, Length)) { - KeReleaseSpinLock(&Bcb->BcbLock, oldirql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); IoStatus->Status = STATUS_UNSUCCESSFUL; IoStatus->Information = 0; return FALSE; @@ -375,14 +376,14 @@ CcCopyRead ( break; current_entry = current_entry->Flink; } - KeReleaseSpinLock(&Bcb->BcbLock, oldirql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); } TempLength = ReadOffset % VACB_MAPPING_GRANULARITY; if (TempLength != 0) { TempLength = min(Length, VACB_MAPPING_GRANULARITY - TempLength); - Status = CcRosRequestVacb(Bcb, + Status = CcRosRequestVacb(SharedCacheMap, ROUND_DOWN(ReadOffset, VACB_MAPPING_GRANULARITY), &BaseAddress, &Valid, &Vacb); @@ -400,14 +401,14 @@ CcCopyRead ( { IoStatus->Information = 0; IoStatus->Status = Status; - CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE); return FALSE; } } RtlCopyMemory(Buffer, (char*)BaseAddress + ReadOffset % VACB_MAPPING_GRANULARITY, TempLength); - CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE); ReadLength += TempLength; Length -= TempLength; ReadOffset += TempLength; @@ -417,7 +418,7 @@ CcCopyRead ( while (Length > 0) { TempLength = min(VACB_MAPPING_GRANULARITY, Length); - Status = ReadVacbChain(Bcb, ReadOffset, TempLength, Buffer); + Status = ReadVacbChain(SharedCacheMap, ReadOffset, TempLength, Buffer); if (!NT_SUCCESS(Status)) { IoStatus->Information = 0; @@ -454,7 +455,7 @@ CcCopyWrite ( NTSTATUS Status; ULONG WriteOffset; KIRQL oldirql; - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; PLIST_ENTRY current_entry; PROS_VACB Vacb; ULONG TempLength; @@ -465,26 +466,26 @@ CcCopyWrite ( "Length %lu, Wait %u, Buffer 0x%p)\n", FileObject, FileOffset->QuadPart, Length, Wait, Buffer); - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; WriteOffset = (ULONG)FileOffset->QuadPart; if (!Wait) { /* testing, if the requested datas are available */ - KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql); /* FIXME: this loop doesn't take into account areas that don't have * a VACB in the list yet */ - current_entry = Bcb->BcbVacbListHead.Flink; - while (current_entry != &Bcb->BcbVacbListHead) + current_entry = SharedCacheMap->CacheMapVacbListHead.Flink; + while (current_entry != &SharedCacheMap->CacheMapVacbListHead) { Vacb = CONTAINING_RECORD(current_entry, ROS_VACB, - BcbVacbListEntry); + CacheMapVacbListEntry); if (!Vacb->Valid && DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY, WriteOffset, Length)) { - KeReleaseSpinLock(&Bcb->BcbLock, oldirql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); /* datas not available */ return FALSE; } @@ -492,7 +493,7 @@ CcCopyWrite ( break; current_entry = current_entry->Flink; } - KeReleaseSpinLock(&Bcb->BcbLock, oldirql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); } TempLength = WriteOffset % VACB_MAPPING_GRANULARITY; @@ -501,7 +502,7 @@ CcCopyWrite ( ULONG ROffset; ROffset = ROUND_DOWN(WriteOffset, VACB_MAPPING_GRANULARITY); TempLength = min(Length, VACB_MAPPING_GRANULARITY - TempLength); - Status = CcRosRequestVacb(Bcb, ROffset, + Status = CcRosRequestVacb(SharedCacheMap, ROffset, &BaseAddress, &Valid, &Vacb); if (!NT_SUCCESS(Status)) { @@ -517,7 +518,7 @@ CcCopyWrite ( RtlCopyMemory((char*)BaseAddress + WriteOffset % VACB_MAPPING_GRANULARITY, Buffer, TempLength); - CcRosReleaseVacb(Bcb, Vacb, TRUE, TRUE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, TRUE, FALSE); Length -= TempLength; WriteOffset += TempLength; @@ -528,7 +529,7 @@ CcCopyWrite ( while (Length > 0) { TempLength = min(VACB_MAPPING_GRANULARITY, Length); - Status = CcRosRequestVacb(Bcb, + Status = CcRosRequestVacb(SharedCacheMap, WriteOffset, &BaseAddress, &Valid, @@ -541,12 +542,12 @@ CcCopyWrite ( { if (!NT_SUCCESS(CcReadVirtualAddress(Vacb))) { - CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE); return FALSE; } } RtlCopyMemory(BaseAddress, Buffer, TempLength); - CcRosReleaseVacb(Bcb, Vacb, TRUE, TRUE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, TRUE, FALSE); Length -= TempLength; WriteOffset += TempLength; @@ -684,29 +685,29 @@ CcZeroData ( { /* File is cached */ KIRQL oldirql; - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; PLIST_ENTRY current_entry; PROS_VACB Vacb, current, previous; ULONG TempLength; - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; if (!Wait) { /* testing, if the requested datas are available */ - KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql); /* FIXME: this loop doesn't take into account areas that don't have * a VACB in the list yet */ - current_entry = Bcb->BcbVacbListHead.Flink; - while (current_entry != &Bcb->BcbVacbListHead) + current_entry = SharedCacheMap->CacheMapVacbListHead.Flink; + while (current_entry != &SharedCacheMap->CacheMapVacbListHead) { Vacb = CONTAINING_RECORD(current_entry, ROS_VACB, - BcbVacbListEntry); + CacheMapVacbListEntry); if (!Vacb->Valid && DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY, WriteOffset.u.LowPart, Length)) { - KeReleaseSpinLock(&Bcb->BcbLock, oldirql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); /* datas not available */ return FALSE; } @@ -714,7 +715,7 @@ CcZeroData ( break; current_entry = current_entry->Flink; } - KeReleaseSpinLock(&Bcb->BcbLock, oldirql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); } while (Length > 0) @@ -729,7 +730,7 @@ CcZeroData ( { CurrentLength = Length; } - Status = CcRosGetVacbChain(Bcb, WriteOffset.u.LowPart - Offset, + Status = CcRosGetVacbChain(SharedCacheMap, WriteOffset.u.LowPart - Offset, Offset + CurrentLength, &Vacb); if (!NT_SUCCESS(Status)) { @@ -774,7 +775,7 @@ CcZeroData ( { previous = current; current = current->NextInChain; - CcRosReleaseVacb(Bcb, previous, TRUE, TRUE, FALSE); + CcRosReleaseVacb(SharedCacheMap, previous, TRUE, TRUE, FALSE); } } } diff --git a/reactos/ntoskrnl/cc/fs.c b/reactos/ntoskrnl/cc/fs.c index 1ee69d5d96b..d806d38198f 100644 --- a/reactos/ntoskrnl/cc/fs.c +++ b/reactos/ntoskrnl/cc/fs.c @@ -52,7 +52,7 @@ CcGetFileObjectFromBcb ( IN PVOID Bcb) { PINTERNAL_BCB iBcb = (PINTERNAL_BCB)Bcb; - return iBcb->Vacb->Bcb->FileObject; + return iBcb->Vacb->SharedCacheMap->FileObject; } /* @@ -128,7 +128,7 @@ CcSetFileSizes ( IN PCC_FILE_SIZES FileSizes) { KIRQL oldirql; - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; PLIST_ENTRY current_entry; PROS_VACB current; LIST_ENTRY FreeListHead; @@ -141,33 +141,33 @@ CcSetFileSizes ( FileSizes->FileSize.QuadPart, FileSizes->ValidDataLength.QuadPart); - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; /* * It is valid to call this function on file objects that weren't * initialized for caching. In this case it's simple no-op. */ - if (Bcb == NULL) + if (SharedCacheMap == NULL) return; - if (FileSizes->AllocationSize.QuadPart < Bcb->AllocationSize.QuadPart) + if (FileSizes->AllocationSize.QuadPart < SharedCacheMap->AllocationSize.QuadPart) { InitializeListHead(&FreeListHead); KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql); - current_entry = Bcb->BcbVacbListHead.Flink; - while (current_entry != &Bcb->BcbVacbListHead) + current_entry = SharedCacheMap->CacheMapVacbListHead.Flink; + while (current_entry != &SharedCacheMap->CacheMapVacbListHead) { current = CONTAINING_RECORD(current_entry, ROS_VACB, - BcbVacbListEntry); + CacheMapVacbListEntry); current_entry = current_entry->Flink; if (current->FileOffset >= FileSizes->AllocationSize.QuadPart) { if ((current->ReferenceCount == 0) || ((current->ReferenceCount == 1) && current->Dirty)) { - RemoveEntryList(¤t->BcbVacbListEntry); + RemoveEntryList(¤t->CacheMapVacbListEntry); RemoveEntryList(¤t->VacbListEntry); RemoveEntryList(¤t->VacbLruListEntry); if (current->Dirty) @@ -175,7 +175,7 @@ CcSetFileSizes ( RemoveEntryList(¤t->DirtyVacbListEntry); DirtyPageCount -= VACB_MAPPING_GRANULARITY / PAGE_SIZE; } - InsertHeadList(&FreeListHead, ¤t->BcbVacbListEntry); + InsertHeadList(&FreeListHead, ¤t->CacheMapVacbListEntry); } else { @@ -185,15 +185,15 @@ CcSetFileSizes ( } } - Bcb->AllocationSize = FileSizes->AllocationSize; - Bcb->FileSize = FileSizes->FileSize; - KeReleaseSpinLock(&Bcb->BcbLock, oldirql); + SharedCacheMap->AllocationSize = FileSizes->AllocationSize; + SharedCacheMap->FileSize = FileSizes->FileSize; + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); KeReleaseGuardedMutex(&ViewLock); current_entry = FreeListHead.Flink; while(current_entry != &FreeListHead) { - current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry); + current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry); current_entry = current_entry->Flink; Status = CcRosInternalFreeVacb(current); if (!NT_SUCCESS(Status)) @@ -205,10 +205,10 @@ CcSetFileSizes ( } else { - KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); - Bcb->AllocationSize = FileSizes->AllocationSize; - Bcb->FileSize = FileSizes->FileSize; - KeReleaseSpinLock(&Bcb->BcbLock, oldirql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql); + SharedCacheMap->AllocationSize = FileSizes->AllocationSize; + SharedCacheMap->FileSize = FileSizes->FileSize; + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); } } @@ -249,14 +249,14 @@ CcGetFileSizes ( IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes) { - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; - if (!Bcb) + if (!SharedCacheMap) return FALSE; - FileSizes->AllocationSize = Bcb->AllocationSize; - FileSizes->FileSize = FileSizes->ValidDataLength = Bcb->FileSize; + FileSizes->AllocationSize = SharedCacheMap->AllocationSize; + FileSizes->FileSize = FileSizes->ValidDataLength = SharedCacheMap->FileSize; return TRUE; } diff --git a/reactos/ntoskrnl/cc/pin.c b/reactos/ntoskrnl/cc/pin.c index 29e7d65606b..2ab228a6297 100644 --- a/reactos/ntoskrnl/cc/pin.c +++ b/reactos/ntoskrnl/cc/pin.c @@ -34,7 +34,7 @@ CcMapData ( { ULONG ReadOffset; BOOLEAN Valid; - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; PROS_VACB Vacb; NTSTATUS Status; PINTERNAL_BCB iBcb; @@ -50,12 +50,12 @@ CcMapData ( ASSERT(FileObject->SectionObjectPointer); ASSERT(FileObject->SectionObjectPointer->SharedCacheMap); - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; - ASSERT(Bcb); + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; + ASSERT(SharedCacheMap); DPRINT("AllocationSize %I64x, FileSize %I64x\n", - Bcb->AllocationSize.QuadPart, - Bcb->FileSize.QuadPart); + SharedCacheMap->AllocationSize.QuadPart, + SharedCacheMap->FileSize.QuadPart); if (ReadOffset % VACB_MAPPING_GRANULARITY + Length > VACB_MAPPING_GRANULARITY) { @@ -63,7 +63,7 @@ CcMapData ( } ROffset = ROUND_DOWN(ReadOffset, VACB_MAPPING_GRANULARITY); - Status = CcRosRequestVacb(Bcb, + Status = CcRosRequestVacb(SharedCacheMap, ROffset, pBuffer, &Valid, @@ -77,13 +77,13 @@ CcMapData ( { if (!(Flags & MAP_WAIT)) { - CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE); return FALSE; } if (!NT_SUCCESS(CcReadVirtualAddress(Vacb))) { - CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE); return FALSE; } } @@ -92,7 +92,7 @@ CcMapData ( iBcb = ExAllocateFromNPagedLookasideList(&iBcbLookasideList); if (iBcb == NULL) { - CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE); return FALSE; } @@ -195,7 +195,7 @@ CcUnpinData ( { PINTERNAL_BCB iBcb = Bcb; - CcRosReleaseVacb(iBcb->Vacb->Bcb, + CcRosReleaseVacb(iBcb->Vacb->SharedCacheMap, iBcb->Vacb, TRUE, iBcb->Dirty, diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index 146659d67fb..e151c7a58e9 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -49,14 +49,14 @@ ULONG DirtyPageCount = 0; KGUARDED_MUTEX ViewLock; NPAGED_LOOKASIDE_LIST iBcbLookasideList; -static NPAGED_LOOKASIDE_LIST BcbLookasideList; +static NPAGED_LOOKASIDE_LIST SharedCacheMapLookasideList; static NPAGED_LOOKASIDE_LIST VacbLookasideList; #if DBG static void CcRosVacbIncRefCount_(PROS_VACB vacb, const char* file, int line) { ++vacb->ReferenceCount; - if (vacb->Bcb->Trace) + if (vacb->SharedCacheMap->Trace) { DbgPrint("(%s:%i) VACB %p ++RefCount=%lu, Dirty %u, PageOut %lu\n", file, line, vacb, vacb->ReferenceCount, vacb->Dirty, vacb->PageOut); @@ -65,7 +65,7 @@ static void CcRosVacbIncRefCount_(PROS_VACB vacb, const char* file, int line) static void CcRosVacbDecRefCount_(PROS_VACB vacb, const char* file, int line) { --vacb->ReferenceCount; - if (vacb->Bcb->Trace) + if (vacb->SharedCacheMap->Trace) { DbgPrint("(%s:%i) VACB %p --RefCount=%lu, Dirty %u, PageOut %lu\n", file, line, vacb, vacb->ReferenceCount, vacb->Dirty, vacb->PageOut); @@ -87,7 +87,7 @@ CcRosInternalFreeVacb(PROS_VACB Vacb); VOID NTAPI CcRosTraceCacheMap ( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, BOOLEAN Trace ) { #if DBG @@ -95,38 +95,38 @@ CcRosTraceCacheMap ( PLIST_ENTRY current_entry; PROS_VACB current; - if ( !Bcb ) + if (!SharedCacheMap) return; - Bcb->Trace = Trace; + SharedCacheMap->Trace = Trace; - if ( Trace ) + if (Trace) { - DPRINT1("Enabling Tracing for CacheMap 0x%p:\n", Bcb ); + DPRINT1("Enabling Tracing for CacheMap 0x%p:\n", SharedCacheMap); KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(&Bcb->BcbLock, &oldirql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql); - current_entry = Bcb->BcbVacbListHead.Flink; - while (current_entry != &Bcb->BcbVacbListHead) + current_entry = SharedCacheMap->CacheMapVacbListHead.Flink; + while (current_entry != &SharedCacheMap->CacheMapVacbListHead) { - current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry); + current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry); current_entry = current_entry->Flink; DPRINT1(" VACB 0x%p enabled, RefCount %lu, Dirty %u, PageOut %lu\n", current, current->ReferenceCount, current->Dirty, current->PageOut ); } - KeReleaseSpinLock(&Bcb->BcbLock, oldirql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); KeReleaseGuardedMutex(&ViewLock); } else { - DPRINT1("Disabling Tracing for CacheMap 0x%p:\n", Bcb ); + DPRINT1("Disabling Tracing for CacheMap 0x%p:\n", SharedCacheMap); } #else - Bcb = Bcb; - Trace = Trace; + UNREFERENCED_PARAMETER(SharedCacheMap); + UNREFERENCED_PARAMETER(Trace); #endif } @@ -142,14 +142,14 @@ CcRosFlushVacb ( if (NT_SUCCESS(Status)) { KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(&Vacb->Bcb->BcbLock, &oldIrql); + KeAcquireSpinLock(&Vacb->SharedCacheMap->CacheMapLock, &oldIrql); Vacb->Dirty = FALSE; RemoveEntryList(&Vacb->DirtyVacbListEntry); DirtyPageCount -= VACB_MAPPING_GRANULARITY / PAGE_SIZE; CcRosVacbDecRefCount(Vacb); - KeReleaseSpinLock(&Vacb->Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&Vacb->SharedCacheMap->CacheMapLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); } @@ -192,8 +192,8 @@ CcRosFlushDirtyPages ( CcRosVacbIncRefCount(current); - Locked = current->Bcb->Callbacks->AcquireForLazyWrite( - current->Bcb->LazyWriteContext, Wait); + Locked = current->SharedCacheMap->Callbacks->AcquireForLazyWrite( + current->SharedCacheMap->LazyWriteContext, Wait); if (!Locked) { CcRosVacbDecRefCount(current); @@ -207,8 +207,8 @@ CcRosFlushDirtyPages ( Wait ? NULL : &ZeroTimeout); if (Status != STATUS_SUCCESS) { - current->Bcb->Callbacks->ReleaseFromLazyWrite( - current->Bcb->LazyWriteContext); + current->SharedCacheMap->Callbacks->ReleaseFromLazyWrite( + current->SharedCacheMap->LazyWriteContext); CcRosVacbDecRefCount(current); continue; } @@ -219,8 +219,8 @@ CcRosFlushDirtyPages ( if (current->ReferenceCount > 2) { KeReleaseMutex(¤t->Mutex, FALSE); - current->Bcb->Callbacks->ReleaseFromLazyWrite( - current->Bcb->LazyWriteContext); + current->SharedCacheMap->Callbacks->ReleaseFromLazyWrite( + current->SharedCacheMap->LazyWriteContext); CcRosVacbDecRefCount(current); continue; } @@ -230,8 +230,8 @@ CcRosFlushDirtyPages ( Status = CcRosFlushVacb(current); KeReleaseMutex(¤t->Mutex, FALSE); - current->Bcb->Callbacks->ReleaseFromLazyWrite( - current->Bcb->LazyWriteContext); + current->SharedCacheMap->Callbacks->ReleaseFromLazyWrite( + current->SharedCacheMap->LazyWriteContext); KeAcquireGuardedMutex(&ViewLock); CcRosVacbDecRefCount(current); @@ -296,7 +296,7 @@ retry: VacbLruListEntry); current_entry = current_entry->Flink; - KeAcquireSpinLock(¤t->Bcb->BcbLock, &oldIrql); + KeAcquireSpinLock(¤t->SharedCacheMap->CacheMapLock, &oldIrql); /* Reference the VACB */ CcRosVacbIncRefCount(current); @@ -305,7 +305,7 @@ retry: if (current->MappedCount > 0 && !current->Dirty) { /* We have to break these locks because Cc sucks */ - KeReleaseSpinLock(¤t->Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(¤t->SharedCacheMap->CacheMapLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); /* Page out the VACB */ @@ -318,7 +318,7 @@ retry: /* Reacquire the locks */ KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(¤t->Bcb->BcbLock, &oldIrql); + KeAcquireSpinLock(¤t->SharedCacheMap->CacheMapLock, &oldIrql); } /* Dereference the VACB */ @@ -330,10 +330,10 @@ retry: ASSERT(!current->Dirty); ASSERT(!current->MappedCount); - RemoveEntryList(¤t->BcbVacbListEntry); + RemoveEntryList(¤t->CacheMapVacbListEntry); RemoveEntryList(¤t->VacbListEntry); RemoveEntryList(¤t->VacbLruListEntry); - InsertHeadList(&FreeList, ¤t->BcbVacbListEntry); + InsertHeadList(&FreeList, ¤t->CacheMapVacbListEntry); /* Calculate how many pages we freed for Mm */ PagesFreed = min(VACB_MAPPING_GRANULARITY / PAGE_SIZE, Target); @@ -341,7 +341,7 @@ retry: (*NrFreed) += PagesFreed; } - KeReleaseSpinLock(¤t->Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(¤t->SharedCacheMap->CacheMapLock, oldIrql); } KeReleaseGuardedMutex(&ViewLock); @@ -370,7 +370,7 @@ retry: current_entry = RemoveHeadList(&FreeList); current = CONTAINING_RECORD(current_entry, ROS_VACB, - BcbVacbListEntry); + CacheMapVacbListEntry); CcRosInternalFreeVacb(current); } @@ -382,7 +382,7 @@ retry: NTSTATUS NTAPI CcRosReleaseVacb ( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, PROS_VACB Vacb, BOOLEAN Valid, BOOLEAN Dirty, @@ -391,13 +391,13 @@ CcRosReleaseVacb ( BOOLEAN WasDirty; KIRQL oldIrql; - ASSERT(Bcb); + ASSERT(SharedCacheMap); - DPRINT("CcRosReleaseVacb(Bcb 0x%p, Vacb 0x%p, Valid %u)\n", - Bcb, Vacb, Valid); + DPRINT("CcRosReleaseVacb(SharedCacheMap 0x%p, Vacb 0x%p, Valid %u)\n", + SharedCacheMap, Vacb, Valid); KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql); Vacb->Valid = Valid; @@ -424,7 +424,7 @@ CcRosReleaseVacb ( CcRosVacbIncRefCount(Vacb); } - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); KeReleaseMutex(&Vacb->Mutex, FALSE); @@ -435,31 +435,32 @@ CcRosReleaseVacb ( PROS_VACB NTAPI CcRosLookupVacb ( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset) { PLIST_ENTRY current_entry; PROS_VACB current; KIRQL oldIrql; - ASSERT(Bcb); + ASSERT(SharedCacheMap); - DPRINT("CcRosLookupVacb(Bcb -x%p, FileOffset %lu)\n", Bcb, FileOffset); + DPRINT("CcRosLookupVacb(SharedCacheMap 0x%p, FileOffset %lu)\n", + SharedCacheMap, FileOffset); KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql); - current_entry = Bcb->BcbVacbListHead.Flink; - while (current_entry != &Bcb->BcbVacbListHead) + current_entry = SharedCacheMap->CacheMapVacbListHead.Flink; + while (current_entry != &SharedCacheMap->CacheMapVacbListHead) { current = CONTAINING_RECORD(current_entry, ROS_VACB, - BcbVacbListEntry); + CacheMapVacbListEntry); if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY, FileOffset)) { CcRosVacbIncRefCount(current); - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); KeWaitForSingleObject(¤t->Mutex, Executive, @@ -473,7 +474,7 @@ CcRosLookupVacb ( current_entry = current_entry->Flink; } - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); return NULL; @@ -482,24 +483,25 @@ CcRosLookupVacb ( NTSTATUS NTAPI CcRosMarkDirtyVacb ( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset) { PROS_VACB Vacb; KIRQL oldIrql; - ASSERT(Bcb); + ASSERT(SharedCacheMap); - DPRINT("CcRosMarkDirtyVacb(Bcb 0x%p, FileOffset %lu)\n", Bcb, FileOffset); + DPRINT("CcRosMarkDirtyVacb(SharedCacheMap 0x%p, FileOffset %lu)\n", + SharedCacheMap, FileOffset); - Vacb = CcRosLookupVacb(Bcb, FileOffset); + Vacb = CcRosLookupVacb(SharedCacheMap, FileOffset); if (Vacb == NULL) { KeBugCheck(CACHE_MANAGER); } KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql); if (!Vacb->Dirty) { @@ -517,7 +519,7 @@ CcRosMarkDirtyVacb ( Vacb->Dirty = TRUE; - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); KeReleaseMutex(&Vacb->Mutex, FALSE); @@ -527,7 +529,7 @@ CcRosMarkDirtyVacb ( NTSTATUS NTAPI CcRosUnmapVacb ( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, BOOLEAN NowDirty) { @@ -535,19 +537,19 @@ CcRosUnmapVacb ( BOOLEAN WasDirty; KIRQL oldIrql; - ASSERT(Bcb); + ASSERT(SharedCacheMap); - DPRINT("CcRosUnmapVacb(Bcb 0x%p, FileOffset %lu, NowDirty %u)\n", - Bcb, FileOffset, NowDirty); + DPRINT("CcRosUnmapVacb(SharedCacheMap 0x%p, FileOffset %lu, NowDirty %u)\n", + SharedCacheMap, FileOffset, NowDirty); - Vacb = CcRosLookupVacb(Bcb, FileOffset); + Vacb = CcRosLookupVacb(SharedCacheMap, FileOffset); if (Vacb == NULL) { return STATUS_UNSUCCESSFUL; } KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql); WasDirty = Vacb->Dirty; Vacb->Dirty = Vacb->Dirty || NowDirty; @@ -570,7 +572,7 @@ CcRosUnmapVacb ( CcRosVacbDecRefCount(Vacb); } - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); KeReleaseMutex(&Vacb->Mutex, FALSE); @@ -580,7 +582,7 @@ CcRosUnmapVacb ( static NTSTATUS CcRosCreateVacb ( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, PROS_VACB *Vacb) { @@ -590,11 +592,11 @@ CcRosCreateVacb ( NTSTATUS Status; KIRQL oldIrql; - ASSERT(Bcb); + ASSERT(SharedCacheMap); DPRINT("CcRosCreateVacb()\n"); - if (FileOffset >= Bcb->FileSize.u.LowPart) + if (FileOffset >= SharedCacheMap->FileSize.u.LowPart) { *Vacb = NULL; return STATUS_INVALID_PARAMETER; @@ -605,11 +607,11 @@ CcRosCreateVacb ( current->Dirty = FALSE; current->PageOut = FALSE; current->FileOffset = ROUND_DOWN(FileOffset, VACB_MAPPING_GRANULARITY); - current->Bcb = Bcb; + current->SharedCacheMap = SharedCacheMap; #if DBG - if ( Bcb->Trace ) + if (SharedCacheMap->Trace) { - DPRINT1("CacheMap 0x%p: new VACB: 0x%p\n", Bcb, current ); + DPRINT1("CacheMap 0x%p: new VACB: 0x%p\n", SharedCacheMap, current); } #endif current->MappedCount = 0; @@ -630,26 +632,26 @@ CcRosCreateVacb ( * file offset exist. If there is a VACB, we release * our newly created VACB and return the existing one. */ - KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - current_entry = Bcb->BcbVacbListHead.Flink; + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql); + current_entry = SharedCacheMap->CacheMapVacbListHead.Flink; previous = NULL; - while (current_entry != &Bcb->BcbVacbListHead) + while (current_entry != &SharedCacheMap->CacheMapVacbListHead) { current = CONTAINING_RECORD(current_entry, ROS_VACB, - BcbVacbListEntry); + CacheMapVacbListEntry); if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY, FileOffset)) { CcRosVacbIncRefCount(current); - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql); #if DBG - if ( Bcb->Trace ) + if (SharedCacheMap->Trace) { DPRINT1("CacheMap 0x%p: deleting newly created VACB 0x%p ( found existing one 0x%p )\n", - Bcb, + SharedCacheMap, (*Vacb), - current ); + current); } #endif KeReleaseMutex(&(*Vacb)->Mutex, FALSE); @@ -677,13 +679,13 @@ CcRosCreateVacb ( current = *Vacb; if (previous) { - InsertHeadList(&previous->BcbVacbListEntry, ¤t->BcbVacbListEntry); + InsertHeadList(&previous->CacheMapVacbListEntry, ¤t->CacheMapVacbListEntry); } else { - InsertHeadList(&Bcb->BcbVacbListHead, ¤t->BcbVacbListEntry); + InsertHeadList(&SharedCacheMap->CacheMapVacbListHead, ¤t->CacheMapVacbListEntry); } - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql); InsertTailList(&VacbListHead, ¤t->VacbListEntry); InsertTailList(&VacbLruListHead, ¤t->VacbLruListEntry); KeReleaseGuardedMutex(&ViewLock); @@ -710,9 +712,9 @@ CcRosCreateVacb ( #if MI_TRACE_PFNS PWCHAR pos = NULL; ULONG len = 0; - if ((Bcb->FileObject) && (Bcb->FileObject->FileName.Buffer)) + if ((SharedCacheMap->FileObject) && (SharedCacheMap->FileObject->FileName.Buffer)) { - pos = wcsrchr(Bcb->FileObject->FileName.Buffer, '\\'); + pos = wcsrchr(SharedCacheMap->FileObject->FileName.Buffer, '\\'); len = wcslen(pos) * sizeof(WCHAR); if (pos) snprintf(MI_PFN_CURRENT_PROCESS_NAME, min(16, len), "%S", pos); } @@ -727,7 +729,7 @@ CcRosCreateVacb ( NTSTATUS NTAPI CcRosGetVacbChain ( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, ULONG Length, PROS_VACB *Vacb) @@ -737,7 +739,7 @@ CcRosGetVacbChain ( PROS_VACB *VacbList; PROS_VACB Previous = NULL; - ASSERT(Bcb); + ASSERT(SharedCacheMap); DPRINT("CcRosGetVacbChain()\n"); @@ -752,7 +754,7 @@ CcRosGetVacbChain ( for (i = 0; i < (Length / VACB_MAPPING_GRANULARITY); i++) { ULONG CurrentOffset = FileOffset + (i * VACB_MAPPING_GRANULARITY); - current = CcRosLookupVacb(Bcb, CurrentOffset); + current = CcRosLookupVacb(SharedCacheMap, CurrentOffset); if (current != NULL) { KeAcquireGuardedMutex(&ViewLock); @@ -767,7 +769,7 @@ CcRosGetVacbChain ( } else { - CcRosCreateVacb(Bcb, CurrentOffset, ¤t); + CcRosCreateVacb(SharedCacheMap, CurrentOffset, ¤t); VacbList[i] = current; } } @@ -794,7 +796,7 @@ CcRosGetVacbChain ( NTSTATUS NTAPI CcRosGetVacb ( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, PULONG BaseOffset, PVOID* BaseAddress, @@ -804,20 +806,20 @@ CcRosGetVacb ( PROS_VACB current; NTSTATUS Status; - ASSERT(Bcb); + ASSERT(SharedCacheMap); DPRINT("CcRosGetVacb()\n"); /* * Look for a VACB already mapping the same data. */ - current = CcRosLookupVacb(Bcb, FileOffset); + current = CcRosLookupVacb(SharedCacheMap, FileOffset); if (current == NULL) { /* * Otherwise create a new VACB. */ - Status = CcRosCreateVacb(Bcb, FileOffset, ¤t); + Status = CcRosCreateVacb(SharedCacheMap, FileOffset, ¤t); if (!NT_SUCCESS(Status)) { return Status; @@ -846,18 +848,18 @@ CcRosGetVacb ( NTSTATUS NTAPI CcRosRequestVacb ( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, PROS_VACB *Vacb) /* - * FUNCTION: Request a page mapping for a BCB + * FUNCTION: Request a page mapping for a shared cache map */ { ULONG BaseOffset; - ASSERT(Bcb); + ASSERT(SharedCacheMap); if (FileOffset % VACB_MAPPING_GRANULARITY != 0) { @@ -866,7 +868,7 @@ CcRosRequestVacb ( KeBugCheck(CACHE_MANAGER); } - return CcRosGetVacb(Bcb, + return CcRosGetVacb(SharedCacheMap, FileOffset, &BaseOffset, BaseAddress, @@ -896,14 +898,14 @@ NTSTATUS CcRosInternalFreeVacb ( PROS_VACB Vacb) /* - * FUNCTION: Releases a VACB associated with a BCB + * FUNCTION: Releases a VACB associated with a shared cache map */ { DPRINT("Freeing VACB 0x%p\n", Vacb); #if DBG - if (Vacb->Bcb->Trace) + if (Vacb->SharedCacheMap->Trace) { - DPRINT1("CacheMap 0x%p: deleting VACB: 0x%p\n", Vacb->Bcb, Vacb); + DPRINT1("CacheMap 0x%p: deleting VACB: 0x%p\n", Vacb->SharedCacheMap, Vacb); } #endif @@ -929,7 +931,7 @@ CcFlushCache ( IN ULONG Length, OUT PIO_STATUS_BLOCK IoStatus) { - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; LARGE_INTEGER Offset; PROS_VACB current; NTSTATUS Status; @@ -940,8 +942,8 @@ CcFlushCache ( if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap) { - Bcb = (PBCB)SectionObjectPointers->SharedCacheMap; - ASSERT(Bcb); + SharedCacheMap = SectionObjectPointers->SharedCacheMap; + ASSERT(SharedCacheMap); if (FileOffset) { Offset = *FileOffset; @@ -949,7 +951,7 @@ CcFlushCache ( else { Offset.QuadPart = (LONGLONG)0; - Length = Bcb->FileSize.u.LowPart; + Length = SharedCacheMap->FileSize.u.LowPart; } if (IoStatus) @@ -960,7 +962,7 @@ CcFlushCache ( while (Length > 0) { - current = CcRosLookupVacb(Bcb, Offset.u.LowPart); + current = CcRosLookupVacb(SharedCacheMap, Offset.u.LowPart); if (current != NULL) { if (current->Dirty) @@ -974,9 +976,9 @@ CcFlushCache ( KeReleaseMutex(¤t->Mutex, FALSE); KeAcquireGuardedMutex(&ViewLock); - KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql); CcRosVacbDecRefCount(current); - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); } @@ -1004,9 +1006,9 @@ NTSTATUS NTAPI CcRosDeleteFileCache ( PFILE_OBJECT FileObject, - PBCB Bcb) + PROS_SHARED_CACHE_MAP SharedCacheMap) /* - * FUNCTION: Releases the BCB associated with a file object + * FUNCTION: Releases the shared cache map associated with a file object */ { PLIST_ENTRY current_entry; @@ -1014,16 +1016,16 @@ CcRosDeleteFileCache ( LIST_ENTRY FreeList; KIRQL oldIrql; - ASSERT(Bcb); + ASSERT(SharedCacheMap); - Bcb->RefCount++; + SharedCacheMap->RefCount++; KeReleaseGuardedMutex(&ViewLock); CcFlushCache(FileObject->SectionObjectPointer, NULL, 0, NULL); KeAcquireGuardedMutex(&ViewLock); - Bcb->RefCount--; - if (Bcb->RefCount == 0) + SharedCacheMap->RefCount--; + if (SharedCacheMap->RefCount == 0) { FileObject->SectionObjectPointer->SharedCacheMap = NULL; @@ -1031,11 +1033,11 @@ CcRosDeleteFileCache ( * Release all VACBs */ InitializeListHead(&FreeList); - KeAcquireSpinLock(&Bcb->BcbLock, &oldIrql); - while (!IsListEmpty(&Bcb->BcbVacbListHead)) + KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldIrql); + while (!IsListEmpty(&SharedCacheMap->CacheMapVacbListHead)) { - current_entry = RemoveTailList(&Bcb->BcbVacbListHead); - current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry); + current_entry = RemoveTailList(&SharedCacheMap->CacheMapVacbListHead); + current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry); RemoveEntryList(¤t->VacbListEntry); RemoveEntryList(¤t->VacbLruListEntry); if (current->Dirty) @@ -1044,23 +1046,23 @@ CcRosDeleteFileCache ( DirtyPageCount -= VACB_MAPPING_GRANULARITY / PAGE_SIZE; DPRINT1("Freeing dirty VACB\n"); } - InsertHeadList(&FreeList, ¤t->BcbVacbListEntry); + InsertHeadList(&FreeList, ¤t->CacheMapVacbListEntry); } #if DBG - Bcb->Trace = FALSE; + SharedCacheMap->Trace = FALSE; #endif - KeReleaseSpinLock(&Bcb->BcbLock, oldIrql); + KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldIrql); KeReleaseGuardedMutex(&ViewLock); - ObDereferenceObject (Bcb->FileObject); + ObDereferenceObject(SharedCacheMap->FileObject); while (!IsListEmpty(&FreeList)) { current_entry = RemoveTailList(&FreeList); - current = CONTAINING_RECORD(current_entry, ROS_VACB, BcbVacbListEntry); + current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry); CcRosInternalFreeVacb(current); } - ExFreeToNPagedLookasideList(&BcbLookasideList, Bcb); + ExFreeToNPagedLookasideList(&SharedCacheMapLookasideList, SharedCacheMap); KeAcquireGuardedMutex(&ViewLock); } return STATUS_SUCCESS; @@ -1071,12 +1073,12 @@ NTAPI CcRosReferenceCache ( PFILE_OBJECT FileObject) { - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; KeAcquireGuardedMutex(&ViewLock); - Bcb = (PBCB)FileObject->SectionObjectPointer->SharedCacheMap; - ASSERT(Bcb); - ASSERT(Bcb->RefCount != 0); - Bcb->RefCount++; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; + ASSERT(SharedCacheMap); + ASSERT(SharedCacheMap->RefCount != 0); + SharedCacheMap->RefCount++; KeReleaseGuardedMutex(&ViewLock); } @@ -1085,13 +1087,13 @@ NTAPI CcRosRemoveIfClosed ( PSECTION_OBJECT_POINTERS SectionObjectPointer) { - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; DPRINT("CcRosRemoveIfClosed()\n"); KeAcquireGuardedMutex(&ViewLock); - Bcb = (PBCB)SectionObjectPointer->SharedCacheMap; - if (Bcb && Bcb->RefCount == 0) + SharedCacheMap = SectionObjectPointer->SharedCacheMap; + if (SharedCacheMap && SharedCacheMap->RefCount == 0) { - CcRosDeleteFileCache(Bcb->FileObject, Bcb); + CcRosDeleteFileCache(SharedCacheMap->FileObject, SharedCacheMap); } KeReleaseGuardedMutex(&ViewLock); } @@ -1102,17 +1104,17 @@ NTAPI CcRosDereferenceCache ( PFILE_OBJECT FileObject) { - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; KeAcquireGuardedMutex(&ViewLock); - Bcb = (PBCB)FileObject->SectionObjectPointer->SharedCacheMap; - ASSERT(Bcb); - if (Bcb->RefCount > 0) + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; + ASSERT(SharedCacheMap); + if (SharedCacheMap->RefCount > 0) { - Bcb->RefCount--; - if (Bcb->RefCount == 0) + SharedCacheMap->RefCount--; + if (SharedCacheMap->RefCount == 0) { - MmFreeSectionSegments(Bcb->FileObject); - CcRosDeleteFileCache(FileObject, Bcb); + MmFreeSectionSegments(SharedCacheMap->FileObject); + CcRosDeleteFileCache(FileObject, SharedCacheMap); } } KeReleaseGuardedMutex(&ViewLock); @@ -1127,23 +1129,23 @@ CcRosReleaseFileCache ( * has been closed. */ { - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; KeAcquireGuardedMutex(&ViewLock); if (FileObject->SectionObjectPointer->SharedCacheMap != NULL) { - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; if (FileObject->PrivateCacheMap != NULL) { FileObject->PrivateCacheMap = NULL; - if (Bcb->RefCount > 0) + if (SharedCacheMap->RefCount > 0) { - Bcb->RefCount--; - if (Bcb->RefCount == 0) + SharedCacheMap->RefCount--; + if (SharedCacheMap->RefCount == 0) { - MmFreeSectionSegments(Bcb->FileObject); - CcRosDeleteFileCache(FileObject, Bcb); + MmFreeSectionSegments(SharedCacheMap->FileObject); + CcRosDeleteFileCache(FileObject, SharedCacheMap); } } } @@ -1157,14 +1159,14 @@ NTAPI CcTryToInitializeFileCache ( PFILE_OBJECT FileObject) { - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; NTSTATUS Status; KeAcquireGuardedMutex(&ViewLock); ASSERT(FileObject->SectionObjectPointer); - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; - if (Bcb == NULL) + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; + if (SharedCacheMap == NULL) { Status = STATUS_UNSUCCESSFUL; } @@ -1172,8 +1174,8 @@ CcTryToInitializeFileCache ( { if (FileObject->PrivateCacheMap == NULL) { - FileObject->PrivateCacheMap = Bcb; - Bcb->RefCount++; + FileObject->PrivateCacheMap = SharedCacheMap; + SharedCacheMap->RefCount++; } Status = STATUS_SUCCESS; } @@ -1190,47 +1192,47 @@ CcRosInitializeFileCache ( PCACHE_MANAGER_CALLBACKS CallBacks, PVOID LazyWriterContext) /* - * FUNCTION: Initializes a BCB for a file object + * FUNCTION: Initializes a shared cache map for a file object */ { - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; - DPRINT("CcRosInitializeFileCache(FileObject 0x%p, Bcb 0x%p)\n", - FileObject, Bcb); + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; + DPRINT("CcRosInitializeFileCache(FileObject 0x%p, SharedCacheMap 0x%p)\n", + FileObject, SharedCacheMap); KeAcquireGuardedMutex(&ViewLock); - if (Bcb == NULL) + if (SharedCacheMap == NULL) { - Bcb = ExAllocateFromNPagedLookasideList(&BcbLookasideList); - if (Bcb == NULL) + SharedCacheMap = ExAllocateFromNPagedLookasideList(&SharedCacheMapLookasideList); + if (SharedCacheMap == NULL) { KeReleaseGuardedMutex(&ViewLock); return STATUS_UNSUCCESSFUL; } - RtlZeroMemory(Bcb, sizeof(*Bcb)); + RtlZeroMemory(SharedCacheMap, sizeof(*SharedCacheMap)); ObReferenceObjectByPointer(FileObject, FILE_ALL_ACCESS, NULL, KernelMode); - Bcb->FileObject = FileObject; - Bcb->Callbacks = CallBacks; - Bcb->LazyWriteContext = LazyWriterContext; + SharedCacheMap->FileObject = FileObject; + SharedCacheMap->Callbacks = CallBacks; + SharedCacheMap->LazyWriteContext = LazyWriterContext; if (FileObject->FsContext) { - Bcb->AllocationSize = + SharedCacheMap->AllocationSize = ((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->AllocationSize; - Bcb->FileSize = + SharedCacheMap->FileSize = ((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize; } - KeInitializeSpinLock(&Bcb->BcbLock); - InitializeListHead(&Bcb->BcbVacbListHead); - FileObject->SectionObjectPointer->SharedCacheMap = Bcb; + KeInitializeSpinLock(&SharedCacheMap->CacheMapLock); + InitializeListHead(&SharedCacheMap->CacheMapVacbListHead); + FileObject->SectionObjectPointer->SharedCacheMap = SharedCacheMap; } if (FileObject->PrivateCacheMap == NULL) { - FileObject->PrivateCacheMap = Bcb; - Bcb->RefCount++; + FileObject->PrivateCacheMap = SharedCacheMap; + SharedCacheMap->RefCount++; } KeReleaseGuardedMutex(&ViewLock); @@ -1245,12 +1247,12 @@ NTAPI CcGetFileObjectFromSectionPtrs ( IN PSECTION_OBJECT_POINTERS SectionObjectPointers) { - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; if (SectionObjectPointers && SectionObjectPointers->SharedCacheMap) { - Bcb = (PBCB)SectionObjectPointers->SharedCacheMap; - ASSERT(Bcb); - return Bcb->FileObject; + SharedCacheMap = SectionObjectPointers->SharedCacheMap; + ASSERT(SharedCacheMap); + return SharedCacheMap->FileObject; } return NULL; } @@ -1274,11 +1276,11 @@ CcInitView ( sizeof(INTERNAL_BCB), TAG_IBCB, 20); - ExInitializeNPagedLookasideList (&BcbLookasideList, + ExInitializeNPagedLookasideList (&SharedCacheMapLookasideList, NULL, NULL, 0, - sizeof(BCB), + sizeof(ROS_SHARED_CACHE_MAP), TAG_BCB, 20); ExInitializeNPagedLookasideList (&VacbLookasideList, diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index 291701b2590..a65de293205 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -101,21 +101,21 @@ typedef struct _PFSN_PREFETCHER_GLOBALS LONG ActivePrefetches; } PFSN_PREFETCHER_GLOBALS, *PPFSN_PREFETCHER_GLOBALS; -typedef struct _BCB +typedef struct _ROS_SHARED_CACHE_MAP { - LIST_ENTRY BcbVacbListHead; + LIST_ENTRY CacheMapVacbListHead; ULONG TimeStamp; PFILE_OBJECT FileObject; LARGE_INTEGER AllocationSize; LARGE_INTEGER FileSize; PCACHE_MANAGER_CALLBACKS Callbacks; PVOID LazyWriteContext; - KSPIN_LOCK BcbLock; + KSPIN_LOCK CacheMapLock; ULONG RefCount; #if DBG - BOOLEAN Trace; /* enable extra trace output for this BCB and it's VACBs */ + BOOLEAN Trace; /* enable extra trace output for this cache map and it's VACBs */ #endif -} BCB, *PBCB; +} ROS_SHARED_CACHE_MAP, *PROS_SHARED_CACHE_MAP; typedef struct _ROS_VACB { @@ -130,8 +130,8 @@ typedef struct _ROS_VACB /* Page out in progress */ BOOLEAN PageOut; ULONG MappedCount; - /* Entry in the list of VACBs for this BCB. */ - LIST_ENTRY BcbVacbListEntry; + /* Entry in the list of VACBs for this shared cache map. */ + LIST_ENTRY CacheMapVacbListEntry; /* Entry in the list of VACBs which are dirty. */ LIST_ENTRY DirtyVacbListEntry; /* Entry in the list of VACBs. */ @@ -143,8 +143,8 @@ typedef struct _ROS_VACB KMUTEX Mutex; /* Number of references. */ ULONG ReferenceCount; - /* Pointer to the BCB for the file which this view maps data for. */ - PBCB Bcb; + /* Pointer to the shared cache map for the file which this view maps data for. */ + PROS_SHARED_CACHE_MAP SharedCacheMap; /* Pointer to the next VACB in a chain. */ struct _ROS_VACB *NextInChain; } ROS_VACB, *PROS_VACB; @@ -185,7 +185,7 @@ CcRosFlushVacb(PROS_VACB Vacb); NTSTATUS NTAPI CcRosGetVacb( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, PULONG BaseOffset, PVOID *BaseAddress, @@ -212,7 +212,7 @@ CcInitializeCacheManager(VOID); NTSTATUS NTAPI CcRosUnmapVacb( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, BOOLEAN NowDirty ); @@ -220,14 +220,14 @@ CcRosUnmapVacb( PROS_VACB NTAPI CcRosLookupVacb( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset ); NTSTATUS NTAPI CcRosGetVacbChain( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, ULONG Length, PROS_VACB *Vacb @@ -240,7 +240,7 @@ CcInitCacheZeroPage(VOID); NTSTATUS NTAPI CcRosMarkDirtyVacb( - PBCB Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset ); @@ -267,7 +267,7 @@ CcRosRemoveIfClosed(PSECTION_OBJECT_POINTERS SectionObjectPointer); NTSTATUS NTAPI CcRosReleaseVacb( - BCB* Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, PROS_VACB Vacb, BOOLEAN Valid, BOOLEAN Dirty, @@ -277,7 +277,7 @@ CcRosReleaseVacb( NTSTATUS NTAPI CcRosRequestVacb( - BCB *Bcb, + PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index acde62a6796..268e65761e5 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -896,7 +896,7 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, { PFILE_OBJECT FileObject; #ifndef NEWCC - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; #endif SWAPENTRY SavedSwapEntry; PFN_NUMBER Page; @@ -918,10 +918,10 @@ MmUnsharePageEntrySectionSegment(PROS_SECTION_OBJECT Section, (Offset->QuadPart + PAGE_SIZE <= Segment->RawLength.QuadPart || !IsImageSection)) { NTSTATUS Status; - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; IsDirectMapped = TRUE; #ifndef NEWCC - Status = CcRosUnmapVacb(Bcb, FileOffset.LowPart, Dirty); + Status = CcRosUnmapVacb(SharedCacheMap, FileOffset.LowPart, Dirty); #else Status = STATUS_SUCCESS; #endif @@ -1015,13 +1015,13 @@ BOOLEAN MiIsPageFromCache(PMEMORY_AREA MemoryArea, #ifndef NEWCC if (!(MemoryArea->Data.SectionData.Segment->Image.Characteristics & IMAGE_SCN_MEM_SHARED)) { - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; PROS_VACB Vacb; - Bcb = MemoryArea->Data.SectionData.Section->FileObject->SectionObjectPointer->SharedCacheMap; - Vacb = CcRosLookupVacb(Bcb, (ULONG)(SegOffset + MemoryArea->Data.SectionData.Segment->Image.FileOffset)); + SharedCacheMap = MemoryArea->Data.SectionData.Section->FileObject->SectionObjectPointer->SharedCacheMap; + Vacb = CcRosLookupVacb(SharedCacheMap, (ULONG)(SegOffset + MemoryArea->Data.SectionData.Segment->Image.FileOffset)); if (Vacb) { - CcRosReleaseVacb(Bcb, Vacb, Vacb->Valid, FALSE, TRUE); + CcRosReleaseVacb(SharedCacheMap, Vacb, Vacb->Valid, FALSE, TRUE); return TRUE; } } @@ -1074,17 +1074,17 @@ MiReadPage(PMEMORY_AREA MemoryArea, PFILE_OBJECT FileObject; NTSTATUS Status; ULONG_PTR RawLength; - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; BOOLEAN IsImageSection; ULONG_PTR Length; FileObject = MemoryArea->Data.SectionData.Section->FileObject; - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; RawLength = (ULONG_PTR)(MemoryArea->Data.SectionData.Segment->RawLength.QuadPart); FileOffset = SegOffset + MemoryArea->Data.SectionData.Segment->Image.FileOffset; IsImageSection = MemoryArea->Data.SectionData.Section->AllocationAttributes & SEC_IMAGE ? TRUE : FALSE; - ASSERT(Bcb); + ASSERT(SharedCacheMap); DPRINT("%S %I64x\n", FileObject->FileName.Buffer, FileOffset); @@ -1103,7 +1103,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, * filesystems do because it is safe for us to use an offset with an * alignment less than the file system block size. */ - Status = CcRosGetVacb(Bcb, + Status = CcRosGetVacb(SharedCacheMap, (ULONG)FileOffset, &BaseOffset, &BaseAddress, @@ -1122,7 +1122,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, Status = CcReadVirtualAddress(Vacb); if (!NT_SUCCESS(Status)) { - CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE); return Status; } } @@ -1136,7 +1136,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, (*Page) = MmGetPhysicalAddress((char*)BaseAddress + FileOffset - BaseOffset).LowPart >> PAGE_SHIFT; - CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, TRUE); + CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, TRUE); } else { @@ -1156,7 +1156,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, { return(Status); } - Status = CcRosGetVacb(Bcb, + Status = CcRosGetVacb(SharedCacheMap, (ULONG)FileOffset, &BaseOffset, &BaseAddress, @@ -1175,7 +1175,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, Status = CcReadVirtualAddress(Vacb); if (!NT_SUCCESS(Status)) { - CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE); return Status; } } @@ -1196,8 +1196,8 @@ MiReadPage(PMEMORY_AREA MemoryArea, { memcpy(PageAddr, (char*)BaseAddress + FileOffset - BaseOffset, VacbOffset); MiUnmapPageInHyperSpace(Process, PageAddr, Irql); - CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE); - Status = CcRosGetVacb(Bcb, + CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE); + Status = CcRosGetVacb(SharedCacheMap, (ULONG)(FileOffset + VacbOffset), &BaseOffset, &BaseAddress, @@ -1216,7 +1216,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, Status = CcReadVirtualAddress(Vacb); if (!NT_SUCCESS(Status)) { - CcRosReleaseVacb(Bcb, Vacb, FALSE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, FALSE, FALSE, FALSE); return Status; } } @@ -1231,7 +1231,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, } } MiUnmapPageInHyperSpace(Process, PageAddr, Irql); - CcRosReleaseVacb(Bcb, Vacb, TRUE, FALSE, FALSE); + CcRosReleaseVacb(SharedCacheMap, Vacb, TRUE, FALSE, FALSE); } return(STATUS_SUCCESS); } @@ -1869,7 +1869,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace, NTSTATUS Status; PFILE_OBJECT FileObject; #ifndef NEWCC - PBCB Bcb = NULL; + PROS_SHARED_CACHE_MAP SharedCacheMap = NULL; #endif BOOLEAN DirectMapped; BOOLEAN IsImageSection; @@ -1901,7 +1901,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace, if (FileObject != NULL && !(Context.Segment->Image.Characteristics & IMAGE_SCN_MEM_SHARED)) { - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; /* * If the file system is letting us go directly to the cache and the @@ -2066,7 +2066,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace, KeBugCheckEx(MEMORY_MANAGEMENT, STATUS_UNSUCCESSFUL, SwapEntry, (ULONG_PTR)Process, (ULONG_PTR)Address); } #ifndef NEWCC - Status = CcRosUnmapVacb(Bcb, (ULONG)FileOffset, FALSE); + Status = CcRosUnmapVacb(SharedCacheMap, (ULONG)FileOffset, FALSE); #else Status = STATUS_SUCCESS; #endif @@ -2074,7 +2074,7 @@ MmPageOutSectionView(PMMSUPPORT AddressSpace, if (!NT_SUCCESS(Status)) { DPRINT1("CcRosUnmapVacb failed, status = %x\n", Status); - KeBugCheckEx(MEMORY_MANAGEMENT, Status, (ULONG_PTR)Bcb, (ULONG_PTR)FileOffset, (ULONG_PTR)Address); + KeBugCheckEx(MEMORY_MANAGEMENT, Status, (ULONG_PTR)SharedCacheMap, (ULONG_PTR)FileOffset, (ULONG_PTR)Address); } #endif MiSetPageEvent(NULL, NULL); @@ -2276,7 +2276,7 @@ MmWritePageSectionView(PMMSUPPORT AddressSpace, BOOLEAN Private; NTSTATUS Status; PFILE_OBJECT FileObject; - PBCB Bcb = NULL; + PROS_SHARED_CACHE_MAP SharedCacheMap = NULL; BOOLEAN DirectMapped; BOOLEAN IsImageSection; PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace); @@ -2298,7 +2298,7 @@ MmWritePageSectionView(PMMSUPPORT AddressSpace, if (FileObject != NULL && !(Segment->Image.Characteristics & IMAGE_SCN_MEM_SHARED)) { - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; /* * If the file system is letting us go directly to the cache and the @@ -2366,7 +2366,7 @@ MmWritePageSectionView(PMMSUPPORT AddressSpace, ASSERT(SwapEntry == 0); //SOffset.QuadPart = Offset.QuadPart + Segment->Image.FileOffset; #ifndef NEWCC - CcRosMarkDirtyVacb(Bcb, Offset.LowPart); + CcRosMarkDirtyVacb(SharedCacheMap, Offset.LowPart); #endif MmLockSectionSegment(Segment); MmSetPageEntrySectionSegment(Segment, &Offset, PageEntry); @@ -3970,7 +3970,7 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, { ULONG_PTR Entry; PFILE_OBJECT FileObject; - PBCB Bcb; + PROS_SHARED_CACHE_MAP SharedCacheMap; LARGE_INTEGER Offset; SWAPENTRY SavedSwapEntry; PROS_SECTION_OBJECT Section; @@ -4011,9 +4011,9 @@ MmFreeSectionPage(PVOID Context, MEMORY_AREA* MemoryArea, PVOID Address, if (Page == PFN_FROM_SSE(Entry) && Dirty) { FileObject = MemoryArea->Data.SectionData.Section->FileObject; - Bcb = FileObject->SectionObjectPointer->SharedCacheMap; + SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; #ifndef NEWCC - CcRosMarkDirtyVacb(Bcb, (ULONG)(Offset.QuadPart + Segment->Image.FileOffset)); + CcRosMarkDirtyVacb(SharedCacheMap, (ULONG)(Offset.QuadPart + Segment->Image.FileOffset)); #endif ASSERT(SwapEntry == 0); } @@ -4674,8 +4674,8 @@ MmCanFileBeTruncated (IN PSECTION_OBJECT_POINTERS SectionObjectPointer, /* Check size of file */ if (SectionObjectPointer->SharedCacheMap) { - PBCB Bcb = SectionObjectPointer->SharedCacheMap; - if (NewFileSize->QuadPart <= Bcb->FileSize.QuadPart) + PROS_SHARED_CACHE_MAP SharedCacheMap = SectionObjectPointer->SharedCacheMap; + if (NewFileSize->QuadPart <= SharedCacheMap->FileSize.QuadPart) { return FALSE; } From 72e7415f50d228f45e6b97b2a8408b8db6b5bf14 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 12 Apr 2014 11:12:14 +0000 Subject: [PATCH 292/419] [NTOS:CC] - Organize pool tags and make them somewhat Windows-compatible CORE-8065 svn path=/trunk/; revision=62714 --- reactos/ntoskrnl/cc/view.c | 43 ++++++++++++------------- reactos/ntoskrnl/include/internal/tag.h | 11 ++++--- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index e151c7a58e9..e72eda1c636 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -1269,32 +1269,31 @@ CcInitView ( InitializeListHead(&DirtyVacbListHead); InitializeListHead(&VacbLruListHead); KeInitializeGuardedMutex(&ViewLock); - ExInitializeNPagedLookasideList (&iBcbLookasideList, - NULL, - NULL, - 0, - sizeof(INTERNAL_BCB), - TAG_IBCB, - 20); - ExInitializeNPagedLookasideList (&SharedCacheMapLookasideList, - NULL, - NULL, - 0, - sizeof(ROS_SHARED_CACHE_MAP), - TAG_BCB, - 20); - ExInitializeNPagedLookasideList (&VacbLookasideList, - NULL, - NULL, - 0, - sizeof(ROS_VACB), - TAG_CSEG, - 20); + ExInitializeNPagedLookasideList(&iBcbLookasideList, + NULL, + NULL, + 0, + sizeof(INTERNAL_BCB), + TAG_BCB, + 20); + ExInitializeNPagedLookasideList(&SharedCacheMapLookasideList, + NULL, + NULL, + 0, + sizeof(ROS_SHARED_CACHE_MAP), + TAG_SHARED_CACHE_MAP, + 20); + ExInitializeNPagedLookasideList(&VacbLookasideList, + NULL, + NULL, + 0, + sizeof(ROS_VACB), + TAG_VACB, + 20); MmInitializeMemoryConsumer(MC_CACHE, CcRosTrimCache); CcInitCacheZeroPage(); - } /* EOF */ diff --git a/reactos/ntoskrnl/include/internal/tag.h b/reactos/ntoskrnl/include/internal/tag.h index 09044c2eefb..1507685b44b 100644 --- a/reactos/ntoskrnl/include/internal/tag.h +++ b/reactos/ntoskrnl/include/internal/tag.h @@ -1,10 +1,11 @@ #pragma once -/* formerly located in cc/view.c */ -#define TAG_CC ' cC' -#define TAG_CSEG 'GESC' -#define TAG_BCB ' BCB' -#define TAG_IBCB 'BCBi' +/* Cache Manager Tags */ +#define TAG_CC ' cC' +#define TAG_VACB 'aVcC' +#define TAG_SHARED_CACHE_MAP 'cScC' +#define TAG_PRIVATE_CACHE_MAP 'cPcC' +#define TAG_BCB 'cBcC' /* Executive Callbacks */ #define TAG_CALLBACK_ROUTINE_BLOCK 'brbC' From 340e5bb7564ad11238ee8266d6a1c6a3d894755c Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 12 Apr 2014 11:19:38 +0000 Subject: [PATCH 293/419] [NTOS:CC] - Rename ROS_SHARED_CACHE_MAP::AllocationSize to SectionSize CORE-8065 svn path=/trunk/; revision=62715 --- reactos/ntoskrnl/cc/copy.c | 8 ++++---- reactos/ntoskrnl/cc/fs.c | 8 ++++---- reactos/ntoskrnl/cc/pin.c | 4 ++-- reactos/ntoskrnl/cc/view.c | 2 +- reactos/ntoskrnl/include/internal/cc.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index ed1bb8a374b..7cd5d3d014e 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -199,7 +199,7 @@ CcReadVirtualAddress ( KEVENT Event; VacbOffset.QuadPart = Vacb->FileOffset; - Size = (ULONG)(Vacb->SharedCacheMap->AllocationSize.QuadPart - Vacb->FileOffset); + Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset); if (Size > VACB_MAPPING_GRANULARITY) { Size = VACB_MAPPING_GRANULARITY; @@ -252,7 +252,7 @@ CcWriteVirtualAddress ( Vacb->Dirty = FALSE; VacbOffset.QuadPart = Vacb->FileOffset; - Size = (ULONG)(Vacb->SharedCacheMap->AllocationSize.QuadPart - Vacb->FileOffset); + Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset); if (Size > VACB_MAPPING_GRANULARITY) { Size = VACB_MAPPING_GRANULARITY; @@ -344,8 +344,8 @@ CcCopyRead ( SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; ReadOffset = (ULONG)FileOffset->QuadPart; - DPRINT("AllocationSize %I64d, FileSize %I64d\n", - SharedCacheMap->AllocationSize.QuadPart, + DPRINT("SectionSize %I64d, FileSize %I64d\n", + SharedCacheMap->SectionSize.QuadPart, SharedCacheMap->FileSize.QuadPart); /* diff --git a/reactos/ntoskrnl/cc/fs.c b/reactos/ntoskrnl/cc/fs.c index d806d38198f..0652891f0da 100644 --- a/reactos/ntoskrnl/cc/fs.c +++ b/reactos/ntoskrnl/cc/fs.c @@ -150,7 +150,7 @@ CcSetFileSizes ( if (SharedCacheMap == NULL) return; - if (FileSizes->AllocationSize.QuadPart < SharedCacheMap->AllocationSize.QuadPart) + if (FileSizes->AllocationSize.QuadPart < SharedCacheMap->SectionSize.QuadPart) { InitializeListHead(&FreeListHead); KeAcquireGuardedMutex(&ViewLock); @@ -185,7 +185,7 @@ CcSetFileSizes ( } } - SharedCacheMap->AllocationSize = FileSizes->AllocationSize; + SharedCacheMap->SectionSize = FileSizes->AllocationSize; SharedCacheMap->FileSize = FileSizes->FileSize; KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); KeReleaseGuardedMutex(&ViewLock); @@ -206,7 +206,7 @@ CcSetFileSizes ( else { KeAcquireSpinLock(&SharedCacheMap->CacheMapLock, &oldirql); - SharedCacheMap->AllocationSize = FileSizes->AllocationSize; + SharedCacheMap->SectionSize = FileSizes->AllocationSize; SharedCacheMap->FileSize = FileSizes->FileSize; KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); } @@ -256,7 +256,7 @@ CcGetFileSizes ( if (!SharedCacheMap) return FALSE; - FileSizes->AllocationSize = SharedCacheMap->AllocationSize; + FileSizes->AllocationSize = SharedCacheMap->SectionSize; FileSizes->FileSize = FileSizes->ValidDataLength = SharedCacheMap->FileSize; return TRUE; } diff --git a/reactos/ntoskrnl/cc/pin.c b/reactos/ntoskrnl/cc/pin.c index 2ab228a6297..a439d78fb11 100644 --- a/reactos/ntoskrnl/cc/pin.c +++ b/reactos/ntoskrnl/cc/pin.c @@ -53,8 +53,8 @@ CcMapData ( SharedCacheMap = FileObject->SectionObjectPointer->SharedCacheMap; ASSERT(SharedCacheMap); - DPRINT("AllocationSize %I64x, FileSize %I64x\n", - SharedCacheMap->AllocationSize.QuadPart, + DPRINT("SectionSize %I64x, FileSize %I64x\n", + SharedCacheMap->SectionSize.QuadPart, SharedCacheMap->FileSize.QuadPart); if (ReadOffset % VACB_MAPPING_GRANULARITY + Length > VACB_MAPPING_GRANULARITY) diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index e72eda1c636..2bce41bdfdf 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -1220,7 +1220,7 @@ CcRosInitializeFileCache ( SharedCacheMap->LazyWriteContext = LazyWriterContext; if (FileObject->FsContext) { - SharedCacheMap->AllocationSize = + SharedCacheMap->SectionSize = ((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->AllocationSize; SharedCacheMap->FileSize = ((PFSRTL_COMMON_FCB_HEADER)FileObject->FsContext)->FileSize; diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index a65de293205..e781e14c15b 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -106,7 +106,7 @@ typedef struct _ROS_SHARED_CACHE_MAP LIST_ENTRY CacheMapVacbListHead; ULONG TimeStamp; PFILE_OBJECT FileObject; - LARGE_INTEGER AllocationSize; + LARGE_INTEGER SectionSize; LARGE_INTEGER FileSize; PCACHE_MANAGER_CALLBACKS Callbacks; PVOID LazyWriteContext; From 417fb8210e719f89999002408c4942e5eafb2ccb Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sat, 12 Apr 2014 11:51:46 +0000 Subject: [PATCH 294/419] [NTOS:CC] - Change ROS_VACB::FileOffset from ULONG to LARGE_INTEGER svn path=/trunk/; revision=62716 --- reactos/ntoskrnl/cc/copy.c | 31 ++++++++++++-------------- reactos/ntoskrnl/cc/fs.c | 2 +- reactos/ntoskrnl/cc/view.c | 22 +++++++++--------- reactos/ntoskrnl/include/internal/cc.h | 12 +++++----- reactos/ntoskrnl/mm/section.c | 2 +- 5 files changed, 34 insertions(+), 35 deletions(-) diff --git a/reactos/ntoskrnl/cc/copy.c b/reactos/ntoskrnl/cc/copy.c index 7cd5d3d014e..d63c36e06ea 100644 --- a/reactos/ntoskrnl/cc/copy.c +++ b/reactos/ntoskrnl/cc/copy.c @@ -66,7 +66,6 @@ ReadVacbChain ( PROS_VACB current; PROS_VACB previous; IO_STATUS_BLOCK Iosb; - LARGE_INTEGER VacbOffset; NTSTATUS Status; ULONG TempLength; KEVENT Event; @@ -141,11 +140,10 @@ ReadVacbChain ( /* * Read in the information. */ - VacbOffset.QuadPart = current->FileOffset; KeInitializeEvent(&Event, NotificationEvent, FALSE); Status = IoPageRead(SharedCacheMap->FileObject, Mdl, - &VacbOffset, + ¤t->FileOffset, &Event, &Iosb); if (Status == STATUS_PENDING) @@ -194,12 +192,10 @@ CcReadVirtualAddress ( ULONG Size; PMDL Mdl; NTSTATUS Status; - LARGE_INTEGER VacbOffset; IO_STATUS_BLOCK IoStatus; KEVENT Event; - VacbOffset.QuadPart = Vacb->FileOffset; - Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset); + Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset.QuadPart); if (Size > VACB_MAPPING_GRANULARITY) { Size = VACB_MAPPING_GRANULARITY; @@ -214,7 +210,7 @@ CcReadVirtualAddress ( MmBuildMdlForNonPagedPool(Mdl); Mdl->MdlFlags |= MDL_IO_PAGE_READ; KeInitializeEvent(&Event, NotificationEvent, FALSE); - Status = IoPageRead(Vacb->SharedCacheMap->FileObject, Mdl, &VacbOffset, &Event, &IoStatus); + Status = IoPageRead(Vacb->SharedCacheMap->FileObject, Mdl, &Vacb->FileOffset, &Event, &IoStatus); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -247,12 +243,10 @@ CcWriteVirtualAddress ( PMDL Mdl; NTSTATUS Status; IO_STATUS_BLOCK IoStatus; - LARGE_INTEGER VacbOffset; KEVENT Event; Vacb->Dirty = FALSE; - VacbOffset.QuadPart = Vacb->FileOffset; - Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset); + Size = (ULONG)(Vacb->SharedCacheMap->SectionSize.QuadPart - Vacb->FileOffset.QuadPart); if (Size > VACB_MAPPING_GRANULARITY) { Size = VACB_MAPPING_GRANULARITY; @@ -277,7 +271,7 @@ CcWriteVirtualAddress ( MmBuildMdlForNonPagedPool(Mdl); Mdl->MdlFlags |= MDL_IO_PAGE_READ; KeInitializeEvent(&Event, NotificationEvent, FALSE); - Status = IoSynchronousPageWrite(Vacb->SharedCacheMap->FileObject, Mdl, &VacbOffset, &Event, &IoStatus); + Status = IoSynchronousPageWrite(Vacb->SharedCacheMap->FileObject, Mdl, &Vacb->FileOffset, &Event, &IoStatus); if (Status == STATUS_PENDING) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); @@ -364,7 +358,8 @@ CcCopyRead ( ROS_VACB, CacheMapVacbListEntry); if (!current->Valid && - DoRangesIntersect(current->FileOffset, VACB_MAPPING_GRANULARITY, + DoRangesIntersect(current->FileOffset.QuadPart, + VACB_MAPPING_GRANULARITY, ReadOffset, Length)) { KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); @@ -372,7 +367,7 @@ CcCopyRead ( IoStatus->Information = 0; return FALSE; } - if (current->FileOffset >= ReadOffset + Length) + if (current->FileOffset.QuadPart >= ReadOffset + Length) break; current_entry = current_entry->Flink; } @@ -482,14 +477,15 @@ CcCopyWrite ( ROS_VACB, CacheMapVacbListEntry); if (!Vacb->Valid && - DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY, + DoRangesIntersect(Vacb->FileOffset.QuadPart, + VACB_MAPPING_GRANULARITY, WriteOffset, Length)) { KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); /* datas not available */ return FALSE; } - if (Vacb->FileOffset >= WriteOffset + Length) + if (Vacb->FileOffset.QuadPart >= WriteOffset + Length) break; current_entry = current_entry->Flink; } @@ -704,14 +700,15 @@ CcZeroData ( ROS_VACB, CacheMapVacbListEntry); if (!Vacb->Valid && - DoRangesIntersect(Vacb->FileOffset, VACB_MAPPING_GRANULARITY, + DoRangesIntersect(Vacb->FileOffset.QuadPart, + VACB_MAPPING_GRANULARITY, WriteOffset.u.LowPart, Length)) { KeReleaseSpinLock(&SharedCacheMap->CacheMapLock, oldirql); /* datas not available */ return FALSE; } - if (Vacb->FileOffset >= WriteOffset.u.LowPart + Length) + if (Vacb->FileOffset.QuadPart >= WriteOffset.u.LowPart + Length) break; current_entry = current_entry->Flink; } diff --git a/reactos/ntoskrnl/cc/fs.c b/reactos/ntoskrnl/cc/fs.c index 0652891f0da..2b95fb19376 100644 --- a/reactos/ntoskrnl/cc/fs.c +++ b/reactos/ntoskrnl/cc/fs.c @@ -163,7 +163,7 @@ CcSetFileSizes ( ROS_VACB, CacheMapVacbListEntry); current_entry = current_entry->Flink; - if (current->FileOffset >= FileSizes->AllocationSize.QuadPart) + if (current->FileOffset.QuadPart >= FileSizes->AllocationSize.QuadPart) { if ((current->ReferenceCount == 0) || ((current->ReferenceCount == 1) && current->Dirty)) { diff --git a/reactos/ntoskrnl/cc/view.c b/reactos/ntoskrnl/cc/view.c index 2bce41bdfdf..0584917098c 100644 --- a/reactos/ntoskrnl/cc/view.c +++ b/reactos/ntoskrnl/cc/view.c @@ -456,7 +456,8 @@ CcRosLookupVacb ( current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry); - if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY, + if (IsPointInRange(current->FileOffset.QuadPart, + VACB_MAPPING_GRANULARITY, FileOffset)) { CcRosVacbIncRefCount(current); @@ -469,7 +470,7 @@ CcRosLookupVacb ( NULL); return current; } - if (current->FileOffset > FileOffset) + if (current->FileOffset.QuadPart > FileOffset) break; current_entry = current_entry->Flink; } @@ -606,7 +607,7 @@ CcRosCreateVacb ( current->Valid = FALSE; current->Dirty = FALSE; current->PageOut = FALSE; - current->FileOffset = ROUND_DOWN(FileOffset, VACB_MAPPING_GRANULARITY); + current->FileOffset.QuadPart = ROUND_DOWN(FileOffset, VACB_MAPPING_GRANULARITY); current->SharedCacheMap = SharedCacheMap; #if DBG if (SharedCacheMap->Trace) @@ -640,7 +641,8 @@ CcRosCreateVacb ( current = CONTAINING_RECORD(current_entry, ROS_VACB, CacheMapVacbListEntry); - if (IsPointInRange(current->FileOffset, VACB_MAPPING_GRANULARITY, + if (IsPointInRange(current->FileOffset.QuadPart, + VACB_MAPPING_GRANULARITY, FileOffset)) { CcRosVacbIncRefCount(current); @@ -665,13 +667,13 @@ CcRosCreateVacb ( NULL); return STATUS_SUCCESS; } - if (current->FileOffset < FileOffset) + if (current->FileOffset.QuadPart < FileOffset) { ASSERT(previous == NULL || - previous->FileOffset < current->FileOffset); + previous->FileOffset.QuadPart < current->FileOffset.QuadPart); previous = current; } - if (current->FileOffset > FileOffset) + if (current->FileOffset.QuadPart > FileOffset) break; current_entry = current_entry->Flink; } @@ -798,7 +800,7 @@ NTAPI CcRosGetVacb ( PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, - PULONG BaseOffset, + PULONGLONG BaseOffset, PVOID* BaseAddress, PBOOLEAN UptoDate, PROS_VACB *Vacb) @@ -841,7 +843,7 @@ CcRosGetVacb ( *BaseAddress = current->BaseAddress; DPRINT("*BaseAddress %p\n", *BaseAddress); *Vacb = current; - *BaseOffset = current->FileOffset; + *BaseOffset = current->FileOffset.QuadPart; return STATUS_SUCCESS; } @@ -857,7 +859,7 @@ CcRosRequestVacb ( * FUNCTION: Request a page mapping for a shared cache map */ { - ULONG BaseOffset; + ULONGLONG BaseOffset; ASSERT(SharedCacheMap); diff --git a/reactos/ntoskrnl/include/internal/cc.h b/reactos/ntoskrnl/include/internal/cc.h index e781e14c15b..57649deec89 100644 --- a/reactos/ntoskrnl/include/internal/cc.h +++ b/reactos/ntoskrnl/include/internal/cc.h @@ -138,7 +138,7 @@ typedef struct _ROS_VACB LIST_ENTRY VacbListEntry; LIST_ENTRY VacbLruListEntry; /* Offset in the file which this view maps. */ - ULONG FileOffset; + LARGE_INTEGER FileOffset; /* Mutex */ KMUTEX Mutex; /* Number of references. */ @@ -187,7 +187,7 @@ NTAPI CcRosGetVacb( PROS_SHARED_CACHE_MAP SharedCacheMap, ULONG FileOffset, - PULONG BaseOffset, + PULONGLONG BaseOffset, PVOID *BaseAddress, PBOOLEAN UptoDate, PROS_VACB *Vacb @@ -305,9 +305,9 @@ CcTryToInitializeFileCache(PFILE_OBJECT FileObject); FORCEINLINE BOOLEAN DoRangesIntersect( - _In_ ULONG Offset1, + _In_ ULONGLONG Offset1, _In_ ULONG Length1, - _In_ ULONG Offset2, + _In_ ULONGLONG Offset2, _In_ ULONG Length2) { if (Offset1 + Length1 <= Offset2) @@ -320,9 +320,9 @@ DoRangesIntersect( FORCEINLINE BOOLEAN IsPointInRange( - _In_ ULONG Offset1, + _In_ ULONGLONG Offset1, _In_ ULONG Length1, - _In_ ULONG Point) + _In_ ULONGLONG Point) { return DoRangesIntersect(Offset1, Length1, Point, 1); } diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index 268e65761e5..ec3b0947678 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -1066,7 +1066,7 @@ MiReadPage(PMEMORY_AREA MemoryArea, * Page - Variable that receives a page contains the read data. */ { - ULONG BaseOffset; + ULONGLONG BaseOffset; ULONGLONG FileOffset; PVOID BaseAddress; BOOLEAN UptoDate; From 77ef29ad7928291ec4e4b8b83badbbbe706725cc Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 12 Apr 2014 12:06:47 +0000 Subject: [PATCH 295/419] [KMTESTS:NPFS] Add tests for volume information query. Could be completed for size, device, full size and attributes query. This is used to validate changes made in r62663. Tested by Thomas. CORE-7451 svn path=/trunk/; revision=62717 --- rostests/kmtests/CMakeLists.txt | 1 + rostests/kmtests/kmtest_drv/testlist.c | 2 + rostests/kmtests/npfs/NpfsVolumeInfo.c | 96 ++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 rostests/kmtests/npfs/NpfsVolumeInfo.c diff --git a/rostests/kmtests/CMakeLists.txt b/rostests/kmtests/CMakeLists.txt index 11d13698407..6a6209cdca6 100644 --- a/rostests/kmtests/CMakeLists.txt +++ b/rostests/kmtests/CMakeLists.txt @@ -32,6 +32,7 @@ list(APPEND KMTEST_DRV_SOURCE npfs/NpfsCreate.c npfs/NpfsHelpers.c npfs/NpfsReadWrite.c + npfs/NpfsVolumeInfo.c ntos_ex/ExCallback.c ntos_ex/ExDoubleList.c ntos_ex/ExFastMutex.c diff --git a/rostests/kmtests/kmtest_drv/testlist.c b/rostests/kmtests/kmtest_drv/testlist.c index 8cb7c06725b..9b35bd18d13 100644 --- a/rostests/kmtests/kmtest_drv/testlist.c +++ b/rostests/kmtests/kmtest_drv/testlist.c @@ -41,6 +41,7 @@ KMT_TESTFUNC Test_MmSection; KMT_TESTFUNC Test_NpfsConnect; KMT_TESTFUNC Test_NpfsCreate; KMT_TESTFUNC Test_NpfsReadWrite; +KMT_TESTFUNC Test_NpfsVolumeInfo; KMT_TESTFUNC Test_ObReference; KMT_TESTFUNC Test_ObType; KMT_TESTFUNC Test_ObTypeClean; @@ -95,6 +96,7 @@ const KMT_TEST TestList[] = { "NpfsConnect", Test_NpfsConnect }, { "NpfsCreate", Test_NpfsCreate }, { "NpfsReadWrite", Test_NpfsReadWrite }, + { "NpfsVolumeInfo", Test_NpfsVolumeInfo }, { "ObReference", Test_ObReference }, { "ObType", Test_ObType }, { "-ObTypeClean", Test_ObTypeClean }, diff --git a/rostests/kmtests/npfs/NpfsVolumeInfo.c b/rostests/kmtests/npfs/NpfsVolumeInfo.c new file mode 100644 index 00000000000..54590d47bf0 --- /dev/null +++ b/rostests/kmtests/npfs/NpfsVolumeInfo.c @@ -0,0 +1,96 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory + * PURPOSE: Kernel-Mode Test Suite NPFS volume information test + * PROGRAMMER: Pierre Schweitzer + */ + +#include +#include "npfs.h" + +#define MAX_INSTANCES 1 +#define IN_QUOTA 4096 +#define OUT_QUOTA 4096 + +static +VOID +TestVolumeInfo( + IN HANDLE ServerHandle) +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + struct { + FILE_FS_VOLUME_INFORMATION; + WCHAR PartialName[2]; + } PartialInfo; + struct { + FILE_FS_VOLUME_INFORMATION; + WCHAR PartialName[10]; + } CompleteInfo; + + Status = ZwQueryVolumeInformationFile(ServerHandle, + &IoStatusBlock, + &CompleteInfo, + sizeof(CompleteInfo), + FileFsVolumeInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_long(CompleteInfo.VolumeCreationTime.LowPart, 0); + ok_eq_long(CompleteInfo.VolumeCreationTime.HighPart, 0); + ok_eq_ulong(CompleteInfo.VolumeSerialNumber, 0); + ok_bool_false(CompleteInfo.SupportsObjects, "CompleteInfo.SupportsObjects"); + ok_eq_ulong(CompleteInfo.VolumeLabelLength, 18); + ok_eq_ulong(IoStatusBlock.Information, 36); + ok_eq_ulong(RtlCompareMemory(CompleteInfo.VolumeLabel, L"NamedPipe", 18), 18); + + Status = ZwQueryVolumeInformationFile(ServerHandle, + &IoStatusBlock, + &PartialInfo, + sizeof(PartialInfo), + FileFsVolumeInformation); + ok_eq_hex(Status, STATUS_BUFFER_OVERFLOW); + ok_eq_hex(IoStatusBlock.Status, STATUS_BUFFER_OVERFLOW); + ok_eq_long(CompleteInfo.VolumeCreationTime.LowPart, 0); + ok_eq_long(CompleteInfo.VolumeCreationTime.HighPart, 0); + ok_eq_ulong(CompleteInfo.VolumeSerialNumber, 0); + ok_bool_false(CompleteInfo.SupportsObjects, "CompleteInfo.SupportsObjects"); + ok_eq_ulong(CompleteInfo.VolumeLabelLength, 18); + ok_eq_ulong(IoStatusBlock.Information, 32); + ok_eq_ulong(RtlCompareMemory(CompleteInfo.VolumeLabel, L"Na", 4), 4); +} + +static KSTART_ROUTINE RunTest; +static +VOID +NTAPI +RunTest( + IN PVOID Context) +{ + NTSTATUS Status; + HANDLE ServerHandle; + + UNREFERENCED_PARAMETER(Context); + + ServerHandle = INVALID_HANDLE_VALUE; + Status = NpCreatePipe(&ServerHandle, + DEVICE_NAMED_PIPE L"\\KmtestNpfsVolumeInfoTestPipe", + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, + MAX_INSTANCES, + IN_QUOTA, + OUT_QUOTA); + ok_eq_hex(Status, STATUS_SUCCESS); + ok(ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE, "ServerHandle = %p\n", ServerHandle); + if (!skip(NT_SUCCESS(Status) && ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE, "No pipe\n")) + { + TestVolumeInfo(ServerHandle); + ObCloseHandle(ServerHandle, KernelMode); + } +} + +START_TEST(NpfsVolumeInfo) +{ + PKTHREAD Thread; + + Thread = KmtStartThread(RunTest, NULL); + KmtFinishThread(Thread, NULL); +} From 85b40a6ccc496cfe90390bc201a670597a3c960e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 12 Apr 2014 14:23:36 +0000 Subject: [PATCH 296/419] [CONSOLE.CPL] Fix various things: - values update when edit controls lose focus, - improve (still WIP) console window preview, - fix screen color preview (now with font!) - use Unicode functions. What remains: - really fix the console window preview, - fully implement the console font selector. CORE-6629 #resolve #comment Fixed in revision 62718. svn path=/trunk/; revision=62718 --- reactos/dll/cpl/console/CMakeLists.txt | 3 +- reactos/dll/cpl/console/colors.c | 148 ++++++++--- reactos/dll/cpl/console/console.c | 124 +++++---- reactos/dll/cpl/console/console.h | 14 +- reactos/dll/cpl/console/layout.c | 343 +++++++++++++++++-------- reactos/dll/cpl/console/options.c | 237 +++++++++-------- 6 files changed, 554 insertions(+), 315 deletions(-) diff --git a/reactos/dll/cpl/console/CMakeLists.txt b/reactos/dll/cpl/console/CMakeLists.txt index a817aea9556..245bc2bab02 100644 --- a/reactos/dll/cpl/console/CMakeLists.txt +++ b/reactos/dll/cpl/console/CMakeLists.txt @@ -18,7 +18,8 @@ add_library(console SHARED console.rc ${CMAKE_CURRENT_BINARY_DIR}/console.def) -set_module_type(console win32dll UNICODE) +set_module_type(console cpl UNICODE) +set_target_properties(console PROPERTIES SUFFIX ".dll") add_importlibs(console msvcrt diff --git a/reactos/dll/cpl/console/colors.c b/reactos/dll/cpl/console/colors.c index 00ddc80ec39..8ddd3a2ac9a 100644 --- a/reactos/dll/cpl/console/colors.c +++ b/reactos/dll/cpl/console/colors.c @@ -22,10 +22,7 @@ PaintStaticControls(HWND hwndDlg, index = min(drawItem->CtlID - IDC_STATIC_COLOR1, sizeof(pConInfo->ci.Colors) / sizeof(pConInfo->ci.Colors[0]) - 1); hBrush = CreateSolidBrush(pConInfo->ci.Colors[index]); - if (!hBrush) - { - return FALSE; - } + if (!hBrush) return FALSE; FillRect(drawItem->hDC, &drawItem->rcItem, hBrush); DeleteObject((HGDIOBJ)hBrush); @@ -44,7 +41,6 @@ ColorsProc(HWND hwndDlg, LPARAM lParam) { PCONSOLE_PROPS pConInfo; - LPDRAWITEMSTRUCT drawItem; DWORD colorIndex; COLORREF color; @@ -58,9 +54,9 @@ ColorsProc(HWND hwndDlg, SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pConInfo); /* Set the valid range of the colour indicators */ - SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_COLOR_RED), UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); - SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_COLOR_GREEN), UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); - SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_COLOR_BLUE), UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); + SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_COLOR_RED , UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); + SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_COLOR_GREEN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); + SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_COLOR_BLUE , UDM_SETRANGE, 0, (LPARAM)MAKELONG(255, 0)); /* Select by default the screen background option */ CheckRadioButton(hwndDlg, IDC_RADIO_SCREEN_TEXT, IDC_RADIO_POPUP_BACKGROUND, IDC_RADIO_SCREEN_BACKGROUND); @@ -71,16 +67,15 @@ ColorsProc(HWND hwndDlg, case WM_DRAWITEM: { - drawItem = (LPDRAWITEMSTRUCT)lParam; + LPDRAWITEMSTRUCT drawItem = (LPDRAWITEMSTRUCT)lParam; + if (drawItem->CtlID >= IDC_STATIC_COLOR1 && drawItem->CtlID <= IDC_STATIC_COLOR16) - { return PaintStaticControls(hwndDlg, pConInfo, drawItem); - } - else if (drawItem->CtlID == IDC_STATIC_SCREEN_COLOR || drawItem->CtlID == IDC_STATIC_POPUP_COLOR) - { - PaintText(drawItem, pConInfo); - return TRUE; - } + else if (drawItem->CtlID == IDC_STATIC_SCREEN_COLOR) + return PaintText(drawItem, pConInfo, Screen); + else if (drawItem->CtlID == IDC_STATIC_POPUP_COLOR) + return PaintText(drawItem, pConInfo, Popup); + break; } @@ -90,7 +85,6 @@ ColorsProc(HWND hwndDlg, { case PSN_APPLY: { - // LPPSHNOTIFY lppsn; if (!pConInfo->AppliedConfig) { return ApplyConsoleInfo(hwndDlg, pConInfo); @@ -114,23 +108,17 @@ ColorsProc(HWND hwndDlg, if (lpnmud->hdr.idFrom == IDC_UPDOWN_COLOR_RED) { - if (lpnmud->iPos < 0) lpnmud->iPos = 0; - else if (lpnmud->iPos > 255) lpnmud->iPos = 255; - + lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 0), 255); color = RGB(lpnmud->iPos, GetGValue(color), GetBValue(color)); } else if (lpnmud->hdr.idFrom == IDC_UPDOWN_COLOR_GREEN) { - if (lpnmud->iPos < 0) lpnmud->iPos = 0; - else if (lpnmud->iPos > 255) lpnmud->iPos = 255; - + lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 0), 255); color = RGB(GetRValue(color), lpnmud->iPos, GetBValue(color)); } else if (lpnmud->hdr.idFrom == IDC_UPDOWN_COLOR_BLUE) { - if (lpnmud->iPos < 0) lpnmud->iPos = 0; - else if (lpnmud->iPos > 255) lpnmud->iPos = 255; - + lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 0), 255); color = RGB(GetRValue(color), GetGValue(color), lpnmud->iPos); } else @@ -141,7 +129,7 @@ ColorsProc(HWND hwndDlg, pConInfo->ci.Colors[colorIndex] = color; InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; @@ -162,15 +150,15 @@ ColorsProc(HWND hwndDlg, color = pConInfo->ci.Colors[colorIndex]; /* Set the values of the colour indicators */ - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, GetRValue(color), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, GetBValue(color), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + pConInfo->ActiveStaticControl), NULL, TRUE); pConInfo->ActiveStaticControl = colorIndex; InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + pConInfo->ActiveStaticControl), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); break; } @@ -181,15 +169,15 @@ ColorsProc(HWND hwndDlg, color = pConInfo->ci.Colors[colorIndex]; /* Set the values of the colour indicators */ - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, GetRValue(color), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, GetBValue(color), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + pConInfo->ActiveStaticControl), NULL, TRUE); pConInfo->ActiveStaticControl = colorIndex; InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + pConInfo->ActiveStaticControl), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); break; } @@ -200,15 +188,15 @@ ColorsProc(HWND hwndDlg, color = pConInfo->ci.Colors[colorIndex]; /* Set the values of the colour indicators */ - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, GetRValue(color), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, GetBValue(color), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + pConInfo->ActiveStaticControl), NULL, TRUE); pConInfo->ActiveStaticControl = colorIndex; InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + pConInfo->ActiveStaticControl), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); break; } @@ -219,17 +207,93 @@ ColorsProc(HWND hwndDlg, color = pConInfo->ci.Colors[colorIndex]; /* Set the values of the colour indicators */ - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, GetRValue(color), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, GetBValue(color), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + pConInfo->ActiveStaticControl), NULL, TRUE); pConInfo->ActiveStaticControl = colorIndex; InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + pConInfo->ActiveStaticControl), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); break; } + + case IDC_EDIT_COLOR_RED: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD red; + + /* Get the current color */ + colorIndex = pConInfo->ActiveStaticControl; + color = pConInfo->ci.Colors[colorIndex]; + + red = GetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, NULL, FALSE); + red = min(max(red, 0), 255); + + color = RGB(red, GetGValue(color), GetBValue(color)); + + pConInfo->ci.Colors[colorIndex] = color; + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + + case IDC_EDIT_COLOR_GREEN: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD green; + + /* Get the current color */ + colorIndex = pConInfo->ActiveStaticControl; + color = pConInfo->ci.Colors[colorIndex]; + + green = GetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, NULL, FALSE); + green = min(max(green, 0), 255); + + color = RGB(GetRValue(color), green, GetBValue(color)); + + pConInfo->ci.Colors[colorIndex] = color; + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + + case IDC_EDIT_COLOR_BLUE: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD blue; + + /* Get the current color */ + colorIndex = pConInfo->ActiveStaticControl; + color = pConInfo->ci.Colors[colorIndex]; + + blue = GetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, NULL, FALSE); + blue = min(max(blue, 0), 255); + + color = RGB(GetRValue(color), GetGValue(color), blue); + + pConInfo->ci.Colors[colorIndex] = color; + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + colorIndex), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); + + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + } if ( HIWORD(wParam) == STN_CLICKED && @@ -245,9 +309,9 @@ ColorsProc(HWND hwndDlg, color = pConInfo->ci.Colors[colorIndex]; - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED, GetRValue(color), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_RED , GetRValue(color), FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_GREEN, GetGValue(color), FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE, GetBValue(color), FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_COLOR_BLUE , GetBValue(color), FALSE); /* Update global struct */ if (IsDlgButtonChecked(hwndDlg, IDC_RADIO_SCREEN_TEXT)) @@ -271,7 +335,7 @@ ColorsProc(HWND hwndDlg, pConInfo->ActiveStaticControl = colorIndex; InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_COLOR1 + pConInfo->ActiveStaticControl), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); - InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); + InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR) , NULL, TRUE); PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; diff --git a/reactos/dll/cpl/console/console.c b/reactos/dll/cpl/console/console.c index 02cf7bfa7d9..b69467be2de 100644 --- a/reactos/dll/cpl/console/console.c +++ b/reactos/dll/cpl/console/console.c @@ -59,16 +59,16 @@ const COLORREF s_Colors[16] = #define CSR_DEFAULT_CURSOR_SIZE 25 static VOID -InitPropSheetPage(PROPSHEETPAGE *psp, +InitPropSheetPage(PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc, LPARAM lParam) { - ZeroMemory(psp, sizeof(PROPSHEETPAGE)); - psp->dwSize = sizeof(PROPSHEETPAGE); + ZeroMemory(psp, sizeof(PROPSHEETPAGEW)); + psp->dwSize = sizeof(PROPSHEETPAGEW); psp->dwFlags = PSP_DEFAULT; psp->hInstance = hApplet; - psp->pszTemplate = MAKEINTRESOURCE(idDlg); + psp->pszTemplate = MAKEINTRESOURCEW(idDlg); psp->pfnDlgProc = DlgProc; psp->lParam = lParam; } @@ -134,24 +134,20 @@ ApplyProc(HWND hwndDlg, WPARAM wParam, LPARAM lParam) { - HWND hDlgCtrl; - UNREFERENCED_PARAMETER(lParam); switch (uMsg) { case WM_INITDIALOG: { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_APPLY_CURRENT); - SendMessage(hDlgCtrl, BM_SETCHECK, BST_CHECKED, 0); + CheckDlgButton(hwndDlg, IDC_RADIO_APPLY_CURRENT, BST_CHECKED); return TRUE; } case WM_COMMAND: { if (LOWORD(wParam) == IDOK) { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_APPLY_CURRENT); - if (SendMessage(hDlgCtrl, BM_GETCHECK, 0, 0) == BST_CHECKED) + if (IsDlgButtonChecked(hwndDlg, IDC_RADIO_APPLY_CURRENT) == BST_CHECKED) EndDialog(hwndDlg, IDC_RADIO_APPLY_CURRENT); else EndDialog(hwndDlg, IDC_RADIO_APPLY_ALL); @@ -187,7 +183,7 @@ ApplyConsoleInfo(HWND hwndDlg, } else { - INT_PTR res = DialogBox(hApplet, MAKEINTRESOURCE(IDD_APPLYOPTIONS), hwndDlg, ApplyProc); + INT_PTR res = DialogBoxW(hApplet, MAKEINTRESOURCEW(IDD_APPLYOPTIONS), hwndDlg, ApplyProc); SetParams = (res != IDCANCEL); SaveParams = (res == IDC_RADIO_APPLY_ALL); @@ -209,12 +205,12 @@ ApplyConsoleInfo(HWND hwndDlg, * Create a memory section to share with the server, and map it. */ /* Holds data for console.dll + console info + terminal-specific info */ - hSection = CreateFileMapping(INVALID_HANDLE_VALUE, - NULL, - PAGE_READWRITE, - 0, - sizeof(CONSOLE_PROPS) + sizeof(GUI_CONSOLE_INFO), - NULL); + hSection = CreateFileMappingW(INVALID_HANDLE_VALUE, + NULL, + PAGE_READWRITE, + 0, + sizeof(CONSOLE_PROPS) + sizeof(GUI_CONSOLE_INFO), + NULL); if (!hSection) { DPRINT1("Error when creating file mapping, error = %d\n", GetLastError()); @@ -264,12 +260,11 @@ LONG APIENTRY InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam) { HANDLE hSection = (HANDLE)wParam; - BOOL GuiTermInfo = FALSE; - PCONSOLE_PROPS pSharedInfo; + PCONSOLE_PROPS pSharedInfo = NULL; PCONSOLE_PROPS pConInfo; WCHAR szTitle[MAX_PATH + 1]; - PROPSHEETPAGE psp[4]; - PROPSHEETHEADER psh; + PROPSHEETPAGEW psp[4]; + PROPSHEETHEADERW psh; INT i = 0; UNREFERENCED_PARAMETER(uMsg); @@ -285,28 +280,54 @@ InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam) pConInfo = AllocConsoleInfo(); if (!pConInfo) return 0; - /* Map the shared section */ - pSharedInfo = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); - if (pSharedInfo == NULL) + /* Check whether we were launched from the terminal... */ + if (hSection != NULL) { - HeapFree(GetProcessHeap(), 0, pConInfo); - return 0; + /* ... yes, map the shared section */ + pSharedInfo = MapViewOfFile(hSection, FILE_MAP_READ, 0, 0, 0); + if (pSharedInfo == NULL) + { + /* Cleanup */ + HeapFree(GetProcessHeap(), 0, pConInfo); + + /* Close the section */ + CloseHandle(hSection); + + return 0; + } + + /* Check that we are really going to modify GUI terminal information... */ + if (pSharedInfo->TerminalInfo.Size != sizeof(GUI_CONSOLE_INFO) || + pSharedInfo->TerminalInfo.TermInfo == 0) + { + /* ... it's not the case, bail out */ + + /* Cleanup */ + HeapFree(GetProcessHeap(), 0, pConInfo); + + /* Close the section */ + UnmapViewOfFile(pSharedInfo); + CloseHandle(hSection); + + return 0; + } + + /* Find the console window and whether we set the default parameters */ + pConInfo->hConsoleWindow = pSharedInfo->hConsoleWindow; + pConInfo->ShowDefaultParams = pSharedInfo->ShowDefaultParams; + } + else + { + /* ... no, we were launched as a CPL. Display the default settings. */ + pConInfo->ShowDefaultParams = TRUE; } - /* Find the console window and whether we must use default parameters */ - pConInfo->hConsoleWindow = pSharedInfo->hConsoleWindow; - pConInfo->ShowDefaultParams = pSharedInfo->ShowDefaultParams; - - /* Check that we are going to modify GUI terminal information */ - GuiTermInfo = ( pSharedInfo->TerminalInfo.Size == sizeof(GUI_CONSOLE_INFO) && - pSharedInfo->TerminalInfo.TermInfo != 0 ); - - if (pConInfo->ShowDefaultParams || !GuiTermInfo) + if (pConInfo->ShowDefaultParams) { /* Use defaults */ InitConsoleDefaults(pConInfo); } - else + else if (hSection && pSharedInfo) { /* * Copy the shared data into our allocated buffer, and @@ -316,13 +337,16 @@ InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam) pConInfo->TerminalInfo.TermInfo = (PVOID)((ULONG_PTR)pConInfo + (ULONG_PTR)pConInfo->TerminalInfo.TermInfo); } - /* Close the section */ - UnmapViewOfFile(pSharedInfo); - CloseHandle(hSection); + if (hSection && pSharedInfo) + { + /* Close the section */ + UnmapViewOfFile(pSharedInfo); + CloseHandle(hSection); + } /* Initialize the property sheet structure */ - ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); - psh.dwSize = sizeof(PROPSHEETHEADER); + ZeroMemory(&psh, sizeof(PROPSHEETHEADERW)); + psh.dwSize = sizeof(PROPSHEETHEADERW); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE | /* PSH_USEHICON */ PSH_USEICONID | PSH_NOAPPLYNOW; if (pConInfo->ci.ConsoleTitle[0] != L'\0') @@ -339,18 +363,18 @@ InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam) psh.hwndParent = pConInfo->hConsoleWindow; psh.hInstance = hApplet; - // psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON)); - psh.pszIcon = MAKEINTRESOURCE(IDC_CPLICON); + // psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCEW(IDC_CPLICON)); + psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON); psh.nPages = 4; psh.nStartPage = 0; psh.ppsp = psp; InitPropSheetPage(&psp[i++], IDD_PROPPAGEOPTIONS, (DLGPROC) OptionsProc, (LPARAM)pConInfo); - InitPropSheetPage(&psp[i++], IDD_PROPPAGEFONT, (DLGPROC) FontProc, (LPARAM)pConInfo); - InitPropSheetPage(&psp[i++], IDD_PROPPAGELAYOUT, (DLGPROC) LayoutProc, (LPARAM)pConInfo); - InitPropSheetPage(&psp[i++], IDD_PROPPAGECOLORS, (DLGPROC) ColorsProc, (LPARAM)pConInfo); + InitPropSheetPage(&psp[i++], IDD_PROPPAGEFONT , (DLGPROC) FontProc , (LPARAM)pConInfo); + InitPropSheetPage(&psp[i++], IDD_PROPPAGELAYOUT , (DLGPROC) LayoutProc , (LPARAM)pConInfo); + InitPropSheetPage(&psp[i++], IDD_PROPPAGECOLORS , (DLGPROC) ColorsProc , (LPARAM)pConInfo); - return (PropertySheet(&psh) != -1); + return (PropertySheetW(&psh) != -1); } /* Control Panel Callback */ @@ -375,9 +399,9 @@ CPlApplet(HWND hwndCPl, case CPL_INQUIRE: { CPLINFO *CPlInfo = (CPLINFO*)lParam2; - CPlInfo->idIcon = Applets[0].idIcon; - CPlInfo->idName = Applets[0].idName; - CPlInfo->idInfo = Applets[0].idDescription; + CPlInfo->idIcon = Applets[0].idIcon; + CPlInfo->idName = Applets[0].idName; + CPlInfo->idInfo = Applets[0].idDescription; break; } diff --git a/reactos/dll/cpl/console/console.h b/reactos/dll/cpl/console/console.h index adce5f9585c..a81c9652861 100644 --- a/reactos/dll/cpl/console/console.h +++ b/reactos/dll/cpl/console/console.h @@ -1,8 +1,7 @@ #ifndef CONSOLE_H__ #define CONSOLE_H__ -#include // just for UINT_MAX in layout.c -#include +#include #define WIN32_NO_STATUS @@ -16,6 +15,9 @@ #include "resource.h" +#define EnableDlgItem(hDlg, nID, bEnable) \ + EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable)) + /* Shared header with the GUI Terminal Front-End from consrv.dll */ #include "consolecpl.h" @@ -27,9 +29,15 @@ typedef struct APPLET_PROC AppletProc; } APPLET, *PAPPLET; +typedef enum _TEXT_TYPE +{ + Screen, + Popup +} TEXT_TYPE; + BOOL ApplyConsoleInfo(HWND hwndDlg, PCONSOLE_PROPS pConInfo); VOID PaintConsole(LPDRAWITEMSTRUCT drawItem, PCONSOLE_PROPS pConInfo); -VOID PaintText(LPDRAWITEMSTRUCT drawItem, PCONSOLE_PROPS pConInfo); +BOOL PaintText(LPDRAWITEMSTRUCT drawItem, PCONSOLE_PROPS pConInfo, TEXT_TYPE TextMode); // Globals extern HINSTANCE hApplet; diff --git a/reactos/dll/cpl/console/layout.c b/reactos/dll/cpl/console/layout.c index 065e00c3c28..e88ac5868eb 100644 --- a/reactos/dll/cpl/console/layout.c +++ b/reactos/dll/cpl/console/layout.c @@ -11,15 +11,15 @@ #define NDEBUG #include -const TCHAR szPreviewText[] = - _T("C:\\ReactOS> dir \n") \ - _T("SYSTEM 13-04-15 5:00a\n") \ - _T("SYSTEM32 13-04-15 5:00a\n") \ - _T("readme txt 1739 13-04-15 5:00a\n") \ - _T("explorer exe 3329536 13-04-15 5:00a\n") \ - _T("vgafonts cab 18736 13-04-15 5:00a\n") \ - _T("setuplog txt 313 13-04-15 5:00a\n") \ - _T("win ini 7005 13-04-15 5:00a\n"); +const WCHAR szPreviewText[] = + L"C:\\ReactOS> dir \n" \ + L"SYSTEM 13-04-15 5:00a\n" \ + L"SYSTEM32 13-04-15 5:00a\n" \ + L"readme txt 1739 13-04-15 5:00a\n" \ + L"explorer exe 3329536 13-04-15 5:00a\n" \ + L"vgafonts cab 18736 13-04-15 5:00a\n" \ + L"setuplog txt 313 13-04-15 5:00a\n" \ + L"win ini 7005 13-04-15 5:00a\n" ; VOID @@ -35,8 +35,10 @@ PaintConsole(LPDRAWITEMSTRUCT drawItem, FillRect(drawItem->hDC, &drawItem->rcItem, GetSysColorBrush(COLOR_BACKGROUND)); - sizex = drawItem->rcItem.right - drawItem->rcItem.left; - sizey = drawItem->rcItem.bottom - drawItem->rcItem.top; + // FIXME: Use: SM_CXSIZE, SM_CYSIZE, SM_CXVSCROLL, SM_CYHSCROLL, SM_CXMIN, SM_CYMIN, SM_CXFRAME, SM_CYFRAME + /* Use it for scaling */ + sizex = drawItem->rcItem.right - drawItem->rcItem.left; + sizey = drawItem->rcItem.bottom - drawItem->rcItem.top ; if ( GuiInfo->WindowOrigin.x == MAXDWORD && GuiInfo->WindowOrigin.y == MAXDWORD ) @@ -48,14 +50,14 @@ PaintConsole(LPDRAWITEMSTRUCT drawItem, { // TODO: // Calculate pos correctly when console centered - startx = sizex / 3; - starty = sizey / 3; + startx = GuiInfo->WindowOrigin.x; + starty = GuiInfo->WindowOrigin.y; } // TODO: - // Strech console when bold fonts are selected - endx = drawItem->rcItem.right - startx + 15; - endy = starty + sizey / 3; + // Stretch console when bold fonts are selected + endx = startx + pConInfo->ci.ConsoleSize.X; // drawItem->rcItem.right - startx + 15; + endy = starty + pConInfo->ci.ConsoleSize.Y; // starty + sizey / 3; /* Draw console size */ SetRect(&cRect, startx, starty, endx, endy); @@ -92,39 +94,71 @@ PaintConsole(LPDRAWITEMSTRUCT drawItem, DeleteObject((HGDIOBJ)hBrush); } -VOID PaintText(LPDRAWITEMSTRUCT drawItem, - PCONSOLE_PROPS pConInfo) +BOOL +PaintText(LPDRAWITEMSTRUCT drawItem, + PCONSOLE_PROPS pConInfo, + TEXT_TYPE TextMode) { + PGUI_CONSOLE_INFO GuiInfo = pConInfo->TerminalInfo.TermInfo; + USHORT CurrentAttrib; COLORREF pbkColor, ptColor; COLORREF nbkColor, ntColor; - HBRUSH hBrush = NULL; + HBRUSH hBrush; + HFONT Font, OldFont; - if (drawItem->CtlID == IDC_STATIC_SCREEN_COLOR) + if (TextMode == Screen) + CurrentAttrib = pConInfo->ci.ScreenAttrib; + else if (TextMode == Popup) + CurrentAttrib = pConInfo->ci.PopupAttrib; + else + return FALSE; + + nbkColor = pConInfo->ci.Colors[BkgdAttribFromAttrib(CurrentAttrib)]; + ntColor = pConInfo->ci.Colors[TextAttribFromAttrib(CurrentAttrib)]; + + hBrush = CreateSolidBrush(nbkColor); + if (!hBrush) return FALSE; + + Font = CreateFontW(LOWORD(GuiInfo->FontSize), + 0, // HIWORD(GuiInfo->FontSize), + 0, + TA_BASELINE, + GuiInfo->FontWeight, + FALSE, + FALSE, + FALSE, + OEM_CHARSET, + OUT_DEFAULT_PRECIS, + CLIP_DEFAULT_PRECIS, + NONANTIALIASED_QUALITY, + FIXED_PITCH | GuiInfo->FontFamily /* FF_DONTCARE */, + GuiInfo->FaceName); + if (Font == NULL) { - nbkColor = pConInfo->ci.Colors[BkgdAttribFromAttrib(pConInfo->ci.ScreenAttrib)]; - hBrush = CreateSolidBrush(nbkColor); - ntColor = pConInfo->ci.Colors[TextAttribFromAttrib(pConInfo->ci.ScreenAttrib)]; - } - else if (drawItem->CtlID == IDC_STATIC_POPUP_COLOR) - { - nbkColor = pConInfo->ci.Colors[BkgdAttribFromAttrib(pConInfo->ci.PopupAttrib)]; - hBrush = CreateSolidBrush(nbkColor); - ntColor = pConInfo->ci.Colors[TextAttribFromAttrib(pConInfo->ci.PopupAttrib)]; + DPRINT1("PaintText: CreateFont failed\n"); + return FALSE; } - if (!hBrush) + OldFont = SelectObject(drawItem->hDC, Font); + if (OldFont == NULL) { - return; + DeleteObject(Font); + return FALSE; } FillRect(drawItem->hDC, &drawItem->rcItem, hBrush); ptColor = SetTextColor(drawItem->hDC, ntColor); pbkColor = SetBkColor(drawItem->hDC, nbkColor); - DrawText(drawItem->hDC, szPreviewText, _tcslen(szPreviewText), &drawItem->rcItem, 0); + DrawTextW(drawItem->hDC, szPreviewText, wcslen(szPreviewText), &drawItem->rcItem, 0); SetTextColor(drawItem->hDC, ptColor); SetBkColor(drawItem->hDC, pbkColor); DeleteObject((HGDIOBJ)hBrush); + + SelectObject(drawItem->hDC, OldFont); + DeleteObject(Font); + + return TRUE; } INT_PTR @@ -134,8 +168,6 @@ LayoutProc(HWND hwndDlg, WPARAM wParam, LPARAM lParam) { - LPNMUPDOWN lpnmud; - LPPSHNOTIFY lppsn; PCONSOLE_PROPS pConInfo = (PCONSOLE_PROPS)GetWindowLongPtr(hwndDlg, DWLP_USER); PGUI_CONSOLE_INFO GuiInfo = (pConInfo ? pConInfo->TerminalInfo.TermInfo : NULL); @@ -146,57 +178,64 @@ LayoutProc(HWND hwndDlg, { case WM_INITDIALOG: { - DWORD xres, yres; - HDC hDC; + /* Multi-monitor support */ + LONG xVirtScr, yVirtScr; // Coordinates of the top-left virtual screen + LONG cxVirtScr, cyVirtScr; // Width and Height of the virtual screen + LONG cxFrame , cyFrame ; // Thickness of the window frame + pConInfo = (PCONSOLE_PROPS)((LPPROPSHEETPAGE)lParam)->lParam; GuiInfo = pConInfo->TerminalInfo.TermInfo; SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pConInfo); - SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_SCREEN_BUFFER_HEIGHT), UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); - SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_SCREEN_BUFFER_WIDTH), UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); - SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_SIZE_HEIGHT), UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); - SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_SIZE_WIDTH), UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); + /* Multi-monitor support */ + xVirtScr = GetSystemMetrics(SM_XVIRTUALSCREEN); + yVirtScr = GetSystemMetrics(SM_YVIRTUALSCREEN); + cxVirtScr = GetSystemMetrics(SM_CXVIRTUALSCREEN); + cyVirtScr = GetSystemMetrics(SM_CYVIRTUALSCREEN); + cxFrame = GetSystemMetrics(SM_CXFRAME); + cyFrame = GetSystemMetrics(SM_CYFRAME); + + SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_SCREEN_BUFFER_HEIGHT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); + SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_SCREEN_BUFFER_WIDTH , UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); + SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_WINDOW_SIZE_HEIGHT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); + SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_WINDOW_SIZE_WIDTH , UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1)); SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, pConInfo->ci.ScreenBufferSize.Y, FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, pConInfo->ci.ScreenBufferSize.X, FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH , pConInfo->ci.ScreenBufferSize.X, FALSE); SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, pConInfo->ci.ConsoleSize.Y, FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, pConInfo->ci.ConsoleSize.X, FALSE); + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH , pConInfo->ci.ConsoleSize.X, FALSE); - hDC = GetDC(NULL); - xres = GetDeviceCaps(hDC, HORZRES); - yres = GetDeviceCaps(hDC, VERTRES); - SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT), UDM_SETRANGE, 0, (LPARAM)MAKELONG(xres, 0)); - SendMessage(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP), UDM_SETRANGE, 0, (LPARAM)MAKELONG(yres, 0)); + SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, UDM_SETRANGE, 0, + (LPARAM)MAKELONG(xVirtScr + cxVirtScr - cxFrame, xVirtScr - cxFrame)); + SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , UDM_SETRANGE, 0, + (LPARAM)MAKELONG(yVirtScr + cyVirtScr - cyFrame, yVirtScr - cyFrame)); - if ( GuiInfo->WindowOrigin.x != MAXDWORD && - GuiInfo->WindowOrigin.y != MAXDWORD ) + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, GuiInfo->WindowOrigin.x, TRUE); + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , GuiInfo->WindowOrigin.y, TRUE); + + if (GuiInfo->AutoPosition) { - SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, GuiInfo->WindowOrigin.x, FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, GuiInfo->WindowOrigin.y, FALSE); - } - else - { - // FIXME: Calculate window pos from xres, yres - SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, 88, FALSE); - SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, 88, FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP), FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_SYSTEM_POS_WINDOW), BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, FALSE); + EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , FALSE); + EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, FALSE); + EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , FALSE); } + CheckDlgButton(hwndDlg, IDC_CHECK_SYSTEM_POS_WINDOW, + GuiInfo->AutoPosition ? BST_CHECKED : BST_UNCHECKED); return TRUE; } + case WM_DRAWITEM: { PaintConsole((LPDRAWITEMSTRUCT)lParam, pConInfo); return TRUE; } + case WM_NOTIFY: { - lpnmud = (LPNMUPDOWN) lParam; - lppsn = (LPPSHNOTIFY) lParam; + LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam; + LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; if (lppsn->hdr.code == UDN_DELTAPOS) { @@ -246,7 +285,7 @@ LayoutProc(HWND hwndDlg, } else { - left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, FALSE); + left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, TRUE); } if (lppsn->hdr.idFrom == IDC_UPDOWN_WINDOW_POS_TOP) @@ -255,7 +294,7 @@ LayoutProc(HWND hwndDlg, } else { - top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, NULL, FALSE); + top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, NULL, TRUE); } if (lppsn->hdr.idFrom == IDC_UPDOWN_WINDOW_SIZE_WIDTH || lppsn->hdr.idFrom == IDC_UPDOWN_WINDOW_SIZE_HEIGHT) @@ -266,13 +305,14 @@ LayoutProc(HWND hwndDlg, SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, wwidth, TRUE); swidth = wwidth; } - if (wheight >= sheight) { SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, wheight, TRUE); sheight = wheight; } } + + /* Be sure that the (new) screen buffer sizes are in the correct range */ swidth = min(max(swidth , 1), 0xFFFF); sheight = min(max(sheight, 1), 0xFFFF); @@ -284,7 +324,6 @@ LayoutProc(HWND hwndDlg, SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, swidth, TRUE); wwidth = swidth; } - if (wheight > sheight) { SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, sheight, TRUE); @@ -302,50 +341,127 @@ LayoutProc(HWND hwndDlg, } break; } + case WM_COMMAND: { switch (LOWORD(wParam)) { case IDC_EDIT_SCREEN_BUFFER_WIDTH: - case IDC_EDIT_SCREEN_BUFFER_HEIGHT: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD swidth, wwidth; + + swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE); + wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH , NULL, FALSE); + + /* Be sure that the (new) screen buffer width is in the correct range */ + swidth = min(max(swidth, 1), 0xFFFF); + + /* Automatically adjust window size when screen buffer decreases */ + if (wwidth > swidth) + { + wwidth = swidth; + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, wwidth, TRUE); + } + + pConInfo->ci.ScreenBufferSize.X = (SHORT)swidth; + pConInfo->ci.ConsoleSize.X = (SHORT)wwidth; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + case IDC_EDIT_WINDOW_SIZE_WIDTH: - case IDC_UPDOWN_WINDOW_SIZE_HEIGHT: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD swidth, wwidth; + + swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE); + wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH , NULL, FALSE); + + /* Automatically adjust screen buffer size when window size enlarges */ + if (wwidth >= swidth) + { + swidth = wwidth; + + /* Be sure that the (new) screen buffer width is in the correct range */ + swidth = min(max(swidth, 1), 0xFFFF); + + SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, swidth, TRUE); + } + + pConInfo->ci.ScreenBufferSize.X = (SHORT)swidth; + pConInfo->ci.ConsoleSize.X = (SHORT)wwidth; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + + case IDC_EDIT_SCREEN_BUFFER_HEIGHT: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD sheight, wheight; + + sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE); + wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT , NULL, FALSE); + + /* Be sure that the (new) screen buffer width is in the correct range */ + sheight = min(max(sheight, 1), 0xFFFF); + + /* Automatically adjust window size when screen buffer decreases */ + if (wheight > sheight) + { + wheight = sheight; + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, wheight, TRUE); + } + + pConInfo->ci.ScreenBufferSize.Y = (SHORT)sheight; + pConInfo->ci.ConsoleSize.Y = (SHORT)wheight; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + + case IDC_EDIT_WINDOW_SIZE_HEIGHT: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD sheight, wheight; + + sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE); + wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT , NULL, FALSE); + + /* Automatically adjust screen buffer size when window size enlarges */ + if (wheight >= sheight) + { + sheight = wheight; + + /* Be sure that the (new) screen buffer width is in the correct range */ + sheight = min(max(sheight, 1), 0xFFFF); + + SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, sheight, TRUE); + } + + pConInfo->ci.ScreenBufferSize.Y = (SHORT)sheight; + pConInfo->ci.ConsoleSize.Y = (SHORT)wheight; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + case IDC_EDIT_WINDOW_POS_LEFT: case IDC_EDIT_WINDOW_POS_TOP: { if (HIWORD(wParam) == EN_KILLFOCUS) { - DWORD wheight, wwidth; - DWORD sheight, swidth; DWORD left, top; - wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, NULL, FALSE); - wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, NULL, FALSE); - swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE); - sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE); - left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, FALSE); - top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, NULL, FALSE); + left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, TRUE); + top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , NULL, TRUE); - swidth = min(max(swidth , 1), 0xFFFF); - sheight = min(max(sheight, 1), 0xFFFF); - - /* Automatically adjust window size when screen buffer decreases */ - if (wwidth > swidth) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, swidth, TRUE); - wwidth = swidth; - } - - if (wheight > sheight) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, sheight, TRUE); - wheight = sheight; - } - - pConInfo->ci.ScreenBufferSize.X = (SHORT)swidth; - pConInfo->ci.ScreenBufferSize.Y = (SHORT)sheight; - pConInfo->ci.ConsoleSize.X = (SHORT)wwidth; - pConInfo->ci.ConsoleSize.Y = (SHORT)wheight; GuiInfo->WindowOrigin.x = left; GuiInfo->WindowOrigin.y = top; PropSheet_Changed(GetParent(hwndDlg), hwndDlg); @@ -360,29 +476,36 @@ LayoutProc(HWND hwndDlg, { ULONG left, top; - left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, FALSE); - top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, NULL, FALSE); + left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, TRUE); + top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , NULL, TRUE); + + GuiInfo->AutoPosition = FALSE; GuiInfo->WindowOrigin.x = left; GuiInfo->WindowOrigin.y = top; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT), TRUE); - EnableWindow(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP), TRUE); + EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, TRUE); + EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , TRUE); + EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, TRUE); + EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , TRUE); } else if (res == BST_UNCHECKED) { - GuiInfo->WindowOrigin.x = UINT_MAX; - GuiInfo->WindowOrigin.y = UINT_MAX; + GuiInfo->AutoPosition = TRUE; + // Do not touch GuiInfo->WindowOrigin !! + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP), FALSE); + EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, FALSE); + EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , FALSE); + EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, FALSE); + EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , FALSE); } } } } + default: break; } diff --git a/reactos/dll/cpl/console/options.c b/reactos/dll/cpl/console/options.c index d445871ac39..d0e5bc5a809 100644 --- a/reactos/dll/cpl/console/options.c +++ b/reactos/dll/cpl/console/options.c @@ -11,9 +11,85 @@ #define NDEBUG #include -static -void -UpdateDialogElements(HWND hwndDlg, PCONSOLE_PROPS pConInfo); +static void +UpdateDialogElements(HWND hwndDlg, PCONSOLE_PROPS pConInfo) +{ + PGUI_CONSOLE_INFO GuiInfo = pConInfo->TerminalInfo.TermInfo; + HWND hDlgCtrl; + + /* Update cursor size */ + if (pConInfo->ci.CursorSize <= 25) + { + /* Small cursor */ + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + } + else if (pConInfo->ci.CursorSize <= 50) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + } + else /* if (pConInfo->ci.CursorSize <= 100) */ + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + } + + /* Update num buffers */ + hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_NUM_BUFFER); + SendMessage(hDlgCtrl, UDM_SETRANGE, 0, MAKELONG(999, 1)); + SetDlgItemInt(hwndDlg, IDC_EDIT_NUM_BUFFER, pConInfo->ci.NumberOfHistoryBuffers, FALSE); + + /* Update buffer size */ + hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_BUFFER_SIZE); + SendMessage(hDlgCtrl, UDM_SETRANGE, 0, MAKELONG(999, 1)); + SetDlgItemInt(hwndDlg, IDC_EDIT_BUFFER_SIZE, pConInfo->ci.HistoryBufferSize, FALSE); + + /* Update discard duplicates */ + CheckDlgButton(hwndDlg, IDC_CHECK_DISCARD_DUPLICATES, + pConInfo->ci.HistoryNoDup ? BST_CHECKED : BST_UNCHECKED); + + /* Update full/window screen */ + if (GuiInfo->FullScreen) + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_FULL); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_WINDOW); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + } + else + { + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_WINDOW); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); + + hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_FULL); + SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); + } + + /* Update quick edit */ + CheckDlgButton(hwndDlg, IDC_CHECK_QUICK_EDIT, + pConInfo->ci.QuickEdit ? BST_CHECKED : BST_UNCHECKED); + + /* Update insert mode */ + CheckDlgButton(hwndDlg, IDC_CHECK_INSERT_MODE, + pConInfo->ci.InsertMode ? BST_CHECKED : BST_UNCHECKED); +} INT_PTR CALLBACK @@ -24,9 +100,6 @@ OptionsProc(HWND hwndDlg, { PCONSOLE_PROPS pConInfo; PGUI_CONSOLE_INFO GuiInfo; - LRESULT lResult; - HWND hDlgCtrl; - LPPSHNOTIFY lppsn; pConInfo = (PCONSOLE_PROPS)GetWindowLongPtr(hwndDlg, DWLP_USER); @@ -39,19 +112,28 @@ OptionsProc(HWND hwndDlg, UpdateDialogElements(hwndDlg, pConInfo); return TRUE; } + case WM_NOTIFY: { - if (!pConInfo) break; + LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam; + LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; + + // if (!pConInfo) break; - lppsn = (LPPSHNOTIFY) lParam; if (lppsn->hdr.code == UDN_DELTAPOS) { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_BUFFER_SIZE); - pConInfo->ci.HistoryBufferSize = LOWORD(SendMessage(hDlgCtrl, UDM_GETPOS, 0, 0)); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_NUM_BUFFER); - pConInfo->ci.NumberOfHistoryBuffers = LOWORD(SendMessage(hDlgCtrl, UDM_GETPOS, 0, 0)); - PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + if (lppsn->hdr.idFrom == IDC_UPDOWN_BUFFER_SIZE) + { + lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 1), 999); + pConInfo->ci.HistoryBufferSize = lpnmud->iPos; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + else if (lppsn->hdr.idFrom == IDC_UPDOWN_NUM_BUFFER) + { + lpnmud->iPos = min(max(lpnmud->iPos + lpnmud->iDelta, 1), 999); + pConInfo->ci.NumberOfHistoryBuffers = lpnmud->iPos; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } } else if (lppsn->hdr.code == PSN_APPLY) { @@ -68,8 +150,11 @@ OptionsProc(HWND hwndDlg, } break; } + case WM_COMMAND: { + LRESULT lResult; + if (!pConInfo) break; GuiInfo = pConInfo->TerminalInfo.TermInfo; @@ -153,109 +238,43 @@ OptionsProc(HWND hwndDlg, PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; } + case IDC_EDIT_BUFFER_SIZE: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD sizeBuff; + + sizeBuff = GetDlgItemInt(hwndDlg, IDC_EDIT_BUFFER_SIZE, NULL, FALSE); + sizeBuff = min(max(sizeBuff, 1), 999); + + pConInfo->ci.HistoryBufferSize = sizeBuff; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + case IDC_EDIT_NUM_BUFFER: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD numBuff; + + numBuff = GetDlgItemInt(hwndDlg, IDC_EDIT_NUM_BUFFER, NULL, FALSE); + numBuff = min(max(numBuff, 1), 999); + + pConInfo->ci.NumberOfHistoryBuffers = numBuff; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } default: break; } break; } + default: break; } return FALSE; } - -static -void -UpdateDialogElements(HWND hwndDlg, PCONSOLE_PROPS pConInfo) -{ - PGUI_CONSOLE_INFO GuiInfo = pConInfo->TerminalInfo.TermInfo; - HWND hDlgCtrl; - TCHAR szBuffer[MAX_PATH]; - - /* Update cursor size */ - if (pConInfo->ci.CursorSize <= 25) - { - /* Small cursor */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else if (pConInfo->ci.CursorSize <= 50) - { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - else /* if (pConInfo->ci.CursorSize <= 100) */ - { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_LARGE_CURSOR); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_SMALL_CURSOR); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_MEDIUM_CURSOR); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0); - } - - /* Update num buffers */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_NUM_BUFFER); - SendMessage(hDlgCtrl, UDM_SETRANGE, 0, MAKELONG((short)999, (short)1)); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_NUM_BUFFER); - _stprintf(szBuffer, _T("%d"), pConInfo->ci.NumberOfHistoryBuffers); - SendMessage(hDlgCtrl, WM_SETTEXT, 0, (LPARAM)szBuffer); - - /* Update buffer size */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_UPDOWN_BUFFER_SIZE); - SendMessage(hDlgCtrl, UDM_SETRANGE, 0, MAKELONG((short)999, (short)1)); - hDlgCtrl = GetDlgItem(hwndDlg, IDC_EDIT_BUFFER_SIZE); - _stprintf(szBuffer, _T("%d"), pConInfo->ci.HistoryBufferSize); - SendMessage(hDlgCtrl, WM_SETTEXT, 0, (LPARAM)szBuffer); - - /* Update discard duplicates */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_DISCARD_DUPLICATES); - if (pConInfo->ci.HistoryNoDup) - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - else - SendMessage(hDlgCtrl, BM_SETCHECK, (LPARAM)BST_UNCHECKED, 0); - - /* Update full/window screen */ - if (GuiInfo->FullScreen) - { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_FULL); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_WINDOW); - SendMessage(hDlgCtrl, BM_SETCHECK, (LPARAM)BST_UNCHECKED, 0); - } - else - { - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_WINDOW); - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - - hDlgCtrl = GetDlgItem(hwndDlg, IDC_RADIO_DISPLAY_FULL); - SendMessage(hDlgCtrl, BM_SETCHECK, (LPARAM)BST_UNCHECKED, 0); - } - - /* Update quick edit */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_QUICK_EDIT); - if (pConInfo->ci.QuickEdit) - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - else - SendMessage(hDlgCtrl, BM_SETCHECK, (LPARAM)BST_UNCHECKED, 0); - - /* Update insert mode */ - hDlgCtrl = GetDlgItem(hwndDlg, IDC_CHECK_INSERT_MODE); - if (pConInfo->ci.InsertMode) - SendMessage(hDlgCtrl, BM_SETCHECK, (WPARAM)BST_CHECKED, 0); - else - SendMessage(hDlgCtrl, BM_SETCHECK, (LPARAM)BST_UNCHECKED, 0); -} From 9d33160552f033b57666e1eab83aa8f76dd8e978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 12 Apr 2014 14:27:36 +0000 Subject: [PATCH 297/419] Fix build. svn path=/trunk/; revision=62719 --- reactos/dll/cpl/console/font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/cpl/console/font.c b/reactos/dll/cpl/console/font.c index a65b7786d1e..a2651040678 100644 --- a/reactos/dll/cpl/console/font.c +++ b/reactos/dll/cpl/console/font.c @@ -41,7 +41,7 @@ FontProc(HWND hwndDlg, } else if (drawItem->CtlID == IDC_STATIC_SELECT_FONT_PREVIEW) { - PaintText(drawItem, pConInfo); + PaintText(drawItem, pConInfo, Screen); } return TRUE; } From f5431ba0ec8336254aa2dc9b337879e0e573bdaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 12 Apr 2014 15:02:02 +0000 Subject: [PATCH 298/419] [CONSOLE.CPL] Fix setting default parameters. svn path=/trunk/; revision=62720 --- reactos/dll/cpl/console/console.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/reactos/dll/cpl/console/console.c b/reactos/dll/cpl/console/console.c index b69467be2de..bd4950f39ae 100644 --- a/reactos/dll/cpl/console/console.c +++ b/reactos/dll/cpl/console/console.c @@ -296,22 +296,6 @@ InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam) return 0; } - /* Check that we are really going to modify GUI terminal information... */ - if (pSharedInfo->TerminalInfo.Size != sizeof(GUI_CONSOLE_INFO) || - pSharedInfo->TerminalInfo.TermInfo == 0) - { - /* ... it's not the case, bail out */ - - /* Cleanup */ - HeapFree(GetProcessHeap(), 0, pConInfo); - - /* Close the section */ - UnmapViewOfFile(pSharedInfo); - CloseHandle(hSection); - - return 0; - } - /* Find the console window and whether we set the default parameters */ pConInfo->hConsoleWindow = pSharedInfo->hConsoleWindow; pConInfo->ShowDefaultParams = pSharedInfo->ShowDefaultParams; @@ -333,6 +317,13 @@ InitApplet(HWND hWnd, UINT uMsg, LPARAM wParam, LPARAM lParam) * Copy the shared data into our allocated buffer, and * de-offsetize the address of terminal-specific information. */ + + /* Check that we are really going to modify GUI terminal information */ + // FIXME: Do something clever, for example copy the UI-independent part + // and init the UI-dependent part to some default values... + ASSERT(pSharedInfo->TerminalInfo.Size == sizeof(GUI_CONSOLE_INFO)); + ASSERT(pSharedInfo->TerminalInfo.TermInfo); + RtlCopyMemory(pConInfo, pSharedInfo, sizeof(CONSOLE_PROPS) + sizeof(GUI_CONSOLE_INFO)); pConInfo->TerminalInfo.TermInfo = (PVOID)((ULONG_PTR)pConInfo + (ULONG_PTR)pConInfo->TerminalInfo.TermInfo); } From ffd100f622a723970cfa92af79faa3433e6a9d39 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 12 Apr 2014 18:37:44 +0000 Subject: [PATCH 299/419] [KMTESTS:NPFS] - Add more tests for volume info - Fix previous tests - Add two helper macros Tested by Thomas. CORE-7451 svn path=/trunk/; revision=62721 --- rostests/kmtests/include/kmt_test.h | 2 + rostests/kmtests/npfs/NpfsVolumeInfo.c | 165 +++++++++++++++++++++---- 2 files changed, 145 insertions(+), 22 deletions(-) diff --git a/rostests/kmtests/include/kmt_test.h b/rostests/kmtests/include/kmt_test.h index e8273427878..a0e6139818c 100644 --- a/rostests/kmtests/include/kmt_test.h +++ b/rostests/kmtests/include/kmt_test.h @@ -190,6 +190,8 @@ VOID KmtFreeGuarded(PVOID Pointer); #define ok_eq_ulong(value, expected) ok_eq_print(value, expected, "%lu") #define ok_eq_longlong(value, expected) ok_eq_print(value, expected, "%I64d") #define ok_eq_ulonglong(value, expected) ok_eq_print(value, expected, "%I64u") +#define ok_eq_char(value, expected) ok_eq_print(value, expected, "%c") +#define ok_eq_wchar(value, expected) ok_eq_print(value, expected, "%C") #ifndef _WIN64 #define ok_eq_size(value, expected) ok_eq_print(value, (SIZE_T)(expected), "%lu") #define ok_eq_longptr(value, expected) ok_eq_print(value, (LONG_PTR)(expected), "%ld") diff --git a/rostests/kmtests/npfs/NpfsVolumeInfo.c b/rostests/kmtests/npfs/NpfsVolumeInfo.c index 54590d47bf0..d09d80d6364 100644 --- a/rostests/kmtests/npfs/NpfsVolumeInfo.c +++ b/rostests/kmtests/npfs/NpfsVolumeInfo.c @@ -19,44 +19,165 @@ TestVolumeInfo( { NTSTATUS Status; IO_STATUS_BLOCK IoStatusBlock; - struct { - FILE_FS_VOLUME_INFORMATION; - WCHAR PartialName[2]; - } PartialInfo; + FILE_FS_SIZE_INFORMATION FileFsSizeInfo; + FILE_FS_DEVICE_INFORMATION FileFsDeviceInfo; + FILE_FS_FULL_SIZE_INFORMATION FileFsFullSizeInfo; + struct { FILE_FS_VOLUME_INFORMATION; WCHAR PartialName[10]; - } CompleteInfo; + } VolumeInfo; + struct { + FILE_FS_ATTRIBUTE_INFORMATION; + WCHAR PartialName[6]; + } AttributeInfo; + + RtlFillMemory(&VolumeInfo, sizeof(VolumeInfo), 0xFF); Status = ZwQueryVolumeInformationFile(ServerHandle, &IoStatusBlock, - &CompleteInfo, - sizeof(CompleteInfo), + &VolumeInfo, + sizeof(VolumeInfo), FileFsVolumeInformation); ok_eq_hex(Status, STATUS_SUCCESS); ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); - ok_eq_long(CompleteInfo.VolumeCreationTime.LowPart, 0); - ok_eq_long(CompleteInfo.VolumeCreationTime.HighPart, 0); - ok_eq_ulong(CompleteInfo.VolumeSerialNumber, 0); - ok_bool_false(CompleteInfo.SupportsObjects, "CompleteInfo.SupportsObjects"); - ok_eq_ulong(CompleteInfo.VolumeLabelLength, 18); + ok_eq_long(VolumeInfo.VolumeCreationTime.LowPart, 0); + ok_eq_long(VolumeInfo.VolumeCreationTime.HighPart, 0); + ok_eq_ulong(VolumeInfo.VolumeSerialNumber, 0); + ok_bool_false(VolumeInfo.SupportsObjects, "VolumeInfo.SupportsObjects"); + ok_eq_ulong(VolumeInfo.VolumeLabelLength, 18); + ok_eq_size(RtlCompareMemory(VolumeInfo.VolumeLabel, L"NamedPipe", 18), 18); + ok_eq_wchar(VolumeInfo.VolumeLabel[9], 0xFFFF); ok_eq_ulong(IoStatusBlock.Information, 36); - ok_eq_ulong(RtlCompareMemory(CompleteInfo.VolumeLabel, L"NamedPipe", 18), 18); + RtlFillMemory(&VolumeInfo, sizeof(VolumeInfo), 0xFF); Status = ZwQueryVolumeInformationFile(ServerHandle, &IoStatusBlock, - &PartialInfo, - sizeof(PartialInfo), + &VolumeInfo, + sizeof(FILE_FS_VOLUME_INFORMATION) + 2 * sizeof(WCHAR), FileFsVolumeInformation); ok_eq_hex(Status, STATUS_BUFFER_OVERFLOW); ok_eq_hex(IoStatusBlock.Status, STATUS_BUFFER_OVERFLOW); - ok_eq_long(CompleteInfo.VolumeCreationTime.LowPart, 0); - ok_eq_long(CompleteInfo.VolumeCreationTime.HighPart, 0); - ok_eq_ulong(CompleteInfo.VolumeSerialNumber, 0); - ok_bool_false(CompleteInfo.SupportsObjects, "CompleteInfo.SupportsObjects"); - ok_eq_ulong(CompleteInfo.VolumeLabelLength, 18); - ok_eq_ulong(IoStatusBlock.Information, 32); - ok_eq_ulong(RtlCompareMemory(CompleteInfo.VolumeLabel, L"Na", 4), 4); + ok_eq_long(VolumeInfo.VolumeCreationTime.LowPart, 0); + ok_eq_long(VolumeInfo.VolumeCreationTime.HighPart, 0); + ok_eq_ulong(VolumeInfo.VolumeSerialNumber, 0); + ok_bool_false(VolumeInfo.SupportsObjects, "VolumeInfo.SupportsObjects"); + ok_eq_ulong(VolumeInfo.VolumeLabelLength, 18); + ok_eq_size(RtlCompareMemory(VolumeInfo.VolumeLabel, L"NamedP", 10), 10); + ok_eq_wchar(VolumeInfo.VolumeLabel[5], 0xFFFF); + ok_eq_ulong(IoStatusBlock.Information, 28); + + RtlFillMemory(&FileFsSizeInfo, sizeof(FileFsSizeInfo), 0xFF); + Status = ZwQueryVolumeInformationFile(ServerHandle, + &IoStatusBlock, + &FileFsSizeInfo, + sizeof(FileFsSizeInfo), + FileFsSizeInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_longlong(FileFsSizeInfo.TotalAllocationUnits.QuadPart, 0); + ok_eq_longlong(FileFsSizeInfo.AvailableAllocationUnits.QuadPart, 0); + ok_eq_ulong(FileFsSizeInfo.SectorsPerAllocationUnit, 1); + ok_eq_ulong(FileFsSizeInfo.BytesPerSector, 1); + ok_eq_ulong(IoStatusBlock.Information, sizeof(FileFsSizeInfo)); + + RtlFillMemory(&FileFsSizeInfo, sizeof(FileFsSizeInfo), 0xFF); + Status = ZwQueryVolumeInformationFile(ServerHandle, + &IoStatusBlock, + &FileFsSizeInfo, + sizeof(FileFsSizeInfo) - 4, + FileFsSizeInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_longlong(FileFsSizeInfo.TotalAllocationUnits.QuadPart, 0); + ok_eq_longlong(FileFsSizeInfo.AvailableAllocationUnits.QuadPart, 0); + ok_eq_ulong(FileFsSizeInfo.SectorsPerAllocationUnit, 1); + ok_eq_ulong(FileFsSizeInfo.BytesPerSector, 1); + ok_eq_ulong(IoStatusBlock.Information, sizeof(FileFsSizeInfo)); + + RtlFillMemory(&FileFsDeviceInfo, sizeof(FileFsDeviceInfo), 0xFF); + Status = ZwQueryVolumeInformationFile(ServerHandle, + &IoStatusBlock, + &FileFsDeviceInfo, + sizeof(FileFsDeviceInfo), + FileFsDeviceInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_ulong(FileFsDeviceInfo.Characteristics, 0); + ok_eq_ulong(FileFsDeviceInfo.DeviceType, FILE_DEVICE_NAMED_PIPE); + ok_eq_ulong(IoStatusBlock.Information, sizeof(FileFsDeviceInfo)); + + RtlFillMemory(&FileFsDeviceInfo, sizeof(FileFsDeviceInfo), 0xFF); + Status = ZwQueryVolumeInformationFile(ServerHandle, + &IoStatusBlock, + &FileFsDeviceInfo, + sizeof(FileFsDeviceInfo) - 4, + FileFsDeviceInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_ulong(FileFsDeviceInfo.Characteristics, 0); + ok_eq_ulong(FileFsDeviceInfo.DeviceType, FILE_DEVICE_NAMED_PIPE); + ok_eq_ulong(IoStatusBlock.Information, sizeof(FileFsDeviceInfo)); + + RtlFillMemory(&AttributeInfo, sizeof(AttributeInfo), 0xFF); + Status = ZwQueryVolumeInformationFile(ServerHandle, + &IoStatusBlock, + &AttributeInfo, + sizeof(AttributeInfo), + FileFsAttributeInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_ulong(AttributeInfo.FileSystemAttributes, FILE_CASE_PRESERVED_NAMES); + ok_eq_long(AttributeInfo.MaximumComponentNameLength, 0xFFFFFFFF); + ok_eq_ulong(AttributeInfo.FileSystemNameLength, 8); + ok_eq_size(RtlCompareMemory(AttributeInfo.FileSystemName, L"NPFS", 8), 8); + ok_eq_wchar(AttributeInfo.FileSystemName[4], 0xFFFF); + ok_eq_ulong(IoStatusBlock.Information, 20); + + RtlFillMemory(&AttributeInfo, sizeof(AttributeInfo), 0xFF); + Status = ZwQueryVolumeInformationFile(ServerHandle, + &IoStatusBlock, + &AttributeInfo, + sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 2 * sizeof(WCHAR), + FileFsAttributeInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_ulong(AttributeInfo.FileSystemAttributes, FILE_CASE_PRESERVED_NAMES); + ok_eq_long(AttributeInfo.MaximumComponentNameLength, 0xFFFFFFFF); + ok_eq_ulong(AttributeInfo.FileSystemNameLength, 8); + ok_eq_size(RtlCompareMemory(AttributeInfo.FileSystemName, L"NPFS", 8), 8); + ok_eq_wchar(AttributeInfo.FileSystemName[4], 0xFFFF); + ok_eq_ulong(IoStatusBlock.Information, 20); + + RtlFillMemory(&FileFsFullSizeInfo, sizeof(FileFsFullSizeInfo), 0xFF); + Status = ZwQueryVolumeInformationFile(ServerHandle, + &IoStatusBlock, + &FileFsFullSizeInfo, + sizeof(FileFsFullSizeInfo), + FileFsFullSizeInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_longlong(FileFsFullSizeInfo.TotalAllocationUnits.QuadPart, 0); + ok_eq_longlong(FileFsFullSizeInfo.CallerAvailableAllocationUnits.QuadPart, 0); + ok_eq_longlong(FileFsFullSizeInfo.ActualAvailableAllocationUnits.QuadPart, 0); + ok_eq_ulong(FileFsFullSizeInfo.SectorsPerAllocationUnit, 0); + ok_eq_ulong(FileFsFullSizeInfo.BytesPerSector, 0); + ok_eq_ulong(IoStatusBlock.Information, sizeof(FileFsFullSizeInfo)); + + RtlFillMemory(&FileFsFullSizeInfo, sizeof(FileFsFullSizeInfo), 0xFF); + Status = ZwQueryVolumeInformationFile(ServerHandle, + &IoStatusBlock, + &FileFsFullSizeInfo, + sizeof(FileFsFullSizeInfo) - 4, + FileFsFullSizeInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_longlong(FileFsFullSizeInfo.TotalAllocationUnits.QuadPart, 0); + ok_eq_longlong(FileFsFullSizeInfo.CallerAvailableAllocationUnits.QuadPart, 0); + ok_eq_longlong(FileFsFullSizeInfo.ActualAvailableAllocationUnits.QuadPart, 0); + ok_eq_ulong(FileFsFullSizeInfo.SectorsPerAllocationUnit, 0); + ok_eq_ulong(FileFsFullSizeInfo.BytesPerSector, 0); + ok_eq_ulong(IoStatusBlock.Information, sizeof(FileFsFullSizeInfo)); } static KSTART_ROUTINE RunTest; From df69eedf4b4d2a595efdfddf77b0e17f34d72b99 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 12 Apr 2014 21:03:03 +0000 Subject: [PATCH 300/419] [SYSDM] - Simplify the message box code. - Inform the user that a reboot is requied when the pagefile settings have changed. svn path=/trunk/; revision=62722 --- reactos/dll/cpl/sysdm/lang/bg-BG.rc | 1 + reactos/dll/cpl/sysdm/lang/cs-CZ.rc | 1 + reactos/dll/cpl/sysdm/lang/da-DK.rc | 1 + reactos/dll/cpl/sysdm/lang/de-DE.rc | 1 + reactos/dll/cpl/sysdm/lang/el-GR.rc | 1 + reactos/dll/cpl/sysdm/lang/en-US.rc | 1 + reactos/dll/cpl/sysdm/lang/es-ES.rc | 1 + reactos/dll/cpl/sysdm/lang/fr-FR.rc | 1 + reactos/dll/cpl/sysdm/lang/he-IL.rc | 1 + reactos/dll/cpl/sysdm/lang/hu-HU.rc | 1 + reactos/dll/cpl/sysdm/lang/id-ID.rc | 1 + reactos/dll/cpl/sysdm/lang/it-IT.rc | 1 + reactos/dll/cpl/sysdm/lang/ja-JP.rc | 1 + reactos/dll/cpl/sysdm/lang/nl-NL.rc | 1 + reactos/dll/cpl/sysdm/lang/no-NO.rc | 1 + reactos/dll/cpl/sysdm/lang/pl-PL.rc | 1 + reactos/dll/cpl/sysdm/lang/ro-RO.rc | 1 + reactos/dll/cpl/sysdm/lang/ru-RU.rc | 1 + reactos/dll/cpl/sysdm/lang/sk-SK.rc | 1 + reactos/dll/cpl/sysdm/lang/sq-AL.rc | 1 + reactos/dll/cpl/sysdm/lang/sv-SE.rc | 1 + reactos/dll/cpl/sysdm/lang/tr-TR.rc | 1 + reactos/dll/cpl/sysdm/lang/uk-UA.rc | 1 + reactos/dll/cpl/sysdm/lang/zh-CN.rc | 1 + reactos/dll/cpl/sysdm/precomp.h | 11 ++- reactos/dll/cpl/sysdm/resource.h | 1 + reactos/dll/cpl/sysdm/sysdm.c | 22 ++++++ reactos/dll/cpl/sysdm/virtmem.c | 114 +++++++++++----------------- 28 files changed, 100 insertions(+), 72 deletions(-) diff --git a/reactos/dll/cpl/sysdm/lang/bg-BG.rc b/reactos/dll/cpl/sysdm/lang/bg-BG.rc index 1a6655dfdd7..d9fd309f8f2 100644 --- a/reactos/dll/cpl/sysdm/lang/bg-BG.rc +++ b/reactos/dll/cpl/sysdm/lang/bg-BG.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "Върховият размер на страниращия файл не трябва да е по-малък от началния и не трябва да надвишава свободното пространство на избраното устройство" IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/cs-CZ.rc b/reactos/dll/cpl/sysdm/lang/cs-CZ.rc index 1725a2f7a47..fb6e315fbd2 100644 --- a/reactos/dll/cpl/sysdm/lang/cs-CZ.rc +++ b/reactos/dll/cpl/sysdm/lang/cs-CZ.rc @@ -282,5 +282,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "Maximální velikost stránkovacího souboru nesmí být menší než velikost výchozí a nesmí překročit množství volného místa na zvolené diskové jednotce." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/da-DK.rc b/reactos/dll/cpl/sysdm/lang/da-DK.rc index 1f15f3d3570..49c61680f13 100644 --- a/reactos/dll/cpl/sysdm/lang/da-DK.rc +++ b/reactos/dll/cpl/sysdm/lang/da-DK.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/de-DE.rc b/reactos/dll/cpl/sysdm/lang/de-DE.rc index 166a96ad946..ed64877acea 100644 --- a/reactos/dll/cpl/sysdm/lang/de-DE.rc +++ b/reactos/dll/cpl/sysdm/lang/de-DE.rc @@ -286,5 +286,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "Die Maximalgröße der Auslagerungsdatei darf nicht kleiner als die Anfangsgröße sein und darf den verfügbaren Speicherplatz auf dem gewählten Laufwerk nicht überschreiten." IDS_PAGEFILE_NONE "Keine" IDS_PAGEFILE_SYSTEM "Systemverwaltet" + IDS_INFOREBOOT "Sie müssen den Computer neu starten, damit die Änderung wirksam wird." IDS_DEVS "\nReactOS Team\n\nProjektkoordinator\n\nAleksey Bragin\n\nEntwicklerteam\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Verantwortliche\n\nColin Finck\nZ98\n\nWebseitenteam\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedienteam\n\nMindflyer\nWierd_W\n\nweiterer Dank geht an\n\nalle Mitwirkenden\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/el-GR.rc b/reactos/dll/cpl/sysdm/lang/el-GR.rc index ad2e95ec810..04674c5813c 100644 --- a/reactos/dll/cpl/sysdm/lang/el-GR.rc +++ b/reactos/dll/cpl/sysdm/lang/el-GR.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/en-US.rc b/reactos/dll/cpl/sysdm/lang/en-US.rc index b89c9e59911..b790e8e0fe8 100644 --- a/reactos/dll/cpl/sysdm/lang/en-US.rc +++ b/reactos/dll/cpl/sysdm/lang/en-US.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/es-ES.rc b/reactos/dll/cpl/sysdm/lang/es-ES.rc index 284d2b8a450..da49c7ab8c8 100644 --- a/reactos/dll/cpl/sysdm/lang/es-ES.rc +++ b/reactos/dll/cpl/sysdm/lang/es-ES.rc @@ -279,5 +279,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "El tamaño máximo del archivo de paginación no puede ser inferior al tamaño inicial y no puede exceder el espacio disponible en la unidad seleccionada." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/fr-FR.rc b/reactos/dll/cpl/sysdm/lang/fr-FR.rc index dfaa518cbf0..bd7a82cdde7 100644 --- a/reactos/dll/cpl/sysdm/lang/fr-FR.rc +++ b/reactos/dll/cpl/sysdm/lang/fr-FR.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/he-IL.rc b/reactos/dll/cpl/sysdm/lang/he-IL.rc index 5502680ee10..29c2b8f13ab 100644 --- a/reactos/dll/cpl/sysdm/lang/he-IL.rc +++ b/reactos/dll/cpl/sysdm/lang/he-IL.rc @@ -279,5 +279,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/hu-HU.rc b/reactos/dll/cpl/sysdm/lang/hu-HU.rc index 5616e317d7f..a852ea6bf6e 100644 --- a/reactos/dll/cpl/sysdm/lang/hu-HU.rc +++ b/reactos/dll/cpl/sysdm/lang/hu-HU.rc @@ -279,5 +279,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/id-ID.rc b/reactos/dll/cpl/sysdm/lang/id-ID.rc index 1e09507a12b..1e033e31522 100644 --- a/reactos/dll/cpl/sysdm/lang/id-ID.rc +++ b/reactos/dll/cpl/sysdm/lang/id-ID.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/it-IT.rc b/reactos/dll/cpl/sysdm/lang/it-IT.rc index 74a01b4bdff..d87ee3f6592 100644 --- a/reactos/dll/cpl/sysdm/lang/it-IT.rc +++ b/reactos/dll/cpl/sysdm/lang/it-IT.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "La dimensione massima del file di paging non può essere inferiore a quella iniziale e non può superare lo spazio disponibile nell'unità selezionata." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nCoordinatore\n\nAleksey Bragin\n\nGruppo di sviluppo\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nUlteriori ringraziamenti\n\na tutti i Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/ja-JP.rc b/reactos/dll/cpl/sysdm/lang/ja-JP.rc index 5dac2c21488..c9419b99fe9 100644 --- a/reactos/dll/cpl/sysdm/lang/ja-JP.rc +++ b/reactos/dll/cpl/sysdm/lang/ja-JP.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/nl-NL.rc b/reactos/dll/cpl/sysdm/lang/nl-NL.rc index 6e383126049..e66da432dc0 100644 --- a/reactos/dll/cpl/sysdm/lang/nl-NL.rc +++ b/reactos/dll/cpl/sysdm/lang/nl-NL.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/no-NO.rc b/reactos/dll/cpl/sysdm/lang/no-NO.rc index fca80a1a614..dca5cd7204f 100644 --- a/reactos/dll/cpl/sysdm/lang/no-NO.rc +++ b/reactos/dll/cpl/sysdm/lang/no-NO.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/pl-PL.rc b/reactos/dll/cpl/sysdm/lang/pl-PL.rc index 413fe64ca9b..33add887c43 100644 --- a/reactos/dll/cpl/sysdm/lang/pl-PL.rc +++ b/reactos/dll/cpl/sysdm/lang/pl-PL.rc @@ -286,5 +286,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "Maksymalny rozmiar pliku stronicowania nie może być mniejszy niż jego rozmiar początkowy i nie może przekraczać dostępnej ilości miejsca w wybranym napędzie." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nEkipa ReactOS\n\nKoordynator Projektu\n\nAleksey Bragin\n\nEkipa Programistów\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nInżynierowie Wydań\n\nColin Finck\nZ98\n\nEkipa WWW\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nEkipa PR\n\nMindflyer\nWierd_W\n\nPodziękowania dla\n\nwszystkich współpracowników\nEkipy Wine\n\n"//FIXME END diff --git a/reactos/dll/cpl/sysdm/lang/ro-RO.rc b/reactos/dll/cpl/sysdm/lang/ro-RO.rc index eba3d3a70f5..6dda9d5769d 100644 --- a/reactos/dll/cpl/sysdm/lang/ro-RO.rc +++ b/reactos/dll/cpl/sysdm/lang/ro-RO.rc @@ -279,5 +279,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "Dimensiunea maximă a fișierului de paginare trebuie să fie încadrată între dimensiunea inițială și spațiul liber disponibil al unității selectate." IDS_PAGEFILE_NONE "nespecificat" IDS_PAGEFILE_SYSTEM "gestionat de sistem" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nEchipa ReactOS\n\nCoordonator de proiect\n\nAleksey Bragin\n\nEchipa de dezvoltare\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nIngineri de distribuție\n\nColin Finck\nZ98\n\nEchipa paginii web\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nEchipa multimedia\n\nMindflyer\nWierd_W\n\nmulțumiri adresate către\n\ntoți Contribuitorii\nEchipa Wine\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/ru-RU.rc b/reactos/dll/cpl/sysdm/lang/ru-RU.rc index 1ced85f967b..f2c4fb9c598 100644 --- a/reactos/dll/cpl/sysdm/lang/ru-RU.rc +++ b/reactos/dll/cpl/sysdm/lang/ru-RU.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "Максимальный размер файла подкачки должен быть не меньше, чем начальный размер, который не должен превышать свободного места на выбранном диске." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nКоманда ReactOS\n\nКоординатор проекта\n\nАлексей Брагин\n\nКоллектив разработчиков\n\nАлексей Брагин\nЭндрю Гринвуд\nАндрей Коротаев\nАрт Йеркс\nКристоф фон Виттих\nКолин Финк\nДаниэль Раймер\nДмитрий Чапышев\nЭрик Коль\nГед Мёрфи\nГрегор Брюнмар\nЭрве Поссино\nДжеймс Тэбор\nДжеффри Морлан\nЙоханнес Андервальд\nKJK::Гиперион\nМаартен Босма\nМагнус Олсен\nМарк Пиулахс\nМаттиас Купфер\nМайк Норделл\nПитер Вард\nПьер Швейцер\nСавелий Третьяков\nСтефан Гинсберг\nСильвейн Петреоль\nТомас Блюмель\nТимо Кройцер\n\nАлекс Ионеску\nФилип Навара\nГуннар Далснес\nМартин Фукс\nРойс Митчелл III\nБрэндон Тёрнер\nБрайан Палмер\nКаспер Хорнструп\nДэвид Велч\nЭмануэль Алиберти\nГе ван Гельдорп\nГрегор Анич\nДжейсон Филби\nЙенс Коллин\nМихаэль Вирт\nНатан Вудс\nРоберт Дикенсон\nРекс Джоллифф\nVizzini\n\nРелиз-инженеры\n\nКолин Финк\nЦзылян Гуо\n\nРазработка веб-сайта\n\nКолин Финк\nЯн Блумквист Кинандер\nКлеменс Фридл\nЦзылян Гуо\n\nГрафический дизайн\n\nMindflyer\nWierd_W\n\nБлагодарности\n\nвсем участникам проекта\nКоманде Wine\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/sk-SK.rc b/reactos/dll/cpl/sysdm/lang/sk-SK.rc index 533383bef30..939b2ecb17f 100644 --- a/reactos/dll/cpl/sysdm/lang/sk-SK.rc +++ b/reactos/dll/cpl/sysdm/lang/sk-SK.rc @@ -285,5 +285,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/sq-AL.rc b/reactos/dll/cpl/sysdm/lang/sq-AL.rc index 03cf9795a17..0accbd9b210 100644 --- a/reactos/dll/cpl/sysdm/lang/sq-AL.rc +++ b/reactos/dll/cpl/sysdm/lang/sq-AL.rc @@ -277,5 +277,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "Madhësia maksimale e faqes së dokumenit nuk duhet të jetë më e vogël se madhësia e saj fillestare dhe nuk duhet të kalojë hapësirën në dispozicion në driver-in e përzgjedhur." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/sv-SE.rc b/reactos/dll/cpl/sysdm/lang/sv-SE.rc index a30843301dd..a632ffa0c67 100644 --- a/reactos/dll/cpl/sysdm/lang/sv-SE.rc +++ b/reactos/dll/cpl/sysdm/lang/sv-SE.rc @@ -279,5 +279,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/tr-TR.rc b/reactos/dll/cpl/sysdm/lang/tr-TR.rc index 2a2f9562b9f..d930540931a 100644 --- a/reactos/dll/cpl/sysdm/lang/tr-TR.rc +++ b/reactos/dll/cpl/sysdm/lang/tr-TR.rc @@ -279,5 +279,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "Sayfalama kütüğünün azamî büyüklüğü, başlangıç büyüklüğünden küçük, seçili sürücüdeki boşluğun büyüklüğünden büyük olamaz." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Takımı\n\nTasarı Eş Güdümcüsü:\n\nAleksey Bragin\n\nGeliştirme Takımı:\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nSürüm Tasarlayıcıları:\n\nColin Finck\nZ98\n\nUmûmî Ağ Sitesi Takımı:\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedya Takımı:\n\nMindflyer\nWierd_W\n\nAyrıca, diğer tüm katkıda bulunanlara teşekkürler:\nWine Takımı\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/uk-UA.rc b/reactos/dll/cpl/sysdm/lang/uk-UA.rc index 0027acdfe51..78bb12d09e3 100644 --- a/reactos/dll/cpl/sysdm/lang/uk-UA.rc +++ b/reactos/dll/cpl/sysdm/lang/uk-UA.rc @@ -285,5 +285,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "Максимальний розмір файлу довантаження не повинен бути меншим від початкового та не повинен перевищувати об'єм вільного місця на обраному диску." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/lang/zh-CN.rc b/reactos/dll/cpl/sysdm/lang/zh-CN.rc index 162f729e1b9..18a7ce8fcbc 100644 --- a/reactos/dll/cpl/sysdm/lang/zh-CN.rc +++ b/reactos/dll/cpl/sysdm/lang/zh-CN.rc @@ -279,5 +279,6 @@ BEGIN IDS_WARNMAXIMUMRANGE "The maximum size of the paging file must not be smaller than its initial size and must not exceed the available space on the selected drive." IDS_PAGEFILE_NONE "none" IDS_PAGEFILE_SYSTEM "system managed" + IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." IDS_DEVS "\nReactOS Team\n\nProject Coordinator\n\nAleksey Bragin\n\nDevelopment Team\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nRelease Engineers\n\nColin Finck\nZ98\n\nWebsite Team\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nMedia Team\n\nMindflyer\nWierd_W\n\nfurther thanks go to\n\nall Contributers\nWine Team\n\n" END diff --git a/reactos/dll/cpl/sysdm/precomp.h b/reactos/dll/cpl/sysdm/precomp.h index 97c30ba8ded..417f8432221 100644 --- a/reactos/dll/cpl/sysdm/precomp.h +++ b/reactos/dll/cpl/sysdm/precomp.h @@ -65,7 +65,7 @@ typedef struct _VIRTMEM LPTSTR szPagingFiles; TCHAR szDrive[10]; INT Count; - BOOL bSave; + BOOL bModified; PAGEFILE Pagefile[26]; } VIRTMEM, *PVIRTMEM; @@ -78,4 +78,13 @@ typedef struct _BOOTRECORD }BOOTRECORD, *PBOOTRECORD; +INT +ResourceMessageBox( + IN HINSTANCE hInstance, + IN HWND hwnd, + IN UINT uType, + IN UINT uCaption, + IN UINT uText); + + #endif /* __CPL_SYSDM_H */ diff --git a/reactos/dll/cpl/sysdm/resource.h b/reactos/dll/cpl/sysdm/resource.h index 6ef3de200a3..6557c2ced47 100644 --- a/reactos/dll/cpl/sysdm/resource.h +++ b/reactos/dll/cpl/sysdm/resource.h @@ -39,6 +39,7 @@ #define IDS_WARNMAXIMUMRANGE 81 #define IDS_PAGEFILE_NONE 82 #define IDS_PAGEFILE_SYSTEM 83 +#define IDS_INFOREBOOT 84 /* Propsheet - general */ #define IDD_PROPPAGEGENERAL 100 diff --git a/reactos/dll/cpl/sysdm/sysdm.c b/reactos/dll/cpl/sysdm/sysdm.c index b9af4698f74..64b489f7e20 100644 --- a/reactos/dll/cpl/sysdm/sysdm.c +++ b/reactos/dll/cpl/sysdm/sysdm.c @@ -24,6 +24,28 @@ APPLET Applets[NUM_APPLETS] = #define MAX_SYSTEM_PAGES 32 + +INT +ResourceMessageBox( + IN HINSTANCE hInstance, + IN HWND hwnd, + IN UINT uType, + IN UINT uCaption, + IN UINT uText) +{ + WCHAR szCaption[256]; + WCHAR szText[256]; + + LoadStringW(hInstance, uCaption, szCaption, 256); + LoadStringW(hInstance, uText, szText, 256); + + return MessageBoxW(hwnd, + szText, + szCaption, + uType); +} + + static BOOL CALLBACK PropSheetAddPage(HPROPSHEETPAGE hpage, LPARAM lParam) { diff --git a/reactos/dll/cpl/sysdm/virtmem.c b/reactos/dll/cpl/sysdm/virtmem.c index 53f69828ca1..d7b2f8d2dd7 100644 --- a/reactos/dll/cpl/sysdm/virtmem.c +++ b/reactos/dll/cpl/sysdm/virtmem.c @@ -371,15 +371,11 @@ static VOID OnSet(PVIRTMEM pVirtMem) { INT Index; - UINT InitialSize; - UINT MaximumSize; + UINT InitialSize = -1; + UINT MaximumSize = -1; BOOL bTranslated; - TCHAR szTitle[64]; - TCHAR szMessage[256]; INT DriveIndex = 0; - pVirtMem->bSave = TRUE; - Index = (INT)SendDlgItemMessage(pVirtMem->hSelf, IDC_PAGEFILELIST, LB_GETCURSEL, @@ -403,22 +399,11 @@ OnSet(PVIRTMEM pVirtMem) FALSE); if (!bTranslated) { - if (LoadString(hApplet, - IDS_MESSAGEBOXTITLE, - szTitle, - sizeof(szTitle) / sizeof(szTitle[0])) == 0) - _tcscpy(szTitle, _T("System control panel applet")); - - if (LoadString(hApplet, - IDS_WARNINITIALSIZE, - szMessage, - sizeof(szMessage) / sizeof(szMessage[0])) == 0) - _tcscpy(szMessage, _T("Enter a numeric value for the initial size of the paging file.")); - - MessageBox(NULL, - szMessage, - szTitle, - MB_ICONWARNING | MB_OK); + ResourceMessageBox(hApplet, + NULL, + MB_ICONWARNING | MB_OK, + IDS_MESSAGEBOXTITLE, + IDS_WARNINITIALSIZE); return; } @@ -428,22 +413,11 @@ OnSet(PVIRTMEM pVirtMem) FALSE); if (!bTranslated) { - if (LoadString(hApplet, - IDS_MESSAGEBOXTITLE, - szTitle, - sizeof(szTitle) / sizeof(szTitle[0])) == 0) - _tcscpy(szTitle, _T("System control panel applet")); - - if (LoadString(hApplet, - IDS_WARNMAXIMUMSIZE, - szMessage, - sizeof(szMessage) / sizeof(szMessage[0])) == 0) - _tcscpy(szMessage, _T("Enter a numeric value for the maximum size of the paging file.")); - - MessageBox(NULL, - szMessage, - szTitle, - MB_ICONWARNING | MB_OK); + ResourceMessageBox(hApplet, + NULL, + MB_ICONWARNING | MB_OK, + IDS_MESSAGEBOXTITLE, + IDS_WARNMAXIMUMSIZE); return; } @@ -451,21 +425,11 @@ OnSet(PVIRTMEM pVirtMem) if (InitialSize < 2 || InitialSize > pVirtMem->Pagefile[DriveIndex].FreeSize) { - if (LoadString(hApplet, - IDS_MESSAGEBOXTITLE, - szTitle, - sizeof(szTitle) / sizeof(szTitle[0])) == 0) - _tcscpy(szTitle, _T("System control panel applet")); - - LoadString(hApplet, - IDS_WARNINITIALRANGE, - szMessage, - sizeof(szMessage) / sizeof(szMessage[0])); - - MessageBox(NULL, - szMessage, - szTitle, - MB_ICONWARNING | MB_OK); + ResourceMessageBox(hApplet, + NULL, + MB_ICONWARNING | MB_OK, + IDS_MESSAGEBOXTITLE, + IDS_WARNINITIALRANGE); return; } @@ -473,24 +437,18 @@ OnSet(PVIRTMEM pVirtMem) if (MaximumSize < InitialSize || MaximumSize > pVirtMem->Pagefile[DriveIndex].FreeSize) { - if (LoadString(hApplet, - IDS_MESSAGEBOXTITLE, - szTitle, - sizeof(szTitle) / sizeof(szTitle[0])) == 0) - _tcscpy(szTitle, _T("System control panel applet")); - - LoadString(hApplet, - IDS_WARNMAXIMUMRANGE, - szMessage, - sizeof(szMessage) / sizeof(szMessage[0])); - - MessageBox(NULL, - szMessage, - szTitle, - MB_ICONWARNING | MB_OK); + ResourceMessageBox(hApplet, + NULL, + MB_ICONWARNING | MB_OK, + IDS_MESSAGEBOXTITLE, + IDS_WARNMAXIMUMRANGE); return; } + if ((pVirtMem->Pagefile[DriveIndex].InitialSize != InitialSize) && + (pVirtMem->Pagefile[DriveIndex].MaximumSize != MaximumSize)) + pVirtMem->bModified = TRUE; + pVirtMem->Pagefile[DriveIndex].InitialSize = InitialSize; pVirtMem->Pagefile[DriveIndex].MaximumSize = MaximumSize; pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; @@ -498,6 +456,10 @@ OnSet(PVIRTMEM pVirtMem) else if (IsDlgButtonChecked(pVirtMem->hSelf, IDC_NOPAGEFILE) == BST_CHECKED) { + if ((pVirtMem->Pagefile[DriveIndex].InitialSize != InitialSize) && + (pVirtMem->Pagefile[DriveIndex].MaximumSize != MaximumSize)) + pVirtMem->bModified = TRUE; + /* Set sizes to -1 */ pVirtMem->Pagefile[DriveIndex].InitialSize = -1; pVirtMem->Pagefile[DriveIndex].MaximumSize = -1; @@ -505,6 +467,10 @@ OnSet(PVIRTMEM pVirtMem) } else { + if ((pVirtMem->Pagefile[DriveIndex].InitialSize != InitialSize) && + (pVirtMem->Pagefile[DriveIndex].MaximumSize != MaximumSize)) + pVirtMem->bModified = TRUE; + pVirtMem->Pagefile[DriveIndex].InitialSize = 0; pVirtMem->Pagefile[DriveIndex].MaximumSize = 0; pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; @@ -618,8 +584,14 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem) static VOID OnOk(PVIRTMEM pVirtMem) { - if (pVirtMem->bSave == TRUE) + if (pVirtMem->bModified == TRUE) { + ResourceMessageBox(hApplet, + NULL, + MB_ICONINFORMATION | MB_OK, + IDS_MESSAGEBOXTITLE, + IDS_INFOREBOOT); + WritePageFileSettings(pVirtMem); } } @@ -632,7 +604,7 @@ OnInitDialog(HWND hwnd, PVIRTMEM pVirtMem) pVirtMem->hSelf = hwnd; pVirtMem->hListBox = GetDlgItem(hwnd, IDC_PAGEFILELIST); - pVirtMem->bSave = FALSE; + pVirtMem->bModified = FALSE; SetListBoxColumns(pVirtMem->hListBox); @@ -711,7 +683,7 @@ VirtMemDlgProc(HWND hwndDlg, case IDOK: OnOk(pVirtMem); - EndDialog(hwndDlg, 0); + EndDialog(hwndDlg, pVirtMem->bModified); return TRUE; case IDC_NOPAGEFILE: From 502ebc94afafc13db368f40a68210c1f057825b5 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 12 Apr 2014 21:12:26 +0000 Subject: [PATCH 301/419] [KMTESTS:NPFS] --MagicValues; CORE-7451 svn path=/trunk/; revision=62723 --- rostests/kmtests/npfs/NpfsVolumeInfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rostests/kmtests/npfs/NpfsVolumeInfo.c b/rostests/kmtests/npfs/NpfsVolumeInfo.c index d09d80d6364..9117191ef00 100644 --- a/rostests/kmtests/npfs/NpfsVolumeInfo.c +++ b/rostests/kmtests/npfs/NpfsVolumeInfo.c @@ -48,7 +48,7 @@ TestVolumeInfo( ok_eq_ulong(VolumeInfo.VolumeLabelLength, 18); ok_eq_size(RtlCompareMemory(VolumeInfo.VolumeLabel, L"NamedPipe", 18), 18); ok_eq_wchar(VolumeInfo.VolumeLabel[9], 0xFFFF); - ok_eq_ulong(IoStatusBlock.Information, 36); + ok_eq_ulong(IoStatusBlock.Information, (FIELD_OFFSET(FILE_FS_VOLUME_INFORMATION, VolumeLabel) + 9 * sizeof(WCHAR))); RtlFillMemory(&VolumeInfo, sizeof(VolumeInfo), 0xFF); Status = ZwQueryVolumeInformationFile(ServerHandle, @@ -65,7 +65,7 @@ TestVolumeInfo( ok_eq_ulong(VolumeInfo.VolumeLabelLength, 18); ok_eq_size(RtlCompareMemory(VolumeInfo.VolumeLabel, L"NamedP", 10), 10); ok_eq_wchar(VolumeInfo.VolumeLabel[5], 0xFFFF); - ok_eq_ulong(IoStatusBlock.Information, 28); + ok_eq_ulong(IoStatusBlock.Information, (FIELD_OFFSET(FILE_FS_VOLUME_INFORMATION, VolumeLabel) + 5 * sizeof(WCHAR))); RtlFillMemory(&FileFsSizeInfo, sizeof(FileFsSizeInfo), 0xFF); Status = ZwQueryVolumeInformationFile(ServerHandle, From c48b6ad95494c9fdf4753b08f29f947d1fc9acc8 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 12 Apr 2014 21:15:55 +0000 Subject: [PATCH 302/419] [NPFS] Fix failing tests CORE-7451 svn path=/trunk/; revision=62724 --- reactos/drivers/filesystems/npfs/volinfo.c | 24 ++++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/reactos/drivers/filesystems/npfs/volinfo.c b/reactos/drivers/filesystems/npfs/volinfo.c index a8449ef9a84..ea0d67442b8 100644 --- a/reactos/drivers/filesystems/npfs/volinfo.c +++ b/reactos/drivers/filesystems/npfs/volinfo.c @@ -25,7 +25,7 @@ NpQueryFsVolumeInfo(IN PVOID Buffer, USHORT NameLength; TRACE("Entered\n"); - *Length -= sizeof(*InfoBuffer); + *Length -= FIELD_OFFSET(FILE_FS_VOLUME_INFORMATION, VolumeLabel); InfoBuffer->VolumeCreationTime.LowPart = 0; InfoBuffer->VolumeCreationTime.HighPart = 0; @@ -77,23 +77,15 @@ NpQueryFsDeviceInfo(IN PVOID Buffer, IN OUT PULONG Length) { PFILE_FS_DEVICE_INFORMATION InfoBuffer = Buffer; - NTSTATUS Status; TRACE("Entered\n"); - if (*Length >= sizeof(*InfoBuffer)) - { - InfoBuffer->DeviceType = 0; - InfoBuffer->Characteristics = 0; - InfoBuffer->DeviceType = FILE_DEVICE_NAMED_PIPE; - *Length -= sizeof(*InfoBuffer); - Status = STATUS_SUCCESS; - } - else - { - Status = STATUS_BUFFER_OVERFLOW; - } - TRACE("Leaving, Status = %lx\n", Status); - return Status; + InfoBuffer->DeviceType = 0; + InfoBuffer->Characteristics = 0; + InfoBuffer->DeviceType = FILE_DEVICE_NAMED_PIPE; + *Length -= sizeof(*InfoBuffer); + + TRACE("Leaving, Status = STATUS_SUCCESS\n"); + return STATUS_SUCCESS; } NTSTATUS From 4bd491de8052c7f090c4ac6364ee953f8c19d56c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 12 Apr 2014 23:06:41 +0000 Subject: [PATCH 303/419] [FONTS] Add the Monospace flag to the Fixedsys fonts. svn path=/trunk/; revision=62725 --- reactos/media/fonts/FSEX301-L2.ttf | Bin 574604 -> 574604 bytes reactos/media/fonts/FSEX301.ttf | Bin 575668 -> 575668 bytes reactos/media/fonts/doc/Fixedsys/README.txt | 7 +++++++ 3 files changed, 7 insertions(+) diff --git a/reactos/media/fonts/FSEX301-L2.ttf b/reactos/media/fonts/FSEX301-L2.ttf index 58ef2fe268de7da2b6059577837283de64987a58..6d3d1ca9e31579c4ae94dc1b88ea360f3a9c1098 100644 GIT binary patch delta 35 qcmeC_RPO0iZfId_VQOJ+VQFD)VcWuPeUOo{-R2f$x?sD{LH6xF2RR&=0ruAnt^fc4 diff --git a/reactos/media/fonts/FSEX301.ttf b/reactos/media/fonts/FSEX301.ttf index a4f177c41a894b87a0175d2d68e730aa2f742700..affa7ff92220e1a9b11055d6aa73b51f59d490be 100644 GIT binary patch delta 35 rcmdloQF+Tm<%Sl<7N!>F7M2#)7Pc+y>AM&i+cS2tZ_n7p;ll?2=erC? delta 38 ucmdloQF+Tm<%Sl<7N!>F7M2#)7Pc+y>AR*+S-~OLUa^aPd&Mpe8$JLW6%IiF diff --git a/reactos/media/fonts/doc/Fixedsys/README.txt b/reactos/media/fonts/doc/Fixedsys/README.txt index 2be4f7e189e..4d8f20881c3 100644 --- a/reactos/media/fonts/doc/Fixedsys/README.txt +++ b/reactos/media/fonts/doc/Fixedsys/README.txt @@ -42,3 +42,10 @@ Authors: Jean-Baptiste Lallement, and Derek Veit Credits: Darien Gavin Valentine https://bugs.launchpad.net/ubuntu/+bug/200671 + + ++=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= + + +Monospace flag added to FSEX301.ttf and FSEX301-L2.ttf +Herms Blusca-Mato From ebfb6c79a70f2b38c62e8f1faa2982e311da97fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 12 Apr 2014 23:12:46 +0000 Subject: [PATCH 304/419] [CHARMAP][IMAGESOFT] Be sure to enumerate *all* the fonts. svn path=/trunk/; revision=62726 --- reactos/base/applications/charmap/charmap.c | 2 +- rosapps/applications/imagesoft/font.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/base/applications/charmap/charmap.c b/reactos/base/applications/charmap/charmap.c index ed00aa14682..f3d78298fee 100644 --- a/reactos/base/applications/charmap/charmap.c +++ b/reactos/base/applications/charmap/charmap.c @@ -36,7 +36,7 @@ EnumFontNames(ENUMLOGFONTEXW *lpelfe, /* make sure font doesn't already exist in our list */ if(SendMessageW(hwndCombo, - CB_FINDSTRING, + CB_FINDSTRINGEXACT, 0, (LPARAM)pszName) == CB_ERR) { diff --git a/rosapps/applications/imagesoft/font.c b/rosapps/applications/imagesoft/font.c index 93e1a7cf9dc..1f696cbddc6 100644 --- a/rosapps/applications/imagesoft/font.c +++ b/rosapps/applications/imagesoft/font.c @@ -50,7 +50,7 @@ EnumFontNames(ENUMLOGFONTEX *lpelfe, /* make sure font doesn't already exist in our list */ if(SendMessage(hwndCombo, - CB_FINDSTRING, + CB_FINDSTRINGEXACT, 0, (LPARAM)pszName) == CB_ERR) { From 47bbfcb8422876d261f02fabb288d26124702d22 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sat, 12 Apr 2014 23:58:12 +0000 Subject: [PATCH 305/419] [NtUser|User32] - Adding more message write backs. Test code for explorer task bar size change. See CORE-7447. svn path=/trunk/; revision=62727 --- reactos/win32ss/user/ntuser/callback.c | 2 ++ reactos/win32ss/user/ntuser/message.c | 2 ++ reactos/win32ss/user/user32/windows/message.c | 25 +++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/reactos/win32ss/user/ntuser/callback.c b/reactos/win32ss/user/ntuser/callback.c index a6112e87e1e..74fb27171f6 100644 --- a/reactos/win32ss/user/ntuser/callback.c +++ b/reactos/win32ss/user/ntuser/callback.c @@ -374,6 +374,8 @@ co_IntCallWindowProc(WNDPROC Proc, case WM_NCCREATE: case WM_STYLECHANGING: case WM_WINDOWPOSCHANGING: + case WM_SIZING: + case WM_MOVING: TRACE("Copy lParam, Message %d Size %d lParam %d!\n", Message, lParamBufferSize, lParam); if (InSendMessage) // Copy into kernel space. diff --git a/reactos/win32ss/user/ntuser/message.c b/reactos/win32ss/user/ntuser/message.c index 50deea3e44c..a9e2256d3eb 100644 --- a/reactos/win32ss/user/ntuser/message.c +++ b/reactos/win32ss/user/ntuser/message.c @@ -136,6 +136,8 @@ static MSGMEMORY g_MsgMemory[] = { WM_COPYGLOBALDATA, MMS_SIZE_WPARAM, MMS_FLAG_READ }, { WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READWRITE }, { WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE }, + { WM_SIZING, sizeof(RECT), MMS_FLAG_READWRITE }, + { WM_MOVING, sizeof(RECT), MMS_FLAG_READWRITE }, }; static PMSGMEMORY FASTCALL diff --git a/reactos/win32ss/user/user32/windows/message.c b/reactos/win32ss/user/user32/windows/message.c index afd066e1eff..f3a729155cb 100644 --- a/reactos/win32ss/user/user32/windows/message.c +++ b/reactos/win32ss/user/user32/windows/message.c @@ -2930,6 +2930,17 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength) return STATUS_INFO_LENGTH_MISMATCH; } KMMsg.lParam = (LPARAM) ((char *) CallbackArgs + sizeof(WINDOWPROC_CALLBACK_ARGUMENTS)); + switch(KMMsg.message) + { + case WM_SIZING: + { + PRECT prect = (PRECT) KMMsg.lParam; + ERR("WM_SIZING 1 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom); + break; + } + default: + break; + } } else { @@ -2965,6 +2976,20 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength) { } + if (0 <= CallbackArgs->lParamBufferSize) + { + switch(KMMsg.message) + { + case WM_SIZING: + { + PRECT prect = (PRECT) KMMsg.lParam; + ERR("WM_SIZING 2 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom); + break; + } + default: + break; + } + } return ZwCallbackReturn(CallbackArgs, ArgumentLength, STATUS_SUCCESS); } From 97c7401a8b1b3f6327ce0a7e72c5ba9a39674443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 13 Apr 2014 00:10:33 +0000 Subject: [PATCH 306/419] [FONTS] Fixedsys fonts: Also fix their PANOSE proportion byte to Monospace. Now they are recognized by Windows as real monospaced fonts (what they were). Their lfPitchAndFamily flag is equal to FF_MODERN | FIXED_PITCH . Addendum to revision 62725. svn path=/trunk/; revision=62728 --- reactos/media/fonts/FSEX301-L2.ttf | Bin 574604 -> 574604 bytes reactos/media/fonts/FSEX301.ttf | Bin 575668 -> 575668 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/reactos/media/fonts/FSEX301-L2.ttf b/reactos/media/fonts/FSEX301-L2.ttf index 6d3d1ca9e31579c4ae94dc1b88ea360f3a9c1098..c19e216190de111aafb905012e5d634bc3d7e921 100644 GIT binary patch delta 48 ucmeC_RPO0i-msgIk+XRZWBVRP5M}~mW*}w(Vpbq#17h~=dl)$`90CBN!4WM0 delta 48 ucmeC_RPO0i-msgIk)e4HWBVRP5M}~mW*}w(Vpbq#17h~=dl)$`90CBMYY`*> diff --git a/reactos/media/fonts/FSEX301.ttf b/reactos/media/fonts/FSEX301.ttf index affa7ff92220e1a9b11055d6aa73b51f59d490be..a92892ec45934efb1329342469c36dc3c2dd7a01 100644 GIT binary patch delta 48 ucmdloQF+Tm Date: Sun, 13 Apr 2014 00:13:51 +0000 Subject: [PATCH 307/419] Update description, addendum to revisions 62728 and 62725. svn path=/trunk/; revision=62729 --- reactos/media/fonts/doc/Fixedsys/README.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/reactos/media/fonts/doc/Fixedsys/README.txt b/reactos/media/fonts/doc/Fixedsys/README.txt index 4d8f20881c3..6d0960e81f9 100644 --- a/reactos/media/fonts/doc/Fixedsys/README.txt +++ b/reactos/media/fonts/doc/Fixedsys/README.txt @@ -47,5 +47,7 @@ https://bugs.launchpad.net/ubuntu/+bug/200671 +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= -Monospace flag added to FSEX301.ttf and FSEX301-L2.ttf +PostScript Monospace flag added, and PANOSE proportion byte fixed to Monospace, +in FSEX301.ttf and FSEX301-L2.ttf. + Herms Blusca-Mato From e99eb38ba3359753b9e8b53de47011fa376dd356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 13 Apr 2014 01:03:08 +0000 Subject: [PATCH 308/419] [CONSOLE.CPL] Start to implement the terminal fonts selector: add a basic font enumerator. The criteria for eligible console fonts are given in http://support.microsoft.com/kb/247815 . I relax some of them to allow e.g. Courier (New) as potential console fonts, for example. See the code for more details. svn path=/trunk/; revision=62730 --- reactos/dll/cpl/console/colors.c | 2 +- reactos/dll/cpl/console/console.c | 3 +- reactos/dll/cpl/console/font.c | 222 +++++++++++++++++++++++++- reactos/dll/cpl/console/lang/bg-BG.rc | 4 +- reactos/dll/cpl/console/lang/cs-CZ.rc | 4 +- reactos/dll/cpl/console/lang/de-DE.rc | 4 +- reactos/dll/cpl/console/lang/en-US.rc | 4 +- reactos/dll/cpl/console/lang/es-ES.rc | 4 +- reactos/dll/cpl/console/lang/fr-FR.rc | 4 +- reactos/dll/cpl/console/lang/he-IL.rc | 4 +- reactos/dll/cpl/console/lang/id-ID.rc | 4 +- reactos/dll/cpl/console/lang/it-IT.rc | 4 +- reactos/dll/cpl/console/lang/no-NO.rc | 4 +- reactos/dll/cpl/console/lang/pl-PL.rc | 4 +- reactos/dll/cpl/console/lang/ro-RO.rc | 4 +- reactos/dll/cpl/console/lang/ru-RU.rc | 4 +- reactos/dll/cpl/console/lang/sk-SK.rc | 4 +- reactos/dll/cpl/console/lang/sq-AL.rc | 4 +- reactos/dll/cpl/console/lang/tr-TR.rc | 4 +- reactos/dll/cpl/console/lang/uk-UA.rc | 4 +- reactos/dll/cpl/console/lang/zh-CN.rc | 4 +- reactos/dll/cpl/console/layout.c | 3 +- reactos/dll/cpl/console/options.c | 2 +- reactos/dll/cpl/console/resource.h | 4 +- 24 files changed, 260 insertions(+), 48 deletions(-) diff --git a/reactos/dll/cpl/console/colors.c b/reactos/dll/cpl/console/colors.c index 8ddd3a2ac9a..a4ff1e765ae 100644 --- a/reactos/dll/cpl/console/colors.c +++ b/reactos/dll/cpl/console/colors.c @@ -2,7 +2,7 @@ * PROJECT: ReactOS Console Configuration DLL * LICENSE: GPL - See COPYING in the top level directory * FILE: dll/win32/console/colors.c - * PURPOSE: displays colors dialog + * PURPOSE: Colors dialog * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org) */ diff --git a/reactos/dll/cpl/console/console.c b/reactos/dll/cpl/console/console.c index bd4950f39ae..e0c4978ca7d 100644 --- a/reactos/dll/cpl/console/console.c +++ b/reactos/dll/cpl/console/console.c @@ -2,8 +2,9 @@ * PROJECT: ReactOS Console Configuration DLL * LICENSE: GPL - See COPYING in the top level directory * FILE: dll/win32/console/console.c - * PURPOSE: initialization of DLL + * PURPOSE: Initialization * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org) + * Hermes Belusca-Maito (hermes.belusca@sfr.fr) */ #include "console.h" diff --git a/reactos/dll/cpl/console/font.c b/reactos/dll/cpl/console/font.c index a2651040678..58d7948975f 100644 --- a/reactos/dll/cpl/console/font.c +++ b/reactos/dll/cpl/console/font.c @@ -2,8 +2,9 @@ * PROJECT: ReactOS Console Configuration DLL * LICENSE: GPL - See COPYING in the top level directory * FILE: dll/win32/console/font.c - * PURPOSE: displays font dialog + * PURPOSE: Font dialog * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org) + * Hermes Belusca-Maito (hermes.belusca@sfr.fr) */ #include "console.h" @@ -11,6 +12,191 @@ #define NDEBUG #include + +// +// Some temporary code for future reference... +// +#if 0 +/* + * This code comes from PuTTY + */ +{ + CHOOSEFONT cf; + LOGFONT lf; + HDC hdc; + FontSpec *fs = (FontSpec *)c->data; + + hdc = GetDC(0); + lf.lfHeight = -MulDiv(fs->height, + GetDeviceCaps(hdc, LOGPIXELSY), 72); + ReleaseDC(0, hdc); + lf.lfWidth = lf.lfEscapement = lf.lfOrientation = 0; + lf.lfItalic = lf.lfUnderline = lf.lfStrikeOut = 0; + lf.lfWeight = (fs->isbold ? FW_BOLD : 0); + lf.lfCharSet = fs->charset; + lf.lfOutPrecision = OUT_DEFAULT_PRECIS; + lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf.lfQuality = DEFAULT_QUALITY; + lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; + strncpy(lf.lfFaceName, fs->name, + sizeof(lf.lfFaceName) - 1); + lf.lfFaceName[sizeof(lf.lfFaceName) - 1] = '\0'; + + cf.lStructSize = sizeof(cf); + cf.hwndOwner = dp->hwnd; + cf.lpLogFont = &lf; + cf.Flags = (dp->fixed_pitch_fonts ? CF_FIXEDPITCHONLY : 0) | + CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS; + + if (ChooseFont(&cf)) { + fs = fontspec_new(lf.lfFaceName, (lf.lfWeight == FW_BOLD), + cf.iPointSize / 10, lf.lfCharSet); + dlg_fontsel_set(ctrl, dp, fs); + fontspec_free(fs); + + ctrl->generic.handler(ctrl, dp, dp->data, EVENT_VALCHANGE); + } +} + +/* + * This code is from consrv. + */ +{ + if (!GetTextMetricsW(drawItem->hDC, &Metrics)) + { + DPRINT1("PaintText: GetTextMetrics failed\n"); + SelectObject(drawItem->hDC, OldFont); + DeleteObject(Font); + return; + } + GuiData->CharWidth = Metrics.tmMaxCharWidth; + GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; + + /* Measure real char width more precisely if possible. */ + if (GetTextExtentPoint32W(drawItem->hDC, L"R", 1, &CharSize)) + GuiData->CharWidth = CharSize.cx; +} +#endif + + +BOOL CALLBACK +EnumFontFamExProc(PLOGFONTW lplf, + PNEWTEXTMETRICW lpntm, + DWORD FontType, + LPARAM lParam) +{ + HWND hwndCombo = (HWND)lParam; + LPWSTR pszName = lplf->lfFaceName; + + BOOL fFixed; + BOOL fTrueType; + + /* Record the font's attributes (Fixedwidth and Truetype) */ + fFixed = ((lplf->lfPitchAndFamily & 0x03) == FIXED_PITCH); + fTrueType = (lplf->lfOutPrecision == OUT_STROKE_PRECIS) ? TRUE : FALSE; + + /* + * According to: http://support.microsoft.com/kb/247815 + * the criteria for console-eligible fonts are: + * - The font must be a fixed-pitch font. + * - The font cannot be an italic font. + * - The font cannot have a negative A or C space. + * - If it is a TrueType font, it must be FF_MODERN. + * - If it is not a TrueType font, it must be OEM_CHARSET. + * + * Non documented: vertical fonts are forbidden (their name start with a '@'). + * + * Additional criteria for Asian installations: + * - If it is not a TrueType font, the face name must be "Terminal". + * - If it is an Asian TrueType font, it must also be an Asian character set. + * + * To install additional TrueType fonts to be available for the console, + * add entries of type REG_SZ named "0", "00" etc... in: + * HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont + * The names of the fonts listed there should match those in: + * HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Fonts + */ + + /* + * In ReactOS, we relax some criteria: + * - We allow fixed-pitch FF_MODERN (Monospace) TrueType fonts + * that can be italic and have negative A or C space. + * - If it is not a TrueType font, it can be from another character set + * than OEM_CHARSET. + * - We do not support Asian criteria at the moment. + * - We do not look into the magic registry key mentioned above. + */ + + /* Reject variable width fonts */ + if (((lplf->lfPitchAndFamily & 0x03) != FIXED_PITCH) +#if 0 /* Reject italic and TrueType fonts with negative A or C space */ + || (lplf->lfItalic) + || !(lpntm->ntmFlags & NTM_NONNEGATIVE_AC) +#endif + ) + { + DPRINT1("Font '%S' rejected because it%s (lfPitchAndFamily = %d).\n", + pszName, !(lplf->lfPitchAndFamily & FIXED_PITCH) ? "'s not FIXED_PITCH" : (!(lpntm->ntmFlags & NTM_NONNEGATIVE_AC) ? " has negative A or C space" : " is broken"), + lplf->lfPitchAndFamily); + return TRUE; + } + + /* Reject TrueType fonts that are not FF_MODERN */ + if ((FontType == TRUETYPE_FONTTYPE) && ((lplf->lfPitchAndFamily & 0xF0) != FF_MODERN)) + { + DPRINT1("TrueType font '%S' rejected because it's not FF_MODERN (lfPitchAndFamily = %d)\n", pszName, lplf->lfPitchAndFamily); + return TRUE; + } + + /* Reject non-TrueType fonts that are not OEM */ +#if 0 + if ((FontType != TRUETYPE_FONTTYPE) && (lplf->lfCharSet != OEM_CHARSET)) + { + DPRINT1("Non-TrueType font '%S' rejected because it's not OEM_CHARSET %d\n", pszName, lplf->lfCharSet); + return TRUE; + } +#else // Improved criterium + if ((FontType != TRUETYPE_FONTTYPE) && + ((lplf->lfCharSet != ANSI_CHARSET) && (lplf->lfCharSet != DEFAULT_CHARSET) && (lplf->lfCharSet != OEM_CHARSET))) + { + DPRINT1("Non-TrueType font '%S' rejected because it's not ANSI_CHARSET or DEFAULT_CHARSET or OEM_CHARSET (lfCharSet = %d)\n", pszName, lplf->lfCharSet); + return TRUE; + } +#endif + + /* Reject fonts that are vertical (tategaki) */ + if (pszName[0] == L'@') + { + DPRINT1("Font '%S' rejected because it's vertical\n", pszName); + return TRUE; + } + +#if 0 // For Asian installations only + /* Reject non-TrueType fonts that are not Terminal */ + if ((FontType != TRUETYPE_FONTTYPE) && (wcscmp(pszName, L"Terminal") != 0)) + { + DPRINT1("Non-TrueType font '%S' rejected because it's not Terminal\n", pszName); + return TRUE; + } + + // TODO: Asian TrueType font must also be an Asian character set. +#endif + + /* Make sure the font doesn't already exist in the list */ + if (SendMessageW(hwndCombo, LB_FINDSTRINGEXACT, 0, (LPARAM)pszName) == LB_ERR) + { + /* Add the font */ + INT idx = (INT)SendMessageW(hwndCombo, LB_ADDSTRING, 0, (LPARAM)pszName); + + DPRINT1("Add font '%S' (lfPitchAndFamily = %d)\n", pszName, lplf->lfPitchAndFamily); + + /* Store this information in the list-item's userdata area */ + SendMessageW(hwndCombo, LB_SETITEMDATA, idx, MAKEWPARAM(fFixed, fTrueType)); + } + + return TRUE; +} + INT_PTR CALLBACK FontProc(HWND hwndDlg, @@ -18,23 +204,48 @@ FontProc(HWND hwndDlg, WPARAM wParam, LPARAM lParam) { - LPDRAWITEMSTRUCT drawItem; PCONSOLE_PROPS pConInfo = (PCONSOLE_PROPS)GetWindowLongPtr(hwndDlg, DWLP_USER); + PGUI_CONSOLE_INFO GuiInfo = (pConInfo ? pConInfo->TerminalInfo.TermInfo : NULL); - UNREFERENCED_PARAMETER(hwndDlg); UNREFERENCED_PARAMETER(wParam); switch (uMsg) { case WM_INITDIALOG: { + HDC hDC; + HWND hwndCombo; + LOGFONTW lf; + INT idx; + pConInfo = (PCONSOLE_PROPS)((LPPROPSHEETPAGE)lParam)->lParam; + GuiInfo = pConInfo->TerminalInfo.TermInfo; SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pConInfo); + + ZeroMemory(&lf, sizeof(lf)); + lf.lfCharSet = DEFAULT_CHARSET; // OEM_CHARSET; + // lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE; + // lf.lfFaceName = L""; + + hDC = GetDC(NULL); + hwndCombo = GetDlgItem(hwndDlg, IDC_LBOX_FONTTYPE); + EnumFontFamiliesExW(hDC, &lf, (FONTENUMPROCW)EnumFontFamExProc, (LPARAM)hwndCombo, 0); + ReleaseDC(NULL, hDC); + + DPRINT1("GuiInfo->FaceName = '%S'\n", GuiInfo->FaceName); + idx = (INT)SendMessageW(hwndCombo, LB_FINDSTRINGEXACT, 0, (LPARAM)GuiInfo->FaceName); + if (idx != LB_ERR) + { + SendMessageW(hwndCombo, LB_SETCURSEL, (WPARAM)idx, 0); + } + return TRUE; } + case WM_DRAWITEM: { - drawItem = (LPDRAWITEMSTRUCT)lParam; + LPDRAWITEMSTRUCT drawItem = (LPDRAWITEMSTRUCT)lParam; + if (drawItem->CtlID == IDC_STATIC_FONT_WINDOW_PREVIEW) { PaintConsole(drawItem, pConInfo); @@ -45,10 +256,9 @@ FontProc(HWND hwndDlg, } return TRUE; } + default: - { break; - } } return FALSE; diff --git a/reactos/dll/cpl/console/lang/bg-BG.rc b/reactos/dll/cpl/console/lang/bg-BG.rc index a256bd13ad0..b7f0b9da413 100644 --- a/reactos/dll/cpl/console/lang/bg-BG.rc +++ b/reactos/dll/cpl/console/lang/bg-BG.rc @@ -35,10 +35,10 @@ BEGIN LTEXT "Прозоречен преглед:", -1, 10, 10, 94, 10 LTEXT "Размер:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Шрифт:", -1, 10, 105, 33, 10 CHECKBOX "&Получери шрифтове", IDC_CHECK_BOLD_FONTS, 38, 105, 85, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Всеки знак е:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/cs-CZ.rc b/reactos/dll/cpl/console/lang/cs-CZ.rc index dd06891e245..0cfef2c42f4 100644 --- a/reactos/dll/cpl/console/lang/cs-CZ.rc +++ b/reactos/dll/cpl/console/lang/cs-CZ.rc @@ -41,10 +41,10 @@ BEGIN LTEXT "Náhled okna:", -1, 10, 10, 94, 10 LTEXT "Velikost:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Písmo:", -1, 10, 105, 33, 10 CHECKBOX "&Tučná písma", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Každý znak je:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/de-DE.rc b/reactos/dll/cpl/console/lang/de-DE.rc index 86cc0c0e4a6..8a241377d0b 100644 --- a/reactos/dll/cpl/console/lang/de-DE.rc +++ b/reactos/dll/cpl/console/lang/de-DE.rc @@ -37,10 +37,10 @@ BEGIN LTEXT "Fenstervorschau", -1, 10, 7, 65, 10 LTEXT "Größe", -1, 130, 10, 30, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 115, 70 - LISTBOX IDC_LBOX_FONTS, 130, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 130, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Schrift", -1, 10, 105, 35, 10 CHECKBOX "&Fette Schriften", IDC_CHECK_BOLD_FONTS, 45, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 50, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 50, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 10, 155, 200, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 165, 95, 35 LTEXT "Jedes Zeichen ist:", -1, 130, 165, 75, 10 diff --git a/reactos/dll/cpl/console/lang/en-US.rc b/reactos/dll/cpl/console/lang/en-US.rc index 0bf0d2887f3..a389a6af357 100644 --- a/reactos/dll/cpl/console/lang/en-US.rc +++ b/reactos/dll/cpl/console/lang/en-US.rc @@ -35,10 +35,10 @@ BEGIN LTEXT "Window Preview:", -1, 10, 10, 94, 10 LTEXT "Size:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Font:", -1, 10, 105, 33, 10 CHECKBOX "&Bold fonts", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Each character is:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/es-ES.rc b/reactos/dll/cpl/console/lang/es-ES.rc index ccffc4dfea5..86611a92863 100644 --- a/reactos/dll/cpl/console/lang/es-ES.rc +++ b/reactos/dll/cpl/console/lang/es-ES.rc @@ -37,10 +37,10 @@ BEGIN LTEXT "Ventana de Previsualización", -1, 10, 7, 65, 10 LTEXT "Tamaño", -1, 130, 10, 30, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 115, 70 - LISTBOX IDC_LBOX_FONTS, 130, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 130, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Fuente", -1, 10, 105, 35, 10 CHECKBOX "&Negrita", IDC_CHECK_BOLD_FONTS, 45, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 50, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 50, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 10, 155, 200, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 165, 95, 35 LTEXT "Cada caracter es:", -1, 130, 165, 75, 10 diff --git a/reactos/dll/cpl/console/lang/fr-FR.rc b/reactos/dll/cpl/console/lang/fr-FR.rc index 568f783bcd7..fcfc76e36ee 100644 --- a/reactos/dll/cpl/console/lang/fr-FR.rc +++ b/reactos/dll/cpl/console/lang/fr-FR.rc @@ -37,10 +37,10 @@ BEGIN LTEXT "Fenêtre de Prévisualisation :", -1, 10, 10, 94, 10 LTEXT "Taille :", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Police :", -1, 10, 105, 33, 10 CHECKBOX "&Gras", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Chaque caractère est :", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/he-IL.rc b/reactos/dll/cpl/console/lang/he-IL.rc index 0db39a414d3..2ee72d74b64 100644 --- a/reactos/dll/cpl/console/lang/he-IL.rc +++ b/reactos/dll/cpl/console/lang/he-IL.rc @@ -37,10 +37,10 @@ BEGIN LTEXT "תצוגה מקדימה:", -1, 10, 10, 94, 10 LTEXT "גודל:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "גופן:", -1, 10, 105, 33, 10 CHECKBOX "גופנים מודגשים", IDC_CHECK_BOLD_FONTS, 41, 105, 33, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Each character is:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/id-ID.rc b/reactos/dll/cpl/console/lang/id-ID.rc index 605765ac2e5..4232a3b112d 100644 --- a/reactos/dll/cpl/console/lang/id-ID.rc +++ b/reactos/dll/cpl/console/lang/id-ID.rc @@ -37,10 +37,10 @@ BEGIN LTEXT "Tinjauan Jendela", -1, 10, 7, 65, 10 LTEXT "Ukuran", -1, 130, 10, 30, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 115, 70 - LISTBOX IDC_LBOX_FONTS, 130, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 130, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Font", -1, 10, 105, 35, 10 CHECKBOX "Font &tebal", IDC_CHECK_BOLD_FONTS, 45, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 50, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 50, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 10, 155, 200, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 165, 95, 35 LTEXT "Setiap karakter adalah:", -1, 130, 165, 75, 10 diff --git a/reactos/dll/cpl/console/lang/it-IT.rc b/reactos/dll/cpl/console/lang/it-IT.rc index 368ed955704..395c6c45ed2 100644 --- a/reactos/dll/cpl/console/lang/it-IT.rc +++ b/reactos/dll/cpl/console/lang/it-IT.rc @@ -37,10 +37,10 @@ BEGIN LTEXT "Anteprima", -1, 10, 7, 65, 10 LTEXT "Dimansione", -1, 130, 10, 30, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 115, 70 - LISTBOX IDC_LBOX_FONTS, 130, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 130, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Font", -1, 10, 105, 35, 10 CHECKBOX "&Grassetto fonts", IDC_CHECK_BOLD_FONTS, 45, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 50, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 50, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 10, 155, 200, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 165, 95, 35 LTEXT "Ogni carattere è:", -1, 130, 165, 75, 10 diff --git a/reactos/dll/cpl/console/lang/no-NO.rc b/reactos/dll/cpl/console/lang/no-NO.rc index 6da56748bd9..8a3eb71fe11 100644 --- a/reactos/dll/cpl/console/lang/no-NO.rc +++ b/reactos/dll/cpl/console/lang/no-NO.rc @@ -35,10 +35,10 @@ BEGIN LTEXT "Vindu forhåndsvisning:", -1, 10, 10, 94, 10 LTEXT "Størrelse:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Skrift:", -1, 10, 105, 33, 10 CHECKBOX "&Fet skrift", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Hver tegn er:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/pl-PL.rc b/reactos/dll/cpl/console/lang/pl-PL.rc index 51b5bb0c59a..f7e8d7c3588 100644 --- a/reactos/dll/cpl/console/lang/pl-PL.rc +++ b/reactos/dll/cpl/console/lang/pl-PL.rc @@ -42,10 +42,10 @@ BEGIN LTEXT "Okno podglądu", -1, 10, 7, 65, 10 LTEXT "Rozmiar", -1, 130, 10, 30, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 115, 70 - LISTBOX IDC_LBOX_FONTS, 130, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 130, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Czcionka", -1, 10, 105, 35, 10 CHECKBOX "&Pogrubiona czcionka", IDC_CHECK_BOLD_FONTS, 45, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 50, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 50, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 10, 155, 200, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 15, 165, 95, 35 LTEXT "Pogrubiona czcionka:", -1, 130, 165, 75, 10 diff --git a/reactos/dll/cpl/console/lang/ro-RO.rc b/reactos/dll/cpl/console/lang/ro-RO.rc index 90e877261ef..6f17ed30790 100644 --- a/reactos/dll/cpl/console/lang/ro-RO.rc +++ b/reactos/dll/cpl/console/lang/ro-RO.rc @@ -44,10 +44,10 @@ BEGIN LTEXT "Previzionare:", -1, 10, 10, 94, 10 LTEXT "&Mărime:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "F&ont:", -1, 10, 105, 33, 10 CHECKBOX "&Aldin", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Fiecare caracter are:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/ru-RU.rc b/reactos/dll/cpl/console/lang/ru-RU.rc index 359c1d0ea17..13e60dd0861 100644 --- a/reactos/dll/cpl/console/lang/ru-RU.rc +++ b/reactos/dll/cpl/console/lang/ru-RU.rc @@ -37,10 +37,10 @@ BEGIN LTEXT "Окно предпросмотра:", -1, 10, 10, 94, 10 LTEXT "Размер:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Шрифт:", -1, 10, 105, 33, 10 CHECKBOX "&Жирный", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Каждый символ:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/sk-SK.rc b/reactos/dll/cpl/console/lang/sk-SK.rc index e5d5f128eaf..09df76713af 100644 --- a/reactos/dll/cpl/console/lang/sk-SK.rc +++ b/reactos/dll/cpl/console/lang/sk-SK.rc @@ -39,10 +39,10 @@ BEGIN LTEXT "Ukážka okna:", -1, 10, 10, 94, 10 LTEXT "Veľkosť:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Písmo:", -1, 10, 105, 33, 10 CHECKBOX "&Tučné písma", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Každý znak je:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/sq-AL.rc b/reactos/dll/cpl/console/lang/sq-AL.rc index ee7fefd3d47..b61d4488c8c 100644 --- a/reactos/dll/cpl/console/lang/sq-AL.rc +++ b/reactos/dll/cpl/console/lang/sq-AL.rc @@ -39,10 +39,10 @@ BEGIN LTEXT "Dritare Preview:", -1, 10, 10, 94, 10 LTEXT "Masë:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Statik", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Font:", -1, 10, 105, 33, 10 CHECKBOX "&Bold fonts", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Statik", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Çdo krarakter është:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/tr-TR.rc b/reactos/dll/cpl/console/lang/tr-TR.rc index b4675588107..4801f2d9a4e 100644 --- a/reactos/dll/cpl/console/lang/tr-TR.rc +++ b/reactos/dll/cpl/console/lang/tr-TR.rc @@ -37,10 +37,10 @@ BEGIN LTEXT "Pencere Ön İzlemesi:", -1, 10, 10, 94, 10 LTEXT "Boyutlar:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Yazı Tipi:", -1, 10, 105, 33, 10 CHECKBOX "&Kalın Yazı Tipleri", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Her bir damga:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/uk-UA.rc b/reactos/dll/cpl/console/lang/uk-UA.rc index a5ab20c5536..c98f33c127d 100644 --- a/reactos/dll/cpl/console/lang/uk-UA.rc +++ b/reactos/dll/cpl/console/lang/uk-UA.rc @@ -37,10 +37,10 @@ BEGIN LTEXT "Зразок вікна", -1, 10, 10, 94, 10 LTEXT "Size:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&Шрифт:", -1, 10, 105, 33, 10 CHECKBOX "&Жирні", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "Кожен символ:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/lang/zh-CN.rc b/reactos/dll/cpl/console/lang/zh-CN.rc index acbba33eb5a..409f531e67f 100644 --- a/reactos/dll/cpl/console/lang/zh-CN.rc +++ b/reactos/dll/cpl/console/lang/zh-CN.rc @@ -37,10 +37,10 @@ BEGIN LTEXT "窗口预览:", -1, 10, 10, 94, 10 LTEXT "大小:", -1, 180, 10, 36, 10 CONTROL "", IDC_STATIC_FONT_WINDOW_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 10, 20, 163, 74 - LISTBOX IDC_LBOX_FONTS, 181, 20, 55, 80, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTSIZE, 181, 20, 55, 80, LBS_SORT | LBS_DISABLENOSCROLL | WS_VSCROLL LTEXT "&字体(&F):", -1, 10, 105, 33, 10 CHECKBOX "粗体(&B)", IDC_CHECK_BOLD_FONTS, 56, 105, 60, 10 - LISTBOX IDC_LBOX_TYPE, 10, 120, 110, 40, LBS_DISABLENOSCROLL | WS_VSCROLL + LISTBOX IDC_LBOX_FONTTYPE, 10, 120, 110, 40, LBS_SORT | LBS_HASSTRINGS | LBS_DISABLENOSCROLL | WS_VSCROLL GROUPBOX "", IDC_GROUPBOX_FONT_NAME, 6, 156, 241, 50 CONTROL "", IDC_STATIC_SELECT_FONT_PREVIEW, "Static", SS_OWNERDRAW | SS_SUNKEN, 16, 165, 95, 35 LTEXT "每个字符为:", -1, 124, 166, 75, 10 diff --git a/reactos/dll/cpl/console/layout.c b/reactos/dll/cpl/console/layout.c index e88ac5868eb..6651bb43911 100644 --- a/reactos/dll/cpl/console/layout.c +++ b/reactos/dll/cpl/console/layout.c @@ -2,8 +2,9 @@ * PROJECT: ReactOS Console Configuration DLL * LICENSE: GPL - See COPYING in the top level directory * FILE: dll/win32/console/layout.c - * PURPOSE: displays layout dialog + * PURPOSE: Layout dialog * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org) + * Hermes Belusca-Maito (hermes.belusca@sfr.fr) */ #include "console.h" diff --git a/reactos/dll/cpl/console/options.c b/reactos/dll/cpl/console/options.c index d0e5bc5a809..c5b0056d442 100644 --- a/reactos/dll/cpl/console/options.c +++ b/reactos/dll/cpl/console/options.c @@ -2,7 +2,7 @@ * PROJECT: ReactOS Console Configuration DLL * LICENSE: GPL - See COPYING in the top level directory * FILE: dll/win32/console/options.c - * PURPOSE: displays options dialog + * PURPOSE: Options dialog * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org) */ diff --git a/reactos/dll/cpl/console/resource.h b/reactos/dll/cpl/console/resource.h index c0537b97cfc..18c53cc9837 100644 --- a/reactos/dll/cpl/console/resource.h +++ b/reactos/dll/cpl/console/resource.h @@ -34,9 +34,9 @@ #define IDC_STATIC_SELECT_FONT_PREVIEW 401 #define IDC_FONT_SIZE_X 402 #define IDC_FONT_SIZE_Y 403 -#define IDC_LBOX_FONTS 404 +#define IDC_LBOX_FONTSIZE 404 #define IDC_STATIC_FONT_WINDOW_PREVIEW 405 -#define IDC_LBOX_TYPE 406 +#define IDC_LBOX_FONTTYPE 406 #define IDC_GROUPBOX_FONT_NAME 407 /* Layout dialog */ From 53ee3ac14aaa0b5195bc4e0674640a205c9022d8 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 13 Apr 2014 05:09:17 +0000 Subject: [PATCH 309/419] [RAPPS] - Use ES_AUTOHSCROLL for edit boxes. Patch by Ricardo Hanke CORE-8006 #resolve svn path=/trunk/; revision=62731 --- reactos/base/applications/rapps/lang/bg-BG.rc | 2 +- reactos/base/applications/rapps/lang/cs-CZ.rc | 2 +- reactos/base/applications/rapps/lang/de-DE.rc | 2 +- reactos/base/applications/rapps/lang/en-US.rc | 2 +- reactos/base/applications/rapps/lang/es-ES.rc | 2 +- reactos/base/applications/rapps/lang/fr-FR.rc | 2 +- reactos/base/applications/rapps/lang/he-IL.rc | 2 +- reactos/base/applications/rapps/lang/it-IT.rc | 2 +- reactos/base/applications/rapps/lang/ja-JP.rc | 2 +- reactos/base/applications/rapps/lang/no-NO.rc | 2 +- reactos/base/applications/rapps/lang/pl-PL.rc | 2 +- reactos/base/applications/rapps/lang/pt-BR.rc | 2 +- reactos/base/applications/rapps/lang/ro-RO.rc | 2 +- reactos/base/applications/rapps/lang/ru-RU.rc | 2 +- reactos/base/applications/rapps/lang/sk-SK.rc | 2 +- reactos/base/applications/rapps/lang/sq-AL.rc | 2 +- reactos/base/applications/rapps/lang/sv-SE.rc | 2 +- reactos/base/applications/rapps/lang/tr-TR.rc | 2 +- reactos/base/applications/rapps/lang/uk-UA.rc | 2 +- reactos/base/applications/rapps/lang/zh-CN.rc | 2 +- reactos/base/applications/rapps/lang/zh-TW.rc | 2 +- reactos/base/applications/rapps/toolbar.c | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/reactos/base/applications/rapps/lang/bg-BG.rc b/reactos/base/applications/rapps/lang/bg-BG.rc index f3037bd6903..647756a7379 100644 --- a/reactos/base/applications/rapps/lang/bg-BG.rc +++ b/reactos/base/applications/rapps/lang/bg-BG.rc @@ -67,7 +67,7 @@ BEGIN AUTOCHECKBOX "&Вписване на слаганията и маханията на приложения", IDC_LOG_ENABLED, 15, 46, 223, 12 GROUPBOX "Сваляне", -1, 4, 65, 244, 51 LTEXT "Папка за свалените файлове", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "Из&бор", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "След слагане, използваните файлове да се изтриват", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Подразбирано", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/cs-CZ.rc b/reactos/base/applications/rapps/lang/cs-CZ.rc index 24810bb4402..7202c36141e 100644 --- a/reactos/base/applications/rapps/lang/cs-CZ.rc +++ b/reactos/base/applications/rapps/lang/cs-CZ.rc @@ -68,7 +68,7 @@ BEGIN AUTOCHECKBOX "Ukládat &záznam instalací a odstranění programů", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Stahování", -1, 4, 65, 240, 51 LTEXT "Složka se staženými soubory:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Procházet...", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Smazat instalátor programu po dokončení instalace", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Výchozí", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/de-DE.rc b/reactos/base/applications/rapps/lang/de-DE.rc index c2a2dbeea4f..f32a3762b78 100644 --- a/reactos/base/applications/rapps/lang/de-DE.rc +++ b/reactos/base/applications/rapps/lang/de-DE.rc @@ -63,7 +63,7 @@ BEGIN AUTOCHECKBOX "Hinzufügen und Entfernen von Programmen mit&loggen", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Download", -1, 4, 65, 240, 51 LTEXT "Ordner für Downloads:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Wählen", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Installer nach Programminstallation löschen", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Vorgabe", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/en-US.rc b/reactos/base/applications/rapps/lang/en-US.rc index 7d198375fb2..55f375bbb7b 100644 --- a/reactos/base/applications/rapps/lang/en-US.rc +++ b/reactos/base/applications/rapps/lang/en-US.rc @@ -63,7 +63,7 @@ BEGIN AUTOCHECKBOX "&Log of installation and removal of programs", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Downloading", -1, 4, 65, 240, 51 LTEXT "Downloads folder:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Choose", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Delete program installer after installation", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Default", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/es-ES.rc b/reactos/base/applications/rapps/lang/es-ES.rc index 4c61ccbb11c..8dcab10cbd6 100644 --- a/reactos/base/applications/rapps/lang/es-ES.rc +++ b/reactos/base/applications/rapps/lang/es-ES.rc @@ -63,7 +63,7 @@ BEGIN AUTOCHECKBOX "&Registro de programas instalados y desinstalados", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Descargando ", -1, 4, 65, 240, 51 LTEXT "Carpeta de descargas:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Seleccionar", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Borrar el instalador del programa tras su instalación", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Por defecto", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/fr-FR.rc b/reactos/base/applications/rapps/lang/fr-FR.rc index 8704703e8d4..b57643333e3 100644 --- a/reactos/base/applications/rapps/lang/fr-FR.rc +++ b/reactos/base/applications/rapps/lang/fr-FR.rc @@ -63,7 +63,7 @@ BEGIN AUTOCHECKBOX "&Journal de l'installation de la suppression des programmes", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Téléchargement", -1, 4, 65, 240, 51 LTEXT "Fichier des téléchargements :", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Sélectionner", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Supprimer l'installateur du programme après l'installation", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Par défaut", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/he-IL.rc b/reactos/base/applications/rapps/lang/he-IL.rc index 9f467b69d2d..d53d833f77e 100644 --- a/reactos/base/applications/rapps/lang/he-IL.rc +++ b/reactos/base/applications/rapps/lang/he-IL.rc @@ -65,7 +65,7 @@ BEGIN AUTOCHECKBOX "תעד התקנה והסרה של תכניות", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "הורדה", -1, 4, 65, 240, 51 LTEXT "תיקיית הורדות:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "בחר", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "מחק את קובץ ההתקנה לאחר סיום ההתקנה", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "ברירת מחדל", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/it-IT.rc b/reactos/base/applications/rapps/lang/it-IT.rc index 149b0cbd575..595b35ea7c9 100644 --- a/reactos/base/applications/rapps/lang/it-IT.rc +++ b/reactos/base/applications/rapps/lang/it-IT.rc @@ -63,7 +63,7 @@ BEGIN AUTOCHECKBOX "&Registra la installazione o disinstallazione dei programmi", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Downloading", -1, 4, 65, 240, 51 LTEXT "Cartella:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Scegli", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Rimuovere la procedura di installazione dopo l'uso", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Predefiniti", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/ja-JP.rc b/reactos/base/applications/rapps/lang/ja-JP.rc index c0116d3c304..a49e4b91bc4 100644 --- a/reactos/base/applications/rapps/lang/ja-JP.rc +++ b/reactos/base/applications/rapps/lang/ja-JP.rc @@ -63,7 +63,7 @@ BEGIN AUTOCHECKBOX "プログラムのインストールと削除を記録する(&L)", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "ダウンロード処理", -1, 4, 65, 240, 51 LTEXT "ダウンロードするフォルダ:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "選択(&C)", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "インストール後にプログラムのインストーラを削除する(&D)", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "デフォルト", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/no-NO.rc b/reactos/base/applications/rapps/lang/no-NO.rc index 518b109dec5..f93acbee9fc 100644 --- a/reactos/base/applications/rapps/lang/no-NO.rc +++ b/reactos/base/applications/rapps/lang/no-NO.rc @@ -63,7 +63,7 @@ BEGIN AUTOCHECKBOX "&Log of installation and removal of programs", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Downloading", -1, 4, 65, 240, 51 LTEXT "Folder for downloadings:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Choose", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Delete installers of programs after installation", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Default", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/pl-PL.rc b/reactos/base/applications/rapps/lang/pl-PL.rc index 101f18a1c93..b60efaf3b64 100644 --- a/reactos/base/applications/rapps/lang/pl-PL.rc +++ b/reactos/base/applications/rapps/lang/pl-PL.rc @@ -71,7 +71,7 @@ BEGIN AUTOCHECKBOX "Zap&isuj dziennik instalacji i usuwania programów", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Pobieranie", -1, 4, 65, 240, 51 LTEXT "Katalog dla pobranych plików:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Wybierz", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Usuń instalatory programów po ich zainstalowaniu", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Domyślne", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/pt-BR.rc b/reactos/base/applications/rapps/lang/pt-BR.rc index bbd429998c8..1ff56b713bf 100644 --- a/reactos/base/applications/rapps/lang/pt-BR.rc +++ b/reactos/base/applications/rapps/lang/pt-BR.rc @@ -65,7 +65,7 @@ BEGIN AUTOCHECKBOX "&Registro de instalação e remoção de programas", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Baixando", -1, 4, 65, 240, 51 LTEXT "Pasta de download:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Escolher", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Deletar instalador após a instalação do programa", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Padrão", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/ro-RO.rc b/reactos/base/applications/rapps/lang/ro-RO.rc index b555380193c..3f86fce3857 100644 --- a/reactos/base/applications/rapps/lang/ro-RO.rc +++ b/reactos/base/applications/rapps/lang/ro-RO.rc @@ -69,7 +69,7 @@ BEGIN AUTOCHECKBOX "&Menține jurnal de instalare/dezinstalare a aplicațiilor", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Descărcări", -1, 4, 65, 240, 51 LTEXT "Dosarul pentru descărcări:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "Spe&cificare…", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "Șt&erge instalatorul aplicației după instalare", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "&Implicite", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/ru-RU.rc b/reactos/base/applications/rapps/lang/ru-RU.rc index a37a8e33224..339599a8b14 100644 --- a/reactos/base/applications/rapps/lang/ru-RU.rc +++ b/reactos/base/applications/rapps/lang/ru-RU.rc @@ -63,7 +63,7 @@ BEGIN AUTOCHECKBOX "&Вести лог установки/удаления программ", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Загрузка", -1, 4, 65, 240, 51 LTEXT "Папка для загрузок:", -1, 16, 75, 77, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "В&ыбрать", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Удалять инсталляторы программ после установки", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "По умолчанию", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/sk-SK.rc b/reactos/base/applications/rapps/lang/sk-SK.rc index 63e16a249e7..cc6e16d1355 100644 --- a/reactos/base/applications/rapps/lang/sk-SK.rc +++ b/reactos/base/applications/rapps/lang/sk-SK.rc @@ -68,7 +68,7 @@ BEGIN AUTOCHECKBOX "&Záznam o inštalovaní a odstránení programov", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Sťahovanie", -1, 4, 65, 240, 51 LTEXT "Priečinok pre sťahovanie:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Vybrať", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Zmazať inštalačné programy po nainštalovaní", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Predvolené", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/sq-AL.rc b/reactos/base/applications/rapps/lang/sq-AL.rc index 1432b924ce7..9c0e6d7d76f 100644 --- a/reactos/base/applications/rapps/lang/sq-AL.rc +++ b/reactos/base/applications/rapps/lang/sq-AL.rc @@ -67,7 +67,7 @@ BEGIN AUTOCHECKBOX "&Log instalalimin dhe heqjen e programeve", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Shkarko", -1, 4, 65, 240, 51 LTEXT "Dosja e shkarkimit:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "Zgjedh", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "Fshi instaluesit e programeve pas instalimit", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Parazgjedhur", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/sv-SE.rc b/reactos/base/applications/rapps/lang/sv-SE.rc index d3082ffb506..34054adfadd 100644 --- a/reactos/base/applications/rapps/lang/sv-SE.rc +++ b/reactos/base/applications/rapps/lang/sv-SE.rc @@ -70,7 +70,7 @@ BEGIN AUTOCHECKBOX "&Logga ur installation och borttagning program", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Nerladding", -1, 4, 65, 240, 51 LTEXT "Mapp för nerladdningar:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Välj", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Ta bort programinstallerare efter installation", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Standard", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/tr-TR.rc b/reactos/base/applications/rapps/lang/tr-TR.rc index fe22b4c7f1e..7e20c851cb8 100644 --- a/reactos/base/applications/rapps/lang/tr-TR.rc +++ b/reactos/base/applications/rapps/lang/tr-TR.rc @@ -65,7 +65,7 @@ BEGIN AUTOCHECKBOX "&İzlencelerin Kuruluşlarını ve Kaldırılışlarını Kaydet", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "İndirme", -1, 4, 65, 240, 51 LTEXT "İndirme Dizini:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Seç", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Kurulumdan Sonra İzlencenin Kurulum Kütüğünü Sil", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Ön Tanımlılar", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/uk-UA.rc b/reactos/base/applications/rapps/lang/uk-UA.rc index d7d06155dcf..b42b37d3fe2 100644 --- a/reactos/base/applications/rapps/lang/uk-UA.rc +++ b/reactos/base/applications/rapps/lang/uk-UA.rc @@ -71,7 +71,7 @@ BEGIN AUTOCHECKBOX "&Вести звіт встановлення/видалення програм", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Завантаження", -1, 4, 65, 240, 51 LTEXT "Тека для завантажень:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "&Обрати", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Видаляти інсталятори програм після встановлення", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Стандартно", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/zh-CN.rc b/reactos/base/applications/rapps/lang/zh-CN.rc index 15cb09097d1..87f514c39a9 100644 --- a/reactos/base/applications/rapps/lang/zh-CN.rc +++ b/reactos/base/applications/rapps/lang/zh-CN.rc @@ -65,7 +65,7 @@ BEGIN AUTOCHECKBOX "将程序的安装和卸载记录到日志(&L)", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "正在下载", -1, 4, 65, 240, 51 LTEXT "下载文件夹:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "选择(&C)", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "在安装完程序后删除安装程序(&D)", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "缺省", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/lang/zh-TW.rc b/reactos/base/applications/rapps/lang/zh-TW.rc index 649b662532c..d2f16da7b76 100644 --- a/reactos/base/applications/rapps/lang/zh-TW.rc +++ b/reactos/base/applications/rapps/lang/zh-TW.rc @@ -65,7 +65,7 @@ BEGIN AUTOCHECKBOX "將程式的安裝和解除安裝記錄到日誌(&L)", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "正在下載", -1, 4, 65, 240, 51 LTEXT "下載資料夾:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL PUSHBUTTON "選擇(&C)", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "在安裝完程式後刪除安裝程式(&D)", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "預設", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/toolbar.c b/reactos/base/applications/rapps/toolbar.c index 31ce6032673..f1bbc80f030 100644 --- a/reactos/base/applications/rapps/toolbar.c +++ b/reactos/base/applications/rapps/toolbar.c @@ -119,7 +119,7 @@ CreateSearchBar(VOID) hSearchBar = CreateWindowExW(WS_EX_CLIENTEDGE, L"Edit", NULL, - WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOVSCROLL, + WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL, 0, 5, 200, From cccfe2354101a9b805109f6be415ea5d7ed476c6 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 13 Apr 2014 05:41:19 +0000 Subject: [PATCH 310/419] =?UTF-8?q?[BROWSEUI]=20-=20Add=20more=20tests=20f?= =?UTF-8?q?or=20SHExplorerParseCmdLine.=20Patch=20by=20Edijs=20Kolesnikovi?= =?UTF-8?q?=C4=8Ds=20CORE-7627=20#resolve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=62732 --- .../browseui/SHExplorerParseCmdLine.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/rostests/apitests/browseui/SHExplorerParseCmdLine.c b/rostests/apitests/browseui/SHExplorerParseCmdLine.c index 1bd37e6fa16..7352776f8de 100644 --- a/rostests/apitests/browseui/SHExplorerParseCmdLine.c +++ b/rostests/apitests/browseui/SHExplorerParseCmdLine.c @@ -115,13 +115,18 @@ START_TEST(SHExplorerParseCmdLine) PCWSTR PidlPath; } Tests[] = { - { L"", -1, CSIDL_MYDOCUMENTS, 0x00000009 }, - { L"/e", TRUE, PIDL_IS_UNTOUCHED, 0x00000008 }, - { L"/n", TRUE, PIDL_IS_UNTOUCHED, 0x00004001 }, - { L"/x", TRUE, PIDL_IS_NULL, 0x02000000, L"/x" }, - { L"-e", TRUE, PIDL_IS_NULL, 0x02000000, L"-e" }, - { L"C:\\", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\" }, - { L"/e,C:\\", TRUE, PIDL_IS_PATH, 0x00000208, NULL, L"C:\\" }, + { L"", -1, CSIDL_MYDOCUMENTS, 0x00000009 }, + { L"/e", TRUE, PIDL_IS_UNTOUCHED, 0x00000008 }, + { L"/n", TRUE, PIDL_IS_UNTOUCHED, 0x00004001 }, + { L"/x", TRUE, PIDL_IS_NULL, 0x02000000, L"/x" }, + { L"-e", TRUE, PIDL_IS_NULL, 0x02000000, L"-e" }, + { L"C:\\", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"C:\\" }, + { L"/e,C:\\", TRUE, PIDL_IS_PATH, 0x00000208, NULL, L"C:\\" }, + { L"/select,C:\\", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"C:\\" }, + { L"/e,::{20d04fe0-3aea-1069-a2d8-08002b30309d}", TRUE, PIDL_IS_PATH, 0x00000208, NULL, L"::{20d04fe0-3aea-1069-a2d8-08002b30309d}" }, + { L"::{645ff040-5081-101b-9f08-00aa002f954e}", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::{645ff040-5081-101b-9f08-00aa002f954e}" }, + { L"/select,::{450d8fba-ad25-11d0-98a8-0800361b1103}", TRUE, PIDL_IS_PATH, 0x00000240, NULL, L"::{450d8fba-ad25-11d0-98a8-0800361b1103}" }, + { L"=", TRUE, PIDL_IS_PATH, 0x00000200, NULL, L"::{20d04fe0-3aea-1069-a2d8-08002b30309d}" }, /* TODO: needs a lot more testcases */ }; const int TestCount = sizeof(Tests) / sizeof(Tests[0]); From 87a883ba7dcd308b36263569b6c91f4f3b0c5dbb Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 13 Apr 2014 05:50:09 +0000 Subject: [PATCH 311/419] [UTF16LE] - Use binary mode for input and output files. Patch by Tomoya Kitagawa CORE-7705 #resolve #comment Committed in r62733. Thanks! svn path=/trunk/; revision=62733 --- reactos/tools/utf16le/utf16le.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/tools/utf16le/utf16le.cpp b/reactos/tools/utf16le/utf16le.cpp index 54b23b26d03..8f4fa29bc40 100644 --- a/reactos/tools/utf16le/utf16le.cpp +++ b/reactos/tools/utf16le/utf16le.cpp @@ -35,13 +35,13 @@ class utf_converter utf_converter(string ifname, string ofname, enc_types enc = detect) : error(none), encoding(enc), fill(0), index(0) { enc_types tmp_enc; - inputfile.open(ifname.c_str(), ios::in); + inputfile.open(ifname.c_str(), ios::in | ios::binary); if (!inputfile) { error = iopen; return; } - outputfile.open(ofname.c_str(), ios::out); + outputfile.open(ofname.c_str(), ios::out | ios::binary); if (!outputfile) { error = oopen; From d3b058d4eb0a90cc5fbc8f0a7e4ae4d30709c111 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 13 Apr 2014 07:14:47 +0000 Subject: [PATCH 312/419] =?UTF-8?q?[NTDLL=5FAPITEST]=20-=20Fix=20test=20fa?= =?UTF-8?q?ilure=20on=20Windows.=20Based=20on=20patch=20by=20V=C3=ADctor?= =?UTF-8?q?=20Mart=C3=ADnez=20ROSTESTS-132=20#resolve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=62734 --- rostests/apitests/ntdll/SystemInfo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rostests/apitests/ntdll/SystemInfo.c b/rostests/apitests/ntdll/SystemInfo.c index 9a4eb2d801e..f93eee6743d 100644 --- a/rostests/apitests/ntdll/SystemInfo.c +++ b/rostests/apitests/ntdll/SystemInfo.c @@ -26,6 +26,7 @@ GetPrivilege() tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, NULL, 0); + CloseHandle(hToken); } @@ -37,8 +38,6 @@ Test_TimeAdjustment(void) NTSTATUS Status; ULONG ReturnLength; - GetPrivilege(); - SetTimeInfo.TimeAdjustment = 0; SetTimeInfo.Enable = 0; From 6d83ec90e4312e13fc1577e1af209161d2c015f2 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sun, 13 Apr 2014 11:41:19 +0000 Subject: [PATCH 313/419] [Win32k] - Add two more Gdi32 counterparts for Win32k and fix the others. svn path=/trunk/; revision=62735 --- reactos/win32ss/gdi/ntgdi/coord.h | 3 +- reactos/win32ss/gdi/ntgdi/dcutil.c | 51 ++++++++++++++++++++++++++---- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/coord.h b/reactos/win32ss/gdi/ntgdi/coord.h index 2f3386b2410..6b80232f9ac 100644 --- a/reactos/win32ss/gdi/ntgdi/coord.h +++ b/reactos/win32ss/gdi/ntgdi/coord.h @@ -150,4 +150,5 @@ GreModifyWorldTransform( VOID FASTCALL IntMirrorWindowOrg(PDC); int APIENTRY IntGdiSetMapMode(PDC, int); - +BOOL FASTCALL GreLPtoDP(HDC, LPPOINT, INT); +BOOL FASTCALL GreDPtoLP(HDC, LPPOINT, INT); diff --git a/reactos/win32ss/gdi/ntgdi/dcutil.c b/reactos/win32ss/gdi/ntgdi/dcutil.c index 2fb9cb3e0c8..e4a6f40bb19 100644 --- a/reactos/win32ss/gdi/ntgdi/dcutil.c +++ b/reactos/win32ss/gdi/ntgdi/dcutil.c @@ -3,40 +3,77 @@ #define NDEBUG #include -int FASTCALL -GreGetBkMode(HDC hdc) +BOOL FASTCALL +GreDPtoLP(HDC hdc, LPPOINT lpPoints, INT nCount) { PDC dc; if (!(dc = DC_LockDc(hdc))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + IntDPtoLP(dc, lpPoints, nCount); + DC_UnlockDc(dc); + return TRUE; +} + +BOOL FASTCALL +GreLPtoDP(HDC hdc, LPPOINT lpPoints, INT nCount) +{ + PDC dc; + if (!(dc = DC_LockDc(hdc))) + { + EngSetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + IntLPtoDP(dc, lpPoints, nCount); + DC_UnlockDc(dc); + return TRUE; +} + +int FASTCALL +GreGetBkMode(HDC hdc) +{ + PDC dc; + LONG lBkMode; + if (!(dc = DC_LockDc(hdc))) { EngSetLastError(ERROR_INVALID_HANDLE); return CLR_INVALID; } - return dc->pdcattr->lBkMode; + lBkMode = dc->pdcattr->lBkMode; + DC_UnlockDc(dc); + return lBkMode; } int FASTCALL GreGetMapMode(HDC hdc) { PDC dc; + INT iMapMode; if (!(dc = DC_LockDc(hdc))) { EngSetLastError(ERROR_INVALID_HANDLE); return CLR_INVALID; } - return dc->pdcattr->iMapMode; + iMapMode = dc->pdcattr->iMapMode; + DC_UnlockDc(dc); + return iMapMode; } COLORREF FASTCALL GreGetTextColor(HDC hdc) { PDC dc; + ULONG ulForegroundClr; if (!(dc = DC_LockDc(hdc))) { EngSetLastError(ERROR_INVALID_HANDLE); return CLR_INVALID; } - return dc->pdcattr->ulForegroundClr; + ulForegroundClr = dc->pdcattr->ulForegroundClr; + DC_UnlockDc(dc); + return ulForegroundClr; } COLORREF FASTCALL @@ -153,6 +190,7 @@ IntSetDCBrushColor(HDC hdc, COLORREF crColor) dc->pdcattr->crBrushClr = crColor; } } + DC_UnlockDc(dc); return OldColor; } @@ -175,7 +213,7 @@ IntSetDCPenColor(HDC hdc, COLORREF crColor) dc->pdcattr->ulDirty_ |= DIRTY_LINE; dc->pdcattr->crPenClr = crColor; } - + DC_UnlockDc(dc); return OldColor; } @@ -199,6 +237,7 @@ GreSetStretchBltMode(HDC hDC, int iStretchMode) pdcattr->jStretchBltMode = iStretchMode; } + DC_UnlockDc(pdc); return oSMode; } From d585b0d8e5254e6165ab7ae2968a3988b0ed85a5 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 13 Apr 2014 12:04:13 +0000 Subject: [PATCH 314/419] [NTOS:KE] - When switching to VM86 mode, ensure a 16 byte aligned floating point save area. CORE-7581 #resolve svn path=/trunk/; revision=62736 --- reactos/ntoskrnl/include/internal/i386/ke.h | 1 + reactos/ntoskrnl/ke/i386/ctxswitch.S | 4 ++-- reactos/ntoskrnl/ke/i386/v86vdm.c | 14 ++++++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/i386/ke.h b/reactos/ntoskrnl/include/internal/i386/ke.h index d461a01187e..d6d3906b94c 100644 --- a/reactos/ntoskrnl/include/internal/i386/ke.h +++ b/reactos/ntoskrnl/include/internal/i386/ke.h @@ -557,6 +557,7 @@ FORCEINLINE PFX_SAVE_AREA KiGetThreadNpxArea(IN PKTHREAD Thread) { + ASSERT((ULONG_PTR)Thread->InitialStack % 16 == 0); return (PFX_SAVE_AREA)((ULONG_PTR)Thread->InitialStack - sizeof(FX_SAVE_AREA)); } diff --git a/reactos/ntoskrnl/ke/i386/ctxswitch.S b/reactos/ntoskrnl/ke/i386/ctxswitch.S index 1d0ebe46933..474034273ef 100644 --- a/reactos/ntoskrnl/ke/i386/ctxswitch.S +++ b/reactos/ntoskrnl/ke/i386/ctxswitch.S @@ -143,7 +143,7 @@ _Ki386SetupAndExitToV86Mode@4: /* Enter V8086 mode */ pushad - sub esp, (12 + KTRAP_FRAME_LENGTH + NPX_FRAME_LENGTH) + sub esp, (12 + KTRAP_FRAME_LENGTH + NPX_FRAME_LENGTH + 16) mov ecx, esp call @KiEnterV86Mode@4 jmp $ @@ -155,7 +155,7 @@ PUBLIC @Ki386BiosCallReturnAddress@4 /* Exit V8086 mode */ call @KiExitV86Mode@4 mov esp, eax - add esp, (12 + KTRAP_FRAME_LENGTH + NPX_FRAME_LENGTH) + add esp, (12 + KTRAP_FRAME_LENGTH + NPX_FRAME_LENGTH + 16) popad ret 4 diff --git a/reactos/ntoskrnl/ke/i386/v86vdm.c b/reactos/ntoskrnl/ke/i386/v86vdm.c index 8f241bedd50..aee93898837 100644 --- a/reactos/ntoskrnl/ke/i386/v86vdm.c +++ b/reactos/ntoskrnl/ke/i386/v86vdm.c @@ -465,6 +465,7 @@ ULONG_PTR FASTCALL KiExitV86Mode(IN PKTRAP_FRAME TrapFrame) { + ULONG_PTR StackFrameUnaligned; PKV8086_STACK_FRAME StackFrame; PKTHREAD Thread; PKTRAP_FRAME PmTrapFrame; @@ -472,10 +473,12 @@ KiExitV86Mode(IN PKTRAP_FRAME TrapFrame) PFX_SAVE_AREA NpxFrame; /* Get the stack frame back */ - StackFrame = CONTAINING_RECORD(TrapFrame->Esi, KV8086_STACK_FRAME, V86Frame); + StackFrameUnaligned = TrapFrame->Esi; + StackFrame = (PKV8086_STACK_FRAME)(ROUND_UP(StackFrameUnaligned - 4, 16) + 4); PmTrapFrame = &StackFrame->TrapFrame; V86Frame = &StackFrame->V86Frame; NpxFrame = &StackFrame->NpxArea; + ASSERT((ULONG_PTR)NpxFrame % 16 == 0); /* Copy the FPU frame back */ Thread = KeGetCurrentThread(); @@ -493,18 +496,21 @@ KiExitV86Mode(IN PKTRAP_FRAME TrapFrame) /* Enable interrupts and return a pointer to the trap frame */ _enable(); - return (ULONG)PmTrapFrame; + return StackFrameUnaligned; } VOID FASTCALL -KiEnterV86Mode(IN PKV8086_STACK_FRAME StackFrame) +KiEnterV86Mode(IN ULONG_PTR StackFrameUnaligned) { PKTHREAD Thread; + PKV8086_STACK_FRAME StackFrame = (PKV8086_STACK_FRAME)(ROUND_UP(StackFrameUnaligned - 4, 16) + 4); PKTRAP_FRAME TrapFrame = &StackFrame->TrapFrame; PKV86_FRAME V86Frame = &StackFrame->V86Frame; PFX_SAVE_AREA NpxFrame = &StackFrame->NpxArea; + ASSERT((ULONG_PTR)NpxFrame % 16 == 0); + /* Build fake user-mode trap frame */ TrapFrame->SegCs = KGDT_R0_CODE | RPL_MASK; TrapFrame->SegEs = TrapFrame->SegDs = TrapFrame->SegFs = TrapFrame->SegGs = 0; @@ -522,7 +528,7 @@ KiEnterV86Mode(IN PKV8086_STACK_FRAME StackFrame) TrapFrame->Eip = (ULONG_PTR)Ki386BiosCallReturnAddress; /* Save our stack (after the frames) */ - TrapFrame->Esi = (ULONG_PTR)V86Frame; + TrapFrame->Esi = StackFrameUnaligned; TrapFrame->Edi = (ULONG_PTR)_AddressOfReturnAddress() + 4; /* Sanitize EFlags and enable interrupts */ From 09c6736145ecd0ecc731e6d915a8cbfa6d771a3a Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 13 Apr 2014 12:20:31 +0000 Subject: [PATCH 315/419] [SHELL32] - Use C++-style casts. Patch by Ivan Rodionov. CORE-7698 #resolve svn path=/trunk/; revision=62737 --- reactos/dll/win32/shell32/autocomplete.cpp | 4 ++-- reactos/dll/win32/shell32/desktop.cpp | 5 ++--- reactos/dll/win32/shell32/drvdefext.cpp | 10 +++++----- reactos/dll/win32/shell32/enumidlist.cpp | 2 +- reactos/dll/win32/shell32/filedefext.cpp | 8 ++++---- reactos/dll/win32/shell32/folders/recyclebin.cpp | 2 +- reactos/dll/win32/shell32/newmenu.cpp | 4 ++-- reactos/dll/win32/shell32/openwithmenu.cpp | 8 ++++---- reactos/dll/win32/shell32/shelllink.cpp | 10 +++++----- reactos/dll/win32/shell32/shlview.cpp | 2 +- 10 files changed, 27 insertions(+), 28 deletions(-) diff --git a/reactos/dll/win32/shell32/autocomplete.cpp b/reactos/dll/win32/shell32/autocomplete.cpp index 8d1352e620b..f7d27dcdf78 100644 --- a/reactos/dll/win32/shell32/autocomplete.cpp +++ b/reactos/dll/win32/shell32/autocomplete.cpp @@ -256,7 +256,7 @@ HRESULT WINAPI CAutoComplete::SetOptions(DWORD dwFlag) */ LRESULT APIENTRY CAutoComplete::ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - CAutoComplete *pThis = (CAutoComplete *)GetPropW(hwnd, autocomplete_propertyW);;//GetWindowLongPtrW(hwnd, GWLP_USERDATA); + CAutoComplete *pThis = static_cast(GetPropW(hwnd, autocomplete_propertyW));//GetWindowLongPtrW(hwnd, GWLP_USERDATA); LPOLESTR strs; HRESULT hr; WCHAR hwndText[255]; @@ -488,7 +488,7 @@ LRESULT APIENTRY CAutoComplete::ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM LRESULT APIENTRY CAutoComplete::ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - CAutoComplete *pThis = (CAutoComplete *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); + CAutoComplete *pThis = reinterpret_cast(GetWindowLongPtrW(hwnd, GWLP_USERDATA)); WCHAR *msg; int sel, len; diff --git a/reactos/dll/win32/shell32/desktop.cpp b/reactos/dll/win32/shell32/desktop.cpp index 58b95e20872..cc0b8d8808d 100644 --- a/reactos/dll/win32/shell32/desktop.cpp +++ b/reactos/dll/win32/shell32/desktop.cpp @@ -389,8 +389,7 @@ LRESULT CALLBACK CDesktopBrowser::ProgmanWindowProc(IN HWND hwnd, IN UINT uMsg, if (uMsg != WM_NCCREATE) { - pThis = (CDesktopBrowser*)GetWindowLongPtrW(hwnd, - 0); + pThis = reinterpret_cast(GetWindowLongPtrW(hwnd, 0)); if (pThis == NULL) goto DefMsgHandler; } @@ -554,7 +553,7 @@ HANDLE WINAPI SHCreateDesktop(IShellDesktopTray *ShellDesk) */ BOOL WINAPI SHDesktopMessageLoop(HANDLE hDesktop) { - CDesktopBrowser *Desk = (CDesktopBrowser *)hDesktop; + CDesktopBrowser *Desk = static_cast(hDesktop); if (Desk == NULL || Desk->Tag != SHDESK_TAG) { diff --git a/reactos/dll/win32/shell32/drvdefext.cpp b/reactos/dll/win32/shell32/drvdefext.cpp index 2379c058ff5..d24fcb87228 100644 --- a/reactos/dll/win32/shell32/drvdefext.cpp +++ b/reactos/dll/win32/shell32/drvdefext.cpp @@ -339,7 +339,7 @@ CDrvDefExt::GeneralPageProc( if (ppsp == NULL) break; - CDrvDefExt *pDrvDefExt = (CDrvDefExt*)ppsp->lParam; + CDrvDefExt *pDrvDefExt = reinterpret_cast(ppsp->lParam); SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pDrvDefExt); pDrvDefExt->InitGeneralPage(hwndDlg); return TRUE; @@ -350,7 +350,7 @@ CDrvDefExt::GeneralPageProc( if (pDrawItem->CtlID >= 14013 && pDrawItem->CtlID <= 14015) { - CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CDrvDefExt *pDrvDefExt = reinterpret_cast(GetWindowLongPtr(hwndDlg, DWLP_USER)); pDrvDefExt->PaintStaticControls(hwndDlg, pDrawItem); return TRUE; } @@ -361,7 +361,7 @@ CDrvDefExt::GeneralPageProc( case WM_COMMAND: if (LOWORD(wParam) == 14010) /* Disk Cleanup */ { - CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CDrvDefExt *pDrvDefExt = reinterpret_cast(GetWindowLongPtr(hwndDlg, DWLP_USER)); WCHAR wszBuf[256]; DWORD cbBuf = sizeof(wszBuf); @@ -395,7 +395,7 @@ CDrvDefExt::GeneralPageProc( if (lppsn->hdr.code == PSN_APPLY) { - CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CDrvDefExt *pDrvDefExt = reinterpret_cast(GetWindowLongPtr(hwndDlg, DWLP_USER)); WCHAR wszBuf[256]; if (GetDlgItemTextW(hwndDlg, 14000, wszBuf, _countof(wszBuf))) @@ -432,7 +432,7 @@ CDrvDefExt::ExtraPageProc( { WCHAR wszBuf[MAX_PATH]; DWORD cbBuf = sizeof(wszBuf); - CDrvDefExt *pDrvDefExt = (CDrvDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CDrvDefExt *pDrvDefExt = reinterpret_cast(GetWindowLongPtr(hwndDlg, DWLP_USER)); switch(LOWORD(wParam)) { diff --git a/reactos/dll/win32/shell32/enumidlist.cpp b/reactos/dll/win32/shell32/enumidlist.cpp index 203fb12010d..ee7394effae 100644 --- a/reactos/dll/win32/shell32/enumidlist.cpp +++ b/reactos/dll/win32/shell32/enumidlist.cpp @@ -45,7 +45,7 @@ BOOL IEnumIDListImpl::AddToEnumList(LPITEMIDLIST pidl) if (!pidl) return FALSE; - pNew = (ENUMLIST *)SHAlloc(sizeof(ENUMLIST)); + pNew = static_cast(SHAlloc(sizeof(ENUMLIST))); if (pNew) { /*set the next pointer */ diff --git a/reactos/dll/win32/shell32/filedefext.cpp b/reactos/dll/win32/shell32/filedefext.cpp index e64c1c1104f..82a666435cb 100644 --- a/reactos/dll/win32/shell32/filedefext.cpp +++ b/reactos/dll/win32/shell32/filedefext.cpp @@ -626,7 +626,7 @@ CFileDefExt::GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar TRACE("WM_INITDIALOG hwnd %p lParam %p ppsplParam %S\n", hwndDlg, lParam, ppsp->lParam); - CFileDefExt *pFileDefExt = (CFileDefExt*)ppsp->lParam; + CFileDefExt *pFileDefExt = reinterpret_cast(ppsp->lParam); SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pFileDefExt); pFileDefExt->InitGeneralPage(hwndDlg); break; @@ -634,7 +634,7 @@ CFileDefExt::GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case WM_COMMAND: if (LOWORD(wParam) == 14024) /* Opens With - Change */ { - CFileDefExt *pFileDefExt = (CFileDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CFileDefExt *pFileDefExt = reinterpret_cast(GetWindowLongPtr(hwndDlg, DWLP_USER)); OPENASINFO oainfo; oainfo.pcszFile = pFileDefExt->m_wszPath; oainfo.pcszClass = NULL; @@ -654,7 +654,7 @@ CFileDefExt::GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam; if (lppsn->hdr.code == PSN_APPLY) { - CFileDefExt *pFileDefExt = (CFileDefExt*)GetWindowLongPtr(hwndDlg, DWLP_USER); + CFileDefExt *pFileDefExt = reinterpret_cast(GetWindowLongPtr(hwndDlg, DWLP_USER)); /* Update attributes first */ DWORD dwAttr = GetFileAttributesW(pFileDefExt->m_wszPath); @@ -826,7 +826,7 @@ CFileDefExt::VersionPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar TRACE("WM_INITDIALOG hwnd %p lParam %p ppsplParam %x\n", hwndDlg, lParam, ppsp->lParam); - CFileDefExt *pFileDefExt = (CFileDefExt*)ppsp->lParam; + CFileDefExt *pFileDefExt = reinterpret_cast(ppsp->lParam); return pFileDefExt->InitVersionPage(hwndDlg); } case WM_COMMAND: diff --git a/reactos/dll/win32/shell32/folders/recyclebin.cpp b/reactos/dll/win32/shell32/folders/recyclebin.cpp index 648debf6a47..9b1a3895832 100644 --- a/reactos/dll/win32/shell32/folders/recyclebin.cpp +++ b/reactos/dll/win32/shell32/folders/recyclebin.cpp @@ -231,7 +231,7 @@ static LPITEMIDLIST _ILCreateRecycleItem(PDELETED_FILE_DETAILS_W pFileDetails) BOOL WINAPI CRecycleBinEnum::CBEnumRecycleBin(IN PVOID Context, IN HANDLE hDeletedFile) { - return ((CRecycleBinEnum *)Context)->CBEnumRecycleBin(hDeletedFile); + return static_cast(Context)->CBEnumRecycleBin(hDeletedFile); } BOOL WINAPI CRecycleBinEnum::CBEnumRecycleBin(IN HANDLE hDeletedFile) diff --git a/reactos/dll/win32/shell32/newmenu.cpp b/reactos/dll/win32/shell32/newmenu.cpp index 7c5f853f1d4..53dc802fa4c 100644 --- a/reactos/dll/win32/shell32/newmenu.cpp +++ b/reactos/dll/win32/shell32/newmenu.cpp @@ -165,7 +165,7 @@ CNewMenu::SHELLNEW_ITEM *CNewMenu::LoadItem(LPCWSTR pwszExt) return NULL; /* Create new item */ - SHELLNEW_ITEM *pNewItem = (SHELLNEW_ITEM *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SHELLNEW_ITEM)); + SHELLNEW_ITEM *pNewItem = static_cast(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SHELLNEW_ITEM))); if (!pNewItem) { free(pData); @@ -225,7 +225,7 @@ CNewMenu::LoadAllItems() if (!m_pLinkItem) { - m_pLinkItem = (SHELLNEW_ITEM *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SHELLNEW_ITEM)); + m_pLinkItem = static_cast(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(SHELLNEW_ITEM))); if (m_pLinkItem) { m_pLinkItem->Type = SHELLNEW_TYPE_NULLFILE; diff --git a/reactos/dll/win32/shell32/openwithmenu.cpp b/reactos/dll/win32/shell32/openwithmenu.cpp index 6648a78d85e..02e5b9fd8c4 100644 --- a/reactos/dll/win32/shell32/openwithmenu.cpp +++ b/reactos/dll/win32/shell32/openwithmenu.cpp @@ -297,9 +297,9 @@ COpenWithList::SApp *COpenWithList::AddInternal(LPCWSTR pwszFilename) /* Create new item */ if (!m_pApp) - m_pApp = (SApp*)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(m_pApp[0])); + m_pApp = static_cast(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(m_pApp[0]))); else - m_pApp = (SApp*)HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m_pApp, (m_cApp + 1)*sizeof(m_pApp[0])); + m_pApp = static_cast(HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m_pApp, (m_cApp + 1)*sizeof(m_pApp[0]))); if (!m_pApp) { ERR("Allocation failed\n"); @@ -989,13 +989,13 @@ VOID COpenWithDialog::Accept() INT_PTR CALLBACK COpenWithDialog::DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - COpenWithDialog *pThis = (COpenWithDialog*)GetWindowLongPtr(hwndDlg, DWLP_USER); + COpenWithDialog *pThis = reinterpret_cast(GetWindowLongPtr(hwndDlg, DWLP_USER)); switch(uMsg) { case WM_INITDIALOG: { - COpenWithDialog *pThis = (COpenWithDialog*)lParam; + COpenWithDialog *pThis = reinterpret_cast(lParam); pThis->Init(hwndDlg); return TRUE; diff --git a/reactos/dll/win32/shell32/shelllink.cpp b/reactos/dll/win32/shell32/shelllink.cpp index 4982f7da306..6c63a77a2a9 100644 --- a/reactos/dll/win32/shell32/shelllink.cpp +++ b/reactos/dll/win32/shell32/shelllink.cpp @@ -359,7 +359,7 @@ static HRESULT Stream_ReadChunk(IStream* stm, LPVOID *data) if (FAILED(hr) || count != sizeof(size)) return E_FAIL; - chunk = (sized_chunk *)HeapAlloc(GetProcessHeap(), 0, size); + chunk = static_cast(HeapAlloc(GetProcessHeap(), 0, size)); if (!chunk) return E_OUTOFMEMORY; @@ -421,7 +421,7 @@ static HRESULT Stream_LoadLocation(IStream *stm, if (FAILED(hr)) return hr; - LOCATION_INFO *loc = (LOCATION_INFO*) p; + LOCATION_INFO *loc = reinterpret_cast(p); if (loc->dwTotalSize < sizeof(LOCATION_INFO)) { HeapFree(GetProcessHeap(), 0, p); @@ -721,7 +721,7 @@ static HRESULT Stream_WriteLocationInfo(IStream* stm, LPCWSTR path, DWORD total_size = sizeof(*loc) + volume_info_size + path_size + final_path_size; /* create pointers to everything */ - loc = (LOCATION_INFO *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, total_size); + loc = static_cast(HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, total_size)); vol = (LOCAL_VOLUME_INFO*) &loc[1]; LPSTR szLabel = (LPSTR) &vol[1]; LPSTR szPath = &szLabel[label_size]; @@ -1954,7 +1954,7 @@ INT_PTR CALLBACK ExtendedShortcutProc(HWND hwndDlg, UINT uMsg, INT_PTR CALLBACK CShellLink::SH_ShellLinkDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - CShellLink *pThis = (CShellLink *)GetWindowLongPtr(hwndDlg, DWLP_USER); + CShellLink *pThis = reinterpret_cast(GetWindowLongPtr(hwndDlg, DWLP_USER)); switch(uMsg) { @@ -1966,7 +1966,7 @@ INT_PTR CALLBACK CShellLink::SH_ShellLinkDlgProc(HWND hwndDlg, UINT uMsg, WPARAM TRACE("ShellLink_DlgProc (WM_INITDIALOG hwnd %p lParam %p ppsplParam %x)\n", hwndDlg, lParam, ppsp->lParam); - pThis = (CShellLink *)ppsp->lParam; + pThis = reinterpret_cast(ppsp->lParam); SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pThis); TRACE("sArgs: %S sComponent: %S sDescription: %S sIcoPath: %S sPath: %S sPathRel: %S sProduct: %S sWorkDir: %S\n", pThis->sArgs, pThis->sComponent, pThis->sDescription, diff --git a/reactos/dll/win32/shell32/shlview.cpp b/reactos/dll/win32/shell32/shlview.cpp index 5afc0e85fe5..d36822506b4 100644 --- a/reactos/dll/win32/shell32/shlview.cpp +++ b/reactos/dll/win32/shell32/shlview.cpp @@ -816,7 +816,7 @@ BOOLEAN CDefView::LV_RenameItem(LPCITEMIDLIST pidlOld, LPCITEMIDLIST pidlNew) INT CALLBACK CDefView::fill_list( LPVOID ptr, LPVOID arg ) { LPITEMIDLIST pidl = (LPITEMIDLIST)ptr; - CDefView *pThis = (CDefView *)arg; + CDefView *pThis = static_cast(arg); /* in a commdlg This works as a filemask*/ if (pThis->IncludeObject(pidl) == S_OK) pThis->LV_AddItem(pidl); From 4496c7309a927d9c838c72850f3850857ca54eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 13 Apr 2014 12:54:24 +0000 Subject: [PATCH 316/419] [CONSRV] - Code cleaning. - Properly remove trailing whitespace when copying text from the console. svn path=/trunk/; revision=62738 --- .../winsrv/consrv/frontends/gui/guisettings.c | 3 +-- .../user/winsrv/consrv/frontends/gui/text.c | 25 ++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c index 9da334dd683..f12305ee6fc 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c @@ -110,7 +110,7 @@ GuiConsoleReadUserSettings(IN OUT PGUI_CONSOLE_INFO TermInfo, } else if (!wcscmp(szValueName, L"WindowPosition")) { - TermInfo->AutoPosition = FALSE; + TermInfo->AutoPosition = FALSE; TermInfo->WindowOrigin.x = LOWORD(Value); TermInfo->WindowOrigin.y = HIWORD(Value); RetVal = TRUE; @@ -326,7 +326,6 @@ GuiConsoleShowConsoleProperties(PGUI_CONSOLE_DATA GuiData, GuiInfo->FontWeight = GuiData->GuiInfo.FontWeight; GuiInfo->UseRasterFonts = GuiData->GuiInfo.UseRasterFonts; GuiInfo->FullScreen = GuiData->GuiInfo.FullScreen; - /// GuiInfo->WindowPosition = GuiData->GuiInfo.WindowPosition; GuiInfo->AutoPosition = GuiData->GuiInfo.AutoPosition; GuiInfo->WindowOrigin = GuiData->GuiInfo.WindowOrigin; /* Offsetize */ diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c index 24526d51c13..e14dfdea4f2 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c @@ -59,6 +59,11 @@ GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, Console->Selection.srSelection.Right, Console->Selection.srSelection.Bottom); +#ifdef IS_WHITESPACE +#undef IS_WHITESPACE +#endif +#define IS_WHITESPACE(c) ((c) == L'\0' || (c) == L' ' || (c) == L'\t') + /* Basic size for one line... */ size = selWidth; /* ... and for the other lines, add newline characters if needed. */ @@ -89,23 +94,31 @@ GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, for (yPos = 0; yPos < selHeight; yPos++) { + ULONG length = selWidth; + ptr = ConioCoordToPointer(Buffer, Console->Selection.srSelection.Left, Console->Selection.srSelection.Top + yPos); + + /* Trim whitespace from the right */ + while (length > 0) + { + if (IS_WHITESPACE(ptr[length-1].Char.UnicodeChar)) + --length; + else + break; + } + /* Copy only the characters, leave attributes alone */ - for (xPos = 0; xPos < selWidth; xPos++) + for (xPos = 0; xPos < length; xPos++) { /* * Sometimes, applications can put NULL chars into the screen-buffer * (this behaviour is allowed). Detect this and replace by a space. - * FIXME - HACK: Improve the way we're doing that (i.e., put spaces - * instead of NULLs (or even, nothing) only if it exists a non-null - * char *after* those NULLs, before the end-of-line of the selection. - * Do the same concerning spaces -- i.e. trailing spaces --). */ dstPos[xPos] = (ptr[xPos].Char.UnicodeChar ? ptr[xPos].Char.UnicodeChar : L' '); } - dstPos += selWidth; + dstPos += length; /* Add newline characters if we are not in inline-text copy mode */ if (!InlineCopyMode) From 858c7e6474d076e609a6a01aedc90a745add8be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 13 Apr 2014 13:21:55 +0000 Subject: [PATCH 317/419] [CONSRV] - Fix console selection and selection mode text that displays in the console title: - Correctly set selection flags; - Ignore the first mouse event when the console is being activated with the mouse, when we are in "QuickEdit" mode (avoids e.g. an erroneous paste if somebody right-clicks on the console); gather the console window position to consistently update GuiData->GuiInfo.WindowOrigin (needed when console properties are displayed). svn path=/trunk/; revision=62739 --- .../winsrv/consrv/frontends/gui/guiterm.c | 177 ++++++++++++------ 1 file changed, 120 insertions(+), 57 deletions(-) diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c index a9070b3c90b..cda9b63f0ab 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c @@ -24,7 +24,7 @@ #include "resource.h" /* GUI Console Window Class name */ -#define GUI_CONSOLE_WINDOW_CLASS L"ConsoleWindowClass" +#define GUI_CONWND_CLASS L"ConsoleWindowClass" #ifndef WM_APP #define WM_APP 0x8000 @@ -277,22 +277,16 @@ GuiConsoleHandleSysMenuCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM { case ID_SYSTEM_EDIT_MARK: { - LPWSTR WindowTitle = NULL; - SIZE_T Length = 0; + /* Clear the old selection */ + // GuiConsoleUpdateSelection(Console, NULL); + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; + /* Restart a new selection */ Console->dwSelectionCursor.X = ActiveBuffer->ViewOrigin.X; Console->dwSelectionCursor.Y = ActiveBuffer->ViewOrigin.Y; Console->Selection.dwSelectionAnchor = Console->dwSelectionCursor; - Console->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS; GuiConsoleUpdateSelection(Console, &Console->Selection.dwSelectionAnchor); - Length = Console->Title.Length + sizeof(L"Mark - ")/sizeof(WCHAR) + 1; - WindowTitle = ConsoleAllocHeap(0, Length * sizeof(WCHAR)); - wcscpy(WindowTitle, L"Mark - "); - wcscat(WindowTitle, Console->Title.Buffer); - SetWindowText(GuiData->hWindow, WindowTitle); - ConsoleFreeHeap(WindowTitle); - break; } @@ -306,8 +300,9 @@ GuiConsoleHandleSysMenuCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM case ID_SYSTEM_EDIT_SELECTALL: { - LPWSTR WindowTitle = NULL; - SIZE_T Length = 0; + /* Clear the old selection */ + // GuiConsoleUpdateSelection(Console, NULL); + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; /* * The selection area extends to the whole screen buffer's width. @@ -337,16 +332,10 @@ GuiConsoleHandleSysMenuCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1; } - Console->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS | CONSOLE_MOUSE_SELECTION; + /* Restart a new selection */ + Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION; GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); - Length = Console->Title.Length + sizeof(L"Selection - ")/sizeof(WCHAR) + 1; - WindowTitle = ConsoleAllocHeap(0, Length * sizeof(WCHAR)); - wcscpy(WindowTitle, L"Selection - "); - wcscat(WindowTitle, Console->Title.Buffer); - SetWindowText(GuiData->hWindow, WindowTitle); - ConsoleFreeHeap(WindowTitle); - break; } @@ -579,14 +568,16 @@ static VOID GuiConsoleUpdateSelection(PCONSOLE Console, PCOORD coord) { PGUI_CONSOLE_DATA GuiData = Console->TermIFace.Data; - RECT oldRect, newRect; + RECT oldRect; SmallRectToRect(GuiData, &oldRect, &Console->Selection.srSelection); if (coord != NULL) { + RECT newRect; SMALL_RECT rc; - /* exchange left/top with right/bottom if required */ + + /* Exchange left/top with right/bottom if required */ rc.Left = min(Console->Selection.dwSelectionAnchor.X, coord->X); rc.Top = min(Console->Selection.dwSelectionAnchor.Y, coord->Y); rc.Right = max(Console->Selection.dwSelectionAnchor.X, coord->X); @@ -600,7 +591,7 @@ GuiConsoleUpdateSelection(PCONSOLE Console, PCOORD coord) { HRGN rgn1, rgn2; - /* calculate the region that needs to be updated */ + /* Calculate the region that needs to be updated */ if ((rgn1 = CreateRectRgnIndirect(&oldRect))) { if ((rgn2 = CreateRectRgnIndirect(&newRect))) @@ -619,20 +610,54 @@ GuiConsoleUpdateSelection(PCONSOLE Console, PCOORD coord) { InvalidateRect(GuiData->hWindow, &newRect, FALSE); } + Console->Selection.dwFlags |= CONSOLE_SELECTION_NOT_EMPTY; Console->Selection.srSelection = rc; Console->dwSelectionCursor = *coord; - ConioPause(Console, PAUSED_FROM_SELECTION); + + if ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) == 0) + { + LPWSTR SelectionType, WindowTitle = NULL; + SIZE_T Length = 0; + + /* Clear the old selection */ + if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) + { + InvalidateRect(GuiData->hWindow, &oldRect, FALSE); + } + + if (Console->Selection.dwFlags & CONSOLE_MOUSE_SELECTION) + { + SelectionType = L"Selection - "; + } + else + { + SelectionType = L"Mark - "; + } + + Length = Console->Title.Length + wcslen(SelectionType) + 1; + WindowTitle = ConsoleAllocHeap(0, Length * sizeof(WCHAR)); + wcscpy(WindowTitle, SelectionType); + wcscat(WindowTitle, Console->Title.Buffer); + SetWindowText(GuiData->hWindow, WindowTitle); + ConsoleFreeHeap(WindowTitle); + + Console->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS; + ConioPause(Console, PAUSED_FROM_SELECTION); + } } else { - /* clear the selection */ + /* Clear the selection */ if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) { InvalidateRect(GuiData->hWindow, &oldRect, FALSE); } + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; ConioUnpause(Console, PAUSED_FROM_SELECTION); + + SetWindowText(GuiData->hWindow, Console->Title.Buffer); } } @@ -768,8 +793,6 @@ GuiConsoleHandleKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM l { /* Cancel selection if ESC or Ctrl-C are pressed */ GuiConsoleUpdateSelection(Console, NULL); - SetWindowText(GuiData->hWindow, Console->Title.Buffer); - goto Quit; } @@ -879,7 +902,6 @@ GuiConsoleHandleKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM l { /* Clear the selection and send the key into the input buffer */ GuiConsoleUpdateSelection(Console, NULL); - SetWindowText(GuiData->hWindow, Console->Title.Buffer); } else { @@ -1096,10 +1118,11 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM { if (msg != WM_LBUTTONDOWN && msg != WM_MBUTTONDOWN && - msg != WM_RBUTTONDOWN) + msg != WM_RBUTTONDOWN && + msg != WM_MOUSEMOVE) { /* - * If this mouse signal is not a button-down action, + * If this mouse signal is not a button-down action or a move, * then it is the last signal being ignored. */ GuiData->IgnoreNextMouseSignal = FALSE; @@ -1107,7 +1130,7 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM else { /* - * This mouse signal is a button-down action. + * This mouse signal is a button-down action or a move. * Ignore it and perform default action. */ Err = TRUE; @@ -1128,33 +1151,28 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM { case WM_LBUTTONDOWN: { - LPWSTR WindowTitle = NULL; - SIZE_T Length = 0; + /* Clear the old selection */ + // GuiConsoleUpdateSelection(Console, NULL); + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; + /* Restart a new selection */ Console->Selection.dwSelectionAnchor = PointToCoord(GuiData, lParam); SetCapture(GuiData->hWindow); - Console->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS | CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; + Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; GuiConsoleUpdateSelection(Console, &Console->Selection.dwSelectionAnchor); - Length = Console->Title.Length + sizeof(L"Selection - ")/sizeof(WCHAR) + 1; - WindowTitle = ConsoleAllocHeap(0, Length * sizeof(WCHAR)); - wcscpy(WindowTitle, L"Selection - "); - wcscat(WindowTitle, Console->Title.Buffer); - SetWindowText(GuiData->hWindow, WindowTitle); - ConsoleFreeHeap(WindowTitle); - break; } case WM_LBUTTONUP: { - COORD c; + // COORD c; if (!(Console->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break; - c = PointToCoord(GuiData, lParam); + // c = PointToCoord(GuiData, lParam); Console->Selection.dwFlags &= ~CONSOLE_MOUSE_DOWN; - GuiConsoleUpdateSelection(Console, &c); + // GuiConsoleUpdateSelection(Console, &c); ReleaseCapture(); break; @@ -1166,6 +1184,9 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM if (GetType(Buffer) == TEXTMODE_BUFFER) { +#ifdef IS_WHITESPACE +#undef IS_WHITESPACE +#endif #define IS_WHITESPACE(c) \ ((c) == L'\0' || (c) == L' ' || (c) == L'\t' || (c) == L'\r' || (c) == L'\n') @@ -1192,10 +1213,19 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM ++ptrR; } + /* + * Update the selection started with the single + * left-click that preceded this double-click. + */ Console->Selection.dwSelectionAnchor = cL; Console->dwSelectionCursor = cR; + SetCapture(GuiData->hWindow); + Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); + + /* Ignore the next mouse move signal */ + GuiData->IgnoreNextMouseSignal = TRUE; } break; @@ -1213,6 +1243,7 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM GuiConsoleCopy(GuiData); } + /* Ignore the next mouse move signal */ GuiData->IgnoreNextMouseSignal = TRUE; break; } @@ -1378,9 +1409,10 @@ GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, static VOID GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData) { + PCONSOLE Console = GuiData->Console; + if (OpenClipboard(GuiData->hWindow) == TRUE) { - PCONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; if (GetType(Buffer) == TEXTMODE_BUFFER) @@ -1393,11 +1425,10 @@ GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData) } CloseClipboard(); - - /* Clear the selection */ - GuiConsoleUpdateSelection(Console, NULL); - SetWindowText(GuiData->hWindow, Console->Title.Buffer); } + + /* Clear the selection */ + GuiConsoleUpdateSelection(Console, NULL); } VOID @@ -1739,7 +1770,14 @@ GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) } } - if (ActivationState == WA_CLICKACTIVE) GuiData->IgnoreNextMouseSignal = TRUE; + /* + * When we are in QuickEdit mode, ignore the next mouse signal + * when we are going to be enabled again via the mouse, in order + * to prevent e.g. an erroneous right-click from the user which + * would have as an effect to paste some unwanted text... + */ + if (Console->QuickEdit && (ActivationState == WA_CLICKACTIVE)) + GuiData->IgnoreNextMouseSignal = TRUE; break; } @@ -1752,6 +1790,10 @@ GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) GuiConsoleHandlePaint(GuiData); break; + case WM_TIMER: + GuiConsoleHandleTimer(GuiData); + break; + case WM_PALETTECHANGED: { PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; @@ -1815,10 +1857,6 @@ GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) break; } - case WM_TIMER: - GuiConsoleHandleTimer(GuiData); - break; - case WM_SETCURSOR: { /* @@ -2013,6 +2051,25 @@ GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) GuiConsoleGetMinMaxInfo(GuiData, (PMINMAXINFO)lParam); break; + case WM_MOVE: + { + if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + { + // TODO: Simplify the code. + // See: GuiConsoleNotifyWndProc() PM_CREATE_CONSOLE. + + RECT rcWnd; + + /* Retrieve our real position */ + GetWindowRect(GuiData->hWindow, &rcWnd); + GuiData->GuiInfo.WindowOrigin.x = rcWnd.left; + GuiData->GuiInfo.WindowOrigin.y = rcWnd.top; + + LeaveCriticalSection(&Console->Lock); + } + break; + } + case WM_SIZE: GuiConsoleResize(GuiData, wParam, lParam); break; @@ -2101,9 +2158,10 @@ GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)lParam; PCONSOLE Console = GuiData->Console; + RECT rcWnd; NewWindow = CreateWindowExW(WS_EX_CLIENTEDGE, - GUI_CONSOLE_WINDOW_CLASS, + GUI_CONWND_CLASS, Console->Title.Buffer, WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL, CW_USEDEFAULT, @@ -2136,6 +2194,11 @@ GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) SendMessageW(GuiData->hWindow, WM_SETICON, ICON_SMALL, (LPARAM)GuiData->hIconSm); } + /* Retrieve our real position */ + GetWindowRect(GuiData->hWindow, &rcWnd); + GuiData->GuiInfo.WindowOrigin.x = rcWnd.left; + GuiData->GuiInfo.WindowOrigin.y = rcWnd.top; + /* Move and resize the window to the user's values */ /* CAN WE DEADLOCK ?? */ GuiConsoleMoveWindow(GuiData); @@ -2289,7 +2352,7 @@ GuiInit(VOID) LR_SHARED); ghDefaultCursor = LoadCursorW(NULL, IDC_ARROW); wc.cbSize = sizeof(WNDCLASSEXW); - wc.lpszClassName = GUI_CONSOLE_WINDOW_CLASS; + wc.lpszClassName = GUI_CONWND_CLASS; wc.lpfnWndProc = GuiConsoleWndProc; wc.style = CS_DBLCLKS /* | CS_HREDRAW | CS_VREDRAW */; wc.hInstance = ConSrvDllInstance; From 163b561df13973cb5e6b2177cbd96ee7960b4afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 13 Apr 2014 15:13:55 +0000 Subject: [PATCH 318/419] [CONSRV] Code reorganization: move console-window-class - related code into a file. svn path=/trunk/; revision=62740 --- reactos/win32ss/user/winsrv/consrv.cmake | 1 + reactos/win32ss/user/winsrv/consrv/consrv.h | 7 +- .../user/winsrv/consrv/frontends/gui/conwnd.c | 2156 +++++++++++++++++ .../user/winsrv/consrv/frontends/gui/conwnd.h | 68 + .../winsrv/consrv/frontends/gui/fullscreen.c | 2 + .../winsrv/consrv/frontends/gui/graphics.c | 2 + .../winsrv/consrv/frontends/gui/guisettings.c | 3 + .../winsrv/consrv/frontends/gui/guisettings.h | 45 +- .../winsrv/consrv/frontends/gui/guiterm.c | 2086 +--------------- .../winsrv/consrv/frontends/gui/guiterm.h | 8 +- .../user/winsrv/consrv/frontends/gui/text.c | 2 + 11 files changed, 2262 insertions(+), 2118 deletions(-) create mode 100644 reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c create mode 100644 reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h diff --git a/reactos/win32ss/user/winsrv/consrv.cmake b/reactos/win32ss/user/winsrv/consrv.cmake index 6bcd7079d58..69dbf469814 100644 --- a/reactos/win32ss/user/winsrv/consrv.cmake +++ b/reactos/win32ss/user/winsrv/consrv.cmake @@ -22,6 +22,7 @@ list(APPEND CONSRV_SOURCE consrv/condrv/graphics.c consrv/condrv/text.c consrv/frontends/input.c + consrv/frontends/gui/conwnd.c consrv/frontends/gui/fullscreen.c consrv/frontends/gui/guiterm.c consrv/frontends/gui/guisettings.c diff --git a/reactos/win32ss/user/winsrv/consrv/consrv.h b/reactos/win32ss/user/winsrv/consrv/consrv.h index 30ce8647609..b30e00994f0 100644 --- a/reactos/win32ss/user/winsrv/consrv/consrv.h +++ b/reactos/win32ss/user/winsrv/consrv/consrv.h @@ -67,13 +67,12 @@ typedef struct _CONSOLE_PROCESS_DATA } CONSOLE_PROCESS_DATA, *PCONSOLE_PROCESS_DATA; #include "include/conio.h" +#include "include/console.h" +#include "include/settings.h" +#include "include/term.h" #include "console.h" #include "conoutput.h" #include "handle.h" #include "lineinput.h" -#include "frontends/gui/guisettings.h" -#include "include/console.h" -#include "include/settings.h" -#include "include/term.h" #endif /* __CONSRV_H__ */ diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c new file mode 100644 index 00000000000..49fb50b2ce4 --- /dev/null +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c @@ -0,0 +1,2156 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Console Server DLL + * FILE: frontends/gui/conwnd.c + * PURPOSE: GUI Console Window Class + * PROGRAMMERS: G van Geldorp + * Johannes Anderwald + * Jeffrey Morlan + * Hermes Belusca-Maito (hermes.belusca@sfr.fr) + */ + +/* INCLUDES *******************************************************************/ + +#include + +#include + +#define NDEBUG +#include + +#include "guiterm.h" +#include "conwnd.h" +#include "resource.h" + +/* GLOBALS ********************************************************************/ + +// #define PM_CREATE_CONSOLE (WM_APP + 1) +// #define PM_DESTROY_CONSOLE (WM_APP + 2) + +// See guiterm.c +#define CONGUI_MIN_WIDTH 10 +#define CONGUI_MIN_HEIGHT 10 +#define CONGUI_UPDATE_TIME 0 +#define CONGUI_UPDATE_TIMER 1 + +#define CURSOR_BLINK_TIME 500 + + +/**************************************************************\ +\** Define the Console Leader Process for the console window **/ +#define GWLP_CONWND_ALLOC (2 * sizeof(LONG_PTR)) +#define GWLP_CONSOLE_LEADER_PID 0 +#define GWLP_CONSOLE_LEADER_TID 4 + +VOID +SetConWndConsoleLeaderCID(IN PGUI_CONSOLE_DATA GuiData) +{ + PCONSOLE_PROCESS_DATA ProcessData; + CLIENT_ID ConsoleLeaderCID; + + ProcessData = CONTAINING_RECORD(GuiData->Console->ProcessList.Blink, + CONSOLE_PROCESS_DATA, + ConsoleLink); + ConsoleLeaderCID = ProcessData->Process->ClientId; + SetWindowLongPtrW(GuiData->hWindow, GWLP_CONSOLE_LEADER_PID, + (LONG_PTR)(ConsoleLeaderCID.UniqueProcess)); + SetWindowLongPtrW(GuiData->hWindow, GWLP_CONSOLE_LEADER_TID, + (LONG_PTR)(ConsoleLeaderCID.UniqueThread)); +} +/**************************************************************/ + +HICON ghDefaultIcon = NULL; +HICON ghDefaultIconSm = NULL; +HCURSOR ghDefaultCursor = NULL; + +typedef struct _GUICONSOLE_MENUITEM +{ + UINT uID; + const struct _GUICONSOLE_MENUITEM *SubMenu; + WORD wCmdID; +} GUICONSOLE_MENUITEM, *PGUICONSOLE_MENUITEM; + +static const GUICONSOLE_MENUITEM GuiConsoleEditMenuItems[] = +{ + { IDS_MARK, NULL, ID_SYSTEM_EDIT_MARK }, + { IDS_COPY, NULL, ID_SYSTEM_EDIT_COPY }, + { IDS_PASTE, NULL, ID_SYSTEM_EDIT_PASTE }, + { IDS_SELECTALL, NULL, ID_SYSTEM_EDIT_SELECTALL }, + { IDS_SCROLL, NULL, ID_SYSTEM_EDIT_SCROLL }, + { IDS_FIND, NULL, ID_SYSTEM_EDIT_FIND }, + + { 0, NULL, 0 } /* End of list */ +}; + +static const GUICONSOLE_MENUITEM GuiConsoleMainMenuItems[] = +{ + { IDS_EDIT, GuiConsoleEditMenuItems, 0 }, + { IDS_DEFAULTS, NULL, ID_SYSTEM_DEFAULTS }, + { IDS_PROPERTIES, NULL, ID_SYSTEM_PROPERTIES }, + + { 0, NULL, 0 } /* End of list */ +}; + +/* + * Default 16-color palette for foreground and background + * (corresponding flags in comments). + */ +const COLORREF s_Colors[16] = +{ + RGB(0, 0, 0), // (Black) + RGB(0, 0, 128), // BLUE + RGB(0, 128, 0), // GREEN + RGB(0, 128, 128), // BLUE | GREEN + RGB(128, 0, 0), // RED + RGB(128, 0, 128), // BLUE | RED + RGB(128, 128, 0), // GREEN | RED + RGB(192, 192, 192), // BLUE | GREEN | RED + + RGB(128, 128, 128), // (Grey) INTENSITY + RGB(0, 0, 255), // BLUE | INTENSITY + RGB(0, 255, 0), // GREEN | INTENSITY + RGB(0, 255, 255), // BLUE | GREEN | INTENSITY + RGB(255, 0, 0), // RED | INTENSITY + RGB(255, 0, 255), // BLUE | RED | INTENSITY + RGB(255, 255, 0), // GREEN | RED | INTENSITY + RGB(255, 255, 255) // BLUE | GREEN | RED | INTENSITY +}; + +/* FUNCTIONS ******************************************************************/ + +static LRESULT CALLBACK +ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + +BOOLEAN +RegisterConWndClass(IN HINSTANCE hInstance) +{ + WNDCLASSEXW WndClass; + ATOM WndClassAtom; + + ghDefaultIcon = LoadImageW(hInstance, + MAKEINTRESOURCEW(IDI_TERMINAL), + IMAGE_ICON, + GetSystemMetrics(SM_CXICON), + GetSystemMetrics(SM_CYICON), + LR_SHARED); + ghDefaultIconSm = LoadImageW(hInstance, + MAKEINTRESOURCEW(IDI_TERMINAL), + IMAGE_ICON, + GetSystemMetrics(SM_CXSMICON), + GetSystemMetrics(SM_CYSMICON), + LR_SHARED); + ghDefaultCursor = LoadCursorW(NULL, IDC_ARROW); + + WndClass.cbSize = sizeof(WNDCLASSEXW); + WndClass.lpszClassName = GUI_CONWND_CLASS; + WndClass.lpfnWndProc = ConWndProc; + WndClass.style = CS_DBLCLKS /* | CS_HREDRAW | CS_VREDRAW */; + WndClass.hInstance = hInstance; + WndClass.hIcon = ghDefaultIcon; + WndClass.hIconSm = ghDefaultIconSm; + WndClass.hCursor = ghDefaultCursor; + WndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); // The color of a terminal when it is switched off. + WndClass.lpszMenuName = NULL; + WndClass.cbClsExtra = 0; + WndClass.cbWndExtra = GWLP_CONWND_ALLOC; + + WndClassAtom = RegisterClassExW(&WndClass); + if (WndClassAtom == 0) + { + DPRINT1("Failed to register GUI console class\n"); + } + else + { + NtUserConsoleControl(GuiConsoleWndClassAtom, &WndClassAtom, sizeof(ATOM)); + } + + return (WndClassAtom != 0); +} + +BOOLEAN +UnRegisterConWndClass(HINSTANCE hInstance) +{ + return !!UnregisterClassW(GUI_CONWND_CLASS, hInstance); +} + + + +static VOID +GetScreenBufferSizeUnits(IN PCONSOLE_SCREEN_BUFFER Buffer, + IN PGUI_CONSOLE_DATA GuiData, + OUT PUINT WidthUnit, + OUT PUINT HeightUnit) +{ + if (Buffer == NULL || GuiData == NULL || + WidthUnit == NULL || HeightUnit == NULL) + { + return; + } + + if (GetType(Buffer) == TEXTMODE_BUFFER) + { + *WidthUnit = GuiData->CharWidth ; + *HeightUnit = GuiData->CharHeight; + } + else /* if (GetType(Buffer) == GRAPHICS_BUFFER) */ + { + *WidthUnit = 1; + *HeightUnit = 1; + } +} + +static VOID +GuiConsoleAppendMenuItems(HMENU hMenu, + const GUICONSOLE_MENUITEM *Items) +{ + UINT i = 0; + WCHAR szMenuString[255]; + HMENU hSubMenu; + + do + { + if (Items[i].uID != (UINT)-1) + { + if (LoadStringW(ConSrvDllInstance, + Items[i].uID, + szMenuString, + sizeof(szMenuString) / sizeof(szMenuString[0])) > 0) + { + if (Items[i].SubMenu != NULL) + { + hSubMenu = CreatePopupMenu(); + if (hSubMenu != NULL) + { + GuiConsoleAppendMenuItems(hSubMenu, + Items[i].SubMenu); + + if (!AppendMenuW(hMenu, + MF_STRING | MF_POPUP, + (UINT_PTR)hSubMenu, + szMenuString)) + { + DestroyMenu(hSubMenu); + } + } + } + else + { + AppendMenuW(hMenu, + MF_STRING, + Items[i].wCmdID, + szMenuString); + } + } + } + else + { + AppendMenuW(hMenu, + MF_SEPARATOR, + 0, + NULL); + } + i++; + } while (!(Items[i].uID == 0 && Items[i].SubMenu == NULL && Items[i].wCmdID == 0)); +} + +static VOID +GuiConsoleCreateSysMenu(HWND hWnd) +{ + HMENU hMenu = GetSystemMenu(hWnd, FALSE); + if (hMenu != NULL) + { + GuiConsoleAppendMenuItems(hMenu, GuiConsoleMainMenuItems); + DrawMenuBar(hWnd); + } +} + +static VOID +GuiSendMenuEvent(PCONSOLE Console, UINT CmdId) +{ + INPUT_RECORD er; + + er.EventType = MENU_EVENT; + er.Event.MenuEvent.dwCommandId = CmdId; + + DPRINT("Menu item ID: %d\n", CmdId); + ConioProcessInputEvent(Console, &er); +} + +static VOID +GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData); +static VOID +GuiConsolePaste(PGUI_CONSOLE_DATA GuiData); +static VOID +GuiConsoleUpdateSelection(PCONSOLE Console, PCOORD coord); +static VOID +GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightUnit); + +static LRESULT +GuiConsoleHandleSysMenuCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) +{ + LRESULT Ret = TRUE; + PCONSOLE Console = GuiData->Console; + PCONSOLE_SCREEN_BUFFER ActiveBuffer; + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + { + Ret = FALSE; + goto Quit; + } + ActiveBuffer = GuiData->ActiveBuffer; + + /* + * In case the selected menu item belongs to the user-reserved menu id range, + * send to him a menu event and return directly. The user must handle those + * reserved menu commands... + */ + if (GuiData->CmdIdLow <= (UINT)wParam && (UINT)wParam <= GuiData->CmdIdHigh) + { + GuiSendMenuEvent(Console, (UINT)wParam); + goto Unlock_Quit; + } + + /* ... otherwise, perform actions. */ + switch (wParam) + { + case ID_SYSTEM_EDIT_MARK: + { + /* Clear the old selection */ + // GuiConsoleUpdateSelection(Console, NULL); + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; + + /* Restart a new selection */ + Console->dwSelectionCursor.X = ActiveBuffer->ViewOrigin.X; + Console->dwSelectionCursor.Y = ActiveBuffer->ViewOrigin.Y; + Console->Selection.dwSelectionAnchor = Console->dwSelectionCursor; + GuiConsoleUpdateSelection(Console, &Console->Selection.dwSelectionAnchor); + + break; + } + + case ID_SYSTEM_EDIT_COPY: + GuiConsoleCopy(GuiData); + break; + + case ID_SYSTEM_EDIT_PASTE: + GuiConsolePaste(GuiData); + break; + + case ID_SYSTEM_EDIT_SELECTALL: + { + /* Clear the old selection */ + // GuiConsoleUpdateSelection(Console, NULL); + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; + + /* + * The selection area extends to the whole screen buffer's width. + */ + Console->Selection.dwSelectionAnchor.X = 0; + Console->Selection.dwSelectionAnchor.Y = 0; + Console->dwSelectionCursor.X = ActiveBuffer->ScreenBufferSize.X - 1; + + /* + * Determine whether the selection must extend to just some part + * (for text-mode screen buffers) or to all of the screen buffer's + * height (for graphics ones). + */ + if (GetType(ActiveBuffer) == TEXTMODE_BUFFER) + { + /* + * We select all the characters from the first line + * to the line where the cursor is positioned. + */ + Console->dwSelectionCursor.Y = ActiveBuffer->CursorPosition.Y; + } + else /* if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) */ + { + /* + * We select all the screen buffer area. + */ + Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1; + } + + /* Restart a new selection */ + Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION; + GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); + + break; + } + + case ID_SYSTEM_EDIT_SCROLL: + DPRINT1("Scrolling is not handled yet\n"); + break; + + case ID_SYSTEM_EDIT_FIND: + DPRINT1("Finding is not handled yet\n"); + break; + + case ID_SYSTEM_DEFAULTS: + GuiConsoleShowConsoleProperties(GuiData, TRUE); + break; + + case ID_SYSTEM_PROPERTIES: + GuiConsoleShowConsoleProperties(GuiData, FALSE); + break; + + default: + Ret = FALSE; + break; + } + +Unlock_Quit: + LeaveCriticalSection(&Console->Lock); +Quit: + if (!Ret) + Ret = DefWindowProcW(GuiData->hWindow, WM_SYSCOMMAND, wParam, lParam); + + return Ret; +} + +static PGUI_CONSOLE_DATA +GuiGetGuiData(HWND hWnd) +{ + /* This function ensures that the console pointer is not NULL */ + PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)GetWindowLongPtrW(hWnd, GWLP_USERDATA); + return ( ((GuiData == NULL) || (GuiData->hWindow == hWnd && GuiData->Console != NULL)) ? GuiData : NULL ); +} + +static VOID +GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightUnit) +{ + PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; + SCROLLINFO sInfo; + + DWORD Width, Height; + + Width = Buff->ViewSize.X * WidthUnit + + 2 * (GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXEDGE)); + Height = Buff->ViewSize.Y * HeightUnit + + 2 * (GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE)) + GetSystemMetrics(SM_CYCAPTION); + + /* Set scrollbar sizes */ + sInfo.cbSize = sizeof(SCROLLINFO); + sInfo.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; + sInfo.nMin = 0; + if (Buff->ScreenBufferSize.Y > Buff->ViewSize.Y) + { + sInfo.nMax = Buff->ScreenBufferSize.Y - 1; + sInfo.nPage = Buff->ViewSize.Y; + sInfo.nPos = Buff->ViewOrigin.Y; + SetScrollInfo(GuiData->hWindow, SB_VERT, &sInfo, TRUE); + Width += GetSystemMetrics(SM_CXVSCROLL); + ShowScrollBar(GuiData->hWindow, SB_VERT, TRUE); + } + else + { + ShowScrollBar(GuiData->hWindow, SB_VERT, FALSE); + } + + if (Buff->ScreenBufferSize.X > Buff->ViewSize.X) + { + sInfo.nMax = Buff->ScreenBufferSize.X - 1; + sInfo.nPage = Buff->ViewSize.X; + sInfo.nPos = Buff->ViewOrigin.X; + SetScrollInfo(GuiData->hWindow, SB_HORZ, &sInfo, TRUE); + Height += GetSystemMetrics(SM_CYHSCROLL); + ShowScrollBar(GuiData->hWindow, SB_HORZ, TRUE); + } + else + { + ShowScrollBar(GuiData->hWindow, SB_HORZ, FALSE); + } + + /* Resize the window */ + SetWindowPos(GuiData->hWindow, NULL, 0, 0, Width, Height, + SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOCOPYBITS); + // NOTE: The SWP_NOCOPYBITS flag can be replaced by a subsequent call + // to: InvalidateRect(GuiData->hWindow, NULL, TRUE); +} + +static BOOL +GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create) +{ + PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)Create->lpCreateParams; + PCONSOLE Console; + HDC hDC; + HFONT OldFont; + TEXTMETRICW Metrics; + SIZE CharSize; + + DPRINT("GuiConsoleHandleNcCreate\n"); + + if (NULL == GuiData) + { + DPRINT1("GuiConsoleNcCreate: No GUI data\n"); + return FALSE; + } + + Console = GuiData->Console; + + GuiData->hWindow = hWnd; + + GuiData->Font = CreateFontW(LOWORD(GuiData->GuiInfo.FontSize), + 0, // HIWORD(GuiData->GuiInfo.FontSize), + 0, + TA_BASELINE, + GuiData->GuiInfo.FontWeight, + FALSE, + FALSE, + FALSE, + OEM_CHARSET, + OUT_DEFAULT_PRECIS, + CLIP_DEFAULT_PRECIS, + NONANTIALIASED_QUALITY, + FIXED_PITCH | GuiData->GuiInfo.FontFamily /* FF_DONTCARE */, + GuiData->GuiInfo.FaceName); + + if (NULL == GuiData->Font) + { + DPRINT1("GuiConsoleNcCreate: CreateFont failed\n"); + GuiData->hWindow = NULL; + SetEvent(GuiData->hGuiInitEvent); + return FALSE; + } + hDC = GetDC(GuiData->hWindow); + if (NULL == hDC) + { + DPRINT1("GuiConsoleNcCreate: GetDC failed\n"); + DeleteObject(GuiData->Font); + GuiData->hWindow = NULL; + SetEvent(GuiData->hGuiInitEvent); + return FALSE; + } + OldFont = SelectObject(hDC, GuiData->Font); + if (NULL == OldFont) + { + DPRINT1("GuiConsoleNcCreate: SelectObject failed\n"); + ReleaseDC(GuiData->hWindow, hDC); + DeleteObject(GuiData->Font); + GuiData->hWindow = NULL; + SetEvent(GuiData->hGuiInitEvent); + return FALSE; + } + if (!GetTextMetricsW(hDC, &Metrics)) + { + DPRINT1("GuiConsoleNcCreate: GetTextMetrics failed\n"); + SelectObject(hDC, OldFont); + ReleaseDC(GuiData->hWindow, hDC); + DeleteObject(GuiData->Font); + GuiData->hWindow = NULL; + SetEvent(GuiData->hGuiInitEvent); + return FALSE; + } + GuiData->CharWidth = Metrics.tmMaxCharWidth; + GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; + + /* Measure real char width more precisely if possible. */ + if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize)) + GuiData->CharWidth = CharSize.cx; + + SelectObject(hDC, OldFont); + + ReleaseDC(GuiData->hWindow, hDC); + + /* Initialize the terminal framebuffer */ + GuiData->hMemDC = CreateCompatibleDC(NULL); + GuiData->hBitmap = NULL; + GuiData->hSysPalette = NULL; /* Original system palette */ + + // FIXME: Keep these instructions here ? /////////////////////////////////// + Console->ActiveBuffer->CursorBlinkOn = TRUE; + Console->ActiveBuffer->ForceCursorOff = FALSE; + //////////////////////////////////////////////////////////////////////////// + + SetWindowLongPtrW(GuiData->hWindow, GWLP_USERDATA, (DWORD_PTR)GuiData); + + SetTimer(GuiData->hWindow, CONGUI_UPDATE_TIMER, CONGUI_UPDATE_TIME, NULL); + GuiConsoleCreateSysMenu(GuiData->hWindow); + + DPRINT("GuiConsoleHandleNcCreate - setting start event\n"); + SetEvent(GuiData->hGuiInitEvent); + + return (BOOL)DefWindowProcW(GuiData->hWindow, WM_NCCREATE, 0, (LPARAM)Create); +} + +static VOID +SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect) +{ + PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; + UINT WidthUnit, HeightUnit; + + GetScreenBufferSizeUnits(Buffer, GuiData, &WidthUnit, &HeightUnit); + + Rect->left = (SmallRect->Left - Buffer->ViewOrigin.X) * WidthUnit ; + Rect->top = (SmallRect->Top - Buffer->ViewOrigin.Y) * HeightUnit; + Rect->right = (SmallRect->Right + 1 - Buffer->ViewOrigin.X) * WidthUnit ; + Rect->bottom = (SmallRect->Bottom + 1 - Buffer->ViewOrigin.Y) * HeightUnit; +} + +static VOID +GuiConsoleUpdateSelection(PCONSOLE Console, PCOORD coord) +{ + PGUI_CONSOLE_DATA GuiData = Console->TermIFace.Data; + RECT oldRect; + + SmallRectToRect(GuiData, &oldRect, &Console->Selection.srSelection); + + if (coord != NULL) + { + RECT newRect; + SMALL_RECT rc; + + /* Exchange left/top with right/bottom if required */ + rc.Left = min(Console->Selection.dwSelectionAnchor.X, coord->X); + rc.Top = min(Console->Selection.dwSelectionAnchor.Y, coord->Y); + rc.Right = max(Console->Selection.dwSelectionAnchor.X, coord->X); + rc.Bottom = max(Console->Selection.dwSelectionAnchor.Y, coord->Y); + + SmallRectToRect(GuiData, &newRect, &rc); + + if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) + { + if (memcmp(&rc, &Console->Selection.srSelection, sizeof(SMALL_RECT)) != 0) + { + HRGN rgn1, rgn2; + + /* Calculate the region that needs to be updated */ + if ((rgn1 = CreateRectRgnIndirect(&oldRect))) + { + if ((rgn2 = CreateRectRgnIndirect(&newRect))) + { + if (CombineRgn(rgn1, rgn2, rgn1, RGN_XOR) != ERROR) + { + InvalidateRgn(GuiData->hWindow, rgn1, FALSE); + } + DeleteObject(rgn2); + } + DeleteObject(rgn1); + } + } + } + else + { + InvalidateRect(GuiData->hWindow, &newRect, FALSE); + } + + Console->Selection.dwFlags |= CONSOLE_SELECTION_NOT_EMPTY; + Console->Selection.srSelection = rc; + Console->dwSelectionCursor = *coord; + + if ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) == 0) + { + LPWSTR SelectionType, WindowTitle = NULL; + SIZE_T Length = 0; + + /* Clear the old selection */ + if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) + { + InvalidateRect(GuiData->hWindow, &oldRect, FALSE); + } + + if (Console->Selection.dwFlags & CONSOLE_MOUSE_SELECTION) + { + SelectionType = L"Selection - "; + } + else + { + SelectionType = L"Mark - "; + } + + Length = Console->Title.Length + wcslen(SelectionType) + 1; + WindowTitle = ConsoleAllocHeap(0, Length * sizeof(WCHAR)); + wcscpy(WindowTitle, SelectionType); + wcscat(WindowTitle, Console->Title.Buffer); + SetWindowText(GuiData->hWindow, WindowTitle); + ConsoleFreeHeap(WindowTitle); + + Console->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS; + ConioPause(Console, PAUSED_FROM_SELECTION); + } + } + else + { + /* Clear the selection */ + if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) + { + InvalidateRect(GuiData->hWindow, &oldRect, FALSE); + } + + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; + ConioUnpause(Console, PAUSED_FROM_SELECTION); + + SetWindowText(GuiData->hWindow, Console->Title.Buffer); + } +} + + +VOID +GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData, + PRECT rcView, + PRECT rcFramebuffer); +VOID +GuiPaintGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData, + PRECT rcView, + PRECT rcFramebuffer); + +static VOID +GuiConsoleHandlePaint(PGUI_CONSOLE_DATA GuiData) +{ + BOOL Success = TRUE; + PCONSOLE Console = GuiData->Console; + PCONSOLE_SCREEN_BUFFER ActiveBuffer; + PAINTSTRUCT ps; + RECT rcPaint; + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + { + Success = FALSE; + goto Quit; + } + ActiveBuffer = GuiData->ActiveBuffer; + + BeginPaint(GuiData->hWindow, &ps); + if (ps.hdc != NULL && + ps.rcPaint.left < ps.rcPaint.right && + ps.rcPaint.top < ps.rcPaint.bottom) + { + EnterCriticalSection(&GuiData->Lock); + + /* Compose the current screen-buffer on-memory */ + if (GetType(ActiveBuffer) == TEXTMODE_BUFFER) + { + GuiPaintTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)ActiveBuffer, + GuiData, &ps.rcPaint, &rcPaint); + } + else /* if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) */ + { + GuiPaintGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)ActiveBuffer, + GuiData, &ps.rcPaint, &rcPaint); + } + + /* Send it to screen */ + BitBlt(ps.hdc, + ps.rcPaint.left, + ps.rcPaint.top, + rcPaint.right - rcPaint.left, + rcPaint.bottom - rcPaint.top, + GuiData->hMemDC, + rcPaint.left, + rcPaint.top, + SRCCOPY); + + if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) + { + SmallRectToRect(GuiData, &rcPaint, &Console->Selection.srSelection); + + /* Invert the selection */ + if (IntersectRect(&rcPaint, &ps.rcPaint, &rcPaint)) + { + InvertRect(ps.hdc, &rcPaint); + } + } + + LeaveCriticalSection(&GuiData->Lock); + } + EndPaint(GuiData->hWindow, &ps); + +Quit: + if (Success) + LeaveCriticalSection(&Console->Lock); + else + DefWindowProcW(GuiData->hWindow, WM_PAINT, 0, 0); + + return; +} + +static BOOL +IsSystemKey(WORD VirtualKeyCode) +{ + switch (VirtualKeyCode) + { + /* From MSDN, "Virtual-Key Codes" */ + case VK_RETURN: + case VK_SHIFT: + case VK_CONTROL: + case VK_MENU: + case VK_PAUSE: + case VK_CAPITAL: + case VK_ESCAPE: + case VK_LWIN: + case VK_RWIN: + case VK_NUMLOCK: + case VK_SCROLL: + return TRUE; + default: + return FALSE; + } +} + +static VOID +GuiConsoleHandleKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) +{ + PCONSOLE Console = GuiData->Console; + PCONSOLE_SCREEN_BUFFER ActiveBuffer; + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; + + ActiveBuffer = GuiData->ActiveBuffer; + + if (Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) + { + WORD VirtualKeyCode = LOWORD(wParam); + + if (msg != WM_KEYDOWN) goto Quit; + + if (VirtualKeyCode == VK_RETURN) + { + /* Copy (and clear) selection if ENTER is pressed */ + GuiConsoleCopy(GuiData); + goto Quit; + } + else if ( VirtualKeyCode == VK_ESCAPE || + (VirtualKeyCode == 'C' && GetKeyState(VK_CONTROL) & 0x8000) ) + { + /* Cancel selection if ESC or Ctrl-C are pressed */ + GuiConsoleUpdateSelection(Console, NULL); + goto Quit; + } + + if ((Console->Selection.dwFlags & CONSOLE_MOUSE_SELECTION) == 0) + { + /* Keyboard selection mode */ + BOOL Interpreted = FALSE; + BOOL MajPressed = (GetKeyState(VK_SHIFT) & 0x8000); + + switch (VirtualKeyCode) + { + case VK_LEFT: + { + Interpreted = TRUE; + if (Console->dwSelectionCursor.X > 0) + Console->dwSelectionCursor.X--; + + break; + } + + case VK_RIGHT: + { + Interpreted = TRUE; + if (Console->dwSelectionCursor.X < ActiveBuffer->ScreenBufferSize.X - 1) + Console->dwSelectionCursor.X++; + + break; + } + + case VK_UP: + { + Interpreted = TRUE; + if (Console->dwSelectionCursor.Y > 0) + Console->dwSelectionCursor.Y--; + + break; + } + + case VK_DOWN: + { + Interpreted = TRUE; + if (Console->dwSelectionCursor.Y < ActiveBuffer->ScreenBufferSize.Y - 1) + Console->dwSelectionCursor.Y++; + + break; + } + + case VK_HOME: + { + Interpreted = TRUE; + Console->dwSelectionCursor.X = 0; + Console->dwSelectionCursor.Y = 0; + break; + } + + case VK_END: + { + Interpreted = TRUE; + Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1; + break; + } + + case VK_PRIOR: + { + Interpreted = TRUE; + Console->dwSelectionCursor.Y -= ActiveBuffer->ViewSize.Y; + if (Console->dwSelectionCursor.Y < 0) + Console->dwSelectionCursor.Y = 0; + + break; + } + + case VK_NEXT: + { + Interpreted = TRUE; + Console->dwSelectionCursor.Y += ActiveBuffer->ViewSize.Y; + if (Console->dwSelectionCursor.Y >= ActiveBuffer->ScreenBufferSize.Y) + Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1; + + break; + } + + default: + break; + } + + if (Interpreted) + { + if (!MajPressed) + Console->Selection.dwSelectionAnchor = Console->dwSelectionCursor; + + GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); + } + else if (!IsSystemKey(VirtualKeyCode)) + { + /* Emit an error beep sound */ + SendNotifyMessage(GuiData->hWindow, PM_CONSOLE_BEEP, 0, 0); + } + + goto Quit; + } + else + { + /* Mouse selection mode */ + + if (!IsSystemKey(VirtualKeyCode)) + { + /* Clear the selection and send the key into the input buffer */ + GuiConsoleUpdateSelection(Console, NULL); + } + else + { + goto Quit; + } + } + } + + if ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) == 0) + { + MSG Message; + + Message.hwnd = GuiData->hWindow; + Message.message = msg; + Message.wParam = wParam; + Message.lParam = lParam; + + ConioProcessKey(Console, &Message); + } + +Quit: + LeaveCriticalSection(&Console->Lock); +} + + +// FIXME: Remove after fixing GuiConsoleHandleTimer +VOID +GuiInvalidateCell(IN OUT PFRONTEND This, SHORT x, SHORT y); + +static VOID +GuiConsoleHandleTimer(PGUI_CONSOLE_DATA GuiData) +{ + PCONSOLE Console = GuiData->Console; + PCONSOLE_SCREEN_BUFFER Buff; + + SetTimer(GuiData->hWindow, CONGUI_UPDATE_TIMER, CURSOR_BLINK_TIME, NULL); + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; + + Buff = GuiData->ActiveBuffer; + + if (GetType(Buff) == TEXTMODE_BUFFER) + { + GuiInvalidateCell(&Console->TermIFace, Buff->CursorPosition.X, Buff->CursorPosition.Y); + Buff->CursorBlinkOn = !Buff->CursorBlinkOn; + + if ((GuiData->OldCursor.x != Buff->CursorPosition.X) || + (GuiData->OldCursor.y != Buff->CursorPosition.Y)) + { + SCROLLINFO xScroll; + int OldScrollX = -1, OldScrollY = -1; + int NewScrollX = -1, NewScrollY = -1; + + xScroll.cbSize = sizeof(SCROLLINFO); + xScroll.fMask = SIF_POS; + // Capture the original position of the scroll bars and save them. + if (GetScrollInfo(GuiData->hWindow, SB_HORZ, &xScroll)) OldScrollX = xScroll.nPos; + if (GetScrollInfo(GuiData->hWindow, SB_VERT, &xScroll)) OldScrollY = xScroll.nPos; + + // If we successfully got the info for the horizontal scrollbar + if (OldScrollX >= 0) + { + if ((Buff->CursorPosition.X < Buff->ViewOrigin.X) || + (Buff->CursorPosition.X >= (Buff->ViewOrigin.X + Buff->ViewSize.X))) + { + // Handle the horizontal scroll bar + if (Buff->CursorPosition.X >= Buff->ViewSize.X) + NewScrollX = Buff->CursorPosition.X - Buff->ViewSize.X + 1; + else + NewScrollX = 0; + } + else + { + NewScrollX = OldScrollX; + } + } + // If we successfully got the info for the vertical scrollbar + if (OldScrollY >= 0) + { + if ((Buff->CursorPosition.Y < Buff->ViewOrigin.Y) || + (Buff->CursorPosition.Y >= (Buff->ViewOrigin.Y + Buff->ViewSize.Y))) + { + // Handle the vertical scroll bar + if (Buff->CursorPosition.Y >= Buff->ViewSize.Y) + NewScrollY = Buff->CursorPosition.Y - Buff->ViewSize.Y + 1; + else + NewScrollY = 0; + } + else + { + NewScrollY = OldScrollY; + } + } + + // Adjust scroll bars and refresh the window if the cursor has moved outside the visible area + // NOTE: OldScroll# and NewScroll# will both be -1 (initial value) if the info for the respective scrollbar + // was not obtained successfully in the previous steps. This means their difference is 0 (no scrolling) + // and their associated scrollbar is left alone. + if ((OldScrollX != NewScrollX) || (OldScrollY != NewScrollY)) + { + Buff->ViewOrigin.X = NewScrollX; + Buff->ViewOrigin.Y = NewScrollY; + ScrollWindowEx(GuiData->hWindow, + (OldScrollX - NewScrollX) * GuiData->CharWidth, + (OldScrollY - NewScrollY) * GuiData->CharHeight, + NULL, + NULL, + NULL, + NULL, + SW_INVALIDATE); + if (NewScrollX >= 0) + { + xScroll.nPos = NewScrollX; + SetScrollInfo(GuiData->hWindow, SB_HORZ, &xScroll, TRUE); + } + if (NewScrollY >= 0) + { + xScroll.nPos = NewScrollY; + SetScrollInfo(GuiData->hWindow, SB_VERT, &xScroll, TRUE); + } + UpdateWindow(GuiData->hWindow); + // InvalidateRect(GuiData->hWindow, NULL, FALSE); + GuiData->OldCursor.x = Buff->CursorPosition.X; + GuiData->OldCursor.y = Buff->CursorPosition.Y; + } + } + } + else /* if (GetType(Buff) == GRAPHICS_BUFFER) */ + { + } + + LeaveCriticalSection(&Console->Lock); +} + +static BOOL +GuiConsoleHandleClose(PGUI_CONSOLE_DATA GuiData) +{ + PCONSOLE Console = GuiData->Console; + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + return TRUE; + + // TODO: Prompt for termination ? (Warn the user about possible apps running in this console) + + /* + * FIXME: Windows will wait up to 5 seconds for the thread to exit. + * We shouldn't wait here, though, since the console lock is entered. + * A copy of the thread list probably needs to be made. + */ + ConDrvConsoleProcessCtrlEvent(Console, 0, CTRL_CLOSE_EVENT); + + LeaveCriticalSection(&Console->Lock); + return FALSE; +} + +static LRESULT +GuiConsoleHandleNcDestroy(HWND hWnd) +{ + PGUI_CONSOLE_DATA GuiData = GuiGetGuiData(hWnd); + + KillTimer(hWnd, CONGUI_UPDATE_TIMER); + GetSystemMenu(hWnd, TRUE); + + if (GuiData) + { + /* Free the terminal framebuffer */ + if (GuiData->hMemDC ) DeleteDC(GuiData->hMemDC); + if (GuiData->hBitmap) DeleteObject(GuiData->hBitmap); + // if (GuiData->hSysPalette) DeleteObject(GuiData->hSysPalette); + if (GuiData->Font) DeleteObject(GuiData->Font); + } + + /* Free the GuiData registration */ + SetWindowLongPtrW(hWnd, GWLP_USERDATA, (DWORD_PTR)NULL); + + return DefWindowProcW(hWnd, WM_NCDESTROY, 0, 0); +} + +static COORD +PointToCoord(PGUI_CONSOLE_DATA GuiData, LPARAM lParam) +{ + PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; + COORD Coord; + UINT WidthUnit, HeightUnit; + + GetScreenBufferSizeUnits(Buffer, GuiData, &WidthUnit, &HeightUnit); + + Coord.X = Buffer->ViewOrigin.X + ((SHORT)LOWORD(lParam) / (int)WidthUnit ); + Coord.Y = Buffer->ViewOrigin.Y + ((SHORT)HIWORD(lParam) / (int)HeightUnit); + + /* Clip coordinate to ensure it's inside buffer */ + if (Coord.X < 0) + Coord.X = 0; + else if (Coord.X >= Buffer->ScreenBufferSize.X) + Coord.X = Buffer->ScreenBufferSize.X - 1; + + if (Coord.Y < 0) + Coord.Y = 0; + else if (Coord.Y >= Buffer->ScreenBufferSize.Y) + Coord.Y = Buffer->ScreenBufferSize.Y - 1; + + return Coord; +} + +static LRESULT +GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) +{ + BOOL Err = FALSE; + PCONSOLE Console = GuiData->Console; + + if (GuiData->IgnoreNextMouseSignal) + { + if (msg != WM_LBUTTONDOWN && + msg != WM_MBUTTONDOWN && + msg != WM_RBUTTONDOWN && + msg != WM_MOUSEMOVE) + { + /* + * If this mouse signal is not a button-down action or a move, + * then it is the last signal being ignored. + */ + GuiData->IgnoreNextMouseSignal = FALSE; + } + else + { + /* + * This mouse signal is a button-down action or a move. + * Ignore it and perform default action. + */ + Err = TRUE; + } + goto Quit; + } + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + { + Err = TRUE; + goto Quit; + } + + if ( (Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) || + (Console->QuickEdit) ) + { + switch (msg) + { + case WM_LBUTTONDOWN: + { + /* Clear the old selection */ + // GuiConsoleUpdateSelection(Console, NULL); + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; + + /* Restart a new selection */ + Console->Selection.dwSelectionAnchor = PointToCoord(GuiData, lParam); + SetCapture(GuiData->hWindow); + Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; + GuiConsoleUpdateSelection(Console, &Console->Selection.dwSelectionAnchor); + + break; + } + + case WM_LBUTTONUP: + { + // COORD c; + + if (!(Console->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break; + + // c = PointToCoord(GuiData, lParam); + Console->Selection.dwFlags &= ~CONSOLE_MOUSE_DOWN; + // GuiConsoleUpdateSelection(Console, &c); + ReleaseCapture(); + + break; + } + + case WM_LBUTTONDBLCLK: + { + PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; + + if (GetType(Buffer) == TEXTMODE_BUFFER) + { +#ifdef IS_WHITESPACE +#undef IS_WHITESPACE +#endif +#define IS_WHITESPACE(c) \ + ((c) == L'\0' || (c) == L' ' || (c) == L'\t' || (c) == L'\r' || (c) == L'\n') + + PTEXTMODE_SCREEN_BUFFER TextBuffer = (PTEXTMODE_SCREEN_BUFFER)Buffer; + COORD cL, cR; + PCHAR_INFO ptrL, ptrR; + + /* Starting point */ + cL = cR = PointToCoord(GuiData, lParam); + ptrL = ptrR = ConioCoordToPointer(TextBuffer, cL.X, cL.Y); + + /* Enlarge the selection by checking for whitespace */ + while ((0 < cL.X) && !IS_WHITESPACE(ptrL->Char.UnicodeChar) + && !IS_WHITESPACE((ptrL-1)->Char.UnicodeChar)) + { + --cL.X; + --ptrL; + } + while ((cR.X < TextBuffer->ScreenBufferSize.X - 1) && + !IS_WHITESPACE(ptrR->Char.UnicodeChar) && + !IS_WHITESPACE((ptrR+1)->Char.UnicodeChar)) + { + ++cR.X; + ++ptrR; + } + + /* + * Update the selection started with the single + * left-click that preceded this double-click. + */ + Console->Selection.dwSelectionAnchor = cL; + Console->dwSelectionCursor = cR; + + SetCapture(GuiData->hWindow); + Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; + GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); + + /* Ignore the next mouse move signal */ + GuiData->IgnoreNextMouseSignal = TRUE; + } + + break; + } + + case WM_RBUTTONDOWN: + case WM_RBUTTONDBLCLK: + { + if (!(Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)) + { + GuiConsolePaste(GuiData); + } + else + { + GuiConsoleCopy(GuiData); + } + + /* Ignore the next mouse move signal */ + GuiData->IgnoreNextMouseSignal = TRUE; + break; + } + + case WM_MOUSEMOVE: + { + COORD c; + + if (!(wParam & MK_LBUTTON)) break; + if (!(Console->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break; + + c = PointToCoord(GuiData, lParam); /* TODO: Scroll buffer to bring c into view */ + GuiConsoleUpdateSelection(Console, &c); + + break; + } + + default: + Err = FALSE; // TRUE; + break; + } + } + else if (Console->InputBuffer.Mode & ENABLE_MOUSE_INPUT) + { + INPUT_RECORD er; + WORD wKeyState = GET_KEYSTATE_WPARAM(wParam); + DWORD dwButtonState = 0; + DWORD dwControlKeyState = 0; + DWORD dwEventFlags = 0; + + switch (msg) + { + case WM_LBUTTONDOWN: + SetCapture(GuiData->hWindow); + dwButtonState = FROM_LEFT_1ST_BUTTON_PRESSED; + dwEventFlags = 0; + break; + + case WM_MBUTTONDOWN: + SetCapture(GuiData->hWindow); + dwButtonState = FROM_LEFT_2ND_BUTTON_PRESSED; + dwEventFlags = 0; + break; + + case WM_RBUTTONDOWN: + SetCapture(GuiData->hWindow); + dwButtonState = RIGHTMOST_BUTTON_PRESSED; + dwEventFlags = 0; + break; + + case WM_LBUTTONUP: + ReleaseCapture(); + dwButtonState = 0; + dwEventFlags = 0; + break; + + case WM_MBUTTONUP: + ReleaseCapture(); + dwButtonState = 0; + dwEventFlags = 0; + break; + + case WM_RBUTTONUP: + ReleaseCapture(); + dwButtonState = 0; + dwEventFlags = 0; + break; + + case WM_LBUTTONDBLCLK: + dwButtonState = FROM_LEFT_1ST_BUTTON_PRESSED; + dwEventFlags = DOUBLE_CLICK; + break; + + case WM_MBUTTONDBLCLK: + dwButtonState = FROM_LEFT_2ND_BUTTON_PRESSED; + dwEventFlags = DOUBLE_CLICK; + break; + + case WM_RBUTTONDBLCLK: + dwButtonState = RIGHTMOST_BUTTON_PRESSED; + dwEventFlags = DOUBLE_CLICK; + break; + + case WM_MOUSEMOVE: + dwButtonState = 0; + dwEventFlags = MOUSE_MOVED; + break; + + case WM_MOUSEWHEEL: + dwButtonState = GET_WHEEL_DELTA_WPARAM(wParam) << 16; + dwEventFlags = MOUSE_WHEELED; + break; + + case WM_MOUSEHWHEEL: + dwButtonState = GET_WHEEL_DELTA_WPARAM(wParam) << 16; + dwEventFlags = MOUSE_HWHEELED; + break; + + default: + Err = TRUE; + break; + } + + if (!Err) + { + if (wKeyState & MK_LBUTTON) + dwButtonState |= FROM_LEFT_1ST_BUTTON_PRESSED; + if (wKeyState & MK_MBUTTON) + dwButtonState |= FROM_LEFT_2ND_BUTTON_PRESSED; + if (wKeyState & MK_RBUTTON) + dwButtonState |= RIGHTMOST_BUTTON_PRESSED; + + if (GetKeyState(VK_RMENU) & 0x8000) + dwControlKeyState |= RIGHT_ALT_PRESSED; + if (GetKeyState(VK_LMENU) & 0x8000) + dwControlKeyState |= LEFT_ALT_PRESSED; + if (GetKeyState(VK_RCONTROL) & 0x8000) + dwControlKeyState |= RIGHT_CTRL_PRESSED; + if (GetKeyState(VK_LCONTROL) & 0x8000) + dwControlKeyState |= LEFT_CTRL_PRESSED; + if (GetKeyState(VK_SHIFT) & 0x8000) + dwControlKeyState |= SHIFT_PRESSED; + if (GetKeyState(VK_NUMLOCK) & 0x0001) + dwControlKeyState |= NUMLOCK_ON; + if (GetKeyState(VK_SCROLL) & 0x0001) + dwControlKeyState |= SCROLLLOCK_ON; + if (GetKeyState(VK_CAPITAL) & 0x0001) + dwControlKeyState |= CAPSLOCK_ON; + /* See WM_CHAR MSDN documentation for instance */ + if (lParam & 0x01000000) + dwControlKeyState |= ENHANCED_KEY; + + er.EventType = MOUSE_EVENT; + er.Event.MouseEvent.dwMousePosition = PointToCoord(GuiData, lParam); + er.Event.MouseEvent.dwButtonState = dwButtonState; + er.Event.MouseEvent.dwControlKeyState = dwControlKeyState; + er.Event.MouseEvent.dwEventFlags = dwEventFlags; + + ConioProcessInputEvent(Console, &er); + } + } + else + { + Err = TRUE; + } + + LeaveCriticalSection(&Console->Lock); + +Quit: + if (Err) + return DefWindowProcW(GuiData->hWindow, msg, wParam, lParam); + else + return 0; +} + +VOID +GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); +VOID +GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); + +static VOID +GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData) +{ + PCONSOLE Console = GuiData->Console; + + if (OpenClipboard(GuiData->hWindow) == TRUE) + { + PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; + + if (GetType(Buffer) == TEXTMODE_BUFFER) + { + GuiCopyFromTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer, GuiData); + } + else /* if (GetType(Buffer) == GRAPHICS_BUFFER) */ + { + GuiCopyFromGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer, GuiData); + } + + CloseClipboard(); + } + + /* Clear the selection */ + GuiConsoleUpdateSelection(Console, NULL); +} + +VOID +GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); +VOID +GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, + PGUI_CONSOLE_DATA GuiData); + +static VOID +GuiConsolePaste(PGUI_CONSOLE_DATA GuiData) +{ + if (OpenClipboard(GuiData->hWindow) == TRUE) + { + PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; + + if (GetType(Buffer) == TEXTMODE_BUFFER) + { + GuiPasteToTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer, GuiData); + } + else /* if (GetType(Buffer) == GRAPHICS_BUFFER) */ + { + GuiPasteToGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer, GuiData); + } + + CloseClipboard(); + } +} + +static VOID +GuiConsoleGetMinMaxInfo(PGUI_CONSOLE_DATA GuiData, PMINMAXINFO minMaxInfo) +{ + PCONSOLE Console = GuiData->Console; + PCONSOLE_SCREEN_BUFFER ActiveBuffer; + DWORD windx, windy; + UINT WidthUnit, HeightUnit; + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; + + ActiveBuffer = GuiData->ActiveBuffer; + + GetScreenBufferSizeUnits(ActiveBuffer, GuiData, &WidthUnit, &HeightUnit); + + windx = CONGUI_MIN_WIDTH * WidthUnit + 2 * (GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXEDGE)); + windy = CONGUI_MIN_HEIGHT * HeightUnit + 2 * (GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE)) + GetSystemMetrics(SM_CYCAPTION); + + minMaxInfo->ptMinTrackSize.x = windx; + minMaxInfo->ptMinTrackSize.y = windy; + + windx = (ActiveBuffer->ScreenBufferSize.X) * WidthUnit + 2 * (GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXEDGE)); + windy = (ActiveBuffer->ScreenBufferSize.Y) * HeightUnit + 2 * (GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE)) + GetSystemMetrics(SM_CYCAPTION); + + if (ActiveBuffer->ViewSize.X < ActiveBuffer->ScreenBufferSize.X) windy += GetSystemMetrics(SM_CYHSCROLL); // window currently has a horizontal scrollbar + if (ActiveBuffer->ViewSize.Y < ActiveBuffer->ScreenBufferSize.Y) windx += GetSystemMetrics(SM_CXVSCROLL); // window currently has a vertical scrollbar + + minMaxInfo->ptMaxTrackSize.x = windx; + minMaxInfo->ptMaxTrackSize.y = windy; + + LeaveCriticalSection(&Console->Lock); +} + +static VOID +GuiConsoleResize(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) +{ + PCONSOLE Console = GuiData->Console; + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; + + if ((GuiData->WindowSizeLock == FALSE) && + (wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED || wParam == SIZE_MINIMIZED)) + { + PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; + DWORD windx, windy, charx, chary; + UINT WidthUnit, HeightUnit; + + GetScreenBufferSizeUnits(Buff, GuiData, &WidthUnit, &HeightUnit); + + GuiData->WindowSizeLock = TRUE; + + windx = LOWORD(lParam); + windy = HIWORD(lParam); + + // Compensate for existing scroll bars (because lParam values do not accommodate scroll bar) + if (Buff->ViewSize.X < Buff->ScreenBufferSize.X) windy += GetSystemMetrics(SM_CYHSCROLL); // window currently has a horizontal scrollbar + if (Buff->ViewSize.Y < Buff->ScreenBufferSize.Y) windx += GetSystemMetrics(SM_CXVSCROLL); // window currently has a vertical scrollbar + + charx = windx / (int)WidthUnit ; + chary = windy / (int)HeightUnit; + + // Character alignment (round size up or down) + if ((windx % WidthUnit ) >= (WidthUnit / 2)) ++charx; + if ((windy % HeightUnit) >= (HeightUnit / 2)) ++chary; + + // Compensate for added scroll bars in new window + if (charx < Buff->ScreenBufferSize.X) windy -= GetSystemMetrics(SM_CYHSCROLL); // new window will have a horizontal scroll bar + if (chary < Buff->ScreenBufferSize.Y) windx -= GetSystemMetrics(SM_CXVSCROLL); // new window will have a vertical scroll bar + + charx = windx / (int)WidthUnit ; + chary = windy / (int)HeightUnit; + + // Character alignment (round size up or down) + if ((windx % WidthUnit ) >= (WidthUnit / 2)) ++charx; + if ((windy % HeightUnit) >= (HeightUnit / 2)) ++chary; + + // Resize window + if ((charx != Buff->ViewSize.X) || (chary != Buff->ViewSize.Y)) + { + Buff->ViewSize.X = (charx <= Buff->ScreenBufferSize.X) ? charx : Buff->ScreenBufferSize.X; + Buff->ViewSize.Y = (chary <= Buff->ScreenBufferSize.Y) ? chary : Buff->ScreenBufferSize.Y; + } + + GuiConsoleResizeWindow(GuiData, WidthUnit, HeightUnit); + + // Adjust the start of the visible area if we are attempting to show nonexistent areas + if ((Buff->ScreenBufferSize.X - Buff->ViewOrigin.X) < Buff->ViewSize.X) Buff->ViewOrigin.X = Buff->ScreenBufferSize.X - Buff->ViewSize.X; + if ((Buff->ScreenBufferSize.Y - Buff->ViewOrigin.Y) < Buff->ViewSize.Y) Buff->ViewOrigin.Y = Buff->ScreenBufferSize.Y - Buff->ViewSize.Y; + InvalidateRect(GuiData->hWindow, NULL, TRUE); + + GuiData->WindowSizeLock = FALSE; + } + + LeaveCriticalSection(&Console->Lock); +} + +/* +// HACK: This functionality is standard for general scrollbars. Don't add it by hand. + +VOID +FASTCALL +GuiConsoleHandleScrollbarMenu(VOID) +{ + HMENU hMenu; + + hMenu = CreatePopupMenu(); + if (hMenu == NULL) + { + DPRINT("CreatePopupMenu failed\n"); + return; + } + + //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLHERE); + //InsertItem(hMenu, MFT_SEPARATOR, MIIM_FTYPE, 0, NULL, -1); + //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLTOP); + //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLBOTTOM); + //InsertItem(hMenu, MFT_SEPARATOR, MIIM_FTYPE, 0, NULL, -1); + //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLPAGE_UP); + //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLPAGE_DOWN); + //InsertItem(hMenu, MFT_SEPARATOR, MIIM_FTYPE, 0, NULL, -1); + //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLUP); + //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLDOWN); +} +*/ + +static LRESULT +GuiConsoleHandleScroll(PGUI_CONSOLE_DATA GuiData, UINT uMsg, WPARAM wParam) +{ + PCONSOLE Console = GuiData->Console; + PCONSOLE_SCREEN_BUFFER Buff; + SCROLLINFO sInfo; + int fnBar; + int old_pos, Maximum; + PSHORT pShowXY; + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return 0; + + Buff = GuiData->ActiveBuffer; + + if (uMsg == WM_HSCROLL) + { + fnBar = SB_HORZ; + Maximum = Buff->ScreenBufferSize.X - Buff->ViewSize.X; + pShowXY = &Buff->ViewOrigin.X; + } + else + { + fnBar = SB_VERT; + Maximum = Buff->ScreenBufferSize.Y - Buff->ViewSize.Y; + pShowXY = &Buff->ViewOrigin.Y; + } + + /* set scrollbar sizes */ + sInfo.cbSize = sizeof(SCROLLINFO); + sInfo.fMask = SIF_RANGE | SIF_POS | SIF_PAGE | SIF_TRACKPOS; + + if (!GetScrollInfo(GuiData->hWindow, fnBar, &sInfo)) goto Quit; + + old_pos = sInfo.nPos; + + switch (LOWORD(wParam)) + { + case SB_LINELEFT: + sInfo.nPos -= 1; + break; + + case SB_LINERIGHT: + sInfo.nPos += 1; + break; + + case SB_PAGELEFT: + sInfo.nPos -= sInfo.nPage; + break; + + case SB_PAGERIGHT: + sInfo.nPos += sInfo.nPage; + break; + + case SB_THUMBTRACK: + sInfo.nPos = sInfo.nTrackPos; + ConioPause(Console, PAUSED_FROM_SCROLLBAR); + break; + + case SB_THUMBPOSITION: + ConioUnpause(Console, PAUSED_FROM_SCROLLBAR); + break; + + case SB_TOP: + sInfo.nPos = sInfo.nMin; + break; + + case SB_BOTTOM: + sInfo.nPos = sInfo.nMax; + break; + + default: + break; + } + + sInfo.nPos = max(sInfo.nPos, 0); + sInfo.nPos = min(sInfo.nPos, Maximum); + + if (old_pos != sInfo.nPos) + { + USHORT OldX = Buff->ViewOrigin.X; + USHORT OldY = Buff->ViewOrigin.Y; + UINT WidthUnit, HeightUnit; + + *pShowXY = sInfo.nPos; + + GetScreenBufferSizeUnits(Buff, GuiData, &WidthUnit, &HeightUnit); + + ScrollWindowEx(GuiData->hWindow, + (OldX - Buff->ViewOrigin.X) * WidthUnit , + (OldY - Buff->ViewOrigin.Y) * HeightUnit, + NULL, + NULL, + NULL, + NULL, + SW_INVALIDATE); + + sInfo.fMask = SIF_POS; + SetScrollInfo(GuiData->hWindow, fnBar, &sInfo, TRUE); + + UpdateWindow(GuiData->hWindow); + // InvalidateRect(GuiData->hWindow, NULL, FALSE); + } + +Quit: + LeaveCriticalSection(&Console->Lock); + return 0; +} + + +BOOL +EnterFullScreen(PGUI_CONSOLE_DATA GuiData); +VOID +LeaveFullScreen(PGUI_CONSOLE_DATA GuiData); +VOID +SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); +VOID +GuiConsoleSwitchFullScreen(PGUI_CONSOLE_DATA GuiData); + +static LRESULT CALLBACK +ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + LRESULT Result = 0; + PGUI_CONSOLE_DATA GuiData = NULL; + PCONSOLE Console = NULL; + + /* + * - If it's the first time we create a window for the terminal, + * just initialize it and return. + * + * - If we are destroying the window, just do it and return. + */ + if (msg == WM_NCCREATE) + { + return (LRESULT)GuiConsoleHandleNcCreate(hWnd, (LPCREATESTRUCTW)lParam); + } + else if (msg == WM_NCDESTROY) + { + return GuiConsoleHandleNcDestroy(hWnd); + } + + /* + * Now the terminal window is initialized. + * Get the terminal data via the window's data. + * If there is no data, just go away. + */ + GuiData = GuiGetGuiData(hWnd); + if (GuiData == NULL) return DefWindowProcW(hWnd, msg, wParam, lParam); + + // TEMPORARY HACK until all of the functions can deal with a NULL GuiData->ActiveBuffer ... + if (GuiData->ActiveBuffer == NULL) return DefWindowProcW(hWnd, msg, wParam, lParam); + + /* + * Just retrieve a pointer to the console in case somebody needs it. + * It is not NULL because it was checked in GuiGetGuiData. + * Each helper function which needs the console has to validate and lock it. + */ + Console = GuiData->Console; + + /* We have a console, start message dispatching */ + switch (msg) + { + case WM_ACTIVATE: + { + WORD ActivationState = LOWORD(wParam); + + DPRINT1("WM_ACTIVATE - ActivationState = %d\n"); + + if ( ActivationState == WA_ACTIVE || + ActivationState == WA_CLICKACTIVE ) + { + if (GuiData->GuiInfo.FullScreen) + { + EnterFullScreen(GuiData); + // // PostMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_RESTORE, 0); + // SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_RESTORE, 0); + } + } + else // if (ActivationState == WA_INACTIVE) + { + if (GuiData->GuiInfo.FullScreen) + { + SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); + LeaveFullScreen(GuiData); + // // PostMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); + // SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); + } + } + + /* + * When we are in QuickEdit mode, ignore the next mouse signal + * when we are going to be enabled again via the mouse, in order + * to prevent e.g. an erroneous right-click from the user which + * would have as an effect to paste some unwanted text... + */ + if (Console->QuickEdit && (ActivationState == WA_CLICKACTIVE)) + GuiData->IgnoreNextMouseSignal = TRUE; + + break; + } + + case WM_CLOSE: + if (GuiConsoleHandleClose(GuiData)) goto Default; + break; + + case WM_PAINT: + GuiConsoleHandlePaint(GuiData); + break; + + case WM_TIMER: + GuiConsoleHandleTimer(GuiData); + break; + + case WM_PALETTECHANGED: + { + PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; + + DPRINT("WM_PALETTECHANGED called\n"); + + /* + * Protects against infinite loops: + * "... A window that receives this message must not realize + * its palette, unless it determines that wParam does not contain + * its own window handle." (WM_PALETTECHANGED description - MSDN) + * + * This message is sent to all windows, including the one that + * changed the system palette and caused this message to be sent. + * The wParam of this message contains the handle of the window + * that caused the system palette to change. To avoid an infinite + * loop, care must be taken to check that the wParam of this message + * does not match the window's handle. + */ + if ((HWND)wParam == hWnd) break; + + DPRINT("WM_PALETTECHANGED ok\n"); + + // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) + if (ActiveBuffer->PaletteHandle) + { + DPRINT("WM_PALETTECHANGED changing palette\n"); + + /* Specify the use of the system palette for the framebuffer */ + SetSystemPaletteUse(GuiData->hMemDC, ActiveBuffer->PaletteUsage); + + /* Realize the (logical) palette */ + RealizePalette(GuiData->hMemDC); + } + + DPRINT("WM_PALETTECHANGED quit\n"); + + break; + } + + case WM_KEYDOWN: + case WM_KEYUP: + case WM_CHAR: + case WM_DEADCHAR: + case WM_SYSKEYDOWN: + case WM_SYSKEYUP: + case WM_SYSCHAR: + case WM_SYSDEADCHAR: + { + /* Detect Alt-Enter presses and switch back and forth to fullscreen mode */ + if (msg == WM_SYSKEYDOWN && (HIWORD(lParam) & KF_ALTDOWN) && wParam == VK_RETURN) + { + /* Switch only at first Alt-Enter press, and ignore subsequent key repetitions */ + if ((HIWORD(lParam) & (KF_UP | KF_REPEAT)) != KF_REPEAT) + GuiConsoleSwitchFullScreen(GuiData); + + break; + } + + GuiConsoleHandleKey(GuiData, msg, wParam, lParam); + break; + } + + case WM_SETCURSOR: + { + /* + * The message was sent because we are manually triggering a change. + * Check whether the mouse is indeed present on this console window + * and take appropriate decisions. + */ + if (wParam == -1 && lParam == -1) + { + POINT mouseCoords; + HWND hWndHit; + + /* Get the placement of the mouse */ + GetCursorPos(&mouseCoords); + + /* On which window is placed the mouse ? */ + hWndHit = WindowFromPoint(mouseCoords); + + /* It's our window. Perform the hit-test to be used later on. */ + if (hWndHit == hWnd) + { + wParam = (WPARAM)hWnd; + lParam = DefWindowProcW(hWndHit, WM_NCHITTEST, 0, + MAKELPARAM(mouseCoords.x, mouseCoords.y)); + } + } + + /* Set the mouse cursor only when we are in the client area */ + if ((HWND)wParam == hWnd && LOWORD(lParam) == HTCLIENT) + { + if (GuiData->MouseCursorRefCount >= 0) + { + /* Show the cursor */ + SetCursor(GuiData->hCursor); + } + else + { + /* Hide the cursor if the reference count is negative */ + SetCursor(NULL); + } + return TRUE; + } + else + { + goto Default; + } + } + + case WM_LBUTTONDOWN: + case WM_MBUTTONDOWN: + case WM_RBUTTONDOWN: + case WM_LBUTTONUP: + case WM_MBUTTONUP: + case WM_RBUTTONUP: + case WM_LBUTTONDBLCLK: + case WM_MBUTTONDBLCLK: + case WM_RBUTTONDBLCLK: + case WM_MOUSEMOVE: + case WM_MOUSEWHEEL: + case WM_MOUSEHWHEEL: + { + Result = GuiConsoleHandleMouse(GuiData, msg, wParam, lParam); + break; + } + + case WM_HSCROLL: + case WM_VSCROLL: + { + Result = GuiConsoleHandleScroll(GuiData, msg, wParam); + break; + } + + case WM_NCRBUTTONDOWN: + { + DPRINT1("WM_NCRBUTTONDOWN\n"); + /* + * HACK: !! Because, when we deal with WM_RBUTTON* and we do not + * call after that DefWindowProc, on ReactOS, right-clicks on the + * (non-client) application title-bar does not display the system + * menu and does not trigger a WM_NCRBUTTONUP message too. + * See: http://git.reactos.org/?p=reactos.git;a=blob;f=reactos/win32ss/user/user32/windows/defwnd.c;hb=332bc8f482f40fd05ab510f78276576719fbfba8#l1103 + * and line 1135 too. + */ +#if 0 + if (DefWindowProcW(hWnd, WM_NCHITTEST, 0, lParam) == HTCAPTION) + { + /* Call DefWindowProcW with the WM_CONTEXTMENU message */ + msg = WM_CONTEXTMENU; + } +#endif + goto Default; + } + // case WM_NCRBUTTONUP: + // DPRINT1("WM_NCRBUTTONUP\n"); + // goto Default; + + case WM_CONTEXTMENU: + { + if (DefWindowProcW(hWnd /*GuiData->hWindow*/, WM_NCHITTEST, 0, lParam) == HTCLIENT) + { + HMENU hMenu = CreatePopupMenu(); + if (hMenu != NULL) + { + GuiConsoleAppendMenuItems(hMenu, GuiConsoleEditMenuItems); + TrackPopupMenuEx(hMenu, + TPM_RIGHTBUTTON, + GET_X_LPARAM(lParam), + GET_Y_LPARAM(lParam), + hWnd, + NULL); + DestroyMenu(hMenu); + } + break; + } + else + { + goto Default; + } + } + + case WM_INITMENU: + { + HMENU hMenu = (HMENU)wParam; + if (hMenu != NULL) + { + /* Enable or disable the Close menu item */ + EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | + (GuiData->IsCloseButtonEnabled ? MF_ENABLED : MF_GRAYED)); + + /* Enable or disable the Copy and Paste items */ + EnableMenuItem(hMenu, ID_SYSTEM_EDIT_COPY , MF_BYCOMMAND | + ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) && + (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) ? MF_ENABLED : MF_GRAYED)); + // FIXME: Following whether the active screen buffer is text-mode + // or graphics-mode, search for CF_UNICODETEXT or CF_BITMAP formats. + EnableMenuItem(hMenu, ID_SYSTEM_EDIT_PASTE, MF_BYCOMMAND | + (!(Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) && + IsClipboardFormatAvailable(CF_UNICODETEXT) ? MF_ENABLED : MF_GRAYED)); + } + + if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + { + GuiSendMenuEvent(Console, WM_INITMENU); + LeaveCriticalSection(&Console->Lock); + } + break; + } + + case WM_MENUSELECT: + { + if (HIWORD(wParam) == 0xFFFF) // Allow all the menu flags + { + if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + { + GuiSendMenuEvent(Console, WM_MENUSELECT); + LeaveCriticalSection(&Console->Lock); + } + } + break; + } + + case WM_COMMAND: + case WM_SYSCOMMAND: + { + Result = GuiConsoleHandleSysMenuCommand(GuiData, wParam, lParam); + break; + } + + case WM_SETFOCUS: + case WM_KILLFOCUS: + { + if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + { + BOOL SetFocus = (msg == WM_SETFOCUS); + INPUT_RECORD er; + + er.EventType = FOCUS_EVENT; + er.Event.FocusEvent.bSetFocus = SetFocus; + ConioProcessInputEvent(Console, &er); + + if (SetFocus) + DPRINT1("TODO: Create console caret\n"); + else + DPRINT1("TODO: Destroy console caret\n"); + + LeaveCriticalSection(&Console->Lock); + } + break; + } + + case WM_GETMINMAXINFO: + GuiConsoleGetMinMaxInfo(GuiData, (PMINMAXINFO)lParam); + break; + + case WM_MOVE: + { + if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + { + // TODO: Simplify the code. + // See: GuiConsoleNotifyWndProc() PM_CREATE_CONSOLE. + + RECT rcWnd; + + /* Retrieve our real position */ + GetWindowRect(GuiData->hWindow, &rcWnd); + GuiData->GuiInfo.WindowOrigin.x = rcWnd.left; + GuiData->GuiInfo.WindowOrigin.y = rcWnd.top; + + LeaveCriticalSection(&Console->Lock); + } + break; + } + + case WM_SIZE: + GuiConsoleResize(GuiData, wParam, lParam); + break; + + case PM_RESIZE_TERMINAL: + { + PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; + HDC hDC; + HBITMAP hnew, hold; + + DWORD Width, Height; + UINT WidthUnit, HeightUnit; + + GetScreenBufferSizeUnits(Buff, GuiData, &WidthUnit, &HeightUnit); + + Width = Buff->ScreenBufferSize.X * WidthUnit ; + Height = Buff->ScreenBufferSize.Y * HeightUnit; + + /* Recreate the framebuffer */ + hDC = GetDC(GuiData->hWindow); + hnew = CreateCompatibleBitmap(hDC, Width, Height); + ReleaseDC(GuiData->hWindow, hDC); + hold = SelectObject(GuiData->hMemDC, hnew); + if (GuiData->hBitmap) + { + if (hold == GuiData->hBitmap) DeleteObject(GuiData->hBitmap); + } + GuiData->hBitmap = hnew; + + /* Resize the window to the user's values */ + GuiData->WindowSizeLock = TRUE; + GuiConsoleResizeWindow(GuiData, WidthUnit, HeightUnit); + GuiData->WindowSizeLock = FALSE; + break; + } + + case PM_APPLY_CONSOLE_INFO: + { + if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + { + GuiApplyUserSettings(GuiData, (HANDLE)wParam, (BOOL)lParam); + LeaveCriticalSection(&Console->Lock); + } + break; + } + + case PM_CONSOLE_BEEP: + DPRINT1("Beep !!\n"); + Beep(800, 200); + break; + + // case PM_CONSOLE_SET_TITLE: + // SetWindowText(GuiData->hWindow, GuiData->Console->Title.Buffer); + // break; + + default: Default: + Result = DefWindowProcW(hWnd, msg, wParam, lParam); + break; + } + + return Result; +} + +/* EOF */ diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h b/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h new file mode 100644 index 00000000000..87097384eb7 --- /dev/null +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.h @@ -0,0 +1,68 @@ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Console Server DLL + * FILE: frontends/gui/conwnd.h + * PURPOSE: GUI Console Window Class + * PROGRAMMERS: G van Geldorp + * Johannes Anderwald + * Jeffrey Morlan + * Hermes Belusca-Maito (hermes.belusca@sfr.fr) + */ + +#pragma once + +/* GUI Console Window Class name */ +#define GUI_CONWND_CLASS L"ConsoleWindowClass" + +#ifndef WM_APP + #define WM_APP 0x8000 +#endif +#define PM_RESIZE_TERMINAL (WM_APP + 3) +#define PM_CONSOLE_BEEP (WM_APP + 4) +#define PM_CONSOLE_SET_TITLE (WM_APP + 5) + + +typedef struct _GUI_CONSOLE_DATA +{ + CRITICAL_SECTION Lock; + BOOL WindowSizeLock; + HANDLE hGuiInitEvent; + + POINT OldCursor; + + LONG_PTR WndStyle; + LONG_PTR WndStyleEx; + BOOL IsWndMax; + WINDOWPLACEMENT WndPl; + + HWND hWindow; /* Handle to the console's window */ + HDC hMemDC; /* Memory DC holding the console framebuffer */ + HBITMAP hBitmap; /* Console framebuffer */ + HPALETTE hSysPalette; /* Handle to the original system palette */ + + HICON hIcon; /* Handle to the console's icon (big) */ + HICON hIconSm; /* Handle to the console's icon (small) */ + +/*** The following may be put per-screen-buffer !! ***/ + HCURSOR hCursor; /* Handle to the mouse cursor */ + INT MouseCursorRefCount; /* The reference counter associated with the mouse cursor. >= 0 and the cursor is shown; < 0 and the cursor is hidden. */ + BOOL IgnoreNextMouseSignal; /* Used in cases where we don't want to treat a mouse signal */ + + BOOL IsCloseButtonEnabled; /* TRUE if the Close button and the corresponding system menu item are enabled (default), FALSE otherwise */ + UINT CmdIdLow ; /* Lowest menu id of the user-reserved menu id range */ + UINT CmdIdHigh; /* Highest menu id of the user-reserved menu id range */ + +// COLORREF Colors[16]; + +// PVOID ScreenBuffer; /* Hardware screen buffer */ + + HFONT Font; + UINT CharWidth; + UINT CharHeight; +/*****************************************************/ + + PCONSOLE Console; /* Pointer to the owned console */ + PCONSOLE_SCREEN_BUFFER ActiveBuffer; /* Pointer to the active screen buffer (then maybe the previous Console member is redundant?? Or not...) */ + + GUI_CONSOLE_INFO GuiInfo; /* GUI terminal settings */ +} GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA; diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c index 4a23f662e3b..caf9330d882 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/fullscreen.c @@ -13,6 +13,8 @@ #define NDEBUG #include +#include "guiterm.h" + /* FUNCTIONS ******************************************************************/ BOOL diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c index 69808518b94..8b2135fb24c 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/graphics.c @@ -13,6 +13,8 @@ #define NDEBUG #include +#include "guiterm.h" + /* FUNCTIONS ******************************************************************/ VOID diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c index f12305ee6fc..0d64f83e604 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c @@ -14,6 +14,9 @@ #define NDEBUG #include +#include "guiterm.h" +#include "guisettings.h" + VOID GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData); VOID SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h index 88265cf61e8..efc8f0dd273 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.h @@ -37,50 +37,7 @@ typedef struct _GUI_CONSOLE_INFO #ifndef CONSOLE_H__ // If we aren't included by console.dll -typedef struct _GUI_CONSOLE_DATA -{ - CRITICAL_SECTION Lock; - BOOL WindowSizeLock; - HANDLE hGuiInitEvent; - - POINT OldCursor; - - LONG_PTR WndStyle; - LONG_PTR WndStyleEx; - BOOL IsWndMax; - WINDOWPLACEMENT WndPl; - - HWND hWindow; /* Handle to the console's window */ - HDC hMemDC; /* Memory DC holding the console framebuffer */ - HBITMAP hBitmap; /* Console framebuffer */ - HPALETTE hSysPalette; /* Handle to the original system palette */ - - HICON hIcon; /* Handle to the console's icon (big) */ - HICON hIconSm; /* Handle to the console's icon (small) */ - -/*** The following may be put per-screen-buffer !! ***/ - HCURSOR hCursor; /* Handle to the mouse cursor */ - INT MouseCursorRefCount; /* The reference counter associated with the mouse cursor. >= 0 and the cursor is shown; < 0 and the cursor is hidden. */ - BOOL IgnoreNextMouseSignal; /* Used in cases where we don't want to treat a mouse signal */ - - BOOL IsCloseButtonEnabled; /* TRUE if the Close button and the corresponding system menu item are enabled (default), FALSE otherwise */ - UINT CmdIdLow ; /* Lowest menu id of the user-reserved menu id range */ - UINT CmdIdHigh; /* Highest menu id of the user-reserved menu id range */ - -// COLORREF Colors[16]; - -// PVOID ScreenBuffer; /* Hardware screen buffer */ - - HFONT Font; - UINT CharWidth; - UINT CharHeight; -/*****************************************************/ - - PCONSOLE Console; /* Pointer to the owned console */ - PCONSOLE_SCREEN_BUFFER ActiveBuffer; /* Pointer to the active screen buffer (then maybe the previous Console member is redundant?? Or not...) */ - - GUI_CONSOLE_INFO GuiInfo; /* GUI terminal settings */ -} GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA; +#include "conwnd.h" /* FUNCTIONS ******************************************************************/ diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c index cda9b63f0ab..b68ec12e55d 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c @@ -13,7 +13,6 @@ #include -#include #define COBJMACROS #include @@ -23,17 +22,12 @@ #include "guiterm.h" #include "resource.h" -/* GUI Console Window Class name */ -#define GUI_CONWND_CLASS L"ConsoleWindowClass" +// HACK!! Remove it when the hack in GuiWriteStream is fixed +#define CONGUI_UPDATE_TIME 0 +#define CONGUI_UPDATE_TIMER 1 -#ifndef WM_APP - #define WM_APP 0x8000 -#endif #define PM_CREATE_CONSOLE (WM_APP + 1) #define PM_DESTROY_CONSOLE (WM_APP + 2) -#define PM_RESIZE_TERMINAL (WM_APP + 3) -#define PM_CONSOLE_BEEP (WM_APP + 4) -#define PM_CONSOLE_SET_TITLE (WM_APP + 5) /* Not defined in any header file */ @@ -50,85 +44,19 @@ typedef struct _GUI_INIT_INFO ULONG ProcessId; } GUI_INIT_INFO, *PGUI_INIT_INFO; -/**************************************************************\ -\** Define the Console Leader Process for the console window **/ -#define GWLP_CONSOLEWND_ALLOC (2 * sizeof(LONG_PTR)) -#define GWLP_CONSOLE_LEADER_PID 0 -#define GWLP_CONSOLE_LEADER_TID 4 - -#define SetConsoleWndConsoleLeaderCID(GuiData) \ -do { \ - PCONSOLE_PROCESS_DATA ProcessData; \ - CLIENT_ID ConsoleLeaderCID; \ - ProcessData = CONTAINING_RECORD((GuiData)->Console->ProcessList.Blink, \ - CONSOLE_PROCESS_DATA, \ - ConsoleLink); \ - ConsoleLeaderCID = ProcessData->Process->ClientId; \ - SetWindowLongPtrW((GuiData)->hWindow, GWLP_CONSOLE_LEADER_PID, \ - (LONG_PTR)(ConsoleLeaderCID.UniqueProcess)); \ - SetWindowLongPtrW((GuiData)->hWindow, GWLP_CONSOLE_LEADER_TID, \ - (LONG_PTR)(ConsoleLeaderCID.UniqueThread )); \ -} while (0) -/**************************************************************/ - static BOOL ConsInitialized = FALSE; -static HICON ghDefaultIcon = NULL; -static HICON ghDefaultIconSm = NULL; -static HCURSOR ghDefaultCursor = NULL; static HWND NotifyWnd = NULL; -typedef struct _GUICONSOLE_MENUITEM -{ - UINT uID; - const struct _GUICONSOLE_MENUITEM *SubMenu; - WORD wCmdID; -} GUICONSOLE_MENUITEM, *PGUICONSOLE_MENUITEM; +extern HICON ghDefaultIcon; +extern HICON ghDefaultIconSm; +extern HCURSOR ghDefaultCursor; -static const GUICONSOLE_MENUITEM GuiConsoleEditMenuItems[] = -{ - { IDS_MARK, NULL, ID_SYSTEM_EDIT_MARK }, - { IDS_COPY, NULL, ID_SYSTEM_EDIT_COPY }, - { IDS_PASTE, NULL, ID_SYSTEM_EDIT_PASTE }, - { IDS_SELECTALL, NULL, ID_SYSTEM_EDIT_SELECTALL }, - { IDS_SCROLL, NULL, ID_SYSTEM_EDIT_SCROLL }, - { IDS_FIND, NULL, ID_SYSTEM_EDIT_FIND }, - - { 0, NULL, 0 } /* End of list */ -}; - -static const GUICONSOLE_MENUITEM GuiConsoleMainMenuItems[] = -{ - { IDS_EDIT, GuiConsoleEditMenuItems, 0 }, - { IDS_DEFAULTS, NULL, ID_SYSTEM_DEFAULTS }, - { IDS_PROPERTIES, NULL, ID_SYSTEM_PROPERTIES }, - - { 0, NULL, 0 } /* End of list */ -}; - -/* - * Default 16-color palette for foreground and background - * (corresponding flags in comments). - */ -const COLORREF s_Colors[16] = -{ - RGB(0, 0, 0), // (Black) - RGB(0, 0, 128), // BLUE - RGB(0, 128, 0), // GREEN - RGB(0, 128, 128), // BLUE | GREEN - RGB(128, 0, 0), // RED - RGB(128, 0, 128), // BLUE | RED - RGB(128, 128, 0), // GREEN | RED - RGB(192, 192, 192), // BLUE | GREEN | RED - - RGB(128, 128, 128), // (Grey) INTENSITY - RGB(0, 0, 255), // BLUE | INTENSITY - RGB(0, 255, 0), // GREEN | INTENSITY - RGB(0, 255, 255), // BLUE | GREEN | INTENSITY - RGB(255, 0, 0), // RED | INTENSITY - RGB(255, 0, 255), // BLUE | RED | INTENSITY - RGB(255, 255, 0), // GREEN | RED | INTENSITY - RGB(255, 255, 255) // BLUE | GREEN | RED | INTENSITY -}; +VOID +SetConWndConsoleLeaderCID(IN PGUI_CONSOLE_DATA GuiData); +BOOLEAN +RegisterConWndClass(IN HINSTANCE hInstance); +BOOLEAN +UnRegisterConWndClass(HINSTANCE hInstance); /* FUNCTIONS ******************************************************************/ @@ -156,227 +84,6 @@ GetScreenBufferSizeUnits(IN PCONSOLE_SCREEN_BUFFER Buffer, } } - - -static VOID -GuiConsoleAppendMenuItems(HMENU hMenu, - const GUICONSOLE_MENUITEM *Items) -{ - UINT i = 0; - WCHAR szMenuString[255]; - HMENU hSubMenu; - - do - { - if (Items[i].uID != (UINT)-1) - { - if (LoadStringW(ConSrvDllInstance, - Items[i].uID, - szMenuString, - sizeof(szMenuString) / sizeof(szMenuString[0])) > 0) - { - if (Items[i].SubMenu != NULL) - { - hSubMenu = CreatePopupMenu(); - if (hSubMenu != NULL) - { - GuiConsoleAppendMenuItems(hSubMenu, - Items[i].SubMenu); - - if (!AppendMenuW(hMenu, - MF_STRING | MF_POPUP, - (UINT_PTR)hSubMenu, - szMenuString)) - { - DestroyMenu(hSubMenu); - } - } - } - else - { - AppendMenuW(hMenu, - MF_STRING, - Items[i].wCmdID, - szMenuString); - } - } - } - else - { - AppendMenuW(hMenu, - MF_SEPARATOR, - 0, - NULL); - } - i++; - } while (!(Items[i].uID == 0 && Items[i].SubMenu == NULL && Items[i].wCmdID == 0)); -} - -static VOID -GuiConsoleCreateSysMenu(HWND hWnd) -{ - HMENU hMenu = GetSystemMenu(hWnd, FALSE); - if (hMenu != NULL) - { - GuiConsoleAppendMenuItems(hMenu, GuiConsoleMainMenuItems); - DrawMenuBar(hWnd); - } -} - -static VOID -GuiSendMenuEvent(PCONSOLE Console, UINT CmdId) -{ - INPUT_RECORD er; - - er.EventType = MENU_EVENT; - er.Event.MenuEvent.dwCommandId = CmdId; - - DPRINT("Menu item ID: %d\n", CmdId); - ConioProcessInputEvent(Console, &er); -} - -static VOID -GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData); -static VOID -GuiConsolePaste(PGUI_CONSOLE_DATA GuiData); -static VOID -GuiConsoleUpdateSelection(PCONSOLE Console, PCOORD coord); -static VOID NTAPI -GuiDrawRegion(IN OUT PFRONTEND This, SMALL_RECT* Region); -static VOID -GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightUnit); - - -static LRESULT -GuiConsoleHandleSysMenuCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) -{ - LRESULT Ret = TRUE; - PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER ActiveBuffer; - - if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) - { - Ret = FALSE; - goto Quit; - } - ActiveBuffer = GuiData->ActiveBuffer; - - /* - * In case the selected menu item belongs to the user-reserved menu id range, - * send to him a menu event and return directly. The user must handle those - * reserved menu commands... - */ - if (GuiData->CmdIdLow <= (UINT)wParam && (UINT)wParam <= GuiData->CmdIdHigh) - { - GuiSendMenuEvent(Console, (UINT)wParam); - goto Unlock_Quit; - } - - /* ... otherwise, perform actions. */ - switch (wParam) - { - case ID_SYSTEM_EDIT_MARK: - { - /* Clear the old selection */ - // GuiConsoleUpdateSelection(Console, NULL); - Console->Selection.dwFlags = CONSOLE_NO_SELECTION; - - /* Restart a new selection */ - Console->dwSelectionCursor.X = ActiveBuffer->ViewOrigin.X; - Console->dwSelectionCursor.Y = ActiveBuffer->ViewOrigin.Y; - Console->Selection.dwSelectionAnchor = Console->dwSelectionCursor; - GuiConsoleUpdateSelection(Console, &Console->Selection.dwSelectionAnchor); - - break; - } - - case ID_SYSTEM_EDIT_COPY: - GuiConsoleCopy(GuiData); - break; - - case ID_SYSTEM_EDIT_PASTE: - GuiConsolePaste(GuiData); - break; - - case ID_SYSTEM_EDIT_SELECTALL: - { - /* Clear the old selection */ - // GuiConsoleUpdateSelection(Console, NULL); - Console->Selection.dwFlags = CONSOLE_NO_SELECTION; - - /* - * The selection area extends to the whole screen buffer's width. - */ - Console->Selection.dwSelectionAnchor.X = 0; - Console->Selection.dwSelectionAnchor.Y = 0; - Console->dwSelectionCursor.X = ActiveBuffer->ScreenBufferSize.X - 1; - - /* - * Determine whether the selection must extend to just some part - * (for text-mode screen buffers) or to all of the screen buffer's - * height (for graphics ones). - */ - if (GetType(ActiveBuffer) == TEXTMODE_BUFFER) - { - /* - * We select all the characters from the first line - * to the line where the cursor is positioned. - */ - Console->dwSelectionCursor.Y = ActiveBuffer->CursorPosition.Y; - } - else /* if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) */ - { - /* - * We select all the screen buffer area. - */ - Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1; - } - - /* Restart a new selection */ - Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION; - GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); - - break; - } - - case ID_SYSTEM_EDIT_SCROLL: - DPRINT1("Scrolling is not handled yet\n"); - break; - - case ID_SYSTEM_EDIT_FIND: - DPRINT1("Finding is not handled yet\n"); - break; - - case ID_SYSTEM_DEFAULTS: - GuiConsoleShowConsoleProperties(GuiData, TRUE); - break; - - case ID_SYSTEM_PROPERTIES: - GuiConsoleShowConsoleProperties(GuiData, FALSE); - break; - - default: - Ret = FALSE; - break; - } - -Unlock_Quit: - LeaveCriticalSection(&Console->Lock); -Quit: - if (!Ret) - Ret = DefWindowProcW(GuiData->hWindow, WM_SYSCOMMAND, wParam, lParam); - - return Ret; -} - -static PGUI_CONSOLE_DATA -GuiGetGuiData(HWND hWnd) -{ - /* This function ensures that the console pointer is not NULL */ - PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)GetWindowLongPtrW(hWnd, GWLP_USERDATA); - return ( ((GuiData == NULL) || (GuiData->hWindow == hWnd && GuiData->Console != NULL)) ? GuiData : NULL ); -} - VOID GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData) { @@ -387,169 +94,11 @@ GuiConsoleMoveWindow(PGUI_CONSOLE_DATA GuiData) NULL, GuiData->GuiInfo.WindowOrigin.x, GuiData->GuiInfo.WindowOrigin.y, - 0, - 0, + 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE); } } -static VOID -GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightUnit) -{ - PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; - SCROLLINFO sInfo; - - DWORD Width, Height; - - Width = Buff->ViewSize.X * WidthUnit + - 2 * (GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXEDGE)); - Height = Buff->ViewSize.Y * HeightUnit + - 2 * (GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE)) + GetSystemMetrics(SM_CYCAPTION); - - /* Set scrollbar sizes */ - sInfo.cbSize = sizeof(SCROLLINFO); - sInfo.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; - sInfo.nMin = 0; - if (Buff->ScreenBufferSize.Y > Buff->ViewSize.Y) - { - sInfo.nMax = Buff->ScreenBufferSize.Y - 1; - sInfo.nPage = Buff->ViewSize.Y; - sInfo.nPos = Buff->ViewOrigin.Y; - SetScrollInfo(GuiData->hWindow, SB_VERT, &sInfo, TRUE); - Width += GetSystemMetrics(SM_CXVSCROLL); - ShowScrollBar(GuiData->hWindow, SB_VERT, TRUE); - } - else - { - ShowScrollBar(GuiData->hWindow, SB_VERT, FALSE); - } - - if (Buff->ScreenBufferSize.X > Buff->ViewSize.X) - { - sInfo.nMax = Buff->ScreenBufferSize.X - 1; - sInfo.nPage = Buff->ViewSize.X; - sInfo.nPos = Buff->ViewOrigin.X; - SetScrollInfo(GuiData->hWindow, SB_HORZ, &sInfo, TRUE); - Height += GetSystemMetrics(SM_CYHSCROLL); - ShowScrollBar(GuiData->hWindow, SB_HORZ, TRUE); - } - else - { - ShowScrollBar(GuiData->hWindow, SB_HORZ, FALSE); - } - - /* Resize the window */ - SetWindowPos(GuiData->hWindow, NULL, 0, 0, Width, Height, - SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOCOPYBITS); - // NOTE: The SWP_NOCOPYBITS flag can be replaced by a subsequent call - // to: InvalidateRect(GuiData->hWindow, NULL, TRUE); -} - -static BOOL -GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create) -{ - PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)Create->lpCreateParams; - PCONSOLE Console; - HDC hDC; - HFONT OldFont; - TEXTMETRICW Metrics; - SIZE CharSize; - - DPRINT("GuiConsoleHandleNcCreate\n"); - - if (NULL == GuiData) - { - DPRINT1("GuiConsoleNcCreate: No GUI data\n"); - return FALSE; - } - - Console = GuiData->Console; - - GuiData->hWindow = hWnd; - - GuiData->Font = CreateFontW(LOWORD(GuiData->GuiInfo.FontSize), - 0, // HIWORD(GuiData->GuiInfo.FontSize), - 0, - TA_BASELINE, - GuiData->GuiInfo.FontWeight, - FALSE, - FALSE, - FALSE, - OEM_CHARSET, - OUT_DEFAULT_PRECIS, - CLIP_DEFAULT_PRECIS, - NONANTIALIASED_QUALITY, - FIXED_PITCH | GuiData->GuiInfo.FontFamily /* FF_DONTCARE */, - GuiData->GuiInfo.FaceName); - - if (NULL == GuiData->Font) - { - DPRINT1("GuiConsoleNcCreate: CreateFont failed\n"); - GuiData->hWindow = NULL; - SetEvent(GuiData->hGuiInitEvent); - return FALSE; - } - hDC = GetDC(GuiData->hWindow); - if (NULL == hDC) - { - DPRINT1("GuiConsoleNcCreate: GetDC failed\n"); - DeleteObject(GuiData->Font); - GuiData->hWindow = NULL; - SetEvent(GuiData->hGuiInitEvent); - return FALSE; - } - OldFont = SelectObject(hDC, GuiData->Font); - if (NULL == OldFont) - { - DPRINT1("GuiConsoleNcCreate: SelectObject failed\n"); - ReleaseDC(GuiData->hWindow, hDC); - DeleteObject(GuiData->Font); - GuiData->hWindow = NULL; - SetEvent(GuiData->hGuiInitEvent); - return FALSE; - } - if (!GetTextMetricsW(hDC, &Metrics)) - { - DPRINT1("GuiConsoleNcCreate: GetTextMetrics failed\n"); - SelectObject(hDC, OldFont); - ReleaseDC(GuiData->hWindow, hDC); - DeleteObject(GuiData->Font); - GuiData->hWindow = NULL; - SetEvent(GuiData->hGuiInitEvent); - return FALSE; - } - GuiData->CharWidth = Metrics.tmMaxCharWidth; - GuiData->CharHeight = Metrics.tmHeight + Metrics.tmExternalLeading; - - /* Measure real char width more precisely if possible. */ - if (GetTextExtentPoint32W(hDC, L"R", 1, &CharSize)) - GuiData->CharWidth = CharSize.cx; - - SelectObject(hDC, OldFont); - - ReleaseDC(GuiData->hWindow, hDC); - - /* Initialize the terminal framebuffer */ - GuiData->hMemDC = CreateCompatibleDC(NULL); - GuiData->hBitmap = NULL; - GuiData->hSysPalette = NULL; /* Original system palette */ - - // FIXME: Keep these instructions here ? /////////////////////////////////// - Console->ActiveBuffer->CursorBlinkOn = TRUE; - Console->ActiveBuffer->ForceCursorOff = FALSE; - //////////////////////////////////////////////////////////////////////////// - - SetWindowLongPtrW(GuiData->hWindow, GWLP_USERDATA, (DWORD_PTR)GuiData); - - SetTimer(GuiData->hWindow, CONGUI_UPDATE_TIMER, CONGUI_UPDATE_TIME, NULL); - GuiConsoleCreateSysMenu(GuiData->hWindow); - - DPRINT("GuiConsoleHandleNcCreate - setting start event\n"); - SetEvent(GuiData->hGuiInitEvent); - - return (BOOL)DefWindowProcW(GuiData->hWindow, WM_NCCREATE, 0, (LPARAM)Create); -} - static VOID SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect) { @@ -564,1581 +113,24 @@ SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect) Rect->bottom = (SmallRect->Bottom + 1 - Buffer->ViewOrigin.Y) * HeightUnit; } -static VOID -GuiConsoleUpdateSelection(PCONSOLE Console, PCOORD coord) -{ - PGUI_CONSOLE_DATA GuiData = Console->TermIFace.Data; - RECT oldRect; - - SmallRectToRect(GuiData, &oldRect, &Console->Selection.srSelection); - - if (coord != NULL) - { - RECT newRect; - SMALL_RECT rc; - - /* Exchange left/top with right/bottom if required */ - rc.Left = min(Console->Selection.dwSelectionAnchor.X, coord->X); - rc.Top = min(Console->Selection.dwSelectionAnchor.Y, coord->Y); - rc.Right = max(Console->Selection.dwSelectionAnchor.X, coord->X); - rc.Bottom = max(Console->Selection.dwSelectionAnchor.Y, coord->Y); - - SmallRectToRect(GuiData, &newRect, &rc); - - if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) - { - if (memcmp(&rc, &Console->Selection.srSelection, sizeof(SMALL_RECT)) != 0) - { - HRGN rgn1, rgn2; - - /* Calculate the region that needs to be updated */ - if ((rgn1 = CreateRectRgnIndirect(&oldRect))) - { - if ((rgn2 = CreateRectRgnIndirect(&newRect))) - { - if (CombineRgn(rgn1, rgn2, rgn1, RGN_XOR) != ERROR) - { - InvalidateRgn(GuiData->hWindow, rgn1, FALSE); - } - DeleteObject(rgn2); - } - DeleteObject(rgn1); - } - } - } - else - { - InvalidateRect(GuiData->hWindow, &newRect, FALSE); - } - - Console->Selection.dwFlags |= CONSOLE_SELECTION_NOT_EMPTY; - Console->Selection.srSelection = rc; - Console->dwSelectionCursor = *coord; - - if ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) == 0) - { - LPWSTR SelectionType, WindowTitle = NULL; - SIZE_T Length = 0; - - /* Clear the old selection */ - if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) - { - InvalidateRect(GuiData->hWindow, &oldRect, FALSE); - } - - if (Console->Selection.dwFlags & CONSOLE_MOUSE_SELECTION) - { - SelectionType = L"Selection - "; - } - else - { - SelectionType = L"Mark - "; - } - - Length = Console->Title.Length + wcslen(SelectionType) + 1; - WindowTitle = ConsoleAllocHeap(0, Length * sizeof(WCHAR)); - wcscpy(WindowTitle, SelectionType); - wcscat(WindowTitle, Console->Title.Buffer); - SetWindowText(GuiData->hWindow, WindowTitle); - ConsoleFreeHeap(WindowTitle); - - Console->Selection.dwFlags |= CONSOLE_SELECTION_IN_PROGRESS; - ConioPause(Console, PAUSED_FROM_SELECTION); - } - } - else - { - /* Clear the selection */ - if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) - { - InvalidateRect(GuiData->hWindow, &oldRect, FALSE); - } - - Console->Selection.dwFlags = CONSOLE_NO_SELECTION; - ConioUnpause(Console, PAUSED_FROM_SELECTION); - - SetWindowText(GuiData->hWindow, Console->Title.Buffer); - } -} - - +static VOID NTAPI +GuiDrawRegion(IN OUT PFRONTEND This, + SMALL_RECT* Region); VOID -GuiPaintTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, - PGUI_CONSOLE_DATA GuiData, - PRECT rcView, - PRECT rcFramebuffer); -VOID -GuiPaintGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, - PGUI_CONSOLE_DATA GuiData, - PRECT rcView, - PRECT rcFramebuffer); - -static VOID -GuiConsoleHandlePaint(PGUI_CONSOLE_DATA GuiData) -{ - BOOL Success = TRUE; - PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER ActiveBuffer; - PAINTSTRUCT ps; - RECT rcPaint; - - if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) - { - Success = FALSE; - goto Quit; - } - ActiveBuffer = GuiData->ActiveBuffer; - - BeginPaint(GuiData->hWindow, &ps); - if (ps.hdc != NULL && - ps.rcPaint.left < ps.rcPaint.right && - ps.rcPaint.top < ps.rcPaint.bottom) - { - EnterCriticalSection(&GuiData->Lock); - - /* Compose the current screen-buffer on-memory */ - if (GetType(ActiveBuffer) == TEXTMODE_BUFFER) - { - GuiPaintTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)ActiveBuffer, - GuiData, &ps.rcPaint, &rcPaint); - } - else /* if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) */ - { - GuiPaintGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)ActiveBuffer, - GuiData, &ps.rcPaint, &rcPaint); - } - - /* Send it to screen */ - BitBlt(ps.hdc, - ps.rcPaint.left, - ps.rcPaint.top, - rcPaint.right - rcPaint.left, - rcPaint.bottom - rcPaint.top, - GuiData->hMemDC, - rcPaint.left, - rcPaint.top, - SRCCOPY); - - if (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) - { - SmallRectToRect(GuiData, &rcPaint, &Console->Selection.srSelection); - - /* Invert the selection */ - if (IntersectRect(&rcPaint, &ps.rcPaint, &rcPaint)) - { - InvertRect(ps.hdc, &rcPaint); - } - } - - LeaveCriticalSection(&GuiData->Lock); - } - EndPaint(GuiData->hWindow, &ps); - -Quit: - if (Success) - LeaveCriticalSection(&Console->Lock); - else - DefWindowProcW(GuiData->hWindow, WM_PAINT, 0, 0); - - return; -} - -static BOOL -IsSystemKey(WORD VirtualKeyCode) -{ - switch (VirtualKeyCode) - { - /* From MSDN, "Virtual-Key Codes" */ - case VK_RETURN: - case VK_SHIFT: - case VK_CONTROL: - case VK_MENU: - case VK_PAUSE: - case VK_CAPITAL: - case VK_ESCAPE: - case VK_LWIN: - case VK_RWIN: - case VK_NUMLOCK: - case VK_SCROLL: - return TRUE; - default: - return FALSE; - } -} - -static VOID -GuiConsoleHandleKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) -{ - PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER ActiveBuffer; - - if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; - - ActiveBuffer = GuiData->ActiveBuffer; - - if (Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) - { - WORD VirtualKeyCode = LOWORD(wParam); - - if (msg != WM_KEYDOWN) goto Quit; - - if (VirtualKeyCode == VK_RETURN) - { - /* Copy (and clear) selection if ENTER is pressed */ - GuiConsoleCopy(GuiData); - goto Quit; - } - else if ( VirtualKeyCode == VK_ESCAPE || - (VirtualKeyCode == 'C' && GetKeyState(VK_CONTROL) & 0x8000) ) - { - /* Cancel selection if ESC or Ctrl-C are pressed */ - GuiConsoleUpdateSelection(Console, NULL); - goto Quit; - } - - if ((Console->Selection.dwFlags & CONSOLE_MOUSE_SELECTION) == 0) - { - /* Keyboard selection mode */ - BOOL Interpreted = FALSE; - BOOL MajPressed = (GetKeyState(VK_SHIFT) & 0x8000); - - switch (VirtualKeyCode) - { - case VK_LEFT: - { - Interpreted = TRUE; - if (Console->dwSelectionCursor.X > 0) - Console->dwSelectionCursor.X--; - - break; - } - - case VK_RIGHT: - { - Interpreted = TRUE; - if (Console->dwSelectionCursor.X < ActiveBuffer->ScreenBufferSize.X - 1) - Console->dwSelectionCursor.X++; - - break; - } - - case VK_UP: - { - Interpreted = TRUE; - if (Console->dwSelectionCursor.Y > 0) - Console->dwSelectionCursor.Y--; - - break; - } - - case VK_DOWN: - { - Interpreted = TRUE; - if (Console->dwSelectionCursor.Y < ActiveBuffer->ScreenBufferSize.Y - 1) - Console->dwSelectionCursor.Y++; - - break; - } - - case VK_HOME: - { - Interpreted = TRUE; - Console->dwSelectionCursor.X = 0; - Console->dwSelectionCursor.Y = 0; - break; - } - - case VK_END: - { - Interpreted = TRUE; - Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1; - break; - } - - case VK_PRIOR: - { - Interpreted = TRUE; - Console->dwSelectionCursor.Y -= ActiveBuffer->ViewSize.Y; - if (Console->dwSelectionCursor.Y < 0) - Console->dwSelectionCursor.Y = 0; - - break; - } - - case VK_NEXT: - { - Interpreted = TRUE; - Console->dwSelectionCursor.Y += ActiveBuffer->ViewSize.Y; - if (Console->dwSelectionCursor.Y >= ActiveBuffer->ScreenBufferSize.Y) - Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1; - - break; - } - - default: - break; - } - - if (Interpreted) - { - if (!MajPressed) - Console->Selection.dwSelectionAnchor = Console->dwSelectionCursor; - - GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); - } - else if (!IsSystemKey(VirtualKeyCode)) - { - /* Emit an error beep sound */ - SendNotifyMessage(GuiData->hWindow, PM_CONSOLE_BEEP, 0, 0); - } - - goto Quit; - } - else - { - /* Mouse selection mode */ - - if (!IsSystemKey(VirtualKeyCode)) - { - /* Clear the selection and send the key into the input buffer */ - GuiConsoleUpdateSelection(Console, NULL); - } - else - { - goto Quit; - } - } - } - - if ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) == 0) - { - MSG Message; - - Message.hwnd = GuiData->hWindow; - Message.message = msg; - Message.wParam = wParam; - Message.lParam = lParam; - - ConioProcessKey(Console, &Message); - } - -Quit: - LeaveCriticalSection(&Console->Lock); -} - -static VOID GuiInvalidateCell(IN OUT PFRONTEND This, SHORT x, SHORT y) { SMALL_RECT CellRect = { x, y, x, y }; GuiDrawRegion(This, &CellRect); } -static VOID -GuiConsoleHandleTimer(PGUI_CONSOLE_DATA GuiData) -{ - PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER Buff; - - SetTimer(GuiData->hWindow, CONGUI_UPDATE_TIMER, CURSOR_BLINK_TIME, NULL); - - if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; - - Buff = GuiData->ActiveBuffer; - - if (GetType(Buff) == TEXTMODE_BUFFER) - { - GuiInvalidateCell(&Console->TermIFace, Buff->CursorPosition.X, Buff->CursorPosition.Y); - Buff->CursorBlinkOn = !Buff->CursorBlinkOn; - - if ((GuiData->OldCursor.x != Buff->CursorPosition.X) || - (GuiData->OldCursor.y != Buff->CursorPosition.Y)) - { - SCROLLINFO xScroll; - int OldScrollX = -1, OldScrollY = -1; - int NewScrollX = -1, NewScrollY = -1; - - xScroll.cbSize = sizeof(SCROLLINFO); - xScroll.fMask = SIF_POS; - // Capture the original position of the scroll bars and save them. - if (GetScrollInfo(GuiData->hWindow, SB_HORZ, &xScroll)) OldScrollX = xScroll.nPos; - if (GetScrollInfo(GuiData->hWindow, SB_VERT, &xScroll)) OldScrollY = xScroll.nPos; - - // If we successfully got the info for the horizontal scrollbar - if (OldScrollX >= 0) - { - if ((Buff->CursorPosition.X < Buff->ViewOrigin.X) || - (Buff->CursorPosition.X >= (Buff->ViewOrigin.X + Buff->ViewSize.X))) - { - // Handle the horizontal scroll bar - if (Buff->CursorPosition.X >= Buff->ViewSize.X) - NewScrollX = Buff->CursorPosition.X - Buff->ViewSize.X + 1; - else - NewScrollX = 0; - } - else - { - NewScrollX = OldScrollX; - } - } - // If we successfully got the info for the vertical scrollbar - if (OldScrollY >= 0) - { - if ((Buff->CursorPosition.Y < Buff->ViewOrigin.Y) || - (Buff->CursorPosition.Y >= (Buff->ViewOrigin.Y + Buff->ViewSize.Y))) - { - // Handle the vertical scroll bar - if (Buff->CursorPosition.Y >= Buff->ViewSize.Y) - NewScrollY = Buff->CursorPosition.Y - Buff->ViewSize.Y + 1; - else - NewScrollY = 0; - } - else - { - NewScrollY = OldScrollY; - } - } - - // Adjust scroll bars and refresh the window if the cursor has moved outside the visible area - // NOTE: OldScroll# and NewScroll# will both be -1 (initial value) if the info for the respective scrollbar - // was not obtained successfully in the previous steps. This means their difference is 0 (no scrolling) - // and their associated scrollbar is left alone. - if ((OldScrollX != NewScrollX) || (OldScrollY != NewScrollY)) - { - Buff->ViewOrigin.X = NewScrollX; - Buff->ViewOrigin.Y = NewScrollY; - ScrollWindowEx(GuiData->hWindow, - (OldScrollX - NewScrollX) * GuiData->CharWidth, - (OldScrollY - NewScrollY) * GuiData->CharHeight, - NULL, - NULL, - NULL, - NULL, - SW_INVALIDATE); - if (NewScrollX >= 0) - { - xScroll.nPos = NewScrollX; - SetScrollInfo(GuiData->hWindow, SB_HORZ, &xScroll, TRUE); - } - if (NewScrollY >= 0) - { - xScroll.nPos = NewScrollY; - SetScrollInfo(GuiData->hWindow, SB_VERT, &xScroll, TRUE); - } - UpdateWindow(GuiData->hWindow); - // InvalidateRect(GuiData->hWindow, NULL, FALSE); - GuiData->OldCursor.x = Buff->CursorPosition.X; - GuiData->OldCursor.y = Buff->CursorPosition.Y; - } - } - } - else /* if (GetType(Buff) == GRAPHICS_BUFFER) */ - { - } - - LeaveCriticalSection(&Console->Lock); -} - -static BOOL -GuiConsoleHandleClose(PGUI_CONSOLE_DATA GuiData) -{ - PCONSOLE Console = GuiData->Console; - - if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) - return TRUE; - - // TODO: Prompt for termination ? (Warn the user about possible apps running in this console) - - /* - * FIXME: Windows will wait up to 5 seconds for the thread to exit. - * We shouldn't wait here, though, since the console lock is entered. - * A copy of the thread list probably needs to be made. - */ - ConDrvConsoleProcessCtrlEvent(Console, 0, CTRL_CLOSE_EVENT); - - LeaveCriticalSection(&Console->Lock); - return FALSE; -} - -static LRESULT -GuiConsoleHandleNcDestroy(HWND hWnd) -{ - PGUI_CONSOLE_DATA GuiData = GuiGetGuiData(hWnd); - - KillTimer(hWnd, CONGUI_UPDATE_TIMER); - GetSystemMenu(hWnd, TRUE); - - if (GuiData) - { - /* Free the terminal framebuffer */ - if (GuiData->hMemDC ) DeleteDC(GuiData->hMemDC); - if (GuiData->hBitmap) DeleteObject(GuiData->hBitmap); - // if (GuiData->hSysPalette) DeleteObject(GuiData->hSysPalette); - if (GuiData->Font) DeleteObject(GuiData->Font); - } - - /* Free the GuiData registration */ - SetWindowLongPtrW(hWnd, GWLP_USERDATA, (DWORD_PTR)NULL); - - return DefWindowProcW(hWnd, WM_NCDESTROY, 0, 0); -} - -static COORD -PointToCoord(PGUI_CONSOLE_DATA GuiData, LPARAM lParam) -{ - PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; - COORD Coord; - UINT WidthUnit, HeightUnit; - - GetScreenBufferSizeUnits(Buffer, GuiData, &WidthUnit, &HeightUnit); - - Coord.X = Buffer->ViewOrigin.X + ((SHORT)LOWORD(lParam) / (int)WidthUnit ); - Coord.Y = Buffer->ViewOrigin.Y + ((SHORT)HIWORD(lParam) / (int)HeightUnit); - - /* Clip coordinate to ensure it's inside buffer */ - if (Coord.X < 0) - Coord.X = 0; - else if (Coord.X >= Buffer->ScreenBufferSize.X) - Coord.X = Buffer->ScreenBufferSize.X - 1; - - if (Coord.Y < 0) - Coord.Y = 0; - else if (Coord.Y >= Buffer->ScreenBufferSize.Y) - Coord.Y = Buffer->ScreenBufferSize.Y - 1; - - return Coord; -} - -static LRESULT -GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) -{ - BOOL Err = FALSE; - PCONSOLE Console = GuiData->Console; - - if (GuiData->IgnoreNextMouseSignal) - { - if (msg != WM_LBUTTONDOWN && - msg != WM_MBUTTONDOWN && - msg != WM_RBUTTONDOWN && - msg != WM_MOUSEMOVE) - { - /* - * If this mouse signal is not a button-down action or a move, - * then it is the last signal being ignored. - */ - GuiData->IgnoreNextMouseSignal = FALSE; - } - else - { - /* - * This mouse signal is a button-down action or a move. - * Ignore it and perform default action. - */ - Err = TRUE; - } - goto Quit; - } - - if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) - { - Err = TRUE; - goto Quit; - } - - if ( (Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) || - (Console->QuickEdit) ) - { - switch (msg) - { - case WM_LBUTTONDOWN: - { - /* Clear the old selection */ - // GuiConsoleUpdateSelection(Console, NULL); - Console->Selection.dwFlags = CONSOLE_NO_SELECTION; - - /* Restart a new selection */ - Console->Selection.dwSelectionAnchor = PointToCoord(GuiData, lParam); - SetCapture(GuiData->hWindow); - Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; - GuiConsoleUpdateSelection(Console, &Console->Selection.dwSelectionAnchor); - - break; - } - - case WM_LBUTTONUP: - { - // COORD c; - - if (!(Console->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break; - - // c = PointToCoord(GuiData, lParam); - Console->Selection.dwFlags &= ~CONSOLE_MOUSE_DOWN; - // GuiConsoleUpdateSelection(Console, &c); - ReleaseCapture(); - - break; - } - - case WM_LBUTTONDBLCLK: - { - PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; - - if (GetType(Buffer) == TEXTMODE_BUFFER) - { -#ifdef IS_WHITESPACE -#undef IS_WHITESPACE -#endif -#define IS_WHITESPACE(c) \ - ((c) == L'\0' || (c) == L' ' || (c) == L'\t' || (c) == L'\r' || (c) == L'\n') - - PTEXTMODE_SCREEN_BUFFER TextBuffer = (PTEXTMODE_SCREEN_BUFFER)Buffer; - COORD cL, cR; - PCHAR_INFO ptrL, ptrR; - - /* Starting point */ - cL = cR = PointToCoord(GuiData, lParam); - ptrL = ptrR = ConioCoordToPointer(TextBuffer, cL.X, cL.Y); - - /* Enlarge the selection by checking for whitespace */ - while ((0 < cL.X) && !IS_WHITESPACE(ptrL->Char.UnicodeChar) - && !IS_WHITESPACE((ptrL-1)->Char.UnicodeChar)) - { - --cL.X; - --ptrL; - } - while ((cR.X < TextBuffer->ScreenBufferSize.X - 1) && - !IS_WHITESPACE(ptrR->Char.UnicodeChar) && - !IS_WHITESPACE((ptrR+1)->Char.UnicodeChar)) - { - ++cR.X; - ++ptrR; - } - - /* - * Update the selection started with the single - * left-click that preceded this double-click. - */ - Console->Selection.dwSelectionAnchor = cL; - Console->dwSelectionCursor = cR; - - SetCapture(GuiData->hWindow); - Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; - GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); - - /* Ignore the next mouse move signal */ - GuiData->IgnoreNextMouseSignal = TRUE; - } - - break; - } - - case WM_RBUTTONDOWN: - case WM_RBUTTONDBLCLK: - { - if (!(Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)) - { - GuiConsolePaste(GuiData); - } - else - { - GuiConsoleCopy(GuiData); - } - - /* Ignore the next mouse move signal */ - GuiData->IgnoreNextMouseSignal = TRUE; - break; - } - - case WM_MOUSEMOVE: - { - COORD c; - - if (!(wParam & MK_LBUTTON)) break; - if (!(Console->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break; - - c = PointToCoord(GuiData, lParam); /* TODO: Scroll buffer to bring c into view */ - GuiConsoleUpdateSelection(Console, &c); - - break; - } - - default: - Err = FALSE; // TRUE; - break; - } - } - else if (Console->InputBuffer.Mode & ENABLE_MOUSE_INPUT) - { - INPUT_RECORD er; - WORD wKeyState = GET_KEYSTATE_WPARAM(wParam); - DWORD dwButtonState = 0; - DWORD dwControlKeyState = 0; - DWORD dwEventFlags = 0; - - switch (msg) - { - case WM_LBUTTONDOWN: - SetCapture(GuiData->hWindow); - dwButtonState = FROM_LEFT_1ST_BUTTON_PRESSED; - dwEventFlags = 0; - break; - - case WM_MBUTTONDOWN: - SetCapture(GuiData->hWindow); - dwButtonState = FROM_LEFT_2ND_BUTTON_PRESSED; - dwEventFlags = 0; - break; - - case WM_RBUTTONDOWN: - SetCapture(GuiData->hWindow); - dwButtonState = RIGHTMOST_BUTTON_PRESSED; - dwEventFlags = 0; - break; - - case WM_LBUTTONUP: - ReleaseCapture(); - dwButtonState = 0; - dwEventFlags = 0; - break; - - case WM_MBUTTONUP: - ReleaseCapture(); - dwButtonState = 0; - dwEventFlags = 0; - break; - - case WM_RBUTTONUP: - ReleaseCapture(); - dwButtonState = 0; - dwEventFlags = 0; - break; - - case WM_LBUTTONDBLCLK: - dwButtonState = FROM_LEFT_1ST_BUTTON_PRESSED; - dwEventFlags = DOUBLE_CLICK; - break; - - case WM_MBUTTONDBLCLK: - dwButtonState = FROM_LEFT_2ND_BUTTON_PRESSED; - dwEventFlags = DOUBLE_CLICK; - break; - - case WM_RBUTTONDBLCLK: - dwButtonState = RIGHTMOST_BUTTON_PRESSED; - dwEventFlags = DOUBLE_CLICK; - break; - - case WM_MOUSEMOVE: - dwButtonState = 0; - dwEventFlags = MOUSE_MOVED; - break; - - case WM_MOUSEWHEEL: - dwButtonState = GET_WHEEL_DELTA_WPARAM(wParam) << 16; - dwEventFlags = MOUSE_WHEELED; - break; - - case WM_MOUSEHWHEEL: - dwButtonState = GET_WHEEL_DELTA_WPARAM(wParam) << 16; - dwEventFlags = MOUSE_HWHEELED; - break; - - default: - Err = TRUE; - break; - } - - if (!Err) - { - if (wKeyState & MK_LBUTTON) - dwButtonState |= FROM_LEFT_1ST_BUTTON_PRESSED; - if (wKeyState & MK_MBUTTON) - dwButtonState |= FROM_LEFT_2ND_BUTTON_PRESSED; - if (wKeyState & MK_RBUTTON) - dwButtonState |= RIGHTMOST_BUTTON_PRESSED; - - if (GetKeyState(VK_RMENU) & 0x8000) - dwControlKeyState |= RIGHT_ALT_PRESSED; - if (GetKeyState(VK_LMENU) & 0x8000) - dwControlKeyState |= LEFT_ALT_PRESSED; - if (GetKeyState(VK_RCONTROL) & 0x8000) - dwControlKeyState |= RIGHT_CTRL_PRESSED; - if (GetKeyState(VK_LCONTROL) & 0x8000) - dwControlKeyState |= LEFT_CTRL_PRESSED; - if (GetKeyState(VK_SHIFT) & 0x8000) - dwControlKeyState |= SHIFT_PRESSED; - if (GetKeyState(VK_NUMLOCK) & 0x0001) - dwControlKeyState |= NUMLOCK_ON; - if (GetKeyState(VK_SCROLL) & 0x0001) - dwControlKeyState |= SCROLLLOCK_ON; - if (GetKeyState(VK_CAPITAL) & 0x0001) - dwControlKeyState |= CAPSLOCK_ON; - /* See WM_CHAR MSDN documentation for instance */ - if (lParam & 0x01000000) - dwControlKeyState |= ENHANCED_KEY; - - er.EventType = MOUSE_EVENT; - er.Event.MouseEvent.dwMousePosition = PointToCoord(GuiData, lParam); - er.Event.MouseEvent.dwButtonState = dwButtonState; - er.Event.MouseEvent.dwControlKeyState = dwControlKeyState; - er.Event.MouseEvent.dwEventFlags = dwEventFlags; - - ConioProcessInputEvent(Console, &er); - } - } - else - { - Err = TRUE; - } - - LeaveCriticalSection(&Console->Lock); - -Quit: - if (Err) - return DefWindowProcW(GuiData->hWindow, msg, wParam, lParam); - else - return 0; -} - -VOID -GuiCopyFromTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, - PGUI_CONSOLE_DATA GuiData); -VOID -GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, - PGUI_CONSOLE_DATA GuiData); - -static VOID -GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData) -{ - PCONSOLE Console = GuiData->Console; - - if (OpenClipboard(GuiData->hWindow) == TRUE) - { - PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; - - if (GetType(Buffer) == TEXTMODE_BUFFER) - { - GuiCopyFromTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer, GuiData); - } - else /* if (GetType(Buffer) == GRAPHICS_BUFFER) */ - { - GuiCopyFromGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer, GuiData); - } - - CloseClipboard(); - } - - /* Clear the selection */ - GuiConsoleUpdateSelection(Console, NULL); -} - -VOID -GuiPasteToTextModeBuffer(PTEXTMODE_SCREEN_BUFFER Buffer, - PGUI_CONSOLE_DATA GuiData); -VOID -GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, - PGUI_CONSOLE_DATA GuiData); - -static VOID -GuiConsolePaste(PGUI_CONSOLE_DATA GuiData) -{ - if (OpenClipboard(GuiData->hWindow) == TRUE) - { - PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; - - if (GetType(Buffer) == TEXTMODE_BUFFER) - { - GuiPasteToTextModeBuffer((PTEXTMODE_SCREEN_BUFFER)Buffer, GuiData); - } - else /* if (GetType(Buffer) == GRAPHICS_BUFFER) */ - { - GuiPasteToGraphicsBuffer((PGRAPHICS_SCREEN_BUFFER)Buffer, GuiData); - } - - CloseClipboard(); - } -} - -static VOID -GuiConsoleGetMinMaxInfo(PGUI_CONSOLE_DATA GuiData, PMINMAXINFO minMaxInfo) -{ - PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER ActiveBuffer; - DWORD windx, windy; - UINT WidthUnit, HeightUnit; - - if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; - - ActiveBuffer = GuiData->ActiveBuffer; - - GetScreenBufferSizeUnits(ActiveBuffer, GuiData, &WidthUnit, &HeightUnit); - - windx = CONGUI_MIN_WIDTH * WidthUnit + 2 * (GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXEDGE)); - windy = CONGUI_MIN_HEIGHT * HeightUnit + 2 * (GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE)) + GetSystemMetrics(SM_CYCAPTION); - - minMaxInfo->ptMinTrackSize.x = windx; - minMaxInfo->ptMinTrackSize.y = windy; - - windx = (ActiveBuffer->ScreenBufferSize.X) * WidthUnit + 2 * (GetSystemMetrics(SM_CXFRAME) + GetSystemMetrics(SM_CXEDGE)); - windy = (ActiveBuffer->ScreenBufferSize.Y) * HeightUnit + 2 * (GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYEDGE)) + GetSystemMetrics(SM_CYCAPTION); - - if (ActiveBuffer->ViewSize.X < ActiveBuffer->ScreenBufferSize.X) windy += GetSystemMetrics(SM_CYHSCROLL); // window currently has a horizontal scrollbar - if (ActiveBuffer->ViewSize.Y < ActiveBuffer->ScreenBufferSize.Y) windx += GetSystemMetrics(SM_CXVSCROLL); // window currently has a vertical scrollbar - - minMaxInfo->ptMaxTrackSize.x = windx; - minMaxInfo->ptMaxTrackSize.y = windy; - - LeaveCriticalSection(&Console->Lock); -} - -static VOID -GuiConsoleResize(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) -{ - PCONSOLE Console = GuiData->Console; - - if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; - - if ((GuiData->WindowSizeLock == FALSE) && - (wParam == SIZE_RESTORED || wParam == SIZE_MAXIMIZED || wParam == SIZE_MINIMIZED)) - { - PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; - DWORD windx, windy, charx, chary; - UINT WidthUnit, HeightUnit; - - GetScreenBufferSizeUnits(Buff, GuiData, &WidthUnit, &HeightUnit); - - GuiData->WindowSizeLock = TRUE; - - windx = LOWORD(lParam); - windy = HIWORD(lParam); - - // Compensate for existing scroll bars (because lParam values do not accommodate scroll bar) - if (Buff->ViewSize.X < Buff->ScreenBufferSize.X) windy += GetSystemMetrics(SM_CYHSCROLL); // window currently has a horizontal scrollbar - if (Buff->ViewSize.Y < Buff->ScreenBufferSize.Y) windx += GetSystemMetrics(SM_CXVSCROLL); // window currently has a vertical scrollbar - - charx = windx / (int)WidthUnit ; - chary = windy / (int)HeightUnit; - - // Character alignment (round size up or down) - if ((windx % WidthUnit ) >= (WidthUnit / 2)) ++charx; - if ((windy % HeightUnit) >= (HeightUnit / 2)) ++chary; - - // Compensate for added scroll bars in new window - if (charx < Buff->ScreenBufferSize.X) windy -= GetSystemMetrics(SM_CYHSCROLL); // new window will have a horizontal scroll bar - if (chary < Buff->ScreenBufferSize.Y) windx -= GetSystemMetrics(SM_CXVSCROLL); // new window will have a vertical scroll bar - - charx = windx / (int)WidthUnit ; - chary = windy / (int)HeightUnit; - - // Character alignment (round size up or down) - if ((windx % WidthUnit ) >= (WidthUnit / 2)) ++charx; - if ((windy % HeightUnit) >= (HeightUnit / 2)) ++chary; - - // Resize window - if ((charx != Buff->ViewSize.X) || (chary != Buff->ViewSize.Y)) - { - Buff->ViewSize.X = (charx <= Buff->ScreenBufferSize.X) ? charx : Buff->ScreenBufferSize.X; - Buff->ViewSize.Y = (chary <= Buff->ScreenBufferSize.Y) ? chary : Buff->ScreenBufferSize.Y; - } - - GuiConsoleResizeWindow(GuiData, WidthUnit, HeightUnit); - - // Adjust the start of the visible area if we are attempting to show nonexistent areas - if ((Buff->ScreenBufferSize.X - Buff->ViewOrigin.X) < Buff->ViewSize.X) Buff->ViewOrigin.X = Buff->ScreenBufferSize.X - Buff->ViewSize.X; - if ((Buff->ScreenBufferSize.Y - Buff->ViewOrigin.Y) < Buff->ViewSize.Y) Buff->ViewOrigin.Y = Buff->ScreenBufferSize.Y - Buff->ViewSize.Y; - InvalidateRect(GuiData->hWindow, NULL, TRUE); - - GuiData->WindowSizeLock = FALSE; - } - - LeaveCriticalSection(&Console->Lock); -} - -/* -// HACK: This functionality is standard for general scrollbars. Don't add it by hand. - -VOID -FASTCALL -GuiConsoleHandleScrollbarMenu(VOID) -{ - HMENU hMenu; - - hMenu = CreatePopupMenu(); - if (hMenu == NULL) - { - DPRINT("CreatePopupMenu failed\n"); - return; - } - - //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLHERE); - //InsertItem(hMenu, MFT_SEPARATOR, MIIM_FTYPE, 0, NULL, -1); - //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLTOP); - //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLBOTTOM); - //InsertItem(hMenu, MFT_SEPARATOR, MIIM_FTYPE, 0, NULL, -1); - //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLPAGE_UP); - //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLPAGE_DOWN); - //InsertItem(hMenu, MFT_SEPARATOR, MIIM_FTYPE, 0, NULL, -1); - //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLUP); - //InsertItem(hMenu, MIIM_STRING, MIIM_ID | MIIM_FTYPE | MIIM_STRING, 0, NULL, IDS_SCROLLDOWN); -} -*/ - -static LRESULT -GuiConsoleHandleScroll(PGUI_CONSOLE_DATA GuiData, UINT uMsg, WPARAM wParam) -{ - PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER Buff; - SCROLLINFO sInfo; - int fnBar; - int old_pos, Maximum; - PSHORT pShowXY; - - if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return 0; - - Buff = GuiData->ActiveBuffer; - - if (uMsg == WM_HSCROLL) - { - fnBar = SB_HORZ; - Maximum = Buff->ScreenBufferSize.X - Buff->ViewSize.X; - pShowXY = &Buff->ViewOrigin.X; - } - else - { - fnBar = SB_VERT; - Maximum = Buff->ScreenBufferSize.Y - Buff->ViewSize.Y; - pShowXY = &Buff->ViewOrigin.Y; - } - - /* set scrollbar sizes */ - sInfo.cbSize = sizeof(SCROLLINFO); - sInfo.fMask = SIF_RANGE | SIF_POS | SIF_PAGE | SIF_TRACKPOS; - - if (!GetScrollInfo(GuiData->hWindow, fnBar, &sInfo)) goto Quit; - - old_pos = sInfo.nPos; - - switch (LOWORD(wParam)) - { - case SB_LINELEFT: - sInfo.nPos -= 1; - break; - - case SB_LINERIGHT: - sInfo.nPos += 1; - break; - - case SB_PAGELEFT: - sInfo.nPos -= sInfo.nPage; - break; - - case SB_PAGERIGHT: - sInfo.nPos += sInfo.nPage; - break; - - case SB_THUMBTRACK: - sInfo.nPos = sInfo.nTrackPos; - ConioPause(Console, PAUSED_FROM_SCROLLBAR); - break; - - case SB_THUMBPOSITION: - ConioUnpause(Console, PAUSED_FROM_SCROLLBAR); - break; - - case SB_TOP: - sInfo.nPos = sInfo.nMin; - break; - - case SB_BOTTOM: - sInfo.nPos = sInfo.nMax; - break; - - default: - break; - } - - sInfo.nPos = max(sInfo.nPos, 0); - sInfo.nPos = min(sInfo.nPos, Maximum); - - if (old_pos != sInfo.nPos) - { - USHORT OldX = Buff->ViewOrigin.X; - USHORT OldY = Buff->ViewOrigin.Y; - UINT WidthUnit, HeightUnit; - - *pShowXY = sInfo.nPos; - - GetScreenBufferSizeUnits(Buff, GuiData, &WidthUnit, &HeightUnit); - - ScrollWindowEx(GuiData->hWindow, - (OldX - Buff->ViewOrigin.X) * WidthUnit , - (OldY - Buff->ViewOrigin.Y) * HeightUnit, - NULL, - NULL, - NULL, - NULL, - SW_INVALIDATE); - - sInfo.fMask = SIF_POS; - SetScrollInfo(GuiData->hWindow, fnBar, &sInfo, TRUE); - - UpdateWindow(GuiData->hWindow); - // InvalidateRect(GuiData->hWindow, NULL, FALSE); - } - -Quit: - LeaveCriticalSection(&Console->Lock); - return 0; -} - - -BOOL -EnterFullScreen(PGUI_CONSOLE_DATA GuiData); -VOID -LeaveFullScreen(PGUI_CONSOLE_DATA GuiData); -VOID -SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); -VOID -GuiConsoleSwitchFullScreen(PGUI_CONSOLE_DATA GuiData); - -static LRESULT CALLBACK -GuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - LRESULT Result = 0; - PGUI_CONSOLE_DATA GuiData = NULL; - PCONSOLE Console = NULL; - - /* - * - If it's the first time we create a window for the terminal, - * just initialize it and return. - * - * - If we are destroying the window, just do it and return. - */ - if (msg == WM_NCCREATE) - { - return (LRESULT)GuiConsoleHandleNcCreate(hWnd, (LPCREATESTRUCTW)lParam); - } - else if (msg == WM_NCDESTROY) - { - return GuiConsoleHandleNcDestroy(hWnd); - } - - /* - * Now the terminal window is initialized. - * Get the terminal data via the window's data. - * If there is no data, just go away. - */ - GuiData = GuiGetGuiData(hWnd); - if (GuiData == NULL) return DefWindowProcW(hWnd, msg, wParam, lParam); - - // TEMPORARY HACK until all of the functions can deal with a NULL GuiData->ActiveBuffer ... - if (GuiData->ActiveBuffer == NULL) return DefWindowProcW(hWnd, msg, wParam, lParam); - - /* - * Just retrieve a pointer to the console in case somebody needs it. - * It is not NULL because it was checked in GuiGetGuiData. - * Each helper function which needs the console has to validate and lock it. - */ - Console = GuiData->Console; - - /* We have a console, start message dispatching */ - switch (msg) - { - case WM_ACTIVATE: - { - WORD ActivationState = LOWORD(wParam); - - DPRINT1("WM_ACTIVATE - ActivationState = %d\n"); - - if ( ActivationState == WA_ACTIVE || - ActivationState == WA_CLICKACTIVE ) - { - if (GuiData->GuiInfo.FullScreen) - { - EnterFullScreen(GuiData); - // // PostMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_RESTORE, 0); - // SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_RESTORE, 0); - } - } - else // if (ActivationState == WA_INACTIVE) - { - if (GuiData->GuiInfo.FullScreen) - { - SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); - LeaveFullScreen(GuiData); - // // PostMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); - // SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); - } - } - - /* - * When we are in QuickEdit mode, ignore the next mouse signal - * when we are going to be enabled again via the mouse, in order - * to prevent e.g. an erroneous right-click from the user which - * would have as an effect to paste some unwanted text... - */ - if (Console->QuickEdit && (ActivationState == WA_CLICKACTIVE)) - GuiData->IgnoreNextMouseSignal = TRUE; - - break; - } - - case WM_CLOSE: - if (GuiConsoleHandleClose(GuiData)) goto Default; - break; - - case WM_PAINT: - GuiConsoleHandlePaint(GuiData); - break; - - case WM_TIMER: - GuiConsoleHandleTimer(GuiData); - break; - - case WM_PALETTECHANGED: - { - PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; - - DPRINT("WM_PALETTECHANGED called\n"); - - /* - * Protects against infinite loops: - * "... A window that receives this message must not realize - * its palette, unless it determines that wParam does not contain - * its own window handle." (WM_PALETTECHANGED description - MSDN) - * - * This message is sent to all windows, including the one that - * changed the system palette and caused this message to be sent. - * The wParam of this message contains the handle of the window - * that caused the system palette to change. To avoid an infinite - * loop, care must be taken to check that the wParam of this message - * does not match the window's handle. - */ - if ((HWND)wParam == hWnd) break; - - DPRINT("WM_PALETTECHANGED ok\n"); - - // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) - if (ActiveBuffer->PaletteHandle) - { - DPRINT("WM_PALETTECHANGED changing palette\n"); - - /* Specify the use of the system palette for the framebuffer */ - SetSystemPaletteUse(GuiData->hMemDC, ActiveBuffer->PaletteUsage); - - /* Realize the (logical) palette */ - RealizePalette(GuiData->hMemDC); - } - - DPRINT("WM_PALETTECHANGED quit\n"); - - break; - } - - case WM_KEYDOWN: - case WM_KEYUP: - case WM_CHAR: - case WM_DEADCHAR: - case WM_SYSKEYDOWN: - case WM_SYSKEYUP: - case WM_SYSCHAR: - case WM_SYSDEADCHAR: - { - /* Detect Alt-Enter presses and switch back and forth to fullscreen mode */ - if (msg == WM_SYSKEYDOWN && (HIWORD(lParam) & KF_ALTDOWN) && wParam == VK_RETURN) - { - /* Switch only at first Alt-Enter press, and ignore subsequent key repetitions */ - if ((HIWORD(lParam) & (KF_UP | KF_REPEAT)) != KF_REPEAT) - GuiConsoleSwitchFullScreen(GuiData); - - break; - } - - GuiConsoleHandleKey(GuiData, msg, wParam, lParam); - break; - } - - case WM_SETCURSOR: - { - /* - * The message was sent because we are manually triggering a change. - * Check whether the mouse is indeed present on this console window - * and take appropriate decisions. - */ - if (wParam == -1 && lParam == -1) - { - POINT mouseCoords; - HWND hWndHit; - - /* Get the placement of the mouse */ - GetCursorPos(&mouseCoords); - - /* On which window is placed the mouse ? */ - hWndHit = WindowFromPoint(mouseCoords); - - /* It's our window. Perform the hit-test to be used later on. */ - if (hWndHit == hWnd) - { - wParam = (WPARAM)hWnd; - lParam = DefWindowProcW(hWndHit, WM_NCHITTEST, 0, - MAKELPARAM(mouseCoords.x, mouseCoords.y)); - } - } - - /* Set the mouse cursor only when we are in the client area */ - if ((HWND)wParam == hWnd && LOWORD(lParam) == HTCLIENT) - { - if (GuiData->MouseCursorRefCount >= 0) - { - /* Show the cursor */ - SetCursor(GuiData->hCursor); - } - else - { - /* Hide the cursor if the reference count is negative */ - SetCursor(NULL); - } - return TRUE; - } - else - { - goto Default; - } - } - - case WM_LBUTTONDOWN: - case WM_MBUTTONDOWN: - case WM_RBUTTONDOWN: - case WM_LBUTTONUP: - case WM_MBUTTONUP: - case WM_RBUTTONUP: - case WM_LBUTTONDBLCLK: - case WM_MBUTTONDBLCLK: - case WM_RBUTTONDBLCLK: - case WM_MOUSEMOVE: - case WM_MOUSEWHEEL: - case WM_MOUSEHWHEEL: - { - Result = GuiConsoleHandleMouse(GuiData, msg, wParam, lParam); - break; - } - - case WM_HSCROLL: - case WM_VSCROLL: - { - Result = GuiConsoleHandleScroll(GuiData, msg, wParam); - break; - } - - case WM_NCRBUTTONDOWN: - { - DPRINT1("WM_NCRBUTTONDOWN\n"); - /* - * HACK: !! Because, when we deal with WM_RBUTTON* and we do not - * call after that DefWindowProc, on ReactOS, right-clicks on the - * (non-client) application title-bar does not display the system - * menu and does not trigger a WM_NCRBUTTONUP message too. - * See: http://git.reactos.org/?p=reactos.git;a=blob;f=reactos/win32ss/user/user32/windows/defwnd.c;hb=332bc8f482f40fd05ab510f78276576719fbfba8#l1103 - * and line 1135 too. - */ -#if 0 - if (DefWindowProcW(hWnd, WM_NCHITTEST, 0, lParam) == HTCAPTION) - { - /* Call DefWindowProcW with the WM_CONTEXTMENU message */ - msg = WM_CONTEXTMENU; - } -#endif - goto Default; - } - // case WM_NCRBUTTONUP: - // DPRINT1("WM_NCRBUTTONUP\n"); - // goto Default; - - case WM_CONTEXTMENU: - { - if (DefWindowProcW(hWnd /*GuiData->hWindow*/, WM_NCHITTEST, 0, lParam) == HTCLIENT) - { - HMENU hMenu = CreatePopupMenu(); - if (hMenu != NULL) - { - GuiConsoleAppendMenuItems(hMenu, GuiConsoleEditMenuItems); - TrackPopupMenuEx(hMenu, - TPM_RIGHTBUTTON, - GET_X_LPARAM(lParam), - GET_Y_LPARAM(lParam), - hWnd, - NULL); - DestroyMenu(hMenu); - } - break; - } - else - { - goto Default; - } - } - - case WM_INITMENU: - { - HMENU hMenu = (HMENU)wParam; - if (hMenu != NULL) - { - /* Enable or disable the Close menu item */ - EnableMenuItem(hMenu, SC_CLOSE, MF_BYCOMMAND | - (GuiData->IsCloseButtonEnabled ? MF_ENABLED : MF_GRAYED)); - - /* Enable or disable the Copy and Paste items */ - EnableMenuItem(hMenu, ID_SYSTEM_EDIT_COPY , MF_BYCOMMAND | - ((Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) && - (Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY) ? MF_ENABLED : MF_GRAYED)); - // FIXME: Following whether the active screen buffer is text-mode - // or graphics-mode, search for CF_UNICODETEXT or CF_BITMAP formats. - EnableMenuItem(hMenu, ID_SYSTEM_EDIT_PASTE, MF_BYCOMMAND | - (!(Console->Selection.dwFlags & CONSOLE_SELECTION_IN_PROGRESS) && - IsClipboardFormatAvailable(CF_UNICODETEXT) ? MF_ENABLED : MF_GRAYED)); - } - - if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) - { - GuiSendMenuEvent(Console, WM_INITMENU); - LeaveCriticalSection(&Console->Lock); - } - break; - } - - case WM_MENUSELECT: - { - if (HIWORD(wParam) == 0xFFFF) // Allow all the menu flags - { - if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) - { - GuiSendMenuEvent(Console, WM_MENUSELECT); - LeaveCriticalSection(&Console->Lock); - } - } - break; - } - - case WM_COMMAND: - case WM_SYSCOMMAND: - { - Result = GuiConsoleHandleSysMenuCommand(GuiData, wParam, lParam); - break; - } - - case WM_SETFOCUS: - case WM_KILLFOCUS: - { - if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) - { - BOOL SetFocus = (msg == WM_SETFOCUS); - INPUT_RECORD er; - - er.EventType = FOCUS_EVENT; - er.Event.FocusEvent.bSetFocus = SetFocus; - ConioProcessInputEvent(Console, &er); - - if (SetFocus) - DPRINT1("TODO: Create console caret\n"); - else - DPRINT1("TODO: Destroy console caret\n"); - - LeaveCriticalSection(&Console->Lock); - } - break; - } - - case WM_GETMINMAXINFO: - GuiConsoleGetMinMaxInfo(GuiData, (PMINMAXINFO)lParam); - break; - - case WM_MOVE: - { - if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) - { - // TODO: Simplify the code. - // See: GuiConsoleNotifyWndProc() PM_CREATE_CONSOLE. - - RECT rcWnd; - - /* Retrieve our real position */ - GetWindowRect(GuiData->hWindow, &rcWnd); - GuiData->GuiInfo.WindowOrigin.x = rcWnd.left; - GuiData->GuiInfo.WindowOrigin.y = rcWnd.top; - - LeaveCriticalSection(&Console->Lock); - } - break; - } - - case WM_SIZE: - GuiConsoleResize(GuiData, wParam, lParam); - break; - - case PM_RESIZE_TERMINAL: - { - PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; - HDC hDC; - HBITMAP hnew, hold; - - DWORD Width, Height; - UINT WidthUnit, HeightUnit; - - GetScreenBufferSizeUnits(Buff, GuiData, &WidthUnit, &HeightUnit); - - Width = Buff->ScreenBufferSize.X * WidthUnit ; - Height = Buff->ScreenBufferSize.Y * HeightUnit; - - /* Recreate the framebuffer */ - hDC = GetDC(GuiData->hWindow); - hnew = CreateCompatibleBitmap(hDC, Width, Height); - ReleaseDC(GuiData->hWindow, hDC); - hold = SelectObject(GuiData->hMemDC, hnew); - if (GuiData->hBitmap) - { - if (hold == GuiData->hBitmap) DeleteObject(GuiData->hBitmap); - } - GuiData->hBitmap = hnew; - - /* Resize the window to the user's values */ - GuiData->WindowSizeLock = TRUE; - GuiConsoleResizeWindow(GuiData, WidthUnit, HeightUnit); - GuiData->WindowSizeLock = FALSE; - break; - } - - case PM_APPLY_CONSOLE_INFO: - { - if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) - { - GuiApplyUserSettings(GuiData, (HANDLE)wParam, (BOOL)lParam); - LeaveCriticalSection(&Console->Lock); - } - break; - } - - case PM_CONSOLE_BEEP: - DPRINT1("Beep !!\n"); - Beep(800, 200); - break; - - // case PM_CONSOLE_SET_TITLE: - // SetWindowText(GuiData->hWindow, GuiData->Console->Title.Buffer); - // break; - - default: Default: - Result = DefWindowProcW(hWnd, msg, wParam, lParam); - break; - } - - return Result; -} - - /****************************************************************************** * GUI Terminal Initialization * ******************************************************************************/ +VOID +SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); + static LRESULT CALLBACK GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -2308,7 +300,6 @@ static BOOL GuiInit(VOID) { WNDCLASSEXW wc; - ATOM ConsoleClassAtom; /* Exit if we were already initialized */ // if (ConsInitialized) return TRUE; @@ -2338,42 +329,8 @@ GuiInit(VOID) } /* Initialize the console window class */ - ghDefaultIcon = LoadImageW(ConSrvDllInstance, - MAKEINTRESOURCEW(IDI_TERMINAL), - IMAGE_ICON, - GetSystemMetrics(SM_CXICON), - GetSystemMetrics(SM_CYICON), - LR_SHARED); - ghDefaultIconSm = LoadImageW(ConSrvDllInstance, - MAKEINTRESOURCEW(IDI_TERMINAL), - IMAGE_ICON, - GetSystemMetrics(SM_CXSMICON), - GetSystemMetrics(SM_CYSMICON), - LR_SHARED); - ghDefaultCursor = LoadCursorW(NULL, IDC_ARROW); - wc.cbSize = sizeof(WNDCLASSEXW); - wc.lpszClassName = GUI_CONWND_CLASS; - wc.lpfnWndProc = GuiConsoleWndProc; - wc.style = CS_DBLCLKS /* | CS_HREDRAW | CS_VREDRAW */; - wc.hInstance = ConSrvDllInstance; - wc.hIcon = ghDefaultIcon; - wc.hIconSm = ghDefaultIconSm; - wc.hCursor = ghDefaultCursor; - wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); // The color of a terminal when it is switch off. - wc.lpszMenuName = NULL; - wc.cbClsExtra = 0; - wc.cbWndExtra = GWLP_CONSOLEWND_ALLOC; - - ConsoleClassAtom = RegisterClassExW(&wc); - if (ConsoleClassAtom == 0) - { - DPRINT1("Failed to register GUI console wndproc\n"); + if (!RegisterConWndClass(ConSrvDllInstance)) return FALSE; - } - else - { - NtUserConsoleControl(GuiConsoleWndClassAtom, &ConsoleClassAtom, sizeof(ATOM)); - } ConsInitialized = TRUE; } @@ -2701,6 +658,7 @@ GuiWriteStream(IN OUT PFRONTEND This, GuiInvalidateCell(This, CursorEndX, CursorEndY); } + // HACK!! // Set up the update timer (very short interval) - this is a "hack" for getting the OS to // repaint the window without having it just freeze up and stay on the screen permanently. Buff->CursorBlinkOn = TRUE; @@ -2864,7 +822,7 @@ GuiRefreshInternalInfo(IN OUT PFRONTEND This) PGUI_CONSOLE_DATA GuiData = This->Data; /* Update the console leader information held by the window */ - SetConsoleWndConsoleLeaderCID(GuiData); + SetConWndConsoleLeaderCID(GuiData); /* * HACK: diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h index 556d3991824..67d7871728d 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.h @@ -11,12 +11,8 @@ #pragma once -#define CONGUI_MIN_WIDTH 10 -#define CONGUI_MIN_HEIGHT 10 -#define CONGUI_UPDATE_TIME 0 -#define CONGUI_UPDATE_TIMER 1 - -#define CURSOR_BLINK_TIME 500 +#include "guisettings.h" +#include "conwnd.h" NTSTATUS FASTCALL GuiInitConsole(PCONSOLE Console, /*IN*/ PCONSOLE_START_INFO ConsoleStartInfo, diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c index e14dfdea4f2..4ac21b0325a 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/text.c @@ -16,6 +16,8 @@ #define NDEBUG #include +#include "guiterm.h" + /* FUNCTIONS ******************************************************************/ COLORREF RGBFromAttrib2(PCONSOLE Console, WORD Attribute) From 304ce1db7a1459a9f90eb85f287cc487b07d916c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 13 Apr 2014 15:38:05 +0000 Subject: [PATCH 319/419] [CONSRV]: Do not capture the mouse in the double-click case. svn path=/trunk/; revision=62741 --- reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c index 49fb50b2ce4..e83c024df97 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c @@ -1240,7 +1240,6 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM Console->Selection.dwSelectionAnchor = cL; Console->dwSelectionCursor = cR; - SetCapture(GuiData->hWindow); Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); From 4d1dfdbc1bd026f82ce2e4380fc90ac2ec72f37f Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 13 Apr 2014 16:16:30 +0000 Subject: [PATCH 320/419] [KMTESTS:NPFS] Add more tests for file info Tested by Thomas. CORE-7451 svn path=/trunk/; revision=62742 --- rostests/kmtests/CMakeLists.txt | 1 + rostests/kmtests/kmtest_drv/testlist.c | 2 + rostests/kmtests/npfs/NpfsFileInfo.c | 153 +++++++++++++++++++++++++ 3 files changed, 156 insertions(+) create mode 100644 rostests/kmtests/npfs/NpfsFileInfo.c diff --git a/rostests/kmtests/CMakeLists.txt b/rostests/kmtests/CMakeLists.txt index 6a6209cdca6..f6fd239ded7 100644 --- a/rostests/kmtests/CMakeLists.txt +++ b/rostests/kmtests/CMakeLists.txt @@ -30,6 +30,7 @@ list(APPEND KMTEST_DRV_SOURCE example/KernelType.c npfs/NpfsConnect.c npfs/NpfsCreate.c + npfs/NpfsFileInfo.c npfs/NpfsHelpers.c npfs/NpfsReadWrite.c npfs/NpfsVolumeInfo.c diff --git a/rostests/kmtests/kmtest_drv/testlist.c b/rostests/kmtests/kmtest_drv/testlist.c index 9b35bd18d13..b6e0390fa9f 100644 --- a/rostests/kmtests/kmtest_drv/testlist.c +++ b/rostests/kmtests/kmtest_drv/testlist.c @@ -40,6 +40,7 @@ KMT_TESTFUNC Test_KernelType; KMT_TESTFUNC Test_MmSection; KMT_TESTFUNC Test_NpfsConnect; KMT_TESTFUNC Test_NpfsCreate; +KMT_TESTFUNC Test_NpfsFileInfo; KMT_TESTFUNC Test_NpfsReadWrite; KMT_TESTFUNC Test_NpfsVolumeInfo; KMT_TESTFUNC Test_ObReference; @@ -95,6 +96,7 @@ const KMT_TEST TestList[] = { "MmSection", Test_MmSection }, { "NpfsConnect", Test_NpfsConnect }, { "NpfsCreate", Test_NpfsCreate }, + { "NpfsFileInfo", Test_NpfsFileInfo }, { "NpfsReadWrite", Test_NpfsReadWrite }, { "NpfsVolumeInfo", Test_NpfsVolumeInfo }, { "ObReference", Test_ObReference }, diff --git a/rostests/kmtests/npfs/NpfsFileInfo.c b/rostests/kmtests/npfs/NpfsFileInfo.c new file mode 100644 index 00000000000..d49031b7576 --- /dev/null +++ b/rostests/kmtests/npfs/NpfsFileInfo.c @@ -0,0 +1,153 @@ +/* + * PROJECT: ReactOS kernel-mode tests + * LICENSE: LGPLv2+ - See COPYING.LIB in the top level directory + * PURPOSE: Kernel-Mode Test Suite NPFS file information test + * PROGRAMMER: Pierre Schweitzer + */ + +#include +#include "npfs.h" + +#define MAX_INSTANCES 1 +#define IN_QUOTA 4096 +#define OUT_QUOTA 4096 +#define PIPE_NAME L"\\KmtestNpfsFileInfoTestPipe" + +static +VOID +TestFileInfo( + IN HANDLE ServerHandle) +{ + NTSTATUS Status; + IO_STATUS_BLOCK IoStatusBlock; + + struct { + FILE_ALL_INFORMATION; + WCHAR PartialName[50]; + } FileAllInfo; + + RtlFillMemory(&FileAllInfo, sizeof(FileAllInfo), 0xFF); + Status = ZwQueryInformationFile(ServerHandle, + &IoStatusBlock, + &FileAllInfo, + sizeof(FileAllInfo), + FileAllInformation); + ok_eq_hex(Status, STATUS_SUCCESS); + ok_eq_hex(IoStatusBlock.Status, STATUS_SUCCESS); + ok_eq_longlong(FileAllInfo.BasicInformation.CreationTime.QuadPart, 0); + ok_eq_longlong(FileAllInfo.BasicInformation.LastAccessTime.QuadPart, 0); + ok_eq_longlong(FileAllInfo.BasicInformation.LastWriteTime.QuadPart, 0); + ok_eq_longlong(FileAllInfo.BasicInformation.ChangeTime.QuadPart, 0); + ok_eq_ulong(FileAllInfo.BasicInformation.FileAttributes, FILE_ATTRIBUTE_NORMAL); + ok_eq_longlong(FileAllInfo.StandardInformation.AllocationSize.QuadPart, 8192); + ok_eq_longlong(FileAllInfo.StandardInformation.EndOfFile.QuadPart, 0); + ok_eq_ulong(FileAllInfo.StandardInformation.NumberOfLinks, 1); + ok_bool_true(FileAllInfo.StandardInformation.DeletePending, "DeletePending"); + ok_bool_false(FileAllInfo.StandardInformation.Directory, "Directory"); + ok(FileAllInfo.InternalInformation.IndexNumber.QuadPart != 0xFFFFFFFFFFFFFFFF, "FileAllInfo.InternalInformation.IndexNumber = 0xFFFFFFFFFFFFFFFF, whereas it shouldn't\n"); + ok(FileAllInfo.InternalInformation.IndexNumber.QuadPart != 0, "FileAllInfo.InternalInformation.IndexNumber = 0, whereas it shouldn't\n"); + ok_eq_ulong(FileAllInfo.EaInformation.EaSize, 0); + ok_eq_ulong(FileAllInfo.AccessInformation.AccessFlags, (FILE_GENERIC_READ | FILE_GENERIC_WRITE)); + ok_eq_longlong(FileAllInfo.PositionInformation.CurrentByteOffset.QuadPart, 0); + ok_eq_ulong(FileAllInfo.ModeInformation.Mode, FILE_SYNCHRONOUS_IO_NONALERT); + ok_eq_ulong(FileAllInfo.AlignmentInformation.AlignmentRequirement, 0); + ok_eq_ulong(FileAllInfo.NameInformation.FileNameLength, sizeof(PIPE_NAME) - sizeof(WCHAR)); + ok_eq_size(RtlCompareMemory(FileAllInfo.NameInformation.FileName, PIPE_NAME, sizeof(PIPE_NAME) - sizeof(WCHAR)), (sizeof(PIPE_NAME) - sizeof(WCHAR))); + ok_eq_wchar(FileAllInfo.NameInformation.FileName[sizeof(PIPE_NAME) / sizeof(WCHAR) - 1], 0xFFFF); + ok_eq_ulong(IoStatusBlock.Information, (FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + sizeof(PIPE_NAME) - sizeof(WCHAR))); + + RtlFillMemory(&FileAllInfo, sizeof(FileAllInfo), 0xFF); + Status = ZwQueryInformationFile(ServerHandle, + &IoStatusBlock, + &FileAllInfo, + sizeof(FILE_ALL_INFORMATION) + 4 * sizeof(WCHAR), + FileAllInformation); + ok_eq_hex(Status, STATUS_BUFFER_OVERFLOW); + ok_eq_hex(IoStatusBlock.Status, STATUS_BUFFER_OVERFLOW); + ok_eq_longlong(FileAllInfo.BasicInformation.CreationTime.QuadPart, 0); + ok_eq_longlong(FileAllInfo.BasicInformation.LastAccessTime.QuadPart, 0); + ok_eq_longlong(FileAllInfo.BasicInformation.LastWriteTime.QuadPart, 0); + ok_eq_longlong(FileAllInfo.BasicInformation.ChangeTime.QuadPart, 0); + ok_eq_ulong(FileAllInfo.BasicInformation.FileAttributes, FILE_ATTRIBUTE_NORMAL); + ok_eq_longlong(FileAllInfo.StandardInformation.AllocationSize.QuadPart, 8192); + ok_eq_longlong(FileAllInfo.StandardInformation.EndOfFile.QuadPart, 0); + ok_eq_ulong(FileAllInfo.StandardInformation.NumberOfLinks, 1); + ok_bool_true(FileAllInfo.StandardInformation.DeletePending, "DeletePending"); + ok_bool_false(FileAllInfo.StandardInformation.Directory, "Directory"); + ok(FileAllInfo.InternalInformation.IndexNumber.QuadPart != 0xFFFFFFFFFFFFFFFF, "FileAllInfo.InternalInformation.IndexNumber = 0xFFFFFFFFFFFFFFFF, whereas it shouldn't\n"); + ok(FileAllInfo.InternalInformation.IndexNumber.QuadPart != 0, "FileAllInfo.InternalInformation.IndexNumber = 0, whereas it shouldn't\n"); + ok_eq_ulong(FileAllInfo.EaInformation.EaSize, 0); + ok_eq_ulong(FileAllInfo.AccessInformation.AccessFlags, (FILE_GENERIC_READ | FILE_GENERIC_WRITE)); + ok_eq_longlong(FileAllInfo.PositionInformation.CurrentByteOffset.QuadPart, 0); + ok_eq_ulong(FileAllInfo.ModeInformation.Mode, FILE_SYNCHRONOUS_IO_NONALERT); + ok_eq_ulong(FileAllInfo.AlignmentInformation.AlignmentRequirement, 0); + ok_eq_ulong(FileAllInfo.NameInformation.FileNameLength, sizeof(PIPE_NAME) - sizeof(WCHAR)); + ok_eq_size(RtlCompareMemory(FileAllInfo.NameInformation.FileName, PIPE_NAME, 6 * sizeof(WCHAR)), (6 * sizeof(WCHAR))); + ok_eq_wchar(FileAllInfo.NameInformation.FileName[6], 0xFFFF); + ok_eq_ulong(IoStatusBlock.Information, (FIELD_OFFSET(FILE_ALL_INFORMATION, NameInformation.FileName) + 6 * sizeof(WCHAR))); + + RtlFillMemory(&FileAllInfo, sizeof(FileAllInfo), 0xFF); + Status = ZwQueryInformationFile(ServerHandle, + &IoStatusBlock, + &FileAllInfo, + sizeof(FILE_ALL_INFORMATION) - 4, + FileAllInformation); + ok_eq_hex(Status, STATUS_BUFFER_OVERFLOW); + ok_eq_hex(IoStatusBlock.Status, STATUS_BUFFER_OVERFLOW); + ok_eq_longlong(FileAllInfo.BasicInformation.CreationTime.QuadPart, 0); + ok_eq_longlong(FileAllInfo.BasicInformation.LastAccessTime.QuadPart, 0); + ok_eq_longlong(FileAllInfo.BasicInformation.LastWriteTime.QuadPart, 0); + ok_eq_longlong(FileAllInfo.BasicInformation.ChangeTime.QuadPart, 0); + ok_eq_ulong(FileAllInfo.BasicInformation.FileAttributes, FILE_ATTRIBUTE_NORMAL); + ok_eq_longlong(FileAllInfo.StandardInformation.AllocationSize.QuadPart, 8192); + ok_eq_longlong(FileAllInfo.StandardInformation.EndOfFile.QuadPart, 0); + ok_eq_ulong(FileAllInfo.StandardInformation.NumberOfLinks, 1); + ok_bool_true(FileAllInfo.StandardInformation.DeletePending, "DeletePending"); + ok_bool_false(FileAllInfo.StandardInformation.Directory, "Directory"); + ok(FileAllInfo.InternalInformation.IndexNumber.QuadPart != 0xFFFFFFFFFFFFFFFF, "FileAllInfo.InternalInformation.IndexNumber = 0xFFFFFFFFFFFFFFFF, whereas it shouldn't\n"); + ok(FileAllInfo.InternalInformation.IndexNumber.QuadPart != 0, "FileAllInfo.InternalInformation.IndexNumber = 0, whereas it shouldn't\n"); + ok_eq_ulong(FileAllInfo.EaInformation.EaSize, 0); + ok_eq_ulong(FileAllInfo.AccessInformation.AccessFlags, (FILE_GENERIC_READ | FILE_GENERIC_WRITE)); + ok_eq_longlong(FileAllInfo.PositionInformation.CurrentByteOffset.QuadPart, 0); + ok_eq_ulong(FileAllInfo.ModeInformation.Mode, FILE_SYNCHRONOUS_IO_NONALERT); + ok_eq_ulong(FileAllInfo.AlignmentInformation.AlignmentRequirement, 0); + ok_eq_ulong(FileAllInfo.NameInformation.FileNameLength, sizeof(PIPE_NAME) - sizeof(WCHAR)); + ok_eq_wchar(FileAllInfo.NameInformation.FileName[0], 0xFFFF); + ok_eq_ulong(IoStatusBlock.Information, (sizeof(FILE_ALL_INFORMATION) - 4)); +} + +static KSTART_ROUTINE RunTest; +static +VOID +NTAPI +RunTest( + IN PVOID Context) +{ + NTSTATUS Status; + HANDLE ServerHandle; + + UNREFERENCED_PARAMETER(Context); + + ServerHandle = INVALID_HANDLE_VALUE; + Status = NpCreatePipe(&ServerHandle, + DEVICE_NAMED_PIPE PIPE_NAME, + BYTE_STREAM, QUEUE, BYTE_STREAM, DUPLEX, + MAX_INSTANCES, + IN_QUOTA, + OUT_QUOTA); + ok_eq_hex(Status, STATUS_SUCCESS); + ok(ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE, "ServerHandle = %p\n", ServerHandle); + if (!skip(NT_SUCCESS(Status) && ServerHandle != NULL && ServerHandle != INVALID_HANDLE_VALUE, "No pipe\n")) + { + TestFileInfo(ServerHandle); + ObCloseHandle(ServerHandle, KernelMode); + } +} + +START_TEST(NpfsFileInfo) +{ + PKTHREAD Thread; + + Thread = KmtStartThread(RunTest, NULL); + KmtFinishThread(Thread, NULL); +} From 1823418a800107380bf9174e06ac7864a348c8a6 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Sun, 13 Apr 2014 16:45:58 +0000 Subject: [PATCH 321/419] [NTOSKRNL] Simplify code in ExpLookupHandleTableEntry CORE-6843 #resolve svn path=/trunk/; revision=62743 --- reactos/ntoskrnl/ex/handle.c | 104 ++++++++++--------------- reactos/ntoskrnl/include/internal/ex.h | 36 ++++++--- 2 files changed, 64 insertions(+), 76 deletions(-) diff --git a/reactos/ntoskrnl/ex/handle.c b/reactos/ntoskrnl/ex/handle.c index 5c9edb23ed0..648e7ab6674 100644 --- a/reactos/ntoskrnl/ex/handle.c +++ b/reactos/ntoskrnl/ex/handle.c @@ -34,90 +34,59 @@ ExpInitializeHandleTables(VOID) PHANDLE_TABLE_ENTRY NTAPI ExpLookupHandleTableEntry(IN PHANDLE_TABLE HandleTable, - IN EXHANDLE LookupHandle) + IN EXHANDLE Handle) { - ULONG TableLevel, NextHandle; - ULONG_PTR i, j, k, TableBase; - PHANDLE_TABLE_ENTRY Entry = NULL; - EXHANDLE Handle = LookupHandle; - PUCHAR Level1, Level2, Level3; + ULONG TableLevel; + ULONG_PTR TableBase; + PHANDLE_TABLE_ENTRY HandleArray, Entry; + PVOID *PointerArray; - /* Clear the tag bits and check what the next handle is */ + /* Clear the tag bits */ Handle.TagBits = 0; - NextHandle = *(volatile ULONG*)&HandleTable->NextHandleNeedingPool; - if (Handle.Value >= NextHandle) return NULL; + + /* Check if the handle is in the allocated range */ + if (Handle.Value >= HandleTable->NextHandleNeedingPool) + { + return NULL; + } /* Get the table code */ - TableBase = *(volatile ULONG_PTR*)&HandleTable->TableCode; + TableBase = HandleTable->TableCode; /* Extract the table level and actual table base */ TableLevel = (ULONG)(TableBase & 3); - TableBase = TableBase - TableLevel; + TableBase &= ~3; + + PointerArray = (PVOID*)TableBase; + HandleArray = (PHANDLE_TABLE_ENTRY)TableBase; /* Check what level we're running at */ switch (TableLevel) { - /* Direct index */ - case 0: - - /* Use level 1 and just get the entry directly */ - Level1 = (PUCHAR)TableBase; - Entry = (PVOID)&Level1[Handle.Value * - (sizeof(HANDLE_TABLE_ENTRY) / - SizeOfHandle(1))]; - break; - - /* Nested index into mid level */ - case 1: - - /* Get the second table and index into it */ - Level2 = (PUCHAR)TableBase; - i = Handle.Value % SizeOfHandle(LOW_LEVEL_ENTRIES); - - /* Substract this index, and get the next one */ - Handle.Value -= i; - j = Handle.Value / - (SizeOfHandle(LOW_LEVEL_ENTRIES) / sizeof(PHANDLE_TABLE_ENTRY)); - - /* Now get the next table and get the entry from it */ - Level1 = (PUCHAR)*(PHANDLE_TABLE_ENTRY*)&Level2[j]; - Entry = (PVOID)&Level1[i * - (sizeof(HANDLE_TABLE_ENTRY) / - SizeOfHandle(1))]; - break; - - /* Nested index into high level */ case 2: - /* Start with the 3rd level table */ - Level3 = (PUCHAR)TableBase; - i = Handle.Value % SizeOfHandle(LOW_LEVEL_ENTRIES); + /* Get the mid level pointer array */ + PointerArray = PointerArray[Handle.HighIndex]; - /* Subtract this index and get the index for the next lower table */ - Handle.Value -= i; - k = Handle.Value / - (SizeOfHandle(LOW_LEVEL_ENTRIES) / sizeof(PHANDLE_TABLE_ENTRY)); + /* Fall through */ + case 1: - /* Get the remaining index in the 2nd level table */ - j = k % (MID_LEVEL_ENTRIES * sizeof(PHANDLE_TABLE_ENTRY)); + /* Get the handle array */ + HandleArray = PointerArray[Handle.MidIndex]; - /* Get the remaining index, which is in the third table */ - k -= j; - k /= MID_LEVEL_ENTRIES; + /* Fall through */ + case 0: - /* Extract the table level for the handle in each table */ - Level2 = (PUCHAR)*(PHANDLE_TABLE_ENTRY*)&Level3[k]; - Level1 = (PUCHAR)*(PHANDLE_TABLE_ENTRY*)&Level2[j]; - - /* Get the handle table entry */ - Entry = (PVOID)&Level1[i * - (sizeof(HANDLE_TABLE_ENTRY) / - SizeOfHandle(1))]; - - default: + /* Get the entry using the low index */ + Entry = &HandleArray[Handle.LowIndex]; /* All done */ break; + + default: + + NT_ASSERT(FALSE); + Entry = NULL; } /* Return the handle entry */ @@ -217,7 +186,7 @@ ExpFreeHandleTable(IN PHANDLE_TABLE HandleTable) PAGED_CODE(); /* Check which level we're at */ - if (!TableLevel) + if (TableLevel == 0) { /* Select the first level table base and just free it */ Level1 = (PVOID)TableBase; @@ -504,7 +473,7 @@ ExpAllocateHandleTableEntrySlow(IN PHANDLE_TABLE HandleTable, PAGED_CODE(); /* Check how many levels we already have */ - if (!TableLevel) + if (TableLevel == 0) { /* Allocate a mid level, since we only have a low level */ Mid = ExpAllocateMidLevelTable(HandleTable, DoInit, &Low); @@ -600,6 +569,11 @@ ExpAllocateHandleTableEntrySlow(IN PHANDLE_TABLE HandleTable, ASSERT(Value == NULL); } } + else + { + /* Something is really broken */ + ASSERT(FALSE); + } /* Update the index of the next handle */ Index = InterlockedExchangeAdd((PLONG) &HandleTable->NextHandleNeedingPool, diff --git a/reactos/ntoskrnl/include/internal/ex.h b/reactos/ntoskrnl/include/internal/ex.h index ba66425cd94..a46ffce92ba 100644 --- a/reactos/ntoskrnl/include/internal/ex.h +++ b/reactos/ntoskrnl/include/internal/ex.h @@ -33,18 +33,32 @@ extern LIST_ENTRY ExpPagedLookasideListHead; extern KSPIN_LOCK ExpNonPagedLookasideListLock; extern KSPIN_LOCK ExpPagedLookasideListLock; -typedef struct _EXHANDLE +#ifdef _WIN64 +#define HANDLE_LOW_BITS (PAGE_SHIFT - 4) +#define HANDLE_HIGH_BITS (PAGE_SHIFT - 3) +#else +#define HANDLE_LOW_BITS (PAGE_SHIFT - 3) +#define HANDLE_HIGH_BITS (PAGE_SHIFT - 2) +#endif +#define KERNEL_FLAG_BITS (sizeof(PVOID)*8 - 31) + +typedef union _EXHANDLE { - union - { - struct - { - ULONG TagBits:2; - ULONG Index:30; - }; - HANDLE GenericHandleOverlay; - ULONG_PTR Value; - }; + struct + { + ULONG_PTR TagBits:2; + ULONG_PTR Index:29; + }; + struct + { + ULONG_PTR TagBits2:2; + ULONG_PTR LowIndex:HANDLE_LOW_BITS; + ULONG_PTR MidIndex:HANDLE_HIGH_BITS; + ULONG_PTR HighIndex:HANDLE_HIGH_BITS; + ULONG_PTR KernelFlag:KERNEL_FLAG_BITS; + }; + HANDLE GenericHandleOverlay; + ULONG_PTR Value; } EXHANDLE, *PEXHANDLE; typedef struct _ETIMER From bd3046315ae45161e63885156e8a067e08273a2d Mon Sep 17 00:00:00 2001 From: James Tabor Date: Sun, 13 Apr 2014 23:53:34 +0000 Subject: [PATCH 322/419] [Win32k] - Move the system command Move and Size to Win32k. Fix most redraw issues. ATM this will be plugged in after User32 DefWnd cleanup. - Move more DefWindowProc functions into Win32k, these too will been needed soon. - Added more server side support functions. - See CORE-7447. svn path=/trunk/; revision=62744 --- reactos/win32ss/user/ntuser/cursoricon.c | 49 ++ reactos/win32ss/user/ntuser/cursoricon.h | 2 + reactos/win32ss/user/ntuser/cursoricon_new.c | 60 ++ reactos/win32ss/user/ntuser/defwnd.c | 722 ++++++++++++++++++- reactos/win32ss/user/ntuser/input.h | 1 - reactos/win32ss/user/ntuser/monitor.c | 29 + reactos/win32ss/user/ntuser/monitor.h | 1 + reactos/win32ss/user/ntuser/win32.h | 3 +- 8 files changed, 842 insertions(+), 25 deletions(-) diff --git a/reactos/win32ss/user/ntuser/cursoricon.c b/reactos/win32ss/user/ntuser/cursoricon.c index f7ecbfc6f4d..a4b0d3ad5f7 100644 --- a/reactos/win32ss/user/ntuser/cursoricon.c +++ b/reactos/win32ss/user/ntuser/cursoricon.c @@ -330,6 +330,55 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PPROCESSINFO Win32Process) } } +HCURSOR FASTCALL +IntSetCursor( + HCURSOR hCursor) +{ + PCURICON_OBJECT pcurOld, pcurNew; + HCURSOR hOldCursor = NULL; + + if (hCursor) + { + pcurNew = UserGetCurIconObject(hCursor); + if (!pcurNew) + { + EngSetLastError(ERROR_INVALID_CURSOR_HANDLE); + goto leave; + } + } + else + { + pcurNew = NULL; + } + + pcurOld = UserSetCursor(pcurNew, FALSE); + if (pcurOld) + { + hOldCursor = (HCURSOR)pcurOld->Self; + UserDereferenceObject(pcurOld); + } +leave: + return hOldCursor; +} + +BOOL FASTCALL +IntDestroyCursor( + HANDLE hCurIcon, + BOOL bForce) +{ + PCURICON_OBJECT CurIcon; + BOOL ret; + + if (!(CurIcon = UserGetCurIconObject(hCurIcon))) + { + return FALSE; + } + + ret = IntDestroyCurIconObject(CurIcon, PsGetCurrentProcessWin32Process()); + /* Note: IntDestroyCurIconObject will remove our reference for us! */ + + return ret; +} /* * @implemented diff --git a/reactos/win32ss/user/ntuser/cursoricon.h b/reactos/win32ss/user/ntuser/cursoricon.h index 0e16e86419b..a6d842c0e27 100644 --- a/reactos/win32ss/user/ntuser/cursoricon.h +++ b/reactos/win32ss/user/ntuser/cursoricon.h @@ -113,6 +113,8 @@ PCURICON_OBJECT FASTCALL UserGetCurIconObject(HCURSOR hCurIcon); BOOL UserSetCursorPos( INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook); BOOL APIENTRY UserClipCursor(RECTL *prcl); PSYSTEM_CURSORINFO IntGetSysCursorInfo(VOID); +HCURSOR FASTCALL IntSetCursor(HCURSOR hCursor); +BOOL FASTCALL IntDestroyCursor(HANDLE hCurIcon, BOOL bForce); #define IntReleaseCurIconObject(CurIconObj) \ UserDereferenceObject(CurIconObj) diff --git a/reactos/win32ss/user/ntuser/cursoricon_new.c b/reactos/win32ss/user/ntuser/cursoricon_new.c index ece23ce7667..bdd7fbb1712 100644 --- a/reactos/win32ss/user/ntuser/cursoricon_new.c +++ b/reactos/win32ss/user/ntuser/cursoricon_new.c @@ -246,6 +246,66 @@ IntCleanupCurIcons(struct _EPROCESS *Process, PPROCESSINFO Win32Process) } } +HCURSOR FASTCALL +IntSetCursor( + HCURSOR hCursor) +{ + PCURICON_OBJECT pcurOld, pcurNew; + HCURSOR hOldCursor = NULL; + + if (hCursor) + { + pcurNew = UserGetCurIconObject(hCursor); + if (!pcurNew) + { + EngSetLastError(ERROR_INVALID_CURSOR_HANDLE); + goto leave; + } + pcurNew->CURSORF_flags |= CURSORF_CURRENT; + } + else + { + pcurNew = NULL; + } + + pcurOld = UserSetCursor(pcurNew, FALSE); + if (pcurOld) + { + hOldCursor = pcurOld->head.h; + pcurOld->CURSORF_flags &= ~CURSORF_CURRENT; + if(UserObjectInDestroy(hOldCursor)) + { + /* Destroy it once and for all */ + IntDestroyCurIconObject(pcurOld, TRUE); + hOldCursor = NULL; + } + else + { + UserDereferenceObject(pcurOld); + } + } +leave: + return hOldCursor; +} + +BOOL FASTCALL +IntDestroyCursor( + HANDLE hCurIcon, + BOOL bForce) +{ + PCURICON_OBJECT CurIcon; + BOOL ret; + + if (!(CurIcon = UserGetCurIconObject(hCurIcon))) + { + RETURN(FALSE); + } + + ret = IntDestroyCurIconObject(CurIcon, bForce); + /* Note: IntDestroyCurIconObject will remove our reference for us! */ + + return ret; +} /* * @implemented diff --git a/reactos/win32ss/user/ntuser/defwnd.c b/reactos/win32ss/user/ntuser/defwnd.c index ea2e385792c..f6218b027e6 100644 --- a/reactos/win32ss/user/ntuser/defwnd.c +++ b/reactos/win32ss/user/ntuser/defwnd.c @@ -12,6 +12,26 @@ DBG_DEFAULT_CHANNEL(UserDefwnd); +#define UserHasDlgFrameStyle(Style, ExStyle) \ + (((ExStyle) & WS_EX_DLGMODALFRAME) || \ + (((Style) & WS_DLGFRAME) && (!((Style) & WS_THICKFRAME)))) + +#define UserHasThickFrameStyle(Style, ExStyle) \ + (((Style) & WS_THICKFRAME) && \ + (!(((Style) & (WS_DLGFRAME | WS_BORDER)) == WS_DLGFRAME))) + +#define UserHasThinFrameStyle(Style, ExStyle) \ + (((Style) & WS_BORDER) || (!((Style) & (WS_CHILD | WS_POPUP)))) + +#define ON_LEFT_BORDER(hit) \ + (((hit) == HTLEFT) || ((hit) == HTTOPLEFT) || ((hit) == HTBOTTOMLEFT)) +#define ON_RIGHT_BORDER(hit) \ + (((hit) == HTRIGHT) || ((hit) == HTTOPRIGHT) || ((hit) == HTBOTTOMRIGHT)) +#define ON_TOP_BORDER(hit) \ + (((hit) == HTTOP) || ((hit) == HTTOPLEFT) || ((hit) == HTTOPRIGHT)) +#define ON_BOTTOM_BORDER(hit) \ + (((hit) == HTBOTTOM) || ((hit) == HTBOTTOMLEFT) || ((hit) == HTBOTTOMRIGHT)) + // Client Shutdown messages #define MCS_SHUTDOWNTIMERS 1 #define MCS_QUERYENDSESSION 2 @@ -133,7 +153,6 @@ DefWndControlColor(HDC hDC, UINT ctlType) return IntGetSysColorBrush(COLOR_WINDOW); } - LRESULT FASTCALL DefWndHandleWindowPosChanging(PWND pWnd, WINDOWPOS* Pos) { @@ -163,27 +182,27 @@ DefWndHandleWindowPosChanging(PWND pWnd, WINDOWPOS* Pos) LRESULT FASTCALL DefWndHandleWindowPosChanged(PWND pWnd, WINDOWPOS* Pos) { - RECT Rect; - LONG style = pWnd->style; + RECT Rect; + LONG style = pWnd->style; - IntGetClientRect(pWnd, &Rect); - IntMapWindowPoints(pWnd, (style & WS_CHILD ? IntGetParent(pWnd) : NULL), (LPPOINT) &Rect, 2); + IntGetClientRect(pWnd, &Rect); + IntMapWindowPoints(pWnd, (style & WS_CHILD ? IntGetParent(pWnd) : NULL), (LPPOINT) &Rect, 2); - if (!(Pos->flags & SWP_NOCLIENTMOVE)) - { + if (!(Pos->flags & SWP_NOCLIENTMOVE)) + { co_IntSendMessage(UserHMGetHandle(pWnd), WM_MOVE, 0, MAKELONG(Rect.left, Rect.top)); - } + } - if (!(Pos->flags & SWP_NOCLIENTSIZE) || (Pos->flags & SWP_STATECHANGED)) - { + if (!(Pos->flags & SWP_NOCLIENTSIZE) || (Pos->flags & SWP_STATECHANGED)) + { if (style & WS_MINIMIZE) co_IntSendMessage(UserHMGetHandle(pWnd), WM_SIZE, SIZE_MINIMIZED, 0 ); else { WPARAM wp = (style & WS_MAXIMIZE) ? SIZE_MAXIMIZED : SIZE_RESTORED; co_IntSendMessage(UserHMGetHandle(pWnd), WM_SIZE, wp, MAKELONG(Rect.right - Rect.left, Rect.bottom - Rect.top)); } - } - return 0; + } + return 0; } VOID FASTCALL @@ -192,12 +211,12 @@ UserDrawWindowFrame(HDC hdc, ULONG width, ULONG height) { - HBRUSH hbrush = NtGdiSelectBrush( hdc, gpsi->hbrGray ); - NtGdiPatBlt( hdc, rect->left, rect->top, rect->right - rect->left - width, height, PATINVERT ); - NtGdiPatBlt( hdc, rect->left, rect->top + height, width, rect->bottom - rect->top - height, PATINVERT ); - NtGdiPatBlt( hdc, rect->left + width, rect->bottom - 1, rect->right - rect->left - width, -height, PATINVERT ); - NtGdiPatBlt( hdc, rect->right - 1, rect->top, -width, rect->bottom - rect->top - height, PATINVERT ); - NtGdiSelectBrush( hdc, hbrush ); + HBRUSH hbrush = NtGdiSelectBrush( hdc, gpsi->hbrGray ); + NtGdiPatBlt( hdc, rect->left, rect->top, rect->right - rect->left - width, height, PATINVERT ); + NtGdiPatBlt( hdc, rect->left, rect->top + height, width, rect->bottom - rect->top - height, PATINVERT ); + NtGdiPatBlt( hdc, rect->left + width, rect->bottom - 1, rect->right - rect->left - width, -height, PATINVERT ); + NtGdiPatBlt( hdc, rect->right - 1, rect->top, -width, rect->bottom - rect->top - height, PATINVERT ); + NtGdiSelectBrush( hdc, hbrush ); } VOID FASTCALL @@ -205,10 +224,503 @@ UserDrawMovingFrame(HDC hdc, RECTL *rect, BOOL thickframe) { - if (thickframe) UserDrawWindowFrame(hdc, rect, UserGetSystemMetrics(SM_CXFRAME), UserGetSystemMetrics(SM_CYFRAME)); - else UserDrawWindowFrame(hdc, rect, 1, 1); + if (thickframe) UserDrawWindowFrame(hdc, rect, UserGetSystemMetrics(SM_CXFRAME), UserGetSystemMetrics(SM_CYFRAME)); + else UserDrawWindowFrame(hdc, rect, 1, 1); } +/*********************************************************************** + * NC_GetInsideRect + * + * Get the 'inside' rectangle of a window, i.e. the whole window rectangle + * but without the borders (if any). + */ +void FASTCALL +NC_GetInsideRect(PWND Wnd, RECT *rect) +{ + ULONG Style; + ULONG ExStyle; + + Style = Wnd->style; + ExStyle = Wnd->ExStyle; + + rect->top = rect->left = 0; + rect->right = Wnd->rcWindow.right - Wnd->rcWindow.left; + rect->bottom = Wnd->rcWindow.bottom - Wnd->rcWindow.top; + + if (Style & WS_ICONIC) return; + + /* Remove frame from rectangle */ + if (UserHasThickFrameStyle(Style, ExStyle )) + { + RECTL_vInflateRect(rect, -UserGetSystemMetrics(SM_CXFRAME), -UserGetSystemMetrics(SM_CYFRAME)); + } + else + { + if (UserHasDlgFrameStyle(Style, ExStyle )) + { + RECTL_vInflateRect(rect, -UserGetSystemMetrics(SM_CXDLGFRAME), -UserGetSystemMetrics(SM_CYDLGFRAME)); + /* FIXME: this isn't in NC_AdjustRect? why not? */ + if (ExStyle & WS_EX_DLGMODALFRAME) + RECTL_vInflateRect( rect, -1, 0 ); + } + else + { + if (UserHasThinFrameStyle(Style, ExStyle)) + { + RECTL_vInflateRect(rect, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER)); + } + } + } + /* We have additional border information if the window + * is a child (but not an MDI child) */ + if ((Style & WS_CHILD) && !(ExStyle & WS_EX_MDICHILD)) + { + if (ExStyle & WS_EX_CLIENTEDGE) + RECTL_vInflateRect (rect, -UserGetSystemMetrics(SM_CXEDGE), -UserGetSystemMetrics(SM_CYEDGE)); + if (ExStyle & WS_EX_STATICEDGE) + RECTL_vInflateRect (rect, -UserGetSystemMetrics(SM_CXBORDER), -UserGetSystemMetrics(SM_CYBORDER)); + } +} + +LONG FASTCALL +DefWndStartSizeMove(PWND Wnd, WPARAM wParam, POINT *capturePoint) +{ + LONG hittest = 0; + POINT pt; + MSG msg; + RECT rectWindow; + ULONG Style = Wnd->style; + PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); + + rectWindow = Wnd->rcWindow; + + if ((wParam & 0xfff0) == SC_MOVE) + { + /* Move pointer at the center of the caption */ + RECT rect = rectWindow; + /* Note: to be exactly centered we should take the different types + * of border into account, but it shouldn't make more than a few pixels + * of difference so let's not bother with that */ + if (Style & WS_SYSMENU) + rect.left += UserGetSystemMetrics(SM_CXSIZE) + 1; + if (Style & WS_MINIMIZEBOX) + rect.right -= UserGetSystemMetrics(SM_CXSIZE) + 1; + if (Style & WS_MAXIMIZEBOX) + rect.right -= UserGetSystemMetrics(SM_CXSIZE) + 1; + pt.x = (rect.right + rect.left) / 2; + pt.y = rect.top + UserGetSystemMetrics(SM_CYSIZE)/2; + hittest = HTCAPTION; + *capturePoint = pt; + } + else /* SC_SIZE */ + { + pt.x = pt.y = 0; + while (!hittest) + { + if (!co_IntGetPeekMessage(&msg, 0, 0, 0, PM_REMOVE, TRUE)) return 0; + if (IntCallMsgFilter( &msg, MSGF_SIZE )) continue; + + switch(msg.message) + { + case WM_MOUSEMOVE: + //// Clamp the mouse position to the window rectangle when starting a window resize. + pt.x = min( max( msg.pt.x, rectWindow.left ), rectWindow.right - 1 ); + pt.y = min( max( msg.pt.y, rectWindow.top ), rectWindow.bottom - 1 ); + hittest = GetNCHitEx(Wnd, pt); + if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT)) hittest = 0; + break; + + case WM_LBUTTONUP: + return 0; + + case WM_KEYDOWN: + switch (msg.wParam) + { + case VK_UP: + hittest = HTTOP; + pt.x = (rectWindow.left+rectWindow.right)/2; + pt.y = rectWindow.top + UserGetSystemMetrics(SM_CYFRAME) / 2; + break; + case VK_DOWN: + hittest = HTBOTTOM; + pt.x = (rectWindow.left+rectWindow.right)/2; + pt.y = rectWindow.bottom - UserGetSystemMetrics(SM_CYFRAME) / 2; + break; + case VK_LEFT: + hittest = HTLEFT; + pt.x = rectWindow.left + UserGetSystemMetrics(SM_CXFRAME) / 2; + pt.y = (rectWindow.top+rectWindow.bottom)/2; + break; + case VK_RIGHT: + hittest = HTRIGHT; + pt.x = rectWindow.right - UserGetSystemMetrics(SM_CXFRAME) / 2; + pt.y = (rectWindow.top+rectWindow.bottom)/2; + break; + case VK_RETURN: + case VK_ESCAPE: + return 0; + } + default: + IntTranslateKbdMessage( &msg, 0 ); + pti->TIF_flags |= TIF_MOVESIZETRACKING; + IntDispatchMessage( &msg ); + pti->TIF_flags |= TIF_MOVESIZETRACKING; + break; + } + } + *capturePoint = pt; + } + UserSetCursorPos(pt.x, pt.y, 0, 0, FALSE); + co_IntSendMessage(UserHMGetHandle(Wnd), WM_SETCURSOR, (WPARAM)UserHMGetHandle(Wnd), MAKELONG(hittest, WM_MOUSEMOVE)); + return hittest; +} + +// +// System Command Size and Move +// +// Perform SC_MOVE and SC_SIZE commands. +// +VOID FASTCALL +DefWndDoSizeMove(PWND pwnd, WORD wParam) +{ + MSG msg; + RECT sizingRect, mouseRect, origRect, unmodRect; + HDC hdc; + LONG hittest = (LONG)(wParam & 0x0f); + HCURSOR hDragCursor = 0, hOldCursor = 0; + POINT minTrack, maxTrack; + POINT capturePoint, pt; + ULONG Style, ExStyle; + BOOL thickframe; + BOOL iconic; + BOOL moved = FALSE; + BOOL DragFullWindows = FALSE; + PWND pWndParent = NULL; + WPARAM syscommand = (wParam & 0xfff0); + PTHREADINFO pti = PsGetCurrentThreadWin32Thread(); + //PMONITOR mon = 0; Don't port sync from wine!!! This breaks explorer task bar sizing!! + // The task bar can grow in size and can not reduce due to the change + // in the work area. + + Style = pwnd->style; + ExStyle = pwnd->ExStyle; + iconic = (Style & WS_MINIMIZE) != 0; + + if ((Style & WS_MAXIMIZE) || !IntIsWindowVisible(pwnd)) return; + + thickframe = UserHasThickFrameStyle(Style, ExStyle) && !iconic; + + // + // Show window contents while dragging the window, get flag from registry data. + // + UserSystemParametersInfo(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0); + + pt.x = pti->ptLast.x; + pt.y = pti->ptLast.y; + capturePoint = pt; + UserClipCursor( NULL ); + + TRACE("pwnd %p command %04lx, hittest %d, pos %d,%d\n", + pwnd, syscommand, hittest, pt.x, pt.y); + + if (syscommand == SC_MOVE) + { + if (!hittest) hittest = DefWndStartSizeMove(pwnd, wParam, &capturePoint); + if (!hittest) return; + } + else /* SC_SIZE */ + { + if (!thickframe) return; + if (hittest && (syscommand != SC_MOUSEMENU)) + { + hittest += (HTLEFT - WMSZ_LEFT); + } + else + { + co_UserSetCapture(UserHMGetHandle(pwnd)); + hittest = DefWndStartSizeMove(pwnd, wParam, &capturePoint); + if (!hittest) + { + IntReleaseCapture(); + return; + } + } + } + + /* Get min/max info */ + + co_WinPosGetMinMaxInfo(pwnd, NULL, NULL, &minTrack, &maxTrack); + sizingRect = pwnd->rcWindow; + origRect = sizingRect; + if (Style & WS_CHILD) + { + pWndParent = IntGetParent(pwnd); + IntGetClientRect( pWndParent, &mouseRect ); + IntMapWindowPoints( pWndParent, 0, (LPPOINT)&mouseRect, 2 ); + IntMapWindowPoints( 0, pWndParent, (LPPOINT)&sizingRect, 2 ); + unmodRect = sizingRect; + } + else + { + if (!(ExStyle & WS_EX_TOPMOST)) + { + UserSystemParametersInfo(SPI_GETWORKAREA, 0, &mouseRect, 0); + } + else + { + RECTL_vSetRect(&mouseRect, 0, 0, UserGetSystemMetrics(SM_CXSCREEN), UserGetSystemMetrics(SM_CYSCREEN)); + } + unmodRect = sizingRect; + } + + if (ON_LEFT_BORDER(hittest)) + { + mouseRect.left = max( mouseRect.left, sizingRect.right-maxTrack.x+capturePoint.x-sizingRect.left ); + mouseRect.right = min( mouseRect.right, sizingRect.right-minTrack.x+capturePoint.x-sizingRect.left ); + } + else if (ON_RIGHT_BORDER(hittest)) + { + mouseRect.left = max( mouseRect.left, sizingRect.left+minTrack.x+capturePoint.x-sizingRect.right ); + mouseRect.right = min( mouseRect.right, sizingRect.left+maxTrack.x+capturePoint.x-sizingRect.right ); + } + if (ON_TOP_BORDER(hittest)) + { + mouseRect.top = max( mouseRect.top, sizingRect.bottom-maxTrack.y+capturePoint.y-sizingRect.top ); + mouseRect.bottom = min( mouseRect.bottom,sizingRect.bottom-minTrack.y+capturePoint.y-sizingRect.top); + } + else if (ON_BOTTOM_BORDER(hittest)) + { + mouseRect.top = max( mouseRect.top, sizingRect.top+minTrack.y+capturePoint.y-sizingRect.bottom ); + mouseRect.bottom = min( mouseRect.bottom, sizingRect.top+maxTrack.y+capturePoint.y-sizingRect.bottom ); + } + + hdc = UserGetDCEx( pWndParent, 0, DCX_CACHE ); + + if ( iconic ) /* create a cursor for dragging */ + { + hDragCursor = pwnd->pcls->hIcon;; + if ( !hDragCursor ) hDragCursor = (HCURSOR)co_IntSendMessage( UserHMGetHandle(pwnd), WM_QUERYDRAGICON, 0, 0 ); + if ( !hDragCursor ) iconic = FALSE; + } + + /* repaint the window before moving it around */ + co_UserRedrawWindow( pwnd, NULL, 0, RDW_UPDATENOW | RDW_ALLCHILDREN); + + IntNotifyWinEvent( EVENT_SYSTEM_MOVESIZESTART, pwnd, OBJID_WINDOW, CHILDID_SELF, 0); + + co_IntSendMessage( UserHMGetHandle(pwnd), WM_ENTERSIZEMOVE, 0, 0 ); + + MsqSetStateWindow(pti, MSQ_STATE_MOVESIZE, UserHMGetHandle(pwnd)); + + if (IntGetCapture() != UserHMGetHandle(pwnd)) co_UserSetCapture( UserHMGetHandle(pwnd) ); + + pwnd->head.pti->TIF_flags |= TIF_MOVESIZETRACKING; + + for(;;) + { + int dx = 0, dy = 0; + + if (!co_IntGetPeekMessage(&msg, 0, 0, 0, PM_REMOVE, TRUE)) break; + if (IntCallMsgFilter( &msg, MSGF_SIZE )) continue; + + /* Exit on button-up, Return, or Esc */ + if ((msg.message == WM_LBUTTONUP) || + ((msg.message == WM_KEYDOWN) && + ((msg.wParam == VK_RETURN) || (msg.wParam == VK_ESCAPE)))) break; + + if ((msg.message != WM_KEYDOWN) && (msg.message != WM_MOUSEMOVE)) + { + IntTranslateKbdMessage( &msg , 0 ); + IntDispatchMessage( &msg ); + continue; /* We are not interested in other messages */ + } + + pt = msg.pt; + + if (msg.message == WM_KEYDOWN) switch(msg.wParam) + { + case VK_UP: pt.y -= 8; break; + case VK_DOWN: pt.y += 8; break; + case VK_LEFT: pt.x -= 8; break; + case VK_RIGHT: pt.x += 8; break; + } + + pt.x = max( pt.x, mouseRect.left ); + pt.x = min( pt.x, mouseRect.right - 1 ); + pt.y = max( pt.y, mouseRect.top ); + pt.y = min( pt.y, mouseRect.bottom - 1 ); + + dx = pt.x - capturePoint.x; + dy = pt.y - capturePoint.y; + + if (dx || dy) + { + if ( !moved ) + { + moved = TRUE; + + if ( iconic ) /* ok, no system popup tracking */ + { + hOldCursor = IntSetCursor(hDragCursor); + UserShowCursor( TRUE ); + } + else if(!DragFullWindows) + UserDrawMovingFrame( hdc, &sizingRect, thickframe ); + } + + if (msg.message == WM_KEYDOWN) UserSetCursorPos(pt.x, pt.y, 0, 0, FALSE); + else + { + RECT newRect = unmodRect; + + if (!iconic && !DragFullWindows) UserDrawMovingFrame( hdc, &sizingRect, thickframe ); + if (hittest == HTCAPTION) RECTL_vOffsetRect( &newRect, dx, dy ); + if (ON_LEFT_BORDER(hittest)) newRect.left += dx; + else if (ON_RIGHT_BORDER(hittest)) newRect.right += dx; + if (ON_TOP_BORDER(hittest)) newRect.top += dy; + else if (ON_BOTTOM_BORDER(hittest)) newRect.bottom += dy; + capturePoint = pt; + + // + // Save the new position to the unmodified rectangle. This allows explorer task bar + // sizing. Explorer will forces back the position unless a certain amount of sizing + // has occurred. + // + unmodRect = newRect; + + /* determine the hit location */ + if (syscommand == SC_SIZE) + { + WPARAM wpSizingHit = 0; + + if (hittest >= HTLEFT && hittest <= HTBOTTOMRIGHT) + wpSizingHit = WMSZ_LEFT + (hittest - HTLEFT); + co_IntSendMessage( UserHMGetHandle(pwnd), WM_SIZING, wpSizingHit, (LPARAM)&newRect ); + } + else + co_IntSendMessage( UserHMGetHandle(pwnd), WM_MOVING, 0, (LPARAM)&newRect ); + + if (!iconic) + { + if (!DragFullWindows) + UserDrawMovingFrame( hdc, &newRect, thickframe ); + else + { // Moving the whole window now! + PWND pwndTemp; + //// This causes the mdi child window to jump up when it is moved. + //IntMapWindowPoints( 0, pWndParent, (POINT *)&rect, 2 ); + co_WinPosSetWindowPos( pwnd, + 0, + newRect.left, + newRect.top, + newRect.right - newRect.left, + newRect.bottom - newRect.top, + ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ); + + // Update all the windows after the move or size, including this window. + for ( pwndTemp = pwnd->head.rpdesk->pDeskInfo->spwnd->spwndChild; + pwndTemp; + pwndTemp = pwndTemp->spwndNext ) + { + RECTL rect; + // Only the windows that overlap will be redrawn. + if (RECTL_bIntersectRect( &rect, &pwnd->rcWindow, &pwndTemp->rcWindow )) + { + co_UserRedrawWindow( pwndTemp, NULL, NULL, RDW_UPDATENOW | RDW_ALLCHILDREN); + } + } + } + } + sizingRect = newRect; + } + } + } + + pwnd->head.pti->TIF_flags &= ~TIF_MOVESIZETRACKING; + + IntReleaseCapture(); + + if ( iconic ) + { + if ( moved ) /* restore cursors, show icon title later on */ + { + UserShowCursor( FALSE ); + IntSetCursor( hOldCursor ); + } + IntDestroyCursor( hDragCursor, FALSE ); + } + else if ( moved && !DragFullWindows ) + UserDrawMovingFrame( hdc, &sizingRect, thickframe ); + + UserReleaseDC(NULL, hdc, FALSE); + + //// This causes the mdi child window to jump up when it is moved. + //if (pWndParent) IntMapWindowPoints( 0, pWndParent, (POINT *)&sizingRect, 2 ); + + if (co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)UserHMGetHandle(pwnd), (LPARAM)&sizingRect)) + { + ERR("DoSizeMove : WH_CBT Call Hook return!\n"); + moved = FALSE; + } + + IntNotifyWinEvent( EVENT_SYSTEM_MOVESIZEEND, pwnd, OBJID_WINDOW, CHILDID_SELF, 0); + + MsqSetStateWindow(pti, MSQ_STATE_MOVESIZE, NULL); + + co_IntSendMessage( UserHMGetHandle(pwnd), WM_EXITSIZEMOVE, 0, 0 ); + //// wine mdi hack + co_IntSendMessage( UserHMGetHandle(pwnd), WM_SETVISIBLE, !!(pwnd->style & WS_MINIMIZE), 0L); + //// + /* window moved or resized */ + if (moved) + { + /* if the moving/resizing isn't canceled call SetWindowPos + * with the new position or the new size of the window + */ + if (!((msg.message == WM_KEYDOWN) && (msg.wParam == VK_ESCAPE)) ) + { + /* NOTE: SWP_NOACTIVATE prevents document window activation in Word 6 */ + if (!DragFullWindows || iconic ) + { + co_WinPosSetWindowPos( pwnd, + 0, + sizingRect.left, + sizingRect.top, + sizingRect.right - sizingRect.left, + sizingRect.bottom - sizingRect.top, + ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ); + } + } + else + { /* restore previous size/position */ + if ( DragFullWindows ) + { + co_WinPosSetWindowPos( pwnd, + 0, + origRect.left, + origRect.top, + origRect.right - origRect.left, + origRect.bottom - origRect.top, + ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ); + } + } + } + + if ( IntIsWindow(UserHMGetHandle(pwnd)) ) + if ( iconic ) + { + /* Single click brings up the system menu when iconized */ + if ( !moved ) + { + if( Style & WS_SYSMENU ) + co_IntSendMessage( UserHMGetHandle(pwnd), WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y)); + } + } +} + +// +// Handle a WM_SYSCOMMAND message. Called from DefWindowProc(). +// LRESULT FASTCALL DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam) { @@ -227,15 +739,58 @@ DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam) { case SC_MOVE: case SC_SIZE: - //DefWndDoSizeMove(pWnd, wParam); - ERR("SC_MOVESIZE\n"); + DefWndDoSizeMove(pWnd, wParam); break; + case SC_MINIMIZE: + if (UserHMGetHandle(pWnd) == UserGetActiveWindow()) + IntShowOwnedPopups(pWnd,FALSE); // This is done in ShowWindow! Need to retest! + co_WinPosShowWindow( pWnd, SW_MINIMIZE ); + break; + + case SC_MAXIMIZE: + if (((pWnd->style & WS_MINIMIZE) != 0) && UserHMGetHandle(pWnd) == UserGetActiveWindow()) + IntShowOwnedPopups(pWnd,TRUE); + co_WinPosShowWindow( pWnd, SW_MAXIMIZE ); + break; + + case SC_RESTORE: + if (((pWnd->style & WS_MINIMIZE) != 0) && UserHMGetHandle(pWnd) == UserGetActiveWindow()) + IntShowOwnedPopups(pWnd,TRUE); + co_WinPosShowWindow( pWnd, SW_RESTORE ); + break; + + case SC_CLOSE: + return co_IntSendMessage(UserHMGetHandle(pWnd), WM_CLOSE, 0, 0); + case SC_SCREENSAVE: ERR("Screensaver Called!\n"); UserPostMessage(hwndSAS, WM_LOGONNOTIFY, LN_START_SCREENSAVE, 0); // always lParam 0 == not Secure break; + case SC_HOTKEY: + { + USER_REFERENCE_ENTRY Ref; + + pWnd = ValidateHwndNoErr((HWND)lParam); + if (pWnd) + { + if (pWnd->spwndLastActive) + { + pWnd = pWnd->spwndLastActive; + } + UserRefObjectCo(pWnd, &Ref); + co_IntSetForegroundWindow(pWnd); + UserDerefObjectCo(pWnd); + if (pWnd->style & WS_MINIMIZE) + { + UserPostMessage(UserHMGetHandle(pWnd), WM_SYSCOMMAND, SC_RESTORE, 0); + } + } + } + break; + + default: // We do not support anything else here so we should return normal even when sending a hook. return 0; @@ -244,6 +799,39 @@ DefWndHandleSysCommand(PWND pWnd, WPARAM wParam, LPARAM lParam) return(Hook ? 1 : 0); // Don't call us again from user space. } +VOID FASTCALL DefWndPrint( PWND pwnd, HDC hdc, ULONG uFlags) +{ + /* + * Visibility flag. + */ + if ( (uFlags & PRF_CHECKVISIBLE) && + !IntIsWindowVisible(pwnd) ) + return; + + /* + * Unimplemented flags. + */ + if ( (uFlags & PRF_CHILDREN) || + (uFlags & PRF_OWNED) || + (uFlags & PRF_NONCLIENT) ) + { + FIXME("WM_PRINT message with unsupported flags\n"); + } + + /* + * Background + */ + if ( uFlags & PRF_ERASEBKGND) + co_IntSendMessage(UserHMGetHandle(pwnd), WM_ERASEBKGND, (WPARAM)hdc, 0); + + /* + * Client area + */ + if ( uFlags & PRF_CLIENT) + co_IntSendMessage(UserHMGetHandle(pwnd), WM_PRINTCLIENT, (WPARAM)hdc, uFlags); +} + + /* Win32k counterpart of User DefWindowProc */ @@ -304,6 +892,10 @@ IntDefWindowProc( UserDerefObjectCo(Wnd->spwndParent); break; + case WM_CLOSE: + co_UserDestroyWindow(Wnd); + break; + case WM_CTLCOLORMSGBOX: case WM_CTLCOLOREDIT: case WM_CTLCOLORLISTBOX: @@ -316,6 +908,51 @@ IntDefWindowProc( case WM_CTLCOLOR: return (LRESULT) DefWndControlColor((HDC)wParam, HIWORD(lParam)); + case WM_ACTIVATE: + /* The default action in Windows is to set the keyboard focus to + * the window, if it's being activated and not minimized */ + if (LOWORD(wParam) != WA_INACTIVE && + !(Wnd->style & WS_MINIMIZE)) + { + //ERR("WM_ACTIVATE %p\n",hWnd); + co_UserSetFocus(Wnd); + } + break; + + case WM_MOUSEWHEEL: + if (Wnd->style & WS_CHILD) + { + HWND hwndParent; + PWND pwndParent = IntGetParent(Wnd); + hwndParent = pwndParent ? UserHMGetHandle(pwndParent) : NULL; + return co_IntSendMessage( hwndParent, WM_MOUSEWHEEL, wParam, lParam); + } + break; + + case WM_ERASEBKGND: + case WM_ICONERASEBKGND: + { + RECT Rect; + HBRUSH hBrush = Wnd->pcls->hbrBackground; + if (!hBrush) return 0; + if (hBrush <= (HBRUSH)COLOR_MENUBAR) + { + hBrush = IntGetSysColorBrush((INT)hBrush); + } + if (Wnd->pcls->style & CS_PARENTDC) + { + /* can't use GetClipBox with a parent DC or we fill the whole parent */ + IntGetClientRect(Wnd, &Rect); + GreDPtoLP((HDC)wParam, (LPPOINT)&Rect, 2); + } + else + { + GdiGetClipBox((HDC)wParam, &Rect); + } + FillRect((HDC)wParam, &Rect, hBrush); + return (1); + } + case WM_GETHOTKEY: //ERR("WM_GETHOTKEY\n"); return DefWndGetHotKey(Wnd); @@ -331,6 +968,46 @@ IntDefWindowProc( return GetNCHitEx(Wnd, Point); } + case WM_PRINT: + { + DefWndPrint(Wnd, (HDC)wParam, lParam); + return (0); + } + + case WM_PAINTICON: + case WM_PAINT: + { + PAINTSTRUCT Ps; + HDC hDC; + + /* If already in Paint and Client area is not empty just return. */ + if (Wnd->state2 & WNDS2_STARTPAINT && !RECTL_bIsEmptyRect(&Wnd->rcClient)) + { + ERR("In Paint and Client area is not empty!\n"); + return 0; + } + + hDC = IntBeginPaint(Wnd, &Ps); + if (hDC) + { + HICON hIcon; + if (((Wnd->style & WS_MINIMIZE) != 0) && (hIcon = Wnd->pcls->hIcon)) + { + RECT ClientRect; + INT x, y; + PCURICON_OBJECT pIcon; + if (!(pIcon = UserGetCurIconObject(hIcon))) return 0; + ERR("Doing Paint and Client area is empty!\n"); + IntGetClientRect(Wnd, &ClientRect); + x = (ClientRect.right - ClientRect.left - UserGetSystemMetrics(SM_CXICON)) / 2; + y = (ClientRect.bottom - ClientRect.top - UserGetSystemMetrics(SM_CYICON)) / 2; + UserDrawIconEx( hDC, x, y, pIcon, 0, 0, 0, 0, DI_NORMAL | DI_COMPAT | DI_DEFAULTSIZE ); + } + IntEndPaint(Wnd, &Ps); + } + return (0); + } + case WM_SYNCPAINT: { HRGN hRgn; @@ -430,7 +1107,6 @@ HICON FASTCALL NC_IconForWindow( PWND pWnd ) { if (!hIcon) hIcon = gpsi->hIconSmWindows; // Both are IDI_WINLOGO Small if (!hIcon) hIcon = gpsi->hIconWindows; // Reg size. - hIcon = (HICON)1; } return hIcon; } diff --git a/reactos/win32ss/user/ntuser/input.h b/reactos/win32ss/user/ntuser/input.h index c34eb4a9ff0..2374fafc590 100644 --- a/reactos/win32ss/user/ntuser/input.h +++ b/reactos/win32ss/user/ntuser/input.h @@ -97,6 +97,5 @@ extern BYTE gafAsyncKeyState[256 * 2 / 8]; // 2 bits per key ((ks)[GET_KS_BYTE(vk)] | GET_KS_LOCK_BIT(vk)) : \ ((ks)[GET_KS_BYTE(vk)] & ~GET_KS_LOCK_BIT(vk))) - extern PKL gspklBaseLayout; extern KEYBOARD_ATTRIBUTES gKeyboardInfo; diff --git a/reactos/win32ss/user/ntuser/monitor.c b/reactos/win32ss/user/ntuser/monitor.c index 586a0f40036..ca32fe01be3 100644 --- a/reactos/win32ss/user/ntuser/monitor.c +++ b/reactos/win32ss/user/ntuser/monitor.c @@ -467,6 +467,35 @@ cleanup: return UserGetMonitorObject(hMonitor); } +PMONITOR +FASTCALL +UserMonitorFromPoint( + IN POINT pt, + IN DWORD dwFlags) +{ + RECTL rc; + HMONITOR hMonitor = NULL; + + /* Check if flags are valid */ + if (dwFlags != MONITOR_DEFAULTTONULL && + dwFlags != MONITOR_DEFAULTTOPRIMARY && + dwFlags != MONITOR_DEFAULTTONEAREST) + { + EngSetLastError(ERROR_INVALID_FLAGS); + return NULL; + } + + /* Fill rect (bottom-right exclusive) */ + rc.left = pt.x; + rc.right = pt.x + 1; + rc.top = pt.y; + rc.bottom = pt.y + 1; + + /* Find intersecting monitor */ + IntGetMonitorsFromRect(&rc, &hMonitor, NULL, 1, dwFlags); + + return UserGetMonitorObject(hMonitor); +} /* PUBLIC FUNCTIONS ***********************************************************/ diff --git a/reactos/win32ss/user/ntuser/monitor.h b/reactos/win32ss/user/ntuser/monitor.h index ce1a6faea6d..8882dfb68d2 100644 --- a/reactos/win32ss/user/ntuser/monitor.h +++ b/reactos/win32ss/user/ntuser/monitor.h @@ -29,5 +29,6 @@ NTSTATUS NTAPI UserUpdateMonitorSize(IN HDEV hDev); PMONITOR NTAPI UserGetMonitorObject(IN HMONITOR); PMONITOR NTAPI UserGetPrimaryMonitor(VOID); PMONITOR NTAPI UserMonitorFromRect(PRECTL,DWORD); +PMONITOR FASTCALL UserMonitorFromPoint(POINT,DWORD); /* EOF */ diff --git a/reactos/win32ss/user/ntuser/win32.h b/reactos/win32ss/user/ntuser/win32.h index fbbfaca8953..a086b8f19bd 100644 --- a/reactos/win32ss/user/ntuser/win32.h +++ b/reactos/win32ss/user/ntuser/win32.h @@ -125,7 +125,7 @@ typedef struct _THREADINFO /* Queue of messages posted to the queue. */ LIST_ENTRY PostedMessagesListHead; // mlPost - + UINT fsChangeBitsRemoved; UINT cWindows; UINT cVisWindows; LIST_ENTRY aphkStart[NB_HOOKS]; @@ -238,6 +238,7 @@ typedef struct _PROCESSINFO struct _CURICON_OBJECT* pCursorCache; LUID luidSession; USERSTARTUPINFO usi; + PVOID pW32Job; DWORD dwLayout; DWORD dwRegisteredClasses; /* ReactOS */ From 142c54771444f8a8a4eedfc864ff2e326e478229 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 14 Apr 2014 01:52:37 +0000 Subject: [PATCH 323/419] [User32] - Cleanup and plug in. Removed code that is not used, this code served us well. An assessment is needed to be made, base on speed and necessity, on what stays or moved or duplicated. - See CORE-7447. svn path=/trunk/; revision=62745 --- reactos/win32ss/user/user32/windows/defwnd.c | 626 +------------------ 1 file changed, 5 insertions(+), 621 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/defwnd.c b/reactos/win32ss/user/user32/windows/defwnd.c index 37459991a14..5b90e29ff6a 100644 --- a/reactos/win32ss/user/user32/windows/defwnd.c +++ b/reactos/win32ss/user/user32/windows/defwnd.c @@ -153,32 +153,6 @@ UserGetInsideRectNC(PWND Wnd, RECT *rect) } } -#if 0 -VOID -DefWndSetRedraw(HWND hWnd, WPARAM wParam) -{ - LONG Style = GetWindowLongPtr(hWnd, GWL_STYLE); - /* Content can be redrawn after a change. */ - if (wParam) - { - if (!(Style & WS_VISIBLE)) /* Not Visible */ - { - SetWindowLongPtr(hWnd, GWL_STYLE, WS_VISIBLE); - } - } - else /* Content cannot be redrawn after a change. */ - { - if (Style & WS_VISIBLE) /* Visible */ - { - RedrawWindow( hWnd, NULL, 0, RDW_ALLCHILDREN | RDW_VALIDATE ); - Style &= ~WS_VISIBLE; - SetWindowLongPtr(hWnd, GWL_STYLE, Style); /* clear bits */ - } - } - return; -} -#endif - LRESULT DefWndHandleSetCursor(HWND hWnd, WPARAM wParam, LPARAM lParam, ULONG Style) { @@ -255,502 +229,6 @@ DefWndHandleSetCursor(HWND hWnd, WPARAM wParam, LPARAM lParam, ULONG Style) return((LRESULT)SetCursor(LoadCursorW(0, IDC_ARROW))); } -static LONG -DefWndStartSizeMove(HWND hWnd, PWND Wnd, WPARAM wParam, POINT *capturePoint) -{ - LONG hittest = 0; - POINT pt; - MSG msg; - RECT rectWindow; - ULONG Style = Wnd->style; - - rectWindow = Wnd->rcWindow; - - if ((wParam & 0xfff0) == SC_MOVE) - { - /* Move pointer at the center of the caption */ - RECT rect; - UserGetInsideRectNC(Wnd, &rect); - if (Style & WS_SYSMENU) - rect.left += GetSystemMetrics(SM_CXSIZE) + 1; - if (Style & WS_MINIMIZEBOX) - rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; - if (Style & WS_MAXIMIZEBOX) - rect.right -= GetSystemMetrics(SM_CXSIZE) + 1; - //pt.x = rectWindow.left + (rect.right - rect.left) / 2; - //pt.y = rectWindow.top + rect.top + GetSystemMetrics(SM_CYSIZE)/2; - pt.x = (rect.right + rect.left) / 2; - pt.y = rect.top + GetSystemMetrics(SM_CYSIZE)/2; - ERR("SC_MOVE\n"); - hittest = HTCAPTION; - *capturePoint = pt; - } - else /* SC_SIZE */ - { - pt.x = pt.y = 0; - while(!hittest) - { - if (!GetMessageW(&msg, NULL, 0, 0)) break; //return 0; - if (CallMsgFilterW( &msg, MSGF_SIZE )) continue; - - switch(msg.message) - { - case WM_MOUSEMOVE: - //// Clamp the mouse position to the window rectangle when starting a window resize. - //pt.x = min( max( msg.pt.x, rectWindow.left ), rectWindow.right - 1 ); - //pt.y = min( max( msg.pt.y, rectWindow.top ), rectWindow.bottom - 1 ); - //// Breaks a win test. - hittest = DefWndNCHitTest(hWnd, msg.pt); - if ((hittest < HTLEFT) || (hittest > HTBOTTOMRIGHT)) hittest = 0; - break; - - case WM_LBUTTONUP: - return 0; - - case WM_KEYDOWN: - switch(msg.wParam) - { - case VK_UP: - hittest = HTTOP; - pt.x =(rectWindow.left+rectWindow.right)/2; - pt.y = rectWindow.top + GetSystemMetrics(SM_CYFRAME) / 2; - break; - case VK_DOWN: - hittest = HTBOTTOM; - pt.x =(rectWindow.left+rectWindow.right)/2; - pt.y = rectWindow.bottom - GetSystemMetrics(SM_CYFRAME) / 2; - break; - case VK_LEFT: - hittest = HTLEFT; - pt.x = rectWindow.left + GetSystemMetrics(SM_CXFRAME) / 2; - pt.y =(rectWindow.top+rectWindow.bottom)/2; - break; - case VK_RIGHT: - hittest = HTRIGHT; - pt.x = rectWindow.right - GetSystemMetrics(SM_CXFRAME) / 2; - pt.y =(rectWindow.top+rectWindow.bottom)/2; - break; - case VK_RETURN: - case VK_ESCAPE: - return 0; - } - default: - TranslateMessage( &msg ); - DispatchMessageW( &msg ); - break; - } - } - *capturePoint = pt; - } - SetCursorPos( pt.x, pt.y ); - DefWndHandleSetCursor(hWnd, (WPARAM)hWnd, MAKELONG(hittest, WM_MOUSEMOVE), Style); - //SendMessageW(hWnd, WM_SETCURSOR, (WPARAM)hWnd, MAKELONG(hittest, WM_MOUSEMOVE)); - return hittest; -} - -#define ON_LEFT_BORDER(hit) \ - (((hit) == HTLEFT) || ((hit) == HTTOPLEFT) || ((hit) == HTBOTTOMLEFT)) -#define ON_RIGHT_BORDER(hit) \ - (((hit) == HTRIGHT) || ((hit) == HTTOPRIGHT) || ((hit) == HTBOTTOMRIGHT)) -#define ON_TOP_BORDER(hit) \ - (((hit) == HTTOP) || ((hit) == HTTOPLEFT) || ((hit) == HTTOPRIGHT)) -#define ON_BOTTOM_BORDER(hit) \ - (((hit) == HTBOTTOM) || ((hit) == HTBOTTOMLEFT) || ((hit) == HTBOTTOMRIGHT)) - -static VOID -UserDrawWindowFrame(HDC hdc, const RECT *rect, - ULONG width, ULONG height) -{ - HBRUSH hbrush = SelectObject( hdc, gpsi->hbrGray ); - - PatBlt( hdc, rect->left, rect->top, - rect->right - rect->left - width, height, PATINVERT ); - PatBlt( hdc, rect->left, rect->top + height, width, - rect->bottom - rect->top - height, PATINVERT ); - PatBlt( hdc, rect->left + width, rect->bottom - 1, - rect->right - rect->left - width, -height, PATINVERT ); - PatBlt( hdc, rect->right - 1, rect->top, -width, - rect->bottom - rect->top - height, PATINVERT ); - SelectObject( hdc, hbrush ); -} - -static VOID -UserDrawMovingFrame(HDC hdc, RECT *rect, BOOL thickframe) -{ - if(thickframe) - { - UserDrawWindowFrame(hdc, rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME)); - } - else - { - UserDrawWindowFrame(hdc, rect, 1, 1); - } -} - -static VOID -DefWndDoSizeMove(HWND hwnd, WORD wParam) -{ - HRGN DesktopRgn; - MSG msg; - RECT sizingRect, mouseRect, origRect, clipRect, unmodRect; - HDC hdc; - LONG hittest = (LONG)(wParam & 0x0f); - HCURSOR hDragCursor = 0, hOldCursor = 0; - POINT minTrack, maxTrack; - POINT capturePoint, pt; - ULONG Style, ExStyle; - BOOL thickframe; - BOOL iconic; - BOOL moved = FALSE; - DWORD dwPoint = GetMessagePos(); - BOOL DragFullWindows = FALSE; - HWND hWndParent = NULL; - PWND Wnd; - WPARAM syscommand = wParam & 0xfff0; - HMONITOR mon = 0; - - Wnd = ValidateHwnd(hwnd); - if (!Wnd) - return; - - Style = Wnd->style; - ExStyle = Wnd->ExStyle; - iconic = (Style & WS_MINIMIZE) != 0; - - // - // Show window contents while dragging the window, get flag from registry data. - // - SystemParametersInfoW(SPI_GETDRAGFULLWINDOWS, 0, &DragFullWindows, 0); - - pt.x = GET_X_LPARAM(dwPoint); - pt.y = GET_Y_LPARAM(dwPoint); - capturePoint = pt; - - TRACE("hwnd %p command %04lx, hittest %d, pos %d,%d\n", - hwnd, syscommand, hittest, pt.x, pt.y); - - if ((Style & WS_MAXIMIZE) || !IsWindowVisible(hwnd)) return; - - thickframe = UserHasThickFrameStyle(Style, ExStyle) && !iconic; - - if (syscommand == SC_MOVE) - { - ERR("SC_MOVE\n"); - if (!hittest) hittest = DefWndStartSizeMove(hwnd, Wnd, wParam, &capturePoint); - if (!hittest) return; - } - else /* SC_SIZE */ - { - if (!thickframe) return; - if (hittest && (syscommand != SC_MOUSEMENU)) - { - hittest += (HTLEFT - WMSZ_LEFT); - } - else - { - SetCapture(hwnd); - hittest = DefWndStartSizeMove(hwnd, Wnd, wParam, &capturePoint); - if (!hittest) - { - ReleaseCapture(); - return; - } - } - } - - /* Get min/max info */ - - WinPosGetMinMaxInfo(hwnd, NULL, NULL, &minTrack, &maxTrack); - sizingRect = Wnd->rcWindow; - ERR("x %d y %d X %d Y %d\n",pt.x,pt.y,sizingRect.left,sizingRect.top); - if (Style & WS_CHILD) - { - hWndParent = GetParent(hwnd); - MapWindowPoints( 0, hWndParent, (LPPOINT)&sizingRect, 2 ); - unmodRect = sizingRect; - GetClientRect(hWndParent, &mouseRect ); - clipRect = mouseRect; - MapWindowPoints(hWndParent, HWND_DESKTOP, (LPPOINT)&clipRect, 2); - } - else - { - if(!(ExStyle & WS_EX_TOPMOST)) - { - SystemParametersInfoW(SPI_GETWORKAREA, 0, &clipRect, 0); - mouseRect = clipRect; - } - else - { - SetRect(&mouseRect, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); - clipRect = mouseRect; - } - mon = MonitorFromPoint( pt, MONITOR_DEFAULTTONEAREST ); - unmodRect = sizingRect; - } - ClipCursor(&clipRect); - - origRect = sizingRect; - if (ON_LEFT_BORDER(hittest)) - { - mouseRect.left = max( mouseRect.left, sizingRect.right-maxTrack.x ); - mouseRect.right = min( mouseRect.right, sizingRect.right-minTrack.x ); - } - else if (ON_RIGHT_BORDER(hittest)) - { - mouseRect.left = max( mouseRect.left, sizingRect.left+minTrack.x ); - mouseRect.right = min( mouseRect.right, sizingRect.left+maxTrack.x ); - } - if (ON_TOP_BORDER(hittest)) - { - mouseRect.top = max( mouseRect.top, sizingRect.bottom-maxTrack.y ); - mouseRect.bottom = min( mouseRect.bottom,sizingRect.bottom-minTrack.y); - } - else if (ON_BOTTOM_BORDER(hittest)) - { - mouseRect.top = max( mouseRect.top, sizingRect.top+minTrack.y ); - mouseRect.bottom = min( mouseRect.bottom, sizingRect.top+maxTrack.y ); - } - if (Style & WS_CHILD) - { - MapWindowPoints( hWndParent, 0, (LPPOINT)&mouseRect, 2 ); - } - - IntNotifyWinEvent( EVENT_SYSTEM_MOVESIZESTART, hwnd, OBJID_WINDOW, CHILDID_SELF, 0); - SendMessageW( hwnd, WM_ENTERSIZEMOVE, 0, 0 ); - NtUserxSetGUIThreadHandle(MSQ_STATE_MOVESIZE, hwnd); - if (GetCapture() != hwnd) SetCapture( hwnd ); - - if (Style & WS_CHILD) - { - /* Retrieve a default cache DC (without using the window style) */ - hdc = GetDCEx(hWndParent, 0, DCX_CACHE); - DesktopRgn = NULL; - } - else - { - hdc = GetDC( 0 ); - DesktopRgn = CreateRectRgnIndirect(&clipRect); - } - - SelectObject(hdc, DesktopRgn); - - if( iconic ) /* create a cursor for dragging */ - { - HICON hIcon = (HICON)GetClassLongPtrW(hwnd, GCL_HICON); - if(!hIcon) hIcon = (HICON)SendMessageW( hwnd, WM_QUERYDRAGICON, 0, 0L); - if( hIcon ) hDragCursor = CursorIconToCursor( hIcon, TRUE ); - if( !hDragCursor ) iconic = FALSE; - } - - /* invert frame if WIN31_LOOK to indicate mouse click on caption */ - if( !iconic && !DragFullWindows) - { - UserDrawMovingFrame( hdc, &sizingRect, thickframe); - } - - for(;;) - { - int dx = 0, dy = 0; - - if (!GetMessageW(&msg, 0, 0, 0)) break; - if (CallMsgFilterW( &msg, MSGF_SIZE )) continue; - - /* Exit on button-up, Return, or Esc */ - if ((msg.message == WM_LBUTTONUP) || - ((msg.message == WM_KEYDOWN) && - ((msg.wParam == VK_RETURN) || (msg.wParam == VK_ESCAPE)))) break; - - if (msg.message == WM_PAINT) - { - if(!iconic && !DragFullWindows) UserDrawMovingFrame( hdc, &sizingRect, thickframe ); - UpdateWindow( msg.hwnd ); - if(!iconic && !DragFullWindows) UserDrawMovingFrame( hdc, &sizingRect, thickframe ); - continue; - } - - if ((msg.message != WM_KEYDOWN) && (msg.message != WM_MOUSEMOVE)) - { - TranslateMessage( &msg ); - DispatchMessageW( &msg ); - continue; /* We are not interested in other messages */ - } - - pt = msg.pt; - - if (msg.message == WM_KEYDOWN) switch(msg.wParam) - { - case VK_UP: pt.y -= 8; break; - case VK_DOWN: pt.y += 8; break; - case VK_LEFT: pt.x -= 8; break; - case VK_RIGHT: pt.x += 8; break; - } - - pt.x = max( pt.x, mouseRect.left ); - pt.x = min( pt.x, mouseRect.right - 1 ); - pt.y = max( pt.y, mouseRect.top ); - pt.y = min( pt.y, mouseRect.bottom - 1 ); - - if (!hWndParent) - { - HMONITOR newmon; - MONITORINFO info; - - if ((newmon = MonitorFromPoint( pt, MONITOR_DEFAULTTONULL ))) - mon = newmon; - - info.cbSize = sizeof(info); - if (mon && GetMonitorInfoW( mon, &info )) - { - pt.x = max( pt.x, info.rcWork.left ); - pt.x = min( pt.x, info.rcWork.right - 1 ); - pt.y = max( pt.y, info.rcWork.top ); - pt.y = min( pt.y, info.rcWork.bottom - 1 ); - } - } - - dx = pt.x - capturePoint.x; - dy = pt.y - capturePoint.y; - - if (dx || dy) - { - if( !moved ) - { - moved = TRUE; - - if( iconic ) /* ok, no system popup tracking */ - { - hOldCursor = SetCursor(hDragCursor); - ShowCursor( TRUE ); - } - } - - if (msg.message == WM_KEYDOWN) SetCursorPos( pt.x, pt.y ); - else - { - RECT newRect = unmodRect; - - if (hittest == HTCAPTION) OffsetRect( &newRect, dx, dy ); - if (ON_LEFT_BORDER(hittest)) newRect.left += dx; - else if (ON_RIGHT_BORDER(hittest)) newRect.right += dx; - if (ON_TOP_BORDER(hittest)) newRect.top += dy; - else if (ON_BOTTOM_BORDER(hittest)) newRect.bottom += dy; - if(!iconic && !DragFullWindows) UserDrawMovingFrame( hdc, &sizingRect, thickframe ); - capturePoint = pt; - - /* determine the hit location */ - unmodRect = newRect; - if (syscommand == SC_SIZE) - { - WPARAM wpSizingHit = 0; - - if (hittest >= HTLEFT && hittest <= HTBOTTOMRIGHT) - wpSizingHit = WMSZ_LEFT + (hittest - HTLEFT); - SendMessageW( hwnd, WM_SIZING, wpSizingHit, (LPARAM)&newRect ); - } - else - SendMessageW( hwnd, WM_MOVING, 0, (LPARAM)&newRect ); - - if (!iconic) - { - if(!DragFullWindows) - UserDrawMovingFrame( hdc, &newRect, thickframe ); - else - { /* To avoid any deadlocks, all the locks on the windows - structures must be suspended before the SetWindowPos */ - //ERR("SWP 1\n"); - SetWindowPos( hwnd, 0, newRect.left, newRect.top, - newRect.right - newRect.left, - newRect.bottom - newRect.top, - ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ); - } - } - sizingRect = newRect; - } - } - } - - ReleaseCapture(); - ClipCursor(NULL); - if( iconic ) - { - if( moved ) /* restore cursors, show icon title later on */ - { - ShowCursor( FALSE ); - SetCursor( hOldCursor ); - } - DestroyCursor( hDragCursor ); - } - else if(!DragFullWindows) - UserDrawMovingFrame( hdc, &sizingRect, thickframe ); - - if (Style & WS_CHILD) - ReleaseDC( hWndParent, hdc ); - else - { - ReleaseDC( 0, hdc ); - if(DesktopRgn) - { - DeleteObject(DesktopRgn); - } - } - //// This causes the mdi child window to jump up when it is moved. - //if (hWndParent) MapWindowPoints( 0, hWndParent, (POINT *)&sizingRect, 2 ); - - if (ISITHOOKED(WH_CBT)) - { - LRESULT lResult; - NtUserMessageCall( hwnd, WM_CBT, HCBT_MOVESIZE, (LPARAM)&sizingRect, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, FALSE); - if (lResult) moved = FALSE; - } - - NtUserxSetGUIThreadHandle(MSQ_STATE_MOVESIZE, NULL); - SendMessageW( hwnd, WM_EXITSIZEMOVE, 0, 0 ); - SendMessageW( hwnd, WM_SETVISIBLE, !IsIconic(hwnd), 0L); - - /* window moved or resized */ - if (moved) - { - /* if the moving/resizing isn't canceled call SetWindowPos - * with the new position or the new size of the window - */ - if (!((msg.message == WM_KEYDOWN) && (msg.wParam == VK_ESCAPE)) ) - { - /* NOTE: SWP_NOACTIVATE prevents document window activation in Word 6 */ - if(!DragFullWindows )//|| iconic) breaks 2 win tests. - { - //ERR("SWP 2\n"); - SetWindowPos( hwnd, 0, sizingRect.left, sizingRect.top, - sizingRect.right - sizingRect.left, - sizingRect.bottom - sizingRect.top, - ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ); - } - } - else - { /* restore previous size/position */ - if(DragFullWindows) - { - //ERR("SWP 3\n"); - SetWindowPos( hwnd, 0, origRect.left, origRect.top, - origRect.right - origRect.left, - origRect.bottom - origRect.top, - ( hittest == HTCAPTION ) ? SWP_NOSIZE : 0 ); - } - } - } - - if( IsWindow(hwnd) ) - if( iconic ) - { - /* Single click brings up the system menu when iconized */ - if( !moved ) - { - if( Style & WS_SYSMENU ) - SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, MAKELONG(pt.x,pt.y)); - } - } -} - - /*********************************************************************** * DefWndTrackScrollBar * @@ -785,7 +263,6 @@ LRESULT WINAPI DoAppSwitch( WPARAM wParam, LPARAM lParam); LRESULT DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { -// WINDOWPLACEMENT wp; POINT Pt; LRESULT lResult; @@ -801,8 +278,9 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) { case SC_MOVE: case SC_SIZE: - DefWndDoSizeMove(hWnd, wParam); + NtUserMessageCall( hWnd, WM_SYSCOMMAND, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, FALSE); break; + case SC_MINIMIZE: if (hWnd == GetActiveWindow()) ShowOwnedPopups(hWnd,FALSE); @@ -823,6 +301,7 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) case SC_CLOSE: return SendMessageW(hWnd, WM_CLOSE, 0, 0); + // case SC_DEFAULT: case SC_MOUSEMENU: { @@ -887,65 +366,6 @@ DefWndHandleSysCommand(HWND hWnd, WPARAM wParam, LPARAM lParam) return(0); } -#if 0 // Move to Win32k -LRESULT -DefWndHandleWindowPosChanging(HWND hWnd, WINDOWPOS* Pos) -{ - POINT maxTrack, minTrack; - LONG style = GetWindowLongPtrA(hWnd, GWL_STYLE); - - if (Pos->flags & SWP_NOSIZE) return 0; - if ((style & WS_THICKFRAME) || ((style & (WS_POPUP | WS_CHILD)) == 0)) - { - WinPosGetMinMaxInfo(hWnd, NULL, NULL, &minTrack, &maxTrack); - Pos->cx = min(Pos->cx, maxTrack.x); - Pos->cy = min(Pos->cy, maxTrack.y); - if (!(style & WS_MINIMIZE)) - { - if (Pos->cx < minTrack.x) Pos->cx = minTrack.x; - if (Pos->cy < minTrack.y) Pos->cy = minTrack.y; - } - } - else - { - Pos->cx = max(Pos->cx, 0); - Pos->cy = max(Pos->cy, 0); - } - return 0; -} - -LRESULT -DefWndHandleWindowPosChanged(HWND hWnd, WINDOWPOS* Pos) -{ - RECT Rect; - - GetClientRect(hWnd, &Rect); - MapWindowPoints(hWnd, (GetWindowLongPtrW(hWnd, GWL_STYLE) & WS_CHILD ? - GetParent(hWnd) : NULL), (LPPOINT) &Rect, 2); - - if (! (Pos->flags & SWP_NOCLIENTMOVE)) - { - SendMessageW(hWnd, WM_MOVE, 0, MAKELONG(Rect.left, Rect.top)); - } - - if (! (Pos->flags & SWP_NOCLIENTSIZE)) - { - WPARAM wp = SIZE_RESTORED; - if (IsZoomed(hWnd)) - { - wp = SIZE_MAXIMIZED; - } - else if (IsIconic(hWnd)) - { - wp = SIZE_MINIMIZED; - } - SendMessageW(hWnd, WM_SIZE, wp, - MAKELONG(Rect.right - Rect.left, Rect.bottom - Rect.top)); - } - - return 0; -} -#endif /*********************************************************************** * DefWndControlColor @@ -1032,7 +452,7 @@ LRESULT FASTCALL DefWndSetIcon(PWND pWnd, WPARAM wParam, LPARAM lParam) { HICON hIcon, hIconSmall, hIconOld; - + if ( wParam > ICON_SMALL2 ) { SetLastError(ERROR_INVALID_PARAMETER); @@ -1195,17 +615,7 @@ User32DefWindowProc(HWND hWnd, { return (DefWndNCLButtonDblClk(hWnd, wParam, lParam)); } -/* Moved to Win32k - case WM_WINDOWPOSCHANGING: - { - return (DefWndHandleWindowPosChanging(hWnd, (WINDOWPOS*)lParam)); - } - case WM_WINDOWPOSCHANGED: - { - return (DefWndHandleWindowPosChanged(hWnd, (WINDOWPOS*)lParam)); - } -*/ case WM_NCRBUTTONDOWN: return NC_HandleNCRButtonDown( hWnd, wParam, lParam ); @@ -1344,34 +754,7 @@ User32DefWindowProc(HWND hWnd, } return (0); } -/* Moved to Win32k - case WM_SYNCPAINT: - { - HRGN hRgn; - hRgn = CreateRectRgn(0, 0, 0, 0); - if (GetUpdateRgn(hWnd, hRgn, FALSE) != NULLREGION) - { - RedrawWindow(hWnd, NULL, hRgn, - RDW_ERASENOW | RDW_ERASE | RDW_FRAME | - RDW_ALLCHILDREN); - } - DeleteObject(hRgn); - return (0); - } - case WM_SETREDRAW: - { - LONG_PTR Style = GetWindowLongPtrW(hWnd, GWL_STYLE); - if (wParam) SetWindowLongPtr(hWnd, GWL_STYLE, Style | WS_VISIBLE); - else - { - RedrawWindow(hWnd, NULL, 0, RDW_ALLCHILDREN | RDW_VALIDATE); - Style &= ~WS_VISIBLE; - SetWindowLongPtr(hWnd, GWL_STYLE, Style); - } - return (0); - } -*/ case WM_CLOSE: DestroyWindow(hWnd); return (0); @@ -1885,6 +1268,7 @@ User32DefWindowProc(HWND hWnd, case WM_SETHOTKEY: case WM_WINDOWPOSCHANGING: case WM_WINDOWPOSCHANGED: + case WM_APPCOMMAND: { LRESULT lResult; NtUserMessageCall( hWnd, Msg, wParam, lParam, (ULONG_PTR)&lResult, FNID_DEFWINDOWPROC, !bUnicode); From b07e61e478f5c23bc515fc1a589200643b213931 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 14 Apr 2014 05:43:02 +0000 Subject: [PATCH 324/419] [User32] - Patch by Victor Martinez Calvo : Fix Invalid parameter handling in GetMenuInfo and SetLastError. Modified handle validation by me. See CORE-8064. - Moved code and added a non-client create function ID. svn path=/trunk/; revision=62746 --- reactos/win32ss/user/user32/windows/menu.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/menu.c b/reactos/win32ss/user/user32/windows/menu.c index 2446ae3ba64..c051f69dd44 100644 --- a/reactos/win32ss/user/user32/windows/menu.c +++ b/reactos/win32ss/user/user32/windows/menu.c @@ -1147,9 +1147,8 @@ static void FASTCALL MenuDrawMenuItem(HWND hWnd, PROSMENUINFO MenuInfo, HWND Wnd if ( (Wnd->style & WS_MINIMIZE)) { UserGetInsideRectNC(Wnd, &rect); - UserDrawSysMenuButton(hWnd, hdc, &rect, - lpitem->fState & (MF_HILITE | MF_MOUSESELECT)); - } + UserDrawSysMenuButton(hWnd, hdc, &rect, lpitem->fState & (MF_HILITE | MF_MOUSESELECT)); + } return; } @@ -1816,6 +1815,10 @@ LRESULT WINAPI PopupMenuWndProcA(HWND Wnd, UINT Message, WPARAM wParam, LPARAM l { if (!pWnd->fnid) { + if (Message != WM_NCCREATE) + { + return DefWindowProcA(Wnd, Message, wParam, lParam); + } NtUserSetWindowFNID(Wnd, FNID_MENU); } else @@ -4264,9 +4267,16 @@ GetMenuInfo(HMENU hmenu, { ROSMENUINFO mi; BOOL res = FALSE; + PVOID pMenu; - if(!lpcmi || (lpcmi->cbSize != sizeof(MENUINFO))) - return FALSE; + if (!(pMenu = ValidateHandle(hmenu, TYPE_MENU))) + return FALSE; + + if (!lpcmi || (lpcmi->cbSize != sizeof(MENUINFO))) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } RtlZeroMemory(&mi, sizeof(MENUINFO)); mi.cbSize = sizeof(MENUINFO); From 52fbc79cd63ce5cbefb19515b9c0c3531706c63a Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 14 Apr 2014 06:05:34 +0000 Subject: [PATCH 325/419] [User32] - Fixed get menu info, check parameters first than the handle. See CORE-8064. svn path=/trunk/; revision=62747 --- reactos/win32ss/user/user32/windows/menu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/menu.c b/reactos/win32ss/user/user32/windows/menu.c index c051f69dd44..d3eeae860bc 100644 --- a/reactos/win32ss/user/user32/windows/menu.c +++ b/reactos/win32ss/user/user32/windows/menu.c @@ -4269,15 +4269,15 @@ GetMenuInfo(HMENU hmenu, BOOL res = FALSE; PVOID pMenu; - if (!(pMenu = ValidateHandle(hmenu, TYPE_MENU))) - return FALSE; - if (!lpcmi || (lpcmi->cbSize != sizeof(MENUINFO))) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } + if (!(pMenu = ValidateHandle(hmenu, TYPE_MENU))) + return FALSE; + RtlZeroMemory(&mi, sizeof(MENUINFO)); mi.cbSize = sizeof(MENUINFO); mi.fMask = lpcmi->fMask; From 90e1c4d5bc5ff81fa0068be33398f031e1a7c1af Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 14 Apr 2014 06:54:41 +0000 Subject: [PATCH 326/419] [Win32k] - Switch menu allocation to desktop stack. svn path=/trunk/; revision=62748 --- reactos/win32ss/user/ntuser/object.c | 4 ++-- reactos/win32ss/user/user32/misc/misc.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/win32ss/user/ntuser/object.c b/reactos/win32ss/user/ntuser/object.c index 4f7f1da4257..a7de628ff87 100644 --- a/reactos/win32ss/user/ntuser/object.c +++ b/reactos/win32ss/user/ntuser/object.c @@ -337,7 +337,7 @@ UserCreateObject( PUSER_HANDLE_TABLE ht, switch (type) { case TYPE_WINDOW: -// case TYPE_MENU: + case TYPE_MENU: case TYPE_HOOK: case TYPE_CALLPROC: case TYPE_INPUTCONTEXT: @@ -436,7 +436,7 @@ UserDereferenceObject(PVOID object) switch (type) { case TYPE_WINDOW: -// case TYPE_MENU: + case TYPE_MENU: case TYPE_HOOK: case TYPE_CALLPROC: case TYPE_INPUTCONTEXT: diff --git a/reactos/win32ss/user/user32/misc/misc.c b/reactos/win32ss/user/user32/misc/misc.c index 154986348c1..5d97031b6ae 100644 --- a/reactos/win32ss/user/user32/misc/misc.c +++ b/reactos/win32ss/user/user32/misc/misc.c @@ -311,7 +311,7 @@ static const BOOL g_ObjectHeapTypeShared[TYPE_CTYPES] = { FALSE, /* TYPE_FREE (not used) */ FALSE, /* TYPE_WINDOW */ - TRUE, /* TYPE_MENU FALSE */ + FALSE, /* TYPE_MENU */ TRUE, /* TYPE_CURSOR */ TRUE, /* TYPE_SETWINDOWPOS */ FALSE, /* TYPE_HOOK */ @@ -324,7 +324,7 @@ static const BOOL g_ObjectHeapTypeShared[TYPE_CTYPES] = TRUE, /* TYPE_MONITOR */ FALSE, /* TYPE_KBDLAYOUT */ FALSE, /* TYPE_KBDFILE */ - TRUE, /* TYPE_WINEVENTHOOK */ + TRUE, /* TYPE_WINEVENTHOOK */ FALSE, /* TYPE_TIMER */ FALSE, /* TYPE_INPUTCONTEXT */ FALSE, /* TYPE_HIDDATA */ From b66792a4bb6a93286ebe23f643fe19a4720223cc Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 14 Apr 2014 20:23:17 +0000 Subject: [PATCH 327/419] [User32] - Patch by Nikolay Sivov : Fix Edit margins calculation for empty client area case. - Patch by Akihiro Sagawa : Emit EM_SETSEL message when choosing "Select All" from context menu. Don' t emit WM_COMMAND on choosing an item in a context menu (Edit control). svn path=/trunk/; revision=62749 --- reactos/win32ss/user/user32/controls/edit.c | 57 +++++---------------- 1 file changed, 13 insertions(+), 44 deletions(-) diff --git a/reactos/win32ss/user/user32/controls/edit.c b/reactos/win32ss/user/user32/controls/edit.c index 30aa88f9b9d..b5ea7e34a3f 100644 --- a/reactos/win32ss/user/user32/controls/edit.c +++ b/reactos/win32ss/user/user32/controls/edit.c @@ -2918,7 +2918,7 @@ static void EDIT_EM_SetMargins(EDITSTATE *es, INT action, default_right_margin = tm.tmAveCharWidth / 2; min_size = calc_min_set_margin_size(dc, default_left_margin, default_right_margin); GetClientRect(es->hwndSelf, &rc); - if(rc.right - rc.left < min_size) { + if (!IsRectEmpty(&rc) && (rc.right - rc.left < min_size)) { default_left_margin = es->left_margin; default_right_margin = es->right_margin; } @@ -3252,17 +3252,14 @@ static LRESULT EDIT_WM_Char(EDITSTATE *es, WCHAR c) return 1; } -#if 0 // Removed see Revision 43925 comments. + /********************************************************************* * - * WM_COMMAND + * EDIT_ContextMenuCommand * */ -static void EDIT_WM_Command(EDITSTATE *es, INT code, INT id, HWND control) +static void EDIT_ContextMenuCommand(EDITSTATE *es, UINT id) { - if (code || control) - return; - switch (id) { case EM_UNDO: SendMessageW(es->hwndSelf, WM_UNDO, 0, 0); @@ -3280,15 +3277,13 @@ static void EDIT_WM_Command(EDITSTATE *es, INT code, INT id, HWND control) SendMessageW(es->hwndSelf, WM_CLEAR, 0, 0); break; case EM_SETSEL: - EDIT_EM_SetSel(es, 0, (UINT)-1, FALSE); - EDIT_EM_ScrollCaret(es); + SendMessageW(es->hwndSelf, EM_SETSEL, 0, -1); break; default: ERR("unknown menu item, please report\n"); break; } } -#endif /********************************************************************* @@ -3313,8 +3308,8 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y) HMENU popup = GetSubMenu(menu, 0); UINT start = es->selection_start; UINT end = es->selection_end; + UINT cmd; - BOOL selectedItem; // reactos r40667 ORDER_UINT(start, end); /* undo */ @@ -3345,34 +3340,12 @@ static void EDIT_WM_ContextMenu(EDITSTATE *es, INT x, INT y) if (!(es->flags & EF_FOCUSED)) SetFocus(es->hwndSelf); -#ifdef __REACTOS__ // r40667 - selectedItem = TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, x, y, 0, es->hwndSelf, NULL); - // Added see Revision 43925 comments. - switch (selectedItem) { - case EM_UNDO: - SendMessageW(es->hwndSelf, WM_UNDO, 0, 0); - break; - case WM_CUT: - SendMessageW(es->hwndSelf, WM_CUT, 0, 0); - break; - case WM_COPY: - SendMessageW(es->hwndSelf, WM_COPY, 0, 0); - break; - case WM_PASTE: - SendMessageW(es->hwndSelf, WM_PASTE, 0, 0); - break; - case WM_CLEAR: - SendMessageW(es->hwndSelf, WM_CLEAR, 0, 0); - break; - case EM_SETSEL: - EDIT_EM_SetSel(es, 0, (UINT)-1, FALSE); - EDIT_EM_ScrollCaret(es); - break; - default: - ERR("unknown menu item, please report\n"); - break; - } -#endif + cmd = TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD | TPM_NONOTIFY, + x, y, 0, es->hwndSelf, NULL); + + if (cmd) + EDIT_ContextMenuCommand(es, cmd); + DestroyMenu(menu); } @@ -5049,11 +5022,7 @@ LRESULT WINAPI EditWndProc_common( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_CLEAR: EDIT_WM_Clear(es); break; -#if 0 // Removed see Revision 43925 comments. - case WM_COMMAND: - EDIT_WM_Command(es, HIWORD(wParam), LOWORD(wParam), (HWND)lParam); - break; -#endif + case WM_CONTEXTMENU: EDIT_WM_ContextMenu(es, (short)LOWORD(lParam), (short)HIWORD(lParam)); break; From 9b7d5bcdff810c61b86ad05116628a73f4447a82 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Mon, 14 Apr 2014 20:26:59 +0000 Subject: [PATCH 328/419] [WineTests|User32] - Sync Edit to wine head. svn path=/trunk/; revision=62750 --- rostests/winetests/user32/edit.c | 110 +++++++++++++++++++++++++++++-- 1 file changed, 106 insertions(+), 4 deletions(-) diff --git a/rostests/winetests/user32/edit.c b/rostests/winetests/user32/edit.c index 336db407c35..e5c05db574b 100755 --- a/rostests/winetests/user32/edit.c +++ b/rostests/winetests/user32/edit.c @@ -1299,6 +1299,7 @@ static void test_edit_control_5(void) len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); ok(lstrlenA(str) == len, "text shouldn't have been truncated\n"); DestroyWindow(hWnd); + DestroyWindow(parentWnd); } /* Test WM_GETTEXT processing @@ -1423,6 +1424,8 @@ static void test_margins(void) RECT old_rect, new_rect; INT old_right_margin; DWORD old_margins, new_margins; + LOGFONTA lf; + HFONT hfont; hwEdit = create_editcontrol(WS_BORDER | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0); @@ -1470,6 +1473,46 @@ static void test_margins(void) ok(new_rect.bottom == old_rect.bottom, "The bottom border of the rectangle has changed\n"); DestroyWindow (hwEdit); + + memset(&lf, 0, sizeof(lf)); + lf.lfHeight = -11; + lf.lfWeight = FW_NORMAL; + lf.lfCharSet = DEFAULT_CHARSET; + strcpy(lf.lfFaceName, "Tahoma"); + + hfont = CreateFontIndirectA(&lf); + ok(hfont != NULL, "got %p\n", hfont); + + /* Empty window rectangle */ + hwEdit = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL); + ok(hwEdit != NULL, "got %p\n", hwEdit); + GetClientRect(hwEdit, &old_rect); + ok(IsRectEmpty(&old_rect), "got rect %d,%d-%d,%d\n", old_rect.left, old_rect.top, old_rect.right, old_rect.bottom); + + old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0); + ok(old_margins == 0, "got %x\n", old_margins); + + SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); + old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0); + ok(HIWORD(old_margins) > 0 && LOWORD(old_margins) > 0, "got %d, %d\n", HIWORD(old_margins), LOWORD(old_margins)); + + DestroyWindow(hwEdit); + + /* Size is not enough to display a text, but not empty */ + hwEdit = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, 2, 2, NULL, NULL, NULL, NULL); + ok(hwEdit != NULL, "got %p\n", hwEdit); + GetClientRect(hwEdit, &old_rect); + ok(!IsRectEmpty(&old_rect), "got rect %d,%d-%d,%d\n", old_rect.left, old_rect.top, old_rect.right, old_rect.bottom); + + old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0); + ok(old_margins == 0, "got %x\n", old_margins); + + SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); + old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0); + ok(old_margins == 0, "got %d, %d\n", HIWORD(old_margins), LOWORD(old_margins)); + + DeleteObject(hfont); + DestroyWindow(hwEdit); } static INT CALLBACK find_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) @@ -2132,8 +2175,8 @@ static void test_child_edit_wmkeydown(void) destroy_child_editcontrol(hwEdit); } -static int got_en_setfocus = 0; -static int got_wm_capturechanged = 0; +static BOOL got_en_setfocus = FALSE; +static BOOL got_wm_capturechanged = FALSE; static LRESULT (CALLBACK *p_edit_proc)(HWND, UINT, WPARAM, LPARAM); static LRESULT CALLBACK edit4_wnd_procA(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -2142,14 +2185,14 @@ static LRESULT CALLBACK edit4_wnd_procA(HWND hWnd, UINT msg, WPARAM wParam, LPAR case WM_COMMAND: switch (HIWORD(wParam)) { case EN_SETFOCUS: - got_en_setfocus = 1; + got_en_setfocus = TRUE; break; } break; case WM_CAPTURECHANGED: if (hWnd != (HWND)lParam) { - got_wm_capturechanged = 1; + got_wm_capturechanged = TRUE; pEndMenu(); } break; @@ -2200,9 +2243,49 @@ static LRESULT CALLBACK edit_proc_proxy(HWND hWnd, UINT msg, WPARAM wParam, LPAR return p_edit_proc(hWnd, msg, wParam, lParam); } +struct context_menu_messages +{ + unsigned int wm_command, em_setsel; +}; + +static struct context_menu_messages menu_messages; + +static LRESULT CALLBACK child_edit_menu_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_ENTERIDLE: + if (wParam == MSGF_MENU) { + HWND hwndMenu = (HWND)lParam; + MENUBARINFO mbi = { sizeof(MENUBARINFO) }; + if (pGetMenuBarInfo(hwndMenu, OBJID_CLIENT, 0, &mbi)) { + MENUITEMINFOA mii = { sizeof(MENUITEMINFOA), MIIM_STATE }; + if (GetMenuItemInfoA(mbi.hMenu, EM_SETSEL, FALSE, &mii)) { + if (mii.fState & MFS_HILITE) { + PostMessageA(hwnd, WM_KEYDOWN, VK_RETURN, 0x1c0001); + PostMessageA(hwnd, WM_KEYUP, VK_RETURN, 0x1c0001); + } + else { + PostMessageA(hwnd, WM_KEYDOWN, VK_DOWN, 0x500001); + PostMessageA(hwnd, WM_KEYUP, VK_DOWN, 0x500001); + } + } + } + } + break; + case WM_COMMAND: + menu_messages.wm_command++; + break; + case EM_SETSEL: + menu_messages.em_setsel++; + break; + } + return CallWindowProcA(p_edit_proc, hwnd, msg, wParam, lParam); +} + static void test_contextmenu(void) { HWND hwndMain, hwndEdit; + MSG msg; hwndMain = CreateWindowA(szEditTest4Class, "ET4", WS_OVERLAPPEDWINDOW|WS_VISIBLE, 0, 0, 200, 200, NULL, NULL, hinst, NULL); @@ -2226,6 +2309,25 @@ static void test_contextmenu(void) SendMessageA(hwndEdit, WM_CONTEXTMENU, (WPARAM)hwndEdit, MAKEWORD(10, 10)); } + DestroyWindow (hwndEdit); + + hwndEdit = CreateWindowA("EDIT", "Test Text", + WS_CHILD | WS_BORDER | WS_VISIBLE, + 0, 0, 100, 100, + hwndMain, NULL, hinst, NULL); + memset(&menu_messages, 0, sizeof(menu_messages)); + p_edit_proc = (void*)SetWindowLongPtrA(hwndEdit, GWLP_WNDPROC, + (ULONG_PTR)child_edit_menu_proc); + + SetFocus(hwndEdit); + SendMessageA(hwndEdit, WM_SETTEXT, 0, (LPARAM)"foo"); + SendMessageA(hwndEdit, WM_CONTEXTMENU, (WPARAM)hwndEdit, MAKEWORD(-1, -1)); + while (PeekMessageA(&msg, hwndEdit, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok(menu_messages.wm_command == 0, + "Expected no WM_COMMAND messages, got %d\n", menu_messages.wm_command); + ok(menu_messages.em_setsel == 1, + "Expected 1 EM_SETSEL message, got %d\n", menu_messages.em_setsel); + DestroyWindow (hwndEdit); DestroyWindow (hwndMain); } From 5aaa06b20b2d6872a32cd16fca6bcb9bdcea54b9 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Tue, 15 Apr 2014 02:26:47 +0000 Subject: [PATCH 329/419] - Fix AbiWord Crash when sizing. svn path=/trunk/; revision=62751 --- reactos/win32ss/user/ntuser/callback.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/reactos/win32ss/user/ntuser/callback.c b/reactos/win32ss/user/ntuser/callback.c index 74fb27171f6..3ed610f8bb4 100644 --- a/reactos/win32ss/user/ntuser/callback.c +++ b/reactos/win32ss/user/ntuser/callback.c @@ -97,9 +97,18 @@ IntSetTebWndCallback (HWND * hWnd, PWND * pWnd, PVOID * pActCtx) *pWnd = ClientInfo->CallbackWnd.pWnd; *pActCtx = ClientInfo->CallbackWnd.pActCtx; - ClientInfo->CallbackWnd.hWnd = hWndS; - ClientInfo->CallbackWnd.pWnd = DesktopHeapAddressToUser(Window); - ClientInfo->CallbackWnd.pActCtx = Window->pActCtx; + if (Window) + { + ClientInfo->CallbackWnd.hWnd = hWndS; + ClientInfo->CallbackWnd.pWnd = DesktopHeapAddressToUser(Window); + ClientInfo->CallbackWnd.pActCtx = Window->pActCtx; + } + else //// What if Dispatching WM_SYS/TIMER with NULL window? Fix AbiWord Crash when sizing. + { + ClientInfo->CallbackWnd.hWnd = hWndS; + ClientInfo->CallbackWnd.pWnd = Window; + ClientInfo->CallbackWnd.pActCtx = 0; + } } static VOID From e2ffe74418cd6fe3f6108e17eda88bb11ac04d00 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Tue, 15 Apr 2014 18:03:29 +0000 Subject: [PATCH 330/419] [CPL] - Hide "Open as read-only" checkbox in dialogs where the file is always used read-only. Patch by Ricardo Hanke. CORE-7760 #resolve svn path=/trunk/; revision=62754 --- reactos/dll/cpl/desk/background.c | 2 +- reactos/dll/cpl/main/mouse.c | 2 +- reactos/dll/cpl/mmsys/sounds.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reactos/dll/cpl/desk/background.c b/reactos/dll/cpl/desk/background.c index e0b62963b42..20d2aeaff12 100644 --- a/reactos/dll/cpl/desk/background.c +++ b/reactos/dll/cpl/desk/background.c @@ -493,7 +493,7 @@ OnBrowseButton(HWND hwndDlg, PDATA pData) ofn.lpstrFileTitle = fileTitle; ofn.nMaxFileTitle = 256; ofn.lpstrInitialDir = NULL; - ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; if (GetOpenFileName(&ofn) == TRUE) { diff --git a/reactos/dll/cpl/main/mouse.c b/reactos/dll/cpl/main/mouse.c index 0b8914a6a2f..99a3c6894b6 100644 --- a/reactos/dll/cpl/main/mouse.c +++ b/reactos/dll/cpl/main/mouse.c @@ -852,7 +852,7 @@ BrowseCursor(HWND hwndDlg) ofn.nMaxFile = MAX_PATH; ofn.lpstrInitialDir = _T("%WINDIR%\\Cursors"); ofn.lpstrTitle = szTitle; - ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST; + ofn.Flags = OFN_EXPLORER | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; if (!GetOpenFileName(&ofn)) return FALSE; diff --git a/reactos/dll/cpl/mmsys/sounds.c b/reactos/dll/cpl/mmsys/sounds.c index 3fffd72b208..08f60cf1894 100644 --- a/reactos/dll/cpl/mmsys/sounds.c +++ b/reactos/dll/cpl/mmsys/sounds.c @@ -957,7 +957,7 @@ SoundsDlgProc(HWND hwndDlg, ofn.lpstrFileTitle = L"Search for new sounds"; //FIXME non-nls ofn.nMaxFileTitle = wcslen(ofn.lpstrFileTitle); ofn.lpstrInitialDir = NULL; - ofn.Flags = OFN_FILEMUSTEXIST; + ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; if (GetOpenFileNameW(&ofn) == TRUE) { From df0f048623ac53606220e6ca39a1943b0623f038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 16 Apr 2014 12:30:47 +0000 Subject: [PATCH 331/419] [NTOS:MM] Improve a DPRINT1, for: CORE-8072 #comment Can you please retest with revision >= 62758 ? svn path=/trunk/; revision=62758 --- reactos/ntoskrnl/mm/ARM3/mmsup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/ntoskrnl/mm/ARM3/mmsup.c b/reactos/ntoskrnl/mm/ARM3/mmsup.c index b1e61323562..245acf1a844 100644 --- a/reactos/ntoskrnl/mm/ARM3/mmsup.c +++ b/reactos/ntoskrnl/mm/ARM3/mmsup.c @@ -89,7 +89,8 @@ MmAdjustWorkingSetSize(IN SIZE_T WorkingSetMinimumInBytes, /* Check if the new minimum exceeds the new maximum */ if (MinimumWorkingSetSize > MaximumWorkingSetSize) { - DPRINT1("MinimumWorkingSetSize > MaximumWorkingSetSize\n"); + DPRINT1("MinimumWorkingSetSize (%lu) > MaximumWorkingSetSize (%lu)\n", + MinimumWorkingSetSize, MaximumWorkingSetSize); Status = STATUS_BAD_WORKING_SET_LIMIT; goto Cleanup; } From 2d3fe65c2470d7d4d6c942109f7852ae0a9a8fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Wed, 16 Apr 2014 22:25:29 +0000 Subject: [PATCH 332/419] [KERNEL32] Fix a DPRINT. [CONSRV] Some code reorganization and few fixes. svn path=/trunk/; revision=62760 --- .../dll/win32/kernel32/client/console/init.c | 2 +- .../user/winsrv/consrv/frontends/gui/conwnd.c | 513 ++++++++++-------- .../winsrv/consrv/frontends/gui/guiterm.c | 75 ++- 3 files changed, 316 insertions(+), 274 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/console/init.c b/reactos/dll/win32/kernel32/client/console/init.c index 5c90ddf9c61..1313b77a232 100644 --- a/reactos/dll/win32/kernel32/client/console/init.c +++ b/reactos/dll/win32/kernel32/client/console/init.c @@ -70,7 +70,7 @@ PropDialogHandler(IN LPVOID lpThreadParameter) if (ConsoleLibrary == NULL) { - DPRINT1("Failed to load console.dll"); + DPRINT1("Failed to load console.dll\n"); AlreadyDisplayingProps = FALSE; return STATUS_UNSUCCESSFUL; } diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c index e83c024df97..6e8adfb6231 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/conwnd.c @@ -200,8 +200,8 @@ GetScreenBufferSizeUnits(IN PCONSOLE_SCREEN_BUFFER Buffer, } static VOID -GuiConsoleAppendMenuItems(HMENU hMenu, - const GUICONSOLE_MENUITEM *Items) +AppendMenuItems(HMENU hMenu, + const GUICONSOLE_MENUITEM *Items) { UINT i = 0; WCHAR szMenuString[255]; @@ -221,8 +221,7 @@ GuiConsoleAppendMenuItems(HMENU hMenu, hSubMenu = CreatePopupMenu(); if (hSubMenu != NULL) { - GuiConsoleAppendMenuItems(hSubMenu, - Items[i].SubMenu); + AppendMenuItems(hSubMenu, Items[i].SubMenu); if (!AppendMenuW(hMenu, MF_STRING | MF_POPUP, @@ -254,18 +253,18 @@ GuiConsoleAppendMenuItems(HMENU hMenu, } static VOID -GuiConsoleCreateSysMenu(HWND hWnd) +CreateSysMenu(HWND hWnd) { HMENU hMenu = GetSystemMenu(hWnd, FALSE); if (hMenu != NULL) { - GuiConsoleAppendMenuItems(hMenu, GuiConsoleMainMenuItems); + AppendMenuItems(hMenu, GuiConsoleMainMenuItems); DrawMenuBar(hWnd); } } static VOID -GuiSendMenuEvent(PCONSOLE Console, UINT CmdId) +SendMenuEvent(PCONSOLE Console, UINT CmdId) { INPUT_RECORD er; @@ -277,27 +276,83 @@ GuiSendMenuEvent(PCONSOLE Console, UINT CmdId) } static VOID -GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData); +Copy(PGUI_CONSOLE_DATA GuiData); static VOID -GuiConsolePaste(PGUI_CONSOLE_DATA GuiData); +Paste(PGUI_CONSOLE_DATA GuiData); static VOID -GuiConsoleUpdateSelection(PCONSOLE Console, PCOORD coord); +UpdateSelection(PGUI_CONSOLE_DATA GuiData, PCOORD coord); + static VOID -GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightUnit); +Mark(PGUI_CONSOLE_DATA GuiData) +{ + PCONSOLE Console = GuiData->Console; + PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; + + /* Clear the old selection */ + // UpdateSelection(GuiData, NULL); + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; + + /* Restart a new selection */ + Console->dwSelectionCursor.X = ActiveBuffer->ViewOrigin.X; + Console->dwSelectionCursor.Y = ActiveBuffer->ViewOrigin.Y; + Console->Selection.dwSelectionAnchor = Console->dwSelectionCursor; + UpdateSelection(GuiData, &Console->Selection.dwSelectionAnchor); +} + +static VOID +SelectAll(PGUI_CONSOLE_DATA GuiData) +{ + PCONSOLE Console = GuiData->Console; + PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; + + /* Clear the old selection */ + // UpdateSelection(GuiData, NULL); + Console->Selection.dwFlags = CONSOLE_NO_SELECTION; + + /* + * The selection area extends to the whole screen buffer's width. + */ + Console->Selection.dwSelectionAnchor.X = 0; + Console->Selection.dwSelectionAnchor.Y = 0; + Console->dwSelectionCursor.X = ActiveBuffer->ScreenBufferSize.X - 1; + + /* + * Determine whether the selection must extend to just some part + * (for text-mode screen buffers) or to all of the screen buffer's + * height (for graphics ones). + */ + if (GetType(ActiveBuffer) == TEXTMODE_BUFFER) + { + /* + * We select all the characters from the first line + * to the line where the cursor is positioned. + */ + Console->dwSelectionCursor.Y = ActiveBuffer->CursorPosition.Y; + } + else /* if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) */ + { + /* + * We select all the screen buffer area. + */ + Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1; + } + + /* Restart a new selection */ + Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION; + UpdateSelection(GuiData, &Console->dwSelectionCursor); +} static LRESULT -GuiConsoleHandleSysMenuCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) +OnCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) { LRESULT Ret = TRUE; PCONSOLE Console = GuiData->Console; - PCONSOLE_SCREEN_BUFFER ActiveBuffer; if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) { Ret = FALSE; goto Quit; } - ActiveBuffer = GuiData->ActiveBuffer; /* * In case the selected menu item belongs to the user-reserved menu id range, @@ -306,7 +361,7 @@ GuiConsoleHandleSysMenuCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM */ if (GuiData->CmdIdLow <= (UINT)wParam && (UINT)wParam <= GuiData->CmdIdHigh) { - GuiSendMenuEvent(Console, (UINT)wParam); + SendMenuEvent(Console, (UINT)wParam); goto Unlock_Quit; } @@ -314,68 +369,20 @@ GuiConsoleHandleSysMenuCommand(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM switch (wParam) { case ID_SYSTEM_EDIT_MARK: - { - /* Clear the old selection */ - // GuiConsoleUpdateSelection(Console, NULL); - Console->Selection.dwFlags = CONSOLE_NO_SELECTION; - - /* Restart a new selection */ - Console->dwSelectionCursor.X = ActiveBuffer->ViewOrigin.X; - Console->dwSelectionCursor.Y = ActiveBuffer->ViewOrigin.Y; - Console->Selection.dwSelectionAnchor = Console->dwSelectionCursor; - GuiConsoleUpdateSelection(Console, &Console->Selection.dwSelectionAnchor); - + Mark(GuiData); break; - } case ID_SYSTEM_EDIT_COPY: - GuiConsoleCopy(GuiData); + Copy(GuiData); break; case ID_SYSTEM_EDIT_PASTE: - GuiConsolePaste(GuiData); + Paste(GuiData); break; case ID_SYSTEM_EDIT_SELECTALL: - { - /* Clear the old selection */ - // GuiConsoleUpdateSelection(Console, NULL); - Console->Selection.dwFlags = CONSOLE_NO_SELECTION; - - /* - * The selection area extends to the whole screen buffer's width. - */ - Console->Selection.dwSelectionAnchor.X = 0; - Console->Selection.dwSelectionAnchor.Y = 0; - Console->dwSelectionCursor.X = ActiveBuffer->ScreenBufferSize.X - 1; - - /* - * Determine whether the selection must extend to just some part - * (for text-mode screen buffers) or to all of the screen buffer's - * height (for graphics ones). - */ - if (GetType(ActiveBuffer) == TEXTMODE_BUFFER) - { - /* - * We select all the characters from the first line - * to the line where the cursor is positioned. - */ - Console->dwSelectionCursor.Y = ActiveBuffer->CursorPosition.Y; - } - else /* if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) */ - { - /* - * We select all the screen buffer area. - */ - Console->dwSelectionCursor.Y = ActiveBuffer->ScreenBufferSize.Y - 1; - } - - /* Restart a new selection */ - Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION; - GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); - + SelectAll(GuiData); break; - } case ID_SYSTEM_EDIT_SCROLL: DPRINT1("Scrolling is not handled yet\n"); @@ -416,7 +423,7 @@ GuiGetGuiData(HWND hWnd) } static VOID -GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightUnit) +ResizeConWnd(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightUnit) { PCONSOLE_SCREEN_BUFFER Buff = GuiData->ActiveBuffer; SCROLLINFO sInfo; @@ -468,7 +475,7 @@ GuiConsoleResizeWindow(PGUI_CONSOLE_DATA GuiData, DWORD WidthUnit, DWORD HeightU } static BOOL -GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create) +OnNcCreate(HWND hWnd, LPCREATESTRUCTW Create) { PGUI_CONSOLE_DATA GuiData = (PGUI_CONSOLE_DATA)Create->lpCreateParams; PCONSOLE Console; @@ -477,8 +484,6 @@ GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create) TEXTMETRICW Metrics; SIZE CharSize; - DPRINT("GuiConsoleHandleNcCreate\n"); - if (NULL == GuiData) { DPRINT1("GuiConsoleNcCreate: No GUI data\n"); @@ -556,6 +561,13 @@ GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create) GuiData->hBitmap = NULL; GuiData->hSysPalette = NULL; /* Original system palette */ + /* Update the icons of the window */ + if (GuiData->hIcon != ghDefaultIcon) + { + DefWindowProcW(GuiData->hWindow, WM_SETICON, ICON_BIG , (LPARAM)GuiData->hIcon ); + DefWindowProcW(GuiData->hWindow, WM_SETICON, ICON_SMALL, (LPARAM)GuiData->hIconSm); + } + // FIXME: Keep these instructions here ? /////////////////////////////////// Console->ActiveBuffer->CursorBlinkOn = TRUE; Console->ActiveBuffer->ForceCursorOff = FALSE; @@ -564,14 +576,83 @@ GuiConsoleHandleNcCreate(HWND hWnd, LPCREATESTRUCTW Create) SetWindowLongPtrW(GuiData->hWindow, GWLP_USERDATA, (DWORD_PTR)GuiData); SetTimer(GuiData->hWindow, CONGUI_UPDATE_TIMER, CONGUI_UPDATE_TIME, NULL); - GuiConsoleCreateSysMenu(GuiData->hWindow); + CreateSysMenu(GuiData->hWindow); - DPRINT("GuiConsoleHandleNcCreate - setting start event\n"); + DPRINT("OnNcCreate - setting start event\n"); SetEvent(GuiData->hGuiInitEvent); return (BOOL)DefWindowProcW(GuiData->hWindow, WM_NCCREATE, 0, (LPARAM)Create); } + +BOOL +EnterFullScreen(PGUI_CONSOLE_DATA GuiData); +VOID +LeaveFullScreen(PGUI_CONSOLE_DATA GuiData); +VOID +SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); +VOID +GuiConsoleSwitchFullScreen(PGUI_CONSOLE_DATA GuiData); + +static VOID +OnActivate(PGUI_CONSOLE_DATA GuiData, WPARAM wParam) +{ + PCONSOLE Console = GuiData->Console; + WORD ActivationState = LOWORD(wParam); + + DPRINT1("WM_ACTIVATE - ActivationState = %d\n"); + + if ( ActivationState == WA_ACTIVE || + ActivationState == WA_CLICKACTIVE ) + { + if (GuiData->GuiInfo.FullScreen) + { + EnterFullScreen(GuiData); + // // PostMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_RESTORE, 0); + // SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_RESTORE, 0); + } + } + else // if (ActivationState == WA_INACTIVE) + { + if (GuiData->GuiInfo.FullScreen) + { + SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); + LeaveFullScreen(GuiData); + // // PostMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); + // SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); + } + } + + /* + * When we are in QuickEdit mode, ignore the next mouse signal + * when we are going to be enabled again via the mouse, in order + * to prevent e.g. an erroneous right-click from the user which + * would have as an effect to paste some unwanted text... + */ + if (Console->QuickEdit && (ActivationState == WA_CLICKACTIVE)) + GuiData->IgnoreNextMouseSignal = TRUE; +} + +static VOID +OnFocus(PGUI_CONSOLE_DATA GuiData, BOOL SetFocus) +{ + PCONSOLE Console = GuiData->Console; + INPUT_RECORD er; + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; + + er.EventType = FOCUS_EVENT; + er.Event.FocusEvent.bSetFocus = SetFocus; + ConioProcessInputEvent(Console, &er); + + if (SetFocus) + DPRINT1("TODO: Create console caret\n"); + else + DPRINT1("TODO: Destroy console caret\n"); + + LeaveCriticalSection(&Console->Lock); +} + static VOID SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect) { @@ -587,9 +668,9 @@ SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect) } static VOID -GuiConsoleUpdateSelection(PCONSOLE Console, PCOORD coord) +UpdateSelection(PGUI_CONSOLE_DATA GuiData, PCOORD coord) { - PGUI_CONSOLE_DATA GuiData = Console->TermIFace.Data; + PCONSOLE Console = GuiData->Console; RECT oldRect; SmallRectToRect(GuiData, &oldRect, &Console->Selection.srSelection); @@ -696,7 +777,7 @@ GuiPaintGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, PRECT rcFramebuffer); static VOID -GuiConsoleHandlePaint(PGUI_CONSOLE_DATA GuiData) +OnPaint(PGUI_CONSOLE_DATA GuiData) { BOOL Success = TRUE; PCONSOLE Console = GuiData->Console; @@ -765,6 +846,27 @@ Quit: return; } +static VOID +OnPaletteChanged(PGUI_CONSOLE_DATA GuiData) +{ + PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; + + // See WM_PALETTECHANGED message + // if ((HWND)wParam == hWnd) break; + + // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) + if (ActiveBuffer->PaletteHandle) + { + DPRINT("WM_PALETTECHANGED changing palette\n"); + + /* Specify the use of the system palette for the framebuffer */ + SetSystemPaletteUse(GuiData->hMemDC, ActiveBuffer->PaletteUsage); + + /* Realize the (logical) palette */ + RealizePalette(GuiData->hMemDC); + } +} + static BOOL IsSystemKey(WORD VirtualKeyCode) { @@ -789,7 +891,7 @@ IsSystemKey(WORD VirtualKeyCode) } static VOID -GuiConsoleHandleKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) +OnKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) { PCONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER ActiveBuffer; @@ -807,14 +909,14 @@ GuiConsoleHandleKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM l if (VirtualKeyCode == VK_RETURN) { /* Copy (and clear) selection if ENTER is pressed */ - GuiConsoleCopy(GuiData); + Copy(GuiData); goto Quit; } else if ( VirtualKeyCode == VK_ESCAPE || (VirtualKeyCode == 'C' && GetKeyState(VK_CONTROL) & 0x8000) ) { /* Cancel selection if ESC or Ctrl-C are pressed */ - GuiConsoleUpdateSelection(Console, NULL); + UpdateSelection(GuiData, NULL); goto Quit; } @@ -906,7 +1008,7 @@ GuiConsoleHandleKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM l if (!MajPressed) Console->Selection.dwSelectionAnchor = Console->dwSelectionCursor; - GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); + UpdateSelection(GuiData, &Console->dwSelectionCursor); } else if (!IsSystemKey(VirtualKeyCode)) { @@ -923,7 +1025,7 @@ GuiConsoleHandleKey(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM l if (!IsSystemKey(VirtualKeyCode)) { /* Clear the selection and send the key into the input buffer */ - GuiConsoleUpdateSelection(Console, NULL); + UpdateSelection(GuiData, NULL); } else { @@ -949,12 +1051,13 @@ Quit: } -// FIXME: Remove after fixing GuiConsoleHandleTimer +// FIXME: Remove after fixing OnTimer VOID -GuiInvalidateCell(IN OUT PFRONTEND This, SHORT x, SHORT y); +InvalidateCell(PGUI_CONSOLE_DATA GuiData, + SHORT x, SHORT y); static VOID -GuiConsoleHandleTimer(PGUI_CONSOLE_DATA GuiData) +OnTimer(PGUI_CONSOLE_DATA GuiData) { PCONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER Buff; @@ -967,7 +1070,7 @@ GuiConsoleHandleTimer(PGUI_CONSOLE_DATA GuiData) if (GetType(Buff) == TEXTMODE_BUFFER) { - GuiInvalidateCell(&Console->TermIFace, Buff->CursorPosition.X, Buff->CursorPosition.Y); + InvalidateCell(GuiData, Buff->CursorPosition.X, Buff->CursorPosition.Y); Buff->CursorBlinkOn = !Buff->CursorBlinkOn; if ((GuiData->OldCursor.x != Buff->CursorPosition.X) || @@ -1059,7 +1162,7 @@ GuiConsoleHandleTimer(PGUI_CONSOLE_DATA GuiData) } static BOOL -GuiConsoleHandleClose(PGUI_CONSOLE_DATA GuiData) +OnClose(PGUI_CONSOLE_DATA GuiData) { PCONSOLE Console = GuiData->Console; @@ -1080,7 +1183,7 @@ GuiConsoleHandleClose(PGUI_CONSOLE_DATA GuiData) } static LRESULT -GuiConsoleHandleNcDestroy(HWND hWnd) +OnNcDestroy(HWND hWnd) { PGUI_CONSOLE_DATA GuiData = GuiGetGuiData(hWnd); @@ -1129,7 +1232,7 @@ PointToCoord(PGUI_CONSOLE_DATA GuiData, LPARAM lParam) } static LRESULT -GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) +OnMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM lParam) { BOOL Err = FALSE; PCONSOLE Console = GuiData->Console; @@ -1172,14 +1275,14 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM case WM_LBUTTONDOWN: { /* Clear the old selection */ - // GuiConsoleUpdateSelection(Console, NULL); + // UpdateSelection(GuiData, NULL); Console->Selection.dwFlags = CONSOLE_NO_SELECTION; /* Restart a new selection */ Console->Selection.dwSelectionAnchor = PointToCoord(GuiData, lParam); SetCapture(GuiData->hWindow); Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; - GuiConsoleUpdateSelection(Console, &Console->Selection.dwSelectionAnchor); + UpdateSelection(GuiData, &Console->Selection.dwSelectionAnchor); break; } @@ -1192,7 +1295,7 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM // c = PointToCoord(GuiData, lParam); Console->Selection.dwFlags &= ~CONSOLE_MOUSE_DOWN; - // GuiConsoleUpdateSelection(Console, &c); + // UpdateSelection(GuiData, &c); ReleaseCapture(); break; @@ -1241,7 +1344,7 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM Console->dwSelectionCursor = cR; Console->Selection.dwFlags |= CONSOLE_MOUSE_SELECTION | CONSOLE_MOUSE_DOWN; - GuiConsoleUpdateSelection(Console, &Console->dwSelectionCursor); + UpdateSelection(GuiData, &Console->dwSelectionCursor); /* Ignore the next mouse move signal */ GuiData->IgnoreNextMouseSignal = TRUE; @@ -1255,11 +1358,11 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM { if (!(Console->Selection.dwFlags & CONSOLE_SELECTION_NOT_EMPTY)) { - GuiConsolePaste(GuiData); + Paste(GuiData); } else { - GuiConsoleCopy(GuiData); + Copy(GuiData); } /* Ignore the next mouse move signal */ @@ -1275,7 +1378,7 @@ GuiConsoleHandleMouse(PGUI_CONSOLE_DATA GuiData, UINT msg, WPARAM wParam, LPARAM if (!(Console->Selection.dwFlags & CONSOLE_MOUSE_DOWN)) break; c = PointToCoord(GuiData, lParam); /* TODO: Scroll buffer to bring c into view */ - GuiConsoleUpdateSelection(Console, &c); + UpdateSelection(GuiData, &c); break; } @@ -1426,10 +1529,8 @@ GuiCopyFromGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData); static VOID -GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData) +Copy(PGUI_CONSOLE_DATA GuiData) { - PCONSOLE Console = GuiData->Console; - if (OpenClipboard(GuiData->hWindow) == TRUE) { PCONSOLE_SCREEN_BUFFER Buffer = GuiData->ActiveBuffer; @@ -1447,7 +1548,7 @@ GuiConsoleCopy(PGUI_CONSOLE_DATA GuiData) } /* Clear the selection */ - GuiConsoleUpdateSelection(Console, NULL); + UpdateSelection(GuiData, NULL); } VOID @@ -1458,7 +1559,7 @@ GuiPasteToGraphicsBuffer(PGRAPHICS_SCREEN_BUFFER Buffer, PGUI_CONSOLE_DATA GuiData); static VOID -GuiConsolePaste(PGUI_CONSOLE_DATA GuiData) +Paste(PGUI_CONSOLE_DATA GuiData) { if (OpenClipboard(GuiData->hWindow) == TRUE) { @@ -1478,7 +1579,7 @@ GuiConsolePaste(PGUI_CONSOLE_DATA GuiData) } static VOID -GuiConsoleGetMinMaxInfo(PGUI_CONSOLE_DATA GuiData, PMINMAXINFO minMaxInfo) +OnGetMinMaxInfo(PGUI_CONSOLE_DATA GuiData, PMINMAXINFO minMaxInfo) { PCONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER ActiveBuffer; @@ -1510,7 +1611,7 @@ GuiConsoleGetMinMaxInfo(PGUI_CONSOLE_DATA GuiData, PMINMAXINFO minMaxInfo) } static VOID -GuiConsoleResize(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) +OnSize(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) { PCONSOLE Console = GuiData->Console; @@ -1559,7 +1660,7 @@ GuiConsoleResize(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) Buff->ViewSize.Y = (chary <= Buff->ScreenBufferSize.Y) ? chary : Buff->ScreenBufferSize.Y; } - GuiConsoleResizeWindow(GuiData, WidthUnit, HeightUnit); + ResizeConWnd(GuiData, WidthUnit, HeightUnit); // Adjust the start of the visible area if we are attempting to show nonexistent areas if ((Buff->ScreenBufferSize.X - Buff->ViewOrigin.X) < Buff->ViewSize.X) Buff->ViewOrigin.X = Buff->ScreenBufferSize.X - Buff->ViewSize.X; @@ -1572,6 +1673,25 @@ GuiConsoleResize(PGUI_CONSOLE_DATA GuiData, WPARAM wParam, LPARAM lParam) LeaveCriticalSection(&Console->Lock); } +static VOID +OnMove(PGUI_CONSOLE_DATA GuiData) +{ + PCONSOLE Console = GuiData->Console; + RECT rcWnd; + + if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return; + + // TODO: Simplify the code. + // See: GuiConsoleNotifyWndProc() PM_CREATE_CONSOLE. + + /* Retrieve our real position */ + GetWindowRect(GuiData->hWindow, &rcWnd); + GuiData->GuiInfo.WindowOrigin.x = rcWnd.left; + GuiData->GuiInfo.WindowOrigin.y = rcWnd.top; + + LeaveCriticalSection(&Console->Lock); +} + /* // HACK: This functionality is standard for general scrollbars. Don't add it by hand. @@ -1602,7 +1722,7 @@ GuiConsoleHandleScrollbarMenu(VOID) */ static LRESULT -GuiConsoleHandleScroll(PGUI_CONSOLE_DATA GuiData, UINT uMsg, WPARAM wParam) +OnScroll(PGUI_CONSOLE_DATA GuiData, UINT uMsg, WPARAM wParam) { PCONSOLE Console = GuiData->Console; PCONSOLE_SCREEN_BUFFER Buff; @@ -1710,15 +1830,6 @@ Quit: } -BOOL -EnterFullScreen(PGUI_CONSOLE_DATA GuiData); -VOID -LeaveFullScreen(PGUI_CONSOLE_DATA GuiData); -VOID -SwitchFullScreen(PGUI_CONSOLE_DATA GuiData, BOOL FullScreen); -VOID -GuiConsoleSwitchFullScreen(PGUI_CONSOLE_DATA GuiData); - static LRESULT CALLBACK ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -1734,11 +1845,11 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) */ if (msg == WM_NCCREATE) { - return (LRESULT)GuiConsoleHandleNcCreate(hWnd, (LPCREATESTRUCTW)lParam); + return (LRESULT)OnNcCreate(hWnd, (LPCREATESTRUCTW)lParam); } else if (msg == WM_NCDESTROY) { - return GuiConsoleHandleNcDestroy(hWnd); + return OnNcDestroy(hWnd); } /* @@ -1763,60 +1874,23 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) switch (msg) { case WM_ACTIVATE: - { - WORD ActivationState = LOWORD(wParam); - - DPRINT1("WM_ACTIVATE - ActivationState = %d\n"); - - if ( ActivationState == WA_ACTIVE || - ActivationState == WA_CLICKACTIVE ) - { - if (GuiData->GuiInfo.FullScreen) - { - EnterFullScreen(GuiData); - // // PostMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_RESTORE, 0); - // SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_RESTORE, 0); - } - } - else // if (ActivationState == WA_INACTIVE) - { - if (GuiData->GuiInfo.FullScreen) - { - SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); - LeaveFullScreen(GuiData); - // // PostMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); - // SendMessageW(GuiData->hWindow, WM_SYSCOMMAND, SC_MINIMIZE, 0); - } - } - - /* - * When we are in QuickEdit mode, ignore the next mouse signal - * when we are going to be enabled again via the mouse, in order - * to prevent e.g. an erroneous right-click from the user which - * would have as an effect to paste some unwanted text... - */ - if (Console->QuickEdit && (ActivationState == WA_CLICKACTIVE)) - GuiData->IgnoreNextMouseSignal = TRUE; - + OnActivate(GuiData, wParam); break; - } case WM_CLOSE: - if (GuiConsoleHandleClose(GuiData)) goto Default; + if (OnClose(GuiData)) goto Default; break; case WM_PAINT: - GuiConsoleHandlePaint(GuiData); + OnPaint(GuiData); break; case WM_TIMER: - GuiConsoleHandleTimer(GuiData); + OnTimer(GuiData); break; case WM_PALETTECHANGED: { - PCONSOLE_SCREEN_BUFFER ActiveBuffer = GuiData->ActiveBuffer; - DPRINT("WM_PALETTECHANGED called\n"); /* @@ -1835,21 +1909,8 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) if ((HWND)wParam == hWnd) break; DPRINT("WM_PALETTECHANGED ok\n"); - - // if (GetType(ActiveBuffer) == GRAPHICS_BUFFER) - if (ActiveBuffer->PaletteHandle) - { - DPRINT("WM_PALETTECHANGED changing palette\n"); - - /* Specify the use of the system palette for the framebuffer */ - SetSystemPaletteUse(GuiData->hMemDC, ActiveBuffer->PaletteUsage); - - /* Realize the (logical) palette */ - RealizePalette(GuiData->hMemDC); - } - + OnPaletteChanged(GuiData); DPRINT("WM_PALETTECHANGED quit\n"); - break; } @@ -1872,7 +1933,7 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) break; } - GuiConsoleHandleKey(GuiData, msg, wParam, lParam); + OnKey(GuiData, msg, wParam, lParam); break; } @@ -1937,41 +1998,17 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_MOUSEWHEEL: case WM_MOUSEHWHEEL: { - Result = GuiConsoleHandleMouse(GuiData, msg, wParam, lParam); + Result = OnMouse(GuiData, msg, wParam, lParam); break; } case WM_HSCROLL: case WM_VSCROLL: { - Result = GuiConsoleHandleScroll(GuiData, msg, wParam); + Result = OnScroll(GuiData, msg, wParam); break; } - case WM_NCRBUTTONDOWN: - { - DPRINT1("WM_NCRBUTTONDOWN\n"); - /* - * HACK: !! Because, when we deal with WM_RBUTTON* and we do not - * call after that DefWindowProc, on ReactOS, right-clicks on the - * (non-client) application title-bar does not display the system - * menu and does not trigger a WM_NCRBUTTONUP message too. - * See: http://git.reactos.org/?p=reactos.git;a=blob;f=reactos/win32ss/user/user32/windows/defwnd.c;hb=332bc8f482f40fd05ab510f78276576719fbfba8#l1103 - * and line 1135 too. - */ -#if 0 - if (DefWindowProcW(hWnd, WM_NCHITTEST, 0, lParam) == HTCAPTION) - { - /* Call DefWindowProcW with the WM_CONTEXTMENU message */ - msg = WM_CONTEXTMENU; - } -#endif - goto Default; - } - // case WM_NCRBUTTONUP: - // DPRINT1("WM_NCRBUTTONUP\n"); - // goto Default; - case WM_CONTEXTMENU: { if (DefWindowProcW(hWnd /*GuiData->hWindow*/, WM_NCHITTEST, 0, lParam) == HTCLIENT) @@ -1979,7 +2016,7 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) HMENU hMenu = CreatePopupMenu(); if (hMenu != NULL) { - GuiConsoleAppendMenuItems(hMenu, GuiConsoleEditMenuItems); + AppendMenuItems(hMenu, GuiConsoleEditMenuItems); TrackPopupMenuEx(hMenu, TPM_RIGHTBUTTON, GET_X_LPARAM(lParam), @@ -2018,7 +2055,7 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) { - GuiSendMenuEvent(Console, WM_INITMENU); + SendMenuEvent(Console, WM_INITMENU); LeaveCriticalSection(&Console->Lock); } break; @@ -2030,7 +2067,7 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) { - GuiSendMenuEvent(Console, WM_MENUSELECT); + SendMenuEvent(Console, WM_MENUSELECT); LeaveCriticalSection(&Console->Lock); } } @@ -2040,57 +2077,65 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_COMMAND: case WM_SYSCOMMAND: { - Result = GuiConsoleHandleSysMenuCommand(GuiData, wParam, lParam); + Result = OnCommand(GuiData, wParam, lParam); break; } case WM_SETFOCUS: case WM_KILLFOCUS: - { - if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) - { - BOOL SetFocus = (msg == WM_SETFOCUS); - INPUT_RECORD er; - - er.EventType = FOCUS_EVENT; - er.Event.FocusEvent.bSetFocus = SetFocus; - ConioProcessInputEvent(Console, &er); - - if (SetFocus) - DPRINT1("TODO: Create console caret\n"); - else - DPRINT1("TODO: Destroy console caret\n"); - - LeaveCriticalSection(&Console->Lock); - } + OnFocus(GuiData, (msg == WM_SETFOCUS)); break; - } case WM_GETMINMAXINFO: - GuiConsoleGetMinMaxInfo(GuiData, (PMINMAXINFO)lParam); + OnGetMinMaxInfo(GuiData, (PMINMAXINFO)lParam); break; case WM_MOVE: + OnMove(GuiData); + break; + +#if 0 // This code is here to prepare & control dynamic console SB resizing. + case WM_SIZING: { - if (ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) + PRECT dragRect = (PRECT)lParam; + switch (wParam) { - // TODO: Simplify the code. - // See: GuiConsoleNotifyWndProc() PM_CREATE_CONSOLE. - - RECT rcWnd; - - /* Retrieve our real position */ - GetWindowRect(GuiData->hWindow, &rcWnd); - GuiData->GuiInfo.WindowOrigin.x = rcWnd.left; - GuiData->GuiInfo.WindowOrigin.y = rcWnd.top; - - LeaveCriticalSection(&Console->Lock); + case WMSZ_LEFT: + DPRINT1("WMSZ_LEFT\n"); + break; + case WMSZ_RIGHT: + DPRINT1("WMSZ_RIGHT\n"); + break; + case WMSZ_TOP: + DPRINT1("WMSZ_TOP\n"); + break; + case WMSZ_TOPLEFT: + DPRINT1("WMSZ_TOPLEFT\n"); + break; + case WMSZ_TOPRIGHT: + DPRINT1("WMSZ_TOPRIGHT\n"); + break; + case WMSZ_BOTTOM: + DPRINT1("WMSZ_BOTTOM\n"); + break; + case WMSZ_BOTTOMLEFT: + DPRINT1("WMSZ_BOTTOMLEFT\n"); + break; + case WMSZ_BOTTOMRIGHT: + DPRINT1("WMSZ_BOTTOMRIGHT\n"); + break; + default: + DPRINT1("wParam = %d\n", wParam); + break; } + DPRINT1("dragRect = {.left = %d ; .top = %d ; .right = %d ; .bottom = %d}\n", + dragRect->left, dragRect->top, dragRect->right, dragRect->bottom); break; } +#endif case WM_SIZE: - GuiConsoleResize(GuiData, wParam, lParam); + OnSize(GuiData, wParam, lParam); break; case PM_RESIZE_TERMINAL: @@ -2120,7 +2165,7 @@ ConWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) /* Resize the window to the user's values */ GuiData->WindowSizeLock = TRUE; - GuiConsoleResizeWindow(GuiData, WidthUnit, HeightUnit); + ResizeConWnd(GuiData, WidthUnit, HeightUnit); GuiData->WindowSizeLock = FALSE; break; } diff --git a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c index b68ec12e55d..44ed61a7c65 100644 --- a/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c +++ b/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c @@ -113,14 +113,24 @@ SmallRectToRect(PGUI_CONSOLE_DATA GuiData, PRECT Rect, PSMALL_RECT SmallRect) Rect->bottom = (SmallRect->Bottom + 1 - Buffer->ViewOrigin.Y) * HeightUnit; } -static VOID NTAPI -GuiDrawRegion(IN OUT PFRONTEND This, - SMALL_RECT* Region); +static VOID +DrawRegion(PGUI_CONSOLE_DATA GuiData, + SMALL_RECT* Region) +{ + RECT RegionRect; + + SmallRectToRect(GuiData, &RegionRect, Region); + /* Do not erase the background: it speeds up redrawing and reduce flickering */ + InvalidateRect(GuiData->hWindow, &RegionRect, FALSE); + /**UpdateWindow(GuiData->hWindow);**/ +} + VOID -GuiInvalidateCell(IN OUT PFRONTEND This, SHORT x, SHORT y) +InvalidateCell(PGUI_CONSOLE_DATA GuiData, + SHORT x, SHORT y) { SMALL_RECT CellRect = { x, y, x, y }; - GuiDrawRegion(This, &CellRect); + DrawRegion(GuiData, &CellRect); } @@ -152,6 +162,8 @@ GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) PCONSOLE Console = GuiData->Console; RECT rcWnd; + DPRINT("PM_CREATE_CONSOLE -- creating window\n"); + NewWindow = CreateWindowExW(WS_EX_CLIENTEDGE, GUI_CONWND_CLASS, Console->Title.Buffer, @@ -172,33 +184,26 @@ GuiConsoleNotifyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) WindowCount++; SetWindowLongW(hWnd, GWL_USERDATA, WindowCount); - DPRINT("Set icons via PM_CREATE_CONSOLE\n"); - if (GuiData->hIcon == NULL) - { - DPRINT("Not really /o\\...\n"); - GuiData->hIcon = ghDefaultIcon; - GuiData->hIconSm = ghDefaultIconSm; - } - else if (GuiData->hIcon != ghDefaultIcon) - { - DPRINT("Yes \\o/\n"); - SendMessageW(GuiData->hWindow, WM_SETICON, ICON_BIG, (LPARAM)GuiData->hIcon); - SendMessageW(GuiData->hWindow, WM_SETICON, ICON_SMALL, (LPARAM)GuiData->hIconSm); - } + // + // FIXME: TODO: Move everything there into conwnd.c!OnNcCreate() + // /* Retrieve our real position */ + // See conwnd.c!OnMove() GetWindowRect(GuiData->hWindow, &rcWnd); GuiData->GuiInfo.WindowOrigin.x = rcWnd.left; GuiData->GuiInfo.WindowOrigin.y = rcWnd.top; /* Move and resize the window to the user's values */ /* CAN WE DEADLOCK ?? */ - GuiConsoleMoveWindow(GuiData); + GuiConsoleMoveWindow(GuiData); // FIXME: This MUST be done via the CreateWindowExW call. SendMessageW(GuiData->hWindow, PM_RESIZE_TERMINAL, 0, 0); /* Switch to full-screen mode if necessary */ + // FIXME: Move elsewhere, it cause misdrawings of the window. if (GuiData->GuiInfo.FullScreen) SwitchFullScreen(GuiData, TRUE); + DPRINT("PM_CREATE_CONSOLE -- showing window\n"); // ShowWindow(NewWindow, (int)wParam); ShowWindowAsync(NewWindow, (int)wParam); DPRINT("Window showed\n"); @@ -424,7 +429,7 @@ GuiInitFrontEnd(IN OUT PFRONTEND This, DPRINT1("CONSRV: Failed to create GUI_CONSOLE_DATA\n"); return STATUS_UNSUCCESSFUL; } - /* HACK */ Console->TermIFace.Data = (PVOID)GuiData; /* HACK */ + ///// /* HACK */ Console->TermIFace.Data = (PVOID)GuiData; /* HACK */ GuiData->Console = Console; GuiData->ActiveBuffer = Console->ActiveBuffer; GuiData->hWindow = NULL; @@ -509,13 +514,10 @@ GuiInitFrontEnd(IN OUT PFRONTEND This, &hIconSm, 1); DPRINT("hIcon = 0x%p ; hIconSm = 0x%p\n", hIcon, hIconSm); - if (hIcon != NULL) - { - DPRINT("Effectively set the icons\n"); - GuiData->hIcon = hIcon; - GuiData->hIconSm = hIconSm; - } + if (hIcon != NULL) GuiData->hIcon = hIcon; + if (hIconSm != NULL) GuiData->hIconSm = hIconSm; } + ASSERT(GuiData->hIcon && GuiData->hIconSm); /* Mouse is shown by default with its default cursor shape */ GuiData->hCursor = ghDefaultCursor; @@ -597,12 +599,7 @@ GuiDrawRegion(IN OUT PFRONTEND This, SMALL_RECT* Region) { PGUI_CONSOLE_DATA GuiData = This->Data; - RECT RegionRect; - - SmallRectToRect(GuiData, &RegionRect, Region); - /* Do not erase the background: it speeds up redrawing and reduce flickering */ - InvalidateRect(GuiData->hWindow, &RegionRect, FALSE); - /**UpdateWindow(GuiData->hWindow);**/ + DrawRegion(GuiData, Region); } static VOID NTAPI @@ -641,12 +638,12 @@ GuiWriteStream(IN OUT PFRONTEND This, SW_INVALIDATE); } - GuiDrawRegion(This, Region); + DrawRegion(GuiData, Region); if (CursorStartX < Region->Left || Region->Right < CursorStartX || CursorStartY < Region->Top || Region->Bottom < CursorStartY) { - GuiInvalidateCell(This, CursorStartX, CursorStartY); + InvalidateCell(GuiData, CursorStartX, CursorStartY); } CursorEndX = Buff->CursorPosition.X; @@ -655,7 +652,7 @@ GuiWriteStream(IN OUT PFRONTEND This, || CursorEndY < Region->Top || Region->Bottom < CursorEndY) && (CursorEndX != CursorStartX || CursorEndY != CursorStartY)) { - GuiInvalidateCell(This, CursorEndX, CursorEndY); + InvalidateCell(GuiData, CursorEndX, CursorEndY); } // HACK!! @@ -673,7 +670,7 @@ GuiSetCursorInfo(IN OUT PFRONTEND This, if (GuiData->ActiveBuffer == Buff) { - GuiInvalidateCell(This, Buff->CursorPosition.X, Buff->CursorPosition.Y); + InvalidateCell(GuiData, Buff->CursorPosition.X, Buff->CursorPosition.Y); } return TRUE; @@ -690,9 +687,9 @@ GuiSetScreenInfo(IN OUT PFRONTEND This, if (GuiData->ActiveBuffer == Buff) { /* Redraw char at old position (remove cursor) */ - GuiInvalidateCell(This, OldCursorX, OldCursorY); + InvalidateCell(GuiData, OldCursorX, OldCursorY); /* Redraw char at new position (show cursor) */ - GuiInvalidateCell(This, Buff->CursorPosition.X, Buff->CursorPosition.Y); + InvalidateCell(GuiData, Buff->CursorPosition.X, Buff->CursorPosition.Y); } return TRUE; @@ -884,7 +881,7 @@ GuiChangeIcon(IN OUT PFRONTEND This, GuiData->hIconSm = hIconSm; DPRINT("Set icons in GuiChangeIcon\n"); - PostMessageW(GuiData->hWindow, WM_SETICON, ICON_BIG, (LPARAM)GuiData->hIcon); + PostMessageW(GuiData->hWindow, WM_SETICON, ICON_BIG , (LPARAM)GuiData->hIcon ); PostMessageW(GuiData->hWindow, WM_SETICON, ICON_SMALL, (LPARAM)GuiData->hIconSm); } From e8b645bc30e6d677b47323c5ec6041880a429c59 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Wed, 16 Apr 2014 22:47:40 +0000 Subject: [PATCH 333/419] [LIBWINE] - bring back the old debug output format ie class:(file:line), Testman depends on this svn path=/trunk/; revision=62761 --- reactos/include/reactos/wine/debug.h | 9 ++++++--- reactos/lib/3rdparty/libwine/debug.c | 28 +++++++++++++++++++++++++--- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/reactos/include/reactos/wine/debug.h b/reactos/include/reactos/wine/debug.h index 54ac2c68ac7..2428c89e205 100644 --- a/reactos/include/reactos/wine/debug.h +++ b/reactos/include/reactos/wine/debug.h @@ -91,7 +91,7 @@ struct __wine_debug_channel __WINE_DBG_LOG #define __WINE_DBG_LOG(args...) \ - wine_dbg_log( __dbcl, __dbch, __FUNCTION__, args); } } while(0) + ros_dbg_log( __dbcl, __dbch, __FILE__, __FUNCTION__, __LINE__, args); } } while(0) #define __WINE_PRINTF_ATTR(fmt,args) /*__attribute__((format (printf,fmt,args)))*/ @@ -137,7 +137,7 @@ struct __wine_debug_channel #define __WINE_DPRINTF(dbcl,dbch) \ (!__WINE_GET_DEBUGGING(dbcl,(dbch)) || \ - (wine_dbg_log(__WINE_DBCL##dbcl,(dbch),__FILE__,"%d: ",__LINE__) == -1)) ? \ + (ros_dbg_log(__WINE_DBCL##dbcl,(dbch),__FILE__,"",__LINE__,"") == -1)) ? \ (void)0 : (void)wine_dbg_printf #define __WINE_PRINTF_ATTR(fmt, args) @@ -152,7 +152,7 @@ struct __wine_debug_functions const char * (*dbgstr_wn)( const WCHAR *s, int n ); int (*dbg_vprintf)( const char *format, va_list args ); int (*dbg_vlog)( enum __wine_debug_class cls, struct __wine_debug_channel *channel, - const char *function, const char *format, va_list args ); + const char *file, const char *function, const int line, const char *format, va_list args ); }; extern unsigned char __wine_dbg_get_channel_flags( struct __wine_debug_channel *channel ); @@ -175,6 +175,9 @@ extern const char *wine_dbg_sprintf( const char *format, ... ) __WINE_PRINTF_ATT extern int wine_dbg_printf( const char *format, ... ) __WINE_PRINTF_ATTR(1,2); extern int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *func, const char *format, ... ) __WINE_PRINTF_ATTR(4,5); +/* ReactOS compliant debug format */ +extern int ros_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *file, + const char *func, const int line, const char *format, ... ) __WINE_PRINTF_ATTR(6,7); static __inline const char *wine_dbgstr_a( const char *s ) { diff --git a/reactos/lib/3rdparty/libwine/debug.c b/reactos/lib/3rdparty/libwine/debug.c index b95249cbacc..1bf8dc1c133 100644 --- a/reactos/lib/3rdparty/libwine/debug.c +++ b/reactos/lib/3rdparty/libwine/debug.c @@ -247,7 +247,23 @@ int wine_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *chan if (!(__wine_dbg_get_channel_flags( channel ) & (1 << cls))) return -1; va_start(valist, format); - ret = funcs.dbg_vlog( cls, channel, func, format, valist ); + ret = funcs.dbg_vlog( cls, channel, NULL, func, 0, format, valist ); + va_end(valist); + return ret; +} + + +/* ReactOS compliant debug format wrapper for funcs.dbg_vlog */ +int ros_dbg_log( enum __wine_debug_class cls, struct __wine_debug_channel *channel, + const char *file, const char *func, const int line, const char *format, ... ) +{ + int ret; + va_list valist; + + if (!(__wine_dbg_get_channel_flags( channel ) & (1 << cls))) return -1; + + va_start(valist, format); + ret = funcs.dbg_vlog( cls, channel, file, func, line, format, valist ); va_end(valist); return ret; } @@ -396,12 +412,18 @@ static int default_dbg_vprintf( const char *format, va_list args ) /* default implementation of wine_dbg_vlog */ static int default_dbg_vlog( enum __wine_debug_class cls, struct __wine_debug_channel *channel, - const char *func, const char *format, va_list args ) + const char *file, const char *func, const int line, const char *format, va_list args ) { int ret = 0; if (cls < sizeof(debug_classes)/sizeof(debug_classes[0])) - ret += wine_dbg_printf( "%s:%s:%s ", debug_classes[cls], channel->name, func ); + ret += wine_dbg_printf( "%s:", debug_classes[cls] ); + + if (file && line) + ret += wine_dbg_printf ( "(%s:%d) ", file, line ); + else + ret += wine_dbg_printf( "%s:%s: ", channel->name, func ); + if (format) ret += funcs.dbg_vprintf( format, args ); return ret; From 252f2b2f4be931d59cc00c30a9515a79ec474af6 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Wed, 16 Apr 2014 23:17:59 +0000 Subject: [PATCH 334/419] [LIBWINE] - apply r61265 and use relative paths svn path=/trunk/; revision=62762 --- reactos/include/reactos/wine/debug.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reactos/include/reactos/wine/debug.h b/reactos/include/reactos/wine/debug.h index 2428c89e205..6eeb12eea93 100644 --- a/reactos/include/reactos/wine/debug.h +++ b/reactos/include/reactos/wine/debug.h @@ -27,6 +27,12 @@ #include #endif +#include + +#if !defined(__RELFILE__) +#define __RELFILE__ __FILE__ +#endif + #ifdef __WINE_WINE_TEST_H #error This file should not be used in Wine tests #endif @@ -91,7 +97,7 @@ struct __wine_debug_channel __WINE_DBG_LOG #define __WINE_DBG_LOG(args...) \ - ros_dbg_log( __dbcl, __dbch, __FILE__, __FUNCTION__, __LINE__, args); } } while(0) + ros_dbg_log( __dbcl, __dbch, __RELFILE__, __FUNCTION__, __LINE__, args); } } while(0) #define __WINE_PRINTF_ATTR(fmt,args) /*__attribute__((format (printf,fmt,args)))*/ From ace39a5f063636b34d4f9c4950feda850949be5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 17 Apr 2014 00:46:43 +0000 Subject: [PATCH 335/419] [CONSRV] Code "symmetrization" (see the upper helper function). svn path=/trunk/; revision=62763 --- .../user/winsrv/consrv/condrv/coninput.c | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c b/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c index 3b4777c1468..eaf94a8a19a 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c @@ -54,6 +54,19 @@ ConioInputEventToAnsi(PCONSOLE Console, PINPUT_RECORD InputEvent) } } +static VOID FASTCALL +ConioInputEventToUnicode(PCONSOLE Console, PINPUT_RECORD InputEvent) +{ + if (InputEvent->EventType == KEY_EVENT) + { + CHAR AsciiChar = InputEvent->Event.KeyEvent.uChar.AsciiChar; + InputEvent->Event.KeyEvent.uChar.AsciiChar = 0; + ConsoleInputAnsiCharToUnicodeChar(Console, + &InputEvent->Event.KeyEvent.uChar.UnicodeChar, + &AsciiChar); + } +} + NTSTATUS FASTCALL ConioAddInputEvent(PCONSOLE Console, PINPUT_RECORD InputEvent, @@ -465,12 +478,9 @@ ConDrvWriteConsoleInput(IN PCONSOLE Console, for (i = (NumEventsWritten ? *NumEventsWritten : 0); i < NumEventsToWrite && NT_SUCCESS(Status); ++i) { - if (InputRecord->EventType == KEY_EVENT && !Unicode) + if (!Unicode) { - CHAR AsciiChar = InputRecord->Event.KeyEvent.uChar.AsciiChar; - ConsoleInputAnsiCharToUnicodeChar(Console, - &InputRecord->Event.KeyEvent.uChar.UnicodeChar, - &AsciiChar); + ConioInputEventToUnicode(Console, InputRecord); } Status = ConioAddInputEvent(Console, InputRecord++, AppendToEnd); From 6687753892fe9952dde9ae37f4c3d5aebc3d7e9d Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Thu, 17 Apr 2014 13:49:49 +0000 Subject: [PATCH 336/419] [CMAKE] * Enable the PCH related warnings globally. svn path=/trunk/; revision=62764 --- reactos/cmake/gcc.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/cmake/gcc.cmake b/reactos/cmake/gcc.cmake index 7f4f84f66e0..c6da9b8c19e 100644 --- a/reactos/cmake/gcc.cmake +++ b/reactos/cmake/gcc.cmake @@ -324,6 +324,7 @@ set(PSEH_LIB "pseh") # Macros if(PCH) + add_compile_flags("-Winvalid-pch -Werror=invalid-pch") macro(add_pch _target _pch _sources) # When including x.h GCC looks for x.h.gch first set(_pch_final_name "${_target}_pch.h") @@ -351,7 +352,7 @@ if(PCH) # Include the gch in the specified source files, skipping the pch file itself list(REMOVE_ITEM ${_sources} ${_pch}) foreach(_src ${${_sources}}) - set_property(SOURCE ${_src} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_ccache_flag} -Winvalid-pch -Werror=invalid-pch -include ${_pch_final_name}") + set_property(SOURCE ${_src} APPEND_STRING PROPERTY COMPILE_FLAGS " ${_ccache_flag} -include ${_pch_final_name}") set_property(SOURCE ${_src} APPEND PROPERTY OBJECT_DEPENDS ${_gch}) endforeach() endmacro() From 4698314274e959d55761195d22ef3200694b1dc0 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Thu, 17 Apr 2014 19:03:49 +0000 Subject: [PATCH 337/419] [SYSDM] Delete a paging file on the next boot after the user selected the "no paging file" option for a disk drive. svn path=/trunk/; revision=62765 --- reactos/dll/cpl/sysdm/precomp.h | 6 +- reactos/dll/cpl/sysdm/virtmem.c | 140 ++++++++++++++++++-------------- 2 files changed, 85 insertions(+), 61 deletions(-) diff --git a/reactos/dll/cpl/sysdm/precomp.h b/reactos/dll/cpl/sysdm/precomp.h index 417f8432221..5b362c7ed2b 100644 --- a/reactos/dll/cpl/sysdm/precomp.h +++ b/reactos/dll/cpl/sysdm/precomp.h @@ -52,8 +52,10 @@ typedef struct _PAGEFILE { TCHAR szDrive[3]; LPTSTR pszVolume; - UINT InitialSize; - UINT MaximumSize; + INT OldMinSize; + INT OldMaxSize; + INT NewMinSize; + INT NewMaxSize; UINT FreeSize; BOOL bUsed; } PAGEFILE, *PPAGEFILE; diff --git a/reactos/dll/cpl/sysdm/virtmem.c b/reactos/dll/cpl/sysdm/virtmem.c index d7b2f8d2dd7..8a23a5ec6cf 100644 --- a/reactos/dll/cpl/sysdm/virtmem.c +++ b/reactos/dll/cpl/sysdm/virtmem.c @@ -108,8 +108,8 @@ ParseMemSettings(PVIRTMEM pVirtMem) LPTSTR DrivePtr = szDrives; TCHAR szDrive[3]; // Single drive TCHAR szVolume[MAX_PATH + 1]; - INT InitialSize; - INT MaximumSize; + INT MinSize; + INT MaxSize; INT DriveLen; INT PgCnt = 0; INT Len; @@ -129,19 +129,21 @@ ParseMemSettings(PVIRTMEM pVirtMem) if (GetDriveType(DrivePtr) == DRIVE_FIXED) { - InitialSize = -1; - MaximumSize = -1; + MinSize = -1; + MaxSize = -1; /* Does drive match the one in the registry ? */ if (!_tcsncmp(pVirtMem->szPagingFiles, szDrive, 2)) { GetPageFileSizes(pVirtMem->szPagingFiles, - &InitialSize, - &MaximumSize); + &MinSize, + &MaxSize); } - pVirtMem->Pagefile[PgCnt].InitialSize = InitialSize; - pVirtMem->Pagefile[PgCnt].MaximumSize = MaximumSize; + pVirtMem->Pagefile[PgCnt].OldMinSize = MinSize; + pVirtMem->Pagefile[PgCnt].OldMaxSize = MaxSize; + pVirtMem->Pagefile[PgCnt].NewMinSize = MinSize; + pVirtMem->Pagefile[PgCnt].NewMaxSize = MaxSize; pVirtMem->Pagefile[PgCnt].bUsed = TRUE; lstrcpy(pVirtMem->Pagefile[PgCnt].szDrive, szDrive); @@ -185,14 +187,14 @@ WritePageFileSettings(PVIRTMEM pVirtMem) for (i = 0; i < pVirtMem->Count; ++i) { if (pVirtMem->Pagefile[i].bUsed && - pVirtMem->Pagefile[i].InitialSize != -1 && - pVirtMem->Pagefile[i].MaximumSize != -1) + pVirtMem->Pagefile[i].NewMinSize != -1 && + pVirtMem->Pagefile[i].NewMaxSize != -1) { _stprintf(szText, _T("%s\\pagefile.sys %i %i"), pVirtMem->Pagefile[i].szDrive, - pVirtMem->Pagefile[i].InitialSize, - pVirtMem->Pagefile[i].MaximumSize); + pVirtMem->Pagefile[i].NewMinSize, + pVirtMem->Pagefile[i].NewMaxSize); /* Add it to our overall registry string */ lstrcpy(szPagingFiles + nPos, szText); @@ -229,8 +231,26 @@ WritePageFileSettings(PVIRTMEM pVirtMem) RegCloseKey(hk); } + if (bErr == FALSE) + { + /* Delete obsolete paging files on the next boot */ + for (i = 0; i < 26; i++) + { + if (pVirtMem->Pagefile[i].OldMinSize != -1 && + pVirtMem->Pagefile[i].NewMinSize == -1) + { + _stprintf(szText, + _T("%s\\pagefile.sys"), + pVirtMem->Pagefile[i].szDrive); + + MoveFileEx(szText, NULL, MOVEFILE_DELAY_UNTIL_REBOOT); + } + } + } + if (bErr) ShowLastWin32Error(pVirtMem->hSelf); + } @@ -283,16 +303,16 @@ InitPagefileList(PVIRTMEM pVirtMem) { if (pVirtMem->Pagefile[i].bUsed) { - if ((pVirtMem->Pagefile[i].InitialSize == -1) && - (pVirtMem->Pagefile[i].MaximumSize == -1)) + if ((pVirtMem->Pagefile[i].NewMinSize == -1) && + (pVirtMem->Pagefile[i].NewMaxSize == -1)) { LoadString(hApplet, IDS_PAGEFILE_NONE, szSize, sizeof(szSize) / sizeof(szSize[0])); } - else if ((pVirtMem->Pagefile[i].InitialSize == 0) && - (pVirtMem->Pagefile[i].MaximumSize == 0)) + else if ((pVirtMem->Pagefile[i].NewMinSize == 0) && + (pVirtMem->Pagefile[i].NewMaxSize == 0)) { LoadString(hApplet, IDS_PAGEFILE_SYSTEM, @@ -302,8 +322,8 @@ InitPagefileList(PVIRTMEM pVirtMem) else { _stprintf(szSize, _T("%d - %d"), - pVirtMem->Pagefile[i].InitialSize, - pVirtMem->Pagefile[i].MaximumSize); + pVirtMem->Pagefile[i].NewMinSize, + pVirtMem->Pagefile[i].NewMaxSize); } _stprintf(szDisplayString, @@ -331,16 +351,16 @@ UpdatePagefileEntry(PVIRTMEM pVirtMem, TCHAR szDisplayString[256]; TCHAR szSize[64]; - if ((pVirtMem->Pagefile[DriveIndex].InitialSize == -1) && - (pVirtMem->Pagefile[DriveIndex].MaximumSize == -1)) + if ((pVirtMem->Pagefile[DriveIndex].NewMinSize == -1) && + (pVirtMem->Pagefile[DriveIndex].NewMaxSize == -1)) { LoadString(hApplet, IDS_PAGEFILE_NONE, szSize, sizeof(szSize) / sizeof(szSize[0])); } - else if ((pVirtMem->Pagefile[DriveIndex].InitialSize == 0) && - (pVirtMem->Pagefile[DriveIndex].MaximumSize == 0)) + else if ((pVirtMem->Pagefile[DriveIndex].NewMinSize == 0) && + (pVirtMem->Pagefile[DriveIndex].NewMaxSize == 0)) { LoadString(hApplet, IDS_PAGEFILE_SYSTEM, @@ -351,8 +371,8 @@ UpdatePagefileEntry(PVIRTMEM pVirtMem, { _stprintf(szSize, _T("%d - %d"), - pVirtMem->Pagefile[DriveIndex].InitialSize, - pVirtMem->Pagefile[DriveIndex].MaximumSize); + pVirtMem->Pagefile[DriveIndex].NewMinSize, + pVirtMem->Pagefile[DriveIndex].NewMaxSize); } _stprintf(szDisplayString, @@ -371,8 +391,8 @@ static VOID OnSet(PVIRTMEM pVirtMem) { INT Index; - UINT InitialSize = -1; - UINT MaximumSize = -1; + UINT MinSize = -1; + UINT MaxSize = -1; BOOL bTranslated; INT DriveIndex = 0; @@ -393,10 +413,10 @@ OnSet(PVIRTMEM pVirtMem) if (IsDlgButtonChecked(pVirtMem->hSelf, IDC_CUSTOM) == BST_CHECKED) { - InitialSize = GetDlgItemInt(pVirtMem->hSelf, - IDC_INITIALSIZE, - &bTranslated, - FALSE); + MinSize = GetDlgItemInt(pVirtMem->hSelf, + IDC_INITIALSIZE, + &bTranslated, + FALSE); if (!bTranslated) { ResourceMessageBox(hApplet, @@ -407,10 +427,10 @@ OnSet(PVIRTMEM pVirtMem) return; } - MaximumSize = GetDlgItemInt(pVirtMem->hSelf, - IDC_MAXSIZE, - &bTranslated, - FALSE); + MaxSize = GetDlgItemInt(pVirtMem->hSelf, + IDC_MAXSIZE, + &bTranslated, + FALSE); if (!bTranslated) { ResourceMessageBox(hApplet, @@ -421,9 +441,9 @@ OnSet(PVIRTMEM pVirtMem) return; } - /* Check the valid range of the inial size */ - if (InitialSize < 2 || - InitialSize > pVirtMem->Pagefile[DriveIndex].FreeSize) + /* Check the valid range of the minimum size */ + if (MinSize < 2 || + MinSize > pVirtMem->Pagefile[DriveIndex].FreeSize) { ResourceMessageBox(hApplet, NULL, @@ -434,8 +454,8 @@ OnSet(PVIRTMEM pVirtMem) } /* Check the valid range of the maximum size */ - if (MaximumSize < InitialSize || - MaximumSize > pVirtMem->Pagefile[DriveIndex].FreeSize) + if (MaxSize < MinSize || + MaxSize > pVirtMem->Pagefile[DriveIndex].FreeSize) { ResourceMessageBox(hApplet, NULL, @@ -445,34 +465,34 @@ OnSet(PVIRTMEM pVirtMem) return; } - if ((pVirtMem->Pagefile[DriveIndex].InitialSize != InitialSize) && - (pVirtMem->Pagefile[DriveIndex].MaximumSize != MaximumSize)) + if ((pVirtMem->Pagefile[DriveIndex].NewMinSize != MinSize) && + (pVirtMem->Pagefile[DriveIndex].NewMaxSize != MaxSize)) pVirtMem->bModified = TRUE; - pVirtMem->Pagefile[DriveIndex].InitialSize = InitialSize; - pVirtMem->Pagefile[DriveIndex].MaximumSize = MaximumSize; + pVirtMem->Pagefile[DriveIndex].NewMinSize = MinSize; + pVirtMem->Pagefile[DriveIndex].NewMaxSize = MaxSize; pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; } else if (IsDlgButtonChecked(pVirtMem->hSelf, IDC_NOPAGEFILE) == BST_CHECKED) { - if ((pVirtMem->Pagefile[DriveIndex].InitialSize != InitialSize) && - (pVirtMem->Pagefile[DriveIndex].MaximumSize != MaximumSize)) + if ((pVirtMem->Pagefile[DriveIndex].NewMinSize != MinSize) && + (pVirtMem->Pagefile[DriveIndex].NewMaxSize != MaxSize)) pVirtMem->bModified = TRUE; /* Set sizes to -1 */ - pVirtMem->Pagefile[DriveIndex].InitialSize = -1; - pVirtMem->Pagefile[DriveIndex].MaximumSize = -1; + pVirtMem->Pagefile[DriveIndex].NewMinSize = -1; + pVirtMem->Pagefile[DriveIndex].NewMaxSize = -1; pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; } else { - if ((pVirtMem->Pagefile[DriveIndex].InitialSize != InitialSize) && - (pVirtMem->Pagefile[DriveIndex].MaximumSize != MaximumSize)) + if ((pVirtMem->Pagefile[DriveIndex].NewMinSize != MinSize) && + (pVirtMem->Pagefile[DriveIndex].NewMaxSize != MaxSize)) pVirtMem->bModified = TRUE; - pVirtMem->Pagefile[DriveIndex].InitialSize = 0; - pVirtMem->Pagefile[DriveIndex].MaximumSize = 0; + pVirtMem->Pagefile[DriveIndex].NewMinSize = 0; + pVirtMem->Pagefile[DriveIndex].NewMaxSize = 0; pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; } @@ -510,8 +530,8 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem) SetDlgItemText(hwndDlg, IDC_SPACEAVAIL, szBuffer); } - if (pVirtMem->Pagefile[Index].InitialSize == -1 && - pVirtMem->Pagefile[Index].MaximumSize == -1) + if (pVirtMem->Pagefile[Index].NewMinSize == -1 && + pVirtMem->Pagefile[Index].NewMaxSize == -1) { /* No pagefile */ @@ -520,8 +540,8 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem) CheckDlgButton(pVirtMem->hSelf, IDC_NOPAGEFILE, BST_CHECKED); } - else if (pVirtMem->Pagefile[Index].InitialSize == 0 && - pVirtMem->Pagefile[Index].MaximumSize == 0) + else if (pVirtMem->Pagefile[Index].NewMinSize == 0 && + pVirtMem->Pagefile[Index].NewMaxSize == 0) { /* System managed size*/ @@ -540,12 +560,12 @@ OnSelChange(HWND hwndDlg, PVIRTMEM pVirtMem) SetDlgItemInt(pVirtMem->hSelf, IDC_INITIALSIZE, - pVirtMem->Pagefile[Index].InitialSize, + pVirtMem->Pagefile[Index].NewMinSize, FALSE); SetDlgItemInt(pVirtMem->hSelf, IDC_MAXSIZE, - pVirtMem->Pagefile[Index].MaximumSize, + pVirtMem->Pagefile[Index].NewMaxSize, FALSE); CheckDlgButton(pVirtMem->hSelf, @@ -611,8 +631,10 @@ OnInitDialog(HWND hwnd, PVIRTMEM pVirtMem) for (i = 0; i < 26; i++) { pVirtMem->Pagefile[i].bUsed = FALSE; - pVirtMem->Pagefile[i].InitialSize = -1; - pVirtMem->Pagefile[i].MaximumSize = -1; + pVirtMem->Pagefile[i].OldMinSize = -1; + pVirtMem->Pagefile[i].OldMaxSize = -1; + pVirtMem->Pagefile[i].NewMinSize = -1; + pVirtMem->Pagefile[i].NewMaxSize = -1; } /* Load the pagefile systems from the reg */ From 3a0cc85009e1f49595173d17d8fb851839285074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 17 Apr 2014 20:43:41 +0000 Subject: [PATCH 338/419] [USETUP] Disable EXT2 formatting because it *DOESN'T WORK* and cause problems to newcomers. Please reenable it *ONLY WHEN* you know it *REALLY* works !!!!!!!!!! CORE-3091 CORE-3073 CORE-4003 #comment EXT2 formatting disabled in USETUP in revision 62766. Please reenable ONLY when you know it works. svn path=/trunk/; revision=62766 --- reactos/base/setup/usetup/interface/usetup.c | 2 ++ reactos/base/setup/usetup/native/fslist.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index b1a09be80dc..d8c73af3ac8 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -2392,8 +2392,10 @@ FormatPartitionPage(PINPUT_RECORD Ir) } } } +#if 0 else if (wcscmp(FileSystemList->Selected->FileSystem, L"EXT2") == 0) PartEntry->PartInfo[PartNum].PartitionType = PARTITION_EXT2; +#endif else if (!FileSystemList->Selected->FormatFunc) return QUIT_PAGE; diff --git a/reactos/base/setup/usetup/native/fslist.c b/reactos/base/setup/usetup/native/fslist.c index c4d6ec91bd5..c1211c874ec 100644 --- a/reactos/base/setup/usetup/native/fslist.c +++ b/reactos/base/setup/usetup/native/fslist.c @@ -5,7 +5,9 @@ NATIVE_CreateFileSystemList( IN PFILE_SYSTEM_LIST List) { FS_AddProvider(List, L"FAT", VfatFormat, VfatChkdsk); +#if 0 FS_AddProvider(List, L"EXT2", Ext2Format, Ext2Chkdsk); +#endif return TRUE; } From 402905a0316f776a36193970486f1bc3a8ed5b81 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Thu, 17 Apr 2014 20:56:12 +0000 Subject: [PATCH 339/419] [SYSDM] Bugfix: Enable the user to set a system managed paging file size if no paging file was set before. The user does not need to set a custom paging file size before setting the system managed paging file size. svn path=/trunk/; revision=62767 --- reactos/dll/cpl/sysdm/virtmem.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/reactos/dll/cpl/sysdm/virtmem.c b/reactos/dll/cpl/sysdm/virtmem.c index 8a23a5ec6cf..af9ce053522 100644 --- a/reactos/dll/cpl/sysdm/virtmem.c +++ b/reactos/dll/cpl/sysdm/virtmem.c @@ -465,10 +465,6 @@ OnSet(PVIRTMEM pVirtMem) return; } - if ((pVirtMem->Pagefile[DriveIndex].NewMinSize != MinSize) && - (pVirtMem->Pagefile[DriveIndex].NewMaxSize != MaxSize)) - pVirtMem->bModified = TRUE; - pVirtMem->Pagefile[DriveIndex].NewMinSize = MinSize; pVirtMem->Pagefile[DriveIndex].NewMaxSize = MaxSize; pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; @@ -476,26 +472,24 @@ OnSet(PVIRTMEM pVirtMem) else if (IsDlgButtonChecked(pVirtMem->hSelf, IDC_NOPAGEFILE) == BST_CHECKED) { - if ((pVirtMem->Pagefile[DriveIndex].NewMinSize != MinSize) && - (pVirtMem->Pagefile[DriveIndex].NewMaxSize != MaxSize)) - pVirtMem->bModified = TRUE; - - /* Set sizes to -1 */ + /* No pagefile */ pVirtMem->Pagefile[DriveIndex].NewMinSize = -1; pVirtMem->Pagefile[DriveIndex].NewMaxSize = -1; pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; } else { - if ((pVirtMem->Pagefile[DriveIndex].NewMinSize != MinSize) && - (pVirtMem->Pagefile[DriveIndex].NewMaxSize != MaxSize)) - pVirtMem->bModified = TRUE; - + /* System managed size*/ pVirtMem->Pagefile[DriveIndex].NewMinSize = 0; pVirtMem->Pagefile[DriveIndex].NewMaxSize = 0; pVirtMem->Pagefile[DriveIndex].bUsed = TRUE; } + /* Set the modified flag if min or max size has changed */ + if ((pVirtMem->Pagefile[DriveIndex].OldMinSize != pVirtMem->Pagefile[DriveIndex].NewMinSize) || + (pVirtMem->Pagefile[DriveIndex].OldMaxSize != pVirtMem->Pagefile[DriveIndex].NewMaxSize)) + pVirtMem->bModified = TRUE; + UpdatePagefileEntry(pVirtMem, Index, DriveIndex); } } From f9f5063b798e3e8686874df4b06ecfd139d8dc9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 17 Apr 2014 20:58:30 +0000 Subject: [PATCH 340/419] [BOOTDATA] In the same vein as in revision 62766: CORE-1697 CORE-7915 #comment Disable Multiprocessor choices at installation because it *DOESN'T correctly WORK* and cause problems to newcomers. Please reenable it *ONLY WHEN* you know it *REALLY* works !!! (revision 62768). svn path=/trunk/; revision=62768 --- reactos/boot/bootdata/txtsetup.sif | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/reactos/boot/bootdata/txtsetup.sif b/reactos/boot/bootdata/txtsetup.sif index d2675d94f39..555365a0642 100644 --- a/reactos/boot/bootdata/txtsetup.sif +++ b/reactos/boot/bootdata/txtsetup.sif @@ -132,32 +132,32 @@ DefaultLanguage = 00000409 [Computer] pci_up = "Standard PC Uniprocessor" -pci_mp = "Standard PC Multiprocessor" +;pci_mp = "Standard PC Multiprocessor" acpi_up = "ACPI PC Uniprocessor" -acpi_mp = "ACPI PC Multiprocessor" +;acpi_mp = "ACPI PC Multiprocessor" [Map.Computer] ; = pci_up = "PC UP" -pci_mp = "PC MP" +;pci_mp = "PC MP" acpi_up = "ACPI UP" -acpi_mp = "ACPI MP" +;acpi_mp = "ACPI MP" [Files.pci_up] ntoskrnl.exe=,,,,,,,,,,,,2 hal.dll=,,,,,,,,,,,,2 -[Files.pci_mp] -ntkrnlmp.exe=,,,,,,,,,,ntoskrnl.exe,,2 -halmps.dll=,,,,,,,,,,hal.dll,,2 +;[Files.pci_mp] +;ntkrnlmp.exe=,,,,,,,,,,ntoskrnl.exe,,2 +;halmps.dll=,,,,,,,,,,hal.dll,,2 [Files.acpi_up] ntoskrnl.exe=,,,,,,,,,,,,2 halacpi.dll=,,,,,,,,,,hal.dll,,2 -[Files.acpi_mp] -ntkrnlmp.exe=,,,,,,,,,,ntoskrnl.exe,,2 -halacpi.dll=,,,,,,,,,,hal.dll,,2 +;[Files.acpi_mp] +;ntkrnlmp.exe=,,,,,,,,,,ntoskrnl.exe,,2 +;halacpi.dll=,,,,,,,,,,hal.dll,,2 [Display] ; = ,,,,, From 8f32653a219b954609e49f0fae617215d6bfbee2 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Thu, 17 Apr 2014 21:32:35 +0000 Subject: [PATCH 341/419] [USETUP] - add a default page file entry to the registry also during unattended setup CORE-8074 svn path=/trunk/; revision=62769 --- reactos/base/setup/usetup/interface/usetup.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reactos/base/setup/usetup/interface/usetup.c b/reactos/base/setup/usetup/interface/usetup.c index d8c73af3ac8..8ba4d858be9 100644 --- a/reactos/base/setup/usetup/interface/usetup.c +++ b/reactos/base/setup/usetup/interface/usetup.c @@ -1524,6 +1524,8 @@ SelectPartitionPage(PINPUT_RECORD Ir) MaxSize, TRUE); + DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter[0]; + return SELECT_FILE_SYSTEM_PAGE; } } @@ -1535,6 +1537,8 @@ SelectPartitionPage(PINPUT_RECORD Ir) return SELECT_PARTITION_PAGE; /* let the user select another partition */ } + DestinationDriveLetter = (WCHAR)PartitionList->CurrentPartition->DriveLetter[0]; + return SELECT_FILE_SYSTEM_PAGE; } } From f398c22dbe4c9efb26ce1e38b61d0158b33b9d9a Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 17 Apr 2014 22:48:14 +0000 Subject: [PATCH 342/419] [User32] - Fixed right click on title bar. See CORE-7054. svn path=/trunk/; revision=62770 --- reactos/win32ss/user/user32/windows/nonclient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/user32/windows/nonclient.c b/reactos/win32ss/user/user32/windows/nonclient.c index 4dab2d0bfd1..ba179c87771 100644 --- a/reactos/win32ss/user/user32/windows/nonclient.c +++ b/reactos/win32ss/user/user32/windows/nonclient.c @@ -1135,8 +1135,8 @@ LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) ReleaseCapture(); if (hittest == HTCAPTION || hittest == HTSYSMENU) { - ERR("Msg pt %x and Msg.lParam %x and lParam %x\n",MAKELONG(msg.pt.x,msg.pt.y),msg.lParam,lParam); - SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOUSEMENU + HTSYSMENU, msg.lParam ); + TRACE("Msg pt %x and Msg.lParam %x and lParam %x\n",MAKELONG(msg.pt.x,msg.pt.y),msg.lParam,lParam); + SendMessageW( hwnd, WM_CONTEXTMENU, (WPARAM)hwnd, MAKELONG(msg.pt.x,msg.pt.y)); } break; } From cfbe5a56934593bb31e66599fc97f0379621d45a Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 17 Apr 2014 23:09:50 +0000 Subject: [PATCH 343/419] - Add support to scrolls too. svn path=/trunk/; revision=62771 --- reactos/win32ss/user/user32/windows/nonclient.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/win32ss/user/user32/windows/nonclient.c b/reactos/win32ss/user/user32/windows/nonclient.c index ba179c87771..234f1b9abe8 100644 --- a/reactos/win32ss/user/user32/windows/nonclient.c +++ b/reactos/win32ss/user/user32/windows/nonclient.c @@ -1133,7 +1133,7 @@ LRESULT NC_HandleNCRButtonDown( HWND hwnd, WPARAM wParam, LPARAM lParam ) if (hwnd != GetCapture()) return 0; } ReleaseCapture(); - if (hittest == HTCAPTION || hittest == HTSYSMENU) + if (hittest == HTCAPTION || hittest == HTSYSMENU || hittest == HTHSCROLL || hittest == HTVSCROLL) { TRACE("Msg pt %x and Msg.lParam %x and lParam %x\n",MAKELONG(msg.pt.x,msg.pt.y),msg.lParam,lParam); SendMessageW( hwnd, WM_CONTEXTMENU, (WPARAM)hwnd, MAKELONG(msg.pt.x,msg.pt.y)); From 15ceab25f8215f7f431674bec2f9ed74e15badb2 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Fri, 18 Apr 2014 12:07:55 +0000 Subject: [PATCH 344/419] [FASTFAT] Add file and directory removal notification. svn path=/trunk/; revision=62772 --- reactos/drivers/filesystems/fastfat/close.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/filesystems/fastfat/close.c b/reactos/drivers/filesystems/fastfat/close.c index 78f016f7d6e..007c3c5f444 100644 --- a/reactos/drivers/filesystems/fastfat/close.c +++ b/reactos/drivers/filesystems/fastfat/close.c @@ -28,7 +28,7 @@ VfatCloseFile( NTSTATUS Status = STATUS_SUCCESS; DPRINT("VfatCloseFile(DeviceExt %p, FileObject %p)\n", - DeviceExt, FileObject); + DeviceExt, FileObject); /* FIXME : update entry in directory? */ pCcb = (PVFATCCB) (FileObject->FsContext2); @@ -52,6 +52,17 @@ VfatCloseFile( if (pFcb->Flags & FCB_DELETE_PENDING) { VfatDelEntry(DeviceExt, pFcb); + + FsRtlNotifyFullReportChange(DeviceExt->NotifySync, + &(DeviceExt->NotifyList), + (PSTRING)&pFcb->PathNameU, + pFcb->PathNameU.Length - pFcb->LongNameU.Length, + NULL, + NULL, + ((*pFcb->Attributes & FILE_ATTRIBUTE_DIRECTORY) ? + FILE_NOTIFY_CHANGE_DIR_NAME : FILE_NOTIFY_CHANGE_FILE_NAME), + FILE_ACTION_REMOVED, + NULL); } else { From d6098a47bffc3f45678dcc1f93a43b74648c10bf Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 19:33:35 +0000 Subject: [PATCH 345/419] [LIBXML2] * Update to 2.9.1 * Make use of our iconvc and zlib libs. [LIBXSLT][MSXML3] * Make use of our iconvc and zlib libs. CORE-8079 #resolve svn path=/trunk/; revision=62773 --- reactos/dll/3rdparty/libxslt/CMakeLists.txt | 6 +- reactos/dll/win32/msxml3/CMakeLists.txt | 7 +- .../include/reactos/libs/libxml/Makefile.am | 54 - .../include/reactos/libs/libxml/Makefile.in | 631 - .../include/reactos/libs/libxml/entities.h | 3 +- reactos/include/reactos/libs/libxml/parser.h | 1 + reactos/include/reactos/libs/libxml/tree.h | 2 +- .../include/reactos/libs/libxml/xmlerror.h | 1 + .../include/reactos/libs/libxml/xmlversion.h | 29 +- .../reactos/libs/libxml/xmlversion.h.in | 9 + reactos/include/reactos/libs/libxml/xpath.h | 7 + reactos/lib/3rdparty/libxml2/CMakeLists.txt | 4 +- reactos/lib/3rdparty/libxml2/Copyright | 14 +- reactos/lib/3rdparty/libxml2/HTMLparser.c | 7 +- reactos/lib/3rdparty/libxml2/INSTALL | 370 - reactos/lib/3rdparty/libxml2/Makefile.am | 1275 - reactos/lib/3rdparty/libxml2/Makefile.in | 2791 - reactos/lib/3rdparty/libxml2/Makefile.tests | 41 - reactos/lib/3rdparty/libxml2/README.tests | 39 - reactos/lib/3rdparty/libxml2/SAX2.c | 19 +- reactos/lib/3rdparty/libxml2/acinclude.m4 | 28 - reactos/lib/3rdparty/libxml2/aclocal.m4 | 1034 - reactos/lib/3rdparty/libxml2/buf.c | 3 + reactos/lib/3rdparty/libxml2/catalog.c | 10 +- .../libxml2/check-relaxng-test-suite.py | 394 - .../libxml2/check-relaxng-test-suite2.py | 418 - .../libxml2/check-xinclude-test-suite.py | 221 - .../3rdparty/libxml2/check-xml-test-suite.py | 409 - .../libxml2/check-xsddata-test-suite.py | 420 - reactos/lib/3rdparty/libxml2/config.guess | 1522 - reactos/lib/3rdparty/libxml2/config.h | 2 +- reactos/lib/3rdparty/libxml2/config.h.in | 324 - reactos/lib/3rdparty/libxml2/config.sub | 1766 - reactos/lib/3rdparty/libxml2/configure | 17695 ------ reactos/lib/3rdparty/libxml2/configure.in | 1577 - reactos/lib/3rdparty/libxml2/dbgen.pl | 43 - reactos/lib/3rdparty/libxml2/dbgenattr.pl | 42 - reactos/lib/3rdparty/libxml2/debugXML.c | 1 - reactos/lib/3rdparty/libxml2/depcomp | 688 - reactos/lib/3rdparty/libxml2/dict.c | 29 +- reactos/lib/3rdparty/libxml2/elfgcchack.h | 174 + reactos/lib/3rdparty/libxml2/enc.h | 2 +- reactos/lib/3rdparty/libxml2/encoding.c | 9 +- reactos/lib/3rdparty/libxml2/genUnicode.py | 478 - reactos/lib/3rdparty/libxml2/gentest.py | 963 - reactos/lib/3rdparty/libxml2/hash.c | 4 + .../lib/3rdparty/libxml2/include/Makefile.am | 5 - .../lib/3rdparty/libxml2/include/Makefile.in | 680 - reactos/lib/3rdparty/libxml2/install-sh | 527 - .../libxml2/libxml-2.0-uninstalled.pc.in | 12 - reactos/lib/3rdparty/libxml2/libxml-2.0.pc.in | 13 - reactos/lib/3rdparty/libxml2/libxml.3 | 71 - reactos/lib/3rdparty/libxml2/libxml.h | 4 + reactos/lib/3rdparty/libxml2/libxml.m4 | 188 - reactos/lib/3rdparty/libxml2/libxml.spec.in | 133 - reactos/lib/3rdparty/libxml2/libxml2.spec | 133 - reactos/lib/3rdparty/libxml2/ltmain.sh | 9655 --- reactos/lib/3rdparty/libxml2/missing | 331 - reactos/lib/3rdparty/libxml2/nanohttp.c | 12 +- reactos/lib/3rdparty/libxml2/parser.c | 209 +- .../lib/3rdparty/libxml2/parserInternals.c | 6 +- reactos/lib/3rdparty/libxml2/regressions.py | 350 - reactos/lib/3rdparty/libxml2/regressions.xml | 226 - reactos/lib/3rdparty/libxml2/relaxng.c | 2 +- reactos/lib/3rdparty/libxml2/runsuite.c | 1172 - reactos/lib/3rdparty/libxml2/runtest.c | 4467 -- reactos/lib/3rdparty/libxml2/runxmlconf.c | 607 - reactos/lib/3rdparty/libxml2/testAutomata.c | 309 - reactos/lib/3rdparty/libxml2/testC14N.c | 370 - reactos/lib/3rdparty/libxml2/testHTML.c | 880 - reactos/lib/3rdparty/libxml2/testModule.c | 82 - reactos/lib/3rdparty/libxml2/testReader.c | 145 - reactos/lib/3rdparty/libxml2/testRegexp.c | 402 - reactos/lib/3rdparty/libxml2/testRelax.c | 194 - reactos/lib/3rdparty/libxml2/testSAX.c | 1198 - reactos/lib/3rdparty/libxml2/testSchemas.c | 185 - reactos/lib/3rdparty/libxml2/testThreads.c | 200 - .../lib/3rdparty/libxml2/testThreadsWin32.c | 150 - reactos/lib/3rdparty/libxml2/testURI.c | 124 - reactos/lib/3rdparty/libxml2/testXPath.c | 229 - reactos/lib/3rdparty/libxml2/testapi.c | 52060 ---------------- reactos/lib/3rdparty/libxml2/testchar.c | 617 - reactos/lib/3rdparty/libxml2/testdict.c | 444 - reactos/lib/3rdparty/libxml2/testdso.c | 12 - reactos/lib/3rdparty/libxml2/testlimits.c | 1634 - reactos/lib/3rdparty/libxml2/testrecurse.c | 965 - reactos/lib/3rdparty/libxml2/threads.c | 8 +- reactos/lib/3rdparty/libxml2/timsort.h | 16 +- reactos/lib/3rdparty/libxml2/tree.c | 2 +- reactos/lib/3rdparty/libxml2/valid.c | 2 +- reactos/lib/3rdparty/libxml2/xml2-config.1 | 30 - reactos/lib/3rdparty/libxml2/xml2-config.in | 106 - reactos/lib/3rdparty/libxml2/xml2Conf.sh.in | 8 - reactos/lib/3rdparty/libxml2/xmlIO.c | 22 +- reactos/lib/3rdparty/libxml2/xmllint.c | 18 +- reactos/lib/3rdparty/libxml2/xmlreader.c | 8 +- reactos/lib/3rdparty/libxml2/xmlregexp.c | 6 +- reactos/lib/3rdparty/libxml2/xmlsave.c | 4 + reactos/lib/3rdparty/libxml2/xmlschemas.c | 22 +- reactos/media/doc/3rd Party Files.txt | 2 +- 100 files changed, 552 insertions(+), 112271 deletions(-) delete mode 100644 reactos/include/reactos/libs/libxml/Makefile.am delete mode 100644 reactos/include/reactos/libs/libxml/Makefile.in delete mode 100644 reactos/lib/3rdparty/libxml2/INSTALL delete mode 100644 reactos/lib/3rdparty/libxml2/Makefile.am delete mode 100644 reactos/lib/3rdparty/libxml2/Makefile.in delete mode 100644 reactos/lib/3rdparty/libxml2/Makefile.tests delete mode 100644 reactos/lib/3rdparty/libxml2/README.tests delete mode 100644 reactos/lib/3rdparty/libxml2/acinclude.m4 delete mode 100644 reactos/lib/3rdparty/libxml2/aclocal.m4 delete mode 100644 reactos/lib/3rdparty/libxml2/check-relaxng-test-suite.py delete mode 100644 reactos/lib/3rdparty/libxml2/check-relaxng-test-suite2.py delete mode 100644 reactos/lib/3rdparty/libxml2/check-xinclude-test-suite.py delete mode 100644 reactos/lib/3rdparty/libxml2/check-xml-test-suite.py delete mode 100644 reactos/lib/3rdparty/libxml2/check-xsddata-test-suite.py delete mode 100644 reactos/lib/3rdparty/libxml2/config.guess delete mode 100644 reactos/lib/3rdparty/libxml2/config.h.in delete mode 100644 reactos/lib/3rdparty/libxml2/config.sub delete mode 100644 reactos/lib/3rdparty/libxml2/configure delete mode 100644 reactos/lib/3rdparty/libxml2/configure.in delete mode 100644 reactos/lib/3rdparty/libxml2/dbgen.pl delete mode 100644 reactos/lib/3rdparty/libxml2/dbgenattr.pl delete mode 100644 reactos/lib/3rdparty/libxml2/depcomp delete mode 100644 reactos/lib/3rdparty/libxml2/genUnicode.py delete mode 100644 reactos/lib/3rdparty/libxml2/gentest.py delete mode 100644 reactos/lib/3rdparty/libxml2/include/Makefile.am delete mode 100644 reactos/lib/3rdparty/libxml2/include/Makefile.in delete mode 100644 reactos/lib/3rdparty/libxml2/install-sh delete mode 100644 reactos/lib/3rdparty/libxml2/libxml-2.0-uninstalled.pc.in delete mode 100644 reactos/lib/3rdparty/libxml2/libxml-2.0.pc.in delete mode 100644 reactos/lib/3rdparty/libxml2/libxml.3 delete mode 100644 reactos/lib/3rdparty/libxml2/libxml.m4 delete mode 100644 reactos/lib/3rdparty/libxml2/libxml.spec.in delete mode 100644 reactos/lib/3rdparty/libxml2/libxml2.spec delete mode 100644 reactos/lib/3rdparty/libxml2/ltmain.sh delete mode 100644 reactos/lib/3rdparty/libxml2/missing delete mode 100644 reactos/lib/3rdparty/libxml2/regressions.py delete mode 100644 reactos/lib/3rdparty/libxml2/regressions.xml delete mode 100644 reactos/lib/3rdparty/libxml2/runsuite.c delete mode 100644 reactos/lib/3rdparty/libxml2/runtest.c delete mode 100644 reactos/lib/3rdparty/libxml2/runxmlconf.c delete mode 100644 reactos/lib/3rdparty/libxml2/testAutomata.c delete mode 100644 reactos/lib/3rdparty/libxml2/testC14N.c delete mode 100644 reactos/lib/3rdparty/libxml2/testHTML.c delete mode 100644 reactos/lib/3rdparty/libxml2/testModule.c delete mode 100644 reactos/lib/3rdparty/libxml2/testReader.c delete mode 100644 reactos/lib/3rdparty/libxml2/testRegexp.c delete mode 100644 reactos/lib/3rdparty/libxml2/testRelax.c delete mode 100644 reactos/lib/3rdparty/libxml2/testSAX.c delete mode 100644 reactos/lib/3rdparty/libxml2/testSchemas.c delete mode 100644 reactos/lib/3rdparty/libxml2/testThreads.c delete mode 100644 reactos/lib/3rdparty/libxml2/testThreadsWin32.c delete mode 100644 reactos/lib/3rdparty/libxml2/testURI.c delete mode 100644 reactos/lib/3rdparty/libxml2/testXPath.c delete mode 100644 reactos/lib/3rdparty/libxml2/testapi.c delete mode 100644 reactos/lib/3rdparty/libxml2/testchar.c delete mode 100644 reactos/lib/3rdparty/libxml2/testdict.c delete mode 100644 reactos/lib/3rdparty/libxml2/testdso.c delete mode 100644 reactos/lib/3rdparty/libxml2/testlimits.c delete mode 100644 reactos/lib/3rdparty/libxml2/testrecurse.c delete mode 100644 reactos/lib/3rdparty/libxml2/xml2-config.1 delete mode 100644 reactos/lib/3rdparty/libxml2/xml2-config.in delete mode 100644 reactos/lib/3rdparty/libxml2/xml2Conf.sh.in diff --git a/reactos/dll/3rdparty/libxslt/CMakeLists.txt b/reactos/dll/3rdparty/libxslt/CMakeLists.txt index 9a55a10adb9..988a7ca3c29 100644 --- a/reactos/dll/3rdparty/libxslt/CMakeLists.txt +++ b/reactos/dll/3rdparty/libxslt/CMakeLists.txt @@ -1,6 +1,6 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR} - ${REACTOS_SOURCE_DIR}/include/reactos/libs/libxslt) +include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/libxslt + ${REACTOS_SOURCE_DIR}/lib/3rdparty/libwin-iconv) add_definitions( -DHAVE_CONFIG_H @@ -37,7 +37,7 @@ list(APPEND SOURCE add_library(libxslt SHARED ${SOURCE}) set_module_type(libxslt win32dll) -target_link_libraries(libxslt libxml2 iconv-static) +target_link_libraries(libxslt libxml2 iconv-static zlib) add_importlibs(libxslt msvcrt ws2_32 kernel32) if(MSVC) add_importlibs(libxslt ntdll) diff --git a/reactos/dll/win32/msxml3/CMakeLists.txt b/reactos/dll/win32/msxml3/CMakeLists.txt index 8a7ee4e69ef..31b11f14309 100644 --- a/reactos/dll/win32/msxml3/CMakeLists.txt +++ b/reactos/dll/win32/msxml3/CMakeLists.txt @@ -9,7 +9,10 @@ if(MSVC) add_compile_flags("/FIwine/typeof.h /FImsvc.h") endif() -include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine) +include_directories( + ${REACTOS_SOURCE_DIR}/include/reactos/wine + ${REACTOS_SOURCE_DIR}/lib/3rdparty/libwin-iconv) + spec2def(msxml3.dll msxml3.spec ADD_IMPORTLIB) add_typelib(msxml3_v1.idl) @@ -66,7 +69,7 @@ add_library(msxml3 SHARED add_idl_headers(xmlparser_idlheader xmlparser.idl) set_module_type(msxml3 win32dll) -target_link_libraries(msxml3 libxml2 iconv-static uuid wine) +target_link_libraries(msxml3 libxml2 iconv-static uuid wine zlib) add_importlibs(msxml3 urlmon ws2_32 shlwapi oleaut32 ole32 user32 msvcrt kernel32 ntdll) add_dependencies(msxml3 xmlparser_idlheader stdole2) # msxml3_v1.tlb needs stdole2.tlb add_pch(msxml3 precomp.h SOURCE) diff --git a/reactos/include/reactos/libs/libxml/Makefile.am b/reactos/include/reactos/libs/libxml/Makefile.am deleted file mode 100644 index cf9297aad66..00000000000 --- a/reactos/include/reactos/libs/libxml/Makefile.am +++ /dev/null @@ -1,54 +0,0 @@ -## Process this file with automake to produce Makefile.in - -xmlincdir = $(includedir)/libxml2/libxml - -xmlinc_HEADERS = \ - SAX.h \ - entities.h \ - encoding.h \ - parser.h \ - parserInternals.h \ - xmlerror.h \ - HTMLparser.h \ - HTMLtree.h \ - debugXML.h \ - tree.h \ - list.h \ - hash.h \ - xpath.h \ - xpathInternals.h \ - xpointer.h \ - xinclude.h \ - xmlIO.h \ - xmlmemory.h \ - nanohttp.h \ - nanoftp.h \ - uri.h \ - valid.h \ - xlink.h \ - xmlversion.h \ - DOCBparser.h \ - catalog.h \ - threads.h \ - globals.h \ - c14n.h \ - xmlautomata.h \ - xmlregexp.h \ - xmlmodule.h \ - xmlschemas.h \ - schemasInternals.h \ - xmlschemastypes.h \ - xmlstring.h \ - xmlunicode.h \ - xmlreader.h \ - relaxng.h \ - dict.h \ - SAX2.h \ - xmlexports.h \ - xmlwriter.h \ - chvalid.h \ - pattern.h \ - xmlsave.h \ - schematron.h - -EXTRA_DIST = xmlversion.h.in diff --git a/reactos/include/reactos/libs/libxml/Makefile.in b/reactos/include/reactos/libs/libxml/Makefile.in deleted file mode 100644 index 2c56fd4116e..00000000000 --- a/reactos/include/reactos/libs/libxml/Makefile.in +++ /dev/null @@ -1,631 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = include/libxml -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/xmlversion.h.in $(xmlinc_HEADERS) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = xmlversion.h -CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -SOURCES = -DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(xmlincdir)" -HEADERS = $(xmlinc_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_THREAD_LIBS = @BASE_THREAD_LIBS@ -C14N_OBJ = @C14N_OBJ@ -CATALOG_OBJ = @CATALOG_OBJ@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ -CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@ -DEBUG_OBJ = @DEBUG_OBJ@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DOCB_OBJ = @DOCB_OBJ@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FTP_OBJ = @FTP_OBJ@ -GREP = @GREP@ -HAVE_ISINF = @HAVE_ISINF@ -HAVE_ISNAN = @HAVE_ISNAN@ -HTML_DIR = @HTML_DIR@ -HTML_OBJ = @HTML_OBJ@ -HTTP_OBJ = @HTTP_OBJ@ -ICONV_LIBS = @ICONV_LIBS@ -ICU_LIBS = @ICU_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ -LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ -LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ -LIBXML_VERSION = @LIBXML_VERSION@ -LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@ -LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ -LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LZMA_CFLAGS = @LZMA_CFLAGS@ -LZMA_LIBS = @LZMA_LIBS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MODULE_EXTENSION = @MODULE_EXTENSION@ -MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ -MV = @MV@ -M_LIBS = @M_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PYTHON = @PYTHON@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ -PYTHON_SUBDIR = @PYTHON_SUBDIR@ -PYTHON_TESTS = @PYTHON_TESTS@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -RDL_LIBS = @RDL_LIBS@ -READER_TEST = @READER_TEST@ -RELDATE = @RELDATE@ -RM = @RM@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STATIC_BINARIES = @STATIC_BINARIES@ -STRIP = @STRIP@ -TAR = @TAR@ -TEST_C14N = @TEST_C14N@ -TEST_CATALOG = @TEST_CATALOG@ -TEST_DEBUG = @TEST_DEBUG@ -TEST_HTML = @TEST_HTML@ -TEST_MODULES = @TEST_MODULES@ -TEST_PATTERN = @TEST_PATTERN@ -TEST_PHTML = @TEST_PHTML@ -TEST_PUSH = @TEST_PUSH@ -TEST_REGEXPS = @TEST_REGEXPS@ -TEST_SAX = @TEST_SAX@ -TEST_SCHEMAS = @TEST_SCHEMAS@ -TEST_SCHEMATRON = @TEST_SCHEMATRON@ -TEST_THREADS = @TEST_THREADS@ -TEST_VALID = @TEST_VALID@ -TEST_VTIME = @TEST_VTIME@ -TEST_XINCLUDE = @TEST_XINCLUDE@ -TEST_XPATH = @TEST_XPATH@ -TEST_XPTR = @TEST_XPTR@ -THREAD_CFLAGS = @THREAD_CFLAGS@ -THREAD_LIBS = @THREAD_LIBS@ -VERSION = @VERSION@ -VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WGET = @WGET@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ -WIN32_EXTRA_PYTHON_LIBADD = @WIN32_EXTRA_PYTHON_LIBADD@ -WITH_C14N = @WITH_C14N@ -WITH_CATALOG = @WITH_CATALOG@ -WITH_DEBUG = @WITH_DEBUG@ -WITH_DOCB = @WITH_DOCB@ -WITH_FTP = @WITH_FTP@ -WITH_HTML = @WITH_HTML@ -WITH_HTTP = @WITH_HTTP@ -WITH_ICONV = @WITH_ICONV@ -WITH_ICU = @WITH_ICU@ -WITH_ISO8859X = @WITH_ISO8859X@ -WITH_LEGACY = @WITH_LEGACY@ -WITH_LZMA = @WITH_LZMA@ -WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ -WITH_MODULES = @WITH_MODULES@ -WITH_OUTPUT = @WITH_OUTPUT@ -WITH_PATTERN = @WITH_PATTERN@ -WITH_PUSH = @WITH_PUSH@ -WITH_READER = @WITH_READER@ -WITH_REGEXPS = @WITH_REGEXPS@ -WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ -WITH_SAX1 = @WITH_SAX1@ -WITH_SCHEMAS = @WITH_SCHEMAS@ -WITH_SCHEMATRON = @WITH_SCHEMATRON@ -WITH_THREADS = @WITH_THREADS@ -WITH_TREE = @WITH_TREE@ -WITH_TRIO = @WITH_TRIO@ -WITH_VALID = @WITH_VALID@ -WITH_WRITER = @WITH_WRITER@ -WITH_XINCLUDE = @WITH_XINCLUDE@ -WITH_XPATH = @WITH_XPATH@ -WITH_XPTR = @WITH_XPTR@ -WITH_ZLIB = @WITH_ZLIB@ -XINCLUDE_OBJ = @XINCLUDE_OBJ@ -XMLLINT = @XMLLINT@ -XML_CFLAGS = @XML_CFLAGS@ -XML_INCLUDEDIR = @XML_INCLUDEDIR@ -XML_LIBDIR = @XML_LIBDIR@ -XML_LIBS = @XML_LIBS@ -XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@ -XPATH_OBJ = @XPATH_OBJ@ -XPTR_OBJ = @XPTR_OBJ@ -XSLTPROC = @XSLTPROC@ -Z_CFLAGS = @Z_CFLAGS@ -Z_LIBS = @Z_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -xmlincdir = $(includedir)/libxml2/libxml -xmlinc_HEADERS = \ - SAX.h \ - entities.h \ - encoding.h \ - parser.h \ - parserInternals.h \ - xmlerror.h \ - HTMLparser.h \ - HTMLtree.h \ - debugXML.h \ - tree.h \ - list.h \ - hash.h \ - xpath.h \ - xpathInternals.h \ - xpointer.h \ - xinclude.h \ - xmlIO.h \ - xmlmemory.h \ - nanohttp.h \ - nanoftp.h \ - uri.h \ - valid.h \ - xlink.h \ - xmlversion.h \ - DOCBparser.h \ - catalog.h \ - threads.h \ - globals.h \ - c14n.h \ - xmlautomata.h \ - xmlregexp.h \ - xmlmodule.h \ - xmlschemas.h \ - schemasInternals.h \ - xmlschemastypes.h \ - xmlstring.h \ - xmlunicode.h \ - xmlreader.h \ - relaxng.h \ - dict.h \ - SAX2.h \ - xmlexports.h \ - xmlwriter.h \ - chvalid.h \ - pattern.h \ - xmlsave.h \ - schematron.h - -EXTRA_DIST = xmlversion.h.in -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/libxml/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu include/libxml/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -xmlversion.h: $(top_builddir)/config.status $(srcdir)/xmlversion.h.in - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-xmlincHEADERS: $(xmlinc_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(xmlincdir)" || $(MKDIR_P) "$(DESTDIR)$(xmlincdir)" - @list='$(xmlinc_HEADERS)'; test -n "$(xmlincdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(xmlincdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(xmlincdir)" || exit $$?; \ - done - -uninstall-xmlincHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(xmlinc_HEADERS)'; test -n "$(xmlincdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(xmlincdir)'; $(am__uninstall_files_from_dir) - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(xmlincdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-xmlincHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-xmlincHEADERS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool ctags distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip install-xmlincHEADERS \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-xmlincHEADERS - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/reactos/include/reactos/libs/libxml/entities.h b/reactos/include/reactos/libs/libxml/entities.h index cefb97f780d..1e9118975d7 100644 --- a/reactos/include/reactos/libs/libxml/entities.h +++ b/reactos/include/reactos/libs/libxml/entities.h @@ -58,7 +58,8 @@ struct _xmlEntity { int owner; /* does the entity own the childrens */ int checked; /* was the entity content checked */ /* this is also used to count entites - * references done from that entity */ + * references done from that entity + * and if it contains '<' */ }; /* diff --git a/reactos/include/reactos/libs/libxml/parser.h b/reactos/include/reactos/libs/libxml/parser.h index e1346e4a4d3..3f5730dc61b 100644 --- a/reactos/include/reactos/libs/libxml/parser.h +++ b/reactos/include/reactos/libs/libxml/parser.h @@ -310,6 +310,7 @@ struct _xmlParserCtxt { xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */ int input_id; /* we need to label inputs */ + unsigned long sizeentcopy; /* volume of entity copy */ }; /** diff --git a/reactos/include/reactos/libs/libxml/tree.h b/reactos/include/reactos/libs/libxml/tree.h index da12daaecea..7e06686af3c 100644 --- a/reactos/include/reactos/libs/libxml/tree.h +++ b/reactos/include/reactos/libs/libxml/tree.h @@ -118,7 +118,7 @@ typedef xmlBuf *xmlBufPtr; */ XMLPUBFUN xmlChar* XMLCALL xmlBufContent (const xmlBufPtr buf); XMLPUBFUN xmlChar* XMLCALL xmlBufEnd (const xmlBufPtr buf); -XMLPUBFUN size_t XMLCALL xmlBufUse (xmlBufPtr buf); +XMLPUBFUN size_t XMLCALL xmlBufUse (const xmlBufPtr buf); XMLPUBFUN size_t XMLCALL xmlBufShrink (xmlBufPtr buf, size_t len); /* diff --git a/reactos/include/reactos/libs/libxml/xmlerror.h b/reactos/include/reactos/libs/libxml/xmlerror.h index 48ea145d9f7..537a396c6d8 100644 --- a/reactos/include/reactos/libs/libxml/xmlerror.h +++ b/reactos/include/reactos/libs/libxml/xmlerror.h @@ -208,6 +208,7 @@ typedef enum { XML_ERR_UNKNOWN_VERSION, /* 108 */ XML_ERR_VERSION_MISMATCH, /* 109 */ XML_ERR_NAME_TOO_LONG, /* 110 */ + XML_ERR_USER_STOP, /* 111 */ XML_NS_ERR_XML_NAMESPACE = 200, XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */ XML_NS_ERR_QNAME, /* 202 */ diff --git a/reactos/include/reactos/libs/libxml/xmlversion.h b/reactos/include/reactos/libs/libxml/xmlversion.h index 06d55f09c5f..26517419949 100644 --- a/reactos/include/reactos/libs/libxml/xmlversion.h +++ b/reactos/include/reactos/libs/libxml/xmlversion.h @@ -29,28 +29,28 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.9.0" +#define LIBXML_DOTTED_VERSION "2.9.1" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20900 +#define LIBXML_VERSION 20901 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20900" +#define LIBXML_VERSION_STRING "20901" /** * LIBXML_VERSION_EXTRA: * * extra version information, used to show a CVS compilation */ -#define LIBXML_VERSION_EXTRA "-GITv2.9.0-rc2-5-g7651606" +#define LIBXML_VERSION_EXTRA "" /** * LIBXML_TEST_VERSION: @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20900); +#define LIBXML_TEST_VERSION xmlCheckVersion(20901); #ifndef VMS #if 0 @@ -97,6 +97,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #endif #endif +/** + * LIBXML_THREAD_ALLOC_ENABLED: + * + * Whether the allocation hooks are per-thread + */ +#if 0 +#define LIBXML_THREAD_ALLOC_ENABLED +#endif + /** * LIBXML_TREE_ENABLED: * @@ -264,7 +273,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * Whether iconv support is available */ -#if 0 +#if 1 #define LIBXML_ICONV_ENABLED #endif @@ -282,7 +291,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * Whether ISO-8859-* support is made available in case iconv is not */ -#if 1 +#if 0 #define LIBXML_ISO8859X_ENABLED #endif @@ -300,7 +309,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * Whether the memory debugging is configured in */ -#if 1 +#if 0 #define DEBUG_MEMORY_LOCATION #endif @@ -309,7 +318,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * Whether the runtime debugging is configured in */ -#if 1 +#if 0 #define LIBXML_DEBUG_RUNTIME #endif @@ -379,7 +388,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the string suffix used by dynamic modules (usually shared libraries) */ -#define LIBXML_MODULE_EXTENSION ".so" +#define LIBXML_MODULE_EXTENSION ".dll" #endif /** diff --git a/reactos/include/reactos/libs/libxml/xmlversion.h.in b/reactos/include/reactos/libs/libxml/xmlversion.h.in index c98e7ca76f9..00a836fb9bc 100644 --- a/reactos/include/reactos/libs/libxml/xmlversion.h.in +++ b/reactos/include/reactos/libs/libxml/xmlversion.h.in @@ -97,6 +97,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #endif #endif +/** + * LIBXML_THREAD_ALLOC_ENABLED: + * + * Whether the allocation hooks are per-thread + */ +#if @WITH_THREAD_ALLOC@ +#define LIBXML_THREAD_ALLOC_ENABLED +#endif + /** * LIBXML_TREE_ENABLED: * diff --git a/reactos/include/reactos/libs/libxml/xpath.h b/reactos/include/reactos/libs/libxml/xpath.h index 8819a290428..d96776c5183 100644 --- a/reactos/include/reactos/libs/libxml/xpath.h +++ b/reactos/include/reactos/libs/libxml/xpath.h @@ -508,6 +508,13 @@ XMLPUBFUN int XMLCALL */ XMLPUBFUN long XMLCALL xmlXPathOrderDocElems (xmlDocPtr doc); +XMLPUBFUN int XMLCALL + xmlXPathSetContextNode (xmlNodePtr node, + xmlXPathContextPtr ctx); +XMLPUBFUN xmlXPathObjectPtr XMLCALL + xmlXPathNodeEval (xmlNodePtr node, + const xmlChar *str, + xmlXPathContextPtr ctx); XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPathEval (const xmlChar *str, xmlXPathContextPtr ctx); diff --git a/reactos/lib/3rdparty/libxml2/CMakeLists.txt b/reactos/lib/3rdparty/libxml2/CMakeLists.txt index a983a3659d8..b0062c36feb 100644 --- a/reactos/lib/3rdparty/libxml2/CMakeLists.txt +++ b/reactos/lib/3rdparty/libxml2/CMakeLists.txt @@ -1,7 +1,8 @@ include_directories( include - ${REACTOS_SOURCE_DIR}/lib/3rdparty/libwin-iconv) + ${REACTOS_SOURCE_DIR}/lib/3rdparty/libwin-iconv + ${REACTOS_SOURCE_DIR}/include/reactos/libs/zlib) add_definitions( -D__MINGW32__ @@ -12,7 +13,6 @@ add_definitions( -D_WINDOWS -DWIN32 -DHAVE_CONFIG_H - -DLIBXML_ICONV_ENABLED -DICONV_CONST=const -D_DLL -D__USE_CRTIMP) diff --git a/reactos/lib/3rdparty/libxml2/Copyright b/reactos/lib/3rdparty/libxml2/Copyright index 417e95531fd..d61318502ca 100644 --- a/reactos/lib/3rdparty/libxml2/Copyright +++ b/reactos/lib/3rdparty/libxml2/Copyright @@ -2,7 +2,7 @@ Except where otherwise noted in the source code (e.g. the files hash.c, list.c and the trio files, which are covered by a similar licence but with different Copyright notices) all the files are: - Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved. + Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -17,11 +17,7 @@ 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, FIT- NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- -NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of Daniel Veillard shall not -be used in advertising or otherwise to promote the sale, use or other deal- -ings in this Software without prior written authorization from him. - +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. diff --git a/reactos/lib/3rdparty/libxml2/HTMLparser.c b/reactos/lib/3rdparty/libxml2/HTMLparser.c index a533f375c4b..dd0c1ead910 100644 --- a/reactos/lib/3rdparty/libxml2/HTMLparser.c +++ b/reactos/lib/3rdparty/libxml2/HTMLparser.c @@ -3561,7 +3561,7 @@ htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) { */ processed = ctxt->input->cur - ctxt->input->base; xmlBufShrink(ctxt->input->buf->buffer, processed); - nbchars = xmlCharEncInput(ctxt->input->buf); + nbchars = xmlCharEncInput(ctxt->input->buf, 1); if (nbchars < 0) { htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, "htmlCheckEncoding: encoder error\n", @@ -6054,13 +6054,16 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size, if ((in->encoder != NULL) && (in->buffer != NULL) && (in->raw != NULL)) { int nbchars; + size_t base = xmlBufGetInputBase(in->buffer, ctxt->input); + size_t current = ctxt->input->cur - ctxt->input->base; - nbchars = xmlCharEncInput(in); + nbchars = xmlCharEncInput(in, terminate); if (nbchars < 0) { htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING, "encoder error\n", NULL, NULL); return(XML_ERR_INVALID_ENCODING); } + xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current); } } } diff --git a/reactos/lib/3rdparty/libxml2/INSTALL b/reactos/lib/3rdparty/libxml2/INSTALL deleted file mode 100644 index a1e89e18ad2..00000000000 --- a/reactos/lib/3rdparty/libxml2/INSTALL +++ /dev/null @@ -1,370 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, -Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/reactos/lib/3rdparty/libxml2/Makefile.am b/reactos/lib/3rdparty/libxml2/Makefile.am deleted file mode 100644 index a4a9f87c12c..00000000000 --- a/reactos/lib/3rdparty/libxml2/Makefile.am +++ /dev/null @@ -1,1275 +0,0 @@ -## Process this file with automake to produce Makefile.in - -ACLOCAL_AMFLAGS = -I m4 - -SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR) - -DIST_SUBDIRS = include . doc example python xstc - -AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include - -AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS) - -noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \ - testThreads testC14N testAutomata testRegexp \ - testReader testapi testModule runtest runsuite testchar \ - testdict runxmlconf testrecurse testlimits - -bin_PROGRAMS = xmllint xmlcatalog - -bin_SCRIPTS=xml2-config - -lib_LTLIBRARIES = libxml2.la -libxml2_la_LIBADD = $(ICU_LIBS) $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) - -if USE_VERSION_SCRIPT -LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms -else -LIBXML2_VERSION_SCRIPT = -endif - -libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \ - $(LIBXML2_VERSION_SCRIPT) \ - -version-info $(LIBXML_VERSION_INFO) \ - $(MODULE_PLATFORM_LIBS) - -if WITH_SAX1_SOURCES -docb_sources = DOCBparser.c -else -docb_sources = -endif - -if WITH_TRIO_SOURCES -trio_sources = triostr.c trio.c -else -trio_sources = -endif - -libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ - parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ - valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \ - xpointer.c xinclude.c nanohttp.c nanoftp.c \ - $(docb_sources) \ - catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \ - xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ - $(trio_sources) \ - xmlreader.c relaxng.c dict.c SAX2.c \ - xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ - xmlmodule.c schematron.c xzlib.c - -DEPS = $(top_builddir)/libxml2.la -LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) - - -man_MANS = xml2-config.1 libxml.3 - -m4datadir = $(datadir)/aclocal -m4data_DATA = libxml.m4 - -runtest_SOURCES=runtest.c -runtest_LDFLAGS = -runtest_DEPENDENCIES = $(DEPS) -runtest_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) - -testrecurse_SOURCES=testrecurse.c -testrecurse_LDFLAGS = -testrecurse_DEPENDENCIES = $(DEPS) -testrecurse_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) - -testlimits_SOURCES=testlimits.c -testlimits_LDFLAGS = -testlimits_DEPENDENCIES = $(DEPS) -testlimits_LDADD= $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) - -testchar_SOURCES=testchar.c -testchar_LDFLAGS = -testchar_DEPENDENCIES = $(DEPS) -testchar_LDADD= $(RDL_LIBS) $(LDADDS) - -testdict_SOURCES=testdict.c -testdict_LDFLAGS = -testdict_DEPENDENCIES = $(DEPS) -testdict_LDADD= $(RDL_LIBS) $(LDADDS) - -runsuite_SOURCES=runsuite.c -runsuite_LDFLAGS = -runsuite_DEPENDENCIES = $(DEPS) -runsuite_LDADD= $(RDL_LIBS) $(LDADDS) - -xmllint_SOURCES=xmllint.c -xmllint_LDFLAGS = -xmllint_DEPENDENCIES = $(DEPS) -xmllint_LDADD= $(RDL_LIBS) $(LDADDS) - -testSAX_SOURCES=testSAX.c -testSAX_LDFLAGS = -testSAX_DEPENDENCIES = $(DEPS) -testSAX_LDADD= $(LDADDS) - -testHTML_SOURCES=testHTML.c -testHTML_LDFLAGS = -testHTML_DEPENDENCIES = $(DEPS) -testHTML_LDADD= $(LDADDS) - -xmlcatalog_SOURCES=xmlcatalog.c -xmlcatalog_LDFLAGS = -xmlcatalog_DEPENDENCIES = $(DEPS) -xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS) - -testXPath_SOURCES=testXPath.c -testXPath_LDFLAGS = -testXPath_DEPENDENCIES = $(DEPS) -testXPath_LDADD= $(LDADDS) - -testC14N_SOURCES=testC14N.c -testC14N_LDFLAGS = -testC14N_DEPENDENCIES = $(DEPS) -testC14N_LDADD= $(LDADDS) - -if THREADS_W32 -testThreads_SOURCES = testThreadsWin32.c -else -testThreads_SOURCES = testThreads.c -endif -testThreads_LDFLAGS = -testThreads_DEPENDENCIES = $(DEPS) -testThreads_LDADD= $(BASE_THREAD_LIBS) $(LDADDS) - -testURI_SOURCES=testURI.c -testURI_LDFLAGS = -testURI_DEPENDENCIES = $(DEPS) -testURI_LDADD= $(LDADDS) - -testRegexp_SOURCES=testRegexp.c -testRegexp_LDFLAGS = -testRegexp_DEPENDENCIES = $(DEPS) -testRegexp_LDADD= $(LDADDS) - -testAutomata_SOURCES=testAutomata.c -testAutomata_LDFLAGS = -testAutomata_DEPENDENCIES = $(DEPS) -testAutomata_LDADD= $(LDADDS) - -testSchemas_SOURCES=testSchemas.c -testSchemas_LDFLAGS = -testSchemas_DEPENDENCIES = $(DEPS) -testSchemas_LDADD= $(LDADDS) - -testRelax_SOURCES=testRelax.c -testRelax_LDFLAGS = -testRelax_DEPENDENCIES = $(DEPS) -testRelax_LDADD= $(LDADDS) - -testReader_SOURCES=testReader.c -testReader_LDFLAGS = -testReader_DEPENDENCIES = $(DEPS) -testReader_LDADD= $(LDADDS) - -testModule_SOURCES=testModule.c -testModule_LDFLAGS = -testModule_DEPENDENCIES = $(DEPS) -testModule_LDADD= $(LDADDS) - -noinst_LTLIBRARIES = testdso.la -testdso_la_SOURCES = testdso.c -testdso_la_LDFLAGS = -module -no-undefined -avoid-version -rpath $(libdir) - -# that one forces the rebuild when "make rebuild" is run on doc/ -rebuild_testapi: - -@(if [ "$(PYTHON)" != "" ] ; then \ - $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi ) - -# that one is just to make sure it is rebuilt if missing -# but adding the dependances generate mess -testapi.c: $(srcdir)/gentest.py - -@(if [ "$(PYTHON)" != "" ] ; then \ - $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi ) - -BUILT_SOURCES = testapi.c - -testapi_SOURCES=testapi.c -testapi_LDFLAGS = -testapi_DEPENDENCIES = $(DEPS) -testapi_LDADD= $(LDADDS) - -runxmlconf_SOURCES=runxmlconf.c -runxmlconf_LDFLAGS = -runxmlconf_DEPENDENCIES = $(DEPS) -runxmlconf_LDADD= $(LDADDS) - -#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c -#testOOM_LDFLAGS = -#testOOM_DEPENDENCIES = $(DEPS) -#testOOM_LDADD= $(LDADDS) - -runtests: - [ -d test ] || $(LN_S) $(srcdir)/test . - [ -d result ] || $(LN_S) $(srcdir)/result . - $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT) - @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ - $(MAKE) tests ; fi) - -check: all runtests - -check-valgrind valgrind: all - @echo '## Running the regression tests under Valgrind' - @echo '## Go get a cup of coffee it is gonna take a while ...' - $(MAKE) CHECKER='valgrind -q' runtests - -testall : tests SVGtests SAXtests - -tests: XMLtests XMLenttests NStests IDtests Errtests APItests $(READER_TEST) $(TEST_SAX) $(TEST_PUSH) $(TEST_HTML) $(TEST_PHTML) $(TEST_VALID) URItests $(TEST_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES) - @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ - $(MAKE) tests ; fi) - @(cd doc/examples ; $(MAKE) tests) - -APItests: testapi$(EXEEXT) - @echo "## Running the API regression tests this may take a little while" - -@($(CHECKER) $(top_builddir)/testapi -q) - -HTMLtests : testHTML$(EXEEXT) - @(echo > .memdump) - @echo "## HTML regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML $$i > result.$$name 2> error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name result.$$name ; \ - diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \ - $(CHECKER) $(top_builddir)/testHTML result.$$name > result2.$$name 2>error.$$name ; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result2.$$name error.$$name ; \ - fi ; fi ; done) - -HTMLPushtests : testHTML$(EXEEXT) - @echo "## Push HTML regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML --push $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML --push $$i > result.$$name 2> error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name result.$$name ; \ - cut -b 1-15 $(srcdir)/result/HTML/$$name.err > errorcut.$$name; \ - cut -b 1-15 error.$$name > errorcut2.$$name; \ - diff -b errorcut.$$name errorcut2.$$name ; \ - $(CHECKER) $(top_builddir)/testHTML --push result.$$name > result2.$$name 2>error.$$name ; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \ - fi ; fi ; done) - @echo "## HTML SAX regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name.sax ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML --sax $$i > result.$$name.sax ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name.sax ; \ - fi ; fi ; done) - @echo "## Push HTML SAX regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML --push --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML --push --sax $$i 2>&1 > result.$$name.sax ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name.sax ; \ - fi ; fi ; done) - -XMLtests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result.$$name result2.$$name` ;\ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - @echo "## XML regression tests on memory" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --memory $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint --memory result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - diff result.$$name result2.$$name ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -XMLPushtests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML push regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --push $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint --push result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -NStests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML Namespaces regression tests" - -@(for i in $(srcdir)/test/namespaces/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/namespaces/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i \ - 2> $(srcdir)/result/namespaces/$$name.err \ - > $(srcdir)/result/namespaces/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/namespaces/$$name result.$$name ; \ - diff $(srcdir)/result/namespaces/$$name.err error.$$name`; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -IDtests : xmllint$(EXEEXT) testXPath$(EXEEXT) - @(echo > .memdump) - @echo "## xml:id regression tests" - -@(for i in $(srcdir)/test/xmlid/id_*.xml ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/xmlid/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" \ - 2> $(srcdir)/result/xmlid/$$name.err \ - > $(srcdir)/result/xmlid/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" 2> error.$$name > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/xmlid/$$name result.$$name ; \ - diff $(srcdir)/result/xmlid/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -Errtests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Error cases regression tests" - -@(for i in $(srcdir)/test/errors/*.xml ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/errors/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i \ - 2> $(srcdir)/result/errors/$$name.err \ - > $(srcdir)/result/errors/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/errors/$$name result.$$name ; \ - diff $(srcdir)/result/errors/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - @echo "## Error cases stream regression tests" - -@(for i in $(srcdir)/test/errors/*.xml ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/errors/$$name.str ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --stream $$i \ - 2> $(srcdir)/result/errors/$$name.str \ - > /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/errors/$$name.str error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm error.$$name ; \ - fi ; fi ; done) - -Docbtests : xmllint$(EXEEXT) - -XMLenttests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML entity subst regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/noent/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --noent $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/noent/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noent result.$$name 2>&1 > result2.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -URItests : testURI$(EXEEXT) - @(echo > .memdump) - @echo "## URI module regression tests" - -@(for i in $(srcdir)/test/URI/*.data ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/URI/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/URI/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/URI/*.uri ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/URI/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testURI < $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/URI/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -XPathtests : testXPath$(EXEEXT) - @(echo > .memdump) - @echo "## XPath regression tests" - -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \ - then echo Skipping debug not compiled in ; exit 0 ; fi ; \ - for i in $(srcdir)/test/XPath/expr/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -f --expr $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XPath/expr/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ; \ - for i in $(srcdir)/test/XPath/docs/* ; do \ - if [ ! -d $$i ] ; then \ - doc=`basename $$i`; \ - for j in $(srcdir)/test/XPath/tests/$$doc* ; do \ - if [ ! -f $$j ] ; then continue ; fi ; \ - name=`basename $$j`; \ - if [ ! -d $$j ] ; then \ - if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XPath/tests/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ; fi ; done) - -XPtrtests : testXPath$(EXEEXT) - @(echo > .memdump) - @echo "## XPointer regression tests" - -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \ - then echo Skipping debug not compiled in ; exit 0 ; fi ; \ - for i in $(srcdir)/test/XPath/docs/* ; do \ - if [ ! -d $$i ] ; then \ - doc=`basename $$i`; \ - for j in $(srcdir)/test/XPath/xptr/$$doc* ; do \ - if [ ! -f $$j ] ; then continue ; fi ; \ - name=`basename $$j`; \ - if [ ! -d $$j ] ; then \ - if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XPath/xptr/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ; fi ; done) - -XIncludetests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XInclude regression tests" - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name result.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name result.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - @(echo > .memdump) - @echo "## XInclude xmlReader regression tests" - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -Scripttests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Scripts regression tests" - @echo "## Some of the base computations may be different if srcdir != ." - -@(for i in $(srcdir)/test/scripts/*.script ; do \ - name=`basename $$i .script`; \ - xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \ - if [ -f $$xml ] ; then \ - if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/scripts/$$name result.$$name ; \ - diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result.$$name.err ; \ - fi ; fi ; done) - -Catatests : xmlcatalog$(EXEEXT) - @(echo > .memdump) - @echo "## Catalog regression tests" - -@(for i in $(srcdir)/test/catalogs/*.script ; do \ - name=`basename $$i .script`; \ - xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \ - if [ -f $$xml ] ; then \ - if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/catalogs/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/catalogs/*.script ; do \ - name=`basename $$i .script`; \ - sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \ - if [ -f $$sgml ] ; then \ - if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/catalogs/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Add and del operations on XML Catalogs" - -@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - rm -f $(srcdir)/result/catalogs/mycatalog) - -SVGtests : xmllint$(EXEEXT) - @echo "## SVG parsing regression tests" - -@(for i in $(srcdir)/test/SVG/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - echo Testing $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/SVG/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff result.$$name result2.$$name ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -Threadtests : testThreads$(EXEEXT) - @echo "## Threaded regression tests" - -@($(CHECKER) $(top_builddir)/testThreads ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - exit 0) - -Readertests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Reader regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Reader on memory regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @(echo > .memdump) - @echo "## Walker regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Reader entities substitution regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rde ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > $(srcdir)/result/$$name.rde 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rde result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -SAXtests : testSAX$(EXEEXT) - @(echo > .memdump) - @echo "## SAX1 callbacks regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.sax ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testSAX $$i > $(srcdir)/result/$$name.sax 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testSAX $$i > result.$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.sax result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## SAX2 callbacks regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.sax2 ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testSAX --sax2 $$i > $(srcdir)/result/$$name.sax2 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testSAX --sax2 $$i > result.$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.sax2 result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -Validtests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Valid documents regression tests" - -@(for i in $(srcdir)/test/VCM/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - log=`$(CHECKER) $(top_builddir)/xmllint --valid --noout --nowarning $$i ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`;\ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - fi ; done ; exit 0) - @echo "## Validity checking regression tests" - -@(for i in $(srcdir)/test/VC/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/VC/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/VC/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## General documents valid regression tests" - -@(for i in $(srcdir)/test/valid/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/valid/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/valid/$$name result.$$name ; \ - diff $(srcdir)/result/valid/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -Regexptests: testRegexp$(EXEEXT) - @(echo > .memdump) - @echo "## Regexp regression tests" - -@(for i in $(srcdir)/test/regexp/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/regexp/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Formal expresssions regression tests" - -@(for i in $(srcdir)/test/expr/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/expr/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testRegexp --expr -i $$i > $(srcdir)/result/expr/$$name; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testRegexp --expr -i $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/expr/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -Automatatests: testAutomata$(EXEEXT) - @(echo > .memdump) - @echo "## Automata regression tests" - -@(for i in $(srcdir)/test/automata/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/automata/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testAutomata $$i > $(srcdir)/result/automata/$$name; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testAutomata $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/automata/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -dba100000.xml: dbgenattr.pl - @echo "## generating dba100000.xml" - @($(PERL) $(top_srcdir)/dbgenattr.pl 100000 > dba100000.xml) - -Timingtests: xmllint$(EXEEXT) dba100000.xml - @echo "## Timing tests to try to detect performance" - @echo "## as well a memory usage breakage when streaming" - @echo "## 1/ using the file interface" - @echo "## 2/ using the memory interface" - @echo "## 3/ repeated DOM parsing" - @echo "## 4/ repeated DOM validation" - -@($(top_builddir)/xmllint --stream --timing dba100000.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -VTimingtests: xmllint$(EXEEXT) - -@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -C14Ntests : testC14N$(EXEEXT) - @echo "## C14N and XPath regression tests" - -@(for m in with-comments without-comments 1-1-without-comments exc-without-comments ; do \ - for i in $(srcdir)/test/c14n/$$m/*.xml ; do \ - if [ ! -d $$i ] ; then \ - name=`basename $$i .xml`; \ - cmdline="$(CHECKER) $(top_builddir)/testC14N --$$m $$i"; \ - if [ -f $(srcdir)/test/c14n/$$m/$$name.xpath ] ; then \ - cmdline="$$cmdline $(srcdir)/test/c14n/$$m/$$name.xpath"; \ - if [ -f $(srcdir)/test/c14n/$$m/$$name.ns ] ; then \ - cmdline="$$cmdline '`cat $(srcdir)/test/c14n/$$m/$$name.ns`'"; \ - fi; \ - fi; \ - $$cmdline > $(srcdir)/test/c14n/test.tmp; \ - if [ $$? -eq 0 ]; then \ - diff $(srcdir)/result/c14n/$$m/$$name $(srcdir)/test/c14n/test.tmp; \ - if [ $$? -ne 0 ]; then \ - echo "Test $$m/$$name failed"; \ - cat $(srcdir)/test/c14n/test.tmp; \ - fi; \ - else \ - echo "C14N failed"; \ - fi; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - fi; \ - rm -f $(srcdir)/test/c14n/test.tmp; \ - done; \ - done) - -Schemastests: testSchemas$(EXEEXT) - @(echo > .memdump) - @echo "## Schemas regression tests" - -@(for i in $(srcdir)/test/schemas/*_*.xsd ; do \ - name=`basename $$i | sed 's+_.*++'`; \ - sno=`basename $$i | sed 's+.*_\(.*\).xsd+\1+'`; \ - for j in $(srcdir)/test/schemas/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$sno"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/testSchemas $$i $$j \ - > $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \ - 2> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testSchemas $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \ - res.$$name;\ - diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err \ - err.$$name;\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$sno"_"$$xno" result ; echo $$log ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ;\ - done; done) - -Relaxtests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Relax-NG regression tests" - -@(for i in $(srcdir)/test/relaxng/*.rng ; do \ - name=`basename $$i | sed 's+\.rng++'`; \ - if [ ! -f $(srcdir)/result/relaxng/"$$name"_valid ] ; then \ - echo New schemas $$name ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \ - > $(srcdir)/result/relaxng/"$$name"_valid \ - 2> $(srcdir)/result/relaxng/"$$name"_err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/relaxng/"$$name"_valid \ - res.$$name;\ - diff $(srcdir)/result/relaxng/"$$name"_err \ - err.$$name | grep -v "error detected at";\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo schemas $$name result ; echo $$log ; fi ; \ - rm res.$$name err.$$name ; \ - fi; \ - for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ - > $(srcdir)/result/relaxng/"$$name"_"$$xno" \ - 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno" \ - res.$$name;\ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \ - err.$$name | grep -v "error detected at";\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ; \ - done; done) - @echo "## Relax-NG streaming regression tests" - -@(for i in $(srcdir)/test/relaxng/*.rng ; do \ - name=`basename $$i | sed 's+\.rng++'`; \ - for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ - > $(srcdir)/result/relaxng/"$$name"_"$$xno" \ - 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --stream --relaxng $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno" res.$$name;\ - if [ "$$name" != "tutor10_1" -a "$$name" != "tutor10_2" -a "$$name" != "tutor3_2" -a "$$name" != "307377" -a "$$name" != "tutor8_2" ] ; then \ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \ - err.$$name | grep -v "error detected at";\ - fi ; grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ; \ - done; done) - -Schematrontests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Schematron regression tests" - -@(for i in $(srcdir)/test/schematron/*.sct ; do \ - name=`basename $$i | sed 's+\.sct++'`; \ - for j in $(srcdir)/test/schematron/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \ - > $(srcdir)/result/schematron/"$$name"_"$$xno" \ - 2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/schematron/"$$name"_"$$xno" \ - res.$$name;\ - diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \ - err.$$name | grep -v "error detected at";\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ; \ - done; done) - -RelaxNGPythonTests: - @(if [ -x $(PYTHON) ] ; then \ - PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \ - export PYTHONPATH; \ - LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ - export LD_LIBRARY_PATH; \ - echo "## Relax-NG Python based test suite 1" ; \ - $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \ - echo "## Relax-NG Python based test suite 2" ; \ - $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite2.py ; \ - fi) - -SchemasPythonTests: - @(if [ -x $(PYTHON) ] ; then \ - PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \ - export PYTHONPATH; \ - LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ - export LD_LIBRARY_PATH; \ - echo "## XML Schemas datatypes Python based test suite" ; \ - echo "## It is normal to see 11 errors reported" ; \ - $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \ - fi) - @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi) - -Patterntests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Pattern regression tests" - -@(for i in $(srcdir)/test/pattern/*.pat ; do \ - name=`basename $$i .pat`; \ - if [ -f $(srcdir)/test/pattern/$$name.xml ] ; then \ - if [ ! -f $(srcdir)/result/pattern/$$name ] ; then \ - rm -f result.$$name ; \ - echo New test file $$name ; \ - for pat in `cat $$i` ; do \ - $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml >> $(srcdir)/result/pattern/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - done ;\ - else \ - rm -f result.$$name ; \ - lst=`cat $$i` ; \ - log=`for pat in $$lst ; do $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml 2>&1 >> result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - done ;\ - diff $(srcdir)/result/pattern/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ;) - -ModuleTests: testModule$(EXEEXT) testdso.la - @echo "## Module tests" - @(./testModule$(EXEEXT)) - -cleanup: - -@(find . -name .\#\* -exec rm {} \;) - -@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;) - -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;) - -dist-hook: cleanup libxml2.spec - -cp libxml2.spec $(distdir) - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git win32 macos vms VxWorks bakefile test result) | (cd $(distdir); tar xf -) - -dist-source: distdir - $(AMTAR) -chof - --exclude Tests --exclude test --exclude result $(distdir) | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-sources+"`.tar.gz - -dist-test: distdir - (mkdir -p $(distdir)) - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git xstc/Tests) | (cd $(distdir); tar xf -) - tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README $(distdir)/README.tests $(distdir)/AUTHORS $(distdir)/testapi.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz - @(rm -rf $(distdir)/xstc/Test) - -cleantar: - @(rm -f libxml*.tar.gz COPYING.LIB) - -rpm: cleanup cleantar - @(unset CDPATH ; $(MAKE) dist-source dist && rpmbuild -ta $(distdir).tar.gz) - -## We create xml2Conf.sh here and not from configure because we want -## to get the paths expanded correctly. Macros like srcdir are given -## the value NONE in configure if the user doesn't specify them (this -## is an autoconf feature, not a bug). - -xml2Conf.sh: xml2Conf.sh.in Makefile -## Use sed and then mv to avoid problems if the user interrupts. - sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \ - -e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \ - -e 's?\@VERSION\@?$(VERSION)?g' \ - -e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \ - < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \ - && mv xml2Conf.tmp xml2Conf.sh - -CLEANFILES = runxmlconf.log test.out xml2Conf.sh *.gcda *.gcno *.res -DISTCLEANFILES = COPYING missing.lst - -confexecdir=$(libdir) -confexec_DATA = xml2Conf.sh -CVS_EXTRA_DIST= -EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \ - libxml.m4 Copyright check-xml-test-suite.py gentest.py \ - check-relaxng-test-suite.py check-relaxng-test-suite2.py \ - check-xsddata-test-suite.py check-xinclude-test-suite.py \ - example/Makefile.am example/gjobread.c example/gjobs.xml \ - $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \ - trionan.c trionan.h triostr.c triostr.h trio.c trio.h \ - triop.h triodef.h libxml.h elfgcchack.h xzlib.h buf.h \ - enc.h save.h testThreadsWin32.c genUnicode.py TODO_SCHEMAS \ - dbgen.pl dbgenattr.pl regressions.py regressions.xml \ - README.tests Makefile.tests libxml2.syms timsort.h \ - $(CVS_EXTRA_DIST) - - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libxml-2.0.pc - -# -# Install the tests program sources as examples -# -BASE_DIR=$(datadir)/doc -DOC_MODULE=libxml2-$(VERSION) -EXAMPLES_DIR=$(BASE_DIR)/$(DOC_MODULE)/examples - -install-data-local: - $(MKDIR_P) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - -$(INSTALL) -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - $(MKDIR_P) $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR) - -uninstall-local: - rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c - rm -f $(DESTDIR)$(EXAMPLES_DIR)/testHTML.c - rm -f $(DESTDIR)$(EXAMPLES_DIR)/testSAX.c - rm -f $(DESTDIR)$(EXAMPLES_DIR)/xmllint.c - rm -rf $(DESTDIR)$(EXAMPLES_DIR) - rm -f $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)/Copyright - rm -rf $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - -tst: tst.c - $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz -llzma - -sparse: clean - $(MAKE) CC=cgcc - -# -# Coverage support, largely borrowed from libvirt -# Both binaries comes from the lcov package in Fedora -# -LCOV = /usr/bin/lcov -GENHTML = /usr/bin/genhtml - -cov: clean-cov - if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \ - echo not configured with coverage; exit 1 ; fi - if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \ - echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi - -@($(MAKE) check) - -@(./runsuite$(EXEEXT)) - mkdir $(top_builddir)/coverage - $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir) - $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr* - rm $(top_builddir)/coverage/libxml2.info.tmp - $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info - echo "Coverage report is in $(top_builddir)/coverage/index.html" - -clean-cov: - rm -rf $(top_builddir)/coverage - diff --git a/reactos/lib/3rdparty/libxml2/Makefile.in b/reactos/lib/3rdparty/libxml2/Makefile.in deleted file mode 100644 index 63d82280286..00000000000 --- a/reactos/lib/3rdparty/libxml2/Makefile.in +++ /dev/null @@ -1,2791 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - - - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -noinst_PROGRAMS = testSchemas$(EXEEXT) testRelax$(EXEEXT) \ - testSAX$(EXEEXT) testHTML$(EXEEXT) testXPath$(EXEEXT) \ - testURI$(EXEEXT) testThreads$(EXEEXT) testC14N$(EXEEXT) \ - testAutomata$(EXEEXT) testRegexp$(EXEEXT) testReader$(EXEEXT) \ - testapi$(EXEEXT) testModule$(EXEEXT) runtest$(EXEEXT) \ - runsuite$(EXEEXT) testchar$(EXEEXT) testdict$(EXEEXT) \ - runxmlconf$(EXEEXT) testrecurse$(EXEEXT) testlimits$(EXEEXT) -bin_PROGRAMS = xmllint$(EXEEXT) xmlcatalog$(EXEEXT) -subdir = . -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(srcdir)/libxml-2.0-uninstalled.pc.in \ - $(srcdir)/libxml-2.0.pc.in $(srcdir)/libxml.spec.in \ - $(srcdir)/xml2-config.in $(top_srcdir)/configure AUTHORS \ - COPYING ChangeLog INSTALL NEWS TODO config.guess config.sub \ - depcomp install-sh ltmain.sh missing -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ - configure.lineno config.status.lineno -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = libxml2.spec xml2-config libxml-2.0.pc \ - libxml-2.0-uninstalled.pc -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ - "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(confexecdir)" \ - "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)" -LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) -am__DEPENDENCIES_1 = -libxml2_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am__libxml2_la_SOURCES_DIST = SAX.c entities.c encoding.c error.c \ - parserInternals.c parser.c tree.c hash.c list.c xmlIO.c \ - xmlmemory.c uri.c valid.c xlink.c HTMLparser.c HTMLtree.c \ - debugXML.c xpath.c xpointer.c xinclude.c nanohttp.c nanoftp.c \ - DOCBparser.c catalog.c globals.c threads.c c14n.c xmlstring.c \ - buf.c xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ - triostr.c trio.c xmlreader.c relaxng.c dict.c SAX2.c \ - xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c xmlmodule.c \ - schematron.c xzlib.c -@WITH_SAX1_SOURCES_TRUE@am__objects_1 = DOCBparser.lo -@WITH_TRIO_SOURCES_TRUE@am__objects_2 = triostr.lo trio.lo -am_libxml2_la_OBJECTS = SAX.lo entities.lo encoding.lo error.lo \ - parserInternals.lo parser.lo tree.lo hash.lo list.lo xmlIO.lo \ - xmlmemory.lo uri.lo valid.lo xlink.lo HTMLparser.lo \ - HTMLtree.lo debugXML.lo xpath.lo xpointer.lo xinclude.lo \ - nanohttp.lo nanoftp.lo $(am__objects_1) catalog.lo globals.lo \ - threads.lo c14n.lo xmlstring.lo buf.lo xmlregexp.lo \ - xmlschemas.lo xmlschemastypes.lo xmlunicode.lo \ - $(am__objects_2) xmlreader.lo relaxng.lo dict.lo SAX2.lo \ - xmlwriter.lo legacy.lo chvalid.lo pattern.lo xmlsave.lo \ - xmlmodule.lo schematron.lo xzlib.lo -libxml2_la_OBJECTS = $(am_libxml2_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -libxml2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libxml2_la_LDFLAGS) $(LDFLAGS) -o $@ -testdso_la_LIBADD = -am_testdso_la_OBJECTS = testdso.lo -testdso_la_OBJECTS = $(am_testdso_la_OBJECTS) -testdso_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testdso_la_LDFLAGS) $(LDFLAGS) -o $@ -PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) -am_runsuite_OBJECTS = runsuite.$(OBJEXT) -runsuite_OBJECTS = $(am_runsuite_OBJECTS) -am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(top_builddir)/libxml2.la \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) -runsuite_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(runsuite_LDFLAGS) $(LDFLAGS) -o $@ -am_runtest_OBJECTS = runtest.$(OBJEXT) -runtest_OBJECTS = $(am_runtest_OBJECTS) -runtest_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(runtest_LDFLAGS) $(LDFLAGS) -o $@ -am_runxmlconf_OBJECTS = runxmlconf.$(OBJEXT) -runxmlconf_OBJECTS = $(am_runxmlconf_OBJECTS) -runxmlconf_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(runxmlconf_LDFLAGS) $(LDFLAGS) -o $@ -am_testAutomata_OBJECTS = testAutomata.$(OBJEXT) -testAutomata_OBJECTS = $(am_testAutomata_OBJECTS) -testAutomata_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testAutomata_LDFLAGS) $(LDFLAGS) -o $@ -am_testC14N_OBJECTS = testC14N.$(OBJEXT) -testC14N_OBJECTS = $(am_testC14N_OBJECTS) -testC14N_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testC14N_LDFLAGS) $(LDFLAGS) -o $@ -am_testHTML_OBJECTS = testHTML.$(OBJEXT) -testHTML_OBJECTS = $(am_testHTML_OBJECTS) -testHTML_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testHTML_LDFLAGS) $(LDFLAGS) -o $@ -am_testModule_OBJECTS = testModule.$(OBJEXT) -testModule_OBJECTS = $(am_testModule_OBJECTS) -testModule_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testModule_LDFLAGS) $(LDFLAGS) -o $@ -am_testReader_OBJECTS = testReader.$(OBJEXT) -testReader_OBJECTS = $(am_testReader_OBJECTS) -testReader_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testReader_LDFLAGS) $(LDFLAGS) -o $@ -am_testRegexp_OBJECTS = testRegexp.$(OBJEXT) -testRegexp_OBJECTS = $(am_testRegexp_OBJECTS) -testRegexp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testRegexp_LDFLAGS) $(LDFLAGS) -o $@ -am_testRelax_OBJECTS = testRelax.$(OBJEXT) -testRelax_OBJECTS = $(am_testRelax_OBJECTS) -testRelax_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testRelax_LDFLAGS) $(LDFLAGS) -o $@ -am_testSAX_OBJECTS = testSAX.$(OBJEXT) -testSAX_OBJECTS = $(am_testSAX_OBJECTS) -testSAX_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testSAX_LDFLAGS) $(LDFLAGS) -o $@ -am_testSchemas_OBJECTS = testSchemas.$(OBJEXT) -testSchemas_OBJECTS = $(am_testSchemas_OBJECTS) -testSchemas_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testSchemas_LDFLAGS) $(LDFLAGS) -o $@ -am__testThreads_SOURCES_DIST = testThreads.c testThreadsWin32.c -@THREADS_W32_FALSE@am_testThreads_OBJECTS = testThreads.$(OBJEXT) -@THREADS_W32_TRUE@am_testThreads_OBJECTS = testThreadsWin32.$(OBJEXT) -testThreads_OBJECTS = $(am_testThreads_OBJECTS) -testThreads_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testThreads_LDFLAGS) $(LDFLAGS) -o $@ -am_testURI_OBJECTS = testURI.$(OBJEXT) -testURI_OBJECTS = $(am_testURI_OBJECTS) -testURI_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testURI_LDFLAGS) $(LDFLAGS) -o $@ -am_testXPath_OBJECTS = testXPath.$(OBJEXT) -testXPath_OBJECTS = $(am_testXPath_OBJECTS) -testXPath_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testXPath_LDFLAGS) $(LDFLAGS) -o $@ -am_testapi_OBJECTS = testapi.$(OBJEXT) -testapi_OBJECTS = $(am_testapi_OBJECTS) -testapi_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testapi_LDFLAGS) $(LDFLAGS) -o $@ -am_testchar_OBJECTS = testchar.$(OBJEXT) -testchar_OBJECTS = $(am_testchar_OBJECTS) -testchar_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testchar_LDFLAGS) $(LDFLAGS) -o $@ -am_testdict_OBJECTS = testdict.$(OBJEXT) -testdict_OBJECTS = $(am_testdict_OBJECTS) -testdict_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testdict_LDFLAGS) $(LDFLAGS) -o $@ -am_testlimits_OBJECTS = testlimits.$(OBJEXT) -testlimits_OBJECTS = $(am_testlimits_OBJECTS) -testlimits_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testlimits_LDFLAGS) $(LDFLAGS) -o $@ -am_testrecurse_OBJECTS = testrecurse.$(OBJEXT) -testrecurse_OBJECTS = $(am_testrecurse_OBJECTS) -testrecurse_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(testrecurse_LDFLAGS) $(LDFLAGS) -o $@ -am_xmlcatalog_OBJECTS = xmlcatalog.$(OBJEXT) -xmlcatalog_OBJECTS = $(am_xmlcatalog_OBJECTS) -xmlcatalog_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(xmlcatalog_LDFLAGS) $(LDFLAGS) -o $@ -am_xmllint_OBJECTS = xmllint.$(OBJEXT) -xmllint_OBJECTS = $(am_xmllint_OBJECTS) -xmllint_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(xmllint_LDFLAGS) $(LDFLAGS) -o $@ -SCRIPTS = $(bin_SCRIPTS) -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(libxml2_la_SOURCES) $(testdso_la_SOURCES) \ - $(runsuite_SOURCES) $(runtest_SOURCES) $(runxmlconf_SOURCES) \ - $(testAutomata_SOURCES) $(testC14N_SOURCES) \ - $(testHTML_SOURCES) $(testModule_SOURCES) \ - $(testReader_SOURCES) $(testRegexp_SOURCES) \ - $(testRelax_SOURCES) $(testSAX_SOURCES) $(testSchemas_SOURCES) \ - $(testThreads_SOURCES) $(testURI_SOURCES) $(testXPath_SOURCES) \ - $(testapi_SOURCES) $(testchar_SOURCES) $(testdict_SOURCES) \ - $(testlimits_SOURCES) $(testrecurse_SOURCES) \ - $(xmlcatalog_SOURCES) $(xmllint_SOURCES) -DIST_SOURCES = $(am__libxml2_la_SOURCES_DIST) $(testdso_la_SOURCES) \ - $(runsuite_SOURCES) $(runtest_SOURCES) $(runxmlconf_SOURCES) \ - $(testAutomata_SOURCES) $(testC14N_SOURCES) \ - $(testHTML_SOURCES) $(testModule_SOURCES) \ - $(testReader_SOURCES) $(testRegexp_SOURCES) \ - $(testRelax_SOURCES) $(testSAX_SOURCES) $(testSchemas_SOURCES) \ - $(am__testThreads_SOURCES_DIST) $(testURI_SOURCES) \ - $(testXPath_SOURCES) $(testapi_SOURCES) $(testchar_SOURCES) \ - $(testdict_SOURCES) $(testlimits_SOURCES) \ - $(testrecurse_SOURCES) $(xmlcatalog_SOURCES) \ - $(xmllint_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -man1dir = $(mandir)/man1 -man3dir = $(mandir)/man3 -NROFF = nroff -MANS = $(man_MANS) -DATA = $(confexec_DATA) $(m4data_DATA) $(pkgconfig_DATA) -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) -am__remove_distdir = \ - if test -d "$(distdir)"; then \ - find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -rf "$(distdir)" \ - || { sleep 5 && rm -rf "$(distdir)"; }; \ - else :; fi -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -DIST_ARCHIVES = $(distdir).tar.gz -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ - | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' -distcleancheck_listfiles = find . -type f -print -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_THREAD_LIBS = @BASE_THREAD_LIBS@ -C14N_OBJ = @C14N_OBJ@ -CATALOG_OBJ = @CATALOG_OBJ@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ -CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@ -DEBUG_OBJ = @DEBUG_OBJ@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DOCB_OBJ = @DOCB_OBJ@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FTP_OBJ = @FTP_OBJ@ -GREP = @GREP@ -HAVE_ISINF = @HAVE_ISINF@ -HAVE_ISNAN = @HAVE_ISNAN@ -HTML_DIR = @HTML_DIR@ -HTML_OBJ = @HTML_OBJ@ -HTTP_OBJ = @HTTP_OBJ@ -ICONV_LIBS = @ICONV_LIBS@ -ICU_LIBS = @ICU_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ -LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ -LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ -LIBXML_VERSION = @LIBXML_VERSION@ -LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@ -LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ -LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LZMA_CFLAGS = @LZMA_CFLAGS@ -LZMA_LIBS = @LZMA_LIBS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MODULE_EXTENSION = @MODULE_EXTENSION@ -MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ -MV = @MV@ -M_LIBS = @M_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PYTHON = @PYTHON@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ -PYTHON_SUBDIR = @PYTHON_SUBDIR@ -PYTHON_TESTS = @PYTHON_TESTS@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -RDL_LIBS = @RDL_LIBS@ -READER_TEST = @READER_TEST@ -RELDATE = @RELDATE@ -RM = @RM@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STATIC_BINARIES = @STATIC_BINARIES@ -STRIP = @STRIP@ -TAR = @TAR@ -TEST_C14N = @TEST_C14N@ -TEST_CATALOG = @TEST_CATALOG@ -TEST_DEBUG = @TEST_DEBUG@ -TEST_HTML = @TEST_HTML@ -TEST_MODULES = @TEST_MODULES@ -TEST_PATTERN = @TEST_PATTERN@ -TEST_PHTML = @TEST_PHTML@ -TEST_PUSH = @TEST_PUSH@ -TEST_REGEXPS = @TEST_REGEXPS@ -TEST_SAX = @TEST_SAX@ -TEST_SCHEMAS = @TEST_SCHEMAS@ -TEST_SCHEMATRON = @TEST_SCHEMATRON@ -TEST_THREADS = @TEST_THREADS@ -TEST_VALID = @TEST_VALID@ -TEST_VTIME = @TEST_VTIME@ -TEST_XINCLUDE = @TEST_XINCLUDE@ -TEST_XPATH = @TEST_XPATH@ -TEST_XPTR = @TEST_XPTR@ -THREAD_CFLAGS = @THREAD_CFLAGS@ -THREAD_LIBS = @THREAD_LIBS@ -VERSION = @VERSION@ -VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WGET = @WGET@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ -WIN32_EXTRA_PYTHON_LIBADD = @WIN32_EXTRA_PYTHON_LIBADD@ -WITH_C14N = @WITH_C14N@ -WITH_CATALOG = @WITH_CATALOG@ -WITH_DEBUG = @WITH_DEBUG@ -WITH_DOCB = @WITH_DOCB@ -WITH_FTP = @WITH_FTP@ -WITH_HTML = @WITH_HTML@ -WITH_HTTP = @WITH_HTTP@ -WITH_ICONV = @WITH_ICONV@ -WITH_ICU = @WITH_ICU@ -WITH_ISO8859X = @WITH_ISO8859X@ -WITH_LEGACY = @WITH_LEGACY@ -WITH_LZMA = @WITH_LZMA@ -WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ -WITH_MODULES = @WITH_MODULES@ -WITH_OUTPUT = @WITH_OUTPUT@ -WITH_PATTERN = @WITH_PATTERN@ -WITH_PUSH = @WITH_PUSH@ -WITH_READER = @WITH_READER@ -WITH_REGEXPS = @WITH_REGEXPS@ -WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ -WITH_SAX1 = @WITH_SAX1@ -WITH_SCHEMAS = @WITH_SCHEMAS@ -WITH_SCHEMATRON = @WITH_SCHEMATRON@ -WITH_THREADS = @WITH_THREADS@ -WITH_TREE = @WITH_TREE@ -WITH_TRIO = @WITH_TRIO@ -WITH_VALID = @WITH_VALID@ -WITH_WRITER = @WITH_WRITER@ -WITH_XINCLUDE = @WITH_XINCLUDE@ -WITH_XPATH = @WITH_XPATH@ -WITH_XPTR = @WITH_XPTR@ -WITH_ZLIB = @WITH_ZLIB@ -XINCLUDE_OBJ = @XINCLUDE_OBJ@ -XMLLINT = @XMLLINT@ -XML_CFLAGS = @XML_CFLAGS@ -XML_INCLUDEDIR = @XML_INCLUDEDIR@ -XML_LIBDIR = @XML_LIBDIR@ -XML_LIBS = @XML_LIBS@ -XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@ -XPATH_OBJ = @XPATH_OBJ@ -XPTR_OBJ = @XPTR_OBJ@ -XSLTPROC = @XSLTPROC@ -Z_CFLAGS = @Z_CFLAGS@ -Z_LIBS = @Z_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR) -DIST_SUBDIRS = include . doc example python xstc -AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include -AM_CFLAGS = $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS) -bin_SCRIPTS = xml2-config -lib_LTLIBRARIES = libxml2.la -libxml2_la_LIBADD = $(ICU_LIBS) $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) -@USE_VERSION_SCRIPT_FALSE@LIBXML2_VERSION_SCRIPT = -@USE_VERSION_SCRIPT_TRUE@LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms -libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \ - $(LIBXML2_VERSION_SCRIPT) \ - -version-info $(LIBXML_VERSION_INFO) \ - $(MODULE_PLATFORM_LIBS) - -@WITH_SAX1_SOURCES_FALSE@docb_sources = -@WITH_SAX1_SOURCES_TRUE@docb_sources = DOCBparser.c -@WITH_TRIO_SOURCES_FALSE@trio_sources = -@WITH_TRIO_SOURCES_TRUE@trio_sources = triostr.c trio.c -libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \ - parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \ - valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \ - xpointer.c xinclude.c nanohttp.c nanoftp.c \ - $(docb_sources) \ - catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \ - xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \ - $(trio_sources) \ - xmlreader.c relaxng.c dict.c SAX2.c \ - xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \ - xmlmodule.c schematron.c xzlib.c - -DEPS = $(top_builddir)/libxml2.la -LDADDS = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD) -man_MANS = xml2-config.1 libxml.3 -m4datadir = $(datadir)/aclocal -m4data_DATA = libxml.m4 -runtest_SOURCES = runtest.c -runtest_LDFLAGS = -runtest_DEPENDENCIES = $(DEPS) -runtest_LDADD = $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) -testrecurse_SOURCES = testrecurse.c -testrecurse_LDFLAGS = -testrecurse_DEPENDENCIES = $(DEPS) -testrecurse_LDADD = $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) -testlimits_SOURCES = testlimits.c -testlimits_LDFLAGS = -testlimits_DEPENDENCIES = $(DEPS) -testlimits_LDADD = $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS) -testchar_SOURCES = testchar.c -testchar_LDFLAGS = -testchar_DEPENDENCIES = $(DEPS) -testchar_LDADD = $(RDL_LIBS) $(LDADDS) -testdict_SOURCES = testdict.c -testdict_LDFLAGS = -testdict_DEPENDENCIES = $(DEPS) -testdict_LDADD = $(RDL_LIBS) $(LDADDS) -runsuite_SOURCES = runsuite.c -runsuite_LDFLAGS = -runsuite_DEPENDENCIES = $(DEPS) -runsuite_LDADD = $(RDL_LIBS) $(LDADDS) -xmllint_SOURCES = xmllint.c -xmllint_LDFLAGS = -xmllint_DEPENDENCIES = $(DEPS) -xmllint_LDADD = $(RDL_LIBS) $(LDADDS) -testSAX_SOURCES = testSAX.c -testSAX_LDFLAGS = -testSAX_DEPENDENCIES = $(DEPS) -testSAX_LDADD = $(LDADDS) -testHTML_SOURCES = testHTML.c -testHTML_LDFLAGS = -testHTML_DEPENDENCIES = $(DEPS) -testHTML_LDADD = $(LDADDS) -xmlcatalog_SOURCES = xmlcatalog.c -xmlcatalog_LDFLAGS = -xmlcatalog_DEPENDENCIES = $(DEPS) -xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS) -testXPath_SOURCES = testXPath.c -testXPath_LDFLAGS = -testXPath_DEPENDENCIES = $(DEPS) -testXPath_LDADD = $(LDADDS) -testC14N_SOURCES = testC14N.c -testC14N_LDFLAGS = -testC14N_DEPENDENCIES = $(DEPS) -testC14N_LDADD = $(LDADDS) -@THREADS_W32_FALSE@testThreads_SOURCES = testThreads.c -@THREADS_W32_TRUE@testThreads_SOURCES = testThreadsWin32.c -testThreads_LDFLAGS = -testThreads_DEPENDENCIES = $(DEPS) -testThreads_LDADD = $(BASE_THREAD_LIBS) $(LDADDS) -testURI_SOURCES = testURI.c -testURI_LDFLAGS = -testURI_DEPENDENCIES = $(DEPS) -testURI_LDADD = $(LDADDS) -testRegexp_SOURCES = testRegexp.c -testRegexp_LDFLAGS = -testRegexp_DEPENDENCIES = $(DEPS) -testRegexp_LDADD = $(LDADDS) -testAutomata_SOURCES = testAutomata.c -testAutomata_LDFLAGS = -testAutomata_DEPENDENCIES = $(DEPS) -testAutomata_LDADD = $(LDADDS) -testSchemas_SOURCES = testSchemas.c -testSchemas_LDFLAGS = -testSchemas_DEPENDENCIES = $(DEPS) -testSchemas_LDADD = $(LDADDS) -testRelax_SOURCES = testRelax.c -testRelax_LDFLAGS = -testRelax_DEPENDENCIES = $(DEPS) -testRelax_LDADD = $(LDADDS) -testReader_SOURCES = testReader.c -testReader_LDFLAGS = -testReader_DEPENDENCIES = $(DEPS) -testReader_LDADD = $(LDADDS) -testModule_SOURCES = testModule.c -testModule_LDFLAGS = -testModule_DEPENDENCIES = $(DEPS) -testModule_LDADD = $(LDADDS) -noinst_LTLIBRARIES = testdso.la -testdso_la_SOURCES = testdso.c -testdso_la_LDFLAGS = -module -no-undefined -avoid-version -rpath $(libdir) -BUILT_SOURCES = testapi.c -testapi_SOURCES = testapi.c -testapi_LDFLAGS = -testapi_DEPENDENCIES = $(DEPS) -testapi_LDADD = $(LDADDS) -runxmlconf_SOURCES = runxmlconf.c -runxmlconf_LDFLAGS = -runxmlconf_DEPENDENCIES = $(DEPS) -runxmlconf_LDADD = $(LDADDS) -CLEANFILES = runxmlconf.log test.out xml2Conf.sh *.gcda *.gcno *.res -DISTCLEANFILES = COPYING missing.lst -confexecdir = $(libdir) -confexec_DATA = xml2Conf.sh -CVS_EXTRA_DIST = -EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \ - libxml.m4 Copyright check-xml-test-suite.py gentest.py \ - check-relaxng-test-suite.py check-relaxng-test-suite2.py \ - check-xsddata-test-suite.py check-xinclude-test-suite.py \ - example/Makefile.am example/gjobread.c example/gjobs.xml \ - $(man_MANS) libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \ - trionan.c trionan.h triostr.c triostr.h trio.c trio.h \ - triop.h triodef.h libxml.h elfgcchack.h xzlib.h buf.h \ - enc.h save.h testThreadsWin32.c genUnicode.py TODO_SCHEMAS \ - dbgen.pl dbgenattr.pl regressions.py regressions.xml \ - README.tests Makefile.tests libxml2.syms timsort.h \ - $(CVS_EXTRA_DIST) - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libxml-2.0.pc - -# -# Install the tests program sources as examples -# -BASE_DIR = $(datadir)/doc -DOC_MODULE = libxml2-$(VERSION) -EXAMPLES_DIR = $(BASE_DIR)/$(DOC_MODULE)/examples - -# -# Coverage support, largely borrowed from libvirt -# Both binaries comes from the lcov package in Fedora -# -LCOV = /usr/bin/lcov -GENHTML = /usr/bin/genhtml -all: $(BUILT_SOURCES) config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -am--refresh: Makefile - @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - echo ' $(SHELL) ./config.status'; \ - $(SHELL) ./config.status;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - $(SHELL) ./config.status --recheck - -$(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi - -stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f config.h stamp-h1 -libxml2.spec: $(top_builddir)/config.status $(srcdir)/libxml.spec.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -xml2-config: $(top_builddir)/config.status $(srcdir)/xml2-config.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -libxml-2.0.pc: $(top_builddir)/config.status $(srcdir)/libxml-2.0.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -libxml-2.0-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/libxml-2.0-uninstalled.pc.in - cd $(top_builddir) && $(SHELL) ./config.status $@ -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - done - -clean-libLTLIBRARIES: - -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -libxml2.la: $(libxml2_la_OBJECTS) $(libxml2_la_DEPENDENCIES) $(EXTRA_libxml2_la_DEPENDENCIES) - $(AM_V_CCLD)$(libxml2_la_LINK) -rpath $(libdir) $(libxml2_la_OBJECTS) $(libxml2_la_LIBADD) $(LIBS) -testdso.la: $(testdso_la_OBJECTS) $(testdso_la_DEPENDENCIES) $(EXTRA_testdso_la_DEPENDENCIES) - $(AM_V_CCLD)$(testdso_la_LINK) $(testdso_la_OBJECTS) $(testdso_la_LIBADD) $(LIBS) -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list - -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ - echo " rm -f" $$list; \ - rm -f $$list || exit $$?; \ - test -n "$(EXEEXT)" || exit 0; \ - list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ - echo " rm -f" $$list; \ - rm -f $$list -runsuite$(EXEEXT): $(runsuite_OBJECTS) $(runsuite_DEPENDENCIES) $(EXTRA_runsuite_DEPENDENCIES) - @rm -f runsuite$(EXEEXT) - $(AM_V_CCLD)$(runsuite_LINK) $(runsuite_OBJECTS) $(runsuite_LDADD) $(LIBS) -runtest$(EXEEXT): $(runtest_OBJECTS) $(runtest_DEPENDENCIES) $(EXTRA_runtest_DEPENDENCIES) - @rm -f runtest$(EXEEXT) - $(AM_V_CCLD)$(runtest_LINK) $(runtest_OBJECTS) $(runtest_LDADD) $(LIBS) -runxmlconf$(EXEEXT): $(runxmlconf_OBJECTS) $(runxmlconf_DEPENDENCIES) $(EXTRA_runxmlconf_DEPENDENCIES) - @rm -f runxmlconf$(EXEEXT) - $(AM_V_CCLD)$(runxmlconf_LINK) $(runxmlconf_OBJECTS) $(runxmlconf_LDADD) $(LIBS) -testAutomata$(EXEEXT): $(testAutomata_OBJECTS) $(testAutomata_DEPENDENCIES) $(EXTRA_testAutomata_DEPENDENCIES) - @rm -f testAutomata$(EXEEXT) - $(AM_V_CCLD)$(testAutomata_LINK) $(testAutomata_OBJECTS) $(testAutomata_LDADD) $(LIBS) -testC14N$(EXEEXT): $(testC14N_OBJECTS) $(testC14N_DEPENDENCIES) $(EXTRA_testC14N_DEPENDENCIES) - @rm -f testC14N$(EXEEXT) - $(AM_V_CCLD)$(testC14N_LINK) $(testC14N_OBJECTS) $(testC14N_LDADD) $(LIBS) -testHTML$(EXEEXT): $(testHTML_OBJECTS) $(testHTML_DEPENDENCIES) $(EXTRA_testHTML_DEPENDENCIES) - @rm -f testHTML$(EXEEXT) - $(AM_V_CCLD)$(testHTML_LINK) $(testHTML_OBJECTS) $(testHTML_LDADD) $(LIBS) -testModule$(EXEEXT): $(testModule_OBJECTS) $(testModule_DEPENDENCIES) $(EXTRA_testModule_DEPENDENCIES) - @rm -f testModule$(EXEEXT) - $(AM_V_CCLD)$(testModule_LINK) $(testModule_OBJECTS) $(testModule_LDADD) $(LIBS) -testReader$(EXEEXT): $(testReader_OBJECTS) $(testReader_DEPENDENCIES) $(EXTRA_testReader_DEPENDENCIES) - @rm -f testReader$(EXEEXT) - $(AM_V_CCLD)$(testReader_LINK) $(testReader_OBJECTS) $(testReader_LDADD) $(LIBS) -testRegexp$(EXEEXT): $(testRegexp_OBJECTS) $(testRegexp_DEPENDENCIES) $(EXTRA_testRegexp_DEPENDENCIES) - @rm -f testRegexp$(EXEEXT) - $(AM_V_CCLD)$(testRegexp_LINK) $(testRegexp_OBJECTS) $(testRegexp_LDADD) $(LIBS) -testRelax$(EXEEXT): $(testRelax_OBJECTS) $(testRelax_DEPENDENCIES) $(EXTRA_testRelax_DEPENDENCIES) - @rm -f testRelax$(EXEEXT) - $(AM_V_CCLD)$(testRelax_LINK) $(testRelax_OBJECTS) $(testRelax_LDADD) $(LIBS) -testSAX$(EXEEXT): $(testSAX_OBJECTS) $(testSAX_DEPENDENCIES) $(EXTRA_testSAX_DEPENDENCIES) - @rm -f testSAX$(EXEEXT) - $(AM_V_CCLD)$(testSAX_LINK) $(testSAX_OBJECTS) $(testSAX_LDADD) $(LIBS) -testSchemas$(EXEEXT): $(testSchemas_OBJECTS) $(testSchemas_DEPENDENCIES) $(EXTRA_testSchemas_DEPENDENCIES) - @rm -f testSchemas$(EXEEXT) - $(AM_V_CCLD)$(testSchemas_LINK) $(testSchemas_OBJECTS) $(testSchemas_LDADD) $(LIBS) -testThreads$(EXEEXT): $(testThreads_OBJECTS) $(testThreads_DEPENDENCIES) $(EXTRA_testThreads_DEPENDENCIES) - @rm -f testThreads$(EXEEXT) - $(AM_V_CCLD)$(testThreads_LINK) $(testThreads_OBJECTS) $(testThreads_LDADD) $(LIBS) -testURI$(EXEEXT): $(testURI_OBJECTS) $(testURI_DEPENDENCIES) $(EXTRA_testURI_DEPENDENCIES) - @rm -f testURI$(EXEEXT) - $(AM_V_CCLD)$(testURI_LINK) $(testURI_OBJECTS) $(testURI_LDADD) $(LIBS) -testXPath$(EXEEXT): $(testXPath_OBJECTS) $(testXPath_DEPENDENCIES) $(EXTRA_testXPath_DEPENDENCIES) - @rm -f testXPath$(EXEEXT) - $(AM_V_CCLD)$(testXPath_LINK) $(testXPath_OBJECTS) $(testXPath_LDADD) $(LIBS) -testapi$(EXEEXT): $(testapi_OBJECTS) $(testapi_DEPENDENCIES) $(EXTRA_testapi_DEPENDENCIES) - @rm -f testapi$(EXEEXT) - $(AM_V_CCLD)$(testapi_LINK) $(testapi_OBJECTS) $(testapi_LDADD) $(LIBS) -testchar$(EXEEXT): $(testchar_OBJECTS) $(testchar_DEPENDENCIES) $(EXTRA_testchar_DEPENDENCIES) - @rm -f testchar$(EXEEXT) - $(AM_V_CCLD)$(testchar_LINK) $(testchar_OBJECTS) $(testchar_LDADD) $(LIBS) -testdict$(EXEEXT): $(testdict_OBJECTS) $(testdict_DEPENDENCIES) $(EXTRA_testdict_DEPENDENCIES) - @rm -f testdict$(EXEEXT) - $(AM_V_CCLD)$(testdict_LINK) $(testdict_OBJECTS) $(testdict_LDADD) $(LIBS) -testlimits$(EXEEXT): $(testlimits_OBJECTS) $(testlimits_DEPENDENCIES) $(EXTRA_testlimits_DEPENDENCIES) - @rm -f testlimits$(EXEEXT) - $(AM_V_CCLD)$(testlimits_LINK) $(testlimits_OBJECTS) $(testlimits_LDADD) $(LIBS) -testrecurse$(EXEEXT): $(testrecurse_OBJECTS) $(testrecurse_DEPENDENCIES) $(EXTRA_testrecurse_DEPENDENCIES) - @rm -f testrecurse$(EXEEXT) - $(AM_V_CCLD)$(testrecurse_LINK) $(testrecurse_OBJECTS) $(testrecurse_LDADD) $(LIBS) -xmlcatalog$(EXEEXT): $(xmlcatalog_OBJECTS) $(xmlcatalog_DEPENDENCIES) $(EXTRA_xmlcatalog_DEPENDENCIES) - @rm -f xmlcatalog$(EXEEXT) - $(AM_V_CCLD)$(xmlcatalog_LINK) $(xmlcatalog_OBJECTS) $(xmlcatalog_LDADD) $(LIBS) -xmllint$(EXEEXT): $(xmllint_OBJECTS) $(xmllint_DEPENDENCIES) $(EXTRA_xmllint_DEPENDENCIES) - @rm -f xmllint$(EXEEXT) - $(AM_V_CCLD)$(xmllint_LINK) $(xmllint_OBJECTS) $(xmllint_LDADD) $(LIBS) -install-binSCRIPTS: $(bin_SCRIPTS) - @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n' \ - -e 'h;s|.*|.|' \ - -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) { files[d] = files[d] " " $$1; \ - if (++n[d] == $(am__install_max)) { \ - print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ - else { print "f", d "/" $$4, $$1 } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binSCRIPTS: - @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 's,.*/,,;$(transform)'`; \ - dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DOCBparser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HTMLparser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HTMLtree.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAX.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SAX2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c14n.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/catalog.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chvalid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugXML.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dict.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encoding.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entities.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanoftp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanohttp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parserInternals.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pattern.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/relaxng.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runsuite.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtest.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runxmlconf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schematron.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testAutomata.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testC14N.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testHTML.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testModule.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testReader.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testRegexp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testRelax.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testSAX.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testSchemas.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testThreads.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testThreadsWin32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testURI.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testXPath.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testapi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testchar.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdso.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testlimits.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrecurse.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trio.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/triostr.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uri.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/valid.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xinclude.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xlink.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlIO.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlcatalog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmllint.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlmemory.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlmodule.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlreader.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlregexp.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlsave.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlschemas.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlschemastypes.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlstring.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlunicode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmlwriter.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpath.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xpointer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xzlib.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt -install-man1: $(man_MANS) - @$(NORMAL_INSTALL) - test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" - @list=''; test -n "$(man1dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ - done; } - -uninstall-man1: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man1dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.1[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) -install-man3: $(man_MANS) - @$(NORMAL_INSTALL) - test -z "$(man3dir)" || $(MKDIR_P) "$(DESTDIR)$(man3dir)" - @list=''; test -n "$(man3dir)" || exit 0; \ - { for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.3[a-z]*$$/p'; \ - } | while read p; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; echo "$$p"; \ - done | \ - sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ - sed 'N;N;s,\n, ,g' | { \ - list=; while read file base inst; do \ - if test "$$base" = "$$inst"; then list="$$list $$file"; else \ - echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ - $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ - fi; \ - done; \ - for i in $$list; do echo "$$i"; done | $(am__base_list) | \ - while read files; do \ - test -z "$$files" || { \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ - done; } - -uninstall-man3: - @$(NORMAL_UNINSTALL) - @list=''; test -n "$(man3dir)" || exit 0; \ - files=`{ for i in $$list; do echo "$$i"; done; \ - l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ - sed -n '/\.3[a-z]*$$/p'; \ - } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ - -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ - dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) -install-confexecDATA: $(confexec_DATA) - @$(NORMAL_INSTALL) - test -z "$(confexecdir)" || $(MKDIR_P) "$(DESTDIR)$(confexecdir)" - @list='$(confexec_DATA)'; test -n "$(confexecdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confexecdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(confexecdir)" || exit $$?; \ - done - -uninstall-confexecDATA: - @$(NORMAL_UNINSTALL) - @list='$(confexec_DATA)'; test -n "$(confexecdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(confexecdir)'; $(am__uninstall_files_from_dir) -install-m4dataDATA: $(m4data_DATA) - @$(NORMAL_INSTALL) - test -z "$(m4datadir)" || $(MKDIR_P) "$(DESTDIR)$(m4datadir)" - @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(m4datadir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(m4datadir)" || exit $$?; \ - done - -uninstall-m4dataDATA: - @$(NORMAL_UNINSTALL) - @list='$(m4data_DATA)'; test -n "$(m4datadir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(m4datadir)'; $(am__uninstall_files_from_dir) -install-pkgconfigDATA: $(pkgconfig_DATA) - @$(NORMAL_INSTALL) - test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ - done - -uninstall-pkgconfigDATA: - @$(NORMAL_UNINSTALL) - @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @list='$(MANS)'; if test -n "$$list"; then \ - list=`for p in $$list; do \ - if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ - if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ - if test -n "$$list" && \ - grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ - echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ - grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ - echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ - echo " typically \`make maintainer-clean' will remove them" >&2; \ - exit 1; \ - else :; fi; \ - else :; fi - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - dist-hook - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) - -dist-lzip: distdir - tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) - -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) - -dist-tarZ: distdir - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - -dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ - *.tar.lz*) \ - lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir); chmod u+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(AM_DISTCHECK_CONFIGURE_FLAGS) \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @test -n '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: trying to run $@ with an empty' \ - '$$(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - $(am__cd) '$(distuninstallcheck_dir)' || { \ - echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ - exit 1; \ - }; \ - test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left after uninstall:" ; \ - if test -n "$(DESTDIR)"; then \ - echo " (check DESTDIR support)"; \ - fi ; \ - $(distuninstallcheck_listfiles) ; \ - exit 1; } >&2 -distcleancheck: distclean - @if test '$(srcdir)' = . ; then \ - echo "ERROR: distcleancheck can only run from a VPATH build" ; \ - exit 1 ; \ - fi - @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ - || { echo "ERROR: files left in build directory after distclean:" ; \ - $(distcleancheck_listfiles) ; \ - exit 1; } >&2 -check-am: all-am -check: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \ - config.h -install-binPROGRAMS: install-libLTLIBRARIES - -installdirs: installdirs-recursive -installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(confexecdir)" "$(DESTDIR)$(m4datadir)" "$(DESTDIR)$(pkgconfigdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: $(BUILT_SOURCES) - $(MAKE) $(AM_MAKEFLAGS) install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -clean: clean-recursive - -clean-am: clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \ - clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ - mostlyclean-am - -distclean: distclean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-hdr distclean-libtool distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: install-data-local install-m4dataDATA install-man \ - install-pkgconfigDATA - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: install-binPROGRAMS install-binSCRIPTS \ - install-confexecDATA install-libLTLIBRARIES - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: install-man1 install-man3 - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ - uninstall-confexecDATA uninstall-libLTLIBRARIES \ - uninstall-local uninstall-m4dataDATA uninstall-man \ - uninstall-pkgconfigDATA - -uninstall-man: uninstall-man1 uninstall-man3 - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ - ctags-recursive install install-am install-strip \ - tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-binPROGRAMS \ - clean-generic clean-libLTLIBRARIES clean-libtool \ - clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags \ - ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \ - dist-lzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ - distcheck distclean distclean-compile distclean-generic \ - distclean-hdr distclean-libtool distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-binPROGRAMS \ - install-binSCRIPTS install-confexecDATA install-data \ - install-data-am install-data-local install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-libLTLIBRARIES \ - install-m4dataDATA install-man install-man1 install-man3 \ - install-pdf install-pdf-am install-pkgconfigDATA install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am \ - uninstall-binPROGRAMS uninstall-binSCRIPTS \ - uninstall-confexecDATA uninstall-libLTLIBRARIES \ - uninstall-local uninstall-m4dataDATA uninstall-man \ - uninstall-man1 uninstall-man3 uninstall-pkgconfigDATA - - -# that one forces the rebuild when "make rebuild" is run on doc/ -rebuild_testapi: - -@(if [ "$(PYTHON)" != "" ] ; then \ - $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi ) - -# that one is just to make sure it is rebuilt if missing -# but adding the dependances generate mess -testapi.c: $(srcdir)/gentest.py - -@(if [ "$(PYTHON)" != "" ] ; then \ - $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi ) - -#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c -#testOOM_LDFLAGS = -#testOOM_DEPENDENCIES = $(DEPS) -#testOOM_LDADD= $(LDADDS) - -runtests: - [ -d test ] || $(LN_S) $(srcdir)/test . - [ -d result ] || $(LN_S) $(srcdir)/result . - $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT) - @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ - $(MAKE) tests ; fi) - -check: all runtests - -check-valgrind valgrind: all - @echo '## Running the regression tests under Valgrind' - @echo '## Go get a cup of coffee it is gonna take a while ...' - $(MAKE) CHECKER='valgrind -q' runtests - -testall : tests SVGtests SAXtests - -tests: XMLtests XMLenttests NStests IDtests Errtests APItests $(READER_TEST) $(TEST_SAX) $(TEST_PUSH) $(TEST_HTML) $(TEST_PHTML) $(TEST_VALID) URItests $(TEST_PATTERN) $(TEST_XPATH) $(TEST_XPTR) $(TEST_XINCLUDE) $(TEST_C14N) $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMAS) $(TEST_SCHEMATRON) $(TEST_THREADS) Timingtests $(TEST_VTIME) $(PYTHON_TESTS) $(TEST_MODULES) - @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \ - $(MAKE) tests ; fi) - @(cd doc/examples ; $(MAKE) tests) - -APItests: testapi$(EXEEXT) - @echo "## Running the API regression tests this may take a little while" - -@($(CHECKER) $(top_builddir)/testapi -q) - -HTMLtests : testHTML$(EXEEXT) - @(echo > .memdump) - @echo "## HTML regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML $$i > result.$$name 2> error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name result.$$name ; \ - diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \ - $(CHECKER) $(top_builddir)/testHTML result.$$name > result2.$$name 2>error.$$name ; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result2.$$name error.$$name ; \ - fi ; fi ; done) - -HTMLPushtests : testHTML$(EXEEXT) - @echo "## Push HTML regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML --push $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML --push $$i > result.$$name 2> error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name result.$$name ; \ - cut -b 1-15 $(srcdir)/result/HTML/$$name.err > errorcut.$$name; \ - cut -b 1-15 error.$$name > errorcut2.$$name; \ - diff -b errorcut.$$name errorcut2.$$name ; \ - $(CHECKER) $(top_builddir)/testHTML --push result.$$name > result2.$$name 2>error.$$name ; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \ - fi ; fi ; done) - @echo "## HTML SAX regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name.sax ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML --sax $$i > result.$$name.sax ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name.sax ; \ - fi ; fi ; done) - @echo "## Push HTML SAX regression tests" - -@(for i in $(srcdir)/test/HTML/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testHTML --push --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \ - else \ - log=`$(CHECKER) $(top_builddir)/testHTML --push --sax $$i 2>&1 > result.$$name.sax ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name.sax ; \ - fi ; fi ; done) - -XMLtests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result.$$name result2.$$name` ;\ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - @echo "## XML regression tests on memory" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --memory $$i > $(srcdir)/result/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --memory $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint --memory result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - diff result.$$name result2.$$name ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -XMLPushtests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML push regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --push $$i > $(srcdir)/result/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --push $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint --push result.$$name 2>&1 > result2.$$name | grep -v 'failed to load external entity' ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -NStests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML Namespaces regression tests" - -@(for i in $(srcdir)/test/namespaces/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/namespaces/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i \ - 2> $(srcdir)/result/namespaces/$$name.err \ - > $(srcdir)/result/namespaces/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/namespaces/$$name result.$$name ; \ - diff $(srcdir)/result/namespaces/$$name.err error.$$name`; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -IDtests : xmllint$(EXEEXT) testXPath$(EXEEXT) - @(echo > .memdump) - @echo "## xml:id regression tests" - -@(for i in $(srcdir)/test/xmlid/id_*.xml ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/xmlid/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" \ - 2> $(srcdir)/result/xmlid/$$name.err \ - > $(srcdir)/result/xmlid/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -i $$i "id('bar')" 2> error.$$name > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/xmlid/$$name result.$$name ; \ - diff $(srcdir)/result/xmlid/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -Errtests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Error cases regression tests" - -@(for i in $(srcdir)/test/errors/*.xml ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/errors/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i \ - 2> $(srcdir)/result/errors/$$name.err \ - > $(srcdir)/result/errors/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint $$i 2> error.$$name > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/errors/$$name result.$$name ; \ - diff $(srcdir)/result/errors/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - @echo "## Error cases stream regression tests" - -@(for i in $(srcdir)/test/errors/*.xml ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/errors/$$name.str ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --stream $$i \ - 2> $(srcdir)/result/errors/$$name.str \ - > /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/errors/$$name.str error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm error.$$name ; \ - fi ; fi ; done) - -Docbtests : xmllint$(EXEEXT) - -XMLenttests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XML entity subst regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/noent/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --noent $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff $(srcdir)/result/noent/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noent result.$$name 2>&1 > result2.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result.$$name result2.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -URItests : testURI$(EXEEXT) - @(echo > .memdump) - @echo "## URI module regression tests" - -@(for i in $(srcdir)/test/URI/*.data ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/URI/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/URI/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/URI/*.uri ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/URI/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testURI < $$i > $(srcdir)/result/URI/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testURI < $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/URI/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -XPathtests : testXPath$(EXEEXT) - @(echo > .memdump) - @echo "## XPath regression tests" - -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \ - then echo Skipping debug not compiled in ; exit 0 ; fi ; \ - for i in $(srcdir)/test/XPath/expr/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -f --expr $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XPath/expr/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ; \ - for i in $(srcdir)/test/XPath/docs/* ; do \ - if [ ! -d $$i ] ; then \ - doc=`basename $$i`; \ - for j in $(srcdir)/test/XPath/tests/$$doc* ; do \ - if [ ! -f $$j ] ; then continue ; fi ; \ - name=`basename $$j`; \ - if [ ! -d $$j ] ; then \ - if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -f -i $$i $$j 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XPath/tests/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ; fi ; done) - -XPtrtests : testXPath$(EXEEXT) - @(echo > .memdump) - @echo "## XPointer regression tests" - -@(if [ "`$(top_builddir)/testXPath | grep 'support not compiled in'`" != "" ] ; \ - then echo Skipping debug not compiled in ; exit 0 ; fi ; \ - for i in $(srcdir)/test/XPath/docs/* ; do \ - if [ ! -d $$i ] ; then \ - doc=`basename $$i`; \ - for j in $(srcdir)/test/XPath/xptr/$$doc* ; do \ - if [ ! -f $$j ] ; then continue ; fi ; \ - name=`basename $$j`; \ - if [ ! -d $$j ] ; then \ - if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - else \ - log=`$(CHECKER) $(top_builddir)/testXPath -xptr -f -i $$i $$j 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XPath/xptr/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ; fi ; done) - -XIncludetests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## XInclude regression tests" - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name result.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > $(srcdir)/result/XInclude/$$name 2> $(srcdir)/result/XInclude/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name result.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - @(echo > .memdump) - @echo "## XInclude xmlReader regression tests" - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/XInclude/docs/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/XInclude/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nowarning --noxincludenode --stream --debug $$i > $(srcdir)/result/XInclude/$$name.rdr ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nowarning --xinclude --stream --debug $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/XInclude/$$name.err error.$$name ; \ - diff $(srcdir)/result/XInclude/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -Scripttests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Scripts regression tests" - @echo "## Some of the base computations may be different if srcdir != ." - -@(for i in $(srcdir)/test/scripts/*.script ; do \ - name=`basename $$i .script`; \ - xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \ - if [ -f $$xml ] ; then \ - if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/scripts/$$name result.$$name ; \ - diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name result.$$name.err ; \ - fi ; fi ; done) - -Catatests : xmlcatalog$(EXEEXT) - @(echo > .memdump) - @echo "## Catalog regression tests" - -@(for i in $(srcdir)/test/catalogs/*.script ; do \ - name=`basename $$i .script`; \ - xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \ - if [ -f $$xml ] ; then \ - if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/catalogs/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -@(for i in $(srcdir)/test/catalogs/*.script ; do \ - name=`basename $$i .script`; \ - sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \ - if [ -f $$sgml ] ; then \ - if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/catalogs/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Add and del operations on XML Catalogs" - -@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - rm -f $(srcdir)/result/catalogs/mycatalog) - -SVGtests : xmllint$(EXEEXT) - @echo "## SVG parsing regression tests" - -@(for i in $(srcdir)/test/SVG/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - echo Testing $$name ; \ - $(CHECKER) $(top_builddir)/xmllint $$i > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/SVG/$$name result.$$name ; \ - $(CHECKER) $(top_builddir)/xmllint result.$$name > result2.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff result.$$name result2.$$name ; \ - rm result.$$name result2.$$name ; \ - fi ; fi ; done) - -Threadtests : testThreads$(EXEEXT) - @echo "## Threaded regression tests" - -@($(CHECKER) $(top_builddir)/testThreads ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \ - exit 0) - -Readertests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Reader regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Reader on memory regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @(echo > .memdump) - @echo "## Walker regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --nonet --debug --walker $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rdr result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Reader entities substitution regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.rde ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > $(srcdir)/result/$$name.rde 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --noent --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.rde result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -SAXtests : testSAX$(EXEEXT) - @(echo > .memdump) - @echo "## SAX1 callbacks regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.sax ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testSAX $$i > $(srcdir)/result/$$name.sax 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testSAX $$i > result.$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.sax result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## SAX2 callbacks regression tests" - -@(for i in $(srcdir)/test/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/$$name.sax2 ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testSAX --sax2 $$i > $(srcdir)/result/$$name.sax2 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testSAX --sax2 $$i > result.$$name 2> /dev/null ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/$$name.sax2 result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -Validtests : xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Valid documents regression tests" - -@(for i in $(srcdir)/test/VCM/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - log=`$(CHECKER) $(top_builddir)/xmllint --valid --noout --nowarning $$i ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"`;\ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - fi ; done ; exit 0) - @echo "## Validity checking regression tests" - -@(for i in $(srcdir)/test/VC/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/VC/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/VC/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## General documents valid regression tests" - -@(for i in $(srcdir)/test/valid/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/valid/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/valid/$$name result.$$name ; \ - diff $(srcdir)/result/valid/$$name.err error.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name error.$$name ; \ - fi ; fi ; done) - -Regexptests: testRegexp$(EXEEXT) - @(echo > .memdump) - @echo "## Regexp regression tests" - -@(for i in $(srcdir)/test/regexp/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/regexp/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - @echo "## Formal expresssions regression tests" - -@(for i in $(srcdir)/test/expr/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/expr/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testRegexp --expr -i $$i > $(srcdir)/result/expr/$$name; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testRegexp --expr -i $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/expr/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -Automatatests: testAutomata$(EXEEXT) - @(echo > .memdump) - @echo "## Automata regression tests" - -@(for i in $(srcdir)/test/automata/* ; do \ - name=`basename $$i`; \ - if [ ! -d $$i ] ; then \ - if [ ! -f $(srcdir)/result/automata/$$name ] ; then \ - echo New test file $$name ; \ - $(CHECKER) $(top_builddir)/testAutomata $$i > $(srcdir)/result/automata/$$name; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testAutomata $$i 2>&1 > result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/automata/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done) - -dba100000.xml: dbgenattr.pl - @echo "## generating dba100000.xml" - @($(PERL) $(top_srcdir)/dbgenattr.pl 100000 > dba100000.xml) - -Timingtests: xmllint$(EXEEXT) dba100000.xml - @echo "## Timing tests to try to detect performance" - @echo "## as well a memory usage breakage when streaming" - @echo "## 1/ using the file interface" - @echo "## 2/ using the memory interface" - @echo "## 3/ repeated DOM parsing" - @echo "## 4/ repeated DOM validation" - -@($(top_builddir)/xmllint --stream --timing dba100000.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -VTimingtests: xmllint$(EXEEXT) - -@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \ - MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\ - if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - exit 0) - -C14Ntests : testC14N$(EXEEXT) - @echo "## C14N and XPath regression tests" - -@(for m in with-comments without-comments 1-1-without-comments exc-without-comments ; do \ - for i in $(srcdir)/test/c14n/$$m/*.xml ; do \ - if [ ! -d $$i ] ; then \ - name=`basename $$i .xml`; \ - cmdline="$(CHECKER) $(top_builddir)/testC14N --$$m $$i"; \ - if [ -f $(srcdir)/test/c14n/$$m/$$name.xpath ] ; then \ - cmdline="$$cmdline $(srcdir)/test/c14n/$$m/$$name.xpath"; \ - if [ -f $(srcdir)/test/c14n/$$m/$$name.ns ] ; then \ - cmdline="$$cmdline '`cat $(srcdir)/test/c14n/$$m/$$name.ns`'"; \ - fi; \ - fi; \ - $$cmdline > $(srcdir)/test/c14n/test.tmp; \ - if [ $$? -eq 0 ]; then \ - diff $(srcdir)/result/c14n/$$m/$$name $(srcdir)/test/c14n/test.tmp; \ - if [ $$? -ne 0 ]; then \ - echo "Test $$m/$$name failed"; \ - cat $(srcdir)/test/c14n/test.tmp; \ - fi; \ - else \ - echo "C14N failed"; \ - fi; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - fi; \ - rm -f $(srcdir)/test/c14n/test.tmp; \ - done; \ - done) - -Schemastests: testSchemas$(EXEEXT) - @(echo > .memdump) - @echo "## Schemas regression tests" - -@(for i in $(srcdir)/test/schemas/*_*.xsd ; do \ - name=`basename $$i | sed 's+_.*++'`; \ - sno=`basename $$i | sed 's+.*_\(.*\).xsd+\1+'`; \ - for j in $(srcdir)/test/schemas/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$sno"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/testSchemas $$i $$j \ - > $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \ - 2> $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/testSchemas $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno" \ - res.$$name;\ - diff $(srcdir)/result/schemas/"$$name"_"$$sno"_"$$xno".err \ - err.$$name;\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$sno"_"$$xno" result ; echo $$log ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ;\ - done; done) - -Relaxtests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Relax-NG regression tests" - -@(for i in $(srcdir)/test/relaxng/*.rng ; do \ - name=`basename $$i | sed 's+\.rng++'`; \ - if [ ! -f $(srcdir)/result/relaxng/"$$name"_valid ] ; then \ - echo New schemas $$name ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \ - > $(srcdir)/result/relaxng/"$$name"_valid \ - 2> $(srcdir)/result/relaxng/"$$name"_err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $(srcdir)/test/relaxng/tutorA.rng $$i \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/relaxng/"$$name"_valid \ - res.$$name;\ - diff $(srcdir)/result/relaxng/"$$name"_err \ - err.$$name | grep -v "error detected at";\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo schemas $$name result ; echo $$log ; fi ; \ - rm res.$$name err.$$name ; \ - fi; \ - for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ - > $(srcdir)/result/relaxng/"$$name"_"$$xno" \ - 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno" \ - res.$$name;\ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \ - err.$$name | grep -v "error detected at";\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ; \ - done; done) - @echo "## Relax-NG streaming regression tests" - -@(for i in $(srcdir)/test/relaxng/*.rng ; do \ - name=`basename $$i | sed 's+\.rng++'`; \ - for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/relaxng/"$$name"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --relaxng $$i $$j \ - > $(srcdir)/result/relaxng/"$$name"_"$$xno" \ - 2> $(srcdir)/result/relaxng/"$$name"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --noout --stream --relaxng $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno" res.$$name;\ - if [ "$$name" != "tutor10_1" -a "$$name" != "tutor10_2" -a "$$name" != "tutor3_2" -a "$$name" != "307377" -a "$$name" != "tutor8_2" ] ; then \ - diff $(srcdir)/result/relaxng/"$$name"_"$$xno".err \ - err.$$name | grep -v "error detected at";\ - fi ; grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ; \ - done; done) - -Schematrontests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Schematron regression tests" - -@(for i in $(srcdir)/test/schematron/*.sct ; do \ - name=`basename $$i | sed 's+\.sct++'`; \ - for j in $(srcdir)/test/schematron/"$$name"_*.xml ; do \ - if [ -f $$j ] ; then \ - xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \ - if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \ - then \ - echo New test file "$$name"_"$$xno" ; \ - $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \ - > $(srcdir)/result/schematron/"$$name"_"$$xno" \ - 2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - else \ - log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \ - > res.$$name 2> err.$$name;\ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - diff $(srcdir)/result/schematron/"$$name"_"$$xno" \ - res.$$name;\ - diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \ - err.$$name | grep -v "error detected at";\ - grep Unimplemented err.$$name`; \ - if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo $$log ; fi ; \ - rm res.$$name err.$$name ; \ - fi ; fi ; \ - done; done) - -RelaxNGPythonTests: - @(if [ -x $(PYTHON) ] ; then \ - PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \ - export PYTHONPATH; \ - LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ - export LD_LIBRARY_PATH; \ - echo "## Relax-NG Python based test suite 1" ; \ - $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \ - echo "## Relax-NG Python based test suite 2" ; \ - $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite2.py ; \ - fi) - -SchemasPythonTests: - @(if [ -x $(PYTHON) ] ; then \ - PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \ - export PYTHONPATH; \ - LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \ - export LD_LIBRARY_PATH; \ - echo "## XML Schemas datatypes Python based test suite" ; \ - echo "## It is normal to see 11 errors reported" ; \ - $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \ - fi) - @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi) - -Patterntests: xmllint$(EXEEXT) - @(echo > .memdump) - @echo "## Pattern regression tests" - -@(for i in $(srcdir)/test/pattern/*.pat ; do \ - name=`basename $$i .pat`; \ - if [ -f $(srcdir)/test/pattern/$$name.xml ] ; then \ - if [ ! -f $(srcdir)/result/pattern/$$name ] ; then \ - rm -f result.$$name ; \ - echo New test file $$name ; \ - for pat in `cat $$i` ; do \ - $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml >> $(srcdir)/result/pattern/$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - done ;\ - else \ - rm -f result.$$name ; \ - lst=`cat $$i` ; \ - log=`for pat in $$lst ; do $(CHECKER) $(top_builddir)/xmllint --walker --pattern $$pat $(srcdir)/test/pattern/$$name.xml 2>&1 >> result.$$name ; \ - grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\ - done ;\ - diff $(srcdir)/result/pattern/$$name result.$$name` ; \ - if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \ - rm result.$$name ; \ - fi ; fi ; done ;) - -ModuleTests: testModule$(EXEEXT) testdso.la - @echo "## Module tests" - @(./testModule$(EXEEXT)) - -cleanup: - -@(find . -name .\#\* -exec rm {} \;) - -@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;) - -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;) - -dist-hook: cleanup libxml2.spec - -cp libxml2.spec $(distdir) - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git win32 macos vms VxWorks bakefile test result) | (cd $(distdir); tar xf -) - -dist-source: distdir - $(AMTAR) -chof - --exclude Tests --exclude test --exclude result $(distdir) | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-sources+"`.tar.gz - -dist-test: distdir - (mkdir -p $(distdir)) - (cd $(srcdir) ; tar -cf - --exclude CVS --exclude .svn --exclude .git xstc/Tests) | (cd $(distdir); tar xf -) - tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README $(distdir)/README.tests $(distdir)/AUTHORS $(distdir)/testapi.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz - @(rm -rf $(distdir)/xstc/Test) - -cleantar: - @(rm -f libxml*.tar.gz COPYING.LIB) - -rpm: cleanup cleantar - @(unset CDPATH ; $(MAKE) dist-source dist && rpmbuild -ta $(distdir).tar.gz) - -xml2Conf.sh: xml2Conf.sh.in Makefile - sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \ - -e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \ - -e 's?\@VERSION\@?$(VERSION)?g' \ - -e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \ - < $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \ - && mv xml2Conf.tmp xml2Conf.sh - -install-data-local: - $(MKDIR_P) $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - -$(INSTALL) -m 0644 $(srcdir)/Copyright $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - $(MKDIR_P) $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/xmllint.c $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/testSAX.c $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/testHTML.c $(DESTDIR)$(EXAMPLES_DIR) - -$(INSTALL) -m 0644 $(srcdir)/testXPath.c $(DESTDIR)$(EXAMPLES_DIR) - -uninstall-local: - rm -f $(DESTDIR)$(EXAMPLES_DIR)/testXPath.c - rm -f $(DESTDIR)$(EXAMPLES_DIR)/testHTML.c - rm -f $(DESTDIR)$(EXAMPLES_DIR)/testSAX.c - rm -f $(DESTDIR)$(EXAMPLES_DIR)/xmllint.c - rm -rf $(DESTDIR)$(EXAMPLES_DIR) - rm -f $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE)/Copyright - rm -rf $(DESTDIR)$(BASE_DIR)/$(DOC_MODULE) - -tst: tst.c - $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz -llzma - -sparse: clean - $(MAKE) CC=cgcc - -cov: clean-cov - if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \ - echo not configured with coverage; exit 1 ; fi - if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \ - echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi - -@($(MAKE) check) - -@(./runsuite$(EXEEXT)) - mkdir $(top_builddir)/coverage - $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir) - $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr* - rm $(top_builddir)/coverage/libxml2.info.tmp - $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info - echo "Coverage report is in $(top_builddir)/coverage/index.html" - -clean-cov: - rm -rf $(top_builddir)/coverage - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/reactos/lib/3rdparty/libxml2/Makefile.tests b/reactos/lib/3rdparty/libxml2/Makefile.tests deleted file mode 100644 index 619cbfb8597..00000000000 --- a/reactos/lib/3rdparty/libxml2/Makefile.tests +++ /dev/null @@ -1,41 +0,0 @@ -# -# You may have to ajust to call the right compiler, or other oprions -# for compiling and linking -# - -CFLAGS=`xml2-config --cflags` -LIBS=`xml2-config --libs` -THREADLIB= -lpthread -EXEEXT= - -all: runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT) testchar$(EXEEXT) - -clean: - $(RM) runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT) - -check: do_runtest do_testchar do_testapi do_runsuite - -runtest$(EXEEXT): runtest.c - $(CC) -o runtest$(EXEEXT) $(CFLAGS) runtest.c $(LIBS) $(THREADLIB) - -do_runtest: runtest$(EXEEXT) - ./runtest - -runsuite$(EXEEXT): runsuite.c - $(CC) -o runsuite$(EXEEXT) $(CFLAGS) runsuite.c $(LIBS) - -do_runsuite: runsuite$(EXEEXT) - ./runsuite - -testapi$(EXEEXT): testapi.c - $(CC) -o testapi$(EXEEXT) $(CFLAGS) testapi.c $(LIBS) - -do_testapi: testapi$(EXEEXT) - ./testapi - -testchar$(EXEEXT): testchar.c - $(CC) -o testchar$(EXEEXT) $(CFLAGS) testchar.c $(LIBS) - -do_testchar: testchar$(EXEEXT) - ./testchar - diff --git a/reactos/lib/3rdparty/libxml2/README.tests b/reactos/lib/3rdparty/libxml2/README.tests deleted file mode 100644 index 8d86f2a19ce..00000000000 --- a/reactos/lib/3rdparty/libxml2/README.tests +++ /dev/null @@ -1,39 +0,0 @@ - README.tests - - Instructions for standalone test regressions of libxml2 - -libxml2-tests-$version.tar.gz contains 3 standalone C programs as well -as a large amount of tests and results coming from libxml2 itself and -from W3C, NIST, Sun Microsystems, Microsoft and James Clark. Each C -program has a different testing purpose: - - runtest.c : runs libxml2 basic internal regression tests - runsuite.c: runs libxml2 against external regression tests - testapi.c : exercises the library public entry points - testchar.c: exercise the check of character ranges and UTF-8 validation - -The command: - - make check -or - make -f Makefile.tests check - -should be sufficient on an Unix system to build and exercise the tests -for the version of the library installed on the system. Note however -that there isn't backward compatibility provided so if the installed -version is older than the testsuite one, failing to compile or run the tests -is likely. In any event this won't work with an installed libxml2 older -than 2.6.20. - -Building on other platforms should be a matter of compiling the C files -like any other program using libxml2, running the test should be done -simply by launching the resulting executables. - -Also note the availability of a "make valgrind" target which will run the -above tests under valgrind to check for memory errors (but this relies -on the availability of the valgrind command and take far more time to -complete). - -Daniel Veillard -Mon May 7 2012 - diff --git a/reactos/lib/3rdparty/libxml2/SAX2.c b/reactos/lib/3rdparty/libxml2/SAX2.c index a24abc88c3c..4adf2024465 100644 --- a/reactos/lib/3rdparty/libxml2/SAX2.c +++ b/reactos/lib/3rdparty/libxml2/SAX2.c @@ -411,6 +411,7 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name, xmlParserInputPtr input = NULL; xmlCharEncoding enc; int oldcharset; + const xmlChar *oldencoding; /* * Ask the Entity resolver to load the damn thing @@ -432,6 +433,8 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name, oldinputMax = ctxt->inputMax; oldinputTab = ctxt->inputTab; oldcharset = ctxt->charset; + oldencoding = ctxt->encoding; + ctxt->encoding = NULL; ctxt->inputTab = (xmlParserInputPtr *) xmlMalloc(5 * sizeof(xmlParserInputPtr)); @@ -442,6 +445,7 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name, ctxt->inputMax = oldinputMax; ctxt->inputTab = oldinputTab; ctxt->charset = oldcharset; + ctxt->encoding = oldencoding; return; } ctxt->inputNr = 0; @@ -487,6 +491,11 @@ xmlSAX2ExternalSubset(void *ctx, const xmlChar *name, ctxt->inputMax = oldinputMax; ctxt->inputTab = oldinputTab; ctxt->charset = oldcharset; + if ((ctxt->encoding != NULL) && + ((ctxt->dict == NULL) || + (!xmlDictOwns(ctxt->dict, ctxt->encoding)))) + xmlFree((xmlChar *) ctxt->encoding); + ctxt->encoding = oldencoding; /* ctxt->wellFormed = oldwellFormed; */ } } @@ -591,6 +600,7 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name) * parse the external entity */ xmlNodePtr children; + unsigned long oldnbent = ctxt->nbentities; val = xmlParseCtxtExternalEntity(ctxt, ret->URI, ret->ExternalID, &children); @@ -603,8 +613,11 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name) return(NULL); } ret->owner = 1; - if (ret->checked == 0) - ret->checked = 1; + if (ret->checked == 0) { + ret->checked = (ctxt->nbentities - oldnbent + 1) * 2; + if ((ret->content != NULL) && (xmlStrchr(ret->content, '<'))) + ret->checked |= 1; + } } return(ret); } @@ -2202,7 +2215,7 @@ xmlSAX2StartElementNs(void *ctx, (ctxt->myDoc->intSubset->elements == NULL) && (ctxt->myDoc->intSubset->attributes == NULL) && (ctxt->myDoc->intSubset->entities == NULL)))) { - xmlErrValid(ctxt, XML_ERR_NO_DTD, + xmlErrValid(ctxt, XML_DTD_NO_DTD, "Validation failed: no DTD found !", NULL, NULL); ctxt->validate = 0; } diff --git a/reactos/lib/3rdparty/libxml2/acinclude.m4 b/reactos/lib/3rdparty/libxml2/acinclude.m4 deleted file mode 100644 index 7ad8630a4f0..00000000000 --- a/reactos/lib/3rdparty/libxml2/acinclude.m4 +++ /dev/null @@ -1,28 +0,0 @@ -dnl Like AC_TRY_EVAL but also errors out if the compiler generates -dnl _any_ output. Some compilers might issue warnings which we want -dnl to catch. -AC_DEFUN([AC_TRY_EVAL2], -[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AS_MESSAGE_LOG_FD; dnl -(eval [$]$1) 2>&AS_MESSAGE_LOG_FD; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }]) - -dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL -AC_DEFUN([AC_TRY_COMPILE2], -[cat > conftest.$ac_ext <&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD -ifelse([$4], , , [ rm -rf conftest* - $4 -])dnl -fi -rm -f conftest*]) diff --git a/reactos/lib/3rdparty/libxml2/aclocal.m4 b/reactos/lib/3rdparty/libxml2/aclocal.m4 deleted file mode 100644 index 78c9ca9c65a..00000000000 --- a/reactos/lib/3rdparty/libxml2/aclocal.m4 +++ /dev/null @@ -1,1034 +0,0 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. -You have another version of autoconf. It may work, but is not guaranteed to. -If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) - -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_AUTOMAKE_VERSION(VERSION) -# ---------------------------- -# Automake X.Y traces this macro to ensure aclocal.m4 has been -# generated from the m4 files accompanying Automake X.Y. -# (This private macro should not be called outside this file.) -AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.3], [], - [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl -]) - -# _AM_AUTOCONF_VERSION(VERSION) -# ----------------------------- -# aclocal traces this macro to find the Autoconf version. -# This is a private macro too. Using m4_define simplifies -# the logic in aclocal, which can simply ignore this definition. -m4_define([_AM_AUTOCONF_VERSION], []) - -# AM_SET_CURRENT_AUTOMAKE_VERSION -# ------------------------------- -# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. -# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.3])dnl -m4_ifndef([AC_AUTOCONF_VERSION], - [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) - -# AM_AUX_DIR_EXPAND -*- Autoconf -*- - -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. -# -# Of course, Automake must honor this variable whenever it calls a -# tool from the auxiliary directory. The problem is that $srcdir (and -# therefore $ac_aux_dir as well) can be either absolute or relative, -# depending on how configure is run. This is pretty annoying, since -# it makes $ac_aux_dir quite unusable in subdirectories: in the top -# source directory, any form will work fine, but in subdirectories a -# relative path needs to be adjusted first. -# -# $ac_aux_dir/missing -# fails when called from a subdirectory if $ac_aux_dir is relative -# $top_srcdir/$ac_aux_dir/missing -# fails if $ac_aux_dir is absolute, -# fails when called from a subdirectory in a VPATH build with -# a relative $ac_aux_dir -# -# The reason of the latter failure is that $top_srcdir and $ac_aux_dir -# are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you -# start a VPATH build or use an absolute $srcdir. -# -# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, -# iff we strip the leading $srcdir from $ac_aux_dir. That would be: -# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` -# and then we would define $MISSING as -# MISSING="\${SHELL} $am_aux_dir/missing" -# This will work as long as MISSING is not called from configure, because -# unfortunately $(top_srcdir) has no meaning in configure. -# However there are other variables, like CC, which are often used in -# configure, and could therefore not use this "fixed" $ac_aux_dir. -# -# Another solution, used here, is to always expand $ac_aux_dir to an -# absolute PATH. The drawback is that using absolute paths prevent a -# configured tree to be moved without reconfiguration. - -AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` -]) - -# AM_CONDITIONAL -*- Autoconf -*- - -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 9 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 12 - -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be -# written in clear, in which case automake, when reading aclocal.m4, -# will think it sees a *use*, and therefore will trigger all it's -# C support machinery. Also note that it means that autoscan, seeing -# CC etc. in the Makefile, will ask for an AC_PROG_CC use... - - -# _AM_DEPENDENCIES(NAME) -# ---------------------- -# See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". -# We try a few techniques and use that to set a single cache variable. -# -# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was -# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular -# dependency, and given that the user is not expected to run this macro, -# just rely on AC_PROG_CC. -AC_DEFUN([_AM_DEPENDENCIES], -[AC_REQUIRE([AM_SET_DEPDIR])dnl -AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl -AC_REQUIRE([AM_MAKE_INCLUDE])dnl -AC_REQUIRE([AM_DEP_TRACK])dnl - -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) - -AC_CACHE_CHECK([dependency style of $depcc], - [am_cv_$1_dependencies_compiler_type], -[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_$1_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` - fi - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi -AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -AC_SUBST([AMDEPBACKSLASH])dnl -_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl -AC_SUBST([am__nodep])dnl -_AM_SUBST_NOTMAKE([am__nodep])dnl -]) - -# Generate code to set up dependency tracking. -*- Autoconf -*- - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -#serial 5 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 16 - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl -]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) - -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST(install_sh)]) - -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - -# Helper functions for option handling. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# _AM_MANGLE_OPTION(NAME) -# ----------------------- -AC_DEFUN([_AM_MANGLE_OPTION], -[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) - -# _AM_SET_OPTION(NAME) -# -------------------- -# Set option NAME. Presently that only means defining a flag for this option. -AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) - -# _AM_SET_OPTIONS(OPTIONS) -# ------------------------ -# OPTIONS is a space-separated list of Automake options. -AC_DEFUN([_AM_SET_OPTIONS], -[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) - -# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) -# ------------------------------------------- -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -AC_DEFUN([_AM_IF_OPTION], -[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) - -# Check to make sure that the build environment is sane. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# Copyright (C) 2009, 2011 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# AM_SILENT_RULES([DEFAULT]) -# -------------------------- -# Enable less verbose build rules; with the default set to DEFAULT -# (`yes' being less verbose, `no' or empty being verbose). -AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], -[ --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0')]) -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; -esac -dnl -dnl A few `make' implementations (e.g., NonStop OS and NextStep) -dnl do not support nested variable expansions. -dnl See automake bug#9928 and bug#10237. -am_make=${MAKE-make} -AC_CACHE_CHECK([whether $am_make supports nested variables], - [am_cv_make_support_nested_variables], - [if AS_ECHO([['TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi]) -if test $am_cv_make_support_nested_variables = yes; then - dnl Using `$V' instead of `$(V)' breaks IRIX make. - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AC_SUBST([AM_V])dnl -AM_SUBST_NOTMAKE([AM_V])dnl -AC_SUBST([AM_DEFAULT_V])dnl -AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl -AC_SUBST([AM_DEFAULT_VERBOSITY])dnl -AM_BACKSLASH='\' -AC_SUBST([AM_BACKSLASH])dnl -_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl -]) - -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_INSTALL_STRIP -# --------------------- -# One issue with vendor `install' (even GNU) is that you can't -# specify the program used to strip binaries. This is especially -# annoying in cross-compiling environments, where the build's strip -# is unlikely to handle the host's binaries. -# Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize -# STRIPPROG with the value of the STRIP variable (set by the user). -AC_DEFUN([AM_PROG_INSTALL_STRIP], -[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. -if test "$cross_compiling" != no; then - AC_CHECK_TOOL([STRIP], [strip], :) -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -AC_SUBST([INSTALL_STRIP_PROGRAM])]) - -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 3 - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# -------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir - -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - -m4_include([m4/libtool.m4]) -m4_include([m4/ltoptions.m4]) -m4_include([m4/ltsugar.m4]) -m4_include([m4/ltversion.m4]) -m4_include([m4/lt~obsolete.m4]) -m4_include([acinclude.m4]) diff --git a/reactos/lib/3rdparty/libxml2/buf.c b/reactos/lib/3rdparty/libxml2/buf.c index fa0c3f6e5f2..d1756c4ad62 100644 --- a/reactos/lib/3rdparty/libxml2/buf.c +++ b/reactos/lib/3rdparty/libxml2/buf.c @@ -1299,3 +1299,6 @@ xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input, input->end = &buf->content[buf->use]; return(0); } + +#define bottom_buf +#include "elfgcchack.h" diff --git a/reactos/lib/3rdparty/libxml2/catalog.c b/reactos/lib/3rdparty/libxml2/catalog.c index 61cce03d7cc..8e34cd2df5d 100644 --- a/reactos/lib/3rdparty/libxml2/catalog.c +++ b/reactos/lib/3rdparty/libxml2/catalog.c @@ -84,10 +84,12 @@ static char XML_XML_DEFAULT_CATALOG[256] = "file:///etc/xml/catalog"; #define GetModuleHandleA GetModuleHandle #define GetModuleFileNameA GetModuleFileName #else +#if !defined(_WINDOWS_) void* __stdcall GetModuleHandleA(const char*); unsigned long __stdcall GetModuleFileNameA(void*, char*, unsigned long); #endif #endif +#endif static xmlChar *xmlCatalogNormalizePublic(const xmlChar *pubID); static int xmlExpandCatalog(xmlCatalogPtr catal, const char *filename); @@ -989,7 +991,7 @@ xmlLoadFileContent(const char *filename) return (NULL); } #endif - content = xmlMallocAtomic(size + 10); + content = (xmlChar*)xmlMallocAtomic(size + 10); if (content == NULL) { xmlCatalogErrMemory("allocating catalog data"); return (NULL); @@ -1547,7 +1549,7 @@ xmlAddXMLCatalog(xmlCatalogEntryPtr catal, const xmlChar *type, NULL, catal->prefer, NULL); if (doregister) { catal->type = XML_CATA_CATALOG; - cur = xmlHashLookup(xmlCatalogXMLFiles, catal->URL); + cur = (xmlCatalogEntryPtr)xmlHashLookup(xmlCatalogXMLFiles, catal->URL); if (cur != NULL) cur->children = catal->children; } @@ -3129,7 +3131,7 @@ xmlInitializeCatalog(void) { if (p != buf) { xmlChar* uri; strncpy(p, "\\..\\etc\\catalog", 255 - (p - buf)); - uri = xmlCanonicPath(buf); + uri = xmlCanonicPath((const xmlChar*)buf); if (uri != NULL) { strncpy(XML_XML_DEFAULT_CATALOG, uri, 255); xmlFree(uri); @@ -3244,7 +3246,7 @@ xmlLoadCatalogs(const char *pathss) { cur++; path = xmlStrndup((const xmlChar *)paths, cur - paths); #ifdef _WIN32 - iLen = strlen(path); + iLen = strlen((const char*)path); for(i = 0; i < iLen; i++) { if(path[i] == '\\') { path[i] = '/'; diff --git a/reactos/lib/3rdparty/libxml2/check-relaxng-test-suite.py b/reactos/lib/3rdparty/libxml2/check-relaxng-test-suite.py deleted file mode 100644 index f4a5a69a46e..00000000000 --- a/reactos/lib/3rdparty/libxml2/check-relaxng-test-suite.py +++ /dev/null @@ -1,394 +0,0 @@ -#!/usr/bin/python -import sys -import time -import os -import string -import StringIO -sys.path.insert(0, "python") -import libxml2 - -# Memory debug specific -libxml2.debugMemory(1) -debug = 0 -verbose = 0 -quiet = 1 - -# -# the testsuite description -# -CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/OASIS/spectest.xml") -LOG="check-relaxng-test-suite.log" -RES="relaxng-test-results.xml" - -log = open(LOG, "w") -nb_schemas_tests = 0 -nb_schemas_success = 0 -nb_schemas_failed = 0 -nb_instances_tests = 0 -nb_instances_success = 0 -nb_instances_failed = 0 - -libxml2.lineNumbersDefault(1) -# -# Error and warnng callbacks -# -def callback(ctx, str): - global log - log.write("%s%s" % (ctx, str)) - -libxml2.registerErrorHandler(callback, "") - -# -# Resolver callback -# -resources = {} -def resolver(URL, ID, ctxt): - global resources - - if string.find(URL, '#') != -1: - URL = URL[0:string.find(URL, '#')] - if resources.has_key(URL): - return(StringIO.StringIO(resources[URL])) - log.write("Resolver failure: asked %s\n" % (URL)) - log.write("resources: %s\n" % (resources)) - return None - -# -# Load the previous results -# -#results = {} -#previous = {} -# -#try: -# res = libxml2.parseFile(RES) -#except: -# log.write("Could not parse %s" % (RES)) - -# -# handle a valid instance -# -def handle_valid(node, schema): - global log - global nb_instances_success - global nb_instances_failed - - instance = "" - child = node.children - while child != None: - if child.type != 'text': - instance = instance + child.serialize() - child = child.next - - try: - doc = libxml2.parseDoc(instance) - except: - doc = None - - if doc == None: - log.write("\nFailed to parse correct instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - nb_instances_failed = nb_instances_failed + 1 - return - - try: - ctxt = schema.relaxNGNewValidCtxt() - ret = doc.relaxNGValidateDoc(ctxt) - except: - ret = -1 - if ret != 0: - log.write("\nFailed to validate correct instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - nb_instances_failed = nb_instances_failed + 1 - else: - nb_instances_success = nb_instances_success + 1 - doc.freeDoc() - -# -# handle an invalid instance -# -def handle_invalid(node, schema): - global log - global nb_instances_success - global nb_instances_failed - - instance = "" - child = node.children - while child != None: - if child.type != 'text': - instance = instance + child.serialize() - child = child.next - - try: - doc = libxml2.parseDoc(instance) - except: - doc = None - - if doc == None: - log.write("\nStrange: failed to parse incorrect instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - return - - try: - ctxt = schema.relaxNGNewValidCtxt() - ret = doc.relaxNGValidateDoc(ctxt) - except: - ret = -1 - if ret == 0: - log.write("\nFailed to detect validation problem in instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - nb_instances_failed = nb_instances_failed + 1 - else: - nb_instances_success = nb_instances_success + 1 - doc.freeDoc() - -# -# handle an incorrect test -# -def handle_correct(node): - global log - global nb_schemas_success - global nb_schemas_failed - - schema = "" - child = node.children - while child != None: - if child.type != 'text': - schema = schema + child.serialize() - child = child.next - - try: - rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema)) - rngs = rngp.relaxNGParse() - except: - rngs = None - if rngs == None: - log.write("\nFailed to compile correct schema:\n-----\n") - log.write(schema) - log.write("\n-----\n") - nb_schemas_failed = nb_schemas_failed + 1 - else: - nb_schemas_success = nb_schemas_success + 1 - return rngs - -def handle_incorrect(node): - global log - global nb_schemas_success - global nb_schemas_failed - - schema = "" - child = node.children - while child != None: - if child.type != 'text': - schema = schema + child.serialize() - child = child.next - - try: - rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema)) - rngs = rngp.relaxNGParse() - except: - rngs = None - if rngs != None: - log.write("\nFailed to detect schema error in:\n-----\n") - log.write(schema) - log.write("\n-----\n") - nb_schemas_failed = nb_schemas_failed + 1 - else: -# log.write("\nSuccess detecting schema error in:\n-----\n") -# log.write(schema) -# log.write("\n-----\n") - nb_schemas_success = nb_schemas_success + 1 - return None - -# -# resource handling: keep a dictionary of URL->string mappings -# -def handle_resource(node, dir): - global resources - - try: - name = node.prop('name') - except: - name = None - - if name == None or name == '': - log.write("resource has no name") - return; - - if dir != None: -# name = libxml2.buildURI(name, dir) - name = dir + '/' + name - - res = "" - child = node.children - while child != None: - if child.type != 'text': - res = res + child.serialize() - child = child.next - resources[name] = res - -# -# dir handling: pseudo directory resources -# -def handle_dir(node, dir): - try: - name = node.prop('name') - except: - name = None - - if name == None or name == '': - log.write("resource has no name") - return; - - if dir != None: -# name = libxml2.buildURI(name, dir) - name = dir + '/' + name - - dirs = node.xpathEval('dir') - for dir in dirs: - handle_dir(dir, name) - res = node.xpathEval('resource') - for r in res: - handle_resource(r, name) - -# -# handle a testCase element -# -def handle_testCase(node): - global nb_schemas_tests - global nb_instances_tests - global resources - - sections = node.xpathEval('string(section)') - log.write("\n ======== test %d line %d section %s ==========\n" % ( - - nb_schemas_tests, node.lineNo(), sections)) - resources = {} - if debug: - print "test %d line %d" % (nb_schemas_tests, node.lineNo()) - - dirs = node.xpathEval('dir') - for dir in dirs: - handle_dir(dir, None) - res = node.xpathEval('resource') - for r in res: - handle_resource(r, None) - - tsts = node.xpathEval('incorrect') - if tsts != []: - if len(tsts) != 1: - print "warning test line %d has more than one example" %(node.lineNo()) - schema = handle_incorrect(tsts[0]) - else: - tsts = node.xpathEval('correct') - if tsts != []: - if len(tsts) != 1: - print "warning test line %d has more than one example"% (node.lineNo()) - schema = handle_correct(tsts[0]) - else: - print "warning line %d has no nor child" % (node.lineNo()) - - nb_schemas_tests = nb_schemas_tests + 1; - - valids = node.xpathEval('valid') - invalids = node.xpathEval('invalid') - nb_instances_tests = nb_instances_tests + len(valids) + len(invalids) - if schema != None: - for valid in valids: - handle_valid(valid, schema) - for invalid in invalids: - handle_invalid(invalid, schema) - - -# -# handle a testSuite element -# -def handle_testSuite(node, level = 0): - global nb_schemas_tests, nb_schemas_success, nb_schemas_failed - global nb_instances_tests, nb_instances_success, nb_instances_failed - global quiet - if level >= 1: - old_schemas_tests = nb_schemas_tests - old_schemas_success = nb_schemas_success - old_schemas_failed = nb_schemas_failed - old_instances_tests = nb_instances_tests - old_instances_success = nb_instances_success - old_instances_failed = nb_instances_failed - - docs = node.xpathEval('documentation') - authors = node.xpathEval('author') - if docs != []: - msg = "" - for doc in docs: - msg = msg + doc.content + " " - if authors != []: - msg = msg + "written by " - for author in authors: - msg = msg + author.content + " " - if quiet == 0: - print msg - sections = node.xpathEval('section') - if sections != [] and level <= 0: - msg = "" - for section in sections: - msg = msg + section.content + " " - if quiet == 0: - print "Tests for section %s" % (msg) - for test in node.xpathEval('testCase'): - handle_testCase(test) - for test in node.xpathEval('testSuite'): - handle_testSuite(test, level + 1) - - - if verbose and level >= 1 and sections != []: - msg = "" - for section in sections: - msg = msg + section.content + " " - print "Result of tests for section %s" % (msg) - if nb_schemas_tests != old_schemas_tests: - print "found %d test schemas: %d success %d failures" % ( - nb_schemas_tests - old_schemas_tests, - nb_schemas_success - old_schemas_success, - nb_schemas_failed - old_schemas_failed) - if nb_instances_tests != old_instances_tests: - print "found %d test instances: %d success %d failures" % ( - nb_instances_tests - old_instances_tests, - nb_instances_success - old_instances_success, - nb_instances_failed - old_instances_failed) -# -# Parse the conf file -# -libxml2.substituteEntitiesDefault(1); -testsuite = libxml2.parseFile(CONF) -libxml2.setEntityLoader(resolver) -root = testsuite.getRootElement() -if root.name != 'testSuite': - print "%s doesn't start with a testSuite element, aborting" % (CONF) - sys.exit(1) -if quiet == 0: - print "Running Relax NG testsuite" -handle_testSuite(root) - -if quiet == 0: - print "\nTOTAL:\n" -if quiet == 0 or nb_schemas_failed != 0: - print "found %d test schemas: %d success %d failures" % ( - nb_schemas_tests, nb_schemas_success, nb_schemas_failed) -if quiet == 0 or nb_instances_failed != 0: - print "found %d test instances: %d success %d failures" % ( - nb_instances_tests, nb_instances_success, nb_instances_failed) - -testsuite.freeDoc() - -# Memory debug specific -libxml2.relaxNGCleanupTypes() -libxml2.cleanupParser() -if libxml2.debugMemory(1) == 0: - if quiet == 0: - print "OK" -else: - print "Memory leak %d bytes" % (libxml2.debugMemory(1)) - libxml2.dumpMemory() diff --git a/reactos/lib/3rdparty/libxml2/check-relaxng-test-suite2.py b/reactos/lib/3rdparty/libxml2/check-relaxng-test-suite2.py deleted file mode 100644 index 8618db7695d..00000000000 --- a/reactos/lib/3rdparty/libxml2/check-relaxng-test-suite2.py +++ /dev/null @@ -1,418 +0,0 @@ -#!/usr/bin/python -import sys -import time -import os -import string -import StringIO -sys.path.insert(0, "python") -import libxml2 - -# Memory debug specific -libxml2.debugMemory(1) -debug = 0 -quiet = 1 - -# -# the testsuite description -# -CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/testsuite.xml") -LOG="check-relaxng-test-suite2.log" - -log = open(LOG, "w") -nb_schemas_tests = 0 -nb_schemas_success = 0 -nb_schemas_failed = 0 -nb_instances_tests = 0 -nb_instances_success = 0 -nb_instances_failed = 0 - -libxml2.lineNumbersDefault(1) -# -# Resolver callback -# -resources = {} -def resolver(URL, ID, ctxt): - global resources - - if resources.has_key(URL): - return(StringIO.StringIO(resources[URL])) - log.write("Resolver failure: asked %s\n" % (URL)) - log.write("resources: %s\n" % (resources)) - return None - -# -# Load the previous results -# -#results = {} -#previous = {} -# -#try: -# res = libxml2.parseFile(RES) -#except: -# log.write("Could not parse %s" % (RES)) - -# -# handle a valid instance -# -def handle_valid(node, schema): - global log - global nb_instances_success - global nb_instances_failed - - instance = node.prop("dtd") - if instance == None: - instance = "" - child = node.children - while child != None: - if child.type != 'text': - instance = instance + child.serialize() - child = child.next - -# mem = libxml2.debugMemory(1); - try: - doc = libxml2.parseDoc(instance) - except: - doc = None - - if doc == None: - log.write("\nFailed to parse correct instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - nb_instances_failed = nb_instances_failed + 1 - return - - if debug: - print "instance line %d" % (node.lineNo()) - - try: - ctxt = schema.relaxNGNewValidCtxt() - ret = doc.relaxNGValidateDoc(ctxt) - del ctxt - except: - ret = -1 - - doc.freeDoc() -# if mem != libxml2.debugMemory(1): -# print "validating instance %d line %d leaks" % ( -# nb_instances_tests, node.lineNo()) - - if ret != 0: - log.write("\nFailed to validate correct instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - nb_instances_failed = nb_instances_failed + 1 - else: - nb_instances_success = nb_instances_success + 1 - -# -# handle an invalid instance -# -def handle_invalid(node, schema): - global log - global nb_instances_success - global nb_instances_failed - - instance = node.prop("dtd") - if instance == None: - instance = "" - child = node.children - while child != None: - if child.type != 'text': - instance = instance + child.serialize() - child = child.next - -# mem = libxml2.debugMemory(1); - - try: - doc = libxml2.parseDoc(instance) - except: - doc = None - - if doc == None: - log.write("\nStrange: failed to parse incorrect instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - return - - if debug: - print "instance line %d" % (node.lineNo()) - - try: - ctxt = schema.relaxNGNewValidCtxt() - ret = doc.relaxNGValidateDoc(ctxt) - del ctxt - - except: - ret = -1 - - doc.freeDoc() -# mem2 = libxml2.debugMemory(1) -# if mem != mem2: -# print "validating instance %d line %d leaks %d bytes" % ( -# nb_instances_tests, node.lineNo(), mem2 - mem) - - if ret == 0: - log.write("\nFailed to detect validation problem in instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - nb_instances_failed = nb_instances_failed + 1 - else: - nb_instances_success = nb_instances_success + 1 - -# -# handle an incorrect test -# -def handle_correct(node): - global log - global nb_schemas_success - global nb_schemas_failed - - schema = "" - child = node.children - while child != None: - if child.type != 'text': - schema = schema + child.serialize() - child = child.next - - try: - rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema)) - rngs = rngp.relaxNGParse() - except: - rngs = None - if rngs == None: - log.write("\nFailed to compile correct schema:\n-----\n") - log.write(schema) - log.write("\n-----\n") - nb_schemas_failed = nb_schemas_failed + 1 - else: - nb_schemas_success = nb_schemas_success + 1 - return rngs - -def handle_incorrect(node): - global log - global nb_schemas_success - global nb_schemas_failed - - schema = "" - child = node.children - while child != None: - if child.type != 'text': - schema = schema + child.serialize() - child = child.next - - try: - rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema)) - rngs = rngp.relaxNGParse() - except: - rngs = None - if rngs != None: - log.write("\nFailed to detect schema error in:\n-----\n") - log.write(schema) - log.write("\n-----\n") - nb_schemas_failed = nb_schemas_failed + 1 - else: -# log.write("\nSuccess detecting schema error in:\n-----\n") -# log.write(schema) -# log.write("\n-----\n") - nb_schemas_success = nb_schemas_success + 1 - return None - -# -# resource handling: keep a dictionary of URL->string mappings -# -def handle_resource(node, dir): - global resources - - try: - name = node.prop('name') - except: - name = None - - if name == None or name == '': - log.write("resource has no name") - return; - - if dir != None: -# name = libxml2.buildURI(name, dir) - name = dir + '/' + name - - res = "" - child = node.children - while child != None: - if child.type != 'text': - res = res + child.serialize() - child = child.next - resources[name] = res - -# -# dir handling: pseudo directory resources -# -def handle_dir(node, dir): - try: - name = node.prop('name') - except: - name = None - - if name == None or name == '': - log.write("resource has no name") - return; - - if dir != None: -# name = libxml2.buildURI(name, dir) - name = dir + '/' + name - - dirs = node.xpathEval('dir') - for dir in dirs: - handle_dir(dir, name) - res = node.xpathEval('resource') - for r in res: - handle_resource(r, name) - -# -# handle a testCase element -# -def handle_testCase(node): - global nb_schemas_tests - global nb_instances_tests - global resources - - sections = node.xpathEval('string(section)') - log.write("\n ======== test %d line %d section %s ==========\n" % ( - - nb_schemas_tests, node.lineNo(), sections)) - resources = {} - if debug: - print "test %d line %d" % (nb_schemas_tests, node.lineNo()) - - dirs = node.xpathEval('dir') - for dir in dirs: - handle_dir(dir, None) - res = node.xpathEval('resource') - for r in res: - handle_resource(r, None) - - tsts = node.xpathEval('incorrect') - if tsts != []: - if len(tsts) != 1: - print "warning test line %d has more than one example" %(node.lineNo()) - schema = handle_incorrect(tsts[0]) - else: - tsts = node.xpathEval('correct') - if tsts != []: - if len(tsts) != 1: - print "warning test line %d has more than one example"% (node.lineNo()) - schema = handle_correct(tsts[0]) - else: - print "warning line %d has no nor child" % (node.lineNo()) - - nb_schemas_tests = nb_schemas_tests + 1; - - valids = node.xpathEval('valid') - invalids = node.xpathEval('invalid') - nb_instances_tests = nb_instances_tests + len(valids) + len(invalids) - if schema != None: - for valid in valids: - handle_valid(valid, schema) - for invalid in invalids: - handle_invalid(invalid, schema) - - -# -# handle a testSuite element -# -def handle_testSuite(node, level = 0): - global nb_schemas_tests, nb_schemas_success, nb_schemas_failed - global nb_instances_tests, nb_instances_success, nb_instances_failed - if level >= 1: - old_schemas_tests = nb_schemas_tests - old_schemas_success = nb_schemas_success - old_schemas_failed = nb_schemas_failed - old_instances_tests = nb_instances_tests - old_instances_success = nb_instances_success - old_instances_failed = nb_instances_failed - - docs = node.xpathEval('documentation') - authors = node.xpathEval('author') - if docs != []: - msg = "" - for doc in docs: - msg = msg + doc.content + " " - if authors != []: - msg = msg + "written by " - for author in authors: - msg = msg + author.content + " " - if quiet == 0: - print msg - sections = node.xpathEval('section') - if sections != [] and level <= 0: - msg = "" - for section in sections: - msg = msg + section.content + " " - if quiet == 0: - print "Tests for section %s" % (msg) - for test in node.xpathEval('testCase'): - handle_testCase(test) - for test in node.xpathEval('testSuite'): - handle_testSuite(test, level + 1) - - - if level >= 1 and sections != []: - msg = "" - for section in sections: - msg = msg + section.content + " " - print "Result of tests for section %s" % (msg) - if nb_schemas_tests != old_schemas_tests: - print "found %d test schemas: %d success %d failures" % ( - nb_schemas_tests - old_schemas_tests, - nb_schemas_success - old_schemas_success, - nb_schemas_failed - old_schemas_failed) - if nb_instances_tests != old_instances_tests: - print "found %d test instances: %d success %d failures" % ( - nb_instances_tests - old_instances_tests, - nb_instances_success - old_instances_success, - nb_instances_failed - old_instances_failed) -# -# Parse the conf file -# -libxml2.substituteEntitiesDefault(1); -testsuite = libxml2.parseFile(CONF) - -# -# Error and warnng callbacks -# -def callback(ctx, str): - global log - log.write("%s%s" % (ctx, str)) - -libxml2.registerErrorHandler(callback, "") - -libxml2.setEntityLoader(resolver) -root = testsuite.getRootElement() -if root.name != 'testSuite': - print "%s doesn't start with a testSuite element, aborting" % (CONF) - sys.exit(1) -if quiet == 0: - print "Running Relax NG testsuite" -handle_testSuite(root) - -if quiet == 0: - print "\nTOTAL:\n" -if quiet == 0 or nb_schemas_failed != 0: - print "found %d test schemas: %d success %d failures" % ( - nb_schemas_tests, nb_schemas_success, nb_schemas_failed) -if quiet == 0 or nb_instances_failed != 0: - print "found %d test instances: %d success %d failures" % ( - nb_instances_tests, nb_instances_success, nb_instances_failed) - - -testsuite.freeDoc() - -# Memory debug specific -libxml2.relaxNGCleanupTypes() -libxml2.cleanupParser() -if libxml2.debugMemory(1) == 0: - if quiet == 0: - print "OK" -else: - print "Memory leak %d bytes" % (libxml2.debugMemory(1)) - libxml2.dumpMemory() diff --git a/reactos/lib/3rdparty/libxml2/check-xinclude-test-suite.py b/reactos/lib/3rdparty/libxml2/check-xinclude-test-suite.py deleted file mode 100644 index f470011ebe3..00000000000 --- a/reactos/lib/3rdparty/libxml2/check-xinclude-test-suite.py +++ /dev/null @@ -1,221 +0,0 @@ -#!/usr/bin/python -import sys -import time -import os -import string -sys.path.insert(0, "python") -import libxml2 - -# -# the testsuite description -# -DIR="xinclude-test-suite" -CONF="testdescr.xml" -LOG="check-xinclude-test-suite.log" - -log = open(LOG, "w") - -os.chdir(DIR) - -test_nr = 0 -test_succeed = 0 -test_failed = 0 -test_error = 0 -# -# Error and warning handlers -# -error_nr = 0 -error_msg = '' - -def errorHandler(ctx, str): - global error_nr - global error_msg - - if string.find(str, "error:") >= 0: - error_nr = error_nr + 1 - if len(error_msg) < 300: - if len(error_msg) == 0 or error_msg[-1] == '\n': - error_msg = error_msg + " >>" + str - else: - error_msg = error_msg + str - -libxml2.registerErrorHandler(errorHandler, None) - -def testXInclude(filename, id): - global error_nr - global error_msg - global log - - error_nr = 0 - error_msg = '' - - print "testXInclude(%s, %s)" % (filename, id) - return 1 - -def runTest(test, basedir): - global test_nr - global test_failed - global test_error - global test_succeed - global error_msg - global log - - fatal_error = 0 - uri = test.prop('href') - id = test.prop('id') - type = test.prop('type') - if uri == None: - print "Test without ID:", uri - return -1 - if id == None: - print "Test without URI:", id - return -1 - if type == None: - print "Test without URI:", id - return -1 - if basedir != None: - URI = basedir + "/" + uri - else: - URI = uri - if os.access(URI, os.R_OK) == 0: - print "Test %s missing: base %s uri %s" % (URI, basedir, uri) - return -1 - - expected = None - outputfile = None - diff = None - if type != 'error': - output = test.xpathEval('string(output)') - if output == 'No output file.': - output = None - if output == '': - output = None - if output != None: - if basedir != None: - output = basedir + "/" + output - if os.access(output, os.R_OK) == 0: - print "Result for %s missing: %s" % (id, output) - output = None - else: - try: - f = open(output) - expected = f.read() - outputfile = output - except: - print "Result for %s unreadable: %s" % (id, output) - - try: - # print "testing %s" % (URI) - doc = libxml2.parseFile(URI) - except: - doc = None - if doc != None: - res = doc.xincludeProcess() - if res >= 0 and expected != None: - result = doc.serialize() - if result != expected: - print "Result for %s differs" % (id) - open("xinclude.res", "w").write(result) - diff = os.popen("diff %s xinclude.res" % outputfile).read() - - doc.freeDoc() - else: - print "Failed to parse %s" % (URI) - res = -1 - - - - test_nr = test_nr + 1 - if type == 'success': - if res > 0: - test_succeed = test_succeed + 1 - elif res == 0: - test_failed = test_failed + 1 - print "Test %s: no substitution done ???" % (id) - elif res < 0: - test_error = test_error + 1 - print "Test %s: failed valid XInclude processing" % (id) - elif type == 'error': - if res > 0: - test_error = test_error + 1 - print "Test %s: failed to detect invalid XInclude processing" % (id) - elif res == 0: - test_failed = test_failed + 1 - print "Test %s: Invalid but no substitution done" % (id) - elif res < 0: - test_succeed = test_succeed + 1 - elif type == 'optional': - if res > 0: - test_succeed = test_succeed + 1 - else: - print "Test %s: failed optional test" % (id) - - # Log the ontext - if res != 1: - log.write("Test ID %s\n" % (id)) - log.write(" File: %s\n" % (URI)) - content = string.strip(test.content) - while content[-1] == '\n': - content = content[0:-1] - log.write(" %s:%s\n\n" % (type, content)) - if error_msg != '': - log.write(" ----\n%s ----\n" % (error_msg)) - error_msg = '' - log.write("\n") - if diff != None: - log.write("diff from test %s:\n" %(id)) - log.write(" -----------\n%s\n -----------\n" % (diff)); - - return 0 - - -def runTestCases(case): - creator = case.prop('creator') - if creator != None: - print "=>", creator - base = case.getBase(None) - basedir = case.prop('basedir') - if basedir != None: - base = libxml2.buildURI(basedir, base) - test = case.children - while test != None: - if test.name == 'testcase': - runTest(test, base) - if test.name == 'testcases': - runTestCases(test) - test = test.next - -conf = libxml2.parseFile(CONF) -if conf == None: - print "Unable to load %s" % CONF - sys.exit(1) - -testsuite = conf.getRootElement() -if testsuite.name != 'testsuite': - print "Expecting TESTSUITE root element: aborting" - sys.exit(1) - -profile = testsuite.prop('PROFILE') -if profile != None: - print profile - -start = time.time() - -case = testsuite.children -while case != None: - if case.name == 'testcases': - old_test_nr = test_nr - old_test_succeed = test_succeed - old_test_failed = test_failed - old_test_error = test_error - runTestCases(case) - print " Ran %d tests: %d suceeded, %d failed and %d generated an error" % ( - test_nr - old_test_nr, test_succeed - old_test_succeed, - test_failed - old_test_failed, test_error - old_test_error) - case = case.next - -conf.freeDoc() -log.close() - -print "Ran %d tests: %d suceeded, %d failed and %d generated an error in %.2f s." % ( - test_nr, test_succeed, test_failed, test_error, time.time() - start) diff --git a/reactos/lib/3rdparty/libxml2/check-xml-test-suite.py b/reactos/lib/3rdparty/libxml2/check-xml-test-suite.py deleted file mode 100644 index 2de07b1095c..00000000000 --- a/reactos/lib/3rdparty/libxml2/check-xml-test-suite.py +++ /dev/null @@ -1,409 +0,0 @@ -#!/usr/bin/python -import sys -import time -import os -import string -sys.path.insert(0, "python") -import libxml2 - -test_nr = 0 -test_succeed = 0 -test_failed = 0 -test_error = 0 - -# -# the testsuite description -# -CONF="xml-test-suite/xmlconf/xmlconf.xml" -LOG="check-xml-test-suite.log" - -log = open(LOG, "w") - -# -# Error and warning handlers -# -error_nr = 0 -error_msg = '' -def errorHandler(ctx, str): - global error_nr - global error_msg - - error_nr = error_nr + 1 - if len(error_msg) < 300: - if len(error_msg) == 0 or error_msg[-1] == '\n': - error_msg = error_msg + " >>" + str - else: - error_msg = error_msg + str - -libxml2.registerErrorHandler(errorHandler, None) - -#warning_nr = 0 -#warning = '' -#def warningHandler(ctx, str): -# global warning_nr -# global warning -# -# warning_nr = warning_nr + 1 -# warning = warning + str -# -#libxml2.registerWarningHandler(warningHandler, None) - -# -# Used to load the XML testsuite description -# -def loadNoentDoc(filename): - ctxt = libxml2.createFileParserCtxt(filename) - if ctxt == None: - return None - ctxt.replaceEntities(1) - ctxt.parseDocument() - try: - doc = ctxt.doc() - except: - doc = None - if ctxt.wellFormed() != 1: - doc.freeDoc() - return None - return doc - -# -# The conformance testing routines -# - -def testNotWf(filename, id): - global error_nr - global error_msg - global log - - error_nr = 0 - error_msg = '' - - ctxt = libxml2.createFileParserCtxt(filename) - if ctxt == None: - return -1 - ret = ctxt.parseDocument() - - try: - doc = ctxt.doc() - except: - doc = None - if doc != None: - doc.freeDoc() - if ret == 0 or ctxt.wellFormed() != 0: - print "%s: error: Well Formedness error not detected" % (id) - log.write("%s: error: Well Formedness error not detected\n" % (id)) - return 0 - return 1 - -def testNotWfEnt(filename, id): - global error_nr - global error_msg - global log - - error_nr = 0 - error_msg = '' - - ctxt = libxml2.createFileParserCtxt(filename) - if ctxt == None: - return -1 - ctxt.replaceEntities(1) - ret = ctxt.parseDocument() - - try: - doc = ctxt.doc() - except: - doc = None - if doc != None: - doc.freeDoc() - if ret == 0 or ctxt.wellFormed() != 0: - print "%s: error: Well Formedness error not detected" % (id) - log.write("%s: error: Well Formedness error not detected\n" % (id)) - return 0 - return 1 - -def testNotWfEntDtd(filename, id): - global error_nr - global error_msg - global log - - error_nr = 0 - error_msg = '' - - ctxt = libxml2.createFileParserCtxt(filename) - if ctxt == None: - return -1 - ctxt.replaceEntities(1) - ctxt.loadSubset(1) - ret = ctxt.parseDocument() - - try: - doc = ctxt.doc() - except: - doc = None - if doc != None: - doc.freeDoc() - if ret == 0 or ctxt.wellFormed() != 0: - print "%s: error: Well Formedness error not detected" % (id) - log.write("%s: error: Well Formedness error not detected\n" % (id)) - return 0 - return 1 - -def testWfEntDtd(filename, id): - global error_nr - global error_msg - global log - - error_nr = 0 - error_msg = '' - - ctxt = libxml2.createFileParserCtxt(filename) - if ctxt == None: - return -1 - ctxt.replaceEntities(1) - ctxt.loadSubset(1) - ret = ctxt.parseDocument() - - try: - doc = ctxt.doc() - except: - doc = None - if doc == None or ret != 0 or ctxt.wellFormed() == 0: - print "%s: error: wrongly failed to parse the document" % (id) - log.write("%s: error: wrongly failed to parse the document\n" % (id)) - if doc != None: - doc.freeDoc() - return 0 - if error_nr != 0: - print "%s: warning: WF document generated an error msg" % (id) - log.write("%s: error: WF document generated an error msg\n" % (id)) - doc.freeDoc() - return 2 - doc.freeDoc() - return 1 - -def testError(filename, id): - global error_nr - global error_msg - global log - - error_nr = 0 - error_msg = '' - - ctxt = libxml2.createFileParserCtxt(filename) - if ctxt == None: - return -1 - ctxt.replaceEntities(1) - ctxt.loadSubset(1) - ret = ctxt.parseDocument() - - try: - doc = ctxt.doc() - except: - doc = None - if doc != None: - doc.freeDoc() - if ctxt.wellFormed() == 0: - print "%s: warning: failed to parse the document but accepted" % (id) - log.write("%s: warning: failed to parse the document but accepte\n" % (id)) - return 2 - if error_nr != 0: - print "%s: warning: WF document generated an error msg" % (id) - log.write("%s: error: WF document generated an error msg\n" % (id)) - return 2 - return 1 - -def testInvalid(filename, id): - global error_nr - global error_msg - global log - - error_nr = 0 - error_msg = '' - - ctxt = libxml2.createFileParserCtxt(filename) - if ctxt == None: - return -1 - ctxt.validate(1) - ret = ctxt.parseDocument() - - try: - doc = ctxt.doc() - except: - doc = None - valid = ctxt.isValid() - if doc == None: - print "%s: error: wrongly failed to parse the document" % (id) - log.write("%s: error: wrongly failed to parse the document\n" % (id)) - return 0 - if valid == 1: - print "%s: error: Validity error not detected" % (id) - log.write("%s: error: Validity error not detected\n" % (id)) - doc.freeDoc() - return 0 - if error_nr == 0: - print "%s: warning: Validity error not reported" % (id) - log.write("%s: warning: Validity error not reported\n" % (id)) - doc.freeDoc() - return 2 - - doc.freeDoc() - return 1 - -def testValid(filename, id): - global error_nr - global error_msg - - error_nr = 0 - error_msg = '' - - ctxt = libxml2.createFileParserCtxt(filename) - if ctxt == None: - return -1 - ctxt.validate(1) - ctxt.parseDocument() - - try: - doc = ctxt.doc() - except: - doc = None - valid = ctxt.isValid() - if doc == None: - print "%s: error: wrongly failed to parse the document" % (id) - log.write("%s: error: wrongly failed to parse the document\n" % (id)) - return 0 - if valid != 1: - print "%s: error: Validity check failed" % (id) - log.write("%s: error: Validity check failed\n" % (id)) - doc.freeDoc() - return 0 - if error_nr != 0 or valid != 1: - print "%s: warning: valid document reported an error" % (id) - log.write("%s: warning: valid document reported an error\n" % (id)) - doc.freeDoc() - return 2 - doc.freeDoc() - return 1 - -def runTest(test): - global test_nr - global test_succeed - global test_failed - global error_msg - global log - - uri = test.prop('URI') - id = test.prop('ID') - if uri == None: - print "Test without ID:", uri - return -1 - if id == None: - print "Test without URI:", id - return -1 - base = test.getBase(None) - URI = libxml2.buildURI(uri, base) - if os.access(URI, os.R_OK) == 0: - print "Test %s missing: base %s uri %s" % (URI, base, uri) - return -1 - type = test.prop('TYPE') - if type == None: - print "Test %s missing TYPE" % (id) - return -1 - - extra = None - if type == "invalid": - res = testInvalid(URI, id) - elif type == "valid": - res = testValid(URI, id) - elif type == "not-wf": - extra = test.prop('ENTITIES') - # print URI - #if extra == None: - # res = testNotWfEntDtd(URI, id) - #elif extra == 'none': - # res = testNotWf(URI, id) - #elif extra == 'general': - # res = testNotWfEnt(URI, id) - #elif extra == 'both' or extra == 'parameter': - res = testNotWfEntDtd(URI, id) - #else: - # print "Unknow value %s for an ENTITIES test value" % (extra) - # return -1 - elif type == "error": - res = testError(URI, id) - else: - # TODO skipped for now - return -1 - - test_nr = test_nr + 1 - if res > 0: - test_succeed = test_succeed + 1 - elif res == 0: - test_failed = test_failed + 1 - elif res < 0: - test_error = test_error + 1 - - # Log the ontext - if res != 1: - log.write(" File: %s\n" % (URI)) - content = string.strip(test.content) - while content[-1] == '\n': - content = content[0:-1] - if extra != None: - log.write(" %s:%s:%s\n" % (type, extra, content)) - else: - log.write(" %s:%s\n\n" % (type, content)) - if error_msg != '': - log.write(" ----\n%s ----\n" % (error_msg)) - error_msg = '' - log.write("\n") - - return 0 - - -def runTestCases(case): - profile = case.prop('PROFILE') - if profile != None and \ - string.find(profile, "IBM XML Conformance Test Suite - Production") < 0: - print "=>", profile - test = case.children - while test != None: - if test.name == 'TEST': - runTest(test) - if test.name == 'TESTCASES': - runTestCases(test) - test = test.next - -conf = loadNoentDoc(CONF) -if conf == None: - print "Unable to load %s" % CONF - sys.exit(1) - -testsuite = conf.getRootElement() -if testsuite.name != 'TESTSUITE': - print "Expecting TESTSUITE root element: aborting" - sys.exit(1) - -profile = testsuite.prop('PROFILE') -if profile != None: - print profile - -start = time.time() - -case = testsuite.children -while case != None: - if case.name == 'TESTCASES': - old_test_nr = test_nr - old_test_succeed = test_succeed - old_test_failed = test_failed - old_test_error = test_error - runTestCases(case) - print " Ran %d tests: %d suceeded, %d failed and %d generated an error" % ( - test_nr - old_test_nr, test_succeed - old_test_succeed, - test_failed - old_test_failed, test_error - old_test_error) - case = case.next - -conf.freeDoc() -log.close() - -print "Ran %d tests: %d suceeded, %d failed and %d generated an error in %.2f s." % ( - test_nr, test_succeed, test_failed, test_error, time.time() - start) diff --git a/reactos/lib/3rdparty/libxml2/check-xsddata-test-suite.py b/reactos/lib/3rdparty/libxml2/check-xsddata-test-suite.py deleted file mode 100644 index c946129bf37..00000000000 --- a/reactos/lib/3rdparty/libxml2/check-xsddata-test-suite.py +++ /dev/null @@ -1,420 +0,0 @@ -#!/usr/bin/python -import sys -import time -import os -import string -import StringIO -sys.path.insert(0, "python") -import libxml2 - -# Memory debug specific -libxml2.debugMemory(1) -debug = 0 -verbose = 0 -quiet = 1 - -# -# the testsuite description -# -CONF=os.path.join(os.path.dirname(__file__), "test/xsdtest/xsdtestsuite.xml") -LOG="check-xsddata-test-suite.log" - -log = open(LOG, "w") -nb_schemas_tests = 0 -nb_schemas_success = 0 -nb_schemas_failed = 0 -nb_instances_tests = 0 -nb_instances_success = 0 -nb_instances_failed = 0 - -libxml2.lineNumbersDefault(1) -# -# Error and warnng callbacks -# -def callback(ctx, str): - global log - log.write("%s%s" % (ctx, str)) - -libxml2.registerErrorHandler(callback, "") - -# -# Resolver callback -# -resources = {} -def resolver(URL, ID, ctxt): - global resources - - if resources.has_key(URL): - return(StringIO.StringIO(resources[URL])) - log.write("Resolver failure: asked %s\n" % (URL)) - log.write("resources: %s\n" % (resources)) - return None - -# -# handle a valid instance -# -def handle_valid(node, schema): - global log - global nb_instances_success - global nb_instances_failed - - instance = node.prop("dtd") - if instance == None: - instance = "" - child = node.children - while child != None: - if child.type != 'text': - instance = instance + child.serialize() - child = child.next - - mem = libxml2.debugMemory(1); - try: - doc = libxml2.parseDoc(instance) - except: - doc = None - - if doc == None: - log.write("\nFailed to parse correct instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - nb_instances_failed = nb_instances_failed + 1 - return - - if debug: - print "instance line %d" % (node.lineNo()) - - try: - ctxt = schema.relaxNGNewValidCtxt() - ret = doc.relaxNGValidateDoc(ctxt) - del ctxt - except: - ret = -1 - - doc.freeDoc() - if mem != libxml2.debugMemory(1): - print "validating instance %d line %d leaks" % ( - nb_instances_tests, node.lineNo()) - - if ret != 0: - log.write("\nFailed to validate correct instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - nb_instances_failed = nb_instances_failed + 1 - else: - nb_instances_success = nb_instances_success + 1 - -# -# handle an invalid instance -# -def handle_invalid(node, schema): - global log - global nb_instances_success - global nb_instances_failed - - instance = node.prop("dtd") - if instance == None: - instance = "" - child = node.children - while child != None: - if child.type != 'text': - instance = instance + child.serialize() - child = child.next - -# mem = libxml2.debugMemory(1); - - try: - doc = libxml2.parseDoc(instance) - except: - doc = None - - if doc == None: - log.write("\nStrange: failed to parse incorrect instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - return - - if debug: - print "instance line %d" % (node.lineNo()) - - try: - ctxt = schema.relaxNGNewValidCtxt() - ret = doc.relaxNGValidateDoc(ctxt) - del ctxt - - except: - ret = -1 - - doc.freeDoc() -# if mem != libxml2.debugMemory(1): -# print "validating instance %d line %d leaks" % ( -# nb_instances_tests, node.lineNo()) - - if ret == 0: - log.write("\nFailed to detect validation problem in instance:\n-----\n") - log.write(instance) - log.write("\n-----\n") - nb_instances_failed = nb_instances_failed + 1 - else: - nb_instances_success = nb_instances_success + 1 - -# -# handle an incorrect test -# -def handle_correct(node): - global log - global nb_schemas_success - global nb_schemas_failed - - schema = "" - child = node.children - while child != None: - if child.type != 'text': - schema = schema + child.serialize() - child = child.next - - try: - rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema)) - rngs = rngp.relaxNGParse() - except: - rngs = None - if rngs == None: - log.write("\nFailed to compile correct schema:\n-----\n") - log.write(schema) - log.write("\n-----\n") - nb_schemas_failed = nb_schemas_failed + 1 - else: - nb_schemas_success = nb_schemas_success + 1 - return rngs - -def handle_incorrect(node): - global log - global nb_schemas_success - global nb_schemas_failed - - schema = "" - child = node.children - while child != None: - if child.type != 'text': - schema = schema + child.serialize() - child = child.next - - try: - rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema)) - rngs = rngp.relaxNGParse() - except: - rngs = None - if rngs != None: - log.write("\nFailed to detect schema error in:\n-----\n") - log.write(schema) - log.write("\n-----\n") - nb_schemas_failed = nb_schemas_failed + 1 - else: -# log.write("\nSuccess detecting schema error in:\n-----\n") -# log.write(schema) -# log.write("\n-----\n") - nb_schemas_success = nb_schemas_success + 1 - return None - -# -# resource handling: keep a dictionary of URL->string mappings -# -def handle_resource(node, dir): - global resources - - try: - name = node.prop('name') - except: - name = None - - if name == None or name == '': - log.write("resource has no name") - return; - - if dir != None: -# name = libxml2.buildURI(name, dir) - name = dir + '/' + name - - res = "" - child = node.children - while child != None: - if child.type != 'text': - res = res + child.serialize() - child = child.next - resources[name] = res - -# -# dir handling: pseudo directory resources -# -def handle_dir(node, dir): - try: - name = node.prop('name') - except: - name = None - - if name == None or name == '': - log.write("resource has no name") - return; - - if dir != None: -# name = libxml2.buildURI(name, dir) - name = dir + '/' + name - - dirs = node.xpathEval('dir') - for dir in dirs: - handle_dir(dir, name) - res = node.xpathEval('resource') - for r in res: - handle_resource(r, name) - -# -# handle a testCase element -# -def handle_testCase(node): - global nb_schemas_tests - global nb_instances_tests - global resources - - sections = node.xpathEval('string(section)') - log.write("\n ======== test %d line %d section %s ==========\n" % ( - - nb_schemas_tests, node.lineNo(), sections)) - resources = {} - if debug: - print "test %d line %d" % (nb_schemas_tests, node.lineNo()) - - dirs = node.xpathEval('dir') - for dir in dirs: - handle_dir(dir, None) - res = node.xpathEval('resource') - for r in res: - handle_resource(r, None) - - tsts = node.xpathEval('incorrect') - if tsts != []: - if len(tsts) != 1: - print "warning test line %d has more than one example" %(node.lineNo()) - schema = handle_incorrect(tsts[0]) - else: - tsts = node.xpathEval('correct') - if tsts != []: - if len(tsts) != 1: - print "warning test line %d has more than one example"% (node.lineNo()) - schema = handle_correct(tsts[0]) - else: - print "warning line %d has no nor child" % (node.lineNo()) - - nb_schemas_tests = nb_schemas_tests + 1; - - valids = node.xpathEval('valid') - invalids = node.xpathEval('invalid') - nb_instances_tests = nb_instances_tests + len(valids) + len(invalids) - if schema != None: - for valid in valids: - handle_valid(valid, schema) - for invalid in invalids: - handle_invalid(invalid, schema) - - -# -# handle a testSuite element -# -def handle_testSuite(node, level = 0): - global nb_schemas_tests, nb_schemas_success, nb_schemas_failed - global nb_instances_tests, nb_instances_success, nb_instances_failed - if verbose and level >= 0: - old_schemas_tests = nb_schemas_tests - old_schemas_success = nb_schemas_success - old_schemas_failed = nb_schemas_failed - old_instances_tests = nb_instances_tests - old_instances_success = nb_instances_success - old_instances_failed = nb_instances_failed - - docs = node.xpathEval('documentation') - authors = node.xpathEval('author') - if docs != []: - msg = "" - for doc in docs: - msg = msg + doc.content + " " - if authors != []: - msg = msg + "written by " - for author in authors: - msg = msg + author.content + " " - if quiet == 0: - print msg - sections = node.xpathEval('section') - if verbose and sections != [] and level <= 0: - msg = "" - for section in sections: - msg = msg + section.content + " " - if quiet == 0: - print "Tests for section %s" % (msg) - for test in node.xpathEval('testCase'): - handle_testCase(test) - for test in node.xpathEval('testSuite'): - handle_testSuite(test, level + 1) - - - if verbose and level >= 0 : - if sections != []: - msg = "" - for section in sections: - msg = msg + section.content + " " - print "Result of tests for section %s" % (msg) - elif docs != []: - msg = "" - for doc in docs: - msg = msg + doc.content + " " - print "Result of tests for %s" % (msg) - - if nb_schemas_tests != old_schemas_tests: - print "found %d test schemas: %d success %d failures" % ( - nb_schemas_tests - old_schemas_tests, - nb_schemas_success - old_schemas_success, - nb_schemas_failed - old_schemas_failed) - if nb_instances_tests != old_instances_tests: - print "found %d test instances: %d success %d failures" % ( - nb_instances_tests - old_instances_tests, - nb_instances_success - old_instances_success, - nb_instances_failed - old_instances_failed) -# -# Parse the conf file -# -libxml2.substituteEntitiesDefault(1); -testsuite = libxml2.parseFile(CONF) - -# -# Error and warnng callbacks -# -def callback(ctx, str): - global log - log.write("%s%s" % (ctx, str)) - -libxml2.registerErrorHandler(callback, "") - -libxml2.setEntityLoader(resolver) -root = testsuite.getRootElement() -if root.name != 'testSuite': - print "%s doesn't start with a testSuite element, aborting" % (CONF) - sys.exit(1) -if quiet == 0: - print "Running Relax NG testsuite" -handle_testSuite(root) - -if quiet == 0 or nb_schemas_failed != 0: - print "\nTOTAL:\nfound %d test schemas: %d success %d failures" % ( - nb_schemas_tests, nb_schemas_success, nb_schemas_failed) -if quiet == 0 or nb_instances_failed != 0: - print "found %d test instances: %d success %d failures" % ( - nb_instances_tests, nb_instances_success, nb_instances_failed) - -testsuite.freeDoc() - -# Memory debug specific -libxml2.relaxNGCleanupTypes() -libxml2.cleanupParser() -if libxml2.debugMemory(1) == 0: - if quiet == 0: - print "OK" -else: - print "Memory leak %d bytes" % (libxml2.debugMemory(1)) - libxml2.dumpMemory() diff --git a/reactos/lib/3rdparty/libxml2/config.guess b/reactos/lib/3rdparty/libxml2/config.guess deleted file mode 100644 index 49ba16f15c6..00000000000 --- a/reactos/lib/3rdparty/libxml2/config.guess +++ /dev/null @@ -1,1522 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. - -timestamp='2012-01-01' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - sh5el) machine=sh5le-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; - *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; - DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in - amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - esac - exit ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; - *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; - i*:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; - *:Interix*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-gnu - else - if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_PCS_VFP - then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi - else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf - fi - fi - exit ;; - avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu - exit ;; - crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu - exit ;; - frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu - exit ;; - x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/reactos/lib/3rdparty/libxml2/config.h b/reactos/lib/3rdparty/libxml2/config.h index 10b9b16a3cc..b96114a2c34 100644 --- a/reactos/lib/3rdparty/libxml2/config.h +++ b/reactos/lib/3rdparty/libxml2/config.h @@ -261,7 +261,7 @@ #define HAVE_VSPRINTF 1 /* Define to 1 if you have the header file. */ -/* #undef HAVE_ZLIB_H */ +#define HAVE_ZLIB_H /* Define to 1 if you have the `_stat' function. */ #define HAVE__STAT 1 diff --git a/reactos/lib/3rdparty/libxml2/config.h.in b/reactos/lib/3rdparty/libxml2/config.h.in deleted file mode 100644 index a564b6c7bba..00000000000 --- a/reactos/lib/3rdparty/libxml2/config.h.in +++ /dev/null @@ -1,324 +0,0 @@ -/* config.h.in. Generated from configure.in by autoheader. */ - -/* Define to 1 if you have the header file. */ -#undef HAVE_ANSIDECL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_INET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_NAMESER_H - -/* Whether struct sockaddr::__ss_family exists */ -#undef HAVE_BROKEN_SS_FAMILY - -/* Define to 1 if you have the `class' function. */ -#undef HAVE_CLASS - -/* Define to 1 if you have the header file. */ -#undef HAVE_CTYPE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DIRENT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Have dlopen based dso */ -#undef HAVE_DLOPEN - -/* Define to 1 if you have the header file. */ -#undef HAVE_DL_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ERRNO_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H - -/* Define to 1 if you have the `finite' function. */ -#undef HAVE_FINITE - -/* Define to 1 if you have the header file. */ -#undef HAVE_FLOAT_H - -/* Define to 1 if you have the `fpclass' function. */ -#undef HAVE_FPCLASS - -/* Define to 1 if you have the `fprintf' function. */ -#undef HAVE_FPRINTF - -/* Define to 1 if you have the `fp_class' function. */ -#undef HAVE_FP_CLASS - -/* Define to 1 if you have the header file. */ -#undef HAVE_FP_CLASS_H - -/* Define to 1 if you have the `ftime' function. */ -#undef HAVE_FTIME - -/* Define if getaddrinfo is there */ -#undef HAVE_GETADDRINFO - -/* Define to 1 if you have the `gettimeofday' function. */ -#undef HAVE_GETTIMEOFDAY - -/* Define to 1 if you have the header file. */ -#undef HAVE_IEEEFP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `isascii' function. */ -#undef HAVE_ISASCII - -/* Define if isinf is there */ -#undef HAVE_ISINF - -/* Define if isnan is there */ -#undef HAVE_ISNAN - -/* Define to 1 if you have the `isnand' function. */ -#undef HAVE_ISNAND - -/* Define if history library is there (-lhistory) */ -#undef HAVE_LIBHISTORY - -/* Have compression library */ -#undef HAVE_LIBLZMA - -/* Define if pthread library is there (-lpthread) */ -#undef HAVE_LIBPTHREAD - -/* Define if readline library is there (-lreadline) */ -#undef HAVE_LIBREADLINE - -/* Have compression library */ -#undef HAVE_LIBZ - -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H - -/* Define to 1 if you have the `localtime' function. */ -#undef HAVE_LOCALTIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_LZMA_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MATH_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `mmap' function. */ -#undef HAVE_MMAP - -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP - -/* mmap() is no good without munmap() */ -#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) -# undef /**/ HAVE_MMAP -#endif - -/* Define to 1 if you have the header file. */ -#undef HAVE_NAN_H - -/* Define to 1 if you have the header file, and it defines `DIR'. */ -#undef HAVE_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_POLL_H - -/* Define to 1 if you have the `printf' function. */ -#undef HAVE_PRINTF - -/* Define if is there */ -#undef HAVE_PTHREAD_H - -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV - -/* Define to 1 if you have the `rand' function. */ -#undef HAVE_RAND - -/* Define to 1 if you have the `rand_r' function. */ -#undef HAVE_RAND_R - -/* Define to 1 if you have the header file. */ -#undef HAVE_RESOLV_H - -/* Have shl_load based dso */ -#undef HAVE_SHLLOAD - -/* Define to 1 if you have the `signal' function. */ -#undef HAVE_SIGNAL - -/* Define to 1 if you have the header file. */ -#undef HAVE_SIGNAL_H - -/* Define to 1 if you have the `snprintf' function. */ -#undef HAVE_SNPRINTF - -/* Define to 1 if you have the `sprintf' function. */ -#undef HAVE_SPRINTF - -/* Define to 1 if you have the `srand' function. */ -#undef HAVE_SRAND - -/* Define to 1 if you have the `sscanf' function. */ -#undef HAVE_SSCANF - -/* Define to 1 if you have the `stat' function. */ -#undef HAVE_STAT - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR - -/* Define to 1 if you have the `strftime' function. */ -#undef HAVE_STRFTIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the `strndup' function. */ -#undef HAVE_STRNDUP - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_DIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MMAN_H - -/* Define to 1 if you have the header file, and it defines `DIR'. - */ -#undef HAVE_SYS_NDIR_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SELECT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIMEB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the `time' function. */ -#undef HAVE_TIME - -/* Define to 1 if you have the header file. */ -#undef HAVE_TIME_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Whether va_copy() is available */ -#undef HAVE_VA_COPY - -/* Define to 1 if you have the `vfprintf' function. */ -#undef HAVE_VFPRINTF - -/* Define to 1 if you have the `vsnprintf' function. */ -#undef HAVE_VSNPRINTF - -/* Define to 1 if you have the `vsprintf' function. */ -#undef HAVE_VSPRINTF - -/* Define to 1 if you have the header file. */ -#undef HAVE_ZLIB_H - -/* Define to 1 if you have the `_stat' function. */ -#undef HAVE__STAT - -/* Whether __va_copy() is available */ -#undef HAVE___VA_COPY - -/* Define as const if the declaration of iconv() needs const. */ -#undef ICONV_CONST - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Name of package */ -#undef PACKAGE - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the home page for this package. */ -#undef PACKAGE_URL - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Support for IPv6 */ -#undef SUPPORT_IP6 - -/* Version number of package */ -#undef VERSION - -/* Determine what socket length (socklen_t) data type is */ -#undef XML_SOCKLEN_T - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT32_T - -/* Using the Win32 Socket implementation */ -#undef _WINSOCKAPI_ - -/* ss_family is not defined here, use __ss_family instead */ -#undef ss_family - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef uint32_t diff --git a/reactos/lib/3rdparty/libxml2/config.sub b/reactos/lib/3rdparty/libxml2/config.sub deleted file mode 100644 index d6b6b3c768f..00000000000 --- a/reactos/lib/3rdparty/libxml2/config.sub +++ /dev/null @@ -1,1766 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. - -timestamp='2012-01-01' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | epiphany \ - | fido | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 \ - | ns16k | ns32k \ - | open8 \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze) - basic_machine=microblaze-xilinx - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i386-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/reactos/lib/3rdparty/libxml2/configure b/reactos/lib/3rdparty/libxml2/configure deleted file mode 100644 index dab3f3abba4..00000000000 --- a/reactos/lib/3rdparty/libxml2/configure +++ /dev/null @@ -1,17695 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. -# -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -SHELL=${CONFIG_SHELL-/bin/sh} - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME= -PACKAGE_TARNAME= -PACKAGE_VERSION= -PACKAGE_STRING= -PACKAGE_BUGREPORT= -PACKAGE_URL= - -ac_unique_file="entities.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -PYTHON_TESTS -RELDATE -RDL_LIBS -M_LIBS -PYTHON_SITE_PACKAGES -PYTHON_INCLUDES -PYTHON_VERSION -HAVE_ISINF -HAVE_ISNAN -XML_INCLUDEDIR -ICONV_LIBS -XML_LIBTOOLLIBS -XML_LIBS -XML_LIBDIR -XML_CFLAGS -CYGWIN_EXTRA_PYTHON_LIBADD -CYGWIN_EXTRA_LDFLAGS -WIN32_EXTRA_PYTHON_LIBADD -WIN32_EXTRA_LDFLAGS -WIN32_EXTRA_LIBADD -WITH_RUN_DEBUG -WITH_MEM_DEBUG -TEST_DEBUG -DEBUG_OBJ -WITH_DEBUG -TEST_REGEXPS -WITH_REGEXPS -TEST_SCHEMAS -WITH_SCHEMAS -TEST_SCHEMATRON -WITH_SCHEMATRON -WITH_ISO8859X -ICU_LIBS -WITH_ICU -WITH_ICONV -WITH_OUTPUT -TEST_XPATH -XPATH_OBJ -WITH_XPATH -TEST_XINCLUDE -XINCLUDE_OBJ -WITH_XINCLUDE -TEST_C14N -C14N_OBJ -WITH_C14N -TEST_XPTR -XPTR_OBJ -WITH_XPTR -DOCB_OBJ -WITH_DOCB -TEST_CATALOG -CATALOG_OBJ -WITH_CATALOG -TEST_VTIME -TEST_VALID -WITH_VALID -TEST_PHTML -TEST_HTML -HTML_OBJ -WITH_HTML -TEST_PUSH -WITH_PUSH -TEST_SAX -WITH_SAX1_SOURCES_FALSE -WITH_SAX1_SOURCES_TRUE -WITH_SAX1 -TEST_PATTERN -WITH_PATTERN -WITH_WRITER -READER_TEST -WITH_READER -WITH_LEGACY -HTTP_OBJ -WITH_HTTP -FTP_OBJ -WITH_FTP -WITH_TREE -THREADS_W32_FALSE -THREADS_W32_TRUE -TEST_THREADS -THREAD_CFLAGS -WITH_THREADS -BASE_THREAD_LIBS -THREAD_LIBS -WITH_TRIO -WITH_TRIO_SOURCES_FALSE -WITH_TRIO_SOURCES_TRUE -STATIC_BINARIES -TEST_MODULES -MODULE_EXTENSION -MODULE_PLATFORM_LIBS -WITH_MODULES -PYTHON_LIBS -PYTHON_SUBDIR -pythondir -WITH_PYTHON_FALSE -WITH_PYTHON_TRUE -PYTHON -WITH_LZMA -LZMA_LIBS -LZMA_CFLAGS -WITH_ZLIB -Z_LIBS -Z_CFLAGS -REBUILD_DOCS_FALSE -REBUILD_DOCS_TRUE -HTML_DIR -USE_VERSION_SCRIPT_FALSE -USE_VERSION_SCRIPT_TRUE -VERSION_SCRIPT_FLAGS -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -MANIFEST_TOOL -RANLIB -ac_ct_AR -AR -DLLTOOL -OBJDUMP -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -EGREP -GREP -SED -LIBTOOL -XSLTPROC -XMLLINT -WGET -PERL -TAR -MV -RM -CPP -LN_S -am__fastdepCC_FALSE -am__fastdepCC_TRUE -CCDEPMODE -am__nodep -AMDEPBACKSLASH -AMDEP_FALSE -AMDEP_TRUE -am__quote -am__include -DEPDIR -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V -am__untar -am__tar -AMTAR -am__leading_dot -SET_MAKE -AWK -mkdir_p -MKDIR_P -INSTALL_STRIP_PROGRAM -STRIP -install_sh -MAKEINFO -AUTOHEADER -AUTOMAKE -AUTOCONF -ACLOCAL -VERSION -PACKAGE -CYGPATH_W -am__isrc -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -LIBXML_VERSION_EXTRA -LIBXML_VERSION_NUMBER -LIBXML_VERSION_INFO -LIBXML_VERSION -LIBXML_MICRO_VERSION -LIBXML_MINOR_VERSION -LIBXML_MAJOR_VERSION -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_silent_rules -enable_dependency_tracking -enable_shared -enable_static -with_pic -enable_fast_install -with_gnu_ld -with_sysroot -enable_libtool_lock -with_c14n -with_catalog -with_debug -with_docbook -with_fexceptions -with_ftp -with_history -with_html -with_html_dir -with_html_subdir -with_http -with_iconv -with_icu -with_iso8859x -with_legacy -with_mem_debug -with_minimum -with_output -with_pattern -with_push -with_python -with_reader -with_readline -with_regexps -with_run_debug -with_sax1 -with_schemas -with_schematron -with_threads -with_thread_alloc -with_tree -with_valid -with_writer -with_xinclude -with_xpath -with_xptr -with_modules -with_zlib -with_lzma -with_coverage -enable_rebuild_docs -enable_ipv6 -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] -_ACEOF -fi - -if test -n "$ac_init_help"; then - - cat <<\_ACEOF - -Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0') - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] - --enable-fast-install[=PKGS] - optimize for fast installation [default=yes] - --disable-libtool-lock avoid locking (might break parallel builds) - --enable-rebuild-docs[=yes/no] rebuild some generated docs [default=no] - --enable-ipv6[=yes/no] enables compilation of IPv6 code [default=yes] - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-gnu-ld assume the C compiler uses GNU ld [default=no] - --with-sysroot=DIR Search for dependent libraries within DIR - (or the compiler's sysroot if not specified). - --with-c14n add the Canonicalization support (on) - --with-catalog add the Catalog support (on) - --with-debug add the debugging module (on) - --with-docbook add Docbook SGML support (on) - --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off) - --with-ftp add the FTP support (on) - --with-history add history support to xmllint shell(off) - --with-html add the HTML support (on) - --with-html-dir=path path to base html directory, default - $datadir/doc/html - --with-html-subdir=path directory used under html-dir, default - $PACKAGE-$VERSION/html - --with-http add the HTTP support (on) - --with-iconv[=DIR] add ICONV support (on) - --with-icu add ICU support (off) - --with-iso8859x add ISO8859X support if no iconv (on) - --with-legacy add deprecated APIs for compatibility (on) - --with-mem-debug add the memory debugging module (off) - --with-minimum build a minimally sized library (off) - --with-output add the serialization support (on) - --with-pattern add the xmlPattern selection interface (on) - --with-push add the PUSH parser interfaces (on) - --with-python[=DIR] build Python bindings if found - --with-reader add the xmlReader parsing interface (on) - --with-readline=DIR use readline in DIR - --with-regexps add Regular Expressions support (on) - --with-run-debug add the runtime debugging module (off) - --with-sax1 add the older SAX1 interface (on) - --with-schemas add Relax-NG and Schemas support (on) - --with-schematron add Schematron support (on) - --with-threads add multithread support(on) - --with-thread-alloc add per-thread memory(off) - --with-tree add the DOM like tree manipulation APIs (on) - --with-valid add the DTD validation support (on) - --with-writer add the xmlWriter saving interface (on) - --with-xinclude add the XInclude support (on) - --with-xpath add the XPATH support (on) - --with-xptr add the XPointer support (on) - --with-modules add the dynamic modules support (on) - --with-zlib[=DIR] use libz in DIR - --with-lzma[=DIR] use liblzma in DIR - --with-coverage build for code coverage with GCC (off) - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to the package provider. -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -configure -generated by GNU Autoconf 2.68 - -Copyright (C) 2010 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_func - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_find_uintX_t LINENO BITS VAR -# ------------------------------------ -# Finds an unsigned integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in #( - uint$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_find_uintX_t -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -ac_config_headers="$ac_config_headers config.h" - - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - - -LIBXML_MAJOR_VERSION=2 -LIBXML_MINOR_VERSION=9 -LIBXML_MICRO_VERSION=0 -LIBXML_MICRO_VERSION_SUFFIX= -LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX -LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION - -LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` - -if test -f CVS/Entries ; then - extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-CVS$extra" - fi -else if test -d .svn ; then - extra=`svn info | grep Revision | sed 's+Revision: ++'` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-SVN$extra" - fi -else if test -d .git ; then - extra=`git describe 2>/dev/null | sed 's+LIBXML[0-9.]*-++'` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-GIT$extra" - fi -fi -fi -fi - - - - - - - - -VERSION=${LIBXML_VERSION} - -am__api_version='1.11' - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - fi - done - done - ;; -esac - - done -IFS=$as_save_IFS - -rm -rf conftest.one conftest.two conftest.dir - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in mkdir gmkdir; do - for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ - 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext - break 3;; - esac - done - done - done -IFS=$as_save_IFS - -fi - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE=libxml2 - VERSION=$VERSION - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. Yes, it's still used -# in the wild :-( We should find a proper way to deprecate it ... -AMTAR='$${TAR-tar}' - -am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' - - - - - - -# Support silent build rules, requires at least automake-1.11. Disable -# by either passing --disable-silent-rules to configure or passing V=1 -# to make -# Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : - enableval=$enable_silent_rules; -fi - -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=0;; -esac -am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) -BAR0=false -BAR1=true -V=1 -am__doit: - @$(TRUE) -.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then - am_cv_make_support_nested_variables=yes -else - am_cv_make_support_nested_variables=no -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } -if test $am_cv_make_support_nested_variables = yes; then - AM_V='$(V)' - AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' -else - AM_V=$AM_DEFAULT_VERBOSITY - AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY -fi -AM_BACKSLASH='\' - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' - am__nodep='_no' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub - - am_cv_CC_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Extract the first word of "rm", so it can be a program name with args. -set dummy rm; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_RM+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $RM in - [\\/]* | ?:[\\/]*) - ac_cv_path_RM="$RM" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_RM" && ac_cv_path_RM="/bin/rm" - ;; -esac -fi -RM=$ac_cv_path_RM -if test -n "$RM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 -$as_echo "$RM" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "mv", so it can be a program name with args. -set dummy mv; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_MV+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MV in - [\\/]* | ?:[\\/]*) - ac_cv_path_MV="$MV" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_MV="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_MV" && ac_cv_path_MV="/bin/mv" - ;; -esac -fi -MV=$ac_cv_path_MV -if test -n "$MV"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MV" >&5 -$as_echo "$MV" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "tar", so it can be a program name with args. -set dummy tar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_TAR+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $TAR in - [\\/]* | ?:[\\/]*) - ac_cv_path_TAR="$TAR" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_TAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_TAR" && ac_cv_path_TAR="/bin/tar" - ;; -esac -fi -TAR=$ac_cv_path_TAR -if test -n "$TAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 -$as_echo "$TAR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PERL+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="/usr/bin/perl" - ;; -esac -fi -PERL=$ac_cv_path_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "wget", so it can be a program name with args. -set dummy wget; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_WGET+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $WGET in - [\\/]* | ?:[\\/]*) - ac_cv_path_WGET="$WGET" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_WGET="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_WGET" && ac_cv_path_WGET="/usr/bin/wget" - ;; -esac -fi -WGET=$ac_cv_path_WGET -if test -n "$WGET"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WGET" >&5 -$as_echo "$WGET" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "xmllint", so it can be a program name with args. -set dummy xmllint; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XMLLINT+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XMLLINT in - [\\/]* | ?:[\\/]*) - ac_cv_path_XMLLINT="$XMLLINT" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_XMLLINT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_XMLLINT" && ac_cv_path_XMLLINT="/usr/bin/xmllint" - ;; -esac -fi -XMLLINT=$ac_cv_path_XMLLINT -if test -n "$XMLLINT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 -$as_echo "$XMLLINT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -# Extract the first word of "xsltproc", so it can be a program name with args. -set dummy xsltproc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_XSLTPROC+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $XSLTPROC in - [\\/]* | ?:[\\/]*) - ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_XSLTPROC" && ac_cv_path_XSLTPROC="/usr/bin/xsltproc" - ;; -esac -fi -XSLTPROC=$ac_cv_path_XSLTPROC -if test -n "$XSLTPROC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 -$as_echo "$XSLTPROC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.4.2' -macro_revision='1.3337' - - - - - - - - - - - - - -ltmain="$ac_aux_dir/ltmain.sh" - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - : ${lt_cv_path_NM=no} -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DUMPBIN"; then - ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DUMPBIN"; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } - -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - os2*) - # The test takes a long time on OS/2. - lt_cv_sys_max_cmd_len=8192 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - else - # Make teststring a little bigger before we do anything with it. - # a 1K string should be a reasonable start. - for i in 1 2 3 4 5 6 7 8 ; do - teststring=$teststring$teststring - done - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ - = c,a/b,b/c, \ - && eval 'test $(( 1 + 1 )) -eq 2 \ - && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ - && xsi_shell=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 - ;; - esac - ;; - *-*-cygwin* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin - ;; - *-*-cygwin* ) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; - * ) # otherwise, assume *nix - lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin - ;; - esac - ;; - * ) # unhandled hosts (and "normal" native builds) - lt_cv_to_host_file_cmd=func_convert_file_noop - ;; -esac - -fi - -to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - #assume ordinary cross tools, or native build. -lt_cv_to_tool_file_cmd=func_convert_file_noop -case $host in - *-*-mingw* ) - case $build in - *-*-mingw* ) # actually msys - lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 - ;; - esac - ;; -esac - -fi - -to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_reload_flag='-r' -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - if test "$GCC" != yes; then - reload_cmds=false - fi - ;; - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix[4-9]*) - lt_cv_deplibs_check_method=pass_all - ;; - -beos*) - lt_cv_deplibs_check_method=pass_all - ;; - -bsdi[45]*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' - lt_cv_file_magic_test_file=/shlib/libc.so - ;; - -cygwin*) - # func_win32_libid is a shell function defined in ltmain.sh - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - ;; - -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump', - # unless we find 'file', for example because we are cross-compiling. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } - -file_magic_glob= -want_nocaseglob=no -if test "$build" = "$host"; then - case $host_os in - mingw* | pw32*) - if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then - want_nocaseglob=yes - else - file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` - fi - ;; - esac -fi - -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - - - - - - - - - - - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" -fi - -test -z "$DLLTOOL" && DLLTOOL=dlltool - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_sharedlib_from_linklib_cmd='unknown' - -case $host_os in -cygwin* | mingw* | pw32* | cegcc*) - # two different shell functions defined in ltmain.sh - # decide which to use based on capabilities of $DLLTOOL - case `$DLLTOOL --help 2>&1` in - *--identify-strict*) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib - ;; - *) - lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback - ;; - esac - ;; -*) - # fallback: assume linklib IS sharedlib - lt_cv_sharedlib_from_linklib_cmd="$ECHO" - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } -sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd -test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO - - - - - - - - -if test -n "$ac_tool_prefix"; then - for ac_prog in ar - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AR" && break - done -fi -if test -z "$AR"; then - ac_ct_AR=$AR - for ac_prog in ar -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_AR" && break -done - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -fi - -: ${AR=ar} -: ${AR_FLAGS=cru} - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ar_at_file=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - echo conftest.$ac_objext > conftest.lst - lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -eq 0; then - # Ensure the archiver fails upon bogus file names. - rm -f conftest.$ac_objext libconftest.a - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 - (eval $lt_ar_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if test "$ac_status" -ne 0; then - lt_cv_ar_at_file=@ - fi - fi - rm -f conftest.* libconftest.a - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } - -if test "x$lt_cv_ar_at_file" = xno; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -test -z "$STRIP" && STRIP=: - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[ABCDGISTW]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK '"\ -" {last_section=section; section=\$ 3};"\ -" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ -" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ -" \$ 0!~/External *\|/{next};"\ -" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ -" {if(hide[section]) next};"\ -" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ -" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ -" s[1]~/^[@?]/{print s[1], s[1]; next};"\ -" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ -" ' prfx=^$ac_symprfx" - else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <<_LT_EOF -#ifdef __cplusplus -extern "C" { -#endif -char nm_test_var; -void nm_test_func(void); -void nm_test_func(void){} -#ifdef __cplusplus -} -#endif -int main(){nm_test_var='a';nm_test_func();return(0);} -_LT_EOF - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -_LT_EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - - cat <<_LT_EOF >> conftest.$ac_ext - -/* The mapping between symbol names and symbols. */ -LT_DLSYM_CONST struct { - const char *name; - void *address; -} -lt__PROGRAM__LTX_preloaded_symbols[] = -{ - { "@PROGRAM@", (void *) 0 }, -_LT_EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext - cat <<\_LT_EOF >> conftest.$ac_ext - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt__PROGRAM__LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif -_LT_EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_globsym_save_LIBS=$LIBS - lt_globsym_save_CFLAGS=$CFLAGS - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS=$lt_globsym_save_LIBS - CFLAGS=$lt_globsym_save_CFLAGS - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -rf conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done - -fi - -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi - -# Response file support. -if test "$lt_cv_nm_interface" = "MS dumpbin"; then - nm_file_list_spec='@' -elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then - nm_file_list_spec='@' -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } - -# Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : - withval=$with_sysroot; -else - with_sysroot=no -fi - - -lt_sysroot= -case ${with_sysroot} in #( - yes) - if test "$GCC" = yes; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` - fi - ;; #( - /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` - ;; #( - no|'') - ;; #( - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 -$as_echo "${with_sysroot}" >&6; } - as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 - ;; -esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } - - - - - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi - -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) - case $host in - i?86-*-solaris*) - LD="${LD-ld} -m elf_x86_64" - ;; - sparc*-*-solaris*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - # GNU ld 2.21 introduced _sol2 emulations. Use them if available. - if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then - LD="${LD-ld}_sol2" - fi - ;; - *) - if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then - LD="${LD-ld} -64" - fi - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; -esac - -need_locks="$enable_libtool_lock" - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. -set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MANIFEST_TOOL"; then - ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL -if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MANIFEST_TOOL"; then - ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL - # Extract the first word of "mt", so it can be a program name with args. -set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MANIFEST_TOOL"; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL -if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MANIFEST_TOOL" = x; then - MANIFEST_TOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL - fi -else - MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" -fi - -test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no - echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 - $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out - cat conftest.err >&5 - if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test "x$lt_cv_path_mainfest_tool" != xyes; then - MANIFEST_TOOL=: -fi - - - - - - - case $host_os in - rhapsody* | darwin*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. -set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DSYMUTIL"; then - ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DSYMUTIL"; then - ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$NMEDIT"; then - ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_NMEDIT"; then - ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$LIPO"; then - ac_cv_prog_LIPO="$LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_LIPO"; then - ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL"; then - ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL"; then - ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OTOOL64"; then - ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OTOOL64"; then - ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - # If there is a non-empty error log, and "single_module" - # appears in it, assume the flag caused a linker warning - if test -s conftest.err && $GREP single_module conftest.err; then - cat conftest.err >&5 - # Otherwise, if the output was created with a 0 exit code from - # the compiler, it worked. - elif test -f libconftest.dylib && test $_lt_result -eq 0; then - lt_cv_apple_cc_single_mod=yes - else - cat conftest.err >&5 - fi - rm -rf libconftest.dylib* - rm -f conftest.* - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_exported_symbols_list=no - save_LDFLAGS=$LDFLAGS - echo "_main" > conftest.sym - LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -s conftest.err && $GREP force_load conftest.err; then - cat conftest.err >&5 - elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - - - -# Set options - - - - enable_dlopen=no - - - enable_win32_dll=no - - - # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : - enableval=$enable_shared; p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_shared=yes -fi - - - - - - - - - - # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : - enableval=$enable_static; p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_static=yes -fi - - - - - - - - - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : - withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for lt_pkg in $withval; do - IFS="$lt_save_ifs" - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - pic_mode=default -fi - - -test -z "$pic_mode" && pic_mode=default - - - - - - - - # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : - enableval=$enable_fast_install; p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac -else - enable_fast_install=yes -fi - - - - - - - - - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -test -z "$LN_S" && LN_S="ln -s" - - - - - - - - - - - - - - -if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi - -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Use C for the default configuration in the libtool script - -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - if test -n "$lt_prog_compiler_pic"; then - lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" - fi - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - nagfor*) - # NAG Fortran compiler - lt_prog_compiler_wl='-Wl,-Wl,,' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ F* | *Sun*Fortran*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Qoption ld ' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-Wl,' - ;; - *Intel*\ [CF]*Compiler*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - *Portland\ Group*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - esac - ;; - esac - ;; - - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - - rdos*) - lt_prog_compiler_static='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic=$lt_prog_compiler_pic -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } -lt_prog_compiler_pic=$lt_cv_prog_compiler_pic - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler_c_o=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_separator= - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - inherit_rpath=no - link_all_deplibs=unknown - module_cmds= - module_expsym_cmds= - old_archive_from_new_cmds= - old_archive_from_expsyms_cmds= - thread_safe_flag_spec= - whole_archive_flag_spec= - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - # Exclude shared library initialization/finalization symbols. - extract_expsyms_cmds= - - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs=yes - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' - exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs=no - fi - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag=' $pic_flag' - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix[4-9]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - export_dynamic_flag_spec='${wl}-bexpall' - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - if test "${lt_cv_aix_libpath+set}" = set; then - aix_libpath=$lt_cv_aix_libpath -else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\([^ ]*\) *$/\1/ - p - } - }' - lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - # Check for a 64-bit object if we didn't find anything. - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` - fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test -z "$lt_cv_aix_libpath_"; then - lt_cv_aix_libpath_="/usr/lib:/lib" - fi - -fi - - aix_libpath=$lt_cv_aix_libpath_ -fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - case $cc_basename in - cl*) - # Native MSVC - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - always_export_symbols=yes - file_list_spec='@' - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' - archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; - else - sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; - fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ - linknames=' - # The linker will not automatically build a static lib if we build a DLL. - # _LT_TAGVAR(old_archive_from_new_cmds, )='true' - enable_shared_with_static_runtimes=yes - exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' - # Don't use ranlib - old_postinstall_cmds='chmod 644 $oldlib' - postlink_cmds='lt_outputfile="@OUTPUT@"~ - lt_tool_outputfile="@TOOL_OUTPUT@"~ - case $lt_outputfile in - *.exe|*.EXE) ;; - *) - lt_outputfile="$lt_outputfile.exe" - lt_tool_outputfile="$lt_tool_outputfile.exe" - ;; - esac~ - if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then - $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; - $RM "$lt_outputfile.manifest"; - fi' - ;; - *) - # Assume MSVC wrapper - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - enable_shared_with_static_runtimes=yes - ;; - esac - ;; - - darwin* | rhapsody*) - - - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2.*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo (void) { return 0; } -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_irix_exported_symbol=yes -else - lt_cv_irix_exported_symbol=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } - if test "$lt_cv_irix_exported_symbol" = yes; then - archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - fi - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - else - case `$CC -V 2>&1` in - *"Compilers 5.0"*) - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' - ;; - *) - wlarc='${wl}' - archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' - ;; - esac - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. GCC discards it without `$wl', - # but is careful enough not to reorder. - # Supported since Solaris 2.6 (maybe 2.5.1?) - if test "$GCC" = yes; then - whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - else - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' - fi - ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-R,$libdir' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac - - if test x$host_vendor = xsni; then - case $host in - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - export_dynamic_flag_spec='${wl}-Blargedynsym' - ;; - esac - fi - fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix[4-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32* | cegcc*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$cc_basename in - yes,*) - # gcc - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname~ - if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then - eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; - fi' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - dynamic_linker='Win32 ld.exe' - ;; - - *,cl*) - # Native MSVC - libname_spec='$name' - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - library_names_spec='${libname}.dll.lib' - - case $build_os in - mingw*) - sys_lib_search_path_spec= - lt_save_ifs=$IFS - IFS=';' - for lt_path in $LIB - do - IFS=$lt_save_ifs - # Let DOS variable expansion print the short 8.3 style file name. - lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` - sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" - done - IFS=$lt_save_ifs - # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` - ;; - cygwin*) - # Convert to unix form, then to dos form, then back to unix form - # but this time dos style (no spaces!) so that the unix form looks - # like /cygdrive/c/PROGRA~1:/cygdr... - sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` - sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` - sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - ;; - *) - sys_lib_search_path_spec="$LIB" - if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - # FIXME: find the short name or the path components, as spaces are - # common. (e.g. "Program Files" -> "PROGRA~1") - ;; - esac - - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $RM \$dlpath' - shlibpath_overrides_runpath=yes - dynamic_linker='Win32 link.exe' - ;; - - *) - # Assume MSVC wrapper - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - dynamic_linker='Win32 ld.exe' - ;; - esac - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[23].*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2.*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - *) # from 4.6 on, and DragonFly - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -haiku*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux # correct to gnu/linux during the next big refactor - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - - # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -*nto* | *qnx*) - version_type=qnx - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='ldqnx.so' - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -rdos*) - dynamic_linker=no - ;; - -solaris*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -tpf*) - # TPF is a cross-target only. Preferred cross-host = GNU/Linux. - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -uts4*) - version_type=linux # correct to gnu/linux during the next big refactor - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - -fi - - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lsvld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" -fi - - -fi - - -fi - - -fi - - -fi - - -fi - - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); -#endif - -int fnord () { return 42; } -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else - { - if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - - - -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - -VERSION_SCRIPT_FLAGS= -# lt_cv_prog_gnu_ld is from libtool 2.+ -if test "$lt_cv_prog_gnu_ld" = yes; then - VERSION_SCRIPT_FLAGS=-Wl,--version-script= -else - case $host in - *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";; - esac -fi - - if test -n "$VERSION_SCRIPT_FLAGS"; then - USE_VERSION_SCRIPT_TRUE= - USE_VERSION_SCRIPT_FALSE='#' -else - USE_VERSION_SCRIPT_TRUE='#' - USE_VERSION_SCRIPT_FALSE= -fi - - - -_cppflags="${CPPFLAGS}" -_libs="${LIBS}" - - -# Check whether --with-c14n was given. -if test "${with_c14n+set}" = set; then : - withval=$with_c14n; -fi - - -# Check whether --with-catalog was given. -if test "${with_catalog+set}" = set; then : - withval=$with_catalog; -fi - - -# Check whether --with-debug was given. -if test "${with_debug+set}" = set; then : - withval=$with_debug; -fi - - -# Check whether --with-docbook was given. -if test "${with_docbook+set}" = set; then : - withval=$with_docbook; -fi - - -# Check whether --with-fexceptions was given. -if test "${with_fexceptions+set}" = set; then : - withval=$with_fexceptions; -fi - - -# Check whether --with-ftp was given. -if test "${with_ftp+set}" = set; then : - withval=$with_ftp; -fi - - -# Check whether --with-history was given. -if test "${with_history+set}" = set; then : - withval=$with_history; -fi - - -# Check whether --with-html was given. -if test "${with_html+set}" = set; then : - withval=$with_html; -fi - - -# Check whether --with-html-dir was given. -if test "${with_html_dir+set}" = set; then : - withval=$with_html_dir; HTML_DIR=$withval -else - HTML_DIR='$(datadir)/doc' -fi - - - -# Check whether --with-html-subdir was given. -if test "${with_html_subdir+set}" = set; then : - withval=$with_html_subdir; test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval" -else - HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html" -fi - - - -# Check whether --with-http was given. -if test "${with_http+set}" = set; then : - withval=$with_http; -fi - - -# Check whether --with-iconv was given. -if test "${with_iconv+set}" = set; then : - withval=$with_iconv; -fi - - -# Check whether --with-icu was given. -if test "${with_icu+set}" = set; then : - withval=$with_icu; -fi - - -# Check whether --with-iso8859x was given. -if test "${with_iso8859x+set}" = set; then : - withval=$with_iso8859x; -fi - - -# Check whether --with-legacy was given. -if test "${with_legacy+set}" = set; then : - withval=$with_legacy; -fi - - -# Check whether --with-mem_debug was given. -if test "${with_mem_debug+set}" = set; then : - withval=$with_mem_debug; -fi - - -# Check whether --with-minimum was given. -if test "${with_minimum+set}" = set; then : - withval=$with_minimum; -fi - - -# Check whether --with-output was given. -if test "${with_output+set}" = set; then : - withval=$with_output; -fi - - -# Check whether --with-pattern was given. -if test "${with_pattern+set}" = set; then : - withval=$with_pattern; -fi - - -# Check whether --with-push was given. -if test "${with_push+set}" = set; then : - withval=$with_push; -fi - - -# Check whether --with-python was given. -if test "${with_python+set}" = set; then : - withval=$with_python; -fi - - -# Check whether --with-reader was given. -if test "${with_reader+set}" = set; then : - withval=$with_reader; -fi - - -# Check whether --with-readline was given. -if test "${with_readline+set}" = set; then : - withval=$with_readline; - if test "$withval" != "no" -a "$withval" != "yes"; then - RDL_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LIBS="${LIBS} -L$withval/lib" - fi - -fi - - -# Check whether --with-regexps was given. -if test "${with_regexps+set}" = set; then : - withval=$with_regexps; -fi - - -# Check whether --with-run_debug was given. -if test "${with_run_debug+set}" = set; then : - withval=$with_run_debug; -fi - - -# Check whether --with-sax1 was given. -if test "${with_sax1+set}" = set; then : - withval=$with_sax1; -fi - - -# Check whether --with-schemas was given. -if test "${with_schemas+set}" = set; then : - withval=$with_schemas; -fi - - -# Check whether --with-schematron was given. -if test "${with_schematron+set}" = set; then : - withval=$with_schematron; -fi - - -# Check whether --with-threads was given. -if test "${with_threads+set}" = set; then : - withval=$with_threads; -fi - - -# Check whether --with-thread-alloc was given. -if test "${with_thread_alloc+set}" = set; then : - withval=$with_thread_alloc; -fi - - -# Check whether --with-tree was given. -if test "${with_tree+set}" = set; then : - withval=$with_tree; -fi - - -# Check whether --with-valid was given. -if test "${with_valid+set}" = set; then : - withval=$with_valid; -fi - - -# Check whether --with-writer was given. -if test "${with_writer+set}" = set; then : - withval=$with_writer; -fi - - -# Check whether --with-xinclude was given. -if test "${with_xinclude+set}" = set; then : - withval=$with_xinclude; -fi - - -# Check whether --with-xpath was given. -if test "${with_xpath+set}" = set; then : - withval=$with_xpath; -fi - - -# Check whether --with-xptr was given. -if test "${with_xptr+set}" = set; then : - withval=$with_xptr; -fi - - -# Check whether --with-modules was given. -if test "${with_modules+set}" = set; then : - withval=$with_modules; -fi - - -# Check whether --with-zlib was given. -if test "${with_zlib+set}" = set; then : - withval=$with_zlib; - if test "$withval" != "no" -a "$withval" != "yes"; then - Z_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LIBS="${LIBS} -L$withval/lib" - fi - -fi - - -# Check whether --with-lzma was given. -if test "${with_lzma+set}" = set; then : - withval=$with_lzma; - if test "$withval" != "no" -a "$withval" != "yes"; then - LZMA_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LIBS="${LIBS} -L$withval/lib" - fi - -fi - - -# Check whether --with-coverage was given. -if test "${with_coverage+set}" = set; then : - withval=$with_coverage; -fi - - -# Check whether --enable-rebuild-docs was given. -if test "${enable_rebuild_docs+set}" = set; then : - enableval=$enable_rebuild_docs; -fi - -if test "$enable_rebuild_docs" = "yes" -a "$srcdir" != "."; then - as_fn_error $? "cannot rebuild docs when builddir != srcdir" "$LINENO" 5 -fi - if test "$enable_rebuild_docs" = "yes" -o "$USER" = "veillard"; then - REBUILD_DOCS_TRUE= - REBUILD_DOCS_FALSE='#' -else - REBUILD_DOCS_TRUE='#' - REBUILD_DOCS_FALSE= -fi - - -if test "$with_schemas" = "yes" -then - with_pattern=yes - with_regexps=yes -fi -if test "$with_schematron" = "yes" -then - with_pattern=yes - with_xpath=yes -fi -if test "$with_reader" = "yes" -then - with_push=yes -fi -if test "$with_xptr" = "yes" -then - with_xpath=yes -fi -if test "$with_minimum" = "yes" -then - echo "Configuring for a minimal library" - if test "$with_c14n" = "" - then - with_c14n=no - fi - if test "$with_catalog" = "" - then - with_catalog=no - fi - echo So far so good! - if test "$with_debug" = "" - then - with_debug=no - fi - if test "$with_docbook" = "" - then - with_docbook=no - fi - if test "$with_fexceptions" = "" - then - with_fexceptions=no - fi - if test "$with_ftp" = "" - then - with_ftp=no - fi - if test "$with_history" = "" - then - with_history=no - fi - if test "$with_html" = "" - then - with_html=no - fi - if test "$with_http" = "" - then - with_http=no - fi - if test "$with_iconv" = "" - then - with_iconv=no - fi - if test "$with_iso8859x" = "" - then - with_iso8859x=no - fi - if test "$with_legacy" = "" - then - with_legacy=no - fi - if test "$with_mem_debug" = "" - then - with_mem_debug=no - fi - if test "$with_output" = "" - then - with_output=no - fi - if test "$with_pattern" = "" - then - with_pattern=no - fi - if test "$with_push" = "" - then - with_push=no - fi - if test "$with_python" = "" - then - with_python=no - fi - if test "$with_reader" = "" - then - with_reader=no - fi - if test "$with_readline" = "" - then - with_readline=no - fi - if test "$with_regexps" = "" - then - with_regexps=no - fi - if test "$with_run_debug" = "" - then - with_run_debug=no - fi - if test "$with_sax1" = "" - then - with_sax1=no - fi - if test "$with_schemas" = "" - then - with_schemas=no - fi - if test "$with_schematron" = "" - then - with_schematron=no - fi - if test "$with_threads" = "" - then - with_threads=no - fi - if test "$with_thread_alloc" = "" - then - with_thread_alloc=no - fi - if test "$with_tree" = "" - then - with_tree=no - fi - if test "$with_valid" = "" - then - with_valid=no - fi - if test "$with_writer" = "" - then - with_writer=no - fi - if test "$with_xinclude" = "" - then - with_xinclude=no - fi - if test "$with_xpath" = "" - then - with_xpath=no - fi - if test "$with_xptr" = "" - then - with_xptr=no - fi - if test "$with_zlib" = "" - then - with_zlib=no - fi - if test "$with_modules" = "" - then - with_modules=no - fi -fi - -echo Checking zlib - - -WITH_ZLIB=0 -if test "$with_zlib" = "no"; then - echo "Disabling compression support" -else - for ac_header in zlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ZLIB_H 1 -_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzread in -lz" >&5 -$as_echo_n "checking for gzread in -lz... " >&6; } -if ${ac_cv_lib_z_gzread+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gzread (); -int -main () -{ -return gzread (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_gzread=yes -else - ac_cv_lib_z_gzread=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzread" >&5 -$as_echo "$ac_cv_lib_z_gzread" >&6; } -if test "x$ac_cv_lib_z_gzread" = xyes; then : - - -$as_echo "#define HAVE_LIBZ 1" >>confdefs.h - - WITH_ZLIB=1 - if test "x${Z_DIR}" != "x"; then - Z_CFLAGS="-I${Z_DIR}/include" - Z_LIBS="-L${Z_DIR}/lib -lz" - case ${host} in - *-*-solaris*) - Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" - ;; - esac - else - Z_LIBS="-lz" - fi -fi - -fi - -done - -fi - - - - - -echo Checking lzma - - -WITH_LZMA=0 -if test "$with_lzma" = "no"; then - echo "Disabling compression support" -else - for ac_header in lzma.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default" -if test "x$ac_cv_header_lzma_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LZMA_H 1 -_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_code in -llzma" >&5 -$as_echo_n "checking for lzma_code in -llzma... " >&6; } -if ${ac_cv_lib_lzma_lzma_code+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-llzma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char lzma_code (); -int -main () -{ -return lzma_code (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_lzma_lzma_code=yes -else - ac_cv_lib_lzma_lzma_code=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_code" >&5 -$as_echo "$ac_cv_lib_lzma_lzma_code" >&6; } -if test "x$ac_cv_lib_lzma_lzma_code" = xyes; then : - - -$as_echo "#define HAVE_LIBLZMA 1" >>confdefs.h - - WITH_LZMA=1 - if test "x${LZMA_DIR}" != "x"; then - LZMA_CFLAGS="-I${LZMA_DIR}/include" - LZMA_LIBS="-L${LZMA_DIR}/lib -llzma" - else - LZMA_LIBS="-llzma" - fi -fi - -fi - -done - -fi - - - - - -CPPFLAGS=${_cppflags} -LIBS=${_libs} - -echo Checking headers - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -if eval \${$as_ac_Header+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include <$ac_hdr> - -int -main () -{ -if ((DIR *) 0) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_ac_Header=yes" -else - eval "$as_ac_Header=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$as_ac_Header - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -_ACEOF - -ac_header_dirent=$ac_hdr; break -fi - -done -# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' dir; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } -if ${ac_cv_search_opendir+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char opendir (); -int -main () -{ -return opendir (); - ; - return 0; -} -_ACEOF -for ac_lib in '' x; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_opendir=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_opendir+:} false; then : - break -fi -done -if ${ac_cv_search_opendir+:} false; then : - -else - ac_cv_search_opendir=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } -ac_res=$ac_cv_search_opendir -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -for ac_header in fcntl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" -if test "x$ac_cv_header_fcntl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FCNTL_H 1 -_ACEOF - -fi - -done - -for ac_header in unistd.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" -if test "x$ac_cv_header_unistd_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_UNISTD_H 1 -_ACEOF - -fi - -done - -for ac_header in ctype.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "$ac_includes_default" -if test "x$ac_cv_header_ctype_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CTYPE_H 1 -_ACEOF - -fi - -done - -for ac_header in dirent.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "dirent.h" "ac_cv_header_dirent_h" "$ac_includes_default" -if test "x$ac_cv_header_dirent_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DIRENT_H 1 -_ACEOF - -fi - -done - -for ac_header in errno.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" -if test "x$ac_cv_header_errno_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ERRNO_H 1 -_ACEOF - -fi - -done - -for ac_header in malloc.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" -if test "x$ac_cv_header_malloc_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MALLOC_H 1 -_ACEOF - -fi - -done - -for ac_header in stdarg.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "$ac_includes_default" -if test "x$ac_cv_header_stdarg_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDARG_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/stat.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_stat_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_STAT_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/types.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_types_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TYPES_H 1 -_ACEOF - -fi - -done - -for ac_header in stdint.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" -if test "x$ac_cv_header_stdint_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDINT_H 1 -_ACEOF - -fi - -done - -for ac_header in inttypes.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" -if test "x$ac_cv_header_inttypes_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_INTTYPES_H 1 -_ACEOF - -fi - -done - -for ac_header in time.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" -if test "x$ac_cv_header_time_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_TIME_H 1 -_ACEOF - -fi - -done - -for ac_header in ansidecl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ansidecl.h" "ac_cv_header_ansidecl_h" "$ac_includes_default" -if test "x$ac_cv_header_ansidecl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ANSIDECL_H 1 -_ACEOF - -fi - -done - -for ac_header in ieeefp.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ieeefp.h" "ac_cv_header_ieeefp_h" "$ac_includes_default" -if test "x$ac_cv_header_ieeefp_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_IEEEFP_H 1 -_ACEOF - -fi - -done - -for ac_header in nan.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "nan.h" "ac_cv_header_nan_h" "$ac_includes_default" -if test "x$ac_cv_header_nan_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NAN_H 1 -_ACEOF - -fi - -done - -for ac_header in math.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" -if test "x$ac_cv_header_math_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_MATH_H 1 -_ACEOF - -fi - -done - -for ac_header in limits.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" -if test "x$ac_cv_header_limits_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIMITS_H 1 -_ACEOF - -fi - -done - -for ac_header in fp_class.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "fp_class.h" "ac_cv_header_fp_class_h" "$ac_includes_default" -if test "x$ac_cv_header_fp_class_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FP_CLASS_H 1 -_ACEOF - -fi - -done - -for ac_header in float.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" -if test "x$ac_cv_header_float_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_FLOAT_H 1 -_ACEOF - -fi - -done - -for ac_header in stdlib.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" -if test "x$ac_cv_header_stdlib_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDLIB_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/socket.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "#if HAVE_SYS_TYPES_H -# include -# endif - -" -if test "x$ac_cv_header_sys_socket_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SOCKET_H 1 -_ACEOF - -fi - -done - -for ac_header in netinet/in.h -do : - ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "#if HAVE_SYS_TYPES_H -# include -# endif - -" -if test "x$ac_cv_header_netinet_in_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NETINET_IN_H 1 -_ACEOF - -fi - -done - -for ac_header in arpa/inet.h -do : - ac_fn_c_check_header_compile "$LINENO" "arpa/inet.h" "ac_cv_header_arpa_inet_h" "#if HAVE_SYS_TYPES_H -# include -# endif -#if HAVE_ARPA_INET_H -# include -# endif - -" -if test "x$ac_cv_header_arpa_inet_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ARPA_INET_H 1 -_ACEOF - -fi - -done - -for ac_header in netdb.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "netdb.h" "ac_cv_header_netdb_h" "$ac_includes_default" -if test "x$ac_cv_header_netdb_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NETDB_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/time.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_time_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TIME_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/select.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_select_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_SELECT_H 1 -_ACEOF - -fi - -done - -for ac_header in poll.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "poll.h" "ac_cv_header_poll_h" "$ac_includes_default" -if test "x$ac_cv_header_poll_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_POLL_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/mman.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_mman_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_MMAN_H 1 -_ACEOF - -fi - -done - -for ac_header in sys/timeb.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_timeb_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_TIMEB_H 1 -_ACEOF - -fi - -done - -for ac_header in signal.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "signal.h" "ac_cv_header_signal_h" "$ac_includes_default" -if test "x$ac_cv_header_signal_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SIGNAL_H 1 -_ACEOF - -fi - -done - -for ac_header in arpa/nameser.h -do : - ac_fn_c_check_header_compile "$LINENO" "arpa/nameser.h" "ac_cv_header_arpa_nameser_h" "#if HAVE_SYS_TYPES_H -# include -# endif - -" -if test "x$ac_cv_header_arpa_nameser_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_ARPA_NAMESER_H 1 -_ACEOF - -fi - -done - -for ac_header in resolv.h -do : - ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "#if HAVE_SYS_TYPES_H -# include -# endif -#if HAVE_NETINET_IN_H -# include -# endif -#if HAVE_ARPA_NAMESER_H -# include -# endif - -" -if test "x$ac_cv_header_resolv_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_RESOLV_H 1 -_ACEOF - -fi - -done - -for ac_header in dl.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" -if test "x$ac_cv_header_dl_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DL_H 1 -_ACEOF - -fi - -done - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF - -fi - -done - - - -echo Checking types - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT32_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint32_t $ac_cv_c_uint32_t -_ACEOF -;; - esac - - - -echo Checking libraries - -for ac_func in strftime -do : - ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" -if test "x$ac_cv_func_strftime" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STRFTIME 1 -_ACEOF - -else - # strftime is in -lintl on SCO UNIX. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 -$as_echo_n "checking for strftime in -lintl... " >&6; } -if ${ac_cv_lib_intl_strftime+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lintl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char strftime (); -int -main () -{ -return strftime (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_intl_strftime=yes -else - ac_cv_lib_intl_strftime=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 -$as_echo "$ac_cv_lib_intl_strftime" >&6; } -if test "x$ac_cv_lib_intl_strftime" = xyes; then : - $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h - -LIBS="-lintl $LIBS" -fi - -fi -done - -for ac_func in strdup strndup strerror -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in finite isnand fp_class class fpclass -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in strftime localtime gettimeofday ftime -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in stat _stat signal -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in rand rand_r srand time -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in isascii mmap munmap putenv -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5 -$as_echo_n "checking for va_copy... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -va_list ap1,ap2; -int -main () -{ -va_copy(ap1,ap2); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - have_va_copy=yes -else - have_va_copy=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_va_copy" >&5 -$as_echo "$have_va_copy" >&6; } -if test x"$have_va_copy" = x"yes"; then - -$as_echo "#define HAVE_VA_COPY 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __va_copy" >&5 -$as_echo_n "checking for __va_copy... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - va_list ap1,ap2; -int -main () -{ -__va_copy(ap1,ap2); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - have___va_copy=yes -else - have___va_copy=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have___va_copy" >&5 -$as_echo "$have___va_copy" >&6; } - if test x"$have___va_copy" = x"yes"; then - -$as_echo "#define HAVE___VA_COPY 1" >>confdefs.h - - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostent" >&5 -$as_echo_n "checking for library containing gethostent... " >&6; } -if ${ac_cv_search_gethostent+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gethostent (); -int -main () -{ -return gethostent (); - ; - return 0; -} -_ACEOF -for ac_lib in '' nsl; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_gethostent=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_gethostent+:} false; then : - break -fi -done -if ${ac_cv_search_gethostent+:} false; then : - -else - ac_cv_search_gethostent=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostent" >&5 -$as_echo "$ac_cv_search_gethostent" >&6; } -ac_res=$ac_cv_search_gethostent -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5 -$as_echo_n "checking for library containing setsockopt... " >&6; } -if ${ac_cv_search_setsockopt+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char setsockopt (); -int -main () -{ -return setsockopt (); - ; - return 0; -} -_ACEOF -for ac_lib in '' socket net network; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_setsockopt=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_setsockopt+:} false; then : - break -fi -done -if ${ac_cv_search_setsockopt+:} false; then : - -else - ac_cv_search_setsockopt=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setsockopt" >&5 -$as_echo "$ac_cv_search_setsockopt" >&6; } -ac_res=$ac_cv_search_setsockopt -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing connect" >&5 -$as_echo_n "checking for library containing connect... " >&6; } -if ${ac_cv_search_connect+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char connect (); -int -main () -{ -return connect (); - ; - return 0; -} -_ACEOF -for ac_lib in '' inet; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_connect=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_connect+:} false; then : - break -fi -done -if ${ac_cv_search_connect+:} false; then : - -else - ac_cv_search_connect=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_connect" >&5 -$as_echo "$ac_cv_search_connect" >&6; } -ac_res=$ac_cv_search_connect -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type of socket length (socklen_t)" >&5 -$as_echo_n "checking for type of socket length (socklen_t)... " >&6; } -cat > conftest.$ac_ext < -#include -#include -int main(void) { - -(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL) -; return 0; } -EOF -if { (eval echo configure:13619: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then - rm -rf conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: socklen_t *" >&5 -$as_echo "socklen_t *" >&6; } - XML_SOCKLEN_T=socklen_t -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - cat > conftest.$ac_ext < -#include -#include -int main(void) { - -(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL) -; return 0; } -EOF -if { (eval echo configure:13642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then - rm -rf conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: size_t *" >&5 -$as_echo "size_t *" >&6; } - XML_SOCKLEN_T=size_t -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - cat > conftest.$ac_ext < -#include -#include -int main(void) { - -(void)getsockopt (1, 1, 1, NULL, (int *)NULL) -; return 0; } -EOF -if { (eval echo configure:13665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then - rm -rf conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: int *" >&5 -$as_echo "int *" >&6; } - XML_SOCKLEN_T=int -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not determine" >&5 -$as_echo "$as_me: WARNING: could not determine" >&2;} - XML_SOCKLEN_T="int" -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - -cat >>confdefs.h <<_ACEOF -#define XML_SOCKLEN_T $XML_SOCKLEN_T -_ACEOF - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable IPv6" >&5 -$as_echo_n "checking whether to enable IPv6... " >&6; } -# Check whether --enable-ipv6 was given. -if test "${enable_ipv6+set}" = set; then : - enableval=$enable_ipv6; -else - enable_ipv6=yes -fi - -if test "$with_minimum" = "yes" -then - enable_ipv6=no -fi -if test $enable_ipv6 = yes; then - have_ipv6=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include -# include - -int -main () -{ - - struct sockaddr_storage ss; - socket(AF_INET6, SOCK_STREAM, 0) - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_ipv6=yes -else - have_ipv6=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ipv6" >&5 -$as_echo "$have_ipv6" >&6; } - - if test $have_ipv6 = yes; then - -$as_echo "#define SUPPORT_IP6 /**/" >>confdefs.h - - have_broken_ss_family=no - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking struct sockaddr::ss_family" >&5 -$as_echo_n "checking struct sockaddr::ss_family... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include -# include - -int -main () -{ - - struct sockaddr_storage ss ; - ss.ss_family = 0 ; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_ss_family=yes -else - have_ss_family=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ss_family" >&5 -$as_echo "$have_ss_family" >&6; } - if test x$have_ss_family = xno ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking broken struct sockaddr::ss_family" >&5 -$as_echo_n "checking broken struct sockaddr::ss_family... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -# include -# include - -int -main () -{ - - struct sockaddr_storage ss ; - ss.__ss_family = 0 ; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_broken_ss_family=yes -else - have_broken_ss_family=no - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_broken_ss_family" >&5 -$as_echo "$have_broken_ss_family" >&6; } - if test x$have_broken_ss_family = xyes ; then - -$as_echo "#define HAVE_BROKEN_SS_FAMILY /**/" >>confdefs.h - - -$as_echo "#define ss_family __ss_family" >>confdefs.h - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ss_family and __ss_family not found" >&5 -$as_echo "$as_me: WARNING: ss_family and __ss_family not found" >&2;} - fi - fi - - have_getaddrinfo=no - ac_fn_c_check_func "$LINENO" "getaddrinfo" "ac_cv_func_getaddrinfo" -if test "x$ac_cv_func_getaddrinfo" = xyes; then : - have_getaddrinfo=yes -fi - - if test $have_getaddrinfo != yes; then - for lib in bsd socket inet; do - as_ac_Lib=`$as_echo "ac_cv_lib_$lib''_getaddrinfo" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -l$lib" >&5 -$as_echo_n "checking for getaddrinfo in -l$lib... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l$lib $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char getaddrinfo (); -int -main () -{ -return getaddrinfo (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break -fi - - done - fi - - if test $have_getaddrinfo = yes; then - -$as_echo "#define HAVE_GETADDRINFO /**/" >>confdefs.h - - fi - fi -fi - - -ac_fn_c_check_func "$LINENO" "isnan" "ac_cv_func_isnan" -if test "x$ac_cv_func_isnan" = xyes; then : - -$as_echo "#define HAVE_ISNAN /**/" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isnan in -lm" >&5 -$as_echo_n "checking for isnan in -lm... " >&6; } -if ${ac_cv_lib_m_isnan+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char isnan (); -int -main () -{ -return isnan (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_isnan=yes -else - ac_cv_lib_m_isnan=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isnan" >&5 -$as_echo "$ac_cv_lib_m_isnan" >&6; } -if test "x$ac_cv_lib_m_isnan" = xyes; then : - -$as_echo "#define HAVE_ISNAN /**/" >>confdefs.h - -fi - -fi - - -ac_fn_c_check_func "$LINENO" "isinf" "ac_cv_func_isinf" -if test "x$ac_cv_func_isinf" = xyes; then : - -$as_echo "#define HAVE_ISINF /**/" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf in -lm" >&5 -$as_echo_n "checking for isinf in -lm... " >&6; } -if ${ac_cv_lib_m_isinf+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lm $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char isinf (); -int -main () -{ -return isinf (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_m_isinf=yes -else - ac_cv_lib_m_isinf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_isinf" >&5 -$as_echo "$ac_cv_lib_m_isinf" >&6; } -if test "x$ac_cv_lib_m_isinf" = xyes; then : - -$as_echo "#define HAVE_ISINF /**/" >>confdefs.h - -fi - -fi - - -XML_LIBDIR='-L${libdir}' -XML_INCLUDEDIR='-I${includedir}/libxml2' - -XML_CFLAGS="" -RDL_LIBS="" - -if test "${GCC}" != "yes" ; then - case "${host}" in - hppa*-*-hpux* ) - CFLAGS="${CFLAGS} -Wp,-H30000" - ;; - *-dec-osf* ) - CFLAGS="${CFLAGS} -ieee" - ;; - alpha*-*-linux* ) - CFLAGS="${CFLAGS} -ieee" - ;; - esac -else - if test "$with_fexceptions" = "yes" - then - # - # Not activated by default because this inflates the code size - # Used to allow propagation of C++ exceptions through the library - # - CFLAGS="${CFLAGS} -fexceptions" - fi - - # warnings we'd like to see - CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls" - # warnings we'd like to supress - CFLAGS="${CFLAGS} -Wno-long-long" - case "${host}" in - alpha*-*-linux* ) - CFLAGS="${CFLAGS} -mieee" - ;; - alpha*-*-osf* ) - CFLAGS="${CFLAGS} -mieee" - ;; - esac -fi -case ${host} in - *-*-solaris*) - XML_LIBDIR="${XML_LIBDIR} -R${libdir}" - ;; - hppa*-hp-mpeix) - NEED_TRIO=1 - ;; - *-*-mingw* | *-*-cygwin* | *-*-msvc* ) - # If the host is Windows, and shared libraries are disabled, we - # need to add -DLIBXML_STATIC to CFLAGS in order for linking to - # work properly (without it, xmlexports.h would force the use of - # DLL imports, which obviously aren't present in a static - # library). - if test "x$enable_shared" = "xno"; then - XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC" - CFLAGS="$CFLAGS -DLIBXML_STATIC" - fi - ;; -esac - - - -PYTHON_VERSION= -PYTHON_INCLUDES= -PYTHON_SITE_PACKAGES= -PYTHON_TESTS= -pythondir= -if test "$with_python" != "no" ; then - if test -x "$with_python/bin/python" - then - echo Found python in $with_python/bin/python - PYTHON="$with_python/bin/python" - else - if test -x "$with_python/python.exe" - then - echo Found python in $with_python/python.exe - PYTHON="$with_python/python.exe" - else - if test -x "$with_python" - then - echo Found python in $with_python - PYTHON="$with_python" - else - if test -x "$PYTHON" - then - echo Found python in environment PYTHON=$PYTHON - with_python=`$PYTHON -c "import sys; print sys.exec_prefix"` - else - # Extract the first word of "python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5", so it can be a program name with args. -set dummy python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PYTHON+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PYTHON in - [\\/]* | ?:[\\/]*) - ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -PYTHON=$ac_cv_path_PYTHON -if test -n "$PYTHON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -$as_echo "$PYTHON" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi - fi - fi - fi - if test "$PYTHON" != "" - then - PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[0:3]"` - echo Found Python version $PYTHON_VERSION - fi - if test "$PYTHON_VERSION" != "" - then - if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ - -d $with_python/lib/python$PYTHON_VERSION/site-packages - then - PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION - PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages - else - if test -r $prefix/include/python$PYTHON_VERSION/Python.h - then - PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION - PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages - else - if test -r /usr/include/python$PYTHON_VERSION/Python.h - then - PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION - PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages - else - if test -r $with_python/include/Python.h -a \ - -d $with_python/lib/site-packages - then - PYTHON_INCLUDES=$with_python/include - PYTHON_SITE_PACKAGES=$with_python/lib/site-packages - else - echo could not find python$PYTHON_VERSION/Python.h or $with_python/include/Python.h - fi - fi - fi - if test ! -d "$PYTHON_SITE_PACKAGES" - then - PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` - fi - fi - PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags` - fi - if test "$with_python" != "" - then - pythondir='$(PYTHON_SITE_PACKAGES)' - else - pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages' - fi -else - PYTHON= -fi - if test "$PYTHON_INCLUDES" != ""; then - WITH_PYTHON_TRUE= - WITH_PYTHON_FALSE='#' -else - WITH_PYTHON_TRUE='#' - WITH_PYTHON_FALSE= -fi - -if test "$PYTHON_INCLUDES" != "" -then - PYTHON_SUBDIR=python -else - PYTHON_SUBDIR= -fi - - - - -WITH_MODULES=0 -TEST_MODULES= - -if test "$with_modules" != "no" ; then - case "$host" in - *-*-cygwin*) - MODULE_EXTENSION=".dll" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lcygwin" >&5 -$as_echo_n "checking for dlopen in -lcygwin... " >&6; } -if ${ac_cv_lib_cygwin_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcygwin $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_cygwin_dlopen=yes -else - ac_cv_lib_cygwin_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cygwin_dlopen" >&5 -$as_echo "$ac_cv_lib_cygwin_dlopen" >&6; } -if test "x$ac_cv_lib_cygwin_dlopen" = xyes; then : - - WITH_MODULES=1 - MODULE_PLATFORM_LIBS= - -$as_echo "#define HAVE_DLOPEN /**/" >>confdefs.h - - -fi - - ;; - *-*-mingw*) - MODULE_EXTENSION=".dll" - WITH_MODULES=1 - ;; - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : - libxml_have_shl_load=yes -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldld $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : - - MODULE_PLATFORM_LIBS="-ldld" - libxml_have_shl_load=yes -else - - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : - libxml_have_dlopen=yes -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : - - MODULE_PLATFORM_LIBS="-ldl" - libxml_have_dlopen=yes -fi - -fi - -fi - -fi - - - if test "${libxml_have_shl_load}" = "yes"; then - MODULE_EXTENSION=".sl" - WITH_MODULES=1 - -$as_echo "#define HAVE_SHLLOAD /**/" >>confdefs.h - - fi - - if test "${libxml_have_dlopen}" = "yes"; then - case "${host}" in - *-*-hpux* ) - MODULE_EXTENSION=".sl" - ;; - * ) - MODULE_EXTENSION=".so" - ;; - esac - - WITH_MODULES=1 - -$as_echo "#define HAVE_DLOPEN /**/" >>confdefs.h - - fi - ;; - esac -fi - -if test "${WITH_MODULES}" = "1"; then - TEST_MODULES="ModuleTests" -fi - - - - - - - -if [ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ] || \ - [ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ] || \ - [ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ] - then - if test "$with_minimum" != "yes" - then - if test "${with_mem_debug}" = "" ; then - echo Activating memory debugging - with_mem_debug="yes" - with_run_debug="yes" - fi - if test "${with_docbook}" = "" ; then - with_docbook="yes" - fi - fi - if test "${GCC}" = "yes" ; then - CFLAGS="-g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall" - fi - STATIC_BINARIES="-static" -else - STATIC_BINARIES= -fi - - - -if test "${NEED_TRIO}" = "1" ; then - echo Adding trio library for string functions - WITH_TRIO=1 -else - WITH_TRIO=0 -fi - if test "${NEED_TRIO}" = "1"; then - WITH_TRIO_SOURCES_TRUE= - WITH_TRIO_SOURCES_FALSE='#' -else - WITH_TRIO_SOURCES_TRUE='#' - WITH_TRIO_SOURCES_FALSE= -fi - - - -echo Checking configuration requirements - -THREAD_LIBS="" -BASE_THREAD_LIBS="" -WITH_THREADS=0 -THREAD_CFLAGS="" -TEST_THREADS="" -THREADS_W32="" - -if test "$with_threads" = "no" ; then - echo Disabling multithreaded support -else - echo Enabling multithreaded support - - case $host_os in - *mingw32*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then - WITH_THREADS="1" - THREADS_W32="1" - THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" - fi - ;; - esac - - if test -z "$THREADS_W32"; then - if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lpthread" >&5 -$as_echo_n "checking for pthread_join in -lpthread... " >&6; } -if ${ac_cv_lib_pthread_pthread_join+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char pthread_join (); -int -main () -{ -return pthread_join (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pthread_pthread_join=yes -else - ac_cv_lib_pthread_pthread_join=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_join" >&5 -$as_echo "$ac_cv_lib_pthread_pthread_join" >&6; } -if test "x$ac_cv_lib_pthread_pthread_join" = xyes; then : - - THREAD_LIBS="-lpthread" - -$as_echo "#define HAVE_LIBPTHREAD /**/" >>confdefs.h - - -$as_echo "#define HAVE_PTHREAD_H /**/" >>confdefs.h - - WITH_THREADS="1" -fi - -fi - - - fi - fi - - case $host_os in - *cygwin*) THREAD_LIBS="" - ;; - *beos*) WITH_THREADS="1" - THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS" - ;; - *linux*) - if test "${GCC}" = "yes" ; then - GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'` - GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'` - GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[0-9]*\.++' | sed 's+\..*++'` - if test "${THREAD_LIBS}" = "-lpthread" ; then - if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null - then - THREAD_LIBS="" - BASE_THREAD_LIBS="-lpthread" - else - if expr ${GCC_MAJOR} \> 3 > /dev/null - then - THREAD_LIBS="" - BASE_THREAD_LIBS="-lpthread" - else - echo old GCC disabling weak symbols for pthread - fi - fi - fi - fi - ;; - esac - if test "$WITH_THREADS" = "1" ; then - THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" - TEST_THREADS="Threadtests" - fi -fi -if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then - THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED" -fi - - - - - - - if test -n "$THREADS_W32"; then - THREADS_W32_TRUE= - THREADS_W32_FALSE='#' -else - THREADS_W32_TRUE='#' - THREADS_W32_FALSE= -fi - - -if test "$with_history" = "yes" ; then - echo Enabling xmllint shell history - unset tcap - for termlib in ncurses curses termcap terminfo termlib; do - as_ac_Lib=`$as_echo "ac_cv_lib_${termlib}''_tputs" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for tputs in -l${termlib}" >&5 -$as_echo_n "checking for tputs in -l${termlib}... " >&6; } -if eval \${$as_ac_Lib+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-l${termlib} $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char tputs (); -int -main () -{ -return tputs (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$as_ac_Lib=yes" -else - eval "$as_ac_Lib=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -eval ac_res=\$$as_ac_Lib - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - tcap="-l$termlib" -fi - - test -n "$tcap" && break - done - - ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_history_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for append_history in -lhistory" >&5 -$as_echo_n "checking for append_history in -lhistory... " >&6; } -if ${ac_cv_lib_history_append_history+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhistory $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char append_history (); -int -main () -{ -return append_history (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_history_append_history=yes -else - ac_cv_lib_history_append_history=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_history_append_history" >&5 -$as_echo "$ac_cv_lib_history_append_history" >&6; } -if test "x$ac_cv_lib_history_append_history" = xyes; then : - - RDL_LIBS="-lhistory" - -$as_echo "#define HAVE_LIBHISTORY /**/" >>confdefs.h - -fi - -fi - - - ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_readline_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline in -lreadline" >&5 -$as_echo_n "checking for readline in -lreadline... " >&6; } -if ${ac_cv_lib_readline_readline+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lreadline $tcap $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char readline (); -int -main () -{ -return readline (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_readline_readline=yes -else - ac_cv_lib_readline_readline=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_readline" >&5 -$as_echo "$ac_cv_lib_readline_readline" >&6; } -if test "x$ac_cv_lib_readline_readline" = xyes; then : - - RDL_LIBS="-lreadline $RDL_LIBS $tcap" - -$as_echo "#define HAVE_LIBREADLINE /**/" >>confdefs.h - -fi - -fi - - - if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then - CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" - RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" - fi -fi - -if test "$with_tree" = "no" ; then - echo Disabling DOM like tree manipulation APIs - WITH_TREE=0 -else - WITH_TREE=1 -fi - - -if test "$with_ftp" = "no" ; then - echo Disabling FTP support - WITH_FTP=0 - FTP_OBJ= -else - WITH_FTP=1 - FTP_OBJ=nanoftp.o -fi - - - -if test "$with_http" = "no" ; then - echo Disabling HTTP support - WITH_HTTP=0 - HTTP_OBJ= -else - WITH_HTTP=1 - HTTP_OBJ=nanohttp.o -fi - - - -if test "$with_legacy" = "no" ; then - echo Disabling deprecated APIs - WITH_LEGACY=0 -else - WITH_LEGACY=1 -fi - - -if test "$with_reader" = "no" ; then - echo Disabling the xmlReader parsing interface - WITH_READER=0 - READER_TEST= -else - WITH_READER=1 - READER_TEST=Readertests - if test "$with_push" = "no" ; then - echo xmlReader requires Push interface - enabling it - with_push=yes - fi -fi - - - -if test "$with_writer" = "no" ; then - echo Disabling the xmlWriter saving interface - WITH_WRITER=0 -# WRITER_TEST= -else - WITH_WRITER=1 -# WRITER_TEST=Writertests - if test "$with_push" = "no" ; then - echo xmlWriter requires Push interface - enabling it - with_push=yes - fi - if test "$with_output" = "no" ; then - echo xmlWriter requires Output interface - enabling it - with_output=yes - fi -fi - -#AC_SUBST(WRITER_TEST) - -if test "$with_pattern" = "no" ; then - echo Disabling the xmlPattern parsing interface - WITH_PATTERN=0 - TEST_PATTERN= -else - WITH_PATTERN=1 - TEST_PATTERN=Patterntests -fi - - - -if test "$with_sax1" = "no" ; then - echo Disabling the older SAX1 interface - WITH_SAX1=0 - TEST_SAX= -else - WITH_SAX1=1 - TEST_SAX=SAXtests -fi - - if test "${WITH_TRIO}" = "1"; then - WITH_SAX1_SOURCES_TRUE= - WITH_SAX1_SOURCES_FALSE='#' -else - WITH_SAX1_SOURCES_TRUE='#' - WITH_SAX1_SOURCES_FALSE= -fi - - - -if test "$with_push" = "no" ; then - echo Disabling the PUSH parser interfaces - WITH_PUSH=0 - TEST_PUSH= -else - WITH_PUSH=1 - TEST_PUSH="XMLPushtests" -fi - - - -if test "$with_html" = "no" ; then - echo Disabling HTML support - WITH_HTML=0 - HTML_OBJ= - TEST_HTML= -else - WITH_HTML=1 - HTML_OBJ="HTMLparser.o HTMLtree.o" - TEST_HTML=HTMLtests - if test "$with_push" != "no" ; then - TEST_PHTML=HTMLPushtests - else - TEST_PHTML= - fi -fi - - - - - -if test "$with_valid" = "no" ; then - echo Disabling DTD validation support - WITH_VALID=0 - TEST_VALID= - TEST_VTIME= -else - WITH_VALID=1 - TEST_VALID=Validtests - TEST_VTIME=VTimingtests -fi - - - - -if test "$with_catalog" = "no" ; then - echo Disabling Catalog support - WITH_CATALOG=0 - CATALOG_OBJ= - TEST_CATALOG= -else - WITH_CATALOG=1 - CATALOG_OBJ="catalog.o" - TEST_CATALOG=Catatests -fi - - - - -if test "$with_docbook" = "no" ; then - echo Disabling Docbook support - WITH_DOCB=0 - DOCB_OBJ= -else - WITH_DOCB=1 - DOCB_OBJ="DOCBparser.o" -fi - - - - -if test "$with_xptr" = "no" ; then - echo Disabling XPointer support - WITH_XPTR=0 - XPTR_OBJ= - TEST_XPTR= -else - WITH_XPTR=1 - XPTR_OBJ=xpointer.o - TEST_XPTR=XPtrtests - if test "$with_xpath" = "no" ; then - echo XPointer requires XPath support - enabling it - with_xpath=yes - fi -fi - - - - -if test "$with_c14n" = "no" ; then - echo Disabling C14N support - WITH_C14N=0 - C14N_OBJ= - TEST_C14N= -else - WITH_C14N=1 - C14N_OBJ="c14n.c" - TEST_C14N=C14Ntests - if test "$with_xpath" = "no" ; then - echo C14N requires XPath support - enabling it - with_xpath=yes - fi -fi - - - - -if test "$with_xinclude" = "no" ; then - echo Disabling XInclude support - WITH_XINCLUDE=0 - XINCLUDE_OBJ= - with_xinclude="no" - TEST_XINCLUDE= -else - WITH_XINCLUDE=1 - XINCLUDE_OBJ=xinclude.o - TEST_XINCLUDE=XIncludetests - if test "$with_xpath" = "no" ; then - echo XInclude requires XPath support - enabling it - with_xpath=yes - fi -fi - - - - -if test "$with_xpath" = "no" ; then - echo Disabling XPATH support - WITH_XPATH=0 - XPATH_OBJ= - TEST_XPATH= -else - WITH_XPATH=1 - XPATH_OBJ=xpath.o - TEST_XPATH=XPathtests -fi - - - - -if test "$with_output" = "no" ; then - echo Disabling serialization/saving support - WITH_OUTPUT=0 -else - WITH_OUTPUT=1 -fi - - -WITH_ICONV=0 -if test "$with_iconv" = "no" ; then - echo Disabling ICONV support -else - if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then - CPPFLAGS="${CPPFLAGS} -I$with_iconv/include" - # Export this since our headers include iconv.h - XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include" - ICONV_LIBS="-L$with_iconv/lib" - fi - - ac_fn_c_check_header_mongrel "$LINENO" "iconv.h" "ac_cv_header_iconv_h" "$ac_includes_default" -if test "x$ac_cv_header_iconv_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 -$as_echo_n "checking for iconv... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ - -iconv_t cd = iconv_open ("",""); -iconv (cd, NULL, NULL, NULL, NULL); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - WITH_ICONV=1 -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5 -$as_echo_n "checking for iconv in -liconv... " >&6; } - - _ldflags="${LDFLAGS}" - _libs="${LIBS}" - LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" - LIBS="${LIBS} -liconv" - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -int -main () -{ - -iconv_t cd = iconv_open ("",""); -iconv (cd, NULL, NULL, NULL, NULL); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - WITH_ICONV=1 - ICONV_LIBS="${ICONV_LIBS} -liconv" - LIBS="${_libs}" - LDFLAGS="${_ldflags}" -else - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - LIBS="${_libs}" - LDFLAGS="${_ldflags}" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi - - - - if test "$WITH_ICONV" = "1" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 -$as_echo_n "checking for iconv declaration... " >&6; } - if ${xml_cv_iconv_arg2+:} false; then : - $as_echo_n "(cached) " >&6 -else - - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - xml_cv_iconv_arg2="" -else - xml_cv_iconv_arg2="const" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - - - xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${xml_xxx:- - }$xml_cv_iconv_decl" >&5 -$as_echo "${xml_xxx:- - }$xml_cv_iconv_decl" >&6; } - -cat >>confdefs.h <<_ACEOF -#define ICONV_CONST $xml_cv_iconv_arg2 -_ACEOF - - fi -fi -case "$host" in - *mingw*) M_LIBS="" - ;; - *beos*) M_LIBS="" - ;; - *haiku*) M_LIBS="" - ;; - *) M_LIBS="-lm" - ;; -esac -XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS" -XML_LIBTOOLLIBS="libxml2.la" - - -WITH_ICU=0 -ICU_LIBS="" -if test "$with_icu" != "yes" ; then - echo Disabling ICU support -else - ICU_CONFIG=icu-config - if ${ICU_CONFIG} --cflags >/dev/null 2>&1 - then - ICU_LIBS=`${ICU_CONFIG} --ldflags` - WITH_ICU=1 - echo Enabling ICU support - else - as_fn_error $? "libicu config program icu-config not found" "$LINENO" 5 - fi -fi - - - -WITH_ISO8859X=1 -if test "$WITH_ICONV" != "1" ; then -if test "$with_iso8859x" = "no" ; then - echo Disabling ISO8859X support - WITH_ISO8859X=0 -fi -fi - - -if test "$with_schematron" = "no" ; then - echo "Disabling Schematron support" - WITH_SCHEMATRON=0 - TEST_SCHEMATRON= -else - echo "Enabled Schematron support" - WITH_SCHEMATRON=1 - TEST_SCHEMATRON="Schematrontests" - with_xpath=yes - with_pattern=yes -fi - - - -if test "$with_schemas" = "no" ; then - echo "Disabling Schemas/Relax-NG support" - WITH_SCHEMAS=0 - TEST_SCHEMAS= -else - echo "Enabled Schemas/Relax-NG support" - WITH_SCHEMAS=1 - TEST_SCHEMAS="Schemastests Relaxtests" - if test "$PYTHON_INCLUDES" != "" ; then - PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests" - fi - with_regexps=yes -fi - - - -if test "$with_regexps" = "no" ; then - echo Disabling Regexps support - WITH_REGEXPS=0 - TEST_REGEXPS= -else - WITH_REGEXPS=1 - TEST_REGEXPS="Regexptests Automatatests" -fi - - - -if test "$with_debug" = "no" ; then - echo Disabling DEBUG support - WITH_DEBUG=0 - DEBUG_OBJ= - TEST_DEBUG= -else - WITH_DEBUG=1 - DEBUG_OBJ=debugXML.o - TEST_DEBUG=Scripttests -fi - - - - -if test "$with_mem_debug" = "yes" ; then - if test "$with_thread_alloc" = "yes" ; then - echo Disabling memory debug - cannot use mem-debug with thread-alloc! - WITH_MEM_DEBUG=0 - else - echo Enabling memory debug support - WITH_MEM_DEBUG=1 - fi -else - WITH_MEM_DEBUG=0 -fi - - -if test "$with_run_debug" = "yes" ; then - echo Enabling runtime debug support - WITH_RUN_DEBUG=1 -else - WITH_RUN_DEBUG=0 -fi - - -WIN32_EXTRA_LIBADD= -WIN32_EXTRA_LDFLAGS= -CYGWIN_EXTRA_LDFLAGS= -CYGWIN_EXTRA_PYTHON_LIBADD= -WIN32_EXTRA_PYTHON_LIBADD= -case "$host" in - *-*-mingw*) - CPPFLAGS="$CPPFLAGS -DWIN32" - WIN32_EXTRA_LIBADD="-lws2_32" - WIN32_EXTRA_LDFLAGS="-no-undefined" - -$as_echo "#define _WINSOCKAPI_ 1" >>confdefs.h - - if test "${PYTHON}" != "" - then - WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)" - fi - ;; - *-*-cygwin*) - CYGWIN_EXTRA_LDFLAGS="-no-undefined" - if test "${PYTHON}" != "" - then - CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}" - fi - ;; -esac - - - - - - -for ac_func in printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -else - NEED_TRIO=1 -fi -done - - -if test "$with_coverage" = "yes" -a "${GCC}" = "yes" -then - echo Enabling code coverage for GCC - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" - LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage" -else - echo Disabling code coverage for GCC -fi - - - - - - - - - - - - - - - - - - - - - - -RELDATE=`date +'%a %b %e %Y'` - - - -rm -f COPYING.LIB COPYING -ln -s $srcdir/Copyright COPYING - -# keep on one line for cygwin c.f. #130896 -ac_config_files="$ac_config_files libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${USE_VERSION_SCRIPT_TRUE}" && test -z "${USE_VERSION_SCRIPT_FALSE}"; then - as_fn_error $? "conditional \"USE_VERSION_SCRIPT\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${REBUILD_DOCS_TRUE}" && test -z "${REBUILD_DOCS_FALSE}"; then - as_fn_error $? "conditional \"REBUILD_DOCS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_PYTHON_TRUE}" && test -z "${WITH_PYTHON_FALSE}"; then - as_fn_error $? "conditional \"WITH_PYTHON\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_TRIO_SOURCES_TRUE}" && test -z "${WITH_TRIO_SOURCES_FALSE}"; then - as_fn_error $? "conditional \"WITH_TRIO_SOURCES\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${THREADS_W32_TRUE}" && test -z "${THREADS_W32_FALSE}"; then - as_fn_error $? "conditional \"THREADS_W32\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${WITH_SAX1_SOURCES_TRUE}" && test -z "${WITH_SAX1_SOURCES_FALSE}"; then - as_fn_error $? "conditional \"WITH_SAX1_SOURCES\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: "${CONFIG_STATUS=./config.status}" -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to the package provider." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -config.status -configured by $0, generated by GNU Autoconf 2.68, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=?*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' -lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' -want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' -DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' -sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' -lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL \ -ECHO \ -PATH_SEPARATOR \ -SED \ -GREP \ -EGREP \ -FGREP \ -LD \ -NM \ -LN_S \ -lt_SP2NL \ -lt_NL2SP \ -reload_flag \ -OBJDUMP \ -deplibs_check_method \ -file_magic_cmd \ -file_magic_glob \ -want_nocaseglob \ -DLLTOOL \ -sharedlib_from_linklib_cmd \ -AR \ -AR_FLAGS \ -archiver_list_spec \ -STRIP \ -RANLIB \ -CC \ -CFLAGS \ -compiler \ -lt_cv_sys_global_symbol_pipe \ -lt_cv_sys_global_symbol_to_cdecl \ -lt_cv_sys_global_symbol_to_c_name_address \ -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ -nm_file_list_spec \ -lt_prog_compiler_no_builtin_flag \ -lt_prog_compiler_pic \ -lt_prog_compiler_wl \ -lt_prog_compiler_static \ -lt_cv_prog_compiler_c_o \ -need_locks \ -MANIFEST_TOOL \ -DSYMUTIL \ -NMEDIT \ -LIPO \ -OTOOL \ -OTOOL64 \ -shrext_cmds \ -export_dynamic_flag_spec \ -whole_archive_flag_spec \ -compiler_needs_object \ -with_gnu_ld \ -allow_undefined_flag \ -no_undefined_flag \ -hardcode_libdir_flag_spec \ -hardcode_libdir_separator \ -exclude_expsyms \ -include_expsyms \ -file_list_spec \ -variables_saved_for_relink \ -libname_spec \ -library_names_spec \ -soname_spec \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postlink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile' - - - - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "libxml2.spec") CONFIG_FILES="$CONFIG_FILES libxml2.spec:libxml.spec.in" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; - "include/libxml/Makefile") CONFIG_FILES="$CONFIG_FILES include/libxml/Makefile" ;; - "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "doc/examples/Makefile") CONFIG_FILES="$CONFIG_FILES doc/examples/Makefile" ;; - "doc/devhelp/Makefile") CONFIG_FILES="$CONFIG_FILES doc/devhelp/Makefile" ;; - "example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;; - "python/Makefile") CONFIG_FILES="$CONFIG_FILES python/Makefile" ;; - "python/tests/Makefile") CONFIG_FILES="$CONFIG_FILES python/tests/Makefile" ;; - "xstc/Makefile") CONFIG_FILES="$CONFIG_FILES xstc/Makefile" ;; - "include/libxml/xmlversion.h") CONFIG_FILES="$CONFIG_FILES include/libxml/xmlversion.h" ;; - "xml2-config") CONFIG_FILES="$CONFIG_FILES xml2-config" ;; - "libxml-2.0.pc") CONFIG_FILES="$CONFIG_FILES libxml-2.0.pc" ;; - "libxml-2.0-uninstalled.pc") CONFIG_FILES="$CONFIG_FILES libxml-2.0-uninstalled.pc" ;; - "python/setup.py") CONFIG_FILES="$CONFIG_FILES python/setup.py" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= ac_tmp= - trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$ac_tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$ac_tmp/stdin" - case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool 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. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - - -# The names of the tagged configurations supported by this script. -available_tags="" - -# ### BEGIN LIBTOOL CONFIG - -# Which release of libtool.m4 was used? -macro_version=$macro_version -macro_revision=$macro_revision - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# What type of objects to build. -pic_mode=$pic_mode - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# The PATH separator for the build system. -PATH_SEPARATOR=$lt_PATH_SEPARATOR - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="\$SED -e 1s/^X//" - -# A grep program that handles long lines. -GREP=$lt_GREP - -# An ERE matcher. -EGREP=$lt_EGREP - -# A literal string matcher. -FGREP=$lt_FGREP - -# A BSD- or MS-compatible name lister. -NM=$lt_NM - -# Whether we need soft or hard links. -LN_S=$lt_LN_S - -# What is the maximum length of a command? -max_cmd_len=$max_cmd_len - -# Object file suffix (normally "o"). -objext=$ac_objext - -# Executable file suffix (normally ""). -exeext=$exeext - -# whether the shell understands "unset". -lt_unset=$lt_unset - -# turn spaces into newlines. -SP2NL=$lt_lt_SP2NL - -# turn newlines into spaces. -NL2SP=$lt_lt_NL2SP - -# convert \$build file names to \$host format. -to_host_file_cmd=$lt_cv_to_host_file_cmd - -# convert \$build files to toolchain format. -to_tool_file_cmd=$lt_cv_to_tool_file_cmd - -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method = "file_magic". -file_magic_cmd=$lt_file_magic_cmd - -# How to find potential files when deplibs_check_method = "file_magic". -file_magic_glob=$lt_file_magic_glob - -# Find potential files using nocaseglob when deplibs_check_method = "file_magic". -want_nocaseglob=$lt_want_nocaseglob - -# DLL creation program. -DLLTOOL=$lt_DLLTOOL - -# Command to associate shared and link libraries. -sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd - -# The archiver. -AR=$lt_AR - -# Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS - -# How to feed a file listing to the archiver. -archiver_list_spec=$lt_archiver_list_spec - -# A symbol stripping program. -STRIP=$lt_STRIP - -# Commands used to install an old-style archive. -RANLIB=$lt_RANLIB -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# Specify filename containing input files for \$NM. -nm_file_list_spec=$lt_nm_file_list_spec - -# The root where to search for dependent libraries,and in which our libraries should be installed. -lt_sysroot=$lt_sysroot - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Manifest tool. -MANIFEST_TOOL=$lt_MANIFEST_TOOL - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object=$lt_compiler_needs_object - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds - -# Whether we are building with GNU ld or not. -with_gnu_ld=$lt_with_gnu_ld - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag - -# Flag that enforces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=$hardcode_direct - -# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes -# DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \${shlibpath_var} if the -# library is relocated. -hardcode_direct_absolute=$hardcode_direct_absolute - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=$hardcode_minus_L - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var - -# Set to "yes" if building a shared library automatically hardcodes DIR -# into the library and all subsequent libraries and executables linked -# against it. -hardcode_automatic=$hardcode_automatic - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=$inherit_rpath - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs - -# Set to "yes" if exported symbols are required. -always_export_symbols=$always_export_symbols - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds=$lt_prelink_cmds - -# Commands necessary for finishing linking programs. -postlink_cmds=$lt_postlink_cmds - -# Specify filename containing input files. -file_list_spec=$lt_file_list_spec - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action - -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - -ltmain="$ac_aux_dir/ltmain.sh" - - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ - || (rm -f "$cfgfile"; exit 1) - - if test x"$xsi_shell" = xyes; then - sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ -func_dirname ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_basename ()$/,/^} # func_basename /c\ -func_basename ()\ -{\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ -func_dirname_and_basename ()\ -{\ -\ case ${1} in\ -\ */*) func_dirname_result="${1%/*}${2}" ;;\ -\ * ) func_dirname_result="${3}" ;;\ -\ esac\ -\ func_basename_result="${1##*/}"\ -} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ -func_stripname ()\ -{\ -\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ -\ # positional parameters, so assign one to ordinary parameter first.\ -\ func_stripname_result=${3}\ -\ func_stripname_result=${func_stripname_result#"${1}"}\ -\ func_stripname_result=${func_stripname_result%"${2}"}\ -} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ -func_split_long_opt ()\ -{\ -\ func_split_long_opt_name=${1%%=*}\ -\ func_split_long_opt_arg=${1#*=}\ -} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ -func_split_short_opt ()\ -{\ -\ func_split_short_opt_arg=${1#??}\ -\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ -} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ -func_lo2o ()\ -{\ -\ case ${1} in\ -\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ -\ *) func_lo2o_result=${1} ;;\ -\ esac\ -} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_xform ()$/,/^} # func_xform /c\ -func_xform ()\ -{\ - func_xform_result=${1%.*}.lo\ -} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_arith ()$/,/^} # func_arith /c\ -func_arith ()\ -{\ - func_arith_result=$(( $* ))\ -} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_len ()$/,/^} # func_len /c\ -func_len ()\ -{\ - func_len_result=${#1}\ -} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - -fi - -if test x"$lt_shell_append" = xyes; then - sed -e '/^func_append ()$/,/^} # func_append /c\ -func_append ()\ -{\ - eval "${1}+=\\${2}"\ -} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ -func_append_quoted ()\ -{\ -\ func_quote_for_eval "${2}"\ -\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ -} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") -test 0 -eq $? || _lt_function_replace_fail=: - - - # Save a `func_append' function call where possible by direct use of '+=' - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -else - # Save a `func_append' function call even when '+=' is not available - sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ - && mv -f "$cfgfile.tmp" "$cfgfile" \ - || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") - test 0 -eq $? || _lt_function_replace_fail=: -fi - -if test x"$_lt_function_replace_fail" = x":"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 -$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} -fi - - - mv -f "$cfgfile" "$ofile" || - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - - ;; - - esac -done # for ac_tag - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - - -chmod +x xml2-config python/setup.py -echo Done configuring diff --git a/reactos/lib/3rdparty/libxml2/configure.in b/reactos/lib/3rdparty/libxml2/configure.in deleted file mode 100644 index 3d5f48be247..00000000000 --- a/reactos/lib/3rdparty/libxml2/configure.in +++ /dev/null @@ -1,1577 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_PREREQ([2.68]) -AC_INIT -AC_CONFIG_SRCDIR([entities.c]) -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) -AC_CANONICAL_HOST - -LIBXML_MAJOR_VERSION=2 -LIBXML_MINOR_VERSION=9 -LIBXML_MICRO_VERSION=0 -LIBXML_MICRO_VERSION_SUFFIX= -LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX -LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION - -LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION` - -if test -f CVS/Entries ; then - extra=`grep ChangeLog CVS/Entries | grep -v LIBXML | sed -e s\%/ChangeLog/1\.%% -e s\%/.*$%%` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-CVS$extra" - fi -else if test -d .svn ; then - extra=`svn info | grep Revision | sed 's+Revision: ++'` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-SVN$extra" - fi -else if test -d .git ; then - extra=`git describe 2>/dev/null | sed 's+LIBXML[[0-9.]]*-++'` - echo extra=$extra - if test "$extra" != "" - then - LIBXML_VERSION_EXTRA="-GIT$extra" - fi -fi -fi -fi -AC_SUBST(LIBXML_MAJOR_VERSION) -AC_SUBST(LIBXML_MINOR_VERSION) -AC_SUBST(LIBXML_MICRO_VERSION) -AC_SUBST(LIBXML_VERSION) -AC_SUBST(LIBXML_VERSION_INFO) -AC_SUBST(LIBXML_VERSION_NUMBER) -AC_SUBST(LIBXML_VERSION_EXTRA) - -VERSION=${LIBXML_VERSION} - -AM_INIT_AUTOMAKE(libxml2, $VERSION) - -# Support silent build rules, requires at least automake-1.11. Disable -# by either passing --disable-silent-rules to configure or passing V=1 -# to make -m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MKDIR_P -AC_PROG_CPP -AC_PATH_PROG(RM, rm, /bin/rm) -AC_PATH_PROG(MV, mv, /bin/mv) -AC_PATH_PROG(TAR, tar, /bin/tar) -AC_PATH_PROG(PERL, perl, /usr/bin/perl) -AC_PATH_PROG(WGET, wget, /usr/bin/wget) -AC_PATH_PROG(XMLLINT, xmllint, /usr/bin/xmllint) -AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc) - -LT_INIT - -dnl -dnl if the system support linker version scripts for symbol versioning -dnl then add it -dnl -VERSION_SCRIPT_FLAGS= -# lt_cv_prog_gnu_ld is from libtool 2.+ -if test "$lt_cv_prog_gnu_ld" = yes; then - VERSION_SCRIPT_FLAGS=-Wl,--version-script= -else - case $host in - *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";; - esac -fi -AC_SUBST(VERSION_SCRIPT_FLAGS) -AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"]) - -dnl -dnl We process the AC_ARG_WITH first so that later we can modify -dnl some of them to try to prevent impossible combinations. This -dnl also allows up so alphabetize the choices -dnl - -dnl -dnl zlib option might change flags, so we save them initially -dnl -_cppflags="${CPPFLAGS}" -_libs="${LIBS}" - -AC_ARG_WITH(c14n, -[ --with-c14n add the Canonicalization support (on)]) -AC_ARG_WITH(catalog, -[ --with-catalog add the Catalog support (on)]) -AC_ARG_WITH(debug, -[ --with-debug add the debugging module (on)]) -AC_ARG_WITH(docbook, -[ --with-docbook add Docbook SGML support (on)]) -AC_ARG_WITH(fexceptions, -[ --with-fexceptions add GCC flag -fexceptions for C++ exceptions (off)]) -AC_ARG_WITH(ftp, -[ --with-ftp add the FTP support (on)]) -AC_ARG_WITH(history, -[ --with-history add history support to xmllint shell(off)]) -AC_ARG_WITH(html, -[ --with-html add the HTML support (on)]) -dnl Specific dir for HTML output ? -AC_ARG_WITH(html-dir, AS_HELP_STRING([--with-html-dir=path], - [path to base html directory, default $datadir/doc/html]), - [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc']) - -AC_ARG_WITH(html-subdir, AS_HELP_STRING([--with-html-subdir=path], - [directory used under html-dir, default $PACKAGE-$VERSION/html]), - [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"], - [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"]) -AC_SUBST(HTML_DIR) -AC_ARG_WITH(http, -[ --with-http add the HTTP support (on)]) -AC_ARG_WITH(iconv, -[ --with-iconv[[=DIR]] add ICONV support (on)]) -AC_ARG_WITH(icu, -[ --with-icu add ICU support (off)]) -AC_ARG_WITH(iso8859x, -[ --with-iso8859x add ISO8859X support if no iconv (on)]) -AC_ARG_WITH(legacy, -[ --with-legacy add deprecated APIs for compatibility (on)]) -AC_ARG_WITH(mem_debug, -[ --with-mem-debug add the memory debugging module (off)]) -AC_ARG_WITH(minimum, -[ --with-minimum build a minimally sized library (off)]) -AC_ARG_WITH(output, -[ --with-output add the serialization support (on)]) -AC_ARG_WITH(pattern, -[ --with-pattern add the xmlPattern selection interface (on)]) -AC_ARG_WITH(push, -[ --with-push add the PUSH parser interfaces (on)]) -AC_ARG_WITH(python, -[ --with-python[[=DIR]] build Python bindings if found]) -AC_ARG_WITH(reader, -[ --with-reader add the xmlReader parsing interface (on)]) -AC_ARG_WITH(readline, -[ --with-readline=DIR use readline in DIR],[ - if test "$withval" != "no" -a "$withval" != "yes"; then - RDL_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LIBS="${LIBS} -L$withval/lib" - fi -]) -AC_ARG_WITH(regexps, -[ --with-regexps add Regular Expressions support (on)]) -AC_ARG_WITH(run_debug, -[ --with-run-debug add the runtime debugging module (off)]) -AC_ARG_WITH(sax1, -[ --with-sax1 add the older SAX1 interface (on)]) -AC_ARG_WITH(schemas, -[ --with-schemas add Relax-NG and Schemas support (on)]) -AC_ARG_WITH(schematron, -[ --with-schematron add Schematron support (on)]) -AC_ARG_WITH(threads, -[ --with-threads add multithread support(on)]) -AC_ARG_WITH(thread-alloc, -[ --with-thread-alloc add per-thread memory(off)]) -AC_ARG_WITH(tree, -[ --with-tree add the DOM like tree manipulation APIs (on)]) -AC_ARG_WITH(valid, -[ --with-valid add the DTD validation support (on)]) -AC_ARG_WITH(writer, -[ --with-writer add the xmlWriter saving interface (on)]) -AC_ARG_WITH(xinclude, -[ --with-xinclude add the XInclude support (on)]) -AC_ARG_WITH(xpath, -[ --with-xpath add the XPATH support (on)]) -AC_ARG_WITH(xptr, -[ --with-xptr add the XPointer support (on)]) -AC_ARG_WITH(modules, -[ --with-modules add the dynamic modules support (on)]) -AC_ARG_WITH(zlib, -[ --with-zlib[[=DIR]] use libz in DIR],[ - if test "$withval" != "no" -a "$withval" != "yes"; then - Z_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LIBS="${LIBS} -L$withval/lib" - fi -]) -AC_ARG_WITH(lzma, -[ --with-lzma[[=DIR]] use liblzma in DIR],[ - if test "$withval" != "no" -a "$withval" != "yes"; then - LZMA_DIR=$withval - CPPFLAGS="${CPPFLAGS} -I$withval/include" - LIBS="${LIBS} -L$withval/lib" - fi -]) -AC_ARG_WITH(coverage, -[ --with-coverage build for code coverage with GCC (off)]) - -AC_ARG_ENABLE(rebuild-docs, -[ --enable-rebuild-docs[[=yes/no]] rebuild some generated docs [[default=no]]]) -if test "$enable_rebuild_docs" = "yes" -a "$srcdir" != "."; then - AC_MSG_ERROR([cannot rebuild docs when builddir != srcdir]) -fi -AM_CONDITIONAL([REBUILD_DOCS], [test "$enable_rebuild_docs" = "yes" -o "$USER" = "veillard"]) - -dnl -dnl hard dependancies on options -dnl -if test "$with_schemas" = "yes" -then - with_pattern=yes - with_regexps=yes -fi -if test "$with_schematron" = "yes" -then - with_pattern=yes - with_xpath=yes -fi -if test "$with_reader" = "yes" -then - with_push=yes -fi -if test "$with_xptr" = "yes" -then - with_xpath=yes -fi -dnl -dnl option to build a minimal libxml2 library -dnl -if test "$with_minimum" = "yes" -then - echo "Configuring for a minimal library" - if test "$with_c14n" = "" - then - with_c14n=no - fi - if test "$with_catalog" = "" - then - with_catalog=no - fi - echo So far so good! - if test "$with_debug" = "" - then - with_debug=no - fi - if test "$with_docbook" = "" - then - with_docbook=no - fi - if test "$with_fexceptions" = "" - then - with_fexceptions=no - fi - if test "$with_ftp" = "" - then - with_ftp=no - fi - if test "$with_history" = "" - then - with_history=no - fi - if test "$with_html" = "" - then - with_html=no - fi - if test "$with_http" = "" - then - with_http=no - fi - if test "$with_iconv" = "" - then - with_iconv=no - fi - if test "$with_iso8859x" = "" - then - with_iso8859x=no - fi - if test "$with_legacy" = "" - then - with_legacy=no - fi - if test "$with_mem_debug" = "" - then - with_mem_debug=no - fi - if test "$with_output" = "" - then - with_output=no - fi - if test "$with_pattern" = "" - then - with_pattern=no - fi - if test "$with_push" = "" - then - with_push=no - fi - if test "$with_python" = "" - then - with_python=no - fi - if test "$with_reader" = "" - then - with_reader=no - fi - if test "$with_readline" = "" - then - with_readline=no - fi - if test "$with_regexps" = "" - then - with_regexps=no - fi - if test "$with_run_debug" = "" - then - with_run_debug=no - fi - if test "$with_sax1" = "" - then - with_sax1=no - fi - if test "$with_schemas" = "" - then - with_schemas=no - fi - if test "$with_schematron" = "" - then - with_schematron=no - fi - if test "$with_threads" = "" - then - with_threads=no - fi - if test "$with_thread_alloc" = "" - then - with_thread_alloc=no - fi - if test "$with_tree" = "" - then - with_tree=no - fi - if test "$with_valid" = "" - then - with_valid=no - fi - if test "$with_writer" = "" - then - with_writer=no - fi - if test "$with_xinclude" = "" - then - with_xinclude=no - fi - if test "$with_xpath" = "" - then - with_xpath=no - fi - if test "$with_xptr" = "" - then - with_xptr=no - fi - if test "$with_zlib" = "" - then - with_zlib=no - fi - if test "$with_modules" = "" - then - with_modules=no - fi -fi - -echo Checking zlib - -dnl Checks for zlib library. - -WITH_ZLIB=0 -if test "$with_zlib" = "no"; then - echo "Disabling compression support" -else - AC_CHECK_HEADERS(zlib.h, - AC_CHECK_LIB(z, gzread,[ - AC_DEFINE([HAVE_LIBZ], [1], [Have compression library]) - WITH_ZLIB=1 - if test "x${Z_DIR}" != "x"; then - Z_CFLAGS="-I${Z_DIR}/include" - Z_LIBS="-L${Z_DIR}/lib -lz" - [case ${host} in - *-*-solaris*) - Z_LIBS="-L${Z_DIR}/lib -R${Z_DIR}/lib -lz" - ;; - esac] - else - Z_LIBS="-lz" - fi])) -fi - -AC_SUBST(Z_CFLAGS) -AC_SUBST(Z_LIBS) -AC_SUBST(WITH_ZLIB) - -echo Checking lzma - -dnl Checks for lzma library. - -WITH_LZMA=0 -if test "$with_lzma" = "no"; then - echo "Disabling compression support" -else - AC_CHECK_HEADERS(lzma.h, - AC_CHECK_LIB(lzma, lzma_code,[ - AC_DEFINE([HAVE_LIBLZMA], [1], [Have compression library]) - WITH_LZMA=1 - if test "x${LZMA_DIR}" != "x"; then - LZMA_CFLAGS="-I${LZMA_DIR}/include" - LZMA_LIBS="-L${LZMA_DIR}/lib -llzma" - else - LZMA_LIBS="-llzma" - fi])) -fi - -AC_SUBST(LZMA_CFLAGS) -AC_SUBST(LZMA_LIBS) -AC_SUBST(WITH_LZMA) - -CPPFLAGS=${_cppflags} -LIBS=${_libs} - -echo Checking headers - -dnl Checks for header files. -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS([fcntl.h]) -AC_CHECK_HEADERS([unistd.h]) -AC_CHECK_HEADERS([ctype.h]) -AC_CHECK_HEADERS([dirent.h]) -AC_CHECK_HEADERS([errno.h]) -AC_CHECK_HEADERS([malloc.h]) -AC_CHECK_HEADERS([stdarg.h]) -AC_CHECK_HEADERS([sys/stat.h]) -AC_CHECK_HEADERS([sys/types.h]) -AC_CHECK_HEADERS([stdint.h]) -AC_CHECK_HEADERS([inttypes.h]) -AC_CHECK_HEADERS([time.h]) -AC_CHECK_HEADERS([ansidecl.h]) -AC_CHECK_HEADERS([ieeefp.h]) -AC_CHECK_HEADERS([nan.h]) -AC_CHECK_HEADERS([math.h]) -AC_CHECK_HEADERS([limits.h]) -AC_CHECK_HEADERS([fp_class.h]) -AC_CHECK_HEADERS([float.h]) -AC_CHECK_HEADERS([stdlib.h]) -AC_CHECK_HEADERS([sys/socket.h], [], [], -[#if HAVE_SYS_TYPES_H -# include -# endif -]) -AC_CHECK_HEADERS([netinet/in.h], [], [], -[#if HAVE_SYS_TYPES_H -# include -# endif -]) -AC_CHECK_HEADERS([arpa/inet.h], [], [], -[#if HAVE_SYS_TYPES_H -# include -# endif -#if HAVE_ARPA_INET_H -# include -# endif -]) -AC_CHECK_HEADERS([netdb.h]) -AC_CHECK_HEADERS([sys/time.h]) -AC_CHECK_HEADERS([sys/select.h]) -AC_CHECK_HEADERS([poll.h]) -AC_CHECK_HEADERS([sys/mman.h]) -AC_CHECK_HEADERS([sys/timeb.h]) -AC_CHECK_HEADERS([signal.h]) -AC_CHECK_HEADERS([arpa/nameser.h], [], [], -[#if HAVE_SYS_TYPES_H -# include -# endif -]) -AC_CHECK_HEADERS([resolv.h], [], [], -[#if HAVE_SYS_TYPES_H -# include -# endif -#if HAVE_NETINET_IN_H -# include -# endif -#if HAVE_ARPA_NAMESER_H -# include -# endif -]) -AC_CHECK_HEADERS([dl.h]) -AC_CHECK_HEADERS([dlfcn.h]) - - -echo Checking types - -AC_TYPE_UINT32_T - - -echo Checking libraries - -dnl Checks for library functions. -AC_FUNC_STRFTIME -AC_CHECK_FUNCS(strdup strndup strerror) -AC_CHECK_FUNCS(finite isnand fp_class class fpclass) -AC_CHECK_FUNCS(strftime localtime gettimeofday ftime) -AC_CHECK_FUNCS(stat _stat signal) -AC_CHECK_FUNCS(rand rand_r srand time) -AC_CHECK_FUNCS(isascii mmap munmap putenv) - -AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */ -#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) -# undef /**/ HAVE_MMAP -#endif]) - -dnl Checking for va_copy availability -AC_MSG_CHECKING([for va_copy]) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include -va_list ap1,ap2;]], [[va_copy(ap1,ap2);]])], -have_va_copy=yes, -have_va_copy=no) -AC_MSG_RESULT($have_va_copy) -if test x"$have_va_copy" = x"yes"; then - AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) -else - AC_MSG_CHECKING([for __va_copy]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include - va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])], - have___va_copy=yes, - have___va_copy=no) - AC_MSG_RESULT($have___va_copy) - if test x"$have___va_copy" = x"yes"; then - AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) - fi -fi - -dnl Checks for inet libraries: -AC_SEARCH_LIBS(gethostent, [nsl]) -AC_SEARCH_LIBS(setsockopt, [socket net network]) -AC_SEARCH_LIBS(connect, [inet]) - -dnl Determine what socket length (socklen_t) data type is -AC_MSG_CHECKING([for type of socket length (socklen_t)]) -AC_TRY_COMPILE2([ -#include -#include -#include ],[ -(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[ - AC_MSG_RESULT(socklen_t *) - XML_SOCKLEN_T=socklen_t],[ - AC_TRY_COMPILE2([ -#include -#include -#include ],[ -(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[ - AC_MSG_RESULT(size_t *) - XML_SOCKLEN_T=size_t],[ - AC_TRY_COMPILE2([ -#include -#include -#include ],[ -(void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[ - AC_MSG_RESULT(int *) - XML_SOCKLEN_T=int],[ - AC_MSG_WARN(could not determine) - XML_SOCKLEN_T="int"])])]) -AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is]) - -dnl ***********************Checking for availability of IPv6******************* - -AC_MSG_CHECKING([whether to enable IPv6]) -AC_ARG_ENABLE(ipv6, [ --enable-ipv6[[=yes/no]] enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes) -if test "$with_minimum" = "yes" -then - enable_ipv6=no -fi -if test $enable_ipv6 = yes; then - have_ipv6=no - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -# include -# include - ]], [[ - struct sockaddr_storage ss; - socket(AF_INET6, SOCK_STREAM, 0) - ]])], - have_ipv6=yes, - have_ipv6=no - ) - AC_MSG_RESULT($have_ipv6) - - if test $have_ipv6 = yes; then - AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6]) - have_broken_ss_family=no - - dnl ********************************************************************* - dnl on some platforms (like AIX 5L), the structure sockaddr doesn't have - dnl a ss_family member, but rather __ss_family. Let's detect that - dnl and define the HAVE_BROKEN_SS_FAMILY when we are on one of these - dnl platforms. However, we should only do this if ss_family is not - dnl present. - dnl ******************************************************************** - AC_MSG_CHECKING([struct sockaddr::ss_family]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -# include -# include - ]], [[ - struct sockaddr_storage ss ; - ss.ss_family = 0 ; - ]])], - have_ss_family=yes, - have_ss_family=no - ) - AC_MSG_RESULT($have_ss_family) - if test x$have_ss_family = xno ; then - AC_MSG_CHECKING([broken struct sockaddr::ss_family]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -# include -# include - ]], [[ - struct sockaddr_storage ss ; - ss.__ss_family = 0 ; - ]])], - have_broken_ss_family=yes, - have_broken_ss_family=no - ) - AC_MSG_RESULT($have_broken_ss_family) - if test x$have_broken_ss_family = xyes ; then - AC_DEFINE(HAVE_BROKEN_SS_FAMILY, [], - [Whether struct sockaddr::__ss_family exists]) - AC_DEFINE(ss_family, __ss_family, - [ss_family is not defined here, use __ss_family instead]) - else - AC_MSG_WARN(ss_family and __ss_family not found) - fi - fi - - have_getaddrinfo=no - AC_CHECK_FUNC(getaddrinfo, have_getaddrinfo=yes) - if test $have_getaddrinfo != yes; then - for lib in bsd socket inet; do - AC_CHECK_LIB($lib, getaddrinfo, [LIBS="$LIBS -l$lib";have_getaddrinfo=yes;break]) - done - fi - - if test $have_getaddrinfo = yes; then - AC_DEFINE([HAVE_GETADDRINFO], [], [Define if getaddrinfo is there]) - fi - fi -fi - -dnl ******************************End IPv6 checks****************************** - -dnl Checks for isnan in libm if not in libc -AC_CHECK_FUNC(isnan, AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there]) , AC_CHECK_LIB(m, isnan, - [AC_DEFINE([HAVE_ISNAN],[], [Define if isnan is there])])) - -AC_CHECK_FUNC(isinf, AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there]) , AC_CHECK_LIB(m, isinf, - [AC_DEFINE([HAVE_ISINF], [], [Define if isinf is there])])) - -XML_LIBDIR='-L${libdir}' -XML_INCLUDEDIR='-I${includedir}/libxml2' - -dnl -dnl Extra flags -dnl -XML_CFLAGS="" -RDL_LIBS="" - -dnl -dnl Workaround for native compilers -dnl HP : http://bugs.gnome.org/db/31/3163.html -dnl DEC : Enable NaN/Inf -dnl -if test "${GCC}" != "yes" ; then - case "${host}" in - hppa*-*-hpux* ) - CFLAGS="${CFLAGS} -Wp,-H30000" - ;; - *-dec-osf* ) - CFLAGS="${CFLAGS} -ieee" - ;; - alpha*-*-linux* ) - CFLAGS="${CFLAGS} -ieee" - ;; - esac -else - if test "$with_fexceptions" = "yes" - then - # - # Not activated by default because this inflates the code size - # Used to allow propagation of C++ exceptions through the library - # - CFLAGS="${CFLAGS} -fexceptions" - fi - - # warnings we'd like to see - CFLAGS="${CFLAGS} -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls" - # warnings we'd like to supress - CFLAGS="${CFLAGS} -Wno-long-long" - case "${host}" in - alpha*-*-linux* ) - CFLAGS="${CFLAGS} -mieee" - ;; - alpha*-*-osf* ) - CFLAGS="${CFLAGS} -mieee" - ;; - esac -fi -case ${host} in - *-*-solaris*) - XML_LIBDIR="${XML_LIBDIR} -R${libdir}" - ;; - hppa*-hp-mpeix) - NEED_TRIO=1 - ;; - *-*-mingw* | *-*-cygwin* | *-*-msvc* ) - # If the host is Windows, and shared libraries are disabled, we - # need to add -DLIBXML_STATIC to CFLAGS in order for linking to - # work properly (without it, xmlexports.h would force the use of - # DLL imports, which obviously aren't present in a static - # library). - if test "x$enable_shared" = "xno"; then - XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC" - CFLAGS="$CFLAGS -DLIBXML_STATIC" - fi - ;; -esac - - -dnl -dnl check for python -dnl - -PYTHON_VERSION= -PYTHON_INCLUDES= -PYTHON_SITE_PACKAGES= -PYTHON_TESTS= -pythondir= -if test "$with_python" != "no" ; then - if test -x "$with_python/bin/python" - then - echo Found python in $with_python/bin/python - PYTHON="$with_python/bin/python" - else - if test -x "$with_python/python.exe" - then - echo Found python in $with_python/python.exe - PYTHON="$with_python/python.exe" - else - if test -x "$with_python" - then - echo Found python in $with_python - PYTHON="$with_python" - else - if test -x "$PYTHON" - then - echo Found python in environment PYTHON=$PYTHON - with_python=`$PYTHON -c "import sys; print sys.exec_prefix"` - else - AC_PATH_PROG(PYTHON, python python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5) - fi - fi - fi - fi - if test "$PYTHON" != "" - then - PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"` - echo Found Python version $PYTHON_VERSION - fi - if test "$PYTHON_VERSION" != "" - then - if test -r $with_python/include/python$PYTHON_VERSION/Python.h -a \ - -d $with_python/lib/python$PYTHON_VERSION/site-packages - then - PYTHON_INCLUDES=$with_python/include/python$PYTHON_VERSION - PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages - else - if test -r $prefix/include/python$PYTHON_VERSION/Python.h - then - PYTHON_INCLUDES=$prefix/include/python$PYTHON_VERSION - PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages - else - if test -r /usr/include/python$PYTHON_VERSION/Python.h - then - PYTHON_INCLUDES=/usr/include/python$PYTHON_VERSION - PYTHON_SITE_PACKAGES=$libdir/python$PYTHON_VERSION/site-packages - else - if test -r $with_python/include/Python.h -a \ - -d $with_python/lib/site-packages - then - PYTHON_INCLUDES=$with_python/include - PYTHON_SITE_PACKAGES=$with_python/lib/site-packages - else - echo could not find python$PYTHON_VERSION/Python.h or $with_python/include/Python.h - fi - fi - fi - if test ! -d "$PYTHON_SITE_PACKAGES" - then - PYTHON_SITE_PACKAGES=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib()"` - fi - fi - PYTHON_LIBS=`python$PYTHON_VERSION-config --ldflags` - fi - if test "$with_python" != "" - then - pythondir='$(PYTHON_SITE_PACKAGES)' - else - pythondir='$(libdir)/python$(PYTHON_VERSION)/site-packages' - fi -else - PYTHON= -fi -AM_CONDITIONAL(WITH_PYTHON, test "$PYTHON_INCLUDES" != "") -if test "$PYTHON_INCLUDES" != "" -then - PYTHON_SUBDIR=python -else - PYTHON_SUBDIR= -fi -AC_SUBST(pythondir) -AC_SUBST(PYTHON_SUBDIR) -AC_SUBST(PYTHON_LIBS) - -dnl check for dso support -WITH_MODULES=0 -TEST_MODULES= - -if test "$with_modules" != "no" ; then - case "$host" in - *-*-cygwin*) - MODULE_EXTENSION=".dll" - AC_CHECK_LIB(cygwin, dlopen, [ - WITH_MODULES=1 - MODULE_PLATFORM_LIBS= - AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) - ]) - ;; - *-*-mingw*) - MODULE_EXTENSION=".dll" - WITH_MODULES=1 - ;; - *) - AC_CHECK_FUNC(shl_load, libxml_have_shl_load=yes, [ - AC_CHECK_LIB(dld, shl_load, [ - MODULE_PLATFORM_LIBS="-ldld" - libxml_have_shl_load=yes], [ - AC_CHECK_FUNC(dlopen, libxml_have_dlopen=yes, [ - AC_CHECK_LIB(dl, dlopen, [ - MODULE_PLATFORM_LIBS="-ldl" - libxml_have_dlopen=yes])])])]) - - if test "${libxml_have_shl_load}" = "yes"; then - MODULE_EXTENSION=".sl" - WITH_MODULES=1 - AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso]) - fi - - if test "${libxml_have_dlopen}" = "yes"; then - case "${host}" in - *-*-hpux* ) - MODULE_EXTENSION=".sl" - ;; - * ) - MODULE_EXTENSION=".so" - ;; - esac - - WITH_MODULES=1 - AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso]) - fi - ;; - esac -fi - -if test "${WITH_MODULES}" = "1"; then - TEST_MODULES="ModuleTests" -fi - -AC_SUBST(WITH_MODULES) -AC_SUBST(MODULE_PLATFORM_LIBS) -AC_SUBST(MODULE_EXTENSION) -AC_SUBST(TEST_MODULES) - -dnl -dnl Tester makes use of readline if present -dnl - -dnl -dnl specific tests to setup DV and Bill's devel environments with debug etc ... -dnl (-Wunreachable-code) -dnl -if [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/u/veillard/XML" ]] || \ - [[ "${LOGNAME}" = "veillard" -a "`pwd`" = "/home/veillard/libxml2" ]] || \ - [[ "${LOGNAME}" = "bill" -a "`pwd`" = "/home/bill/gnomesvn/libxml2" ]] - then - if test "$with_minimum" != "yes" - then - if test "${with_mem_debug}" = "" ; then - echo Activating memory debugging - with_mem_debug="yes" - with_run_debug="yes" - fi - if test "${with_docbook}" = "" ; then - with_docbook="yes" - fi - fi - if test "${GCC}" = "yes" ; then - CFLAGS="-g -O -pedantic -W -Wformat -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wformat -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls -Wall" - fi - STATIC_BINARIES="-static" -dnl -Wcast-qual -ansi -else - STATIC_BINARIES= -fi -AC_SUBST(STATIC_BINARIES) - -dnl -dnl Check for trio string functions -dnl - -if test "${NEED_TRIO}" = "1" ; then - echo Adding trio library for string functions - WITH_TRIO=1 -else - WITH_TRIO=0 -fi -AM_CONDITIONAL(WITH_TRIO_SOURCES, test "${NEED_TRIO}" = "1") -AC_SUBST(WITH_TRIO) - -dnl -dnl Allow to enable/disable various pieces -dnl -echo Checking configuration requirements - -dnl -dnl Thread-related stuff -dnl -THREAD_LIBS="" -BASE_THREAD_LIBS="" -WITH_THREADS=0 -THREAD_CFLAGS="" -TEST_THREADS="" -THREADS_W32="" - -if test "$with_threads" = "no" ; then - echo Disabling multithreaded support -else - echo Enabling multithreaded support - - dnl Default to native threads on Win32 - case $host_os in - *mingw32*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then - WITH_THREADS="1" - THREADS_W32="1" - THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS" - fi - ;; - esac - - dnl Use pthread by default in other cases - if test -z "$THREADS_W32"; then - if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then - AC_CHECK_HEADER(pthread.h, - AC_CHECK_LIB(pthread, pthread_join,[ - THREAD_LIBS="-lpthread" - AC_DEFINE([HAVE_LIBPTHREAD], [], [Define if pthread library is there (-lpthread)]) - AC_DEFINE([HAVE_PTHREAD_H], [], [Define if is there]) - WITH_THREADS="1"])) - fi - fi - - case $host_os in - *cygwin*) THREAD_LIBS="" - ;; - *beos*) WITH_THREADS="1" - THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS" - ;; - *linux*) - if test "${GCC}" = "yes" ; then - GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'` - GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'` - GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[[0-9]]*\.++' | sed 's+\..*++'` - if test "${THREAD_LIBS}" = "-lpthread" ; then - if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null - then - THREAD_LIBS="" - BASE_THREAD_LIBS="-lpthread" - else - if expr ${GCC_MAJOR} \> 3 > /dev/null - then - THREAD_LIBS="" - BASE_THREAD_LIBS="-lpthread" - else - echo old GCC disabling weak symbols for pthread - fi - fi - fi - fi - ;; - esac - if test "$WITH_THREADS" = "1" ; then - THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" - TEST_THREADS="Threadtests" - fi -fi -if test "$with_thread_alloc" = "yes" -a "$WITH_THREADS" = "1" ; then - THREAD_CFLAGS="$THREAD_CFLAGS -DLIBXML_THREAD_ALLOC_ENABLED" -fi - -AC_SUBST(THREAD_LIBS) -AC_SUBST(BASE_THREAD_LIBS) -AC_SUBST(WITH_THREADS) -AC_SUBST(THREAD_CFLAGS) -AC_SUBST(TEST_THREADS) -AM_CONDITIONAL([THREADS_W32],[test -n "$THREADS_W32"]) - -dnl -dnl xmllint shell history -dnl -if test "$with_history" = "yes" ; then - echo Enabling xmllint shell history - dnl check for terminal library. this is a very cool solution - dnl from octave's configure.in - unset tcap - for termlib in ncurses curses termcap terminfo termlib; do - AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"]) - test -n "$tcap" && break - done - - AC_CHECK_HEADER(readline/history.h, - AC_CHECK_LIB(history, append_history,[ - RDL_LIBS="-lhistory" - AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])])) - AC_CHECK_HEADER(readline/readline.h, - AC_CHECK_LIB(readline, readline,[ - RDL_LIBS="-lreadline $RDL_LIBS $tcap" - AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap)) - if test -n "$RDL_DIR" -a -n "$RDL_LIBS"; then - CPPFLAGS="$CPPFLAGS -I${RDL_DIR}/include" - RDL_LIBS="-L${RDL_DIR}/lib $RDL_LIBS" - fi -fi - -dnl -dnl Tree functions -dnl -if test "$with_tree" = "no" ; then - echo Disabling DOM like tree manipulation APIs - WITH_TREE=0 -else - WITH_TREE=1 -fi -AC_SUBST(WITH_TREE) - -if test "$with_ftp" = "no" ; then - echo Disabling FTP support - WITH_FTP=0 - FTP_OBJ= -else - WITH_FTP=1 - FTP_OBJ=nanoftp.o -fi -AC_SUBST(WITH_FTP) -AC_SUBST(FTP_OBJ) - -if test "$with_http" = "no" ; then - echo Disabling HTTP support - WITH_HTTP=0 - HTTP_OBJ= -else - WITH_HTTP=1 - HTTP_OBJ=nanohttp.o -fi -AC_SUBST(WITH_HTTP) -AC_SUBST(HTTP_OBJ) - -if test "$with_legacy" = "no" ; then - echo Disabling deprecated APIs - WITH_LEGACY=0 -else - WITH_LEGACY=1 -fi -AC_SUBST(WITH_LEGACY) - -if test "$with_reader" = "no" ; then - echo Disabling the xmlReader parsing interface - WITH_READER=0 - READER_TEST= -else - WITH_READER=1 - READER_TEST=Readertests - if test "$with_push" = "no" ; then - echo xmlReader requires Push interface - enabling it - with_push=yes - fi -fi -AC_SUBST(WITH_READER) -AC_SUBST(READER_TEST) - -if test "$with_writer" = "no" ; then - echo Disabling the xmlWriter saving interface - WITH_WRITER=0 -# WRITER_TEST= -else - WITH_WRITER=1 -# WRITER_TEST=Writertests - if test "$with_push" = "no" ; then - echo xmlWriter requires Push interface - enabling it - with_push=yes - fi - if test "$with_output" = "no" ; then - echo xmlWriter requires Output interface - enabling it - with_output=yes - fi -fi -AC_SUBST(WITH_WRITER) -#AC_SUBST(WRITER_TEST) - -if test "$with_pattern" = "no" ; then - echo Disabling the xmlPattern parsing interface - WITH_PATTERN=0 - TEST_PATTERN= -else - WITH_PATTERN=1 - TEST_PATTERN=Patterntests -fi -AC_SUBST(WITH_PATTERN) -AC_SUBST(TEST_PATTERN) - -if test "$with_sax1" = "no" ; then - echo Disabling the older SAX1 interface - WITH_SAX1=0 - TEST_SAX= -else - WITH_SAX1=1 - TEST_SAX=SAXtests -fi -AC_SUBST(WITH_SAX1) -AM_CONDITIONAL(WITH_SAX1_SOURCES, test "${WITH_TRIO}" = "1") -AC_SUBST(TEST_SAX) - -if test "$with_push" = "no" ; then - echo Disabling the PUSH parser interfaces - WITH_PUSH=0 - TEST_PUSH= -else - WITH_PUSH=1 - TEST_PUSH="XMLPushtests" -fi -AC_SUBST(WITH_PUSH) -AC_SUBST(TEST_PUSH) - -if test "$with_html" = "no" ; then - echo Disabling HTML support - WITH_HTML=0 - HTML_OBJ= - TEST_HTML= -else - WITH_HTML=1 - HTML_OBJ="HTMLparser.o HTMLtree.o" - TEST_HTML=HTMLtests - if test "$with_push" != "no" ; then - TEST_PHTML=HTMLPushtests - else - TEST_PHTML= - fi -fi -AC_SUBST(WITH_HTML) -AC_SUBST(HTML_OBJ) -AC_SUBST(TEST_HTML) -AC_SUBST(TEST_PHTML) - -if test "$with_valid" = "no" ; then - echo Disabling DTD validation support - WITH_VALID=0 - TEST_VALID= - TEST_VTIME= -else - WITH_VALID=1 - TEST_VALID=Validtests - TEST_VTIME=VTimingtests -fi -AC_SUBST(WITH_VALID) -AC_SUBST(TEST_VALID) -AC_SUBST(TEST_VTIME) - -if test "$with_catalog" = "no" ; then - echo Disabling Catalog support - WITH_CATALOG=0 - CATALOG_OBJ= - TEST_CATALOG= -else - WITH_CATALOG=1 - CATALOG_OBJ="catalog.o" - TEST_CATALOG=Catatests -fi -AC_SUBST(WITH_CATALOG) -AC_SUBST(CATALOG_OBJ) -AC_SUBST(TEST_CATALOG) - -if test "$with_docbook" = "no" ; then - echo Disabling Docbook support - WITH_DOCB=0 - DOCB_OBJ= -else - WITH_DOCB=1 - DOCB_OBJ="DOCBparser.o" -fi -AC_SUBST(WITH_DOCB) -AC_SUBST(DOCB_OBJ) - - -if test "$with_xptr" = "no" ; then - echo Disabling XPointer support - WITH_XPTR=0 - XPTR_OBJ= - TEST_XPTR= -else - WITH_XPTR=1 - XPTR_OBJ=xpointer.o - TEST_XPTR=XPtrtests - if test "$with_xpath" = "no" ; then - echo XPointer requires XPath support - enabling it - with_xpath=yes - fi -fi -AC_SUBST(WITH_XPTR) -AC_SUBST(XPTR_OBJ) -AC_SUBST(TEST_XPTR) - -if test "$with_c14n" = "no" ; then - echo Disabling C14N support - WITH_C14N=0 - C14N_OBJ= - TEST_C14N= -else - WITH_C14N=1 - C14N_OBJ="c14n.c" - TEST_C14N=C14Ntests - if test "$with_xpath" = "no" ; then - echo C14N requires XPath support - enabling it - with_xpath=yes - fi -fi -AC_SUBST(WITH_C14N) -AC_SUBST(C14N_OBJ) -AC_SUBST(TEST_C14N) - -if test "$with_xinclude" = "no" ; then - echo Disabling XInclude support - WITH_XINCLUDE=0 - XINCLUDE_OBJ= - with_xinclude="no" - TEST_XINCLUDE= -else - WITH_XINCLUDE=1 - XINCLUDE_OBJ=xinclude.o - TEST_XINCLUDE=XIncludetests - if test "$with_xpath" = "no" ; then - echo XInclude requires XPath support - enabling it - with_xpath=yes - fi -fi -AC_SUBST(WITH_XINCLUDE) -AC_SUBST(XINCLUDE_OBJ) -AC_SUBST(TEST_XINCLUDE) - -if test "$with_xpath" = "no" ; then - echo Disabling XPATH support - WITH_XPATH=0 - XPATH_OBJ= - TEST_XPATH= -else - WITH_XPATH=1 - XPATH_OBJ=xpath.o - TEST_XPATH=XPathtests -fi -AC_SUBST(WITH_XPATH) -AC_SUBST(XPATH_OBJ) -AC_SUBST(TEST_XPATH) - -dnl -dnl output functions -dnl -if test "$with_output" = "no" ; then - echo Disabling serialization/saving support - WITH_OUTPUT=0 -else - WITH_OUTPUT=1 -fi -AC_SUBST(WITH_OUTPUT) - -WITH_ICONV=0 -if test "$with_iconv" = "no" ; then - echo Disabling ICONV support -else - if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then - CPPFLAGS="${CPPFLAGS} -I$with_iconv/include" - # Export this since our headers include iconv.h - XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include" - ICONV_LIBS="-L$with_iconv/lib" - fi - - AC_CHECK_HEADER(iconv.h, - AC_MSG_CHECKING(for iconv) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include -#include ]],[[ -iconv_t cd = iconv_open ("",""); -iconv (cd, NULL, NULL, NULL, NULL);]])],[ - AC_MSG_RESULT(yes) - WITH_ICONV=1],[ - AC_MSG_RESULT(no) - AC_MSG_CHECKING(for iconv in -liconv) - - _ldflags="${LDFLAGS}" - _libs="${LIBS}" - LDFLAGS="${LDFLAGS} ${ICONV_LIBS}" - LIBS="${LIBS} -liconv" - - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include -#include ]],[[ -iconv_t cd = iconv_open ("",""); -iconv (cd, NULL, NULL, NULL, NULL);]])],[ - AC_MSG_RESULT(yes) - WITH_ICONV=1 - ICONV_LIBS="${ICONV_LIBS} -liconv" - LIBS="${_libs}" - LDFLAGS="${_ldflags}"],[ - AC_MSG_RESULT(no) - LIBS="${_libs}" - LDFLAGS="${_ldflags}"])])) - - if test "$WITH_ICONV" = "1" ; then - AC_MSG_CHECKING([for iconv declaration]) - AC_CACHE_VAL(xml_cv_iconv_arg2, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include -#include -extern -#ifdef __cplusplus -"C" -#endif -#if defined(__STDC__) || defined(__cplusplus) -size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -#else -size_t iconv(); -#endif -]], [])], xml_cv_iconv_arg2="", xml_cv_iconv_arg2="const")]) - - xml_cv_iconv_decl="extern size_t iconv (iconv_t cd, $xml_cv_iconv_arg2 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" - AC_MSG_RESULT([${xml_xxx:- - }$xml_cv_iconv_decl]) - AC_DEFINE_UNQUOTED(ICONV_CONST, $xml_cv_iconv_arg2, - [Define as const if the declaration of iconv() needs const.]) - fi -fi -case "$host" in - *mingw*) M_LIBS="" - ;; - *beos*) M_LIBS="" - ;; - *haiku*) M_LIBS="" - ;; - *) M_LIBS="-lm" - ;; -esac -XML_LIBS="-lxml2 $Z_LIBS $THREAD_LIBS $ICONV_LIBS $M_LIBS $LIBS" -XML_LIBTOOLLIBS="libxml2.la" -AC_SUBST(WITH_ICONV) - -WITH_ICU=0 -ICU_LIBS="" -if test "$with_icu" != "yes" ; then - echo Disabling ICU support -else - ICU_CONFIG=icu-config - if ${ICU_CONFIG} --cflags >/dev/null 2>&1 - then - ICU_LIBS=`${ICU_CONFIG} --ldflags` - WITH_ICU=1 - echo Enabling ICU support - else - AC_MSG_ERROR([libicu config program icu-config not found]) - fi -fi -AC_SUBST(WITH_ICU) -AC_SUBST(ICU_LIBS) - -WITH_ISO8859X=1 -if test "$WITH_ICONV" != "1" ; then -if test "$with_iso8859x" = "no" ; then - echo Disabling ISO8859X support - WITH_ISO8859X=0 -fi -fi -AC_SUBST(WITH_ISO8859X) - -if test "$with_schematron" = "no" ; then - echo "Disabling Schematron support" - WITH_SCHEMATRON=0 - TEST_SCHEMATRON= -else - echo "Enabled Schematron support" - WITH_SCHEMATRON=1 - TEST_SCHEMATRON="Schematrontests" - with_xpath=yes - with_pattern=yes -fi -AC_SUBST(WITH_SCHEMATRON) -AC_SUBST(TEST_SCHEMATRON) - -if test "$with_schemas" = "no" ; then - echo "Disabling Schemas/Relax-NG support" - WITH_SCHEMAS=0 - TEST_SCHEMAS= -else - echo "Enabled Schemas/Relax-NG support" - WITH_SCHEMAS=1 - TEST_SCHEMAS="Schemastests Relaxtests" - if test "$PYTHON_INCLUDES" != "" ; then - PYTHON_TESTS="$PYTHON_TESTS RelaxNGPythonTests SchemasPythonTests" - fi - with_regexps=yes -fi -AC_SUBST(WITH_SCHEMAS) -AC_SUBST(TEST_SCHEMAS) - -if test "$with_regexps" = "no" ; then - echo Disabling Regexps support - WITH_REGEXPS=0 - TEST_REGEXPS= -else - WITH_REGEXPS=1 - TEST_REGEXPS="Regexptests Automatatests" -fi -AC_SUBST(WITH_REGEXPS) -AC_SUBST(TEST_REGEXPS) - -if test "$with_debug" = "no" ; then - echo Disabling DEBUG support - WITH_DEBUG=0 - DEBUG_OBJ= - TEST_DEBUG= -else - WITH_DEBUG=1 - DEBUG_OBJ=debugXML.o - TEST_DEBUG=Scripttests -fi -AC_SUBST(WITH_DEBUG) -AC_SUBST(DEBUG_OBJ) -AC_SUBST(TEST_DEBUG) - -if test "$with_mem_debug" = "yes" ; then - if test "$with_thread_alloc" = "yes" ; then - echo Disabling memory debug - cannot use mem-debug with thread-alloc! - WITH_MEM_DEBUG=0 - else - echo Enabling memory debug support - WITH_MEM_DEBUG=1 - fi -else - WITH_MEM_DEBUG=0 -fi -AC_SUBST(WITH_MEM_DEBUG) - -if test "$with_run_debug" = "yes" ; then - echo Enabling runtime debug support - WITH_RUN_DEBUG=1 -else - WITH_RUN_DEBUG=0 -fi -AC_SUBST(WITH_RUN_DEBUG) - -WIN32_EXTRA_LIBADD= -WIN32_EXTRA_LDFLAGS= -CYGWIN_EXTRA_LDFLAGS= -CYGWIN_EXTRA_PYTHON_LIBADD= -WIN32_EXTRA_PYTHON_LIBADD= -case "$host" in - *-*-mingw*) - CPPFLAGS="$CPPFLAGS -DWIN32" - WIN32_EXTRA_LIBADD="-lws2_32" - WIN32_EXTRA_LDFLAGS="-no-undefined" - AC_DEFINE([_WINSOCKAPI_],1,[Using the Win32 Socket implementation]) - if test "${PYTHON}" != "" - then - WIN32_EXTRA_PYTHON_LIBADD="-L${pythondir}/../../libs -lpython$(echo ${PYTHON_VERSION} | tr -d .)" - fi - ;; - *-*-cygwin*) - CYGWIN_EXTRA_LDFLAGS="-no-undefined" - if test "${PYTHON}" != "" - then - CYGWIN_EXTRA_PYTHON_LIBADD="-L/usr/lib/python${PYTHON_VERSION}/config -lpython${PYTHON_VERSION}" - fi - ;; -esac -AC_SUBST(WIN32_EXTRA_LIBADD) -AC_SUBST(WIN32_EXTRA_LDFLAGS) -AC_SUBST(WIN32_EXTRA_PYTHON_LIBADD) -AC_SUBST(CYGWIN_EXTRA_LDFLAGS) -AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD) - -dnl Checking the standard string functions availability -dnl -dnl Note mingw* has C99 implementation that produce expected xml numbers -dnl if code use {v}snprintf functions. -dnl If you like to activate at run-time C99 compatible number output -dnl see release note for mingw runtime 3.15: -dnl http://sourceforge.net/project/shownotes.php?release_id=24832 -dnl -dnl Also *win32*config.h files redefine them for various MSC compilers. -dnl -dnl So do not redefine {v}snprintf to _{v}snprintf like follwing: -dnl AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around]) -dnl AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around]) -dnl and do not redefine those functions is C-source files. -dnl -AC_CHECK_FUNCS(printf sprintf fprintf snprintf vfprintf vsprintf vsnprintf sscanf,, - NEED_TRIO=1) - -if test "$with_coverage" = "yes" -a "${GCC}" = "yes" -then - echo Enabling code coverage for GCC - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" - LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage" -else - echo Disabling code coverage for GCC -fi - -AC_SUBST(CPPFLAGS) -AC_SUBST(CFLAGS) -AC_SUBST(LDFLAGS) -AC_SUBST(XML_CFLAGS) - -AC_SUBST(XML_LIBDIR) -AC_SUBST(XML_LIBS) -AC_SUBST(XML_LIBTOOLLIBS) -AC_SUBST(ICONV_LIBS) -AC_SUBST(XML_INCLUDEDIR) -AC_SUBST(HTML_DIR) -AC_SUBST(HAVE_ISNAN) -AC_SUBST(HAVE_ISINF) -AC_SUBST(PYTHON) -AC_SUBST(PYTHON_VERSION) -AC_SUBST(PYTHON_INCLUDES) -AC_SUBST(PYTHON_SITE_PACKAGES) - -AC_SUBST(M_LIBS) -AC_SUBST(RDL_LIBS) - -dnl for the spec file -RELDATE=`date +'%a %b %e %Y'` -AC_SUBST(RELDATE) -AC_SUBST(PYTHON_TESTS) - -rm -f COPYING.LIB COPYING -ln -s $srcdir/Copyright COPYING - -# keep on one line for cygwin c.f. #130896 -AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h xml2-config libxml-2.0.pc libxml-2.0-uninstalled.pc python/setup.py]) -AC_OUTPUT - -chmod +x xml2-config python/setup.py -echo Done configuring diff --git a/reactos/lib/3rdparty/libxml2/dbgen.pl b/reactos/lib/3rdparty/libxml2/dbgen.pl deleted file mode 100644 index 1383d6e9797..00000000000 --- a/reactos/lib/3rdparty/libxml2/dbgen.pl +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/perl - -$size = shift; - -if ($size eq "") -{ - die "usage: dbgen.pl [size]\n"; -} - -@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood", - "George", "Hank", "Inki", "James"); -@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman", - "Franklin", "Grice", "Haverford", "Ilvedson", "Jones"); -@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", - "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", - "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", - "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", - "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"); - -print "\n"; -print "\n"; -print "\n"; - -for ($i=0; $i<$size; $i++) -{ - $first = $firstnames [$i % 10]; - $last = $lastnames [($i / 10) % 10]; - $state = $states [($i / 100) % 50]; - $zip = 22000 + $i / 5000; - - printf " \n"; - printf " %04d\n", $i; - printf " $first\n", $i; - printf " $last\n", $i; - printf " %d Any St.\n", ($i % 100) + 1; - printf " Anytown\n"; - printf " $state\n"; - printf " %d\n", $zip; - printf " \n"; -} - -print "
\n"; - diff --git a/reactos/lib/3rdparty/libxml2/dbgenattr.pl b/reactos/lib/3rdparty/libxml2/dbgenattr.pl deleted file mode 100644 index dce11cd8b17..00000000000 --- a/reactos/lib/3rdparty/libxml2/dbgenattr.pl +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/perl - -$size = shift; - -if ($size eq "") -{ - die "usage: dbgen.pl [size]\n"; -} - -@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood", - "George", "Hank", "Inki", "James"); -@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman", - "Franklin", "Grice", "Haverford", "Ilvedson", "Jones"); -@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", - "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", - "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", - "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", - "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"); - -print "\n"; -print "\n"; -print "\n"; - -for ($i=0; $i<$size; $i++) -{ - $first = $firstnames [$i % 10]; - $last = $lastnames [($i / 10) % 10]; - $state = $states [($i / 100) % 50]; - $zip = 22000 + $i / 5000; - - printf " \n", $zip; -} - -print "
\n"; - diff --git a/reactos/lib/3rdparty/libxml2/debugXML.c b/reactos/lib/3rdparty/libxml2/debugXML.c index 3874b19fbf6..c8efe6abd60 100644 --- a/reactos/lib/3rdparty/libxml2/debugXML.c +++ b/reactos/lib/3rdparty/libxml2/debugXML.c @@ -354,7 +354,6 @@ xmlCtxtGenericNodeCheck(xmlDebugCtxtPtr ctxt, xmlNodePtr node) { (node->type != XML_ELEMENT_DECL) && (node->type != XML_ATTRIBUTE_DECL) && (node->type != XML_DTD_NODE) && - (node->type != XML_ELEMENT_DECL) && (node->type != XML_HTML_DOCUMENT_NODE) && (node->type != XML_DOCUMENT_NODE)) { if (node->content != NULL) diff --git a/reactos/lib/3rdparty/libxml2/depcomp b/reactos/lib/3rdparty/libxml2/depcomp deleted file mode 100644 index bd0ac089584..00000000000 --- a/reactos/lib/3rdparty/libxml2/depcomp +++ /dev/null @@ -1,688 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2011-12-04.11; # UTC - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. - -# 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, 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, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputting dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "depcomp $scriptversion" - exit $? - ;; -esac - -if test -z "$depmode" || test -z "$source" || test -z "$object"; then - echo "depcomp: Variables source, object and depmode must be set" 1>&2 - exit 1 -fi - -# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. -depfile=${depfile-`echo "$object" | - sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} -tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} - -rm -f "$tmpdepfile" - -# Some modes work just like other modes, but use different flags. We -# parameterize here, but still list the modes in the big case below, -# to make depend.m4 easier to write. Note that we *cannot* use a case -# here, because this file can only contain one case statement. -if test "$depmode" = hp; then - # HP compiler uses -M and no extra arg. - gccflag=-M - depmode=gcc -fi - -if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout -fi - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp -fi - -if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 -fi - -case "$depmode" in -gcc3) -## gcc 3 implements dependency tracking that does exactly what -## we want. Yay! Note: for some reason libtool 1.4 doesn't like -## it if -MD -MP comes after the -MF stuff. Hmm. -## Unfortunately, FreeBSD c89 acceptance of flags depends upon -## the command line argument order; so add the flags where they -## appear in depend2.am. Note that the slowdown incurred here -## affects only configure: in makefiles, %FASTDEP% shortcuts this. - for arg - do - case $arg in - -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; - *) set fnord "$@" "$arg" ;; - esac - shift # fnord - shift # $arg - done - "$@" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - mv "$tmpdepfile" "$depfile" - ;; - -gcc) -## There are various ways to get dependency output from gcc. Here's -## why we pick this rather obscure method: -## - Don't want to use -MD because we'd like the dependencies to end -## up in a subdir. Having to rename by hand is ugly. -## (We might end up doing this anyway to support other compilers.) -## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). -## - Using -M directly means running the compiler twice (even worse -## than renaming). - if test -z "$gccflag"; then - gccflag=-MD, - fi - "$@" -Wp,"$gccflag$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. - sed -e 's/^[^:]*: / /' \ - -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. -## The problem is that when a header file which appears in a .P file -## is deleted, the dependency causes make to die (because there is -## typically no way to rebuild the header). We avoid this by adding -## dummy dependencies for each header file. Too bad gcc doesn't do -## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory -## that the space means something, we add a space to the output as -## well. hp depmode also adds that space, but also prefixes the VPATH -## to the object. Take care to not repeat it in the output. -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -sgi) - if test "$libtool" = yes; then - "$@" "-Wp,-MDupdate,$tmpdepfile" - else - "$@" -MDupdate "$tmpdepfile" - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - - if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files - echo "$object : \\" > "$depfile" - - # Clip off the initial element (the dependent). Don't try to be - # clever and replace this with sed code, as IRIX sed won't handle - # lines with more than a fixed number of characters (4096 in - # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the - # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" - echo >> "$depfile" - - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -aix) - # The C for AIX Compiler uses -M and outputs the dependencies - # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the - # start of each line; $object doesn't have directory information. - # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.u - tmpdepfile2=$base.u - tmpdepfile3=$dir.libs/$base.u - "$@" -Wc,-M - else - tmpdepfile1=$dir$base.u - tmpdepfile2=$dir$base.u - tmpdepfile3=$dir$base.u - "$@" -M - fi - stat=$? - - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output - # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : - # foo.o: sub/foo.c ... \ - # sub/foo.h ... \ - # ... - - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - # Each line is of the form `foo.o: dependent.h', - # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" - # Some versions of the HPUX 10.20 sed can't process this invocation - # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -hp2) - # The "hp" stanza above does not work with aCC (C++) and HP's ia64 - # compilers, which have integrated preprocessors. The correct option - # to use with these is +Maked; it writes dependencies to a file named - # 'foo.d', which lands next to the object file, wherever that - # happens to be. - # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - if test "$libtool" = yes; then - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir.libs/$base.d - "$@" -Wc,+Maked - else - tmpdepfile1=$dir$base.d - tmpdepfile2=$dir$base.d - "$@" +Maked - fi - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. - sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" "$tmpdepfile2" - ;; - -tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi - - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; - -msvc7) - if test "$libtool" = yes; then - showIncludes=-Wc,-showIncludes - else - showIncludes=-showIncludes - fi - "$@" $showIncludes > "$tmpdepfile" - stat=$? - grep -v '^Note: including file: ' "$tmpdepfile" - if test "$stat" = 0; then : - else - rm -f "$tmpdepfile" - exit $stat - fi - rm -f "$depfile" - echo "$object : \\" > "$depfile" - # The first sed program below extracts the file names and escapes - # backslashes for cygpath. The second sed program outputs the file - # name when reading, but also accumulates all include files in the - # hold buffer in order to output them again at the end. This only - # works with sed implementations that can handle large buffers. - sed < "$tmpdepfile" -n ' -/^Note: including file: *\(.*\)/ { - s//\1/ - s/\\/\\\\/g - p -}' | $cygpath_u | sort -u | sed -n ' -s/ /\\ /g -s/\(.*\)/ \1 \\/p -s/.\(.*\) \\/\1:/ -H -$ { - s/.*/ / - G - p -}' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvc7msys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -#nosideeffect) - # This comment above is used by automake to tell side-effect - # dependency tracking mechanisms from slower ones. - -dashmstdout) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout, regardless of -o. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" - rm -f "$depfile" - cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -dashXmstdout) - # This case only exists to satisfy depend.m4. It is never actually - # run, as this mode is specially recognized in the preamble. - exit 1 - ;; - -makedepend) - "$@" || exit $? - # Remove any Libtool call - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - # makedepend may prepend the VPATH from the source file name to the object. - # No need to regex-escape $object, excess matching of '.' is harmless. - sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" "$tmpdepfile".bak - ;; - -cpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/reactos/lib/3rdparty/libxml2/dict.c b/reactos/lib/3rdparty/libxml2/dict.c index 9935a2554d9..5f71d55d736 100644 --- a/reactos/lib/3rdparty/libxml2/dict.c +++ b/reactos/lib/3rdparty/libxml2/dict.c @@ -143,7 +143,7 @@ static int xmlDictInitialized = 0; /* * Internal data for random function, protected by xmlDictMutex */ -unsigned int rand_seed = 0; +static unsigned int rand_seed = 0; #endif #endif @@ -151,13 +151,28 @@ unsigned int rand_seed = 0; * xmlInitializeDict: * * Do the dictionary mutex initialization. - * this function is not thread safe, initialization should - * preferably be done once at startup + * this function is deprecated * * Returns 0 if initialization was already done, and 1 if that * call led to the initialization */ int xmlInitializeDict(void) { + return(0); +} + +/** + * __xmlInitializeDict: + * + * This function is not public + * Do the dictionary mutex initialization. + * this function is not thread safe, initialization should + * normally be done once at setup when called from xmlOnceInit() + * we may also land in this code if thread support is not compiled in + * + * Returns 0 if initialization was already done, and 1 if that + * call led to the initialization + */ +int __xmlInitializeDict(void) { if (xmlDictInitialized) return(1); @@ -183,7 +198,7 @@ int __xmlRandom(void) { int ret; if (xmlDictInitialized == 0) - xmlInitializeDict(); + __xmlInitializeDict(); xmlRMutexLock(xmlDictMutex); #ifdef HAVE_RAND_R @@ -522,7 +537,7 @@ xmlDictCreate(void) { xmlDictPtr dict; if (!xmlDictInitialized) - if (!xmlInitializeDict()) + if (!__xmlInitializeDict()) return(NULL); #ifdef DICT_DEBUG_PATTERNS @@ -590,7 +605,7 @@ xmlDictCreateSub(xmlDictPtr sub) { int xmlDictReference(xmlDictPtr dict) { if (!xmlDictInitialized) - if (!xmlInitializeDict()) + if (!__xmlInitializeDict()) return(-1); if (dict == NULL) return -1; @@ -754,7 +769,7 @@ xmlDictFree(xmlDictPtr dict) { return; if (!xmlDictInitialized) - if (!xmlInitializeDict()) + if (!__xmlInitializeDict()) return; /* decrement the counter, it may be shared by a parser and docs */ diff --git a/reactos/lib/3rdparty/libxml2/elfgcchack.h b/reactos/lib/3rdparty/libxml2/elfgcchack.h index 84e81516a55..85c49d60b88 100644 --- a/reactos/lib/3rdparty/libxml2/elfgcchack.h +++ b/reactos/lib/3rdparty/libxml2/elfgcchack.h @@ -1343,6 +1343,68 @@ extern __typeof (xmlBoolToText) xmlBoolToText__internal_alias __attribute((visib #endif #endif +#ifdef bottom_buf +#undef xmlBufContent +extern __typeof (xmlBufContent) xmlBufContent __attribute((alias("xmlBufContent__internal_alias"))); +#else +#ifndef xmlBufContent +extern __typeof (xmlBufContent) xmlBufContent__internal_alias __attribute((visibility("hidden"))); +#define xmlBufContent xmlBufContent__internal_alias +#endif +#endif + +#ifdef bottom_buf +#undef xmlBufEnd +extern __typeof (xmlBufEnd) xmlBufEnd __attribute((alias("xmlBufEnd__internal_alias"))); +#else +#ifndef xmlBufEnd +extern __typeof (xmlBufEnd) xmlBufEnd__internal_alias __attribute((visibility("hidden"))); +#define xmlBufEnd xmlBufEnd__internal_alias +#endif +#endif + +#ifdef bottom_tree +#undef xmlBufGetNodeContent +extern __typeof (xmlBufGetNodeContent) xmlBufGetNodeContent __attribute((alias("xmlBufGetNodeContent__internal_alias"))); +#else +#ifndef xmlBufGetNodeContent +extern __typeof (xmlBufGetNodeContent) xmlBufGetNodeContent__internal_alias __attribute((visibility("hidden"))); +#define xmlBufGetNodeContent xmlBufGetNodeContent__internal_alias +#endif +#endif + +#if defined(LIBXML_OUTPUT_ENABLED) +#ifdef bottom_xmlsave +#undef xmlBufNodeDump +extern __typeof (xmlBufNodeDump) xmlBufNodeDump __attribute((alias("xmlBufNodeDump__internal_alias"))); +#else +#ifndef xmlBufNodeDump +extern __typeof (xmlBufNodeDump) xmlBufNodeDump__internal_alias __attribute((visibility("hidden"))); +#define xmlBufNodeDump xmlBufNodeDump__internal_alias +#endif +#endif +#endif + +#ifdef bottom_buf +#undef xmlBufShrink +extern __typeof (xmlBufShrink) xmlBufShrink __attribute((alias("xmlBufShrink__internal_alias"))); +#else +#ifndef xmlBufShrink +extern __typeof (xmlBufShrink) xmlBufShrink__internal_alias __attribute((visibility("hidden"))); +#define xmlBufShrink xmlBufShrink__internal_alias +#endif +#endif + +#ifdef bottom_buf +#undef xmlBufUse +extern __typeof (xmlBufUse) xmlBufUse __attribute((alias("xmlBufUse__internal_alias"))); +#else +#ifndef xmlBufUse +extern __typeof (xmlBufUse) xmlBufUse__internal_alias __attribute((visibility("hidden"))); +#define xmlBufUse xmlBufUse__internal_alias +#endif +#endif + #ifdef bottom_tree #undef xmlBufferAdd extern __typeof (xmlBufferAdd) xmlBufferAdd __attribute((alias("xmlBufferAdd__internal_alias"))); @@ -1423,6 +1485,16 @@ extern __typeof (xmlBufferCreateStatic) xmlBufferCreateStatic__internal_alias __ #endif #endif +#ifdef bottom_tree +#undef xmlBufferDetach +extern __typeof (xmlBufferDetach) xmlBufferDetach __attribute((alias("xmlBufferDetach__internal_alias"))); +#else +#ifndef xmlBufferDetach +extern __typeof (xmlBufferDetach) xmlBufferDetach__internal_alias __attribute((visibility("hidden"))); +#define xmlBufferDetach xmlBufferDetach__internal_alias +#endif +#endif + #ifdef bottom_tree #undef xmlBufferDump extern __typeof (xmlBufferDump) xmlBufferDump __attribute((alias("xmlBufferDump__internal_alias"))); @@ -2839,6 +2911,16 @@ extern __typeof (xmlDictFree) xmlDictFree__internal_alias __attribute((visibilit #endif #endif +#ifdef bottom_dict +#undef xmlDictGetUsage +extern __typeof (xmlDictGetUsage) xmlDictGetUsage __attribute((alias("xmlDictGetUsage__internal_alias"))); +#else +#ifndef xmlDictGetUsage +extern __typeof (xmlDictGetUsage) xmlDictGetUsage__internal_alias __attribute((visibility("hidden"))); +#define xmlDictGetUsage xmlDictGetUsage__internal_alias +#endif +#endif + #ifdef bottom_dict #undef xmlDictLookup extern __typeof (xmlDictLookup) xmlDictLookup __attribute((alias("xmlDictLookup__internal_alias"))); @@ -2879,6 +2961,16 @@ extern __typeof (xmlDictReference) xmlDictReference__internal_alias __attribute( #endif #endif +#ifdef bottom_dict +#undef xmlDictSetLimit +extern __typeof (xmlDictSetLimit) xmlDictSetLimit __attribute((alias("xmlDictSetLimit__internal_alias"))); +#else +#ifndef xmlDictSetLimit +extern __typeof (xmlDictSetLimit) xmlDictSetLimit__internal_alias __attribute((visibility("hidden"))); +#define xmlDictSetLimit xmlDictSetLimit__internal_alias +#endif +#endif + #ifdef bottom_dict #undef xmlDictSize extern __typeof (xmlDictSize) xmlDictSize __attribute((alias("xmlDictSize__internal_alias"))); @@ -4601,6 +4693,16 @@ extern __typeof (xmlInitializeCatalog) xmlInitializeCatalog__internal_alias __at #endif #endif +#ifdef bottom_dict +#undef xmlInitializeDict +extern __typeof (xmlInitializeDict) xmlInitializeDict __attribute((alias("xmlInitializeDict__internal_alias"))); +#else +#ifndef xmlInitializeDict +extern __typeof (xmlInitializeDict) xmlInitializeDict__internal_alias __attribute((visibility("hidden"))); +#define xmlInitializeDict xmlInitializeDict__internal_alias +#endif +#endif + #ifdef bottom_globals #undef xmlInitializeGlobalState extern __typeof (xmlInitializeGlobalState) xmlInitializeGlobalState __attribute((alias("xmlInitializeGlobalState__internal_alias"))); @@ -6755,6 +6857,30 @@ extern __typeof (xmlOutputBufferFlush) xmlOutputBufferFlush__internal_alias __at #endif #endif +#if defined(LIBXML_OUTPUT_ENABLED) +#ifdef bottom_xmlIO +#undef xmlOutputBufferGetContent +extern __typeof (xmlOutputBufferGetContent) xmlOutputBufferGetContent __attribute((alias("xmlOutputBufferGetContent__internal_alias"))); +#else +#ifndef xmlOutputBufferGetContent +extern __typeof (xmlOutputBufferGetContent) xmlOutputBufferGetContent__internal_alias __attribute((visibility("hidden"))); +#define xmlOutputBufferGetContent xmlOutputBufferGetContent__internal_alias +#endif +#endif +#endif + +#if defined(LIBXML_OUTPUT_ENABLED) +#ifdef bottom_xmlIO +#undef xmlOutputBufferGetSize +extern __typeof (xmlOutputBufferGetSize) xmlOutputBufferGetSize __attribute((alias("xmlOutputBufferGetSize__internal_alias"))); +#else +#ifndef xmlOutputBufferGetSize +extern __typeof (xmlOutputBufferGetSize) xmlOutputBufferGetSize__internal_alias __attribute((visibility("hidden"))); +#define xmlOutputBufferGetSize xmlOutputBufferGetSize__internal_alias +#endif +#endif +#endif + #if defined(LIBXML_OUTPUT_ENABLED) #ifdef bottom_xmlIO #undef xmlOutputBufferWrite @@ -10041,6 +10167,30 @@ extern __typeof (xmlSchemaValidatePredefinedType) xmlSchemaValidatePredefinedTyp #endif #endif +#if defined(LIBXML_SCHEMAS_ENABLED) +#ifdef bottom_xmlschemas +#undef xmlSchemaValidateSetFilename +extern __typeof (xmlSchemaValidateSetFilename) xmlSchemaValidateSetFilename __attribute((alias("xmlSchemaValidateSetFilename__internal_alias"))); +#else +#ifndef xmlSchemaValidateSetFilename +extern __typeof (xmlSchemaValidateSetFilename) xmlSchemaValidateSetFilename__internal_alias __attribute((visibility("hidden"))); +#define xmlSchemaValidateSetFilename xmlSchemaValidateSetFilename__internal_alias +#endif +#endif +#endif + +#if defined(LIBXML_SCHEMAS_ENABLED) +#ifdef bottom_xmlschemas +#undef xmlSchemaValidateSetLocator +extern __typeof (xmlSchemaValidateSetLocator) xmlSchemaValidateSetLocator __attribute((alias("xmlSchemaValidateSetLocator__internal_alias"))); +#else +#ifndef xmlSchemaValidateSetLocator +extern __typeof (xmlSchemaValidateSetLocator) xmlSchemaValidateSetLocator__internal_alias __attribute((visibility("hidden"))); +#define xmlSchemaValidateSetLocator xmlSchemaValidateSetLocator__internal_alias +#endif +#endif +#endif + #if defined(LIBXML_SCHEMAS_ENABLED) #ifdef bottom_xmlschemas #undef xmlSchemaValidateStream @@ -11713,6 +11863,18 @@ extern __typeof (xmlTextReaderRelaxNGValidate) xmlTextReaderRelaxNGValidate__int #endif #endif +#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) +#ifdef bottom_xmlreader +#undef xmlTextReaderRelaxNGValidateCtxt +extern __typeof (xmlTextReaderRelaxNGValidateCtxt) xmlTextReaderRelaxNGValidateCtxt __attribute((alias("xmlTextReaderRelaxNGValidateCtxt__internal_alias"))); +#else +#ifndef xmlTextReaderRelaxNGValidateCtxt +extern __typeof (xmlTextReaderRelaxNGValidateCtxt) xmlTextReaderRelaxNGValidateCtxt__internal_alias __attribute((visibility("hidden"))); +#define xmlTextReaderRelaxNGValidateCtxt xmlTextReaderRelaxNGValidateCtxt__internal_alias +#endif +#endif +#endif + #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) #ifdef bottom_xmlreader #undef xmlTextReaderSchemaValidate @@ -12001,6 +12163,18 @@ extern __typeof (xmlTextWriterSetIndentString) xmlTextWriterSetIndentString__int #endif #endif +#if defined(LIBXML_WRITER_ENABLED) +#ifdef bottom_xmlwriter +#undef xmlTextWriterSetQuoteChar +extern __typeof (xmlTextWriterSetQuoteChar) xmlTextWriterSetQuoteChar __attribute((alias("xmlTextWriterSetQuoteChar__internal_alias"))); +#else +#ifndef xmlTextWriterSetQuoteChar +extern __typeof (xmlTextWriterSetQuoteChar) xmlTextWriterSetQuoteChar__internal_alias __attribute((visibility("hidden"))); +#define xmlTextWriterSetQuoteChar xmlTextWriterSetQuoteChar__internal_alias +#endif +#endif +#endif + #if defined(LIBXML_WRITER_ENABLED) #ifdef bottom_xmlwriter #undef xmlTextWriterStartAttribute diff --git a/reactos/lib/3rdparty/libxml2/enc.h b/reactos/lib/3rdparty/libxml2/enc.h index 91977604414..057d206df8a 100644 --- a/reactos/lib/3rdparty/libxml2/enc.h +++ b/reactos/lib/3rdparty/libxml2/enc.h @@ -21,7 +21,7 @@ extern "C" { int xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out, xmlBufferPtr in, int len); int xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len); -int xmlCharEncInput(xmlParserInputBufferPtr input); +int xmlCharEncInput(xmlParserInputBufferPtr input, int flush); int xmlCharEncOutput(xmlOutputBufferPtr output, int init); #ifdef __cplusplus diff --git a/reactos/lib/3rdparty/libxml2/encoding.c b/reactos/lib/3rdparty/libxml2/encoding.c index 87b1d9b84fe..7330e9082a5 100644 --- a/reactos/lib/3rdparty/libxml2/encoding.c +++ b/reactos/lib/3rdparty/libxml2/encoding.c @@ -1517,6 +1517,8 @@ xmlGetCharEncodingHandler(xmlCharEncoding enc) { if (handler != NULL) return(handler); handler = xmlFindCharEncodingHandler("EBCDIC-US"); if (handler != NULL) return(handler); + handler = xmlFindCharEncodingHandler("IBM-037"); + if (handler != NULL) return(handler); break; case XML_CHAR_ENCODING_UCS4BE: handler = xmlFindCharEncodingHandler("ISO-10646-UCS-4"); @@ -2161,6 +2163,7 @@ xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len) /** * xmlCharEncInput: * @input: a parser input buffer + * @flush: try to flush all the raw buffer * * Generic front-end for the encoding handler on parser input * @@ -2170,7 +2173,7 @@ xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len) * the result of transformation can't fit into the encoding we want), or */ int -xmlCharEncInput(xmlParserInputBufferPtr input) +xmlCharEncInput(xmlParserInputBufferPtr input, int flush) { int ret = -2; size_t written; @@ -2189,7 +2192,7 @@ xmlCharEncInput(xmlParserInputBufferPtr input) toconv = xmlBufUse(in); if (toconv == 0) return (0); - if (toconv > 64 * 1024) + if ((toconv > 64 * 1024) && (flush == 0)) toconv = 64 * 1024; written = xmlBufAvail(out); if (written > 0) @@ -2200,7 +2203,7 @@ xmlCharEncInput(xmlParserInputBufferPtr input) if (written > 0) written--; /* count '\0' */ } - if (written > 128 * 1024) + if ((written > 128 * 1024) && (flush == 0)) written = 128 * 1024; c_in = toconv; diff --git a/reactos/lib/3rdparty/libxml2/genUnicode.py b/reactos/lib/3rdparty/libxml2/genUnicode.py deleted file mode 100644 index 56e4e9ba2ab..00000000000 --- a/reactos/lib/3rdparty/libxml2/genUnicode.py +++ /dev/null @@ -1,478 +0,0 @@ -#!/usr/bin/python -u -# -# Original script modified in November 2003 to take advantage of -# the character-validation range routines, and updated to the -# current Unicode information (Version 4.0.1) -# -# NOTE: there is an 'alias' facility for blocks which are not present in -# the current release, but are needed for ABI compatibility. This -# must be accomplished MANUALLY! Please see the comments below under -# 'blockAliases' -# -import sys -import string -import time - -webpage = "http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html" -sources = "Blocks-4.0.1.txt UnicodeData-4.0.1.txt" - -# -# blockAliases is a small hack - it is used for mapping block names which -# were were used in the 3.1 release, but are missing or changed in the current -# release. The format is "OldBlockName:NewBlockName1[,NewBlockName2[,...]]" -blockAliases = [] -blockAliases.append("CombiningMarksforSymbols:CombiningDiacriticalMarksforSymbols") -blockAliases.append("Greek:GreekandCoptic") -blockAliases.append("PrivateUse:PrivateUseArea,SupplementaryPrivateUseArea-A," + - "SupplementaryPrivateUseArea-B") - -# minTableSize gives the minimum number of ranges which must be present -# before a range table is produced. If there are less than this -# number, inline comparisons are generated -minTableSize = 8 - -(blockfile, catfile) = string.split(sources) - - -# -# Now process the "blocks" file, reducing it to a dictionary -# indexed by blockname, containing a tuple with the applicable -# block range -# -BlockNames = {} -try: - blocks = open(blockfile, "r") -except: - print "Missing %s, aborting ..." % blockfile - sys.exit(1) - -for line in blocks.readlines(): - if line[0] == '#': - continue - line = string.strip(line) - if line == '': - continue - try: - fields = string.split(line, ';') - range = string.strip(fields[0]) - (start, end) = string.split(range, "..") - name = string.strip(fields[1]) - name = string.replace(name, ' ', '') - except: - print "Failed to process line: %s" % (line) - continue - start = "0x" + start - end = "0x" + end - try: - BlockNames[name].append((start, end)) - except: - BlockNames[name] = [(start, end)] -blocks.close() -print "Parsed %d blocks descriptions" % (len(BlockNames.keys())) - -for block in blockAliases: - alias = string.split(block,':') - alist = string.split(alias[1],',') - for comp in alist: - if BlockNames.has_key(comp): - if alias[0] not in BlockNames: - BlockNames[alias[0]] = [] - for r in BlockNames[comp]: - BlockNames[alias[0]].append(r) - else: - print "Alias %s: %s not in Blocks" % (alias[0], comp) - continue - -# -# Next process the Categories file. This is more complex, since -# the file is in code sequence, and we need to invert it. We use -# a dictionary with index category-name, with each entry containing -# all the ranges (codepoints) of that category. Note that category -# names comprise two parts - the general category, and the "subclass" -# within that category. Therefore, both "general category" (which is -# the first character of the 2-character category-name) and the full -# (2-character) name are entered into this dictionary. -# -try: - data = open(catfile, "r") -except: - print "Missing %s, aborting ..." % catfile - sys.exit(1) - -nbchar = 0; -Categories = {} -for line in data.readlines(): - if line[0] == '#': - continue - line = string.strip(line) - if line == '': - continue - try: - fields = string.split(line, ';') - point = string.strip(fields[0]) - value = 0 - while point != '': - value = value * 16 - if point[0] >= '0' and point[0] <= '9': - value = value + ord(point[0]) - ord('0') - elif point[0] >= 'A' and point[0] <= 'F': - value = value + 10 + ord(point[0]) - ord('A') - elif point[0] >= 'a' and point[0] <= 'f': - value = value + 10 + ord(point[0]) - ord('a') - point = point[1:] - name = fields[2] - except: - print "Failed to process line: %s" % (line) - continue - - nbchar = nbchar + 1 - # update entry for "full name" - try: - Categories[name].append(value) - except: - try: - Categories[name] = [value] - except: - print "Failed to process line: %s" % (line) - # update "general category" name - try: - Categories[name[0]].append(value) - except: - try: - Categories[name[0]] = [value] - except: - print "Failed to process line: %s" % (line) - -blocks.close() -print "Parsed %d char generating %d categories" % (nbchar, len(Categories.keys())) - -# -# The data is now all read. Time to process it into a more useful form. -# -# reduce the number list into ranges -for cat in Categories.keys(): - list = Categories[cat] - start = -1 - prev = -1 - end = -1 - ranges = [] - for val in list: - if start == -1: - start = val - prev = val - continue - elif val == prev + 1: - prev = val - continue - elif prev == start: - ranges.append((prev, prev)) - start = val - prev = val - continue - else: - ranges.append((start, prev)) - start = val - prev = val - continue - if prev == start: - ranges.append((prev, prev)) - else: - ranges.append((start, prev)) - Categories[cat] = ranges - -# -# Assure all data is in alphabetic order, since we will be doing binary -# searches on the tables. -# -bkeys = BlockNames.keys() -bkeys.sort() - -ckeys = Categories.keys() -ckeys.sort() - -# -# Generate the resulting files -# -try: - header = open("include/libxml/xmlunicode.h", "w") -except: - print "Failed to open include/libxml/xmlunicode.h" - sys.exit(1) - -try: - output = open("xmlunicode.c", "w") -except: - print "Failed to open xmlunicode.c" - sys.exit(1) - -date = time.asctime(time.localtime(time.time())) - -header.write( -"""/* - * Summary: Unicode character APIs - * Description: API for the Unicode character APIs - * - * This file is automatically generated from the - * UCS description files of the Unicode Character Database - * %s - * using the genUnicode.py Python script. - * - * Generation date: %s - * Sources: %s - * Author: Daniel Veillard - */ - -#ifndef __XML_UNICODE_H__ -#define __XML_UNICODE_H__ - -#include - -#ifdef LIBXML_UNICODE_ENABLED - -#ifdef __cplusplus -extern "C" { -#endif - -""" % (webpage, date, sources)); - -output.write( -"""/* - * xmlunicode.c: this module implements the Unicode character APIs - * - * This file is automatically generated from the - * UCS description files of the Unicode Character Database - * %s - * using the genUnicode.py Python script. - * - * Generation date: %s - * Sources: %s - * Daniel Veillard - */ - -#define IN_LIBXML -#include "libxml.h" - -#ifdef LIBXML_UNICODE_ENABLED - -#include -#include -#include -#include - -typedef int (xmlIntFunc)(int); /* just to keep one's mind untwisted */ - -typedef struct { - const char *rangename; - xmlIntFunc *func; -} xmlUnicodeRange; - -typedef struct { - xmlUnicodeRange *table; - int numentries; -} xmlUnicodeNameTable; - - -static xmlIntFunc *xmlUnicodeLookup(xmlUnicodeNameTable *tptr, const char *tname); - -static xmlUnicodeRange xmlUnicodeBlocks[] = { -""" % (webpage, date, sources)); - -flag = 0 -for block in bkeys: - name = string.replace(block, '-', '') - if flag: - output.write(',\n') - else: - flag = 1 - output.write(' {"%s", xmlUCSIs%s}' % (block, name)) -output.write('};\n\n') - -output.write('static xmlUnicodeRange xmlUnicodeCats[] = {\n') -flag = 0; -for name in ckeys: - if flag: - output.write(',\n') - else: - flag = 1 - output.write(' {"%s", xmlUCSIsCat%s}' % (name, name)) -output.write('};\n\n') - -# -# For any categories with more than minTableSize ranges we generate -# a range table suitable for xmlCharInRange -# -for name in ckeys: - if len(Categories[name]) > minTableSize: - numshort = 0 - numlong = 0 - ranges = Categories[name] - sptr = "NULL" - lptr = "NULL" - for range in ranges: - (low, high) = range - if high < 0x10000: - if numshort == 0: - pline = "static const xmlChSRange xml%sS[] = {" % name - sptr = "xml%sS" % name - else: - pline += ", " - numshort += 1 - else: - if numlong == 0: - if numshort > 0: - output.write(pline + " };\n") - pline = "static const xmlChLRange xml%sL[] = {" % name - lptr = "xml%sL" % name - else: - pline += ", " - numlong += 1 - if len(pline) > 60: - output.write(pline + "\n") - pline = " " - pline += "{%s, %s}" % (hex(low), hex(high)) - output.write(pline + " };\nstatic xmlChRangeGroup xml%sG = {%s,%s,%s,%s};\n\n" - % (name, numshort, numlong, sptr, lptr)) - - -output.write( -"""static xmlUnicodeNameTable xmlUnicodeBlockTbl = {xmlUnicodeBlocks, %s}; -static xmlUnicodeNameTable xmlUnicodeCatTbl = {xmlUnicodeCats, %s}; - -/** - * xmlUnicodeLookup: - * @tptr: pointer to the name table - * @name: name to be found - * - * binary table lookup for user-supplied name - * - * Returns pointer to range function if found, otherwise NULL - */ -static xmlIntFunc -*xmlUnicodeLookup(xmlUnicodeNameTable *tptr, const char *tname) { - int low, high, mid, cmp; - xmlUnicodeRange *sptr; - - if ((tptr == NULL) || (tname == NULL)) return(NULL); - - low = 0; - high = tptr->numentries - 1; - sptr = tptr->table; - while (low <= high) { - mid = (low + high) / 2; - if ((cmp=strcmp(tname, sptr[mid].rangename)) == 0) - return (sptr[mid].func); - if (cmp < 0) - high = mid - 1; - else - low = mid + 1; - } - return (NULL); -} - -""" % (len(BlockNames), len(Categories)) ) - -for block in bkeys: - name = string.replace(block, '-', '') - header.write("XMLPUBFUN int XMLCALL xmlUCSIs%s\t(int code);\n" % name) - output.write("/**\n * xmlUCSIs%s:\n * @code: UCS code point\n" % (name)) - output.write(" *\n * Check whether the character is part of %s UCS Block\n"% - (block)) - output.write(" *\n * Returns 1 if true 0 otherwise\n */\n"); - output.write("int\nxmlUCSIs%s(int code) {\n return(" % name) - flag = 0 - for (start, end) in BlockNames[block]: - if flag: - output.write(" ||\n ") - else: - flag = 1 - output.write("((code >= %s) && (code <= %s))" % (start, end)) - output.write(");\n}\n\n") - -header.write("\nXMLPUBFUN int XMLCALL xmlUCSIsBlock\t(int code, const char *block);\n\n") -output.write( -"""/** - * xmlUCSIsBlock: - * @code: UCS code point - * @block: UCS block name - * - * Check whether the character is part of the UCS Block - * - * Returns 1 if true, 0 if false and -1 on unknown block - */ -int -xmlUCSIsBlock(int code, const char *block) { - xmlIntFunc *func; - - func = xmlUnicodeLookup(&xmlUnicodeBlockTbl, block); - if (func == NULL) - return (-1); - return (func(code)); -} - -""") - -for name in ckeys: - ranges = Categories[name] - header.write("XMLPUBFUN int XMLCALL xmlUCSIsCat%s\t(int code);\n" % name) - output.write("/**\n * xmlUCSIsCat%s:\n * @code: UCS code point\n" % (name)) - output.write(" *\n * Check whether the character is part of %s UCS Category\n"% - (name)) - output.write(" *\n * Returns 1 if true 0 otherwise\n */\n"); - output.write("int\nxmlUCSIsCat%s(int code) {\n" % name) - if len(Categories[name]) > minTableSize: - output.write(" return(xmlCharInRange((unsigned int)code, &xml%sG)" - % name) - else: - start = 1 - for range in ranges: - (begin, end) = range; - if start: - output.write(" return("); - start = 0 - else: - output.write(" ||\n "); - if (begin == end): - output.write("(code == %s)" % (hex(begin))) - else: - output.write("((code >= %s) && (code <= %s))" % ( - hex(begin), hex(end))) - output.write(");\n}\n\n") - -header.write("\nXMLPUBFUN int XMLCALL xmlUCSIsCat\t(int code, const char *cat);\n") -output.write( -"""/** - * xmlUCSIsCat: - * @code: UCS code point - * @cat: UCS Category name - * - * Check whether the character is part of the UCS Category - * - * Returns 1 if true, 0 if false and -1 on unknown category - */ -int -xmlUCSIsCat(int code, const char *cat) { - xmlIntFunc *func; - - func = xmlUnicodeLookup(&xmlUnicodeCatTbl, cat); - if (func == NULL) - return (-1); - return (func(code)); -} - -#define bottom_xmlunicode -#include "elfgcchack.h" -#endif /* LIBXML_UNICODE_ENABLED */ -""") - -header.write(""" -#ifdef __cplusplus -} -#endif - -#endif /* LIBXML_UNICODE_ENABLED */ - -#endif /* __XML_UNICODE_H__ */ -"""); - -header.close() -output.close() diff --git a/reactos/lib/3rdparty/libxml2/gentest.py b/reactos/lib/3rdparty/libxml2/gentest.py deleted file mode 100644 index f1786205020..00000000000 --- a/reactos/lib/3rdparty/libxml2/gentest.py +++ /dev/null @@ -1,963 +0,0 @@ -#!/usr/bin/python -u -# -# generate a tester program for the API -# -import sys -import os -import string -try: - import libxml2 -except: - print "libxml2 python bindings not available, skipping testapi.c generation" - sys.exit(0) - -if len(sys.argv) > 1: - srcPref = sys.argv[1] + '/' -else: - srcPref = '' - -# -# Modules we want to skip in API test -# -skipped_modules = [ "SAX", "xlink", "threads", "globals", - "xmlmemory", "xmlversion", "xmlexports", - #deprecated - "DOCBparser", -] - -# -# defines for each module -# -modules_defines = { - "HTMLparser": "LIBXML_HTML_ENABLED", - "catalog": "LIBXML_CATALOG_ENABLED", - "xmlreader": "LIBXML_READER_ENABLED", - "relaxng": "LIBXML_SCHEMAS_ENABLED", - "schemasInternals": "LIBXML_SCHEMAS_ENABLED", - "xmlschemas": "LIBXML_SCHEMAS_ENABLED", - "xmlschemastypes": "LIBXML_SCHEMAS_ENABLED", - "xpath": "LIBXML_XPATH_ENABLED", - "xpathInternals": "LIBXML_XPATH_ENABLED", - "xinclude": "LIBXML_XINCLUDE_ENABLED", - "xpointer": "LIBXML_XPTR_ENABLED", - "xmlregexp" : "LIBXML_REGEXP_ENABLED", - "xmlautomata" : "LIBXML_AUTOMATA_ENABLED", - "xmlsave" : "LIBXML_OUTPUT_ENABLED", - "DOCBparser" : "LIBXML_DOCB_ENABLED", - "xmlmodule" : "LIBXML_MODULES_ENABLED", - "pattern" : "LIBXML_PATTERN_ENABLED", - "schematron" : "LIBXML_SCHEMATRON_ENABLED", -} - -# -# defines for specific functions -# -function_defines = { - "htmlDefaultSAXHandlerInit": "LIBXML_HTML_ENABLED", - "xmlSAX2EndElement" : "LIBXML_SAX1_ENABLED", - "xmlSAX2StartElement" : "LIBXML_SAX1_ENABLED", - "xmlSAXDefaultVersion" : "LIBXML_SAX1_ENABLED", - "UTF8Toisolat1" : "LIBXML_OUTPUT_ENABLED", - "xmlCleanupPredefinedEntities": "LIBXML_LEGACY_ENABLED", - "xmlInitializePredefinedEntities": "LIBXML_LEGACY_ENABLED", - "xmlSetFeature": "LIBXML_LEGACY_ENABLED", - "xmlGetFeature": "LIBXML_LEGACY_ENABLED", - "xmlGetFeaturesList": "LIBXML_LEGACY_ENABLED", - "xmlIOParseDTD": "LIBXML_VALID_ENABLED", - "xmlParseDTD": "LIBXML_VALID_ENABLED", - "xmlParseDoc": "LIBXML_SAX1_ENABLED", - "xmlParseMemory": "LIBXML_SAX1_ENABLED", - "xmlRecoverDoc": "LIBXML_SAX1_ENABLED", - "xmlParseFile": "LIBXML_SAX1_ENABLED", - "xmlRecoverFile": "LIBXML_SAX1_ENABLED", - "xmlRecoverMemory": "LIBXML_SAX1_ENABLED", - "xmlSAXParseFileWithData": "LIBXML_SAX1_ENABLED", - "xmlSAXParseMemory": "LIBXML_SAX1_ENABLED", - "xmlSAXUserParseMemory": "LIBXML_SAX1_ENABLED", - "xmlSAXParseDoc": "LIBXML_SAX1_ENABLED", - "xmlSAXParseDTD": "LIBXML_SAX1_ENABLED", - "xmlSAXUserParseFile": "LIBXML_SAX1_ENABLED", - "xmlParseEntity": "LIBXML_SAX1_ENABLED", - "xmlParseExternalEntity": "LIBXML_SAX1_ENABLED", - "xmlSAXParseMemoryWithData": "LIBXML_SAX1_ENABLED", - "xmlParseBalancedChunkMemory": "LIBXML_SAX1_ENABLED", - "xmlParseBalancedChunkMemoryRecover": "LIBXML_SAX1_ENABLED", - "xmlSetupParserForBuffer": "LIBXML_SAX1_ENABLED", - "xmlStopParser": "LIBXML_PUSH_ENABLED", - "xmlAttrSerializeTxtContent": "LIBXML_OUTPUT_ENABLED", - "xmlSAXParseFile": "LIBXML_SAX1_ENABLED", - "xmlSAXParseEntity": "LIBXML_SAX1_ENABLED", - "xmlNewTextChild": "LIBXML_TREE_ENABLED", - "xmlNewDocRawNode": "LIBXML_TREE_ENABLED", - "xmlNewProp": "LIBXML_TREE_ENABLED", - "xmlReconciliateNs": "LIBXML_TREE_ENABLED", - "xmlValidateNCName": "LIBXML_TREE_ENABLED", - "xmlValidateNMToken": "LIBXML_TREE_ENABLED", - "xmlValidateName": "LIBXML_TREE_ENABLED", - "xmlNewChild": "LIBXML_TREE_ENABLED", - "xmlValidateQName": "LIBXML_TREE_ENABLED", - "xmlSprintfElementContent": "LIBXML_OUTPUT_ENABLED", - "xmlValidGetPotentialChildren" : "LIBXML_VALID_ENABLED", - "xmlValidGetValidElements" : "LIBXML_VALID_ENABLED", - "docbDefaultSAXHandlerInit" : "LIBXML_DOCB_ENABLED", - "xmlTextReaderPreservePattern" : "LIBXML_PATTERN_ENABLED", -} - -# -# Some functions really need to be skipped for the tests. -# -skipped_functions = [ -# block on I/O -"xmlFdRead", "xmlReadFd", "xmlCtxtReadFd", -"htmlFdRead", "htmlReadFd", "htmlCtxtReadFd", -"xmlReaderNewFd", "xmlReaderForFd", -"xmlIORead", "xmlReadIO", "xmlCtxtReadIO", -"htmlIORead", "htmlReadIO", "htmlCtxtReadIO", -"xmlReaderNewIO", "xmlBufferDump", "xmlNanoFTPConnect", -"xmlNanoFTPConnectTo", "xmlNanoHTTPMethod", "xmlNanoHTTPMethodRedir", -# Complex I/O APIs -"xmlCreateIOParserCtxt", "xmlParserInputBufferCreateIO", -"xmlRegisterInputCallbacks", "xmlReaderForIO", -"xmlOutputBufferCreateIO", "xmlRegisterOutputCallbacks", -"xmlSaveToIO", "xmlIOHTTPOpenW", -# library state cleanup, generate false leak informations and other -# troubles, heavillyb tested otherwise. -"xmlCleanupParser", "xmlRelaxNGCleanupTypes", "xmlSetListDoc", -"xmlSetTreeDoc", "xmlUnlinkNode", -# hard to avoid leaks in the tests -"xmlStrcat", "xmlStrncat", "xmlCatalogAddLocal", "xmlNewTextWriterDoc", -"xmlXPathNewValueTree", "xmlXPathWrapString", -# unimplemented -"xmlTextReaderReadInnerXml", "xmlTextReaderReadOuterXml", -"xmlTextReaderReadString", -# destructor -"xmlListDelete", "xmlOutputBufferClose", "xmlNanoFTPClose", "xmlNanoHTTPClose", -# deprecated -"xmlCatalogGetPublic", "xmlCatalogGetSystem", "xmlEncodeEntities", -"xmlNewGlobalNs", "xmlHandleEntity", "xmlNamespaceParseNCName", -"xmlNamespaceParseNSDef", "xmlNamespaceParseQName", -"xmlParseNamespace", "xmlParseQuotedString", "xmlParserHandleReference", -"xmlScanName", -"xmlDecodeEntities", -# allocators -"xmlMemFree", -# verbosity -"xmlCatalogSetDebug", "xmlShellPrintXPathError", "xmlShellPrintNode", -# Internal functions, no user space should really call them -"xmlParseAttribute", "xmlParseAttributeListDecl", "xmlParseName", -"xmlParseNmtoken", "xmlParseEntityValue", "xmlParseAttValue", -"xmlParseSystemLiteral", "xmlParsePubidLiteral", "xmlParseCharData", -"xmlParseExternalID", "xmlParseComment", "xmlParsePITarget", "xmlParsePI", -"xmlParseNotationDecl", "xmlParseEntityDecl", "xmlParseDefaultDecl", -"xmlParseNotationType", "xmlParseEnumerationType", "xmlParseEnumeratedType", -"xmlParseAttributeType", "xmlParseAttributeListDecl", -"xmlParseElementMixedContentDecl", "xmlParseElementChildrenContentDecl", -"xmlParseElementContentDecl", "xmlParseElementDecl", "xmlParseMarkupDecl", -"xmlParseCharRef", "xmlParseEntityRef", "xmlParseReference", -"xmlParsePEReference", "xmlParseDocTypeDecl", "xmlParseAttribute", -"xmlParseStartTag", "xmlParseEndTag", "xmlParseCDSect", "xmlParseContent", -"xmlParseElement", "xmlParseVersionNum", "xmlParseVersionInfo", -"xmlParseEncName", "xmlParseEncodingDecl", "xmlParseSDDecl", -"xmlParseXMLDecl", "xmlParseTextDecl", "xmlParseMisc", -"xmlParseExternalSubset", "xmlParserHandlePEReference", -"xmlSkipBlankChars", -] - -# -# These functions have side effects on the global state -# and hence generate errors on memory allocation tests -# -skipped_memcheck = [ "xmlLoadCatalog", "xmlAddEncodingAlias", - "xmlSchemaInitTypes", "xmlNanoFTPProxy", "xmlNanoFTPScanProxy", - "xmlNanoHTTPScanProxy", "xmlResetLastError", "xmlCatalogConvert", - "xmlCatalogRemove", "xmlLoadCatalogs", "xmlCleanupCharEncodingHandlers", - "xmlInitCharEncodingHandlers", "xmlCatalogCleanup", - "xmlSchemaGetBuiltInType", - "htmlParseFile", "htmlCtxtReadFile", # loads the catalogs - "xmlTextReaderSchemaValidate", "xmlSchemaCleanupTypes", # initialize the schemas type system - "xmlCatalogResolve", "xmlIOParseDTD" # loads the catalogs -] - -# -# Extra code needed for some test cases -# -extra_pre_call = { - "xmlSAXUserParseFile": """ -#ifdef LIBXML_SAX1_ENABLED - if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; -#endif -""", - "xmlSAXUserParseMemory": """ -#ifdef LIBXML_SAX1_ENABLED - if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; -#endif -""", - "xmlParseBalancedChunkMemory": """ -#ifdef LIBXML_SAX1_ENABLED - if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; -#endif -""", - "xmlParseBalancedChunkMemoryRecover": """ -#ifdef LIBXML_SAX1_ENABLED - if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; -#endif -""", - "xmlParserInputBufferCreateFd": - "if (fd >= 0) fd = -1;", -} -extra_post_call = { - "xmlAddChild": - "if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }", - "xmlAddEntity": - "if (ret_val != NULL) { xmlFreeNode(ret_val) ; ret_val = NULL; }", - "xmlAddChildList": - "if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }", - "xmlAddSibling": - "if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }", - "xmlAddNextSibling": - "if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }", - "xmlAddPrevSibling": - "if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; }", - "xmlDocSetRootElement": - "if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; }", - "xmlReplaceNode": - """if (cur != NULL) { - xmlUnlinkNode(cur); - xmlFreeNode(cur) ; cur = NULL ; } - if (old != NULL) { - xmlUnlinkNode(old); - xmlFreeNode(old) ; old = NULL ; } - ret_val = NULL;""", - "xmlTextMerge": - """if ((first != NULL) && (first->type != XML_TEXT_NODE)) { - xmlUnlinkNode(second); - xmlFreeNode(second) ; second = NULL ; }""", - "xmlBuildQName": - """if ((ret_val != NULL) && (ret_val != ncname) && - (ret_val != prefix) && (ret_val != memory)) - xmlFree(ret_val); - ret_val = NULL;""", - "xmlNewDocElementContent": - """xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;""", - "xmlDictReference": "xmlDictFree(dict);", - # Functions which deallocates one of their parameters - "xmlXPathConvertBoolean": """val = NULL;""", - "xmlXPathConvertNumber": """val = NULL;""", - "xmlXPathConvertString": """val = NULL;""", - "xmlSaveFileTo": """buf = NULL;""", - "xmlSaveFormatFileTo": """buf = NULL;""", - "xmlIOParseDTD": "input = NULL;", - "xmlRemoveProp": "cur = NULL;", - "xmlNewNs": "if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val);", - "xmlCopyNamespace": "if (ret_val != NULL) xmlFreeNs(ret_val);", - "xmlCopyNamespaceList": "if (ret_val != NULL) xmlFreeNsList(ret_val);", - "xmlNewTextWriter": "if (ret_val != NULL) out = NULL;", - "xmlNewTextWriterPushParser": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL;", - "xmlNewIOInputStream": "if (ret_val != NULL) input = NULL;", - "htmlParseChunk": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", - "htmlParseDocument": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", - "xmlParseDocument": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", - "xmlParseChunk": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", - "xmlParseExtParsedEnt": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", - "xmlDOMWrapAdoptNode": "if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}", - "xmlBufferSetAllocationScheme": "if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;}" -} - -modules = [] - -def is_skipped_module(name): - for mod in skipped_modules: - if mod == name: - return 1 - return 0 - -def is_skipped_function(name): - for fun in skipped_functions: - if fun == name: - return 1 - # Do not test destructors - if string.find(name, 'Free') != -1: - return 1 - return 0 - -def is_skipped_memcheck(name): - for fun in skipped_memcheck: - if fun == name: - return 1 - return 0 - -missing_types = {} -def add_missing_type(name, func): - try: - list = missing_types[name] - list.append(func) - except: - missing_types[name] = [func] - -generated_param_types = [] -def add_generated_param_type(name): - generated_param_types.append(name) - -generated_return_types = [] -def add_generated_return_type(name): - generated_return_types.append(name) - -missing_functions = {} -missing_functions_nr = 0 -def add_missing_functions(name, module): - global missing_functions_nr - - missing_functions_nr = missing_functions_nr + 1 - try: - list = missing_functions[module] - list.append(name) - except: - missing_functions[module] = [name] - -# -# Provide the type generators and destructors for the parameters -# - -def type_convert(str, name, info, module, function, pos): -# res = string.replace(str, " ", " ") -# res = string.replace(str, " ", " ") -# res = string.replace(str, " ", " ") - res = string.replace(str, " *", "_ptr") -# res = string.replace(str, "*", "_ptr") - res = string.replace(res, " ", "_") - if res == 'const_char_ptr': - if string.find(name, "file") != -1 or \ - string.find(name, "uri") != -1 or \ - string.find(name, "URI") != -1 or \ - string.find(info, "filename") != -1 or \ - string.find(info, "URI") != -1 or \ - string.find(info, "URL") != -1: - if string.find(function, "Save") != -1 or \ - string.find(function, "Create") != -1 or \ - string.find(function, "Write") != -1 or \ - string.find(function, "Fetch") != -1: - return('fileoutput') - return('filepath') - if res == 'void_ptr': - if module == 'nanoftp' and name == 'ctx': - return('xmlNanoFTPCtxtPtr') - if function == 'xmlNanoFTPNewCtxt' or \ - function == 'xmlNanoFTPConnectTo' or \ - function == 'xmlNanoFTPOpen': - return('xmlNanoFTPCtxtPtr') - if module == 'nanohttp' and name == 'ctx': - return('xmlNanoHTTPCtxtPtr') - if function == 'xmlNanoHTTPMethod' or \ - function == 'xmlNanoHTTPMethodRedir' or \ - function == 'xmlNanoHTTPOpen' or \ - function == 'xmlNanoHTTPOpenRedir': - return('xmlNanoHTTPCtxtPtr'); - if function == 'xmlIOHTTPOpen': - return('xmlNanoHTTPCtxtPtr') - if string.find(name, "data") != -1: - return('userdata') - if string.find(name, "user") != -1: - return('userdata') - if res == 'xmlDoc_ptr': - res = 'xmlDocPtr' - if res == 'xmlNode_ptr': - res = 'xmlNodePtr' - if res == 'xmlDict_ptr': - res = 'xmlDictPtr' - if res == 'xmlNodePtr' and pos != 0: - if (function == 'xmlAddChild' and pos == 2) or \ - (function == 'xmlAddChildList' and pos == 2) or \ - (function == 'xmlAddNextSibling' and pos == 2) or \ - (function == 'xmlAddSibling' and pos == 2) or \ - (function == 'xmlDocSetRootElement' and pos == 2) or \ - (function == 'xmlReplaceNode' and pos == 2) or \ - (function == 'xmlTextMerge') or \ - (function == 'xmlAddPrevSibling' and pos == 2): - return('xmlNodePtr_in'); - if res == 'const xmlBufferPtr': - res = 'xmlBufferPtr' - if res == 'xmlChar_ptr' and name == 'name' and \ - string.find(function, "EatName") != -1: - return('eaten_name') - if res == 'void_ptr*': - res = 'void_ptr_ptr' - if res == 'char_ptr*': - res = 'char_ptr_ptr' - if res == 'xmlChar_ptr*': - res = 'xmlChar_ptr_ptr' - if res == 'const_xmlChar_ptr*': - res = 'const_xmlChar_ptr_ptr' - if res == 'const_char_ptr*': - res = 'const_char_ptr_ptr' - if res == 'FILE_ptr' and module == 'debugXML': - res = 'debug_FILE_ptr'; - if res == 'int' and name == 'options': - if module == 'parser' or module == 'xmlreader': - res = 'parseroptions' - - return res - -known_param_types = [] - -def is_known_param_type(name, rtype): - global test - for type in known_param_types: - if type == name: - return 1 - for type in generated_param_types: - if type == name: - return 1 - - if name[-3:] == 'Ptr' or name[-4:] == '_ptr': - if rtype[0:6] == 'const ': - crtype = rtype[6:] - else: - crtype = rtype - - define = 0 - if modules_defines.has_key(module): - test.write("#ifdef %s\n" % (modules_defines[module])) - define = 1 - test.write(""" -#define gen_nb_%s 1 -static %s gen_%s(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_%s(int no ATTRIBUTE_UNUSED, %s val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -""" % (name, crtype, name, name, rtype)) - if define == 1: - test.write("#endif\n\n") - add_generated_param_type(name) - return 1 - - return 0 - -# -# Provide the type destructors for the return values -# - -known_return_types = [] - -def is_known_return_type(name): - for type in known_return_types: - if type == name: - return 1 - return 0 - -# -# Copy the beginning of the C test program result -# - -try: - input = open("testapi.c", "r") -except: - input = open(srcPref + "testapi.c", "r") -test = open('testapi.c.new', 'w') - -def compare_and_save(): - global test - - test.close() - try: - input = open("testapi.c", "r").read() - except: - input = '' - test = open('testapi.c.new', "r").read() - if input != test: - try: - os.system("rm testapi.c; mv testapi.c.new testapi.c") - except: - os.system("mv testapi.c.new testapi.c") - print("Updated testapi.c") - else: - print("Generated testapi.c is identical") - -line = input.readline() -while line != "": - if line == "/* CUT HERE: everything below that line is generated */\n": - break; - if line[0:15] == "#define gen_nb_": - type = string.split(line[15:])[0] - known_param_types.append(type) - if line[0:19] == "static void desret_": - type = string.split(line[19:], '(')[0] - known_return_types.append(type) - test.write(line) - line = input.readline() -input.close() - -if line == "": - print "Could not find the CUT marker in testapi.c skipping generation" - test.close() - sys.exit(0) - -print("Scanned testapi.c: found %d parameters types and %d return types\n" % ( - len(known_param_types), len(known_return_types))) -test.write("/* CUT HERE: everything below that line is generated */\n") - - -# -# Open the input API description -# -doc = libxml2.readFile(srcPref + 'doc/libxml2-api.xml', None, 0) -if doc == None: - print "Failed to load doc/libxml2-api.xml" - sys.exit(1) -ctxt = doc.xpathNewContext() - -# -# Generate a list of all function parameters and select only -# those used in the api tests -# -argtypes = {} -args = ctxt.xpathEval("/api/symbols/function/arg") -for arg in args: - mod = arg.xpathEval('string(../@file)') - func = arg.xpathEval('string(../@name)') - if (mod not in skipped_modules) and (func not in skipped_functions): - type = arg.xpathEval('string(@type)') - if not argtypes.has_key(type): - argtypes[type] = func - -# similarly for return types -rettypes = {} -rets = ctxt.xpathEval("/api/symbols/function/return") -for ret in rets: - mod = ret.xpathEval('string(../@file)') - func = ret.xpathEval('string(../@name)') - if (mod not in skipped_modules) and (func not in skipped_functions): - type = ret.xpathEval('string(@type)') - if not rettypes.has_key(type): - rettypes[type] = func - -# -# Generate constructors and return type handling for all enums -# which are used as function parameters -# -enums = ctxt.xpathEval("/api/symbols/typedef[@type='enum']") -for enum in enums: - module = enum.xpathEval('string(@file)') - name = enum.xpathEval('string(@name)') - # - # Skip any enums which are not in our filtered lists - # - if (name == None) or ((name not in argtypes) and (name not in rettypes)): - continue; - define = 0 - - if argtypes.has_key(name) and is_known_param_type(name, name) == 0: - values = ctxt.xpathEval("/api/symbols/enum[@type='%s']" % name) - i = 0 - vals = [] - for value in values: - vname = value.xpathEval('string(@name)') - if vname == None: - continue; - i = i + 1 - if i >= 5: - break; - vals.append(vname) - if vals == []: - print "Didn't find any value for enum %s" % (name) - continue - if modules_defines.has_key(module): - test.write("#ifdef %s\n" % (modules_defines[module])) - define = 1 - test.write("#define gen_nb_%s %d\n" % (name, len(vals))) - test.write("""static %s gen_%s(int no, int nr ATTRIBUTE_UNUSED) {\n""" % - (name, name)) - i = 1 - for value in vals: - test.write(" if (no == %d) return(%s);\n" % (i, value)) - i = i + 1 - test.write(""" return(0); -} - -static void des_%s(int no ATTRIBUTE_UNUSED, %s val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -""" % (name, name)); - known_param_types.append(name) - - if (is_known_return_type(name) == 0) and (name in rettypes): - if define == 0 and modules_defines.has_key(module): - test.write("#ifdef %s\n" % (modules_defines[module])) - define = 1 - test.write("""static void desret_%s(%s val ATTRIBUTE_UNUSED) { -} - -""" % (name, name)) - known_return_types.append(name) - if define == 1: - test.write("#endif\n\n") - -# -# Load the interfaces -# -headers = ctxt.xpathEval("/api/files/file") -for file in headers: - name = file.xpathEval('string(@name)') - if (name == None) or (name == ''): - continue - - # - # Some module may be skipped because they don't really consists - # of user callable APIs - # - if is_skipped_module(name): - continue - - # - # do not test deprecated APIs - # - desc = file.xpathEval('string(description)') - if string.find(desc, 'DEPRECATED') != -1: - print "Skipping deprecated interface %s" % name - continue; - - test.write("#include \n" % name) - modules.append(name) - -# -# Generate the callers signatures -# -for module in modules: - test.write("static int test_%s(void);\n" % module); - -# -# Generate the top caller -# - -test.write(""" -/** - * testlibxml2: - * - * Main entry point of the tester for the full libxml2 module, - * it calls all the tester entry point for each module. - * - * Returns the number of error found - */ -static int -testlibxml2(void) -{ - int test_ret = 0; - -""") - -for module in modules: - test.write(" test_ret += test_%s();\n" % module) - -test.write(""" - printf("Total: %d functions, %d tests, %d errors\\n", - function_tests, call_tests, test_ret); - return(test_ret); -} - -""") - -# -# How to handle a function -# -nb_tests = 0 - -def generate_test(module, node): - global test - global nb_tests - nb_cond = 0 - no_gen = 0 - - name = node.xpathEval('string(@name)') - if is_skipped_function(name): - return - - # - # check we know how to handle the args and return values - # and store the informations for the generation - # - try: - args = node.xpathEval("arg") - except: - args = [] - t_args = [] - n = 0 - for arg in args: - n = n + 1 - rtype = arg.xpathEval("string(@type)") - if rtype == 'void': - break; - info = arg.xpathEval("string(@info)") - nam = arg.xpathEval("string(@name)") - type = type_convert(rtype, nam, info, module, name, n) - if is_known_param_type(type, rtype) == 0: - add_missing_type(type, name); - no_gen = 1 - if (type[-3:] == 'Ptr' or type[-4:] == '_ptr') and \ - rtype[0:6] == 'const ': - crtype = rtype[6:] - else: - crtype = rtype - t_args.append((nam, type, rtype, crtype, info)) - - try: - rets = node.xpathEval("return") - except: - rets = [] - t_ret = None - for ret in rets: - rtype = ret.xpathEval("string(@type)") - info = ret.xpathEval("string(@info)") - type = type_convert(rtype, 'return', info, module, name, 0) - if rtype == 'void': - break - if is_known_return_type(type) == 0: - add_missing_type(type, name); - no_gen = 1 - t_ret = (type, rtype, info) - break - - test.write(""" -static int -test_%s(void) { - int test_ret = 0; - -""" % (name)) - - if no_gen == 1: - add_missing_functions(name, module) - test.write(""" - /* missing type support */ - return(test_ret); -} - -""") - return - - try: - conds = node.xpathEval("cond") - for cond in conds: - test.write("#if %s\n" % (cond.get_content())) - nb_cond = nb_cond + 1 - except: - pass - - define = 0 - if function_defines.has_key(name): - test.write("#ifdef %s\n" % (function_defines[name])) - define = 1 - - # Declare the memory usage counter - no_mem = is_skipped_memcheck(name) - if no_mem == 0: - test.write(" int mem_base;\n"); - - # Declare the return value - if t_ret != None: - test.write(" %s ret_val;\n" % (t_ret[1])) - - # Declare the arguments - for arg in t_args: - (nam, type, rtype, crtype, info) = arg; - # add declaration - test.write(" %s %s; /* %s */\n" % (crtype, nam, info)) - test.write(" int n_%s;\n" % (nam)) - test.write("\n") - - # Cascade loop on of each argument list of values - for arg in t_args: - (nam, type, rtype, crtype, info) = arg; - # - test.write(" for (n_%s = 0;n_%s < gen_nb_%s;n_%s++) {\n" % ( - nam, nam, type, nam)) - - # log the memory usage - if no_mem == 0: - test.write(" mem_base = xmlMemBlocks();\n"); - - # prepare the call - i = 0; - for arg in t_args: - (nam, type, rtype, crtype, info) = arg; - # - test.write(" %s = gen_%s(n_%s, %d);\n" % (nam, type, nam, i)) - i = i + 1; - - # do the call, and clanup the result - if extra_pre_call.has_key(name): - test.write(" %s\n"% (extra_pre_call[name])) - if t_ret != None: - test.write("\n ret_val = %s(" % (name)) - need = 0 - for arg in t_args: - (nam, type, rtype, crtype, info) = arg - if need: - test.write(", ") - else: - need = 1 - if rtype != crtype: - test.write("(%s)" % rtype) - test.write("%s" % nam); - test.write(");\n") - if extra_post_call.has_key(name): - test.write(" %s\n"% (extra_post_call[name])) - test.write(" desret_%s(ret_val);\n" % t_ret[0]) - else: - test.write("\n %s(" % (name)); - need = 0; - for arg in t_args: - (nam, type, rtype, crtype, info) = arg; - if need: - test.write(", ") - else: - need = 1 - if rtype != crtype: - test.write("(%s)" % rtype) - test.write("%s" % nam) - test.write(");\n") - if extra_post_call.has_key(name): - test.write(" %s\n"% (extra_post_call[name])) - - test.write(" call_tests++;\n"); - - # Free the arguments - i = 0; - for arg in t_args: - (nam, type, rtype, crtype, info) = arg; - # This is a hack to prevent generating a destructor for the - # 'input' argument in xmlTextReaderSetup. There should be - # a better, more generic way to do this! - if string.find(info, 'destroy') == -1: - test.write(" des_%s(n_%s, " % (type, nam)) - if rtype != crtype: - test.write("(%s)" % rtype) - test.write("%s, %d);\n" % (nam, i)) - i = i + 1; - - test.write(" xmlResetLastError();\n"); - # Check the memory usage - if no_mem == 0: - test.write(""" if (mem_base != xmlMemBlocks()) { - printf("Leak of %%d blocks found in %s", - xmlMemBlocks() - mem_base); - test_ret++; -""" % (name)); - for arg in t_args: - (nam, type, rtype, crtype, info) = arg; - test.write(""" printf(" %%d", n_%s);\n""" % (nam)) - test.write(""" printf("\\n");\n""") - test.write(" }\n") - - for arg in t_args: - test.write(" }\n") - - test.write(" function_tests++;\n") - # - # end of conditional - # - while nb_cond > 0: - test.write("#endif\n") - nb_cond = nb_cond -1 - if define == 1: - test.write("#endif\n") - - nb_tests = nb_tests + 1; - - test.write(""" - return(test_ret); -} - -""") - -# -# Generate all module callers -# -for module in modules: - # gather all the functions exported by that module - try: - functions = ctxt.xpathEval("/api/symbols/function[@file='%s']" % (module)) - except: - print "Failed to gather functions from module %s" % (module) - continue; - - # iterate over all functions in the module generating the test - i = 0 - nb_tests_old = nb_tests - for function in functions: - i = i + 1 - generate_test(module, function); - - # header - test.write("""static int -test_%s(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing %s : %d of %d functions ...\\n"); -""" % (module, module, nb_tests - nb_tests_old, i)) - - # iterate over all functions in the module generating the call - for function in functions: - name = function.xpathEval('string(@name)') - if is_skipped_function(name): - continue - test.write(" test_ret += test_%s();\n" % (name)) - - # footer - test.write(""" - if (test_ret != 0) - printf("Module %s: %%d errors\\n", test_ret); - return(test_ret); -} -""" % (module)) - -# -# Generate direct module caller -# -test.write("""static int -test_module(const char *module) { -"""); -for module in modules: - test.write(""" if (!strcmp(module, "%s")) return(test_%s());\n""" % ( - module, module)) -test.write(""" return(0); -} -"""); - -print "Generated test for %d modules and %d functions" %(len(modules), nb_tests) - -compare_and_save() - -missing_list = [] -for missing in missing_types.keys(): - if missing == 'va_list' or missing == '...': - continue; - - n = len(missing_types[missing]) - missing_list.append((n, missing)) - -def compare_missing(a, b): - return b[0] - a[0] - -missing_list.sort(compare_missing) -print "Missing support for %d functions and %d types see missing.lst" % (missing_functions_nr, len(missing_list)) -lst = open("missing.lst", "w") -lst.write("Missing support for %d types" % (len(missing_list))) -lst.write("\n") -for miss in missing_list: - lst.write("%s: %d :" % (miss[1], miss[0])) - i = 0 - for n in missing_types[miss[1]]: - i = i + 1 - if i > 5: - lst.write(" ...") - break - lst.write(" %s" % (n)) - lst.write("\n") -lst.write("\n") -lst.write("\n") -lst.write("Missing support per module"); -for module in missing_functions.keys(): - lst.write("module %s:\n %s\n" % (module, missing_functions[module])) - -lst.close() - - diff --git a/reactos/lib/3rdparty/libxml2/hash.c b/reactos/lib/3rdparty/libxml2/hash.c index afabcb1a0bc..0145109cb12 100644 --- a/reactos/lib/3rdparty/libxml2/hash.c +++ b/reactos/lib/3rdparty/libxml2/hash.c @@ -93,11 +93,13 @@ xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); } } + value = value ^ ((value << 5) + (value >> 3)); if (name2 != NULL) { while ((ch = *name2++) != 0) { value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); } } + value = value ^ ((value << 5) + (value >> 3)); if (name3 != NULL) { while ((ch = *name3++) != 0) { value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); @@ -133,6 +135,7 @@ xmlHashComputeQKey(xmlHashTablePtr table, value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); } } + value = value ^ ((value << 5) + (value >> 3)); if (prefix2 != NULL) { while ((ch = *prefix2++) != 0) { value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); @@ -144,6 +147,7 @@ xmlHashComputeQKey(xmlHashTablePtr table, value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); } } + value = value ^ ((value << 5) + (value >> 3)); if (prefix3 != NULL) { while ((ch = *prefix3++) != 0) { value = value ^ ((value << 5) + (value >> 3) + (unsigned long)ch); diff --git a/reactos/lib/3rdparty/libxml2/include/Makefile.am b/reactos/lib/3rdparty/libxml2/include/Makefile.am deleted file mode 100644 index 7dbfaa5bb58..00000000000 --- a/reactos/lib/3rdparty/libxml2/include/Makefile.am +++ /dev/null @@ -1,5 +0,0 @@ -## Process this file with automake to produce Makefile.in -SUBDIRS=libxml - -EXTRA_DIST = win32config.h wsockcompat.h - diff --git a/reactos/lib/3rdparty/libxml2/include/Makefile.in b/reactos/lib/3rdparty/libxml2/include/Makefile.in deleted file mode 100644 index a4bf4922b6f..00000000000 --- a/reactos/lib/3rdparty/libxml2/include/Makefile.in +++ /dev/null @@ -1,680 +0,0 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = include -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_THREAD_LIBS = @BASE_THREAD_LIBS@ -C14N_OBJ = @C14N_OBJ@ -CATALOG_OBJ = @CATALOG_OBJ@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@ -CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@ -DEBUG_OBJ = @DEBUG_OBJ@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DOCB_OBJ = @DOCB_OBJ@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FTP_OBJ = @FTP_OBJ@ -GREP = @GREP@ -HAVE_ISINF = @HAVE_ISINF@ -HAVE_ISNAN = @HAVE_ISNAN@ -HTML_DIR = @HTML_DIR@ -HTML_OBJ = @HTML_OBJ@ -HTTP_OBJ = @HTTP_OBJ@ -ICONV_LIBS = @ICONV_LIBS@ -ICU_LIBS = @ICU_LIBS@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@ -LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@ -LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@ -LIBXML_VERSION = @LIBXML_VERSION@ -LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@ -LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@ -LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -LZMA_CFLAGS = @LZMA_CFLAGS@ -LZMA_LIBS = @LZMA_LIBS@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MKDIR_P = @MKDIR_P@ -MODULE_EXTENSION = @MODULE_EXTENSION@ -MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@ -MV = @MV@ -M_LIBS = @M_LIBS@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PERL = @PERL@ -PYTHON = @PYTHON@ -PYTHON_INCLUDES = @PYTHON_INCLUDES@ -PYTHON_LIBS = @PYTHON_LIBS@ -PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@ -PYTHON_SUBDIR = @PYTHON_SUBDIR@ -PYTHON_TESTS = @PYTHON_TESTS@ -PYTHON_VERSION = @PYTHON_VERSION@ -RANLIB = @RANLIB@ -RDL_LIBS = @RDL_LIBS@ -READER_TEST = @READER_TEST@ -RELDATE = @RELDATE@ -RM = @RM@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STATIC_BINARIES = @STATIC_BINARIES@ -STRIP = @STRIP@ -TAR = @TAR@ -TEST_C14N = @TEST_C14N@ -TEST_CATALOG = @TEST_CATALOG@ -TEST_DEBUG = @TEST_DEBUG@ -TEST_HTML = @TEST_HTML@ -TEST_MODULES = @TEST_MODULES@ -TEST_PATTERN = @TEST_PATTERN@ -TEST_PHTML = @TEST_PHTML@ -TEST_PUSH = @TEST_PUSH@ -TEST_REGEXPS = @TEST_REGEXPS@ -TEST_SAX = @TEST_SAX@ -TEST_SCHEMAS = @TEST_SCHEMAS@ -TEST_SCHEMATRON = @TEST_SCHEMATRON@ -TEST_THREADS = @TEST_THREADS@ -TEST_VALID = @TEST_VALID@ -TEST_VTIME = @TEST_VTIME@ -TEST_XINCLUDE = @TEST_XINCLUDE@ -TEST_XPATH = @TEST_XPATH@ -TEST_XPTR = @TEST_XPTR@ -THREAD_CFLAGS = @THREAD_CFLAGS@ -THREAD_LIBS = @THREAD_LIBS@ -VERSION = @VERSION@ -VERSION_SCRIPT_FLAGS = @VERSION_SCRIPT_FLAGS@ -WGET = @WGET@ -WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@ -WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@ -WIN32_EXTRA_PYTHON_LIBADD = @WIN32_EXTRA_PYTHON_LIBADD@ -WITH_C14N = @WITH_C14N@ -WITH_CATALOG = @WITH_CATALOG@ -WITH_DEBUG = @WITH_DEBUG@ -WITH_DOCB = @WITH_DOCB@ -WITH_FTP = @WITH_FTP@ -WITH_HTML = @WITH_HTML@ -WITH_HTTP = @WITH_HTTP@ -WITH_ICONV = @WITH_ICONV@ -WITH_ICU = @WITH_ICU@ -WITH_ISO8859X = @WITH_ISO8859X@ -WITH_LEGACY = @WITH_LEGACY@ -WITH_LZMA = @WITH_LZMA@ -WITH_MEM_DEBUG = @WITH_MEM_DEBUG@ -WITH_MODULES = @WITH_MODULES@ -WITH_OUTPUT = @WITH_OUTPUT@ -WITH_PATTERN = @WITH_PATTERN@ -WITH_PUSH = @WITH_PUSH@ -WITH_READER = @WITH_READER@ -WITH_REGEXPS = @WITH_REGEXPS@ -WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ -WITH_SAX1 = @WITH_SAX1@ -WITH_SCHEMAS = @WITH_SCHEMAS@ -WITH_SCHEMATRON = @WITH_SCHEMATRON@ -WITH_THREADS = @WITH_THREADS@ -WITH_TREE = @WITH_TREE@ -WITH_TRIO = @WITH_TRIO@ -WITH_VALID = @WITH_VALID@ -WITH_WRITER = @WITH_WRITER@ -WITH_XINCLUDE = @WITH_XINCLUDE@ -WITH_XPATH = @WITH_XPATH@ -WITH_XPTR = @WITH_XPTR@ -WITH_ZLIB = @WITH_ZLIB@ -XINCLUDE_OBJ = @XINCLUDE_OBJ@ -XMLLINT = @XMLLINT@ -XML_CFLAGS = @XML_CFLAGS@ -XML_INCLUDEDIR = @XML_INCLUDEDIR@ -XML_LIBDIR = @XML_LIBDIR@ -XML_LIBS = @XML_LIBS@ -XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@ -XPATH_OBJ = @XPATH_OBJ@ -XPTR_OBJ = @XPTR_OBJ@ -XSLTPROC = @XSLTPROC@ -Z_CFLAGS = @Z_CFLAGS@ -Z_LIBS = @Z_LIBS@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pythondir = @pythondir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUBDIRS = libxml -EXTRA_DIST = win32config.h wsockcompat.h -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --gnu include/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -html-am: - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-dvi-am: - -install-exec-am: - -install-html: install-html-recursive - -install-html-am: - -install-info: install-info-recursive - -install-info-am: - -install-man: - -install-pdf: install-pdf-recursive - -install-pdf-am: - -install-ps: install-ps-recursive - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - ctags ctags-recursive distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/reactos/lib/3rdparty/libxml2/install-sh b/reactos/lib/3rdparty/libxml2/install-sh deleted file mode 100644 index a9244eb0786..00000000000 --- a/reactos/lib/3rdparty/libxml2/install-sh +++ /dev/null @@ -1,527 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2011-01-19.21; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# 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 -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - # Protect names problematic for `test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; - - -T) no_target_directory=true;; - - --version) echo "$0 $scriptversion"; exit $?;; - - --) shift - break;; - - -*) echo "$0: invalid option: $1" >&2 - exit 1;; - - *) break;; - esac - shift -done - -if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then - # When -d is used, all remaining arguments are directories to create. - # When -t is used, the destination is already specified. - # Otherwise, the last argument is the destination. Remove it from $@. - for arg - do - if test -n "$dst_arg"; then - # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dst_arg" - shift # fnord - fi - shift # arg - dst_arg=$arg - # Protect names problematic for `test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - done -fi - -if test $# -eq 0; then - if test -z "$dir_arg"; then - echo "$0: no input file specified." >&2 - exit 1 - fi - # It's OK to call `install-sh -d' without argument. - # This can happen when creating conditional directories. - exit 0 -fi - -if test -z "$dir_arg"; then - do_exit='(exit $ret); exit $ret' - trap "ret=129; $do_exit" 1 - trap "ret=130; $do_exit" 2 - trap "ret=141; $do_exit" 13 - trap "ret=143; $do_exit" 15 - - # Set umask so as not to create temps with too-generous modes. - # However, 'strip' requires both read and write access to temps. - case $mode in - # Optimize common cases. - *644) cp_umask=133;; - *755) cp_umask=22;; - - *[0-7]) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw='% 200' - fi - cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; - *) - if test -z "$stripcmd"; then - u_plus_rw= - else - u_plus_rw=,u+rw - fi - cp_umask=$mode$u_plus_rw;; - esac -fi - -for src -do - # Protect names problematic for `test' and other utilities. - case $src in - -* | [=\(\)!]) src=./$src;; - esac - - if test -n "$dir_arg"; then - dst=$src - dstdir=$dst - test -d "$dstdir" - dstdir_status=$? - else - - # Waiting for this to be detected by the "$cpprog $src $dsttmp" command - # might cause directories to be created, which would be especially bad - # if $src (and thus $dsttmp) contains '*'. - if test ! -f "$src" && test ! -d "$src"; then - echo "$0: $src does not exist." >&2 - exit 1 - fi - - if test -z "$dst_arg"; then - echo "$0: no destination specified." >&2 - exit 1 - fi - dst=$dst_arg - - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. - if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 - fi - dstdir=$dst - dst=$dstdir/`basename "$src"` - dstdir_status=0 - else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - - test -d "$dstdir" - dstdir_status=$? - fi - fi - - obsolete_mkdir_used=false - - if test $dstdir_status != 0; then - case $posix_mkdir in - '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; - esac - - if - $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" - ) - then : - else - - # The umask is ridiculous, or mkdir does not conform to POSIX, - # or it failed possibly due to a race condition. Create the - # directory the slow way, step by step, checking for races as we go. - - case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; - esac - - eval "$initialize_posix_glob" - - oIFS=$IFS - IFS=/ - $posix_glob set -f - set fnord $dstdir - shift - $posix_glob set +f - IFS=$oIFS - - prefixes= - - for d - do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ - done - - if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true - fi - fi - fi - - if test -n "$dir_arg"; then - { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && - { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 - else - - # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ - - # Trap to clean up those temp files at exit. - trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 - - # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && - - # and set any options; do chmod last to preserve setuid bits. - # - # If any of these fail, we abort the whole thing. If we want to - # ignore errors from any of these, just make sure not to ignore - # errors from the above "$doit $cpprog $src $dsttmp" command. - # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && - { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && - { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && - { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - - # If -C, don't bother to copy if it wouldn't change the file. - if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && - set X $old && old=:$2:$4:$5:$6 && - set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - - test "$old" = "$new" && - $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 - then - rm -f "$dsttmp" - else - # Rename the file to the real destination. - $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || - - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. - { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - fi || exit 1 - - trap '' 0 - fi -done - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/reactos/lib/3rdparty/libxml2/libxml-2.0-uninstalled.pc.in b/reactos/lib/3rdparty/libxml2/libxml-2.0-uninstalled.pc.in deleted file mode 100644 index cab68346534..00000000000 --- a/reactos/lib/3rdparty/libxml2/libxml-2.0-uninstalled.pc.in +++ /dev/null @@ -1,12 +0,0 @@ -prefix= -exec_prefix= -libdir=${pcfiledir} -includedir=${pcfiledir}/include - - -Name: libXML -Version: @VERSION@ -Description: libXML library version2. -Requires: -Libs: -L${libdir} -lxml2 @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @LIBS@ -Cflags: -I${includedir} @XML_INCLUDEDIR@ @XML_CFLAGS@ diff --git a/reactos/lib/3rdparty/libxml2/libxml-2.0.pc.in b/reactos/lib/3rdparty/libxml2/libxml-2.0.pc.in deleted file mode 100644 index f5f5f03fc0b..00000000000 --- a/reactos/lib/3rdparty/libxml2/libxml-2.0.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -modules=@WITH_MODULES@ - -Name: libXML -Version: @VERSION@ -Description: libXML library version2. -Requires: -Libs: -L${libdir} -lxml2 -Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ -Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@ diff --git a/reactos/lib/3rdparty/libxml2/libxml.3 b/reactos/lib/3rdparty/libxml2/libxml.3 deleted file mode 100644 index b3e9fef0617..00000000000 --- a/reactos/lib/3rdparty/libxml2/libxml.3 +++ /dev/null @@ -1,71 +0,0 @@ -.TH libxml 3 "12 April 2000" -.SH NAME -libxml \- library used to parse XML files -.SH DESCRIPTION -The -.I libxml -library is used to parse XML files. -Its internal document representation is as close as possible to the -.I DOM -(Document Object Model) interface, -an API for accessing XML or HTML structured documents. -.LP -The -.I libxml -library also has a -.IR SAX -like -interface, -which is designed to be compatible with -.IR expat (1). -NOTE: -.IR SAX , -the Simple API for XML, -is a standard interface for event-based XML parsing, -developed collaboratively by the members of the XML-DEV mailing list, -currently hosted by OASIS. -The -.I expat -library is a XML 1.0 parser written in C, -which aims to be fully conforming. -It is currently not a validating XML processor. -.LP -The -.I libxml -library now includes a nearly complete -.I XPath -implementation. -The -.I XPath -(XML Path Language) is a language for addressing parts of an -XML document, -designed to be used by both -.I XSLT -and -.IR XPointer . -.LP -The -.I libxml -library exports Push and Pull type parser interfaces for both XML and -.IR html . -.SH FILES -.TP 2.2i -.B /depot/lib/libxml_2.0.0/libxml.a -static library -.TP -.B /depot/lib/libxml_2.0.0/libxml.so -shared library -.TP -.B /depot/package/libxml_2.0.0/bin/xmllint -binary application for parsing XML files -.SH AUTHORS -Daniel Veillard (daniel@veillard.com). -Red Hat Inc. -Manual page by Ziying Sherwin (sherwin@nlm.nih.gov), -Lister Hill National Center for Biomedical Communications, -U.S. National Library of Medicine. -.SH SEE ALSO -.IR xmllint (1), -.IR libxslt (3), -.IR libexslt (3), -.IR xsltproc (1) -.\" end of manual page diff --git a/reactos/lib/3rdparty/libxml2/libxml.h b/reactos/lib/3rdparty/libxml2/libxml.h index 6f9e56c051f..66218f0e79f 100644 --- a/reactos/lib/3rdparty/libxml2/libxml.h +++ b/reactos/lib/3rdparty/libxml2/libxml.h @@ -84,6 +84,8 @@ void __xmlGlobalInitMutexLock(void); void __xmlGlobalInitMutexUnlock(void); void __xmlGlobalInitMutexDestroy(void); +int __xmlInitializeDict(void); + #if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) /* * internal thread safe random function @@ -91,6 +93,8 @@ void __xmlGlobalInitMutexDestroy(void); int __xmlRandom(void); #endif +int xmlNop(void); + #ifdef IN_LIBXML #ifdef __GNUC__ #ifdef PIC diff --git a/reactos/lib/3rdparty/libxml2/libxml.m4 b/reactos/lib/3rdparty/libxml2/libxml.m4 deleted file mode 100644 index 68cd8242fbc..00000000000 --- a/reactos/lib/3rdparty/libxml2/libxml.m4 +++ /dev/null @@ -1,188 +0,0 @@ -# Configure paths for LIBXML2 -# Mike Hommey 2004-06-19 -# use CPPFLAGS instead of CFLAGS -# Toshio Kuratomi 2001-04-21 -# Adapted from: -# Configure paths for GLIB -# Owen Taylor 97-11-3 - -dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) -dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS -dnl -AC_DEFUN([AM_PATH_XML2],[ -AC_ARG_WITH(xml-prefix, - [ --with-xml-prefix=PFX Prefix where libxml is installed (optional)], - xml_config_prefix="$withval", xml_config_prefix="") -AC_ARG_WITH(xml-exec-prefix, - [ --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)], - xml_config_exec_prefix="$withval", xml_config_exec_prefix="") -AC_ARG_ENABLE(xmltest, - [ --disable-xmltest Do not try to compile and run a test LIBXML program],, - enable_xmltest=yes) - - if test x$xml_config_exec_prefix != x ; then - xml_config_args="$xml_config_args" - if test x${XML2_CONFIG+set} != xset ; then - XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config - fi - fi - if test x$xml_config_prefix != x ; then - xml_config_args="$xml_config_args --prefix=$xml_config_prefix" - if test x${XML2_CONFIG+set} != xset ; then - XML2_CONFIG=$xml_config_prefix/bin/xml2-config - fi - fi - - AC_PATH_PROG(XML2_CONFIG, xml2-config, no) - min_xml_version=ifelse([$1], ,2.0.0,[$1]) - AC_MSG_CHECKING(for libxml - version >= $min_xml_version) - no_xml="" - if test "$XML2_CONFIG" = "no" ; then - no_xml=yes - else - XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags` - XML_LIBS=`$XML2_CONFIG $xml_config_args --libs` - xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - if test "x$enable_xmltest" = "xyes" ; then - ac_save_CPPFLAGS="$CPPFLAGS" - ac_save_LIBS="$LIBS" - CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" - LIBS="$XML_LIBS $LIBS" -dnl -dnl Now check if the installed libxml is sufficiently new. -dnl (Also sanity checks the results of xml2-config to some extent) -dnl - rm -f conf.xmltest - AC_TRY_RUN([ -#include -#include -#include -#include - -int -main() -{ - int xml_major_version, xml_minor_version, xml_micro_version; - int major, minor, micro; - char *tmp_version; - - system("touch conf.xmltest"); - - /* Capture xml2-config output via autoconf/configure variables */ - /* HP/UX 9 (%@#!) writes to sscanf strings */ - tmp_version = (char *)strdup("$min_xml_version"); - if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string from xml2-config\n", "$min_xml_version"); - exit(1); - } - free(tmp_version); - - /* Capture the version information from the header files */ - tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION); - if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) { - printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION"); - exit(1); - } - free(tmp_version); - - /* Compare xml2-config output to the libxml headers */ - if ((xml_major_version != $xml_config_major_version) || - (xml_minor_version != $xml_config_minor_version) || - (xml_micro_version != $xml_config_micro_version)) - { - printf("*** libxml header files (version %d.%d.%d) do not match\n", - xml_major_version, xml_minor_version, xml_micro_version); - printf("*** xml2-config (version %d.%d.%d)\n", - $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version); - return 1; - } -/* Compare the headers to the library to make sure we match */ - /* Less than ideal -- doesn't provide us with return value feedback, - * only exits if there's a serious mismatch between header and library. - */ - LIBXML_TEST_VERSION; - - /* Test that the library is greater than our minimum version */ - if ((xml_major_version > major) || - ((xml_major_version == major) && (xml_minor_version > minor)) || - ((xml_major_version == major) && (xml_minor_version == minor) && - (xml_micro_version >= micro))) - { - return 0; - } - else - { - printf("\n*** An old version of libxml (%d.%d.%d) was found.\n", - xml_major_version, xml_minor_version, xml_micro_version); - printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n", - major, minor, micro); - printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n"); - printf("***\n"); - printf("*** If you have already installed a sufficiently new version, this error\n"); - printf("*** probably means that the wrong copy of the xml2-config shell script is\n"); - printf("*** being found. The easiest way to fix this is to remove the old version\n"); - printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n"); - printf("*** correct copy of xml2-config. (In this case, you will have to\n"); - printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); - printf("*** so that the correct libraries are found at run-time))\n"); - } - return 1; -} -],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CPPFLAGS="$ac_save_CPPFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - - if test "x$no_xml" = x ; then - AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version)) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$XML2_CONFIG" = "no" ; then - echo "*** The xml2-config script installed by LIBXML could not be found" - echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the XML2_CONFIG environment variable to the" - echo "*** full path to xml2-config." - else - if test -f conf.xmltest ; then - : - else - echo "*** Could not run libxml test program, checking why..." - CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" - LIBS="$LIBS $XML_LIBS" - AC_TRY_LINK([ -#include -#include -], [ LIBXML_TEST_VERSION; return 0;], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding LIBXML or finding the wrong" - echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means LIBXML was incorrectly installed" - echo "*** or that you have moved LIBXML since it was installed. In the latter case, you" - echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ]) - CPPFLAGS="$ac_save_CPPFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - - XML_CPPFLAGS="" - XML_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(XML_CPPFLAGS) - AC_SUBST(XML_LIBS) - rm -f conf.xmltest -]) diff --git a/reactos/lib/3rdparty/libxml2/libxml.spec.in b/reactos/lib/3rdparty/libxml2/libxml.spec.in deleted file mode 100644 index 03eb24ee0e4..00000000000 --- a/reactos/lib/3rdparty/libxml2/libxml.spec.in +++ /dev/null @@ -1,133 +0,0 @@ -Summary: Library providing XML and HTML support -Name: libxml2 -Version: @VERSION@ -Release: 1 -License: MIT -Group: Development/Libraries -Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -BuildRequires: python python-devel zlib-devel pkgconfig xz-devel -URL: http://xmlsoft.org/ - -%description -This library allows to manipulate XML files. It includes support -to read, modify and write XML and HTML files. There is DTDs support -this includes parsing and validation even with complex DtDs, either -at parse time or later once the document has been modified. The output -can be a simple SAX stream or and in-memory DOM like representations. -In this case one can use the built-in XPath and XPointer implementation -to select subnodes or ranges. A flexible Input/Output mechanism is -available, with existing HTTP and FTP modules and combined to an -URI library. - -%package devel -Summary: Libraries, includes, etc. to develop XML and HTML applications -Group: Development/Libraries -Requires: libxml2 = %{version}-%{release} -Requires: zlib-devel -Requires: xz-devel -Requires: pkgconfig - -%description devel -Libraries, include files, etc you can use to develop XML applications. -This library allows to manipulate XML files. It includes support -to read, modify and write XML and HTML files. There is DTDs support -this includes parsing and validation even with complex DtDs, either -at parse time or later once the document has been modified. The output -can be a simple SAX stream or and in-memory DOM like representations. -In this case one can use the built-in XPath and XPointer implementation -to select subnodes or ranges. A flexible Input/Output mechanism is -available, with existing HTTP and FTP modules and combined to an -URI library. - -%package python -Summary: Python bindings for the libxml2 library -Group: Development/Libraries -Requires: libxml2 = %{version}-%{release} -Requires: python - -%description python -The libxml2-python package contains a module that permits applications -written in the Python programming language to use the interface -supplied by the libxml2 library to manipulate XML files. - -This library allows to manipulate XML files. It includes support -to read, modify and write XML and HTML files. There is DTDs support -this includes parsing and validation even with complex DTDs, either -at parse time or later once the document has been modified. - -%prep -%setup -q - -%build -%configure -make %{_smp_mflags} -gzip -9 ChangeLog - -%install -rm -fr %{buildroot} - -%makeinstall -(cd doc/examples ; make clean ; rm -rf .deps Makefile) -gzip -9 doc/libxml2-api.xml -rm -f $RPM_BUILD_ROOT%{_libdir}/*.la - -%clean -rm -fr %{buildroot} - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - -%files -%defattr(-, root, root) - -%doc AUTHORS ChangeLog.gz NEWS README Copyright TODO -%doc %{_mandir}/man1/xmllint.1* -%doc %{_mandir}/man1/xmlcatalog.1* -%doc %{_mandir}/man3/libxml.3* - -%{_libdir}/lib*.so.* -%{_bindir}/xmllint -%{_bindir}/xmlcatalog - -%files devel -%defattr(-, root, root) - -%doc %{_mandir}/man1/xml2-config.1* -%doc AUTHORS ChangeLog.gz NEWS README Copyright -%doc doc/*.html doc/html doc/*.gif doc/*.png -%doc doc/tutorial doc/libxml2-api.xml.gz -%doc doc/examples -%doc %dir %{_datadir}/gtk-doc/html/libxml2 -%doc %{_datadir}/gtk-doc/html/libxml2/*.devhelp -%doc %{_datadir}/gtk-doc/html/libxml2/*.html -%doc %{_datadir}/gtk-doc/html/libxml2/*.png -%doc %{_datadir}/gtk-doc/html/libxml2/*.css - -%{_libdir}/lib*.so -%{_libdir}/*a -%{_libdir}/*.sh -%{_includedir}/* -%{_bindir}/xml2-config -%{_datadir}/aclocal/libxml.m4 -%{_libdir}/pkgconfig/libxml-2.0.pc -%files python -%defattr(-, root, root) - -%doc AUTHORS ChangeLog.gz NEWS README Copyright -%{_libdir}/python*/site-packages/libxml2.py* -%{_libdir}/python*/site-packages/drv_libxml2.py* -%{_libdir}/python*/site-packages/libxml2mod* -%doc python/TODO -%doc python/libxml2class.txt -%doc python/tests/*.py -%doc doc/*.py -%doc doc/python.html - -%changelog -* @RELDATE@ Daniel Veillard -- upstream release @VERSION@ see http://xmlsoft.org/news.html - diff --git a/reactos/lib/3rdparty/libxml2/libxml2.spec b/reactos/lib/3rdparty/libxml2/libxml2.spec deleted file mode 100644 index 214adcf416f..00000000000 --- a/reactos/lib/3rdparty/libxml2/libxml2.spec +++ /dev/null @@ -1,133 +0,0 @@ -Summary: Library providing XML and HTML support -Name: libxml2 -Version: 2.9.0 -Release: 1 -License: MIT -Group: Development/Libraries -Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root -BuildRequires: python python-devel zlib-devel pkgconfig xz-devel -URL: http://xmlsoft.org/ - -%description -This library allows to manipulate XML files. It includes support -to read, modify and write XML and HTML files. There is DTDs support -this includes parsing and validation even with complex DtDs, either -at parse time or later once the document has been modified. The output -can be a simple SAX stream or and in-memory DOM like representations. -In this case one can use the built-in XPath and XPointer implementation -to select subnodes or ranges. A flexible Input/Output mechanism is -available, with existing HTTP and FTP modules and combined to an -URI library. - -%package devel -Summary: Libraries, includes, etc. to develop XML and HTML applications -Group: Development/Libraries -Requires: libxml2 = %{version}-%{release} -Requires: zlib-devel -Requires: xz-devel -Requires: pkgconfig - -%description devel -Libraries, include files, etc you can use to develop XML applications. -This library allows to manipulate XML files. It includes support -to read, modify and write XML and HTML files. There is DTDs support -this includes parsing and validation even with complex DtDs, either -at parse time or later once the document has been modified. The output -can be a simple SAX stream or and in-memory DOM like representations. -In this case one can use the built-in XPath and XPointer implementation -to select subnodes or ranges. A flexible Input/Output mechanism is -available, with existing HTTP and FTP modules and combined to an -URI library. - -%package python -Summary: Python bindings for the libxml2 library -Group: Development/Libraries -Requires: libxml2 = %{version}-%{release} -Requires: python - -%description python -The libxml2-python package contains a module that permits applications -written in the Python programming language to use the interface -supplied by the libxml2 library to manipulate XML files. - -This library allows to manipulate XML files. It includes support -to read, modify and write XML and HTML files. There is DTDs support -this includes parsing and validation even with complex DTDs, either -at parse time or later once the document has been modified. - -%prep -%setup -q - -%build -%configure -make %{_smp_mflags} -gzip -9 ChangeLog - -%install -rm -fr %{buildroot} - -%makeinstall -(cd doc/examples ; make clean ; rm -rf .deps Makefile) -gzip -9 doc/libxml2-api.xml -rm -f $RPM_BUILD_ROOT%{_libdir}/*.la - -%clean -rm -fr %{buildroot} - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - -%files -%defattr(-, root, root) - -%doc AUTHORS ChangeLog.gz NEWS README Copyright TODO -%doc %{_mandir}/man1/xmllint.1* -%doc %{_mandir}/man1/xmlcatalog.1* -%doc %{_mandir}/man3/libxml.3* - -%{_libdir}/lib*.so.* -%{_bindir}/xmllint -%{_bindir}/xmlcatalog - -%files devel -%defattr(-, root, root) - -%doc %{_mandir}/man1/xml2-config.1* -%doc AUTHORS ChangeLog.gz NEWS README Copyright -%doc doc/*.html doc/html doc/*.gif doc/*.png -%doc doc/tutorial doc/libxml2-api.xml.gz -%doc doc/examples -%doc %dir %{_datadir}/gtk-doc/html/libxml2 -%doc %{_datadir}/gtk-doc/html/libxml2/*.devhelp -%doc %{_datadir}/gtk-doc/html/libxml2/*.html -%doc %{_datadir}/gtk-doc/html/libxml2/*.png -%doc %{_datadir}/gtk-doc/html/libxml2/*.css - -%{_libdir}/lib*.so -%{_libdir}/*a -%{_libdir}/*.sh -%{_includedir}/* -%{_bindir}/xml2-config -%{_datadir}/aclocal/libxml.m4 -%{_libdir}/pkgconfig/libxml-2.0.pc -%files python -%defattr(-, root, root) - -%doc AUTHORS ChangeLog.gz NEWS README Copyright -%{_libdir}/python*/site-packages/libxml2.py* -%{_libdir}/python*/site-packages/drv_libxml2.py* -%{_libdir}/python*/site-packages/libxml2mod* -%doc python/TODO -%doc python/libxml2class.txt -%doc python/tests/*.py -%doc doc/*.py -%doc doc/python.html - -%changelog -* Tue Sep 11 2012 Daniel Veillard -- upstream release 2.9.0 see http://xmlsoft.org/news.html - diff --git a/reactos/lib/3rdparty/libxml2/ltmain.sh b/reactos/lib/3rdparty/libxml2/ltmain.sh deleted file mode 100644 index 63ae69dc6fe..00000000000 --- a/reactos/lib/3rdparty/libxml2/ltmain.sh +++ /dev/null @@ -1,9655 +0,0 @@ - -# libtool (GNU libtool) 2.4.2 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool 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. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . - -PROGRAM=libtool -PACKAGE=libtool -VERSION=2.4.2 -TIMESTAMP="" -package_revision=1.3337 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL - -$lt_unset CDPATH - - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - - - -: ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} # func_dirname may be replaced by extended shell implementation - - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation - - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} # func_dirname_and_basename may be replaced by extended shell implementation - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname may be replaced by extended shell implementation - - -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' - -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi - - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} - -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=${PATH_SEPARATOR-:} - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' - -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $opt_debug - - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $opt_debug - - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. -func_help () -{ - $opt_debug - - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $opt_debug - - func_error "missing argument for $1." - exit_cmd=exit -} - - -# func_split_short_opt shortopt -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () -{ - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation - - -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () -{ - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' - - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation - -exit_cmd=: - - - - - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation - -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () -{ - func_quote_for_eval "${2}" - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" -} # func_append_quoted may be replaced by extended shell implementation - - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation - - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation - - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation - - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation - - -# func_fatal_configuration arg... -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." -} - - -# func_config -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - -# func_features -# Display the features supported by this script. -func_features () -{ - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - - exit $? -} - -# func_enable_tag tagname -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname="$1" - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac - - - -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_warning=: -opt_verbose=: -opt_silent=false -opt_verbose=false - - -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-warning|--no-warn) - opt_warning=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) - opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" - shift - ;; - - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; - esac - done - - # Validate options: - - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - - $opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } - - - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE -} - - - - -## ----------- ## -## Main. ## -## ----------- ## - -# func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. -func_source () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case "$lt_sysroot:$1" in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $opt_debug - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $opt_debug - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $opt_debug - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $opt_debug - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $opt_debug - if test -z "$2" && test -n "$1" ; then - func_error "Could not determine host file name corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result="$1" - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $opt_debug - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " \`$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result="$3" - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $opt_debug - case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via `$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $opt_debug - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $opt_debug - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result="$1" -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via `$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $opt_debug - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $opt_debug - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result="$1" -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_mode_compile arg... -func_mode_compile () -{ - $opt_debug - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" - arg_mode=target - continue - ;; - - -pie | -fpie | -fPIE) - func_append pie_flag " $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - func_append_quoted lastarg "$arg" - done - IFS="$save_ifs" - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - func_append base_compile " $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg - - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with \`-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj="$func_basename_result" - } - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac - - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from \`$libobj'" - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - continue - ;; - - -static) - build_libtool_libs=no - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - func_append removelist " $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - func_append command " -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - func_append command " -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$opt_mode'" - ;; - esac - - echo - $ECHO "Try \`$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir="$func_dirname_result" - - if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir="$func_dirname_result" - ;; - - *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "\`$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument \`$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} - -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - func_append files " $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - func_append staticlibs " $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - func_append dir "$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $tool_oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = install && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $opt_dry_run || { - $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" - func_basename "$dlprefile" - name="$func_basename_result" - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - echo >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' - - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $opt_debug - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $opt_debug - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result="" - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case \" \$* \" in - *\\ --lt-*) - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done ;; - esac - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined (other platforms) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -n -e ' -s/^\(.\{79\}\)\(..*\)/\1\ -\2/ -h -s/\([\\"]\)/\\\1/g -s/$/\\n/ -s/\([^\n]*\).*/ fputs ("\1", f);/p -g -D' - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - func_append dlfiles " $arg" - else - func_append dlprefiles " $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# func_append moreargs " $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file \`$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) func_append rpath " $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) func_append xrpath " $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - func_append weak_libs " $arg" - prev= - continue - ;; - xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" - else - func_fatal_error "need path for \`-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - func_append deplibs " $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - continue - ;; - - -multi_module) - single_module="${wl}-multi_module" - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" - func_append finalize_command " $arg" - func_append compiler_flags " $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - func_append objs " $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" - prev= - else - func_append deplibs " $func_resolve_sysroot_result" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then - case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append libs " $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; - esac - func_append pre_post_deps " $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs="$tmp_deplibs" - fi - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - func_append newdlprefiles " $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append newdlfiles " $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib="$l" - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" - else - func_append newdlfiles " $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" - fi - ;; - esac - func_basename "$lib" - laname="$func_basename_result" - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" - fi - case "$host" in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - func_append newlib_search_path " $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc*) - # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - func_append notinst_deplibs " $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" - break - fi - done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - echo - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname="$1" - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc*) - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - func_basename "$soroot" - soname="$func_basename_result" - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from \`$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$opt_mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - elif test -n "$old_library"; then - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$absdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$opt_mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; - esac;; - *) func_append temp_deplibs " $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - func_append newlib_search_path " $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; - esac - fi - func_append tmp_libs " $func_resolve_sysroot_result" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path="$deplib" ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" - path= - fi - fi - ;; - *) - path="-L$absdir/$objdir" - ;; - esac - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" - - path="-L$absdir" - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; - esac - ;; - *) func_append tmp_libs " $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - func_append tmp_libs " $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "\`-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - func_append objs "$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - shift - IFS="$save_ifs" - - test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$1" - number_minor="$2" - number_revision="$3" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - # correct linux to gnu/linux during the next big refactor - darwin|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) # correct to gnu/linux during the next big refactor - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - func_append verstring ":${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - - *) - func_fatal_configuration "unknown library version type \`$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$opt_mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - func_append removelist " $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - func_append oldlibs " $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - func_append deplibs " -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - deplibs="$new_libs" - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Remove ${wl} instances when linking with ld. - # FIXME: should test the right _cmds variable. - case $archive_cmds in - *\$LD\ *) wl= ;; - esac - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname="$1" - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - func_append linknames " $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - func_append delfiles " $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols="$export_symbols" - export_symbols= - always_export_symbols=yes - fi - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd1 in $cmds; do - IFS="$save_ifs" - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test "$try_normal_branch" = yes \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=${output_objdir}/${output_la}.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - func_append tmp_deplibs " $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test "X$objlist" = X || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - func_append delfiles " $output" - - else - output= - fi - - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - fi - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - if ${skipped_export-false}; then - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - fi - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "\`-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' - fi - - exit $exit_status - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase="$func_basename_result" - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" - ;; - *) func_append oldobjs " $obj" ;; - esac - done - fi - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - func_resolve_sysroot "$deplib" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" - ;; - *) func_append newdlfiles " $lib" ;; - esac - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlfiles " $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlprefiles " $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" - else - odir="$dir/$objdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" - - # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then - case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - func_append rmfiles " $odir/$n" - done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" - - case "$opt_mode" in - clean) - case " $library_names " in - *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; - esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then - func_append rmfiles " $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then - func_append rmfiles " $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$opt_mode" = clean ; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - func_append rmfiles " $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$opt_mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: -# vi:sw=2 - diff --git a/reactos/lib/3rdparty/libxml2/missing b/reactos/lib/3rdparty/libxml2/missing deleted file mode 100644 index 86a8fc31e3c..00000000000 --- a/reactos/lib/3rdparty/libxml2/missing +++ /dev/null @@ -1,331 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2012-01-06.13; # UTC - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. - -# 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, 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, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch] - -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. - -Send bug reports to ." - exit $? - ;; - - -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing $scriptversion (GNU Automake)" - exit $? - ;; - - -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 - ;; - -esac - -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; - - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; - - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac - -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/reactos/lib/3rdparty/libxml2/nanohttp.c b/reactos/lib/3rdparty/libxml2/nanohttp.c index cb800c59600..04733b78c67 100644 --- a/reactos/lib/3rdparty/libxml2/nanohttp.c +++ b/reactos/lib/3rdparty/libxml2/nanohttp.c @@ -276,6 +276,8 @@ xmlNanoHTTPCleanup(void) { static void xmlNanoHTTPScanURL(xmlNanoHTTPCtxtPtr ctxt, const char *URL) { xmlURIPtr uri; + int len; + /* * Clear any existing data from the context */ @@ -307,7 +309,15 @@ xmlNanoHTTPScanURL(xmlNanoHTTPCtxtPtr ctxt, const char *URL) { } ctxt->protocol = xmlMemStrdup(uri->scheme); - ctxt->hostname = xmlMemStrdup(uri->server); + /* special case of IPv6 addresses, the [] need to be removed */ + if ((uri->server != NULL) && (*uri->server == '[')) { + len = strlen(uri->server); + if ((len > 2) && (uri->server[len - 1] == ']')) { + ctxt->hostname = (char *) xmlCharStrndup(uri->server + 1, len -2); + } else + ctxt->hostname = xmlMemStrdup(uri->server); + } else + ctxt->hostname = xmlMemStrdup(uri->server); if (uri->path != NULL) ctxt->path = xmlMemStrdup(uri->path); else diff --git a/reactos/lib/3rdparty/libxml2/parser.c b/reactos/lib/3rdparty/libxml2/parser.c index 192eaedfd88..ee429f333ea 100644 --- a/reactos/lib/3rdparty/libxml2/parser.c +++ b/reactos/lib/3rdparty/libxml2/parser.c @@ -122,7 +122,7 @@ xmlCreateEntityParserCtxtInternal(const xmlChar *URL, const xmlChar *ID, */ static int xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size, - xmlEntityPtr ent) + xmlEntityPtr ent, size_t replacement) { size_t consumed = 0; @@ -130,7 +130,24 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size, return (0); if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP) return (1); - if (size != 0) { + if (replacement != 0) { + if (replacement < XML_MAX_TEXT_LENGTH) + return(0); + + /* + * If the volume of entity copy reaches 10 times the + * amount of parsed data and over the large text threshold + * then that's very likely to be an abuse. + */ + if (ctxt->input != NULL) { + consumed = ctxt->input->consumed + + (ctxt->input->cur - ctxt->input->base); + } + consumed += ctxt->sizeentities; + + if (replacement < XML_PARSER_NON_LINEAR * consumed) + return(0); + } else if (size != 0) { /* * Do the check based on the replacement size of the entity */ @@ -153,7 +170,7 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size, /* * use the number of parsed entities in the replacement */ - size = ent->checked; + size = ent->checked / 2; /* * The amount of data parsed counting entities size only once @@ -176,7 +193,6 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size, */ return (0); } - xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL); return (1); } @@ -1540,7 +1556,7 @@ nsPush(xmlParserCtxtPtr ctxt, const xmlChar *prefix, const xmlChar *URL) { if (ctxt->options & XML_PARSE_NSCLEAN) { int i; - for (i = 0;i < ctxt->nsNr;i += 2) { + for (i = ctxt->nsNr - 2;i >= 0;i -= 2) { if (ctxt->nsTab[i] == prefix) { /* in scope */ if (ctxt->nsTab[i + 1] == URL) @@ -2025,6 +2041,7 @@ static void xmlSHRINK (xmlParserCtxtPtr ctxt) { static void xmlGROW (xmlParserCtxtPtr ctxt) { if ((((ctxt->input->end - ctxt->input->cur) > XML_MAX_LOOKUP_LIMIT) || ((ctxt->input->cur - ctxt->input->base) > XML_MAX_LOOKUP_LIMIT)) && + ((ctxt->input->buf) && (ctxt->input->buf->readcallback != (xmlInputReadCallback) xmlNop)) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "Huge input lookup"); ctxt->instate = XML_PARSER_EOF; @@ -2532,6 +2549,8 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) { NEXT; if ((ctxt->sax != NULL) && (ctxt->sax->getParameterEntity != NULL)) entity = ctxt->sax->getParameterEntity(ctxt->userData, name); + if (ctxt->instate == XML_PARSER_EOF) + return; if (entity == NULL) { /* @@ -2719,7 +2738,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, (ctxt->lastError.code == XML_ERR_INTERNAL_ERROR)) goto int_error; if (ent != NULL) - ctxt->nbentities += ent->checked; + ctxt->nbentities += ent->checked / 2; if ((ent != NULL) && (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) { if (ent->content != NULL) { @@ -2742,7 +2761,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, while (*current != 0) { /* non input consuming loop */ buffer[nbchars++] = *current++; if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { - if (xmlParserEntityCheck(ctxt, nbchars, ent)) + if (xmlParserEntityCheck(ctxt, nbchars, ent, 0)) goto int_error; growBuffer(buffer, XML_PARSER_BUFFER_SIZE); } @@ -2770,7 +2789,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP) goto int_error; if (ent != NULL) - ctxt->nbentities += ent->checked; + ctxt->nbentities += ent->checked / 2; if (ent != NULL) { if (ent->content == NULL) { xmlLoadEntityContent(ctxt, ent); @@ -2784,7 +2803,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len, while (*current != 0) { /* non input consuming loop */ buffer[nbchars++] = *current++; if (nbchars + XML_PARSER_BUFFER_SIZE > buffer_size) { - if (xmlParserEntityCheck(ctxt, nbchars, ent)) + if (xmlParserEntityCheck(ctxt, nbchars, ent, 0)) goto int_error; growBuffer(buffer, XML_PARSER_BUFFER_SIZE); } @@ -3435,7 +3454,7 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) { /** * xmlParseNCName: * @ctxt: an XML parser context - * @len: lenght of the string parsed + * @len: length of the string parsed * * parse an XML name. * @@ -3934,7 +3953,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { if ((len > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, - "AttValue lenght too long\n"); + "AttValue length too long\n"); goto mem_error; } if (c == 0) break; @@ -4027,10 +4046,16 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { * entities problems */ if ((ent->etype != XML_INTERNAL_PREDEFINED_ENTITY) && - (ent->content != NULL)) { + (ent->content != NULL) && (ent->checked == 0)) { + unsigned long oldnbent = ctxt->nbentities; + rep = xmlStringDecodeEntities(ctxt, ent->content, XML_SUBSTITUTE_REF, 0, 0, 0); + + ent->checked = (ctxt->nbentities - oldnbent + 1) * 2; if (rep != NULL) { + if (xmlStrchr(rep, '<')) + ent->checked |= 1; xmlFree(rep); rep = NULL; } @@ -4075,7 +4100,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { goto error; if ((in_space) && (normalize)) { - while (buf[len - 1] == 0x20) len--; + while ((len > 0) && (buf[len - 1] == 0x20)) len--; } buf[len] = 0; if (RAW == '<') { @@ -4093,11 +4118,11 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) { /* * There we potentially risk an overflow, don't allow attribute value of - * lenght more than INT_MAX it is a very reasonnable assumption ! + * length more than INT_MAX it is a very reasonnable assumption ! */ if (len >= INT_MAX) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, - "AttValue lenght too long\n"); + "AttValue length too long\n"); goto mem_error; } @@ -4983,7 +5008,8 @@ get_more: } if (buf != NULL) xmlFree(buf); - ctxt->instate = state; + if (ctxt->instate != XML_PARSER_EOF) + ctxt->instate = state; return; } if (buf != NULL) { @@ -5571,6 +5597,8 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) { } } } + if (ctxt->instate == XML_PARSER_EOF) + return; SKIP_BLANKS; if (RAW != '>') { xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED, @@ -7196,13 +7224,15 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { * Store the number of entities needing parsing for this entity * content and do checkings */ - ent->checked = ctxt->nbentities - oldnbent; + ent->checked = (ctxt->nbentities - oldnbent + 1) * 2; + if ((ent->content != NULL) && (xmlStrchr(ent->content, '<'))) + ent->checked |= 1; if (ret == XML_ERR_ENTITY_LOOP) { xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL); xmlFreeNodeList(list); return; } - if (xmlParserEntityCheck(ctxt, 0, ent)) { + if (xmlParserEntityCheck(ctxt, 0, ent, 0)) { xmlFreeNodeList(list); return; } @@ -7261,9 +7291,9 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { list = NULL; } if (ent->checked == 0) - ent->checked = 1; + ent->checked = 2; } else if (ent->checked != 1) { - ctxt->nbentities += ent->checked; + ctxt->nbentities += ent->checked / 2; } /* @@ -7359,6 +7389,13 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { (ctxt->parseMode == XML_PARSE_READER)) { xmlNodePtr nw = NULL, cur, firstChild = NULL; + /* + * We are copying here, make sure there is no abuse + */ + ctxt->sizeentcopy += ent->length; + if (xmlParserEntityCheck(ctxt, 0, ent, ctxt->sizeentcopy)) + return; + /* * when operating on a reader, the entities definitions * are always owning the entities subtree. @@ -7399,6 +7436,14 @@ xmlParseReference(xmlParserCtxtPtr ctxt) { } else if ((list == NULL) || (ctxt->inputNr > 0)) { xmlNodePtr nw = NULL, cur, next, last, firstChild = NULL; + + /* + * We are copying here, make sure there is no abuse + */ + ctxt->sizeentcopy += ent->length; + if (xmlParserEntityCheck(ctxt, 0, ent, ctxt->sizeentcopy)) + return; + /* * Copy the entity child list and make it the new * entity child list. The goal is to make sure any @@ -7515,7 +7560,7 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { NEXT; /* - * Predefined entites override any extra definition + * Predefined entities override any extra definition */ if ((ctxt->options & XML_PARSE_OLDSAX) == 0) { ent = xmlGetPredefinedEntity(name); @@ -7524,7 +7569,7 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { } /* - * Increate the number of entity references parsed + * Increase the number of entity references parsed */ ctxt->nbentities++; @@ -7543,6 +7588,8 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { ent = xmlSAX2GetEntity(ctxt, name); } } + if (ctxt->instate == XML_PARSER_EOF) + return(NULL); /* * [ WFC: Entity Declared ] * In a document without any DTD, a document with only an @@ -7609,11 +7656,13 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) { * not contain a <. */ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) && - (ent != NULL) && (ent->content != NULL) && - (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY) && - (xmlStrchr(ent->content, '<'))) { - xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, - "'<' in entity '%s' is not allowed in attributes values\n", name); + (ent != NULL) && + (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) { + if ((ent->checked & 1) || ((ent->checked == 0) && + (ent->content != NULL) &&(xmlStrchr(ent->content, '<')))) { + xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, + "'<' in entity '%s' is not allowed in attributes values\n", name); + } } /* @@ -7733,6 +7782,10 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) { ent = xmlSAX2GetEntity(ctxt, name); } } + if (ctxt->instate == XML_PARSER_EOF) { + xmlFree(name); + return(NULL); + } /* * [ WFC: Entity Declared ] @@ -7894,8 +7947,9 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt) */ if ((ctxt->sax != NULL) && (ctxt->sax->getParameterEntity != NULL)) - entity = ctxt->sax->getParameterEntity(ctxt->userData, - name); + entity = ctxt->sax->getParameterEntity(ctxt->userData, name); + if (ctxt->instate == XML_PARSER_EOF) + return; if (entity == NULL) { /* * [ WFC: Entity Declared ] @@ -8132,8 +8186,11 @@ xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) { */ if ((ctxt->sax != NULL) && (ctxt->sax->getParameterEntity != NULL)) - entity = ctxt->sax->getParameterEntity(ctxt->userData, - name); + entity = ctxt->sax->getParameterEntity(ctxt->userData, name); + if (ctxt->instate == XML_PARSER_EOF) { + xmlFree(name); + return(NULL); + } if (entity == NULL) { /* * [ WFC: Entity Declared ] @@ -8235,6 +8292,8 @@ xmlParseDocTypeDecl(xmlParserCtxtPtr ctxt) { if ((ctxt->sax != NULL) && (ctxt->sax->internalSubset != NULL) && (!ctxt->disableSAX)) ctxt->sax->internalSubset(ctxt->userData, name, ExternalID, URI); + if (ctxt->instate == XML_PARSER_EOF) + return; /* * Is there any internal subset declarations ? @@ -8897,7 +8956,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, if (((in - start) > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, - "AttValue lenght too long\n"); + "AttValue length too long\n"); return(NULL); } } @@ -8919,7 +8978,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, if (((in - start) > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, - "AttValue lenght too long\n"); + "AttValue length too long\n"); return(NULL); } } @@ -8948,7 +9007,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, if (((in - start) > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, - "AttValue lenght too long\n"); + "AttValue length too long\n"); return(NULL); } } @@ -8956,7 +9015,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, if (((in - start) > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, - "AttValue lenght too long\n"); + "AttValue length too long\n"); return(NULL); } if (*in != limit) goto need_complex; @@ -8978,7 +9037,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, if (((in - start) > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, - "AttValue lenght too long\n"); + "AttValue length too long\n"); return(NULL); } } @@ -8987,7 +9046,7 @@ xmlParseAttValueInternal(xmlParserCtxtPtr ctxt, int *len, int *alloc, if (((in - start) > XML_MAX_TEXT_LENGTH) && ((ctxt->options & XML_PARSE_HUGE) == 0)) { xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED, - "AttValue lenght too long\n"); + "AttValue length too long\n"); return(NULL); } if (*in != limit) goto need_complex; @@ -9993,6 +10052,8 @@ xmlParseElement(xmlParserCtxtPtr ctxt) { * Parse the content of the element: */ xmlParseContent(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + return; if (!IS_BYTE_CHAR(RAW)) { xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED, "Premature end of data in tag %s line %d\n", @@ -10565,6 +10626,8 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { */ if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator); + if (ctxt->instate == XML_PARSER_EOF) + return(-1); if ((ctxt->encoding == NULL) && ((ctxt->input->end - ctxt->input->cur) >= 4)) { @@ -10616,6 +10679,8 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { } if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX)) ctxt->sax->startDocument(ctxt->userData); + if (ctxt->instate == XML_PARSER_EOF) + return(-1); /* * The Misc part of the Prolog @@ -10635,6 +10700,8 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { if (RAW == '[') { ctxt->instate = XML_PARSER_DTD; xmlParseInternalSubset(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + return(-1); } /* @@ -10645,6 +10712,8 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) { (!ctxt->disableSAX)) ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName, ctxt->extSubSystem, ctxt->extSubURI); + if (ctxt->instate == XML_PARSER_EOF) + return(-1); ctxt->inSubset = 0; xmlCleanSpecialAttr(ctxt); @@ -10785,6 +10854,8 @@ xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) { } if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX)) ctxt->sax->startDocument(ctxt->userData); + if (ctxt->instate == XML_PARSER_EOF) + return(-1); /* * Doing validity checking on chunk doesn't make sense @@ -10795,6 +10866,8 @@ xmlParseExtParsedEnt(xmlParserCtxtPtr ctxt) { ctxt->depth = 0; xmlParseContent(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + return(-1); if ((RAW == '<') && (NXT(1) == '/')) { xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL); @@ -11102,7 +11175,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { } xmlParseGetLasts(ctxt, &lastlt, &lastgt); - while (1) { + while (ctxt->instate != XML_PARSER_EOF) { if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1)) return(0); @@ -11121,9 +11194,13 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { /* * If we are operating on converted input, try to flush * remainng chars to avoid them stalling in the non-converted - * buffer. + * buffer. But do not do this in document start where + * encoding="..." may not have been read and we work on a + * guessed encoding. */ - if (xmlBufIsEmpty(ctxt->input->buf->buffer) == 0) { + if ((ctxt->instate != XML_PARSER_START) && + (ctxt->input->buf->raw != NULL) && + (xmlBufIsEmpty(ctxt->input->buf->raw) == 0)) { size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input); size_t current = ctxt->input->cur - ctxt->input->base; @@ -11338,6 +11415,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { ctxt->sax->endElement(ctxt->userData, name); #endif /* LIBXML_SAX1_ENABLED */ } + if (ctxt->instate == XML_PARSER_EOF) + goto done; spacePop(ctxt); if (ctxt->nameNr == 0) { ctxt->instate = XML_PARSER_EPILOG; @@ -11528,6 +11607,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { ctxt->sax->characters(ctxt->userData, ctxt->input->cur, tmp); } + if (ctxt->instate == XML_PARSER_EOF) + goto done; SKIPL(tmp); ctxt->checkIndex = 0; } @@ -11563,6 +11644,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { ctxt->sax->characters(ctxt->userData, ctxt->input->cur, base); } + if (ctxt->instate == XML_PARSER_EOF) + goto done; SKIPL(base + 3); ctxt->checkIndex = 0; ctxt->instate = XML_PARSER_CONTENT; @@ -11596,6 +11679,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { "PP: Parsing PI\n"); #endif xmlParsePI(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + goto done; ctxt->instate = XML_PARSER_MISC; ctxt->progressive = 1; ctxt->checkIndex = 0; @@ -11612,6 +11697,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { "PP: Parsing Comment\n"); #endif xmlParseComment(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + goto done; ctxt->instate = XML_PARSER_MISC; ctxt->progressive = 1; ctxt->checkIndex = 0; @@ -11633,9 +11720,11 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { "PP: Parsing internal subset\n"); #endif ctxt->inSubset = 1; - ctxt->progressive = 1; + ctxt->progressive = 0; ctxt->checkIndex = 0; xmlParseDocTypeDecl(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + goto done; if (RAW == '[') { ctxt->instate = XML_PARSER_DTD; #ifdef DEBUG_PUSH @@ -11695,6 +11784,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { "PP: Parsing PI\n"); #endif xmlParsePI(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + goto done; ctxt->instate = XML_PARSER_PROLOG; ctxt->progressive = 1; } else if ((cur == '<') && (next == '!') && @@ -11709,6 +11800,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { "PP: Parsing Comment\n"); #endif xmlParseComment(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + goto done; ctxt->instate = XML_PARSER_PROLOG; ctxt->progressive = 1; } else if ((cur == '<') && (next == '!') && @@ -11747,6 +11840,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { "PP: Parsing PI\n"); #endif xmlParsePI(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + goto done; ctxt->instate = XML_PARSER_EPILOG; ctxt->progressive = 1; } else if ((cur == '<') && (next == '!') && @@ -11761,6 +11856,8 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) { "PP: Parsing Comment\n"); #endif xmlParseComment(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + goto done; ctxt->instate = XML_PARSER_EPILOG; ctxt->progressive = 1; } else if ((cur == '<') && (next == '!') && @@ -11891,6 +11988,8 @@ not_end_of_int_subset: found_end_int_subset: ctxt->checkIndex = 0; xmlParseInternalSubset(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + goto done; ctxt->inSubset = 2; if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && (ctxt->sax->externalSubset != NULL)) @@ -11898,6 +11997,8 @@ found_end_int_subset: ctxt->extSubSystem, ctxt->extSubURI); ctxt->inSubset = 0; xmlCleanSpecialAttr(ctxt); + if (ctxt->instate == XML_PARSER_EOF) + goto done; ctxt->instate = XML_PARSER_PROLOG; ctxt->checkIndex = 0; #ifdef DEBUG_PUSH @@ -12041,7 +12142,7 @@ xmlParseCheckTransition(xmlParserCtxtPtr ctxt, const char *chunk, int size) { } if ((ctxt->progressive == XML_PARSER_DTD) || (ctxt->instate == XML_PARSER_DTD)) { - if (memchr(chunk, ']', size) != NULL) + if (memchr(chunk, '>', size) != NULL) return(1); return(0); } @@ -12125,7 +12226,7 @@ xmldecl_done: remain = 0; } } - res =xmlParserInputBufferPush(ctxt->input->buf, size, chunk); + res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk); if (res < 0) { ctxt->errNo = XML_PARSER_EOF; ctxt->disableSAX = 1; @@ -12142,14 +12243,17 @@ xmldecl_done: if ((in->encoder != NULL) && (in->buffer != NULL) && (in->raw != NULL)) { int nbchars; + size_t base = xmlBufGetInputBase(in->buffer, ctxt->input); + size_t current = ctxt->input->cur - ctxt->input->base; - nbchars = xmlCharEncInput(in); + nbchars = xmlCharEncInput(in, terminate); if (nbchars < 0) { /* TODO 2.6.0 */ xmlGenericError(xmlGenericErrorContext, "xmlParseChunk: encoder error\n"); return(XML_ERR_INVALID_ENCODING); } + xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current); } } } @@ -12171,6 +12275,9 @@ xmldecl_done: avail - old_avail))) xmlParseTryOrFinish(ctxt, terminate); } + if (ctxt->instate == XML_PARSER_EOF) + return(ctxt->errNo); + if ((ctxt->input != NULL) && (((ctxt->input->end - ctxt->input->cur) > XML_MAX_LOOKUP_LIMIT) || ((ctxt->input->cur - ctxt->input->base) > XML_MAX_LOOKUP_LIMIT)) && @@ -12189,7 +12296,14 @@ xmldecl_done: } if ((end_in_lf == 1) && (ctxt->input != NULL) && (ctxt->input->buf != NULL)) { + size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, + ctxt->input); + size_t current = ctxt->input->cur - ctxt->input->base; + xmlParserInputBufferPush(ctxt->input->buf, 1, "\r"); + + xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, + base, current); } if (terminate) { /* @@ -12219,7 +12333,10 @@ xmldecl_done: } ctxt->instate = XML_PARSER_EOF; } - return((xmlParserErrors) ctxt->errNo); + if (ctxt->wellFormed == 0) + return((xmlParserErrors) ctxt->errNo); + else + return(0); } /************************************************************************ @@ -12364,6 +12481,7 @@ xmlStopParser(xmlParserCtxtPtr ctxt) { if (ctxt == NULL) return; ctxt->instate = XML_PARSER_EOF; + ctxt->errNo = XML_ERR_USER_STOP; ctxt->disableSAX = 1; if (ctxt->input != NULL) { ctxt->input->cur = BAD_CAST""; @@ -14749,6 +14867,7 @@ xmlCtxtReset(xmlParserCtxtPtr ctxt) ctxt->catalogs = NULL; ctxt->nbentities = 0; ctxt->sizeentities = 0; + ctxt->sizeentcopy = 0; xmlInitNodeInfoSeq(&ctxt->node_seq); if (ctxt->attsDefault != NULL) { diff --git a/reactos/lib/3rdparty/libxml2/parserInternals.c b/reactos/lib/3rdparty/libxml2/parserInternals.c index 35a90ab733a..f8a70410680 100644 --- a/reactos/lib/3rdparty/libxml2/parserInternals.c +++ b/reactos/lib/3rdparty/libxml2/parserInternals.c @@ -1201,7 +1201,7 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, /* * convert as much as possible of the buffer */ - nbchars = xmlCharEncInput(input->buf); + nbchars = xmlCharEncInput(input->buf, 1); } else { /* * convert just enough to get @@ -1253,7 +1253,7 @@ xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, * xmlSwitchToEncodingInt: * @ctxt: the parser context * @handler: the encoding handler - * @len: the lenght to convert or -1 + * @len: the length to convert or -1 * * change the input functions when discovering the character encoding * of a given entity, and convert only @len bytes of the output, this @@ -1719,6 +1719,8 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt) ctxt->charset = XML_CHAR_ENCODING_UTF8; ctxt->catalogs = NULL; ctxt->nbentities = 0; + ctxt->sizeentities = 0; + ctxt->sizeentcopy = 0; ctxt->input_id = 1; xmlInitNodeInfoSeq(&ctxt->node_seq); return(0); diff --git a/reactos/lib/3rdparty/libxml2/regressions.py b/reactos/lib/3rdparty/libxml2/regressions.py deleted file mode 100644 index 0e813c2ea33..00000000000 --- a/reactos/lib/3rdparty/libxml2/regressions.py +++ /dev/null @@ -1,350 +0,0 @@ -#!/usr/bin/python -u -import glob, os, string, sys, thread, time -# import difflib -import libxml2 - -### -# -# This is a "Work in Progress" attempt at a python script to run the -# various regression tests. The rationale for this is that it should be -# possible to run this on most major platforms, including those (such as -# Windows) which don't support gnu Make. -# -# The script is driven by a parameter file which defines the various tests -# to be run, together with the unique settings for each of these tests. A -# script for Linux is included (regressions.xml), with comments indicating -# the significance of the various parameters. To run the tests under Windows, -# edit regressions.xml and remove the comment around the default parameter -# "" (i.e. make it point to the location of the binary executables). -# -# Note that this current version requires the Python bindings for libxml2 to -# have been previously installed and accessible -# -# See Copyright for the status of this software. -# William Brack (wbrack@mmm.com.hk) -# -### -defaultParams = {} # will be used as a dictionary to hold the parsed params - -# This routine is used for comparing the expected stdout / stdin with the results. -# The expected data has already been read in; the result is a file descriptor. -# Within the two sets of data, lines may begin with a path string. If so, the -# code "relativises" it by removing the path component. The first argument is a -# list already read in by a separate thread; the second is a file descriptor. -# The two 'base' arguments are to let me "relativise" the results files, allowing -# the script to be run from any directory. -def compFiles(res, expected, base1, base2): - l1 = len(base1) - exp = expected.readlines() - expected.close() - # the "relativisation" is done here - for i in range(len(res)): - j = string.find(res[i],base1) - if (j == 0) or ((j == 2) and (res[i][0:2] == './')): - col = string.find(res[i],':') - if col > 0: - start = string.rfind(res[i][:col], '/') - if start > 0: - res[i] = res[i][start+1:] - - for i in range(len(exp)): - j = string.find(exp[i],base2) - if (j == 0) or ((j == 2) and (exp[i][0:2] == './')): - col = string.find(exp[i],':') - if col > 0: - start = string.rfind(exp[i][:col], '/') - if start > 0: - exp[i] = exp[i][start+1:] - - ret = 0 - # ideally we would like to use difflib functions here to do a - # nice comparison of the two sets. Unfortunately, during testing - # (using python 2.3.3 and 2.3.4) the following code went into - # a dead loop under windows. I'll pursue this later. -# diff = difflib.ndiff(res, exp) -# diff = list(diff) -# for line in diff: -# if line[:2] != ' ': -# print string.strip(line) -# ret = -1 - - # the following simple compare is fine for when the two data sets - # (actual result vs. expected result) are equal, which should be true for - # us. Unfortunately, if the test fails it's not nice at all. - rl = len(res) - el = len(exp) - if el != rl: - print 'Length of expected is %d, result is %d' % (el, rl) - ret = -1 - for i in range(min(el, rl)): - if string.strip(res[i]) != string.strip(exp[i]): - print '+:%s-:%s' % (res[i], exp[i]) - ret = -1 - if el > rl: - for i in range(rl, el): - print '-:%s' % exp[i] - ret = -1 - elif rl > el: - for i in range (el, rl): - print '+:%s' % res[i] - ret = -1 - return ret - -# Separate threads to handle stdout and stderr are created to run this function -def readPfile(file, list, flag): - data = file.readlines() # no call by reference, so I cheat - for l in data: - list.append(l) - file.close() - flag.append('ok') - -# This routine runs the test program (e.g. xmllint) -def runOneTest(testDescription, filename, inbase, errbase): - if 'execpath' in testDescription: - dir = testDescription['execpath'] + '/' - else: - dir = '' - cmd = os.path.abspath(dir + testDescription['testprog']) - if 'flag' in testDescription: - for f in string.split(testDescription['flag']): - cmd += ' ' + f - if 'stdin' not in testDescription: - cmd += ' ' + inbase + filename - if 'extarg' in testDescription: - cmd += ' ' + testDescription['extarg'] - - noResult = 0 - expout = None - if 'resext' in testDescription: - if testDescription['resext'] == 'None': - noResult = 1 - else: - ext = '.' + testDescription['resext'] - else: - ext = '' - if not noResult: - try: - fname = errbase + filename + ext - expout = open(fname, 'rt') - except: - print "Can't open result file %s - bypassing test" % fname - return - - noErrors = 0 - if 'reserrext' in testDescription: - if testDescription['reserrext'] == 'None': - noErrors = 1 - else: - if len(testDescription['reserrext'])>0: - ext = '.' + testDescription['reserrext'] - else: - ext = '' - else: - ext = '' - if not noErrors: - try: - fname = errbase + filename + ext - experr = open(fname, 'rt') - except: - experr = None - else: - experr = None - - pin, pout, perr = os.popen3(cmd) - if 'stdin' in testDescription: - infile = open(inbase + filename, 'rt') - pin.writelines(infile.readlines()) - infile.close() - pin.close() - - # popen is great fun, but can lead to the old "deadly embrace", because - # synchronizing the writing (by the task being run) of stdout and stderr - # with respect to the reading (by this task) is basically impossible. I - # tried several ways to cheat, but the only way I have found which works - # is to do a *very* elementary multi-threading approach. We can only hope - # that Python threads are implemented on the target system (it's okay for - # Linux and Windows) - - th1Flag = [] # flags to show when threads finish - th2Flag = [] - outfile = [] # lists to contain the pipe data - errfile = [] - th1 = thread.start_new_thread(readPfile, (pout, outfile, th1Flag)) - th2 = thread.start_new_thread(readPfile, (perr, errfile, th2Flag)) - while (len(th1Flag)==0) or (len(th2Flag)==0): - time.sleep(0.001) - if not noResult: - ret = compFiles(outfile, expout, inbase, 'test/') - if ret != 0: - print 'trouble with %s' % cmd - else: - if len(outfile) != 0: - for l in outfile: - print l - print 'trouble with %s' % cmd - if experr != None: - ret = compFiles(errfile, experr, inbase, 'test/') - if ret != 0: - print 'trouble with %s' % cmd - else: - if not noErrors: - if len(errfile) != 0: - for l in errfile: - print l - print 'trouble with %s' % cmd - - if 'stdin' not in testDescription: - pin.close() - -# This routine is called by the parameter decoding routine whenever the end of a -# 'test' section is encountered. Depending upon file globbing, a large number of -# individual tests may be run. -def runTest(description): - testDescription = defaultParams.copy() # set defaults - testDescription.update(description) # override with current ent - if 'testname' in testDescription: - print "## %s" % testDescription['testname'] - if not 'file' in testDescription: - print "No file specified - can't run this test!" - return - # Set up the source and results directory paths from the decoded params - dir = '' - if 'srcdir' in testDescription: - dir += testDescription['srcdir'] + '/' - if 'srcsub' in testDescription: - dir += testDescription['srcsub'] + '/' - - rdir = '' - if 'resdir' in testDescription: - rdir += testDescription['resdir'] + '/' - if 'ressub' in testDescription: - rdir += testDescription['ressub'] + '/' - - testFiles = glob.glob(os.path.abspath(dir + testDescription['file'])) - if testFiles == []: - print "No files result from '%s'" % testDescription['file'] - return - - # Some test programs just don't work (yet). For now we exclude them. - count = 0 - excl = [] - if 'exclfile' in testDescription: - for f in string.split(testDescription['exclfile']): - glb = glob.glob(dir + f) - for g in glb: - excl.append(os.path.abspath(g)) - - # Run the specified test program - for f in testFiles: - if not os.path.isdir(f): - if f not in excl: - count = count + 1 - runOneTest(testDescription, os.path.basename(f), dir, rdir) - -# -# The following classes are used with the xmlreader interface to interpret the -# parameter file. Once a test section has been identified, runTest is called -# with a dictionary containing the parsed results of the interpretation. -# - -class testDefaults: - curText = '' # accumulates text content of parameter - - def addToDict(self, key): - txt = string.strip(self.curText) -# if txt == '': -# return - if key not in defaultParams: - defaultParams[key] = txt - else: - defaultParams[key] += ' ' + txt - - def processNode(self, reader, curClass): - if reader.Depth() == 2: - if reader.NodeType() == 1: - self.curText = '' # clear the working variable - elif reader.NodeType() == 15: - if (reader.Name() != '#text') and (reader.Name() != '#comment'): - self.addToDict(reader.Name()) - elif reader.Depth() == 3: - if reader.Name() == '#text': - self.curText += reader.Value() - - elif reader.NodeType() == 15: # end of element - print "Defaults have been set to:" - for k in defaultParams.keys(): - print " %s : '%s'" % (k, defaultParams[k]) - curClass = rootClass() - return curClass - - -class testClass: - def __init__(self): - self.testParams = {} # start with an empty set of params - self.curText = '' # and empty text - - def addToDict(self, key): - data = string.strip(self.curText) - if key not in self.testParams: - self.testParams[key] = data - else: - if self.testParams[key] != '': - data = ' ' + data - self.testParams[key] += data - - def processNode(self, reader, curClass): - if reader.Depth() == 2: - if reader.NodeType() == 1: - self.curText = '' # clear the working variable - if reader.Name() not in self.testParams: - self.testParams[reader.Name()] = '' - elif reader.NodeType() == 15: - if (reader.Name() != '#text') and (reader.Name() != '#comment'): - self.addToDict(reader.Name()) - elif reader.Depth() == 3: - if reader.Name() == '#text': - self.curText += reader.Value() - - elif reader.NodeType() == 15: # end of element - runTest(self.testParams) - curClass = rootClass() - return curClass - - -class rootClass: - def processNode(self, reader, curClass): - if reader.Depth() == 0: - return curClass - if reader.Depth() != 1: - print "Unexpected junk: Level %d, type %d, name %s" % ( - reader.Depth(), reader.NodeType(), reader.Name()) - return curClass - if reader.Name() == 'test': - curClass = testClass() - curClass.testParams = {} - elif reader.Name() == 'defaults': - curClass = testDefaults() - return curClass - -def streamFile(filename): - try: - reader = libxml2.newTextReaderFilename(filename) - except: - print "unable to open %s" % (filename) - return - - curClass = rootClass() - ret = reader.Read() - while ret == 1: - curClass = curClass.processNode(reader, curClass) - ret = reader.Read() - - if ret != 0: - print "%s : failed to parse" % (filename) - -# OK, we're finished with all the routines. Now for the main program:- -if len(sys.argv) != 2: - print "Usage: maketest {filename}" - sys.exit(-1) - -streamFile(sys.argv[1]) diff --git a/reactos/lib/3rdparty/libxml2/regressions.xml b/reactos/lib/3rdparty/libxml2/regressions.xml deleted file mode 100644 index c78838ac51e..00000000000 --- a/reactos/lib/3rdparty/libxml2/regressions.xml +++ /dev/null @@ -1,226 +0,0 @@ - - - - - - noname - - . - xmllint - test - result - *.xml - err - - - - - XML Regression Tests - failed to load external entity - - - XML Entity Subst Regression Tests - noent - --noent - - - XML Namespaces Regression Tests - namespaces - namespaces - - - xml:id Regression Tests - testXPath - xmlid - xmlid - -i - id_*.xml - "id('bar')" - - - Error Cases Regression Tests - errors - errors - - - Error Cases Stream Regression Tests - errors - errors - str - --stream - - - Reader Regression Tests - rdr - --nonet - --debug - --stream - * - None - - - Walker Regression Tests - rdr - --nonet - --debug - --walker - * - None - - - Reader Entities Substitution Regression Tests - rde - --nonet - --debug - --stream - --noent - * - None - - - SAX Callbacks Regression Tests - testSAX - sax - * - utf16*.xml - None - - - XML Push Regression Tests - --push - failed to load external entity - - - HTML Regression Tests - testHTML - HTML - HTML - * - wired.html - - - Push HTML Regression Tests - testHTML - --push - HTML - HTML - * - - - HTML SAX Regression Tests - testHTML - --sax - HTML - HTML - sax - None - * - - - Push HTML SAX Regression Tests - testHTML - --sax - --push - HTML - HTML - sax - None - * - - - Valid Documents Regression Tests - VCM - VCM - None - None - * - --valid - --noout - --nowarning - - - Validity Checking Regression Tests - VC - VC - None - - * - --valid - --noout - - - General Documents Valid Regression Tests - valid - valid - * - --valid - - - URI Module Regression Tests (1) - testURI - URI - - URI - None - *.data - - -base "http://foo.com/path/to/index.html?orig#help" - - - URI Module Regression Tests (2) - testURI - URI - - URI - None - *.uri - - - XPath Regression Tests (1) - testXPath - XPath/expr - XPath/expr - * - -f - --expr - - - XInclude Regression Tests - XInclude/docs - XInclude - * - --nowarning - --xinclude - - - XInclude xmlReader Regression Tests - XInclude/docs - XInclude - rdr - * - --nowarning - --xinclude - --stream - --debug - - diff --git a/reactos/lib/3rdparty/libxml2/relaxng.c b/reactos/lib/3rdparty/libxml2/relaxng.c index f600d07e50c..370e314ceac 100644 --- a/reactos/lib/3rdparty/libxml2/relaxng.c +++ b/reactos/lib/3rdparty/libxml2/relaxng.c @@ -8347,7 +8347,7 @@ xmlRelaxNGValidatePushElement(xmlRelaxNGValidCtxtPtr ctxt, * xmlRelaxNGValidatePushCData: * @ctxt: the RelaxNG validation context * @data: some character data read - * @len: the lenght of the data + * @len: the length of the data * * check the CData parsed for validation in the current stack * diff --git a/reactos/lib/3rdparty/libxml2/runsuite.c b/reactos/lib/3rdparty/libxml2/runsuite.c deleted file mode 100644 index aaab13e1ee6..00000000000 --- a/reactos/lib/3rdparty/libxml2/runsuite.c +++ /dev/null @@ -1,1172 +0,0 @@ -/* - * runsuite.c: C program to run libxml2 againts published testsuites - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#include "libxml.h" -#include - -#if !defined(_WIN32) || defined(__CYGWIN__) -#include -#endif -#include -#include -#include -#include - -#include -#include -#include -#include -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_XPATH_ENABLED) -#include - -#include -#include - -#include -#include -#include - -#define LOGFILE "runsuite.log" -static FILE *logfile = NULL; -static int verbose = 0; - - -/************************************************************************ - * * - * File name and path utilities * - * * - ************************************************************************/ - -static int checkTestFile(const char *filename) { - struct stat buf; - - if (stat(filename, &buf) == -1) - return(0); - -#if defined(_WIN32) && !defined(__CYGWIN__) - if (!(buf.st_mode & _S_IFREG)) - return(0); -#else - if (!S_ISREG(buf.st_mode)) - return(0); -#endif - - return(1); -} - -static xmlChar *composeDir(const xmlChar *dir, const xmlChar *path) { - char buf[500]; - - if (dir == NULL) return(xmlStrdup(path)); - if (path == NULL) return(NULL); - - snprintf(buf, 500, "%s/%s", (const char *) dir, (const char *) path); - return(xmlStrdup((const xmlChar *) buf)); -} - -/************************************************************************ - * * - * Libxml2 specific routines * - * * - ************************************************************************/ - -static int nb_tests = 0; -static int nb_errors = 0; -static int nb_internals = 0; -static int nb_schematas = 0; -static int nb_unimplemented = 0; -static int nb_leaks = 0; -static int extraMemoryFromResolver = 0; - -static int -fatalError(void) { - fprintf(stderr, "Exitting tests on fatal error\n"); - exit(1); -} - -/* - * that's needed to implement - */ -#define MAX_ENTITIES 20 -static char *testEntitiesName[MAX_ENTITIES]; -static char *testEntitiesValue[MAX_ENTITIES]; -static int nb_entities = 0; -static void resetEntities(void) { - int i; - - for (i = 0;i < nb_entities;i++) { - if (testEntitiesName[i] != NULL) - xmlFree(testEntitiesName[i]); - if (testEntitiesValue[i] != NULL) - xmlFree(testEntitiesValue[i]); - } - nb_entities = 0; -} -static int addEntity(char *name, char *content) { - if (nb_entities >= MAX_ENTITIES) { - fprintf(stderr, "Too many entities defined\n"); - return(-1); - } - testEntitiesName[nb_entities] = name; - testEntitiesValue[nb_entities] = content; - nb_entities++; - return(0); -} - -/* - * We need to trap calls to the resolver to not account memory for the catalog - * which is shared to the current running test. We also don't want to have - * network downloads modifying tests. - */ -static xmlParserInputPtr -testExternalEntityLoader(const char *URL, const char *ID, - xmlParserCtxtPtr ctxt) { - xmlParserInputPtr ret; - int i; - - for (i = 0;i < nb_entities;i++) { - if (!strcmp(testEntitiesName[i], URL)) { - ret = xmlNewStringInputStream(ctxt, - (const xmlChar *) testEntitiesValue[i]); - if (ret != NULL) { - ret->filename = (const char *) - xmlStrdup((xmlChar *)testEntitiesName[i]); - } - return(ret); - } - } - if (checkTestFile(URL)) { - ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); - } else { - int memused = xmlMemUsed(); - ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); - extraMemoryFromResolver += xmlMemUsed() - memused; - } -#if 0 - if (ret == NULL) { - fprintf(stderr, "Failed to find resource %s\n", URL); - } -#endif - - return(ret); -} - -/* - * Trapping the error messages at the generic level to grab the equivalent of - * stderr messages on CLI tools. - */ -static char testErrors[32769]; -static int testErrorsSize = 0; - -static void test_log(const char *msg, ...) { - va_list args; - if (logfile != NULL) { - fprintf(logfile, "\n------------\n"); - va_start(args, msg); - vfprintf(logfile, msg, args); - va_end(args); - fprintf(logfile, "%s", testErrors); - testErrorsSize = 0; testErrors[0] = 0; - } - if (verbose) { - va_start(args, msg); - vfprintf(stderr, msg, args); - va_end(args); - } -} - -static void -testErrorHandler(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { - va_list args; - int res; - - if (testErrorsSize >= 32768) - return; - va_start(args, msg); - res = vsnprintf(&testErrors[testErrorsSize], - 32768 - testErrorsSize, - msg, args); - va_end(args); - if (testErrorsSize + res >= 32768) { - /* buffer is full */ - testErrorsSize = 32768; - testErrors[testErrorsSize] = 0; - } else { - testErrorsSize += res; - } - testErrors[testErrorsSize] = 0; -} - -static xmlXPathContextPtr ctxtXPath; - -static void -initializeLibxml2(void) { - xmlGetWarningsDefaultValue = 0; - xmlPedanticParserDefault(0); - - xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup); - xmlInitParser(); - xmlSetExternalEntityLoader(testExternalEntityLoader); - ctxtXPath = xmlXPathNewContext(NULL); - /* - * Deactivate the cache if created; otherwise we have to create/free it - * for every test, since it will confuse the memory leak detection. - * Note that normally this need not be done, since the cache is not - * created until set explicitely with xmlXPathContextSetCache(); - * but for test purposes it is sometimes usefull to activate the - * cache by default for the whole library. - */ - if (ctxtXPath->cache != NULL) - xmlXPathContextSetCache(ctxtXPath, 0, -1, 0); - /* used as default nanemspace in xstc tests */ - xmlXPathRegisterNs(ctxtXPath, BAD_CAST "ts", BAD_CAST "TestSuite"); - xmlXPathRegisterNs(ctxtXPath, BAD_CAST "xlink", - BAD_CAST "http://www.w3.org/1999/xlink"); - xmlSetGenericErrorFunc(NULL, testErrorHandler); -#ifdef LIBXML_SCHEMAS_ENABLED - xmlSchemaInitTypes(); - xmlRelaxNGInitTypes(); -#endif -} - -static xmlNodePtr -getNext(xmlNodePtr cur, const char *xpath) { - xmlNodePtr ret = NULL; - xmlXPathObjectPtr res; - xmlXPathCompExprPtr comp; - - if ((cur == NULL) || (cur->doc == NULL) || (xpath == NULL)) - return(NULL); - ctxtXPath->doc = cur->doc; - ctxtXPath->node = cur; - comp = xmlXPathCompile(BAD_CAST xpath); - if (comp == NULL) { - fprintf(stderr, "Failed to compile %s\n", xpath); - return(NULL); - } - res = xmlXPathCompiledEval(comp, ctxtXPath); - xmlXPathFreeCompExpr(comp); - if (res == NULL) - return(NULL); - if ((res->type == XPATH_NODESET) && - (res->nodesetval != NULL) && - (res->nodesetval->nodeNr > 0) && - (res->nodesetval->nodeTab != NULL)) - ret = res->nodesetval->nodeTab[0]; - xmlXPathFreeObject(res); - return(ret); -} - -static xmlChar * -getString(xmlNodePtr cur, const char *xpath) { - xmlChar *ret = NULL; - xmlXPathObjectPtr res; - xmlXPathCompExprPtr comp; - - if ((cur == NULL) || (cur->doc == NULL) || (xpath == NULL)) - return(NULL); - ctxtXPath->doc = cur->doc; - ctxtXPath->node = cur; - comp = xmlXPathCompile(BAD_CAST xpath); - if (comp == NULL) { - fprintf(stderr, "Failed to compile %s\n", xpath); - return(NULL); - } - res = xmlXPathCompiledEval(comp, ctxtXPath); - xmlXPathFreeCompExpr(comp); - if (res == NULL) - return(NULL); - if (res->type == XPATH_STRING) { - ret = res->stringval; - res->stringval = NULL; - } - xmlXPathFreeObject(res); - return(ret); -} - -/************************************************************************ - * * - * Test test/xsdtest/xsdtestsuite.xml * - * * - ************************************************************************/ - -static int -xsdIncorectTestCase(xmlNodePtr cur) { - xmlNodePtr test; - xmlBufferPtr buf; - xmlRelaxNGParserCtxtPtr pctxt; - xmlRelaxNGPtr rng = NULL; - int ret = 0, memt; - - cur = getNext(cur, "./incorrect[1]"); - if (cur == NULL) { - return(0); - } - - test = getNext(cur, "./*"); - if (test == NULL) { - test_log("Failed to find test in correct line %ld\n", - xmlGetLineNo(cur)); - return(1); - } - - memt = xmlMemUsed(); - extraMemoryFromResolver = 0; - /* - * dump the schemas to a buffer, then reparse it and compile the schemas - */ - buf = xmlBufferCreate(); - if (buf == NULL) { - fprintf(stderr, "out of memory !\n"); - fatalError(); - } - xmlNodeDump(buf, test->doc, test, 0, 0); - pctxt = xmlRelaxNGNewMemParserCtxt((const char *)buf->content, buf->use); - xmlRelaxNGSetParserErrors(pctxt, - (xmlRelaxNGValidityErrorFunc) testErrorHandler, - (xmlRelaxNGValidityWarningFunc) testErrorHandler, - pctxt); - rng = xmlRelaxNGParse(pctxt); - xmlRelaxNGFreeParserCtxt(pctxt); - if (rng != NULL) { - test_log("Failed to detect incorect RNG line %ld\n", - xmlGetLineNo(test)); - ret = 1; - goto done; - } - -done: - if (buf != NULL) - xmlBufferFree(buf); - if (rng != NULL) - xmlRelaxNGFree(rng); - xmlResetLastError(); - if ((memt < xmlMemUsed()) && (extraMemoryFromResolver == 0)) { - test_log("Validation of tests starting line %ld leaked %d\n", - xmlGetLineNo(cur), xmlMemUsed() - memt); - nb_leaks++; - } - return(ret); -} - -static void -installResources(xmlNodePtr tst, const xmlChar *base) { - xmlNodePtr test; - xmlBufferPtr buf; - xmlChar *name, *content, *res; - - buf = xmlBufferCreate(); - if (buf == NULL) { - fprintf(stderr, "out of memory !\n"); - fatalError(); - } - xmlNodeDump(buf, tst->doc, tst, 0, 0); - - while (tst != NULL) { - test = getNext(tst, "./*"); - if (test != NULL) { - xmlBufferEmpty(buf); - xmlNodeDump(buf, test->doc, test, 0, 0); - name = getString(tst, "string(@name)"); - content = xmlStrdup(buf->content); - if ((name != NULL) && (content != NULL)) { - res = composeDir(base, name); - xmlFree(name); - addEntity((char *) res, (char *) content); - } else { - if (name != NULL) xmlFree(name); - if (content != NULL) xmlFree(content); - } - } - tst = getNext(tst, "following-sibling::resource[1]"); - } - if (buf != NULL) - xmlBufferFree(buf); -} - -static void -installDirs(xmlNodePtr tst, const xmlChar *base) { - xmlNodePtr test; - xmlChar *name, *res; - - name = getString(tst, "string(@name)"); - if (name == NULL) - return; - res = composeDir(base, name); - xmlFree(name); - if (res == NULL) { - return; - } - /* Now process resources and subdir recursively */ - test = getNext(tst, "./resource[1]"); - if (test != NULL) { - installResources(test, res); - } - test = getNext(tst, "./dir[1]"); - while (test != NULL) { - installDirs(test, res); - test = getNext(test, "following-sibling::dir[1]"); - } - xmlFree(res); -} - -static int -xsdTestCase(xmlNodePtr tst) { - xmlNodePtr test, tmp, cur; - xmlBufferPtr buf; - xmlDocPtr doc = NULL; - xmlRelaxNGParserCtxtPtr pctxt; - xmlRelaxNGValidCtxtPtr ctxt; - xmlRelaxNGPtr rng = NULL; - int ret = 0, mem, memt; - xmlChar *dtd; - - resetEntities(); - testErrorsSize = 0; testErrors[0] = 0; - - tmp = getNext(tst, "./dir[1]"); - if (tmp != NULL) { - installDirs(tmp, NULL); - } - tmp = getNext(tst, "./resource[1]"); - if (tmp != NULL) { - installResources(tmp, NULL); - } - - cur = getNext(tst, "./correct[1]"); - if (cur == NULL) { - return(xsdIncorectTestCase(tst)); - } - - test = getNext(cur, "./*"); - if (test == NULL) { - fprintf(stderr, "Failed to find test in correct line %ld\n", - xmlGetLineNo(cur)); - return(1); - } - - memt = xmlMemUsed(); - extraMemoryFromResolver = 0; - /* - * dump the schemas to a buffer, then reparse it and compile the schemas - */ - buf = xmlBufferCreate(); - if (buf == NULL) { - fprintf(stderr, "out of memory !\n"); - fatalError(); - } - xmlNodeDump(buf, test->doc, test, 0, 0); - pctxt = xmlRelaxNGNewMemParserCtxt((const char *)buf->content, buf->use); - xmlRelaxNGSetParserErrors(pctxt, - (xmlRelaxNGValidityErrorFunc) testErrorHandler, - (xmlRelaxNGValidityWarningFunc) testErrorHandler, - pctxt); - rng = xmlRelaxNGParse(pctxt); - xmlRelaxNGFreeParserCtxt(pctxt); - if (extraMemoryFromResolver) - memt = 0; - - if (rng == NULL) { - test_log("Failed to parse RNGtest line %ld\n", - xmlGetLineNo(test)); - nb_errors++; - ret = 1; - goto done; - } - /* - * now scan all the siblings of correct to process the tests - */ - tmp = getNext(cur, "following-sibling::valid[1]"); - while (tmp != NULL) { - dtd = xmlGetProp(tmp, BAD_CAST "dtd"); - test = getNext(tmp, "./*"); - if (test == NULL) { - fprintf(stderr, "Failed to find test in line %ld\n", - xmlGetLineNo(tmp)); - - } else { - xmlBufferEmpty(buf); - if (dtd != NULL) - xmlBufferAdd(buf, dtd, -1); - xmlNodeDump(buf, test->doc, test, 0, 0); - - /* - * We are ready to run the test - */ - mem = xmlMemUsed(); - extraMemoryFromResolver = 0; - doc = xmlReadMemory((const char *)buf->content, buf->use, - "test", NULL, 0); - if (doc == NULL) { - test_log("Failed to parse valid instance line %ld\n", - xmlGetLineNo(tmp)); - nb_errors++; - } else { - nb_tests++; - ctxt = xmlRelaxNGNewValidCtxt(rng); - xmlRelaxNGSetValidErrors(ctxt, - (xmlRelaxNGValidityErrorFunc) testErrorHandler, - (xmlRelaxNGValidityWarningFunc) testErrorHandler, - ctxt); - ret = xmlRelaxNGValidateDoc(ctxt, doc); - xmlRelaxNGFreeValidCtxt(ctxt); - if (ret > 0) { - test_log("Failed to validate valid instance line %ld\n", - xmlGetLineNo(tmp)); - nb_errors++; - } else if (ret < 0) { - test_log("Internal error validating instance line %ld\n", - xmlGetLineNo(tmp)); - nb_errors++; - } - xmlFreeDoc(doc); - } - xmlResetLastError(); - if ((mem != xmlMemUsed()) && (extraMemoryFromResolver == 0)) { - test_log("Validation of instance line %ld leaked %d\n", - xmlGetLineNo(tmp), xmlMemUsed() - mem); - xmlMemoryDump(); - nb_leaks++; - } - } - if (dtd != NULL) - xmlFree(dtd); - tmp = getNext(tmp, "following-sibling::valid[1]"); - } - /* - * now scan all the siblings of correct to process the tests - */ - tmp = getNext(cur, "following-sibling::invalid[1]"); - while (tmp != NULL) { - test = getNext(tmp, "./*"); - if (test == NULL) { - fprintf(stderr, "Failed to find test in line %ld\n", - xmlGetLineNo(tmp)); - - } else { - xmlBufferEmpty(buf); - xmlNodeDump(buf, test->doc, test, 0, 0); - - /* - * We are ready to run the test - */ - mem = xmlMemUsed(); - extraMemoryFromResolver = 0; - doc = xmlReadMemory((const char *)buf->content, buf->use, - "test", NULL, 0); - if (doc == NULL) { - test_log("Failed to parse valid instance line %ld\n", - xmlGetLineNo(tmp)); - nb_errors++; - } else { - nb_tests++; - ctxt = xmlRelaxNGNewValidCtxt(rng); - xmlRelaxNGSetValidErrors(ctxt, - (xmlRelaxNGValidityErrorFunc) testErrorHandler, - (xmlRelaxNGValidityWarningFunc) testErrorHandler, - ctxt); - ret = xmlRelaxNGValidateDoc(ctxt, doc); - xmlRelaxNGFreeValidCtxt(ctxt); - if (ret == 0) { - test_log("Failed to detect invalid instance line %ld\n", - xmlGetLineNo(tmp)); - nb_errors++; - } else if (ret < 0) { - test_log("Internal error validating instance line %ld\n", - xmlGetLineNo(tmp)); - nb_errors++; - } - xmlFreeDoc(doc); - } - xmlResetLastError(); - if ((mem != xmlMemUsed()) && (extraMemoryFromResolver == 0)) { - test_log("Validation of instance line %ld leaked %d\n", - xmlGetLineNo(tmp), xmlMemUsed() - mem); - xmlMemoryDump(); - nb_leaks++; - } - } - tmp = getNext(tmp, "following-sibling::invalid[1]"); - } - -done: - if (buf != NULL) - xmlBufferFree(buf); - if (rng != NULL) - xmlRelaxNGFree(rng); - xmlResetLastError(); - if ((memt != xmlMemUsed()) && (memt != 0)) { - test_log("Validation of tests starting line %ld leaked %d\n", - xmlGetLineNo(cur), xmlMemUsed() - memt); - nb_leaks++; - } - return(ret); -} - -static int -xsdTestSuite(xmlNodePtr cur) { - if (verbose) { - xmlChar *doc = getString(cur, "string(documentation)"); - - if (doc != NULL) { - printf("Suite %s\n", doc); - xmlFree(doc); - } - } - cur = getNext(cur, "./testCase[1]"); - while (cur != NULL) { - xsdTestCase(cur); - cur = getNext(cur, "following-sibling::testCase[1]"); - } - - return(0); -} - -static int -xsdTest(void) { - xmlDocPtr doc; - xmlNodePtr cur; - const char *filename = "test/xsdtest/xsdtestsuite.xml"; - int ret = 0; - - doc = xmlReadFile(filename, NULL, XML_PARSE_NOENT); - if (doc == NULL) { - fprintf(stderr, "Failed to parse %s\n", filename); - return(-1); - } - printf("## XML Schemas datatypes test suite from James Clark\n"); - - cur = xmlDocGetRootElement(doc); - if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "testSuite"))) { - fprintf(stderr, "Unexpected format %s\n", filename); - ret = -1; - goto done; - } - - cur = getNext(cur, "./testSuite[1]"); - if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "testSuite"))) { - fprintf(stderr, "Unexpected format %s\n", filename); - ret = -1; - goto done; - } - while (cur != NULL) { - xsdTestSuite(cur); - cur = getNext(cur, "following-sibling::testSuite[1]"); - } - -done: - if (doc != NULL) - xmlFreeDoc(doc); - return(ret); -} - -static int -rngTestSuite(xmlNodePtr cur) { - if (verbose) { - xmlChar *doc = getString(cur, "string(documentation)"); - - if (doc != NULL) { - printf("Suite %s\n", doc); - xmlFree(doc); - } else { - doc = getString(cur, "string(section)"); - if (doc != NULL) { - printf("Section %s\n", doc); - xmlFree(doc); - } - } - } - cur = getNext(cur, "./testSuite[1]"); - while (cur != NULL) { - xsdTestSuite(cur); - cur = getNext(cur, "following-sibling::testSuite[1]"); - } - - return(0); -} - -static int -rngTest1(void) { - xmlDocPtr doc; - xmlNodePtr cur; - const char *filename = "test/relaxng/OASIS/spectest.xml"; - int ret = 0; - - doc = xmlReadFile(filename, NULL, XML_PARSE_NOENT); - if (doc == NULL) { - fprintf(stderr, "Failed to parse %s\n", filename); - return(-1); - } - printf("## Relax NG test suite from James Clark\n"); - - cur = xmlDocGetRootElement(doc); - if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "testSuite"))) { - fprintf(stderr, "Unexpected format %s\n", filename); - ret = -1; - goto done; - } - - cur = getNext(cur, "./testSuite[1]"); - if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "testSuite"))) { - fprintf(stderr, "Unexpected format %s\n", filename); - ret = -1; - goto done; - } - while (cur != NULL) { - rngTestSuite(cur); - cur = getNext(cur, "following-sibling::testSuite[1]"); - } - -done: - if (doc != NULL) - xmlFreeDoc(doc); - return(ret); -} - -static int -rngTest2(void) { - xmlDocPtr doc; - xmlNodePtr cur; - const char *filename = "test/relaxng/testsuite.xml"; - int ret = 0; - - doc = xmlReadFile(filename, NULL, XML_PARSE_NOENT); - if (doc == NULL) { - fprintf(stderr, "Failed to parse %s\n", filename); - return(-1); - } - printf("## Relax NG test suite for libxml2\n"); - - cur = xmlDocGetRootElement(doc); - if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "testSuite"))) { - fprintf(stderr, "Unexpected format %s\n", filename); - ret = -1; - goto done; - } - - cur = getNext(cur, "./testSuite[1]"); - if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "testSuite"))) { - fprintf(stderr, "Unexpected format %s\n", filename); - ret = -1; - goto done; - } - while (cur != NULL) { - xsdTestSuite(cur); - cur = getNext(cur, "following-sibling::testSuite[1]"); - } - -done: - if (doc != NULL) - xmlFreeDoc(doc); - return(ret); -} - -/************************************************************************ - * * - * Schemas test suites from W3C/NIST/MS/Sun * - * * - ************************************************************************/ - -static int -xstcTestInstance(xmlNodePtr cur, xmlSchemaPtr schemas, - const xmlChar *spath, const char *base) { - xmlChar *href = NULL; - xmlChar *path = NULL; - xmlChar *validity = NULL; - xmlSchemaValidCtxtPtr ctxt = NULL; - xmlDocPtr doc = NULL; - int ret = 0, mem; - - xmlResetLastError(); - testErrorsSize = 0; testErrors[0] = 0; - mem = xmlMemUsed(); - href = getString(cur, - "string(ts:instanceDocument/@xlink:href)"); - if ((href == NULL) || (href[0] == 0)) { - test_log("testGroup line %ld misses href for schemaDocument\n", - xmlGetLineNo(cur)); - ret = -1; - goto done; - } - path = xmlBuildURI(href, BAD_CAST base); - if (path == NULL) { - fprintf(stderr, - "Failed to build path to schemas testGroup line %ld : %s\n", - xmlGetLineNo(cur), href); - ret = -1; - goto done; - } - if (checkTestFile((const char *) path) <= 0) { - test_log("schemas for testGroup line %ld is missing: %s\n", - xmlGetLineNo(cur), path); - ret = -1; - goto done; - } - validity = getString(cur, - "string(ts:expected/@validity)"); - if (validity == NULL) { - fprintf(stderr, "instanceDocument line %ld misses expected validity\n", - xmlGetLineNo(cur)); - ret = -1; - goto done; - } - nb_tests++; - doc = xmlReadFile((const char *) path, NULL, XML_PARSE_NOENT); - if (doc == NULL) { - fprintf(stderr, "instance %s fails to parse\n", path); - ret = -1; - nb_errors++; - goto done; - } - - ctxt = xmlSchemaNewValidCtxt(schemas); - xmlSchemaSetValidErrors(ctxt, - (xmlSchemaValidityErrorFunc) testErrorHandler, - (xmlSchemaValidityWarningFunc) testErrorHandler, - ctxt); - ret = xmlSchemaValidateDoc(ctxt, doc); - - if (xmlStrEqual(validity, BAD_CAST "valid")) { - if (ret > 0) { - test_log("valid instance %s failed to validate against %s\n", - path, spath); - nb_errors++; - } else if (ret < 0) { - test_log("valid instance %s got internal error validating %s\n", - path, spath); - nb_internals++; - nb_errors++; - } - } else if (xmlStrEqual(validity, BAD_CAST "invalid")) { - if (ret == 0) { - test_log("Failed to detect invalid instance %s against %s\n", - path, spath); - nb_errors++; - } - } else { - test_log("instanceDocument line %ld has unexpected validity value%s\n", - xmlGetLineNo(cur), validity); - ret = -1; - goto done; - } - -done: - if (href != NULL) xmlFree(href); - if (path != NULL) xmlFree(path); - if (validity != NULL) xmlFree(validity); - if (ctxt != NULL) xmlSchemaFreeValidCtxt(ctxt); - if (doc != NULL) xmlFreeDoc(doc); - xmlResetLastError(); - if (mem != xmlMemUsed()) { - test_log("Validation of tests starting line %ld leaked %d\n", - xmlGetLineNo(cur), xmlMemUsed() - mem); - nb_leaks++; - } - return(ret); -} - -static int -xstcTestGroup(xmlNodePtr cur, const char *base) { - xmlChar *href = NULL; - xmlChar *path = NULL; - xmlChar *validity = NULL; - xmlSchemaPtr schemas = NULL; - xmlSchemaParserCtxtPtr ctxt; - xmlNodePtr instance; - int ret = 0, mem; - - xmlResetLastError(); - testErrorsSize = 0; testErrors[0] = 0; - mem = xmlMemUsed(); - href = getString(cur, - "string(ts:schemaTest/ts:schemaDocument/@xlink:href)"); - if ((href == NULL) || (href[0] == 0)) { - test_log("testGroup line %ld misses href for schemaDocument\n", - xmlGetLineNo(cur)); - ret = -1; - goto done; - } - path = xmlBuildURI(href, BAD_CAST base); - if (path == NULL) { - test_log("Failed to build path to schemas testGroup line %ld : %s\n", - xmlGetLineNo(cur), href); - ret = -1; - goto done; - } - if (checkTestFile((const char *) path) <= 0) { - test_log("schemas for testGroup line %ld is missing: %s\n", - xmlGetLineNo(cur), path); - ret = -1; - goto done; - } - validity = getString(cur, - "string(ts:schemaTest/ts:expected/@validity)"); - if (validity == NULL) { - test_log("testGroup line %ld misses expected validity\n", - xmlGetLineNo(cur)); - ret = -1; - goto done; - } - nb_tests++; - if (xmlStrEqual(validity, BAD_CAST "valid")) { - nb_schematas++; - ctxt = xmlSchemaNewParserCtxt((const char *) path); - xmlSchemaSetParserErrors(ctxt, - (xmlSchemaValidityErrorFunc) testErrorHandler, - (xmlSchemaValidityWarningFunc) testErrorHandler, - ctxt); - schemas = xmlSchemaParse(ctxt); - xmlSchemaFreeParserCtxt(ctxt); - if (schemas == NULL) { - test_log("valid schemas %s failed to parse\n", - path); - ret = 1; - nb_errors++; - } - if ((ret == 0) && (strstr(testErrors, "nimplemented") != NULL)) { - test_log("valid schemas %s hit an unimplemented block\n", - path); - ret = 1; - nb_unimplemented++; - nb_errors++; - } - instance = getNext(cur, "./ts:instanceTest[1]"); - while (instance != NULL) { - if (schemas != NULL) { - xstcTestInstance(instance, schemas, path, base); - } else { - /* - * We'll automatically mark the instances as failed - * if the schema was broken. - */ - nb_errors++; - } - instance = getNext(instance, - "following-sibling::ts:instanceTest[1]"); - } - } else if (xmlStrEqual(validity, BAD_CAST "invalid")) { - nb_schematas++; - ctxt = xmlSchemaNewParserCtxt((const char *) path); - xmlSchemaSetParserErrors(ctxt, - (xmlSchemaValidityErrorFunc) testErrorHandler, - (xmlSchemaValidityWarningFunc) testErrorHandler, - ctxt); - schemas = xmlSchemaParse(ctxt); - xmlSchemaFreeParserCtxt(ctxt); - if (schemas != NULL) { - test_log("Failed to detect error in schemas %s\n", - path); - nb_errors++; - ret = 1; - } - if ((ret == 0) && (strstr(testErrors, "nimplemented") != NULL)) { - nb_unimplemented++; - test_log("invalid schemas %s hit an unimplemented block\n", - path); - ret = 1; - nb_errors++; - } - } else { - test_log("testGroup line %ld misses unexpected validity value%s\n", - xmlGetLineNo(cur), validity); - ret = -1; - goto done; - } - -done: - if (href != NULL) xmlFree(href); - if (path != NULL) xmlFree(path); - if (validity != NULL) xmlFree(validity); - if (schemas != NULL) xmlSchemaFree(schemas); - xmlResetLastError(); - if ((mem != xmlMemUsed()) && (extraMemoryFromResolver == 0)) { - test_log("Processing test line %ld %s leaked %d\n", - xmlGetLineNo(cur), path, xmlMemUsed() - mem); - nb_leaks++; - } - return(ret); -} - -static int -xstcMetadata(const char *metadata, const char *base) { - xmlDocPtr doc; - xmlNodePtr cur; - xmlChar *contributor; - xmlChar *name; - int ret = 0; - - doc = xmlReadFile(metadata, NULL, XML_PARSE_NOENT); - if (doc == NULL) { - fprintf(stderr, "Failed to parse %s\n", metadata); - return(-1); - } - - cur = xmlDocGetRootElement(doc); - if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "testSet"))) { - fprintf(stderr, "Unexpected format %s\n", metadata); - return(-1); - } - contributor = xmlGetProp(cur, BAD_CAST "contributor"); - if (contributor == NULL) { - contributor = xmlStrdup(BAD_CAST "Unknown"); - } - name = xmlGetProp(cur, BAD_CAST "name"); - if (name == NULL) { - name = xmlStrdup(BAD_CAST "Unknown"); - } - printf("## %s test suite for Schemas version %s\n", contributor, name); - xmlFree(contributor); - xmlFree(name); - - cur = getNext(cur, "./ts:testGroup[1]"); - if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "testGroup"))) { - fprintf(stderr, "Unexpected format %s\n", metadata); - ret = -1; - goto done; - } - while (cur != NULL) { - xstcTestGroup(cur, base); - cur = getNext(cur, "following-sibling::ts:testGroup[1]"); - } - -done: - xmlFreeDoc(doc); - return(ret); -} - -/************************************************************************ - * * - * The driver for the tests * - * * - ************************************************************************/ - -int -main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - int ret = 0; - int old_errors, old_tests, old_leaks; - - logfile = fopen(LOGFILE, "w"); - if (logfile == NULL) { - fprintf(stderr, - "Could not open the log file, running in verbose mode\n"); - verbose = 1; - } - initializeLibxml2(); - - if ((argc >= 2) && (!strcmp(argv[1], "-v"))) - verbose = 1; - - - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - xsdTest(); - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests, no errors\n", nb_tests - old_tests); - else - printf("Ran %d tests, %d errors, %d leaks\n", - nb_tests - old_tests, - nb_errors - old_errors, - nb_leaks - old_leaks); - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - rngTest1(); - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests, no errors\n", nb_tests - old_tests); - else - printf("Ran %d tests, %d errors, %d leaks\n", - nb_tests - old_tests, - nb_errors - old_errors, - nb_leaks - old_leaks); - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - rngTest2(); - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests, no errors\n", nb_tests - old_tests); - else - printf("Ran %d tests, %d errors, %d leaks\n", - nb_tests - old_tests, - nb_errors - old_errors, - nb_leaks - old_leaks); - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - nb_internals = 0; - nb_schematas = 0; - xstcMetadata("xstc/Tests/Metadata/NISTXMLSchemaDatatypes.testSet", - "xstc/Tests/Metadata/"); - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests (%d schemata), no errors\n", - nb_tests - old_tests, nb_schematas); - else - printf("Ran %d tests (%d schemata), %d errors (%d internals), %d leaks\n", - nb_tests - old_tests, - nb_schematas, - nb_errors - old_errors, - nb_internals, - nb_leaks - old_leaks); - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - nb_internals = 0; - nb_schematas = 0; - xstcMetadata("xstc/Tests/Metadata/SunXMLSchema1-0-20020116.testSet", - "xstc/Tests/"); - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests (%d schemata), no errors\n", - nb_tests - old_tests, nb_schematas); - else - printf("Ran %d tests (%d schemata), %d errors (%d internals), %d leaks\n", - nb_tests - old_tests, - nb_schematas, - nb_errors - old_errors, - nb_internals, - nb_leaks - old_leaks); - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - nb_internals = 0; - nb_schematas = 0; - xstcMetadata("xstc/Tests/Metadata/MSXMLSchema1-0-20020116.testSet", - "xstc/Tests/"); - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests (%d schemata), no errors\n", - nb_tests - old_tests, nb_schematas); - else - printf("Ran %d tests (%d schemata), %d errors (%d internals), %d leaks\n", - nb_tests - old_tests, - nb_schematas, - nb_errors - old_errors, - nb_internals, - nb_leaks - old_leaks); - - if ((nb_errors == 0) && (nb_leaks == 0)) { - ret = 0; - printf("Total %d tests, no errors\n", - nb_tests); - } else { - ret = 1; - printf("Total %d tests, %d errors, %d leaks\n", - nb_tests, nb_errors, nb_leaks); - } - xmlXPathFreeContext(ctxtXPath); - xmlCleanupParser(); - xmlMemoryDump(); - - if (logfile != NULL) - fclose(logfile); - return(ret); -} -#else /* !SCHEMAS */ -int -main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - fprintf(stderr, "runsuite requires support for schemas and xpath in libxml2\n"); -} -#endif diff --git a/reactos/lib/3rdparty/libxml2/runtest.c b/reactos/lib/3rdparty/libxml2/runtest.c deleted file mode 100644 index c6517a39847..00000000000 --- a/reactos/lib/3rdparty/libxml2/runtest.c +++ /dev/null @@ -1,4467 +0,0 @@ -/* - * runtest.c: C program to run libxml2 regression tests without - * requiring make or Python, and reducing platform dependancies - * to a strict minimum. - * - * To compile on Unixes: - * cc -o runtest `xml2-config --cflags` runtest.c `xml2-config --libs` -lpthread - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#include "libxml.h" -#include - -#if !defined(_WIN32) || defined(__CYGWIN__) -#include -#endif -#include -#include -#include -#include - -#include -#include -#include - -#ifdef LIBXML_OUTPUT_ENABLED -#ifdef LIBXML_READER_ENABLED -#include -#endif - -#ifdef LIBXML_XINCLUDE_ENABLED -#include -#endif - -#ifdef LIBXML_XPATH_ENABLED -#include -#include -#ifdef LIBXML_XPTR_ENABLED -#include -#endif -#endif - -#ifdef LIBXML_SCHEMAS_ENABLED -#include -#include -#include -#endif - -#ifdef LIBXML_PATTERN_ENABLED -#include -#endif - -#ifdef LIBXML_C14N_ENABLED -#include -#endif - -#ifdef LIBXML_HTML_ENABLED -#include -#include - -/* - * pseudo flag for the unification of HTML and XML tests - */ -#define XML_PARSE_HTML 1 << 24 -#endif - -#if defined(LIBXML_THREAD_ENABLED) && defined(LIBXML_CATALOG_ENABLED) -#include -#include -#include -#include -#include -#endif - -/* - * O_BINARY is just for Windows compatibility - if it isn't defined - * on this system, avoid any compilation error - */ -#ifdef O_BINARY -#define RD_FLAGS O_RDONLY | O_BINARY -#else -#define RD_FLAGS O_RDONLY -#endif - -typedef int (*functest) (const char *filename, const char *result, - const char *error, int options); - -typedef struct testDesc testDesc; -typedef testDesc *testDescPtr; -struct testDesc { - const char *desc; /* descripton of the test */ - functest func; /* function implementing the test */ - const char *in; /* glob to path for input files */ - const char *out; /* output directory */ - const char *suffix;/* suffix for output files */ - const char *err; /* suffix for error output files */ - int options; /* parser options for the test */ -}; - -static int checkTestFile(const char *filename); - -#if defined(_WIN32) && !defined(__CYGWIN__) - -#include -#include - -typedef struct -{ - size_t gl_pathc; /* Count of paths matched so far */ - char **gl_pathv; /* List of matched pathnames. */ - size_t gl_offs; /* Slots to reserve in 'gl_pathv'. */ -} glob_t; - -#define GLOB_DOOFFS 0 -static int glob(const char *pattern, int flags, - int errfunc(const char *epath, int eerrno), - glob_t *pglob) { - glob_t *ret; - WIN32_FIND_DATA FindFileData; - HANDLE hFind; - unsigned int nb_paths = 0; - char directory[500]; - int len; - - if ((pattern == NULL) || (pglob == NULL)) return(-1); - - strncpy(directory, pattern, 499); - for (len = strlen(directory);len >= 0;len--) { - if (directory[len] == '/') { - len++; - directory[len] = 0; - break; - } - } - if (len <= 0) - len = 0; - - - ret = pglob; - memset(ret, 0, sizeof(glob_t)); - - hFind = FindFirstFileA(pattern, &FindFileData); - if (hFind == INVALID_HANDLE_VALUE) - return(0); - nb_paths = 20; - ret->gl_pathv = (char **) malloc(nb_paths * sizeof(char *)); - if (ret->gl_pathv == NULL) { - FindClose(hFind); - return(-1); - } - strncpy(directory + len, FindFileData.cFileName, 499 - len); - ret->gl_pathv[ret->gl_pathc] = strdup(directory); - if (ret->gl_pathv[ret->gl_pathc] == NULL) - goto done; - ret->gl_pathc++; - while(FindNextFileA(hFind, &FindFileData)) { - if (FindFileData.cFileName[0] == '.') - continue; - if (ret->gl_pathc + 2 > nb_paths) { - char **tmp = realloc(ret->gl_pathv, nb_paths * 2 * sizeof(char *)); - if (tmp == NULL) - break; - ret->gl_pathv = tmp; - nb_paths *= 2; - } - strncpy(directory + len, FindFileData.cFileName, 499 - len); - ret->gl_pathv[ret->gl_pathc] = strdup(directory); - if (ret->gl_pathv[ret->gl_pathc] == NULL) - break; - ret->gl_pathc++; - } - ret->gl_pathv[ret->gl_pathc] = NULL; - -done: - FindClose(hFind); - return(0); -} - - - -static void globfree(glob_t *pglob) { - unsigned int i; - if (pglob == NULL) - return; - - for (i = 0;i < pglob->gl_pathc;i++) { - if (pglob->gl_pathv[i] != NULL) - free(pglob->gl_pathv[i]); - } -} - -#else -#include -#endif - -/************************************************************************ - * * - * Libxml2 specific routines * - * * - ************************************************************************/ - -static int nb_tests = 0; -static int nb_errors = 0; -static int nb_leaks = 0; -static int extraMemoryFromResolver = 0; - -static int -fatalError(void) { - fprintf(stderr, "Exitting tests on fatal error\n"); - exit(1); -} - -/* - * We need to trap calls to the resolver to not account memory for the catalog - * which is shared to the current running test. We also don't want to have - * network downloads modifying tests. - */ -static xmlParserInputPtr -testExternalEntityLoader(const char *URL, const char *ID, - xmlParserCtxtPtr ctxt) { - xmlParserInputPtr ret; - - if (checkTestFile(URL)) { - ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); - } else { - int memused = xmlMemUsed(); - ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); - extraMemoryFromResolver += xmlMemUsed() - memused; - } - - return(ret); -} - -/* - * Trapping the error messages at the generic level to grab the equivalent of - * stderr messages on CLI tools. - */ -static char testErrors[32769]; -static int testErrorsSize = 0; - -static void XMLCDECL -testErrorHandler(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { - va_list args; - int res; - - if (testErrorsSize >= 32768) - return; - va_start(args, msg); - res = vsnprintf(&testErrors[testErrorsSize], - 32768 - testErrorsSize, - msg, args); - va_end(args); - if (testErrorsSize + res >= 32768) { - /* buffer is full */ - testErrorsSize = 32768; - testErrors[testErrorsSize] = 0; - } else { - testErrorsSize += res; - } - testErrors[testErrorsSize] = 0; -} - -static void XMLCDECL -channel(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { - va_list args; - int res; - - if (testErrorsSize >= 32768) - return; - va_start(args, msg); - res = vsnprintf(&testErrors[testErrorsSize], - 32768 - testErrorsSize, - msg, args); - va_end(args); - if (testErrorsSize + res >= 32768) { - /* buffer is full */ - testErrorsSize = 32768; - testErrors[testErrorsSize] = 0; - } else { - testErrorsSize += res; - } - testErrors[testErrorsSize] = 0; -} - -/** - * xmlParserPrintFileContext: - * @input: an xmlParserInputPtr input - * - * Displays current context within the input content for error tracking - */ - -static void -xmlParserPrintFileContextInternal(xmlParserInputPtr input , - xmlGenericErrorFunc chanl, void *data ) { - const xmlChar *cur, *base; - unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */ - xmlChar content[81]; /* space for 80 chars + line terminator */ - xmlChar *ctnt; - - if (input == NULL) return; - cur = input->cur; - base = input->base; - /* skip backwards over any end-of-lines */ - while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) { - cur--; - } - n = 0; - /* search backwards for beginning-of-line (to max buff size) */ - while ((n++ < (sizeof(content)-1)) && (cur > base) && - (*(cur) != '\n') && (*(cur) != '\r')) - cur--; - if ((*(cur) == '\n') || (*(cur) == '\r')) cur++; - /* calculate the error position in terms of the current position */ - col = input->cur - cur; - /* search forward for end-of-line (to max buff size) */ - n = 0; - ctnt = content; - /* copy selected text to our buffer */ - while ((*cur != 0) && (*(cur) != '\n') && - (*(cur) != '\r') && (n < sizeof(content)-1)) { - *ctnt++ = *cur++; - n++; - } - *ctnt = 0; - /* print out the selected text */ - chanl(data ,"%s\n", content); - /* create blank line with problem pointer */ - n = 0; - ctnt = content; - /* (leave buffer space for pointer + line terminator) */ - while ((nfile; - line = err->line; - code = err->code; - domain = err->domain; - level = err->level; - node = err->node; - if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) || - (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) || - (domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) { - ctxt = err->ctxt; - } - str = err->message; - - if (code == XML_ERR_OK) - return; - - if ((node != NULL) && (node->type == XML_ELEMENT_NODE)) - name = node->name; - - /* - * Maintain the compatibility with the legacy error handling - */ - if (ctxt != NULL) { - input = ctxt->input; - if ((input != NULL) && (input->filename == NULL) && - (ctxt->inputNr > 1)) { - cur = input; - input = ctxt->inputTab[ctxt->inputNr - 2]; - } - if (input != NULL) { - if (input->filename) - channel(data, "%s:%d: ", input->filename, input->line); - else if ((line != 0) && (domain == XML_FROM_PARSER)) - channel(data, "Entity: line %d: ", input->line); - } - } else { - if (file != NULL) - channel(data, "%s:%d: ", file, line); - else if ((line != 0) && (domain == XML_FROM_PARSER)) - channel(data, "Entity: line %d: ", line); - } - if (name != NULL) { - channel(data, "element %s: ", name); - } - if (code == XML_ERR_OK) - return; - switch (domain) { - case XML_FROM_PARSER: - channel(data, "parser "); - break; - case XML_FROM_NAMESPACE: - channel(data, "namespace "); - break; - case XML_FROM_DTD: - case XML_FROM_VALID: - channel(data, "validity "); - break; - case XML_FROM_HTML: - channel(data, "HTML parser "); - break; - case XML_FROM_MEMORY: - channel(data, "memory "); - break; - case XML_FROM_OUTPUT: - channel(data, "output "); - break; - case XML_FROM_IO: - channel(data, "I/O "); - break; - case XML_FROM_XINCLUDE: - channel(data, "XInclude "); - break; - case XML_FROM_XPATH: - channel(data, "XPath "); - break; - case XML_FROM_XPOINTER: - channel(data, "parser "); - break; - case XML_FROM_REGEXP: - channel(data, "regexp "); - break; - case XML_FROM_MODULE: - channel(data, "module "); - break; - case XML_FROM_SCHEMASV: - channel(data, "Schemas validity "); - break; - case XML_FROM_SCHEMASP: - channel(data, "Schemas parser "); - break; - case XML_FROM_RELAXNGP: - channel(data, "Relax-NG parser "); - break; - case XML_FROM_RELAXNGV: - channel(data, "Relax-NG validity "); - break; - case XML_FROM_CATALOG: - channel(data, "Catalog "); - break; - case XML_FROM_C14N: - channel(data, "C14N "); - break; - case XML_FROM_XSLT: - channel(data, "XSLT "); - break; - default: - break; - } - if (code == XML_ERR_OK) - return; - switch (level) { - case XML_ERR_NONE: - channel(data, ": "); - break; - case XML_ERR_WARNING: - channel(data, "warning : "); - break; - case XML_ERR_ERROR: - channel(data, "error : "); - break; - case XML_ERR_FATAL: - channel(data, "error : "); - break; - } - if (code == XML_ERR_OK) - return; - if (str != NULL) { - int len; - len = xmlStrlen((const xmlChar *)str); - if ((len > 0) && (str[len - 1] != '\n')) - channel(data, "%s\n", str); - else - channel(data, "%s", str); - } else { - channel(data, "%s\n", "out of memory error"); - } - if (code == XML_ERR_OK) - return; - - if (ctxt != NULL) { - xmlParserPrintFileContextInternal(input, channel, data); - if (cur != NULL) { - if (cur->filename) - channel(data, "%s:%d: \n", cur->filename, cur->line); - else if ((line != 0) && (domain == XML_FROM_PARSER)) - channel(data, "Entity: line %d: \n", cur->line); - xmlParserPrintFileContextInternal(cur, channel, data); - } - } - if ((domain == XML_FROM_XPATH) && (err->str1 != NULL) && - (err->int1 < 100) && - (err->int1 < xmlStrlen((const xmlChar *)err->str1))) { - xmlChar buf[150]; - int i; - - channel(data, "%s\n", err->str1); - for (i=0;i < err->int1;i++) - buf[i] = ' '; - buf[i++] = '^'; - buf[i] = 0; - channel(data, "%s\n", buf); - } -} - -static void -initializeLibxml2(void) { - xmlGetWarningsDefaultValue = 0; - xmlPedanticParserDefault(0); - - xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup); - xmlInitParser(); - xmlSetExternalEntityLoader(testExternalEntityLoader); - xmlSetStructuredErrorFunc(NULL, testStructuredErrorHandler); -#ifdef LIBXML_SCHEMAS_ENABLED - xmlSchemaInitTypes(); - xmlRelaxNGInitTypes(); -#endif -} - - -/************************************************************************ - * * - * File name and path utilities * - * * - ************************************************************************/ - -static const char *baseFilename(const char *filename) { - const char *cur; - if (filename == NULL) - return(NULL); - cur = &filename[strlen(filename)]; - while ((cur > filename) && (*cur != '/')) - cur--; - if (*cur == '/') - return(cur + 1); - return(cur); -} - -static char *resultFilename(const char *filename, const char *out, - const char *suffix) { - const char *base; - char res[500]; - char suffixbuff[500]; - -/************* - if ((filename[0] == 't') && (filename[1] == 'e') && - (filename[2] == 's') && (filename[3] == 't') && - (filename[4] == '/')) - filename = &filename[5]; - *************/ - - base = baseFilename(filename); - if (suffix == NULL) - suffix = ".tmp"; - if (out == NULL) - out = ""; - - strncpy(suffixbuff,suffix,499); -#ifdef VMS - if(strstr(base,".") && suffixbuff[0]=='.') - suffixbuff[0]='_'; -#endif - - snprintf(res, 499, "%s%s%s", out, base, suffixbuff); - res[499] = 0; - return(strdup(res)); -} - -static int checkTestFile(const char *filename) { - struct stat buf; - - if (stat(filename, &buf) == -1) - return(0); - -#if defined(_WIN32) && !defined(__CYGWIN__) - if (!(buf.st_mode & _S_IFREG)) - return(0); -#else - if (!S_ISREG(buf.st_mode)) - return(0); -#endif - - return(1); -} - -static int compareFiles(const char *r1, const char *r2) { - int res1, res2; - int fd1, fd2; - char bytes1[4096]; - char bytes2[4096]; - - fd1 = open(r1, RD_FLAGS); - if (fd1 < 0) - return(-1); - fd2 = open(r2, RD_FLAGS); - if (fd2 < 0) { - close(fd1); - return(-1); - } - while (1) { - res1 = read(fd1, bytes1, 4096); - res2 = read(fd2, bytes2, 4096); - if ((res1 != res2) || (res1 < 0)) { - close(fd1); - close(fd2); - return(1); - } - if (res1 == 0) - break; - if (memcmp(bytes1, bytes2, res1) != 0) { - close(fd1); - close(fd2); - return(1); - } - } - close(fd1); - close(fd2); - return(0); -} - -static int compareFileMem(const char *filename, const char *mem, int size) { - int res; - int fd; - char bytes[4096]; - int idx = 0; - struct stat info; - - if (stat(filename, &info) < 0) - return(-1); - if (info.st_size != size) - return(-1); - fd = open(filename, RD_FLAGS); - if (fd < 0) - return(-1); - while (idx < size) { - res = read(fd, bytes, 4096); - if (res <= 0) - break; - if (res + idx > size) - break; - if (memcmp(bytes, &mem[idx], res) != 0) { - int ix; - for (ix=0; ix 0) { - siz += res; - } - close(fd); -#if !defined(_WIN32) - if (siz != info.st_size) { - free(base); - return(-1); - } -#endif - base[siz] = 0; - *mem = base; - *size = siz; - return(0); -} - -static int unloadMem(const char *mem) { - free((char *)mem); - return(0); -} - -/************************************************************************ - * * - * Tests implementations * - * * - ************************************************************************/ - -/************************************************************************ - * * - * Parse to SAX based tests * - * * - ************************************************************************/ - -static FILE *SAXdebug = NULL; - -/* - * empty SAX block - */ -static xmlSAXHandler emptySAXHandlerStruct = { - NULL, /* internalSubset */ - NULL, /* isStandalone */ - NULL, /* hasInternalSubset */ - NULL, /* hasExternalSubset */ - NULL, /* resolveEntity */ - NULL, /* getEntity */ - NULL, /* entityDecl */ - NULL, /* notationDecl */ - NULL, /* attributeDecl */ - NULL, /* elementDecl */ - NULL, /* unparsedEntityDecl */ - NULL, /* setDocumentLocator */ - NULL, /* startDocument */ - NULL, /* endDocument */ - NULL, /* startElement */ - NULL, /* endElement */ - NULL, /* reference */ - NULL, /* characters */ - NULL, /* ignorableWhitespace */ - NULL, /* processingInstruction */ - NULL, /* comment */ - NULL, /* xmlParserWarning */ - NULL, /* xmlParserError */ - NULL, /* xmlParserError */ - NULL, /* getParameterEntity */ - NULL, /* cdataBlock; */ - NULL, /* externalSubset; */ - 1, - NULL, - NULL, /* startElementNs */ - NULL, /* endElementNs */ - NULL /* xmlStructuredErrorFunc */ -}; - -static xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct; -static int callbacks = 0; -static int quiet = 0; - -/** - * isStandaloneDebug: - * @ctxt: An XML parser context - * - * Is this document tagged standalone ? - * - * Returns 1 if true - */ -static int -isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return(0); - fprintf(SAXdebug, "SAX.isStandalone()\n"); - return(0); -} - -/** - * hasInternalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an internal subset - * - * Returns 1 if true - */ -static int -hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return(0); - fprintf(SAXdebug, "SAX.hasInternalSubset()\n"); - return(0); -} - -/** - * hasExternalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an external subset - * - * Returns 1 if true - */ -static int -hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return(0); - fprintf(SAXdebug, "SAX.hasExternalSubset()\n"); - return(0); -} - -/** - * internalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an internal subset - */ -static void -internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *ExternalID, const xmlChar *SystemID) -{ - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.internalSubset(%s,", name); - if (ExternalID == NULL) - fprintf(SAXdebug, " ,"); - else - fprintf(SAXdebug, " %s,", ExternalID); - if (SystemID == NULL) - fprintf(SAXdebug, " )\n"); - else - fprintf(SAXdebug, " %s)\n", SystemID); -} - -/** - * externalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an external subset - */ -static void -externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *ExternalID, const xmlChar *SystemID) -{ - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.externalSubset(%s,", name); - if (ExternalID == NULL) - fprintf(SAXdebug, " ,"); - else - fprintf(SAXdebug, " %s,", ExternalID); - if (SystemID == NULL) - fprintf(SAXdebug, " )\n"); - else - fprintf(SAXdebug, " %s)\n", SystemID); -} - -/** - * resolveEntityDebug: - * @ctxt: An XML parser context - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * - * Special entity resolver, better left to the parser, it has - * more context than the application layer. - * The default behaviour is to NOT resolve the entities, in that case - * the ENTITY_REF nodes are built in the structure (and the parameter - * values). - * - * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. - */ -static xmlParserInputPtr -resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId) -{ - callbacks++; - if (quiet) - return(NULL); - /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ - - - fprintf(SAXdebug, "SAX.resolveEntity("); - if (publicId != NULL) - fprintf(SAXdebug, "%s", (char *)publicId); - else - fprintf(SAXdebug, " "); - if (systemId != NULL) - fprintf(SAXdebug, ", %s)\n", (char *)systemId); - else - fprintf(SAXdebug, ", )\n"); -/********* - if (systemId != NULL) { - return(xmlNewInputFromFile(ctxt, (char *) systemId)); - } - *********/ - return(NULL); -} - -/** - * getEntityDebug: - * @ctxt: An XML parser context - * @name: The entity name - * - * Get an entity by name - * - * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. - */ -static xmlEntityPtr -getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) -{ - callbacks++; - if (quiet) - return(NULL); - fprintf(SAXdebug, "SAX.getEntity(%s)\n", name); - return(NULL); -} - -/** - * getParameterEntityDebug: - * @ctxt: An XML parser context - * @name: The entity name - * - * Get a parameter entity by name - * - * Returns the xmlParserInputPtr - */ -static xmlEntityPtr -getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) -{ - callbacks++; - if (quiet) - return(NULL); - fprintf(SAXdebug, "SAX.getParameterEntity(%s)\n", name); - return(NULL); -} - - -/** - * entityDeclDebug: - * @ctxt: An XML parser context - * @name: the entity name - * @type: the entity type - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * @content: the entity value (without processing). - * - * An entity definition has been parsed - */ -static void -entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type, - const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) -{ -const xmlChar *nullstr = BAD_CAST "(null)"; - /* not all libraries handle printing null pointers nicely */ - if (publicId == NULL) - publicId = nullstr; - if (systemId == NULL) - systemId = nullstr; - if (content == NULL) - content = (xmlChar *)nullstr; - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.entityDecl(%s, %d, %s, %s, %s)\n", - name, type, publicId, systemId, content); -} - -/** - * attributeDeclDebug: - * @ctxt: An XML parser context - * @name: the attribute name - * @type: the attribute type - * - * An attribute definition has been parsed - */ -static void -attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem, - const xmlChar * name, int type, int def, - const xmlChar * defaultValue, xmlEnumerationPtr tree) -{ - callbacks++; - if (quiet) - return; - if (defaultValue == NULL) - fprintf(SAXdebug, "SAX.attributeDecl(%s, %s, %d, %d, NULL, ...)\n", - elem, name, type, def); - else - fprintf(SAXdebug, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n", - elem, name, type, def, defaultValue); - xmlFreeEnumeration(tree); -} - -/** - * elementDeclDebug: - * @ctxt: An XML parser context - * @name: the element name - * @type: the element type - * @content: the element value (without processing). - * - * An element definition has been parsed - */ -static void -elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type, - xmlElementContentPtr content ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.elementDecl(%s, %d, ...)\n", - name, type); -} - -/** - * notationDeclDebug: - * @ctxt: An XML parser context - * @name: The name of the notation - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * - * What to do when a notation declaration has been parsed. - */ -static void -notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *publicId, const xmlChar *systemId) -{ - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.notationDecl(%s, %s, %s)\n", - (char *) name, (char *) publicId, (char *) systemId); -} - -/** - * unparsedEntityDeclDebug: - * @ctxt: An XML parser context - * @name: The name of the entity - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * @notationName: the name of the notation - * - * What to do when an unparsed entity declaration is parsed - */ -static void -unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *publicId, const xmlChar *systemId, - const xmlChar *notationName) -{ -const xmlChar *nullstr = BAD_CAST "(null)"; - - if (publicId == NULL) - publicId = nullstr; - if (systemId == NULL) - systemId = nullstr; - if (notationName == NULL) - notationName = nullstr; - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n", - (char *) name, (char *) publicId, (char *) systemId, - (char *) notationName); -} - -/** - * setDocumentLocatorDebug: - * @ctxt: An XML parser context - * @loc: A SAX Locator - * - * Receive the document locator at startup, actually xmlDefaultSAXLocator - * Everything is available on the context, so this is useless in our case. - */ -static void -setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.setDocumentLocator()\n"); -} - -/** - * startDocumentDebug: - * @ctxt: An XML parser context - * - * called when the document start being processed. - */ -static void -startDocumentDebug(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.startDocument()\n"); -} - -/** - * endDocumentDebug: - * @ctxt: An XML parser context - * - * called when the document end has been detected. - */ -static void -endDocumentDebug(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.endDocument()\n"); -} - -/** - * startElementDebug: - * @ctxt: An XML parser context - * @name: The element name - * - * called when an opening tag has been processed. - */ -static void -startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts) -{ - int i; - - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.startElement(%s", (char *) name); - if (atts != NULL) { - for (i = 0;(atts[i] != NULL);i++) { - fprintf(SAXdebug, ", %s='", atts[i++]); - if (atts[i] != NULL) - fprintf(SAXdebug, "%s'", atts[i]); - } - } - fprintf(SAXdebug, ")\n"); -} - -/** - * endElementDebug: - * @ctxt: An XML parser context - * @name: The element name - * - * called when the end of an element has been detected. - */ -static void -endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) -{ - callbacks++; - if (quiet) - return; - fprintf(SAXdebug, "SAX.endElement(%s)\n", (char *) name); -} - -/** - * charactersDebug: - * @ctxt: An XML parser context - * @ch: a xmlChar string - * @len: the number of xmlChar - * - * receiving some chars from the parser. - * Question: how much at a time ??? - */ -static void -charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) -{ - char output[40]; - int i; - - callbacks++; - if (quiet) - return; - for (i = 0;(i= size) { -#ifdef LIBXML_HTML_ENABLED - if (options & XML_PARSE_HTML) - htmlParseChunk(ctxt, base + cur, size - cur, 1); - else -#endif - xmlParseChunk(ctxt, base + cur, size - cur, 1); - break; - } else { -#ifdef LIBXML_HTML_ENABLED - if (options & XML_PARSE_HTML) - htmlParseChunk(ctxt, base + cur, 1024, 0); - else -#endif - xmlParseChunk(ctxt, base + cur, 1024, 0); - cur += 1024; - } - } - doc = ctxt->myDoc; -#ifdef LIBXML_HTML_ENABLED - if (options & XML_PARSE_HTML) - res = 1; - else -#endif - res = ctxt->wellFormed; - xmlFreeParserCtxt(ctxt); - free((char *)base); - if (!res) { - xmlFreeDoc(doc); - fprintf(stderr, "Failed to parse %s\n", filename); - return(-1); - } -#ifdef LIBXML_HTML_ENABLED - if (options & XML_PARSE_HTML) - htmlDocDumpMemory(doc, (xmlChar **) &base, &size); - else -#endif - xmlDocDumpMemory(doc, (xmlChar **) &base, &size); - xmlFreeDoc(doc); - res = compareFileMem(result, base, size); - if ((base == NULL) || (res != 0)) { - if (base != NULL) - xmlFree((char *)base); - fprintf(stderr, "Result for %s failed\n", filename); - return(-1); - } - xmlFree((char *)base); - if (err != NULL) { - res = compareFileMem(err, testErrors, testErrorsSize); - if (res != 0) { - fprintf(stderr, "Error for %s failed\n", filename); - return(-1); - } - } - return(0); -} -#endif - -/** - * memParseTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages: unused - * - * Parse a file using the old xmlReadMemory API, then serialize back - * reparse the result and serialize again, then check for deviation - * in serialization. - * - * Returns 0 in case of success, an error code otherwise - */ -static int -memParseTest(const char *filename, const char *result, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - xmlDocPtr doc; - const char *base; - int size, res; - - nb_tests++; - /* - * load and parse the memory - */ - if (loadMem(filename, &base, &size) != 0) { - fprintf(stderr, "Failed to load %s\n", filename); - return(-1); - } - - doc = xmlReadMemory(base, size, filename, NULL, 0); - unloadMem(base); - if (doc == NULL) { - return(1); - } - xmlDocDumpMemory(doc, (xmlChar **) &base, &size); - xmlFreeDoc(doc); - res = compareFileMem(result, base, size); - if ((base == NULL) || (res != 0)) { - if (base != NULL) - xmlFree((char *)base); - fprintf(stderr, "Result for %s failed\n", filename); - return(-1); - } - xmlFree((char *)base); - return(0); -} - -/** - * noentParseTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages: unused - * - * Parse a file with entity resolution, then serialize back - * reparse the result and serialize again, then check for deviation - * in serialization. - * - * Returns 0 in case of success, an error code otherwise - */ -static int -noentParseTest(const char *filename, const char *result, - const char *err ATTRIBUTE_UNUSED, - int options) { - xmlDocPtr doc; - char *temp; - int res = 0; - - nb_tests++; - /* - * base of the test, parse with the old API - */ - doc = xmlReadFile(filename, NULL, options); - if (doc == NULL) - return(1); - temp = resultFilename(filename, "", ".res"); - if (temp == NULL) { - fprintf(stderr, "Out of memory\n"); - fatalError(); - } - xmlSaveFile(temp, doc); - if (compareFiles(temp, result)) { - res = 1; - } - xmlFreeDoc(doc); - - /* - * Parse the saved result to make sure the round trip is okay - */ - doc = xmlReadFile(filename, NULL, options); - if (doc == NULL) - return(1); - xmlSaveFile(temp, doc); - if (compareFiles(temp, result)) { - res = 1; - } - xmlFreeDoc(doc); - - if (temp != NULL) { - unlink(temp); - free(temp); - } - return(res); -} - -/** - * errParseTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file using the xmlReadFile API and check for errors. - * - * Returns 0 in case of success, an error code otherwise - */ -static int -errParseTest(const char *filename, const char *result, const char *err, - int options) { - xmlDocPtr doc; - const char *base = NULL; - int size, res = 0; - - nb_tests++; -#ifdef LIBXML_HTML_ENABLED - if (options & XML_PARSE_HTML) { - doc = htmlReadFile(filename, NULL, options); - } else -#endif -#ifdef LIBXML_XINCLUDE_ENABLED - if (options & XML_PARSE_XINCLUDE) { - doc = xmlReadFile(filename, NULL, options); - xmlXIncludeProcessFlags(doc, options); - } else -#endif - { - xmlGetWarningsDefaultValue = 1; - doc = xmlReadFile(filename, NULL, options); - } - xmlGetWarningsDefaultValue = 0; - if (result) { - if (doc == NULL) { - base = ""; - size = 0; - } else { -#ifdef LIBXML_HTML_ENABLED - if (options & XML_PARSE_HTML) { - htmlDocDumpMemory(doc, (xmlChar **) &base, &size); - } else -#endif - xmlDocDumpMemory(doc, (xmlChar **) &base, &size); - } - res = compareFileMem(result, base, size); - } - if (doc != NULL) { - if (base != NULL) - xmlFree((char *)base); - xmlFreeDoc(doc); - } - if (res != 0) { - fprintf(stderr, "Result for %s failed\n", filename); - return(-1); - } - if (err != NULL) { - res = compareFileMem(err, testErrors, testErrorsSize); - if (res != 0) { - fprintf(stderr, "Error for %s failed\n", filename); - return(-1); - } - } else if (options & XML_PARSE_DTDVALID) { - if (testErrorsSize != 0) - fprintf(stderr, "Validation for %s failed\n", filename); - } - - return(0); -} - -#ifdef LIBXML_READER_ENABLED -/************************************************************************ - * * - * Reader based tests * - * * - ************************************************************************/ - -static void processNode(FILE *out, xmlTextReaderPtr reader) { - const xmlChar *name, *value; - int type, empty; - - type = xmlTextReaderNodeType(reader); - empty = xmlTextReaderIsEmptyElement(reader); - - name = xmlTextReaderConstName(reader); - if (name == NULL) - name = BAD_CAST "--"; - - value = xmlTextReaderConstValue(reader); - - - fprintf(out, "%d %d %s %d %d", - xmlTextReaderDepth(reader), - type, - name, - empty, - xmlTextReaderHasValue(reader)); - if (value == NULL) - fprintf(out, "\n"); - else { - fprintf(out, " %s\n", value); - } -} -static int -streamProcessTest(const char *filename, const char *result, const char *err, - xmlTextReaderPtr reader, const char *rng) { - int ret; - char *temp = NULL; - FILE *t = NULL; - - if (reader == NULL) - return(-1); - - nb_tests++; - if (result != NULL) { - temp = resultFilename(filename, "", ".res"); - if (temp == NULL) { - fprintf(stderr, "Out of memory\n"); - fatalError(); - } - t = fopen(temp, "wb"); - if (t == NULL) { - fprintf(stderr, "Can't open temp file %s\n", temp); - free(temp); - return(-1); - } - } -#ifdef LIBXML_SCHEMAS_ENABLED - if (rng != NULL) { - ret = xmlTextReaderRelaxNGValidate(reader, rng); - if (ret < 0) { - testErrorHandler(NULL, "Relax-NG schema %s failed to compile\n", - rng); - fclose(t); - if (temp != NULL) { - unlink(temp); - free(temp); - } - return(0); - } - } -#endif - xmlGetWarningsDefaultValue = 1; - ret = xmlTextReaderRead(reader); - while (ret == 1) { - if ((t != NULL) && (rng == NULL)) - processNode(t, reader); - ret = xmlTextReaderRead(reader); - } - if (ret != 0) { - testErrorHandler(NULL, "%s : failed to parse\n", filename); - } - if (rng != NULL) { - if (xmlTextReaderIsValid(reader) != 1) { - testErrorHandler(NULL, "%s fails to validate\n", filename); - } else { - testErrorHandler(NULL, "%s validates\n", filename); - } - } - xmlGetWarningsDefaultValue = 0; - if (t != NULL) { - fclose(t); - ret = compareFiles(temp, result); - if (temp != NULL) { - unlink(temp); - free(temp); - } - if (ret) { - fprintf(stderr, "Result for %s failed\n", filename); - return(-1); - } - } - if (err != NULL) { - ret = compareFileMem(err, testErrors, testErrorsSize); - if (ret != 0) { - fprintf(stderr, "Error for %s failed\n", filename); - printf("%s", testErrors); - return(-1); - } - } - - return(0); -} - -/** - * streamParseTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file using the reader API and check for errors. - * - * Returns 0 in case of success, an error code otherwise - */ -static int -streamParseTest(const char *filename, const char *result, const char *err, - int options) { - xmlTextReaderPtr reader; - int ret; - - reader = xmlReaderForFile(filename, NULL, options); - ret = streamProcessTest(filename, result, err, reader, NULL); - xmlFreeTextReader(reader); - return(ret); -} - -/** - * walkerParseTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file using the walker, i.e. a reader built from a atree. - * - * Returns 0 in case of success, an error code otherwise - */ -static int -walkerParseTest(const char *filename, const char *result, const char *err, - int options) { - xmlDocPtr doc; - xmlTextReaderPtr reader; - int ret; - - doc = xmlReadFile(filename, NULL, options); - if (doc == NULL) { - fprintf(stderr, "Failed to parse %s\n", filename); - return(-1); - } - reader = xmlReaderWalker(doc); - ret = streamProcessTest(filename, result, err, reader, NULL); - xmlFreeTextReader(reader); - xmlFreeDoc(doc); - return(ret); -} - -/** - * streamMemParseTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file using the reader API from memory and check for errors. - * - * Returns 0 in case of success, an error code otherwise - */ -static int -streamMemParseTest(const char *filename, const char *result, const char *err, - int options) { - xmlTextReaderPtr reader; - int ret; - const char *base; - int size; - - /* - * load and parse the memory - */ - if (loadMem(filename, &base, &size) != 0) { - fprintf(stderr, "Failed to load %s\n", filename); - return(-1); - } - reader = xmlReaderForMemory(base, size, filename, NULL, options); - ret = streamProcessTest(filename, result, err, reader, NULL); - free((char *)base); - xmlFreeTextReader(reader); - return(ret); -} -#endif - -#ifdef LIBXML_XPATH_ENABLED -#ifdef LIBXML_DEBUG_ENABLED -/************************************************************************ - * * - * XPath and XPointer based tests * - * * - ************************************************************************/ - -static FILE *xpathOutput; -static xmlDocPtr xpathDocument; - -static void -testXPath(const char *str, int xptr, int expr) { - xmlXPathObjectPtr res; - xmlXPathContextPtr ctxt; - - nb_tests++; -#if defined(LIBXML_XPTR_ENABLED) - if (xptr) { - ctxt = xmlXPtrNewContext(xpathDocument, NULL, NULL); - res = xmlXPtrEval(BAD_CAST str, ctxt); - } else { -#endif - ctxt = xmlXPathNewContext(xpathDocument); - ctxt->node = xmlDocGetRootElement(xpathDocument); - if (expr) - res = xmlXPathEvalExpression(BAD_CAST str, ctxt); - else { - /* res = xmlXPathEval(BAD_CAST str, ctxt); */ - xmlXPathCompExprPtr comp; - - comp = xmlXPathCompile(BAD_CAST str); - if (comp != NULL) { - res = xmlXPathCompiledEval(comp, ctxt); - xmlXPathFreeCompExpr(comp); - } else - res = NULL; - } -#if defined(LIBXML_XPTR_ENABLED) - } -#endif - xmlXPathDebugDumpObject(xpathOutput, res, 0); - xmlXPathFreeObject(res); - xmlXPathFreeContext(ctxt); -} - -/** - * xpathExprTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file containing XPath standalone expressions and evaluate them - * - * Returns 0 in case of success, an error code otherwise - */ -static int -xpathCommonTest(const char *filename, const char *result, - int xptr, int expr) { - FILE *input; - char expression[5000]; - int len, ret = 0; - char *temp; - - temp = resultFilename(filename, "", ".res"); - if (temp == NULL) { - fprintf(stderr, "Out of memory\n"); - fatalError(); - } - xpathOutput = fopen(temp, "wb"); - if (xpathOutput == NULL) { - fprintf(stderr, "failed to open output file %s\n", temp); - free(temp); - return(-1); - } - - input = fopen(filename, "rb"); - if (input == NULL) { - xmlGenericError(xmlGenericErrorContext, - "Cannot open %s for reading\n", filename); - free(temp); - return(-1); - } - while (fgets(expression, 4500, input) != NULL) { - len = strlen(expression); - len--; - while ((len >= 0) && - ((expression[len] == '\n') || (expression[len] == '\t') || - (expression[len] == '\r') || (expression[len] == ' '))) len--; - expression[len + 1] = 0; - if (len >= 0) { - fprintf(xpathOutput, - "\n========================\nExpression: %s\n", - expression) ; - testXPath(expression, xptr, expr); - } - } - - fclose(input); - fclose(xpathOutput); - if (result != NULL) { - ret = compareFiles(temp, result); - if (ret) { - fprintf(stderr, "Result for %s failed\n", filename); - } - } - - if (temp != NULL) { - unlink(temp); - free(temp); - } - return(ret); -} - -/** - * xpathExprTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file containing XPath standalone expressions and evaluate them - * - * Returns 0 in case of success, an error code otherwise - */ -static int -xpathExprTest(const char *filename, const char *result, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - return(xpathCommonTest(filename, result, 0, 1)); -} - -/** - * xpathDocTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file containing XPath expressions and evaluate them against - * a set of corresponding documents. - * - * Returns 0 in case of success, an error code otherwise - */ -static int -xpathDocTest(const char *filename, - const char *resul ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options) { - - char pattern[500]; - char result[500]; - glob_t globbuf; - size_t i; - int ret = 0, res; - - xpathDocument = xmlReadFile(filename, NULL, - options | XML_PARSE_DTDATTR | XML_PARSE_NOENT); - if (xpathDocument == NULL) { - fprintf(stderr, "Failed to load %s\n", filename); - return(-1); - } - - snprintf(pattern, 499, "./test/XPath/tests/%s*", baseFilename(filename)); - pattern[499] = 0; - globbuf.gl_offs = 0; - glob(pattern, GLOB_DOOFFS, NULL, &globbuf); - for (i = 0;i < globbuf.gl_pathc;i++) { - snprintf(result, 499, "result/XPath/tests/%s", - baseFilename(globbuf.gl_pathv[i])); - res = xpathCommonTest(globbuf.gl_pathv[i], &result[0], 0, 0); - if (res != 0) - ret = res; - } - globfree(&globbuf); - - xmlFreeDoc(xpathDocument); - return(ret); -} - -#ifdef LIBXML_XPTR_ENABLED -/** - * xptrDocTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file containing XPath expressions and evaluate them against - * a set of corresponding documents. - * - * Returns 0 in case of success, an error code otherwise - */ -static int -xptrDocTest(const char *filename, - const char *resul ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options) { - - char pattern[500]; - char result[500]; - glob_t globbuf; - size_t i; - int ret = 0, res; - - xpathDocument = xmlReadFile(filename, NULL, - options | XML_PARSE_DTDATTR | XML_PARSE_NOENT); - if (xpathDocument == NULL) { - fprintf(stderr, "Failed to load %s\n", filename); - return(-1); - } - - snprintf(pattern, 499, "./test/XPath/xptr/%s*", baseFilename(filename)); - pattern[499] = 0; - globbuf.gl_offs = 0; - glob(pattern, GLOB_DOOFFS, NULL, &globbuf); - for (i = 0;i < globbuf.gl_pathc;i++) { - snprintf(result, 499, "result/XPath/xptr/%s", - baseFilename(globbuf.gl_pathv[i])); - res = xpathCommonTest(globbuf.gl_pathv[i], &result[0], 1, 0); - if (res != 0) - ret = res; - } - globfree(&globbuf); - - xmlFreeDoc(xpathDocument); - return(ret); -} -#endif /* LIBXML_XPTR_ENABLED */ - -/** - * xmlidDocTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file containing xml:id and check for errors and verify - * that XPath queries will work on them as expected. - * - * Returns 0 in case of success, an error code otherwise - */ -static int -xmlidDocTest(const char *filename, - const char *result, - const char *err, - int options) { - - int res = 0; - int ret = 0; - char *temp; - - xpathDocument = xmlReadFile(filename, NULL, - options | XML_PARSE_DTDATTR | XML_PARSE_NOENT); - if (xpathDocument == NULL) { - fprintf(stderr, "Failed to load %s\n", filename); - return(-1); - } - - temp = resultFilename(filename, "", ".res"); - if (temp == NULL) { - fprintf(stderr, "Out of memory\n"); - fatalError(); - } - xpathOutput = fopen(temp, "wb"); - if (xpathOutput == NULL) { - fprintf(stderr, "failed to open output file %s\n", temp); - xmlFreeDoc(xpathDocument); - free(temp); - return(-1); - } - - testXPath("id('bar')", 0, 0); - - fclose(xpathOutput); - if (result != NULL) { - ret = compareFiles(temp, result); - if (ret) { - fprintf(stderr, "Result for %s failed\n", filename); - res = 1; - } - } - - if (temp != NULL) { - unlink(temp); - free(temp); - } - xmlFreeDoc(xpathDocument); - - if (err != NULL) { - ret = compareFileMem(err, testErrors, testErrorsSize); - if (ret != 0) { - fprintf(stderr, "Error for %s failed\n", filename); - res = 1; - } - } - return(res); -} - -#endif /* LIBXML_DEBUG_ENABLED */ -#endif /* XPATH */ -/************************************************************************ - * * - * URI based tests * - * * - ************************************************************************/ - -static void -handleURI(const char *str, const char *base, FILE *o) { - int ret; - xmlURIPtr uri; - xmlChar *res = NULL; - - uri = xmlCreateURI(); - - if (base == NULL) { - ret = xmlParseURIReference(uri, str); - if (ret != 0) - fprintf(o, "%s : error %d\n", str, ret); - else { - xmlNormalizeURIPath(uri->path); - xmlPrintURI(o, uri); - fprintf(o, "\n"); - } - } else { - res = xmlBuildURI((xmlChar *)str, (xmlChar *) base); - if (res != NULL) { - fprintf(o, "%s\n", (char *) res); - } - else - fprintf(o, "::ERROR::\n"); - } - if (res != NULL) - xmlFree(res); - xmlFreeURI(uri); -} - -/** - * uriCommonTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file containing URI and check for errors - * - * Returns 0 in case of success, an error code otherwise - */ -static int -uriCommonTest(const char *filename, - const char *result, - const char *err, - const char *base) { - char *temp; - FILE *o, *f; - char str[1024]; - int res = 0, i, ret; - - temp = resultFilename(filename, "", ".res"); - if (temp == NULL) { - fprintf(stderr, "Out of memory\n"); - fatalError(); - } - o = fopen(temp, "wb"); - if (o == NULL) { - fprintf(stderr, "failed to open output file %s\n", temp); - free(temp); - return(-1); - } - f = fopen(filename, "rb"); - if (f == NULL) { - fprintf(stderr, "failed to open input file %s\n", filename); - fclose(o); - if (temp != NULL) { - unlink(temp); - free(temp); - } - return(-1); - } - - while (1) { - /* - * read one line in string buffer. - */ - if (fgets (&str[0], sizeof (str) - 1, f) == NULL) - break; - - /* - * remove the ending spaces - */ - i = strlen(str); - while ((i > 0) && - ((str[i - 1] == '\n') || (str[i - 1] == '\r') || - (str[i - 1] == ' ') || (str[i - 1] == '\t'))) { - i--; - str[i] = 0; - } - nb_tests++; - handleURI(str, base, o); - } - - fclose(f); - fclose(o); - - if (result != NULL) { - ret = compareFiles(temp, result); - if (ret) { - fprintf(stderr, "Result for %s failed\n", filename); - res = 1; - } - } - if (err != NULL) { - ret = compareFileMem(err, testErrors, testErrorsSize); - if (ret != 0) { - fprintf(stderr, "Error for %s failed\n", filename); - res = 1; - } - } - - if (temp != NULL) { - unlink(temp); - free(temp); - } - return(res); -} - -/** - * uriParseTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file containing URI and check for errors - * - * Returns 0 in case of success, an error code otherwise - */ -static int -uriParseTest(const char *filename, - const char *result, - const char *err, - int options ATTRIBUTE_UNUSED) { - return(uriCommonTest(filename, result, err, NULL)); -} - -/** - * uriBaseTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file containing URI, compose them against a fixed base and - * check for errors - * - * Returns 0 in case of success, an error code otherwise - */ -static int -uriBaseTest(const char *filename, - const char *result, - const char *err, - int options ATTRIBUTE_UNUSED) { - return(uriCommonTest(filename, result, err, - "http://foo.com/path/to/index.html?orig#help")); -} - -static int urip_success = 1; -static int urip_current = 0; -static const char *urip_testURLs[] = { - "urip://example.com/a b.html", - "urip://example.com/a%20b.html", - "file:///path/to/a b.html", - "file:///path/to/a%20b.html", - "/path/to/a b.html", - "/path/to/a%20b.html", - "urip://example.com/r" "\xe9" "sum" "\xe9" ".html", - "urip://example.com/test?a=1&b=2%263&c=4#foo", - NULL -}; -static const char *urip_rcvsURLs[] = { - /* it is an URI the strings must be escaped */ - "urip://example.com/a%20b.html", - /* check that % escaping is not broken */ - "urip://example.com/a%20b.html", - /* it's an URI path the strings must be escaped */ - "file:///path/to/a%20b.html", - /* check that % escaping is not broken */ - "file:///path/to/a%20b.html", - /* this is not an URI, this is a path, so this should not be escaped */ - "/path/to/a b.html", - /* check that paths with % are not broken */ - "/path/to/a%20b.html", - /* out of context the encoding can't be guessed byte by byte conversion */ - "urip://example.com/r%E9sum%E9.html", - /* verify we don't destroy URIs especially the query part */ - "urip://example.com/test?a=1&b=2%263&c=4#foo", - NULL -}; -static const char *urip_res = ""; -static const char *urip_cur = NULL; -static int urip_rlen; - -/** - * uripMatch: - * @URI: an URI to test - * - * Check for an urip: query - * - * Returns 1 if yes and 0 if another Input module should be used - */ -static int -uripMatch(const char * URI) { - if ((URI == NULL) || (!strcmp(URI, "file:///etc/xml/catalog"))) - return(0); - /* Verify we received the escaped URL */ - if (strcmp(urip_rcvsURLs[urip_current], URI)) - urip_success = 0; - return(1); -} - -/** - * uripOpen: - * @URI: an URI to test - * - * Return a pointer to the urip: query handler, in this example simply - * the urip_current pointer... - * - * Returns an Input context or NULL in case or error - */ -static void * -uripOpen(const char * URI) { - if ((URI == NULL) || (!strcmp(URI, "file:///etc/xml/catalog"))) - return(NULL); - /* Verify we received the escaped URL */ - if (strcmp(urip_rcvsURLs[urip_current], URI)) - urip_success = 0; - urip_cur = urip_res; - urip_rlen = strlen(urip_res); - return((void *) urip_cur); -} - -/** - * uripClose: - * @context: the read context - * - * Close the urip: query handler - * - * Returns 0 or -1 in case of error - */ -static int -uripClose(void * context) { - if (context == NULL) return(-1); - urip_cur = NULL; - urip_rlen = 0; - return(0); -} - -/** - * uripRead: - * @context: the read context - * @buffer: where to store data - * @len: number of bytes to read - * - * Implement an urip: query read. - * - * Returns the number of bytes read or -1 in case of error - */ -static int -uripRead(void * context, char * buffer, int len) { - const char *ptr = (const char *) context; - - if ((context == NULL) || (buffer == NULL) || (len < 0)) - return(-1); - - if (len > urip_rlen) len = urip_rlen; - memcpy(buffer, ptr, len); - urip_rlen -= len; - return(len); -} - -static int -urip_checkURL(const char *URL) { - xmlDocPtr doc; - - doc = xmlReadFile(URL, NULL, 0); - if (doc == NULL) - return(-1); - xmlFreeDoc(doc); - return(1); -} - -/** - * uriPathTest: - * @filename: ignored - * @result: ignored - * @err: ignored - * - * Run a set of tests to check how Path and URI are handled before - * being passed to the I/O layer - * - * Returns 0 in case of success, an error code otherwise - */ -static int -uriPathTest(const char *filename ATTRIBUTE_UNUSED, - const char *result ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - int parsed; - int failures = 0; - - /* - * register the new I/O handlers - */ - if (xmlRegisterInputCallbacks(uripMatch, uripOpen, uripRead, uripClose) < 0) - { - fprintf(stderr, "failed to register HTTP handler\n"); - return(-1); - } - - for (urip_current = 0;urip_testURLs[urip_current] != NULL;urip_current++) { - urip_success = 1; - parsed = urip_checkURL(urip_testURLs[urip_current]); - if (urip_success != 1) { - fprintf(stderr, "failed the URL passing test for %s", - urip_testURLs[urip_current]); - failures++; - } else if (parsed != 1) { - fprintf(stderr, "failed the parsing test for %s", - urip_testURLs[urip_current]); - failures++; - } - nb_tests++; - } - - xmlPopInputCallbacks(); - return(failures); -} - -#ifdef LIBXML_SCHEMAS_ENABLED -/************************************************************************ - * * - * Schemas tests * - * * - ************************************************************************/ -static int -schemasOneTest(const char *sch, - const char *filename, - const char *result, - const char *err, - int options, - xmlSchemaPtr schemas) { - xmlDocPtr doc; - xmlSchemaValidCtxtPtr ctxt; - int ret = 0; - int validResult = 0; - char *temp; - FILE *schemasOutput; - - doc = xmlReadFile(filename, NULL, options); - if (doc == NULL) { - fprintf(stderr, "failed to parse instance %s for %s\n", filename, sch); - return(-1); - } - - temp = resultFilename(result, "", ".res"); - if (temp == NULL) { - fprintf(stderr, "Out of memory\n"); - fatalError(); - } - schemasOutput = fopen(temp, "wb"); - if (schemasOutput == NULL) { - fprintf(stderr, "failed to open output file %s\n", temp); - xmlFreeDoc(doc); - free(temp); - return(-1); - } - - ctxt = xmlSchemaNewValidCtxt(schemas); - xmlSchemaSetValidErrors(ctxt, - (xmlSchemaValidityErrorFunc) testErrorHandler, - (xmlSchemaValidityWarningFunc) testErrorHandler, - ctxt); - validResult = xmlSchemaValidateDoc(ctxt, doc); - if (validResult == 0) { - fprintf(schemasOutput, "%s validates\n", filename); - } else if (validResult > 0) { - fprintf(schemasOutput, "%s fails to validate\n", filename); - } else { - fprintf(schemasOutput, "%s validation generated an internal error\n", - filename); - } - fclose(schemasOutput); - if (result) { - if (compareFiles(temp, result)) { - fprintf(stderr, "Result for %s on %s failed\n", filename, sch); - ret = 1; - } - } - if (temp != NULL) { - unlink(temp); - free(temp); - } - - if ((validResult != 0) && (err != NULL)) { - if (compareFileMem(err, testErrors, testErrorsSize)) { - fprintf(stderr, "Error for %s on %s failed\n", filename, sch); - ret = 1; - } - } - - xmlSchemaFreeValidCtxt(ctxt); - xmlFreeDoc(doc); - return(ret); -} -/** - * schemasTest: - * @filename: the schemas file - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a file containing URI, compose them against a fixed base and - * check for errors - * - * Returns 0 in case of success, an error code otherwise - */ -static int -schemasTest(const char *filename, - const char *resul ATTRIBUTE_UNUSED, - const char *errr ATTRIBUTE_UNUSED, - int options) { - const char *base = baseFilename(filename); - const char *base2; - const char *instance; - xmlSchemaParserCtxtPtr ctxt; - xmlSchemaPtr schemas; - int res = 0, len, ret; - char pattern[500]; - char prefix[500]; - char result[500]; - char err[500]; - glob_t globbuf; - size_t i; - char count = 0; - - /* first compile the schemas if possible */ - ctxt = xmlSchemaNewParserCtxt(filename); - xmlSchemaSetParserErrors(ctxt, - (xmlSchemaValidityErrorFunc) testErrorHandler, - (xmlSchemaValidityWarningFunc) testErrorHandler, - ctxt); - schemas = xmlSchemaParse(ctxt); - xmlSchemaFreeParserCtxt(ctxt); - - /* - * most of the mess is about the output filenames generated by the Makefile - */ - len = strlen(base); - if ((len > 499) || (len < 5)) { - xmlSchemaFree(schemas); - return(-1); - } - len -= 4; /* remove trailing .xsd */ - if (base[len - 2] == '_') { - len -= 2; /* remove subtest number */ - } - if (base[len - 2] == '_') { - len -= 2; /* remove subtest number */ - } - memcpy(prefix, base, len); - prefix[len] = 0; - - snprintf(pattern, 499, "./test/schemas/%s_?.xml", prefix); - pattern[499] = 0; - - if (base[len] == '_') { - len += 2; - memcpy(prefix, base, len); - prefix[len] = 0; - } - - globbuf.gl_offs = 0; - glob(pattern, GLOB_DOOFFS, NULL, &globbuf); - for (i = 0;i < globbuf.gl_pathc;i++) { - testErrorsSize = 0; - testErrors[0] = 0; - instance = globbuf.gl_pathv[i]; - base2 = baseFilename(instance); - len = strlen(base2); - if ((len > 6) && (base2[len - 6] == '_')) { - count = base2[len - 5]; - snprintf(result, 499, "result/schemas/%s_%c", - prefix, count); - result[499] = 0; - snprintf(err, 499, "result/schemas/%s_%c.err", - prefix, count); - err[499] = 0; - } else { - fprintf(stderr, "don't know how to process %s\n", instance); - continue; - } - if (schemas == NULL) { - } else { - nb_tests++; - ret = schemasOneTest(filename, instance, result, err, - options, schemas); - if (ret != 0) - res = ret; - } - } - globfree(&globbuf); - xmlSchemaFree(schemas); - - return(res); -} - -/************************************************************************ - * * - * Schemas tests * - * * - ************************************************************************/ -static int -rngOneTest(const char *sch, - const char *filename, - const char *result, - const char *err, - int options, - xmlRelaxNGPtr schemas) { - xmlDocPtr doc; - xmlRelaxNGValidCtxtPtr ctxt; - int ret = 0; - char *temp; - FILE *schemasOutput; - - doc = xmlReadFile(filename, NULL, options); - if (doc == NULL) { - fprintf(stderr, "failed to parse instance %s for %s\n", filename, sch); - return(-1); - } - - temp = resultFilename(result, "", ".res"); - if (temp == NULL) { - fprintf(stderr, "Out of memory\n"); - fatalError(); - } - schemasOutput = fopen(temp, "wb"); - if (schemasOutput == NULL) { - fprintf(stderr, "failed to open output file %s\n", temp); - xmlFreeDoc(doc); - free(temp); - return(-1); - } - - ctxt = xmlRelaxNGNewValidCtxt(schemas); - xmlRelaxNGSetValidErrors(ctxt, - (xmlRelaxNGValidityErrorFunc) testErrorHandler, - (xmlRelaxNGValidityWarningFunc) testErrorHandler, - ctxt); - ret = xmlRelaxNGValidateDoc(ctxt, doc); - if (ret == 0) { - testErrorHandler(NULL, "%s validates\n", filename); - } else if (ret > 0) { - testErrorHandler(NULL, "%s fails to validate\n", filename); - } else { - testErrorHandler(NULL, "%s validation generated an internal error\n", - filename); - } - fclose(schemasOutput); - ret = 0; - if (result) { - if (compareFiles(temp, result)) { - fprintf(stderr, "Result for %s on %s failed\n", filename, sch); - ret = 1; - } - } - if (temp != NULL) { - unlink(temp); - free(temp); - } - - if (err != NULL) { - if (compareFileMem(err, testErrors, testErrorsSize)) { - fprintf(stderr, "Error for %s on %s failed\n", filename, sch); - ret = 1; - printf("%s", testErrors); - } - } - - - xmlRelaxNGFreeValidCtxt(ctxt); - xmlFreeDoc(doc); - return(ret); -} -/** - * rngTest: - * @filename: the schemas file - * @result: the file with expected result - * @err: the file with error messages - * - * Parse an RNG schemas and then apply it to the related .xml - * - * Returns 0 in case of success, an error code otherwise - */ -static int -rngTest(const char *filename, - const char *resul ATTRIBUTE_UNUSED, - const char *errr ATTRIBUTE_UNUSED, - int options) { - const char *base = baseFilename(filename); - const char *base2; - const char *instance; - xmlRelaxNGParserCtxtPtr ctxt; - xmlRelaxNGPtr schemas; - int res = 0, len, ret = 0; - char pattern[500]; - char prefix[500]; - char result[500]; - char err[500]; - glob_t globbuf; - size_t i; - char count = 0; - - /* first compile the schemas if possible */ - ctxt = xmlRelaxNGNewParserCtxt(filename); - xmlRelaxNGSetParserErrors(ctxt, - (xmlRelaxNGValidityErrorFunc) testErrorHandler, - (xmlRelaxNGValidityWarningFunc) testErrorHandler, - ctxt); - schemas = xmlRelaxNGParse(ctxt); - xmlRelaxNGFreeParserCtxt(ctxt); - - /* - * most of the mess is about the output filenames generated by the Makefile - */ - len = strlen(base); - if ((len > 499) || (len < 5)) { - xmlRelaxNGFree(schemas); - return(-1); - } - len -= 4; /* remove trailing .rng */ - memcpy(prefix, base, len); - prefix[len] = 0; - - snprintf(pattern, 499, "./test/relaxng/%s_?.xml", prefix); - pattern[499] = 0; - - globbuf.gl_offs = 0; - glob(pattern, GLOB_DOOFFS, NULL, &globbuf); - for (i = 0;i < globbuf.gl_pathc;i++) { - testErrorsSize = 0; - testErrors[0] = 0; - instance = globbuf.gl_pathv[i]; - base2 = baseFilename(instance); - len = strlen(base2); - if ((len > 6) && (base2[len - 6] == '_')) { - count = base2[len - 5]; - snprintf(result, 499, "result/relaxng/%s_%c", - prefix, count); - result[499] = 0; - snprintf(err, 499, "result/relaxng/%s_%c.err", - prefix, count); - err[499] = 0; - } else { - fprintf(stderr, "don't know how to process %s\n", instance); - continue; - } - if (schemas == NULL) { - } else { - nb_tests++; - ret = rngOneTest(filename, instance, result, err, - options, schemas); - if (res != 0) - ret = res; - } - } - globfree(&globbuf); - xmlRelaxNGFree(schemas); - - return(ret); -} - -#ifdef LIBXML_READER_ENABLED -/** - * rngStreamTest: - * @filename: the schemas file - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a set of files with streaming, applying an RNG schemas - * - * Returns 0 in case of success, an error code otherwise - */ -static int -rngStreamTest(const char *filename, - const char *resul ATTRIBUTE_UNUSED, - const char *errr ATTRIBUTE_UNUSED, - int options) { - const char *base = baseFilename(filename); - const char *base2; - const char *instance; - int res = 0, len, ret; - char pattern[500]; - char prefix[500]; - char result[500]; - char err[500]; - glob_t globbuf; - size_t i; - char count = 0; - xmlTextReaderPtr reader; - int disable_err = 0; - - /* - * most of the mess is about the output filenames generated by the Makefile - */ - len = strlen(base); - if ((len > 499) || (len < 5)) { - fprintf(stderr, "len(base) == %d !\n", len); - return(-1); - } - len -= 4; /* remove trailing .rng */ - memcpy(prefix, base, len); - prefix[len] = 0; - - /* - * strictly unifying the error messages is nearly impossible this - * hack is also done in the Makefile - */ - if ((!strcmp(prefix, "tutor10_1")) || (!strcmp(prefix, "tutor10_2")) || - (!strcmp(prefix, "tutor3_2")) || (!strcmp(prefix, "307377")) || - (!strcmp(prefix, "tutor8_2"))) - disable_err = 1; - - snprintf(pattern, 499, "./test/relaxng/%s_?.xml", prefix); - pattern[499] = 0; - - globbuf.gl_offs = 0; - glob(pattern, GLOB_DOOFFS, NULL, &globbuf); - for (i = 0;i < globbuf.gl_pathc;i++) { - testErrorsSize = 0; - testErrors[0] = 0; - instance = globbuf.gl_pathv[i]; - base2 = baseFilename(instance); - len = strlen(base2); - if ((len > 6) && (base2[len - 6] == '_')) { - count = base2[len - 5]; - snprintf(result, 499, "result/relaxng/%s_%c", - prefix, count); - result[499] = 0; - snprintf(err, 499, "result/relaxng/%s_%c.err", - prefix, count); - err[499] = 0; - } else { - fprintf(stderr, "don't know how to process %s\n", instance); - continue; - } - reader = xmlReaderForFile(instance, NULL, options); - if (reader == NULL) { - fprintf(stderr, "Failed to build reder for %s\n", instance); - } - if (disable_err == 1) - ret = streamProcessTest(instance, result, NULL, reader, filename); - else - ret = streamProcessTest(instance, result, err, reader, filename); - xmlFreeTextReader(reader); - if (ret != 0) { - fprintf(stderr, "instance %s failed\n", instance); - res = ret; - } - } - globfree(&globbuf); - - return(res); -} -#endif /* READER */ - -#endif - -#ifdef LIBXML_PATTERN_ENABLED -#ifdef LIBXML_READER_ENABLED -/************************************************************************ - * * - * Patterns tests * - * * - ************************************************************************/ -static void patternNode(FILE *out, xmlTextReaderPtr reader, - const char *pattern, xmlPatternPtr patternc, - xmlStreamCtxtPtr patstream) { - xmlChar *path = NULL; - int match = -1; - int type, empty; - - type = xmlTextReaderNodeType(reader); - empty = xmlTextReaderIsEmptyElement(reader); - - if (type == XML_READER_TYPE_ELEMENT) { - /* do the check only on element start */ - match = xmlPatternMatch(patternc, xmlTextReaderCurrentNode(reader)); - - if (match) { - path = xmlGetNodePath(xmlTextReaderCurrentNode(reader)); - fprintf(out, "Node %s matches pattern %s\n", path, pattern); - } - } - if (patstream != NULL) { - int ret; - - if (type == XML_READER_TYPE_ELEMENT) { - ret = xmlStreamPush(patstream, - xmlTextReaderConstLocalName(reader), - xmlTextReaderConstNamespaceUri(reader)); - if (ret < 0) { - fprintf(out, "xmlStreamPush() failure\n"); - xmlFreeStreamCtxt(patstream); - patstream = NULL; - } else if (ret != match) { - if (path == NULL) { - path = xmlGetNodePath( - xmlTextReaderCurrentNode(reader)); - } - fprintf(out, - "xmlPatternMatch and xmlStreamPush disagree\n"); - fprintf(out, - " pattern %s node %s\n", - pattern, path); - } - - - } - if ((type == XML_READER_TYPE_END_ELEMENT) || - ((type == XML_READER_TYPE_ELEMENT) && (empty))) { - ret = xmlStreamPop(patstream); - if (ret < 0) { - fprintf(out, "xmlStreamPop() failure\n"); - xmlFreeStreamCtxt(patstream); - patstream = NULL; - } - } - } - if (path != NULL) - xmlFree(path); -} - -/** - * patternTest: - * @filename: the schemas file - * @result: the file with expected result - * @err: the file with error messages - * - * Parse a set of files with streaming, applying an RNG schemas - * - * Returns 0 in case of success, an error code otherwise - */ -static int -patternTest(const char *filename, - const char *resul ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options) { - xmlPatternPtr patternc = NULL; - xmlStreamCtxtPtr patstream = NULL; - FILE *o, *f; - char str[1024]; - char xml[500]; - char result[500]; - int len, i; - int ret = 0, res; - char *temp; - xmlTextReaderPtr reader; - xmlDocPtr doc; - - len = strlen(filename); - len -= 4; - memcpy(xml, filename, len); - xml[len] = 0; - snprintf(result, 499, "result/pattern/%s", baseFilename(xml)); - result[499] = 0; - memcpy(xml + len, ".xml", 5); - - if (!checkTestFile(xml)) { - fprintf(stderr, "Missing xml file %s\n", xml); - return(-1); - } - if (!checkTestFile(result)) { - fprintf(stderr, "Missing result file %s\n", result); - return(-1); - } - f = fopen(filename, "rb"); - if (f == NULL) { - fprintf(stderr, "Failed to open %s\n", filename); - return(-1); - } - temp = resultFilename(filename, "", ".res"); - if (temp == NULL) { - fprintf(stderr, "Out of memory\n"); - fatalError(); - } - o = fopen(temp, "wb"); - if (o == NULL) { - fprintf(stderr, "failed to open output file %s\n", temp); - fclose(f); - free(temp); - return(-1); - } - while (1) { - /* - * read one line in string buffer. - */ - if (fgets (&str[0], sizeof (str) - 1, f) == NULL) - break; - - /* - * remove the ending spaces - */ - i = strlen(str); - while ((i > 0) && - ((str[i - 1] == '\n') || (str[i - 1] == '\r') || - (str[i - 1] == ' ') || (str[i - 1] == '\t'))) { - i--; - str[i] = 0; - } - doc = xmlReadFile(xml, NULL, options); - if (doc == NULL) { - fprintf(stderr, "Failed to parse %s\n", xml); - ret = 1; - } else { - xmlNodePtr root; - const xmlChar *namespaces[22]; - int j; - xmlNsPtr ns; - - root = xmlDocGetRootElement(doc); - for (ns = root->nsDef, j = 0;ns != NULL && j < 20;ns=ns->next) { - namespaces[j++] = ns->href; - namespaces[j++] = ns->prefix; - } - namespaces[j++] = NULL; - namespaces[j] = NULL; - - patternc = xmlPatterncompile((const xmlChar *) str, doc->dict, - 0, &namespaces[0]); - if (patternc == NULL) { - testErrorHandler(NULL, - "Pattern %s failed to compile\n", str); - xmlFreeDoc(doc); - ret = 1; - continue; - } - patstream = xmlPatternGetStreamCtxt(patternc); - if (patstream != NULL) { - ret = xmlStreamPush(patstream, NULL, NULL); - if (ret < 0) { - fprintf(stderr, "xmlStreamPush() failure\n"); - xmlFreeStreamCtxt(patstream); - patstream = NULL; - } - } - nb_tests++; - - reader = xmlReaderWalker(doc); - res = xmlTextReaderRead(reader); - while (res == 1) { - patternNode(o, reader, str, patternc, patstream); - res = xmlTextReaderRead(reader); - } - if (res != 0) { - fprintf(o, "%s : failed to parse\n", filename); - } - xmlFreeTextReader(reader); - xmlFreeDoc(doc); - xmlFreeStreamCtxt(patstream); - patstream = NULL; - xmlFreePattern(patternc); - - } - } - - fclose(f); - fclose(o); - - ret = compareFiles(temp, result); - if (ret) { - fprintf(stderr, "Result for %s failed\n", filename); - ret = 1; - } - if (temp != NULL) { - unlink(temp); - free(temp); - } - return(ret); -} -#endif /* READER */ -#endif /* PATTERN */ -#ifdef LIBXML_C14N_ENABLED -/************************************************************************ - * * - * Canonicalization tests * - * * - ************************************************************************/ -static xmlXPathObjectPtr -load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { - xmlXPathObjectPtr xpath; - xmlDocPtr doc; - xmlChar *expr; - xmlXPathContextPtr ctx; - xmlNodePtr node; - xmlNsPtr ns; - - /* - * load XPath expr as a file - */ - xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - xmlSubstituteEntitiesDefault(1); - - doc = xmlReadFile(filename, NULL, XML_PARSE_DTDATTR | XML_PARSE_NOENT); - if (doc == NULL) { - fprintf(stderr, "Error: unable to parse file \"%s\"\n", filename); - return(NULL); - } - - /* - * Check the document is of the right kind - */ - if(xmlDocGetRootElement(doc) == NULL) { - fprintf(stderr,"Error: empty document for file \"%s\"\n", filename); - xmlFreeDoc(doc); - return(NULL); - } - - node = doc->children; - while(node != NULL && !xmlStrEqual(node->name, (const xmlChar *)"XPath")) { - node = node->next; - } - - if(node == NULL) { - fprintf(stderr,"Error: XPath element expected in the file \"%s\"\n", filename); - xmlFreeDoc(doc); - return(NULL); - } - - expr = xmlNodeGetContent(node); - if(expr == NULL) { - fprintf(stderr,"Error: XPath content element is NULL \"%s\"\n", filename); - xmlFreeDoc(doc); - return(NULL); - } - - ctx = xmlXPathNewContext(parent_doc); - if(ctx == NULL) { - fprintf(stderr,"Error: unable to create new context\n"); - xmlFree(expr); - xmlFreeDoc(doc); - return(NULL); - } - - /* - * Register namespaces - */ - ns = node->nsDef; - while(ns != NULL) { - if(xmlXPathRegisterNs(ctx, ns->prefix, ns->href) != 0) { - fprintf(stderr,"Error: unable to register NS with prefix=\"%s\" and href=\"%s\"\n", ns->prefix, ns->href); - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); - return(NULL); - } - ns = ns->next; - } - - /* - * Evaluate xpath - */ - xpath = xmlXPathEvalExpression(expr, ctx); - if(xpath == NULL) { - fprintf(stderr,"Error: unable to evaluate xpath expression\n"); -xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); - return(NULL); - } - - /* print_xpath_nodes(xpath->nodesetval); */ - - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); - return(xpath); -} - -/* - * Macro used to grow the current buffer. - */ -#define xxx_growBufferReentrant() { \ - buffer_size *= 2; \ - buffer = (xmlChar **) \ - xmlRealloc(buffer, buffer_size * sizeof(xmlChar*)); \ - if (buffer == NULL) { \ - perror("realloc failed"); \ - return(NULL); \ - } \ -} - -static xmlChar ** -parse_list(xmlChar *str) { - xmlChar **buffer; - xmlChar **out = NULL; - int buffer_size = 0; - int len; - - if(str == NULL) { - return(NULL); - } - - len = xmlStrlen(str); - if((str[0] == '\'') && (str[len - 1] == '\'')) { - str[len - 1] = '\0'; - str++; - } - /* - * allocate an translation buffer. - */ - buffer_size = 1000; - buffer = (xmlChar **) xmlMalloc(buffer_size * sizeof(xmlChar*)); - if (buffer == NULL) { - perror("malloc failed"); - return(NULL); - } - out = buffer; - - while(*str != '\0') { - if (out - buffer > buffer_size - 10) { - int indx = out - buffer; - - xxx_growBufferReentrant(); - out = &buffer[indx]; - } - (*out++) = str; - while(*str != ',' && *str != '\0') ++str; - if(*str == ',') *(str++) = '\0'; - } - (*out) = NULL; - return buffer; -} - -static int -c14nRunTest(const char* xml_filename, int with_comments, int mode, - const char* xpath_filename, const char *ns_filename, - const char* result_file) { - xmlDocPtr doc; - xmlXPathObjectPtr xpath = NULL; - xmlChar *result = NULL; - int ret; - xmlChar **inclusive_namespaces = NULL; - const char *nslist = NULL; - int nssize; - - - /* - * build an XML tree from a the file; we need to add default - * attributes and resolve all character and entities references - */ - xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - xmlSubstituteEntitiesDefault(1); - - doc = xmlReadFile(xml_filename, NULL, XML_PARSE_DTDATTR | XML_PARSE_NOENT); - if (doc == NULL) { - fprintf(stderr, "Error: unable to parse file \"%s\"\n", xml_filename); - return(-1); - } - - /* - * Check the document is of the right kind - */ - if(xmlDocGetRootElement(doc) == NULL) { - fprintf(stderr,"Error: empty document for file \"%s\"\n", xml_filename); - xmlFreeDoc(doc); - return(-1); - } - - /* - * load xpath file if specified - */ - if(xpath_filename) { - xpath = load_xpath_expr(doc, xpath_filename); - if(xpath == NULL) { - fprintf(stderr,"Error: unable to evaluate xpath expression\n"); - xmlFreeDoc(doc); - return(-1); - } - } - - if (ns_filename != NULL) { - if (loadMem(ns_filename, &nslist, &nssize)) { - fprintf(stderr,"Error: unable to evaluate xpath expression\n"); - if(xpath != NULL) xmlXPathFreeObject(xpath); - xmlFreeDoc(doc); - return(-1); - } - inclusive_namespaces = parse_list((xmlChar *) nslist); - } - - /* - * Canonical form - */ - /* fprintf(stderr,"File \"%s\" loaded: start canonization\n", xml_filename); */ - ret = xmlC14NDocDumpMemory(doc, - (xpath) ? xpath->nodesetval : NULL, - mode, inclusive_namespaces, - with_comments, &result); - if (ret >= 0) { - if(result != NULL) { - if (compareFileMem(result_file, (const char *) result, ret)) { - fprintf(stderr, "Result mismatch for %s\n", xml_filename); - fprintf(stderr, "RESULT:\n%s\n", (const char*)result); - ret = -1; - } - } - } else { - fprintf(stderr,"Error: failed to canonicalize XML file \"%s\" (ret=%d)\n", xml_filename, ret); - ret = -1; - } - - /* - * Cleanup - */ - if (result != NULL) xmlFree(result); - if(xpath != NULL) xmlXPathFreeObject(xpath); - if (inclusive_namespaces != NULL) xmlFree(inclusive_namespaces); - if (nslist != NULL) free((char *) nslist); - xmlFreeDoc(doc); - - return(ret); -} - -static int -c14nCommonTest(const char *filename, int with_comments, int mode, - const char *subdir) { - char buf[500]; - char prefix[500]; - const char *base; - int len; - char *result = NULL; - char *xpath = NULL; - char *ns = NULL; - int ret = 0; - - base = baseFilename(filename); - len = strlen(base); - len -= 4; - memcpy(prefix, base, len); - prefix[len] = 0; - - snprintf(buf, 499, "result/c14n/%s/%s", subdir,prefix); - if (!checkTestFile(buf)) { - fprintf(stderr, "Missing result file %s", buf); - return(-1); - } - result = strdup(buf); - snprintf(buf, 499, "test/c14n/%s/%s.xpath", subdir,prefix); - if (checkTestFile(buf)) { - xpath = strdup(buf); - } - snprintf(buf, 499, "test/c14n/%s/%s.ns", subdir,prefix); - if (checkTestFile(buf)) { - ns = strdup(buf); - } - - nb_tests++; - if (c14nRunTest(filename, with_comments, mode, - xpath, ns, result) < 0) - ret = 1; - - if (result != NULL) free(result); - if (xpath != NULL) free(xpath); - if (ns != NULL) free(ns); - return(ret); -} - -static int -c14nWithCommentTest(const char *filename, - const char *resul ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - return(c14nCommonTest(filename, 1, XML_C14N_1_0, "with-comments")); -} -static int -c14nWithoutCommentTest(const char *filename, - const char *resul ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - return(c14nCommonTest(filename, 0, XML_C14N_1_0, "without-comments")); -} -static int -c14nExcWithoutCommentTest(const char *filename, - const char *resul ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - return(c14nCommonTest(filename, 0, XML_C14N_EXCLUSIVE_1_0, "exc-without-comments")); -} -static int -c14n11WithoutCommentTest(const char *filename, - const char *resul ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - return(c14nCommonTest(filename, 0, XML_C14N_1_1, "1-1-without-comments")); -} -#endif -#if defined(LIBXML_THREAD_ENABLED) && defined(LIBXML_CATALOG_ENABLED) && defined (LIBXML_SAX1_ENABLED) -/************************************************************************ - * * - * Catalog and threads test * - * * - ************************************************************************/ - -/* - * mostly a cut and paste from testThreads.c - */ -#define MAX_ARGC 20 - -static const char *catalog = "test/threads/complex.xml"; -static const char *testfiles[] = { - "test/threads/abc.xml", - "test/threads/acb.xml", - "test/threads/bac.xml", - "test/threads/bca.xml", - "test/threads/cab.xml", - "test/threads/cba.xml", - "test/threads/invalid.xml", -}; - -static const char *Okay = "OK"; -static const char *Failed = "Failed"; - -#ifndef xmlDoValidityCheckingDefaultValue -#error xmlDoValidityCheckingDefaultValue is not a macro -#endif -#ifndef xmlGenericErrorContext -#error xmlGenericErrorContext is not a macro -#endif - -static void * -thread_specific_data(void *private_data) -{ - xmlDocPtr myDoc; - const char *filename = (const char *) private_data; - int okay = 1; - - if (!strcmp(filename, "test/threads/invalid.xml")) { - xmlDoValidityCheckingDefaultValue = 0; - xmlGenericErrorContext = stdout; - } else { - xmlDoValidityCheckingDefaultValue = 1; - xmlGenericErrorContext = stderr; - } - myDoc = xmlParseFile(filename); - if (myDoc) { - xmlFreeDoc(myDoc); - } else { - printf("parse failed\n"); - okay = 0; - } - if (!strcmp(filename, "test/threads/invalid.xml")) { - if (xmlDoValidityCheckingDefaultValue != 0) { - printf("ValidityCheckingDefaultValue override failed\n"); - okay = 0; - } - if (xmlGenericErrorContext != stdout) { - printf("xmlGenericErrorContext override failed\n"); - okay = 0; - } - } else { - if (xmlDoValidityCheckingDefaultValue != 1) { - printf("ValidityCheckingDefaultValue override failed\n"); - okay = 0; - } - if (xmlGenericErrorContext != stderr) { - printf("xmlGenericErrorContext override failed\n"); - okay = 0; - } - } - if (okay == 0) - return ((void *) Failed); - return ((void *) Okay); -} - -#if defined WIN32 -#include -#include - -#define TEST_REPEAT_COUNT 500 - -static HANDLE tid[MAX_ARGC]; - -static DWORD WINAPI -win32_thread_specific_data(void *private_data) -{ - return((DWORD) thread_specific_data(private_data)); -} - -static int -testThread(void) -{ - unsigned int i, repeat; - unsigned int num_threads = sizeof(testfiles) / sizeof(testfiles[0]); - DWORD results[MAX_ARGC]; - BOOL ret; - int res = 0; - - xmlInitParser(); - for (repeat = 0; repeat < TEST_REPEAT_COUNT; repeat++) { - xmlLoadCatalog(catalog); - nb_tests++; - - for (i = 0; i < num_threads; i++) { - results[i] = 0; - tid[i] = (HANDLE) - 1; - } - - for (i = 0; i < num_threads; i++) { - DWORD useless; - - tid[i] = CreateThread(NULL, 0, - win32_thread_specific_data, - (void *) testfiles[i], 0, - &useless); - if (tid[i] == NULL) { - fprintf(stderr, "CreateThread failed\n"); - return(1); - } - } - - if (WaitForMultipleObjects(num_threads, tid, TRUE, INFINITE) == - WAIT_FAILED) { - fprintf(stderr, "WaitForMultipleObjects failed\n"); - return(1); - } - - for (i = 0; i < num_threads; i++) { - ret = GetExitCodeThread(tid[i], &results[i]); - if (ret == 0) { - fprintf(stderr, "GetExitCodeThread failed\n"); - return(1); - } - CloseHandle(tid[i]); - } - - xmlCatalogCleanup(); - for (i = 0; i < num_threads; i++) { - if (results[i] != (DWORD) Okay) { - fprintf(stderr, "Thread %d handling %s failed\n", - i, testfiles[i]); - res = 1; - } - } - } - - return (res); -} - -#elif defined __BEOS__ -#include - -static thread_id tid[MAX_ARGC]; - -static int -testThread(void) -{ - unsigned int i, repeat; - unsigned int num_threads = sizeof(testfiles) / sizeof(testfiles[0]); - void *results[MAX_ARGC]; - status_t ret; - int res = 0; - - xmlInitParser(); - for (repeat = 0; repeat < 500; repeat++) { - xmlLoadCatalog(catalog); - for (i = 0; i < num_threads; i++) { - results[i] = NULL; - tid[i] = (thread_id) - 1; - } - for (i = 0; i < num_threads; i++) { - tid[i] = - spawn_thread(thread_specific_data, "xmlTestThread", - B_NORMAL_PRIORITY, (void *) testfiles[i]); - if (tid[i] < B_OK) { - fprintf(stderr, "beos_thread_create failed\n"); - return (1); - } - printf("beos_thread_create %d -> %d\n", i, tid[i]); - } - for (i = 0; i < num_threads; i++) { - ret = wait_for_thread(tid[i], &results[i]); - printf("beos_thread_wait %d -> %d\n", i, ret); - if (ret != B_OK) { - fprintf(stderr, "beos_thread_wait failed\n"); - return (1); - } - } - - xmlCatalogCleanup(); - ret = B_OK; - for (i = 0; i < num_threads; i++) - if (results[i] != (void *) Okay) { - printf("Thread %d handling %s failed\n", i, testfiles[i]); - ret = B_ERROR; - } - } - if (ret != B_OK) - return(1); - return (0); -} - -#elif defined HAVE_PTHREAD_H -#include - -static pthread_t tid[MAX_ARGC]; - -static int -testThread(void) -{ - unsigned int i, repeat; - unsigned int num_threads = sizeof(testfiles) / sizeof(testfiles[0]); - void *results[MAX_ARGC]; - int ret; - int res = 0; - - xmlInitParser(); - - for (repeat = 0; repeat < 500; repeat++) { - xmlLoadCatalog(catalog); - nb_tests++; - - for (i = 0; i < num_threads; i++) { - results[i] = NULL; - tid[i] = (pthread_t) - 1; - } - - for (i = 0; i < num_threads; i++) { - ret = pthread_create(&tid[i], 0, thread_specific_data, - (void *) testfiles[i]); - if (ret != 0) { - fprintf(stderr, "pthread_create failed\n"); - return (1); - } - } - for (i = 0; i < num_threads; i++) { - ret = pthread_join(tid[i], &results[i]); - if (ret != 0) { - fprintf(stderr, "pthread_join failed\n"); - return (1); - } - } - - xmlCatalogCleanup(); - for (i = 0; i < num_threads; i++) - if (results[i] != (void *) Okay) { - fprintf(stderr, "Thread %d handling %s failed\n", - i, testfiles[i]); - res = 1; - } - } - return (res); -} - -#else -static int -testThread(void) -{ - fprintf(stderr, - "Specific platform thread support not detected\n"); - return (-1); -} -#endif -static int -threadsTest(const char *filename ATTRIBUTE_UNUSED, - const char *resul ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - return(testThread()); -} -#endif -/************************************************************************ - * * - * Tests Descriptions * - * * - ************************************************************************/ - -static -testDesc testDescriptions[] = { - { "XML regression tests" , - oldParseTest, "./test/*", "result/", "", NULL, - 0 }, - { "XML regression tests on memory" , - memParseTest, "./test/*", "result/", "", NULL, - 0 }, - { "XML entity subst regression tests" , - noentParseTest, "./test/*", "result/noent/", "", NULL, - XML_PARSE_NOENT }, - { "XML Namespaces regression tests", - errParseTest, "./test/namespaces/*", "result/namespaces/", "", ".err", - 0 }, - { "Error cases regression tests", - errParseTest, "./test/errors/*.xml", "result/errors/", "", ".err", - 0 }, -#ifdef LIBXML_READER_ENABLED - { "Error cases stream regression tests", - streamParseTest, "./test/errors/*.xml", "result/errors/", NULL, ".str", - 0 }, - { "Reader regression tests", - streamParseTest, "./test/*", "result/", ".rdr", NULL, - 0 }, - { "Reader entities substitution regression tests", - streamParseTest, "./test/*", "result/", ".rde", NULL, - XML_PARSE_NOENT }, - { "Reader on memory regression tests", - streamMemParseTest, "./test/*", "result/", ".rdr", NULL, - 0 }, - { "Walker regression tests", - walkerParseTest, "./test/*", "result/", ".rdr", NULL, - 0 }, -#endif -#ifdef LIBXML_SAX1_ENABLED - { "SAX1 callbacks regression tests" , - saxParseTest, "./test/*", "result/", ".sax", NULL, - XML_PARSE_SAX1 }, - { "SAX2 callbacks regression tests" , - saxParseTest, "./test/*", "result/", ".sax2", NULL, - 0 }, -#endif -#ifdef LIBXML_PUSH_ENABLED - { "XML push regression tests" , - pushParseTest, "./test/*", "result/", "", NULL, - 0 }, -#endif -#ifdef LIBXML_HTML_ENABLED - { "HTML regression tests" , - errParseTest, "./test/HTML/*", "result/HTML/", "", ".err", - XML_PARSE_HTML }, -#ifdef LIBXML_PUSH_ENABLED - { "Push HTML regression tests" , - pushParseTest, "./test/HTML/*", "result/HTML/", "", ".err", - XML_PARSE_HTML }, -#endif -#ifdef LIBXML_SAX1_ENABLED - { "HTML SAX regression tests" , - saxParseTest, "./test/HTML/*", "result/HTML/", ".sax", NULL, - XML_PARSE_HTML }, -#endif -#endif -#ifdef LIBXML_VALID_ENABLED - { "Valid documents regression tests" , - errParseTest, "./test/VCM/*", NULL, NULL, NULL, - XML_PARSE_DTDVALID }, - { "Validity checking regression tests" , - errParseTest, "./test/VC/*", "result/VC/", NULL, "", - XML_PARSE_DTDVALID }, - { "General documents valid regression tests" , - errParseTest, "./test/valid/*", "result/valid/", "", ".err", - XML_PARSE_DTDVALID }, -#endif -#ifdef LIBXML_XINCLUDE_ENABLED - { "XInclude regression tests" , - errParseTest, "./test/XInclude/docs/*", "result/XInclude/", "", NULL, - /* Ignore errors at this point ".err", */ - XML_PARSE_XINCLUDE }, -#ifdef LIBXML_READER_ENABLED - { "XInclude xmlReader regression tests", - streamParseTest, "./test/XInclude/docs/*", "result/XInclude/", ".rdr", - /* Ignore errors at this point ".err", */ - NULL, XML_PARSE_XINCLUDE }, -#endif - { "XInclude regression tests stripping include nodes" , - errParseTest, "./test/XInclude/docs/*", "result/XInclude/", "", NULL, - /* Ignore errors at this point ".err", */ - XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE }, -#ifdef LIBXML_READER_ENABLED - { "XInclude xmlReader regression tests stripping include nodes", - streamParseTest, "./test/XInclude/docs/*", "result/XInclude/", ".rdr", - /* Ignore errors at this point ".err", */ - NULL, XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE }, -#endif -#endif -#ifdef LIBXML_XPATH_ENABLED -#ifdef LIBXML_DEBUG_ENABLED - { "XPath expressions regression tests" , - xpathExprTest, "./test/XPath/expr/*", "result/XPath/expr/", "", NULL, - 0 }, - { "XPath document queries regression tests" , - xpathDocTest, "./test/XPath/docs/*", NULL, NULL, NULL, - 0 }, -#ifdef LIBXML_XPTR_ENABLED - { "XPointer document queries regression tests" , - xptrDocTest, "./test/XPath/docs/*", NULL, NULL, NULL, - 0 }, -#endif - { "xml:id regression tests" , - xmlidDocTest, "./test/xmlid/*", "result/xmlid/", "", ".err", - 0 }, -#endif -#endif - { "URI parsing tests" , - uriParseTest, "./test/URI/*.uri", "result/URI/", "", NULL, - 0 }, - { "URI base composition tests" , - uriBaseTest, "./test/URI/*.data", "result/URI/", "", NULL, - 0 }, - { "Path URI conversion tests" , - uriPathTest, NULL, NULL, NULL, NULL, - 0 }, -#ifdef LIBXML_SCHEMAS_ENABLED - { "Schemas regression tests" , - schemasTest, "./test/schemas/*_*.xsd", NULL, NULL, NULL, - 0 }, - { "Relax-NG regression tests" , - rngTest, "./test/relaxng/*.rng", NULL, NULL, NULL, - XML_PARSE_DTDATTR | XML_PARSE_NOENT }, -#ifdef LIBXML_READER_ENABLED - { "Relax-NG streaming regression tests" , - rngStreamTest, "./test/relaxng/*.rng", NULL, NULL, NULL, - XML_PARSE_DTDATTR | XML_PARSE_NOENT }, -#endif -#endif -#ifdef LIBXML_PATTERN_ENABLED -#ifdef LIBXML_READER_ENABLED - { "Pattern regression tests" , - patternTest, "./test/pattern/*.pat", "result/pattern/", NULL, NULL, - 0 }, -#endif -#endif -#ifdef LIBXML_C14N_ENABLED - { "C14N with comments regression tests" , - c14nWithCommentTest, "./test/c14n/with-comments/*.xml", NULL, NULL, NULL, - 0 }, - { "C14N without comments regression tests" , - c14nWithoutCommentTest, "./test/c14n/without-comments/*.xml", NULL, NULL, NULL, - 0 }, - { "C14N exclusive without comments regression tests" , - c14nExcWithoutCommentTest, "./test/c14n/exc-without-comments/*.xml", NULL, NULL, NULL, - 0 }, - { "C14N 1.1 without comments regression tests" , - c14n11WithoutCommentTest, "./test/c14n/1-1-without-comments/*.xml", NULL, NULL, NULL, - 0 }, -#endif -#if defined(LIBXML_THREAD_ENABLED) && defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_SAX1_ENABLED) - { "Catalog and Threads regression tests" , - threadsTest, NULL, NULL, NULL, NULL, - 0 }, -#endif - {NULL, NULL, NULL, NULL, NULL, NULL, 0} -}; - -/************************************************************************ - * * - * The main code driving the tests * - * * - ************************************************************************/ - -static int -launchTests(testDescPtr tst) { - int res = 0, err = 0; - size_t i; - char *result; - char *error; - int mem; - - if (tst == NULL) return(-1); - if (tst->in != NULL) { - glob_t globbuf; - - globbuf.gl_offs = 0; - glob(tst->in, GLOB_DOOFFS, NULL, &globbuf); - for (i = 0;i < globbuf.gl_pathc;i++) { - if (!checkTestFile(globbuf.gl_pathv[i])) - continue; - if (tst->suffix != NULL) { - result = resultFilename(globbuf.gl_pathv[i], tst->out, - tst->suffix); - if (result == NULL) { - fprintf(stderr, "Out of memory !\n"); - fatalError(); - } - } else { - result = NULL; - } - if (tst->err != NULL) { - error = resultFilename(globbuf.gl_pathv[i], tst->out, - tst->err); - if (error == NULL) { - fprintf(stderr, "Out of memory !\n"); - fatalError(); - } - } else { - error = NULL; - } - if ((result) &&(!checkTestFile(result))) { - fprintf(stderr, "Missing result file %s\n", result); - } else if ((error) &&(!checkTestFile(error))) { - fprintf(stderr, "Missing error file %s\n", error); - } else { - mem = xmlMemUsed(); - extraMemoryFromResolver = 0; - testErrorsSize = 0; - testErrors[0] = 0; - res = tst->func(globbuf.gl_pathv[i], result, error, - tst->options | XML_PARSE_COMPACT); - xmlResetLastError(); - if (res != 0) { - fprintf(stderr, "File %s generated an error\n", - globbuf.gl_pathv[i]); - nb_errors++; - err++; - } - else if (xmlMemUsed() != mem) { - if ((xmlMemUsed() != mem) && - (extraMemoryFromResolver == 0)) { - fprintf(stderr, "File %s leaked %d bytes\n", - globbuf.gl_pathv[i], xmlMemUsed() - mem); - nb_leaks++; - err++; - } - } - testErrorsSize = 0; - } - if (result) - free(result); - if (error) - free(error); - } - globfree(&globbuf); - } else { - testErrorsSize = 0; - testErrors[0] = 0; - extraMemoryFromResolver = 0; - res = tst->func(NULL, NULL, NULL, tst->options); - if (res != 0) { - nb_errors++; - err++; - } - } - return(err); -} - -static int verbose = 0; -static int tests_quiet = 0; - -static int -runtest(int i) { - int ret = 0, res; - int old_errors, old_tests, old_leaks; - - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - if ((tests_quiet == 0) && (testDescriptions[i].desc != NULL)) - printf("## %s\n", testDescriptions[i].desc); - res = launchTests(&testDescriptions[i]); - if (res != 0) - ret++; - if (verbose) { - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests, no errors\n", nb_tests - old_tests); - else - printf("Ran %d tests, %d errors, %d leaks\n", - nb_tests - old_tests, - nb_errors - old_errors, - nb_leaks - old_leaks); - } - return(ret); -} - -int -main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - int i, a, ret = 0; - int subset = 0; - - initializeLibxml2(); - - for (a = 1; a < argc;a++) { - if (!strcmp(argv[a], "-v")) - verbose = 1; - else if (!strcmp(argv[a], "-quiet")) - tests_quiet = 1; - else { - for (i = 0; testDescriptions[i].func != NULL; i++) { - if (strstr(testDescriptions[i].desc, argv[a])) { - ret += runtest(i); - subset++; - } - } - } - } - if (subset == 0) { - for (i = 0; testDescriptions[i].func != NULL; i++) { - ret += runtest(i); - } - } - if ((nb_errors == 0) && (nb_leaks == 0)) { - ret = 0; - printf("Total %d tests, no errors\n", - nb_tests); - } else { - ret = 1; - printf("Total %d tests, %d errors, %d leaks\n", - nb_tests, nb_errors, nb_leaks); - } - xmlCleanupParser(); - xmlMemoryDump(); - - return(ret); -} - -#else /* ! LIBXML_OUTPUT_ENABLED */ -int -main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - fprintf(stderr, "runtest requires output to be enabled in libxml2\n"); - return(1); -} -#endif diff --git a/reactos/lib/3rdparty/libxml2/runxmlconf.c b/reactos/lib/3rdparty/libxml2/runxmlconf.c deleted file mode 100644 index cef20f484b5..00000000000 --- a/reactos/lib/3rdparty/libxml2/runxmlconf.c +++ /dev/null @@ -1,607 +0,0 @@ -/* - * runsuite.c: C program to run libxml2 againts published testsuites - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#include "libxml.h" -#include - -#ifdef LIBXML_XPATH_ENABLED - -#if !defined(_WIN32) || defined(__CYGWIN__) -#include -#endif -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#define LOGFILE "runxmlconf.log" -static FILE *logfile = NULL; -static int verbose = 0; - -#define NB_EXPECTED_ERRORS 15 - - -const char *skipped_tests[] = { -/* http://lists.w3.org/Archives/Public/public-xml-testsuite/2008Jul/0000.html */ - "rmt-ns10-035", - NULL -}; - -/************************************************************************ - * * - * File name and path utilities * - * * - ************************************************************************/ - -static int checkTestFile(const char *filename) { - struct stat buf; - - if (stat(filename, &buf) == -1) - return(0); - -#if defined(_WIN32) && !defined(__CYGWIN__) - if (!(buf.st_mode & _S_IFREG)) - return(0); -#else - if (!S_ISREG(buf.st_mode)) - return(0); -#endif - - return(1); -} - -static xmlChar *composeDir(const xmlChar *dir, const xmlChar *path) { - char buf[500]; - - if (dir == NULL) return(xmlStrdup(path)); - if (path == NULL) return(NULL); - - snprintf(buf, 500, "%s/%s", (const char *) dir, (const char *) path); - return(xmlStrdup((const xmlChar *) buf)); -} - -/************************************************************************ - * * - * Libxml2 specific routines * - * * - ************************************************************************/ - -static int nb_skipped = 0; -static int nb_tests = 0; -static int nb_errors = 0; -static int nb_leaks = 0; - -/* - * We need to trap calls to the resolver to not account memory for the catalog - * and not rely on any external resources. - */ -static xmlParserInputPtr -testExternalEntityLoader(const char *URL, const char *ID ATTRIBUTE_UNUSED, - xmlParserCtxtPtr ctxt) { - xmlParserInputPtr ret; - - ret = xmlNewInputFromFile(ctxt, (const char *) URL); - - return(ret); -} - -/* - * Trapping the error messages at the generic level to grab the equivalent of - * stderr messages on CLI tools. - */ -static char testErrors[32769]; -static int testErrorsSize = 0; -static int nbError = 0; -static int nbFatal = 0; - -static void test_log(const char *msg, ...) { - va_list args; - if (logfile != NULL) { - fprintf(logfile, "\n------------\n"); - va_start(args, msg); - vfprintf(logfile, msg, args); - va_end(args); - fprintf(logfile, "%s", testErrors); - testErrorsSize = 0; testErrors[0] = 0; - } - if (verbose) { - va_start(args, msg); - vfprintf(stderr, msg, args); - va_end(args); - } -} - -static void -testErrorHandler(void *userData ATTRIBUTE_UNUSED, xmlErrorPtr error) { - int res; - - if (testErrorsSize >= 32768) - return; - res = snprintf(&testErrors[testErrorsSize], - 32768 - testErrorsSize, - "%s:%d: %s\n", (error->file ? error->file : "entity"), - error->line, error->message); - if (error->level == XML_ERR_FATAL) - nbFatal++; - else if (error->level == XML_ERR_ERROR) - nbError++; - if (testErrorsSize + res >= 32768) { - /* buffer is full */ - testErrorsSize = 32768; - testErrors[testErrorsSize] = 0; - } else { - testErrorsSize += res; - } - testErrors[testErrorsSize] = 0; -} - -static xmlXPathContextPtr ctxtXPath; - -static void -initializeLibxml2(void) { - xmlGetWarningsDefaultValue = 0; - xmlPedanticParserDefault(0); - - xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup); - xmlInitParser(); - xmlSetExternalEntityLoader(testExternalEntityLoader); - ctxtXPath = xmlXPathNewContext(NULL); - /* - * Deactivate the cache if created; otherwise we have to create/free it - * for every test, since it will confuse the memory leak detection. - * Note that normally this need not be done, since the cache is not - * created until set explicitely with xmlXPathContextSetCache(); - * but for test purposes it is sometimes usefull to activate the - * cache by default for the whole library. - */ - if (ctxtXPath->cache != NULL) - xmlXPathContextSetCache(ctxtXPath, 0, -1, 0); - xmlSetStructuredErrorFunc(NULL, testErrorHandler); -} - -/************************************************************************ - * * - * Run the xmlconf test if found * - * * - ************************************************************************/ - -static int -xmlconfTestInvalid(const char *id, const char *filename, int options) { - xmlDocPtr doc; - xmlParserCtxtPtr ctxt; - int ret = 1; - - ctxt = xmlNewParserCtxt(); - if (ctxt == NULL) { - test_log("test %s : %s out of memory\n", - id, filename); - return(0); - } - doc = xmlCtxtReadFile(ctxt, filename, NULL, options); - if (doc == NULL) { - test_log("test %s : %s invalid document turned not well-formed too\n", - id, filename); - } else { - /* invalidity should be reported both in the context and in the document */ - if ((ctxt->valid != 0) || (doc->properties & XML_DOC_DTDVALID)) { - test_log("test %s : %s failed to detect invalid document\n", - id, filename); - nb_errors++; - ret = 0; - } - xmlFreeDoc(doc); - } - xmlFreeParserCtxt(ctxt); - return(ret); -} - -static int -xmlconfTestValid(const char *id, const char *filename, int options) { - xmlDocPtr doc; - xmlParserCtxtPtr ctxt; - int ret = 1; - - ctxt = xmlNewParserCtxt(); - if (ctxt == NULL) { - test_log("test %s : %s out of memory\n", - id, filename); - return(0); - } - doc = xmlCtxtReadFile(ctxt, filename, NULL, options); - if (doc == NULL) { - test_log("test %s : %s failed to parse a valid document\n", - id, filename); - nb_errors++; - ret = 0; - } else { - /* validity should be reported both in the context and in the document */ - if ((ctxt->valid == 0) || ((doc->properties & XML_DOC_DTDVALID) == 0)) { - test_log("test %s : %s failed to validate a valid document\n", - id, filename); - nb_errors++; - ret = 0; - } - xmlFreeDoc(doc); - } - xmlFreeParserCtxt(ctxt); - return(ret); -} - -static int -xmlconfTestNotNSWF(const char *id, const char *filename, int options) { - xmlDocPtr doc; - int ret = 1; - - /* - * In case of Namespace errors, libxml2 will still parse the document - * but log a Namesapce error. - */ - doc = xmlReadFile(filename, NULL, options); - if (doc == NULL) { - test_log("test %s : %s failed to parse the XML\n", - id, filename); - nb_errors++; - ret = 0; - } else { - if ((xmlLastError.code == XML_ERR_OK) || - (xmlLastError.domain != XML_FROM_NAMESPACE)) { - test_log("test %s : %s failed to detect namespace error\n", - id, filename); - nb_errors++; - ret = 0; - } - xmlFreeDoc(doc); - } - return(ret); -} - -static int -xmlconfTestNotWF(const char *id, const char *filename, int options) { - xmlDocPtr doc; - int ret = 1; - - doc = xmlReadFile(filename, NULL, options); - if (doc != NULL) { - test_log("test %s : %s failed to detect not well formedness\n", - id, filename); - nb_errors++; - xmlFreeDoc(doc); - ret = 0; - } - return(ret); -} - -static int -xmlconfTestItem(xmlDocPtr doc, xmlNodePtr cur) { - int ret = -1; - xmlChar *type = NULL; - xmlChar *filename = NULL; - xmlChar *uri = NULL; - xmlChar *base = NULL; - xmlChar *id = NULL; - xmlChar *rec = NULL; - xmlChar *version = NULL; - xmlChar *entities = NULL; - xmlChar *edition = NULL; - int options = 0; - int nstest = 0; - int mem, final; - int i; - - testErrorsSize = 0; testErrors[0] = 0; - nbError = 0; - nbFatal = 0; - id = xmlGetProp(cur, BAD_CAST "ID"); - if (id == NULL) { - test_log("test missing ID, line %ld\n", xmlGetLineNo(cur)); - goto error; - } - for (i = 0;skipped_tests[i] != NULL;i++) { - if (!strcmp(skipped_tests[i], (char *) id)) { - test_log("Skipping test %s from skipped list\n", (char *) id); - ret = 0; - nb_skipped++; - goto error; - } - } - type = xmlGetProp(cur, BAD_CAST "TYPE"); - if (type == NULL) { - test_log("test %s missing TYPE\n", (char *) id); - goto error; - } - uri = xmlGetProp(cur, BAD_CAST "URI"); - if (uri == NULL) { - test_log("test %s missing URI\n", (char *) id); - goto error; - } - base = xmlNodeGetBase(doc, cur); - filename = composeDir(base, uri); - if (!checkTestFile((char *) filename)) { - test_log("test %s missing file %s \n", id, - (filename ? (char *)filename : "NULL")); - goto error; - } - - version = xmlGetProp(cur, BAD_CAST "VERSION"); - - entities = xmlGetProp(cur, BAD_CAST "ENTITIES"); - if (!xmlStrEqual(entities, BAD_CAST "none")) { - options |= XML_PARSE_DTDLOAD; - options |= XML_PARSE_NOENT; - } - rec = xmlGetProp(cur, BAD_CAST "RECOMMENDATION"); - if ((rec == NULL) || - (xmlStrEqual(rec, BAD_CAST "XML1.0")) || - (xmlStrEqual(rec, BAD_CAST "XML1.0-errata2e")) || - (xmlStrEqual(rec, BAD_CAST "XML1.0-errata3e")) || - (xmlStrEqual(rec, BAD_CAST "XML1.0-errata4e"))) { - if ((version != NULL) && (!xmlStrEqual(version, BAD_CAST "1.0"))) { - test_log("Skipping test %s for %s\n", (char *) id, - (char *) version); - ret = 0; - nb_skipped++; - goto error; - } - ret = 1; - } else if ((xmlStrEqual(rec, BAD_CAST "NS1.0")) || - (xmlStrEqual(rec, BAD_CAST "NS1.0-errata1e"))) { - ret = 1; - nstest = 1; - } else { - test_log("Skipping test %s for REC %s\n", (char *) id, (char *) rec); - ret = 0; - nb_skipped++; - goto error; - } - edition = xmlGetProp(cur, BAD_CAST "EDITION"); - if ((edition != NULL) && (xmlStrchr(edition, '5') == NULL)) { - /* test limited to all versions before 5th */ - options |= XML_PARSE_OLD10; - } - - /* - * Reset errors and check memory usage before the test - */ - xmlResetLastError(); - testErrorsSize = 0; testErrors[0] = 0; - mem = xmlMemUsed(); - - if (xmlStrEqual(type, BAD_CAST "not-wf")) { - if (nstest == 0) - xmlconfTestNotWF((char *) id, (char *) filename, options); - else - xmlconfTestNotNSWF((char *) id, (char *) filename, options); - } else if (xmlStrEqual(type, BAD_CAST "valid")) { - options |= XML_PARSE_DTDVALID; - xmlconfTestValid((char *) id, (char *) filename, options); - } else if (xmlStrEqual(type, BAD_CAST "invalid")) { - options |= XML_PARSE_DTDVALID; - xmlconfTestInvalid((char *) id, (char *) filename, options); - } else if (xmlStrEqual(type, BAD_CAST "error")) { - test_log("Skipping error test %s \n", (char *) id); - ret = 0; - nb_skipped++; - goto error; - } else { - test_log("test %s unknown TYPE value %s\n", (char *) id, (char *)type); - ret = -1; - goto error; - } - - /* - * Reset errors and check memory usage after the test - */ - xmlResetLastError(); - final = xmlMemUsed(); - if (final > mem) { - test_log("test %s : %s leaked %d bytes\n", - id, filename, final - mem); - nb_leaks++; - xmlMemDisplayLast(logfile, final - mem); - } - nb_tests++; - -error: - if (type != NULL) - xmlFree(type); - if (entities != NULL) - xmlFree(entities); - if (edition != NULL) - xmlFree(edition); - if (version != NULL) - xmlFree(version); - if (filename != NULL) - xmlFree(filename); - if (uri != NULL) - xmlFree(uri); - if (base != NULL) - xmlFree(base); - if (id != NULL) - xmlFree(id); - if (rec != NULL) - xmlFree(rec); - return(ret); -} - -static int -xmlconfTestCases(xmlDocPtr doc, xmlNodePtr cur, int level) { - xmlChar *profile; - int ret = 0; - int tests = 0; - int output = 0; - - if (level == 1) { - profile = xmlGetProp(cur, BAD_CAST "PROFILE"); - if (profile != NULL) { - output = 1; - level++; - printf("Test cases: %s\n", (char *) profile); - xmlFree(profile); - } - } - cur = cur->children; - while (cur != NULL) { - /* look only at elements we ignore everything else */ - if (cur->type == XML_ELEMENT_NODE) { - if (xmlStrEqual(cur->name, BAD_CAST "TESTCASES")) { - ret += xmlconfTestCases(doc, cur, level); - } else if (xmlStrEqual(cur->name, BAD_CAST "TEST")) { - if (xmlconfTestItem(doc, cur) >= 0) - ret++; - tests++; - } else { - fprintf(stderr, "Unhandled element %s\n", (char *)cur->name); - } - } - cur = cur->next; - } - if (output == 1) { - if (tests > 0) - printf("Test cases: %d tests\n", tests); - } - return(ret); -} - -static int -xmlconfTestSuite(xmlDocPtr doc, xmlNodePtr cur) { - xmlChar *profile; - int ret = 0; - - profile = xmlGetProp(cur, BAD_CAST "PROFILE"); - if (profile != NULL) { - printf("Test suite: %s\n", (char *) profile); - xmlFree(profile); - } else - printf("Test suite\n"); - cur = cur->children; - while (cur != NULL) { - /* look only at elements we ignore everything else */ - if (cur->type == XML_ELEMENT_NODE) { - if (xmlStrEqual(cur->name, BAD_CAST "TESTCASES")) { - ret += xmlconfTestCases(doc, cur, 1); - } else { - fprintf(stderr, "Unhandled element %s\n", (char *)cur->name); - } - } - cur = cur->next; - } - return(ret); -} - -static void -xmlconfInfo(void) { - fprintf(stderr, " you need to fetch and extract the\n"); - fprintf(stderr, " latest XML Conformance Test Suites\n"); - fprintf(stderr, " http://www.w3.org/XML/Test/xmlts20080827.tar.gz\n"); - fprintf(stderr, " see http://www.w3.org/XML/Test/ for informations\n"); -} - -static int -xmlconfTest(void) { - const char *confxml = "xmlconf/xmlconf.xml"; - xmlDocPtr doc; - xmlNodePtr cur; - int ret = 0; - - if (!checkTestFile(confxml)) { - fprintf(stderr, "%s is missing \n", confxml); - xmlconfInfo(); - return(-1); - } - doc = xmlReadFile(confxml, NULL, XML_PARSE_NOENT); - if (doc == NULL) { - fprintf(stderr, "%s is corrupted \n", confxml); - xmlconfInfo(); - return(-1); - } - - cur = xmlDocGetRootElement(doc); - if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "TESTSUITE"))) { - fprintf(stderr, "Unexpected format %s\n", confxml); - xmlconfInfo(); - ret = -1; - } else { - ret = xmlconfTestSuite(doc, cur); - } - xmlFreeDoc(doc); - return(ret); -} - -/************************************************************************ - * * - * The driver for the tests * - * * - ************************************************************************/ - -int -main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - int ret = 0; - int old_errors, old_tests, old_leaks; - - logfile = fopen(LOGFILE, "w"); - if (logfile == NULL) { - fprintf(stderr, - "Could not open the log file, running in verbose mode\n"); - verbose = 1; - } - initializeLibxml2(); - - if ((argc >= 2) && (!strcmp(argv[1], "-v"))) - verbose = 1; - - - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - xmlconfTest(); - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests, no errors\n", nb_tests - old_tests); - else - printf("Ran %d tests, %d errors, %d leaks\n", - nb_tests - old_tests, - nb_errors - old_errors, - nb_leaks - old_leaks); - if ((nb_errors == 0) && (nb_leaks == 0)) { - ret = 0; - printf("Total %d tests, no errors\n", - nb_tests); - } else { - ret = 1; - printf("Total %d tests, %d errors, %d leaks\n", - nb_tests, nb_errors, nb_leaks); - printf("See %s for detailed output\n", LOGFILE); - if ((nb_leaks == 0) && (nb_errors == NB_EXPECTED_ERRORS)) { - printf("%d errors were expected\n", nb_errors); - ret = 0; - } - } - xmlXPathFreeContext(ctxtXPath); - xmlCleanupParser(); - xmlMemoryDump(); - - if (logfile != NULL) - fclose(logfile); - return(ret); -} - -#else /* ! LIBXML_XPATH_ENABLED */ -#include -int -main(int argc, char **argv) { - fprintf(stderr, "%s need XPath support\n", argv[0]); -} -#endif diff --git a/reactos/lib/3rdparty/libxml2/testAutomata.c b/reactos/lib/3rdparty/libxml2/testAutomata.c deleted file mode 100644 index 6c4de9002e4..00000000000 --- a/reactos/lib/3rdparty/libxml2/testAutomata.c +++ /dev/null @@ -1,309 +0,0 @@ -/* - * testRegexp.c: simple module for testing regular expressions - * - * See Copyright for the status of this software. - * - * Daniel Veillard - */ - -#include "libxml.h" -#ifdef LIBXML_AUTOMATA_ENABLED -#include - -#include -#include - -static int scanNumber(char **ptr) { - int ret = 0; - char *cur; - - cur = *ptr; - while ((*cur >= '0') && (*cur <= '9')) { - ret = ret * 10 + (*cur - '0'); - cur++; - } - *ptr = cur; - return(ret); -} - -static void -testRegexpFile(const char *filename) { - FILE *input; - char expr[5000]; - int len; - int ret; - int i; - xmlAutomataPtr am; - xmlAutomataStatePtr states[1000]; - xmlRegexpPtr regexp = NULL; - xmlRegExecCtxtPtr exec = NULL; - - for (i = 0;i<1000;i++) - states[i] = NULL; - - input = fopen(filename, "r"); - if (input == NULL) { - xmlGenericError(xmlGenericErrorContext, - "Cannot open %s for reading\n", filename); - return; - } - - am = xmlNewAutomata(); - if (am == NULL) { - xmlGenericError(xmlGenericErrorContext, - "Cannot create automata\n"); - fclose(input); - return; - } - states[0] = xmlAutomataGetInitState(am); - if (states[0] == NULL) { - xmlGenericError(xmlGenericErrorContext, - "Cannot get start state\n"); - xmlFreeAutomata(am); - fclose(input); - return; - } - ret = 0; - - while (fgets(expr, 4500, input) != NULL) { - if (expr[0] == '#') - continue; - len = strlen(expr); - len--; - while ((len >= 0) && - ((expr[len] == '\n') || (expr[len] == '\t') || - (expr[len] == '\r') || (expr[len] == ' '))) len--; - expr[len + 1] = 0; - if (len >= 0) { - if ((am != NULL) && (expr[0] == 't') && (expr[1] == ' ')) { - char *ptr = &expr[2]; - int from, to; - - from = scanNumber(&ptr); - if (*ptr != ' ') { - xmlGenericError(xmlGenericErrorContext, - "Bad line %s\n", expr); - break; - } - if (states[from] == NULL) - states[from] = xmlAutomataNewState(am); - ptr++; - to = scanNumber(&ptr); - if (*ptr != ' ') { - xmlGenericError(xmlGenericErrorContext, - "Bad line %s\n", expr); - break; - } - if (states[to] == NULL) - states[to] = xmlAutomataNewState(am); - ptr++; - xmlAutomataNewTransition(am, states[from], states[to], - BAD_CAST ptr, NULL); - } else if ((am != NULL) && (expr[0] == 'e') && (expr[1] == ' ')) { - char *ptr = &expr[2]; - int from, to; - - from = scanNumber(&ptr); - if (*ptr != ' ') { - xmlGenericError(xmlGenericErrorContext, - "Bad line %s\n", expr); - break; - } - if (states[from] == NULL) - states[from] = xmlAutomataNewState(am); - ptr++; - to = scanNumber(&ptr); - if (states[to] == NULL) - states[to] = xmlAutomataNewState(am); - xmlAutomataNewEpsilon(am, states[from], states[to]); - } else if ((am != NULL) && (expr[0] == 'f') && (expr[1] == ' ')) { - char *ptr = &expr[2]; - int state; - - state = scanNumber(&ptr); - if (states[state] == NULL) { - xmlGenericError(xmlGenericErrorContext, - "Bad state %d : %s\n", state, expr); - break; - } - xmlAutomataSetFinalState(am, states[state]); - } else if ((am != NULL) && (expr[0] == 'c') && (expr[1] == ' ')) { - char *ptr = &expr[2]; - int from, to; - int min, max; - - from = scanNumber(&ptr); - if (*ptr != ' ') { - xmlGenericError(xmlGenericErrorContext, - "Bad line %s\n", expr); - break; - } - if (states[from] == NULL) - states[from] = xmlAutomataNewState(am); - ptr++; - to = scanNumber(&ptr); - if (*ptr != ' ') { - xmlGenericError(xmlGenericErrorContext, - "Bad line %s\n", expr); - break; - } - if (states[to] == NULL) - states[to] = xmlAutomataNewState(am); - ptr++; - min = scanNumber(&ptr); - if (*ptr != ' ') { - xmlGenericError(xmlGenericErrorContext, - "Bad line %s\n", expr); - break; - } - ptr++; - max = scanNumber(&ptr); - if (*ptr != ' ') { - xmlGenericError(xmlGenericErrorContext, - "Bad line %s\n", expr); - break; - } - ptr++; - xmlAutomataNewCountTrans(am, states[from], states[to], - BAD_CAST ptr, min, max, NULL); - } else if ((am != NULL) && (expr[0] == '-') && (expr[1] == '-')) { - /* end of the automata */ - regexp = xmlAutomataCompile(am); - xmlFreeAutomata(am); - am = NULL; - if (regexp == NULL) { - xmlGenericError(xmlGenericErrorContext, - "Failed to compile the automata"); - break; - } - } else if ((expr[0] == '=') && (expr[1] == '>')) { - if (regexp == NULL) { - printf("=> failed not compiled\n"); - } else { - if (exec == NULL) - exec = xmlRegNewExecCtxt(regexp, NULL, NULL); - if (ret == 0) { - ret = xmlRegExecPushString(exec, NULL, NULL); - } - if (ret == 1) - printf("=> Passed\n"); - else if ((ret == 0) || (ret == -1)) - printf("=> Failed\n"); - else if (ret < 0) - printf("=> Error\n"); - xmlRegFreeExecCtxt(exec); - exec = NULL; - } - ret = 0; - } else if (regexp != NULL) { - if (exec == NULL) - exec = xmlRegNewExecCtxt(regexp, NULL, NULL); - ret = xmlRegExecPushString(exec, BAD_CAST expr, NULL); - } else { - xmlGenericError(xmlGenericErrorContext, - "Unexpected line %s\n", expr); - } - } - } - fclose(input); - if (regexp != NULL) - xmlRegFreeRegexp(regexp); - if (exec != NULL) - xmlRegFreeExecCtxt(exec); - if (am != NULL) - xmlFreeAutomata(am); -} - -int main(int argc, char **argv) { - - xmlInitMemory(); - - if (argc == 1) { - int ret; - xmlAutomataPtr am; - xmlAutomataStatePtr start, cur; - xmlRegexpPtr regexp; - xmlRegExecCtxtPtr exec; - - am = xmlNewAutomata(); - start = xmlAutomataGetInitState(am); - - /* generate a[ba]*a */ - cur = xmlAutomataNewTransition(am, start, NULL, BAD_CAST"a", NULL); - xmlAutomataNewTransition(am, cur, cur, BAD_CAST"b", NULL); - xmlAutomataNewTransition(am, cur, cur, BAD_CAST"a", NULL); - cur = xmlAutomataNewCountTrans(am, cur, NULL, BAD_CAST"a", 2, 3, NULL); - xmlAutomataSetFinalState(am, cur); - - /* compile it in a regexp and free the automata */ - regexp = xmlAutomataCompile(am); - xmlFreeAutomata(am); - - /* test the regexp */ - xmlRegexpPrint(stdout, regexp); - exec = xmlRegNewExecCtxt(regexp, NULL, NULL); - ret = xmlRegExecPushString(exec, BAD_CAST"a", NULL); - if (ret == 1) - printf("final\n"); - else if (ret < 0) - printf("error\n"); - ret =xmlRegExecPushString(exec, BAD_CAST"a", NULL); - if (ret == 1) - printf("final\n"); - else if (ret < 0) - printf("error\n"); - ret =xmlRegExecPushString(exec, BAD_CAST"b", NULL); - if (ret == 1) - printf("final\n"); - else if (ret < 0) - printf("error\n"); - ret =xmlRegExecPushString(exec, BAD_CAST"a", NULL); - if (ret == 1) - printf("final\n"); - else if (ret < 0) - printf("error\n"); - ret =xmlRegExecPushString(exec, BAD_CAST"a", NULL); - if (ret == 1) - printf("final\n"); - else if (ret < 0) - printf("error\n"); - ret =xmlRegExecPushString(exec, BAD_CAST"a", NULL); - if (ret == 1) - printf("final\n"); - else if (ret < 0) - printf("error\n"); - ret =xmlRegExecPushString(exec, BAD_CAST"a", NULL); - if (ret == 1) - printf("final\n"); - else if (ret < 0) - printf("error\n"); - if (ret == 0) { - ret = xmlRegExecPushString(exec, NULL, NULL); - if (ret == 1) - printf("final\n"); - else if (ret < 0) - printf("error\n"); - } - xmlRegFreeExecCtxt(exec); - - /* free the regexp */ - xmlRegFreeRegexp(regexp); - } else { - int i; - - for (i = 1;i < argc;i++) - testRegexpFile(argv[i]); - } - - xmlCleanupParser(); - xmlMemoryDump(); - return(0); -} - -#else -#include -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - printf("%s : Automata support not compiled in\n", argv[0]); - return(0); -} -#endif /* LIBXML_AUTOMATA_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/testC14N.c b/reactos/lib/3rdparty/libxml2/testC14N.c deleted file mode 100644 index 86e58f27e40..00000000000 --- a/reactos/lib/3rdparty/libxml2/testC14N.c +++ /dev/null @@ -1,370 +0,0 @@ -/* - * Canonical XML implementation test program - * (http://www.w3.org/TR/2001/REC-xml-c14n-20010315) - * - * See Copyright for the status of this software. - * - * Author: Aleksey Sanin - */ -#include "libxml.h" -#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - -#include -#include -#ifndef STDOUT_FILENO -#ifdef HAVE_UNISTD_H -#include -#else -#define STDOUT_FILENO fileno(stdout) -#endif /* HAVE_UNISTD_H */ -#endif -#ifdef HAVE_STDLIB_H -#include -#endif - -#include -#include -#include -#include - -#include - - -static void usage(const char *name) { - fprintf(stderr, - "Usage: %s [] []\n", - name); - fprintf(stderr, "where is one of following:\n"); - fprintf(stderr, - "--with-comments \t XML file canonicalization v1.0 w comments \n"); - fprintf(stderr, - "--without-comments \t XML file canonicalization v1.0 w/o comments\n"); - fprintf(stderr, - "--1-1-with-comments \t XML file canonicalization v1.1 w comments\n"); - fprintf(stderr, - "--1-1-without-comments \t XML file canonicalization v1.1 w/o comments\n"); - fprintf(stderr, - "--exc-with-comments \t Exclusive XML file canonicalization v1.0 w comments\n"); - fprintf(stderr, - "--exc-without-comments\t Exclusive XML file canonicalization v1.0 w/o comments\n"); -} - -static xmlXPathObjectPtr -load_xpath_expr (xmlDocPtr parent_doc, const char* filename); - -static xmlChar **parse_list(xmlChar *str); - -/* static void print_xpath_nodes(xmlNodeSetPtr nodes); */ - -static int -test_c14n(const char* xml_filename, int with_comments, int mode, - const char* xpath_filename, xmlChar **inclusive_namespaces) { - xmlDocPtr doc; - xmlXPathObjectPtr xpath = NULL; - xmlChar *result = NULL; - int ret; - - /* - * build an XML tree from a the file; we need to add default - * attributes and resolve all character and entities references - */ - xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - xmlSubstituteEntitiesDefault(1); - - doc = xmlReadFile(xml_filename, NULL, XML_PARSE_DTDATTR | XML_PARSE_NOENT); - if (doc == NULL) { - fprintf(stderr, "Error: unable to parse file \"%s\"\n", xml_filename); - return(-1); - } - - /* - * Check the document is of the right kind - */ - if(xmlDocGetRootElement(doc) == NULL) { - fprintf(stderr,"Error: empty document for file \"%s\"\n", xml_filename); - xmlFreeDoc(doc); - return(-1); - } - - /* - * load xpath file if specified - */ - if(xpath_filename) { - xpath = load_xpath_expr(doc, xpath_filename); - if(xpath == NULL) { - fprintf(stderr,"Error: unable to evaluate xpath expression\n"); - xmlFreeDoc(doc); - return(-1); - } - } - - /* - * Canonical form - */ - /* fprintf(stderr,"File \"%s\" loaded: start canonization\n", xml_filename); */ - ret = xmlC14NDocDumpMemory(doc, - (xpath) ? xpath->nodesetval : NULL, - mode, inclusive_namespaces, - with_comments, &result); - if(ret >= 0) { - if(result != NULL) { - if (write(STDOUT_FILENO, result, ret) == -1) { - fprintf(stderr, "Can't write data\n"); - } - xmlFree(result); - } - } else { - fprintf(stderr,"Error: failed to canonicalize XML file \"%s\" (ret=%d)\n", xml_filename, ret); - if(result != NULL) xmlFree(result); - xmlFreeDoc(doc); - return(-1); - } - - /* - * Cleanup - */ - if(xpath != NULL) xmlXPathFreeObject(xpath); - xmlFreeDoc(doc); - - return(ret); -} - -int main(int argc, char **argv) { - int ret = -1; - - /* - * Init libxml - */ - xmlInitParser(); - LIBXML_TEST_VERSION - - /* - * Parse command line and process file - */ - if( argc < 3 ) { - fprintf(stderr, "Error: wrong number of arguments.\n"); - usage(argv[0]); - } else if(strcmp(argv[1], "--with-comments") == 0) { - ret = test_c14n(argv[2], 1, XML_C14N_1_0, (argc > 3) ? argv[3] : NULL, NULL); - } else if(strcmp(argv[1], "--without-comments") == 0) { - ret = test_c14n(argv[2], 0, XML_C14N_1_0, (argc > 3) ? argv[3] : NULL, NULL); - } else if(strcmp(argv[1], "--1-1-with-comments") == 0) { - ret = test_c14n(argv[2], 1, XML_C14N_1_1, (argc > 3) ? argv[3] : NULL, NULL); - } else if(strcmp(argv[1], "--1-1-without-comments") == 0) { - ret = test_c14n(argv[2], 0, XML_C14N_1_1, (argc > 3) ? argv[3] : NULL, NULL); - } else if(strcmp(argv[1], "--exc-with-comments") == 0) { - xmlChar **list; - - /* load exclusive namespace from command line */ - list = (argc > 4) ? parse_list((xmlChar *)argv[4]) : NULL; - ret = test_c14n(argv[2], 1, XML_C14N_EXCLUSIVE_1_0, (argc > 3) ? argv[3] : NULL, list); - if(list != NULL) xmlFree(list); - } else if(strcmp(argv[1], "--exc-without-comments") == 0) { - xmlChar **list; - - /* load exclusive namespace from command line */ - list = (argc > 4) ? parse_list((xmlChar *)argv[4]) : NULL; - ret = test_c14n(argv[2], 0, XML_C14N_EXCLUSIVE_1_0, (argc > 3) ? argv[3] : NULL, list); - if(list != NULL) xmlFree(list); - } else { - fprintf(stderr, "Error: bad option.\n"); - usage(argv[0]); - } - - /* - * Shutdown libxml - */ - xmlCleanupParser(); - xmlMemoryDump(); - - return((ret >= 0) ? 0 : 1); -} - -/* - * Macro used to grow the current buffer. - */ -#define growBufferReentrant() { \ - buffer_size *= 2; \ - buffer = (xmlChar **) \ - xmlRealloc(buffer, buffer_size * sizeof(xmlChar*)); \ - if (buffer == NULL) { \ - perror("realloc failed"); \ - return(NULL); \ - } \ -} - -static xmlChar ** -parse_list(xmlChar *str) { - xmlChar **buffer; - xmlChar **out = NULL; - int buffer_size = 0; - int len; - - if(str == NULL) { - return(NULL); - } - - len = xmlStrlen(str); - if((str[0] == '\'') && (str[len - 1] == '\'')) { - str[len - 1] = '\0'; - str++; - } - /* - * allocate an translation buffer. - */ - buffer_size = 1000; - buffer = (xmlChar **) xmlMalloc(buffer_size * sizeof(xmlChar*)); - if (buffer == NULL) { - perror("malloc failed"); - return(NULL); - } - out = buffer; - - while(*str != '\0') { - if (out - buffer > buffer_size - 10) { - int indx = out - buffer; - - growBufferReentrant(); - out = &buffer[indx]; - } - (*out++) = str; - while(*str != ',' && *str != '\0') ++str; - if(*str == ',') *(str++) = '\0'; - } - (*out) = NULL; - return buffer; -} - -static xmlXPathObjectPtr -load_xpath_expr (xmlDocPtr parent_doc, const char* filename) { - xmlXPathObjectPtr xpath; - xmlDocPtr doc; - xmlChar *expr; - xmlXPathContextPtr ctx; - xmlNodePtr node; - xmlNsPtr ns; - - /* - * load XPath expr as a file - */ - xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS; - xmlSubstituteEntitiesDefault(1); - - doc = xmlReadFile(filename, NULL, XML_PARSE_DTDATTR | XML_PARSE_NOENT); - if (doc == NULL) { - fprintf(stderr, "Error: unable to parse file \"%s\"\n", filename); - return(NULL); - } - - /* - * Check the document is of the right kind - */ - if(xmlDocGetRootElement(doc) == NULL) { - fprintf(stderr,"Error: empty document for file \"%s\"\n", filename); - xmlFreeDoc(doc); - return(NULL); - } - - node = doc->children; - while(node != NULL && !xmlStrEqual(node->name, (const xmlChar *)"XPath")) { - node = node->next; - } - - if(node == NULL) { - fprintf(stderr,"Error: XPath element expected in the file \"%s\"\n", filename); - xmlFreeDoc(doc); - return(NULL); - } - - expr = xmlNodeGetContent(node); - if(expr == NULL) { - fprintf(stderr,"Error: XPath content element is NULL \"%s\"\n", filename); - xmlFreeDoc(doc); - return(NULL); - } - - ctx = xmlXPathNewContext(parent_doc); - if(ctx == NULL) { - fprintf(stderr,"Error: unable to create new context\n"); - xmlFree(expr); - xmlFreeDoc(doc); - return(NULL); - } - - /* - * Register namespaces - */ - ns = node->nsDef; - while(ns != NULL) { - if(xmlXPathRegisterNs(ctx, ns->prefix, ns->href) != 0) { - fprintf(stderr,"Error: unable to register NS with prefix=\"%s\" and href=\"%s\"\n", ns->prefix, ns->href); - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); - return(NULL); - } - ns = ns->next; - } - - /* - * Evaluate xpath - */ - xpath = xmlXPathEvalExpression(expr, ctx); - if(xpath == NULL) { - fprintf(stderr,"Error: unable to evaluate xpath expression\n"); - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); - return(NULL); - } - - /* print_xpath_nodes(xpath->nodesetval); */ - - xmlFree(expr); - xmlXPathFreeContext(ctx); - xmlFreeDoc(doc); - return(xpath); -} - -/* -static void -print_xpath_nodes(xmlNodeSetPtr nodes) { - xmlNodePtr cur; - int i; - - if(nodes == NULL ){ - fprintf(stderr, "Error: no nodes set defined\n"); - return; - } - - fprintf(stderr, "Nodes Set:\n-----\n"); - for(i = 0; i < nodes->nodeNr; ++i) { - if(nodes->nodeTab[i]->type == XML_NAMESPACE_DECL) { - xmlNsPtr ns; - - ns = (xmlNsPtr)nodes->nodeTab[i]; - cur = (xmlNodePtr)ns->next; - fprintf(stderr, "namespace \"%s\"=\"%s\" for node %s:%s\n", - ns->prefix, ns->href, - (cur->ns) ? cur->ns->prefix : BAD_CAST "", cur->name); - } else if(nodes->nodeTab[i]->type == XML_ELEMENT_NODE) { - cur = nodes->nodeTab[i]; - fprintf(stderr, "element node \"%s:%s\"\n", - (cur->ns) ? cur->ns->prefix : BAD_CAST "", cur->name); - } else { - cur = nodes->nodeTab[i]; - fprintf(stderr, "node \"%s\": type %d\n", cur->name, cur->type); - } - } -} -*/ - -#else -#include -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - printf("%s : XPath/Canonicalization and output support not compiled in\n", argv[0]); - return(0); -} -#endif /* LIBXML_C14N_ENABLED */ - - diff --git a/reactos/lib/3rdparty/libxml2/testHTML.c b/reactos/lib/3rdparty/libxml2/testHTML.c deleted file mode 100644 index 9b42778c80d..00000000000 --- a/reactos/lib/3rdparty/libxml2/testHTML.c +++ /dev/null @@ -1,880 +0,0 @@ -/* - * testHTML.c : a small tester program for HTML input. - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#include "libxml.h" - -#ifdef LIBXML_HTML_ENABLED - -#include -#include - - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif - -#include -#include -#include -#include -#include -#include - -#ifdef LIBXML_DEBUG_ENABLED -static int debug = 0; -#endif -static int copy = 0; -static int sax = 0; -static int repeat = 0; -static int noout = 0; -#ifdef LIBXML_PUSH_ENABLED -static int push = 0; -#endif /* LIBXML_PUSH_ENABLED */ -static char *encoding = NULL; -static int options = 0; - -static xmlSAXHandler emptySAXHandlerStruct = { - NULL, /* internalSubset */ - NULL, /* isStandalone */ - NULL, /* hasInternalSubset */ - NULL, /* hasExternalSubset */ - NULL, /* resolveEntity */ - NULL, /* getEntity */ - NULL, /* entityDecl */ - NULL, /* notationDecl */ - NULL, /* attributeDecl */ - NULL, /* elementDecl */ - NULL, /* unparsedEntityDecl */ - NULL, /* setDocumentLocator */ - NULL, /* startDocument */ - NULL, /* endDocument */ - NULL, /* startElement */ - NULL, /* endElement */ - NULL, /* reference */ - NULL, /* characters */ - NULL, /* ignorableWhitespace */ - NULL, /* processingInstruction */ - NULL, /* comment */ - NULL, /* xmlParserWarning */ - NULL, /* xmlParserError */ - NULL, /* xmlParserError */ - NULL, /* getParameterEntity */ - NULL, /* cdataBlock */ - NULL, /* externalSubset */ - 1, /* initialized */ - NULL, /* private */ - NULL, /* startElementNsSAX2Func */ - NULL, /* endElementNsSAX2Func */ - NULL /* xmlStructuredErrorFunc */ -}; - -static xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct; -extern xmlSAXHandlerPtr debugSAXHandler; - -/************************************************************************ - * * - * Debug Handlers * - * * - ************************************************************************/ - -/** - * isStandaloneDebug: - * @ctxt: An XML parser context - * - * Is this document tagged standalone ? - * - * Returns 1 if true - */ -static int -isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED) -{ - fprintf(stdout, "SAX.isStandalone()\n"); - return(0); -} - -/** - * hasInternalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an internal subset - * - * Returns 1 if true - */ -static int -hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED) -{ - fprintf(stdout, "SAX.hasInternalSubset()\n"); - return(0); -} - -/** - * hasExternalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an external subset - * - * Returns 1 if true - */ -static int -hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED) -{ - fprintf(stdout, "SAX.hasExternalSubset()\n"); - return(0); -} - -/** - * hasInternalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an internal subset - */ -static void -internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *ExternalID, const xmlChar *SystemID) -{ - fprintf(stdout, "SAX.internalSubset(%s,", name); - if (ExternalID == NULL) - fprintf(stdout, " ,"); - else - fprintf(stdout, " %s,", ExternalID); - if (SystemID == NULL) - fprintf(stdout, " )\n"); - else - fprintf(stdout, " %s)\n", SystemID); -} - -/** - * resolveEntityDebug: - * @ctxt: An XML parser context - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * - * Special entity resolver, better left to the parser, it has - * more context than the application layer. - * The default behaviour is to NOT resolve the entities, in that case - * the ENTITY_REF nodes are built in the structure (and the parameter - * values). - * - * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. - */ -static xmlParserInputPtr -resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId) -{ - /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ - - - fprintf(stdout, "SAX.resolveEntity("); - if (publicId != NULL) - fprintf(stdout, "%s", (char *)publicId); - else - fprintf(stdout, " "); - if (systemId != NULL) - fprintf(stdout, ", %s)\n", (char *)systemId); - else - fprintf(stdout, ", )\n"); -/********* - if (systemId != NULL) { - return(xmlNewInputFromFile(ctxt, (char *) systemId)); - } - *********/ - return(NULL); -} - -/** - * getEntityDebug: - * @ctxt: An XML parser context - * @name: The entity name - * - * Get an entity by name - * - * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. - */ -static xmlEntityPtr -getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) -{ - fprintf(stdout, "SAX.getEntity(%s)\n", name); - return(NULL); -} - -/** - * getParameterEntityDebug: - * @ctxt: An XML parser context - * @name: The entity name - * - * Get a parameter entity by name - * - * Returns the xmlParserInputPtr - */ -static xmlEntityPtr -getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) -{ - fprintf(stdout, "SAX.getParameterEntity(%s)\n", name); - return(NULL); -} - - -/** - * entityDeclDebug: - * @ctxt: An XML parser context - * @name: the entity name - * @type: the entity type - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * @content: the entity value (without processing). - * - * An entity definition has been parsed - */ -static void -entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type, - const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) -{ - fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n", - name, type, publicId, systemId, content); -} - -/** - * attributeDeclDebug: - * @ctxt: An XML parser context - * @name: the attribute name - * @type: the attribute type - * - * An attribute definition has been parsed - */ -static void -attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *elem, const xmlChar *name, - int type, int def, const xmlChar *defaultValue, - xmlEnumerationPtr tree ATTRIBUTE_UNUSED) -{ - fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n", - elem, name, type, def, defaultValue); -} - -/** - * elementDeclDebug: - * @ctxt: An XML parser context - * @name: the element name - * @type: the element type - * @content: the element value (without processing). - * - * An element definition has been parsed - */ -static void -elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type, - xmlElementContentPtr content ATTRIBUTE_UNUSED) -{ - fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n", - name, type); -} - -/** - * notationDeclDebug: - * @ctxt: An XML parser context - * @name: The name of the notation - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * - * What to do when a notation declaration has been parsed. - */ -static void -notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *publicId, const xmlChar *systemId) -{ - fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n", - (char *) name, (char *) publicId, (char *) systemId); -} - -/** - * unparsedEntityDeclDebug: - * @ctxt: An XML parser context - * @name: The name of the entity - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * @notationName: the name of the notation - * - * What to do when an unparsed entity declaration is parsed - */ -static void -unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *publicId, const xmlChar *systemId, - const xmlChar *notationName) -{ - fprintf(stdout, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n", - (char *) name, (char *) publicId, (char *) systemId, - (char *) notationName); -} - -/** - * setDocumentLocatorDebug: - * @ctxt: An XML parser context - * @loc: A SAX Locator - * - * Receive the document locator at startup, actually xmlDefaultSAXLocator - * Everything is available on the context, so this is useless in our case. - */ -static void -setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED) -{ - fprintf(stdout, "SAX.setDocumentLocator()\n"); -} - -/** - * startDocumentDebug: - * @ctxt: An XML parser context - * - * called when the document start being processed. - */ -static void -startDocumentDebug(void *ctx ATTRIBUTE_UNUSED) -{ - fprintf(stdout, "SAX.startDocument()\n"); -} - -/** - * endDocumentDebug: - * @ctxt: An XML parser context - * - * called when the document end has been detected. - */ -static void -endDocumentDebug(void *ctx ATTRIBUTE_UNUSED) -{ - fprintf(stdout, "SAX.endDocument()\n"); -} - -/** - * startElementDebug: - * @ctxt: An XML parser context - * @name: The element name - * - * called when an opening tag has been processed. - */ -static void -startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts) -{ - int i; - - fprintf(stdout, "SAX.startElement(%s", (char *) name); - if (atts != NULL) { - for (i = 0;(atts[i] != NULL);i++) { - fprintf(stdout, ", %s", atts[i++]); - if (atts[i] != NULL) { - unsigned char output[40]; - const unsigned char *att = atts[i]; - int outlen, attlen; - fprintf(stdout, "='"); - while ((attlen = strlen((char*)att)) > 0) { - outlen = sizeof output - 1; - htmlEncodeEntities(output, &outlen, att, &attlen, '\''); - output[outlen] = 0; - fprintf(stdout, "%s", (char *) output); - att += attlen; - } - fprintf(stdout, "'"); - } - } - } - fprintf(stdout, ")\n"); -} - -/** - * endElementDebug: - * @ctxt: An XML parser context - * @name: The element name - * - * called when the end of an element has been detected. - */ -static void -endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) -{ - fprintf(stdout, "SAX.endElement(%s)\n", (char *) name); -} - -/** - * charactersDebug: - * @ctxt: An XML parser context - * @ch: a xmlChar string - * @len: the number of xmlChar - * - * receiving some chars from the parser. - * Question: how much at a time ??? - */ -static void -charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) -{ - unsigned char output[40]; - int inlen = len, outlen = 30; - - htmlEncodeEntities(output, &outlen, ch, &inlen, 0); - output[outlen] = 0; - - fprintf(stdout, "SAX.characters(%s, %d)\n", output, len); -} - -/** - * cdataDebug: - * @ctxt: An XML parser context - * @ch: a xmlChar string - * @len: the number of xmlChar - * - * receiving some cdata chars from the parser. - * Question: how much at a time ??? - */ -static void -cdataDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) -{ - unsigned char output[40]; - int inlen = len, outlen = 30; - - htmlEncodeEntities(output, &outlen, ch, &inlen, 0); - output[outlen] = 0; - - fprintf(stdout, "SAX.cdata(%s, %d)\n", output, len); -} - -/** - * referenceDebug: - * @ctxt: An XML parser context - * @name: The entity name - * - * called when an entity reference is detected. - */ -static void -referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) -{ - fprintf(stdout, "SAX.reference(%s)\n", name); -} - -/** - * ignorableWhitespaceDebug: - * @ctxt: An XML parser context - * @ch: a xmlChar string - * @start: the first char in the string - * @len: the number of xmlChar - * - * receiving some ignorable whitespaces from the parser. - * Question: how much at a time ??? - */ -static void -ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) -{ - char output[40]; - int i; - - for (i = 0;(i 0) { - ctxt = htmlCreatePushParserCtxt(emptySAXHandler, NULL, - chars, res, filename, XML_CHAR_ENCODING_NONE); - while ((res = fread(chars, 1, size, f)) > 0) { - htmlParseChunk(ctxt, chars, res, 0); - } - htmlParseChunk(ctxt, chars, 0, 1); - doc = ctxt->myDoc; - htmlFreeParserCtxt(ctxt); - } - if (doc != NULL) { - fprintf(stdout, "htmlSAXParseFile returned non-NULL\n"); - xmlFreeDoc(doc); - } - fclose(f); - } - if (!noout) { -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - f = fopen(filename, "rb"); -#else - f = fopen(filename, "r"); -#endif - if (f != NULL) { - int res, size = 3; - char chars[4096]; - htmlParserCtxtPtr ctxt; - - /* if (repeat) */ - size = 4096; - res = fread(chars, 1, 4, f); - if (res > 0) { - ctxt = htmlCreatePushParserCtxt(debugSAXHandler, NULL, - chars, res, filename, XML_CHAR_ENCODING_NONE); - while ((res = fread(chars, 1, size, f)) > 0) { - htmlParseChunk(ctxt, chars, res, 0); - } - htmlParseChunk(ctxt, chars, 0, 1); - doc = ctxt->myDoc; - htmlFreeParserCtxt(ctxt); - } - if (doc != NULL) { - fprintf(stdout, "htmlSAXParseFile returned non-NULL\n"); - xmlFreeDoc(doc); - } - fclose(f); - } - } - } else { -#endif /* LIBXML_PUSH_ENABLED */ - doc = htmlSAXParseFile(filename, NULL, emptySAXHandler, NULL); - if (doc != NULL) { - fprintf(stdout, "htmlSAXParseFile returned non-NULL\n"); - xmlFreeDoc(doc); - } - - if (!noout) { - /* - * Debug callback - */ - doc = htmlSAXParseFile(filename, NULL, debugSAXHandler, NULL); - if (doc != NULL) { - fprintf(stdout, "htmlSAXParseFile returned non-NULL\n"); - xmlFreeDoc(doc); - } - } -#ifdef LIBXML_PUSH_ENABLED - } -#endif /* LIBXML_PUSH_ENABLED */ -} - -static void -parseAndPrintFile(char *filename) { - htmlDocPtr doc = NULL; - - /* - * build an HTML tree from a string; - */ -#ifdef LIBXML_PUSH_ENABLED - if (push) { - FILE *f; - -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - f = fopen(filename, "rb"); -#else - f = fopen(filename, "r"); -#endif - if (f != NULL) { - int res, size = 3; - char chars[4096]; - htmlParserCtxtPtr ctxt; - - /* if (repeat) */ - size = 4096; - res = fread(chars, 1, 4, f); - if (res > 0) { - ctxt = htmlCreatePushParserCtxt(NULL, NULL, - chars, res, filename, XML_CHAR_ENCODING_NONE); - while ((res = fread(chars, 1, size, f)) > 0) { - htmlParseChunk(ctxt, chars, res, 0); - } - htmlParseChunk(ctxt, chars, 0, 1); - doc = ctxt->myDoc; - htmlFreeParserCtxt(ctxt); - } - fclose(f); - } - } else { - doc = htmlReadFile(filename, NULL, options); - } -#else - doc = htmlReadFile(filename,NULL,options); -#endif - if (doc == NULL) { - xmlGenericError(xmlGenericErrorContext, - "Could not parse %s\n", filename); - } - -#ifdef LIBXML_TREE_ENABLED - /* - * test intermediate copy if needed. - */ - if (copy) { - htmlDocPtr tmp; - - tmp = doc; - doc = xmlCopyDoc(doc, 1); - xmlFreeDoc(tmp); - } -#endif - -#ifdef LIBXML_OUTPUT_ENABLED - /* - * print it. - */ - if (!noout) { -#ifdef LIBXML_DEBUG_ENABLED - if (!debug) { - if (encoding) - htmlSaveFileEnc("-", doc, encoding); - else - htmlDocDump(stdout, doc); - } else - xmlDebugDumpDocument(stdout, doc); -#else - if (encoding) - htmlSaveFileEnc("-", doc, encoding); - else - htmlDocDump(stdout, doc); -#endif - } -#endif /* LIBXML_OUTPUT_ENABLED */ - - /* - * free it. - */ - xmlFreeDoc(doc); -} - -int main(int argc, char **argv) { - int i, count; - int files = 0; - - for (i = 1; i < argc ; i++) { -#ifdef LIBXML_DEBUG_ENABLED - if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) - debug++; - else -#endif - if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy"))) - copy++; -#ifdef LIBXML_PUSH_ENABLED - else if ((!strcmp(argv[i], "-push")) || (!strcmp(argv[i], "--push"))) - push++; -#endif /* LIBXML_PUSH_ENABLED */ - else if ((!strcmp(argv[i], "-sax")) || (!strcmp(argv[i], "--sax"))) - sax++; - else if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout"))) - noout++; - else if ((!strcmp(argv[i], "-repeat")) || - (!strcmp(argv[i], "--repeat"))) - repeat++; - else if ((!strcmp(argv[i], "-encode")) || - (!strcmp(argv[i], "--encode"))) { - i++; - encoding = argv[i]; - } - } - for (i = 1; i < argc ; i++) { - if ((!strcmp(argv[i], "-encode")) || - (!strcmp(argv[i], "--encode"))) { - i++; - continue; - } - if (argv[i][0] != '-') { - if (repeat) { - for (count = 0;count < 100 * repeat;count++) { - if (sax) - parseSAXFile(argv[i]); - else - parseAndPrintFile(argv[i]); - } - } else { - if (sax) - parseSAXFile(argv[i]); - else - parseAndPrintFile(argv[i]); - } - files ++; - } - } - if (files == 0) { - printf("Usage : %s [--debug] [--copy] [--copy] HTMLfiles ...\n", - argv[0]); - printf("\tParse the HTML files and output the result of the parsing\n"); -#ifdef LIBXML_DEBUG_ENABLED - printf("\t--debug : dump a debug tree of the in-memory document\n"); -#endif - printf("\t--copy : used to test the internal copy implementation\n"); - printf("\t--sax : debug the sequence of SAX callbacks\n"); - printf("\t--repeat : parse the file 100 times, for timing\n"); - printf("\t--noout : do not print the result\n"); -#ifdef LIBXML_PUSH_ENABLED - printf("\t--push : use the push mode parser\n"); -#endif /* LIBXML_PUSH_ENABLED */ - printf("\t--encode encoding : output in the given encoding\n"); - } - xmlCleanupParser(); - xmlMemoryDump(); - - return(0); -} -#else /* !LIBXML_HTML_ENABLED */ -#include -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - printf("%s : HTML support not compiled in\n", argv[0]); - return(0); -} -#endif diff --git a/reactos/lib/3rdparty/libxml2/testModule.c b/reactos/lib/3rdparty/libxml2/testModule.c deleted file mode 100644 index e399f5c040d..00000000000 --- a/reactos/lib/3rdparty/libxml2/testModule.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * testModule.c : a small tester program for xmlModule - * - * See Copyright for the status of this software. - * - * joelwreed@comcast.net - */ - -#include "libxml.h" -#ifdef LIBXML_MODULES_ENABLED -#include - -#include -#include -#include -#include - -#include -#include -#include - -#ifdef _WIN32 -#define MODULE_PATH "." -#include /* for _MAX_PATH */ -#ifndef __MINGW32__ -#define PATH_MAX _MAX_PATH -#endif -#else -#define MODULE_PATH ".libs" -#endif - -/* Used for SCO Openserver*/ -#ifndef PATH_MAX -#ifdef _POSIX_PATH_MAX -#define PATH_MAX _POSIX_PATH_MAX -#else -#define PATH_MAX 4096 -#endif -#endif - -typedef int (*hello_world_t)(void); - -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - xmlChar filename[PATH_MAX]; - xmlModulePtr module = NULL; - hello_world_t hello_world = NULL; - - /* build the module filename, and confirm the module exists */ - xmlStrPrintf(filename, sizeof(filename), - (const xmlChar*) "%s/testdso%s", - (const xmlChar*)MODULE_PATH, - (const xmlChar*)LIBXML_MODULE_EXTENSION); - - module = xmlModuleOpen((const char*)filename, 0); - if (module) - { - if (xmlModuleSymbol(module, "hello_world", (void **) &hello_world)) { - fprintf(stderr, "Failure to lookup\n"); - return(1); - } - if (hello_world == NULL) { - fprintf(stderr, "Lookup returned NULL\n"); - return(1); - } - - (*hello_world)(); - - xmlModuleClose(module); - } - - xmlMemoryDump(); - - return(0); -} - -#else -#include -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - printf("%s : Module support not compiled in\n", argv[0]); - return(0); -} -#endif /* LIBXML_SCHEMAS_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/testReader.c b/reactos/lib/3rdparty/libxml2/testReader.c deleted file mode 100644 index 8f8e26d5b74..00000000000 --- a/reactos/lib/3rdparty/libxml2/testReader.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * testSAX.c : a small tester program for parsing using the SAX API. - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#include "libxml.h" - -#ifdef LIBXML_READER_ENABLED -#include -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - - -#include - -static int debug = 0; -static int dump = 0; -static int noent = 0; -static int count = 0; -static int valid = 0; -static int consumed = 0; - -static void usage(const char *progname) { - printf("Usage : %s [options] XMLfiles ...\n", progname); - printf("\tParse the XML files using the xmlTextReader API\n"); - printf("\t --count: count the number of attribute and elements\n"); - printf("\t --valid: validate the document\n"); - printf("\t --consumed: count the number of bytes consumed\n"); - exit(1); -} -static int elem, attrs; - -static void processNode(xmlTextReaderPtr reader) { - int type; - - type = xmlTextReaderNodeType(reader); - if (count) { - if (type == 1) { - elem++; - attrs += xmlTextReaderAttributeCount(reader); - } - } -} - -static void handleFile(const char *filename) { - xmlTextReaderPtr reader; - int ret; - - if (count) { - elem = 0; - attrs = 0; - } - - reader = xmlNewTextReaderFilename(filename); - if (reader != NULL) { - if (valid) - xmlTextReaderSetParserProp(reader, XML_PARSER_VALIDATE, 1); - - /* - * Process all nodes in sequence - */ - ret = xmlTextReaderRead(reader); - while (ret == 1) { - processNode(reader); - ret = xmlTextReaderRead(reader); - } - - /* - * Done, cleanup and status - */ - if (consumed) - printf("%ld bytes consumed by parser\n", xmlTextReaderByteConsumed(reader)); - xmlFreeTextReader(reader); - if (ret != 0) { - printf("%s : failed to parse\n", filename); - } else if (count) - printf("%s : %d elements, %d attributes\n", filename, elem, attrs); - } else { - fprintf(stderr, "Unable to open %s\n", filename); - } -} - -int main(int argc, char **argv) { - int i; - int files = 0; - - if (argc <= 1) { - usage(argv[0]); - return(1); - } - LIBXML_TEST_VERSION - for (i = 1; i < argc ; i++) { - if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) - debug++; - else if ((!strcmp(argv[i], "-dump")) || (!strcmp(argv[i], "--dump"))) - dump++; - else if ((!strcmp(argv[i], "-count")) || (!strcmp(argv[i], "--count"))) - count++; - else if ((!strcmp(argv[i], "-consumed")) || (!strcmp(argv[i], "--consumed"))) - consumed++; - else if ((!strcmp(argv[i], "-valid")) || (!strcmp(argv[i], "--valid"))) - valid++; - else if ((!strcmp(argv[i], "-noent")) || - (!strcmp(argv[i], "--noent"))) - noent++; - } - if (noent != 0) xmlSubstituteEntitiesDefault(1); - for (i = 1; i < argc ; i++) { - if (argv[i][0] != '-') { - handleFile(argv[i]); - files ++; - } - } - xmlCleanupParser(); - xmlMemoryDump(); - - return(0); -} -#else -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - printf("%s : xmlReader parser support not compiled in\n", argv[0]); - return(0); -} -#endif /* LIBXML_READER_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/testRegexp.c b/reactos/lib/3rdparty/libxml2/testRegexp.c deleted file mode 100644 index 21dac945bc2..00000000000 --- a/reactos/lib/3rdparty/libxml2/testRegexp.c +++ /dev/null @@ -1,402 +0,0 @@ -/* - * testRegexp.c: simple module for testing regular expressions - * - * See Copyright for the status of this software. - * - * Daniel Veillard - */ - -#include "libxml.h" -#ifdef LIBXML_REGEXP_ENABLED -#include - -#include -#include - -static int repeat = 0; -static int debug = 0; - -static void testRegexp(xmlRegexpPtr comp, const char *value) { - int ret; - - ret = xmlRegexpExec(comp, (const xmlChar *) value); - if (ret == 1) - printf("%s: Ok\n", value); - else if (ret == 0) - printf("%s: Fail\n", value); - else - printf("%s: Error: %d\n", value, ret); - if (repeat) { - int j; - for (j = 0;j < 999999;j++) - xmlRegexpExec(comp, (const xmlChar *) value); - } -} - -static void -testRegexpFile(const char *filename) { - xmlRegexpPtr comp = NULL; - FILE *input; - char expression[5000]; - int len; - - input = fopen(filename, "r"); - if (input == NULL) { - xmlGenericError(xmlGenericErrorContext, - "Cannot open %s for reading\n", filename); - return; - } - while (fgets(expression, 4500, input) != NULL) { - len = strlen(expression); - len--; - while ((len >= 0) && - ((expression[len] == '\n') || (expression[len] == '\t') || - (expression[len] == '\r') || (expression[len] == ' '))) len--; - expression[len + 1] = 0; - if (len >= 0) { - if (expression[0] == '#') - continue; - if ((expression[0] == '=') && (expression[1] == '>')) { - char *pattern = &expression[2]; - - if (comp != NULL) { - xmlRegFreeRegexp(comp); - comp = NULL; - } - printf("Regexp: %s\n", pattern) ; - comp = xmlRegexpCompile((const xmlChar *) pattern); - if (comp == NULL) { - printf(" failed to compile\n"); - break; - } - } else if (comp == NULL) { - printf("Regexp: %s\n", expression) ; - comp = xmlRegexpCompile((const xmlChar *) expression); - if (comp == NULL) { - printf(" failed to compile\n"); - break; - } - } else if (comp != NULL) { - testRegexp(comp, expression); - } - } - } - fclose(input); - if (comp != NULL) - xmlRegFreeRegexp(comp); -} - -#ifdef LIBXML_EXPR_ENABLED -static void -runFileTest(xmlExpCtxtPtr ctxt, const char *filename) { - xmlExpNodePtr expr = NULL, sub; - FILE *input; - char expression[5000]; - int len; - - input = fopen(filename, "r"); - if (input == NULL) { - xmlGenericError(xmlGenericErrorContext, - "Cannot open %s for reading\n", filename); - return; - } - while (fgets(expression, 4500, input) != NULL) { - len = strlen(expression); - len--; - while ((len >= 0) && - ((expression[len] == '\n') || (expression[len] == '\t') || - (expression[len] == '\r') || (expression[len] == ' '))) len--; - expression[len + 1] = 0; - if (len >= 0) { - if (expression[0] == '#') - continue; - if ((expression[0] == '=') && (expression[1] == '>')) { - char *str = &expression[2]; - - if (expr != NULL) { - xmlExpFree(ctxt, expr); - if (xmlExpCtxtNbNodes(ctxt) != 0) - printf(" Parse/free of Expression leaked %d\n", - xmlExpCtxtNbNodes(ctxt)); - expr = NULL; - } - printf("Expression: %s\n", str) ; - expr = xmlExpParse(ctxt, str); - if (expr == NULL) { - printf(" parsing Failed\n"); - break; - } - } else if (expr != NULL) { - int expect = -1; - int nodes1, nodes2; - - if (expression[0] == '0') - expect = 0; - if (expression[0] == '1') - expect = 1; - printf("Subexp: %s", expression + 2) ; - nodes1 = xmlExpCtxtNbNodes(ctxt); - sub = xmlExpParse(ctxt, expression + 2); - if (sub == NULL) { - printf(" parsing Failed\n"); - break; - } else { - int ret; - - nodes2 = xmlExpCtxtNbNodes(ctxt); - ret = xmlExpSubsume(ctxt, expr, sub); - - if ((expect == 1) && (ret == 1)) { - printf(" => accept, Ok\n"); - } else if ((expect == 0) && (ret == 0)) { - printf(" => reject, Ok\n"); - } else if ((expect == 1) && (ret == 0)) { - printf(" => reject, Failed\n"); - } else if ((expect == 0) && (ret == 1)) { - printf(" => accept, Failed\n"); - } else { - printf(" => fail internally\n"); - } - if (xmlExpCtxtNbNodes(ctxt) > nodes2) { - printf(" Subsume leaked %d\n", - xmlExpCtxtNbNodes(ctxt) - nodes2); - nodes1 += xmlExpCtxtNbNodes(ctxt) - nodes2; - } - xmlExpFree(ctxt, sub); - if (xmlExpCtxtNbNodes(ctxt) > nodes1) { - printf(" Parse/free leaked %d\n", - xmlExpCtxtNbNodes(ctxt) - nodes1); - } - } - - } - } - } - if (expr != NULL) { - xmlExpFree(ctxt, expr); - if (xmlExpCtxtNbNodes(ctxt) != 0) - printf(" Parse/free of Expression leaked %d\n", - xmlExpCtxtNbNodes(ctxt)); - } - fclose(input); -} - -static void -testReduce(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr, const char *tst) { - xmlBufferPtr xmlExpBuf; - xmlExpNodePtr sub, deriv; - xmlExpBuf = xmlBufferCreate(); - - sub = xmlExpParse(ctxt, tst); - if (sub == NULL) { - printf("Subset %s failed to parse\n", tst); - return; - } - xmlExpDump(xmlExpBuf, sub); - printf("Subset parsed as: %s\n", - (const char *) xmlBufferContent(xmlExpBuf)); - deriv = xmlExpExpDerive(ctxt, expr, sub); - if (deriv == NULL) { - printf("Derivation led to an internal error, report this !\n"); - return; - } else { - xmlBufferEmpty(xmlExpBuf); - xmlExpDump(xmlExpBuf, deriv); - if (xmlExpIsNillable(deriv)) - printf("Resulting nillable derivation: %s\n", - (const char *) xmlBufferContent(xmlExpBuf)); - else - printf("Resulting derivation: %s\n", - (const char *) xmlBufferContent(xmlExpBuf)); - xmlExpFree(ctxt, deriv); - } - xmlExpFree(ctxt, sub); -} - -static void -exprDebug(xmlExpCtxtPtr ctxt, xmlExpNodePtr expr) { - xmlBufferPtr xmlExpBuf; - xmlExpNodePtr deriv; - const char *list[40]; - int ret; - - xmlExpBuf = xmlBufferCreate(); - - if (expr == NULL) { - printf("Failed to parse\n"); - return; - } - xmlExpDump(xmlExpBuf, expr); - printf("Parsed as: %s\n", (const char *) xmlBufferContent(xmlExpBuf)); - printf("Max token input = %d\n", xmlExpMaxToken(expr)); - if (xmlExpIsNillable(expr) == 1) - printf("Is nillable\n"); - ret = xmlExpGetLanguage(ctxt, expr, (const xmlChar **) &list[0], 40); - if (ret < 0) - printf("Failed to get list: %d\n", ret); - else { - int i; - - printf("Language has %d strings, testing string derivations\n", ret); - for (i = 0;i < ret;i++) { - deriv = xmlExpStringDerive(ctxt, expr, BAD_CAST list[i], -1); - if (deriv == NULL) { - printf(" %s -> derivation failed\n", list[i]); - } else { - xmlBufferEmpty(xmlExpBuf); - xmlExpDump(xmlExpBuf, deriv); - printf(" %s -> %s\n", list[i], - (const char *) xmlBufferContent(xmlExpBuf)); - } - xmlExpFree(ctxt, deriv); - } - } - xmlBufferFree(xmlExpBuf); -} -#endif - -static void usage(const char *name) { - fprintf(stderr, "Usage: %s [flags]\n", name); - fprintf(stderr, "Testing tool for libxml2 string and pattern regexps\n"); - fprintf(stderr, " --debug: switch on debugging\n"); - fprintf(stderr, " --repeat: loop on the operation\n"); -#ifdef LIBXML_EXPR_ENABLED - fprintf(stderr, " --expr: test xmlExp and not xmlRegexp\n"); -#endif - fprintf(stderr, " --input filename: use the given filename for regexp\n"); - fprintf(stderr, " --input filename: use the given filename for exp\n"); -} - -int main(int argc, char **argv) { - xmlRegexpPtr comp = NULL; -#ifdef LIBXML_EXPR_ENABLED - xmlExpNodePtr expr = NULL; - int use_exp = 0; - xmlExpCtxtPtr ctxt = NULL; -#endif - const char *pattern = NULL; - char *filename = NULL; - int i; - - xmlInitMemory(); - - if (argc <= 1) { - usage(argv[0]); - return(1); - } - for (i = 1; i < argc ; i++) { - if (!strcmp(argv[i], "-")) - break; - - if (argv[i][0] != '-') - continue; - if (!strcmp(argv[i], "--")) - break; - - if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) { - debug++; - } else if ((!strcmp(argv[i], "-repeat")) || - (!strcmp(argv[i], "--repeat"))) { - repeat++; -#ifdef LIBXML_EXPR_ENABLED - } else if ((!strcmp(argv[i], "-expr")) || - (!strcmp(argv[i], "--expr"))) { - use_exp++; -#endif - } else if ((!strcmp(argv[i], "-i")) || (!strcmp(argv[i], "-f")) || - (!strcmp(argv[i], "--input"))) - filename = argv[++i]; - else { - fprintf(stderr, "Unknown option %s\n", argv[i]); - usage(argv[0]); - } - } - -#ifdef LIBXML_EXPR_ENABLED - if (use_exp) - ctxt = xmlExpNewCtxt(0, NULL); -#endif - - if (filename != NULL) { -#ifdef LIBXML_EXPR_ENABLED - if (use_exp) - runFileTest(ctxt, filename); - else -#endif - testRegexpFile(filename); - } else { - int data = 0; -#ifdef LIBXML_EXPR_ENABLED - - if (use_exp) { - for (i = 1; i < argc ; i++) { - if (strcmp(argv[i], "--") == 0) - data = 1; - else if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0) || - (data == 1)) { - if (pattern == NULL) { - pattern = argv[i]; - printf("Testing expr %s:\n", pattern); - expr = xmlExpParse(ctxt, pattern); - if (expr == NULL) { - printf(" failed to compile\n"); - break; - } - if (debug) { - exprDebug(ctxt, expr); - } - } else { - testReduce(ctxt, expr, argv[i]); - } - } - } - if (expr != NULL) { - xmlExpFree(ctxt, expr); - expr = NULL; - } - } else -#endif - { - for (i = 1; i < argc ; i++) { - if (strcmp(argv[i], "--") == 0) - data = 1; - else if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0) || - (data == 1)) { - if (pattern == NULL) { - pattern = argv[i]; - printf("Testing %s:\n", pattern); - comp = xmlRegexpCompile((const xmlChar *) pattern); - if (comp == NULL) { - printf(" failed to compile\n"); - break; - } - if (debug) - xmlRegexpPrint(stdout, comp); - } else { - testRegexp(comp, argv[i]); - } - } - } - if (comp != NULL) - xmlRegFreeRegexp(comp); - } - } -#ifdef LIBXML_EXPR_ENABLED - if (ctxt != NULL) { - printf("Ops: %d nodes, %d cons\n", - xmlExpCtxtNbNodes(ctxt), xmlExpCtxtNbCons(ctxt)); - xmlExpFreeCtxt(ctxt); - } -#endif - xmlCleanupParser(); - xmlMemoryDump(); - return(0); -} - -#else -#include -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - printf("%s : Regexp support not compiled in\n", argv[0]); - return(0); -} -#endif /* LIBXML_REGEXP_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/testRelax.c b/reactos/lib/3rdparty/libxml2/testRelax.c deleted file mode 100644 index 8e94a7a8194..00000000000 --- a/reactos/lib/3rdparty/libxml2/testRelax.c +++ /dev/null @@ -1,194 +0,0 @@ -/* - * testRelax.c : a small tester program for RelaxNG validation - * - * See Copyright for the status of this software. - * - * Daniel.Veillard@w3.org - */ - -#include "libxml.h" -#ifdef LIBXML_SCHEMAS_ENABLED - -#include -#include - -#include -#include -#include - - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_SYS_MMAN_H -#include -/* seems needed for Solaris */ -#ifndef MAP_FAILED -#define MAP_FAILED ((void *) -1) -#endif -#endif - -#include -#include -#include - -#ifdef LIBXML_DEBUG_ENABLED -static int debug = 0; -#endif -static int noout = 0; -static int tree = 0; -#ifdef HAVE_MMAP -static int memory = 0; -#endif - - -int main(int argc, char **argv) { - int i; - int files = 0; - xmlRelaxNGPtr schema = NULL; - - for (i = 1; i < argc ; i++) { -#ifdef LIBXML_DEBUG_ENABLED - if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) - debug++; - else -#endif -#ifdef HAVE_MMAP - if ((!strcmp(argv[i], "-memory")) || (!strcmp(argv[i], "--memory"))) { - memory++; - } else -#endif - if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout"))) { - noout++; - } else - if ((!strcmp(argv[i], "-tree")) || (!strcmp(argv[i], "--tree"))) { - tree++; - } - } - xmlLineNumbersDefault(1); - xmlSubstituteEntitiesDefault(1); - for (i = 1; i < argc ; i++) { - if (argv[i][0] != '-') { - if (schema == NULL) { - xmlRelaxNGParserCtxtPtr ctxt; - -#ifdef HAVE_MMAP - if (memory) { - int fd; - struct stat info; - const char *base; - if (stat(argv[i], &info) < 0) - break; - if ((fd = open(argv[i], O_RDONLY)) < 0) - break; - base = mmap(NULL, info.st_size, PROT_READ, - MAP_SHARED, fd, 0) ; - if (base == (void *) MAP_FAILED) - break; - - ctxt = xmlRelaxNGNewMemParserCtxt((char *)base,info.st_size); - - xmlRelaxNGSetParserErrors(ctxt, - (xmlRelaxNGValidityErrorFunc) fprintf, - (xmlRelaxNGValidityWarningFunc) fprintf, - stderr); - schema = xmlRelaxNGParse(ctxt); - xmlRelaxNGFreeParserCtxt(ctxt); - munmap((char *) base, info.st_size); - } else -#endif - { - ctxt = xmlRelaxNGNewParserCtxt(argv[i]); - xmlRelaxNGSetParserErrors(ctxt, - (xmlRelaxNGValidityErrorFunc) fprintf, - (xmlRelaxNGValidityWarningFunc) fprintf, - stderr); - schema = xmlRelaxNGParse(ctxt); - xmlRelaxNGFreeParserCtxt(ctxt); - } - if (schema == NULL) { - printf("Relax-NG schema %s failed to compile\n", argv[i]); - files = -1; - break; - } -#ifdef LIBXML_OUTPUT_ENABLED -#ifdef LIBXML_DEBUG_ENABLED - if (debug) - xmlRelaxNGDump(stdout, schema); -#endif - if (tree) - xmlRelaxNGDumpTree(stdout, schema); -#endif /* LIBXML_OUTPUT_ENABLED */ - } else { - xmlDocPtr doc; - - doc = xmlReadFile(argv[i],NULL,0); - - if (doc == NULL) { - fprintf(stderr, "Could not parse %s\n", argv[i]); - } else { - xmlRelaxNGValidCtxtPtr ctxt; - int ret; - - ctxt = xmlRelaxNGNewValidCtxt(schema); - xmlRelaxNGSetValidErrors(ctxt, - (xmlRelaxNGValidityErrorFunc) fprintf, - (xmlRelaxNGValidityWarningFunc) fprintf, - stderr); - ret = xmlRelaxNGValidateDoc(ctxt, doc); - if (ret == 0) { - printf("%s validates\n", argv[i]); - } else if (ret > 0) { - printf("%s fails to validate\n", argv[i]); - } else { - printf("%s validation generated an internal error\n", - argv[i]); - } - xmlRelaxNGFreeValidCtxt(ctxt); - xmlFreeDoc(doc); - } - } - files ++; - } - } - if (schema != NULL) - xmlRelaxNGFree(schema); - if (files == 0) { - printf("Usage : %s [--debug] [--noout] schemas XMLfiles ...\n", - argv[0]); - printf("\tParse the HTML files and output the result of the parsing\n"); -#ifdef LIBXML_DEBUG_ENABLED - printf("\t--debug : dump a debug tree of the in-memory document\n"); -#endif - printf("\t--noout : do not print the result\n"); - printf("\t--tree : print the intermediate Relax-NG document tree\n"); -#ifdef HAVE_MMAP - printf("\t--memory : test the schemas in memory parsing\n"); -#endif - } - xmlRelaxNGCleanupTypes(); - xmlCleanupParser(); - xmlMemoryDump(); - - return(0); -} - -#else -#include -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - printf("%s : RelaxNG support not compiled in\n", argv[0]); - return(0); -} -#endif /* LIBXML_SCHEMAS_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/testSAX.c b/reactos/lib/3rdparty/libxml2/testSAX.c deleted file mode 100644 index 81c4b93d62e..00000000000 --- a/reactos/lib/3rdparty/libxml2/testSAX.c +++ /dev/null @@ -1,1198 +0,0 @@ -/* - * testSAX.c : a small tester program for parsing using the SAX API. - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#include "libxml.h" - -#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_TIMEB_H -#include -#endif -#ifdef HAVE_TIME_H -#include -#endif - -#ifdef LIBXML_SAX1_ENABLED -#include -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_STRING_H -#include -#endif - - -#include -#include -#include -#include /* only for xmlNewInputFromFile() */ -#include -#include -#include - -static int debug = 0; -static int copy = 0; -static int recovery = 0; -static int push = 0; -static int speed = 0; -static int noent = 0; -static int quiet = 0; -static int nonull = 0; -static int sax2 = 0; -static int repeat = 0; -static int callbacks = 0; -static int timing = 0; - -/* - * Timing routines. - */ -/* - * Internal timing routines to remove the necessity to have unix-specific - * function calls - */ - -#ifndef HAVE_GETTIMEOFDAY -#ifdef HAVE_SYS_TIMEB_H -#ifdef HAVE_SYS_TIME_H -#ifdef HAVE_FTIME - -static int -my_gettimeofday(struct timeval *tvp, void *tzp) -{ - struct timeb timebuffer; - - ftime(&timebuffer); - if (tvp) { - tvp->tv_sec = timebuffer.time; - tvp->tv_usec = timebuffer.millitm * 1000L; - } - return (0); -} -#define HAVE_GETTIMEOFDAY 1 -#define gettimeofday my_gettimeofday - -#endif /* HAVE_FTIME */ -#endif /* HAVE_SYS_TIME_H */ -#endif /* HAVE_SYS_TIMEB_H */ -#endif /* !HAVE_GETTIMEOFDAY */ - -#if defined(HAVE_GETTIMEOFDAY) -static struct timeval begin, end; - -/* - * startTimer: call where you want to start timing - */ -static void -startTimer(void) -{ - gettimeofday(&begin, NULL); -} - -/* - * endTimer: call where you want to stop timing and to print out a - * message about the timing performed; format is a printf - * type argument - */ -static void XMLCDECL -endTimer(const char *fmt, ...) -{ - long msec; - va_list ap; - - gettimeofday(&end, NULL); - msec = end.tv_sec - begin.tv_sec; - msec *= 1000; - msec += (end.tv_usec - begin.tv_usec) / 1000; - -#ifndef HAVE_STDARG_H -#error "endTimer required stdarg functions" -#endif - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - - fprintf(stderr, " took %ld ms\n", msec); -} -#elif defined(HAVE_TIME_H) -/* - * No gettimeofday function, so we have to make do with calling clock. - * This is obviously less accurate, but there's little we can do about - * that. - */ -#ifndef CLOCKS_PER_SEC -#define CLOCKS_PER_SEC 100 -#endif - -static clock_t begin, end; -static void -startTimer(void) -{ - begin = clock(); -} -static void XMLCDECL -endTimer(const char *fmt, ...) -{ - long msec; - va_list ap; - - end = clock(); - msec = ((end - begin) * 1000) / CLOCKS_PER_SEC; - -#ifndef HAVE_STDARG_H -#error "endTimer required stdarg functions" -#endif - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - fprintf(stderr, " took %ld ms\n", msec); -} -#else - -/* - * We don't have a gettimeofday or time.h, so we just don't do timing - */ -static void -startTimer(void) -{ - /* - * Do nothing - */ -} -static void XMLCDECL -endTimer(char *format, ...) -{ - /* - * We cannot do anything because we don't have a timing function - */ -#ifdef HAVE_STDARG_H - va_start(ap, format); - vfprintf(stderr, format, ap); - va_end(ap); - fprintf(stderr, " was not timed\n", msec); -#else - /* We don't have gettimeofday, time or stdarg.h, what crazy world is - * this ?! - */ -#endif -} -#endif - -/* - * empty SAX block - */ -static xmlSAXHandler emptySAXHandlerStruct = { - NULL, /* internalSubset */ - NULL, /* isStandalone */ - NULL, /* hasInternalSubset */ - NULL, /* hasExternalSubset */ - NULL, /* resolveEntity */ - NULL, /* getEntity */ - NULL, /* entityDecl */ - NULL, /* notationDecl */ - NULL, /* attributeDecl */ - NULL, /* elementDecl */ - NULL, /* unparsedEntityDecl */ - NULL, /* setDocumentLocator */ - NULL, /* startDocument */ - NULL, /* endDocument */ - NULL, /* startElement */ - NULL, /* endElement */ - NULL, /* reference */ - NULL, /* characters */ - NULL, /* ignorableWhitespace */ - NULL, /* processingInstruction */ - NULL, /* comment */ - NULL, /* xmlParserWarning */ - NULL, /* xmlParserError */ - NULL, /* xmlParserError */ - NULL, /* getParameterEntity */ - NULL, /* cdataBlock; */ - NULL, /* externalSubset; */ - 1, - NULL, - NULL, /* startElementNs */ - NULL, /* endElementNs */ - NULL /* xmlStructuredErrorFunc */ -}; - -static xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct; -extern xmlSAXHandlerPtr debugSAXHandler; - -/************************************************************************ - * * - * Debug Handlers * - * * - ************************************************************************/ - -/** - * isStandaloneDebug: - * @ctxt: An XML parser context - * - * Is this document tagged standalone ? - * - * Returns 1 if true - */ -static int -isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return(0); - fprintf(stdout, "SAX.isStandalone()\n"); - return(0); -} - -/** - * hasInternalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an internal subset - * - * Returns 1 if true - */ -static int -hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return(0); - fprintf(stdout, "SAX.hasInternalSubset()\n"); - return(0); -} - -/** - * hasExternalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an external subset - * - * Returns 1 if true - */ -static int -hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return(0); - fprintf(stdout, "SAX.hasExternalSubset()\n"); - return(0); -} - -/** - * internalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an internal subset - */ -static void -internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *ExternalID, const xmlChar *SystemID) -{ - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.internalSubset(%s,", name); - if (ExternalID == NULL) - fprintf(stdout, " ,"); - else - fprintf(stdout, " %s,", ExternalID); - if (SystemID == NULL) - fprintf(stdout, " )\n"); - else - fprintf(stdout, " %s)\n", SystemID); -} - -/** - * externalSubsetDebug: - * @ctxt: An XML parser context - * - * Does this document has an external subset - */ -static void -externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *ExternalID, const xmlChar *SystemID) -{ - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.externalSubset(%s,", name); - if (ExternalID == NULL) - fprintf(stdout, " ,"); - else - fprintf(stdout, " %s,", ExternalID); - if (SystemID == NULL) - fprintf(stdout, " )\n"); - else - fprintf(stdout, " %s)\n", SystemID); -} - -/** - * resolveEntityDebug: - * @ctxt: An XML parser context - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * - * Special entity resolver, better left to the parser, it has - * more context than the application layer. - * The default behaviour is to NOT resolve the entities, in that case - * the ENTITY_REF nodes are built in the structure (and the parameter - * values). - * - * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. - */ -static xmlParserInputPtr -resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId) -{ - callbacks++; - if (quiet) - return(NULL); - /* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */ - - - fprintf(stdout, "SAX.resolveEntity("); - if (publicId != NULL) - fprintf(stdout, "%s", (char *)publicId); - else - fprintf(stdout, " "); - if (systemId != NULL) - fprintf(stdout, ", %s)\n", (char *)systemId); - else - fprintf(stdout, ", )\n"); -/********* - if (systemId != NULL) { - return(xmlNewInputFromFile(ctxt, (char *) systemId)); - } - *********/ - return(NULL); -} - -/** - * getEntityDebug: - * @ctxt: An XML parser context - * @name: The entity name - * - * Get an entity by name - * - * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. - */ -static xmlEntityPtr -getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) -{ - callbacks++; - if (quiet) - return(NULL); - fprintf(stdout, "SAX.getEntity(%s)\n", name); - return(NULL); -} - -/** - * getParameterEntityDebug: - * @ctxt: An XML parser context - * @name: The entity name - * - * Get a parameter entity by name - * - * Returns the xmlParserInputPtr - */ -static xmlEntityPtr -getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) -{ - callbacks++; - if (quiet) - return(NULL); - fprintf(stdout, "SAX.getParameterEntity(%s)\n", name); - return(NULL); -} - - -/** - * entityDeclDebug: - * @ctxt: An XML parser context - * @name: the entity name - * @type: the entity type - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * @content: the entity value (without processing). - * - * An entity definition has been parsed - */ -static void -entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type, - const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) -{ -const xmlChar *nullstr = BAD_CAST "(null)"; - /* not all libraries handle printing null pointers nicely */ - if (publicId == NULL) - publicId = nullstr; - if (systemId == NULL) - systemId = nullstr; - if (content == NULL) - content = (xmlChar *)nullstr; - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n", - name, type, publicId, systemId, content); -} - -/** - * attributeDeclDebug: - * @ctxt: An XML parser context - * @name: the attribute name - * @type: the attribute type - * - * An attribute definition has been parsed - */ -static void -attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem, - const xmlChar * name, int type, int def, - const xmlChar * defaultValue, xmlEnumerationPtr tree) -{ - callbacks++; - if (quiet) - return; - if (defaultValue == NULL) - fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, NULL, ...)\n", - elem, name, type, def); - else - fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n", - elem, name, type, def, defaultValue); - xmlFreeEnumeration(tree); -} - -/** - * elementDeclDebug: - * @ctxt: An XML parser context - * @name: the element name - * @type: the element type - * @content: the element value (without processing). - * - * An element definition has been parsed - */ -static void -elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type, - xmlElementContentPtr content ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n", - name, type); -} - -/** - * notationDeclDebug: - * @ctxt: An XML parser context - * @name: The name of the notation - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * - * What to do when a notation declaration has been parsed. - */ -static void -notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *publicId, const xmlChar *systemId) -{ - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n", - (char *) name, (char *) publicId, (char *) systemId); -} - -/** - * unparsedEntityDeclDebug: - * @ctxt: An XML parser context - * @name: The name of the entity - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * @notationName: the name of the notation - * - * What to do when an unparsed entity declaration is parsed - */ -static void -unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, - const xmlChar *publicId, const xmlChar *systemId, - const xmlChar *notationName) -{ -const xmlChar *nullstr = BAD_CAST "(null)"; - - if (publicId == NULL) - publicId = nullstr; - if (systemId == NULL) - systemId = nullstr; - if (notationName == NULL) - notationName = nullstr; - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n", - (char *) name, (char *) publicId, (char *) systemId, - (char *) notationName); -} - -/** - * setDocumentLocatorDebug: - * @ctxt: An XML parser context - * @loc: A SAX Locator - * - * Receive the document locator at startup, actually xmlDefaultSAXLocator - * Everything is available on the context, so this is useless in our case. - */ -static void -setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.setDocumentLocator()\n"); -} - -/** - * startDocumentDebug: - * @ctxt: An XML parser context - * - * called when the document start being processed. - */ -static void -startDocumentDebug(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.startDocument()\n"); -} - -/** - * endDocumentDebug: - * @ctxt: An XML parser context - * - * called when the document end has been detected. - */ -static void -endDocumentDebug(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.endDocument()\n"); -} - -/** - * startElementDebug: - * @ctxt: An XML parser context - * @name: The element name - * - * called when an opening tag has been processed. - */ -static void -startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts) -{ - int i; - - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.startElement(%s", (char *) name); - if (atts != NULL) { - for (i = 0;(atts[i] != NULL);i++) { - fprintf(stdout, ", %s='", atts[i++]); - if (atts[i] != NULL) - fprintf(stdout, "%s'", atts[i]); - } - } - fprintf(stdout, ")\n"); -} - -/** - * endElementDebug: - * @ctxt: An XML parser context - * @name: The element name - * - * called when the end of an element has been detected. - */ -static void -endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name) -{ - callbacks++; - if (quiet) - return; - fprintf(stdout, "SAX.endElement(%s)\n", (char *) name); -} - -/** - * charactersDebug: - * @ctxt: An XML parser context - * @ch: a xmlChar string - * @len: the number of xmlChar - * - * receiving some chars from the parser. - * Question: how much at a time ??? - */ -static void -charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len) -{ - char output[40]; - int i; - - callbacks++; - if (quiet) - return; - for (i = 0;(i 0) { - ctxt = xmlCreatePushParserCtxt(emptySAXHandler, NULL, - chars, ret, filename); - while ((ret = fread(chars, 1, 3, f)) > 0) { - xmlParseChunk(ctxt, chars, ret, 0); - } - xmlParseChunk(ctxt, chars, 0, 1); - xmlFreeParserCtxt(ctxt); - } - fclose(f); - } else { - xmlGenericError(xmlGenericErrorContext, - "Cannot read file %s\n", filename); - } - } - /* - * Debug callback - */ -#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) - f = fopen(filename, "rb"); -#else - f = fopen(filename, "r"); -#endif - if (f != NULL) { - int ret; - char chars[10]; - xmlParserCtxtPtr ctxt; - - ret = fread(chars, 1, 4, f); - if (ret > 0) { - if (sax2) - ctxt = xmlCreatePushParserCtxt(debugSAX2Handler, NULL, - chars, ret, filename); - else - ctxt = xmlCreatePushParserCtxt(debugSAXHandler, NULL, - chars, ret, filename); - while ((ret = fread(chars, 1, 3, f)) > 0) { - xmlParseChunk(ctxt, chars, ret, 0); - } - ret = xmlParseChunk(ctxt, chars, 0, 1); - xmlFreeParserCtxt(ctxt); - if (ret != 0) { - fprintf(stdout, - "xmlSAXUserParseFile returned error %d\n", ret); - } - } - fclose(f); - } - } else { -#endif /* LIBXML_PUSH_ENABLED */ - if (!speed) { - /* - * Empty callbacks for checking - */ - if ((!quiet) && (!nonull)) { - res = xmlSAXUserParseFile(emptySAXHandler, NULL, filename); - if (res != 0) { - fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res); - } - } - - /* - * Debug callback - */ - callbacks = 0; - if (repeat) { - int i; - for (i = 0;i < 99;i++) { - if (sax2) - res = xmlSAXUserParseFile(debugSAX2Handler, NULL, - filename); - else - res = xmlSAXUserParseFile(debugSAXHandler, NULL, - filename); - } - } - if (sax2) - res = xmlSAXUserParseFile(debugSAX2Handler, NULL, filename); - else - res = xmlSAXUserParseFile(debugSAXHandler, NULL, filename); - if (res != 0) { - fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res); - } - if (quiet) - fprintf(stdout, "%d callbacks generated\n", callbacks); - } else { - /* - * test 100x the SAX parse - */ - int i; - - for (i = 0; i<100;i++) - res = xmlSAXUserParseFile(emptySAXHandler, NULL, filename); - if (res != 0) { - fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res); - } - } -#ifdef LIBXML_PUSH_ENABLED - } -#endif -} - - -int main(int argc, char **argv) { - int i; - int files = 0; - - LIBXML_TEST_VERSION /* be safe, plus calls xmlInitParser */ - - for (i = 1; i < argc ; i++) { - if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) - debug++; - else if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy"))) - copy++; - else if ((!strcmp(argv[i], "-recover")) || - (!strcmp(argv[i], "--recover"))) - recovery++; - else if ((!strcmp(argv[i], "-push")) || - (!strcmp(argv[i], "--push"))) -#ifdef LIBXML_PUSH_ENABLED - push++; -#else - fprintf(stderr,"'push' not enabled in library - ignoring\n"); -#endif /* LIBXML_PUSH_ENABLED */ - else if ((!strcmp(argv[i], "-speed")) || - (!strcmp(argv[i], "--speed"))) - speed++; - else if ((!strcmp(argv[i], "-timing")) || - (!strcmp(argv[i], "--timing"))) { - nonull++; - timing++; - quiet++; - } else if ((!strcmp(argv[i], "-repeat")) || - (!strcmp(argv[i], "--repeat"))) { - repeat++; - quiet++; - } else if ((!strcmp(argv[i], "-noent")) || - (!strcmp(argv[i], "--noent"))) - noent++; - else if ((!strcmp(argv[i], "-quiet")) || - (!strcmp(argv[i], "--quiet"))) - quiet++; - else if ((!strcmp(argv[i], "-sax2")) || - (!strcmp(argv[i], "--sax2"))) - sax2++; - else if ((!strcmp(argv[i], "-nonull")) || - (!strcmp(argv[i], "--nonull"))) - nonull++; - } - if (noent != 0) xmlSubstituteEntitiesDefault(1); - for (i = 1; i < argc ; i++) { - if (argv[i][0] != '-') { - if (timing) { - startTimer(); - } - parseAndPrintFile(argv[i]); - if (timing) { - endTimer("Parsing"); - } - files ++; - } - } - xmlCleanupParser(); - xmlMemoryDump(); - - return(0); -} -#else -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - printf("%s : SAX1 parsing support not compiled in\n", argv[0]); - return(0); -} -#endif /* LIBXML_SAX1_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/testSchemas.c b/reactos/lib/3rdparty/libxml2/testSchemas.c deleted file mode 100644 index b98e6313e43..00000000000 --- a/reactos/lib/3rdparty/libxml2/testSchemas.c +++ /dev/null @@ -1,185 +0,0 @@ -/* - * testSchemas.c : a small tester program for Schema validation - * - * See Copyright for the status of this software. - * - * Daniel.Veillard@w3.org - */ - -#include "libxml.h" -#ifdef LIBXML_SCHEMAS_ENABLED - -#include -#include - -#include -#include -#include - - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif -#ifdef HAVE_SYS_MMAN_H -#include -/* seems needed for Solaris */ -#ifndef MAP_FAILED -#define MAP_FAILED ((void *) -1) -#endif -#endif - -#include -#include -#include -#include - -#ifdef LIBXML_DEBUG_ENABLED -static int debug = 0; -#endif -static int noout = 0; -#ifdef HAVE_MMAP -static int memory = 0; -#endif - - -int main(int argc, char **argv) { - int i; - int files = 0; - xmlSchemaPtr schema = NULL; - - for (i = 1; i < argc ; i++) { -#ifdef LIBXML_DEBUG_ENABLED - if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) - debug++; - else -#endif -#ifdef HAVE_MMAP - if ((!strcmp(argv[i], "-memory")) || (!strcmp(argv[i], "--memory"))) { - memory++; - } else -#endif - if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout"))) { - noout++; - } - } - xmlLineNumbersDefault(1); - for (i = 1; i < argc ; i++) { - if (argv[i][0] != '-') { - if (schema == NULL) { - xmlSchemaParserCtxtPtr ctxt; - -#ifdef HAVE_MMAP - if (memory) { - int fd; - struct stat info; - const char *base; - if (stat(argv[i], &info) < 0) - break; - if ((fd = open(argv[i], O_RDONLY)) < 0) - break; - base = mmap(NULL, info.st_size, PROT_READ, - MAP_SHARED, fd, 0) ; - if (base == (void *) MAP_FAILED) - break; - - ctxt = xmlSchemaNewMemParserCtxt((char *)base,info.st_size); - - xmlSchemaSetParserErrors(ctxt, - (xmlSchemaValidityErrorFunc) fprintf, - (xmlSchemaValidityWarningFunc) fprintf, - stderr); - schema = xmlSchemaParse(ctxt); - xmlSchemaFreeParserCtxt(ctxt); - munmap((char *) base, info.st_size); - } else -#endif - { - ctxt = xmlSchemaNewParserCtxt(argv[i]); - xmlSchemaSetParserErrors(ctxt, - (xmlSchemaValidityErrorFunc) fprintf, - (xmlSchemaValidityWarningFunc) fprintf, - stderr); - schema = xmlSchemaParse(ctxt); - xmlSchemaFreeParserCtxt(ctxt); - } -#ifdef LIBXML_OUTPUT_ENABLED -#ifdef LIBXML_DEBUG_ENABLED - if (debug) - xmlSchemaDump(stdout, schema); -#endif -#endif /* LIBXML_OUTPUT_ENABLED */ - if (schema == NULL) - goto failed_schemas; - } else { - xmlDocPtr doc; - - doc = xmlReadFile(argv[i],NULL,0); - - if (doc == NULL) { - fprintf(stderr, "Could not parse %s\n", argv[i]); - } else { - xmlSchemaValidCtxtPtr ctxt; - int ret; - - ctxt = xmlSchemaNewValidCtxt(schema); - xmlSchemaSetValidErrors(ctxt, - (xmlSchemaValidityErrorFunc) fprintf, - (xmlSchemaValidityWarningFunc) fprintf, - stderr); - ret = xmlSchemaValidateDoc(ctxt, doc); - if (ret == 0) { - printf("%s validates\n", argv[i]); - } else if (ret > 0) { - printf("%s fails to validate\n", argv[i]); - } else { - printf("%s validation generated an internal error\n", - argv[i]); - } - xmlSchemaFreeValidCtxt(ctxt); - xmlFreeDoc(doc); - } - } - files ++; - } - } - if (schema != NULL) - xmlSchemaFree(schema); - if (files == 0) { - printf("Usage : %s [--debug] [--noout] schemas XMLfiles ...\n", - argv[0]); - printf("\tParse the HTML files and output the result of the parsing\n"); -#ifdef LIBXML_DEBUG_ENABLED - printf("\t--debug : dump a debug tree of the in-memory document\n"); -#endif - printf("\t--noout : do not print the result\n"); -#ifdef HAVE_MMAP - printf("\t--memory : test the schemas in memory parsing\n"); -#endif - } -failed_schemas: - xmlSchemaCleanupTypes(); - xmlCleanupParser(); - xmlMemoryDump(); - - return(0); -} - -#else -#include -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - printf("%s : Schemas support not compiled in\n", argv[0]); - return(0); -} -#endif /* LIBXML_SCHEMAS_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/testThreads.c b/reactos/lib/3rdparty/libxml2/testThreads.c deleted file mode 100644 index bff53912ecb..00000000000 --- a/reactos/lib/3rdparty/libxml2/testThreads.c +++ /dev/null @@ -1,200 +0,0 @@ -#include "libxml.h" - -#include -#include - -#if defined(LIBXML_THREAD_ENABLED) && defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_SAX1_ENABLED) -#include -#include -#include -#include -#ifdef HAVE_PTHREAD_H -#include -#elif defined HAVE_BEOS_THREADS -#include -#endif -#include -#if !defined(_MSC_VER) -#include -#endif -#include - -#define MAX_ARGC 20 -#ifdef HAVE_PTHREAD_H -static pthread_t tid[MAX_ARGC]; -#elif defined HAVE_BEOS_THREADS -static thread_id tid[MAX_ARGC]; -#endif - -static const char *catalog = "test/threads/complex.xml"; -static const char *testfiles[] = { - "test/threads/abc.xml", - "test/threads/acb.xml", - "test/threads/bac.xml", - "test/threads/bca.xml", - "test/threads/cab.xml", - "test/threads/cba.xml", - "test/threads/invalid.xml", -}; - -static const char *Okay = "OK"; -static const char *Failed = "Failed"; - -#ifndef xmlDoValidityCheckingDefaultValue -#error xmlDoValidityCheckingDefaultValue is not a macro -#endif -#ifndef xmlGenericErrorContext -#error xmlGenericErrorContext is not a macro -#endif - -static void * -thread_specific_data(void *private_data) -{ - xmlDocPtr myDoc; - const char *filename = (const char *) private_data; - int okay = 1; - - if (!strcmp(filename, "test/threads/invalid.xml")) { - xmlDoValidityCheckingDefaultValue = 0; - xmlGenericErrorContext = stdout; - } else { - xmlDoValidityCheckingDefaultValue = 1; - xmlGenericErrorContext = stderr; - } - myDoc = xmlParseFile(filename); - if (myDoc) { - xmlFreeDoc(myDoc); - } else { - printf("parse failed\n"); - okay = 0; - } - if (!strcmp(filename, "test/threads/invalid.xml")) { - if (xmlDoValidityCheckingDefaultValue != 0) { - printf("ValidityCheckingDefaultValue override failed\n"); - okay = 0; - } - if (xmlGenericErrorContext != stdout) { - printf("xmlGenericErrorContext override failed\n"); - okay = 0; - } - } else { - if (xmlDoValidityCheckingDefaultValue != 1) { - printf("ValidityCheckingDefaultValue override failed\n"); - okay = 0; - } - if (xmlGenericErrorContext != stderr) { - printf("xmlGenericErrorContext override failed\n"); - okay = 0; - } - } - if (okay == 0) - return((void *) Failed); - return ((void *) Okay); -} - -#ifdef HAVE_PTHREAD_H -int -main(void) -{ - unsigned int i, repeat; - unsigned int num_threads = sizeof(testfiles) / sizeof(testfiles[0]); - void *results[MAX_ARGC]; - int ret; - - xmlInitParser(); - for (repeat = 0;repeat < 500;repeat++) { - xmlLoadCatalog(catalog); - - memset(results, 0, sizeof(*results)*num_threads); - memset(tid, 0xff, sizeof(*tid)*num_threads); - - for (i = 0; i < num_threads; i++) { - ret = pthread_create(&tid[i], NULL, thread_specific_data, - (void *) testfiles[i]); - if (ret != 0) { - perror("pthread_create"); - exit(1); - } - } - for (i = 0; i < num_threads; i++) { - ret = pthread_join(tid[i], &results[i]); - if (ret != 0) { - perror("pthread_join"); - exit(1); - } - } - - xmlCatalogCleanup(); - for (i = 0; i < num_threads; i++) - if (results[i] != (void *) Okay) - printf("Thread %d handling %s failed\n", i, testfiles[i]); - } - xmlCleanupParser(); - xmlMemoryDump(); - return (0); -} -#elif defined HAVE_BEOS_THREADS -int -main(void) -{ - unsigned int i, repeat; - unsigned int num_threads = sizeof(testfiles) / sizeof(testfiles[0]); - void *results[MAX_ARGC]; - status_t ret; - - xmlInitParser(); - printf("Parser initialized\n"); - for (repeat = 0;repeat < 500;repeat++) { - printf("repeat: %d\n",repeat); - xmlLoadCatalog(catalog); - printf("loaded catalog: %s\n", catalog); - for (i = 0; i < num_threads; i++) { - results[i] = NULL; - tid[i] = (thread_id) -1; - } - printf("cleaned threads\n"); - for (i = 0; i < num_threads; i++) { - tid[i] = spawn_thread(thread_specific_data, "xmlTestThread", B_NORMAL_PRIORITY, (void *) testfiles[i]); - if (tid[i] < B_OK) { - perror("beos_thread_create"); - exit(1); - } - printf("beos_thread_create %d -> %d\n", i, tid[i]); - } - for (i = 0; i < num_threads; i++) { - ret = wait_for_thread(tid[i], &results[i]); - printf("beos_thread_wait %d -> %d\n", i, ret); - if (ret != B_OK) { - perror("beos_thread_wait"); - exit(1); - } - } - - xmlCatalogCleanup(); - ret = B_OK; - for (i = 0; i < num_threads; i++) - if (results[i] != (void *) Okay) { - printf("Thread %d handling %s failed\n", i, testfiles[i]); - ret = B_ERROR; - } - } - xmlCleanupParser(); - xmlMemoryDump(); - - if (ret == B_OK) - printf("testThread : BeOS : SUCCESS!\n"); - else - printf("testThread : BeOS : FAILED!\n"); - - return (0); -} -#endif /* pthreads or BeOS threads */ - -#else /* !LIBXML_THREADS_ENABLED */ -int -main(void) -{ - fprintf(stderr, "libxml was not compiled with thread or catalog support\n"); - return (0); -} -#endif diff --git a/reactos/lib/3rdparty/libxml2/testThreadsWin32.c b/reactos/lib/3rdparty/libxml2/testThreadsWin32.c deleted file mode 100644 index 3d1a5ba23ad..00000000000 --- a/reactos/lib/3rdparty/libxml2/testThreadsWin32.c +++ /dev/null @@ -1,150 +0,0 @@ -#include "libxml.h" -#include -#include - -#if defined(LIBXML_THREAD_ENABLED) && defined(LIBXML_CATALOG_ENABLED) -#include -#include -#include -#include -#include -#include -#include - -#define MAX_ARGC 20 -#define TEST_REPEAT_COUNT 500 - -static HANDLE tid[MAX_ARGC]; - -static const char *catalog = "test/threads/complex.xml"; -static char *testfiles[] = { - "test/threads/abc.xml", - "test/threads/acb.xml", - "test/threads/bac.xml", - "test/threads/bca.xml", - "test/threads/cab.xml", - "test/threads/cba.xml", - "test/threads/invalid.xml", -}; - -const char *Okay = "OK"; -const char *Failed = "Failed"; - -#ifndef xmlDoValidityCheckingDefaultValue -#error xmlDoValidityCheckingDefaultValue is not a macro -#endif -#ifndef xmlGenericErrorContext -#error xmlGenericErrorContext is not a macro -#endif - -static DWORD WINAPI -thread_specific_data(void *private_data) -{ - xmlDocPtr myDoc; - const char *filename = (const char *) private_data; - int okay = 1; - - if (!strcmp(filename, "test/threads/invalid.xml")) { - xmlDoValidityCheckingDefaultValue = 0; - xmlGenericErrorContext = stdout; - } else { - xmlDoValidityCheckingDefaultValue = 1; - xmlGenericErrorContext = stderr; - } - myDoc = xmlParseFile(filename); - if (myDoc) { - xmlFreeDoc(myDoc); - } else { - printf("parse failed\n"); - okay = 0; - } - if (!strcmp(filename, "test/threads/invalid.xml")) { - if (xmlDoValidityCheckingDefaultValue != 0) { - printf("ValidityCheckingDefaultValue override failed\n"); - okay = 0; - } - if (xmlGenericErrorContext != stdout) { - printf("xmlGenericErrorContext override failed\n"); - okay = 0; - } - } else { - if (xmlDoValidityCheckingDefaultValue != 1) { - printf("ValidityCheckingDefaultValue override failed\n"); - okay = 0; - } - if (xmlGenericErrorContext != stderr) { - printf("xmlGenericErrorContext override failed\n"); - okay = 0; - } - } - if (okay == 0) - return ((DWORD) Failed); - return ((DWORD) Okay); -} - -int -main() -{ - unsigned int i, repeat; - unsigned int num_threads = sizeof(testfiles) / sizeof(testfiles[0]); - DWORD results[MAX_ARGC]; - BOOL ret; - - xmlInitParser(); - for (repeat = 0;repeat < TEST_REPEAT_COUNT;repeat++) - { - xmlLoadCatalog(catalog); - - for (i = 0; i < num_threads; i++) - { - results[i] = 0; - tid[i] = (HANDLE) -1; - } - - for (i = 0; i < num_threads; i++) - { - DWORD useless; - tid[i] = CreateThread(NULL, 0, - thread_specific_data, testfiles[i], 0, &useless); - if (tid[i] == NULL) - { - perror("CreateThread"); - exit(1); - } - } - - if (WaitForMultipleObjects (num_threads, tid, TRUE, INFINITE) == WAIT_FAILED) - perror ("WaitForMultipleObjects failed"); - - for (i = 0; i < num_threads; i++) - { - ret = GetExitCodeThread (tid[i], &results[i]); - if (ret == 0) - { - perror("GetExitCodeThread"); - exit(1); - } - CloseHandle (tid[i]); - } - - xmlCatalogCleanup(); - for (i = 0; i < num_threads; i++) { - if (results[i] != (DWORD) Okay) - printf("Thread %d handling %s failed\n", i, testfiles[i]); - } - } - - xmlCleanupParser(); - xmlMemoryDump(); - - return (0); -} - -#else /* !LIBXML_THREADS_ENABLED */ -int -main() -{ - fprintf(stderr, "libxml was not compiled with thread or catalog support\n"); - return (0); -} -#endif diff --git a/reactos/lib/3rdparty/libxml2/testURI.c b/reactos/lib/3rdparty/libxml2/testURI.c deleted file mode 100644 index d20989d4b35..00000000000 --- a/reactos/lib/3rdparty/libxml2/testURI.c +++ /dev/null @@ -1,124 +0,0 @@ -/* - * testURI.c : a small tester program for XML input. - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#include "libxml.h" - -#include -#include -#include - -#include -#include -#include - -static const char *base = NULL; -static int escape = 0; -static int debug = 0; - -static void handleURI(const char *str) { - int ret; - xmlURIPtr uri; - xmlChar *res = NULL, *parsed = NULL; - - uri = xmlCreateURI(); - - if (base == NULL) { - ret = xmlParseURIReference(uri, str); - if (ret != 0) - printf("%s : error %d\n", str, ret); - else { - if (debug) { - if (uri->scheme) printf("scheme: %s\n", uri->scheme); - if (uri->opaque) printf("opaque: %s\n", uri->opaque); - if (uri->authority) printf("authority: %s\n", uri->authority); - if (uri->server) printf("server: %s\n", uri->server); - if (uri->user) printf("user: %s\n", uri->user); - if (uri->port != 0) printf("port: %d\n", uri->port); - if (uri->path) printf("path: %s\n", uri->path); - if (uri->query) printf("query: %s\n", uri->query); - if (uri->fragment) printf("fragment: %s\n", uri->fragment); - if (uri->query_raw) printf("query_raw: %s\n", uri->query_raw); - if (uri->cleanup != 0) printf("cleanup\n"); - } - xmlNormalizeURIPath(uri->path); - if (escape != 0) { - parsed = xmlSaveUri(uri); - res = xmlURIEscape(parsed); - printf("%s\n", (char *) res); - - } else { - xmlPrintURI(stdout, uri); - printf("\n"); - } - } - } else { - res = xmlBuildURI((xmlChar *)str, (xmlChar *) base); - if (res != NULL) { - printf("%s\n", (char *) res); - } - else - printf("::ERROR::\n"); - } - if (res != NULL) - xmlFree(res); - if (parsed != NULL) - xmlFree(parsed); - xmlFreeURI(uri); -} - -int main(int argc, char **argv) { - int i, arg = 1; - - if ((argc > arg) && (argv[arg] != NULL) && - ((!strcmp(argv[arg], "-base")) || (!strcmp(argv[arg], "--base")))) { - arg++; - base = argv[arg]; - if (base != NULL) - arg++; - } - if ((argc > arg) && (argv[arg] != NULL) && - ((!strcmp(argv[arg], "-escape")) || (!strcmp(argv[arg], "--escape")))) { - arg++; - escape++; - } - if ((argc > arg) && (argv[arg] != NULL) && - ((!strcmp(argv[arg], "-debug")) || (!strcmp(argv[arg], "--debug")))) { - arg++; - debug++; - } - if (argv[arg] == NULL) { - char str[1024]; - - while (1) { - /* - * read one line in string buffer. - */ - if (fgets (&str[0], sizeof (str) - 1, stdin) == NULL) - break; - - /* - * remove the ending spaces - */ - i = strlen(str); - while ((i > 0) && - ((str[i - 1] == '\n') || (str[i - 1] == '\r') || - (str[i - 1] == ' ') || (str[i - 1] == '\t'))) { - i--; - str[i] = 0; - } - handleURI(str); - } - } else { - while (argv[arg] != NULL) { - handleURI(argv[arg]); - arg++; - } - } - xmlMemoryDump(); - return(0); -} diff --git a/reactos/lib/3rdparty/libxml2/testXPath.c b/reactos/lib/3rdparty/libxml2/testXPath.c deleted file mode 100644 index ebb9ff7bbd8..00000000000 --- a/reactos/lib/3rdparty/libxml2/testXPath.c +++ /dev/null @@ -1,229 +0,0 @@ -/* - * testXPath.c : a small tester program for XPath. - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#include "libxml.h" -#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED) - -#include - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_STDLIB_H -#include -#endif - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(LIBXML_XPTR_ENABLED) -#include -static int xptr = 0; -#endif -static int debug = 0; -static int valid = 0; -static int expr = 0; -static int tree = 0; -static int nocdata = 0; -static xmlDocPtr document = NULL; - -/* - * Default document - */ -static xmlChar buffer[] = -"\n\ -\n\ - \n\ - Welcome to Gnome\n\ - \n\ - \n\ - The Linux adventure\n\ -

bla bla bla ...

\n\ - \n\ -

...

\n\ -
\n\ - \n\ - Chapter 2\n\ -

this is chapter 2 ...

\n\ -
\n\ - \n\ - Chapter 3\n\ -

this is chapter 3 ...

\n\ -
\n\ -
\n\ -"; - - -static void -testXPath(const char *str) { - xmlXPathObjectPtr res; - xmlXPathContextPtr ctxt; - -#if defined(LIBXML_XPTR_ENABLED) - if (xptr) { - ctxt = xmlXPtrNewContext(document, NULL, NULL); - res = xmlXPtrEval(BAD_CAST str, ctxt); - } else { -#endif - ctxt = xmlXPathNewContext(document); - ctxt->node = xmlDocGetRootElement(document); - if (expr) - res = xmlXPathEvalExpression(BAD_CAST str, ctxt); - else { - /* res = xmlXPathEval(BAD_CAST str, ctxt); */ - xmlXPathCompExprPtr comp; - - comp = xmlXPathCompile(BAD_CAST str); - if (comp != NULL) { - if (tree) - xmlXPathDebugDumpCompExpr(stdout, comp, 0); - - res = xmlXPathCompiledEval(comp, ctxt); - xmlXPathFreeCompExpr(comp); - } else - res = NULL; - } -#if defined(LIBXML_XPTR_ENABLED) - } -#endif - xmlXPathDebugDumpObject(stdout, res, 0); - xmlXPathFreeObject(res); - xmlXPathFreeContext(ctxt); -} - -static void -testXPathFile(const char *filename) { - FILE *input; - char expression[5000]; - int len; - - input = fopen(filename, "r"); - if (input == NULL) { - xmlGenericError(xmlGenericErrorContext, - "Cannot open %s for reading\n", filename); - return; - } - while (fgets(expression, 4500, input) != NULL) { - len = strlen(expression); - len--; - while ((len >= 0) && - ((expression[len] == '\n') || (expression[len] == '\t') || - (expression[len] == '\r') || (expression[len] == ' '))) len--; - expression[len + 1] = 0; - if (len >= 0) { - printf("\n========================\nExpression: %s\n", expression) ; - testXPath(expression); - } - } - - fclose(input); -} - -int main(int argc, char **argv) { - int i; - int strings = 0; - int usefile = 0; - char *filename = NULL; - - for (i = 1; i < argc ; i++) { -#if defined(LIBXML_XPTR_ENABLED) - if ((!strcmp(argv[i], "-xptr")) || (!strcmp(argv[i], "--xptr"))) - xptr++; - else -#endif - if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug"))) - debug++; - else if ((!strcmp(argv[i], "-valid")) || (!strcmp(argv[i], "--valid"))) - valid++; - else if ((!strcmp(argv[i], "-expr")) || (!strcmp(argv[i], "--expr"))) - expr++; - else if ((!strcmp(argv[i], "-tree")) || (!strcmp(argv[i], "--tree"))) - tree++; - else if ((!strcmp(argv[i], "-nocdata")) || - (!strcmp(argv[i], "--nocdata"))) - nocdata++; - else if ((!strcmp(argv[i], "-i")) || (!strcmp(argv[i], "--input"))) - filename = argv[++i]; - else if ((!strcmp(argv[i], "-f")) || (!strcmp(argv[i], "--file"))) - usefile++; - } - if (valid != 0) xmlDoValidityCheckingDefaultValue = 1; - xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS; - xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; - xmlSubstituteEntitiesDefaultValue = 1; -#ifdef LIBXML_SAX1_ENABLED - if (nocdata != 0) { - xmlDefaultSAXHandlerInit(); - xmlDefaultSAXHandler.cdataBlock = NULL; - } -#endif - if (document == NULL) { - if (filename == NULL) - document = xmlReadDoc(buffer,NULL,NULL,XML_PARSE_COMPACT); - else - document = xmlReadFile(filename,NULL,XML_PARSE_COMPACT); - } - for (i = 1; i < argc ; i++) { - if ((!strcmp(argv[i], "-i")) || (!strcmp(argv[i], "--input"))) { - i++; continue; - } - if (argv[i][0] != '-') { - if (usefile) - testXPathFile(argv[i]); - else - testXPath(argv[i]); - strings ++; - } - } - if (strings == 0) { - printf("Usage : %s [--debug] [--copy] stringsorfiles ...\n", - argv[0]); - printf("\tParse the XPath strings and output the result of the parsing\n"); - printf("\t--debug : dump a debug version of the result\n"); - printf("\t--valid : switch on DTD support in the parser\n"); -#if defined(LIBXML_XPTR_ENABLED) - printf("\t--xptr : expressions are XPointer expressions\n"); -#endif - printf("\t--expr : debug XPath expressions only\n"); - printf("\t--tree : show the compiled XPath tree\n"); - printf("\t--nocdata : do not generate CDATA nodes\n"); - printf("\t--input filename : or\n"); - printf("\t-i filename : read the document from filename\n"); - printf("\t--file : or\n"); - printf("\t-f : read queries from files, args\n"); - } - if (document != NULL) - xmlFreeDoc(document); - xmlCleanupParser(); - xmlMemoryDump(); - - return(0); -} -#else -#include -int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - printf("%s : XPath/Debug support not compiled in\n", argv[0]); - return(0); -} -#endif /* LIBXML_XPATH_ENABLED */ diff --git a/reactos/lib/3rdparty/libxml2/testapi.c b/reactos/lib/3rdparty/libxml2/testapi.c deleted file mode 100644 index 48656b3b086..00000000000 --- a/reactos/lib/3rdparty/libxml2/testapi.c +++ /dev/null @@ -1,52060 +0,0 @@ -/* - * testapi.c: libxml2 API tester program. - * - * Automatically generated by gentest.py from libxml2-api.xml - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#include "libxml.h" -#include - -#include /* for putenv() */ -#include -#include -#include - - -static int testlibxml2(void); -static int test_module(const char *module); - -static int generic_errors = 0; -static int call_tests = 0; -static int function_tests = 0; - -static xmlChar chartab[1024]; -static int inttab[1024]; -static unsigned long longtab[1024]; - -static xmlDocPtr api_doc = NULL; -static xmlDtdPtr api_dtd = NULL; -static xmlNodePtr api_root = NULL; -static xmlAttrPtr api_attr = NULL; -static xmlNsPtr api_ns = NULL; - -static void -structured_errors(void *userData ATTRIBUTE_UNUSED, - xmlErrorPtr error ATTRIBUTE_UNUSED) { - generic_errors++; -} - -static void -free_api_doc(void) { - xmlFreeDoc(api_doc); - api_doc = NULL; - api_dtd = NULL; - api_root = NULL; - api_attr = NULL; - api_ns = NULL; -} - -static xmlDocPtr -get_api_doc(void) { - if (api_doc == NULL) { - api_doc = xmlReadMemory("]>", 88, "root_test", NULL, 0); - api_root = NULL; - api_attr = NULL; - } - return(api_doc); -} - -static xmlDtdPtr -get_api_dtd(void) { - if ((api_dtd == NULL) || (api_dtd->type != XML_DTD_NODE)) { - get_api_doc(); - if ((api_doc != NULL) && (api_doc->children != NULL) && - (api_doc->children->type == XML_DTD_NODE)) - api_dtd = (xmlDtdPtr) api_doc->children; - } - return(api_dtd); -} - -static xmlNodePtr -get_api_root(void) { - if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) { - get_api_doc(); - if ((api_doc != NULL) && (api_doc->children != NULL) && - (api_doc->children->next != NULL) && - (api_doc->children->next->type == XML_ELEMENT_NODE)) - api_root = api_doc->children->next; - } - return(api_root); -} - -static xmlNsPtr -get_api_ns(void) { - get_api_root(); - if (api_root != NULL) - api_ns = api_root->nsDef; - return(api_ns); -} - -static xmlAttrPtr -get_api_attr(void) { -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) - static int nr = 0; - xmlChar name[20]; -#endif - - if ((api_root == NULL) || (api_root->type != XML_ELEMENT_NODE)) { - get_api_root(); - } - if (api_root == NULL) - return(NULL); - if (api_root->properties != NULL) { - api_attr = api_root->properties; - return(api_root->properties); - } - api_attr = NULL; -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) - snprintf((char *) name, 20, "foo%d", nr++); - api_attr = xmlSetProp(api_root, name, (const xmlChar *) "bar"); -#endif - return(api_attr); -} - -static int quiet = 0; - -int main(int argc, char **argv) { - int ret; - int blocks, mem; - -#ifdef HAVE_PUTENV - /* access to the proxy can slow up regression tests a lot */ - putenv((char *) "http_proxy="); -#endif - - memset(chartab, 0, sizeof(chartab)); - strncpy((char *) chartab, " chartab\n", 20); - memset(inttab, 0, sizeof(inttab)); - memset(longtab, 0, sizeof(longtab)); - - xmlInitParser(); -#ifdef LIBXML_SCHEMAS_ENABLED - xmlRelaxNGInitTypes(); -#endif - - LIBXML_TEST_VERSION - - xmlSetStructuredErrorFunc(NULL, structured_errors); - - if (argc >= 2) { - if (!strcmp(argv[1], "-q")) { - quiet = 1; - if (argc >= 3) - ret = test_module(argv[2]); - else - ret = testlibxml2(); - } else { - ret = test_module(argv[1]); - } - } else - ret = testlibxml2(); - - xmlCleanupParser(); - blocks = xmlMemBlocks(); - mem = xmlMemUsed(); - if ((blocks != 0) || (mem != 0)) { - printf("testapi leaked %d bytes in %d blocks\n", mem, blocks); - } - xmlMemoryDump(); - - return (ret != 0); -} - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - We manually define xmlErrMemory because it's normal declaration - is "hidden" by #ifdef IN_LIBXML -*/ -void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra); - -/* - We need some "remote" addresses, but want to avoid getting into - name resolution delays, so we use these -*/ -#define REMOTE1GOOD "http://localhost/" -#define REMOTE1BAD "http:http://http" -#define REMOTE2GOOD "ftp://localhost/foo" - -#define gen_nb_void_ptr 2 - -static void *gen_void_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_void_ptr(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#if 0 -#define gen_nb_const_void_ptr 2 - -static const void *gen_const_void_ptr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return((const void *) "immutable string"); - return(NULL); -} -static void des_const_void_ptr(int no ATTRIBUTE_UNUSED, const void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#define gen_nb_userdata 3 - -static void *gen_userdata(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return((void *) &call_tests); - if (no == 1) return((void *) -1); - return(NULL); -} -static void des_userdata(int no ATTRIBUTE_UNUSED, void *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - - -#define gen_nb_int 4 - -static int gen_int(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(0); - if (no == 1) return(1); - if (no == 2) return(-1); - if (no == 3) return(122); - return(-1); -} - -static void des_int(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_parseroptions 5 - -static int gen_parseroptions(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(XML_PARSE_NOBLANKS | XML_PARSE_RECOVER); - if (no == 1) return(XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_DTDVALID | XML_PARSE_NOCDATA); - if (no == 2) return(XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE | XML_PARSE_NSCLEAN); - if (no == 3) return(XML_PARSE_XINCLUDE | XML_PARSE_NODICT); - return(XML_PARSE_SAX1); -} - -static void des_parseroptions(int no ATTRIBUTE_UNUSED, int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#if 0 -#define gen_nb_long 5 - -static long gen_long(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(0); - if (no == 1) return(1); - if (no == 2) return(-1); - if (no == 3) return(122); - return(-1); -} - -static void des_long(int no ATTRIBUTE_UNUSED, long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#define gen_nb_xmlChar 4 - -static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return('a'); - if (no == 1) return(' '); - if (no == 2) return((xmlChar) '\xf8'); - return(0); -} - -static void des_xmlChar(int no ATTRIBUTE_UNUSED, xmlChar val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_unsigned_int 3 - -static unsigned int gen_unsigned_int(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(0); - if (no == 1) return(1); - if (no == 2) return(122); - return((unsigned int) -1); -} - -static void des_unsigned_int(int no ATTRIBUTE_UNUSED, unsigned int val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_unsigned_long 4 - -static unsigned long gen_unsigned_long(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(0); - if (no == 1) return(1); - if (no == 2) return(122); - return((unsigned long) -1); -} - -static void des_unsigned_long(int no ATTRIBUTE_UNUSED, unsigned long val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_double 4 - -static double gen_double(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(0); - if (no == 1) return(-1.1); -#if defined(LIBXML_XPATH_ENABLED) - if (no == 2) return(xmlXPathNAN); -#endif - return(-1); -} - -static void des_double(int no ATTRIBUTE_UNUSED, double val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_unsigned_long_ptr 2 - -static unsigned long *gen_unsigned_long_ptr(int no, int nr) { - if (no == 0) return(&longtab[nr]); - return(NULL); -} - -static void des_unsigned_long_ptr(int no ATTRIBUTE_UNUSED, unsigned long *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_int_ptr 2 - -static int *gen_int_ptr(int no, int nr) { - if (no == 0) return(&inttab[nr]); - return(NULL); -} - -static void des_int_ptr(int no ATTRIBUTE_UNUSED, int *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_const_char_ptr 4 - -static char *gen_const_char_ptr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return((char *) "foo"); - if (no == 1) return((char *) ""); - if (no == 2) return((char *) "test/ent2"); - return(NULL); -} -static void des_const_char_ptr(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_xmlChar_ptr 2 - -static xmlChar *gen_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(&chartab[0]); - return(NULL); -} -static void des_xmlChar_ptr(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_FILE_ptr 2 - -static FILE *gen_FILE_ptr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(fopen("test.out", "a+")); - return(NULL); -} -static void des_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) fclose(val); -} - -#define gen_nb_debug_FILE_ptr 2 -static FILE *gen_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(fopen("test.out", "a+")); -} -static void des_debug_FILE_ptr(int no ATTRIBUTE_UNUSED, FILE *val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) fclose(val); -} - -#define gen_nb_const_xmlChar_ptr 5 - -static xmlChar *gen_const_xmlChar_ptr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return((xmlChar *) "foo"); - if (no == 1) return((xmlChar *) ""); - if (no == 2) return((xmlChar *) "n" "\xf8" "ne"); - if (no == 3) return((xmlChar *) " 2ab "); - return(NULL); -} -static void des_const_xmlChar_ptr(int no ATTRIBUTE_UNUSED, const xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_filepath 8 - -static const char *gen_filepath(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return("missing.xml"); - if (no == 1) return(""); - if (no == 2) return("test/ent2"); - if (no == 3) return("test/valid/REC-xml-19980210.xml"); - if (no == 4) return("test/valid/dtds/xhtml1-strict.dtd"); - if (no == 5) return(REMOTE1GOOD); - if (no == 6) return(REMOTE1BAD); - return(NULL); -} -static void des_filepath(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_eaten_name 2 - -static xmlChar *gen_eaten_name(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlStrdup(BAD_CAST "eaten")); - return(NULL); -} -static void des_eaten_name(int no ATTRIBUTE_UNUSED, xmlChar *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_fileoutput 6 - -static const char *gen_fileoutput(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return("/missing.xml"); - if (no == 1) return(""); - if (no == 2) return(REMOTE2GOOD); - if (no == 3) return(REMOTE1GOOD); - if (no == 4) return(REMOTE1BAD); - return(NULL); -} -static void des_fileoutput(int no ATTRIBUTE_UNUSED, const char *val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_xmlParserCtxtPtr 3 -static xmlParserCtxtPtr gen_xmlParserCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlNewParserCtxt()); - if (no == 1) return(xmlCreateMemoryParserCtxt("", 6)); - return(NULL); -} -static void des_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlParserCtxtPtr val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) - xmlFreeParserCtxt(val); -} - -#define gen_nb_xmlSAXHandlerPtr 2 -static xmlSAXHandlerPtr gen_xmlSAXHandlerPtr(int no, int nr ATTRIBUTE_UNUSED) { -#ifdef LIBXML_SAX1_ENABLED - if (no == 0) return((xmlSAXHandlerPtr) &xmlDefaultSAXHandler); -#endif - return(NULL); -} -static void des_xmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_xmlValidCtxtPtr 2 -static xmlValidCtxtPtr gen_xmlValidCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) { -#ifdef LIBXML_VALID_ENABLED - if (no == 0) return(xmlNewValidCtxt()); -#endif - return(NULL); -} -static void des_xmlValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlValidCtxtPtr val, int nr ATTRIBUTE_UNUSED) { -#ifdef LIBXML_VALID_ENABLED - if (val != NULL) - xmlFreeValidCtxt(val); -#endif -} - -#define gen_nb_xmlParserInputBufferPtr 8 - -static xmlParserInputBufferPtr gen_xmlParserInputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlParserInputBufferCreateFilename("missing.xml", XML_CHAR_ENCODING_NONE)); - if (no == 1) return(xmlParserInputBufferCreateFilename("", XML_CHAR_ENCODING_NONE)); - if (no == 2) return(xmlParserInputBufferCreateFilename("test/ent2", XML_CHAR_ENCODING_NONE)); - if (no == 3) return(xmlParserInputBufferCreateFilename("test/valid/REC-xml-19980210.xml", XML_CHAR_ENCODING_NONE)); - if (no == 4) return(xmlParserInputBufferCreateFilename("test/valid/dtds/xhtml1-strict.dtd", XML_CHAR_ENCODING_NONE)); - if (no == 5) return(xmlParserInputBufferCreateFilename(REMOTE1GOOD, XML_CHAR_ENCODING_NONE)); - if (no == 6) return(xmlParserInputBufferCreateFilename(REMOTE1BAD, XML_CHAR_ENCODING_NONE)); - return(NULL); -} -static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputBufferPtr val, int nr ATTRIBUTE_UNUSED) { - xmlFreeParserInputBuffer(val); -} - -#define gen_nb_xmlDocPtr 4 -static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlNewDoc(BAD_CAST "1.0")); - if (no == 1) return(xmlReadMemory("", 6, "test", NULL, 0)); - if (no == 2) return(xmlReadMemory(" ", 24, "test", NULL, 0)); - return(NULL); -} -static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) { - if ((val != NULL) && (val != api_doc) && (val->doc != api_doc)) - xmlFreeDoc(val); -} - -#define gen_nb_xmlAttrPtr 2 -static xmlAttrPtr gen_xmlAttrPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(get_api_attr()); - return(NULL); -} -static void des_xmlAttrPtr(int no, xmlAttrPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - if (no == 0) free_api_doc(); -} - -#define gen_nb_xmlDictPtr 2 -static xmlDictPtr gen_xmlDictPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlDictCreate()); - return(NULL); -} -static void des_xmlDictPtr(int no ATTRIBUTE_UNUSED, xmlDictPtr val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) - xmlDictFree(val); -} - -#define gen_nb_xmlNodePtr 3 -static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL)); - if (no == 1) return(get_api_root()); - return(NULL); -/* if (no == 2) return((xmlNodePtr) get_api_doc()); */ -} -static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) { - if (no == 1) { - free_api_doc(); - } else if (val != NULL) { - xmlUnlinkNode(val); - xmlFreeNode(val); - } -} - -#define gen_nb_xmlDtdPtr 3 -static xmlDtdPtr gen_xmlDtdPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) - return(xmlNewDtd(NULL, BAD_CAST "dtd", BAD_CAST"foo", BAD_CAST"bar")); - if (no == 1) return(get_api_dtd()); - return(NULL); -} -static void des_xmlDtdPtr(int no, xmlDtdPtr val, int nr ATTRIBUTE_UNUSED) { - if (no == 1) free_api_doc(); - else if (val != NULL) { - xmlUnlinkNode((xmlNodePtr) val); - xmlFreeNode((xmlNodePtr) val); - } -} - -#define gen_nb_xmlNsPtr 2 -static xmlNsPtr gen_xmlNsPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(get_api_ns()); - return(NULL); -} -static void des_xmlNsPtr(int no, xmlNsPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - if (no == 0) free_api_doc(); -} - -#define gen_nb_xmlNodePtr_in 3 -static xmlNodePtr gen_xmlNodePtr_in(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlNewPI(BAD_CAST "test", NULL)); - if (no == 0) return(xmlNewText(BAD_CAST "text")); - return(NULL); -} -static void des_xmlNodePtr_in(int no ATTRIBUTE_UNUSED, xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#ifdef LIBXML_WRITER_ENABLED -#define gen_nb_xmlTextWriterPtr 2 -static xmlTextWriterPtr gen_xmlTextWriterPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlNewTextWriterFilename("test.out", 0)); - return(NULL); -} -static void des_xmlTextWriterPtr(int no ATTRIBUTE_UNUSED, xmlTextWriterPtr val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) xmlFreeTextWriter(val); -} -#endif - -#ifdef LIBXML_READER_ENABLED -#define gen_nb_xmlTextReaderPtr 4 -static xmlTextReaderPtr gen_xmlTextReaderPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlNewTextReaderFilename("test/ent2")); - if (no == 1) return(xmlNewTextReaderFilename("test/valid/REC-xml-19980210.xml")); - if (no == 2) return(xmlNewTextReaderFilename("test/valid/dtds/xhtml1-strict.dtd")); - return(NULL); -} -static void des_xmlTextReaderPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderPtr val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) xmlFreeTextReader(val); -} -#endif - -#define gen_nb_xmlBufferPtr 3 -static const xmlChar *static_buf_content = (xmlChar *)"a static buffer"; -static xmlBufferPtr gen_xmlBufferPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlBufferCreate()); - if (no == 1) return(xmlBufferCreateStatic((void *)static_buf_content, 13)); - return(NULL); -} -static void des_xmlBufferPtr(int no ATTRIBUTE_UNUSED, xmlBufferPtr val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) { - xmlBufferFree(val); - } -} - -#define gen_nb_xmlListPtr 2 -static xmlListPtr gen_xmlListPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlListCreate(NULL, NULL)); - return(NULL); -} -static void des_xmlListPtr(int no ATTRIBUTE_UNUSED, xmlListPtr val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) { - xmlListDelete(val); - } -} - -#define gen_nb_xmlHashTablePtr 2 -static xmlHashTablePtr gen_xmlHashTablePtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlHashCreate(10)); - return(NULL); -} -static void des_xmlHashTablePtr(int no ATTRIBUTE_UNUSED, xmlHashTablePtr val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) { - xmlHashFree(val, NULL); - } -} - -#include - -#ifdef LIBXML_XPATH_ENABLED -#define gen_nb_xmlXPathObjectPtr 5 -static xmlXPathObjectPtr gen_xmlXPathObjectPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlXPathNewString(BAD_CAST "string object")); - if (no == 1) return(xmlXPathNewFloat(1.1)); - if (no == 2) return(xmlXPathNewBoolean(1)); - if (no == 3) return(xmlXPathNewNodeSet(NULL)); - return(NULL); -} -static void des_xmlXPathObjectPtr(int no ATTRIBUTE_UNUSED, xmlXPathObjectPtr val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) { - xmlXPathFreeObject(val); - } -} -#endif - -#ifdef LIBXML_OUTPUT_ENABLED -#define gen_nb_xmlOutputBufferPtr 2 -static xmlOutputBufferPtr gen_xmlOutputBufferPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlOutputBufferCreateFilename("test.out", NULL, 0)); - return(NULL); -} -static void des_xmlOutputBufferPtr(int no ATTRIBUTE_UNUSED, xmlOutputBufferPtr val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) { - xmlOutputBufferClose(val); - } -} -#endif - -#ifdef LIBXML_FTP_ENABLED -#define gen_nb_xmlNanoFTPCtxtPtr 4 -static void *gen_xmlNanoFTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlNanoFTPNewCtxt(REMOTE2GOOD)); - if (no == 1) return(xmlNanoFTPNewCtxt(REMOTE1GOOD)); - if (no == 2) return(xmlNanoFTPNewCtxt("foo")); - return(NULL); -} -static void des_xmlNanoFTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) { - xmlNanoFTPFreeCtxt(val); - } -} -#endif - -#ifdef LIBXML_HTTP_ENABLED -#define gen_nb_xmlNanoHTTPCtxtPtr 1 -static void *gen_xmlNanoHTTPCtxtPtr(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlNanoHTTPOpen(REMOTE1GOOD, NULL)); - if (no == 1) return(xmlNanoHTTPOpen(REMOTE2GOOD, NULL)); - if (no == 2) return(xmlNanoHTTPOpen(REMOTE1BAD, NULL)); - return(NULL); -} -static void des_xmlNanoHTTPCtxtPtr(int no ATTRIBUTE_UNUSED, void *val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) { - xmlNanoHTTPClose(val); - } -} -#endif - -#define gen_nb_xmlCharEncoding 4 -static xmlCharEncoding gen_xmlCharEncoding(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(XML_CHAR_ENCODING_UTF8); - if (no == 1) return(XML_CHAR_ENCODING_NONE); - if (no == 2) return(XML_CHAR_ENCODING_8859_1); - return(XML_CHAR_ENCODING_ERROR); -} -static void des_xmlCharEncoding(int no ATTRIBUTE_UNUSED, xmlCharEncoding val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) - -#define gen_nb_xmlExpCtxtPtr 1 -static xmlExpCtxtPtr gen_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlExpCtxtPtr(int no ATTRIBUTE_UNUSED, xmlExpCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_xmlExpNodePtr 1 -static xmlExpNodePtr gen_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#endif - -#if defined(LIBXML_SCHEMAS_ENABLED) -#define gen_nb_xmlSchemaPtr 1 -static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_xmlSchemaValidCtxtPtr 1 -static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#endif /* LIBXML_SCHEMAS_ENABLED */ - -#define gen_nb_xmlHashDeallocator 2 -static void -test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) { -} - -static xmlHashDeallocator gen_xmlHashDeallocator(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(test_xmlHashDeallocator); - return(NULL); -} -static void des_xmlHashDeallocator(int no ATTRIBUTE_UNUSED, xmlHashDeallocator val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - - -static void desret_int(int val ATTRIBUTE_UNUSED) { -} -static void desret_xmlChar(xmlChar val ATTRIBUTE_UNUSED) { -} -static void desret_long(long val ATTRIBUTE_UNUSED) { -} -static void desret_unsigned_long(unsigned long val ATTRIBUTE_UNUSED) { -} -static void desret_double(double val ATTRIBUTE_UNUSED) { -} -static void desret_xmlCharEncoding(xmlCharEncoding val ATTRIBUTE_UNUSED) { -} -#if 0 -static void desret_const_void_ptr(void *val ATTRIBUTE_UNUSED) { -} -#endif -static void desret_void_ptr(void *val ATTRIBUTE_UNUSED) { -} -static void desret_const_char_ptr(const char *val ATTRIBUTE_UNUSED) { -} -static void desret_const_xmlChar_ptr(const xmlChar *val ATTRIBUTE_UNUSED) { -} -static void desret_xmlChar_ptr(xmlChar *val) { - if (val != NULL) - xmlFree(val); -} -static void desret_xmlDocPtr(xmlDocPtr val) { - if (val != api_doc) - xmlFreeDoc(val); -} -static void desret_xmlDictPtr(xmlDictPtr val) { - xmlDictFree(val); -} -#ifdef LIBXML_OUTPUT_ENABLED -static void desret_xmlOutputBufferPtr(xmlOutputBufferPtr val) { - xmlOutputBufferClose(val); -} -#endif -#ifdef LIBXML_READER_ENABLED -static void desret_xmlTextReaderPtr(xmlTextReaderPtr val) { - xmlFreeTextReader(val); -} -#endif -static void desret_xmlNodePtr(xmlNodePtr val) { - if ((val != NULL) && (val != api_root) && (val != (xmlNodePtr) api_doc)) { - xmlUnlinkNode(val); - xmlFreeNode(val); - } -} -static void desret_xmlAttrPtr(xmlAttrPtr val) { - if (val != NULL) { - xmlUnlinkNode((xmlNodePtr) val); - xmlFreeNode((xmlNodePtr) val); - } -} -static void desret_xmlEntityPtr(xmlEntityPtr val) { - if (val != NULL) { - xmlUnlinkNode((xmlNodePtr) val); - xmlFreeNode((xmlNodePtr) val); - } -} -static void desret_xmlElementPtr(xmlElementPtr val) { - if (val != NULL) { - xmlUnlinkNode((xmlNodePtr) val); - } -} -static void desret_xmlAttributePtr(xmlAttributePtr val) { - if (val != NULL) { - xmlUnlinkNode((xmlNodePtr) val); - } -} -static void desret_xmlNsPtr(xmlNsPtr val ATTRIBUTE_UNUSED) { -} -static void desret_xmlDtdPtr(xmlDtdPtr val) { - desret_xmlNodePtr((xmlNodePtr)val); -} -#ifdef LIBXML_XPATH_ENABLED -static void desret_xmlXPathObjectPtr(xmlXPathObjectPtr val) { - xmlXPathFreeObject(val); -} -static void desret_xmlNodeSetPtr(xmlNodeSetPtr val) { - xmlXPathFreeNodeSet(val); -} -#endif -static void desret_xmlParserCtxtPtr(xmlParserCtxtPtr val) { - xmlFreeParserCtxt(val); -} -static void desret_xmlParserInputBufferPtr(xmlParserInputBufferPtr val) { - xmlFreeParserInputBuffer(val); -} -static void desret_xmlParserInputPtr(xmlParserInputPtr val) { - xmlFreeInputStream(val); -} -#ifdef LIBXML_WRITER_ENABLED -static void desret_xmlTextWriterPtr(xmlTextWriterPtr val) { - xmlFreeTextWriter(val); -} -#endif -static void desret_xmlBufferPtr(xmlBufferPtr val) { - xmlBufferFree(val); -} -#ifdef LIBXML_SCHEMAS_ENABLED -static void desret_xmlSchemaParserCtxtPtr(xmlSchemaParserCtxtPtr val) { - xmlSchemaFreeParserCtxt(val); -} -static void desret_xmlSchemaTypePtr(xmlSchemaTypePtr val ATTRIBUTE_UNUSED) { -} -static void desret_xmlRelaxNGParserCtxtPtr(xmlRelaxNGParserCtxtPtr val) { - xmlRelaxNGFreeParserCtxt(val); -} -#endif -#ifdef LIBXML_HTML_ENABLED -static void desret_const_htmlEntityDesc_ptr(const htmlEntityDesc * val ATTRIBUTE_UNUSED) { -} -#endif -#ifdef LIBXML_HTTP_ENABLED -static void desret_xmlNanoHTTPCtxtPtr(void *val) { - xmlNanoHTTPClose(val); -} -#endif -#ifdef LIBXML_FTP_ENABLED -static void desret_xmlNanoFTPCtxtPtr(void *val) { - xmlNanoFTPClose(val); -} -#endif -/* cut and pasted from autogenerated to avoid troubles */ -#define gen_nb_const_xmlChar_ptr_ptr 1 -static xmlChar ** gen_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, const xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_unsigned_char_ptr 1 -static unsigned char * gen_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_const_unsigned_char_ptr 1 -static unsigned char * gen_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_unsigned_char_ptr(int no ATTRIBUTE_UNUSED, const unsigned char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#ifdef LIBXML_HTML_ENABLED -#define gen_nb_const_htmlNodePtr 1 -static htmlNodePtr gen_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_htmlNodePtr(int no ATTRIBUTE_UNUSED, const htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#ifdef LIBXML_HTML_ENABLED -#define gen_nb_htmlDocPtr 3 -static htmlDocPtr gen_htmlDocPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(htmlNewDoc(NULL, NULL)); - if (no == 1) return(htmlReadMemory("", 7, "test", NULL, 0)); - return(NULL); -} -static void des_htmlDocPtr(int no ATTRIBUTE_UNUSED, htmlDocPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - if ((val != NULL) && (val != api_doc) && (val->doc != api_doc)) - xmlFreeDoc(val); -} -static void desret_htmlDocPtr(htmlDocPtr val) { - if ((val != NULL) && (val != api_doc) && (val->doc != api_doc)) - xmlFreeDoc(val); -} -#define gen_nb_htmlParserCtxtPtr 3 -static htmlParserCtxtPtr gen_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - if (no == 0) return(xmlNewParserCtxt()); - if (no == 1) return(htmlCreateMemoryParserCtxt("", 7)); - return(NULL); -} -static void des_htmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, htmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) - htmlFreeParserCtxt(val); -} -static void desret_htmlParserCtxtPtr(htmlParserCtxtPtr val) { - if (val != NULL) - htmlFreeParserCtxt(val); -} -#endif - -#ifdef LIBXML_XPATH_ENABLED -#define gen_nb_xmlNodeSetPtr 1 -static xmlNodeSetPtr gen_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlNodeSetPtr(int no ATTRIBUTE_UNUSED, xmlNodeSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#ifdef LIBXML_DEBUG_ENABLED -#ifdef LIBXML_XPATH_ENABLED -#define gen_nb_xmlShellCtxtPtr 1 -static xmlShellCtxtPtr gen_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlShellCtxtPtr(int no ATTRIBUTE_UNUSED, xmlShellCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif -#endif - -#ifdef LIBXML_PATTERN_ENABLED -#define gen_nb_xmlPatternPtr 1 -static xmlPatternPtr gen_xmlPatternPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlPatternPtr(int no ATTRIBUTE_UNUSED, xmlPatternPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#define gen_nb_xmlElementContentPtr 1 -static xmlElementContentPtr gen_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlElementContentPtr(int no ATTRIBUTE_UNUSED, xmlElementContentPtr val, int nr ATTRIBUTE_UNUSED) { - if (val != NULL) - xmlFreeElementContent(val); -} -static void desret_xmlElementContentPtr(xmlElementContentPtr val) { - if (val != NULL) - xmlFreeElementContent(val); -} - -#define gen_nb_xmlParserNodeInfoSeqPtr 1 -static xmlParserNodeInfoSeqPtr gen_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static void desret_const_xmlParserNodeInfo_ptr(const xmlParserNodeInfo *val ATTRIBUTE_UNUSED) { -} - -#define gen_nb_void_ptr_ptr 1 -static void ** gen_void_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_void_ptr_ptr(int no ATTRIBUTE_UNUSED, void ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -/************************************************************************ - * * - * WARNING: end of the manually maintained part of the test code * - * do not remove or alter the CUT HERE line * - * * - ************************************************************************/ - -/* CUT HERE: everything below that line is generated */ -#ifdef LIBXML_HTML_ENABLED -static void desret_htmlStatus(htmlStatus val ATTRIBUTE_UNUSED) { -} - -#endif - -#define gen_nb_xmlAttributeDefault 4 -static xmlAttributeDefault gen_xmlAttributeDefault(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_ATTRIBUTE_FIXED); - if (no == 2) return(XML_ATTRIBUTE_IMPLIED); - if (no == 3) return(XML_ATTRIBUTE_NONE); - if (no == 4) return(XML_ATTRIBUTE_REQUIRED); - return(0); -} - -static void des_xmlAttributeDefault(int no ATTRIBUTE_UNUSED, xmlAttributeDefault val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_xmlAttributeType 4 -static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_ATTRIBUTE_CDATA); - if (no == 2) return(XML_ATTRIBUTE_ENTITIES); - if (no == 3) return(XML_ATTRIBUTE_ENTITY); - if (no == 4) return(XML_ATTRIBUTE_ENUMERATION); - return(0); -} - -static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_xmlBufferAllocationScheme 4 -static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT); - if (no == 2) return(XML_BUFFER_ALLOC_EXACT); - if (no == 3) return(XML_BUFFER_ALLOC_HYBRID); - if (no == 4) return(XML_BUFFER_ALLOC_IMMUTABLE); - return(0); -} - -static void des_xmlBufferAllocationScheme(int no ATTRIBUTE_UNUSED, xmlBufferAllocationScheme val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static void desret_xmlBufferAllocationScheme(xmlBufferAllocationScheme val ATTRIBUTE_UNUSED) { -} - -#ifdef LIBXML_CATALOG_ENABLED -#define gen_nb_xmlCatalogAllow 4 -static xmlCatalogAllow gen_xmlCatalogAllow(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_CATA_ALLOW_ALL); - if (no == 2) return(XML_CATA_ALLOW_DOCUMENT); - if (no == 3) return(XML_CATA_ALLOW_GLOBAL); - if (no == 4) return(XML_CATA_ALLOW_NONE); - return(0); -} - -static void des_xmlCatalogAllow(int no ATTRIBUTE_UNUSED, xmlCatalogAllow val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static void desret_xmlCatalogAllow(xmlCatalogAllow val ATTRIBUTE_UNUSED) { -} - -#endif - -#ifdef LIBXML_CATALOG_ENABLED -#define gen_nb_xmlCatalogPrefer 3 -static xmlCatalogPrefer gen_xmlCatalogPrefer(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_CATA_PREFER_NONE); - if (no == 2) return(XML_CATA_PREFER_PUBLIC); - if (no == 3) return(XML_CATA_PREFER_SYSTEM); - return(0); -} - -static void des_xmlCatalogPrefer(int no ATTRIBUTE_UNUSED, xmlCatalogPrefer val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static void desret_xmlCatalogPrefer(xmlCatalogPrefer val ATTRIBUTE_UNUSED) { -} - -#endif - -#define gen_nb_xmlElementContentType 4 -static xmlElementContentType gen_xmlElementContentType(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_ELEMENT_CONTENT_ELEMENT); - if (no == 2) return(XML_ELEMENT_CONTENT_OR); - if (no == 3) return(XML_ELEMENT_CONTENT_PCDATA); - if (no == 4) return(XML_ELEMENT_CONTENT_SEQ); - return(0); -} - -static void des_xmlElementContentType(int no ATTRIBUTE_UNUSED, xmlElementContentType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_xmlElementTypeVal 4 -static xmlElementTypeVal gen_xmlElementTypeVal(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_ELEMENT_TYPE_ANY); - if (no == 2) return(XML_ELEMENT_TYPE_ELEMENT); - if (no == 3) return(XML_ELEMENT_TYPE_EMPTY); - if (no == 4) return(XML_ELEMENT_TYPE_MIXED); - return(0); -} - -static void des_xmlElementTypeVal(int no ATTRIBUTE_UNUSED, xmlElementTypeVal val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_xmlFeature 4 -static xmlFeature gen_xmlFeature(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_WITH_AUTOMATA); - if (no == 2) return(XML_WITH_C14N); - if (no == 3) return(XML_WITH_CATALOG); - if (no == 4) return(XML_WITH_DEBUG); - return(0); -} - -static void des_xmlFeature(int no ATTRIBUTE_UNUSED, xmlFeature val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static void desret_xmlParserErrors(xmlParserErrors val ATTRIBUTE_UNUSED) { -} - -#ifdef LIBXML_SCHEMAS_ENABLED -#define gen_nb_xmlSchemaValType 4 -static xmlSchemaValType gen_xmlSchemaValType(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_SCHEMAS_ANYSIMPLETYPE); - if (no == 2) return(XML_SCHEMAS_ANYTYPE); - if (no == 3) return(XML_SCHEMAS_ANYURI); - if (no == 4) return(XML_SCHEMAS_BASE64BINARY); - return(0); -} - -static void des_xmlSchemaValType(int no ATTRIBUTE_UNUSED, xmlSchemaValType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static void desret_xmlSchemaValType(xmlSchemaValType val ATTRIBUTE_UNUSED) { -} - -#endif - -#ifdef LIBXML_SCHEMAS_ENABLED -#define gen_nb_xmlSchemaWhitespaceValueType 4 -static xmlSchemaWhitespaceValueType gen_xmlSchemaWhitespaceValueType(int no, int nr ATTRIBUTE_UNUSED) { - if (no == 1) return(XML_SCHEMA_WHITESPACE_COLLAPSE); - if (no == 2) return(XML_SCHEMA_WHITESPACE_PRESERVE); - if (no == 3) return(XML_SCHEMA_WHITESPACE_REPLACE); - if (no == 4) return(XML_SCHEMA_WHITESPACE_UNKNOWN); - return(0); -} - -static void des_xmlSchemaWhitespaceValueType(int no ATTRIBUTE_UNUSED, xmlSchemaWhitespaceValueType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -static int test_HTMLparser(void); -static int test_HTMLtree(void); -static int test_SAX2(void); -static int test_c14n(void); -static int test_catalog(void); -static int test_chvalid(void); -static int test_debugXML(void); -static int test_dict(void); -static int test_encoding(void); -static int test_entities(void); -static int test_hash(void); -static int test_list(void); -static int test_nanoftp(void); -static int test_nanohttp(void); -static int test_parser(void); -static int test_parserInternals(void); -static int test_pattern(void); -static int test_relaxng(void); -static int test_schemasInternals(void); -static int test_schematron(void); -static int test_tree(void); -static int test_uri(void); -static int test_valid(void); -static int test_xinclude(void); -static int test_xmlIO(void); -static int test_xmlautomata(void); -static int test_xmlerror(void); -static int test_xmlmodule(void); -static int test_xmlreader(void); -static int test_xmlregexp(void); -static int test_xmlsave(void); -static int test_xmlschemas(void); -static int test_xmlschemastypes(void); -static int test_xmlstring(void); -static int test_xmlunicode(void); -static int test_xmlwriter(void); -static int test_xpath(void); -static int test_xpathInternals(void); -static int test_xpointer(void); - -/** - * testlibxml2: - * - * Main entry point of the tester for the full libxml2 module, - * it calls all the tester entry point for each module. - * - * Returns the number of error found - */ -static int -testlibxml2(void) -{ - int test_ret = 0; - - test_ret += test_HTMLparser(); - test_ret += test_HTMLtree(); - test_ret += test_SAX2(); - test_ret += test_c14n(); - test_ret += test_catalog(); - test_ret += test_chvalid(); - test_ret += test_debugXML(); - test_ret += test_dict(); - test_ret += test_encoding(); - test_ret += test_entities(); - test_ret += test_hash(); - test_ret += test_list(); - test_ret += test_nanoftp(); - test_ret += test_nanohttp(); - test_ret += test_parser(); - test_ret += test_parserInternals(); - test_ret += test_pattern(); - test_ret += test_relaxng(); - test_ret += test_schemasInternals(); - test_ret += test_schematron(); - test_ret += test_tree(); - test_ret += test_uri(); - test_ret += test_valid(); - test_ret += test_xinclude(); - test_ret += test_xmlIO(); - test_ret += test_xmlautomata(); - test_ret += test_xmlerror(); - test_ret += test_xmlmodule(); - test_ret += test_xmlreader(); - test_ret += test_xmlregexp(); - test_ret += test_xmlsave(); - test_ret += test_xmlschemas(); - test_ret += test_xmlschemastypes(); - test_ret += test_xmlstring(); - test_ret += test_xmlunicode(); - test_ret += test_xmlwriter(); - test_ret += test_xpath(); - test_ret += test_xpathInternals(); - test_ret += test_xpointer(); - - printf("Total: %d functions, %d tests, %d errors\n", - function_tests, call_tests, test_ret); - return(test_ret); -} - - -static int -test_UTF8ToHtml(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - unsigned char * out; /* a pointer to an array of bytes to store the result */ - int n_out; - int * outlen; /* the length of @out */ - int n_outlen; - unsigned char * in; /* a pointer to an array of UTF-8 chars */ - int n_in; - int * inlen; /* the length of @in */ - int n_inlen; - - for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { - for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { - for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { - for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { - mem_base = xmlMemBlocks(); - out = gen_unsigned_char_ptr(n_out, 0); - outlen = gen_int_ptr(n_outlen, 1); - in = gen_const_unsigned_char_ptr(n_in, 2); - inlen = gen_int_ptr(n_inlen, 3); - - ret_val = UTF8ToHtml(out, outlen, (const unsigned char *)in, inlen); - desret_int(ret_val); - call_tests++; - des_unsigned_char_ptr(n_out, out, 0); - des_int_ptr(n_outlen, outlen, 1); - des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); - des_int_ptr(n_inlen, inlen, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in UTF8ToHtml", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_outlen); - printf(" %d", n_in); - printf(" %d", n_inlen); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_HTML_ENABLED - -#define gen_nb_const_htmlElemDesc_ptr 1 -static htmlElemDesc * gen_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_htmlElemDesc_ptr(int no ATTRIBUTE_UNUSED, const htmlElemDesc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_htmlAttrAllowed(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlStatus ret_val; - htmlElemDesc * elt; /* HTML element */ - int n_elt; - xmlChar * attr; /* HTML attribute */ - int n_attr; - int legacy; /* whether to allow deprecated attributes */ - int n_legacy; - - for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) { - for (n_attr = 0;n_attr < gen_nb_const_xmlChar_ptr;n_attr++) { - for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) { - mem_base = xmlMemBlocks(); - elt = gen_const_htmlElemDesc_ptr(n_elt, 0); - attr = gen_const_xmlChar_ptr(n_attr, 1); - legacy = gen_int(n_legacy, 2); - - ret_val = htmlAttrAllowed((const htmlElemDesc *)elt, (const xmlChar *)attr, legacy); - desret_htmlStatus(ret_val); - call_tests++; - des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 0); - des_const_xmlChar_ptr(n_attr, (const xmlChar *)attr, 1); - des_int(n_legacy, legacy, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlAttrAllowed", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_elt); - printf(" %d", n_attr); - printf(" %d", n_legacy); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_HTML_ENABLED - -#define gen_nb_htmlNodePtr 1 -static htmlNodePtr gen_htmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_htmlNodePtr(int no ATTRIBUTE_UNUSED, htmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_htmlAutoCloseTag(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - htmlDocPtr doc; /* the HTML document */ - int n_doc; - xmlChar * name; /* The tag name */ - int n_name; - htmlNodePtr elem; /* the HTML element */ - int n_elem; - - for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) { - mem_base = xmlMemBlocks(); - doc = gen_htmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - elem = gen_htmlNodePtr(n_elem, 2); - - ret_val = htmlAutoCloseTag(doc, (const xmlChar *)name, elem); - desret_int(ret_val); - call_tests++; - des_htmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_htmlNodePtr(n_elem, elem, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlAutoCloseTag", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf(" %d", n_elem); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlCreateMemoryParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlParserCtxtPtr ret_val; - char * buffer; /* a pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - mem_base = xmlMemBlocks(); - buffer = gen_const_char_ptr(n_buffer, 0); - size = gen_int(n_size, 1); - - ret_val = htmlCreateMemoryParserCtxt((const char *)buffer, size); - desret_htmlParserCtxtPtr(ret_val); - call_tests++; - des_const_char_ptr(n_buffer, (const char *)buffer, 0); - des_int(n_size, size, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlCreateMemoryParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_size); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_HTML_ENABLED - -#define gen_nb_htmlSAXHandlerPtr 1 -static htmlSAXHandlerPtr gen_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_htmlSAXHandlerPtr(int no ATTRIBUTE_UNUSED, htmlSAXHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_htmlCreatePushParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED) - int mem_base; - htmlParserCtxtPtr ret_val; - htmlSAXHandlerPtr sax; /* a SAX handler */ - int n_sax; - void * user_data; /* The user data returned on SAX callbacks */ - int n_user_data; - char * chunk; /* a pointer to an array of chars */ - int n_chunk; - int size; /* number of chars in the array */ - int n_size; - const char * filename; /* an optional file name or URI */ - int n_filename; - xmlCharEncoding enc; /* an optional encoding */ - int n_enc; - - for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) { - for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { - for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - mem_base = xmlMemBlocks(); - sax = gen_htmlSAXHandlerPtr(n_sax, 0); - user_data = gen_userdata(n_user_data, 1); - chunk = gen_const_char_ptr(n_chunk, 2); - size = gen_int(n_size, 3); - filename = gen_fileoutput(n_filename, 4); - enc = gen_xmlCharEncoding(n_enc, 5); - - ret_val = htmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename, enc); - desret_htmlParserCtxtPtr(ret_val); - call_tests++; - des_htmlSAXHandlerPtr(n_sax, sax, 0); - des_userdata(n_user_data, user_data, 1); - des_const_char_ptr(n_chunk, (const char *)chunk, 2); - des_int(n_size, size, 3); - des_fileoutput(n_filename, filename, 4); - des_xmlCharEncoding(n_enc, enc, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlCreatePushParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_user_data); - printf(" %d", n_chunk); - printf(" %d", n_size); - printf(" %d", n_filename); - printf(" %d", n_enc); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlCtxtReadDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlDocPtr ret_val; - htmlParserCtxtPtr ctxt; /* an HTML parser context */ - int n_ctxt; - xmlChar * cur; /* a pointer to a zero terminated string */ - int n_cur; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of htmlParserOption(s) */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); - cur = gen_const_xmlChar_ptr(n_cur, 1); - URL = gen_filepath(n_URL, 2); - encoding = gen_const_char_ptr(n_encoding, 3); - options = gen_int(n_options, 4); - - ret_val = htmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options); - desret_htmlDocPtr(ret_val); - call_tests++; - des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); - des_filepath(n_URL, URL, 2); - des_const_char_ptr(n_encoding, (const char *)encoding, 3); - des_int(n_options, options, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlCtxtReadDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlCtxtReadFile(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - htmlDocPtr ret_val; - htmlParserCtxtPtr ctxt; /* an HTML parser context */ - int n_ctxt; - const char * filename; /* a file or URL */ - int n_filename; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of htmlParserOption(s) */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); - filename = gen_filepath(n_filename, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - options = gen_int(n_options, 3); - - ret_val = htmlCtxtReadFile(ctxt, filename, (const char *)encoding, options); - desret_htmlDocPtr(ret_val); - call_tests++; - des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_filepath(n_filename, filename, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_int(n_options, options, 3); - xmlResetLastError(); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlCtxtReadMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlDocPtr ret_val; - htmlParserCtxtPtr ctxt; /* an HTML parser context */ - int n_ctxt; - char * buffer; /* a pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of htmlParserOption(s) */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); - buffer = gen_const_char_ptr(n_buffer, 1); - size = gen_int(n_size, 2); - URL = gen_filepath(n_URL, 3); - encoding = gen_const_char_ptr(n_encoding, 4); - options = gen_int(n_options, 5); - - ret_val = htmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options); - desret_htmlDocPtr(ret_val); - call_tests++; - des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_char_ptr(n_buffer, (const char *)buffer, 1); - des_int(n_size, size, 2); - des_filepath(n_URL, URL, 3); - des_const_char_ptr(n_encoding, (const char *)encoding, 4); - des_int(n_options, options, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlCtxtReadMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_buffer); - printf(" %d", n_size); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlCtxtReset(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlParserCtxtPtr ctxt; /* an HTML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); - - htmlCtxtReset(ctxt); - call_tests++; - des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlCtxtReset", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlCtxtUseOptions(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - htmlParserCtxtPtr ctxt; /* an HTML parser context */ - int n_ctxt; - int options; /* a combination of htmlParserOption(s) */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); - options = gen_int(n_options, 1); - - ret_val = htmlCtxtUseOptions(ctxt, options); - desret_int(ret_val); - call_tests++; - des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_int(n_options, options, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlCtxtUseOptions", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_options); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlElementAllowedHere(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - htmlElemDesc * parent; /* HTML parent element */ - int n_parent; - xmlChar * elt; /* HTML element */ - int n_elt; - - for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) { - for (n_elt = 0;n_elt < gen_nb_const_xmlChar_ptr;n_elt++) { - mem_base = xmlMemBlocks(); - parent = gen_const_htmlElemDesc_ptr(n_parent, 0); - elt = gen_const_xmlChar_ptr(n_elt, 1); - - ret_val = htmlElementAllowedHere((const htmlElemDesc *)parent, (const xmlChar *)elt); - desret_int(ret_val); - call_tests++; - des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0); - des_const_xmlChar_ptr(n_elt, (const xmlChar *)elt, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlElementAllowedHere", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_parent); - printf(" %d", n_elt); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlElementStatusHere(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlStatus ret_val; - htmlElemDesc * parent; /* HTML parent element */ - int n_parent; - htmlElemDesc * elt; /* HTML element */ - int n_elt; - - for (n_parent = 0;n_parent < gen_nb_const_htmlElemDesc_ptr;n_parent++) { - for (n_elt = 0;n_elt < gen_nb_const_htmlElemDesc_ptr;n_elt++) { - mem_base = xmlMemBlocks(); - parent = gen_const_htmlElemDesc_ptr(n_parent, 0); - elt = gen_const_htmlElemDesc_ptr(n_elt, 1); - - ret_val = htmlElementStatusHere((const htmlElemDesc *)parent, (const htmlElemDesc *)elt); - desret_htmlStatus(ret_val); - call_tests++; - des_const_htmlElemDesc_ptr(n_parent, (const htmlElemDesc *)parent, 0); - des_const_htmlElemDesc_ptr(n_elt, (const htmlElemDesc *)elt, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlElementStatusHere", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_parent); - printf(" %d", n_elt); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlEncodeEntities(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - unsigned char * out; /* a pointer to an array of bytes to store the result */ - int n_out; - int * outlen; /* the length of @out */ - int n_outlen; - unsigned char * in; /* a pointer to an array of UTF-8 chars */ - int n_in; - int * inlen; /* the length of @in */ - int n_inlen; - int quoteChar; /* the quote character to escape (' or ") or zero. */ - int n_quoteChar; - - for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { - for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { - for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { - for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { - for (n_quoteChar = 0;n_quoteChar < gen_nb_int;n_quoteChar++) { - mem_base = xmlMemBlocks(); - out = gen_unsigned_char_ptr(n_out, 0); - outlen = gen_int_ptr(n_outlen, 1); - in = gen_const_unsigned_char_ptr(n_in, 2); - inlen = gen_int_ptr(n_inlen, 3); - quoteChar = gen_int(n_quoteChar, 4); - - ret_val = htmlEncodeEntities(out, outlen, (const unsigned char *)in, inlen, quoteChar); - desret_int(ret_val); - call_tests++; - des_unsigned_char_ptr(n_out, out, 0); - des_int_ptr(n_outlen, outlen, 1); - des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); - des_int_ptr(n_inlen, inlen, 3); - des_int(n_quoteChar, quoteChar, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlEncodeEntities", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_outlen); - printf(" %d", n_in); - printf(" %d", n_inlen); - printf(" %d", n_quoteChar); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlEntityLookup(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - const htmlEntityDesc * ret_val; - xmlChar * name; /* the entity name */ - int n_name; - - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - name = gen_const_xmlChar_ptr(n_name, 0); - - ret_val = htmlEntityLookup((const xmlChar *)name); - desret_const_htmlEntityDesc_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlEntityLookup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlEntityValueLookup(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - const htmlEntityDesc * ret_val; - unsigned int value; /* the entity's unicode value */ - int n_value; - - for (n_value = 0;n_value < gen_nb_unsigned_int;n_value++) { - mem_base = xmlMemBlocks(); - value = gen_unsigned_int(n_value, 0); - - ret_val = htmlEntityValueLookup(value); - desret_const_htmlEntityDesc_ptr(ret_val); - call_tests++; - des_unsigned_int(n_value, value, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlEntityValueLookup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlHandleOmittedElem(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - int val; /* int 0 or 1 */ - int n_val; - - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_int(n_val, 0); - - ret_val = htmlHandleOmittedElem(val); - desret_int(ret_val); - call_tests++; - des_int(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlHandleOmittedElem", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlIsAutoClosed(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - htmlDocPtr doc; /* the HTML document */ - int n_doc; - htmlNodePtr elem; /* the HTML element */ - int n_elem; - - for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_htmlNodePtr;n_elem++) { - mem_base = xmlMemBlocks(); - doc = gen_htmlDocPtr(n_doc, 0); - elem = gen_htmlNodePtr(n_elem, 1); - - ret_val = htmlIsAutoClosed(doc, elem); - desret_int(ret_val); - call_tests++; - des_htmlDocPtr(n_doc, doc, 0); - des_htmlNodePtr(n_elem, elem, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlIsAutoClosed", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_elem); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlIsScriptAttribute(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - xmlChar * name; /* an attribute name */ - int n_name; - - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - name = gen_const_xmlChar_ptr(n_name, 0); - - ret_val = htmlIsScriptAttribute((const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlIsScriptAttribute", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlNewParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlParserCtxtPtr ret_val; - - mem_base = xmlMemBlocks(); - - ret_val = htmlNewParserCtxt(); - desret_htmlParserCtxtPtr(ret_val); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlNewParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlNodeStatus(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlStatus ret_val; - htmlNodePtr node; /* an htmlNodePtr in a tree */ - int n_node; - int legacy; /* whether to allow deprecated elements (YES is faster here for Element nodes) */ - int n_legacy; - - for (n_node = 0;n_node < gen_nb_const_htmlNodePtr;n_node++) { - for (n_legacy = 0;n_legacy < gen_nb_int;n_legacy++) { - mem_base = xmlMemBlocks(); - node = gen_const_htmlNodePtr(n_node, 0); - legacy = gen_int(n_legacy, 1); - - ret_val = htmlNodeStatus((const htmlNodePtr)node, legacy); - desret_htmlStatus(ret_val); - call_tests++; - des_const_htmlNodePtr(n_node, (const htmlNodePtr)node, 0); - des_int(n_legacy, legacy, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlNodeStatus", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_legacy); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlParseCharRef(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - htmlParserCtxtPtr ctxt; /* an HTML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); - - ret_val = htmlParseCharRef(ctxt); - desret_int(ret_val); - call_tests++; - des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlParseCharRef", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlParseChunk(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_PUSH_ENABLED) - int mem_base; - int ret_val; - htmlParserCtxtPtr ctxt; /* an HTML parser context */ - int n_ctxt; - char * chunk; /* an char array */ - int n_chunk; - int size; /* the size in byte of the chunk */ - int n_size; - int terminate; /* last chunk indicator */ - int n_terminate; - - for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { - for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) { - mem_base = xmlMemBlocks(); - ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); - chunk = gen_const_char_ptr(n_chunk, 1); - size = gen_int(n_size, 2); - terminate = gen_int(n_terminate, 3); - - ret_val = htmlParseChunk(ctxt, (const char *)chunk, size, terminate); - if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} - desret_int(ret_val); - call_tests++; - des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_char_ptr(n_chunk, (const char *)chunk, 1); - des_int(n_size, size, 2); - des_int(n_terminate, terminate, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlParseChunk", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_chunk); - printf(" %d", n_size); - printf(" %d", n_terminate); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlParseDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlDocPtr ret_val; - xmlChar * cur; /* a pointer to an array of xmlChar */ - int n_cur; - char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ - int n_encoding; - - for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlChar_ptr(n_cur, 0); - encoding = gen_const_char_ptr(n_encoding, 1); - - ret_val = htmlParseDoc(cur, (const char *)encoding); - desret_htmlDocPtr(ret_val); - call_tests++; - des_xmlChar_ptr(n_cur, cur, 0); - des_const_char_ptr(n_encoding, (const char *)encoding, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlParseDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlParseDocument(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - htmlParserCtxtPtr ctxt; /* an HTML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); - - ret_val = htmlParseDocument(ctxt); - if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} - desret_int(ret_val); - call_tests++; - des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlParseDocument", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlParseElement(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlParserCtxtPtr ctxt; /* an HTML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); - - htmlParseElement(ctxt); - call_tests++; - des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlParseElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlParseEntityRef(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - const htmlEntityDesc * ret_val; - htmlParserCtxtPtr ctxt; /* an HTML parser context */ - int n_ctxt; - xmlChar ** str; /* location to store the entity name */ - int n_str; - - for (n_ctxt = 0;n_ctxt < gen_nb_htmlParserCtxtPtr;n_ctxt++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr_ptr;n_str++) { - mem_base = xmlMemBlocks(); - ctxt = gen_htmlParserCtxtPtr(n_ctxt, 0); - str = gen_const_xmlChar_ptr_ptr(n_str, 1); - - ret_val = htmlParseEntityRef(ctxt, (const xmlChar **)str); - desret_const_htmlEntityDesc_ptr(ret_val); - call_tests++; - des_htmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr_ptr(n_str, (const xmlChar **)str, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlParseEntityRef", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_str); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlParseFile(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - htmlDocPtr ret_val; - const char * filename; /* the filename */ - int n_filename; - char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ - int n_encoding; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - filename = gen_filepath(n_filename, 0); - encoding = gen_const_char_ptr(n_encoding, 1); - - ret_val = htmlParseFile(filename, (const char *)encoding); - desret_htmlDocPtr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - des_const_char_ptr(n_encoding, (const char *)encoding, 1); - xmlResetLastError(); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlReadDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlDocPtr ret_val; - xmlChar * cur; /* a pointer to a zero terminated string */ - int n_cur; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of htmlParserOption(s) */ - int n_options; - - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - cur = gen_const_xmlChar_ptr(n_cur, 0); - URL = gen_filepath(n_URL, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - options = gen_int(n_options, 3); - - ret_val = htmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options); - desret_htmlDocPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); - des_filepath(n_URL, URL, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_int(n_options, options, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlReadDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlReadFile(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlDocPtr ret_val; - const char * filename; /* a file or URL */ - int n_filename; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of htmlParserOption(s) */ - int n_options; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - encoding = gen_const_char_ptr(n_encoding, 1); - options = gen_int(n_options, 2); - - ret_val = htmlReadFile(filename, (const char *)encoding, options); - desret_htmlDocPtr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - des_const_char_ptr(n_encoding, (const char *)encoding, 1); - des_int(n_options, options, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlReadFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlReadMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlDocPtr ret_val; - char * buffer; /* a pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of htmlParserOption(s) */ - int n_options; - - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - buffer = gen_const_char_ptr(n_buffer, 0); - size = gen_int(n_size, 1); - URL = gen_filepath(n_URL, 2); - encoding = gen_const_char_ptr(n_encoding, 3); - options = gen_int(n_options, 4); - - ret_val = htmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options); - desret_htmlDocPtr(ret_val); - call_tests++; - des_const_char_ptr(n_buffer, (const char *)buffer, 0); - des_int(n_size, size, 1); - des_filepath(n_URL, URL, 2); - des_const_char_ptr(n_encoding, (const char *)encoding, 3); - des_int(n_options, options, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlReadMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_size); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlSAXParseDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlDocPtr ret_val; - xmlChar * cur; /* a pointer to an array of xmlChar */ - int n_cur; - char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ - int n_encoding; - htmlSAXHandlerPtr sax; /* the SAX handler block */ - int n_sax; - void * userData; /* if using SAX, this pointer will be provided on callbacks. */ - int n_userData; - - for (n_cur = 0;n_cur < gen_nb_xmlChar_ptr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) { - for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlChar_ptr(n_cur, 0); - encoding = gen_const_char_ptr(n_encoding, 1); - sax = gen_htmlSAXHandlerPtr(n_sax, 2); - userData = gen_userdata(n_userData, 3); - - ret_val = htmlSAXParseDoc(cur, (const char *)encoding, sax, userData); - desret_htmlDocPtr(ret_val); - call_tests++; - des_xmlChar_ptr(n_cur, cur, 0); - des_const_char_ptr(n_encoding, (const char *)encoding, 1); - des_htmlSAXHandlerPtr(n_sax, sax, 2); - des_userdata(n_userData, userData, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlSAXParseDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf(" %d", n_sax); - printf(" %d", n_userData); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlSAXParseFile(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlDocPtr ret_val; - const char * filename; /* the filename */ - int n_filename; - char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ - int n_encoding; - htmlSAXHandlerPtr sax; /* the SAX handler block */ - int n_sax; - void * userData; /* if using SAX, this pointer will be provided on callbacks. */ - int n_userData; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_sax = 0;n_sax < gen_nb_htmlSAXHandlerPtr;n_sax++) { - for (n_userData = 0;n_userData < gen_nb_userdata;n_userData++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - encoding = gen_const_char_ptr(n_encoding, 1); - sax = gen_htmlSAXHandlerPtr(n_sax, 2); - userData = gen_userdata(n_userData, 3); - - ret_val = htmlSAXParseFile(filename, (const char *)encoding, sax, userData); - desret_htmlDocPtr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - des_const_char_ptr(n_encoding, (const char *)encoding, 1); - des_htmlSAXHandlerPtr(n_sax, sax, 2); - des_userdata(n_userData, userData, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlSAXParseFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_encoding); - printf(" %d", n_sax); - printf(" %d", n_userData); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlTagLookup(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -static int -test_HTMLparser(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing HTMLparser : 32 of 38 functions ...\n"); - test_ret += test_UTF8ToHtml(); - test_ret += test_htmlAttrAllowed(); - test_ret += test_htmlAutoCloseTag(); - test_ret += test_htmlCreateMemoryParserCtxt(); - test_ret += test_htmlCreatePushParserCtxt(); - test_ret += test_htmlCtxtReadDoc(); - test_ret += test_htmlCtxtReadFile(); - test_ret += test_htmlCtxtReadMemory(); - test_ret += test_htmlCtxtReset(); - test_ret += test_htmlCtxtUseOptions(); - test_ret += test_htmlElementAllowedHere(); - test_ret += test_htmlElementStatusHere(); - test_ret += test_htmlEncodeEntities(); - test_ret += test_htmlEntityLookup(); - test_ret += test_htmlEntityValueLookup(); - test_ret += test_htmlHandleOmittedElem(); - test_ret += test_htmlIsAutoClosed(); - test_ret += test_htmlIsScriptAttribute(); - test_ret += test_htmlNewParserCtxt(); - test_ret += test_htmlNodeStatus(); - test_ret += test_htmlParseCharRef(); - test_ret += test_htmlParseChunk(); - test_ret += test_htmlParseDoc(); - test_ret += test_htmlParseDocument(); - test_ret += test_htmlParseElement(); - test_ret += test_htmlParseEntityRef(); - test_ret += test_htmlParseFile(); - test_ret += test_htmlReadDoc(); - test_ret += test_htmlReadFile(); - test_ret += test_htmlReadMemory(); - test_ret += test_htmlSAXParseDoc(); - test_ret += test_htmlSAXParseFile(); - test_ret += test_htmlTagLookup(); - - if (test_ret != 0) - printf("Module HTMLparser: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_htmlDocContentDumpFormatOutput(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlOutputBufferPtr buf; /* the HTML buffer output */ - int n_buf; - xmlDocPtr cur; /* the document */ - int n_cur; - char * encoding; /* the encoding string */ - int n_encoding; - int format; /* should formatting spaces been added */ - int n_format; - - for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlOutputBufferPtr(n_buf, 0); - cur = gen_xmlDocPtr(n_cur, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - format = gen_int(n_format, 3); - - htmlDocContentDumpFormatOutput(buf, cur, (const char *)encoding, format); - call_tests++; - des_xmlOutputBufferPtr(n_buf, buf, 0); - des_xmlDocPtr(n_cur, cur, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_int(n_format, format, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlDocContentDumpFormatOutput", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlDocContentDumpOutput(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlOutputBufferPtr buf; /* the HTML buffer output */ - int n_buf; - xmlDocPtr cur; /* the document */ - int n_cur; - char * encoding; /* the encoding string */ - int n_encoding; - - for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlOutputBufferPtr(n_buf, 0); - cur = gen_xmlDocPtr(n_cur, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - - htmlDocContentDumpOutput(buf, cur, (const char *)encoding); - call_tests++; - des_xmlOutputBufferPtr(n_buf, buf, 0); - des_xmlDocPtr(n_cur, cur, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlDocContentDumpOutput", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlDocDump(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - FILE * f; /* the FILE* */ - int n_f; - xmlDocPtr cur; /* the document */ - int n_cur; - - for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - mem_base = xmlMemBlocks(); - f = gen_FILE_ptr(n_f, 0); - cur = gen_xmlDocPtr(n_cur, 1); - - ret_val = htmlDocDump(f, cur); - desret_int(ret_val); - call_tests++; - des_FILE_ptr(n_f, f, 0); - des_xmlDocPtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlDocDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_f); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -#define gen_nb_xmlChar_ptr_ptr 1 -static xmlChar ** gen_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlChar_ptr_ptr(int no ATTRIBUTE_UNUSED, xmlChar ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_htmlDocDumpMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlDocPtr cur; /* the document */ - int n_cur; - xmlChar ** mem; /* OUT: the memory pointer */ - int n_mem; - int * size; /* OUT: the memory length */ - int n_size; - - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { - for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlDocPtr(n_cur, 0); - mem = gen_xmlChar_ptr_ptr(n_mem, 1); - size = gen_int_ptr(n_size, 2); - - htmlDocDumpMemory(cur, mem, size); - call_tests++; - des_xmlDocPtr(n_cur, cur, 0); - des_xmlChar_ptr_ptr(n_mem, mem, 1); - des_int_ptr(n_size, size, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlDocDumpMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_mem); - printf(" %d", n_size); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlDocDumpMemoryFormat(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlDocPtr cur; /* the document */ - int n_cur; - xmlChar ** mem; /* OUT: the memory pointer */ - int n_mem; - int * size; /* OUT: the memory length */ - int n_size; - int format; /* should formatting spaces been added */ - int n_format; - - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { - for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlDocPtr(n_cur, 0); - mem = gen_xmlChar_ptr_ptr(n_mem, 1); - size = gen_int_ptr(n_size, 2); - format = gen_int(n_format, 3); - - htmlDocDumpMemoryFormat(cur, mem, size, format); - call_tests++; - des_xmlDocPtr(n_cur, cur, 0); - des_xmlChar_ptr_ptr(n_mem, mem, 1); - des_int_ptr(n_size, size, 2); - des_int(n_format, format, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlDocDumpMemoryFormat", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_mem); - printf(" %d", n_size); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlGetMetaEncoding(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - const xmlChar * ret_val; - htmlDocPtr doc; /* the document */ - int n_doc; - - for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - doc = gen_htmlDocPtr(n_doc, 0); - - ret_val = htmlGetMetaEncoding(doc); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_htmlDocPtr(n_doc, doc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlGetMetaEncoding", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlIsBooleanAttr(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - xmlChar * name; /* the name of the attribute to check */ - int n_name; - - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - name = gen_const_xmlChar_ptr(n_name, 0); - - ret_val = htmlIsBooleanAttr((const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlIsBooleanAttr", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlNewDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlDocPtr ret_val; - xmlChar * URI; /* URI for the dtd, or NULL */ - int n_URI; - xmlChar * ExternalID; /* the external ID of the DTD, or NULL */ - int n_ExternalID; - - for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - mem_base = xmlMemBlocks(); - URI = gen_const_xmlChar_ptr(n_URI, 0); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1); - - ret_val = htmlNewDoc((const xmlChar *)URI, (const xmlChar *)ExternalID); - desret_htmlDocPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlNewDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URI); - printf(" %d", n_ExternalID); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlNewDocNoDtD(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlDocPtr ret_val; - xmlChar * URI; /* URI for the dtd, or NULL */ - int n_URI; - xmlChar * ExternalID; /* the external ID of the DTD, or NULL */ - int n_ExternalID; - - for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - mem_base = xmlMemBlocks(); - URI = gen_const_xmlChar_ptr(n_URI, 0); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1); - - ret_val = htmlNewDocNoDtD((const xmlChar *)URI, (const xmlChar *)ExternalID); - desret_htmlDocPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlNewDocNoDtD", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URI); - printf(" %d", n_ExternalID); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlNodeDump(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlBufferPtr buf; /* the HTML buffer output */ - int n_buf; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr cur; /* the current node */ - int n_cur; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - doc = gen_xmlDocPtr(n_doc, 1); - cur = gen_xmlNodePtr(n_cur, 2); - - ret_val = htmlNodeDump(buf, doc, cur); - desret_int(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_cur, cur, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlNodeDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_doc); - printf(" %d", n_cur); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlNodeDumpFile(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - FILE * out; /* the FILE pointer */ - int n_out; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr cur; /* the current node */ - int n_cur; - - for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - out = gen_FILE_ptr(n_out, 0); - doc = gen_xmlDocPtr(n_doc, 1); - cur = gen_xmlNodePtr(n_cur, 2); - - htmlNodeDumpFile(out, doc, cur); - call_tests++; - des_FILE_ptr(n_out, out, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_cur, cur, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlNodeDumpFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_doc); - printf(" %d", n_cur); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlNodeDumpFileFormat(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - FILE * out; /* the FILE pointer */ - int n_out; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr cur; /* the current node */ - int n_cur; - char * encoding; /* the document encoding */ - int n_encoding; - int format; /* should formatting spaces been added */ - int n_format; - - for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - out = gen_FILE_ptr(n_out, 0); - doc = gen_xmlDocPtr(n_doc, 1); - cur = gen_xmlNodePtr(n_cur, 2); - encoding = gen_const_char_ptr(n_encoding, 3); - format = gen_int(n_format, 4); - - ret_val = htmlNodeDumpFileFormat(out, doc, cur, (const char *)encoding, format); - desret_int(ret_val); - call_tests++; - des_FILE_ptr(n_out, out, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_cur, cur, 2); - des_const_char_ptr(n_encoding, (const char *)encoding, 3); - des_int(n_format, format, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlNodeDumpFileFormat", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_doc); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlNodeDumpFormatOutput(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlOutputBufferPtr buf; /* the HTML buffer output */ - int n_buf; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr cur; /* the current node */ - int n_cur; - char * encoding; /* the encoding string */ - int n_encoding; - int format; /* should formatting spaces been added */ - int n_format; - - for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlOutputBufferPtr(n_buf, 0); - doc = gen_xmlDocPtr(n_doc, 1); - cur = gen_xmlNodePtr(n_cur, 2); - encoding = gen_const_char_ptr(n_encoding, 3); - format = gen_int(n_format, 4); - - htmlNodeDumpFormatOutput(buf, doc, cur, (const char *)encoding, format); - call_tests++; - des_xmlOutputBufferPtr(n_buf, buf, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_cur, cur, 2); - des_const_char_ptr(n_encoding, (const char *)encoding, 3); - des_int(n_format, format, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlNodeDumpFormatOutput", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_doc); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlNodeDumpOutput(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlOutputBufferPtr buf; /* the HTML buffer output */ - int n_buf; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr cur; /* the current node */ - int n_cur; - char * encoding; /* the encoding string */ - int n_encoding; - - for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlOutputBufferPtr(n_buf, 0); - doc = gen_xmlDocPtr(n_doc, 1); - cur = gen_xmlNodePtr(n_cur, 2); - encoding = gen_const_char_ptr(n_encoding, 3); - - htmlNodeDumpOutput(buf, doc, cur, (const char *)encoding); - call_tests++; - des_xmlOutputBufferPtr(n_buf, buf, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_cur, cur, 2); - des_const_char_ptr(n_encoding, (const char *)encoding, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlNodeDumpOutput", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_doc); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlSaveFile(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - const char * filename; /* the filename (or URL) */ - int n_filename; - xmlDocPtr cur; /* the document */ - int n_cur; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - cur = gen_xmlDocPtr(n_cur, 1); - - ret_val = htmlSaveFile(filename, cur); - desret_int(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - des_xmlDocPtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlSaveFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlSaveFileEnc(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - const char * filename; /* the filename */ - int n_filename; - xmlDocPtr cur; /* the document */ - int n_cur; - char * encoding; /* the document encoding */ - int n_encoding; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - cur = gen_xmlDocPtr(n_cur, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - - ret_val = htmlSaveFileEnc(filename, cur, (const char *)encoding); - desret_int(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - des_xmlDocPtr(n_cur, cur, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlSaveFileEnc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlSaveFileFormat(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - const char * filename; /* the filename */ - int n_filename; - xmlDocPtr cur; /* the document */ - int n_cur; - char * encoding; /* the document encoding */ - int n_encoding; - int format; /* should formatting spaces been added */ - int n_format; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - cur = gen_xmlDocPtr(n_cur, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - format = gen_int(n_format, 3); - - ret_val = htmlSaveFileFormat(filename, cur, (const char *)encoding, format); - desret_int(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - des_xmlDocPtr(n_cur, cur, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_int(n_format, format, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlSaveFileFormat", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlSetMetaEncoding(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - int ret_val; - htmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * encoding; /* the encoding string */ - int n_encoding; - - for (n_doc = 0;n_doc < gen_nb_htmlDocPtr;n_doc++) { - for (n_encoding = 0;n_encoding < gen_nb_const_xmlChar_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - doc = gen_htmlDocPtr(n_doc, 0); - encoding = gen_const_xmlChar_ptr(n_encoding, 1); - - ret_val = htmlSetMetaEncoding(doc, (const xmlChar *)encoding); - desret_int(ret_val); - call_tests++; - des_htmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_encoding, (const xmlChar *)encoding, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlSetMetaEncoding", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_HTMLtree(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing HTMLtree : 18 of 18 functions ...\n"); - test_ret += test_htmlDocContentDumpFormatOutput(); - test_ret += test_htmlDocContentDumpOutput(); - test_ret += test_htmlDocDump(); - test_ret += test_htmlDocDumpMemory(); - test_ret += test_htmlDocDumpMemoryFormat(); - test_ret += test_htmlGetMetaEncoding(); - test_ret += test_htmlIsBooleanAttr(); - test_ret += test_htmlNewDoc(); - test_ret += test_htmlNewDocNoDtD(); - test_ret += test_htmlNodeDump(); - test_ret += test_htmlNodeDumpFile(); - test_ret += test_htmlNodeDumpFileFormat(); - test_ret += test_htmlNodeDumpFormatOutput(); - test_ret += test_htmlNodeDumpOutput(); - test_ret += test_htmlSaveFile(); - test_ret += test_htmlSaveFileEnc(); - test_ret += test_htmlSaveFileFormat(); - test_ret += test_htmlSetMetaEncoding(); - - if (test_ret != 0) - printf("Module HTMLtree: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_docbDefaultSAXHandlerInit(void) { - int test_ret = 0; - -#if defined(LIBXML_DOCB_ENABLED) -#ifdef LIBXML_DOCB_ENABLED - int mem_base; - - mem_base = xmlMemBlocks(); - - docbDefaultSAXHandlerInit(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in docbDefaultSAXHandlerInit", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_htmlDefaultSAXHandlerInit(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) -#ifdef LIBXML_HTML_ENABLED - int mem_base; - - mem_base = xmlMemBlocks(); - - htmlDefaultSAXHandlerInit(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlDefaultSAXHandlerInit", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlDefaultSAXHandlerInit(void) { - int test_ret = 0; - - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlDefaultSAXHandlerInit(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDefaultSAXHandlerInit", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlEnumerationPtr 1 -static xmlEnumerationPtr gen_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlEnumerationPtr(int no ATTRIBUTE_UNUSED, xmlEnumerationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlSAX2AttributeDecl(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * elem; /* the name of the element */ - int n_elem; - xmlChar * fullname; /* the attribute name */ - int n_fullname; - int type; /* the attribute type */ - int n_type; - int def; /* the type of default value */ - int n_def; - xmlChar * defaultValue; /* the attribute default value */ - int n_defaultValue; - xmlEnumerationPtr tree; /* the tree of enumerated value set */ - int n_tree; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { - for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) { - for (n_type = 0;n_type < gen_nb_int;n_type++) { - for (n_def = 0;n_def < gen_nb_int;n_def++) { - for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) { - for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - elem = gen_const_xmlChar_ptr(n_elem, 1); - fullname = gen_const_xmlChar_ptr(n_fullname, 2); - type = gen_int(n_type, 3); - def = gen_int(n_def, 4); - defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 5); - tree = gen_xmlEnumerationPtr(n_tree, 6); - - xmlSAX2AttributeDecl(ctx, (const xmlChar *)elem, (const xmlChar *)fullname, type, def, (const xmlChar *)defaultValue, tree); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1); - des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 2); - des_int(n_type, type, 3); - des_int(n_def, def, 4); - des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 5); - des_xmlEnumerationPtr(n_tree, tree, 6); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2AttributeDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_elem); - printf(" %d", n_fullname); - printf(" %d", n_type); - printf(" %d", n_def); - printf(" %d", n_defaultValue); - printf(" %d", n_tree); - printf("\n"); - } - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2CDataBlock(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * value; /* The pcdata content */ - int n_value; - int len; /* the block length */ - int n_len; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - len = gen_int(n_len, 2); - - xmlSAX2CDataBlock(ctx, (const xmlChar *)value, len); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2CDataBlock", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_value); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2Characters(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * ch; /* a xmlChar string */ - int n_ch; - int len; /* the number of xmlChar */ - int n_len; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - ch = gen_const_xmlChar_ptr(n_ch, 1); - len = gen_int(n_len, 2); - - xmlSAX2Characters(ctx, (const xmlChar *)ch, len); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2Characters", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_ch); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2Comment(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * value; /* the xmlSAX2Comment content */ - int n_value; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - - xmlSAX2Comment(ctx, (const xmlChar *)value); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2Comment", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2ElementDecl(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * name; /* the element name */ - int n_name; - int type; /* the element type */ - int n_type; - xmlElementContentPtr content; /* the element value tree */ - int n_content; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_type = 0;n_type < gen_nb_int;n_type++) { - for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - type = gen_int(n_type, 2); - content = gen_xmlElementContentPtr(n_content, 3); - - xmlSAX2ElementDecl(ctx, (const xmlChar *)name, type, content); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_int(n_type, type, 2); - des_xmlElementContentPtr(n_content, content, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2ElementDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_name); - printf(" %d", n_type); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2EndDocument(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - - xmlSAX2EndDocument(ctx); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2EndDocument", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2EndElement(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * name; /* The element name */ - int n_name; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - xmlSAX2EndElement(ctx, (const xmlChar *)name); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2EndElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAX2EndElementNs(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * localname; /* the local name of the element */ - int n_localname; - xmlChar * prefix; /* the element namespace prefix if available */ - int n_prefix; - xmlChar * URI; /* the element namespace name if available */ - int n_URI; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - localname = gen_const_xmlChar_ptr(n_localname, 1); - prefix = gen_const_xmlChar_ptr(n_prefix, 2); - URI = gen_const_xmlChar_ptr(n_URI, 3); - - xmlSAX2EndElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); - des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2EndElementNs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_localname); - printf(" %d", n_prefix); - printf(" %d", n_URI); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2EntityDecl(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * name; /* the entity name */ - int n_name; - int type; /* the entity type */ - int n_type; - xmlChar * publicId; /* The public ID of the entity */ - int n_publicId; - xmlChar * systemId; /* The system ID of the entity */ - int n_systemId; - xmlChar * content; /* the entity value (without processing). */ - int n_content; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_type = 0;n_type < gen_nb_int;n_type++) { - for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { - for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { - for (n_content = 0;n_content < gen_nb_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - type = gen_int(n_type, 2); - publicId = gen_const_xmlChar_ptr(n_publicId, 3); - systemId = gen_const_xmlChar_ptr(n_systemId, 4); - content = gen_xmlChar_ptr(n_content, 5); - - xmlSAX2EntityDecl(ctx, (const xmlChar *)name, type, (const xmlChar *)publicId, (const xmlChar *)systemId, content); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_int(n_type, type, 2); - des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 3); - des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 4); - des_xmlChar_ptr(n_content, content, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2EntityDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_name); - printf(" %d", n_type); - printf(" %d", n_publicId); - printf(" %d", n_systemId); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2ExternalSubset(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * name; /* the root element name */ - int n_name; - xmlChar * ExternalID; /* the external ID */ - int n_ExternalID; - xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */ - int n_SystemID; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); - SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); - - xmlSAX2ExternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); - des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2ExternalSubset", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_name); - printf(" %d", n_ExternalID); - printf(" %d", n_SystemID); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2GetColumnNumber(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - - ret_val = xmlSAX2GetColumnNumber(ctx); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2GetColumnNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2GetEntity(void) { - int test_ret = 0; - - int mem_base; - xmlEntityPtr ret_val; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * name; /* The entity name */ - int n_name; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlSAX2GetEntity(ctx, (const xmlChar *)name); - desret_xmlEntityPtr(ret_val); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2GetEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2GetLineNumber(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - - ret_val = xmlSAX2GetLineNumber(ctx); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2GetLineNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2GetParameterEntity(void) { - int test_ret = 0; - - int mem_base; - xmlEntityPtr ret_val; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * name; /* The entity name */ - int n_name; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlSAX2GetParameterEntity(ctx, (const xmlChar *)name); - desret_xmlEntityPtr(ret_val); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2GetParameterEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2GetPublicId(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - - ret_val = xmlSAX2GetPublicId(ctx); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2GetPublicId", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2GetSystemId(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - - ret_val = xmlSAX2GetSystemId(ctx); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2GetSystemId", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2HasExternalSubset(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - - ret_val = xmlSAX2HasExternalSubset(ctx); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2HasExternalSubset", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2HasInternalSubset(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - - ret_val = xmlSAX2HasInternalSubset(ctx); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2HasInternalSubset", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2IgnorableWhitespace(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * ch; /* a xmlChar string */ - int n_ch; - int len; /* the number of xmlChar */ - int n_len; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_ch = 0;n_ch < gen_nb_const_xmlChar_ptr;n_ch++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - ch = gen_const_xmlChar_ptr(n_ch, 1); - len = gen_int(n_len, 2); - - xmlSAX2IgnorableWhitespace(ctx, (const xmlChar *)ch, len); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_ch, (const xmlChar *)ch, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2IgnorableWhitespace", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_ch); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlSAXHandler_ptr 1 -static xmlSAXHandler * gen_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSAXHandler_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlSAX2InitDefaultSAXHandler(void) { - int test_ret = 0; - - int mem_base; - xmlSAXHandler * hdlr; /* the SAX handler */ - int n_hdlr; - int warning; /* flag if non-zero sets the handler warning procedure */ - int n_warning; - - for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { - for (n_warning = 0;n_warning < gen_nb_int;n_warning++) { - mem_base = xmlMemBlocks(); - hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); - warning = gen_int(n_warning, 1); - - xmlSAX2InitDefaultSAXHandler(hdlr, warning); - call_tests++; - des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); - des_int(n_warning, warning, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2InitDefaultSAXHandler", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_hdlr); - printf(" %d", n_warning); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2InitDocbDefaultSAXHandler(void) { - int test_ret = 0; - -#if defined(LIBXML_DOCB_ENABLED) - int mem_base; - xmlSAXHandler * hdlr; /* the SAX handler */ - int n_hdlr; - - for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { - mem_base = xmlMemBlocks(); - hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); - - xmlSAX2InitDocbDefaultSAXHandler(hdlr); - call_tests++; - des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2InitDocbDefaultSAXHandler", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_hdlr); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSAX2InitHtmlDefaultSAXHandler(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - xmlSAXHandler * hdlr; /* the SAX handler */ - int n_hdlr; - - for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { - mem_base = xmlMemBlocks(); - hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); - - xmlSAX2InitHtmlDefaultSAXHandler(hdlr); - call_tests++; - des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2InitHtmlDefaultSAXHandler", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_hdlr); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSAX2InternalSubset(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * name; /* the root element name */ - int n_name; - xmlChar * ExternalID; /* the external ID */ - int n_ExternalID; - xmlChar * SystemID; /* the SYSTEM ID (e.g. filename or URL) */ - int n_SystemID; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); - SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); - - xmlSAX2InternalSubset(ctx, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); - des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2InternalSubset", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_name); - printf(" %d", n_ExternalID); - printf(" %d", n_SystemID); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2IsStandalone(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - - ret_val = xmlSAX2IsStandalone(ctx); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2IsStandalone", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2NotationDecl(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * name; /* The name of the notation */ - int n_name; - xmlChar * publicId; /* The public ID of the entity */ - int n_publicId; - xmlChar * systemId; /* The system ID of the entity */ - int n_systemId; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { - for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - publicId = gen_const_xmlChar_ptr(n_publicId, 2); - systemId = gen_const_xmlChar_ptr(n_systemId, 3); - - xmlSAX2NotationDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2); - des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2NotationDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_name); - printf(" %d", n_publicId); - printf(" %d", n_systemId); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2ProcessingInstruction(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * target; /* the target name */ - int n_target; - xmlChar * data; /* the PI data's */ - int n_data; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) { - for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - target = gen_const_xmlChar_ptr(n_target, 1); - data = gen_const_xmlChar_ptr(n_data, 2); - - xmlSAX2ProcessingInstruction(ctx, (const xmlChar *)target, (const xmlChar *)data); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1); - des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2ProcessingInstruction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_target); - printf(" %d", n_data); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2Reference(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * name; /* The entity name */ - int n_name; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - xmlSAX2Reference(ctx, (const xmlChar *)name); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2Reference", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2ResolveEntity(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * publicId; /* The public ID of the entity */ - int n_publicId; - xmlChar * systemId; /* The system ID of the entity */ - int n_systemId; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { - for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - publicId = gen_const_xmlChar_ptr(n_publicId, 1); - systemId = gen_const_xmlChar_ptr(n_systemId, 2); - - ret_val = xmlSAX2ResolveEntity(ctx, (const xmlChar *)publicId, (const xmlChar *)systemId); - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 1); - des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2ResolveEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_publicId); - printf(" %d", n_systemId); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlSAXLocatorPtr 1 -static xmlSAXLocatorPtr gen_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSAXLocatorPtr(int no ATTRIBUTE_UNUSED, xmlSAXLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlSAX2SetDocumentLocator(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlSAXLocatorPtr loc; /* A SAX Locator */ - int n_loc; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_loc = 0;n_loc < gen_nb_xmlSAXLocatorPtr;n_loc++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - loc = gen_xmlSAXLocatorPtr(n_loc, 1); - - xmlSAX2SetDocumentLocator(ctx, loc); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_xmlSAXLocatorPtr(n_loc, loc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2SetDocumentLocator", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_loc); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2StartDocument(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - - xmlSAX2StartDocument(ctx); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2StartDocument", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2StartElement(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * fullname; /* The element name, including namespace prefix */ - int n_fullname; - xmlChar ** atts; /* An array of name/value attributes pairs, NULL terminated */ - int n_atts; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_fullname = 0;n_fullname < gen_nb_const_xmlChar_ptr;n_fullname++) { - for (n_atts = 0;n_atts < gen_nb_const_xmlChar_ptr_ptr;n_atts++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - fullname = gen_const_xmlChar_ptr(n_fullname, 1); - atts = gen_const_xmlChar_ptr_ptr(n_atts, 2); - - xmlSAX2StartElement(ctx, (const xmlChar *)fullname, (const xmlChar **)atts); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_fullname, (const xmlChar *)fullname, 1); - des_const_xmlChar_ptr_ptr(n_atts, (const xmlChar **)atts, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2StartElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_fullname); - printf(" %d", n_atts); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAX2StartElementNs(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * localname; /* the local name of the element */ - int n_localname; - xmlChar * prefix; /* the element namespace prefix if available */ - int n_prefix; - xmlChar * URI; /* the element namespace name if available */ - int n_URI; - int nb_namespaces; /* number of namespace definitions on that node */ - int n_nb_namespaces; - xmlChar ** namespaces; /* pointer to the array of prefix/URI pairs namespace definitions */ - int n_namespaces; - int nb_attributes; /* the number of attributes on that node */ - int n_nb_attributes; - int nb_defaulted; /* the number of defaulted attributes. */ - int n_nb_defaulted; - xmlChar ** attributes; /* pointer to the array of (localname/prefix/URI/value/end) attribute values. */ - int n_attributes; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_localname = 0;n_localname < gen_nb_const_xmlChar_ptr;n_localname++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { - for (n_nb_namespaces = 0;n_nb_namespaces < gen_nb_int;n_nb_namespaces++) { - for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) { - for (n_nb_attributes = 0;n_nb_attributes < gen_nb_int;n_nb_attributes++) { - for (n_nb_defaulted = 0;n_nb_defaulted < gen_nb_int;n_nb_defaulted++) { - for (n_attributes = 0;n_attributes < gen_nb_const_xmlChar_ptr_ptr;n_attributes++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - localname = gen_const_xmlChar_ptr(n_localname, 1); - prefix = gen_const_xmlChar_ptr(n_prefix, 2); - URI = gen_const_xmlChar_ptr(n_URI, 3); - nb_namespaces = gen_int(n_nb_namespaces, 4); - namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 5); - nb_attributes = gen_int(n_nb_attributes, 6); - nb_defaulted = gen_int(n_nb_defaulted, 7); - attributes = gen_const_xmlChar_ptr_ptr(n_attributes, 8); - - xmlSAX2StartElementNs(ctx, (const xmlChar *)localname, (const xmlChar *)prefix, (const xmlChar *)URI, nb_namespaces, (const xmlChar **)namespaces, nb_attributes, nb_defaulted, (const xmlChar **)attributes); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_localname, (const xmlChar *)localname, 1); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); - des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 3); - des_int(n_nb_namespaces, nb_namespaces, 4); - des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 5); - des_int(n_nb_attributes, nb_attributes, 6); - des_int(n_nb_defaulted, nb_defaulted, 7); - des_const_xmlChar_ptr_ptr(n_attributes, (const xmlChar **)attributes, 8); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2StartElementNs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_localname); - printf(" %d", n_prefix); - printf(" %d", n_URI); - printf(" %d", n_nb_namespaces); - printf(" %d", n_namespaces); - printf(" %d", n_nb_attributes); - printf(" %d", n_nb_defaulted); - printf(" %d", n_attributes); - printf("\n"); - } - } - } - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAX2UnparsedEntityDecl(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* the user data (XML parser context) */ - int n_ctx; - xmlChar * name; /* The name of the entity */ - int n_name; - xmlChar * publicId; /* The public ID of the entity */ - int n_publicId; - xmlChar * systemId; /* The system ID of the entity */ - int n_systemId; - xmlChar * notationName; /* the name of the notation */ - int n_notationName; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_publicId = 0;n_publicId < gen_nb_const_xmlChar_ptr;n_publicId++) { - for (n_systemId = 0;n_systemId < gen_nb_const_xmlChar_ptr;n_systemId++) { - for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - publicId = gen_const_xmlChar_ptr(n_publicId, 2); - systemId = gen_const_xmlChar_ptr(n_systemId, 3); - notationName = gen_const_xmlChar_ptr(n_notationName, 4); - - xmlSAX2UnparsedEntityDecl(ctx, (const xmlChar *)name, (const xmlChar *)publicId, (const xmlChar *)systemId, (const xmlChar *)notationName); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_publicId, (const xmlChar *)publicId, 2); - des_const_xmlChar_ptr(n_systemId, (const xmlChar *)systemId, 3); - des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAX2UnparsedEntityDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_name); - printf(" %d", n_publicId); - printf(" %d", n_systemId); - printf(" %d", n_notationName); - printf("\n"); - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSAXDefaultVersion(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - int ret_val; - int version; /* the version, 1 or 2 */ - int n_version; - - for (n_version = 0;n_version < gen_nb_int;n_version++) { - mem_base = xmlMemBlocks(); - version = gen_int(n_version, 0); - - ret_val = xmlSAXDefaultVersion(version); - desret_int(ret_val); - call_tests++; - des_int(n_version, version, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXDefaultVersion", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_version); - printf("\n"); - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAXVersion(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlSAXHandler * hdlr; /* the SAX handler */ - int n_hdlr; - int version; /* the version, 1 or 2 */ - int n_version; - - for (n_hdlr = 0;n_hdlr < gen_nb_xmlSAXHandler_ptr;n_hdlr++) { - for (n_version = 0;n_version < gen_nb_int;n_version++) { - mem_base = xmlMemBlocks(); - hdlr = gen_xmlSAXHandler_ptr(n_hdlr, 0); - version = gen_int(n_version, 1); - - ret_val = xmlSAXVersion(hdlr, version); - desret_int(ret_val); - call_tests++; - des_xmlSAXHandler_ptr(n_hdlr, hdlr, 0); - des_int(n_version, version, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXVersion", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_hdlr); - printf(" %d", n_version); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - -static int -test_SAX2(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing SAX2 : 38 of 38 functions ...\n"); - test_ret += test_docbDefaultSAXHandlerInit(); - test_ret += test_htmlDefaultSAXHandlerInit(); - test_ret += test_xmlDefaultSAXHandlerInit(); - test_ret += test_xmlSAX2AttributeDecl(); - test_ret += test_xmlSAX2CDataBlock(); - test_ret += test_xmlSAX2Characters(); - test_ret += test_xmlSAX2Comment(); - test_ret += test_xmlSAX2ElementDecl(); - test_ret += test_xmlSAX2EndDocument(); - test_ret += test_xmlSAX2EndElement(); - test_ret += test_xmlSAX2EndElementNs(); - test_ret += test_xmlSAX2EntityDecl(); - test_ret += test_xmlSAX2ExternalSubset(); - test_ret += test_xmlSAX2GetColumnNumber(); - test_ret += test_xmlSAX2GetEntity(); - test_ret += test_xmlSAX2GetLineNumber(); - test_ret += test_xmlSAX2GetParameterEntity(); - test_ret += test_xmlSAX2GetPublicId(); - test_ret += test_xmlSAX2GetSystemId(); - test_ret += test_xmlSAX2HasExternalSubset(); - test_ret += test_xmlSAX2HasInternalSubset(); - test_ret += test_xmlSAX2IgnorableWhitespace(); - test_ret += test_xmlSAX2InitDefaultSAXHandler(); - test_ret += test_xmlSAX2InitDocbDefaultSAXHandler(); - test_ret += test_xmlSAX2InitHtmlDefaultSAXHandler(); - test_ret += test_xmlSAX2InternalSubset(); - test_ret += test_xmlSAX2IsStandalone(); - test_ret += test_xmlSAX2NotationDecl(); - test_ret += test_xmlSAX2ProcessingInstruction(); - test_ret += test_xmlSAX2Reference(); - test_ret += test_xmlSAX2ResolveEntity(); - test_ret += test_xmlSAX2SetDocumentLocator(); - test_ret += test_xmlSAX2StartDocument(); - test_ret += test_xmlSAX2StartElement(); - test_ret += test_xmlSAX2StartElementNs(); - test_ret += test_xmlSAX2UnparsedEntityDecl(); - test_ret += test_xmlSAXDefaultVersion(); - test_ret += test_xmlSAXVersion(); - - if (test_ret != 0) - printf("Module SAX2: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlC14NDocDumpMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlDocPtr doc; /* the XML document for canonization */ - int n_doc; - xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */ - int n_nodes; - int mode; /* the c14n mode (see @xmlC14NMode) */ - int n_mode; - xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */ - int n_inclusive_ns_prefixes; - int with_comments; /* include comments in the result (!=0) or not (==0) */ - int n_with_comments; - xmlChar ** doc_txt_ptr; /* the memory pointer for allocated canonical XML text; the caller of this functions is responsible for calling xmlFree() to free allocated memory */ - int n_doc_txt_ptr; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { - for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { - for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) { - for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) { - for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - nodes = gen_xmlNodeSetPtr(n_nodes, 1); - mode = gen_int(n_mode, 2); - inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3); - with_comments = gen_int(n_with_comments, 4); - doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 5); - - ret_val = xmlC14NDocDumpMemory(doc, nodes, mode, inclusive_ns_prefixes, with_comments, doc_txt_ptr); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodeSetPtr(n_nodes, nodes, 1); - des_int(n_mode, mode, 2); - des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3); - des_int(n_with_comments, with_comments, 4); - des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlC14NDocDumpMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_nodes); - printf(" %d", n_mode); - printf(" %d", n_inclusive_ns_prefixes); - printf(" %d", n_with_comments); - printf(" %d", n_doc_txt_ptr); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlC14NDocSave(void) { - int test_ret = 0; - -#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlDocPtr doc; /* the XML document for canonization */ - int n_doc; - xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */ - int n_nodes; - int mode; /* the c14n mode (see @xmlC14NMode) */ - int n_mode; - xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */ - int n_inclusive_ns_prefixes; - int with_comments; /* include comments in the result (!=0) or not (==0) */ - int n_with_comments; - const char * filename; /* the filename to store canonical XML image */ - int n_filename; - int compression; /* the compression level (zlib requred): -1 - libxml default, 0 - uncompressed, >0 - compression level */ - int n_compression; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { - for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { - for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) { - for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) { - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_compression = 0;n_compression < gen_nb_int;n_compression++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - nodes = gen_xmlNodeSetPtr(n_nodes, 1); - mode = gen_int(n_mode, 2); - inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3); - with_comments = gen_int(n_with_comments, 4); - filename = gen_fileoutput(n_filename, 5); - compression = gen_int(n_compression, 6); - - ret_val = xmlC14NDocSave(doc, nodes, mode, inclusive_ns_prefixes, with_comments, filename, compression); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodeSetPtr(n_nodes, nodes, 1); - des_int(n_mode, mode, 2); - des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3); - des_int(n_with_comments, with_comments, 4); - des_fileoutput(n_filename, filename, 5); - des_int(n_compression, compression, 6); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlC14NDocSave", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_nodes); - printf(" %d", n_mode); - printf(" %d", n_inclusive_ns_prefixes); - printf(" %d", n_with_comments); - printf(" %d", n_filename); - printf(" %d", n_compression); - printf("\n"); - } - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlC14NDocSaveTo(void) { - int test_ret = 0; - -#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlDocPtr doc; /* the XML document for canonization */ - int n_doc; - xmlNodeSetPtr nodes; /* the nodes set to be included in the canonized image or NULL if all document nodes should be included */ - int n_nodes; - int mode; /* the c14n mode (see @xmlC14NMode) */ - int n_mode; - xmlChar ** inclusive_ns_prefixes; /* the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise) */ - int n_inclusive_ns_prefixes; - int with_comments; /* include comments in the result (!=0) or not (==0) */ - int n_with_comments; - xmlOutputBufferPtr buf; /* the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output */ - int n_buf; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { - for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { - for (n_inclusive_ns_prefixes = 0;n_inclusive_ns_prefixes < gen_nb_xmlChar_ptr_ptr;n_inclusive_ns_prefixes++) { - for (n_with_comments = 0;n_with_comments < gen_nb_int;n_with_comments++) { - for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - nodes = gen_xmlNodeSetPtr(n_nodes, 1); - mode = gen_int(n_mode, 2); - inclusive_ns_prefixes = gen_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, 3); - with_comments = gen_int(n_with_comments, 4); - buf = gen_xmlOutputBufferPtr(n_buf, 5); - - ret_val = xmlC14NDocSaveTo(doc, nodes, mode, inclusive_ns_prefixes, with_comments, buf); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodeSetPtr(n_nodes, nodes, 1); - des_int(n_mode, mode, 2); - des_xmlChar_ptr_ptr(n_inclusive_ns_prefixes, inclusive_ns_prefixes, 3); - des_int(n_with_comments, with_comments, 4); - des_xmlOutputBufferPtr(n_buf, buf, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlC14NDocSaveTo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_nodes); - printf(" %d", n_mode); - printf(" %d", n_inclusive_ns_prefixes); - printf(" %d", n_with_comments); - printf(" %d", n_buf); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlC14NExecute(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -static int -test_c14n(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing c14n : 3 of 4 functions ...\n"); - test_ret += test_xmlC14NDocDumpMemory(); - test_ret += test_xmlC14NDocSave(); - test_ret += test_xmlC14NDocSaveTo(); - test_ret += test_xmlC14NExecute(); - - if (test_ret != 0) - printf("Module c14n: %d errors\n", test_ret); - return(test_ret); -} -#ifdef LIBXML_CATALOG_ENABLED - -#define gen_nb_xmlCatalogPtr 1 -static xmlCatalogPtr gen_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlCatalogPtr(int no ATTRIBUTE_UNUSED, xmlCatalogPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlACatalogAdd(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - int ret_val; - xmlCatalogPtr catal; /* a Catalog */ - int n_catal; - xmlChar * type; /* the type of record to add to the catalog */ - int n_type; - xmlChar * orig; /* the system, public or prefix to match */ - int n_orig; - xmlChar * replace; /* the replacement value for the match */ - int n_replace; - - for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { - for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) { - for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) { - for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) { - mem_base = xmlMemBlocks(); - catal = gen_xmlCatalogPtr(n_catal, 0); - type = gen_const_xmlChar_ptr(n_type, 1); - orig = gen_const_xmlChar_ptr(n_orig, 2); - replace = gen_const_xmlChar_ptr(n_replace, 3); - - ret_val = xmlACatalogAdd(catal, (const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace); - desret_int(ret_val); - call_tests++; - des_xmlCatalogPtr(n_catal, catal, 0); - des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 1); - des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 2); - des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlACatalogAdd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catal); - printf(" %d", n_type); - printf(" %d", n_orig); - printf(" %d", n_replace); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlACatalogDump(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlCatalogPtr catal; /* a Catalog */ - int n_catal; - FILE * out; /* the file. */ - int n_out; - - for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { - for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { - mem_base = xmlMemBlocks(); - catal = gen_xmlCatalogPtr(n_catal, 0); - out = gen_FILE_ptr(n_out, 1); - - xmlACatalogDump(catal, out); - call_tests++; - des_xmlCatalogPtr(n_catal, catal, 0); - des_FILE_ptr(n_out, out, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlACatalogDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catal); - printf(" %d", n_out); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlACatalogRemove(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - int ret_val; - xmlCatalogPtr catal; /* a Catalog */ - int n_catal; - xmlChar * value; /* the value to remove */ - int n_value; - - for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - catal = gen_xmlCatalogPtr(n_catal, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - - ret_val = xmlACatalogRemove(catal, (const xmlChar *)value); - desret_int(ret_val); - call_tests++; - des_xmlCatalogPtr(n_catal, catal, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlACatalogRemove", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catal); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlACatalogResolve(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlCatalogPtr catal; /* a Catalog */ - int n_catal; - xmlChar * pubID; /* the public ID string */ - int n_pubID; - xmlChar * sysID; /* the system ID string */ - int n_sysID; - - for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { - for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { - for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { - mem_base = xmlMemBlocks(); - catal = gen_xmlCatalogPtr(n_catal, 0); - pubID = gen_const_xmlChar_ptr(n_pubID, 1); - sysID = gen_const_xmlChar_ptr(n_sysID, 2); - - ret_val = xmlACatalogResolve(catal, (const xmlChar *)pubID, (const xmlChar *)sysID); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlCatalogPtr(n_catal, catal, 0); - des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1); - des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlACatalogResolve", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catal); - printf(" %d", n_pubID); - printf(" %d", n_sysID); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlACatalogResolvePublic(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlCatalogPtr catal; /* a Catalog */ - int n_catal; - xmlChar * pubID; /* the public ID string */ - int n_pubID; - - for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { - for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { - mem_base = xmlMemBlocks(); - catal = gen_xmlCatalogPtr(n_catal, 0); - pubID = gen_const_xmlChar_ptr(n_pubID, 1); - - ret_val = xmlACatalogResolvePublic(catal, (const xmlChar *)pubID); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlCatalogPtr(n_catal, catal, 0); - des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlACatalogResolvePublic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catal); - printf(" %d", n_pubID); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlACatalogResolveSystem(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlCatalogPtr catal; /* a Catalog */ - int n_catal; - xmlChar * sysID; /* the system ID string */ - int n_sysID; - - for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { - for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { - mem_base = xmlMemBlocks(); - catal = gen_xmlCatalogPtr(n_catal, 0); - sysID = gen_const_xmlChar_ptr(n_sysID, 1); - - ret_val = xmlACatalogResolveSystem(catal, (const xmlChar *)sysID); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlCatalogPtr(n_catal, catal, 0); - des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlACatalogResolveSystem", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catal); - printf(" %d", n_sysID); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlACatalogResolveURI(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlCatalogPtr catal; /* a Catalog */ - int n_catal; - xmlChar * URI; /* the URI */ - int n_URI; - - for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { - for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { - mem_base = xmlMemBlocks(); - catal = gen_xmlCatalogPtr(n_catal, 0); - URI = gen_const_xmlChar_ptr(n_URI, 1); - - ret_val = xmlACatalogResolveURI(catal, (const xmlChar *)URI); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlCatalogPtr(n_catal, catal, 0); - des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlACatalogResolveURI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catal); - printf(" %d", n_URI); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogAdd(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - int ret_val; - xmlChar * type; /* the type of record to add to the catalog */ - int n_type; - xmlChar * orig; /* the system, public or prefix to match */ - int n_orig; - xmlChar * replace; /* the replacement value for the match */ - int n_replace; - - for (n_type = 0;n_type < gen_nb_const_xmlChar_ptr;n_type++) { - for (n_orig = 0;n_orig < gen_nb_const_xmlChar_ptr;n_orig++) { - for (n_replace = 0;n_replace < gen_nb_const_xmlChar_ptr;n_replace++) { - mem_base = xmlMemBlocks(); - type = gen_const_xmlChar_ptr(n_type, 0); - orig = gen_const_xmlChar_ptr(n_orig, 1); - replace = gen_const_xmlChar_ptr(n_replace, 2); - - ret_val = xmlCatalogAdd((const xmlChar *)type, (const xmlChar *)orig, (const xmlChar *)replace); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_type, (const xmlChar *)type, 0); - des_const_xmlChar_ptr(n_orig, (const xmlChar *)orig, 1); - des_const_xmlChar_ptr(n_replace, (const xmlChar *)replace, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogAdd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_type); - printf(" %d", n_orig); - printf(" %d", n_replace); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogCleanup(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - - - xmlCatalogCleanup(); - call_tests++; - xmlResetLastError(); - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogConvert(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int ret_val; - - - ret_val = xmlCatalogConvert(); - desret_int(ret_val); - call_tests++; - xmlResetLastError(); - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogDump(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - FILE * out; /* the file. */ - int n_out; - - for (n_out = 0;n_out < gen_nb_FILE_ptr;n_out++) { - mem_base = xmlMemBlocks(); - out = gen_FILE_ptr(n_out, 0); - - xmlCatalogDump(out); - call_tests++; - des_FILE_ptr(n_out, out, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogGetDefaults(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlCatalogAllow ret_val; - - mem_base = xmlMemBlocks(); - - ret_val = xmlCatalogGetDefaults(); - desret_xmlCatalogAllow(ret_val); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogGetDefaults", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogIsEmpty(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - int ret_val; - xmlCatalogPtr catal; /* should this create an SGML catalog */ - int n_catal; - - for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { - mem_base = xmlMemBlocks(); - catal = gen_xmlCatalogPtr(n_catal, 0); - - ret_val = xmlCatalogIsEmpty(catal); - desret_int(ret_val); - call_tests++; - des_xmlCatalogPtr(n_catal, catal, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogIsEmpty", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catal); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogLocalResolve(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlChar * ret_val; - void * catalogs; /* a document's list of catalogs */ - int n_catalogs; - xmlChar * pubID; /* the public ID string */ - int n_pubID; - xmlChar * sysID; /* the system ID string */ - int n_sysID; - - for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) { - for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { - for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { - mem_base = xmlMemBlocks(); - catalogs = gen_void_ptr(n_catalogs, 0); - pubID = gen_const_xmlChar_ptr(n_pubID, 1); - sysID = gen_const_xmlChar_ptr(n_sysID, 2); - - ret_val = xmlCatalogLocalResolve(catalogs, (const xmlChar *)pubID, (const xmlChar *)sysID); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_void_ptr(n_catalogs, catalogs, 0); - des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 1); - des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogLocalResolve", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catalogs); - printf(" %d", n_pubID); - printf(" %d", n_sysID); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogLocalResolveURI(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlChar * ret_val; - void * catalogs; /* a document's list of catalogs */ - int n_catalogs; - xmlChar * URI; /* the URI */ - int n_URI; - - for (n_catalogs = 0;n_catalogs < gen_nb_void_ptr;n_catalogs++) { - for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { - mem_base = xmlMemBlocks(); - catalogs = gen_void_ptr(n_catalogs, 0); - URI = gen_const_xmlChar_ptr(n_URI, 1); - - ret_val = xmlCatalogLocalResolveURI(catalogs, (const xmlChar *)URI); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_void_ptr(n_catalogs, catalogs, 0); - des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogLocalResolveURI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catalogs); - printf(" %d", n_URI); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogRemove(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int ret_val; - xmlChar * value; /* the value to remove */ - int n_value; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - value = gen_const_xmlChar_ptr(n_value, 0); - - ret_val = xmlCatalogRemove((const xmlChar *)value); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - xmlResetLastError(); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogResolve(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - xmlChar * ret_val; - xmlChar * pubID; /* the public ID string */ - int n_pubID; - xmlChar * sysID; /* the system ID string */ - int n_sysID; - - for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { - for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { - pubID = gen_const_xmlChar_ptr(n_pubID, 0); - sysID = gen_const_xmlChar_ptr(n_sysID, 1); - - ret_val = xmlCatalogResolve((const xmlChar *)pubID, (const xmlChar *)sysID); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0); - des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1); - xmlResetLastError(); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogResolvePublic(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlChar * pubID; /* the public ID string */ - int n_pubID; - - for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) { - mem_base = xmlMemBlocks(); - pubID = gen_const_xmlChar_ptr(n_pubID, 0); - - ret_val = xmlCatalogResolvePublic((const xmlChar *)pubID); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogResolvePublic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_pubID); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogResolveSystem(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlChar * sysID; /* the system ID string */ - int n_sysID; - - for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) { - mem_base = xmlMemBlocks(); - sysID = gen_const_xmlChar_ptr(n_sysID, 0); - - ret_val = xmlCatalogResolveSystem((const xmlChar *)sysID); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogResolveSystem", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sysID); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogResolveURI(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlChar * URI; /* the URI */ - int n_URI; - - for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { - mem_base = xmlMemBlocks(); - URI = gen_const_xmlChar_ptr(n_URI, 0); - - ret_val = xmlCatalogResolveURI((const xmlChar *)URI); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogResolveURI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URI); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogSetDefaultPrefer(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlCatalogPrefer ret_val; - xmlCatalogPrefer prefer; /* the default preference for delegation */ - int n_prefer; - - for (n_prefer = 0;n_prefer < gen_nb_xmlCatalogPrefer;n_prefer++) { - mem_base = xmlMemBlocks(); - prefer = gen_xmlCatalogPrefer(n_prefer, 0); - - ret_val = xmlCatalogSetDefaultPrefer(prefer); - desret_xmlCatalogPrefer(ret_val); - call_tests++; - des_xmlCatalogPrefer(n_prefer, prefer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogSetDefaultPrefer", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_prefer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCatalogSetDefaults(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlCatalogAllow allow; /* what catalogs should be accepted */ - int n_allow; - - for (n_allow = 0;n_allow < gen_nb_xmlCatalogAllow;n_allow++) { - mem_base = xmlMemBlocks(); - allow = gen_xmlCatalogAllow(n_allow, 0); - - xmlCatalogSetDefaults(allow); - call_tests++; - des_xmlCatalogAllow(n_allow, allow, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCatalogSetDefaults", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_allow); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlConvertSGMLCatalog(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - int ret_val; - xmlCatalogPtr catal; /* the catalog */ - int n_catal; - - for (n_catal = 0;n_catal < gen_nb_xmlCatalogPtr;n_catal++) { - mem_base = xmlMemBlocks(); - catal = gen_xmlCatalogPtr(n_catal, 0); - - ret_val = xmlConvertSGMLCatalog(catal); - desret_int(ret_val); - call_tests++; - des_xmlCatalogPtr(n_catal, catal, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlConvertSGMLCatalog", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_catal); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlInitializeCatalog(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlInitializeCatalog(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlInitializeCatalog", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlLoadACatalog(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlLoadCatalog(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int ret_val; - const char * filename; /* a file path */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - filename = gen_filepath(n_filename, 0); - - ret_val = xmlLoadCatalog(filename); - desret_int(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlLoadCatalogs(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - char * pathss; /* a list of directories separated by a colon or a space. */ - int n_pathss; - - for (n_pathss = 0;n_pathss < gen_nb_const_char_ptr;n_pathss++) { - pathss = gen_const_char_ptr(n_pathss, 0); - - xmlLoadCatalogs((const char *)pathss); - call_tests++; - des_const_char_ptr(n_pathss, (const char *)pathss, 0); - xmlResetLastError(); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlLoadSGMLSuperCatalog(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlNewCatalog(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlParseCatalogFile(void) { - int test_ret = 0; - -#if defined(LIBXML_CATALOG_ENABLED) - int mem_base; - xmlDocPtr ret_val; - const char * filename; /* the filename */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - - ret_val = xmlParseCatalogFile(filename); - desret_xmlDocPtr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseCatalogFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_catalog(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing catalog : 27 of 36 functions ...\n"); - test_ret += test_xmlACatalogAdd(); - test_ret += test_xmlACatalogDump(); - test_ret += test_xmlACatalogRemove(); - test_ret += test_xmlACatalogResolve(); - test_ret += test_xmlACatalogResolvePublic(); - test_ret += test_xmlACatalogResolveSystem(); - test_ret += test_xmlACatalogResolveURI(); - test_ret += test_xmlCatalogAdd(); - test_ret += test_xmlCatalogCleanup(); - test_ret += test_xmlCatalogConvert(); - test_ret += test_xmlCatalogDump(); - test_ret += test_xmlCatalogGetDefaults(); - test_ret += test_xmlCatalogIsEmpty(); - test_ret += test_xmlCatalogLocalResolve(); - test_ret += test_xmlCatalogLocalResolveURI(); - test_ret += test_xmlCatalogRemove(); - test_ret += test_xmlCatalogResolve(); - test_ret += test_xmlCatalogResolvePublic(); - test_ret += test_xmlCatalogResolveSystem(); - test_ret += test_xmlCatalogResolveURI(); - test_ret += test_xmlCatalogSetDefaultPrefer(); - test_ret += test_xmlCatalogSetDefaults(); - test_ret += test_xmlConvertSGMLCatalog(); - test_ret += test_xmlInitializeCatalog(); - test_ret += test_xmlLoadACatalog(); - test_ret += test_xmlLoadCatalog(); - test_ret += test_xmlLoadCatalogs(); - test_ret += test_xmlLoadSGMLSuperCatalog(); - test_ret += test_xmlNewCatalog(); - test_ret += test_xmlParseCatalogFile(); - - if (test_ret != 0) - printf("Module catalog: %d errors\n", test_ret); - return(test_ret); -} - -#define gen_nb_const_xmlChRangeGroup_ptr 1 -static xmlChRangeGroup * gen_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_xmlChRangeGroup_ptr(int no ATTRIBUTE_UNUSED, const xmlChRangeGroup * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlCharInRange(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned int val; /* character to be validated */ - int n_val; - xmlChRangeGroup * rptr; /* pointer to range to be used to validate */ - int n_rptr; - - for (n_val = 0;n_val < gen_nb_unsigned_int;n_val++) { - for (n_rptr = 0;n_rptr < gen_nb_const_xmlChRangeGroup_ptr;n_rptr++) { - mem_base = xmlMemBlocks(); - val = gen_unsigned_int(n_val, 0); - rptr = gen_const_xmlChRangeGroup_ptr(n_rptr, 1); - - ret_val = xmlCharInRange(val, (const xmlChRangeGroup *)rptr); - desret_int(ret_val); - call_tests++; - des_unsigned_int(n_val, val, 0); - des_const_xmlChRangeGroup_ptr(n_rptr, (const xmlChRangeGroup *)rptr, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCharInRange", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf(" %d", n_rptr); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsBaseChar(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned int ch; /* character to validate */ - int n_ch; - - for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { - mem_base = xmlMemBlocks(); - ch = gen_unsigned_int(n_ch, 0); - - ret_val = xmlIsBaseChar(ch); - desret_int(ret_val); - call_tests++; - des_unsigned_int(n_ch, ch, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsBaseChar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ch); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsBlank(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned int ch; /* character to validate */ - int n_ch; - - for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { - mem_base = xmlMemBlocks(); - ch = gen_unsigned_int(n_ch, 0); - - ret_val = xmlIsBlank(ch); - desret_int(ret_val); - call_tests++; - des_unsigned_int(n_ch, ch, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsBlank", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ch); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsChar(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned int ch; /* character to validate */ - int n_ch; - - for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { - mem_base = xmlMemBlocks(); - ch = gen_unsigned_int(n_ch, 0); - - ret_val = xmlIsChar(ch); - desret_int(ret_val); - call_tests++; - des_unsigned_int(n_ch, ch, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsChar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ch); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsCombining(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned int ch; /* character to validate */ - int n_ch; - - for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { - mem_base = xmlMemBlocks(); - ch = gen_unsigned_int(n_ch, 0); - - ret_val = xmlIsCombining(ch); - desret_int(ret_val); - call_tests++; - des_unsigned_int(n_ch, ch, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsCombining", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ch); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsDigit(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned int ch; /* character to validate */ - int n_ch; - - for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { - mem_base = xmlMemBlocks(); - ch = gen_unsigned_int(n_ch, 0); - - ret_val = xmlIsDigit(ch); - desret_int(ret_val); - call_tests++; - des_unsigned_int(n_ch, ch, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsDigit", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ch); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsExtender(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned int ch; /* character to validate */ - int n_ch; - - for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { - mem_base = xmlMemBlocks(); - ch = gen_unsigned_int(n_ch, 0); - - ret_val = xmlIsExtender(ch); - desret_int(ret_val); - call_tests++; - des_unsigned_int(n_ch, ch, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsExtender", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ch); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsIdeographic(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned int ch; /* character to validate */ - int n_ch; - - for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { - mem_base = xmlMemBlocks(); - ch = gen_unsigned_int(n_ch, 0); - - ret_val = xmlIsIdeographic(ch); - desret_int(ret_val); - call_tests++; - des_unsigned_int(n_ch, ch, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsIdeographic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ch); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsPubidChar(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned int ch; /* character to validate */ - int n_ch; - - for (n_ch = 0;n_ch < gen_nb_unsigned_int;n_ch++) { - mem_base = xmlMemBlocks(); - ch = gen_unsigned_int(n_ch, 0); - - ret_val = xmlIsPubidChar(ch); - desret_int(ret_val); - call_tests++; - des_unsigned_int(n_ch, ch, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsPubidChar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ch); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - -static int -test_chvalid(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing chvalid : 9 of 9 functions ...\n"); - test_ret += test_xmlCharInRange(); - test_ret += test_xmlIsBaseChar(); - test_ret += test_xmlIsBlank(); - test_ret += test_xmlIsChar(); - test_ret += test_xmlIsCombining(); - test_ret += test_xmlIsDigit(); - test_ret += test_xmlIsExtender(); - test_ret += test_xmlIsIdeographic(); - test_ret += test_xmlIsPubidChar(); - - if (test_ret != 0) - printf("Module chvalid: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlBoolToText(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - const char * ret_val; - int boolval; /* a bool to turn into text */ - int n_boolval; - - for (n_boolval = 0;n_boolval < gen_nb_int;n_boolval++) { - mem_base = xmlMemBlocks(); - boolval = gen_int(n_boolval, 0); - - ret_val = xmlBoolToText(boolval); - desret_const_char_ptr(ret_val); - call_tests++; - des_int(n_boolval, boolval, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBoolToText", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_boolval); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugCheckDocument(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - int ret_val; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlDocPtr doc; /* the document */ - int n_doc; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - ret_val = xmlDebugCheckDocument(output, doc); - desret_int(ret_val); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugCheckDocument", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugDumpAttr(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlAttrPtr attr; /* the attribute */ - int n_attr; - int depth; /* the indentation level. */ - int n_depth; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { - for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - attr = gen_xmlAttrPtr(n_attr, 1); - depth = gen_int(n_depth, 2); - - xmlDebugDumpAttr(output, attr, depth); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlAttrPtr(n_attr, attr, 1); - des_int(n_depth, depth, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugDumpAttr", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_attr); - printf(" %d", n_depth); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugDumpAttrList(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlAttrPtr attr; /* the attribute list */ - int n_attr; - int depth; /* the indentation level. */ - int n_depth; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { - for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - attr = gen_xmlAttrPtr(n_attr, 1); - depth = gen_int(n_depth, 2); - - xmlDebugDumpAttrList(output, attr, depth); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlAttrPtr(n_attr, attr, 1); - des_int(n_depth, depth, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugDumpAttrList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_attr); - printf(" %d", n_depth); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugDumpDTD(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlDtdPtr dtd; /* the DTD */ - int n_dtd; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - dtd = gen_xmlDtdPtr(n_dtd, 1); - - xmlDebugDumpDTD(output, dtd); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlDtdPtr(n_dtd, dtd, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugDumpDTD", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_dtd); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugDumpDocument(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlDocPtr doc; /* the document */ - int n_doc; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - xmlDebugDumpDocument(output, doc); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugDumpDocument", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugDumpDocumentHead(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlDocPtr doc; /* the document */ - int n_doc; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - xmlDebugDumpDocumentHead(output, doc); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugDumpDocumentHead", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugDumpEntities(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlDocPtr doc; /* the document */ - int n_doc; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - xmlDebugDumpEntities(output, doc); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugDumpEntities", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugDumpNode(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlNodePtr node; /* the node */ - int n_node; - int depth; /* the indentation level. */ - int n_depth; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - node = gen_xmlNodePtr(n_node, 1); - depth = gen_int(n_depth, 2); - - xmlDebugDumpNode(output, node, depth); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlNodePtr(n_node, node, 1); - des_int(n_depth, depth, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugDumpNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_node); - printf(" %d", n_depth); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugDumpNodeList(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlNodePtr node; /* the node list */ - int n_node; - int depth; /* the indentation level. */ - int n_depth; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - node = gen_xmlNodePtr(n_node, 1); - depth = gen_int(n_depth, 2); - - xmlDebugDumpNodeList(output, node, depth); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlNodePtr(n_node, node, 1); - des_int(n_depth, depth, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugDumpNodeList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_node); - printf(" %d", n_depth); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugDumpOneNode(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlNodePtr node; /* the node */ - int n_node; - int depth; /* the indentation level. */ - int n_depth; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - node = gen_xmlNodePtr(n_node, 1); - depth = gen_int(n_depth, 2); - - xmlDebugDumpOneNode(output, node, depth); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlNodePtr(n_node, node, 1); - des_int(n_depth, depth, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugDumpOneNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_node); - printf(" %d", n_depth); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDebugDumpString(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlChar * str; /* the string */ - int n_str; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - str = gen_const_xmlChar_ptr(n_str, 1); - - xmlDebugDumpString(output, (const xmlChar *)str); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDebugDumpString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_str); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlLsCountNode(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - int ret_val; - xmlNodePtr node; /* the node to count */ - int n_node; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - - ret_val = xmlLsCountNode(node); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlLsCountNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlLsOneNode(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlNodePtr node; /* the node to dump */ - int n_node; - - for (n_output = 0;n_output < gen_nb_debug_FILE_ptr;n_output++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - output = gen_debug_FILE_ptr(n_output, 0); - node = gen_xmlNodePtr(n_node, 1); - - xmlLsOneNode(output, node); - call_tests++; - des_debug_FILE_ptr(n_output, output, 0); - des_xmlNodePtr(n_node, node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlLsOneNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -#define gen_nb_char_ptr 1 -static char * gen_char_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_char_ptr(int no ATTRIBUTE_UNUSED, char * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlShell(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlShellBase(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlShellCtxtPtr ctxt; /* the shell context */ - int n_ctxt; - char * arg; /* unused */ - int n_arg; - xmlNodePtr node; /* a node */ - int n_node; - xmlNodePtr node2; /* unused */ - int n_node2; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { - for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); - arg = gen_char_ptr(n_arg, 1); - node = gen_xmlNodePtr(n_node, 2); - node2 = gen_xmlNodePtr(n_node2, 3); - - ret_val = xmlShellBase(ctxt, arg, node, node2); - desret_int(ret_val); - call_tests++; - des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); - des_char_ptr(n_arg, arg, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlNodePtr(n_node2, node2, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellBase", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_arg); - printf(" %d", n_node); - printf(" %d", n_node2); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlShellCat(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlShellCtxtPtr ctxt; /* the shell context */ - int n_ctxt; - char * arg; /* unused */ - int n_arg; - xmlNodePtr node; /* a node */ - int n_node; - xmlNodePtr node2; /* unused */ - int n_node2; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { - for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); - arg = gen_char_ptr(n_arg, 1); - node = gen_xmlNodePtr(n_node, 2); - node2 = gen_xmlNodePtr(n_node2, 3); - - ret_val = xmlShellCat(ctxt, arg, node, node2); - desret_int(ret_val); - call_tests++; - des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); - des_char_ptr(n_arg, arg, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlNodePtr(n_node2, node2, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellCat", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_arg); - printf(" %d", n_node); - printf(" %d", n_node2); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlShellDir(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlShellCtxtPtr ctxt; /* the shell context */ - int n_ctxt; - char * arg; /* unused */ - int n_arg; - xmlNodePtr node; /* a node */ - int n_node; - xmlNodePtr node2; /* unused */ - int n_node2; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { - for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); - arg = gen_char_ptr(n_arg, 1); - node = gen_xmlNodePtr(n_node, 2); - node2 = gen_xmlNodePtr(n_node2, 3); - - ret_val = xmlShellDir(ctxt, arg, node, node2); - desret_int(ret_val); - call_tests++; - des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); - des_char_ptr(n_arg, arg, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlNodePtr(n_node2, node2, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellDir", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_arg); - printf(" %d", n_node); - printf(" %d", n_node2); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlShellDu(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlShellCtxtPtr ctxt; /* the shell context */ - int n_ctxt; - char * arg; /* unused */ - int n_arg; - xmlNodePtr tree; /* a node defining a subtree */ - int n_tree; - xmlNodePtr node2; /* unused */ - int n_node2; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { - for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { - for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); - arg = gen_char_ptr(n_arg, 1); - tree = gen_xmlNodePtr(n_tree, 2); - node2 = gen_xmlNodePtr(n_node2, 3); - - ret_val = xmlShellDu(ctxt, arg, tree, node2); - desret_int(ret_val); - call_tests++; - des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); - des_char_ptr(n_arg, arg, 1); - des_xmlNodePtr(n_tree, tree, 2); - des_xmlNodePtr(n_node2, node2, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellDu", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_arg); - printf(" %d", n_tree); - printf(" %d", n_node2); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlShellList(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlShellCtxtPtr ctxt; /* the shell context */ - int n_ctxt; - char * arg; /* unused */ - int n_arg; - xmlNodePtr node; /* a node */ - int n_node; - xmlNodePtr node2; /* unused */ - int n_node2; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { - for (n_arg = 0;n_arg < gen_nb_char_ptr;n_arg++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); - arg = gen_char_ptr(n_arg, 1); - node = gen_xmlNodePtr(n_node, 2); - node2 = gen_xmlNodePtr(n_node2, 3); - - ret_val = xmlShellList(ctxt, arg, node, node2); - desret_int(ret_val); - call_tests++; - des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); - des_char_ptr(n_arg, arg, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlNodePtr(n_node2, node2, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_arg); - printf(" %d", n_node); - printf(" %d", n_node2); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlShellLoad(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlShellCtxtPtr ctxt; /* the shell context */ - int n_ctxt; - char * filename; /* the file name */ - int n_filename; - xmlNodePtr node; /* unused */ - int n_node; - xmlNodePtr node2; /* unused */ - int n_node2; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { - for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); - filename = gen_char_ptr(n_filename, 1); - node = gen_xmlNodePtr(n_node, 2); - node2 = gen_xmlNodePtr(n_node2, 3); - - ret_val = xmlShellLoad(ctxt, filename, node, node2); - desret_int(ret_val); - call_tests++; - des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); - des_char_ptr(n_filename, filename, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlNodePtr(n_node2, node2, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellLoad", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_filename); - printf(" %d", n_node); - printf(" %d", n_node2); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlShellPrintXPathResult(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr list; /* a valid result generated by an xpath evaluation */ - int n_list; - - for (n_list = 0;n_list < gen_nb_xmlXPathObjectPtr;n_list++) { - mem_base = xmlMemBlocks(); - list = gen_xmlXPathObjectPtr(n_list, 0); - - xmlShellPrintXPathResult(list); - call_tests++; - des_xmlXPathObjectPtr(n_list, list, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellPrintXPathResult", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_list); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlShellPwd(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlShellCtxtPtr ctxt; /* the shell context */ - int n_ctxt; - char * buffer; /* the output buffer */ - int n_buffer; - xmlNodePtr node; /* a node */ - int n_node; - xmlNodePtr node2; /* unused */ - int n_node2; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { - for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); - buffer = gen_char_ptr(n_buffer, 1); - node = gen_xmlNodePtr(n_node, 2); - node2 = gen_xmlNodePtr(n_node2, 3); - - ret_val = xmlShellPwd(ctxt, buffer, node, node2); - desret_int(ret_val); - call_tests++; - des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); - des_char_ptr(n_buffer, buffer, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlNodePtr(n_node2, node2, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellPwd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_buffer); - printf(" %d", n_node); - printf(" %d", n_node2); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlShellSave(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlShellCtxtPtr ctxt; /* the shell context */ - int n_ctxt; - char * filename; /* the file name (optional) */ - int n_filename; - xmlNodePtr node; /* unused */ - int n_node; - xmlNodePtr node2; /* unused */ - int n_node2; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { - for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); - filename = gen_char_ptr(n_filename, 1); - node = gen_xmlNodePtr(n_node, 2); - node2 = gen_xmlNodePtr(n_node2, 3); - - ret_val = xmlShellSave(ctxt, filename, node, node2); - desret_int(ret_val); - call_tests++; - des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); - des_char_ptr(n_filename, filename, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlNodePtr(n_node2, node2, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellSave", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_filename); - printf(" %d", n_node); - printf(" %d", n_node2); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlShellValidate(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlShellCtxtPtr ctxt; /* the shell context */ - int n_ctxt; - char * dtd; /* the DTD URI (optional) */ - int n_dtd; - xmlNodePtr node; /* unused */ - int n_node; - xmlNodePtr node2; /* unused */ - int n_node2; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { - for (n_dtd = 0;n_dtd < gen_nb_char_ptr;n_dtd++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); - dtd = gen_char_ptr(n_dtd, 1); - node = gen_xmlNodePtr(n_node, 2); - node2 = gen_xmlNodePtr(n_node2, 3); - - ret_val = xmlShellValidate(ctxt, dtd, node, node2); - desret_int(ret_val); - call_tests++; - des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); - des_char_ptr(n_dtd, dtd, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlNodePtr(n_node2, node2, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellValidate", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_dtd); - printf(" %d", n_node); - printf(" %d", n_node2); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlShellWrite(void) { - int test_ret = 0; - -#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlShellCtxtPtr ctxt; /* the shell context */ - int n_ctxt; - char * filename; /* the file name */ - int n_filename; - xmlNodePtr node; /* a node in the tree */ - int n_node; - xmlNodePtr node2; /* unused */ - int n_node2; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlShellCtxtPtr;n_ctxt++) { - for (n_filename = 0;n_filename < gen_nb_char_ptr;n_filename++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlShellCtxtPtr(n_ctxt, 0); - filename = gen_char_ptr(n_filename, 1); - node = gen_xmlNodePtr(n_node, 2); - node2 = gen_xmlNodePtr(n_node2, 3); - - ret_val = xmlShellWrite(ctxt, filename, node, node2); - desret_int(ret_val); - call_tests++; - des_xmlShellCtxtPtr(n_ctxt, ctxt, 0); - des_char_ptr(n_filename, filename, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlNodePtr(n_node2, node2, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlShellWrite", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_filename); - printf(" %d", n_node); - printf(" %d", n_node2); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_debugXML(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing debugXML : 25 of 28 functions ...\n"); - test_ret += test_xmlBoolToText(); - test_ret += test_xmlDebugCheckDocument(); - test_ret += test_xmlDebugDumpAttr(); - test_ret += test_xmlDebugDumpAttrList(); - test_ret += test_xmlDebugDumpDTD(); - test_ret += test_xmlDebugDumpDocument(); - test_ret += test_xmlDebugDumpDocumentHead(); - test_ret += test_xmlDebugDumpEntities(); - test_ret += test_xmlDebugDumpNode(); - test_ret += test_xmlDebugDumpNodeList(); - test_ret += test_xmlDebugDumpOneNode(); - test_ret += test_xmlDebugDumpString(); - test_ret += test_xmlLsCountNode(); - test_ret += test_xmlLsOneNode(); - test_ret += test_xmlShell(); - test_ret += test_xmlShellBase(); - test_ret += test_xmlShellCat(); - test_ret += test_xmlShellDir(); - test_ret += test_xmlShellDu(); - test_ret += test_xmlShellList(); - test_ret += test_xmlShellLoad(); - test_ret += test_xmlShellPrintXPathResult(); - test_ret += test_xmlShellPwd(); - test_ret += test_xmlShellSave(); - test_ret += test_xmlShellValidate(); - test_ret += test_xmlShellWrite(); - - if (test_ret != 0) - printf("Module debugXML: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlDictCleanup(void) { - int test_ret = 0; - - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlDictCleanup(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDictCleanup", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDictCreate(void) { - int test_ret = 0; - - int mem_base; - xmlDictPtr ret_val; - - mem_base = xmlMemBlocks(); - - ret_val = xmlDictCreate(); - desret_xmlDictPtr(ret_val); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDictCreate", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDictCreateSub(void) { - int test_ret = 0; - - int mem_base; - xmlDictPtr ret_val; - xmlDictPtr sub; /* an existing dictionnary */ - int n_sub; - - for (n_sub = 0;n_sub < gen_nb_xmlDictPtr;n_sub++) { - mem_base = xmlMemBlocks(); - sub = gen_xmlDictPtr(n_sub, 0); - - ret_val = xmlDictCreateSub(sub); - desret_xmlDictPtr(ret_val); - call_tests++; - des_xmlDictPtr(n_sub, sub, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDictCreateSub", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sub); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDictExists(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlDictPtr dict; /* the dictionnary */ - int n_dict; - xmlChar * name; /* the name of the userdata */ - int n_name; - int len; /* the length of the name, if -1 it is recomputed */ - int n_len; - - for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - dict = gen_xmlDictPtr(n_dict, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - len = gen_int(n_len, 2); - - ret_val = xmlDictExists(dict, (const xmlChar *)name, len); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlDictPtr(n_dict, dict, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDictExists", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dict); - printf(" %d", n_name); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDictGetUsage(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlDictLookup(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlDictPtr dict; /* the dictionnary */ - int n_dict; - xmlChar * name; /* the name of the userdata */ - int n_name; - int len; /* the length of the name, if -1 it is recomputed */ - int n_len; - - for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - dict = gen_xmlDictPtr(n_dict, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - len = gen_int(n_len, 2); - - ret_val = xmlDictLookup(dict, (const xmlChar *)name, len); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlDictPtr(n_dict, dict, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDictLookup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dict); - printf(" %d", n_name); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDictOwns(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDictPtr dict; /* the dictionnary */ - int n_dict; - xmlChar * str; /* the string */ - int n_str; - - for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - mem_base = xmlMemBlocks(); - dict = gen_xmlDictPtr(n_dict, 0); - str = gen_const_xmlChar_ptr(n_str, 1); - - ret_val = xmlDictOwns(dict, (const xmlChar *)str); - desret_int(ret_val); - call_tests++; - des_xmlDictPtr(n_dict, dict, 0); - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDictOwns", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dict); - printf(" %d", n_str); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDictQLookup(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlDictPtr dict; /* the dictionnary */ - int n_dict; - xmlChar * prefix; /* the prefix */ - int n_prefix; - xmlChar * name; /* the name */ - int n_name; - - for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - dict = gen_xmlDictPtr(n_dict, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - - ret_val = xmlDictQLookup(dict, (const xmlChar *)prefix, (const xmlChar *)name); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlDictPtr(n_dict, dict, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDictQLookup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dict); - printf(" %d", n_prefix); - printf(" %d", n_name); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDictReference(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDictPtr dict; /* the dictionnary */ - int n_dict; - - for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { - mem_base = xmlMemBlocks(); - dict = gen_xmlDictPtr(n_dict, 0); - - ret_val = xmlDictReference(dict); - xmlDictFree(dict); - desret_int(ret_val); - call_tests++; - des_xmlDictPtr(n_dict, dict, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDictReference", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dict); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDictSetLimit(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlDictSize(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDictPtr dict; /* the dictionnary */ - int n_dict; - - for (n_dict = 0;n_dict < gen_nb_xmlDictPtr;n_dict++) { - mem_base = xmlMemBlocks(); - dict = gen_xmlDictPtr(n_dict, 0); - - ret_val = xmlDictSize(dict); - desret_int(ret_val); - call_tests++; - des_xmlDictPtr(n_dict, dict, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDictSize", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dict); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlInitializeDict(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - - mem_base = xmlMemBlocks(); - - ret_val = xmlInitializeDict(); - desret_int(ret_val); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlInitializeDict", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - -static int -test_dict(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing dict : 10 of 13 functions ...\n"); - test_ret += test_xmlDictCleanup(); - test_ret += test_xmlDictCreate(); - test_ret += test_xmlDictCreateSub(); - test_ret += test_xmlDictExists(); - test_ret += test_xmlDictGetUsage(); - test_ret += test_xmlDictLookup(); - test_ret += test_xmlDictOwns(); - test_ret += test_xmlDictQLookup(); - test_ret += test_xmlDictReference(); - test_ret += test_xmlDictSetLimit(); - test_ret += test_xmlDictSize(); - test_ret += test_xmlInitializeDict(); - - if (test_ret != 0) - printf("Module dict: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_UTF8Toisolat1(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef LIBXML_OUTPUT_ENABLED - int mem_base; - int ret_val; - unsigned char * out; /* a pointer to an array of bytes to store the result */ - int n_out; - int * outlen; /* the length of @out */ - int n_outlen; - unsigned char * in; /* a pointer to an array of UTF-8 chars */ - int n_in; - int * inlen; /* the length of @in */ - int n_inlen; - - for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { - for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { - for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { - for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { - mem_base = xmlMemBlocks(); - out = gen_unsigned_char_ptr(n_out, 0); - outlen = gen_int_ptr(n_outlen, 1); - in = gen_const_unsigned_char_ptr(n_in, 2); - inlen = gen_int_ptr(n_inlen, 3); - - ret_val = UTF8Toisolat1(out, outlen, (const unsigned char *)in, inlen); - desret_int(ret_val); - call_tests++; - des_unsigned_char_ptr(n_out, out, 0); - des_int_ptr(n_outlen, outlen, 1); - des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); - des_int_ptr(n_inlen, inlen, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in UTF8Toisolat1", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_outlen); - printf(" %d", n_in); - printf(" %d", n_inlen); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_isolat1ToUTF8(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned char * out; /* a pointer to an array of bytes to store the result */ - int n_out; - int * outlen; /* the length of @out */ - int n_outlen; - unsigned char * in; /* a pointer to an array of ISO Latin 1 chars */ - int n_in; - int * inlen; /* the length of @in */ - int n_inlen; - - for (n_out = 0;n_out < gen_nb_unsigned_char_ptr;n_out++) { - for (n_outlen = 0;n_outlen < gen_nb_int_ptr;n_outlen++) { - for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { - for (n_inlen = 0;n_inlen < gen_nb_int_ptr;n_inlen++) { - mem_base = xmlMemBlocks(); - out = gen_unsigned_char_ptr(n_out, 0); - outlen = gen_int_ptr(n_outlen, 1); - in = gen_const_unsigned_char_ptr(n_in, 2); - inlen = gen_int_ptr(n_inlen, 3); - - ret_val = isolat1ToUTF8(out, outlen, (const unsigned char *)in, inlen); - desret_int(ret_val); - call_tests++; - des_unsigned_char_ptr(n_out, out, 0); - des_int_ptr(n_outlen, outlen, 1); - des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 2); - des_int_ptr(n_inlen, inlen, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in isolat1ToUTF8", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_outlen); - printf(" %d", n_in); - printf(" %d", n_inlen); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlAddEncodingAlias(void) { - int test_ret = 0; - - int ret_val; - char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */ - int n_name; - char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ - int n_alias; - - for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { - for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { - name = gen_const_char_ptr(n_name, 0); - alias = gen_const_char_ptr(n_alias, 1); - - ret_val = xmlAddEncodingAlias((const char *)name, (const char *)alias); - desret_int(ret_val); - call_tests++; - des_const_char_ptr(n_name, (const char *)name, 0); - des_const_char_ptr(n_alias, (const char *)alias, 1); - xmlResetLastError(); - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlCharEncodingHandler_ptr 1 -static xmlCharEncodingHandler * gen_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlCharEncodingHandler_ptr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandler * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlCharEncCloseFunc(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlCharEncodingHandler * handler; /* char enconding transformation data structure */ - int n_handler; - - for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { - mem_base = xmlMemBlocks(); - handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); - - ret_val = xmlCharEncCloseFunc(handler); - desret_int(ret_val); - call_tests++; - des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCharEncCloseFunc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_handler); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCharEncFirstLine(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlCharEncodingHandler * handler; /* char enconding transformation data structure */ - int n_handler; - xmlBufferPtr out; /* an xmlBuffer for the output. */ - int n_out; - xmlBufferPtr in; /* an xmlBuffer for the input */ - int n_in; - - for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { - for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) { - for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) { - mem_base = xmlMemBlocks(); - handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); - out = gen_xmlBufferPtr(n_out, 1); - in = gen_xmlBufferPtr(n_in, 2); - - ret_val = xmlCharEncFirstLine(handler, out, in); - desret_int(ret_val); - call_tests++; - des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); - des_xmlBufferPtr(n_out, out, 1); - des_xmlBufferPtr(n_in, in, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCharEncFirstLine", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_handler); - printf(" %d", n_out); - printf(" %d", n_in); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCharEncInFunc(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlCharEncodingHandler * handler; /* char encoding transformation data structure */ - int n_handler; - xmlBufferPtr out; /* an xmlBuffer for the output. */ - int n_out; - xmlBufferPtr in; /* an xmlBuffer for the input */ - int n_in; - - for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { - for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) { - for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) { - mem_base = xmlMemBlocks(); - handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); - out = gen_xmlBufferPtr(n_out, 1); - in = gen_xmlBufferPtr(n_in, 2); - - ret_val = xmlCharEncInFunc(handler, out, in); - desret_int(ret_val); - call_tests++; - des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); - des_xmlBufferPtr(n_out, out, 1); - des_xmlBufferPtr(n_in, in, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCharEncInFunc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_handler); - printf(" %d", n_out); - printf(" %d", n_in); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCharEncOutFunc(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlCharEncodingHandler * handler; /* char enconding transformation data structure */ - int n_handler; - xmlBufferPtr out; /* an xmlBuffer for the output. */ - int n_out; - xmlBufferPtr in; /* an xmlBuffer for the input */ - int n_in; - - for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandler_ptr;n_handler++) { - for (n_out = 0;n_out < gen_nb_xmlBufferPtr;n_out++) { - for (n_in = 0;n_in < gen_nb_xmlBufferPtr;n_in++) { - mem_base = xmlMemBlocks(); - handler = gen_xmlCharEncodingHandler_ptr(n_handler, 0); - out = gen_xmlBufferPtr(n_out, 1); - in = gen_xmlBufferPtr(n_in, 2); - - ret_val = xmlCharEncOutFunc(handler, out, in); - desret_int(ret_val); - call_tests++; - des_xmlCharEncodingHandler_ptr(n_handler, handler, 0); - des_xmlBufferPtr(n_out, out, 1); - des_xmlBufferPtr(n_in, in, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCharEncOutFunc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_handler); - printf(" %d", n_out); - printf(" %d", n_in); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCleanupCharEncodingHandlers(void) { - int test_ret = 0; - - - - xmlCleanupCharEncodingHandlers(); - call_tests++; - xmlResetLastError(); - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCleanupEncodingAliases(void) { - int test_ret = 0; - - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlCleanupEncodingAliases(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCleanupEncodingAliases", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDelEncodingAlias(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ - int n_alias; - - for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { - mem_base = xmlMemBlocks(); - alias = gen_const_char_ptr(n_alias, 0); - - ret_val = xmlDelEncodingAlias((const char *)alias); - desret_int(ret_val); - call_tests++; - des_const_char_ptr(n_alias, (const char *)alias, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDelEncodingAlias", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_alias); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDetectCharEncoding(void) { - int test_ret = 0; - - int mem_base; - xmlCharEncoding ret_val; - unsigned char * in; /* a pointer to the first bytes of the XML entity, must be at least 2 bytes long (at least 4 if encoding is UTF4 variant). */ - int n_in; - int len; /* pointer to the length of the buffer */ - int n_len; - - for (n_in = 0;n_in < gen_nb_const_unsigned_char_ptr;n_in++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - in = gen_const_unsigned_char_ptr(n_in, 0); - len = gen_int(n_len, 1); - - ret_val = xmlDetectCharEncoding((const unsigned char *)in, len); - desret_xmlCharEncoding(ret_val); - call_tests++; - des_const_unsigned_char_ptr(n_in, (const unsigned char *)in, 0); - des_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDetectCharEncoding", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_in); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlFindCharEncodingHandler(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlGetCharEncodingHandler(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlGetCharEncodingName(void) { - int test_ret = 0; - - int mem_base; - const char * ret_val; - xmlCharEncoding enc; /* the encoding */ - int n_enc; - - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - mem_base = xmlMemBlocks(); - enc = gen_xmlCharEncoding(n_enc, 0); - - ret_val = xmlGetCharEncodingName(enc); - desret_const_char_ptr(ret_val); - call_tests++; - des_xmlCharEncoding(n_enc, enc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetCharEncodingName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_enc); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetEncodingAlias(void) { - int test_ret = 0; - - int mem_base; - const char * ret_val; - char * alias; /* the alias name as parsed, in UTF-8 format (ASCII actually) */ - int n_alias; - - for (n_alias = 0;n_alias < gen_nb_const_char_ptr;n_alias++) { - mem_base = xmlMemBlocks(); - alias = gen_const_char_ptr(n_alias, 0); - - ret_val = xmlGetEncodingAlias((const char *)alias); - desret_const_char_ptr(ret_val); - call_tests++; - des_const_char_ptr(n_alias, (const char *)alias, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetEncodingAlias", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_alias); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlInitCharEncodingHandlers(void) { - int test_ret = 0; - - - - xmlInitCharEncodingHandlers(); - call_tests++; - xmlResetLastError(); - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewCharEncodingHandler(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlParseCharEncoding(void) { - int test_ret = 0; - - int mem_base; - xmlCharEncoding ret_val; - char * name; /* the encoding name as parsed, in UTF-8 format (ASCII actually) */ - int n_name; - - for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { - mem_base = xmlMemBlocks(); - name = gen_const_char_ptr(n_name, 0); - - ret_val = xmlParseCharEncoding((const char *)name); - desret_xmlCharEncoding(ret_val); - call_tests++; - des_const_char_ptr(n_name, (const char *)name, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseCharEncoding", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlCharEncodingHandlerPtr 1 -static xmlCharEncodingHandlerPtr gen_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlCharEncodingHandlerPtr(int no ATTRIBUTE_UNUSED, xmlCharEncodingHandlerPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlRegisterCharEncodingHandler(void) { - int test_ret = 0; - - int mem_base; - xmlCharEncodingHandlerPtr handler; /* the xmlCharEncodingHandlerPtr handler block */ - int n_handler; - - for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) { - mem_base = xmlMemBlocks(); - handler = gen_xmlCharEncodingHandlerPtr(n_handler, 0); - - xmlRegisterCharEncodingHandler(handler); - call_tests++; - des_xmlCharEncodingHandlerPtr(n_handler, handler, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegisterCharEncodingHandler", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_handler); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - -static int -test_encoding(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing encoding : 16 of 19 functions ...\n"); - test_ret += test_UTF8Toisolat1(); - test_ret += test_isolat1ToUTF8(); - test_ret += test_xmlAddEncodingAlias(); - test_ret += test_xmlCharEncCloseFunc(); - test_ret += test_xmlCharEncFirstLine(); - test_ret += test_xmlCharEncInFunc(); - test_ret += test_xmlCharEncOutFunc(); - test_ret += test_xmlCleanupCharEncodingHandlers(); - test_ret += test_xmlCleanupEncodingAliases(); - test_ret += test_xmlDelEncodingAlias(); - test_ret += test_xmlDetectCharEncoding(); - test_ret += test_xmlFindCharEncodingHandler(); - test_ret += test_xmlGetCharEncodingHandler(); - test_ret += test_xmlGetCharEncodingName(); - test_ret += test_xmlGetEncodingAlias(); - test_ret += test_xmlInitCharEncodingHandlers(); - test_ret += test_xmlNewCharEncodingHandler(); - test_ret += test_xmlParseCharEncoding(); - test_ret += test_xmlRegisterCharEncodingHandler(); - - if (test_ret != 0) - printf("Module encoding: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlAddDocEntity(void) { - int test_ret = 0; - - int mem_base; - xmlEntityPtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * name; /* the entity name */ - int n_name; - int type; /* the entity type XML_xxx_yyy_ENTITY */ - int n_type; - xmlChar * ExternalID; /* the entity external ID if available */ - int n_ExternalID; - xmlChar * SystemID; /* the entity system ID if available */ - int n_SystemID; - xmlChar * content; /* the entity content */ - int n_content; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_type = 0;n_type < gen_nb_int;n_type++) { - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - type = gen_int(n_type, 2); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3); - SystemID = gen_const_xmlChar_ptr(n_SystemID, 4); - content = gen_const_xmlChar_ptr(n_content, 5); - - ret_val = xmlAddDocEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content); - desret_xmlEntityPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_int(n_type, type, 2); - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3); - des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAddDocEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf(" %d", n_type); - printf(" %d", n_ExternalID); - printf(" %d", n_SystemID); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlAddDtdEntity(void) { - int test_ret = 0; - - int mem_base; - xmlEntityPtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * name; /* the entity name */ - int n_name; - int type; /* the entity type XML_xxx_yyy_ENTITY */ - int n_type; - xmlChar * ExternalID; /* the entity external ID if available */ - int n_ExternalID; - xmlChar * SystemID; /* the entity system ID if available */ - int n_SystemID; - xmlChar * content; /* the entity content */ - int n_content; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_type = 0;n_type < gen_nb_int;n_type++) { - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - type = gen_int(n_type, 2); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3); - SystemID = gen_const_xmlChar_ptr(n_SystemID, 4); - content = gen_const_xmlChar_ptr(n_content, 5); - - ret_val = xmlAddDtdEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content); - desret_xmlEntityPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_int(n_type, type, 2); - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3); - des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAddDtdEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf(" %d", n_type); - printf(" %d", n_ExternalID); - printf(" %d", n_SystemID); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCleanupPredefinedEntities(void) { - int test_ret = 0; - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef LIBXML_LEGACY_ENABLED - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlCleanupPredefinedEntities(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCleanupPredefinedEntities", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -#define gen_nb_xmlEntitiesTablePtr 1 -static xmlEntitiesTablePtr gen_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlEntitiesTablePtr(int no ATTRIBUTE_UNUSED, xmlEntitiesTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlCopyEntitiesTable(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlCreateEntitiesTable(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlDumpEntitiesTable(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlBufferPtr buf; /* An XML buffer. */ - int n_buf; - xmlEntitiesTablePtr table; /* An entity table */ - int n_table; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_table = 0;n_table < gen_nb_xmlEntitiesTablePtr;n_table++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - table = gen_xmlEntitiesTablePtr(n_table, 1); - - xmlDumpEntitiesTable(buf, table); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlEntitiesTablePtr(n_table, table, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDumpEntitiesTable", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_table); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -#define gen_nb_xmlEntityPtr 1 -static xmlEntityPtr gen_xmlEntityPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlEntityPtr(int no ATTRIBUTE_UNUSED, xmlEntityPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlDumpEntityDecl(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlBufferPtr buf; /* An XML buffer. */ - int n_buf; - xmlEntityPtr ent; /* An entity table */ - int n_ent; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_ent = 0;n_ent < gen_nb_xmlEntityPtr;n_ent++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - ent = gen_xmlEntityPtr(n_ent, 1); - - xmlDumpEntityDecl(buf, ent); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlEntityPtr(n_ent, ent, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDumpEntityDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_ent); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlEncodeEntitiesReentrant(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlDocPtr doc; /* the document containing the string */ - int n_doc; - xmlChar * input; /* A string to convert to XML. */ - int n_input; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - input = gen_const_xmlChar_ptr(n_input, 1); - - ret_val = xmlEncodeEntitiesReentrant(doc, (const xmlChar *)input); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlEncodeEntitiesReentrant", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_input); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlEncodeSpecialChars(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlDocPtr doc; /* the document containing the string */ - int n_doc; - xmlChar * input; /* A string to convert to XML. */ - int n_input; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_input = 0;n_input < gen_nb_const_xmlChar_ptr;n_input++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - input = gen_const_xmlChar_ptr(n_input, 1); - - ret_val = xmlEncodeSpecialChars(doc, (const xmlChar *)input); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_input, (const xmlChar *)input, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlEncodeSpecialChars", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_input); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetDocEntity(void) { - int test_ret = 0; - - int mem_base; - xmlEntityPtr ret_val; - xmlDocPtr doc; /* the document referencing the entity */ - int n_doc; - xmlChar * name; /* the entity name */ - int n_name; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlGetDocEntity(doc, (const xmlChar *)name); - desret_xmlEntityPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetDocEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetDtdEntity(void) { - int test_ret = 0; - - int mem_base; - xmlEntityPtr ret_val; - xmlDocPtr doc; /* the document referencing the entity */ - int n_doc; - xmlChar * name; /* the entity name */ - int n_name; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlGetDtdEntity(doc, (const xmlChar *)name); - desret_xmlEntityPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetDtdEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetParameterEntity(void) { - int test_ret = 0; - - int mem_base; - xmlEntityPtr ret_val; - xmlDocPtr doc; /* the document referencing the entity */ - int n_doc; - xmlChar * name; /* the entity name */ - int n_name; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlGetParameterEntity(doc, (const xmlChar *)name); - desret_xmlEntityPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetParameterEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetPredefinedEntity(void) { - int test_ret = 0; - - int mem_base; - xmlEntityPtr ret_val; - xmlChar * name; /* the entity name */ - int n_name; - - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - name = gen_const_xmlChar_ptr(n_name, 0); - - ret_val = xmlGetPredefinedEntity((const xmlChar *)name); - desret_xmlEntityPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetPredefinedEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlInitializePredefinedEntities(void) { - int test_ret = 0; - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef LIBXML_LEGACY_ENABLED - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlInitializePredefinedEntities(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlInitializePredefinedEntities", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlNewEntity(void) { - int test_ret = 0; - - int mem_base; - xmlEntityPtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * name; /* the entity name */ - int n_name; - int type; /* the entity type XML_xxx_yyy_ENTITY */ - int n_type; - xmlChar * ExternalID; /* the entity external ID if available */ - int n_ExternalID; - xmlChar * SystemID; /* the entity system ID if available */ - int n_SystemID; - xmlChar * content; /* the entity content */ - int n_content; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_type = 0;n_type < gen_nb_int;n_type++) { - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - type = gen_int(n_type, 2); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3); - SystemID = gen_const_xmlChar_ptr(n_SystemID, 4); - content = gen_const_xmlChar_ptr(n_content, 5); - - ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content); - desret_xmlEntityPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_int(n_type, type, 2); - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3); - des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf(" %d", n_type); - printf(" %d", n_ExternalID); - printf(" %d", n_SystemID); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - -static int -test_entities(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n"); - test_ret += test_xmlAddDocEntity(); - test_ret += test_xmlAddDtdEntity(); - test_ret += test_xmlCleanupPredefinedEntities(); - test_ret += test_xmlCopyEntitiesTable(); - test_ret += test_xmlCreateEntitiesTable(); - test_ret += test_xmlDumpEntitiesTable(); - test_ret += test_xmlDumpEntityDecl(); - test_ret += test_xmlEncodeEntitiesReentrant(); - test_ret += test_xmlEncodeSpecialChars(); - test_ret += test_xmlGetDocEntity(); - test_ret += test_xmlGetDtdEntity(); - test_ret += test_xmlGetParameterEntity(); - test_ret += test_xmlGetPredefinedEntity(); - test_ret += test_xmlInitializePredefinedEntities(); - test_ret += test_xmlNewEntity(); - - if (test_ret != 0) - printf("Module entities: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlHashAddEntry(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - void * userdata; /* a pointer to the userdata */ - int n_userdata; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - userdata = gen_userdata(n_userdata, 2); - - ret_val = xmlHashAddEntry(table, (const xmlChar *)name, userdata); - desret_int(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_userdata(n_userdata, userdata, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashAddEntry", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_userdata); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashAddEntry2(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlChar * name2; /* a second name of the userdata */ - int n_name2; - void * userdata; /* a pointer to the userdata */ - int n_userdata; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { - for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - name2 = gen_const_xmlChar_ptr(n_name2, 2); - userdata = gen_userdata(n_userdata, 3); - - ret_val = xmlHashAddEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata); - desret_int(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); - des_userdata(n_userdata, userdata, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashAddEntry2", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_name2); - printf(" %d", n_userdata); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashAddEntry3(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlChar * name2; /* a second name of the userdata */ - int n_name2; - xmlChar * name3; /* a third name of the userdata */ - int n_name3; - void * userdata; /* a pointer to the userdata */ - int n_userdata; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { - for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { - for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - name2 = gen_const_xmlChar_ptr(n_name2, 2); - name3 = gen_const_xmlChar_ptr(n_name3, 3); - userdata = gen_userdata(n_userdata, 4); - - ret_val = xmlHashAddEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata); - desret_int(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); - des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); - des_userdata(n_userdata, userdata, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashAddEntry3", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_name2); - printf(" %d", n_name3); - printf(" %d", n_userdata); - printf("\n"); - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashCopy(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlHashCreate(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlHashCreateDict(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlHashLookup(void) { - int test_ret = 0; - - int mem_base; - void * ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlHashLookup(table, (const xmlChar *)name); - desret_void_ptr(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashLookup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashLookup2(void) { - int test_ret = 0; - - int mem_base; - void * ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlChar * name2; /* a second name of the userdata */ - int n_name2; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - name2 = gen_const_xmlChar_ptr(n_name2, 2); - - ret_val = xmlHashLookup2(table, (const xmlChar *)name, (const xmlChar *)name2); - desret_void_ptr(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashLookup2", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_name2); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashLookup3(void) { - int test_ret = 0; - - int mem_base; - void * ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlChar * name2; /* a second name of the userdata */ - int n_name2; - xmlChar * name3; /* a third name of the userdata */ - int n_name3; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { - for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - name2 = gen_const_xmlChar_ptr(n_name2, 2); - name3 = gen_const_xmlChar_ptr(n_name3, 3); - - ret_val = xmlHashLookup3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3); - desret_void_ptr(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); - des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashLookup3", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_name2); - printf(" %d", n_name3); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashQLookup(void) { - int test_ret = 0; - - int mem_base; - void * ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * prefix; /* the prefix of the userdata */ - int n_prefix; - xmlChar * name; /* the name of the userdata */ - int n_name; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - - ret_val = xmlHashQLookup(table, (const xmlChar *)prefix, (const xmlChar *)name); - desret_void_ptr(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashQLookup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_prefix); - printf(" %d", n_name); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashQLookup2(void) { - int test_ret = 0; - - int mem_base; - void * ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * prefix; /* the prefix of the userdata */ - int n_prefix; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlChar * prefix2; /* the second prefix of the userdata */ - int n_prefix2; - xmlChar * name2; /* a second name of the userdata */ - int n_name2; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) { - for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3); - name2 = gen_const_xmlChar_ptr(n_name2, 4); - - ret_val = xmlHashQLookup2(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2); - desret_void_ptr(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3); - des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashQLookup2", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_prefix); - printf(" %d", n_name); - printf(" %d", n_prefix2); - printf(" %d", n_name2); - printf("\n"); - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashQLookup3(void) { - int test_ret = 0; - - int mem_base; - void * ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * prefix; /* the prefix of the userdata */ - int n_prefix; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlChar * prefix2; /* the second prefix of the userdata */ - int n_prefix2; - xmlChar * name2; /* a second name of the userdata */ - int n_name2; - xmlChar * prefix3; /* the third prefix of the userdata */ - int n_prefix3; - xmlChar * name3; /* a third name of the userdata */ - int n_name3; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_prefix2 = 0;n_prefix2 < gen_nb_const_xmlChar_ptr;n_prefix2++) { - for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { - for (n_prefix3 = 0;n_prefix3 < gen_nb_const_xmlChar_ptr;n_prefix3++) { - for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - prefix2 = gen_const_xmlChar_ptr(n_prefix2, 3); - name2 = gen_const_xmlChar_ptr(n_name2, 4); - prefix3 = gen_const_xmlChar_ptr(n_prefix3, 5); - name3 = gen_const_xmlChar_ptr(n_name3, 6); - - ret_val = xmlHashQLookup3(table, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)prefix2, (const xmlChar *)name2, (const xmlChar *)prefix3, (const xmlChar *)name3); - desret_void_ptr(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_prefix2, (const xmlChar *)prefix2, 3); - des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 4); - des_const_xmlChar_ptr(n_prefix3, (const xmlChar *)prefix3, 5); - des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 6); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashQLookup3", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_prefix); - printf(" %d", n_name); - printf(" %d", n_prefix2); - printf(" %d", n_name2); - printf(" %d", n_prefix3); - printf(" %d", n_name3); - printf("\n"); - } - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashRemoveEntry(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlHashDeallocator f; /* the deallocator function for removed item (if any) */ - int n_f; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - f = gen_xmlHashDeallocator(n_f, 2); - - ret_val = xmlHashRemoveEntry(table, (const xmlChar *)name, f); - desret_int(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_xmlHashDeallocator(n_f, f, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashRemoveEntry", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_f); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashRemoveEntry2(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlChar * name2; /* a second name of the userdata */ - int n_name2; - xmlHashDeallocator f; /* the deallocator function for removed item (if any) */ - int n_f; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { - for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - name2 = gen_const_xmlChar_ptr(n_name2, 2); - f = gen_xmlHashDeallocator(n_f, 3); - - ret_val = xmlHashRemoveEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, f); - desret_int(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); - des_xmlHashDeallocator(n_f, f, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashRemoveEntry2", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_name2); - printf(" %d", n_f); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashRemoveEntry3(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlChar * name2; /* a second name of the userdata */ - int n_name2; - xmlChar * name3; /* a third name of the userdata */ - int n_name3; - xmlHashDeallocator f; /* the deallocator function for removed item (if any) */ - int n_f; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { - for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { - for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - name2 = gen_const_xmlChar_ptr(n_name2, 2); - name3 = gen_const_xmlChar_ptr(n_name3, 3); - f = gen_xmlHashDeallocator(n_f, 4); - - ret_val = xmlHashRemoveEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, f); - desret_int(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); - des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); - des_xmlHashDeallocator(n_f, f, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashRemoveEntry3", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_name2); - printf(" %d", n_name3); - printf(" %d", n_f); - printf("\n"); - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashScan(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlHashScan3(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlHashScanFull(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlHashScanFull3(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlHashSize(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - - ret_val = xmlHashSize(table); - desret_int(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashSize", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashUpdateEntry(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - void * userdata; /* a pointer to the userdata */ - int n_userdata; - xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */ - int n_f; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { - for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - userdata = gen_userdata(n_userdata, 2); - f = gen_xmlHashDeallocator(n_f, 3); - - ret_val = xmlHashUpdateEntry(table, (const xmlChar *)name, userdata, f); - desret_int(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_userdata(n_userdata, userdata, 2); - des_xmlHashDeallocator(n_f, f, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashUpdateEntry", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_userdata); - printf(" %d", n_f); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashUpdateEntry2(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlChar * name2; /* a second name of the userdata */ - int n_name2; - void * userdata; /* a pointer to the userdata */ - int n_userdata; - xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */ - int n_f; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { - for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { - for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - name2 = gen_const_xmlChar_ptr(n_name2, 2); - userdata = gen_userdata(n_userdata, 3); - f = gen_xmlHashDeallocator(n_f, 4); - - ret_val = xmlHashUpdateEntry2(table, (const xmlChar *)name, (const xmlChar *)name2, userdata, f); - desret_int(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); - des_userdata(n_userdata, userdata, 3); - des_xmlHashDeallocator(n_f, f, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashUpdateEntry2", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_name2); - printf(" %d", n_userdata); - printf(" %d", n_f); - printf("\n"); - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHashUpdateEntry3(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlHashTablePtr table; /* the hash table */ - int n_table; - xmlChar * name; /* the name of the userdata */ - int n_name; - xmlChar * name2; /* a second name of the userdata */ - int n_name2; - xmlChar * name3; /* a third name of the userdata */ - int n_name3; - void * userdata; /* a pointer to the userdata */ - int n_userdata; - xmlHashDeallocator f; /* the deallocator function for replaced item (if any) */ - int n_f; - - for (n_table = 0;n_table < gen_nb_xmlHashTablePtr;n_table++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_name2 = 0;n_name2 < gen_nb_const_xmlChar_ptr;n_name2++) { - for (n_name3 = 0;n_name3 < gen_nb_const_xmlChar_ptr;n_name3++) { - for (n_userdata = 0;n_userdata < gen_nb_userdata;n_userdata++) { - for (n_f = 0;n_f < gen_nb_xmlHashDeallocator;n_f++) { - mem_base = xmlMemBlocks(); - table = gen_xmlHashTablePtr(n_table, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - name2 = gen_const_xmlChar_ptr(n_name2, 2); - name3 = gen_const_xmlChar_ptr(n_name3, 3); - userdata = gen_userdata(n_userdata, 4); - f = gen_xmlHashDeallocator(n_f, 5); - - ret_val = xmlHashUpdateEntry3(table, (const xmlChar *)name, (const xmlChar *)name2, (const xmlChar *)name3, userdata, f); - desret_int(ret_val); - call_tests++; - des_xmlHashTablePtr(n_table, table, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_name2, (const xmlChar *)name2, 2); - des_const_xmlChar_ptr(n_name3, (const xmlChar *)name3, 3); - des_userdata(n_userdata, userdata, 4); - des_xmlHashDeallocator(n_f, f, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHashUpdateEntry3", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_table); - printf(" %d", n_name); - printf(" %d", n_name2); - printf(" %d", n_name3); - printf(" %d", n_userdata); - printf(" %d", n_f); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - -static int -test_hash(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing hash : 16 of 24 functions ...\n"); - test_ret += test_xmlHashAddEntry(); - test_ret += test_xmlHashAddEntry2(); - test_ret += test_xmlHashAddEntry3(); - test_ret += test_xmlHashCopy(); - test_ret += test_xmlHashCreate(); - test_ret += test_xmlHashCreateDict(); - test_ret += test_xmlHashLookup(); - test_ret += test_xmlHashLookup2(); - test_ret += test_xmlHashLookup3(); - test_ret += test_xmlHashQLookup(); - test_ret += test_xmlHashQLookup2(); - test_ret += test_xmlHashQLookup3(); - test_ret += test_xmlHashRemoveEntry(); - test_ret += test_xmlHashRemoveEntry2(); - test_ret += test_xmlHashRemoveEntry3(); - test_ret += test_xmlHashScan(); - test_ret += test_xmlHashScan3(); - test_ret += test_xmlHashScanFull(); - test_ret += test_xmlHashScanFull3(); - test_ret += test_xmlHashSize(); - test_ret += test_xmlHashUpdateEntry(); - test_ret += test_xmlHashUpdateEntry2(); - test_ret += test_xmlHashUpdateEntry3(); - - if (test_ret != 0) - printf("Module hash: %d errors\n", test_ret); - return(test_ret); -} - -#define gen_nb_xmlLinkPtr 1 -static xmlLinkPtr gen_xmlLinkPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlLinkPtr(int no ATTRIBUTE_UNUSED, xmlLinkPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlLinkGetData(void) { - int test_ret = 0; - - int mem_base; - void * ret_val; - xmlLinkPtr lk; /* a link */ - int n_lk; - - for (n_lk = 0;n_lk < gen_nb_xmlLinkPtr;n_lk++) { - mem_base = xmlMemBlocks(); - lk = gen_xmlLinkPtr(n_lk, 0); - - ret_val = xmlLinkGetData(lk); - desret_void_ptr(ret_val); - call_tests++; - des_xmlLinkPtr(n_lk, lk, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlLinkGetData", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_lk); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListAppend(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlListPtr l; /* a list */ - int n_l; - void * data; /* the data */ - int n_data; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - data = gen_userdata(n_data, 1); - - ret_val = xmlListAppend(l, data); - desret_int(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - des_userdata(n_data, data, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListAppend", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf(" %d", n_data); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListClear(void) { - int test_ret = 0; - - int mem_base; - xmlListPtr l; /* a list */ - int n_l; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - - xmlListClear(l); - call_tests++; - des_xmlListPtr(n_l, l, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListClear", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_const_xmlListPtr 1 -static xmlListPtr gen_const_xmlListPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_xmlListPtr(int no ATTRIBUTE_UNUSED, const xmlListPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlListCopy(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlListPtr cur; /* the new list */ - int n_cur; - xmlListPtr old; /* the old list */ - int n_old; - - for (n_cur = 0;n_cur < gen_nb_xmlListPtr;n_cur++) { - for (n_old = 0;n_old < gen_nb_const_xmlListPtr;n_old++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlListPtr(n_cur, 0); - old = gen_const_xmlListPtr(n_old, 1); - - ret_val = xmlListCopy(cur, (const xmlListPtr)old); - desret_int(ret_val); - call_tests++; - des_xmlListPtr(n_cur, cur, 0); - des_const_xmlListPtr(n_old, (const xmlListPtr)old, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListCopy", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_old); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListCreate(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlListDup(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlListEmpty(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlListPtr l; /* a list */ - int n_l; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - - ret_val = xmlListEmpty(l); - desret_int(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListEmpty", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListEnd(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlListFront(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlListInsert(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlListPtr l; /* a list */ - int n_l; - void * data; /* the data */ - int n_data; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - data = gen_userdata(n_data, 1); - - ret_val = xmlListInsert(l, data); - desret_int(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - des_userdata(n_data, data, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListInsert", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf(" %d", n_data); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListMerge(void) { - int test_ret = 0; - - int mem_base; - xmlListPtr l1; /* the original list */ - int n_l1; - xmlListPtr l2; /* the new list */ - int n_l2; - - for (n_l1 = 0;n_l1 < gen_nb_xmlListPtr;n_l1++) { - for (n_l2 = 0;n_l2 < gen_nb_xmlListPtr;n_l2++) { - mem_base = xmlMemBlocks(); - l1 = gen_xmlListPtr(n_l1, 0); - l2 = gen_xmlListPtr(n_l2, 1); - - xmlListMerge(l1, l2); - call_tests++; - des_xmlListPtr(n_l1, l1, 0); - des_xmlListPtr(n_l2, l2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListMerge", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l1); - printf(" %d", n_l2); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListPopBack(void) { - int test_ret = 0; - - int mem_base; - xmlListPtr l; /* a list */ - int n_l; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - - xmlListPopBack(l); - call_tests++; - des_xmlListPtr(n_l, l, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListPopBack", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListPopFront(void) { - int test_ret = 0; - - int mem_base; - xmlListPtr l; /* a list */ - int n_l; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - - xmlListPopFront(l); - call_tests++; - des_xmlListPtr(n_l, l, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListPopFront", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListPushBack(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlListPtr l; /* a list */ - int n_l; - void * data; /* new data */ - int n_data; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - data = gen_userdata(n_data, 1); - - ret_val = xmlListPushBack(l, data); - desret_int(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - des_userdata(n_data, data, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListPushBack", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf(" %d", n_data); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListPushFront(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlListPtr l; /* a list */ - int n_l; - void * data; /* new data */ - int n_data; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - data = gen_userdata(n_data, 1); - - ret_val = xmlListPushFront(l, data); - desret_int(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - des_userdata(n_data, data, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListPushFront", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf(" %d", n_data); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListRemoveAll(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlListPtr l; /* a list */ - int n_l; - void * data; /* list data */ - int n_data; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - data = gen_userdata(n_data, 1); - - ret_val = xmlListRemoveAll(l, data); - desret_int(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - des_userdata(n_data, data, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListRemoveAll", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf(" %d", n_data); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListRemoveFirst(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlListPtr l; /* a list */ - int n_l; - void * data; /* list data */ - int n_data; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - data = gen_userdata(n_data, 1); - - ret_val = xmlListRemoveFirst(l, data); - desret_int(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - des_userdata(n_data, data, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListRemoveFirst", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf(" %d", n_data); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListRemoveLast(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlListPtr l; /* a list */ - int n_l; - void * data; /* list data */ - int n_data; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - data = gen_userdata(n_data, 1); - - ret_val = xmlListRemoveLast(l, data); - desret_int(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - des_userdata(n_data, data, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListRemoveLast", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf(" %d", n_data); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListReverse(void) { - int test_ret = 0; - - int mem_base; - xmlListPtr l; /* a list */ - int n_l; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - - xmlListReverse(l); - call_tests++; - des_xmlListPtr(n_l, l, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListReverse", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListReverseSearch(void) { - int test_ret = 0; - - int mem_base; - void * ret_val; - xmlListPtr l; /* a list */ - int n_l; - void * data; /* a search value */ - int n_data; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - data = gen_userdata(n_data, 1); - - ret_val = xmlListReverseSearch(l, data); - desret_void_ptr(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - des_userdata(n_data, data, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListReverseSearch", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf(" %d", n_data); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListReverseWalk(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlListSearch(void) { - int test_ret = 0; - - int mem_base; - void * ret_val; - xmlListPtr l; /* a list */ - int n_l; - void * data; /* a search value */ - int n_data; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - data = gen_userdata(n_data, 1); - - ret_val = xmlListSearch(l, data); - desret_void_ptr(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - des_userdata(n_data, data, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListSearch", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf(" %d", n_data); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListSize(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlListPtr l; /* a list */ - int n_l; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - - ret_val = xmlListSize(l); - desret_int(ret_val); - call_tests++; - des_xmlListPtr(n_l, l, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListSize", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListSort(void) { - int test_ret = 0; - - int mem_base; - xmlListPtr l; /* a list */ - int n_l; - - for (n_l = 0;n_l < gen_nb_xmlListPtr;n_l++) { - mem_base = xmlMemBlocks(); - l = gen_xmlListPtr(n_l, 0); - - xmlListSort(l); - call_tests++; - des_xmlListPtr(n_l, l, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlListSort", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_l); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlListWalk(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -static int -test_list(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing list : 19 of 26 functions ...\n"); - test_ret += test_xmlLinkGetData(); - test_ret += test_xmlListAppend(); - test_ret += test_xmlListClear(); - test_ret += test_xmlListCopy(); - test_ret += test_xmlListCreate(); - test_ret += test_xmlListDup(); - test_ret += test_xmlListEmpty(); - test_ret += test_xmlListEnd(); - test_ret += test_xmlListFront(); - test_ret += test_xmlListInsert(); - test_ret += test_xmlListMerge(); - test_ret += test_xmlListPopBack(); - test_ret += test_xmlListPopFront(); - test_ret += test_xmlListPushBack(); - test_ret += test_xmlListPushFront(); - test_ret += test_xmlListRemoveAll(); - test_ret += test_xmlListRemoveFirst(); - test_ret += test_xmlListRemoveLast(); - test_ret += test_xmlListReverse(); - test_ret += test_xmlListReverseSearch(); - test_ret += test_xmlListReverseWalk(); - test_ret += test_xmlListSearch(); - test_ret += test_xmlListSize(); - test_ret += test_xmlListSort(); - test_ret += test_xmlListWalk(); - - if (test_ret != 0) - printf("Module list: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlNanoFTPCheckResponse(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* an FTP context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); - - ret_val = xmlNanoFTPCheckResponse(ctx); - desret_int(ret_val); - call_tests++; - des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPCheckResponse", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPCleanup(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlNanoFTPCleanup(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPCleanup", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPCloseConnection(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* an FTP context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); - - ret_val = xmlNanoFTPCloseConnection(ctx); - desret_int(ret_val); - call_tests++; - des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPCloseConnection", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPCwd(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* an FTP context */ - int n_ctx; - char * directory; /* a directory on the server */ - int n_directory; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { - for (n_directory = 0;n_directory < gen_nb_const_char_ptr;n_directory++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); - directory = gen_const_char_ptr(n_directory, 1); - - ret_val = xmlNanoFTPCwd(ctx, (const char *)directory); - desret_int(ret_val); - call_tests++; - des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); - des_const_char_ptr(n_directory, (const char *)directory, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPCwd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_directory); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPDele(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* an FTP context */ - int n_ctx; - const char * file; /* a file or directory on the server */ - int n_file; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { - for (n_file = 0;n_file < gen_nb_filepath;n_file++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); - file = gen_filepath(n_file, 1); - - ret_val = xmlNanoFTPDele(ctx, file); - desret_int(ret_val); - call_tests++; - des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); - des_filepath(n_file, file, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPDele", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_file); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPGet(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlNanoFTPGetConnection(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlNanoFTPGetResponse(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* an FTP context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); - - ret_val = xmlNanoFTPGetResponse(ctx); - desret_int(ret_val); - call_tests++; - des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPGetResponse", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPGetSocket(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlNanoFTPInit(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlNanoFTPInit(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPInit", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPList(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlNanoFTPNewCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - void * ret_val; - const char * URL; /* The URL used to initialize the context */ - int n_URL; - - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - mem_base = xmlMemBlocks(); - URL = gen_filepath(n_URL, 0); - - ret_val = xmlNanoFTPNewCtxt(URL); - desret_xmlNanoFTPCtxtPtr(ret_val); - call_tests++; - des_filepath(n_URL, URL, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPNewCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPOpen(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - void * ret_val; - const char * URL; /* the URL to the resource */ - int n_URL; - - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - mem_base = xmlMemBlocks(); - URL = gen_filepath(n_URL, 0); - - ret_val = xmlNanoFTPOpen(URL); - desret_xmlNanoFTPCtxtPtr(ret_val); - call_tests++; - des_filepath(n_URL, URL, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPOpen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPProxy(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - char * host; /* the proxy host name */ - int n_host; - int port; /* the proxy port */ - int n_port; - char * user; /* the proxy user name */ - int n_user; - char * passwd; /* the proxy password */ - int n_passwd; - int type; /* the type of proxy 1 for using SITE, 2 for USER a@b */ - int n_type; - - for (n_host = 0;n_host < gen_nb_const_char_ptr;n_host++) { - for (n_port = 0;n_port < gen_nb_int;n_port++) { - for (n_user = 0;n_user < gen_nb_const_char_ptr;n_user++) { - for (n_passwd = 0;n_passwd < gen_nb_const_char_ptr;n_passwd++) { - for (n_type = 0;n_type < gen_nb_int;n_type++) { - host = gen_const_char_ptr(n_host, 0); - port = gen_int(n_port, 1); - user = gen_const_char_ptr(n_user, 2); - passwd = gen_const_char_ptr(n_passwd, 3); - type = gen_int(n_type, 4); - - xmlNanoFTPProxy((const char *)host, port, (const char *)user, (const char *)passwd, type); - call_tests++; - des_const_char_ptr(n_host, (const char *)host, 0); - des_int(n_port, port, 1); - des_const_char_ptr(n_user, (const char *)user, 2); - des_const_char_ptr(n_passwd, (const char *)passwd, 3); - des_int(n_type, type, 4); - xmlResetLastError(); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPQuit(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* an FTP context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); - - ret_val = xmlNanoFTPQuit(ctx); - desret_int(ret_val); - call_tests++; - des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPQuit", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPRead(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* the FTP context */ - int n_ctx; - void * dest; /* a buffer */ - int n_dest; - int len; /* the buffer length */ - int n_len; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { - for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); - dest = gen_void_ptr(n_dest, 1); - len = gen_int(n_len, 2); - - ret_val = xmlNanoFTPRead(ctx, dest, len); - desret_int(ret_val); - call_tests++; - des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); - des_void_ptr(n_dest, dest, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPRead", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_dest); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPScanProxy(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - const char * URL; /* The proxy URL used to initialize the proxy context */ - int n_URL; - - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - URL = gen_filepath(n_URL, 0); - - xmlNanoFTPScanProxy(URL); - call_tests++; - des_filepath(n_URL, URL, 0); - xmlResetLastError(); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoFTPUpdateURL(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* an FTP context */ - int n_ctx; - const char * URL; /* The URL used to update the context */ - int n_URL; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoFTPCtxtPtr;n_ctx++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoFTPCtxtPtr(n_ctx, 0); - URL = gen_filepath(n_URL, 1); - - ret_val = xmlNanoFTPUpdateURL(ctx, URL); - desret_int(ret_val); - call_tests++; - des_xmlNanoFTPCtxtPtr(n_ctx, ctx, 0); - des_filepath(n_URL, URL, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoFTPUpdateURL", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_URL); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_nanoftp(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing nanoftp : 14 of 22 functions ...\n"); - test_ret += test_xmlNanoFTPCheckResponse(); - test_ret += test_xmlNanoFTPCleanup(); - test_ret += test_xmlNanoFTPCloseConnection(); - test_ret += test_xmlNanoFTPCwd(); - test_ret += test_xmlNanoFTPDele(); - test_ret += test_xmlNanoFTPGet(); - test_ret += test_xmlNanoFTPGetConnection(); - test_ret += test_xmlNanoFTPGetResponse(); - test_ret += test_xmlNanoFTPGetSocket(); - test_ret += test_xmlNanoFTPInit(); - test_ret += test_xmlNanoFTPList(); - test_ret += test_xmlNanoFTPNewCtxt(); - test_ret += test_xmlNanoFTPOpen(); - test_ret += test_xmlNanoFTPProxy(); - test_ret += test_xmlNanoFTPQuit(); - test_ret += test_xmlNanoFTPRead(); - test_ret += test_xmlNanoFTPScanProxy(); - test_ret += test_xmlNanoFTPUpdateURL(); - - if (test_ret != 0) - printf("Module nanoftp: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlNanoHTTPAuthHeader(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - const char * ret_val; - void * ctx; /* the HTTP context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); - - ret_val = xmlNanoHTTPAuthHeader(ctx); - desret_const_char_ptr(ret_val); - call_tests++; - des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPAuthHeader", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPCleanup(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlNanoHTTPCleanup(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPCleanup", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPContentLength(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* the HTTP context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); - - ret_val = xmlNanoHTTPContentLength(ctx); - desret_int(ret_val); - call_tests++; - des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPContentLength", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPEncoding(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - const char * ret_val; - void * ctx; /* the HTTP context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); - - ret_val = xmlNanoHTTPEncoding(ctx); - desret_const_char_ptr(ret_val); - call_tests++; - des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPEncoding", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -#define gen_nb_char_ptr_ptr 1 -static char ** gen_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_char_ptr_ptr(int no ATTRIBUTE_UNUSED, char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlNanoHTTPFetch(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - int ret_val; - const char * URL; /* The URL to load */ - int n_URL; - const char * filename; /* the filename where the content should be saved */ - int n_filename; - char ** contentType; /* if available the Content-Type information will be returned at that location */ - int n_contentType; - - for (n_URL = 0;n_URL < gen_nb_fileoutput;n_URL++) { - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { - mem_base = xmlMemBlocks(); - URL = gen_fileoutput(n_URL, 0); - filename = gen_fileoutput(n_filename, 1); - contentType = gen_char_ptr_ptr(n_contentType, 2); - - ret_val = xmlNanoHTTPFetch(URL, filename, contentType); - desret_int(ret_val); - call_tests++; - des_fileoutput(n_URL, URL, 0); - des_fileoutput(n_filename, filename, 1); - des_char_ptr_ptr(n_contentType, contentType, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPFetch", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf(" %d", n_filename); - printf(" %d", n_contentType); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPInit(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlNanoHTTPInit(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPInit", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPMimeType(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - const char * ret_val; - void * ctx; /* the HTTP context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); - - ret_val = xmlNanoHTTPMimeType(ctx); - desret_const_char_ptr(ret_val); - call_tests++; - des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPMimeType", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPOpen(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - void * ret_val; - const char * URL; /* The URL to load */ - int n_URL; - char ** contentType; /* if available the Content-Type information will be returned at that location */ - int n_contentType; - - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { - mem_base = xmlMemBlocks(); - URL = gen_filepath(n_URL, 0); - contentType = gen_char_ptr_ptr(n_contentType, 1); - - ret_val = xmlNanoHTTPOpen(URL, contentType); - desret_xmlNanoHTTPCtxtPtr(ret_val); - call_tests++; - des_filepath(n_URL, URL, 0); - des_char_ptr_ptr(n_contentType, contentType, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPOpen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf(" %d", n_contentType); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPOpenRedir(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - void * ret_val; - const char * URL; /* The URL to load */ - int n_URL; - char ** contentType; /* if available the Content-Type information will be returned at that location */ - int n_contentType; - char ** redir; /* if available the redirected URL will be returned */ - int n_redir; - - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_contentType = 0;n_contentType < gen_nb_char_ptr_ptr;n_contentType++) { - for (n_redir = 0;n_redir < gen_nb_char_ptr_ptr;n_redir++) { - mem_base = xmlMemBlocks(); - URL = gen_filepath(n_URL, 0); - contentType = gen_char_ptr_ptr(n_contentType, 1); - redir = gen_char_ptr_ptr(n_redir, 2); - - ret_val = xmlNanoHTTPOpenRedir(URL, contentType, redir); - desret_xmlNanoHTTPCtxtPtr(ret_val); - call_tests++; - des_filepath(n_URL, URL, 0); - des_char_ptr_ptr(n_contentType, contentType, 1); - des_char_ptr_ptr(n_redir, redir, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPOpenRedir", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf(" %d", n_contentType); - printf(" %d", n_redir); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPRead(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* the HTTP context */ - int n_ctx; - void * dest; /* a buffer */ - int n_dest; - int len; /* the buffer length */ - int n_len; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { - for (n_dest = 0;n_dest < gen_nb_void_ptr;n_dest++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); - dest = gen_void_ptr(n_dest, 1); - len = gen_int(n_len, 2); - - ret_val = xmlNanoHTTPRead(ctx, dest, len); - desret_int(ret_val); - call_tests++; - des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); - des_void_ptr(n_dest, dest, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPRead", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_dest); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPRedir(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlNanoHTTPReturnCode(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - int ret_val; - void * ctx; /* the HTTP context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_xmlNanoHTTPCtxtPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlNanoHTTPCtxtPtr(n_ctx, 0); - - ret_val = xmlNanoHTTPReturnCode(ctx); - desret_int(ret_val); - call_tests++; - des_xmlNanoHTTPCtxtPtr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPReturnCode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPSave(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - void * ctxt; /* the HTTP context */ - int n_ctxt; - const char * filename; /* the filename where the content should be saved */ - int n_filename; - - for (n_ctxt = 0;n_ctxt < gen_nb_void_ptr;n_ctxt++) { - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - mem_base = xmlMemBlocks(); - ctxt = gen_void_ptr(n_ctxt, 0); - filename = gen_fileoutput(n_filename, 1); - - ret_val = xmlNanoHTTPSave(ctxt, filename); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_ctxt, ctxt, 0); - des_fileoutput(n_filename, filename, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNanoHTTPSave", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_filename); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNanoHTTPScanProxy(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - const char * URL; /* The proxy URL used to initialize the proxy context */ - int n_URL; - - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - URL = gen_filepath(n_URL, 0); - - xmlNanoHTTPScanProxy(URL); - call_tests++; - des_filepath(n_URL, URL, 0); - xmlResetLastError(); - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_nanohttp(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing nanohttp : 13 of 17 functions ...\n"); - test_ret += test_xmlNanoHTTPAuthHeader(); - test_ret += test_xmlNanoHTTPCleanup(); - test_ret += test_xmlNanoHTTPContentLength(); - test_ret += test_xmlNanoHTTPEncoding(); - test_ret += test_xmlNanoHTTPFetch(); - test_ret += test_xmlNanoHTTPInit(); - test_ret += test_xmlNanoHTTPMimeType(); - test_ret += test_xmlNanoHTTPOpen(); - test_ret += test_xmlNanoHTTPOpenRedir(); - test_ret += test_xmlNanoHTTPRead(); - test_ret += test_xmlNanoHTTPRedir(); - test_ret += test_xmlNanoHTTPReturnCode(); - test_ret += test_xmlNanoHTTPSave(); - test_ret += test_xmlNanoHTTPScanProxy(); - - if (test_ret != 0) - printf("Module nanohttp: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlByteConsumed(void) { - int test_ret = 0; - - int mem_base; - long ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = xmlByteConsumed(ctxt); - desret_long(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlByteConsumed", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlClearNodeInfoSeq(void) { - int test_ret = 0; - - int mem_base; - xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */ - int n_seq; - - for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) { - mem_base = xmlMemBlocks(); - seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0); - - xmlClearNodeInfoSeq(seq); - call_tests++; - des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlClearNodeInfoSeq", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_seq); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlClearParserCtxt(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - xmlClearParserCtxt(ctxt); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlClearParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCreateDocParserCtxt(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ret_val; - xmlChar * cur; /* a pointer to an array of xmlChar */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_const_xmlChar_ptr(n_cur, 0); - - ret_val = xmlCreateDocParserCtxt((const xmlChar *)cur); - desret_xmlParserCtxtPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCreateDocParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCreatePushParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_PUSH_ENABLED) - int mem_base; - xmlParserCtxtPtr ret_val; - xmlSAXHandlerPtr sax; /* a SAX handler */ - int n_sax; - void * user_data; /* The user data returned on SAX callbacks */ - int n_user_data; - char * chunk; /* a pointer to an array of chars */ - int n_chunk; - int size; /* number of chars in the array */ - int n_size; - const char * filename; /* an optional file name or URI */ - int n_filename; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { - for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - mem_base = xmlMemBlocks(); - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - user_data = gen_userdata(n_user_data, 1); - chunk = gen_const_char_ptr(n_chunk, 2); - size = gen_int(n_size, 3); - filename = gen_fileoutput(n_filename, 4); - - ret_val = xmlCreatePushParserCtxt(sax, user_data, (const char *)chunk, size, filename); - desret_xmlParserCtxtPtr(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_userdata(n_user_data, user_data, 1); - des_const_char_ptr(n_chunk, (const char *)chunk, 2); - des_int(n_size, size, 3); - des_fileoutput(n_filename, filename, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCreatePushParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_user_data); - printf(" %d", n_chunk); - printf(" %d", n_size); - printf(" %d", n_filename); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCtxtReadDoc(void) { - int test_ret = 0; - - int mem_base; - xmlDocPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlChar * cur; /* a pointer to a zero terminated string */ - int n_cur; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - cur = gen_const_xmlChar_ptr(n_cur, 1); - URL = gen_filepath(n_URL, 2); - encoding = gen_const_char_ptr(n_encoding, 3); - options = gen_parseroptions(n_options, 4); - - ret_val = xmlCtxtReadDoc(ctxt, (const xmlChar *)cur, URL, (const char *)encoding, options); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); - des_filepath(n_URL, URL, 2); - des_const_char_ptr(n_encoding, (const char *)encoding, 3); - des_parseroptions(n_options, options, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCtxtReadDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCtxtReadFile(void) { - int test_ret = 0; - - int mem_base; - xmlDocPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - const char * filename; /* a file or URL */ - int n_filename; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - filename = gen_filepath(n_filename, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - options = gen_parseroptions(n_options, 3); - - ret_val = xmlCtxtReadFile(ctxt, filename, (const char *)encoding, options); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_filepath(n_filename, filename, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_parseroptions(n_options, options, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCtxtReadFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_filename); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCtxtReadMemory(void) { - int test_ret = 0; - - int mem_base; - xmlDocPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - char * buffer; /* a pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - buffer = gen_const_char_ptr(n_buffer, 1); - size = gen_int(n_size, 2); - URL = gen_filepath(n_URL, 3); - encoding = gen_const_char_ptr(n_encoding, 4); - options = gen_parseroptions(n_options, 5); - - ret_val = xmlCtxtReadMemory(ctxt, (const char *)buffer, size, URL, (const char *)encoding, options); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_char_ptr(n_buffer, (const char *)buffer, 1); - des_int(n_size, size, 2); - des_filepath(n_URL, URL, 3); - des_const_char_ptr(n_encoding, (const char *)encoding, 4); - des_parseroptions(n_options, options, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCtxtReadMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_buffer); - printf(" %d", n_size); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCtxtReset(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - xmlCtxtReset(ctxt); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCtxtReset", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCtxtResetPush(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - char * chunk; /* a pointer to an array of chars */ - int n_chunk; - int size; /* number of chars in the array */ - int n_size; - const char * filename; /* an optional file name or URI */ - int n_filename; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - chunk = gen_const_char_ptr(n_chunk, 1); - size = gen_int(n_size, 2); - filename = gen_filepath(n_filename, 3); - encoding = gen_const_char_ptr(n_encoding, 4); - - ret_val = xmlCtxtResetPush(ctxt, (const char *)chunk, size, filename, (const char *)encoding); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_char_ptr(n_chunk, (const char *)chunk, 1); - des_int(n_size, size, 2); - des_filepath(n_filename, filename, 3); - des_const_char_ptr(n_encoding, (const char *)encoding, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCtxtResetPush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_chunk); - printf(" %d", n_size); - printf(" %d", n_filename); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCtxtUseOptions(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - options = gen_parseroptions(n_options, 1); - - ret_val = xmlCtxtUseOptions(ctxt, options); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_parseroptions(n_options, options, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCtxtUseOptions", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_options); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetExternalEntityLoader(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlGetFeature(void) { - int test_ret = 0; - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef LIBXML_LEGACY_ENABLED - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */ - int n_ctxt; - char * name; /* the feature name */ - int n_name; - void * result; /* location to store the result */ - int n_result; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { - for (n_result = 0;n_result < gen_nb_void_ptr;n_result++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - name = gen_const_char_ptr(n_name, 1); - result = gen_void_ptr(n_result, 2); - - ret_val = xmlGetFeature(ctxt, (const char *)name, result); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_char_ptr(n_name, (const char *)name, 1); - des_void_ptr(n_result, result, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetFeature", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_name); - printf(" %d", n_result); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -#define gen_nb_const_char_ptr_ptr 1 -static char ** gen_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_char_ptr_ptr(int no ATTRIBUTE_UNUSED, const char ** val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlGetFeaturesList(void) { - int test_ret = 0; - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef LIBXML_LEGACY_ENABLED - int mem_base; - int ret_val; - int * len; /* the length of the features name array (input/output) */ - int n_len; - char ** result; /* an array of string to be filled with the features name. */ - int n_result; - - for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { - for (n_result = 0;n_result < gen_nb_const_char_ptr_ptr;n_result++) { - mem_base = xmlMemBlocks(); - len = gen_int_ptr(n_len, 0); - result = gen_const_char_ptr_ptr(n_result, 1); - - ret_val = xmlGetFeaturesList(len, (const char **)result); - desret_int(ret_val); - call_tests++; - des_int_ptr(n_len, len, 0); - des_const_char_ptr_ptr(n_result, (const char **)result, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetFeaturesList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_len); - printf(" %d", n_result); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlHasFeature(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlFeature feature; /* the feature to be examined */ - int n_feature; - - for (n_feature = 0;n_feature < gen_nb_xmlFeature;n_feature++) { - mem_base = xmlMemBlocks(); - feature = gen_xmlFeature(n_feature, 0); - - ret_val = xmlHasFeature(feature); - desret_int(ret_val); - call_tests++; - des_xmlFeature(n_feature, feature, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHasFeature", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_feature); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIOParseDTD(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) -#ifdef LIBXML_VALID_ENABLED - xmlDtdPtr ret_val; - xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */ - int n_sax; - xmlParserInputBufferPtr input; /* an Input Buffer */ - int n_input; - xmlCharEncoding enc; /* the charset encoding if known */ - int n_enc; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - input = gen_xmlParserInputBufferPtr(n_input, 1); - enc = gen_xmlCharEncoding(n_enc, 2); - - ret_val = xmlIOParseDTD(sax, input, enc); - input = NULL; - desret_xmlDtdPtr(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_xmlParserInputBufferPtr(n_input, input, 1); - des_xmlCharEncoding(n_enc, enc, 2); - xmlResetLastError(); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlInitNodeInfoSeq(void) { - int test_ret = 0; - - int mem_base; - xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */ - int n_seq; - - for (n_seq = 0;n_seq < gen_nb_xmlParserNodeInfoSeqPtr;n_seq++) { - mem_base = xmlMemBlocks(); - seq = gen_xmlParserNodeInfoSeqPtr(n_seq, 0); - - xmlInitNodeInfoSeq(seq); - call_tests++; - des_xmlParserNodeInfoSeqPtr(n_seq, seq, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlInitNodeInfoSeq", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_seq); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlInitParser(void) { - int test_ret = 0; - - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlInitParser(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlInitParser", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlInitParserCtxt(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = xmlInitParserCtxt(ctxt); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlInitParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlKeepBlanksDefault(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - int val; /* int 0 or 1 */ - int n_val; - - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_int(n_val, 0); - - ret_val = xmlKeepBlanksDefault(val); - desret_int(ret_val); - call_tests++; - des_int(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlKeepBlanksDefault", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlLineNumbersDefault(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - int val; /* int 0 or 1 */ - int n_val; - - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_int(n_val, 0); - - ret_val = xmlLineNumbersDefault(val); - desret_int(ret_val); - call_tests++; - des_int(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlLineNumbersDefault", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlLoadExternalEntity(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - const char * URL; /* the URL for the entity to load */ - int n_URL; - char * ID; /* the Public ID for the entity to load */ - int n_ID; - xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */ - int n_ctxt; - - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) { - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - URL = gen_filepath(n_URL, 0); - ID = gen_const_char_ptr(n_ID, 1); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2); - - ret_val = xmlLoadExternalEntity(URL, (const char *)ID, ctxt); - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_filepath(n_URL, URL, 0); - des_const_char_ptr(n_ID, (const char *)ID, 1); - des_xmlParserCtxtPtr(n_ctxt, ctxt, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlLoadExternalEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf(" %d", n_ID); - printf(" %d", n_ctxt); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewIOInputStream(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlParserInputBufferPtr input; /* an I/O Input */ - int n_input; - xmlCharEncoding enc; /* the charset encoding if known */ - int n_enc; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - input = gen_xmlParserInputBufferPtr(n_input, 1); - enc = gen_xmlCharEncoding(n_enc, 2); - - ret_val = xmlNewIOInputStream(ctxt, input, enc); - if (ret_val != NULL) input = NULL; - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlParserInputBufferPtr(n_input, input, 1); - des_xmlCharEncoding(n_enc, enc, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewIOInputStream", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_input); - printf(" %d", n_enc); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewParserCtxt(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ret_val; - - mem_base = xmlMemBlocks(); - - ret_val = xmlNewParserCtxt(); - desret_xmlParserCtxtPtr(ret_val); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlNodePtr_ptr 1 -static xmlNodePtr * gen_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlNodePtr_ptr(int no ATTRIBUTE_UNUSED, xmlNodePtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlParseBalancedChunkMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - int ret_val; - xmlDocPtr doc; /* the document the chunk pertains to */ - int n_doc; - xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */ - int n_sax; - void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */ - int n_user_data; - int depth; /* Used for loop detection, use 0 */ - int n_depth; - xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */ - int n_string; - xmlNodePtr * lst; /* the return value for the set of parsed nodes */ - int n_lst; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { - for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { - for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { - for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - sax = gen_xmlSAXHandlerPtr(n_sax, 1); - user_data = gen_userdata(n_user_data, 2); - depth = gen_int(n_depth, 3); - string = gen_const_xmlChar_ptr(n_string, 4); - lst = gen_xmlNodePtr_ptr(n_lst, 5); - -#ifdef LIBXML_SAX1_ENABLED - if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; -#endif - - - ret_val = xmlParseBalancedChunkMemory(doc, sax, user_data, depth, (const xmlChar *)string, lst); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlSAXHandlerPtr(n_sax, sax, 1); - des_userdata(n_user_data, user_data, 2); - des_int(n_depth, depth, 3); - des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4); - des_xmlNodePtr_ptr(n_lst, lst, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseBalancedChunkMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_sax); - printf(" %d", n_user_data); - printf(" %d", n_depth); - printf(" %d", n_string); - printf(" %d", n_lst); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlParseBalancedChunkMemoryRecover(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - int ret_val; - xmlDocPtr doc; /* the document the chunk pertains to */ - int n_doc; - xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */ - int n_sax; - void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */ - int n_user_data; - int depth; /* Used for loop detection, use 0 */ - int n_depth; - xmlChar * string; /* the input string in UTF8 or ISO-Latin (zero terminated) */ - int n_string; - xmlNodePtr * lst; /* the return value for the set of parsed nodes */ - int n_lst; - int recover; /* return nodes even if the data is broken (use 0) */ - int n_recover; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { - for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { - for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { - for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { - for (n_recover = 0;n_recover < gen_nb_int;n_recover++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - sax = gen_xmlSAXHandlerPtr(n_sax, 1); - user_data = gen_userdata(n_user_data, 2); - depth = gen_int(n_depth, 3); - string = gen_const_xmlChar_ptr(n_string, 4); - lst = gen_xmlNodePtr_ptr(n_lst, 5); - recover = gen_int(n_recover, 6); - -#ifdef LIBXML_SAX1_ENABLED - if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; -#endif - - - ret_val = xmlParseBalancedChunkMemoryRecover(doc, sax, user_data, depth, (const xmlChar *)string, lst, recover); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlSAXHandlerPtr(n_sax, sax, 1); - des_userdata(n_user_data, user_data, 2); - des_int(n_depth, depth, 3); - des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 4); - des_xmlNodePtr_ptr(n_lst, lst, 5); - des_int(n_recover, recover, 6); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseBalancedChunkMemoryRecover", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_sax); - printf(" %d", n_user_data); - printf(" %d", n_depth); - printf(" %d", n_string); - printf(" %d", n_lst); - printf(" %d", n_recover); - printf("\n"); - } - } - } - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlParseChunk(void) { - int test_ret = 0; - -#if defined(LIBXML_PUSH_ENABLED) - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - char * chunk; /* an char array */ - int n_chunk; - int size; /* the size in byte of the chunk */ - int n_size; - int terminate; /* last chunk indicator */ - int n_terminate; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_chunk = 0;n_chunk < gen_nb_const_char_ptr;n_chunk++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_terminate = 0;n_terminate < gen_nb_int;n_terminate++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - chunk = gen_const_char_ptr(n_chunk, 1); - size = gen_int(n_size, 2); - terminate = gen_int(n_terminate, 3); - - ret_val = xmlParseChunk(ctxt, (const char *)chunk, size, terminate); - if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_char_ptr(n_chunk, (const char *)chunk, 1); - des_int(n_size, size, 2); - des_int(n_terminate, terminate, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseChunk", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_chunk); - printf(" %d", n_size); - printf(" %d", n_terminate); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlParseCtxtExternalEntity(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctx; /* the existing parsing context */ - int n_ctx; - xmlChar * URL; /* the URL for the entity to load */ - int n_URL; - xmlChar * ID; /* the System ID for the entity to load */ - int n_ID; - xmlNodePtr * lst; /* the return value for the set of parsed nodes */ - int n_lst; - - for (n_ctx = 0;n_ctx < gen_nb_xmlParserCtxtPtr;n_ctx++) { - for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) { - for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { - for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { - mem_base = xmlMemBlocks(); - ctx = gen_xmlParserCtxtPtr(n_ctx, 0); - URL = gen_const_xmlChar_ptr(n_URL, 1); - ID = gen_const_xmlChar_ptr(n_ID, 2); - lst = gen_xmlNodePtr_ptr(n_lst, 3); - - ret_val = xmlParseCtxtExternalEntity(ctx, (const xmlChar *)URL, (const xmlChar *)ID, lst); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctx, ctx, 0); - des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 1); - des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 2); - des_xmlNodePtr_ptr(n_lst, lst, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseCtxtExternalEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_URL); - printf(" %d", n_ID); - printf(" %d", n_lst); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParseDTD(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) -#ifdef LIBXML_VALID_ENABLED - int mem_base; - xmlDtdPtr ret_val; - xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */ - int n_ExternalID; - xmlChar * SystemID; /* a NAME* containing the URL to the DTD */ - int n_SystemID; - - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { - mem_base = xmlMemBlocks(); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 0); - SystemID = gen_const_xmlChar_ptr(n_SystemID, 1); - - ret_val = xmlParseDTD((const xmlChar *)ExternalID, (const xmlChar *)SystemID); - desret_xmlDtdPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 0); - des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseDTD", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ExternalID); - printf(" %d", n_SystemID); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlParseDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - xmlChar * cur; /* a pointer to an array of xmlChar */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_const_xmlChar_ptr(n_cur, 0); - - ret_val = xmlParseDoc((const xmlChar *)cur); - desret_xmlDocPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlParseDocument(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = xmlParseDocument(ctxt); - if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseDocument", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParseEntity(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - const char * filename; /* the filename */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - - ret_val = xmlParseEntity(filename); - desret_xmlDocPtr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlParseExtParsedEnt(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = xmlParseExtParsedEnt(ctxt); - if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseExtParsedEnt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParseExternalEntity(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - int ret_val; - xmlDocPtr doc; /* the document the chunk pertains to */ - int n_doc; - xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */ - int n_sax; - void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */ - int n_user_data; - int depth; /* Used for loop detection, use 0 */ - int n_depth; - xmlChar * URL; /* the URL for the entity to load */ - int n_URL; - xmlChar * ID; /* the System ID for the entity to load */ - int n_ID; - xmlNodePtr * lst; /* the return value for the set of parsed nodes */ - int n_lst; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { - for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { - for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) { - for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { - for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - sax = gen_xmlSAXHandlerPtr(n_sax, 1); - user_data = gen_userdata(n_user_data, 2); - depth = gen_int(n_depth, 3); - URL = gen_const_xmlChar_ptr(n_URL, 4); - ID = gen_const_xmlChar_ptr(n_ID, 5); - lst = gen_xmlNodePtr_ptr(n_lst, 6); - - ret_val = xmlParseExternalEntity(doc, sax, user_data, depth, (const xmlChar *)URL, (const xmlChar *)ID, lst); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlSAXHandlerPtr(n_sax, sax, 1); - des_userdata(n_user_data, user_data, 2); - des_int(n_depth, depth, 3); - des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 4); - des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 5); - des_xmlNodePtr_ptr(n_lst, lst, 6); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseExternalEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_sax); - printf(" %d", n_user_data); - printf(" %d", n_depth); - printf(" %d", n_URL); - printf(" %d", n_ID); - printf(" %d", n_lst); - printf("\n"); - } - } - } - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlParseFile(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - const char * filename; /* the filename */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - - ret_val = xmlParseFile(filename); - desret_xmlDocPtr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlParseInNodeContext(void) { - int test_ret = 0; - - int mem_base; - xmlParserErrors ret_val; - xmlNodePtr node; /* the context node */ - int n_node; - char * data; /* the input string */ - int n_data; - int datalen; /* the input string length in bytes */ - int n_datalen; - int options; /* a combination of xmlParserOption */ - int n_options; - xmlNodePtr * lst; /* the return value for the set of parsed nodes */ - int n_lst; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) { - for (n_datalen = 0;n_datalen < gen_nb_int;n_datalen++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - for (n_lst = 0;n_lst < gen_nb_xmlNodePtr_ptr;n_lst++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - data = gen_const_char_ptr(n_data, 1); - datalen = gen_int(n_datalen, 2); - options = gen_parseroptions(n_options, 3); - lst = gen_xmlNodePtr_ptr(n_lst, 4); - - ret_val = xmlParseInNodeContext(node, (const char *)data, datalen, options, lst); - desret_xmlParserErrors(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_char_ptr(n_data, (const char *)data, 1); - des_int(n_datalen, datalen, 2); - des_parseroptions(n_options, options, 3); - des_xmlNodePtr_ptr(n_lst, lst, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseInNodeContext", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_data); - printf(" %d", n_datalen); - printf(" %d", n_options); - printf(" %d", n_lst); - printf("\n"); - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParseMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - char * buffer; /* an pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - mem_base = xmlMemBlocks(); - buffer = gen_const_char_ptr(n_buffer, 0); - size = gen_int(n_size, 1); - - ret_val = xmlParseMemory((const char *)buffer, size); - desret_xmlDocPtr(ret_val); - call_tests++; - des_const_char_ptr(n_buffer, (const char *)buffer, 0); - des_int(n_size, size, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_size); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -#define gen_nb_const_xmlParserNodeInfoPtr 1 -static xmlParserNodeInfoPtr gen_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_xmlParserNodeInfoPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlParserAddNodeInfo(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlParserNodeInfoPtr info; /* a node info sequence pointer */ - int n_info; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_info = 0;n_info < gen_nb_const_xmlParserNodeInfoPtr;n_info++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - info = gen_const_xmlParserNodeInfoPtr(n_info, 1); - - xmlParserAddNodeInfo(ctxt, (const xmlParserNodeInfoPtr)info); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlParserNodeInfoPtr(n_info, (const xmlParserNodeInfoPtr)info, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserAddNodeInfo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_info); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_const_xmlParserCtxtPtr 1 -static xmlParserCtxtPtr gen_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_xmlParserCtxtPtr(int no ATTRIBUTE_UNUSED, const xmlParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -#define gen_nb_const_xmlNodePtr 1 -static xmlNodePtr gen_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_xmlNodePtr(int no ATTRIBUTE_UNUSED, const xmlNodePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlParserFindNodeInfo(void) { - int test_ret = 0; - - int mem_base; - const xmlParserNodeInfo * ret_val; - xmlParserCtxtPtr ctx; /* an XML parser context */ - int n_ctx; - xmlNodePtr node; /* an XML node within the tree */ - int n_node; - - for (n_ctx = 0;n_ctx < gen_nb_const_xmlParserCtxtPtr;n_ctx++) { - for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - ctx = gen_const_xmlParserCtxtPtr(n_ctx, 0); - node = gen_const_xmlNodePtr(n_node, 1); - - ret_val = xmlParserFindNodeInfo((const xmlParserCtxtPtr)ctx, (const xmlNodePtr)node); - desret_const_xmlParserNodeInfo_ptr(ret_val); - call_tests++; - des_const_xmlParserCtxtPtr(n_ctx, (const xmlParserCtxtPtr)ctx, 0); - des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserFindNodeInfo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_const_xmlParserNodeInfoSeqPtr 1 -static xmlParserNodeInfoSeqPtr gen_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_xmlParserNodeInfoSeqPtr(int no ATTRIBUTE_UNUSED, const xmlParserNodeInfoSeqPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlParserFindNodeInfoIndex(void) { - int test_ret = 0; - - int mem_base; - unsigned long ret_val; - xmlParserNodeInfoSeqPtr seq; /* a node info sequence pointer */ - int n_seq; - xmlNodePtr node; /* an XML node pointer */ - int n_node; - - for (n_seq = 0;n_seq < gen_nb_const_xmlParserNodeInfoSeqPtr;n_seq++) { - for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - seq = gen_const_xmlParserNodeInfoSeqPtr(n_seq, 0); - node = gen_const_xmlNodePtr(n_node, 1); - - ret_val = xmlParserFindNodeInfoIndex((const xmlParserNodeInfoSeqPtr)seq, (const xmlNodePtr)node); - desret_unsigned_long(ret_val); - call_tests++; - des_const_xmlParserNodeInfoSeqPtr(n_seq, (const xmlParserNodeInfoSeqPtr)seq, 0); - des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserFindNodeInfoIndex", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_seq); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlParserInputPtr 1 -static xmlParserInputPtr gen_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlParserInputPtr(int no ATTRIBUTE_UNUSED, xmlParserInputPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlParserInputGrow(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserInputPtr in; /* an XML parser input */ - int n_in; - int len; /* an indicative size for the lookahead */ - int n_len; - - for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - in = gen_xmlParserInputPtr(n_in, 0); - len = gen_int(n_len, 1); - - ret_val = xmlParserInputGrow(in, len); - desret_int(ret_val); - call_tests++; - des_xmlParserInputPtr(n_in, in, 0); - des_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputGrow", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_in); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserInputRead(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserInputPtr in; /* an XML parser input */ - int n_in; - int len; /* an indicative size for the lookahead */ - int n_len; - - for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - in = gen_xmlParserInputPtr(n_in, 0); - len = gen_int(n_len, 1); - - ret_val = xmlParserInputRead(in, len); - desret_int(ret_val); - call_tests++; - des_xmlParserInputPtr(n_in, in, 0); - des_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputRead", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_in); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlPedanticParserDefault(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - int val; /* int 0 or 1 */ - int n_val; - - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_int(n_val, 0); - - ret_val = xmlPedanticParserDefault(val); - desret_int(ret_val); - call_tests++; - des_int(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPedanticParserDefault", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlReadDoc(void) { - int test_ret = 0; - - int mem_base; - xmlDocPtr ret_val; - xmlChar * cur; /* a pointer to a zero terminated string */ - int n_cur; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - cur = gen_const_xmlChar_ptr(n_cur, 0); - URL = gen_filepath(n_URL, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - options = gen_parseroptions(n_options, 3); - - ret_val = xmlReadDoc((const xmlChar *)cur, URL, (const char *)encoding, options); - desret_xmlDocPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); - des_filepath(n_URL, URL, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_parseroptions(n_options, options, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReadDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlReadFile(void) { - int test_ret = 0; - - int mem_base; - xmlDocPtr ret_val; - const char * filename; /* a file or URL */ - int n_filename; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - encoding = gen_const_char_ptr(n_encoding, 1); - options = gen_parseroptions(n_options, 2); - - ret_val = xmlReadFile(filename, (const char *)encoding, options); - desret_xmlDocPtr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - des_const_char_ptr(n_encoding, (const char *)encoding, 1); - des_parseroptions(n_options, options, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReadFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlReadMemory(void) { - int test_ret = 0; - - int mem_base; - xmlDocPtr ret_val; - char * buffer; /* a pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - buffer = gen_const_char_ptr(n_buffer, 0); - size = gen_int(n_size, 1); - URL = gen_filepath(n_URL, 2); - encoding = gen_const_char_ptr(n_encoding, 3); - options = gen_parseroptions(n_options, 4); - - ret_val = xmlReadMemory((const char *)buffer, size, URL, (const char *)encoding, options); - desret_xmlDocPtr(ret_val); - call_tests++; - des_const_char_ptr(n_buffer, (const char *)buffer, 0); - des_int(n_size, size, 1); - des_filepath(n_URL, URL, 2); - des_const_char_ptr(n_encoding, (const char *)encoding, 3); - des_parseroptions(n_options, options, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReadMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_size); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlRecoverDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - xmlChar * cur; /* a pointer to an array of xmlChar */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_const_xmlChar_ptr(n_cur, 0); - - ret_val = xmlRecoverDoc((const xmlChar *)cur); - desret_xmlDocPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRecoverDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlRecoverFile(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - const char * filename; /* the filename */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - - ret_val = xmlRecoverFile(filename); - desret_xmlDocPtr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRecoverFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlRecoverMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - char * buffer; /* an pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - mem_base = xmlMemBlocks(); - buffer = gen_const_char_ptr(n_buffer, 0); - size = gen_int(n_size, 1); - - ret_val = xmlRecoverMemory((const char *)buffer, size); - desret_xmlDocPtr(ret_val); - call_tests++; - des_const_char_ptr(n_buffer, (const char *)buffer, 0); - des_int(n_size, size, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRecoverMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_size); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAXParseDTD(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDtdPtr ret_val; - xmlSAXHandlerPtr sax; /* the SAX handler block */ - int n_sax; - xmlChar * ExternalID; /* a NAME* containing the External ID of the DTD */ - int n_ExternalID; - xmlChar * SystemID; /* a NAME* containing the URL to the DTD */ - int n_SystemID; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { - mem_base = xmlMemBlocks(); - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 1); - SystemID = gen_const_xmlChar_ptr(n_SystemID, 2); - - ret_val = xmlSAXParseDTD(sax, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); - desret_xmlDtdPtr(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 1); - des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXParseDTD", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_ExternalID); - printf(" %d", n_SystemID); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAXParseDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - xmlSAXHandlerPtr sax; /* the SAX handler block */ - int n_sax; - xmlChar * cur; /* a pointer to an array of xmlChar */ - int n_cur; - int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ - int n_recovery; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { - mem_base = xmlMemBlocks(); - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - cur = gen_const_xmlChar_ptr(n_cur, 1); - recovery = gen_int(n_recovery, 2); - - ret_val = xmlSAXParseDoc(sax, (const xmlChar *)cur, recovery); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); - des_int(n_recovery, recovery, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXParseDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_cur); - printf(" %d", n_recovery); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAXParseEntity(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - xmlSAXHandlerPtr sax; /* the SAX handler block */ - int n_sax; - const char * filename; /* the filename */ - int n_filename; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - filename = gen_filepath(n_filename, 1); - - ret_val = xmlSAXParseEntity(sax, filename); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_filepath(n_filename, filename, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXParseEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_filename); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAXParseFile(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - xmlSAXHandlerPtr sax; /* the SAX handler block */ - int n_sax; - const char * filename; /* the filename */ - int n_filename; - int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ - int n_recovery; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { - mem_base = xmlMemBlocks(); - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - filename = gen_filepath(n_filename, 1); - recovery = gen_int(n_recovery, 2); - - ret_val = xmlSAXParseFile(sax, filename, recovery); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_filepath(n_filename, filename, 1); - des_int(n_recovery, recovery, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXParseFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_filename); - printf(" %d", n_recovery); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAXParseFileWithData(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - xmlSAXHandlerPtr sax; /* the SAX handler block */ - int n_sax; - const char * filename; /* the filename */ - int n_filename; - int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ - int n_recovery; - void * data; /* the userdata */ - int n_data; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - filename = gen_filepath(n_filename, 1); - recovery = gen_int(n_recovery, 2); - data = gen_userdata(n_data, 3); - - ret_val = xmlSAXParseFileWithData(sax, filename, recovery, data); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_filepath(n_filename, filename, 1); - des_int(n_recovery, recovery, 2); - des_userdata(n_data, data, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXParseFileWithData", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_filename); - printf(" %d", n_recovery); - printf(" %d", n_data); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAXParseMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - xmlSAXHandlerPtr sax; /* the SAX handler block */ - int n_sax; - char * buffer; /* an pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - int recovery; /* work in recovery mode, i.e. tries to read not Well Formed documents */ - int n_recovery; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { - mem_base = xmlMemBlocks(); - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - buffer = gen_const_char_ptr(n_buffer, 1); - size = gen_int(n_size, 2); - recovery = gen_int(n_recovery, 3); - - ret_val = xmlSAXParseMemory(sax, (const char *)buffer, size, recovery); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_const_char_ptr(n_buffer, (const char *)buffer, 1); - des_int(n_size, size, 2); - des_int(n_recovery, recovery, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXParseMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_buffer); - printf(" %d", n_size); - printf(" %d", n_recovery); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAXParseMemoryWithData(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlDocPtr ret_val; - xmlSAXHandlerPtr sax; /* the SAX handler block */ - int n_sax; - char * buffer; /* an pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - int recovery; /* work in recovery mode, i.e. tries to read no Well Formed documents */ - int n_recovery; - void * data; /* the userdata */ - int n_data; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_recovery = 0;n_recovery < gen_nb_int;n_recovery++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - buffer = gen_const_char_ptr(n_buffer, 1); - size = gen_int(n_size, 2); - recovery = gen_int(n_recovery, 3); - data = gen_userdata(n_data, 4); - - ret_val = xmlSAXParseMemoryWithData(sax, (const char *)buffer, size, recovery, data); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_const_char_ptr(n_buffer, (const char *)buffer, 1); - des_int(n_size, size, 2); - des_int(n_recovery, recovery, 3); - des_userdata(n_data, data, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXParseMemoryWithData", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_buffer); - printf(" %d", n_size); - printf(" %d", n_recovery); - printf(" %d", n_data); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAXUserParseFile(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - int ret_val; - xmlSAXHandlerPtr sax; /* a SAX handler */ - int n_sax; - void * user_data; /* The user data returned on SAX callbacks */ - int n_user_data; - const char * filename; /* a file name */ - int n_filename; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - user_data = gen_userdata(n_user_data, 1); - filename = gen_filepath(n_filename, 2); - -#ifdef LIBXML_SAX1_ENABLED - if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; -#endif - - - ret_val = xmlSAXUserParseFile(sax, user_data, filename); - desret_int(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_userdata(n_user_data, user_data, 1); - des_filepath(n_filename, filename, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXUserParseFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_user_data); - printf(" %d", n_filename); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSAXUserParseMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - int ret_val; - xmlSAXHandlerPtr sax; /* a SAX handler */ - int n_sax; - void * user_data; /* The user data returned on SAX callbacks */ - int n_user_data; - char * buffer; /* an in-memory XML document input */ - int n_buffer; - int size; /* the length of the XML document in bytes */ - int n_size; - - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - mem_base = xmlMemBlocks(); - sax = gen_xmlSAXHandlerPtr(n_sax, 0); - user_data = gen_userdata(n_user_data, 1); - buffer = gen_const_char_ptr(n_buffer, 2); - size = gen_int(n_size, 3); - -#ifdef LIBXML_SAX1_ENABLED - if (sax == (xmlSAXHandlerPtr)&xmlDefaultSAXHandler) user_data = NULL; -#endif - - - ret_val = xmlSAXUserParseMemory(sax, user_data, (const char *)buffer, size); - desret_int(ret_val); - call_tests++; - des_xmlSAXHandlerPtr(n_sax, sax, 0); - des_userdata(n_user_data, user_data, 1); - des_const_char_ptr(n_buffer, (const char *)buffer, 2); - des_int(n_size, size, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSAXUserParseMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_sax); - printf(" %d", n_user_data); - printf(" %d", n_buffer); - printf(" %d", n_size); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSetExternalEntityLoader(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSetFeature(void) { - int test_ret = 0; - -#if defined(LIBXML_LEGACY_ENABLED) -#ifdef LIBXML_LEGACY_ENABLED - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML/HTML parser context */ - int n_ctxt; - char * name; /* the feature name */ - int n_name; - void * value; /* pointer to the location of the new value */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { - for (n_value = 0;n_value < gen_nb_void_ptr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - name = gen_const_char_ptr(n_name, 1); - value = gen_void_ptr(n_value, 2); - - ret_val = xmlSetFeature(ctxt, (const char *)name, value); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_char_ptr(n_name, (const char *)name, 1); - des_void_ptr(n_value, value, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSetFeature", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlSetupParserForBuffer(void) { - int test_ret = 0; - -#if defined(LIBXML_SAX1_ENABLED) -#ifdef LIBXML_SAX1_ENABLED - int mem_base; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlChar * buffer; /* a xmlChar * buffer */ - int n_buffer; - const char * filename; /* a file name */ - int n_filename; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - buffer = gen_const_xmlChar_ptr(n_buffer, 1); - filename = gen_filepath(n_filename, 2); - - xmlSetupParserForBuffer(ctxt, (const xmlChar *)buffer, filename); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1); - des_filepath(n_filename, filename, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSetupParserForBuffer", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_buffer); - printf(" %d", n_filename); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlStopParser(void) { - int test_ret = 0; - -#ifdef LIBXML_PUSH_ENABLED - int mem_base; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - xmlStopParser(ctxt); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStopParser", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSubstituteEntitiesDefault(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - int val; /* int 0 or 1 */ - int n_val; - - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_int(n_val, 0); - - ret_val = xmlSubstituteEntitiesDefault(val); - desret_int(ret_val); - call_tests++; - des_int(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSubstituteEntitiesDefault", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - -static int -test_parser(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing parser : 61 of 70 functions ...\n"); - test_ret += test_xmlByteConsumed(); - test_ret += test_xmlClearNodeInfoSeq(); - test_ret += test_xmlClearParserCtxt(); - test_ret += test_xmlCreateDocParserCtxt(); - test_ret += test_xmlCreatePushParserCtxt(); - test_ret += test_xmlCtxtReadDoc(); - test_ret += test_xmlCtxtReadFile(); - test_ret += test_xmlCtxtReadMemory(); - test_ret += test_xmlCtxtReset(); - test_ret += test_xmlCtxtResetPush(); - test_ret += test_xmlCtxtUseOptions(); - test_ret += test_xmlGetExternalEntityLoader(); - test_ret += test_xmlGetFeature(); - test_ret += test_xmlGetFeaturesList(); - test_ret += test_xmlHasFeature(); - test_ret += test_xmlIOParseDTD(); - test_ret += test_xmlInitNodeInfoSeq(); - test_ret += test_xmlInitParser(); - test_ret += test_xmlInitParserCtxt(); - test_ret += test_xmlKeepBlanksDefault(); - test_ret += test_xmlLineNumbersDefault(); - test_ret += test_xmlLoadExternalEntity(); - test_ret += test_xmlNewIOInputStream(); - test_ret += test_xmlNewParserCtxt(); - test_ret += test_xmlParseBalancedChunkMemory(); - test_ret += test_xmlParseBalancedChunkMemoryRecover(); - test_ret += test_xmlParseChunk(); - test_ret += test_xmlParseCtxtExternalEntity(); - test_ret += test_xmlParseDTD(); - test_ret += test_xmlParseDoc(); - test_ret += test_xmlParseDocument(); - test_ret += test_xmlParseEntity(); - test_ret += test_xmlParseExtParsedEnt(); - test_ret += test_xmlParseExternalEntity(); - test_ret += test_xmlParseFile(); - test_ret += test_xmlParseInNodeContext(); - test_ret += test_xmlParseMemory(); - test_ret += test_xmlParserAddNodeInfo(); - test_ret += test_xmlParserFindNodeInfo(); - test_ret += test_xmlParserFindNodeInfoIndex(); - test_ret += test_xmlParserInputGrow(); - test_ret += test_xmlParserInputRead(); - test_ret += test_xmlPedanticParserDefault(); - test_ret += test_xmlReadDoc(); - test_ret += test_xmlReadFile(); - test_ret += test_xmlReadMemory(); - test_ret += test_xmlRecoverDoc(); - test_ret += test_xmlRecoverFile(); - test_ret += test_xmlRecoverMemory(); - test_ret += test_xmlSAXParseDTD(); - test_ret += test_xmlSAXParseDoc(); - test_ret += test_xmlSAXParseEntity(); - test_ret += test_xmlSAXParseFile(); - test_ret += test_xmlSAXParseFileWithData(); - test_ret += test_xmlSAXParseMemory(); - test_ret += test_xmlSAXParseMemoryWithData(); - test_ret += test_xmlSAXUserParseFile(); - test_ret += test_xmlSAXUserParseMemory(); - test_ret += test_xmlSetExternalEntityLoader(); - test_ret += test_xmlSetFeature(); - test_ret += test_xmlSetupParserForBuffer(); - test_ret += test_xmlStopParser(); - test_ret += test_xmlSubstituteEntitiesDefault(); - - if (test_ret != 0) - printf("Module parser: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_htmlCreateFileParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - htmlParserCtxtPtr ret_val; - const char * filename; /* the filename */ - int n_filename; - char * encoding; /* a free form C string describing the HTML document encoding, or NULL */ - int n_encoding; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - encoding = gen_const_char_ptr(n_encoding, 1); - - ret_val = htmlCreateFileParserCtxt(filename, (const char *)encoding); - desret_htmlParserCtxtPtr(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - des_const_char_ptr(n_encoding, (const char *)encoding, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlCreateFileParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_htmlInitAutoClose(void) { - int test_ret = 0; - -#if defined(LIBXML_HTML_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - htmlInitAutoClose(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in htmlInitAutoClose", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_inputPop(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = inputPop(ctxt); - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in inputPop", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_inputPush(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlParserInputPtr value; /* the parser input */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_value = 0;n_value < gen_nb_xmlParserInputPtr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - value = gen_xmlParserInputPtr(n_value, 1); - - ret_val = inputPush(ctxt, value); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlParserInputPtr(n_value, value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in inputPush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_namePop(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = namePop(ctxt); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in namePop", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_namePush(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlChar * value; /* the element name */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - - ret_val = namePush(ctxt, (const xmlChar *)value); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in namePush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_nodePop(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = nodePop(ctxt); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in nodePop", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_nodePush(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlNodePtr value; /* the element node */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_value = 0;n_value < gen_nb_xmlNodePtr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - value = gen_xmlNodePtr(n_value, 1); - - ret_val = nodePush(ctxt, value); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_value, value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in nodePush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCheckLanguageID(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * lang; /* pointer to the string value */ - int n_lang; - - for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) { - mem_base = xmlMemBlocks(); - lang = gen_const_xmlChar_ptr(n_lang, 0); - - ret_val = xmlCheckLanguageID((const xmlChar *)lang); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCheckLanguageID", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_lang); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCopyChar(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - int len; /* Ignored, compatibility */ - int n_len; - xmlChar * out; /* pointer to an array of xmlChar */ - int n_out; - int val; /* the char value */ - int n_val; - - for (n_len = 0;n_len < gen_nb_int;n_len++) { - for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) { - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - len = gen_int(n_len, 0); - out = gen_xmlChar_ptr(n_out, 1); - val = gen_int(n_val, 2); - - ret_val = xmlCopyChar(len, out, val); - desret_int(ret_val); - call_tests++; - des_int(n_len, len, 0); - des_xmlChar_ptr(n_out, out, 1); - des_int(n_val, val, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyChar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_len); - printf(" %d", n_out); - printf(" %d", n_val); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCopyCharMultiByte(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * out; /* pointer to an array of xmlChar */ - int n_out; - int val; /* the char value */ - int n_val; - - for (n_out = 0;n_out < gen_nb_xmlChar_ptr;n_out++) { - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - out = gen_xmlChar_ptr(n_out, 0); - val = gen_int(n_val, 1); - - ret_val = xmlCopyCharMultiByte(out, val); - desret_int(ret_val); - call_tests++; - des_xmlChar_ptr(n_out, out, 0); - des_int(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyCharMultiByte", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCreateEntityParserCtxt(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ret_val; - xmlChar * URL; /* the entity URL */ - int n_URL; - xmlChar * ID; /* the entity PUBLIC ID */ - int n_ID; - xmlChar * base; /* a possible base for the target URI */ - int n_base; - - for (n_URL = 0;n_URL < gen_nb_const_xmlChar_ptr;n_URL++) { - for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { - for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { - mem_base = xmlMemBlocks(); - URL = gen_const_xmlChar_ptr(n_URL, 0); - ID = gen_const_xmlChar_ptr(n_ID, 1); - base = gen_const_xmlChar_ptr(n_base, 2); - - ret_val = xmlCreateEntityParserCtxt((const xmlChar *)URL, (const xmlChar *)ID, (const xmlChar *)base); - desret_xmlParserCtxtPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_URL, (const xmlChar *)URL, 0); - des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1); - des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCreateEntityParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf(" %d", n_ID); - printf(" %d", n_base); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCreateFileParserCtxt(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ret_val; - const char * filename; /* the filename */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - - ret_val = xmlCreateFileParserCtxt(filename); - desret_xmlParserCtxtPtr(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCreateFileParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCreateMemoryParserCtxt(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ret_val; - char * buffer; /* a pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - mem_base = xmlMemBlocks(); - buffer = gen_const_char_ptr(n_buffer, 0); - size = gen_int(n_size, 1); - - ret_val = xmlCreateMemoryParserCtxt((const char *)buffer, size); - desret_xmlParserCtxtPtr(ret_val); - call_tests++; - des_const_char_ptr(n_buffer, (const char *)buffer, 0); - des_int(n_size, size, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCreateMemoryParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_size); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCreateURLParserCtxt(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ret_val; - const char * filename; /* the filename or URL */ - int n_filename; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - options = gen_int(n_options, 1); - - ret_val = xmlCreateURLParserCtxt(filename, options); - desret_xmlParserCtxtPtr(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - des_int(n_options, options, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCreateURLParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_options); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCurrentChar(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* the XML parser context */ - int n_ctxt; - int * len; /* pointer to the length of the char read */ - int n_len; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - len = gen_int_ptr(n_len, 1); - - ret_val = xmlCurrentChar(ctxt, len); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_int_ptr(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCurrentChar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlErrMemory(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - char * extra; /* extra informations */ - int n_extra; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_extra = 0;n_extra < gen_nb_const_char_ptr;n_extra++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - extra = gen_const_char_ptr(n_extra, 1); - - xmlErrMemory(ctxt, (const char *)extra); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_char_ptr(n_extra, (const char *)extra, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlErrMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_extra); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsLetter(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - int c; /* an unicode character (int) */ - int n_c; - - for (n_c = 0;n_c < gen_nb_int;n_c++) { - mem_base = xmlMemBlocks(); - c = gen_int(n_c, 0); - - ret_val = xmlIsLetter(c); - desret_int(ret_val); - call_tests++; - des_int(n_c, c, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsLetter", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_c); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewEntityInputStream(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlEntityPtr entity; /* an Entity pointer */ - int n_entity; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_entity = 0;n_entity < gen_nb_xmlEntityPtr;n_entity++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - entity = gen_xmlEntityPtr(n_entity, 1); - - ret_val = xmlNewEntityInputStream(ctxt, entity); - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlEntityPtr(n_entity, entity, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewEntityInputStream", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_entity); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewInputFromFile(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - const char * filename; /* the filename to use as entity */ - int n_filename; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - filename = gen_filepath(n_filename, 1); - - ret_val = xmlNewInputFromFile(ctxt, filename); - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_filepath(n_filename, filename, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewInputFromFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_filename); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewInputStream(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = xmlNewInputStream(ctxt); - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewInputStream", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewStringInputStream(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlChar * buffer; /* an memory buffer */ - int n_buffer; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_buffer = 0;n_buffer < gen_nb_const_xmlChar_ptr;n_buffer++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - buffer = gen_const_xmlChar_ptr(n_buffer, 1); - - ret_val = xmlNewStringInputStream(ctxt, (const xmlChar *)buffer); - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_buffer, (const xmlChar *)buffer, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewStringInputStream", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_buffer); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNextChar(void) { - int test_ret = 0; - - int mem_base; - xmlParserCtxtPtr ctxt; /* the XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - xmlNextChar(ctxt); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNextChar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserInputShrink(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr in; /* an XML parser input */ - int n_in; - - for (n_in = 0;n_in < gen_nb_xmlParserInputPtr;n_in++) { - mem_base = xmlMemBlocks(); - in = gen_xmlParserInputPtr(n_in, 0); - - xmlParserInputShrink(in); - call_tests++; - des_xmlParserInputPtr(n_in, in, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputShrink", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_in); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlPopInput(void) { - int test_ret = 0; - - int mem_base; - xmlChar ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - - ret_val = xmlPopInput(ctxt); - desret_xmlChar(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPopInput", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlPushInput(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */ - int n_input; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - input = gen_xmlParserInputPtr(n_input, 1); - - ret_val = xmlPushInput(ctxt, input); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlParserInputPtr(n_input, input, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPushInput", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_input); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSetEntityReferenceFunc(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSplitQName(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlChar * name; /* an XML parser context */ - int n_name; - xmlChar ** prefix; /* a xmlChar ** */ - int n_prefix; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - prefix = gen_xmlChar_ptr_ptr(n_prefix, 2); - - ret_val = xmlSplitQName(ctxt, (const xmlChar *)name, prefix); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_xmlChar_ptr_ptr(n_prefix, prefix, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSplitQName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_name); - printf(" %d", n_prefix); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStringCurrentChar(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* the XML parser context */ - int n_ctxt; - xmlChar * cur; /* pointer to the beginning of the char */ - int n_cur; - int * len; /* pointer to the length of the char read */ - int n_len; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - cur = gen_const_xmlChar_ptr(n_cur, 1); - len = gen_int_ptr(n_len, 2); - - ret_val = xmlStringCurrentChar(ctxt, (const xmlChar *)cur, len); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); - des_int_ptr(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStringCurrentChar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStringDecodeEntities(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlParserCtxtPtr ctxt; /* the parser context */ - int n_ctxt; - xmlChar * str; /* the input string */ - int n_str; - int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */ - int n_what; - xmlChar end; /* an end marker xmlChar, 0 if none */ - int n_end; - xmlChar end2; /* an end marker xmlChar, 0 if none */ - int n_end2; - xmlChar end3; /* an end marker xmlChar, 0 if none */ - int n_end3; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_what = 0;n_what < gen_nb_int;n_what++) { - for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) { - for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) { - for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - str = gen_const_xmlChar_ptr(n_str, 1); - what = gen_int(n_what, 2); - end = gen_xmlChar(n_end, 3); - end2 = gen_xmlChar(n_end2, 4); - end3 = gen_xmlChar(n_end3, 5); - - ret_val = xmlStringDecodeEntities(ctxt, (const xmlChar *)str, what, end, end2, end3); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); - des_int(n_what, what, 2); - des_xmlChar(n_end, end, 3); - des_xmlChar(n_end2, end2, 4); - des_xmlChar(n_end3, end3, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStringDecodeEntities", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_str); - printf(" %d", n_what); - printf(" %d", n_end); - printf(" %d", n_end2); - printf(" %d", n_end3); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStringLenDecodeEntities(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlParserCtxtPtr ctxt; /* the parser context */ - int n_ctxt; - xmlChar * str; /* the input string */ - int n_str; - int len; /* the string length */ - int n_len; - int what; /* combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF */ - int n_what; - xmlChar end; /* an end marker xmlChar, 0 if none */ - int n_end; - xmlChar end2; /* an end marker xmlChar, 0 if none */ - int n_end2; - xmlChar end3; /* an end marker xmlChar, 0 if none */ - int n_end3; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - for (n_what = 0;n_what < gen_nb_int;n_what++) { - for (n_end = 0;n_end < gen_nb_xmlChar;n_end++) { - for (n_end2 = 0;n_end2 < gen_nb_xmlChar;n_end2++) { - for (n_end3 = 0;n_end3 < gen_nb_xmlChar;n_end3++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - str = gen_const_xmlChar_ptr(n_str, 1); - len = gen_int(n_len, 2); - what = gen_int(n_what, 3); - end = gen_xmlChar(n_end, 4); - end2 = gen_xmlChar(n_end2, 5); - end3 = gen_xmlChar(n_end3, 6); - - ret_val = xmlStringLenDecodeEntities(ctxt, (const xmlChar *)str, len, what, end, end2, end3); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); - des_int(n_len, len, 2); - des_int(n_what, what, 3); - des_xmlChar(n_end, end, 4); - des_xmlChar(n_end2, end2, 5); - des_xmlChar(n_end3, end3, 6); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStringLenDecodeEntities", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_str); - printf(" %d", n_len); - printf(" %d", n_what); - printf(" %d", n_end); - printf(" %d", n_end2); - printf(" %d", n_end3); - printf("\n"); - } - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSwitchEncoding(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* the parser context */ - int n_ctxt; - xmlCharEncoding enc; /* the encoding value (number) */ - int n_enc; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - enc = gen_xmlCharEncoding(n_enc, 1); - - ret_val = xmlSwitchEncoding(ctxt, enc); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlCharEncoding(n_enc, enc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSwitchEncoding", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_enc); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSwitchInputEncoding(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* the parser context */ - int n_ctxt; - xmlParserInputPtr input; /* the input stream */ - int n_input; - xmlCharEncodingHandlerPtr handler; /* the encoding handler */ - int n_handler; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { - for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - input = gen_xmlParserInputPtr(n_input, 1); - handler = gen_xmlCharEncodingHandlerPtr(n_handler, 2); - - ret_val = xmlSwitchInputEncoding(ctxt, input, handler); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlParserInputPtr(n_input, input, 1); - des_xmlCharEncodingHandlerPtr(n_handler, handler, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSwitchInputEncoding", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_input); - printf(" %d", n_handler); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSwitchToEncoding(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserCtxtPtr ctxt; /* the parser context */ - int n_ctxt; - xmlCharEncodingHandlerPtr handler; /* the encoding handler */ - int n_handler; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_handler = 0;n_handler < gen_nb_xmlCharEncodingHandlerPtr;n_handler++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - handler = gen_xmlCharEncodingHandlerPtr(n_handler, 1); - - ret_val = xmlSwitchToEncoding(ctxt, handler); - desret_int(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlCharEncodingHandlerPtr(n_handler, handler, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSwitchToEncoding", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_handler); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - -static int -test_parserInternals(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing parserInternals : 33 of 90 functions ...\n"); - test_ret += test_htmlCreateFileParserCtxt(); - test_ret += test_htmlInitAutoClose(); - test_ret += test_inputPop(); - test_ret += test_inputPush(); - test_ret += test_namePop(); - test_ret += test_namePush(); - test_ret += test_nodePop(); - test_ret += test_nodePush(); - test_ret += test_xmlCheckLanguageID(); - test_ret += test_xmlCopyChar(); - test_ret += test_xmlCopyCharMultiByte(); - test_ret += test_xmlCreateEntityParserCtxt(); - test_ret += test_xmlCreateFileParserCtxt(); - test_ret += test_xmlCreateMemoryParserCtxt(); - test_ret += test_xmlCreateURLParserCtxt(); - test_ret += test_xmlCurrentChar(); - test_ret += test_xmlErrMemory(); - test_ret += test_xmlIsLetter(); - test_ret += test_xmlNewEntityInputStream(); - test_ret += test_xmlNewInputFromFile(); - test_ret += test_xmlNewInputStream(); - test_ret += test_xmlNewStringInputStream(); - test_ret += test_xmlNextChar(); - test_ret += test_xmlParserInputShrink(); - test_ret += test_xmlPopInput(); - test_ret += test_xmlPushInput(); - test_ret += test_xmlSetEntityReferenceFunc(); - test_ret += test_xmlSplitQName(); - test_ret += test_xmlStringCurrentChar(); - test_ret += test_xmlStringDecodeEntities(); - test_ret += test_xmlStringLenDecodeEntities(); - test_ret += test_xmlSwitchEncoding(); - test_ret += test_xmlSwitchInputEncoding(); - test_ret += test_xmlSwitchToEncoding(); - - if (test_ret != 0) - printf("Module parserInternals: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlPatternFromRoot(void) { - int test_ret = 0; - -#if defined(LIBXML_PATTERN_ENABLED) - int mem_base; - int ret_val; - xmlPatternPtr comp; /* the precompiled pattern */ - int n_comp; - - for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { - mem_base = xmlMemBlocks(); - comp = gen_xmlPatternPtr(n_comp, 0); - - ret_val = xmlPatternFromRoot(comp); - desret_int(ret_val); - call_tests++; - des_xmlPatternPtr(n_comp, comp, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPatternFromRoot", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_comp); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlPatternGetStreamCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlPatternMatch(void) { - int test_ret = 0; - -#if defined(LIBXML_PATTERN_ENABLED) - int mem_base; - int ret_val; - xmlPatternPtr comp; /* the precompiled pattern */ - int n_comp; - xmlNodePtr node; /* a node */ - int n_node; - - for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - comp = gen_xmlPatternPtr(n_comp, 0); - node = gen_xmlNodePtr(n_node, 1); - - ret_val = xmlPatternMatch(comp, node); - desret_int(ret_val); - call_tests++; - des_xmlPatternPtr(n_comp, comp, 0); - des_xmlNodePtr(n_node, node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPatternMatch", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_comp); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlPatternMaxDepth(void) { - int test_ret = 0; - -#if defined(LIBXML_PATTERN_ENABLED) - int mem_base; - int ret_val; - xmlPatternPtr comp; /* the precompiled pattern */ - int n_comp; - - for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { - mem_base = xmlMemBlocks(); - comp = gen_xmlPatternPtr(n_comp, 0); - - ret_val = xmlPatternMaxDepth(comp); - desret_int(ret_val); - call_tests++; - des_xmlPatternPtr(n_comp, comp, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPatternMaxDepth", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_comp); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlPatternMinDepth(void) { - int test_ret = 0; - -#if defined(LIBXML_PATTERN_ENABLED) - int mem_base; - int ret_val; - xmlPatternPtr comp; /* the precompiled pattern */ - int n_comp; - - for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { - mem_base = xmlMemBlocks(); - comp = gen_xmlPatternPtr(n_comp, 0); - - ret_val = xmlPatternMinDepth(comp); - desret_int(ret_val); - call_tests++; - des_xmlPatternPtr(n_comp, comp, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPatternMinDepth", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_comp); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlPatternStreamable(void) { - int test_ret = 0; - -#if defined(LIBXML_PATTERN_ENABLED) - int mem_base; - int ret_val; - xmlPatternPtr comp; /* the precompiled pattern */ - int n_comp; - - for (n_comp = 0;n_comp < gen_nb_xmlPatternPtr;n_comp++) { - mem_base = xmlMemBlocks(); - comp = gen_xmlPatternPtr(n_comp, 0); - - ret_val = xmlPatternStreamable(comp); - desret_int(ret_val); - call_tests++; - des_xmlPatternPtr(n_comp, comp, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPatternStreamable", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_comp); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlPatterncompile(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -#ifdef LIBXML_PATTERN_ENABLED - -#define gen_nb_xmlStreamCtxtPtr 1 -static xmlStreamCtxtPtr gen_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlStreamCtxtPtr(int no ATTRIBUTE_UNUSED, xmlStreamCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlStreamPop(void) { - int test_ret = 0; - -#if defined(LIBXML_PATTERN_ENABLED) - int mem_base; - int ret_val; - xmlStreamCtxtPtr stream; /* the stream context */ - int n_stream; - - for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { - mem_base = xmlMemBlocks(); - stream = gen_xmlStreamCtxtPtr(n_stream, 0); - - ret_val = xmlStreamPop(stream); - desret_int(ret_val); - call_tests++; - des_xmlStreamCtxtPtr(n_stream, stream, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStreamPop", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_stream); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlStreamPush(void) { - int test_ret = 0; - -#if defined(LIBXML_PATTERN_ENABLED) - int mem_base; - int ret_val; - xmlStreamCtxtPtr stream; /* the stream context */ - int n_stream; - xmlChar * name; /* the current name */ - int n_name; - xmlChar * ns; /* the namespace name */ - int n_ns; - - for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { - mem_base = xmlMemBlocks(); - stream = gen_xmlStreamCtxtPtr(n_stream, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - ns = gen_const_xmlChar_ptr(n_ns, 2); - - ret_val = xmlStreamPush(stream, (const xmlChar *)name, (const xmlChar *)ns); - desret_int(ret_val); - call_tests++; - des_xmlStreamCtxtPtr(n_stream, stream, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStreamPush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_stream); - printf(" %d", n_name); - printf(" %d", n_ns); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlStreamPushAttr(void) { - int test_ret = 0; - -#if defined(LIBXML_PATTERN_ENABLED) - int mem_base; - int ret_val; - xmlStreamCtxtPtr stream; /* the stream context */ - int n_stream; - xmlChar * name; /* the current name */ - int n_name; - xmlChar * ns; /* the namespace name */ - int n_ns; - - for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { - mem_base = xmlMemBlocks(); - stream = gen_xmlStreamCtxtPtr(n_stream, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - ns = gen_const_xmlChar_ptr(n_ns, 2); - - ret_val = xmlStreamPushAttr(stream, (const xmlChar *)name, (const xmlChar *)ns); - desret_int(ret_val); - call_tests++; - des_xmlStreamCtxtPtr(n_stream, stream, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStreamPushAttr", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_stream); - printf(" %d", n_name); - printf(" %d", n_ns); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlStreamPushNode(void) { - int test_ret = 0; - -#if defined(LIBXML_PATTERN_ENABLED) - int mem_base; - int ret_val; - xmlStreamCtxtPtr stream; /* the stream context */ - int n_stream; - xmlChar * name; /* the current name */ - int n_name; - xmlChar * ns; /* the namespace name */ - int n_ns; - int nodeType; /* the type of the node being pushed */ - int n_nodeType; - - for (n_stream = 0;n_stream < gen_nb_xmlStreamCtxtPtr;n_stream++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { - for (n_nodeType = 0;n_nodeType < gen_nb_int;n_nodeType++) { - mem_base = xmlMemBlocks(); - stream = gen_xmlStreamCtxtPtr(n_stream, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - ns = gen_const_xmlChar_ptr(n_ns, 2); - nodeType = gen_int(n_nodeType, 3); - - ret_val = xmlStreamPushNode(stream, (const xmlChar *)name, (const xmlChar *)ns, nodeType); - desret_int(ret_val); - call_tests++; - des_xmlStreamCtxtPtr(n_stream, stream, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 2); - des_int(n_nodeType, nodeType, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStreamPushNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_stream); - printf(" %d", n_name); - printf(" %d", n_ns); - printf(" %d", n_nodeType); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlStreamWantsAnyNode(void) { - int test_ret = 0; - -#if defined(LIBXML_PATTERN_ENABLED) - int mem_base; - int ret_val; - xmlStreamCtxtPtr streamCtxt; /* the stream context */ - int n_streamCtxt; - - for (n_streamCtxt = 0;n_streamCtxt < gen_nb_xmlStreamCtxtPtr;n_streamCtxt++) { - mem_base = xmlMemBlocks(); - streamCtxt = gen_xmlStreamCtxtPtr(n_streamCtxt, 0); - - ret_val = xmlStreamWantsAnyNode(streamCtxt); - desret_int(ret_val); - call_tests++; - des_xmlStreamCtxtPtr(n_streamCtxt, streamCtxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStreamWantsAnyNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_streamCtxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_pattern(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing pattern : 10 of 15 functions ...\n"); - test_ret += test_xmlPatternFromRoot(); - test_ret += test_xmlPatternGetStreamCtxt(); - test_ret += test_xmlPatternMatch(); - test_ret += test_xmlPatternMaxDepth(); - test_ret += test_xmlPatternMinDepth(); - test_ret += test_xmlPatternStreamable(); - test_ret += test_xmlPatterncompile(); - test_ret += test_xmlStreamPop(); - test_ret += test_xmlStreamPush(); - test_ret += test_xmlStreamPushAttr(); - test_ret += test_xmlStreamPushNode(); - test_ret += test_xmlStreamWantsAnyNode(); - - if (test_ret != 0) - printf("Module pattern: %d errors\n", test_ret); - return(test_ret); -} -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlRelaxNGPtr 1 -static xmlRelaxNGPtr gen_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlRelaxNGPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlRelaxNGDump(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - FILE * output; /* the file output */ - int n_output; - xmlRelaxNGPtr schema; /* a schema structure */ - int n_schema; - - for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { - for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) { - mem_base = xmlMemBlocks(); - output = gen_FILE_ptr(n_output, 0); - schema = gen_xmlRelaxNGPtr(n_schema, 1); - - xmlRelaxNGDump(output, schema); - call_tests++; - des_FILE_ptr(n_output, output, 0); - des_xmlRelaxNGPtr(n_schema, schema, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_schema); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxNGDumpTree(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - FILE * output; /* the file output */ - int n_output; - xmlRelaxNGPtr schema; /* a schema structure */ - int n_schema; - - for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { - for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) { - mem_base = xmlMemBlocks(); - output = gen_FILE_ptr(n_output, 0); - schema = gen_xmlRelaxNGPtr(n_schema, 1); - - xmlRelaxNGDumpTree(output, schema); - call_tests++; - des_FILE_ptr(n_output, output, 0); - des_xmlRelaxNGPtr(n_schema, schema, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGDumpTree", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_schema); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlRelaxNGParserCtxtPtr 1 -static xmlRelaxNGParserCtxtPtr gen_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlRelaxNGParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlRelaxNGValidityErrorFunc_ptr 1 -static xmlRelaxNGValidityErrorFunc * gen_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlRelaxNGValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlRelaxNGValidityWarningFunc_ptr 1 -static xmlRelaxNGValidityWarningFunc * gen_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlRelaxNGValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlRelaxNGGetParserErrors(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlRelaxNGParserCtxtPtr ctxt; /* a Relax-NG validation context */ - int n_ctxt; - xmlRelaxNGValidityErrorFunc * err; /* the error callback result */ - int n_err; - xmlRelaxNGValidityWarningFunc * warn; /* the warning callback result */ - int n_warn; - void ** ctx; /* contextual data for the callbacks result */ - int n_ctx; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) { - for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) { - for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) { - for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0); - err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1); - warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2); - ctx = gen_void_ptr_ptr(n_ctx, 3); - - ret_val = xmlRelaxNGGetParserErrors(ctxt, err, warn, ctx); - desret_int(ret_val); - call_tests++; - des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1); - des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2); - des_void_ptr_ptr(n_ctx, ctx, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGGetParserErrors", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_err); - printf(" %d", n_warn); - printf(" %d", n_ctx); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlRelaxNGValidCtxtPtr 1 -static xmlRelaxNGValidCtxtPtr gen_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlRelaxNGValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRelaxNGValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlRelaxNGGetValidErrors(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */ - int n_ctxt; - xmlRelaxNGValidityErrorFunc * err; /* the error function result */ - int n_err; - xmlRelaxNGValidityWarningFunc * warn; /* the warning function result */ - int n_warn; - void ** ctx; /* the functions context result */ - int n_ctx; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { - for (n_err = 0;n_err < gen_nb_xmlRelaxNGValidityErrorFunc_ptr;n_err++) { - for (n_warn = 0;n_warn < gen_nb_xmlRelaxNGValidityWarningFunc_ptr;n_warn++) { - for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); - err = gen_xmlRelaxNGValidityErrorFunc_ptr(n_err, 1); - warn = gen_xmlRelaxNGValidityWarningFunc_ptr(n_warn, 2); - ctx = gen_void_ptr_ptr(n_ctx, 3); - - ret_val = xmlRelaxNGGetValidErrors(ctxt, err, warn, ctx); - desret_int(ret_val); - call_tests++; - des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlRelaxNGValidityErrorFunc_ptr(n_err, err, 1); - des_xmlRelaxNGValidityWarningFunc_ptr(n_warn, warn, 2); - des_void_ptr_ptr(n_ctx, ctx, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGGetValidErrors", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_err); - printf(" %d", n_warn); - printf(" %d", n_ctx); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxNGInitTypes(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - - mem_base = xmlMemBlocks(); - - ret_val = xmlRelaxNGInitTypes(); - desret_int(ret_val); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGInitTypes", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxNGNewDocParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlRelaxNGParserCtxtPtr ret_val; - xmlDocPtr doc; /* a preparsed document tree */ - int n_doc; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - - ret_val = xmlRelaxNGNewDocParserCtxt(doc); - desret_xmlRelaxNGParserCtxtPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGNewDocParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxNGNewMemParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlRelaxNGParserCtxtPtr ret_val; - char * buffer; /* a pointer to a char array containing the schemas */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - mem_base = xmlMemBlocks(); - buffer = gen_const_char_ptr(n_buffer, 0); - size = gen_int(n_size, 1); - - ret_val = xmlRelaxNGNewMemParserCtxt((const char *)buffer, size); - desret_xmlRelaxNGParserCtxtPtr(ret_val); - call_tests++; - des_const_char_ptr(n_buffer, (const char *)buffer, 0); - des_int(n_size, size, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGNewMemParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_size); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxNGNewParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlRelaxNGParserCtxtPtr ret_val; - char * URL; /* the location of the schema */ - int n_URL; - - for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) { - mem_base = xmlMemBlocks(); - URL = gen_const_char_ptr(n_URL, 0); - - ret_val = xmlRelaxNGNewParserCtxt((const char *)URL); - desret_xmlRelaxNGParserCtxtPtr(ret_val); - call_tests++; - des_const_char_ptr(n_URL, (const char *)URL, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGNewParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxNGNewValidCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlRelaxNGParse(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlRelaxNGSetParserErrors(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlRelaxNGSetParserStructuredErrors(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlRelaxNGSetValidErrors(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlRelaxNGSetValidStructuredErrors(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlRelaxNGValidateDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlRelaxNGValidCtxtPtr ctxt; /* a Relax-NG validation context */ - int n_ctxt; - xmlDocPtr doc; /* a parsed document tree */ - int n_doc; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - ret_val = xmlRelaxNGValidateDoc(ctxt, doc); - desret_int(ret_val); - call_tests++; - des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGValidateDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxNGValidateFullElement(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlNodePtr elem; /* an element instance */ - int n_elem; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlNodePtr(n_elem, 2); - - ret_val = xmlRelaxNGValidateFullElement(ctxt, doc, elem); - desret_int(ret_val); - call_tests++; - des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_elem, elem, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGValidateFullElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxNGValidatePopElement(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlNodePtr elem; /* an element instance */ - int n_elem; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlNodePtr(n_elem, 2); - - ret_val = xmlRelaxNGValidatePopElement(ctxt, doc, elem); - desret_int(ret_val); - call_tests++; - des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_elem, elem, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGValidatePopElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxNGValidatePushCData(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG validation context */ - int n_ctxt; - xmlChar * data; /* some character data read */ - int n_data; - int len; /* the lenght of the data */ - int n_len; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { - for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); - data = gen_const_xmlChar_ptr(n_data, 1); - len = gen_int(n_len, 2); - - ret_val = xmlRelaxNGValidatePushCData(ctxt, (const xmlChar *)data, len); - desret_int(ret_val); - call_tests++; - des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGValidatePushCData", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_data); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxNGValidatePushElement(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlRelaxNGValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlNodePtr elem; /* an element instance */ - int n_elem; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlNodePtr(n_elem, 2); - - ret_val = xmlRelaxNGValidatePushElement(ctxt, doc, elem); - desret_int(ret_val); - call_tests++; - des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_elem, elem, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxNGValidatePushElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRelaxParserSetFlag(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlRelaxNGParserCtxtPtr ctxt; /* a RelaxNG parser context */ - int n_ctxt; - int flags; /* a set of flags values */ - int n_flags; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGParserCtxtPtr;n_ctxt++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlRelaxNGParserCtxtPtr(n_ctxt, 0); - flags = gen_int(n_flags, 1); - - ret_val = xmlRelaxParserSetFlag(ctxt, flags); - desret_int(ret_val); - call_tests++; - des_xmlRelaxNGParserCtxtPtr(n_ctxt, ctxt, 0); - des_int(n_flags, flags, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRelaxParserSetFlag", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_flags); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_relaxng(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing relaxng : 14 of 24 functions ...\n"); - test_ret += test_xmlRelaxNGDump(); - test_ret += test_xmlRelaxNGDumpTree(); - test_ret += test_xmlRelaxNGGetParserErrors(); - test_ret += test_xmlRelaxNGGetValidErrors(); - test_ret += test_xmlRelaxNGInitTypes(); - test_ret += test_xmlRelaxNGNewDocParserCtxt(); - test_ret += test_xmlRelaxNGNewMemParserCtxt(); - test_ret += test_xmlRelaxNGNewParserCtxt(); - test_ret += test_xmlRelaxNGNewValidCtxt(); - test_ret += test_xmlRelaxNGParse(); - test_ret += test_xmlRelaxNGSetParserErrors(); - test_ret += test_xmlRelaxNGSetParserStructuredErrors(); - test_ret += test_xmlRelaxNGSetValidErrors(); - test_ret += test_xmlRelaxNGSetValidStructuredErrors(); - test_ret += test_xmlRelaxNGValidateDoc(); - test_ret += test_xmlRelaxNGValidateFullElement(); - test_ret += test_xmlRelaxNGValidatePopElement(); - test_ret += test_xmlRelaxNGValidatePushCData(); - test_ret += test_xmlRelaxNGValidatePushElement(); - test_ret += test_xmlRelaxParserSetFlag(); - - if (test_ret != 0) - printf("Module relaxng: %d errors\n", test_ret); - return(test_ret); -} -static int -test_schemasInternals(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing schemasInternals : 0 of 2 functions ...\n"); - - if (test_ret != 0) - printf("Module schemasInternals: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlSchematronNewDocParserCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchematronNewMemParserCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchematronNewParserCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -#ifdef LIBXML_SCHEMATRON_ENABLED - -#define gen_nb_xmlSchematronPtr 1 -static xmlSchematronPtr gen_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchematronPtr(int no ATTRIBUTE_UNUSED, xmlSchematronPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlSchematronNewValidCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -#ifdef LIBXML_SCHEMATRON_ENABLED - -#define gen_nb_xmlSchematronParserCtxtPtr 1 -static xmlSchematronParserCtxtPtr gen_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchematronParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlSchematronParse(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -#ifdef LIBXML_SCHEMATRON_ENABLED - -#define gen_nb_xmlSchematronValidCtxtPtr 1 -static xmlSchematronValidCtxtPtr gen_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchematronValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchematronValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlSchematronSetValidStructuredErrors(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchematronValidateDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMATRON_ENABLED) - int mem_base; - int ret_val; - xmlSchematronValidCtxtPtr ctxt; /* the schema validation context */ - int n_ctxt; - xmlDocPtr instance; /* the document instace tree */ - int n_instance; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchematronValidCtxtPtr;n_ctxt++) { - for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchematronValidCtxtPtr(n_ctxt, 0); - instance = gen_xmlDocPtr(n_instance, 1); - - ret_val = xmlSchematronValidateDoc(ctxt, instance); - desret_int(ret_val); - call_tests++; - des_xmlSchematronValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_instance, instance, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchematronValidateDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_instance); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_schematron(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing schematron : 1 of 10 functions ...\n"); - test_ret += test_xmlSchematronNewDocParserCtxt(); - test_ret += test_xmlSchematronNewMemParserCtxt(); - test_ret += test_xmlSchematronNewParserCtxt(); - test_ret += test_xmlSchematronNewValidCtxt(); - test_ret += test_xmlSchematronParse(); - test_ret += test_xmlSchematronSetValidStructuredErrors(); - test_ret += test_xmlSchematronValidateDoc(); - - if (test_ret != 0) - printf("Module schematron: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlAddChild(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr parent; /* the parent node */ - int n_parent; - xmlNodePtr cur; /* the child node */ - int n_cur; - - for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { - mem_base = xmlMemBlocks(); - parent = gen_xmlNodePtr(n_parent, 0); - cur = gen_xmlNodePtr_in(n_cur, 1); - - ret_val = xmlAddChild(parent, cur); - if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; } - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_parent, parent, 0); - des_xmlNodePtr_in(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAddChild", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_parent); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlAddChildList(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr parent; /* the parent node */ - int n_parent; - xmlNodePtr cur; /* the first node in the list */ - int n_cur; - - for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { - mem_base = xmlMemBlocks(); - parent = gen_xmlNodePtr(n_parent, 0); - cur = gen_xmlNodePtr_in(n_cur, 1); - - ret_val = xmlAddChildList(parent, cur); - if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; } - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_parent, parent, 0); - des_xmlNodePtr_in(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAddChildList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_parent); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlAddNextSibling(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr cur; /* the child node */ - int n_cur; - xmlNodePtr elem; /* the new node */ - int n_elem; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - elem = gen_xmlNodePtr_in(n_elem, 1); - - ret_val = xmlAddNextSibling(cur, elem); - if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_xmlNodePtr_in(n_elem, elem, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAddNextSibling", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_elem); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlAddPrevSibling(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr cur; /* the child node */ - int n_cur; - xmlNodePtr elem; /* the new node */ - int n_elem; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - elem = gen_xmlNodePtr_in(n_elem, 1); - - ret_val = xmlAddPrevSibling(cur, elem); - if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_xmlNodePtr_in(n_elem, elem, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAddPrevSibling", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_elem); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlAddSibling(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr cur; /* the child node */ - int n_cur; - xmlNodePtr elem; /* the new node */ - int n_elem; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr_in;n_elem++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - elem = gen_xmlNodePtr_in(n_elem, 1); - - ret_val = xmlAddSibling(cur, elem); - if (ret_val == NULL) { xmlFreeNode(elem) ; elem = NULL ; } - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_xmlNodePtr_in(n_elem, elem, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAddSibling", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_elem); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlAttrSerializeTxtContent(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef LIBXML_OUTPUT_ENABLED - int mem_base; - xmlBufferPtr buf; /* the XML buffer output */ - int n_buf; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlAttrPtr attr; /* the attribute node */ - int n_attr; - xmlChar * string; /* the text content */ - int n_string; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { - for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - doc = gen_xmlDocPtr(n_doc, 1); - attr = gen_xmlAttrPtr(n_attr, 2); - string = gen_const_xmlChar_ptr(n_string, 3); - - xmlAttrSerializeTxtContent(buf, doc, attr, (const xmlChar *)string); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlAttrPtr(n_attr, attr, 2); - des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAttrSerializeTxtContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_doc); - printf(" %d", n_attr); - printf(" %d", n_string); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -#define gen_nb_const_xmlBufPtr 1 -static xmlBufPtr gen_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_xmlBufPtr(int no ATTRIBUTE_UNUSED, const xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlBufContent(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlBufPtr buf; /* the buffer */ - int n_buf; - - for (n_buf = 0;n_buf < gen_nb_const_xmlBufPtr;n_buf++) { - mem_base = xmlMemBlocks(); - buf = gen_const_xmlBufPtr(n_buf, 0); - - ret_val = xmlBufContent((const xmlBufPtr)buf); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlBufPtr(n_buf, (const xmlBufPtr)buf, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufEnd(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlBufPtr buf; /* the buffer */ - int n_buf; - - for (n_buf = 0;n_buf < gen_nb_const_xmlBufPtr;n_buf++) { - mem_base = xmlMemBlocks(); - buf = gen_const_xmlBufPtr(n_buf, 0); - - ret_val = xmlBufEnd((const xmlBufPtr)buf); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlBufPtr(n_buf, (const xmlBufPtr)buf, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufEnd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlBufPtr 1 -static xmlBufPtr gen_xmlBufPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlBufPtr(int no ATTRIBUTE_UNUSED, xmlBufPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlBufGetNodeContent(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlBufPtr buf; /* a buffer xmlBufPtr */ - int n_buf; - xmlNodePtr cur; /* the node being read */ - int n_cur; - - for (n_buf = 0;n_buf < gen_nb_xmlBufPtr;n_buf++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufPtr(n_buf, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlBufGetNodeContent(buf, cur); - desret_int(ret_val); - call_tests++; - des_xmlBufPtr(n_buf, buf, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufGetNodeContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufNodeDump(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlBufShrink(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlBufUse(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlBufferAdd(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlBufferPtr buf; /* the buffer to dump */ - int n_buf; - xmlChar * str; /* the #xmlChar string */ - int n_str; - int len; /* the number of #xmlChar to add */ - int n_len; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - str = gen_const_xmlChar_ptr(n_str, 1); - len = gen_int(n_len, 2); - - ret_val = xmlBufferAdd(buf, (const xmlChar *)str, len); - desret_int(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferAdd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_str); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferAddHead(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlBufferPtr buf; /* the buffer */ - int n_buf; - xmlChar * str; /* the #xmlChar string */ - int n_str; - int len; /* the number of #xmlChar to add */ - int n_len; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - str = gen_const_xmlChar_ptr(n_str, 1); - len = gen_int(n_len, 2); - - ret_val = xmlBufferAddHead(buf, (const xmlChar *)str, len); - desret_int(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferAddHead", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_str); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferCCat(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlBufferPtr buf; /* the buffer to dump */ - int n_buf; - char * str; /* the C char string */ - int n_str; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - str = gen_const_char_ptr(n_str, 1); - - ret_val = xmlBufferCCat(buf, (const char *)str); - desret_int(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_const_char_ptr(n_str, (const char *)str, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferCCat", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_str); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferCat(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlBufferPtr buf; /* the buffer to add to */ - int n_buf; - xmlChar * str; /* the #xmlChar string */ - int n_str; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - str = gen_const_xmlChar_ptr(n_str, 1); - - ret_val = xmlBufferCat(buf, (const xmlChar *)str); - desret_int(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferCat", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_str); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_const_xmlBufferPtr 1 -static xmlBufferPtr gen_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_const_xmlBufferPtr(int no ATTRIBUTE_UNUSED, const xmlBufferPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlBufferContent(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlBufferPtr buf; /* the buffer */ - int n_buf; - - for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) { - mem_base = xmlMemBlocks(); - buf = gen_const_xmlBufferPtr(n_buf, 0); - - ret_val = xmlBufferContent((const xmlBufferPtr)buf); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferCreate(void) { - int test_ret = 0; - - int mem_base; - xmlBufferPtr ret_val; - - mem_base = xmlMemBlocks(); - - ret_val = xmlBufferCreate(); - desret_xmlBufferPtr(ret_val); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferCreate", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferCreateSize(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlBufferCreateStatic(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlBufferDetach(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlBufferPtr buf; /* the buffer */ - int n_buf; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - - ret_val = xmlBufferDetach(buf); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferDetach", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferEmpty(void) { - int test_ret = 0; - - int mem_base; - xmlBufferPtr buf; /* the buffer */ - int n_buf; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - - xmlBufferEmpty(buf); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferEmpty", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferGrow(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlBufferPtr buf; /* the buffer */ - int n_buf; - unsigned int len; /* the minimum free size to allocate */ - int n_len; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - len = gen_unsigned_int(n_len, 1); - - ret_val = xmlBufferGrow(buf, len); - desret_int(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_unsigned_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferGrow", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferLength(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlBufferPtr buf; /* the buffer */ - int n_buf; - - for (n_buf = 0;n_buf < gen_nb_const_xmlBufferPtr;n_buf++) { - mem_base = xmlMemBlocks(); - buf = gen_const_xmlBufferPtr(n_buf, 0); - - ret_val = xmlBufferLength((const xmlBufferPtr)buf); - desret_int(ret_val); - call_tests++; - des_const_xmlBufferPtr(n_buf, (const xmlBufferPtr)buf, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferLength", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferResize(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlBufferPtr buf; /* the buffer to resize */ - int n_buf; - unsigned int size; /* the desired size */ - int n_size; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_size = 0;n_size < gen_nb_unsigned_int;n_size++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - size = gen_unsigned_int(n_size, 1); - - ret_val = xmlBufferResize(buf, size); - desret_int(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_unsigned_int(n_size, size, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferResize", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_size); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferSetAllocationScheme(void) { - int test_ret = 0; - - int mem_base; - xmlBufferPtr buf; /* the buffer to tune */ - int n_buf; - xmlBufferAllocationScheme scheme; /* allocation scheme to use */ - int n_scheme; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - scheme = gen_xmlBufferAllocationScheme(n_scheme, 1); - - xmlBufferSetAllocationScheme(buf, scheme); - if ((buf != NULL) && (scheme == XML_BUFFER_ALLOC_IMMUTABLE) && (buf->content != NULL) && (buf->content != static_buf_content)) { xmlFree(buf->content); buf->content = NULL;} - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlBufferAllocationScheme(n_scheme, scheme, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferSetAllocationScheme", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_scheme); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferShrink(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlBufferPtr buf; /* the buffer to dump */ - int n_buf; - unsigned int len; /* the number of xmlChar to remove */ - int n_len; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_len = 0;n_len < gen_nb_unsigned_int;n_len++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - len = gen_unsigned_int(n_len, 1); - - ret_val = xmlBufferShrink(buf, len); - desret_int(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_unsigned_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferShrink", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferWriteCHAR(void) { - int test_ret = 0; - - int mem_base; - xmlBufferPtr buf; /* the XML buffer */ - int n_buf; - xmlChar * string; /* the string to add */ - int n_string; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - string = gen_const_xmlChar_ptr(n_string, 1); - - xmlBufferWriteCHAR(buf, (const xmlChar *)string); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferWriteCHAR", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_string); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferWriteChar(void) { - int test_ret = 0; - - int mem_base; - xmlBufferPtr buf; /* the XML buffer output */ - int n_buf; - char * string; /* the string to add */ - int n_string; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_string = 0;n_string < gen_nb_const_char_ptr;n_string++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - string = gen_const_char_ptr(n_string, 1); - - xmlBufferWriteChar(buf, (const char *)string); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_const_char_ptr(n_string, (const char *)string, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferWriteChar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_string); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBufferWriteQuotedString(void) { - int test_ret = 0; - - int mem_base; - xmlBufferPtr buf; /* the XML buffer output */ - int n_buf; - xmlChar * string; /* the string to add */ - int n_string; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr;n_string++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - string = gen_const_xmlChar_ptr(n_string, 1); - - xmlBufferWriteQuotedString(buf, (const xmlChar *)string); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_const_xmlChar_ptr(n_string, (const xmlChar *)string, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBufferWriteQuotedString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_string); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBuildQName(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * ncname; /* the Name */ - int n_ncname; - xmlChar * prefix; /* the prefix */ - int n_prefix; - xmlChar * memory; /* preallocated memory */ - int n_memory; - int len; /* preallocated memory length */ - int n_len; - - for (n_ncname = 0;n_ncname < gen_nb_const_xmlChar_ptr;n_ncname++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_memory = 0;n_memory < gen_nb_xmlChar_ptr;n_memory++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - ncname = gen_const_xmlChar_ptr(n_ncname, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - memory = gen_xmlChar_ptr(n_memory, 2); - len = gen_int(n_len, 3); - - ret_val = xmlBuildQName((const xmlChar *)ncname, (const xmlChar *)prefix, memory, len); - if ((ret_val != NULL) && (ret_val != ncname) && - (ret_val != prefix) && (ret_val != memory)) - xmlFree(ret_val); - ret_val = NULL; - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_ncname, (const xmlChar *)ncname, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - des_xmlChar_ptr(n_memory, memory, 2); - des_int(n_len, len, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBuildQName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ncname); - printf(" %d", n_prefix); - printf(" %d", n_memory); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlChildElementCount(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - unsigned long ret_val; - xmlNodePtr parent; /* the parent node */ - int n_parent; - - for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { - mem_base = xmlMemBlocks(); - parent = gen_xmlNodePtr(n_parent, 0); - - ret_val = xmlChildElementCount(parent); - desret_unsigned_long(ret_val); - call_tests++; - des_xmlNodePtr(n_parent, parent, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlChildElementCount", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_parent); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCopyDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlDocPtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - int recursive; /* if not zero do a recursive copy. */ - int n_recursive; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_recursive = 0;n_recursive < gen_nb_int;n_recursive++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - recursive = gen_int(n_recursive, 1); - - ret_val = xmlCopyDoc(doc, recursive); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_int(n_recursive, recursive, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_recursive); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCopyDtd(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlDtdPtr ret_val; - xmlDtdPtr dtd; /* the dtd */ - int n_dtd; - - for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { - mem_base = xmlMemBlocks(); - dtd = gen_xmlDtdPtr(n_dtd, 0); - - ret_val = xmlCopyDtd(dtd); - desret_xmlDtdPtr(ret_val); - call_tests++; - des_xmlDtdPtr(n_dtd, dtd, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyDtd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dtd); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlCopyNamespace(void) { - int test_ret = 0; - - int mem_base; - xmlNsPtr ret_val; - xmlNsPtr cur; /* the namespace */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNsPtr(n_cur, 0); - - ret_val = xmlCopyNamespace(cur); - if (ret_val != NULL) xmlFreeNs(ret_val); - desret_xmlNsPtr(ret_val); - call_tests++; - des_xmlNsPtr(n_cur, cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyNamespace", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCopyNamespaceList(void) { - int test_ret = 0; - - int mem_base; - xmlNsPtr ret_val; - xmlNsPtr cur; /* the first namespace */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_xmlNsPtr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNsPtr(n_cur, 0); - - ret_val = xmlCopyNamespaceList(cur); - if (ret_val != NULL) xmlFreeNsList(ret_val); - desret_xmlNsPtr(ret_val); - call_tests++; - des_xmlNsPtr(n_cur, cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyNamespaceList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCopyNode(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr node; /* the node */ - int n_node; - int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */ - int n_extended; - - for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { - for (n_extended = 0;n_extended < gen_nb_int;n_extended++) { - mem_base = xmlMemBlocks(); - node = gen_const_xmlNodePtr(n_node, 0); - extended = gen_int(n_extended, 1); - - ret_val = xmlCopyNode((const xmlNodePtr)node, extended); - desret_xmlNodePtr(ret_val); - call_tests++; - des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0); - des_int(n_extended, extended, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_extended); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCopyNodeList(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr node; /* the first node in the list. */ - int n_node; - - for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - node = gen_const_xmlNodePtr(n_node, 0); - - ret_val = xmlCopyNodeList((const xmlNodePtr)node); - desret_xmlNodePtr(ret_val); - call_tests++; - des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyNodeList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCopyProp(void) { - int test_ret = 0; - - int mem_base; - xmlAttrPtr ret_val; - xmlNodePtr target; /* the element where the attribute will be grafted */ - int n_target; - xmlAttrPtr cur; /* the attribute */ - int n_cur; - - for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) { - for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) { - mem_base = xmlMemBlocks(); - target = gen_xmlNodePtr(n_target, 0); - cur = gen_xmlAttrPtr(n_cur, 1); - - ret_val = xmlCopyProp(target, cur); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_target, target, 0); - des_xmlAttrPtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_target); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCopyPropList(void) { - int test_ret = 0; - - int mem_base; - xmlAttrPtr ret_val; - xmlNodePtr target; /* the element where the attributes will be grafted */ - int n_target; - xmlAttrPtr cur; /* the first attribute */ - int n_cur; - - for (n_target = 0;n_target < gen_nb_xmlNodePtr;n_target++) { - for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) { - mem_base = xmlMemBlocks(); - target = gen_xmlNodePtr(n_target, 0); - cur = gen_xmlAttrPtr(n_cur, 1); - - ret_val = xmlCopyPropList(target, cur); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_target, target, 0); - des_xmlAttrPtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyPropList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_target); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCreateIntSubset(void) { - int test_ret = 0; - - int mem_base; - xmlDtdPtr ret_val; - xmlDocPtr doc; /* the document pointer */ - int n_doc; - xmlChar * name; /* the DTD name */ - int n_name; - xmlChar * ExternalID; /* the external (PUBLIC) ID */ - int n_ExternalID; - xmlChar * SystemID; /* the system ID */ - int n_SystemID; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); - SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); - - ret_val = xmlCreateIntSubset(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); - desret_xmlDtdPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); - des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCreateIntSubset", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf(" %d", n_ExternalID); - printf(" %d", n_SystemID); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlDOMWrapCtxtPtr 1 -static xmlDOMWrapCtxtPtr gen_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlDOMWrapCtxtPtr(int no ATTRIBUTE_UNUSED, xmlDOMWrapCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlDOMWrapAdoptNode(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */ - int n_ctxt; - xmlDocPtr sourceDoc; /* the optional sourceDoc */ - int n_sourceDoc; - xmlNodePtr node; /* the node to start with */ - int n_node; - xmlDocPtr destDoc; /* the destination doc */ - int n_destDoc; - xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */ - int n_destParent; - int options; /* option flags */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { - for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) { - for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); - sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1); - node = gen_xmlNodePtr(n_node, 2); - destDoc = gen_xmlDocPtr(n_destDoc, 3); - destParent = gen_xmlNodePtr(n_destParent, 4); - options = gen_int(n_options, 5); - - ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options); - if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;} - desret_int(ret_val); - call_tests++; - des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_sourceDoc, sourceDoc, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlDocPtr(n_destDoc, destDoc, 3); - des_xmlNodePtr(n_destParent, destParent, 4); - des_int(n_options, options, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDOMWrapAdoptNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_sourceDoc); - printf(" %d", n_node); - printf(" %d", n_destDoc); - printf(" %d", n_destParent); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDOMWrapCloneNode(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDOMWrapCtxtPtr ctxt; /* the optional context for custom processing */ - int n_ctxt; - xmlDocPtr sourceDoc; /* the optional sourceDoc */ - int n_sourceDoc; - xmlNodePtr node; /* the node to start with */ - int n_node; - xmlNodePtr * resNode; /* the clone of the given @node */ - int n_resNode; - xmlDocPtr destDoc; /* the destination doc */ - int n_destDoc; - xmlNodePtr destParent; /* the optional new parent of @node in @destDoc */ - int n_destParent; - int deep; /* descend into child if set */ - int n_deep; - int options; /* option flags */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { - for (n_sourceDoc = 0;n_sourceDoc < gen_nb_xmlDocPtr;n_sourceDoc++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_resNode = 0;n_resNode < gen_nb_xmlNodePtr_ptr;n_resNode++) { - for (n_destDoc = 0;n_destDoc < gen_nb_xmlDocPtr;n_destDoc++) { - for (n_destParent = 0;n_destParent < gen_nb_xmlNodePtr;n_destParent++) { - for (n_deep = 0;n_deep < gen_nb_int;n_deep++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); - sourceDoc = gen_xmlDocPtr(n_sourceDoc, 1); - node = gen_xmlNodePtr(n_node, 2); - resNode = gen_xmlNodePtr_ptr(n_resNode, 3); - destDoc = gen_xmlDocPtr(n_destDoc, 4); - destParent = gen_xmlNodePtr(n_destParent, 5); - deep = gen_int(n_deep, 6); - options = gen_int(n_options, 7); - - ret_val = xmlDOMWrapCloneNode(ctxt, sourceDoc, node, resNode, destDoc, destParent, deep, options); - desret_int(ret_val); - call_tests++; - des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_sourceDoc, sourceDoc, 1); - des_xmlNodePtr(n_node, node, 2); - des_xmlNodePtr_ptr(n_resNode, resNode, 3); - des_xmlDocPtr(n_destDoc, destDoc, 4); - des_xmlNodePtr(n_destParent, destParent, 5); - des_int(n_deep, deep, 6); - des_int(n_options, options, 7); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDOMWrapCloneNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_sourceDoc); - printf(" %d", n_node); - printf(" %d", n_resNode); - printf(" %d", n_destDoc); - printf(" %d", n_destParent); - printf(" %d", n_deep); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDOMWrapNewCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlDOMWrapReconcileNamespaces(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDOMWrapCtxtPtr ctxt; /* DOM wrapper context, unused at the moment */ - int n_ctxt; - xmlNodePtr elem; /* the element-node */ - int n_elem; - int options; /* option flags */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); - elem = gen_xmlNodePtr(n_elem, 1); - options = gen_int(n_options, 2); - - ret_val = xmlDOMWrapReconcileNamespaces(ctxt, elem, options); - desret_int(ret_val); - call_tests++; - des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_elem, elem, 1); - des_int(n_options, options, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDOMWrapReconcileNamespaces", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_elem); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDOMWrapRemoveNode(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDOMWrapCtxtPtr ctxt; /* a DOM wrapper context */ - int n_ctxt; - xmlDocPtr doc; /* the doc */ - int n_doc; - xmlNodePtr node; /* the node to be removed. */ - int n_node; - int options; /* set of options, unused at the moment */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlDOMWrapCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlDOMWrapCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - node = gen_xmlNodePtr(n_node, 2); - options = gen_int(n_options, 3); - - ret_val = xmlDOMWrapRemoveNode(ctxt, doc, node, options); - desret_int(ret_val); - call_tests++; - des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_node, node, 2); - des_int(n_options, options, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDOMWrapRemoveNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_node); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDocCopyNode(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlDocPtr doc; /* the document */ - int n_doc; - int extended; /* if 1 do a recursive copy (properties, namespaces and children when applicable) if 2 copy properties and namespaces (when applicable) */ - int n_extended; - - for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_extended = 0;n_extended < gen_nb_int;n_extended++) { - mem_base = xmlMemBlocks(); - node = gen_const_xmlNodePtr(n_node, 0); - doc = gen_xmlDocPtr(n_doc, 1); - extended = gen_int(n_extended, 2); - - ret_val = xmlDocCopyNode((const xmlNodePtr)node, doc, extended); - desret_xmlNodePtr(ret_val); - call_tests++; - des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_int(n_extended, extended, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDocCopyNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_doc); - printf(" %d", n_extended); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDocCopyNodeList(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the target document */ - int n_doc; - xmlNodePtr node; /* the first node in the list. */ - int n_node; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_node = 0;n_node < gen_nb_const_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - node = gen_const_xmlNodePtr(n_node, 1); - - ret_val = xmlDocCopyNodeList(doc, (const xmlNodePtr)node); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlNodePtr(n_node, (const xmlNodePtr)node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDocCopyNodeList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDocDump(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - FILE * f; /* the FILE* */ - int n_f; - xmlDocPtr cur; /* the document */ - int n_cur; - - for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - mem_base = xmlMemBlocks(); - f = gen_FILE_ptr(n_f, 0); - cur = gen_xmlDocPtr(n_cur, 1); - - ret_val = xmlDocDump(f, cur); - desret_int(ret_val); - call_tests++; - des_FILE_ptr(n_f, f, 0); - des_xmlDocPtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDocDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_f); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDocDumpFormatMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlDocPtr cur; /* the document */ - int n_cur; - xmlChar ** mem; /* OUT: the memory pointer */ - int n_mem; - int * size; /* OUT: the memory length */ - int n_size; - int format; /* should formatting spaces been added */ - int n_format; - - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { - for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlDocPtr(n_cur, 0); - mem = gen_xmlChar_ptr_ptr(n_mem, 1); - size = gen_int_ptr(n_size, 2); - format = gen_int(n_format, 3); - - xmlDocDumpFormatMemory(cur, mem, size, format); - call_tests++; - des_xmlDocPtr(n_cur, cur, 0); - des_xmlChar_ptr_ptr(n_mem, mem, 1); - des_int_ptr(n_size, size, 2); - des_int(n_format, format, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDocDumpFormatMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_mem); - printf(" %d", n_size); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDocDumpFormatMemoryEnc(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlDocPtr out_doc; /* Document to generate XML text from */ - int n_out_doc; - xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */ - int n_doc_txt_ptr; - int * doc_txt_len; /* Length of the generated XML text */ - int n_doc_txt_len; - char * txt_encoding; /* Character encoding to use when generating XML text */ - int n_txt_encoding; - int format; /* should formatting spaces been added */ - int n_format; - - for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) { - for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) { - for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) { - for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - out_doc = gen_xmlDocPtr(n_out_doc, 0); - doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1); - doc_txt_len = gen_int_ptr(n_doc_txt_len, 2); - txt_encoding = gen_const_char_ptr(n_txt_encoding, 3); - format = gen_int(n_format, 4); - - xmlDocDumpFormatMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding, format); - call_tests++; - des_xmlDocPtr(n_out_doc, out_doc, 0); - des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1); - des_int_ptr(n_doc_txt_len, doc_txt_len, 2); - des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3); - des_int(n_format, format, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDocDumpFormatMemoryEnc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out_doc); - printf(" %d", n_doc_txt_ptr); - printf(" %d", n_doc_txt_len); - printf(" %d", n_txt_encoding); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDocDumpMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlDocPtr cur; /* the document */ - int n_cur; - xmlChar ** mem; /* OUT: the memory pointer */ - int n_mem; - int * size; /* OUT: the memory length */ - int n_size; - - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_mem = 0;n_mem < gen_nb_xmlChar_ptr_ptr;n_mem++) { - for (n_size = 0;n_size < gen_nb_int_ptr;n_size++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlDocPtr(n_cur, 0); - mem = gen_xmlChar_ptr_ptr(n_mem, 1); - size = gen_int_ptr(n_size, 2); - - xmlDocDumpMemory(cur, mem, size); - call_tests++; - des_xmlDocPtr(n_cur, cur, 0); - des_xmlChar_ptr_ptr(n_mem, mem, 1); - des_int_ptr(n_size, size, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDocDumpMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_mem); - printf(" %d", n_size); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDocDumpMemoryEnc(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlDocPtr out_doc; /* Document to generate XML text from */ - int n_out_doc; - xmlChar ** doc_txt_ptr; /* Memory pointer for allocated XML text */ - int n_doc_txt_ptr; - int * doc_txt_len; /* Length of the generated XML text */ - int n_doc_txt_len; - char * txt_encoding; /* Character encoding to use when generating XML text */ - int n_txt_encoding; - - for (n_out_doc = 0;n_out_doc < gen_nb_xmlDocPtr;n_out_doc++) { - for (n_doc_txt_ptr = 0;n_doc_txt_ptr < gen_nb_xmlChar_ptr_ptr;n_doc_txt_ptr++) { - for (n_doc_txt_len = 0;n_doc_txt_len < gen_nb_int_ptr;n_doc_txt_len++) { - for (n_txt_encoding = 0;n_txt_encoding < gen_nb_const_char_ptr;n_txt_encoding++) { - mem_base = xmlMemBlocks(); - out_doc = gen_xmlDocPtr(n_out_doc, 0); - doc_txt_ptr = gen_xmlChar_ptr_ptr(n_doc_txt_ptr, 1); - doc_txt_len = gen_int_ptr(n_doc_txt_len, 2); - txt_encoding = gen_const_char_ptr(n_txt_encoding, 3); - - xmlDocDumpMemoryEnc(out_doc, doc_txt_ptr, doc_txt_len, (const char *)txt_encoding); - call_tests++; - des_xmlDocPtr(n_out_doc, out_doc, 0); - des_xmlChar_ptr_ptr(n_doc_txt_ptr, doc_txt_ptr, 1); - des_int_ptr(n_doc_txt_len, doc_txt_len, 2); - des_const_char_ptr(n_txt_encoding, (const char *)txt_encoding, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDocDumpMemoryEnc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out_doc); - printf(" %d", n_doc_txt_ptr); - printf(" %d", n_doc_txt_len); - printf(" %d", n_txt_encoding); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDocFormatDump(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - FILE * f; /* the FILE* */ - int n_f; - xmlDocPtr cur; /* the document */ - int n_cur; - int format; /* should formatting spaces been added */ - int n_format; - - for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - f = gen_FILE_ptr(n_f, 0); - cur = gen_xmlDocPtr(n_cur, 1); - format = gen_int(n_format, 2); - - ret_val = xmlDocFormatDump(f, cur, format); - desret_int(ret_val); - call_tests++; - des_FILE_ptr(n_f, f, 0); - des_xmlDocPtr(n_cur, cur, 1); - des_int(n_format, format, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDocFormatDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_f); - printf(" %d", n_cur); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDocGetRootElement(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - - ret_val = xmlDocGetRootElement(doc); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDocGetRootElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlDocSetRootElement(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr root; /* the new document root element, if root is NULL no action is taken, to remove a node from a document use xmlUnlinkNode(root) instead. */ - int n_root; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_root = 0;n_root < gen_nb_xmlNodePtr_in;n_root++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - root = gen_xmlNodePtr_in(n_root, 1); - - ret_val = xmlDocSetRootElement(doc, root); - if (doc == NULL) { xmlFreeNode(root) ; root = NULL ; } - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr_in(n_root, root, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDocSetRootElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_root); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlElemDump(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - FILE * f; /* the FILE * for the output */ - int n_f; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr cur; /* the current node */ - int n_cur; - - for (n_f = 0;n_f < gen_nb_FILE_ptr;n_f++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - f = gen_FILE_ptr(n_f, 0); - doc = gen_xmlDocPtr(n_doc, 1); - cur = gen_xmlNodePtr(n_cur, 2); - - xmlElemDump(f, doc, cur); - call_tests++; - des_FILE_ptr(n_f, f, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_cur, cur, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlElemDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_f); - printf(" %d", n_doc); - printf(" %d", n_cur); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlFirstElementChild(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr parent; /* the parent node */ - int n_parent; - - for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { - mem_base = xmlMemBlocks(); - parent = gen_xmlNodePtr(n_parent, 0); - - ret_val = xmlFirstElementChild(parent); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_parent, parent, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlFirstElementChild", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_parent); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlGetBufferAllocationScheme(void) { - int test_ret = 0; - - int mem_base; - xmlBufferAllocationScheme ret_val; - - mem_base = xmlMemBlocks(); - - ret_val = xmlGetBufferAllocationScheme(); - desret_xmlBufferAllocationScheme(ret_val); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetBufferAllocationScheme", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetCompressMode(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - - mem_base = xmlMemBlocks(); - - ret_val = xmlGetCompressMode(); - desret_int(ret_val); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetCompressMode", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetDocCompressMode(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - - ret_val = xmlGetDocCompressMode(doc); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetDocCompressMode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetIntSubset(void) { - int test_ret = 0; - - int mem_base; - xmlDtdPtr ret_val; - xmlDocPtr doc; /* the document pointer */ - int n_doc; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - - ret_val = xmlGetIntSubset(doc); - desret_xmlDtdPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetIntSubset", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetLastChild(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr parent; /* the parent node */ - int n_parent; - - for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { - mem_base = xmlMemBlocks(); - parent = gen_xmlNodePtr(n_parent, 0); - - ret_val = xmlGetLastChild(parent); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_parent, parent, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetLastChild", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_parent); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetLineNo(void) { - int test_ret = 0; - - int mem_base; - long ret_val; - xmlNodePtr node; /* valid node */ - int n_node; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - - ret_val = xmlGetLineNo(node); - desret_long(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetLineNo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetNoNsProp(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlChar * name; /* the attribute name */ - int n_name; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlGetNoNsProp(node, (const xmlChar *)name); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetNoNsProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetNodePath(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlNodePtr node; /* a node */ - int n_node; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - - ret_val = xmlGetNodePath(node); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetNodePath", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlGetNsList(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlGetNsProp(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlChar * name; /* the attribute name */ - int n_name; - xmlChar * nameSpace; /* the URI of the namespace */ - int n_nameSpace; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2); - - ret_val = xmlGetNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetNsProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_name); - printf(" %d", n_nameSpace); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetProp(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlChar * name; /* the attribute name */ - int n_name; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlGetProp(node, (const xmlChar *)name); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHasNsProp(void) { - int test_ret = 0; - - int mem_base; - xmlAttrPtr ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlChar * name; /* the attribute name */ - int n_name; - xmlChar * nameSpace; /* the URI of the namespace */ - int n_nameSpace; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2); - - ret_val = xmlHasNsProp(node, (const xmlChar *)name, (const xmlChar *)nameSpace); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHasNsProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_name); - printf(" %d", n_nameSpace); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlHasProp(void) { - int test_ret = 0; - - int mem_base; - xmlAttrPtr ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlChar * name; /* the attribute name */ - int n_name; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlHasProp(node, (const xmlChar *)name); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlHasProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsBlankNode(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlNodePtr node; /* the node */ - int n_node; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - - ret_val = xmlIsBlankNode(node); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsBlankNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsXHTML(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * systemID; /* the system identifier */ - int n_systemID; - xmlChar * publicID; /* the public identifier */ - int n_publicID; - - for (n_systemID = 0;n_systemID < gen_nb_const_xmlChar_ptr;n_systemID++) { - for (n_publicID = 0;n_publicID < gen_nb_const_xmlChar_ptr;n_publicID++) { - mem_base = xmlMemBlocks(); - systemID = gen_const_xmlChar_ptr(n_systemID, 0); - publicID = gen_const_xmlChar_ptr(n_publicID, 1); - - ret_val = xmlIsXHTML((const xmlChar *)systemID, (const xmlChar *)publicID); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_systemID, (const xmlChar *)systemID, 0); - des_const_xmlChar_ptr(n_publicID, (const xmlChar *)publicID, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsXHTML", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_systemID); - printf(" %d", n_publicID); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlLastElementChild(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr parent; /* the parent node */ - int n_parent; - - for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { - mem_base = xmlMemBlocks(); - parent = gen_xmlNodePtr(n_parent, 0); - - ret_val = xmlLastElementChild(parent); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_parent, parent, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlLastElementChild", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_parent); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNewCDataBlock(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * content; /* the CDATA block content content */ - int n_content; - int len; /* the length of the block */ - int n_len; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - len = gen_int(n_len, 2); - - ret_val = xmlNewCDataBlock(doc, (const xmlChar *)content, len); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewCDataBlock", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_content); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewCharRef(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * name; /* the char ref string, starting with # or "&# ... ;" */ - int n_name; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlNewCharRef(doc, (const xmlChar *)name); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewCharRef", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewChild(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef LIBXML_TREE_ENABLED - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr parent; /* the parent node */ - int n_parent; - xmlNsPtr ns; /* a namespace if any */ - int n_ns; - xmlChar * name; /* the name of the child */ - int n_name; - xmlChar * content; /* the XML content of the child if any. */ - int n_content; - - for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - parent = gen_xmlNodePtr(n_parent, 0); - ns = gen_xmlNsPtr(n_ns, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - content = gen_const_xmlChar_ptr(n_content, 3); - - ret_val = xmlNewChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_parent, parent, 0); - des_xmlNsPtr(n_ns, ns, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewChild", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_parent); - printf(" %d", n_ns); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlNewComment(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlChar * content; /* the comment content */ - int n_content; - - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - content = gen_const_xmlChar_ptr(n_content, 0); - - ret_val = xmlNewComment((const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewComment", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_content); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewDoc(void) { - int test_ret = 0; - - int mem_base; - xmlDocPtr ret_val; - xmlChar * version; /* xmlChar string giving the version of XML "1.0" */ - int n_version; - - for (n_version = 0;n_version < gen_nb_const_xmlChar_ptr;n_version++) { - mem_base = xmlMemBlocks(); - version = gen_const_xmlChar_ptr(n_version, 0); - - ret_val = xmlNewDoc((const xmlChar *)version); - desret_xmlDocPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_version, (const xmlChar *)version, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_version); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewDocComment(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * content; /* the comment content */ - int n_content; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - - ret_val = xmlNewDocComment(doc, (const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDocComment", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_content); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewDocFragment(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document owning the fragment */ - int n_doc; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - - ret_val = xmlNewDocFragment(doc); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDocFragment", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNewDocNode(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNsPtr ns; /* namespace if any */ - int n_ns; - xmlChar * name; /* the node name */ - int n_name; - xmlChar * content; /* the XML text content if any */ - int n_content; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - ns = gen_xmlNsPtr(n_ns, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - content = gen_const_xmlChar_ptr(n_content, 3); - - ret_val = xmlNewDocNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNsPtr(n_ns, ns, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDocNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_ns); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewDocNodeEatName(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNsPtr ns; /* namespace if any */ - int n_ns; - xmlChar * name; /* the node name */ - int n_name; - xmlChar * content; /* the XML text content if any */ - int n_content; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - ns = gen_xmlNsPtr(n_ns, 1); - name = gen_eaten_name(n_name, 2); - content = gen_const_xmlChar_ptr(n_content, 3); - - ret_val = xmlNewDocNodeEatName(doc, ns, name, (const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNsPtr(n_ns, ns, 1); - des_eaten_name(n_name, name, 2); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDocNodeEatName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_ns); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewDocPI(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the target document */ - int n_doc; - xmlChar * name; /* the processing instruction name */ - int n_name; - xmlChar * content; /* the PI content */ - int n_content; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - content = gen_const_xmlChar_ptr(n_content, 2); - - ret_val = xmlNewDocPI(doc, (const xmlChar *)name, (const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDocPI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewDocProp(void) { - int test_ret = 0; - - int mem_base; - xmlAttrPtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * name; /* the name of the attribute */ - int n_name; - xmlChar * value; /* the value of the attribute */ - int n_value; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - value = gen_const_xmlChar_ptr(n_value, 2); - - ret_val = xmlNewDocProp(doc, (const xmlChar *)name, (const xmlChar *)value); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDocProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewDocRawNode(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) -#ifdef LIBXML_TREE_ENABLED - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNsPtr ns; /* namespace if any */ - int n_ns; - xmlChar * name; /* the node name */ - int n_name; - xmlChar * content; /* the text content if any */ - int n_content; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - ns = gen_xmlNsPtr(n_ns, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - content = gen_const_xmlChar_ptr(n_content, 3); - - ret_val = xmlNewDocRawNode(doc, ns, (const xmlChar *)name, (const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNsPtr(n_ns, ns, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDocRawNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_ns); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlNewDocText(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * content; /* the text content */ - int n_content; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - - ret_val = xmlNewDocText(doc, (const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDocText", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_content); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewDocTextLen(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * content; /* the text content */ - int n_content; - int len; /* the text len. */ - int n_len; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - len = gen_int(n_len, 2); - - ret_val = xmlNewDocTextLen(doc, (const xmlChar *)content, len); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDocTextLen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_content); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewDtd(void) { - int test_ret = 0; - - int mem_base; - xmlDtdPtr ret_val; - xmlDocPtr doc; /* the document pointer */ - int n_doc; - xmlChar * name; /* the DTD name */ - int n_name; - xmlChar * ExternalID; /* the external ID */ - int n_ExternalID; - xmlChar * SystemID; /* the system ID */ - int n_SystemID; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) { - for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 2); - SystemID = gen_const_xmlChar_ptr(n_SystemID, 3); - - ret_val = xmlNewDtd(doc, (const xmlChar *)name, (const xmlChar *)ExternalID, (const xmlChar *)SystemID); - desret_xmlDtdPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 2); - des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDtd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf(" %d", n_ExternalID); - printf(" %d", n_SystemID); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewNode(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNsPtr ns; /* namespace if any */ - int n_ns; - xmlChar * name; /* the node name */ - int n_name; - - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - ns = gen_xmlNsPtr(n_ns, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlNewNode(ns, (const xmlChar *)name); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNsPtr(n_ns, ns, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ns); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewNodeEatName(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNsPtr ns; /* namespace if any */ - int n_ns; - xmlChar * name; /* the node name */ - int n_name; - - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) { - mem_base = xmlMemBlocks(); - ns = gen_xmlNsPtr(n_ns, 0); - name = gen_eaten_name(n_name, 1); - - ret_val = xmlNewNodeEatName(ns, name); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNsPtr(n_ns, ns, 0); - des_eaten_name(n_name, name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewNodeEatName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ns); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewNs(void) { - int test_ret = 0; - - int mem_base; - xmlNsPtr ret_val; - xmlNodePtr node; /* the element carrying the namespace */ - int n_node; - xmlChar * href; /* the URI associated */ - int n_href; - xmlChar * prefix; /* the prefix for the namespace */ - int n_prefix; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - href = gen_const_xmlChar_ptr(n_href, 1); - prefix = gen_const_xmlChar_ptr(n_prefix, 2); - - ret_val = xmlNewNs(node, (const xmlChar *)href, (const xmlChar *)prefix); - if ((node == NULL) && (ret_val != NULL)) xmlFreeNs(ret_val); - desret_xmlNsPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 1); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewNs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_href); - printf(" %d", n_prefix); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewNsProp(void) { - int test_ret = 0; - - int mem_base; - xmlAttrPtr ret_val; - xmlNodePtr node; /* the holding node */ - int n_node; - xmlNsPtr ns; /* the namespace */ - int n_ns; - xmlChar * name; /* the name of the attribute */ - int n_name; - xmlChar * value; /* the value of the attribute */ - int n_value; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - ns = gen_xmlNsPtr(n_ns, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - value = gen_const_xmlChar_ptr(n_value, 3); - - ret_val = xmlNewNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_xmlNsPtr(n_ns, ns, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewNsProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_ns); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewNsPropEatName(void) { - int test_ret = 0; - - int mem_base; - xmlAttrPtr ret_val; - xmlNodePtr node; /* the holding node */ - int n_node; - xmlNsPtr ns; /* the namespace */ - int n_ns; - xmlChar * name; /* the name of the attribute */ - int n_name; - xmlChar * value; /* the value of the attribute */ - int n_value; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_eaten_name;n_name++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - ns = gen_xmlNsPtr(n_ns, 1); - name = gen_eaten_name(n_name, 2); - value = gen_const_xmlChar_ptr(n_value, 3); - - ret_val = xmlNewNsPropEatName(node, ns, name, (const xmlChar *)value); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_xmlNsPtr(n_ns, ns, 1); - des_eaten_name(n_name, name, 2); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewNsPropEatName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_ns); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewPI(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlChar * name; /* the processing instruction name */ - int n_name; - xmlChar * content; /* the PI content */ - int n_content; - - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - name = gen_const_xmlChar_ptr(n_name, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - - ret_val = xmlNewPI((const xmlChar *)name, (const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewPI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewProp(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef LIBXML_TREE_ENABLED - int mem_base; - xmlAttrPtr ret_val; - xmlNodePtr node; /* the holding node */ - int n_node; - xmlChar * name; /* the name of the attribute */ - int n_name; - xmlChar * value; /* the value of the attribute */ - int n_value; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - value = gen_const_xmlChar_ptr(n_value, 2); - - ret_val = xmlNewProp(node, (const xmlChar *)name, (const xmlChar *)value); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlNewReference(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * name; /* the reference name, or the reference string with & and ; */ - int n_name; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlNewReference(doc, (const xmlChar *)name); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewReference", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewText(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlChar * content; /* the text content */ - int n_content; - - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - content = gen_const_xmlChar_ptr(n_content, 0); - - ret_val = xmlNewText((const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewText", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_content); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewTextChild(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) -#ifdef LIBXML_TREE_ENABLED - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr parent; /* the parent node */ - int n_parent; - xmlNsPtr ns; /* a namespace if any */ - int n_ns; - xmlChar * name; /* the name of the child */ - int n_name; - xmlChar * content; /* the text content of the child if any. */ - int n_content; - - for (n_parent = 0;n_parent < gen_nb_xmlNodePtr;n_parent++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - parent = gen_xmlNodePtr(n_parent, 0); - ns = gen_xmlNsPtr(n_ns, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - content = gen_const_xmlChar_ptr(n_content, 3); - - ret_val = xmlNewTextChild(parent, ns, (const xmlChar *)name, (const xmlChar *)content); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_parent, parent, 0); - des_xmlNsPtr(n_ns, ns, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewTextChild", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_parent); - printf(" %d", n_ns); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlNewTextLen(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlChar * content; /* the text content */ - int n_content; - int len; /* the text len. */ - int n_len; - - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - content = gen_const_xmlChar_ptr(n_content, 0); - len = gen_int(n_len, 1); - - ret_val = xmlNewTextLen((const xmlChar *)content, len); - desret_xmlNodePtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 0); - des_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewTextLen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_content); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNextElementSibling(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr node; /* the current node */ - int n_node; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - - ret_val = xmlNextElementSibling(node); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNextElementSibling", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNodeAddContent(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr cur; /* the node being modified */ - int n_cur; - xmlChar * content; /* extra content */ - int n_content; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - - xmlNodeAddContent(cur, (const xmlChar *)content); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeAddContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_content); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNodeAddContentLen(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr cur; /* the node being modified */ - int n_cur; - xmlChar * content; /* extra content */ - int n_content; - int len; /* the size of @content */ - int n_len; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - len = gen_int(n_len, 2); - - xmlNodeAddContentLen(cur, (const xmlChar *)content, len); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeAddContentLen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_content); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNodeBufGetContent(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlBufferPtr buffer; /* a buffer */ - int n_buffer; - xmlNodePtr cur; /* the node being read */ - int n_cur; - - for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - buffer = gen_xmlBufferPtr(n_buffer, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlNodeBufGetContent(buffer, cur); - desret_int(ret_val); - call_tests++; - des_xmlBufferPtr(n_buffer, buffer, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeBufGetContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNodeDump(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlBufferPtr buf; /* the XML buffer output */ - int n_buf; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr cur; /* the current node */ - int n_cur; - int level; /* the imbrication level for indenting */ - int n_level; - int format; /* is formatting allowed */ - int n_format; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_level = 0;n_level < gen_nb_int;n_level++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - doc = gen_xmlDocPtr(n_doc, 1); - cur = gen_xmlNodePtr(n_cur, 2); - level = gen_int(n_level, 3); - format = gen_int(n_format, 4); - - ret_val = xmlNodeDump(buf, doc, cur, level, format); - desret_int(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_cur, cur, 2); - des_int(n_level, level, 3); - des_int(n_format, format, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_doc); - printf(" %d", n_cur); - printf(" %d", n_level); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNodeDumpOutput(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlOutputBufferPtr buf; /* the XML buffer output */ - int n_buf; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr cur; /* the current node */ - int n_cur; - int level; /* the imbrication level for indenting */ - int n_level; - int format; /* is formatting allowed */ - int n_format; - char * encoding; /* an optional encoding string */ - int n_encoding; - - for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_level = 0;n_level < gen_nb_int;n_level++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlOutputBufferPtr(n_buf, 0); - doc = gen_xmlDocPtr(n_doc, 1); - cur = gen_xmlNodePtr(n_cur, 2); - level = gen_int(n_level, 3); - format = gen_int(n_format, 4); - encoding = gen_const_char_ptr(n_encoding, 5); - - xmlNodeDumpOutput(buf, doc, cur, level, format, (const char *)encoding); - call_tests++; - des_xmlOutputBufferPtr(n_buf, buf, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_cur, cur, 2); - des_int(n_level, level, 3); - des_int(n_format, format, 4); - des_const_char_ptr(n_encoding, (const char *)encoding, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeDumpOutput", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_doc); - printf(" %d", n_cur); - printf(" %d", n_level); - printf(" %d", n_format); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNodeGetBase(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlDocPtr doc; /* the document the node pertains to */ - int n_doc; - xmlNodePtr cur; /* the node being checked */ - int n_cur; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlNodeGetBase(doc, cur); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeGetBase", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNodeGetContent(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlNodePtr cur; /* the node being read */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - - ret_val = xmlNodeGetContent(cur); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeGetContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNodeGetLang(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlNodePtr cur; /* the node being checked */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - - ret_val = xmlNodeGetLang(cur); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeGetLang", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNodeGetSpacePreserve(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlNodePtr cur; /* the node being checked */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - - ret_val = xmlNodeGetSpacePreserve(cur); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeGetSpacePreserve", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNodeIsText(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlNodePtr node; /* the node */ - int n_node; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - - ret_val = xmlNodeIsText(node); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeIsText", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNodeListGetRawString(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr list; /* a Node list */ - int n_list; - int inLine; /* should we replace entity contents or show their external form */ - int n_inLine; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) { - for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - list = gen_xmlNodePtr(n_list, 1); - inLine = gen_int(n_inLine, 2); - - ret_val = xmlNodeListGetRawString(doc, list, inLine); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr(n_list, list, 1); - des_int(n_inLine, inLine, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeListGetRawString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_list); - printf(" %d", n_inLine); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNodeListGetString(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr list; /* a Node list */ - int n_list; - int inLine; /* should we replace entity contents or show their external form */ - int n_inLine; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_list = 0;n_list < gen_nb_xmlNodePtr;n_list++) { - for (n_inLine = 0;n_inLine < gen_nb_int;n_inLine++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - list = gen_xmlNodePtr(n_list, 1); - inLine = gen_int(n_inLine, 2); - - ret_val = xmlNodeListGetString(doc, list, inLine); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr(n_list, list, 1); - des_int(n_inLine, inLine, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeListGetString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_list); - printf(" %d", n_inLine); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNodeSetBase(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) - int mem_base; - xmlNodePtr cur; /* the node being changed */ - int n_cur; - xmlChar * uri; /* the new base URI */ - int n_uri; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_uri = 0;n_uri < gen_nb_const_xmlChar_ptr;n_uri++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - uri = gen_const_xmlChar_ptr(n_uri, 1); - - xmlNodeSetBase(cur, (const xmlChar *)uri); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_const_xmlChar_ptr(n_uri, (const xmlChar *)uri, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeSetBase", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_uri); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNodeSetContent(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr cur; /* the node being modified */ - int n_cur; - xmlChar * content; /* the new value of the content */ - int n_content; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - - xmlNodeSetContent(cur, (const xmlChar *)content); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeSetContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_content); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNodeSetContentLen(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlNodePtr cur; /* the node being modified */ - int n_cur; - xmlChar * content; /* the new value of the content */ - int n_content; - int len; /* the size of @content */ - int n_len; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - len = gen_int(n_len, 2); - - xmlNodeSetContentLen(cur, (const xmlChar *)content, len); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeSetContentLen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_content); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNodeSetLang(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlNodePtr cur; /* the node being changed */ - int n_cur; - xmlChar * lang; /* the language description */ - int n_lang; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_lang = 0;n_lang < gen_nb_const_xmlChar_ptr;n_lang++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - lang = gen_const_xmlChar_ptr(n_lang, 1); - - xmlNodeSetLang(cur, (const xmlChar *)lang); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_const_xmlChar_ptr(n_lang, (const xmlChar *)lang, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeSetLang", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_lang); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNodeSetName(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlNodePtr cur; /* the node being changed */ - int n_cur; - xmlChar * name; /* the new tag name */ - int n_name; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - xmlNodeSetName(cur, (const xmlChar *)name); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeSetName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNodeSetSpacePreserve(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlNodePtr cur; /* the node being changed */ - int n_cur; - int val; /* the xml:space value ("0": default, 1: "preserve") */ - int n_val; - - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodePtr(n_cur, 0); - val = gen_int(n_val, 1); - - xmlNodeSetSpacePreserve(cur, val); - call_tests++; - des_xmlNodePtr(n_cur, cur, 0); - des_int(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNodeSetSpacePreserve", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlPreviousElementSibling(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr node; /* the current node */ - int n_node; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - - ret_val = xmlPreviousElementSibling(node); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPreviousElementSibling", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlReconciliateNs(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) -#ifdef LIBXML_TREE_ENABLED - int mem_base; - int ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr tree; /* a node defining the subtree to reconciliate */ - int n_tree; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - tree = gen_xmlNodePtr(n_tree, 1); - - ret_val = xmlReconciliateNs(doc, tree); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr(n_tree, tree, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReconciliateNs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_tree); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlRemoveProp(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlAttrPtr cur; /* an attribute */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_xmlAttrPtr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlAttrPtr(n_cur, 0); - - ret_val = xmlRemoveProp(cur); - cur = NULL; - desret_int(ret_val); - call_tests++; - des_xmlAttrPtr(n_cur, cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRemoveProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlReplaceNode(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr old; /* the old node */ - int n_old; - xmlNodePtr cur; /* the node */ - int n_cur; - - for (n_old = 0;n_old < gen_nb_xmlNodePtr;n_old++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr_in;n_cur++) { - mem_base = xmlMemBlocks(); - old = gen_xmlNodePtr(n_old, 0); - cur = gen_xmlNodePtr_in(n_cur, 1); - - ret_val = xmlReplaceNode(old, cur); - if (cur != NULL) { - xmlUnlinkNode(cur); - xmlFreeNode(cur) ; cur = NULL ; } - if (old != NULL) { - xmlUnlinkNode(old); - xmlFreeNode(old) ; old = NULL ; } - ret_val = NULL; - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr(n_old, old, 0); - des_xmlNodePtr_in(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReplaceNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_old); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSaveFile(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - const char * filename; /* the filename (or URL) */ - int n_filename; - xmlDocPtr cur; /* the document */ - int n_cur; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - cur = gen_xmlDocPtr(n_cur, 1); - - ret_val = xmlSaveFile(filename, cur); - desret_int(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - des_xmlDocPtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSaveFileEnc(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - const char * filename; /* the filename (or URL) */ - int n_filename; - xmlDocPtr cur; /* the document */ - int n_cur; - char * encoding; /* the name of an encoding (or NULL) */ - int n_encoding; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - cur = gen_xmlDocPtr(n_cur, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - - ret_val = xmlSaveFileEnc(filename, cur, (const char *)encoding); - desret_int(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - des_xmlDocPtr(n_cur, cur, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveFileEnc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSaveFileTo(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlOutputBufferPtr buf; /* an output I/O buffer */ - int n_buf; - xmlDocPtr cur; /* the document */ - int n_cur; - char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */ - int n_encoding; - - for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlOutputBufferPtr(n_buf, 0); - cur = gen_xmlDocPtr(n_cur, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - - ret_val = xmlSaveFileTo(buf, cur, (const char *)encoding); - buf = NULL; - desret_int(ret_val); - call_tests++; - des_xmlOutputBufferPtr(n_buf, buf, 0); - des_xmlDocPtr(n_cur, cur, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveFileTo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSaveFormatFile(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - const char * filename; /* the filename (or URL) */ - int n_filename; - xmlDocPtr cur; /* the document */ - int n_cur; - int format; /* should formatting spaces been added */ - int n_format; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - cur = gen_xmlDocPtr(n_cur, 1); - format = gen_int(n_format, 2); - - ret_val = xmlSaveFormatFile(filename, cur, format); - desret_int(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - des_xmlDocPtr(n_cur, cur, 1); - des_int(n_format, format, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveFormatFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_cur); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSaveFormatFileEnc(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - const char * filename; /* the filename or URL to output */ - int n_filename; - xmlDocPtr cur; /* the document being saved */ - int n_cur; - char * encoding; /* the name of the encoding to use or NULL. */ - int n_encoding; - int format; /* should formatting spaces be added. */ - int n_format; - - for (n_filename = 0;n_filename < gen_nb_fileoutput;n_filename++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - filename = gen_fileoutput(n_filename, 0); - cur = gen_xmlDocPtr(n_cur, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - format = gen_int(n_format, 3); - - ret_val = xmlSaveFormatFileEnc(filename, cur, (const char *)encoding, format); - desret_int(ret_val); - call_tests++; - des_fileoutput(n_filename, filename, 0); - des_xmlDocPtr(n_cur, cur, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_int(n_format, format, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveFormatFileEnc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSaveFormatFileTo(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlOutputBufferPtr buf; /* an output I/O buffer */ - int n_buf; - xmlDocPtr cur; /* the document */ - int n_cur; - char * encoding; /* the encoding if any assuming the I/O layer handles the trancoding */ - int n_encoding; - int format; /* should formatting spaces been added */ - int n_format; - - for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) { - for (n_cur = 0;n_cur < gen_nb_xmlDocPtr;n_cur++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_format = 0;n_format < gen_nb_int;n_format++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlOutputBufferPtr(n_buf, 0); - cur = gen_xmlDocPtr(n_cur, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - format = gen_int(n_format, 3); - - ret_val = xmlSaveFormatFileTo(buf, cur, (const char *)encoding, format); - buf = NULL; - desret_int(ret_val); - call_tests++; - des_xmlOutputBufferPtr(n_buf, buf, 0); - des_xmlDocPtr(n_cur, cur, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_int(n_format, format, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveFormatFileTo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_cur); - printf(" %d", n_encoding); - printf(" %d", n_format); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSearchNs(void) { - int test_ret = 0; - - int mem_base; - xmlNsPtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr node; /* the current node */ - int n_node; - xmlChar * nameSpace; /* the namespace prefix */ - int n_nameSpace; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_nameSpace = 0;n_nameSpace < gen_nb_const_xmlChar_ptr;n_nameSpace++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - node = gen_xmlNodePtr(n_node, 1); - nameSpace = gen_const_xmlChar_ptr(n_nameSpace, 2); - - ret_val = xmlSearchNs(doc, node, (const xmlChar *)nameSpace); - desret_xmlNsPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr(n_node, node, 1); - des_const_xmlChar_ptr(n_nameSpace, (const xmlChar *)nameSpace, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSearchNs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_node); - printf(" %d", n_nameSpace); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSearchNsByHref(void) { - int test_ret = 0; - - int mem_base; - xmlNsPtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr node; /* the current node */ - int n_node; - xmlChar * href; /* the namespace value */ - int n_href; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_href = 0;n_href < gen_nb_const_xmlChar_ptr;n_href++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - node = gen_xmlNodePtr(n_node, 1); - href = gen_const_xmlChar_ptr(n_href, 2); - - ret_val = xmlSearchNsByHref(doc, node, (const xmlChar *)href); - desret_xmlNsPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr(n_node, node, 1); - des_const_xmlChar_ptr(n_href, (const xmlChar *)href, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSearchNsByHref", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_node); - printf(" %d", n_href); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSetBufferAllocationScheme(void) { - int test_ret = 0; - - int mem_base; - xmlBufferAllocationScheme scheme; /* allocation method to use */ - int n_scheme; - - for (n_scheme = 0;n_scheme < gen_nb_xmlBufferAllocationScheme;n_scheme++) { - mem_base = xmlMemBlocks(); - scheme = gen_xmlBufferAllocationScheme(n_scheme, 0); - - xmlSetBufferAllocationScheme(scheme); - call_tests++; - des_xmlBufferAllocationScheme(n_scheme, scheme, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSetBufferAllocationScheme", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_scheme); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSetCompressMode(void) { - int test_ret = 0; - - int mem_base; - int mode; /* the compression ratio */ - int n_mode; - - for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { - mem_base = xmlMemBlocks(); - mode = gen_int(n_mode, 0); - - xmlSetCompressMode(mode); - call_tests++; - des_int(n_mode, mode, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSetCompressMode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_mode); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSetDocCompressMode(void) { - int test_ret = 0; - - int mem_base; - xmlDocPtr doc; /* the document */ - int n_doc; - int mode; /* the compression ratio */ - int n_mode; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_mode = 0;n_mode < gen_nb_int;n_mode++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - mode = gen_int(n_mode, 1); - - xmlSetDocCompressMode(doc, mode); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_int(n_mode, mode, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSetDocCompressMode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_mode); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSetNs(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr node; /* a node in the document */ - int n_node; - xmlNsPtr ns; /* a namespace pointer */ - int n_ns; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - ns = gen_xmlNsPtr(n_ns, 1); - - xmlSetNs(node, ns); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_xmlNsPtr(n_ns, ns, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSetNs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_ns); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSetNsProp(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) - int mem_base; - xmlAttrPtr ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlNsPtr ns; /* the namespace definition */ - int n_ns; - xmlChar * name; /* the attribute name */ - int n_name; - xmlChar * value; /* the attribute value */ - int n_value; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - ns = gen_xmlNsPtr(n_ns, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - value = gen_const_xmlChar_ptr(n_value, 3); - - ret_val = xmlSetNsProp(node, ns, (const xmlChar *)name, (const xmlChar *)value); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_xmlNsPtr(n_ns, ns, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSetNsProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_ns); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSetProp(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) - int mem_base; - xmlAttrPtr ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlChar * name; /* the attribute name (a QName) */ - int n_name; - xmlChar * value; /* the attribute value */ - int n_value; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - value = gen_const_xmlChar_ptr(n_value, 2); - - ret_val = xmlSetProp(node, (const xmlChar *)name, (const xmlChar *)value); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSetProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSplitQName2(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * name; /* the full QName */ - int n_name; - xmlChar ** prefix; /* a xmlChar ** */ - int n_prefix; - - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_prefix = 0;n_prefix < gen_nb_xmlChar_ptr_ptr;n_prefix++) { - mem_base = xmlMemBlocks(); - name = gen_const_xmlChar_ptr(n_name, 0); - prefix = gen_xmlChar_ptr_ptr(n_prefix, 1); - - ret_val = xmlSplitQName2((const xmlChar *)name, prefix); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); - des_xmlChar_ptr_ptr(n_prefix, prefix, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSplitQName2", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf(" %d", n_prefix); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSplitQName3(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlChar * name; /* the full QName */ - int n_name; - int * len; /* an int * */ - int n_len; - - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { - mem_base = xmlMemBlocks(); - name = gen_const_xmlChar_ptr(n_name, 0); - len = gen_int_ptr(n_len, 1); - - ret_val = xmlSplitQName3((const xmlChar *)name, len); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); - des_int_ptr(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSplitQName3", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStringGetNodeList(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * value; /* the value of the attribute */ - int n_value; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - - ret_val = xmlStringGetNodeList(doc, (const xmlChar *)value); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStringGetNodeList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStringLenGetNodeList(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * value; /* the value of the text */ - int n_value; - int len; /* the length of the string value */ - int n_len; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - len = gen_int(n_len, 2); - - ret_val = xmlStringLenGetNodeList(doc, (const xmlChar *)value, len); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStringLenGetNodeList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_value); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlTextConcat(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlChar * content; /* the content */ - int n_content; - int len; /* @content length */ - int n_len; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - len = gen_int(n_len, 2); - - ret_val = xmlTextConcat(node, (const xmlChar *)content, len); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextConcat", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_content); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlTextMerge(void) { - int test_ret = 0; - - int mem_base; - xmlNodePtr ret_val; - xmlNodePtr first; /* the first text node */ - int n_first; - xmlNodePtr second; /* the second text node being merged */ - int n_second; - - for (n_first = 0;n_first < gen_nb_xmlNodePtr_in;n_first++) { - for (n_second = 0;n_second < gen_nb_xmlNodePtr_in;n_second++) { - mem_base = xmlMemBlocks(); - first = gen_xmlNodePtr_in(n_first, 0); - second = gen_xmlNodePtr_in(n_second, 1); - - ret_val = xmlTextMerge(first, second); - if ((first != NULL) && (first->type != XML_TEXT_NODE)) { - xmlUnlinkNode(second); - xmlFreeNode(second) ; second = NULL ; } - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlNodePtr_in(n_first, first, 0); - des_xmlNodePtr_in(n_second, second, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextMerge", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_first); - printf(" %d", n_second); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlUnsetNsProp(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlNsPtr ns; /* the namespace definition */ - int n_ns; - xmlChar * name; /* the attribute name */ - int n_name; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - ns = gen_xmlNsPtr(n_ns, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - - ret_val = xmlUnsetNsProp(node, ns, (const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_xmlNsPtr(n_ns, ns, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUnsetNsProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_ns); - printf(" %d", n_name); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUnsetProp(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlNodePtr node; /* the node */ - int n_node; - xmlChar * name; /* the attribute name */ - int n_name; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlUnsetProp(node, (const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUnsetProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateNCName(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) -#ifdef LIBXML_TREE_ENABLED - int mem_base; - int ret_val; - xmlChar * value; /* the value to check */ - int n_value; - int space; /* allow spaces in front and end of the string */ - int n_space; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_space = 0;n_space < gen_nb_int;n_space++) { - mem_base = xmlMemBlocks(); - value = gen_const_xmlChar_ptr(n_value, 0); - space = gen_int(n_space, 1); - - ret_val = xmlValidateNCName((const xmlChar *)value, space); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - des_int(n_space, space, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateNCName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf(" %d", n_space); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlValidateNMToken(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef LIBXML_TREE_ENABLED - int mem_base; - int ret_val; - xmlChar * value; /* the value to check */ - int n_value; - int space; /* allow spaces in front and end of the string */ - int n_space; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_space = 0;n_space < gen_nb_int;n_space++) { - mem_base = xmlMemBlocks(); - value = gen_const_xmlChar_ptr(n_value, 0); - space = gen_int(n_space, 1); - - ret_val = xmlValidateNMToken((const xmlChar *)value, space); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - des_int(n_space, space, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateNMToken", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf(" %d", n_space); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlValidateName(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef LIBXML_TREE_ENABLED - int mem_base; - int ret_val; - xmlChar * value; /* the value to check */ - int n_value; - int space; /* allow spaces in front and end of the string */ - int n_space; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_space = 0;n_space < gen_nb_int;n_space++) { - mem_base = xmlMemBlocks(); - value = gen_const_xmlChar_ptr(n_value, 0); - space = gen_int(n_space, 1); - - ret_val = xmlValidateName((const xmlChar *)value, space); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - des_int(n_space, space, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf(" %d", n_space); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlValidateQName(void) { - int test_ret = 0; - -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) -#ifdef LIBXML_TREE_ENABLED - int mem_base; - int ret_val; - xmlChar * value; /* the value to check */ - int n_value; - int space; /* allow spaces in front and end of the string */ - int n_space; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_space = 0;n_space < gen_nb_int;n_space++) { - mem_base = xmlMemBlocks(); - value = gen_const_xmlChar_ptr(n_value, 0); - space = gen_int(n_space, 1); - - ret_val = xmlValidateQName((const xmlChar *)value, space); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - des_int(n_space, space, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateQName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf(" %d", n_space); - printf("\n"); - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - -static int -test_tree(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing tree : 142 of 164 functions ...\n"); - test_ret += test_xmlAddChild(); - test_ret += test_xmlAddChildList(); - test_ret += test_xmlAddNextSibling(); - test_ret += test_xmlAddPrevSibling(); - test_ret += test_xmlAddSibling(); - test_ret += test_xmlAttrSerializeTxtContent(); - test_ret += test_xmlBufContent(); - test_ret += test_xmlBufEnd(); - test_ret += test_xmlBufGetNodeContent(); - test_ret += test_xmlBufNodeDump(); - test_ret += test_xmlBufShrink(); - test_ret += test_xmlBufUse(); - test_ret += test_xmlBufferAdd(); - test_ret += test_xmlBufferAddHead(); - test_ret += test_xmlBufferCCat(); - test_ret += test_xmlBufferCat(); - test_ret += test_xmlBufferContent(); - test_ret += test_xmlBufferCreate(); - test_ret += test_xmlBufferCreateSize(); - test_ret += test_xmlBufferCreateStatic(); - test_ret += test_xmlBufferDetach(); - test_ret += test_xmlBufferEmpty(); - test_ret += test_xmlBufferGrow(); - test_ret += test_xmlBufferLength(); - test_ret += test_xmlBufferResize(); - test_ret += test_xmlBufferSetAllocationScheme(); - test_ret += test_xmlBufferShrink(); - test_ret += test_xmlBufferWriteCHAR(); - test_ret += test_xmlBufferWriteChar(); - test_ret += test_xmlBufferWriteQuotedString(); - test_ret += test_xmlBuildQName(); - test_ret += test_xmlChildElementCount(); - test_ret += test_xmlCopyDoc(); - test_ret += test_xmlCopyDtd(); - test_ret += test_xmlCopyNamespace(); - test_ret += test_xmlCopyNamespaceList(); - test_ret += test_xmlCopyNode(); - test_ret += test_xmlCopyNodeList(); - test_ret += test_xmlCopyProp(); - test_ret += test_xmlCopyPropList(); - test_ret += test_xmlCreateIntSubset(); - test_ret += test_xmlDOMWrapAdoptNode(); - test_ret += test_xmlDOMWrapCloneNode(); - test_ret += test_xmlDOMWrapNewCtxt(); - test_ret += test_xmlDOMWrapReconcileNamespaces(); - test_ret += test_xmlDOMWrapRemoveNode(); - test_ret += test_xmlDocCopyNode(); - test_ret += test_xmlDocCopyNodeList(); - test_ret += test_xmlDocDump(); - test_ret += test_xmlDocDumpFormatMemory(); - test_ret += test_xmlDocDumpFormatMemoryEnc(); - test_ret += test_xmlDocDumpMemory(); - test_ret += test_xmlDocDumpMemoryEnc(); - test_ret += test_xmlDocFormatDump(); - test_ret += test_xmlDocGetRootElement(); - test_ret += test_xmlDocSetRootElement(); - test_ret += test_xmlElemDump(); - test_ret += test_xmlFirstElementChild(); - test_ret += test_xmlGetBufferAllocationScheme(); - test_ret += test_xmlGetCompressMode(); - test_ret += test_xmlGetDocCompressMode(); - test_ret += test_xmlGetIntSubset(); - test_ret += test_xmlGetLastChild(); - test_ret += test_xmlGetLineNo(); - test_ret += test_xmlGetNoNsProp(); - test_ret += test_xmlGetNodePath(); - test_ret += test_xmlGetNsList(); - test_ret += test_xmlGetNsProp(); - test_ret += test_xmlGetProp(); - test_ret += test_xmlHasNsProp(); - test_ret += test_xmlHasProp(); - test_ret += test_xmlIsBlankNode(); - test_ret += test_xmlIsXHTML(); - test_ret += test_xmlLastElementChild(); - test_ret += test_xmlNewCDataBlock(); - test_ret += test_xmlNewCharRef(); - test_ret += test_xmlNewChild(); - test_ret += test_xmlNewComment(); - test_ret += test_xmlNewDoc(); - test_ret += test_xmlNewDocComment(); - test_ret += test_xmlNewDocFragment(); - test_ret += test_xmlNewDocNode(); - test_ret += test_xmlNewDocNodeEatName(); - test_ret += test_xmlNewDocPI(); - test_ret += test_xmlNewDocProp(); - test_ret += test_xmlNewDocRawNode(); - test_ret += test_xmlNewDocText(); - test_ret += test_xmlNewDocTextLen(); - test_ret += test_xmlNewDtd(); - test_ret += test_xmlNewNode(); - test_ret += test_xmlNewNodeEatName(); - test_ret += test_xmlNewNs(); - test_ret += test_xmlNewNsProp(); - test_ret += test_xmlNewNsPropEatName(); - test_ret += test_xmlNewPI(); - test_ret += test_xmlNewProp(); - test_ret += test_xmlNewReference(); - test_ret += test_xmlNewText(); - test_ret += test_xmlNewTextChild(); - test_ret += test_xmlNewTextLen(); - test_ret += test_xmlNextElementSibling(); - test_ret += test_xmlNodeAddContent(); - test_ret += test_xmlNodeAddContentLen(); - test_ret += test_xmlNodeBufGetContent(); - test_ret += test_xmlNodeDump(); - test_ret += test_xmlNodeDumpOutput(); - test_ret += test_xmlNodeGetBase(); - test_ret += test_xmlNodeGetContent(); - test_ret += test_xmlNodeGetLang(); - test_ret += test_xmlNodeGetSpacePreserve(); - test_ret += test_xmlNodeIsText(); - test_ret += test_xmlNodeListGetRawString(); - test_ret += test_xmlNodeListGetString(); - test_ret += test_xmlNodeSetBase(); - test_ret += test_xmlNodeSetContent(); - test_ret += test_xmlNodeSetContentLen(); - test_ret += test_xmlNodeSetLang(); - test_ret += test_xmlNodeSetName(); - test_ret += test_xmlNodeSetSpacePreserve(); - test_ret += test_xmlPreviousElementSibling(); - test_ret += test_xmlReconciliateNs(); - test_ret += test_xmlRemoveProp(); - test_ret += test_xmlReplaceNode(); - test_ret += test_xmlSaveFile(); - test_ret += test_xmlSaveFileEnc(); - test_ret += test_xmlSaveFileTo(); - test_ret += test_xmlSaveFormatFile(); - test_ret += test_xmlSaveFormatFileEnc(); - test_ret += test_xmlSaveFormatFileTo(); - test_ret += test_xmlSearchNs(); - test_ret += test_xmlSearchNsByHref(); - test_ret += test_xmlSetBufferAllocationScheme(); - test_ret += test_xmlSetCompressMode(); - test_ret += test_xmlSetDocCompressMode(); - test_ret += test_xmlSetNs(); - test_ret += test_xmlSetNsProp(); - test_ret += test_xmlSetProp(); - test_ret += test_xmlSplitQName2(); - test_ret += test_xmlSplitQName3(); - test_ret += test_xmlStringGetNodeList(); - test_ret += test_xmlStringLenGetNodeList(); - test_ret += test_xmlTextConcat(); - test_ret += test_xmlTextMerge(); - test_ret += test_xmlUnsetNsProp(); - test_ret += test_xmlUnsetProp(); - test_ret += test_xmlValidateNCName(); - test_ret += test_xmlValidateNMToken(); - test_ret += test_xmlValidateName(); - test_ret += test_xmlValidateQName(); - - if (test_ret != 0) - printf("Module tree: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlBuildRelativeURI(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * URI; /* the URI reference under consideration */ - int n_URI; - xmlChar * base; /* the base value */ - int n_base; - - for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { - for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { - mem_base = xmlMemBlocks(); - URI = gen_const_xmlChar_ptr(n_URI, 0); - base = gen_const_xmlChar_ptr(n_base, 1); - - ret_val = xmlBuildRelativeURI((const xmlChar *)URI, (const xmlChar *)base); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); - des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBuildRelativeURI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URI); - printf(" %d", n_base); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlBuildURI(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * URI; /* the URI instance found in the document */ - int n_URI; - xmlChar * base; /* the base value */ - int n_base; - - for (n_URI = 0;n_URI < gen_nb_const_xmlChar_ptr;n_URI++) { - for (n_base = 0;n_base < gen_nb_const_xmlChar_ptr;n_base++) { - mem_base = xmlMemBlocks(); - URI = gen_const_xmlChar_ptr(n_URI, 0); - base = gen_const_xmlChar_ptr(n_base, 1); - - ret_val = xmlBuildURI((const xmlChar *)URI, (const xmlChar *)base); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_URI, (const xmlChar *)URI, 0); - des_const_xmlChar_ptr(n_base, (const xmlChar *)base, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlBuildURI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URI); - printf(" %d", n_base); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCanonicPath(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * path; /* the resource locator in a filesystem notation */ - int n_path; - - for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { - mem_base = xmlMemBlocks(); - path = gen_const_xmlChar_ptr(n_path, 0); - - ret_val = xmlCanonicPath((const xmlChar *)path); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCanonicPath", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_path); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCreateURI(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlNormalizeURIPath(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - char * path; /* pointer to the path string */ - int n_path; - - for (n_path = 0;n_path < gen_nb_char_ptr;n_path++) { - mem_base = xmlMemBlocks(); - path = gen_char_ptr(n_path, 0); - - ret_val = xmlNormalizeURIPath(path); - desret_int(ret_val); - call_tests++; - des_char_ptr(n_path, path, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNormalizeURIPath", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_path); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParseURI(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlParseURIRaw(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -#define gen_nb_xmlURIPtr 1 -static xmlURIPtr gen_xmlURIPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlURIPtr(int no ATTRIBUTE_UNUSED, xmlURIPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlParseURIReference(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlURIPtr uri; /* pointer to an URI structure */ - int n_uri; - char * str; /* the string to analyze */ - int n_str; - - for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) { - for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { - mem_base = xmlMemBlocks(); - uri = gen_xmlURIPtr(n_uri, 0); - str = gen_const_char_ptr(n_str, 1); - - ret_val = xmlParseURIReference(uri, (const char *)str); - desret_int(ret_val); - call_tests++; - des_xmlURIPtr(n_uri, uri, 0); - des_const_char_ptr(n_str, (const char *)str, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParseURIReference", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_uri); - printf(" %d", n_str); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlPathToURI(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * path; /* the resource locator in a filesystem notation */ - int n_path; - - for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { - mem_base = xmlMemBlocks(); - path = gen_const_xmlChar_ptr(n_path, 0); - - ret_val = xmlPathToURI((const xmlChar *)path); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPathToURI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_path); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlPrintURI(void) { - int test_ret = 0; - - int mem_base; - FILE * stream; /* a FILE* for the output */ - int n_stream; - xmlURIPtr uri; /* pointer to an xmlURI */ - int n_uri; - - for (n_stream = 0;n_stream < gen_nb_FILE_ptr;n_stream++) { - for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) { - mem_base = xmlMemBlocks(); - stream = gen_FILE_ptr(n_stream, 0); - uri = gen_xmlURIPtr(n_uri, 1); - - xmlPrintURI(stream, uri); - call_tests++; - des_FILE_ptr(n_stream, stream, 0); - des_xmlURIPtr(n_uri, uri, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPrintURI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_stream); - printf(" %d", n_uri); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSaveUri(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlURIPtr uri; /* pointer to an xmlURI */ - int n_uri; - - for (n_uri = 0;n_uri < gen_nb_xmlURIPtr;n_uri++) { - mem_base = xmlMemBlocks(); - uri = gen_xmlURIPtr(n_uri, 0); - - ret_val = xmlSaveUri(uri); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlURIPtr(n_uri, uri, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveUri", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_uri); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlURIEscape(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * str; /* the string of the URI to escape */ - int n_str; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - - ret_val = xmlURIEscape((const xmlChar *)str); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlURIEscape", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlURIEscapeStr(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * str; /* string to escape */ - int n_str; - xmlChar * list; /* exception list string of chars not to escape */ - int n_list; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_list = 0;n_list < gen_nb_const_xmlChar_ptr;n_list++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - list = gen_const_xmlChar_ptr(n_list, 1); - - ret_val = xmlURIEscapeStr((const xmlChar *)str, (const xmlChar *)list); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - des_const_xmlChar_ptr(n_list, (const xmlChar *)list, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlURIEscapeStr", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf(" %d", n_list); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlURIUnescapeString(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -static int -test_uri(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing uri : 10 of 15 functions ...\n"); - test_ret += test_xmlBuildRelativeURI(); - test_ret += test_xmlBuildURI(); - test_ret += test_xmlCanonicPath(); - test_ret += test_xmlCreateURI(); - test_ret += test_xmlNormalizeURIPath(); - test_ret += test_xmlParseURI(); - test_ret += test_xmlParseURIRaw(); - test_ret += test_xmlParseURIReference(); - test_ret += test_xmlPathToURI(); - test_ret += test_xmlPrintURI(); - test_ret += test_xmlSaveUri(); - test_ret += test_xmlURIEscape(); - test_ret += test_xmlURIEscapeStr(); - test_ret += test_xmlURIUnescapeString(); - - if (test_ret != 0) - printf("Module uri: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlAddAttributeDecl(void) { - int test_ret = 0; - - int mem_base; - xmlAttributePtr ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDtdPtr dtd; /* pointer to the DTD */ - int n_dtd; - xmlChar * elem; /* the element name */ - int n_elem; - xmlChar * name; /* the attribute name */ - int n_name; - xmlChar * ns; /* the attribute namespace prefix */ - int n_ns; - xmlAttributeType type; /* the attribute type */ - int n_type; - xmlAttributeDefault def; /* the attribute default type */ - int n_def; - xmlChar * defaultValue; /* the attribute default value */ - int n_defaultValue; - xmlEnumerationPtr tree; /* if it's an enumeration, the associated list */ - int n_tree; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { - for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { - for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) { - for (n_def = 0;n_def < gen_nb_xmlAttributeDefault;n_def++) { - for (n_defaultValue = 0;n_defaultValue < gen_nb_const_xmlChar_ptr;n_defaultValue++) { - for (n_tree = 0;n_tree < gen_nb_xmlEnumerationPtr;n_tree++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - dtd = gen_xmlDtdPtr(n_dtd, 1); - elem = gen_const_xmlChar_ptr(n_elem, 2); - name = gen_const_xmlChar_ptr(n_name, 3); - ns = gen_const_xmlChar_ptr(n_ns, 4); - type = gen_xmlAttributeType(n_type, 5); - def = gen_xmlAttributeDefault(n_def, 6); - defaultValue = gen_const_xmlChar_ptr(n_defaultValue, 7); - tree = gen_xmlEnumerationPtr(n_tree, 8); - - ret_val = xmlAddAttributeDecl(ctxt, dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)ns, type, def, (const xmlChar *)defaultValue, tree); - desret_xmlAttributePtr(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDtdPtr(n_dtd, dtd, 1); - des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 2); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3); - des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 4); - des_xmlAttributeType(n_type, type, 5); - des_xmlAttributeDefault(n_def, def, 6); - des_const_xmlChar_ptr(n_defaultValue, (const xmlChar *)defaultValue, 7); - des_xmlEnumerationPtr(n_tree, tree, 8); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAddAttributeDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_dtd); - printf(" %d", n_elem); - printf(" %d", n_name); - printf(" %d", n_ns); - printf(" %d", n_type); - printf(" %d", n_def); - printf(" %d", n_defaultValue); - printf(" %d", n_tree); - printf("\n"); - } - } - } - } - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlAddElementDecl(void) { - int test_ret = 0; - - int mem_base; - xmlElementPtr ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDtdPtr dtd; /* pointer to the DTD */ - int n_dtd; - xmlChar * name; /* the entity name */ - int n_name; - xmlElementTypeVal type; /* the element type */ - int n_type; - xmlElementContentPtr content; /* the element content tree or NULL */ - int n_content; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_type = 0;n_type < gen_nb_xmlElementTypeVal;n_type++) { - for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - dtd = gen_xmlDtdPtr(n_dtd, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - type = gen_xmlElementTypeVal(n_type, 3); - content = gen_xmlElementContentPtr(n_content, 4); - - ret_val = xmlAddElementDecl(ctxt, dtd, (const xmlChar *)name, type, content); - desret_xmlElementPtr(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDtdPtr(n_dtd, dtd, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_xmlElementTypeVal(n_type, type, 3); - des_xmlElementContentPtr(n_content, content, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAddElementDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_dtd); - printf(" %d", n_name); - printf(" %d", n_type); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlAddID(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAddNotationDecl(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAddRef(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -#define gen_nb_xmlAttributeTablePtr 1 -static xmlAttributeTablePtr gen_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlAttributeTablePtr(int no ATTRIBUTE_UNUSED, xmlAttributeTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlCopyAttributeTable(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlCopyDocElementContent(void) { - int test_ret = 0; - - int mem_base; - xmlElementContentPtr ret_val; - xmlDocPtr doc; /* the document owning the element declaration */ - int n_doc; - xmlElementContentPtr cur; /* An element content pointer. */ - int n_cur; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - cur = gen_xmlElementContentPtr(n_cur, 1); - - ret_val = xmlCopyDocElementContent(doc, cur); - desret_xmlElementContentPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlElementContentPtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyDocElementContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCopyElementContent(void) { - int test_ret = 0; - - int mem_base; - xmlElementContentPtr ret_val; - xmlElementContentPtr cur; /* An element content pointer. */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_xmlElementContentPtr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlElementContentPtr(n_cur, 0); - - ret_val = xmlCopyElementContent(cur); - desret_xmlElementContentPtr(ret_val); - call_tests++; - des_xmlElementContentPtr(n_cur, cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyElementContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlElementTablePtr 1 -static xmlElementTablePtr gen_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlElementTablePtr(int no ATTRIBUTE_UNUSED, xmlElementTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlCopyElementTable(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlCopyEnumeration(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -#define gen_nb_xmlNotationTablePtr 1 -static xmlNotationTablePtr gen_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlNotationTablePtr(int no ATTRIBUTE_UNUSED, xmlNotationTablePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlCopyNotationTable(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlCreateEnumeration(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -#define gen_nb_xmlAttributePtr 1 -static xmlAttributePtr gen_xmlAttributePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlAttributePtr(int no ATTRIBUTE_UNUSED, xmlAttributePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlDumpAttributeDecl(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlBufferPtr buf; /* the XML buffer output */ - int n_buf; - xmlAttributePtr attr; /* An attribute declaration */ - int n_attr; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - attr = gen_xmlAttributePtr(n_attr, 1); - - xmlDumpAttributeDecl(buf, attr); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlAttributePtr(n_attr, attr, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDumpAttributeDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_attr); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDumpAttributeTable(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlBufferPtr buf; /* the XML buffer output */ - int n_buf; - xmlAttributeTablePtr table; /* An attribute table */ - int n_table; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_table = 0;n_table < gen_nb_xmlAttributeTablePtr;n_table++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - table = gen_xmlAttributeTablePtr(n_table, 1); - - xmlDumpAttributeTable(buf, table); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlAttributeTablePtr(n_table, table, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDumpAttributeTable", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_table); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -#define gen_nb_xmlElementPtr 1 -static xmlElementPtr gen_xmlElementPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlElementPtr(int no ATTRIBUTE_UNUSED, xmlElementPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlDumpElementDecl(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlBufferPtr buf; /* the XML buffer output */ - int n_buf; - xmlElementPtr elem; /* An element table */ - int n_elem; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - elem = gen_xmlElementPtr(n_elem, 1); - - xmlDumpElementDecl(buf, elem); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlElementPtr(n_elem, elem, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDumpElementDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_elem); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDumpElementTable(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlBufferPtr buf; /* the XML buffer output */ - int n_buf; - xmlElementTablePtr table; /* An element table */ - int n_table; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_table = 0;n_table < gen_nb_xmlElementTablePtr;n_table++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - table = gen_xmlElementTablePtr(n_table, 1); - - xmlDumpElementTable(buf, table); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlElementTablePtr(n_table, table, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDumpElementTable", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_table); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -#define gen_nb_xmlNotationPtr 1 -static xmlNotationPtr gen_xmlNotationPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlNotationPtr(int no ATTRIBUTE_UNUSED, xmlNotationPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlDumpNotationDecl(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlBufferPtr buf; /* the XML buffer output */ - int n_buf; - xmlNotationPtr nota; /* A notation declaration */ - int n_nota; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - nota = gen_xmlNotationPtr(n_nota, 1); - - xmlDumpNotationDecl(buf, nota); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlNotationPtr(n_nota, nota, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDumpNotationDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_nota); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlDumpNotationTable(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlBufferPtr buf; /* the XML buffer output */ - int n_buf; - xmlNotationTablePtr table; /* A notation table */ - int n_table; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_table = 0;n_table < gen_nb_xmlNotationTablePtr;n_table++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - table = gen_xmlNotationTablePtr(n_table, 1); - - xmlDumpNotationTable(buf, table); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlNotationTablePtr(n_table, table, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlDumpNotationTable", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_table); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlGetDtdAttrDesc(void) { - int test_ret = 0; - - int mem_base; - xmlAttributePtr ret_val; - xmlDtdPtr dtd; /* a pointer to the DtD to search */ - int n_dtd; - xmlChar * elem; /* the element name */ - int n_elem; - xmlChar * name; /* the attribute name */ - int n_name; - - for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { - for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - dtd = gen_xmlDtdPtr(n_dtd, 0); - elem = gen_const_xmlChar_ptr(n_elem, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - - ret_val = xmlGetDtdAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name); - desret_xmlAttributePtr(ret_val); - call_tests++; - des_xmlDtdPtr(n_dtd, dtd, 0); - des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetDtdAttrDesc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dtd); - printf(" %d", n_elem); - printf(" %d", n_name); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetDtdElementDesc(void) { - int test_ret = 0; - - int mem_base; - xmlElementPtr ret_val; - xmlDtdPtr dtd; /* a pointer to the DtD to search */ - int n_dtd; - xmlChar * name; /* the element name */ - int n_name; - - for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - dtd = gen_xmlDtdPtr(n_dtd, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlGetDtdElementDesc(dtd, (const xmlChar *)name); - desret_xmlElementPtr(ret_val); - call_tests++; - des_xmlDtdPtr(n_dtd, dtd, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetDtdElementDesc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dtd); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetDtdNotationDesc(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlGetDtdQAttrDesc(void) { - int test_ret = 0; - - int mem_base; - xmlAttributePtr ret_val; - xmlDtdPtr dtd; /* a pointer to the DtD to search */ - int n_dtd; - xmlChar * elem; /* the element name */ - int n_elem; - xmlChar * name; /* the attribute name */ - int n_name; - xmlChar * prefix; /* the attribute namespace prefix */ - int n_prefix; - - for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { - for (n_elem = 0;n_elem < gen_nb_const_xmlChar_ptr;n_elem++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - mem_base = xmlMemBlocks(); - dtd = gen_xmlDtdPtr(n_dtd, 0); - elem = gen_const_xmlChar_ptr(n_elem, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - prefix = gen_const_xmlChar_ptr(n_prefix, 3); - - ret_val = xmlGetDtdQAttrDesc(dtd, (const xmlChar *)elem, (const xmlChar *)name, (const xmlChar *)prefix); - desret_xmlAttributePtr(ret_val); - call_tests++; - des_xmlDtdPtr(n_dtd, dtd, 0); - des_const_xmlChar_ptr(n_elem, (const xmlChar *)elem, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetDtdQAttrDesc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dtd); - printf(" %d", n_elem); - printf(" %d", n_name); - printf(" %d", n_prefix); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetDtdQElementDesc(void) { - int test_ret = 0; - - int mem_base; - xmlElementPtr ret_val; - xmlDtdPtr dtd; /* a pointer to the DtD to search */ - int n_dtd; - xmlChar * name; /* the element name */ - int n_name; - xmlChar * prefix; /* the element namespace prefix */ - int n_prefix; - - for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - mem_base = xmlMemBlocks(); - dtd = gen_xmlDtdPtr(n_dtd, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - prefix = gen_const_xmlChar_ptr(n_prefix, 2); - - ret_val = xmlGetDtdQElementDesc(dtd, (const xmlChar *)name, (const xmlChar *)prefix); - desret_xmlElementPtr(ret_val); - call_tests++; - des_xmlDtdPtr(n_dtd, dtd, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetDtdQElementDesc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_dtd); - printf(" %d", n_name); - printf(" %d", n_prefix); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetID(void) { - int test_ret = 0; - - int mem_base; - xmlAttrPtr ret_val; - xmlDocPtr doc; /* pointer to the document */ - int n_doc; - xmlChar * ID; /* the ID value */ - int n_ID; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_ID = 0;n_ID < gen_nb_const_xmlChar_ptr;n_ID++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - ID = gen_const_xmlChar_ptr(n_ID, 1); - - ret_val = xmlGetID(doc, (const xmlChar *)ID); - desret_xmlAttrPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_ID, (const xmlChar *)ID, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetID", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_ID); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetRefs(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlIsID(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr elem; /* the element carrying the attribute */ - int n_elem; - xmlAttrPtr attr; /* the attribute */ - int n_attr; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - elem = gen_xmlNodePtr(n_elem, 1); - attr = gen_xmlAttrPtr(n_attr, 2); - - ret_val = xmlIsID(doc, elem, attr); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr(n_elem, elem, 1); - des_xmlAttrPtr(n_attr, attr, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsID", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_elem); - printf(" %d", n_attr); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsMixedElement(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * name; /* the element name */ - int n_name; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlIsMixedElement(doc, (const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsMixedElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIsRef(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr elem; /* the element carrying the attribute */ - int n_elem; - xmlAttrPtr attr; /* the attribute */ - int n_attr; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - elem = gen_xmlNodePtr(n_elem, 1); - attr = gen_xmlAttrPtr(n_attr, 2); - - ret_val = xmlIsRef(doc, elem, attr); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr(n_elem, elem, 1); - des_xmlAttrPtr(n_attr, attr, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIsRef", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_elem); - printf(" %d", n_attr); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewDocElementContent(void) { - int test_ret = 0; - - int mem_base; - xmlElementContentPtr ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * name; /* the subelement name or NULL */ - int n_name; - xmlElementContentType type; /* the type of element content decl */ - int n_type; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - type = gen_xmlElementContentType(n_type, 2); - - ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type); - xmlFreeDocElementContent(doc, ret_val); ret_val = NULL; - desret_xmlElementContentPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_xmlElementContentType(n_type, type, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewDocElementContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_name); - printf(" %d", n_type); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewElementContent(void) { - int test_ret = 0; - - int mem_base; - xmlElementContentPtr ret_val; - xmlChar * name; /* the subelement name or NULL */ - int n_name; - xmlElementContentType type; /* the type of element content decl */ - int n_type; - - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_type = 0;n_type < gen_nb_xmlElementContentType;n_type++) { - mem_base = xmlMemBlocks(); - name = gen_const_xmlChar_ptr(n_name, 0); - type = gen_xmlElementContentType(n_type, 1); - - ret_val = xmlNewElementContent((const xmlChar *)name, type); - desret_xmlElementContentPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); - des_xmlElementContentType(n_type, type, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewElementContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf(" %d", n_type); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNewValidCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlRemoveID(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlAttrPtr attr; /* the attribute */ - int n_attr; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - attr = gen_xmlAttrPtr(n_attr, 1); - - ret_val = xmlRemoveID(doc, attr); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlAttrPtr(n_attr, attr, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRemoveID", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_attr); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlRemoveRef(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlAttrPtr attr; /* the attribute */ - int n_attr; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - attr = gen_xmlAttrPtr(n_attr, 1); - - ret_val = xmlRemoveRef(doc, attr); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlAttrPtr(n_attr, attr, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRemoveRef", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_attr); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSnprintfElementContent(void) { - int test_ret = 0; - - int mem_base; - char * buf; /* an output buffer */ - int n_buf; - int size; /* the buffer size */ - int n_size; - xmlElementContentPtr content; /* An element table */ - int n_content; - int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */ - int n_englob; - - for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { - for (n_englob = 0;n_englob < gen_nb_int;n_englob++) { - mem_base = xmlMemBlocks(); - buf = gen_char_ptr(n_buf, 0); - size = gen_int(n_size, 1); - content = gen_xmlElementContentPtr(n_content, 2); - englob = gen_int(n_englob, 3); - - xmlSnprintfElementContent(buf, size, content, englob); - call_tests++; - des_char_ptr(n_buf, buf, 0); - des_int(n_size, size, 1); - des_xmlElementContentPtr(n_content, content, 2); - des_int(n_englob, englob, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSnprintfElementContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_size); - printf(" %d", n_content); - printf(" %d", n_englob); - printf("\n"); - } - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSprintfElementContent(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) -#ifdef LIBXML_OUTPUT_ENABLED - int mem_base; - char * buf; /* an output buffer */ - int n_buf; - xmlElementContentPtr content; /* An element table */ - int n_content; - int englob; /* 1 if one must print the englobing parenthesis, 0 otherwise */ - int n_englob; - - for (n_buf = 0;n_buf < gen_nb_char_ptr;n_buf++) { - for (n_content = 0;n_content < gen_nb_xmlElementContentPtr;n_content++) { - for (n_englob = 0;n_englob < gen_nb_int;n_englob++) { - mem_base = xmlMemBlocks(); - buf = gen_char_ptr(n_buf, 0); - content = gen_xmlElementContentPtr(n_content, 1); - englob = gen_int(n_englob, 2); - - xmlSprintfElementContent(buf, content, englob); - call_tests++; - des_char_ptr(n_buf, buf, 0); - des_xmlElementContentPtr(n_content, content, 1); - des_int(n_englob, englob, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSprintfElementContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_content); - printf(" %d", n_englob); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlValidBuildContentModel(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* a validation context */ - int n_ctxt; - xmlElementPtr elem; /* an element declaration node */ - int n_elem; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - elem = gen_xmlElementPtr(n_elem, 1); - - ret_val = xmlValidBuildContentModel(ctxt, elem); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlElementPtr(n_elem, elem, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidBuildContentModel", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_elem); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidCtxtNormalizeAttributeValue(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlValidCtxtPtr ctxt; /* the validation context or NULL */ - int n_ctxt; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr elem; /* the parent */ - int n_elem; - xmlChar * name; /* the attribute name */ - int n_name; - xmlChar * value; /* the attribute value */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlNodePtr(n_elem, 2); - name = gen_const_xmlChar_ptr(n_name, 3); - value = gen_const_xmlChar_ptr(n_value, 4); - - ret_val = xmlValidCtxtNormalizeAttributeValue(ctxt, doc, elem, (const xmlChar *)name, (const xmlChar *)value); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_elem, elem, 2); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidCtxtNormalizeAttributeValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -#define gen_nb_xmlElementContent_ptr 1 -static xmlElementContent * gen_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlElementContent_ptr(int no ATTRIBUTE_UNUSED, xmlElementContent * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlValidGetPotentialChildren(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) -#ifdef LIBXML_VALID_ENABLED - int mem_base; - int ret_val; - xmlElementContent * ctree; /* an element content tree */ - int n_ctree; - xmlChar ** names; /* an array to store the list of child names */ - int n_names; - int * len; /* a pointer to the number of element in the list */ - int n_len; - int max; /* the size of the array */ - int n_max; - - for (n_ctree = 0;n_ctree < gen_nb_xmlElementContent_ptr;n_ctree++) { - for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) { - for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { - for (n_max = 0;n_max < gen_nb_int;n_max++) { - mem_base = xmlMemBlocks(); - ctree = gen_xmlElementContent_ptr(n_ctree, 0); - names = gen_const_xmlChar_ptr_ptr(n_names, 1); - len = gen_int_ptr(n_len, 2); - max = gen_int(n_max, 3); - - ret_val = xmlValidGetPotentialChildren(ctree, (const xmlChar **)names, len, max); - desret_int(ret_val); - call_tests++; - des_xmlElementContent_ptr(n_ctree, ctree, 0); - des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 1); - des_int_ptr(n_len, len, 2); - des_int(n_max, max, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidGetPotentialChildren", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctree); - printf(" %d", n_names); - printf(" %d", n_len); - printf(" %d", n_max); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlValidGetValidElements(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) -#ifdef LIBXML_VALID_ENABLED - int mem_base; - int ret_val; - xmlNode * prev; /* an element to insert after */ - int n_prev; - xmlNode * next; /* an element to insert next */ - int n_next; - xmlChar ** names; /* an array to store the list of child names */ - int n_names; - int max; /* the size of the array */ - int n_max; - - for (n_prev = 0;n_prev < gen_nb_xmlNodePtr;n_prev++) { - for (n_next = 0;n_next < gen_nb_xmlNodePtr;n_next++) { - for (n_names = 0;n_names < gen_nb_const_xmlChar_ptr_ptr;n_names++) { - for (n_max = 0;n_max < gen_nb_int;n_max++) { - mem_base = xmlMemBlocks(); - prev = gen_xmlNodePtr(n_prev, 0); - next = gen_xmlNodePtr(n_next, 1); - names = gen_const_xmlChar_ptr_ptr(n_names, 2); - max = gen_int(n_max, 3); - - ret_val = xmlValidGetValidElements(prev, next, (const xmlChar **)names, max); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_prev, prev, 0); - des_xmlNodePtr(n_next, next, 1); - des_const_xmlChar_ptr_ptr(n_names, (const xmlChar **)names, 2); - des_int(n_max, max, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidGetValidElements", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_prev); - printf(" %d", n_next); - printf(" %d", n_names); - printf(" %d", n_max); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlValidNormalizeAttributeValue(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlNodePtr elem; /* the parent */ - int n_elem; - xmlChar * name; /* the attribute name */ - int n_name; - xmlChar * value; /* the attribute value */ - int n_value; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - elem = gen_xmlNodePtr(n_elem, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - value = gen_const_xmlChar_ptr(n_value, 3); - - ret_val = xmlValidNormalizeAttributeValue(doc, elem, (const xmlChar *)name, (const xmlChar *)value); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr(n_elem, elem, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidNormalizeAttributeValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_elem); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateAttributeDecl(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlAttributePtr attr; /* an attribute definition */ - int n_attr; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_attr = 0;n_attr < gen_nb_xmlAttributePtr;n_attr++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - attr = gen_xmlAttributePtr(n_attr, 2); - - ret_val = xmlValidateAttributeDecl(ctxt, doc, attr); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlAttributePtr(n_attr, attr, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateAttributeDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_attr); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateAttributeValue(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlAttributeType type; /* an attribute type */ - int n_type; - xmlChar * value; /* an attribute value */ - int n_value; - - for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - type = gen_xmlAttributeType(n_type, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - - ret_val = xmlValidateAttributeValue(type, (const xmlChar *)value); - desret_int(ret_val); - call_tests++; - des_xmlAttributeType(n_type, type, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateAttributeValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_type); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateDocument(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - ret_val = xmlValidateDocument(ctxt, doc); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateDocument", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateDocumentFinal(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - ret_val = xmlValidateDocumentFinal(ctxt, doc); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateDocumentFinal", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateDtd(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlDtdPtr dtd; /* a dtd instance */ - int n_dtd; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_dtd = 0;n_dtd < gen_nb_xmlDtdPtr;n_dtd++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - dtd = gen_xmlDtdPtr(n_dtd, 2); - - ret_val = xmlValidateDtd(ctxt, doc, dtd); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlDtdPtr(n_dtd, dtd, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateDtd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_dtd); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateDtdFinal(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - ret_val = xmlValidateDtdFinal(ctxt, doc); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateDtdFinal", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateElement(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlNodePtr elem; /* an element instance */ - int n_elem; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlNodePtr(n_elem, 2); - - ret_val = xmlValidateElement(ctxt, doc, elem); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_elem, elem, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateElementDecl(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlElementPtr elem; /* an element definition */ - int n_elem; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlElementPtr;n_elem++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlElementPtr(n_elem, 2); - - ret_val = xmlValidateElementDecl(ctxt, doc, elem); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlElementPtr(n_elem, elem, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateElementDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateNameValue(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlChar * value; /* an Name value */ - int n_value; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - value = gen_const_xmlChar_ptr(n_value, 0); - - ret_val = xmlValidateNameValue((const xmlChar *)value); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateNameValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateNamesValue(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlChar * value; /* an Names value */ - int n_value; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - value = gen_const_xmlChar_ptr(n_value, 0); - - ret_val = xmlValidateNamesValue((const xmlChar *)value); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateNamesValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateNmtokenValue(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlChar * value; /* an Nmtoken value */ - int n_value; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - value = gen_const_xmlChar_ptr(n_value, 0); - - ret_val = xmlValidateNmtokenValue((const xmlChar *)value); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateNmtokenValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateNmtokensValue(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlChar * value; /* an Nmtokens value */ - int n_value; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - value = gen_const_xmlChar_ptr(n_value, 0); - - ret_val = xmlValidateNmtokensValue((const xmlChar *)value); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateNmtokensValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateNotationDecl(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlNotationPtr nota; /* a notation definition */ - int n_nota; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_nota = 0;n_nota < gen_nb_xmlNotationPtr;n_nota++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - nota = gen_xmlNotationPtr(n_nota, 2); - - ret_val = xmlValidateNotationDecl(ctxt, doc, nota); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNotationPtr(n_nota, nota, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateNotationDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_nota); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateNotationUse(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* the document */ - int n_doc; - xmlChar * notationName; /* the notation name to check */ - int n_notationName; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_notationName = 0;n_notationName < gen_nb_const_xmlChar_ptr;n_notationName++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - notationName = gen_const_xmlChar_ptr(n_notationName, 2); - - ret_val = xmlValidateNotationUse(ctxt, doc, (const xmlChar *)notationName); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_const_xmlChar_ptr(n_notationName, (const xmlChar *)notationName, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateNotationUse", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_notationName); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateOneAttribute(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlNodePtr elem; /* an element instance */ - int n_elem; - xmlAttrPtr attr; /* an attribute instance */ - int n_attr; - xmlChar * value; /* the attribute value (without entities processing) */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - for (n_attr = 0;n_attr < gen_nb_xmlAttrPtr;n_attr++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlNodePtr(n_elem, 2); - attr = gen_xmlAttrPtr(n_attr, 3); - value = gen_const_xmlChar_ptr(n_value, 4); - - ret_val = xmlValidateOneAttribute(ctxt, doc, elem, attr, (const xmlChar *)value); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_elem, elem, 2); - des_xmlAttrPtr(n_attr, attr, 3); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateOneAttribute", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf(" %d", n_attr); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateOneElement(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlNodePtr elem; /* an element instance */ - int n_elem; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlNodePtr(n_elem, 2); - - ret_val = xmlValidateOneElement(ctxt, doc, elem); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_elem, elem, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateOneElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateOneNamespace(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlNodePtr elem; /* an element instance */ - int n_elem; - xmlChar * prefix; /* the namespace prefix */ - int n_prefix; - xmlNsPtr ns; /* an namespace declaration instance */ - int n_ns; - xmlChar * value; /* the attribute value (without entities processing) */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlNodePtr(n_elem, 2); - prefix = gen_const_xmlChar_ptr(n_prefix, 3); - ns = gen_xmlNsPtr(n_ns, 4); - value = gen_const_xmlChar_ptr(n_value, 5); - - ret_val = xmlValidateOneNamespace(ctxt, doc, elem, (const xmlChar *)prefix, ns, (const xmlChar *)value); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_elem, elem, 2); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 3); - des_xmlNsPtr(n_ns, ns, 4); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateOneNamespace", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf(" %d", n_prefix); - printf(" %d", n_ns); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidatePopElement(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlNodePtr elem; /* an element instance */ - int n_elem; - xmlChar * qname; /* the qualified name as appearing in the serialization */ - int n_qname; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlNodePtr(n_elem, 2); - qname = gen_const_xmlChar_ptr(n_qname, 3); - - ret_val = xmlValidatePopElement(ctxt, doc, elem, (const xmlChar *)qname); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_elem, elem, 2); - des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidatePopElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf(" %d", n_qname); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidatePushCData(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlChar * data; /* some character data read */ - int n_data; - int len; /* the lenght of the data */ - int n_len; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_data = 0;n_data < gen_nb_const_xmlChar_ptr;n_data++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - data = gen_const_xmlChar_ptr(n_data, 1); - len = gen_int(n_len, 2); - - ret_val = xmlValidatePushCData(ctxt, (const xmlChar *)data, len); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_data, (const xmlChar *)data, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidatePushCData", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_data); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidatePushElement(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) && defined(LIBXML_REGEXP_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - xmlNodePtr elem; /* an element instance */ - int n_elem; - xmlChar * qname; /* the qualified name as appearing in the serialization */ - int n_qname; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - for (n_qname = 0;n_qname < gen_nb_const_xmlChar_ptr;n_qname++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - elem = gen_xmlNodePtr(n_elem, 2); - qname = gen_const_xmlChar_ptr(n_qname, 3); - - ret_val = xmlValidatePushElement(ctxt, doc, elem, (const xmlChar *)qname); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - des_xmlNodePtr(n_elem, elem, 2); - des_const_xmlChar_ptr(n_qname, (const xmlChar *)qname, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidatePushElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf(" %d", n_elem); - printf(" %d", n_qname); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlValidateRoot(void) { - int test_ret = 0; - -#if defined(LIBXML_VALID_ENABLED) - int mem_base; - int ret_val; - xmlValidCtxtPtr ctxt; /* the validation context */ - int n_ctxt; - xmlDocPtr doc; /* a document instance */ - int n_doc; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - ret_val = xmlValidateRoot(ctxt, doc); - desret_int(ret_val); - call_tests++; - des_xmlValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlValidateRoot", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_valid(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing valid : 50 of 70 functions ...\n"); - test_ret += test_xmlAddAttributeDecl(); - test_ret += test_xmlAddElementDecl(); - test_ret += test_xmlAddID(); - test_ret += test_xmlAddNotationDecl(); - test_ret += test_xmlAddRef(); - test_ret += test_xmlCopyAttributeTable(); - test_ret += test_xmlCopyDocElementContent(); - test_ret += test_xmlCopyElementContent(); - test_ret += test_xmlCopyElementTable(); - test_ret += test_xmlCopyEnumeration(); - test_ret += test_xmlCopyNotationTable(); - test_ret += test_xmlCreateEnumeration(); - test_ret += test_xmlDumpAttributeDecl(); - test_ret += test_xmlDumpAttributeTable(); - test_ret += test_xmlDumpElementDecl(); - test_ret += test_xmlDumpElementTable(); - test_ret += test_xmlDumpNotationDecl(); - test_ret += test_xmlDumpNotationTable(); - test_ret += test_xmlGetDtdAttrDesc(); - test_ret += test_xmlGetDtdElementDesc(); - test_ret += test_xmlGetDtdNotationDesc(); - test_ret += test_xmlGetDtdQAttrDesc(); - test_ret += test_xmlGetDtdQElementDesc(); - test_ret += test_xmlGetID(); - test_ret += test_xmlGetRefs(); - test_ret += test_xmlIsID(); - test_ret += test_xmlIsMixedElement(); - test_ret += test_xmlIsRef(); - test_ret += test_xmlNewDocElementContent(); - test_ret += test_xmlNewElementContent(); - test_ret += test_xmlNewValidCtxt(); - test_ret += test_xmlRemoveID(); - test_ret += test_xmlRemoveRef(); - test_ret += test_xmlSnprintfElementContent(); - test_ret += test_xmlSprintfElementContent(); - test_ret += test_xmlValidBuildContentModel(); - test_ret += test_xmlValidCtxtNormalizeAttributeValue(); - test_ret += test_xmlValidGetPotentialChildren(); - test_ret += test_xmlValidGetValidElements(); - test_ret += test_xmlValidNormalizeAttributeValue(); - test_ret += test_xmlValidateAttributeDecl(); - test_ret += test_xmlValidateAttributeValue(); - test_ret += test_xmlValidateDocument(); - test_ret += test_xmlValidateDocumentFinal(); - test_ret += test_xmlValidateDtd(); - test_ret += test_xmlValidateDtdFinal(); - test_ret += test_xmlValidateElement(); - test_ret += test_xmlValidateElementDecl(); - test_ret += test_xmlValidateNameValue(); - test_ret += test_xmlValidateNamesValue(); - test_ret += test_xmlValidateNmtokenValue(); - test_ret += test_xmlValidateNmtokensValue(); - test_ret += test_xmlValidateNotationDecl(); - test_ret += test_xmlValidateNotationUse(); - test_ret += test_xmlValidateOneAttribute(); - test_ret += test_xmlValidateOneElement(); - test_ret += test_xmlValidateOneNamespace(); - test_ret += test_xmlValidatePopElement(); - test_ret += test_xmlValidatePushCData(); - test_ret += test_xmlValidatePushElement(); - test_ret += test_xmlValidateRoot(); - - if (test_ret != 0) - printf("Module valid: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlXIncludeNewContext(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXIncludeProcess(void) { - int test_ret = 0; - -#if defined(LIBXML_XINCLUDE_ENABLED) - int mem_base; - int ret_val; - xmlDocPtr doc; /* an XML document */ - int n_doc; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - - ret_val = xmlXIncludeProcess(doc); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXIncludeProcess", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXIncludeProcessFlags(void) { - int test_ret = 0; - -#if defined(LIBXML_XINCLUDE_ENABLED) - int mem_base; - int ret_val; - xmlDocPtr doc; /* an XML document */ - int n_doc; - int flags; /* a set of xmlParserOption used for parsing XML includes */ - int n_flags; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - flags = gen_int(n_flags, 1); - - ret_val = xmlXIncludeProcessFlags(doc, flags); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_int(n_flags, flags, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXIncludeProcessFlags", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_flags); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXIncludeProcessFlagsData(void) { - int test_ret = 0; - -#if defined(LIBXML_XINCLUDE_ENABLED) - int mem_base; - int ret_val; - xmlDocPtr doc; /* an XML document */ - int n_doc; - int flags; /* a set of xmlParserOption used for parsing XML includes */ - int n_flags; - void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */ - int n_data; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - flags = gen_int(n_flags, 1); - data = gen_userdata(n_data, 2); - - ret_val = xmlXIncludeProcessFlagsData(doc, flags, data); - desret_int(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_int(n_flags, flags, 1); - des_userdata(n_data, data, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXIncludeProcessFlagsData", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_flags); - printf(" %d", n_data); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_XINCLUDE_ENABLED - -#define gen_nb_xmlXIncludeCtxtPtr 1 -static xmlXIncludeCtxtPtr gen_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlXIncludeCtxtPtr(int no ATTRIBUTE_UNUSED, xmlXIncludeCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlXIncludeProcessNode(void) { - int test_ret = 0; - -#if defined(LIBXML_XINCLUDE_ENABLED) - int mem_base; - int ret_val; - xmlXIncludeCtxtPtr ctxt; /* an existing XInclude context */ - int n_ctxt; - xmlNodePtr node; /* a node in an XML document */ - int n_node; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0); - node = gen_xmlNodePtr(n_node, 1); - - ret_val = xmlXIncludeProcessNode(ctxt, node); - desret_int(ret_val); - call_tests++; - des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_node, node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXIncludeProcessNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXIncludeProcessTree(void) { - int test_ret = 0; - -#if defined(LIBXML_XINCLUDE_ENABLED) - int mem_base; - int ret_val; - xmlNodePtr tree; /* a node in an XML document */ - int n_tree; - - for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { - mem_base = xmlMemBlocks(); - tree = gen_xmlNodePtr(n_tree, 0); - - ret_val = xmlXIncludeProcessTree(tree); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_tree, tree, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXIncludeProcessTree", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_tree); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXIncludeProcessTreeFlags(void) { - int test_ret = 0; - -#if defined(LIBXML_XINCLUDE_ENABLED) - int mem_base; - int ret_val; - xmlNodePtr tree; /* a node in an XML document */ - int n_tree; - int flags; /* a set of xmlParserOption used for parsing XML includes */ - int n_flags; - - for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { - mem_base = xmlMemBlocks(); - tree = gen_xmlNodePtr(n_tree, 0); - flags = gen_int(n_flags, 1); - - ret_val = xmlXIncludeProcessTreeFlags(tree, flags); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_tree, tree, 0); - des_int(n_flags, flags, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlags", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_tree); - printf(" %d", n_flags); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXIncludeProcessTreeFlagsData(void) { - int test_ret = 0; - -#if defined(LIBXML_XINCLUDE_ENABLED) - int mem_base; - int ret_val; - xmlNodePtr tree; /* an XML node */ - int n_tree; - int flags; /* a set of xmlParserOption used for parsing XML includes */ - int n_flags; - void * data; /* application data that will be passed to the parser context in the _private field of the parser context(s) */ - int n_data; - - for (n_tree = 0;n_tree < gen_nb_xmlNodePtr;n_tree++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - tree = gen_xmlNodePtr(n_tree, 0); - flags = gen_int(n_flags, 1); - data = gen_userdata(n_data, 2); - - ret_val = xmlXIncludeProcessTreeFlagsData(tree, flags, data); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_tree, tree, 0); - des_int(n_flags, flags, 1); - des_userdata(n_data, data, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXIncludeProcessTreeFlagsData", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_tree); - printf(" %d", n_flags); - printf(" %d", n_data); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXIncludeSetFlags(void) { - int test_ret = 0; - -#if defined(LIBXML_XINCLUDE_ENABLED) - int mem_base; - int ret_val; - xmlXIncludeCtxtPtr ctxt; /* an XInclude processing context */ - int n_ctxt; - int flags; /* a set of xmlParserOption used for parsing XML includes */ - int n_flags; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXIncludeCtxtPtr;n_ctxt++) { - for (n_flags = 0;n_flags < gen_nb_int;n_flags++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXIncludeCtxtPtr(n_ctxt, 0); - flags = gen_int(n_flags, 1); - - ret_val = xmlXIncludeSetFlags(ctxt, flags); - desret_int(ret_val); - call_tests++; - des_xmlXIncludeCtxtPtr(n_ctxt, ctxt, 0); - des_int(n_flags, flags, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXIncludeSetFlags", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_flags); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xinclude(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xinclude : 8 of 10 functions ...\n"); - test_ret += test_xmlXIncludeNewContext(); - test_ret += test_xmlXIncludeProcess(); - test_ret += test_xmlXIncludeProcessFlags(); - test_ret += test_xmlXIncludeProcessFlagsData(); - test_ret += test_xmlXIncludeProcessNode(); - test_ret += test_xmlXIncludeProcessTree(); - test_ret += test_xmlXIncludeProcessTreeFlags(); - test_ret += test_xmlXIncludeProcessTreeFlagsData(); - test_ret += test_xmlXIncludeSetFlags(); - - if (test_ret != 0) - printf("Module xinclude: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlAllocOutputBuffer(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlOutputBufferPtr ret_val; - xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ - int n_encoder; - - for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { - mem_base = xmlMemBlocks(); - encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 0); - - ret_val = xmlAllocOutputBuffer(encoder); - desret_xmlOutputBufferPtr(ret_val); - call_tests++; - des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAllocOutputBuffer", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_encoder); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlAllocParserInputBuffer(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputBufferPtr ret_val; - xmlCharEncoding enc; /* the charset encoding if known */ - int n_enc; - - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - mem_base = xmlMemBlocks(); - enc = gen_xmlCharEncoding(n_enc, 0); - - ret_val = xmlAllocParserInputBuffer(enc); - desret_xmlParserInputBufferPtr(ret_val); - call_tests++; - des_xmlCharEncoding(n_enc, enc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAllocParserInputBuffer", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_enc); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCheckFilename(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - char * path; /* the path to check */ - int n_path; - - for (n_path = 0;n_path < gen_nb_const_char_ptr;n_path++) { - mem_base = xmlMemBlocks(); - path = gen_const_char_ptr(n_path, 0); - - ret_val = xmlCheckFilename((const char *)path); - desret_int(ret_val); - call_tests++; - des_const_char_ptr(n_path, (const char *)path, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCheckFilename", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_path); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCheckHTTPInput(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - xmlParserCtxtPtr ctxt; /* an XML parser context */ - int n_ctxt; - xmlParserInputPtr ret; /* an XML parser input */ - int n_ret; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_ret = 0;n_ret < gen_nb_xmlParserInputPtr;n_ret++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - ret = gen_xmlParserInputPtr(n_ret, 1); - - ret_val = xmlCheckHTTPInput(ctxt, ret); - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlParserInputPtr(n_ret, ret, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCheckHTTPInput", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_ret); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCleanupInputCallbacks(void) { - int test_ret = 0; - - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlCleanupInputCallbacks(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCleanupInputCallbacks", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCleanupOutputCallbacks(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlCleanupOutputCallbacks(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCleanupOutputCallbacks", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlFileClose(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - void * context; /* the I/O context */ - int n_context; - - for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { - mem_base = xmlMemBlocks(); - context = gen_void_ptr(n_context, 0); - - ret_val = xmlFileClose(context); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_context, context, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlFileClose", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_context); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlFileMatch(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - const char * filename; /* the URI for matching */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - - ret_val = xmlFileMatch(filename); - desret_int(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlFileMatch", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlFileOpen(void) { - int test_ret = 0; - - int mem_base; - void * ret_val; - const char * filename; /* the URI for matching */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - - ret_val = xmlFileOpen(filename); - desret_void_ptr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlFileOpen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlFileRead(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - void * context; /* the I/O context */ - int n_context; - char * buffer; /* where to drop data */ - int n_buffer; - int len; /* number of bytes to write */ - int n_len; - - for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { - for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - context = gen_void_ptr(n_context, 0); - buffer = gen_char_ptr(n_buffer, 1); - len = gen_int(n_len, 2); - - ret_val = xmlFileRead(context, buffer, len); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_context, context, 0); - des_char_ptr(n_buffer, buffer, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlFileRead", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_context); - printf(" %d", n_buffer); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlIOFTPClose(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - void * context; /* the I/O context */ - int n_context; - - for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { - mem_base = xmlMemBlocks(); - context = gen_void_ptr(n_context, 0); - - ret_val = xmlIOFTPClose(context); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_context, context, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIOFTPClose", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_context); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlIOFTPMatch(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - const char * filename; /* the URI for matching */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - - ret_val = xmlIOFTPMatch(filename); - desret_int(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIOFTPMatch", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlIOFTPOpen(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - void * ret_val; - const char * filename; /* the URI for matching */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - - ret_val = xmlIOFTPOpen(filename); - desret_void_ptr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIOFTPOpen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlIOFTPRead(void) { - int test_ret = 0; - -#if defined(LIBXML_FTP_ENABLED) - int mem_base; - int ret_val; - void * context; /* the I/O context */ - int n_context; - char * buffer; /* where to drop data */ - int n_buffer; - int len; /* number of bytes to write */ - int n_len; - - for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { - for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - context = gen_void_ptr(n_context, 0); - buffer = gen_char_ptr(n_buffer, 1); - len = gen_int(n_len, 2); - - ret_val = xmlIOFTPRead(context, buffer, len); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_context, context, 0); - des_char_ptr(n_buffer, buffer, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIOFTPRead", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_context); - printf(" %d", n_buffer); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlIOHTTPClose(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - int ret_val; - void * context; /* the I/O context */ - int n_context; - - for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { - mem_base = xmlMemBlocks(); - context = gen_void_ptr(n_context, 0); - - ret_val = xmlIOHTTPClose(context); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_context, context, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIOHTTPClose", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_context); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlIOHTTPMatch(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - int ret_val; - const char * filename; /* the URI for matching */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - - ret_val = xmlIOHTTPMatch(filename); - desret_int(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIOHTTPMatch", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlIOHTTPOpen(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - void * ret_val; - const char * filename; /* the URI for matching */ - int n_filename; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - - ret_val = xmlIOHTTPOpen(filename); - desret_xmlNanoHTTPCtxtPtr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIOHTTPOpen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlIOHTTPRead(void) { - int test_ret = 0; - -#if defined(LIBXML_HTTP_ENABLED) - int mem_base; - int ret_val; - void * context; /* the I/O context */ - int n_context; - char * buffer; /* where to drop data */ - int n_buffer; - int len; /* number of bytes to write */ - int n_len; - - for (n_context = 0;n_context < gen_nb_void_ptr;n_context++) { - for (n_buffer = 0;n_buffer < gen_nb_char_ptr;n_buffer++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - context = gen_void_ptr(n_context, 0); - buffer = gen_char_ptr(n_buffer, 1); - len = gen_int(n_len, 2); - - ret_val = xmlIOHTTPRead(context, buffer, len); - desret_int(ret_val); - call_tests++; - des_void_ptr(n_context, context, 0); - des_char_ptr(n_buffer, buffer, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlIOHTTPRead", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_context); - printf(" %d", n_buffer); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNoNetExternalEntityLoader(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr ret_val; - const char * URL; /* the URL for the entity to load */ - int n_URL; - char * ID; /* the System ID for the entity to load */ - int n_ID; - xmlParserCtxtPtr ctxt; /* the context in which the entity is called or NULL */ - int n_ctxt; - - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_ID = 0;n_ID < gen_nb_const_char_ptr;n_ID++) { - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - URL = gen_filepath(n_URL, 0); - ID = gen_const_char_ptr(n_ID, 1); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 2); - - ret_val = xmlNoNetExternalEntityLoader(URL, (const char *)ID, ctxt); - desret_xmlParserInputPtr(ret_val); - call_tests++; - des_filepath(n_URL, URL, 0); - des_const_char_ptr(n_ID, (const char *)ID, 1); - des_xmlParserCtxtPtr(n_ctxt, ctxt, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNoNetExternalEntityLoader", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf(" %d", n_ID); - printf(" %d", n_ctxt); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlNormalizeWindowsPath(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * path; /* the input file path */ - int n_path; - - for (n_path = 0;n_path < gen_nb_const_xmlChar_ptr;n_path++) { - mem_base = xmlMemBlocks(); - path = gen_const_xmlChar_ptr(n_path, 0); - - ret_val = xmlNormalizeWindowsPath((const xmlChar *)path); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_path, (const xmlChar *)path, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNormalizeWindowsPath", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_path); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlOutputBufferCreateBuffer(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlOutputBufferPtr ret_val; - xmlBufferPtr buffer; /* a xmlBufferPtr */ - int n_buffer; - xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ - int n_encoder; - - for (n_buffer = 0;n_buffer < gen_nb_xmlBufferPtr;n_buffer++) { - for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { - mem_base = xmlMemBlocks(); - buffer = gen_xmlBufferPtr(n_buffer, 0); - encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); - - ret_val = xmlOutputBufferCreateBuffer(buffer, encoder); - desret_xmlOutputBufferPtr(ret_val); - call_tests++; - des_xmlBufferPtr(n_buffer, buffer, 0); - des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlOutputBufferCreateBuffer", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_encoder); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlOutputBufferCreateFd(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlOutputBufferPtr ret_val; - int fd; /* a file descriptor number */ - int n_fd; - xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ - int n_encoder; - - for (n_fd = 0;n_fd < gen_nb_int;n_fd++) { - for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { - mem_base = xmlMemBlocks(); - fd = gen_int(n_fd, 0); - encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); - - ret_val = xmlOutputBufferCreateFd(fd, encoder); - desret_xmlOutputBufferPtr(ret_val); - call_tests++; - des_int(n_fd, fd, 0); - des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlOutputBufferCreateFd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_fd); - printf(" %d", n_encoder); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlOutputBufferCreateFile(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlOutputBufferPtr ret_val; - FILE * file; /* a FILE* */ - int n_file; - xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ - int n_encoder; - - for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) { - for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { - mem_base = xmlMemBlocks(); - file = gen_FILE_ptr(n_file, 0); - encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); - - ret_val = xmlOutputBufferCreateFile(file, encoder); - desret_xmlOutputBufferPtr(ret_val); - call_tests++; - des_FILE_ptr(n_file, file, 0); - des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlOutputBufferCreateFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_file); - printf(" %d", n_encoder); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlOutputBufferCreateFilename(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - xmlOutputBufferPtr ret_val; - const char * URI; /* a C string containing the URI or filename */ - int n_URI; - xmlCharEncodingHandlerPtr encoder; /* the encoding converter or NULL */ - int n_encoder; - int compression; /* the compression ration (0 none, 9 max). */ - int n_compression; - - for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) { - for (n_encoder = 0;n_encoder < gen_nb_xmlCharEncodingHandlerPtr;n_encoder++) { - for (n_compression = 0;n_compression < gen_nb_int;n_compression++) { - mem_base = xmlMemBlocks(); - URI = gen_fileoutput(n_URI, 0); - encoder = gen_xmlCharEncodingHandlerPtr(n_encoder, 1); - compression = gen_int(n_compression, 2); - - ret_val = xmlOutputBufferCreateFilename(URI, encoder, compression); - desret_xmlOutputBufferPtr(ret_val); - call_tests++; - des_fileoutput(n_URI, URI, 0); - des_xmlCharEncodingHandlerPtr(n_encoder, encoder, 1); - des_int(n_compression, compression, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlOutputBufferCreateFilename", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URI); - printf(" %d", n_encoder); - printf(" %d", n_compression); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlOutputBufferFlush(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlOutputBufferPtr out; /* a buffered output */ - int n_out; - - for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { - mem_base = xmlMemBlocks(); - out = gen_xmlOutputBufferPtr(n_out, 0); - - ret_val = xmlOutputBufferFlush(out); - desret_int(ret_val); - call_tests++; - des_xmlOutputBufferPtr(n_out, out, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlOutputBufferFlush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlOutputBufferGetContent(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */ - int n_out; - - for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { - mem_base = xmlMemBlocks(); - out = gen_xmlOutputBufferPtr(n_out, 0); - - ret_val = xmlOutputBufferGetContent(out); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlOutputBufferPtr(n_out, out, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlOutputBufferGetContent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlOutputBufferGetSize(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlOutputBufferWrite(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlOutputBufferPtr out; /* a buffered parser output */ - int n_out; - int len; /* the size in bytes of the array. */ - int n_len; - char * buf; /* an char array */ - int n_buf; - - for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) { - mem_base = xmlMemBlocks(); - out = gen_xmlOutputBufferPtr(n_out, 0); - len = gen_int(n_len, 1); - buf = gen_const_char_ptr(n_buf, 2); - - ret_val = xmlOutputBufferWrite(out, len, (const char *)buf); - desret_int(ret_val); - call_tests++; - des_xmlOutputBufferPtr(n_out, out, 0); - des_int(n_len, len, 1); - des_const_char_ptr(n_buf, (const char *)buf, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlOutputBufferWrite", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_len); - printf(" %d", n_buf); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlOutputBufferWriteEscape(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlOutputBufferWriteString(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlOutputBufferPtr out; /* a buffered parser output */ - int n_out; - char * str; /* a zero terminated C string */ - int n_str; - - for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { - for (n_str = 0;n_str < gen_nb_const_char_ptr;n_str++) { - mem_base = xmlMemBlocks(); - out = gen_xmlOutputBufferPtr(n_out, 0); - str = gen_const_char_ptr(n_str, 1); - - ret_val = xmlOutputBufferWriteString(out, (const char *)str); - desret_int(ret_val); - call_tests++; - des_xmlOutputBufferPtr(n_out, out, 0); - des_const_char_ptr(n_str, (const char *)str, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlOutputBufferWriteString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf(" %d", n_str); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlParserGetDirectory(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlParserInputBufferCreateFd(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputBufferPtr ret_val; - int fd; /* a file descriptor number */ - int n_fd; - xmlCharEncoding enc; /* the charset encoding if known */ - int n_enc; - - for (n_fd = 0;n_fd < gen_nb_int;n_fd++) { - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - mem_base = xmlMemBlocks(); - fd = gen_int(n_fd, 0); - enc = gen_xmlCharEncoding(n_enc, 1); - if (fd >= 0) fd = -1; - - ret_val = xmlParserInputBufferCreateFd(fd, enc); - desret_xmlParserInputBufferPtr(ret_val); - call_tests++; - des_int(n_fd, fd, 0); - des_xmlCharEncoding(n_enc, enc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputBufferCreateFd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_fd); - printf(" %d", n_enc); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserInputBufferCreateFile(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputBufferPtr ret_val; - FILE * file; /* a FILE* */ - int n_file; - xmlCharEncoding enc; /* the charset encoding if known */ - int n_enc; - - for (n_file = 0;n_file < gen_nb_FILE_ptr;n_file++) { - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - mem_base = xmlMemBlocks(); - file = gen_FILE_ptr(n_file, 0); - enc = gen_xmlCharEncoding(n_enc, 1); - - ret_val = xmlParserInputBufferCreateFile(file, enc); - desret_xmlParserInputBufferPtr(ret_val); - call_tests++; - des_FILE_ptr(n_file, file, 0); - des_xmlCharEncoding(n_enc, enc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputBufferCreateFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_file); - printf(" %d", n_enc); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserInputBufferCreateFilename(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputBufferPtr ret_val; - const char * URI; /* a C string containing the URI or filename */ - int n_URI; - xmlCharEncoding enc; /* the charset encoding if known */ - int n_enc; - - for (n_URI = 0;n_URI < gen_nb_fileoutput;n_URI++) { - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - mem_base = xmlMemBlocks(); - URI = gen_fileoutput(n_URI, 0); - enc = gen_xmlCharEncoding(n_enc, 1); - - ret_val = xmlParserInputBufferCreateFilename(URI, enc); - desret_xmlParserInputBufferPtr(ret_val); - call_tests++; - des_fileoutput(n_URI, URI, 0); - des_xmlCharEncoding(n_enc, enc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputBufferCreateFilename", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URI); - printf(" %d", n_enc); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserInputBufferCreateMem(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputBufferPtr ret_val; - char * mem; /* the memory input */ - int n_mem; - int size; /* the length of the memory block */ - int n_size; - xmlCharEncoding enc; /* the charset encoding if known */ - int n_enc; - - for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - mem_base = xmlMemBlocks(); - mem = gen_const_char_ptr(n_mem, 0); - size = gen_int(n_size, 1); - enc = gen_xmlCharEncoding(n_enc, 2); - - ret_val = xmlParserInputBufferCreateMem((const char *)mem, size, enc); - desret_xmlParserInputBufferPtr(ret_val); - call_tests++; - des_const_char_ptr(n_mem, (const char *)mem, 0); - des_int(n_size, size, 1); - des_xmlCharEncoding(n_enc, enc, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputBufferCreateMem", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_mem); - printf(" %d", n_size); - printf(" %d", n_enc); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserInputBufferCreateStatic(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputBufferPtr ret_val; - char * mem; /* the memory input */ - int n_mem; - int size; /* the length of the memory block */ - int n_size; - xmlCharEncoding enc; /* the charset encoding if known */ - int n_enc; - - for (n_mem = 0;n_mem < gen_nb_const_char_ptr;n_mem++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - mem_base = xmlMemBlocks(); - mem = gen_const_char_ptr(n_mem, 0); - size = gen_int(n_size, 1); - enc = gen_xmlCharEncoding(n_enc, 2); - - ret_val = xmlParserInputBufferCreateStatic((const char *)mem, size, enc); - desret_xmlParserInputBufferPtr(ret_val); - call_tests++; - des_const_char_ptr(n_mem, (const char *)mem, 0); - des_int(n_size, size, 1); - des_xmlCharEncoding(n_enc, enc, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputBufferCreateStatic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_mem); - printf(" %d", n_size); - printf(" %d", n_enc); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserInputBufferGrow(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserInputBufferPtr in; /* a buffered parser input */ - int n_in; - int len; /* indicative value of the amount of chars to read */ - int n_len; - - for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - in = gen_xmlParserInputBufferPtr(n_in, 0); - len = gen_int(n_len, 1); - - ret_val = xmlParserInputBufferGrow(in, len); - desret_int(ret_val); - call_tests++; - des_xmlParserInputBufferPtr(n_in, in, 0); - des_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputBufferGrow", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_in); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserInputBufferPush(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserInputBufferPtr in; /* a buffered parser input */ - int n_in; - int len; /* the size in bytes of the array. */ - int n_len; - char * buf; /* an char array */ - int n_buf; - - for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - for (n_buf = 0;n_buf < gen_nb_const_char_ptr;n_buf++) { - mem_base = xmlMemBlocks(); - in = gen_xmlParserInputBufferPtr(n_in, 0); - len = gen_int(n_len, 1); - buf = gen_const_char_ptr(n_buf, 2); - - ret_val = xmlParserInputBufferPush(in, len, (const char *)buf); - desret_int(ret_val); - call_tests++; - des_xmlParserInputBufferPtr(n_in, in, 0); - des_int(n_len, len, 1); - des_const_char_ptr(n_buf, (const char *)buf, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputBufferPush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_in); - printf(" %d", n_len); - printf(" %d", n_buf); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserInputBufferRead(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlParserInputBufferPtr in; /* a buffered parser input */ - int n_in; - int len; /* indicative value of the amount of chars to read */ - int n_len; - - for (n_in = 0;n_in < gen_nb_xmlParserInputBufferPtr;n_in++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - in = gen_xmlParserInputBufferPtr(n_in, 0); - len = gen_int(n_len, 1); - - ret_val = xmlParserInputBufferRead(in, len); - desret_int(ret_val); - call_tests++; - des_xmlParserInputBufferPtr(n_in, in, 0); - des_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserInputBufferRead", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_in); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlPopInputCallbacks(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - - mem_base = xmlMemBlocks(); - - ret_val = xmlPopInputCallbacks(); - desret_int(ret_val); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlPopInputCallbacks", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlRegisterDefaultInputCallbacks(void) { - int test_ret = 0; - - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlRegisterDefaultInputCallbacks(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegisterDefaultInputCallbacks", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlRegisterDefaultOutputCallbacks(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlRegisterDefaultOutputCallbacks(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegisterDefaultOutputCallbacks", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRegisterHTTPPostCallbacks(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTTP_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlRegisterHTTPPostCallbacks(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegisterHTTPPostCallbacks", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xmlIO(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n"); - test_ret += test_xmlAllocOutputBuffer(); - test_ret += test_xmlAllocParserInputBuffer(); - test_ret += test_xmlCheckFilename(); - test_ret += test_xmlCheckHTTPInput(); - test_ret += test_xmlCleanupInputCallbacks(); - test_ret += test_xmlCleanupOutputCallbacks(); - test_ret += test_xmlFileClose(); - test_ret += test_xmlFileMatch(); - test_ret += test_xmlFileOpen(); - test_ret += test_xmlFileRead(); - test_ret += test_xmlIOFTPClose(); - test_ret += test_xmlIOFTPMatch(); - test_ret += test_xmlIOFTPOpen(); - test_ret += test_xmlIOFTPRead(); - test_ret += test_xmlIOHTTPClose(); - test_ret += test_xmlIOHTTPMatch(); - test_ret += test_xmlIOHTTPOpen(); - test_ret += test_xmlIOHTTPRead(); - test_ret += test_xmlNoNetExternalEntityLoader(); - test_ret += test_xmlNormalizeWindowsPath(); - test_ret += test_xmlOutputBufferCreateBuffer(); - test_ret += test_xmlOutputBufferCreateFd(); - test_ret += test_xmlOutputBufferCreateFile(); - test_ret += test_xmlOutputBufferCreateFilename(); - test_ret += test_xmlOutputBufferFlush(); - test_ret += test_xmlOutputBufferGetContent(); - test_ret += test_xmlOutputBufferGetSize(); - test_ret += test_xmlOutputBufferWrite(); - test_ret += test_xmlOutputBufferWriteEscape(); - test_ret += test_xmlOutputBufferWriteString(); - test_ret += test_xmlParserGetDirectory(); - test_ret += test_xmlParserInputBufferCreateFd(); - test_ret += test_xmlParserInputBufferCreateFile(); - test_ret += test_xmlParserInputBufferCreateFilename(); - test_ret += test_xmlParserInputBufferCreateMem(); - test_ret += test_xmlParserInputBufferCreateStatic(); - test_ret += test_xmlParserInputBufferGrow(); - test_ret += test_xmlParserInputBufferPush(); - test_ret += test_xmlParserInputBufferRead(); - test_ret += test_xmlPopInputCallbacks(); - test_ret += test_xmlRegisterDefaultInputCallbacks(); - test_ret += test_xmlRegisterDefaultOutputCallbacks(); - test_ret += test_xmlRegisterHTTPPostCallbacks(); - - if (test_ret != 0) - printf("Module xmlIO: %d errors\n", test_ret); - return(test_ret); -} -#ifdef LIBXML_AUTOMATA_ENABLED - -#define gen_nb_xmlAutomataPtr 1 -static xmlAutomataPtr gen_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlAutomataPtr(int no ATTRIBUTE_UNUSED, xmlAutomataPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlAutomataCompile(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataGetInitState(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataIsDeterminist(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) - int mem_base; - int ret_val; - xmlAutomataPtr am; /* an automata */ - int n_am; - - for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) { - mem_base = xmlMemBlocks(); - am = gen_xmlAutomataPtr(n_am, 0); - - ret_val = xmlAutomataIsDeterminist(am); - desret_int(ret_val); - call_tests++; - des_xmlAutomataPtr(n_am, am, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAutomataIsDeterminist", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_am); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_AUTOMATA_ENABLED - -#define gen_nb_xmlAutomataStatePtr 1 -static xmlAutomataStatePtr gen_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlAutomataStatePtr(int no ATTRIBUTE_UNUSED, xmlAutomataStatePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlAutomataNewAllTrans(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewCountTrans(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewCountTrans2(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewCountedTrans(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewCounter(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) - int mem_base; - int ret_val; - xmlAutomataPtr am; /* an automata */ - int n_am; - int min; /* the minimal value on the counter */ - int n_min; - int max; /* the maximal value on the counter */ - int n_max; - - for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) { - for (n_min = 0;n_min < gen_nb_int;n_min++) { - for (n_max = 0;n_max < gen_nb_int;n_max++) { - mem_base = xmlMemBlocks(); - am = gen_xmlAutomataPtr(n_am, 0); - min = gen_int(n_min, 1); - max = gen_int(n_max, 2); - - ret_val = xmlAutomataNewCounter(am, min, max); - desret_int(ret_val); - call_tests++; - des_xmlAutomataPtr(n_am, am, 0); - des_int(n_min, min, 1); - des_int(n_max, max, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAutomataNewCounter", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_am); - printf(" %d", n_min); - printf(" %d", n_max); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlAutomataNewCounterTrans(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewEpsilon(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewNegTrans(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewOnceTrans(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewOnceTrans2(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewState(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewTransition(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataNewTransition2(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlAutomataSetFinalState(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_AUTOMATA_ENABLED) - int mem_base; - int ret_val; - xmlAutomataPtr am; /* an automata */ - int n_am; - xmlAutomataStatePtr state; /* a state in this automata */ - int n_state; - - for (n_am = 0;n_am < gen_nb_xmlAutomataPtr;n_am++) { - for (n_state = 0;n_state < gen_nb_xmlAutomataStatePtr;n_state++) { - mem_base = xmlMemBlocks(); - am = gen_xmlAutomataPtr(n_am, 0); - state = gen_xmlAutomataStatePtr(n_state, 1); - - ret_val = xmlAutomataSetFinalState(am, state); - desret_int(ret_val); - call_tests++; - des_xmlAutomataPtr(n_am, am, 0); - des_xmlAutomataStatePtr(n_state, state, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlAutomataSetFinalState", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_am); - printf(" %d", n_state); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNewAutomata(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -static int -test_xmlautomata(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlautomata : 3 of 19 functions ...\n"); - test_ret += test_xmlAutomataCompile(); - test_ret += test_xmlAutomataGetInitState(); - test_ret += test_xmlAutomataIsDeterminist(); - test_ret += test_xmlAutomataNewAllTrans(); - test_ret += test_xmlAutomataNewCountTrans(); - test_ret += test_xmlAutomataNewCountTrans2(); - test_ret += test_xmlAutomataNewCountedTrans(); - test_ret += test_xmlAutomataNewCounter(); - test_ret += test_xmlAutomataNewCounterTrans(); - test_ret += test_xmlAutomataNewEpsilon(); - test_ret += test_xmlAutomataNewNegTrans(); - test_ret += test_xmlAutomataNewOnceTrans(); - test_ret += test_xmlAutomataNewOnceTrans2(); - test_ret += test_xmlAutomataNewState(); - test_ret += test_xmlAutomataNewTransition(); - test_ret += test_xmlAutomataNewTransition2(); - test_ret += test_xmlAutomataSetFinalState(); - test_ret += test_xmlNewAutomata(); - - if (test_ret != 0) - printf("Module xmlautomata: %d errors\n", test_ret); - return(test_ret); -} - -#define gen_nb_xmlGenericErrorFunc_ptr 1 -static xmlGenericErrorFunc * gen_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlGenericErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlGenericErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_initGenericErrorDefaultFunc(void) { - int test_ret = 0; - - int mem_base; - xmlGenericErrorFunc * handler; /* the handler */ - int n_handler; - - for (n_handler = 0;n_handler < gen_nb_xmlGenericErrorFunc_ptr;n_handler++) { - mem_base = xmlMemBlocks(); - handler = gen_xmlGenericErrorFunc_ptr(n_handler, 0); - - initGenericErrorDefaultFunc(handler); - call_tests++; - des_xmlGenericErrorFunc_ptr(n_handler, handler, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in initGenericErrorDefaultFunc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_handler); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -#define gen_nb_xmlErrorPtr 1 -static xmlErrorPtr gen_xmlErrorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlErrorPtr(int no ATTRIBUTE_UNUSED, xmlErrorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} - -static int -test_xmlCopyError(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlErrorPtr from; /* a source error */ - int n_from; - xmlErrorPtr to; /* a target error */ - int n_to; - - for (n_from = 0;n_from < gen_nb_xmlErrorPtr;n_from++) { - for (n_to = 0;n_to < gen_nb_xmlErrorPtr;n_to++) { - mem_base = xmlMemBlocks(); - from = gen_xmlErrorPtr(n_from, 0); - to = gen_xmlErrorPtr(n_to, 1); - - ret_val = xmlCopyError(from, to); - desret_int(ret_val); - call_tests++; - des_xmlErrorPtr(n_from, from, 0); - des_xmlErrorPtr(n_to, to, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCopyError", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_from); - printf(" %d", n_to); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCtxtGetLastError(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlCtxtResetLastError(void) { - int test_ret = 0; - - int mem_base; - void * ctx; /* an XML parser context */ - int n_ctx; - - for (n_ctx = 0;n_ctx < gen_nb_void_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctx = gen_void_ptr(n_ctx, 0); - - xmlCtxtResetLastError(ctx); - call_tests++; - des_void_ptr(n_ctx, ctx, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCtxtResetLastError", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctx); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetLastError(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlParserError(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlParserPrintFileContext(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr input; /* an xmlParserInputPtr input */ - int n_input; - - for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { - mem_base = xmlMemBlocks(); - input = gen_xmlParserInputPtr(n_input, 0); - - xmlParserPrintFileContext(input); - call_tests++; - des_xmlParserInputPtr(n_input, input, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserPrintFileContext", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_input); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserPrintFileInfo(void) { - int test_ret = 0; - - int mem_base; - xmlParserInputPtr input; /* an xmlParserInputPtr input */ - int n_input; - - for (n_input = 0;n_input < gen_nb_xmlParserInputPtr;n_input++) { - mem_base = xmlMemBlocks(); - input = gen_xmlParserInputPtr(n_input, 0); - - xmlParserPrintFileInfo(input); - call_tests++; - des_xmlParserInputPtr(n_input, input, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlParserPrintFileInfo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_input); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlParserValidityError(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlParserValidityWarning(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlParserWarning(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlResetError(void) { - int test_ret = 0; - - int mem_base; - xmlErrorPtr err; /* pointer to the error. */ - int n_err; - - for (n_err = 0;n_err < gen_nb_xmlErrorPtr;n_err++) { - mem_base = xmlMemBlocks(); - err = gen_xmlErrorPtr(n_err, 0); - - xmlResetError(err); - call_tests++; - des_xmlErrorPtr(n_err, err, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlResetError", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_err); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlResetLastError(void) { - int test_ret = 0; - - - - xmlResetLastError(); - call_tests++; - xmlResetLastError(); - function_tests++; - - return(test_ret); -} - - -static int -test_xmlSetGenericErrorFunc(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSetStructuredErrorFunc(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -static int -test_xmlerror(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlerror : 7 of 15 functions ...\n"); - test_ret += test_initGenericErrorDefaultFunc(); - test_ret += test_xmlCopyError(); - test_ret += test_xmlCtxtGetLastError(); - test_ret += test_xmlCtxtResetLastError(); - test_ret += test_xmlGetLastError(); - test_ret += test_xmlParserError(); - test_ret += test_xmlParserPrintFileContext(); - test_ret += test_xmlParserPrintFileInfo(); - test_ret += test_xmlParserValidityError(); - test_ret += test_xmlParserValidityWarning(); - test_ret += test_xmlParserWarning(); - test_ret += test_xmlResetError(); - test_ret += test_xmlResetLastError(); - test_ret += test_xmlSetGenericErrorFunc(); - test_ret += test_xmlSetStructuredErrorFunc(); - - if (test_ret != 0) - printf("Module xmlerror: %d errors\n", test_ret); - return(test_ret); -} -#ifdef LIBXML_MODULES_ENABLED - -#define gen_nb_xmlModulePtr 1 -static xmlModulePtr gen_xmlModulePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlModulePtr(int no ATTRIBUTE_UNUSED, xmlModulePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlModuleClose(void) { - int test_ret = 0; - -#if defined(LIBXML_MODULES_ENABLED) - int mem_base; - int ret_val; - xmlModulePtr module; /* the module handle */ - int n_module; - - for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) { - mem_base = xmlMemBlocks(); - module = gen_xmlModulePtr(n_module, 0); - - ret_val = xmlModuleClose(module); - desret_int(ret_val); - call_tests++; - des_xmlModulePtr(n_module, module, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlModuleClose", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_module); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlModuleOpen(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlModuleSymbol(void) { - int test_ret = 0; - -#if defined(LIBXML_MODULES_ENABLED) - int mem_base; - int ret_val; - xmlModulePtr module; /* the module */ - int n_module; - char * name; /* the name of the symbol */ - int n_name; - void ** symbol; /* the resulting symbol address */ - int n_symbol; - - for (n_module = 0;n_module < gen_nb_xmlModulePtr;n_module++) { - for (n_name = 0;n_name < gen_nb_const_char_ptr;n_name++) { - for (n_symbol = 0;n_symbol < gen_nb_void_ptr_ptr;n_symbol++) { - mem_base = xmlMemBlocks(); - module = gen_xmlModulePtr(n_module, 0); - name = gen_const_char_ptr(n_name, 1); - symbol = gen_void_ptr_ptr(n_symbol, 2); - - ret_val = xmlModuleSymbol(module, (const char *)name, symbol); - desret_int(ret_val); - call_tests++; - des_xmlModulePtr(n_module, module, 0); - des_const_char_ptr(n_name, (const char *)name, 1); - des_void_ptr_ptr(n_symbol, symbol, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlModuleSymbol", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_module); - printf(" %d", n_name); - printf(" %d", n_symbol); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xmlmodule(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlmodule : 2 of 4 functions ...\n"); - test_ret += test_xmlModuleClose(); - test_ret += test_xmlModuleOpen(); - test_ret += test_xmlModuleSymbol(); - - if (test_ret != 0) - printf("Module xmlmodule: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlNewTextReader(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlTextReaderPtr ret_val; - xmlParserInputBufferPtr input; /* the xmlParserInputBufferPtr used to read data */ - int n_input; - const char * URI; /* the URI information for the source if available */ - int n_URI; - - for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { - for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) { - mem_base = xmlMemBlocks(); - input = gen_xmlParserInputBufferPtr(n_input, 0); - URI = gen_filepath(n_URI, 1); - - ret_val = xmlNewTextReader(input, URI); - desret_xmlTextReaderPtr(ret_val); - call_tests++; - des_xmlParserInputBufferPtr(n_input, input, 0); - des_filepath(n_URI, URI, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewTextReader", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_input); - printf(" %d", n_URI); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNewTextReaderFilename(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlTextReaderPtr ret_val; - const char * URI; /* the URI of the resource to process */ - int n_URI; - - for (n_URI = 0;n_URI < gen_nb_filepath;n_URI++) { - mem_base = xmlMemBlocks(); - URI = gen_filepath(n_URI, 0); - - ret_val = xmlNewTextReaderFilename(URI); - desret_xmlTextReaderPtr(ret_val); - call_tests++; - des_filepath(n_URI, URI, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewTextReaderFilename", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URI); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlReaderForDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlTextReaderPtr ret_val; - xmlChar * cur; /* a pointer to a zero terminated string */ - int n_cur; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - cur = gen_const_xmlChar_ptr(n_cur, 0); - URL = gen_filepath(n_URL, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - options = gen_parseroptions(n_options, 3); - - ret_val = xmlReaderForDoc((const xmlChar *)cur, URL, (const char *)encoding, options); - desret_xmlTextReaderPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); - des_filepath(n_URL, URL, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_parseroptions(n_options, options, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReaderForDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlReaderForFile(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlTextReaderPtr ret_val; - const char * filename; /* a file or URL */ - int n_filename; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - filename = gen_filepath(n_filename, 0); - encoding = gen_const_char_ptr(n_encoding, 1); - options = gen_parseroptions(n_options, 2); - - ret_val = xmlReaderForFile(filename, (const char *)encoding, options); - desret_xmlTextReaderPtr(ret_val); - call_tests++; - des_filepath(n_filename, filename, 0); - des_const_char_ptr(n_encoding, (const char *)encoding, 1); - des_parseroptions(n_options, options, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReaderForFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_filename); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlReaderForMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlTextReaderPtr ret_val; - char * buffer; /* a pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - buffer = gen_const_char_ptr(n_buffer, 0); - size = gen_int(n_size, 1); - URL = gen_filepath(n_URL, 2); - encoding = gen_const_char_ptr(n_encoding, 3); - options = gen_parseroptions(n_options, 4); - - ret_val = xmlReaderForMemory((const char *)buffer, size, URL, (const char *)encoding, options); - desret_xmlTextReaderPtr(ret_val); - call_tests++; - des_const_char_ptr(n_buffer, (const char *)buffer, 0); - des_int(n_size, size, 1); - des_filepath(n_URL, URL, 2); - des_const_char_ptr(n_encoding, (const char *)encoding, 3); - des_parseroptions(n_options, options, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReaderForMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_size); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlReaderNewDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* an XML reader */ - int n_reader; - xmlChar * cur; /* a pointer to a zero terminated string */ - int n_cur; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - cur = gen_const_xmlChar_ptr(n_cur, 1); - URL = gen_filepath(n_URL, 2); - encoding = gen_const_char_ptr(n_encoding, 3); - options = gen_parseroptions(n_options, 4); - - ret_val = xmlReaderNewDoc(reader, (const xmlChar *)cur, URL, (const char *)encoding, options); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 1); - des_filepath(n_URL, URL, 2); - des_const_char_ptr(n_encoding, (const char *)encoding, 3); - des_parseroptions(n_options, options, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReaderNewDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_cur); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlReaderNewFile(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* an XML reader */ - int n_reader; - const char * filename; /* a file or URL */ - int n_filename; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - filename = gen_filepath(n_filename, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - options = gen_parseroptions(n_options, 3); - - ret_val = xmlReaderNewFile(reader, filename, (const char *)encoding, options); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_filepath(n_filename, filename, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_parseroptions(n_options, options, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReaderNewFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_filename); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlReaderNewMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* an XML reader */ - int n_reader; - char * buffer; /* a pointer to a char array */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - buffer = gen_const_char_ptr(n_buffer, 1); - size = gen_int(n_size, 2); - URL = gen_filepath(n_URL, 3); - encoding = gen_const_char_ptr(n_encoding, 4); - options = gen_parseroptions(n_options, 5); - - ret_val = xmlReaderNewMemory(reader, (const char *)buffer, size, URL, (const char *)encoding, options); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_char_ptr(n_buffer, (const char *)buffer, 1); - des_int(n_size, size, 2); - des_filepath(n_URL, URL, 3); - des_const_char_ptr(n_encoding, (const char *)encoding, 4); - des_parseroptions(n_options, options, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReaderNewMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_buffer); - printf(" %d", n_size); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlReaderNewWalker(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* an XML reader */ - int n_reader; - xmlDocPtr doc; /* a preparsed document */ - int n_doc; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - ret_val = xmlReaderNewWalker(reader, doc); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReaderNewWalker", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlReaderWalker(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlTextReaderPtr ret_val; - xmlDocPtr doc; /* a preparsed document */ - int n_doc; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - - ret_val = xmlReaderWalker(doc); - desret_xmlTextReaderPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlReaderWalker", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderAttributeCount(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderAttributeCount(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderAttributeCount", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderBaseUri(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderBaseUri(reader); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderBaseUri", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderByteConsumed(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - long ret_val; - xmlTextReaderPtr reader; /* an XML reader */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderByteConsumed(reader); - desret_long(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderByteConsumed", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderClose(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderClose(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderClose", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderConstBaseUri(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderConstBaseUri(reader); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderConstBaseUri", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderConstEncoding(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderConstEncoding(reader); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderConstEncoding", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderConstLocalName(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderConstLocalName(reader); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderConstLocalName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderConstName(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderConstName(reader); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderConstName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderConstNamespaceUri(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderConstNamespaceUri(reader); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderConstNamespaceUri", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderConstPrefix(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderConstPrefix(reader); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderConstPrefix", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderConstString(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlChar * str; /* the string to intern. */ - int n_str; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - str = gen_const_xmlChar_ptr(n_str, 1); - - ret_val = xmlTextReaderConstString(reader, (const xmlChar *)str); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderConstString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_str); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderConstValue(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderConstValue(reader); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderConstValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderConstXmlLang(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderConstXmlLang(reader); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderConstXmlLang", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderConstXmlVersion(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderConstXmlVersion(reader); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderConstXmlVersion", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderCurrentDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlDocPtr ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderCurrentDoc(reader); - desret_xmlDocPtr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderCurrentDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderCurrentNode(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderCurrentNode(reader); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderCurrentNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderDepth(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderDepth(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderDepth", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderExpand(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderExpand(reader); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderExpand", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderGetAttribute(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlChar * name; /* the qualified name of the attribute. */ - int n_name; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlTextReaderGetAttribute(reader, (const xmlChar *)name); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderGetAttribute", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderGetAttributeNo(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - int no; /* the zero-based index of the attribute relative to the containing element */ - int n_no; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_no = 0;n_no < gen_nb_int;n_no++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - no = gen_int(n_no, 1); - - ret_val = xmlTextReaderGetAttributeNo(reader, no); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_int(n_no, no, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderGetAttributeNo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_no); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderGetAttributeNs(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlChar * localName; /* the local name of the attribute. */ - int n_localName; - xmlChar * namespaceURI; /* the namespace URI of the attribute. */ - int n_namespaceURI; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) { - for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - localName = gen_const_xmlChar_ptr(n_localName, 1); - namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2); - - ret_val = xmlTextReaderGetAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1); - des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderGetAttributeNs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_localName); - printf(" %d", n_namespaceURI); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_READER_ENABLED - -#define gen_nb_xmlTextReaderErrorFunc_ptr 1 -static xmlTextReaderErrorFunc * gen_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlTextReaderErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlTextReaderErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlTextReaderGetErrorHandler(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlTextReaderErrorFunc * f; /* the callback function or NULL is no callback has been registered */ - int n_f; - void ** arg; /* a user argument */ - int n_arg; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_f = 0;n_f < gen_nb_xmlTextReaderErrorFunc_ptr;n_f++) { - for (n_arg = 0;n_arg < gen_nb_void_ptr_ptr;n_arg++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - f = gen_xmlTextReaderErrorFunc_ptr(n_f, 1); - arg = gen_void_ptr_ptr(n_arg, 2); - - xmlTextReaderGetErrorHandler(reader, f, arg); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_xmlTextReaderErrorFunc_ptr(n_f, f, 1); - des_void_ptr_ptr(n_arg, arg, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderGetErrorHandler", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_f); - printf(" %d", n_arg); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderGetParserColumnNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the user data (XML reader context) */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderGetParserColumnNumber(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderGetParserColumnNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderGetParserLineNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the user data (XML reader context) */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderGetParserLineNumber(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderGetParserLineNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderGetParserProp(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - int prop; /* the xmlParserProperties to get */ - int n_prop; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_prop = 0;n_prop < gen_nb_int;n_prop++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - prop = gen_int(n_prop, 1); - - ret_val = xmlTextReaderGetParserProp(reader, prop); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_int(n_prop, prop, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderGetParserProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_prop); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderGetRemainder(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlParserInputBufferPtr ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderGetRemainder(reader); - desret_xmlParserInputBufferPtr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderGetRemainder", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderHasAttributes(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderHasAttributes(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderHasAttributes", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderHasValue(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderHasValue(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderHasValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderIsDefault(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderIsDefault(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderIsDefault", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderIsEmptyElement(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderIsEmptyElement(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderIsEmptyElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderIsNamespaceDecl(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderIsNamespaceDecl(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderIsNamespaceDecl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderIsValid(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderIsValid(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderIsValid", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderLocalName(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderLocalName(reader); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderLocalName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_READER_ENABLED - -#define gen_nb_xmlTextReaderLocatorPtr 1 -static xmlTextReaderLocatorPtr gen_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlTextReaderLocatorPtr(int no ATTRIBUTE_UNUSED, xmlTextReaderLocatorPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlTextReaderLocatorBaseURI(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */ - int n_locator; - - for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) { - mem_base = xmlMemBlocks(); - locator = gen_xmlTextReaderLocatorPtr(n_locator, 0); - - ret_val = xmlTextReaderLocatorBaseURI(locator); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderLocatorPtr(n_locator, locator, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderLocatorBaseURI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_locator); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderLocatorLineNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderLocatorPtr locator; /* the xmlTextReaderLocatorPtr used */ - int n_locator; - - for (n_locator = 0;n_locator < gen_nb_xmlTextReaderLocatorPtr;n_locator++) { - mem_base = xmlMemBlocks(); - locator = gen_xmlTextReaderLocatorPtr(n_locator, 0); - - ret_val = xmlTextReaderLocatorLineNumber(locator); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderLocatorPtr(n_locator, locator, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderLocatorLineNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_locator); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderLookupNamespace(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlChar * prefix; /* the prefix whose namespace URI is to be resolved. To return the default namespace, specify NULL */ - int n_prefix; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - - ret_val = xmlTextReaderLookupNamespace(reader, (const xmlChar *)prefix); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderLookupNamespace", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_prefix); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderMoveToAttribute(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlChar * name; /* the qualified name of the attribute. */ - int n_name; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlTextReaderMoveToAttribute(reader, (const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderMoveToAttribute", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderMoveToAttributeNo(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - int no; /* the zero-based index of the attribute relative to the containing element. */ - int n_no; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_no = 0;n_no < gen_nb_int;n_no++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - no = gen_int(n_no, 1); - - ret_val = xmlTextReaderMoveToAttributeNo(reader, no); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_int(n_no, no, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_no); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderMoveToAttributeNs(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlChar * localName; /* the local name of the attribute. */ - int n_localName; - xmlChar * namespaceURI; /* the namespace URI of the attribute. */ - int n_namespaceURI; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_localName = 0;n_localName < gen_nb_const_xmlChar_ptr;n_localName++) { - for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - localName = gen_const_xmlChar_ptr(n_localName, 1); - namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 2); - - ret_val = xmlTextReaderMoveToAttributeNs(reader, (const xmlChar *)localName, (const xmlChar *)namespaceURI); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_xmlChar_ptr(n_localName, (const xmlChar *)localName, 1); - des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderMoveToAttributeNs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_localName); - printf(" %d", n_namespaceURI); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderMoveToElement(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderMoveToElement(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderMoveToElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderMoveToFirstAttribute(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderMoveToFirstAttribute(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderMoveToFirstAttribute", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderMoveToNextAttribute(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderMoveToNextAttribute(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderMoveToNextAttribute", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderName(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderName(reader); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderNamespaceUri(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderNamespaceUri(reader); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderNamespaceUri", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderNext(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderNext(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderNext", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderNextSibling(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderNextSibling(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderNextSibling", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderNodeType(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderNodeType(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderNodeType", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderNormalization(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderNormalization(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderNormalization", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderPrefix(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderPrefix(reader); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderPrefix", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderPreserve(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderPreserve(reader); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderPreserve", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderPreservePattern(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED) -#ifdef LIBXML_PATTERN_ENABLED - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlChar * pattern; /* an XPath subset pattern */ - int n_pattern; - xmlChar ** namespaces; /* the prefix definitions, array of [URI, prefix] or NULL */ - int n_namespaces; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_pattern = 0;n_pattern < gen_nb_const_xmlChar_ptr;n_pattern++) { - for (n_namespaces = 0;n_namespaces < gen_nb_const_xmlChar_ptr_ptr;n_namespaces++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - pattern = gen_const_xmlChar_ptr(n_pattern, 1); - namespaces = gen_const_xmlChar_ptr_ptr(n_namespaces, 2); - - ret_val = xmlTextReaderPreservePattern(reader, (const xmlChar *)pattern, (const xmlChar **)namespaces); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_xmlChar_ptr(n_pattern, (const xmlChar *)pattern, 1); - des_const_xmlChar_ptr_ptr(n_namespaces, (const xmlChar **)namespaces, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderPreservePattern", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_pattern); - printf(" %d", n_namespaces); - printf("\n"); - } - } - } - } - function_tests++; -#endif -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderQuoteChar(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderQuoteChar(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderQuoteChar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderRead(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderRead(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderRead", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderReadAttributeValue(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderReadAttributeValue(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderReadAttributeValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderReadState(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderReadState(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderReadState", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderRelaxNGSetSchema(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlRelaxNGPtr schema; /* a precompiled RelaxNG schema */ - int n_schema; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_schema = 0;n_schema < gen_nb_xmlRelaxNGPtr;n_schema++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - schema = gen_xmlRelaxNGPtr(n_schema, 1); - - ret_val = xmlTextReaderRelaxNGSetSchema(reader, schema); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_xmlRelaxNGPtr(n_schema, schema, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderRelaxNGSetSchema", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_schema); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderRelaxNGValidate(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - char * rng; /* the path to a RelaxNG schema or NULL */ - int n_rng; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_rng = 0;n_rng < gen_nb_const_char_ptr;n_rng++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - rng = gen_const_char_ptr(n_rng, 1); - - ret_val = xmlTextReaderRelaxNGValidate(reader, (const char *)rng); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_char_ptr(n_rng, (const char *)rng, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidate", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_rng); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderRelaxNGValidateCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlRelaxNGValidCtxtPtr ctxt; /* the RelaxNG schema validation context or NULL */ - int n_ctxt; - int options; /* options (not used yet) */ - int n_options; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_ctxt = 0;n_ctxt < gen_nb_xmlRelaxNGValidCtxtPtr;n_ctxt++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - ctxt = gen_xmlRelaxNGValidCtxtPtr(n_ctxt, 1); - options = gen_parseroptions(n_options, 2); - - ret_val = xmlTextReaderRelaxNGValidateCtxt(reader, ctxt, options); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_xmlRelaxNGValidCtxtPtr(n_ctxt, ctxt, 1); - des_parseroptions(n_options, options, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderRelaxNGValidateCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_ctxt); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderSchemaValidate(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - char * xsd; /* the path to a W3C XSD schema or NULL */ - int n_xsd; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_xsd = 0;n_xsd < gen_nb_const_char_ptr;n_xsd++) { - reader = gen_xmlTextReaderPtr(n_reader, 0); - xsd = gen_const_char_ptr(n_xsd, 1); - - ret_val = xmlTextReaderSchemaValidate(reader, (const char *)xsd); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_const_char_ptr(n_xsd, (const char *)xsd, 1); - xmlResetLastError(); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderSchemaValidateCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlSchemaValidCtxtPtr ctxt; /* the XML Schema validation context or NULL */ - int n_ctxt; - int options; /* options (not used yet) */ - int n_options; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 1); - options = gen_parseroptions(n_options, 2); - - ret_val = xmlTextReaderSchemaValidateCtxt(reader, ctxt, options); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 1); - des_parseroptions(n_options, options, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderSchemaValidateCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_ctxt); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderSetErrorHandler(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextReaderSetParserProp(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - int prop; /* the xmlParserProperties to set */ - int n_prop; - int value; /* usually 0 or 1 to (de)activate it */ - int n_value; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_prop = 0;n_prop < gen_nb_int;n_prop++) { - for (n_value = 0;n_value < gen_nb_int;n_value++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - prop = gen_int(n_prop, 1); - value = gen_int(n_value, 2); - - ret_val = xmlTextReaderSetParserProp(reader, prop, value); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_int(n_prop, prop, 1); - des_int(n_value, value, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderSetParserProp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_prop); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderSetSchema(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - xmlSchemaPtr schema; /* a precompiled Schema schema */ - int n_schema; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - schema = gen_xmlSchemaPtr(n_schema, 1); - - ret_val = xmlTextReaderSetSchema(reader, schema); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_xmlSchemaPtr(n_schema, schema, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderSetSchema", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_schema); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderSetStructuredErrorHandler(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextReaderSetup(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* an XML reader */ - int n_reader; - xmlParserInputBufferPtr input; /* xmlParserInputBufferPtr used to feed the reader, will be destroyed with it. */ - int n_input; - const char * URL; /* the base URL to use for the document */ - int n_URL; - char * encoding; /* the document encoding, or NULL */ - int n_encoding; - int options; /* a combination of xmlParserOption */ - int n_options; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { - for (n_URL = 0;n_URL < gen_nb_filepath;n_URL++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_options = 0;n_options < gen_nb_parseroptions;n_options++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - input = gen_xmlParserInputBufferPtr(n_input, 1); - URL = gen_filepath(n_URL, 2); - encoding = gen_const_char_ptr(n_encoding, 3); - options = gen_parseroptions(n_options, 4); - - ret_val = xmlTextReaderSetup(reader, input, URL, (const char *)encoding, options); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - des_filepath(n_URL, URL, 2); - des_const_char_ptr(n_encoding, (const char *)encoding, 3); - des_parseroptions(n_options, options, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderSetup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf(" %d", n_input); - printf(" %d", n_URL); - printf(" %d", n_encoding); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderStandalone(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - int ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderStandalone(reader); - desret_int(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderStandalone", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderValue(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderValue(reader); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextReaderXmlLang(void) { - int test_ret = 0; - -#if defined(LIBXML_READER_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlTextReaderPtr reader; /* the xmlTextReaderPtr used */ - int n_reader; - - for (n_reader = 0;n_reader < gen_nb_xmlTextReaderPtr;n_reader++) { - mem_base = xmlMemBlocks(); - reader = gen_xmlTextReaderPtr(n_reader, 0); - - ret_val = xmlTextReaderXmlLang(reader); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlTextReaderPtr(n_reader, reader, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextReaderXmlLang", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_reader); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xmlreader(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlreader : 76 of 86 functions ...\n"); - test_ret += test_xmlNewTextReader(); - test_ret += test_xmlNewTextReaderFilename(); - test_ret += test_xmlReaderForDoc(); - test_ret += test_xmlReaderForFile(); - test_ret += test_xmlReaderForMemory(); - test_ret += test_xmlReaderNewDoc(); - test_ret += test_xmlReaderNewFile(); - test_ret += test_xmlReaderNewMemory(); - test_ret += test_xmlReaderNewWalker(); - test_ret += test_xmlReaderWalker(); - test_ret += test_xmlTextReaderAttributeCount(); - test_ret += test_xmlTextReaderBaseUri(); - test_ret += test_xmlTextReaderByteConsumed(); - test_ret += test_xmlTextReaderClose(); - test_ret += test_xmlTextReaderConstBaseUri(); - test_ret += test_xmlTextReaderConstEncoding(); - test_ret += test_xmlTextReaderConstLocalName(); - test_ret += test_xmlTextReaderConstName(); - test_ret += test_xmlTextReaderConstNamespaceUri(); - test_ret += test_xmlTextReaderConstPrefix(); - test_ret += test_xmlTextReaderConstString(); - test_ret += test_xmlTextReaderConstValue(); - test_ret += test_xmlTextReaderConstXmlLang(); - test_ret += test_xmlTextReaderConstXmlVersion(); - test_ret += test_xmlTextReaderCurrentDoc(); - test_ret += test_xmlTextReaderCurrentNode(); - test_ret += test_xmlTextReaderDepth(); - test_ret += test_xmlTextReaderExpand(); - test_ret += test_xmlTextReaderGetAttribute(); - test_ret += test_xmlTextReaderGetAttributeNo(); - test_ret += test_xmlTextReaderGetAttributeNs(); - test_ret += test_xmlTextReaderGetErrorHandler(); - test_ret += test_xmlTextReaderGetParserColumnNumber(); - test_ret += test_xmlTextReaderGetParserLineNumber(); - test_ret += test_xmlTextReaderGetParserProp(); - test_ret += test_xmlTextReaderGetRemainder(); - test_ret += test_xmlTextReaderHasAttributes(); - test_ret += test_xmlTextReaderHasValue(); - test_ret += test_xmlTextReaderIsDefault(); - test_ret += test_xmlTextReaderIsEmptyElement(); - test_ret += test_xmlTextReaderIsNamespaceDecl(); - test_ret += test_xmlTextReaderIsValid(); - test_ret += test_xmlTextReaderLocalName(); - test_ret += test_xmlTextReaderLocatorBaseURI(); - test_ret += test_xmlTextReaderLocatorLineNumber(); - test_ret += test_xmlTextReaderLookupNamespace(); - test_ret += test_xmlTextReaderMoveToAttribute(); - test_ret += test_xmlTextReaderMoveToAttributeNo(); - test_ret += test_xmlTextReaderMoveToAttributeNs(); - test_ret += test_xmlTextReaderMoveToElement(); - test_ret += test_xmlTextReaderMoveToFirstAttribute(); - test_ret += test_xmlTextReaderMoveToNextAttribute(); - test_ret += test_xmlTextReaderName(); - test_ret += test_xmlTextReaderNamespaceUri(); - test_ret += test_xmlTextReaderNext(); - test_ret += test_xmlTextReaderNextSibling(); - test_ret += test_xmlTextReaderNodeType(); - test_ret += test_xmlTextReaderNormalization(); - test_ret += test_xmlTextReaderPrefix(); - test_ret += test_xmlTextReaderPreserve(); - test_ret += test_xmlTextReaderPreservePattern(); - test_ret += test_xmlTextReaderQuoteChar(); - test_ret += test_xmlTextReaderRead(); - test_ret += test_xmlTextReaderReadAttributeValue(); - test_ret += test_xmlTextReaderReadState(); - test_ret += test_xmlTextReaderRelaxNGSetSchema(); - test_ret += test_xmlTextReaderRelaxNGValidate(); - test_ret += test_xmlTextReaderRelaxNGValidateCtxt(); - test_ret += test_xmlTextReaderSchemaValidate(); - test_ret += test_xmlTextReaderSchemaValidateCtxt(); - test_ret += test_xmlTextReaderSetErrorHandler(); - test_ret += test_xmlTextReaderSetParserProp(); - test_ret += test_xmlTextReaderSetSchema(); - test_ret += test_xmlTextReaderSetStructuredErrorHandler(); - test_ret += test_xmlTextReaderSetup(); - test_ret += test_xmlTextReaderStandalone(); - test_ret += test_xmlTextReaderValue(); - test_ret += test_xmlTextReaderXmlLang(); - - if (test_ret != 0) - printf("Module xmlreader: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlExpCtxtNbCons(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) - int mem_base; - int ret_val; - xmlExpCtxtPtr ctxt; /* an expression context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); - - ret_val = xmlExpCtxtNbCons(ctxt); - desret_int(ret_val); - call_tests++; - des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlExpCtxtNbCons", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlExpCtxtNbNodes(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) - int mem_base; - int ret_val; - xmlExpCtxtPtr ctxt; /* an expression context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); - - ret_val = xmlExpCtxtNbNodes(ctxt); - desret_int(ret_val); - call_tests++; - des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlExpCtxtNbNodes", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlExpDump(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) - int mem_base; - xmlBufferPtr buf; /* a buffer to receive the output */ - int n_buf; - xmlExpNodePtr expr; /* the compiled expression */ - int n_expr; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - expr = gen_xmlExpNodePtr(n_expr, 1); - - xmlExpDump(buf, expr); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_xmlExpNodePtr(n_expr, expr, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlExpDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_expr); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlExpExpDerive(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlExpGetLanguage(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) - int mem_base; - int ret_val; - xmlExpCtxtPtr ctxt; /* the expression context */ - int n_ctxt; - xmlExpNodePtr exp; /* the expression */ - int n_exp; - xmlChar ** langList; /* where to store the tokens */ - int n_langList; - int len; /* the allocated lenght of @list */ - int n_len; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { - for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { - for (n_langList = 0;n_langList < gen_nb_const_xmlChar_ptr_ptr;n_langList++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); - exp = gen_xmlExpNodePtr(n_exp, 1); - langList = gen_const_xmlChar_ptr_ptr(n_langList, 2); - len = gen_int(n_len, 3); - - ret_val = xmlExpGetLanguage(ctxt, exp, (const xmlChar **)langList, len); - desret_int(ret_val); - call_tests++; - des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); - des_xmlExpNodePtr(n_exp, exp, 1); - des_const_xmlChar_ptr_ptr(n_langList, (const xmlChar **)langList, 2); - des_int(n_len, len, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlExpGetLanguage", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_exp); - printf(" %d", n_langList); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlExpGetStart(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) - int mem_base; - int ret_val; - xmlExpCtxtPtr ctxt; /* the expression context */ - int n_ctxt; - xmlExpNodePtr exp; /* the expression */ - int n_exp; - xmlChar ** tokList; /* where to store the tokens */ - int n_tokList; - int len; /* the allocated lenght of @list */ - int n_len; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { - for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { - for (n_tokList = 0;n_tokList < gen_nb_const_xmlChar_ptr_ptr;n_tokList++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); - exp = gen_xmlExpNodePtr(n_exp, 1); - tokList = gen_const_xmlChar_ptr_ptr(n_tokList, 2); - len = gen_int(n_len, 3); - - ret_val = xmlExpGetStart(ctxt, exp, (const xmlChar **)tokList, len); - desret_int(ret_val); - call_tests++; - des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); - des_xmlExpNodePtr(n_exp, exp, 1); - des_const_xmlChar_ptr_ptr(n_tokList, (const xmlChar **)tokList, 2); - des_int(n_len, len, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlExpGetStart", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_exp); - printf(" %d", n_tokList); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlExpIsNillable(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) - int mem_base; - int ret_val; - xmlExpNodePtr exp; /* the expression */ - int n_exp; - - for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { - mem_base = xmlMemBlocks(); - exp = gen_xmlExpNodePtr(n_exp, 0); - - ret_val = xmlExpIsNillable(exp); - desret_int(ret_val); - call_tests++; - des_xmlExpNodePtr(n_exp, exp, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlExpIsNillable", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_exp); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlExpMaxToken(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) - int mem_base; - int ret_val; - xmlExpNodePtr expr; /* a compiled expression */ - int n_expr; - - for (n_expr = 0;n_expr < gen_nb_xmlExpNodePtr;n_expr++) { - mem_base = xmlMemBlocks(); - expr = gen_xmlExpNodePtr(n_expr, 0); - - ret_val = xmlExpMaxToken(expr); - desret_int(ret_val); - call_tests++; - des_xmlExpNodePtr(n_expr, expr, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlExpMaxToken", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_expr); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlExpNewAtom(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlExpNewCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlExpNewOr(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlExpNewRange(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlExpNewSeq(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlExpParse(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlExpRef(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) - int mem_base; - xmlExpNodePtr exp; /* the expression */ - int n_exp; - - for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { - mem_base = xmlMemBlocks(); - exp = gen_xmlExpNodePtr(n_exp, 0); - - xmlExpRef(exp); - call_tests++; - des_xmlExpNodePtr(n_exp, exp, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlExpRef", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_exp); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlExpStringDerive(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlExpSubsume(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) && defined(LIBXML_EXPR_ENABLED) - int mem_base; - int ret_val; - xmlExpCtxtPtr ctxt; /* the expressions context */ - int n_ctxt; - xmlExpNodePtr exp; /* the englobing expression */ - int n_exp; - xmlExpNodePtr sub; /* the subexpression */ - int n_sub; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlExpCtxtPtr;n_ctxt++) { - for (n_exp = 0;n_exp < gen_nb_xmlExpNodePtr;n_exp++) { - for (n_sub = 0;n_sub < gen_nb_xmlExpNodePtr;n_sub++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlExpCtxtPtr(n_ctxt, 0); - exp = gen_xmlExpNodePtr(n_exp, 1); - sub = gen_xmlExpNodePtr(n_sub, 2); - - ret_val = xmlExpSubsume(ctxt, exp, sub); - desret_int(ret_val); - call_tests++; - des_xmlExpCtxtPtr(n_ctxt, ctxt, 0); - des_xmlExpNodePtr(n_exp, exp, 1); - des_xmlExpNodePtr(n_sub, sub, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlExpSubsume", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_exp); - printf(" %d", n_sub); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_REGEXP_ENABLED - -#define gen_nb_xmlRegExecCtxtPtr 1 -static xmlRegExecCtxtPtr gen_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlRegExecCtxtPtr(int no ATTRIBUTE_UNUSED, xmlRegExecCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlRegExecErrInfo(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) - int mem_base; - int ret_val; - xmlRegExecCtxtPtr exec; /* a regexp execution context generating an error */ - int n_exec; - xmlChar ** string; /* return value for the error string */ - int n_string; - int * nbval; /* pointer to the number of accepted values IN/OUT */ - int n_nbval; - int * nbneg; /* return number of negative transitions */ - int n_nbneg; - xmlChar ** values; /* pointer to the array of acceptable values */ - int n_values; - int * terminal; /* return value if this was a terminal state */ - int n_terminal; - - for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) { - for (n_string = 0;n_string < gen_nb_const_xmlChar_ptr_ptr;n_string++) { - for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) { - for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) { - for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) { - for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) { - mem_base = xmlMemBlocks(); - exec = gen_xmlRegExecCtxtPtr(n_exec, 0); - string = gen_const_xmlChar_ptr_ptr(n_string, 1); - nbval = gen_int_ptr(n_nbval, 2); - nbneg = gen_int_ptr(n_nbneg, 3); - values = gen_xmlChar_ptr_ptr(n_values, 4); - terminal = gen_int_ptr(n_terminal, 5); - - ret_val = xmlRegExecErrInfo(exec, (const xmlChar **)string, nbval, nbneg, values, terminal); - desret_int(ret_val); - call_tests++; - des_xmlRegExecCtxtPtr(n_exec, exec, 0); - des_const_xmlChar_ptr_ptr(n_string, (const xmlChar **)string, 1); - des_int_ptr(n_nbval, nbval, 2); - des_int_ptr(n_nbneg, nbneg, 3); - des_xmlChar_ptr_ptr(n_values, values, 4); - des_int_ptr(n_terminal, terminal, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegExecErrInfo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_exec); - printf(" %d", n_string); - printf(" %d", n_nbval); - printf(" %d", n_nbneg); - printf(" %d", n_values); - printf(" %d", n_terminal); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRegExecNextValues(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) - int mem_base; - int ret_val; - xmlRegExecCtxtPtr exec; /* a regexp execution context */ - int n_exec; - int * nbval; /* pointer to the number of accepted values IN/OUT */ - int n_nbval; - int * nbneg; /* return number of negative transitions */ - int n_nbneg; - xmlChar ** values; /* pointer to the array of acceptable values */ - int n_values; - int * terminal; /* return value if this was a terminal state */ - int n_terminal; - - for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) { - for (n_nbval = 0;n_nbval < gen_nb_int_ptr;n_nbval++) { - for (n_nbneg = 0;n_nbneg < gen_nb_int_ptr;n_nbneg++) { - for (n_values = 0;n_values < gen_nb_xmlChar_ptr_ptr;n_values++) { - for (n_terminal = 0;n_terminal < gen_nb_int_ptr;n_terminal++) { - mem_base = xmlMemBlocks(); - exec = gen_xmlRegExecCtxtPtr(n_exec, 0); - nbval = gen_int_ptr(n_nbval, 1); - nbneg = gen_int_ptr(n_nbneg, 2); - values = gen_xmlChar_ptr_ptr(n_values, 3); - terminal = gen_int_ptr(n_terminal, 4); - - ret_val = xmlRegExecNextValues(exec, nbval, nbneg, values, terminal); - desret_int(ret_val); - call_tests++; - des_xmlRegExecCtxtPtr(n_exec, exec, 0); - des_int_ptr(n_nbval, nbval, 1); - des_int_ptr(n_nbneg, nbneg, 2); - des_xmlChar_ptr_ptr(n_values, values, 3); - des_int_ptr(n_terminal, terminal, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegExecNextValues", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_exec); - printf(" %d", n_nbval); - printf(" %d", n_nbneg); - printf(" %d", n_values); - printf(" %d", n_terminal); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRegExecPushString(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) - int mem_base; - int ret_val; - xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */ - int n_exec; - xmlChar * value; /* a string token input */ - int n_value; - void * data; /* data associated to the token to reuse in callbacks */ - int n_data; - - for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - exec = gen_xmlRegExecCtxtPtr(n_exec, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - data = gen_userdata(n_data, 2); - - ret_val = xmlRegExecPushString(exec, (const xmlChar *)value, data); - desret_int(ret_val); - call_tests++; - des_xmlRegExecCtxtPtr(n_exec, exec, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - des_userdata(n_data, data, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegExecPushString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_exec); - printf(" %d", n_value); - printf(" %d", n_data); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRegExecPushString2(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) - int mem_base; - int ret_val; - xmlRegExecCtxtPtr exec; /* a regexp execution context or NULL to indicate the end */ - int n_exec; - xmlChar * value; /* the first string token input */ - int n_value; - xmlChar * value2; /* the second string token input */ - int n_value2; - void * data; /* data associated to the token to reuse in callbacks */ - int n_data; - - for (n_exec = 0;n_exec < gen_nb_xmlRegExecCtxtPtr;n_exec++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_value2 = 0;n_value2 < gen_nb_const_xmlChar_ptr;n_value2++) { - for (n_data = 0;n_data < gen_nb_userdata;n_data++) { - mem_base = xmlMemBlocks(); - exec = gen_xmlRegExecCtxtPtr(n_exec, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - value2 = gen_const_xmlChar_ptr(n_value2, 2); - data = gen_userdata(n_data, 3); - - ret_val = xmlRegExecPushString2(exec, (const xmlChar *)value, (const xmlChar *)value2, data); - desret_int(ret_val); - call_tests++; - des_xmlRegExecCtxtPtr(n_exec, exec, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - des_const_xmlChar_ptr(n_value2, (const xmlChar *)value2, 2); - des_userdata(n_data, data, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegExecPushString2", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_exec); - printf(" %d", n_value); - printf(" %d", n_value2); - printf(" %d", n_data); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_REGEXP_ENABLED - -#define gen_nb_xmlRegexpPtr 1 -static xmlRegexpPtr gen_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlRegexpPtr(int no ATTRIBUTE_UNUSED, xmlRegexpPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlRegNewExecCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlRegexpCompile(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlRegexpExec(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) - int mem_base; - int ret_val; - xmlRegexpPtr comp; /* the compiled regular expression */ - int n_comp; - xmlChar * content; /* the value to check against the regular expression */ - int n_content; - - for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - comp = gen_xmlRegexpPtr(n_comp, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - - ret_val = xmlRegexpExec(comp, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlRegexpPtr(n_comp, comp, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegexpExec", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_comp); - printf(" %d", n_content); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRegexpIsDeterminist(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) - int mem_base; - int ret_val; - xmlRegexpPtr comp; /* the compiled regular expression */ - int n_comp; - - for (n_comp = 0;n_comp < gen_nb_xmlRegexpPtr;n_comp++) { - mem_base = xmlMemBlocks(); - comp = gen_xmlRegexpPtr(n_comp, 0); - - ret_val = xmlRegexpIsDeterminist(comp); - desret_int(ret_val); - call_tests++; - des_xmlRegexpPtr(n_comp, comp, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegexpIsDeterminist", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_comp); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlRegexpPrint(void) { - int test_ret = 0; - -#if defined(LIBXML_REGEXP_ENABLED) - int mem_base; - FILE * output; /* the file for the output debug */ - int n_output; - xmlRegexpPtr regexp; /* the compiled regexp */ - int n_regexp; - - for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { - for (n_regexp = 0;n_regexp < gen_nb_xmlRegexpPtr;n_regexp++) { - mem_base = xmlMemBlocks(); - output = gen_FILE_ptr(n_output, 0); - regexp = gen_xmlRegexpPtr(n_regexp, 1); - - xmlRegexpPrint(output, regexp); - call_tests++; - des_FILE_ptr(n_output, output, 0); - des_xmlRegexpPtr(n_regexp, regexp, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlRegexpPrint", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_regexp); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xmlregexp(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlregexp : 16 of 30 functions ...\n"); - test_ret += test_xmlExpCtxtNbCons(); - test_ret += test_xmlExpCtxtNbNodes(); - test_ret += test_xmlExpDump(); - test_ret += test_xmlExpExpDerive(); - test_ret += test_xmlExpGetLanguage(); - test_ret += test_xmlExpGetStart(); - test_ret += test_xmlExpIsNillable(); - test_ret += test_xmlExpMaxToken(); - test_ret += test_xmlExpNewAtom(); - test_ret += test_xmlExpNewCtxt(); - test_ret += test_xmlExpNewOr(); - test_ret += test_xmlExpNewRange(); - test_ret += test_xmlExpNewSeq(); - test_ret += test_xmlExpParse(); - test_ret += test_xmlExpRef(); - test_ret += test_xmlExpStringDerive(); - test_ret += test_xmlExpSubsume(); - test_ret += test_xmlRegExecErrInfo(); - test_ret += test_xmlRegExecNextValues(); - test_ret += test_xmlRegExecPushString(); - test_ret += test_xmlRegExecPushString2(); - test_ret += test_xmlRegNewExecCtxt(); - test_ret += test_xmlRegexpCompile(); - test_ret += test_xmlRegexpExec(); - test_ret += test_xmlRegexpIsDeterminist(); - test_ret += test_xmlRegexpPrint(); - - if (test_ret != 0) - printf("Module xmlregexp: %d errors\n", test_ret); - return(test_ret); -} -#ifdef LIBXML_OUTPUT_ENABLED - -#define gen_nb_xmlSaveCtxtPtr 1 -static xmlSaveCtxtPtr gen_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSaveCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSaveCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlSaveClose(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlSaveCtxtPtr ctxt; /* a document saving context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0); - - ret_val = xmlSaveClose(ctxt); - desret_int(ret_val); - call_tests++; - des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveClose", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSaveDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - long ret_val; - xmlSaveCtxtPtr ctxt; /* a document saving context */ - int n_ctxt; - xmlDocPtr doc; /* a document */ - int n_doc; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - ret_val = xmlSaveDoc(ctxt, doc); - desret_long(ret_val); - call_tests++; - des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSaveFlush(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - int ret_val; - xmlSaveCtxtPtr ctxt; /* a document saving context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0); - - ret_val = xmlSaveFlush(ctxt); - desret_int(ret_val); - call_tests++; - des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveFlush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSaveSetAttrEscape(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSaveSetEscape(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSaveToBuffer(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSaveToFd(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSaveToFilename(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSaveTree(void) { - int test_ret = 0; - -#if defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - long ret_val; - xmlSaveCtxtPtr ctxt; /* a document saving context */ - int n_ctxt; - xmlNodePtr node; /* the top node of the subtree to save */ - int n_node; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0); - node = gen_xmlNodePtr(n_node, 1); - - ret_val = xmlSaveTree(ctxt, node); - desret_long(ret_val); - call_tests++; - des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_node, node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSaveTree", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xmlsave(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlsave : 4 of 10 functions ...\n"); - test_ret += test_xmlSaveClose(); - test_ret += test_xmlSaveDoc(); - test_ret += test_xmlSaveFlush(); - test_ret += test_xmlSaveSetAttrEscape(); - test_ret += test_xmlSaveSetEscape(); - test_ret += test_xmlSaveToBuffer(); - test_ret += test_xmlSaveToFd(); - test_ret += test_xmlSaveToFilename(); - test_ret += test_xmlSaveTree(); - - if (test_ret != 0) - printf("Module xmlsave: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlSchemaDump(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) - int mem_base; - FILE * output; /* the file output */ - int n_output; - xmlSchemaPtr schema; /* a schema structure */ - int n_schema; - - for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { - for (n_schema = 0;n_schema < gen_nb_xmlSchemaPtr;n_schema++) { - mem_base = xmlMemBlocks(); - output = gen_FILE_ptr(n_output, 0); - schema = gen_xmlSchemaPtr(n_schema, 1); - - xmlSchemaDump(output, schema); - call_tests++; - des_FILE_ptr(n_output, output, 0); - des_xmlSchemaPtr(n_schema, schema, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaDump", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_schema); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlSchemaParserCtxtPtr 1 -static xmlSchemaParserCtxtPtr gen_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaParserCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaParserCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlSchemaValidityErrorFunc_ptr 1 -static xmlSchemaValidityErrorFunc * gen_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaValidityErrorFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityErrorFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlSchemaValidityWarningFunc_ptr 1 -static xmlSchemaValidityWarningFunc * gen_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaValidityWarningFunc_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValidityWarningFunc * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlSchemaGetParserErrors(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaParserCtxtPtr ctxt; /* a XMl-Schema parser context */ - int n_ctxt; - xmlSchemaValidityErrorFunc * err; /* the error callback result */ - int n_err; - xmlSchemaValidityWarningFunc * warn; /* the warning callback result */ - int n_warn; - void ** ctx; /* contextual data for the callbacks result */ - int n_ctx; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaParserCtxtPtr;n_ctxt++) { - for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) { - for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) { - for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchemaParserCtxtPtr(n_ctxt, 0); - err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1); - warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2); - ctx = gen_void_ptr_ptr(n_ctx, 3); - - ret_val = xmlSchemaGetParserErrors(ctxt, err, warn, ctx); - desret_int(ret_val); - call_tests++; - des_xmlSchemaParserCtxtPtr(n_ctxt, ctxt, 0); - des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1); - des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2); - des_void_ptr_ptr(n_ctx, ctx, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaGetParserErrors", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_err); - printf(" %d", n_warn); - printf(" %d", n_ctx); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaGetValidErrors(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */ - int n_ctxt; - xmlSchemaValidityErrorFunc * err; /* the error function result */ - int n_err; - xmlSchemaValidityWarningFunc * warn; /* the warning function result */ - int n_warn; - void ** ctx; /* the functions context result */ - int n_ctx; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - for (n_err = 0;n_err < gen_nb_xmlSchemaValidityErrorFunc_ptr;n_err++) { - for (n_warn = 0;n_warn < gen_nb_xmlSchemaValidityWarningFunc_ptr;n_warn++) { - for (n_ctx = 0;n_ctx < gen_nb_void_ptr_ptr;n_ctx++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); - err = gen_xmlSchemaValidityErrorFunc_ptr(n_err, 1); - warn = gen_xmlSchemaValidityWarningFunc_ptr(n_warn, 2); - ctx = gen_void_ptr_ptr(n_ctx, 3); - - ret_val = xmlSchemaGetValidErrors(ctxt, err, warn, ctx); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlSchemaValidityErrorFunc_ptr(n_err, err, 1); - des_xmlSchemaValidityWarningFunc_ptr(n_warn, warn, 2); - des_void_ptr_ptr(n_ctx, ctx, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaGetValidErrors", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_err); - printf(" %d", n_warn); - printf(" %d", n_ctx); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaIsValid(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); - - ret_val = xmlSchemaIsValid(ctxt); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaIsValid", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaNewDocParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlSchemaParserCtxtPtr ret_val; - xmlDocPtr doc; /* a preparsed document tree */ - int n_doc; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - - ret_val = xmlSchemaNewDocParserCtxt(doc); - desret_xmlSchemaParserCtxtPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaNewDocParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaNewMemParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlSchemaParserCtxtPtr ret_val; - char * buffer; /* a pointer to a char array containing the schemas */ - int n_buffer; - int size; /* the size of the array */ - int n_size; - - for (n_buffer = 0;n_buffer < gen_nb_const_char_ptr;n_buffer++) { - for (n_size = 0;n_size < gen_nb_int;n_size++) { - mem_base = xmlMemBlocks(); - buffer = gen_const_char_ptr(n_buffer, 0); - size = gen_int(n_size, 1); - - ret_val = xmlSchemaNewMemParserCtxt((const char *)buffer, size); - desret_xmlSchemaParserCtxtPtr(ret_val); - call_tests++; - des_const_char_ptr(n_buffer, (const char *)buffer, 0); - des_int(n_size, size, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaNewMemParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buffer); - printf(" %d", n_size); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaNewParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlSchemaParserCtxtPtr ret_val; - char * URL; /* the location of the schema */ - int n_URL; - - for (n_URL = 0;n_URL < gen_nb_const_char_ptr;n_URL++) { - mem_base = xmlMemBlocks(); - URL = gen_const_char_ptr(n_URL, 0); - - ret_val = xmlSchemaNewParserCtxt((const char *)URL); - desret_xmlSchemaParserCtxtPtr(ret_val); - call_tests++; - des_const_char_ptr(n_URL, (const char *)URL, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaNewParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_URL); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaNewValidCtxt(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaParse(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlSAXHandlerPtr_ptr 1 -static xmlSAXHandlerPtr * gen_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSAXHandlerPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSAXHandlerPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlSchemaSAXPlug(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlSchemaSAXPlugPtr 1 -static xmlSchemaSAXPlugPtr gen_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaSAXPlugPtr(int no ATTRIBUTE_UNUSED, xmlSchemaSAXPlugPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlSchemaSAXUnplug(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */ - int n_plug; - - for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) { - mem_base = xmlMemBlocks(); - plug = gen_xmlSchemaSAXPlugPtr(n_plug, 0); - - ret_val = xmlSchemaSAXUnplug(plug); - desret_int(ret_val); - call_tests++; - des_xmlSchemaSAXPlugPtr(n_plug, plug, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaSAXUnplug", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_plug); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaSetParserErrors(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaSetParserStructuredErrors(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaSetValidErrors(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaSetValidOptions(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ - int n_ctxt; - int options; /* a combination of xmlSchemaValidOption */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); - options = gen_int(n_options, 1); - - ret_val = xmlSchemaSetValidOptions(ctxt, options); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); - des_int(n_options, options, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaSetValidOptions", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_options); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaSetValidStructuredErrors(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaValidCtxtGetOptions(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); - - ret_val = xmlSchemaValidCtxtGetOptions(ctxt); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidCtxtGetOptions", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidCtxtGetParserCtxt(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlParserCtxtPtr ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); - - ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt); - desret_xmlParserCtxtPtr(ret_val); - call_tests++; - des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidateDoc(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ - int n_ctxt; - xmlDocPtr doc; /* a parsed document tree */ - int n_doc; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); - doc = gen_xmlDocPtr(n_doc, 1); - - ret_val = xmlSchemaValidateDoc(ctxt, doc); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlDocPtr(n_doc, doc, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidateDoc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_doc); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidateFile(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ - int n_ctxt; - const char * filename; /* the URI of the instance */ - int n_filename; - int options; /* a future set of options, currently unused */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); - filename = gen_filepath(n_filename, 1); - options = gen_int(n_options, 2); - - ret_val = xmlSchemaValidateFile(ctxt, filename, options); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); - des_filepath(n_filename, filename, 1); - des_int(n_options, options, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidateFile", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_filename); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidateOneElement(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ - int n_ctxt; - xmlNodePtr elem; /* an element node */ - int n_elem; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); - elem = gen_xmlNodePtr(n_elem, 1); - - ret_val = xmlSchemaValidateOneElement(ctxt, elem); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_elem, elem, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidateOneElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_elem); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidateSetFilename(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlSchemaValidCtxtPtr vctxt; /* the schema validation context */ - int n_vctxt; - const char * filename; /* the file name */ - int n_filename; - - for (n_vctxt = 0;n_vctxt < gen_nb_xmlSchemaValidCtxtPtr;n_vctxt++) { - for (n_filename = 0;n_filename < gen_nb_filepath;n_filename++) { - mem_base = xmlMemBlocks(); - vctxt = gen_xmlSchemaValidCtxtPtr(n_vctxt, 0); - filename = gen_filepath(n_filename, 1); - - xmlSchemaValidateSetFilename(vctxt, filename); - call_tests++; - des_xmlSchemaValidCtxtPtr(n_vctxt, vctxt, 0); - des_filepath(n_filename, filename, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidateSetFilename", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_vctxt); - printf(" %d", n_filename); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidateSetLocator(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaValidateStream(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */ - int n_ctxt; - xmlParserInputBufferPtr input; /* the input to use for reading the data */ - int n_input; - xmlCharEncoding enc; /* an optional encoding information */ - int n_enc; - xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */ - int n_sax; - void * user_data; /* the context to provide to the SAX handler. */ - int n_user_data; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) { - for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) { - for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) { - for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) { - for (n_user_data = 0;n_user_data < gen_nb_userdata;n_user_data++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0); - input = gen_xmlParserInputBufferPtr(n_input, 1); - enc = gen_xmlCharEncoding(n_enc, 2); - sax = gen_xmlSAXHandlerPtr(n_sax, 3); - user_data = gen_userdata(n_user_data, 4); - - ret_val = xmlSchemaValidateStream(ctxt, input, enc, sax, user_data); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0); - des_xmlParserInputBufferPtr(n_input, input, 1); - des_xmlCharEncoding(n_enc, enc, 2); - des_xmlSAXHandlerPtr(n_sax, sax, 3); - des_userdata(n_user_data, user_data, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidateStream", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_input); - printf(" %d", n_enc); - printf(" %d", n_sax); - printf(" %d", n_user_data); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xmlschemas(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlschemas : 16 of 27 functions ...\n"); - test_ret += test_xmlSchemaDump(); - test_ret += test_xmlSchemaGetParserErrors(); - test_ret += test_xmlSchemaGetValidErrors(); - test_ret += test_xmlSchemaIsValid(); - test_ret += test_xmlSchemaNewDocParserCtxt(); - test_ret += test_xmlSchemaNewMemParserCtxt(); - test_ret += test_xmlSchemaNewParserCtxt(); - test_ret += test_xmlSchemaNewValidCtxt(); - test_ret += test_xmlSchemaParse(); - test_ret += test_xmlSchemaSAXPlug(); - test_ret += test_xmlSchemaSAXUnplug(); - test_ret += test_xmlSchemaSetParserErrors(); - test_ret += test_xmlSchemaSetParserStructuredErrors(); - test_ret += test_xmlSchemaSetValidErrors(); - test_ret += test_xmlSchemaSetValidOptions(); - test_ret += test_xmlSchemaSetValidStructuredErrors(); - test_ret += test_xmlSchemaValidCtxtGetOptions(); - test_ret += test_xmlSchemaValidCtxtGetParserCtxt(); - test_ret += test_xmlSchemaValidateDoc(); - test_ret += test_xmlSchemaValidateFile(); - test_ret += test_xmlSchemaValidateOneElement(); - test_ret += test_xmlSchemaValidateSetFilename(); - test_ret += test_xmlSchemaValidateSetLocator(); - test_ret += test_xmlSchemaValidateStream(); - - if (test_ret != 0) - printf("Module xmlschemas: %d errors\n", test_ret); - return(test_ret); -} -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlSchemaFacetPtr 1 -static xmlSchemaFacetPtr gen_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaFacetPtr(int no ATTRIBUTE_UNUSED, xmlSchemaFacetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlSchemaTypePtr 1 -static xmlSchemaTypePtr gen_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaTypePtr(int no ATTRIBUTE_UNUSED, xmlSchemaTypePtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlSchemaCheckFacet(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaFacetPtr facet; /* the facet */ - int n_facet; - xmlSchemaTypePtr typeDecl; /* the schema type definition */ - int n_typeDecl; - xmlSchemaParserCtxtPtr pctxt; /* the schema parser context or NULL */ - int n_pctxt; - xmlChar * name; /* the optional name of the type */ - int n_name; - - for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) { - for (n_typeDecl = 0;n_typeDecl < gen_nb_xmlSchemaTypePtr;n_typeDecl++) { - for (n_pctxt = 0;n_pctxt < gen_nb_xmlSchemaParserCtxtPtr;n_pctxt++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - facet = gen_xmlSchemaFacetPtr(n_facet, 0); - typeDecl = gen_xmlSchemaTypePtr(n_typeDecl, 1); - pctxt = gen_xmlSchemaParserCtxtPtr(n_pctxt, 2); - name = gen_const_xmlChar_ptr(n_name, 3); - - ret_val = xmlSchemaCheckFacet(facet, typeDecl, pctxt, (const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_xmlSchemaFacetPtr(n_facet, facet, 0); - des_xmlSchemaTypePtr(n_typeDecl, typeDecl, 1); - des_xmlSchemaParserCtxtPtr(n_pctxt, pctxt, 2); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaCheckFacet", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_facet); - printf(" %d", n_typeDecl); - printf(" %d", n_pctxt); - printf(" %d", n_name); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaCleanupTypes(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - - - xmlSchemaCleanupTypes(); - call_tests++; - xmlResetLastError(); - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaCollapseString(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlChar * value; /* a value */ - int n_value; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - value = gen_const_xmlChar_ptr(n_value, 0); - - ret_val = xmlSchemaCollapseString((const xmlChar *)value); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaCollapseString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlSchemaValPtr 1 -static xmlSchemaValPtr gen_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaValPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlSchemaCompareValues(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValPtr x; /* a first value */ - int n_x; - xmlSchemaValPtr y; /* a second value */ - int n_y; - - for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) { - for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) { - mem_base = xmlMemBlocks(); - x = gen_xmlSchemaValPtr(n_x, 0); - y = gen_xmlSchemaValPtr(n_y, 1); - - ret_val = xmlSchemaCompareValues(x, y); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValPtr(n_x, x, 0); - des_xmlSchemaValPtr(n_y, y, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaCompareValues", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_x); - printf(" %d", n_y); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaCompareValuesWhtsp(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValPtr x; /* a first value */ - int n_x; - xmlSchemaWhitespaceValueType xws; /* the whitespace value of x */ - int n_xws; - xmlSchemaValPtr y; /* a second value */ - int n_y; - xmlSchemaWhitespaceValueType yws; /* the whitespace value of y */ - int n_yws; - - for (n_x = 0;n_x < gen_nb_xmlSchemaValPtr;n_x++) { - for (n_xws = 0;n_xws < gen_nb_xmlSchemaWhitespaceValueType;n_xws++) { - for (n_y = 0;n_y < gen_nb_xmlSchemaValPtr;n_y++) { - for (n_yws = 0;n_yws < gen_nb_xmlSchemaWhitespaceValueType;n_yws++) { - mem_base = xmlMemBlocks(); - x = gen_xmlSchemaValPtr(n_x, 0); - xws = gen_xmlSchemaWhitespaceValueType(n_xws, 1); - y = gen_xmlSchemaValPtr(n_y, 2); - yws = gen_xmlSchemaWhitespaceValueType(n_yws, 3); - - ret_val = xmlSchemaCompareValuesWhtsp(x, xws, y, yws); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValPtr(n_x, x, 0); - des_xmlSchemaWhitespaceValueType(n_xws, xws, 1); - des_xmlSchemaValPtr(n_y, y, 2); - des_xmlSchemaWhitespaceValueType(n_yws, yws, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaCompareValuesWhtsp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_x); - printf(" %d", n_xws); - printf(" %d", n_y); - printf(" %d", n_yws); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaCopyValue(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaGetBuiltInListSimpleTypeItemType(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlSchemaTypePtr ret_val; - xmlSchemaTypePtr type; /* the built-in simple type. */ - int n_type; - - for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) { - mem_base = xmlMemBlocks(); - type = gen_xmlSchemaTypePtr(n_type, 0); - - ret_val = xmlSchemaGetBuiltInListSimpleTypeItemType(type); - desret_xmlSchemaTypePtr(ret_val); - call_tests++; - des_xmlSchemaTypePtr(n_type, type, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaGetBuiltInListSimpleTypeItemType", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_type); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaGetBuiltInType(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - xmlSchemaTypePtr ret_val; - xmlSchemaValType type; /* the type of the built in type */ - int n_type; - - for (n_type = 0;n_type < gen_nb_xmlSchemaValType;n_type++) { - type = gen_xmlSchemaValType(n_type, 0); - - ret_val = xmlSchemaGetBuiltInType(type); - desret_xmlSchemaTypePtr(ret_val); - call_tests++; - des_xmlSchemaValType(n_type, type, 0); - xmlResetLastError(); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaGetCanonValue(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValPtr val; /* the precomputed value */ - int n_val; - xmlChar ** retValue; /* the returned value */ - int n_retValue; - - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) { - for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) { - mem_base = xmlMemBlocks(); - val = gen_xmlSchemaValPtr(n_val, 0); - retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1); - - ret_val = xmlSchemaGetCanonValue(val, (const xmlChar **)retValue); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValPtr(n_val, val, 0); - des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaGetCanonValue", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf(" %d", n_retValue); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaGetCanonValueWhtsp(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValPtr val; /* the precomputed value */ - int n_val; - xmlChar ** retValue; /* the returned value */ - int n_retValue; - xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */ - int n_ws; - - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) { - for (n_retValue = 0;n_retValue < gen_nb_const_xmlChar_ptr_ptr;n_retValue++) { - for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) { - mem_base = xmlMemBlocks(); - val = gen_xmlSchemaValPtr(n_val, 0); - retValue = gen_const_xmlChar_ptr_ptr(n_retValue, 1); - ws = gen_xmlSchemaWhitespaceValueType(n_ws, 2); - - ret_val = xmlSchemaGetCanonValueWhtsp(val, (const xmlChar **)retValue, ws); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValPtr(n_val, val, 0); - des_const_xmlChar_ptr_ptr(n_retValue, (const xmlChar **)retValue, 1); - des_xmlSchemaWhitespaceValueType(n_ws, ws, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaGetCanonValueWhtsp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf(" %d", n_retValue); - printf(" %d", n_ws); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaGetFacetValueAsULong(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - unsigned long ret_val; - xmlSchemaFacetPtr facet; /* an schemas type facet */ - int n_facet; - - for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) { - mem_base = xmlMemBlocks(); - facet = gen_xmlSchemaFacetPtr(n_facet, 0); - - ret_val = xmlSchemaGetFacetValueAsULong(facet); - desret_unsigned_long(ret_val); - call_tests++; - des_xmlSchemaFacetPtr(n_facet, facet, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaGetFacetValueAsULong", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_facet); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaGetPredefinedType(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlSchemaTypePtr ret_val; - xmlChar * name; /* the type name */ - int n_name; - xmlChar * ns; /* the URI of the namespace usually "http://www.w3.org/2001/XMLSchema" */ - int n_ns; - - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ns = 0;n_ns < gen_nb_const_xmlChar_ptr;n_ns++) { - mem_base = xmlMemBlocks(); - name = gen_const_xmlChar_ptr(n_name, 0); - ns = gen_const_xmlChar_ptr(n_ns, 1); - - ret_val = xmlSchemaGetPredefinedType((const xmlChar *)name, (const xmlChar *)ns); - desret_xmlSchemaTypePtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); - des_const_xmlChar_ptr(n_ns, (const xmlChar *)ns, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaGetPredefinedType", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf(" %d", n_ns); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaGetValType(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlSchemaValType ret_val; - xmlSchemaValPtr val; /* a schemas value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlSchemaValPtr(n_val, 0); - - ret_val = xmlSchemaGetValType(val); - desret_xmlSchemaValType(ret_val); - call_tests++; - des_xmlSchemaValPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaGetValType", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaInitTypes(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - - - xmlSchemaInitTypes(); - call_tests++; - xmlResetLastError(); - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaIsBuiltInTypeFacet(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaTypePtr type; /* the built-in type */ - int n_type; - int facetType; /* the facet type */ - int n_facetType; - - for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) { - for (n_facetType = 0;n_facetType < gen_nb_int;n_facetType++) { - mem_base = xmlMemBlocks(); - type = gen_xmlSchemaTypePtr(n_type, 0); - facetType = gen_int(n_facetType, 1); - - ret_val = xmlSchemaIsBuiltInTypeFacet(type, facetType); - desret_int(ret_val); - call_tests++; - des_xmlSchemaTypePtr(n_type, type, 0); - des_int(n_facetType, facetType, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaIsBuiltInTypeFacet", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_type); - printf(" %d", n_facetType); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaNewFacet(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaNewNOTATIONValue(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaNewQNameValue(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaNewStringValue(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -#ifdef LIBXML_SCHEMAS_ENABLED - -#define gen_nb_xmlSchemaValPtr_ptr 1 -static xmlSchemaValPtr * gen_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlSchemaValPtr_ptr(int no ATTRIBUTE_UNUSED, xmlSchemaValPtr * val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlSchemaValPredefTypeNode(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaTypePtr type; /* the predefined type */ - int n_type; - xmlChar * value; /* the value to check */ - int n_value; - xmlSchemaValPtr * val; /* the return computed value */ - int n_val; - xmlNodePtr node; /* the node containing the value */ - int n_node; - - for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - type = gen_xmlSchemaTypePtr(n_type, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - val = gen_xmlSchemaValPtr_ptr(n_val, 2); - node = gen_xmlNodePtr(n_node, 3); - - ret_val = xmlSchemaValPredefTypeNode(type, (const xmlChar *)value, val, node); - desret_int(ret_val); - call_tests++; - des_xmlSchemaTypePtr(n_type, type, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - des_xmlSchemaValPtr_ptr(n_val, val, 2); - des_xmlNodePtr(n_node, node, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValPredefTypeNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_type); - printf(" %d", n_value); - printf(" %d", n_val); - printf(" %d", n_node); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValPredefTypeNodeNoNorm(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaTypePtr type; /* the predefined type */ - int n_type; - xmlChar * value; /* the value to check */ - int n_value; - xmlSchemaValPtr * val; /* the return computed value */ - int n_val; - xmlNodePtr node; /* the node containing the value */ - int n_node; - - for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - type = gen_xmlSchemaTypePtr(n_type, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - val = gen_xmlSchemaValPtr_ptr(n_val, 2); - node = gen_xmlNodePtr(n_node, 3); - - ret_val = xmlSchemaValPredefTypeNodeNoNorm(type, (const xmlChar *)value, val, node); - desret_int(ret_val); - call_tests++; - des_xmlSchemaTypePtr(n_type, type, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - des_xmlSchemaValPtr_ptr(n_val, val, 2); - des_xmlNodePtr(n_node, node, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValPredefTypeNodeNoNorm", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_type); - printf(" %d", n_value); - printf(" %d", n_val); - printf(" %d", n_node); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidateFacet(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaTypePtr base; /* the base type */ - int n_base; - xmlSchemaFacetPtr facet; /* the facet to check */ - int n_facet; - xmlChar * value; /* the lexical repr of the value to validate */ - int n_value; - xmlSchemaValPtr val; /* the precomputed value */ - int n_val; - - for (n_base = 0;n_base < gen_nb_xmlSchemaTypePtr;n_base++) { - for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) { - mem_base = xmlMemBlocks(); - base = gen_xmlSchemaTypePtr(n_base, 0); - facet = gen_xmlSchemaFacetPtr(n_facet, 1); - value = gen_const_xmlChar_ptr(n_value, 2); - val = gen_xmlSchemaValPtr(n_val, 3); - - ret_val = xmlSchemaValidateFacet(base, facet, (const xmlChar *)value, val); - desret_int(ret_val); - call_tests++; - des_xmlSchemaTypePtr(n_base, base, 0); - des_xmlSchemaFacetPtr(n_facet, facet, 1); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); - des_xmlSchemaValPtr(n_val, val, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidateFacet", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_base); - printf(" %d", n_facet); - printf(" %d", n_value); - printf(" %d", n_val); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidateFacetWhtsp(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaFacetPtr facet; /* the facet to check */ - int n_facet; - xmlSchemaWhitespaceValueType fws; /* the whitespace type of the facet's value */ - int n_fws; - xmlSchemaValType valType; /* the built-in type of the value */ - int n_valType; - xmlChar * value; /* the lexical (or normalized for pattern) repr of the value to validate */ - int n_value; - xmlSchemaValPtr val; /* the precomputed value */ - int n_val; - xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */ - int n_ws; - - for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) { - for (n_fws = 0;n_fws < gen_nb_xmlSchemaWhitespaceValueType;n_fws++) { - for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) { - for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) { - mem_base = xmlMemBlocks(); - facet = gen_xmlSchemaFacetPtr(n_facet, 0); - fws = gen_xmlSchemaWhitespaceValueType(n_fws, 1); - valType = gen_xmlSchemaValType(n_valType, 2); - value = gen_const_xmlChar_ptr(n_value, 3); - val = gen_xmlSchemaValPtr(n_val, 4); - ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5); - - ret_val = xmlSchemaValidateFacetWhtsp(facet, fws, valType, (const xmlChar *)value, val, ws); - desret_int(ret_val); - call_tests++; - des_xmlSchemaFacetPtr(n_facet, facet, 0); - des_xmlSchemaWhitespaceValueType(n_fws, fws, 1); - des_xmlSchemaValType(n_valType, valType, 2); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 3); - des_xmlSchemaValPtr(n_val, val, 4); - des_xmlSchemaWhitespaceValueType(n_ws, ws, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidateFacetWhtsp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_facet); - printf(" %d", n_fws); - printf(" %d", n_valType); - printf(" %d", n_value); - printf(" %d", n_val); - printf(" %d", n_ws); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidateLengthFacet(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaTypePtr type; /* the built-in type */ - int n_type; - xmlSchemaFacetPtr facet; /* the facet to check */ - int n_facet; - xmlChar * value; /* the lexical repr. of the value to be validated */ - int n_value; - xmlSchemaValPtr val; /* the precomputed value */ - int n_val; - unsigned long * length; /* the actual length of the value */ - int n_length; - - for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) { - for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) { - for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) { - mem_base = xmlMemBlocks(); - type = gen_xmlSchemaTypePtr(n_type, 0); - facet = gen_xmlSchemaFacetPtr(n_facet, 1); - value = gen_const_xmlChar_ptr(n_value, 2); - val = gen_xmlSchemaValPtr(n_val, 3); - length = gen_unsigned_long_ptr(n_length, 4); - - ret_val = xmlSchemaValidateLengthFacet(type, facet, (const xmlChar *)value, val, length); - desret_int(ret_val); - call_tests++; - des_xmlSchemaTypePtr(n_type, type, 0); - des_xmlSchemaFacetPtr(n_facet, facet, 1); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); - des_xmlSchemaValPtr(n_val, val, 3); - des_unsigned_long_ptr(n_length, length, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidateLengthFacet", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_type); - printf(" %d", n_facet); - printf(" %d", n_value); - printf(" %d", n_val); - printf(" %d", n_length); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidateLengthFacetWhtsp(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaFacetPtr facet; /* the facet to check */ - int n_facet; - xmlSchemaValType valType; /* the built-in type */ - int n_valType; - xmlChar * value; /* the lexical repr. of the value to be validated */ - int n_value; - xmlSchemaValPtr val; /* the precomputed value */ - int n_val; - unsigned long * length; /* the actual length of the value */ - int n_length; - xmlSchemaWhitespaceValueType ws; /* the whitespace type of the value */ - int n_ws; - - for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) { - for (n_valType = 0;n_valType < gen_nb_xmlSchemaValType;n_valType++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) { - for (n_length = 0;n_length < gen_nb_unsigned_long_ptr;n_length++) { - for (n_ws = 0;n_ws < gen_nb_xmlSchemaWhitespaceValueType;n_ws++) { - mem_base = xmlMemBlocks(); - facet = gen_xmlSchemaFacetPtr(n_facet, 0); - valType = gen_xmlSchemaValType(n_valType, 1); - value = gen_const_xmlChar_ptr(n_value, 2); - val = gen_xmlSchemaValPtr(n_val, 3); - length = gen_unsigned_long_ptr(n_length, 4); - ws = gen_xmlSchemaWhitespaceValueType(n_ws, 5); - - ret_val = xmlSchemaValidateLengthFacetWhtsp(facet, valType, (const xmlChar *)value, val, length, ws); - desret_int(ret_val); - call_tests++; - des_xmlSchemaFacetPtr(n_facet, facet, 0); - des_xmlSchemaValType(n_valType, valType, 1); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 2); - des_xmlSchemaValPtr(n_val, val, 3); - des_unsigned_long_ptr(n_length, length, 4); - des_xmlSchemaWhitespaceValueType(n_ws, ws, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidateLengthFacetWhtsp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_facet); - printf(" %d", n_valType); - printf(" %d", n_value); - printf(" %d", n_val); - printf(" %d", n_length); - printf(" %d", n_ws); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidateListSimpleTypeFacet(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaFacetPtr facet; /* the facet to check */ - int n_facet; - xmlChar * value; /* the lexical repr of the value to validate */ - int n_value; - unsigned long actualLen; /* the number of list items */ - int n_actualLen; - unsigned long * expectedLen; /* the resulting expected number of list items */ - int n_expectedLen; - - for (n_facet = 0;n_facet < gen_nb_xmlSchemaFacetPtr;n_facet++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_actualLen = 0;n_actualLen < gen_nb_unsigned_long;n_actualLen++) { - for (n_expectedLen = 0;n_expectedLen < gen_nb_unsigned_long_ptr;n_expectedLen++) { - mem_base = xmlMemBlocks(); - facet = gen_xmlSchemaFacetPtr(n_facet, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - actualLen = gen_unsigned_long(n_actualLen, 2); - expectedLen = gen_unsigned_long_ptr(n_expectedLen, 3); - - ret_val = xmlSchemaValidateListSimpleTypeFacet(facet, (const xmlChar *)value, actualLen, expectedLen); - desret_int(ret_val); - call_tests++; - des_xmlSchemaFacetPtr(n_facet, facet, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - des_unsigned_long(n_actualLen, actualLen, 2); - des_unsigned_long_ptr(n_expectedLen, expectedLen, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidateListSimpleTypeFacet", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_facet); - printf(" %d", n_value); - printf(" %d", n_actualLen); - printf(" %d", n_expectedLen); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValidatePredefinedType(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaTypePtr type; /* the predefined type */ - int n_type; - xmlChar * value; /* the value to check */ - int n_value; - xmlSchemaValPtr * val; /* the return computed value */ - int n_val; - - for (n_type = 0;n_type < gen_nb_xmlSchemaTypePtr;n_type++) { - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr_ptr;n_val++) { - mem_base = xmlMemBlocks(); - type = gen_xmlSchemaTypePtr(n_type, 0); - value = gen_const_xmlChar_ptr(n_value, 1); - val = gen_xmlSchemaValPtr_ptr(n_val, 2); - - ret_val = xmlSchemaValidatePredefinedType(type, (const xmlChar *)value, val); - desret_int(ret_val); - call_tests++; - des_xmlSchemaTypePtr(n_type, type, 0); - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 1); - des_xmlSchemaValPtr_ptr(n_val, val, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValidatePredefinedType", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_type); - printf(" %d", n_value); - printf(" %d", n_val); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValueAppend(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValPtr prev; /* the value */ - int n_prev; - xmlSchemaValPtr cur; /* the value to be appended */ - int n_cur; - - for (n_prev = 0;n_prev < gen_nb_xmlSchemaValPtr;n_prev++) { - for (n_cur = 0;n_cur < gen_nb_xmlSchemaValPtr;n_cur++) { - mem_base = xmlMemBlocks(); - prev = gen_xmlSchemaValPtr(n_prev, 0); - cur = gen_xmlSchemaValPtr(n_cur, 1); - - ret_val = xmlSchemaValueAppend(prev, cur); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValPtr(n_prev, prev, 0); - des_xmlSchemaValPtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValueAppend", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_prev); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValueGetAsBoolean(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - xmlSchemaValPtr val; /* the value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlSchemaValPtr(n_val, 0); - - ret_val = xmlSchemaValueGetAsBoolean(val); - desret_int(ret_val); - call_tests++; - des_xmlSchemaValPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValueGetAsBoolean", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValueGetAsString(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlSchemaValPtr val; /* the value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlSchemaValPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlSchemaValPtr(n_val, 0); - - ret_val = xmlSchemaValueGetAsString(val); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlSchemaValPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaValueGetAsString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlSchemaValueGetNext(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlSchemaWhiteSpaceReplace(void) { - int test_ret = 0; - -#if defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlChar * value; /* a value */ - int n_value; - - for (n_value = 0;n_value < gen_nb_const_xmlChar_ptr;n_value++) { - mem_base = xmlMemBlocks(); - value = gen_const_xmlChar_ptr(n_value, 0); - - ret_val = xmlSchemaWhiteSpaceReplace((const xmlChar *)value); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_value, (const xmlChar *)value, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlSchemaWhiteSpaceReplace", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_value); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xmlschemastypes(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlschemastypes : 26 of 34 functions ...\n"); - test_ret += test_xmlSchemaCheckFacet(); - test_ret += test_xmlSchemaCleanupTypes(); - test_ret += test_xmlSchemaCollapseString(); - test_ret += test_xmlSchemaCompareValues(); - test_ret += test_xmlSchemaCompareValuesWhtsp(); - test_ret += test_xmlSchemaCopyValue(); - test_ret += test_xmlSchemaGetBuiltInListSimpleTypeItemType(); - test_ret += test_xmlSchemaGetBuiltInType(); - test_ret += test_xmlSchemaGetCanonValue(); - test_ret += test_xmlSchemaGetCanonValueWhtsp(); - test_ret += test_xmlSchemaGetFacetValueAsULong(); - test_ret += test_xmlSchemaGetPredefinedType(); - test_ret += test_xmlSchemaGetValType(); - test_ret += test_xmlSchemaInitTypes(); - test_ret += test_xmlSchemaIsBuiltInTypeFacet(); - test_ret += test_xmlSchemaNewFacet(); - test_ret += test_xmlSchemaNewNOTATIONValue(); - test_ret += test_xmlSchemaNewQNameValue(); - test_ret += test_xmlSchemaNewStringValue(); - test_ret += test_xmlSchemaValPredefTypeNode(); - test_ret += test_xmlSchemaValPredefTypeNodeNoNorm(); - test_ret += test_xmlSchemaValidateFacet(); - test_ret += test_xmlSchemaValidateFacetWhtsp(); - test_ret += test_xmlSchemaValidateLengthFacet(); - test_ret += test_xmlSchemaValidateLengthFacetWhtsp(); - test_ret += test_xmlSchemaValidateListSimpleTypeFacet(); - test_ret += test_xmlSchemaValidatePredefinedType(); - test_ret += test_xmlSchemaValueAppend(); - test_ret += test_xmlSchemaValueGetAsBoolean(); - test_ret += test_xmlSchemaValueGetAsString(); - test_ret += test_xmlSchemaValueGetNext(); - test_ret += test_xmlSchemaWhiteSpaceReplace(); - - if (test_ret != 0) - printf("Module xmlschemastypes: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlCharStrdup(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - char * cur; /* the input char * */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_const_char_ptr(n_cur, 0); - - ret_val = xmlCharStrdup((const char *)cur); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_char_ptr(n_cur, (const char *)cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCharStrdup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCharStrndup(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - char * cur; /* the input char * */ - int n_cur; - int len; /* the len of @cur */ - int n_len; - - for (n_cur = 0;n_cur < gen_nb_const_char_ptr;n_cur++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - cur = gen_const_char_ptr(n_cur, 0); - len = gen_int(n_len, 1); - - ret_val = xmlCharStrndup((const char *)cur, len); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_char_ptr(n_cur, (const char *)cur, 0); - des_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCharStrndup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlCheckUTF8(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned char * utf; /* Pointer to putative UTF-8 encoded string. */ - int n_utf; - - for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) { - mem_base = xmlMemBlocks(); - utf = gen_const_unsigned_char_ptr(n_utf, 0); - - ret_val = xmlCheckUTF8((const unsigned char *)utf); - desret_int(ret_val); - call_tests++; - des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlCheckUTF8", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_utf); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlGetUTF8Char(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - unsigned char * utf; /* a sequence of UTF-8 encoded bytes */ - int n_utf; - int * len; /* a pointer to the minimum number of bytes present in the sequence. This is used to assure the next character is completely contained within the sequence. */ - int n_len; - - for (n_utf = 0;n_utf < gen_nb_const_unsigned_char_ptr;n_utf++) { - for (n_len = 0;n_len < gen_nb_int_ptr;n_len++) { - mem_base = xmlMemBlocks(); - utf = gen_const_unsigned_char_ptr(n_utf, 0); - len = gen_int_ptr(n_len, 1); - - ret_val = xmlGetUTF8Char((const unsigned char *)utf, len); - desret_int(ret_val); - call_tests++; - des_const_unsigned_char_ptr(n_utf, (const unsigned char *)utf, 0); - des_int_ptr(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlGetUTF8Char", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_utf); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrEqual(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * str1; /* the first xmlChar * */ - int n_str1; - xmlChar * str2; /* the second xmlChar * */ - int n_str2; - - for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { - for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { - mem_base = xmlMemBlocks(); - str1 = gen_const_xmlChar_ptr(n_str1, 0); - str2 = gen_const_xmlChar_ptr(n_str2, 1); - - ret_val = xmlStrEqual((const xmlChar *)str1, (const xmlChar *)str2); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0); - des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrEqual", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str1); - printf(" %d", n_str2); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrPrintf(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlStrQEqual(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * pref; /* the prefix of the QName */ - int n_pref; - xmlChar * name; /* the localname of the QName */ - int n_name; - xmlChar * str; /* the second xmlChar * */ - int n_str; - - for (n_pref = 0;n_pref < gen_nb_const_xmlChar_ptr;n_pref++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - mem_base = xmlMemBlocks(); - pref = gen_const_xmlChar_ptr(n_pref, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - str = gen_const_xmlChar_ptr(n_str, 2); - - ret_val = xmlStrQEqual((const xmlChar *)pref, (const xmlChar *)name, (const xmlChar *)str); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_pref, (const xmlChar *)pref, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrQEqual", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_pref); - printf(" %d", n_name); - printf(" %d", n_str); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrVPrintf(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlStrcasecmp(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * str1; /* the first xmlChar * */ - int n_str1; - xmlChar * str2; /* the second xmlChar * */ - int n_str2; - - for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { - for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { - mem_base = xmlMemBlocks(); - str1 = gen_const_xmlChar_ptr(n_str1, 0); - str2 = gen_const_xmlChar_ptr(n_str2, 1); - - ret_val = xmlStrcasecmp((const xmlChar *)str1, (const xmlChar *)str2); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0); - des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrcasecmp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str1); - printf(" %d", n_str2); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrcasestr(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlChar * str; /* the xmlChar * array (haystack) */ - int n_str; - xmlChar * val; /* the xmlChar to search (needle) */ - int n_val; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - val = gen_const_xmlChar_ptr(n_val, 1); - - ret_val = xmlStrcasestr((const xmlChar *)str, (const xmlChar *)val); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrcasestr", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrchr(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlChar * str; /* the xmlChar * array */ - int n_str; - xmlChar val; /* the xmlChar to search */ - int n_val; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_val = 0;n_val < gen_nb_xmlChar;n_val++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - val = gen_xmlChar(n_val, 1); - - ret_val = xmlStrchr((const xmlChar *)str, val); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - des_xmlChar(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrchr", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrcmp(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * str1; /* the first xmlChar * */ - int n_str1; - xmlChar * str2; /* the second xmlChar * */ - int n_str2; - - for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { - for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { - mem_base = xmlMemBlocks(); - str1 = gen_const_xmlChar_ptr(n_str1, 0); - str2 = gen_const_xmlChar_ptr(n_str2, 1); - - ret_val = xmlStrcmp((const xmlChar *)str1, (const xmlChar *)str2); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0); - des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrcmp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str1); - printf(" %d", n_str2); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrdup(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * cur; /* the input xmlChar * */ - int n_cur; - - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - mem_base = xmlMemBlocks(); - cur = gen_const_xmlChar_ptr(n_cur, 0); - - ret_val = xmlStrdup((const xmlChar *)cur); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrdup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrlen(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * str; /* the xmlChar * array */ - int n_str; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - - ret_val = xmlStrlen((const xmlChar *)str); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrlen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrncasecmp(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * str1; /* the first xmlChar * */ - int n_str1; - xmlChar * str2; /* the second xmlChar * */ - int n_str2; - int len; /* the max comparison length */ - int n_len; - - for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { - for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - str1 = gen_const_xmlChar_ptr(n_str1, 0); - str2 = gen_const_xmlChar_ptr(n_str2, 1); - len = gen_int(n_len, 2); - - ret_val = xmlStrncasecmp((const xmlChar *)str1, (const xmlChar *)str2, len); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0); - des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrncasecmp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str1); - printf(" %d", n_str2); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrncatNew(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * str1; /* first xmlChar string */ - int n_str1; - xmlChar * str2; /* second xmlChar string */ - int n_str2; - int len; /* the len of @str2 or < 0 */ - int n_len; - - for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { - for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - str1 = gen_const_xmlChar_ptr(n_str1, 0); - str2 = gen_const_xmlChar_ptr(n_str2, 1); - len = gen_int(n_len, 2); - - ret_val = xmlStrncatNew((const xmlChar *)str1, (const xmlChar *)str2, len); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0); - des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrncatNew", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str1); - printf(" %d", n_str2); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrncmp(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * str1; /* the first xmlChar * */ - int n_str1; - xmlChar * str2; /* the second xmlChar * */ - int n_str2; - int len; /* the max comparison length */ - int n_len; - - for (n_str1 = 0;n_str1 < gen_nb_const_xmlChar_ptr;n_str1++) { - for (n_str2 = 0;n_str2 < gen_nb_const_xmlChar_ptr;n_str2++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - str1 = gen_const_xmlChar_ptr(n_str1, 0); - str2 = gen_const_xmlChar_ptr(n_str2, 1); - len = gen_int(n_len, 2); - - ret_val = xmlStrncmp((const xmlChar *)str1, (const xmlChar *)str2, len); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str1, (const xmlChar *)str1, 0); - des_const_xmlChar_ptr(n_str2, (const xmlChar *)str2, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrncmp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str1); - printf(" %d", n_str2); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrndup(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * cur; /* the input xmlChar * */ - int n_cur; - int len; /* the len of @cur */ - int n_len; - - for (n_cur = 0;n_cur < gen_nb_const_xmlChar_ptr;n_cur++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - cur = gen_const_xmlChar_ptr(n_cur, 0); - len = gen_int(n_len, 1); - - ret_val = xmlStrndup((const xmlChar *)cur, len); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_cur, (const xmlChar *)cur, 0); - des_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrndup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrstr(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlChar * str; /* the xmlChar * array (haystack) */ - int n_str; - xmlChar * val; /* the xmlChar to search (needle) */ - int n_val; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - val = gen_const_xmlChar_ptr(n_val, 1); - - ret_val = xmlStrstr((const xmlChar *)str, (const xmlChar *)val); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrstr", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlStrsub(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * str; /* the xmlChar * array (haystack) */ - int n_str; - int start; /* the index of the first char (zero based) */ - int n_start; - int len; /* the length of the substring */ - int n_len; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_start = 0;n_start < gen_nb_int;n_start++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - start = gen_int(n_start, 1); - len = gen_int(n_len, 2); - - ret_val = xmlStrsub((const xmlChar *)str, start, len); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - des_int(n_start, start, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlStrsub", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf(" %d", n_start); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlUTF8Charcmp(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * utf1; /* pointer to first UTF8 char */ - int n_utf1; - xmlChar * utf2; /* pointer to second UTF8 char */ - int n_utf2; - - for (n_utf1 = 0;n_utf1 < gen_nb_const_xmlChar_ptr;n_utf1++) { - for (n_utf2 = 0;n_utf2 < gen_nb_const_xmlChar_ptr;n_utf2++) { - mem_base = xmlMemBlocks(); - utf1 = gen_const_xmlChar_ptr(n_utf1, 0); - utf2 = gen_const_xmlChar_ptr(n_utf2, 1); - - ret_val = xmlUTF8Charcmp((const xmlChar *)utf1, (const xmlChar *)utf2); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_utf1, (const xmlChar *)utf1, 0); - des_const_xmlChar_ptr(n_utf2, (const xmlChar *)utf2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUTF8Charcmp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_utf1); - printf(" %d", n_utf2); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlUTF8Size(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * utf; /* pointer to the UTF8 character */ - int n_utf; - - for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { - mem_base = xmlMemBlocks(); - utf = gen_const_xmlChar_ptr(n_utf, 0); - - ret_val = xmlUTF8Size((const xmlChar *)utf); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUTF8Size", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_utf); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlUTF8Strlen(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * utf; /* a sequence of UTF-8 encoded bytes */ - int n_utf; - - for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { - mem_base = xmlMemBlocks(); - utf = gen_const_xmlChar_ptr(n_utf, 0); - - ret_val = xmlUTF8Strlen((const xmlChar *)utf); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUTF8Strlen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_utf); - printf("\n"); - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlUTF8Strloc(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * utf; /* the input UTF8 * */ - int n_utf; - xmlChar * utfchar; /* the UTF8 character to be found */ - int n_utfchar; - - for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { - for (n_utfchar = 0;n_utfchar < gen_nb_const_xmlChar_ptr;n_utfchar++) { - mem_base = xmlMemBlocks(); - utf = gen_const_xmlChar_ptr(n_utf, 0); - utfchar = gen_const_xmlChar_ptr(n_utfchar, 1); - - ret_val = xmlUTF8Strloc((const xmlChar *)utf, (const xmlChar *)utfchar); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0); - des_const_xmlChar_ptr(n_utfchar, (const xmlChar *)utfchar, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUTF8Strloc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_utf); - printf(" %d", n_utfchar); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlUTF8Strndup(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * utf; /* the input UTF8 * */ - int n_utf; - int len; /* the len of @utf (in chars) */ - int n_len; - - for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - utf = gen_const_xmlChar_ptr(n_utf, 0); - len = gen_int(n_len, 1); - - ret_val = xmlUTF8Strndup((const xmlChar *)utf, len); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0); - des_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUTF8Strndup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_utf); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlUTF8Strpos(void) { - int test_ret = 0; - - int mem_base; - const xmlChar * ret_val; - xmlChar * utf; /* the input UTF8 * */ - int n_utf; - int pos; /* the position of the desired UTF8 char (in chars) */ - int n_pos; - - for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { - for (n_pos = 0;n_pos < gen_nb_int;n_pos++) { - mem_base = xmlMemBlocks(); - utf = gen_const_xmlChar_ptr(n_utf, 0); - pos = gen_int(n_pos, 1); - - ret_val = xmlUTF8Strpos((const xmlChar *)utf, pos); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0); - des_int(n_pos, pos, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUTF8Strpos", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_utf); - printf(" %d", n_pos); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlUTF8Strsize(void) { - int test_ret = 0; - - int mem_base; - int ret_val; - xmlChar * utf; /* a sequence of UTF-8 encoded bytes */ - int n_utf; - int len; /* the number of characters in the array */ - int n_len; - - for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - utf = gen_const_xmlChar_ptr(n_utf, 0); - len = gen_int(n_len, 1); - - ret_val = xmlUTF8Strsize((const xmlChar *)utf, len); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0); - des_int(n_len, len, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUTF8Strsize", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_utf); - printf(" %d", n_len); - printf("\n"); - } - } - } - function_tests++; - - return(test_ret); -} - - -static int -test_xmlUTF8Strsub(void) { - int test_ret = 0; - - int mem_base; - xmlChar * ret_val; - xmlChar * utf; /* a sequence of UTF-8 encoded bytes */ - int n_utf; - int start; /* relative pos of first char */ - int n_start; - int len; /* total number to copy */ - int n_len; - - for (n_utf = 0;n_utf < gen_nb_const_xmlChar_ptr;n_utf++) { - for (n_start = 0;n_start < gen_nb_int;n_start++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - utf = gen_const_xmlChar_ptr(n_utf, 0); - start = gen_int(n_start, 1); - len = gen_int(n_len, 2); - - ret_val = xmlUTF8Strsub((const xmlChar *)utf, start, len); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_utf, (const xmlChar *)utf, 0); - des_int(n_start, start, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUTF8Strsub", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_utf); - printf(" %d", n_start); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; - - return(test_ret); -} - -static int -test_xmlstring(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlstring : 26 of 30 functions ...\n"); - test_ret += test_xmlCharStrdup(); - test_ret += test_xmlCharStrndup(); - test_ret += test_xmlCheckUTF8(); - test_ret += test_xmlGetUTF8Char(); - test_ret += test_xmlStrEqual(); - test_ret += test_xmlStrPrintf(); - test_ret += test_xmlStrQEqual(); - test_ret += test_xmlStrVPrintf(); - test_ret += test_xmlStrcasecmp(); - test_ret += test_xmlStrcasestr(); - test_ret += test_xmlStrchr(); - test_ret += test_xmlStrcmp(); - test_ret += test_xmlStrdup(); - test_ret += test_xmlStrlen(); - test_ret += test_xmlStrncasecmp(); - test_ret += test_xmlStrncatNew(); - test_ret += test_xmlStrncmp(); - test_ret += test_xmlStrndup(); - test_ret += test_xmlStrstr(); - test_ret += test_xmlStrsub(); - test_ret += test_xmlUTF8Charcmp(); - test_ret += test_xmlUTF8Size(); - test_ret += test_xmlUTF8Strlen(); - test_ret += test_xmlUTF8Strloc(); - test_ret += test_xmlUTF8Strndup(); - test_ret += test_xmlUTF8Strpos(); - test_ret += test_xmlUTF8Strsize(); - test_ret += test_xmlUTF8Strsub(); - - if (test_ret != 0) - printf("Module xmlstring: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlUCSIsAegeanNumbers(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsAegeanNumbers(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsAegeanNumbers", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsAlphabeticPresentationForms(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsAlphabeticPresentationForms(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsAlphabeticPresentationForms", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsArabic(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsArabic(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsArabic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsArabicPresentationFormsA(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsArabicPresentationFormsA(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsA", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsArabicPresentationFormsB(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsArabicPresentationFormsB(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsArabicPresentationFormsB", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsArmenian(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsArmenian(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsArmenian", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsArrows(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsArrows(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsArrows", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsBasicLatin(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsBasicLatin(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsBasicLatin", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsBengali(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsBengali(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsBengali", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsBlock(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - char * block; /* UCS block name */ - int n_block; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - for (n_block = 0;n_block < gen_nb_const_char_ptr;n_block++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - block = gen_const_char_ptr(n_block, 1); - - ret_val = xmlUCSIsBlock(code, (const char *)block); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - des_const_char_ptr(n_block, (const char *)block, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsBlock", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf(" %d", n_block); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsBlockElements(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsBlockElements(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsBlockElements", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsBopomofo(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsBopomofo(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsBopomofo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsBopomofoExtended(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsBopomofoExtended(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsBopomofoExtended", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsBoxDrawing(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsBoxDrawing(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsBoxDrawing", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsBraillePatterns(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsBraillePatterns(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsBraillePatterns", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsBuhid(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsBuhid(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsBuhid", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsByzantineMusicalSymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsByzantineMusicalSymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsByzantineMusicalSymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCJKCompatibility(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCJKCompatibility(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCJKCompatibility", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCJKCompatibilityForms(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCJKCompatibilityForms(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityForms", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCJKCompatibilityIdeographs(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCJKCompatibilityIdeographs(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCJKCompatibilityIdeographsSupplement(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCJKCompatibilityIdeographsSupplement(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCJKCompatibilityIdeographsSupplement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCJKRadicalsSupplement(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCJKRadicalsSupplement(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCJKRadicalsSupplement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCJKSymbolsandPunctuation(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCJKSymbolsandPunctuation(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCJKSymbolsandPunctuation", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCJKUnifiedIdeographs(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCJKUnifiedIdeographs(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCJKUnifiedIdeographsExtensionA(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionA(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionA", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCJKUnifiedIdeographsExtensionB(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCJKUnifiedIdeographsExtensionB(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCJKUnifiedIdeographsExtensionB", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCat(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - char * cat; /* UCS Category name */ - int n_cat; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - for (n_cat = 0;n_cat < gen_nb_const_char_ptr;n_cat++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - cat = gen_const_char_ptr(n_cat, 1); - - ret_val = xmlUCSIsCat(code, (const char *)cat); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - des_const_char_ptr(n_cat, (const char *)cat, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCat", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf(" %d", n_cat); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatC(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatC(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatC", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatCc(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatCc(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatCc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatCf(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatCf(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatCf", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatCo(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatCo(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatCo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatCs(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatCs(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatCs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatL(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatL(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatL", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatLl(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatLl(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatLl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatLm(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatLm(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatLm", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatLo(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatLo(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatLo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatLt(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatLt(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatLt", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatLu(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatLu(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatLu", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatM(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatM(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatM", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatMc(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatMc(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatMc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatMe(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatMe(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatMe", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatMn(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatMn(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatMn", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatN(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatN(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatN", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatNd(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatNd(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatNd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatNl(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatNl(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatNl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatNo(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatNo(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatNo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatP(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatP(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatP", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatPc(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatPc(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatPc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatPd(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatPd(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatPd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatPe(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatPe(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatPe", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatPf(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatPf(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatPf", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatPi(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatPi(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatPi", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatPo(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatPo(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatPo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatPs(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatPs(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatPs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatS(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatS(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatS", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatSc(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatSc(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatSc", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatSk(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatSk(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatSk", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatSm(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatSm(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatSm", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatSo(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatSo(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatSo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatZ(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatZ(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatZ", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatZl(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatZl(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatZl", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatZp(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatZp(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatZp", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCatZs(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCatZs(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCatZs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCherokee(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCherokee(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCherokee", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCombiningDiacriticalMarks(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCombiningDiacriticalMarks(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarks", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCombiningDiacriticalMarksforSymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCombiningDiacriticalMarksforSymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCombiningDiacriticalMarksforSymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCombiningHalfMarks(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCombiningHalfMarks(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCombiningHalfMarks", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCombiningMarksforSymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCombiningMarksforSymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCombiningMarksforSymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsControlPictures(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsControlPictures(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsControlPictures", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCurrencySymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCurrencySymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCurrencySymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCypriotSyllabary(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCypriotSyllabary(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCypriotSyllabary", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCyrillic(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCyrillic(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCyrillic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsCyrillicSupplement(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsCyrillicSupplement(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsCyrillicSupplement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsDeseret(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsDeseret(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsDeseret", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsDevanagari(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsDevanagari(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsDevanagari", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsDingbats(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsDingbats(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsDingbats", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsEnclosedAlphanumerics(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsEnclosedAlphanumerics(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsEnclosedAlphanumerics", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsEnclosedCJKLettersandMonths(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsEnclosedCJKLettersandMonths(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsEnclosedCJKLettersandMonths", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsEthiopic(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsEthiopic(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsEthiopic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsGeneralPunctuation(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsGeneralPunctuation(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsGeneralPunctuation", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsGeometricShapes(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsGeometricShapes(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsGeometricShapes", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsGeorgian(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsGeorgian(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsGeorgian", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsGothic(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsGothic(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsGothic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsGreek(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsGreek(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsGreek", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsGreekExtended(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsGreekExtended(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsGreekExtended", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsGreekandCoptic(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsGreekandCoptic(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsGreekandCoptic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsGujarati(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsGujarati(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsGujarati", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsGurmukhi(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsGurmukhi(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsGurmukhi", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsHalfwidthandFullwidthForms(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsHalfwidthandFullwidthForms(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsHalfwidthandFullwidthForms", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsHangulCompatibilityJamo(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsHangulCompatibilityJamo(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsHangulCompatibilityJamo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsHangulJamo(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsHangulJamo(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsHangulJamo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsHangulSyllables(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsHangulSyllables(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsHangulSyllables", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsHanunoo(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsHanunoo(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsHanunoo", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsHebrew(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsHebrew(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsHebrew", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsHighPrivateUseSurrogates(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsHighPrivateUseSurrogates(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsHighPrivateUseSurrogates", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsHighSurrogates(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsHighSurrogates(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsHighSurrogates", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsHiragana(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsHiragana(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsHiragana", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsIPAExtensions(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsIPAExtensions(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsIPAExtensions", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsIdeographicDescriptionCharacters(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsIdeographicDescriptionCharacters(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsIdeographicDescriptionCharacters", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsKanbun(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsKanbun(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsKanbun", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsKangxiRadicals(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsKangxiRadicals(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsKangxiRadicals", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsKannada(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsKannada(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsKannada", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsKatakana(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsKatakana(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsKatakana", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsKatakanaPhoneticExtensions(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsKatakanaPhoneticExtensions(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsKatakanaPhoneticExtensions", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsKhmer(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsKhmer(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsKhmer", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsKhmerSymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsKhmerSymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsKhmerSymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsLao(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsLao(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsLao", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsLatin1Supplement(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsLatin1Supplement(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsLatin1Supplement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsLatinExtendedA(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsLatinExtendedA(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsLatinExtendedA", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsLatinExtendedAdditional(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsLatinExtendedAdditional(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsLatinExtendedAdditional", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsLatinExtendedB(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsLatinExtendedB(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsLatinExtendedB", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsLetterlikeSymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsLetterlikeSymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsLetterlikeSymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsLimbu(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsLimbu(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsLimbu", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsLinearBIdeograms(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsLinearBIdeograms(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsLinearBIdeograms", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsLinearBSyllabary(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsLinearBSyllabary(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsLinearBSyllabary", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsLowSurrogates(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsLowSurrogates(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsLowSurrogates", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMalayalam(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMalayalam(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMalayalam", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMathematicalAlphanumericSymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMathematicalAlphanumericSymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMathematicalAlphanumericSymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMathematicalOperators(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMathematicalOperators(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMathematicalOperators", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMiscellaneousMathematicalSymbolsA(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsA(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsA", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMiscellaneousMathematicalSymbolsB(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMiscellaneousMathematicalSymbolsB(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMiscellaneousMathematicalSymbolsB", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMiscellaneousSymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMiscellaneousSymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMiscellaneousSymbolsandArrows(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMiscellaneousSymbolsandArrows(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMiscellaneousSymbolsandArrows", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMiscellaneousTechnical(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMiscellaneousTechnical(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMiscellaneousTechnical", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMongolian(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMongolian(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMongolian", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMusicalSymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMusicalSymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMusicalSymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsMyanmar(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsMyanmar(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsMyanmar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsNumberForms(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsNumberForms(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsNumberForms", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsOgham(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsOgham(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsOgham", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsOldItalic(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsOldItalic(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsOldItalic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsOpticalCharacterRecognition(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsOpticalCharacterRecognition(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsOpticalCharacterRecognition", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsOriya(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsOriya(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsOriya", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsOsmanya(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsOsmanya(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsOsmanya", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsPhoneticExtensions(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsPhoneticExtensions(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsPhoneticExtensions", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsPrivateUse(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsPrivateUse(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsPrivateUse", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsPrivateUseArea(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsPrivateUseArea(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsPrivateUseArea", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsRunic(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsRunic(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsRunic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsShavian(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsShavian(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsShavian", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSinhala(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSinhala(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSinhala", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSmallFormVariants(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSmallFormVariants(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSmallFormVariants", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSpacingModifierLetters(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSpacingModifierLetters(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSpacingModifierLetters", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSpecials(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSpecials(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSpecials", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSuperscriptsandSubscripts(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSuperscriptsandSubscripts(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSuperscriptsandSubscripts", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSupplementalArrowsA(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSupplementalArrowsA(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsA", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSupplementalArrowsB(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSupplementalArrowsB(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSupplementalArrowsB", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSupplementalMathematicalOperators(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSupplementalMathematicalOperators(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSupplementalMathematicalOperators", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSupplementaryPrivateUseAreaA(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSupplementaryPrivateUseAreaA(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaA", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSupplementaryPrivateUseAreaB(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSupplementaryPrivateUseAreaB(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSupplementaryPrivateUseAreaB", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsSyriac(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsSyriac(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsSyriac", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsTagalog(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsTagalog(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsTagalog", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsTagbanwa(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsTagbanwa(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsTagbanwa", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsTags(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsTags(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsTags", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsTaiLe(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsTaiLe(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsTaiLe", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsTaiXuanJingSymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsTaiXuanJingSymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsTaiXuanJingSymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsTamil(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsTamil(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsTamil", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsTelugu(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsTelugu(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsTelugu", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsThaana(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsThaana(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsThaana", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsThai(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsThai(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsThai", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsTibetan(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsTibetan(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsTibetan", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsUgaritic(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsUgaritic(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsUgaritic", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsUnifiedCanadianAboriginalSyllabics(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsUnifiedCanadianAboriginalSyllabics", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsVariationSelectors(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsVariationSelectors(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsVariationSelectors", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsVariationSelectorsSupplement(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsVariationSelectorsSupplement(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsVariationSelectorsSupplement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsYiRadicals(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsYiRadicals(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsYiRadicals", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsYiSyllables(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsYiSyllables(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsYiSyllables", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlUCSIsYijingHexagramSymbols(void) { - int test_ret = 0; - -#if defined(LIBXML_UNICODE_ENABLED) - int mem_base; - int ret_val; - int code; /* UCS code point */ - int n_code; - - for (n_code = 0;n_code < gen_nb_int;n_code++) { - mem_base = xmlMemBlocks(); - code = gen_int(n_code, 0); - - ret_val = xmlUCSIsYijingHexagramSymbols(code); - desret_int(ret_val); - call_tests++; - des_int(n_code, code, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlUCSIsYijingHexagramSymbols", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_code); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xmlunicode(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlunicode : 166 of 166 functions ...\n"); - test_ret += test_xmlUCSIsAegeanNumbers(); - test_ret += test_xmlUCSIsAlphabeticPresentationForms(); - test_ret += test_xmlUCSIsArabic(); - test_ret += test_xmlUCSIsArabicPresentationFormsA(); - test_ret += test_xmlUCSIsArabicPresentationFormsB(); - test_ret += test_xmlUCSIsArmenian(); - test_ret += test_xmlUCSIsArrows(); - test_ret += test_xmlUCSIsBasicLatin(); - test_ret += test_xmlUCSIsBengali(); - test_ret += test_xmlUCSIsBlock(); - test_ret += test_xmlUCSIsBlockElements(); - test_ret += test_xmlUCSIsBopomofo(); - test_ret += test_xmlUCSIsBopomofoExtended(); - test_ret += test_xmlUCSIsBoxDrawing(); - test_ret += test_xmlUCSIsBraillePatterns(); - test_ret += test_xmlUCSIsBuhid(); - test_ret += test_xmlUCSIsByzantineMusicalSymbols(); - test_ret += test_xmlUCSIsCJKCompatibility(); - test_ret += test_xmlUCSIsCJKCompatibilityForms(); - test_ret += test_xmlUCSIsCJKCompatibilityIdeographs(); - test_ret += test_xmlUCSIsCJKCompatibilityIdeographsSupplement(); - test_ret += test_xmlUCSIsCJKRadicalsSupplement(); - test_ret += test_xmlUCSIsCJKSymbolsandPunctuation(); - test_ret += test_xmlUCSIsCJKUnifiedIdeographs(); - test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionA(); - test_ret += test_xmlUCSIsCJKUnifiedIdeographsExtensionB(); - test_ret += test_xmlUCSIsCat(); - test_ret += test_xmlUCSIsCatC(); - test_ret += test_xmlUCSIsCatCc(); - test_ret += test_xmlUCSIsCatCf(); - test_ret += test_xmlUCSIsCatCo(); - test_ret += test_xmlUCSIsCatCs(); - test_ret += test_xmlUCSIsCatL(); - test_ret += test_xmlUCSIsCatLl(); - test_ret += test_xmlUCSIsCatLm(); - test_ret += test_xmlUCSIsCatLo(); - test_ret += test_xmlUCSIsCatLt(); - test_ret += test_xmlUCSIsCatLu(); - test_ret += test_xmlUCSIsCatM(); - test_ret += test_xmlUCSIsCatMc(); - test_ret += test_xmlUCSIsCatMe(); - test_ret += test_xmlUCSIsCatMn(); - test_ret += test_xmlUCSIsCatN(); - test_ret += test_xmlUCSIsCatNd(); - test_ret += test_xmlUCSIsCatNl(); - test_ret += test_xmlUCSIsCatNo(); - test_ret += test_xmlUCSIsCatP(); - test_ret += test_xmlUCSIsCatPc(); - test_ret += test_xmlUCSIsCatPd(); - test_ret += test_xmlUCSIsCatPe(); - test_ret += test_xmlUCSIsCatPf(); - test_ret += test_xmlUCSIsCatPi(); - test_ret += test_xmlUCSIsCatPo(); - test_ret += test_xmlUCSIsCatPs(); - test_ret += test_xmlUCSIsCatS(); - test_ret += test_xmlUCSIsCatSc(); - test_ret += test_xmlUCSIsCatSk(); - test_ret += test_xmlUCSIsCatSm(); - test_ret += test_xmlUCSIsCatSo(); - test_ret += test_xmlUCSIsCatZ(); - test_ret += test_xmlUCSIsCatZl(); - test_ret += test_xmlUCSIsCatZp(); - test_ret += test_xmlUCSIsCatZs(); - test_ret += test_xmlUCSIsCherokee(); - test_ret += test_xmlUCSIsCombiningDiacriticalMarks(); - test_ret += test_xmlUCSIsCombiningDiacriticalMarksforSymbols(); - test_ret += test_xmlUCSIsCombiningHalfMarks(); - test_ret += test_xmlUCSIsCombiningMarksforSymbols(); - test_ret += test_xmlUCSIsControlPictures(); - test_ret += test_xmlUCSIsCurrencySymbols(); - test_ret += test_xmlUCSIsCypriotSyllabary(); - test_ret += test_xmlUCSIsCyrillic(); - test_ret += test_xmlUCSIsCyrillicSupplement(); - test_ret += test_xmlUCSIsDeseret(); - test_ret += test_xmlUCSIsDevanagari(); - test_ret += test_xmlUCSIsDingbats(); - test_ret += test_xmlUCSIsEnclosedAlphanumerics(); - test_ret += test_xmlUCSIsEnclosedCJKLettersandMonths(); - test_ret += test_xmlUCSIsEthiopic(); - test_ret += test_xmlUCSIsGeneralPunctuation(); - test_ret += test_xmlUCSIsGeometricShapes(); - test_ret += test_xmlUCSIsGeorgian(); - test_ret += test_xmlUCSIsGothic(); - test_ret += test_xmlUCSIsGreek(); - test_ret += test_xmlUCSIsGreekExtended(); - test_ret += test_xmlUCSIsGreekandCoptic(); - test_ret += test_xmlUCSIsGujarati(); - test_ret += test_xmlUCSIsGurmukhi(); - test_ret += test_xmlUCSIsHalfwidthandFullwidthForms(); - test_ret += test_xmlUCSIsHangulCompatibilityJamo(); - test_ret += test_xmlUCSIsHangulJamo(); - test_ret += test_xmlUCSIsHangulSyllables(); - test_ret += test_xmlUCSIsHanunoo(); - test_ret += test_xmlUCSIsHebrew(); - test_ret += test_xmlUCSIsHighPrivateUseSurrogates(); - test_ret += test_xmlUCSIsHighSurrogates(); - test_ret += test_xmlUCSIsHiragana(); - test_ret += test_xmlUCSIsIPAExtensions(); - test_ret += test_xmlUCSIsIdeographicDescriptionCharacters(); - test_ret += test_xmlUCSIsKanbun(); - test_ret += test_xmlUCSIsKangxiRadicals(); - test_ret += test_xmlUCSIsKannada(); - test_ret += test_xmlUCSIsKatakana(); - test_ret += test_xmlUCSIsKatakanaPhoneticExtensions(); - test_ret += test_xmlUCSIsKhmer(); - test_ret += test_xmlUCSIsKhmerSymbols(); - test_ret += test_xmlUCSIsLao(); - test_ret += test_xmlUCSIsLatin1Supplement(); - test_ret += test_xmlUCSIsLatinExtendedA(); - test_ret += test_xmlUCSIsLatinExtendedAdditional(); - test_ret += test_xmlUCSIsLatinExtendedB(); - test_ret += test_xmlUCSIsLetterlikeSymbols(); - test_ret += test_xmlUCSIsLimbu(); - test_ret += test_xmlUCSIsLinearBIdeograms(); - test_ret += test_xmlUCSIsLinearBSyllabary(); - test_ret += test_xmlUCSIsLowSurrogates(); - test_ret += test_xmlUCSIsMalayalam(); - test_ret += test_xmlUCSIsMathematicalAlphanumericSymbols(); - test_ret += test_xmlUCSIsMathematicalOperators(); - test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsA(); - test_ret += test_xmlUCSIsMiscellaneousMathematicalSymbolsB(); - test_ret += test_xmlUCSIsMiscellaneousSymbols(); - test_ret += test_xmlUCSIsMiscellaneousSymbolsandArrows(); - test_ret += test_xmlUCSIsMiscellaneousTechnical(); - test_ret += test_xmlUCSIsMongolian(); - test_ret += test_xmlUCSIsMusicalSymbols(); - test_ret += test_xmlUCSIsMyanmar(); - test_ret += test_xmlUCSIsNumberForms(); - test_ret += test_xmlUCSIsOgham(); - test_ret += test_xmlUCSIsOldItalic(); - test_ret += test_xmlUCSIsOpticalCharacterRecognition(); - test_ret += test_xmlUCSIsOriya(); - test_ret += test_xmlUCSIsOsmanya(); - test_ret += test_xmlUCSIsPhoneticExtensions(); - test_ret += test_xmlUCSIsPrivateUse(); - test_ret += test_xmlUCSIsPrivateUseArea(); - test_ret += test_xmlUCSIsRunic(); - test_ret += test_xmlUCSIsShavian(); - test_ret += test_xmlUCSIsSinhala(); - test_ret += test_xmlUCSIsSmallFormVariants(); - test_ret += test_xmlUCSIsSpacingModifierLetters(); - test_ret += test_xmlUCSIsSpecials(); - test_ret += test_xmlUCSIsSuperscriptsandSubscripts(); - test_ret += test_xmlUCSIsSupplementalArrowsA(); - test_ret += test_xmlUCSIsSupplementalArrowsB(); - test_ret += test_xmlUCSIsSupplementalMathematicalOperators(); - test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaA(); - test_ret += test_xmlUCSIsSupplementaryPrivateUseAreaB(); - test_ret += test_xmlUCSIsSyriac(); - test_ret += test_xmlUCSIsTagalog(); - test_ret += test_xmlUCSIsTagbanwa(); - test_ret += test_xmlUCSIsTags(); - test_ret += test_xmlUCSIsTaiLe(); - test_ret += test_xmlUCSIsTaiXuanJingSymbols(); - test_ret += test_xmlUCSIsTamil(); - test_ret += test_xmlUCSIsTelugu(); - test_ret += test_xmlUCSIsThaana(); - test_ret += test_xmlUCSIsThai(); - test_ret += test_xmlUCSIsTibetan(); - test_ret += test_xmlUCSIsUgaritic(); - test_ret += test_xmlUCSIsUnifiedCanadianAboriginalSyllabics(); - test_ret += test_xmlUCSIsVariationSelectors(); - test_ret += test_xmlUCSIsVariationSelectorsSupplement(); - test_ret += test_xmlUCSIsYiRadicals(); - test_ret += test_xmlUCSIsYiSyllables(); - test_ret += test_xmlUCSIsYijingHexagramSymbols(); - - if (test_ret != 0) - printf("Module xmlunicode: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlNewTextWriter(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - xmlTextWriterPtr ret_val; - xmlOutputBufferPtr out; /* an xmlOutputBufferPtr */ - int n_out; - - for (n_out = 0;n_out < gen_nb_xmlOutputBufferPtr;n_out++) { - mem_base = xmlMemBlocks(); - out = gen_xmlOutputBufferPtr(n_out, 0); - - ret_val = xmlNewTextWriter(out); - if (ret_val != NULL) out = NULL; - desret_xmlTextWriterPtr(ret_val); - call_tests++; - des_xmlOutputBufferPtr(n_out, out, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewTextWriter", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_out); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNewTextWriterFilename(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - xmlTextWriterPtr ret_val; - const char * uri; /* the URI of the resource for the output */ - int n_uri; - int compression; /* compress the output? */ - int n_compression; - - for (n_uri = 0;n_uri < gen_nb_fileoutput;n_uri++) { - for (n_compression = 0;n_compression < gen_nb_int;n_compression++) { - mem_base = xmlMemBlocks(); - uri = gen_fileoutput(n_uri, 0); - compression = gen_int(n_compression, 1); - - ret_val = xmlNewTextWriterFilename(uri, compression); - desret_xmlTextWriterPtr(ret_val); - call_tests++; - des_fileoutput(n_uri, uri, 0); - des_int(n_compression, compression, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewTextWriterFilename", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_uri); - printf(" %d", n_compression); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNewTextWriterMemory(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - xmlTextWriterPtr ret_val; - xmlBufferPtr buf; /* xmlBufferPtr */ - int n_buf; - int compression; /* compress the output? */ - int n_compression; - - for (n_buf = 0;n_buf < gen_nb_xmlBufferPtr;n_buf++) { - for (n_compression = 0;n_compression < gen_nb_int;n_compression++) { - mem_base = xmlMemBlocks(); - buf = gen_xmlBufferPtr(n_buf, 0); - compression = gen_int(n_compression, 1); - - ret_val = xmlNewTextWriterMemory(buf, compression); - desret_xmlTextWriterPtr(ret_val); - call_tests++; - des_xmlBufferPtr(n_buf, buf, 0); - des_int(n_compression, compression, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewTextWriterMemory", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_buf); - printf(" %d", n_compression); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNewTextWriterPushParser(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - xmlTextWriterPtr ret_val; - xmlParserCtxtPtr ctxt; /* xmlParserCtxtPtr to hold the new XML document tree */ - int n_ctxt; - int compression; /* compress the output? */ - int n_compression; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) { - for (n_compression = 0;n_compression < gen_nb_int;n_compression++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0); - compression = gen_int(n_compression, 1); - - ret_val = xmlNewTextWriterPushParser(ctxt, compression); - if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;} if (ret_val != NULL) ctxt = NULL; - desret_xmlTextWriterPtr(ret_val); - call_tests++; - des_xmlParserCtxtPtr(n_ctxt, ctxt, 0); - des_int(n_compression, compression, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewTextWriterPushParser", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_compression); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlNewTextWriterTree(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - xmlTextWriterPtr ret_val; - xmlDocPtr doc; /* xmlDocPtr */ - int n_doc; - xmlNodePtr node; /* xmlNodePtr or NULL for doc->children */ - int n_node; - int compression; /* compress the output? */ - int n_compression; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_compression = 0;n_compression < gen_nb_int;n_compression++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - node = gen_xmlNodePtr(n_node, 1); - compression = gen_int(n_compression, 2); - - ret_val = xmlNewTextWriterTree(doc, node, compression); - desret_xmlTextWriterPtr(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - des_xmlNodePtr(n_node, node, 1); - des_int(n_compression, compression, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlNewTextWriterTree", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf(" %d", n_node); - printf(" %d", n_compression); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterEndAttribute(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterEndAttribute(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterEndAttribute", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterEndCDATA(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterEndCDATA(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterEndCDATA", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterEndComment(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterEndComment(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterEndComment", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterEndDTD(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterEndDTD(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterEndDTD", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterEndDTDAttlist(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterEndDTDAttlist(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterEndDTDAttlist", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterEndDTDElement(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterEndDTDElement(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterEndDTDElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterEndDTDEntity(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterEndDTDEntity(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterEndDTDEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterEndDocument(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterEndDocument(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterEndDocument", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterEndElement(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterEndElement(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterEndElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterEndPI(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterEndPI(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterEndPI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterFlush(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterFlush(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterFlush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterFullEndElement(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterFullEndElement(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterFullEndElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterSetIndent(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - int indent; /* do indentation? */ - int n_indent; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_indent = 0;n_indent < gen_nb_int;n_indent++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - indent = gen_int(n_indent, 1); - - ret_val = xmlTextWriterSetIndent(writer, indent); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_int(n_indent, indent, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterSetIndent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_indent); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterSetIndentString(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * str; /* the xmlChar string */ - int n_str; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - str = gen_const_xmlChar_ptr(n_str, 1); - - ret_val = xmlTextWriterSetIndentString(writer, (const xmlChar *)str); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterSetIndentString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_str); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterSetQuoteChar(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar quotechar; /* the quote character */ - int n_quotechar; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_quotechar = 0;n_quotechar < gen_nb_xmlChar;n_quotechar++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - quotechar = gen_xmlChar(n_quotechar, 1); - - ret_val = xmlTextWriterSetQuoteChar(writer, quotechar); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_xmlChar(n_quotechar, quotechar, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterSetQuoteChar", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_quotechar); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartAttribute(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* element name */ - int n_name; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlTextWriterStartAttribute(writer, (const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartAttribute", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartAttributeNS(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * prefix; /* namespace prefix or NULL */ - int n_prefix; - xmlChar * name; /* element local name */ - int n_name; - xmlChar * namespaceURI; /* namespace URI or NULL */ - int n_namespaceURI; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3); - - ret_val = xmlTextWriterStartAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartAttributeNS", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_prefix); - printf(" %d", n_name); - printf(" %d", n_namespaceURI); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartCDATA(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterStartCDATA(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartCDATA", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartComment(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - - ret_val = xmlTextWriterStartComment(writer); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartComment", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartDTD(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* the name of the DTD */ - int n_name; - xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ - int n_pubid; - xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ - int n_sysid; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { - for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - pubid = gen_const_xmlChar_ptr(n_pubid, 2); - sysid = gen_const_xmlChar_ptr(n_sysid, 3); - - ret_val = xmlTextWriterStartDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2); - des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartDTD", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf(" %d", n_pubid); - printf(" %d", n_sysid); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartDTDAttlist(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* the name of the DTD ATTLIST */ - int n_name; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlTextWriterStartDTDAttlist(writer, (const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartDTDAttlist", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartDTDElement(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* the name of the DTD element */ - int n_name; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlTextWriterStartDTDElement(writer, (const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartDTDElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartDTDEntity(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - int pe; /* TRUE if this is a parameter entity, FALSE if not */ - int n_pe; - xmlChar * name; /* the name of the DTD ATTLIST */ - int n_name; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_pe = 0;n_pe < gen_nb_int;n_pe++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - pe = gen_int(n_pe, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - - ret_val = xmlTextWriterStartDTDEntity(writer, pe, (const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_int(n_pe, pe, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartDTDEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_pe); - printf(" %d", n_name); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartDocument(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - char * version; /* the xml version ("1.0") or NULL for default ("1.0") */ - int n_version; - char * encoding; /* the encoding or NULL for default */ - int n_encoding; - char * standalone; /* "yes" or "no" or NULL for default */ - int n_standalone; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_version = 0;n_version < gen_nb_const_char_ptr;n_version++) { - for (n_encoding = 0;n_encoding < gen_nb_const_char_ptr;n_encoding++) { - for (n_standalone = 0;n_standalone < gen_nb_const_char_ptr;n_standalone++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - version = gen_const_char_ptr(n_version, 1); - encoding = gen_const_char_ptr(n_encoding, 2); - standalone = gen_const_char_ptr(n_standalone, 3); - - ret_val = xmlTextWriterStartDocument(writer, (const char *)version, (const char *)encoding, (const char *)standalone); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_char_ptr(n_version, (const char *)version, 1); - des_const_char_ptr(n_encoding, (const char *)encoding, 2); - des_const_char_ptr(n_standalone, (const char *)standalone, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartDocument", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_version); - printf(" %d", n_encoding); - printf(" %d", n_standalone); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartElement(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* element name */ - int n_name; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlTextWriterStartElement(writer, (const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartElementNS(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * prefix; /* namespace prefix or NULL */ - int n_prefix; - xmlChar * name; /* element local name */ - int n_name; - xmlChar * namespaceURI; /* namespace URI or NULL */ - int n_namespaceURI; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3); - - ret_val = xmlTextWriterStartElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartElementNS", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_prefix); - printf(" %d", n_name); - printf(" %d", n_namespaceURI); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterStartPI(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * target; /* PI target */ - int n_target; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - target = gen_const_xmlChar_ptr(n_target, 1); - - ret_val = xmlTextWriterStartPI(writer, (const xmlChar *)target); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterStartPI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_target); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteAttribute(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* attribute name */ - int n_name; - xmlChar * content; /* attribute content */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - content = gen_const_xmlChar_ptr(n_content, 2); - - ret_val = xmlTextWriterWriteAttribute(writer, (const xmlChar *)name, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteAttribute", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteAttributeNS(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * prefix; /* namespace prefix */ - int n_prefix; - xmlChar * name; /* attribute local name */ - int n_name; - xmlChar * namespaceURI; /* namespace URI */ - int n_namespaceURI; - xmlChar * content; /* attribute content */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3); - content = gen_const_xmlChar_ptr(n_content, 4); - - ret_val = xmlTextWriterWriteAttributeNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteAttributeNS", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_prefix); - printf(" %d", n_name); - printf(" %d", n_namespaceURI); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteBase64(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - char * data; /* binary data */ - int n_data; - int start; /* the position within the data of the first byte to encode */ - int n_start; - int len; /* the number of bytes to encode */ - int n_len; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) { - for (n_start = 0;n_start < gen_nb_int;n_start++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - data = gen_const_char_ptr(n_data, 1); - start = gen_int(n_start, 2); - len = gen_int(n_len, 3); - - ret_val = xmlTextWriterWriteBase64(writer, (const char *)data, start, len); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_char_ptr(n_data, (const char *)data, 1); - des_int(n_start, start, 2); - des_int(n_len, len, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteBase64", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_data); - printf(" %d", n_start); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteBinHex(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - char * data; /* binary data */ - int n_data; - int start; /* the position within the data of the first byte to encode */ - int n_start; - int len; /* the number of bytes to encode */ - int n_len; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_data = 0;n_data < gen_nb_const_char_ptr;n_data++) { - for (n_start = 0;n_start < gen_nb_int;n_start++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - data = gen_const_char_ptr(n_data, 1); - start = gen_int(n_start, 2); - len = gen_int(n_len, 3); - - ret_val = xmlTextWriterWriteBinHex(writer, (const char *)data, start, len); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_char_ptr(n_data, (const char *)data, 1); - des_int(n_start, start, 2); - des_int(n_len, len, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteBinHex", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_data); - printf(" %d", n_start); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteCDATA(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * content; /* CDATA content */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - - ret_val = xmlTextWriterWriteCDATA(writer, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteCDATA", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_content); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteComment(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * content; /* comment string */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - - ret_val = xmlTextWriterWriteComment(writer, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteComment", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_content); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteDTD(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* the name of the DTD */ - int n_name; - xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ - int n_pubid; - xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ - int n_sysid; - xmlChar * subset; /* string content of the DTD */ - int n_subset; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { - for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { - for (n_subset = 0;n_subset < gen_nb_const_xmlChar_ptr;n_subset++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - pubid = gen_const_xmlChar_ptr(n_pubid, 2); - sysid = gen_const_xmlChar_ptr(n_sysid, 3); - subset = gen_const_xmlChar_ptr(n_subset, 4); - - ret_val = xmlTextWriterWriteDTD(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)subset); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2); - des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3); - des_const_xmlChar_ptr(n_subset, (const xmlChar *)subset, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteDTD", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf(" %d", n_pubid); - printf(" %d", n_sysid); - printf(" %d", n_subset); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteDTDAttlist(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* the name of the DTD ATTLIST */ - int n_name; - xmlChar * content; /* content of the ATTLIST */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - content = gen_const_xmlChar_ptr(n_content, 2); - - ret_val = xmlTextWriterWriteDTDAttlist(writer, (const xmlChar *)name, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteDTDAttlist", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteDTDElement(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* the name of the DTD element */ - int n_name; - xmlChar * content; /* content of the element */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - content = gen_const_xmlChar_ptr(n_content, 2); - - ret_val = xmlTextWriterWriteDTDElement(writer, (const xmlChar *)name, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteDTDElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteDTDEntity(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - int pe; /* TRUE if this is a parameter entity, FALSE if not */ - int n_pe; - xmlChar * name; /* the name of the DTD entity */ - int n_name; - xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ - int n_pubid; - xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ - int n_sysid; - xmlChar * ndataid; /* the xml notation name. */ - int n_ndataid; - xmlChar * content; /* content of the entity */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_pe = 0;n_pe < gen_nb_int;n_pe++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { - for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { - for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - pe = gen_int(n_pe, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - pubid = gen_const_xmlChar_ptr(n_pubid, 3); - sysid = gen_const_xmlChar_ptr(n_sysid, 4); - ndataid = gen_const_xmlChar_ptr(n_ndataid, 5); - content = gen_const_xmlChar_ptr(n_content, 6); - - ret_val = xmlTextWriterWriteDTDEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_int(n_pe, pe, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3); - des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4); - des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 6); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteDTDEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_pe); - printf(" %d", n_name); - printf(" %d", n_pubid); - printf(" %d", n_sysid); - printf(" %d", n_ndataid); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteDTDExternalEntity(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - int pe; /* TRUE if this is a parameter entity, FALSE if not */ - int n_pe; - xmlChar * name; /* the name of the DTD entity */ - int n_name; - xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ - int n_pubid; - xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ - int n_sysid; - xmlChar * ndataid; /* the xml notation name. */ - int n_ndataid; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_pe = 0;n_pe < gen_nb_int;n_pe++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { - for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { - for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - pe = gen_int(n_pe, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - pubid = gen_const_xmlChar_ptr(n_pubid, 3); - sysid = gen_const_xmlChar_ptr(n_sysid, 4); - ndataid = gen_const_xmlChar_ptr(n_ndataid, 5); - - ret_val = xmlTextWriterWriteDTDExternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_int(n_pe, pe, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 3); - des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 4); - des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 5); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_pe); - printf(" %d", n_name); - printf(" %d", n_pubid); - printf(" %d", n_sysid); - printf(" %d", n_ndataid); - printf("\n"); - } - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteDTDExternalEntityContents(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ - int n_pubid; - xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ - int n_sysid; - xmlChar * ndataid; /* the xml notation name. */ - int n_ndataid; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { - for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { - for (n_ndataid = 0;n_ndataid < gen_nb_const_xmlChar_ptr;n_ndataid++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - pubid = gen_const_xmlChar_ptr(n_pubid, 1); - sysid = gen_const_xmlChar_ptr(n_sysid, 2); - ndataid = gen_const_xmlChar_ptr(n_ndataid, 3); - - ret_val = xmlTextWriterWriteDTDExternalEntityContents(writer, (const xmlChar *)pubid, (const xmlChar *)sysid, (const xmlChar *)ndataid); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 1); - des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 2); - des_const_xmlChar_ptr(n_ndataid, (const xmlChar *)ndataid, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteDTDExternalEntityContents", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_pubid); - printf(" %d", n_sysid); - printf(" %d", n_ndataid); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteDTDInternalEntity(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - int pe; /* TRUE if this is a parameter entity, FALSE if not */ - int n_pe; - xmlChar * name; /* the name of the DTD entity */ - int n_name; - xmlChar * content; /* content of the entity */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_pe = 0;n_pe < gen_nb_int;n_pe++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - pe = gen_int(n_pe, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - content = gen_const_xmlChar_ptr(n_content, 3); - - ret_val = xmlTextWriterWriteDTDInternalEntity(writer, pe, (const xmlChar *)name, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_int(n_pe, pe, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteDTDInternalEntity", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_pe); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteDTDNotation(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* the name of the xml notation */ - int n_name; - xmlChar * pubid; /* the public identifier, which is an alternative to the system identifier */ - int n_pubid; - xmlChar * sysid; /* the system identifier, which is the URI of the DTD */ - int n_sysid; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_pubid = 0;n_pubid < gen_nb_const_xmlChar_ptr;n_pubid++) { - for (n_sysid = 0;n_sysid < gen_nb_const_xmlChar_ptr;n_sysid++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - pubid = gen_const_xmlChar_ptr(n_pubid, 2); - sysid = gen_const_xmlChar_ptr(n_sysid, 3); - - ret_val = xmlTextWriterWriteDTDNotation(writer, (const xmlChar *)name, (const xmlChar *)pubid, (const xmlChar *)sysid); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_pubid, (const xmlChar *)pubid, 2); - des_const_xmlChar_ptr(n_sysid, (const xmlChar *)sysid, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteDTDNotation", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf(" %d", n_pubid); - printf(" %d", n_sysid); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteElement(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * name; /* element name */ - int n_name; - xmlChar * content; /* element content */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - content = gen_const_xmlChar_ptr(n_content, 2); - - ret_val = xmlTextWriterWriteElement(writer, (const xmlChar *)name, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteElement", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_name); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteElementNS(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * prefix; /* namespace prefix */ - int n_prefix; - xmlChar * name; /* element local name */ - int n_name; - xmlChar * namespaceURI; /* namespace URI */ - int n_namespaceURI; - xmlChar * content; /* element content */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_namespaceURI = 0;n_namespaceURI < gen_nb_const_xmlChar_ptr;n_namespaceURI++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - name = gen_const_xmlChar_ptr(n_name, 2); - namespaceURI = gen_const_xmlChar_ptr(n_namespaceURI, 3); - content = gen_const_xmlChar_ptr(n_content, 4); - - ret_val = xmlTextWriterWriteElementNS(writer, (const xmlChar *)prefix, (const xmlChar *)name, (const xmlChar *)namespaceURI, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 2); - des_const_xmlChar_ptr(n_namespaceURI, (const xmlChar *)namespaceURI, 3); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 4); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteElementNS", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_prefix); - printf(" %d", n_name); - printf(" %d", n_namespaceURI); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatAttribute(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatAttributeNS(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatCDATA(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatComment(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatDTD(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatDTDAttlist(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatDTDElement(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatDTDInternalEntity(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatElement(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatElementNS(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatPI(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatRaw(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteFormatString(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWritePI(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * target; /* PI target */ - int n_target; - xmlChar * content; /* PI content */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_target = 0;n_target < gen_nb_const_xmlChar_ptr;n_target++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - target = gen_const_xmlChar_ptr(n_target, 1); - content = gen_const_xmlChar_ptr(n_content, 2); - - ret_val = xmlTextWriterWritePI(writer, (const xmlChar *)target, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_target, (const xmlChar *)target, 1); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWritePI", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_target); - printf(" %d", n_content); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteRaw(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * content; /* text string */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - - ret_val = xmlTextWriterWriteRaw(writer, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteRaw", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_content); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteRawLen(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * content; /* text string */ - int n_content; - int len; /* length of the text string */ - int n_len; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - for (n_len = 0;n_len < gen_nb_int;n_len++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - len = gen_int(n_len, 2); - - ret_val = xmlTextWriterWriteRawLen(writer, (const xmlChar *)content, len); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - des_int(n_len, len, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteRawLen", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_content); - printf(" %d", n_len); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteString(void) { - int test_ret = 0; - -#if defined(LIBXML_WRITER_ENABLED) - int mem_base; - int ret_val; - xmlTextWriterPtr writer; /* the xmlTextWriterPtr */ - int n_writer; - xmlChar * content; /* text string */ - int n_content; - - for (n_writer = 0;n_writer < gen_nb_xmlTextWriterPtr;n_writer++) { - for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) { - mem_base = xmlMemBlocks(); - writer = gen_xmlTextWriterPtr(n_writer, 0); - content = gen_const_xmlChar_ptr(n_content, 1); - - ret_val = xmlTextWriterWriteString(writer, (const xmlChar *)content); - desret_int(ret_val); - call_tests++; - des_xmlTextWriterPtr(n_writer, writer, 0); - des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlTextWriterWriteString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_writer); - printf(" %d", n_content); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatAttribute(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatAttributeNS(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatCDATA(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatComment(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatDTD(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatDTDAttlist(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatDTDElement(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatDTDInternalEntity(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatElement(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatElementNS(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatPI(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatRaw(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlTextWriterWriteVFormatString(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -static int -test_xmlwriter(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xmlwriter : 52 of 80 functions ...\n"); - test_ret += test_xmlNewTextWriter(); - test_ret += test_xmlNewTextWriterFilename(); - test_ret += test_xmlNewTextWriterMemory(); - test_ret += test_xmlNewTextWriterPushParser(); - test_ret += test_xmlNewTextWriterTree(); - test_ret += test_xmlTextWriterEndAttribute(); - test_ret += test_xmlTextWriterEndCDATA(); - test_ret += test_xmlTextWriterEndComment(); - test_ret += test_xmlTextWriterEndDTD(); - test_ret += test_xmlTextWriterEndDTDAttlist(); - test_ret += test_xmlTextWriterEndDTDElement(); - test_ret += test_xmlTextWriterEndDTDEntity(); - test_ret += test_xmlTextWriterEndDocument(); - test_ret += test_xmlTextWriterEndElement(); - test_ret += test_xmlTextWriterEndPI(); - test_ret += test_xmlTextWriterFlush(); - test_ret += test_xmlTextWriterFullEndElement(); - test_ret += test_xmlTextWriterSetIndent(); - test_ret += test_xmlTextWriterSetIndentString(); - test_ret += test_xmlTextWriterSetQuoteChar(); - test_ret += test_xmlTextWriterStartAttribute(); - test_ret += test_xmlTextWriterStartAttributeNS(); - test_ret += test_xmlTextWriterStartCDATA(); - test_ret += test_xmlTextWriterStartComment(); - test_ret += test_xmlTextWriterStartDTD(); - test_ret += test_xmlTextWriterStartDTDAttlist(); - test_ret += test_xmlTextWriterStartDTDElement(); - test_ret += test_xmlTextWriterStartDTDEntity(); - test_ret += test_xmlTextWriterStartDocument(); - test_ret += test_xmlTextWriterStartElement(); - test_ret += test_xmlTextWriterStartElementNS(); - test_ret += test_xmlTextWriterStartPI(); - test_ret += test_xmlTextWriterWriteAttribute(); - test_ret += test_xmlTextWriterWriteAttributeNS(); - test_ret += test_xmlTextWriterWriteBase64(); - test_ret += test_xmlTextWriterWriteBinHex(); - test_ret += test_xmlTextWriterWriteCDATA(); - test_ret += test_xmlTextWriterWriteComment(); - test_ret += test_xmlTextWriterWriteDTD(); - test_ret += test_xmlTextWriterWriteDTDAttlist(); - test_ret += test_xmlTextWriterWriteDTDElement(); - test_ret += test_xmlTextWriterWriteDTDEntity(); - test_ret += test_xmlTextWriterWriteDTDExternalEntity(); - test_ret += test_xmlTextWriterWriteDTDExternalEntityContents(); - test_ret += test_xmlTextWriterWriteDTDInternalEntity(); - test_ret += test_xmlTextWriterWriteDTDNotation(); - test_ret += test_xmlTextWriterWriteElement(); - test_ret += test_xmlTextWriterWriteElementNS(); - test_ret += test_xmlTextWriterWriteFormatAttribute(); - test_ret += test_xmlTextWriterWriteFormatAttributeNS(); - test_ret += test_xmlTextWriterWriteFormatCDATA(); - test_ret += test_xmlTextWriterWriteFormatComment(); - test_ret += test_xmlTextWriterWriteFormatDTD(); - test_ret += test_xmlTextWriterWriteFormatDTDAttlist(); - test_ret += test_xmlTextWriterWriteFormatDTDElement(); - test_ret += test_xmlTextWriterWriteFormatDTDInternalEntity(); - test_ret += test_xmlTextWriterWriteFormatElement(); - test_ret += test_xmlTextWriterWriteFormatElementNS(); - test_ret += test_xmlTextWriterWriteFormatPI(); - test_ret += test_xmlTextWriterWriteFormatRaw(); - test_ret += test_xmlTextWriterWriteFormatString(); - test_ret += test_xmlTextWriterWritePI(); - test_ret += test_xmlTextWriterWriteRaw(); - test_ret += test_xmlTextWriterWriteRawLen(); - test_ret += test_xmlTextWriterWriteString(); - test_ret += test_xmlTextWriterWriteVFormatAttribute(); - test_ret += test_xmlTextWriterWriteVFormatAttributeNS(); - test_ret += test_xmlTextWriterWriteVFormatCDATA(); - test_ret += test_xmlTextWriterWriteVFormatComment(); - test_ret += test_xmlTextWriterWriteVFormatDTD(); - test_ret += test_xmlTextWriterWriteVFormatDTDAttlist(); - test_ret += test_xmlTextWriterWriteVFormatDTDElement(); - test_ret += test_xmlTextWriterWriteVFormatDTDInternalEntity(); - test_ret += test_xmlTextWriterWriteVFormatElement(); - test_ret += test_xmlTextWriterWriteVFormatElementNS(); - test_ret += test_xmlTextWriterWriteVFormatPI(); - test_ret += test_xmlTextWriterWriteVFormatRaw(); - test_ret += test_xmlTextWriterWriteVFormatString(); - - if (test_ret != 0) - printf("Module xmlwriter: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlXPathCastBooleanToNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - double ret_val; - int val; /* a boolean */ - int n_val; - - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_int(n_val, 0); - - ret_val = xmlXPathCastBooleanToNumber(val); - desret_double(ret_val); - call_tests++; - des_int(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastBooleanToNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastBooleanToString(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlChar * ret_val; - int val; /* a boolean */ - int n_val; - - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_int(n_val, 0); - - ret_val = xmlXPathCastBooleanToString(val); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_int(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastBooleanToString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastNodeSetToBoolean(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlNodeSetPtr ns; /* a node-set */ - int n_ns; - - for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) { - mem_base = xmlMemBlocks(); - ns = gen_xmlNodeSetPtr(n_ns, 0); - - ret_val = xmlXPathCastNodeSetToBoolean(ns); - desret_int(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_ns, ns, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastNodeSetToBoolean", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ns); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastNodeSetToNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - double ret_val; - xmlNodeSetPtr ns; /* a node-set */ - int n_ns; - - for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) { - mem_base = xmlMemBlocks(); - ns = gen_xmlNodeSetPtr(n_ns, 0); - - ret_val = xmlXPathCastNodeSetToNumber(ns); - desret_double(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_ns, ns, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastNodeSetToNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ns); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastNodeSetToString(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlNodeSetPtr ns; /* a node-set */ - int n_ns; - - for (n_ns = 0;n_ns < gen_nb_xmlNodeSetPtr;n_ns++) { - mem_base = xmlMemBlocks(); - ns = gen_xmlNodeSetPtr(n_ns, 0); - - ret_val = xmlXPathCastNodeSetToString(ns); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_ns, ns, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastNodeSetToString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ns); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastNodeToNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - double ret_val; - xmlNodePtr node; /* a node */ - int n_node; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - - ret_val = xmlXPathCastNodeToNumber(node); - desret_double(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastNodeToNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastNodeToString(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlNodePtr node; /* a node */ - int n_node; - - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - node = gen_xmlNodePtr(n_node, 0); - - ret_val = xmlXPathCastNodeToString(node); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlNodePtr(n_node, node, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastNodeToString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastNumberToBoolean(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - double val; /* a number */ - int n_val; - - for (n_val = 0;n_val < gen_nb_double;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_double(n_val, 0); - - ret_val = xmlXPathCastNumberToBoolean(val); - desret_int(ret_val); - call_tests++; - des_double(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastNumberToBoolean", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastNumberToString(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlChar * ret_val; - double val; /* a number */ - int n_val; - - for (n_val = 0;n_val < gen_nb_double;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_double(n_val, 0); - - ret_val = xmlXPathCastNumberToString(val); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_double(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastNumberToString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastStringToBoolean(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlChar * val; /* a string */ - int n_val; - - for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_const_xmlChar_ptr(n_val, 0); - - ret_val = xmlXPathCastStringToBoolean((const xmlChar *)val); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastStringToBoolean", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastStringToNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - double ret_val; - xmlChar * val; /* a string */ - int n_val; - - for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_const_xmlChar_ptr(n_val, 0); - - ret_val = xmlXPathCastStringToNumber((const xmlChar *)val); - desret_double(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastStringToNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastToBoolean(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathObjectPtr val; /* an XPath object */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlXPathObjectPtr(n_val, 0); - - ret_val = xmlXPathCastToBoolean(val); - desret_int(ret_val); - call_tests++; - des_xmlXPathObjectPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastToBoolean", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastToNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - double ret_val; - xmlXPathObjectPtr val; /* an XPath object */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlXPathObjectPtr(n_val, 0); - - ret_val = xmlXPathCastToNumber(val); - desret_double(ret_val); - call_tests++; - des_xmlXPathObjectPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastToNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCastToString(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlXPathObjectPtr val; /* an XPath object */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlXPathObjectPtr(n_val, 0); - - ret_val = xmlXPathCastToString(val); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlXPathObjectPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCastToString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCmpNodes(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlNodePtr node1; /* the first node */ - int n_node1; - xmlNodePtr node2; /* the second node */ - int n_node2; - - for (n_node1 = 0;n_node1 < gen_nb_xmlNodePtr;n_node1++) { - for (n_node2 = 0;n_node2 < gen_nb_xmlNodePtr;n_node2++) { - mem_base = xmlMemBlocks(); - node1 = gen_xmlNodePtr(n_node1, 0); - node2 = gen_xmlNodePtr(n_node2, 1); - - ret_val = xmlXPathCmpNodes(node1, node2); - desret_int(ret_val); - call_tests++; - des_xmlNodePtr(n_node1, node1, 0); - des_xmlNodePtr(n_node2, node2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCmpNodes", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_node1); - printf(" %d", n_node2); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCompile(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - -#ifdef LIBXML_XPATH_ENABLED - -#define gen_nb_xmlXPathCompExprPtr 1 -static xmlXPathCompExprPtr gen_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlXPathCompExprPtr(int no ATTRIBUTE_UNUSED, xmlXPathCompExprPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - -#ifdef LIBXML_XPATH_ENABLED - -#define gen_nb_xmlXPathContextPtr 1 -static xmlXPathContextPtr gen_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlXPathContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlXPathCompiledEval(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathCompExprPtr comp; /* the compiled XPath expression */ - int n_comp; - xmlXPathContextPtr ctx; /* the XPath context */ - int n_ctx; - - for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) { - for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - comp = gen_xmlXPathCompExprPtr(n_comp, 0); - ctx = gen_xmlXPathContextPtr(n_ctx, 1); - - ret_val = xmlXPathCompiledEval(comp, ctx); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathCompExprPtr(n_comp, comp, 0); - des_xmlXPathContextPtr(n_ctx, ctx, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCompiledEval", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_comp); - printf(" %d", n_ctx); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCompiledEvalToBoolean(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathCompExprPtr comp; /* the compiled XPath expression */ - int n_comp; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - - for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) { - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - comp = gen_xmlXPathCompExprPtr(n_comp, 0); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 1); - - ret_val = xmlXPathCompiledEvalToBoolean(comp, ctxt); - desret_int(ret_val); - call_tests++; - des_xmlXPathCompExprPtr(n_comp, comp, 0); - des_xmlXPathContextPtr(n_ctxt, ctxt, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCompiledEvalToBoolean", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_comp); - printf(" %d", n_ctxt); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathContextSetCache(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - int active; /* enables/disables (creates/frees) the cache */ - int n_active; - int value; /* a value with semantics dependant on @options */ - int n_value; - int options; /* options (currently only the value 0 is used) */ - int n_options; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - for (n_active = 0;n_active < gen_nb_int;n_active++) { - for (n_value = 0;n_value < gen_nb_int;n_value++) { - for (n_options = 0;n_options < gen_nb_int;n_options++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - active = gen_int(n_active, 1); - value = gen_int(n_value, 2); - options = gen_int(n_options, 3); - - ret_val = xmlXPathContextSetCache(ctxt, active, value, options); - desret_int(ret_val); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - des_int(n_active, active, 1); - des_int(n_value, value, 2); - des_int(n_options, options, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathContextSetCache", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_active); - printf(" %d", n_value); - printf(" %d", n_options); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathConvertBoolean(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathObjectPtr val; /* an XPath object */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlXPathObjectPtr(n_val, 0); - - ret_val = xmlXPathConvertBoolean(val); - val = NULL; - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathObjectPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathConvertBoolean", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathConvertNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathObjectPtr val; /* an XPath object */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlXPathObjectPtr(n_val, 0); - - ret_val = xmlXPathConvertNumber(val); - val = NULL; - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathObjectPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathConvertNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathConvertString(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathObjectPtr val; /* an XPath object */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlXPathObjectPtr(n_val, 0); - - ret_val = xmlXPathConvertString(val); - val = NULL; - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathObjectPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathConvertString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCtxtCompile(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPathEval(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlChar * str; /* the XPath expression */ - int n_str; - xmlXPathContextPtr ctx; /* the XPath context */ - int n_ctx; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - ctx = gen_xmlXPathContextPtr(n_ctx, 1); - - ret_val = xmlXPathEval((const xmlChar *)str, ctx); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - des_xmlXPathContextPtr(n_ctx, ctx, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathEval", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf(" %d", n_ctx); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathEvalExpression(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlChar * str; /* the XPath expression */ - int n_str; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 1); - - ret_val = xmlXPathEvalExpression((const xmlChar *)str, ctxt); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - des_xmlXPathContextPtr(n_ctxt, ctxt, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathEvalExpression", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf(" %d", n_ctxt); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathEvalPredicate(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */ - int n_res; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - res = gen_xmlXPathObjectPtr(n_res, 1); - - ret_val = xmlXPathEvalPredicate(ctxt, res); - desret_int(ret_val); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - des_xmlXPathObjectPtr(n_res, res, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathEvalPredicate", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_res); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathInit(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - - mem_base = xmlMemBlocks(); - - xmlXPathInit(); - call_tests++; - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathInit", - xmlMemBlocks() - mem_base); - test_ret++; - printf("\n"); - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathIsInf(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - double val; /* a double value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_double;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_double(n_val, 0); - - ret_val = xmlXPathIsInf(val); - desret_int(ret_val); - call_tests++; - des_double(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathIsInf", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathIsNaN(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) - int mem_base; - int ret_val; - double val; /* a double value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_double;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_double(n_val, 0); - - ret_val = xmlXPathIsNaN(val); - desret_int(ret_val); - call_tests++; - des_double(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathIsNaN", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNewContext(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPathNodeSetCreate(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodePtr val; /* an initial xmlNodePtr, or NULL */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlNodePtr(n_val, 0); - - ret_val = xmlXPathNodeSetCreate(val); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeSetCreate", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathObjectCopy(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathObjectPtr val; /* the original object */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlXPathObjectPtr(n_val, 0); - - ret_val = xmlXPathObjectCopy(val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathObjectPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathObjectCopy", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathOrderDocElems(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - long ret_val; - xmlDocPtr doc; /* an input document */ - int n_doc; - - for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) { - mem_base = xmlMemBlocks(); - doc = gen_xmlDocPtr(n_doc, 0); - - ret_val = xmlXPathOrderDocElems(doc); - desret_long(ret_val); - call_tests++; - des_xmlDocPtr(n_doc, doc, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathOrderDocElems", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_doc); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xpath(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xpath : 30 of 38 functions ...\n"); - test_ret += test_xmlXPathCastBooleanToNumber(); - test_ret += test_xmlXPathCastBooleanToString(); - test_ret += test_xmlXPathCastNodeSetToBoolean(); - test_ret += test_xmlXPathCastNodeSetToNumber(); - test_ret += test_xmlXPathCastNodeSetToString(); - test_ret += test_xmlXPathCastNodeToNumber(); - test_ret += test_xmlXPathCastNodeToString(); - test_ret += test_xmlXPathCastNumberToBoolean(); - test_ret += test_xmlXPathCastNumberToString(); - test_ret += test_xmlXPathCastStringToBoolean(); - test_ret += test_xmlXPathCastStringToNumber(); - test_ret += test_xmlXPathCastToBoolean(); - test_ret += test_xmlXPathCastToNumber(); - test_ret += test_xmlXPathCastToString(); - test_ret += test_xmlXPathCmpNodes(); - test_ret += test_xmlXPathCompile(); - test_ret += test_xmlXPathCompiledEval(); - test_ret += test_xmlXPathCompiledEvalToBoolean(); - test_ret += test_xmlXPathContextSetCache(); - test_ret += test_xmlXPathConvertBoolean(); - test_ret += test_xmlXPathConvertNumber(); - test_ret += test_xmlXPathConvertString(); - test_ret += test_xmlXPathCtxtCompile(); - test_ret += test_xmlXPathEval(); - test_ret += test_xmlXPathEvalExpression(); - test_ret += test_xmlXPathEvalPredicate(); - test_ret += test_xmlXPathInit(); - test_ret += test_xmlXPathIsInf(); - test_ret += test_xmlXPathIsNaN(); - test_ret += test_xmlXPathNewContext(); - test_ret += test_xmlXPathNodeSetCreate(); - test_ret += test_xmlXPathObjectCopy(); - test_ret += test_xmlXPathOrderDocElems(); - - if (test_ret != 0) - printf("Module xpath: %d errors\n", test_ret); - return(test_ret); -} -#ifdef LIBXML_XPATH_ENABLED - -#define gen_nb_xmlXPathParserContextPtr 1 -static xmlXPathParserContextPtr gen_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlXPathParserContextPtr(int no ATTRIBUTE_UNUSED, xmlXPathParserContextPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_valuePop(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = valuePop(ctxt); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in valuePop", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_valuePush(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathParserContextPtr ctxt; /* an XPath evaluation context */ - int n_ctxt; - xmlXPathObjectPtr value; /* the XPath object */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - value = gen_xmlXPathObjectPtr(n_value, 1); - - ret_val = valuePush(ctxt, value); - desret_int(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlXPathObjectPtr(n_value, value, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in valuePush", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_value); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathAddValues(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - xmlXPathAddValues(ctxt); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathAddValues", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathBooleanFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathBooleanFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathBooleanFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCeilingFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathCeilingFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCeilingFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCompareValues(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int inf; /* less than (1) or greater than (0) */ - int n_inf; - int strict; /* is the comparison strict */ - int n_strict; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_inf = 0;n_inf < gen_nb_int;n_inf++) { - for (n_strict = 0;n_strict < gen_nb_int;n_strict++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - inf = gen_int(n_inf, 1); - strict = gen_int(n_strict, 2); - - ret_val = xmlXPathCompareValues(ctxt, inf, strict); - desret_int(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_inf, inf, 1); - des_int(n_strict, strict, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCompareValues", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_inf); - printf(" %d", n_strict); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathConcatFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathConcatFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathConcatFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathContainsFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathContainsFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathContainsFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathCountFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathCountFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathCountFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathDebugDumpCompExpr(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * for the output */ - int n_output; - xmlXPathCompExprPtr comp; /* the precompiled XPath expression */ - int n_comp; - int depth; /* the indentation level. */ - int n_depth; - - for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { - for (n_comp = 0;n_comp < gen_nb_xmlXPathCompExprPtr;n_comp++) { - for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { - mem_base = xmlMemBlocks(); - output = gen_FILE_ptr(n_output, 0); - comp = gen_xmlXPathCompExprPtr(n_comp, 1); - depth = gen_int(n_depth, 2); - - xmlXPathDebugDumpCompExpr(output, comp, depth); - call_tests++; - des_FILE_ptr(n_output, output, 0); - des_xmlXPathCompExprPtr(n_comp, comp, 1); - des_int(n_depth, depth, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathDebugDumpCompExpr", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_comp); - printf(" %d", n_depth); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathDebugDumpObject(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED) - int mem_base; - FILE * output; /* the FILE * to dump the output */ - int n_output; - xmlXPathObjectPtr cur; /* the object to inspect */ - int n_cur; - int depth; /* indentation level */ - int n_depth; - - for (n_output = 0;n_output < gen_nb_FILE_ptr;n_output++) { - for (n_cur = 0;n_cur < gen_nb_xmlXPathObjectPtr;n_cur++) { - for (n_depth = 0;n_depth < gen_nb_int;n_depth++) { - mem_base = xmlMemBlocks(); - output = gen_FILE_ptr(n_output, 0); - cur = gen_xmlXPathObjectPtr(n_cur, 1); - depth = gen_int(n_depth, 2); - - xmlXPathDebugDumpObject(output, cur, depth); - call_tests++; - des_FILE_ptr(n_output, output, 0); - des_xmlXPathObjectPtr(n_cur, cur, 1); - des_int(n_depth, depth, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathDebugDumpObject", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_output); - printf(" %d", n_cur); - printf(" %d", n_depth); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathDifference(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes1; /* a node-set */ - int n_nodes1; - xmlNodeSetPtr nodes2; /* a node-set */ - int n_nodes2; - - for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) { - for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) { - mem_base = xmlMemBlocks(); - nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0); - nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1); - - ret_val = xmlXPathDifference(nodes1, nodes2); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes1, nodes1, 0); - des_xmlNodeSetPtr(n_nodes2, nodes2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathDifference", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes1); - printf(" %d", n_nodes2); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathDistinct(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes; /* a node-set */ - int n_nodes; - - for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { - mem_base = xmlMemBlocks(); - nodes = gen_xmlNodeSetPtr(n_nodes, 0); - - ret_val = xmlXPathDistinct(nodes); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes, nodes, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathDistinct", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathDistinctSorted(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes; /* a node-set, sorted by document order */ - int n_nodes; - - for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { - mem_base = xmlMemBlocks(); - nodes = gen_xmlNodeSetPtr(n_nodes, 0); - - ret_val = xmlXPathDistinctSorted(nodes); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes, nodes, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathDistinctSorted", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathDivValues(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - xmlXPathDivValues(ctxt); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathDivValues", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathEqualValues(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = xmlXPathEqualValues(ctxt); - desret_int(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathEqualValues", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathErr(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* a XPath parser context */ - int n_ctxt; - int error; /* the error code */ - int n_error; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_error = 0;n_error < gen_nb_int;n_error++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - error = gen_int(n_error, 1); - - xmlXPathErr(ctxt, error); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_error, error, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathErr", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_error); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathEvalExpr(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - xmlXPathEvalExpr(ctxt); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathEvalExpr", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathEvaluatePredicateResult(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlXPathObjectPtr res; /* the Predicate Expression evaluation result */ - int n_res; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_res = 0;n_res < gen_nb_xmlXPathObjectPtr;n_res++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - res = gen_xmlXPathObjectPtr(n_res, 1); - - ret_val = xmlXPathEvaluatePredicateResult(ctxt, res); - desret_int(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlXPathObjectPtr(n_res, res, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathEvaluatePredicateResult", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_res); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathFalseFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathFalseFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathFalseFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathFloorFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathFloorFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathFloorFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathFunctionLookup(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPathFunctionLookupNS(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPathHasSameNodes(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlNodeSetPtr nodes1; /* a node-set */ - int n_nodes1; - xmlNodeSetPtr nodes2; /* a node-set */ - int n_nodes2; - - for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) { - for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) { - mem_base = xmlMemBlocks(); - nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0); - nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1); - - ret_val = xmlXPathHasSameNodes(nodes1, nodes2); - desret_int(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes1, nodes1, 0); - des_xmlNodeSetPtr(n_nodes2, nodes2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathHasSameNodes", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes1); - printf(" %d", n_nodes2); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathIdFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathIdFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathIdFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathIntersection(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes1; /* a node-set */ - int n_nodes1; - xmlNodeSetPtr nodes2; /* a node-set */ - int n_nodes2; - - for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) { - for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) { - mem_base = xmlMemBlocks(); - nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0); - nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1); - - ret_val = xmlXPathIntersection(nodes1, nodes2); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes1, nodes1, 0); - des_xmlNodeSetPtr(n_nodes2, nodes2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathIntersection", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes1); - printf(" %d", n_nodes2); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathIsNodeType(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlChar * name; /* a name string */ - int n_name; - - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - name = gen_const_xmlChar_ptr(n_name, 0); - - ret_val = xmlXPathIsNodeType((const xmlChar *)name); - desret_int(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathIsNodeType", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_name); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathLangFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathLangFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathLangFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathLastFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathLastFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathLastFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathLeading(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes1; /* a node-set */ - int n_nodes1; - xmlNodeSetPtr nodes2; /* a node-set */ - int n_nodes2; - - for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) { - for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) { - mem_base = xmlMemBlocks(); - nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0); - nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1); - - ret_val = xmlXPathLeading(nodes1, nodes2); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes1, nodes1, 0); - des_xmlNodeSetPtr(n_nodes2, nodes2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathLeading", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes1); - printf(" %d", n_nodes2); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathLeadingSorted(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */ - int n_nodes1; - xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */ - int n_nodes2; - - for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) { - for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) { - mem_base = xmlMemBlocks(); - nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0); - nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1); - - ret_val = xmlXPathLeadingSorted(nodes1, nodes2); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes1, nodes1, 0); - des_xmlNodeSetPtr(n_nodes2, nodes2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathLeadingSorted", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes1); - printf(" %d", n_nodes2); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathLocalNameFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathLocalNameFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathLocalNameFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathModValues(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - xmlXPathModValues(ctxt); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathModValues", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathMultValues(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - xmlXPathMultValues(ctxt); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathMultValues", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNamespaceURIFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathNamespaceURIFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNamespaceURIFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNewBoolean(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - int val; /* the boolean value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_int(n_val, 0); - - ret_val = xmlXPathNewBoolean(val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_int(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNewBoolean", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNewCString(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - char * val; /* the char * value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_const_char_ptr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_const_char_ptr(n_val, 0); - - ret_val = xmlXPathNewCString((const char *)val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_const_char_ptr(n_val, (const char *)val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNewCString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNewFloat(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - double val; /* the double value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_double;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_double(n_val, 0); - - ret_val = xmlXPathNewFloat(val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_double(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNewFloat", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNewNodeSet(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlNodePtr val; /* the NodePtr value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlNodePtr(n_val, 0); - - ret_val = xmlXPathNewNodeSet(val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNewNodeSet", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNewNodeSetList(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlNodeSetPtr val; /* an existing NodeSet */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlNodeSetPtr(n_val, 0); - - ret_val = xmlXPathNewNodeSetList(val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNewNodeSetList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNewParserContext(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPathNewString(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlChar * val; /* the xmlChar * value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_const_xmlChar_ptr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_const_xmlChar_ptr(n_val, 0); - - ret_val = xmlXPathNewString((const xmlChar *)val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_val, (const xmlChar *)val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNewString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextAncestor(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextAncestor(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextAncestor", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextAncestorOrSelf(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextAncestorOrSelf(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextAncestorOrSelf", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextAttribute(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current attribute in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextAttribute(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextAttribute", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextChild(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextChild(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextChild", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextDescendant(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextDescendant(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextDescendant", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextDescendantOrSelf(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextDescendantOrSelf(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextDescendantOrSelf", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextFollowing(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextFollowing(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextFollowing", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextFollowingSibling(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextFollowingSibling(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextFollowingSibling", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextNamespace(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current attribute in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextNamespace(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextNamespace", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextParent(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextParent(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextParent", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextPreceding(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextPreceding(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextPreceding", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextPrecedingSibling(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextPrecedingSibling(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextPrecedingSibling", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNextSelf(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - xmlNodePtr cur; /* the current node in the traversal */ - int n_cur; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - cur = gen_xmlNodePtr(n_cur, 1); - - ret_val = xmlXPathNextSelf(ctxt, cur); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_xmlNodePtr(n_cur, cur, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNextSelf", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_cur); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeLeading(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes; /* a node-set */ - int n_nodes; - xmlNodePtr node; /* a node */ - int n_node; - - for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - nodes = gen_xmlNodeSetPtr(n_nodes, 0); - node = gen_xmlNodePtr(n_node, 1); - - ret_val = xmlXPathNodeLeading(nodes, node); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes, nodes, 0); - des_xmlNodePtr(n_node, node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeLeading", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeLeadingSorted(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes; /* a node-set, sorted by document order */ - int n_nodes; - xmlNodePtr node; /* a node */ - int n_node; - - for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - nodes = gen_xmlNodeSetPtr(n_nodes, 0); - node = gen_xmlNodePtr(n_node, 1); - - ret_val = xmlXPathNodeLeadingSorted(nodes, node); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes, nodes, 0); - des_xmlNodePtr(n_node, node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeLeadingSorted", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeSetAdd(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlNodeSetPtr cur; /* the initial node set */ - int n_cur; - xmlNodePtr val; /* a new xmlNodePtr */ - int n_val; - - for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) { - for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodeSetPtr(n_cur, 0); - val = gen_xmlNodePtr(n_val, 1); - - ret_val = xmlXPathNodeSetAdd(cur, val); - desret_int(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_cur, cur, 0); - des_xmlNodePtr(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeSetAdd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeSetAddNs(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlNodeSetPtr cur; /* the initial node set */ - int n_cur; - xmlNodePtr node; /* the hosting node */ - int n_node; - xmlNsPtr ns; /* a the namespace node */ - int n_ns; - - for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - for (n_ns = 0;n_ns < gen_nb_xmlNsPtr;n_ns++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodeSetPtr(n_cur, 0); - node = gen_xmlNodePtr(n_node, 1); - ns = gen_xmlNsPtr(n_ns, 2); - - ret_val = xmlXPathNodeSetAddNs(cur, node, ns); - desret_int(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_cur, cur, 0); - des_xmlNodePtr(n_node, node, 1); - des_xmlNsPtr(n_ns, ns, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeSetAddNs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_node); - printf(" %d", n_ns); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeSetAddUnique(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlNodeSetPtr cur; /* the initial node set */ - int n_cur; - xmlNodePtr val; /* a new xmlNodePtr */ - int n_val; - - for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) { - for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodeSetPtr(n_cur, 0); - val = gen_xmlNodePtr(n_val, 1); - - ret_val = xmlXPathNodeSetAddUnique(cur, val); - desret_int(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_cur, cur, 0); - des_xmlNodePtr(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeSetAddUnique", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeSetContains(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlNodeSetPtr cur; /* the node-set */ - int n_cur; - xmlNodePtr val; /* the node */ - int n_val; - - for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) { - for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodeSetPtr(n_cur, 0); - val = gen_xmlNodePtr(n_val, 1); - - ret_val = xmlXPathNodeSetContains(cur, val); - desret_int(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_cur, cur, 0); - des_xmlNodePtr(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeSetContains", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeSetDel(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr cur; /* the initial node set */ - int n_cur; - xmlNodePtr val; /* an xmlNodePtr */ - int n_val; - - for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) { - for (n_val = 0;n_val < gen_nb_xmlNodePtr;n_val++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodeSetPtr(n_cur, 0); - val = gen_xmlNodePtr(n_val, 1); - - xmlXPathNodeSetDel(cur, val); - call_tests++; - des_xmlNodeSetPtr(n_cur, cur, 0); - des_xmlNodePtr(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeSetDel", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeSetMerge(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr val1; /* the first NodeSet or NULL */ - int n_val1; - xmlNodeSetPtr val2; /* the second NodeSet */ - int n_val2; - - for (n_val1 = 0;n_val1 < gen_nb_xmlNodeSetPtr;n_val1++) { - for (n_val2 = 0;n_val2 < gen_nb_xmlNodeSetPtr;n_val2++) { - mem_base = xmlMemBlocks(); - val1 = gen_xmlNodeSetPtr(n_val1, 0); - val2 = gen_xmlNodeSetPtr(n_val2, 1); - - ret_val = xmlXPathNodeSetMerge(val1, val2); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_val1, val1, 0); - des_xmlNodeSetPtr(n_val2, val2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeSetMerge", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val1); - printf(" %d", n_val2); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeSetRemove(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr cur; /* the initial node set */ - int n_cur; - int val; /* the index to remove */ - int n_val; - - for (n_cur = 0;n_cur < gen_nb_xmlNodeSetPtr;n_cur++) { - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlNodeSetPtr(n_cur, 0); - val = gen_int(n_val, 1); - - xmlXPathNodeSetRemove(cur, val); - call_tests++; - des_xmlNodeSetPtr(n_cur, cur, 0); - des_int(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeSetRemove", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeSetSort(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr set; /* the node set */ - int n_set; - - for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) { - mem_base = xmlMemBlocks(); - set = gen_xmlNodeSetPtr(n_set, 0); - - xmlXPathNodeSetSort(set); - call_tests++; - des_xmlNodeSetPtr(n_set, set, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeSetSort", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_set); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeTrailing(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes; /* a node-set */ - int n_nodes; - xmlNodePtr node; /* a node */ - int n_node; - - for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - nodes = gen_xmlNodeSetPtr(n_nodes, 0); - node = gen_xmlNodePtr(n_node, 1); - - ret_val = xmlXPathNodeTrailing(nodes, node); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes, nodes, 0); - des_xmlNodePtr(n_node, node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeTrailing", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNodeTrailingSorted(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes; /* a node-set, sorted by document order */ - int n_nodes; - xmlNodePtr node; /* a node */ - int n_node; - - for (n_nodes = 0;n_nodes < gen_nb_xmlNodeSetPtr;n_nodes++) { - for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) { - mem_base = xmlMemBlocks(); - nodes = gen_xmlNodeSetPtr(n_nodes, 0); - node = gen_xmlNodePtr(n_node, 1); - - ret_val = xmlXPathNodeTrailingSorted(nodes, node); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes, nodes, 0); - des_xmlNodePtr(n_node, node, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNodeTrailingSorted", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes); - printf(" %d", n_node); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNormalizeFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathNormalizeFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNormalizeFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNotEqualValues(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = xmlXPathNotEqualValues(ctxt); - desret_int(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNotEqualValues", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNotFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathNotFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNotFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNsLookup(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - const xmlChar * ret_val; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - xmlChar * prefix; /* the namespace prefix value */ - int n_prefix; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - - ret_val = xmlXPathNsLookup(ctxt, (const xmlChar *)prefix); - desret_const_xmlChar_ptr(ret_val); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNsLookup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_prefix); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathNumberFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathNumberFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathNumberFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathParseNCName(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = xmlXPathParseNCName(ctxt); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathParseNCName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathParseName(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = xmlXPathParseName(ctxt); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathParseName", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathPopBoolean(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathParserContextPtr ctxt; /* an XPath parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = xmlXPathPopBoolean(ctxt); - desret_int(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathPopBoolean", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathPopExternal(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - void * ret_val; - xmlXPathParserContextPtr ctxt; /* an XPath parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = xmlXPathPopExternal(ctxt); - desret_void_ptr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathPopExternal", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathPopNodeSet(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlXPathParserContextPtr ctxt; /* an XPath parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = xmlXPathPopNodeSet(ctxt); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathPopNodeSet", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathPopNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - double ret_val; - xmlXPathParserContextPtr ctxt; /* an XPath parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = xmlXPathPopNumber(ctxt); - desret_double(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathPopNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathPopString(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlChar * ret_val; - xmlXPathParserContextPtr ctxt; /* an XPath parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - ret_val = xmlXPathPopString(ctxt); - desret_xmlChar_ptr(ret_val); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathPopString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathPositionFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathPositionFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathPositionFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathRegisterAllFunctions(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - - xmlXPathRegisterAllFunctions(ctxt); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathRegisterAllFunctions", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathRegisterFunc(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPathRegisterFuncLookup(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPathRegisterFuncNS(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPathRegisterNs(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - xmlChar * prefix; /* the namespace prefix cannot be NULL or empty string */ - int n_prefix; - xmlChar * ns_uri; /* the namespace name */ - int n_ns_uri; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - for (n_prefix = 0;n_prefix < gen_nb_const_xmlChar_ptr;n_prefix++) { - for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - prefix = gen_const_xmlChar_ptr(n_prefix, 1); - ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2); - - ret_val = xmlXPathRegisterNs(ctxt, (const xmlChar *)prefix, (const xmlChar *)ns_uri); - desret_int(ret_val); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_prefix, (const xmlChar *)prefix, 1); - des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathRegisterNs", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_prefix); - printf(" %d", n_ns_uri); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathRegisterVariable(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - xmlChar * name; /* the variable name */ - int n_name; - xmlXPathObjectPtr value; /* the variable value or NULL */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - value = gen_xmlXPathObjectPtr(n_value, 2); - - ret_val = xmlXPathRegisterVariable(ctxt, (const xmlChar *)name, value); - desret_int(ret_val); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_xmlXPathObjectPtr(n_value, value, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathRegisterVariable", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_name); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathRegisterVariableLookup(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPathRegisterVariableNS(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - int ret_val; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - xmlChar * name; /* the variable name */ - int n_name; - xmlChar * ns_uri; /* the variable namespace URI */ - int n_ns_uri; - xmlXPathObjectPtr value; /* the variable value or NULL */ - int n_value; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) { - for (n_value = 0;n_value < gen_nb_xmlXPathObjectPtr;n_value++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2); - value = gen_xmlXPathObjectPtr(n_value, 3); - - ret_val = xmlXPathRegisterVariableNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri, value); - desret_int(ret_val); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2); - des_xmlXPathObjectPtr(n_value, value, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathRegisterVariableNS", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_name); - printf(" %d", n_ns_uri); - printf(" %d", n_value); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathRegisteredFuncsCleanup(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - - xmlXPathRegisteredFuncsCleanup(ctxt); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathRegisteredFuncsCleanup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathRegisteredNsCleanup(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - - xmlXPathRegisteredNsCleanup(ctxt); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathRegisteredNsCleanup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathRegisteredVariablesCleanup(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - - xmlXPathRegisteredVariablesCleanup(ctxt); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathRegisteredVariablesCleanup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathRoot(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - xmlXPathRoot(ctxt); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathRoot", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathRoundFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathRoundFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathRoundFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathStartsWithFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathStartsWithFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathStartsWithFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathStringEvalNumber(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - double ret_val; - xmlChar * str; /* A string to scan */ - int n_str; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - - ret_val = xmlXPathStringEvalNumber((const xmlChar *)str); - desret_double(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathStringEvalNumber", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathStringFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathStringFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathStringFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathStringLengthFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathStringLengthFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathStringLengthFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathSubValues(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - xmlXPathSubValues(ctxt); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathSubValues", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathSubstringAfterFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathSubstringAfterFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathSubstringAfterFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathSubstringBeforeFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathSubstringBeforeFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathSubstringBeforeFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathSubstringFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathSubstringFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathSubstringFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathSumFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathSumFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathSumFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathTrailing(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes1; /* a node-set */ - int n_nodes1; - xmlNodeSetPtr nodes2; /* a node-set */ - int n_nodes2; - - for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) { - for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) { - mem_base = xmlMemBlocks(); - nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0); - nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1); - - ret_val = xmlXPathTrailing(nodes1, nodes2); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes1, nodes1, 0); - des_xmlNodeSetPtr(n_nodes2, nodes2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathTrailing", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes1); - printf(" %d", n_nodes2); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathTrailingSorted(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlNodeSetPtr ret_val; - xmlNodeSetPtr nodes1; /* a node-set, sorted by document order */ - int n_nodes1; - xmlNodeSetPtr nodes2; /* a node-set, sorted by document order */ - int n_nodes2; - - for (n_nodes1 = 0;n_nodes1 < gen_nb_xmlNodeSetPtr;n_nodes1++) { - for (n_nodes2 = 0;n_nodes2 < gen_nb_xmlNodeSetPtr;n_nodes2++) { - mem_base = xmlMemBlocks(); - nodes1 = gen_xmlNodeSetPtr(n_nodes1, 0); - nodes2 = gen_xmlNodeSetPtr(n_nodes2, 1); - - ret_val = xmlXPathTrailingSorted(nodes1, nodes2); - desret_xmlNodeSetPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_nodes1, nodes1, 0); - des_xmlNodeSetPtr(n_nodes2, nodes2, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathTrailingSorted", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_nodes1); - printf(" %d", n_nodes2); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathTranslateFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathTranslateFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathTranslateFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathTrueFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - int nargs; /* the number of arguments */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPathTrueFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathTrueFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathValueFlipSign(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - xmlXPathValueFlipSign(ctxt); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathValueFlipSign", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathVariableLookup(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - xmlChar * name; /* the variable name */ - int n_name; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - - ret_val = xmlXPathVariableLookup(ctxt, (const xmlChar *)name); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathVariableLookup", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_name); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathVariableLookupNS(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathContextPtr ctxt; /* the XPath context */ - int n_ctxt; - xmlChar * name; /* the variable name */ - int n_name; - xmlChar * ns_uri; /* the variable namespace URI */ - int n_ns_uri; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathContextPtr;n_ctxt++) { - for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) { - for (n_ns_uri = 0;n_ns_uri < gen_nb_const_xmlChar_ptr;n_ns_uri++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathContextPtr(n_ctxt, 0); - name = gen_const_xmlChar_ptr(n_name, 1); - ns_uri = gen_const_xmlChar_ptr(n_ns_uri, 2); - - ret_val = xmlXPathVariableLookupNS(ctxt, (const xmlChar *)name, (const xmlChar *)ns_uri); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathContextPtr(n_ctxt, ctxt, 0); - des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1); - des_const_xmlChar_ptr(n_ns_uri, (const xmlChar *)ns_uri, 2); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathVariableLookupNS", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_name); - printf(" %d", n_ns_uri); - printf("\n"); - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathWrapCString(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - char * val; /* the char * value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_char_ptr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_char_ptr(n_val, 0); - - ret_val = xmlXPathWrapCString(val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_char_ptr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathWrapCString", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathWrapExternal(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - void * val; /* the user data */ - int n_val; - - for (n_val = 0;n_val < gen_nb_void_ptr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_void_ptr(n_val, 0); - - ret_val = xmlXPathWrapExternal(val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_void_ptr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathWrapExternal", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPathWrapNodeSet(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlNodeSetPtr val; /* the NodePtr value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlNodeSetPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlNodeSetPtr(n_val, 0); - - ret_val = xmlXPathWrapNodeSet(val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPathWrapNodeSet", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPatherror(void) { - int test_ret = 0; - -#if defined(LIBXML_XPATH_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPath Parser context */ - int n_ctxt; - const char * file; /* the file name */ - int n_file; - int line; /* the line number */ - int n_line; - int no; /* the error number */ - int n_no; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_file = 0;n_file < gen_nb_filepath;n_file++) { - for (n_line = 0;n_line < gen_nb_int;n_line++) { - for (n_no = 0;n_no < gen_nb_int;n_no++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - file = gen_filepath(n_file, 1); - line = gen_int(n_line, 2); - no = gen_int(n_no, 3); - - xmlXPatherror(ctxt, file, line, no); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_filepath(n_file, file, 1); - des_int(n_line, line, 2); - des_int(n_no, no, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPatherror", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_file); - printf(" %d", n_line); - printf(" %d", n_no); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xpathInternals(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xpathInternals : 106 of 117 functions ...\n"); - test_ret += test_valuePop(); - test_ret += test_valuePush(); - test_ret += test_xmlXPathAddValues(); - test_ret += test_xmlXPathBooleanFunction(); - test_ret += test_xmlXPathCeilingFunction(); - test_ret += test_xmlXPathCompareValues(); - test_ret += test_xmlXPathConcatFunction(); - test_ret += test_xmlXPathContainsFunction(); - test_ret += test_xmlXPathCountFunction(); - test_ret += test_xmlXPathDebugDumpCompExpr(); - test_ret += test_xmlXPathDebugDumpObject(); - test_ret += test_xmlXPathDifference(); - test_ret += test_xmlXPathDistinct(); - test_ret += test_xmlXPathDistinctSorted(); - test_ret += test_xmlXPathDivValues(); - test_ret += test_xmlXPathEqualValues(); - test_ret += test_xmlXPathErr(); - test_ret += test_xmlXPathEvalExpr(); - test_ret += test_xmlXPathEvaluatePredicateResult(); - test_ret += test_xmlXPathFalseFunction(); - test_ret += test_xmlXPathFloorFunction(); - test_ret += test_xmlXPathFunctionLookup(); - test_ret += test_xmlXPathFunctionLookupNS(); - test_ret += test_xmlXPathHasSameNodes(); - test_ret += test_xmlXPathIdFunction(); - test_ret += test_xmlXPathIntersection(); - test_ret += test_xmlXPathIsNodeType(); - test_ret += test_xmlXPathLangFunction(); - test_ret += test_xmlXPathLastFunction(); - test_ret += test_xmlXPathLeading(); - test_ret += test_xmlXPathLeadingSorted(); - test_ret += test_xmlXPathLocalNameFunction(); - test_ret += test_xmlXPathModValues(); - test_ret += test_xmlXPathMultValues(); - test_ret += test_xmlXPathNamespaceURIFunction(); - test_ret += test_xmlXPathNewBoolean(); - test_ret += test_xmlXPathNewCString(); - test_ret += test_xmlXPathNewFloat(); - test_ret += test_xmlXPathNewNodeSet(); - test_ret += test_xmlXPathNewNodeSetList(); - test_ret += test_xmlXPathNewParserContext(); - test_ret += test_xmlXPathNewString(); - test_ret += test_xmlXPathNextAncestor(); - test_ret += test_xmlXPathNextAncestorOrSelf(); - test_ret += test_xmlXPathNextAttribute(); - test_ret += test_xmlXPathNextChild(); - test_ret += test_xmlXPathNextDescendant(); - test_ret += test_xmlXPathNextDescendantOrSelf(); - test_ret += test_xmlXPathNextFollowing(); - test_ret += test_xmlXPathNextFollowingSibling(); - test_ret += test_xmlXPathNextNamespace(); - test_ret += test_xmlXPathNextParent(); - test_ret += test_xmlXPathNextPreceding(); - test_ret += test_xmlXPathNextPrecedingSibling(); - test_ret += test_xmlXPathNextSelf(); - test_ret += test_xmlXPathNodeLeading(); - test_ret += test_xmlXPathNodeLeadingSorted(); - test_ret += test_xmlXPathNodeSetAdd(); - test_ret += test_xmlXPathNodeSetAddNs(); - test_ret += test_xmlXPathNodeSetAddUnique(); - test_ret += test_xmlXPathNodeSetContains(); - test_ret += test_xmlXPathNodeSetDel(); - test_ret += test_xmlXPathNodeSetMerge(); - test_ret += test_xmlXPathNodeSetRemove(); - test_ret += test_xmlXPathNodeSetSort(); - test_ret += test_xmlXPathNodeTrailing(); - test_ret += test_xmlXPathNodeTrailingSorted(); - test_ret += test_xmlXPathNormalizeFunction(); - test_ret += test_xmlXPathNotEqualValues(); - test_ret += test_xmlXPathNotFunction(); - test_ret += test_xmlXPathNsLookup(); - test_ret += test_xmlXPathNumberFunction(); - test_ret += test_xmlXPathParseNCName(); - test_ret += test_xmlXPathParseName(); - test_ret += test_xmlXPathPopBoolean(); - test_ret += test_xmlXPathPopExternal(); - test_ret += test_xmlXPathPopNodeSet(); - test_ret += test_xmlXPathPopNumber(); - test_ret += test_xmlXPathPopString(); - test_ret += test_xmlXPathPositionFunction(); - test_ret += test_xmlXPathRegisterAllFunctions(); - test_ret += test_xmlXPathRegisterFunc(); - test_ret += test_xmlXPathRegisterFuncLookup(); - test_ret += test_xmlXPathRegisterFuncNS(); - test_ret += test_xmlXPathRegisterNs(); - test_ret += test_xmlXPathRegisterVariable(); - test_ret += test_xmlXPathRegisterVariableLookup(); - test_ret += test_xmlXPathRegisterVariableNS(); - test_ret += test_xmlXPathRegisteredFuncsCleanup(); - test_ret += test_xmlXPathRegisteredNsCleanup(); - test_ret += test_xmlXPathRegisteredVariablesCleanup(); - test_ret += test_xmlXPathRoot(); - test_ret += test_xmlXPathRoundFunction(); - test_ret += test_xmlXPathStartsWithFunction(); - test_ret += test_xmlXPathStringEvalNumber(); - test_ret += test_xmlXPathStringFunction(); - test_ret += test_xmlXPathStringLengthFunction(); - test_ret += test_xmlXPathSubValues(); - test_ret += test_xmlXPathSubstringAfterFunction(); - test_ret += test_xmlXPathSubstringBeforeFunction(); - test_ret += test_xmlXPathSubstringFunction(); - test_ret += test_xmlXPathSumFunction(); - test_ret += test_xmlXPathTrailing(); - test_ret += test_xmlXPathTrailingSorted(); - test_ret += test_xmlXPathTranslateFunction(); - test_ret += test_xmlXPathTrueFunction(); - test_ret += test_xmlXPathValueFlipSign(); - test_ret += test_xmlXPathVariableLookup(); - test_ret += test_xmlXPathVariableLookupNS(); - test_ret += test_xmlXPathWrapCString(); - test_ret += test_xmlXPathWrapExternal(); - test_ret += test_xmlXPathWrapNodeSet(); - test_ret += test_xmlXPatherror(); - - if (test_ret != 0) - printf("Module xpathInternals: %d errors\n", test_ret); - return(test_ret); -} - -static int -test_xmlXPtrBuildNodeList(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlNodePtr ret_val; - xmlXPathObjectPtr obj; /* the XPointer result from the evaluation. */ - int n_obj; - - for (n_obj = 0;n_obj < gen_nb_xmlXPathObjectPtr;n_obj++) { - mem_base = xmlMemBlocks(); - obj = gen_xmlXPathObjectPtr(n_obj, 0); - - ret_val = xmlXPtrBuildNodeList(obj); - desret_xmlNodePtr(ret_val); - call_tests++; - des_xmlXPathObjectPtr(n_obj, obj, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrBuildNodeList", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_obj); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrEval(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlChar * str; /* the XPointer expression */ - int n_str; - xmlXPathContextPtr ctx; /* the XPointer context */ - int n_ctx; - - for (n_str = 0;n_str < gen_nb_const_xmlChar_ptr;n_str++) { - for (n_ctx = 0;n_ctx < gen_nb_xmlXPathContextPtr;n_ctx++) { - mem_base = xmlMemBlocks(); - str = gen_const_xmlChar_ptr(n_str, 0); - ctx = gen_xmlXPathContextPtr(n_ctx, 1); - - ret_val = xmlXPtrEval((const xmlChar *)str, ctx); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_const_xmlChar_ptr(n_str, (const xmlChar *)str, 0); - des_xmlXPathContextPtr(n_ctx, ctx, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrEval", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_str); - printf(" %d", n_ctx); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrEvalRangePredicate(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */ - int n_ctxt; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - - xmlXPtrEvalRangePredicate(ctxt); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrEvalRangePredicate", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -#ifdef LIBXML_XPTR_ENABLED - -#define gen_nb_xmlLocationSetPtr 1 -static xmlLocationSetPtr gen_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { - return(NULL); -} -static void des_xmlLocationSetPtr(int no ATTRIBUTE_UNUSED, xmlLocationSetPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) { -} -#endif - - -static int -test_xmlXPtrLocationSetAdd(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlLocationSetPtr cur; /* the initial range set */ - int n_cur; - xmlXPathObjectPtr val; /* a new xmlXPathObjectPtr */ - int n_val; - - for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) { - for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlLocationSetPtr(n_cur, 0); - val = gen_xmlXPathObjectPtr(n_val, 1); - - xmlXPtrLocationSetAdd(cur, val); - call_tests++; - des_xmlLocationSetPtr(n_cur, cur, 0); - des_xmlXPathObjectPtr(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrLocationSetAdd", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrLocationSetCreate(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPtrLocationSetDel(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlLocationSetPtr cur; /* the initial range set */ - int n_cur; - xmlXPathObjectPtr val; /* an xmlXPathObjectPtr */ - int n_val; - - for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) { - for (n_val = 0;n_val < gen_nb_xmlXPathObjectPtr;n_val++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlLocationSetPtr(n_cur, 0); - val = gen_xmlXPathObjectPtr(n_val, 1); - - xmlXPtrLocationSetDel(cur, val); - call_tests++; - des_xmlLocationSetPtr(n_cur, cur, 0); - des_xmlXPathObjectPtr(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrLocationSetDel", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrLocationSetMerge(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPtrLocationSetRemove(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlLocationSetPtr cur; /* the initial range set */ - int n_cur; - int val; /* the index to remove */ - int n_val; - - for (n_cur = 0;n_cur < gen_nb_xmlLocationSetPtr;n_cur++) { - for (n_val = 0;n_val < gen_nb_int;n_val++) { - mem_base = xmlMemBlocks(); - cur = gen_xmlLocationSetPtr(n_cur, 0); - val = gen_int(n_val, 1); - - xmlXPtrLocationSetRemove(cur, val); - call_tests++; - des_xmlLocationSetPtr(n_cur, cur, 0); - des_int(n_val, val, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrLocationSetRemove", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_cur); - printf(" %d", n_val); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrNewCollapsedRange(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlNodePtr start; /* the starting and ending node */ - int n_start; - - for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) { - mem_base = xmlMemBlocks(); - start = gen_xmlNodePtr(n_start, 0); - - ret_val = xmlXPtrNewCollapsedRange(start); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_start, start, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrNewCollapsedRange", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_start); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrNewContext(void) { - int test_ret = 0; - - - /* missing type support */ - return(test_ret); -} - - -static int -test_xmlXPtrNewLocationSetNodeSet(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlNodeSetPtr set; /* a node set */ - int n_set; - - for (n_set = 0;n_set < gen_nb_xmlNodeSetPtr;n_set++) { - mem_base = xmlMemBlocks(); - set = gen_xmlNodeSetPtr(n_set, 0); - - ret_val = xmlXPtrNewLocationSetNodeSet(set); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlNodeSetPtr(n_set, set, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodeSet", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_set); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrNewLocationSetNodes(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlNodePtr start; /* the start NodePtr value */ - int n_start; - xmlNodePtr end; /* the end NodePtr value or NULL */ - int n_end; - - for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) { - for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) { - mem_base = xmlMemBlocks(); - start = gen_xmlNodePtr(n_start, 0); - end = gen_xmlNodePtr(n_end, 1); - - ret_val = xmlXPtrNewLocationSetNodes(start, end); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_start, start, 0); - des_xmlNodePtr(n_end, end, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrNewLocationSetNodes", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_start); - printf(" %d", n_end); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrNewRange(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlNodePtr start; /* the starting node */ - int n_start; - int startindex; /* the start index */ - int n_startindex; - xmlNodePtr end; /* the ending point */ - int n_end; - int endindex; /* the ending index */ - int n_endindex; - - for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) { - for (n_startindex = 0;n_startindex < gen_nb_int;n_startindex++) { - for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) { - for (n_endindex = 0;n_endindex < gen_nb_int;n_endindex++) { - mem_base = xmlMemBlocks(); - start = gen_xmlNodePtr(n_start, 0); - startindex = gen_int(n_startindex, 1); - end = gen_xmlNodePtr(n_end, 2); - endindex = gen_int(n_endindex, 3); - - ret_val = xmlXPtrNewRange(start, startindex, end, endindex); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_start, start, 0); - des_int(n_startindex, startindex, 1); - des_xmlNodePtr(n_end, end, 2); - des_int(n_endindex, endindex, 3); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrNewRange", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_start); - printf(" %d", n_startindex); - printf(" %d", n_end); - printf(" %d", n_endindex); - printf("\n"); - } - } - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrNewRangeNodeObject(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlNodePtr start; /* the starting node */ - int n_start; - xmlXPathObjectPtr end; /* the ending object */ - int n_end; - - for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) { - for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) { - mem_base = xmlMemBlocks(); - start = gen_xmlNodePtr(n_start, 0); - end = gen_xmlXPathObjectPtr(n_end, 1); - - ret_val = xmlXPtrNewRangeNodeObject(start, end); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_start, start, 0); - des_xmlXPathObjectPtr(n_end, end, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrNewRangeNodeObject", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_start); - printf(" %d", n_end); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrNewRangeNodePoint(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlNodePtr start; /* the starting node */ - int n_start; - xmlXPathObjectPtr end; /* the ending point */ - int n_end; - - for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) { - for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) { - mem_base = xmlMemBlocks(); - start = gen_xmlNodePtr(n_start, 0); - end = gen_xmlXPathObjectPtr(n_end, 1); - - ret_val = xmlXPtrNewRangeNodePoint(start, end); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_start, start, 0); - des_xmlXPathObjectPtr(n_end, end, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrNewRangeNodePoint", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_start); - printf(" %d", n_end); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrNewRangeNodes(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlNodePtr start; /* the starting node */ - int n_start; - xmlNodePtr end; /* the ending node */ - int n_end; - - for (n_start = 0;n_start < gen_nb_xmlNodePtr;n_start++) { - for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) { - mem_base = xmlMemBlocks(); - start = gen_xmlNodePtr(n_start, 0); - end = gen_xmlNodePtr(n_end, 1); - - ret_val = xmlXPtrNewRangeNodes(start, end); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlNodePtr(n_start, start, 0); - des_xmlNodePtr(n_end, end, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrNewRangeNodes", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_start); - printf(" %d", n_end); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrNewRangePointNode(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathObjectPtr start; /* the starting point */ - int n_start; - xmlNodePtr end; /* the ending node */ - int n_end; - - for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) { - for (n_end = 0;n_end < gen_nb_xmlNodePtr;n_end++) { - mem_base = xmlMemBlocks(); - start = gen_xmlXPathObjectPtr(n_start, 0); - end = gen_xmlNodePtr(n_end, 1); - - ret_val = xmlXPtrNewRangePointNode(start, end); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathObjectPtr(n_start, start, 0); - des_xmlNodePtr(n_end, end, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrNewRangePointNode", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_start); - printf(" %d", n_end); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrNewRangePoints(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlXPathObjectPtr start; /* the starting point */ - int n_start; - xmlXPathObjectPtr end; /* the ending point */ - int n_end; - - for (n_start = 0;n_start < gen_nb_xmlXPathObjectPtr;n_start++) { - for (n_end = 0;n_end < gen_nb_xmlXPathObjectPtr;n_end++) { - mem_base = xmlMemBlocks(); - start = gen_xmlXPathObjectPtr(n_start, 0); - end = gen_xmlXPathObjectPtr(n_end, 1); - - ret_val = xmlXPtrNewRangePoints(start, end); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlXPathObjectPtr(n_start, start, 0); - des_xmlXPathObjectPtr(n_end, end, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrNewRangePoints", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_start); - printf(" %d", n_end); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrRangeToFunction(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathParserContextPtr ctxt; /* the XPointer Parser context */ - int n_ctxt; - int nargs; /* the number of args */ - int n_nargs; - - for (n_ctxt = 0;n_ctxt < gen_nb_xmlXPathParserContextPtr;n_ctxt++) { - for (n_nargs = 0;n_nargs < gen_nb_int;n_nargs++) { - mem_base = xmlMemBlocks(); - ctxt = gen_xmlXPathParserContextPtr(n_ctxt, 0); - nargs = gen_int(n_nargs, 1); - - xmlXPtrRangeToFunction(ctxt, nargs); - call_tests++; - des_xmlXPathParserContextPtr(n_ctxt, ctxt, 0); - des_int(n_nargs, nargs, 1); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrRangeToFunction", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_ctxt); - printf(" %d", n_nargs); - printf("\n"); - } - } - } - function_tests++; -#endif - - return(test_ret); -} - - -static int -test_xmlXPtrWrapLocationSet(void) { - int test_ret = 0; - -#if defined(LIBXML_XPTR_ENABLED) - int mem_base; - xmlXPathObjectPtr ret_val; - xmlLocationSetPtr val; /* the LocationSet value */ - int n_val; - - for (n_val = 0;n_val < gen_nb_xmlLocationSetPtr;n_val++) { - mem_base = xmlMemBlocks(); - val = gen_xmlLocationSetPtr(n_val, 0); - - ret_val = xmlXPtrWrapLocationSet(val); - desret_xmlXPathObjectPtr(ret_val); - call_tests++; - des_xmlLocationSetPtr(n_val, val, 0); - xmlResetLastError(); - if (mem_base != xmlMemBlocks()) { - printf("Leak of %d blocks found in xmlXPtrWrapLocationSet", - xmlMemBlocks() - mem_base); - test_ret++; - printf(" %d", n_val); - printf("\n"); - } - } - function_tests++; -#endif - - return(test_ret); -} - -static int -test_xpointer(void) { - int test_ret = 0; - - if (quiet == 0) printf("Testing xpointer : 17 of 21 functions ...\n"); - test_ret += test_xmlXPtrBuildNodeList(); - test_ret += test_xmlXPtrEval(); - test_ret += test_xmlXPtrEvalRangePredicate(); - test_ret += test_xmlXPtrLocationSetAdd(); - test_ret += test_xmlXPtrLocationSetCreate(); - test_ret += test_xmlXPtrLocationSetDel(); - test_ret += test_xmlXPtrLocationSetMerge(); - test_ret += test_xmlXPtrLocationSetRemove(); - test_ret += test_xmlXPtrNewCollapsedRange(); - test_ret += test_xmlXPtrNewContext(); - test_ret += test_xmlXPtrNewLocationSetNodeSet(); - test_ret += test_xmlXPtrNewLocationSetNodes(); - test_ret += test_xmlXPtrNewRange(); - test_ret += test_xmlXPtrNewRangeNodeObject(); - test_ret += test_xmlXPtrNewRangeNodePoint(); - test_ret += test_xmlXPtrNewRangeNodes(); - test_ret += test_xmlXPtrNewRangePointNode(); - test_ret += test_xmlXPtrNewRangePoints(); - test_ret += test_xmlXPtrRangeToFunction(); - test_ret += test_xmlXPtrWrapLocationSet(); - - if (test_ret != 0) - printf("Module xpointer: %d errors\n", test_ret); - return(test_ret); -} -static int -test_module(const char *module) { - if (!strcmp(module, "HTMLparser")) return(test_HTMLparser()); - if (!strcmp(module, "HTMLtree")) return(test_HTMLtree()); - if (!strcmp(module, "SAX2")) return(test_SAX2()); - if (!strcmp(module, "c14n")) return(test_c14n()); - if (!strcmp(module, "catalog")) return(test_catalog()); - if (!strcmp(module, "chvalid")) return(test_chvalid()); - if (!strcmp(module, "debugXML")) return(test_debugXML()); - if (!strcmp(module, "dict")) return(test_dict()); - if (!strcmp(module, "encoding")) return(test_encoding()); - if (!strcmp(module, "entities")) return(test_entities()); - if (!strcmp(module, "hash")) return(test_hash()); - if (!strcmp(module, "list")) return(test_list()); - if (!strcmp(module, "nanoftp")) return(test_nanoftp()); - if (!strcmp(module, "nanohttp")) return(test_nanohttp()); - if (!strcmp(module, "parser")) return(test_parser()); - if (!strcmp(module, "parserInternals")) return(test_parserInternals()); - if (!strcmp(module, "pattern")) return(test_pattern()); - if (!strcmp(module, "relaxng")) return(test_relaxng()); - if (!strcmp(module, "schemasInternals")) return(test_schemasInternals()); - if (!strcmp(module, "schematron")) return(test_schematron()); - if (!strcmp(module, "tree")) return(test_tree()); - if (!strcmp(module, "uri")) return(test_uri()); - if (!strcmp(module, "valid")) return(test_valid()); - if (!strcmp(module, "xinclude")) return(test_xinclude()); - if (!strcmp(module, "xmlIO")) return(test_xmlIO()); - if (!strcmp(module, "xmlautomata")) return(test_xmlautomata()); - if (!strcmp(module, "xmlerror")) return(test_xmlerror()); - if (!strcmp(module, "xmlmodule")) return(test_xmlmodule()); - if (!strcmp(module, "xmlreader")) return(test_xmlreader()); - if (!strcmp(module, "xmlregexp")) return(test_xmlregexp()); - if (!strcmp(module, "xmlsave")) return(test_xmlsave()); - if (!strcmp(module, "xmlschemas")) return(test_xmlschemas()); - if (!strcmp(module, "xmlschemastypes")) return(test_xmlschemastypes()); - if (!strcmp(module, "xmlstring")) return(test_xmlstring()); - if (!strcmp(module, "xmlunicode")) return(test_xmlunicode()); - if (!strcmp(module, "xmlwriter")) return(test_xmlwriter()); - if (!strcmp(module, "xpath")) return(test_xpath()); - if (!strcmp(module, "xpathInternals")) return(test_xpathInternals()); - if (!strcmp(module, "xpointer")) return(test_xpointer()); - return(0); -} diff --git a/reactos/lib/3rdparty/libxml2/testchar.c b/reactos/lib/3rdparty/libxml2/testchar.c deleted file mode 100644 index 0d087927a7e..00000000000 --- a/reactos/lib/3rdparty/libxml2/testchar.c +++ /dev/null @@ -1,617 +0,0 @@ -/** - * Test the UTF-8 decoding routines - * - * author: Daniel Veillard - * copy: see Copyright for the status of this software. - */ - -#include -#include -#include -#include - -#include "buf.h" - -int lastError; - -static void errorHandler(void *unused, xmlErrorPtr err) { - if ((unused == NULL) && (err != NULL) && (lastError == 0)) { - lastError = err->code; - } -} - -char document1[100] = "XXXX"; -char document2[100] = ""; - -static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document, - int len, char *data, int forbid1, int forbid2) { - int i; - xmlDocPtr res; - - for (i = 0;i <= 0xFF;i++) { - lastError = 0; - xmlCtxtReset(ctxt); - - data[0] = i; - - res = xmlReadMemory(document, len, "test", NULL, 0); - - if ((i == forbid1) || (i == forbid2)) { - if ((lastError == 0) || (res != NULL)) - fprintf(stderr, - "Failed to detect invalid char for Byte 0x%02X: %c\n", - i, i); - } - - else if ((i == '<') || (i == '&')) { - if ((lastError == 0) || (res != NULL)) - fprintf(stderr, - "Failed to detect illegal char %c for Byte 0x%02X\n", i, i); - } - else if (((i < 0x20) || (i >= 0x80)) && - (i != 0x9) && (i != 0xA) && (i != 0xD)) { - if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL)) - fprintf(stderr, - "Failed to detect invalid char for Byte 0x%02X\n", i); - } - else if (res == NULL) { - fprintf(stderr, - "Failed to parse valid char for Byte 0x%02X : %c\n", i, i); - } - if (res != NULL) - xmlFreeDoc(res); - } -} - -static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document, - int len, char *data) { - int i, j; - xmlDocPtr res; - - for (i = 0x80;i <= 0xFF;i++) { - for (j = 0;j <= 0xFF;j++) { - lastError = 0; - xmlCtxtReset(ctxt); - - data[0] = i; - data[1] = j; - - res = xmlReadMemory(document, len, "test", NULL, 0); - - /* if first bit of first char is set, then second bit must too */ - if ((i & 0x80) && ((i & 0x40) == 0)) { - if ((lastError == 0) || (res != NULL)) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n", - i, j); - } - - /* - * if first bit of first char is set, then second char first - * bits must be 10 - */ - else if ((i & 0x80) && ((j & 0xC0) != 0x80)) { - if ((lastError == 0) || (res != NULL)) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n", - i, j); - } - - /* - * if using a 2 byte encoding then the value must be greater - * than 0x80, i.e. one of bits 5 to 1 of i must be set - */ - else if ((i & 0x80) && ((i & 0x1E) == 0)) { - if ((lastError == 0) || (res != NULL)) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n", - i, j); - } - - /* - * if third bit of first char is set, then the sequence would need - * at least 3 bytes, but we give only 2 ! - */ - else if ((i & 0xE0) == 0xE0) { - if ((lastError == 0) || (res != NULL)) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n", - i, j); - } - - /* - * We should see no error in remaning cases - */ - else if ((lastError != 0) || (res == NULL)) { - fprintf(stderr, - "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j); - } - if (res != NULL) - xmlFreeDoc(res); - } - } -} - -/** - * testDocumentRanges: - * - * Test the correct UTF8 character parsing in context of XML documents - * Those are in-context injection tests checking the parser behaviour on - * edge case values at different point in content, beginning and end of - * CDATA in text or in attribute values. - */ - -static void testDocumentRanges(void) { - xmlParserCtxtPtr ctxt; - char *data; - - /* - * Set up a parsing context using the first document as - * the current input source. - */ - ctxt = xmlNewParserCtxt(); - if (ctxt == NULL) { - fprintf(stderr, "Failed to allocate parser context\n"); - return; - } - - printf("testing 1 byte char in document: 1"); - fflush(stdout); - data = &document1[5]; - data[0] = ' '; - data[1] = ' '; - data[2] = ' '; - data[3] = ' '; - /* test 1 byte injection at beginning of area */ - testDocumentRangeByte1(ctxt, &document1[0], strlen(document1), - data, -1, -1); - printf(" 2"); - fflush(stdout); - data[0] = ' '; - data[1] = ' '; - data[2] = ' '; - data[3] = ' '; - /* test 1 byte injection at end of area */ - testDocumentRangeByte1(ctxt, &document1[0], strlen(document1), - data + 3, -1, -1); - - printf(" 3"); - fflush(stdout); - data = &document2[10]; - data[0] = ' '; - data[1] = ' '; - data[2] = ' '; - data[3] = ' '; - /* test 1 byte injection at beginning of area */ - testDocumentRangeByte1(ctxt, &document2[0], strlen(document2), - data, '\'', -1); - printf(" 4"); - fflush(stdout); - data[0] = ' '; - data[1] = ' '; - data[2] = ' '; - data[3] = ' '; - /* test 1 byte injection at end of area */ - testDocumentRangeByte1(ctxt, &document2[0], strlen(document2), - data + 3, '\'', -1); - printf(" done\n"); - - printf("testing 2 byte char in document: 1"); - fflush(stdout); - data = &document1[5]; - data[0] = ' '; - data[1] = ' '; - data[2] = ' '; - data[3] = ' '; - /* test 2 byte injection at beginning of area */ - testDocumentRangeByte2(ctxt, &document1[0], strlen(document1), - data); - printf(" 2"); - fflush(stdout); - data[0] = ' '; - data[1] = ' '; - data[2] = ' '; - data[3] = ' '; - /* test 2 byte injection at end of area */ - testDocumentRangeByte2(ctxt, &document1[0], strlen(document1), - data + 2); - - printf(" 3"); - fflush(stdout); - data = &document2[10]; - data[0] = ' '; - data[1] = ' '; - data[2] = ' '; - data[3] = ' '; - /* test 2 byte injection at beginning of area */ - testDocumentRangeByte2(ctxt, &document2[0], strlen(document2), - data); - printf(" 4"); - fflush(stdout); - data[0] = ' '; - data[1] = ' '; - data[2] = ' '; - data[3] = ' '; - /* test 2 byte injection at end of area */ - testDocumentRangeByte2(ctxt, &document2[0], strlen(document2), - data + 2); - printf(" done\n"); - - xmlFreeParserCtxt(ctxt); -} - -static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) { - int i = 0; - int len, c; - - data[1] = 0; - data[2] = 0; - data[3] = 0; - for (i = 0;i <= 0xFF;i++) { - data[0] = i; - ctxt->charset = XML_CHAR_ENCODING_UTF8; - - lastError = 0; - c = xmlCurrentChar(ctxt, &len); - if ((i == 0) || (i >= 0x80)) { - /* we must see an error there */ - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Byte 0x%02X\n", i); - } else if (i == 0xD) { - if ((c != 0xA) || (len != 1)) - fprintf(stderr, "Failed to convert char for Byte 0x%02X\n", i); - } else if ((c != i) || (len != 1)) { - fprintf(stderr, "Failed to parse char for Byte 0x%02X\n", i); - } - } -} - -static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) { - int i, j; - int len, c; - - data[2] = 0; - data[3] = 0; - for (i = 0x80;i <= 0xFF;i++) { - for (j = 0;j <= 0xFF;j++) { - data[0] = i; - data[1] = j; - ctxt->charset = XML_CHAR_ENCODING_UTF8; - - lastError = 0; - c = xmlCurrentChar(ctxt, &len); - - /* if first bit of first char is set, then second bit must too */ - if ((i & 0x80) && ((i & 0x40) == 0)) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n", - i, j); - } - - /* - * if first bit of first char is set, then second char first - * bits must be 10 - */ - else if ((i & 0x80) && ((j & 0xC0) != 0x80)) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n", - i, j, c); - } - - /* - * if using a 2 byte encoding then the value must be greater - * than 0x80, i.e. one of bits 5 to 1 of i must be set - */ - else if ((i & 0x80) && ((i & 0x1E) == 0)) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n", - i, j, c); - } - - /* - * if third bit of first char is set, then the sequence would need - * at least 3 bytes, but we give only 2 ! - */ - else if ((i & 0xE0) == 0xE0) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n", - i, j); - } - - /* - * We should see no error in remaning cases - */ - else if ((lastError != 0) || (len != 2)) { - fprintf(stderr, - "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j); - } - - /* - * Finally check the value is right - */ - else if (c != (j & 0x3F) + ((i & 0x1F) << 6)) { - fprintf(stderr, - "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n", - i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c); - } - } - } -} - -static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) { - int i, j, k, K; - int len, c; - unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF}; - int value; - - data[3] = 0; - for (i = 0xE0;i <= 0xFF;i++) { - for (j = 0;j <= 0xFF;j++) { - for (k = 0;k < 6;k++) { - data[0] = i; - data[1] = j; - K = lows[k]; - data[2] = (char) K; - value = (K & 0x3F) + ((j & 0x3F) << 6) + ((i & 0xF) << 12); - ctxt->charset = XML_CHAR_ENCODING_UTF8; - - lastError = 0; - c = xmlCurrentChar(ctxt, &len); - - /* - * if fourth bit of first char is set, then the sequence would need - * at least 4 bytes, but we give only 3 ! - */ - if ((i & 0xF0) == 0xF0) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n", - i, j, K, data[3]); - } - - /* - * The second and the third bytes must start with 10 - */ - else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80)) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n", - i, j, K); - } - - /* - * if using a 3 byte encoding then the value must be greater - * than 0x800, i.e. one of bits 4 to 0 of i must be set or - * the 6th byte of data[1] must be set - */ - else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n", - i, j, K); - } - - /* - * There are values in that range that are not allowed in XML-1.0 - */ - else if (((value > 0xD7FF) && (value <0xE000)) || - ((value > 0xFFFD) && (value <0x10000))) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X\n", - value, i, j, K); - } - - /* - * We should see no error in remaining cases - */ - else if ((lastError != 0) || (len != 3)) { - fprintf(stderr, - "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", - i, j, K); - } - - /* - * Finally check the value is right - */ - else if (c != value) { - fprintf(stderr, - "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", - i, j, data[2], value, c); - } - } - } - } -} - -static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) { - int i, j, k, K, l, L; - int len, c; - unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF}; - int value; - - data[4] = 0; - for (i = 0xF0;i <= 0xFF;i++) { - for (j = 0;j <= 0xFF;j++) { - for (k = 0;k < 6;k++) { - for (l = 0;l < 6;l++) { - data[0] = i; - data[1] = j; - K = lows[k]; - data[2] = (char) K; - L = lows[l]; - data[3] = (char) L; - value = (L & 0x3F) + ((K & 0x3F) << 6) + ((j & 0x3F) << 12) + - ((i & 0x7) << 18); - ctxt->charset = XML_CHAR_ENCODING_UTF8; - - lastError = 0; - c = xmlCurrentChar(ctxt, &len); - - /* - * if fifth bit of first char is set, then the sequence would need - * at least 5 bytes, but we give only 4 ! - */ - if ((i & 0xF8) == 0xF8) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n", - i, j, K, data[3]); - } - - /* - * The second, third and fourth bytes must start with 10 - */ - else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) || - ((L & 0xC0) != 0x80)) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n", - i, j, K, L); - } - - /* - * if using a 3 byte encoding then the value must be greater - * than 0x10000, i.e. one of bits 3 to 0 of i must be set or - * the 6 or 5th byte of j must be set - */ - else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, - "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n", - i, j, K, L); - } - - /* - * There are values in that range that are not allowed in XML-1.0 - */ - else if (((value > 0xD7FF) && (value <0xE000)) || - ((value > 0xFFFD) && (value <0x10000)) || - (value > 0x10FFFF)) { - if (lastError != XML_ERR_INVALID_CHAR) - fprintf(stderr, -"Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n", - value, i, j, K, L); - } - - /* - * We should see no error in remaining cases - */ - else if ((lastError != 0) || (len != 4)) { - fprintf(stderr, - "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n", - i, j, K); - } - - /* - * Finally check the value is right - */ - else if (c != value) { - fprintf(stderr, - "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n", - i, j, data[2], value, c); - } - } - } - } - } -} - -/** - * testCharRanges: - * - * Test the correct UTF8 character parsing in isolation i.e. - * not when parsing a full document, this is less expensive and we can - * cover the full range of UTF-8 chars accepted by XML-1.0 - */ - -static void testCharRanges(void) { - char data[5]; - xmlParserCtxtPtr ctxt; - xmlParserInputBufferPtr buf; - xmlParserInputPtr input; - - memset(data, 0, 5); - - /* - * Set up a parsing context using the above data buffer as - * the current input source. - */ - ctxt = xmlNewParserCtxt(); - if (ctxt == NULL) { - fprintf(stderr, "Failed to allocate parser context\n"); - return; - } - buf = xmlParserInputBufferCreateStatic(data, sizeof(data), - XML_CHAR_ENCODING_NONE); - if (buf == NULL) { - fprintf(stderr, "Failed to allocate input buffer\n"); - goto error; - } - input = xmlNewInputStream(ctxt); - if (input == NULL) { - xmlFreeParserInputBuffer(buf); - goto error; - } - input->filename = NULL; - input->buf = buf; - input->cur = - input->base = xmlBufContent(input->buf->buffer); - input->end = input->base + 4; - inputPush(ctxt, input); - - printf("testing char range: 1"); - fflush(stdout); - testCharRangeByte1(ctxt, data); - printf(" 2"); - fflush(stdout); - testCharRangeByte2(ctxt, data); - printf(" 3"); - fflush(stdout); - testCharRangeByte3(ctxt, data); - printf(" 4"); - fflush(stdout); - testCharRangeByte4(ctxt, data); - printf(" done\n"); - fflush(stdout); - -error: - xmlFreeParserCtxt(ctxt); -} - -int main(void) { - - /* - * this initialize the library and check potential ABI mismatches - * between the version it was compiled for and the actual shared - * library used. - */ - LIBXML_TEST_VERSION - - /* - * Catch errors separately - */ - - xmlSetStructuredErrorFunc(NULL, errorHandler); - - /* - * Run the tests - */ - testCharRanges(); - testDocumentRanges(); - - /* - * Cleanup function for the XML library. - */ - xmlCleanupParser(); - /* - * this is to debug memory for regression tests - */ - xmlMemoryDump(); - return(0); -} diff --git a/reactos/lib/3rdparty/libxml2/testdict.c b/reactos/lib/3rdparty/libxml2/testdict.c deleted file mode 100644 index 4e8581f85c3..00000000000 --- a/reactos/lib/3rdparty/libxml2/testdict.c +++ /dev/null @@ -1,444 +0,0 @@ -#include -#include -#include - -/* #define WITH_PRINT */ - -static const char *seeds1[] = { - "a", "b", "c", - "d", "e", "f", - "g", "h", "i", - "j", "k", "l", - - NULL -}; - -static const char *seeds2[] = { - "m", "n", "o", - "p", "q", "r", - "s", "t", "u", - "v", "w", "x", - - NULL -}; - -#define NB_STRINGS_NS 100 -#define NB_STRINGS_MAX 10000 -#define NB_STRINGS_MIN 10 - -static xmlChar *strings1[NB_STRINGS_MAX]; -static xmlChar *strings2[NB_STRINGS_MAX]; -static const xmlChar *test1[NB_STRINGS_MAX]; -static const xmlChar *test2[NB_STRINGS_MAX]; -static int nbErrors = 0; - -static void fill_strings(void) { - int i, j, k; - - /* - * That's a bit nasty but the output is fine and it doesn't take hours - * there is a small but sufficient number of duplicates, and we have - * ":xxx" and full QNames in the last NB_STRINGS_NS values - */ - for (i = 0; seeds1[i] != NULL; i++) { - strings1[i] = xmlStrdup((const xmlChar *) seeds1[i]); - if (strings1[i] == NULL) { - fprintf(stderr, "Out of memory while generating strings1\n"); - exit(1); - } - } - for (j = 0, k = 0;i < NB_STRINGS_MAX - NB_STRINGS_NS;i++,j++) { - strings1[i] = xmlStrncatNew(strings1[j], strings1[k], -1); - if (strings1[i] == NULL) { - fprintf(stderr, "Out of memory while generating strings1\n"); - exit(1); - } - if (j >= 50) { - j = 0; - k++; - } - } - for (j = 0; (j < 50) && (i < NB_STRINGS_MAX); i++, j+=2) { - strings1[i] = xmlStrncatNew(strings1[j], (const xmlChar *) ":", -1); - if (strings1[i] == NULL) { - fprintf(stderr, "Out of memory while generating strings1\n"); - exit(1); - } - } - for (j = NB_STRINGS_MAX - NB_STRINGS_NS, k = 0; - i < NB_STRINGS_MAX;i++,j++) { - strings1[i] = xmlStrncatNew(strings1[j], strings1[k], -1); - if (strings1[i] == NULL) { - fprintf(stderr, "Out of memory while generating strings1\n"); - exit(1); - } - k += 3; - if (k >= 50) k = 0; - } - - /* - * Now do the same with the second pool of strings - */ - for (i = 0; seeds2[i] != NULL; i++) { - strings2[i] = xmlStrdup((const xmlChar *) seeds2[i]); - if (strings2[i] == NULL) { - fprintf(stderr, "Out of memory while generating strings2\n"); - exit(1); - } - } - for (j = 0, k = 0;i < NB_STRINGS_MAX - NB_STRINGS_NS;i++,j++) { - strings2[i] = xmlStrncatNew(strings2[j], strings2[k], -1); - if (strings2[i] == NULL) { - fprintf(stderr, "Out of memory while generating strings2\n"); - exit(1); - } - if (j >= 50) { - j = 0; - k++; - } - } - for (j = 0; (j < 50) && (i < NB_STRINGS_MAX); i++, j+=2) { - strings2[i] = xmlStrncatNew(strings2[j], (const xmlChar *) ":", -1); - if (strings2[i] == NULL) { - fprintf(stderr, "Out of memory while generating strings2\n"); - exit(1); - } - } - for (j = NB_STRINGS_MAX - NB_STRINGS_NS, k = 0; - i < NB_STRINGS_MAX;i++,j++) { - strings2[i] = xmlStrncatNew(strings2[j], strings2[k], -1); - if (strings2[i] == NULL) { - fprintf(stderr, "Out of memory while generating strings2\n"); - exit(1); - } - k += 3; - if (k >= 50) k = 0; - } - -} - -#ifdef WITH_PRINT -static void print_strings(void) { - int i; - - for (i = 0; i < NB_STRINGS_MAX;i++) { - printf("%s\n", strings1[i]); - } - for (i = 0; i < NB_STRINGS_MAX;i++) { - printf("%s\n", strings2[i]); - } -} -#endif - -static void clean_strings(void) { - int i; - - for (i = 0; i < NB_STRINGS_MAX; i++) { - if (strings1[i] != NULL) /* really should not happen */ - xmlFree(strings1[i]); - } - for (i = 0; i < NB_STRINGS_MAX; i++) { - if (strings2[i] != NULL) /* really should not happen */ - xmlFree(strings2[i]); - } -} - -/* - * This tests the sub-dictionary support - */ -static int run_test2(xmlDictPtr parent) { - int i, j; - xmlDictPtr dict; - int ret = 0; - xmlChar prefix[40]; - xmlChar *cur, *pref; - const xmlChar *tmp; - - dict = xmlDictCreateSub(parent); - if (dict == NULL) { - fprintf(stderr, "Out of memory while creating sub-dictionary\n"); - exit(1); - } - memset(test2, 0, sizeof(test2)); - - /* - * Fill in NB_STRINGS_MIN, at this point the dictionary should not grow - * and we allocate all those doing the fast key computations - * All the strings are based on a different seeds subset so we know - * they are allocated in the main dictionary, not coming from the parent - */ - for (i = 0;i < NB_STRINGS_MIN;i++) { - test2[i] = xmlDictLookup(dict, strings2[i], -1); - if (test2[i] == NULL) { - fprintf(stderr, "Failed lookup for '%s'\n", strings2[i]); - ret = 1; - nbErrors++; - } - } - j = NB_STRINGS_MAX - NB_STRINGS_NS; - /* ":foo" like strings2 */ - for (i = 0;i < NB_STRINGS_MIN;i++, j++) { - test2[j] = xmlDictLookup(dict, strings2[j], xmlStrlen(strings2[j])); - if (test2[j] == NULL) { - fprintf(stderr, "Failed lookup for '%s'\n", strings2[j]); - ret = 1; - nbErrors++; - } - } - /* "a:foo" like strings2 */ - j = NB_STRINGS_MAX - NB_STRINGS_MIN; - for (i = 0;i < NB_STRINGS_MIN;i++, j++) { - test2[j] = xmlDictLookup(dict, strings2[j], xmlStrlen(strings2[j])); - if (test2[j] == NULL) { - fprintf(stderr, "Failed lookup for '%s'\n", strings2[j]); - ret = 1; - nbErrors++; - } - } - - /* - * At this point allocate all the strings - * the dictionary will grow in the process, reallocate more string tables - * and switch to the better key generator - */ - for (i = 0;i < NB_STRINGS_MAX;i++) { - if (test2[i] != NULL) - continue; - test2[i] = xmlDictLookup(dict, strings2[i], -1); - if (test2[i] == NULL) { - fprintf(stderr, "Failed lookup for '%s'\n", strings2[i]); - ret = 1; - nbErrors++; - } - } - - /* - * Now we can start to test things, first that all strings2 belongs to - * the dict, and that none of them was actually allocated in the parent - */ - for (i = 0;i < NB_STRINGS_MAX;i++) { - if (!xmlDictOwns(dict, test2[i])) { - fprintf(stderr, "Failed ownership failure for '%s'\n", - strings2[i]); - ret = 1; - nbErrors++; - } - if (xmlDictOwns(parent, test2[i])) { - fprintf(stderr, "Failed parent ownership failure for '%s'\n", - strings2[i]); - ret = 1; - nbErrors++; - } - } - - /* - * Also verify that all strings from the parent are seen from the subdict - */ - for (i = 0;i < NB_STRINGS_MAX;i++) { - if (!xmlDictOwns(dict, test1[i])) { - fprintf(stderr, "Failed sub-ownership failure for '%s'\n", - strings1[i]); - ret = 1; - nbErrors++; - } - } - - /* - * Then that another lookup to the string in sub will return the same - */ - for (i = 0;i < NB_STRINGS_MAX;i++) { - if (xmlDictLookup(dict, strings2[i], -1) != test2[i]) { - fprintf(stderr, "Failed re-lookup check for %d, '%s'\n", - i, strings2[i]); - ret = 1; - nbErrors++; - } - } - /* - * But also that any lookup for a string in the parent will be provided - * as in the parent - */ - for (i = 0;i < NB_STRINGS_MAX;i++) { - if (xmlDictLookup(dict, strings1[i], -1) != test1[i]) { - fprintf(stderr, "Failed parent string lookup check for %d, '%s'\n", - i, strings1[i]); - ret = 1; - nbErrors++; - } - } - - /* - * check the QName lookups - */ - for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) { - cur = strings2[i]; - pref = &prefix[0]; - while (*cur != ':') *pref++ = *cur++; - cur++; - *pref = 0; - tmp = xmlDictQLookup(dict, &prefix[0], cur); - if (xmlDictQLookup(dict, &prefix[0], cur) != test2[i]) { - fprintf(stderr, "Failed lookup check for '%s':'%s'\n", - &prefix[0], cur); - ret = 1; - nbErrors++; - } - } - /* - * check the QName lookups for strings from the parent - */ - for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) { - cur = strings1[i]; - pref = &prefix[0]; - while (*cur != ':') *pref++ = *cur++; - cur++; - *pref = 0; - tmp = xmlDictQLookup(dict, &prefix[0], cur); - if (xmlDictQLookup(dict, &prefix[0], cur) != test1[i]) { - fprintf(stderr, "Failed parent lookup check for '%s':'%s'\n", - &prefix[0], cur); - ret = 1; - nbErrors++; - } - } - - xmlDictFree(dict); - return(ret); -} - -/* - * Test a single dictionary - */ -static int run_test1(void) { - int i, j; - xmlDictPtr dict; - int ret = 0; - xmlChar prefix[40]; - xmlChar *cur, *pref; - const xmlChar *tmp; - - dict = xmlDictCreate(); - if (dict == NULL) { - fprintf(stderr, "Out of memory while creating dictionary\n"); - exit(1); - } - memset(test1, 0, sizeof(test1)); - - /* - * Fill in NB_STRINGS_MIN, at this point the dictionary should not grow - * and we allocate all those doing the fast key computations - */ - for (i = 0;i < NB_STRINGS_MIN;i++) { - test1[i] = xmlDictLookup(dict, strings1[i], -1); - if (test1[i] == NULL) { - fprintf(stderr, "Failed lookup for '%s'\n", strings1[i]); - ret = 1; - nbErrors++; - } - } - j = NB_STRINGS_MAX - NB_STRINGS_NS; - /* ":foo" like strings1 */ - for (i = 0;i < NB_STRINGS_MIN;i++, j++) { - test1[j] = xmlDictLookup(dict, strings1[j], xmlStrlen(strings1[j])); - if (test1[j] == NULL) { - fprintf(stderr, "Failed lookup for '%s'\n", strings1[j]); - ret = 1; - nbErrors++; - } - } - /* "a:foo" like strings1 */ - j = NB_STRINGS_MAX - NB_STRINGS_MIN; - for (i = 0;i < NB_STRINGS_MIN;i++, j++) { - test1[j] = xmlDictLookup(dict, strings1[j], xmlStrlen(strings1[j])); - if (test1[j] == NULL) { - fprintf(stderr, "Failed lookup for '%s'\n", strings1[j]); - ret = 1; - nbErrors++; - } - } - - /* - * At this point allocate all the strings - * the dictionary will grow in the process, reallocate more string tables - * and switch to the better key generator - */ - for (i = 0;i < NB_STRINGS_MAX;i++) { - if (test1[i] != NULL) - continue; - test1[i] = xmlDictLookup(dict, strings1[i], -1); - if (test1[i] == NULL) { - fprintf(stderr, "Failed lookup for '%s'\n", strings1[i]); - ret = 1; - nbErrors++; - } - } - - /* - * Now we can start to test things, first that all strings1 belongs to - * the dict - */ - for (i = 0;i < NB_STRINGS_MAX;i++) { - if (!xmlDictOwns(dict, test1[i])) { - fprintf(stderr, "Failed ownership failure for '%s'\n", - strings1[i]); - ret = 1; - nbErrors++; - } - } - - /* - * Then that another lookup to the string will return the same - */ - for (i = 0;i < NB_STRINGS_MAX;i++) { - if (xmlDictLookup(dict, strings1[i], -1) != test1[i]) { - fprintf(stderr, "Failed re-lookup check for %d, '%s'\n", - i, strings1[i]); - ret = 1; - nbErrors++; - } - } - - /* - * More complex, check the QName lookups - */ - for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) { - cur = strings1[i]; - pref = &prefix[0]; - while (*cur != ':') *pref++ = *cur++; - cur++; - *pref = 0; - tmp = xmlDictQLookup(dict, &prefix[0], cur); - if (xmlDictQLookup(dict, &prefix[0], cur) != test1[i]) { - fprintf(stderr, "Failed lookup check for '%s':'%s'\n", - &prefix[0], cur); - ret = 1; - nbErrors++; - } - } - - run_test2(dict); - - xmlDictFree(dict); - return(ret); -} - -int main(void) -{ - int ret; - - LIBXML_TEST_VERSION - fill_strings(); -#ifdef WITH_PRINT - print_strings(); -#endif - ret = run_test1(); - if (ret == 0) { - printf("dictionary tests succeeded %d strings\n", 2 * NB_STRINGS_MAX); - } else { - printf("dictionary tests failed with %d errors\n", nbErrors); - } - clean_strings(); - xmlCleanupParser(); - xmlMemoryDump(); - return(ret); -} diff --git a/reactos/lib/3rdparty/libxml2/testdso.c b/reactos/lib/3rdparty/libxml2/testdso.c deleted file mode 100644 index bd4ff0865d9..00000000000 --- a/reactos/lib/3rdparty/libxml2/testdso.c +++ /dev/null @@ -1,12 +0,0 @@ -#include - -#define IN_LIBXML -#include "libxml/xmlexports.h" - -XMLPUBFUN int hello_world(void); - -int hello_world(void) -{ - printf("Success!\n"); - return 0; -} diff --git a/reactos/lib/3rdparty/libxml2/testlimits.c b/reactos/lib/3rdparty/libxml2/testlimits.c deleted file mode 100644 index 7ee6fb9721a..00000000000 --- a/reactos/lib/3rdparty/libxml2/testlimits.c +++ /dev/null @@ -1,1634 +0,0 @@ -/* - * testlimits.c: C program to run libxml2 regression tests checking various - * limits in document size. Will consume a lot of RAM and CPU cycles - * - * To compile on Unixes: - * cc -o testlimits `xml2-config --cflags` testlimits.c `xml2-config --libs` -lpthread - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#ifdef HAVE_CONFIG_H -#include "libxml.h" -#else -#include -#endif - -#if !defined(_WIN32) || defined(__CYGWIN__) -#include -#endif -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#ifdef LIBXML_READER_ENABLED -#include -#endif - -static int verbose = 0; -static int tests_quiet = 0; - -/************************************************************************ - * * - * time handling * - * * - ************************************************************************/ - -/* maximum time for one parsing before declaring a timeout */ -#define MAX_TIME 2 /* seconds */ - -static clock_t t0; -int timeout = 0; - -static void reset_timout(void) { - timeout = 0; - t0 = clock(); -} - -static int check_time(void) { - clock_t tnow = clock(); - if (((tnow - t0) / CLOCKS_PER_SEC) > MAX_TIME) { - timeout = 1; - return(0); - } - return(1); -} - -/************************************************************************ - * * - * Huge document generator * - * * - ************************************************************************/ - -#include - -/* - * Huge documents are built using fixed start and end chunks - * and filling between the two an unconventional amount of char data - */ -typedef struct hugeTest hugeTest; -typedef hugeTest *hugeTestPtr; -struct hugeTest { - const char *description; - const char *name; - const char *start; - const char *end; -}; - -static struct hugeTest hugeTests[] = { - { "Huge text node", "huge:textNode", "", "" }, - { "Huge attribute node", "huge:attrNode", "" }, - { "Huge comment node", "huge:commentNode", "" }, - { "Huge PI node", "huge:piNode", "" }, -}; - -static const char *current; -static int rlen; -static unsigned int currentTest = 0; -static int instate = 0; - -/** - * hugeMatch: - * @URI: an URI to test - * - * Check for an huge: query - * - * Returns 1 if yes and 0 if another Input module should be used - */ -static int -hugeMatch(const char * URI) { - if ((URI != NULL) && (!strncmp(URI, "huge:", 5))) - return(1); - return(0); -} - -/** - * hugeOpen: - * @URI: an URI to test - * - * Return a pointer to the huge: query handler, in this example simply - * the current pointer... - * - * Returns an Input context or NULL in case or error - */ -static void * -hugeOpen(const char * URI) { - if ((URI == NULL) || (strncmp(URI, "huge:", 5))) - return(NULL); - - for (currentTest = 0;currentTest < sizeof(hugeTests)/sizeof(hugeTests[0]); - currentTest++) - if (!strcmp(hugeTests[currentTest].name, URI)) - goto found; - - return(NULL); - -found: - rlen = strlen(hugeTests[currentTest].start); - current = hugeTests[currentTest].start; - instate = 0; - return((void *) current); -} - -/** - * hugeClose: - * @context: the read context - * - * Close the huge: query handler - * - * Returns 0 or -1 in case of error - */ -static int -hugeClose(void * context) { - if (context == NULL) return(-1); - fprintf(stderr, "\n"); - return(0); -} - -#define CHUNK 4096 - -char filling[CHUNK + 1]; - -static void fillFilling(void) { - int i; - - for (i = 0;i < CHUNK;i++) { - filling[i] = 'a'; - } - filling[CHUNK] = 0; -} - -size_t maxlen = 64 * 1024 * 1024; -size_t curlen = 0; -size_t dotlen; - -/** - * hugeRead: - * @context: the read context - * @buffer: where to store data - * @len: number of bytes to read - * - * Implement an huge: query read. - * - * Returns the number of bytes read or -1 in case of error - */ -static int -hugeRead(void *context, char *buffer, int len) -{ - if ((context == NULL) || (buffer == NULL) || (len < 0)) - return (-1); - - if (instate == 0) { - if (len >= rlen) { - len = rlen; - rlen = 0; - memcpy(buffer, current, len); - instate = 1; - curlen = 0; - dotlen = maxlen / 10; - } else { - memcpy(buffer, current, len); - rlen -= len; - current += len; - } - } else if (instate == 2) { - if (len >= rlen) { - len = rlen; - rlen = 0; - memcpy(buffer, current, len); - instate = 3; - curlen = 0; - } else { - memcpy(buffer, current, len); - rlen -= len; - current += len; - } - } else if (instate == 1) { - if (len > CHUNK) len = CHUNK; - memcpy(buffer, &filling[0], len); - curlen += len; - if (curlen >= maxlen) { - rlen = strlen(hugeTests[currentTest].end); - current = hugeTests[currentTest].end; - instate = 2; - } else { - if (curlen > dotlen) { - fprintf(stderr, "."); - dotlen += maxlen / 10; - } - } - } else - len = 0; - return (len); -} - -/************************************************************************ - * * - * Crazy document generator * - * * - ************************************************************************/ - -unsigned int crazy_indx = 0; - -const char *crazy = "\ -\ -\ -\ -\ -\ -\ -]>\ -\ -\ -\ -\ -\ -foo\ -\ -\ -\ -"; - -/** - * crazyMatch: - * @URI: an URI to test - * - * Check for a crazy: query - * - * Returns 1 if yes and 0 if another Input module should be used - */ -static int -crazyMatch(const char * URI) { - if ((URI != NULL) && (!strncmp(URI, "crazy:", 6))) - return(1); - return(0); -} - -/** - * crazyOpen: - * @URI: an URI to test - * - * Return a pointer to the crazy: query handler, in this example simply - * the current pointer... - * - * Returns an Input context or NULL in case or error - */ -static void * -crazyOpen(const char * URI) { - if ((URI == NULL) || (strncmp(URI, "crazy:", 6))) - return(NULL); - - if (crazy_indx > strlen(crazy)) - return(NULL); - reset_timout(); - rlen = crazy_indx; - current = &crazy[0]; - instate = 0; - return((void *) current); -} - -/** - * crazyClose: - * @context: the read context - * - * Close the crazy: query handler - * - * Returns 0 or -1 in case of error - */ -static int -crazyClose(void * context) { - if (context == NULL) return(-1); - return(0); -} - - -/** - * crazyRead: - * @context: the read context - * @buffer: where to store data - * @len: number of bytes to read - * - * Implement an crazy: query read. - * - * Returns the number of bytes read or -1 in case of error - */ -static int -crazyRead(void *context, char *buffer, int len) -{ - if ((context == NULL) || (buffer == NULL) || (len < 0)) - return (-1); - - if ((check_time() <= 0) && (instate == 1)) { - fprintf(stderr, "\ntimeout in crazy(%d)\n", crazy_indx); - rlen = strlen(crazy) - crazy_indx; - current = &crazy[crazy_indx]; - instate = 2; - } - if (instate == 0) { - if (len >= rlen) { - len = rlen; - rlen = 0; - memcpy(buffer, current, len); - instate = 1; - curlen = 0; - } else { - memcpy(buffer, current, len); - rlen -= len; - current += len; - } - } else if (instate == 2) { - if (len >= rlen) { - len = rlen; - rlen = 0; - memcpy(buffer, current, len); - instate = 3; - curlen = 0; - } else { - memcpy(buffer, current, len); - rlen -= len; - current += len; - } - } else if (instate == 1) { - if (len > CHUNK) len = CHUNK; - memcpy(buffer, &filling[0], len); - curlen += len; - if (curlen >= maxlen) { - rlen = strlen(crazy) - crazy_indx; - current = &crazy[crazy_indx]; - instate = 2; - } - } else - len = 0; - return (len); -} -/************************************************************************ - * * - * Libxml2 specific routines * - * * - ************************************************************************/ - -static int nb_tests = 0; -static int nb_errors = 0; -static int nb_leaks = 0; -static int extraMemoryFromResolver = 0; - -/* - * We need to trap calls to the resolver to not account memory for the catalog - * which is shared to the current running test. We also don't want to have - * network downloads modifying tests. - */ -static xmlParserInputPtr -testExternalEntityLoader(const char *URL, const char *ID, - xmlParserCtxtPtr ctxt) { - xmlParserInputPtr ret; - int memused = xmlMemUsed(); - - ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); - extraMemoryFromResolver += xmlMemUsed() - memused; - - return(ret); -} - -/* - * Trapping the error messages at the generic level to grab the equivalent of - * stderr messages on CLI tools. - */ -static char testErrors[32769]; -static int testErrorsSize = 0; - -static void XMLCDECL -channel(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { - va_list args; - int res; - - if (testErrorsSize >= 32768) - return; - va_start(args, msg); - res = vsnprintf(&testErrors[testErrorsSize], - 32768 - testErrorsSize, - msg, args); - va_end(args); - if (testErrorsSize + res >= 32768) { - /* buffer is full */ - testErrorsSize = 32768; - testErrors[testErrorsSize] = 0; - } else { - testErrorsSize += res; - } - testErrors[testErrorsSize] = 0; -} - -/** - * xmlParserPrintFileContext: - * @input: an xmlParserInputPtr input - * - * Displays current context within the input content for error tracking - */ - -static void -xmlParserPrintFileContextInternal(xmlParserInputPtr input , - xmlGenericErrorFunc chanl, void *data ) { - const xmlChar *cur, *base; - unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */ - xmlChar content[81]; /* space for 80 chars + line terminator */ - xmlChar *ctnt; - - if (input == NULL) return; - cur = input->cur; - base = input->base; - /* skip backwards over any end-of-lines */ - while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) { - cur--; - } - n = 0; - /* search backwards for beginning-of-line (to max buff size) */ - while ((n++ < (sizeof(content)-1)) && (cur > base) && - (*(cur) != '\n') && (*(cur) != '\r')) - cur--; - if ((*(cur) == '\n') || (*(cur) == '\r')) cur++; - /* calculate the error position in terms of the current position */ - col = input->cur - cur; - /* search forward for end-of-line (to max buff size) */ - n = 0; - ctnt = content; - /* copy selected text to our buffer */ - while ((*cur != 0) && (*(cur) != '\n') && - (*(cur) != '\r') && (n < sizeof(content)-1)) { - *ctnt++ = *cur++; - n++; - } - *ctnt = 0; - /* print out the selected text */ - chanl(data ,"%s\n", content); - /* create blank line with problem pointer */ - n = 0; - ctnt = content; - /* (leave buffer space for pointer + line terminator) */ - while ((nfile; - line = err->line; - code = err->code; - domain = err->domain; - level = err->level; - node = err->node; - if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) || - (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) || - (domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) { - ctxt = err->ctxt; - } - str = err->message; - - if (code == XML_ERR_OK) - return; - - if ((node != NULL) && (node->type == XML_ELEMENT_NODE)) - name = node->name; - - /* - * Maintain the compatibility with the legacy error handling - */ - if (ctxt != NULL) { - input = ctxt->input; - if ((input != NULL) && (input->filename == NULL) && - (ctxt->inputNr > 1)) { - cur = input; - input = ctxt->inputTab[ctxt->inputNr - 2]; - } - if (input != NULL) { - if (input->filename) - channel(data, "%s:%d: ", input->filename, input->line); - else if ((line != 0) && (domain == XML_FROM_PARSER)) - channel(data, "Entity: line %d: ", input->line); - } - } else { - if (file != NULL) - channel(data, "%s:%d: ", file, line); - else if ((line != 0) && (domain == XML_FROM_PARSER)) - channel(data, "Entity: line %d: ", line); - } - if (name != NULL) { - channel(data, "element %s: ", name); - } - if (code == XML_ERR_OK) - return; - switch (domain) { - case XML_FROM_PARSER: - channel(data, "parser "); - break; - case XML_FROM_NAMESPACE: - channel(data, "namespace "); - break; - case XML_FROM_DTD: - case XML_FROM_VALID: - channel(data, "validity "); - break; - case XML_FROM_HTML: - channel(data, "HTML parser "); - break; - case XML_FROM_MEMORY: - channel(data, "memory "); - break; - case XML_FROM_OUTPUT: - channel(data, "output "); - break; - case XML_FROM_IO: - channel(data, "I/O "); - break; - case XML_FROM_XINCLUDE: - channel(data, "XInclude "); - break; - case XML_FROM_XPATH: - channel(data, "XPath "); - break; - case XML_FROM_XPOINTER: - channel(data, "parser "); - break; - case XML_FROM_REGEXP: - channel(data, "regexp "); - break; - case XML_FROM_MODULE: - channel(data, "module "); - break; - case XML_FROM_SCHEMASV: - channel(data, "Schemas validity "); - break; - case XML_FROM_SCHEMASP: - channel(data, "Schemas parser "); - break; - case XML_FROM_RELAXNGP: - channel(data, "Relax-NG parser "); - break; - case XML_FROM_RELAXNGV: - channel(data, "Relax-NG validity "); - break; - case XML_FROM_CATALOG: - channel(data, "Catalog "); - break; - case XML_FROM_C14N: - channel(data, "C14N "); - break; - case XML_FROM_XSLT: - channel(data, "XSLT "); - break; - default: - break; - } - if (code == XML_ERR_OK) - return; - switch (level) { - case XML_ERR_NONE: - channel(data, ": "); - break; - case XML_ERR_WARNING: - channel(data, "warning : "); - break; - case XML_ERR_ERROR: - channel(data, "error : "); - break; - case XML_ERR_FATAL: - channel(data, "error : "); - break; - } - if (code == XML_ERR_OK) - return; - if (str != NULL) { - int len; - len = xmlStrlen((const xmlChar *)str); - if ((len > 0) && (str[len - 1] != '\n')) - channel(data, "%s\n", str); - else - channel(data, "%s", str); - } else { - channel(data, "%s\n", "out of memory error"); - } - if (code == XML_ERR_OK) - return; - - if (ctxt != NULL) { - xmlParserPrintFileContextInternal(input, channel, data); - if (cur != NULL) { - if (cur->filename) - channel(data, "%s:%d: \n", cur->filename, cur->line); - else if ((line != 0) && (domain == XML_FROM_PARSER)) - channel(data, "Entity: line %d: \n", cur->line); - xmlParserPrintFileContextInternal(cur, channel, data); - } - } - if ((domain == XML_FROM_XPATH) && (err->str1 != NULL) && - (err->int1 < 100) && - (err->int1 < xmlStrlen((const xmlChar *)err->str1))) { - xmlChar buf[150]; - int i; - - channel(data, "%s\n", err->str1); - for (i=0;i < err->int1;i++) - buf[i] = ' '; - buf[i++] = '^'; - buf[i] = 0; - channel(data, "%s\n", buf); - } -} - -static void -initializeLibxml2(void) { - xmlGetWarningsDefaultValue = 0; - xmlPedanticParserDefault(0); - - xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup); - xmlInitParser(); - xmlSetExternalEntityLoader(testExternalEntityLoader); - xmlSetStructuredErrorFunc(NULL, testStructuredErrorHandler); - /* - * register the new I/O handlers - */ - if (xmlRegisterInputCallbacks(hugeMatch, hugeOpen, - hugeRead, hugeClose) < 0) { - fprintf(stderr, "failed to register Huge handlers\n"); - exit(1); - } - if (xmlRegisterInputCallbacks(crazyMatch, crazyOpen, - crazyRead, crazyClose) < 0) { - fprintf(stderr, "failed to register Crazy handlers\n"); - exit(1); - } -} - -/************************************************************************ - * * - * SAX empty callbacks * - * * - ************************************************************************/ - -unsigned long callbacks = 0; - -/** - * isStandaloneCallback: - * @ctxt: An XML parser context - * - * Is this document tagged standalone ? - * - * Returns 1 if true - */ -static int -isStandaloneCallback(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - return (0); -} - -/** - * hasInternalSubsetCallback: - * @ctxt: An XML parser context - * - * Does this document has an internal subset - * - * Returns 1 if true - */ -static int -hasInternalSubsetCallback(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - return (0); -} - -/** - * hasExternalSubsetCallback: - * @ctxt: An XML parser context - * - * Does this document has an external subset - * - * Returns 1 if true - */ -static int -hasExternalSubsetCallback(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - return (0); -} - -/** - * internalSubsetCallback: - * @ctxt: An XML parser context - * - * Does this document has an internal subset - */ -static void -internalSubsetCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED, - const xmlChar * ExternalID ATTRIBUTE_UNUSED, - const xmlChar * SystemID ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * externalSubsetCallback: - * @ctxt: An XML parser context - * - * Does this document has an external subset - */ -static void -externalSubsetCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED, - const xmlChar * ExternalID ATTRIBUTE_UNUSED, - const xmlChar * SystemID ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * resolveEntityCallback: - * @ctxt: An XML parser context - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * - * Special entity resolver, better left to the parser, it has - * more context than the application layer. - * The default behaviour is to NOT resolve the entities, in that case - * the ENTITY_REF nodes are built in the structure (and the parameter - * values). - * - * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. - */ -static xmlParserInputPtr -resolveEntityCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * publicId ATTRIBUTE_UNUSED, - const xmlChar * systemId ATTRIBUTE_UNUSED) -{ - callbacks++; - return (NULL); -} - -/** - * getEntityCallback: - * @ctxt: An XML parser context - * @name: The entity name - * - * Get an entity by name - * - * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour. - */ -static xmlEntityPtr -getEntityCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED) -{ - callbacks++; - return (NULL); -} - -/** - * getParameterEntityCallback: - * @ctxt: An XML parser context - * @name: The entity name - * - * Get a parameter entity by name - * - * Returns the xmlParserInputPtr - */ -static xmlEntityPtr -getParameterEntityCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED) -{ - callbacks++; - return (NULL); -} - - -/** - * entityDeclCallback: - * @ctxt: An XML parser context - * @name: the entity name - * @type: the entity type - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * @content: the entity value (without processing). - * - * An entity definition has been parsed - */ -static void -entityDeclCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED, - int type ATTRIBUTE_UNUSED, - const xmlChar * publicId ATTRIBUTE_UNUSED, - const xmlChar * systemId ATTRIBUTE_UNUSED, - xmlChar * content ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * attributeDeclCallback: - * @ctxt: An XML parser context - * @name: the attribute name - * @type: the attribute type - * - * An attribute definition has been parsed - */ -static void -attributeDeclCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * elem ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED, - int type ATTRIBUTE_UNUSED, int def ATTRIBUTE_UNUSED, - const xmlChar * defaultValue ATTRIBUTE_UNUSED, - xmlEnumerationPtr tree ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * elementDeclCallback: - * @ctxt: An XML parser context - * @name: the element name - * @type: the element type - * @content: the element value (without processing). - * - * An element definition has been parsed - */ -static void -elementDeclCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED, - int type ATTRIBUTE_UNUSED, - xmlElementContentPtr content ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * notationDeclCallback: - * @ctxt: An XML parser context - * @name: The name of the notation - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * - * What to do when a notation declaration has been parsed. - */ -static void -notationDeclCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED, - const xmlChar * publicId ATTRIBUTE_UNUSED, - const xmlChar * systemId ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * unparsedEntityDeclCallback: - * @ctxt: An XML parser context - * @name: The name of the entity - * @publicId: The public ID of the entity - * @systemId: The system ID of the entity - * @notationName: the name of the notation - * - * What to do when an unparsed entity declaration is parsed - */ -static void -unparsedEntityDeclCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED, - const xmlChar * publicId ATTRIBUTE_UNUSED, - const xmlChar * systemId ATTRIBUTE_UNUSED, - const xmlChar * notationName ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * setDocumentLocatorCallback: - * @ctxt: An XML parser context - * @loc: A SAX Locator - * - * Receive the document locator at startup, actually xmlDefaultSAXLocator - * Everything is available on the context, so this is useless in our case. - */ -static void -setDocumentLocatorCallback(void *ctx ATTRIBUTE_UNUSED, - xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * startDocumentCallback: - * @ctxt: An XML parser context - * - * called when the document start being processed. - */ -static void -startDocumentCallback(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * endDocumentCallback: - * @ctxt: An XML parser context - * - * called when the document end has been detected. - */ -static void -endDocumentCallback(void *ctx ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -#if 0 -/** - * startElementCallback: - * @ctxt: An XML parser context - * @name: The element name - * - * called when an opening tag has been processed. - */ -static void -startElementCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED, - const xmlChar ** atts ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * endElementCallback: - * @ctxt: An XML parser context - * @name: The element name - * - * called when the end of an element has been detected. - */ -static void -endElementCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} -#endif - -/** - * charactersCallback: - * @ctxt: An XML parser context - * @ch: a xmlChar string - * @len: the number of xmlChar - * - * receiving some chars from the parser. - * Question: how much at a time ??? - */ -static void -charactersCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * ch ATTRIBUTE_UNUSED, - int len ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * referenceCallback: - * @ctxt: An XML parser context - * @name: The entity name - * - * called when an entity reference is detected. - */ -static void -referenceCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * name ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * ignorableWhitespaceCallback: - * @ctxt: An XML parser context - * @ch: a xmlChar string - * @start: the first char in the string - * @len: the number of xmlChar - * - * receiving some ignorable whitespaces from the parser. - * Question: how much at a time ??? - */ -static void -ignorableWhitespaceCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * ch ATTRIBUTE_UNUSED, - int len ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * processingInstructionCallback: - * @ctxt: An XML parser context - * @target: the target name - * @data: the PI data's - * @len: the number of xmlChar - * - * A processing instruction has been parsed. - */ -static void -processingInstructionCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * target ATTRIBUTE_UNUSED, - const xmlChar * data ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * cdataBlockCallback: - * @ctx: the user data (XML parser context) - * @value: The pcdata content - * @len: the block length - * - * called when a pcdata block has been parsed - */ -static void -cdataBlockCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * value ATTRIBUTE_UNUSED, - int len ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * commentCallback: - * @ctxt: An XML parser context - * @value: the comment content - * - * A comment has been parsed. - */ -static void -commentCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * value ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * warningCallback: - * @ctxt: An XML parser context - * @msg: the message to display/transmit - * @...: extra parameters for the message display - * - * Display and format a warning messages, gives file, line, position and - * extra parameters. - */ -static void XMLCDECL -warningCallback(void *ctx ATTRIBUTE_UNUSED, - const char *msg ATTRIBUTE_UNUSED, ...) -{ - callbacks++; - return; -} - -/** - * errorCallback: - * @ctxt: An XML parser context - * @msg: the message to display/transmit - * @...: extra parameters for the message display - * - * Display and format a error messages, gives file, line, position and - * extra parameters. - */ -static void XMLCDECL -errorCallback(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED, - ...) -{ - callbacks++; - return; -} - -/** - * fatalErrorCallback: - * @ctxt: An XML parser context - * @msg: the message to display/transmit - * @...: extra parameters for the message display - * - * Display and format a fatalError messages, gives file, line, position and - * extra parameters. - */ -static void XMLCDECL -fatalErrorCallback(void *ctx ATTRIBUTE_UNUSED, - const char *msg ATTRIBUTE_UNUSED, ...) -{ - return; -} - - -/* - * SAX2 specific callbacks - */ - -/** - * startElementNsCallback: - * @ctxt: An XML parser context - * @name: The element name - * - * called when an opening tag has been processed. - */ -static void -startElementNsCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * localname ATTRIBUTE_UNUSED, - const xmlChar * prefix ATTRIBUTE_UNUSED, - const xmlChar * URI ATTRIBUTE_UNUSED, - int nb_namespaces ATTRIBUTE_UNUSED, - const xmlChar ** namespaces ATTRIBUTE_UNUSED, - int nb_attributes ATTRIBUTE_UNUSED, - int nb_defaulted ATTRIBUTE_UNUSED, - const xmlChar ** attributes ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -/** - * endElementCallback: - * @ctxt: An XML parser context - * @name: The element name - * - * called when the end of an element has been detected. - */ -static void -endElementNsCallback(void *ctx ATTRIBUTE_UNUSED, - const xmlChar * localname ATTRIBUTE_UNUSED, - const xmlChar * prefix ATTRIBUTE_UNUSED, - const xmlChar * URI ATTRIBUTE_UNUSED) -{ - callbacks++; - return; -} - -static xmlSAXHandler callbackSAX2HandlerStruct = { - internalSubsetCallback, - isStandaloneCallback, - hasInternalSubsetCallback, - hasExternalSubsetCallback, - resolveEntityCallback, - getEntityCallback, - entityDeclCallback, - notationDeclCallback, - attributeDeclCallback, - elementDeclCallback, - unparsedEntityDeclCallback, - setDocumentLocatorCallback, - startDocumentCallback, - endDocumentCallback, - NULL, - NULL, - referenceCallback, - charactersCallback, - ignorableWhitespaceCallback, - processingInstructionCallback, - commentCallback, - warningCallback, - errorCallback, - fatalErrorCallback, - getParameterEntityCallback, - cdataBlockCallback, - externalSubsetCallback, - XML_SAX2_MAGIC, - NULL, - startElementNsCallback, - endElementNsCallback, - NULL -}; - -static xmlSAXHandlerPtr callbackSAX2Handler = &callbackSAX2HandlerStruct; - -/************************************************************************ - * * - * The tests front-ends * - * * - ************************************************************************/ - -/** - * readerTest: - * @filename: the file to parse - * @max_size: size of the limit to test - * @options: parsing options - * @fail: should a failure be reported - * - * Parse a memory generated file using SAX - * - * Returns 0 in case of success, an error code otherwise - */ -static int -saxTest(const char *filename, size_t limit, int options, int fail) { - int res = 0; - xmlParserCtxtPtr ctxt; - xmlDocPtr doc; - xmlSAXHandlerPtr old_sax; - - nb_tests++; - - maxlen = limit; - ctxt = xmlNewParserCtxt(); - if (ctxt == NULL) { - fprintf(stderr, "Failed to create parser context\n"); - return(1); - } - old_sax = ctxt->sax; - ctxt->sax = callbackSAX2Handler; - ctxt->userData = NULL; - doc = xmlCtxtReadFile(ctxt, filename, NULL, options); - - if (doc != NULL) { - fprintf(stderr, "SAX parsing generated a document !\n"); - xmlFreeDoc(doc); - res = 0; - } else if (ctxt->wellFormed == 0) { - if (fail) - res = 0; - else { - fprintf(stderr, "Failed to parse '%s' %lu\n", filename, limit); - res = 1; - } - } else { - if (fail) { - fprintf(stderr, "Failed to get failure for '%s' %lu\n", - filename, limit); - res = 1; - } else - res = 0; - } - ctxt->sax = old_sax; - xmlFreeParserCtxt(ctxt); - - return(res); -} -#ifdef LIBXML_READER_ENABLED -/** - * readerTest: - * @filename: the file to parse - * @max_size: size of the limit to test - * @options: parsing options - * @fail: should a failure be reported - * - * Parse a memory generated file using the xmlReader - * - * Returns 0 in case of success, an error code otherwise - */ -static int -readerTest(const char *filename, size_t limit, int options, int fail) { - xmlTextReaderPtr reader; - int res = 0; - int ret; - - nb_tests++; - - maxlen = limit; - reader = xmlReaderForFile(filename , NULL, options); - if (reader == NULL) { - fprintf(stderr, "Failed to open '%s' test\n", filename); - return(1); - } - ret = xmlTextReaderRead(reader); - while (ret == 1) { - ret = xmlTextReaderRead(reader); - } - if (ret != 0) { - if (fail) - res = 0; - else { - if (strncmp(filename, "crazy:", 6) == 0) - fprintf(stderr, "Failed to parse '%s' %u\n", - filename, crazy_indx); - else - fprintf(stderr, "Failed to parse '%s' %lu\n", - filename, limit); - res = 1; - } - } else { - if (fail) { - if (strncmp(filename, "crazy:", 6) == 0) - fprintf(stderr, "Failed to get failure for '%s' %u\n", - filename, crazy_indx); - else - fprintf(stderr, "Failed to get failure for '%s' %lu\n", - filename, limit); - res = 1; - } else - res = 0; - } - if (timeout) - res = 1; - xmlFreeTextReader(reader); - - return(res); -} -#endif - -/************************************************************************ - * * - * Tests descriptions * - * * - ************************************************************************/ - -typedef int (*functest) (const char *filename, size_t limit, int options, - int fail); - -typedef struct limitDesc limitDesc; -typedef limitDesc *limitDescPtr; -struct limitDesc { - const char *name; /* the huge generator name */ - size_t limit; /* the limit to test */ - int options; /* extra parser options */ - int fail; /* whether the test should fail */ -}; - -static limitDesc limitDescriptions[] = { - /* max lenght of a text node in content */ - {"huge:textNode", XML_MAX_TEXT_LENGTH - CHUNK, 0, 0}, - {"huge:textNode", XML_MAX_TEXT_LENGTH + CHUNK, 0, 1}, - {"huge:textNode", XML_MAX_TEXT_LENGTH + CHUNK, XML_PARSE_HUGE, 0}, - /* max lenght of a text node in content */ - {"huge:attrNode", XML_MAX_TEXT_LENGTH - CHUNK, 0, 0}, - {"huge:attrNode", XML_MAX_TEXT_LENGTH + CHUNK, 0, 1}, - {"huge:attrNode", XML_MAX_TEXT_LENGTH + CHUNK, XML_PARSE_HUGE, 0}, - /* max lenght of a comment node */ - {"huge:commentNode", XML_MAX_TEXT_LENGTH - CHUNK, 0, 0}, - {"huge:commentNode", XML_MAX_TEXT_LENGTH + CHUNK, 0, 1}, - {"huge:commentNode", XML_MAX_TEXT_LENGTH + CHUNK, XML_PARSE_HUGE, 0}, - /* max lenght of a PI node */ - {"huge:piNode", XML_MAX_TEXT_LENGTH - CHUNK, 0, 0}, - {"huge:piNode", XML_MAX_TEXT_LENGTH + CHUNK, 0, 1}, - {"huge:piNode", XML_MAX_TEXT_LENGTH + CHUNK, XML_PARSE_HUGE, 0}, -}; - -typedef struct testDesc testDesc; -typedef testDesc *testDescPtr; -struct testDesc { - const char *desc; /* descripton of the test */ - functest func; /* function implementing the test */ -}; - -static -testDesc testDescriptions[] = { - { "Parsing of huge files with the sax parser", saxTest}, -/* { "Parsing of huge files with the tree parser", treeTest}, */ -#ifdef LIBXML_READER_ENABLED - { "Parsing of huge files with the reader", readerTest}, -#endif - {NULL, NULL} -}; - -typedef struct testException testException; -typedef testException *testExceptionPtr; -struct testException { - unsigned int test; /* the parser test number */ - unsigned int limit; /* the limit test number */ - int fail; /* new fail value or -1*/ - size_t size; /* new limit value or 0 */ -}; - -static -testException testExceptions[] = { - /* the SAX parser doesn't hit a limit of XML_MAX_TEXT_LENGTH text nodes */ - { 0, 1, 0, 0}, -}; - -static int -launchTests(testDescPtr tst, unsigned int test) { - int res = 0, err = 0; - unsigned int i, j; - size_t limit; - int fail; - - if (tst == NULL) return(-1); - - for (i = 0;i < sizeof(limitDescriptions)/sizeof(limitDescriptions[0]);i++) { - limit = limitDescriptions[i].limit; - fail = limitDescriptions[i].fail; - /* - * Handle exceptions if any - */ - for (j = 0;j < sizeof(testExceptions)/sizeof(testExceptions[0]);j++) { - if ((testExceptions[j].test == test) && - (testExceptions[j].limit == i)) { - if (testExceptions[j].fail != -1) - fail = testExceptions[j].fail; - if (testExceptions[j].size != 0) - limit = testExceptions[j].size; - break; - } - } - res = tst->func(limitDescriptions[i].name, limit, - limitDescriptions[i].options, fail); - if (res != 0) { - nb_errors++; - err++; - } - } - return(err); -} - - -static int -runtest(unsigned int i) { - int ret = 0, res; - int old_errors, old_tests, old_leaks; - - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - if ((tests_quiet == 0) && (testDescriptions[i].desc != NULL)) - printf("## %s\n", testDescriptions[i].desc); - res = launchTests(&testDescriptions[i], i); - if (res != 0) - ret++; - if (verbose) { - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests, no errors\n", nb_tests - old_tests); - else - printf("Ran %d tests, %d errors, %d leaks\n", - nb_tests - old_tests, - nb_errors - old_errors, - nb_leaks - old_leaks); - } - return(ret); -} - -static int -launchCrazySAX(unsigned int test, int fail) { - int res = 0, err = 0; - - crazy_indx = test; - - res = saxTest("crazy::test", XML_MAX_LOOKUP_LIMIT - CHUNK, 0, fail); - if (res != 0) { - nb_errors++; - err++; - } - if (tests_quiet == 0) - fprintf(stderr, "%c", crazy[test]); - - return(err); -} - -static int -launchCrazy(unsigned int test, int fail) { - int res = 0, err = 0; - - crazy_indx = test; - - res = readerTest("crazy::test", XML_MAX_LOOKUP_LIMIT - CHUNK, 0, fail); - if (res != 0) { - nb_errors++; - err++; - } - if (tests_quiet == 0) - fprintf(stderr, "%c", crazy[test]); - - return(err); -} - -static int get_crazy_fail(int test) { - /* - * adding 1000000 of character 'a' leads to parser failure mostly - * everywhere except in those special spots. Need to be updated - * each time crazy is updated - */ - int fail = 1; - if ((test == 44) || /* PI in Misc */ - ((test >= 50) && (test <= 55)) || /* Comment in Misc */ - (test == 79) || /* PI in DTD */ - ((test >= 85) && (test <= 90)) || /* Comment in DTD */ - (test == 154) || /* PI in Misc */ - ((test >= 160) && (test <= 165)) || /* Comment in Misc */ - ((test >= 178) && (test <= 181)) || /* attribute value */ - (test == 183) || /* Text */ - (test == 189) || /* PI in Content */ - (test == 191) || /* Text */ - ((test >= 195) && (test <= 200)) || /* Comment in Content */ - ((test >= 203) && (test <= 206)) || /* Text */ - (test == 215) || (test == 216) || /* in CDATA */ - (test == 219) || /* Text */ - (test == 231) || /* PI in Misc */ - ((test >= 237) && (test <= 242))) /* Comment in Misc */ - fail = 0; - return(fail); -} - -static int -runcrazy(void) { - int ret = 0, res = 0; - int old_errors, old_tests, old_leaks; - unsigned int i; - - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - if (tests_quiet == 0) { - printf("## Crazy tests on reader\n"); - } - for (i = 0;i < strlen(crazy);i++) { - res += launchCrazy(i, get_crazy_fail(i)); - if (res != 0) - ret++; - } - if (tests_quiet == 0) { - printf("\n## Crazy tests on SAX\n"); - } - for (i = 0;i < strlen(crazy);i++) { - res += launchCrazySAX(i, get_crazy_fail(i)); - if (res != 0) - ret++; - } - if (tests_quiet == 0) - fprintf(stderr, "\n"); - if (verbose) { - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests, no errors\n", nb_tests - old_tests); - else - printf("Ran %d tests, %d errors, %d leaks\n", - nb_tests - old_tests, - nb_errors - old_errors, - nb_leaks - old_leaks); - } - return(ret); -} - - -int -main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - int i, a, ret = 0; - int subset = 0; - - fillFilling(); - initializeLibxml2(); - - for (a = 1; a < argc;a++) { - if (!strcmp(argv[a], "-v")) - verbose = 1; - else if (!strcmp(argv[a], "-quiet")) - tests_quiet = 1; - else if (!strcmp(argv[a], "-crazy")) - subset = 1; - } - if (subset == 0) { - for (i = 0; testDescriptions[i].func != NULL; i++) { - ret += runtest(i); - } - } - ret += runcrazy(); - if ((nb_errors == 0) && (nb_leaks == 0)) { - ret = 0; - printf("Total %d tests, no errors\n", - nb_tests); - } else { - ret = 1; - printf("Total %d tests, %d errors, %d leaks\n", - nb_tests, nb_errors, nb_leaks); - } - xmlCleanupParser(); - xmlMemoryDump(); - - return(ret); -} diff --git a/reactos/lib/3rdparty/libxml2/testrecurse.c b/reactos/lib/3rdparty/libxml2/testrecurse.c deleted file mode 100644 index e5d5d1b307a..00000000000 --- a/reactos/lib/3rdparty/libxml2/testrecurse.c +++ /dev/null @@ -1,965 +0,0 @@ -/* - * testrecurse.c: C program to run libxml2 regression tests checking entities - * recursions - * - * To compile on Unixes: - * cc -o testrecurse `xml2-config --cflags` testrecurse.c `xml2-config --libs` -lpthread - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#include "libxml.h" -#include - -#if !defined(_WIN32) || defined(__CYGWIN__) -#include -#endif -#include -#include -#include -#include - -#include -#include -#include -#ifdef LIBXML_READER_ENABLED -#include -#endif - -/* - * O_BINARY is just for Windows compatibility - if it isn't defined - * on this system, avoid any compilation error - */ -#ifdef O_BINARY -#define RD_FLAGS O_RDONLY | O_BINARY -#else -#define RD_FLAGS O_RDONLY -#endif - -typedef int (*functest) (const char *filename, const char *result, - const char *error, int options); - -typedef struct testDesc testDesc; -typedef testDesc *testDescPtr; -struct testDesc { - const char *desc; /* descripton of the test */ - functest func; /* function implementing the test */ - const char *in; /* glob to path for input files */ - const char *out; /* output directory */ - const char *suffix;/* suffix for output files */ - const char *err; /* suffix for error output files */ - int options; /* parser options for the test */ -}; - -static int checkTestFile(const char *filename); - - -#if defined(_WIN32) && !defined(__CYGWIN__) - -#include -#include - -typedef struct -{ - size_t gl_pathc; /* Count of paths matched so far */ - char **gl_pathv; /* List of matched pathnames. */ - size_t gl_offs; /* Slots to reserve in 'gl_pathv'. */ -} glob_t; - -#define GLOB_DOOFFS 0 -static int glob(const char *pattern, int flags, - int errfunc(const char *epath, int eerrno), - glob_t *pglob) { - glob_t *ret; - WIN32_FIND_DATA FindFileData; - HANDLE hFind; - unsigned int nb_paths = 0; - char directory[500]; - int len; - - if ((pattern == NULL) || (pglob == NULL)) return(-1); - - strncpy(directory, pattern, 499); - for (len = strlen(directory);len >= 0;len--) { - if (directory[len] == '/') { - len++; - directory[len] = 0; - break; - } - } - if (len <= 0) - len = 0; - - - ret = pglob; - memset(ret, 0, sizeof(glob_t)); - - hFind = FindFirstFileA(pattern, &FindFileData); - if (hFind == INVALID_HANDLE_VALUE) - return(0); - nb_paths = 20; - ret->gl_pathv = (char **) malloc(nb_paths * sizeof(char *)); - if (ret->gl_pathv == NULL) { - FindClose(hFind); - return(-1); - } - strncpy(directory + len, FindFileData.cFileName, 499 - len); - ret->gl_pathv[ret->gl_pathc] = strdup(directory); - if (ret->gl_pathv[ret->gl_pathc] == NULL) - goto done; - ret->gl_pathc++; - while(FindNextFileA(hFind, &FindFileData)) { - if (FindFileData.cFileName[0] == '.') - continue; - if (ret->gl_pathc + 2 > nb_paths) { - char **tmp = realloc(ret->gl_pathv, nb_paths * 2 * sizeof(char *)); - if (tmp == NULL) - break; - ret->gl_pathv = tmp; - nb_paths *= 2; - } - strncpy(directory + len, FindFileData.cFileName, 499 - len); - ret->gl_pathv[ret->gl_pathc] = strdup(directory); - if (ret->gl_pathv[ret->gl_pathc] == NULL) - break; - ret->gl_pathc++; - } - ret->gl_pathv[ret->gl_pathc] = NULL; - -done: - FindClose(hFind); - return(0); -} - - - -static void globfree(glob_t *pglob) { - unsigned int i; - if (pglob == NULL) - return; - - for (i = 0;i < pglob->gl_pathc;i++) { - if (pglob->gl_pathv[i] != NULL) - free(pglob->gl_pathv[i]); - } -} - -#else -#include -#endif - -/************************************************************************ - * * - * Huge document generator * - * * - ************************************************************************/ - -#include - - -static const char *start = " \ - \ - \ -]> \ -"; - -static const char *segment = " &e; &f; &d;\n"; -static const char *finish = ""; - -static int curseg = 0; -static const char *current; -static int rlen; - -/** - * hugeMatch: - * @URI: an URI to test - * - * Check for an huge: query - * - * Returns 1 if yes and 0 if another Input module should be used - */ -static int -hugeMatch(const char * URI) { - if ((URI != NULL) && (!strncmp(URI, "huge:", 4))) - return(1); - return(0); -} - -/** - * hugeOpen: - * @URI: an URI to test - * - * Return a pointer to the huge: query handler, in this example simply - * the current pointer... - * - * Returns an Input context or NULL in case or error - */ -static void * -hugeOpen(const char * URI) { - if ((URI == NULL) || (strncmp(URI, "huge:", 4))) - return(NULL); - rlen = strlen(start); - current = start; - return((void *) current); -} - -/** - * hugeClose: - * @context: the read context - * - * Close the huge: query handler - * - * Returns 0 or -1 in case of error - */ -static int -hugeClose(void * context) { - if (context == NULL) return(-1); - return(0); -} - -#define MAX_NODES 1000000 - -/** - * hugeRead: - * @context: the read context - * @buffer: where to store data - * @len: number of bytes to read - * - * Implement an huge: query read. - * - * Returns the number of bytes read or -1 in case of error - */ -static int -hugeRead(void *context, char *buffer, int len) -{ - if ((context == NULL) || (buffer == NULL) || (len < 0)) - return (-1); - - if (len >= rlen) { - if (curseg >= MAX_NODES + 1) { - rlen = 0; - return(0); - } - len = rlen; - rlen = 0; - memcpy(buffer, current, len); - curseg ++; - if (curseg == MAX_NODES) { - fprintf(stderr, "\n"); - rlen = strlen(finish); - current = finish; - } else { - if (curseg % (MAX_NODES / 10) == 0) - fprintf(stderr, "."); - rlen = strlen(segment); - current = segment; - } - } else { - memcpy(buffer, current, len); - rlen -= len; - current += len; - } - return (len); -} - -/************************************************************************ - * * - * Libxml2 specific routines * - * * - ************************************************************************/ - -static int nb_tests = 0; -static int nb_errors = 0; -static int nb_leaks = 0; -static int extraMemoryFromResolver = 0; - -static int -fatalError(void) { - fprintf(stderr, "Exitting tests on fatal error\n"); - exit(1); -} - -/* - * We need to trap calls to the resolver to not account memory for the catalog - * which is shared to the current running test. We also don't want to have - * network downloads modifying tests. - */ -static xmlParserInputPtr -testExternalEntityLoader(const char *URL, const char *ID, - xmlParserCtxtPtr ctxt) { - xmlParserInputPtr ret; - - if (checkTestFile(URL)) { - ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); - } else { - int memused = xmlMemUsed(); - ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt); - extraMemoryFromResolver += xmlMemUsed() - memused; - } - - return(ret); -} - -/* - * Trapping the error messages at the generic level to grab the equivalent of - * stderr messages on CLI tools. - */ -static char testErrors[32769]; -static int testErrorsSize = 0; - -static void XMLCDECL -channel(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) { - va_list args; - int res; - - if (testErrorsSize >= 32768) - return; - va_start(args, msg); - res = vsnprintf(&testErrors[testErrorsSize], - 32768 - testErrorsSize, - msg, args); - va_end(args); - if (testErrorsSize + res >= 32768) { - /* buffer is full */ - testErrorsSize = 32768; - testErrors[testErrorsSize] = 0; - } else { - testErrorsSize += res; - } - testErrors[testErrorsSize] = 0; -} - -/** - * xmlParserPrintFileContext: - * @input: an xmlParserInputPtr input - * - * Displays current context within the input content for error tracking - */ - -static void -xmlParserPrintFileContextInternal(xmlParserInputPtr input , - xmlGenericErrorFunc chanl, void *data ) { - const xmlChar *cur, *base; - unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */ - xmlChar content[81]; /* space for 80 chars + line terminator */ - xmlChar *ctnt; - - if (input == NULL) return; - cur = input->cur; - base = input->base; - /* skip backwards over any end-of-lines */ - while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) { - cur--; - } - n = 0; - /* search backwards for beginning-of-line (to max buff size) */ - while ((n++ < (sizeof(content)-1)) && (cur > base) && - (*(cur) != '\n') && (*(cur) != '\r')) - cur--; - if ((*(cur) == '\n') || (*(cur) == '\r')) cur++; - /* calculate the error position in terms of the current position */ - col = input->cur - cur; - /* search forward for end-of-line (to max buff size) */ - n = 0; - ctnt = content; - /* copy selected text to our buffer */ - while ((*cur != 0) && (*(cur) != '\n') && - (*(cur) != '\r') && (n < sizeof(content)-1)) { - *ctnt++ = *cur++; - n++; - } - *ctnt = 0; - /* print out the selected text */ - chanl(data ,"%s\n", content); - /* create blank line with problem pointer */ - n = 0; - ctnt = content; - /* (leave buffer space for pointer + line terminator) */ - while ((nfile; - line = err->line; - code = err->code; - domain = err->domain; - level = err->level; - node = err->node; - if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) || - (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) || - (domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) { - ctxt = err->ctxt; - } - str = err->message; - - if (code == XML_ERR_OK) - return; - - if ((node != NULL) && (node->type == XML_ELEMENT_NODE)) - name = node->name; - - /* - * Maintain the compatibility with the legacy error handling - */ - if (ctxt != NULL) { - input = ctxt->input; - if ((input != NULL) && (input->filename == NULL) && - (ctxt->inputNr > 1)) { - cur = input; - input = ctxt->inputTab[ctxt->inputNr - 2]; - } - if (input != NULL) { - if (input->filename) - channel(data, "%s:%d: ", input->filename, input->line); - else if ((line != 0) && (domain == XML_FROM_PARSER)) - channel(data, "Entity: line %d: ", input->line); - } - } else { - if (file != NULL) - channel(data, "%s:%d: ", file, line); - else if ((line != 0) && (domain == XML_FROM_PARSER)) - channel(data, "Entity: line %d: ", line); - } - if (name != NULL) { - channel(data, "element %s: ", name); - } - if (code == XML_ERR_OK) - return; - switch (domain) { - case XML_FROM_PARSER: - channel(data, "parser "); - break; - case XML_FROM_NAMESPACE: - channel(data, "namespace "); - break; - case XML_FROM_DTD: - case XML_FROM_VALID: - channel(data, "validity "); - break; - case XML_FROM_HTML: - channel(data, "HTML parser "); - break; - case XML_FROM_MEMORY: - channel(data, "memory "); - break; - case XML_FROM_OUTPUT: - channel(data, "output "); - break; - case XML_FROM_IO: - channel(data, "I/O "); - break; - case XML_FROM_XINCLUDE: - channel(data, "XInclude "); - break; - case XML_FROM_XPATH: - channel(data, "XPath "); - break; - case XML_FROM_XPOINTER: - channel(data, "parser "); - break; - case XML_FROM_REGEXP: - channel(data, "regexp "); - break; - case XML_FROM_MODULE: - channel(data, "module "); - break; - case XML_FROM_SCHEMASV: - channel(data, "Schemas validity "); - break; - case XML_FROM_SCHEMASP: - channel(data, "Schemas parser "); - break; - case XML_FROM_RELAXNGP: - channel(data, "Relax-NG parser "); - break; - case XML_FROM_RELAXNGV: - channel(data, "Relax-NG validity "); - break; - case XML_FROM_CATALOG: - channel(data, "Catalog "); - break; - case XML_FROM_C14N: - channel(data, "C14N "); - break; - case XML_FROM_XSLT: - channel(data, "XSLT "); - break; - default: - break; - } - if (code == XML_ERR_OK) - return; - switch (level) { - case XML_ERR_NONE: - channel(data, ": "); - break; - case XML_ERR_WARNING: - channel(data, "warning : "); - break; - case XML_ERR_ERROR: - channel(data, "error : "); - break; - case XML_ERR_FATAL: - channel(data, "error : "); - break; - } - if (code == XML_ERR_OK) - return; - if (str != NULL) { - int len; - len = xmlStrlen((const xmlChar *)str); - if ((len > 0) && (str[len - 1] != '\n')) - channel(data, "%s\n", str); - else - channel(data, "%s", str); - } else { - channel(data, "%s\n", "out of memory error"); - } - if (code == XML_ERR_OK) - return; - - if (ctxt != NULL) { - xmlParserPrintFileContextInternal(input, channel, data); - if (cur != NULL) { - if (cur->filename) - channel(data, "%s:%d: \n", cur->filename, cur->line); - else if ((line != 0) && (domain == XML_FROM_PARSER)) - channel(data, "Entity: line %d: \n", cur->line); - xmlParserPrintFileContextInternal(cur, channel, data); - } - } - if ((domain == XML_FROM_XPATH) && (err->str1 != NULL) && - (err->int1 < 100) && - (err->int1 < xmlStrlen((const xmlChar *)err->str1))) { - xmlChar buf[150]; - int i; - - channel(data, "%s\n", err->str1); - for (i=0;i < err->int1;i++) - buf[i] = ' '; - buf[i++] = '^'; - buf[i] = 0; - channel(data, "%s\n", buf); - } -} - -static void -initializeLibxml2(void) { - xmlGetWarningsDefaultValue = 0; - xmlPedanticParserDefault(0); - - xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup); - xmlInitParser(); - xmlSetExternalEntityLoader(testExternalEntityLoader); - xmlSetStructuredErrorFunc(NULL, testStructuredErrorHandler); - /* - * register the new I/O handlers - */ - if (xmlRegisterInputCallbacks(hugeMatch, hugeOpen, - hugeRead, hugeClose) < 0) { - fprintf(stderr, "failed to register Huge handler\n"); - exit(1); - } -} - -/************************************************************************ - * * - * File name and path utilities * - * * - ************************************************************************/ - -static const char *baseFilename(const char *filename) { - const char *cur; - if (filename == NULL) - return(NULL); - cur = &filename[strlen(filename)]; - while ((cur > filename) && (*cur != '/')) - cur--; - if (*cur == '/') - return(cur + 1); - return(cur); -} - -static char *resultFilename(const char *filename, const char *out, - const char *suffix) { - const char *base; - char res[500]; - char suffixbuff[500]; - -/************* - if ((filename[0] == 't') && (filename[1] == 'e') && - (filename[2] == 's') && (filename[3] == 't') && - (filename[4] == '/')) - filename = &filename[5]; - *************/ - - base = baseFilename(filename); - if (suffix == NULL) - suffix = ".tmp"; - if (out == NULL) - out = ""; - - strncpy(suffixbuff,suffix,499); -#ifdef VMS - if(strstr(base,".") && suffixbuff[0]=='.') - suffixbuff[0]='_'; -#endif - - snprintf(res, 499, "%s%s%s", out, base, suffixbuff); - res[499] = 0; - return(strdup(res)); -} - -static int checkTestFile(const char *filename) { - struct stat buf; - - if (stat(filename, &buf) == -1) - return(0); - -#if defined(_WIN32) && !defined(__CYGWIN__) - if (!(buf.st_mode & _S_IFREG)) - return(0); -#else - if (!S_ISREG(buf.st_mode)) - return(0); -#endif - - return(1); -} - - - -/************************************************************************ - * * - * Test to detect or not recursive entities * - * * - ************************************************************************/ -/** - * recursiveDetectTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages: unused - * - * Parse a file loading DTD and replacing entities check it fails for - * lol cases - * - * Returns 0 in case of success, an error code otherwise - */ -static int -recursiveDetectTest(const char *filename, - const char *result ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - xmlDocPtr doc; - xmlParserCtxtPtr ctxt; - int res = 0; - - nb_tests++; - - ctxt = xmlNewParserCtxt(); - /* - * base of the test, parse with the old API - */ - doc = xmlCtxtReadFile(ctxt, filename, NULL, - XML_PARSE_NOENT | XML_PARSE_DTDLOAD); - if ((doc != NULL) || (ctxt->lastError.code != XML_ERR_ENTITY_LOOP)) { - fprintf(stderr, "Failed to detect recursion in %s\n", filename); - xmlFreeParserCtxt(ctxt); - xmlFreeDoc(doc); - return(1); - } - xmlFreeParserCtxt(ctxt); - - return(res); -} - -/** - * notRecursiveDetectTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages: unused - * - * Parse a file loading DTD and replacing entities check it works for - * good cases - * - * Returns 0 in case of success, an error code otherwise - */ -static int -notRecursiveDetectTest(const char *filename, - const char *result ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - xmlDocPtr doc; - xmlParserCtxtPtr ctxt; - int res = 0; - - nb_tests++; - - ctxt = xmlNewParserCtxt(); - /* - * base of the test, parse with the old API - */ - doc = xmlCtxtReadFile(ctxt, filename, NULL, - XML_PARSE_NOENT | XML_PARSE_DTDLOAD); - if (doc == NULL) { - fprintf(stderr, "Failed to parse correct file %s\n", filename); - xmlFreeParserCtxt(ctxt); - return(1); - } - xmlFreeDoc(doc); - xmlFreeParserCtxt(ctxt); - - return(res); -} - -#ifdef LIBXML_READER_ENABLED -/** - * notRecursiveHugeTest: - * @filename: the file to parse - * @result: the file with expected result - * @err: the file with error messages: unused - * - * Parse a memory generated file - * good cases - * - * Returns 0 in case of success, an error code otherwise - */ -static int -notRecursiveHugeTest(const char *filename ATTRIBUTE_UNUSED, - const char *result ATTRIBUTE_UNUSED, - const char *err ATTRIBUTE_UNUSED, - int options ATTRIBUTE_UNUSED) { - xmlTextReaderPtr reader; - int res = 0; - int ret; - - nb_tests++; - - reader = xmlReaderForFile("huge:test" , NULL, - XML_PARSE_NOENT | XML_PARSE_DTDLOAD); - if (reader == NULL) { - fprintf(stderr, "Failed to open huge:test\n"); - return(1); - } - ret = xmlTextReaderRead(reader); - while (ret == 1) { - ret = xmlTextReaderRead(reader); - } - if (ret != 0) { - fprintf(stderr, "Failed to parser huge:test with entities\n"); - res = 1; - } - xmlFreeTextReader(reader); - - return(res); -} -#endif - -/************************************************************************ - * * - * Tests Descriptions * - * * - ************************************************************************/ - -static -testDesc testDescriptions[] = { - { "Parsing recursive test cases" , - recursiveDetectTest, "./test/recurse/lol*.xml", NULL, NULL, NULL, - 0 }, - { "Parsing non-recursive test cases" , - notRecursiveDetectTest, "./test/recurse/good*.xml", NULL, NULL, NULL, - 0 }, -#ifdef LIBXML_READER_ENABLED - { "Parsing non-recursive huge case" , - notRecursiveHugeTest, NULL, NULL, NULL, NULL, - 0 }, -#endif - {NULL, NULL, NULL, NULL, NULL, NULL, 0} -}; - -/************************************************************************ - * * - * The main code driving the tests * - * * - ************************************************************************/ - -static int -launchTests(testDescPtr tst) { - int res = 0, err = 0; - size_t i; - char *result; - char *error; - int mem; - - if (tst == NULL) return(-1); - if (tst->in != NULL) { - glob_t globbuf; - - globbuf.gl_offs = 0; - glob(tst->in, GLOB_DOOFFS, NULL, &globbuf); - for (i = 0;i < globbuf.gl_pathc;i++) { - if (!checkTestFile(globbuf.gl_pathv[i])) - continue; - if (tst->suffix != NULL) { - result = resultFilename(globbuf.gl_pathv[i], tst->out, - tst->suffix); - if (result == NULL) { - fprintf(stderr, "Out of memory !\n"); - fatalError(); - } - } else { - result = NULL; - } - if (tst->err != NULL) { - error = resultFilename(globbuf.gl_pathv[i], tst->out, - tst->err); - if (error == NULL) { - fprintf(stderr, "Out of memory !\n"); - fatalError(); - } - } else { - error = NULL; - } - if ((result) &&(!checkTestFile(result))) { - fprintf(stderr, "Missing result file %s\n", result); - } else if ((error) &&(!checkTestFile(error))) { - fprintf(stderr, "Missing error file %s\n", error); - } else { - mem = xmlMemUsed(); - extraMemoryFromResolver = 0; - testErrorsSize = 0; - testErrors[0] = 0; - res = tst->func(globbuf.gl_pathv[i], result, error, - tst->options | XML_PARSE_COMPACT); - xmlResetLastError(); - if (res != 0) { - fprintf(stderr, "File %s generated an error\n", - globbuf.gl_pathv[i]); - nb_errors++; - err++; - } - else if (xmlMemUsed() != mem) { - if ((xmlMemUsed() != mem) && - (extraMemoryFromResolver == 0)) { - fprintf(stderr, "File %s leaked %d bytes\n", - globbuf.gl_pathv[i], xmlMemUsed() - mem); - nb_leaks++; - err++; - } - } - testErrorsSize = 0; - } - if (result) - free(result); - if (error) - free(error); - } - globfree(&globbuf); - } else { - testErrorsSize = 0; - testErrors[0] = 0; - extraMemoryFromResolver = 0; - res = tst->func(NULL, NULL, NULL, tst->options); - if (res != 0) { - nb_errors++; - err++; - } - } - return(err); -} - -static int verbose = 0; -static int tests_quiet = 0; - -static int -runtest(int i) { - int ret = 0, res; - int old_errors, old_tests, old_leaks; - - old_errors = nb_errors; - old_tests = nb_tests; - old_leaks = nb_leaks; - if ((tests_quiet == 0) && (testDescriptions[i].desc != NULL)) - printf("## %s\n", testDescriptions[i].desc); - res = launchTests(&testDescriptions[i]); - if (res != 0) - ret++; - if (verbose) { - if ((nb_errors == old_errors) && (nb_leaks == old_leaks)) - printf("Ran %d tests, no errors\n", nb_tests - old_tests); - else - printf("Ran %d tests, %d errors, %d leaks\n", - nb_tests - old_tests, - nb_errors - old_errors, - nb_leaks - old_leaks); - } - return(ret); -} - -int -main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { - int i, a, ret = 0; - int subset = 0; - - initializeLibxml2(); - - for (a = 1; a < argc;a++) { - if (!strcmp(argv[a], "-v")) - verbose = 1; - else if (!strcmp(argv[a], "-quiet")) - tests_quiet = 1; - else { - for (i = 0; testDescriptions[i].func != NULL; i++) { - if (strstr(testDescriptions[i].desc, argv[a])) { - ret += runtest(i); - subset++; - } - } - } - } - if (subset == 0) { - for (i = 0; testDescriptions[i].func != NULL; i++) { - ret += runtest(i); - } - } - if ((nb_errors == 0) && (nb_leaks == 0)) { - ret = 0; - printf("Total %d tests, no errors\n", - nb_tests); - } else { - ret = 1; - printf("Total %d tests, %d errors, %d leaks\n", - nb_tests, nb_errors, nb_leaks); - } - xmlCleanupParser(); - xmlMemoryDump(); - - return(ret); -} diff --git a/reactos/lib/3rdparty/libxml2/threads.c b/reactos/lib/3rdparty/libxml2/threads.c index 52d6671f491..0d7fe52d016 100644 --- a/reactos/lib/3rdparty/libxml2/threads.c +++ b/reactos/lib/3rdparty/libxml2/threads.c @@ -146,6 +146,7 @@ struct _xmlRMutex { static pthread_key_t globalkey; static pthread_t mainthread; static pthread_once_t once_control = PTHREAD_ONCE_INIT; +static pthread_once_t once_control_init = PTHREAD_ONCE_INIT; static pthread_mutex_t global_init_lock = PTHREAD_MUTEX_INITIALIZER; #elif defined HAVE_WIN32_THREADS #if defined(HAVE_COMPILER_TLS) @@ -251,7 +252,6 @@ xmlMutexLock(xmlMutexPtr tok) #ifdef DEBUG_THREADS xmlGenericError(xmlGenericErrorContext, "xmlMutexLock():BeOS:Couldn't aquire semaphore\n"); - exit(); #endif } tok->tid = find_thread(NULL); @@ -499,7 +499,6 @@ __xmlGlobalInitMutexLock(void) #ifdef DEBUG_THREADS xmlGenericError(xmlGenericErrorContext, "xmlGlobalInitMutexLock():BeOS:Couldn't acquire semaphore\n"); - exit(); #endif } #endif @@ -915,7 +914,7 @@ xmlCleanupThreads(void) #ifdef HAVE_PTHREAD_H if ((libxml_is_threaded) && (pthread_key_delete != NULL)) pthread_key_delete(globalkey); - once_control = PTHREAD_ONCE_INIT; + once_control = once_control_init; #elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)) if (globalkey != TLS_OUT_OF_INDEXES) { xmlGlobalStateCleanupHelperParams *p; @@ -955,6 +954,7 @@ xmlOnceInit(void) #ifdef HAVE_PTHREAD_H (void) pthread_key_create(&globalkey, xmlFreeGlobalState); mainthread = pthread_self(); + __xmlInitializeDict(); #elif defined(HAVE_WIN32_THREADS) if (!run_once.done) { if (InterlockedIncrement(&run_once.control) == 1) { @@ -962,6 +962,7 @@ xmlOnceInit(void) globalkey = TlsAlloc(); #endif mainthread = GetCurrentThreadId(); + __xmlInitializeDict(); run_once.done = 1; } else { /* Another thread is working; give up our slice and @@ -975,6 +976,7 @@ xmlOnceInit(void) globalkey = tls_allocate(); tls_set(globalkey, NULL); mainthread = find_thread(NULL); + __xmlInitializeDict(); } else atomic_add(&run_once_init, -1); #endif diff --git a/reactos/lib/3rdparty/libxml2/timsort.h b/reactos/lib/3rdparty/libxml2/timsort.h index 54439881c25..99697a04913 100644 --- a/reactos/lib/3rdparty/libxml2/timsort.h +++ b/reactos/lib/3rdparty/libxml2/timsort.h @@ -30,6 +30,14 @@ typedef unsigned __int64 uint64_t; #endif #endif +#ifndef MK_UINT64 +#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER < 1300 +#define MK_UINT64(x) ((uint64_t)(x)) +#else +#define MK_UINT64(x) x##ULL +#endif +#endif + #ifndef MAX #define MAX(x,y) (((x) > (y) ? (x) : (y))) #endif @@ -37,10 +45,10 @@ typedef unsigned __int64 uint64_t; #define MIN(x,y) (((x) < (y) ? (x) : (y))) #endif -int compute_minrun(const uint64_t); +int compute_minrun(uint64_t); #ifndef CLZ -#ifdef __GNUC__ +#if defined(__GNUC__) && ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ > 3)) #define CLZ __builtin_clzll #else @@ -67,12 +75,12 @@ int clzll(uint64_t x) /* {{{ */ #endif #endif -int compute_minrun(const uint64_t size) /* {{{ */ +int compute_minrun(uint64_t size) /* {{{ */ { const int top_bit = 64 - CLZ(size); const int shift = MAX(top_bit, 6) - 6; const int minrun = size >> shift; - const uint64_t mask = (1ULL << shift) - 1; + const uint64_t mask = (MK_UINT64(1) << shift) - 1; if (mask & size) return minrun + 1; return minrun; } diff --git a/reactos/lib/3rdparty/libxml2/tree.c b/reactos/lib/3rdparty/libxml2/tree.c index 145a68961ec..7e5af2693a0 100644 --- a/reactos/lib/3rdparty/libxml2/tree.c +++ b/reactos/lib/3rdparty/libxml2/tree.c @@ -314,7 +314,7 @@ xmlSplitQName2(const xmlChar *name, xmlChar **prefix) { * parse an XML qualified name string,i * * returns NULL if it is not a Qualified Name, otherwise, update len - * with the lenght in byte of the prefix and return a pointer + * with the length in byte of the prefix and return a pointer * to the start of the name without the prefix */ diff --git a/reactos/lib/3rdparty/libxml2/valid.c b/reactos/lib/3rdparty/libxml2/valid.c index 10bc4f44f89..6e53a76de3a 100644 --- a/reactos/lib/3rdparty/libxml2/valid.c +++ b/reactos/lib/3rdparty/libxml2/valid.c @@ -5796,7 +5796,7 @@ xmlValidatePushElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, * xmlValidatePushCData: * @ctxt: the validation context * @data: some character data read - * @len: the lenght of the data + * @len: the length of the data * * check the CData parsed for validation in the current stack * diff --git a/reactos/lib/3rdparty/libxml2/xml2-config.1 b/reactos/lib/3rdparty/libxml2/xml2-config.1 deleted file mode 100644 index 8cf9858ba5e..00000000000 --- a/reactos/lib/3rdparty/libxml2/xml2-config.1 +++ /dev/null @@ -1,30 +0,0 @@ -.TH GNOME-XML 1 "3 July 1999" Version 1.1.0 -.SH NAME -xml-config - script to get information about the installed version of GNOME-XML -.SH SYNOPSIS -.B xml-config -[\-\-prefix\fI[=DIR]\fP] [\-\-libs] [\-\-cflags] [\-\-version] [\-\-help] -.SH DESCRIPTION -\fIxml-config\fP is a tool that is used to determine the compile and -linker flags that should be used to compile and link programs that use -\fIGNOME-XML\fP. -.SH OPTIONS -\fIxml-config\fP accepts the following options: -.TP 8 -.B \-\-version -Print the currently installed version of \fIGNOME-XML\fP on the standard output. -.TP 8 -.B \-\-libs -Print the linker flags that are necessary to link a \fIGNOME-XML\fP program. -.TP 8 -.B \-\-cflags -Print the compiler flags that are necessary to compile a \fIGNOME-XML\fP program. -.TP 8 -.B \-\-prefix=PREFIX -If specified, use PREFIX instead of the installation prefix that -\fIGNOME-XML\fP was built with when computing the output for the -\-\-cflags and \-\-libs options. This option must be specified before -any \-\-libs or \-\-cflags options. -.SH AUTHOR -This manual page was written by Fredrik Hallenberg , -for the Debian GNU/linux system (but may be used by others). diff --git a/reactos/lib/3rdparty/libxml2/xml2-config.in b/reactos/lib/3rdparty/libxml2/xml2-config.in deleted file mode 100644 index 19574864cb6..00000000000 --- a/reactos/lib/3rdparty/libxml2/xml2-config.in +++ /dev/null @@ -1,106 +0,0 @@ -#! /bin/sh - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -includedir=@includedir@ -libdir=@libdir@ - -usage() -{ - cat <raw); - nbchars = xmlCharEncInput(in); + nbchars = xmlCharEncInput(in, 1); if (nbchars < 0) { xmlIOErr(XML_IO_ENCODER, NULL); in->error = XML_IO_ENCODER; @@ -3344,7 +3344,7 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) { * convert as much as possible to the parser reading buffer. */ use = xmlBufUse(in->raw); - nbchars = xmlCharEncInput(in); + nbchars = xmlCharEncInput(in, 1); if (nbchars < 0) { xmlIOErr(XML_IO_ENCODER, NULL); in->error = XML_IO_ENCODER; @@ -3726,14 +3726,16 @@ xmlOutputBufferFlush(xmlOutputBufferPtr out) { */ if ((out->conv != NULL) && (out->encoder != NULL)) { /* - * convert as much as possible to the parser reading buffer. + * convert as much as possible to the parser output buffer. */ - nbchars = xmlCharEncOutput(out, 0); - if (nbchars < 0) { - xmlIOErr(XML_IO_ENCODER, NULL); - out->error = XML_IO_ENCODER; - return(-1); - } + do { + nbchars = xmlCharEncOutput(out, 0); + if (nbchars < 0) { + xmlIOErr(XML_IO_ENCODER, NULL); + out->error = XML_IO_ENCODER; + return(-1); + } + } while (nbchars); } /* diff --git a/reactos/lib/3rdparty/libxml2/xmllint.c b/reactos/lib/3rdparty/libxml2/xmllint.c index 9415d9aa49d..26d8db1c202 100644 --- a/reactos/lib/3rdparty/libxml2/xmllint.c +++ b/reactos/lib/3rdparty/libxml2/xmllint.c @@ -168,6 +168,7 @@ static int nodefdtd = 0; #endif #ifdef LIBXML_PUSH_ENABLED static int push = 0; +static int pushsize = 4096; #endif /* LIBXML_PUSH_ENABLED */ #ifdef HAVE_MMAP static int memory = 0; @@ -1874,7 +1875,8 @@ static void streamFile(char *filename) { xmlTextReaderSetParserProp(reader, XML_PARSER_VALIDATE, 1); else #endif /* LIBXML_VALID_ENABLED */ - xmlTextReaderSetParserProp(reader, XML_PARSER_LOADDTD, 1); + if (loaddtd) + xmlTextReaderSetParserProp(reader, XML_PARSER_LOADDTD, 1); #ifdef LIBXML_SCHEMAS_ENABLED if (relaxng != NULL) { if ((timing) && (!repeat)) { @@ -2192,17 +2194,15 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) { f = fopen(filename, "r"); #endif if (f != NULL) { - int res, size = 3; + int res; char chars[4096]; htmlParserCtxtPtr ctxt; - /* if (repeat) */ - size = 4096; res = fread(chars, 1, 4, f); if (res > 0) { ctxt = htmlCreatePushParserCtxt(NULL, NULL, chars, res, filename, XML_CHAR_ENCODING_NONE); - while ((res = fread(chars, 1, size, f)) > 0) { + while ((res = fread(chars, 1, pushsize, f)) > 0) { htmlParseChunk(ctxt, chars, res, 0); } htmlParseChunk(ctxt, chars, 0, 1); @@ -3017,6 +3017,7 @@ static void usage(const char *name) { #endif #ifdef LIBXML_PUSH_ENABLED printf("\t--push : use the push mode of the parser\n"); + printf("\t--pushsmall : use the push mode of the parser using tiny increments\n"); #endif /* LIBXML_PUSH_ENABLED */ #ifdef HAVE_MMAP printf("\t--memory : parse from memory\n"); @@ -3076,7 +3077,7 @@ static void usage(const char *name) { printf("\t--sax: do not build a tree but work just at the SAX level\n"); printf("\t--oldxml10: use XML-1.0 parsing rules before the 5th edition\n"); #ifdef LIBXML_XPATH_ENABLED - printf("\t--xpath expr: evaluate the XPath expression, inply --noout\n"); + printf("\t--xpath expr: evaluate the XPath expression, imply --noout\n"); #endif printf("\nLibxml project home page: http://xmlsoft.org/\n"); @@ -3247,6 +3248,11 @@ main(int argc, char **argv) { else if ((!strcmp(argv[i], "-push")) || (!strcmp(argv[i], "--push"))) push++; + else if ((!strcmp(argv[i], "-pushsmall")) || + (!strcmp(argv[i], "--pushsmall"))) { + push++; + pushsize = 10; + } #endif /* LIBXML_PUSH_ENABLED */ #ifdef HAVE_MMAP else if ((!strcmp(argv[i], "-memory")) || diff --git a/reactos/lib/3rdparty/libxml2/xmlreader.c b/reactos/lib/3rdparty/libxml2/xmlreader.c index 579e9437a45..00083d0e433 100644 --- a/reactos/lib/3rdparty/libxml2/xmlreader.c +++ b/reactos/lib/3rdparty/libxml2/xmlreader.c @@ -984,7 +984,7 @@ printf("Expand failed !\n"); * xmlTextReaderValidateCData: * @reader: the xmlTextReaderPtr used * @data: pointer to the CData - * @len: lenght of the CData block in bytes. + * @len: length of the CData block in bytes. * * Push some CData for validation */ @@ -1409,8 +1409,7 @@ get_next_node: #endif (reader->entNr == 0) && (reader->node->prev != NULL) && - (reader->node->prev->type != XML_DTD_NODE) && - (reader->entNr == 0)) { + (reader->node->prev->type != XML_DTD_NODE)) { xmlNodePtr tmp = reader->node->prev; if ((tmp->extra & NODE_IS_PRESERVED) == 0) { xmlUnlinkNode(tmp); @@ -1459,8 +1458,7 @@ get_next_node: #endif (reader->entNr == 0) && (oldnode->type != XML_DTD_NODE) && - ((oldnode->extra & NODE_IS_PRESERVED) == 0) && - (reader->entNr == 0)) { + ((oldnode->extra & NODE_IS_PRESERVED) == 0)) { xmlUnlinkNode(oldnode); xmlTextReaderFreeNode(reader, oldnode); } diff --git a/reactos/lib/3rdparty/libxml2/xmlregexp.c b/reactos/lib/3rdparty/libxml2/xmlregexp.c index 68e7bed9492..1f9911c7462 100644 --- a/reactos/lib/3rdparty/libxml2/xmlregexp.c +++ b/reactos/lib/3rdparty/libxml2/xmlregexp.c @@ -6838,7 +6838,7 @@ xmlExpRef(xmlExpNodePtr exp) { * xmlExpNewAtom: * @ctxt: the expression context * @name: the atom name - * @len: the atom name lenght in byte (or -1); + * @len: the atom name length in byte (or -1); * * Get the atom associated to this name from that context * @@ -6975,7 +6975,7 @@ tail: * @ctxt: the expression context * @exp: the expression * @langList: where to store the tokens - * @len: the allocated lenght of @list + * @len: the allocated length of @list * * Find all the strings used in @exp and store them in @list * @@ -7041,7 +7041,7 @@ tail: * @ctxt: the expression context * @exp: the expression * @tokList: where to store the tokens - * @len: the allocated lenght of @list + * @len: the allocated length of @list * * Find all the strings that appears at the start of the languages * accepted by @exp and store them in @list. E.g. for (a, b) | c diff --git a/reactos/lib/3rdparty/libxml2/xmlsave.c b/reactos/lib/3rdparty/libxml2/xmlsave.c index 829abb36b14..774404b884a 100644 --- a/reactos/lib/3rdparty/libxml2/xmlsave.c +++ b/reactos/lib/3rdparty/libxml2/xmlsave.c @@ -2247,6 +2247,7 @@ xmlBufNodeDump(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, size_t use; int ret; xmlOutputBufferPtr outbuf; + int oldalloc; xmlInitParser(); @@ -2278,7 +2279,10 @@ xmlBufNodeDump(xmlBufPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level, outbuf->written = 0; use = xmlBufUse(buf); + oldalloc = xmlBufGetAllocationScheme(buf); + xmlBufSetAllocationScheme(buf, XML_BUFFER_ALLOC_DOUBLEIT); xmlNodeDumpOutput(outbuf, doc, cur, level, format, NULL); + xmlBufSetAllocationScheme(buf, oldalloc); xmlFree(outbuf); ret = xmlBufUse(buf) - use; return (ret); diff --git a/reactos/lib/3rdparty/libxml2/xmlschemas.c b/reactos/lib/3rdparty/libxml2/xmlschemas.c index d6a47e4d47b..121533fec8f 100644 --- a/reactos/lib/3rdparty/libxml2/xmlschemas.c +++ b/reactos/lib/3rdparty/libxml2/xmlschemas.c @@ -26063,6 +26063,20 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt) "AUTOMATON create on '%s'\n", inode->localName); #endif } + + /* + * Do not check further content if the node has been nilled + */ + if (INODE_NILLED(inode)) { + ret = 0; +#ifdef DEBUG_AUTOMATA + xmlGenericError(xmlGenericErrorContext, + "AUTOMATON succeeded on nilled '%s'\n", + inode->localName); +#endif + goto skip_nilled; + } + /* * Get hold of the still expected content, since a further * call to xmlRegExecPushString() will loose this information. @@ -26100,6 +26114,9 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt) } } + +skip_nilled: + if (inode->typeDef->contentType == XML_SCHEMA_CONTENT_ELEMENTS) goto end_elem; @@ -27846,7 +27863,10 @@ xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt) const xmlChar *nsName; /* DOC VAL TODO: Move this to the start function. */ - valRoot = xmlDocGetRootElement(vctxt->doc); + if (vctxt->validationRoot != NULL) + valRoot = vctxt->validationRoot; + else + valRoot = xmlDocGetRootElement(vctxt->doc); if (valRoot == NULL) { /* VAL TODO: Error code? */ VERROR(1, NULL, "The document has no document element"); diff --git a/reactos/media/doc/3rd Party Files.txt b/reactos/media/doc/3rd Party Files.txt index e22f8b4c4e3..8905398bf9e 100644 --- a/reactos/media/doc/3rd Party Files.txt +++ b/reactos/media/doc/3rd Party Files.txt @@ -35,7 +35,7 @@ Used Version: 1.0.6 Website: http://www.bzip.org Title: LibXML -Used Version: 2.9.0 +Used Version: 2.9.1 Website: http://xmlsoft.org | ftp://xmlsoft.org/libxml2/ Title: ZLib From 16e97786ece9f1791e6b1d712f4ac54be5fbc940 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 20:22:07 +0000 Subject: [PATCH 346/419] [WIDL] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62774 --- reactos/media/doc/README.WINE | 2 +- reactos/tools/widl/getopt.c | 1209 +++++-- reactos/tools/widl/header.c | 15 +- reactos/tools/widl/header.h | 31 +- reactos/tools/widl/parser.l | 7 +- reactos/tools/widl/parser.tab.c | 4769 ++++++++++++++------------- reactos/tools/widl/parser.tab.h | 366 +- reactos/tools/widl/parser.y | 115 +- reactos/tools/widl/parser.yy.c | 627 ++-- reactos/tools/widl/proxy.c | 5 + reactos/tools/widl/typegen.c | 71 +- reactos/tools/widl/typelib.c | 10 - reactos/tools/widl/typelib_struct.h | 8 +- reactos/tools/widl/utils.c | 4 +- reactos/tools/widl/widl.c | 103 +- reactos/tools/widl/widl.h | 2 + reactos/tools/widl/widltypes.h | 5 +- reactos/tools/widl/write_msft.c | 94 +- reactos/tools/wpp/preproc.c | 2 +- 19 files changed, 4147 insertions(+), 3298 deletions(-) diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 4c67a396d54..953c8db5b87 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -22,7 +22,7 @@ When porting a new DLL from Wine to ReactOS, please do the following steps The following build tools are shared with Wine. reactos/tools/unicode # Synced to Wine-1.7.1 -reactos/tools/widl # Synced to Wine-1.5.11 +reactos/tools/widl # Synced to Wine-1.7.17 reactos/tools/wpp # Synced to Wine-1.7.1 The following libraries are shared with Wine. diff --git a/reactos/tools/widl/getopt.c b/reactos/tools/widl/getopt.c index c41bb0f8b63..3fae7871fa1 100644 --- a/reactos/tools/widl/getopt.c +++ b/reactos/tools/widl/getopt.c @@ -31,21 +31,10 @@ * SUCH DAMAGE. */ -#include -#include #include #include -#include #include -extern int opterr; /* if error message should be printed */ -extern int optind; /* index into parent argv vector */ -extern int optopt; /* character checked for validity */ -extern int optreset; /* reset getopt */ -extern char *optarg; /* argument associated with option */ - -int getopt (int, char * const *, const char *); - struct option { const char *name; int has_arg; @@ -53,384 +42,874 @@ struct option { int val; }; -int getopt_long (int, char *const *, const char *, const struct option *, int *); - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#define REPLACE_GETOPT - -#define _DIAGASSERT(x) do {} while (0) - -#ifdef REPLACE_GETOPT int opterr = 1; int optind = 1; int optopt = '?'; int optreset; char *optarg; + +#define my_index strchr + +#ifdef _LIBC +# ifdef USE_NONOPTION_FLAGS +# define SWAP_FLAGS(ch1, ch2) \ + if (nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +# else +# define SWAP_FLAGS(ch1, ch2) +# endif +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +int __getopt_initialized; + +static int first_nonopt = -1; +static int last_nonopt = -1; + +static char *nextchar; + +static char *posixly_correct; + +static enum +{ + REQUIRE_ORDER, + PERMUTE, + RETURN_IN_ORDER +} ordering; + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + nonoption_flags_len = nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + nonoption_flags_max_len), + '\0', top + 1 - nonoption_flags_max_len); + nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } #endif -#define __progname __argv[0] + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; -#define IGNORE_FIRST (*options == '-' || *options == '+') -#define PRINT_ERROR ((opterr) && ((*options != ':') || (IGNORE_FIRST && options[1] != ':'))) + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; -#ifndef IS_POSIXLY_CORRECT -#define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL) + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +static const char * +_getopt_initialize (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + first_nonopt = last_nonopt = optind; + + nextchar = NULL; + + posixly_correct = getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (posixly_correct != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + if (posixly_correct == NULL + && argc == __libc_argc && argv == __libc_argv) + { + if (nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = nonoption_flags_max_len = strlen (orig_str); + if (nonoption_flags_max_len < argc) + nonoption_flags_max_len = argc; + __getopt_nonoption_flags = malloc (nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', nonoption_flags_max_len - len); + } + } + nonoption_flags_len = nonoption_flags_max_len; + } + else + nonoption_flags_len = 0; #endif -#define PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST) - -#define IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-') - -#define BADCH (int)'?' -#define BADARG ((IGNORE_FIRST && options[1] == ':') || (*options == ':') ? (int)':' : (int)'?') -#define INORDER (int)1 - -static char EMSG[1]; - -static int getopt_internal (int,char * const *,const char *); -static int gcd (int,int); -static void permute_args (int,int,int,char * const *); - -static char *place = EMSG; - -static int nonopt_start = -1; -static int nonopt_end = -1; - -static const char recargchar[] = "option requires an argument -- %c"; -static const char recargstring[] = "option requires an argument -- %s"; -static const char ambig[] = "ambiguous option -- %.*s"; -static const char noarg[] = "option doesn't take an argument -- %.*s"; -static const char illoptchar[] = "unknown option -- %c"; -static const char illoptstring[] = "unknown option -- %s"; - -static void -_vwarnx(const char *fmt,va_list ap) -{ - (void)fprintf(stderr,"%s: ",__progname); - if (fmt != NULL) - (void)vfprintf(stderr,fmt,ap); - (void)fprintf(stderr,"\n"); + return optstring; } -static void -warnx(const char *fmt,...) -{ - va_list ap; - va_start(ap,fmt); - _vwarnx(fmt,ap); - va_end(ap); -} - -static int -gcd(a,b) - int a; - int b; -{ - int c; - - c = a % b; - while (c != 0) { - a = b; - b = c; - c = a % b; - } - - return b; -} - -static void -permute_args(panonopt_start,panonopt_end,opt_end,nargv) - int panonopt_start; - int panonopt_end; - int opt_end; - char * const *nargv; -{ - int cstart,cyclelen,i,j,ncycle,nnonopts,nopts,pos; - char *swap; - - _DIAGASSERT(nargv != NULL); - - nnonopts = panonopt_end - panonopt_start; - nopts = opt_end - panonopt_end; - ncycle = gcd(nnonopts,nopts); - cyclelen = (opt_end - panonopt_start) / ncycle; - - for (i = 0; i < ncycle; i++) { - cstart = panonopt_end+i; - pos = cstart; - for (j = 0; j < cyclelen; j++) { - if (pos >= panonopt_end) - pos -= nnonopts; - else - pos += nopts; - swap = nargv[pos]; - - ((char **) nargv)[pos] = nargv[cstart]; - - ((char **)nargv)[cstart] = swap; - } - } -} - -static int -getopt_internal(nargc,nargv,options) - int nargc; - char * const *nargv; - const char *options; -{ - char *oli; - int optchar; - - _DIAGASSERT(nargv != NULL); - _DIAGASSERT(options != NULL); - - optarg = NULL; - - if (optind == 0) - optind = 1; - - if (optreset) - nonopt_start = nonopt_end = -1; -start: - if (optreset || !*place) { - optreset = 0; - if (optind >= nargc) { - place = EMSG; - if (nonopt_end != -1) { - - permute_args(nonopt_start,nonopt_end,optind,nargv); - optind -= nonopt_end - nonopt_start; - } - else if (nonopt_start != -1) { - - optind = nonopt_start; - } - nonopt_start = nonopt_end = -1; - return -1; - } - if ((*(place = nargv[optind]) != '-') - || (place[1] == '\0')) { - place = EMSG; - if (IN_ORDER) { - - optarg = nargv[optind++]; - return INORDER; - } - if (!PERMUTE) { - - return -1; - } - - if (nonopt_start == -1) - nonopt_start = optind; - else if (nonopt_end != -1) { - permute_args(nonopt_start,nonopt_end,optind,nargv); - nonopt_start = optind - - (nonopt_end - nonopt_start); - nonopt_end = -1; - } - optind++; - - goto start; - } - if (nonopt_start != -1 && nonopt_end == -1) - nonopt_end = optind; - if (place[1] && *++place == '-') { - place++; - return -2; - } - } - if ((optchar = (int)*place++) == (int)':' || - (oli = strchr(options + (IGNORE_FIRST ? 1 : 0),optchar)) == NULL) { - - if (!*place) - ++optind; - if (PRINT_ERROR) - warnx(illoptchar,optchar); - optopt = optchar; - return BADCH; - } - if (optchar == 'W' && oli[1] == ';') { - - if (*place) - return -2; - - if (++optind >= nargc) { - place = EMSG; - if (PRINT_ERROR) - warnx(recargchar,optchar); - optopt = optchar; - return BADARG; - } else - place = nargv[optind]; - - return -2; - } - if (*++oli != ':') { - if (!*place) - ++optind; - } else { - optarg = NULL; - if (*place) - optarg = place; - - else if (oli[1] != ':') { - if (++optind >= nargc) { - place = EMSG; - if (PRINT_ERROR) - warnx(recargchar,optchar); - optopt = optchar; - return BADARG; - } else - optarg = nargv[optind]; - } - place = EMSG; - ++optind; - } - - return optchar; -} - -#ifdef REPLACE_GETOPT - int -getopt(nargc,nargv,options) - int nargc; - char * const *nargv; - const char *options; +getopt_long_only (int argc, char * const *argv, const char *options, const struct option *long_options, int *opt_index) { - int retval; - - _DIAGASSERT(nargv != NULL); - _DIAGASSERT(options != NULL); - - if ((retval = getopt_internal(nargc,nargv,options)) == -2) { - ++optind; - - if (nonopt_end != -1) { - permute_args(nonopt_start,nonopt_end,optind,nargv); - optind -= nonopt_end - nonopt_start; - } - nonopt_start = nonopt_end = -1; - retval = -1; - } - return retval; + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } -#endif int -getopt_long(nargc,nargv,options,long_options,idx) - int nargc; - char * const *nargv; - const char *options; - const struct option *long_options; - int *idx; +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; { - int retval; + int print_errors = opterr; + if (optstring[0] == ':') + print_errors = 0; - _DIAGASSERT(nargv != NULL); - _DIAGASSERT(options != NULL); - _DIAGASSERT(long_options != NULL); + if (argc < 1) + return -1; - if ((retval = getopt_internal(nargc,nargv,options)) == -2) { - char *current_argv,*has_equal; - size_t current_argv_len; - int i,match; + optarg = NULL; - current_argv = place; - match = -1; + if (optind == 0 || !__getopt_initialized) + { + if (optind == 0) + optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring); + __getopt_initialized = 1; + } + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#if defined _LIBC && defined USE_NONOPTION_FLAGS +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ + || (optind < nonoption_flags_len \ + && __getopt_nonoption_flags[optind] == '1')) +#else +# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') +#endif + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (last_nonopt > optind) + last_nonopt = optind; + if (first_nonopt > optind) + first_nonopt = optind; + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc && NONOPTION_P) + optind++; + last_nonopt = optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (ordering == REQUIRE_ORDER) + return -1; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else if (long_only + || pfound->has_arg != p->has_arg + || pfound->flag != p->flag + || pfound->val != p->val) + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[optind]) >= 0) + { + + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } +#else + fprintf (stderr, "%s: option `%s' is ambiguous\n", + argv[0], argv[optind]); +#endif + } + nextchar += strlen (nextchar); + optind++; + optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (argv[optind - 1][1] == '-') + { + /* --option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, "\ +%s: option `--%s' doesn't allow an argument\n", + argv[0], pfound->name); +#else + fprintf (stderr, "\ +%s: option `--%s' doesn't allow an argument\n", + argv[0], pfound->name); +#endif + } + else + { + /* +option or -option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, "\ +%s: option `%c%s' doesn't allow an argument\n", + argv[0], argv[optind - 1][0], + pfound->name); +#else + fprintf (stderr, "\ +%s: option `%c%s' doesn't allow an argument\n", + argv[0], argv[optind - 1][0], pfound->name); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } +#endif + } + + nextchar += strlen (nextchar); + + optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]) >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } +#else + fprintf (stderr, + "%s: option `%s' requires an argument\n", + argv[0], argv[optind - 1]); +#endif + } + nextchar += strlen (nextchar); + optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (argv[optind][1] == '-') + { + /* --option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), + argv[0], nextchar); +#else + fprintf (stderr, "%s: unrecognized option `--%s'\n", + argv[0], nextchar); +#endif + } + else + { + /* +option or -option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[optind][0], nextchar); +#else + fprintf (stderr, "%s: unrecognized option `%c%s'\n", + argv[0], argv[optind][0], nextchar); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } +#endif + } + nextchar = (char *) ""; + optind++; + optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (posixly_correct) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: illegal option -- %c\n"), + argv[0], c); +#else + fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c); +#endif + } + else + { +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: invalid option -- %c\n"), + argv[0], c); +#else + fprintf (stderr, "%s: invalid option -- %c\n", argv[0], c); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } +#endif + } + optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, + _("%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } +#else + fprintf (stderr, "%s: option requires an argument -- %c\n", + argv[0], c); +#endif + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if ((unsigned int) (nameend - nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[optind]) >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } +#else + fprintf (stderr, "%s: option `-W %s' is ambiguous\n", + argv[0], argv[optind]); +#endif + } + nextchar += strlen (nextchar); + optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name) >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } +#else + fprintf (stderr, "\ +%s: option `-W %s' doesn't allow an argument\n", + argv[0], pfound->name); +#endif + } + + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `%s' requires an argument\n"), + argv[0], argv[optind - 1]) >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); + + free (buf); + } +#else + fprintf (stderr, + "%s: option `%s' requires an argument\n", + argv[0], argv[optind - 1]); +#endif + } + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; optind++; - place = EMSG; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; - if (*current_argv == '\0') { + if (__asprintf (&buf, _("\ +%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + if (_IO_fwide (stderr, 0) > 0) + __fwprintf (stderr, L"%s", buf); + else + fputs (buf, stderr); - if (nonopt_end != -1) { - permute_args(nonopt_start,nonopt_end,optind,nargv); - optind -= nonopt_end - nonopt_start; - } - nonopt_start = nonopt_end = -1; - return -1; - } - if ((has_equal = strchr(current_argv,'=')) != NULL) { - - current_argv_len = has_equal - current_argv; - has_equal++; - } else - current_argv_len = strlen(current_argv); - - for (i = 0; long_options[i].name; i++) { - - if (strncmp(current_argv,long_options[i].name,current_argv_len)) - continue; - - if (strlen(long_options[i].name) == - (unsigned)current_argv_len) { - - match = i; - break; - } - if (match == -1) - match = i; - else { - - if (PRINT_ERROR) - warnx(ambig,(int)current_argv_len,current_argv); - optopt = 0; - return BADCH; - } - } - if (match != -1) { - if (long_options[match].has_arg == no_argument - && has_equal) { - if (PRINT_ERROR) - warnx(noarg,(int)current_argv_len,current_argv); - - if (long_options[match].flag == NULL) - optopt = long_options[match].val; - else - optopt = 0; - return BADARG; - } - if (long_options[match].has_arg == required_argument || - long_options[match].has_arg == optional_argument) { - if (has_equal) - optarg = has_equal; - else if (long_options[match].has_arg == - required_argument) { - - optarg = nargv[optind++]; - } - } - if ((long_options[match].has_arg == required_argument) - && (optarg == NULL)) { - - if (PRINT_ERROR) - warnx(recargstring,current_argv); - - if (long_options[match].flag == NULL) - optopt = long_options[match].val; - else - optopt = 0; - --optind; - return BADARG; - } - } else { - if (PRINT_ERROR) - warnx(illoptstring,current_argv); - optopt = 0; - return BADCH; - } - if (long_options[match].flag) { - *long_options[match].flag = long_options[match].val; - retval = 0; - } else - retval = long_options[match].val; - if (idx) - *idx = match; - } - return retval; + free (buf); + } +#else + fprintf (stderr, + "%s: option requires an argument -- %c\n", + argv[0], c); +#endif + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } } diff --git a/reactos/tools/widl/header.c b/reactos/tools/widl/header.c index 309a4c2a176..916f2941055 100644 --- a/reactos/tools/widl/header.c +++ b/reactos/tools/widl/header.c @@ -109,17 +109,7 @@ unsigned int get_attrv(const attr_list_t *list, enum attr_type t) return 0; } -int is_void(const type_t *t) -{ - return type_get_type(t) == TYPE_VOID; -} - -int is_conformant_array(const type_t *t) -{ - return is_array(t) && type_array_has_conformance(t); -} - -void write_guid(FILE *f, const char *guid_prefix, const char *name, const UUID *uuid) +static void write_guid(FILE *f, const char *guid_prefix, const char *name, const UUID *uuid) { if (!uuid) return; fprintf(f, "DEFINE_GUID(%s_%s, 0x%08x, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x," @@ -1351,6 +1341,7 @@ static void write_imports(FILE *header, const statement_list_t *stmts) case STMT_TYPEDEF: case STMT_MODULE: case STMT_CPPQUOTE: + case STMT_PRAGMA: case STMT_DECLARATION: /* not processed here */ break; @@ -1385,6 +1376,7 @@ static void write_forward_decls(FILE *header, const statement_list_t *stmts) case STMT_TYPEDEF: case STMT_MODULE: case STMT_CPPQUOTE: + case STMT_PRAGMA: case STMT_DECLARATION: /* not processed here */ break; @@ -1437,6 +1429,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons break; case STMT_IMPORTLIB: case STMT_MODULE: + case STMT_PRAGMA: /* not included in header */ break; case STMT_IMPORT: diff --git a/reactos/tools/widl/header.h b/reactos/tools/widl/header.h index 6d056db2df5..10601ff734e 100644 --- a/reactos/tools/widl/header.h +++ b/reactos/tools/widl/header.h @@ -28,9 +28,6 @@ extern int is_aliaschain_attr(const type_t *var, enum attr_type t); extern int is_attr(const attr_list_t *list, enum attr_type t); extern void *get_attrp(const attr_list_t *list, enum attr_type t); extern unsigned int get_attrv(const attr_list_t *list, enum attr_type t); -extern int is_void(const type_t *t); -extern int is_conformant_array(const type_t *t); -extern int is_declptr(const type_t *t); extern const char* get_name(const var_t *v); extern void write_type_left(FILE *h, type_t *t, int declonly); extern void write_type_right(FILE *h, type_t *t, int is_field); @@ -47,6 +44,7 @@ extern int need_proxy(const type_t *iface); extern int need_inline_stubs(const type_t *iface); extern int need_stub_files(const statement_list_t *stmts); extern int need_proxy_file(const statement_list_t *stmts); +extern int need_proxy_delegation(const statement_list_t *stmts); extern int need_inline_stubs_file(const statement_list_t *stmts); extern const var_t *is_callas(const attr_list_t *list); extern void write_args(FILE *h, const var_list_t *arg, const char *name, int obj, int do_indent); @@ -55,10 +53,33 @@ extern const type_t* get_explicit_generic_handle_type(const var_t* var); extern const var_t *get_func_handle_var( const type_t *iface, const var_t *func, unsigned char *explicit_fc, unsigned char *implicit_fc ); extern int has_out_arg_or_return(const var_t *func); -extern void write_guid(FILE *f, const char *guid_prefix, const char *name, - const UUID *uuid); extern int is_const_decl(const var_t *var); +static inline int is_ptr(const type_t *t) +{ + return type_get_type(t) == TYPE_POINTER; +} + +static inline int is_array(const type_t *t) +{ + return type_get_type(t) == TYPE_ARRAY; +} + +static inline int is_void(const type_t *t) +{ + return type_get_type(t) == TYPE_VOID; +} + +static inline int is_declptr(const type_t *t) +{ + return is_ptr(t) || (type_get_type(t) == TYPE_ARRAY && type_array_is_decl_as_ptr(t)); +} + +static inline int is_conformant_array(const type_t *t) +{ + return is_array(t) && type_array_has_conformance(t); +} + static inline int last_ptr(const type_t *type) { return is_ptr(type) && !is_declptr(type_pointer_get_ref(type)); diff --git a/reactos/tools/widl/parser.l b/reactos/tools/widl/parser.l index e80616792b4..b911186fc51 100644 --- a/reactos/tools/widl/parser.l +++ b/reactos/tools/widl/parser.l @@ -37,6 +37,7 @@ double [0-9]+\.[0-9]+([eE][+-]?[0-9]+)* %x WSTRQUOTE %x ATTR %x PP_LINE +%x PP_PRAGMA %x SQUOTE %{ @@ -125,6 +126,7 @@ UUID *parse_uuid(const char *u) ************************************************************************** */ %% +^{ws}*\#{ws}*pragma{ws}+ yy_push_state(PP_PRAGMA); ^{ws}*\#{ws}* yy_push_state(PP_LINE); [^\n]* { int lineno; @@ -144,6 +146,8 @@ UUID *parse_uuid(const char *u) line_number = lineno - 1; /* We didn't read the newline */ input_name = xstrdup(fname); } +midl_echo[^\n]* yyless(9); yy_pop_state(); return tCPPQUOTE; +[^\n]* parser_lval.str = xstrdup(yytext); yy_pop_state(); return aPRAGMA; \" yy_push_state(QUOTE); cbufidx = 0; \" { yy_pop_state(); @@ -261,6 +265,7 @@ static const struct keyword keywords[] = { {"long", tLONG}, {"methods", tMETHODS}, {"module", tMODULE}, + {"namespace", tNAMESPACE}, {"pascal", tPASCAL}, {"properties", tPROPERTIES}, {"register", tREGISTER}, @@ -414,7 +419,7 @@ static int kw_token(const char *kw) struct keyword key, *kwp; key.kw = kw; kwp = bsearch(&key, keywords, NKEYWORDS, sizeof(keywords[0]), kw_cmp_func); - if (kwp) { + if (kwp && (do_rt_extension || kwp->token != tNAMESPACE)) { parser_lval.str = xstrdup(kwp->kw); return kwp->token; } diff --git a/reactos/tools/widl/parser.tab.c b/reactos/tools/widl/parser.tab.c index 333f094f945..df664389552 100644 --- a/reactos/tools/widl/parser.tab.c +++ b/reactos/tools/widl/parser.tab.c @@ -115,33 +115,6 @@ #include "expr.h" #include "typetree.h" -#if defined(YYBYACC) - /* Berkeley yacc (byacc) doesn't seem to know about these */ - /* Some *BSD supplied versions do define these though */ -# ifndef YYEMPTY -# define YYEMPTY (-1) /* Empty lookahead value of yychar */ -# endif -# ifndef YYLEX -# define YYLEX yylex() -# endif - -#elif defined(YYBISON) - /* Bison was used for original development */ - /* #define YYEMPTY -2 */ - /* #define YYLEX yylex() */ - -#else - /* No yacc we know yet */ -# if !defined(YYEMPTY) || !defined(YYLEX) -# error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX. -# elif defined(__GNUC__) /* gcc defines the #warning directive */ -# warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested - /* #else we just take a chance that it works... */ -# endif -#endif - -#define YYERROR_VERBOSE - static unsigned char pointer_default = RPC_FC_UP; typedef struct list typelist_t; @@ -218,6 +191,7 @@ static statement_t *make_statement_type_decl(type_t *type); static statement_t *make_statement_reference(type_t *type); static statement_t *make_statement_declaration(var_t *var); static statement_t *make_statement_library(typelib_t *typelib); +static statement_t *make_statement_pragma(const char *str); static statement_t *make_statement_cppquote(const char *str); static statement_t *make_statement_importlib(const char *str); static statement_t *make_statement_module(type_t *type); @@ -225,11 +199,13 @@ static statement_t *make_statement_typedef(var_list_t *names); static statement_t *make_statement_import(const char *str); static statement_t *make_statement_typedef(var_list_t *names); static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt); +static statement_list_t *append_statements(statement_list_t *, statement_list_t *); +static attr_list_t *append_attribs(attr_list_t *, attr_list_t *); /* Line 268 of yacc.c */ -#line 233 "parser.tab.c" +#line 209 "parser.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -241,7 +217,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else -# define YYERROR_VERBOSE 0 +# define YYERROR_VERBOSE 1 #endif /* Enabling the token table. */ @@ -257,186 +233,188 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s know about them. */ enum yytokentype { aIDENTIFIER = 258, - aKNOWNTYPE = 259, - aNUM = 260, - aHEXNUM = 261, - aDOUBLE = 262, - aSTRING = 263, - aWSTRING = 264, - aSQSTRING = 265, - aUUID = 266, - aEOF = 267, - SHL = 268, - SHR = 269, - MEMBERPTR = 270, - EQUALITY = 271, - INEQUALITY = 272, - GREATEREQUAL = 273, - LESSEQUAL = 274, - LOGICALOR = 275, - LOGICALAND = 276, - ELLIPSIS = 277, - tAGGREGATABLE = 278, - tALLOCATE = 279, - tANNOTATION = 280, - tAPPOBJECT = 281, - tASYNC = 282, - tASYNCUUID = 283, - tAUTOHANDLE = 284, - tBINDABLE = 285, - tBOOLEAN = 286, - tBROADCAST = 287, - tBYTE = 288, - tBYTECOUNT = 289, - tCALLAS = 290, - tCALLBACK = 291, - tCASE = 292, - tCDECL = 293, - tCHAR = 294, - tCOCLASS = 295, - tCODE = 296, - tCOMMSTATUS = 297, - tCONST = 298, - tCONTEXTHANDLE = 299, - tCONTEXTHANDLENOSERIALIZE = 300, - tCONTEXTHANDLESERIALIZE = 301, - tCONTROL = 302, - tCPPQUOTE = 303, - tDECODE = 304, - tDEFAULT = 305, - tDEFAULTBIND = 306, - tDEFAULTCOLLELEM = 307, - tDEFAULTVALUE = 308, - tDEFAULTVTABLE = 309, - tDISABLECONSISTENCYCHECK = 310, - tDISPLAYBIND = 311, - tDISPINTERFACE = 312, - tDLLNAME = 313, - tDOUBLE = 314, - tDUAL = 315, - tENABLEALLOCATE = 316, - tENCODE = 317, - tENDPOINT = 318, - tENTRY = 319, - tENUM = 320, - tERRORSTATUST = 321, - tEXPLICITHANDLE = 322, - tEXTERN = 323, - tFALSE = 324, - tFASTCALL = 325, - tFAULTSTATUS = 326, - tFLOAT = 327, - tFORCEALLOCATE = 328, - tHANDLE = 329, - tHANDLET = 330, - tHELPCONTEXT = 331, - tHELPFILE = 332, - tHELPSTRING = 333, - tHELPSTRINGCONTEXT = 334, - tHELPSTRINGDLL = 335, - tHIDDEN = 336, - tHYPER = 337, - tID = 338, - tIDEMPOTENT = 339, - tIGNORE = 340, - tIIDIS = 341, - tIMMEDIATEBIND = 342, - tIMPLICITHANDLE = 343, - tIMPORT = 344, - tIMPORTLIB = 345, - tIN = 346, - tIN_LINE = 347, - tINLINE = 348, - tINPUTSYNC = 349, - tINT = 350, - tINT3264 = 351, - tINT64 = 352, - tINTERFACE = 353, - tLCID = 354, - tLENGTHIS = 355, - tLIBRARY = 356, - tLICENSED = 357, - tLOCAL = 358, - tLONG = 359, - tMAYBE = 360, - tMESSAGE = 361, - tMETHODS = 362, - tMODULE = 363, - tNOCODE = 364, - tNONBROWSABLE = 365, - tNONCREATABLE = 366, - tNONEXTENSIBLE = 367, - tNOTIFY = 368, - tNOTIFYFLAG = 369, - tNULL = 370, - tOBJECT = 371, - tODL = 372, - tOLEAUTOMATION = 373, - tOPTIMIZE = 374, - tOPTIONAL = 375, - tOUT = 376, - tPARTIALIGNORE = 377, - tPASCAL = 378, - tPOINTERDEFAULT = 379, - tPROGID = 380, - tPROPERTIES = 381, - tPROPGET = 382, - tPROPPUT = 383, - tPROPPUTREF = 384, - tPROXY = 385, - tPTR = 386, - tPUBLIC = 387, - tRANGE = 388, - tREADONLY = 389, - tREF = 390, - tREGISTER = 391, - tREPRESENTAS = 392, - tREQUESTEDIT = 393, - tRESTRICTED = 394, - tRETVAL = 395, - tSAFEARRAY = 396, - tSHORT = 397, - tSIGNED = 398, - tSIZEIS = 399, - tSIZEOF = 400, - tSMALL = 401, - tSOURCE = 402, - tSTATIC = 403, - tSTDCALL = 404, - tSTRICTCONTEXTHANDLE = 405, - tSTRING = 406, - tSTRUCT = 407, - tSWITCH = 408, - tSWITCHIS = 409, - tSWITCHTYPE = 410, - tTHREADING = 411, - tTRANSMITAS = 412, - tTRUE = 413, - tTYPEDEF = 414, - tUIDEFAULT = 415, - tUNION = 416, - tUNIQUE = 417, - tUNSIGNED = 418, - tUSESGETLASTERROR = 419, - tUSERMARSHAL = 420, - tUUID = 421, - tV1ENUM = 422, - tVARARG = 423, - tVERSION = 424, - tVIPROGID = 425, - tVOID = 426, - tWCHAR = 427, - tWIREMARSHAL = 428, - tAPARTMENT = 429, - tNEUTRAL = 430, - tSINGLE = 431, - tFREE = 432, - tBOTH = 433, - ADDRESSOF = 434, - NEG = 435, - POS = 436, - PPTR = 437, - CAST = 438 + aPRAGMA = 259, + aKNOWNTYPE = 260, + aNUM = 261, + aHEXNUM = 262, + aDOUBLE = 263, + aSTRING = 264, + aWSTRING = 265, + aSQSTRING = 266, + aUUID = 267, + aEOF = 268, + SHL = 269, + SHR = 270, + MEMBERPTR = 271, + EQUALITY = 272, + INEQUALITY = 273, + GREATEREQUAL = 274, + LESSEQUAL = 275, + LOGICALOR = 276, + LOGICALAND = 277, + ELLIPSIS = 278, + tAGGREGATABLE = 279, + tALLOCATE = 280, + tANNOTATION = 281, + tAPPOBJECT = 282, + tASYNC = 283, + tASYNCUUID = 284, + tAUTOHANDLE = 285, + tBINDABLE = 286, + tBOOLEAN = 287, + tBROADCAST = 288, + tBYTE = 289, + tBYTECOUNT = 290, + tCALLAS = 291, + tCALLBACK = 292, + tCASE = 293, + tCDECL = 294, + tCHAR = 295, + tCOCLASS = 296, + tCODE = 297, + tCOMMSTATUS = 298, + tCONST = 299, + tCONTEXTHANDLE = 300, + tCONTEXTHANDLENOSERIALIZE = 301, + tCONTEXTHANDLESERIALIZE = 302, + tCONTROL = 303, + tCPPQUOTE = 304, + tDECODE = 305, + tDEFAULT = 306, + tDEFAULTBIND = 307, + tDEFAULTCOLLELEM = 308, + tDEFAULTVALUE = 309, + tDEFAULTVTABLE = 310, + tDISABLECONSISTENCYCHECK = 311, + tDISPLAYBIND = 312, + tDISPINTERFACE = 313, + tDLLNAME = 314, + tDOUBLE = 315, + tDUAL = 316, + tENABLEALLOCATE = 317, + tENCODE = 318, + tENDPOINT = 319, + tENTRY = 320, + tENUM = 321, + tERRORSTATUST = 322, + tEXPLICITHANDLE = 323, + tEXTERN = 324, + tFALSE = 325, + tFASTCALL = 326, + tFAULTSTATUS = 327, + tFLOAT = 328, + tFORCEALLOCATE = 329, + tHANDLE = 330, + tHANDLET = 331, + tHELPCONTEXT = 332, + tHELPFILE = 333, + tHELPSTRING = 334, + tHELPSTRINGCONTEXT = 335, + tHELPSTRINGDLL = 336, + tHIDDEN = 337, + tHYPER = 338, + tID = 339, + tIDEMPOTENT = 340, + tIGNORE = 341, + tIIDIS = 342, + tIMMEDIATEBIND = 343, + tIMPLICITHANDLE = 344, + tIMPORT = 345, + tIMPORTLIB = 346, + tIN = 347, + tIN_LINE = 348, + tINLINE = 349, + tINPUTSYNC = 350, + tINT = 351, + tINT3264 = 352, + tINT64 = 353, + tINTERFACE = 354, + tLCID = 355, + tLENGTHIS = 356, + tLIBRARY = 357, + tLICENSED = 358, + tLOCAL = 359, + tLONG = 360, + tMAYBE = 361, + tMESSAGE = 362, + tMETHODS = 363, + tMODULE = 364, + tNAMESPACE = 365, + tNOCODE = 366, + tNONBROWSABLE = 367, + tNONCREATABLE = 368, + tNONEXTENSIBLE = 369, + tNOTIFY = 370, + tNOTIFYFLAG = 371, + tNULL = 372, + tOBJECT = 373, + tODL = 374, + tOLEAUTOMATION = 375, + tOPTIMIZE = 376, + tOPTIONAL = 377, + tOUT = 378, + tPARTIALIGNORE = 379, + tPASCAL = 380, + tPOINTERDEFAULT = 381, + tPROGID = 382, + tPROPERTIES = 383, + tPROPGET = 384, + tPROPPUT = 385, + tPROPPUTREF = 386, + tPROXY = 387, + tPTR = 388, + tPUBLIC = 389, + tRANGE = 390, + tREADONLY = 391, + tREF = 392, + tREGISTER = 393, + tREPRESENTAS = 394, + tREQUESTEDIT = 395, + tRESTRICTED = 396, + tRETVAL = 397, + tSAFEARRAY = 398, + tSHORT = 399, + tSIGNED = 400, + tSIZEIS = 401, + tSIZEOF = 402, + tSMALL = 403, + tSOURCE = 404, + tSTATIC = 405, + tSTDCALL = 406, + tSTRICTCONTEXTHANDLE = 407, + tSTRING = 408, + tSTRUCT = 409, + tSWITCH = 410, + tSWITCHIS = 411, + tSWITCHTYPE = 412, + tTHREADING = 413, + tTRANSMITAS = 414, + tTRUE = 415, + tTYPEDEF = 416, + tUIDEFAULT = 417, + tUNION = 418, + tUNIQUE = 419, + tUNSIGNED = 420, + tUSESGETLASTERROR = 421, + tUSERMARSHAL = 422, + tUUID = 423, + tV1ENUM = 424, + tVARARG = 425, + tVERSION = 426, + tVIPROGID = 427, + tVOID = 428, + tWCHAR = 429, + tWIREMARSHAL = 430, + tAPARTMENT = 431, + tNEUTRAL = 432, + tSINGLE = 433, + tFREE = 434, + tBOTH = 435, + ADDRESSOF = 436, + NEG = 437, + POS = 438, + PPTR = 439, + CAST = 440 }; #endif @@ -447,7 +425,7 @@ typedef union YYSTYPE { /* Line 293 of yacc.c */ -#line 153 "parser.y" +#line 129 "parser.y" attr_t *attr; attr_list_t *attr_list; @@ -477,7 +455,7 @@ typedef union YYSTYPE /* Line 293 of yacc.c */ -#line 481 "parser.tab.c" +#line 459 "parser.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -489,7 +467,7 @@ typedef union YYSTYPE /* Line 343 of yacc.c */ -#line 493 "parser.tab.c" +#line 471 "parser.tab.c" #ifdef short # undef short @@ -708,20 +686,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 2733 +#define YYLAST 3077 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 208 +#define YYNTOKENS 210 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 100 +#define YYNNTS 101 /* YYNRULES -- Number of rules. */ -#define YYNRULES 381 +#define YYNRULES 387 /* YYNRULES -- Number of states. */ -#define YYNSTATES 662 +#define YYNSTATES 679 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 438 +#define YYMAXUTOK 440 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -732,16 +710,16 @@ static const yytype_uint8 yytranslate[] = 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 192, 2, 2, 2, 191, 184, 2, - 203, 204, 189, 188, 179, 187, 199, 190, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 181, 202, - 185, 207, 186, 180, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 194, 2, 2, 2, 193, 186, 2, + 207, 208, 191, 190, 181, 189, 201, 192, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 183, 206, + 187, 209, 188, 182, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 200, 2, 201, 183, 2, 2, 2, 2, 2, + 2, 202, 2, 203, 185, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 205, 182, 206, 193, 2, 2, 2, + 2, 2, 2, 204, 184, 205, 195, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -772,7 +750,8 @@ static const yytype_uint8 yytranslate[] = 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 194, 195, 196, 197, 198 + 175, 176, 177, 178, 179, 180, 196, 197, 198, 199, + 200 }; #if YYDEBUG @@ -780,208 +759,211 @@ static const yytype_uint8 yytranslate[] = YYRHS. */ static const yytype_uint16 yyprhs[] = { - 0, 0, 3, 5, 6, 9, 12, 16, 19, 22, - 25, 28, 29, 32, 35, 39, 42, 45, 48, 51, - 54, 55, 58, 59, 61, 63, 66, 69, 71, 74, - 76, 79, 81, 84, 86, 89, 92, 95, 98, 103, - 107, 111, 117, 120, 124, 129, 130, 132, 134, 138, - 140, 144, 148, 151, 155, 159, 162, 163, 165, 169, - 171, 175, 180, 182, 186, 187, 189, 194, 196, 198, - 200, 202, 204, 209, 214, 216, 218, 220, 222, 224, - 226, 228, 230, 232, 234, 239, 241, 243, 245, 250, - 252, 254, 256, 261, 266, 268, 270, 272, 274, 279, - 284, 289, 294, 299, 301, 306, 308, 310, 315, 317, - 322, 324, 326, 331, 336, 338, 340, 342, 344, 346, - 348, 350, 352, 354, 356, 358, 360, 362, 364, 369, - 371, 373, 375, 380, 385, 387, 389, 391, 393, 395, - 402, 404, 409, 411, 413, 415, 420, 422, 424, 426, - 431, 436, 441, 446, 448, 450, 455, 460, 462, 464, - 469, 474, 479, 481, 483, 485, 487, 489, 491, 493, - 494, 497, 502, 506, 507, 510, 512, 514, 518, 522, - 524, 530, 532, 536, 537, 539, 541, 543, 545, 547, - 549, 551, 553, 555, 557, 559, 565, 569, 573, 577, - 581, 585, 589, 593, 597, 601, 605, 609, 613, 617, - 621, 625, 629, 633, 637, 640, 643, 646, 649, 652, - 655, 659, 663, 669, 675, 680, 684, 686, 690, 692, - 694, 695, 698, 703, 707, 710, 713, 714, 717, 720, - 722, 726, 729, 731, 735, 738, 739, 741, 742, 744, - 746, 748, 750, 752, 754, 756, 759, 762, 764, 766, - 768, 770, 772, 774, 775, 777, 779, 782, 784, 787, - 790, 792, 794, 796, 799, 802, 805, 811, 812, 815, - 818, 821, 824, 827, 830, 834, 837, 841, 847, 853, - 854, 857, 860, 863, 866, 873, 882, 885, 888, 891, - 894, 897, 900, 906, 908, 910, 912, 914, 916, 917, - 920, 923, 927, 928, 930, 933, 936, 939, 943, 946, - 948, 950, 954, 957, 962, 966, 969, 971, 975, 978, - 979, 981, 985, 988, 990, 994, 999, 1003, 1006, 1008, - 1012, 1015, 1016, 1018, 1020, 1024, 1027, 1029, 1033, 1038, - 1040, 1044, 1045, 1048, 1051, 1053, 1057, 1059, 1063, 1065, - 1067, 1069, 1071, 1073, 1075, 1077, 1079, 1085, 1087, 1089, - 1091, 1093, 1096, 1098, 1101, 1103, 1106, 1111, 1116, 1122, - 1133, 1135 + 0, 0, 3, 5, 6, 12, 15, 18, 22, 25, + 28, 31, 34, 35, 38, 44, 47, 51, 54, 57, + 60, 63, 66, 67, 70, 71, 73, 75, 78, 81, + 83, 86, 88, 90, 93, 95, 98, 100, 103, 106, + 109, 112, 117, 121, 125, 131, 134, 138, 143, 144, + 146, 148, 152, 154, 158, 162, 165, 169, 173, 176, + 177, 179, 183, 185, 189, 194, 196, 200, 201, 203, + 208, 210, 212, 214, 216, 218, 223, 228, 230, 232, + 234, 236, 238, 240, 242, 244, 246, 248, 253, 255, + 257, 259, 264, 266, 268, 270, 275, 280, 282, 284, + 286, 288, 293, 298, 303, 308, 313, 315, 320, 322, + 324, 329, 331, 336, 338, 340, 345, 350, 352, 354, + 356, 358, 360, 362, 364, 366, 368, 370, 372, 374, + 376, 378, 383, 385, 387, 389, 394, 399, 401, 403, + 405, 407, 409, 416, 418, 423, 425, 427, 429, 434, + 436, 438, 440, 445, 450, 455, 460, 462, 464, 469, + 474, 479, 481, 483, 488, 493, 498, 500, 502, 504, + 506, 508, 510, 512, 513, 516, 521, 525, 526, 529, + 531, 533, 537, 541, 543, 549, 551, 555, 556, 558, + 560, 562, 564, 566, 568, 570, 572, 574, 576, 578, + 584, 588, 592, 596, 600, 604, 608, 612, 616, 620, + 624, 628, 632, 636, 640, 644, 648, 652, 656, 659, + 662, 665, 668, 671, 674, 678, 682, 688, 694, 699, + 703, 705, 709, 711, 713, 714, 717, 722, 726, 729, + 732, 733, 736, 739, 741, 745, 748, 750, 754, 757, + 758, 760, 761, 763, 765, 767, 769, 771, 773, 775, + 778, 781, 783, 785, 787, 789, 791, 793, 794, 796, + 798, 801, 803, 806, 809, 811, 813, 815, 818, 821, + 824, 830, 833, 834, 837, 840, 843, 846, 849, 852, + 856, 859, 863, 869, 875, 876, 879, 882, 885, 888, + 895, 904, 907, 910, 913, 916, 919, 922, 928, 930, + 932, 934, 936, 938, 939, 942, 945, 949, 950, 952, + 955, 958, 961, 965, 968, 970, 972, 976, 979, 984, + 988, 991, 993, 997, 1000, 1001, 1003, 1007, 1010, 1012, + 1016, 1021, 1025, 1028, 1030, 1034, 1037, 1038, 1040, 1042, + 1046, 1049, 1051, 1055, 1060, 1062, 1066, 1067, 1070, 1073, + 1075, 1079, 1081, 1085, 1087, 1089, 1091, 1093, 1095, 1097, + 1099, 1101, 1107, 1109, 1111, 1113, 1115, 1118, 1120, 1123, + 1125, 1128, 1133, 1139, 1145, 1156, 1158, 1162 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 209, 0, -1, 210, -1, -1, 210, 275, -1, 210, - 274, -1, 210, 261, 202, -1, 210, 263, -1, 210, - 278, -1, 210, 222, -1, 210, 214, -1, -1, 211, - 275, -1, 211, 274, -1, 211, 261, 202, -1, 211, - 263, -1, 211, 278, -1, 211, 214, -1, 211, 219, - -1, 211, 222, -1, -1, 212, 214, -1, -1, 202, - -1, 216, -1, 215, 202, -1, 254, 202, -1, 218, - -1, 305, 202, -1, 240, -1, 65, 3, -1, 303, - -1, 152, 3, -1, 306, -1, 161, 3, -1, 229, - 240, -1, 229, 303, -1, 229, 306, -1, 48, 203, - 8, 204, -1, 89, 8, 202, -1, 217, 211, 12, - -1, 90, 203, 8, 204, 213, -1, 101, 3, -1, - 229, 220, 205, -1, 221, 211, 206, 213, -1, -1, - 225, -1, 226, -1, 224, 179, 226, -1, 224, -1, - 224, 179, 22, -1, 229, 283, 294, -1, 283, 294, - -1, 200, 243, 201, -1, 200, 189, 201, -1, 200, - 201, -1, -1, 229, -1, 200, 230, 201, -1, 232, - -1, 230, 179, 232, -1, 230, 201, 200, 232, -1, - 8, -1, 231, 179, 8, -1, -1, 23, -1, 25, - 203, 8, 204, -1, 26, -1, 27, -1, 29, -1, - 30, -1, 32, -1, 35, 203, 257, 204, -1, 37, - 203, 244, 204, -1, 41, -1, 42, -1, 44, -1, - 45, -1, 46, -1, 47, -1, 49, -1, 50, -1, - 51, -1, 52, -1, 53, 203, 246, 204, -1, 54, - -1, 55, -1, 56, -1, 58, 203, 8, 204, -1, - 60, -1, 61, -1, 62, -1, 63, 203, 231, 204, - -1, 64, 203, 246, 204, -1, 67, -1, 71, -1, - 73, -1, 74, -1, 76, 203, 245, 204, -1, 77, - 203, 8, 204, -1, 78, 203, 8, 204, -1, 79, - 203, 245, 204, -1, 80, 203, 8, 204, -1, 81, - -1, 83, 203, 245, 204, -1, 84, -1, 85, -1, - 86, 203, 243, 204, -1, 87, -1, 88, 203, 226, - 204, -1, 91, -1, 94, -1, 100, 203, 241, 204, - -1, 99, 203, 245, 204, -1, 99, -1, 102, -1, - 103, -1, 105, -1, 106, -1, 109, -1, 110, -1, - 111, -1, 112, -1, 113, -1, 114, -1, 116, -1, - 117, -1, 118, -1, 119, 203, 8, 204, -1, 120, - -1, 121, -1, 122, -1, 124, 203, 302, 204, -1, - 125, 203, 8, 204, -1, 127, -1, 128, -1, 129, - -1, 130, -1, 132, -1, 133, 203, 245, 179, 245, - 204, -1, 134, -1, 137, 203, 304, 204, -1, 138, - -1, 139, -1, 140, -1, 144, 203, 241, 204, -1, - 147, -1, 150, -1, 151, -1, 154, 203, 243, 204, - -1, 155, 203, 304, 204, -1, 157, 203, 304, 204, - -1, 156, 203, 301, 204, -1, 160, -1, 164, -1, - 165, 203, 304, 204, -1, 166, 203, 233, 204, -1, - 167, -1, 168, -1, 169, 203, 307, 204, -1, 170, - 203, 8, 204, -1, 173, 203, 304, 204, -1, 302, - -1, 11, -1, 8, -1, 38, -1, 70, -1, 123, - -1, 149, -1, -1, 235, 236, -1, 37, 245, 181, - 251, -1, 50, 181, 251, -1, -1, 238, 179, -1, - 238, -1, 239, -1, 238, 179, 239, -1, 257, 207, - 245, -1, 257, -1, 65, 256, 205, 237, 206, -1, - 242, -1, 241, 179, 242, -1, -1, 243, -1, 5, - -1, 6, -1, 7, -1, 69, -1, 115, -1, 158, - -1, 8, -1, 9, -1, 10, -1, 3, -1, 243, - 180, 243, 181, 243, -1, 243, 20, 243, -1, 243, - 21, 243, -1, 243, 182, 243, -1, 243, 183, 243, - -1, 243, 184, 243, -1, 243, 16, 243, -1, 243, - 17, 243, -1, 243, 186, 243, -1, 243, 185, 243, - -1, 243, 18, 243, -1, 243, 19, 243, -1, 243, - 13, 243, -1, 243, 14, 243, -1, 243, 188, 243, - -1, 243, 187, 243, -1, 243, 191, 243, -1, 243, - 189, 243, -1, 243, 190, 243, -1, 192, 243, -1, - 193, 243, -1, 188, 243, -1, 187, 243, -1, 184, - 243, -1, 189, 243, -1, 243, 15, 3, -1, 243, - 199, 3, -1, 203, 283, 290, 204, 243, -1, 145, - 203, 283, 290, 204, -1, 243, 200, 243, 201, -1, - 203, 243, 204, -1, 245, -1, 244, 179, 245, -1, - 243, -1, 243, -1, -1, 247, 248, -1, 228, 283, - 299, 202, -1, 228, 306, 202, -1, 252, 202, -1, - 229, 202, -1, -1, 250, 249, -1, 252, 202, -1, - 202, -1, 228, 283, 286, -1, 228, 303, -1, 254, - -1, 229, 283, 300, -1, 283, 300, -1, -1, 257, - -1, -1, 3, -1, 4, -1, 3, -1, 4, -1, - 33, -1, 172, -1, 260, -1, 143, 260, -1, 163, - 260, -1, 163, -1, 72, -1, 59, -1, 31, -1, - 66, -1, 75, -1, -1, 95, -1, 95, -1, 142, - 259, -1, 146, -1, 104, 259, -1, 82, 259, -1, - 97, -1, 39, -1, 96, -1, 40, 3, -1, 40, - 4, -1, 229, 261, -1, 262, 205, 264, 206, 213, - -1, -1, 264, 265, -1, 228, 275, -1, 57, 3, - -1, 57, 4, -1, 229, 266, -1, 126, 181, -1, - 268, 252, 202, -1, 107, 181, -1, 269, 253, 202, - -1, 267, 205, 268, 269, 206, -1, 267, 205, 272, - 202, 206, -1, -1, 181, 4, -1, 98, 3, -1, - 98, 4, -1, 229, 272, -1, 273, 271, 205, 212, - 206, 213, -1, 273, 181, 3, 205, 218, 212, 206, - 213, -1, 270, 213, -1, 272, 202, -1, 266, 202, - -1, 108, 3, -1, 108, 4, -1, 229, 276, -1, - 277, 205, 212, 206, 213, -1, 68, -1, 148, -1, - 136, -1, 93, -1, 43, -1, -1, 282, 281, -1, - 304, 284, -1, 285, 304, 284, -1, -1, 285, -1, - 281, 284, -1, 280, 284, -1, 279, 284, -1, 189, - 282, 286, -1, 234, 286, -1, 287, -1, 257, -1, - 203, 286, 204, -1, 287, 227, -1, 287, 203, 223, - 204, -1, 189, 282, 290, -1, 234, 290, -1, 291, - -1, 189, 282, 294, -1, 234, 294, -1, -1, 288, - -1, 203, 289, 204, -1, 291, 227, -1, 227, -1, - 203, 223, 204, -1, 291, 203, 223, 204, -1, 189, - 282, 294, -1, 234, 294, -1, 295, -1, 189, 282, - 294, -1, 234, 294, -1, -1, 292, -1, 257, -1, - 203, 293, 204, -1, 295, 227, -1, 227, -1, 203, - 223, 204, -1, 295, 203, 223, 204, -1, 286, -1, - 296, 179, 286, -1, -1, 181, 246, -1, 292, 297, - -1, 298, -1, 299, 179, 298, -1, 286, -1, 286, - 207, 246, -1, 174, -1, 175, -1, 176, -1, 177, - -1, 178, -1, 135, -1, 162, -1, 131, -1, 152, - 256, 205, 247, 206, -1, 171, -1, 4, -1, 258, - -1, 240, -1, 65, 3, -1, 303, -1, 152, 3, - -1, 306, -1, 161, 3, -1, 141, 203, 304, 204, - -1, 159, 228, 283, 296, -1, 161, 256, 205, 250, - 206, -1, 161, 256, 153, 203, 252, 204, 255, 205, - 235, 206, -1, 5, -1, 5, 199, 5, -1 + 211, 0, -1, 212, -1, -1, 212, 266, 204, 212, + 205, -1, 212, 278, -1, 212, 277, -1, 212, 263, + 206, -1, 212, 265, -1, 212, 281, -1, 212, 224, + -1, 212, 216, -1, -1, 213, 278, -1, 213, 266, + 204, 213, 205, -1, 213, 277, -1, 213, 263, 206, + -1, 213, 265, -1, 213, 281, -1, 213, 216, -1, + 213, 221, -1, 213, 224, -1, -1, 214, 216, -1, + -1, 206, -1, 218, -1, 217, 206, -1, 256, 206, + -1, 220, -1, 308, 206, -1, 4, -1, 242, -1, + 66, 3, -1, 306, -1, 154, 3, -1, 309, -1, + 163, 3, -1, 231, 242, -1, 231, 306, -1, 231, + 309, -1, 49, 207, 9, 208, -1, 90, 9, 206, + -1, 219, 213, 13, -1, 91, 207, 9, 208, 215, + -1, 102, 3, -1, 231, 222, 204, -1, 223, 213, + 205, 215, -1, -1, 227, -1, 228, -1, 226, 181, + 228, -1, 226, -1, 226, 181, 23, -1, 231, 286, + 297, -1, 286, 297, -1, 202, 245, 203, -1, 202, + 191, 203, -1, 202, 203, -1, -1, 231, -1, 202, + 232, 203, -1, 234, -1, 232, 181, 234, -1, 232, + 203, 202, 234, -1, 9, -1, 233, 181, 9, -1, + -1, 24, -1, 26, 207, 9, 208, -1, 27, -1, + 28, -1, 30, -1, 31, -1, 33, -1, 36, 207, + 259, 208, -1, 38, 207, 246, 208, -1, 42, -1, + 43, -1, 45, -1, 46, -1, 47, -1, 48, -1, + 50, -1, 51, -1, 52, -1, 53, -1, 54, 207, + 248, 208, -1, 55, -1, 56, -1, 57, -1, 59, + 207, 9, 208, -1, 61, -1, 62, -1, 63, -1, + 64, 207, 233, 208, -1, 65, 207, 248, 208, -1, + 68, -1, 72, -1, 74, -1, 75, -1, 77, 207, + 247, 208, -1, 78, 207, 9, 208, -1, 79, 207, + 9, 208, -1, 80, 207, 247, 208, -1, 81, 207, + 9, 208, -1, 82, -1, 84, 207, 247, 208, -1, + 85, -1, 86, -1, 87, 207, 245, 208, -1, 88, + -1, 89, 207, 228, 208, -1, 92, -1, 95, -1, + 101, 207, 243, 208, -1, 100, 207, 247, 208, -1, + 100, -1, 103, -1, 104, -1, 106, -1, 107, -1, + 111, -1, 112, -1, 113, -1, 114, -1, 115, -1, + 116, -1, 118, -1, 119, -1, 120, -1, 121, 207, + 9, 208, -1, 122, -1, 123, -1, 124, -1, 126, + 207, 305, 208, -1, 127, 207, 9, 208, -1, 129, + -1, 130, -1, 131, -1, 132, -1, 134, -1, 135, + 207, 247, 181, 247, 208, -1, 136, -1, 139, 207, + 307, 208, -1, 140, -1, 141, -1, 142, -1, 146, + 207, 243, 208, -1, 149, -1, 152, -1, 153, -1, + 156, 207, 245, 208, -1, 157, 207, 307, 208, -1, + 159, 207, 307, 208, -1, 158, 207, 304, 208, -1, + 162, -1, 166, -1, 167, 207, 307, 208, -1, 168, + 207, 235, 208, -1, 29, 207, 235, 208, -1, 169, + -1, 170, -1, 171, 207, 310, 208, -1, 172, 207, + 9, 208, -1, 175, 207, 307, 208, -1, 305, -1, + 12, -1, 9, -1, 39, -1, 71, -1, 125, -1, + 151, -1, -1, 237, 238, -1, 38, 247, 183, 253, + -1, 51, 183, 253, -1, -1, 240, 181, -1, 240, + -1, 241, -1, 240, 181, 241, -1, 259, 209, 247, + -1, 259, -1, 66, 258, 204, 239, 205, -1, 244, + -1, 243, 181, 244, -1, -1, 245, -1, 6, -1, + 7, -1, 8, -1, 70, -1, 117, -1, 160, -1, + 9, -1, 10, -1, 11, -1, 3, -1, 245, 182, + 245, 183, 245, -1, 245, 21, 245, -1, 245, 22, + 245, -1, 245, 184, 245, -1, 245, 185, 245, -1, + 245, 186, 245, -1, 245, 17, 245, -1, 245, 18, + 245, -1, 245, 188, 245, -1, 245, 187, 245, -1, + 245, 19, 245, -1, 245, 20, 245, -1, 245, 14, + 245, -1, 245, 15, 245, -1, 245, 190, 245, -1, + 245, 189, 245, -1, 245, 193, 245, -1, 245, 191, + 245, -1, 245, 192, 245, -1, 194, 245, -1, 195, + 245, -1, 190, 245, -1, 189, 245, -1, 186, 245, + -1, 191, 245, -1, 245, 16, 3, -1, 245, 201, + 3, -1, 207, 286, 293, 208, 245, -1, 147, 207, + 286, 293, 208, -1, 245, 202, 245, 203, -1, 207, + 245, 208, -1, 247, -1, 246, 181, 247, -1, 245, + -1, 245, -1, -1, 249, 250, -1, 230, 286, 302, + 206, -1, 230, 309, 206, -1, 254, 206, -1, 231, + 206, -1, -1, 252, 251, -1, 254, 206, -1, 206, + -1, 230, 286, 289, -1, 230, 306, -1, 256, -1, + 231, 286, 303, -1, 286, 303, -1, -1, 259, -1, + -1, 3, -1, 5, -1, 3, -1, 5, -1, 34, + -1, 174, -1, 262, -1, 145, 262, -1, 165, 262, + -1, 165, -1, 73, -1, 60, -1, 32, -1, 67, + -1, 76, -1, -1, 96, -1, 96, -1, 144, 261, + -1, 148, -1, 105, 261, -1, 83, 261, -1, 98, + -1, 40, -1, 97, -1, 41, 3, -1, 41, 5, + -1, 231, 263, -1, 264, 204, 267, 205, 215, -1, + 110, 3, -1, -1, 267, 268, -1, 230, 278, -1, + 58, 3, -1, 58, 5, -1, 231, 269, -1, 128, + 183, -1, 271, 254, 206, -1, 108, 183, -1, 272, + 255, 206, -1, 270, 204, 271, 272, 205, -1, 270, + 204, 275, 206, 205, -1, -1, 183, 5, -1, 99, + 3, -1, 99, 5, -1, 231, 275, -1, 276, 274, + 204, 214, 205, 215, -1, 276, 183, 3, 204, 220, + 214, 205, 215, -1, 273, 215, -1, 275, 206, -1, + 269, 206, -1, 109, 3, -1, 109, 5, -1, 231, + 279, -1, 280, 204, 214, 205, 215, -1, 69, -1, + 150, -1, 138, -1, 94, -1, 44, -1, -1, 285, + 284, -1, 307, 287, -1, 288, 307, 287, -1, -1, + 288, -1, 284, 287, -1, 283, 287, -1, 282, 287, + -1, 191, 285, 289, -1, 236, 289, -1, 290, -1, + 259, -1, 207, 289, 208, -1, 290, 229, -1, 290, + 207, 225, 208, -1, 191, 285, 293, -1, 236, 293, + -1, 294, -1, 191, 285, 297, -1, 236, 297, -1, + -1, 291, -1, 207, 292, 208, -1, 294, 229, -1, + 229, -1, 207, 225, 208, -1, 294, 207, 225, 208, + -1, 191, 285, 297, -1, 236, 297, -1, 298, -1, + 191, 285, 297, -1, 236, 297, -1, -1, 295, -1, + 259, -1, 207, 296, 208, -1, 298, 229, -1, 229, + -1, 207, 225, 208, -1, 298, 207, 225, 208, -1, + 289, -1, 299, 181, 289, -1, -1, 183, 248, -1, + 295, 300, -1, 301, -1, 302, 181, 301, -1, 289, + -1, 289, 209, 248, -1, 176, -1, 177, -1, 178, + -1, 179, -1, 180, -1, 137, -1, 164, -1, 133, + -1, 154, 258, 204, 249, 205, -1, 173, -1, 5, + -1, 260, -1, 242, -1, 66, 3, -1, 306, -1, + 154, 3, -1, 309, -1, 163, 3, -1, 143, 207, + 307, 208, -1, 230, 161, 230, 286, 299, -1, 163, + 258, 204, 252, 205, -1, 163, 258, 155, 207, 254, + 208, 257, 204, 237, 205, -1, 6, -1, 6, 201, + 6, -1, 7, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 328, 328, 342, 343, 344, 345, 348, 351, 352, - 353, 356, 357, 358, 359, 360, 363, 364, 365, 366, - 369, 370, 373, 374, 378, 379, 380, 381, 382, 386, - 387, 388, 389, 390, 391, 392, 393, 394, 397, 399, - 407, 413, 417, 419, 423, 430, 431, 434, 435, 438, - 439, 443, 448, 455, 459, 460, 463, 464, 468, 471, - 472, 473, 476, 477, 480, 481, 482, 483, 484, 485, - 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, - 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, - 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, - 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, - 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, - 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, - 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, - 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, - 579, 580, 581, 585, 586, 591, 592, 593, 594, 597, - 598, 601, 605, 611, 612, 613, 616, 620, 632, 636, - 641, 644, 645, 648, 649, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, - 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, - 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, - 687, 688, 689, 691, 693, 694, 697, 698, 701, 707, - 713, 714, 717, 722, 729, 730, 733, 734, 738, 739, - 742, 746, 752, 760, 764, 769, 770, 773, 774, 775, - 778, 780, 783, 784, 785, 786, 787, 788, 789, 790, - 791, 792, 793, 796, 797, 800, 801, 802, 803, 804, - 805, 806, 807, 810, 811, 819, 825, 829, 830, 834, - 837, 838, 841, 850, 851, 854, 855, 858, 864, 870, - 871, 874, 875, 878, 888, 895, 901, 905, 906, 909, - 910, 913, 918, 925, 926, 927, 931, 935, 938, 939, - 942, 943, 947, 948, 952, 953, 954, 958, 960, 962, - 966, 967, 968, 969, 977, 979, 981, 986, 988, 993, - 994, 999, 1000, 1001, 1002, 1007, 1016, 1018, 1019, 1024, - 1026, 1030, 1031, 1038, 1039, 1040, 1041, 1042, 1047, 1055, - 1056, 1059, 1060, 1063, 1070, 1071, 1076, 1077, 1081, 1082, - 1083, 1084, 1085, 1089, 1090, 1091, 1094, 1097, 1098, 1099, - 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1109, 1115, 1117, - 1123, 1124 + 0, 308, 308, 322, 323, 325, 326, 327, 330, 333, + 334, 335, 338, 339, 340, 342, 343, 344, 347, 348, + 349, 350, 353, 354, 357, 358, 362, 363, 364, 365, + 366, 367, 371, 372, 373, 374, 375, 376, 377, 378, + 379, 382, 384, 392, 398, 402, 404, 408, 415, 416, + 419, 420, 423, 424, 428, 433, 440, 444, 445, 448, + 449, 453, 456, 457, 458, 461, 462, 465, 466, 467, + 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, + 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, + 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, + 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, + 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, + 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, + 538, 539, 540, 544, 545, 546, 547, 548, 549, 550, + 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 565, 566, 567, 571, 572, 577, + 578, 579, 580, 583, 584, 587, 591, 597, 598, 599, + 602, 606, 618, 622, 627, 630, 631, 634, 635, 638, + 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, + 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, + 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, + 669, 670, 671, 672, 673, 674, 675, 677, 679, 680, + 683, 684, 687, 693, 699, 700, 703, 708, 715, 716, + 719, 720, 724, 725, 728, 732, 738, 746, 750, 755, + 756, 759, 760, 761, 764, 766, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 782, 783, 786, + 787, 788, 789, 790, 791, 792, 793, 796, 797, 805, + 811, 815, 818, 819, 823, 826, 827, 830, 839, 840, + 843, 844, 847, 853, 859, 860, 863, 864, 867, 877, + 886, 892, 896, 897, 900, 901, 904, 909, 916, 917, + 918, 922, 926, 929, 930, 933, 934, 938, 939, 943, + 944, 945, 949, 951, 953, 957, 958, 959, 960, 968, + 970, 972, 977, 979, 984, 985, 990, 991, 992, 993, + 998, 1007, 1009, 1010, 1015, 1017, 1021, 1022, 1029, 1030, + 1031, 1032, 1033, 1038, 1046, 1047, 1050, 1051, 1054, 1061, + 1062, 1067, 1068, 1072, 1073, 1074, 1075, 1076, 1080, 1081, + 1082, 1085, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, + 1096, 1097, 1100, 1107, 1109, 1115, 1116, 1117 }; #endif @@ -990,9 +972,9 @@ static const yytype_uint16 yyrline[] = First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "aIDENTIFIER", "aKNOWNTYPE", "aNUM", - "aHEXNUM", "aDOUBLE", "aSTRING", "aWSTRING", "aSQSTRING", "aUUID", - "aEOF", "SHL", "SHR", "MEMBERPTR", "EQUALITY", "INEQUALITY", + "$end", "error", "$undefined", "aIDENTIFIER", "aPRAGMA", "aKNOWNTYPE", + "aNUM", "aHEXNUM", "aDOUBLE", "aSTRING", "aWSTRING", "aSQSTRING", + "aUUID", "aEOF", "SHL", "SHR", "MEMBERPTR", "EQUALITY", "INEQUALITY", "GREATEREQUAL", "LESSEQUAL", "LOGICALOR", "LOGICALAND", "ELLIPSIS", "tAGGREGATABLE", "tALLOCATE", "tANNOTATION", "tAPPOBJECT", "tASYNC", "tASYNCUUID", "tAUTOHANDLE", "tBINDABLE", "tBOOLEAN", "tBROADCAST", @@ -1010,8 +992,8 @@ static const char *const yytname[] = "tIIDIS", "tIMMEDIATEBIND", "tIMPLICITHANDLE", "tIMPORT", "tIMPORTLIB", "tIN", "tIN_LINE", "tINLINE", "tINPUTSYNC", "tINT", "tINT3264", "tINT64", "tINTERFACE", "tLCID", "tLENGTHIS", "tLIBRARY", "tLICENSED", "tLOCAL", - "tLONG", "tMAYBE", "tMESSAGE", "tMETHODS", "tMODULE", "tNOCODE", - "tNONBROWSABLE", "tNONCREATABLE", "tNONEXTENSIBLE", "tNOTIFY", + "tLONG", "tMAYBE", "tMESSAGE", "tMETHODS", "tMODULE", "tNAMESPACE", + "tNOCODE", "tNONBROWSABLE", "tNONCREATABLE", "tNONEXTENSIBLE", "tNOTIFY", "tNOTIFYFLAG", "tNULL", "tOBJECT", "tODL", "tOLEAUTOMATION", "tOPTIMIZE", "tOPTIONAL", "tOUT", "tPARTIALIGNORE", "tPASCAL", "tPOINTERDEFAULT", "tPROGID", "tPROPERTIES", "tPROPGET", "tPROPPUT", "tPROPPUTREF", @@ -1026,7 +1008,7 @@ static const char *const yytname[] = "tNEUTRAL", "tSINGLE", "tFREE", "tBOTH", "','", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "'~'", "ADDRESSOF", "NEG", "POS", "PPTR", "CAST", "'.'", "'['", "']'", - "';'", "'('", "')'", "'{'", "'}'", "'='", "$accept", "input", + "'{'", "'}'", "';'", "'('", "')'", "'='", "$accept", "input", "gbl_statements", "imp_statements", "int_statements", "semicolon_opt", "statement", "typedecl", "cppquote", "import_start", "import", "importlib", "libraryhdr", "library_start", "librarydef", "m_args", @@ -1037,14 +1019,15 @@ static const char *const yytname[] = "fields", "field", "ne_union_field", "ne_union_fields", "union_field", "s_field", "funcdef", "declaration", "m_ident", "t_ident", "ident", "base_type", "m_int", "int_std", "coclass", "coclasshdr", "coclassdef", - "coclass_ints", "coclass_int", "dispinterface", "dispinterfacehdr", - "dispint_props", "dispint_meths", "dispinterfacedef", "inherit", - "interface", "interfacehdr", "interfacedef", "interfacedec", "module", - "modulehdr", "moduledef", "storage_cls_spec", "function_specifier", - "type_qualifier", "m_type_qual_list", "decl_spec", "m_decl_spec_no_type", - "decl_spec_no_type", "declarator", "direct_declarator", - "abstract_declarator", "abstract_declarator_no_direct", - "m_abstract_declarator", "abstract_direct_declarator", "any_declarator", + "namespacedef", "coclass_ints", "coclass_int", "dispinterface", + "dispinterfacehdr", "dispint_props", "dispint_meths", "dispinterfacedef", + "inherit", "interface", "interfacehdr", "interfacedef", "interfacedec", + "module", "modulehdr", "moduledef", "storage_cls_spec", + "function_specifier", "type_qualifier", "m_type_qual_list", "decl_spec", + "m_decl_spec_no_type", "decl_spec_no_type", "declarator", + "direct_declarator", "abstract_declarator", + "abstract_declarator_no_direct", "m_abstract_declarator", + "abstract_direct_declarator", "any_declarator", "any_declarator_no_direct", "m_any_declarator", "any_direct_declarator", "declarator_list", "m_bitfield", "struct_declarator", "struct_declarator_list", "init_declarator", "threading_type", @@ -1074,99 +1057,99 @@ static const yytype_uint16 yytoknum[] = 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 44, - 63, 58, 124, 94, 38, 60, 62, 45, 43, 42, - 47, 37, 33, 126, 434, 435, 436, 437, 438, 46, - 91, 93, 59, 40, 41, 123, 125, 61 + 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, + 435, 44, 63, 58, 124, 94, 38, 60, 62, 45, + 43, 42, 47, 37, 33, 126, 436, 437, 438, 439, + 440, 46, 91, 93, 123, 125, 59, 40, 41, 61 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint16 yyr1[] = { - 0, 208, 209, 210, 210, 210, 210, 210, 210, 210, - 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 212, 212, 213, 213, 214, 214, 214, 214, 214, 215, - 215, 215, 215, 215, 215, 215, 215, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 223, 224, 224, 225, - 225, 226, 226, 227, 227, 227, 228, 228, 229, 230, - 230, 230, 231, 231, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, - 232, 232, 232, 233, 233, 234, 234, 234, 234, 235, - 235, 236, 236, 237, 237, 237, 238, 238, 239, 239, - 240, 241, 241, 242, 242, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 244, 244, 245, 246, - 247, 247, 248, 248, 249, 249, 250, 250, 251, 251, - 252, 252, 253, 254, 254, 255, 255, 256, 256, 256, - 257, 257, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 259, 259, 260, 260, 260, 260, 260, - 260, 260, 260, 261, 261, 262, 263, 264, 264, 265, - 266, 266, 267, 268, 268, 269, 269, 270, 270, 271, - 271, 272, 272, 273, 274, 274, 274, 275, 275, 276, - 276, 277, 278, 279, 279, 279, 280, 281, 282, 282, - 283, 283, 284, 284, 285, 285, 285, 286, 286, 286, - 287, 287, 287, 287, 288, 288, 288, 289, 289, 290, - 290, 291, 291, 291, 291, 291, 292, 292, 292, 293, - 293, 294, 294, 295, 295, 295, 295, 295, 295, 296, - 296, 297, 297, 298, 299, 299, 300, 300, 301, 301, - 301, 301, 301, 302, 302, 302, 303, 304, 304, 304, - 304, 304, 304, 304, 304, 304, 304, 305, 306, 306, - 307, 307 + 0, 210, 211, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 213, 213, 213, 213, 213, 213, 213, 213, + 213, 213, 214, 214, 215, 215, 216, 216, 216, 216, + 216, 216, 217, 217, 217, 217, 217, 217, 217, 217, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 225, + 226, 226, 227, 227, 228, 228, 229, 229, 229, 230, + 230, 231, 232, 232, 232, 233, 233, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, + 234, 234, 234, 234, 234, 234, 234, 235, 235, 236, + 236, 236, 236, 237, 237, 238, 238, 239, 239, 239, + 240, 240, 241, 241, 242, 243, 243, 244, 244, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 246, 246, 247, 248, 249, 249, 250, 250, 251, 251, + 252, 252, 253, 253, 254, 254, 255, 256, 256, 257, + 257, 258, 258, 258, 259, 259, 260, 260, 260, 260, + 260, 260, 260, 260, 260, 260, 260, 261, 261, 262, + 262, 262, 262, 262, 262, 262, 262, 263, 263, 264, + 265, 266, 267, 267, 268, 269, 269, 270, 271, 271, + 272, 272, 273, 273, 274, 274, 275, 275, 276, 277, + 277, 277, 278, 278, 279, 279, 280, 281, 282, 282, + 282, 283, 284, 285, 285, 286, 286, 287, 287, 288, + 288, 288, 289, 289, 289, 290, 290, 290, 290, 291, + 291, 291, 292, 292, 293, 293, 294, 294, 294, 294, + 294, 295, 295, 295, 296, 296, 297, 297, 298, 298, + 298, 298, 298, 298, 299, 299, 300, 300, 301, 302, + 302, 303, 303, 304, 304, 304, 304, 304, 305, 305, + 305, 306, 307, 307, 307, 307, 307, 307, 307, 307, + 307, 307, 308, 309, 309, 310, 310, 310 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 1, 0, 2, 2, 3, 2, 2, 2, - 2, 0, 2, 2, 3, 2, 2, 2, 2, 2, - 0, 2, 0, 1, 1, 2, 2, 1, 2, 1, - 2, 1, 2, 1, 2, 2, 2, 2, 4, 3, - 3, 5, 2, 3, 4, 0, 1, 1, 3, 1, - 3, 3, 2, 3, 3, 2, 0, 1, 3, 1, - 3, 4, 1, 3, 0, 1, 4, 1, 1, 1, - 1, 1, 4, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 4, 1, 1, 1, 4, 1, - 1, 1, 4, 4, 1, 1, 1, 1, 4, 4, - 4, 4, 4, 1, 4, 1, 1, 4, 1, 4, - 1, 1, 4, 4, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, - 1, 1, 4, 4, 1, 1, 1, 1, 1, 6, - 1, 4, 1, 1, 1, 4, 1, 1, 1, 4, - 4, 4, 4, 1, 1, 4, 4, 1, 1, 4, - 4, 4, 1, 1, 1, 1, 1, 1, 1, 0, - 2, 4, 3, 0, 2, 1, 1, 3, 3, 1, - 5, 1, 3, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 5, 3, 3, 3, 3, + 0, 2, 1, 0, 5, 2, 2, 3, 2, 2, + 2, 2, 0, 2, 5, 2, 3, 2, 2, 2, + 2, 2, 0, 2, 0, 1, 1, 2, 2, 1, + 2, 1, 1, 2, 1, 2, 1, 2, 2, 2, + 2, 4, 3, 3, 5, 2, 3, 4, 0, 1, + 1, 3, 1, 3, 3, 2, 3, 3, 2, 0, + 1, 3, 1, 3, 4, 1, 3, 0, 1, 4, + 1, 1, 1, 1, 1, 4, 4, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, + 1, 4, 1, 1, 1, 4, 4, 1, 1, 1, + 1, 4, 4, 4, 4, 4, 1, 4, 1, 1, + 4, 1, 4, 1, 1, 4, 4, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 1, 1, 1, 4, 4, 1, 1, 1, + 1, 1, 6, 1, 4, 1, 1, 1, 4, 1, + 1, 1, 4, 4, 4, 4, 1, 1, 4, 4, + 4, 1, 1, 4, 4, 4, 1, 1, 1, 1, + 1, 1, 1, 0, 2, 4, 3, 0, 2, 1, + 1, 3, 3, 1, 5, 1, 3, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, - 3, 3, 5, 5, 4, 3, 1, 3, 1, 1, - 0, 2, 4, 3, 2, 2, 0, 2, 2, 1, - 3, 2, 1, 3, 2, 0, 1, 0, 1, 1, - 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, - 1, 1, 1, 0, 1, 1, 2, 1, 2, 2, - 1, 1, 1, 2, 2, 2, 5, 0, 2, 2, - 2, 2, 2, 2, 3, 2, 3, 5, 5, 0, - 2, 2, 2, 2, 6, 8, 2, 2, 2, 2, - 2, 2, 5, 1, 1, 1, 1, 1, 0, 2, - 2, 3, 0, 1, 2, 2, 2, 3, 2, 1, - 1, 3, 2, 4, 3, 2, 1, 3, 2, 0, - 1, 3, 2, 1, 3, 4, 3, 2, 1, 3, - 2, 0, 1, 1, 3, 2, 1, 3, 4, 1, - 3, 0, 2, 2, 1, 3, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, - 1, 2, 1, 2, 1, 2, 4, 4, 5, 10, - 1, 3 + 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, + 2, 2, 2, 2, 3, 3, 5, 5, 4, 3, + 1, 3, 1, 1, 0, 2, 4, 3, 2, 2, + 0, 2, 2, 1, 3, 2, 1, 3, 2, 0, + 1, 0, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 1, 1, 1, 1, 1, 1, 0, 1, 1, + 2, 1, 2, 2, 1, 1, 1, 2, 2, 2, + 5, 2, 0, 2, 2, 2, 2, 2, 2, 3, + 2, 3, 5, 5, 0, 2, 2, 2, 2, 6, + 8, 2, 2, 2, 2, 2, 2, 5, 1, 1, + 1, 1, 1, 0, 2, 2, 3, 0, 1, 2, + 2, 2, 3, 2, 1, 1, 3, 2, 4, 3, + 2, 1, 3, 2, 0, 1, 3, 2, 1, 3, + 4, 3, 2, 1, 3, 2, 0, 1, 1, 3, + 2, 1, 3, 4, 1, 3, 0, 2, 2, 1, + 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 5, 1, 1, 1, 1, 2, 1, 2, 1, + 2, 4, 5, 5, 10, 1, 3, 1 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. @@ -1174,816 +1157,889 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 3, 0, 2, 1, 368, 260, 252, 271, 0, 307, - 0, 0, 259, 247, 261, 303, 258, 262, 263, 0, - 306, 265, 272, 270, 0, 263, 305, 0, 263, 0, - 267, 304, 247, 56, 247, 257, 367, 253, 64, 10, - 0, 24, 11, 27, 11, 9, 0, 370, 0, 369, - 254, 0, 0, 7, 0, 0, 22, 0, 289, 5, - 4, 0, 8, 312, 312, 312, 0, 0, 372, 312, - 0, 374, 273, 274, 0, 280, 281, 371, 249, 0, - 264, 269, 0, 291, 292, 268, 0, 266, 255, 373, - 0, 0, 57, 375, 0, 256, 65, 0, 67, 68, - 69, 70, 71, 0, 0, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 0, 85, 86, 87, 0, - 89, 90, 91, 0, 0, 94, 95, 96, 97, 0, - 0, 0, 0, 0, 103, 0, 105, 106, 0, 108, - 0, 110, 111, 114, 0, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 0, 129, - 130, 131, 0, 0, 134, 135, 136, 137, 365, 138, - 0, 140, 363, 0, 142, 143, 144, 0, 146, 147, - 148, 0, 0, 0, 0, 153, 364, 154, 0, 0, - 157, 158, 0, 0, 0, 0, 59, 162, 25, 0, - 0, 247, 0, 0, 247, 247, 0, 370, 275, 282, - 293, 301, 0, 372, 374, 26, 6, 277, 298, 0, - 23, 296, 297, 0, 0, 20, 316, 313, 315, 314, - 250, 251, 165, 166, 167, 168, 308, 0, 0, 320, - 356, 319, 244, 370, 372, 312, 374, 310, 28, 0, - 173, 39, 0, 230, 0, 0, 236, 0, 0, 0, + 3, 0, 2, 1, 31, 373, 264, 256, 275, 0, + 312, 0, 0, 263, 251, 265, 308, 262, 266, 267, + 0, 311, 269, 276, 274, 0, 267, 0, 310, 0, + 267, 0, 271, 309, 251, 251, 261, 372, 257, 67, + 11, 0, 26, 12, 29, 12, 10, 0, 60, 375, + 0, 374, 258, 0, 0, 8, 0, 0, 0, 24, + 0, 294, 6, 5, 0, 9, 317, 317, 317, 0, + 0, 377, 317, 0, 379, 277, 278, 0, 285, 286, + 376, 253, 0, 268, 273, 0, 296, 297, 272, 281, + 0, 270, 259, 378, 0, 380, 0, 260, 68, 0, + 70, 71, 0, 72, 73, 74, 0, 0, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 0, 88, + 89, 90, 0, 92, 93, 94, 0, 0, 97, 98, + 99, 100, 0, 0, 0, 0, 0, 106, 0, 108, + 109, 0, 111, 0, 113, 114, 117, 0, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 0, 132, 133, 134, 0, 0, 137, 138, 139, + 140, 370, 141, 0, 143, 368, 0, 145, 146, 147, + 0, 149, 150, 151, 0, 0, 0, 0, 156, 369, + 157, 0, 0, 161, 162, 0, 0, 0, 0, 62, + 166, 27, 59, 59, 59, 251, 0, 0, 251, 251, + 0, 375, 279, 287, 298, 306, 0, 377, 379, 28, + 7, 282, 3, 303, 0, 25, 301, 302, 0, 0, + 22, 321, 318, 320, 319, 254, 255, 169, 170, 171, + 172, 313, 0, 0, 325, 361, 324, 248, 375, 377, + 317, 379, 315, 30, 0, 177, 42, 0, 234, 0, + 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 187, 0, + 0, 0, 0, 0, 187, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 67, 61, 43, 0, 19, 20, + 21, 0, 17, 0, 15, 13, 18, 24, 0, 60, + 376, 45, 304, 305, 378, 380, 46, 247, 59, 59, + 0, 59, 0, 0, 295, 22, 59, 0, 0, 323, + 0, 0, 48, 327, 316, 41, 0, 179, 180, 183, + 381, 59, 59, 59, 0, 168, 167, 0, 0, 198, + 189, 190, 191, 195, 196, 197, 192, 193, 0, 194, + 0, 0, 0, 0, 0, 0, 0, 232, 0, 230, + 233, 0, 0, 65, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 346, 0, 0, 185, 188, + 0, 0, 0, 0, 0, 0, 0, 0, 363, 364, + 365, 366, 367, 0, 0, 0, 0, 385, 387, 0, + 0, 0, 63, 67, 0, 16, 12, 47, 0, 24, + 0, 283, 4, 288, 0, 0, 0, 0, 0, 0, + 59, 24, 23, 60, 314, 322, 326, 362, 0, 58, + 0, 0, 52, 49, 50, 184, 178, 0, 371, 0, + 235, 0, 383, 60, 241, 0, 69, 160, 75, 0, + 222, 221, 220, 223, 218, 219, 0, 334, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 183, 0, 0, 0, 0, 0, 183, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, - 58, 40, 0, 17, 18, 19, 0, 15, 13, 12, - 16, 22, 371, 42, 299, 300, 373, 375, 43, 243, - 56, 0, 56, 0, 0, 290, 20, 0, 0, 0, - 318, 0, 0, 45, 322, 311, 38, 0, 175, 176, - 179, 376, 56, 349, 377, 56, 56, 0, 0, 194, - 185, 186, 187, 191, 192, 193, 188, 189, 0, 190, - 0, 0, 0, 0, 0, 0, 0, 228, 0, 226, - 229, 0, 0, 62, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 341, 0, 0, 181, 184, - 0, 0, 0, 0, 0, 0, 0, 0, 358, 359, - 360, 361, 362, 0, 0, 0, 164, 163, 0, 380, - 0, 0, 0, 60, 64, 0, 14, 44, 22, 0, - 278, 283, 0, 0, 0, 0, 0, 0, 0, 22, - 21, 0, 309, 317, 321, 357, 0, 55, 0, 0, - 49, 46, 47, 180, 174, 0, 366, 0, 231, 0, - 0, 378, 57, 237, 0, 66, 72, 0, 218, 217, - 216, 219, 214, 215, 0, 329, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 73, - 84, 88, 0, 92, 93, 98, 99, 100, 101, 102, - 104, 107, 109, 341, 308, 45, 346, 341, 343, 342, - 52, 338, 113, 183, 112, 128, 132, 133, 0, 141, - 145, 149, 150, 152, 151, 155, 156, 0, 159, 160, - 161, 61, 0, 276, 279, 285, 0, 372, 284, 287, - 0, 0, 242, 288, 20, 22, 302, 54, 53, 323, - 0, 177, 178, 0, 374, 350, 245, 235, 234, 329, - 225, 308, 45, 333, 329, 330, 0, 326, 207, 208, - 220, 201, 202, 205, 206, 196, 197, 0, 198, 199, - 200, 204, 203, 210, 209, 212, 213, 211, 221, 0, - 227, 63, 51, 341, 308, 0, 341, 0, 337, 45, - 345, 182, 0, 381, 22, 240, 286, 0, 294, 50, - 48, 351, 354, 0, 233, 0, 246, 0, 329, 308, - 0, 341, 0, 325, 0, 45, 332, 0, 224, 336, - 341, 347, 340, 344, 0, 139, 41, 22, 0, 353, - 0, 232, 169, 223, 324, 341, 334, 328, 331, 222, - 0, 195, 339, 348, 295, 352, 355, 0, 327, 335, - 0, 0, 379, 170, 0, 56, 56, 239, 172, 0, - 171, 238 + 0, 76, 87, 91, 0, 95, 96, 101, 102, 103, + 104, 105, 107, 110, 112, 346, 313, 48, 351, 346, + 348, 347, 55, 343, 116, 187, 115, 131, 135, 136, + 0, 144, 148, 152, 153, 155, 154, 158, 159, 0, + 163, 164, 165, 64, 0, 59, 354, 382, 280, 284, + 290, 0, 377, 289, 292, 0, 0, 246, 293, 22, + 24, 307, 57, 56, 328, 0, 181, 182, 0, 379, + 249, 239, 238, 334, 229, 313, 48, 338, 334, 335, + 0, 331, 211, 212, 224, 205, 206, 209, 210, 200, + 201, 0, 202, 203, 204, 208, 207, 214, 213, 216, + 217, 215, 225, 0, 231, 66, 54, 346, 313, 0, + 346, 0, 342, 48, 350, 186, 0, 386, 24, 14, + 0, 244, 291, 59, 299, 53, 51, 356, 359, 0, + 237, 0, 250, 0, 334, 313, 0, 346, 0, 330, + 0, 48, 337, 0, 228, 341, 346, 352, 345, 349, + 0, 142, 44, 355, 24, 0, 358, 0, 236, 173, + 227, 329, 346, 339, 333, 336, 226, 0, 199, 344, + 353, 300, 357, 360, 0, 332, 340, 0, 0, 384, + 174, 0, 59, 59, 243, 176, 0, 175, 242 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 2, 199, 317, 221, 420, 40, 41, 42, - 43, 294, 206, 44, 295, 429, 430, 431, 432, 496, - 413, 92, 195, 364, 196, 398, 497, 647, 653, 327, - 328, 329, 243, 377, 378, 357, 358, 359, 361, 332, - 438, 443, 336, 658, 659, 531, 48, 605, 79, 498, - 49, 81, 50, 296, 52, 297, 310, 410, 54, 55, - 312, 415, 56, 224, 57, 58, 298, 299, 211, 61, - 300, 63, 64, 65, 318, 66, 226, 67, 240, 241, - 555, 612, 556, 557, 499, 587, 500, 501, 334, 629, - 602, 603, 242, 393, 197, 244, 69, 70, 246, 400 + -1, 1, 2, 202, 326, 226, 298, 41, 42, 43, + 44, 299, 210, 45, 300, 441, 442, 443, 444, 508, + 47, 309, 198, 374, 199, 347, 509, 664, 670, 336, + 337, 338, 248, 387, 388, 367, 368, 369, 371, 341, + 450, 454, 343, 675, 676, 546, 50, 621, 82, 510, + 51, 84, 52, 301, 54, 302, 303, 318, 421, 57, + 58, 321, 427, 59, 229, 60, 61, 304, 305, 215, + 64, 306, 66, 67, 68, 327, 69, 231, 70, 245, + 246, 569, 628, 570, 571, 511, 601, 512, 513, 537, + 646, 618, 619, 247, 403, 200, 249, 72, 73, 251, + 409 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -519 +#define YYPACT_NINF -526 static const yytype_int16 yypact[] = { - -519, 56, 1328, -519, -519, -519, -519, -519, 160, -519, - -140, 164, -519, 168, -519, -519, -519, -519, 7, 105, - -519, -519, -519, -519, 174, 7, -519, -58, 7, 426, - -519, -519, 178, -78, 180, 426, -519, -519, 2560, -519, - -15, -519, -519, -519, -519, -519, 2244, -11, -7, -519, - -519, 13, -36, -519, 15, -20, 20, 22, 12, -519, - -519, -6, -519, -16, -16, -16, 493, 2410, 31, -16, - 33, 41, -519, -519, 171, -519, -519, -72, -519, 4, - -519, -519, 45, -519, -519, -519, 2410, -519, -519, -71, - 44, 2316, -519, -111, -121, -519, -519, 49, -519, -519, - -519, -519, -519, 55, 67, -519, -519, -519, -519, -519, - -519, -519, -519, -519, -519, 70, -519, -519, -519, 72, - -519, -519, -519, 74, 76, -519, -519, -519, -519, 78, - 81, 84, 94, 97, -519, 103, -519, -519, 110, -519, - 113, -519, -519, 128, 130, -519, -519, -519, -519, -519, - -519, -519, -519, -519, -519, -519, -519, -519, 132, -519, - -519, -519, 138, 141, -519, -519, -519, -519, -519, -519, - 159, -519, -519, 161, -519, -519, -519, 162, -519, -519, - -519, 163, 166, 169, 170, -519, -519, -519, 176, 177, - -519, -519, 179, 191, 195, -74, -519, -519, -519, 1201, - 514, 264, 364, 288, 305, 322, 194, 172, -519, -519, - -519, -519, 493, 199, 202, -519, -519, -519, -519, -29, - -519, -519, -519, 334, 200, -519, -519, -519, -519, -519, - -519, -519, -519, -519, -519, -519, -519, 493, 493, -519, - 201, -133, -519, -519, -519, -16, -519, -519, -519, 206, - 336, -519, 207, -519, 493, 203, -519, 404, 336, 436, - 436, 409, 410, 436, 436, 412, 419, 436, 421, 436, - 436, 1747, 436, 436, 423, -73, 424, 436, 2410, 436, - 436, 2410, -37, 2410, 2410, 136, 429, 427, 2410, 2560, - 236, -519, 235, -519, -519, -519, 246, -519, -519, -519, - -519, 20, 248, -519, -519, -519, 248, -109, -519, -519, - -135, 270, -81, 252, 250, -519, -519, 615, 387, 255, - -519, 436, 73, 1747, -519, -519, -519, 266, 277, -519, - 259, -519, -134, -519, 297, -78, -132, 273, 274, -519, - -519, -519, -519, -519, -519, -519, -519, -519, 278, -519, - 436, 436, 436, 436, 436, 436, 1058, 2055, -143, -519, - 2055, 282, 285, -519, -129, 287, 290, 294, 295, 298, - 300, 302, 1745, 307, 2316, 260, 308, -106, -519, 2055, - 309, 311, 312, 330, 313, -89, 1817, 315, -519, -519, - -519, -519, -519, 316, 320, 321, -519, -519, 323, 289, - 324, 325, 328, -519, 2560, 525, -519, -519, 20, -3, - -519, -519, 345, 2316, 299, 944, 329, 445, 729, 20, - -519, 2316, -519, -519, -519, -519, 101, -519, 1937, 333, - 360, -519, -519, -519, 336, 436, -519, 2316, -519, 493, - 337, -519, 338, -519, 340, -519, -519, 2316, 14, 14, - 14, 14, 14, 14, 1842, 258, 436, 436, 540, 436, - 436, 436, 436, 436, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 545, 436, 436, -519, - -519, -519, 541, -519, -519, -519, -519, -519, -519, -519, - -519, -519, -519, 260, -519, 1455, -519, 260, -519, -519, - -519, -48, -519, 436, -519, -519, -519, -519, 436, -519, - -519, -519, -519, -519, -519, -519, -519, 547, -519, -519, - -519, -519, 351, -519, -519, -519, 493, -101, -519, -519, - 2316, 356, -519, -519, -519, 20, -519, -519, -519, -519, - 1653, -519, -519, 260, 357, -519, 336, -519, -519, 258, - -519, -519, 1581, -519, 258, -519, 361, -46, 280, 280, - -519, 751, 751, 197, 197, 2074, 981, 2034, 1996, 1977, - 1037, 197, 197, 284, 284, 14, 14, 14, -519, 1959, - -519, -519, -519, 83, -519, 362, 260, 363, -519, 1747, - -519, -519, 365, -519, 20, -519, -519, 830, -519, -519, - -519, 379, -519, -86, -519, 359, -519, 370, 518, -519, - 371, 260, 373, -519, 436, 1747, -519, 436, -519, -519, - 83, -519, -519, -519, 374, -519, -519, 20, 436, -519, - 260, -519, -519, -519, -519, 83, -519, -519, -519, 14, - 380, 2055, -519, -519, -519, -519, -519, -17, -519, -519, - 436, 402, -519, -519, 411, -40, -40, -519, -519, 383, - -519, -519 + -526, 59, 1737, -526, -526, -526, -526, -526, -526, 163, + -526, -138, 169, -526, 194, -526, -526, -526, -526, 12, + 73, -526, -526, -526, -526, 219, 12, 120, -526, -64, + 12, 300, -526, -526, 266, 270, 300, -526, -526, 2902, + -526, -48, -526, -526, -526, -526, -526, 46, 2579, -44, + -23, -526, -526, 39, 19, -526, 48, 47, 54, 62, + 76, -33, -526, -526, 82, -526, 96, 96, 96, 57, + 2751, 86, 96, 87, 90, -526, -526, 223, -526, -526, + 72, -526, 95, -526, -526, 103, -526, -526, -526, -526, + 2751, -526, -526, 99, 112, -112, -109, -526, -526, 21, + -526, -526, 56, -526, -526, -526, 93, 156, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, 157, -526, + -526, -526, 162, -526, -526, -526, 164, 168, -526, -526, + -526, -526, 170, 171, 173, 174, 175, -526, 177, -526, + -526, 178, -526, 179, -526, -526, 184, 186, -526, -526, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, 187, -526, -526, -526, 193, 196, -526, -526, -526, + -526, -526, -526, 197, -526, -526, 200, -526, -526, -526, + 201, -526, -526, -526, 202, 203, 215, 216, -526, -526, + -526, 220, 225, -526, -526, 228, 231, 234, -56, -526, + -526, -526, 1620, 877, 136, 301, 373, 329, 347, 356, + 226, 195, -526, -526, -526, -526, 57, 237, 239, -526, + -526, -526, -526, -526, -22, -526, -526, -526, 357, 242, + -526, -526, -526, -526, -526, -526, -526, -526, -526, -526, + -526, -526, 57, 57, -526, 238, -141, -526, -526, -526, + 96, -526, -526, -526, 241, 365, -526, 243, -526, 247, + -526, 453, 161, 365, 713, 713, 454, 455, 713, 713, + 456, 457, 713, 458, 713, 713, 2168, 713, 713, 459, + -54, 461, 713, 2751, 713, 713, 2751, 135, 2751, 2751, + 161, 130, 462, 2751, 2902, 271, -526, 265, -526, -526, + -526, 273, -526, 276, -526, -526, -526, 62, 2665, -526, + 277, -526, -526, -526, 277, -105, -526, -526, -18, 1111, + 294, -76, 280, 278, -526, -526, 1213, 42, 279, -526, + 713, 94, 2168, -526, -526, -526, 284, 309, -526, 282, + -526, -13, 136, -11, 288, -526, -526, 289, 291, -526, + -526, -526, -526, -526, -526, -526, -526, -526, 285, -526, + 713, 713, 713, 713, 713, 713, 703, 2390, -91, -526, + 2390, 292, 296, -526, -70, 298, 302, 303, 304, 305, + 306, 307, 398, 308, 2665, 88, 310, -66, -526, 2390, + 311, 313, 314, 321, 315, -63, 2174, 316, -526, -526, + -526, -526, -526, 317, 318, 319, 322, 328, -526, 323, + 324, 326, -526, 2902, 499, -526, -526, -526, 57, 62, + -21, -526, -526, -526, 352, 2665, 331, 1503, 334, 419, + 1315, 62, -526, 2665, -526, -526, -526, -526, 450, -526, + 1425, 336, 366, -526, -526, -526, 365, 713, -526, 2665, + -526, 338, -526, 342, -526, 343, -526, -526, -526, 2665, + 18, 18, 18, 18, 18, 18, 2260, 248, 713, 713, + 547, 713, 713, 713, 713, 713, 713, 713, 713, 713, + 713, 713, 713, 713, 713, 713, 713, 713, 548, 713, + 713, -526, -526, -526, 543, -526, -526, -526, -526, -526, + -526, -526, -526, -526, -526, 88, -526, 1823, -526, 88, + -526, -526, -526, -137, -526, 713, -526, -526, -526, -526, + 713, -526, -526, -526, -526, -526, -526, -526, -526, 549, + -526, -526, -526, -526, 346, 994, -526, 375, -526, -526, + -526, 57, 166, -526, -526, 2665, 351, -526, -526, -526, + 62, -526, -526, -526, -526, 2082, -526, -526, 88, 354, + 365, -526, -526, 248, -526, -526, 1950, -526, 248, -526, + 350, -135, 25, 25, -526, 603, 603, 165, 165, 817, + 2285, 2369, 2408, 2440, 740, 165, 165, 64, 64, 18, + 18, 18, -526, 2329, -526, -526, -526, 70, -526, 353, + 88, 355, -526, 2168, -526, -526, 358, -526, 62, -526, + 57, -526, -526, 1417, -526, -526, -526, 379, -526, -94, + -526, 364, -526, 361, 100, -526, 369, 88, 370, -526, + 713, 2168, -526, 713, -526, -526, 70, -526, -526, -526, + 371, -526, -526, -526, 62, 713, -526, 88, -526, -526, + -526, -526, 70, -526, -526, -526, 18, 384, 2390, -526, + -526, -526, -526, -526, -3, -526, -526, 713, 411, -526, + -526, 412, -86, -86, -526, -526, 390, -526, -526 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -519, -519, -519, 549, -300, -291, 28, -519, -519, -519, - 182, -519, -519, -519, 589, -464, -519, -519, -258, -230, - -9, -2, -519, -519, -268, -519, -62, -519, -519, -519, - -519, 167, 5, 318, 102, -114, -519, -255, -257, -519, - -519, -519, -519, -50, -212, -519, 193, -519, 25, -64, - -519, 133, 100, 46, -519, 612, -519, -519, 569, -519, - -519, -519, -519, -519, -23, -519, 619, 6, -519, -519, - 620, -519, -519, -303, -466, -45, -24, -26, -219, -519, - -519, -519, -494, -519, -518, -519, -183, -519, -519, -519, - -13, -519, 414, -519, 352, 1, -33, -519, 3, -519 + -526, -526, 359, -28, -305, -300, -1, -526, -526, -526, + 176, -526, -526, -526, 23, -468, -526, -526, -257, -232, + -189, -2, -526, -526, -267, 312, -65, -526, -526, -526, + -526, 152, 7, 320, 92, 210, -526, -261, -256, -526, + -526, -526, -526, -60, -187, -526, 181, -526, 22, -67, + -526, 131, 40, 16, -526, 24, 26, -526, -526, 555, + -526, -526, -526, -526, -526, -12, -526, 28, 4, -526, + -526, 29, -526, -526, -287, -477, -38, 17, -14, -220, + -526, -526, -526, -500, -526, -525, -526, -467, -526, -526, + -526, -32, -526, 393, -526, 341, 1, -46, -526, 3, + -526 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -249 +#define YYTABLE_NINF -253 static const yytype_int16 yytable[] = { - 46, 212, 239, 68, 238, 71, 365, 47, 60, 366, - 407, 324, 369, 373, 371, 422, 418, 376, 319, 320, - 650, 403, 383, 210, 91, 601, 412, 9, 583, 458, - 39, 585, 255, 651, 245, 333, 478, 227, 227, 227, - 228, 229, -248, 227, -248, 247, 254, 213, 51, 214, - 482, 207, 15, 252, 11, 607, 3, 90, 168, 94, - 613, 479, 172, 74, 425, 38, 38, 322, 38, 24, - 323, 408, 436, 503, 441, 483, 339, 20, 340, 341, - 342, 343, 344, 345, 256, 608, 230, 231, 610, 186, - 503, -34, 208, 630, -248, 24, -248, 311, 504, 423, - 414, -241, 80, -241, 339, 289, 340, 341, 342, 343, - 344, 345, 601, 82, 634, 510, 631, 523, 620, 38, - 26, 232, 38, 440, 444, 624, 9, 290, 536, 88, - -30, -32, 31, -248, -248, 95, 521, 388, 389, 390, - 391, 392, 346, 635, 396, 86, 360, 397, 239, 360, - 238, 640, 322, 233, 322, 589, 372, 615, 85, 379, - 38, 87, 657, 72, 73, 379, 386, 75, 76, 217, - 346, 77, 78, 239, 239, 238, 238, 83, 84, 249, - 542, 89, 78, 93, 78, 219, 330, 198, 347, 652, - 239, -29, 238, 223, 338, 215, 313, 46, 46, 225, - 68, 68, 71, 71, 47, 47, 234, 360, 428, 250, - 456, 457, 458, 476, 477, 216, 347, 218, 348, 227, - 545, 325, 220, 580, 222, 553, 375, 293, 293, 90, - 94, 349, 235, -31, 597, 248, 448, 449, 450, 451, - 452, 453, 454, -33, 598, 384, 348, 251, 387, 253, - 394, 395, 257, 592, 239, 402, 238, 350, 258, 349, - 351, 352, 426, 230, 231, 354, 355, 302, 78, 374, - 259, 590, 494, 260, 427, 261, 356, 262, 375, 263, - 422, 264, 600, 322, 265, 350, 495, 266, 351, 352, - 353, 304, 305, 354, 355, 458, 232, 267, 232, 458, - 268, 409, 537, 626, 356, 422, 269, 595, 306, 78, - 582, 455, 451, 270, 588, 421, 271, 422, 68, 553, - 71, 374, 47, 437, 553, 307, 78, 616, 233, 493, - 233, 272, 422, 273, 442, 274, 644, 314, 315, 230, - 231, 275, 558, 559, 276, 561, 562, 563, 564, 565, - 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, - 576, 577, 277, 579, 278, 279, 280, 303, 526, 281, - 330, 645, 282, 283, -35, 239, 212, 238, 553, 284, - 285, 234, 286, 234, 471, 472, 473, 474, 475, 379, - 230, 231, 543, 554, 287, 654, 476, 477, 288, 308, - 619, -36, 549, 622, -37, 316, 335, 235, 321, 235, - 326, 331, 337, 530, 527, 524, 421, 362, 363, 68, - 367, 71, 213, 47, 214, 232, 207, 368, 637, 370, - 9, 380, 382, 586, 399, 401, 404, 642, 405, 339, - 544, 340, 341, 342, 343, 344, 345, 551, 406, 494, - 375, 411, 648, -248, 416, 417, 434, 233, 322, 424, - 322, 552, 239, 495, 238, 7, 435, 471, 472, 473, - 474, 475, 433, 473, 474, 475, 439, 445, 446, 476, - 477, 447, 606, 476, 477, 212, 480, 554, 517, 481, - 611, 484, 554, 374, 485, 375, 230, 231, 486, 487, - 639, 528, 488, 641, 489, 346, 490, 375, 18, 508, - 234, 492, 502, 505, 360, 506, 507, 509, 4, 512, - 513, 21, 22, 23, 514, 515, 525, 516, 518, 519, - 25, 232, 520, 522, 19, 533, 235, 539, 374, 540, - 547, 546, 548, 560, 375, 5, 554, 6, 578, 581, - 374, 347, 593, 7, 8, 594, 232, 9, 596, 604, - 628, 9, 10, 233, 632, 614, 621, 623, 28, 625, - 375, 11, 30, 12, 633, 636, 236, 638, 643, 13, - 14, 348, 15, 655, 649, 661, 16, 374, 233, 17, - 237, 45, 656, 200, 349, 421, 18, 385, 68, 534, - 71, 541, 47, 19, 292, 591, 660, 20, 532, 21, - 22, 23, 24, 374, 53, 209, 234, 646, 25, 4, - 350, 59, 62, 351, 352, 353, 309, 381, 354, 355, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 356, - 0, 234, 235, 0, 0, 0, 5, 0, 6, 0, - 26, 0, 0, 0, 7, 27, 28, 29, 9, 0, - 30, 0, 31, 10, 0, 0, 32, 235, 0, 0, - 0, 0, 0, 33, 12, 34, 0, 35, 0, 0, - 13, 14, 236, 15, 0, 36, 37, 16, 0, 0, - 17, 0, 0, 0, 0, 0, 237, 18, 0, 0, - 0, 0, 0, 0, 19, 0, 0, 551, 20, 0, - 21, 22, 23, 0, 38, 0, 0, 0, 322, 25, - 301, 552, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, + 48, 40, 244, 71, 243, 74, 63, 417, 376, 49, + 216, 379, 375, 381, 333, 308, 386, 203, 53, 383, + 430, 393, 328, 329, 250, 46, 55, 412, 56, 597, + 62, 65, 424, 617, 470, 667, 214, 12, 596, 599, + 434, 470, 602, -252, 257, 235, 259, 236, 668, 217, + -252, 218, 232, 232, 232, 211, 94, 96, 232, 3, + 235, 331, 236, 623, 212, 331, 332, 331, 629, 77, + 603, 92, 631, 235, 437, 236, 97, 25, 25, 171, + 470, 237, 85, 175, 233, 234, 10, 647, 624, 252, + 490, 235, -252, 236, -37, 260, 237, 349, 626, -252, + 350, 351, 352, 353, 354, 355, 320, 435, 83, 237, + 189, 494, 648, 238, 10, 515, 39, 491, 515, 538, + 674, 636, 617, 89, 651, 294, 39, 237, 238, 420, + 635, 551, 425, 638, 426, 640, 407, 408, 495, 237, + 10, 238, 516, 90, 10, 522, 533, 295, 652, 244, + 228, 243, 449, 425, 425, 451, 455, 88, 201, 238, + 654, 91, -32, 657, 356, 16, 75, 239, 76, 659, + 345, 238, 78, 346, 79, 244, 244, 243, 243, 468, + 469, 470, 239, 219, 39, 665, 557, 419, 339, 39, + 21, 39, 448, 240, 452, 239, 348, 80, 536, 81, + 48, 48, 669, 71, 71, 74, 74, 204, 240, 49, + 49, 357, 322, 239, 483, 484, 485, 486, 487, 488, + 489, 240, 86, 221, 87, 239, 488, 489, 261, 594, + 94, 96, 254, 241, 28, 567, 232, 394, 385, 240, + 397, 358, 404, 405, 613, 220, 33, 411, 241, 242, + 614, 240, 222, 223, 359, 485, 486, 487, 224, 606, + 244, 506, 243, 262, 242, 488, 489, 334, 225, 93, + 418, 81, 331, 95, 384, 81, -252, 507, -33, 506, + 360, 604, 227, 361, 362, 438, 230, 237, 364, 365, + 331, 565, -34, 253, 385, 507, -36, 439, 616, 255, + 263, 366, 331, -252, 310, -35, 81, 566, 642, 256, + 434, 398, 399, 400, 401, 402, 258, 48, 40, 238, + 71, 611, 74, 63, 433, 432, 49, 71, 467, 74, + 384, 567, 312, 49, 313, 53, 567, 434, 39, 632, + 8, 453, 46, 55, 661, 56, 505, 62, 65, 434, + 314, 244, 81, 243, 483, 484, 485, 486, 487, 315, + 323, 81, 324, 264, 265, 434, 488, 489, 235, 266, + 236, 267, -245, 239, -245, 268, 311, 269, 270, 339, + 271, 272, 273, 19, 274, 275, 276, 541, 535, 662, + 643, 277, 567, 278, 279, 216, 22, 23, 24, 240, + 280, -38, 568, 281, 282, 26, 671, 283, 284, 285, + 286, 558, 468, 469, 470, 471, 472, 473, 474, 475, + 476, 563, 287, 288, 539, 545, 542, 289, 433, 432, + 316, 71, 290, 74, 217, 291, 218, 49, 292, 565, + 211, 293, 600, -39, 30, -40, 325, 330, 32, 335, + 331, 340, 559, 349, 342, 566, 350, 351, 352, 353, + 354, 355, 344, 372, 373, 377, 378, 380, 390, 385, + 392, 410, 414, 413, 244, 370, 243, 423, 370, 415, + 416, -252, 429, 425, 425, 382, 428, 436, 389, 445, + 446, 447, 459, 622, 389, 396, 456, 457, 568, 458, + 492, 627, 520, 568, 493, 384, 496, 216, 534, 20, + 497, 498, 499, 500, 501, 502, 504, 385, 514, 517, + 356, 518, 519, 521, 524, 525, 526, 527, 385, 529, + 528, 530, 531, 48, 532, 540, 71, 543, 74, 548, + 370, 440, 49, 244, 554, 243, 560, 555, 561, 562, + 574, 592, 595, 384, 608, 607, 610, 612, 630, 568, + 620, 637, 645, 639, 384, 385, 641, 357, 649, 650, + 460, 461, 462, 463, 464, 465, 466, 653, 655, 660, + 477, 319, 478, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 666, 385, 672, 673, 678, 358, 556, 488, + 489, 384, 406, 213, 395, 549, 503, 605, 547, 317, + 359, 433, 432, 677, 71, 663, 74, 468, 469, 470, + 49, 391, 473, 474, 0, 0, 0, 0, 0, 384, + 0, 0, 0, 0, 0, 0, 360, 0, 0, 361, + 362, 363, 0, 0, 364, 365, 0, 0, 463, 0, + 0, 0, 0, 552, 0, 0, 0, 366, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 26, 0, 0, 0, 0, 27, 28, 29, 0, - 5, 30, 6, 31, 456, 457, 458, 32, 7, 461, - 462, 0, 9, 0, 33, 0, 34, 10, 35, 0, - 0, 0, 0, 0, 0, 0, 36, 37, 12, 0, - 0, 0, 0, 0, 13, 14, 0, 15, 0, 0, - 0, 16, 0, 0, 17, 0, 0, 0, 0, 0, - 0, 18, 0, 0, 0, 38, 0, 0, 19, 0, - 0, 419, 20, 0, 21, 22, 23, 0, 0, 0, - 0, 0, 0, 25, 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 572, 573, + 0, 575, 576, 577, 578, 579, 580, 581, 582, 583, + 584, 585, 586, 587, 588, 589, 590, 591, 0, 593, + 0, 0, 0, 0, 0, 0, 349, 0, 5, 350, + 351, 352, 353, 354, 355, 0, 349, 0, 0, 350, + 351, 352, 353, 354, 355, 389, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 7, 0, 0, + 0, 0, 0, 8, 0, 0, 0, 10, 0, 0, + 0, 0, 0, 0, 468, 469, 470, 471, 472, 473, + 474, 0, 0, 13, 0, 0, 0, 0, 0, 205, + 15, 0, 16, 356, 0, 0, 17, 0, 0, 18, + 0, 0, 0, 356, 0, 0, 19, 0, 0, 0, + 481, 482, 483, 484, 485, 486, 487, 21, 0, 22, + 23, 24, 0, 0, 488, 489, 0, 0, 26, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 357, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 357, 468, 469, 470, 471, 472, 473, 474, 0, 476, + 656, 28, 0, 658, 0, 0, 29, 30, 31, 0, + 358, 32, 0, 33, 0, 370, 0, 208, 0, 0, + 358, 0, 0, 359, 0, 0, 209, 0, 36, 0, + 0, 0, 0, 359, 0, 0, 37, 38, 0, 0, + 0, 4, 5, 0, 0, 0, 0, 0, 0, 360, + 0, 0, 361, 362, 363, 0, 0, 364, 365, 360, + 0, 0, 361, 362, 363, 0, 0, 364, 365, 6, + 366, 7, 0, 0, 0, 0, 0, 8, 9, 0, + 366, 10, 0, 0, 0, 0, 11, 481, 482, 483, + 484, 485, 486, 487, 0, 12, 0, 13, 0, 0, + 0, 488, 489, 14, 15, 0, 16, 0, 0, 0, + 17, 0, 0, 18, 0, 0, 0, 0, 0, 0, + 19, 0, 0, 0, 0, 0, 0, 20, 297, 0, + 0, 21, 0, 22, 23, 24, 25, 0, 0, 0, + 0, 0, 26, 0, 0, 0, 0, 27, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, + 0, 478, 479, 480, 481, 482, 483, 484, 485, 486, + 487, 0, 0, 0, 0, 28, 0, 0, 488, 489, + 29, 30, 31, 0, 0, 32, 6, 33, 7, 0, + 0, 34, 0, 0, 8, 9, 0, 0, 10, 0, + 35, 0, 36, 11, 0, 0, 0, 0, 0, 0, + 37, 38, 12, 0, 13, 0, 0, 0, 0, 0, + 14, 15, 0, 16, 0, 0, 0, 17, 0, 0, + 18, 0, 0, 0, 0, 0, 0, 19, 0, 39, + 0, 0, 307, 0, 20, 297, 0, 0, 21, 0, + 22, 23, 24, 25, 0, 0, 0, 0, 0, 26, + 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 28, 0, 0, 0, 0, 29, 30, 31, + 0, 0, 32, 6, 33, 7, 0, 0, 34, 0, + 0, 8, 9, 0, 0, 10, 0, 35, 0, 36, + 11, 0, 0, 0, 0, 0, 0, 37, 38, 12, + 0, 13, 0, 0, 0, 0, 0, 14, 15, 0, + 16, 0, 0, 0, 17, 0, 0, 18, 0, 0, + 0, 0, 0, 0, 19, 0, 39, 0, 0, 609, + 0, 20, 0, 0, 0, 21, 0, 22, 23, 24, + 25, 0, 0, 0, 0, 0, 26, 4, 5, 0, + 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 7, 0, 28, + 0, 0, 0, 8, 29, 30, 31, 10, 0, 32, + 0, 33, 11, 0, 0, 34, 0, 0, 0, 0, + 0, 0, 0, 13, 35, 0, 36, 0, 0, 14, + 15, 0, 16, 0, 37, 38, 17, 0, 0, 18, + 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, + 0, 0, 0, 20, 0, 0, 0, 21, 0, 22, + 23, 24, 0, 39, 0, 0, 422, 0, 26, 4, + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 6, 0, 7, + 0, 28, 0, 0, 0, 8, 29, 30, 31, 10, + 0, 32, 0, 33, 11, 0, 0, 34, 0, 0, + 0, 0, 0, 0, 0, 13, 35, 0, 36, 0, + 0, 14, 15, 0, 16, 0, 37, 38, 17, 0, + 0, 18, 0, 0, 0, 0, 0, 0, 19, 0, + 0, 0, 0, 0, 0, 20, 0, 0, 0, 21, + 0, 22, 23, 24, 0, 39, 0, 0, 431, 0, + 26, 4, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 468, + 469, 470, 471, 472, 473, 474, 475, 476, 0, 6, + 0, 7, 0, 28, 0, 0, 0, 8, 29, 30, + 31, 10, 0, 32, 0, 33, 11, 0, 0, 34, + 0, 0, 0, 0, 0, 0, 0, 13, 35, 0, + 36, 0, 0, 14, 15, 0, 16, 0, 37, 38, + 17, 0, 0, 18, 0, 0, 0, 0, 0, 0, + 19, 0, 0, 0, 0, 0, 0, 20, 5, 0, + 0, 21, 0, 22, 23, 24, 0, 39, 0, 0, + 550, 0, 26, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 7, 0, 0, + 0, 0, 0, 8, 0, 0, 0, 10, 0, 0, + 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, + 29, 30, 31, 13, 0, 32, 0, 33, 0, 205, + 15, 34, 16, 0, 0, 0, 17, 0, 0, 18, + 35, 0, 36, 0, 0, 0, 19, 0, 0, 0, + 37, 38, 0, 0, 0, 0, 0, 21, 0, 22, + 23, 24, 0, 0, 0, 0, 0, 477, 26, 478, + 479, 480, 481, 482, 483, 484, 485, 486, 487, 39, + 0, 0, 644, 0, 4, 5, 488, 489, 553, 0, + 0, 0, 0, 296, 0, 0, 0, 0, 0, 0, + 0, 28, 0, 0, 0, 0, 29, 30, 31, 0, + 0, 32, 6, 33, 7, 0, 0, 208, 0, 0, + 8, 9, 0, 0, 10, 0, 209, 0, 36, 11, + 0, 0, 0, 0, 0, 0, 37, 38, 12, 0, + 13, 0, 0, 0, 0, 0, 14, 15, 0, 16, + 0, 0, 0, 17, 0, 0, 18, 0, 0, 0, + 0, 0, 0, 19, 0, 39, 0, 0, 544, 0, + 20, 297, 0, 0, 21, 0, 22, 23, 24, 25, + 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, + 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 4, 5, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, + 0, 0, 0, 29, 30, 31, 0, 0, 32, 6, + 33, 7, 0, 0, 34, 0, 0, 8, 9, 0, + 0, 10, 0, 35, 0, 36, 11, 0, 0, 0, + 0, 0, 0, 37, 38, 12, 0, 13, 0, 0, + 0, 0, 0, 14, 15, 0, 16, 0, 0, 0, + 17, 0, 0, 18, 0, 0, 0, 0, 0, 0, + 19, 0, 39, 0, 0, 0, 0, 20, 5, 0, + 0, 21, 0, 22, 23, 24, 25, 0, 0, 0, + 0, 0, 26, 0, 0, 0, 0, 27, 0, 0, + 0, 0, 0, 0, 0, 6, 0, 7, 0, 0, + 0, 0, 237, 8, 0, 0, 0, 10, 0, 0, + 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, + 29, 30, 31, 13, 0, 32, 0, 33, 0, 205, + 15, 34, 16, 0, 238, 0, 17, 0, -59, 18, + 35, 0, 36, 0, 0, 0, 19, 0, 0, 0, + 37, 38, 0, 0, 0, 0, 0, 21, 0, 22, + 23, 24, 0, 0, 0, 0, 0, 0, 26, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, + 0, 0, 0, 0, 0, 0, 0, 0, 239, 0, + 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, + 0, 28, 0, 0, 0, 0, 29, 30, 31, 0, + 0, 32, 0, 33, 240, 0, 0, 208, 0, 0, + 0, 0, 6, 0, 7, 0, 209, 0, 36, 237, + 8, 0, 0, 0, 10, 0, 37, 38, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 598, 0, 205, 15, 0, 16, + 0, 238, 0, 17, 0, 39, 18, 0, 0, 0, + 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 21, 0, 22, 23, 24, 0, + 0, 0, 0, 0, 0, 26, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 239, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 5, 28, 0, + 0, 0, 0, 29, 30, 31, 0, 0, 32, 0, + 33, 240, 0, 0, 208, 615, 0, 0, 0, 0, + 0, 0, 0, 209, 6, 36, 7, 0, 0, 0, + 0, 0, 8, 37, 38, 0, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 625, 13, 0, 0, 0, 0, 0, 205, 15, + 0, 16, 39, 0, 0, 17, 0, 0, 18, 0, + 0, 0, 0, 0, 0, 19, 0, 0, 0, 0, + 0, 0, 0, 5, 0, 0, 21, 0, 22, 23, + 24, 0, 0, 0, 0, 0, 0, 26, 468, 469, + 470, 471, 472, 473, 474, 475, 476, 0, 0, 0, + 6, 0, 7, 0, 0, 0, 0, 0, 8, 0, + 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, + 28, 0, 0, 0, 0, 29, 30, 31, 13, 0, + 32, 0, 33, 0, 205, 15, 208, 16, 0, 0, + 0, 17, 0, 0, 18, 209, 0, 36, 0, 0, + 0, 19, 0, 0, 0, 37, 38, 0, 0, 0, + 0, 0, 21, 0, 22, 23, 24, 0, 0, 0, + 0, 0, 0, 26, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 0, 39, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 468, + 469, 470, 471, 472, 473, 474, 28, 0, 0, 0, + 0, 29, 30, 31, 0, 0, 32, 0, 33, 0, + 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, + 0, 209, 0, 36, 0, 0, 0, 0, 0, 0, + 0, 37, 38, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 0, 0, 0, 0, 477, 0, 478, 479, + 480, 481, 482, 483, 484, 485, 486, 487, 0, 0, + 39, 0, 0, 0, 0, 488, 489, 0, 0, 0, + 0, 0, 523, 468, 469, 470, 471, 472, 473, 474, + 475, 476, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 468, 469, 470, 471, 472, 473, + 474, 475, 476, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 468, 469, 470, 471, 472, 473, 474, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 477, 0, 478, 479, 480, 481, 482, 483, + 484, 485, 486, 487, 468, 469, 470, 471, 472, 473, + 474, 488, 489, 0, 0, 0, 0, 0, 564, 478, + 479, 480, 481, 482, 483, 484, 485, 486, 487, 0, + 0, 0, 0, 0, 0, 0, 488, 489, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 6, 0, 26, 0, 0, 0, 7, - 27, 28, 29, 9, 0, 30, 0, 31, 10, 0, - 0, 32, 0, 0, 0, 0, 0, 0, 33, 12, - 34, 0, 35, 0, 0, 13, 14, 0, 15, 0, - 36, 37, 16, 0, 0, 17, 0, 0, 0, 0, - 0, 0, 18, 0, 0, 0, 0, 0, 0, 19, - 0, 0, 0, 20, 0, 21, 22, 23, 0, 38, - 0, 0, 0, 0, 25, 535, 469, 470, 471, 472, - 473, 474, 475, 0, 0, 0, 0, 0, 4, 0, - 476, 477, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 477, 0, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 0, 0, 0, 0, 0, 0, 0, + 488, 489, 634, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 477, 633, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 0, 0, 0, 0, 0, 0, 0, + 488, 489, 477, 0, 478, 479, 480, 481, 482, 483, + 484, 485, 486, 487, 5, 0, 0, 0, 0, 0, + 0, 488, 489, 479, 480, 481, 482, 483, 484, 485, + 486, 487, 0, 0, 0, 0, 0, 0, 0, 488, + 489, 6, 0, 7, 0, 0, 0, 0, 0, 8, + 9, 0, 0, 10, 0, 0, 480, 481, 482, 483, + 484, 485, 486, 487, 0, 0, 0, 12, 0, 13, + 0, 488, 489, 0, 0, 205, 15, 0, 16, 0, + 0, 0, 17, 0, 0, 18, 0, 0, 0, 0, + 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, + 5, 0, 0, 21, 0, 22, 23, 24, 25, 0, + 0, 206, 0, 0, 26, 0, 0, 0, 207, 0, + 0, 0, 0, 0, 0, 0, 0, 6, 0, 7, + 0, 0, 0, 0, 0, 8, 0, 0, 0, 10, + 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, + 0, 0, 29, 30, 31, 13, 0, 32, 0, 33, + 0, 205, 15, 208, 16, 0, 0, 0, 17, 0, + 0, 18, 209, 0, 36, 0, 0, 0, 19, 0, + 0, 0, 37, 38, 0, 0, 5, 0, 0, 21, + 0, 22, 23, 24, 0, 0, 0, 0, 0, 0, + 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 6, 0, 7, 0, 0, 0, 0, + 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 28, 0, 0, 0, 0, 29, 30, + 31, 13, 0, 32, 0, 33, 0, 205, 15, 208, + 0, 0, 0, 0, 17, 0, 0, 18, 209, 0, + 36, 0, 0, 0, 19, 0, 0, 0, 37, 38, + 0, 0, 0, 0, 0, 0, 0, 22, 23, 24, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, - 0, 27, 28, 29, 0, 5, 30, 6, 31, 0, - 0, 0, 32, 7, 0, 0, 0, 9, 0, 33, - 0, 34, 0, 35, 456, 457, 458, 459, 460, 461, - 462, 36, 37, 12, 0, 0, 0, 0, 0, 201, - 14, 0, 15, 0, 0, 0, 16, 0, 0, 17, - 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, - 38, 0, 0, 0, 0, 0, 627, 20, 0, 21, - 22, 23, 0, 0, 0, 0, 0, 0, 25, 0, - 456, 457, 458, 459, 460, 461, 462, 0, 0, 0, - 0, 339, 4, 340, 341, 342, 343, 344, 345, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 26, 0, 0, 0, 0, 27, 28, 29, 0, 5, - 30, 6, 31, 0, 0, 0, 204, 7, 0, 0, - 0, 9, 0, 0, 0, 205, 0, 35, 0, 0, - 0, 0, 0, 0, 0, 36, 37, 12, 0, 0, - 0, 0, 0, 201, 14, 0, 15, 346, 0, 0, - 16, 0, 0, 17, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 38, 0, 0, 0, 0, 0, - 529, 20, 0, 21, 22, 23, 0, 0, 0, 0, - 0, 0, 25, 466, 467, 468, 469, 470, 471, 472, - 473, 474, 475, 347, 0, 0, 0, 0, 0, 0, - 476, 477, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 26, 0, 0, 0, 0, 27, - 28, 29, 0, 348, 30, 4, 31, 0, 0, 0, - 204, 0, 0, 291, 0, 0, 349, 0, 0, 205, - 0, 35, 469, 470, 471, 472, 473, 474, 475, 36, - 37, 0, 5, 0, 6, 0, 476, 477, 0, 0, - 7, 8, 350, 0, 9, 351, 352, 353, 0, 10, - 354, 355, 0, 0, 0, 0, 0, 0, 11, 0, - 12, 356, 0, 0, 0, 0, 13, 14, 0, 15, - 0, 0, 0, 16, 0, 0, 17, 0, 0, 0, - 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, - 19, 292, 0, 0, 20, 0, 21, 22, 23, 24, - 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 4, 0, 0, 0, 0, 26, 0, 0, - 0, 0, 27, 28, 29, 0, 0, 30, 0, 31, - 0, 0, 0, 32, 0, 0, 0, 0, 0, 5, - 33, 6, 34, 0, 35, 0, 0, 7, 8, 0, - 0, 9, 36, 37, 0, 0, 10, 0, 0, 0, - 0, 0, 0, 0, 0, 11, 0, 12, 0, 0, - 0, 0, 0, 13, 14, 0, 15, 0, 0, 0, - 16, 38, 0, 17, 0, 0, 0, 0, 0, 0, - 18, 0, 0, 0, 0, 0, 0, 19, 0, 0, - 0, 20, 0, 21, 22, 23, 24, 0, 0, 0, - 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, - 0, 0, 0, 0, 26, 0, 0, 0, 0, 27, - 28, 29, 0, 0, 30, 0, 31, 0, 0, 0, - 32, 0, 0, 0, 0, 0, 5, 33, 6, 34, - 0, 35, 0, 232, 7, 0, 0, 0, 9, 36, - 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, - 201, 14, 0, 15, 0, 233, 0, 16, 38, 0, - 17, 0, 0, 0, 0, 0, 0, 18, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, - 21, 22, 23, 0, 0, 0, 0, 0, 0, 25, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 234, 0, - 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, - 0, 26, 0, 0, 0, 0, 27, 28, 29, 0, - 0, 30, 0, 31, 235, 0, 0, 204, 0, 0, - 0, 0, 5, 0, 6, 0, 205, 0, 35, 232, - 7, 0, 0, 0, 9, 0, 36, 37, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 12, 0, 0, 0, 584, 0, 201, 14, 0, 15, - 0, 233, 0, 16, 0, 38, 17, 4, 0, 0, - 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 20, 599, 21, 22, 23, 0, - 0, 0, 0, 0, 5, 25, 6, 0, 0, 0, - 0, 0, 7, 0, 0, 0, 9, 0, 0, 0, - 0, 0, 0, 0, 234, 0, 0, 0, 0, 0, - 0, 0, 12, 0, 0, 0, 0, 26, 201, 14, - 0, 15, 27, 28, 29, 16, 0, 30, 17, 31, - 235, 0, 0, 204, 0, 18, 0, 0, 0, 0, - 0, 0, 205, 0, 35, 0, 20, 0, 21, 22, - 23, 4, 36, 37, 0, 0, 0, 25, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 0, 0, 0, - 609, 0, 0, 0, 0, 0, 0, 0, 5, 0, - 6, 38, 0, 0, 0, 0, 7, 0, 0, 26, - 9, 0, 0, 0, 27, 28, 29, 0, 0, 30, - 0, 31, 0, 0, 0, 204, 12, 0, 0, 0, - 0, 0, 201, 14, 205, 15, 35, 0, 0, 16, - 0, 0, 17, 0, 36, 37, 0, 0, 0, 18, - 456, 457, 458, 459, 460, 461, 462, 463, 464, 0, - 20, 0, 21, 22, 23, 0, 0, 0, 0, 0, - 0, 25, 0, 38, 0, 456, 457, 458, 459, 460, - 461, 462, 463, 464, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 26, 0, 0, 0, 0, 27, 28, - 29, 0, 0, 30, 0, 31, 0, 0, 0, 204, - 0, 0, 0, 0, 0, 0, 0, 0, 205, 0, - 35, 0, 0, 0, 0, 0, 0, 0, 36, 37, - 0, 0, 0, 0, 0, 465, 0, 466, 467, 468, - 469, 470, 471, 472, 473, 474, 475, 0, 0, 0, - 0, 0, 0, 0, 476, 477, 0, 38, 0, 491, - 456, 457, 458, 459, 460, 461, 462, 463, 464, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 456, 457, 458, 459, 460, 461, 462, 463, - 464, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 456, 457, 458, 459, 460, 461, 462, 465, 0, 466, - 467, 468, 469, 470, 471, 472, 473, 474, 475, 456, - 457, 458, 459, 460, 461, 462, 476, 477, 0, 0, - 0, 511, 465, 0, 466, 467, 468, 469, 470, 471, - 472, 473, 474, 475, 0, 0, 0, 0, 0, 0, - 0, 476, 477, 0, 0, 0, 550, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 456, 457, - 458, 459, 460, 461, 462, 463, 464, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 456, 457, 458, - 459, 460, 461, 462, 0, 464, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 465, 0, 466, - 467, 468, 469, 470, 471, 472, 473, 474, 475, 0, - 0, 0, 0, 0, 0, 0, 476, 477, 538, 465, - 0, 466, 467, 468, 469, 470, 471, 472, 473, 474, - 475, 0, 0, 0, 0, 0, 0, 0, 476, 477, - 618, 468, 469, 470, 471, 472, 473, 474, 475, 0, - 0, 0, 0, 0, 0, 0, 476, 477, 0, 467, - 468, 469, 470, 471, 472, 473, 474, 475, 0, 0, - 0, 0, 0, 0, 0, 476, 477, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 465, 617, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 0, 0, 0, 0, - 0, 0, 0, 476, 477, 465, 0, 466, 467, 468, - 469, 470, 471, 472, 473, 474, 475, 0, 4, 0, - 0, 0, 0, 0, 476, 477, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 0, 0, 0, 0, - 0, 0, 0, 476, 477, 5, 0, 6, 0, 0, - 0, 0, 0, 7, 8, 0, 0, 9, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 11, 0, 12, 0, 0, 0, 0, 0, 201, - 14, 0, 15, 0, 0, 0, 16, 0, 0, 17, - 4, 0, 0, 0, 0, 0, 18, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 20, 0, 21, - 22, 23, 24, 0, 0, 202, 0, 5, 25, 6, - 0, 0, 203, 0, 0, 7, 0, 0, 0, 9, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, - 26, 201, 14, 0, 15, 27, 28, 29, 16, 0, - 30, 17, 31, 0, 0, 0, 204, 0, 18, 0, - 0, 0, 0, 0, 0, 205, 0, 35, 0, 20, - 0, 21, 22, 23, 4, 36, 37, 0, 0, 0, - 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 6, 0, 0, 0, 0, 0, 7, - 0, 0, 26, 0, 0, 0, 0, 27, 28, 29, - 0, 0, 30, 0, 31, 0, 0, 0, 204, 12, - 0, 0, 0, 0, 0, 201, 14, 205, 0, 35, - 0, 0, 16, 0, 0, 17, 0, 36, 37, 0, - 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 21, 22, 23, 0, 0, - 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 27, 28, 29, 0, 0, 30, 0, 0, 0, - 0, 0, 204, 0, 0, 0, 0, 0, 0, 0, - 0, 205, 0, 35, 0, 0, 0, 0, 0, 0, - 0, 36, 37, 96, 0, 97, 98, 99, 0, 100, - 101, 0, 102, 0, 0, 103, 0, 104, 0, 0, - 0, 105, 106, 0, 107, 108, 109, 110, 0, 111, - 112, 113, 114, 115, 116, 117, 118, 0, 119, 0, - 120, 121, 122, 123, 124, 0, 0, 125, 0, 0, - 0, 126, 0, 127, 128, 0, 129, 130, 131, 132, - 133, 134, 0, 135, 136, 137, 138, 139, 140, 0, - 0, 141, 0, 0, 142, 0, 0, 0, 0, 143, - 144, 0, 145, 146, 0, 147, 148, 0, 0, 149, - 150, 151, 152, 153, 154, 0, 155, 156, 157, 158, - 159, 160, 161, 0, 162, 163, 0, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 0, 173, 174, 175, - 176, 0, 0, 0, 177, 0, 0, 178, 0, 0, - 179, 180, 0, 0, 181, 182, 183, 184, 0, 0, - 185, 0, 186, 0, 187, 188, 189, 190, 191, 192, - 193, 0, 0, 194 + 0, 0, 0, 0, 29, 30, 31, 0, 0, 32, + 0, 0, 0, 0, 0, 208, 0, 0, 0, 0, + 0, 0, 0, 0, 209, 0, 36, 0, 0, 0, + 0, 0, 0, 0, 37, 38, 98, 0, 99, 100, + 101, 102, 103, 104, 0, 105, 0, 0, 106, 0, + 107, 0, 0, 0, 108, 109, 0, 110, 111, 112, + 113, 0, 114, 115, 116, 117, 118, 119, 120, 121, + 0, 122, 0, 123, 124, 125, 126, 127, 0, 0, + 128, 0, 0, 0, 129, 0, 130, 131, 0, 132, + 133, 134, 135, 136, 137, 0, 138, 139, 140, 141, + 142, 143, 0, 0, 144, 0, 0, 145, 0, 0, + 0, 0, 146, 147, 0, 148, 149, 0, 150, 151, + 0, 0, 0, 152, 153, 154, 155, 156, 157, 0, + 158, 159, 160, 161, 162, 163, 164, 0, 165, 166, + 0, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 0, 176, 177, 178, 179, 0, 0, 0, 180, 0, + 0, 181, 0, 0, 182, 183, 0, 0, 184, 185, + 186, 187, 0, 0, 188, 0, 189, 0, 190, 191, + 192, 193, 194, 195, 196, 0, 0, 197 }; #define yypact_value_is_default(yystate) \ - ((yystate) == (-519)) + ((yystate) == (-526)) #define yytable_value_is_error(yytable_value) \ YYID (0) static const yytype_int16 yycheck[] = { - 2, 46, 66, 2, 66, 2, 263, 2, 2, 264, - 301, 241, 267, 271, 269, 318, 316, 272, 237, 238, - 37, 289, 277, 46, 33, 543, 107, 43, 494, 15, - 2, 495, 153, 50, 67, 254, 179, 63, 64, 65, - 64, 65, 153, 69, 153, 69, 91, 46, 2, 46, - 179, 46, 68, 86, 57, 549, 0, 32, 131, 34, - 554, 204, 135, 203, 321, 200, 200, 200, 200, 98, - 203, 206, 206, 179, 206, 204, 3, 93, 5, 6, - 7, 8, 9, 10, 205, 551, 3, 4, 552, 162, - 179, 202, 46, 179, 205, 98, 205, 126, 204, 318, - 312, 202, 95, 204, 3, 179, 5, 6, 7, 8, - 9, 10, 630, 8, 608, 204, 202, 408, 584, 200, - 136, 38, 200, 335, 336, 589, 43, 201, 419, 29, - 202, 202, 148, 205, 205, 35, 404, 174, 175, 176, - 177, 178, 69, 609, 8, 203, 260, 11, 212, 263, - 212, 615, 200, 70, 200, 203, 270, 203, 25, 273, - 200, 28, 202, 3, 4, 279, 280, 3, 4, 205, - 69, 3, 4, 237, 238, 237, 238, 3, 4, 8, - 435, 3, 4, 3, 4, 205, 250, 202, 115, 206, - 254, 202, 254, 181, 258, 202, 219, 199, 200, 205, - 199, 200, 199, 200, 199, 200, 123, 321, 322, 205, - 13, 14, 15, 199, 200, 202, 115, 202, 145, 245, - 439, 245, 202, 478, 202, 455, 271, 199, 200, 204, - 205, 158, 149, 202, 534, 202, 350, 351, 352, 353, - 354, 355, 356, 202, 535, 278, 145, 202, 281, 205, - 283, 284, 203, 508, 318, 288, 318, 184, 203, 158, - 187, 188, 189, 3, 4, 192, 193, 3, 4, 271, - 203, 501, 189, 203, 201, 203, 203, 203, 323, 203, - 583, 203, 540, 200, 203, 184, 203, 203, 187, 188, - 189, 3, 4, 192, 193, 15, 38, 203, 38, 15, - 203, 310, 201, 594, 203, 608, 203, 526, 3, 4, - 493, 356, 426, 203, 497, 317, 203, 620, 317, 549, - 317, 323, 317, 332, 554, 3, 4, 557, 70, 374, - 70, 203, 635, 203, 336, 203, 627, 3, 4, 3, - 4, 203, 456, 457, 203, 459, 460, 461, 462, 463, - 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, - 474, 475, 203, 477, 203, 203, 203, 3, 413, 203, - 434, 628, 203, 203, 202, 439, 421, 439, 608, 203, - 203, 123, 203, 123, 187, 188, 189, 190, 191, 503, - 3, 4, 437, 455, 203, 650, 199, 200, 203, 205, - 583, 202, 447, 586, 202, 205, 203, 149, 207, 149, - 204, 204, 8, 415, 413, 409, 418, 8, 8, 418, - 8, 418, 421, 418, 421, 38, 421, 8, 611, 8, - 43, 8, 8, 495, 5, 8, 200, 620, 203, 3, - 437, 5, 6, 7, 8, 9, 10, 189, 202, 189, - 495, 181, 635, 205, 202, 205, 179, 70, 200, 204, - 200, 203, 526, 203, 526, 39, 207, 187, 188, 189, - 190, 191, 206, 189, 190, 191, 179, 204, 204, 199, - 200, 203, 546, 199, 200, 530, 204, 549, 199, 204, - 552, 204, 554, 495, 204, 540, 3, 4, 204, 204, - 614, 202, 204, 617, 204, 69, 204, 552, 82, 179, - 123, 204, 204, 204, 628, 204, 204, 204, 4, 204, - 204, 95, 96, 97, 204, 204, 181, 204, 204, 204, - 104, 38, 204, 8, 89, 206, 149, 204, 540, 179, - 202, 204, 202, 3, 589, 31, 608, 33, 3, 8, - 552, 115, 5, 39, 40, 204, 38, 43, 202, 202, - 181, 43, 48, 70, 205, 204, 204, 204, 142, 204, - 615, 57, 146, 59, 204, 204, 189, 204, 204, 65, - 66, 145, 68, 181, 204, 202, 72, 589, 70, 75, - 203, 2, 181, 44, 158, 597, 82, 279, 597, 417, - 597, 434, 597, 89, 90, 503, 656, 93, 415, 95, - 96, 97, 98, 615, 2, 46, 123, 630, 104, 4, - 184, 2, 2, 187, 188, 189, 212, 275, 192, 193, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 203, - -1, 123, 149, -1, -1, -1, 31, -1, 33, -1, - 136, -1, -1, -1, 39, 141, 142, 143, 43, -1, - 146, -1, 148, 48, -1, -1, 152, 149, -1, -1, - -1, -1, -1, 159, 59, 161, -1, 163, -1, -1, - 65, 66, 189, 68, -1, 171, 172, 72, -1, -1, - 75, -1, -1, -1, -1, -1, 203, 82, -1, -1, - -1, -1, -1, -1, 89, -1, -1, 189, 93, -1, - 95, 96, 97, -1, 200, -1, -1, -1, 200, 104, - 206, 203, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 4, -1, -1, -1, -1, -1, -1, + 2, 2, 69, 2, 69, 2, 2, 307, 269, 2, + 48, 272, 268, 274, 246, 204, 277, 45, 2, 276, + 325, 282, 242, 243, 70, 2, 2, 294, 2, 506, + 2, 2, 108, 558, 16, 38, 48, 58, 505, 507, + 327, 16, 509, 155, 90, 3, 155, 5, 51, 48, + 155, 48, 66, 67, 68, 48, 34, 35, 72, 0, + 3, 202, 5, 563, 48, 202, 207, 202, 568, 207, + 207, 31, 207, 3, 330, 5, 36, 99, 99, 133, + 16, 39, 9, 137, 67, 68, 44, 181, 565, 72, + 181, 3, 204, 5, 206, 204, 39, 3, 566, 204, + 6, 7, 8, 9, 10, 11, 128, 327, 96, 39, + 164, 181, 206, 71, 44, 181, 202, 208, 181, 419, + 206, 598, 647, 3, 624, 181, 202, 39, 71, 318, + 597, 431, 321, 600, 321, 603, 6, 7, 208, 39, + 44, 71, 208, 207, 44, 208, 413, 203, 625, 216, + 183, 216, 341, 342, 343, 342, 343, 26, 206, 71, + 627, 30, 206, 631, 70, 69, 3, 125, 5, 636, + 9, 71, 3, 12, 5, 242, 243, 242, 243, 14, + 15, 16, 125, 206, 202, 652, 447, 205, 255, 202, + 94, 202, 205, 151, 205, 125, 263, 3, 418, 5, + 202, 203, 205, 202, 203, 202, 203, 161, 151, 202, + 203, 117, 224, 125, 189, 190, 191, 192, 193, 201, + 202, 151, 3, 204, 5, 125, 201, 202, 207, 490, + 208, 209, 9, 191, 138, 467, 250, 283, 276, 151, + 286, 147, 288, 289, 549, 206, 150, 293, 191, 207, + 550, 151, 204, 206, 160, 191, 192, 193, 204, 520, + 327, 191, 327, 207, 207, 201, 202, 250, 206, 3, + 308, 5, 202, 3, 276, 5, 204, 207, 206, 191, + 186, 513, 206, 189, 190, 191, 204, 39, 194, 195, + 202, 191, 206, 206, 332, 207, 206, 203, 555, 204, + 207, 207, 202, 204, 3, 206, 5, 207, 608, 206, + 597, 176, 177, 178, 179, 180, 204, 319, 319, 71, + 319, 541, 319, 319, 326, 326, 319, 326, 366, 326, + 332, 563, 3, 326, 5, 319, 568, 624, 202, 571, + 40, 343, 319, 319, 644, 319, 384, 319, 319, 636, + 3, 418, 5, 418, 189, 190, 191, 192, 193, 3, + 3, 5, 5, 207, 207, 652, 201, 202, 3, 207, + 5, 207, 206, 125, 208, 207, 3, 207, 207, 446, + 207, 207, 207, 83, 207, 207, 207, 425, 416, 645, + 610, 207, 624, 207, 207, 433, 96, 97, 98, 151, + 207, 206, 467, 207, 207, 105, 667, 207, 207, 207, + 207, 449, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 459, 207, 207, 420, 427, 425, 207, 430, 430, + 204, 430, 207, 430, 433, 207, 433, 430, 207, 191, + 433, 207, 507, 206, 144, 206, 204, 209, 148, 208, + 202, 208, 449, 3, 207, 207, 6, 7, 8, 9, + 10, 11, 9, 9, 9, 9, 9, 9, 9, 507, + 9, 9, 207, 202, 541, 265, 541, 183, 268, 206, + 204, 204, 204, 672, 673, 275, 206, 208, 278, 205, + 181, 209, 207, 560, 284, 285, 208, 208, 563, 208, + 208, 566, 181, 568, 208, 507, 208, 545, 9, 90, + 208, 208, 208, 208, 208, 208, 208, 555, 208, 208, + 70, 208, 208, 208, 208, 208, 208, 208, 566, 201, + 208, 208, 208, 535, 208, 183, 535, 206, 535, 205, + 330, 331, 535, 610, 208, 610, 208, 181, 206, 206, + 3, 3, 9, 555, 208, 6, 181, 206, 208, 624, + 206, 208, 183, 208, 566, 603, 208, 117, 204, 208, + 360, 361, 362, 363, 364, 365, 366, 208, 208, 208, + 182, 222, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 208, 631, 183, 183, 206, 147, 446, 201, + 202, 603, 290, 48, 284, 429, 208, 515, 427, 216, + 160, 613, 613, 673, 613, 647, 613, 14, 15, 16, + 613, 280, 19, 20, -1, -1, -1, -1, -1, 631, + -1, -1, -1, -1, -1, -1, 186, -1, -1, 189, + 190, 191, -1, -1, 194, 195, -1, -1, 438, -1, + -1, -1, -1, 203, -1, -1, -1, 207, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 136, -1, -1, -1, -1, 141, 142, 143, -1, - 31, 146, 33, 148, 13, 14, 15, 152, 39, 18, - 19, -1, 43, -1, 159, -1, 161, 48, 163, -1, - -1, -1, -1, -1, -1, -1, 171, 172, 59, -1, - -1, -1, -1, -1, 65, 66, -1, 68, -1, -1, - -1, 72, -1, -1, 75, -1, -1, -1, -1, -1, - -1, 82, -1, -1, -1, 200, -1, -1, 89, -1, - -1, 206, 93, -1, 95, 96, 97, -1, -1, -1, - -1, -1, -1, 104, 4, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 468, 469, + -1, 471, 472, 473, 474, 475, 476, 477, 478, 479, + 480, 481, 482, 483, 484, 485, 486, 487, -1, 489, + -1, -1, -1, -1, -1, -1, 3, -1, 5, 6, + 7, 8, 9, 10, 11, -1, 3, -1, -1, 6, + 7, 8, 9, 10, 11, 515, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 32, -1, 34, -1, -1, + -1, -1, -1, 40, -1, -1, -1, 44, -1, -1, + -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, + 20, -1, -1, 60, -1, -1, -1, -1, -1, 66, + 67, -1, 69, 70, -1, -1, 73, -1, -1, 76, + -1, -1, -1, 70, -1, -1, 83, -1, -1, -1, + 187, 188, 189, 190, 191, 192, 193, 94, -1, 96, + 97, 98, -1, -1, 201, 202, -1, -1, 105, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 117, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 117, 14, 15, 16, 17, 18, 19, 20, -1, 22, + 630, 138, -1, 633, -1, -1, 143, 144, 145, -1, + 147, 148, -1, 150, -1, 645, -1, 154, -1, -1, + 147, -1, -1, 160, -1, -1, 163, -1, 165, -1, + -1, -1, -1, 160, -1, -1, 173, 174, -1, -1, + -1, 4, 5, -1, -1, -1, -1, -1, -1, 186, + -1, -1, 189, 190, 191, -1, -1, 194, 195, 186, + -1, -1, 189, 190, 191, -1, -1, 194, 195, 32, + 207, 34, -1, -1, -1, -1, -1, 40, 41, -1, + 207, 44, -1, -1, -1, -1, 49, 187, 188, 189, + 190, 191, 192, 193, -1, 58, -1, 60, -1, -1, + -1, 201, 202, 66, 67, -1, 69, -1, -1, -1, + 73, -1, -1, 76, -1, -1, -1, -1, -1, -1, + 83, -1, -1, -1, -1, -1, -1, 90, 91, -1, + -1, 94, -1, 96, 97, 98, 99, -1, -1, -1, + -1, -1, 105, -1, -1, -1, -1, 110, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 4, 5, + -1, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, -1, -1, -1, -1, 138, -1, -1, 201, 202, + 143, 144, 145, -1, -1, 148, 32, 150, 34, -1, + -1, 154, -1, -1, 40, 41, -1, -1, 44, -1, + 163, -1, 165, 49, -1, -1, -1, -1, -1, -1, + 173, 174, 58, -1, 60, -1, -1, -1, -1, -1, + 66, 67, -1, 69, -1, -1, -1, 73, -1, -1, + 76, -1, -1, -1, -1, -1, -1, 83, -1, 202, + -1, -1, 205, -1, 90, 91, -1, -1, 94, -1, + 96, 97, 98, 99, -1, -1, -1, -1, -1, 105, + -1, -1, -1, -1, 110, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 4, 5, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 138, -1, -1, -1, -1, 143, 144, 145, + -1, -1, 148, 32, 150, 34, -1, -1, 154, -1, + -1, 40, 41, -1, -1, 44, -1, 163, -1, 165, + 49, -1, -1, -1, -1, -1, -1, 173, 174, 58, + -1, 60, -1, -1, -1, -1, -1, 66, 67, -1, + 69, -1, -1, -1, 73, -1, -1, 76, -1, -1, + -1, -1, -1, -1, 83, -1, 202, -1, -1, 205, + -1, 90, -1, -1, -1, 94, -1, 96, 97, 98, + 99, -1, -1, -1, -1, -1, 105, 4, 5, -1, + -1, 110, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 32, -1, 34, -1, 138, + -1, -1, -1, 40, 143, 144, 145, 44, -1, 148, + -1, 150, 49, -1, -1, 154, -1, -1, -1, -1, + -1, -1, -1, 60, 163, -1, 165, -1, -1, 66, + 67, -1, 69, -1, 173, 174, 73, -1, -1, 76, + -1, -1, -1, -1, -1, -1, 83, -1, -1, -1, + -1, -1, -1, 90, -1, -1, -1, 94, -1, 96, + 97, 98, -1, 202, -1, -1, 205, -1, 105, 4, + 5, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 32, -1, 34, + -1, 138, -1, -1, -1, 40, 143, 144, 145, 44, + -1, 148, -1, 150, 49, -1, -1, 154, -1, -1, + -1, -1, -1, -1, -1, 60, 163, -1, 165, -1, + -1, 66, 67, -1, 69, -1, 173, 174, 73, -1, + -1, 76, -1, -1, -1, -1, -1, -1, 83, -1, + -1, -1, -1, -1, -1, 90, -1, -1, -1, 94, + -1, 96, 97, 98, -1, 202, -1, -1, 205, -1, + 105, 4, 5, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, + 15, 16, 17, 18, 19, 20, 21, 22, -1, 32, + -1, 34, -1, 138, -1, -1, -1, 40, 143, 144, + 145, 44, -1, 148, -1, 150, 49, -1, -1, 154, + -1, -1, -1, -1, -1, -1, -1, 60, 163, -1, + 165, -1, -1, 66, 67, -1, 69, -1, 173, 174, + 73, -1, -1, 76, -1, -1, -1, -1, -1, -1, + 83, -1, -1, -1, -1, -1, -1, 90, 5, -1, + -1, 94, -1, 96, 97, 98, -1, 202, -1, -1, + 205, -1, 105, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 32, -1, 34, -1, -1, + -1, -1, -1, 40, -1, -1, -1, 44, -1, -1, + -1, -1, -1, -1, -1, 138, -1, -1, -1, -1, + 143, 144, 145, 60, -1, 148, -1, 150, -1, 66, + 67, 154, 69, -1, -1, -1, 73, -1, -1, 76, + 163, -1, 165, -1, -1, -1, 83, -1, -1, -1, + 173, 174, -1, -1, -1, -1, -1, 94, -1, 96, + 97, 98, -1, -1, -1, -1, -1, 182, 105, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 202, + -1, -1, 205, -1, 4, 5, 201, 202, 203, -1, + -1, -1, -1, 13, -1, -1, -1, -1, -1, -1, + -1, 138, -1, -1, -1, -1, 143, 144, 145, -1, + -1, 148, 32, 150, 34, -1, -1, 154, -1, -1, + 40, 41, -1, -1, 44, -1, 163, -1, 165, 49, + -1, -1, -1, -1, -1, -1, 173, 174, 58, -1, + 60, -1, -1, -1, -1, -1, 66, 67, -1, 69, + -1, -1, -1, 73, -1, -1, 76, -1, -1, -1, + -1, -1, -1, 83, -1, 202, -1, -1, 205, -1, + 90, 91, -1, -1, 94, -1, 96, 97, 98, 99, + -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, + 110, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 4, 5, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 138, -1, + -1, -1, -1, 143, 144, 145, -1, -1, 148, 32, + 150, 34, -1, -1, 154, -1, -1, 40, 41, -1, + -1, 44, -1, 163, -1, 165, 49, -1, -1, -1, + -1, -1, -1, 173, 174, 58, -1, 60, -1, -1, + -1, -1, -1, 66, 67, -1, 69, -1, -1, -1, + 73, -1, -1, 76, -1, -1, -1, -1, -1, -1, + 83, -1, 202, -1, -1, -1, -1, 90, 5, -1, + -1, 94, -1, 96, 97, 98, 99, -1, -1, -1, + -1, -1, 105, -1, -1, -1, -1, 110, -1, -1, + -1, -1, -1, -1, -1, 32, -1, 34, -1, -1, + -1, -1, 39, 40, -1, -1, -1, 44, -1, -1, + -1, -1, -1, -1, -1, 138, -1, -1, -1, -1, + 143, 144, 145, 60, -1, 148, -1, 150, -1, 66, + 67, 154, 69, -1, 71, -1, 73, -1, 161, 76, + 163, -1, 165, -1, -1, -1, 83, -1, -1, -1, + 173, 174, -1, -1, -1, -1, -1, 94, -1, 96, + 97, 98, -1, -1, -1, -1, -1, -1, 105, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 202, + -1, -1, -1, -1, -1, -1, -1, -1, 125, -1, + -1, -1, -1, -1, -1, 5, -1, -1, -1, -1, + -1, 138, -1, -1, -1, -1, 143, 144, 145, -1, + -1, 148, -1, 150, 151, -1, -1, 154, -1, -1, + -1, -1, 32, -1, 34, -1, 163, -1, 165, 39, + 40, -1, -1, -1, 44, -1, 173, 174, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 60, -1, -1, -1, 191, -1, 66, 67, -1, 69, + -1, 71, -1, 73, -1, 202, 76, -1, -1, -1, + -1, -1, -1, 83, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 94, -1, 96, 97, 98, -1, + -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 125, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 5, 138, -1, + -1, -1, -1, 143, 144, 145, -1, -1, 148, -1, + 150, 151, -1, -1, 154, 23, -1, -1, -1, -1, + -1, -1, -1, 163, 32, 165, 34, -1, -1, -1, + -1, -1, 40, 173, 174, -1, 44, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 191, 60, -1, -1, -1, -1, -1, 66, 67, + -1, 69, 202, -1, -1, 73, -1, -1, 76, -1, + -1, -1, -1, -1, -1, 83, -1, -1, -1, -1, + -1, -1, -1, 5, -1, -1, 94, -1, 96, 97, + 98, -1, -1, -1, -1, -1, -1, 105, 14, 15, + 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, + 32, -1, 34, -1, -1, -1, -1, -1, 40, -1, + -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, + 138, -1, -1, -1, -1, 143, 144, 145, 60, -1, + 148, -1, 150, -1, 66, 67, 154, 69, -1, -1, + -1, 73, -1, -1, 76, 163, -1, 165, -1, -1, + -1, 83, -1, -1, -1, 173, 174, -1, -1, -1, + -1, -1, 94, -1, 96, 97, 98, -1, -1, -1, + -1, -1, -1, 105, 14, 15, 16, 17, 18, 19, + 20, 21, 22, -1, 202, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 14, + 15, 16, 17, 18, 19, 20, 138, -1, -1, -1, + -1, 143, 144, 145, -1, -1, 148, -1, 150, -1, + -1, -1, 154, -1, -1, -1, -1, -1, -1, -1, + -1, 163, -1, 165, -1, -1, -1, -1, -1, -1, + -1, 173, 174, 14, 15, 16, 17, 18, 19, 20, + 21, 22, -1, -1, -1, -1, 182, -1, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, -1, -1, + 202, -1, -1, -1, -1, 201, 202, -1, -1, -1, + -1, -1, 208, 14, 15, 16, 17, 18, 19, 20, + 21, 22, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 14, 15, 16, 17, 18, 19, + 20, 21, 22, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 14, 15, 16, 17, 18, 19, 20, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 182, -1, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 14, 15, 16, 17, 18, 19, + 20, 201, 202, -1, -1, -1, -1, -1, 208, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, -1, + -1, -1, -1, -1, -1, -1, 201, 202, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 31, -1, 33, -1, 136, -1, -1, -1, 39, - 141, 142, 143, 43, -1, 146, -1, 148, 48, -1, - -1, 152, -1, -1, -1, -1, -1, -1, 159, 59, - 161, -1, 163, -1, -1, 65, 66, -1, 68, -1, - 171, 172, 72, -1, -1, 75, -1, -1, -1, -1, - -1, -1, 82, -1, -1, -1, -1, -1, -1, 89, - -1, -1, -1, 93, -1, 95, 96, 97, -1, 200, - -1, -1, -1, -1, 104, 206, 185, 186, 187, 188, - 189, 190, 191, -1, -1, -1, -1, -1, 4, -1, - 199, 200, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 136, -1, -1, -1, - -1, 141, 142, 143, -1, 31, 146, 33, 148, -1, - -1, -1, 152, 39, -1, -1, -1, 43, -1, 159, - -1, 161, -1, 163, 13, 14, 15, 16, 17, 18, - 19, 171, 172, 59, -1, -1, -1, -1, -1, 65, - 66, -1, 68, -1, -1, -1, 72, -1, -1, 75, - -1, -1, -1, -1, -1, -1, 82, -1, -1, -1, - 200, -1, -1, -1, -1, -1, 206, 93, -1, 95, - 96, 97, -1, -1, -1, -1, -1, -1, 104, -1, - 13, 14, 15, 16, 17, 18, 19, -1, -1, -1, - -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, + -1, 182, -1, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, -1, -1, -1, -1, -1, -1, -1, + 201, 202, 203, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 136, -1, -1, -1, -1, 141, 142, 143, -1, 31, - 146, 33, 148, -1, -1, -1, 152, 39, -1, -1, - -1, 43, -1, -1, -1, 161, -1, 163, -1, -1, - -1, -1, -1, -1, -1, 171, 172, 59, -1, -1, - -1, -1, -1, 65, 66, -1, 68, 69, -1, -1, - 72, -1, -1, 75, -1, -1, -1, -1, -1, -1, - 82, -1, -1, -1, 200, -1, -1, -1, -1, -1, - 206, 93, -1, 95, 96, 97, -1, -1, -1, -1, - -1, -1, 104, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 115, -1, -1, -1, -1, -1, -1, - 199, 200, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 136, -1, -1, -1, -1, 141, - 142, 143, -1, 145, 146, 4, 148, -1, -1, -1, - 152, -1, -1, 12, -1, -1, 158, -1, -1, 161, - -1, 163, 185, 186, 187, 188, 189, 190, 191, 171, - 172, -1, 31, -1, 33, -1, 199, 200, -1, -1, - 39, 40, 184, -1, 43, 187, 188, 189, -1, 48, - 192, 193, -1, -1, -1, -1, -1, -1, 57, -1, - 59, 203, -1, -1, -1, -1, 65, 66, -1, 68, - -1, -1, -1, 72, -1, -1, 75, -1, -1, -1, - -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, - 89, 90, -1, -1, 93, -1, 95, 96, 97, 98, - -1, -1, -1, -1, -1, 104, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 4, -1, -1, -1, -1, 136, -1, -1, - -1, -1, 141, 142, 143, -1, -1, 146, -1, 148, - -1, -1, -1, 152, -1, -1, -1, -1, -1, 31, - 159, 33, 161, -1, 163, -1, -1, 39, 40, -1, - -1, 43, 171, 172, -1, -1, 48, -1, -1, -1, - -1, -1, -1, -1, -1, 57, -1, 59, -1, -1, - -1, -1, -1, 65, 66, -1, 68, -1, -1, -1, - 72, 200, -1, 75, -1, -1, -1, -1, -1, -1, - 82, -1, -1, -1, -1, -1, -1, 89, -1, -1, - -1, 93, -1, 95, 96, 97, 98, -1, -1, -1, - -1, -1, 104, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 4, - -1, -1, -1, -1, 136, -1, -1, -1, -1, 141, - 142, 143, -1, -1, 146, -1, 148, -1, -1, -1, - 152, -1, -1, -1, -1, -1, 31, 159, 33, 161, - -1, 163, -1, 38, 39, -1, -1, -1, 43, 171, - 172, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 59, -1, -1, -1, -1, -1, - 65, 66, -1, 68, -1, 70, -1, 72, 200, -1, - 75, -1, -1, -1, -1, -1, -1, 82, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 93, -1, - 95, 96, 97, -1, -1, -1, -1, -1, -1, 104, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 123, -1, - -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, - -1, 136, -1, -1, -1, -1, 141, 142, 143, -1, - -1, 146, -1, 148, 149, -1, -1, 152, -1, -1, - -1, -1, 31, -1, 33, -1, 161, -1, 163, 38, - 39, -1, -1, -1, 43, -1, 171, 172, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 59, -1, -1, -1, 189, -1, 65, 66, -1, 68, - -1, 70, -1, 72, -1, 200, 75, 4, -1, -1, - -1, -1, -1, 82, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 93, 22, 95, 96, 97, -1, - -1, -1, -1, -1, 31, 104, 33, -1, -1, -1, - -1, -1, 39, -1, -1, -1, 43, -1, -1, -1, - -1, -1, -1, -1, 123, -1, -1, -1, -1, -1, - -1, -1, 59, -1, -1, -1, -1, 136, 65, 66, - -1, 68, 141, 142, 143, 72, -1, 146, 75, 148, - 149, -1, -1, 152, -1, 82, -1, -1, -1, -1, - -1, -1, 161, -1, 163, -1, 93, -1, 95, 96, - 97, 4, 171, 172, -1, -1, -1, 104, 13, 14, - 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, - 189, -1, -1, -1, -1, -1, -1, -1, 31, -1, - 33, 200, -1, -1, -1, -1, 39, -1, -1, 136, - 43, -1, -1, -1, 141, 142, 143, -1, -1, 146, - -1, 148, -1, -1, -1, 152, 59, -1, -1, -1, - -1, -1, 65, 66, 161, 68, 163, -1, -1, 72, - -1, -1, 75, -1, 171, 172, -1, -1, -1, 82, - 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, - 93, -1, 95, 96, 97, -1, -1, -1, -1, -1, - -1, 104, -1, 200, -1, 13, 14, 15, 16, 17, - 18, 19, 20, 21, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 136, -1, -1, -1, -1, 141, 142, - 143, -1, -1, 146, -1, 148, -1, -1, -1, 152, - -1, -1, -1, -1, -1, -1, -1, -1, 161, -1, - 163, -1, -1, -1, -1, -1, -1, -1, 171, 172, - -1, -1, -1, -1, -1, 180, -1, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, -1, -1, -1, - -1, -1, -1, -1, 199, 200, -1, 200, -1, 204, - 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 13, 14, 15, 16, 17, 18, 19, 20, - 21, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 13, 14, 15, 16, 17, 18, 19, 180, -1, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 13, - 14, 15, 16, 17, 18, 19, 199, 200, -1, -1, - -1, 204, 180, -1, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, -1, -1, -1, -1, -1, -1, - -1, 199, 200, -1, -1, -1, 204, 13, 14, 15, - 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 13, 14, - 15, 16, 17, 18, 19, 20, 21, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 13, 14, 15, - 16, 17, 18, 19, -1, 21, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 180, -1, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, -1, - -1, -1, -1, -1, -1, -1, 199, 200, 201, 180, -1, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, -1, -1, -1, -1, -1, -1, -1, 199, 200, - 201, 184, 185, 186, 187, 188, 189, 190, 191, -1, - -1, -1, -1, -1, -1, -1, 199, 200, -1, 183, - 184, 185, 186, 187, 188, 189, 190, 191, -1, -1, - -1, -1, -1, -1, -1, 199, 200, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, -1, -1, -1, -1, - -1, -1, -1, 199, 200, 180, -1, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, -1, 4, -1, - -1, -1, -1, -1, 199, 200, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, -1, -1, -1, -1, - -1, -1, -1, 199, 200, 31, -1, 33, -1, -1, - -1, -1, -1, 39, 40, -1, -1, 43, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 57, -1, 59, -1, -1, -1, -1, -1, 65, - 66, -1, 68, -1, -1, -1, 72, -1, -1, 75, - 4, -1, -1, -1, -1, -1, 82, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 93, -1, 95, - 96, 97, 98, -1, -1, 101, -1, 31, 104, 33, - -1, -1, 108, -1, -1, 39, -1, -1, -1, 43, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 59, -1, -1, -1, -1, - 136, 65, 66, -1, 68, 141, 142, 143, 72, -1, - 146, 75, 148, -1, -1, -1, 152, -1, 82, -1, - -1, -1, -1, -1, -1, 161, -1, 163, -1, 93, - -1, 95, 96, 97, 4, 171, 172, -1, -1, -1, - 104, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 31, -1, 33, -1, -1, -1, -1, -1, 39, - -1, -1, 136, -1, -1, -1, -1, 141, 142, 143, - -1, -1, 146, -1, 148, -1, -1, -1, 152, 59, - -1, -1, -1, -1, -1, 65, 66, 161, -1, 163, - -1, -1, 72, -1, -1, 75, -1, 171, 172, -1, - -1, -1, 82, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 95, 96, 97, -1, -1, - -1, -1, -1, -1, 104, -1, -1, -1, -1, -1, + 191, 192, 193, -1, -1, -1, -1, -1, -1, -1, + 201, 202, 182, -1, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 5, -1, -1, -1, -1, -1, + -1, 201, 202, 185, 186, 187, 188, 189, 190, 191, + 192, 193, -1, -1, -1, -1, -1, -1, -1, 201, + 202, 32, -1, 34, -1, -1, -1, -1, -1, 40, + 41, -1, -1, 44, -1, -1, 186, 187, 188, 189, + 190, 191, 192, 193, -1, -1, -1, 58, -1, 60, + -1, 201, 202, -1, -1, 66, 67, -1, 69, -1, + -1, -1, 73, -1, -1, 76, -1, -1, -1, -1, + -1, -1, 83, -1, -1, -1, -1, -1, -1, -1, + 5, -1, -1, 94, -1, 96, 97, 98, 99, -1, + -1, 102, -1, -1, 105, -1, -1, -1, 109, -1, + -1, -1, -1, -1, -1, -1, -1, 32, -1, 34, + -1, -1, -1, -1, -1, 40, -1, -1, -1, 44, + -1, -1, -1, -1, -1, -1, -1, 138, -1, -1, + -1, -1, 143, 144, 145, 60, -1, 148, -1, 150, + -1, 66, 67, 154, 69, -1, -1, -1, 73, -1, + -1, 76, 163, -1, 165, -1, -1, -1, 83, -1, + -1, -1, 173, 174, -1, -1, 5, -1, -1, 94, + -1, 96, 97, 98, -1, -1, -1, -1, -1, -1, + 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 32, -1, 34, -1, -1, -1, -1, + -1, 40, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 138, -1, -1, -1, -1, 143, 144, + 145, 60, -1, 148, -1, 150, -1, 66, 67, 154, + -1, -1, -1, -1, 73, -1, -1, 76, 163, -1, + 165, -1, -1, -1, 83, -1, -1, -1, 173, 174, + -1, -1, -1, -1, -1, -1, -1, 96, 97, 98, + -1, -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 141, 142, 143, -1, -1, 146, -1, -1, -1, - -1, -1, 152, -1, -1, -1, -1, -1, -1, -1, - -1, 161, -1, 163, -1, -1, -1, -1, -1, -1, - -1, 171, 172, 23, -1, 25, 26, 27, -1, 29, - 30, -1, 32, -1, -1, 35, -1, 37, -1, -1, - -1, 41, 42, -1, 44, 45, 46, 47, -1, 49, - 50, 51, 52, 53, 54, 55, 56, -1, 58, -1, - 60, 61, 62, 63, 64, -1, -1, 67, -1, -1, - -1, 71, -1, 73, 74, -1, 76, 77, 78, 79, - 80, 81, -1, 83, 84, 85, 86, 87, 88, -1, - -1, 91, -1, -1, 94, -1, -1, -1, -1, 99, - 100, -1, 102, 103, -1, 105, 106, -1, -1, 109, - 110, 111, 112, 113, 114, -1, 116, 117, 118, 119, - 120, 121, 122, -1, 124, 125, -1, 127, 128, 129, - 130, 131, 132, 133, 134, 135, -1, 137, 138, 139, - 140, -1, -1, -1, 144, -1, -1, 147, -1, -1, - 150, 151, -1, -1, 154, 155, 156, 157, -1, -1, - 160, -1, 162, -1, 164, 165, 166, 167, 168, 169, - 170, -1, -1, 173 + -1, -1, -1, -1, 143, 144, 145, -1, -1, 148, + -1, -1, -1, -1, -1, 154, -1, -1, -1, -1, + -1, -1, -1, -1, 163, -1, 165, -1, -1, -1, + -1, -1, -1, -1, 173, 174, 24, -1, 26, 27, + 28, 29, 30, 31, -1, 33, -1, -1, 36, -1, + 38, -1, -1, -1, 42, 43, -1, 45, 46, 47, + 48, -1, 50, 51, 52, 53, 54, 55, 56, 57, + -1, 59, -1, 61, 62, 63, 64, 65, -1, -1, + 68, -1, -1, -1, 72, -1, 74, 75, -1, 77, + 78, 79, 80, 81, 82, -1, 84, 85, 86, 87, + 88, 89, -1, -1, 92, -1, -1, 95, -1, -1, + -1, -1, 100, 101, -1, 103, 104, -1, 106, 107, + -1, -1, -1, 111, 112, 113, 114, 115, 116, -1, + 118, 119, 120, 121, 122, 123, 124, -1, 126, 127, + -1, 129, 130, 131, 132, 133, 134, 135, 136, 137, + -1, 139, 140, 141, 142, -1, -1, -1, 146, -1, + -1, 149, -1, -1, 152, 153, -1, -1, 156, 157, + 158, 159, -1, -1, 162, -1, 164, -1, 166, 167, + 168, 169, 170, 171, 172, -1, -1, 175 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint16 yystos[] = { - 0, 209, 210, 0, 4, 31, 33, 39, 40, 43, - 48, 57, 59, 65, 66, 68, 72, 75, 82, 89, - 93, 95, 96, 97, 98, 104, 136, 141, 142, 143, - 146, 148, 152, 159, 161, 163, 171, 172, 200, 214, - 215, 216, 217, 218, 221, 222, 229, 240, 254, 258, - 260, 261, 262, 263, 266, 267, 270, 272, 273, 274, - 275, 277, 278, 279, 280, 281, 283, 285, 303, 304, - 305, 306, 3, 4, 203, 3, 4, 3, 4, 256, - 95, 259, 8, 3, 4, 259, 203, 259, 260, 3, - 256, 228, 229, 3, 256, 260, 23, 25, 26, 27, - 29, 30, 32, 35, 37, 41, 42, 44, 45, 46, - 47, 49, 50, 51, 52, 53, 54, 55, 56, 58, - 60, 61, 62, 63, 64, 67, 71, 73, 74, 76, - 77, 78, 79, 80, 81, 83, 84, 85, 86, 87, - 88, 91, 94, 99, 100, 102, 103, 105, 106, 109, - 110, 111, 112, 113, 114, 116, 117, 118, 119, 120, - 121, 122, 124, 125, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 137, 138, 139, 140, 144, 147, 150, - 151, 154, 155, 156, 157, 160, 162, 164, 165, 166, - 167, 168, 169, 170, 173, 230, 232, 302, 202, 211, - 211, 65, 101, 108, 152, 161, 220, 240, 261, 266, - 272, 276, 283, 303, 306, 202, 202, 205, 202, 205, - 202, 213, 202, 181, 271, 205, 284, 285, 284, 284, - 3, 4, 38, 70, 123, 149, 189, 203, 234, 257, - 286, 287, 300, 240, 303, 304, 306, 284, 202, 8, - 205, 202, 304, 205, 283, 153, 205, 203, 203, 203, - 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, - 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, - 203, 203, 203, 203, 203, 203, 203, 203, 203, 179, - 201, 12, 90, 214, 219, 222, 261, 263, 274, 275, - 278, 206, 3, 3, 3, 4, 3, 3, 205, 300, - 264, 126, 268, 272, 3, 4, 205, 212, 282, 286, - 286, 207, 200, 203, 227, 284, 204, 237, 238, 239, - 257, 204, 247, 286, 296, 203, 250, 8, 257, 3, - 5, 6, 7, 8, 9, 10, 69, 115, 145, 158, - 184, 187, 188, 189, 192, 193, 203, 243, 244, 245, - 243, 246, 8, 8, 231, 246, 245, 8, 8, 245, - 8, 245, 243, 226, 229, 283, 245, 241, 242, 243, - 8, 302, 8, 245, 304, 241, 243, 304, 174, 175, - 176, 177, 178, 301, 304, 304, 8, 11, 233, 5, - 307, 8, 304, 232, 200, 203, 202, 213, 206, 228, - 265, 181, 107, 228, 252, 269, 202, 205, 212, 206, - 214, 229, 281, 286, 204, 246, 189, 201, 243, 223, - 224, 225, 226, 206, 179, 207, 206, 228, 248, 179, - 252, 206, 229, 249, 252, 204, 204, 203, 243, 243, - 243, 243, 243, 243, 243, 283, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 180, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 199, 200, 179, 204, - 204, 204, 179, 204, 204, 204, 204, 204, 204, 204, - 204, 204, 204, 283, 189, 203, 227, 234, 257, 292, - 294, 295, 204, 179, 204, 204, 204, 204, 179, 204, - 204, 204, 204, 204, 204, 204, 204, 199, 204, 204, - 204, 232, 8, 213, 275, 181, 283, 303, 202, 206, - 229, 253, 254, 206, 218, 206, 213, 201, 201, 204, - 179, 239, 245, 283, 306, 286, 204, 202, 202, 283, - 204, 189, 203, 227, 234, 288, 290, 291, 243, 243, - 3, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 3, 243, - 245, 8, 294, 282, 189, 223, 234, 293, 294, 203, - 227, 242, 245, 5, 204, 286, 202, 212, 213, 22, - 226, 292, 298, 299, 202, 255, 257, 290, 282, 189, - 223, 234, 289, 290, 204, 203, 227, 181, 201, 294, - 282, 204, 294, 204, 223, 204, 213, 206, 181, 297, - 179, 202, 205, 204, 290, 282, 204, 294, 204, 243, - 223, 243, 294, 204, 213, 246, 298, 235, 294, 204, - 37, 50, 206, 236, 245, 181, 181, 202, 251, 252, - 251, 202 + 0, 211, 212, 0, 4, 5, 32, 34, 40, 41, + 44, 49, 58, 60, 66, 67, 69, 73, 76, 83, + 90, 94, 96, 97, 98, 99, 105, 110, 138, 143, + 144, 145, 148, 150, 154, 163, 165, 173, 174, 202, + 216, 217, 218, 219, 220, 223, 224, 230, 231, 242, + 256, 260, 262, 263, 264, 265, 266, 269, 270, 273, + 275, 276, 277, 278, 280, 281, 282, 283, 284, 286, + 288, 306, 307, 308, 309, 3, 5, 207, 3, 5, + 3, 5, 258, 96, 261, 9, 3, 5, 261, 3, + 207, 261, 262, 3, 258, 3, 258, 262, 24, 26, + 27, 28, 29, 30, 31, 33, 36, 38, 42, 43, + 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, + 56, 57, 59, 61, 62, 63, 64, 65, 68, 72, + 74, 75, 77, 78, 79, 80, 81, 82, 84, 85, + 86, 87, 88, 89, 92, 95, 100, 101, 103, 104, + 106, 107, 111, 112, 113, 114, 115, 116, 118, 119, + 120, 121, 122, 123, 124, 126, 127, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 139, 140, 141, 142, + 146, 149, 152, 153, 156, 157, 158, 159, 162, 164, + 166, 167, 168, 169, 170, 171, 172, 175, 232, 234, + 305, 206, 213, 213, 161, 66, 102, 109, 154, 163, + 222, 242, 263, 269, 275, 279, 286, 306, 309, 206, + 206, 204, 204, 206, 204, 206, 215, 206, 183, 274, + 204, 287, 288, 287, 287, 3, 5, 39, 71, 125, + 151, 191, 207, 236, 259, 289, 290, 303, 242, 306, + 307, 309, 287, 206, 9, 204, 206, 307, 204, 155, + 204, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 181, 203, 13, 91, 216, 221, + 224, 263, 265, 266, 277, 278, 281, 205, 230, 231, + 3, 3, 3, 5, 3, 3, 204, 303, 267, 212, + 128, 271, 275, 3, 5, 204, 214, 285, 289, 289, + 209, 202, 207, 229, 287, 208, 239, 240, 241, 259, + 208, 249, 207, 252, 9, 9, 12, 235, 259, 3, + 6, 7, 8, 9, 10, 11, 70, 117, 147, 160, + 186, 189, 190, 191, 194, 195, 207, 245, 246, 247, + 245, 248, 9, 9, 233, 248, 247, 9, 9, 247, + 9, 247, 245, 228, 231, 286, 247, 243, 244, 245, + 9, 305, 9, 247, 307, 243, 245, 307, 176, 177, + 178, 179, 180, 304, 307, 307, 235, 6, 7, 310, + 9, 307, 234, 202, 207, 206, 204, 215, 286, 205, + 230, 268, 205, 183, 108, 230, 254, 272, 206, 204, + 214, 205, 216, 231, 284, 289, 208, 248, 191, 203, + 245, 225, 226, 227, 228, 205, 181, 209, 205, 230, + 250, 254, 205, 231, 251, 254, 208, 208, 208, 207, + 245, 245, 245, 245, 245, 245, 245, 286, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 182, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 201, 202, + 181, 208, 208, 208, 181, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 286, 191, 207, 229, 236, + 259, 295, 297, 298, 208, 181, 208, 208, 208, 208, + 181, 208, 208, 208, 208, 208, 208, 208, 208, 201, + 208, 208, 208, 234, 9, 213, 289, 299, 215, 278, + 183, 286, 306, 206, 205, 231, 255, 256, 205, 220, + 205, 215, 203, 203, 208, 181, 241, 247, 286, 309, + 208, 206, 206, 286, 208, 191, 207, 229, 236, 291, + 293, 294, 245, 245, 3, 245, 245, 245, 245, 245, + 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, + 245, 245, 3, 245, 247, 9, 297, 285, 191, 225, + 236, 296, 297, 207, 229, 244, 247, 6, 208, 205, + 181, 289, 206, 214, 215, 23, 228, 295, 301, 302, + 206, 257, 259, 293, 285, 191, 225, 236, 292, 293, + 208, 207, 229, 183, 203, 297, 285, 208, 297, 208, + 225, 208, 215, 289, 205, 183, 300, 181, 206, 204, + 208, 293, 285, 208, 297, 208, 245, 225, 245, 297, + 208, 215, 248, 301, 237, 297, 208, 38, 51, 205, + 238, 247, 183, 183, 206, 253, 254, 253, 206 }; #define yyerrok (yyerrstatus = 0) @@ -2820,7 +2876,7 @@ yyreduce: case 2: /* Line 1806 of yacc.c */ -#line 328 "parser.y" +#line 308 "parser.y" { fix_incomplete(); check_statements((yyvsp[(1) - (1)].stmt_list), FALSE); check_all_user_types((yyvsp[(1) - (1)].stmt_list)); @@ -2838,230 +2894,251 @@ yyreduce: case 3: /* Line 1806 of yacc.c */ -#line 342 "parser.y" +#line 322 "parser.y" { (yyval.stmt_list) = NULL; } break; case 4: /* Line 1806 of yacc.c */ -#line 343 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_reference((yyvsp[(2) - (2)].type))); } +#line 324 "parser.y" + { (yyval.stmt_list) = append_statements((yyvsp[(1) - (5)].stmt_list), (yyvsp[(4) - (5)].stmt_list)); } break; case 5: /* Line 1806 of yacc.c */ -#line 344 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_type_decl((yyvsp[(2) - (2)].type))); } +#line 325 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_reference((yyvsp[(2) - (2)].type))); } break; case 6: /* Line 1806 of yacc.c */ -#line 345 "parser.y" - { (yyval.stmt_list) = (yyvsp[(1) - (3)].stmt_list); - reg_type((yyvsp[(2) - (3)].type), (yyvsp[(2) - (3)].type)->name, 0); - } +#line 326 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_type_decl((yyvsp[(2) - (2)].type))); } break; case 7: /* Line 1806 of yacc.c */ -#line 348 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_type_decl((yyvsp[(2) - (2)].type))); - reg_type((yyvsp[(2) - (2)].type), (yyvsp[(2) - (2)].type)->name, 0); +#line 327 "parser.y" + { (yyval.stmt_list) = (yyvsp[(1) - (3)].stmt_list); + reg_type((yyvsp[(2) - (3)].type), (yyvsp[(2) - (3)].type)->name, 0); } break; case 8: /* Line 1806 of yacc.c */ -#line 351 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_module((yyvsp[(2) - (2)].type))); } - break; - - case 9: - -/* Line 1806 of yacc.c */ -#line 352 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_library((yyvsp[(2) - (2)].typelib))); } - break; - - case 10: - -/* Line 1806 of yacc.c */ -#line 353 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), (yyvsp[(2) - (2)].statement)); } - break; - - case 11: - -/* Line 1806 of yacc.c */ -#line 356 "parser.y" - { (yyval.stmt_list) = NULL; } - break; - - case 12: - -/* Line 1806 of yacc.c */ -#line 357 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_reference((yyvsp[(2) - (2)].type))); } - break; - - case 13: - -/* Line 1806 of yacc.c */ -#line 358 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_type_decl((yyvsp[(2) - (2)].type))); } - break; - - case 14: - -/* Line 1806 of yacc.c */ -#line 359 "parser.y" - { (yyval.stmt_list) = (yyvsp[(1) - (3)].stmt_list); reg_type((yyvsp[(2) - (3)].type), (yyvsp[(2) - (3)].type)->name, 0); } - break; - - case 15: - -/* Line 1806 of yacc.c */ -#line 360 "parser.y" +#line 330 "parser.y" { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_type_decl((yyvsp[(2) - (2)].type))); reg_type((yyvsp[(2) - (2)].type), (yyvsp[(2) - (2)].type)->name, 0); } break; + case 9: + +/* Line 1806 of yacc.c */ +#line 333 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_module((yyvsp[(2) - (2)].type))); } + break; + + case 10: + +/* Line 1806 of yacc.c */ +#line 334 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_library((yyvsp[(2) - (2)].typelib))); } + break; + + case 11: + +/* Line 1806 of yacc.c */ +#line 335 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), (yyvsp[(2) - (2)].statement)); } + break; + + case 12: + +/* Line 1806 of yacc.c */ +#line 338 "parser.y" + { (yyval.stmt_list) = NULL; } + break; + + case 13: + +/* Line 1806 of yacc.c */ +#line 339 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_reference((yyvsp[(2) - (2)].type))); } + break; + + case 14: + +/* Line 1806 of yacc.c */ +#line 341 "parser.y" + { (yyval.stmt_list) = append_statements((yyvsp[(1) - (5)].stmt_list), (yyvsp[(4) - (5)].stmt_list)); } + break; + + case 15: + +/* Line 1806 of yacc.c */ +#line 342 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_type_decl((yyvsp[(2) - (2)].type))); } + break; + case 16: /* Line 1806 of yacc.c */ -#line 363 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_module((yyvsp[(2) - (2)].type))); } +#line 343 "parser.y" + { (yyval.stmt_list) = (yyvsp[(1) - (3)].stmt_list); reg_type((yyvsp[(2) - (3)].type), (yyvsp[(2) - (3)].type)->name, 0); } break; case 17: /* Line 1806 of yacc.c */ -#line 364 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), (yyvsp[(2) - (2)].statement)); } +#line 344 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_type_decl((yyvsp[(2) - (2)].type))); + reg_type((yyvsp[(2) - (2)].type), (yyvsp[(2) - (2)].type)->name, 0); + } break; case 18: /* Line 1806 of yacc.c */ -#line 365 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_importlib((yyvsp[(2) - (2)].str))); } +#line 347 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_module((yyvsp[(2) - (2)].type))); } break; case 19: /* Line 1806 of yacc.c */ -#line 366 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_library((yyvsp[(2) - (2)].typelib))); } +#line 348 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), (yyvsp[(2) - (2)].statement)); } break; case 20: /* Line 1806 of yacc.c */ -#line 369 "parser.y" - { (yyval.stmt_list) = NULL; } +#line 349 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_importlib((yyvsp[(2) - (2)].str))); } break; case 21: /* Line 1806 of yacc.c */ -#line 370 "parser.y" +#line 350 "parser.y" + { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), make_statement_library((yyvsp[(2) - (2)].typelib))); } + break; + + case 22: + +/* Line 1806 of yacc.c */ +#line 353 "parser.y" + { (yyval.stmt_list) = NULL; } + break; + + case 23: + +/* Line 1806 of yacc.c */ +#line 354 "parser.y" { (yyval.stmt_list) = append_statement((yyvsp[(1) - (2)].stmt_list), (yyvsp[(2) - (2)].statement)); } break; - case 24: - -/* Line 1806 of yacc.c */ -#line 378 "parser.y" - { (yyval.statement) = make_statement_cppquote((yyvsp[(1) - (1)].str)); } - break; - - case 25: - -/* Line 1806 of yacc.c */ -#line 379 "parser.y" - { (yyval.statement) = make_statement_type_decl((yyvsp[(1) - (2)].type)); } - break; - case 26: /* Line 1806 of yacc.c */ -#line 380 "parser.y" - { (yyval.statement) = make_statement_declaration((yyvsp[(1) - (2)].var)); } +#line 362 "parser.y" + { (yyval.statement) = make_statement_cppquote((yyvsp[(1) - (1)].str)); } break; case 27: /* Line 1806 of yacc.c */ -#line 381 "parser.y" - { (yyval.statement) = make_statement_import((yyvsp[(1) - (1)].str)); } +#line 363 "parser.y" + { (yyval.statement) = make_statement_type_decl((yyvsp[(1) - (2)].type)); } break; case 28: /* Line 1806 of yacc.c */ -#line 382 "parser.y" - { (yyval.statement) = (yyvsp[(1) - (2)].statement); } +#line 364 "parser.y" + { (yyval.statement) = make_statement_declaration((yyvsp[(1) - (2)].var)); } + break; + + case 29: + +/* Line 1806 of yacc.c */ +#line 365 "parser.y" + { (yyval.statement) = make_statement_import((yyvsp[(1) - (1)].str)); } break; case 30: /* Line 1806 of yacc.c */ -#line 387 "parser.y" +#line 366 "parser.y" + { (yyval.statement) = (yyvsp[(1) - (2)].statement); } + break; + + case 31: + +/* Line 1806 of yacc.c */ +#line 367 "parser.y" + { (yyval.statement) = make_statement_pragma((yyvsp[(1) - (1)].str)); } + break; + + case 33: + +/* Line 1806 of yacc.c */ +#line 372 "parser.y" { (yyval.type) = type_new_enum((yyvsp[(2) - (2)].str), FALSE, NULL); } break; - case 32: - -/* Line 1806 of yacc.c */ -#line 389 "parser.y" - { (yyval.type) = type_new_struct((yyvsp[(2) - (2)].str), FALSE, NULL); } - break; - - case 34: - -/* Line 1806 of yacc.c */ -#line 391 "parser.y" - { (yyval.type) = type_new_nonencapsulated_union((yyvsp[(2) - (2)].str), FALSE, NULL); } - break; - case 35: /* Line 1806 of yacc.c */ -#line 392 "parser.y" - { (yyval.type) = (yyvsp[(2) - (2)].type); (yyval.type)->attrs = check_enum_attrs((yyvsp[(1) - (2)].attr_list)); } - break; - - case 36: - -/* Line 1806 of yacc.c */ -#line 393 "parser.y" - { (yyval.type) = (yyvsp[(2) - (2)].type); (yyval.type)->attrs = check_struct_attrs((yyvsp[(1) - (2)].attr_list)); } +#line 374 "parser.y" + { (yyval.type) = type_new_struct((yyvsp[(2) - (2)].str), FALSE, NULL); } break; case 37: /* Line 1806 of yacc.c */ -#line 394 "parser.y" - { (yyval.type) = (yyvsp[(2) - (2)].type); (yyval.type)->attrs = check_union_attrs((yyvsp[(1) - (2)].attr_list)); } +#line 376 "parser.y" + { (yyval.type) = type_new_nonencapsulated_union((yyvsp[(2) - (2)].str), FALSE, NULL); } break; case 38: /* Line 1806 of yacc.c */ -#line 397 "parser.y" - { (yyval.str) = (yyvsp[(3) - (4)].str); } +#line 377 "parser.y" + { (yyval.type) = (yyvsp[(2) - (2)].type); (yyval.type)->attrs = check_enum_attrs((yyvsp[(1) - (2)].attr_list)); } break; case 39: /* Line 1806 of yacc.c */ -#line 399 "parser.y" +#line 378 "parser.y" + { (yyval.type) = (yyvsp[(2) - (2)].type); (yyval.type)->attrs = check_struct_attrs((yyvsp[(1) - (2)].attr_list)); } + break; + + case 40: + +/* Line 1806 of yacc.c */ +#line 379 "parser.y" + { (yyval.type) = (yyvsp[(2) - (2)].type); (yyval.type)->attrs = check_union_attrs((yyvsp[(1) - (2)].attr_list)); } + break; + + case 41: + +/* Line 1806 of yacc.c */ +#line 382 "parser.y" + { (yyval.str) = (yyvsp[(3) - (4)].str); } + break; + + case 42: + +/* Line 1806 of yacc.c */ +#line 384 "parser.y" { assert(yychar == YYEMPTY); (yyval.import) = xmalloc(sizeof(struct _import_t)); (yyval.import)->name = (yyvsp[(2) - (3)].str); @@ -3070,81 +3147,81 @@ yyreduce: } break; - case 40: + case 43: /* Line 1806 of yacc.c */ -#line 407 "parser.y" +#line 392 "parser.y" { (yyval.str) = (yyvsp[(1) - (3)].import)->name; if ((yyvsp[(1) - (3)].import)->import_performed) pop_import(); free((yyvsp[(1) - (3)].import)); } break; - case 41: + case 44: /* Line 1806 of yacc.c */ -#line 414 "parser.y" +#line 399 "parser.y" { (yyval.str) = (yyvsp[(3) - (5)].str); if(!parse_only) add_importlib((yyvsp[(3) - (5)].str)); } break; - case 42: + case 45: /* Line 1806 of yacc.c */ -#line 417 "parser.y" +#line 402 "parser.y" { (yyval.str) = (yyvsp[(2) - (2)].str); } break; - case 43: + case 46: /* Line 1806 of yacc.c */ -#line 419 "parser.y" +#line 404 "parser.y" { (yyval.typelib) = make_library((yyvsp[(2) - (3)].str), check_library_attrs((yyvsp[(2) - (3)].str), (yyvsp[(1) - (3)].attr_list))); if (!parse_only) start_typelib((yyval.typelib)); } break; - case 44: + case 47: /* Line 1806 of yacc.c */ -#line 424 "parser.y" +#line 409 "parser.y" { (yyval.typelib) = (yyvsp[(1) - (4)].typelib); (yyval.typelib)->stmts = (yyvsp[(2) - (4)].stmt_list); if (!parse_only) end_typelib(); } break; - case 45: - -/* Line 1806 of yacc.c */ -#line 430 "parser.y" - { (yyval.var_list) = NULL; } - break; - - case 47: - -/* Line 1806 of yacc.c */ -#line 434 "parser.y" - { check_arg_attrs((yyvsp[(1) - (1)].var)); (yyval.var_list) = append_var( NULL, (yyvsp[(1) - (1)].var) ); } - break; - case 48: /* Line 1806 of yacc.c */ -#line 435 "parser.y" - { check_arg_attrs((yyvsp[(3) - (3)].var)); (yyval.var_list) = append_var( (yyvsp[(1) - (3)].var_list), (yyvsp[(3) - (3)].var) ); } +#line 415 "parser.y" + { (yyval.var_list) = NULL; } break; case 50: /* Line 1806 of yacc.c */ -#line 439 "parser.y" - { (yyval.var_list) = append_var( (yyvsp[(1) - (3)].var_list), make_var(strdup("...")) ); } +#line 419 "parser.y" + { check_arg_attrs((yyvsp[(1) - (1)].var)); (yyval.var_list) = append_var( NULL, (yyvsp[(1) - (1)].var) ); } break; case 51: /* Line 1806 of yacc.c */ -#line 443 "parser.y" +#line 420 "parser.y" + { check_arg_attrs((yyvsp[(3) - (3)].var)); (yyval.var_list) = append_var( (yyvsp[(1) - (3)].var_list), (yyvsp[(3) - (3)].var) ); } + break; + + case 53: + +/* Line 1806 of yacc.c */ +#line 424 "parser.y" + { (yyval.var_list) = append_var( (yyvsp[(1) - (3)].var_list), make_var(strdup("...")) ); } + break; + + case 54: + +/* Line 1806 of yacc.c */ +#line 428 "parser.y" { if ((yyvsp[(2) - (3)].declspec)->stgclass != STG_NONE && (yyvsp[(2) - (3)].declspec)->stgclass != STG_REGISTER) error_loc("invalid storage class for function parameter\n"); (yyval.var) = declare_var((yyvsp[(1) - (3)].attr_list), (yyvsp[(2) - (3)].declspec), (yyvsp[(3) - (3)].declarator), TRUE); @@ -3152,10 +3229,10 @@ yyreduce: } break; - case 52: + case 55: /* Line 1806 of yacc.c */ -#line 448 "parser.y" +#line 433 "parser.y" { if ((yyvsp[(1) - (2)].declspec)->stgclass != STG_NONE && (yyvsp[(1) - (2)].declspec)->stgclass != STG_REGISTER) error_loc("invalid storage class for function parameter\n"); (yyval.var) = declare_var(NULL, (yyvsp[(1) - (2)].declspec), (yyvsp[(2) - (2)].declarator), TRUE); @@ -3163,873 +3240,880 @@ yyreduce: } break; - case 53: + case 56: /* Line 1806 of yacc.c */ -#line 455 "parser.y" +#line 440 "parser.y" { (yyval.expr) = (yyvsp[(2) - (3)].expr); if (!(yyval.expr)->is_const) error_loc("array dimension is not an integer constant\n"); } break; - case 54: + case 57: /* Line 1806 of yacc.c */ -#line 459 "parser.y" +#line 444 "parser.y" { (yyval.expr) = make_expr(EXPR_VOID); } break; - case 55: - -/* Line 1806 of yacc.c */ -#line 460 "parser.y" - { (yyval.expr) = make_expr(EXPR_VOID); } - break; - - case 56: - -/* Line 1806 of yacc.c */ -#line 463 "parser.y" - { (yyval.attr_list) = NULL; } - break; - case 58: /* Line 1806 of yacc.c */ -#line 468 "parser.y" - { (yyval.attr_list) = (yyvsp[(2) - (3)].attr_list); } +#line 445 "parser.y" + { (yyval.expr) = make_expr(EXPR_VOID); } break; case 59: /* Line 1806 of yacc.c */ -#line 471 "parser.y" - { (yyval.attr_list) = append_attr( NULL, (yyvsp[(1) - (1)].attr) ); } - break; - - case 60: - -/* Line 1806 of yacc.c */ -#line 472 "parser.y" - { (yyval.attr_list) = append_attr( (yyvsp[(1) - (3)].attr_list), (yyvsp[(3) - (3)].attr) ); } +#line 448 "parser.y" + { (yyval.attr_list) = NULL; } break; case 61: /* Line 1806 of yacc.c */ -#line 473 "parser.y" - { (yyval.attr_list) = append_attr( (yyvsp[(1) - (4)].attr_list), (yyvsp[(4) - (4)].attr) ); } +#line 453 "parser.y" + { (yyval.attr_list) = (yyvsp[(2) - (3)].attr_list); } break; case 62: /* Line 1806 of yacc.c */ -#line 476 "parser.y" - { (yyval.str_list) = append_str( NULL, (yyvsp[(1) - (1)].str) ); } +#line 456 "parser.y" + { (yyval.attr_list) = append_attr( NULL, (yyvsp[(1) - (1)].attr) ); } break; case 63: /* Line 1806 of yacc.c */ -#line 477 "parser.y" - { (yyval.str_list) = append_str( (yyvsp[(1) - (3)].str_list), (yyvsp[(3) - (3)].str) ); } +#line 457 "parser.y" + { (yyval.attr_list) = append_attr( (yyvsp[(1) - (3)].attr_list), (yyvsp[(3) - (3)].attr) ); } break; case 64: /* Line 1806 of yacc.c */ -#line 480 "parser.y" - { (yyval.attr) = NULL; } +#line 458 "parser.y" + { (yyval.attr_list) = append_attr( (yyvsp[(1) - (4)].attr_list), (yyvsp[(4) - (4)].attr) ); } break; case 65: /* Line 1806 of yacc.c */ -#line 481 "parser.y" - { (yyval.attr) = make_attr(ATTR_AGGREGATABLE); } +#line 461 "parser.y" + { (yyval.str_list) = append_str( NULL, (yyvsp[(1) - (1)].str) ); } break; case 66: /* Line 1806 of yacc.c */ -#line 482 "parser.y" - { (yyval.attr) = make_attrp(ATTR_ANNOTATION, (yyvsp[(3) - (4)].str)); } +#line 462 "parser.y" + { (yyval.str_list) = append_str( (yyvsp[(1) - (3)].str_list), (yyvsp[(3) - (3)].str) ); } break; case 67: /* Line 1806 of yacc.c */ -#line 483 "parser.y" - { (yyval.attr) = make_attr(ATTR_APPOBJECT); } +#line 465 "parser.y" + { (yyval.attr) = NULL; } break; case 68: /* Line 1806 of yacc.c */ -#line 484 "parser.y" - { (yyval.attr) = make_attr(ATTR_ASYNC); } +#line 466 "parser.y" + { (yyval.attr) = make_attr(ATTR_AGGREGATABLE); } break; case 69: /* Line 1806 of yacc.c */ -#line 485 "parser.y" - { (yyval.attr) = make_attr(ATTR_AUTO_HANDLE); } +#line 467 "parser.y" + { (yyval.attr) = make_attrp(ATTR_ANNOTATION, (yyvsp[(3) - (4)].str)); } break; case 70: /* Line 1806 of yacc.c */ -#line 486 "parser.y" - { (yyval.attr) = make_attr(ATTR_BINDABLE); } +#line 468 "parser.y" + { (yyval.attr) = make_attr(ATTR_APPOBJECT); } break; case 71: /* Line 1806 of yacc.c */ -#line 487 "parser.y" - { (yyval.attr) = make_attr(ATTR_BROADCAST); } +#line 469 "parser.y" + { (yyval.attr) = make_attr(ATTR_ASYNC); } break; case 72: /* Line 1806 of yacc.c */ -#line 488 "parser.y" - { (yyval.attr) = make_attrp(ATTR_CALLAS, (yyvsp[(3) - (4)].var)); } +#line 470 "parser.y" + { (yyval.attr) = make_attr(ATTR_AUTO_HANDLE); } break; case 73: /* Line 1806 of yacc.c */ -#line 489 "parser.y" - { (yyval.attr) = make_attrp(ATTR_CASE, (yyvsp[(3) - (4)].expr_list)); } +#line 471 "parser.y" + { (yyval.attr) = make_attr(ATTR_BINDABLE); } break; case 74: /* Line 1806 of yacc.c */ -#line 490 "parser.y" - { (yyval.attr) = make_attr(ATTR_CODE); } +#line 472 "parser.y" + { (yyval.attr) = make_attr(ATTR_BROADCAST); } break; case 75: /* Line 1806 of yacc.c */ -#line 491 "parser.y" - { (yyval.attr) = make_attr(ATTR_COMMSTATUS); } +#line 473 "parser.y" + { (yyval.attr) = make_attrp(ATTR_CALLAS, (yyvsp[(3) - (4)].var)); } break; case 76: /* Line 1806 of yacc.c */ -#line 492 "parser.y" - { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); } +#line 474 "parser.y" + { (yyval.attr) = make_attrp(ATTR_CASE, (yyvsp[(3) - (4)].expr_list)); } break; case 77: /* Line 1806 of yacc.c */ -#line 493 "parser.y" - { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ } +#line 475 "parser.y" + { (yyval.attr) = make_attr(ATTR_CODE); } break; case 78: /* Line 1806 of yacc.c */ -#line 494 "parser.y" - { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ } +#line 476 "parser.y" + { (yyval.attr) = make_attr(ATTR_COMMSTATUS); } break; case 79: /* Line 1806 of yacc.c */ -#line 495 "parser.y" - { (yyval.attr) = make_attr(ATTR_CONTROL); } +#line 477 "parser.y" + { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); } break; case 80: /* Line 1806 of yacc.c */ -#line 496 "parser.y" - { (yyval.attr) = make_attr(ATTR_DECODE); } +#line 478 "parser.y" + { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ } break; case 81: /* Line 1806 of yacc.c */ -#line 497 "parser.y" - { (yyval.attr) = make_attr(ATTR_DEFAULT); } +#line 479 "parser.y" + { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ } break; case 82: /* Line 1806 of yacc.c */ -#line 498 "parser.y" - { (yyval.attr) = make_attr(ATTR_DEFAULTBIND); } +#line 480 "parser.y" + { (yyval.attr) = make_attr(ATTR_CONTROL); } break; case 83: /* Line 1806 of yacc.c */ -#line 499 "parser.y" - { (yyval.attr) = make_attr(ATTR_DEFAULTCOLLELEM); } +#line 481 "parser.y" + { (yyval.attr) = make_attr(ATTR_DECODE); } break; case 84: /* Line 1806 of yacc.c */ -#line 500 "parser.y" - { (yyval.attr) = make_attrp(ATTR_DEFAULTVALUE, (yyvsp[(3) - (4)].expr)); } +#line 482 "parser.y" + { (yyval.attr) = make_attr(ATTR_DEFAULT); } break; case 85: /* Line 1806 of yacc.c */ -#line 501 "parser.y" - { (yyval.attr) = make_attr(ATTR_DEFAULTVTABLE); } +#line 483 "parser.y" + { (yyval.attr) = make_attr(ATTR_DEFAULTBIND); } break; case 86: /* Line 1806 of yacc.c */ -#line 502 "parser.y" - { (yyval.attr) = make_attr(ATTR_DISABLECONSISTENCYCHECK); } +#line 484 "parser.y" + { (yyval.attr) = make_attr(ATTR_DEFAULTCOLLELEM); } break; case 87: /* Line 1806 of yacc.c */ -#line 503 "parser.y" - { (yyval.attr) = make_attr(ATTR_DISPLAYBIND); } +#line 485 "parser.y" + { (yyval.attr) = make_attrp(ATTR_DEFAULTVALUE, (yyvsp[(3) - (4)].expr)); } break; case 88: /* Line 1806 of yacc.c */ -#line 504 "parser.y" - { (yyval.attr) = make_attrp(ATTR_DLLNAME, (yyvsp[(3) - (4)].str)); } +#line 486 "parser.y" + { (yyval.attr) = make_attr(ATTR_DEFAULTVTABLE); } break; case 89: /* Line 1806 of yacc.c */ -#line 505 "parser.y" - { (yyval.attr) = make_attr(ATTR_DUAL); } +#line 487 "parser.y" + { (yyval.attr) = make_attr(ATTR_DISABLECONSISTENCYCHECK); } break; case 90: /* Line 1806 of yacc.c */ -#line 506 "parser.y" - { (yyval.attr) = make_attr(ATTR_ENABLEALLOCATE); } +#line 488 "parser.y" + { (yyval.attr) = make_attr(ATTR_DISPLAYBIND); } break; case 91: /* Line 1806 of yacc.c */ -#line 507 "parser.y" - { (yyval.attr) = make_attr(ATTR_ENCODE); } +#line 489 "parser.y" + { (yyval.attr) = make_attrp(ATTR_DLLNAME, (yyvsp[(3) - (4)].str)); } break; case 92: /* Line 1806 of yacc.c */ -#line 508 "parser.y" - { (yyval.attr) = make_attrp(ATTR_ENDPOINT, (yyvsp[(3) - (4)].str_list)); } +#line 490 "parser.y" + { (yyval.attr) = make_attr(ATTR_DUAL); } break; case 93: /* Line 1806 of yacc.c */ -#line 509 "parser.y" - { (yyval.attr) = make_attrp(ATTR_ENTRY, (yyvsp[(3) - (4)].expr)); } +#line 491 "parser.y" + { (yyval.attr) = make_attr(ATTR_ENABLEALLOCATE); } break; case 94: /* Line 1806 of yacc.c */ -#line 510 "parser.y" - { (yyval.attr) = make_attr(ATTR_EXPLICIT_HANDLE); } +#line 492 "parser.y" + { (yyval.attr) = make_attr(ATTR_ENCODE); } break; case 95: /* Line 1806 of yacc.c */ -#line 511 "parser.y" - { (yyval.attr) = make_attr(ATTR_FAULTSTATUS); } +#line 493 "parser.y" + { (yyval.attr) = make_attrp(ATTR_ENDPOINT, (yyvsp[(3) - (4)].str_list)); } break; case 96: /* Line 1806 of yacc.c */ -#line 512 "parser.y" - { (yyval.attr) = make_attr(ATTR_FORCEALLOCATE); } +#line 494 "parser.y" + { (yyval.attr) = make_attrp(ATTR_ENTRY, (yyvsp[(3) - (4)].expr)); } break; case 97: /* Line 1806 of yacc.c */ -#line 513 "parser.y" - { (yyval.attr) = make_attr(ATTR_HANDLE); } +#line 495 "parser.y" + { (yyval.attr) = make_attr(ATTR_EXPLICIT_HANDLE); } break; case 98: /* Line 1806 of yacc.c */ -#line 514 "parser.y" - { (yyval.attr) = make_attrp(ATTR_HELPCONTEXT, (yyvsp[(3) - (4)].expr)); } +#line 496 "parser.y" + { (yyval.attr) = make_attr(ATTR_FAULTSTATUS); } break; case 99: /* Line 1806 of yacc.c */ -#line 515 "parser.y" - { (yyval.attr) = make_attrp(ATTR_HELPFILE, (yyvsp[(3) - (4)].str)); } +#line 497 "parser.y" + { (yyval.attr) = make_attr(ATTR_FORCEALLOCATE); } break; case 100: /* Line 1806 of yacc.c */ -#line 516 "parser.y" - { (yyval.attr) = make_attrp(ATTR_HELPSTRING, (yyvsp[(3) - (4)].str)); } +#line 498 "parser.y" + { (yyval.attr) = make_attr(ATTR_HANDLE); } break; case 101: /* Line 1806 of yacc.c */ -#line 517 "parser.y" - { (yyval.attr) = make_attrp(ATTR_HELPSTRINGCONTEXT, (yyvsp[(3) - (4)].expr)); } +#line 499 "parser.y" + { (yyval.attr) = make_attrp(ATTR_HELPCONTEXT, (yyvsp[(3) - (4)].expr)); } break; case 102: /* Line 1806 of yacc.c */ -#line 518 "parser.y" - { (yyval.attr) = make_attrp(ATTR_HELPSTRINGDLL, (yyvsp[(3) - (4)].str)); } +#line 500 "parser.y" + { (yyval.attr) = make_attrp(ATTR_HELPFILE, (yyvsp[(3) - (4)].str)); } break; case 103: /* Line 1806 of yacc.c */ -#line 519 "parser.y" - { (yyval.attr) = make_attr(ATTR_HIDDEN); } +#line 501 "parser.y" + { (yyval.attr) = make_attrp(ATTR_HELPSTRING, (yyvsp[(3) - (4)].str)); } break; case 104: /* Line 1806 of yacc.c */ -#line 520 "parser.y" - { (yyval.attr) = make_attrp(ATTR_ID, (yyvsp[(3) - (4)].expr)); } +#line 502 "parser.y" + { (yyval.attr) = make_attrp(ATTR_HELPSTRINGCONTEXT, (yyvsp[(3) - (4)].expr)); } break; case 105: /* Line 1806 of yacc.c */ -#line 521 "parser.y" - { (yyval.attr) = make_attr(ATTR_IDEMPOTENT); } +#line 503 "parser.y" + { (yyval.attr) = make_attrp(ATTR_HELPSTRINGDLL, (yyvsp[(3) - (4)].str)); } break; case 106: /* Line 1806 of yacc.c */ -#line 522 "parser.y" - { (yyval.attr) = make_attr(ATTR_IGNORE); } +#line 504 "parser.y" + { (yyval.attr) = make_attr(ATTR_HIDDEN); } break; case 107: /* Line 1806 of yacc.c */ -#line 523 "parser.y" - { (yyval.attr) = make_attrp(ATTR_IIDIS, (yyvsp[(3) - (4)].expr)); } +#line 505 "parser.y" + { (yyval.attr) = make_attrp(ATTR_ID, (yyvsp[(3) - (4)].expr)); } break; case 108: /* Line 1806 of yacc.c */ -#line 524 "parser.y" - { (yyval.attr) = make_attr(ATTR_IMMEDIATEBIND); } +#line 506 "parser.y" + { (yyval.attr) = make_attr(ATTR_IDEMPOTENT); } break; case 109: /* Line 1806 of yacc.c */ -#line 525 "parser.y" - { (yyval.attr) = make_attrp(ATTR_IMPLICIT_HANDLE, (yyvsp[(3) - (4)].var)); } +#line 507 "parser.y" + { (yyval.attr) = make_attr(ATTR_IGNORE); } break; case 110: /* Line 1806 of yacc.c */ -#line 526 "parser.y" - { (yyval.attr) = make_attr(ATTR_IN); } +#line 508 "parser.y" + { (yyval.attr) = make_attrp(ATTR_IIDIS, (yyvsp[(3) - (4)].expr)); } break; case 111: /* Line 1806 of yacc.c */ -#line 527 "parser.y" - { (yyval.attr) = make_attr(ATTR_INPUTSYNC); } +#line 509 "parser.y" + { (yyval.attr) = make_attr(ATTR_IMMEDIATEBIND); } break; case 112: /* Line 1806 of yacc.c */ -#line 528 "parser.y" - { (yyval.attr) = make_attrp(ATTR_LENGTHIS, (yyvsp[(3) - (4)].expr_list)); } +#line 510 "parser.y" + { (yyval.attr) = make_attrp(ATTR_IMPLICIT_HANDLE, (yyvsp[(3) - (4)].var)); } break; case 113: /* Line 1806 of yacc.c */ -#line 529 "parser.y" - { (yyval.attr) = make_attrp(ATTR_LIBLCID, (yyvsp[(3) - (4)].expr)); } +#line 511 "parser.y" + { (yyval.attr) = make_attr(ATTR_IN); } break; case 114: /* Line 1806 of yacc.c */ -#line 530 "parser.y" - { (yyval.attr) = make_attr(ATTR_PARAMLCID); } +#line 512 "parser.y" + { (yyval.attr) = make_attr(ATTR_INPUTSYNC); } break; case 115: /* Line 1806 of yacc.c */ -#line 531 "parser.y" - { (yyval.attr) = make_attr(ATTR_LICENSED); } +#line 513 "parser.y" + { (yyval.attr) = make_attrp(ATTR_LENGTHIS, (yyvsp[(3) - (4)].expr_list)); } break; case 116: /* Line 1806 of yacc.c */ -#line 532 "parser.y" - { (yyval.attr) = make_attr(ATTR_LOCAL); } +#line 514 "parser.y" + { (yyval.attr) = make_attrp(ATTR_LIBLCID, (yyvsp[(3) - (4)].expr)); } break; case 117: /* Line 1806 of yacc.c */ -#line 533 "parser.y" - { (yyval.attr) = make_attr(ATTR_MAYBE); } +#line 515 "parser.y" + { (yyval.attr) = make_attr(ATTR_PARAMLCID); } break; case 118: /* Line 1806 of yacc.c */ -#line 534 "parser.y" - { (yyval.attr) = make_attr(ATTR_MESSAGE); } +#line 516 "parser.y" + { (yyval.attr) = make_attr(ATTR_LICENSED); } break; case 119: /* Line 1806 of yacc.c */ -#line 535 "parser.y" - { (yyval.attr) = make_attr(ATTR_NOCODE); } +#line 517 "parser.y" + { (yyval.attr) = make_attr(ATTR_LOCAL); } break; case 120: /* Line 1806 of yacc.c */ -#line 536 "parser.y" - { (yyval.attr) = make_attr(ATTR_NONBROWSABLE); } +#line 518 "parser.y" + { (yyval.attr) = make_attr(ATTR_MAYBE); } break; case 121: /* Line 1806 of yacc.c */ -#line 537 "parser.y" - { (yyval.attr) = make_attr(ATTR_NONCREATABLE); } +#line 519 "parser.y" + { (yyval.attr) = make_attr(ATTR_MESSAGE); } break; case 122: /* Line 1806 of yacc.c */ -#line 538 "parser.y" - { (yyval.attr) = make_attr(ATTR_NONEXTENSIBLE); } +#line 520 "parser.y" + { (yyval.attr) = make_attr(ATTR_NOCODE); } break; case 123: /* Line 1806 of yacc.c */ -#line 539 "parser.y" - { (yyval.attr) = make_attr(ATTR_NOTIFY); } +#line 521 "parser.y" + { (yyval.attr) = make_attr(ATTR_NONBROWSABLE); } break; case 124: /* Line 1806 of yacc.c */ -#line 540 "parser.y" - { (yyval.attr) = make_attr(ATTR_NOTIFYFLAG); } +#line 522 "parser.y" + { (yyval.attr) = make_attr(ATTR_NONCREATABLE); } break; case 125: /* Line 1806 of yacc.c */ -#line 541 "parser.y" - { (yyval.attr) = make_attr(ATTR_OBJECT); } +#line 523 "parser.y" + { (yyval.attr) = make_attr(ATTR_NONEXTENSIBLE); } break; case 126: /* Line 1806 of yacc.c */ -#line 542 "parser.y" - { (yyval.attr) = make_attr(ATTR_ODL); } +#line 524 "parser.y" + { (yyval.attr) = make_attr(ATTR_NOTIFY); } break; case 127: /* Line 1806 of yacc.c */ -#line 543 "parser.y" - { (yyval.attr) = make_attr(ATTR_OLEAUTOMATION); } +#line 525 "parser.y" + { (yyval.attr) = make_attr(ATTR_NOTIFYFLAG); } break; case 128: /* Line 1806 of yacc.c */ -#line 544 "parser.y" - { (yyval.attr) = make_attrp(ATTR_OPTIMIZE, (yyvsp[(3) - (4)].str)); } +#line 526 "parser.y" + { (yyval.attr) = make_attr(ATTR_OBJECT); } break; case 129: /* Line 1806 of yacc.c */ -#line 545 "parser.y" - { (yyval.attr) = make_attr(ATTR_OPTIONAL); } +#line 527 "parser.y" + { (yyval.attr) = make_attr(ATTR_ODL); } break; case 130: /* Line 1806 of yacc.c */ -#line 546 "parser.y" - { (yyval.attr) = make_attr(ATTR_OUT); } +#line 528 "parser.y" + { (yyval.attr) = make_attr(ATTR_OLEAUTOMATION); } break; case 131: /* Line 1806 of yacc.c */ -#line 547 "parser.y" - { (yyval.attr) = make_attr(ATTR_PARTIALIGNORE); } +#line 529 "parser.y" + { (yyval.attr) = make_attrp(ATTR_OPTIMIZE, (yyvsp[(3) - (4)].str)); } break; case 132: /* Line 1806 of yacc.c */ -#line 548 "parser.y" - { (yyval.attr) = make_attrv(ATTR_POINTERDEFAULT, (yyvsp[(3) - (4)].num)); } +#line 530 "parser.y" + { (yyval.attr) = make_attr(ATTR_OPTIONAL); } break; case 133: /* Line 1806 of yacc.c */ -#line 549 "parser.y" - { (yyval.attr) = make_attrp(ATTR_PROGID, (yyvsp[(3) - (4)].str)); } +#line 531 "parser.y" + { (yyval.attr) = make_attr(ATTR_OUT); } break; case 134: /* Line 1806 of yacc.c */ -#line 550 "parser.y" - { (yyval.attr) = make_attr(ATTR_PROPGET); } +#line 532 "parser.y" + { (yyval.attr) = make_attr(ATTR_PARTIALIGNORE); } break; case 135: /* Line 1806 of yacc.c */ -#line 551 "parser.y" - { (yyval.attr) = make_attr(ATTR_PROPPUT); } +#line 533 "parser.y" + { (yyval.attr) = make_attrv(ATTR_POINTERDEFAULT, (yyvsp[(3) - (4)].num)); } break; case 136: /* Line 1806 of yacc.c */ -#line 552 "parser.y" - { (yyval.attr) = make_attr(ATTR_PROPPUTREF); } +#line 534 "parser.y" + { (yyval.attr) = make_attrp(ATTR_PROGID, (yyvsp[(3) - (4)].str)); } break; case 137: /* Line 1806 of yacc.c */ -#line 553 "parser.y" - { (yyval.attr) = make_attr(ATTR_PROXY); } +#line 535 "parser.y" + { (yyval.attr) = make_attr(ATTR_PROPGET); } break; case 138: /* Line 1806 of yacc.c */ -#line 554 "parser.y" - { (yyval.attr) = make_attr(ATTR_PUBLIC); } +#line 536 "parser.y" + { (yyval.attr) = make_attr(ATTR_PROPPUT); } break; case 139: /* Line 1806 of yacc.c */ -#line 556 "parser.y" - { expr_list_t *list = append_expr( NULL, (yyvsp[(3) - (6)].expr) ); - list = append_expr( list, (yyvsp[(5) - (6)].expr) ); - (yyval.attr) = make_attrp(ATTR_RANGE, list); } +#line 537 "parser.y" + { (yyval.attr) = make_attr(ATTR_PROPPUTREF); } break; case 140: /* Line 1806 of yacc.c */ -#line 559 "parser.y" - { (yyval.attr) = make_attr(ATTR_READONLY); } +#line 538 "parser.y" + { (yyval.attr) = make_attr(ATTR_PROXY); } break; case 141: /* Line 1806 of yacc.c */ -#line 560 "parser.y" - { (yyval.attr) = make_attrp(ATTR_REPRESENTAS, (yyvsp[(3) - (4)].type)); } +#line 539 "parser.y" + { (yyval.attr) = make_attr(ATTR_PUBLIC); } break; case 142: /* Line 1806 of yacc.c */ -#line 561 "parser.y" - { (yyval.attr) = make_attr(ATTR_REQUESTEDIT); } +#line 541 "parser.y" + { expr_list_t *list = append_expr( NULL, (yyvsp[(3) - (6)].expr) ); + list = append_expr( list, (yyvsp[(5) - (6)].expr) ); + (yyval.attr) = make_attrp(ATTR_RANGE, list); } break; case 143: /* Line 1806 of yacc.c */ -#line 562 "parser.y" - { (yyval.attr) = make_attr(ATTR_RESTRICTED); } +#line 544 "parser.y" + { (yyval.attr) = make_attr(ATTR_READONLY); } break; case 144: /* Line 1806 of yacc.c */ -#line 563 "parser.y" - { (yyval.attr) = make_attr(ATTR_RETVAL); } +#line 545 "parser.y" + { (yyval.attr) = make_attrp(ATTR_REPRESENTAS, (yyvsp[(3) - (4)].type)); } break; case 145: /* Line 1806 of yacc.c */ -#line 564 "parser.y" - { (yyval.attr) = make_attrp(ATTR_SIZEIS, (yyvsp[(3) - (4)].expr_list)); } +#line 546 "parser.y" + { (yyval.attr) = make_attr(ATTR_REQUESTEDIT); } break; case 146: /* Line 1806 of yacc.c */ -#line 565 "parser.y" - { (yyval.attr) = make_attr(ATTR_SOURCE); } +#line 547 "parser.y" + { (yyval.attr) = make_attr(ATTR_RESTRICTED); } break; case 147: /* Line 1806 of yacc.c */ -#line 566 "parser.y" - { (yyval.attr) = make_attr(ATTR_STRICTCONTEXTHANDLE); } +#line 548 "parser.y" + { (yyval.attr) = make_attr(ATTR_RETVAL); } break; case 148: /* Line 1806 of yacc.c */ -#line 567 "parser.y" - { (yyval.attr) = make_attr(ATTR_STRING); } +#line 549 "parser.y" + { (yyval.attr) = make_attrp(ATTR_SIZEIS, (yyvsp[(3) - (4)].expr_list)); } break; case 149: /* Line 1806 of yacc.c */ -#line 568 "parser.y" - { (yyval.attr) = make_attrp(ATTR_SWITCHIS, (yyvsp[(3) - (4)].expr)); } +#line 550 "parser.y" + { (yyval.attr) = make_attr(ATTR_SOURCE); } break; case 150: /* Line 1806 of yacc.c */ -#line 569 "parser.y" - { (yyval.attr) = make_attrp(ATTR_SWITCHTYPE, (yyvsp[(3) - (4)].type)); } +#line 551 "parser.y" + { (yyval.attr) = make_attr(ATTR_STRICTCONTEXTHANDLE); } break; case 151: /* Line 1806 of yacc.c */ -#line 570 "parser.y" - { (yyval.attr) = make_attrp(ATTR_TRANSMITAS, (yyvsp[(3) - (4)].type)); } +#line 552 "parser.y" + { (yyval.attr) = make_attr(ATTR_STRING); } break; case 152: /* Line 1806 of yacc.c */ -#line 571 "parser.y" - { (yyval.attr) = make_attrv(ATTR_THREADING, (yyvsp[(3) - (4)].num)); } +#line 553 "parser.y" + { (yyval.attr) = make_attrp(ATTR_SWITCHIS, (yyvsp[(3) - (4)].expr)); } break; case 153: /* Line 1806 of yacc.c */ -#line 572 "parser.y" - { (yyval.attr) = make_attr(ATTR_UIDEFAULT); } +#line 554 "parser.y" + { (yyval.attr) = make_attrp(ATTR_SWITCHTYPE, (yyvsp[(3) - (4)].type)); } break; case 154: /* Line 1806 of yacc.c */ -#line 573 "parser.y" - { (yyval.attr) = make_attr(ATTR_USESGETLASTERROR); } +#line 555 "parser.y" + { (yyval.attr) = make_attrp(ATTR_TRANSMITAS, (yyvsp[(3) - (4)].type)); } break; case 155: /* Line 1806 of yacc.c */ -#line 574 "parser.y" - { (yyval.attr) = make_attrp(ATTR_USERMARSHAL, (yyvsp[(3) - (4)].type)); } +#line 556 "parser.y" + { (yyval.attr) = make_attrv(ATTR_THREADING, (yyvsp[(3) - (4)].num)); } break; case 156: /* Line 1806 of yacc.c */ -#line 575 "parser.y" - { (yyval.attr) = make_attrp(ATTR_UUID, (yyvsp[(3) - (4)].uuid)); } +#line 557 "parser.y" + { (yyval.attr) = make_attr(ATTR_UIDEFAULT); } break; case 157: /* Line 1806 of yacc.c */ -#line 576 "parser.y" - { (yyval.attr) = make_attr(ATTR_V1ENUM); } +#line 558 "parser.y" + { (yyval.attr) = make_attr(ATTR_USESGETLASTERROR); } break; case 158: /* Line 1806 of yacc.c */ -#line 577 "parser.y" - { (yyval.attr) = make_attr(ATTR_VARARG); } +#line 559 "parser.y" + { (yyval.attr) = make_attrp(ATTR_USERMARSHAL, (yyvsp[(3) - (4)].type)); } break; case 159: /* Line 1806 of yacc.c */ -#line 578 "parser.y" - { (yyval.attr) = make_attrv(ATTR_VERSION, (yyvsp[(3) - (4)].num)); } +#line 560 "parser.y" + { (yyval.attr) = make_attrp(ATTR_UUID, (yyvsp[(3) - (4)].uuid)); } break; case 160: /* Line 1806 of yacc.c */ -#line 579 "parser.y" - { (yyval.attr) = make_attrp(ATTR_VIPROGID, (yyvsp[(3) - (4)].str)); } +#line 561 "parser.y" + { (yyval.attr) = make_attrp(ATTR_ASYNCUUID, (yyvsp[(3) - (4)].uuid)); } break; case 161: /* Line 1806 of yacc.c */ -#line 580 "parser.y" - { (yyval.attr) = make_attrp(ATTR_WIREMARSHAL, (yyvsp[(3) - (4)].type)); } +#line 562 "parser.y" + { (yyval.attr) = make_attr(ATTR_V1ENUM); } break; case 162: /* Line 1806 of yacc.c */ -#line 581 "parser.y" - { (yyval.attr) = make_attrv(ATTR_POINTERTYPE, (yyvsp[(1) - (1)].num)); } +#line 563 "parser.y" + { (yyval.attr) = make_attr(ATTR_VARARG); } + break; + + case 163: + +/* Line 1806 of yacc.c */ +#line 564 "parser.y" + { (yyval.attr) = make_attrv(ATTR_VERSION, (yyvsp[(3) - (4)].num)); } break; case 164: /* Line 1806 of yacc.c */ -#line 586 "parser.y" - { if (!is_valid_uuid((yyvsp[(1) - (1)].str))) - error_loc("invalid UUID: %s\n", (yyvsp[(1) - (1)].str)); - (yyval.uuid) = parse_uuid((yyvsp[(1) - (1)].str)); } +#line 565 "parser.y" + { (yyval.attr) = make_attrp(ATTR_VIPROGID, (yyvsp[(3) - (4)].str)); } break; case 165: /* Line 1806 of yacc.c */ -#line 591 "parser.y" - { (yyval.str) = xstrdup("__cdecl"); } +#line 566 "parser.y" + { (yyval.attr) = make_attrp(ATTR_WIREMARSHAL, (yyvsp[(3) - (4)].type)); } break; case 166: /* Line 1806 of yacc.c */ -#line 592 "parser.y" - { (yyval.str) = xstrdup("__fastcall"); } - break; - - case 167: - -/* Line 1806 of yacc.c */ -#line 593 "parser.y" - { (yyval.str) = xstrdup("__pascal"); } +#line 567 "parser.y" + { (yyval.attr) = make_attrv(ATTR_POINTERTYPE, (yyvsp[(1) - (1)].num)); } break; case 168: /* Line 1806 of yacc.c */ -#line 594 "parser.y" - { (yyval.str) = xstrdup("__stdcall"); } +#line 572 "parser.y" + { if (!is_valid_uuid((yyvsp[(1) - (1)].str))) + error_loc("invalid UUID: %s\n", (yyvsp[(1) - (1)].str)); + (yyval.uuid) = parse_uuid((yyvsp[(1) - (1)].str)); } break; case 169: /* Line 1806 of yacc.c */ -#line 597 "parser.y" - { (yyval.var_list) = NULL; } +#line 577 "parser.y" + { (yyval.str) = xstrdup("__cdecl"); } break; case 170: /* Line 1806 of yacc.c */ -#line 598 "parser.y" - { (yyval.var_list) = append_var( (yyvsp[(1) - (2)].var_list), (yyvsp[(2) - (2)].var) ); } +#line 578 "parser.y" + { (yyval.str) = xstrdup("__fastcall"); } break; case 171: /* Line 1806 of yacc.c */ -#line 601 "parser.y" - { attr_t *a = make_attrp(ATTR_CASE, append_expr( NULL, (yyvsp[(2) - (4)].expr) )); - (yyval.var) = (yyvsp[(4) - (4)].var); if (!(yyval.var)) (yyval.var) = make_var(NULL); - (yyval.var)->attrs = append_attr( (yyval.var)->attrs, a ); - } +#line 579 "parser.y" + { (yyval.str) = xstrdup("__pascal"); } break; case 172: /* Line 1806 of yacc.c */ -#line 605 "parser.y" - { attr_t *a = make_attr(ATTR_DEFAULT); - (yyval.var) = (yyvsp[(3) - (3)].var); if (!(yyval.var)) (yyval.var) = make_var(NULL); - (yyval.var)->attrs = append_attr( (yyval.var)->attrs, a ); - } +#line 580 "parser.y" + { (yyval.str) = xstrdup("__stdcall"); } break; case 173: /* Line 1806 of yacc.c */ -#line 611 "parser.y" +#line 583 "parser.y" { (yyval.var_list) = NULL; } break; case 174: /* Line 1806 of yacc.c */ -#line 612 "parser.y" - { (yyval.var_list) = (yyvsp[(1) - (2)].var_list); } +#line 584 "parser.y" + { (yyval.var_list) = append_var( (yyvsp[(1) - (2)].var_list), (yyvsp[(2) - (2)].var) ); } + break; + + case 175: + +/* Line 1806 of yacc.c */ +#line 587 "parser.y" + { attr_t *a = make_attrp(ATTR_CASE, append_expr( NULL, (yyvsp[(2) - (4)].expr) )); + (yyval.var) = (yyvsp[(4) - (4)].var); if (!(yyval.var)) (yyval.var) = make_var(NULL); + (yyval.var)->attrs = append_attr( (yyval.var)->attrs, a ); + } break; case 176: /* Line 1806 of yacc.c */ -#line 616 "parser.y" - { if (!(yyvsp[(1) - (1)].var)->eval) - (yyvsp[(1) - (1)].var)->eval = make_exprl(EXPR_NUM, 0 /* default for first enum entry */); - (yyval.var_list) = append_var( NULL, (yyvsp[(1) - (1)].var) ); +#line 591 "parser.y" + { attr_t *a = make_attr(ATTR_DEFAULT); + (yyval.var) = (yyvsp[(3) - (3)].var); if (!(yyval.var)) (yyval.var) = make_var(NULL); + (yyval.var)->attrs = append_attr( (yyval.var)->attrs, a ); } break; case 177: /* Line 1806 of yacc.c */ -#line 620 "parser.y" +#line 597 "parser.y" + { (yyval.var_list) = NULL; } + break; + + case 178: + +/* Line 1806 of yacc.c */ +#line 598 "parser.y" + { (yyval.var_list) = (yyvsp[(1) - (2)].var_list); } + break; + + case 180: + +/* Line 1806 of yacc.c */ +#line 602 "parser.y" + { if (!(yyvsp[(1) - (1)].var)->eval) + (yyvsp[(1) - (1)].var)->eval = make_exprl(EXPR_NUM, 0 /* default for first enum entry */); + (yyval.var_list) = append_var( NULL, (yyvsp[(1) - (1)].var) ); + } + break; + + case 181: + +/* Line 1806 of yacc.c */ +#line 606 "parser.y" { if (!(yyvsp[(3) - (3)].var)->eval) { var_t *last = LIST_ENTRY( list_tail((yyval.var_list)), var_t, entry ); @@ -4042,474 +4126,474 @@ yyreduce: } break; - case 178: + case 182: /* Line 1806 of yacc.c */ -#line 632 "parser.y" +#line 618 "parser.y" { (yyval.var) = reg_const((yyvsp[(1) - (3)].var)); (yyval.var)->eval = (yyvsp[(3) - (3)].expr); (yyval.var)->type = type_new_int(TYPE_BASIC_INT, 0); } break; - case 179: + case 183: /* Line 1806 of yacc.c */ -#line 636 "parser.y" +#line 622 "parser.y" { (yyval.var) = reg_const((yyvsp[(1) - (1)].var)); (yyval.var)->type = type_new_int(TYPE_BASIC_INT, 0); } break; - case 180: + case 184: /* Line 1806 of yacc.c */ -#line 641 "parser.y" +#line 627 "parser.y" { (yyval.type) = type_new_enum((yyvsp[(2) - (5)].str), TRUE, (yyvsp[(4) - (5)].var_list)); } break; - case 181: - -/* Line 1806 of yacc.c */ -#line 644 "parser.y" - { (yyval.expr_list) = append_expr( NULL, (yyvsp[(1) - (1)].expr) ); } - break; - - case 182: - -/* Line 1806 of yacc.c */ -#line 645 "parser.y" - { (yyval.expr_list) = append_expr( (yyvsp[(1) - (3)].expr_list), (yyvsp[(3) - (3)].expr) ); } - break; - - case 183: - -/* Line 1806 of yacc.c */ -#line 648 "parser.y" - { (yyval.expr) = make_expr(EXPR_VOID); } - break; - case 185: /* Line 1806 of yacc.c */ -#line 652 "parser.y" - { (yyval.expr) = make_exprl(EXPR_NUM, (yyvsp[(1) - (1)].num)); } +#line 630 "parser.y" + { (yyval.expr_list) = append_expr( NULL, (yyvsp[(1) - (1)].expr) ); } break; case 186: /* Line 1806 of yacc.c */ -#line 653 "parser.y" - { (yyval.expr) = make_exprl(EXPR_HEXNUM, (yyvsp[(1) - (1)].num)); } +#line 631 "parser.y" + { (yyval.expr_list) = append_expr( (yyvsp[(1) - (3)].expr_list), (yyvsp[(3) - (3)].expr) ); } break; case 187: /* Line 1806 of yacc.c */ -#line 654 "parser.y" - { (yyval.expr) = make_exprd(EXPR_DOUBLE, (yyvsp[(1) - (1)].dbl)); } - break; - - case 188: - -/* Line 1806 of yacc.c */ -#line 655 "parser.y" - { (yyval.expr) = make_exprl(EXPR_TRUEFALSE, 0); } +#line 634 "parser.y" + { (yyval.expr) = make_expr(EXPR_VOID); } break; case 189: /* Line 1806 of yacc.c */ -#line 656 "parser.y" - { (yyval.expr) = make_exprl(EXPR_NUM, 0); } +#line 638 "parser.y" + { (yyval.expr) = make_exprl(EXPR_NUM, (yyvsp[(1) - (1)].num)); } break; case 190: /* Line 1806 of yacc.c */ -#line 657 "parser.y" - { (yyval.expr) = make_exprl(EXPR_TRUEFALSE, 1); } +#line 639 "parser.y" + { (yyval.expr) = make_exprl(EXPR_HEXNUM, (yyvsp[(1) - (1)].num)); } break; case 191: /* Line 1806 of yacc.c */ -#line 658 "parser.y" - { (yyval.expr) = make_exprs(EXPR_STRLIT, (yyvsp[(1) - (1)].str)); } +#line 640 "parser.y" + { (yyval.expr) = make_exprd(EXPR_DOUBLE, (yyvsp[(1) - (1)].dbl)); } break; case 192: /* Line 1806 of yacc.c */ -#line 659 "parser.y" - { (yyval.expr) = make_exprs(EXPR_WSTRLIT, (yyvsp[(1) - (1)].str)); } +#line 641 "parser.y" + { (yyval.expr) = make_exprl(EXPR_TRUEFALSE, 0); } break; case 193: /* Line 1806 of yacc.c */ -#line 660 "parser.y" - { (yyval.expr) = make_exprs(EXPR_CHARCONST, (yyvsp[(1) - (1)].str)); } +#line 642 "parser.y" + { (yyval.expr) = make_exprl(EXPR_NUM, 0); } break; case 194: /* Line 1806 of yacc.c */ -#line 661 "parser.y" - { (yyval.expr) = make_exprs(EXPR_IDENTIFIER, (yyvsp[(1) - (1)].str)); } +#line 643 "parser.y" + { (yyval.expr) = make_exprl(EXPR_TRUEFALSE, 1); } break; case 195: /* Line 1806 of yacc.c */ -#line 662 "parser.y" - { (yyval.expr) = make_expr3(EXPR_COND, (yyvsp[(1) - (5)].expr), (yyvsp[(3) - (5)].expr), (yyvsp[(5) - (5)].expr)); } +#line 644 "parser.y" + { (yyval.expr) = make_exprs(EXPR_STRLIT, (yyvsp[(1) - (1)].str)); } break; case 196: /* Line 1806 of yacc.c */ -#line 663 "parser.y" - { (yyval.expr) = make_expr2(EXPR_LOGOR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 645 "parser.y" + { (yyval.expr) = make_exprs(EXPR_WSTRLIT, (yyvsp[(1) - (1)].str)); } break; case 197: /* Line 1806 of yacc.c */ -#line 664 "parser.y" - { (yyval.expr) = make_expr2(EXPR_LOGAND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 646 "parser.y" + { (yyval.expr) = make_exprs(EXPR_CHARCONST, (yyvsp[(1) - (1)].str)); } break; case 198: /* Line 1806 of yacc.c */ -#line 665 "parser.y" - { (yyval.expr) = make_expr2(EXPR_OR , (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 647 "parser.y" + { (yyval.expr) = make_exprs(EXPR_IDENTIFIER, (yyvsp[(1) - (1)].str)); } break; case 199: /* Line 1806 of yacc.c */ -#line 666 "parser.y" - { (yyval.expr) = make_expr2(EXPR_XOR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 648 "parser.y" + { (yyval.expr) = make_expr3(EXPR_COND, (yyvsp[(1) - (5)].expr), (yyvsp[(3) - (5)].expr), (yyvsp[(5) - (5)].expr)); } break; case 200: /* Line 1806 of yacc.c */ -#line 667 "parser.y" - { (yyval.expr) = make_expr2(EXPR_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 649 "parser.y" + { (yyval.expr) = make_expr2(EXPR_LOGOR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 201: /* Line 1806 of yacc.c */ -#line 668 "parser.y" - { (yyval.expr) = make_expr2(EXPR_EQUALITY, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 650 "parser.y" + { (yyval.expr) = make_expr2(EXPR_LOGAND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 202: /* Line 1806 of yacc.c */ -#line 669 "parser.y" - { (yyval.expr) = make_expr2(EXPR_INEQUALITY, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 651 "parser.y" + { (yyval.expr) = make_expr2(EXPR_OR , (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 203: /* Line 1806 of yacc.c */ -#line 670 "parser.y" - { (yyval.expr) = make_expr2(EXPR_GTR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 652 "parser.y" + { (yyval.expr) = make_expr2(EXPR_XOR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 204: /* Line 1806 of yacc.c */ -#line 671 "parser.y" - { (yyval.expr) = make_expr2(EXPR_LESS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 653 "parser.y" + { (yyval.expr) = make_expr2(EXPR_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 205: /* Line 1806 of yacc.c */ -#line 672 "parser.y" - { (yyval.expr) = make_expr2(EXPR_GTREQL, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 654 "parser.y" + { (yyval.expr) = make_expr2(EXPR_EQUALITY, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 206: /* Line 1806 of yacc.c */ -#line 673 "parser.y" - { (yyval.expr) = make_expr2(EXPR_LESSEQL, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 655 "parser.y" + { (yyval.expr) = make_expr2(EXPR_INEQUALITY, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 207: /* Line 1806 of yacc.c */ -#line 674 "parser.y" - { (yyval.expr) = make_expr2(EXPR_SHL, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 656 "parser.y" + { (yyval.expr) = make_expr2(EXPR_GTR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 208: /* Line 1806 of yacc.c */ -#line 675 "parser.y" - { (yyval.expr) = make_expr2(EXPR_SHR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 657 "parser.y" + { (yyval.expr) = make_expr2(EXPR_LESS, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 209: /* Line 1806 of yacc.c */ -#line 676 "parser.y" - { (yyval.expr) = make_expr2(EXPR_ADD, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 658 "parser.y" + { (yyval.expr) = make_expr2(EXPR_GTREQL, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 210: /* Line 1806 of yacc.c */ -#line 677 "parser.y" - { (yyval.expr) = make_expr2(EXPR_SUB, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 659 "parser.y" + { (yyval.expr) = make_expr2(EXPR_LESSEQL, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 211: /* Line 1806 of yacc.c */ -#line 678 "parser.y" - { (yyval.expr) = make_expr2(EXPR_MOD, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 660 "parser.y" + { (yyval.expr) = make_expr2(EXPR_SHL, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 212: /* Line 1806 of yacc.c */ -#line 679 "parser.y" - { (yyval.expr) = make_expr2(EXPR_MUL, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 661 "parser.y" + { (yyval.expr) = make_expr2(EXPR_SHR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 213: /* Line 1806 of yacc.c */ -#line 680 "parser.y" - { (yyval.expr) = make_expr2(EXPR_DIV, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } +#line 662 "parser.y" + { (yyval.expr) = make_expr2(EXPR_ADD, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 214: /* Line 1806 of yacc.c */ -#line 681 "parser.y" - { (yyval.expr) = make_expr1(EXPR_LOGNOT, (yyvsp[(2) - (2)].expr)); } +#line 663 "parser.y" + { (yyval.expr) = make_expr2(EXPR_SUB, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 215: /* Line 1806 of yacc.c */ -#line 682 "parser.y" - { (yyval.expr) = make_expr1(EXPR_NOT, (yyvsp[(2) - (2)].expr)); } +#line 664 "parser.y" + { (yyval.expr) = make_expr2(EXPR_MOD, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 216: /* Line 1806 of yacc.c */ -#line 683 "parser.y" - { (yyval.expr) = make_expr1(EXPR_POS, (yyvsp[(2) - (2)].expr)); } +#line 665 "parser.y" + { (yyval.expr) = make_expr2(EXPR_MUL, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 217: /* Line 1806 of yacc.c */ -#line 684 "parser.y" - { (yyval.expr) = make_expr1(EXPR_NEG, (yyvsp[(2) - (2)].expr)); } +#line 666 "parser.y" + { (yyval.expr) = make_expr2(EXPR_DIV, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); } break; case 218: /* Line 1806 of yacc.c */ -#line 685 "parser.y" - { (yyval.expr) = make_expr1(EXPR_ADDRESSOF, (yyvsp[(2) - (2)].expr)); } +#line 667 "parser.y" + { (yyval.expr) = make_expr1(EXPR_LOGNOT, (yyvsp[(2) - (2)].expr)); } break; case 219: /* Line 1806 of yacc.c */ -#line 686 "parser.y" - { (yyval.expr) = make_expr1(EXPR_PPTR, (yyvsp[(2) - (2)].expr)); } +#line 668 "parser.y" + { (yyval.expr) = make_expr1(EXPR_NOT, (yyvsp[(2) - (2)].expr)); } break; case 220: /* Line 1806 of yacc.c */ -#line 687 "parser.y" - { (yyval.expr) = make_expr2(EXPR_MEMBER, make_expr1(EXPR_PPTR, (yyvsp[(1) - (3)].expr)), make_exprs(EXPR_IDENTIFIER, (yyvsp[(3) - (3)].str))); } +#line 669 "parser.y" + { (yyval.expr) = make_expr1(EXPR_POS, (yyvsp[(2) - (2)].expr)); } break; case 221: /* Line 1806 of yacc.c */ -#line 688 "parser.y" - { (yyval.expr) = make_expr2(EXPR_MEMBER, (yyvsp[(1) - (3)].expr), make_exprs(EXPR_IDENTIFIER, (yyvsp[(3) - (3)].str))); } +#line 670 "parser.y" + { (yyval.expr) = make_expr1(EXPR_NEG, (yyvsp[(2) - (2)].expr)); } break; case 222: /* Line 1806 of yacc.c */ -#line 690 "parser.y" - { (yyval.expr) = make_exprt(EXPR_CAST, declare_var(NULL, (yyvsp[(2) - (5)].declspec), (yyvsp[(3) - (5)].declarator), 0), (yyvsp[(5) - (5)].expr)); free((yyvsp[(2) - (5)].declspec)); free((yyvsp[(3) - (5)].declarator)); } +#line 671 "parser.y" + { (yyval.expr) = make_expr1(EXPR_ADDRESSOF, (yyvsp[(2) - (2)].expr)); } break; case 223: /* Line 1806 of yacc.c */ -#line 692 "parser.y" - { (yyval.expr) = make_exprt(EXPR_SIZEOF, declare_var(NULL, (yyvsp[(3) - (5)].declspec), (yyvsp[(4) - (5)].declarator), 0), NULL); free((yyvsp[(3) - (5)].declspec)); free((yyvsp[(4) - (5)].declarator)); } +#line 672 "parser.y" + { (yyval.expr) = make_expr1(EXPR_PPTR, (yyvsp[(2) - (2)].expr)); } break; case 224: /* Line 1806 of yacc.c */ -#line 693 "parser.y" - { (yyval.expr) = make_expr2(EXPR_ARRAY, (yyvsp[(1) - (4)].expr), (yyvsp[(3) - (4)].expr)); } +#line 673 "parser.y" + { (yyval.expr) = make_expr2(EXPR_MEMBER, make_expr1(EXPR_PPTR, (yyvsp[(1) - (3)].expr)), make_exprs(EXPR_IDENTIFIER, (yyvsp[(3) - (3)].str))); } break; case 225: /* Line 1806 of yacc.c */ -#line 694 "parser.y" - { (yyval.expr) = (yyvsp[(2) - (3)].expr); } +#line 674 "parser.y" + { (yyval.expr) = make_expr2(EXPR_MEMBER, (yyvsp[(1) - (3)].expr), make_exprs(EXPR_IDENTIFIER, (yyvsp[(3) - (3)].str))); } break; case 226: /* Line 1806 of yacc.c */ -#line 697 "parser.y" - { (yyval.expr_list) = append_expr( NULL, (yyvsp[(1) - (1)].expr) ); } +#line 676 "parser.y" + { (yyval.expr) = make_exprt(EXPR_CAST, declare_var(NULL, (yyvsp[(2) - (5)].declspec), (yyvsp[(3) - (5)].declarator), 0), (yyvsp[(5) - (5)].expr)); free((yyvsp[(2) - (5)].declspec)); free((yyvsp[(3) - (5)].declarator)); } break; case 227: /* Line 1806 of yacc.c */ -#line 698 "parser.y" - { (yyval.expr_list) = append_expr( (yyvsp[(1) - (3)].expr_list), (yyvsp[(3) - (3)].expr) ); } +#line 678 "parser.y" + { (yyval.expr) = make_exprt(EXPR_SIZEOF, declare_var(NULL, (yyvsp[(3) - (5)].declspec), (yyvsp[(4) - (5)].declarator), 0), NULL); free((yyvsp[(3) - (5)].declspec)); free((yyvsp[(4) - (5)].declarator)); } break; case 228: /* Line 1806 of yacc.c */ -#line 701 "parser.y" +#line 679 "parser.y" + { (yyval.expr) = make_expr2(EXPR_ARRAY, (yyvsp[(1) - (4)].expr), (yyvsp[(3) - (4)].expr)); } + break; + + case 229: + +/* Line 1806 of yacc.c */ +#line 680 "parser.y" + { (yyval.expr) = (yyvsp[(2) - (3)].expr); } + break; + + case 230: + +/* Line 1806 of yacc.c */ +#line 683 "parser.y" + { (yyval.expr_list) = append_expr( NULL, (yyvsp[(1) - (1)].expr) ); } + break; + + case 231: + +/* Line 1806 of yacc.c */ +#line 684 "parser.y" + { (yyval.expr_list) = append_expr( (yyvsp[(1) - (3)].expr_list), (yyvsp[(3) - (3)].expr) ); } + break; + + case 232: + +/* Line 1806 of yacc.c */ +#line 687 "parser.y" { (yyval.expr) = (yyvsp[(1) - (1)].expr); if (!(yyval.expr)->is_const) error_loc("expression is not an integer constant\n"); } break; - case 229: + case 233: /* Line 1806 of yacc.c */ -#line 707 "parser.y" +#line 693 "parser.y" { (yyval.expr) = (yyvsp[(1) - (1)].expr); if (!(yyval.expr)->is_const && (yyval.expr)->type != EXPR_STRLIT && (yyval.expr)->type != EXPR_WSTRLIT) error_loc("expression is not constant\n"); } break; - case 230: + case 234: /* Line 1806 of yacc.c */ -#line 713 "parser.y" +#line 699 "parser.y" { (yyval.var_list) = NULL; } break; - case 231: + case 235: /* Line 1806 of yacc.c */ -#line 714 "parser.y" +#line 700 "parser.y" { (yyval.var_list) = append_var_list((yyvsp[(1) - (2)].var_list), (yyvsp[(2) - (2)].var_list)); } break; - case 232: + case 236: /* Line 1806 of yacc.c */ -#line 718 "parser.y" +#line 704 "parser.y" { const char *first = LIST_ENTRY(list_head((yyvsp[(3) - (4)].declarator_list)), declarator_t, entry)->var->name; check_field_attrs(first, (yyvsp[(1) - (4)].attr_list)); (yyval.var_list) = set_var_types((yyvsp[(1) - (4)].attr_list), (yyvsp[(2) - (4)].declspec), (yyvsp[(3) - (4)].declarator_list)); } break; - case 233: + case 237: /* Line 1806 of yacc.c */ -#line 722 "parser.y" +#line 708 "parser.y" { var_t *v = make_var(NULL); v->type = (yyvsp[(2) - (3)].type); v->attrs = (yyvsp[(1) - (3)].attr_list); (yyval.var_list) = append_var(NULL, v); } break; - case 234: - -/* Line 1806 of yacc.c */ -#line 729 "parser.y" - { (yyval.var) = (yyvsp[(1) - (2)].var); } - break; - - case 235: - -/* Line 1806 of yacc.c */ -#line 730 "parser.y" - { (yyval.var) = make_var(NULL); (yyval.var)->attrs = (yyvsp[(1) - (2)].attr_list); } - break; - - case 236: - -/* Line 1806 of yacc.c */ -#line 733 "parser.y" - { (yyval.var_list) = NULL; } - break; - - case 237: - -/* Line 1806 of yacc.c */ -#line 734 "parser.y" - { (yyval.var_list) = append_var( (yyvsp[(1) - (2)].var_list), (yyvsp[(2) - (2)].var) ); } - break; - case 238: /* Line 1806 of yacc.c */ -#line 738 "parser.y" +#line 715 "parser.y" { (yyval.var) = (yyvsp[(1) - (2)].var); } break; case 239: /* Line 1806 of yacc.c */ -#line 739 "parser.y" - { (yyval.var) = NULL; } +#line 716 "parser.y" + { (yyval.var) = make_var(NULL); (yyval.var)->attrs = (yyvsp[(1) - (2)].attr_list); } break; case 240: /* Line 1806 of yacc.c */ -#line 742 "parser.y" +#line 719 "parser.y" + { (yyval.var_list) = NULL; } + break; + + case 241: + +/* Line 1806 of yacc.c */ +#line 720 "parser.y" + { (yyval.var_list) = append_var( (yyvsp[(1) - (2)].var_list), (yyvsp[(2) - (2)].var) ); } + break; + + case 242: + +/* Line 1806 of yacc.c */ +#line 724 "parser.y" + { (yyval.var) = (yyvsp[(1) - (2)].var); } + break; + + case 243: + +/* Line 1806 of yacc.c */ +#line 725 "parser.y" + { (yyval.var) = NULL; } + break; + + case 244: + +/* Line 1806 of yacc.c */ +#line 728 "parser.y" { (yyval.var) = declare_var(check_field_attrs((yyvsp[(3) - (3)].declarator)->var->name, (yyvsp[(1) - (3)].attr_list)), (yyvsp[(2) - (3)].declspec), (yyvsp[(3) - (3)].declarator), FALSE); free((yyvsp[(3) - (3)].declarator)); } break; - case 241: + case 245: /* Line 1806 of yacc.c */ -#line 746 "parser.y" +#line 732 "parser.y" { var_t *v = make_var(NULL); v->type = (yyvsp[(2) - (2)].type); v->attrs = (yyvsp[(1) - (2)].attr_list); (yyval.var) = v; } break; - case 242: + case 246: /* Line 1806 of yacc.c */ -#line 752 "parser.y" +#line 738 "parser.y" { (yyval.var) = (yyvsp[(1) - (1)].var); if (type_get_type((yyval.var)->type) != TYPE_FUNCTION) error_loc("only methods may be declared inside the methods section of a dispinterface\n"); @@ -4517,203 +4601,203 @@ yyreduce: } break; - case 243: + case 247: /* Line 1806 of yacc.c */ -#line 761 "parser.y" +#line 747 "parser.y" { (yyval.var) = declare_var((yyvsp[(1) - (3)].attr_list), (yyvsp[(2) - (3)].declspec), (yyvsp[(3) - (3)].declarator), FALSE); free((yyvsp[(3) - (3)].declarator)); } break; - case 244: + case 248: /* Line 1806 of yacc.c */ -#line 764 "parser.y" +#line 750 "parser.y" { (yyval.var) = declare_var(NULL, (yyvsp[(1) - (2)].declspec), (yyvsp[(2) - (2)].declarator), FALSE); free((yyvsp[(2) - (2)].declarator)); } break; - case 245: - -/* Line 1806 of yacc.c */ -#line 769 "parser.y" - { (yyval.var) = NULL; } - break; - - case 247: - -/* Line 1806 of yacc.c */ -#line 773 "parser.y" - { (yyval.str) = NULL; } - break; - - case 248: - -/* Line 1806 of yacc.c */ -#line 774 "parser.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); } - break; - case 249: /* Line 1806 of yacc.c */ -#line 775 "parser.y" - { (yyval.str) = (yyvsp[(1) - (1)].str); } - break; - - case 250: - -/* Line 1806 of yacc.c */ -#line 778 "parser.y" - { (yyval.var) = make_var((yyvsp[(1) - (1)].str)); } +#line 755 "parser.y" + { (yyval.var) = NULL; } break; case 251: /* Line 1806 of yacc.c */ -#line 780 "parser.y" - { (yyval.var) = make_var((yyvsp[(1) - (1)].str)); } +#line 759 "parser.y" + { (yyval.str) = NULL; } break; case 252: /* Line 1806 of yacc.c */ -#line 783 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } +#line 760 "parser.y" + { (yyval.str) = (yyvsp[(1) - (1)].str); } break; case 253: /* Line 1806 of yacc.c */ -#line 784 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } +#line 761 "parser.y" + { (yyval.str) = (yyvsp[(1) - (1)].str); } + break; + + case 254: + +/* Line 1806 of yacc.c */ +#line 764 "parser.y" + { (yyval.var) = make_var((yyvsp[(1) - (1)].str)); } break; case 255: /* Line 1806 of yacc.c */ -#line 786 "parser.y" - { (yyval.type) = type_new_int(type_basic_get_type((yyvsp[(2) - (2)].type)), -1); } +#line 766 "parser.y" + { (yyval.var) = make_var((yyvsp[(1) - (1)].str)); } break; case 256: /* Line 1806 of yacc.c */ -#line 787 "parser.y" - { (yyval.type) = type_new_int(type_basic_get_type((yyvsp[(2) - (2)].type)), 1); } +#line 769 "parser.y" + { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } break; case 257: /* Line 1806 of yacc.c */ -#line 788 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT, 1); } - break; - - case 258: - -/* Line 1806 of yacc.c */ -#line 789 "parser.y" +#line 770 "parser.y" { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } break; case 259: /* Line 1806 of yacc.c */ -#line 790 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } +#line 772 "parser.y" + { (yyval.type) = type_new_int(type_basic_get_type((yyvsp[(2) - (2)].type)), -1); } break; case 260: /* Line 1806 of yacc.c */ -#line 791 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } +#line 773 "parser.y" + { (yyval.type) = type_new_int(type_basic_get_type((yyvsp[(2) - (2)].type)), 1); } break; case 261: /* Line 1806 of yacc.c */ -#line 792 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } +#line 774 "parser.y" + { (yyval.type) = type_new_int(TYPE_BASIC_INT, 1); } break; case 262: /* Line 1806 of yacc.c */ -#line 793 "parser.y" +#line 775 "parser.y" + { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } + break; + + case 263: + +/* Line 1806 of yacc.c */ +#line 776 "parser.y" + { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } + break; + + case 264: + +/* Line 1806 of yacc.c */ +#line 777 "parser.y" { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } break; case 265: /* Line 1806 of yacc.c */ -#line 800 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT, 0); } +#line 778 "parser.y" + { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } break; case 266: /* Line 1806 of yacc.c */ -#line 801 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT16, 0); } - break; - - case 267: - -/* Line 1806 of yacc.c */ -#line 802 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT8, 0); } - break; - - case 268: - -/* Line 1806 of yacc.c */ -#line 803 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT32, 0); } +#line 779 "parser.y" + { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } break; case 269: /* Line 1806 of yacc.c */ -#line 804 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_HYPER, 0); } +#line 786 "parser.y" + { (yyval.type) = type_new_int(TYPE_BASIC_INT, 0); } break; case 270: /* Line 1806 of yacc.c */ -#line 805 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT64, 0); } +#line 787 "parser.y" + { (yyval.type) = type_new_int(TYPE_BASIC_INT16, 0); } break; case 271: /* Line 1806 of yacc.c */ -#line 806 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_CHAR, 0); } +#line 788 "parser.y" + { (yyval.type) = type_new_int(TYPE_BASIC_INT8, 0); } break; case 272: /* Line 1806 of yacc.c */ -#line 807 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT3264, 0); } +#line 789 "parser.y" + { (yyval.type) = type_new_int(TYPE_BASIC_INT32, 0); } break; case 273: /* Line 1806 of yacc.c */ -#line 810 "parser.y" - { (yyval.type) = type_new_coclass((yyvsp[(2) - (2)].str)); } +#line 790 "parser.y" + { (yyval.type) = type_new_int(TYPE_BASIC_HYPER, 0); } break; case 274: /* Line 1806 of yacc.c */ -#line 811 "parser.y" +#line 791 "parser.y" + { (yyval.type) = type_new_int(TYPE_BASIC_INT64, 0); } + break; + + case 275: + +/* Line 1806 of yacc.c */ +#line 792 "parser.y" + { (yyval.type) = type_new_int(TYPE_BASIC_CHAR, 0); } + break; + + case 276: + +/* Line 1806 of yacc.c */ +#line 793 "parser.y" + { (yyval.type) = type_new_int(TYPE_BASIC_INT3264, 0); } + break; + + case 277: + +/* Line 1806 of yacc.c */ +#line 796 "parser.y" + { (yyval.type) = type_new_coclass((yyvsp[(2) - (2)].str)); } + break; + + case 278: + +/* Line 1806 of yacc.c */ +#line 797 "parser.y" { (yyval.type) = find_type((yyvsp[(2) - (2)].str), 0); if (type_get_type_detect_alias((yyval.type)) != TYPE_COCLASS) error_loc("%s was not declared a coclass at %s:%d\n", @@ -4722,62 +4806,69 @@ yyreduce: } break; - case 275: + case 279: /* Line 1806 of yacc.c */ -#line 819 "parser.y" +#line 805 "parser.y" { (yyval.type) = (yyvsp[(2) - (2)].type); check_def((yyval.type)); (yyval.type)->attrs = check_coclass_attrs((yyvsp[(2) - (2)].type)->name, (yyvsp[(1) - (2)].attr_list)); } break; - case 276: - -/* Line 1806 of yacc.c */ -#line 826 "parser.y" - { (yyval.type) = type_coclass_define((yyvsp[(1) - (5)].type), (yyvsp[(3) - (5)].ifref_list)); } - break; - - case 277: - -/* Line 1806 of yacc.c */ -#line 829 "parser.y" - { (yyval.ifref_list) = NULL; } - break; - - case 278: - -/* Line 1806 of yacc.c */ -#line 830 "parser.y" - { (yyval.ifref_list) = append_ifref( (yyvsp[(1) - (2)].ifref_list), (yyvsp[(2) - (2)].ifref) ); } - break; - - case 279: - -/* Line 1806 of yacc.c */ -#line 834 "parser.y" - { (yyval.ifref) = make_ifref((yyvsp[(2) - (2)].type)); (yyval.ifref)->attrs = (yyvsp[(1) - (2)].attr_list); } - break; - case 280: /* Line 1806 of yacc.c */ -#line 837 "parser.y" - { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[(2) - (2)].str), 0); } +#line 812 "parser.y" + { (yyval.type) = type_coclass_define((yyvsp[(1) - (5)].type), (yyvsp[(3) - (5)].ifref_list)); } break; case 281: /* Line 1806 of yacc.c */ -#line 838 "parser.y" - { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[(2) - (2)].str), 0); } +#line 815 "parser.y" + { (yyval.type) = NULL; } break; case 282: /* Line 1806 of yacc.c */ -#line 841 "parser.y" +#line 818 "parser.y" + { (yyval.ifref_list) = NULL; } + break; + + case 283: + +/* Line 1806 of yacc.c */ +#line 819 "parser.y" + { (yyval.ifref_list) = append_ifref( (yyvsp[(1) - (2)].ifref_list), (yyvsp[(2) - (2)].ifref) ); } + break; + + case 284: + +/* Line 1806 of yacc.c */ +#line 823 "parser.y" + { (yyval.ifref) = make_ifref((yyvsp[(2) - (2)].type)); (yyval.ifref)->attrs = (yyvsp[(1) - (2)].attr_list); } + break; + + case 285: + +/* Line 1806 of yacc.c */ +#line 826 "parser.y" + { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[(2) - (2)].str), 0); } + break; + + case 286: + +/* Line 1806 of yacc.c */ +#line 827 "parser.y" + { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[(2) - (2)].str), 0); } + break; + + case 287: + +/* Line 1806 of yacc.c */ +#line 830 "parser.y" { attr_t *attrs; (yyval.type) = (yyvsp[(2) - (2)].type); check_def((yyval.type)); @@ -4787,84 +4878,84 @@ yyreduce: } break; - case 283: - -/* Line 1806 of yacc.c */ -#line 850 "parser.y" - { (yyval.var_list) = NULL; } - break; - - case 284: - -/* Line 1806 of yacc.c */ -#line 851 "parser.y" - { (yyval.var_list) = append_var( (yyvsp[(1) - (3)].var_list), (yyvsp[(2) - (3)].var) ); } - break; - - case 285: - -/* Line 1806 of yacc.c */ -#line 854 "parser.y" - { (yyval.var_list) = NULL; } - break; - - case 286: - -/* Line 1806 of yacc.c */ -#line 855 "parser.y" - { (yyval.var_list) = append_var( (yyvsp[(1) - (3)].var_list), (yyvsp[(2) - (3)].var) ); } - break; - - case 287: - -/* Line 1806 of yacc.c */ -#line 861 "parser.y" - { (yyval.type) = (yyvsp[(1) - (5)].type); - type_dispinterface_define((yyval.type), (yyvsp[(3) - (5)].var_list), (yyvsp[(4) - (5)].var_list)); - } - break; - case 288: /* Line 1806 of yacc.c */ -#line 865 "parser.y" - { (yyval.type) = (yyvsp[(1) - (5)].type); - type_dispinterface_define_from_iface((yyval.type), (yyvsp[(3) - (5)].type)); - } +#line 839 "parser.y" + { (yyval.var_list) = NULL; } break; case 289: /* Line 1806 of yacc.c */ -#line 870 "parser.y" - { (yyval.type) = NULL; } +#line 840 "parser.y" + { (yyval.var_list) = append_var( (yyvsp[(1) - (3)].var_list), (yyvsp[(2) - (3)].var) ); } break; case 290: /* Line 1806 of yacc.c */ -#line 871 "parser.y" - { (yyval.type) = find_type_or_error2((yyvsp[(2) - (2)].str), 0); } +#line 843 "parser.y" + { (yyval.var_list) = NULL; } break; case 291: /* Line 1806 of yacc.c */ -#line 874 "parser.y" - { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[(2) - (2)].str), 0); } +#line 844 "parser.y" + { (yyval.var_list) = append_var( (yyvsp[(1) - (3)].var_list), (yyvsp[(2) - (3)].var) ); } break; case 292: /* Line 1806 of yacc.c */ -#line 875 "parser.y" - { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[(2) - (2)].str), 0); } +#line 850 "parser.y" + { (yyval.type) = (yyvsp[(1) - (5)].type); + type_dispinterface_define((yyval.type), (yyvsp[(3) - (5)].var_list), (yyvsp[(4) - (5)].var_list)); + } break; case 293: /* Line 1806 of yacc.c */ -#line 878 "parser.y" +#line 854 "parser.y" + { (yyval.type) = (yyvsp[(1) - (5)].type); + type_dispinterface_define_from_iface((yyval.type), (yyvsp[(3) - (5)].type)); + } + break; + + case 294: + +/* Line 1806 of yacc.c */ +#line 859 "parser.y" + { (yyval.type) = NULL; } + break; + + case 295: + +/* Line 1806 of yacc.c */ +#line 860 "parser.y" + { (yyval.type) = find_type_or_error2((yyvsp[(2) - (2)].str), 0); } + break; + + case 296: + +/* Line 1806 of yacc.c */ +#line 863 "parser.y" + { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[(2) - (2)].str), 0); } + break; + + case 297: + +/* Line 1806 of yacc.c */ +#line 864 "parser.y" + { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[(2) - (2)].str), 0); } + break; + + case 298: + +/* Line 1806 of yacc.c */ +#line 867 "parser.y" { (yyval.ifinfo).interface = (yyvsp[(2) - (2)].type); (yyval.ifinfo).old_pointer_default = pointer_default; if (is_attr((yyvsp[(1) - (2)].attr_list), ATTR_POINTERDEFAULT)) @@ -4875,224 +4966,241 @@ yyreduce: } break; - case 294: + case 299: /* Line 1806 of yacc.c */ -#line 889 "parser.y" +#line 878 "parser.y" { (yyval.type) = (yyvsp[(1) - (6)].ifinfo).interface; + if((yyval.type) == (yyvsp[(2) - (6)].type)) + error_loc("Interface can't inherit from itself\n"); type_interface_define((yyval.type), (yyvsp[(2) - (6)].type), (yyvsp[(4) - (6)].stmt_list)); pointer_default = (yyvsp[(1) - (6)].ifinfo).old_pointer_default; } break; - case 295: + case 300: /* Line 1806 of yacc.c */ -#line 897 "parser.y" +#line 888 "parser.y" { (yyval.type) = (yyvsp[(1) - (8)].ifinfo).interface; type_interface_define((yyval.type), find_type_or_error2((yyvsp[(3) - (8)].str), 0), (yyvsp[(6) - (8)].stmt_list)); pointer_default = (yyvsp[(1) - (8)].ifinfo).old_pointer_default; } break; - case 296: - -/* Line 1806 of yacc.c */ -#line 901 "parser.y" - { (yyval.type) = (yyvsp[(1) - (2)].type); } - break; - - case 297: - -/* Line 1806 of yacc.c */ -#line 905 "parser.y" - { (yyval.type) = (yyvsp[(1) - (2)].type); } - break; - - case 298: - -/* Line 1806 of yacc.c */ -#line 906 "parser.y" - { (yyval.type) = (yyvsp[(1) - (2)].type); } - break; - - case 299: - -/* Line 1806 of yacc.c */ -#line 909 "parser.y" - { (yyval.type) = type_new_module((yyvsp[(2) - (2)].str)); } - break; - - case 300: - -/* Line 1806 of yacc.c */ -#line 910 "parser.y" - { (yyval.type) = type_new_module((yyvsp[(2) - (2)].str)); } - break; - case 301: /* Line 1806 of yacc.c */ -#line 913 "parser.y" - { (yyval.type) = (yyvsp[(2) - (2)].type); - (yyval.type)->attrs = check_module_attrs((yyvsp[(2) - (2)].type)->name, (yyvsp[(1) - (2)].attr_list)); - } +#line 892 "parser.y" + { (yyval.type) = (yyvsp[(1) - (2)].type); } break; case 302: /* Line 1806 of yacc.c */ -#line 919 "parser.y" - { (yyval.type) = (yyvsp[(1) - (5)].type); - type_module_define((yyval.type), (yyvsp[(3) - (5)].stmt_list)); - } +#line 896 "parser.y" + { (yyval.type) = (yyvsp[(1) - (2)].type); } break; case 303: /* Line 1806 of yacc.c */ -#line 925 "parser.y" - { (yyval.stgclass) = STG_EXTERN; } +#line 897 "parser.y" + { (yyval.type) = (yyvsp[(1) - (2)].type); } break; case 304: /* Line 1806 of yacc.c */ -#line 926 "parser.y" - { (yyval.stgclass) = STG_STATIC; } +#line 900 "parser.y" + { (yyval.type) = type_new_module((yyvsp[(2) - (2)].str)); } break; case 305: /* Line 1806 of yacc.c */ -#line 927 "parser.y" - { (yyval.stgclass) = STG_REGISTER; } +#line 901 "parser.y" + { (yyval.type) = type_new_module((yyvsp[(2) - (2)].str)); } break; case 306: /* Line 1806 of yacc.c */ -#line 931 "parser.y" - { (yyval.attr) = make_attr(ATTR_INLINE); } +#line 904 "parser.y" + { (yyval.type) = (yyvsp[(2) - (2)].type); + (yyval.type)->attrs = check_module_attrs((yyvsp[(2) - (2)].type)->name, (yyvsp[(1) - (2)].attr_list)); + } break; case 307: /* Line 1806 of yacc.c */ -#line 935 "parser.y" - { (yyval.attr) = make_attr(ATTR_CONST); } +#line 910 "parser.y" + { (yyval.type) = (yyvsp[(1) - (5)].type); + type_module_define((yyval.type), (yyvsp[(3) - (5)].stmt_list)); + } break; case 308: /* Line 1806 of yacc.c */ -#line 938 "parser.y" - { (yyval.attr_list) = NULL; } +#line 916 "parser.y" + { (yyval.stgclass) = STG_EXTERN; } break; case 309: /* Line 1806 of yacc.c */ -#line 939 "parser.y" - { (yyval.attr_list) = append_attr((yyvsp[(1) - (2)].attr_list), (yyvsp[(2) - (2)].attr)); } +#line 917 "parser.y" + { (yyval.stgclass) = STG_STATIC; } break; case 310: /* Line 1806 of yacc.c */ -#line 942 "parser.y" - { (yyval.declspec) = make_decl_spec((yyvsp[(1) - (2)].type), (yyvsp[(2) - (2)].declspec), NULL, NULL, STG_NONE); } +#line 918 "parser.y" + { (yyval.stgclass) = STG_REGISTER; } break; case 311: /* Line 1806 of yacc.c */ -#line 944 "parser.y" - { (yyval.declspec) = make_decl_spec((yyvsp[(2) - (3)].type), (yyvsp[(1) - (3)].declspec), (yyvsp[(3) - (3)].declspec), NULL, STG_NONE); } +#line 922 "parser.y" + { (yyval.attr) = make_attr(ATTR_INLINE); } break; case 312: /* Line 1806 of yacc.c */ -#line 947 "parser.y" - { (yyval.declspec) = NULL; } +#line 926 "parser.y" + { (yyval.attr) = make_attr(ATTR_CONST); } + break; + + case 313: + +/* Line 1806 of yacc.c */ +#line 929 "parser.y" + { (yyval.attr_list) = NULL; } break; case 314: /* Line 1806 of yacc.c */ -#line 952 "parser.y" - { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[(2) - (2)].declspec), NULL, (yyvsp[(1) - (2)].attr), STG_NONE); } +#line 930 "parser.y" + { (yyval.attr_list) = append_attr((yyvsp[(1) - (2)].attr_list), (yyvsp[(2) - (2)].attr)); } break; case 315: /* Line 1806 of yacc.c */ -#line 953 "parser.y" - { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[(2) - (2)].declspec), NULL, (yyvsp[(1) - (2)].attr), STG_NONE); } +#line 933 "parser.y" + { (yyval.declspec) = make_decl_spec((yyvsp[(1) - (2)].type), (yyvsp[(2) - (2)].declspec), NULL, NULL, STG_NONE); } break; case 316: /* Line 1806 of yacc.c */ -#line 954 "parser.y" - { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[(2) - (2)].declspec), NULL, NULL, (yyvsp[(1) - (2)].stgclass)); } +#line 935 "parser.y" + { (yyval.declspec) = make_decl_spec((yyvsp[(2) - (3)].type), (yyvsp[(1) - (3)].declspec), (yyvsp[(3) - (3)].declspec), NULL, STG_NONE); } break; case 317: /* Line 1806 of yacc.c */ -#line 959 "parser.y" - { (yyval.declarator) = (yyvsp[(3) - (3)].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[(2) - (3)].attr_list))); } +#line 938 "parser.y" + { (yyval.declspec) = NULL; } break; - case 318: + case 319: /* Line 1806 of yacc.c */ -#line 960 "parser.y" - { (yyval.declarator) = (yyvsp[(2) - (2)].declarator); if ((yyval.declarator)->func_type) (yyval.declarator)->func_type->attrs = append_attr((yyval.declarator)->func_type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); - else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); } +#line 943 "parser.y" + { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[(2) - (2)].declspec), NULL, (yyvsp[(1) - (2)].attr), STG_NONE); } break; case 320: /* Line 1806 of yacc.c */ -#line 966 "parser.y" - { (yyval.declarator) = make_declarator((yyvsp[(1) - (1)].var)); } +#line 944 "parser.y" + { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[(2) - (2)].declspec), NULL, (yyvsp[(1) - (2)].attr), STG_NONE); } break; case 321: /* Line 1806 of yacc.c */ -#line 967 "parser.y" - { (yyval.declarator) = (yyvsp[(2) - (3)].declarator); } +#line 945 "parser.y" + { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[(2) - (2)].declspec), NULL, NULL, (yyvsp[(1) - (2)].stgclass)); } break; case 322: /* Line 1806 of yacc.c */ -#line 968 "parser.y" - { (yyval.declarator) = (yyvsp[(1) - (2)].declarator); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[(2) - (2)].expr)); } +#line 950 "parser.y" + { (yyval.declarator) = (yyvsp[(3) - (3)].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[(2) - (3)].attr_list))); } break; case 323: /* Line 1806 of yacc.c */ -#line 969 "parser.y" +#line 951 "parser.y" + { (yyval.declarator) = (yyvsp[(2) - (2)].declarator); if ((yyval.declarator)->func_type) (yyval.declarator)->func_type->attrs = append_attr((yyval.declarator)->func_type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); + else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); } + break; + + case 325: + +/* Line 1806 of yacc.c */ +#line 957 "parser.y" + { (yyval.declarator) = make_declarator((yyvsp[(1) - (1)].var)); } + break; + + case 326: + +/* Line 1806 of yacc.c */ +#line 958 "parser.y" + { (yyval.declarator) = (yyvsp[(2) - (3)].declarator); } + break; + + case 327: + +/* Line 1806 of yacc.c */ +#line 959 "parser.y" + { (yyval.declarator) = (yyvsp[(1) - (2)].declarator); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[(2) - (2)].expr)); } + break; + + case 328: + +/* Line 1806 of yacc.c */ +#line 960 "parser.y" { (yyval.declarator) = (yyvsp[(1) - (4)].declarator); (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[(3) - (4)].var_list))); (yyval.declarator)->type = NULL; } break; - case 324: + case 329: + +/* Line 1806 of yacc.c */ +#line 969 "parser.y" + { (yyval.declarator) = (yyvsp[(3) - (3)].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[(2) - (3)].attr_list))); } + break; + + case 330: + +/* Line 1806 of yacc.c */ +#line 970 "parser.y" + { (yyval.declarator) = (yyvsp[(2) - (2)].declarator); if ((yyval.declarator)->func_type) (yyval.declarator)->func_type->attrs = append_attr((yyval.declarator)->func_type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); + else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); } + break; + + case 332: /* Line 1806 of yacc.c */ #line 978 "parser.y" { (yyval.declarator) = (yyvsp[(3) - (3)].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[(2) - (3)].attr_list))); } break; - case 325: + case 333: /* Line 1806 of yacc.c */ #line 979 "parser.y" @@ -5100,392 +5208,385 @@ yyreduce: else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); } break; - case 327: - -/* Line 1806 of yacc.c */ -#line 987 "parser.y" - { (yyval.declarator) = (yyvsp[(3) - (3)].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[(2) - (3)].attr_list))); } - break; - - case 328: - -/* Line 1806 of yacc.c */ -#line 988 "parser.y" - { (yyval.declarator) = (yyvsp[(2) - (2)].declarator); if ((yyval.declarator)->func_type) (yyval.declarator)->func_type->attrs = append_attr((yyval.declarator)->func_type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); - else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); } - break; - - case 329: - -/* Line 1806 of yacc.c */ -#line 993 "parser.y" - { (yyval.declarator) = make_declarator(NULL); } - break; - - case 331: - -/* Line 1806 of yacc.c */ -#line 999 "parser.y" - { (yyval.declarator) = (yyvsp[(2) - (3)].declarator); } - break; - - case 332: - -/* Line 1806 of yacc.c */ -#line 1000 "parser.y" - { (yyval.declarator) = (yyvsp[(1) - (2)].declarator); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[(2) - (2)].expr)); } - break; - - case 333: - -/* Line 1806 of yacc.c */ -#line 1001 "parser.y" - { (yyval.declarator) = make_declarator(NULL); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[(1) - (1)].expr)); } - break; - case 334: /* Line 1806 of yacc.c */ -#line 1003 "parser.y" - { (yyval.declarator) = make_declarator(NULL); - (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[(2) - (3)].var_list))); - (yyval.declarator)->type = NULL; - } - break; - - case 335: - -/* Line 1806 of yacc.c */ -#line 1008 "parser.y" - { (yyval.declarator) = (yyvsp[(1) - (4)].declarator); - (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[(3) - (4)].var_list))); - (yyval.declarator)->type = NULL; - } +#line 984 "parser.y" + { (yyval.declarator) = make_declarator(NULL); } break; case 336: /* Line 1806 of yacc.c */ -#line 1017 "parser.y" - { (yyval.declarator) = (yyvsp[(3) - (3)].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[(2) - (3)].attr_list))); } +#line 990 "parser.y" + { (yyval.declarator) = (yyvsp[(2) - (3)].declarator); } break; case 337: /* Line 1806 of yacc.c */ -#line 1018 "parser.y" - { (yyval.declarator) = (yyvsp[(2) - (2)].declarator); (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); } +#line 991 "parser.y" + { (yyval.declarator) = (yyvsp[(1) - (2)].declarator); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[(2) - (2)].expr)); } + break; + + case 338: + +/* Line 1806 of yacc.c */ +#line 992 "parser.y" + { (yyval.declarator) = make_declarator(NULL); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[(1) - (1)].expr)); } break; case 339: /* Line 1806 of yacc.c */ -#line 1025 "parser.y" - { (yyval.declarator) = (yyvsp[(3) - (3)].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[(2) - (3)].attr_list))); } - break; - - case 340: - -/* Line 1806 of yacc.c */ -#line 1026 "parser.y" - { (yyval.declarator) = (yyvsp[(2) - (2)].declarator); (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); } - break; - - case 341: - -/* Line 1806 of yacc.c */ -#line 1030 "parser.y" - { (yyval.declarator) = make_declarator(NULL); } - break; - - case 343: - -/* Line 1806 of yacc.c */ -#line 1038 "parser.y" - { (yyval.declarator) = make_declarator((yyvsp[(1) - (1)].var)); } - break; - - case 344: - -/* Line 1806 of yacc.c */ -#line 1039 "parser.y" - { (yyval.declarator) = (yyvsp[(2) - (3)].declarator); } - break; - - case 345: - -/* Line 1806 of yacc.c */ -#line 1040 "parser.y" - { (yyval.declarator) = (yyvsp[(1) - (2)].declarator); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[(2) - (2)].expr)); } - break; - - case 346: - -/* Line 1806 of yacc.c */ -#line 1041 "parser.y" - { (yyval.declarator) = make_declarator(NULL); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[(1) - (1)].expr)); } - break; - - case 347: - -/* Line 1806 of yacc.c */ -#line 1043 "parser.y" +#line 994 "parser.y" { (yyval.declarator) = make_declarator(NULL); (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[(2) - (3)].var_list))); (yyval.declarator)->type = NULL; } break; - case 348: + case 340: /* Line 1806 of yacc.c */ -#line 1048 "parser.y" +#line 999 "parser.y" { (yyval.declarator) = (yyvsp[(1) - (4)].declarator); (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[(3) - (4)].var_list))); (yyval.declarator)->type = NULL; } break; + case 341: + +/* Line 1806 of yacc.c */ +#line 1008 "parser.y" + { (yyval.declarator) = (yyvsp[(3) - (3)].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[(2) - (3)].attr_list))); } + break; + + case 342: + +/* Line 1806 of yacc.c */ +#line 1009 "parser.y" + { (yyval.declarator) = (yyvsp[(2) - (2)].declarator); (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); } + break; + + case 344: + +/* Line 1806 of yacc.c */ +#line 1016 "parser.y" + { (yyval.declarator) = (yyvsp[(3) - (3)].declarator); (yyval.declarator)->type = append_ptrchain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[(2) - (3)].attr_list))); } + break; + + case 345: + +/* Line 1806 of yacc.c */ +#line 1017 "parser.y" + { (yyval.declarator) = (yyvsp[(2) - (2)].declarator); (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[(1) - (2)].str))); } + break; + + case 346: + +/* Line 1806 of yacc.c */ +#line 1021 "parser.y" + { (yyval.declarator) = make_declarator(NULL); } + break; + + case 348: + +/* Line 1806 of yacc.c */ +#line 1029 "parser.y" + { (yyval.declarator) = make_declarator((yyvsp[(1) - (1)].var)); } + break; + case 349: /* Line 1806 of yacc.c */ -#line 1055 "parser.y" - { (yyval.declarator_list) = append_declarator( NULL, (yyvsp[(1) - (1)].declarator) ); } +#line 1030 "parser.y" + { (yyval.declarator) = (yyvsp[(2) - (3)].declarator); } break; case 350: /* Line 1806 of yacc.c */ -#line 1056 "parser.y" - { (yyval.declarator_list) = append_declarator( (yyvsp[(1) - (3)].declarator_list), (yyvsp[(3) - (3)].declarator) ); } +#line 1031 "parser.y" + { (yyval.declarator) = (yyvsp[(1) - (2)].declarator); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[(2) - (2)].expr)); } break; case 351: /* Line 1806 of yacc.c */ -#line 1059 "parser.y" - { (yyval.expr) = NULL; } +#line 1032 "parser.y" + { (yyval.declarator) = make_declarator(NULL); (yyval.declarator)->array = append_array((yyval.declarator)->array, (yyvsp[(1) - (1)].expr)); } break; case 352: /* Line 1806 of yacc.c */ -#line 1060 "parser.y" - { (yyval.expr) = (yyvsp[(2) - (2)].expr); } +#line 1034 "parser.y" + { (yyval.declarator) = make_declarator(NULL); + (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[(2) - (3)].var_list))); + (yyval.declarator)->type = NULL; + } break; case 353: /* Line 1806 of yacc.c */ -#line 1063 "parser.y" - { (yyval.declarator) = (yyvsp[(1) - (2)].declarator); (yyval.declarator)->bits = (yyvsp[(2) - (2)].expr); - if (!(yyval.declarator)->bits && !(yyval.declarator)->var->name) - error_loc("unnamed fields are not allowed\n"); +#line 1039 "parser.y" + { (yyval.declarator) = (yyvsp[(1) - (4)].declarator); + (yyval.declarator)->func_type = append_ptrchain_type((yyval.declarator)->type, type_new_function((yyvsp[(3) - (4)].var_list))); + (yyval.declarator)->type = NULL; } break; case 354: /* Line 1806 of yacc.c */ -#line 1070 "parser.y" +#line 1046 "parser.y" { (yyval.declarator_list) = append_declarator( NULL, (yyvsp[(1) - (1)].declarator) ); } break; case 355: /* Line 1806 of yacc.c */ -#line 1072 "parser.y" +#line 1047 "parser.y" { (yyval.declarator_list) = append_declarator( (yyvsp[(1) - (3)].declarator_list), (yyvsp[(3) - (3)].declarator) ); } break; case 356: /* Line 1806 of yacc.c */ -#line 1076 "parser.y" - { (yyval.declarator) = (yyvsp[(1) - (1)].declarator); } +#line 1050 "parser.y" + { (yyval.expr) = NULL; } break; case 357: /* Line 1806 of yacc.c */ -#line 1077 "parser.y" - { (yyval.declarator) = (yyvsp[(1) - (3)].declarator); (yyvsp[(1) - (3)].declarator)->var->eval = (yyvsp[(3) - (3)].expr); } +#line 1051 "parser.y" + { (yyval.expr) = (yyvsp[(2) - (2)].expr); } break; case 358: /* Line 1806 of yacc.c */ -#line 1081 "parser.y" - { (yyval.num) = THREADING_APARTMENT; } +#line 1054 "parser.y" + { (yyval.declarator) = (yyvsp[(1) - (2)].declarator); (yyval.declarator)->bits = (yyvsp[(2) - (2)].expr); + if (!(yyval.declarator)->bits && !(yyval.declarator)->var->name) + error_loc("unnamed fields are not allowed\n"); + } break; case 359: /* Line 1806 of yacc.c */ -#line 1082 "parser.y" - { (yyval.num) = THREADING_NEUTRAL; } +#line 1061 "parser.y" + { (yyval.declarator_list) = append_declarator( NULL, (yyvsp[(1) - (1)].declarator) ); } break; case 360: /* Line 1806 of yacc.c */ -#line 1083 "parser.y" - { (yyval.num) = THREADING_SINGLE; } +#line 1063 "parser.y" + { (yyval.declarator_list) = append_declarator( (yyvsp[(1) - (3)].declarator_list), (yyvsp[(3) - (3)].declarator) ); } break; case 361: /* Line 1806 of yacc.c */ -#line 1084 "parser.y" - { (yyval.num) = THREADING_FREE; } +#line 1067 "parser.y" + { (yyval.declarator) = (yyvsp[(1) - (1)].declarator); } break; case 362: /* Line 1806 of yacc.c */ -#line 1085 "parser.y" - { (yyval.num) = THREADING_BOTH; } +#line 1068 "parser.y" + { (yyval.declarator) = (yyvsp[(1) - (3)].declarator); (yyvsp[(1) - (3)].declarator)->var->eval = (yyvsp[(3) - (3)].expr); } break; case 363: /* Line 1806 of yacc.c */ -#line 1089 "parser.y" - { (yyval.num) = RPC_FC_RP; } +#line 1072 "parser.y" + { (yyval.num) = THREADING_APARTMENT; } break; case 364: /* Line 1806 of yacc.c */ -#line 1090 "parser.y" - { (yyval.num) = RPC_FC_UP; } +#line 1073 "parser.y" + { (yyval.num) = THREADING_NEUTRAL; } break; case 365: /* Line 1806 of yacc.c */ -#line 1091 "parser.y" - { (yyval.num) = RPC_FC_FP; } +#line 1074 "parser.y" + { (yyval.num) = THREADING_SINGLE; } break; case 366: /* Line 1806 of yacc.c */ -#line 1094 "parser.y" - { (yyval.type) = type_new_struct((yyvsp[(2) - (5)].str), TRUE, (yyvsp[(4) - (5)].var_list)); } +#line 1075 "parser.y" + { (yyval.num) = THREADING_FREE; } break; case 367: /* Line 1806 of yacc.c */ -#line 1097 "parser.y" - { (yyval.type) = type_new_void(); } +#line 1076 "parser.y" + { (yyval.num) = THREADING_BOTH; } break; case 368: /* Line 1806 of yacc.c */ -#line 1098 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } +#line 1080 "parser.y" + { (yyval.num) = RPC_FC_RP; } break; case 369: /* Line 1806 of yacc.c */ -#line 1099 "parser.y" - { (yyval.type) = (yyvsp[(1) - (1)].type); } +#line 1081 "parser.y" + { (yyval.num) = RPC_FC_UP; } break; case 370: /* Line 1806 of yacc.c */ -#line 1100 "parser.y" - { (yyval.type) = (yyvsp[(1) - (1)].type); } +#line 1082 "parser.y" + { (yyval.num) = RPC_FC_FP; } break; case 371: /* Line 1806 of yacc.c */ -#line 1101 "parser.y" - { (yyval.type) = type_new_enum((yyvsp[(2) - (2)].str), FALSE, NULL); } +#line 1085 "parser.y" + { (yyval.type) = type_new_struct((yyvsp[(2) - (5)].str), TRUE, (yyvsp[(4) - (5)].var_list)); } break; case 372: /* Line 1806 of yacc.c */ -#line 1102 "parser.y" - { (yyval.type) = (yyvsp[(1) - (1)].type); } +#line 1088 "parser.y" + { (yyval.type) = type_new_void(); } break; case 373: /* Line 1806 of yacc.c */ -#line 1103 "parser.y" - { (yyval.type) = type_new_struct((yyvsp[(2) - (2)].str), FALSE, NULL); } +#line 1089 "parser.y" + { (yyval.type) = find_type_or_error((yyvsp[(1) - (1)].str), 0); } break; case 374: /* Line 1806 of yacc.c */ -#line 1104 "parser.y" +#line 1090 "parser.y" { (yyval.type) = (yyvsp[(1) - (1)].type); } break; case 375: /* Line 1806 of yacc.c */ -#line 1105 "parser.y" - { (yyval.type) = type_new_nonencapsulated_union((yyvsp[(2) - (2)].str), FALSE, NULL); } +#line 1091 "parser.y" + { (yyval.type) = (yyvsp[(1) - (1)].type); } break; case 376: /* Line 1806 of yacc.c */ -#line 1106 "parser.y" - { (yyval.type) = make_safearray((yyvsp[(3) - (4)].type)); } +#line 1092 "parser.y" + { (yyval.type) = type_new_enum((yyvsp[(2) - (2)].str), FALSE, NULL); } break; case 377: /* Line 1806 of yacc.c */ -#line 1110 "parser.y" - { reg_typedefs((yyvsp[(3) - (4)].declspec), (yyvsp[(4) - (4)].declarator_list), check_typedef_attrs((yyvsp[(2) - (4)].attr_list))); - (yyval.statement) = make_statement_typedef((yyvsp[(4) - (4)].declarator_list)); - } +#line 1093 "parser.y" + { (yyval.type) = (yyvsp[(1) - (1)].type); } break; case 378: /* Line 1806 of yacc.c */ -#line 1116 "parser.y" - { (yyval.type) = type_new_nonencapsulated_union((yyvsp[(2) - (5)].str), TRUE, (yyvsp[(4) - (5)].var_list)); } +#line 1094 "parser.y" + { (yyval.type) = type_new_struct((yyvsp[(2) - (2)].str), FALSE, NULL); } break; case 379: /* Line 1806 of yacc.c */ -#line 1119 "parser.y" - { (yyval.type) = type_new_encapsulated_union((yyvsp[(2) - (10)].str), (yyvsp[(5) - (10)].var), (yyvsp[(7) - (10)].var), (yyvsp[(9) - (10)].var_list)); } +#line 1095 "parser.y" + { (yyval.type) = (yyvsp[(1) - (1)].type); } break; case 380: /* Line 1806 of yacc.c */ -#line 1123 "parser.y" - { (yyval.num) = MAKEVERSION((yyvsp[(1) - (1)].num), 0); } +#line 1096 "parser.y" + { (yyval.type) = type_new_nonencapsulated_union((yyvsp[(2) - (2)].str), FALSE, NULL); } break; case 381: /* Line 1806 of yacc.c */ -#line 1124 "parser.y" +#line 1097 "parser.y" + { (yyval.type) = make_safearray((yyvsp[(3) - (4)].type)); } + break; + + case 382: + +/* Line 1806 of yacc.c */ +#line 1101 "parser.y" + { (yyvsp[(1) - (5)].attr_list) = append_attribs((yyvsp[(1) - (5)].attr_list), (yyvsp[(3) - (5)].attr_list)); + reg_typedefs((yyvsp[(4) - (5)].declspec), (yyvsp[(5) - (5)].declarator_list), check_typedef_attrs((yyvsp[(1) - (5)].attr_list))); + (yyval.statement) = make_statement_typedef((yyvsp[(5) - (5)].declarator_list)); + } + break; + + case 383: + +/* Line 1806 of yacc.c */ +#line 1108 "parser.y" + { (yyval.type) = type_new_nonencapsulated_union((yyvsp[(2) - (5)].str), TRUE, (yyvsp[(4) - (5)].var_list)); } + break; + + case 384: + +/* Line 1806 of yacc.c */ +#line 1111 "parser.y" + { (yyval.type) = type_new_encapsulated_union((yyvsp[(2) - (10)].str), (yyvsp[(5) - (10)].var), (yyvsp[(7) - (10)].var), (yyvsp[(9) - (10)].var_list)); } + break; + + case 385: + +/* Line 1806 of yacc.c */ +#line 1115 "parser.y" + { (yyval.num) = MAKEVERSION((yyvsp[(1) - (1)].num), 0); } + break; + + case 386: + +/* Line 1806 of yacc.c */ +#line 1116 "parser.y" { (yyval.num) = MAKEVERSION((yyvsp[(1) - (3)].num), (yyvsp[(3) - (3)].num)); } break; + case 387: + +/* Line 1806 of yacc.c */ +#line 1117 "parser.y" + { (yyval.num) = (yyvsp[(1) - (1)].num); } + break; + /* Line 1806 of yacc.c */ -#line 5489 "parser.tab.c" +#line 5590 "parser.tab.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -5716,7 +5817,7 @@ yyreturn: /* Line 2067 of yacc.c */ -#line 1127 "parser.y" +#line 1120 "parser.y" static void decl_builtin_basic(const char *name, enum type_basic_type type) @@ -6017,11 +6118,6 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl array_dims_t *arr = decl ? decl->array : NULL; type_t *func_type = decl ? decl->func_type : NULL; type_t *type = decl_spec->type; - - /* In case of a range attribute, duplicate the type to keep track of - * the min/max values in the type format string */ - if(is_attr(attrs, ATTR_RANGE)) - type = duptype(type, 1); if (is_attr(type->attrs, ATTR_INLINE)) { @@ -6447,16 +6543,17 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at type_get_type_detect_alias(type) == TYPE_STRUCT || type_get_type_detect_alias(type) == TYPE_UNION || type_get_type_detect_alias(type) == TYPE_ENCAPSULATED_UNION) && - !type->name && !parse_only) + !type->name) { - if (! is_attr(attrs, ATTR_PUBLIC)) + if (! is_attr(attrs, ATTR_PUBLIC) && ! is_attr (attrs, ATTR_HIDDEN)) attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) ); type->name = gen_name(); } - else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC)) + else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC) + && !is_attr(attrs, ATTR_HIDDEN)) attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) ); - /* Append the SWITCHTYPE attribute to a non-encapsulated union if it does not already have it. */ + /* Append the SWITCHTYPE attribute to a union if it does not already have one. */ if (type_get_type_detect_alias(type) == TYPE_UNION && is_attr(attrs, ATTR_SWITCHTYPE) && !is_attr(type->attrs, ATTR_SWITCHTYPE)) @@ -6470,7 +6567,17 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at var_t *name; cur = find_type(decl->var->name, 0); - if (cur) + + /* + * MIDL allows shadowing types that are declared in imported files. + * We don't throw an error in this case and instead add a new type + * (which is earlier on the list in hash table, so it will be used + * instead of shadowed type). + * + * FIXME: We may consider string separated type tables for each input + * for cleaner solution. + */ + if (cur && input_name == cur->loc_info.input_name) error_loc("%s: redefinition error; original definition was at %s:%d\n", cur->name, cur->loc_info.input_name, cur->loc_info.line_number); @@ -6582,7 +6689,7 @@ static char *gen_name(void) if (! file_id) { - char *dst = dup_basename(input_name, ".idl"); + char *dst = dup_basename(input_idl_name, ".idl"); file_id = dst; for (; *dst; ++dst) @@ -6623,6 +6730,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" }, /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" }, + /* ATTR_ASYNCUUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "async_uuid" }, /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" }, /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "bindable" }, /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "broadcast" }, @@ -6658,8 +6766,8 @@ struct allowed_attr allowed_attr[] = /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstring" }, /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstringcontext" }, /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" }, - /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" }, - /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "id" }, + /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" }, + /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, "id" }, /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "idempotent" }, /* ATTR_IGNORE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "ignore" }, /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "iid_is" }, @@ -6667,7 +6775,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" }, /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "in" }, /* ATTR_INLINE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inline" }, - /* ATTR_INPUTSYNC */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" }, + /* ATTR_INPUTSYNC */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" }, /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "length_is" }, /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" }, /* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "licensed" }, @@ -6713,10 +6821,10 @@ struct allowed_attr allowed_attr[] = /* ATTR_UIDEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" }, /* ATTR_USESGETLASTERROR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" }, /* ATTR_USERMARSHAL */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "user_marshal" }, - /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "uuid" }, + /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, "uuid" }, /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" }, /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" }, - /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "version" }, + /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, "version" }, /* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "vi_progid" }, /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" }, }; @@ -7345,6 +7453,13 @@ static statement_t *make_statement_library(typelib_t *typelib) return stmt; } +static statement_t *make_statement_pragma(const char *str) +{ + statement_t *stmt = make_statement(STMT_PRAGMA); + stmt->u.str = str; + return stmt; +} + static statement_t *make_statement_cppquote(const char *str) { statement_t *stmt = make_statement(STMT_CPPQUOTE); @@ -7401,6 +7516,22 @@ static statement_t *make_statement_typedef(declarator_list_t *decls) return stmt; } +static statement_list_t *append_statements(statement_list_t *l1, statement_list_t *l2) +{ + if (!l2) return l1; + if (!l1 || l1 == l2) return l2; + list_move_tail (l1, l2); + return l1; +} + +static attr_list_t *append_attribs(attr_list_t *l1, attr_list_t *l2) +{ + if (!l2) return l1; + if (!l1 || l1 == l2) return l2; + list_move_tail (l1, l2); + return l1; +} + static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt) { if (!stmt) return list; diff --git a/reactos/tools/widl/parser.tab.h b/reactos/tools/widl/parser.tab.h index 8aca8fa6a6d..4a2ac12cb55 100644 --- a/reactos/tools/widl/parser.tab.h +++ b/reactos/tools/widl/parser.tab.h @@ -38,186 +38,188 @@ know about them. */ enum yytokentype { aIDENTIFIER = 258, - aKNOWNTYPE = 259, - aNUM = 260, - aHEXNUM = 261, - aDOUBLE = 262, - aSTRING = 263, - aWSTRING = 264, - aSQSTRING = 265, - aUUID = 266, - aEOF = 267, - SHL = 268, - SHR = 269, - MEMBERPTR = 270, - EQUALITY = 271, - INEQUALITY = 272, - GREATEREQUAL = 273, - LESSEQUAL = 274, - LOGICALOR = 275, - LOGICALAND = 276, - ELLIPSIS = 277, - tAGGREGATABLE = 278, - tALLOCATE = 279, - tANNOTATION = 280, - tAPPOBJECT = 281, - tASYNC = 282, - tASYNCUUID = 283, - tAUTOHANDLE = 284, - tBINDABLE = 285, - tBOOLEAN = 286, - tBROADCAST = 287, - tBYTE = 288, - tBYTECOUNT = 289, - tCALLAS = 290, - tCALLBACK = 291, - tCASE = 292, - tCDECL = 293, - tCHAR = 294, - tCOCLASS = 295, - tCODE = 296, - tCOMMSTATUS = 297, - tCONST = 298, - tCONTEXTHANDLE = 299, - tCONTEXTHANDLENOSERIALIZE = 300, - tCONTEXTHANDLESERIALIZE = 301, - tCONTROL = 302, - tCPPQUOTE = 303, - tDECODE = 304, - tDEFAULT = 305, - tDEFAULTBIND = 306, - tDEFAULTCOLLELEM = 307, - tDEFAULTVALUE = 308, - tDEFAULTVTABLE = 309, - tDISABLECONSISTENCYCHECK = 310, - tDISPLAYBIND = 311, - tDISPINTERFACE = 312, - tDLLNAME = 313, - tDOUBLE = 314, - tDUAL = 315, - tENABLEALLOCATE = 316, - tENCODE = 317, - tENDPOINT = 318, - tENTRY = 319, - tENUM = 320, - tERRORSTATUST = 321, - tEXPLICITHANDLE = 322, - tEXTERN = 323, - tFALSE = 324, - tFASTCALL = 325, - tFAULTSTATUS = 326, - tFLOAT = 327, - tFORCEALLOCATE = 328, - tHANDLE = 329, - tHANDLET = 330, - tHELPCONTEXT = 331, - tHELPFILE = 332, - tHELPSTRING = 333, - tHELPSTRINGCONTEXT = 334, - tHELPSTRINGDLL = 335, - tHIDDEN = 336, - tHYPER = 337, - tID = 338, - tIDEMPOTENT = 339, - tIGNORE = 340, - tIIDIS = 341, - tIMMEDIATEBIND = 342, - tIMPLICITHANDLE = 343, - tIMPORT = 344, - tIMPORTLIB = 345, - tIN = 346, - tIN_LINE = 347, - tINLINE = 348, - tINPUTSYNC = 349, - tINT = 350, - tINT3264 = 351, - tINT64 = 352, - tINTERFACE = 353, - tLCID = 354, - tLENGTHIS = 355, - tLIBRARY = 356, - tLICENSED = 357, - tLOCAL = 358, - tLONG = 359, - tMAYBE = 360, - tMESSAGE = 361, - tMETHODS = 362, - tMODULE = 363, - tNOCODE = 364, - tNONBROWSABLE = 365, - tNONCREATABLE = 366, - tNONEXTENSIBLE = 367, - tNOTIFY = 368, - tNOTIFYFLAG = 369, - tNULL = 370, - tOBJECT = 371, - tODL = 372, - tOLEAUTOMATION = 373, - tOPTIMIZE = 374, - tOPTIONAL = 375, - tOUT = 376, - tPARTIALIGNORE = 377, - tPASCAL = 378, - tPOINTERDEFAULT = 379, - tPROGID = 380, - tPROPERTIES = 381, - tPROPGET = 382, - tPROPPUT = 383, - tPROPPUTREF = 384, - tPROXY = 385, - tPTR = 386, - tPUBLIC = 387, - tRANGE = 388, - tREADONLY = 389, - tREF = 390, - tREGISTER = 391, - tREPRESENTAS = 392, - tREQUESTEDIT = 393, - tRESTRICTED = 394, - tRETVAL = 395, - tSAFEARRAY = 396, - tSHORT = 397, - tSIGNED = 398, - tSIZEIS = 399, - tSIZEOF = 400, - tSMALL = 401, - tSOURCE = 402, - tSTATIC = 403, - tSTDCALL = 404, - tSTRICTCONTEXTHANDLE = 405, - tSTRING = 406, - tSTRUCT = 407, - tSWITCH = 408, - tSWITCHIS = 409, - tSWITCHTYPE = 410, - tTHREADING = 411, - tTRANSMITAS = 412, - tTRUE = 413, - tTYPEDEF = 414, - tUIDEFAULT = 415, - tUNION = 416, - tUNIQUE = 417, - tUNSIGNED = 418, - tUSESGETLASTERROR = 419, - tUSERMARSHAL = 420, - tUUID = 421, - tV1ENUM = 422, - tVARARG = 423, - tVERSION = 424, - tVIPROGID = 425, - tVOID = 426, - tWCHAR = 427, - tWIREMARSHAL = 428, - tAPARTMENT = 429, - tNEUTRAL = 430, - tSINGLE = 431, - tFREE = 432, - tBOTH = 433, - ADDRESSOF = 434, - NEG = 435, - POS = 436, - PPTR = 437, - CAST = 438 + aPRAGMA = 259, + aKNOWNTYPE = 260, + aNUM = 261, + aHEXNUM = 262, + aDOUBLE = 263, + aSTRING = 264, + aWSTRING = 265, + aSQSTRING = 266, + aUUID = 267, + aEOF = 268, + SHL = 269, + SHR = 270, + MEMBERPTR = 271, + EQUALITY = 272, + INEQUALITY = 273, + GREATEREQUAL = 274, + LESSEQUAL = 275, + LOGICALOR = 276, + LOGICALAND = 277, + ELLIPSIS = 278, + tAGGREGATABLE = 279, + tALLOCATE = 280, + tANNOTATION = 281, + tAPPOBJECT = 282, + tASYNC = 283, + tASYNCUUID = 284, + tAUTOHANDLE = 285, + tBINDABLE = 286, + tBOOLEAN = 287, + tBROADCAST = 288, + tBYTE = 289, + tBYTECOUNT = 290, + tCALLAS = 291, + tCALLBACK = 292, + tCASE = 293, + tCDECL = 294, + tCHAR = 295, + tCOCLASS = 296, + tCODE = 297, + tCOMMSTATUS = 298, + tCONST = 299, + tCONTEXTHANDLE = 300, + tCONTEXTHANDLENOSERIALIZE = 301, + tCONTEXTHANDLESERIALIZE = 302, + tCONTROL = 303, + tCPPQUOTE = 304, + tDECODE = 305, + tDEFAULT = 306, + tDEFAULTBIND = 307, + tDEFAULTCOLLELEM = 308, + tDEFAULTVALUE = 309, + tDEFAULTVTABLE = 310, + tDISABLECONSISTENCYCHECK = 311, + tDISPLAYBIND = 312, + tDISPINTERFACE = 313, + tDLLNAME = 314, + tDOUBLE = 315, + tDUAL = 316, + tENABLEALLOCATE = 317, + tENCODE = 318, + tENDPOINT = 319, + tENTRY = 320, + tENUM = 321, + tERRORSTATUST = 322, + tEXPLICITHANDLE = 323, + tEXTERN = 324, + tFALSE = 325, + tFASTCALL = 326, + tFAULTSTATUS = 327, + tFLOAT = 328, + tFORCEALLOCATE = 329, + tHANDLE = 330, + tHANDLET = 331, + tHELPCONTEXT = 332, + tHELPFILE = 333, + tHELPSTRING = 334, + tHELPSTRINGCONTEXT = 335, + tHELPSTRINGDLL = 336, + tHIDDEN = 337, + tHYPER = 338, + tID = 339, + tIDEMPOTENT = 340, + tIGNORE = 341, + tIIDIS = 342, + tIMMEDIATEBIND = 343, + tIMPLICITHANDLE = 344, + tIMPORT = 345, + tIMPORTLIB = 346, + tIN = 347, + tIN_LINE = 348, + tINLINE = 349, + tINPUTSYNC = 350, + tINT = 351, + tINT3264 = 352, + tINT64 = 353, + tINTERFACE = 354, + tLCID = 355, + tLENGTHIS = 356, + tLIBRARY = 357, + tLICENSED = 358, + tLOCAL = 359, + tLONG = 360, + tMAYBE = 361, + tMESSAGE = 362, + tMETHODS = 363, + tMODULE = 364, + tNAMESPACE = 365, + tNOCODE = 366, + tNONBROWSABLE = 367, + tNONCREATABLE = 368, + tNONEXTENSIBLE = 369, + tNOTIFY = 370, + tNOTIFYFLAG = 371, + tNULL = 372, + tOBJECT = 373, + tODL = 374, + tOLEAUTOMATION = 375, + tOPTIMIZE = 376, + tOPTIONAL = 377, + tOUT = 378, + tPARTIALIGNORE = 379, + tPASCAL = 380, + tPOINTERDEFAULT = 381, + tPROGID = 382, + tPROPERTIES = 383, + tPROPGET = 384, + tPROPPUT = 385, + tPROPPUTREF = 386, + tPROXY = 387, + tPTR = 388, + tPUBLIC = 389, + tRANGE = 390, + tREADONLY = 391, + tREF = 392, + tREGISTER = 393, + tREPRESENTAS = 394, + tREQUESTEDIT = 395, + tRESTRICTED = 396, + tRETVAL = 397, + tSAFEARRAY = 398, + tSHORT = 399, + tSIGNED = 400, + tSIZEIS = 401, + tSIZEOF = 402, + tSMALL = 403, + tSOURCE = 404, + tSTATIC = 405, + tSTDCALL = 406, + tSTRICTCONTEXTHANDLE = 407, + tSTRING = 408, + tSTRUCT = 409, + tSWITCH = 410, + tSWITCHIS = 411, + tSWITCHTYPE = 412, + tTHREADING = 413, + tTRANSMITAS = 414, + tTRUE = 415, + tTYPEDEF = 416, + tUIDEFAULT = 417, + tUNION = 418, + tUNIQUE = 419, + tUNSIGNED = 420, + tUSESGETLASTERROR = 421, + tUSERMARSHAL = 422, + tUUID = 423, + tV1ENUM = 424, + tVARARG = 425, + tVERSION = 426, + tVIPROGID = 427, + tVOID = 428, + tWCHAR = 429, + tWIREMARSHAL = 430, + tAPARTMENT = 431, + tNEUTRAL = 432, + tSINGLE = 433, + tFREE = 434, + tBOTH = 435, + ADDRESSOF = 436, + NEG = 437, + POS = 438, + PPTR = 439, + CAST = 440 }; #endif @@ -228,7 +230,7 @@ typedef union YYSTYPE { /* Line 2068 of yacc.c */ -#line 153 "parser.y" +#line 129 "parser.y" attr_t *attr; attr_list_t *attr_list; @@ -258,7 +260,7 @@ typedef union YYSTYPE /* Line 2068 of yacc.c */ -#line 262 "parser.tab.h" +#line 264 "parser.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/reactos/tools/widl/parser.y b/reactos/tools/widl/parser.y index 9f2ea4e4e47..2192bea4245 100644 --- a/reactos/tools/widl/parser.y +++ b/reactos/tools/widl/parser.y @@ -38,33 +38,6 @@ #include "expr.h" #include "typetree.h" -#if defined(YYBYACC) - /* Berkeley yacc (byacc) doesn't seem to know about these */ - /* Some *BSD supplied versions do define these though */ -# ifndef YYEMPTY -# define YYEMPTY (-1) /* Empty lookahead value of yychar */ -# endif -# ifndef YYLEX -# define YYLEX yylex() -# endif - -#elif defined(YYBISON) - /* Bison was used for original development */ - /* #define YYEMPTY -2 */ - /* #define YYLEX yylex() */ - -#else - /* No yacc we know yet */ -# if !defined(YYEMPTY) || !defined(YYLEX) -# error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX. -# elif defined(__GNUC__) /* gcc defines the #warning directive */ -# warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested - /* #else we just take a chance that it works... */ -# endif -#endif - -#define YYERROR_VERBOSE - static unsigned char pointer_default = RPC_FC_UP; typedef struct list typelist_t; @@ -141,6 +114,7 @@ static statement_t *make_statement_type_decl(type_t *type); static statement_t *make_statement_reference(type_t *type); static statement_t *make_statement_declaration(var_t *var); static statement_t *make_statement_library(typelib_t *typelib); +static statement_t *make_statement_pragma(const char *str); static statement_t *make_statement_cppquote(const char *str); static statement_t *make_statement_importlib(const char *str); static statement_t *make_statement_module(type_t *type); @@ -148,6 +122,8 @@ static statement_t *make_statement_typedef(var_list_t *names); static statement_t *make_statement_import(const char *str); static statement_t *make_statement_typedef(var_list_t *names); static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt); +static statement_list_t *append_statements(statement_list_t *, statement_list_t *); +static attr_list_t *append_attribs(attr_list_t *, attr_list_t *); %} %union { @@ -177,7 +153,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s enum storage_class stgclass; } -%token aIDENTIFIER +%token aIDENTIFIER aPRAGMA %token aKNOWNTYPE %token aNUM aHEXNUM %token aDOUBLE @@ -229,6 +205,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s %token tMAYBE tMESSAGE %token tMETHODS %token tMODULE +%token tNAMESPACE %token tNOCODE tNONBROWSABLE %token tNONCREATABLE %token tNONEXTENSIBLE @@ -285,6 +262,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s %type inherit interface interfacedef interfacedec %type dispinterface dispinterfacehdr dispinterfacedef %type module modulehdr moduledef +%type namespacedef %type base_type int_std %type enumdef structdef uniondef typedecl %type type @@ -323,6 +301,8 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s %right '!' '~' CAST PPTR POS NEG ADDRESSOF tSIZEOF %left '.' MEMBERPTR '[' ']' +%error-verbose + %% input: gbl_statements { fix_incomplete(); @@ -340,6 +320,8 @@ input: gbl_statements { fix_incomplete(); ; gbl_statements: { $$ = NULL; } + | gbl_statements namespacedef '{' gbl_statements '}' + { $$ = append_statements($1, $4); } | gbl_statements interfacedec { $$ = append_statement($1, make_statement_reference($2)); } | gbl_statements interfacedef { $$ = append_statement($1, make_statement_type_decl($2)); } | gbl_statements coclass ';' { $$ = $1; @@ -355,6 +337,8 @@ gbl_statements: { $$ = NULL; } imp_statements: { $$ = NULL; } | imp_statements interfacedec { $$ = append_statement($1, make_statement_reference($2)); } + | imp_statements namespacedef '{' imp_statements '}' + { $$ = append_statements($1, $4); } | imp_statements interfacedef { $$ = append_statement($1, make_statement_type_decl($2)); } | imp_statements coclass ';' { $$ = $1; reg_type($2, $2->name, 0); } | imp_statements coclassdef { $$ = append_statement($1, make_statement_type_decl($2)); @@ -380,6 +364,7 @@ statement: | declaration ';' { $$ = make_statement_declaration($1); } | import { $$ = make_statement_import($1); } | typedef ';' { $$ = $1; } + | aPRAGMA { $$ = make_statement_pragma($1); } ; typedecl: @@ -573,6 +558,7 @@ attribute: { $$ = NULL; } | tUSESGETLASTERROR { $$ = make_attr(ATTR_USESGETLASTERROR); } | tUSERMARSHAL '(' type ')' { $$ = make_attrp(ATTR_USERMARSHAL, $3); } | tUUID '(' uuid_string ')' { $$ = make_attrp(ATTR_UUID, $3); } + | tASYNCUUID '(' uuid_string ')' { $$ = make_attrp(ATTR_ASYNCUUID, $3); } | tV1ENUM { $$ = make_attr(ATTR_V1ENUM); } | tVARARG { $$ = make_attr(ATTR_VARARG); } | tVERSION '(' version ')' { $$ = make_attrv(ATTR_VERSION, $3); } @@ -826,6 +812,9 @@ coclassdef: coclasshdr '{' coclass_ints '}' semicolon_opt { $$ = type_coclass_define($1, $3); } ; +namespacedef: tNAMESPACE aIDENTIFIER { $$ = NULL; } + ; + coclass_ints: { $$ = NULL; } | coclass_ints coclass_int { $$ = append_ifref( $1, $2 ); } ; @@ -887,6 +876,8 @@ interfacehdr: attributes interface { $$.interface = $2; interfacedef: interfacehdr inherit '{' int_statements '}' semicolon_opt { $$ = $1.interface; + if($$ == $2) + error_loc("Interface can't inherit from itself\n"); type_interface_define($$, $2, $4); pointer_default = $1.old_pointer_default; } @@ -1106,9 +1097,10 @@ type: tVOID { $$ = type_new_void(); } | tSAFEARRAY '(' type ')' { $$ = make_safearray($3); } ; -typedef: tTYPEDEF m_attributes decl_spec declarator_list - { reg_typedefs($3, $4, check_typedef_attrs($2)); - $$ = make_statement_typedef($4); +typedef: m_attributes tTYPEDEF m_attributes decl_spec declarator_list + { $1 = append_attribs($1, $3); + reg_typedefs($4, $5, check_typedef_attrs($1)); + $$ = make_statement_typedef($5); } ; @@ -1122,6 +1114,7 @@ uniondef: tUNION t_ident '{' ne_union_fields '}' version: aNUM { $$ = MAKEVERSION($1, 0); } | aNUM '.' aNUM { $$ = MAKEVERSION($1, $3); } + | aHEXNUM { $$ = $1; } ; %% @@ -1424,11 +1417,6 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl array_dims_t *arr = decl ? decl->array : NULL; type_t *func_type = decl ? decl->func_type : NULL; type_t *type = decl_spec->type; - - /* In case of a range attribute, duplicate the type to keep track of - * the min/max values in the type format string */ - if(is_attr(attrs, ATTR_RANGE)) - type = duptype(type, 1); if (is_attr(type->attrs, ATTR_INLINE)) { @@ -1854,13 +1842,14 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at type_get_type_detect_alias(type) == TYPE_STRUCT || type_get_type_detect_alias(type) == TYPE_UNION || type_get_type_detect_alias(type) == TYPE_ENCAPSULATED_UNION) && - !type->name && !parse_only) + !type->name) { - if (! is_attr(attrs, ATTR_PUBLIC)) + if (! is_attr(attrs, ATTR_PUBLIC) && ! is_attr (attrs, ATTR_HIDDEN)) attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) ); type->name = gen_name(); } - else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC)) + else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC) + && !is_attr(attrs, ATTR_HIDDEN)) attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) ); /* Append the SWITCHTYPE attribute to a non-encapsulated union if it does not already have it. */ @@ -1877,7 +1866,17 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at var_t *name; cur = find_type(decl->var->name, 0); - if (cur) + + /* + * MIDL allows shadowing types that are declared in imported files. + * We don't throw an error in this case and instead add a new type + * (which is earlier on the list in hash table, so it will be used + * instead of shadowed type). + * + * FIXME: We may consider string separated type tables for each input + * for cleaner solution. + */ + if (cur && input_name == cur->loc_info.input_name) error_loc("%s: redefinition error; original definition was at %s:%d\n", cur->name, cur->loc_info.input_name, cur->loc_info.line_number); @@ -1989,7 +1988,7 @@ static char *gen_name(void) if (! file_id) { - char *dst = dup_basename(input_name, ".idl"); + char *dst = dup_basename(input_idl_name, ".idl"); file_id = dst; for (; *dst; ++dst) @@ -2030,6 +2029,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" }, /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" }, + /* ATTR_ASYNCUUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "async_uuid" }, /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" }, /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "bindable" }, /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "broadcast" }, @@ -2065,8 +2065,8 @@ struct allowed_attr allowed_attr[] = /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstring" }, /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstringcontext" }, /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" }, - /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" }, - /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "id" }, + /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" }, + /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, "id" }, /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "idempotent" }, /* ATTR_IGNORE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "ignore" }, /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "iid_is" }, @@ -2074,7 +2074,7 @@ struct allowed_attr allowed_attr[] = /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" }, /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "in" }, /* ATTR_INLINE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inline" }, - /* ATTR_INPUTSYNC */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" }, + /* ATTR_INPUTSYNC */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" }, /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "length_is" }, /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" }, /* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "licensed" }, @@ -2120,10 +2120,10 @@ struct allowed_attr allowed_attr[] = /* ATTR_UIDEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" }, /* ATTR_USESGETLASTERROR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" }, /* ATTR_USERMARSHAL */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "user_marshal" }, - /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "uuid" }, + /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, "uuid" }, /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" }, /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" }, - /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "version" }, + /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, "version" }, /* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "vi_progid" }, /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" }, }; @@ -2752,6 +2752,13 @@ static statement_t *make_statement_library(typelib_t *typelib) return stmt; } +static statement_t *make_statement_pragma(const char *str) +{ + statement_t *stmt = make_statement(STMT_PRAGMA); + stmt->u.str = str; + return stmt; +} + static statement_t *make_statement_cppquote(const char *str) { statement_t *stmt = make_statement(STMT_CPPQUOTE); @@ -2808,6 +2815,22 @@ static statement_t *make_statement_typedef(declarator_list_t *decls) return stmt; } +static statement_list_t *append_statements(statement_list_t *l1, statement_list_t *l2) +{ + if (!l2) return l1; + if (!l1 || l1 == l2) return l2; + list_move_tail (l1, l2); + return l1; +} + +static attr_list_t *append_attribs(attr_list_t *l1, attr_list_t *l2) +{ + if (!l2) return l1; + if (!l1 || l1 == l2) return l2; + list_move_tail (l1, l2); + return l1; +} + static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt) { if (!stmt) return list; diff --git a/reactos/tools/widl/parser.yy.c b/reactos/tools/widl/parser.yy.c index f7904240587..5340952788e 100644 --- a/reactos/tools/widl/parser.yy.c +++ b/reactos/tools/widl/parser.yy.c @@ -73,7 +73,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -104,6 +103,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -160,7 +161,15 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -379,8 +388,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 36 -#define YY_END_OF_BUFFER 37 +#define YY_NUM_RULES 39 +#define YY_END_OF_BUFFER 40 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -388,24 +397,27 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[148] = +static yyconst flex_int16_t yy_accept[174] = { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, - 0, 0, 37, 35, 24, 23, 35, 3, 35, 7, - 35, 35, 19, 19, 35, 35, 35, 22, 22, 22, - 14, 35, 24, 1, 13, 36, 4, 13, 6, 19, - 19, 16, 16, 16, 15, 2, 8, 13, 29, 33, - 27, 0, 0, 19, 19, 19, 0, 25, 31, 28, - 30, 26, 22, 5, 22, 32, 0, 1, 1, 12, - 10, 9, 19, 0, 16, 16, 2, 11, 34, 20, - 19, 19, 18, 22, 19, 0, 16, 0, 18, 18, - 22, 19, 0, 16, 0, 20, 18, 18, 22, 19, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, + 5, 5, 0, 0, 40, 38, 27, 26, 38, 6, + 38, 10, 38, 38, 22, 22, 38, 38, 38, 25, + 25, 25, 17, 38, 27, 2, 16, 39, 7, 16, + 9, 22, 22, 19, 19, 19, 18, 27, 2, 3, + 5, 5, 11, 16, 32, 36, 30, 0, 0, 22, + 22, 22, 0, 28, 34, 31, 33, 29, 25, 8, + 25, 35, 0, 2, 2, 0, 15, 13, 12, 22, + 0, 19, 19, 0, 2, 2, 3, 5, 5, 14, + 37, 23, 22, 22, 21, 25, 0, 22, 0, 19, - 0, 16, 22, 19, 0, 16, 22, 19, 0, 16, - 22, 19, 0, 16, 22, 0, 19, 0, 21, 0, + 5, 0, 21, 21, 25, 0, 22, 0, 19, 5, + 0, 23, 21, 21, 25, 0, 22, 0, 19, 5, + 25, 0, 22, 0, 19, 5, 25, 0, 22, 0, + 19, 5, 25, 1, 22, 0, 19, 5, 25, 0, + 22, 4, 0, 24, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 17, 0 + 0, 20, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -419,11 +431,11 @@ static yyconst flex_int32_t yy_ec[256] = 16, 17, 1, 1, 18, 19, 19, 19, 20, 21, 22, 22, 22, 22, 22, 23, 22, 22, 22, 22, 22, 24, 25, 22, 26, 22, 22, 27, 28, 22, - 29, 30, 31, 1, 22, 1, 19, 19, 19, 19, + 29, 30, 31, 1, 32, 1, 33, 19, 34, 35, - 32, 19, 22, 22, 22, 22, 22, 33, 22, 22, - 22, 22, 22, 22, 22, 22, 34, 22, 22, 35, - 22, 22, 1, 36, 1, 1, 1, 1, 1, 1, + 36, 19, 37, 38, 39, 22, 22, 40, 41, 22, + 42, 43, 22, 44, 22, 22, 45, 22, 22, 46, + 22, 22, 1, 47, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -440,182 +452,227 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[37] = +static yyconst flex_int32_t yy_meta[48] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 1, 1, - 1, 3, 4, 4, 4, 1 + 1, 4, 3, 3, 3, 3, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 1 } ; -static yyconst flex_int16_t yy_base[184] = +static yyconst flex_int16_t yy_base[214] = { 0, - 0, 35, 35, 39, 40, 43, 61, 45, 262, 261, - 46, 47, 263, 481, 481, 481, 246, 481, 254, 481, - 243, 243, 85, 25, 41, 238, 42, 0, 248, 229, - 481, 210, 60, 243, 481, 481, 481, 34, 481, 108, - 26, 131, 154, 239, 481, 0, 481, 60, 481, 481, - 481, 231, 58, 0, 75, 77, 0, 481, 481, 481, - 481, 481, 0, 481, 220, 481, 61, 238, 236, 481, - 481, 481, 174, 0, 196, 0, 0, 481, 481, 93, - 481, 481, 113, 213, 216, 0, 238, 166, 89, 81, - 214, 258, 0, 280, 89, 169, 481, 481, 207, 300, + 0, 46, 46, 50, 51, 54, 84, 56, 345, 344, + 129, 130, 131, 132, 346, 639, 639, 639, 325, 639, + 333, 639, 322, 326, 160, 124, 45, 321, 47, 0, + 331, 316, 639, 286, 63, 139, 639, 639, 639, 45, + 639, 194, 117, 228, 0, 326, 639, 64, 324, 0, + 0, 286, 639, 135, 639, 639, 639, 312, 54, 154, + 130, 119, 0, 639, 639, 639, 639, 639, 0, 639, + 296, 639, 71, 146, 147, 272, 639, 639, 639, 252, + 0, 285, 0, 72, 313, 312, 0, 0, 278, 639, + 639, 140, 639, 639, 158, 291, 277, 309, 0, 342, - 0, 322, 203, 342, 0, 364, 208, 384, 0, 406, - 197, 428, 213, 212, 115, 0, 211, 128, 481, 0, - 0, 0, 210, 0, 0, 0, 0, 209, 0, 0, - 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 481, 481, 462, 466, 468, - 472, 476, 215, 210, 209, 208, 202, 201, 200, 199, - 196, 195, 193, 188, 187, 182, 181, 178, 175, 168, - 167, 166, 159, 158, 157, 145, 135, 130, 129, 113, - 102, 88, 75 + 269, 182, 152, 162, 290, 265, 366, 0, 399, 269, + 58, 196, 639, 639, 276, 255, 423, 0, 456, 259, + 270, 258, 480, 0, 513, 255, 266, 281, 537, 0, + 570, 244, 251, 275, 212, 265, 263, 227, 143, 0, + 267, 0, 149, 639, 0, 0, 0, 0, 257, 0, + 0, 0, 0, 256, 0, 0, 0, 0, 249, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 639, 639, 606, 610, 614, 616, 620, 622, 626, + 630, 256, 255, 253, 252, 251, 250, 248, 247, 634, + 242, 241, 240, 234, 233, 230, 228, 221, 219, 216, + + 215, 208, 201, 198, 188, 185, 176, 154, 152, 143, + 80, 79, 76 } ; -static yyconst flex_int16_t yy_def[184] = +static yyconst flex_int16_t yy_def[214] = { 0, - 147, 1, 148, 148, 148, 148, 1, 7, 149, 149, - 148, 148, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 23, 147, 147, 147, 150, 150, 150, - 147, 147, 147, 147, 147, 147, 147, 151, 147, 147, - 40, 147, 42, 43, 147, 152, 147, 151, 147, 147, - 147, 147, 147, 24, 147, 147, 153, 147, 147, 147, - 147, 147, 150, 147, 150, 147, 147, 147, 147, 147, - 147, 147, 147, 154, 43, 43, 152, 147, 147, 147, - 147, 147, 153, 150, 147, 155, 43, 147, 147, 147, - 150, 147, 156, 43, 147, 147, 147, 147, 150, 147, + 173, 1, 174, 174, 174, 174, 173, 7, 175, 175, + 176, 176, 174, 174, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 177, + 177, 177, 173, 173, 173, 173, 173, 173, 173, 178, + 173, 173, 42, 179, 179, 179, 173, 173, 173, 180, + 181, 181, 173, 178, 173, 173, 173, 173, 173, 173, + 173, 173, 182, 173, 173, 173, 173, 173, 177, 173, + 177, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 183, 179, 179, 173, 173, 173, 180, 181, 181, 173, + 173, 173, 173, 173, 182, 177, 173, 173, 184, 179, - 157, 43, 150, 147, 158, 43, 150, 147, 159, 43, - 150, 147, 147, 43, 150, 160, 112, 147, 147, 161, - 162, 163, 147, 164, 165, 166, 167, 147, 168, 169, - 170, 171, 147, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 147, 0, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147 + 181, 173, 173, 173, 177, 173, 173, 185, 179, 181, + 173, 173, 173, 173, 177, 173, 173, 186, 179, 181, + 177, 173, 173, 187, 179, 181, 177, 173, 173, 188, + 179, 181, 177, 173, 173, 173, 179, 181, 177, 189, + 173, 190, 173, 173, 191, 190, 192, 193, 173, 194, + 195, 196, 197, 173, 198, 199, 200, 201, 173, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 173, 0, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173 } ; -static yyconst flex_int16_t yy_nxt[518] = +static yyconst flex_int16_t yy_nxt[687] = { 0, - 14, 15, 16, 17, 18, 14, 19, 20, 14, 14, - 21, 22, 23, 24, 25, 26, 27, 28, 28, 28, - 28, 28, 29, 28, 30, 28, 28, 28, 31, 14, - 14, 28, 28, 28, 28, 32, 33, 36, 71, 37, - 34, 36, 36, 37, 39, 36, 33, 39, 36, 36, - 34, 147, 147, 47, 47, 58, 59, 61, 62, 147, - 147, 67, 67, 72, 38, 68, 68, 78, 38, 38, - 80, 80, 38, 40, 41, 48, 48, 146, 42, 42, - 42, 42, 43, 44, 43, 43, 43, 43, 43, 72, - 145, 45, 42, 43, 43, 43, 53, 54, 54, 82, + 16, 17, 18, 19, 20, 16, 21, 22, 16, 16, + 23, 24, 25, 26, 27, 28, 29, 30, 30, 30, + 30, 30, 31, 30, 32, 30, 30, 30, 33, 16, + 16, 30, 30, 30, 30, 30, 30, 30, 30, 30, + 30, 30, 30, 30, 30, 30, 34, 35, 38, 78, + 39, 36, 38, 38, 39, 41, 38, 48, 41, 64, + 65, 49, 67, 68, 73, 84, 92, 92, 74, 85, + 112, 112, 73, 84, 79, 40, 74, 85, 172, 40, + 40, 171, 170, 40, 16, 17, 18, 19, 20, 16, + 21, 22, 16, 16, 23, 24, 42, 43, 27, 28, - 81, 96, 96, 98, 144, 80, 80, 55, 81, 82, - 56, 57, 88, 98, 97, 143, 118, 55, 56, 57, - 73, 73, 97, 119, 88, 74, 74, 74, 74, 118, - 55, 142, 141, 56, 57, 89, 119, 140, 90, 74, - 55, 56, 57, 75, 75, 89, 90, 139, 75, 75, - 75, 75, 76, 76, 76, 76, 76, 76, 76, 138, - 137, 136, 75, 76, 76, 76, 76, 76, 135, 133, - 132, 76, 76, 76, 76, 95, 95, 131, 96, 96, - 130, 96, 96, 128, 127, 76, 85, 85, 88, 126, - 125, 86, 86, 86, 86, 123, 55, 122, 121, 56, + 29, 44, 44, 44, 44, 45, 46, 45, 45, 45, + 45, 45, 33, 16, 47, 45, 44, 44, 44, 44, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 34, 38, 38, 38, 38, 59, 60, 60, 53, 53, + 75, 94, 90, 173, 143, 169, 61, 75, 75, 62, + 143, 144, 92, 92, 168, 93, 167, 144, 94, 102, + 54, 54, 173, 61, 79, 59, 60, 60, 62, 52, + 52, 59, 60, 60, 93, 102, 61, 113, 166, 62, + 103, 76, 61, 104, 114, 62, 63, 165, 76, 76, + 164, 111, 111, 61, 112, 112, 113, 103, 62, 61, - 88, 120, 113, 109, 105, 86, 55, 56, 87, 87, - 101, 93, 86, 87, 87, 87, 87, 83, 134, 129, - 124, 147, 116, 116, 115, 111, 107, 87, 92, 92, - 103, 99, 91, 93, 93, 93, 93, 69, 55, 69, - 84, 56, 79, 64, 69, 66, 65, 93, 55, 56, - 94, 94, 64, 60, 52, 94, 94, 94, 94, 51, - 50, 49, 147, 36, 36, 147, 147, 147, 147, 94, - 100, 100, 147, 147, 147, 101, 101, 101, 101, 147, - 55, 147, 147, 56, 147, 147, 147, 147, 147, 101, - 55, 56, 102, 102, 147, 147, 147, 102, 102, 102, + 163, 114, 104, 162, 62, 63, 80, 80, 112, 112, + 161, 81, 81, 81, 81, 102, 61, 159, 158, 62, + 63, 157, 140, 156, 141, 141, 81, 81, 81, 81, + 154, 102, 153, 61, 61, 152, 151, 62, 62, 63, + 82, 82, 149, 148, 147, 82, 82, 82, 82, 145, + 136, 61, 130, 124, 118, 108, 62, 99, 95, 160, + 82, 82, 82, 82, 98, 98, 155, 150, 142, 99, + 99, 99, 99, 140, 61, 140, 134, 62, 139, 141, + 141, 138, 134, 133, 99, 99, 99, 99, 132, 61, + 128, 61, 62, 127, 126, 122, 62, 100, 100, 121, - 102, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 102, 104, 104, 147, 147, 147, 105, 105, 105, - 105, 147, 55, 147, 147, 56, 147, 147, 147, 147, - 147, 105, 55, 56, 106, 106, 147, 147, 147, 106, - 106, 106, 106, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 106, 108, 108, 147, 147, 147, 109, - 109, 109, 109, 147, 55, 147, 147, 56, 147, 147, - 147, 147, 147, 109, 55, 56, 110, 110, 147, 147, - 147, 110, 110, 110, 110, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 110, 112, 112, 147, 147, + 120, 116, 100, 100, 100, 100, 61, 115, 110, 106, + 105, 62, 101, 86, 86, 97, 96, 100, 100, 100, + 100, 107, 107, 91, 89, 86, 108, 108, 108, 108, + 70, 61, 72, 71, 62, 70, 66, 58, 57, 56, + 55, 108, 108, 108, 108, 173, 38, 38, 61, 173, + 173, 173, 173, 62, 109, 109, 173, 173, 173, 109, + 109, 109, 109, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 109, 109, 109, 109, 117, 117, + 173, 173, 173, 118, 118, 118, 118, 173, 61, 173, + 173, 62, 173, 173, 173, 173, 173, 173, 118, 118, - 147, 113, 113, 113, 113, 147, 55, 147, 147, 56, - 147, 147, 147, 147, 147, 113, 55, 56, 114, 114, - 147, 147, 147, 114, 114, 114, 114, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 114, 116, 147, - 117, 117, 147, 147, 147, 147, 147, 147, 147, 147, - 55, 147, 147, 56, 147, 147, 147, 147, 147, 147, - 55, 56, 35, 35, 35, 35, 46, 46, 46, 46, - 63, 63, 70, 147, 70, 70, 77, 147, 77, 77, - 13, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 118, 118, 173, 173, 173, 61, 173, 173, 173, 173, + 62, 119, 119, 173, 173, 173, 119, 119, 119, 119, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 119, 119, 119, 119, 123, 123, 173, 173, 173, + 124, 124, 124, 124, 173, 61, 173, 173, 62, 173, + 173, 173, 173, 173, 173, 124, 124, 124, 124, 173, + 173, 173, 61, 173, 173, 173, 173, 62, 125, 125, + 173, 173, 173, 125, 125, 125, 125, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 125, 125, + 125, 125, 129, 129, 173, 173, 173, 130, 130, 130, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147 + 130, 173, 61, 173, 173, 62, 173, 173, 173, 173, + 173, 173, 130, 130, 130, 130, 173, 173, 173, 61, + 173, 173, 173, 173, 62, 131, 131, 173, 173, 173, + 131, 131, 131, 131, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 131, 131, 131, 131, 135, + 135, 173, 173, 173, 136, 136, 136, 136, 173, 61, + 173, 173, 62, 173, 173, 173, 173, 173, 173, 136, + 136, 136, 136, 173, 173, 173, 61, 173, 173, 173, + 173, 62, 137, 137, 173, 173, 173, 137, 137, 137, + 137, 173, 173, 173, 173, 173, 173, 173, 173, 173, + + 173, 173, 137, 137, 137, 137, 37, 37, 37, 37, + 50, 50, 50, 50, 51, 51, 51, 51, 69, 69, + 77, 173, 77, 77, 83, 83, 87, 173, 87, 87, + 88, 173, 88, 88, 146, 173, 146, 146, 15, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173 } ; -static yyconst flex_int16_t yy_chk[518] = +static yyconst flex_int16_t yy_chk[687] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 3, 38, 3, - 2, 4, 5, 4, 5, 6, 8, 6, 11, 12, - 8, 24, 41, 11, 12, 25, 25, 27, 27, 24, - 41, 33, 67, 38, 3, 33, 67, 48, 4, 5, - 53, 53, 6, 7, 7, 11, 12, 183, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 48, - 182, 7, 7, 7, 7, 7, 23, 23, 23, 56, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 3, 40, + 3, 2, 4, 5, 4, 5, 6, 8, 6, 27, + 27, 8, 29, 29, 35, 48, 59, 59, 35, 48, + 111, 111, 73, 84, 40, 3, 73, 84, 213, 4, + 5, 212, 211, 6, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 55, 95, 95, 90, 181, 80, 80, 23, 55, 56, - 23, 23, 80, 90, 89, 180, 115, 23, 23, 23, - 40, 40, 89, 115, 80, 40, 40, 40, 40, 118, - 40, 179, 178, 40, 40, 83, 118, 177, 83, 40, - 40, 40, 40, 42, 42, 83, 83, 176, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 175, - 174, 173, 42, 42, 42, 42, 43, 43, 172, 171, - 170, 43, 43, 43, 43, 88, 88, 169, 88, 88, - 168, 96, 96, 167, 166, 43, 73, 73, 96, 165, - 164, 73, 73, 73, 73, 163, 73, 162, 161, 73, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 11, 12, 13, 14, 26, 26, 26, 13, 14, + 36, 62, 54, 43, 139, 210, 26, 74, 75, 26, + 143, 139, 92, 92, 209, 61, 208, 143, 62, 92, + 13, 14, 43, 26, 54, 60, 60, 60, 26, 11, + 12, 25, 25, 25, 61, 92, 60, 103, 207, 60, + 95, 36, 25, 95, 104, 25, 25, 206, 74, 75, + 205, 102, 102, 60, 102, 102, 103, 95, 60, 25, - 96, 160, 159, 158, 157, 73, 73, 73, 75, 75, - 156, 155, 154, 75, 75, 75, 75, 153, 133, 128, - 123, 117, 114, 113, 111, 107, 103, 75, 85, 85, - 99, 91, 84, 85, 85, 85, 85, 69, 85, 68, - 65, 85, 52, 44, 34, 32, 30, 85, 85, 85, - 87, 87, 29, 26, 22, 87, 87, 87, 87, 21, - 19, 17, 13, 10, 9, 0, 0, 0, 0, 87, - 92, 92, 0, 0, 0, 92, 92, 92, 92, 0, - 92, 0, 0, 92, 0, 0, 0, 0, 0, 92, - 92, 92, 94, 94, 0, 0, 0, 94, 94, 94, + 204, 104, 95, 203, 25, 25, 42, 42, 112, 112, + 202, 42, 42, 42, 42, 112, 42, 201, 200, 42, + 42, 199, 135, 198, 135, 135, 42, 42, 42, 42, + 197, 112, 196, 42, 135, 195, 194, 135, 42, 42, + 44, 44, 193, 192, 191, 44, 44, 44, 44, 189, + 188, 135, 187, 186, 185, 184, 135, 183, 182, 159, + 44, 44, 44, 44, 80, 80, 154, 149, 138, 80, + 80, 80, 80, 137, 80, 136, 134, 80, 133, 141, + 141, 132, 128, 127, 80, 80, 80, 80, 126, 141, + 122, 80, 141, 121, 120, 116, 80, 82, 82, 115, - 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 94, 100, 100, 0, 0, 0, 100, 100, 100, - 100, 0, 100, 0, 0, 100, 0, 0, 0, 0, - 0, 100, 100, 100, 102, 102, 0, 0, 0, 102, - 102, 102, 102, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 102, 104, 104, 0, 0, 0, 104, - 104, 104, 104, 0, 104, 0, 0, 104, 0, 0, - 0, 0, 0, 104, 104, 104, 106, 106, 0, 0, - 0, 106, 106, 106, 106, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 106, 108, 108, 0, 0, + 110, 106, 82, 82, 82, 82, 141, 105, 101, 97, + 96, 141, 89, 86, 85, 76, 71, 82, 82, 82, + 82, 98, 98, 58, 52, 49, 98, 98, 98, 98, + 46, 98, 34, 32, 98, 31, 28, 24, 23, 21, + 19, 98, 98, 98, 98, 15, 10, 9, 98, 0, + 0, 0, 0, 98, 100, 100, 0, 0, 0, 100, + 100, 100, 100, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 100, 100, 100, 100, 107, 107, + 0, 0, 0, 107, 107, 107, 107, 0, 107, 0, + 0, 107, 0, 0, 0, 0, 0, 0, 107, 107, - 0, 108, 108, 108, 108, 0, 108, 0, 0, 108, - 0, 0, 0, 0, 0, 108, 108, 108, 110, 110, - 0, 0, 0, 110, 110, 110, 110, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 110, 112, 0, - 112, 112, 0, 0, 0, 0, 0, 0, 0, 0, - 112, 0, 0, 112, 0, 0, 0, 0, 0, 0, - 112, 112, 148, 148, 148, 148, 149, 149, 149, 149, - 150, 150, 151, 0, 151, 151, 152, 0, 152, 152, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 107, 107, 0, 0, 0, 107, 0, 0, 0, 0, + 107, 109, 109, 0, 0, 0, 109, 109, 109, 109, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 109, 109, 109, 109, 117, 117, 0, 0, 0, + 117, 117, 117, 117, 0, 117, 0, 0, 117, 0, + 0, 0, 0, 0, 0, 117, 117, 117, 117, 0, + 0, 0, 117, 0, 0, 0, 0, 117, 119, 119, + 0, 0, 0, 119, 119, 119, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 119, 119, + 119, 119, 123, 123, 0, 0, 0, 123, 123, 123, - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 147, 147, 147 + 123, 0, 123, 0, 0, 123, 0, 0, 0, 0, + 0, 0, 123, 123, 123, 123, 0, 0, 0, 123, + 0, 0, 0, 0, 123, 125, 125, 0, 0, 0, + 125, 125, 125, 125, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 125, 125, 125, 125, 129, + 129, 0, 0, 0, 129, 129, 129, 129, 0, 129, + 0, 0, 129, 0, 0, 0, 0, 0, 0, 129, + 129, 129, 129, 0, 0, 0, 129, 0, 0, 0, + 0, 129, 131, 131, 0, 0, 0, 131, 131, 131, + 131, 0, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 131, 131, 131, 131, 174, 174, 174, 174, + 175, 175, 175, 175, 176, 176, 176, 176, 177, 177, + 178, 0, 178, 178, 179, 179, 180, 0, 180, 180, + 181, 0, 181, 181, 190, 0, 190, 190, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173 } ; static yy_state_type yy_last_accepting_state; @@ -658,7 +715,8 @@ char *parser_text; -#line 43 "parser.l" + +#line 44 "parser.l" #include "config.h" #include "wine/port.h" @@ -741,14 +799,15 @@ UUID *parse_uuid(const char *u) * The flexer starts here ************************************************************************** */ -#line 745 "parser.yy.c" +#line 803 "parser.yy.c" #define INITIAL 0 #define QUOTE 1 #define WSTRQUOTE 2 #define ATTR 3 #define PP_LINE 4 -#define SQUOTE 5 +#define PP_PRAGMA 5 +#define SQUOTE 6 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way @@ -833,7 +892,12 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -841,7 +905,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( parser_text, parser_leng, 1, parser_out ) +#define ECHO do { if (fwrite( parser_text, parser_leng, 1, parser_out )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -852,7 +916,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - int n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( parser_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -937,9 +1001,9 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 127 "parser.l" +#line 128 "parser.l" -#line 943 "parser.yy.c" +#line 1007 "parser.yy.c" if ( !(yy_init) ) { @@ -993,13 +1057,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 148 ) + if ( yy_current_state >= 174 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_current_state != 147 ); + while ( yy_current_state != 173 ); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); @@ -1021,12 +1085,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 128 "parser.l" -yy_push_state(PP_LINE); +#line 129 "parser.l" +yy_push_state(PP_PRAGMA); YY_BREAK case 2: YY_RULE_SETUP -#line 129 "parser.l" +#line 130 "parser.l" +yy_push_state(PP_LINE); + YY_BREAK +case 3: +YY_RULE_SETUP +#line 131 "parser.l" { int lineno; char *cptr, *fname; @@ -1046,194 +1115,204 @@ YY_RULE_SETUP input_name = xstrdup(fname); } YY_BREAK -case 3: -YY_RULE_SETUP -#line 147 "parser.l" -yy_push_state(QUOTE); cbufidx = 0; - YY_BREAK case 4: YY_RULE_SETUP -#line 148 "parser.l" +#line 149 "parser.l" +yyless(9); yy_pop_state(); return tCPPQUOTE; + YY_BREAK +case 5: +YY_RULE_SETUP +#line 150 "parser.l" +parser_lval.str = xstrdup(parser_text); yy_pop_state(); return aPRAGMA; + YY_BREAK +case 6: +YY_RULE_SETUP +#line 151 "parser.l" +yy_push_state(QUOTE); cbufidx = 0; + YY_BREAK +case 7: +YY_RULE_SETUP +#line 152 "parser.l" { yy_pop_state(); parser_lval.str = get_buffered_cstring(); return aSTRING; } YY_BREAK -case 5: +case 8: YY_RULE_SETUP -#line 153 "parser.l" +#line 157 "parser.l" yy_push_state(WSTRQUOTE); cbufidx = 0; YY_BREAK -case 6: +case 9: YY_RULE_SETUP -#line 154 "parser.l" +#line 158 "parser.l" { yy_pop_state(); parser_lval.str = get_buffered_cstring(); return aWSTRING; } YY_BREAK -case 7: +case 10: YY_RULE_SETUP -#line 159 "parser.l" +#line 163 "parser.l" yy_push_state(SQUOTE); cbufidx = 0; YY_BREAK -case 8: +case 11: YY_RULE_SETUP -#line 160 "parser.l" +#line 164 "parser.l" { yy_pop_state(); parser_lval.str = get_buffered_cstring(); return aSQSTRING; } YY_BREAK -case 9: -#line 166 "parser.l" -case 10: -YY_RULE_SETUP -#line 166 "parser.l" -addcchar(parser_text[1]); - YY_BREAK -case 11: -YY_RULE_SETUP -#line 167 "parser.l" -addcchar(parser_text[1]); - YY_BREAK case 12: -YY_RULE_SETUP -#line 168 "parser.l" -addcchar('\\'); addcchar(parser_text[1]); - YY_BREAK +#line 170 "parser.l" case 13: YY_RULE_SETUP -#line 169 "parser.l" -addcchar(parser_text[0]); +#line 170 "parser.l" +addcchar(parser_text[1]); YY_BREAK case 14: YY_RULE_SETUP -#line 170 "parser.l" -yy_push_state(ATTR); return '['; +#line 171 "parser.l" +addcchar(parser_text[1]); YY_BREAK case 15: YY_RULE_SETUP -#line 171 "parser.l" -yy_pop_state(); return ']'; +#line 172 "parser.l" +addcchar('\\'); addcchar(parser_text[1]); YY_BREAK case 16: YY_RULE_SETUP -#line 172 "parser.l" -return attr_token(parser_text); +#line 173 "parser.l" +addcchar(parser_text[0]); YY_BREAK case 17: YY_RULE_SETUP -#line 173 "parser.l" +#line 174 "parser.l" +yy_push_state(ATTR); return '['; + YY_BREAK +case 18: +YY_RULE_SETUP +#line 175 "parser.l" +yy_pop_state(); return ']'; + YY_BREAK +case 19: +YY_RULE_SETUP +#line 176 "parser.l" +return attr_token(parser_text); + YY_BREAK +case 20: +YY_RULE_SETUP +#line 177 "parser.l" { parser_lval.uuid = parse_uuid(parser_text); return aUUID; } YY_BREAK -case 18: +case 21: YY_RULE_SETUP -#line 177 "parser.l" +#line 181 "parser.l" { parser_lval.num = xstrtoul(parser_text, NULL, 0); return aHEXNUM; } YY_BREAK -case 19: +case 22: YY_RULE_SETUP -#line 181 "parser.l" +#line 185 "parser.l" { parser_lval.num = xstrtoul(parser_text, NULL, 0); return aNUM; } YY_BREAK -case 20: +case 23: YY_RULE_SETUP -#line 185 "parser.l" +#line 189 "parser.l" { parser_lval.dbl = strtod(parser_text, NULL); return aDOUBLE; } YY_BREAK -case 21: +case 24: *yy_cp = (yy_hold_char); /* undo effects of setting up parser_text */ (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up parser_text again */ YY_RULE_SETUP -#line 189 "parser.l" +#line 193 "parser.l" return tSAFEARRAY; - YY_BREAK -case 22: -YY_RULE_SETUP -#line 190 "parser.l" -return kw_token(parser_text); - YY_BREAK -case 23: -/* rule 23 can match eol */ -YY_RULE_SETUP -#line 191 "parser.l" -line_number++; - YY_BREAK -case 24: -YY_RULE_SETUP -#line 192 "parser.l" - YY_BREAK case 25: YY_RULE_SETUP -#line 193 "parser.l" -return SHL; +#line 194 "parser.l" +return kw_token(parser_text); YY_BREAK case 26: +/* rule 26 can match eol */ YY_RULE_SETUP -#line 194 "parser.l" -return SHR; +#line 195 "parser.l" +line_number++; YY_BREAK case 27: YY_RULE_SETUP -#line 195 "parser.l" -return MEMBERPTR; +#line 196 "parser.l" + YY_BREAK case 28: YY_RULE_SETUP -#line 196 "parser.l" -return EQUALITY; +#line 197 "parser.l" +return SHL; YY_BREAK case 29: YY_RULE_SETUP -#line 197 "parser.l" -return INEQUALITY; +#line 198 "parser.l" +return SHR; YY_BREAK case 30: YY_RULE_SETUP -#line 198 "parser.l" -return GREATEREQUAL; +#line 199 "parser.l" +return MEMBERPTR; YY_BREAK case 31: YY_RULE_SETUP -#line 199 "parser.l" -return LESSEQUAL; +#line 200 "parser.l" +return EQUALITY; YY_BREAK case 32: YY_RULE_SETUP -#line 200 "parser.l" -return LOGICALOR; +#line 201 "parser.l" +return INEQUALITY; YY_BREAK case 33: YY_RULE_SETUP -#line 201 "parser.l" -return LOGICALAND; +#line 202 "parser.l" +return GREATEREQUAL; YY_BREAK case 34: YY_RULE_SETUP -#line 202 "parser.l" -return ELLIPSIS; +#line 203 "parser.l" +return LESSEQUAL; YY_BREAK case 35: YY_RULE_SETUP -#line 203 "parser.l" +#line 204 "parser.l" +return LOGICALOR; + YY_BREAK +case 36: +YY_RULE_SETUP +#line 205 "parser.l" +return LOGICALAND; + YY_BREAK +case 37: +YY_RULE_SETUP +#line 206 "parser.l" +return ELLIPSIS; + YY_BREAK +case 38: +YY_RULE_SETUP +#line 207 "parser.l" return parser_text[0]; YY_BREAK case YY_STATE_EOF(INITIAL): @@ -1241,20 +1320,21 @@ case YY_STATE_EOF(QUOTE): case YY_STATE_EOF(WSTRQUOTE): case YY_STATE_EOF(ATTR): case YY_STATE_EOF(PP_LINE): +case YY_STATE_EOF(PP_PRAGMA): case YY_STATE_EOF(SQUOTE): -#line 204 "parser.l" +#line 208 "parser.l" { if (import_stack_ptr) return aEOF; else yyterminate(); } YY_BREAK -case 36: +case 39: YY_RULE_SETUP -#line 209 "parser.l" +#line 213 "parser.l" ECHO; YY_BREAK -#line 1258 "parser.yy.c" +#line 1338 "parser.yy.c" case YY_END_OF_BUFFER: { @@ -1546,7 +1626,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 148 ) + if ( yy_current_state >= 174 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1574,11 +1654,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 148 ) + if ( yy_current_state >= 174 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 147); + yy_is_jam = (yy_current_state == 173); return yy_is_jam ? 0 : yy_current_state; } @@ -1973,8 +2053,8 @@ YY_BUFFER_STATE parser__scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to parser_lex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ @@ -2253,7 +2333,7 @@ void parser_free (void * ptr ) #define YYTABLES_NAME "yytables" -#line 209 "parser.l" +#line 213 "parser.l" @@ -2310,6 +2390,7 @@ static const struct keyword keywords[] = { {"long", tLONG}, {"methods", tMETHODS}, {"module", tMODULE}, + {"namespace", tNAMESPACE}, {"pascal", tPASCAL}, {"properties", tPROPERTIES}, {"register", tREGISTER}, @@ -2463,7 +2544,7 @@ static int kw_token(const char *kw) struct keyword key, *kwp; key.kw = kw; kwp = bsearch(&key, keywords, NKEYWORDS, sizeof(keywords[0]), kw_cmp_func); - if (kwp) { + if (kwp && (do_rt_extension || kwp->token != tNAMESPACE)) { parser_lval.str = xstrdup(kwp->kw); return kwp->token; } diff --git a/reactos/tools/widl/proxy.c b/reactos/tools/widl/proxy.c index 4904e11828a..99631c9eb7f 100644 --- a/reactos/tools/widl/proxy.c +++ b/reactos/tools/widl/proxy.c @@ -796,6 +796,11 @@ int need_proxy_file(const statement_list_t *stmts) return does_any_iface(stmts, need_proxy); } +int need_proxy_delegation(const statement_list_t *stmts) +{ + return does_any_iface(stmts, need_delegation); +} + int need_inline_stubs(const type_t *iface) { const statement_t *stmt; diff --git a/reactos/tools/widl/typegen.c b/reactos/tools/widl/typegen.c index 5593a1d293e..ebfd433325d 100644 --- a/reactos/tools/widl/typegen.c +++ b/reactos/tools/widl/typegen.c @@ -85,6 +85,8 @@ static const unsigned short IsSimpleRef = 0x0100; static unsigned int field_memsize(const type_t *type, unsigned int *offset); static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align); static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align); +static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type, + const char *name, unsigned int *typestring_offset); static unsigned int write_struct_tfs(FILE *file, type_t *type, const char *name, unsigned int *tfsoff); static int write_embedded_types(FILE *file, const attr_list_t *attrs, type_t *type, const char *name, int write_ptr, unsigned int *tfsoff); @@ -860,7 +862,7 @@ static const char *get_context_handle_type_name(const type_t *type) do { \ if (file) \ fprintf(file, "/* %2u */\n", typestring_offset); \ - print_file((file), 2, "0x%02x, /* " #fctype " */\n", RPC_##fctype); \ + print_file((file), 2, "0x%02x,\t/* " #fctype " */\n", RPC_##fctype); \ } \ while (0) @@ -1447,8 +1449,8 @@ static void write_procformatstring_func( FILE *file, int indent, const type_t *i if (!is_new_style) { print_file(file, 0, "/* %u (void) */\n", *offset); - print_file(file, indent, "0x5b, /* FC_END */\n"); - print_file(file, indent, "0x5c, /* FC_PAD */\n"); + print_file(file, indent, "0x5b,\t/* FC_END */\n"); + print_file(file, indent, "0x5c,\t/* FC_PAD */\n"); *offset += 2; } } @@ -2316,7 +2318,7 @@ static void write_member_type(FILE *file, const type_t *cont, error("Unsupported member type %d\n", type_get_type(type)); } -static void write_array_element_type(FILE *file, const type_t *type, +static void write_array_element_type(FILE *file, const attr_list_t *attrs, const type_t *type, int cont_is_complex, unsigned int *tfsoff) { type_t *elem = type_array_get_element(type); @@ -2331,7 +2333,7 @@ static void write_array_element_type(FILE *file, const type_t *type, ref->typestring_offset, tfsoff); return; } - if (cont_is_complex && is_string_type(NULL, elem)) + if (cont_is_complex && is_string_type(attrs, elem)) { write_string_tfs(file, NULL, elem, TYPE_CONTEXT_CONTAINER, NULL, tfsoff); return; @@ -2350,10 +2352,10 @@ static void write_end(FILE *file, unsigned int *tfsoff) { if (*tfsoff % 2 == 0) { - print_file(file, 2, "0x%x,\t\t/* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); *tfsoff += 1; } - print_file(file, 2, "0x%x,\t\t/* FC_END */\n", RPC_FC_END); + print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END); *tfsoff += 1; } @@ -2728,7 +2730,7 @@ static int write_varying_array_pointer_descriptions( return pointer_count; } -static void write_pointer_description(FILE *file, type_t *type, +static void write_pointer_description(FILE *file, const attr_list_t *attrs, type_t *type, unsigned int *typestring_offset) { unsigned int offset_in_buffer; @@ -2757,7 +2759,7 @@ static void write_pointer_description(FILE *file, type_t *type, if (is_conformant_array(type) && (type_array_is_decl_as_ptr(type) || !current_structure)) write_conformant_array_pointer_descriptions( - file, NULL, type, 0, typestring_offset); + file, attrs, type, 0, typestring_offset); else if (type_get_type(type) == TYPE_STRUCT && get_struct_fc(type) == RPC_FC_CPSTRUCT) { @@ -2774,11 +2776,6 @@ static void write_pointer_description(FILE *file, type_t *type, &offset_in_memory, &offset_in_buffer, typestring_offset); } -int is_declptr(const type_t *t) -{ - return is_ptr(t) || (type_get_type(t) == TYPE_ARRAY && type_array_is_decl_as_ptr(t)); -} - static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, type_t *type, enum type_context context, const char *name, unsigned int *typestring_offset) @@ -2814,6 +2811,9 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, else elem_type = type_pointer_get_ref(type); + if (type_get_type(elem_type) == TYPE_POINTER && is_array(type)) + return write_array_tfs(file, attrs, type, name, typestring_offset); + if (type_get_type(elem_type) != TYPE_BASIC) { error("write_string_tfs: Unimplemented for non-basic type %s\n", name); @@ -2842,7 +2842,7 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, WRITE_FCTYPE(file, FC_WSTRING, *typestring_offset); else WRITE_FCTYPE(file, FC_CSTRING, *typestring_offset); - print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); *typestring_offset += 2; print_file(file, 2, "NdrFcShort(0x%hx),\t/* %d */\n", (unsigned short)dim, dim); @@ -2857,7 +2857,7 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, WRITE_FCTYPE(file, FC_C_WSTRING, *typestring_offset); else WRITE_FCTYPE(file, FC_C_CSTRING, *typestring_offset); - print_file(file, 2, "0x%x, /* FC_STRING_SIZED */\n", RPC_FC_STRING_SIZED); + print_file(file, 2, "0x%x,\t/* FC_STRING_SIZED */\n", RPC_FC_STRING_SIZED); *typestring_offset += 2; *typestring_offset += write_conf_or_var_desc( @@ -2878,7 +2878,7 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, WRITE_FCTYPE(file, FC_C_WSTRING, *typestring_offset); else WRITE_FCTYPE(file, FC_C_CSTRING, *typestring_offset); - print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); *typestring_offset += 2; update_tfsoff(type, start_offset, file); @@ -2904,7 +2904,8 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t if (!pointer_type) pointer_type = RPC_FC_RP; - write_embedded_types(file, attrs, type_array_get_element(type), name, FALSE, typestring_offset); + if (!is_string_type(attrs, type_array_get_element(type))) + write_embedded_types(file, attrs, type_array_get_element(type), name, FALSE, typestring_offset); size = type_memsize(is_conformant_array(type) ? type_array_get_element(type) : type); align = type_buffer_alignment(is_conformant_array(type) ? type_array_get_element(type) : type); @@ -2964,15 +2965,15 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t if (type_has_pointers(type_array_get_element(type)) && (type_array_is_decl_as_ptr(type) || !current_structure)) { - print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); - print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); *typestring_offset += 2; - write_pointer_description(file, type, typestring_offset); - print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + write_pointer_description(file, is_string_type(attrs, type) ? attrs : NULL, type, typestring_offset); + print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END); *typestring_offset += 1; } - write_array_element_type(file, type, FALSE, typestring_offset); + write_array_element_type(file, is_string_type(attrs, type) ? attrs : NULL, type, FALSE, typestring_offset); write_end(file, typestring_offset); } else @@ -2987,7 +2988,7 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t += write_conf_or_var_desc(file, current_structure, baseoff, type, length_is); - write_array_element_type(file, type, TRUE, typestring_offset); + write_array_element_type(file, is_string_type(attrs, type) ? attrs : NULL, type, TRUE, typestring_offset); write_end(file, typestring_offset); } @@ -3151,11 +3152,11 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type, (fc == RPC_FC_CPSTRUCT) || (fc == RPC_FC_CVSTRUCT && type_has_pointers(type))) { - print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); - print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); *tfsoff += 2; - write_pointer_description(file, type, tfsoff); - print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + write_pointer_description(file, NULL, type, tfsoff); + print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END); *tfsoff += 1; } @@ -3586,12 +3587,26 @@ static unsigned int write_type_tfs(FILE *file, int indent, case TGT_POINTER: { enum type_context ref_context; + type_t *ref = type_pointer_get_ref(type); + if (context == TYPE_CONTEXT_TOPLEVELPARAM) ref_context = TYPE_CONTEXT_PARAM; else if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS) ref_context = TYPE_CONTEXT_CONTAINER; else ref_context = context; + + if (is_string_type(attrs, ref)) + { + if (context != TYPE_CONTEXT_CONTAINER_NO_POINTERS) + write_pointer_tfs(file, attrs, type, *typeformat_offset + 4, context, typeformat_offset); + + offset = write_type_tfs(file, indent, attrs, ref, name, ref_context, typeformat_offset); + if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS) + return 0; + return offset; + } + offset = write_type_tfs( file, indent, attrs, type_pointer_get_ref(type), name, ref_context, typeformat_offset); if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS) diff --git a/reactos/tools/widl/typelib.c b/reactos/tools/widl/typelib.c index a63af091437..d28a8e7d999 100644 --- a/reactos/tools/widl/typelib.c +++ b/reactos/tools/widl/typelib.c @@ -47,16 +47,6 @@ static typelib_t *typelib; -int is_ptr(const type_t *t) -{ - return type_get_type(t) == TYPE_POINTER; -} - -int is_array(const type_t *t) -{ - return type_get_type(t) == TYPE_ARRAY; -} - /* List of oleauto types that should be recognized by name. * (most of) these seem to be intrinsic types in mktyplib. * This table MUST be alphabetically sorted on the kw field. diff --git a/reactos/tools/widl/typelib_struct.h b/reactos/tools/widl/typelib_struct.h index 79b86b91216..42faac8739f 100644 --- a/reactos/tools/widl/typelib_struct.h +++ b/reactos/tools/widl/typelib_struct.h @@ -97,12 +97,12 @@ typedef struct tagMSFT_SegDir { /*2*/MSFT_pSeg pImpInfo; /* table with info for imported types */ /*3*/MSFT_pSeg pImpFiles; /* import libraries */ /*4*/MSFT_pSeg pRefTab; /* References table */ -/*5*/MSFT_pSeg pLibtab; /* always exists, always same size (0x80) */ - /* hash table w offsets to guid????? */ +/*5*/MSFT_pSeg pGuidHashTab; /* always exists, always same size (0x80) */ + /* hash table with offsets to guid */ /*6*/MSFT_pSeg pGuidTab; /* all guids are stored here together with */ /* offset in some table???? */ -/*7*/MSFT_pSeg res07; /* always created, always same size (0x200) */ - /* purpose largely unknown */ +/*7*/MSFT_pSeg pNameHashTab; /* always created, always same size (0x200) */ + /* hash table with offsets to names */ /*8*/MSFT_pSeg pNametab; /* name tables */ /*9*/MSFT_pSeg pStringtab; /* string table */ /*A*/MSFT_pSeg pTypdescTab; /* table with type descriptors */ diff --git a/reactos/tools/widl/utils.c b/reactos/tools/widl/utils.c index dc77ae87438..90668873aac 100644 --- a/reactos/tools/widl/utils.c +++ b/reactos/tools/widl/utils.c @@ -159,8 +159,8 @@ char *dup_basename(const char *name, const char *ext) namelen = strlen(name); - /* +4 for later extension and +1 for '\0' */ - base = xmalloc(namelen +4 +1); + /* +6 for later extension (strlen("_r.rgs")) and +1 for '\0' */ + base = xmalloc(namelen +6 +1); strcpy(base, name); if(!strcasecmp(name + namelen-extlen, ext)) { diff --git a/reactos/tools/widl/widl.c b/reactos/tools/widl/widl.c index 27c35cdafb4..fb1395413b0 100644 --- a/reactos/tools/widl/widl.c +++ b/reactos/tools/widl/widl.c @@ -51,6 +51,7 @@ static const char usage[] = "Usage: widl [options...] infile.idl\n" " or: widl [options...] --dlldata-only name1 [name2...]\n" +" -app_config Ignored, present for midl compatibility\n" " -b arch Set the target architecture\n" " -c Generate client stub\n" " -d n Set debug level to 'n'\n" @@ -71,6 +72,7 @@ static const char usage[] = " --prefix-client=p Prefix names of client stubs with 'p'\n" " --prefix-server=p Prefix names of server functions with 'p'\n" " -r Generate registration script\n" +" --rt Enable WinRT's language extensions for IDL\n" " -s Generate server stub\n" " -t Generate typelib\n" " -u Generate interface identifiers file\n" @@ -112,9 +114,11 @@ int do_win32 = 1; int do_win64 = 1; int win32_packing = 8; int win64_packing = 8; +int do_rt_extension = 0; static enum stub_mode stub_mode = MODE_Os; char *input_name; +char *input_idl_name; char *header_name; char *local_stubs_name; char *header_token; @@ -151,10 +155,12 @@ enum { PREFIX_CLIENT_OPTION, PREFIX_SERVER_OPTION, PRINT_HELP, + RT_OPTION, WIN32_OPTION, WIN64_OPTION, WIN32_ALIGN_OPTION, - WIN64_ALIGN_OPTION + WIN64_ALIGN_OPTION, + APP_CONFIG_OPTION }; static const char short_options[] = @@ -169,10 +175,12 @@ static const struct option long_options[] = { { "prefix-all", 1, NULL, PREFIX_ALL_OPTION }, { "prefix-client", 1, NULL, PREFIX_CLIENT_OPTION }, { "prefix-server", 1, NULL, PREFIX_SERVER_OPTION }, + { "rt", 0, NULL, RT_OPTION }, { "win32", 0, NULL, WIN32_OPTION }, { "win64", 0, NULL, WIN64_OPTION }, { "win32-align", 1, NULL, WIN32_ALIGN_OPTION }, { "win64-align", 1, NULL, WIN64_ALIGN_OPTION }, + { "app_config", 0, NULL, APP_CONFIG_OPTION }, { NULL, 0, NULL, 0 } }; @@ -260,10 +268,9 @@ static void set_target( const char *target ) { "i786", SYS_WIN32 }, { "amd64", SYS_WIN64 }, { "x86_64", SYS_WIN64 }, - { "sparc", SYS_WIN32 }, - { "alpha", SYS_WIN32 }, { "powerpc", SYS_WIN32 }, - { "arm", SYS_WIN32 } + { "arm", SYS_WIN32 }, + { "aarch64", SYS_WIN64 } }; unsigned int i; @@ -340,7 +347,7 @@ static void free_filename_nodes(struct list *list) } } -static void write_dlldata_list(struct list *filenames) +static void write_dlldata_list(struct list *filenames, int define_proxy_delegation) { FILE *dlldata; filename_node_t *node; @@ -351,6 +358,8 @@ static void write_dlldata_list(struct list *filenames) fprintf(dlldata, "/*** Autogenerated by WIDL %s ", PACKAGE_VERSION); fprintf(dlldata, "- Do not edit ***/\n\n"); + if (define_proxy_delegation) + fprintf(dlldata, "#define PROXY_DELEGATION\n"); fprintf(dlldata, "#ifdef __REACTOS__\n"); fprintf(dlldata, "#define WIN32_NO_STATUS\n"); @@ -386,15 +395,19 @@ static char *eat_space(char *s) void write_dlldata(const statement_list_t *stmts) { struct list filenames = LIST_INIT(filenames); + int define_proxy_delegation = 0; filename_node_t *node; FILE *dlldata; if (!do_dlldata || !need_proxy_file(stmts)) return; + define_proxy_delegation = need_proxy_delegation(stmts); + dlldata = fopen(dlldata_name, "r"); if (dlldata) { - static char marker[] = "REFERENCE_PROXY_FILE"; + static const char marker[] = "REFERENCE_PROXY_FILE"; + static const char delegation_define[] = "#define PROXY_DELEGATION"; char *line = NULL; size_t len = 0; @@ -415,6 +428,8 @@ void write_dlldata(const statement_list_t *stmts) *end = '\0'; if (start < end) add_filename_node(&filenames, start); + }else if (!define_proxy_delegation && strncmp(start, delegation_define, sizeof(delegation_define)-1)) { + define_proxy_delegation = 1; } } @@ -433,10 +448,20 @@ void write_dlldata(const statement_list_t *stmts) } add_filename_node(&filenames, proxy_token); - write_dlldata_list(&filenames); + write_dlldata_list(&filenames, define_proxy_delegation); free_filename_nodes(&filenames); } +static void write_id_guid(FILE *f, const char *type, const char *guid_prefix, const char *name, const UUID *uuid) +{ + if (!uuid) return; + fprintf(f, "MIDL_DEFINE_GUID(%s, %s_%s, 0x%08x, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x," + "0x%02x,0x%02x,0x%02x,0x%02x,0x%02x);\n", + type, guid_prefix, name, uuid->Data1, uuid->Data2, uuid->Data3, uuid->Data4[0], + uuid->Data4[1], uuid->Data4[2], uuid->Data4[3], uuid->Data4[4], uuid->Data4[5], + uuid->Data4[6], uuid->Data4[7]); +} + static void write_id_data_stmts(const statement_list_t *stmts) { const statement_t *stmt; @@ -451,19 +476,19 @@ static void write_id_data_stmts(const statement_list_t *stmts) if (!is_object(type) && !is_attr(type->attrs, ATTR_DISPINTERFACE)) continue; uuid = get_attrp(type->attrs, ATTR_UUID); - write_guid(idfile, is_attr(type->attrs, ATTR_DISPINTERFACE) ? "DIID" : "IID", + write_id_guid(idfile, "IID", is_attr(type->attrs, ATTR_DISPINTERFACE) ? "DIID" : "IID", type->name, uuid); } else if (type_get_type(type) == TYPE_COCLASS) { const UUID *uuid = get_attrp(type->attrs, ATTR_UUID); - write_guid(idfile, "CLSID", type->name, uuid); + write_id_guid(idfile, "CLSID", "CLSID", type->name, uuid); } } else if (stmt->type == STMT_LIBRARY) { const UUID *uuid = get_attrp(stmt->u.lib->attrs, ATTR_UUID); - write_guid(idfile, "LIBID", stmt->u.lib->name, uuid); + write_id_guid(idfile, "IID", "LIBID", stmt->u.lib->name, uuid); write_id_data_stmts(stmt->u.lib->stmts); } } @@ -480,7 +505,7 @@ void write_id_data(const statement_list_t *stmts) } fprintf(idfile, "/*** Autogenerated by WIDL %s ", PACKAGE_VERSION); - fprintf(idfile, "from %s - Do not edit ***/\n\n", input_name); + fprintf(idfile, "from %s - Do not edit ***/\n\n", input_idl_name); fprintf(idfile, "#ifdef __REACTOS__\n"); fprintf(idfile, "#define WIN32_NO_STATUS\n"); @@ -489,13 +514,33 @@ void write_id_data(const statement_list_t *stmts) fprintf(idfile, "#include \n"); fprintf(idfile, "#include \n\n"); - fprintf(idfile, "#include \n\n"); + + fprintf(idfile, "#ifdef _MIDL_USE_GUIDDEF_\n\n"); + + fprintf(idfile, "#ifndef INITGUID\n"); + fprintf(idfile, "#define INITGUID\n"); + fprintf(idfile, "#include \n"); + fprintf(idfile, "#undef INITGUID\n"); + fprintf(idfile, "#else\n"); + fprintf(idfile, "#include \n"); + fprintf(idfile, "#endif\n\n"); + + fprintf(idfile, "#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \\\n"); + fprintf(idfile, " DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)\n\n"); + + fprintf(idfile, "#else\n\n"); + + fprintf(idfile, "#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \\\n"); + fprintf(idfile, " const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}\n\n"); + + fprintf(idfile, "#endif\n\n"); start_cplusplus_guard(idfile); write_id_data_stmts(stmts); fprintf(idfile, "\n"); end_cplusplus_guard(idfile); + fprintf(idfile, "#undef MIDL_DEFINE_GUID\n" ); fclose(idfile); } @@ -515,7 +560,7 @@ int main(int argc,char *argv[]) now = time(NULL); - while((optc = getopt_long(argc, argv, short_options, long_options, &opti)) != EOF) { + while((optc = getopt_long_only(argc, argv, short_options, long_options, &opti)) != EOF) { switch(optc) { case DLLDATA_OPTION: dlldata_name = xstrdup(optarg); @@ -544,6 +589,9 @@ int main(int argc,char *argv[]) case PRINT_HELP: fprintf(stderr, "%s", usage); return 0; + case RT_OPTION: + do_rt_extension = 1; + break; case WIN32_OPTION: do_win32 = 1; do_win64 = 0; @@ -562,6 +610,10 @@ int main(int argc,char *argv[]) if(win64_packing != 2 && win64_packing != 4 && win64_packing != 8) error("Packing must be one of 2, 4 or 8\n"); break; + case APP_CONFIG_OPTION: + /* widl does not distinguish between app_mode and default mode, + but we ignore this option for midl compatibility */ + break; case 'b': set_target( optarg ); break; @@ -595,7 +647,6 @@ int main(int argc,char *argv[]) case 'm': if (!strcmp( optarg, "32" )) typelib_kind = SYS_WIN32; else if (!strcmp( optarg, "64" )) typelib_kind = SYS_WIN64; - else error( "Invalid -m argument '%s'\n", optarg ); break; case 'N': no_preprocess = 1; @@ -659,14 +710,30 @@ int main(int argc,char *argv[]) wpp_add_include_path(DEFAULT_INCLUDE_DIR); #endif + /* if nothing specified, try to guess output type from the output file name */ + if (output_name && do_everything && !do_header && !do_typelib && !do_proxies && + !do_client && !do_server && !do_regscript && !do_idfile && !do_dlldata) + { + do_everything = 0; + if (strendswith( output_name, ".h" )) do_header = 1; + else if (strendswith( output_name, ".tlb" )) do_typelib = 1; + else if (strendswith( output_name, "_p.c" )) do_proxies = 1; + else if (strendswith( output_name, "_c.c" )) do_client = 1; + else if (strendswith( output_name, "_s.c" )) do_server = 1; + else if (strendswith( output_name, "_i.c" )) do_idfile = 1; + else if (strendswith( output_name, "_r.res" )) do_regscript = 1; + else if (strendswith( output_name, "_t.res" )) do_typelib = 1; + else if (strendswith( output_name, "dlldata.c" )) do_dlldata = 1; + else do_everything = 1; + } + if(do_everything) { set_everything(TRUE); } if (!output_name) output_name = dup_basename(input_name, ".idl"); - if (!do_everything && - do_header + do_typelib + do_proxies + do_client + + if (do_header + do_typelib + do_proxies + do_client + do_server + do_regscript + do_idfile + do_dlldata == 1) { if (do_header) header_name = output_name; @@ -688,7 +755,7 @@ int main(int argc,char *argv[]) for ( ; optind < argc; ++optind) add_filename_node(&filenames, argv[optind]); - write_dlldata_list(&filenames); + write_dlldata_list(&filenames, 0 /* FIXME */ ); free_filename_nodes(&filenames); return 0; } @@ -697,7 +764,7 @@ int main(int argc,char *argv[]) return 1; } else - input_name = xstrdup(argv[optind]); + input_idl_name = input_name = xstrdup(argv[optind]); } else { fprintf(stderr, "%s", usage); diff --git a/reactos/tools/widl/widl.h b/reactos/tools/widl/widl.h index 6551fa07fbe..9e09f76d116 100644 --- a/reactos/tools/widl/widl.h +++ b/reactos/tools/widl/widl.h @@ -49,8 +49,10 @@ extern int do_win32; extern int do_win64; extern int win32_packing; extern int win64_packing; +extern int do_rt_extension; extern char *input_name; +extern char *input_idl_name; extern char *header_name; extern char *header_token; extern char *local_stubs_name; diff --git a/reactos/tools/widl/widltypes.h b/reactos/tools/widl/widltypes.h index 8447a15ba7f..159b4e2e71d 100644 --- a/reactos/tools/widl/widltypes.h +++ b/reactos/tools/widl/widltypes.h @@ -79,6 +79,7 @@ enum attr_type ATTR_ANNOTATION, ATTR_APPOBJECT, ATTR_ASYNC, + ATTR_ASYNCUUID, ATTR_AUTO_HANDLE, ATTR_BINDABLE, ATTR_BROADCAST, @@ -251,6 +252,7 @@ enum statement_type STMT_TYPEDEF, STMT_IMPORT, STMT_IMPORTLIB, + STMT_PRAGMA, STMT_CPPQUOTE }; @@ -551,9 +553,6 @@ type_t *alloc_type(void); void set_all_tfswrite(int val); void clear_all_offsets(void); -int is_ptr(const type_t *t); -int is_array(const type_t *t); - #define tsENUM 1 #define tsSTRUCT 2 #define tsUNION 3 diff --git a/reactos/tools/widl/write_msft.c b/reactos/tools/widl/write_msft.c index c5b9aa0d559..a191bef92c4 100644 --- a/reactos/tools/widl/write_msft.c +++ b/reactos/tools/widl/write_msft.c @@ -172,7 +172,7 @@ static void ctl2_init_segdir( segdir = &typelib->typelib_segdir[MSFT_SEG_TYPEINFO]; - for (i = 0; i < 15; i++) { + for (i = 0; i < MSFT_SEG_MAX; i++) { segdir[i].offset = -1; segdir[i].length = 0; segdir[i].res08 = -1; @@ -825,7 +825,6 @@ static int encode_type( case VT_UI4: case VT_R4: case VT_ERROR: - case VT_BSTR: case VT_HRESULT: *encoded_type = default_type; *width = 4; @@ -861,8 +860,9 @@ static int encode_type( case VT_UNKNOWN: case VT_DISPATCH: + case VT_BSTR: *encoded_type = default_type; - *width = 4; + *width = pointer_size; *alignment = 4; break; @@ -873,7 +873,7 @@ static int encode_type( case VT_LPSTR: case VT_LPWSTR: *encoded_type = 0xfffe0000 | vt; - *width = 4; + *width = pointer_size; *alignment = 4; break; @@ -896,7 +896,7 @@ static int encode_type( if(next_vt == VT_DISPATCH || next_vt == VT_UNKNOWN) { chat("encode_type: skipping ptr\n"); *encoded_type = target_type; - *width = 4; + *width = pointer_size; *alignment = 4; *decoded_size = child_size; break; @@ -926,13 +926,12 @@ static int encode_type( *encoded_type = typeoffset; - *width = 4; + *width = pointer_size; *alignment = 4; *decoded_size = 8 /*sizeof(TYPEDESC)*/ + child_size; break; } - case VT_SAFEARRAY: { type_t *element_type = type_alias_get_aliasee(type_array_get_element(type)); @@ -964,13 +963,12 @@ static int encode_type( *encoded_type = typeoffset; - *width = 4; + *width = pointer_size; *alignment = 4; *decoded_size = 8 /*sizeof(TYPEDESC)*/ + child_size; break; } - case VT_USERDEFINED: { int typeinfo_offset; @@ -1117,7 +1115,7 @@ static int encode_var( chat("encode_var: skipping ptr\n"); *encoded_type = target_type; *decoded_size = child_size; - *width = 4; + *width = pointer_size; *alignment = 4; return 0; } @@ -1146,7 +1144,7 @@ static int encode_var( *encoded_type = typeoffset; - *width = 4; + *width = pointer_size; *alignment = 4; *decoded_size = 8 /*sizeof(TYPEDESC)*/ + child_size; return 0; @@ -1191,6 +1189,8 @@ static void write_value(msft_typelib_t* typelib, int *out, int vt, const void *v case VT_UINT: case VT_HRESULT: case VT_PTR: + case VT_UNKNOWN: + case VT_DISPATCH: { const unsigned int lv = get_ulong_val(*(const unsigned int *)value, vt); if((lv & 0x3ffffff) == lv) { @@ -1230,7 +1230,7 @@ static void write_value(msft_typelib_t* typelib, int *out, int vt, const void *v } static HRESULT set_custdata(msft_typelib_t *typelib, REFGUID guid, - int vt, int value, int *offset) + int vt, const void *value, int *offset) { MSFT_GuidEntry guidentry; int guidoffset; @@ -1244,7 +1244,7 @@ static HRESULT set_custdata(msft_typelib_t *typelib, REFGUID guid, guidentry.next_hash = -1; guidoffset = ctl2_alloc_guid(typelib, &guidentry); - write_value(typelib, &data_out, vt, &value); + write_value(typelib, &data_out, vt, value); custoffset = ctl2_alloc_segment(typelib, MSFT_SEG_CUSTDATAGUID, 12, 0); @@ -1257,6 +1257,33 @@ static HRESULT set_custdata(msft_typelib_t *typelib, REFGUID guid, return S_OK; } +/* It's possible to have a default value for pointer arguments too. + In this case default value has a referenced type, e.g. + 'LONG*' argument gets VT_I4, 'DOUBLE*' - VT_R8. IUnknown* and IDispatch* + are recognised too and stored as VT_UNKNOWN and VT_DISPATCH. + But IUnknown/IDispatch arguments can only have default value of 0 + (or expression that resolves to zero) while other pointers can have + any default value. */ +static int get_defaultvalue_vt(type_t *type) +{ + int vt = get_type_vt(type); + if (type_get_type(type) == TYPE_ENUM) + vt = VT_I4; + else + { + vt = get_type_vt(type); + if (vt == VT_PTR && is_ptr(type)) { + vt = get_type_vt(type_pointer_get_ref(type)); + /* The only acceptable value for pointers to non-basic types + is NULL, it's stored as VT_I4 for both 32 and 64 bit typelibs. */ + if (vt == VT_USERDEFINED) + vt = VT_I4; + } + } + + return vt; +} + static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index) { int offset, name_offset; @@ -1481,10 +1508,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index) { int vt; expr_t *expr = (expr_t *)attr->u.pval; - if (type_get_type(arg->type) == TYPE_ENUM) - vt = VT_INT; - else - vt = get_type_vt(arg->type); + vt = get_defaultvalue_vt(arg->type); paramflags |= 0x30; /* PARAMFLAG_FHASDEFAULT | PARAMFLAG_FOPT */ if (expr->type == EXPR_STRLIT || expr->type == EXPR_WSTRLIT) { @@ -1726,7 +1750,7 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var) break; case TKIND_DISPATCH: var_kind = 3; /* VAR_DISPATCH */ - typeinfo->datawidth = 4; + typeinfo->datawidth = pointer_size; var_alignment = 4; break; default: @@ -1979,7 +2003,7 @@ static void add_dispinterface_typeinfo(msft_typelib_t *typelib, type_t *dispinte msft_typeinfo = create_msft_typeinfo(typelib, TKIND_DISPATCH, dispinterface->name, dispinterface->attrs); - msft_typeinfo->typeinfo->size = 4; + msft_typeinfo->typeinfo->size = pointer_size; msft_typeinfo->typeinfo->typekind |= 0x2100; msft_typeinfo->typeinfo->flags |= 0x1000; /* TYPEFLAG_FDISPATCHABLE */ @@ -2024,8 +2048,7 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface) return; } - if (is_attr(interface->attrs, ATTR_DISPINTERFACE)) - { + if (is_attr(interface->attrs, ATTR_DISPINTERFACE)) { add_dispinterface_typeinfo(typelib, interface); return; } @@ -2045,7 +2068,7 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface) interface->typelib_idx = typelib->typelib_header.nrtypeinfos; msft_typeinfo = create_msft_typeinfo(typelib, TKIND_INTERFACE, interface->name, interface->attrs); - msft_typeinfo->typeinfo->size = 4; + msft_typeinfo->typeinfo->size = pointer_size; msft_typeinfo->typeinfo->typekind |= 0x2200; for (derived = inherit; derived; derived = type_iface_get_inherit(derived)) @@ -2102,6 +2125,9 @@ static void add_enum_typeinfo(msft_typelib_t *typelib, type_t *enumeration) var_t *cur; msft_typeinfo_t *msft_typeinfo; + if (-1 < enumeration->typelib_idx) + return; + enumeration->typelib_idx = typelib->typelib_header.nrtypeinfos; msft_typeinfo = create_msft_typeinfo(typelib, TKIND_ENUM, enumeration->name, enumeration->attrs); msft_typeinfo->typeinfo->size = 0; @@ -2209,7 +2235,7 @@ static void add_coclass_typeinfo(msft_typelib_t *typelib, type_t *cls) first_source->flags |= 0x1; msft_typeinfo->typeinfo->cImplTypes = num_ifaces; - msft_typeinfo->typeinfo->size = 4; + msft_typeinfo->typeinfo->size = pointer_size; msft_typeinfo->typeinfo->typekind |= 0x2200; } @@ -2265,6 +2291,7 @@ static void add_entry(msft_typelib_t *typelib, const statement_t *stmt) switch(stmt->type) { case STMT_LIBRARY: case STMT_IMPORT: + case STMT_PRAGMA: case STMT_CPPQUOTE: case STMT_DECLARATION: /* not included in typelib */ @@ -2546,7 +2573,12 @@ static void save_all_changes(msft_typelib_t *typelib) if (strendswith( typelib_name, ".res" )) /* create a binary resource file */ { - add_output_to_resources( "TYPELIB", "#1" ); + char typelib_id[13] = "#1"; + + expr_t *expr = get_attrp( typelib->typelib->attrs, ATTR_ID ); + if (expr) + sprintf( typelib_id, "#%d", expr->cval ); + add_output_to_resources( "TYPELIB", typelib_id ); output_typelib_regscript( typelib->typelib ); flush_output_resources( typelib_name ); } @@ -2560,9 +2592,11 @@ int create_msft_typelib(typelib_t *typelib) const statement_t *stmt; time_t cur_time; char *time_override; - unsigned int version = 5 << 24 | 1 << 16 | 164; /* 5.01.0164 */ - GUID midl_time_guid = {0xde77ba63,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}}; - GUID midl_version_guid = {0xde77ba64,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}}; + unsigned int version = 7 << 24 | 555; /* 7.00.0555 */ + GUID midl_time_guid = {0xde77ba63,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}}; + GUID midl_version_guid = {0xde77ba64,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}}; + GUID midl_info_guid = {0xde77ba65,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}}; + char info_string[128]; pointer_size = (typelib_kind == SYS_WIN64) ? 8 : 4; @@ -2609,8 +2643,10 @@ int create_msft_typelib(typelib_t *typelib) and midl's version number */ time_override = getenv( "WIDL_TIME_OVERRIDE"); cur_time = time_override ? atol( time_override) : time(NULL); - set_custdata(msft, &midl_time_guid, VT_UI4, cur_time, &msft->typelib_header.CustomDataOffset); - set_custdata(msft, &midl_version_guid, VT_UI4, version, &msft->typelib_header.CustomDataOffset); + sprintf(info_string, "Created by WIDL version %s at %s\n", PACKAGE_VERSION, ctime(&cur_time)); + set_custdata(msft, &midl_info_guid, VT_BSTR, info_string, &msft->typelib_header.CustomDataOffset); + set_custdata(msft, &midl_time_guid, VT_UI4, &cur_time, &msft->typelib_header.CustomDataOffset); + set_custdata(msft, &midl_version_guid, VT_UI4, &version, &msft->typelib_header.CustomDataOffset); if (typelib->stmts) LIST_FOR_EACH_ENTRY( stmt, typelib->stmts, const statement_t, entry ) diff --git a/reactos/tools/wpp/preproc.c b/reactos/tools/wpp/preproc.c index fd99167d9e6..33f69c8ed2d 100644 --- a/reactos/tools/wpp/preproc.c +++ b/reactos/tools/wpp/preproc.c @@ -209,7 +209,7 @@ static void wpp_default_write( const char *buffer, unsigned int len ) { fwrite(buffer, 1, len, ppy_out); } -/* Don't comment on the hash, its primitive but functional... */ +/* Don't comment on the hash, it's primitive but functional... */ static int pphash(const char *str) { int sum = 0; From b29ae7f1866a4c02a27319923332770e2a826218 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 20:24:51 +0000 Subject: [PATCH 347/419] [REGEDIT] * Sync regproc.c with Wine 1.7.17. Formatting is overrated ;) * Inspired by CORE-7916 (thanks Edijs Kolesnikovics!) * Fixes all regedit test failures. CORE-8080 svn path=/trunk/; revision=62775 --- reactos/base/applications/regedit/regproc.c | 669 +++++++++----------- reactos/base/applications/regedit/regproc.h | 6 +- 2 files changed, 293 insertions(+), 382 deletions(-) diff --git a/reactos/base/applications/regedit/regproc.c b/reactos/base/applications/regedit/regproc.c index 8df3199125a..138c2bf0e4a 100644 --- a/reactos/base/applications/regedit/regproc.c +++ b/reactos/base/applications/regedit/regproc.c @@ -2,9 +2,9 @@ * Registry processing routines. Routines, common for registry * processing frontends. * - * Copyright (C) 1999 Sylvain St-Germain - * Copyright (C) 2002 Andriy Palamarchuk - * Copyright (C) 2008 Alexander N. Sørnes + * Copyright 1999 Sylvain St-Germain + * Copyright 2002 Andriy Palamarchuk + * Copyright 2008 Alexander N. Sørnes * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -24,6 +24,9 @@ #include "regedit.h" #include +#include +#include +#include #define REG_VAL_BUF_SIZE 4096 @@ -32,25 +35,18 @@ */ #define REG_FILE_HEX_LINE_LEN (2 + 25 * 3) -static const CHAR *reg_class_names[] = -{ - "HKEY_LOCAL_MACHINE", "HKEY_USERS", "HKEY_CLASSES_ROOT", - "HKEY_CURRENT_CONFIG", "HKEY_CURRENT_USER", "HKEY_DYN_DATA" -}; - -#define REG_CLASS_NUMBER (COUNT_OF(reg_class_names)) - -const WCHAR* reg_class_namesW[REG_CLASS_NUMBER] = +const WCHAR* reg_class_namesW[] = { L"HKEY_LOCAL_MACHINE", L"HKEY_USERS", L"HKEY_CLASSES_ROOT", L"HKEY_CURRENT_CONFIG", L"HKEY_CURRENT_USER", L"HKEY_DYN_DATA" }; -static HKEY reg_class_keys[REG_CLASS_NUMBER] = -{ - HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CLASSES_ROOT, - HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER, HKEY_DYN_DATA -}; +static HKEY reg_class_keys[] = { + HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_CLASSES_ROOT, + HKEY_CURRENT_CONFIG, HKEY_CURRENT_USER, HKEY_DYN_DATA + }; + +#define REG_CLASS_NUMBER (sizeof(reg_class_keys) / sizeof(reg_class_keys[0])) /* return values */ #define NOT_ENOUGH_MEMORY 1 @@ -154,8 +150,7 @@ static BOOL convertHexToDWord(WCHAR* str, DWORD *dw) char dummy; WideCharToMultiByte(CP_ACP, 0, str, -1, buf, 9, NULL, NULL); - if (lstrlenW(str) > 8 || sscanf(buf, "%lx%c", dw, &dummy) != 1) - { + if (lstrlenW(str) > 8 || sscanf(buf, "%lx%c", dw, &dummy) != 1) { fprintf(stderr,"%S: ERROR, invalid hex value\n", getAppName()); return FALSE; } @@ -178,14 +173,12 @@ static BYTE* convertHexCSVToHex(WCHAR *str, DWORD *size) s = str; d = data; *size=0; - while (*s != '\0') - { + while (*s != '\0') { UINT wc; WCHAR *end; - wc = wcstoul(s,&end, 16); - if (end == s || wc > 0xff || (*end && *end != L',')) - { + wc = strtoulW(s,&end,16); + if (end == s || wc > 0xff || (*end && *end != ',')) { char* strA = GetMultiByteString(s); fprintf(stderr,"%S: ERROR converting CSV hex stream. Invalid value at '%s'\n", getAppName(), strA); @@ -211,13 +204,7 @@ static BYTE* convertHexCSVToHex(WCHAR *str, DWORD *size) */ static DWORD getDataType(LPWSTR *lpValue, DWORD* parse_type) { - struct data_type - { - const WCHAR *tag; - int len; - int type; - int parse_type; - }; + struct data_type { const WCHAR *tag; int len; int type; int parse_type; }; static const WCHAR quote[] = {'"'}; static const WCHAR str[] = {'s','t','r',':','"'}; @@ -227,39 +214,34 @@ static DWORD getDataType(LPWSTR *lpValue, DWORD* parse_type) static const WCHAR hexp[] = {'h','e','x','('}; static const struct data_type data_types[] = { /* actual type */ /* type to assume for parsing */ - { quote, 1, REG_SZ, REG_SZ }, - { str, 5, REG_SZ, REG_SZ }, - { str2, 8, REG_EXPAND_SZ, REG_SZ }, - { hex, 4, REG_BINARY, REG_BINARY }, - { dword, 6, REG_DWORD, REG_DWORD }, - { hexp, 4, -1, REG_BINARY }, - { NULL, 0, 0, 0 } - }; + { quote, 1, REG_SZ, REG_SZ }, + { str, 5, REG_SZ, REG_SZ }, + { str2, 8, REG_EXPAND_SZ, REG_SZ }, + { hex, 4, REG_BINARY, REG_BINARY }, + { dword, 6, REG_DWORD, REG_DWORD }, + { hexp, 4, -1, REG_BINARY }, + { NULL, 0, 0, 0 } + }; const struct data_type *ptr; int type; - for (ptr = data_types; ptr->tag; ptr++) - { - if (wcsncmp(ptr->tag, *lpValue, ptr->len)) + for (ptr = data_types; ptr->tag; ptr++) { + if (strncmpW( ptr->tag, *lpValue, ptr->len )) continue; /* Found! */ *parse_type = ptr->parse_type; type=ptr->type; *lpValue+=ptr->len; - if (type == -1) - { + if (type == -1) { WCHAR* end; /* "hex(xx):" is special */ - type = (int)wcstoul( *lpValue , &end, 16 ); - if (**lpValue=='\0' || *end!=')' || *(end+1)!=':') - { + type = (int)strtoulW( *lpValue , &end, 16 ); + if (**lpValue=='\0' || *end!=')' || *(end+1)!=':') { type=REG_NONE; - } - else - { + } else { *lpValue = end + 2; } } @@ -277,13 +259,10 @@ static void REGPROC_unescape_string(WCHAR* str) int str_idx = 0; /* current character under analysis */ int val_idx = 0; /* the last character of the unescaped string */ int len = lstrlenW(str); - for (str_idx = 0; str_idx < len; str_idx++, val_idx++) - { - if (str[str_idx] == '\\') - { + for (str_idx = 0; str_idx < len; str_idx++, val_idx++) { + if (str[str_idx] == '\\') { str_idx++; - switch (str[str_idx]) - { + switch (str[str_idx]) { case 'n': str[val_idx] = '\n'; break; @@ -292,14 +271,12 @@ static void REGPROC_unescape_string(WCHAR* str) str[val_idx] = str[str_idx]; break; default: - fprintf(stderr,"Warning! Unrecognized escape sequence: \\%C'\n", - str[str_idx]); + fprintf(stderr,"Warning! Unrecognized escape sequence: \\%c'\n", + str[str_idx]); str[val_idx] = str[str_idx]; break; } - } - else - { + } else { str[val_idx] = str[str_idx]; } } @@ -314,11 +291,11 @@ static BOOL parseKeyName(LPWSTR lpKeyName, HKEY *hKey, LPWSTR *lpKeyPath) if (lpKeyName == NULL) return FALSE; - for(i = 0; *(lpKeyName + i) != 0; i++) + for(i = 0; *(lpKeyName+i) != 0; i++) { if(*(lpKeyName+i) == '\\') { - lpSlash = lpKeyName + i; + lpSlash = lpKeyName+i; break; } } @@ -334,11 +311,9 @@ static BOOL parseKeyName(LPWSTR lpKeyName, HKEY *hKey, LPWSTR *lpKeyPath) } *hKey = NULL; - for (i = 0; i < REG_CLASS_NUMBER; i++) - { + for (i = 0; i < REG_CLASS_NUMBER; i++) { if (CompareStringW(LOCALE_USER_DEFAULT, 0, lpKeyName, len, reg_class_namesW[i], len) == CSTR_EQUAL && - len == lstrlenW(reg_class_namesW[i])) - { + len == lstrlenW(reg_class_namesW[i])) { *hKey = reg_class_keys[i]; break; } @@ -347,6 +322,7 @@ static BOOL parseKeyName(LPWSTR lpKeyName, HKEY *hKey, LPWSTR *lpKeyPath) if (*hKey == NULL) return FALSE; + if (*lpSlash != '\0') lpSlash++; *lpKeyPath = lpSlash; @@ -393,6 +369,8 @@ static LONG setValue(WCHAR* val_name, WCHAR* val_data, BOOL is_unicode) * the extra garbage in the registry. */ dwLen = lstrlenW(val_data); + if(val_data[dwLen-1] != '"') + return ERROR_INVALID_DATA; if (dwLen>0 && val_data[dwLen-1]=='"') { dwLen--; @@ -430,12 +408,12 @@ static LONG setValue(WCHAR* val_name, WCHAR* val_data, BOOL is_unicode) } res = RegSetValueExW( - currentKeyHandle, - val_name, - 0, /* Reserved */ - dwDataType, - lpbData, - dwLen); + currentKeyHandle, + val_name, + 0, /* Reserved */ + dwDataType, + lpbData, + dwLen); if (dwParseType == REG_BINARY) HeapFree(GetProcessHeap(), 0, lpbData); return res; @@ -460,16 +438,17 @@ static LONG openKeyW(WCHAR* stdInput) if (!parseKeyName(stdInput, &keyClass, &keyPath)) return ERROR_INVALID_PARAMETER; - res = RegCreateKeyExW(keyClass, /* Class */ - keyPath, /* Sub Key */ - 0, /* MUST BE 0 */ - NULL, /* object type */ - REG_OPTION_NON_VOLATILE, /* option, REG_OPTION_NON_VOLATILE ... */ - KEY_ALL_ACCESS, /* access mask, KEY_ALL_ACCESS */ - NULL, /* security attribute */ - ¤tKeyHandle, /* result */ - &dwDisp); /* disposition, REG_CREATED_NEW_KEY or - REG_OPENED_EXISTING_KEY */ + res = RegCreateKeyExW( + keyClass, /* Class */ + keyPath, /* Sub Key */ + 0, /* MUST BE 0 */ + NULL, /* object type */ + REG_OPTION_NON_VOLATILE, /* option, REG_OPTION_NON_VOLATILE ... */ + KEY_ALL_ACCESS, /* access mask, KEY_ALL_ACCESS */ + NULL, /* security attribute */ + ¤tKeyHandle, /* result */ + &dwDisp); /* disposition, REG_CREATED_NEW_KEY or + REG_OPENED_EXISTING_KEY */ if (res == ERROR_SUCCESS) currentKeyName = GetMultiByteString(stdInput); @@ -509,63 +488,55 @@ static void processSetValue(WCHAR* line, BOOL is_unicode) LONG res; /* get value name */ - while ( iswspace(line[line_idx]) ) line_idx++; - if (line[line_idx] == '@' && line[line_idx + 1] == '=') - { + while ( isspaceW(line[line_idx]) ) line_idx++; + if (line[line_idx] == '@' && line[line_idx + 1] == '=') { line[line_idx] = '\0'; val_name = line; line_idx++; - } - else if (line[line_idx] == '\"') - { + } else if (line[line_idx] == '\"') { line_idx++; val_name = line + line_idx; - while (TRUE) - { + while (line[line_idx]) { if (line[line_idx] == '\\') /* skip escaped character */ { line_idx += 2; - } - else - { - if (line[line_idx] == '\"') - { + } else { + if (line[line_idx] == '\"') { line[line_idx] = '\0'; line_idx++; break; - } - else - { + } else { line_idx++; } } } - while ( iswspace(line[line_idx]) ) line_idx++; - if (line[line_idx] != '=') - { + while ( isspaceW(line[line_idx]) ) line_idx++; + if (!line[line_idx]) { + fprintf(stderr, "%S: warning: unexpected EOL\n", getAppName()); + return; + } + if (line[line_idx] != '=') { char* lineA; line[line_idx] = '\"'; lineA = GetMultiByteString(line); - fprintf(stderr,"Warning! unrecognized line:\n%s\n", lineA); + fprintf(stderr,"%S: warning: unrecognized line: '%s'\n", getAppName(), lineA); HeapFree(GetProcessHeap(), 0, lineA); return; } - } - else - { + } else { char* lineA = GetMultiByteString(line); - fprintf(stderr,"Warning! unrecognized line:\n%s\n", lineA); + fprintf(stderr,"%S: warning: unrecognized line: '%s'\n", getAppName(), lineA); HeapFree(GetProcessHeap(), 0, lineA); return; } line_idx++; /* skip the '=' character */ - while ( iswspace(line[line_idx]) ) line_idx++; + while ( isspaceW(line[line_idx]) ) line_idx++; val_data = line + line_idx; /* trim trailing blanks */ - line_idx = lstrlenW(val_data); - while (line_idx > 0 && iswspace(val_data[line_idx-1])) line_idx--; + line_idx = strlenW(val_data); + while (line_idx > 0 && isspaceW(val_data[line_idx-1])) line_idx--; val_data[line_idx] = '\0'; REGPROC_unescape_string(val_name); @@ -575,10 +546,10 @@ static void processSetValue(WCHAR* line, BOOL is_unicode) char* val_nameA = GetMultiByteString(val_name); char* val_dataA = GetMultiByteString(val_data); fprintf(stderr,"%S: ERROR Key %s not created. Value: %s, Data: %s\n", - getAppName(), - currentKeyName, - val_nameA, - val_dataA); + getAppName(), + currentKeyName, + val_nameA, + val_dataA); HeapFree(GetProcessHeap(), 0, val_nameA); HeapFree(GetProcessHeap(), 0, val_dataA); } @@ -595,20 +566,19 @@ static void processRegEntry(WCHAR* stdInput, BOOL isUnicode) * We encountered the end of the file, make sure we * close the opened key and exit */ - if (stdInput == NULL) - { + if (stdInput == NULL) { closeKey(); return; } - if ( stdInput[0] == L'[') /* We are reading a new key */ + if ( stdInput[0] == '[') /* We are reading a new key */ { WCHAR* keyEnd; - closeKey(); /* Close the previous key */ + closeKey(); /* Close the previous key */ /* Get rid of the square brackets */ stdInput++; - keyEnd = wcsrchr(stdInput, L']'); + keyEnd = strrchrW(stdInput, ']'); if (keyEnd) *keyEnd='\0'; @@ -616,22 +586,19 @@ static void processRegEntry(WCHAR* stdInput, BOOL isUnicode) if ( stdInput[0] == '-') { delete_registry_key(stdInput + 1); - } - else if ( openKeyW(stdInput) != ERROR_SUCCESS ) + } else if ( openKeyW(stdInput) != ERROR_SUCCESS ) { char* stdInputA = GetMultiByteString(stdInput); fprintf(stderr,"%S: setValue failed to open key %s\n", - getAppName(), stdInputA); + getAppName(), stdInputA); HeapFree(GetProcessHeap(), 0, stdInputA); } - } - else if( currentKeyHandle && - (( stdInput[0] == '@') || /* reading a default @=data pair */ - ( stdInput[0] == '\"'))) /* reading a new value=data pair */ + } else if( currentKeyHandle && + (( stdInput[0] == '@') || /* reading a default @=data pair */ + ( stdInput[0] == '\"'))) /* reading a new value=data pair */ { processSetValue(stdInput, isUnicode); - } - else + } else { /* Since we are assuming that the file format is valid we must be * reading a blank line which indicates the end of this key processing @@ -642,30 +609,35 @@ static void processRegEntry(WCHAR* stdInput, BOOL isUnicode) /****************************************************************************** * Processes a registry file. - * Correctly processes comments (in # form), line continuation. + * Correctly processes comments (in # and ; form), line continuation. * * Parameters: * in - input stream to read from + * first_chars - beginning of stream, read due to Unicode check */ -static void processRegLinesA(FILE *in) +static void processRegLinesA(FILE *in, char* first_chars) { LPSTR line = NULL; /* line read from input stream */ ULONG lineSize = REG_VAL_BUF_SIZE; line = HeapAlloc(GetProcessHeap(), 0, lineSize); CHECK_ENOUGH_MEMORY(line); + memcpy(line, first_chars, 2); - while (!feof(in)) - { + while (!feof(in)) { LPSTR s; /* The pointer into line for where the current fgets should read */ - LPSTR check; WCHAR* lineW; s = line; - for (;;) + if(first_chars) { + s += 2; + first_chars = NULL; + } + + for (;;) { size_t size_remaining; - int size_to_get; + int size_to_get, i; char *s_eol; /* various local uses */ /* Do we need to expand the buffer ? */ @@ -691,68 +663,79 @@ static void processRegLinesA(FILE *in) */ size_to_get = (size_remaining > INT_MAX ? INT_MAX : size_remaining); - check = fgets (s, size_to_get, in); + /* get a single line. note that `i' must be one past the last + * meaningful character in `s' when this loop exits */ + for(i = 0; i < size_to_get-1; ++i){ + int xchar; - if (check == NULL) - { - if (ferror(in)) - { - perror ("While reading input"); - exit (IO_ERROR); + xchar = fgetc(in); + s[i] = xchar; + if(xchar == EOF){ + if(ferror(in)){ + perror("While reading input"); + exit(IO_ERROR); + }else + assert(feof(in)); + break; } - else - { - assert (feof(in)); - *s = '\0'; - /* It is not clear to me from the definition that the - * contents of the buffer are well defined on detecting - * an eof without managing to read anything. - */ + if(s[i] == '\r'){ + /* read the next character iff it's \n */ + if(i+2 >= size_to_get){ + /* buffer too short, so put back the EOL char to + * read next cycle */ + ungetc('\r', in); + break; + } + s[i+1] = fgetc(in); + if(s[i+1] != '\n'){ + ungetc(s[i+1], in); + i = i+1; + }else + i = i+2; + break; + } + if(s[i] == '\n'){ + i = i+1; + break; } } + s[i] = '\0'; /* If we didn't read the eol nor the eof go around for the rest */ - s_eol = strchr (s, '\n'); - if (!feof (in) && !s_eol) - { + s_eol = strpbrk (s, "\r\n"); + if (!feof (in) && !s_eol) { s = strchr (s, '\0'); - /* It should be s + size_to_get - 1 but this is safer */ continue; } /* If it is a comment line then discard it and go around again */ - if (line [0] == '#') - { + if (line [0] == '#' || line [0] == ';') { s = line; continue; } - /* Remove any line feed. Leave s_eol on the \0 */ - if (s_eol) - { - *s_eol = '\0'; - if (s_eol > line && *(s_eol-1) == '\r') - *--s_eol = '\0'; - } - else + /* Remove any line feed. Leave s_eol on the first \0 */ + if (s_eol) { + if (*s_eol == '\r' && *(s_eol+1) == '\n') + *(s_eol+1) = '\0'; + *s_eol = '\0'; + } else s_eol = strchr (s, '\0'); /* If there is a concatenating \\ then go around again */ - if (s_eol > line && *(s_eol-1) == '\\') - { + if (s_eol > line && *(s_eol-1) == '\\') { int c; s = s_eol-1; do { c = fgetc(in); - } - while(c == ' ' || c == '\t'); + } while(c == ' ' || c == '\t'); if(c == EOF) { fprintf(stderr,"%S: ERROR - invalid continuation.\n", - getAppName()); + getAppName()); } else { @@ -790,8 +773,7 @@ static void processRegLinesW(FILE *in) s = buf; line = buf; - while(!feof(in)) - { + while(!feof(in)) { size_t size_remaining; int size_to_get; WCHAR *s_eol = NULL; /* various local uses */ @@ -823,15 +805,11 @@ static void processRegLinesW(FILE *in) CharsInBuf = fread(s, sizeof(WCHAR), size_to_get - 1, in); s[CharsInBuf] = 0; - if (CharsInBuf == 0) - { - if (ferror(in)) - { + if (CharsInBuf == 0) { + if (ferror(in)) { perror ("While reading input"); exit (IO_ERROR); - } - else - { + } else { assert (feof(in)); *s = '\0'; /* It is not clear to me from the definition that the @@ -844,56 +822,48 @@ static void processRegLinesW(FILE *in) /* If we didn't read the eol nor the eof go around for the rest */ while(1) { - s_eol = wcschr(line, '\n'); + const WCHAR line_endings[] = {'\r','\n',0}; + s_eol = strpbrkW(line, line_endings); - if(!s_eol) - { + if(!s_eol) { /* Move the stub of the line to the start of the buffer so * we get the maximum space to read into, and so we don't * have to recalculate 'line' if the buffer expands */ - MoveMemory(buf, line, (lstrlenW(line) + 1) * sizeof(WCHAR)); + MoveMemory(buf, line, (strlenW(line)+1) * sizeof(WCHAR)); line = buf; - s = wcschr(line, '\0'); + s = strchrW(line, '\0'); break; } /* If it is a comment line then discard it and go around again */ - if (*line == '#') - { - line = s_eol + 1; + if (*line == '#' || *line == ';') { + if (*s_eol == '\r' && *(s_eol+1) == '\n') + line = s_eol + 2; + else + line = s_eol + 1; continue; } /* If there is a concatenating \\ then go around again */ - if ((*(s_eol-1) == '\\') || - (*(s_eol-1) == '\r' && *(s_eol-2) == '\\')) - { - WCHAR* NextLine = s_eol; + if (*(s_eol-1) == '\\') { + WCHAR* NextLine = s_eol + 1; + + if(*s_eol == '\r' && *(s_eol+1) == '\n') + NextLine++; while(*(NextLine+1) == ' ' || *(NextLine+1) == '\t') NextLine++; - NextLine++; - - if(*(s_eol-1) == '\r') - s_eol--; - MoveMemory(s_eol - 1, NextLine, (CharsInBuf - (NextLine - s) + 1)*sizeof(WCHAR)); CharsInBuf -= NextLine - s_eol + 1; s_eol = 0; continue; } - /* Remove any line feed. Leave s_eol on the \0 */ - if (s_eol) - { - *s_eol = '\0'; - if (s_eol > buf && *(s_eol-1) == '\r') - *(s_eol-1) = '\0'; - } - - if(!s_eol) - break; + /* Remove any line feed. Leave s_eol on the last \0 */ + if (*s_eol == '\r' && *(s_eol + 1) == '\n') + *s_eol++ = '\0'; + *s_eol = '\0'; processRegEntry(line, TRUE); line = s_eol + 1; @@ -920,12 +890,11 @@ static void REGPROC_print_error(void) int status; error_code = GetLastError (); - status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, error_code, 0, (LPTSTR) &lpMsgBuf, 0, NULL); - if (!status) - { + status = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, error_code, 0, (LPSTR) &lpMsgBuf, 0, NULL); + if (!status) { fprintf(stderr,"%S: Cannot display message for error %ld, status %ld\n", - getAppName(), error_code, GetLastError()); + getAppName(), error_code, GetLastError()); exit(1); } puts(lpMsgBuf); @@ -946,8 +915,7 @@ static void REGPROC_print_error(void) static void REGPROC_resize_char_buffer(WCHAR **buffer, DWORD *len, DWORD required_len) { required_len++; - if (required_len > *len) - { + if (required_len > *len) { *len = required_len; if (!*buffer) *buffer = HeapAlloc(GetProcessHeap(), 0, *len * sizeof(**buffer)); @@ -967,8 +935,7 @@ static void REGPROC_resize_char_buffer(WCHAR **buffer, DWORD *len, DWORD require */ static void REGPROC_resize_binary_buffer(BYTE **buffer, DWORD *size, DWORD required_size) { - if (required_size > *size) - { + if (required_size > *size) { *size = required_size; if (!*buffer) *buffer = HeapAlloc(GetProcessHeap(), 0, *size); @@ -990,11 +957,9 @@ static void REGPROC_export_string(WCHAR **line_buf, DWORD *line_buf_size, DWORD /* escaping characters */ pos = *line_len; - for (i = 0; i < str_len; i++) - { + for (i = 0; i < str_len; i++) { WCHAR c = str[i]; - switch (c) - { + switch (c) { case '\n': extra++; REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len + str_len + extra); @@ -1024,20 +989,17 @@ static void REGPROC_export_binary(WCHAR **line_buf, DWORD *line_buf_size, DWORD const WCHAR *hex_prefix; const WCHAR hex[] = {'h','e','x',':',0}; WCHAR hex_buf[17]; - const WCHAR concat[] = {'\\','\n',' ',' ',0}; + const WCHAR concat[] = {'\\','\r','\n',' ',' ',0}; DWORD concat_prefix, concat_len; - const WCHAR newline[] = {'\n',0}; + const WCHAR newline[] = {'\r','\n',0}; CHAR* value_multibyte = NULL; - if (type == REG_BINARY) - { + if (type == REG_BINARY) { hex_prefix = hex; - } - else - { - const WCHAR hex_format[] = {'h','e','x','(','%','u',')',':',0}; + } else { + const WCHAR hex_format[] = {'h','e','x','(','%','x',')',':',0}; hex_prefix = hex_buf; - wsprintfW(hex_buf, hex_format, type); + sprintfW(hex_buf, hex_format, type); if ((type == REG_SZ || type == REG_EXPAND_SZ || type == REG_MULTI_SZ) && !unicode) { value_multibyte = GetMultiByteStringN((WCHAR*)value, value_size / sizeof(WCHAR), &value_size); @@ -1055,12 +1017,13 @@ static void REGPROC_export_binary(WCHAR **line_buf, DWORD *line_buf_size, DWORD /* - The 2 spaces that concat places at the start of the * line effectively reduce the space available for data. * - If the value name and hex prefix are very long - * ( > REG_FILE_HEX_LINE_LEN) then we may overestimate + * ( > REG_FILE_HEX_LINE_LEN) or *line_len divides + * without a remainder then we may overestimate * the needed number of lines by one. But that's ok. - * - The trailing linefeed takes the place of a comma so - * it's accounted for already. + * - The trailing '\r' takes the place of a comma so + * we only need to add 1 for the trailing '\n' */ - *line_len += *line_len / (REG_FILE_HEX_LINE_LEN - concat_prefix) * concat_len; + *line_len += *line_len / (REG_FILE_HEX_LINE_LEN - concat_prefix) * concat_len + 1; REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len); lstrcpyW(*line_buf + hex_pos, hex_prefix); if (value_size) @@ -1072,7 +1035,7 @@ static void REGPROC_export_binary(WCHAR **line_buf, DWORD *line_buf_size, DWORD i = 0; while (1) { - wsprintfW(*line_buf + data_pos, format, (unsigned int)value[i]); + sprintfW(*line_buf + data_pos, format, (unsigned int)value[i]); data_pos += 2; if (++i == value_size) break; @@ -1081,8 +1044,7 @@ static void REGPROC_export_binary(WCHAR **line_buf, DWORD *line_buf_size, DWORD column += 3; /* wrap the line */ - if (column >= REG_FILE_HEX_LINE_LEN) - { + if (column >= REG_FILE_HEX_LINE_LEN) { lstrcpyW(*line_buf + data_pos, concat); data_pos += concat_len; column = concat_prefix; @@ -1098,17 +1060,10 @@ static void REGPROC_export_binary(WCHAR **line_buf, DWORD *line_buf_size, DWORD */ static void REGPROC_write_line(FILE *file, const WCHAR* str, BOOL unicode) { - int i; - if (unicode) + if(unicode) { - for(i = 0; str[i]; i++) - { - if (str[i] == L'\n') - fputwc(L'\r', file); - fputwc(str[i], file); - } - } - else + fwrite(str, sizeof(WCHAR), lstrlenW(str), file); + } else { char* strA = GetMultiByteString(str); fputs(strA, file); @@ -1133,11 +1088,11 @@ static void REGPROC_write_line(FILE *file, const WCHAR* str, BOOL unicode) * val_size - size of the buffer for storing values in bytes. */ static void export_hkey(FILE *file, HKEY key, -WCHAR **reg_key_name_buf, DWORD *reg_key_name_size, -WCHAR **val_name_buf, DWORD *val_name_size, -BYTE **val_buf, DWORD *val_size, -WCHAR **line_buf, DWORD *line_buf_size, -BOOL unicode) + WCHAR **reg_key_name_buf, DWORD *reg_key_name_size, + WCHAR **val_name_buf, DWORD *val_name_size, + BYTE **val_buf, DWORD *val_size, + WCHAR **line_buf, DWORD *line_buf_size, + BOOL unicode) { DWORD max_sub_key_len; DWORD max_val_name_len; @@ -1146,58 +1101,49 @@ BOOL unicode) DWORD i; BOOL more_data; LONG ret; - WCHAR key_format[] = {'\n','[','%','s',']','\n',0}; + WCHAR key_format[] = {'\r','\n','[','%','s',']','\r','\n',0}; /* get size information and resize the buffers if necessary */ if (RegQueryInfoKeyW(key, NULL, NULL, NULL, NULL, - &max_sub_key_len, NULL, - NULL, &max_val_name_len, &max_val_size, NULL, NULL - ) != ERROR_SUCCESS) - { + &max_sub_key_len, NULL, + NULL, &max_val_name_len, &max_val_size, NULL, NULL + ) != ERROR_SUCCESS) { REGPROC_print_error(); } - curr_len = lstrlenW(*reg_key_name_buf); + curr_len = strlenW(*reg_key_name_buf); REGPROC_resize_char_buffer(reg_key_name_buf, reg_key_name_size, - max_sub_key_len + curr_len + 1); + max_sub_key_len + curr_len + 1); REGPROC_resize_char_buffer(val_name_buf, val_name_size, - max_val_name_len); + max_val_name_len); REGPROC_resize_binary_buffer(val_buf, val_size, max_val_size); REGPROC_resize_char_buffer(line_buf, line_buf_size, lstrlenW(*reg_key_name_buf) + 4); /* output data for the current key */ - wsprintfW(*line_buf, key_format, *reg_key_name_buf); + sprintfW(*line_buf, key_format, *reg_key_name_buf); REGPROC_write_line(file, *line_buf, unicode); /* print all the values */ i = 0; more_data = TRUE; - while(more_data) - { + while(more_data) { DWORD value_type; DWORD val_name_size1 = *val_name_size; DWORD val_size1 = *val_size; ret = RegEnumValueW(key, i, *val_name_buf, &val_name_size1, NULL, - &value_type, *val_buf, &val_size1); - if (ret == ERROR_MORE_DATA) - { + &value_type, *val_buf, &val_size1); + if (ret == ERROR_MORE_DATA) { /* Increase the size of the buffers and retry */ REGPROC_resize_char_buffer(val_name_buf, val_name_size, val_name_size1); REGPROC_resize_binary_buffer(val_buf, val_size, val_size1); - } - else if (ret != ERROR_SUCCESS) - { + } else if (ret != ERROR_SUCCESS) { more_data = FALSE; - if (ret != ERROR_NO_MORE_ITEMS) - { + if (ret != ERROR_NO_MORE_ITEMS) { REGPROC_print_error(); } - } - else - { + } else { DWORD line_len; i++; - if ((*val_name_buf)[0]) - { + if ((*val_name_buf)[0]) { const WCHAR val_start[] = {'"','%','s','"','=',0}; line_len = 0; @@ -1207,31 +1153,25 @@ BOOL unicode) line_len = 3 + lstrlenW(*val_name_buf); REGPROC_resize_char_buffer(line_buf, line_buf_size, line_len); - wsprintfW(*line_buf, val_start, *val_name_buf); - } - else - { + sprintfW(*line_buf, val_start, *val_name_buf); + } else { const WCHAR std_val[] = {'@','=',0}; line_len = 2; REGPROC_resize_char_buffer(line_buf, line_buf_size, line_len); lstrcpyW(*line_buf, std_val); } - switch (value_type) - { + switch (value_type) { case REG_SZ: { WCHAR* wstr = (WCHAR*)*val_buf; if (val_size1 < sizeof(WCHAR) || val_size1 % sizeof(WCHAR) || - wstr[val_size1 / sizeof(WCHAR) - 1]) - { + wstr[val_size1 / sizeof(WCHAR) - 1]) { REGPROC_export_binary(line_buf, line_buf_size, &line_len, value_type, *val_buf, val_size1, unicode); - } - else - { + } else { const WCHAR start[] = {'"',0}; - const WCHAR end[] = {'"','\n',0}; + const WCHAR end[] = {'"','\r','\n',0}; DWORD len; len = lstrlenW(start); @@ -1240,7 +1180,7 @@ BOOL unicode) line_len += len; /* At this point we know wstr is '\0'-terminated - * so we can substract 1 from the size + * so we can subtract 1 from the size */ REGPROC_export_string(line_buf, line_buf_size, &line_len, wstr, val_size1 / sizeof(WCHAR) - 1); @@ -1252,10 +1192,10 @@ BOOL unicode) case REG_DWORD: { - WCHAR format[] = {'d','w','o','r','d',':','%','0','8','x','\n',0}; + WCHAR format[] = {'d','w','o','r','d',':','%','0','8','x','\r','\n',0}; REGPROC_resize_char_buffer(line_buf, line_buf_size, line_len + 15); - wsprintfW(*line_buf + line_len, format, *((DWORD *)*val_buf)); + sprintfW(*line_buf + line_len, format, *((DWORD *)*val_buf)); break; } @@ -1264,14 +1204,14 @@ BOOL unicode) char* key_nameA = GetMultiByteString(*reg_key_name_buf); char* value_nameA = GetMultiByteString(*val_name_buf); fprintf(stderr,"%S: warning - unsupported registry format '%ld', " - "treat as binary\n", - getAppName(), value_type); + "treat as binary\n", + getAppName(), value_type); fprintf(stderr,"key name: \"%s\"\n", key_nameA); fprintf(stderr,"value name:\"%s\"\n\n", value_nameA); HeapFree(GetProcessHeap(), 0, key_nameA); HeapFree(GetProcessHeap(), 0, value_nameA); } - /* falls through */ + /* falls through */ case REG_EXPAND_SZ: case REG_MULTI_SZ: /* falls through */ @@ -1285,40 +1225,30 @@ BOOL unicode) i = 0; more_data = TRUE; (*reg_key_name_buf)[curr_len] = '\\'; - while(more_data) - { + while(more_data) { DWORD buf_size = *reg_key_name_size - curr_len - 1; ret = RegEnumKeyExW(key, i, *reg_key_name_buf + curr_len + 1, &buf_size, - NULL, NULL, NULL, NULL); - if (ret == ERROR_MORE_DATA) - { + NULL, NULL, NULL, NULL); + if (ret == ERROR_MORE_DATA) { /* Increase the size of the buffer and retry */ REGPROC_resize_char_buffer(reg_key_name_buf, reg_key_name_size, curr_len + 1 + buf_size); - } - else if (ret != ERROR_SUCCESS) - { + } else if (ret != ERROR_SUCCESS) { more_data = FALSE; - if (ret != ERROR_NO_MORE_ITEMS) - { + if (ret != ERROR_NO_MORE_ITEMS) { REGPROC_print_error(); } - } - else - { + } else { HKEY subkey; i++; if (RegOpenKeyW(key, *reg_key_name_buf + curr_len + 1, - &subkey) == ERROR_SUCCESS) - { + &subkey) == ERROR_SUCCESS) { export_hkey(file, subkey, reg_key_name_buf, reg_key_name_size, - val_name_buf, val_name_size, val_buf, val_size, - line_buf, line_buf_size, unicode); + val_name_buf, val_name_size, val_buf, val_size, + line_buf, line_buf_size, unicode); RegCloseKey(subkey); - } - else - { + } else { REGPROC_print_error(); } } @@ -1327,40 +1257,37 @@ BOOL unicode) } /****************************************************************************** - * Open file for export. + * Open file in binary mode for export. */ static FILE *REGPROC_open_export_file(WCHAR *file_name, BOOL unicode) { FILE *file; WCHAR dash = '-'; - if (wcsncmp(file_name, &dash, 1) == 0) - file = stdout; - else + if (strncmpW(file_name,&dash,1)==0) { + file=stdout; + _setmode(_fileno(file), _O_BINARY); + } else { - if (unicode) - file = _wfopen(file_name, L"wb"); - else - file = _wfopen(file_name, L"w"); - if (!file) - { - CHAR* file_nameA = GetMultiByteString(file_name); + CHAR* file_nameA = GetMultiByteString(file_name); + file = fopen(file_nameA, "wb"); + if (!file) { perror(""); fprintf(stderr,"%S: Can't open file \"%s\"\n", getAppName(), file_nameA); HeapFree(GetProcessHeap(), 0, file_nameA); exit(1); } + HeapFree(GetProcessHeap(), 0, file_nameA); } - if (unicode) + if(unicode) { const BYTE unicode_seq[] = {0xff,0xfe}; - const WCHAR header[] = L"Windows Registry Editor Version 5.00\r\n"; - fwrite(unicode_seq, sizeof(BYTE), COUNT_OF(unicode_seq), file); - fwrite(header, sizeof(WCHAR), lstrlenW(header), file); - } - else + const WCHAR header[] = {'W','i','n','d','o','w','s',' ','R','e','g','i','s','t','r','y',' ','E','d','i','t','o','r',' ','V','e','r','s','i','o','n',' ','5','.','0','0','\r','\n'}; + fwrite(unicode_seq, sizeof(BYTE), sizeof(unicode_seq)/sizeof(unicode_seq[0]), file); + fwrite(header, sizeof(WCHAR), sizeof(header)/sizeof(header[0]), file); + } else { - fputs("REGEDIT4\n", file); + fputs("REGEDIT4\r\n", file); } return file; @@ -1388,87 +1315,75 @@ BOOL export_registry_key(WCHAR *file_name, WCHAR *reg_key_name, DWORD format) BOOL unicode = (format == REG_FORMAT_5); reg_key_name_buf = HeapAlloc(GetProcessHeap(), 0, - reg_key_name_size * sizeof(*reg_key_name_buf)); + reg_key_name_size * sizeof(*reg_key_name_buf)); val_name_buf = HeapAlloc(GetProcessHeap(), 0, - val_name_size * sizeof(*val_name_buf)); + val_name_size * sizeof(*val_name_buf)); val_buf = HeapAlloc(GetProcessHeap(), 0, val_size); line_buf = HeapAlloc(GetProcessHeap(), 0, line_buf_size * sizeof(*line_buf)); CHECK_ENOUGH_MEMORY(reg_key_name_buf && val_name_buf && val_buf && line_buf); - if (reg_key_name && reg_key_name[0]) - { + if (reg_key_name && reg_key_name[0]) { HKEY reg_key_class; WCHAR *branch_name = NULL; HKEY key; REGPROC_resize_char_buffer(®_key_name_buf, ®_key_name_size, - lstrlenW(reg_key_name)); + lstrlenW(reg_key_name)); lstrcpyW(reg_key_name_buf, reg_key_name); /* open the specified key */ - if (!parseKeyName(reg_key_name, ®_key_class, &branch_name)) - { + if (!parseKeyName(reg_key_name, ®_key_class, &branch_name)) { CHAR* key_nameA = GetMultiByteString(reg_key_name); fprintf(stderr,"%S: Incorrect registry class specification in '%s'\n", - getAppName(), key_nameA); + getAppName(), key_nameA); HeapFree(GetProcessHeap(), 0, key_nameA); exit(1); } - if (!branch_name[0]) - { + if (!branch_name[0]) { /* no branch - registry class is specified */ file = REGPROC_open_export_file(file_name, unicode); export_hkey(file, reg_key_class, - ®_key_name_buf, ®_key_name_size, - &val_name_buf, &val_name_size, - &val_buf, &val_size, &line_buf, - &line_buf_size, unicode); - } - else if (RegOpenKeyW(reg_key_class, branch_name, &key) == ERROR_SUCCESS) - { + ®_key_name_buf, ®_key_name_size, + &val_name_buf, &val_name_size, + &val_buf, &val_size, &line_buf, + &line_buf_size, unicode); + } else if (RegOpenKeyW(reg_key_class, branch_name, &key) == ERROR_SUCCESS) { file = REGPROC_open_export_file(file_name, unicode); export_hkey(file, key, - ®_key_name_buf, ®_key_name_size, - &val_name_buf, &val_name_size, - &val_buf, &val_size, &line_buf, - &line_buf_size, unicode); + ®_key_name_buf, ®_key_name_size, + &val_name_buf, &val_name_size, + &val_buf, &val_size, &line_buf, + &line_buf_size, unicode); RegCloseKey(key); - } - else - { + } else { CHAR* key_nameA = GetMultiByteString(reg_key_name); fprintf(stderr,"%S: Can't export. Registry key '%s' does not exist!\n", - getAppName(), key_nameA); + getAppName(), key_nameA); HeapFree(GetProcessHeap(), 0, key_nameA); REGPROC_print_error(); } - } - else - { + } else { unsigned int i; /* export all registry classes */ file = REGPROC_open_export_file(file_name, unicode); - for (i = 0; i < REG_CLASS_NUMBER; i++) - { + for (i = 0; i < REG_CLASS_NUMBER; i++) { /* do not export HKEY_CLASSES_ROOT */ if (reg_class_keys[i] != HKEY_CLASSES_ROOT && - reg_class_keys[i] != HKEY_CURRENT_USER && - reg_class_keys[i] != HKEY_CURRENT_CONFIG && - reg_class_keys[i] != HKEY_DYN_DATA) - { + reg_class_keys[i] != HKEY_CURRENT_USER && + reg_class_keys[i] != HKEY_CURRENT_CONFIG && + reg_class_keys[i] != HKEY_DYN_DATA) { lstrcpyW(reg_key_name_buf, reg_class_namesW[i]); export_hkey(file, reg_class_keys[i], - ®_key_name_buf, ®_key_name_size, - &val_name_buf, &val_name_size, - &val_buf, &val_size, &line_buf, - &line_buf_size, unicode); + ®_key_name_buf, ®_key_name_size, + &val_name_buf, &val_name_size, + &val_buf, &val_size, &line_buf, + &line_buf_size, unicode); } } } - if (file) - { + if (file) { fclose(file); } HeapFree(GetProcessHeap(), 0, reg_key_name); @@ -1491,11 +1406,9 @@ BOOL import_registry_file(FILE* reg_file) if (s[0] == 0xff && s[1] == 0xfe) { processRegLinesW(reg_file); - } - else + } else { - fseek(reg_file, 0, SEEK_SET); - processRegLinesA(reg_file); + processRegLinesA(reg_file, (char*)s); } } return TRUE; @@ -1518,19 +1431,17 @@ void delete_registry_key(WCHAR *reg_key_name) if (!reg_key_name || !reg_key_name[0]) return; - if (!parseKeyName(reg_key_name, &key_class, &key_name)) - { + if (!parseKeyName(reg_key_name, &key_class, &key_name)) { char* reg_key_nameA = GetMultiByteString(reg_key_name); fprintf(stderr,"%S: Incorrect registry class specification in '%s'\n", - getAppName(), reg_key_nameA); + getAppName(), reg_key_nameA); HeapFree(GetProcessHeap(), 0, reg_key_nameA); exit(1); } - if (!*key_name) - { + if (!*key_name) { char* reg_key_nameA = GetMultiByteString(reg_key_name); fprintf(stderr,"%S: Can't delete registry class '%s'\n", - getAppName(), reg_key_nameA); + getAppName(), reg_key_nameA); HeapFree(GetProcessHeap(), 0, reg_key_nameA); exit(1); } diff --git a/reactos/base/applications/regedit/regproc.h b/reactos/base/applications/regedit/regproc.h index b78a39c3900..a2a2d5033e8 100644 --- a/reactos/base/applications/regedit/regproc.h +++ b/reactos/base/applications/regedit/regproc.h @@ -14,7 +14,7 @@ * * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ #pragma once @@ -25,7 +25,7 @@ #define REG_FORMAT_4 2 BOOL export_registry_key(WCHAR *file_name, WCHAR *reg_key_name, DWORD format); -BOOL import_registry_file(FILE* reg_file); -void delete_registry_key(LPTSTR reg_key_name); +BOOL import_registry_file(FILE *in); +void delete_registry_key(WCHAR *reg_key_name); WCHAR* GetWideString(const char* strA); CHAR* GetMultiByteString(const WCHAR* strW); From 16106afe9172388162a2f84627e3558155deada3 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 20:44:26 +0000 Subject: [PATCH 348/419] [LIBXSLT] * Move a couple headers to the appropriate folder. svn path=/trunk/; revision=62776 --- .../{dll/3rdparty => include/reactos/libs}/libxslt/functions.h | 0 .../{dll/3rdparty => include/reactos/libs}/libxslt/variables.h | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename reactos/{dll/3rdparty => include/reactos/libs}/libxslt/functions.h (100%) rename reactos/{dll/3rdparty => include/reactos/libs}/libxslt/variables.h (100%) diff --git a/reactos/dll/3rdparty/libxslt/functions.h b/reactos/include/reactos/libs/libxslt/functions.h similarity index 100% rename from reactos/dll/3rdparty/libxslt/functions.h rename to reactos/include/reactos/libs/libxslt/functions.h diff --git a/reactos/dll/3rdparty/libxslt/variables.h b/reactos/include/reactos/libs/libxslt/variables.h similarity index 100% rename from reactos/dll/3rdparty/libxslt/variables.h rename to reactos/include/reactos/libs/libxslt/variables.h From 4dbdbdbce852c79ce0101a7a9e7f4c01d66cd324 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 21:26:31 +0000 Subject: [PATCH 349/419] [IPHLPAPI] * Zap GetIf{Entry,Table}2(). CORE-8081 #resolve svn path=/trunk/; revision=62777 --- reactos/dll/win32/iphlpapi/iphlpapi.spec | 2 -- reactos/dll/win32/iphlpapi/iphlpapi_main.c | 29 ---------------------- 2 files changed, 31 deletions(-) diff --git a/reactos/dll/win32/iphlpapi/iphlpapi.spec b/reactos/dll/win32/iphlpapi/iphlpapi.spec index 4206beafacd..67ec918f129 100644 --- a/reactos/dll/win32/iphlpapi/iphlpapi.spec +++ b/reactos/dll/win32/iphlpapi/iphlpapi.spec @@ -40,10 +40,8 @@ @ stub GetIcmpStatsFromStack @ stub GetIcmpStatsFromStackEx @ stdcall GetIfEntry( ptr ) -@ stdcall GetIfEntry2( ptr ) @ stub GetIfEntryFromStack @ stdcall GetIfTable( ptr ptr long ) -@ stdcall GetIfTable2(ptr) @ stub GetIfTableFromStack @ stub GetIgmpList @ stdcall GetInterfaceInfo( ptr ptr ) diff --git a/reactos/dll/win32/iphlpapi/iphlpapi_main.c b/reactos/dll/win32/iphlpapi/iphlpapi_main.c index dff38c05714..bea15a3ba96 100644 --- a/reactos/dll/win32/iphlpapi/iphlpapi_main.c +++ b/reactos/dll/win32/iphlpapi/iphlpapi_main.c @@ -2517,35 +2517,6 @@ DWORD WINAPI GetIcmpStatisticsEx(PMIB_ICMP_EX pStats,DWORD dwFamily) return 0L; } -/****************************************************************** - * GetIfTable2 (IPHLPAPI.@) - * - * PARAMS - * pIfTable [In/Out] - */ - -NETIOAPI_API WINAPI GetIfTable2(PMIB_IF_TABLE2 *pIfTable) -{ - UNIMPLEMENTED; - return ERROR_NOT_SUPPORTED; -} - -/****************************************************************** - * GetIfEntry2 (IPHLPAPI.@) - * - * PARAMS - * pIfRow [In/Out] - */ -NETIOAPI_API WINAPI GetIfEntry2(IN OUT PMIB_IF_ROW2 pIfRow) -{ - TRACE("pIfRow %p\n", pIfRow); - if (!pIfRow) - return ERROR_INVALID_PARAMETER; - - UNIMPLEMENTED; - return ERROR_NOT_SUPPORTED; -} - DWORD WINAPI SetIpForwardEntryToStack(PMIB_IPFORWARDROW pRoute) { From bf1641e9b8d777da84dfc31f9c938abdbb051a18 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 21:32:49 +0000 Subject: [PATCH 350/419] [PSDK] * Fix netioapi.h inclusion. * Fix extern "C" placement. CORE-7685 svn path=/trunk/; revision=62778 --- reactos/include/psdk/iphlpapi.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/reactos/include/psdk/iphlpapi.h b/reactos/include/psdk/iphlpapi.h index a799280d265..c6ce686047f 100644 --- a/reactos/include/psdk/iphlpapi.h +++ b/reactos/include/psdk/iphlpapi.h @@ -1,13 +1,14 @@ #ifndef _IPHLPAPI_H #define _IPHLPAPI_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include -#include -#ifdef __cplusplus -extern "C" { -#endif + DWORD WINAPI AddIPAddress(IPAddr,IPMask,DWORD,PULONG,PULONG); DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW); DWORD WINAPI CreateIpNetEntry(PMIB_IPNETROW); @@ -58,7 +59,13 @@ DWORD WINAPI SetIpStatistics(PMIB_IPSTATS); DWORD WINAPI SetIpTTL(UINT); DWORD WINAPI SetTcpEntry(PMIB_TCPROW); DWORD WINAPI UnenableRouter(OVERLAPPED*, LPDWORD); + +#if (NTDDI_VERSION >= NTDDI_VISTA) +#include +#endif + #ifdef __cplusplus } #endif + #endif /* _IPHLPAPI_H */ From 81f368964f42730243a08dd3085367352e92c840 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 18 Apr 2014 21:40:02 +0000 Subject: [PATCH 351/419] [CDFS] Convert FCB pathname from simple buffer to unicode string. Please carefully review if I missed something svn path=/trunk/; revision=62779 --- reactos/drivers/filesystems/cdfs/cdfs.h | 9 +++--- reactos/drivers/filesystems/cdfs/create.c | 6 ++-- reactos/drivers/filesystems/cdfs/dirctl.c | 35 +++++++++++++---------- reactos/drivers/filesystems/cdfs/fcb.c | 26 +++++++++-------- reactos/drivers/filesystems/cdfs/finfo.c | 8 +++--- reactos/drivers/filesystems/cdfs/fsctl.c | 2 +- 6 files changed, 47 insertions(+), 39 deletions(-) diff --git a/reactos/drivers/filesystems/cdfs/cdfs.h b/reactos/drivers/filesystems/cdfs/cdfs.h index 5a344137d61..78c9b57e387 100644 --- a/reactos/drivers/filesystems/cdfs/cdfs.h +++ b/reactos/drivers/filesystems/cdfs/cdfs.h @@ -189,8 +189,9 @@ typedef struct _FCB UNICODE_STRING ShortNameU; - WCHAR *ObjectName; /* point on filename (250 chars max) in PathName */ - WCHAR PathName[MAX_PATH]; /* path+filename 260 max */ + WCHAR *ObjectName; /* point on filename (250 chars max) in PathName */ + UNICODE_STRING PathName; /* path+filename 260 max */ + WCHAR PathNameBuffer[MAX_PATH]; /* Buffer for PathName */ WCHAR ShortNameBuffer[13]; LIST_ENTRY FcbListEntry; @@ -198,8 +199,8 @@ typedef struct _FCB ULONG DirIndex; - LARGE_INTEGER IndexNumber; /* HighPart: Parent directory start sector */ - /* LowPart: Directory record offset in the parent directory file */ + LARGE_INTEGER IndexNumber; /* HighPart: Parent directory start sector */ + /* LowPart: Directory record offset in the parent directory file */ LONG RefCount; ULONG Flags; diff --git a/reactos/drivers/filesystems/cdfs/create.c b/reactos/drivers/filesystems/cdfs/create.c index dcec4d15dbf..eef173d90a0 100644 --- a/reactos/drivers/filesystems/cdfs/create.c +++ b/reactos/drivers/filesystems/cdfs/create.c @@ -56,7 +56,7 @@ CdfsMakeAbsoluteFilename(PFILE_OBJECT FileObject, } /* construct absolute path name */ - Length = (wcslen(Fcb->PathName) * sizeof(WCHAR)) + + Length = Fcb->PathName.Length + sizeof(WCHAR) + RelativeFileName->Length + sizeof(WCHAR); @@ -69,8 +69,8 @@ CdfsMakeAbsoluteFilename(PFILE_OBJECT FileObject, return STATUS_INSUFFICIENT_RESOURCES; } - Status = RtlAppendUnicodeToString(AbsoluteFileName, - Fcb->PathName); + Status = RtlAppendUnicodeStringToString(AbsoluteFileName, + &Fcb->PathName); if (!NT_SUCCESS(Status)) { RtlFreeUnicodeString(AbsoluteFileName); diff --git a/reactos/drivers/filesystems/cdfs/dirctl.c b/reactos/drivers/filesystems/cdfs/dirctl.c index e8568e31d23..652ca111bc0 100644 --- a/reactos/drivers/filesystems/cdfs/dirctl.c +++ b/reactos/drivers/filesystems/cdfs/dirctl.c @@ -216,17 +216,20 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt, /* it's root : complete essentials fields then return ok */ RtlZeroMemory(Fcb, sizeof(FCB)); - Fcb->PathName[0] = '\\'; - Fcb->ObjectName = &Fcb->PathName[1]; + Fcb->PathNameBuffer[0] = '\\'; + Fcb->ObjectName = &Fcb->PathNameBuffer[1]; Fcb->Entry.ExtentLocationL = DeviceExt->CdInfo.RootStart; Fcb->Entry.DataLengthL = DeviceExt->CdInfo.RootSize; Fcb->Entry.FileFlags = 0x02; //FILE_ATTRIBUTE_DIRECTORY; + Fcb->PathName.Length = sizeof(WCHAR); + Fcb->PathName.MaximumLength = sizeof(Fcb->PathNameBuffer); + Fcb->PathName.Buffer = Fcb->PathNameBuffer; if (pDirIndex) *pDirIndex = 0; if (pOffset) *pOffset = 0; - DPRINT("CdfsFindFile: new Pathname %S, new Objectname %S)\n",Fcb->PathName, Fcb->ObjectName); + DPRINT("CdfsFindFile: new Pathname %wZ, new Objectname %S)\n",&Fcb->PathName, Fcb->ObjectName); return STATUS_SUCCESS; } } @@ -303,12 +306,13 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt, if (FsRtlIsNameInExpression(&FileToFindUpcase, &LongName, TRUE, NULL) || FsRtlIsNameInExpression(&FileToFindUpcase, &ShortName, TRUE, NULL)) { - if (Parent->PathName[0]) + if (Parent->PathName.Buffer[0]) { - len = wcslen(Parent->PathName); - memcpy(Fcb->PathName, Parent->PathName, len*sizeof(WCHAR)); - Fcb->ObjectName=&Fcb->PathName[len]; - if (len != 1 || Fcb->PathName[0] != '\\') + len = Parent->PathName.Length / sizeof(WCHAR); + memcpy(Fcb->PathName.Buffer, Parent->PathName.Buffer, Parent->PathName.Length); + Fcb->PathName.Length = Parent->PathName.Length; + Fcb->ObjectName=&Fcb->PathName.Buffer[len]; + if (len != 1 || Fcb->PathName.Buffer[0] != '\\') { Fcb->ObjectName[0] = '\\'; Fcb->ObjectName = &Fcb->ObjectName[1]; @@ -316,16 +320,16 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt, } else { - Fcb->ObjectName=Fcb->PathName; + Fcb->ObjectName=Fcb->PathName.Buffer; Fcb->ObjectName[0]='\\'; Fcb->ObjectName=&Fcb->ObjectName[1]; } - DPRINT("PathName '%S' ObjectName '%S'\n", Fcb->PathName, Fcb->ObjectName); + DPRINT("PathName '%wZ' ObjectName '%S'\n", &Fcb->PathName, Fcb->ObjectName); memcpy(&Fcb->Entry, Record, sizeof(DIR_RECORD)); wcsncpy(Fcb->ObjectName, name, min(wcslen(name) + 1, - MAX_PATH - wcslen(Fcb->PathName) + wcslen(Fcb->ObjectName))); + MAX_PATH - (Fcb->PathName.Length / sizeof(WCHAR)) + wcslen(Fcb->ObjectName))); /* Copy short name */ Fcb->ShortNameU.Length = ShortName.Length; @@ -338,8 +342,8 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt, if (pOffset) *pOffset = Offset; - DPRINT("FindFile: new Pathname %S, new Objectname %S, DirIndex %u\n", - Fcb->PathName, Fcb->ObjectName, DirIndex); + DPRINT("FindFile: new Pathname %wZ, new Objectname %S, DirIndex %u\n", + &Fcb->PathName, Fcb->ObjectName, DirIndex); RtlFreeUnicodeString(&FileToFindUpcase); CcUnpinData(Context); @@ -572,6 +576,8 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject, DeviceExtension = DeviceObject->DeviceExtension; Stack = IoGetCurrentIrpStackLocation(Irp); FileObject = Stack->FileObject; + TempFcb.PathName.Buffer = TempFcb.PathNameBuffer; + TempFcb.PathName.MaximumLength = sizeof(TempFcb.PathNameBuffer); Ccb = (PCCB)FileObject->FsContext2; Fcb = (PFCB)FileObject->FsContext; @@ -646,7 +652,7 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject, } DPRINT("Buffer = %p tofind = %wZ\n", Buffer, &Ccb->DirectorySearchPattern); - TempFcb.ObjectName = TempFcb.PathName; + TempFcb.ObjectName = TempFcb.PathName.Buffer; while (Status == STATUS_SUCCESS && BufferLength > 0) { Status = CdfsFindFile(DeviceExtension, @@ -746,7 +752,6 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject, } - NTSTATUS NTAPI CdfsDirectoryControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) diff --git a/reactos/drivers/filesystems/cdfs/fcb.c b/reactos/drivers/filesystems/cdfs/fcb.c index 66570085db5..1bd06c181c1 100644 --- a/reactos/drivers/filesystems/cdfs/fcb.c +++ b/reactos/drivers/filesystems/cdfs/fcb.c @@ -73,17 +73,19 @@ CdfsCreateFCB(PCWSTR FileName) if(!Fcb) return NULL; RtlZeroMemory(Fcb, sizeof(FCB)); + Fcb->PathName.Buffer = Fcb->PathNameBuffer; + Fcb->PathName.MaximumLength = sizeof(Fcb->PathNameBuffer); if (FileName) { - CdfsWSubString(Fcb->PathName, FileName, sizeof(Fcb->PathName) / sizeof(Fcb->PathName[0]) - 1); - if (wcsrchr(Fcb->PathName, '\\') != 0) + RtlAppendUnicodeToString(&Fcb->PathName, FileName); + if (wcsrchr(Fcb->PathName.Buffer, '\\') != 0) { - Fcb->ObjectName = wcsrchr(Fcb->PathName, '\\'); + Fcb->ObjectName = wcsrchr(Fcb->PathName.Buffer, '\\'); } else { - Fcb->ObjectName = Fcb->PathName; + Fcb->ObjectName = Fcb->PathName.Buffer; } } @@ -129,7 +131,7 @@ CdfsFCBIsDirectory(PFCB Fcb) BOOLEAN CdfsFCBIsRoot(PFCB Fcb) { - return(wcscmp(Fcb->PathName, L"\\") == 0); + return (Fcb->PathName.Length = sizeof(WCHAR) && Fcb->PathName.Buffer[0] == L'\\'); } @@ -156,9 +158,9 @@ CdfsReleaseFCB(PDEVICE_EXTENSION Vcb, { KIRQL oldIrql; - DPRINT("releasing FCB at %p: %S, refCount:%d\n", + DPRINT("releasing FCB at %p: %wZ, refCount:%d\n", Fcb, - Fcb->PathName, + &Fcb->PathName, Fcb->RefCount); KeAcquireSpinLock(&Vcb->FcbListLock, &oldIrql); @@ -209,8 +211,8 @@ CdfsGrabFCBFromTable(PDEVICE_EXTENSION Vcb, { Fcb = CONTAINING_RECORD(current_entry, FCB, FcbListEntry); - DPRINT("Comparing '%wZ' and '%S'\n", FileName, Fcb->PathName); - if (_wcsicmp(FileName->Buffer, Fcb->PathName) == 0) + DPRINT("Comparing '%wZ' and '%wZ'\n", FileName, &Fcb->PathName); + if (RtlCompareUnicodeString(FileName, &Fcb->PathName, TRUE) == 0) { Fcb->RefCount++; KeReleaseSpinLock(&Vcb->FcbListLock, oldIrql); @@ -365,12 +367,12 @@ CdfsMakeFCBFromDirEntry(PVCB Vcb, /* Check if the full string would overflow the pathName buffer (the additional characters are for '\\' and '\0') */ if ((LongName[0] != 0) && - (wcslen(DirectoryFCB->PathName) + 1 + wcslen(LongName) + 1 > MAX_PATH)) + ((DirectoryFCB->PathName.Length / sizeof(WCHAR)) + 1 + wcslen(LongName) + 1 > MAX_PATH)) { return(STATUS_OBJECT_NAME_INVALID); } - wcscpy(pathName, DirectoryFCB->PathName); + wcscpy(pathName, DirectoryFCB->PathName.Buffer); if (!CdfsFCBIsRoot(DirectoryFCB)) { wcscat(pathName, L"\\"); @@ -488,7 +490,7 @@ CdfsDirFindFile(PDEVICE_EXTENSION DeviceExt, DeviceExt, DirectoryFcb, FileToFind); - DPRINT("Dir Path:%S\n", DirectoryFcb->PathName); + DPRINT("Dir Path:%wZ\n", &DirectoryFcb->PathName); /* default to '.' if no filename specified */ if (FileToFind->Length == 0) diff --git a/reactos/drivers/filesystems/cdfs/finfo.c b/reactos/drivers/filesystems/cdfs/finfo.c index 41304a8ce34..a64d7cc448d 100644 --- a/reactos/drivers/filesystems/cdfs/finfo.c +++ b/reactos/drivers/filesystems/cdfs/finfo.c @@ -164,7 +164,7 @@ CdfsGetNameInformation(PFILE_OBJECT FileObject, return STATUS_BUFFER_OVERFLOW; /* Calculate file name length in bytes */ - NameLength = wcslen(Fcb->PathName) * sizeof(WCHAR); + NameLength = Fcb->PathName.Length; NameInfo->FileNameLength = NameLength; /* Calculate amount of bytes to copy not to overflow the buffer */ @@ -172,7 +172,7 @@ CdfsGetNameInformation(PFILE_OBJECT FileObject, *BufferLength - FIELD_OFFSET(FILE_NAME_INFORMATION, FileName[0])); /* Fill in the bytes */ - RtlCopyMemory(NameInfo->FileName, Fcb->PathName, BytesToCopy); + RtlCopyMemory(NameInfo->FileName, Fcb->PathName.Buffer, BytesToCopy); /* Check if we could write more but are not able to */ if (*BufferLength < NameLength + FIELD_OFFSET(FILE_NAME_INFORMATION, FileName[0])) @@ -268,7 +268,7 @@ CdfsGetAllInformation(PFILE_OBJECT FileObject, ASSERT(Info); ASSERT(Fcb); - NameLength = wcslen(Fcb->PathName) * sizeof(WCHAR); + NameLength = Fcb->PathName.Length; if (*BufferLength < sizeof(FILE_ALL_INFORMATION) + NameLength) return(STATUS_BUFFER_OVERFLOW); @@ -321,7 +321,7 @@ CdfsGetAllInformation(PFILE_OBJECT FileObject, /* Name Information */ Info->NameInformation.FileNameLength = NameLength; RtlCopyMemory(Info->NameInformation.FileName, - Fcb->PathName, + Fcb->PathName.Buffer, NameLength + sizeof(WCHAR)); *BufferLength -= (sizeof(FILE_ALL_INFORMATION) + NameLength + sizeof(WCHAR)); diff --git a/reactos/drivers/filesystems/cdfs/fsctl.c b/reactos/drivers/filesystems/cdfs/fsctl.c index 9b658c76aaf..c4920b4533b 100644 --- a/reactos/drivers/filesystems/cdfs/fsctl.c +++ b/reactos/drivers/filesystems/cdfs/fsctl.c @@ -513,7 +513,7 @@ CdfsVerifyVolume(PDEVICE_OBJECT DeviceObject, while (Entry != &DeviceExt->FcbListHead) { Fcb = (PFCB)CONTAINING_RECORD(Entry, FCB, FcbListEntry); - DPRINT1("OpenFile %S RefCount %ld\n", Fcb->PathName, Fcb->RefCount); + DPRINT1("OpenFile %wZ RefCount %ld\n", &Fcb->PathName, Fcb->RefCount); Entry = Entry->Flink; } From 8b86c3ee99f91aa342e2d19c43710ced1bcef2fd Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Fri, 18 Apr 2014 21:49:12 +0000 Subject: [PATCH 352/419] [CDFS] Allow registering notifications. None implemented yet. svn path=/trunk/; revision=62780 --- reactos/drivers/filesystems/cdfs/cdfs.h | 4 ++ reactos/drivers/filesystems/cdfs/cleanup.c | 4 ++ reactos/drivers/filesystems/cdfs/dirctl.c | 43 ++++++++++++++++++++-- reactos/drivers/filesystems/cdfs/fsctl.c | 3 ++ 4 files changed, 51 insertions(+), 3 deletions(-) diff --git a/reactos/drivers/filesystems/cdfs/cdfs.h b/reactos/drivers/filesystems/cdfs/cdfs.h index 78c9b57e387..dd281f027f7 100644 --- a/reactos/drivers/filesystems/cdfs/cdfs.h +++ b/reactos/drivers/filesystems/cdfs/cdfs.h @@ -160,6 +160,10 @@ typedef struct PFILE_OBJECT StreamFileObject; CDINFO CdInfo; + + /* Notifications */ + LIST_ENTRY NotifyList; + PNOTIFY_SYNC NotifySync; } DEVICE_EXTENSION, *PDEVICE_EXTENSION, VCB, *PVCB; diff --git a/reactos/drivers/filesystems/cdfs/cleanup.c b/reactos/drivers/filesystems/cdfs/cleanup.c index ee494d181a0..19d866de6fd 100644 --- a/reactos/drivers/filesystems/cdfs/cleanup.c +++ b/reactos/drivers/filesystems/cdfs/cleanup.c @@ -46,6 +46,10 @@ CdfsCleanupFile(PDEVICE_EXTENSION DeviceExt, DeviceExt, FileObject); + /* Notify about the cleanup */ + FsRtlNotifyCleanup(DeviceExt->NotifySync, + &(DeviceExt->NotifyList), + FileObject->FsContext2); /* Uninitialize file cache if initialized for this file object. */ if (FileObject->SectionObjectPointer && FileObject->SectionObjectPointer->SharedCacheMap) diff --git a/reactos/drivers/filesystems/cdfs/dirctl.c b/reactos/drivers/filesystems/cdfs/dirctl.c index 652ca111bc0..ed6e5c9c2fd 100644 --- a/reactos/drivers/filesystems/cdfs/dirctl.c +++ b/reactos/drivers/filesystems/cdfs/dirctl.c @@ -752,6 +752,40 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject, } +static NTSTATUS +CdfsNotifyChangeDirectory(PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + PDEVICE_EXTENSION DeviceExtension; + PFCB Fcb; + PCCB Ccb; + PIO_STACK_LOCATION Stack; + PFILE_OBJECT FileObject; + + DPRINT("CdfsNotifyChangeDirectory() called\n"); + + DeviceExtension = DeviceObject->DeviceExtension; + Stack = IoGetCurrentIrpStackLocation(Irp); + FileObject = Stack->FileObject; + + Ccb = (PCCB)FileObject->FsContext2; + Fcb = (PFCB)FileObject->FsContext; + + FsRtlNotifyFullChangeDirectory(DeviceExtension->NotifySync, + &(DeviceExtension->NotifyList), + Ccb, + (PSTRING)&(Fcb->PathName), + BooleanFlagOn(Stack->Flags, SL_WATCH_TREE), + FALSE, + Stack->Parameters.NotifyDirectory.CompletionFilter, + Irp, + NULL, + NULL); + + return STATUS_PENDING; +} + + NTSTATUS NTAPI CdfsDirectoryControl(PDEVICE_OBJECT DeviceObject, PIRP Irp) @@ -772,8 +806,8 @@ CdfsDirectoryControl(PDEVICE_OBJECT DeviceObject, break; case IRP_MN_NOTIFY_CHANGE_DIRECTORY: - DPRINT1("IRP_MN_NOTIFY_CHANGE_DIRECTORY\n"); - Status = STATUS_NOT_IMPLEMENTED; + Status = CdfsNotifyChangeDirectory(DeviceObject, + Irp); break; default: @@ -785,7 +819,10 @@ CdfsDirectoryControl(PDEVICE_OBJECT DeviceObject, Irp->IoStatus.Status = Status; Irp->IoStatus.Information = 0; - IoCompleteRequest(Irp, IO_NO_INCREMENT); + if (Status != STATUS_PENDING) + { + IoCompleteRequest(Irp, IO_NO_INCREMENT); + } FsRtlExitFileSystem(); return(Status); diff --git a/reactos/drivers/filesystems/cdfs/fsctl.c b/reactos/drivers/filesystems/cdfs/fsctl.c index c4920b4533b..8504b0f8c22 100644 --- a/reactos/drivers/filesystems/cdfs/fsctl.c +++ b/reactos/drivers/filesystems/cdfs/fsctl.c @@ -429,6 +429,9 @@ CdfsMountVolume(PDEVICE_OBJECT DeviceObject, KeInitializeSpinLock(&DeviceExt->FcbListLock); InitializeListHead(&DeviceExt->FcbListHead); + FsRtlNotifyInitializeSync(&DeviceExt->NotifySync); + InitializeListHead(&DeviceExt->NotifyList); + Status = STATUS_SUCCESS; ByeBye: From 741748858322a848e0f1810e30dfff4d4af7e540 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 21:58:58 +0000 Subject: [PATCH 353/419] [ADVAPI32_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62781 --- rostests/winetests/advapi32/cred.c | 191 +++--- rostests/winetests/advapi32/crypt.c | 75 ++- rostests/winetests/advapi32/eventlog.c | 158 +++-- rostests/winetests/advapi32/lsa.c | 4 +- rostests/winetests/advapi32/registry.c | 80 ++- rostests/winetests/advapi32/security.c | 879 +++++++++++++++++++++++-- rostests/winetests/advapi32/service.c | 23 +- 7 files changed, 1132 insertions(+), 278 deletions(-) diff --git a/rostests/winetests/advapi32/cred.c b/rostests/winetests/advapi32/cred.c index 05705df705e..7e276d4a4e7 100644 --- a/rostests/winetests/advapi32/cred.c +++ b/rostests/winetests/advapi32/cred.c @@ -187,7 +187,7 @@ static void test_CredReadDomainCredentialsA(void) char target_name[] = "no_such_target"; CREDENTIAL_TARGET_INFORMATIONA info = {target_name, NULL, target_name, NULL, NULL, NULL, NULL, 0, 0, NULL}; DWORD count; - PCREDENTIAL* creds; + PCREDENTIALA* creds; if (!pCredReadDomainCredentialsA) { @@ -563,14 +563,65 @@ static void test_CredMarshalCredentialA(void) static void test_CredUnmarshalCredentialA(void) { - static WCHAR tW[] = {'t',0}; - static WCHAR testW[] = {'t','e','s','t',0}; + static const UCHAR cert_empty[CERT_HASH_LENGTH] = {0}; + static const UCHAR cert_wine[CERT_HASH_LENGTH] = {'W','i','n','e',0}; + static const WCHAR tW[] = {'t',0}; + static const WCHAR teW[] = {'t','e',0}; + static const WCHAR tesW[] = {'t','e','s',0}; + static const WCHAR testW[] = {'t','e','s','t',0}; + void *p; CERT_CREDENTIAL_INFO *cert; + const UCHAR *hash; USERNAME_TARGET_CREDENTIAL_INFO *username; CRED_MARSHAL_TYPE type; - unsigned int i; + unsigned int i, j; DWORD error; BOOL ret; + const struct { + const char *cred; + CRED_MARSHAL_TYPE type; + const void *unmarshaled; + } tests[] = { + { "", 0, NULL }, + { "@", 0, NULL }, + { "@@", 0, NULL }, + { "@@@", 0, NULL }, + { "@@A", 0, NULL }, + { "@@E", 4, NULL }, + { "@@Z", 25, NULL }, + { "@@a", 26, NULL }, + { "@@0", 52, NULL }, + { "@@#", 62, NULL }, + { "@@-", 63, NULL }, + { "@@B", CertCredential, NULL }, + { "@@BA", CertCredential, NULL }, + { "@@BAAAAAAAAAAAAAAAAAAAAAAAAAA", CertCredential, NULL }, + { "@@BAAAAAAAAAAAAAAAAAAAAAAAAAAAA", CertCredential, NULL }, + { "@@BAAAAAAAAAAAAAAAAAAAAAAAAAAA", CertCredential, cert_empty }, + { "@@BXlmblBAAAAAAAAAAAAAAAAAAAAA", CertCredential, cert_wine }, + { "@@C", UsernameTargetCredential, NULL }, + { "@@CA", UsernameTargetCredential, NULL }, + { "@@CAAAAAA", UsernameTargetCredential, NULL }, + { "@@CAAAAAA0B", UsernameTargetCredential, NULL }, + { "@@CAAAAAA0BA", UsernameTargetCredential, NULL }, + { "@@CCAAAAA0BA", UsernameTargetCredential, tW }, + { "@@CEAAAAA0BA", UsernameTargetCredential, NULL }, + { "@@CEAAAAA0BAd", UsernameTargetCredential, NULL }, + { "@@CEAAAAA0BAdA", UsernameTargetCredential, NULL }, + { "@@CEAAAAA0BQZAA", UsernameTargetCredential, teW }, + { "@@CEAAAAA0BQZAQ", UsernameTargetCredential, teW }, + { "@@CEAAAAA0BQZAg", UsernameTargetCredential, teW }, + { "@@CEAAAAA0BQZAw", UsernameTargetCredential, teW }, + { "@@CEAAAAA0BQZAAA", UsernameTargetCredential, NULL }, + { "@@CGAAAAA0BQZAMH", UsernameTargetCredential, NULL }, + { "@@CGAAAAA0BQZAMHA", UsernameTargetCredential, tesW }, + { "@@CGAAAAA0BQZAMHAA", UsernameTargetCredential, NULL }, + { "@@CCAAAAA0BAA", UsernameTargetCredential, NULL }, + { "@@CBAAAAA0BAA", UsernameTargetCredential, NULL }, + { "@@CAgAAAA0BAA", UsernameTargetCredential, NULL }, + { "@@CIAAAAA0BQZAMHA0BA", UsernameTargetCredential, testW }, + { "@@CA-----0BQZAMHA0BA", UsernameTargetCredential, NULL }, + }; SetLastError( 0xdeadbeef ); ret = pCredUnmarshalCredentialA( NULL, NULL, NULL ); @@ -593,14 +644,6 @@ static void test_CredUnmarshalCredentialA(void) ok( !ret, "unexpected success\n" ); ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); - type = 0; - cert = NULL; - SetLastError( 0xdeadbeef ); - ret = pCredUnmarshalCredentialA( "", &type, (void **)&cert ); - error = GetLastError(); - ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); - if (0) { /* crash */ SetLastError( 0xdeadbeef ); ret = pCredUnmarshalCredentialA( "@@BAAAAAAAAAAAAAAAAAAAAAAAAAAA", &type, NULL ); @@ -615,69 +658,46 @@ static void test_CredUnmarshalCredentialA(void) ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); } - type = 0; - cert = NULL; - ret = pCredUnmarshalCredentialA( "@@BAAAAAAAAAAAAAAAAAAAAAAAAAAA", &type, (void **)&cert ); - ok( ret, "unexpected failure %u\n", GetLastError() ); - ok( type == CertCredential, "got %u\n", type ); - ok( cert != NULL, "cert is NULL\n" ); - ok( cert->cbSize == sizeof(*cert), "wrong size %u\n", cert->cbSize ); - for (i = 0; i < sizeof(cert->rgbHashOfCert); i++) ok( !cert->rgbHashOfCert[i], "wrong data\n" ); - pCredFree( cert ); + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) + { + SetLastError(0xdeadbeef); + type = 0; + p = NULL; + ret = pCredUnmarshalCredentialA(tests[i].cred, &type, &p); + error = GetLastError(); + if (tests[i].unmarshaled) + { + ok(ret, "[%u] unexpected failure %u\n", i, error); + ok(type == tests[i].type, "[%u] got %u\n", i, type); + ok(p != NULL, "[%u] returned pointer is NULL\n", i); + if (tests[i].type == CertCredential) + { + cert = p; + hash = tests[i].unmarshaled; + ok(cert->cbSize == sizeof(*cert), + "[%u] wrong size %u\n", i, cert->cbSize); + for (j = 0; j < sizeof(cert->rgbHashOfCert); j++) + ok(cert->rgbHashOfCert[j] == hash[j], "[%u] wrong data\n", i); + } + else if (tests[i].type == UsernameTargetCredential) + { + username = p; + ok(username->UserName != NULL, "[%u] UserName is NULL\n", i); + ok(!lstrcmpW(username->UserName, tests[i].unmarshaled), + "[%u] got %s\n", i, wine_dbgstr_w(username->UserName)); + } + } + else + { + ok(!ret, "[%u] unexpected success\n", i); + ok(error == ERROR_INVALID_PARAMETER, "[%u] got %u\n", i, error); + ok(type == tests[i].type, "[%u] got %u\n", i, type); + ok(p == NULL, "[%u] returned pointer is not NULL\n", i); + } - type = 0; - cert = NULL; - ret = pCredUnmarshalCredentialA( "@@BXlmblBAAAAAAAAAAAAAAAAAAAAA", &type, (void **)&cert ); - ok( ret, "unexpected failure %u\n", GetLastError() ); - ok( type == CertCredential, "got %u\n", type ); - ok( cert != NULL, "cert is NULL\n" ); - ok( cert->cbSize == sizeof(*cert), "wrong size %u\n", cert->cbSize ); - ok( cert->rgbHashOfCert[0] == 'W', "wrong data)\n" ); - ok( cert->rgbHashOfCert[1] == 'i', "wrong data\n" ); - ok( cert->rgbHashOfCert[2] == 'n', "wrong data\n" ); - ok( cert->rgbHashOfCert[3] == 'e', "wrong data\n" ); - for (i = 4; i < sizeof(cert->rgbHashOfCert); i++) ok( !cert->rgbHashOfCert[i], "wrong data\n" ); - pCredFree( cert ); - - SetLastError( 0xdeadbeef ); - ret = pCredUnmarshalCredentialA( "@@CAAAAAA", &type, (void **)&username ); - error = GetLastError(); - ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); - - SetLastError( 0xdeadbeef ); - ret = pCredUnmarshalCredentialA( "@@CAAAAAA0BA", &type, (void **)&username ); - error = GetLastError(); - ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); - - type = 0; - username = NULL; - ret = pCredUnmarshalCredentialA( "@@CCAAAAA0BA", &type, (void **)&username ); - ok( ret, "unexpected failure %u\n", GetLastError() ); - ok( type == UsernameTargetCredential, "got %u\n", type ); - ok( username != NULL, "username is NULL\n" ); - ok( username->UserName != NULL, "UserName is NULL\n" ); - ok( !lstrcmpW( username->UserName, tW ), "got %s\n", wine_dbgstr_w(username->UserName) ); - pCredFree( username ); - - type = 0; - username = NULL; - ret = pCredUnmarshalCredentialA( "@@CIAAAAA0BQZAMHA0BA", &type, (void **)&username ); - ok( ret, "unexpected failure %u\n", GetLastError() ); - ok( type == UsernameTargetCredential, "got %u\n", type ); - ok( username != NULL, "username is NULL\n" ); - ok( username->UserName != NULL, "UserName is NULL\n" ); - ok( !lstrcmpW( username->UserName, testW ), "got %s\n", wine_dbgstr_w(username->UserName) ); - pCredFree( username ); - - type = 0; - username = NULL; - SetLastError( 0xdeadbeef ); - ret = pCredUnmarshalCredentialA( "@@CA-----0BQZAMHA0BA", &type, (void **)&username ); - error = GetLastError(); - ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + if (ret) + pCredFree(p); + } } static void test_CredIsMarshaledCredentialA(void) @@ -744,18 +764,19 @@ static void test_CredIsMarshaledCredentialA(void) START_TEST(cred) { DWORD persists[CRED_TYPE_MAXIMUM]; + HMODULE mod = GetModuleHandleA("advapi32.dll"); - pCredEnumerateA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredEnumerateA"); - pCredFree = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredFree"); - pCredGetSessionTypes = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredGetSessionTypes"); - pCredWriteA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredWriteA"); - pCredDeleteA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredDeleteA"); - pCredReadA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredReadA"); - pCredRenameA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredRenameA"); - pCredReadDomainCredentialsA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredReadDomainCredentialsA"); - pCredMarshalCredentialA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredMarshalCredentialA"); - pCredUnmarshalCredentialA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredUnmarshalCredentialA"); - pCredIsMarshaledCredentialA = (void *)GetProcAddress(GetModuleHandle("advapi32.dll"), "CredIsMarshaledCredentialA"); + pCredEnumerateA = (void *)GetProcAddress(mod, "CredEnumerateA"); + pCredFree = (void *)GetProcAddress(mod, "CredFree"); + pCredGetSessionTypes = (void *)GetProcAddress(mod, "CredGetSessionTypes"); + pCredWriteA = (void *)GetProcAddress(mod, "CredWriteA"); + pCredDeleteA = (void *)GetProcAddress(mod, "CredDeleteA"); + pCredReadA = (void *)GetProcAddress(mod, "CredReadA"); + pCredRenameA = (void *)GetProcAddress(mod, "CredRenameA"); + pCredReadDomainCredentialsA = (void *)GetProcAddress(mod, "CredReadDomainCredentialsA"); + pCredMarshalCredentialA = (void *)GetProcAddress(mod, "CredMarshalCredentialA"); + pCredUnmarshalCredentialA = (void *)GetProcAddress(mod, "CredUnmarshalCredentialA"); + pCredIsMarshaledCredentialA = (void *)GetProcAddress(mod, "CredIsMarshaledCredentialA"); if (!pCredEnumerateA || !pCredFree || !pCredWriteA || !pCredDeleteA || !pCredReadA) { diff --git a/rostests/winetests/advapi32/crypt.c b/rostests/winetests/advapi32/crypt.c index 768dd3be344..ebae143f005 100644 --- a/rostests/winetests/advapi32/crypt.c +++ b/rostests/winetests/advapi32/crypt.c @@ -474,21 +474,21 @@ static BOOL FindProvRegVals(DWORD dwIndex, DWORD *pdwProvType, LPSTR *pszProvNam HKEY subkey; DWORD size = sizeof(DWORD); - if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider", &hKey)) + if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider", &hKey)) return FALSE; - RegQueryInfoKey(hKey, NULL, NULL, NULL, pdwProvCount, pcbProvName, + RegQueryInfoKeyA(hKey, NULL, NULL, NULL, pdwProvCount, pcbProvName, NULL, NULL, NULL, NULL, NULL, NULL); (*pcbProvName)++; if (!(*pszProvName = LocalAlloc(LMEM_ZEROINIT, *pcbProvName))) return FALSE; - RegEnumKeyEx(hKey, dwIndex, *pszProvName, pcbProvName, NULL, NULL, NULL, NULL); + RegEnumKeyExA(hKey, dwIndex, *pszProvName, pcbProvName, NULL, NULL, NULL, NULL); (*pcbProvName)++; - RegOpenKey(hKey, *pszProvName, &subkey); - RegQueryValueEx(subkey, "Type", NULL, NULL, (LPBYTE)pdwProvType, &size); + RegOpenKeyA(hKey, *pszProvName, &subkey); + RegQueryValueExA(subkey, "Type", NULL, NULL, (LPBYTE)pdwProvType, &size); RegCloseKey(subkey); RegCloseKey(hKey); @@ -599,10 +599,10 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz DWORD cbName; BOOL ret = FALSE; - if (RegOpenKey(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types", &hKey)) + if (RegOpenKeyA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Cryptography\\Defaults\\Provider Types", &hKey)) return FALSE; - if (RegQueryInfoKey(hKey, NULL, NULL, NULL, pdwTypeCount, &cbName, NULL, + if (RegQueryInfoKeyA(hKey, NULL, NULL, NULL, pdwTypeCount, &cbName, NULL, NULL, NULL, NULL, NULL, NULL)) goto cleanup; cbName++; @@ -610,7 +610,7 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz if (!(szName = LocalAlloc(LMEM_ZEROINIT, cbName))) goto cleanup; - while (!RegEnumKeyEx(hKey, *pdwIndex, szName, &cbName, NULL, NULL, NULL, NULL)) + while (!RegEnumKeyExA(hKey, *pdwIndex, szName, &cbName, NULL, NULL, NULL, NULL)) { cbName++; ch = szName + strlen(szName); @@ -619,15 +619,15 @@ static BOOL FindProvTypesRegVals(DWORD *pdwIndex, DWORD *pdwProvType, LPSTR *psz *pdwProvType += (*(--ch) - '0') * 10; *pdwProvType += (*(--ch) - '0') * 100; - if (RegOpenKey(hKey, szName, &hSubKey)) + if (RegOpenKeyA(hKey, szName, &hSubKey)) break; - if (!RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, NULL, pcbTypeName)) + if (!RegQueryValueExA(hSubKey, "TypeName", NULL, NULL, NULL, pcbTypeName)) { if (!(*pszTypeName = LocalAlloc(LMEM_ZEROINIT, *pcbTypeName))) break; - if (!RegQueryValueEx(hSubKey, "TypeName", NULL, NULL, (LPBYTE)*pszTypeName, pcbTypeName)) + if (!RegQueryValueExA(hSubKey, "TypeName", NULL, NULL, (LPBYTE)*pszTypeName, pcbTypeName)) { ret = TRUE; break; @@ -763,14 +763,14 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN } else return FALSE; - if (RegOpenKey((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE ,keyname, &hKey)) + if (RegOpenKeyA((dwFlags & CRYPT_USER_DEFAULT) ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE ,keyname, &hKey)) { LocalFree(keyname); return FALSE; } LocalFree(keyname); - if (RegQueryValueEx(hKey, "Name", NULL, NULL, (LPBYTE)*pszProvName, pcbProvName)) + if (RegQueryValueExA(hKey, "Name", NULL, NULL, (LPBYTE)*pszProvName, pcbProvName)) { if (GetLastError() != ERROR_MORE_DATA) SetLastError(NTE_PROV_TYPE_ENTRY_BAD); @@ -780,7 +780,7 @@ static BOOL FindDfltProvRegVals(DWORD dwProvType, DWORD dwFlags, LPSTR *pszProvN if (!(*pszProvName = LocalAlloc(LMEM_ZEROINIT, *pcbProvName))) return FALSE; - if (RegQueryValueEx(hKey, "Name", NULL, NULL, (LPBYTE)*pszProvName, pcbProvName)) + if (RegQueryValueExA(hKey, "Name", NULL, NULL, (LPBYTE)*pszProvName, pcbProvName)) { if (GetLastError() != ERROR_MORE_DATA) SetLastError(NTE_PROV_TYPE_ENTRY_BAD); @@ -899,13 +899,13 @@ static void test_set_provider_ex(void) ok(result, "%d\n", GetLastError()); /* check pdwReserved for NULL */ - result = pCryptSetProviderExA(MS_DEF_PROV, PROV_RSA_FULL, ¬Null, CRYPT_MACHINE_DEFAULT); + result = pCryptSetProviderExA(MS_DEF_PROV_A, PROV_RSA_FULL, ¬Null, CRYPT_MACHINE_DEFAULT); ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "expected %i, got %d\n", ERROR_INVALID_PARAMETER, GetLastError()); /* remove the default provider and then set it to MS_DEF_PROV/PROV_RSA_FULL */ SetLastError(0xdeadbeef); - result = pCryptSetProviderExA(MS_DEF_PROV, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT | CRYPT_DELETE_DEFAULT); + result = pCryptSetProviderExA(MS_DEF_PROV_A, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT | CRYPT_DELETE_DEFAULT); if (!result) { ok( GetLastError() == ERROR_ACCESS_DENIED || broken(GetLastError() == ERROR_INVALID_PARAMETER), @@ -915,7 +915,7 @@ static void test_set_provider_ex(void) return; } - result = pCryptSetProviderExA(MS_DEF_PROV, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT); + result = pCryptSetProviderExA(MS_DEF_PROV_A, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT); ok(result, "%d\n", GetLastError()); /* call CryptGetDefaultProvider to see if they match */ @@ -925,13 +925,13 @@ static void test_set_provider_ex(void) goto reset; result = pCryptGetDefaultProviderA(PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT, pszProvName, &cbProvName); - ok(result && !strcmp(MS_DEF_PROV, pszProvName), "expected %s, got %s\n", MS_DEF_PROV, pszProvName); - ok(result && cbProvName==(strlen(MS_DEF_PROV) + 1), "expected %i, got %d\n", (lstrlenA(MS_DEF_PROV) + 1), cbProvName); + ok(result && !strcmp(MS_DEF_PROV_A, pszProvName), "expected %s, got %s\n", MS_DEF_PROV_A, pszProvName); + ok(result && cbProvName==(strlen(MS_DEF_PROV_A) + 1), "expected %i, got %d\n", (lstrlenA(MS_DEF_PROV_A) + 1), cbProvName); LocalFree(pszProvName); reset: - /* Set the provider back to it's original */ + /* Set the provider back to its original */ result = pCryptSetProviderExA(curProvName, PROV_RSA_FULL, NULL, CRYPT_MACHINE_DEFAULT); ok(result, "%d\n", GetLastError()); LocalFree(curProvName); @@ -1026,7 +1026,7 @@ static void test_rc2_keylen(void) } SetLastError(0xdeadbeef); - ret = pCryptAcquireContextA(&provider, NULL, MS_DEF_PROV, + ret = pCryptAcquireContextA(&provider, NULL, MS_DEF_PROV_A, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); ok(ret, "CryptAcquireContext error %08x\n", GetLastError()); @@ -1140,6 +1140,38 @@ static void test_SystemFunction036(void) ok(ret == TRUE, "Expected SystemFunction036 to return TRUE, got %d\n", ret); } +static void test_container_sd(void) +{ + HCRYPTPROV prov; + SECURITY_DESCRIPTOR *sd; + DWORD len, err; + BOOL ret; + + ret = CryptAcquireContextA(&prov, "winetest", "Microsoft Enhanced Cryptographic Provider v1.0", + PROV_RSA_FULL, CRYPT_MACHINE_KEYSET|CRYPT_NEWKEYSET); + ok(ret, "got %u\n", GetLastError()); + + len = 0; + SetLastError(0xdeadbeef); + ret = CryptGetProvParam(prov, PP_KEYSET_SEC_DESCR, NULL, &len, OWNER_SECURITY_INFORMATION); + err = GetLastError(); + ok(ret, "got %u\n", err); + ok(err == ERROR_INSUFFICIENT_BUFFER || broken(err == ERROR_INVALID_PARAMETER), "got %u\n", err); + ok(len, "expected len > 0\n"); + + sd = HeapAlloc(GetProcessHeap(), 0, len); + ret = CryptGetProvParam(prov, PP_KEYSET_SEC_DESCR, (BYTE *)sd, &len, OWNER_SECURITY_INFORMATION); + ok(ret, "got %u\n", GetLastError()); + HeapFree(GetProcessHeap(), 0, sd); + + ret = CryptReleaseContext(prov, 0); + ok(ret, "got %u\n", GetLastError()); + + ret = CryptAcquireContextA(&prov, "winetest", "Microsoft Enhanced Cryptographic Provider v1.0", + PROV_RSA_FULL, CRYPT_MACHINE_KEYSET|CRYPT_DELETEKEYSET); + ok(ret, "got %u\n", GetLastError()); +} + START_TEST(crypt) { init_function_pointers(); @@ -1151,6 +1183,7 @@ START_TEST(crypt) test_incorrect_api_usage(); test_verify_sig(); test_machine_guid(); + test_container_sd(); clean_up_environment(); } diff --git a/rostests/winetests/advapi32/eventlog.c b/rostests/winetests/advapi32/eventlog.c index b0283544c5b..a3fe44b770d 100644 --- a/rostests/winetests/advapi32/eventlog.c +++ b/rostests/winetests/advapi32/eventlog.c @@ -49,17 +49,27 @@ static void init_function_pointers(void) pWow64RevertWow64FsRedirection = (void*)GetProcAddress(hkernel32, "Wow64RevertWow64FsRedirection"); } -static void create_backup(const char *filename) +static BOOL create_backup(const char *filename) { HANDLE handle; + DWORD rc, attribs; DeleteFileA(filename); handle = OpenEventLogA(NULL, "Application"); - BackupEventLogA(handle, filename); + rc = BackupEventLogA(handle, filename); + if (!rc && GetLastError() == ERROR_PRIVILEGE_NOT_HELD) + { + skip("insufficient privileges to backup the eventlog\n"); + CloseEventLog(handle); + return FALSE; + } + ok(rc, "BackupEventLogA failed, le=%u\n", GetLastError()); CloseEventLog(handle); + attribs = GetFileAttributesA(filename); todo_wine - ok(GetFileAttributesA(filename) != INVALID_FILE_ATTRIBUTES, "Expected a backup file\n"); + ok(attribs != INVALID_FILE_ATTRIBUTES, "Expected a backup file attribs=%#x le=%u\n", attribs, GetLastError()); + return TRUE; } static void test_open_close(void) @@ -209,23 +219,24 @@ static void test_count(void) CloseEventLog(handle); /* Make a backup eventlog to work with */ - create_backup(backup); - - handle = OpenBackupEventLogA(NULL, backup); - todo_wine - ok(handle != NULL, "Expected a handle\n"); - - /* Does GetNumberOfEventLogRecords work with backup eventlogs? */ - count = 0xdeadbeef; - ret = GetNumberOfEventLogRecords(handle, &count); - todo_wine + if (create_backup(backup)) { - ok(ret, "Expected success\n"); - ok(count != 0xdeadbeef, "Expected the number of records\n"); - } + handle = OpenBackupEventLogA(NULL, backup); + todo_wine + ok(handle != NULL, "Expected a handle, le=%d\n", GetLastError()); - CloseEventLog(handle); - DeleteFileA(backup); + /* Does GetNumberOfEventLogRecords work with backup eventlogs? */ + count = 0xdeadbeef; + ret = GetNumberOfEventLogRecords(handle, &count); + todo_wine + { + ok(ret, "Expected success\n"); + ok(count != 0xdeadbeef, "Expected the number of records\n"); + } + + CloseEventLog(handle); + DeleteFileA(backup); + } } static void test_oldest(void) @@ -262,23 +273,24 @@ static void test_oldest(void) CloseEventLog(handle); /* Make a backup eventlog to work with */ - create_backup(backup); - - handle = OpenBackupEventLogA(NULL, backup); - todo_wine - ok(handle != NULL, "Expected a handle\n"); - - /* Does GetOldestEventLogRecord work with backup eventlogs? */ - oldest = 0xdeadbeef; - ret = GetOldestEventLogRecord(handle, &oldest); - todo_wine + if (create_backup(backup)) { - ok(ret, "Expected success\n"); - ok(oldest != 0xdeadbeef, "Expected the number of the oldest record\n"); - } + handle = OpenBackupEventLogA(NULL, backup); + todo_wine + ok(handle != NULL, "Expected a handle\n"); - CloseEventLog(handle); - DeleteFileA(backup); + /* Does GetOldestEventLogRecord work with backup eventlogs? */ + oldest = 0xdeadbeef; + ret = GetOldestEventLogRecord(handle, &oldest); + todo_wine + { + ok(ret, "Expected success\n"); + ok(oldest != 0xdeadbeef, "Expected the number of the oldest record\n"); + } + + CloseEventLog(handle); + DeleteFileA(backup); + } } static void test_backup(void) @@ -306,6 +318,12 @@ static void test_backup(void) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); ret = BackupEventLogA(handle, backup); + if (!ret && GetLastError() == ERROR_PRIVILEGE_NOT_HELD) + { + skip("insufficient privileges for backup tests\n"); + CloseEventLog(handle); + return; + } ok(ret, "Expected success\n"); todo_wine ok(GetFileAttributesA(backup) != INVALID_FILE_ATTRIBUTES, "Expected a backup file\n"); @@ -516,39 +534,40 @@ static void test_openbackup(void) "Expected RPC_S_SERVER_UNAVAILABLE, got %d\n", GetLastError()); /* Make a backup eventlog to work with */ - create_backup(backup); - - /* FIXME: Wine stops here */ - if (GetFileAttributesA(backup) == INVALID_FILE_ATTRIBUTES) + if (create_backup(backup)) { - skip("We don't have a backup eventlog to work with\n"); - return; + /* FIXME: Wine stops here */ + if (GetFileAttributesA(backup) == INVALID_FILE_ATTRIBUTES) + { + skip("We don't have a backup eventlog to work with\n"); + return; + } + + SetLastError(0xdeadbeef); + handle = OpenBackupEventLogA("IDontExist", backup); + ok(handle == NULL, "Didn't expect a handle\n"); + ok(GetLastError() == RPC_S_SERVER_UNAVAILABLE || + GetLastError() == RPC_S_INVALID_NET_ADDR, /* Some Vista and Win7 */ + "Expected RPC_S_SERVER_UNAVAILABLE, got %d\n", GetLastError()); + + /* Empty servername should be read as local server */ + handle = OpenBackupEventLogA("", backup); + ok(handle != NULL, "Expected a handle\n"); + CloseEventLog(handle); + + handle = OpenBackupEventLogA(NULL, backup); + ok(handle != NULL, "Expected a handle\n"); + + /* Can we open that same backup eventlog more than once? */ + handle2 = OpenBackupEventLogA(NULL, backup); + ok(handle2 != NULL, "Expected a handle\n"); + ok(handle2 != handle, "Didn't expect the same handle\n"); + CloseEventLog(handle2); + + CloseEventLog(handle); + DeleteFileA(backup); } - SetLastError(0xdeadbeef); - handle = OpenBackupEventLogA("IDontExist", backup); - ok(handle == NULL, "Didn't expect a handle\n"); - ok(GetLastError() == RPC_S_SERVER_UNAVAILABLE || - GetLastError() == RPC_S_INVALID_NET_ADDR, /* Some Vista and Win7 */ - "Expected RPC_S_SERVER_UNAVAILABLE, got %d\n", GetLastError()); - - /* Empty servername should be read as local server */ - handle = OpenBackupEventLogA("", backup); - ok(handle != NULL, "Expected a handle\n"); - CloseEventLog(handle); - - handle = OpenBackupEventLogA(NULL, backup); - ok(handle != NULL, "Expected a handle\n"); - - /* Can we open that same backup eventlog more than once? */ - handle2 = OpenBackupEventLogA(NULL, backup); - ok(handle2 != NULL, "Expected a handle\n"); - ok(handle2 != handle, "Didn't expect the same handle\n"); - CloseEventLog(handle2); - - CloseEventLog(handle); - DeleteFileA(backup); - /* Is there any content checking done? */ file = CreateFileA(backup, GENERIC_WRITE, 0, NULL, CREATE_NEW, 0, NULL); CloseHandle(file); @@ -585,7 +604,8 @@ static void test_clear(void) ok(GetLastError() == ERROR_INVALID_HANDLE, "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); /* Make a backup eventlog to work with */ - create_backup(backup); + if (!create_backup(backup)) + return; SetLastError(0xdeadbeef); ret = ClearEventLogA(NULL, backup); @@ -761,11 +781,11 @@ static void test_readwrite(void) } SetLastError(0xdeadbeef); - ret = ReportEvent(handle, 0x20, 0, 0, NULL, 0, 0, NULL, NULL); + ret = ReportEventA(handle, 0x20, 0, 0, NULL, 0, 0, NULL, NULL); if (!ret && GetLastError() == ERROR_CRC) { win_skip("Win7 fails when using incorrect event types\n"); - ret = ReportEvent(handle, 0, 0, 0, NULL, 0, 0, NULL, NULL); + ret = ReportEventA(handle, 0, 0, 0, NULL, 0, 0, NULL, NULL); ok(ret, "Expected success : %d\n", GetLastError()); } else @@ -822,9 +842,9 @@ static void test_readwrite(void) ok(handle != NULL, "Expected a handle\n"); SetLastError(0xdeadbeef); - ret = ReportEvent(handle, read_write[i].evt_type, read_write[i].evt_cat, - read_write[i].evt_id, run_sidtests ? user : NULL, - read_write[i].evt_numstrings, 0, read_write[i].evt_strings, NULL); + ret = ReportEventA(handle, read_write[i].evt_type, read_write[i].evt_cat, + read_write[i].evt_id, run_sidtests ? user : NULL, + read_write[i].evt_numstrings, 0, read_write[i].evt_strings, NULL); ok(ret, "Expected ReportEvent success : %d\n", GetLastError()); count = 0xdeadbeef; diff --git a/rostests/winetests/advapi32/lsa.c b/rostests/winetests/advapi32/lsa.c index 420b89c14f2..a70b11bb4bd 100644 --- a/rostests/winetests/advapi32/lsa.c +++ b/rostests/winetests/advapi32/lsa.c @@ -49,7 +49,7 @@ static NTSTATUS (WINAPI *pLsaLookupSids)(LSA_HANDLE,ULONG,PSID*,LSA_REFERENCED_D static BOOL init(void) { - hadvapi32 = GetModuleHandle("advapi32.dll"); + hadvapi32 = GetModuleHandleA("advapi32.dll"); pLsaClose = (void*)GetProcAddress(hadvapi32, "LsaClose"); pLsaEnumerateAccountRights = (void*)GetProcAddress(hadvapi32, "LsaEnumerateAccountRights"); @@ -378,7 +378,7 @@ static void test_LsaLookupSids(void) ok(ret, "got %d\n", ret); ret = GetTokenInformation(token, TokenUser, NULL, 0, &size); - ok(!ret, "gotr %d\n", ret); + ok(!ret, "got %d\n", ret); user = HeapAlloc(GetProcessHeap(), 0, size); ret = GetTokenInformation(token, TokenUser, user, size, &size); diff --git a/rostests/winetests/advapi32/registry.c b/rostests/winetests/advapi32/registry.c index 6ec84ee1037..56599300af7 100644 --- a/rostests/winetests/advapi32/registry.c +++ b/rostests/winetests/advapi32/registry.c @@ -1087,8 +1087,8 @@ static void test_reg_create_key(void) ok(!ret, "RegCreateKeyExA failed with error %d\n", ret); /* clean up */ - RegDeleteKey(hkey2, ""); - RegDeleteKey(hkey1, ""); + RegDeleteKeyA(hkey2, ""); + RegDeleteKeyA(hkey1, ""); RegCloseKey(hkey2); RegCloseKey(hkey1); @@ -1106,8 +1106,8 @@ static void test_reg_create_key(void) ok(!ret, "RegCreateKeyExA failed with error %d\n", ret); /* clean up */ - RegDeleteKey(hkey2, ""); - RegDeleteKey(hkey1, ""); + RegDeleteKeyA(hkey2, ""); + RegDeleteKeyA(hkey1, ""); RegCloseKey(hkey2); RegCloseKey(hkey1); @@ -1117,7 +1117,7 @@ static void test_reg_create_key(void) ok(ret == ERROR_BAD_PATHNAME, "expected ERROR_BAD_PATHNAME, got %d\n", ret); else { ok(!ret, "RegCreateKeyExA failed with error %d\n", ret); - RegDeleteKey(hkey1, NULL); + RegDeleteKeyA(hkey1, NULL); RegCloseKey(hkey1); } @@ -1251,7 +1251,7 @@ static void test_reg_delete_key(void) { DWORD ret; - ret = RegDeleteKey(hkey_main, NULL); + ret = RegDeleteKeyA(hkey_main, NULL); /* There is a bug in NT4 and W2K that doesn't check if the subkey is NULL. If * there are also no subkeys available it will delete the key pointed to by hkey_main. @@ -1274,7 +1274,7 @@ static void test_reg_save_key(void) { DWORD ret; - ret = RegSaveKey(hkey_main, "saved_key", NULL); + ret = RegSaveKeyA(hkey_main, "saved_key", NULL); ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); } @@ -1283,10 +1283,10 @@ static void test_reg_load_key(void) DWORD ret; HKEY hkHandle; - ret = RegLoadKey(HKEY_LOCAL_MACHINE, "Test", "saved_key"); + ret = RegLoadKeyA(HKEY_LOCAL_MACHINE, "Test", "saved_key"); ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); - ret = RegOpenKey(HKEY_LOCAL_MACHINE, "Test", &hkHandle); + ret = RegOpenKeyA(HKEY_LOCAL_MACHINE, "Test", &hkHandle); ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); RegCloseKey(hkHandle); @@ -1296,11 +1296,11 @@ static void test_reg_unload_key(void) { DWORD ret; - ret = RegUnLoadKey(HKEY_LOCAL_MACHINE, "Test"); + ret = RegUnLoadKeyA(HKEY_LOCAL_MACHINE, "Test"); ok(ret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", ret); - DeleteFile("saved_key"); - DeleteFile("saved_key.LOG"); + DeleteFileA("saved_key"); + DeleteFileA("saved_key.LOG"); } static BOOL set_privileges(LPCSTR privilege, BOOL set) @@ -1312,7 +1312,7 @@ static BOOL set_privileges(LPCSTR privilege, BOOL set) if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken)) return FALSE; - if(!LookupPrivilegeValue(NULL, privilege, &luid)) + if(!LookupPrivilegeValueA(NULL, privilege, &luid)) { CloseHandle(hToken); return FALSE; @@ -1668,7 +1668,7 @@ static void test_rw_order(void) { HKEY hKey; DWORD dw = 0; - static char keyname[] = "test_rw_order"; + static const char keyname[] = "test_rw_order"; char value_buf[2]; DWORD values, value_len, value_name_max_len; LSTATUS ret; @@ -1707,7 +1707,7 @@ static void test_rw_order(void) ok(!RegEnumValueA(hKey, 3, value_buf, &value_len, NULL, NULL, NULL, NULL), "RegEnumValueA failed\n"); todo_wine ok(strcmp(value_buf, "B") == 0, "Expected name \"B\", got %s\n", value_buf); - ok(!RegDeleteKey(HKEY_CURRENT_USER, keyname), "Failed to delete key\n"); + ok(!RegDeleteKeyA(HKEY_CURRENT_USER, keyname), "Failed to delete key\n"); } static void test_symlinks(void) @@ -1825,10 +1825,10 @@ static void test_symlinks(void) KEY_ALL_ACCESS, NULL, &key, NULL ); ok( err == ERROR_ALREADY_EXISTS, "RegCreateKeyEx wrong error %u\n", err ); - err = RegDeleteKey( hkey_main, "target" ); + err = RegDeleteKeyA( hkey_main, "target" ); ok( err == ERROR_SUCCESS, "RegDeleteKey failed error %u\n", err ); - err = RegDeleteKey( hkey_main, "link" ); + err = RegDeleteKeyA( hkey_main, "link" ); ok( err == ERROR_FILE_NOT_FOUND, "RegDeleteKey wrong error %u\n", err ); status = pNtDeleteKey( link ); @@ -1867,8 +1867,9 @@ static void _check_key_value( int line, HANDLE root, const char *name, DWORD fla static void test_redirection(void) { DWORD err, type, dw, len; - HKEY key, root32, root64, key32, key64; + HKEY key, root32, root64, key32, key64, native, op_key; BOOL is_vista = FALSE; + REGSAM opposite = (sizeof(void*) == 8 ? KEY_WOW64_32KEY : KEY_WOW64_64KEY); if (ptr_size != 64) { @@ -2102,6 +2103,39 @@ static void test_redirection(void) RegCloseKey( key64 ); RegCloseKey( root32 ); RegCloseKey( root64 ); + + /* open key in native bit mode */ + err = RegOpenKeyExA(HKEY_CLASSES_ROOT, "Interface", 0, KEY_ALL_ACCESS, &native); + ok(err == ERROR_SUCCESS, "got %i\n", err); + + pRegDeleteKeyExA(native, "AWineTest", 0, 0); + + /* write subkey in opposite bit mode */ + err = RegOpenKeyExA(HKEY_CLASSES_ROOT, "Interface", 0, KEY_ALL_ACCESS | opposite, &op_key); + ok(err == ERROR_SUCCESS, "got %i\n", err); + + err = RegCreateKeyExA(op_key, "AWineTest", 0, NULL, 0, KEY_ALL_ACCESS | opposite, + NULL, &key, NULL); + ok(err == ERROR_SUCCESS || err == ERROR_ACCESS_DENIED, "got %i\n", err); + if(err != ERROR_SUCCESS){ + win_skip("Can't write to registry\n"); + RegCloseKey(op_key); + RegCloseKey(native); + return; + } + RegCloseKey(key); + + /* verify subkey is not present in native mode */ + err = RegOpenKeyExA(native, "AWineTest", 0, KEY_ALL_ACCESS, &key); + ok(err == ERROR_FILE_NOT_FOUND || + broken(err == ERROR_SUCCESS), /* before Win7, HKCR is reflected instead of redirected */ + "got %i\n", err); + + err = pRegDeleteKeyExA(op_key, "AWineTest", opposite, 0); + ok(err == ERROR_SUCCESS, "got %i\n", err); + + RegCloseKey(op_key); + RegCloseKey(native); } static void test_classesroot(void) @@ -2133,7 +2167,6 @@ static void test_classesroot(void) todo_wine ok(res == ERROR_SUCCESS || broken(res == ERROR_FILE_NOT_FOUND /* WinNT */), "test key not found in hkcr: %d\n", res); - todo_wine ok(IS_HKCR(hkcr), "hkcr mask not set in %p\n", hkcr); if (res) { skip("HKCR key merging not supported\n"); @@ -2142,6 +2175,8 @@ static void test_classesroot(void) return; } + todo_wine ok(IS_HKCR(hkcr), "hkcr mask not set in %p\n", hkcr); + /* set a value in user's classes */ res = RegSetValueExA(hkey, "val1", 0, REG_SZ, (const BYTE *)"user", sizeof("user")); ok(res == ERROR_SUCCESS, "RegSetValueExA failed: %d, GLE=%x\n", res, GetLastError()); @@ -2364,7 +2399,7 @@ static void test_classesroot(void) RegCloseKey( hklmsub1 ); /* delete subkey1 from hkcr (should point at user's classes) */ - res = RegDeleteKey(hkcr, "subkey1"); + res = RegDeleteKeyA(hkcr, "subkey1"); ok(res == ERROR_SUCCESS, "RegDeleteKey failed: %d\n", res); /* confirm key was removed in hkey but not hklm */ @@ -2375,7 +2410,7 @@ static void test_classesroot(void) ok(!IS_HKCR(hklmsub1), "hkcr mask set in %p\n", hklmsub1); /* delete subkey1 from hkcr again (which should now point at hklm) */ - res = RegDeleteKey(hkcr, "subkey1"); + res = RegDeleteKeyA(hkcr, "subkey1"); ok(res == ERROR_SUCCESS, "RegDeleteKey failed: %d\n", res); /* confirm hkey was removed in hklm */ @@ -2586,7 +2621,8 @@ static void test_classesroot_mask(void) res = RegOpenKeyA( HKEY_CLASSES_ROOT, "CLSID", &hkey ); ok(res == ERROR_SUCCESS, "RegOpenKeyA failed: %d\n", res); - todo_wine ok(IS_HKCR(hkey), "hkcr mask not set in %p\n", hkey); + todo_wine ok(IS_HKCR(hkey) || broken(!IS_HKCR(hkey)) /* WinNT */, + "hkcr mask not set in %p\n", hkey); RegCloseKey( hkey ); res = RegOpenKeyA( HKEY_CURRENT_USER, "Software", &hkey ); diff --git a/rostests/winetests/advapi32/security.c b/rostests/winetests/advapi32/security.c index c1945e11428..4485746789f 100644 --- a/rostests/winetests/advapi32/security.c +++ b/rostests/winetests/advapi32/security.c @@ -38,13 +38,30 @@ #include "wine/test.h" +#ifndef PROCESS_QUERY_LIMITED_INFORMATION +#define PROCESS_QUERY_LIMITED_INFORMATION 0x1000 +#endif + /* PROCESS_ALL_ACCESS in Vista+ PSDKs is incompatible with older Windows versions */ #define PROCESS_ALL_ACCESS_NT4 (PROCESS_ALL_ACCESS & ~0xf000) +#define PROCESS_ALL_ACCESS_VISTA (PROCESS_ALL_ACCESS | 0xf000) #ifndef EVENT_QUERY_STATE #define EVENT_QUERY_STATE 0x0001 #endif +#ifndef SEMAPHORE_QUERY_STATE +#define SEMAPHORE_QUERY_STATE 0x0001 +#endif + +#ifndef THREAD_SET_LIMITED_INFORMATION +#define THREAD_SET_LIMITED_INFORMATION 0x0400 +#define THREAD_QUERY_LIMITED_INFORMATION 0x0800 +#endif + +#define THREAD_ALL_ACCESS_NT4 (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3ff) +#define THREAD_ALL_ACCESS_VISTA (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0xffff) + /* copied from Wine winternl.h - not included in the Windows SDK */ typedef enum _OBJECT_INFORMATION_CLASS { ObjectBasicInformation, @@ -104,7 +121,7 @@ static BOOL (WINAPI *pSetFileSecurityA)(LPCSTR, SECURITY_INFORMATION, static DWORD (WINAPI *pGetNamedSecurityInfoA)(LPSTR, SE_OBJECT_TYPE, SECURITY_INFORMATION, PSID*, PSID*, PACL*, PACL*, PSECURITY_DESCRIPTOR*); -static DWORD (WINAPI *pSetNamedSecurityInfoA)(LPTSTR, SE_OBJECT_TYPE, SECURITY_INFORMATION, +static DWORD (WINAPI *pSetNamedSecurityInfoA)(LPSTR, SE_OBJECT_TYPE, SECURITY_INFORMATION, PSID, PSID, PACL, PACL); static PDWORD (WINAPI *pGetSidSubAuthority)(PSID, DWORD); static PUCHAR (WINAPI *pGetSidSubAuthorityCount)(PSID); @@ -160,7 +177,7 @@ static void init(void) pNtQueryObject = (void *)GetProcAddress( hntdll, "NtQueryObject" ); pNtAccessCheck = (void *)GetProcAddress( hntdll, "NtAccessCheck" ); - hmod = GetModuleHandle("advapi32.dll"); + hmod = GetModuleHandleA("advapi32.dll"); pAddAccessAllowedAceEx = (void *)GetProcAddress(hmod, "AddAccessAllowedAceEx"); pAddAccessDeniedAceEx = (void *)GetProcAddress(hmod, "AddAccessDeniedAceEx"); pAddAuditAccessAceEx = (void *)GetProcAddress(hmod, "AddAuditAccessAceEx"); @@ -345,9 +362,9 @@ static void test_trustee(void) GUID ObjectType = {0x12345678, 0x1234, 0x5678, {0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88}}; GUID InheritedObjectType = {0x23456789, 0x2345, 0x6786, {0x2, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99}}; GUID ZeroGuid; - OBJECTS_AND_NAME_ oan; + OBJECTS_AND_NAME_A oan; OBJECTS_AND_SID oas; - TRUSTEE trustee; + TRUSTEEA trustee; PSID psid; char szObjectTypeName[] = "ObjectTypeName"; char szInheritedObjectTypeName[] = "InheritedObjectTypeName"; @@ -443,7 +460,7 @@ static void test_trustee(void) ok(trustee.MultipleTrusteeOperation == NO_MULTIPLE_TRUSTEE, "MultipleTrusteeOperation wrong\n"); ok(trustee.TrusteeForm == TRUSTEE_IS_OBJECTS_AND_NAME, "TrusteeForm wrong\n"); ok(trustee.TrusteeType == TRUSTEE_IS_UNKNOWN, "TrusteeType wrong\n"); - ok(trustee.ptstrName == (LPTSTR)&oan, "ptstrName wrong\n"); + ok(trustee.ptstrName == (LPSTR)&oan, "ptstrName wrong\n"); ok(oan.ObjectsPresent == (ACE_OBJECT_TYPE_PRESENT | ACE_INHERITED_OBJECT_TYPE_PRESENT), "ObjectsPresent wrong\n"); ok(oan.ObjectType == SE_KERNEL_OBJECT, "ObjectType wrong\n"); @@ -480,7 +497,7 @@ static void test_trustee(void) ok(trustee.MultipleTrusteeOperation == NO_MULTIPLE_TRUSTEE, "MultipleTrusteeOperation wrong\n"); ok(trustee.TrusteeForm == TRUSTEE_IS_OBJECTS_AND_NAME, "TrusteeForm wrong\n"); ok(trustee.TrusteeType == TRUSTEE_IS_UNKNOWN, "TrusteeType wrong\n"); - ok(trustee.ptstrName == (LPTSTR)&oan, "ptstrName wrong\n"); + ok(trustee.ptstrName == (LPSTR)&oan, "ptstrName wrong\n"); ok(oan.ObjectsPresent == ACE_OBJECT_TYPE_PRESENT, "ObjectsPresent wrong\n"); ok(oan.ObjectType == SE_KERNEL_OBJECT, "ObjectType wrong\n"); @@ -833,20 +850,20 @@ cleanup: /* Test file access permissions for a file with FILE_ATTRIBUTE_ARCHIVE */ SetLastError(0xdeadbeef); - rc = GetTempPath(sizeof(wintmpdir), wintmpdir); + rc = GetTempPathA(sizeof(wintmpdir), wintmpdir); ok(rc, "GetTempPath error %d\n", GetLastError()); SetLastError(0xdeadbeef); - rc = GetTempFileName(wintmpdir, "tmp", 0, file); + rc = GetTempFileNameA(wintmpdir, "tmp", 0, file); ok(rc, "GetTempFileName error %d\n", GetLastError()); - rc = GetFileAttributes(file); - rc &= ~FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; + rc = GetFileAttributesA(file); + rc &= ~(FILE_ATTRIBUTE_NOT_CONTENT_INDEXED|FILE_ATTRIBUTE_COMPRESSED); ok(rc == FILE_ATTRIBUTE_ARCHIVE, "expected FILE_ATTRIBUTE_ARCHIVE got %#x\n", rc); retSize = 0xdeadbeef; - rc = GetFileSecurity(file, OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, - NULL, 0, &sdSize); + rc = GetFileSecurityA(file, OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, + NULL, 0, &sdSize); ok(!rc, "GetFileSecurity should fail\n"); ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER got %d\n", GetLastError()); @@ -855,8 +872,8 @@ cleanup: sd = HeapAlloc(GetProcessHeap (), 0, sdSize); retSize = 0xdeadbeef; SetLastError(0xdeadbeef); - rc = GetFileSecurity(file, OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, - sd, sdSize, &retSize); + rc = GetFileSecurityA(file, OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, + sd, sdSize, &retSize); ok(rc, "GetFileSecurity error %d\n", GetLastError()); ok(retSize == sdSize || broken(retSize == 0) /* NT4 */, "expected %d, got %d\n", sdSize, retSize); @@ -941,7 +958,7 @@ cleanup: /* Test file access permissions for a file with FILE_ATTRIBUTE_READONLY */ SetLastError(0xdeadbeef); - fh = CreateFile(file, FILE_READ_DATA, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0); + fh = CreateFileA(file, FILE_READ_DATA, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0); ok(fh != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); retSize = 0xdeadbeef; SetLastError(0xdeadbeef); @@ -951,21 +968,21 @@ cleanup: ok(retSize == 0, "expected 0, got %d\n", retSize); CloseHandle(fh); - rc = GetFileAttributes(file); - rc &= ~FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; + rc = GetFileAttributesA(file); + rc &= ~(FILE_ATTRIBUTE_NOT_CONTENT_INDEXED|FILE_ATTRIBUTE_COMPRESSED); todo_wine ok(rc == (FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY), "expected FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY got %#x\n", rc); SetLastError(0xdeadbeef); - rc = SetFileAttributes(file, FILE_ATTRIBUTE_ARCHIVE); + rc = SetFileAttributesA(file, FILE_ATTRIBUTE_ARCHIVE); ok(rc, "SetFileAttributes error %d\n", GetLastError()); SetLastError(0xdeadbeef); - rc = DeleteFile(file); + rc = DeleteFileA(file); ok(rc, "DeleteFile error %d\n", GetLastError()); SetLastError(0xdeadbeef); - fh = CreateFile(file, FILE_READ_DATA, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0); + fh = CreateFileA(file, FILE_READ_DATA, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0); ok(fh != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); retSize = 0xdeadbeef; SetLastError(0xdeadbeef); @@ -975,15 +992,15 @@ todo_wine ok(retSize == 0, "expected 0, got %d\n", retSize); CloseHandle(fh); - rc = GetFileAttributes(file); - rc &= ~FILE_ATTRIBUTE_NOT_CONTENT_INDEXED; + rc = GetFileAttributesA(file); + rc &= ~(FILE_ATTRIBUTE_NOT_CONTENT_INDEXED|FILE_ATTRIBUTE_COMPRESSED); ok(rc == (FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY), "expected FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_READONLY got %#x\n", rc); retSize = 0xdeadbeef; SetLastError(0xdeadbeef); - rc = GetFileSecurity(file, OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, - sd, sdSize, &retSize); + rc = GetFileSecurityA(file, OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, + sd, sdSize, &retSize); ok(rc, "GetFileSecurity error %d\n", GetLastError()); ok(retSize == sdSize || broken(retSize == 0) /* NT4 */, "expected %d, got %d\n", sdSize, retSize); @@ -1050,14 +1067,14 @@ todo_wine { ok(granted == FILE_ALL_ACCESS, "expected FILE_ALL_ACCESS, got %#x\n", granted); } SetLastError(0xdeadbeef); - rc = DeleteFile(file); + rc = DeleteFileA(file); ok(!rc, "DeleteFile should fail\n"); ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); SetLastError(0xdeadbeef); - rc = SetFileAttributes(file, FILE_ATTRIBUTE_ARCHIVE); + rc = SetFileAttributesA(file, FILE_ATTRIBUTE_ARCHIVE); ok(rc, "SetFileAttributes error %d\n", GetLastError()); SetLastError(0xdeadbeef); - rc = DeleteFile(file); + rc = DeleteFileA(file); ok(rc, "DeleteFile error %d\n", GetLastError()); CloseHandle(token); @@ -1085,7 +1102,7 @@ static void test_AccessCheck(void) DWORD err; NTSTATUS ntret, ntAccessStatus; - NtDllModule = GetModuleHandle("ntdll.dll"); + NtDllModule = GetModuleHandleA("ntdll.dll"); if (!NtDllModule) { skip("not running on NT, skipping test\n"); @@ -1493,13 +1510,13 @@ static void test_token_attr(void) for (i = 0; i < Groups->GroupCount; i++) { DWORD NameLength = 255; - TCHAR Name[255]; + CHAR Name[255]; DWORD DomainLength = 255; - TCHAR Domain[255]; + CHAR Domain[255]; SID_NAME_USE SidNameUse; Name[0] = '\0'; Domain[0] = '\0'; - ret = LookupAccountSid(NULL, Groups->Groups[i].Sid, Name, &NameLength, Domain, &DomainLength, &SidNameUse); + ret = LookupAccountSidA(NULL, Groups->Groups[i].Sid, Name, &NameLength, Domain, &DomainLength, &SidNameUse); if (ret) { pConvertSidToStringSidA(Groups->Groups[i].Sid, &SidString); @@ -1535,9 +1552,9 @@ static void test_token_attr(void) trace("TokenPrivileges:\n"); for (i = 0; i < Privileges->PrivilegeCount; i++) { - TCHAR Name[256]; + CHAR Name[256]; DWORD NameLen = sizeof(Name)/sizeof(Name[0]); - LookupPrivilegeName(NULL, &Privileges->Privileges[i].Luid, Name, &NameLen); + LookupPrivilegeNameA(NULL, &Privileges->Privileges[i].Luid, Name, &NameLen); trace("\t%s, 0x%x\n", Name, Privileges->Privileges[i].Attributes); } HeapFree(GetProcessHeap(), 0, Privileges); @@ -1618,7 +1635,7 @@ static void test_sid_str(PSID * sid) SID_NAME_USE use; DWORD acc_size = MAX_PATH; DWORD dom_size = MAX_PATH; - ret = LookupAccountSid(NULL, sid, account, &acc_size, domain, &dom_size, &use); + ret = LookupAccountSidA (NULL, sid, account, &acc_size, domain, &dom_size, &use); ok(ret || (!ret && (GetLastError() == ERROR_NONE_MAPPED)), "LookupAccountSid(%s) failed: %d\n", str_sid, GetLastError()); if (ret) @@ -2120,8 +2137,8 @@ static void check_wellknown_name(const char* name, WELL_KNOWN_SID_TYPE result) ok(EqualSid(psid,wk_sid),"(%s) Sids fail to match well known sid!\n",name); - ok(!lstrcmp(account, wk_account), "Expected %s , got %s\n", account, wk_account); - ok(!lstrcmp(domain, wk_domain), "Expected %s, got %s\n", wk_domain, domain); + ok(!lstrcmpA(account, wk_account), "Expected %s , got %s\n", account, wk_account); + ok(!lstrcmpA(domain, wk_domain), "Expected %s, got %s\n", wk_domain, domain); ok(sid_use == SidTypeWellKnownGroup , "Expected Use (5), got %d\n", sid_use); cleanup: @@ -2182,10 +2199,10 @@ static void test_LookupAccountName(void) get_sid_info(psid, &account, &sid_dom); ok(ret, "Failed to lookup account name\n"); ok(sid_size == GetLengthSid(psid), "Expected %d, got %d\n", GetLengthSid(psid), sid_size); - ok(!lstrcmp(account, user_name), "Expected %s, got %s\n", user_name, account); - ok(!lstrcmp(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); + ok(!lstrcmpA(account, user_name), "Expected %s, got %s\n", user_name, account); + ok(!lstrcmpA(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); ok(domain_size == domain_save - 1, "Expected %d, got %d\n", domain_save - 1, domain_size); - ok(strlen(domain) == domain_size, "Expected %d, got %d\n", lstrlen(domain), domain_size); + ok(strlen(domain) == domain_size, "Expected %d, got %d\n", lstrlenA(domain), domain_size); ok(sid_use == SidTypeUser, "Expected SidTypeUser (%d), got %d\n", SidTypeUser, sid_use); domain_size = domain_save; sid_size = sid_save; @@ -2200,10 +2217,10 @@ static void test_LookupAccountName(void) get_sid_info(psid, &account, &sid_dom); ok(ret, "Failed to lookup account name\n"); ok(sid_size != 0, "sid_size was zero\n"); - ok(!lstrcmp(account, "Everyone"), "Expected Everyone, got %s\n", account); - ok(!lstrcmp(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); + ok(!lstrcmpA(account, "Everyone"), "Expected Everyone, got %s\n", account); + ok(!lstrcmpA(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); ok(domain_size == 0, "Expected 0, got %d\n", domain_size); - ok(strlen(domain) == domain_size, "Expected %d, got %d\n", lstrlen(domain), domain_size); + ok(strlen(domain) == domain_size, "Expected %d, got %d\n", lstrlenA(domain), domain_size); ok(sid_use == SidTypeWellKnownGroup, "Expected SidTypeWellKnownGroup (%d), got %d\n", SidTypeWellKnownGroup, sid_use); domain_size = domain_save; } @@ -2266,7 +2283,7 @@ static void test_LookupAccountName(void) get_sid_info(psid, &account, &sid_dom); ok(ret, "Failed to lookup account name\n"); /* Using a fixed string will not work on different locales */ - ok(!lstrcmp(account, domain), + ok(!lstrcmpA(account, domain), "Got %s for account and %s for domain, these should be the same\n", account, domain); ok(sid_use == SidTypeDomain, "Expected SidTypeDomain (%d), got %d\n", SidTypeDomain, sid_use); @@ -2522,7 +2539,7 @@ static void test_process_security(void) res = InitializeSecurityDescriptor(SecurityDescriptor, SECURITY_DESCRIPTOR_REVISION); ok(res, "InitializeSecurityDescriptor failed with error %d\n", GetLastError()); - event = CreateEvent( NULL, TRUE, TRUE, "test_event" ); + event = CreateEventA( NULL, TRUE, TRUE, "test_event" ); ok(event != NULL, "CreateEvent %d\n", GetLastError()); SecurityDescriptor->Revision = 0; @@ -2664,9 +2681,9 @@ static void test_impersonation_level(void) ok(error == ERROR_CANT_OPEN_ANONYMOUS, "OpenThreadToken on anonymous token should have returned ERROR_CANT_OPEN_ANONYMOUS instead of %d\n", error); /* can't perform access check when opening object against an anonymous impersonation token */ todo_wine { - error = RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey); - ok(error == ERROR_INVALID_HANDLE || error == ERROR_CANT_OPEN_ANONYMOUS, - "RegOpenKeyEx should have failed with ERROR_INVALID_HANDLE or ERROR_CANT_OPEN_ANONYMOUS instead of %d\n", error); + error = RegOpenKeyExA(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey); + ok(error == ERROR_INVALID_HANDLE || error == ERROR_CANT_OPEN_ANONYMOUS || error == ERROR_BAD_IMPERSONATION_LEVEL, + "RegOpenKeyEx failed with %d\n", error); } RevertToSelf(); @@ -2717,7 +2734,7 @@ static void test_impersonation_level(void) ok(ret, "OpenThreadToken failed with error %d\n", GetLastError()); /* can't perform access check when opening object against an identification impersonation token */ - error = RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey); + error = RegOpenKeyExA(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey); todo_wine { ok(error == ERROR_INVALID_HANDLE || error == ERROR_BAD_IMPERSONATION_LEVEL, "RegOpenKeyEx should have failed with ERROR_INVALID_HANDLE or ERROR_BAD_IMPERSONATION_LEVEL instead of %d\n", error); @@ -2731,7 +2748,7 @@ static void test_impersonation_level(void) ok(ret, "ImpersonateSelf(SecurityImpersonation) failed with error %d\n", GetLastError()); ret = OpenThreadToken(GetCurrentThread(), TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY_SOURCE | TOKEN_IMPERSONATE | TOKEN_ADJUST_DEFAULT, TRUE, &Token); ok(ret, "OpenThreadToken failed with error %d\n", GetLastError()); - error = RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey); + error = RegOpenKeyExA(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hkey); ok(error == ERROR_SUCCESS, "RegOpenKeyEx should have succeeded instead of failing with %d\n", error); RegCloseKey(hkey); ret = PrivilegeCheck(Token, PrivilegeSet, &AccessGranted); @@ -2882,7 +2899,7 @@ static void test_SetEntriesInAclA(void) PACL OldAcl = NULL, NewAcl; SID_IDENTIFIER_AUTHORITY SIDAuthWorld = { SECURITY_WORLD_SID_AUTHORITY }; SID_IDENTIFIER_AUTHORITY SIDAuthNT = { SECURITY_NT_AUTHORITY }; - EXPLICIT_ACCESS ExplicitAccess; + EXPLICIT_ACCESSA ExplicitAccess; static const CHAR szEveryone[] = {'E','v','e','r','y','o','n','e',0}; static const CHAR szCurrentUser[] = { 'C','U','R','R','E','N','T','_','U','S','E','R','\0'}; @@ -3006,6 +3023,117 @@ static void test_SetEntriesInAclA(void) HeapFree(GetProcessHeap(), 0, OldAcl); } +static void test_CreateDirectoryA(void) +{ + char admin_ptr[sizeof(SID)+sizeof(ULONG)*SID_MAX_SUB_AUTHORITIES], *user; + DWORD sid_size = sizeof(admin_ptr), user_size; + PSID admin_sid = (PSID) admin_ptr, user_sid; + char sd[SECURITY_DESCRIPTOR_MIN_LENGTH]; + PSECURITY_DESCRIPTOR pSD = &sd; + ACL_SIZE_INFORMATION acl_size; + ACCESS_ALLOWED_ACE *ace; + SECURITY_ATTRIBUTES sa; + char tmpdir[MAX_PATH]; + struct _SID *owner; + BOOL bret = TRUE; + HANDLE token; + DWORD error; + PACL pDacl; + + if (!pGetNamedSecurityInfoA || !pCreateWellKnownSid) + { + win_skip("Required functions are not available\n"); + return; + } + + if (!OpenThreadToken(GetCurrentThread(), TOKEN_READ, TRUE, &token)) + { + if (GetLastError() != ERROR_NO_TOKEN) bret = FALSE; + else if (!OpenProcessToken(GetCurrentProcess(), TOKEN_READ, &token)) bret = FALSE; + } + if (!bret) + { + win_skip("Failed to get current user token\n"); + return; + } + bret = GetTokenInformation(token, TokenUser, NULL, 0, &user_size); + ok(!bret && (GetLastError() == ERROR_INSUFFICIENT_BUFFER), + "GetTokenInformation(TokenUser) failed with error %d\n", GetLastError()); + user = HeapAlloc(GetProcessHeap(), 0, user_size); + bret = GetTokenInformation(token, TokenUser, user, user_size, &user_size); + ok(bret, "GetTokenInformation(TokenUser) failed with error %d\n", GetLastError()); + CloseHandle( token ); + user_sid = ((TOKEN_USER *)user)->User.Sid; + + sa.nLength = sizeof(sa); + sa.lpSecurityDescriptor = pSD; + sa.bInheritHandle = TRUE; + InitializeSecurityDescriptor(pSD, SECURITY_DESCRIPTOR_REVISION); + pCreateWellKnownSid(WinBuiltinAdministratorsSid, NULL, admin_sid, &sid_size); + pDacl = HeapAlloc(GetProcessHeap(), 0, 100); + bret = InitializeAcl(pDacl, 100, ACL_REVISION); + ok(bret, "Failed to initialize ACL.\n"); + bret = pAddAccessAllowedAceEx(pDacl, ACL_REVISION, OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE, + GENERIC_ALL, user_sid); + ok(bret, "Failed to add Current User to ACL.\n"); + bret = pAddAccessAllowedAceEx(pDacl, ACL_REVISION, OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE, + GENERIC_ALL, admin_sid); + ok(bret, "Failed to add Administrator Group to ACL.\n"); + bret = SetSecurityDescriptorDacl(pSD, TRUE, pDacl, FALSE); + ok(bret, "Failed to add ACL to security desciptor.\n"); + + GetTempPathA(MAX_PATH, tmpdir); + lstrcatA(tmpdir, "Please Remove Me"); + bret = CreateDirectoryA(tmpdir, &sa); + ok(bret == TRUE, "CreateDirectoryA(%s) failed err=%d\n", tmpdir, GetLastError()); + HeapFree(GetProcessHeap(), 0, pDacl); + + SetLastError(0xdeadbeef); + error = pGetNamedSecurityInfoA(tmpdir, SE_FILE_OBJECT, + OWNER_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION, (PSID*)&owner, + NULL, &pDacl, NULL, &pSD); + if (error != ERROR_SUCCESS && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)) + { + win_skip("GetNamedSecurityInfoA is not implemented\n"); + goto done; + } + ok(!error, "GetNamedSecurityInfo failed with error %d\n", error); + + bret = pGetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); + ok(bret, "GetAclInformation failed\n"); + ok(acl_size.AceCount == 2, "GetAclInformation returned unexpected entry count (%d != 2).\n", + acl_size.AceCount); + if (acl_size.AceCount > 0) + { + bret = pGetAce(pDacl, 0, (VOID **)&ace); + ok(bret, "Failed to get Current User ACE.\n"); + bret = EqualSid(&ace->SidStart, user_sid); + todo_wine ok(bret, "Current User ACE != Current User SID.\n"); + todo_wine ok(((ACE_HEADER *)ace)->AceFlags == (OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE), + "Current User ACE has unexpected flags (0x%x != 0x03)\n", + ((ACE_HEADER *)ace)->AceFlags); + ok(ace->Mask == 0x1f01ff, "Current User ACE has unexpected mask (0x%x != 0x1f01ff)\n", + ace->Mask); + } + if (acl_size.AceCount > 1) + { + bret = pGetAce(pDacl, 1, (VOID **)&ace); + ok(bret, "Failed to get Administators Group ACE.\n"); + bret = EqualSid(&ace->SidStart, admin_sid); + todo_wine ok(bret, "Administators Group ACE != Administators Group SID.\n"); + todo_wine ok(((ACE_HEADER *)ace)->AceFlags == (OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE), + "Administators Group ACE has unexpected flags (0x%x != 0x03)\n", + ((ACE_HEADER *)ace)->AceFlags); + ok(ace->Mask == 0x1f01ff, "Administators Group ACE has unexpected mask (0x%x != 0x1f01ff)\n", + ace->Mask); + } + +done: + HeapFree(GetProcessHeap(), 0, user); + bret = RemoveDirectoryA(tmpdir); + ok(bret == TRUE, "RemoveDirectoryA should always succeed\n"); +} + static void test_GetNamedSecurityInfoA(void) { char admin_ptr[sizeof(SID)+sizeof(ULONG)*SID_MAX_SUB_AUTHORITIES], *user; @@ -3402,12 +3530,12 @@ static void test_ConvertSecurityDescriptorToString(void) * don't replicate this feature so we only test len >= strlen+1. */ #define CHECK_RESULT_AND_FREE(exp_str) \ ok(strcmp(string, (exp_str)) == 0, "String mismatch (expected \"%s\", got \"%s\")\n", (exp_str), string); \ - ok(len >= (strlen(exp_str) + 1), "Length mismatch (expected %d, got %d)\n", lstrlen(exp_str) + 1, len); \ + ok(len >= (strlen(exp_str) + 1), "Length mismatch (expected %d, got %d)\n", lstrlenA(exp_str) + 1, len); \ LocalFree(string); #define CHECK_ONE_OF_AND_FREE(exp_str1, exp_str2) \ ok(strcmp(string, (exp_str1)) == 0 || strcmp(string, (exp_str2)) == 0, "String mismatch (expected\n\"%s\" or\n\"%s\", got\n\"%s\")\n", (exp_str1), (exp_str2), string); \ - ok(len >= (strlen(exp_str1) + 1) || len >= (strlen(exp_str2) + 1), "Length mismatch (expected %d or %d, got %d)\n", lstrlen(exp_str1) + 1, lstrlen(exp_str2) + 1, len); \ + ok(len >= (strlen(exp_str1) + 1) || len >= (strlen(exp_str2) + 1), "Length mismatch (expected %d or %d, got %d)\n", lstrlenA(exp_str1) + 1, lstrlenA(exp_str2) + 1, len); \ LocalFree(string); InitializeSecurityDescriptor(&desc, SECURITY_DESCRIPTOR_REVISION); @@ -3760,8 +3888,8 @@ static void test_GetSecurityInfo(void) user_sid = ((TOKEN_USER *)b)->User.Sid; /* Create something. Files have lots of associated security info. */ - obj = CreateFile(myARGV[0], GENERIC_READ|WRITE_DAC, FILE_SHARE_READ, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + obj = CreateFileA(myARGV[0], GENERIC_READ|WRITE_DAC, FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (obj == INVALID_HANDLE_VALUE) { skip("Couldn't create an object for GetSecurityInfo test\n"); @@ -4391,23 +4519,71 @@ todo_wine { HeapFree(GetProcessHeap(), 0, sd); } +static ACCESS_MASK get_obj_access(HANDLE obj) +{ + OBJECT_BASIC_INFORMATION info; + NTSTATUS status; + + if (!pNtQueryObject) return 0; + + status = pNtQueryObject(obj, ObjectBasicInformation, &info, sizeof(info), NULL); + ok(!status, "NtQueryObject error %#x\n", status); + + return info.GrantedAccess; +} + static void test_mutex_security(HANDLE token) { - HANDLE mutex; + DWORD ret, i, access; + HANDLE mutex, dup; GENERIC_MAPPING mapping = { STANDARD_RIGHTS_READ | MUTANT_QUERY_STATE | SYNCHRONIZE, STANDARD_RIGHTS_WRITE | MUTEX_MODIFY_STATE | SYNCHRONIZE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE, STANDARD_RIGHTS_ALL | MUTEX_ALL_ACCESS }; + static const struct + { + int generic, mapped; + } map[] = + { + { 0, 0 }, + { GENERIC_READ, STANDARD_RIGHTS_READ | MUTANT_QUERY_STATE }, + { GENERIC_WRITE, STANDARD_RIGHTS_WRITE }, + { GENERIC_EXECUTE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE }, + { GENERIC_ALL, STANDARD_RIGHTS_ALL | MUTANT_QUERY_STATE } + }; SetLastError(0xdeadbeef); - mutex = OpenMutex(0, FALSE, "WineTestMutex"); + mutex = OpenMutexA(0, FALSE, "WineTestMutex"); ok(!mutex, "mutex should not exist\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); SetLastError(0xdeadbeef); - mutex = CreateMutex(NULL, FALSE, "WineTestMutex"); + mutex = CreateMutexA(NULL, FALSE, "WineTestMutex"); ok(mutex != 0, "CreateMutex error %d\n", GetLastError()); + access = get_obj_access(mutex); + ok(access == MUTANT_ALL_ACCESS, "expected MUTANT_ALL_ACCESS, got %#x\n", access); + + for (i = 0; i < sizeof(map)/sizeof(map[0]); i++) + { + SetLastError( 0xdeadbeef ); + ret = DuplicateHandle(GetCurrentProcess(), mutex, GetCurrentProcess(), &dup, + map[i].generic, FALSE, 0); + ok(ret, "DuplicateHandle error %d\n", GetLastError()); + + access = get_obj_access(dup); + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + + CloseHandle(dup); + + SetLastError(0xdeadbeef); + dup = OpenMutexA(0, FALSE, "WineTestMutex"); +todo_wine + ok(!dup, "OpenMutex should fail\n"); +todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError()); + } + test_default_handle_security(token, mutex, &mapping); CloseHandle (mutex); @@ -4415,56 +4591,581 @@ static void test_mutex_security(HANDLE token) static void test_event_security(HANDLE token) { - HANDLE event; + DWORD ret, i, access; + HANDLE event, dup; GENERIC_MAPPING mapping = { STANDARD_RIGHTS_READ | EVENT_QUERY_STATE | SYNCHRONIZE, STANDARD_RIGHTS_WRITE | EVENT_MODIFY_STATE | SYNCHRONIZE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE, STANDARD_RIGHTS_ALL | EVENT_ALL_ACCESS }; + static const struct + { + int generic, mapped; + } map[] = + { + { 0, 0 }, + { GENERIC_READ, STANDARD_RIGHTS_READ | EVENT_QUERY_STATE }, + { GENERIC_WRITE, STANDARD_RIGHTS_WRITE | EVENT_MODIFY_STATE }, + { GENERIC_EXECUTE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE }, + { GENERIC_ALL, STANDARD_RIGHTS_ALL | EVENT_QUERY_STATE | EVENT_MODIFY_STATE } + }; SetLastError(0xdeadbeef); - event = OpenEvent(0, FALSE, "WineTestEvent"); + event = OpenEventA(0, FALSE, "WineTestEvent"); ok(!event, "event should not exist\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); SetLastError(0xdeadbeef); - event = CreateEvent(NULL, FALSE, FALSE, "WineTestEvent"); + event = CreateEventA(NULL, FALSE, FALSE, "WineTestEvent"); ok(event != 0, "CreateEvent error %d\n", GetLastError()); + access = get_obj_access(event); + ok(access == EVENT_ALL_ACCESS, "expected EVENT_ALL_ACCESS, got %#x\n", access); + + for (i = 0; i < sizeof(map)/sizeof(map[0]); i++) + { + SetLastError( 0xdeadbeef ); + ret = DuplicateHandle(GetCurrentProcess(), event, GetCurrentProcess(), &dup, + map[i].generic, FALSE, 0); + ok(ret, "DuplicateHandle error %d\n", GetLastError()); + + access = get_obj_access(dup); + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + + CloseHandle(dup); + + SetLastError(0xdeadbeef); + dup = OpenEventA(0, FALSE, "WineTestEvent"); +todo_wine + ok(!dup, "OpenEvent should fail\n"); +todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError()); + } + test_default_handle_security(token, event, &mapping); CloseHandle(event); } +static void test_semaphore_security(HANDLE token) +{ + DWORD ret, i, access; + HANDLE sem, dup; + GENERIC_MAPPING mapping = { STANDARD_RIGHTS_READ | SEMAPHORE_QUERY_STATE, + STANDARD_RIGHTS_WRITE | SEMAPHORE_MODIFY_STATE, + STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE, + STANDARD_RIGHTS_ALL | SEMAPHORE_ALL_ACCESS }; + static const struct + { + int generic, mapped; + } map[] = + { + { 0, 0 }, + { GENERIC_READ, STANDARD_RIGHTS_READ | SEMAPHORE_QUERY_STATE }, + { GENERIC_WRITE, STANDARD_RIGHTS_WRITE | SEMAPHORE_MODIFY_STATE }, + { GENERIC_EXECUTE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE }, + { GENERIC_ALL, STANDARD_RIGHTS_ALL | SEMAPHORE_QUERY_STATE | SEMAPHORE_MODIFY_STATE } + }; + + SetLastError(0xdeadbeef); + sem = OpenSemaphoreA(0, FALSE, "WineTestSemaphore"); + ok(!sem, "semaphore should not exist\n"); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + sem = CreateSemaphoreA(NULL, 0, 10, "WineTestSemaphore"); + ok(sem != 0, "CreateSemaphore error %d\n", GetLastError()); + + access = get_obj_access(sem); + ok(access == SEMAPHORE_ALL_ACCESS, "expected SEMAPHORE_ALL_ACCESS, got %#x\n", access); + + for (i = 0; i < sizeof(map)/sizeof(map[0]); i++) + { + SetLastError( 0xdeadbeef ); + ret = DuplicateHandle(GetCurrentProcess(), sem, GetCurrentProcess(), &dup, + map[i].generic, FALSE, 0); + ok(ret, "DuplicateHandle error %d\n", GetLastError()); + + access = get_obj_access(dup); + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + + CloseHandle(dup); + } + + test_default_handle_security(token, sem, &mapping); + + CloseHandle(sem); +} + #define WINE_TEST_PIPE "\\\\.\\pipe\\WineTestPipe" static void test_named_pipe_security(HANDLE token) { - HANDLE pipe, file; + DWORD ret, i, access; + HANDLE pipe, file, dup; GENERIC_MAPPING mapping = { FILE_GENERIC_READ, FILE_GENERIC_WRITE, FILE_GENERIC_EXECUTE, STANDARD_RIGHTS_ALL | FILE_ALL_ACCESS }; + static const struct + { + int todo, generic, mapped; + } map[] = + { + { 0, 0, 0 }, + { 1, GENERIC_READ, FILE_GENERIC_READ }, + { 1, GENERIC_WRITE, FILE_GENERIC_WRITE }, + { 1, GENERIC_EXECUTE, FILE_GENERIC_EXECUTE }, + { 1, GENERIC_ALL, STANDARD_RIGHTS_ALL | FILE_ALL_ACCESS } + }; + static const struct + { + DWORD open_mode; + DWORD access; + } creation_access[] = + { + { PIPE_ACCESS_INBOUND, FILE_GENERIC_READ }, + { PIPE_ACCESS_OUTBOUND, FILE_GENERIC_WRITE }, + { PIPE_ACCESS_DUPLEX, FILE_GENERIC_READ|FILE_GENERIC_WRITE }, + { PIPE_ACCESS_INBOUND|WRITE_DAC, FILE_GENERIC_READ|WRITE_DAC }, + { PIPE_ACCESS_INBOUND|WRITE_OWNER, FILE_GENERIC_READ|WRITE_OWNER } + /* ACCESS_SYSTEM_SECURITY is also valid, but will fail with ERROR_PRIVILEGE_NOT_HELD */ + }; + + /* Test the different security access options for pipes */ + for (i = 0; i < sizeof(creation_access)/sizeof(creation_access[0]); i++) + { + SetLastError(0xdeadbeef); + pipe = CreateNamedPipeA(WINE_TEST_PIPE, creation_access[i].open_mode, + PIPE_TYPE_BYTE | PIPE_NOWAIT, PIPE_UNLIMITED_INSTANCES, 0, 0, + NMPWAIT_USE_DEFAULT_WAIT, NULL); + ok(pipe != INVALID_HANDLE_VALUE, "CreateNamedPipe(0x%x) error %d\n", + creation_access[i].open_mode, GetLastError()); + access = get_obj_access(pipe); + ok(access == creation_access[i].access, + "CreateNamedPipeA(0x%x) pipe expected access 0x%x (got 0x%x)\n", + creation_access[i].open_mode, creation_access[i].access, access); + CloseHandle(pipe); + } SetLastError(0xdeadbeef); - pipe = CreateNamedPipe(WINE_TEST_PIPE, PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE, - PIPE_TYPE_BYTE | PIPE_NOWAIT, PIPE_UNLIMITED_INSTANCES, - 0, 0, NMPWAIT_USE_DEFAULT_WAIT, NULL); + pipe = CreateNamedPipeA(WINE_TEST_PIPE, PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE, + PIPE_TYPE_BYTE | PIPE_NOWAIT, PIPE_UNLIMITED_INSTANCES, + 0, 0, NMPWAIT_USE_DEFAULT_WAIT, NULL); ok(pipe != INVALID_HANDLE_VALUE, "CreateNamedPipe error %d\n", GetLastError()); test_default_handle_security(token, pipe, &mapping); SetLastError(0xdeadbeef); - file = CreateFile(WINE_TEST_PIPE, FILE_ALL_ACCESS, 0, NULL, OPEN_EXISTING, 0, 0); + file = CreateFileA(WINE_TEST_PIPE, FILE_ALL_ACCESS, 0, NULL, OPEN_EXISTING, 0, 0); ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); - CloseHandle(file); + access = get_obj_access(file); + ok(access == FILE_ALL_ACCESS, "expected FILE_ALL_ACCESS, got %#x\n", access); + + for (i = 0; i < sizeof(map)/sizeof(map[0]); i++) + { + SetLastError( 0xdeadbeef ); + ret = DuplicateHandle(GetCurrentProcess(), file, GetCurrentProcess(), &dup, + map[i].generic, FALSE, 0); + ok(ret, "DuplicateHandle error %d\n", GetLastError()); + + access = get_obj_access(dup); + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + + CloseHandle(dup); + } + + CloseHandle(file); CloseHandle(pipe); SetLastError(0xdeadbeef); - file = CreateFile("\\\\.\\pipe\\", FILE_ALL_ACCESS, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); + file = CreateFileA("\\\\.\\pipe\\", FILE_ALL_ACCESS, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); ok(file != INVALID_HANDLE_VALUE || broken(file == INVALID_HANDLE_VALUE) /* before Vista */, "CreateFile error %d\n", GetLastError()); + + if (file != INVALID_HANDLE_VALUE) + { + access = get_obj_access(file); + ok(access == FILE_ALL_ACCESS, "expected FILE_ALL_ACCESS, got %#x\n", access); + + for (i = 0; i < sizeof(map)/sizeof(map[0]); i++) + { + SetLastError( 0xdeadbeef ); + ret = DuplicateHandle(GetCurrentProcess(), file, GetCurrentProcess(), &dup, + map[i].generic, FALSE, 0); + ok(ret, "DuplicateHandle error %d\n", GetLastError()); + + access = get_obj_access(dup); + if (map[i].todo) +todo_wine + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + else + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + + CloseHandle(dup); + } + } + CloseHandle(file); } +static void test_file_security(HANDLE token) +{ + DWORD ret, i, access, bytes; + HANDLE file, dup; + static const struct + { + int generic, mapped; + } map[] = + { + { 0, 0 }, + { GENERIC_READ, FILE_GENERIC_READ }, + { GENERIC_WRITE, FILE_GENERIC_WRITE }, + { GENERIC_EXECUTE, FILE_GENERIC_EXECUTE }, + { GENERIC_ALL, STANDARD_RIGHTS_ALL | FILE_ALL_ACCESS } + }; + char temp_path[MAX_PATH]; + char file_name[MAX_PATH]; + char buf[16]; + + GetTempPathA(MAX_PATH, temp_path); + GetTempFileNameA(temp_path, "tmp", 0, file_name); + + /* file */ + SetLastError(0xdeadbeef); + file = CreateFileA(file_name, GENERIC_ALL, 0, NULL, CREATE_ALWAYS, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + + access = get_obj_access(file); + ok(access == FILE_ALL_ACCESS, "expected FILE_ALL_ACCESS, got %#x\n", access); + + for (i = 0; i < sizeof(map)/sizeof(map[0]); i++) + { + SetLastError( 0xdeadbeef ); + ret = DuplicateHandle(GetCurrentProcess(), file, GetCurrentProcess(), &dup, + map[i].generic, FALSE, 0); + ok(ret, "DuplicateHandle error %d\n", GetLastError()); + + access = get_obj_access(dup); + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + + CloseHandle(dup); + } + + CloseHandle(file); + + SetLastError(0xdeadbeef); + file = CreateFileA(file_name, 0, 0, NULL, OPEN_EXISTING, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + + access = get_obj_access(file); +todo_wine + ok(access == (FILE_READ_ATTRIBUTES | SYNCHRONIZE), "expected FILE_READ_ATTRIBUTES | SYNCHRONIZE, got %#x\n", access); + + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadFile(file, buf, sizeof(buf), &bytes, NULL); + ok(!ret, "ReadFile should fail\n"); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(bytes == 0, "expected 0, got %u\n", bytes); + + CloseHandle(file); + + SetLastError(0xdeadbeef); + file = CreateFileA(file_name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); + ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + + access = get_obj_access(file); +todo_wine + ok(access == (FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES), "expected FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES, got %#x\n", access); + + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadFile(file, buf, sizeof(buf), &bytes, NULL); + ok(!ret, "ReadFile should fail\n"); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + ok(bytes == 0, "expected 0, got %u\n", bytes); + + CloseHandle(file); + DeleteFileA(file_name); + + /* directory */ + SetLastError(0xdeadbeef); + file = CreateFileA(temp_path, GENERIC_ALL, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); + ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + + access = get_obj_access(file); + ok(access == FILE_ALL_ACCESS, "expected FILE_ALL_ACCESS, got %#x\n", access); + + for (i = 0; i < sizeof(map)/sizeof(map[0]); i++) + { + SetLastError( 0xdeadbeef ); + ret = DuplicateHandle(GetCurrentProcess(), file, GetCurrentProcess(), &dup, + map[i].generic, FALSE, 0); + ok(ret, "DuplicateHandle error %d\n", GetLastError()); + + access = get_obj_access(dup); + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + + CloseHandle(dup); + } + + CloseHandle(file); + + SetLastError(0xdeadbeef); + file = CreateFileA(temp_path, 0, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); + ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + + access = get_obj_access(file); +todo_wine + ok(access == (FILE_READ_ATTRIBUTES | SYNCHRONIZE), "expected FILE_READ_ATTRIBUTES | SYNCHRONIZE, got %#x\n", access); + + CloseHandle(file); + + SetLastError(0xdeadbeef); + file = CreateFileA(temp_path, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); + ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + + access = get_obj_access(file); +todo_wine + ok(access == (FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES), "expected FILE_GENERIC_WRITE | FILE_READ_ATTRIBUTES, got %#x\n", access); + + CloseHandle(file); +} + +static void test_filemap_security(void) +{ + char temp_path[MAX_PATH]; + char file_name[MAX_PATH]; + DWORD ret, i, access; + HANDLE file, mapping, dup; + static const struct + { + int generic, mapped; + } map[] = + { + { 0, 0 }, + { GENERIC_READ, STANDARD_RIGHTS_READ | SECTION_QUERY | SECTION_MAP_READ }, + { GENERIC_WRITE, STANDARD_RIGHTS_WRITE | SECTION_MAP_WRITE }, + { GENERIC_EXECUTE, STANDARD_RIGHTS_EXECUTE | SECTION_MAP_EXECUTE }, + { GENERIC_ALL, STANDARD_RIGHTS_REQUIRED | SECTION_ALL_ACCESS } + }; + static const struct + { + int prot, mapped; + } prot_map[] = + { + { 0, 0 }, + { PAGE_NOACCESS, 0 }, + { PAGE_READONLY, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ }, + { PAGE_READWRITE, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE }, + { PAGE_WRITECOPY, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ }, + { PAGE_EXECUTE, 0 }, + { PAGE_EXECUTE_READ, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_EXECUTE }, + { PAGE_EXECUTE_READWRITE, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE | SECTION_MAP_EXECUTE }, + { PAGE_EXECUTE_WRITECOPY, STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_EXECUTE } + }; + + GetTempPathA(MAX_PATH, temp_path); + GetTempFileNameA(temp_path, "tmp", 0, file_name); + + SetLastError(0xdeadbeef); + file = CreateFileA(file_name, GENERIC_READ|GENERIC_WRITE|GENERIC_EXECUTE, 0, NULL, CREATE_ALWAYS, 0, 0); + ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + SetFilePointer(file, 4096, NULL, FILE_BEGIN); + SetEndOfFile(file); + + for (i = 0; i < sizeof(prot_map)/sizeof(prot_map[0]); i++) + { + SetLastError(0xdeadbeef); + mapping = CreateFileMappingW(file, NULL, prot_map[i].prot, 0, 4096, NULL); + if (prot_map[i].mapped) + { + if (!mapping) + { + /* NT4 and win2k don't support EXEC on file mappings */ + if (prot_map[i].prot == PAGE_EXECUTE_READ || prot_map[i].prot == PAGE_EXECUTE_READWRITE || prot_map[i].prot == PAGE_EXECUTE_WRITECOPY) + { + win_skip("CreateFileMapping doesn't support PAGE_EXECUTE protection\n"); + continue; + } + } + ok(mapping != 0, "CreateFileMapping(%04x) error %d\n", prot_map[i].prot, GetLastError()); + } + else + { + ok(!mapping, "CreateFileMapping(%04x) should fail\n", prot_map[i].prot); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + continue; + } + + access = get_obj_access(mapping); + ok(access == prot_map[i].mapped, "%d: expected %#x, got %#x\n", i, prot_map[i].mapped, access); + + CloseHandle(mapping); + } + + SetLastError(0xdeadbeef); + mapping = CreateFileMappingW(file, NULL, PAGE_EXECUTE_READWRITE, 0, 4096, NULL); + if (!mapping) + { + /* NT4 and win2k don't support EXEC on file mappings */ + win_skip("CreateFileMapping doesn't support PAGE_EXECUTE protection\n"); + CloseHandle(file); + DeleteFileA(file_name); + return; + } + ok(mapping != 0, "CreateFileMapping error %d\n", GetLastError()); + + access = get_obj_access(mapping); + ok(access == (STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE | SECTION_MAP_EXECUTE), + "expected STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE | SECTION_MAP_EXECUTE, got %#x\n", access); + + for (i = 0; i < sizeof(map)/sizeof(map[0]); i++) + { + SetLastError( 0xdeadbeef ); + ret = DuplicateHandle(GetCurrentProcess(), mapping, GetCurrentProcess(), &dup, + map[i].generic, FALSE, 0); + ok(ret, "DuplicateHandle error %d\n", GetLastError()); + + access = get_obj_access(dup); + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + + CloseHandle(dup); + } + + CloseHandle(mapping); + CloseHandle(file); + DeleteFileA(file_name); +} + +static void test_thread_security(void) +{ + DWORD ret, i, access; + HANDLE thread, dup; + static const struct + { + int generic, mapped; + } map[] = + { + { 0, 0 }, + { GENERIC_READ, STANDARD_RIGHTS_READ | THREAD_QUERY_INFORMATION | THREAD_GET_CONTEXT }, + { GENERIC_WRITE, STANDARD_RIGHTS_WRITE | THREAD_SET_INFORMATION | THREAD_SET_CONTEXT | THREAD_TERMINATE | THREAD_SUSPEND_RESUME | 0x4 }, + { GENERIC_EXECUTE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE }, + { GENERIC_ALL, THREAD_ALL_ACCESS_NT4 } + }; + + SetLastError(0xdeadbeef); + thread = CreateThread(NULL, 0, (void *)0xdeadbeef, NULL, CREATE_SUSPENDED, &ret); + ok(thread != 0, "CreateThread error %d\n", GetLastError()); + + access = get_obj_access(thread); + ok(access == THREAD_ALL_ACCESS_NT4 || access == THREAD_ALL_ACCESS_VISTA, "expected THREAD_ALL_ACCESS, got %#x\n", access); + + for (i = 0; i < sizeof(map)/sizeof(map[0]); i++) + { + SetLastError( 0xdeadbeef ); + ret = DuplicateHandle(GetCurrentProcess(), thread, GetCurrentProcess(), &dup, + map[i].generic, FALSE, 0); + ok(ret, "DuplicateHandle error %d\n", GetLastError()); + + access = get_obj_access(dup); + switch (map[i].generic) + { + case GENERIC_READ: + case GENERIC_EXECUTE: + ok(access == map[i].mapped || access == (map[i].mapped | THREAD_QUERY_LIMITED_INFORMATION) /* Vista+ */, + "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + break; + case GENERIC_WRITE: +todo_wine + ok(access == map[i].mapped || access == (map[i].mapped | THREAD_SET_LIMITED_INFORMATION) /* Vista+ */, + "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + break; + case GENERIC_ALL: + ok(access == map[i].mapped || access == THREAD_ALL_ACCESS_VISTA, + "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + break; + default: + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + break; + } + + CloseHandle(dup); + } + + TerminateThread(thread, 0); + CloseHandle(thread); +} + +static void test_process_access(void) +{ + DWORD ret, i, access; + HANDLE process, dup; + STARTUPINFOA sti; + PROCESS_INFORMATION pi; + char cmdline[] = "winver.exe"; + static const struct + { + int generic, mapped; + } map[] = + { + { 0, 0 }, + { GENERIC_READ, STANDARD_RIGHTS_READ | PROCESS_QUERY_INFORMATION | PROCESS_VM_READ }, + { GENERIC_WRITE, STANDARD_RIGHTS_WRITE | PROCESS_SET_QUOTA | PROCESS_SET_INFORMATION | PROCESS_SUSPEND_RESUME | + PROCESS_VM_WRITE | PROCESS_DUP_HANDLE | PROCESS_CREATE_PROCESS | PROCESS_CREATE_THREAD | PROCESS_VM_OPERATION }, + { GENERIC_EXECUTE, STANDARD_RIGHTS_EXECUTE | SYNCHRONIZE }, + { GENERIC_ALL, PROCESS_ALL_ACCESS_NT4 } + }; + + memset(&sti, 0, sizeof(sti)); + sti.cb = sizeof(sti); + SetLastError(0xdeadbeef); + ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &sti, &pi); + ok(ret, "CreateProcess() error %d\n", GetLastError()); + + CloseHandle(pi.hThread); + process = pi.hProcess; + + access = get_obj_access(process); + ok(access == PROCESS_ALL_ACCESS_NT4 || access == PROCESS_ALL_ACCESS_VISTA, "expected PROCESS_ALL_ACCESS, got %#x\n", access); + + for (i = 0; i < sizeof(map)/sizeof(map[0]); i++) + { + SetLastError( 0xdeadbeef ); + ret = DuplicateHandle(GetCurrentProcess(), process, GetCurrentProcess(), &dup, + map[i].generic, FALSE, 0); + ok(ret, "DuplicateHandle error %d\n", GetLastError()); + + access = get_obj_access(dup); + switch (map[i].generic) + { + case GENERIC_READ: + ok(access == map[i].mapped || access == (map[i].mapped | PROCESS_QUERY_LIMITED_INFORMATION) /* Vista+ */, + "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + break; + case GENERIC_WRITE: + ok(access == map[i].mapped || access == (map[i].mapped | PROCESS_TERMINATE) /* before Vista */, + "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + break; + case GENERIC_EXECUTE: + ok(access == map[i].mapped || access == (map[i].mapped | PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_TERMINATE) /* Vista+ */, + "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + break; + case GENERIC_ALL: + ok(access == map[i].mapped || access == PROCESS_ALL_ACCESS_VISTA, + "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + break; + default: + ok(access == map[i].mapped, "%d: expected %#x, got %#x\n", i, map[i].mapped, access); + break; + } + + CloseHandle(dup); + } + + TerminateProcess(process, 0); + CloseHandle(process); +} + static BOOL validate_impersonation_token(HANDLE token, DWORD *token_type) { DWORD ret, needed; @@ -4538,6 +5239,11 @@ static void test_kernel_objects_security(void) test_mutex_security(token); test_event_security(token); test_named_pipe_security(token); + test_semaphore_security(token); + test_file_security(token); + test_filemap_security(); + test_thread_security(); + test_process_access(); /* FIXME: test other kernel object types */ CloseHandle(process_token); @@ -4612,7 +5318,7 @@ static void test_default_dacl_owner_sid(void) sa.nLength = sizeof(SECURITY_ATTRIBUTES); sa.lpSecurityDescriptor = sd; sa.bInheritHandle = FALSE; - handle = CreateEvent( &sa, TRUE, TRUE, "test_event" ); + handle = CreateEventA( &sa, TRUE, TRUE, "test_event" ); ok( handle != NULL, "error %u\n", GetLastError() ); size = 0; @@ -4652,6 +5358,41 @@ static void test_default_dacl_owner_sid(void) CloseHandle( handle ); } +static void test_AdjustTokenPrivileges(void) +{ + TOKEN_PRIVILEGES tp, prev; + HANDLE token; + DWORD len; + LUID luid; + BOOL ret; + + if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token)) + return; + + if (!LookupPrivilegeValueA(NULL, SE_BACKUP_NAME, &luid)) + { + CloseHandle(token); + return; + } + + tp.PrivilegeCount = 1; + tp.Privileges[0].Luid = luid; + tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; + + len = 0xdeadbeef; + ret = AdjustTokenPrivileges(token, FALSE, &tp, sizeof(TOKEN_PRIVILEGES), NULL, &len); + ok(ret, "got %d\n", ret); + ok(len == 0xdeadbeef, "got length %d\n", len); + + /* revert */ + tp.PrivilegeCount = 1; + tp.Privileges[0].Luid = luid; + tp.Privileges[0].Attributes = 0; + AdjustTokenPrivileges(token, FALSE, &tp, sizeof(TOKEN_PRIVILEGES), &prev, NULL); + + CloseHandle(token); +} + START_TEST(security) { init(); @@ -4677,6 +5418,7 @@ START_TEST(security) test_impersonation_level(); test_SetEntriesInAclW(); test_SetEntriesInAclA(); + test_CreateDirectoryA(); test_GetNamedSecurityInfoA(); test_ConvertStringSecurityDescriptor(); test_ConvertSecurityDescriptorToString(); @@ -4691,4 +5433,5 @@ START_TEST(security) test_CreateRestrictedToken(); test_TokenIntegrityLevel(); test_default_dacl_owner_sid(); + test_AdjustTokenPrivileges(); } diff --git a/rostests/winetests/advapi32/service.c b/rostests/winetests/advapi32/service.c index bbfe01ddb91..603e5085e60 100644 --- a/rostests/winetests/advapi32/service.c +++ b/rostests/winetests/advapi32/service.c @@ -104,7 +104,6 @@ static void test_open_scm(void) CloseServiceHandle(scm_handle); /* Just in case */ /* Proper call with an empty hostname */ - SetLastError(0xdeadbeef); scm_handle = OpenSCManagerA("", SERVICES_ACTIVE_DATABASEA, SC_MANAGER_CONNECT); ok(scm_handle != NULL, "Expected success, got error %u\n", GetLastError()); CloseServiceHandle(scm_handle); @@ -112,6 +111,8 @@ static void test_open_scm(void) /* Again a correct one */ SetLastError(0xdeadbeef); scm_handle = OpenSCManagerA(NULL, NULL, SC_MANAGER_CONNECT); + ok(GetLastError() == ERROR_SUCCESS || broken(GetLastError() == ERROR_IO_PENDING) /* win2k */, + "Expected ERROR_SUCCESS, got %u\n", GetLastError()); ok(scm_handle != NULL, "Expected success, got error %u\n", GetLastError()); CloseServiceHandle(scm_handle); } @@ -169,7 +170,7 @@ static void test_open_svc(void) /* Try to open the service with this displayname, unless the displayname equals * the servicename as that would defeat the purpose of this test. */ - if (!lstrcmpi(spooler, displayname)) + if (!lstrcmpiA(spooler, displayname)) { skip("displayname equals servicename\n"); CloseServiceHandle(scm_handle); @@ -418,7 +419,7 @@ static void test_create_delete_svc(void) /* Wait a while. One of the following tests also does a CreateService for the * same servicename and this would result in an ERROR_SERVICE_MARKED_FOR_DELETE - * error if we do this to quick. Vista seems more picky then the others. + * error if we do this too quickly. Vista seems more picky than the others. */ Sleep(1000); @@ -704,7 +705,7 @@ static void test_get_displayname(void) SetLastError(0xdeadbeef); ret = GetServiceDisplayNameA(scm_handle, servicename, displayname, &displaysize); ok(ret, "Expected success, got error %u\n", GetLastError()); - ok(!lstrcmpi(displayname, servicename), + ok(!lstrcmpiA(displayname, servicename), "Expected displayname to be %s, got %s\n", servicename, displayname); /* Delete the service */ @@ -872,7 +873,7 @@ static void test_get_servicekeyname(void) { ok(strlen(servicename) == tempsize/2, "Expected the buffer to be twice the length of the string\n") ; - ok(!lstrcmpi(servicename, spooler), "Expected %s, got %s\n", spooler, servicename); + ok(!lstrcmpiA(servicename, spooler), "Expected %s, got %s\n", spooler, servicename); ok(servicesize == (tempsize * 2), "Expected servicesize not to change if buffer not insufficient\n") ; } @@ -1060,9 +1061,9 @@ static void test_enum_svc(void) DWORD neededW, returnedW; DWORD tempneeded, tempreturned, missing; DWORD servicecountactive, servicecountinactive; - ENUM_SERVICE_STATUS *services; + ENUM_SERVICE_STATUSA *services; ENUM_SERVICE_STATUSW *servicesW; - ENUM_SERVICE_STATUS_PROCESS *exservices; + ENUM_SERVICE_STATUS_PROCESSA *exservices; UINT i; /* All NULL or wrong */ @@ -1292,7 +1293,7 @@ static void test_enum_svc(void) /* Allocate less than the needed bytes and don't specify a resume handle */ services = HeapAlloc(GetProcessHeap(), 0, tempneeded); - bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUS); + bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUSA); needed = 0xdeadbeef; returned = 0xdeadbeef; SetLastError(0xdeadbeef); @@ -1305,7 +1306,7 @@ static void test_enum_svc(void) "Expected ERROR_MORE_DATA, got %d\n", GetLastError()); /* Allocate less than the needed bytes, this time with a correct resume handle */ - bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUS); + bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUSA); needed = 0xdeadbeef; returned = 0xdeadbeef; resume = 0; @@ -1607,7 +1608,7 @@ static void test_enum_svc(void) /* Allocate less than the needed bytes and don't specify a resume handle */ exservices = HeapAlloc(GetProcessHeap(), 0, tempneeded); - bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUS); + bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUSA); needed = 0xdeadbeef; returned = 0xdeadbeef; SetLastError(0xdeadbeef); @@ -1620,7 +1621,7 @@ static void test_enum_svc(void) "Expected ERROR_MORE_DATA, got %d\n", GetLastError()); /* Allocate less than the needed bytes, this time with a correct resume handle */ - bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUS); + bufsize = (tempreturned - 1) * sizeof(ENUM_SERVICE_STATUSA); needed = 0xdeadbeef; returned = 0xdeadbeef; resume = 0; From b9ecc0ff3f680223aba3fb0d6158f2d65f021a29 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 22:07:22 +0000 Subject: [PATCH 354/419] [WINE/TEST.H] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62782 --- reactos/include/reactos/wine/test.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reactos/include/reactos/wine/test.h b/reactos/include/reactos/wine/test.h index 04f9ab4fe15..fae1487bbd1 100644 --- a/reactos/include/reactos/wine/test.h +++ b/reactos/include/reactos/wine/test.h @@ -69,6 +69,7 @@ extern void winetest_add_failures( LONG new_failures ); extern void winetest_wait_child_process( HANDLE process ); extern const char *wine_dbgstr_wn( const WCHAR *str, int n ); +extern const char *wine_dbgstr_guid( const GUID *guid ); static inline const char *wine_dbgstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); } /* strcmpW is available for tests compiled under Wine, but not in standalone @@ -541,6 +542,19 @@ const char *wine_dbgstr_wn( const WCHAR *str, int n ) return res; } +const char *wine_dbgstr_guid( const GUID *guid ) +{ + char *res; + + if (!guid) return "(null)"; + res = get_temp_buffer( 39 ); /* CHARS_IN_GUID */ + sprintf( res, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], + guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], + guid->Data4[5], guid->Data4[6], guid->Data4[7] ); + return res; +} + /* Find a test by name */ static const struct test *find_test( const char *name ) { From c951aa0ebcd88aa54d203bd3dd3af2a435be8b31 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 22:10:41 +0000 Subject: [PATCH 355/419] * Addendum to r62773 (I don't know how did this file escape earlier). svn path=/trunk/; revision=62783 --- reactos/lib/3rdparty/libxml2/xpath.c | 45 +++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/reactos/lib/3rdparty/libxml2/xpath.c b/reactos/lib/3rdparty/libxml2/xpath.c index 9a82e9091a3..97410e7b63f 100644 --- a/reactos/lib/3rdparty/libxml2/xpath.c +++ b/reactos/lib/3rdparty/libxml2/xpath.c @@ -12399,7 +12399,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt, break; } } else if (cur->type == type) { - if (type == XML_NAMESPACE_DECL) + if (cur->type == XML_NAMESPACE_DECL) XP_TEST_HIT_NS else XP_TEST_HIT @@ -15078,6 +15078,49 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) { return(res); } +/** + * xmlXPathSetContextNode: + * @node: the node to to use as the context node + * @ctx: the XPath context + * + * Sets 'node' as the context node. The node must be in the same + * document as that associated with the context. + * + * Returns -1 in case of error or 0 if successful + */ +int +xmlXPathSetContextNode(xmlNodePtr node, xmlXPathContextPtr ctx) { + if ((node == NULL) || (ctx == NULL)) + return(-1); + + if (node->doc == ctx->doc) { + ctx->node = node; + return(0); + } + return(-1); +} + +/** + * xmlXPathNodeEval: + * @node: the node to to use as the context node + * @str: the XPath expression + * @ctx: the XPath context + * + * Evaluate the XPath Location Path in the given context. The node 'node' + * is set as the context node. The context node is not restored. + * + * Returns the xmlXPathObjectPtr resulting from the evaluation or NULL. + * the caller has to free the object. + */ +xmlXPathObjectPtr +xmlXPathNodeEval(xmlNodePtr node, const xmlChar *str, xmlXPathContextPtr ctx) { + if (str == NULL) + return(NULL); + if (xmlXPathSetContextNode(node, ctx) < 0) + return(NULL); + return(xmlXPathEval(str, ctx)); +} + /** * xmlXPathEvalExpression: * @str: the XPath expression From 4498108070aee674c46ffff9c3ffd9df8f1363f0 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 22:15:54 +0000 Subject: [PATCH 356/419] [UNICODE] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62784 --- reactos/media/doc/README.WINE | 2 +- reactos/tools/unicode/wctype.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 953c8db5b87..76dfc87078b 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -21,7 +21,7 @@ When porting a new DLL from Wine to ReactOS, please do the following steps The following build tools are shared with Wine. -reactos/tools/unicode # Synced to Wine-1.7.1 +reactos/tools/unicode # Synced to Wine-1.7.17 reactos/tools/widl # Synced to Wine-1.7.17 reactos/tools/wpp # Synced to Wine-1.7.1 diff --git a/reactos/tools/unicode/wctype.c b/reactos/tools/unicode/wctype.c index 49128d34dc4..b5309079d12 100644 --- a/reactos/tools/unicode/wctype.c +++ b/reactos/tools/unicode/wctype.c @@ -234,7 +234,7 @@ const unsigned short wine_wctype_table[17152] = 0x6220, 0x6220, 0x6220, 0x6220, 0x6220, 0x0000, 0xb200, 0xb200, 0xc200, 0x5210, 0x5210, 0xc200, 0x7210, 0xc210, 0xb200, 0xb200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, 0xd200, - 0xd200, 0xd200, 0xd200, 0xc210, 0x0000, 0x0000, 0xc210, 0xc210, + 0xd200, 0xd200, 0xd200, 0xc210, 0xc220, 0x0000, 0xc210, 0xc210, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, 0xc300, @@ -776,7 +776,7 @@ const unsigned short wine_wctype_table[17152] = 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, - 0xb210, 0xb210, 0xb210, 0xd200, 0xd200, 0xd200, 0xa208, 0x0000, + 0xb210, 0xb210, 0xb210, 0xd200, 0xd200, 0xd200, 0xe220, 0x0000, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x1204, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -842,7 +842,7 @@ const unsigned short wine_wctype_table[17152] = 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0xd200, - 0xd200, 0x1200, 0x1200, 0x1200, 0x0000, 0x0000, 0x1210, 0x1210, + 0xd200, 0x1200, 0x1200, 0xd200, 0x0000, 0x0000, 0x1210, 0x1210, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, 0x1300, @@ -1043,8 +1043,8 @@ const unsigned short wine_wctype_table[17152] = 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb200, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xb210, 0xa208, - 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, + 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0x0000, 0xf220, 0xf220, + 0xf220, 0xf220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0xe220, 0x3200, 0x1302, 0x0000, 0x0000, 0x3200, 0x3200, 0x3200, 0x3200, 0x3200, 0x3200, 0x4200, 0x4200, 0xb200, 0xb210, 0xb210, 0x1302, 0x3200, 0x3200, 0x3200, 0x3200, 0x3200, 0x3200, 0x3200, 0x3200, @@ -1128,7 +1128,7 @@ const unsigned short wine_wctype_table[17152] = 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, - 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, + 0xb210, 0xb210, 0xb210, 0xb210, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, 0xb200, From 5f7347300befe5f1e8d77b07ea522369c24f0dec Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 22:26:13 +0000 Subject: [PATCH 357/419] [USER32_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62785 --- rostests/winetests/user32/broadcast.c | 24 +- rostests/winetests/user32/clipboard.c | 28 +- rostests/winetests/user32/combo.c | 2 +- rostests/winetests/user32/cursoricon.c | 66 +-- rostests/winetests/user32/dce.c | 9 +- rostests/winetests/user32/dde.c | 14 +- rostests/winetests/user32/dialog.c | 2 +- rostests/winetests/user32/input.c | 152 +++--- rostests/winetests/user32/menu.c | 578 ++++++++++++--------- rostests/winetests/user32/monitor.c | 76 ++- rostests/winetests/user32/msg.c | 221 ++++++-- rostests/winetests/user32/resource.c | 91 ++-- rostests/winetests/user32/scroll.c | 6 +- rostests/winetests/user32/static.c | 22 +- rostests/winetests/user32/sysparams.c | 3 +- rostests/winetests/user32/uitools.c | 50 ++ rostests/winetests/user32/win.c | 686 ++++++++++++++----------- rostests/winetests/user32/winstation.c | 488 +++++++++++++++++- rostests/winetests/user32/wsprintf.c | 16 +- 19 files changed, 1732 insertions(+), 802 deletions(-) diff --git a/rostests/winetests/user32/broadcast.c b/rostests/winetests/user32/broadcast.c index f15bb375139..a18f11a9203 100644 --- a/rostests/winetests/user32/broadcast.c +++ b/rostests/winetests/user32/broadcast.c @@ -59,7 +59,7 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR static BOOL init_procs(void) { WNDCLASSA cls; - HANDLE user32 = GetModuleHandle("user32"); + HANDLE user32 = GetModuleHandleA("user32.dll"); pBroadcastA = (PBROADCAST)GetProcAddress(user32, "BroadcastSystemMessageA"); if (!pBroadcastA) pBroadcastA = (PBROADCAST)GetProcAddress(user32, "BroadcastSystemMessage"); @@ -82,7 +82,7 @@ static BOOL init_procs(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "MainWindowClass"; @@ -92,7 +92,7 @@ static BOOL init_procs(void) if (!CreateWindowExA(0, "MainWindowClass", "Main window", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP, 100, 100, 200, - 200, 0, 0, GetModuleHandle(0), NULL)) + 200, 0, 0, GetModuleHandleA(NULL), NULL)) return FALSE; return TRUE; } @@ -119,7 +119,8 @@ static void test_parameters(PBROADCAST broadcast, const char *functionname) ok(!ret || broken(ret), "Returned: %d\n", ret); if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError()); -#if 0 /* TODO: Check the hang flags */ +if (0) /* TODO: Check the hang flags */ +{ SetLastError(0xcafebabe); recips = BSM_APPLICATIONS; ret = broadcast( BSF_QUERY|(BSF_NOHANG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0 ); @@ -143,7 +144,7 @@ static void test_parameters(PBROADCAST broadcast, const char *functionname) ret = broadcast( BSF_POSTMESSAGE|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0 ); ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Returned: %d\n", ret); -#endif +} recips = BSM_APPLICATIONS; ResetEvent(hevent); @@ -204,31 +205,32 @@ static void test_parametersEx(PBROADCASTEX broadcastex) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError()); ok(!ret, "Returned: %d\n", ret); -#if 0 /* TODO: Check the hang flags */ +if (0) /* TODO: Check the hang flags */ +{ SetLastError(0xcafebabe); recips = BSM_APPLICATIONS; - ret = broadcast( BSF_QUERY|(BSF_NOHANG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); + ret = broadcastex( BSF_QUERY|(BSF_NOHANG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Returned: %d\n", ret); SetLastError(0xcafebabe); recips = BSM_APPLICATIONS; - ret = broadcast( BSF_QUERY|(BSF_NOHANG|BSF_NOTIMEOUTIFNOTHUNG), &recips, WM_NULL, 30000, 0, NULL ); + ret = broadcastex( BSF_QUERY|(BSF_NOHANG|BSF_NOTIMEOUTIFNOTHUNG), &recips, WM_NULL, 30000, 0, NULL ); ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Returned: %d\n", ret); SetLastError(0xcafebabe); recips = BSM_APPLICATIONS; - ret = broadcast( BSF_QUERY|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); + ret = broadcastex( BSF_QUERY|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Returned: %d\n", ret); SetLastError(0xcafebabe); recips = BSM_APPLICATIONS; - ret = broadcast( BSF_POSTMESSAGE|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); + ret = broadcastex( BSF_POSTMESSAGE|(BSF_NOTIMEOUTIFNOTHUNG|BSF_FORCEIFHUNG), &recips, WM_NULL, 30000, 0, NULL ); ok(0, "Last error: %08x\n", GetLastError()); ok(0, "Returned: %d\n", ret); -#endif +} recips = BSM_APPLICATIONS; ResetEvent(hevent); diff --git a/rostests/winetests/user32/clipboard.c b/rostests/winetests/user32/clipboard.c index e2e727c557d..40218be4c7a 100755 --- a/rostests/winetests/user32/clipboard.c +++ b/rostests/winetests/user32/clipboard.c @@ -270,6 +270,7 @@ static void test_synthesized(void) } static CRITICAL_SECTION clipboard_cs; +static HWND next_wnd; static LRESULT CALLBACK clipboard_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { switch(msg) { @@ -277,12 +278,19 @@ static LRESULT CALLBACK clipboard_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARA EnterCriticalSection(&clipboard_cs); LeaveCriticalSection(&clipboard_cs); break; + case WM_CHANGECBCHAIN: + if (next_wnd == (HWND)wp) + next_wnd = (HWND)lp; + else if (next_wnd) + SendMessageA(next_wnd, msg, wp, lp); + break; case WM_USER: + ChangeClipboardChain(hwnd, next_wnd); PostQuitMessage(0); break; } - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcA(hwnd, msg, wp, lp); } static DWORD WINAPI clipboard_thread(void *param) @@ -292,7 +300,7 @@ static DWORD WINAPI clipboard_thread(void *param) EnterCriticalSection(&clipboard_cs); SetLastError(0xdeadbeef); - SetClipboardViewer(win); + next_wnd = SetClipboardViewer(win); ok(GetLastError() == 0xdeadbeef, "GetLastError = %d\n", GetLastError()); LeaveCriticalSection(&clipboard_cs); @@ -307,14 +315,14 @@ static DWORD WINAPI clipboard_thread(void *param) ok(r, "CloseClipboard failed: %d\n", GetLastError()); LeaveCriticalSection(&clipboard_cs); - r = PostMessage(win, WM_USER, 0, 0); + r = PostMessageA(win, WM_USER, 0, 0); ok(r, "PostMessage failed: %d\n", GetLastError()); return 0; } static void test_messages(void) { - WNDCLASS cls; + WNDCLASSA cls; HWND win; MSG msg; HANDLE thread; @@ -324,25 +332,25 @@ static void test_messages(void) memset(&cls, 0, sizeof(cls)); cls.lpfnWndProc = clipboard_wnd_proc; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.lpszClassName = "clipboard_test"; - RegisterClass(&cls); + RegisterClassA(&cls); - win = CreateWindow("clipboard_test", NULL, 0, 0, 0, 0, 0, NULL, 0, NULL, 0); + win = CreateWindowA("clipboard_test", NULL, 0, 0, 0, 0, 0, NULL, 0, NULL, 0); ok(win != NULL, "CreateWindow failed: %d\n", GetLastError()); thread = CreateThread(NULL, 0, clipboard_thread, (void*)win, 0, &tid); ok(thread != NULL, "CreateThread failed: %d\n", GetLastError()); - while(GetMessage(&msg, NULL, 0, 0)) { + while(GetMessageA(&msg, NULL, 0, 0)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok(WaitForSingleObject(thread, INFINITE) == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); CloseHandle(thread); - UnregisterClass("clipboard_test", GetModuleHandle(0)); + UnregisterClassA("clipboard_test", GetModuleHandleA(NULL)); DeleteCriticalSection(&clipboard_cs); } diff --git a/rostests/winetests/user32/combo.c b/rostests/winetests/user32/combo.c index 3d3b945fcd0..d9875ea466c 100644 --- a/rostests/winetests/user32/combo.c +++ b/rostests/winetests/user32/combo.c @@ -60,7 +60,7 @@ static INT CALLBACK is_font_installed_proc(const LOGFONTA *elf, const TEXTMETRIC return 0; } -static int is_font_installed(const char *name) +static BOOL is_font_installed(const char *name) { HDC hdc = GetDC(NULL); BOOL ret = !EnumFontFamiliesA(hdc, name, is_font_installed_proc, 0); diff --git a/rostests/winetests/user32/cursoricon.c b/rostests/winetests/user32/cursoricon.c index 61937e8d0f6..a7c3ca47599 100644 --- a/rostests/winetests/user32/cursoricon.c +++ b/rostests/winetests/user32/cursoricon.c @@ -304,7 +304,7 @@ static BOOL (WINAPI *pGetCursorInfo)(CURSORINFO *); static BOOL (WINAPI *pGetIconInfoExA)(HICON,ICONINFOEXA *); static BOOL (WINAPI *pGetIconInfoExW)(HICON,ICONINFOEXW *); -static const int is_win64 = (sizeof(void *) > sizeof(int)); +static const BOOL is_win64 = (sizeof(void *) > sizeof(int)); static LRESULT CALLBACK callback_child(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -328,7 +328,7 @@ static LRESULT CALLBACK callback_child(HWND hwnd, UINT msg, WPARAM wParam, LPARA return 0; } - return DefWindowProc(hwnd, msg, wParam, lParam); + return DefWindowProcA(hwnd, msg, wParam, lParam); } static LRESULT CALLBACK callback_parent(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -339,12 +339,12 @@ static LRESULT CALLBACK callback_parent(HWND hwnd, UINT msg, WPARAM wParam, LPAR return TRUE; } - return DefWindowProc(hwnd, msg, wParam, lParam); + return DefWindowProcA(hwnd, msg, wParam, lParam); } static void do_child(void) { - WNDCLASS class; + WNDCLASSA class; MSG msg; BOOL ret; @@ -353,7 +353,7 @@ static void do_child(void) class.lpfnWndProc = callback_child; class.cbClsExtra = 0; class.cbWndExtra = 0; - class.hInstance = GetModuleHandle(NULL); + class.hInstance = GetModuleHandleA(NULL); class.hIcon = NULL; class.hCursor = NULL; class.hbrBackground = NULL; @@ -361,7 +361,7 @@ static void do_child(void) class.lpszClassName = "cursor_child"; SetLastError(0xdeadbeef); - ret = RegisterClass(&class); + ret = RegisterClassA(&class); ok(ret, "Failed to register window class. Error: %u\n", GetLastError()); /* Create a window. */ @@ -370,14 +370,14 @@ static void do_child(void) ok(child != 0, "CreateWindowA failed. Error: %u\n", GetLastError()); /* Let the parent know our HWND. */ - PostMessage(parent, PROC_INIT, (WPARAM) child, 0); + PostMessageA(parent, PROC_INIT, (WPARAM) child, 0); /* Receive messages. */ - while ((ret = GetMessage(&msg, 0, 0, 0))) + while ((ret = GetMessageA(&msg, 0, 0, 0))) { ok(ret != -1, "GetMessage failed. Error: %u\n", GetLastError()); TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } } @@ -386,7 +386,7 @@ static void do_parent(void) char path_name[MAX_PATH]; PROCESS_INFORMATION info; STARTUPINFOA startup; - WNDCLASS class; + WNDCLASSA class; MSG msg; BOOL ret; @@ -395,7 +395,7 @@ static void do_parent(void) class.lpfnWndProc = callback_parent; class.cbClsExtra = 0; class.cbWndExtra = 0; - class.hInstance = GetModuleHandle(NULL); + class.hInstance = GetModuleHandleA(NULL); class.hIcon = NULL; class.hCursor = NULL; class.hbrBackground = NULL; @@ -403,7 +403,7 @@ static void do_parent(void) class.lpszClassName = "cursor_parent"; SetLastError(0xdeadbeef); - ret = RegisterClass(&class); + ret = RegisterClassA(&class); ok(ret, "Failed to register window class. Error: %u\n", GetLastError()); /* Create a window. */ @@ -422,17 +422,17 @@ static void do_parent(void) child_process = info.hProcess; /* Wait for child window handle. */ - while ((child == 0) && (ret = GetMessage(&msg, parent, 0, 0))) + while ((child == 0) && (ret = GetMessageA(&msg, parent, 0, 0))) { ok(ret != -1, "GetMessage failed. Error: %u\n", GetLastError()); TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } } static void finish_child_process(void) { - SendMessage(child, WM_CLOSE, 0, 0); + SendMessageA(child, WM_CLOSE, 0, 0); winetest_wait_child_process( child_process ); CloseHandle(child_process); } @@ -462,7 +462,7 @@ static void test_child_process(void) SetCursor(cursor); /* Destroy the cursor. */ - SendMessage(child, WM_USER+1, 0, (LPARAM) cursor); + SendMessageA(child, WM_USER+1, 0, (LPARAM) cursor); } static BOOL color_match(COLORREF a, COLORREF b) @@ -486,8 +486,8 @@ static void test_CopyImage_Check(HBITMAP bitmap, UINT flags, INT copyWidth, INT ok(copy != NULL, "CopyImage() failed\n"); if (copy != NULL) { - GetObject(bitmap, sizeof(origBitmap), &origBitmap); - GetObject(copy, sizeof(copyBitmap), ©Bitmap); + GetObjectA(bitmap, sizeof(origBitmap), &origBitmap); + GetObjectA(copy, sizeof(copyBitmap), ©Bitmap); orig_is_dib = (origBitmap.bmBits != NULL); copy_is_dib = (copyBitmap.bmBits != NULL); @@ -688,7 +688,7 @@ static void test_initial_cursor(void) /* Check what handle GetCursor() returns if a cursor is not set yet. */ SetLastError(0xdeadbeef); - cursor2 = LoadCursor(NULL, IDC_WAIT); + cursor2 = LoadCursorA(NULL, (LPCSTR)IDC_WAIT); todo_wine { ok(cursor == cursor2, "cursor (%p) is not IDC_WAIT (%p).\n", cursor, cursor2); } @@ -710,7 +710,7 @@ static void test_icon_info_dbg(HICON hIcon, UINT exp_cx, UINT exp_cy, UINT exp_m ok_(__FILE__, line)(info.yHotspot == exp_cy/2, "info.yHotspot = %u\n", info.yHotspot); ok_(__FILE__, line)(info.hbmMask != 0, "info.hbmMask is NULL\n"); - ret = GetObject(info.hbmMask, sizeof(bmMask), &bmMask); + ret = GetObjectA(info.hbmMask, sizeof(bmMask), &bmMask); ok_(__FILE__, line)(ret == sizeof(bmMask), "GetObject(info.hbmMask) failed, ret %u\n", ret); if (exp_bpp == 1) @@ -725,7 +725,7 @@ static void test_icon_info_dbg(HICON hIcon, UINT exp_cx, UINT exp_cy, UINT exp_m display_bpp = GetDeviceCaps(hdc, BITSPIXEL); ReleaseDC(0, hdc); - ret = GetObject(info.hbmColor, sizeof(bmColor), &bmColor); + ret = GetObjectA(info.hbmColor, sizeof(bmColor), &bmColor); ok_(__FILE__, line)(ret == sizeof(bmColor), "GetObject(info.hbmColor) failed, ret %u\n", ret); ok_(__FILE__, line)(bmColor.bmBitsPixel == display_bpp /* XP */ || @@ -1043,7 +1043,7 @@ static void test_LoadImageBitmap(const char * test_desc, HBITMAP hbm) DWORD ret, pixel = 0; HDC hdc = GetDC(NULL); - ret = GetObject(hbm, sizeof(bm), &bm); + ret = GetObjectA(hbm, sizeof(bm), &bm); ok(ret == sizeof(bm), "GetObject returned %d\n", ret); memset(&bmi, 0, sizeof(bmi)); @@ -1219,7 +1219,7 @@ static void test_LoadImage(void) DeleteFileA("icon.ico"); /* Test a system icon */ - handle = LoadIcon( 0, IDI_HAND ); + handle = LoadIconA( 0, (LPCSTR)IDI_HAND ); ok(handle != NULL, "LoadImage() failed.\n"); if (pGetIconInfoExA) { @@ -1976,7 +1976,7 @@ static void check_DrawState_Size(HDC hdc, BOOL maskvalue, UINT32 color, int bpp, SetPixelV(hdc, 2, 2, background); /* Let DrawState calculate the size of the icon (it's 1x1) */ - DrawState(hdc, hbr, NULL, (LPARAM) hicon, 0, 1, 1, 0, 0, (DST_ICON | flags )); + DrawStateA(hdc, hbr, NULL, (LPARAM) hicon, 0, 1, 1, 0, 0, (DST_ICON | flags )); result = GetPixel(hdc, 0, 0); passed[0] = color_match(result, background); @@ -1990,7 +1990,7 @@ static void check_DrawState_Size(HDC hdc, BOOL maskvalue, UINT32 color, int bpp, * width/height 2x2 if the icon is only 1x1 pixels in size should * result in drawing it with size 1x1. The size parameters must be * ignored if a Icon has to be drawn! */ - DrawState(hdc, hbr, NULL, (LPARAM) hicon, 0, 1, 1, 2, 2, (DST_ICON | flags )); + DrawStateA(hdc, hbr, NULL, (LPARAM) hicon, 0, 1, 1, 2, 2, (DST_ICON | flags )); result = GetPixel(hdc, 0, 0); passed[1] = color_match(result, background); @@ -2026,7 +2026,7 @@ static void check_DrawState_Color(HDC hdc, BOOL maskvalue, UINT32 color, int bpp /* Set color of the pixel that will be checked afterwards */ SetPixelV(hdc, 1, 1, background); - DrawState(hdc, hbr, NULL, (LPARAM) hicon, 0, 1, 1, 0, 0, ( DST_ICON | flags )); + DrawStateA(hdc, hbr, NULL, (LPARAM) hicon, 0, 1, 1, 0, 0, ( DST_ICON | flags )); /* Check the color of the pixel is correct */ result = GetPixel(hdc, 1, 1); @@ -2095,7 +2095,7 @@ static DWORD CALLBACK set_cursor_thread( void *arg ) { HCURSOR ret; - PeekMessage( 0, 0, 0, 0, PM_NOREMOVE ); /* create a msg queue */ + PeekMessageA( 0, 0, 0, 0, PM_NOREMOVE ); /* create a msg queue */ if (parent_id) { BOOL ret = AttachThreadInput( GetCurrentThreadId(), parent_id, TRUE ); @@ -2214,7 +2214,7 @@ static DWORD CALLBACK show_cursor_thread( void *arg ) DWORD count = (DWORD_PTR)arg; int ret; - PeekMessage( 0, 0, 0, 0, PM_NOREMOVE ); /* create a msg queue */ + PeekMessageA( 0, 0, 0, 0, PM_NOREMOVE ); /* create a msg queue */ if (parent_id) { BOOL ret = AttachThreadInput( GetCurrentThreadId(), parent_id, TRUE ); @@ -2242,8 +2242,8 @@ static void test_ShowCursor(void) ok( info.flags & CURSOR_SHOWING, "cursor not shown in info\n" ); } - event_start = CreateEvent( NULL, FALSE, FALSE, NULL ); - event_next = CreateEvent( NULL, FALSE, FALSE, NULL ); + event_start = CreateEventW( NULL, FALSE, FALSE, NULL ); + event_next = CreateEventW( NULL, FALSE, FALSE, NULL ); count = ShowCursor( TRUE ); ok( count == 1, "wrong count %d\n", count ); @@ -2448,7 +2448,7 @@ static void test_DestroyCursor(void) DeleteObject(cursorInfo.hbmColor); /* Try testing DestroyCursor() now using LoadCursor() cursors. */ - cursor = LoadCursor(NULL, IDC_ARROW); + cursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); SetLastError(0xdeadbeef); ret = DestroyCursor(cursor); @@ -2463,11 +2463,11 @@ static void test_DestroyCursor(void) ok(error == 0xdeadbeef, "Last error: 0x%08x\n", error); /* Check if LoadCursor() returns the same handle with the same icon. */ - cursor2 = LoadCursor(NULL, IDC_ARROW); + cursor2 = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); ok(cursor2 == cursor, "cursor == %p, cursor2 == %p\n", cursor, cursor2); /* Check if LoadCursor() returns the same handle with a different icon. */ - cursor2 = LoadCursor(NULL, IDC_WAIT); + cursor2 = LoadCursorA(NULL, (LPCSTR)IDC_WAIT); ok(cursor2 != cursor, "cursor == %p, cursor2 == %p\n", cursor, cursor2); } diff --git a/rostests/winetests/user32/dce.c b/rostests/winetests/user32/dce.c index f75e6b30e58..dc78caf9759 100755 --- a/rostests/winetests/user32/dce.c +++ b/rostests/winetests/user32/dce.c @@ -40,7 +40,8 @@ static void test_dc_attributes(void) { HDC hdc, old_hdc; HDC hdcs[20]; - INT i, rop, def_rop, found_dc; + INT i, rop, def_rop; + BOOL found_dc; /* test cache DC */ @@ -59,7 +60,7 @@ static void test_dc_attributes(void) ReleaseDC( hwnd_cache, hdc ); old_hdc = hdc; - found_dc = 0; + found_dc = FALSE; for (i = 0; i < 20; i++) { hdc = hdcs[i] = GetDCEx( hwnd_cache, 0, DCX_USESTYLE | DCX_NORESETATTRS ); @@ -68,7 +69,7 @@ static void test_dc_attributes(void) ok( rop == def_rop, "wrong ROP2 %d after release %p/%p\n", rop, old_hdc, hdc ); if (hdc == old_hdc) { - found_dc = 1; + found_dc = TRUE; SetROP2( hdc, R2_WHITE ); } } @@ -581,7 +582,7 @@ START_TEST(dce) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "cache_class"; diff --git a/rostests/winetests/user32/dde.c b/rostests/winetests/user32/dde.c index 4a50c39f66e..38240812a51 100755 --- a/rostests/winetests/user32/dde.c +++ b/rostests/winetests/user32/dde.c @@ -2397,8 +2397,8 @@ static HDDEDATA CALLBACK server_end_to_end_callback(UINT uType, UINT uFmt, HCONV char str[MAX_PATH]; static int msg_index = 0; static HCONV conversation = 0; - static char test_service [] = "TestDDEService"; - static char test_topic [] = "TestDDETopic"; + static const char test_service [] = "TestDDEService"; + static const char test_topic [] = "TestDDETopic"; msg_index++; @@ -2586,10 +2586,10 @@ static void test_end_to_end_client(BOOL type_a) HSZ server, topic; HCONV hconv; HDDEDATA hdata; - static char test_service[] = "TestDDEService"; - static WCHAR test_service_w[] = {'T','e','s','t','D','D','E','S','e','r','v','i','c','e',0}; - static char test_topic[] = "TestDDETopic"; - static WCHAR test_topic_w[] = {'T','e','s','t','D','D','E','T','o','p','i','c',0}; + static const char test_service[] = "TestDDEService"; + static const WCHAR test_service_w[] = {'T','e','s','t','D','D','E','S','e','r','v','i','c','e',0}; + static const char test_topic[] = "TestDDETopic"; + static const WCHAR test_topic_w[] = {'T','e','s','t','D','D','E','T','o','p','i','c',0}; trace("Start end to end client %s\n", type_a ? "ASCII" : "UNICODE"); @@ -2651,7 +2651,7 @@ static void test_end_to_end_server(HANDLE hproc, HANDLE hthread, BOOL type_a) BOOL ret; DWORD res; HDDEDATA hdata; - static CHAR test_service[] = "TestDDEService"; + static const char test_service[] = "TestDDEService"; trace("start end to end server %s\n", type_a ? "ASCII" : "UNICODE"); server_pid = 0; diff --git a/rostests/winetests/user32/dialog.c b/rostests/winetests/user32/dialog.c index 537bb4523bb..403b9a48356 100755 --- a/rostests/winetests/user32/dialog.c +++ b/rostests/winetests/user32/dialog.c @@ -54,7 +54,7 @@ static HWND g_hwndInitialFocusT1, g_hwndInitialFocusT2, g_hwndInitialFocusGroupB static LONG g_styleInitialFocusT1, g_styleInitialFocusT2; static BOOL g_bInitialFocusInitDlgResult, g_bReceivedCommand; -static int g_terminated; +static BOOL g_terminated; typedef struct { INT_PTR id; diff --git a/rostests/winetests/user32/input.c b/rostests/winetests/user32/input.c index a8de5c8226b..7d039e00889 100755 --- a/rostests/winetests/user32/input.c +++ b/rostests/winetests/user32/input.c @@ -246,7 +246,7 @@ static BOOL do_test( HWND hwnd, int seqnr, const KEV td[] ) if (winetest_debug > 1) trace("======== key stroke sequence #%d: %s =============\n", seqnr + 1, buf); - while( PeekMessage(&msg,hwnd,WM_KEYFIRST,WM_KEYLAST,PM_REMOVE) ) { + while( PeekMessageA(&msg,hwnd,WM_KEYFIRST,WM_KEYLAST,PM_REMOVE) ) { if (winetest_debug > 1) trace("message[%d] %-15s wParam %04lx lParam %08lx time %x\n", i, MSGNAME[msg.message - WM_KEYFIRST], msg.wParam, msg.lParam, msg.time); @@ -344,8 +344,8 @@ static void test_Input_whitebox(void) wclass.style = CS_HREDRAW | CS_VREDRAW; wclass.lpfnWndProc = WndProc; wclass.hInstance = hInstance; - wclass.hIcon = LoadIconA( 0, IDI_APPLICATION ); - wclass.hCursor = LoadCursorA( NULL, IDC_ARROW ); + wclass.hIcon = LoadIconA( 0, (LPCSTR)IDI_APPLICATION ); + wclass.hCursor = LoadCursorA( NULL, (LPCSTR)IDC_ARROW ); wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 ); wclass.lpszMenuName = 0; wclass.cbClsExtra = 0; @@ -362,7 +362,7 @@ static void test_Input_whitebox(void) UpdateWindow( hWndTest); /* flush pending messages */ - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); SetFocus( hWndTest ); TestSysKeys( hWndTest ); @@ -390,13 +390,13 @@ static void empty_message_queue(void) while (diff > 0) { if (MsgWaitForMultipleObjects(0, NULL, FALSE, min_timeout, QS_ALLINPUT) == WAIT_TIMEOUT) break; - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) { if (is_keyboard_message(msg.message) || is_mouse_message(msg.message)) ok(msg.time != 0, "message %#x has time set to 0\n", msg.message); TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } diff = time - GetTickCount(); } @@ -437,83 +437,83 @@ static const struct sendinput_test_s { } sendinput_test[] = { /* test ALT+F */ /* 0 */ - {VK_LMENU, 0, 0, {{VK_MENU, 0x00}, {VK_LMENU, 0x00}, {0}}, + {VK_LMENU, 0, FALSE, {{VK_MENU, 0x00}, {VK_LMENU, 0x00}, {0}}, {{WM_SYSKEYDOWN, hook|wparam, VK_LMENU}, {WM_SYSKEYDOWN}, {0}}}, - {'F', 0, 0, {{'F', 0x00}, {0}}, + {'F', 0, FALSE, {{'F', 0x00}, {0}}, {{WM_SYSKEYDOWN, hook}, {WM_SYSKEYDOWN}, {WM_SYSCHAR}, {WM_SYSCOMMAND}, {0}}}, - {'F', KEYEVENTF_KEYUP, 0, {{'F', 0x80}, {0}}, + {'F', KEYEVENTF_KEYUP, FALSE, {{'F', 0x80}, {0}}, {{WM_SYSKEYUP, hook}, {WM_SYSKEYUP}, {0}}}, - {VK_LMENU, KEYEVENTF_KEYUP, 0, {{VK_MENU, 0x80}, {VK_LMENU, 0x80}, {0}}, + {VK_LMENU, KEYEVENTF_KEYUP, FALSE, {{VK_MENU, 0x80}, {VK_LMENU, 0x80}, {0}}, {{WM_KEYUP, hook}, {WM_KEYUP}, {0}}}, /* test CTRL+O */ /* 4 */ - {VK_LCONTROL, 0, 0, {{VK_CONTROL, 0x00}, {VK_LCONTROL, 0x00}, {0}}, + {VK_LCONTROL, 0, FALSE, {{VK_CONTROL, 0x00}, {VK_LCONTROL, 0x00}, {0}}, {{WM_KEYDOWN, hook}, {WM_KEYDOWN}, {0}}}, - {'O', 0, 0, {{'O', 0x00}, {0}}, + {'O', 0, FALSE, {{'O', 0x00}, {0}}, {{WM_KEYDOWN, hook}, {WM_KEYDOWN}, {WM_CHAR}, {0}}}, - {'O', KEYEVENTF_KEYUP, 0, {{'O', 0x80}, {0}}, + {'O', KEYEVENTF_KEYUP, FALSE, {{'O', 0x80}, {0}}, {{WM_KEYUP, hook}, {WM_KEYUP}, {0}}}, - {VK_LCONTROL, KEYEVENTF_KEYUP, 0, {{VK_CONTROL, 0x80}, {VK_LCONTROL, 0x80}, {0}}, + {VK_LCONTROL, KEYEVENTF_KEYUP, FALSE, {{VK_CONTROL, 0x80}, {VK_LCONTROL, 0x80}, {0}}, {{WM_KEYUP, hook}, {WM_KEYUP}, {0}}}, /* test ALT+CTRL+X */ /* 8 */ - {VK_LMENU, 0, 0, {{VK_MENU, 0x00}, {VK_LMENU, 0x00}, {0}}, + {VK_LMENU, 0, FALSE, {{VK_MENU, 0x00}, {VK_LMENU, 0x00}, {0}}, {{WM_SYSKEYDOWN, hook}, {WM_SYSKEYDOWN}, {0}}}, - {VK_LCONTROL, 0, 0, {{VK_CONTROL, 0x00}, {VK_LCONTROL, 0x00}, {0}}, + {VK_LCONTROL, 0, FALSE, {{VK_CONTROL, 0x00}, {VK_LCONTROL, 0x00}, {0}}, {{WM_KEYDOWN, hook}, {WM_KEYDOWN}, {0}}}, - {'X', 0, 0, {{'X', 0x00}, {0}}, + {'X', 0, FALSE, {{'X', 0x00}, {0}}, {{WM_KEYDOWN, hook}, {WM_KEYDOWN}, {0}}}, - {'X', KEYEVENTF_KEYUP, 0, {{'X', 0x80}, {0}}, + {'X', KEYEVENTF_KEYUP, FALSE, {{'X', 0x80}, {0}}, {{WM_KEYUP, hook}, {WM_KEYUP}, {0}}}, - {VK_LCONTROL, KEYEVENTF_KEYUP, 0, {{VK_CONTROL, 0x80}, {VK_LCONTROL, 0x80}, {0}}, + {VK_LCONTROL, KEYEVENTF_KEYUP, FALSE, {{VK_CONTROL, 0x80}, {VK_LCONTROL, 0x80}, {0}}, {{WM_SYSKEYUP, hook}, {WM_SYSKEYUP}, {0}}}, - {VK_LMENU, KEYEVENTF_KEYUP, 0, {{VK_MENU, 0x80}, {VK_LMENU, 0x80}, {0}}, + {VK_LMENU, KEYEVENTF_KEYUP, FALSE, {{VK_MENU, 0x80}, {VK_LMENU, 0x80}, {0}}, {{WM_KEYUP, hook}, {WM_KEYUP}, {0}}}, /* test SHIFT+A */ /* 14 */ - {VK_LSHIFT, 0, 0, {{VK_SHIFT, 0x00}, {VK_LSHIFT, 0x00}, {0}}, + {VK_LSHIFT, 0, FALSE, {{VK_SHIFT, 0x00}, {VK_LSHIFT, 0x00}, {0}}, {{WM_KEYDOWN, hook}, {WM_KEYDOWN}, {0}}}, - {'A', 0, 0, {{'A', 0x00}, {0}}, + {'A', 0, FALSE, {{'A', 0x00}, {0}}, {{WM_KEYDOWN, hook}, {WM_KEYDOWN}, {WM_CHAR}, {0}}}, - {'A', KEYEVENTF_KEYUP, 0, {{'A', 0x80}, {0}}, + {'A', KEYEVENTF_KEYUP, FALSE, {{'A', 0x80}, {0}}, {{WM_KEYUP, hook}, {WM_KEYUP}, {0}}}, - {VK_LSHIFT, KEYEVENTF_KEYUP, 0, {{VK_SHIFT, 0x80}, {VK_LSHIFT, 0x80}, {0}}, + {VK_LSHIFT, KEYEVENTF_KEYUP, FALSE, {{VK_SHIFT, 0x80}, {VK_LSHIFT, 0x80}, {0}}, {{WM_KEYUP, hook}, {WM_KEYUP}, {0}}}, /* test L-SHIFT & R-SHIFT: */ /* RSHIFT == LSHIFT */ /* 18 */ - {VK_RSHIFT, 0, 0, + {VK_RSHIFT, 0, FALSE, /* recent windows versions (>= w2k3) correctly report an RSHIFT transition */ {{VK_SHIFT, 0x00}, {VK_LSHIFT, 0x00, TRUE}, {VK_RSHIFT, 0x00, TRUE}, {0}}, {{WM_KEYDOWN, hook|wparam, VK_RSHIFT}, {WM_KEYDOWN}, {0}}}, - {VK_RSHIFT, KEYEVENTF_KEYUP, 0, + {VK_RSHIFT, KEYEVENTF_KEYUP, FALSE, {{VK_SHIFT, 0x80}, {VK_LSHIFT, 0x80, TRUE}, {VK_RSHIFT, 0x80, TRUE}, {0}}, {{WM_KEYUP, hook, hook|wparam, VK_RSHIFT}, {WM_KEYUP}, {0}}}, /* LSHIFT | KEYEVENTF_EXTENDEDKEY == RSHIFT */ /* 20 */ - {VK_LSHIFT, KEYEVENTF_EXTENDEDKEY, 0, + {VK_LSHIFT, KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_SHIFT, 0x00}, {VK_RSHIFT, 0x00}, {0}}, {{WM_KEYDOWN, hook|wparam|lparam, VK_LSHIFT, LLKHF_EXTENDED}, {WM_KEYDOWN, wparam|lparam, VK_SHIFT, 0}, {0}}}, - {VK_LSHIFT, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, 0, + {VK_LSHIFT, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_SHIFT, 0x80}, {VK_RSHIFT, 0x80}, {0}}, {{WM_KEYUP, hook|wparam|lparam, VK_LSHIFT, LLKHF_UP|LLKHF_EXTENDED}, {WM_KEYUP, wparam|lparam, VK_SHIFT, KF_UP}, {0}}}, /* RSHIFT | KEYEVENTF_EXTENDEDKEY == RSHIFT */ /* 22 */ - {VK_RSHIFT, KEYEVENTF_EXTENDEDKEY, 0, + {VK_RSHIFT, KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_SHIFT, 0x00}, {VK_RSHIFT, 0x00}, {0}}, {{WM_KEYDOWN, hook|wparam|lparam, VK_RSHIFT, LLKHF_EXTENDED}, {WM_KEYDOWN, wparam|lparam, VK_SHIFT, 0}, {0}}}, - {VK_RSHIFT, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, 0, + {VK_RSHIFT, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_SHIFT, 0x80}, {VK_RSHIFT, 0x80}, {0}}, {{WM_KEYUP, hook|wparam|lparam, VK_RSHIFT, LLKHF_UP|LLKHF_EXTENDED}, {WM_KEYUP, wparam|lparam, VK_SHIFT, KF_UP}, {0}}}, @@ -524,21 +524,21 @@ static const struct sendinput_test_s { */ /* SHIFT == LSHIFT */ /* 24 */ - {VK_SHIFT, 0, 0, + {VK_SHIFT, 0, FALSE, {{VK_SHIFT, 0x00}, {VK_LSHIFT, 0x00}, {0}}, {{WM_KEYDOWN, hook/* |wparam */|lparam, VK_SHIFT, 0}, {WM_KEYDOWN, wparam|lparam, VK_SHIFT, 0}, {0}}}, - {VK_SHIFT, KEYEVENTF_KEYUP, 0, + {VK_SHIFT, KEYEVENTF_KEYUP, FALSE, {{VK_SHIFT, 0x80}, {VK_LSHIFT, 0x80}, {0}}, {{WM_KEYUP, hook/*|wparam*/|lparam, VK_SHIFT, LLKHF_UP}, {WM_KEYUP, wparam|lparam, VK_SHIFT, KF_UP}, {0}}}, /* SHIFT | KEYEVENTF_EXTENDEDKEY == RSHIFT */ /* 26 */ - {VK_SHIFT, KEYEVENTF_EXTENDEDKEY, 0, + {VK_SHIFT, KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_SHIFT, 0x00}, {VK_RSHIFT, 0x00}, {0}}, {{WM_KEYDOWN, hook/*|wparam*/|lparam, VK_SHIFT, LLKHF_EXTENDED}, {WM_KEYDOWN, wparam|lparam, VK_SHIFT, 0}, {0}}}, - {VK_SHIFT, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, 0, + {VK_SHIFT, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_SHIFT, 0x80}, {VK_RSHIFT, 0x80}, {0}}, {{WM_KEYUP, hook/*|wparam*/|lparam, VK_SHIFT, LLKHF_UP|LLKHF_EXTENDED}, {WM_KEYUP, wparam|lparam, VK_SHIFT, KF_UP}, {0}}}, @@ -546,51 +546,51 @@ static const struct sendinput_test_s { /* test L-CONTROL & R-CONTROL: */ /* RCONTROL == LCONTROL */ /* 28 */ - {VK_RCONTROL, 0, 0, + {VK_RCONTROL, 0, FALSE, {{VK_CONTROL, 0x00}, {VK_LCONTROL, 0x00}, {0}}, {{WM_KEYDOWN, hook|wparam, VK_RCONTROL}, {WM_KEYDOWN, wparam|lparam, VK_CONTROL, 0}, {0}}}, - {VK_RCONTROL, KEYEVENTF_KEYUP, 0, + {VK_RCONTROL, KEYEVENTF_KEYUP, FALSE, {{VK_CONTROL, 0x80}, {VK_LCONTROL, 0x80}, {0}}, {{WM_KEYUP, hook|wparam, VK_RCONTROL}, {WM_KEYUP, wparam|lparam, VK_CONTROL, KF_UP}, {0}}}, /* LCONTROL | KEYEVENTF_EXTENDEDKEY == RCONTROL */ /* 30 */ - {VK_LCONTROL, KEYEVENTF_EXTENDEDKEY, 0, + {VK_LCONTROL, KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_CONTROL, 0x00}, {VK_RCONTROL, 0x00}, {0}}, {{WM_KEYDOWN, hook|wparam|lparam, VK_LCONTROL, LLKHF_EXTENDED}, {WM_KEYDOWN, wparam|lparam, VK_CONTROL, KF_EXTENDED}, {0}}}, - {VK_LCONTROL, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, 0, + {VK_LCONTROL, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_CONTROL, 0x80}, {VK_RCONTROL, 0x80}, {0}}, {{WM_KEYUP, hook|wparam|lparam, VK_LCONTROL, LLKHF_UP|LLKHF_EXTENDED}, {WM_KEYUP, wparam|lparam, VK_CONTROL, KF_UP|KF_EXTENDED}, {0}}}, /* RCONTROL | KEYEVENTF_EXTENDEDKEY == RCONTROL */ /* 32 */ - {VK_RCONTROL, KEYEVENTF_EXTENDEDKEY, 0, + {VK_RCONTROL, KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_CONTROL, 0x00}, {VK_RCONTROL, 0x00}, {0}}, {{WM_KEYDOWN, hook|wparam|lparam, VK_RCONTROL, LLKHF_EXTENDED}, {WM_KEYDOWN, wparam|lparam, VK_CONTROL, KF_EXTENDED}, {0}}}, - {VK_RCONTROL, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, 0, + {VK_RCONTROL, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_CONTROL, 0x80}, {VK_RCONTROL, 0x80}, {0}}, {{WM_KEYUP, hook|wparam|lparam, VK_RCONTROL, LLKHF_UP|LLKHF_EXTENDED}, {WM_KEYUP, wparam|lparam, VK_CONTROL, KF_UP|KF_EXTENDED}, {0}}}, /* CONTROL == LCONTROL */ /* 34 */ - {VK_CONTROL, 0, 0, + {VK_CONTROL, 0, FALSE, {{VK_CONTROL, 0x00}, {VK_LCONTROL, 0x00}, {0}}, {{WM_KEYDOWN, hook/*|wparam, VK_CONTROL*/}, {WM_KEYDOWN, wparam|lparam, VK_CONTROL, 0}, {0}}}, - {VK_CONTROL, KEYEVENTF_KEYUP, 0, + {VK_CONTROL, KEYEVENTF_KEYUP, FALSE, {{VK_CONTROL, 0x80}, {VK_LCONTROL, 0x80}, {0}}, {{WM_KEYUP, hook/*|wparam, VK_CONTROL*/}, {WM_KEYUP, wparam|lparam, VK_CONTROL, KF_UP}, {0}}}, /* CONTROL | KEYEVENTF_EXTENDEDKEY == RCONTROL */ /* 36 */ - {VK_CONTROL, KEYEVENTF_EXTENDEDKEY, 0, + {VK_CONTROL, KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_CONTROL, 0x00}, {VK_RCONTROL, 0x00}, {0}}, {{WM_KEYDOWN, hook/*|wparam*/|lparam, VK_CONTROL, LLKHF_EXTENDED}, {WM_KEYDOWN, wparam|lparam, VK_CONTROL, KF_EXTENDED}, {0}}}, - {VK_CONTROL, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, 0, + {VK_CONTROL, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_CONTROL, 0x80}, {VK_RCONTROL, 0x80}, {0}}, {{WM_KEYUP, hook/*|wparam*/|lparam, VK_CONTROL, LLKHF_UP|LLKHF_EXTENDED}, {WM_KEYUP, wparam|lparam, VK_CONTROL, KF_UP|KF_EXTENDED}, {0}}}, @@ -598,13 +598,13 @@ static const struct sendinput_test_s { /* test L-MENU & R-MENU: */ /* RMENU == LMENU */ /* 38 */ - {VK_RMENU, 0, 0, + {VK_RMENU, 0, FALSE, {{VK_MENU, 0x00}, {VK_LMENU, 0x00}, {VK_CONTROL, 0x00, 1}, {VK_LCONTROL, 0x01, 1}, {0}}, {{WM_SYSKEYDOWN, hook|wparam|optional, VK_LCONTROL}, {WM_SYSKEYDOWN, hook|wparam, VK_RMENU}, {WM_KEYDOWN, wparam|lparam|optional, VK_CONTROL, 0}, {WM_SYSKEYDOWN, wparam|lparam, VK_MENU, 0}, {0}}}, - {VK_RMENU, KEYEVENTF_KEYUP, 1, + {VK_RMENU, KEYEVENTF_KEYUP, TRUE, {{VK_MENU, 0x80}, {VK_LMENU, 0x80}, {VK_CONTROL, 0x81, 1}, {VK_LCONTROL, 0x80, 1}, {0}}, {{WM_KEYUP, hook|wparam|optional, VK_LCONTROL}, {WM_KEYUP, hook|wparam, VK_RMENU}, @@ -613,24 +613,24 @@ static const struct sendinput_test_s { {WM_SYSCOMMAND, optional}, {0}}}, /* LMENU | KEYEVENTF_EXTENDEDKEY == RMENU */ /* 40 */ - {VK_LMENU, KEYEVENTF_EXTENDEDKEY, 0, + {VK_LMENU, KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_MENU, 0x00}, {VK_RMENU, 0x00}, {0}}, {{WM_SYSKEYDOWN, hook|wparam|lparam, VK_LMENU, LLKHF_EXTENDED}, {WM_SYSKEYDOWN, wparam|lparam, VK_MENU, KF_EXTENDED}, {0}}}, - {VK_LMENU, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, 1, + {VK_LMENU, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, TRUE, {{VK_MENU, 0x80}, {VK_RMENU, 0x80}, {0}}, {{WM_KEYUP, hook|wparam|lparam, VK_LMENU, LLKHF_UP|LLKHF_EXTENDED}, {WM_SYSKEYUP, wparam|lparam, VK_MENU, KF_UP|KF_EXTENDED}, {WM_SYSCOMMAND}, {0}}}, /* RMENU | KEYEVENTF_EXTENDEDKEY == RMENU */ /* 42 */ - {VK_RMENU, KEYEVENTF_EXTENDEDKEY, 0, + {VK_RMENU, KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_MENU, 0x00}, {VK_RMENU, 0x00}, {VK_CONTROL, 0x00, 1}, {VK_LCONTROL, 0x01, 1}, {0}}, {{WM_SYSKEYDOWN, hook|wparam|lparam|optional, VK_LCONTROL, 0}, {WM_SYSKEYDOWN, hook|wparam|lparam, VK_RMENU, LLKHF_EXTENDED}, {WM_KEYDOWN, wparam|lparam|optional, VK_CONTROL, 0}, {WM_SYSKEYDOWN, wparam|lparam, VK_MENU, KF_EXTENDED}, {0}}}, - {VK_RMENU, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, 1, + {VK_RMENU, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, TRUE, {{VK_MENU, 0x80}, {VK_RMENU, 0x80}, {VK_CONTROL, 0x81, 1}, {VK_LCONTROL, 0x80, 1}, {0}}, {{WM_KEYUP, hook|wparam|lparam|optional, VK_LCONTROL, LLKHF_UP}, {WM_KEYUP, hook|wparam|lparam, VK_RMENU, LLKHF_UP|LLKHF_EXTENDED}, @@ -639,23 +639,23 @@ static const struct sendinput_test_s { {WM_SYSCOMMAND, optional}, {0}}}, /* MENU == LMENU */ /* 44 */ - {VK_MENU, 0, 0, + {VK_MENU, 0, FALSE, {{VK_MENU, 0x00}, {VK_LMENU, 0x00}, {0}}, {{WM_SYSKEYDOWN, hook/*|wparam, VK_MENU*/}, {WM_SYSKEYDOWN, wparam|lparam, VK_MENU, 0}, {0}}}, - {VK_MENU, KEYEVENTF_KEYUP, 1, + {VK_MENU, KEYEVENTF_KEYUP, TRUE, {{VK_MENU, 0x80}, {VK_LMENU, 0x80}, {0}}, {{WM_KEYUP, hook/*|wparam, VK_MENU*/}, {WM_SYSKEYUP, wparam|lparam, VK_MENU, KF_UP}, {WM_SYSCOMMAND}, {0}}}, /* MENU | KEYEVENTF_EXTENDEDKEY == RMENU */ /* 46 */ - {VK_MENU, KEYEVENTF_EXTENDEDKEY, 0, + {VK_MENU, KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_MENU, 0x00}, {VK_RMENU, 0x00}, {VK_CONTROL, 0x00, 1}, {VK_LCONTROL, 0x01, 1}, {0}}, {{WM_SYSKEYDOWN, hook|wparam|lparam|optional, VK_CONTROL, 0}, {WM_SYSKEYDOWN, hook/*|wparam*/|lparam, VK_MENU, LLKHF_EXTENDED}, {WM_SYSKEYDOWN, wparam|lparam, VK_MENU, KF_EXTENDED}, {0}}}, - {VK_MENU, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, 1, + {VK_MENU, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, TRUE, {{VK_MENU, 0x80}, {VK_RMENU, 0x80}, {VK_CONTROL, 0x81, 1}, {VK_LCONTROL, 0x80, 1}, {0}}, {{WM_KEYUP, hook|wparam|lparam|optional, VK_CONTROL, LLKHF_UP}, {WM_KEYUP, hook/*|wparam*/|lparam, VK_MENU, LLKHF_UP|LLKHF_EXTENDED}, @@ -664,24 +664,24 @@ static const struct sendinput_test_s { /* test LSHIFT & RSHIFT */ /* 48 */ - {VK_LSHIFT, 0, 0, + {VK_LSHIFT, 0, FALSE, {{VK_SHIFT, 0x00}, {VK_LSHIFT, 0x00}, {0}}, {{WM_KEYDOWN, hook|wparam|lparam, VK_LSHIFT, 0}, {WM_KEYDOWN, wparam|lparam, VK_SHIFT, 0}, {0}}}, - {VK_RSHIFT, KEYEVENTF_EXTENDEDKEY, 0, + {VK_RSHIFT, KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_RSHIFT, 0x00}, {0}}, {{WM_KEYDOWN, hook|wparam|lparam, VK_RSHIFT, LLKHF_EXTENDED}, {WM_KEYDOWN, wparam|lparam, VK_SHIFT, 0}, {0}}}, - {VK_RSHIFT, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, 0, + {VK_RSHIFT, KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY, FALSE, {{VK_RSHIFT, 0x80}, {0}}, {{WM_KEYUP, hook|wparam|lparam, VK_RSHIFT, LLKHF_UP|LLKHF_EXTENDED}, {WM_KEYUP, optional}, {0}}}, - {VK_LSHIFT, KEYEVENTF_KEYUP, 0, + {VK_LSHIFT, KEYEVENTF_KEYUP, FALSE, {{VK_SHIFT, 0x80}, {VK_LSHIFT, 0x80}, {0}}, {{WM_KEYUP, hook|wparam, VK_LSHIFT}, {WM_KEYUP, wparam|lparam, VK_SHIFT, KF_UP}, {0}}}, - {0, 0, 0, {{0}}, {{0}}} /* end */ + {0, 0, FALSE, {{0}}, {{0}}} /* end */ }; static struct message sent_messages[MAXKEYMESSAGES]; @@ -696,7 +696,7 @@ static void compare_and_check(int id, BYTE *ks1, BYTE *ks2, const struct sendinp const struct message *expected = test->expected_messages; while (t->wVk) { - int matched = ((ks1[t->wVk]&0x80) == (t->before_state&0x80) + BOOL matched = ((ks1[t->wVk]&0x80) == (t->before_state&0x80) && (ks2[t->wVk]&0x80) == (~t->before_state&0x80)); if (!matched && !t->optional && test->_todo_wine) @@ -865,7 +865,7 @@ static LRESULT CALLBACK WndProc2(HWND hWnd, UINT Msg, WPARAM wParam, sent_messages[sent_messages_cnt++].lParam = HIWORD(lParam) & (KF_UP|KF_EXTENDED); } } - return DefWindowProc(hWnd, Msg, wParam, lParam); + return DefWindowProcA(hWnd, Msg, wParam, lParam); } static LRESULT CALLBACK hook_proc(int code, WPARAM wparam, LPARAM lparam) @@ -911,7 +911,7 @@ static void test_Input_blackbox(void) skip("Skipping Input_blackbox test on non-US keyboard\n"); return; } - window = CreateWindow("Static", NULL, WS_POPUP|WS_HSCROLL|WS_VSCROLL + window = CreateWindowA("Static", NULL, WS_POPUP|WS_HSCROLL|WS_VSCROLL |WS_VISIBLE, 0, 0, 200, 60, NULL, NULL, NULL, NULL); ok(window != NULL, "error: %d\n", (int) GetLastError()); @@ -929,7 +929,7 @@ static void test_Input_blackbox(void) * key state set by SendInput(). */ empty_message_queue(); - prevWndProc = SetWindowLongPtr(window, GWLP_WNDPROC, (LONG_PTR) WndProc2); + prevWndProc = SetWindowLongPtrA(window, GWLP_WNDPROC, (LONG_PTR) WndProc2); ok(prevWndProc != 0 || (prevWndProc == 0 && GetLastError() == 0), "error: %d\n", (int) GetLastError()); @@ -1160,8 +1160,8 @@ static void test_Input_unicode(void) wclass.style = CS_HREDRAW | CS_VREDRAW; wclass.lpfnWndProc = unicode_wnd_proc; wclass.hInstance = hInstance; - wclass.hIcon = LoadIcon(0, IDI_APPLICATION); - wclass.hCursor = LoadCursor( NULL, IDC_ARROW); + wclass.hIcon = LoadIconW(0, (LPCWSTR)IDI_APPLICATION); + wclass.hCursor = LoadCursorW( NULL, (LPCWSTR)IDC_ARROW); wclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wclass.lpszMenuName = 0; wclass.cbClsExtra = 0; @@ -1171,7 +1171,7 @@ static void test_Input_unicode(void) return; } - hModuleImm32 = LoadLibrary("imm32.dll"); + hModuleImm32 = LoadLibraryA("imm32.dll"); if (hModuleImm32) { pImmDisableIME = (void *)GetProcAddress(hModuleImm32, "ImmDisableIME"); if (pImmDisableIME) @@ -1280,7 +1280,7 @@ static void test_mouse_ll_hook(void) RECT rc; GetCursorPos(&pt_org); - hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 10, 10, 200, 200, NULL, NULL, NULL, NULL); SetCursorPos(100, 100); @@ -1503,34 +1503,34 @@ static void test_key_map(void) { VK_NUMPAD9, VK_PRIOR }, }; - s = MapVirtualKeyEx(VK_SHIFT, MAPVK_VK_TO_VSC, kl); + s = MapVirtualKeyExA(VK_SHIFT, MAPVK_VK_TO_VSC, kl); ok(s != 0, "MapVirtualKeyEx(VK_SHIFT) should return non-zero\n"); - sL = MapVirtualKeyEx(VK_LSHIFT, MAPVK_VK_TO_VSC, kl); + sL = MapVirtualKeyExA(VK_LSHIFT, MAPVK_VK_TO_VSC, kl); ok(s == sL || broken(sL == 0), /* win9x */ "%x != %x\n", s, sL); - kL = MapVirtualKeyEx(0x2a, MAPVK_VSC_TO_VK, kl); + kL = MapVirtualKeyExA(0x2a, MAPVK_VSC_TO_VK, kl); ok(kL == VK_SHIFT, "Scan code -> vKey = %x (not VK_SHIFT)\n", kL); - kR = MapVirtualKeyEx(0x36, MAPVK_VSC_TO_VK, kl); + kR = MapVirtualKeyExA(0x36, MAPVK_VSC_TO_VK, kl); ok(kR == VK_SHIFT, "Scan code -> vKey = %x (not VK_SHIFT)\n", kR); - kL = MapVirtualKeyEx(0x2a, MAPVK_VSC_TO_VK_EX, kl); + kL = MapVirtualKeyExA(0x2a, MAPVK_VSC_TO_VK_EX, kl); ok(kL == VK_LSHIFT || broken(kL == 0), /* win9x */ "Scan code -> vKey = %x (not VK_LSHIFT)\n", kL); - kR = MapVirtualKeyEx(0x36, MAPVK_VSC_TO_VK_EX, kl); + kR = MapVirtualKeyExA(0x36, MAPVK_VSC_TO_VK_EX, kl); ok(kR == VK_RSHIFT || broken(kR == 0), /* win9x */ "Scan code -> vKey = %x (not VK_RSHIFT)\n", kR); /* test that MAPVK_VSC_TO_VK prefers the non-numpad vkey if there's ambiguity */ for (i = 0; i < sizeof(numpad_collisions)/sizeof(numpad_collisions[0]); i++) { - UINT numpad_scan = MapVirtualKeyEx(numpad_collisions[i][0], MAPVK_VK_TO_VSC, kl); - UINT other_scan = MapVirtualKeyEx(numpad_collisions[i][1], MAPVK_VK_TO_VSC, kl); + UINT numpad_scan = MapVirtualKeyExA(numpad_collisions[i][0], MAPVK_VK_TO_VSC, kl); + UINT other_scan = MapVirtualKeyExA(numpad_collisions[i][1], MAPVK_VK_TO_VSC, kl); /* do they really collide for this layout? */ if (numpad_scan && other_scan == numpad_scan) { - UINT vkey = MapVirtualKeyEx(numpad_scan, MAPVK_VSC_TO_VK, kl); + UINT vkey = MapVirtualKeyExA(numpad_scan, MAPVK_VSC_TO_VK, kl); ok(vkey != numpad_collisions[i][0], "Got numpad vKey %x for scan code %x when there was another choice\n", vkey, numpad_scan); diff --git a/rostests/winetests/user32/menu.c b/rostests/winetests/user32/menu.c index e8f2d0f75b7..23922053b08 100755 --- a/rostests/winetests/user32/menu.c +++ b/rostests/winetests/user32/menu.c @@ -64,15 +64,15 @@ static void init_function_pointers(void) static BOOL correct_behavior(void) { HMENU hmenu; - MENUITEMINFO info; + MENUITEMINFOA info; BOOL rc; hmenu = CreateMenu(); - memset(&info, 0, sizeof(MENUITEMINFO)); - info.cbSize= sizeof(MENUITEMINFO); + memset(&info, 0, sizeof(MENUITEMINFOA)); + info.cbSize= sizeof(MENUITEMINFOA); SetLastError(0xdeadbeef); - rc = GetMenuItemInfo(hmenu, 0, TRUE, &info); + rc = GetMenuItemInfoA(hmenu, 0, TRUE, &info); /* Win9x : 0xdeadbeef * NT4 : ERROR_INVALID_PARAMETER * >= W2K : ERROR_MENU_ITEM_NOT_FOUND @@ -94,12 +94,12 @@ static LRESULT WINAPI menu_check_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LP { case WM_ENTERMENULOOP: /* mark window as having entered menu loop */ - SetWindowLongPtr(hwnd, GWLP_USERDATA, TRUE); + SetWindowLongPtrA(hwnd, GWLP_USERDATA, TRUE); /* exit menu modal loop * ( A SendMessage does not work on NT3.51 here ) */ - return PostMessage(hwnd, WM_CANCELMODE, 0, 0); + return PostMessageA(hwnd, WM_CANCELMODE, 0, 0); } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } /* The MSVC headers ignore our NONAMELESSUNION requests so we have to define @@ -144,10 +144,13 @@ static int MOD_avec, MOD_hic; static int MOD_odheight; static SIZE MODsizes[MOD_NRMENUS]= { {MOD_SIZE, MOD_SIZE},{MOD_SIZE, MOD_SIZE}, {MOD_SIZE, MOD_SIZE},{MOD_SIZE, MOD_SIZE}}; -static int MOD_GotDrawItemMsg = FALSE; +static BOOL MOD_GotDrawItemMsg = FALSE; static int gflag_initmenupopup, gflag_entermenuloop, - gflag_initmenu; + gflag_initmenu, + gflag_enteridle; +static WPARAM selectitem_wp; +static LPARAM selectitem_lp; /* wndproc used by test_menu_ownerdraw() */ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg, @@ -182,7 +185,7 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg, case WM_DRAWITEM: { DRAWITEMSTRUCT * pdis; - TEXTMETRIC tm; + TEXTMETRICA tm; HPEN oldpen; char chrs[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; SIZE sz; @@ -212,12 +215,12 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg, strcpy( buf, MOD_txtsizes[i].text); if( ( p = strchr( buf, '\t'))) { *p = '\0'; - DrawText( pdis->hDC, p + 1, -1, &rc, + DrawTextA( pdis->hDC, p + 1, -1, &rc, DT_SINGLELINE|DT_CALCRECT); MOD_txtsizes[i].sc_size.cx= rc.right - rc.left; MOD_txtsizes[i].sc_size.cy= rc.bottom - rc.top; } - DrawText( pdis->hDC, buf, -1, &rc, + DrawTextA( pdis->hDC, buf, -1, &rc, DT_SINGLELINE|DT_CALCRECT); MOD_txtsizes[i].size.cx= rc.right - rc.left; MOD_txtsizes[i].size.cy= rc.bottom - rc.top; @@ -227,15 +230,16 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg, /* store the rectangle */ MOD_rc[pdis->itemData] = pdis->rcItem; /* calculate average character width */ - GetTextExtentPoint( pdis->hDC, chrs, 52, &sz ); + GetTextExtentPointA( pdis->hDC, chrs, 52, &sz ); MOD_avec = (sz.cx + 26)/52; - GetTextMetrics( pdis->hDC, &tm); + GetTextMetricsA( pdis->hDC, &tm); MOD_hic = tm.tmHeight; MOD_GotDrawItemMsg = TRUE; return TRUE; } case WM_ENTERIDLE: { + gflag_enteridle++; ok( lparam || broken(!lparam), /* win9x, nt4 */ "Menu window handle is NULL!\n"); if( lparam) { @@ -243,31 +247,34 @@ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg, ok( hmenupopup == hmenu, "MN_GETHMENU returns %p expected %p\n", hmenu, hmenupopup); } - PostMessage(hwnd, WM_CANCELMODE, 0, 0); + PostMessageA(hwnd, WM_CANCELMODE, 0, 0); return TRUE; } - + case WM_MENUSELECT: + selectitem_wp = wparam; + selectitem_lp = lparam; + break; } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } static void register_menu_check_class(void) { - WNDCLASS wc = + WNDCLASSA wc = { 0, menu_check_wnd_proc, 0, 0, - GetModuleHandle(NULL), + GetModuleHandleA(NULL), NULL, - LoadCursor(NULL, IDC_ARROW), + LoadCursorA(NULL, (LPCSTR)IDC_ARROW), (HBRUSH)(COLOR_BTNFACE+1), NULL, - TEXT("WineMenuCheck"), + "WineMenuCheck", }; - - atomMenuCheckClass = RegisterClass(&wc); + + atomMenuCheckClass = RegisterClassA(&wc); } static void test_getmenubarinfo(void) @@ -286,7 +293,7 @@ static void test_getmenubarinfo(void) mbi.cbSize = sizeof(MENUBARINFO); - hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL, + hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_SYSMENU | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 100, 100, NULL, NULL, NULL, NULL); ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); @@ -350,9 +357,9 @@ static void test_getmenubarinfo(void) ok(mbi.fFocused == 0, "fFocused: Got %d instead of 0.\n", mbi.fFocused); /* add some items */ - ret = AppendMenu(hmenu, MF_STRING , 100, "item 1"); + ret = AppendMenuA(hmenu, MF_STRING , 100, "item 1"); ok(ret, "AppendMenu failed.\n"); - ret = AppendMenu(hmenu, MF_STRING , 101, "item 2"); + ret = AppendMenuA(hmenu, MF_STRING , 101, "item 2"); ok(ret, "AppendMenu failed.\n"); ret = SetMenu(hwnd, hmenu); ok(ret, "SetMenu failed with error %d\n", GetLastError()); @@ -404,13 +411,13 @@ static void test_menu_locked_by_window(void) { BOOL ret; HMENU hmenu; - HWND hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL, + HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, NULL, NULL, NULL, NULL); ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); hmenu = CreateMenu(); ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); - ret = InsertMenu(hmenu, 0, MF_STRING, 0, TEXT("&Test")); + ret = InsertMenuA(hmenu, 0, MF_STRING, 0, "&Test"); ok(ret, "InsertMenu failed with error %d\n", GetLastError()); ret = SetMenu(hwnd, hmenu); ok(ret, "SetMenu failed with error %d\n", GetLastError()); @@ -418,15 +425,13 @@ static void test_menu_locked_by_window(void) ok(ret, "DestroyMenu failed with error %d\n", GetLastError()); ret = DrawMenuBar(hwnd); - todo_wine { ok(ret, "DrawMenuBar failed with error %d\n", GetLastError()); - } ret = IsMenu(GetMenu(hwnd)); ok(!ret || broken(ret) /* nt4 */, "Menu handle should have been destroyed\n"); - SendMessage(hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0); + SendMessageA(hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0); /* did we process the WM_INITMENU message? */ - ret = GetWindowLongPtr(hwnd, GWLP_USERDATA); + ret = GetWindowLongPtrA(hwnd, GWLP_USERDATA); todo_wine { ok(ret, "WM_INITMENU should have been sent\n"); } @@ -444,12 +449,12 @@ static LRESULT WINAPI subpopuplocked_wnd_proc(HWND hwnd, UINT msg, WPARAM wparam case WM_ENTERIDLE: hwndmenu = GetCapture(); if( hwndmenu) { - PostMessage( hwndmenu, WM_KEYDOWN, VK_DOWN, 0); - PostMessage( hwndmenu, WM_KEYDOWN, VK_RIGHT, 0); - PostMessage( hwndmenu, WM_KEYDOWN, VK_RETURN, 0); + PostMessageA( hwndmenu, WM_KEYDOWN, VK_DOWN, 0); + PostMessageA( hwndmenu, WM_KEYDOWN, VK_RIGHT, 0); + PostMessageA( hwndmenu, WM_KEYDOWN, VK_RETURN, 0); } } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } static void test_subpopup_locked_by_menu(void) @@ -458,7 +463,7 @@ static void test_subpopup_locked_by_menu(void) BOOL ret; HMENU hmenu, hsubmenu; MENUINFO mi = { sizeof( MENUINFO)}; - MENUITEMINFO mii = { sizeof( MENUITEMINFO)}; + MENUITEMINFOA mii = { sizeof( MENUITEMINFOA)}; HWND hwnd; const int itemid = 0x1234567; if( !pGetMenuInfo) @@ -467,23 +472,23 @@ static void test_subpopup_locked_by_menu(void) return; } /* create window, popupmenu with one subpopup */ - hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL, + hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, NULL, NULL, NULL, NULL); ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); - SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR) subpopuplocked_wnd_proc); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR) subpopuplocked_wnd_proc); hmenu = CreatePopupMenu(); ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); hsubmenu = CreatePopupMenu(); ok(hsubmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); - ret = InsertMenu(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hsubmenu, - TEXT("PopUpLockTest")); + ret = InsertMenuA(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hsubmenu, + "PopUpLockTest"); ok(ret, "InsertMenu failed with error %d\n", GetLastError()); - ret = InsertMenu(hsubmenu, 0, MF_BYPOSITION | MF_STRING, itemid, TEXT("PopUpMenu")); + ret = InsertMenuA(hsubmenu, 0, MF_BYPOSITION | MF_STRING, itemid, "PopUpMenu"); ok(ret, "InsertMenu failed with error %d\n", GetLastError()); /* first some tests that all this functions properly */ mii.fMask = MIIM_SUBMENU; - ret = GetMenuItemInfo( hmenu, 0, TRUE, &mii); + ret = GetMenuItemInfoA( hmenu, 0, TRUE, &mii); ok( ret, "GetMenuItemInfo failed error %d\n", GetLastError()); ok( mii.hSubMenu == hsubmenu, "submenu is %p\n", mii.hSubMenu); mi.fMask |= MIM_STYLE; @@ -507,7 +512,7 @@ static void test_subpopup_locked_by_menu(void) ok(ret, "DestroyMenu failed with error %d\n", GetLastError()); /* and repeat the tests */ mii.fMask = MIIM_SUBMENU; - ret = GetMenuItemInfo( hmenu, 0, TRUE, &mii); + ret = GetMenuItemInfoA( hmenu, 0, TRUE, &mii); ok( ret, "GetMenuItemInfo failed error %d\n", GetLastError()); /* GetMenuInfo fails now */ ok( mii.hSubMenu == hsubmenu, "submenu is %p\n", mii.hSubMenu); @@ -539,22 +544,22 @@ static void test_menu_ownerdraw(void) int i,j,k; BOOL ret; HMENU hmenu; - MENUITEMINFO mii; + MENUITEMINFOA mii; LONG leftcol; - HWND hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL, + HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, NULL, NULL, NULL, NULL); ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); if( !hwnd) return; - SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc); hmenu = CreatePopupMenu(); ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); if( !hmenu) { DestroyWindow(hwnd);return;} k=0; for( j=0;j<2;j++) /* create columns */ for(i=0;i<2;i++) { /* create rows */ - ret = AppendMenu( hmenu, MF_OWNERDRAW | - (i==0 ? MF_MENUBREAK : 0), k, MAKEINTRESOURCE(k)); + ret = AppendMenuA( hmenu, MF_OWNERDRAW | + (i==0 ? MF_MENUBREAK : 0), k, (LPCSTR)MAKEINTRESOURCE(k)); k++; ok( ret, "AppendMenu failed for %d\n", k-1); } @@ -583,7 +588,7 @@ static void test_menu_ownerdraw(void) /* test what MF_MENUBREAK did at the first position. Also show * that an MF_SEPARATOR is ignored in the height calculation. */ leftcol= MOD_rc[0].left; - ModifyMenu( hmenu, 0, MF_BYCOMMAND| MF_OWNERDRAW| MF_SEPARATOR, 0, 0); + ModifyMenuA( hmenu, 0, MF_BYCOMMAND| MF_OWNERDRAW| MF_SEPARATOR, 0, 0); /* display the menu */ TrackPopupMenu( hmenu, TPM_RETURNCMD, 100,100, 0, hwnd, NULL); /* left should be 4 pixels less now */ @@ -600,7 +605,7 @@ static void test_menu_ownerdraw(void) MOD_rc[0].bottom - MOD_rc[0].top, MOD_SIZE); /* test owner-drawn callback bitmap */ - ModifyMenu( hmenu, 1, MF_BYPOSITION | MFT_BITMAP, 1, (LPCSTR)HBMMENU_CALLBACK ); + ModifyMenuA( hmenu, 1, MF_BYPOSITION | MFT_BITMAP, 1, (LPCSTR)HBMMENU_CALLBACK ); mii.cbSize = sizeof(mii); mii.fMask = MIIM_BITMAP | MIIM_FTYPE | MIIM_ID; if (GetMenuItemInfoA( hmenu, 1, TRUE, &mii )) @@ -619,7 +624,7 @@ static void test_menu_ownerdraw(void) if( !hmenu) { DestroyWindow(hwnd);return;} MOD_maxid=1; for(i=0;i<2;i++) { - ret = AppendMenu( hmenu, MF_OWNERDRAW , i, 0); + ret = AppendMenuA( hmenu, MF_OWNERDRAW, i, 0 ); ok( ret, "AppendMenu failed for %d\n", i); } ret = SetMenu( hwnd, hmenu); @@ -647,12 +652,12 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt, { BOOL ret; HMENU hmenu, submenu; - MENUITEMINFO mii={ sizeof( MENUITEMINFO )}; + MENUITEMINFOA mii={ sizeof( MENUITEMINFOA )}; MENUINFO mi; RECT rc; CHAR text_copy[16]; int hastab, expect; - int failed = 0; + BOOL failed = FALSE; MOD_GotDrawItemMsg = FALSE; mii.fMask = MIIM_FTYPE | MIIM_DATA | MIIM_STATE; @@ -696,7 +701,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt, ret = pSetMenuInfo( hmenu, &mi); ok( ret, "SetMenuInfo failed with error %d\n", GetLastError()); } - ret = InsertMenuItem( hmenu, 0, FALSE, &mii); + ret = InsertMenuItemA( hmenu, 0, FALSE, &mii); ok( ret, "InsertMenuItem failed with error %d\n", GetLastError()); failed = !ret; if( winetest_debug) { @@ -706,7 +711,7 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt, sprintf( buf,"%d text \"%s\" mnuopt %d", count, text ? text: "(nil)", mnuopt); FillRect( hdc, &rc, (HBRUSH) COLOR_WINDOW); - TextOut( hdc, 10, 50, buf, strlen( buf)); + TextOutA( hdc, 10, 50, buf, strlen( buf)); ReleaseDC( hwnd, hdc); } if(ispop) @@ -819,11 +824,11 @@ static void test_menu_bmp_and_string(void) } memset( bmfill, 0xcc, sizeof( bmfill)); - hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL, WS_SYSMENU | + hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_SYSMENU | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, NULL, NULL, NULL, NULL); - hbm_arrow=LoadBitmap( 0, (CHAR*)OBM_MNARROW); - GetObject( hbm_arrow, sizeof(bm), &bm); + hbm_arrow = LoadBitmapA( 0, (LPCSTR)OBM_MNARROW); + GetObjectA( hbm_arrow, sizeof(bm), &bm); arrowwidth = bm.bmWidth; ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); if( !hwnd) return; @@ -843,7 +848,7 @@ static void test_menu_bmp_and_string(void) ok( HBMMENU_POPUP_CLOSE == mii.hbmpItem, "Item info did not get the right hbitmap: got %p expected %p\n", mii.hbmpItem, HBMMENU_POPUP_CLOSE); - SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc); if( winetest_debug) trace(" check %d,%d arrow %d avechar %d\n", @@ -890,7 +895,7 @@ static void test_menu_bmp_and_string(void) static void test_menu_add_string( void ) { HMENU hmenu; - MENUITEMINFO info; + MENUITEMINFOA info; BOOL rc; int ret; @@ -912,7 +917,7 @@ static void test_menu_add_string( void ) info.dwItemData = 0; info.wID = 1; info.fState = 0; - InsertMenuItem(hmenu, 0, TRUE, &info ); + InsertMenuItemA(hmenu, 0, TRUE, &info ); memset( &info, 0, sizeof info ); info.cbSize = sizeof info; @@ -920,22 +925,22 @@ static void test_menu_add_string( void ) info.dwTypeData = string; info.cch = sizeof string; string[0] = 0; - GetMenuItemInfo( hmenu, 0, TRUE, &info ); + GetMenuItemInfoA( hmenu, 0, TRUE, &info ); ok( !strcmp( string, "blah" ), "menu item name differed\n"); /* Test combination of ownerdraw and strings with GetMenuItemString(A/W) */ strcpy(string, "Dummy string"); memset(&info, 0x00, sizeof(info)); - info.cbSize= sizeof(MENUITEMINFO); + info.cbSize= sizeof(MENUITEMINFOA); info.fMask= MIIM_FTYPE | MIIM_STRING; /* Set OwnerDraw + typeData */ info.fType= MFT_OWNERDRAW; info.dwTypeData= string; - rc = InsertMenuItem( hmenu, 0, TRUE, &info ); + rc = InsertMenuItemA( hmenu, 0, TRUE, &info ); ok (rc, "InsertMenuItem failed\n"); strcpy(string,"Garbage"); - ok (GetMenuString( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n"); + ok (GetMenuStringA( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n"); ok (!strcmp( strback, "Dummy string" ), "Menu text from Ansi version incorrect\n"); SetLastError(0xdeadbeef); @@ -948,58 +953,71 @@ static void test_menu_add_string( void ) ok (!lstrcmpW( strbackW, expectedString ), "Menu text from Unicode version incorrect\n"); } + /* Just try some invalid parameter tests */ + SetLastError(0xdeadbeef); + rc = SetMenuItemInfoA( hmenu, 0, TRUE, NULL ); + ret = GetLastError(); + ok (!rc, "SetMenuItemInfoA succeeded unexpectedly\n"); + ok (ret == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", ret); + + SetLastError(0xdeadbeef); + rc = SetMenuItemInfoA( hmenu, 0, FALSE, NULL ); + ret = GetLastError(); + ok (!rc, "SetMenuItemInfoA succeeded unexpectedly\n"); + ok (ret == ERROR_INVALID_PARAMETER, "Expected 87, got %d\n", ret); + /* Just change ftype to string and see what text is stored */ memset(&info, 0x00, sizeof(info)); - info.cbSize= sizeof(MENUITEMINFO); + info.cbSize= sizeof(MENUITEMINFOA); info.fMask= MIIM_FTYPE; /* Set string type */ info.fType= MFT_STRING; - info.dwTypeData= (char *)0xdeadbeef; - rc = SetMenuItemInfo( hmenu, 0, TRUE, &info ); + info.dwTypeData= (char *)0xdeadbeef; + rc = SetMenuItemInfoA( hmenu, 0, TRUE, &info ); ok (rc, "SetMenuItemInfo failed\n"); /* Did we keep the old dwTypeData? */ - ok (GetMenuString( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n"); + ok (GetMenuStringA( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n"); ok (!strcmp( strback, "Dummy string" ), "Menu text from Ansi version incorrect\n"); /* Ensure change to bitmap type fails */ memset(&info, 0x00, sizeof(info)); - info.cbSize= sizeof(MENUITEMINFO); + info.cbSize= sizeof(MENUITEMINFOA); info.fMask= MIIM_FTYPE; /* Set as bitmap type */ info.fType= MFT_BITMAP; info.dwTypeData= (char *)0xdeadbee2; - rc = SetMenuItemInfo( hmenu, 0, TRUE, &info ); + rc = SetMenuItemInfoA( hmenu, 0, TRUE, &info ); ok (!rc, "SetMenuItemInfo unexpectedly worked\n"); /* Just change ftype back and ensure data hasn't been freed */ info.fType= MFT_OWNERDRAW; /* Set as ownerdraw type */ info.dwTypeData= (char *)0xdeadbee3; - rc = SetMenuItemInfo( hmenu, 0, TRUE, &info ); + rc = SetMenuItemInfoA( hmenu, 0, TRUE, &info ); ok (rc, "SetMenuItemInfo failed\n"); - + /* Did we keep the old dwTypeData? */ - ok (GetMenuString( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n"); + ok (GetMenuStringA( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n"); ok (!strcmp( strback, "Dummy string" ), "Menu text from Ansi version incorrect\n"); /* Just change string value (not type) */ memset(&info, 0x00, sizeof(info)); - info.cbSize= sizeof(MENUITEMINFO); + info.cbSize= sizeof(MENUITEMINFOA); info.fMask= MIIM_STRING; /* Set typeData */ strcpy(string2, "string2"); - info.dwTypeData= string2; - rc = SetMenuItemInfo( hmenu, 0, TRUE, &info ); + info.dwTypeData= string2; + rc = SetMenuItemInfoA( hmenu, 0, TRUE, &info ); ok (rc, "SetMenuItemInfo failed\n"); - ok (GetMenuString( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n"); + ok (GetMenuStringA( hmenu, 0, strback, 99, MF_BYPOSITION), "GetMenuString on ownerdraw entry failed\n"); ok (!strcmp( strback, "string2" ), "Menu text from Ansi version incorrect\n"); /* crashes with wine 0.9.5 */ memset(&info, 0x00, sizeof(info)); - info.cbSize= sizeof(MENUITEMINFO); + info.cbSize= sizeof(MENUITEMINFOA); info.fMask= MIIM_FTYPE | MIIM_STRING; /* Set OwnerDraw + typeData */ info.fType= MFT_OWNERDRAW; - rc = InsertMenuItem( hmenu, 0, TRUE, &info ); + rc = InsertMenuItemA( hmenu, 0, TRUE, &info ); ok (rc, "InsertMenuItem failed\n"); - ok (!GetMenuString( hmenu, 0, NULL, 0, MF_BYPOSITION), + ok (!GetMenuStringA( hmenu, 0, NULL, 0, MF_BYPOSITION), "GetMenuString on ownerdraw entry succeeded.\n"); SetLastError(0xdeadbeef); ret = GetMenuStringW( hmenu, 0, NULL, 0, MF_BYPOSITION); @@ -1203,7 +1221,7 @@ static void set_menu_item_info( int line, HMENU hmenu, BOOL ansi, UINT mask, UIN static void test_menu_iteminfo( void ) { - int ansi = TRUE; + BOOL ansi = TRUE; char txtA[]="wine"; char initA[]="XYZ"; char emptyA[]=""; @@ -1693,7 +1711,7 @@ static void test_menu_iteminfo( void ) static void test_menu_search_bycommand( void ) { HMENU hmenu, hmenuSub, hmenuSub2; - MENUITEMINFO info; + MENUITEMINFOA info; BOOL rc; UINT id; char strback[0x80]; @@ -1703,7 +1721,7 @@ static void test_menu_search_bycommand( void ) /* Case 1: Menu containing a menu item */ hmenu = CreateMenu(); - + memset( &info, 0, sizeof info ); info.cbSize = sizeof info; info.fMask = MIIM_FTYPE | MIIM_STRING | MIIM_ID; @@ -1711,8 +1729,8 @@ static void test_menu_search_bycommand( void ) strcpy(strIn, "Case 1 MenuItem"); info.dwTypeData = strIn; info.wID = (UINT) 0x1234; - - rc = InsertMenuItem(hmenu, 0, TRUE, &info ); + + rc = InsertMenuItemA(hmenu, 0, TRUE, &info ); ok (rc, "Inserting the menuitem failed\n"); id = GetMenuItemID(hmenu, 0); @@ -1721,12 +1739,12 @@ static void test_menu_search_bycommand( void ) /* Confirm the menuitem was given the id supplied (getting by position) */ memset( &info, 0, sizeof info ); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING; info.dwTypeData = strback; info.cch = sizeof(strback); - rc = GetMenuItemInfo(hmenu, 0, TRUE, &info); /* Get by position */ + rc = GetMenuItemInfoA(hmenu, 0, TRUE, &info); /* Get by position */ ok (rc, "Getting the menu items info failed\n"); ok (info.wID == 0x1234, "IDs differ for the menuitem\n"); ok (!strcmp(info.dwTypeData, "Case 1 MenuItem"), "Returned item has wrong label\n"); @@ -1734,11 +1752,11 @@ static void test_menu_search_bycommand( void ) /* Search by id - Should return the item */ memset( &info, 0, sizeof info ); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING; info.dwTypeData = strback; info.cch = sizeof(strback); - rc = GetMenuItemInfo(hmenu, 0x1234, FALSE, &info); /* Get by ID */ + rc = GetMenuItemInfoA(hmenu, 0x1234, FALSE, &info); /* Get by ID */ ok (rc, "Getting the menu items info failed\n"); ok (info.wID == 0x1234, "IDs differ for the menuitem\n"); @@ -1749,9 +1767,9 @@ static void test_menu_search_bycommand( void ) /* Case 2: Menu containing a popup menu */ hmenu = CreateMenu(); hmenuSub = CreateMenu(); - + strcpy(strIn, "Case 2 SubMenu"); - rc = InsertMenu(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, strIn); + rc = InsertMenuA(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, strIn); ok (rc, "Inserting the popup menu into the main menu failed\n"); id = GetMenuItemID(hmenu, 0); @@ -1760,13 +1778,13 @@ static void test_menu_search_bycommand( void ) /* Confirm the menuitem itself was given an id the same as the HMENU, (getting by position) */ memset( &info, 0, sizeof info ); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING; info.dwTypeData = strback; info.cch = sizeof(strback); info.wID = 0xdeadbeef; - rc = GetMenuItemInfo(hmenu, 0, TRUE, &info); /* Get by position */ + rc = GetMenuItemInfoA(hmenu, 0, TRUE, &info); /* Get by position */ ok (rc, "Getting the menu items info failed\n"); ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for the menuitem\n"); ok (!strcmp(info.dwTypeData, "Case 2 SubMenu"), "Returned item has wrong label\n"); @@ -1774,11 +1792,11 @@ static void test_menu_search_bycommand( void ) /* Search by id - returns the popup menu itself */ memset( &info, 0, sizeof info ); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING; info.dwTypeData = strback; info.cch = sizeof(strback); - rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */ + rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */ ok (rc, "Getting the menu items info failed\n"); ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for the popup menu\n"); @@ -1794,17 +1812,17 @@ static void test_menu_search_bycommand( void ) strcpy(strIn, "Case 2 MenuItem 1"); info.dwTypeData = strIn; info.wID = (UINT_PTR) hmenuSub; - rc = InsertMenuItem(hmenu, -1, TRUE, &info ); + rc = InsertMenuItemA(hmenu, -1, TRUE, &info ); ok (rc, "Inserting the menuitem failed\n"); /* Search by id - returns the item which follows the popup menu */ memset( &info, 0, sizeof info ); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING; info.dwTypeData = strback; info.cch = sizeof(strback); - rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */ + rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */ ok (rc, "Getting the menu items info failed\n"); ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for the popup menu\n"); @@ -1820,17 +1838,17 @@ static void test_menu_search_bycommand( void ) strcpy(strIn, "Case 2 MenuItem 2"); info.dwTypeData = strIn; info.wID = (UINT_PTR) hmenuSub; - rc = InsertMenuItem(hmenu, 0, TRUE, &info ); + rc = InsertMenuItemA(hmenu, 0, TRUE, &info ); ok (rc, "Inserting the menuitem failed\n"); /* Search by id - returns the item which precedes the popup menu */ memset( &info, 0, sizeof info ); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING; info.dwTypeData = strback; info.cch = sizeof(strback); - rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */ + rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); /* Get by ID */ ok (rc, "Getting the menu items info failed\n"); ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for the popup menu\n"); @@ -1854,10 +1872,10 @@ static void test_menu_search_bycommand( void ) info.dwTypeData = menuitem; info.wID = (UINT_PTR) hmenuSub; /* Enforce id collisions with the hmenu of the popup submenu*/ - rc = InsertMenu(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu"); + rc = InsertMenuA(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu"); ok (rc, "Inserting the popup menu into the main menu failed\n"); - rc = InsertMenuItem(hmenuSub, 0, TRUE, &info ); + rc = InsertMenuItemA(hmenuSub, 0, TRUE, &info ); ok (rc, "Inserting the sub menu menuitem failed\n"); memset( &info, 0, sizeof info ); @@ -1867,40 +1885,40 @@ static void test_menu_search_bycommand( void ) info.dwTypeData = menuitem2; info.wID = (UINT_PTR) hmenuSub; /* Enforce id collisions with the hmenu of the popup submenu*/ - rc = InsertMenuItem(hmenuSub, 1, TRUE, &info ); + rc = InsertMenuItemA(hmenuSub, 1, TRUE, &info ); ok (rc, "Inserting the sub menu menuitem 2 failed\n"); /* Prove that you can't query the id of a popup directly (By position) */ id = GetMenuItemID(hmenu, 0); - ok (id == -1, "Getting the sub menu id should have failed because its a popup (gave %x)\n", id); + ok (id == -1, "Getting the sub menu id should have failed because it's a popup (gave %x)\n", id); /* Prove getting the item info via ID returns the first item (not the popup or 2nd item)*/ memset( &info, 0, sizeof info ); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_STRING | MIIM_ID; info.dwTypeData = strback; info.cch = sizeof(strback); - rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); + rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); ok (rc, "Getting the menus info failed\n"); ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for popup menu\n"); ok (!strcmp(info.dwTypeData, "MenuItem"), "Returned item has wrong label (%s)\n", info.dwTypeData); DestroyMenu( hmenu ); DestroyMenu( hmenuSub ); - /* + /* Case 4: Menu containing 2 popup menus, the second contains 2 items with the same id as the first popup menu */ hmenu = CreateMenu(); hmenuSub = CreateMenu(); hmenuSub2 = CreateMenu(); - - rc = InsertMenu(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu"); + + rc = InsertMenuA(hmenu, 0, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu"); ok (rc, "Inserting the popup menu into the main menu failed\n"); - - rc = InsertMenu(hmenu, 1, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub2, "Submenu2"); + + rc = InsertMenuA(hmenu, 1, MF_BYPOSITION | MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub2, "Submenu2"); ok (rc, "Inserting the popup menu into the main menu failed\n"); memset( &info, 0, sizeof info ); @@ -1910,7 +1928,7 @@ static void test_menu_search_bycommand( void ) info.dwTypeData = menuitem; info.wID = (UINT_PTR) hmenuSub; /* Enforce id collisions with the hmenu of the popup submenu*/ - rc = InsertMenuItem(hmenuSub2, 0, TRUE, &info ); + rc = InsertMenuItemA(hmenuSub2, 0, TRUE, &info ); ok (rc, "Inserting the sub menu menuitem failed\n"); memset( &info, 0, sizeof info ); @@ -1920,30 +1938,30 @@ static void test_menu_search_bycommand( void ) info.dwTypeData = menuitem2; info.wID = (UINT_PTR) hmenuSub; /* Enforce id collisions with the hmenu of the popup submenu*/ - rc = InsertMenuItem(hmenuSub2, 1, TRUE, &info ); + rc = InsertMenuItemA(hmenuSub2, 1, TRUE, &info ); ok (rc, "Inserting the sub menu menuitem 2 failed\n"); /* Prove getting the item info via ID returns the first item (not the popup or 2nd item)*/ memset( &info, 0, sizeof info ); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_STRING | MIIM_ID; info.dwTypeData = strback; info.cch = sizeof(strback); - rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); + rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub, FALSE, &info); ok (rc, "Getting the menus info failed\n"); ok (info.wID == (UINT_PTR)hmenuSub, "IDs differ for popup menu\n"); ok (!strcmp(info.dwTypeData, "MenuItem"), "Returned item has wrong label (%s)\n", info.dwTypeData); memset( &info, 0, sizeof info ); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_STRING | MIIM_ID; info.dwTypeData = strback; info.cch = sizeof(strback); - rc = GetMenuItemInfo(hmenu, (UINT_PTR)hmenuSub2, FALSE, &info); + rc = GetMenuItemInfoA(hmenu, (UINT_PTR)hmenuSub2, FALSE, &info); ok (rc, "Getting the menus info failed\n"); ok (info.wID == (UINT_PTR)hmenuSub2, "IDs differ for popup menu\n"); ok (!strcmp(info.dwTypeData, "Submenu2"), "Returned item has wrong label (%s)\n", info.dwTypeData); @@ -1953,7 +1971,7 @@ static void test_menu_search_bycommand( void ) DestroyMenu( hmenuSub2 ); - /* + /* Case 5: Menu containing a popup menu which in turn contains an item with a different id than the popup menu. This tests the fallback to a popup menu ID. @@ -1962,10 +1980,10 @@ static void test_menu_search_bycommand( void ) hmenu = CreateMenu(); hmenuSub = CreateMenu(); - rc = AppendMenu(hmenu, MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu"); + rc = AppendMenuA(hmenu, MF_POPUP | MF_STRING, (UINT_PTR)hmenuSub, "Submenu"); ok (rc, "Appending the popup menu to the main menu failed\n"); - rc = AppendMenu(hmenuSub, MF_STRING, 102, "Item"); + rc = AppendMenuA(hmenuSub, MF_STRING, 102, "Item"); ok (rc, "Appending the item to the popup menu failed\n"); /* Set the ID for hmenuSub */ @@ -1973,24 +1991,24 @@ static void test_menu_search_bycommand( void ) info.fMask = MIIM_ID; info.wID = 101; - rc = SetMenuItemInfo(hmenu, 0, TRUE, &info); + rc = SetMenuItemInfoA(hmenu, 0, TRUE, &info); ok(rc, "Setting the ID for the popup menu failed\n"); /* Check if the ID has been set */ info.wID = 0; - rc = GetMenuItemInfo(hmenu, 0, TRUE, &info); + rc = GetMenuItemInfoA(hmenu, 0, TRUE, &info); ok(rc, "Getting the ID for the popup menu failed\n"); ok(info.wID == 101, "The ID for the popup menu has not been set\n"); /* Prove getting the item info via ID returns the popup menu */ memset( &info, 0, sizeof(info)); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_STRING | MIIM_ID; info.dwTypeData = strback; info.cch = sizeof(strback); - rc = GetMenuItemInfo(hmenu, 101, FALSE, &info); + rc = GetMenuItemInfoA(hmenu, 101, FALSE, &info); ok (rc, "Getting the menu info failed\n"); ok (info.wID == 101, "IDs differ\n"); ok (!strcmp(info.dwTypeData, "Submenu"), "Returned item has wrong label (%s)\n", info.dwTypeData); @@ -1998,12 +2016,12 @@ static void test_menu_search_bycommand( void ) /* Also look for the menu item */ memset( &info, 0, sizeof(info)); strback[0] = 0x00; - info.cbSize = sizeof(MENUITEMINFO); + info.cbSize = sizeof(MENUITEMINFOA); info.fMask = MIIM_STRING | MIIM_ID; info.dwTypeData = strback; info.cch = sizeof(strback); - rc = GetMenuItemInfo(hmenu, 102, FALSE, &info); + rc = GetMenuItemInfoA(hmenu, 102, FALSE, &info); ok (rc, "Getting the menu info failed\n"); ok (info.wID == 102, "IDs differ\n"); ok (!strcmp(info.dwTypeData, "Item"), "Returned item has wrong label (%s)\n", info.dwTypeData); @@ -2097,7 +2115,7 @@ static BOOL click_menu(HANDLE hWnd, struct menu_item_pair_s *mi) ret = pSendInput(3, (INPUT *) i, sizeof(INPUT)); /* hack to prevent mouse message buildup in Wine */ - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); return ret; } @@ -2110,7 +2128,8 @@ static DWORD WINAPI test_menu_input_thread(LPVOID lpParameter) /* mixed keyboard/mouse test */ for (i = 0; menu_tests[i].type != -1; i++) { - int ret = TRUE, elapsed = 0; + BOOL ret = TRUE; + int elapsed = 0; got_input = i && menu_tests[i-1].bMenuVisible; @@ -2124,7 +2143,7 @@ static DWORD WINAPI test_menu_input_thread(LPVOID lpParameter) if (!ret) { skip( "test %u: failed to send input\n", i ); - PostMessage( hWnd, WM_CANCELMODE, 0, 0 ); + PostMessageA( hWnd, WM_CANCELMODE, 0, 0 ); return 0; } while (menu_tests[i].bMenuVisible != bMenuVisible) @@ -2138,7 +2157,7 @@ static DWORD WINAPI test_menu_input_thread(LPVOID lpParameter) if (!got_input) { skip( "test %u: didn't receive input\n", i ); - PostMessage( hWnd, WM_CANCELMODE, 0, 0 ); + PostMessageA( hWnd, WM_CANCELMODE, 0, 0 ); return 0; } @@ -2180,7 +2199,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, default: return( DefWindowProcA( hWnd, msg, wParam, lParam ) ); } -#if 0 + if(pGetMenuBarInfo) { MENUBARINFO mbi; @@ -2226,7 +2245,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, ok(!(bMenuVisible && (state & MF_HILITE)) == !mbi.fFocused, "msg %x: GetMenuBarInfo.fFocused (%d) is wrong\n", msg, mbi.fFocused != 0); } -#endif + if (msg == WM_EXITMENULOOP) bMenuVisible = FALSE; else if (msg == WM_INITMENUPOPUP) @@ -2254,8 +2273,8 @@ static void test_menu_input(void) { wclass.style = CS_HREDRAW | CS_VREDRAW; wclass.lpfnWndProc = WndProc; wclass.hInstance = hInstance; - wclass.hIcon = LoadIconA( 0, IDI_APPLICATION ); - wclass.hCursor = LoadCursorA( NULL, IDC_ARROW ); + wclass.hIcon = LoadIconA( 0, (LPCSTR)IDI_APPLICATION ); + wclass.hCursor = LoadCursorA( 0, (LPCSTR)IDC_ARROW ); wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 ); wclass.lpszMenuName = 0; wclass.cbClsExtra = 0; @@ -2270,18 +2289,18 @@ static void test_menu_input(void) { if (!hWnd) return; /* fixed menus */ hMenus[3] = CreatePopupMenu(); - AppendMenu(hMenus[3], MF_STRING, 0, "&Enabled"); - AppendMenu(hMenus[3], MF_STRING|MF_DISABLED, 0, "&Disabled"); + AppendMenuA(hMenus[3], MF_STRING, 0, "&Enabled"); + AppendMenuA(hMenus[3], MF_STRING|MF_DISABLED, 0, "&Disabled"); hMenus[2] = CreatePopupMenu(); - AppendMenu(hMenus[2], MF_STRING|MF_POPUP, (UINT_PTR) hMenus[3], "&Popup"); - AppendMenu(hMenus[2], MF_STRING, 0, "&Enabled"); - AppendMenu(hMenus[2], MF_STRING|MF_DISABLED, 0, "&Disabled"); + AppendMenuA(hMenus[2], MF_STRING|MF_POPUP, (UINT_PTR) hMenus[3], "&Popup"); + AppendMenuA(hMenus[2], MF_STRING, 0, "&Enabled"); + AppendMenuA(hMenus[2], MF_STRING|MF_DISABLED, 0, "&Disabled"); hMenus[1] = CreateMenu(); - AppendMenu(hMenus[1], MF_STRING|MF_POPUP, (UINT_PTR) hMenus[2], "&Menu"); - AppendMenu(hMenus[1], MF_STRING, 0, "&Enabled"); - AppendMenu(hMenus[1], MF_STRING|MF_DISABLED, 0, "&Disabled"); + AppendMenuA(hMenus[1], MF_STRING|MF_POPUP, (UINT_PTR) hMenus[2], "&Menu"); + AppendMenuA(hMenus[1], MF_STRING, 0, "&Enabled"); + AppendMenuA(hMenus[1], MF_STRING|MF_DISABLED, 0, "&Disabled"); SetMenu(hWnd, hMenus[1]); ShowWindow(hWnd, SW_SHOW); @@ -2292,7 +2311,7 @@ static void test_menu_input(void) { { if (WAIT_TIMEOUT != WaitForSingleObject(hThread, 50)) break; - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); } DestroyWindow(hWnd); } @@ -2304,12 +2323,12 @@ static void test_menu_flags( void ) hMenu = CreateMenu(); hPopupMenu = CreatePopupMenu(); - AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR)hPopupMenu, "Popup"); + AppendMenuA(hMenu, MF_POPUP | MF_STRING, (UINT_PTR)hPopupMenu, "Popup"); - AppendMenu(hPopupMenu, MF_STRING | MF_HILITE | MF_DEFAULT, 101, "Item 1"); - InsertMenu(hPopupMenu, 1, MF_BYPOSITION | MF_STRING | MF_HILITE | MF_DEFAULT, 102, "Item 2"); - AppendMenu(hPopupMenu, MF_STRING, 103, "Item 3"); - ModifyMenu(hPopupMenu, 2, MF_BYPOSITION | MF_STRING | MF_HILITE | MF_DEFAULT, 103, "Item 3"); + AppendMenuA(hPopupMenu, MF_STRING | MF_HILITE | MF_DEFAULT, 101, "Item 1"); + InsertMenuA(hPopupMenu, 1, MF_BYPOSITION | MF_STRING | MF_HILITE | MF_DEFAULT, 102, "Item 2"); + AppendMenuA(hPopupMenu, MF_STRING, 103, "Item 3"); + ModifyMenuA(hPopupMenu, 2, MF_BYPOSITION | MF_STRING | MF_HILITE | MF_DEFAULT, 103, "Item 3"); ok(GetMenuState(hPopupMenu, 0, MF_BYPOSITION) & MF_HILITE, "AppendMenu should accept MF_HILITE\n"); @@ -2339,8 +2358,8 @@ static void test_menu_hilitemenuitem( void ) wclass.style = CS_HREDRAW | CS_VREDRAW; wclass.lpfnWndProc = WndProc; wclass.hInstance = GetModuleHandleA( NULL ); - wclass.hIcon = LoadIconA( 0, IDI_APPLICATION ); - wclass.hCursor = LoadCursorA( NULL, IDC_ARROW ); + wclass.hIcon = LoadIconA( 0, (LPCSTR)IDI_APPLICATION ); + wclass.hCursor = LoadCursorA( 0, (LPCSTR)IDC_ARROW ); wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 ); wclass.lpszMenuName = 0; wclass.cbClsExtra = 0; @@ -2357,11 +2376,11 @@ static void test_menu_hilitemenuitem( void ) hMenu = CreateMenu(); hPopupMenu = CreatePopupMenu(); - AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR)hPopupMenu, "Popup"); + AppendMenuA(hMenu, MF_POPUP | MF_STRING, (UINT_PTR)hPopupMenu, "Popup"); - AppendMenu(hPopupMenu, MF_STRING, 101, "Item 1"); - AppendMenu(hPopupMenu, MF_STRING, 102, "Item 2"); - AppendMenu(hPopupMenu, MF_STRING, 103, "Item 3"); + AppendMenuA(hPopupMenu, MF_STRING, 101, "Item 1"); + AppendMenuA(hPopupMenu, MF_STRING, 102, "Item 2"); + AppendMenuA(hPopupMenu, MF_STRING, 103, "Item 3"); SetMenu(hWnd, hMenu); @@ -2477,17 +2496,17 @@ static void check_menu_items(HMENU hmenu, UINT checked_cmd, UINT checked_type, for (i = 0; i < count; i++) { BOOL ret; - MENUITEMINFO mii; + MENUITEMINFOA mii; memset(&mii, 0, sizeof(mii)); mii.cbSize = sizeof(mii); mii.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_ID | MIIM_SUBMENU; - ret = GetMenuItemInfo(hmenu, i, TRUE, &mii); + ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii); ok(ret, "GetMenuItemInfo(%u) failed\n", i); -#if 0 +if (0) trace("item #%u: fType %04x, fState %04x, wID %u, hSubMenu %p\n", i, mii.fType, mii.fState, mii.wID, mii.hSubMenu); -#endif + if (mii.hSubMenu) { ok(mii.wID == (UINT_PTR)mii.hSubMenu, "id %u: wID should be equal to hSubMenu\n", checked_cmd); @@ -2523,12 +2542,12 @@ static void check_menu_items(HMENU hmenu, UINT checked_cmd, UINT checked_type, static void clear_ftype_and_state(HMENU hmenu, UINT id, UINT flags) { BOOL ret; - MENUITEMINFO mii; + MENUITEMINFOA mii; memset(&mii, 0, sizeof(mii)); mii.cbSize = sizeof(mii); mii.fMask = MIIM_FTYPE | MIIM_STATE; - ret = SetMenuItemInfo(hmenu, id, (flags & MF_BYPOSITION) != 0, &mii); + ret = SetMenuItemInfoA(hmenu, id, (flags & MF_BYPOSITION) != 0, &mii); ok(ret, "SetMenuItemInfo(%u) failed\n", id); } @@ -2537,7 +2556,7 @@ static void test_CheckMenuRadioItem(void) BOOL ret; HMENU hmenu; - hmenu = LoadMenu(GetModuleHandle(0), MAKEINTRESOURCE(1)); + hmenu = LoadMenuA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(1)); assert(hmenu != 0); check_menu_items(hmenu, -1, 0, 0); @@ -2616,14 +2635,14 @@ static void test_menu_resource_layout(void) INT count, i; BOOL ret; - hmenu = LoadMenuIndirect(&menu_template); + hmenu = LoadMenuIndirectA(&menu_template); ok(hmenu != 0, "LoadMenuIndirect error %u\n", GetLastError()); - ret = AppendMenu(hmenu, MF_STRING, 6, NULL); + ret = AppendMenuA(hmenu, MF_STRING, 6, NULL); ok(ret, "AppendMenu failed\n"); - ret = AppendMenu(hmenu, MF_STRING, 7, "\0"); + ret = AppendMenuA(hmenu, MF_STRING, 7, "\0"); ok(ret, "AppendMenu failed\n"); - ret = AppendMenu(hmenu, MF_SEPARATOR, 8, "separator"); + ret = AppendMenuA(hmenu, MF_SEPARATOR, 8, "separator"); ok(ret, "AppendMenu failed\n"); count = GetMenuItemCount(hmenu); @@ -2634,19 +2653,19 @@ static void test_menu_resource_layout(void) for (i = 0; i < count; i++) { char buf[20]; - MENUITEMINFO mii; + MENUITEMINFOA mii; memset(&mii, 0, sizeof(mii)); mii.cbSize = sizeof(mii); mii.dwTypeData = buf; mii.cch = sizeof(buf); mii.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_ID | MIIM_STRING; - ret = GetMenuItemInfo(hmenu, i, TRUE, &mii); + ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii); ok(ret, "GetMenuItemInfo(%u) failed\n", i); -#if 0 +if (0) trace("item #%u: fType %04x, fState %04x, wID %u, dwTypeData %s\n", i, mii.fType, mii.fState, mii.wID, (LPCSTR)mii.dwTypeData); -#endif + ok(mii.fType == menu_data[i].type, "%u: expected fType %04x, got %04x\n", i, menu_data[i].type, mii.fType); ok(mii.fState == menu_data[i].state, @@ -2680,7 +2699,7 @@ static HMENU create_menu_from_data(const struct menu_data *item, INT item_count) for (i = 0; i < item_count; i++) { SetLastError(0xdeadbeef); - ret = AppendMenu(hmenu, item[i].type, item[i].id, item[i].str); + ret = AppendMenuA(hmenu, item[i].type, item[i].id, item[i].str); ok(ret, "%d: AppendMenu(%04x, %04x, %p) error %u\n", i, item[i].type, item[i].id, item[i].str, GetLastError()); } @@ -2695,7 +2714,7 @@ static HMENU create_menuitem_from_data(const struct menu_data *item, INT item_co HMENU hmenu; INT i; BOOL ret; - MENUITEMINFO mii = { sizeof( MENUITEMINFO)}; + MENUITEMINFOA mii = { sizeof( MENUITEMINFOA) }; hmenu = CreateMenu(); assert(hmenu != 0); @@ -2722,7 +2741,7 @@ static HMENU create_menuitem_from_data(const struct menu_data *item, INT item_co mii.fState = 0; if( item[i].type & MF_HELP) mii.fType |= MF_HELP; mii.wID = item[i].id; - ret = InsertMenuItem( hmenu, -1, TRUE, &mii); + ret = InsertMenuItemA( hmenu, -1, TRUE, &mii); ok(ret, "%d: InsertMenuItem(%04x, %04x, %p) error %u\n", i, item[i].type, item[i].id, item[i].str, GetLastError()); } @@ -2740,19 +2759,19 @@ static void compare_menu_data(HMENU hmenu, const struct menu_data *item, INT ite for (i = 0; i < count; i++) { char buf[20]; - MENUITEMINFO mii; + MENUITEMINFOA mii; memset(&mii, 0, sizeof(mii)); mii.cbSize = sizeof(mii); mii.dwTypeData = buf; mii.cch = sizeof(buf); mii.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STRING | MIIM_BITMAP; - ret = GetMenuItemInfo(hmenu, i, TRUE, &mii); + ret = GetMenuItemInfoA(hmenu, i, TRUE, &mii); ok(ret, "GetMenuItemInfo(%u) failed\n", i); -#if 0 +if (0) trace("item #%u: fType %04x, fState %04x, wID %04x, hbmp %p\n", i, mii.fType, mii.fState, mii.wID, mii.hbmpItem); -#endif + ok(mii.fType == item[i].type, "%u: expected fType %04x, got %04x\n", i, item[i].type, mii.fType); ok(mii.wID == item[i].id, @@ -2782,20 +2801,20 @@ static void test_InsertMenu(void) static const struct menu_data in1[] = { { MF_STRING, 1, "File" }, - { MF_BITMAP|MF_HELP, SC_CLOSE, MAKEINTRESOURCE(1) }, + { MF_BITMAP|MF_HELP, SC_CLOSE, MAKEINTRESOURCEA(1) }, { MF_STRING|MF_HELP, 2, "Help" } }; static const struct menu_data out1[] = { { MF_STRING, 1, "File" }, { MF_STRING|MF_HELP, 2, "Help" }, - { MF_BITMAP|MF_HELP, SC_CLOSE, MAKEINTRESOURCE(1) } + { MF_BITMAP|MF_HELP, SC_CLOSE, MAKEINTRESOURCEA(1) } }; static const struct menu_data out1a[] = { { MF_STRING, 1, "File" }, { MF_STRING|MF_HELP, 2, "Help" }, - { MF_HELP, SC_CLOSE, MAKEINTRESOURCE(1) } + { MF_HELP, SC_CLOSE, MAKEINTRESOURCEA(1) } }; const struct menu_data in2[] = { @@ -2818,32 +2837,32 @@ static void test_InsertMenu(void) static const struct menu_data in3[] = { { MF_STRING, 1, "File" }, - { MF_SEPARATOR|MF_HELP, SC_CLOSE, MAKEINTRESOURCE(1) }, + { MF_SEPARATOR|MF_HELP, SC_CLOSE, MAKEINTRESOURCEA(1) }, { MF_STRING|MF_HELP, 2, "Help" } }; static const struct menu_data out3[] = { { MF_STRING, 1, "File" }, - { MF_SEPARATOR|MF_HELP, SC_CLOSE, MAKEINTRESOURCE(0) }, + { MF_SEPARATOR|MF_HELP, SC_CLOSE, MAKEINTRESOURCEA(0) }, { MF_STRING|MF_HELP, 2, "Help" }, }; static const struct menu_data in4[] = { { MF_STRING, 1, "File" }, - { MF_BITMAP|MF_HELP, 1, MAKEINTRESOURCE(1) }, + { MF_BITMAP|MF_HELP, 1, MAKEINTRESOURCEA(1) }, { MF_STRING|MF_HELP, 2, "Help" } }; static const struct menu_data out4[] = { { MF_STRING, 1, "File" }, { MF_STRING|MF_HELP, 2, "Help" }, - { MF_BITMAP|MF_HELP, 1, MAKEINTRESOURCE(1) } + { MF_BITMAP|MF_HELP, 1, MAKEINTRESOURCEA(1) } }; static const struct menu_data out4a[] = { { MF_STRING, 1, "File" }, { MF_STRING|MF_HELP, 2, "Help" }, - { MF_HELP, 1, MAKEINTRESOURCE(1) } + { MF_HELP, 1, MAKEINTRESOURCEA(1) } }; HMENU hmenu; @@ -2944,7 +2963,7 @@ static void test_menu_setmenuinfo(void) { HMENU hmenu, hsubmenu; MENUINFO mi = {0}; - MENUITEMINFOA mii = {sizeof( MENUITEMINFOA)}; + MENUITEMINFOA mii = { sizeof(MENUITEMINFOA) }; BOOL ret; DWORD gle; @@ -2960,7 +2979,7 @@ static void test_menu_setmenuinfo(void) assert( hmenu && hsubmenu); mii.fMask = MIIM_SUBMENU; mii.hSubMenu = hsubmenu; - ret = InsertMenuItem( hmenu, 0, FALSE, &mii); + ret = InsertMenuItemA( hmenu, 0, FALSE, &mii); ok( ret, "InsertMenuItem failed with error %d\n", GetLastError()); /* test some parameter errors */ SetLastError(0xdeadbeef); @@ -3087,12 +3106,12 @@ static void test_menu_trackpopupmenu(void) HMENU hmenu; DWORD gle; int Ex; - HWND hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL, + HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, NULL, NULL, NULL, NULL); ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); if (!hwnd) return; - SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc); for( Ex = 0; Ex < 2; Ex++) { hmenu = CreatePopupMenu(); @@ -3209,10 +3228,10 @@ static LRESULT WINAPI menu_track_again_wnd_proc(HWND hwnd, UINT msg, WPARAM wpar /* exit menu modal loop * ( A SendMessage does not work on NT3.51 here ) */ - return PostMessage(hwnd, WM_CANCELMODE, 0, 0); + return PostMessageA(hwnd, WM_CANCELMODE, 0, 0); } } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } static void test_menu_trackagain(void) @@ -3220,18 +3239,23 @@ static void test_menu_trackagain(void) HWND hwnd; BOOL ret; - hwnd = CreateWindowEx(0, MAKEINTATOM(atomMenuCheckClass), NULL, + hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, NULL, NULL, NULL, NULL); ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); if (!hwnd) return; - SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_track_again_wnd_proc); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_track_again_wnd_proc); g_hmenu = CreatePopupMenu(); ok(g_hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); + ret = AppendMenuA(g_hmenu, MF_STRING , 100, "item 1"); + ok(ret, "AppendMenu failed.\n"); + ret = AppendMenuA(g_hmenu, MF_STRING , 101, "item 2"); + ok(ret, "AppendMenu failed.\n"); + ret = TrackPopupMenu( g_hmenu, 0, 100, 100, 0, hwnd, NULL); - todo_wine ok(ret == FALSE, "got %d\n", ret); + ok(ret == TRUE, "got %d\n", ret); DestroyMenu(g_hmenu); DestroyWindow(hwnd); @@ -3247,19 +3271,19 @@ static LRESULT WINAPI menu_cancelmode_wnd_proc(HWND hwnd, UINT msg, { case WM_ENTERMENULOOP: g_got_enteridle = 0; - return SendMessage( g_hwndtosend, WM_CANCELMODE, 0, 0); + return SendMessageA( g_hwndtosend, WM_CANCELMODE, 0, 0); case WM_ENTERIDLE: { if( g_got_enteridle++ == 0) { /* little hack to get another WM_ENTERIDLE message */ - PostMessage( hwnd, WM_MOUSEMOVE, 0, 0); - return SendMessage( g_hwndtosend, WM_CANCELMODE, 0, 0); + PostMessageA( hwnd, WM_MOUSEMOVE, 0, 0); + return SendMessageA( g_hwndtosend, WM_CANCELMODE, 0, 0); } pEndMenu(); return TRUE; } } - return DefWindowProc( hwnd, msg, wparam, lparam); + return DefWindowProcA( hwnd, msg, wparam, lparam); } static void test_menu_cancelmode(void) @@ -3272,24 +3296,24 @@ static void test_menu_cancelmode(void) win_skip( "EndMenu is not available\n"); return; } - hwnd = CreateWindowEx( 0, MAKEINTATOM(atomMenuCheckClass), NULL, + hwnd = CreateWindowExA( 0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, NULL, NULL, NULL, NULL); - hwndchild = CreateWindowEx( 0, MAKEINTATOM(atomMenuCheckClass), NULL, + hwndchild = CreateWindowExA( 0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, WS_VISIBLE | WS_CHILD, 10, 10, 20, 20, hwnd, NULL, NULL, NULL); ok( hwnd != NULL && hwndchild != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); g_hwndtosend = hwnd; - SetWindowLongPtr( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_cancelmode_wnd_proc); - SetWindowLongPtr( hwndchild, GWLP_WNDPROC, (LONG_PTR)menu_cancelmode_wnd_proc); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_cancelmode_wnd_proc); + SetWindowLongPtrA( hwndchild, GWLP_WNDPROC, (LONG_PTR)menu_cancelmode_wnd_proc); menu = CreatePopupMenu(); ok( menu != NULL, "CreatePopupMenu failed with error %d\n", GetLastError()); ret = AppendMenuA( menu, MF_STRING, 1, "winetest"); ok( ret, "Functie failed lasterror is %u\n", GetLastError()); /* seems to be needed only on wine :( */ - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) - DispatchMessage(&msg); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + DispatchMessageA(&msg); /* test the effect of sending a WM_CANCELMODE message in the WM_INITMENULOOP * handler of the menu owner */ /* test results is extracted from variable g_got_enteridle. Possible values: @@ -3300,17 +3324,11 @@ static void test_menu_cancelmode(void) /* menu owner is top level window */ g_hwndtosend = hwnd; TrackPopupMenu( menu, TPM_RETURNCMD, 100,100, 0, hwnd, NULL); - todo_wine { - ok( g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); - } - ok( g_got_enteridle < 2, "received %d WM_ENTERIDLE messages, should be less than 2\n", g_got_enteridle); + ok( g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); /* menu owner is child window */ g_hwndtosend = hwndchild; TrackPopupMenu( menu, TPM_RETURNCMD, 100,100, 0, hwndchild, NULL); - todo_wine { - ok(g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); - } - ok(g_got_enteridle < 2, "received %d WM_ENTERIDLE messages, should be less than 2\n", g_got_enteridle); + ok(g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); /* now send the WM_CANCELMODE messages to the WRONG window */ /* those should fail ( to have any effect) */ g_hwndtosend = hwnd; @@ -3326,14 +3344,11 @@ static void test_menu_cancelmode(void) ok( ret, "SetMenu failed lasterror is %u\n", GetLastError()); /* initiate tracking */ g_hwndtosend = hwnd; - ret = SendMessage( hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0 ); + ret = SendMessageA( hwnd, WM_SYSCOMMAND, SC_KEYMENU, 0 ); ok( ret == 0, "Sending WM_SYSCOMMAND/SC_KEYMENU failed lasterror is %u\n", GetLastError()); - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) - DispatchMessage(&msg); - todo_wine { - ok(g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); - } - ok(g_got_enteridle < 2, "received %d WM_ENTERIDLE messages, should be less than 2\n", g_got_enteridle); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + DispatchMessageA(&msg); + ok(g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); /* cleanup */ DestroyMenu( menubar ); @@ -3406,7 +3421,7 @@ static void test_menualign(void) BYTE bmfill[300]; HMENU menu; HBITMAP hbm1, hbm2, hbm3; - MENUITEMINFO mii = { sizeof(MENUITEMINFO)}; + MENUITEMINFOA mii = { sizeof(MENUITEMINFOA) }; DWORD ret; HWND hwnd; MENUINFO mi = { sizeof( MENUINFO)}; @@ -3415,7 +3430,7 @@ static void test_menualign(void) skip( "interactive alignment tests.\n"); return; } - hwnd = CreateWindowEx(0, + hwnd = CreateWindowExA(0, "STATIC", "Menu text alignment Test\nPlease make a selection.", WS_OVERLAPPEDWINDOW, @@ -3443,13 +3458,13 @@ static void test_menualign(void) mii.wID = 1; mii.hbmpItem = hbm1; mii.dwTypeData = (LPSTR) " OK: menu texts are correctly left-aligned."; - ret = InsertMenuItem( menu, -1, TRUE, &mii); + ret = InsertMenuItemA( menu, -1, TRUE, &mii); ok( ret, "InsertMenuItem() failed\n"); mii.fMask = MIIM_BITMAP | MIIM_STRING | MIIM_ID ; mii.wID = 2; mii.hbmpItem = hbm2; mii.dwTypeData = (LPSTR) " FAIL: menu texts are NOT left-aligned."; - ret = InsertMenuItem( menu, -1, TRUE, &mii); + ret = InsertMenuItemA( menu, -1, TRUE, &mii); ok( ret, "InsertMenuItem() failed\n"); ret = TrackPopupMenu( menu, TPM_RETURNCMD, 110, 200, 0, hwnd, NULL); ok( ret != 2, "User indicated that menu text alignment test 1 failed %d\n", ret); @@ -3458,7 +3473,7 @@ static void test_menualign(void) mii.wID = 3; mii.hbmpItem = hbm3; mii.dwTypeData = NULL; - ret = InsertMenuItem( menu, 0, TRUE, &mii); + ret = InsertMenuItemA( menu, 0, TRUE, &mii); ok( ret, "InsertMenuItem() failed\n"); mii.fMask = MIIM_BITMAP | MIIM_STRING | MIIM_ID; mii.wID = 1; @@ -3466,12 +3481,12 @@ static void test_menualign(void) /* make the text a bit longer, to keep it readable */ /* this bug is on winXP and reproduced on wine */ mii.dwTypeData = (LPSTR) " OK: menu texts are to the right of the bitmaps........"; - ret = SetMenuItemInfo( menu, 1, TRUE, &mii); + ret = SetMenuItemInfoA( menu, 1, TRUE, &mii); ok( ret, "SetMenuItemInfo() failed\n"); mii.wID = 2; mii.hbmpItem = hbm2; mii.dwTypeData = (LPSTR) " FAIL: menu texts are below the first bitmap. "; - ret = SetMenuItemInfo( menu, 2, TRUE, &mii); + ret = SetMenuItemInfoA( menu, 2, TRUE, &mii); ok( ret, "SetMenuItemInfo() failed\n"); ret = TrackPopupMenu( menu, TPM_RETURNCMD, 110, 200, 0, hwnd, NULL); ok( ret != 2, "User indicated that menu text alignment test 2 failed %d\n", ret); @@ -3480,18 +3495,18 @@ static void test_menualign(void) mii.wID = 3; mii.fType = MFT_BITMAP; mii.dwTypeData = (LPSTR) hbm3; - ret = SetMenuItemInfo( menu, 0, TRUE, &mii); + ret = SetMenuItemInfoA( menu, 0, TRUE, &mii); ok( ret, "SetMenuItemInfo() failed\n"); mii.fMask = MIIM_BITMAP | MIIM_STRING | MIIM_ID; mii.wID = 1; mii.hbmpItem = NULL; mii.dwTypeData = (LPSTR) " OK: menu texts are below the bitmap."; - ret = SetMenuItemInfo( menu, 1, TRUE, &mii); + ret = SetMenuItemInfoA( menu, 1, TRUE, &mii); ok( ret, "SetMenuItemInfo() failed\n"); mii.wID = 2; mii.hbmpItem = NULL; mii.dwTypeData = (LPSTR) " FAIL: menu texts are NOT below the bitmap."; - ret = SetMenuItemInfo( menu, 2, TRUE, &mii); + ret = SetMenuItemInfoA( menu, 2, TRUE, &mii); ok( ret, "SetMenuItemInfo() failed\n"); ret = TrackPopupMenu( menu, TPM_RETURNCMD, 110, 200, 0, hwnd, NULL); ok( ret != 2, "User indicated that menu text alignment test 3 failed %d\n", ret); @@ -3503,6 +3518,106 @@ static void test_menualign(void) DestroyWindow( hwnd); } +static LRESULT WINAPI menu_fill_in_init(HWND hwnd, UINT msg, + WPARAM wparam, LPARAM lparam) +{ + HMENU hmenupopup; + BOOL ret; + switch (msg) + { + case WM_INITMENUPOPUP: + gflag_initmenupopup++; + hmenupopup = (HMENU) wparam; + ret = AppendMenuA(hmenupopup, MF_STRING , 100, "item 1"); + ok(ret, "AppendMenu failed.\n"); + ret = AppendMenuA(hmenupopup, MF_STRING , 101, "item 2"); + ok(ret, "AppendMenu failed.\n"); + break; + case WM_ENTERMENULOOP: + gflag_entermenuloop++; + break; + case WM_INITMENU: + gflag_initmenu++; + break; + case WM_ENTERIDLE: + gflag_enteridle++; + PostMessageA(hwnd, WM_CANCELMODE, 0, 0); + return TRUE; + case WM_MENUSELECT: + selectitem_wp = wparam; + selectitem_lp = lparam; + break; + } + return DefWindowProcA(hwnd, msg, wparam, lparam); +} + +static void test_emptypopup(void) +{ + BOOL ret; + HMENU hmenu; + + HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, + WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, + NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc); + + hmenu = CreatePopupMenu(); + ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); + + gflag_initmenupopup = gflag_entermenuloop = gflag_initmenu = gflag_enteridle = 0; + selectitem_wp = 0xdeadbeef; + selectitem_lp = 0xdeadbeef; + + ret = TrackPopupMenu( hmenu, TPM_RETURNCMD, 100,100, 0, hwnd, NULL); + ok(ret == 0, "got %i\n", ret); + + ok(gflag_initmenupopup == 1, "got %i\n", gflag_initmenupopup); + ok(gflag_entermenuloop == 1, "got %i\n", gflag_entermenuloop); + ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu); + todo_wine ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu); + + todo_wine ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp); + todo_wine ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp); + + gflag_initmenupopup = gflag_entermenuloop = gflag_initmenu = gflag_enteridle = 0; + selectitem_wp = 0xdeadbeef; + selectitem_lp = 0xdeadbeef; + + ret = TrackPopupMenu( hmenu, 0, 100,100, 0, hwnd, NULL); + todo_wine ok(ret == 0, "got %i\n", ret); + + ok(gflag_initmenupopup == 1, "got %i\n", gflag_initmenupopup); + ok(gflag_entermenuloop == 1, "got %i\n", gflag_entermenuloop); + ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu); + todo_wine ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu); + + todo_wine ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp); + todo_wine ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp); + + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_fill_in_init); + + gflag_initmenupopup = gflag_entermenuloop = gflag_initmenu = gflag_enteridle = 0; + selectitem_wp = 0xdeadbeef; + selectitem_lp = 0xdeadbeef; + + ret = TrackPopupMenu( hmenu, 0, 100,100, 0, hwnd, NULL); + ok(ret == 1, "got %i\n", ret); + + ok(gflag_initmenupopup == 1, "got %i\n", gflag_initmenupopup); + ok(gflag_entermenuloop == 1, "got %i\n", gflag_entermenuloop); + ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu); + ok(gflag_enteridle == 1, "got %i\n", gflag_initmenu); + + ok(selectitem_wp == 0xffff0000, "got %lx\n", selectitem_wp); + ok(selectitem_lp == 0, "got %lx\n", selectitem_lp); + + DestroyWindow(hwnd); + + ret = DestroyMenu(hmenu); + ok(ret, "DestroyMenu failed with error %d\n", GetLastError()); +} + START_TEST(menu) { init_function_pointers(); @@ -3539,4 +3654,5 @@ START_TEST(menu) test_menu_cancelmode(); test_menu_maxdepth(); test_menu_circref(); + test_emptypopup(); } diff --git a/rostests/winetests/user32/monitor.c b/rostests/winetests/user32/monitor.c index b5098604bf0..a2df20eba9d 100644 --- a/rostests/winetests/user32/monitor.c +++ b/rostests/winetests/user32/monitor.c @@ -31,6 +31,7 @@ static BOOL (WINAPI *pEnumDisplayDevicesA)(LPCSTR,DWORD,LPDISPLAY_DEVICEA,DWORD) static BOOL (WINAPI *pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM); static BOOL (WINAPI *pGetMonitorInfoA)(HMONITOR,LPMONITORINFO); static HMONITOR (WINAPI *pMonitorFromPoint)(POINT,DWORD); +static HMONITOR (WINAPI *pMonitorFromRect)(LPCRECT,DWORD); static HMONITOR (WINAPI *pMonitorFromWindow)(HWND,DWORD); static void init_function_pointers(void) @@ -48,6 +49,7 @@ static void init_function_pointers(void) GET_PROC(EnumDisplayMonitors) GET_PROC(GetMonitorInfoA) GET_PROC(MonitorFromPoint) + GET_PROC(MonitorFromRect) GET_PROC(MonitorFromWindow) #undef GET_PROC @@ -161,7 +163,7 @@ static void test_ChangeDisplaySettingsEx(void) } SetLastError(0xdeadbeef); - res = EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm); + res = EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dm); ok(res, "EnumDisplaySettings error %u\n", GetLastError()); width = dm.dmPelsWidth; @@ -291,12 +293,13 @@ static void test_ChangeDisplaySettingsEx(void) static void test_monitors(void) { - HMONITOR monitor, primary; + HMONITOR monitor, primary, nearest; POINT pt; + RECT rc; - if (!pMonitorFromPoint || !pMonitorFromWindow) + if (!pMonitorFromPoint || !pMonitorFromWindow || !pMonitorFromRect) { - win_skip("MonitorFromPoint or MonitorFromWindow are not available\n"); + win_skip("MonitorFromPoint, MonitorFromWindow, or MonitorFromRect is not available\n"); return; } @@ -310,6 +313,65 @@ static void test_monitors(void) ok( monitor == primary, "got %p, should get primary %p for MONITOR_DEFAULTTOPRIMARY\n", monitor, primary ); monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTONEAREST ); ok( monitor == primary, "got %p, should get primary %p for MONITOR_DEFAULTTONEAREST\n", monitor, primary ); + + SetRect( &rc, 0, 0, 1, 1 ); + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL ); + ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary ); + + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTOPRIMARY ); + ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary ); + + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONEAREST ); + ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary ); + + /* Empty rect at 0,0 is considered inside the primary monitor */ + SetRect( &rc, 0, 0, -1, -1 ); + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL ); + ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary ); + + /* Even if there is a monitor left of the primary, the primary will have the most overlapping area */ + SetRect( &rc, -1, 0, 2, 1 ); + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL ); + ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary ); + + /* But the width of the rect doesn't matter if it's empty. */ + SetRect( &rc, -1, 0, 2, -1 ); + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL ); + ok( monitor != primary, "got primary %p\n", monitor ); + + if (!pGetMonitorInfoA) + { + win_skip("GetMonitorInfoA is not available\n"); + return; + } + + /* Search for a monitor that has no others equally near to (left, top-1) */ + SetRect( &rc, -1, -2, 2, 0 ); + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL ); + nearest = primary; + while (monitor != NULL) + { + MONITORINFO mi; + BOOL ret; + ok( monitor != primary, "got primary %p\n", monitor ); + nearest = monitor; + mi.cbSize = sizeof(mi); + ret = pGetMonitorInfoA( monitor, &mi ); + ok( ret, "GetMonitorInfo failed\n" ); + SetRect( &rc, mi.rcMonitor.left-1, mi.rcMonitor.top-2, mi.rcMonitor.left+2, mi.rcMonitor.top ); + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL ); + } + + SetRect( &rc, rc.left+1, rc.top+1, rc.left+2, rc.top+2 ); + + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL ); + ok( monitor == NULL, "got %p\n", monitor ); + + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTOPRIMARY ); + ok( monitor == primary, "got %p, should get primary %p\n", monitor, primary ); + + monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONEAREST ); + ok( monitor == nearest, "got %p, should get nearest %p\n", monitor, nearest ); } static BOOL CALLBACK find_primary_mon(HMONITOR hmon, HDC hdc, LPRECT rc, LPARAM lp) @@ -356,12 +418,12 @@ static void test_work_area(void) mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom); SetLastError(0xdeadbeef); - ret = SystemParametersInfo(SPI_GETWORKAREA, 0, &rc_work, 0); + ret = SystemParametersInfoA(SPI_GETWORKAREA, 0, &rc_work, 0); ok(ret, "SystemParametersInfo error %u\n", GetLastError()); trace("work area (%d,%d-%d,%d)\n", rc_work.left, rc_work.top, rc_work.right, rc_work.bottom); ok(EqualRect(&rc_work, &mi.rcWork), "work area is different\n"); - hwnd = CreateWindowEx(0, "static", NULL, WS_OVERLAPPEDWINDOW|WS_VISIBLE,100,100,10,10,0,0,0,NULL); + hwnd = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW|WS_VISIBLE,100,100,10,10,0,0,0,NULL); ok(hwnd != 0, "CreateWindowEx failed\n"); ret = GetWindowRect(hwnd, &rc_normal); @@ -383,7 +445,7 @@ static void test_work_area(void) else ok(EqualRect(&rc_normal, &wp.rcNormalPosition), "normal pos is different\n"); - SetWindowLong(hwnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW); + SetWindowLongA(hwnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW); wp.length = sizeof(wp); ret = GetWindowPlacement(hwnd, &wp); diff --git a/rostests/winetests/user32/msg.c b/rostests/winetests/user32/msg.c index a0c610b8c3f..9ed7e2ef2ce 100755 --- a/rostests/winetests/user32/msg.c +++ b/rostests/winetests/user32/msg.c @@ -444,20 +444,20 @@ static const struct message WmShowOverlappedSeq[] = { { WM_NCPAINT, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, { WM_ERASEBKGND, sent|optional }, - { HCBT_ACTIVATE, hook }, + { HCBT_ACTIVATE, hook|optional }, { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_NCPAINT, sent|wparam|optional, 1 }, - { WM_ACTIVATEAPP, sent|wparam, 1 }, - { WM_NCACTIVATE, sent|wparam, 1 }, + { WM_ACTIVATEAPP, sent|wparam|optional, 1 }, + { WM_NCACTIVATE, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, - { WM_ACTIVATE, sent|wparam, 1 }, - { HCBT_SETFOCUS, hook }, + { WM_ACTIVATE, sent|wparam|optional, 1 }, + { HCBT_SETFOCUS, hook|optional }, { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_SETFOCUS, sent|wparam|defwinproc, 0 }, + { WM_SETFOCUS, sent|wparam|defwinproc|optional, 0 }, { WM_GETTEXT, sent|optional }, { WM_NCPAINT, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, @@ -488,19 +488,19 @@ static const struct message WmShowMaxOverlappedSeq[] = { { WM_GETMINMAXINFO, sent|defwinproc }, { WM_NCCALCSIZE, sent|wparam, TRUE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 }, - { HCBT_ACTIVATE, hook }, + { HCBT_ACTIVATE, hook|optional }, { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, - { WM_ACTIVATEAPP, sent|wparam, 1 }, - { WM_NCACTIVATE, sent|wparam, 1 }, + { WM_ACTIVATEAPP, sent|wparam|optional, 1 }, + { WM_NCACTIVATE, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, - { WM_ACTIVATE, sent|wparam, 1 }, - { HCBT_SETFOCUS, hook }, + { WM_ACTIVATE, sent|wparam|optional, 1 }, + { HCBT_SETFOCUS, hook|optional }, { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_SETFOCUS, sent|wparam|defwinproc, 0 }, + { WM_SETFOCUS, sent|wparam|defwinproc|optional, 0 }, { WM_GETTEXT, sent|optional }, { WM_NCPAINT, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, @@ -549,20 +549,27 @@ static const struct message WmShowRestoreMinOverlappedSeq[] = { { HCBT_MINMAX, hook|lparam, 0, SW_RESTORE }, { WM_QUERYOPEN, sent|optional }, { WM_GETTEXT, sent|optional }, - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_STATECHANGED|SWP_NOCOPYBITS }, - { WM_GETMINMAXINFO, sent|defwinproc }, - { WM_NCCALCSIZE, sent|wparam, TRUE }, - { HCBT_ACTIVATE, hook }, + { WM_NCACTIVATE, sent|wparam|optional, 1 }, + { WM_WINDOWPOSCHANGING, sent|optional }, /* SWP_NOSIZE|SWP_NOMOVE */ + { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, + { WM_NCCALCSIZE, sent|wparam|optional, TRUE }, + { WM_MOVE, sent|optional }, + { WM_SIZE, sent|wparam|optional, SIZE_RESTORED }, + { WM_GETTEXT, sent|optional }, + { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_FRAMECHANGED|SWP_STATECHANGED|SWP_NOCOPYBITS }, + { WM_GETMINMAXINFO, sent|defwinproc|optional }, + { WM_NCCALCSIZE, sent|wparam|optional, TRUE }, + { HCBT_ACTIVATE, hook|optional }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, - { WM_ACTIVATEAPP, sent|wparam, 1 }, - { WM_NCACTIVATE, sent|wparam, 1 }, + { WM_ACTIVATEAPP, sent|wparam|optional, 1 }, + { WM_NCACTIVATE, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, - { WM_ACTIVATE, sent|wparam, 1 }, - { HCBT_SETFOCUS, hook }, + { WM_ACTIVATE, sent|wparam|optional, 1 }, + { HCBT_SETFOCUS, hook|optional }, { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, - { WM_SETFOCUS, sent|wparam|defwinproc, 0 }, + { WM_SETFOCUS, sent|wparam|defwinproc|optional, 0 }, { WM_GETTEXT, sent|optional }, { WM_NCPAINT, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, @@ -570,9 +577,13 @@ static const struct message WmShowRestoreMinOverlappedSeq[] = { { WM_WINDOWPOSCHANGED, sent|wparam, SWP_STATECHANGED|SWP_FRAMECHANGED|SWP_NOCOPYBITS }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|defwinproc|wparam, SIZE_RESTORED }, + { HCBT_SETFOCUS, hook|optional }, + { WM_SETFOCUS, sent|wparam|optional, 0 }, { WM_NCCALCSIZE, sent|wparam|optional, TRUE }, { WM_NCPAINT, sent|wparam|optional, 1 }, { WM_ERASEBKGND, sent|optional }, + { HCBT_SETFOCUS, hook|optional }, + { WM_SETFOCUS, sent|wparam|optional, 0 }, { WM_ACTIVATE, sent|wparam, 1 }, { WM_GETTEXT, sent|optional }, { WM_PAINT, sent|optional }, @@ -584,9 +595,9 @@ static const struct message WmShowRestoreMinOverlappedSeq[] = { /* ShowWindow(SW_SHOWMINIMIZED) for a not visible overlapped window */ static const struct message WmShowMinOverlappedSeq[] = { { HCBT_MINMAX, hook|lparam, 0, SW_MINIMIZE }, - { HCBT_SETFOCUS, hook }, + { HCBT_SETFOCUS, hook|optional }, { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_KILLFOCUS, sent }, + { WM_KILLFOCUS, sent|optional }, { WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, { WM_IME_NOTIFY, sent|wparam|optional|defwinproc, 1 }, { WM_GETTEXT, sent|optional }, @@ -603,10 +614,10 @@ static const struct message WmShowMinOverlappedSeq[] = { { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, - { WM_NCACTIVATE, sent|wparam, 0 }, + { WM_NCACTIVATE, sent|wparam|optional, 0 }, { WM_GETTEXT, sent|defwinproc|optional }, - { WM_ACTIVATE, sent }, - { WM_ACTIVATEAPP, sent|wparam, 0 }, + { WM_ACTIVATE, sent|optional }, + { WM_ACTIVATEAPP, sent|wparam|optional, 0 }, /* Vista sometimes restores the window right away... */ { WM_SYSCOMMAND, sent|optional|wparam, SC_RESTORE }, @@ -652,7 +663,7 @@ static const struct message WmHideOverlappedSeq[] = { { WM_ACTIVATE, sent|wparam|optional, 0 }, { WM_ACTIVATEAPP, sent|wparam|optional, 0 }, { HCBT_SETFOCUS, hook|optional }, - { WM_KILLFOCUS, sent|wparam, 0 }, + { WM_KILLFOCUS, sent|wparam|optional, 0 }, { WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, { WM_IME_NOTIFY, sent|wparam|optional|defwinproc, 1 }, { 0 } @@ -1719,6 +1730,38 @@ static const struct message WmSHOWNATopInvisible[] = { { 0 } }; +static const struct message WmTrackPopupMenu[] = { + { HCBT_CREATEWND, hook }, + { WM_ENTERMENULOOP, sent|wparam|lparam, TRUE, 0 }, + { WM_INITMENU, sent|lparam, 0, 0 }, + { WM_INITMENUPOPUP, sent|lparam, 0, 0 }, + { 0x0093, sent|optional }, + { 0x0094, sent|optional }, + { 0x0094, sent|optional }, + { WM_ENTERIDLE, sent|wparam, 2 }, + { WM_CAPTURECHANGED, sent }, + { HCBT_DESTROYWND, hook }, + { WM_UNINITMENUPOPUP, sent|lparam, 0, 0 }, + { WM_MENUSELECT, sent|wparam|lparam, 0xffff0000, 0 }, + { WM_EXITMENULOOP, sent|wparam|lparam, 1, 0 }, + { 0 } +}; + +static const struct message WmTrackPopupMenuEmpty[] = { + { HCBT_CREATEWND, hook }, + { WM_ENTERMENULOOP, sent|wparam|lparam, TRUE, 0 }, + { WM_INITMENU, sent|lparam, 0, 0 }, + { WM_INITMENUPOPUP, sent|lparam, 0, 0 }, + { 0x0093, sent|optional }, + { 0x0094, sent|optional }, + { 0x0094, sent|optional }, + { WM_CAPTURECHANGED, sent }, + { WM_EXITMENULOOP, sent|wparam|lparam, 1, 0 }, + { HCBT_DESTROYWND, hook }, + { WM_UNINITMENUPOPUP, sent|lparam, 0, 0 }, + { 0 } +}; + static BOOL after_end_dialog, test_def_id, paint_loop_done; static int sequence_cnt, sequence_size; static struct recvd_message* sequence; @@ -4516,6 +4559,7 @@ static void test_messages(void) HMENU hmenu; MSG msg; LRESULT res; + POINT pos; flush_sequence(); @@ -4776,13 +4820,23 @@ static void test_messages(void) after_end_dialog = FALSE; test_def_id = FALSE; - hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_POPUP, + ok(GetCursorPos(&pos), "GetCursorPos failed\n"); + ok(SetCursorPos(109, 109), "SetCursorPos failed\n"); + + hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_POPUP|WS_CHILD, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL); ok(hwnd != 0, "Failed to create custom dialog window\n"); flush_sequence(); trace("call ShowWindow(%p, SW_SHOW)\n", hwnd); ShowWindow(hwnd, SW_SHOW); ok_sequence(WmShowCustomDialogSeq, "ShowCustomDialog", TRUE); + + flush_events(); + flush_sequence(); + ok(DrawMenuBar(hwnd), "DrawMenuBar failed: %d\n", GetLastError()); + flush_events(); + ok_sequence(WmDrawMenuBarSeq, "DrawMenuBar", FALSE); + ok(SetCursorPos(pos.x, pos.y), "SetCursorPos failed\n"); DestroyWindow(hwnd); flush_sequence(); @@ -4793,7 +4847,8 @@ static void test_messages(void) flush_sequence(); /* Message sequence for SetMenu */ - ok(!DrawMenuBar(hwnd), "DrawMenuBar should return FALSE for a window without a menu\n"); + ok(!DrawMenuBar(hwnd), "DrawMenuBar should return FALSE for a destroyed window\n"); + ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "last error is %d\n", GetLastError()); ok_sequence(WmEmptySeq, "DrawMenuBar for a window without a menu", FALSE); hmenu = CreateMenu(); @@ -10816,8 +10871,11 @@ static const struct message WmShowNoActivate_1[] = { }; static const struct message WmShowNoActivate_2[] = { { HCBT_MINMAX, hook|lparam, 0, SW_SHOWNOACTIVATE }, - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, - { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, + { HCBT_ACTIVATE, hook|optional }, + { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, + { HCBT_SETFOCUS, hook|optional }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|defwinproc, SIZE_RESTORED }, { HCBT_SETFOCUS, hook|optional }, @@ -10937,16 +10995,18 @@ static const struct message WmMinimize_1[] = { static const struct message WmMinimize_2[] = { { HCBT_MINMAX, hook|lparam, 0, SW_MINIMIZE }, { HCBT_SETFOCUS, hook|optional }, - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, - { WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 }, { 0 } }; static const struct message WmMinimize_3[] = { { HCBT_MINMAX, hook|lparam, 0, SW_MINIMIZE }, - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, - { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, + { HCBT_ACTIVATE, hook|optional }, + { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 }, { 0 } @@ -11284,12 +11344,9 @@ if (0) /* FIXME: Wine behaves completely different here */ win_rc.left, win_rc.top, win_rc.right, win_rc.bottom, wp.rcNormalPosition.left, wp.rcNormalPosition.top, wp.rcNormalPosition.right, wp.rcNormalPosition.bottom); - - flush_events(); - flush_sequence(); } - DestroyWindow(hwnd); + flush_events(); } static INT_PTR WINAPI test_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -12084,7 +12141,11 @@ static void test_unicode_wm_char(void) PostMessageW( hwnd, WM_CHAR, 0x3b1, 0 ); - ok( GetMessageW( &msg, hwnd, 0, 0 ), "no message\n" ); + while (GetMessageW( &msg, hwnd, 0, 0 )) + { + if (!ignore_message( msg.message )) break; + } + ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd ); ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message ); ok( msg.wParam == 0x3b1, "bad wparam %lx\n", msg.wParam ); @@ -14260,6 +14321,80 @@ static void test_layered_window(void) DeleteObject( bmp ); } +static HMENU hpopupmenu; + +static LRESULT WINAPI cancel_popup_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + if (ignore_message( message )) return 0; + + switch (message) { + case WM_ENTERIDLE: + todo_wine ok(GetCapture() == hwnd, "expected %p, got %p\n", hwnd, GetCapture()); + EndMenu(); + break; + case WM_INITMENU: + case WM_INITMENUPOPUP: + case WM_UNINITMENUPOPUP: + ok((HMENU)wParam == hpopupmenu, "expected %p, got %lx\n", hpopupmenu, wParam); + break; + } + + return MsgCheckProc (FALSE, hwnd, message, wParam, lParam); +} + +static void test_TrackPopupMenu(void) +{ + HWND hwnd; + BOOL ret; + + hwnd = CreateWindowExA(0, "TestWindowClass", NULL, 0, + 0, 0, 1, 1, 0, + NULL, NULL, 0); + ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); + + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)cancel_popup_proc); + + hpopupmenu = CreatePopupMenu(); + ok(hpopupmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); + + AppendMenuA(hpopupmenu, MF_STRING, 100, "item 1"); + AppendMenuA(hpopupmenu, MF_STRING, 100, "item 2"); + + flush_events(); + flush_sequence(); + ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL); + ok_sequence(WmTrackPopupMenu, "TrackPopupMenu", TRUE); + ok(ret == 1, "TrackPopupMenu failed with error %i\n", GetLastError()); + + DestroyMenu(hpopupmenu); + DestroyWindow(hwnd); +} + +static void test_TrackPopupMenuEmpty(void) +{ + HWND hwnd; + BOOL ret; + + hwnd = CreateWindowExA(0, "TestWindowClass", NULL, 0, + 0, 0, 1, 1, 0, + NULL, NULL, 0); + ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); + + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)cancel_popup_proc); + + hpopupmenu = CreatePopupMenu(); + ok(hpopupmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); + + flush_events(); + flush_sequence(); + ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL); + ok_sequence(WmTrackPopupMenuEmpty, "TrackPopupMenuEmpty", TRUE); + todo_wine ok(ret == 0, "TrackPopupMenu succeeded\n"); + + DestroyMenu(hpopupmenu); + DestroyWindow(hwnd); +} + static void init_funcs(void) { HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); @@ -14337,7 +14472,6 @@ START_TEST(msg) pUnhookWinEvent = 0; } hEvent_hook = 0; - test_SetFocus(); test_SetParent(); test_PostMessage(); @@ -14357,9 +14491,6 @@ START_TEST(msg) test_combobox_messages(); test_wmime_keydown_message(); test_paint_messages(); - if(!winetest_interactive) - skip("ReactOS ActivateActCtx seems to be broken.\n"); - else test_interthread_messages(); test_message_conversion(); test_accelerators(); @@ -14392,6 +14523,8 @@ START_TEST(msg) test_keyflags(); test_hotkey(); test_layered_window(); + test_TrackPopupMenu(); + test_TrackPopupMenuEmpty(); /* keep it the last test, under Windows it tends to break the tests * which rely on active/foreground windows being correct. */ diff --git a/rostests/winetests/user32/resource.c b/rostests/winetests/user32/resource.c index 346cc2a8944..9cb73807641 100755 --- a/rostests/winetests/user32/resource.c +++ b/rostests/winetests/user32/resource.c @@ -23,7 +23,7 @@ #include "wine/test.h" -static UINT (WINAPI *pPrivateExtractIconsA)(LPCTSTR, int, int, int, HICON *, UINT *, UINT, UINT) = NULL; +static UINT (WINAPI *pPrivateExtractIconsA)(LPCSTR, int, int, int, HICON *, UINT *, UINT, UINT) = NULL; static void init_function_pointers(void) { @@ -33,7 +33,7 @@ static void init_function_pointers(void) static void test_LoadStringW(void) { - HINSTANCE hInst = GetModuleHandle(NULL); + HINSTANCE hInst = GetModuleHandleA(NULL); WCHAR copiedstringw[128], returnedstringw[128], *resourcepointer = NULL; char copiedstring[128], returnedstring[128]; int length1, length2, retvalue; @@ -79,7 +79,7 @@ static void test_LoadStringW(void) static void test_LoadStringA (void) { - HINSTANCE hInst = GetModuleHandle (NULL); + HINSTANCE hInst = GetModuleHandleA(NULL); static const char str[] = "String resource"; /* same in resource.rc */ char buf[128]; struct string_test { @@ -148,7 +148,7 @@ static void test_accel1(void) ac[n].key = 0; ac[n++].fVirt = 0; - hAccel = CreateAcceleratorTable( &ac[0], n ); + hAccel = CreateAcceleratorTableA( &ac[0], n ); ok( hAccel != NULL, "create accelerator table\n"); r = DestroyAcceleratorTable( hAccel ); @@ -176,13 +176,13 @@ static void test_accel1(void) ac[n].key = 0xffff; ac[n++].fVirt = 0x0001; - hAccel = CreateAcceleratorTable( &ac[0], n ); + hAccel = CreateAcceleratorTableA( &ac[0], n ); ok( hAccel != NULL, "create accelerator table\n"); - r = CopyAcceleratorTable( hAccel, NULL, 0 ); + r = CopyAcceleratorTableA( hAccel, NULL, 0 ); ok( r == n, "two entries in table %u/%u\n", r, n); - r = CopyAcceleratorTable( hAccel, &ac[0], n ); + r = CopyAcceleratorTableA( hAccel, &ac[0], n ); ok( r == n, "still should be two entries in table %u/%u\n", r, n); n=0; @@ -213,7 +213,7 @@ done: r = DestroyAcceleratorTable( hAccel ); ok( r, "destroy accelerator table\n"); - hAccel = CreateAcceleratorTable( &ac[0], 0 ); + hAccel = CreateAcceleratorTableA( &ac[0], 0 ); ok( !hAccel || broken(hAccel != NULL), /* nt4 */ "zero elements should fail\n"); /* these will on crash win2k @@ -246,36 +246,36 @@ static void test_accel2(void) */ /* try a zero count */ - hac = CreateAcceleratorTable( &ac[0], 0 ); + hac = CreateAcceleratorTableA( &ac[0], 0 ); ok( !hac || broken(hac != NULL), /* nt4 */ "fail\n"); if (!hac) ok( !DestroyAcceleratorTable( hac ), "destroy failed\n"); /* creating one accelerator should work */ - hac = CreateAcceleratorTable( &ac[0], 1 ); + hac = CreateAcceleratorTableA( &ac[0], 1 ); ok( hac != NULL , "fail\n"); - ok( 1 == CopyAcceleratorTable( hac, out, 1 ), "copy failed\n"); + ok( 1 == CopyAcceleratorTableA( hac, out, 1 ), "copy failed\n"); ok( DestroyAcceleratorTable( hac ), "destroy failed\n"); /* how about two of the same type? */ - hac = CreateAcceleratorTable( &ac[0], 2); + hac = CreateAcceleratorTableA( &ac[0], 2); ok( hac != NULL , "fail\n"); - res = CopyAcceleratorTable( hac, NULL, 100 ); + res = CopyAcceleratorTableA( hac, NULL, 100 ); ok( res == 2, "copy null failed %d\n", res); - res = CopyAcceleratorTable( hac, NULL, 0 ); + res = CopyAcceleratorTableA( hac, NULL, 0 ); ok( res == 2, "copy null failed %d\n", res); - res = CopyAcceleratorTable( hac, NULL, 1 ); + res = CopyAcceleratorTableA( hac, NULL, 1 ); ok( res == 2, "copy null failed %d\n", res); - ok( 1 == CopyAcceleratorTable( hac, out, 1 ), "copy 1 failed\n"); - ok( 2 == CopyAcceleratorTable( hac, out, 2 ), "copy 2 failed\n"); + ok( 1 == CopyAcceleratorTableA( hac, out, 1 ), "copy 1 failed\n"); + ok( 2 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n"); ok( DestroyAcceleratorTable( hac ), "destroy failed\n"); /* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */ /* how about two of the same type with a non-zero key? */ ac[0].key = 0x20; ac[1].key = 0x20; - hac = CreateAcceleratorTable( &ac[0], 2); + hac = CreateAcceleratorTableA( &ac[0], 2); ok( hac != NULL , "fail\n"); - ok( 2 == CopyAcceleratorTable( hac, out, 2 ), "copy 2 failed\n"); + ok( 2 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n"); ok( DestroyAcceleratorTable( hac ), "destroy failed\n"); /* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */ @@ -284,17 +284,17 @@ static void test_accel2(void) ac[0].key = 0x40; ac[1].fVirt = FVIRTKEY; ac[1].key = 0x40; - hac = CreateAcceleratorTable( &ac[0], 2); + hac = CreateAcceleratorTableA( &ac[0], 2); ok( hac != NULL , "fail\n"); - ok( 2 == CopyAcceleratorTable( hac, out, 2 ), "copy 2 failed\n"); + ok( 2 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n"); /* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */ ok( DestroyAcceleratorTable( hac ), "destroy failed\n"); /* how virtual key codes */ ac[0].fVirt = FVIRTKEY; - hac = CreateAcceleratorTable( &ac[0], 1); + hac = CreateAcceleratorTableA( &ac[0], 1); ok( hac != NULL , "fail\n"); - ok( 1 == CopyAcceleratorTable( hac, out, 2 ), "copy 2 failed\n"); + ok( 1 == CopyAcceleratorTableA( hac, out, 2 ), "copy 2 failed\n"); /* ok( !memcmp( ac, out, sizeof ac/2 ), "tables different\n"); */ ok( DestroyAcceleratorTable( hac ), "destroy failed\n"); @@ -302,9 +302,9 @@ static void test_accel2(void) ac[0].cmd = 0xffff; ac[0].fVirt = 0xff; ac[0].key = 0xffff; - hac = CreateAcceleratorTable( &ac[0], 1); + hac = CreateAcceleratorTableA( &ac[0], 1); ok( hac != NULL , "fail\n"); - ok( 1 == CopyAcceleratorTable( hac, out, 1 ), "copy 1 failed\n"); + ok( 1 == CopyAcceleratorTableA( hac, out, 1 ), "copy 1 failed\n"); /* ok( memcmp( ac, out, sizeof ac/2 ), "tables not different\n"); */ ok( out[0].cmd == ac[0].cmd, "cmd modified\n"); ok( out[0].fVirt == (ac[0].fVirt&0x7f), "fVirt not modified\n"); @@ -313,9 +313,9 @@ static void test_accel2(void) /* how turning on all bits? */ memset( ac, 0xff, sizeof ac ); - hac = CreateAcceleratorTable( &ac[0], 2); + hac = CreateAcceleratorTableA( &ac[0], 2); ok( hac != NULL , "fail\n"); - res = CopyAcceleratorTable( hac, out, 2 ); + res = CopyAcceleratorTableA( hac, out, 2 ); ok( res == 2, "copy 2 failed %d\n", res); /* ok( memcmp( ac, out, sizeof ac ), "tables not different\n"); */ ok( out[0].cmd == ac[0].cmd, "cmd modified\n"); @@ -331,13 +331,32 @@ static void test_accel2(void) } static void test_PrivateExtractIcons(void) { - CONST CHAR szShell32Dll[] = "shell32.dll"; + const CHAR szShell32Dll[] = "shell32.dll"; HICON ahIcon[256]; - UINT aIconId[256]; - UINT cIcons, cIcons2; + UINT i, aIconId[256], cIcons, cIcons2; if (!pPrivateExtractIconsA) return; - + + cIcons = pPrivateExtractIconsA("", 0, 16, 16, ahIcon, aIconId, 1, 0); + ok(cIcons == ~0u, "got %u\n", cIcons); + + cIcons = pPrivateExtractIconsA("notepad.exe", 0, 16, 16, NULL, NULL, 1, 0); + ok(cIcons == 1 || broken(cIcons == 2) /* win2k */, "got %u\n", cIcons); + + ahIcon[0] = (HICON)0xdeadbeef; + cIcons = pPrivateExtractIconsA("notepad.exe", 0, 16, 16, ahIcon, NULL, 1, 0); + ok(cIcons == 1, "got %u\n", cIcons); + ok(ahIcon[0] != (HICON)0xdeadbeef, "icon not set\n"); + DestroyIcon(ahIcon[0]); + + ahIcon[0] = (HICON)0xdeadbeef; + aIconId[0] = 0xdeadbeef; + cIcons = pPrivateExtractIconsA("notepad.exe", 0, 16, 16, ahIcon, aIconId, 1, 0); + ok(cIcons == 1, "got %u\n", cIcons); + ok(ahIcon[0] != (HICON)0xdeadbeef, "icon not set\n"); + ok(aIconId[0] != 0xdeadbeef, "id not set\n"); + DestroyIcon(ahIcon[0]); + cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, NULL, NULL, 0, 0); cIcons2 = pPrivateExtractIconsA(szShell32Dll, 4, MAKELONG(32,16), MAKELONG(32,16), NULL, NULL, 256, 0); @@ -350,14 +369,18 @@ static void test_PrivateExtractIcons(void) { cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, ahIcon, aIconId, 3, 0); ok(cIcons == 3, "Three icons requested got cIcons=%d\n", cIcons); + for (i = 0; i < cIcons; i++) DestroyIcon(ahIcon[i]); /* count must be a multiple of two when getting two sizes */ cIcons = pPrivateExtractIconsA(szShell32Dll, 0, MAKELONG(16,32), MAKELONG(16,32), ahIcon, aIconId, 3, 0); ok(cIcons == 0 /* vista */ || cIcons == 4, "Three icons requested got cIcons=%d\n", cIcons); + for (i = 0; i < cIcons; i++) DestroyIcon(ahIcon[i]); + cIcons = pPrivateExtractIconsA(szShell32Dll, 0, MAKELONG(16,32), MAKELONG(16,32), ahIcon, aIconId, 4, 0); ok(cIcons == 4, "Four icons requested got cIcons=%d\n", cIcons); + for (i = 0; i < cIcons; i++) DestroyIcon(ahIcon[i]); } static void test_LoadImage(void) @@ -365,14 +388,14 @@ static void test_LoadImage(void) HBITMAP bmp; HRSRC hres; - bmp = LoadBitmapA(GetModuleHandle(NULL), MAKEINTRESOURCE(100)); + bmp = LoadBitmapA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(100)); ok(bmp != NULL, "Could not load a bitmap resource\n"); if (bmp) DeleteObject(bmp); - hres = FindResource(GetModuleHandle(NULL), "#100", RT_BITMAP); + hres = FindResourceA(GetModuleHandleA(NULL), "#100", (LPCSTR)RT_BITMAP); ok(hres != NULL, "Could not find a bitmap resource with a numeric string\n"); - bmp = LoadBitmapA(GetModuleHandle(NULL), "#100"); + bmp = LoadBitmapA(GetModuleHandleA(NULL), "#100"); ok(bmp != NULL, "Could not load a bitmap resource with a numeric string\n"); if (bmp) DeleteObject(bmp); } diff --git a/rostests/winetests/user32/scroll.c b/rostests/winetests/user32/scroll.c index 0f0ede23fed..df37534806e 100644 --- a/rostests/winetests/user32/scroll.c +++ b/rostests/winetests/user32/scroll.c @@ -56,7 +56,7 @@ static void scrollbar_test_track(void) { /* test that scrollbar tracking is terminated when * the control looses mouse capture */ - SendMessage( hScroll, WM_LBUTTONDOWN, 0, MAKELPARAM( 1, 1)); + SendMessageA( hScroll, WM_LBUTTONDOWN, 0, MAKELPARAM( 1, 1)); /* a normal return from the sendmessage */ /* not normal for instance by closing the windws */ ok( IsWindow( hScroll), "Scrollbar has gone!\n"); @@ -467,7 +467,7 @@ static void scrollbar_test_init(void) wc.cbSize = sizeof wc; wc.style = CS_VREDRAW | CS_HREDRAW; wc.hInstance = GetModuleHandleA(0); - wc.hCursor = LoadCursorA(NULL, IDC_ARROW); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wc.hbrBackground = GetStockObject(WHITE_BRUSH); wc.lpszClassName = cls_name; wc.lpfnWndProc = scroll_init_proc; @@ -495,7 +495,7 @@ START_TEST ( scroll ) wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; - wc.hCursor = LoadCursorA(NULL, IDC_IBEAM); + wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_IBEAM); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = "MyTestWnd"; diff --git a/rostests/winetests/user32/static.c b/rostests/winetests/user32/static.c index 13955aa4cb7..d4aa9b1f674 100644 --- a/rostests/winetests/user32/static.c +++ b/rostests/winetests/user32/static.c @@ -50,14 +50,14 @@ static void flush_events(void) while (diff > 0) { if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break; - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); diff = time - GetTickCount(); } } static HWND build_static(DWORD style) { - return CreateWindow("static", "Test", WS_VISIBLE|WS_CHILD|style, 5, 5, 100, 100, hMainWnd, (HMENU)CTRL_ID, NULL, 0); + return CreateWindowA("static", "Test", WS_VISIBLE|WS_CHILD|style, 5, 5, 100, 100, hMainWnd, (HMENU)CTRL_ID, NULL, 0); } static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) @@ -76,7 +76,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lpara break; } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } static void test_updates(int style, int flags) @@ -119,24 +119,24 @@ static void test_updates(int style, int flags) START_TEST(static) { - static char szClassName[] = "testclass"; - WNDCLASSEX wndclass; + static const char szClassName[] = "testclass"; + WNDCLASSEXA wndclass; wndclass.cbSize = sizeof(wndclass); wndclass.style = CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = WndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; - wndclass.hInstance = GetModuleHandle(NULL); - wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wndclass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); - wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass.hInstance = GetModuleHandleA(NULL); + wndclass.hIcon = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); + wndclass.hIconSm = LoadIconA(NULL, (LPCSTR)IDI_APPLICATION); + wndclass.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wndclass.hbrBackground = GetStockObject(WHITE_BRUSH); wndclass.lpszClassName = szClassName; wndclass.lpszMenuName = NULL; - RegisterClassEx(&wndclass); + RegisterClassExA(&wndclass); - hMainWnd = CreateWindow(szClassName, "Test", WS_OVERLAPPEDWINDOW, 0, 0, 500, 500, NULL, NULL, GetModuleHandle(NULL), NULL); + hMainWnd = CreateWindowA(szClassName, "Test", WS_OVERLAPPEDWINDOW, 0, 0, 500, 500, NULL, NULL, GetModuleHandleA(NULL), NULL); ShowWindow(hMainWnd, SW_SHOW); test_updates(0, 0); diff --git a/rostests/winetests/user32/sysparams.c b/rostests/winetests/user32/sysparams.c index d705e78d874..6c3489fc847 100755 --- a/rostests/winetests/user32/sysparams.c +++ b/rostests/winetests/user32/sysparams.c @@ -2869,8 +2869,9 @@ static void test_EnumDisplaySettings(void) if (!EnumDisplaySettingsA(NULL, num, &devmode)) { DWORD le = GetLastError(); ok(le == ERROR_NO_MORE_FILES || + le == ERROR_MOD_NOT_FOUND /* Win8 */ || le == 0xdeadbeef, /* XP, 2003 */ - "Expected ERROR_NO_MORE_FILES or 0xdeadbeef, got %d for %d\n", le, num); + "Expected ERROR_NO_MORE_FILES, ERROR_MOD_NOT_FOUND or 0xdeadbeef, got %d for %d\n", le, num); break; } num++; diff --git a/rostests/winetests/user32/uitools.c b/rostests/winetests/user32/uitools.c index c3f55083c05..5f10b0088ad 100644 --- a/rostests/winetests/user32/uitools.c +++ b/rostests/winetests/user32/uitools.c @@ -63,7 +63,57 @@ static void test_FillRect(void) ReleaseDC(0, hdc); } +static void test_SubtractRect(void) +{ + RECT rect1; + RECT rect2; + RECT rectr; + BOOL result; + + /* source rectangles don't intersect */ + SetRect(&rect1, 50, 50, 150, 100); + SetRect(&rect2, 250, 200, 1500, 1000); + result = SubtractRect(&rectr, &rect1, &rect2); + ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n"); + ok(result && rectr.left == 50 && rectr.top == 50 && rectr.right ==150 + && rectr.bottom == 100, "wrong rect subtraction of SubtractRect " + "(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); + + /* source rect 2 partially overlaps rect 1 */ + SetRect(&rect1, 2431, 626, 3427, 1608); + SetRect(&rect2, 2499, 626, 3427, 1608); + result = SubtractRect(&rectr, &rect1, &rect2); + ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n"); + ok(result && rectr.left == 2431 && rectr.top == 626 && rectr.right == 2499 + && rectr.bottom == 1608, "wrong rect subtraction of SubtractRect " + "(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); + + /* source rect 2 partially overlaps rect 1 - dest is src rect 2 */ + SetRect(&rect1, 2431, 626, 3427, 1608); + SetRect(&rect2, 2499, 626, 3427, 1608); + result = SubtractRect(&rect2, &rect1, &rect2); + ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n"); + ok(result && rectr.left == 2431 && rectr.top == 626 && rectr.right == 2499 + && rectr.bottom == 1608, "wrong rect subtraction of SubtractRect " + "(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); + + /* source rect 2 completely overlaps rect 1 */ + SetRect(&rect1, 250, 250, 400, 500); + SetRect(&rect2, 50, 50, 1500, 1000); + result = SubtractRect(&rectr, &rect1, &rect2); + ok(!result, "SubtractRect returned TRUE but subtraction should be empty " + "(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); + + /* source rect 2 completely overlaps rect 1 - dest is src rect 2 */ + SetRect(&rect1, 250, 250, 400, 500); + SetRect(&rect2, 50, 50, 1500, 1000); + result = SubtractRect(&rect2, &rect1, &rect2); + ok(!result, "SubtractRect returned TRUE but subtraction should be empty " + "(dest rect={%d, %d, %d, %d})\n", rect2.left, rect2.top, rect2.right, rect2.bottom); +} + START_TEST(uitools) { test_FillRect(); + test_SubtractRect(); } diff --git a/rostests/winetests/user32/win.c b/rostests/winetests/user32/win.c index 0dc610fb158..7b5007b0720 100644 --- a/rostests/winetests/user32/win.c +++ b/rostests/winetests/user32/win.c @@ -97,7 +97,7 @@ static void flush_events( BOOL remove_messages ) { if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break; if (remove_messages) - while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); + while (PeekMessageA( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessageA( &msg ); diff = time - GetTickCount(); min_timeout = 50; } @@ -657,7 +657,7 @@ static DWORD CALLBACK enum_thread( void *arg ) "wrong error %u\n", GetLastError() ); } - PeekMessage( &msg, 0, 0, 0, PM_NOREMOVE ); /* make sure we have a message queue */ + PeekMessageA( &msg, 0, 0, 0, PM_NOREMOVE ); /* make sure we have a message queue */ count = 0; ret = EnumThreadWindows( GetCurrentThreadId(), enum_proc, (LPARAM)&count ); @@ -840,7 +840,7 @@ static BOOL RegisterWindowClasses(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "MainWindowClass"; @@ -853,7 +853,7 @@ static BOOL RegisterWindowClasses(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "ToolWindowClass"; @@ -895,14 +895,15 @@ static void verify_window_info(const char *hook, HWND hwnd, const WINDOWINFO *in /* win2k and XP return broken border info in GetWindowInfo most of * the time, so there is no point in testing it. */ -#if 0 +if (0) +{ UINT border; ok(info->cxWindowBorders == (unsigned)(rcClient.left - rcWindow.left), "wrong cxWindowBorders %d != %d\n", info->cxWindowBorders, rcClient.left - rcWindow.left); border = min(rcWindow.bottom - rcClient.bottom, rcClient.top - rcWindow.top); ok(info->cyWindowBorders == border, "wrong cyWindowBorders %d != %d\n", info->cyWindowBorders, border); -#endif +} ok(info->atomWindowType == GetClassLongA(hwnd, GCW_ATOM), "wrong atomWindowType for %p in hook %s\n", hwnd, hook); ok(info->wCreatorVersion == 0x0400 /* NT4, Win2000, XP, Win2003 */ || @@ -1116,7 +1117,7 @@ static void test_shell_window(void) } shellWindow = GetShellWindow(); - hinst = GetModuleHandle(0); + hinst = GetModuleHandleA(NULL); hUser32 = GetModuleHandleA("user32"); SetShellWindow = (void *)GetProcAddress(hUser32, "SetShellWindow"); @@ -1151,7 +1152,7 @@ static void test_shell_window(void) CloseHandle(hProcess); } - hwnd1 = CreateWindowEx(0, TEXT("#32770"), TEXT("TEST1"), WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 100, 100, 300, 200, 0, 0, hinst, 0); + hwnd1 = CreateWindowExA(0, "#32770", "TEST1", WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 100, 100, 300, 200, 0, 0, hinst, 0); trace("created window 1: %p\n", hwnd1); ret = SetShellWindow(hwnd1); @@ -1172,22 +1173,22 @@ static void test_shell_window(void) /* passes on Win XP, but not on Win98 ok(!ret, "third call to SetShellWindow(hwnd1)\n"); */ - SetWindowLong(hwnd1, GWL_EXSTYLE, GetWindowLong(hwnd1,GWL_EXSTYLE)|WS_EX_TOPMOST); - ret = (GetWindowLong(hwnd1,GWL_EXSTYLE) & WS_EX_TOPMOST) != 0; + SetWindowLongA(hwnd1, GWL_EXSTYLE, GetWindowLongA(hwnd1,GWL_EXSTYLE)|WS_EX_TOPMOST); + ret = (GetWindowLongA(hwnd1,GWL_EXSTYLE) & WS_EX_TOPMOST) != 0; ok(!ret, "SetWindowExStyle(hwnd1, WS_EX_TOPMOST)\n"); ret = DestroyWindow(hwnd1); ok(ret, "DestroyWindow(hwnd1)\n"); - hwnd2 = CreateWindowEx(WS_EX_TOPMOST, TEXT("#32770"), TEXT("TEST2"), WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 150, 250, 300, 200, 0, 0, hinst, 0); + hwnd2 = CreateWindowExA(WS_EX_TOPMOST, "#32770", "TEST2", WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 150, 250, 300, 200, 0, 0, hinst, 0); trace("created window 2: %p\n", hwnd2); ret = SetShellWindow(hwnd2); ok(!ret, "SetShellWindow(hwnd2) with WS_EX_TOPMOST\n"); - hwnd3 = CreateWindowEx(0, TEXT("#32770"), TEXT("TEST3"), WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 200, 400, 300, 200, 0, 0, hinst, 0); + hwnd3 = CreateWindowExA(0, "#32770", "TEST3", WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 200, 400, 300, 200, 0, 0, hinst, 0); trace("created window 3: %p\n", hwnd3); - hwnd4 = CreateWindowEx(0, TEXT("#32770"), TEXT("TEST4"), WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 250, 500, 300, 200, 0, 0, hinst, 0); + hwnd4 = CreateWindowExA(0, "#32770", "TEST4", WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 250, 500, 300, 200, 0, 0, hinst, 0); trace("created window 4: %p\n", hwnd4); nextWnd = GetWindow(hwnd4, GW_HWNDNEXT); @@ -1212,7 +1213,7 @@ static void test_shell_window(void) shellWindow = GetShellWindow(); ok(shellWindow==hwnd4, "wrong shell window: %p - expected hwnd4\n", shellWindow); - hwnd5 = CreateWindowEx(0, TEXT("#32770"), TEXT("TEST5"), WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 300, 600, 300, 200, 0, 0, hinst, 0); + hwnd5 = CreateWindowExA(0, "#32770", "TEST5", WS_OVERLAPPEDWINDOW/*|WS_VISIBLE*/, 300, 600, 300, 200, 0, 0, hinst, 0); trace("created window 5: %p\n", hwnd5); ret = SetWindowPos(hwnd4, hwnd5, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); ok(ret, "SetWindowPos(hwnd4, hwnd5)\n"); @@ -1245,7 +1246,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) mdi_cs.szClass = "MDI_child_Class_1"; mdi_cs.szTitle = "MDI child"; - mdi_cs.hOwner = GetModuleHandle(0); + mdi_cs.hOwner = GetModuleHandleA(NULL); mdi_cs.x = CW_USEDEFAULT; mdi_cs.y = CW_USEDEFAULT; mdi_cs.cx = CW_USEDEFAULT; @@ -1308,7 +1309,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, GetModuleHandle(0), + mdi_client, GetModuleHandleA(NULL), (LPARAM)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); @@ -1320,7 +1321,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) 0x7fffffff, /* without WS_POPUP */ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, GetModuleHandle(0), + mdi_client, GetModuleHandleA(NULL), (LPARAM)mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); @@ -1332,7 +1333,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) 0xffffffff, /* with WS_POPUP */ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, GetModuleHandle(0), + mdi_client, GetModuleHandleA(NULL), (LPARAM)mdi_lParam_test_message); if (GetWindowLongA(mdi_client, GWL_STYLE) & MDIS_ALLCHILDSTYLES) { @@ -1353,7 +1354,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, GetModuleHandle(0), + mdi_client, GetModuleHandleA(NULL), (LPARAM)mdi_lParam_test_message); if (!mdi_child) { @@ -1374,7 +1375,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, 0, GetModuleHandle(0), + mdi_client, 0, GetModuleHandleA(NULL), mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); @@ -1386,7 +1387,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) 0x7fffffff, /* without WS_POPUP */ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, 0, GetModuleHandle(0), + mdi_client, 0, GetModuleHandleA(NULL), mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); @@ -1398,7 +1399,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) 0xffffffff, /* with WS_POPUP */ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, 0, GetModuleHandle(0), + mdi_client, 0, GetModuleHandleA(NULL), mdi_lParam_test_message); if (GetWindowLongA(mdi_client, GWL_STYLE) & MDIS_ALLCHILDSTYLES) { @@ -1419,7 +1420,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, 0, GetModuleHandle(0), + mdi_client, 0, GetModuleHandleA(NULL), mdi_lParam_test_message); if (!mdi_child) { @@ -1443,7 +1444,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) WS_CHILD, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - parent, 0, GetModuleHandle(0), + parent, 0, GetModuleHandleA(NULL), mdi_lParam_test_message); ok(!mdi_child, "WS_EX_MDICHILD with a not MDIClient parent should fail\n"); } @@ -1452,7 +1453,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) WS_CHILD, /* without WS_POPUP */ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, 0, GetModuleHandle(0), + mdi_client, 0, GetModuleHandleA(NULL), mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); @@ -1463,7 +1464,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) WS_CHILD | WS_POPUP, /* with WS_POPUP */ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, 0, GetModuleHandle(0), + mdi_client, 0, GetModuleHandleA(NULL), mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); @@ -1475,7 +1476,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) WS_CHILD | WS_MAXIMIZE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, 0, GetModuleHandle(0), + mdi_client, 0, GetModuleHandleA(NULL), mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); @@ -1487,7 +1488,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) WS_CHILD | WS_MAXIMIZE | WS_CAPTION, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, 0, GetModuleHandle(0), + mdi_client, 0, GetModuleHandleA(NULL), mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); @@ -1499,7 +1500,7 @@ static void test_MDI_create(HWND parent, HWND mdi_client, INT_PTR first_id) WS_CHILD | WS_MAXIMIZE | WS_CAPTION | WS_THICKFRAME, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - mdi_client, 0, GetModuleHandle(0), + mdi_client, 0, GetModuleHandleA(NULL), mdi_lParam_test_message); ok(mdi_child != 0, "MDI child creation failed\n"); id = GetWindowLongPtrA(mdi_child, GWLP_ID); @@ -1543,7 +1544,7 @@ static void test_MDI_child_stack(HWND mdi_client) child_4, child_3, child_2, child_1); trace("Activate child next to %p\n", child_3); - SendMessage(mdi_client, WM_MDINEXT, (WPARAM)child_3, 0); + SendMessageA(mdi_client, WM_MDINEXT, (WPARAM)child_3, 0); stack[0] = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); stack[1] = GetWindow(stack[0], GW_HWNDNEXT); @@ -1555,7 +1556,7 @@ static void test_MDI_child_stack(HWND mdi_client) child_2, child_4, child_1, child_3, stack[0], stack[1], stack[2], stack[3]); trace("Activate child previous to %p\n", child_1); - SendMessage(mdi_client, WM_MDINEXT, (WPARAM)child_1, 1); + SendMessageA(mdi_client, WM_MDINEXT, (WPARAM)child_1, 1); stack[0] = (HWND)SendMessageA(mdi_client, WM_MDIGETACTIVE, 0, 0); stack[1] = GetWindow(stack[0], GW_HWNDNEXT); @@ -1836,7 +1837,7 @@ static LRESULT WINAPI mdi_main_wnd_procA(HWND hwnd, UINT msg, WPARAM wparam, LPA WS_CHILD /*| WS_VISIBLE*/, /* tests depend on a not zero MDIClient size */ 0, 0, rc.right, rc.bottom, - hwnd, 0, GetModuleHandle(0), + hwnd, 0, GetModuleHandleA(NULL), &client_cs); assert(mdi_client); test_MDI_create(hwnd, mdi_client, client_cs.idFirstChild); @@ -1848,7 +1849,7 @@ static LRESULT WINAPI mdi_main_wnd_procA(HWND hwnd, UINT msg, WPARAM wparam, LPA WS_CHILD | MDIS_ALLCHILDSTYLES /*| WS_VISIBLE*/, /* tests depend on a not zero MDIClient size */ 0, 0, rc.right, rc.bottom, - hwnd, 0, GetModuleHandle(0), + hwnd, 0, GetModuleHandleA(NULL), &client_cs); assert(mdi_client); test_MDI_create(hwnd, mdi_client, client_cs.idFirstChild); @@ -1859,7 +1860,7 @@ static LRESULT WINAPI mdi_main_wnd_procA(HWND hwnd, UINT msg, WPARAM wparam, LPA NULL, WS_CHILD, 0, 0, rc.right, rc.bottom, - hwnd, 0, GetModuleHandle(0), + hwnd, 0, GetModuleHandleA(NULL), &client_cs); assert(mdi_client); test_MDI_child_stack(mdi_client); @@ -1926,7 +1927,7 @@ static BOOL mdi_RegisterWindowClasses(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "MDI_parent_Class"; @@ -1955,7 +1956,7 @@ static void test_mdi(void) WS_MAXIMIZEBOX /*| WS_VISIBLE*/, 100, 100, CW_USEDEFAULT, CW_USEDEFAULT, GetDesktopWindow(), 0, - GetModuleHandle(0), NULL); + GetModuleHandleA(NULL), NULL); assert(mdi_hwndMain); /* while(GetMessage(&msg, 0, 0, 0)) @@ -1971,9 +1972,9 @@ static void test_icons(void) { WNDCLASSEXA cls; HWND hwnd; - HICON icon = LoadIconA(0, IDI_APPLICATION); - HICON icon2 = LoadIconA(0, IDI_QUESTION); - HICON small_icon = LoadImageA(0, IDI_APPLICATION, IMAGE_ICON, + HICON icon = LoadIconA(0, (LPCSTR)IDI_APPLICATION); + HICON icon2 = LoadIconA(0, (LPCSTR)IDI_QUESTION); + HICON small_icon = LoadImageA(0, (LPCSTR)IDI_APPLICATION, IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED ); HICON res; @@ -1983,9 +1984,9 @@ static void test_icons(void) cls.cbClsExtra = 0; cls.cbWndExtra = 0; cls.hInstance = 0; - cls.hIcon = LoadIconA(0, IDI_HAND); + cls.hIcon = LoadIconA(0, (LPCSTR)IDI_HAND); cls.hIconSm = small_icon; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "IconWindowClass"; @@ -2044,7 +2045,7 @@ static LRESULT WINAPI nccalcsize_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM else InflateRect( rect, -10, -10 ); return 0; } - return DefWindowProc( hwnd, msg, wparam, lparam ); + return DefWindowProcA( hwnd, msg, wparam, lparam ); } static void test_SetWindowPos(HWND hwnd, HWND hwnd2) @@ -2068,7 +2069,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2) GetWindowRect(hwnd, &orig_win_rc); - old_proc = SetWindowLongPtr( hwnd, GWLP_WNDPROC, (ULONG_PTR)nccalcsize_proc ); + old_proc = SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (ULONG_PTR)nccalcsize_proc ); ret = SetWindowPos(hwnd, 0, 100, 100, 0, 0, SWP_NOZORDER|SWP_FRAMECHANGED); ok(ret, "Got %d\n", ret); GetWindowRect( hwnd, &rect ); @@ -2092,7 +2093,7 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2) ret = SetWindowPos(hwnd, 0, orig_win_rc.left, orig_win_rc.top, orig_win_rc.right, orig_win_rc.bottom, 0); ok(ret, "Got %d\n", ret); - SetWindowLongPtr( hwnd, GWLP_WNDPROC, old_proc ); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, old_proc ); /* Win9x truncates coordinates to 16-bit irrespectively */ if (!is_win9x) @@ -2112,16 +2113,16 @@ static void test_SetWindowPos(HWND hwnd, HWND hwnd2) orig_win_rc.right, orig_win_rc.bottom, 0); ok(ret, "Got %d\n", ret); - ok(!(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); + ok(!(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); ret = SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); ok(ret, "Got %d\n", ret); - ok(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); + ok(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); ret = SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); ok(ret, "Got %d\n", ret); - ok(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); + ok(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST, "WS_EX_TOPMOST should be set\n"); ret = SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE); ok(ret, "Got %d\n", ret); - ok(!(GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); + ok(!(GetWindowLongA(hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST), "WS_EX_TOPMOST should not be set\n"); hwnd_desktop = GetDesktopWindow(); ok(!!hwnd_desktop, "Failed to get hwnd_desktop window (%d).\n", GetLastError()); @@ -2322,15 +2323,15 @@ static void test_SetMenu(HWND parent) ret = GetMenu(child); ok(ret == (HMENU)10, "unexpected menu id %p\n", ret); - style = GetWindowLong(child, GWL_STYLE); - SetWindowLong(child, GWL_STYLE, style | WS_POPUP); + style = GetWindowLongA(child, GWL_STYLE); + SetWindowLongA(child, GWL_STYLE, style | WS_POPUP); ok(SetMenu(child, hMenu), "SetMenu on a popup child window should not fail\n"); ok(SetMenu(child, 0), "SetMenu on a popup child window should not fail\n"); - SetWindowLong(child, GWL_STYLE, style); + SetWindowLongA(child, GWL_STYLE, style); - SetWindowLong(child, GWL_STYLE, style | WS_OVERLAPPED); - ok(!SetMenu(child, hMenu), "SetMenu on a overlapped child window should fail\n"); - SetWindowLong(child, GWL_STYLE, style); + SetWindowLongA(child, GWL_STYLE, style | WS_OVERLAPPED); + ok(!SetMenu(child, hMenu), "SetMenu on an overlapped child window should fail\n"); + SetWindowLongA(child, GWL_STYLE, style); DestroyWindow(child); DestroyMenu(hMenu); @@ -2350,7 +2351,7 @@ static void test_window_tree(HWND parent, const DWORD *style, const int *order, { if (style[i] & DS_CONTROL) { - child[i] = CreateWindowExA(0, MAKEINTATOM(32770), "", style[i] & ~WS_VISIBLE, + child[i] = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(32770), "", style[i] & ~WS_VISIBLE, 0,0,0,0, parent, (HMENU)i, 0, NULL); if (style[i] & WS_VISIBLE) ShowWindow(child[i], SW_SHOW); @@ -2428,7 +2429,7 @@ static void check_z_order_debug(HWND hwnd, HWND next, HWND prev, HWND owner, /* skip foreign windows */ while (test && test != next && (GetWindowThreadProcessId(test, NULL) != our_pid || - UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)) != GetModuleHandle(0) || + UlongToHandle(GetWindowLongPtrA(test, GWLP_HINSTANCE)) != GetModuleHandleA(NULL) || GetWindow(test, GW_OWNER) == next)) { /*trace("skipping next %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/ @@ -2440,7 +2441,7 @@ static void check_z_order_debug(HWND hwnd, HWND next, HWND prev, HWND owner, /* skip foreign windows */ while (test && test != prev && (GetWindowThreadProcessId(test, NULL) != our_pid || - UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)) != GetModuleHandle(0) || + UlongToHandle(GetWindowLongPtrA(test, GWLP_HINSTANCE)) != GetModuleHandleA(NULL) || GetWindow(test, GW_OWNER) == hwnd)) { /*trace("skipping prev %p (%p)\n", test, UlongToHandle(GetWindowLongPtr(test, GWLP_HINSTANCE)));*/ @@ -2451,7 +2452,7 @@ static void check_z_order_debug(HWND hwnd, HWND next, HWND prev, HWND owner, test = GetWindow(hwnd, GW_OWNER); ok_(file, line)(owner == test, "%p: expected owner %p, got %p\n", hwnd, owner, test); - ex_style = GetWindowLong(hwnd, GWL_EXSTYLE); + ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE); ok_(file, line)(!(ex_style & WS_EX_TOPMOST) == !topmost, "%p: expected %stopmost\n", hwnd, topmost ? "" : "NOT "); } @@ -2467,10 +2468,10 @@ static void test_popup_zorder(HWND hwnd_D, HWND hwnd_E, DWORD style) check_z_order(hwnd_D, hwnd_E, 0, 0, FALSE); check_z_order(hwnd_E, 0, hwnd_D, 0, FALSE); - hwnd_F = CreateWindowEx(0, "MainWindowClass", "Owner window", + hwnd_F = CreateWindowExA(0, "MainWindowClass", "Owner window", WS_OVERLAPPED | WS_CAPTION, 100, 100, 100, 100, - 0, 0, GetModuleHandle(0), NULL); + 0, 0, GetModuleHandleA(NULL), NULL); trace("hwnd_F %p\n", hwnd_F); check_z_order(hwnd_F, hwnd_D, 0, 0, FALSE); @@ -2479,20 +2480,20 @@ static void test_popup_zorder(HWND hwnd_D, HWND hwnd_E, DWORD style) check_z_order(hwnd_E, hwnd_F, hwnd_D, 0, FALSE); check_z_order(hwnd_D, hwnd_E, 0, 0, FALSE); - hwnd_C = CreateWindowEx(0, "MainWindowClass", NULL, + hwnd_C = CreateWindowExA(0, "MainWindowClass", NULL, style, 100, 100, 100, 100, - hwnd_F, 0, GetModuleHandle(0), NULL); + hwnd_F, 0, GetModuleHandleA(NULL), NULL); trace("hwnd_C %p\n", hwnd_C); check_z_order(hwnd_F, 0, hwnd_E, 0, FALSE); check_z_order(hwnd_E, hwnd_F, hwnd_D, 0, FALSE); check_z_order(hwnd_D, hwnd_E, hwnd_C, 0, FALSE); check_z_order(hwnd_C, hwnd_D, 0, hwnd_F, FALSE); - hwnd_B = CreateWindowEx(WS_EX_TOPMOST, "MainWindowClass", NULL, + hwnd_B = CreateWindowExA(WS_EX_TOPMOST, "MainWindowClass", NULL, style, 100, 100, 100, 100, - hwnd_F, 0, GetModuleHandle(0), NULL); + hwnd_F, 0, GetModuleHandleA(NULL), NULL); trace("hwnd_B %p\n", hwnd_B); check_z_order(hwnd_F, 0, hwnd_E, 0, FALSE); check_z_order(hwnd_E, hwnd_F, hwnd_D, 0, FALSE); @@ -2500,10 +2501,10 @@ static void test_popup_zorder(HWND hwnd_D, HWND hwnd_E, DWORD style) check_z_order(hwnd_C, hwnd_D, hwnd_B, hwnd_F, FALSE); check_z_order(hwnd_B, hwnd_C, 0, hwnd_F, TRUE); - hwnd_A = CreateWindowEx(WS_EX_TOPMOST, "MainWindowClass", NULL, + hwnd_A = CreateWindowExA(WS_EX_TOPMOST, "MainWindowClass", NULL, style, 100, 100, 100, 100, - 0, 0, GetModuleHandle(0), NULL); + 0, 0, GetModuleHandleA(NULL), NULL); trace("hwnd_A %p\n", hwnd_A); check_z_order(hwnd_F, 0, hwnd_E, 0, FALSE); check_z_order(hwnd_E, hwnd_F, hwnd_D, 0, FALSE); @@ -2536,10 +2537,10 @@ static void test_popup_zorder(HWND hwnd_D, HWND hwnd_E, DWORD style) /* make hwnd_C owned by a topmost window */ DestroyWindow( hwnd_C ); - hwnd_C = CreateWindowEx(0, "MainWindowClass", NULL, + hwnd_C = CreateWindowExA(0, "MainWindowClass", NULL, style, 100, 100, 100, 100, - hwnd_A, 0, GetModuleHandle(0), NULL); + hwnd_A, 0, GetModuleHandleA(NULL), NULL); trace("hwnd_C %p\n", hwnd_C); check_z_order(hwnd_E, 0, hwnd_D, 0, FALSE); check_z_order(hwnd_D, hwnd_E, hwnd_F, 0, FALSE); @@ -2593,7 +2594,7 @@ static LRESULT WINAPI set_focus_on_activate_proc(HWND hwnd, UINT msg, WPARAM wp, ok(GetFocus() == child, "Focus should be on child %p\n", child); return 0; } - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcA(hwnd, msg, wp, lp); } static void test_SetFocus(HWND hwnd) @@ -2607,22 +2608,22 @@ static void test_SetFocus(HWND hwnd) SetFocus(0); SetFocus(hwnd); ok( GetFocus() == hwnd, "Failed to set focus to visible window %p\n", hwnd ); - ok( GetWindowLong(hwnd,GWL_STYLE) & WS_VISIBLE, "Window %p not visible\n", hwnd ); + ok( GetWindowLongA(hwnd,GWL_STYLE) & WS_VISIBLE, "Window %p not visible\n", hwnd ); ShowWindow(hwnd, SW_HIDE); SetFocus(0); SetFocus(hwnd); ok( GetFocus() == hwnd, "Failed to set focus to invisible window %p\n", hwnd ); - ok( !(GetWindowLong(hwnd,GWL_STYLE) & WS_VISIBLE), "Window %p still visible\n", hwnd ); + ok( !(GetWindowLongA(hwnd,GWL_STYLE) & WS_VISIBLE), "Window %p still visible\n", hwnd ); child = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 0, 0, hwnd, 0, 0, NULL); assert(child); SetFocus(child); ok( GetFocus() == child, "Failed to set focus to invisible child %p\n", child ); - ok( !(GetWindowLong(child,GWL_STYLE) & WS_VISIBLE), "Child %p is visible\n", child ); + ok( !(GetWindowLongA(child,GWL_STYLE) & WS_VISIBLE), "Child %p is visible\n", child ); ShowWindow(child, SW_SHOW); - ok( GetWindowLong(child,GWL_STYLE) & WS_VISIBLE, "Child %p is not visible\n", child ); + ok( GetWindowLongA(child,GWL_STYLE) & WS_VISIBLE, "Child %p is not visible\n", child ); ok( GetFocus() == child, "Focus no longer on child %p\n", child ); ShowWindow(child, SW_HIDE); - ok( !(GetWindowLong(child,GWL_STYLE) & WS_VISIBLE), "Child %p is visible\n", child ); + ok( !(GetWindowLongA(child,GWL_STYLE) & WS_VISIBLE), "Child %p is visible\n", child ); ok( GetFocus() == hwnd, "Focus should be on parent %p, not %p\n", hwnd, GetFocus() ); ShowWindow(child, SW_SHOW); child2 = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 0, 0, child, 0, 0, NULL); @@ -2630,7 +2631,7 @@ static void test_SetFocus(HWND hwnd) ShowWindow(child2, SW_SHOW); SetFocus(child2); ShowWindow(child, SW_HIDE); - ok( !(GetWindowLong(child,GWL_STYLE) & WS_VISIBLE), "Child %p is visible\n", child ); + ok( !(GetWindowLongA(child,GWL_STYLE) & WS_VISIBLE), "Child %p is visible\n", child ); ok( GetFocus() == child2, "Focus should be on %p, not %p\n", child2, GetFocus() ); ShowWindow(child, SW_SHOW); SetFocus(child); @@ -2668,12 +2669,12 @@ todo_wine ok( GetFocus() != child, "Focus should not be on child %p\n", child ); todo_wine ok( GetFocus() != hwnd, "Focus should not be on parent %p\n", hwnd ); - old_wnd_proc = (WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)set_focus_on_activate_proc); + old_wnd_proc = (WNDPROC)SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)set_focus_on_activate_proc); ShowWindow(hwnd, SW_RESTORE); ok( GetActiveWindow() == hwnd, "parent window %p should be active\n", hwnd); todo_wine ok( GetFocus() == child, "Focus should be on child %p, not %p\n", child, GetFocus() ); - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)old_wnd_proc); + SetWindowLongPtrA(hwnd, GWLP_WNDPROC, (LONG_PTR)old_wnd_proc); SetFocus( hwnd ); SetParent( child, GetDesktopWindow()); @@ -2793,6 +2794,7 @@ static void test_SetForegroundWindow(HWND hwnd) BOOL ret; HWND hwnd2; MSG msg; + LONG style; flush_events( TRUE ); ShowWindow(hwnd, SW_HIDE); @@ -2870,9 +2872,9 @@ static void test_SetForegroundWindow(HWND hwnd) hwnd2 = CreateWindowA("static", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 0, 0, 0, 0, 0, 0); check_wnd_state(hwnd2, hwnd2, hwnd2, 0); - thread_params.window_created = CreateEvent(NULL, FALSE, FALSE, NULL); + thread_params.window_created = CreateEventW(NULL, FALSE, FALSE, NULL); ok(!!thread_params.window_created, "CreateEvent failed, last error %#x.\n", GetLastError()); - thread_params.test_finished = CreateEvent(NULL, FALSE, FALSE, NULL); + thread_params.test_finished = CreateEventW(NULL, FALSE, FALSE, NULL); ok(!!thread_params.test_finished, "CreateEvent failed, last error %#x.\n", GetLastError()); thread = CreateThread(NULL, 0, create_window_thread, &thread_params, 0, &tid); ok(!!thread, "Failed to create thread, last error %#x.\n", GetLastError()); @@ -2883,11 +2885,24 @@ static void test_SetForegroundWindow(HWND hwnd) SetForegroundWindow(hwnd2); check_wnd_state(hwnd2, hwnd2, hwnd2, 0); - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessage(&msg); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); if (0) check_wnd_state(hwnd2, hwnd2, hwnd2, 0); todo_wine ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow()); todo_wine ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus()); + SetForegroundWindow(hwnd); + check_wnd_state(hwnd, hwnd, hwnd, 0); + style = GetWindowLongA(hwnd2, GWL_STYLE) | WS_CHILD; + ok(SetWindowLongA(hwnd2, GWL_STYLE, style), "SetWindowLong failed\n"); + ok(SetForegroundWindow(hwnd2), "SetForegroundWindow failed\n"); + check_wnd_state(hwnd2, hwnd2, hwnd2, 0); + + SetForegroundWindow(hwnd); + check_wnd_state(hwnd, hwnd, hwnd, 0); + ok(SetWindowLongA(hwnd2, GWL_STYLE, style & (~WS_POPUP)), "SetWindowLong failed\n"); + ok(!SetForegroundWindow(hwnd2), "SetForegroundWindow failed\n"); + check_wnd_state(hwnd, hwnd, hwnd, 0); + SetEvent(thread_params.test_finished); WaitForSingleObject(thread, INFINITE); CloseHandle(thread_params.test_finished); @@ -2935,7 +2950,7 @@ static LRESULT WINAPI button_hook_proc(HWND button, UINT msg, WPARAM wparam, LPA /* button wnd proc should release capture on WM_KILLFOCUS if it does * match internal button state. */ - SendMessage(button, WM_KILLFOCUS, 0, 0); + SendMessageA(button, WM_KILLFOCUS, 0, 0); check_wnd_state(button, button, button, 0); ShowWindow(hwnd, SW_SHOW); @@ -3001,7 +3016,7 @@ static void test_capture_2(void) /* button wnd proc should ignore WM_KILLFOCUS if it doesn't match * internal button state. */ - SendMessage(button, WM_KILLFOCUS, 0, 0); + SendMessageA(button, WM_KILLFOCUS, 0, 0); check_wnd_state(button, button, button, button); hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 10, 10, 0, 0, 0, NULL); @@ -3144,8 +3159,8 @@ static void test_capture_4(void) wclass.style = CS_HREDRAW | CS_VREDRAW; wclass.lpfnWndProc = test_capture_4_proc; wclass.hInstance = hInstance; - wclass.hIcon = LoadIconA( 0, IDI_APPLICATION ); - wclass.hCursor = LoadCursorA( NULL, IDC_ARROW ); + wclass.hIcon = LoadIconA( 0, (LPCSTR)IDI_APPLICATION ); + wclass.hCursor = LoadCursorA( 0, (LPCSTR)IDC_ARROW ); wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 ); wclass.lpszMenuName = 0; wclass.cbClsExtra = 0; @@ -3277,7 +3292,7 @@ static BOOL wait_for_message( MSG *msg ) ret = peek_message(msg); if (ret) { - if (msg->message == WM_PAINT) DispatchMessage(msg); + if (msg->message == WM_PAINT) DispatchMessageA(msg); else break; } else if (MsgWaitForMultipleObjects( 0, NULL, FALSE, 100, QS_ALLINPUT ) == WAIT_TIMEOUT) break; @@ -3355,7 +3370,7 @@ static void test_mouse_input(HWND hwnd) if (msg.message == WM_TIMER || ignore_message(msg.message)) continue; ok(msg.hwnd == popup && msg.message == WM_MOUSEMOVE, "hwnd %p message %04x\n", msg.hwnd, msg.message); - DispatchMessage(&msg); + DispatchMessageA(&msg); } ret = peek_message(&msg); ok( !ret, "message %04x available\n", msg.message); @@ -3570,7 +3585,7 @@ static void test_nccalcscroll(HWND parent) 0, rc1.left, rc1.top, rc1.right, rc1.bottom); /* same test, but with client edge: not enough width */ - SetWindowLong( hwnd, GWL_EXSTYLE, WS_EX_CLIENTEDGE | GetWindowLong( hwnd, GWL_EXSTYLE)); + SetWindowLongA( hwnd, GWL_EXSTYLE, WS_EX_CLIENTEDGE | GetWindowLongA( hwnd, GWL_EXSTYLE)); nccalchelper( hwnd, sbwidth, 100, &rc1); ok( rc1.right - rc1.left == sbwidth - 2 * GetSystemMetrics(SM_CXEDGE), "Width should be %d size is %d,%d - %d,%d\n", @@ -3674,6 +3689,19 @@ static void test_SetParent(void) ok(SetParent(sibling, parent) != 0, "SetParent should not fail\n"); ok(GetMenu(sibling) == hMenu, "SetParent should not remove menu\n"); + ok(SetParent(parent, desktop) != 0, "SetParent should not fail\n"); + ok(SetParent(child4, child3) != 0, "SetParent should not fail\n"); + ok(SetParent(child3, child2) != 0, "SetParent should not fail\n"); + ok(SetParent(child2, child1) != 0, "SetParent should not fail\n"); + ok(!IsChild(child3, child4), "wrong parent/child %p/%p\n", child3, child4); + SetWindowLongW(child4, GWL_STYLE, WS_CHILD); + ok(IsChild(child3, child4), "wrong parent/child %p/%p\n", child3, child4); + ok(IsChild(child2, child4), "wrong parent/child %p/%p\n", child2, child4); + ok(!IsChild(child1, child4), "wrong parent/child %p/%p\n", child1, child4); + SetWindowLongW(child2, GWL_STYLE, WS_CHILD); + ok(IsChild(child1, child4), "wrong parent/child %p/%p\n", child1, child4); + ok(IsChild(parent, child4), "wrong parent/child %p/%p\n", parent, child4); + ok(DestroyWindow(parent), "DestroyWindow() failed\n"); ok(!IsWindow(parent), "parent still exists\n"); @@ -3706,21 +3734,34 @@ static void test_SetParent(void) ret = SetParent(popup, child1); ok(ret == desktop, "expected %p, got %p\n", desktop, ret); check_parents(popup, child1, child1, 0, 0, parent, popup); -todo_wine check_active_state(popup, 0, popup); + SetActiveWindow(parent); + SetFocus(popup); + check_active_state(popup, 0, popup); + + EnableWindow(child1, FALSE); + check_active_state(popup, 0, popup); + SetFocus(parent); + check_active_state(parent, 0, parent); + SetFocus(popup); + check_active_state(popup, 0, popup); + EnableWindow(child1, TRUE); + + ShowWindow(child1, SW_MINIMIZE); + SetFocus(parent); + check_active_state(parent, 0, parent); + SetFocus(popup); + check_active_state(popup, 0, popup); + ShowWindow(child1, SW_HIDE); + SetActiveWindow(parent); SetFocus(parent); check_active_state(parent, 0, parent); bret = SetForegroundWindow(popup); -todo_wine { - ok(bret || broken(!bret), "SetForegroundWindow() failed\n"); - if (!bret) - check_active_state(popup, 0, popup); - else - check_active_state(popup, popup, popup); - } + ok(bret, "SetForegroundWindow() failed\n"); + check_active_state(popup, popup, popup); ok(DestroyWindow(parent), "DestroyWindow() failed\n"); @@ -3731,14 +3772,14 @@ todo_wine { static LRESULT WINAPI StyleCheckProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { - LPCREATESTRUCT lpcs; + LPCREATESTRUCTA lpcs; LPSTYLESTRUCT lpss; switch (msg) { case WM_NCCREATE: case WM_CREATE: - lpcs = (LPCREATESTRUCT)lparam; + lpcs = (LPCREATESTRUCTA)lparam; lpss = lpcs->lpCreateParams; if (lpss) { @@ -3759,28 +3800,28 @@ static LRESULT WINAPI StyleCheckProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM } break; } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } static ATOM atomStyleCheckClass; static void register_style_check_class(void) { - WNDCLASS wc = + WNDCLASSA wc = { 0, StyleCheckProc, 0, 0, - GetModuleHandle(NULL), + GetModuleHandleA(NULL), NULL, - LoadCursor(NULL, IDC_ARROW), + LoadCursorA(0, (LPCSTR)IDC_ARROW), (HBRUSH)(COLOR_BTNFACE+1), NULL, - TEXT("WineStyleCheck"), + "WineStyleCheck", }; - - atomStyleCheckClass = RegisterClass(&wc); + + atomStyleCheckClass = RegisterClassA(&wc); assert(atomStyleCheckClass); } @@ -3797,25 +3838,25 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle if (dwStyleIn & WS_CHILD) { - hwndParent = CreateWindowEx(0, MAKEINTATOM(atomStyleCheckClass), NULL, + hwndParent = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomStyleCheckClass), NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL); } - hwnd = CreateWindowEx(dwExStyleIn, MAKEINTATOM(atomStyleCheckClass), NULL, + hwnd = CreateWindowExA(dwExStyleIn, (LPCSTR)MAKEINTATOM(atomStyleCheckClass), NULL, dwStyleIn, 0, 0, 0, 0, hwndParent, NULL, NULL, &ss); assert(hwnd); flush_events( TRUE ); - dwActualStyle = GetWindowLong(hwnd, GWL_STYLE); - dwActualExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); + dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE); + dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle); ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle); /* try setting the styles explicitly */ - SetWindowLong( hwnd, GWL_EXSTYLE, dwExStyleIn ); - dwActualStyle = GetWindowLong(hwnd, GWL_STYLE); - dwActualExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); + SetWindowLongA( hwnd, GWL_EXSTYLE, dwExStyleIn ); + dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE); + dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); /* WS_EX_WINDOWEDGE can't always be changed */ if (dwExStyleIn & WS_EX_DLGMODALFRAME) dwExStyleOut = dwExStyleIn | WS_EX_WINDOWEDGE; @@ -3826,9 +3867,9 @@ static void check_window_style(DWORD dwStyleIn, DWORD dwExStyleIn, DWORD dwStyle ok(dwActualStyle == dwStyleOut, "expected style %#x, got %#x\n", dwStyleOut, dwActualStyle); ok(dwActualExStyle == dwExStyleOut, "expected ex_style %#x, got %#x\n", dwExStyleOut, dwActualExStyle); - SetWindowLong( hwnd, GWL_STYLE, dwStyleIn ); - dwActualStyle = GetWindowLong(hwnd, GWL_STYLE); - dwActualExStyle = GetWindowLong(hwnd, GWL_EXSTYLE); + SetWindowLongA( hwnd, GWL_STYLE, dwStyleIn ); + dwActualStyle = GetWindowLongA(hwnd, GWL_STYLE); + dwActualExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); /* WS_CLIPSIBLINGS can't be reset on top-level windows */ if ((dwStyleIn & (WS_CHILD|WS_POPUP)) == WS_CHILD) dwStyleOut = dwStyleIn; else dwStyleOut = dwStyleIn | WS_CLIPSIBLINGS; @@ -3917,7 +3958,7 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou HWND hwnd, parent = 0; if (style_in & WS_CHILD) - parent = CreateWindowEx(0, "static", NULL, WS_OVERLAPPEDWINDOW, + parent = CreateWindowExA(0, "static", NULL, WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, NULL, NULL, NULL, NULL); dlg_data.dt.style = style_in; @@ -3932,20 +3973,20 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou dlg_data.class_atom = 0; dlg_data.caption[0] = 0; - hwnd = CreateDialogIndirectParam(GetModuleHandle(0), &dlg_data.dt, parent, empty_dlg_proc, 0); + hwnd = CreateDialogIndirectParamA(GetModuleHandleA(NULL), &dlg_data.dt, parent, empty_dlg_proc, 0); ok(hwnd != 0, "dialog creation failed, style %#x, exstyle %#x\n", style_in, ex_style_in); flush_events( TRUE ); - style = GetWindowLong(hwnd, GWL_STYLE); - ex_style = GetWindowLong(hwnd, GWL_EXSTYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); + ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE); ok(style == (style_out | DS_3DLOOK), "expected style %#x, got %#x\n", style_out | DS_3DLOOK, style); ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style); /* try setting the styles explicitly */ - SetWindowLong(hwnd, GWL_EXSTYLE, ex_style_in); - style = GetWindowLong(hwnd, GWL_STYLE); - ex_style = GetWindowLong(hwnd, GWL_EXSTYLE); + SetWindowLongA(hwnd, GWL_EXSTYLE, ex_style_in); + style = GetWindowLongA(hwnd, GWL_STYLE); + ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE); ok(style == (style_out | DS_3DLOOK), "expected style %#x, got %#x\n", style_out|DS_3DLOOK, style); /* WS_EX_WINDOWEDGE can't always be changed */ if (ex_style_in & WS_EX_DLGMODALFRAME) @@ -3956,9 +3997,9 @@ static void check_dialog_style(DWORD style_in, DWORD ex_style_in, DWORD style_ou ex_style_out = ex_style_in & ~WS_EX_WINDOWEDGE; ok(ex_style == ex_style_out, "expected ex_style %#x, got %#x\n", ex_style_out, ex_style); - SetWindowLong(hwnd, GWL_STYLE, style_in); - style = GetWindowLong(hwnd, GWL_STYLE); - ex_style = GetWindowLong(hwnd, GWL_EXSTYLE); + SetWindowLongA(hwnd, GWL_STYLE, style_in); + style = GetWindowLongA(hwnd, GWL_STYLE); + ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE); /* WS_CLIPSIBLINGS can't be reset on top-level windows */ if ((style_in & (WS_CHILD | WS_POPUP)) == WS_CHILD) style_out = style_in; else style_out = style_in | WS_CLIPSIBLINGS; @@ -4147,7 +4188,7 @@ static void test_scrollvalidate( HWND parent) SetRectRgn( clipping, 10, 10, 90, 90); hdc = GetDC( hwnd1); /* for a visual touch */ - TextOut( hdc, 0,10, "0123456789", 10); + TextOutA( hdc, 0,10, "0123456789", 10); ScrollDC( hdc, -10, -5, &rc, &cliprc, hrgn, &rcu); if (winetest_debug > 0) dump_region(hrgn); /* create a region with what is expected */ @@ -4205,12 +4246,12 @@ static void test_scrollvalidate( HWND parent) hwnd2 = CreateWindowExA(0, "static", NULL, WS_CHILD| WS_VISIBLE | WS_BORDER , 50, 50, 100, 100, hwnd1, 0, 0, NULL); - SetWindowLong( hwnd1, GWL_STYLE, GetWindowLong( hwnd1, GWL_STYLE) & ~WS_CLIPSIBLINGS); + SetWindowLongA( hwnd1, GWL_STYLE, GetWindowLongA( hwnd1, GWL_STYLE) & ~WS_CLIPSIBLINGS); GetClientRect( hwnd1, &rc); cliprc=rc; /* WS_CLIPCHILDREN and SW_SCROLLCHILDREN */ - SetWindowLong( hwnd1, GWL_STYLE, GetWindowLong( hwnd1, GWL_STYLE) | WS_CLIPCHILDREN ); + SetWindowLongA( hwnd1, GWL_STYLE, GetWindowLongA( hwnd1, GWL_STYLE) | WS_CLIPCHILDREN ); ValidateRect( hwnd1, NULL); ValidateRect( hwnd2, NULL); ScrollWindowEx( hwnd1, -10, -10, &rc, &cliprc, hrgn, &rcu, @@ -4222,7 +4263,7 @@ static void test_scrollvalidate( HWND parent) ok( EqualRgn( exprgn, hrgn), "wrong update region\n"); /* SW_SCROLLCHILDREN */ - SetWindowLong( hwnd1, GWL_STYLE, GetWindowLong( hwnd1, GWL_STYLE) & ~WS_CLIPCHILDREN ); + SetWindowLongA( hwnd1, GWL_STYLE, GetWindowLongA( hwnd1, GWL_STYLE) & ~WS_CLIPCHILDREN ); ValidateRect( hwnd1, NULL); ValidateRect( hwnd2, NULL); ScrollWindowEx( hwnd1, -10, -10, &rc, &cliprc, hrgn, &rcu, SW_SCROLLCHILDREN | SW_INVALIDATE); @@ -4231,7 +4272,7 @@ static void test_scrollvalidate( HWND parent) ok( EqualRgn( exprgn, hrgn), "wrong update region\n"); /* no SW_SCROLLCHILDREN */ - SetWindowLong( hwnd1, GWL_STYLE, GetWindowLong( hwnd1, GWL_STYLE) & ~WS_CLIPCHILDREN ); + SetWindowLongA( hwnd1, GWL_STYLE, GetWindowLongA( hwnd1, GWL_STYLE) & ~WS_CLIPCHILDREN ); ValidateRect( hwnd1, NULL); ValidateRect( hwnd2, NULL); ScrollWindowEx( hwnd1, -10, -10, &rc, &cliprc, hrgn, &rcu, SW_INVALIDATE); @@ -4240,7 +4281,7 @@ static void test_scrollvalidate( HWND parent) ok( EqualRgn( exprgn, hrgn), "wrong update region\n"); /* WS_CLIPCHILDREN and no SW_SCROLLCHILDREN */ - SetWindowLong( hwnd1, GWL_STYLE, GetWindowLong( hwnd1, GWL_STYLE) | WS_CLIPCHILDREN ); + SetWindowLongA( hwnd1, GWL_STYLE, GetWindowLongA( hwnd1, GWL_STYLE) | WS_CLIPCHILDREN ); ValidateRect( hwnd1, NULL); ValidateRect( hwnd2, NULL); ScrollWindowEx( hwnd1, -10, -10, &rc, &cliprc, hrgn, &rcu, SW_INVALIDATE); @@ -4386,7 +4427,7 @@ static void test_params(void) if (pGetMonitorInfoA) { SetLastError(0xdeadbeef); - rc = GetWindowText(hwndMain2, NULL, 1024); + rc = GetWindowTextA(hwndMain2, NULL, 1024); ok( rc==0, "GetWindowText: rc=%d err=%d\n",rc,GetLastError()); } else @@ -4396,7 +4437,7 @@ static void test_params(void) } SetLastError(0xdeadbeef); - hwnd=CreateWindow("LISTBOX", "TestList", + hwnd=CreateWindowA("LISTBOX", "TestList", (LBS_STANDARD & ~LBS_SORT), 0, 0, 100, 100, NULL, (HMENU)1, NULL, 0); @@ -4413,7 +4454,7 @@ static void test_AWRwindow(LPCSTR class, LONG style, LONG exStyle, BOOL menu) { HWND hwnd = 0; - hwnd = CreateWindowEx(exStyle, class, class, style, + hwnd = CreateWindowExA(exStyle, class, class, style, 110, 100, 225, 200, 0, @@ -4433,20 +4474,20 @@ static void test_AWRwindow(LPCSTR class, LONG style, LONG exStyle, BOOL menu) static BOOL AWR_init(void) { - WNDCLASS class; + WNDCLASSA class; class.style = CS_HREDRAW | CS_VREDRAW; class.lpfnWndProc = DefWindowProcA; class.cbClsExtra = 0; class.cbWndExtra = 0; class.hInstance = 0; - class.hIcon = LoadIcon (0, IDI_APPLICATION); - class.hCursor = LoadCursor (0, IDC_ARROW); + class.hIcon = LoadIconA(0, (LPCSTR)IDI_APPLICATION); + class.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); class.hbrBackground = 0; class.lpszMenuName = 0; class.lpszClassName = szAWRClass; - - if (!RegisterClass (&class)) { + + if (!RegisterClassA(&class)) { ok(FALSE, "RegisterClass failed\n"); return FALSE; } @@ -4455,8 +4496,8 @@ static BOOL AWR_init(void) if (!hmenu) return FALSE; ok(hmenu != 0, "Failed to create menu\n"); - ok(AppendMenu(hmenu, MF_STRING, 1, "Test!"), "Failed to create menu item\n"); - + ok(AppendMenuA(hmenu, MF_STRING, 1, "Test!"), "Failed to create menu item\n"); + return TRUE; } @@ -4543,7 +4584,7 @@ static LRESULT WINAPI redraw_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LP } return 0; } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } /* Ensure we exit from RedrawNow regardless of invalidated area */ @@ -4558,7 +4599,7 @@ static void test_redrawnow(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "RedrawWindowClass"; @@ -4622,7 +4663,7 @@ static LRESULT WINAPI parentdc_window_procA(HWND hwnd, UINT msg, WPARAM wparam, EndPaint(hwnd, &ps); return 0; } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } static void zero_parentdc_stat(struct parentdc_stat *t) @@ -4729,7 +4770,7 @@ static void test_csparentdc(void) clsMain.cbWndExtra = 0; clsMain.hInstance = GetModuleHandleA(0); clsMain.hIcon = 0; - clsMain.hCursor = LoadCursorA(0, IDC_ARROW); + clsMain.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); clsMain.hbrBackground = GetStockObject(WHITE_BRUSH); clsMain.lpszMenuName = NULL; clsMain.lpszClassName = "ParentDcMainWindowClass"; @@ -4745,7 +4786,7 @@ static void test_csparentdc(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "ParentDcWindowClass"; @@ -4950,11 +4991,11 @@ static LRESULT CALLBACK minmax_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM l MINMAXINFO *minmax; if (msg != WM_GETMINMAXINFO) - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcA(hwnd, msg, wp, lp); minmax = (MINMAXINFO *)lp; - if ((GetWindowLong(hwnd, GWL_STYLE) & WS_CHILD)) + if ((GetWindowLongA(hwnd, GWL_STYLE) & WS_CHILD)) { minmax->ptReserved.x = 0; minmax->ptReserved.y = 0; @@ -4968,7 +5009,7 @@ static LRESULT CALLBACK minmax_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM l minmax->ptMinTrackSize.y = 100; } else - DefWindowProc(hwnd, msg, wp, lp); + DefWindowProcA(hwnd, msg, wp, lp); return 1; } @@ -4985,7 +5026,7 @@ static LRESULT CALLBACK winsizes_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM GetWindowRect( hwnd, &rect ); ok( !rect.left && !rect.top && !rect.right && !rect.bottom, "wrong rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcA(hwnd, msg, wp, lp); } case WM_NCCREATE: case WM_CREATE: @@ -5010,7 +5051,7 @@ static LRESULT CALLBACK winsizes_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM "wrong rect %d,%d-%d,%d / %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom, expected_rect.left, expected_rect.top, expected_rect.right, expected_rect.bottom ); - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcA(hwnd, msg, wp, lp); } case WM_NCCALCSIZE: { @@ -5019,16 +5060,16 @@ static LRESULT CALLBACK winsizes_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM ok( !memcmp( &rect, r, sizeof(rect) ), "passed rect %d,%d-%d,%d doesn't match window rect %d,%d-%d,%d\n", r->left, r->top, r->right, r->bottom, rect.left, rect.top, rect.right, rect.bottom ); - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcA(hwnd, msg, wp, lp); } default: - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcA(hwnd, msg, wp, lp); } } static void test_CreateWindow(void) { - WNDCLASS cls; + WNDCLASSA cls; HWND hwnd, parent; HMENU hmenu; RECT rc, rc_minmax; @@ -5041,10 +5082,10 @@ static void test_CreateWindow(void) ok(res, "GetMenu error %d\n", GetLastError()) #define expect_style(window, style)\ - ok((ULONG)GetWindowLong(window, GWL_STYLE) == (style), "expected style %x != %x\n", (LONG)(style), GetWindowLong(window, GWL_STYLE)) + ok((ULONG)GetWindowLongA(window, GWL_STYLE) == (style), "expected style %x != %x\n", (LONG)(style), GetWindowLongA(window, GWL_STYLE)) #define expect_ex_style(window, ex_style)\ - ok((ULONG)GetWindowLong(window, GWL_EXSTYLE) == (ex_style), "expected ex_style %x != %x\n", (LONG)(ex_style), GetWindowLong(window, GWL_EXSTYLE)) + ok((ULONG)GetWindowLongA(window, GWL_EXSTYLE) == (ex_style), "expected ex_style %x != %x\n", (LONG)(ex_style), GetWindowLongA(window, GWL_EXSTYLE)) #define expect_gle_broken_9x(gle)\ ok(GetLastError() == gle ||\ @@ -5062,7 +5103,7 @@ static void test_CreateWindow(void) /* WS_CHILD */ SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_CHILD, + hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, 1); @@ -5071,7 +5112,7 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_CAPTION, + hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_CAPTION, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, 1); @@ -5080,7 +5121,7 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(0, "static", NULL, WS_CHILD, + hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, 1); @@ -5089,7 +5130,7 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(0, "static", NULL, WS_CHILD | WS_CAPTION, + hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_CAPTION, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, 1); @@ -5099,7 +5140,7 @@ static void test_CreateWindow(void) /* WS_POPUP */ SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_POPUP, + hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP, 0, 0, 100, 100, parent, hmenu, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, hmenu); @@ -5113,7 +5154,7 @@ static void test_CreateWindow(void) hmenu = CreateMenu(); assert(hmenu != 0); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_POPUP | WS_CAPTION, + hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP | WS_CAPTION, 0, 0, 100, 100, parent, hmenu, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, hmenu); @@ -5127,7 +5168,7 @@ static void test_CreateWindow(void) hmenu = CreateMenu(); assert(hmenu != 0); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(0, "static", NULL, WS_POPUP, + hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0, 0, 100, 100, parent, hmenu, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, hmenu); @@ -5141,7 +5182,7 @@ static void test_CreateWindow(void) hmenu = CreateMenu(); assert(hmenu != 0); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(0, "static", NULL, WS_POPUP | WS_CAPTION, + hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_CAPTION, 0, 0, 100, 100, parent, hmenu, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, hmenu); @@ -5154,7 +5195,7 @@ static void test_CreateWindow(void) /* WS_CHILD | WS_POPUP */ SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP, + hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); ok(!hwnd || broken(hwnd != 0 /* Win9x */), "CreateWindowEx should fail\n"); expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); @@ -5164,7 +5205,7 @@ static void test_CreateWindow(void) hmenu = CreateMenu(); assert(hmenu != 0); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP, + hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP, 0, 0, 100, 100, parent, hmenu, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, hmenu); @@ -5176,7 +5217,7 @@ static void test_CreateWindow(void) expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION, + hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); ok(!hwnd || broken(hwnd != 0 /* Win9x */), "CreateWindowEx should fail\n"); expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); @@ -5186,7 +5227,7 @@ static void test_CreateWindow(void) hmenu = CreateMenu(); assert(hmenu != 0); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION, + hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION, 0, 0, 100, 100, parent, hmenu, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, hmenu); @@ -5198,7 +5239,7 @@ static void test_CreateWindow(void) expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(0, "static", NULL, WS_CHILD | WS_POPUP, + hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); ok(!hwnd || broken(hwnd != 0 /* Win9x */), "CreateWindowEx should fail\n"); expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); @@ -5208,7 +5249,7 @@ static void test_CreateWindow(void) hmenu = CreateMenu(); assert(hmenu != 0); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(0, "static", NULL, WS_CHILD | WS_POPUP, + hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP, 0, 0, 100, 100, parent, hmenu, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, hmenu); @@ -5220,7 +5261,7 @@ static void test_CreateWindow(void) expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(0, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION, + hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); ok(!hwnd || broken(hwnd != 0 /* Win9x */), "CreateWindowEx should fail\n"); expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); @@ -5230,7 +5271,7 @@ static void test_CreateWindow(void) hmenu = CreateMenu(); assert(hmenu != 0); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(0, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION, + hwnd = CreateWindowExA(0, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION, 0, 0, 100, 100, parent, hmenu, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(hwnd, hmenu); @@ -5246,16 +5287,16 @@ static void test_CreateWindow(void) cls.lpfnWndProc = minmax_wnd_proc; cls.cbClsExtra = 0; cls.cbWndExtra = 0; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "MinMax_WndClass"; - RegisterClass(&cls); + RegisterClassA(&cls); SetLastError(0xdeadbeef); - parent = CreateWindowEx(0, "MinMax_WndClass", NULL, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, + parent = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, 0, 0, 100, 100, 0, 0, 0, NULL); ok(parent != 0, "CreateWindowEx error %d\n", GetLastError()); expect_menu(parent, 0); @@ -5263,7 +5304,7 @@ static void test_CreateWindow(void) expect_ex_style(parent, WS_EX_WINDOWEDGE); memset(&minmax, 0, sizeof(minmax)); - SendMessage(parent, WM_GETMINMAXINFO, 0, (LPARAM)&minmax); + SendMessageA(parent, WM_GETMINMAXINFO, 0, (LPARAM)&minmax); SetRect(&rc_minmax, 0, 0, minmax.ptMaxSize.x, minmax.ptMaxSize.y); ok(IsRectEmpty(&rc_minmax), "ptMaxSize is not empty\n"); SetRect(&rc_minmax, 0, 0, minmax.ptMaxTrackSize.x, minmax.ptMaxTrackSize.y); @@ -5278,7 +5319,7 @@ static void test_CreateWindow(void) trace("creating child with rect (%d,%d-%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); SetLastError(0xdeadbeef); - hwnd = CreateWindowEx(0, "MinMax_WndClass", NULL, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, + hwnd = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_CHILD | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, parent, (HMENU)1, 0, NULL); ok(hwnd != 0, "CreateWindowEx error %d\n", GetLastError()); @@ -5287,7 +5328,7 @@ static void test_CreateWindow(void) expect_ex_style(hwnd, WS_EX_WINDOWEDGE); memset(&minmax, 0, sizeof(minmax)); - SendMessage(hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&minmax); + SendMessageA(hwnd, WM_GETMINMAXINFO, 0, (LPARAM)&minmax); SetRect(&rc_minmax, 0, 0, minmax.ptMaxTrackSize.x, minmax.ptMaxTrackSize.y); GetWindowRect(hwnd, &rc); @@ -5299,7 +5340,7 @@ static void test_CreateWindow(void) cls.lpfnWndProc = winsizes_wnd_proc; cls.lpszClassName = "Sizes_WndClass"; - RegisterClass(&cls); + RegisterClassA(&cls); expected_cx = expected_cy = 200000; SetRect( &expected_rect, 0, 0, 200000, 200000 ); @@ -5335,7 +5376,7 @@ static void test_CreateWindow(void) /* we need a parent at 0,0 so that child coordinates match */ DestroyWindow(parent); - parent = CreateWindowEx(0, "MinMax_WndClass", NULL, WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL); + parent = CreateWindowExA(0, "MinMax_WndClass", NULL, WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL); ok(parent != 0, "CreateWindowEx error %d\n", GetLastError()); expected_cx = 100; @@ -5382,7 +5423,7 @@ static void test_CreateWindow(void) ReleaseDC( parent, hdc ); DestroyWindow( parent ); SetLastError( 0xdeadbeef ); - parent = CreateWindowEx(WS_EX_APPWINDOW | WS_EX_LAYOUTRTL, "static", NULL, WS_POPUP, + parent = CreateWindowExA(WS_EX_APPWINDOW | WS_EX_LAYOUTRTL, "static", NULL, WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL); ok( parent != 0, "creation failed err %u\n", GetLastError()); expect_ex_style( parent, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL ); @@ -5423,12 +5464,12 @@ static void test_CreateWindow(void) res = pGetProcessDefaultLayout( &layout ); ok( res, "GetProcessDefaultLayout failed err %u\n", GetLastError ()); ok( layout == LAYOUT_RTL, "GetProcessDefaultLayout wrong layout %x\n", layout ); - hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_POPUP, + hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP, 0, 0, 100, 100, 0, 0, 0, NULL); ok( hwnd != 0, "creation failed err %u\n", GetLastError()); expect_ex_style( hwnd, WS_EX_APPWINDOW | WS_EX_LAYOUTRTL ); DestroyWindow( hwnd ); - hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_POPUP, + hwnd = CreateWindowExA(WS_EX_APPWINDOW, "static", NULL, WS_POPUP, 0, 0, 100, 100, parent, 0, 0, NULL); ok( hwnd != 0, "creation failed err %u\n", GetLastError()); expect_ex_style( hwnd, WS_EX_APPWINDOW ); @@ -5443,8 +5484,8 @@ static void test_CreateWindow(void) DestroyWindow(parent); - UnregisterClass("MinMax_WndClass", GetModuleHandle(0)); - UnregisterClass("Sizes_WndClass", GetModuleHandle(0)); + UnregisterClassA("MinMax_WndClass", GetModuleHandleA(NULL)); + UnregisterClassA("Sizes_WndClass", GetModuleHandleA(NULL)); #undef expect_gle_broken_9x #undef expect_menu @@ -5468,23 +5509,23 @@ static void test_SetWindowLong(void) WNDPROC old_window_procW; SetLastError(0xdeadbeef); - retval = SetWindowLongPtr(NULL, GWLP_WNDPROC, 0); + retval = SetWindowLongPtrA(NULL, GWLP_WNDPROC, 0); ok(!retval, "SetWindowLongPtr on invalid window handle should have returned 0 instead of 0x%lx\n", retval); ok(check_error(GetLastError(), ERROR_INVALID_WINDOW_HANDLE), "SetWindowLongPtr should have set error to ERROR_INVALID_WINDOW_HANDLE instead of %d\n", GetLastError()); SetLastError(0xdeadbeef); - retval = SetWindowLongPtr(hwndMain, 0xdeadbeef, 0); + retval = SetWindowLongPtrA(hwndMain, 0xdeadbeef, 0); ok(!retval, "SetWindowLongPtr on invalid index should have returned 0 instead of 0x%lx\n", retval); ok(check_error(GetLastError(), ERROR_INVALID_INDEX), "SetWindowLongPtr should have set error to ERROR_INVALID_INDEX instead of %d\n", GetLastError()); SetLastError(0xdeadbeef); - retval = SetWindowLongPtr(hwndMain, GWLP_WNDPROC, 0); + retval = SetWindowLongPtrA(hwndMain, GWLP_WNDPROC, 0); ok((WNDPROC)retval == main_window_procA || broken(!retval), /* win9x */ "SetWindowLongPtr on invalid window proc should have returned address of main_window_procA instead of 0x%lx\n", retval); ok(GetLastError() == 0xdeadbeef, "SetWindowLongPtr shouldn't have set the last error, instead of setting it to %d\n", GetLastError()); - retval = GetWindowLongPtr(hwndMain, GWLP_WNDPROC); + retval = GetWindowLongPtrA(hwndMain, GWLP_WNDPROC); ok((WNDPROC)retval == main_window_procA, "SetWindowLongPtr on invalid window proc shouldn't have changed the value returned by GetWindowLongPtr, instead of changing it to 0x%lx\n", retval); ok(!IsWindowUnicode(hwndMain), "hwndMain shouldn't be Unicode\n"); @@ -5501,7 +5542,7 @@ static void test_SetWindowLong(void) ok(IsWindowUnicode(hwndMain), "hwndMain should now be Unicode\n"); /* set it back to ANSI */ - SetWindowLongPtr(hwndMain, GWLP_WNDPROC, 0); + SetWindowLongPtrA(hwndMain, GWLP_WNDPROC, 0); } } @@ -5514,7 +5555,7 @@ static void test_ShowWindow(void) SetRect(&rcMain, 120, 120, 210, 210); - hwnd = CreateWindowEx(0, "MainWindowClass", NULL, + hwnd = CreateWindowExA(0, "MainWindowClass", NULL, WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP, rcMain.left, rcMain.top, @@ -5522,7 +5563,7 @@ static void test_ShowWindow(void) 0, 0, 0, NULL); assert(hwnd); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(!(style & WS_DISABLED), "window should not be disabled\n"); ok(!(style & WS_VISIBLE), "window should not be visible\n"); ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); @@ -5534,7 +5575,7 @@ static void test_ShowWindow(void) ret = ShowWindow(hwnd, SW_SHOW); ok(!ret, "not expected ret: %lu\n", ret); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(!(style & WS_DISABLED), "window should not be disabled\n"); ok(style & WS_VISIBLE, "window should be visible\n"); ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); @@ -5546,7 +5587,7 @@ static void test_ShowWindow(void) ret = ShowWindow(hwnd, SW_MINIMIZE); ok(ret, "not expected ret: %lu\n", ret); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(!(style & WS_DISABLED), "window should not be disabled\n"); ok(style & WS_VISIBLE, "window should be visible\n"); ok(style & WS_MINIMIZE, "window should be minimized\n"); @@ -5564,7 +5605,7 @@ static void test_ShowWindow(void) ShowWindow(hwnd, SW_RESTORE); ok(ret, "not expected ret: %lu\n", ret); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(!(style & WS_DISABLED), "window should not be disabled\n"); ok(style & WS_VISIBLE, "window should be visible\n"); ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); @@ -5576,12 +5617,12 @@ static void test_ShowWindow(void) ret = EnableWindow(hwnd, FALSE); ok(!ret, "not expected ret: %lu\n", ret); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & WS_DISABLED, "window should be disabled\n"); - ret = DefWindowProc(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); + ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); ok(!ret, "not expected ret: %lu\n", ret); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & WS_DISABLED, "window should be disabled\n"); ok(style & WS_VISIBLE, "window should be visible\n"); ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); @@ -5591,9 +5632,9 @@ static void test_ShowWindow(void) rcMain.left, rcMain.top, rcMain.right, rcMain.bottom, rc.left, rc.top, rc.right, rc.bottom); - ret = DefWindowProc(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0); + ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0); ok(!ret, "not expected ret: %lu\n", ret); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & WS_DISABLED, "window should be disabled\n"); ok(style & WS_VISIBLE, "window should be visible\n"); ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); @@ -5605,7 +5646,7 @@ static void test_ShowWindow(void) ret = ShowWindow(hwnd, SW_MINIMIZE); ok(ret, "not expected ret: %lu\n", ret); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & WS_DISABLED, "window should be disabled\n"); ok(style & WS_VISIBLE, "window should be visible\n"); ok(style & WS_MINIMIZE, "window should be minimized\n"); @@ -5613,9 +5654,9 @@ static void test_ShowWindow(void) GetWindowRect(hwnd, &rc); ok(!EqualRect(&rcMain, &rc), "rects shouldn't match\n"); - ret = DefWindowProc(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); + ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); ok(!ret, "not expected ret: %lu\n", ret); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & WS_DISABLED, "window should be disabled\n"); ok(style & WS_VISIBLE, "window should be visible\n"); ok(style & WS_MINIMIZE, "window should be minimized\n"); @@ -5625,7 +5666,7 @@ static void test_ShowWindow(void) ret = ShowWindow(hwnd, SW_RESTORE); ok(ret, "not expected ret: %lu\n", ret); - style = GetWindowLong(hwnd, GWL_STYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); ok(style & WS_DISABLED, "window should be disabled\n"); ok(style & WS_VISIBLE, "window should be visible\n"); ok(!(style & WS_MINIMIZE), "window should not be minimized\n"); @@ -5635,49 +5676,49 @@ static void test_ShowWindow(void) rcMain.left, rcMain.top, rcMain.right, rcMain.bottom, rc.left, rc.top, rc.right, rc.bottom); - ret = DefWindowProc(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0); + ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0); ok(!ret, "not expected ret: %lu\n", ret); ok(IsWindow(hwnd), "window should exist\n"); ret = EnableWindow(hwnd, TRUE); ok(ret, "not expected ret: %lu\n", ret); - ret = DefWindowProc(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0); + ret = DefWindowProcA(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0); ok(!ret, "not expected ret: %lu\n", ret); ok(!IsWindow(hwnd), "window should not exist\n"); } static void test_gettext(void) { - WNDCLASS cls; + WNDCLASSA cls; LPCSTR clsname = "gettexttest"; HWND hwnd; LRESULT r; memset( &cls, 0, sizeof cls ); - cls.lpfnWndProc = DefWindowProc; + cls.lpfnWndProc = DefWindowProcA; cls.lpszClassName = clsname; - cls.hInstance = GetModuleHandle(NULL); + cls.hInstance = GetModuleHandleA(NULL); - if (!RegisterClass( &cls )) return; + if (!RegisterClassA( &cls )) return; - hwnd = CreateWindow( clsname, "test text", WS_OVERLAPPED, 0, 0, 10, 10, 0, NULL, NULL, NULL); + hwnd = CreateWindowA( clsname, "test text", WS_OVERLAPPED, 0, 0, 10, 10, 0, NULL, NULL, NULL); ok( hwnd != NULL, "window was null\n"); - r = SendMessage( hwnd, WM_GETTEXT, 0x10, 0x1000); + r = SendMessageA( hwnd, WM_GETTEXT, 0x10, 0x1000); ok( r == 0, "settext should return zero\n"); - r = SendMessage( hwnd, WM_GETTEXT, 0x10000, 0); + r = SendMessageA( hwnd, WM_GETTEXT, 0x10000, 0); ok( r == 0, "settext should return zero (%ld)\n", r); - r = SendMessage( hwnd, WM_GETTEXT, 0xff000000, 0x1000); + r = SendMessageA( hwnd, WM_GETTEXT, 0xff000000, 0x1000); ok( r == 0, "settext should return zero (%ld)\n", r); - r = SendMessage( hwnd, WM_GETTEXT, 0x1000, 0xff000000); + r = SendMessageA( hwnd, WM_GETTEXT, 0x1000, 0xff000000); ok( r == 0, "settext should return zero (%ld)\n", r); DestroyWindow(hwnd); - UnregisterClass( clsname, NULL ); + UnregisterClassA( clsname, NULL ); } @@ -5720,14 +5761,14 @@ static void test_GetUpdateRect(void) parent_wm_paint = FALSE; grandparent_wm_paint = FALSE; - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) { if (msg.message == WM_PAINT) { if (msg.hwnd == hgrandparent) grandparent_wm_paint = TRUE; if (msg.hwnd == hparent) parent_wm_paint = TRUE; } - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok(parent_wm_paint, "WM_PAINT should have been received in parent\n"); ok(!grandparent_wm_paint, "WM_PAINT should NOT have been received in grandparent\n"); @@ -5740,7 +5781,7 @@ static void test_GetUpdateRect(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = classNameA; @@ -5784,14 +5825,14 @@ static void test_GetUpdateRect(void) parent_wm_paint = FALSE; grandparent_wm_paint = FALSE; - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) { if (msg.message == WM_PAINT) { if (msg.hwnd == hgrandparent) grandparent_wm_paint = TRUE; if (msg.hwnd == hparent) parent_wm_paint = TRUE; } - DispatchMessage(&msg); + DispatchMessageA(&msg); } ok(parent_wm_paint, "WM_PAINT should have been received in parent\n"); ok(!grandparent_wm_paint, "WM_PAINT should NOT have been received in grandparent\n"); @@ -5830,7 +5871,7 @@ static LRESULT CALLBACK TestExposedRegion_WndProc(HWND hwnd, UINT msg, WPARAM wP return 1; } - return DefWindowProc(hwnd, msg, wParam, lParam); + return DefWindowProcA(hwnd, msg, wParam, lParam); } static void test_Expose(void) @@ -5859,7 +5900,7 @@ static LRESULT CALLBACK TestNCRedraw_WndProc(HWND hwnd, UINT msg, WPARAM wParam, switch(msg) { case WM_CREATE: - ncredrawflags = *(UINT *) (((CREATESTRUCT *)lParam)->lpCreateParams); + ncredrawflags = *(UINT *) (((CREATESTRUCTA *)lParam)->lpCreateParams); return 0; case WM_NCPAINT: RedrawWindow(hwnd, NULL, NULL, ncredrawflags); @@ -5869,7 +5910,7 @@ static LRESULT CALLBACK TestNCRedraw_WndProc(HWND hwnd, UINT msg, WPARAM wParam, EndPaint(hwnd, &ps); return 0; } - return DefWindowProc(hwnd, msg, wParam, lParam); + return DefWindowProcA(hwnd, msg, wParam, lParam); } static void run_NCRedrawLoop(UINT flags) @@ -5885,12 +5926,12 @@ static void run_NCRedrawLoop(UINT flags) ShowWindow(hwnd, SW_SHOW); UpdateWindow(hwnd); flush_events( FALSE ); - while(PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE) != 0) + while (PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE)) { if (msg.message == WM_PAINT) loopcount++; if (loopcount >= 100) break; TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); MsgWaitForMultipleObjects(0, NULL, FALSE, 100, QS_ALLINPUT); } if (flags == (RDW_INVALIDATE | RDW_FRAME)) @@ -5910,8 +5951,8 @@ static void test_NCRedraw(void) wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = 0; - wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); - wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass.hIcon = LoadIconA(0, (LPCSTR)IDI_APPLICATION); + wndclass.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); wndclass.hbrBackground = GetStockObject(WHITE_BRUSH); wndclass.lpszMenuName = NULL; @@ -5937,12 +5978,12 @@ static void test_GetWindowModuleFileName(void) hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP, 0,0,0,0, 0, 0, 0, NULL); assert(hwnd); - hinst = (HINSTANCE)GetWindowLongPtr(hwnd, GWLP_HINSTANCE); - ok(hinst == 0 || broken(hinst == GetModuleHandle(0)), /* win9x */ "expected 0, got %p\n", hinst); + hinst = (HINSTANCE)GetWindowLongPtrA(hwnd, GWLP_HINSTANCE); + ok(hinst == 0 || broken(hinst == GetModuleHandleA(NULL)), /* win9x */ "expected 0, got %p\n", hinst); buf1[0] = 0; SetLastError(0xdeadbeef); - ret1 = GetModuleFileName(hinst, buf1, sizeof(buf1)); + ret1 = GetModuleFileNameA(hinst, buf1, sizeof(buf1)); ok(ret1, "GetModuleFileName error %u\n", GetLastError()); buf2[0] = 0; @@ -5956,10 +5997,10 @@ static void test_GetWindowModuleFileName(void) ok(ret1 == ret2 || broken(ret2 == ret1 + 1), /* win98 */ "%u != %u\n", ret1, ret2); ok(!strcmp(buf1, buf2), "%s != %s\n", buf1, buf2); } - hinst = GetModuleHandle(0); + hinst = GetModuleHandleA(NULL); SetLastError(0xdeadbeef); - ret2 = GetModuleFileName(hinst, buf2, ret1 - 2); + ret2 = GetModuleFileNameA(hinst, buf2, ret1 - 2); ok(ret2 == ret1 - 2 || broken(ret2 == ret1 - 3), /* win98 */ "expected %u, got %u\n", ret1 - 2, ret2); ok(GetLastError() == 0xdeadbeef /* XP */ || @@ -5967,7 +6008,7 @@ static void test_GetWindowModuleFileName(void) "expected 0xdeadbeef or ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); SetLastError(0xdeadbeef); - ret2 = GetModuleFileName(hinst, buf2, 0); + ret2 = GetModuleFileNameA(hinst, buf2, 0); ok(!ret2, "GetModuleFileName should return 0\n"); ok(GetLastError() == 0xdeadbeef /* XP */ || GetLastError() == ERROR_INSUFFICIENT_BUFFER, /* win2k3, vista */ @@ -5998,7 +6039,7 @@ static void test_GetWindowModuleFileName(void) ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE || broken(GetLastError() == 0xdeadbeef), /* win9x */ "expected ERROR_INVALID_WINDOW_HANDLE, got %u\n", GetLastError()); - hwnd = FindWindow("Shell_TrayWnd", NULL); + hwnd = FindWindowA("Shell_TrayWnd", NULL); ok(IsWindow(hwnd) || broken(!hwnd), "got invalid tray window %p\n", hwnd); SetLastError(0xdeadbeef); ret1 = pGetWindowModuleFileNameA(hwnd, buf1, sizeof(buf1)); @@ -6006,7 +6047,7 @@ static void test_GetWindowModuleFileName(void) if (!ret1) /* inter-process GetWindowModuleFileName works on win9x, so don't test the desktop there */ { - ret1 = GetModuleFileName(0, buf1, sizeof(buf1)); + ret1 = GetModuleFileNameA(0, buf1, sizeof(buf1)); hwnd = GetDesktopWindow(); ok(IsWindow(hwnd), "got invalid desktop window %p\n", hwnd); SetLastError(0xdeadbeef); @@ -6052,7 +6093,7 @@ static void test_hwnd_message(void) "parent shouldn't have parent %p\n", pGetAncestor(parent, GA_PARENT) ); trace("parent %p root %p desktop %p\n", parent, root, desktop); if (!GetClassNameA( parent, buffer, sizeof(buffer) )) buffer[0] = 0; - ok( !lstrcmpi( buffer, "Message" ), "wrong parent class '%s'\n", buffer ); + ok( !lstrcmpiA( buffer, "Message" ), "wrong parent class '%s'\n", buffer ); GetWindowRect( parent, &rect ); ok( rect.left == 0 && rect.right == 100 && rect.top == 0 && rect.bottom == 100, "wrong parent rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); @@ -6120,7 +6161,7 @@ static void test_layered_window(void) ok( !ret, "GetLayeredWindowAttributes should fail on non-layered window\n" ); ret = pSetLayeredWindowAttributes( hwnd, 0, 0, LWA_ALPHA ); ok( !ret, "SetLayeredWindowAttributes should fail on non-layered window\n" ); - SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); + SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on layered but not initialized window\n" ); ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); @@ -6140,13 +6181,13 @@ static void test_layered_window(void) ok( GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", GetLastError() ); /* clearing WS_EX_LAYERED resets attributes */ - SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED ); + SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED ); SetLastError( 0xdeadbeef ); ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); ok( !ret, "UpdateLayeredWindow should fail on non-layered window\n" ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on no longer layered window\n" ); - SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); + SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); ok( !ret, "GetLayeredWindowAttributes should fail on layered but not initialized window\n" ); ret = pUpdateLayeredWindow( hwnd, 0, NULL, &sz, hdc, &pt, 0, NULL, ULW_OPAQUE ); @@ -6225,8 +6266,8 @@ static void test_layered_window(void) ok( flags == 0, "wrong flags %x\n", flags ); /* default alpha and color key is 0 */ - SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED ); - SetWindowLong( hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); + SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) & ~WS_EX_LAYERED ); + SetWindowLongA( hwnd, GWL_EXSTYLE, GetWindowLongA(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED ); ret = pSetLayeredWindowAttributes( hwnd, 0x222222, 55, 0 ); ok( ret, "SetLayeredWindowAttributes should succeed on layered window\n" ); ret = pGetLayeredWindowAttributes( hwnd, &key, &alpha, &flags ); @@ -6268,7 +6309,7 @@ static LRESULT CALLBACK fullscreen_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPAR break; } } - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcA(hwnd, msg, wp, lp); } static void test_fullscreen(void) @@ -6279,7 +6320,7 @@ static void test_fullscreen(void) static const DWORD t_ex_style[] = { 0, WS_EX_APPWINDOW, WS_EX_TOOLWINDOW }; - WNDCLASS cls; + WNDCLASSA cls; HWND hwnd; int i, j; POINT pt; @@ -6310,13 +6351,13 @@ static void test_fullscreen(void) cls.lpfnWndProc = fullscreen_wnd_proc; cls.cbClsExtra = 0; cls.cbWndExtra = 0; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "fullscreen_class"; - RegisterClass(&cls); + RegisterClassA(&cls); for (i = 0; i < sizeof(t_style)/sizeof(t_style[0]); i++) { @@ -6334,7 +6375,7 @@ static void test_fullscreen(void) hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom, - GetDesktopWindow(), 0, GetModuleHandle(0), NULL); + GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL); ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style); GetWindowRect(hwnd, &rc); trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom); @@ -6346,7 +6387,7 @@ static void test_fullscreen(void) style = t_style[i] | WS_MAXIMIZE; hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom, - GetDesktopWindow(), 0, GetModuleHandle(0), NULL); + GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL); ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style); GetWindowRect(hwnd, &rc); trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom); @@ -6358,7 +6399,7 @@ static void test_fullscreen(void) style = t_style[i] | WS_MAXIMIZE | WS_CAPTION; hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom, - GetDesktopWindow(), 0, GetModuleHandle(0), NULL); + GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL); ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style); GetWindowRect(hwnd, &rc); trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom); @@ -6370,7 +6411,7 @@ static void test_fullscreen(void) style = t_style[i] | WS_CAPTION | WS_MAXIMIZEBOX; hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom, - GetDesktopWindow(), 0, GetModuleHandle(0), NULL); + GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL); ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style); GetWindowRect(hwnd, &rc); trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom); @@ -6382,7 +6423,7 @@ static void test_fullscreen(void) style = t_style[i] | WS_MAXIMIZE | WS_CAPTION | WS_MAXIMIZEBOX; hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom, - GetDesktopWindow(), 0, GetModuleHandle(0), NULL); + GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL); ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style); GetWindowRect(hwnd, &rc); trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom); @@ -6399,7 +6440,7 @@ static void test_fullscreen(void) style = t_style[i] | WS_MAXIMIZE | WS_MAXIMIZEBOX; hwnd = CreateWindowExA(ex_style, "fullscreen_class", NULL, style, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right, mi.rcMonitor.bottom, - GetDesktopWindow(), 0, GetModuleHandle(0), NULL); + GetDesktopWindow(), 0, GetModuleHandleA(NULL), NULL); ok(hwnd != 0, "%d: CreateWindowExA(%#x/%#x) failed\n", i, ex_style, style); GetWindowRect(hwnd, &rc); trace("%#x/%#x: window rect %d,%d-%d,%d\n", ex_style, style, rc.left, rc.top, rc.right, rc.bottom); @@ -6418,7 +6459,7 @@ static void test_fullscreen(void) } } - UnregisterClass("fullscreen_class", GetModuleHandle(0)); + UnregisterClassA("fullscreen_class", GetModuleHandleA(NULL)); } static BOOL test_thick_child_got_minmax; @@ -6529,7 +6570,7 @@ static void test_thick_child_size(HWND parentWindow) LONG expectedWidth; LONG expectedHeight; WNDCLASSA cls; - LPCTSTR className = "THICK_CHILD_CLASS"; + static const char className[] = "THICK_CHILD_CLASS"; int i; LONG adjustedStyle; static const LONG styles[NUMBER_OF_THICK_CHILD_TESTS] = { @@ -6594,7 +6635,7 @@ static void test_thick_child_size(HWND parentWindow) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = className; @@ -6610,7 +6651,7 @@ static void test_thick_child_size(HWND parentWindow) test_thick_child_got_minmax = FALSE; SetLastError(0xdeadbeef); - childWindow = CreateWindowEx( exStyles[i], className, "", styles[i], 0, 0, 0, 0, parentWindow, 0, GetModuleHandleA(0), NULL ); + childWindow = CreateWindowExA( exStyles[i], className, "", styles[i], 0, 0, 0, 0, parentWindow, 0, GetModuleHandleA(0), NULL ); ok(childWindow != NULL, "Failed to create child window, error: %u\n", GetLastError()); ok(test_thick_child_got_minmax, "Got no WM_GETMINMAXINFO\n"); @@ -6647,7 +6688,7 @@ static void test_thick_child_size(HWND parentWindow) success = DestroyWindow(childWindow); ok(success,"DestroyWindow call failed, error: %u\n", GetLastError()); } - ok(UnregisterClass(className, GetModuleHandleA(0)),"UnregisterClass call failed\n"); + ok(UnregisterClassA(className, GetModuleHandleA(NULL)),"UnregisterClass call failed\n"); } static void test_handles( HWND full_hwnd ) @@ -6933,15 +6974,15 @@ static void test_GetLastActivePopup(void) hwndOwner = CreateWindowExA(0, "MainWindowClass", NULL, WS_VISIBLE | WS_POPUPWINDOW, 100, 100, 200, 200, - NULL, 0, GetModuleHandle(0), NULL); + NULL, 0, GetModuleHandleA(NULL), NULL); hwndPopup1 = CreateWindowExA(0, "MainWindowClass", NULL, WS_VISIBLE | WS_POPUPWINDOW, 100, 100, 200, 200, - hwndOwner, 0, GetModuleHandle(0), NULL); + hwndOwner, 0, GetModuleHandleA(NULL), NULL); hwndPopup2 = CreateWindowExA(0, "MainWindowClass", NULL, WS_VISIBLE | WS_POPUPWINDOW, 100, 100, 200, 200, - hwndPopup1, 0, GetModuleHandle(0), NULL); + hwndPopup1, 0, GetModuleHandleA(NULL), NULL); ok( GetLastActivePopup(hwndOwner) == hwndPopup2, "wrong last active popup\n" ); DestroyWindow( hwndPopup2 ); DestroyWindow( hwndPopup1 ); @@ -6951,12 +6992,12 @@ static void test_GetLastActivePopup(void) static LRESULT WINAPI my_httrasparent_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { if (msg == WM_NCHITTEST) return HTTRANSPARENT; - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcA(hwnd, msg, wp, lp); } static LRESULT WINAPI my_window_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcA(hwnd, msg, wp, lp); } static void create_window_tree(HWND parent, HWND *window, int size) @@ -6970,76 +7011,76 @@ static void create_window_tree(HWND parent, HWND *window, int size) for (i = 0; i < sizeof(style)/sizeof(style[0]); i++) { assert(pos < size); - window[pos] = CreateWindowEx(0, "my_window", NULL, style[i] | WS_CHILD, + window[pos] = CreateWindowExA(0, "my_window", NULL, style[i] | WS_CHILD, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(WS_EX_TRANSPARENT, "my_window", NULL, style[i] | WS_CHILD, + window[pos] = CreateWindowExA(WS_EX_TRANSPARENT, "my_window", NULL, style[i] | WS_CHILD, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(0, "my_httrasparent", NULL, style[i] | WS_CHILD, + window[pos] = CreateWindowExA(0, "my_httrasparent", NULL, style[i] | WS_CHILD, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(WS_EX_TRANSPARENT, "my_httrasparent", NULL, style[i] | WS_CHILD, + window[pos] = CreateWindowExA(WS_EX_TRANSPARENT, "my_httrasparent", NULL, style[i] | WS_CHILD, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(0, "my_button", NULL, style[i] | WS_CHILD | BS_GROUPBOX, + window[pos] = CreateWindowExA(0, "my_button", NULL, style[i] | WS_CHILD | BS_GROUPBOX, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(WS_EX_TRANSPARENT, "my_button", NULL, style[i] | WS_CHILD | BS_GROUPBOX, + window[pos] = CreateWindowExA(WS_EX_TRANSPARENT, "my_button", NULL, style[i] | WS_CHILD | BS_GROUPBOX, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(0, "my_button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON, + window[pos] = CreateWindowExA(0, "my_button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(WS_EX_TRANSPARENT, "my_button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON, + window[pos] = CreateWindowExA(WS_EX_TRANSPARENT, "my_button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(0, "Button", NULL, style[i] | WS_CHILD | BS_GROUPBOX, + window[pos] = CreateWindowExA(0, "Button", NULL, style[i] | WS_CHILD | BS_GROUPBOX, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(WS_EX_TRANSPARENT, "Button", NULL, style[i] | WS_CHILD | BS_GROUPBOX, + window[pos] = CreateWindowExA(WS_EX_TRANSPARENT, "Button", NULL, style[i] | WS_CHILD | BS_GROUPBOX, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(0, "Button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON, + window[pos] = CreateWindowExA(0, "Button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(WS_EX_TRANSPARENT, "Button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON, + window[pos] = CreateWindowExA(WS_EX_TRANSPARENT, "Button", NULL, style[i] | WS_CHILD | BS_PUSHBUTTON, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(0, "Static", NULL, style[i] | WS_CHILD, + window[pos] = CreateWindowExA(0, "Static", NULL, style[i] | WS_CHILD, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; assert(pos < size); - window[pos] = CreateWindowEx(WS_EX_TRANSPARENT, "Static", NULL, style[i] | WS_CHILD, + window[pos] = CreateWindowExA(WS_EX_TRANSPARENT, "Static", NULL, style[i] | WS_CHILD, 0, 0, 100, 100, parent, 0, 0, NULL); ok(window[pos] != 0, "CreateWindowEx failed\n"); pos++; @@ -7049,22 +7090,22 @@ static void create_window_tree(HWND parent, HWND *window, int size) struct window_attributes { char class_name[128]; - int is_visible, is_enabled, is_groupbox, is_httransparent, is_extransparent; + BOOL is_visible, is_enabled, is_groupbox, is_httransparent, is_extransparent; }; static void get_window_attributes(HWND hwnd, struct window_attributes *attrs) { DWORD style, ex_style, hittest; - style = GetWindowLong(hwnd, GWL_STYLE); - ex_style = GetWindowLong(hwnd, GWL_EXSTYLE); + style = GetWindowLongA(hwnd, GWL_STYLE); + ex_style = GetWindowLongA(hwnd, GWL_EXSTYLE); attrs->class_name[0] = 0; - GetClassName(hwnd, attrs->class_name, sizeof(attrs->class_name)); - hittest = SendMessage(hwnd, WM_NCHITTEST, 0, 0); + GetClassNameA(hwnd, attrs->class_name, sizeof(attrs->class_name)); + hittest = SendMessageA(hwnd, WM_NCHITTEST, 0, 0); attrs->is_visible = (style & WS_VISIBLE) != 0; attrs->is_enabled = (style & WS_DISABLED) == 0; - attrs->is_groupbox = !lstrcmpi(attrs->class_name, "Button") && (style & BS_TYPEMASK) == BS_GROUPBOX; + attrs->is_groupbox = !lstrcmpiA(attrs->class_name, "Button") && (style & BS_TYPEMASK) == BS_GROUPBOX; attrs->is_httransparent = hittest == HTTRANSPARENT; attrs->is_extransparent = (ex_style & WS_EX_TRANSPARENT) != 0; } @@ -7093,26 +7134,26 @@ static void test_child_window_from_point(void) int found_invisible, found_disabled, found_groupbox, found_httransparent, found_extransparent; int ret, i; - ret = GetClassInfo(0, "Button", &cls); + ret = GetClassInfoA(0, "Button", &cls); ok(ret, "GetClassInfo(Button) failed\n"); cls.lpszClassName = "my_button"; - ret = RegisterClass(&cls); + ret = RegisterClassA(&cls); ok(ret, "RegisterClass(my_button) failed\n"); cls.lpszClassName = "my_httrasparent"; cls.lpfnWndProc = my_httrasparent_proc; - ret = RegisterClass(&cls); + ret = RegisterClassA(&cls); ok(ret, "RegisterClass(my_httrasparent) failed\n"); cls.lpszClassName = "my_window"; cls.lpfnWndProc = my_window_proc; - ret = RegisterClass(&cls); + ret = RegisterClassA(&cls); ok(ret, "RegisterClass(my_window) failed\n"); - parent = CreateWindowEx(0, "MainWindowClass", NULL, + parent = CreateWindowExA(0, "MainWindowClass", NULL, WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE, 100, 100, 200, 200, - 0, 0, GetModuleHandle(0), NULL); + 0, 0, GetModuleHandleA(NULL), NULL); ok(parent != 0, "CreateWindowEx failed\n"); trace("parent %p\n", parent); @@ -7172,11 +7213,11 @@ todo_wine todo_wine ok(found_extransparent, "found %d extransparent windows\n", found_extransparent); - ret = UnregisterClass("my_button", cls.hInstance); + ret = UnregisterClassA("my_button", cls.hInstance); ok(ret, "UnregisterClass(my_button) failed\n"); - ret = UnregisterClass("my_httrasparent", cls.hInstance); + ret = UnregisterClassA("my_httrasparent", cls.hInstance); ok(ret, "UnregisterClass(my_httrasparent) failed\n"); - ret = UnregisterClass("my_window", cls.hInstance); + ret = UnregisterClassA("my_window", cls.hInstance); ok(ret, "UnregisterClass(my_window) failed\n"); } @@ -7194,11 +7235,11 @@ static void test_map_points(void) RECT client_rect; /* Create test windows */ - wnd = CreateWindow("static", "test1", WS_POPUP, pos.x, pos.y, width, height, NULL, NULL, NULL, NULL); + wnd = CreateWindowA("static", "test1", WS_POPUP, pos.x, pos.y, width, height, NULL, NULL, NULL, NULL); ok(wnd != NULL, "Failed %p\n", wnd); - wnd0 = CreateWindow("static", "test2", WS_POPUP, 0, 0, width, height, NULL, NULL, NULL, NULL); + wnd0 = CreateWindowA("static", "test2", WS_POPUP, 0, 0, width, height, NULL, NULL, NULL, NULL); ok(wnd0 != NULL, "Failed %p\n", wnd); - dwnd = CreateWindow("static", "test3", 0, 200, 300, 150, 150, NULL, NULL, NULL, NULL); + dwnd = CreateWindowA("static", "test3", 0, 200, 300, 150, 150, NULL, NULL, NULL, NULL); DestroyWindow(dwnd); ok(dwnd != NULL, "Failed %p\n", dwnd); @@ -7469,6 +7510,26 @@ todo_wine DestroyWindow(parent); } +static void test_window_without_child_style(void) +{ + HWND hwnd; + + hwnd = CreateWindowExA(0, "edit", NULL, WS_VISIBLE|WS_CHILD, + 0, 0, 50, 50, hwndMain, NULL, 0, NULL); + ok(hwnd != NULL, "CreateWindow failed\n"); + + ok(SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & (~WS_CHILD)), + "can't remove WS_CHILD style\n"); + + SetActiveWindow(hwndMain); + PostMessageW(hwnd, WM_LBUTTONUP, 0, 0); + SendMessageW(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0); + check_active_state(hwnd, hwnd, hwnd); + flush_events(TRUE); + + DestroyWindow(hwnd); +} + START_TEST(win) { HMODULE user32 = GetModuleHandleA( "user32.dll" ); @@ -7493,6 +7554,32 @@ START_TEST(win) if (!RegisterWindowClasses()) assert(0); + hwndMain = CreateWindowExA(/*WS_EX_TOOLWINDOW*/ 0, "MainWindowClass", "Main window", + WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | + WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE, + 100, 100, 200, 200, + 0, 0, GetModuleHandleA(NULL), NULL); + assert( hwndMain ); + + if(!SetForegroundWindow(hwndMain)) { + /* workaround for foreground lock timeout */ + INPUT input[2]; + UINT events_no; + + memset(input, 0, sizeof(input)); + input[0].type = INPUT_MOUSE; + U(input[0]).mi.dx = 101; + U(input[0]).mi.dy = 101; + U(input[0]).mi.dwFlags = MOUSEEVENTF_LEFTDOWN; + input[0].type = INPUT_MOUSE; + U(input[0]).mi.dx = 101; + U(input[0]).mi.dy = 101; + U(input[0]).mi.dwFlags = MOUSEEVENTF_LEFTUP; + events_no = SendInput(2, input, sizeof(input[0])); + ok(events_no == 2, "SendInput returned %d\n", events_no); + ok(SetForegroundWindow(hwndMain), "SetForegroundWindow failed\n"); + } + SetLastError(0xdeafbeef); GetWindowLongPtrW(GetDesktopWindow(), GWLP_WNDPROC); is_win9x = (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED); @@ -7504,17 +7591,11 @@ START_TEST(win) test_FindWindowEx(); test_SetParent(); - hwndMain = CreateWindowExA(/*WS_EX_TOOLWINDOW*/ 0, "MainWindowClass", "Main window", - WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | - WS_MAXIMIZEBOX | WS_POPUP, - 100, 100, 200, 200, - 0, 0, GetModuleHandle(0), NULL); hwndMain2 = CreateWindowExA(/*WS_EX_TOOLWINDOW*/ 0, "MainWindowClass", "Main window 2", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP, 100, 100, 200, 200, - 0, 0, GetModuleHandle(0), NULL); - assert( hwndMain ); + 0, 0, GetModuleHandleA(NULL), NULL); assert( hwndMain2 ); our_pid = GetWindowThreadProcessId(hwndMain, NULL); @@ -7582,6 +7663,7 @@ START_TEST(win) test_winregion(); test_map_points(); test_update_region(); + test_window_without_child_style(); /* add the tests above this line */ if (hhook) UnhookWindowsHookEx(hhook); diff --git a/rostests/winetests/user32/winstation.c b/rostests/winetests/user32/winstation.c index 248b82e062b..7f91b8b2798 100755 --- a/rostests/winetests/user32/winstation.c +++ b/rostests/winetests/user32/winstation.c @@ -53,7 +53,7 @@ static void register_class(void) cls.cbWndExtra = 0; cls.hInstance = GetModuleHandleA(0); cls.hIcon = 0; - cls.hCursor = LoadCursorA(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPCSTR)IDC_ARROW); cls.hbrBackground = GetStockObject(WHITE_BRUSH); cls.lpszMenuName = NULL; cls.lpszClassName = "WinStationClass"; @@ -79,7 +79,7 @@ static DWORD CALLBACK thread( LPVOID arg ) ok( GetLastError() == ERROR_BUSY || broken(GetLastError() == 0xdeadbeef), /* wow64 */ "bad last error %d\n", GetLastError() ); print_object( d1 ); - d2 = CreateDesktop( "foobar2", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); + d2 = CreateDesktopA( "foobar2", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); trace( "created desktop %p\n", d2 ); ok( d2 != 0, "CreateDesktop failed\n" ); @@ -136,7 +136,7 @@ static void test_handles(void) TRUE, DUPLICATE_SAME_ACCESS ), "DuplicateHandle failed\n" ); ok( CloseHandle(w2), "closing dup win station handle failed\n" ); - w2 = CreateWindowStation("WinSta0", 0, WINSTA_ALL_ACCESS, NULL ); + w2 = CreateWindowStationA("WinSta0", 0, WINSTA_ALL_ACCESS, NULL ); le = GetLastError(); ok( w2 != 0 || le == ERROR_ACCESS_DENIED, "CreateWindowStation failed (%u)\n", le ); if (w2 != 0) @@ -148,39 +148,39 @@ static void test_handles(void) "bad last error %d\n", GetLastError() ); ok( CloseWindowStation( w2 ), "CloseWindowStation failed\n" ); - w2 = CreateWindowStation("WinSta0", 0, WINSTA_ALL_ACCESS, NULL ); + w2 = CreateWindowStationA("WinSta0", 0, WINSTA_ALL_ACCESS, NULL ); ok( CloseHandle( w2 ), "CloseHandle failed\n" ); } else if (le == ERROR_ACCESS_DENIED) win_skip( "Not enough privileges for CreateWindowStation\n" ); - w2 = OpenWindowStation("winsta0", TRUE, WINSTA_ALL_ACCESS ); + w2 = OpenWindowStationA("winsta0", TRUE, WINSTA_ALL_ACCESS ); ok( w2 != 0, "OpenWindowStation failed\n" ); ok( w2 != w1, "OpenWindowStation returned default handle\n" ); ok( CloseWindowStation( w2 ), "CloseWindowStation failed\n" ); - w2 = OpenWindowStation("dummy name", TRUE, WINSTA_ALL_ACCESS ); + w2 = OpenWindowStationA("dummy name", TRUE, WINSTA_ALL_ACCESS ); ok( !w2, "open dummy win station succeeded\n" ); CreateMutexA( NULL, 0, "foobar" ); - w2 = CreateWindowStation("foobar", 0, WINSTA_ALL_ACCESS, NULL ); + w2 = CreateWindowStationA("foobar", 0, WINSTA_ALL_ACCESS, NULL ); le = GetLastError(); ok( w2 != 0 || le == ERROR_ACCESS_DENIED, "create foobar station failed (%u)\n", le ); if (w2 != 0) { - w3 = OpenWindowStation("foobar", TRUE, WINSTA_ALL_ACCESS ); + w3 = OpenWindowStationA("foobar", TRUE, WINSTA_ALL_ACCESS ); ok( w3 != 0, "open foobar station failed\n" ); ok( w3 != w2, "open foobar station returned same handle\n" ); ok( CloseWindowStation( w2 ), "CloseWindowStation failed\n" ); ok( CloseWindowStation( w3 ), "CloseWindowStation failed\n" ); - w3 = OpenWindowStation("foobar", TRUE, WINSTA_ALL_ACCESS ); + w3 = OpenWindowStationA("foobar", TRUE, WINSTA_ALL_ACCESS ); ok( !w3, "open foobar station succeeded\n" ); - w2 = CreateWindowStation("foobar1", 0, WINSTA_ALL_ACCESS, NULL ); + w2 = CreateWindowStationA("foobar1", 0, WINSTA_ALL_ACCESS, NULL ); ok( w2 != 0, "create foobar station failed\n" ); - w3 = CreateWindowStation("foobar2", 0, WINSTA_ALL_ACCESS, NULL ); + w3 = CreateWindowStationA("foobar2", 0, WINSTA_ALL_ACCESS, NULL ); ok( w3 != 0, "create foobar station failed\n" ); ok( GetHandleInformation( w2, &flags ), "GetHandleInformation failed\n" ); ok( GetHandleInformation( w3, &flags ), "GetHandleInformation failed\n" ); @@ -233,10 +233,10 @@ static void test_handles(void) TRUE, DUPLICATE_SAME_ACCESS ), "DuplicateHandle failed\n" ); ok( CloseHandle(d2), "closing dup desktop handle failed\n" ); - d2 = OpenDesktop( "dummy name", 0, TRUE, DESKTOP_ALL_ACCESS ); + d2 = OpenDesktopA( "dummy name", 0, TRUE, DESKTOP_ALL_ACCESS ); ok( !d2, "open dummy desktop succeeded\n" ); - d2 = CreateDesktop( "foobar", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); + d2 = CreateDesktopA( "foobar", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); ok( d2 != 0, "create foobar desktop failed\n" ); SetLastError( 0xdeadbeef ); ok( !CloseWindowStation( (HWINSTA)d2 ), "CloseWindowStation succeeded on desktop\n" ); @@ -244,18 +244,18 @@ static void test_handles(void) "bad last error %d\n", GetLastError() ); SetLastError( 0xdeadbeef ); - d3 = CreateDesktop( "foobar", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); + d3 = CreateDesktopA( "foobar", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL ); ok( d3 != 0, "create foobar desktop again failed\n" ); ok( GetLastError() == 0xdeadbeef, "bad last error %d\n", GetLastError() ); ok( CloseDesktop( d3 ), "CloseDesktop failed\n" ); - d3 = OpenDesktop( "foobar", 0, TRUE, DESKTOP_ALL_ACCESS ); + d3 = OpenDesktopA( "foobar", 0, TRUE, DESKTOP_ALL_ACCESS ); ok( d3 != 0, "open foobar desktop failed\n" ); ok( d3 != d2, "open foobar desktop returned same handle\n" ); ok( CloseDesktop( d2 ), "CloseDesktop failed\n" ); ok( CloseDesktop( d3 ), "CloseDesktop failed\n" ); - d3 = OpenDesktop( "foobar", 0, TRUE, DESKTOP_ALL_ACCESS ); + d3 = OpenDesktopA( "foobar", 0, TRUE, DESKTOP_ALL_ACCESS ); ok( !d3, "open foobar desktop succeeded\n" ); ok( !CloseHandle(d1), "closing thread desktop handle succeeded\n" ); @@ -270,6 +270,9 @@ static void test_handles(void) trace( "get other thread desktop: %p\n", GetThreadDesktop(id) ); WaitForSingleObject( hthread, INFINITE ); CloseHandle( hthread ); + + /* clean side effect */ + SetProcessWindowStation( w1 ); } /* Enumeration tests */ @@ -294,7 +297,8 @@ static BOOL CALLBACK open_window_station_callbackA(LPSTR winsta, LPARAM lp) static void test_enumstations(void) { - BOOL ret; + DWORD ret; + HWINSTA hwinsta; if (0) /* Crashes instead */ { @@ -304,6 +308,15 @@ static void test_enumstations(void) ok(GetLastError() == ERROR_INVALID_PARAMETER, "LastError is set to %08x\n", GetLastError()); } + hwinsta = CreateWindowStationA("winsta_test", 0, WINSTA_ALL_ACCESS, NULL); + ret = GetLastError(); + ok(hwinsta != NULL || ret == ERROR_ACCESS_DENIED, "CreateWindowStation failed (%u)\n", ret); + if (!hwinsta) + { + win_skip("Not enough privileges for CreateWindowStation\n"); + return; + } + SetLastError(0xdeadbeef); ret = EnumWindowStationsA(open_window_station_callbackA, 0x12345); ok(ret == 0x12345, "EnumWindowStationsA returned %x\n", ret); @@ -383,7 +396,7 @@ static void test_getuserobjectinformation(void) DWORD size; BOOL ret; - desk = CreateDesktop("foobarTest", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL); + desk = CreateDesktopA("foobarTest", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL); ok(desk != 0, "open foobarTest desktop failed\n"); strcpy(buffer, "blahblah"); @@ -475,6 +488,442 @@ static void test_getuserobjectinformation(void) ok(CloseDesktop(desk), "CloseDesktop failed\n"); } +static void test_inputdesktop(void) +{ + HDESK input_desk, old_input_desk, thread_desk, old_thread_desk, new_desk; + DWORD ret; + CHAR name[1024]; + INPUT inputs[1]; + + inputs[0].type = INPUT_KEYBOARD; + U(inputs[0]).ki.wVk = 0; + U(inputs[0]).ki.wScan = 0x3c0; + U(inputs[0]).ki.dwFlags = KEYEVENTF_UNICODE; + + /* OpenInputDesktop creates new handles for each calls */ + old_input_desk = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); + ok(old_input_desk != NULL, "OpenInputDesktop failed!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(old_input_desk, UOI_NAME, name, 1024, NULL); + ok(ret, "GetUserObjectInformation failed!\n"); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + input_desk = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); + ok(input_desk != NULL, "OpenInputDesktop failed!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(input_desk, UOI_NAME, name, 1024, NULL); + ok(ret, "GetUserObjectInformation failed!\n"); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + ok(old_input_desk != input_desk, "returned the same handle!\n"); + ret = CloseDesktop(input_desk); + ok(ret, "CloseDesktop failed!\n"); + + /* by default, GetThreadDesktop is the input desktop, SendInput should success. */ + old_thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(old_thread_desk != NULL, "GetThreadDesktop faile!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(old_thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + ok(GetLastError() == 0xdeadbeef, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1, "unexpected return count %d\n", ret); + + /* Set thread desktop to the new desktop, SendInput should fail. */ + new_desk = CreateDesktopA("new_desk", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL); + ok(new_desk != NULL, "CreateDesktop failed!\n"); + ret = SetThreadDesktop(new_desk); + ok(ret, "SetThreadDesktop failed!\n"); + thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(thread_desk == new_desk, "thread desktop doesn't match!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "new_desk"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + if(broken(GetLastError() == 0xdeadbeef)) + { + SetThreadDesktop(old_thread_desk); + CloseDesktop(old_input_desk); + CloseDesktop(input_desk); + CloseDesktop(new_desk); + win_skip("Skip tests on NT4\n"); + return; + } +todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1 || broken(ret == 0) /* Win64 */, "unexpected return count %d\n", ret); + + /* Set thread desktop back to the old thread desktop, SendInput should success. */ + ret = SetThreadDesktop(old_thread_desk); + ok(ret, "SetThreadDesktop failed!\n"); + thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(thread_desk == old_thread_desk, "thread desktop doesn't match!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + ok(GetLastError() == 0xdeadbeef, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1, "unexpected return count %d\n", ret); + + /* Set thread desktop to the input desktop, SendInput should success. */ + ret = SetThreadDesktop(old_input_desk); + ok(ret, "SetThreadDesktop failed!\n"); + thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(thread_desk == old_input_desk, "thread desktop doesn't match!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + ok(GetLastError() == 0xdeadbeef, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1, "unexpected return count %d\n", ret); + + /* Switch input desktop to the new desktop, SendInput should fail. */ + ret = SwitchDesktop(new_desk); + ok(ret, "SwitchDesktop failed!\n"); + input_desk = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); + ok(input_desk != NULL, "OpenInputDesktop failed!\n"); + ok(input_desk != new_desk, "returned the same handle!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(input_desk, UOI_NAME, name, 1024, NULL); + ok(ret, "GetUserObjectInformation failed!\n"); +todo_wine + ok(!strcmp(name, "new_desk"), "unexpected desktop %s\n", name); + ret = CloseDesktop(input_desk); + ok(ret, "CloseDesktop failed!\n"); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); +todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1 || broken(ret == 0) /* Win64 */, "unexpected return count %d\n", ret); + + /* Set thread desktop to the new desktop, SendInput should success. */ + ret = SetThreadDesktop(new_desk); + ok(ret, "SetThreadDesktop failed!\n"); + thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(thread_desk == new_desk, "thread desktop doesn't match!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "new_desk"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + ok(GetLastError() == 0xdeadbeef, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1, "unexpected return count %d\n", ret); + + /* Switch input desktop to the old input desktop, set thread desktop to the old + * thread desktop, clean side effects. SendInput should success. */ + ret = SwitchDesktop(old_input_desk); + input_desk = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); + ok(input_desk != NULL, "OpenInputDesktop failed!\n"); + ok(input_desk != old_input_desk, "returned the same handle!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(input_desk, UOI_NAME, name, 1024, NULL); + ok(ret, "GetUserObjectInformation failed!\n"); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + ret = SetThreadDesktop(old_thread_desk); + ok(ret, "SetThreadDesktop failed!\n"); + thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(thread_desk == old_thread_desk, "thread desktop doesn't match!\n"); + memset(name, 0, sizeof(name)); + ret = GetUserObjectInformationA(thread_desk, UOI_NAME, name, 1024, NULL); + ok(!strcmp(name, "Default"), "unexpected desktop %s\n", name); + + SetLastError(0xdeadbeef); + ret = SendInput(1, inputs, sizeof(INPUT)); + ok(GetLastError() == 0xdeadbeef, "unexpected last error %08x\n", GetLastError()); + ok(ret == 1, "unexpected return count %d\n", ret); + + /* free resources */ + ret = CloseDesktop(input_desk); + ok(ret, "CloseDesktop failed!\n"); + ret = CloseDesktop(old_input_desk); + ok(ret, "CloseDesktop failed!\n"); + ret = CloseDesktop(new_desk); + ok(ret, "CloseDesktop failed!\n"); +} + +static void test_inputdesktop2(void) +{ + HWINSTA w1, w2; + HDESK thread_desk, new_desk, input_desk, hdesk; + DWORD ret; + + thread_desk = GetThreadDesktop(GetCurrentThreadId()); + ok(thread_desk != NULL, "GetThreadDesktop failed!\n"); + w1 = GetProcessWindowStation(); + ok(w1 != NULL, "GetProcessWindowStation failed!\n"); + SetLastError(0xdeadbeef); + w2 = CreateWindowStationA("winsta_test", 0, WINSTA_ALL_ACCESS, NULL); + ret = GetLastError(); + ok(w2 != NULL || ret == ERROR_ACCESS_DENIED, "CreateWindowStation failed (%u)\n", ret); + if (!w2) + { + win_skip("Not enough privileges for CreateWindowStation\n"); + return; + } + + ret = EnumDesktopsA(GetProcessWindowStation(), desktop_callbackA, 0); + ok(!ret, "EnumDesktopsA failed!\n"); + input_desk = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); + ok(input_desk != NULL, "OpenInputDesktop failed!\n"); + ret = CloseDesktop(input_desk); + ok(ret, "CloseDesktop failed!\n"); + + ret = SetProcessWindowStation(w2); + ok(ret, "SetProcessWindowStation failed!\n"); + hdesk = GetThreadDesktop(GetCurrentThreadId()); + ok(hdesk != NULL, "GetThreadDesktop failed!\n"); + ok(hdesk == thread_desk, "thread desktop should not change after winstation changed!\n"); + ret = EnumDesktopsA(GetProcessWindowStation(), desktop_callbackA, 0); + + new_desk = CreateDesktopA("desk_test", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL); + ok(new_desk != NULL, "CreateDesktop failed!\n"); + ret = EnumDesktopsA(GetProcessWindowStation(), desktop_callbackA, 0); + ok(!ret, "EnumDesktopsA failed!\n"); + SetLastError(0xdeadbeef); + input_desk = OpenInputDesktop(0, FALSE, DESKTOP_ALL_ACCESS); + ok(input_desk == NULL, "OpenInputDesktop should fail on non default winstation!\n"); + ok(GetLastError() == ERROR_INVALID_FUNCTION || broken(GetLastError() == 0xdeadbeef), "last error %08x\n", GetLastError()); + + hdesk = OpenDesktopA("desk_test", 0, TRUE, DESKTOP_ALL_ACCESS); + ok(hdesk != NULL, "OpenDesktop failed!\n"); + SetLastError(0xdeadbeef); + ret = SwitchDesktop(hdesk); +todo_wine + ok(!ret, "Switch to desktop belong to non default winstation should fail!\n"); +todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED || broken(GetLastError() == 0xdeadbeef), "last error %08x\n", GetLastError()); + ret = SetThreadDesktop(hdesk); + ok(ret, "SetThreadDesktop failed!\n"); + + /* clean side effect */ + ret = SetThreadDesktop(thread_desk); +todo_wine + ok(ret, "SetThreadDesktop should success even desktop is not belong to process winstation!\n"); + ret = SetProcessWindowStation(w1); + ok(ret, "SetProcessWindowStation failed!\n"); + ret = SetThreadDesktop(thread_desk); + ok(ret, "SetThreadDesktop failed!\n"); + ret = CloseWindowStation(w2); + ok(ret, "CloseWindowStation failed!\n"); + ret = CloseDesktop(new_desk); + ok(ret, "CloseDesktop failed!\n"); + ret = CloseDesktop(hdesk); + ok(ret, "CloseDesktop failed!\n"); +} + +static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + if (msg == WM_DESTROY) + { + trace("destroying hwnd %p\n", hWnd); + PostQuitMessage(0); + return 0; + } + return DefWindowProcA( hWnd, msg, wParam, lParam ); +} + +typedef struct tag_wnd_param +{ + const char *wnd_name; + HWND hwnd; + HDESK hdesk; + HANDLE hevent; +} wnd_param; + +static DWORD WINAPI create_window(LPVOID param) +{ + wnd_param *param1 = param; + DWORD ret; + MSG msg; + + ret = SetThreadDesktop(param1->hdesk); + ok(ret, "SetThreadDesktop failed!\n"); + param1->hwnd = CreateWindowA("test_class", param1->wnd_name, WS_POPUP, 0, 0, 100, 100, NULL, NULL, NULL, NULL); + ok(param1->hwnd != 0, "CreateWindowA failed!\n"); + ret = SetEvent(param1->hevent); + ok(ret, "SetEvent failed!\n"); + + while (GetMessageA(&msg, 0, 0, 0)) + { + TranslateMessage(&msg); + DispatchMessageA(&msg); + } + + return 0; +} + +static DWORD set_foreground(HWND hwnd) +{ + HWND hwnd_fore; + DWORD set_id, fore_id, ret; + char win_text[1024]; + + hwnd_fore = GetForegroundWindow(); + GetWindowTextA(hwnd_fore, win_text, 1024); + set_id = GetWindowThreadProcessId(hwnd, NULL); + fore_id = GetWindowThreadProcessId(hwnd_fore, NULL); + trace("\"%s\" %p %08x hwnd %p %08x\n", win_text, hwnd_fore, fore_id, hwnd, set_id); + ret = AttachThreadInput(set_id, fore_id, TRUE); + trace("AttachThreadInput returned %08x\n", ret); + ret = ShowWindow(hwnd, SW_SHOWNORMAL); + trace("ShowWindow returned %08x\n", ret); + ret = SetWindowPos(hwnd, HWND_TOPMOST, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE); + trace("set topmost returned %08x\n", ret); + ret = SetWindowPos(hwnd, HWND_NOTOPMOST, 0,0,0,0, SWP_NOSIZE|SWP_NOMOVE); + trace("set notopmost returned %08x\n", ret); + ret = SetForegroundWindow(hwnd); + trace("SetForegroundWindow returned %08x\n", ret); + Sleep(250); + AttachThreadInput(set_id, fore_id, FALSE); + return ret; +} + +static void test_foregroundwindow(void) +{ + HWND hwnd, hwnd_test, partners[2], hwnds[2]; + HDESK hdesks[2]; + int thread_desk_id, input_desk_id, hwnd_id; + WNDCLASSA wclass; + wnd_param param; + DWORD ret, timeout, timeout_old; + char win_text[1024]; + +#define DESKTOPS 2 + + memset( &wclass, 0, sizeof(wclass) ); + wclass.lpszClassName = "test_class"; + wclass.lpfnWndProc = WndProc; + RegisterClassA(&wclass); + param.wnd_name = "win_name"; + + hdesks[0] = GetThreadDesktop(GetCurrentThreadId()); + ok(hdesks[0] != NULL, "OpenDesktop failed!\n"); + SetLastError(0xdeadbeef); + hdesks[1] = CreateDesktopA("desk2", NULL, NULL, 0, DESKTOP_ALL_ACCESS, NULL); + ret = GetLastError(); + ok(hdesks[1] != NULL || ret == ERROR_ACCESS_DENIED, "CreateDesktop failed (%u)\n", ret); + if(!hdesks[1]) + { + win_skip("Not enough privileges for CreateDesktop\n"); + return; + } + + ret = SystemParametersInfoA(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, &timeout_old, 0); + if(!ret) + { + win_skip("Skip tests on NT4\n"); + CloseDesktop(hdesks[1]); + return; + } + trace("old timeout %d\n", timeout_old); + timeout = 0; + ret = SystemParametersInfoA(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, 0, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); + ok(ret, "set foreground lock timeout failed!\n"); + ret = SystemParametersInfoA(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, &timeout, 0); + ok(ret, "get foreground lock timeout failed!\n"); + ok(timeout == 0, "unexpected timeout %d\n", timeout); + + for (thread_desk_id = 0; thread_desk_id < DESKTOPS; thread_desk_id++) + { + param.hdesk = hdesks[thread_desk_id]; + param.hevent = CreateEventA(NULL, TRUE, FALSE, NULL); + CreateThread(NULL, 0, create_window, ¶m, 0, NULL); + ret = WaitForSingleObject(param.hevent, INFINITE); + ok(ret == WAIT_OBJECT_0, "wait failed!\n"); + hwnds[thread_desk_id] = param.hwnd; + } + + for (thread_desk_id = 0; thread_desk_id < DESKTOPS; thread_desk_id++) + { + param.hdesk = hdesks[thread_desk_id]; + param.hevent = CreateEventA(NULL, TRUE, FALSE, NULL); + CreateThread(NULL, 0, create_window, ¶m, 0, NULL); + ret = WaitForSingleObject(param.hevent, INFINITE); + ok(ret == WAIT_OBJECT_0, "wait failed!\n"); + partners[thread_desk_id] = param.hwnd; + } + + trace("hwnd0 %p hwnd1 %p partner0 %p partner1 %p\n", hwnds[0], hwnds[1], partners[0], partners[1]); + + for (hwnd_id = 0; hwnd_id < DESKTOPS; hwnd_id++) + for (thread_desk_id = 0; thread_desk_id < DESKTOPS; thread_desk_id++) + for (input_desk_id = 0; input_desk_id < DESKTOPS; input_desk_id++) + { + trace("testing thread_desk %d input_desk %d hwnd %d\n", + thread_desk_id, input_desk_id, hwnd_id); + hwnd_test = hwnds[hwnd_id]; + ret = SetThreadDesktop(hdesks[thread_desk_id]); + ok(ret, "set thread desktop failed!\n"); + ret = SwitchDesktop(hdesks[input_desk_id]); + ok(ret, "switch desktop failed!\n"); + set_foreground(partners[0]); + set_foreground(partners[1]); + hwnd = GetForegroundWindow(); + ok(hwnd != hwnd_test, "unexpected foreground window %p\n", hwnd); + ret = set_foreground(hwnd_test); + hwnd = GetForegroundWindow(); + GetWindowTextA(hwnd, win_text, 1024); + trace("hwnd %p name %s\n", hwnd, win_text); + if (input_desk_id == hwnd_id) + { + if (input_desk_id == thread_desk_id) + { + ok(ret, "SetForegroundWindow failed!\n"); + ok(hwnd == hwnd_test , "unexpected foreground window %p\n", hwnd); + } + else + { + todo_wine ok(ret, "SetForegroundWindow failed!\n"); + todo_wine ok(hwnd == 0, "unexpected foreground window %p\n", hwnd); + } + } + else + { + if (input_desk_id == thread_desk_id) + { + ok(!ret, "SetForegroundWindow should fail!\n"); + ok(hwnd == partners[input_desk_id] , "unexpected foreground window %p\n", hwnd); + } + else + { + todo_wine ok(!ret, "SetForegroundWindow should fail!\n"); + todo_wine ok(hwnd == 0, "unexpected foreground window %p\n", hwnd); + } + } + } + + /* Clean up */ + + for (thread_desk_id = DESKTOPS - 1; thread_desk_id >= 0; thread_desk_id--) + { + ret = SetThreadDesktop(hdesks[thread_desk_id]); + ok(ret, "set thread desktop failed!\n"); + SendMessageA(hwnds[thread_desk_id], WM_DESTROY, 0, 0); + SendMessageA(partners[thread_desk_id], WM_DESTROY, 0, 0); + } + + ret = SwitchDesktop(hdesks[0]); + ok(ret, "switch desktop failed!\n"); + CloseDesktop(hdesks[1]); + + ret = SystemParametersInfoA(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, UlongToPtr(timeout_old), SPIF_SENDCHANGE | SPIF_UPDATEINIFILE); + ok(ret, "set foreground lock timeout failed!\n"); + ret = SystemParametersInfoA(SPI_GETFOREGROUNDLOCKTIMEOUT, 0, &timeout, 0); + ok(ret, "get foreground lock timeout failed!\n"); + ok(timeout == timeout_old, "unexpected timeout %d\n", timeout); +} + START_TEST(winstation) { /* Check whether this platform supports WindowStation calls */ @@ -487,8 +936,11 @@ START_TEST(winstation) return; } + test_inputdesktop(); + test_inputdesktop2(); test_enumstations(); test_enumdesktops(); test_handles(); test_getuserobjectinformation(); + test_foregroundwindow(); } diff --git a/rostests/winetests/user32/wsprintf.c b/rostests/winetests/user32/wsprintf.c index 5370df4636a..15e4af0e692 100755 --- a/rostests/winetests/user32/wsprintf.c +++ b/rostests/winetests/user32/wsprintf.c @@ -113,16 +113,16 @@ static void wsprintfWTest(void) static void CharUpperTest(void) { - INT_PTR i,out,failed; + INT_PTR i, out; + BOOL failed = FALSE; - failed = 0; for (i=0;i<256;i++) { - out = (INT_PTR)CharUpper((LPTSTR)i); + out = (INT_PTR)CharUpperA((LPSTR)i); /* printf("%0x ",out); */ if ((out >> 16) != 0) { - failed = 1; + failed = TRUE; break; } } @@ -131,16 +131,16 @@ static void CharUpperTest(void) static void CharLowerTest(void) { - INT_PTR i,out,failed; + INT_PTR i, out; + BOOL failed = FALSE; - failed = 0; for (i=0;i<256;i++) { - out = (INT_PTR)CharLower((LPTSTR)i); + out = (INT_PTR)CharLowerA((LPSTR)i); /* printf("%0x ",out); */ if ((out >> 16) != 0) { - failed = 1; + failed = TRUE; break; } } From b3c122ba2c805d2268f5e20516444b7db8b95ded Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 22:39:12 +0000 Subject: [PATCH 358/419] [PSDK] * Add missing LINGUISTIC_IGNORECASE and NORM_LINGUISTIC_CASING definitions. svn path=/trunk/; revision=62786 --- reactos/include/psdk/winnls.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/include/psdk/winnls.h b/reactos/include/psdk/winnls.h index 4ef122053d6..7a9eb2b13a7 100644 --- a/reactos/include/psdk/winnls.h +++ b/reactos/include/psdk/winnls.h @@ -163,6 +163,8 @@ static const WCHAR LOCALE_NAME_SYSTEM_DEFAULT[] = {'!','s','y','s','-','d','e',' #define NORM_IGNORENONSPACE 2 #define NORM_IGNORESYMBOLS 4 #define NORM_IGNOREWIDTH 131072 +#define LINGUISTIC_IGNORECASE 0x00000010 +#define NORM_LINGUISTIC_CASING 0x08000000 #define SORT_STRINGSORT 4096 #define LCMAP_LOWERCASE 0x00000100 #define LCMAP_UPPERCASE 0x00000200 From eeb0d2ad7849030ce5fd0fa51df517d2a3b1bf0f Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 22:50:27 +0000 Subject: [PATCH 359/419] [KERNEL32_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62787 --- rostests/winetests/kernel32/CMakeLists.txt | 11 +- rostests/winetests/kernel32/actctx.c | 562 +++++++++++- rostests/winetests/kernel32/alloc.c | 399 --------- rostests/winetests/kernel32/change.c | 10 +- rostests/winetests/kernel32/codepage.c | 142 +++ rostests/winetests/kernel32/comm.c | 366 +++++++- rostests/winetests/kernel32/console.c | 336 ++++--- rostests/winetests/kernel32/debugger.c | 21 +- rostests/winetests/kernel32/drive.c | 6 +- rostests/winetests/kernel32/environ.c | 2 +- rostests/winetests/kernel32/fiber.c | 31 +- rostests/winetests/kernel32/file.c | 653 ++++++++++++-- rostests/winetests/kernel32/format_msg.c | 2 +- rostests/winetests/kernel32/heap.c | 282 +++++- rostests/winetests/kernel32/loader.c | 989 ++++++++++++++++----- rostests/winetests/kernel32/locale.c | 352 ++++++-- rostests/winetests/kernel32/mailslot.c | 45 +- rostests/winetests/kernel32/module.c | 42 +- rostests/winetests/kernel32/path.c | 347 +++++++- rostests/winetests/kernel32/pipe.c | 140 ++- rostests/winetests/kernel32/process.c | 31 +- rostests/winetests/kernel32/profile.c | 68 +- rostests/winetests/kernel32/resource.c | 70 +- rostests/winetests/kernel32/sync.c | 705 ++++++++++++++- rostests/winetests/kernel32/testlist.c | 2 - rostests/winetests/kernel32/thread.c | 333 ++++++- rostests/winetests/kernel32/time.c | 2 +- rostests/winetests/kernel32/timer.c | 2 +- rostests/winetests/kernel32/toolhelp.c | 20 +- rostests/winetests/kernel32/version.c | 52 +- rostests/winetests/kernel32/virtual.c | 60 +- rostests/winetests/kernel32/volume.c | 45 +- 32 files changed, 4812 insertions(+), 1316 deletions(-) delete mode 100755 rostests/winetests/kernel32/alloc.c diff --git a/rostests/winetests/kernel32/CMakeLists.txt b/rostests/winetests/kernel32/CMakeLists.txt index 2eec89395cd..1b98b38a49d 100644 --- a/rostests/winetests/kernel32/CMakeLists.txt +++ b/rostests/winetests/kernel32/CMakeLists.txt @@ -1,12 +1,8 @@ -add_definitions( - -D__ROS_LONG64__) - remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) list(APPEND SOURCE actctx.c - alloc.c atom.c change.c codepage.c @@ -40,12 +36,7 @@ list(APPEND SOURCE volume.c testlist.c) -add_executable(kernel32_winetest - ${SOURCE} - resource.rc) - -target_link_libraries(kernel32_winetest wine) +add_executable(kernel32_winetest ${SOURCE} resource.rc) set_module_type(kernel32_winetest win32cui) add_importlibs(kernel32_winetest user32 advapi32 msvcrt kernel32 ntdll) - add_cd_file(TARGET kernel32_winetest DESTINATION reactos/bin FOR all) diff --git a/rostests/winetests/kernel32/actctx.c b/rostests/winetests/kernel32/actctx.c index d0e8433ca60..792a292b8d2 100644 --- a/rostests/winetests/kernel32/actctx.c +++ b/rostests/winetests/kernel32/actctx.c @@ -28,8 +28,10 @@ #include static BOOL (WINAPI *pActivateActCtx)(HANDLE,ULONG_PTR*); +static HANDLE (WINAPI *pCreateActCtxA)(PCACTCTXA); static HANDLE (WINAPI *pCreateActCtxW)(PCACTCTXW); static BOOL (WINAPI *pDeactivateActCtx)(DWORD,ULONG_PTR); +static BOOL (WINAPI *pFindActCtxSectionStringA)(DWORD,const GUID *,ULONG,LPCSTR,PACTCTX_SECTION_KEYED_DATA); static BOOL (WINAPI *pFindActCtxSectionStringW)(DWORD,const GUID *,ULONG,LPCWSTR,PACTCTX_SECTION_KEYED_DATA); static BOOL (WINAPI *pGetCurrentActCtx)(HANDLE *); static BOOL (WINAPI *pIsDebuggerPresent)(void); @@ -47,18 +49,6 @@ static const char* strw(LPCWSTR x) return buffer; } -static const char *debugstr_guid(REFIID riid) -{ - static char buf[50]; - - sprintf(buf, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - riid->Data1, riid->Data2, riid->Data3, riid->Data4[0], - riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], - riid->Data4[5], riid->Data4[6], riid->Data4[7]); - - return buf; -} - #ifdef __i386__ #define ARCH "x86" #elif defined __x86_64__ @@ -72,6 +62,11 @@ static const char manifest1[] = "" ""; +static const char manifest1_1[] = +"" +"" +""; + static const char manifest2[] = "" "" @@ -84,11 +79,19 @@ static const char manifest2[] = "" ""; -DEFINE_GUID(IID_CoTest, 0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x11, 0x11, 0x22, 0x22, 0x33, 0x33); -DEFINE_GUID(IID_TlibTest, 0x99999999, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55); +DEFINE_GUID(IID_CoTest, 0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x11, 0x11, 0x22, 0x22, 0x33, 0x33); +DEFINE_GUID(IID_CoTest2, 0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x11, 0x11, 0x22, 0x22, 0x33, 0x34); +DEFINE_GUID(CLSID_clrclass,0x22345678, 0x1234, 0x5678, 0x12, 0x34, 0x11, 0x11, 0x22, 0x22, 0x33, 0x33); +DEFINE_GUID(IID_TlibTest, 0x99999999, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55); DEFINE_GUID(IID_TlibTest2, 0x99999999, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x56); DEFINE_GUID(IID_TlibTest3, 0x99999999, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x57); DEFINE_GUID(IID_TlibTest4, 0x99999999, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x58); +DEFINE_GUID(IID_Iifaceps, 0x66666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55); +DEFINE_GUID(IID_Ibifaceps, 0x66666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x57); +DEFINE_GUID(IID_Iifaceps2, 0x76666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55); +DEFINE_GUID(IID_Iifaceps3, 0x86666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55); +DEFINE_GUID(IID_Iiface, 0x96666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55); +DEFINE_GUID(IID_PS32, 0x66666666, 0x8888, 0x7777, 0x66, 0x66, 0x55, 0x55, 0x55, 0x55, 0x55, 0x56); static const char manifest3[] = "" @@ -106,8 +109,63 @@ static const char manifest3[] = " miscStatusContent=\"insideout\"" " miscStatusThumbnail=\"alignable\"" " miscStatusDocPrint=\"simpleframe,setclientsitefirst\"" +" >" +" ProgId.ProgId.1" +" ProgId.ProgId.2" +" ProgId.ProgId.3" +" ProgId.ProgId.4" +" ProgId.ProgId.5" +" ProgId.ProgId.6" +" " +" " +" ProgId.ProgId.7" +" " +" " "" +" " +" " +" " +" " +" clrprogid.1" +" clrprogid.2" +" clrprogid.3" +" clrprogid.4" +" clrprogid.5" +" clrprogid.6" +" " ""; static const char manifest_wndcls1[] = @@ -128,7 +186,7 @@ static const char manifest_wndcls2[] = " wndClass3" " wndClass4" " " +" flags=\"HiddeN,CoNTROL,rESTRICTED\" />" " " " " "" @@ -665,7 +723,8 @@ static HANDLE test_create(const char *file) actctx.lpSource = path; handle = pCreateActCtxW(&actctx); - ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + /* to be tested outside of this helper, including last error */ + if (handle == INVALID_HANDLE_VALUE) return handle; ok(actctx.cbSize == sizeof(actctx), "actctx.cbSize=%d\n", actctx.cbSize); ok(actctx.dwFlags == 0, "actctx.dwFlags=%d\n", actctx.dwFlags); @@ -777,7 +836,9 @@ struct strsection_header DWORD unk1[3]; ULONG count; ULONG index_offset; - DWORD unk2[4]; + DWORD unk2[2]; + ULONG global_offset; + ULONG global_len; }; struct string_index @@ -841,6 +902,13 @@ struct tlibredirect_data WORD minor_version; }; +struct progidredirect_data +{ + ULONG size; + DWORD reserved; + ULONG clsid_offset; +}; + static void test_find_dll_redirection(HANDLE handle, LPCWSTR libname, ULONG exid, int line) { ACTCTX_SECTION_KEYED_DATA data; @@ -1107,7 +1175,8 @@ struct comclassredirect_data { ULONG name_offset; ULONG progid_len; ULONG progid_offset; - DWORD res2[2]; + ULONG clrdata_len; + ULONG clrdata_offset; DWORD miscstatus; DWORD miscstatuscontent; DWORD miscstatusthumbnail; @@ -1115,10 +1184,23 @@ struct comclassredirect_data { DWORD miscstatusdocprint; }; -static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GUID *tlid, ULONG exid, int line) +struct clrclass_data { + ULONG size; + DWORD res[2]; + ULONG module_len; + ULONG module_offset; + ULONG name_len; + ULONG name_offset; + ULONG version_len; + ULONG version_offset; + DWORD res2[2]; +}; + +static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GUID *tlid, const WCHAR *progid, ULONG exid, int line) { struct comclassredirect_data *comclass, *comclass2; ACTCTX_SECTION_KEYED_DATA data, data2; + struct guidsection_header *header; BOOL ret; memset(&data, 0xfe, sizeof(data)); @@ -1127,6 +1209,11 @@ static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GU ret = pFindActCtxSectionGuid(0, NULL, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION, clsid, &data); + if (!ret) + { + skip("failed for guid %s\n", wine_dbgstr_guid(clsid)); + return; + } ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError()); comclass = (struct comclassredirect_data*)data.lpData; @@ -1137,7 +1224,6 @@ static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GU ok_(__FILE__, line)(comclass->size == sizeof(*comclass), "got %d for header size\n", comclass->size); if (data.lpData && comclass->size == sizeof(*comclass)) { - static const WCHAR progid[] = {'P','r','o','g','I','d','.','P','r','o','g','I','d',0}; WCHAR *ptr; ULONG len; @@ -1145,19 +1231,31 @@ static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GU ok_(__FILE__, line)(comclass->res1[0] == 0, "got res1[0] as %02x\n", comclass->res1[0]); ok_(__FILE__, line)(comclass->res1[1] == 0, "got res1[1] as %02x\n", comclass->res1[1]); ok_(__FILE__, line)(comclass->model == ThreadingModel_Neutral, "got model %d\n", comclass->model); - ok_(__FILE__, line)(IsEqualGUID(&comclass->clsid, clsid), "got wrong clsid %s\n", debugstr_guid(&comclass->clsid)); - ok_(__FILE__, line)(IsEqualGUID(&comclass->clsid2, clsid), "got wrong clsid2 %s\n", debugstr_guid(&comclass->clsid2)); - ok_(__FILE__, line)(IsEqualGUID(&comclass->tlid, tlid), "got wrong tlid %s\n", debugstr_guid(&comclass->tlid)); + ok_(__FILE__, line)(IsEqualGUID(&comclass->clsid, clsid), "got wrong clsid %s\n", wine_dbgstr_guid(&comclass->clsid)); + ok_(__FILE__, line)(IsEqualGUID(&comclass->clsid2, clsid), "got wrong clsid2 %s\n", wine_dbgstr_guid(&comclass->clsid2)); + if (tlid) + ok_(__FILE__, line)(IsEqualGUID(&comclass->tlid, tlid), "got wrong tlid %s\n", wine_dbgstr_guid(&comclass->tlid)); ok_(__FILE__, line)(comclass->name_len > 0, "got modulename len %d\n", comclass->name_len); - ok_(__FILE__, line)(comclass->progid_offset == comclass->size, "got progid offset %d\n", comclass->progid_offset); - ptr = (WCHAR*)((BYTE*)comclass + comclass->size); - ok_(__FILE__, line)(!lstrcmpW(ptr, progid), "got wrong progid %s, expected %s\n", wine_dbgstr_w(ptr), wine_dbgstr_w(progid)); - ok_(__FILE__, line)(lstrlenW(ptr)*sizeof(WCHAR) == comclass->progid_len, - "got progid name length %d, expected %d\n", comclass->progid_len, lstrlenW(ptr)); + if (progid) + { + len = comclass->size + comclass->clrdata_len; + ok_(__FILE__, line)(comclass->progid_offset == len, "got progid offset %d, expected %d\n", comclass->progid_offset, len); + } + else + ok_(__FILE__, line)(comclass->progid_offset == 0, "got progid offset %d, expected 0\n", comclass->progid_offset); + + if (comclass->progid_offset) + { + ptr = (WCHAR*)((BYTE*)comclass + comclass->progid_offset); + ok_(__FILE__, line)(!lstrcmpW(ptr, progid), "got wrong progid %s, expected %s\n", wine_dbgstr_w(ptr), wine_dbgstr_w(progid)); + ok_(__FILE__, line)(lstrlenW(progid)*sizeof(WCHAR) == comclass->progid_len, + "got progid name length %d\n", comclass->progid_len); + } /* data length is simply header length + string data length including nulls */ - len = comclass->size + comclass->progid_len + sizeof(WCHAR); + len = comclass->size + comclass->clrdata_len; + if (comclass->progid_len) len += comclass->progid_len + sizeof(WCHAR); ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len); /* keyed data structure doesn't include module name, it's available from section data */ @@ -1177,12 +1275,47 @@ static void test_find_com_redirection(HANDLE handle, const GUID *clsid, const GU if (comclass->miscmask & MiscStatusDocPrint) ok_(__FILE__, line)(comclass->miscstatusdocprint != 0, "got miscstatusdocprint 0x%08x\n", comclass->miscstatusdocprint); } + + /* part used for clrClass only */ + if (comclass->clrdata_len) + { + static const WCHAR mscoreeW[] = {'M','S','C','O','R','E','E','.','D','L','L',0}; + static const WCHAR mscoree2W[] = {'m','s','c','o','r','e','e','.','d','l','l',0}; + struct clrclass_data *clrclass; + WCHAR *ptrW; + + clrclass = (struct clrclass_data*)((BYTE*)data.lpData + comclass->clrdata_offset); + ok_(__FILE__, line)(clrclass->size == sizeof(*clrclass), "clrclass: got size %d\n", clrclass->size); + ok_(__FILE__, line)(clrclass->res[0] == 0, "clrclass: got res[0]=0x%08x\n", clrclass->res[0]); + ok_(__FILE__, line)(clrclass->res[1] == 2, "clrclass: got res[1]=0x%08x\n", clrclass->res[1]); + ok_(__FILE__, line)(clrclass->module_len == lstrlenW(mscoreeW)*sizeof(WCHAR), "clrclass: got module len %d\n", clrclass->module_len); + ok_(__FILE__, line)(clrclass->module_offset > 0, "clrclass: got module offset %d\n", clrclass->module_offset); + + ok_(__FILE__, line)(clrclass->name_len > 0, "clrclass: got name len %d\n", clrclass->name_len); + ok_(__FILE__, line)(clrclass->name_offset == clrclass->size, "clrclass: got name offset %d\n", clrclass->name_offset); + ok_(__FILE__, line)(clrclass->version_len > 0, "clrclass: got version len %d\n", clrclass->version_len); + ok_(__FILE__, line)(clrclass->version_offset > 0, "clrclass: got version offset %d\n", clrclass->version_offset); + + ok_(__FILE__, line)(clrclass->res2[0] == 0, "clrclass: got res2[0]=0x%08x\n", clrclass->res2[0]); + ok_(__FILE__, line)(clrclass->res2[1] == 0, "clrclass: got res2[1]=0x%08x\n", clrclass->res2[1]); + + /* clrClass uses mscoree.dll as module name, but in two variants - comclass data points to module name + in lower case, clsclass subsection - in upper case */ + ok_(__FILE__, line)(comclass->name_len == lstrlenW(mscoree2W)*sizeof(WCHAR), "clrclass: got com name len %d\n", comclass->name_len); + ok_(__FILE__, line)(comclass->name_offset > 0, "clrclass: got name offset %d\n", clrclass->name_offset); + + ptrW = (WCHAR*)((BYTE*)data.lpSectionBase + comclass->name_offset); + ok_(__FILE__, line)(!lstrcmpW(ptrW, mscoreeW), "clrclass: module name %s\n", wine_dbgstr_w(ptrW)); + + ptrW = (WCHAR*)((BYTE*)data.lpSectionBase + clrclass->module_offset); + ok_(__FILE__, line)(!lstrcmpW(ptrW, mscoree2W), "clrclass: module name2 %s\n", wine_dbgstr_w(ptrW)); + } } -todo_wine { - ok_(__FILE__, line)(data.lpSectionGlobalData != NULL, "data.lpSectionGlobalData == NULL\n"); - ok_(__FILE__, line)(data.ulSectionGlobalDataLength > 0, "data.ulSectionGlobalDataLength=%u\n", + + header = (struct guidsection_header*)data.lpSectionBase; + ok_(__FILE__, line)(data.lpSectionGlobalData == ((BYTE*)header + header->names_offset), "data.lpSectionGlobalData == NULL\n"); + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->names_len, "data.ulSectionGlobalDataLength=%u\n", data.ulSectionGlobalDataLength); -} ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", data.ulSectionTotalLength); @@ -1203,6 +1336,210 @@ todo_wine { ok_(__FILE__, line)(!memcmp(comclass, comclass2, comclass->size), "got wrong data\n"); } +enum ifaceps_mask +{ + NumMethods = 1, + BaseIface = 2 +}; + +struct ifacepsredirect_data +{ + ULONG size; + DWORD mask; + GUID iid; + ULONG nummethods; + GUID tlbid; + GUID base; + ULONG name_len; + ULONG name_offset; +}; + +static void test_find_ifaceps_redirection(HANDLE handle, const GUID *iid, const GUID *tlbid, const GUID *base, + const GUID *ps32, ULONG exid, int line) +{ + struct ifacepsredirect_data *ifaceps; + ACTCTX_SECTION_KEYED_DATA data; + BOOL ret; + + memset(&data, 0xfe, sizeof(data)); + data.cbSize = sizeof(data); + + ret = pFindActCtxSectionGuid(0, NULL, + ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION, + iid, &data); + ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError()); + + ifaceps = (struct ifacepsredirect_data*)data.lpData; + + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); + ok_(__FILE__, line)(ifaceps->size == sizeof(*ifaceps), "got %d for header size\n", ifaceps->size); + if (data.lpData && ifaceps->size == sizeof(*ifaceps)) + { + ULONG len; + + /* for external proxy stubs it contains a value from 'proxyStubClsid32' */ + if (ps32) + { + ok_(__FILE__, line)(IsEqualGUID(&ifaceps->iid, ps32), "got wrong iid %s\n", wine_dbgstr_guid(&ifaceps->iid)); + } + else + ok_(__FILE__, line)(IsEqualGUID(&ifaceps->iid, iid), "got wrong iid %s\n", wine_dbgstr_guid(&ifaceps->iid)); + + ok_(__FILE__, line)(IsEqualGUID(&ifaceps->tlbid, tlbid), "got wrong tlid %s\n", wine_dbgstr_guid(&ifaceps->tlbid)); + ok_(__FILE__, line)(ifaceps->name_len > 0, "got modulename len %d\n", ifaceps->name_len); + ok_(__FILE__, line)(ifaceps->name_offset == ifaceps->size, "got progid offset %d\n", ifaceps->name_offset); + + /* data length is simply header length + string data length including nulls */ + len = ifaceps->size + ifaceps->name_len + sizeof(WCHAR); + ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len); + + /* mask purpose is to indicate if attribute was specified, for testing purposes assume that manifest + always has non-zero value for it */ + if (ifaceps->mask & NumMethods) + ok_(__FILE__, line)(ifaceps->nummethods != 0, "got nummethods %d\n", ifaceps->nummethods); + if (ifaceps->mask & BaseIface) + ok_(__FILE__, line)(IsEqualGUID(&ifaceps->base, base), "got base %s\n", wine_dbgstr_guid(&ifaceps->base)); + } + + ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n"); + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n", + data.ulSectionGlobalDataLength); + ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", + data.ulSectionTotalLength); + ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx); + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + data.ulAssemblyRosterIndex, exid); +} + +struct clrsurrogate_data +{ + ULONG size; + DWORD res; + GUID clsid; + ULONG version_offset; + ULONG version_len; + ULONG name_offset; + ULONG name_len; +}; + +static void test_find_surrogate(HANDLE handle, const GUID *clsid, const WCHAR *name, const WCHAR *version, + ULONG exid, int line) +{ + struct clrsurrogate_data *surrogate; + ACTCTX_SECTION_KEYED_DATA data; + BOOL ret; + + memset(&data, 0xfe, sizeof(data)); + data.cbSize = sizeof(data); + + ret = pFindActCtxSectionGuid(0, NULL, + ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES, + clsid, &data); + if (!ret) + { + skip("surrogate sections are not supported\n"); + return; + } + ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError()); + + surrogate = (struct clrsurrogate_data*)data.lpData; + + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); + ok_(__FILE__, line)(surrogate->size == sizeof(*surrogate), "got %d for header size\n", surrogate->size); + if (data.lpData && surrogate->size == sizeof(*surrogate)) + { + WCHAR *ptrW; + ULONG len; + + ok_(__FILE__, line)(surrogate->res == 0, "invalid res value %d\n", surrogate->res); + ok_(__FILE__, line)(IsEqualGUID(&surrogate->clsid, clsid), "got wrong clsid %s\n", wine_dbgstr_guid(&surrogate->clsid)); + + ok_(__FILE__, line)(surrogate->version_len == lstrlenW(version)*sizeof(WCHAR), "got version len %d\n", surrogate->version_len); + ok_(__FILE__, line)(surrogate->version_offset == surrogate->size, "got version offset %d\n", surrogate->version_offset); + + ok_(__FILE__, line)(surrogate->name_len == lstrlenW(name)*sizeof(WCHAR), "got name len %d\n", surrogate->name_len); + ok_(__FILE__, line)(surrogate->name_offset > surrogate->version_offset, "got name offset %d\n", surrogate->name_offset); + + len = surrogate->size + surrogate->name_len + surrogate->version_len + 2*sizeof(WCHAR); + ok_(__FILE__, line)(data.ulLength == len, "got wrong data length %d, expected %d\n", data.ulLength, len); + + ptrW = (WCHAR*)((BYTE*)surrogate + surrogate->name_offset); + ok(!lstrcmpW(ptrW, name), "got wrong name %s\n", wine_dbgstr_w(ptrW)); + + ptrW = (WCHAR*)((BYTE*)surrogate + surrogate->version_offset); + ok(!lstrcmpW(ptrW, version), "got wrong name %s\n", wine_dbgstr_w(ptrW)); + } + + ok_(__FILE__, line)(data.lpSectionGlobalData == NULL, "data.lpSectionGlobalData != NULL\n"); + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == 0, "data.ulSectionGlobalDataLength=%u\n", + data.ulSectionGlobalDataLength); + ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", + data.ulSectionTotalLength); + ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx); + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + data.ulAssemblyRosterIndex, exid); +} + +static void test_find_progid_redirection(HANDLE handle, const GUID *clsid, const char *progid, ULONG exid, int line) +{ + struct progidredirect_data *progiddata; + struct comclassredirect_data *comclass; + ACTCTX_SECTION_KEYED_DATA data, data2; + struct strsection_header *header; + BOOL ret; + + memset(&data, 0xfe, sizeof(data)); + data.cbSize = sizeof(data); + + ret = pFindActCtxSectionStringA(0, NULL, + ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION, + progid, &data); + ok_(__FILE__, line)(ret, "FindActCtxSectionStringA failed: %u\n", GetLastError()); + + progiddata = (struct progidredirect_data*)data.lpData; + + ok_(__FILE__, line)(data.cbSize == sizeof(data), "data.cbSize=%u\n", data.cbSize); + ok_(__FILE__, line)(data.ulDataFormatVersion == 1, "data.ulDataFormatVersion=%u\n", data.ulDataFormatVersion); + ok_(__FILE__, line)(data.lpData != NULL, "data.lpData == NULL\n"); + ok_(__FILE__, line)(progiddata->size == sizeof(*progiddata), "got %d for header size\n", progiddata->size); + if (data.lpData && progiddata->size == sizeof(*progiddata)) + { + GUID *guid; + + ok_(__FILE__, line)(progiddata->reserved == 0, "got reserved as %d\n", progiddata->reserved); + ok_(__FILE__, line)(progiddata->clsid_offset > 0, "got clsid_offset as %d\n", progiddata->clsid_offset); + + /* progid data points to generated alias guid */ + guid = (GUID*)((BYTE*)data.lpSectionBase + progiddata->clsid_offset); + + memset(&data2, 0, sizeof(data2)); + data2.cbSize = sizeof(data2); + ret = pFindActCtxSectionGuid(0, NULL, + ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION, + guid, &data2); + ok_(__FILE__, line)(ret, "FindActCtxSectionGuid failed: %u\n", GetLastError()); + + comclass = (struct comclassredirect_data*)data2.lpData; + ok_(__FILE__, line)(IsEqualGUID(guid, &comclass->alias), "got wrong alias referenced from progid %s, %s\n", progid, wine_dbgstr_guid(guid)); + ok_(__FILE__, line)(IsEqualGUID(clsid, &comclass->clsid), "got wrong class referenced from progid %s, %s\n", progid, wine_dbgstr_guid(clsid)); + } + + header = (struct strsection_header*)data.lpSectionBase; + ok_(__FILE__, line)(data.lpSectionGlobalData == (BYTE*)header + header->global_offset, "data.lpSectionGlobalData == NULL\n"); + ok_(__FILE__, line)(data.ulSectionGlobalDataLength == header->global_len, "data.ulSectionGlobalDataLength=%u\n", data.ulSectionGlobalDataLength); + ok_(__FILE__, line)(data.lpSectionBase != NULL, "data.lpSectionBase == NULL\n"); + ok_(__FILE__, line)(data.ulSectionTotalLength > 0, "data.ulSectionTotalLength=%u\n", data.ulSectionTotalLength); + ok_(__FILE__, line)(data.hActCtx == NULL, "data.hActCtx=%p\n", data.hActCtx); + ok_(__FILE__, line)(data.ulAssemblyRosterIndex == exid, "data.ulAssemblyRosterIndex=%u, expected %u\n", + data.ulAssemblyRosterIndex, exid); +} + static void test_wndclass_section(void) { static const WCHAR cls1W[] = {'1','.','2','.','3','.','4','!','w','n','d','C','l','a','s','s','1',0}; @@ -1220,6 +1557,8 @@ static void test_wndclass_section(void) create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL); handle = test_create("main_wndcls.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + DeleteFileA("testdep1.manifest"); DeleteFileA("testdep2.manifest"); DeleteFileA("main_wndcls.manifest"); @@ -1282,6 +1621,8 @@ static void test_dllredirect_section(void) create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL); handle = test_create("main_wndcls.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + DeleteFileA("testdep1.manifest"); DeleteFileA("testdep2.manifest"); DeleteFileA("main_wndcls.manifest"); @@ -1335,6 +1676,8 @@ static void test_typelib_section(void) create_manifest_file("main_wndcls.manifest", manifest_wndcls_main, -1, NULL, NULL); handle = test_create("main_wndcls.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + DeleteFileA("testdep1.manifest"); DeleteFileA("testdep2.manifest"); DeleteFileA("main_wndcls.manifest"); @@ -1367,6 +1710,10 @@ static void test_typelib_section(void) ok(data.ulSectionTotalLength == data2.ulSectionTotalLength, "got %u, %u\n", data.ulSectionTotalLength, data2.ulSectionTotalLength); + ok(data.lpSectionGlobalData == ((BYTE*)section + section->names_offset), "data.lpSectionGlobalData == NULL\n"); + ok(data.ulSectionGlobalDataLength == section->names_len, "data.ulSectionGlobalDataLength=%u\n", + data.ulSectionGlobalDataLength); + /* test some actual data */ tlib = (struct tlibredirect_data*)data.lpData; ok(tlib->size == sizeof(*tlib), "got %d\n", tlib->size); @@ -1401,6 +1748,13 @@ static void test_actctx(void) pReleaseActCtx(handle); } + /* test for whitespace handling in Eq ::= S? '=' S? */ + create_manifest_file("test1_1.manifest", manifest1_1, -1, NULL, NULL); + handle = test_create("test1_1.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + DeleteFileA("test1_1.manifest"); + pReleaseActCtx(handle); + if(!create_manifest_file("test1.manifest", manifest1, -1, NULL, NULL)) { skip("Could not create manifest file\n"); return; @@ -1409,6 +1763,7 @@ static void test_actctx(void) trace("manifest1\n"); handle = test_create("test1.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); DeleteFileA("test1.manifest"); if(handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -1434,6 +1789,7 @@ static void test_actctx(void) trace("manifest2 depmanifest1\n"); handle = test_create("test2.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); DeleteFileA("test2.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -1452,6 +1808,7 @@ static void test_actctx(void) trace("manifest2 depmanifest2\n"); handle = test_create("test2-2.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); DeleteFileA("test2-2.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -1480,6 +1837,7 @@ static void test_actctx(void) } handle = test_create("test2-3.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); DeleteFileA("test2-3.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -1510,8 +1868,17 @@ static void test_actctx(void) } handle = test_create("test3.manifest"); + ok(handle != INVALID_HANDLE_VALUE || broken(handle == INVALID_HANDLE_VALUE) /* XP pre-SP2, win2k3 w/o SP */, + "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); + if (handle == INVALID_HANDLE_VALUE) + win_skip("Some activation context features not supported, skipping a test (possibly old XP/Win2k3 system\n"); DeleteFileA("test3.manifest"); if(handle != INVALID_HANDLE_VALUE) { + static const WCHAR nameW[] = {'t','e','s','t','s','u','r','r','o','g','a','t','e',0}; + static const WCHAR versionW[] = {'v','2','.','0','.','5','0','7','2','7',0}; + static const WCHAR progidW[] = {'P','r','o','g','I','d','.','P','r','o','g','I','d',0}; + static const WCHAR clrprogidW[] = {'c','l','r','p','r','o','g','i','d',0}; + test_basic_info(handle, __LINE__); test_detailed_info(handle, &detailed_info1, __LINE__); test_info_in_assembly(handle, 1, &manifest3_info, __LINE__); @@ -1521,11 +1888,31 @@ static void test_actctx(void) ok(b, "ActivateActCtx failed: %u\n", GetLastError()); test_find_dll_redirection(handle, testlib_dll, 1, __LINE__); test_find_dll_redirection(handle, testlib_dll, 1, __LINE__); - test_find_com_redirection(handle, &IID_CoTest, &IID_TlibTest, 1, __LINE__); + test_find_com_redirection(handle, &IID_CoTest, &IID_TlibTest, progidW, 1, __LINE__); + test_find_com_redirection(handle, &IID_CoTest2, NULL, NULL, 1, __LINE__); + test_find_com_redirection(handle, &CLSID_clrclass, &IID_TlibTest, clrprogidW, 1, __LINE__); + test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId", 1, __LINE__); + test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.1", 1, __LINE__); + test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.2", 1, __LINE__); + test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.3", 1, __LINE__); + test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.4", 1, __LINE__); + test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.5", 1, __LINE__); + test_find_progid_redirection(handle, &IID_CoTest, "ProgId.ProgId.6", 1, __LINE__); + test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid", 1, __LINE__); + test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.1", 1, __LINE__); + test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.2", 1, __LINE__); + test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.3", 1, __LINE__); + test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.4", 1, __LINE__); + test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.5", 1, __LINE__); + test_find_progid_redirection(handle, &CLSID_clrclass, "clrprogid.6", 1, __LINE__); + test_find_surrogate(handle, &IID_Iiface, nameW, versionW, 1, __LINE__); + test_find_ifaceps_redirection(handle, &IID_Iifaceps, &IID_TlibTest4, &IID_Ibifaceps, NULL, 1, __LINE__); + test_find_ifaceps_redirection(handle, &IID_Iifaceps2, &IID_TlibTest4, &IID_Ibifaceps, &IID_PS32, 1, __LINE__); + test_find_ifaceps_redirection(handle, &IID_Iifaceps3, &IID_TlibTest4, &IID_Ibifaceps, NULL, 1, __LINE__); test_find_string_fail(); + b = pDeactivateActCtx(0, cookie); ok(b, "DeactivateActCtx failed: %u\n", GetLastError()); - pReleaseActCtx(handle); } @@ -1537,6 +1924,7 @@ static void test_actctx(void) } handle = test_create("test4.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); DeleteFileA("test4.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { @@ -1557,6 +1945,7 @@ static void test_actctx(void) return; } handle = test_create("..\\test1.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); DeleteFileA("..\\test1.manifest"); if(handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -1577,6 +1966,7 @@ static void test_actctx(void) } handle = test_create("test1.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); DeleteFileA("test1.manifest"); if (handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -1592,6 +1982,7 @@ static void test_actctx(void) } handle = test_create("test1.manifest"); + ok(handle != INVALID_HANDLE_VALUE, "handle == INVALID_HANDLE_VALUE, error %u\n", GetLastError()); DeleteFileA("test1.manifest"); if (handle != INVALID_HANDLE_VALUE) { test_basic_info(handle, __LINE__); @@ -1629,7 +2020,7 @@ static void run_child_process(void) char path[MAX_PATH]; char **argv; PROCESS_INFORMATION pi; - STARTUPINFO si = { 0 }; + STARTUPINFOA si = { 0 }; HANDLE file; FILETIME now; BOOL ret; @@ -1653,7 +2044,7 @@ static void run_child_process(void) CloseHandle(file); } sprintf(cmdline, "\"%s\" %s manifest1", argv[0], argv[1]); - ret = CreateProcess(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "Could not create process: %u\n", GetLastError()); winetest_wait_child_process( pi.hProcess ); CloseHandle(pi.hThread); @@ -1686,14 +2077,108 @@ static void init_paths(void) lstrcpyW(app_manifest_path+lstrlenW(app_manifest_path), dot_manifest); } +static void write_manifest(const char *filename, const char *manifest) +{ + HANDLE file; + DWORD size; + CHAR path[MAX_PATH]; + + GetTempPathA(sizeof(path)/sizeof(CHAR), path); + strcat(path, filename); + + file = CreateFileA(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + WriteFile(file, manifest, strlen(manifest), &size, NULL); + CloseHandle(file); +} + +static void delete_manifest_file(const char *filename) +{ + CHAR path[MAX_PATH]; + + GetTempPathA(sizeof(path)/sizeof(CHAR), path); + strcat(path, filename); + DeleteFileA(path); +} + +static void test_CreateActCtx(void) +{ + CHAR path[MAX_PATH], dir[MAX_PATH]; + ACTCTXA actctx; + HANDLE handle; + + GetTempPathA(sizeof(path)/sizeof(CHAR), path); + strcat(path, "main_wndcls.manifest"); + + write_manifest("testdep1.manifest", manifest_wndcls1); + write_manifest("testdep2.manifest", manifest_wndcls2); + write_manifest("main_wndcls.manifest", manifest_wndcls_main); + + memset(&actctx, 0, sizeof(ACTCTXA)); + actctx.cbSize = sizeof(ACTCTXA); + actctx.lpSource = path; + + /* create using lpSource without specified directory */ + handle = pCreateActCtxA(&actctx); + ok(handle != INVALID_HANDLE_VALUE, "failed to generate context, error %u\n", GetLastError()); + pReleaseActCtx(handle); + + /* with specified directory, that doesn't contain dependent assembly */ + GetWindowsDirectoryA(dir, sizeof(dir)/sizeof(CHAR)); + + memset(&actctx, 0, sizeof(ACTCTXA)); + actctx.cbSize = sizeof(ACTCTXA); + actctx.dwFlags = ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID; + actctx.lpAssemblyDirectory = dir; + actctx.lpSource = path; + + SetLastError(0xdeadbeef); + handle = pCreateActCtxA(&actctx); +todo_wine { + ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); + ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX, "got error %d\n", GetLastError()); +} + if (handle != INVALID_HANDLE_VALUE) pReleaseActCtx(handle); + + delete_manifest_file("main_wndcls.manifest"); + delete_manifest_file("testdep1.manifest"); + delete_manifest_file("testdep2.manifest"); + + /* ACTCTX_FLAG_HMODULE_VALID but hModule is not set */ + memset(&actctx, 0, sizeof(ACTCTXA)); + actctx.cbSize = sizeof(ACTCTXA); + actctx.dwFlags = ACTCTX_FLAG_HMODULE_VALID; + SetLastError(0xdeadbeef); + handle = pCreateActCtxA(&actctx); + ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); +todo_wine + ok(GetLastError() == ERROR_SXS_CANT_GEN_ACTCTX || broken(GetLastError() == ERROR_NOT_ENOUGH_MEMORY) /* XP, win2k3 */, + "got error %d\n", GetLastError()); + + /* create from HMODULE - resource doesn't exist, lpSource is set */ + memset(&actctx, 0, sizeof(ACTCTXA)); + actctx.cbSize = sizeof(ACTCTXA); + actctx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID | ACTCTX_FLAG_HMODULE_VALID; + actctx.lpSource = "dummyfile.dll"; + actctx.lpResourceName = MAKEINTRESOURCEA(20); + actctx.hModule = GetModuleHandleA(NULL); + + SetLastError(0xdeadbeef); + handle = pCreateActCtxA(&actctx); + ok(handle == INVALID_HANDLE_VALUE, "got handle %p\n", handle); + ok(GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "got error %d\n", GetLastError()); +} + static BOOL init_funcs(void) { - HMODULE hKernel32 = GetModuleHandle("kernel32"); + HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); #define X(f) if (!(p##f = (void*)GetProcAddress(hKernel32, #f))) return FALSE; X(ActivateActCtx); + X(CreateActCtxA); X(CreateActCtxW); X(DeactivateActCtx); + X(FindActCtxSectionStringA); X(FindActCtxSectionStringW); X(GetCurrentActCtx); X(IsDebuggerPresent); @@ -1725,5 +2210,6 @@ START_TEST(actctx) } test_actctx(); + test_CreateActCtx(); run_child_process(); } diff --git a/rostests/winetests/kernel32/alloc.c b/rostests/winetests/kernel32/alloc.c deleted file mode 100755 index c1b2afc734d..00000000000 --- a/rostests/winetests/kernel32/alloc.c +++ /dev/null @@ -1,399 +0,0 @@ -/* - * Unit test suite for memory allocation functions. - * - * Copyright 2002 Geoffrey Hausheer - * - * 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 - -#include "wine/test.h" -#include "windef.h" -#include "winbase.h" -#include "winerror.h" - - - /* The following functions don't have tests, because either I don't know how - to test them, or they are WinNT only, or require multiple threads. - Since the last two issues shouldn't really stop the tests from being - written, assume for now that it is all due to the first case - HeapCompact - HeapLock - HeapQueryInformation - HeapSetInformation - HeapUnlock - HeapValidate - HeapWalk -*/ -/* In addition, these features aren't being tested - HEAP_NO_SERIALIZE - HEAP_GENERATE_EXCEPTIONS - STATUS_ACCESS_VIOLATION (error code from HeapAlloc) -*/ - -static void test_Heap(void) -{ - SYSTEM_INFO sysInfo; - ULONG memchunk; - HANDLE heap; - LPVOID mem1,mem1a,mem3; - UCHAR *mem2,*mem2a; - UINT error,i; - DWORD dwSize; - -/* Retrieve the page size for this system */ - sysInfo.dwPageSize=0; - GetSystemInfo(&sysInfo); - ok(sysInfo.dwPageSize>0,"GetSystemInfo should return a valid page size\n"); - -/* Create a Heap with a minimum and maximum size */ -/* Note that Windows and Wine seem to behave a bit differently with respect - to memory allocation. In Windows, you can't access all the memory - specified in the heap (due to overhead), so choosing a reasonable maximum - size for the heap was done mostly by trial-and-error on Win2k. It may need - more tweaking for otherWindows variants. -*/ - memchunk=10*sysInfo.dwPageSize; - heap=HeapCreate(0,2*memchunk,5*memchunk); - -/* Check that HeapCreate allocated the right amount of ram */ - mem1=HeapAlloc(heap,0,5*memchunk+1); - ok(mem1==NULL,"HeapCreate allocated more Ram than it should have\n"); - HeapFree(heap,0,mem1); - -/* Check that a normal alloc works */ - mem1=HeapAlloc(heap,0,memchunk); - ok(mem1!=NULL,"HeapAlloc failed\n"); - if(mem1) { - ok(HeapSize(heap,0,mem1)>=memchunk, "HeapAlloc should return a big enough memory block\n"); - } - -/* Check that a 'zeroing' alloc works */ - mem2=HeapAlloc(heap,HEAP_ZERO_MEMORY,memchunk); - ok(mem2!=NULL,"HeapAlloc failed\n"); - if(mem2) { - ok(HeapSize(heap,0,mem2)>=memchunk,"HeapAlloc should return a big enough memory block\n"); - error=0; - for(i=0;i=memchunk+5*sysInfo.dwPageSize,"HeapReAlloc failed\n"); - error=0; - for(i=0;i<5*sysInfo.dwPageSize;i++) { - if(mem2a[memchunk+i]!=0) { - error=1; - } - } - ok(!error,"HeapReAlloc should have zeroed out it's allocated memory\n"); - } - -/* Check that HeapRealloc honours HEAP_REALLOC_IN_PLACE_ONLY */ - error=0; - mem1a=HeapReAlloc(heap,HEAP_REALLOC_IN_PLACE_ONLY,mem1,memchunk+sysInfo.dwPageSize); - if(mem1a!=NULL) { - if(mem1a!=mem1) { - error=1; - } - } - ok(mem1a==NULL || error==0,"HeapReAlloc didn't honour HEAP_REALLOC_IN_PLACE_ONLY\n"); - -/* Check that HeapFree works correctly */ - if(mem1a) { - ok(HeapFree(heap,0,mem1a),"HeapFree failed\n"); - } else { - ok(HeapFree(heap,0,mem1),"HeapFree failed\n"); - } - if(mem2a) { - ok(HeapFree(heap,0,mem2a),"HeapFree failed\n"); - } else { - ok(HeapFree(heap,0,mem2),"HeapFree failed\n"); - } - - /* 0-length buffer */ - mem1 = HeapAlloc(heap, 0, 0); - ok(mem1 != NULL, "Reserved memory\n"); - - dwSize = HeapSize(heap, 0, mem1); - /* should work with 0-length buffer */ - ok(dwSize < 0xFFFFFFFF, "The size of the 0-length buffer\n"); - ok(HeapFree(heap, 0, mem1), "Freed the 0-length buffer\n"); - -/* Check that HeapDestry works */ - ok(HeapDestroy(heap),"HeapDestroy failed\n"); -} - -/* The following functions don't have tests, because either I don't know how - to test them, or they are WinNT only, or require multiple threads. - Since the last two issues shouldn't really stop the tests from being - written, assume for now that it is all due to the first case - GlobalFlags - GlobalMemoryStatus - GlobalMemoryStatusEx -*/ -/* In addition, these features aren't being tested - GMEM_DISCARDABLE - GMEM_NOCOMPACT -*/ -static void test_Global(void) -{ - ULONG memchunk; - HGLOBAL mem1,mem2,mem2a,mem2b; - UCHAR *mem2ptr; - UINT error,i; - memchunk=100000; - - SetLastError(NO_ERROR); -/* Check that a normal alloc works */ - mem1=GlobalAlloc(0,memchunk); - ok(mem1!=NULL,"GlobalAlloc failed\n"); - if(mem1) { - ok(GlobalSize(mem1)>=memchunk, "GlobalAlloc should return a big enough memory block\n"); - } - -/* Check that a 'zeroing' alloc works */ - mem2=GlobalAlloc(GMEM_ZEROINIT,memchunk); - ok(mem2!=NULL,"GlobalAlloc failed: error=%d\n",GetLastError()); - if(mem2) { - ok(GlobalSize(mem2)>=memchunk,"GlobalAlloc should return a big enough memory block\n"); - mem2ptr=GlobalLock(mem2); - ok(mem2ptr==mem2,"GlobalLock should have returned the same memory as was allocated\n"); - if(mem2ptr) { - error=0; - for(i=0;i=2*memchunk,"GlobalReAlloc failed\n"); - mem2ptr=GlobalLock(mem2a); - ok(mem2ptr!=NULL,"GlobalLock Failed\n"); - if(mem2ptr) { - error=0; - for(i=0;i=memchunk, "LocalAlloc should return a big enough memory block\n"); - } - -/* Check that a 'zeroing' and lock alloc works */ - mem2=LocalAlloc(LMEM_ZEROINIT|LMEM_MOVEABLE,memchunk); - ok(mem2!=NULL,"LocalAlloc failed: error=%d\n",GetLastError()); - if(mem2) { - ok(LocalSize(mem2)>=memchunk,"LocalAlloc should return a big enough memory block\n"); - mem2ptr=LocalLock(mem2); - ok(mem2ptr!=NULL,"LocalLock: error=%d\n",GetLastError()); - if(mem2ptr) { - error=0; - for(i=0;i=2*memchunk,"LocalReAlloc failed\n"); - mem2ptr=LocalLock(mem2a); - ok(mem2ptr!=NULL,"LocalLock Failed\n"); - if(mem2ptr) { - error=0; - for(i=0;i0,"GetSystemInfo should return a valid page size\n"); - -/* Choose a reasonable allocation size */ - memchunk=10*sysInfo.dwPageSize; - -/* Check that a normal alloc works */ - mem1=VirtualAlloc(NULL,memchunk,MEM_COMMIT,PAGE_READWRITE); - ok(mem1!=NULL,"VirtualAlloc failed\n"); - if(mem1) { -/* check that memory is initialized to 0 */ - error=0; - for(i=0;i +#include "ntstatus.h" +#define WIN32_NO_STATUS #include "wine/test.h" +#include "winternl.h" #include "winbase.h" #include "winnls.h" @@ -48,6 +51,16 @@ static BOOL loopback_dtr_dsr = LOOPBACK_DTR_DSR; static BOOL loopback_dtr_ring = LOOPBACK_DTR_RING; static BOOL loopback_dtr_dcd = LOOPBACK_DTR_DCD; +static NTSTATUS (WINAPI *pNtReadFile)(HANDLE hFile, HANDLE hEvent, + PIO_APC_ROUTINE apc, void* apc_user, + PIO_STATUS_BLOCK io_status, void* buffer, ULONG length, + PLARGE_INTEGER offset, PULONG key); +static NTSTATUS (WINAPI *pNtWriteFile)(HANDLE hFile, HANDLE hEvent, + PIO_APC_ROUTINE apc, void* apc_user, + PIO_STATUS_BLOCK io_status, + const void* buffer, ULONG length, + PLARGE_INTEGER offset, PULONG key); + typedef struct { char string[100]; @@ -633,7 +646,7 @@ static void test_BuildCommDCB(void) COMMCONFIG commconfig; DWORD size = sizeof(COMMCONFIG); - if(GetDefaultCommConfig(port_name, &commconfig, &size)) + if(GetDefaultCommConfigA(port_name, &commconfig, &size)) { port = port_name[3]; break; @@ -684,7 +697,7 @@ static HANDLE test_OpenComm(BOOL doOverlap) /* Try to find a port */ for(port_name[3] = '1'; port_name[3] <= '9'; port_name[3]++) { - hcom = CreateFile( port_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, + hcom = CreateFileA( port_name, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, (doOverlap)?FILE_FLAG_OVERLAPPED:0, NULL ); if (hcom != INVALID_HANDLE_VALUE) break; @@ -780,10 +793,11 @@ static void test_waittxempty(void) DCB dcb; COMMTIMEOUTS timeouts; char tbuf[]="test_waittxempty"; - DWORD before, after, bytes, timediff, evtmask; + DWORD before, after, bytes, timediff, evtmask, errors, i; BOOL res; DWORD baud = SLOWBAUD; - OVERLAPPED ovl_write, ovl_wait; + OVERLAPPED ovl_write, ovl_wait, ovl_wait2; + COMSTAT stat; hcom = test_OpenComm(TRUE); if (hcom == INVALID_HANDLE_VALUE) return; @@ -816,57 +830,62 @@ static void test_waittxempty(void) SetLastError(0xdeadbeef); res = WriteFile(hcom, tbuf, sizeof(tbuf), &bytes, NULL); -todo_wine ok(!res, "WriteFile on an overlapped handle without ovl structure should fail\n"); -todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); S(U(ovl_write)).Offset = 0; S(U(ovl_write)).OffsetHigh = 0; - ovl_write.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + ovl_write.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); before = GetTickCount(); SetLastError(0xdeadbeef); res = WriteFile(hcom, tbuf, sizeof(tbuf), &bytes, &ovl_write); after = GetTickCount(); -todo_wine - ok(!res && GetLastError() == ERROR_IO_PENDING, "WriteFile returned %d, error %d\n", res, GetLastError()); -todo_wine - ok(!bytes, "expected 0, got %u\n", bytes); + ok((!res && GetLastError() == ERROR_IO_PENDING) || (res && bytes == sizeof(tbuf)), + "WriteFile returned %d, written %u bytes, error %d\n", res, bytes, GetLastError()); + if (!res) ok(!bytes, "expected 0, got %u\n", bytes); ok(after - before < 30, "WriteFile took %d ms to write %d Bytes at %d Baud\n", after - before, bytes, baud); /* don't wait for WriteFile completion */ S(U(ovl_wait)).Offset = 0; S(U(ovl_wait)).OffsetHigh = 0; - ovl_wait.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + ovl_wait.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); evtmask = 0; before = GetTickCount(); SetLastError(0xdeadbeef); res = WaitCommEvent(hcom, &evtmask, &ovl_wait); ok(!res && GetLastError() == ERROR_IO_PENDING, "WaitCommEvent error %d\n", GetLastError()); - res = WaitForSingleObject(ovl_wait.hEvent, TIMEOUT); -todo_wine + after = GetTickCount(); + ok(after - before < 30, "WaitCommEvent should have returned immediately, took %d ms\n", after - before); + res = WaitForSingleObject(ovl_wait.hEvent, 1500); ok(res == WAIT_OBJECT_0, "WaitCommEvent failed with a timeout\n"); if (res == WAIT_OBJECT_0) { res = GetOverlappedResult(hcom, &ovl_wait, &bytes, FALSE); ok(res, "GetOverlappedResult reported error %d\n", GetLastError()); -todo_wine ok(bytes == sizeof(evtmask), "expected %u, written %u\n", (UINT)sizeof(evtmask), bytes); res = TRUE; } - else res = FALSE; + else + { + /* unblock pending wait */ + trace("recovering after WAIT_TIMEOUT...\n"); + res = SetCommMask(hcom, EV_TXEMPTY); + ok(res, "SetCommMask error %d\n", GetLastError()); + + res = WaitForSingleObject(ovl_wait.hEvent, TIMEOUT); + ok(res == WAIT_OBJECT_0, "WaitCommEvent failed with a timeout\n"); + + res = FALSE; + } after = GetTickCount(); -todo_wine ok(res, "WaitCommEvent error %d\n", GetLastError()); -todo_wine ok(evtmask & EV_TXEMPTY, "WaitCommEvent: expected EV_TXEMPTY, got %#x\n", evtmask); CloseHandle(ovl_wait.hEvent); timediff = after - before; - trace("WaitCommEvent for EV_TXEMPTY took %d ms (timeout %d)\n", timediff, TIMEOUT); -todo_wine - ok(timediff < 900, "WaitCommEvent used %d ms for waiting\n", timediff); + trace("WaitCommEvent for EV_TXEMPTY took %d ms (timeout 1500)\n", timediff); + ok(timediff < 1200, "WaitCommEvent used %d ms for waiting\n", timediff); res = WaitForSingleObject(ovl_write.hEvent, 0); ok(res == WAIT_OBJECT_0, "WriteFile failed with a timeout\n"); @@ -876,6 +895,92 @@ todo_wine CloseHandle(ovl_write.hEvent); CloseHandle(hcom); + + for (i = 0; i < 2; i++) + { + hcom = test_OpenComm(TRUE); + if (hcom == INVALID_HANDLE_VALUE) return; + + res = SetCommMask(hcom, EV_TXEMPTY); + ok(res, "SetCommMask error %d\n", GetLastError()); + + if (i == 0) + { + S(U(ovl_write)).Offset = 0; + S(U(ovl_write)).OffsetHigh = 0; + ovl_write.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); + before = GetTickCount(); + SetLastError(0xdeadbeef); + res = WriteFile(hcom, tbuf, sizeof(tbuf), &bytes, &ovl_write); + ok((!res && GetLastError() == ERROR_IO_PENDING) || (res && bytes == sizeof(tbuf)), + "WriteFile returned %d, written %u bytes, error %d\n", res, bytes, GetLastError()); + if (!res) ok(!bytes, "expected 0, got %u\n", bytes); + + ClearCommError(hcom, &errors, &stat); + ok(stat.cbInQue == 0, "InQueue should be empty, got %d bytes\n", stat.cbInQue); + ok(stat.cbOutQue != 0 || broken(stat.cbOutQue == 0) /* VM */, "OutQueue should not be empty\n"); + ok(errors == 0, "ClearCommErrors: Unexpected error 0x%08x\n", errors); + + res = GetOverlappedResult(hcom, &ovl_write, &bytes, TRUE); + ok(res, "GetOverlappedResult reported error %d\n", GetLastError()); + ok(bytes == sizeof(tbuf), "expected %u, written %u\n", (UINT)sizeof(tbuf), bytes); + CloseHandle(ovl_write.hEvent); + + res = FlushFileBuffers(hcom); + ok(res, "FlushFileBuffers error %d\n", GetLastError()); + } + + ClearCommError(hcom, &errors, &stat); + ok(stat.cbInQue == 0, "InQueue should be empty, got %d bytes\n", stat.cbInQue); + ok(stat.cbOutQue == 0, "OutQueue should be empty, got %d bytes\n", stat.cbOutQue); + ok(errors == 0, "ClearCommErrors: Unexpected error 0x%08x\n", errors); + + S(U(ovl_wait)).Offset = 0; + S(U(ovl_wait)).OffsetHigh = 0; + ovl_wait.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); + evtmask = 0; + SetLastError(0xdeadbeef); + res = WaitCommEvent(hcom, &evtmask, &ovl_wait); + ok((!res && GetLastError() == ERROR_IO_PENDING) || res /* busy system */, "%d: WaitCommEvent error %d\n", i, GetLastError()); + + res = WaitForSingleObject(ovl_wait.hEvent, TIMEOUT); + if (i == 0) + ok(res == WAIT_OBJECT_0, "WaitCommEvent failed with a timeout\n"); + else + ok(res == WAIT_TIMEOUT, "WaitCommEvent should fail with a timeout\n"); + if (res == WAIT_OBJECT_0) + { + res = GetOverlappedResult(hcom, &ovl_wait, &bytes, FALSE); + ok(res, "GetOverlappedResult reported error %d\n", GetLastError()); + ok(bytes == sizeof(evtmask), "expected %u, written %u\n", (UINT)sizeof(evtmask), bytes); + ok(res, "WaitCommEvent error %d\n", GetLastError()); + ok(evtmask & EV_TXEMPTY, "WaitCommEvent: expected EV_TXEMPTY, got %#x\n", evtmask); + } + else + { + ok(!evtmask, "WaitCommEvent: expected 0, got %#x\n", evtmask); + + S(U(ovl_wait2)).Offset = 0; + S(U(ovl_wait2)).OffsetHigh = 0; + ovl_wait2.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); + SetLastError(0xdeadbeef); + res = WaitCommEvent(hcom, &evtmask, &ovl_wait2); + ok(!res, "WaitCommEvent should fail if there is a pending wait\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + CloseHandle(ovl_wait2.hEvent); + + /* unblock pending wait */ + trace("recovering after WAIT_TIMEOUT...\n"); + res = SetCommMask(hcom, EV_TXEMPTY); + ok(res, "SetCommMask error %d\n", GetLastError()); + + res = WaitForSingleObject(ovl_wait.hEvent, TIMEOUT); + ok(res == WAIT_OBJECT_0, "WaitCommEvent failed with a timeout\n"); + CloseHandle(ovl_wait.hEvent); + } + + CloseHandle(hcom); + } } /* A new open handle should not return error or have bytes in the Queues */ @@ -964,7 +1069,7 @@ static void test_LoopbackRead(void) ok(read == sizeof(tbuf),"ReadFile read %d bytes, expected \"%s\"\n", read,rbuf); /* Now do the same with a slower Baud rate. - As we request more characters then written, we will hit the timeout + As we request more characters than written, we will hit the timeout */ ok(GetCommState(hcom, &dcb), "GetCommState failed\n"); @@ -1036,7 +1141,7 @@ static void test_LoopbackCtsRts(void) if (dcb.fRtsControl == RTS_CONTROL_HANDSHAKE) { trace("RTS_CONTROL_HANDSHAKE is set, so don't manipulate RTS\n"); - CloseHandle(hcom); + CloseHandle(hcom); return; } ok(GetCommModemStatus(hcom, &defaultStat), "GetCommModemStatus failed\n"); @@ -1180,6 +1285,7 @@ static void test_LoopbackDtrRing(void) if (dcb.fDtrControl == DTR_CONTROL_HANDSHAKE) { trace("DTR_CONTROL_HANDSHAKE is set, so don't manipulate DTR\n"); + CloseHandle(hcom); return; } ok(GetCommModemStatus(hcom, &defaultStat), "GetCommModemStatus failed\n"); @@ -1232,12 +1338,12 @@ static void test_WaitRx(void) if (hcom == INVALID_HANDLE_VALUE) return; ok(SetCommMask(hcom, EV_RXCHAR), "SetCommMask failed\n"); - hComPortEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); ok(hComPortEvent != 0, "CreateEvent failed\n"); ZeroMemory( &overlapped, sizeof(overlapped)); overlapped.hEvent = hComPortEvent; - hComWriteEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + hComWriteEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); ok(hComWriteEvent != NULL, "CreateEvent res %d\n", GetLastError()); ZeroMemory( &overlapped_w, sizeof(overlapped_w)); overlapped_w.hEvent = hComWriteEvent; @@ -1352,7 +1458,7 @@ static void test_WaitCts(void) trace("test_WaitCts timeout %ld clt 0x%08lx handle %p\n",args[0], args[1], hcom); ok(SetCommMask(hcom, EV_CTS), "SetCommMask failed\n"); - hComPortEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); ok(hComPortEvent != 0, "CreateEvent failed\n"); args[3] = (DWORD_PTR)hComPortEvent; alarmThread = CreateThread(NULL, 0, toggle_ctlLine, args, 0, &alarmThreadId); @@ -1446,7 +1552,7 @@ static void test_AbortWaitCts(void) trace("test_AbortWaitCts timeout %ld handle %p\n",args[0], hcom); ok(SetCommMask(hcom, EV_CTS), "SetCommMask failed\n"); - hComPortEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); ok(hComPortEvent != 0, "CreateEvent failed\n"); alarmThread = CreateThread(NULL, 0, reset_CommMask, args, 0, &alarmThreadId); /* Wait a minimum to let the thread start up */ @@ -1518,7 +1624,7 @@ static void test_WaitDsr(void) trace("test_WaitDsr timeout %ld clt 0x%08lx handle %p\n",args[0], args[1], hcom); ok(SetCommMask(hcom, EV_DSR), "SetCommMask failed\n"); - hComPortEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); ok(hComPortEvent != 0, "CreateEvent failed\n"); alarmThread = CreateThread(NULL, 0, toggle_ctlLine, args, 0, &alarmThreadId); ok(alarmThread !=0 , "CreateThread Failed\n"); @@ -1592,6 +1698,7 @@ static void test_WaitRing(void) ok((ret = GetCommModemStatus(hcom, &defaultStat)), "GetCommModemStatus failed\n"); if (!ret) { skip("modem status failed -> skip.\n"); + CloseHandle(hcom); return; } if(defaultStat & MS_RING_ON) @@ -1603,7 +1710,7 @@ static void test_WaitRing(void) trace("test_WaitRing timeout %ld clt 0x%08lx handle %p\n",args[0], args[1], hcom); ok(SetCommMask(hcom, EV_RING), "SetCommMask failed\n"); - hComPortEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); ok(hComPortEvent != 0, "CreateEvent failed\n"); alarmThread = CreateThread(NULL, 0, toggle_ctlLine, args, 0, &alarmThreadId); ok(alarmThread !=0 , "CreateThread Failed\n"); @@ -1668,7 +1775,7 @@ static void test_WaitDcd(void) if (dcb.fDtrControl == DTR_CONTROL_DISABLE) { trace("DTR_CONTROL_HANDSHAKE is set, so don't manipulate DTR\n"); - CloseHandle(hcom); + CloseHandle(hcom); return; } args[0]= TIMEOUT >>1; @@ -1682,7 +1789,7 @@ static void test_WaitDcd(void) trace("test_WaitDcd timeout %ld clt 0x%08lx handle %p\n",args[0], args[1], hcom); ok(SetCommMask(hcom, EV_RLSD), "SetCommMask failed\n"); - hComPortEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); ok(hComPortEvent != 0, "CreateEvent failed\n"); alarmThread = CreateThread(NULL, 0, toggle_ctlLine, args, 0, &alarmThreadId); ok(alarmThread !=0 , "CreateThread Failed\n"); @@ -1761,7 +1868,7 @@ static void test_WaitBreak(void) if (hcom == INVALID_HANDLE_VALUE) return; ok(SetCommMask(hcom, EV_BREAK), "SetCommMask failed\n"); - hComPortEvent = CreateEvent( NULL, TRUE, FALSE, NULL ); + hComPortEvent = CreateEventW( NULL, TRUE, FALSE, NULL ); ok(hComPortEvent != 0, "CreateEvent failed\n"); trace("test_WaitBreak\n"); @@ -1834,7 +1941,7 @@ static void test_WaitCommEvent(void) S(U(ovl_wait)).Offset = 0; S(U(ovl_wait)).OffsetHigh = 0; - ovl_wait.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + ovl_wait.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); trace("waiting 10 secs for com port events (turn on/off the device)...\n"); last_event_time = 0; @@ -1897,8 +2004,200 @@ static void test_FlushFileBuffers(void) CloseHandle(hcom); } +static void test_read_write(void) +{ + static const char atz[]="ATZ\r\n"; + char buf[256]; + HANDLE hcom; + DCB dcb; + COMMTIMEOUTS timeouts; + DWORD ret, bytes, status, evtmask, before, after, last_event_time; + OVERLAPPED ovl_wait; + IO_STATUS_BLOCK iob; + LARGE_INTEGER offset; + LONG i; + + if (!pNtReadFile || !pNtWriteFile) + { + win_skip("not running on NT, skipping test\n"); + return; + } + + hcom = test_OpenComm(TRUE); + if (hcom == INVALID_HANDLE_VALUE) return; + + ret = GetCommState(hcom, &dcb); + ok(ret, "GetCommState error %d\n", GetLastError()); + dcb.BaudRate = 9600; + dcb.ByteSize = 8; + dcb.Parity = NOPARITY; + dcb.fRtsControl = RTS_CONTROL_ENABLE; + dcb.fDtrControl = DTR_CONTROL_ENABLE; + dcb.StopBits = ONESTOPBIT; + ret = SetCommState(hcom, &dcb); + ok(ret, "SetCommState error %d\n", GetLastError()); + + memset(&timeouts, 0, sizeof(timeouts)); + timeouts.ReadTotalTimeoutConstant = TIMEOUT; + ret = SetCommTimeouts(hcom, &timeouts); + ok(ret,"SetCommTimeouts error %d\n", GetLastError()); + + ret = SetupComm(hcom, 1024, 1024); + ok(ret, "SetUpComm error %d\n", GetLastError()); + + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = WriteFile(hcom, atz, 0, &bytes, NULL); + ok(!ret, "WriteFile should fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + + U(iob).Status = -1; + iob.Information = -1; + status = pNtWriteFile(hcom, 0, NULL, NULL, &iob, atz, 0, NULL, NULL); + ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#x\n", status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); + ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); + + for (i = -20; i < 20; i++) + { + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = (LONGLONG)i; + status = pNtWriteFile(hcom, 0, NULL, NULL, &iob, atz, 0, &offset, NULL); + if (i >= 0 || i == -1) + { + ok(status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, status); + ok(U(iob).Status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, U(iob).Status); + ok(iob.Information == 0, "%d: expected 0, got %lu\n", i, iob.Information); + } + else + { + ok(status == STATUS_INVALID_PARAMETER, "%d: expected STATUS_INVALID_PARAMETER, got %#x\n", i, status); + ok(U(iob).Status == -1, "%d: expected -1, got %#x\n", i, U(iob).Status); + ok(iob.Information == -1, "%d: expected -1, got %ld\n", i, iob.Information); + } + } + + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = 0; + status = pNtWriteFile(hcom, 0, NULL, NULL, &iob, atz, sizeof(atz), &offset, NULL); + ok(status == STATUS_PENDING || status == STATUS_SUCCESS, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status); + /* Under Windows checking IO_STATUS_BLOCK right after the call leads + * to races, iob.Status is either -1 or STATUS_SUCCESS, which means + * that it's set only when the operation completes. + */ + ret = WaitForSingleObject(hcom, TIMEOUT); + if (ret == WAIT_TIMEOUT) + { + skip("Probably modem is not connected.\n"); + CloseHandle(hcom); + return; + } + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); + ok(iob.Information == sizeof(atz), "expected sizeof(atz), got %lu\n", iob.Information); + + ret = SetCommMask(hcom, EV_RXCHAR); + ok(ret, "SetCommMask error %d\n", GetLastError()); + + S(U(ovl_wait)).Offset = 0; + S(U(ovl_wait)).OffsetHigh = 0; + ovl_wait.hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); + + trace("waiting 3 secs for modem response...\n"); + last_event_time = 0; + before = GetTickCount(); + do + { + evtmask = 0; + SetLastError(0xdeadbeef); + ret = WaitCommEvent(hcom, &evtmask, &ovl_wait); + ok(!ret && GetLastError() == ERROR_IO_PENDING, "WaitCommEvent returned %d, error %d\n", ret, GetLastError()); + if (GetLastError() != ERROR_IO_PENDING) goto done; /* no point in further testing */ + for (;;) + { + ret = WaitForSingleObject(ovl_wait.hEvent, 100); + after = GetTickCount(); + if (ret == WAIT_OBJECT_0) + { + trace("got modem response.\n"); + + last_event_time = after; + ret = GetOverlappedResult(hcom, &ovl_wait, &bytes, FALSE); + ok(ret, "GetOverlappedResult reported error %d\n", GetLastError()); + ok(bytes == sizeof(evtmask), "expected sizeof(evtmask), got %u\n", bytes); + ok(evtmask & EV_RXCHAR, "EV_RXCHAR should be set\n"); + + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadFile(hcom, buf, 0, &bytes, NULL); + ok(!ret, "ReadFile should fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + + U(iob).Status = -1; + iob.Information = -1; + status = pNtReadFile(hcom, 0, NULL, NULL, &iob, buf, 0, NULL, NULL); + ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#x\n", status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); + ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); + + for (i = -20; i < 20; i++) + { + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = (LONGLONG)i; + status = pNtReadFile(hcom, 0, NULL, NULL, &iob, buf, 0, &offset, NULL); + /* FIXME: Remove once Wine is fixed */ + if (status == STATUS_PENDING) WaitForSingleObject(hcom, TIMEOUT); + if (i >= 0) + { +todo_wine + ok(status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, status); +todo_wine + ok(U(iob).Status == STATUS_SUCCESS, "%d: expected STATUS_SUCCESS, got %#x\n", i, U(iob).Status); + ok(iob.Information == 0, "%d: expected 0, got %lu\n", i, iob.Information); + } + else + { + ok(status == STATUS_INVALID_PARAMETER, "%d: expected STATUS_INVALID_PARAMETER, got %#x\n", i, status); + ok(U(iob).Status == -1, "%d: expected -1, got %#x\n", i, U(iob).Status); + ok(iob.Information == -1, "%d: expected -1, got %ld\n", i, iob.Information); + } + } + + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = 0; + status = pNtReadFile(hcom, 0, NULL, NULL, &iob, buf, 1, &offset, NULL); + ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); + ok(iob.Information == 1, "expected 1, got %lu\n", iob.Information); + goto done; + } + else + { + if (last_event_time || after - before >= 3000) goto done; + } + } + } while (after - before < 3000); + +done: + CloseHandle(ovl_wait.hEvent); + CloseHandle(hcom); +} + START_TEST(comm) { + HMODULE ntdll = GetModuleHandleA("ntdll.dll"); + if (ntdll) + { + pNtReadFile = (void *)GetProcAddress(ntdll, "NtReadFile"); + pNtWriteFile = (void *)GetProcAddress(ntdll, "NtWriteFile"); + } + test_ClearCommError(); /* keep it the very first test */ test_FlushFileBuffers(); test_BuildCommDCB(); @@ -1918,6 +2217,7 @@ START_TEST(comm) test_WaitDcd(); test_WaitBreak(); test_stdio(); + test_read_write(); if (!winetest_interactive) { diff --git a/rostests/winetests/kernel32/console.c b/rostests/winetests/kernel32/console.c index df752f457b7..5928e8c7ea7 100755 --- a/rostests/winetests/kernel32/console.c +++ b/rostests/winetests/kernel32/console.c @@ -50,7 +50,7 @@ static BOOL (WINAPI *pVerifyConsoleIoHandle)(HANDLE handle); #define okCHAR(hCon, c, ch, attr) do { \ char __ch; WORD __attr; DWORD __len; BOOL expect; \ - expect = ReadConsoleOutputCharacter((hCon), &__ch, 1, (c), &__len) == 1 && __len == 1 && __ch == (ch); \ + expect = ReadConsoleOutputCharacterA((hCon), &__ch, 1, (c), &__len) == 1 && __len == 1 && __ch == (ch); \ ok(expect, "At (%d,%d): expecting char '%c'/%02x got '%c'/%02x\n", (c).X, (c).Y, (ch), (ch), __ch, __ch); \ expect = ReadConsoleOutputAttribute((hCon), &__attr, 1, (c), &__len) == 1 && __len == 1 && __attr == (attr); \ ok(expect, "At (%d,%d): expecting attr %04x got %04x\n", (c).X, (c).Y, (attr), __attr); \ @@ -179,7 +179,7 @@ static void testEmptyWrite(HANDLE hCon) ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left\n"); len = -1; - ok(WriteConsole(hCon, NULL, 0, &len, NULL) != 0 && len == 0, "WriteConsole\n"); + ok(WriteConsoleA(hCon, NULL, 0, &len, NULL) != 0 && len == 0, "WriteConsole\n"); okCURSOR(hCon, c); /* Passing a NULL lpBuffer with sufficiently large non-zero length succeeds @@ -188,22 +188,22 @@ static void testEmptyWrite(HANDLE hCon) if (0) { len = -1; - ok(!WriteConsole(hCon, NULL, 16, &len, NULL) && len == -1, "WriteConsole\n"); + ok(!WriteConsoleA(hCon, NULL, 16, &len, NULL) && len == -1, "WriteConsole\n"); okCURSOR(hCon, c); /* Cursor advances for this call. */ len = -1; - ok(WriteConsole(hCon, NULL, 128, &len, NULL) != 0 && len == 128, "WriteConsole\n"); + ok(WriteConsoleA(hCon, NULL, 128, &len, NULL) != 0 && len == 128, "WriteConsole\n"); } len = -1; - ok(WriteConsole(hCon, emptybuf, 0, &len, NULL) != 0 && len == 0, "WriteConsole\n"); + ok(WriteConsoleA(hCon, emptybuf, 0, &len, NULL) != 0 && len == 0, "WriteConsole\n"); okCURSOR(hCon, c); /* WriteConsole does not halt on a null terminator and is happy to write * memory contents beyond the actual size of the buffer. */ len = -1; - ok(WriteConsole(hCon, emptybuf, 16, &len, NULL) != 0 && len == 16, "WriteConsole\n"); + ok(WriteConsoleA(hCon, emptybuf, 16, &len, NULL) != 0 && len == 16, "WriteConsole\n"); c.X += 16; okCURSOR(hCon, c); } @@ -219,7 +219,7 @@ static void testWriteSimple(HANDLE hCon) c.X = c.Y = 0; ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left\n"); - ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); + ok(WriteConsoleA(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); c.Y = 0; for (c.X = 0; c.X < mylen; c.X++) { @@ -246,7 +246,7 @@ static void testWriteNotWrappedNotProcessed(HANDLE hCon, COORD sbSize) c.X = sbSize.X - 3; c.Y = 0; ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-3\n"); - ret = WriteConsole(hCon, mytest, mylen, &len, NULL); + ret = WriteConsoleA(hCon, mytest, mylen, &len, NULL); ok(ret != 0 && len == mylen, "Couldn't write, ret = %d, len = %d\n", ret, len); c.Y = 0; for (p = mylen - 3; p < mylen; p++) @@ -265,7 +265,7 @@ static void testWriteNotWrappedNotProcessed(HANDLE hCon, COORD sbSize) c.X = sbSize.X - mylen; c.Y = 0; ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-3\n"); - ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); + ok(WriteConsoleA(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); } static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize) @@ -285,7 +285,7 @@ static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize) c.X = sbSize.X - 5; c.Y = 0; ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-5\n"); - ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); + ok(WriteConsoleA(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); c.Y = 0; for (c.X = sbSize.X - 5; c.X < sbSize.X - 1; c.X++) { @@ -316,7 +316,7 @@ static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize) c.X = sbSize.X - 4; c.Y = 0; ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-4\n"); - ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); + ok(WriteConsoleA(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); c.Y = 0; for (c.X = sbSize.X - 4; c.X < sbSize.X; c.X++) { @@ -336,7 +336,7 @@ static void testWriteNotWrappedProcessed(HANDLE hCon, COORD sbSize) c.X = sbSize.X - 3; c.Y = 0; ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-4\n"); - ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); + ok(WriteConsoleA(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); c.Y = 0; for (p = mylen2 - 3; p < mylen2; p++) { @@ -369,7 +369,7 @@ static void testWriteWrappedNotProcessed(HANDLE hCon, COORD sbSize) c.X = sbSize.X - 9; c.Y = 0; ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-9\n"); - ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); + ok(WriteConsoleA(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); c.Y = 0; for (p = 0; p < mylen; p++) { @@ -406,7 +406,7 @@ static void testWriteWrappedProcessed(HANDLE hCon, COORD sbSize) c.X = sbSize.X - 9; c.Y = 0; ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-9\n"); - ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); + ok(WriteConsoleA(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); for (p = 0; p < 4; p++) { c.X = sbSize.X - 9 + p; @@ -431,7 +431,7 @@ static void testWriteWrappedProcessed(HANDLE hCon, COORD sbSize) c.X = sbSize.X - 3; c.Y = 2; ok(SetConsoleCursorPosition(hCon, c) != 0, "Cursor in upper-left-3\n"); - ok(WriteConsole(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); + ok(WriteConsoleA(hCon, mytest, mylen, &len, NULL) != 0 && len == mylen, "WriteConsole\n"); for (p = 0; p < 3; p++) { c.X = sbSize.X - 3 + p; @@ -458,7 +458,7 @@ static void testWriteWrappedProcessed(HANDLE hCon, COORD sbSize) static void testWrite(HANDLE hCon, COORD sbSize) { - /* FIXME: should in fact insure that the sb is at least 10 character wide */ + /* FIXME: should in fact ensure that the sb is at least 10 characters wide */ ok(SetConsoleTextAttribute(hCon, TEST_ATTRIB), "Setting default text color\n"); resetContent(hCon, sbSize, FALSE); testEmptyWrite(hCon); @@ -504,7 +504,7 @@ static void testScroll(HANDLE hCon, COORD sbSize) clip.Top = 0; clip.Bottom = sbSize.Y - 1; - ok(ScrollConsoleScreenBuffer(hCon, &scroll, NULL, dst, &ci), "Scrolling SB\n"); + ok(ScrollConsoleScreenBufferA(hCon, &scroll, NULL, dst, &ci), "Scrolling SB\n"); for (c.Y = 0; c.Y < sbSize.Y; c.Y++) { @@ -539,7 +539,7 @@ static void testScroll(HANDLE hCon, COORD sbSize) clip.Top = 0; clip.Bottom = sbSize.Y - 1; - ok(ScrollConsoleScreenBuffer(hCon, &scroll, NULL, dst, &ci), "Scrolling SB\n"); + ok(ScrollConsoleScreenBufferA(hCon, &scroll, NULL, dst, &ci), "Scrolling SB\n"); for (c.Y = 0; c.Y < sbSize.Y; c.Y++) { @@ -574,7 +574,7 @@ static void testScroll(HANDLE hCon, COORD sbSize) clip.Bottom = min(H + H / 2, sbSize.Y - 1); SetLastError(0xdeadbeef); - ret = ScrollConsoleScreenBuffer(hCon, &scroll, &clip, dst, &ci); + ret = ScrollConsoleScreenBufferA(hCon, &scroll, &clip, dst, &ci); if (ret) { for (c.Y = 0; c.Y < sbSize.Y; c.Y++) @@ -617,7 +617,7 @@ static void testScroll(HANDLE hCon, COORD sbSize) clip.Top = H / 2; clip.Bottom = min(H + H / 2, sbSize.Y - 1); - ok(ScrollConsoleScreenBuffer(hCon, &scroll, &clip, dst, &ci), "Scrolling SB\n"); + ok(ScrollConsoleScreenBufferA(hCon, &scroll, &clip, dst, &ci), "Scrolling SB\n"); for (c.Y = 0; c.Y < sbSize.Y; c.Y++) { @@ -654,8 +654,8 @@ static void testCtrlHandler(void) ok(!SetConsoleCtrlHandler(mch, FALSE), "Shouldn't succeed\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Bad error %u\n", GetLastError()); ok(SetConsoleCtrlHandler(mch, TRUE), "Couldn't set handler\n"); - /* wine requires the event for the test, as we cannot insure, so far, that event - * are processed synchronously in GenerateConsoleCtrlEvent() + /* wine requires the event for the test, as we cannot ensure, so far, that + * events are processed synchronously in GenerateConsoleCtrlEvent() */ mch_event = CreateEventA(NULL, TRUE, FALSE, NULL); mch_count = 0; @@ -704,7 +704,7 @@ static void testScreenBuffer(HANDLE hConOut) WCHAR test_unicode[] = {0x0442, 0x0435, 0x0441, 0x0442, 0}; WCHAR str_wbuf[20]; char str_buf[20]; - DWORD len; + DWORD len, error; COORD c; BOOL ret; DWORD oldcp; @@ -782,25 +782,25 @@ static void testScreenBuffer(HANDLE hConOut) /* trying to write non-console handle */ SetLastError(0xdeadbeef); - ok(!WriteConsoleA(hFileOutRW, test_str1, lstrlenA(test_str1), &len, NULL), - "Shouldn't succeed\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, - "GetLastError: expecting %u got %u\n", - ERROR_INVALID_HANDLE, GetLastError()); + ret = WriteConsoleA(hFileOutRW, test_str1, lstrlenA(test_str1), &len, NULL); + error = GetLastError(); + ok(!ret, "Shouldn't succeed\n"); + ok(error == ERROR_INVALID_HANDLE || error == ERROR_INVALID_FUNCTION, + "GetLastError: got %u\n", error); SetLastError(0xdeadbeef); - ok(!WriteConsoleA(hFileOutRO, test_str1, lstrlenA(test_str1), &len, NULL), - "Shouldn't succeed\n"); - ok(GetLastError() == ERROR_INVALID_HANDLE, - "GetLastError: expecting %u got %u\n", - ERROR_INVALID_HANDLE, GetLastError()); + ret = WriteConsoleA(hFileOutRO, test_str1, lstrlenA(test_str1), &len, NULL); + error = GetLastError(); + ok(!ret, "Shouldn't succeed\n"); + ok(error == ERROR_INVALID_HANDLE || error == ERROR_INVALID_FUNCTION, + "GetLastError: got %u\n", error); SetLastError(0xdeadbeef); - ok(!WriteConsoleA(hFileOutWT, test_str1, lstrlenA(test_str1), &len, NULL), - "Shouldn't succeed\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE, - "GetLastError: expecting %u got %u\n", - ERROR_INVALID_HANDLE, GetLastError()); + ret = WriteConsoleA(hFileOutWT, test_str1, lstrlenA(test_str1), &len, NULL); + error = GetLastError(); + ok(!ret, "Shouldn't succeed\n"); + todo_wine ok(error == ERROR_INVALID_HANDLE || error == ERROR_INVALID_FUNCTION, + "GetLastError: got %u\n", error); CloseHandle(hFileOutRW); CloseHandle(hFileOutRO); @@ -927,7 +927,7 @@ static void test_GetSetConsoleInputExeName(void) ok(ret, "GetConsoleInputExeNameA failed\n"); ok(error == ERROR_BUFFER_OVERFLOW, "got %u expected ERROR_BUFFER_OVERFLOW\n", error); - GetModuleFileNameA(GetModuleHandle(NULL), module, sizeof(module)); + GetModuleFileNameA(GetModuleHandleA(NULL), module, sizeof(module)); p = strrchr(module, '\\') + 1; ret = pGetConsoleInputExeNameA(sizeof(buffer)/sizeof(buffer[0]), buffer); @@ -1025,7 +1025,8 @@ static void test_OpenCON(void) for (i = 0; i < sizeof(accesses) / sizeof(accesses[0]); i++) { h = CreateFileW(conW, GENERIC_WRITE, 0, NULL, accesses[i], 0, NULL); - ok(h != INVALID_HANDLE_VALUE, "Expected to open the CON device on write (%x)\n", accesses[i]); + ok(h != INVALID_HANDLE_VALUE || broken(accesses[i] == TRUNCATE_EXISTING /* Win8 */), + "Expected to open the CON device on write (%x)\n", accesses[i]); CloseHandle(h); h = CreateFileW(conW, GENERIC_READ, 0, NULL, accesses[i], 0, NULL); @@ -1034,14 +1035,13 @@ static void test_OpenCON(void) * NT, XP, Vista comply, but Win7 doesn't and allows opening CON with TRUNCATE_EXISTING * So don't test when disposition is TRUNCATE_EXISTING */ - if (accesses[i] != TRUNCATE_EXISTING) - { - ok(h != INVALID_HANDLE_VALUE, "Expected to open the CON device on read (%x)\n", accesses[i]); - } + ok(h != INVALID_HANDLE_VALUE || broken(accesses[i] == TRUNCATE_EXISTING /* Win7+ */), + "Expected to open the CON device on read (%x)\n", accesses[i]); CloseHandle(h); h = CreateFileW(conW, GENERIC_READ|GENERIC_WRITE, 0, NULL, accesses[i], 0, NULL); ok(h == INVALID_HANDLE_VALUE, "Expected not to open the CON device on read-write (%x)\n", accesses[i]); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, "Unexpected error %x\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_INVALID_PARAMETER, + "Unexpected error %x\n", GetLastError()); } } @@ -1051,6 +1051,7 @@ static void test_OpenConsoleW(void) static const WCHAR conoutW[] = {'C','O','N','O','U','T','$',0}; static const WCHAR emptyW[] = {0}; static const WCHAR invalidW[] = {'I','N','V','A','L','I','D',0}; + DWORD gle; static const struct { @@ -1058,42 +1059,63 @@ static void test_OpenConsoleW(void) DWORD access; BOOL inherit; DWORD creation; - DWORD gle; + DWORD gle, gle2; } invalid_table[] = { - {NULL, 0, FALSE, 0, ERROR_INVALID_PARAMETER}, - {NULL, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, ERROR_INVALID_PARAMETER}, - {NULL, 0, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER}, - {NULL, GENERIC_READ | GENERIC_WRITE, FALSE, 0, ERROR_INVALID_PARAMETER}, - {NULL, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER}, - {NULL, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_EXISTING, ERROR_INVALID_PARAMETER}, - {emptyW, 0, FALSE, 0, ERROR_INVALID_PARAMETER}, - {emptyW, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, ERROR_INVALID_PARAMETER}, - {emptyW, 0, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER}, - {emptyW, GENERIC_READ | GENERIC_WRITE, FALSE, 0, ERROR_INVALID_PARAMETER}, - {emptyW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER}, - {emptyW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_EXISTING, ERROR_INVALID_PARAMETER}, - {invalidW, 0, FALSE, 0, ERROR_INVALID_PARAMETER}, - {invalidW, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, ERROR_INVALID_PARAMETER}, - {invalidW, 0, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER}, - {invalidW, GENERIC_READ | GENERIC_WRITE, FALSE, 0, ERROR_INVALID_PARAMETER}, - {invalidW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER}, - {invalidW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_EXISTING, ERROR_INVALID_PARAMETER}, - {coninW, 0, FALSE, 0, ERROR_SHARING_VIOLATION}, - {coninW, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, ERROR_INVALID_PARAMETER}, - {coninW, 0, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER}, - {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, 0, ERROR_SHARING_VIOLATION}, - {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_NEW, ERROR_SHARING_VIOLATION}, - {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_ALWAYS, ERROR_SHARING_VIOLATION}, - {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER}, - {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, TRUNCATE_EXISTING, ERROR_INVALID_PARAMETER}, - {conoutW, 0, FALSE, 0, ERROR_SHARING_VIOLATION}, - {conoutW, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef, ERROR_INVALID_PARAMETER}, - {conoutW, 0, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER}, - {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, 0, ERROR_SHARING_VIOLATION}, - {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_NEW, ERROR_SHARING_VIOLATION}, - {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_ALWAYS, ERROR_SHARING_VIOLATION}, - {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER}, - {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, TRUNCATE_EXISTING, ERROR_INVALID_PARAMETER}, + {NULL, 0, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {NULL, 0, FALSE, 0xdeadbeef, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {NULL, 0xdeadbeef, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {NULL, 0xdeadbeef, TRUE, 0xdeadbeef, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {NULL, 0, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {NULL, GENERIC_READ | GENERIC_WRITE, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {NULL, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {NULL, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_EXISTING, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {emptyW, 0, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {emptyW, 0, FALSE, 0xdeadbeef, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {emptyW, 0xdeadbeef, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {emptyW, 0xdeadbeef, TRUE, 0xdeadbeef, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {emptyW, 0, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {emptyW, GENERIC_READ | GENERIC_WRITE, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {emptyW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {emptyW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_EXISTING, ERROR_INVALID_PARAMETER, ERROR_PATH_NOT_FOUND}, + {invalidW, 0, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_FILE_NOT_FOUND}, + {invalidW, 0, FALSE, 0xdeadbeef, ERROR_INVALID_PARAMETER, 0}, + {invalidW, 0xdeadbeef, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_FILE_NOT_FOUND}, + {invalidW, 0xdeadbeef, TRUE, 0xdeadbeef, ERROR_INVALID_PARAMETER, 0}, + {invalidW, 0, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER, ERROR_FILE_NOT_FOUND}, + {invalidW, GENERIC_READ | GENERIC_WRITE, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_FILE_NOT_FOUND}, + {invalidW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS, ERROR_INVALID_PARAMETER, ERROR_FILE_NOT_FOUND}, + {invalidW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_EXISTING, ERROR_INVALID_PARAMETER, ERROR_FILE_NOT_FOUND}, + {coninW, 0, FALSE, 0xdeadbeef, ERROR_INVALID_PARAMETER, 0}, + {coninW, 0xdeadbeef, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_ACCESS_DENIED}, + {coninW, 0xdeadbeef, TRUE, 0xdeadbeef, ERROR_INVALID_PARAMETER, 0}, + {conoutW, 0, FALSE, 0xdeadbeef, ERROR_INVALID_PARAMETER, 0}, + {conoutW, 0xceadbeef, FALSE, 0, ERROR_INVALID_PARAMETER, ERROR_ACCESS_DENIED}, + {conoutW, 0xdeadbeef, TRUE, 0xdeadbeef, ERROR_INVALID_PARAMETER, 0}, + }; + static const struct + { + LPCWSTR name; + DWORD access; + BOOL inherit; + DWORD creation; + } valid_table[] = { + {coninW, 0, FALSE, 0 }, + {coninW, 0, TRUE, 0 }, + {coninW, GENERIC_EXECUTE, TRUE, 0 }, + {coninW, GENERIC_ALL, TRUE, 0 }, + {coninW, 0, FALSE, OPEN_ALWAYS }, + {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, 0 }, + {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_NEW }, + {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_ALWAYS }, + {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS }, + {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, TRUNCATE_EXISTING}, + {conoutW, 0, FALSE, 0 }, + {conoutW, 0, FALSE, OPEN_ALWAYS }, + {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, 0 }, + {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_NEW, }, + {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_ALWAYS }, + {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS }, + {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, TRUNCATE_EXISTING}, }; int index; @@ -1110,30 +1132,33 @@ static void test_OpenConsoleW(void) SetLastError(0xdeadbeef); ret = pOpenConsoleW(invalid_table[index].name, invalid_table[index].access, invalid_table[index].inherit, invalid_table[index].creation); + gle = GetLastError(); ok(ret == INVALID_HANDLE_VALUE, "Expected OpenConsoleW to return INVALID_HANDLE_VALUE for index %d, got %p\n", index, ret); - ok(GetLastError() == invalid_table[index].gle, - "Expected GetLastError() to return %u for index %d, got %u\n", - invalid_table[index].gle, index, GetLastError()); + ok(gle == invalid_table[index].gle || (gle != 0 && gle == invalid_table[index].gle2), + "Expected GetLastError() to return %u/%u for index %d, got %u\n", + invalid_table[index].gle, invalid_table[index].gle2, index, gle); + } + + for (index = 0; index < sizeof(valid_table)/sizeof(valid_table[0]); index++) + { + ret = pOpenConsoleW(valid_table[index].name, valid_table[index].access, + valid_table[index].inherit, valid_table[index].creation); + todo_wine + ok(ret != INVALID_HANDLE_VALUE || broken(ret == INVALID_HANDLE_VALUE /* until Win7 */), + "Expected OpenConsoleW to succeed for index %d, got %p\n", index, ret); + if (ret != INVALID_HANDLE_VALUE) + CloseHandle(ret); } - /* OpenConsoleW should not touch the last error on success. */ - SetLastError(0xdeadbeef); ret = pOpenConsoleW(coninW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_EXISTING); - ok(ret != INVALID_HANDLE_VALUE, - "Expected OpenConsoleW to return a valid handle\n"); - ok(GetLastError() == 0xdeadbeef, - "Expected the last error to be untouched, got %u\n", GetLastError()); + ok(ret != INVALID_HANDLE_VALUE, "Expected OpenConsoleW to return a valid handle\n"); if (ret != INVALID_HANDLE_VALUE) CloseHandle(ret); - SetLastError(0xdeadbeef); ret = pOpenConsoleW(conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_EXISTING); - ok(ret != INVALID_HANDLE_VALUE, - "Expected OpenConsoleW to return a valid handle\n"); - ok(GetLastError() == 0xdeadbeef, - "Expected the last error to be untouched, got %u\n", GetLastError()); + ok(ret != INVALID_HANDLE_VALUE, "Expected OpenConsoleW to return a valid handle\n"); if (ret != INVALID_HANDLE_VALUE) CloseHandle(ret); } @@ -1158,14 +1183,13 @@ static void test_CreateFileW(void) {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_NEW, 0, FALSE}, {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_ALWAYS, 0, FALSE}, {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS, 0, FALSE}, - {coninW, GENERIC_READ | GENERIC_WRITE, FALSE, TRUNCATE_EXISTING, 0, FALSE}, {conoutW, 0, FALSE, 0, ERROR_INVALID_PARAMETER, TRUE}, {conoutW, 0, FALSE, OPEN_ALWAYS, 0, FALSE}, {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, 0, ERROR_INVALID_PARAMETER, TRUE}, {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_NEW, 0, FALSE}, {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, CREATE_ALWAYS, 0, FALSE}, {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_ALWAYS, 0, FALSE}, - {conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, TRUNCATE_EXISTING, 0, FALSE}, + /* TRUNCATE_EXISTING is forbidden starting with Windows 8 */ }; int index; @@ -1342,7 +1366,7 @@ static void test_WriteConsoleInputA(HANDLE input_handle) INPUT_RECORD event_list[5]; MOUSE_EVENT_RECORD mouse_event = { {0, 0}, 0, 0, MOUSE_MOVED }; KEY_EVENT_RECORD key_event; - DWORD count, console_mode; + DWORD count, console_mode, gle; BOOL ret; int i; @@ -1353,31 +1377,31 @@ static void test_WriteConsoleInputA(HANDLE input_handle) DWORD count; LPDWORD written; DWORD expected_count; - DWORD last_error; + DWORD gle, gle2; int win_crash; } invalid_table[] = { - {NULL, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {NULL, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {NULL, NULL, 0, &count, 0, ERROR_INVALID_HANDLE}, - {NULL, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, - {NULL, NULL, 1, &count, 0xdeadbeef, ERROR_INVALID_ACCESS}, - {NULL, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {NULL, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, + {NULL, NULL, 1, &count, 0xdeadbeef, ERROR_NOACCESS, ERROR_INVALID_ACCESS}, + {NULL, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {NULL, &event, 0, &count, 0, ERROR_INVALID_HANDLE}, - {NULL, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {NULL, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {NULL, &event, 1, &count, 0, ERROR_INVALID_HANDLE}, - {INVALID_HANDLE_VALUE, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {INVALID_HANDLE_VALUE, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {INVALID_HANDLE_VALUE, NULL, 0, &count, 0, ERROR_INVALID_HANDLE}, - {INVALID_HANDLE_VALUE, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, - {INVALID_HANDLE_VALUE, NULL, 1, &count, 0xdeadbeef, ERROR_INVALID_ACCESS}, - {INVALID_HANDLE_VALUE, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {INVALID_HANDLE_VALUE, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, + {INVALID_HANDLE_VALUE, NULL, 1, &count, 0xdeadbeef, ERROR_INVALID_HANDLE, ERROR_INVALID_ACCESS}, + {INVALID_HANDLE_VALUE, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {INVALID_HANDLE_VALUE, &event, 0, &count, 0, ERROR_INVALID_HANDLE}, - {INVALID_HANDLE_VALUE, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {INVALID_HANDLE_VALUE, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {INVALID_HANDLE_VALUE, &event, 1, &count, 0, ERROR_INVALID_HANDLE}, - {input_handle, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, - {input_handle, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, - {input_handle, NULL, 1, &count, 0xdeadbeef, ERROR_INVALID_ACCESS}, - {input_handle, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, - {input_handle, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {input_handle, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, + {input_handle, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, + {input_handle, NULL, 1, &count, 0xdeadbeef, ERROR_NOACCESS, ERROR_INVALID_ACCESS}, + {input_handle, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, + {input_handle, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, }; /* Suppress external sources of input events for the duration of the test. */ @@ -1422,9 +1446,10 @@ static void test_WriteConsoleInputA(HANDLE input_handle) "[%d] Expected output count to be %u, got %u\n", i, invalid_table[i].expected_count, count); } - ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", - i, invalid_table[i].last_error, GetLastError()); + gle = GetLastError(); + ok(gle == invalid_table[i].gle || (gle != 0 && gle == invalid_table[i].gle2), + "[%d] Expected last error to be %u or %u, got %u\n", + i, invalid_table[i].gle, invalid_table[i].gle2, gle); } count = 0xdeadbeef; @@ -1585,7 +1610,7 @@ static void test_WriteConsoleInputW(HANDLE input_handle) INPUT_RECORD event_list[5]; MOUSE_EVENT_RECORD mouse_event = { {0, 0}, 0, 0, MOUSE_MOVED }; KEY_EVENT_RECORD key_event; - DWORD count, console_mode; + DWORD count, console_mode, gle; BOOL ret; int i; @@ -1596,31 +1621,31 @@ static void test_WriteConsoleInputW(HANDLE input_handle) DWORD count; LPDWORD written; DWORD expected_count; - DWORD last_error; + DWORD gle, gle2; int win_crash; } invalid_table[] = { - {NULL, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {NULL, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {NULL, NULL, 0, &count, 0, ERROR_INVALID_HANDLE}, - {NULL, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, - {NULL, NULL, 1, &count, 0xdeadbeef, ERROR_INVALID_ACCESS}, - {NULL, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {NULL, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, + {NULL, NULL, 1, &count, 0xdeadbeef, ERROR_NOACCESS, ERROR_INVALID_ACCESS}, + {NULL, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {NULL, &event, 0, &count, 0, ERROR_INVALID_HANDLE}, - {NULL, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {NULL, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {NULL, &event, 1, &count, 0, ERROR_INVALID_HANDLE}, - {INVALID_HANDLE_VALUE, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {INVALID_HANDLE_VALUE, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {INVALID_HANDLE_VALUE, NULL, 0, &count, 0, ERROR_INVALID_HANDLE}, - {INVALID_HANDLE_VALUE, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, - {INVALID_HANDLE_VALUE, NULL, 1, &count, 0xdeadbeef, ERROR_INVALID_ACCESS}, - {INVALID_HANDLE_VALUE, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {INVALID_HANDLE_VALUE, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, + {INVALID_HANDLE_VALUE, NULL, 1, &count, 0xdeadbeef, ERROR_INVALID_HANDLE, ERROR_INVALID_ACCESS}, + {INVALID_HANDLE_VALUE, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {INVALID_HANDLE_VALUE, &event, 0, &count, 0, ERROR_INVALID_HANDLE}, - {INVALID_HANDLE_VALUE, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {INVALID_HANDLE_VALUE, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, {INVALID_HANDLE_VALUE, &event, 1, &count, 0, ERROR_INVALID_HANDLE}, - {input_handle, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, - {input_handle, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, - {input_handle, NULL, 1, &count, 0xdeadbeef, ERROR_INVALID_ACCESS}, - {input_handle, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, - {input_handle, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 1}, + {input_handle, NULL, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, + {input_handle, NULL, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, + {input_handle, NULL, 1, &count, 0xdeadbeef, ERROR_NOACCESS, ERROR_INVALID_ACCESS}, + {input_handle, &event, 0, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, + {input_handle, &event, 1, NULL, 0xdeadbeef, ERROR_INVALID_ACCESS, 0, 1}, }; /* Suppress external sources of input events for the duration of the test. */ @@ -1665,9 +1690,10 @@ static void test_WriteConsoleInputW(HANDLE input_handle) "[%d] Expected output count to be %u, got %u\n", i, invalid_table[i].expected_count, count); } - ok(GetLastError() == invalid_table[i].last_error, - "[%d] Expected last error to be %u, got %u\n", - i, invalid_table[i].last_error, GetLastError()); + gle = GetLastError(); + ok(gle == invalid_table[i].gle || (gle != 0 && gle == invalid_table[i].gle2), + "[%d] Expected last error to be %u or %u, got %u\n", + i, invalid_table[i].gle, invalid_table[i].gle2, gle); } count = 0xdeadbeef; @@ -2001,7 +2027,7 @@ static void test_WriteConsoleOutputAttribute(HANDLE output_handle) const struct { HANDLE hConsoleOutput; - CONST WORD *attr; + const WORD *attr; DWORD length; COORD coord; LPDWORD lpNumAttrsWritten; @@ -2527,6 +2553,41 @@ static void test_ReadConsoleOutputAttribute(HANDLE output_handle) ok(count == 1, "Expected count to be 1, got %u\n", count); } +static void test_ReadConsole(void) +{ + HANDLE std_input; + DWORD ret, bytes; + char buf[1024]; + + std_input = GetStdHandle(STD_INPUT_HANDLE); + + SetLastError(0xdeadbeef); + ret = GetFileSize(std_input, NULL); + ok(ret == INVALID_FILE_SIZE, "expected INVALID_FILE_SIZE, got %#x\n", ret); + ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadFile(std_input, buf, -128, &bytes, NULL); + ok(!ret, "expected 0, got %u\n", ret); + ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY, "expected ERROR_NOT_ENOUGH_MEMORY, got %d\n", GetLastError()); + ok(!bytes, "expected 0, got %u\n", bytes); + + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadConsoleA(std_input, buf, -128, &bytes, NULL); + ok(!ret, "expected 0, got %u\n", ret); + ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY, "expected ERROR_NOT_ENOUGH_MEMORY, got %d\n", GetLastError()); + ok(bytes == 0xdeadbeef, "expected 0xdeadbeef, got %#x\n", bytes); + + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadConsoleW(std_input, buf, -128, &bytes, NULL); + ok(!ret, "expected 0, got %u\n", ret); + ok(GetLastError() == ERROR_NOT_ENOUGH_MEMORY, "expected ERROR_NOT_ENOUGH_MEMORY, got %d\n", GetLastError()); + ok(bytes == 0xdeadbeef, "expected 0xdeadbeef, got %#x\n", bytes); +} + START_TEST(console) { static const char font_name[] = "Lucida Console"; @@ -2620,6 +2681,7 @@ START_TEST(console) ok(sbi.dwSize.Y == size, "Unexpected buffer size: %d instead of %d\n", sbi.dwSize.Y, size); if (!ret) return; + test_ReadConsole(); /* Non interactive tests */ testCursor(hConOut, sbi.dwSize); /* test parameters (FIXME: test functionality) */ diff --git a/rostests/winetests/kernel32/debugger.c b/rostests/winetests/kernel32/debugger.c index e578cdd6240..011ed5ffd06 100644 --- a/rostests/winetests/kernel32/debugger.c +++ b/rostests/winetests/kernel32/debugger.c @@ -113,9 +113,9 @@ static void get_events(const char* name, HANDLE *start_event, HANDLE *done_event event_name=HeapAlloc(GetProcessHeap(), 0, 6+strlen(basename)+1); sprintf(event_name, "start_%s", basename); - *start_event=CreateEvent(NULL, 0,0, event_name); + *start_event=CreateEventA(NULL, 0,0, event_name); sprintf(event_name, "done_%s", basename); - *done_event=CreateEvent(NULL, 0,0, event_name); + *done_event=CreateEventA(NULL, 0,0, event_name); HeapFree(GetProcessHeap(), 0, event_name); } @@ -429,8 +429,8 @@ static void test_ExitCode(void) reg_save_value auto_value; reg_save_value debugger_value; - GetModuleFileNameA(GetModuleHandle(NULL), test_exe, sizeof(test_exe)); - if (GetFileAttributes(test_exe) == INVALID_FILE_ATTRIBUTES) + GetModuleFileNameA(GetModuleHandleA(NULL), test_exe, sizeof(test_exe)); + if (GetFileAttributesA(test_exe) == INVALID_FILE_ATTRIBUTES) strcat(test_exe, ".so"); if (GetFileAttributesA(test_exe) == INVALID_FILE_ATTRIBUTES) { @@ -686,7 +686,7 @@ static void doChildren(int argc, char **argv) p = p ? p+1 : blackbox_file; strcpy(event_name, p); strcat(event_name, "_init"); - event = OpenEvent(EVENT_ALL_ACCESS, FALSE, event_name); + event = OpenEventA(EVENT_ALL_ACCESS, FALSE, event_name); child_ok(event != NULL, "OpenEvent failed, last error %d.\n", GetLastError()); SetEvent(event); CloseHandle(event); @@ -695,7 +695,7 @@ static void doChildren(int argc, char **argv) p = p ? p+1 : blackbox_file; strcpy(event_name, p); strcat(event_name, "_attach"); - event = OpenEvent(EVENT_ALL_ACCESS, FALSE, event_name); + event = OpenEventA(EVENT_ALL_ACCESS, FALSE, event_name); child_ok(event != NULL, "OpenEvent failed, last error %d.\n", GetLastError()); WaitForSingleObject(event, INFINITE); CloseHandle(event); @@ -747,14 +747,14 @@ static void test_debug_children(char *name, DWORD flag, BOOL debug_child) p = p ? p+1 : blackbox_file; strcpy(event_name, p); strcat(event_name, "_init"); - event_init = CreateEvent(NULL, FALSE, FALSE, event_name); + event_init = CreateEventA(NULL, FALSE, FALSE, event_name); ok(event_init != NULL, "OpenEvent failed, last error %d.\n", GetLastError()); p = strrchr(blackbox_file, '\\'); p = p ? p+1 : blackbox_file; strcpy(event_name, p); strcat(event_name, "_attach"); - event_attach = CreateEvent(NULL, FALSE, flag!=0, event_name); + event_attach = CreateEventA(NULL, FALSE, flag!=0, event_name); ok(event_attach != NULL, "CreateEvent failed, last error %d.\n", GetLastError()); memset(&si, 0, sizeof(si)); @@ -814,12 +814,12 @@ START_TEST(debugger) { HMODULE hdll; - hdll=GetModuleHandle("kernel32.dll"); + hdll=GetModuleHandleA("kernel32.dll"); pCheckRemoteDebuggerPresent=(void*)GetProcAddress(hdll, "CheckRemoteDebuggerPresent"); pDebugActiveProcessStop=(void*)GetProcAddress(hdll, "DebugActiveProcessStop"); pDebugSetProcessKillOnExit=(void*)GetProcAddress(hdll, "DebugSetProcessKillOnExit"); pIsDebuggerPresent=(void*)GetProcAddress(hdll, "IsDebuggerPresent"); - hdll=GetModuleHandle("ntdll.dll"); + hdll=GetModuleHandleA("ntdll.dll"); if (hdll) pNtCurrentTeb = (void*)GetProcAddress(hdll, "NtCurrentTeb"); myARGC=winetest_get_mainargs(&myARGV); @@ -846,6 +846,7 @@ START_TEST(debugger) test_debug_loop(myARGC, myARGV); test_debug_children(myARGV[0], DEBUG_PROCESS, TRUE); test_debug_children(myARGV[0], DEBUG_ONLY_THIS_PROCESS, FALSE); + test_debug_children(myARGV[0], DEBUG_PROCESS|DEBUG_ONLY_THIS_PROCESS, FALSE); test_debug_children(myARGV[0], 0, FALSE); } } diff --git a/rostests/winetests/kernel32/drive.c b/rostests/winetests/kernel32/drive.c index ca6cb44d044..4acd3e8c19c 100755 --- a/rostests/winetests/kernel32/drive.c +++ b/rostests/winetests/kernel32/drive.c @@ -117,7 +117,7 @@ static void test_GetDiskFreeSpaceA(void) if (!ret) /* GetDiskFreeSpaceA() should succeed, but it can fail with too many - different GetLastError() results to be usable for a ok() */ + different GetLastError() results to be usable for an ok() */ trace("GetDiskFreeSpaceA(%s) failed with %d\n", drive, GetLastError()); if( GetVersion() & 0x80000000) @@ -134,7 +134,7 @@ static void test_GetDiskFreeSpaceA(void) if (!ret) /* GetDiskFreeSpaceExA() should succeed, but it can fail with too many - different GetLastError() results to be usable for a ok() */ + different GetLastError() results to be usable for an ok() */ trace("GetDiskFreeSpaceExA(%s) failed with %d\n", drive, GetLastError()); ok( bytes_per_sector == 0 || /* empty cd rom drive */ @@ -192,7 +192,7 @@ static void test_GetDiskFreeSpaceW(void) drive[0], ret, GetLastError()); else if (!ret) /* GetDiskFreeSpaceW() should succeed, but it can fail with too many - different GetLastError() results to be usable for a ok() */ + different GetLastError() results to be usable for an ok() */ trace("GetDiskFreeSpaceW(%c) failed with %d\n", drive[0], GetLastError()); } logical_drives >>= 1; diff --git a/rostests/winetests/kernel32/environ.c b/rostests/winetests/kernel32/environ.c index 3ac86cd7a4b..f8452be2ee6 100755 --- a/rostests/winetests/kernel32/environ.c +++ b/rostests/winetests/kernel32/environ.c @@ -357,7 +357,7 @@ static void test_ExpandEnvironmentStringsA(void) ret_size = ExpandEnvironmentStringsA(buf, buf1, sizeof(buf1)); ok(ret_size == strlen(buf2)+1 || ret_size == (strlen(buf2)+1)*2 /* NT4 */, - "ExpandEnvironmentStrings returned %d instead of %d\n", ret_size, lstrlen(buf2)+1); + "ExpandEnvironmentStrings returned %d instead of %d\n", ret_size, lstrlenA(buf2)+1); ok(!strcmp(buf1, buf2), "ExpandEnvironmentStrings returned [%s]\n", buf1); SetEnvironmentVariableA("IndirectVar", NULL); diff --git a/rostests/winetests/kernel32/fiber.c b/rostests/winetests/kernel32/fiber.c index 0e685351b46..1e4ca666853 100644 --- a/rostests/winetests/kernel32/fiber.c +++ b/rostests/winetests/kernel32/fiber.c @@ -39,7 +39,7 @@ static WORD cbCount; static VOID init_funcs(void) { - HMODULE hKernel32 = GetModuleHandle("kernel32"); + HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); #define X(f) p##f = (void*)GetProcAddress(hKernel32, #f); X(CreateFiber); @@ -181,6 +181,35 @@ static void test_FiberLocalStorage(PFLS_CALLBACK_FUNCTION cbfunc) ok(ret, "FlsFree failed\n"); if (cbfunc) todo_wine ok(cbCount == 1, "Wrong callback count: %d\n", cbCount); + + /* test index 0 */ + SetLastError( 0xdeadbeef ); + val = pFlsGetValue( 0 ); + ok( !val, "fls index 0 set to %p\n", val ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "setting fls index wrong error %u\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + ret = pFlsSetValue( 0, (void *)0xdeadbeef ); + ok( !ret, "setting fls index 0 succeeded\n" ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "setting fls index wrong error %u\n", GetLastError() ); + SetLastError( 0xdeadbeef ); + val = pFlsGetValue( 0 ); + ok( !val, "fls index 0 wrong value %p\n", val ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "setting fls index wrong error %u\n", GetLastError() ); + + fls = pFlsAlloc( NULL ); + ok( fls != FLS_OUT_OF_INDEXES, "FlsAlloc failed\n" ); + ok( fls != 0, "fls index 0 allocated\n" ); + val = pFlsGetValue( fls ); + ok( !val, "fls index %u wrong value %p\n", fls, val ); + ret = pFlsSetValue( fls, (void *)0xdeadbeef ); + ok( ret, "setting fls index %u failed\n", fls ); + val = pFlsGetValue( fls ); + ok( val == (void *)0xdeadbeef, "fls index %u wrong value %p\n", fls, val ); + pFlsFree( fls ); + ret = pFlsSetValue( fls, (void *)0xdeadbabe ); + ok( ret, "setting fls index %u failed\n", fls ); + val = pFlsGetValue( fls ); + ok( val == (void *)0xdeadbabe, "fls index %u wrong value %p\n", fls, val ); } START_TEST(fiber) diff --git a/rostests/winetests/kernel32/file.c b/rostests/winetests/kernel32/file.c index d0a025c29aa..883aa57b355 100755 --- a/rostests/winetests/kernel32/file.c +++ b/rostests/winetests/kernel32/file.c @@ -21,7 +21,7 @@ */ /* ReplaceFile requires Windows 2000 or newer */ -#define _WIN32_WINNT 0x0600 +#define _WIN32_WINNT 0x0601 #include #include @@ -33,6 +33,7 @@ #include "winbase.h" #include "winerror.h" #include "winnls.h" +#include "fileapi.h" static HANDLE (WINAPI *pFindFirstFileExA)(LPCSTR,FINDEX_INFO_LEVELS,LPVOID,FINDEX_SEARCH_OPS,LPVOID,DWORD); static BOOL (WINAPI *pReplaceFileA)(LPCSTR, LPCSTR, LPCSTR, DWORD, LPVOID, LPVOID); @@ -43,6 +44,8 @@ static DWORD (WINAPI *pQueueUserAPC)(PAPCFUNC pfnAPC, HANDLE hThread, ULONG_PTR static BOOL (WINAPI *pGetFileInformationByHandleEx)(HANDLE, FILE_INFO_BY_HANDLE_CLASS, LPVOID, DWORD); static HANDLE (WINAPI *pOpenFileById)(HANDLE, LPFILE_ID_DESCRIPTOR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD); static BOOL (WINAPI *pSetFileValidData)(HANDLE, LONGLONG); +static HRESULT (WINAPI *pCopyFile2)(PCWSTR,PCWSTR,COPYFILE2_EXTENDED_PARAMETERS*); +static HANDLE (WINAPI *pCreateFile2)(LPCWSTR, DWORD, DWORD, DWORD, CREATEFILE2_EXTENDED_PARAMETERS*); /* keep filename and filenameW the same */ static const char filename[] = "testfile.xxx"; @@ -80,6 +83,8 @@ static void InitFunctionPointers(void) pGetFileInformationByHandleEx = (void *) GetProcAddress(hkernel32, "GetFileInformationByHandleEx"); pOpenFileById = (void *) GetProcAddress(hkernel32, "OpenFileById"); pSetFileValidData = (void *) GetProcAddress(hkernel32, "SetFileValidData"); + pCopyFile2 = (void *) GetProcAddress(hkernel32, "CopyFile2"); + pCreateFile2 = (void *) GetProcAddress(hkernel32, "CreateFile2"); } static void test__hread( void ) @@ -721,7 +726,7 @@ static void test_CopyFileA(void) ok(!memcmp(prefix, buf, sizeof(prefix)), "buffer contents mismatch\n"); /* check error on copying over a mapped file that was opened with FILE_SHARE_READ */ - hmapfile = CreateFileMapping(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); + hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); ret = CopyFileA(source, dest, FALSE); @@ -735,7 +740,7 @@ static void test_CopyFileA(void) ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file\n"); /* check error on copying over a mapped file that was opened with FILE_SHARE_WRITE */ - hmapfile = CreateFileMapping(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); + hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); ret = CopyFileA(source, dest, FALSE); @@ -788,6 +793,234 @@ static void test_CopyFileW(void) ok(ret, "DeleteFileW: error %d\n", GetLastError()); } +static void test_CopyFile2(void) +{ + static const WCHAR doesntexistW[] = {'d','o','e','s','n','t','e','x','i','s','t',0}; + static const WCHAR prefix[] = {'p','f','x',0}; + WCHAR source[MAX_PATH], dest[MAX_PATH], temp_path[MAX_PATH]; + COPYFILE2_EXTENDED_PARAMETERS params; + HANDLE hfile, hmapfile; + FILETIME ft1, ft2; + DWORD ret, len; + char buf[10]; + HRESULT hr; + + if (!pCopyFile2) + { + skip("CopyFile2 is not available\n"); + return; + } + + ret = GetTempPathW(MAX_PATH, temp_path); + ok(ret != 0, "GetTempPathW error %d\n", GetLastError()); + ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n"); + + ret = GetTempFileNameW(temp_path, prefix, 0, source); + ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + + ret = GetTempFileNameW(temp_path, prefix, 0, dest); + ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + + /* fail if exists */ + memset(¶ms, 0, sizeof(params)); + params.dwSize = sizeof(params); + params.dwCopyFlags = COPY_FILE_FAIL_IF_EXISTS; + + SetLastError(0xdeadbeef); + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), "CopyFile2: unexpected error 0x%08x\n", hr); + ok(GetLastError() == ERROR_FILE_EXISTS, "CopyFile2: last error %d\n", GetLastError()); + + /* don't fail if exists */ + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == S_OK, "CopyFile2: error 0x%08x\n", hr); + + /* copying a file to itself must fail */ + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + + SetLastError(0xdeadbeef); + hr = pCopyFile2(source, source, ¶ms); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: copying a file to itself didn't fail, 0x%08x\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + + /* make the source have not zero size */ + hfile = CreateFileW(source, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0 ); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file\n"); + ret = WriteFile(hfile, prefix, sizeof(prefix), &len, NULL ); + ok(ret && len == sizeof(prefix), "WriteFile error %d\n", GetLastError()); + ok(GetFileSize(hfile, NULL) == sizeof(prefix), "source file has wrong size\n"); + + /* get the file time and change it to prove the difference */ + ret = GetFileTime(hfile, NULL, NULL, &ft1); + ok(ret, "GetFileTime error %d\n", GetLastError()); + ft1.dwLowDateTime -= 600000000; /* 60 second */ + ret = SetFileTime(hfile, NULL, NULL, &ft1); + ok(ret, "SetFileTime error %d\n", GetLastError()); + GetFileTime(hfile, NULL, NULL, &ft1); /* get the actual time back */ + CloseHandle(hfile); + + ret = GetTempFileNameW(temp_path, prefix, 0, dest); + ok(ret != 0, "GetTempFileNameA error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = COPY_FILE_FAIL_IF_EXISTS; + + SetLastError(0xdeadbeef); + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_EXISTS), "CopyFile2: unexpected error 0x%08x\n", hr); + ok(GetLastError() == ERROR_FILE_EXISTS, "CopyFile2: last error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + hr = pCopyFile2(source, dest, ¶ms); + ok(ret, "CopyFile2: error 0x%08x\n", hr); + + /* copying from a read-locked source fails */ + hfile = CreateFileW(source, GENERIC_READ, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + SetLastError(0xdeadbeef); + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08x\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + + /* in addition, the source is opened before the destination */ + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + SetLastError(0xdeadbeef); + hr = pCopyFile2(doesntexistW, dest, ¶ms); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "got 0x%08x\n", hr); + ok(GetLastError() == ERROR_FILE_NOT_FOUND, "CopyFile2: last error %d\n", GetLastError()); + CloseHandle(hfile); + + /* copying from a r+w opened, r shared source succeeds */ + hfile = CreateFileW(source, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == S_OK, "failed 0x%08x\n", hr); + CloseHandle(hfile); + + /* copying from a delete-locked source mostly succeeds */ + hfile = CreateFileW(source, DELETE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file, error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == S_OK, "failed 0x%08x\n", hr); + CloseHandle(hfile); + + /* copying to a write-locked destination fails */ + hfile = CreateFileW(dest, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + SetLastError(0xdeadbeef); + hr = pCopyFile2(source, dest, FALSE); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08x\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + CloseHandle(hfile); + + /* copying to a r+w opened, w shared destination mostly succeeds */ + hfile = CreateFileW(dest, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + hr = pCopyFile2(source, dest, FALSE); + ok(hr == S_OK, "got 0x%08x\n", hr); + CloseHandle(hfile); + + /* copying to a delete-locked destination fails, even when the destination is delete-shared */ + hfile = CreateFileW(dest, DELETE, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + SetLastError(0xdeadbeef); + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08x\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + CloseHandle(hfile); + + /* copy to a file that's opened the way Wine opens the source */ + hfile = CreateFileW(dest, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file, error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == S_OK, "got 0x%08x\n", hr); + CloseHandle(hfile); + + /* make sure that destination has correct size */ + hfile = CreateFileW(dest, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file\n"); + ret = GetFileSize(hfile, NULL); + ok(ret == sizeof(prefix), "destination file has wrong size %d\n", ret); + + /* make sure that destination has the same filetime */ + ret = GetFileTime(hfile, NULL, NULL, &ft2); + ok(ret, "GetFileTime error %d\n", GetLastError()); + ok(CompareFileTime(&ft1, &ft2) == 0, "destination file has wrong filetime\n"); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + SetLastError(0xdeadbeef); + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08x\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + + /* make sure that destination still has correct size */ + ret = GetFileSize(hfile, NULL); + ok(ret == sizeof(prefix), "destination file has wrong size %d\n", ret); + ret = ReadFile(hfile, buf, sizeof(buf), &len, NULL); + ok(ret && len == sizeof(prefix), "ReadFile: error %d\n", GetLastError()); + ok(!memcmp(prefix, buf, sizeof(prefix)), "buffer contents mismatch\n"); + + /* check error on copying over a mapped file that was opened with FILE_SHARE_READ */ + hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); + ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + SetLastError(0xdeadbeef); + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == HRESULT_FROM_WIN32(ERROR_SHARING_VIOLATION), "CopyFile2: unexpected error 0x%08x\n", hr); + ok(GetLastError() == ERROR_SHARING_VIOLATION, "CopyFile2: last error %d\n", GetLastError()); + + CloseHandle(hmapfile); + CloseHandle(hfile); + + hfile = CreateFileW(dest, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0); + ok(hfile != INVALID_HANDLE_VALUE, "failed to open destination file\n"); + + /* check error on copying over a mapped file that was opened with FILE_SHARE_WRITE */ + hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); + ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); + + params.dwSize = sizeof(params); + params.dwCopyFlags = 0; + hr = pCopyFile2(source, dest, ¶ms); + ok(hr == HRESULT_FROM_WIN32(ERROR_USER_MAPPED_FILE), "CopyFile2: unexpected error 0x%08x\n", hr); + ok(GetLastError() == ERROR_USER_MAPPED_FILE, "CopyFile2: last error %d\n", GetLastError()); + + CloseHandle(hmapfile); + CloseHandle(hfile); + + DeleteFileW(source); + DeleteFileW(dest); +} /* * Debugging routine to dump a buffer in a hexdump-like fashion. @@ -891,7 +1124,7 @@ static void test_CreateFileA(void) "LastError should have been ERROR_INVALID_NAME or ERROR_FILE_NOT_FOUND but got %u\n", GetLastError()); /* get windows drive letter */ - ret = GetWindowsDirectory(windowsdir, sizeof(windowsdir)); + ret = GetWindowsDirectoryA(windowsdir, sizeof(windowsdir)); ok(ret < sizeof(windowsdir), "windowsdir is abnormally long!\n"); ok(ret != 0, "GetWindowsDirectory: error %d\n", GetLastError()); @@ -900,7 +1133,7 @@ static void test_CreateFileA(void) ok(ret != 0, "GetTempPathA error %d\n", GetLastError()); strcpy(dirname, temp_path); strcat(dirname, directory); - ret = CreateDirectory(dirname, NULL); + ret = CreateDirectoryA(dirname, NULL); ok( ret, "Createdirectory failed, gle=%d\n", GetLastError() ); /* set current drive & directory to known location */ SetCurrentDirectoryA( temp_path ); @@ -1258,6 +1491,87 @@ static void test_CreateFileW(void) ok(ret, "DeleteFileW: error %d\n", GetLastError()); } +static void test_CreateFile2(void) +{ + HANDLE hFile; + WCHAR temp_path[MAX_PATH]; + WCHAR filename[MAX_PATH]; + CREATEFILE2_EXTENDED_PARAMETERS exparams; + static const WCHAR emptyW[]={'\0'}; + static const WCHAR prefix[] = {'p','f','x',0}; + static const WCHAR bogus[] = { '\\', '\\', '.', '\\', 'B', 'O', 'G', 'U', 'S', 0 }; + DWORD ret; + + if (!pCreateFile2) + { + win_skip("CreateFile2 is missing\n"); + return; + } + + ret = GetTempPathW(MAX_PATH, temp_path); + ok(ret != 0, "GetTempPathW error %d\n", GetLastError()); + ok(ret < MAX_PATH, "temp path should fit into MAX_PATH\n"); + + ret = GetTempFileNameW(temp_path, prefix, 0, filename); + ok(ret != 0, "GetTempFileNameW error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + exparams.dwSize = sizeof(exparams); + exparams.dwFileAttributes = FILE_FLAG_RANDOM_ACCESS; + exparams.dwFileFlags = 0; + exparams.dwSecurityQosFlags = 0; + exparams.lpSecurityAttributes = NULL; + exparams.hTemplateFile = 0; + hFile = pCreateFile2(filename, GENERIC_READ, 0, CREATE_NEW, &exparams); + ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_EXISTS, + "CREATE_NEW should fail if file exists and last error value should be ERROR_FILE_EXISTS\n"); + + SetLastError(0xdeadbeef); + hFile = pCreateFile2(filename, GENERIC_READ, FILE_SHARE_READ, CREATE_ALWAYS, &exparams); + ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == ERROR_ALREADY_EXISTS, + "hFile %p, last error %u\n", hFile, GetLastError()); + CloseHandle(hFile); + + SetLastError(0xdeadbeef); + hFile = pCreateFile2(filename, GENERIC_READ, FILE_SHARE_READ, OPEN_ALWAYS, &exparams); + ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == ERROR_ALREADY_EXISTS, + "hFile %p, last error %u\n", hFile, GetLastError()); + CloseHandle(hFile); + + ret = DeleteFileW(filename); + ok(ret, "DeleteFileW: error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + hFile = pCreateFile2(filename, GENERIC_READ, FILE_SHARE_READ, OPEN_ALWAYS, &exparams); + ok(hFile != INVALID_HANDLE_VALUE && GetLastError() == 0, + "hFile %p, last error %u\n", hFile, GetLastError()); + CloseHandle(hFile); + + ret = DeleteFileW(filename); + ok(ret, "DeleteFileW: error %d\n", GetLastError()); + + hFile = pCreateFile2(emptyW, GENERIC_READ, 0, CREATE_NEW, &exparams); + ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND, + "CreateFile2(\"\") returned ret=%p error=%d\n",hFile,GetLastError()); + + /* test the result of opening a nonexistent driver name */ + exparams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; + hFile = pCreateFile2(bogus, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, OPEN_EXISTING, &exparams); + ok(hFile == INVALID_HANDLE_VALUE && GetLastError() == ERROR_FILE_NOT_FOUND, + "CreateFile2 on invalid VxD name returned ret=%p error=%d\n",hFile,GetLastError()); + + ret = CreateDirectoryW(filename, NULL); + ok(ret == TRUE, "couldn't create temporary directory\n"); + exparams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS; + hFile = pCreateFile2(filename, GENERIC_READ | GENERIC_WRITE, 0, OPEN_ALWAYS, &exparams); + todo_wine + ok(hFile == INVALID_HANDLE_VALUE, + "expected CreateFile2 to fail on existing directory, error: %d\n", GetLastError()); + CloseHandle(hFile); + ret = RemoveDirectoryW(filename); + ok(ret, "DeleteFileW: error %d\n", GetLastError()); +} + static void test_GetTempFileNameA(void) { UINT result; @@ -1266,7 +1580,7 @@ static void test_GetTempFileNameA(void) char windowsdir[MAX_PATH + 10]; char windowsdrive[3]; - result = GetWindowsDirectory(windowsdir, sizeof(windowsdir)); + result = GetWindowsDirectoryA(windowsdir, sizeof(windowsdir)); ok(result < sizeof(windowsdir), "windowsdir is abnormally long!\n"); ok(result != 0, "GetWindowsDirectory: error %d\n", GetLastError()); @@ -1318,24 +1632,36 @@ static void test_DeleteFileA( void ) GetLastError() == ERROR_INVALID_FUNCTION), "DeleteFileA(\"nul\") returned ret=%d error=%d\n",ret,GetLastError()); + ret = DeleteFileA("nonexist.txt"); + ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "DeleteFileA(\"nonexist.txt\") returned ret=%d error=%d\n",ret,GetLastError()); + GetTempPathA(MAX_PATH, temp_path); - GetTempFileName(temp_path, "tst", 0, temp_file); + GetTempFileNameA(temp_path, "tst", 0, temp_file); SetLastError(0xdeadbeef); - hfile = CreateFile(temp_file, GENERIC_READ, FILE_SHARE_DELETE | FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); + hfile = CreateFileA(temp_file, GENERIC_READ, FILE_SHARE_DELETE | FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); ok(hfile != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); SetLastError(0xdeadbeef); - ret = DeleteFile(temp_file); + ret = DeleteFileA(temp_file); todo_wine ok(ret, "DeleteFile error %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = CloseHandle(hfile); ok(ret, "CloseHandle error %d\n", GetLastError()); - ret = DeleteFile(temp_file); + ret = DeleteFileA(temp_file); todo_wine ok(!ret, "DeleteFile should fail\n"); + + SetLastError(0xdeadbeef); + ret = CreateDirectoryA("testdir", NULL); + ok(ret, "CreateDirectory failed, got err %d\n", GetLastError()); + ret = DeleteFileA("testdir"); + ok(!ret && GetLastError() == ERROR_ACCESS_DENIED, + "Expected ERROR_ACCESS_DENIED, got error %d\n", GetLastError()); + ret = RemoveDirectoryA("testdir"); + ok(ret, "Remove a directory failed, got error %d\n", GetLastError()); } static void test_DeleteFileW( void ) @@ -1426,7 +1752,7 @@ static void test_MoveFileA(void) ok( retok && ret == sizeof(prefix), "WriteFile error %d\n", GetLastError()); - hmapfile = CreateFileMapping(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); + hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); ret = MoveFileA(source, dest); @@ -1441,12 +1767,12 @@ static void test_MoveFileA(void) CloseHandle(hfile); /* if MoveFile succeeded, move back to dest */ - if (ret) MoveFile(dest, source); + if (ret) MoveFileA(dest, source); hfile = CreateFileA(source, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); ok(hfile != INVALID_HANDLE_VALUE, "failed to open source file\n"); - hmapfile = CreateFileMapping(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); + hmapfile = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_COMMIT, 0, 0, NULL); ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError()); ret = MoveFileA(source, dest); @@ -1461,7 +1787,7 @@ static void test_MoveFileA(void) CloseHandle(hfile); /* if MoveFile succeeded, move back to dest */ - if (ret) MoveFile(dest, source); + if (ret) MoveFileA(dest, source); ret = MoveFileA(source, dest); ok(ret, "MoveFileA: failed, error %d\n", GetLastError()); @@ -1833,7 +2159,7 @@ static unsigned int map_file_access( unsigned int access ) return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); } -static int is_sharing_compatible( DWORD access1, DWORD sharing1, DWORD access2, DWORD sharing2 ) +static BOOL is_sharing_compatible( DWORD access1, DWORD sharing1, DWORD access2, DWORD sharing2 ) { access1 = map_file_access( access1 ); access2 = map_file_access( access2 ); @@ -1843,22 +2169,22 @@ static int is_sharing_compatible( DWORD access1, DWORD sharing1, DWORD access2, if (!access1) sharing1 = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE; if (!access2) sharing2 = FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE; - if ((access1 & (FILE_READ_DATA|FILE_EXECUTE)) && !(sharing2 & FILE_SHARE_READ)) return 0; - if ((access1 & (FILE_WRITE_DATA|FILE_APPEND_DATA)) && !(sharing2 & FILE_SHARE_WRITE)) return 0; - if ((access1 & DELETE) && !(sharing2 & FILE_SHARE_DELETE)) return 0; - if ((access2 & (FILE_READ_DATA|FILE_EXECUTE)) && !(sharing1 & FILE_SHARE_READ)) return 0; - if ((access2 & (FILE_WRITE_DATA|FILE_APPEND_DATA)) && !(sharing1 & FILE_SHARE_WRITE)) return 0; - if ((access2 & DELETE) && !(sharing1 & FILE_SHARE_DELETE)) return 0; - return 1; + if ((access1 & (FILE_READ_DATA|FILE_EXECUTE)) && !(sharing2 & FILE_SHARE_READ)) return FALSE; + if ((access1 & (FILE_WRITE_DATA|FILE_APPEND_DATA)) && !(sharing2 & FILE_SHARE_WRITE)) return FALSE; + if ((access1 & DELETE) && !(sharing2 & FILE_SHARE_DELETE)) return FALSE; + if ((access2 & (FILE_READ_DATA|FILE_EXECUTE)) && !(sharing1 & FILE_SHARE_READ)) return FALSE; + if ((access2 & (FILE_WRITE_DATA|FILE_APPEND_DATA)) && !(sharing1 & FILE_SHARE_WRITE)) return FALSE; + if ((access2 & DELETE) && !(sharing1 & FILE_SHARE_DELETE)) return FALSE; + return TRUE; } -static int is_sharing_map_compatible( DWORD map_access, DWORD access2, DWORD sharing2 ) +static BOOL is_sharing_map_compatible( DWORD map_access, DWORD access2, DWORD sharing2 ) { if ((map_access == PAGE_READWRITE || map_access == PAGE_EXECUTE_READWRITE) && - !(sharing2 & FILE_SHARE_WRITE)) return 0; + !(sharing2 & FILE_SHARE_WRITE)) return FALSE; access2 = map_file_access( access2 ); - if ((map_access & SEC_IMAGE) && (access2 & FILE_WRITE_DATA)) return 0; - return 1; + if ((map_access & SEC_IMAGE) && (access2 & FILE_WRITE_DATA)) return FALSE; + return TRUE; } static void test_file_sharing(void) @@ -2039,7 +2365,7 @@ static void test_file_sharing(void) static char get_windows_drive(void) { char windowsdir[MAX_PATH]; - GetWindowsDirectory(windowsdir, sizeof(windowsdir)); + GetWindowsDirectoryA(windowsdir, sizeof(windowsdir)); return windowsdir[0]; } @@ -2074,7 +2400,7 @@ static void test_FindFirstFileA(void) ok ( FindClose(handle) == TRUE, "Failed to close handle %s\n", buffer2 ); /* try FindFirstFileA on windows dir */ - GetWindowsDirectory( buffer2, sizeof(buffer2) ); + GetWindowsDirectoryA( buffer2, sizeof(buffer2) ); strcat(buffer2, "\\*"); handle = FindFirstFileA(buffer2, &data); ok( handle != INVALID_HANDLE_VALUE, "FindFirstFile on %s should succeed\n", buffer2 ); @@ -2099,18 +2425,26 @@ static void test_FindFirstFileA(void) strcat(buffer2, "\\"); handle = FindFirstFileA(buffer2, &data); err = GetLastError(); - ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); + ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); todo_wine { ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); } + /* try FindFirstFileA without trailing backslash */ + SetLastError( 0xdeadbeaf ); + strcpy(buffer2, nonexistent); + handle = FindFirstFileA(buffer2, &data); + err = GetLastError(); + ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); + ok ( err == ERROR_FILE_NOT_FOUND, "Bad Error number %d\n", err ); + /* try FindFirstFileA on "C:\foo\bar.txt" */ SetLastError( 0xdeadbeaf ); strcpy(buffer2, nonexistent); strcat(buffer2, "\\bar.txt"); handle = FindFirstFileA(buffer2, &data); err = GetLastError(); - ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); + ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); /* try FindFirstFileA on "C:\foo\*.*" */ @@ -2119,7 +2453,7 @@ static void test_FindFirstFileA(void) strcat(buffer2, "\\*.*"); handle = FindFirstFileA(buffer2, &data); err = GetLastError(); - ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); + ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); /* try FindFirstFileA on "foo\bar.txt" */ @@ -2128,7 +2462,7 @@ static void test_FindFirstFileA(void) strcat(buffer2, "\\bar.txt"); handle = FindFirstFileA(buffer2, &data); err = GetLastError(); - ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); + ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); /* try FindFirstFileA on "c:\nul" */ @@ -2178,7 +2512,7 @@ static void test_FindFirstFileA(void) strcat(buffer2, "nul\\*"); handle = FindFirstFileA(buffer2, &data); err = GetLastError(); - ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); + ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); /* try FindFirstFileA on "c:\nul*" */ @@ -2187,7 +2521,7 @@ static void test_FindFirstFileA(void) strcat(buffer2, "nul*"); handle = FindFirstFileA(buffer2, &data); err = GetLastError(); - ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); + ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); ok ( err == ERROR_FILE_NOT_FOUND, "Bad Error number %d\n", err ); /* try FindFirstFileA on "c:\foo\bar\nul" */ @@ -2196,7 +2530,7 @@ static void test_FindFirstFileA(void) strcat(buffer2, "foo\\bar\\nul"); handle = FindFirstFileA(buffer2, &data); err = GetLastError(); - ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); + ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); /* try FindFirstFileA on "c:\foo\nul\bar" */ @@ -2205,7 +2539,7 @@ static void test_FindFirstFileA(void) strcat(buffer2, "foo\\nul\\bar"); handle = FindFirstFileA(buffer2, &data); err = GetLastError(); - ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should Fail\n", buffer2 ); + ok ( handle == INVALID_HANDLE_VALUE, "FindFirstFile on %s should fail\n", buffer2 ); ok ( err == ERROR_PATH_NOT_FOUND, "Bad Error number %d\n", err ); } @@ -2219,7 +2553,7 @@ static void test_FindNextFileA(void) buffer[0] = get_windows_drive(); handle = FindFirstFileA(buffer,&search_results); ok ( handle != INVALID_HANDLE_VALUE, "FindFirstFile on C:\\* should succeed\n" ); - while (FindNextFile(handle, &search_results)) + while (FindNextFileA(handle, &search_results)) { /* get to the end of the files */ } @@ -2256,14 +2590,14 @@ static void test_FindFirstFileExA(FINDEX_SEARCH_OPS search_ops) #define CHECK_NAME(fn) (strcmp((fn), "file1") == 0 || strcmp((fn), "file2") == 0 || strcmp((fn), "dir1") == 0) - ok(FindNextFile(handle, &search_results), "Fetching second file failed\n"); + ok(FindNextFileA(handle, &search_results), "Fetching second file failed\n"); ok(strcmp(search_results.cFileName, "..") == 0, "Second entry should be '..' is %s\n", search_results.cFileName); - ok(FindNextFile(handle, &search_results), "Fetching third file failed\n"); + ok(FindNextFileA(handle, &search_results), "Fetching third file failed\n"); ok(CHECK_NAME(search_results.cFileName), "Invalid third entry - %s\n", search_results.cFileName); SetLastError(0xdeadbeef); - ret = FindNextFile(handle, &search_results); + ret = FindNextFileA(handle, &search_results); if (!ret && (GetLastError() == ERROR_NO_MORE_FILES) && (search_ops == FindExSearchLimitToDirectories)) { skip("File system supports directory filtering\n"); @@ -2276,12 +2610,12 @@ static void test_FindFirstFileExA(FINDEX_SEARCH_OPS search_ops) ok(ret, "Fetching fourth file failed\n"); ok(CHECK_NAME(search_results.cFileName), "Invalid fourth entry - %s\n", search_results.cFileName); - ok(FindNextFile(handle, &search_results), "Fetching fifth file failed\n"); + ok(FindNextFileA(handle, &search_results), "Fetching fifth file failed\n"); ok(CHECK_NAME(search_results.cFileName), "Invalid fifth entry - %s\n", search_results.cFileName); #undef CHECK_NAME - ok(FindNextFile(handle, &search_results) == FALSE, "Fetching sixth file should fail\n"); + ok(FindNextFileA(handle, &search_results) == FALSE, "Fetching sixth file should fail\n"); FindClose( handle ); @@ -2295,8 +2629,8 @@ cleanup: static int test_Mapfile_createtemp(HANDLE *handle) { SetFileAttributesA(filename,FILE_ATTRIBUTE_NORMAL); - DeleteFile(filename); - *handle = CreateFile(filename, GENERIC_READ|GENERIC_WRITE, 0, 0, + DeleteFileA(filename); + *handle = CreateFileA(filename, GENERIC_READ|GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (*handle != INVALID_HANDLE_VALUE) { @@ -2313,14 +2647,14 @@ static void test_MapFile(void) ok(test_Mapfile_createtemp(&handle), "Couldn't create test file.\n"); - hmap = CreateFileMapping( handle, NULL, PAGE_READWRITE, 0, 0x1000, "named_file_map" ); + hmap = CreateFileMappingA( handle, NULL, PAGE_READWRITE, 0, 0x1000, "named_file_map" ); ok( hmap != NULL, "mapping should work, I named it!\n" ); ok( CloseHandle( hmap ), "can't close mapping handle\n"); /* We have to close file before we try new stuff with mapping again. Else we would always succeed on XP or block descriptors on 95. */ - hmap = CreateFileMapping( handle, NULL, PAGE_READWRITE, 0, 0, NULL ); + hmap = CreateFileMappingA( handle, NULL, PAGE_READWRITE, 0, 0, NULL ); ok( hmap != NULL, "We should still be able to map!\n" ); ok( CloseHandle( hmap ), "can't close mapping handle\n"); ok( CloseHandle( handle ), "can't close file handle\n"); @@ -2328,17 +2662,17 @@ static void test_MapFile(void) ok(test_Mapfile_createtemp(&handle), "Couldn't create test file.\n"); - hmap = CreateFileMapping( handle, NULL, PAGE_READWRITE, 0, 0, NULL ); + hmap = CreateFileMappingA( handle, NULL, PAGE_READWRITE, 0, 0, NULL ); ok( hmap == NULL, "mapped zero size file\n"); ok( GetLastError() == ERROR_FILE_INVALID, "not ERROR_FILE_INVALID\n"); - hmap = CreateFileMapping( handle, NULL, PAGE_READWRITE, 0x80000000, 0, NULL ); + hmap = CreateFileMappingA( handle, NULL, PAGE_READWRITE, 0x80000000, 0, NULL ); ok( hmap == NULL || broken(hmap != NULL) /* NT4 */, "mapping should fail\n"); /* GetLastError() varies between win9x and WinNT and also depends on the filesystem */ if ( hmap ) CloseHandle( hmap ); - hmap = CreateFileMapping( handle, NULL, PAGE_READWRITE, 0x80000000, 0x10000, NULL ); + hmap = CreateFileMappingA( handle, NULL, PAGE_READWRITE, 0x80000000, 0x10000, NULL ); ok( hmap == NULL || broken(hmap != NULL) /* NT4 */, "mapping should fail\n"); /* GetLastError() varies between win9x and WinNT and also depends on the filesystem */ if ( hmap ) @@ -2352,7 +2686,7 @@ static void test_MapFile(void) static void test_GetFileType(void) { - DWORD type; + DWORD type, type2; HANDLE h = CreateFileA( filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0 ); ok( h != INVALID_HANDLE_VALUE, "open %s failed\n", filename ); type = GetFileType(h); @@ -2364,6 +2698,11 @@ static void test_GetFileType(void) ok( type == FILE_TYPE_CHAR, "expected type char for nul got %d\n", type ); CloseHandle( h ); DeleteFileA( filename ); + h = GetStdHandle( STD_OUTPUT_HANDLE ); + ok( h != INVALID_HANDLE_VALUE, "GetStdHandle failed\n" ); + type = GetFileType( (HANDLE)STD_OUTPUT_HANDLE ); + type2 = GetFileType( h ); + ok(type == type2, "expected type %d for STD_OUTPUT_HANDLE got %d\n", type2, type); } static int completion_count; @@ -2830,7 +3169,7 @@ static void test_overlapped(void) ok( result == 0, "wrong result %u\n", result ); SetLastError( 0xb00 ); - ov.hEvent = CreateEvent( NULL, 1, 1, NULL ); + ov.hEvent = CreateEventW( NULL, 1, 1, NULL ); ov.Internal = STATUS_PENDING; ov.InternalHigh = 0xabcd; r = GetOverlappedResult(0, &ov, &result, 0); @@ -2857,19 +3196,19 @@ static void test_RemoveDirectory(void) int rc; char directory[] = "removeme"; - rc = CreateDirectory(directory, NULL); + rc = CreateDirectoryA(directory, NULL); ok( rc, "Createdirectory failed, gle=%d\n", GetLastError() ); - rc = SetCurrentDirectory(directory); + rc = SetCurrentDirectoryA(directory); ok( rc, "SetCurrentDirectory failed, gle=%d\n", GetLastError() ); - rc = RemoveDirectory("."); + rc = RemoveDirectoryA("."); if (!rc) { - rc = SetCurrentDirectory(".."); + rc = SetCurrentDirectoryA(".."); ok( rc, "SetCurrentDirectory failed, gle=%d\n", GetLastError() ); - rc = RemoveDirectory(directory); + rc = RemoveDirectoryA(directory); ok( rc, "RemoveDirectory failed, gle=%d\n", GetLastError() ); } } @@ -3179,7 +3518,7 @@ static void test_ReplaceFileW(void) } } -static void test_CreatFile(void) +static void test_CreateFile(void) { static const struct test_data { @@ -3211,20 +3550,61 @@ static void test_CreatFile(void) /* 22*/ { TRUNCATE_EXISTING, 0, ERROR_INVALID_PARAMETER, 0 }, /* 23*/ { TRUNCATE_EXISTING, GENERIC_READ, ERROR_INVALID_PARAMETER, 0 }, /* 24*/ { TRUNCATE_EXISTING, GENERIC_WRITE, 0, 0 }, - /* 25*/ { TRUNCATE_EXISTING, GENERIC_READ|GENERIC_WRITE, 0, 0 } + /* 25*/ { TRUNCATE_EXISTING, GENERIC_READ|GENERIC_WRITE, 0, 0 }, + /* 26*/ { TRUNCATE_EXISTING, FILE_WRITE_DATA, ERROR_INVALID_PARAMETER, 0 } }; char temp_path[MAX_PATH]; char file_name[MAX_PATH]; DWORD i, ret, written; HANDLE hfile; - GetTempPath(MAX_PATH, temp_path); - GetTempFileName(temp_path, "tmp", 0, file_name); + GetTempPathA(MAX_PATH, temp_path); + GetTempFileNameA(temp_path, "tmp", 0, file_name); + + i = strlen(temp_path); + if (i && temp_path[i - 1] == '\\') temp_path[i - 1] = 0; + + for (i = 0; i <= 5; i++) + { + SetLastError(0xdeadbeef); + hfile = CreateFileA(temp_path, GENERIC_READ, 0, NULL, i, 0, 0); + ok(hfile == INVALID_HANDLE_VALUE, "CreateFile should fail\n"); + if (i == 0 || i == 5) + { +/* FIXME: remove once Wine is fixed */ +if (i == 5) todo_wine + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); +else + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); + } + else + { +/* FIXME: remove once Wine is fixed */ +if (i == 1) todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); +else + ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); + } + + SetLastError(0xdeadbeef); + hfile = CreateFileA(temp_path, GENERIC_WRITE, 0, NULL, i, 0, 0); + ok(hfile == INVALID_HANDLE_VALUE, "CreateFile should fail\n"); + if (i == 0) + ok(GetLastError() == ERROR_INVALID_PARAMETER, "%d: expected ERROR_INVALID_PARAMETER, got %d\n", i, GetLastError()); + else + { +/* FIXME: remove once Wine is fixed */ +if (i == 1) todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); +else + ok(GetLastError() == ERROR_ACCESS_DENIED, "%d: expected ERROR_ACCESS_DENIED, got %d\n", i, GetLastError()); + } + } for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { SetLastError(0xdeadbeef); - hfile = CreateFile(file_name, td[i].access, 0, NULL, td[i].disposition, 0, 0); + hfile = CreateFileA(file_name, td[i].access, 0, NULL, td[i].disposition, 0, 0); if (!td[i].error) { ok(hfile != INVALID_HANDLE_VALUE, "%d: CreateFile error %d\n", i, GetLastError()); @@ -3232,7 +3612,7 @@ static void test_CreatFile(void) SetLastError(0xdeadbeef); ret = WriteFile(hfile, &td[i].error, sizeof(td[i].error), &written, NULL); if (td[i].access & GENERIC_WRITE) - ok(ret, "%d: WriteFile error %d\n", i, GetLastError()); + ok(ret, "%d: WriteFile error %d\n", i, GetLastError()); else { ok(!ret, "%d: WriteFile should fail\n", i); @@ -3259,10 +3639,10 @@ static void test_CreatFile(void) } } - if (td[i].clean_up) DeleteFile(file_name); + if (td[i].clean_up) DeleteFileA(file_name); } - DeleteFile(file_name); + DeleteFileA(file_name); } static void test_GetFileInformationByHandleEx(void) @@ -3335,7 +3715,7 @@ static void test_GetFileInformationByHandleEx(void) } CloseHandle(directory); - DeleteFile(tempFileName); + DeleteFileA(tempFileName); } static void test_OpenFileById(void) @@ -3439,7 +3819,7 @@ static void test_OpenFileById(void) CloseHandle(handle); CloseHandle(directory); - DeleteFile(tempFileName); + DeleteFileA(tempFileName); } static void test_SetFileValidData(void) @@ -3503,12 +3883,13 @@ static void test_SetFileValidData(void) privs.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token) || - !LookupPrivilegeValue(NULL, SE_MANAGE_VOLUME_NAME, &privs.Privileges[0].Luid) || + !LookupPrivilegeValueA(NULL, SE_MANAGE_VOLUME_NAME, &privs.Privileges[0].Luid) || !AdjustTokenPrivileges(token, FALSE, &privs, sizeof(privs), NULL, NULL) || GetLastError() == ERROR_NOT_ALL_ASSIGNED) { win_skip("cannot enable SE_MANAGE_VOLUME_NAME privilege\n"); CloseHandle(token); + DeleteFileA(filename); return; } handle = CreateFileA(filename, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); @@ -3572,8 +3953,139 @@ static void test_SetFileValidData(void) privs.Privileges[0].Attributes = 0; AdjustTokenPrivileges(token, FALSE, &privs, sizeof(privs), NULL, NULL); + CloseHandle(token); - DeleteFile(filename); + CloseHandle(handle); + DeleteFileA(filename); +} + +static unsigned file_map_access(unsigned access) +{ + if (access & GENERIC_READ) access |= FILE_GENERIC_READ; + if (access & GENERIC_WRITE) access |= FILE_GENERIC_WRITE; + if (access & GENERIC_EXECUTE) access |= FILE_GENERIC_EXECUTE; + if (access & GENERIC_ALL) access |= FILE_ALL_ACCESS; + return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL); +} + +static BOOL is_access_compatible(unsigned obj_access, unsigned desired_access) +{ + obj_access = file_map_access(obj_access); + desired_access = file_map_access(desired_access); + return (obj_access & desired_access) == desired_access; +} + +static void test_file_access(void) +{ + static const struct + { + unsigned access, create_error, write_error, read_error; + } td[] = + { + { GENERIC_READ | GENERIC_WRITE, 0, 0, 0 }, + { GENERIC_WRITE, 0, 0, ERROR_ACCESS_DENIED }, + { GENERIC_READ, 0, ERROR_ACCESS_DENIED, 0 }, + { FILE_READ_DATA | FILE_WRITE_DATA, 0, 0, 0 }, + { FILE_WRITE_DATA, 0, 0, ERROR_ACCESS_DENIED }, + { FILE_READ_DATA, 0, ERROR_ACCESS_DENIED, 0 }, + { FILE_APPEND_DATA, 0, 0, ERROR_ACCESS_DENIED }, + { FILE_READ_DATA | FILE_APPEND_DATA, 0, 0, 0 }, + { FILE_WRITE_DATA | FILE_APPEND_DATA, 0, 0, ERROR_ACCESS_DENIED }, + { 0, 0, ERROR_ACCESS_DENIED, ERROR_ACCESS_DENIED }, + }; + char path[MAX_PATH], fname[MAX_PATH]; + unsigned char buf[16]; + HANDLE hfile, hdup; + DWORD i, j, ret, bytes; + + GetTempPathA(MAX_PATH, path); + GetTempFileNameA(path, "foo", 0, fname); + + for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) + { + SetLastError(0xdeadbeef); + hfile = CreateFileA(fname, td[i].access, 0, NULL, CREATE_ALWAYS, + FILE_FLAG_DELETE_ON_CLOSE, 0); + if (td[i].create_error) + { + ok(hfile == INVALID_HANDLE_VALUE, "%d: CreateFile should fail\n", i); + ok(td[i].create_error == GetLastError(), "%d: expected %d, got %d\n", i, td[i].create_error, GetLastError()); + continue; + } + else + ok(hfile != INVALID_HANDLE_VALUE, "%d: CreateFile error %d\n", i, GetLastError()); + + for (j = 0; j < sizeof(td)/sizeof(td[0]); j++) + { + SetLastError(0xdeadbeef); + ret = DuplicateHandle(GetCurrentProcess(), hfile, GetCurrentProcess(), &hdup, + td[j].access, 0, 0); + if (is_access_compatible(td[i].access, td[j].access)) + ok(ret, "DuplicateHandle(%#x => %#x) error %d\n", td[i].access, td[j].access, GetLastError()); + else + { + /* FIXME: Remove once Wine is fixed */ + if ((td[j].access & (GENERIC_READ | GENERIC_WRITE)) || + (!(td[i].access & (GENERIC_WRITE | FILE_WRITE_DATA)) && (td[j].access & FILE_WRITE_DATA)) || + (!(td[i].access & (GENERIC_READ | FILE_READ_DATA)) && (td[j].access & FILE_READ_DATA)) || + (!(td[i].access & (GENERIC_WRITE)) && (td[j].access & FILE_APPEND_DATA))) + { +todo_wine + ok(!ret, "DuplicateHandle(%#x => %#x) should fail\n", td[i].access, td[j].access); +todo_wine + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + } + else + { + ok(!ret, "DuplicateHandle(%#x => %#x) should fail\n", td[i].access, td[j].access); + ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); + } + } + if (ret) CloseHandle(hdup); + } + + SetLastError(0xdeadbeef); + bytes = 0xdeadbeef; + ret = WriteFile(hfile, "\x5e\xa7", 2, &bytes, NULL); + if (td[i].write_error) + { + ok(!ret, "%d: WriteFile should fail\n", i); + ok(td[i].write_error == GetLastError(), "%d: expected %d, got %d\n", i, td[i].write_error, GetLastError()); + ok(bytes == 0, "%d: expected 0, got %u\n", i, bytes); + } + else + { + ok(ret, "%d: WriteFile error %d\n", i, GetLastError()); + ok(bytes == 2, "%d: expected 2, got %u\n", i, bytes); + } + + SetLastError(0xdeadbeef); + ret = SetFilePointer(hfile, 0, NULL, FILE_BEGIN); + ok(ret != INVALID_SET_FILE_POINTER, "SetFilePointer error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + bytes = 0xdeadbeef; + ret = ReadFile(hfile, buf, sizeof(buf), &bytes, NULL); + if (td[i].read_error) + { + ok(!ret, "%d: ReadFile should fail\n", i); + ok(td[i].read_error == GetLastError(), "%d: expected %d, got %d\n", i, td[i].read_error, GetLastError()); + ok(bytes == 0, "%d: expected 0, got %u\n", i, bytes); + } + else + { + ok(ret, "%d: ReadFile error %d\n", i, GetLastError()); + if (td[i].write_error) + ok(bytes == 0, "%d: expected 0, got %u\n", i, bytes); + else + { + ok(bytes == 2, "%d: expected 2, got %u\n", i, bytes); + ok(buf[0] == 0x5e && buf[1] == 0xa7, "%d: expected 5ea7, got %02x%02x\n", i, buf[0], buf[1]); + } + } + + CloseHandle(hfile); + } } START_TEST(file) @@ -3591,9 +4103,11 @@ START_TEST(file) test_GetTempFileNameA(); test_CopyFileA(); test_CopyFileW(); - test_CreatFile(); + test_CopyFile2(); + test_CreateFile(); test_CreateFileA(); test_CreateFileW(); + test_CreateFile2(); test_DeleteFileA(); test_DeleteFileW(); test_MoveFileA(); @@ -3618,4 +4132,5 @@ START_TEST(file) test_GetFileInformationByHandleEx(); test_OpenFileById(); test_SetFileValidData(); + test_file_access(); } diff --git a/rostests/winetests/kernel32/format_msg.c b/rostests/winetests/kernel32/format_msg.c index 005e6c4a66c..e98e08372d1 100755 --- a/rostests/winetests/kernel32/format_msg.c +++ b/rostests/winetests/kernel32/format_msg.c @@ -1543,7 +1543,7 @@ static void test_message_from_hmodule(void) HMODULE h; CHAR out[0x100] = {0}; - h = GetModuleHandle("kernel32.dll"); + h = GetModuleHandleA("kernel32.dll"); ok(h != 0, "GetModuleHandle failed\n"); /*Test existing messageID; as the message strings from wine's kernel32 differ from windows' kernel32 we don't compare diff --git a/rostests/winetests/kernel32/heap.c b/rostests/winetests/kernel32/heap.c index e36336cdd14..a36c373c1a7 100755 --- a/rostests/winetests/kernel32/heap.c +++ b/rostests/winetests/kernel32/heap.c @@ -1,6 +1,7 @@ /* * Unit test suite for heap functions * + * Copyright 2002 Geoffrey Hausheer * Copyright 2003 Dimitrie O. Paun * Copyright 2006 Detlef Riekenberg * @@ -56,7 +57,7 @@ static SIZE_T resize_9x(SIZE_T size) static void test_sized_HeapAlloc(int nbytes) { - int success; + BOOL success; char *buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nbytes); ok(buf != NULL, "allocate failed\n"); ok(buf[0] == 0, "buffer not zeroed\n"); @@ -66,7 +67,7 @@ static void test_sized_HeapAlloc(int nbytes) static void test_sized_HeapReAlloc(int nbytes1, int nbytes2) { - int success; + BOOL success; char *buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nbytes1); ok(buf != NULL, "allocate failed\n"); ok(buf[0] == 0, "buffer not zeroed\n"); @@ -480,6 +481,278 @@ static void test_heap(void) } + +static void test_HeapCreate(void) +{ + SYSTEM_INFO sysInfo; + ULONG memchunk; + HANDLE heap; + LPVOID mem1,mem1a,mem3; + UCHAR *mem2,*mem2a; + UINT i; + BOOL error; + DWORD dwSize; + + /* Retrieve the page size for this system */ + GetSystemInfo(&sysInfo); + ok(sysInfo.dwPageSize>0,"GetSystemInfo should return a valid page size\n"); + + /* Create a Heap with a minimum and maximum size */ + /* Note that Windows and Wine seem to behave a bit differently with respect + to memory allocation. In Windows, you can't access all the memory + specified in the heap (due to overhead), so choosing a reasonable maximum + size for the heap was done mostly by trial-and-error on Win2k. It may need + more tweaking for otherWindows variants. + */ + memchunk=10*sysInfo.dwPageSize; + heap=HeapCreate(0,2*memchunk,5*memchunk); + ok( !((ULONG_PTR)heap & 0xffff), "heap %p not 64K aligned\n", heap ); + + /* Check that HeapCreate allocated the right amount of ram */ + mem1=HeapAlloc(heap,0,5*memchunk+1); + ok(mem1==NULL,"HeapCreate allocated more Ram than it should have\n"); + HeapFree(heap,0,mem1); + + /* Check that a normal alloc works */ + mem1=HeapAlloc(heap,0,memchunk); + ok(mem1!=NULL,"HeapAlloc failed\n"); + if(mem1) { + ok(HeapSize(heap,0,mem1)>=memchunk, "HeapAlloc should return a big enough memory block\n"); + } + + /* Check that a 'zeroing' alloc works */ + mem2=HeapAlloc(heap,HEAP_ZERO_MEMORY,memchunk); + ok(mem2!=NULL,"HeapAlloc failed\n"); + if(mem2) { + ok(HeapSize(heap,0,mem2)>=memchunk,"HeapAlloc should return a big enough memory block\n"); + error=FALSE; + for(i=0;i=memchunk+5*sysInfo.dwPageSize,"HeapReAlloc failed\n"); + error=FALSE; + for(i=0;i<5*sysInfo.dwPageSize;i++) { + if(mem2a[memchunk+i]!=0) { + error=TRUE; + } + } + ok(!error,"HeapReAlloc should have zeroed out its allocated memory\n"); + } + + /* Check that HeapRealloc honours HEAP_REALLOC_IN_PLACE_ONLY */ + error=FALSE; + mem1a=HeapReAlloc(heap,HEAP_REALLOC_IN_PLACE_ONLY,mem1,memchunk+sysInfo.dwPageSize); + if(mem1a!=NULL) { + if(mem1a!=mem1) { + error=TRUE; + } + } + ok(mem1a==NULL || !error,"HeapReAlloc didn't honour HEAP_REALLOC_IN_PLACE_ONLY\n"); + + /* Check that HeapFree works correctly */ + if(mem1a) { + ok(HeapFree(heap,0,mem1a),"HeapFree failed\n"); + } else { + ok(HeapFree(heap,0,mem1),"HeapFree failed\n"); + } + if(mem2a) { + ok(HeapFree(heap,0,mem2a),"HeapFree failed\n"); + } else { + ok(HeapFree(heap,0,mem2),"HeapFree failed\n"); + } + + /* 0-length buffer */ + mem1 = HeapAlloc(heap, 0, 0); + ok(mem1 != NULL, "Reserved memory\n"); + + dwSize = HeapSize(heap, 0, mem1); + /* should work with 0-length buffer */ + ok(dwSize < 0xFFFFFFFF, "The size of the 0-length buffer\n"); + ok(HeapFree(heap, 0, mem1), "Freed the 0-length buffer\n"); + + /* Check that HeapDestroy works */ + ok(HeapDestroy(heap),"HeapDestroy failed\n"); +} + + +static void test_GlobalAlloc(void) +{ + ULONG memchunk; + HGLOBAL mem1,mem2,mem2a,mem2b; + UCHAR *mem2ptr; + UINT i; + BOOL error; + memchunk=100000; + + SetLastError(NO_ERROR); + /* Check that a normal alloc works */ + mem1=GlobalAlloc(0,memchunk); + ok(mem1!=NULL,"GlobalAlloc failed\n"); + if(mem1) { + ok(GlobalSize(mem1)>=memchunk, "GlobalAlloc should return a big enough memory block\n"); + } + + /* Check that a 'zeroing' alloc works */ + mem2=GlobalAlloc(GMEM_ZEROINIT,memchunk); + ok(mem2!=NULL,"GlobalAlloc failed: error=%d\n",GetLastError()); + if(mem2) { + ok(GlobalSize(mem2)>=memchunk,"GlobalAlloc should return a big enough memory block\n"); + mem2ptr=GlobalLock(mem2); + ok(mem2ptr==mem2,"GlobalLock should have returned the same memory as was allocated\n"); + if(mem2ptr) { + error=FALSE; + for(i=0;i=2*memchunk,"GlobalReAlloc failed\n"); + mem2ptr=GlobalLock(mem2a); + ok(mem2ptr!=NULL,"GlobalLock Failed\n"); + if(mem2ptr) { + error=FALSE; + for(i=0;i=memchunk, "LocalAlloc should return a big enough memory block\n"); + } + + /* Check that a 'zeroing' and lock alloc works */ + mem2=LocalAlloc(LMEM_ZEROINIT|LMEM_MOVEABLE,memchunk); + ok(mem2!=NULL,"LocalAlloc failed: error=%d\n",GetLastError()); + if(mem2) { + ok(LocalSize(mem2)>=memchunk,"LocalAlloc should return a big enough memory block\n"); + mem2ptr=LocalLock(mem2); + ok(mem2ptr!=NULL,"LocalLock: error=%d\n",GetLastError()); + if(mem2ptr) { + error=FALSE; + for(i=0;i=2*memchunk,"LocalReAlloc failed\n"); + mem2ptr=LocalLock(mem2a); + ok(mem2ptr!=NULL,"LocalLock Failed\n"); + if(mem2ptr) { + error=FALSE; + for(i=0;i #include #include @@ -28,6 +29,10 @@ #include "winbase.h" #include "winternl.h" #include "wine/test.h" +#include "delayloadhandler.h" + +/* PROCESS_ALL_ACCESS in Vista+ PSDKs is incompatible with older Windows versions */ +#define PROCESS_ALL_ACCESS_NT4 (PROCESS_ALL_ACCESS & ~0xf000) #define ALIGN_SIZE(size, alignment) (((size) + (alignment - 1)) & ~((alignment - 1))) @@ -41,9 +46,12 @@ struct PROCESS_BASIC_INFORMATION_PRIVATE ULONG_PTR InheritedFromUniqueProcessId; }; -static BOOL is_child; static LONG *child_failures; +static WORD cb_count; +static DWORD page_size; +static NTSTATUS (WINAPI *pNtCreateSection)(HANDLE *, ACCESS_MASK, const OBJECT_ATTRIBUTES *, + const LARGE_INTEGER *, ULONG, ULONG, HANDLE ); static NTSTATUS (WINAPI *pNtMapViewOfSection)(HANDLE, HANDLE, PVOID *, ULONG, SIZE_T, const LARGE_INTEGER *, SIZE_T *, ULONG, ULONG, ULONG); static NTSTATUS (WINAPI *pNtUnmapViewOfSection)(HANDLE, PVOID); static NTSTATUS (WINAPI *pNtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG, PULONG); @@ -57,6 +65,9 @@ static NTSTATUS (WINAPI *pLdrLockLoaderLock)(ULONG, ULONG *, ULONG *); static NTSTATUS (WINAPI *pLdrUnlockLoaderLock)(ULONG, ULONG); static void (WINAPI *pRtlAcquirePebLock)(void); static void (WINAPI *pRtlReleasePebLock)(void); +static PVOID (WINAPI *pResolveDelayLoadedAPI)(PVOID, PCIMAGE_DELAYLOAD_DESCRIPTOR, + PDELAYLOAD_FAILURE_DLL_CALLBACK, PVOID, + PIMAGE_THUNK_DATA ThunkAddress,ULONG); static PVOID RVAToAddr(DWORD_PTR rva, HMODULE module) { @@ -65,15 +76,7 @@ static PVOID RVAToAddr(DWORD_PTR rva, HMODULE module) return ((char*) module) + rva; } -static const struct -{ - WORD e_magic; /* 00: MZ Header signature */ - WORD unused[29]; - DWORD e_lfanew; /* 3c: Offset to extended header */ -} dos_header = -{ - IMAGE_DOS_SIGNATURE, { 0 }, sizeof(dos_header) -}; +static IMAGE_DOS_HEADER dos_header; static IMAGE_NT_HEADERS nt_header = { @@ -149,11 +152,107 @@ static IMAGE_SECTION_HEADER section = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ, /* Characteristics */ }; + +static const char filler[0x1000]; +static const char section_data[0x10] = "section data"; + +static DWORD create_test_dll( const IMAGE_DOS_HEADER *dos_header, UINT dos_size, + const IMAGE_NT_HEADERS *nt_header, const char *dll_name ) +{ + DWORD dummy, size, file_align; + HANDLE hfile; + BOOL ret; + + hfile = CreateFileA(dll_name, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, 0); + if (hfile == INVALID_HANDLE_VALUE) return 0; + + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, dos_header, dos_size, &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, nt_header, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + if (nt_header->FileHeader.SizeOfOptionalHeader) + { + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, &nt_header->OptionalHeader, + min(nt_header->FileHeader.SizeOfOptionalHeader, sizeof(IMAGE_OPTIONAL_HEADER)), + &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + if (nt_header->FileHeader.SizeOfOptionalHeader > sizeof(IMAGE_OPTIONAL_HEADER)) + { + file_align = nt_header->FileHeader.SizeOfOptionalHeader - sizeof(IMAGE_OPTIONAL_HEADER); + assert(file_align < sizeof(filler)); + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, filler, file_align, &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + } + } + + assert(nt_header->FileHeader.NumberOfSections <= 1); + if (nt_header->FileHeader.NumberOfSections) + { + if (nt_header->OptionalHeader.SectionAlignment >= page_size) + { + section.PointerToRawData = dos_size; + section.VirtualAddress = nt_header->OptionalHeader.SectionAlignment; + section.Misc.VirtualSize = section.SizeOfRawData * 10; + } + else + { + section.PointerToRawData = nt_header->OptionalHeader.SizeOfHeaders; + section.VirtualAddress = nt_header->OptionalHeader.SizeOfHeaders; + section.Misc.VirtualSize = 5; + } + + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, §ion, sizeof(section), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + /* section data */ + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, section_data, sizeof(section_data), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + } + size = GetFileSize(hfile, NULL); + CloseHandle(hfile); + return size; +} + +/* helper to test image section mapping */ +static NTSTATUS map_image_section( const IMAGE_NT_HEADERS *nt_header ) +{ + char temp_path[MAX_PATH]; + char dll_name[MAX_PATH]; + LARGE_INTEGER size; + HANDLE file, map; + NTSTATUS status; + + GetTempPathA(MAX_PATH, temp_path); + GetTempFileNameA(temp_path, "ldr", 0, dll_name); + + size.u.LowPart = create_test_dll( &dos_header, sizeof(dos_header), nt_header, dll_name ); + ok( size.u.LowPart, "could not create %s\n", dll_name); + size.u.HighPart = 0; + + file = CreateFileA(dll_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); + ok(file != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + + status = pNtCreateSection(&map, STANDARD_RIGHTS_REQUIRED | SECTION_MAP_READ, NULL, &size, + PAGE_READONLY, SEC_IMAGE, file ); + if (map) CloseHandle( map ); + CloseHandle( file ); + DeleteFileA( dll_name ); + return status; +} + + static void test_Loader(void) { static const struct test_data { - const void *dos_header; DWORD size_of_dos_header; WORD number_of_sections, size_of_optional_header; DWORD section_alignment, file_alignment; @@ -161,47 +260,47 @@ static void test_Loader(void) DWORD errors[4]; /* 0 means LoadLibrary should succeed */ } td[] = { - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 1, 0, 0, 0, 0, 0, { ERROR_BAD_EXE_FORMAT } }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 1, sizeof(IMAGE_OPTIONAL_HEADER), 0x1000, 0x1000, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER) + 0xe00, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER), { ERROR_BAD_EXE_FORMAT } /* XP doesn't like too small image size */ }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 1, sizeof(IMAGE_OPTIONAL_HEADER), 0x1000, 0x1000, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER) + 0x1000, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER), { ERROR_SUCCESS } }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 1, sizeof(IMAGE_OPTIONAL_HEADER), 0x1000, 0x1000, 0x1f00, 0x1000, { ERROR_SUCCESS } }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 1, sizeof(IMAGE_OPTIONAL_HEADER), 0x200, 0x200, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER) + 0x200, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER), { ERROR_SUCCESS, ERROR_INVALID_ADDRESS } /* vista is more strict */ }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 1, sizeof(IMAGE_OPTIONAL_HEADER), 0x200, 0x1000, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER) + 0x1000, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER), { ERROR_BAD_EXE_FORMAT } /* XP doesn't like alignments */ }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 1, sizeof(IMAGE_OPTIONAL_HEADER), 0x1000, 0x200, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER) + 0x1000, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER), { ERROR_SUCCESS } }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 1, sizeof(IMAGE_OPTIONAL_HEADER), 0x1000, 0x200, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER) + 0x1000, 0x200, @@ -210,66 +309,66 @@ static void test_Loader(void) /* Mandatory are all fields up to SizeOfHeaders, everything else * is really optional (at least that's true for XP). */ - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 1, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 0x200, 0x200, sizeof(dos_header) + sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER) + FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum) + sizeof(IMAGE_SECTION_HEADER) + 0x10, sizeof(dos_header) + sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER) + FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum) + sizeof(IMAGE_SECTION_HEADER), { ERROR_SUCCESS, ERROR_BAD_EXE_FORMAT, ERROR_INVALID_ADDRESS, ERROR_NOACCESS } }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 0x200, 0x200, 0xd0, /* beyond of the end of file */ 0xc0, /* beyond of the end of file */ { ERROR_SUCCESS, ERROR_BAD_EXE_FORMAT } /* vista is more strict */ }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 0x200, 0x200, 0x1000, 0, { ERROR_SUCCESS, ERROR_BAD_EXE_FORMAT } /* vista is more strict */ }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 0x200, 0x200, 1, 0, { ERROR_SUCCESS, ERROR_BAD_EXE_FORMAT } /* vista is more strict */ }, #if 0 /* not power of 2 alignments need more test cases */ - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 0x300, 0x300, 1, 0, { ERROR_BAD_EXE_FORMAT } /* alignment is not power of 2 */ }, #endif - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 4, 4, 1, 0, { ERROR_SUCCESS, ERROR_BAD_EXE_FORMAT } /* vista is more strict */ }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 1, 1, 1, 0, { ERROR_SUCCESS, ERROR_BAD_EXE_FORMAT } /* vista is more strict */ }, - { &dos_header, sizeof(dos_header), + { sizeof(dos_header), 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 0x200, 0x200, 0, 0, { ERROR_BAD_EXE_FORMAT } /* image size == 0 -> failure */ }, /* the following data mimics the PE image which upack creates */ - { &dos_header, 0x10, + { 0x10, 1, 0x148, 0x1000, 0x200, sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER) + 0x1000, 0x200, { ERROR_SUCCESS } }, /* Minimal PE image that XP is able to load: 92 bytes */ - { &dos_header, 0x04, + { 0x04, 0, FIELD_OFFSET(IMAGE_OPTIONAL_HEADER, CheckSum), 0x04 /* also serves as e_lfanew in the truncated MZ header */, 0x04, 1, @@ -277,40 +376,24 @@ static void test_Loader(void) { ERROR_SUCCESS, ERROR_BAD_EXE_FORMAT } /* vista is more strict */ } }; - static const char filler[0x1000]; - static const char section_data[0x10] = "section data"; int i; - DWORD dummy, file_size, file_align; - HANDLE hfile; + DWORD file_size; HMODULE hlib, hlib_as_data_file; - SYSTEM_INFO si; char temp_path[MAX_PATH]; char dll_name[MAX_PATH]; SIZE_T size; BOOL ret; - - GetSystemInfo(&si); + NTSTATUS status; + WORD orig_machine = nt_header.FileHeader.Machine; /* prevent displaying of the "Unable to load this DLL" message box */ SetErrorMode(SEM_FAILCRITICALERRORS); - GetTempPath(MAX_PATH, temp_path); + GetTempPathA(MAX_PATH, temp_path); for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { - GetTempFileName(temp_path, "ldr", 0, dll_name); - - /*trace("creating %s\n", dll_name);*/ - hfile = CreateFileA(dll_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); - if (hfile == INVALID_HANDLE_VALUE) - { - ok(0, "could not create %s\n", dll_name); - break; - } - - SetLastError(0xdeadbeef); - ret = WriteFile(hfile, td[i].dos_header, td[i].size_of_dos_header, &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); + GetTempFileNameA(temp_path, "ldr", 0, dll_name); nt_header.FileHeader.NumberOfSections = td[i].number_of_sections; nt_header.FileHeader.SizeOfOptionalHeader = td[i].size_of_optional_header; @@ -319,58 +402,16 @@ static void test_Loader(void) nt_header.OptionalHeader.FileAlignment = td[i].file_alignment; nt_header.OptionalHeader.SizeOfImage = td[i].size_of_image; nt_header.OptionalHeader.SizeOfHeaders = td[i].size_of_headers; - SetLastError(0xdeadbeef); - ret = WriteFile(hfile, &nt_header, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); - if (nt_header.FileHeader.SizeOfOptionalHeader) + file_size = create_test_dll( &dos_header, td[i].size_of_dos_header, &nt_header, dll_name ); + if (!file_size) { - SetLastError(0xdeadbeef); - ret = WriteFile(hfile, &nt_header.OptionalHeader, - min(nt_header.FileHeader.SizeOfOptionalHeader, sizeof(IMAGE_OPTIONAL_HEADER)), - &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); - if (nt_header.FileHeader.SizeOfOptionalHeader > sizeof(IMAGE_OPTIONAL_HEADER)) - { - file_align = nt_header.FileHeader.SizeOfOptionalHeader - sizeof(IMAGE_OPTIONAL_HEADER); - assert(file_align < sizeof(filler)); - SetLastError(0xdeadbeef); - ret = WriteFile(hfile, filler, file_align, &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); - } + ok(0, "could not create %s\n", dll_name); + break; } - assert(nt_header.FileHeader.NumberOfSections <= 1); - if (nt_header.FileHeader.NumberOfSections) - { - if (nt_header.OptionalHeader.SectionAlignment >= si.dwPageSize) - { - section.PointerToRawData = td[i].size_of_dos_header; - section.VirtualAddress = nt_header.OptionalHeader.SectionAlignment; - section.Misc.VirtualSize = section.SizeOfRawData * 10; - } - else - { - section.PointerToRawData = nt_header.OptionalHeader.SizeOfHeaders; - section.VirtualAddress = nt_header.OptionalHeader.SizeOfHeaders; - section.Misc.VirtualSize = 5; - } - - SetLastError(0xdeadbeef); - ret = WriteFile(hfile, §ion, sizeof(section), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); - - /* section data */ - SetLastError(0xdeadbeef); - ret = WriteFile(hfile, section_data, sizeof(section_data), &dummy, NULL); - ok(ret, "WriteFile error %d\n", GetLastError()); - } - - file_size = GetFileSize(hfile, NULL); - CloseHandle(hfile); - SetLastError(0xdeadbeef); - hlib = LoadLibrary(dll_name); + hlib = LoadLibraryA(dll_name); if (hlib) { MEMORY_BASIC_INFORMATION info; @@ -385,17 +426,17 @@ static void test_Loader(void) ok(info.BaseAddress == hlib, "%d: %p != %p\n", i, info.BaseAddress, hlib); ok(info.AllocationBase == hlib, "%d: %p != %p\n", i, info.AllocationBase, hlib); ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); - ok(info.RegionSize == ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize), "%d: got %lx != expected %x\n", - i, info.RegionSize, ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize)); + ok(info.RegionSize == ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size), "%d: got %lx != expected %x\n", + i, info.RegionSize, ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size)); ok(info.State == MEM_COMMIT, "%d: %x != MEM_COMMIT\n", i, info.State); - if (nt_header.OptionalHeader.SectionAlignment < si.dwPageSize) + if (nt_header.OptionalHeader.SectionAlignment < page_size) ok(info.Protect == PAGE_EXECUTE_WRITECOPY, "%d: %x != PAGE_EXECUTE_WRITECOPY\n", i, info.Protect); else ok(info.Protect == PAGE_READONLY, "%d: %x != PAGE_READONLY\n", i, info.Protect); ok(info.Type == SEC_IMAGE, "%d: %x != SEC_IMAGE\n", i, info.Type); SetLastError(0xdeadbeef); - ptr = VirtualAlloc(hlib, si.dwPageSize, MEM_COMMIT, info.Protect); + ptr = VirtualAlloc(hlib, page_size, MEM_COMMIT, info.Protect); ok(!ptr, "%d: VirtualAlloc should fail\n", i); /* FIXME: Remove once Wine is fixed */ if (info.Protect == PAGE_WRITECOPY || info.Protect == PAGE_EXECUTE_WRITECOPY) @@ -408,11 +449,11 @@ todo_wine size = VirtualQuery((char *)hlib + info.RegionSize, &info, sizeof(info)); ok(size == sizeof(info), "%d: VirtualQuery error %d\n", i, GetLastError()); - if (nt_header.OptionalHeader.SectionAlignment == si.dwPageSize || + if (nt_header.OptionalHeader.SectionAlignment == page_size || nt_header.OptionalHeader.SectionAlignment == nt_header.OptionalHeader.FileAlignment) { - ok(info.BaseAddress == (char *)hlib + ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize), "%d: got %p != expected %p\n", - i, info.BaseAddress, (char *)hlib + ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize)); + ok(info.BaseAddress == (char *)hlib + ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size), "%d: got %p != expected %p\n", + i, info.BaseAddress, (char *)hlib + ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size)); ok(info.AllocationBase == 0, "%d: %p != 0\n", i, info.AllocationBase); ok(info.AllocationProtect == 0, "%d: %x != 0\n", i, info.AllocationProtect); /*ok(info.RegionSize == not_practical_value, "%d: %lx != not_practical_value\n", i, info.RegionSize);*/ @@ -426,20 +467,20 @@ todo_wine ok(info.BaseAddress == hlib, "%d: got %p != expected %p\n", i, info.BaseAddress, hlib); ok(info.AllocationBase == hlib, "%d: %p != %p\n", i, info.AllocationBase, hlib); ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); - ok(info.RegionSize == ALIGN_SIZE(file_size, si.dwPageSize), "%d: got %lx != expected %x\n", - i, info.RegionSize, ALIGN_SIZE(file_size, si.dwPageSize)); + ok(info.RegionSize == ALIGN_SIZE(file_size, page_size), "%d: got %lx != expected %x\n", + i, info.RegionSize, ALIGN_SIZE(file_size, page_size)); ok(info.State == MEM_COMMIT, "%d: %x != MEM_COMMIT\n", i, info.State); ok(info.Protect == PAGE_READONLY, "%d: %x != PAGE_READONLY\n", i, info.Protect); ok(info.Type == SEC_IMAGE, "%d: %x != SEC_IMAGE\n", i, info.Type); } /* header: check the zeroing of alignment */ - if (nt_header.OptionalHeader.SectionAlignment >= si.dwPageSize) + if (nt_header.OptionalHeader.SectionAlignment >= page_size) { const char *start; start = (const char *)hlib + nt_header.OptionalHeader.SizeOfHeaders; - size = ALIGN_SIZE((ULONG_PTR)start, si.dwPageSize) - (ULONG_PTR)start; + size = ALIGN_SIZE((ULONG_PTR)start, page_size) - (ULONG_PTR)start; ok(!memcmp(start, filler, size), "%d: header alignment is not cleared\n", i); } @@ -449,18 +490,18 @@ todo_wine size = VirtualQuery((char *)hlib + section.VirtualAddress, &info, sizeof(info)); ok(size == sizeof(info), "%d: VirtualQuery error %d\n", i, GetLastError()); - if (nt_header.OptionalHeader.SectionAlignment < si.dwPageSize) + if (nt_header.OptionalHeader.SectionAlignment < page_size) { ok(info.BaseAddress == hlib, "%d: got %p != expected %p\n", i, info.BaseAddress, hlib); - ok(info.RegionSize == ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize), "%d: got %lx != expected %x\n", - i, info.RegionSize, ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, si.dwPageSize)); + ok(info.RegionSize == ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size), "%d: got %lx != expected %x\n", + i, info.RegionSize, ALIGN_SIZE(nt_header.OptionalHeader.SizeOfImage, page_size)); ok(info.Protect == PAGE_EXECUTE_WRITECOPY, "%d: %x != PAGE_EXECUTE_WRITECOPY\n", i, info.Protect); } else { ok(info.BaseAddress == (char *)hlib + section.VirtualAddress, "%d: got %p != expected %p\n", i, info.BaseAddress, (char *)hlib + section.VirtualAddress); - ok(info.RegionSize == ALIGN_SIZE(section.Misc.VirtualSize, si.dwPageSize), "%d: got %lx != expected %x\n", - i, info.RegionSize, ALIGN_SIZE(section.Misc.VirtualSize, si.dwPageSize)); + ok(info.RegionSize == ALIGN_SIZE(section.Misc.VirtualSize, page_size), "%d: got %lx != expected %x\n", + i, info.RegionSize, ALIGN_SIZE(section.Misc.VirtualSize, page_size)); ok(info.Protect == PAGE_READONLY, "%d: %x != PAGE_READONLY\n", i, info.Protect); } ok(info.AllocationBase == hlib, "%d: %p != %p\n", i, info.AllocationBase, hlib); @@ -468,23 +509,23 @@ todo_wine ok(info.State == MEM_COMMIT, "%d: %x != MEM_COMMIT\n", i, info.State); ok(info.Type == SEC_IMAGE, "%d: %x != SEC_IMAGE\n", i, info.Type); - if (nt_header.OptionalHeader.SectionAlignment >= si.dwPageSize) + if (nt_header.OptionalHeader.SectionAlignment >= page_size) ok(!memcmp((const char *)hlib + section.VirtualAddress + section.PointerToRawData, &nt_header, section.SizeOfRawData), "wrong section data\n"); else ok(!memcmp((const char *)hlib + section.PointerToRawData, section_data, section.SizeOfRawData), "wrong section data\n"); /* check the zeroing of alignment */ - if (nt_header.OptionalHeader.SectionAlignment >= si.dwPageSize) + if (nt_header.OptionalHeader.SectionAlignment >= page_size) { const char *start; start = (const char *)hlib + section.VirtualAddress + section.PointerToRawData + section.SizeOfRawData; - size = ALIGN_SIZE((ULONG_PTR)start, si.dwPageSize) - (ULONG_PTR)start; + size = ALIGN_SIZE((ULONG_PTR)start, page_size) - (ULONG_PTR)start; ok(memcmp(start, filler, size), "%d: alignment should not be cleared\n", i); } SetLastError(0xdeadbeef); - ptr = VirtualAlloc((char *)hlib + section.VirtualAddress, si.dwPageSize, MEM_COMMIT, info.Protect); + ptr = VirtualAlloc((char *)hlib + section.VirtualAddress, page_size, MEM_COMMIT, info.Protect); ok(!ptr, "%d: VirtualAlloc should fail\n", i); /* FIXME: Remove once Wine is fixed */ if (info.Protect == PAGE_WRITECOPY || info.Protect == PAGE_EXECUTE_WRITECOPY) @@ -497,7 +538,7 @@ todo_wine } SetLastError(0xdeadbeef); - hlib_as_data_file = LoadLibraryEx(dll_name, 0, LOAD_LIBRARY_AS_DATAFILE); + hlib_as_data_file = LoadLibraryExA(dll_name, 0, LOAD_LIBRARY_AS_DATAFILE); ok(hlib_as_data_file != 0, "LoadLibraryEx error %u\n", GetLastError()); ok(hlib_as_data_file == hlib, "hlib_as_file and hlib are different\n"); @@ -506,22 +547,22 @@ todo_wine ok(ret, "FreeLibrary error %d\n", GetLastError()); SetLastError(0xdeadbeef); - hlib = GetModuleHandle(dll_name); + hlib = GetModuleHandleA(dll_name); ok(hlib != 0, "GetModuleHandle error %u\n", GetLastError()); SetLastError(0xdeadbeef); ret = FreeLibrary(hlib_as_data_file); ok(ret, "FreeLibrary error %d\n", GetLastError()); - hlib = GetModuleHandle(dll_name); + hlib = GetModuleHandleA(dll_name); ok(!hlib, "GetModuleHandle should fail\n"); SetLastError(0xdeadbeef); - hlib_as_data_file = LoadLibraryEx(dll_name, 0, LOAD_LIBRARY_AS_DATAFILE); + hlib_as_data_file = LoadLibraryExA(dll_name, 0, LOAD_LIBRARY_AS_DATAFILE); ok(hlib_as_data_file != 0, "LoadLibraryEx error %u\n", GetLastError()); ok((ULONG_PTR)hlib_as_data_file & 1, "hlib_as_data_file is even\n"); - hlib = GetModuleHandle(dll_name); + hlib = GetModuleHandleA(dll_name); ok(!hlib, "GetModuleHandle should fail\n"); SetLastError(0xdeadbeef); @@ -544,9 +585,105 @@ todo_wine } SetLastError(0xdeadbeef); - ret = DeleteFile(dll_name); + ret = DeleteFileA(dll_name); ok(ret, "DeleteFile error %d\n", GetLastError()); } + + nt_header.FileHeader.NumberOfSections = 1; + nt_header.FileHeader.SizeOfOptionalHeader = sizeof(IMAGE_OPTIONAL_HEADER); + + nt_header.OptionalHeader.SectionAlignment = page_size; + nt_header.OptionalHeader.FileAlignment = page_size; + nt_header.OptionalHeader.SizeOfHeaders = sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER); + nt_header.OptionalHeader.SizeOfImage = nt_header.OptionalHeader.SizeOfImage + page_size; + + status = map_image_section( &nt_header ); + ok( status == STATUS_SUCCESS, "NtCreateSection error %08x\n", status ); + + dos_header.e_magic = 0; + status = map_image_section( &nt_header ); + ok( status == STATUS_INVALID_IMAGE_NOT_MZ, "NtCreateSection error %08x\n", status ); + + dos_header.e_magic = IMAGE_DOS_SIGNATURE; + nt_header.Signature = IMAGE_OS2_SIGNATURE; + status = map_image_section( &nt_header ); + ok( status == STATUS_INVALID_IMAGE_NE_FORMAT, "NtCreateSection error %08x\n", status ); + + nt_header.Signature = 0xdeadbeef; + status = map_image_section( &nt_header ); + ok( status == STATUS_INVALID_IMAGE_PROTECT, "NtCreateSection error %08x\n", status ); + + nt_header.Signature = IMAGE_NT_SIGNATURE; + nt_header.OptionalHeader.Magic = 0xdead; + status = map_image_section( &nt_header ); + ok( status == STATUS_INVALID_IMAGE_FORMAT, "NtCreateSection error %08x\n", status ); + + nt_header.OptionalHeader.Magic = IMAGE_NT_OPTIONAL_HDR_MAGIC; + nt_header.FileHeader.Machine = 0xdead; + status = map_image_section( &nt_header ); + ok( status == STATUS_INVALID_IMAGE_FORMAT || broken(status == STATUS_SUCCESS), /* win2k */ + "NtCreateSection error %08x\n", status ); + + nt_header.FileHeader.Machine = IMAGE_FILE_MACHINE_UNKNOWN; + status = map_image_section( &nt_header ); + ok( status == STATUS_INVALID_IMAGE_FORMAT || broken(status == STATUS_SUCCESS), /* win2k */ + "NtCreateSection error %08x\n", status ); + + switch (orig_machine) + { + case IMAGE_FILE_MACHINE_I386: nt_header.FileHeader.Machine = IMAGE_FILE_MACHINE_AMD64; break; + case IMAGE_FILE_MACHINE_AMD64: nt_header.FileHeader.Machine = IMAGE_FILE_MACHINE_I386; break; + case IMAGE_FILE_MACHINE_ARMNT: nt_header.FileHeader.Machine = IMAGE_FILE_MACHINE_ARM64; break; + case IMAGE_FILE_MACHINE_ARM64: nt_header.FileHeader.Machine = IMAGE_FILE_MACHINE_ARMNT; break; + } + status = map_image_section( &nt_header ); + ok( status == STATUS_INVALID_IMAGE_FORMAT || broken(status == STATUS_SUCCESS), /* win2k */ + "NtCreateSection error %08x\n", status ); + + if (nt_header.OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) + { + IMAGE_NT_HEADERS64 nt64; + + memset( &nt64, 0, sizeof(nt64) ); + nt64.Signature = IMAGE_NT_SIGNATURE; + nt64.FileHeader.Machine = orig_machine; + nt64.FileHeader.NumberOfSections = 1; + nt64.FileHeader.SizeOfOptionalHeader = sizeof(IMAGE_OPTIONAL_HEADER64); + nt64.OptionalHeader.Magic = IMAGE_NT_OPTIONAL_HDR64_MAGIC; + nt64.OptionalHeader.MajorLinkerVersion = 1; + nt64.OptionalHeader.ImageBase = 0x10000000; + nt64.OptionalHeader.MajorOperatingSystemVersion = 4; + nt64.OptionalHeader.MajorImageVersion = 1; + nt64.OptionalHeader.MajorSubsystemVersion = 4; + nt64.OptionalHeader.SizeOfHeaders = sizeof(dos_header) + sizeof(nt64) + sizeof(IMAGE_SECTION_HEADER); + nt64.OptionalHeader.SizeOfImage = nt64.OptionalHeader.SizeOfHeaders + 0x1000; + nt64.OptionalHeader.Subsystem = IMAGE_SUBSYSTEM_WINDOWS_CUI; + status = map_image_section( (IMAGE_NT_HEADERS *)&nt64 ); + ok( status == STATUS_INVALID_IMAGE_FORMAT, "NtCreateSection error %08x\n", status ); + } + else + { + IMAGE_NT_HEADERS32 nt32; + + memset( &nt32, 0, sizeof(nt32) ); + nt32.Signature = IMAGE_NT_SIGNATURE; + nt32.FileHeader.Machine = orig_machine; + nt32.FileHeader.NumberOfSections = 1; + nt32.FileHeader.SizeOfOptionalHeader = sizeof(IMAGE_OPTIONAL_HEADER32); + nt32.OptionalHeader.Magic = IMAGE_NT_OPTIONAL_HDR32_MAGIC; + nt32.OptionalHeader.MajorLinkerVersion = 1; + nt32.OptionalHeader.ImageBase = 0x10000000; + nt32.OptionalHeader.MajorOperatingSystemVersion = 4; + nt32.OptionalHeader.MajorImageVersion = 1; + nt32.OptionalHeader.MajorSubsystemVersion = 4; + nt32.OptionalHeader.SizeOfHeaders = sizeof(dos_header) + sizeof(nt32) + sizeof(IMAGE_SECTION_HEADER); + nt32.OptionalHeader.SizeOfImage = nt32.OptionalHeader.SizeOfHeaders + 0x1000; + nt32.OptionalHeader.Subsystem = IMAGE_SUBSYSTEM_WINDOWS_CUI; + status = map_image_section( (IMAGE_NT_HEADERS *)&nt32 ); + ok( status == STATUS_INVALID_IMAGE_FORMAT, "NtCreateSection error %08x\n", status ); + } + + nt_header.FileHeader.Machine = orig_machine; /* restore it for the next tests */ } /* Verify linking style of import descriptors */ @@ -612,18 +749,15 @@ static void test_image_mapping(const char *dll_name, DWORD scn_page_access, BOOL SIZE_T size; void *addr1, *addr2; MEMORY_BASIC_INFORMATION info; - SYSTEM_INFO si; if (!pNtMapViewOfSection) return; - GetSystemInfo(&si); - SetLastError(0xdeadbeef); - hfile = CreateFile(dll_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); + hfile = CreateFileA(dll_name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); ok(hfile != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); SetLastError(0xdeadbeef); - hmap = CreateFileMapping(hfile, NULL, PAGE_READONLY | SEC_IMAGE, 0, 0, 0); + hmap = CreateFileMappingW(hfile, NULL, PAGE_READONLY | SEC_IMAGE, 0, 0, 0); ok(hmap != 0, "CreateFileMapping error %d\n", GetLastError()); offset.u.LowPart = 0; @@ -640,7 +774,7 @@ static void test_image_mapping(const char *dll_name, DWORD scn_page_access, BOOL size = VirtualQuery((char *)addr1 + section.VirtualAddress, &info, sizeof(info)); ok(size == sizeof(info), "VirtualQuery error %d\n", GetLastError()); ok(info.BaseAddress == (char *)addr1 + section.VirtualAddress, "got %p != expected %p\n", info.BaseAddress, (char *)addr1 + section.VirtualAddress); - ok(info.RegionSize == si.dwPageSize, "got %#lx != expected %#x\n", info.RegionSize, si.dwPageSize); + ok(info.RegionSize == page_size, "got %#lx != expected %#x\n", info.RegionSize, page_size); ok(info.Protect == scn_page_access, "got %#x != expected %#x\n", info.Protect, scn_page_access); ok(info.AllocationBase == addr1, "%p != %p\n", info.AllocationBase, addr1); ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%#x != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); @@ -668,7 +802,7 @@ static void test_image_mapping(const char *dll_name, DWORD scn_page_access, BOOL size = VirtualQuery((char *)addr2 + section.VirtualAddress, &info, sizeof(info)); ok(size == sizeof(info), "VirtualQuery error %d\n", GetLastError()); ok(info.BaseAddress == (char *)addr2 + section.VirtualAddress, "got %p != expected %p\n", info.BaseAddress, (char *)addr2 + section.VirtualAddress); - ok(info.RegionSize == si.dwPageSize, "got %#lx != expected %#x\n", info.RegionSize, si.dwPageSize); + ok(info.RegionSize == page_size, "got %#lx != expected %#x\n", info.RegionSize, page_size); ok(info.Protect == scn_page_access, "got %#x != expected %#x\n", info.Protect, scn_page_access); ok(info.AllocationBase == addr2, "%p != %p\n", info.AllocationBase, addr2); ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%#x != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); @@ -686,7 +820,7 @@ static void test_image_mapping(const char *dll_name, DWORD scn_page_access, BOOL size = VirtualQuery((char *)addr2 + section.VirtualAddress, &info, sizeof(info)); ok(size == sizeof(info), "VirtualQuery error %d\n", GetLastError()); ok(info.BaseAddress == (char *)addr2 + section.VirtualAddress, "got %p != expected %p\n", info.BaseAddress, (char *)addr2 + section.VirtualAddress); - ok(info.RegionSize == si.dwPageSize, "got %#lx != expected %#x\n", info.RegionSize, si.dwPageSize); + ok(info.RegionSize == page_size, "got %#lx != expected %#x\n", info.RegionSize, page_size); ok(info.Protect == scn_page_access, "got %#x != expected %#x\n", info.Protect, scn_page_access); ok(info.AllocationBase == addr2, "%p != %p\n", info.AllocationBase, addr2); ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%#x != PAGE_EXECUTE_WRITECOPY\n", info.AllocationProtect); @@ -696,7 +830,7 @@ static void test_image_mapping(const char *dll_name, DWORD scn_page_access, BOOL UnmapViewOfFile(addr2); SetLastError(0xdeadbeef); - addr2 = LoadLibrary(dll_name); + addr2 = LoadLibraryA(dll_name); if (is_dll) { ok(!addr2, "LoadLibrary should fail, is_dll %d\n", is_dll); @@ -778,12 +912,9 @@ static void test_VirtualProtect(void *base, void *section) }; DWORD ret, orig_prot, old_prot, rw_prot, exec_prot, i, j; MEMORY_BASIC_INFORMATION info; - SYSTEM_INFO si; - - GetSystemInfo(&si); SetLastError(0xdeadbeef); - ret = VirtualProtect(section, si.dwPageSize, PAGE_NOACCESS, &old_prot); + ret = VirtualProtect(section, page_size, PAGE_NOACCESS, &old_prot); ok(ret, "VirtualProtect error %d\n", GetLastError()); orig_prot = old_prot; @@ -794,7 +925,7 @@ static void test_VirtualProtect(void *base, void *section) ret = VirtualQuery(section, &info, sizeof(info)); ok(ret, "VirtualQuery failed %d\n", GetLastError()); ok(info.BaseAddress == section, "%d: got %p != expected %p\n", i, info.BaseAddress, section); - ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize); + ok(info.RegionSize == page_size, "%d: got %#lx != expected %#x\n", i, info.RegionSize, page_size); ok(info.Protect == PAGE_NOACCESS, "%d: got %#x != expected PAGE_NOACCESS\n", i, info.Protect); ok(info.AllocationBase == base, "%d: %p != %p\n", i, info.AllocationBase, base); ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); @@ -803,7 +934,7 @@ static void test_VirtualProtect(void *base, void *section) old_prot = 0xdeadbeef; SetLastError(0xdeadbeef); - ret = VirtualProtect(section, si.dwPageSize, td[i].prot_set, &old_prot); + ret = VirtualProtect(section, page_size, td[i].prot_set, &old_prot); if (td[i].prot_get) { ok(ret, "%d: VirtualProtect error %d, requested prot %#x\n", i, GetLastError(), td[i].prot_set); @@ -813,7 +944,7 @@ static void test_VirtualProtect(void *base, void *section) ret = VirtualQuery(section, &info, sizeof(info)); ok(ret, "VirtualQuery failed %d\n", GetLastError()); ok(info.BaseAddress == section, "%d: got %p != expected %p\n", i, info.BaseAddress, section); - ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize); + ok(info.RegionSize == page_size, "%d: got %#lx != expected %#x\n", i, info.RegionSize, page_size); ok(info.Protect == td[i].prot_get, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].prot_get); ok(info.AllocationBase == base, "%d: %p != %p\n", i, info.AllocationBase, base); ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); @@ -828,7 +959,7 @@ static void test_VirtualProtect(void *base, void *section) old_prot = 0xdeadbeef; SetLastError(0xdeadbeef); - ret = VirtualProtect(section, si.dwPageSize, PAGE_NOACCESS, &old_prot); + ret = VirtualProtect(section, page_size, PAGE_NOACCESS, &old_prot); ok(ret, "%d: VirtualProtect error %d\n", i, GetLastError()); if (td[i].prot_get) ok(old_prot == td[i].prot_get, "%d: got %#x != expected %#x\n", i, old_prot, td[i].prot_get); @@ -847,7 +978,7 @@ static void test_VirtualProtect(void *base, void *section) DWORD prot = exec_prot | rw_prot; SetLastError(0xdeadbeef); - ret = VirtualProtect(section, si.dwPageSize, prot, &old_prot); + ret = VirtualProtect(section, page_size, prot, &old_prot); if ((rw_prot && exec_prot) || (!rw_prot && !exec_prot)) { ok(!ret, "VirtualProtect(%02x) should fail\n", prot); @@ -863,7 +994,7 @@ static void test_VirtualProtect(void *base, void *section) } SetLastError(0xdeadbeef); - ret = VirtualProtect(section, si.dwPageSize, orig_prot, &old_prot); + ret = VirtualProtect(section, page_size, orig_prot, &old_prot); ok(ret, "VirtualProtect error %d\n", GetLastError()); } @@ -908,25 +1039,22 @@ static void test_section_access(void) DWORD dummy, file_align; HANDLE hfile; HMODULE hlib; - SYSTEM_INFO si; char temp_path[MAX_PATH]; char dll_name[MAX_PATH]; SIZE_T size; MEMORY_BASIC_INFORMATION info; - STARTUPINFO sti; + STARTUPINFOA sti; PROCESS_INFORMATION pi; DWORD ret; - GetSystemInfo(&si); - /* prevent displaying of the "Unable to load this DLL" message box */ SetErrorMode(SEM_FAILCRITICALERRORS); - GetTempPath(MAX_PATH, temp_path); + GetTempPathA(MAX_PATH, temp_path); for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { - GetTempFileName(temp_path, "ldr", 0, dll_name); + GetTempFileNameA(temp_path, "ldr", 0, dll_name); /*trace("creating %s\n", dll_name);*/ hfile = CreateFileA(dll_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); @@ -944,9 +1072,9 @@ static void test_section_access(void) nt_header.FileHeader.SizeOfOptionalHeader = sizeof(IMAGE_OPTIONAL_HEADER); nt_header.FileHeader.Characteristics = IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_DLL | IMAGE_FILE_RELOCS_STRIPPED; - nt_header.OptionalHeader.SectionAlignment = si.dwPageSize; + nt_header.OptionalHeader.SectionAlignment = page_size; nt_header.OptionalHeader.FileAlignment = 0x200; - nt_header.OptionalHeader.SizeOfImage = sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER) + si.dwPageSize; + nt_header.OptionalHeader.SizeOfImage = sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER) + page_size; nt_header.OptionalHeader.SizeOfHeaders = sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER); SetLastError(0xdeadbeef); ret = WriteFile(hfile, &nt_header, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER), &dummy, NULL); @@ -978,7 +1106,7 @@ static void test_section_access(void) CloseHandle(hfile); SetLastError(0xdeadbeef); - hlib = LoadLibrary(dll_name); + hlib = LoadLibraryA(dll_name); ok(hlib != 0, "LoadLibrary error %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -986,7 +1114,7 @@ static void test_section_access(void) ok(size == sizeof(info), "%d: VirtualQuery error %d\n", i, GetLastError()); ok(info.BaseAddress == (char *)hlib + section.VirtualAddress, "%d: got %p != expected %p\n", i, info.BaseAddress, (char *)hlib + section.VirtualAddress); - ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize); + ok(info.RegionSize == page_size, "%d: got %#lx != expected %#x\n", i, info.RegionSize, page_size); ok(info.Protect == td[i].scn_page_access, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].scn_page_access); ok(info.AllocationBase == hlib, "%d: %p != %p\n", i, info.AllocationBase, hlib); ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); @@ -1021,7 +1149,7 @@ static void test_section_access(void) /* reset IMAGE_FILE_DLL otherwise CreateProcess fails */ nt_header.FileHeader.Characteristics = IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_RELOCS_STRIPPED; SetLastError(0xdeadbeef); - hfile = CreateFile(dll_name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); + hfile = CreateFileA(dll_name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); /* LoadLibrary called on an already memory-mapped file in * test_image_mapping() above leads to a file handle leak * under nt4, and inability to overwrite and delete the file @@ -1040,7 +1168,7 @@ static void test_section_access(void) memset(&sti, 0, sizeof(sti)); sti.cb = sizeof(sti); SetLastError(0xdeadbeef); - ret = CreateProcess(dll_name, NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &sti, &pi); + ret = CreateProcessA(dll_name, NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &sti, &pi); ok(ret, "CreateProcess() error %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -1048,7 +1176,7 @@ static void test_section_access(void) ok(size == sizeof(info), "%d: VirtualQuery error %d\n", i, GetLastError()); ok(info.BaseAddress == (char *)hlib + section.VirtualAddress, "%d: got %p != expected %p\n", i, info.BaseAddress, (char *)hlib + section.VirtualAddress); - ok(info.RegionSize == si.dwPageSize, "%d: got %#lx != expected %#x\n", i, info.RegionSize, si.dwPageSize); + ok(info.RegionSize == page_size, "%d: got %#lx != expected %#x\n", i, info.RegionSize, page_size); ok(info.Protect == td[i].scn_page_access, "%d: got %#x != expected %#x\n", i, info.Protect, td[i].scn_page_access); ok(info.AllocationBase == hlib, "%d: %p != %p\n", i, info.AllocationBase, hlib); ok(info.AllocationProtect == PAGE_EXECUTE_WRITECOPY, "%d: %#x != PAGE_EXECUTE_WRITECOPY\n", i, info.AllocationProtect); @@ -1075,11 +1203,142 @@ static void test_section_access(void) nt4_is_broken: SetLastError(0xdeadbeef); - ret = DeleteFile(dll_name); + ret = DeleteFileA(dll_name); ok(ret || broken(!ret) /* nt4 */, "DeleteFile error %d\n", GetLastError()); } } +static void test_import_resolution(void) +{ + char temp_path[MAX_PATH]; + char dll_name[MAX_PATH]; + DWORD dummy; + void *expect; + char *str; + HANDLE hfile; + HMODULE mod, mod2; + struct imports + { + IMAGE_IMPORT_DESCRIPTOR descr[2]; + IMAGE_THUNK_DATA original_thunks[2]; + IMAGE_THUNK_DATA thunks[2]; + char module[16]; + struct { WORD hint; char name[32]; } function; + IMAGE_TLS_DIRECTORY tls; + char tls_data[16]; + SHORT tls_index; + } data, *ptr; + IMAGE_NT_HEADERS nt; + IMAGE_SECTION_HEADER section; + int test; + + for (test = 0; test < 3; test++) + { +#define DATA_RVA(ptr) (page_size + ((char *)(ptr) - (char *)&data)) + nt = nt_header; + nt.FileHeader.NumberOfSections = 1; + nt.FileHeader.SizeOfOptionalHeader = sizeof(IMAGE_OPTIONAL_HEADER); + nt.FileHeader.Characteristics = IMAGE_FILE_EXECUTABLE_IMAGE | IMAGE_FILE_32BIT_MACHINE | IMAGE_FILE_RELOCS_STRIPPED; + if (test != 2) nt.FileHeader.Characteristics |= IMAGE_FILE_DLL; + nt.OptionalHeader.ImageBase = 0x12340000; + nt.OptionalHeader.SizeOfImage = 2 * page_size; + nt.OptionalHeader.SizeOfHeaders = nt.OptionalHeader.FileAlignment; + nt.OptionalHeader.NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES; + memset( nt.OptionalHeader.DataDirectory, 0, sizeof(nt.OptionalHeader.DataDirectory) ); + nt.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size = sizeof(data.descr); + nt.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress = DATA_RVA(data.descr); + nt.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].Size = sizeof(data.tls); + nt.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress = DATA_RVA(&data.tls); + + memset( &data, 0, sizeof(data) ); + data.descr[0].u.OriginalFirstThunk = DATA_RVA( data.original_thunks ); + data.descr[0].FirstThunk = DATA_RVA( data.thunks ); + data.descr[0].Name = DATA_RVA( data.module ); + strcpy( data.module, "kernel32.dll" ); + strcpy( data.function.name, "CreateEventA" ); + data.original_thunks[0].u1.AddressOfData = DATA_RVA( &data.function ); + data.thunks[0].u1.AddressOfData = 0xdeadbeef; + + data.tls.StartAddressOfRawData = nt.OptionalHeader.ImageBase + DATA_RVA( data.tls_data ); + data.tls.EndAddressOfRawData = data.tls.StartAddressOfRawData + sizeof(data.tls_data); + data.tls.AddressOfIndex = nt.OptionalHeader.ImageBase + DATA_RVA( &data.tls_index ); + strcpy( data.tls_data, "hello world" ); + data.tls_index = 9999; + + GetTempPathA(MAX_PATH, temp_path); + GetTempFileNameA(temp_path, "ldr", 0, dll_name); + + hfile = CreateFileA(dll_name, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, 0, 0); + ok( hfile != INVALID_HANDLE_VALUE, "creation failed\n" ); + + memset( §ion, 0, sizeof(section) ); + memcpy( section.Name, ".text", sizeof(".text") ); + section.PointerToRawData = nt.OptionalHeader.FileAlignment; + section.VirtualAddress = nt.OptionalHeader.SectionAlignment; + section.Misc.VirtualSize = sizeof(data); + section.SizeOfRawData = sizeof(data); + section.Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE; + + WriteFile(hfile, &dos_header, sizeof(dos_header), &dummy, NULL); + WriteFile(hfile, &nt, sizeof(nt), &dummy, NULL); + WriteFile(hfile, §ion, sizeof(section), &dummy, NULL); + + SetFilePointer( hfile, section.PointerToRawData, NULL, SEEK_SET ); + WriteFile(hfile, &data, sizeof(data), &dummy, NULL); + + CloseHandle( hfile ); + + switch (test) + { + case 0: /* normal load */ + mod = LoadLibraryA( dll_name ); + ok( mod != NULL, "failed to load err %u\n", GetLastError() ); + if (!mod) break; + ptr = (struct imports *)((char *)mod + page_size); + expect = GetProcAddress( GetModuleHandleA( data.module ), data.function.name ); + ok( (void *)ptr->thunks[0].u1.Function == expect, "thunk %p instead of %p for %s.%s\n", + (void *)ptr->thunks[0].u1.Function, expect, data.module, data.function.name ); + ok( ptr->tls_index < 32 || broken(ptr->tls_index == 9999), /* before vista */ + "wrong tls index %d\n", ptr->tls_index ); + if (ptr->tls_index != 9999) + { + str = ((char **)NtCurrentTeb()->ThreadLocalStoragePointer)[ptr->tls_index]; + ok( !strcmp( str, "hello world" ), "wrong tls data '%s' at %p\n", str, str ); + } + FreeLibrary( mod ); + break; + case 1: /* load with DONT_RESOLVE_DLL_REFERENCES doesn't resolve imports */ + mod = LoadLibraryExA( dll_name, 0, DONT_RESOLVE_DLL_REFERENCES ); + ok( mod != NULL, "failed to load err %u\n", GetLastError() ); + if (!mod) break; + ptr = (struct imports *)((char *)mod + page_size); + ok( ptr->thunks[0].u1.Function == 0xdeadbeef, "thunk resolved to %p for %s.%s\n", + (void *)ptr->thunks[0].u1.Function, data.module, data.function.name ); + ok( ptr->tls_index == 9999, "wrong tls index %d\n", ptr->tls_index ); + + mod2 = LoadLibraryA( dll_name ); + ok( mod2 == mod, "loaded twice %p / %p\n", mod, mod2 ); + ok( ptr->thunks[0].u1.Function == 0xdeadbeef, "thunk resolved to %p for %s.%s\n", + (void *)ptr->thunks[0].u1.Function, data.module, data.function.name ); + ok( ptr->tls_index == 9999, "wrong tls index %d\n", ptr->tls_index ); + FreeLibrary( mod ); + break; + case 2: /* load without IMAGE_FILE_DLL doesn't resolve imports */ + mod = LoadLibraryA( dll_name ); + ok( mod != NULL, "failed to load err %u\n", GetLastError() ); + if (!mod) break; + ptr = (struct imports *)((char *)mod + page_size); + ok( ptr->thunks[0].u1.Function == 0xdeadbeef, "thunk resolved to %p for %s.%s\n", + (void *)ptr->thunks[0].u1.Function, data.module, data.function.name ); + ok( ptr->tls_index == 9999, "wrong tls index %d\n", ptr->tls_index ); + FreeLibrary( mod ); + break; + } + DeleteFileA( dll_name ); +#undef DATA_RVA + } +} + #define MAX_COUNT 10 static HANDLE attached_thread[MAX_COUNT]; static DWORD attached_thread_count; @@ -1312,7 +1571,7 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) } SetLastError(0xdeadbeef); - process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId()); + process = OpenProcess(PROCESS_ALL_ACCESS_NT4, FALSE, GetCurrentProcessId()); ok(process != NULL, "OpenProcess error %d\n", GetLastError()); noop_thread_started = 0; @@ -1340,7 +1599,7 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) } SetLastError(0xdeadbeef); - handle = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, NULL); + handle = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, NULL); ok(handle != 0, "CreateFileMapping error %d\n", GetLastError()); offset.u.LowPart = 0; @@ -1356,15 +1615,15 @@ static BOOL WINAPI dll_entry_point(HINSTANCE hinst, DWORD reason, LPVOID param) CloseHandle(handle); CloseHandle(process); - handle = GetModuleHandle("winver.exe"); + handle = GetModuleHandleA("winver.exe"); ok(!handle, "winver.exe shouldn't be loaded yet\n"); SetLastError(0xdeadbeef); - handle = LoadLibrary("winver.exe"); + handle = LoadLibraryA("winver.exe"); ok(handle != 0, "LoadLibrary error %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = FreeLibrary(handle); ok(ret, "FreeLibrary error %d\n", GetLastError()); - handle = GetModuleHandle("winver.exe"); + handle = GetModuleHandleA("winver.exe"); if (param) ok(handle != 0, "winver.exe should not be unloaded\n"); else @@ -1445,34 +1704,34 @@ static void child_process(const char *dll_name, DWORD target_offset) trace("phase %d: writing %p at %#x\n", test_dll_phase, dll_entry_point, target_offset); SetLastError(0xdeadbeef); - mutex = CreateMutex(NULL, FALSE, NULL); + mutex = CreateMutexW(NULL, FALSE, NULL); ok(mutex != 0, "CreateMutex error %d\n", GetLastError()); SetLastError(0xdeadbeef); - semaphore = CreateSemaphore(NULL, 1, 1, NULL); + semaphore = CreateSemaphoreW(NULL, 1, 1, NULL); ok(semaphore != 0, "CreateSemaphore error %d\n", GetLastError()); SetLastError(0xdeadbeef); - event = CreateEvent(NULL, TRUE, FALSE, NULL); + event = CreateEventW(NULL, TRUE, FALSE, NULL); ok(event != 0, "CreateEvent error %d\n", GetLastError()); SetLastError(0xdeadbeef); - loader_lock_event = CreateEvent(NULL, FALSE, FALSE, NULL); + loader_lock_event = CreateEventW(NULL, FALSE, FALSE, NULL); ok(loader_lock_event != 0, "CreateEvent error %d\n", GetLastError()); SetLastError(0xdeadbeef); - peb_lock_event = CreateEvent(NULL, FALSE, FALSE, NULL); + peb_lock_event = CreateEventW(NULL, FALSE, FALSE, NULL); ok(peb_lock_event != 0, "CreateEvent error %d\n", GetLastError()); SetLastError(0xdeadbeef); - heap_lock_event = CreateEvent(NULL, FALSE, FALSE, NULL); + heap_lock_event = CreateEventW(NULL, FALSE, FALSE, NULL); ok(heap_lock_event != 0, "CreateEvent error %d\n", GetLastError()); SetLastError(0xdeadbeef); - ack_event = CreateEvent(NULL, FALSE, FALSE, NULL); + ack_event = CreateEventW(NULL, FALSE, FALSE, NULL); ok(ack_event != 0, "CreateEvent error %d\n", GetLastError()); - file = CreateFile(dll_name, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); + file = CreateFileA(dll_name, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); if (file == INVALID_HANDLE_VALUE) { ok(0, "could not open %s\n", dll_name); @@ -1486,11 +1745,11 @@ static void child_process(const char *dll_name, DWORD target_offset) CloseHandle(file); SetLastError(0xdeadbeef); - hmod = LoadLibrary(dll_name); + hmod = LoadLibraryA(dll_name); ok(hmod != 0, "LoadLibrary error %d\n", GetLastError()); SetLastError(0xdeadbeef); - stop_event = CreateEvent(NULL, TRUE, FALSE, NULL); + stop_event = CreateEventW(NULL, TRUE, FALSE, NULL); ok(stop_event != 0, "CreateEvent error %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -1535,7 +1794,7 @@ static void child_process(const char *dll_name, DWORD target_offset) ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); SetLastError(0xdeadbeef); - process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId()); + process = OpenProcess(PROCESS_ALL_ACCESS_NT4, FALSE, GetCurrentProcessId()); ok(process != NULL, "OpenProcess error %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -1570,7 +1829,7 @@ static void child_process(const char *dll_name, DWORD target_offset) ret = pRtlDllShutdownInProgress(); ok(!ret, "RtlDllShutdownInProgress returned %d\n", ret); - hmod = GetModuleHandle(dll_name); + hmod = GetModuleHandleA(dll_name); ok(hmod != 0, "DLL should not be unloaded\n"); SetLastError(0xdeadbeef); @@ -1591,7 +1850,7 @@ static void child_process(const char *dll_name, DWORD target_offset) ret = pRtlDllShutdownInProgress(); ok(ret, "RtlDllShutdownInProgress returned %d\n", ret); - hmod = GetModuleHandle(dll_name); + hmod = GetModuleHandleA(dll_name); ok(hmod != 0, "DLL should not be unloaded\n"); memset(&pbi, 0, sizeof(pbi)); @@ -1616,7 +1875,7 @@ static void child_process(const char *dll_name, DWORD target_offset) SetLastError(0xdeadbeef); ret = FreeLibrary(hmod); ok(ret, "FreeLibrary error %d\n", GetLastError()); - hmod = GetModuleHandle(dll_name); + hmod = GetModuleHandleA(dll_name); ok(!hmod, "DLL should be unloaded\n"); if (test_dll_phase == 2) @@ -1748,7 +2007,7 @@ static void test_ExitProcess(void) DWORD ret, target_offset, old_prot; char **argv, buf[256]; PROCESS_INFORMATION pi; - STARTUPINFO si = { sizeof(si) }; + STARTUPINFOA si = { sizeof(si) }; CONTEXT ctx; struct PROCESS_BASIC_INFORMATION_PRIVATE pbi; MEMORY_BASIC_INFORMATION mbi; @@ -1781,11 +2040,11 @@ static void test_ExitProcess(void) /* prevent displaying of the "Unable to load this DLL" message box */ SetErrorMode(SEM_FAILCRITICALERRORS); - GetTempPath(MAX_PATH, temp_path); - GetTempFileName(temp_path, "ldr", 0, dll_name); + GetTempPathA(MAX_PATH, temp_path); + GetTempFileNameA(temp_path, "ldr", 0, dll_name); /*trace("creating %s\n", dll_name);*/ - file = CreateFile(dll_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + file = CreateFileA(dll_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); if (file == INVALID_HANDLE_VALUE) { ok(0, "could not create %s\n", dll_name); @@ -1841,7 +2100,7 @@ static void test_ExitProcess(void) /* phase 0 */ *child_failures = -1; sprintf(cmdline, "\"%s\" loader %s %u 0", argv[0], dll_name, target_offset); - ret = CreateProcess(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 10000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); @@ -1859,7 +2118,7 @@ static void test_ExitProcess(void) /* phase 1 */ *child_failures = -1; sprintf(cmdline, "\"%s\" loader %s %u 1", argv[0], dll_name, target_offset); - ret = CreateProcess(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 10000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); @@ -1877,7 +2136,7 @@ static void test_ExitProcess(void) /* phase 2 */ *child_failures = -1; sprintf(cmdline, "\"%s\" loader %s %u 2", argv[0], dll_name, target_offset); - ret = CreateProcess(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 10000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); @@ -1895,7 +2154,7 @@ static void test_ExitProcess(void) /* phase 3 */ *child_failures = -1; sprintf(cmdline, "\"%s\" loader %s %u 3", argv[0], dll_name, target_offset); - ret = CreateProcess(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 10000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); @@ -1915,7 +2174,7 @@ static void test_ExitProcess(void) { *child_failures = -1; sprintf(cmdline, "\"%s\" loader %s %u 4", argv[0], dll_name, target_offset); - ret = CreateProcess(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 10000); ok(ret == WAIT_OBJECT_0, "child process failed to terminate\n"); @@ -1938,7 +2197,7 @@ static void test_ExitProcess(void) { *child_failures = -1; sprintf(cmdline, "\"%s\" loader %s %u 5", argv[0], dll_name, target_offset); - ret = CreateProcess(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 5000); ok(ret == WAIT_TIMEOUT, "child process should fail to terminate\n"); @@ -1965,7 +2224,7 @@ static void test_ExitProcess(void) /* phase 6 */ *child_failures = -1; sprintf(cmdline, "\"%s\" loader %s %u 6", argv[0], dll_name, target_offset); - ret = CreateProcess(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); ret = WaitForSingleObject(pi.hProcess, 5000); ok(ret == WAIT_TIMEOUT || broken(ret == WAIT_OBJECT_0) /* XP */, "child process should fail to terminate\n"); @@ -1988,7 +2247,7 @@ static void test_ExitProcess(void) /* test remote process termination */ SetLastError(0xdeadbeef); - ret = CreateProcess(argv[0], NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi); + ret = CreateProcessA(argv[0], NULL, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", argv[0], GetLastError()); SetLastError(0xdeadbeef); @@ -1999,7 +2258,6 @@ static void test_ExitProcess(void) ok(ret, "VirtualProtectEx error %d\n", GetLastError()); ok(old_prot == PAGE_READWRITE, "expected PAGE_READWRITE, got %#x\n", old_prot); SetLastError(0xdeadbeef); - ok(0, "I do *not* love goats!\n"); size = VirtualQueryEx(pi.hProcess, NULL, &mbi, sizeof(mbi)); ok(size == sizeof(mbi), "VirtualQueryEx error %d\n", GetLastError()); @@ -2009,7 +2267,7 @@ static void test_ExitProcess(void) ok(size == 4, "expected 4, got %lu\n", size); SetLastError(0xdeadbeef); - hmap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, NULL); + hmap = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, NULL); ok(hmap != 0, "CreateFileMapping error %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -2063,7 +2321,7 @@ static void test_ExitProcess(void) ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed: %x\n", ret); SetLastError(0xdeadbeef); - process = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pi.dwProcessId); + process = OpenProcess(PROCESS_ALL_ACCESS_NT4, FALSE, pi.dwProcessId); ok(process != NULL, "OpenProcess error %d\n", GetLastError()); CloseHandle(process); @@ -2136,7 +2394,6 @@ static void test_ExitProcess(void) ok(!addr, "VirtualAllocEx should fail\n"); ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); SetLastError(0xdeadbeef); - ok(0, "I do *not* love goats!\n"); size = VirtualQueryEx(pi.hProcess, NULL, &mbi, sizeof(mbi)); ok(!size, "VirtualQueryEx should fail\n"); ok(GetLastError() == ERROR_ACCESS_DENIED, "expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); @@ -2182,36 +2439,350 @@ if (0) CloseHandle(pi.hThread); CloseHandle(pi.hProcess); - ret = DeleteFile(dll_name); + ret = DeleteFileA(dll_name); ok(ret, "DeleteFile error %d\n", GetLastError()); } +static PVOID WINAPI failuredllhook(ULONG ul, DELAYLOAD_INFO* pd) +{ + ok(ul == 4, "expected 4, got %u\n", ul); + ok(!!pd, "no delayload info supplied\n"); + if (pd) + { + ok(pd->Size == sizeof(*pd), "got %u\n", pd->Size); + ok(!!pd->DelayloadDescriptor, "no DelayloadDescriptor supplied\n"); + if (pd->DelayloadDescriptor) + { + ok(pd->DelayloadDescriptor->Attributes.AllAttributes == 1, + "expected 1, got %u\n", pd->DelayloadDescriptor->Attributes.AllAttributes); + ok(pd->DelayloadDescriptor->DllNameRVA == 0x2000, + "expected 0x2000, got %x\n", pd->DelayloadDescriptor->DllNameRVA); + ok(pd->DelayloadDescriptor->ModuleHandleRVA == 0x201a, + "expected 0x201a, got %x\n", pd->DelayloadDescriptor->ModuleHandleRVA); + ok(pd->DelayloadDescriptor->ImportAddressTableRVA > pd->DelayloadDescriptor->ModuleHandleRVA, + "expected %x > %x\n", pd->DelayloadDescriptor->ImportAddressTableRVA, + pd->DelayloadDescriptor->ModuleHandleRVA); + ok(pd->DelayloadDescriptor->ImportNameTableRVA > pd->DelayloadDescriptor->ImportAddressTableRVA, + "expected %x > %x\n", pd->DelayloadDescriptor->ImportNameTableRVA, + pd->DelayloadDescriptor->ImportAddressTableRVA); + ok(pd->DelayloadDescriptor->BoundImportAddressTableRVA == 0, + "expected 0, got %x\n", pd->DelayloadDescriptor->BoundImportAddressTableRVA); + ok(pd->DelayloadDescriptor->UnloadInformationTableRVA == 0, + "expected 0, got %x\n", pd->DelayloadDescriptor->UnloadInformationTableRVA); + ok(pd->DelayloadDescriptor->TimeDateStamp == 0, + "expected 0, got %x\n", pd->DelayloadDescriptor->TimeDateStamp); + } + + ok(!!pd->ThunkAddress, "no ThunkAddress supplied\n"); + if (pd->ThunkAddress) + ok(pd->ThunkAddress->u1.Ordinal == 0, "expected 0, got %x\n", (UINT)pd->ThunkAddress->u1.Ordinal); + + ok(!!pd->TargetDllName, "no TargetDllName supplied\n"); + if (pd->TargetDllName) + ok(!strcmp(pd->TargetDllName, "secur32.dll"), + "expected \"secur32.dll\", got \"%s\"\n", pd->TargetDllName); + + ok(pd->TargetApiDescriptor.ImportDescribedByName == 0, + "expected 0, got %x\n", pd->TargetApiDescriptor.ImportDescribedByName); + ok(pd->TargetApiDescriptor.Description.Ordinal == 0 || + pd->TargetApiDescriptor.Description.Ordinal == 999, + "expected 0, got %x\n", pd->TargetApiDescriptor.Description.Ordinal); + + ok(!!pd->TargetModuleBase, "no TargetModuleBase supplied\n"); + ok(pd->Unused == NULL, "expected NULL, got %p\n", pd->Unused); + ok(pd->LastError, "no LastError supplied\n"); + } + cb_count++; + return (void*)0xdeadbeef; +} + +static void test_ResolveDelayLoadedAPI(void) +{ + static const char test_dll[] = "secur32.dll"; + static const char test_func[] = "SealMessage"; + static const char filler[0x1000]; + char temp_path[MAX_PATH]; + char dll_name[MAX_PATH]; + IMAGE_DELAYLOAD_DESCRIPTOR idd, *delaydir; + IMAGE_THUNK_DATA itd32; + HANDLE hfile; + HMODULE hlib; + DWORD dummy, file_size, i; + WORD hint = 0; + BOOL ret; + static const struct test_data + { + BOOL func; + UINT_PTR ordinal; + BOOL succeeds; + } td[] = + { + { + TRUE, 0, TRUE + }, + { + FALSE, IMAGE_ORDINAL_FLAG | 2, TRUE + }, + { + FALSE, IMAGE_ORDINAL_FLAG | 5, TRUE + }, + { + FALSE, IMAGE_ORDINAL_FLAG | 0, FALSE + }, + { + FALSE, IMAGE_ORDINAL_FLAG | 999, FALSE + }, + }; + + if (!pResolveDelayLoadedAPI) + { + todo_wine win_skip("ResolveDelayLoadedAPI is not available\n"); + return; + } + + if (0) /* crashes on native */ + { + SetLastError(0xdeadbeef); + ok(!pResolveDelayLoadedAPI(NULL, NULL, NULL, NULL, NULL, 0), + "ResolveDelayLoadedAPI succeeded\n"); + ok(GetLastError() == 0xdeadbeef, "GetLastError changed to %x\n", GetLastError()); + + cb_count = 0; + SetLastError(0xdeadbeef); + ok(!pResolveDelayLoadedAPI(NULL, NULL, failuredllhook, NULL, NULL, 0), + "ResolveDelayLoadedAPI succeeded\n"); + ok(GetLastError() == 0xdeadbeef, "GetLastError changed to %x\n", GetLastError()); + ok(cb_count == 1, "Wrong callback count: %d\n", cb_count); + } + + GetTempPathA(MAX_PATH, temp_path); + GetTempFileNameA(temp_path, "ldr", 0, dll_name); + trace("creating %s\n", dll_name); + hfile = CreateFileA(dll_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + if (hfile == INVALID_HANDLE_VALUE) + { + ok(0, "could not create %s\n", dll_name); + return; + } + + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, &dos_header, sizeof(dos_header), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + nt_header.FileHeader.NumberOfSections = 2; + nt_header.FileHeader.SizeOfOptionalHeader = sizeof(IMAGE_OPTIONAL_HEADER); + + nt_header.OptionalHeader.SectionAlignment = 0x1000; + nt_header.OptionalHeader.FileAlignment = 0x1000; + nt_header.OptionalHeader.SizeOfImage = sizeof(dos_header) + sizeof(nt_header) + sizeof(IMAGE_SECTION_HEADER) + 0x2200; + nt_header.OptionalHeader.SizeOfHeaders = sizeof(dos_header) + sizeof(nt_header) + 2 * sizeof(IMAGE_SECTION_HEADER); + nt_header.OptionalHeader.NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES; + nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].VirtualAddress = 0x1000; + nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].Size = 0x100; + + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, &nt_header, sizeof(DWORD) + sizeof(IMAGE_FILE_HEADER), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, &nt_header.OptionalHeader, sizeof(IMAGE_OPTIONAL_HEADER), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + /* sections */ + section.PointerToRawData = nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].VirtualAddress; + section.VirtualAddress = nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].VirtualAddress; + section.Misc.VirtualSize = nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].Size; + section.Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ; + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, §ion, sizeof(section), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + section.PointerToRawData = 0x2000; + section.VirtualAddress = 0x2000; + i = sizeof(td)/sizeof(td[0]); + section.Misc.VirtualSize = sizeof(test_dll) + sizeof(hint) + sizeof(test_func) + sizeof(HMODULE) + + 2 * (i + 1) * sizeof(IMAGE_THUNK_DATA); + ok(section.Misc.VirtualSize <= 0x1000, "Too much tests, add a new section!\n"); + section.Characteristics = IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_READ | IMAGE_SCN_MEM_WRITE; + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, §ion, sizeof(section), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + /* fill up to delay data */ + file_size = GetFileSize(hfile, NULL); + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, filler, + nt_header.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT].VirtualAddress - file_size, + &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + /* delay data */ + idd.Attributes.AllAttributes = 1; + idd.DllNameRVA = 0x2000; + idd.ModuleHandleRVA = idd.DllNameRVA + sizeof(test_dll) + sizeof(hint) + sizeof(test_func); + idd.ImportAddressTableRVA = idd.ModuleHandleRVA + sizeof(HMODULE); + idd.ImportNameTableRVA = idd.ImportAddressTableRVA + (i + 1) * sizeof(IMAGE_THUNK_DATA); + idd.BoundImportAddressTableRVA = 0; + idd.UnloadInformationTableRVA = 0; + idd.TimeDateStamp = 0; + + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, &idd, sizeof(idd), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, filler, sizeof(idd), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + /* fill up to extended delay data */ + file_size = GetFileSize(hfile, NULL); + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, filler, idd.DllNameRVA - file_size, &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + /* extended delay data */ + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, test_dll, sizeof(test_dll), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, &hint, sizeof(hint), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, test_func, sizeof(test_func), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + file_size = GetFileSize(hfile, NULL); + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, filler, idd.ImportNameTableRVA - file_size, &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) + { + if (td[i].func) + itd32.u1.AddressOfData = idd.DllNameRVA + sizeof(test_dll); + else + itd32.u1.Ordinal = td[i].ordinal; + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, &itd32, sizeof(itd32), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + } + + itd32.u1.Ordinal = 0; + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, &itd32, sizeof(itd32), &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + + /* fill up to eof */ + file_size = GetFileSize(hfile, NULL); + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, filler, section.VirtualAddress + section.Misc.VirtualSize - file_size, &dummy, NULL); + ok(ret, "WriteFile error %d\n", GetLastError()); + CloseHandle(hfile); + + SetLastError(0xdeadbeef); + hlib = LoadLibraryA(dll_name); + ok(hlib != NULL, "LoadLibrary error %u\n", GetLastError()); + if (!hlib) + { + skip("couldn't load %s.\n", dll_name); + DeleteFileA(dll_name); + return; + } + + delaydir = RtlImageDirectoryEntryToData(hlib, TRUE, IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT, &file_size); + if (!delaydir) + { + skip("haven't found section for delay import directory.\n"); + FreeLibrary(hlib); + DeleteFileA(dll_name); + return; + } + + for (;;) + { + IMAGE_THUNK_DATA *itdn, *itda; + HMODULE htarget; + + if (!delaydir->DllNameRVA || + !delaydir->ImportAddressTableRVA || + !delaydir->ImportNameTableRVA) break; + + itdn = RVAToAddr(delaydir->ImportNameTableRVA, hlib); + itda = RVAToAddr(delaydir->ImportAddressTableRVA, hlib); + htarget = LoadLibraryA(RVAToAddr(delaydir->DllNameRVA, hlib)); + + for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) + { + void *ret, *load; + + if (IMAGE_SNAP_BY_ORDINAL(itdn[i].u1.Ordinal)) + load = (void *)GetProcAddress(htarget, (LPSTR)IMAGE_ORDINAL(itdn[i].u1.Ordinal)); + else + { + const IMAGE_IMPORT_BY_NAME* iibn = RVAToAddr(itdn[i].u1.AddressOfData, hlib); + load = (void *)GetProcAddress(htarget, (char*)iibn->Name); + } + + cb_count = 0; + ret = pResolveDelayLoadedAPI(hlib, delaydir, failuredllhook, NULL, &itda[i], 0); + if (td[i].succeeds) + { + ok(ret != NULL, "Test %u: ResolveDelayLoadedAPI failed\n", i); + ok(ret == load, "Test %u: expected %p, got %p\n", i, load, ret); + ok(ret == (void*)itda[i].u1.AddressOfData, "Test %u: expected %p, got %p\n", + i, ret, (void*)itda[i].u1.AddressOfData); + ok(!cb_count, "Test %u: Wrong callback count: %d\n", i, cb_count); + } + else + { + ok(ret == (void*)0xdeadbeef, "Test %u: ResolveDelayLoadedAPI succeeded with %p\n", i, ret); + ok(cb_count, "Test %u: Wrong callback count: %d\n", i, cb_count); + } + } + delaydir++; + } + + FreeLibrary(hlib); + trace("deleting %s\n", dll_name); + DeleteFileA(dll_name); +} + START_TEST(loader) { int argc; char **argv; - HANDLE mapping; + HANDLE ntdll, mapping; + SYSTEM_INFO si; - pNtMapViewOfSection = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtMapViewOfSection"); - pNtUnmapViewOfSection = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtUnmapViewOfSection"); - pNtTerminateProcess = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtTerminateProcess"); - pNtQueryInformationProcess = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtQueryInformationProcess"); - pNtSetInformationProcess = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtSetInformationProcess"); - pLdrShutdownProcess = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "LdrShutdownProcess"); - pRtlDllShutdownInProgress = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "RtlDllShutdownInProgress"); - pNtAllocateVirtualMemory = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtAllocateVirtualMemory"); - pNtFreeVirtualMemory = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtFreeVirtualMemory"); - pLdrLockLoaderLock = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "LdrLockLoaderLock"); - pLdrUnlockLoaderLock = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "LdrUnlockLoaderLock"); - pRtlAcquirePebLock = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "RtlAcquirePebLock"); - pRtlReleasePebLock = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "RtlReleasePebLock"); + ntdll = GetModuleHandleA("ntdll.dll"); + pNtCreateSection = (void *)GetProcAddress(ntdll, "NtCreateSection"); + pNtMapViewOfSection = (void *)GetProcAddress(ntdll, "NtMapViewOfSection"); + pNtUnmapViewOfSection = (void *)GetProcAddress(ntdll, "NtUnmapViewOfSection"); + pNtTerminateProcess = (void *)GetProcAddress(ntdll, "NtTerminateProcess"); + pNtQueryInformationProcess = (void *)GetProcAddress(ntdll, "NtQueryInformationProcess"); + pNtSetInformationProcess = (void *)GetProcAddress(ntdll, "NtSetInformationProcess"); + pLdrShutdownProcess = (void *)GetProcAddress(ntdll, "LdrShutdownProcess"); + pRtlDllShutdownInProgress = (void *)GetProcAddress(ntdll, "RtlDllShutdownInProgress"); + pNtAllocateVirtualMemory = (void *)GetProcAddress(ntdll, "NtAllocateVirtualMemory"); + pNtFreeVirtualMemory = (void *)GetProcAddress(ntdll, "NtFreeVirtualMemory"); + pLdrLockLoaderLock = (void *)GetProcAddress(ntdll, "LdrLockLoaderLock"); + pLdrUnlockLoaderLock = (void *)GetProcAddress(ntdll, "LdrUnlockLoaderLock"); + pRtlAcquirePebLock = (void *)GetProcAddress(ntdll, "RtlAcquirePebLock"); + pRtlReleasePebLock = (void *)GetProcAddress(ntdll, "RtlReleasePebLock"); + pResolveDelayLoadedAPI = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "ResolveDelayLoadedAPI"); - mapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, "winetest_loader"); + GetSystemInfo( &si ); + page_size = si.dwPageSize; + dos_header.e_magic = IMAGE_DOS_SIGNATURE; + dos_header.e_lfanew = sizeof(dos_header); + + mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, "winetest_loader"); ok(mapping != 0, "CreateFileMapping failed\n"); child_failures = MapViewOfFile(mapping, FILE_MAP_READ|FILE_MAP_WRITE, 0, 0, 4096); if (*child_failures == -1) { - is_child = 1; *child_failures = 0; } else @@ -2226,7 +2797,9 @@ START_TEST(loader) } test_Loader(); + test_ResolveDelayLoadedAPI(); test_ImportDescriptors(); test_section_access(); + test_import_resolution(); test_ExitProcess(); } diff --git a/rostests/winetests/kernel32/locale.c b/rostests/winetests/kernel32/locale.c index 96013df92cb..4d4f9c25ccc 100755 --- a/rostests/winetests/kernel32/locale.c +++ b/rostests/winetests/kernel32/locale.c @@ -64,7 +64,7 @@ static inline WCHAR *strchrW( const WCHAR *str, WCHAR ch ) return NULL; } -static inline int isdigitW( WCHAR wc ) +static inline BOOL isdigitW( WCHAR wc ) { WORD type; GetStringTypeW( CT_CTYPE1, &wc, 1, &type ); @@ -75,9 +75,9 @@ static inline int isdigitW( WCHAR wc ) static HMODULE hKernel32; static WORD enumCount; -static BOOL (WINAPI *pEnumSystemLanguageGroupsA)(LANGUAGEGROUP_ENUMPROC, DWORD, LONG_PTR); -static BOOL (WINAPI *pEnumLanguageGroupLocalesA)(LANGGROUPLOCALE_ENUMPROC, LGRPID, DWORD, LONG_PTR); -static BOOL (WINAPI *pEnumUILanguagesA)(UILANGUAGE_ENUMPROC, DWORD, LONG_PTR); +static BOOL (WINAPI *pEnumSystemLanguageGroupsA)(LANGUAGEGROUP_ENUMPROCA, DWORD, LONG_PTR); +static BOOL (WINAPI *pEnumLanguageGroupLocalesA)(LANGGROUPLOCALE_ENUMPROCA, LGRPID, DWORD, LONG_PTR); +static BOOL (WINAPI *pEnumUILanguagesA)(UILANGUAGE_ENUMPROCA, DWORD, LONG_PTR); static BOOL (WINAPI *pEnumSystemLocalesEx)(LOCALE_ENUMPROCEX, DWORD, LPARAM, LPVOID); static INT (WINAPI *pLCMapStringEx)(LPCWSTR, DWORD, LPCWSTR, INT, LPWSTR, INT, LPNLSVERSIONINFO, LPVOID, LPARAM); static LCID (WINAPI *pLocaleNameToLCID)(LPCWSTR, DWORD); @@ -91,6 +91,8 @@ static INT (WINAPI *pIdnToUnicode)(DWORD, LPCWSTR, INT, LPWSTR, INT); static INT (WINAPI *pGetLocaleInfoEx)(LPCWSTR, LCTYPE, LPWSTR, INT); static BOOL (WINAPI *pIsValidLocaleName)(LPCWSTR); static INT (WINAPI *pCompareStringOrdinal)(const WCHAR *, INT, const WCHAR *, INT, BOOL); +static INT (WINAPI *pCompareStringEx)(LPCWSTR, DWORD, LPCWSTR, INT, LPCWSTR, INT, + LPNLSVERSIONINFO, LPVOID, LPARAM); static void InitFunctionPointers(void) { @@ -111,6 +113,7 @@ static void InitFunctionPointers(void) pGetLocaleInfoEx = (void*)GetProcAddress(hKernel32, "GetLocaleInfoEx"); pIsValidLocaleName = (void*)GetProcAddress(hKernel32, "IsValidLocaleName"); pCompareStringOrdinal = (void*)GetProcAddress(hKernel32, "CompareStringOrdinal"); + pCompareStringEx = (void*)GetProcAddress(hKernel32, "CompareStringEx"); } #define eq(received, expected, label, type) \ @@ -121,7 +124,7 @@ static void InitFunctionPointers(void) #define COUNTOF(x) (sizeof(x)/sizeof(x)[0]) #define STRINGSA(x,y) strcpy(input, x); strcpy(Expected, y); SetLastError(0xdeadbeef); buffer[0] = '\0' -#define EXPECT_LENA ok(ret == lstrlen(Expected)+1, "Expected Len %d, got %d\n", lstrlen(Expected)+1, ret) +#define EXPECT_LENA ok(ret == lstrlenA(Expected)+1, "Expected len %d, got %d\n", lstrlenA(Expected)+1, ret) #define EXPECT_EQA ok(strncmp(buffer, Expected, strlen(Expected)) == 0, \ "Expected '%s', got '%s'\n", Expected, buffer) @@ -660,21 +663,23 @@ static void test_GetDateFormatA(void) "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); STRINGSA("ddd',' MMM dd ''''yy","5/4/2002"); /* Default to DATE_SHORTDATE */ - ret = GetDateFormat(lcid, NUO, &curtime, NULL, buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid, NUO, &curtime, NULL, buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); if (strncmp(buffer, Expected, strlen(Expected)) && strncmp(buffer, "5/4/02", strlen(Expected)) != 0) ok (0, "Expected '%s' or '5/4/02', got '%s'\n", Expected, buffer); - STRINGSA("ddd',' MMM dd ''''yy", "Saturday, May 04, 2002"); /* DATE_LONGDATE */ - ret = GetDateFormat(lcid, NUO|DATE_LONGDATE, &curtime, NULL, buffer, COUNTOF(buffer)); + SetLastError(0xdeadbeef); buffer[0] = '\0'; /* DATE_LONGDATE */ + ret = GetDateFormatA(lcid, NUO|DATE_LONGDATE, &curtime, NULL, buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); - EXPECT_LENA; EXPECT_EQA; + ok(strcmp(buffer, "Saturday, May 04, 2002") == 0 || + strcmp(buffer, "Saturday, May 4, 2002") == 0 /* Win 8 */, + "got an unexpected date string '%s'\n", buffer); /* test for expected DATE_YEARMONTH behavior with null format */ /* NT4 returns ERROR_INVALID_FLAGS for DATE_YEARMONTH */ STRINGSA("ddd',' MMM dd ''''yy", ""); /* DATE_YEARMONTH */ SetLastError(0xdeadbeef); - ret = GetDateFormat(lcid, NUO|DATE_YEARMONTH, &curtime, input, buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid, NUO|DATE_YEARMONTH, &curtime, input, buffer, COUNTOF(buffer)); ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); EXPECT_EQA; @@ -683,12 +688,12 @@ static void test_GetDateFormatA(void) /* and return values */ STRINGSA("m/d/y", ""); /* Invalid flags */ SetLastError(0xdeadbeef); - ret = GetDateFormat(lcid, DATE_YEARMONTH|DATE_SHORTDATE|DATE_LONGDATE, + ret = GetDateFormatA(lcid, DATE_YEARMONTH|DATE_SHORTDATE|DATE_LONGDATE, &curtime, input, buffer, COUNTOF(buffer)); ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); - ret = GetDateFormat(lcid_ru, 0, &curtime, "ddMMMM", buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, "ddMMMM", buffer, COUNTOF(buffer)); if (!ret) { win_skip("LANG_RUSSIAN locale data unavailable\n"); @@ -697,37 +702,37 @@ static void test_GetDateFormatA(void) /* month part should be in genitive form */ strcpy(genitive_month, buffer + 2); - ret = GetDateFormat(lcid_ru, 0, &curtime, "MMMM", buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, "MMMM", buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); strcpy(month, buffer); ok(strcmp(genitive_month, month) != 0, "Expected different month forms\n"); - ret = GetDateFormat(lcid_ru, 0, &curtime, "ddd", buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, "ddd", buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); strcpy(short_day, buffer); STRINGSA("dd MMMMddd dd", ""); sprintf(Expected, "04 %s%s 04", genitive_month, short_day); - ret = GetDateFormat(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); EXPECT_EQA; STRINGSA("MMMMddd dd", ""); sprintf(Expected, "%s%s 04", month, short_day); - ret = GetDateFormat(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); EXPECT_EQA; STRINGSA("MMMMddd", ""); sprintf(Expected, "%s%s", month, short_day); - ret = GetDateFormat(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); EXPECT_EQA; STRINGSA("MMMMdd", ""); sprintf(Expected, "%s04", genitive_month); sprintf(Broken, "%s04", month); - ret = GetDateFormat(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); ok(strncmp(buffer, Expected, strlen(Expected)) == 0 || broken(strncmp(buffer, Broken, strlen(Broken)) == 0) /* nt4 */, @@ -736,7 +741,7 @@ static void test_GetDateFormatA(void) STRINGSA("MMMMdd ddd", ""); sprintf(Expected, "%s04 %s", genitive_month, short_day); sprintf(Broken, "%s04 %s", month, short_day); - ret = GetDateFormat(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); ok(strncmp(buffer, Expected, strlen(Expected)) == 0 || broken(strncmp(buffer, Broken, strlen(Broken)) == 0) /* nt4 */, @@ -744,14 +749,14 @@ static void test_GetDateFormatA(void) STRINGSA("dd dddMMMM", ""); sprintf(Expected, "04 %s%s", short_day, month); - ret = GetDateFormat(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); EXPECT_EQA; STRINGSA("dd dddMMMM ddd MMMMdd", ""); sprintf(Expected, "04 %s%s %s %s04", short_day, month, short_day, genitive_month); sprintf(Broken, "04 %s%s %s %s04", short_day, month, short_day, month); - ret = GetDateFormat(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); ok(strncmp(buffer, Expected, strlen(Expected)) == 0 || broken(strncmp(buffer, Broken, strlen(Broken)) == 0) /* nt4 */, @@ -761,7 +766,7 @@ static void test_GetDateFormatA(void) STRINGSA("ddd',' MMMM dd", ""); sprintf(Expected, "%s, %s 04", short_day, genitive_month); sprintf(Broken, "%s, %s 04", short_day, month); - ret = GetDateFormat(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); + ret = GetDateFormatA(lcid_ru, 0, &curtime, input, buffer, COUNTOF(buffer)); ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); ok(strncmp(buffer, Expected, strlen(Expected)) == 0 || broken(strncmp(buffer, Broken, strlen(Broken)) == 0) /* nt4 */, @@ -1455,7 +1460,7 @@ static void test_CompareStringA(void) ret = CompareStringA(lcid, NORM_IGNORECASE, "_", -1, ".", -1); todo_wine ok(ret == CSTR_GREATER_THAN, "\"_\" vs \".\" expected CSTR_GREATER_THAN, got %d\n", ret); - ret = lstrcmpi("#", "."); + ret = lstrcmpiA("#", "."); todo_wine ok(ret == -1, "\"#\" vs \".\" expected -1, got %d\n", ret); lcid = MAKELCID(MAKELANGID(LANG_POLISH, SUBLANG_DEFAULT), SORT_DEFAULT); @@ -1473,6 +1478,202 @@ static void test_CompareStringA(void) "ret %d, error %d, expected value %d\n", ret, GetLastError(), CSTR_EQUAL); } +struct comparestringex_test { + const char *locale; + DWORD flags; + const WCHAR first[2]; + const WCHAR second[2]; + INT ret; + INT broken; + BOOL todo; +}; + +static const struct comparestringex_test comparestringex_tests[] = { + /* default behavior */ + { /* 0 */ + "tr-TR", 0, + {'i',0}, {'I',0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 1 */ + "tr-TR", 0, + {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 2 */ + "tr-TR", 0, + {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 3 */ + "tr-TR", 0, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 4 */ + "tr-TR", 0, + {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 5 */ + "tr-TR", 0, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE + }, + /* with NORM_IGNORECASE */ + { /* 6 */ + "tr-TR", NORM_IGNORECASE, + {'i',0}, {'I',0}, CSTR_EQUAL, -1, FALSE + }, + { /* 7 */ + "tr-TR", NORM_IGNORECASE, + {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 8 */ + "tr-TR", NORM_IGNORECASE, + {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 9 */ + "tr-TR", NORM_IGNORECASE, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 10 */ + "tr-TR", NORM_IGNORECASE, + {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 11 */ + "tr-TR", NORM_IGNORECASE, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE + }, + /* with NORM_LINGUISTIC_CASING */ + { /* 12 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {'i',0}, {'I',0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + }, + { /* 13 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 14 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {'i',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + }, + { /* 15 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 16 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {'I',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + }, + { /* 17 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE + }, + /* with LINGUISTIC_IGNORECASE */ + { /* 18 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {'i',0}, {'I',0}, CSTR_EQUAL, -1, TRUE + }, + { /* 19 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 20 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 21 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 22 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 23 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE + }, + /* with NORM_LINGUISTIC_CASING | NORM_IGNORECASE */ + { /* 24 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {'i',0}, {'I',0}, CSTR_GREATER_THAN, CSTR_EQUAL, TRUE + }, + { /* 25 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {'i',0}, {0x130,0}, CSTR_EQUAL, CSTR_LESS_THAN, FALSE + }, + { /* 26 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {'i',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + }, + { /* 27 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 28 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {'I',0}, {0x131,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE + }, + { /* 29 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE + }, + /* with NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE */ + { /* 30 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {'i',0}, {'I',0}, CSTR_GREATER_THAN, CSTR_EQUAL, TRUE + }, + { /* 31 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {'i',0}, {0x130,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE + }, + { /* 32 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {'i',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + }, + { /* 33 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 34 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {'I',0}, {0x131,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE + }, + { /* 35 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + } +}; + +static void test_CompareStringEx(void) +{ + const char *op[] = {"ERROR", "CSTR_LESS_THAN", "CSTR_EQUAL", "CSTR_GREATER_THAN"}; + WCHAR locale[6]; + INT ret, i; + + /* CompareStringEx is only available on Vista+ */ + if (!pCompareStringEx) + { + win_skip("CompareStringEx not supported\n"); + return; + } + + for (i = 0; i < sizeof(comparestringex_tests)/sizeof(comparestringex_tests[0]); i++) + { + const struct comparestringex_test *e = &comparestringex_tests[i]; + + MultiByteToWideChar(CP_ACP, 0, e->locale, -1, locale, sizeof(locale)/sizeof(WCHAR)); + ret = pCompareStringEx(locale, e->flags, e->first, -1, e->second, -1, NULL, NULL, 0); + if (e->todo) + { + todo_wine ok(ret == e->ret || broken(ret == e->broken), + "%d: got %s, expected %s\n", i, op[ret], op[e->ret]); + } + else + { + ok(ret == e->ret || broken(ret == e->broken), + "%d: got %s, expected %s\n", i, op[ret], op[e->ret]); + } + } + +} + static void test_LCMapStringA(void) { int ret, ret2; @@ -2321,6 +2522,7 @@ static void test_FoldStringW(void) 0x0030, /* '0'-'9' */ 0x0660, /* Eastern Arabic */ 0x06F0, /* Arabic - Hindu */ + 0x07C0, /* Nko */ 0x0966, /* Devengari */ 0x09E6, /* Bengalii */ 0x0A66, /* Gurmukhi */ @@ -2332,16 +2534,37 @@ static void test_FoldStringW(void) 0x0D66, /* Maylayalam */ 0x0E50, /* Thai */ 0x0ED0, /* Laos */ - 0x0F29, /* Tibet - 0 is out of sequence */ + 0x0F20, /* Tibet */ + 0x0F29, /* Tibet half - 0 is out of sequence */ + 0x1040, /* Myanmar */ + 0x1090, /* Myanmar Shan */ + 0x1368, /* Ethiopic - no 0 */ + 0x17E0, /* Khmer */ + 0x1810, /* Mongolian */ + 0x1946, /* Limbu */ + 0x19D0, /* New Tai Lue */ + 0x1A80, /* Tai Tham Hora */ + 0x1A90, /* Tai Tham Tham */ + 0x1B50, /* Balinese */ + 0x1BB0, /* Sundanese */ + 0x1C40, /* Lepcha */ + 0x1C50, /* Ol Chiki */ 0x2070, /* Superscript - 1, 2, 3 are out of sequence */ 0x2080, /* Subscript */ 0x245F, /* Circled - 0 is out of sequence */ 0x2473, /* Bracketed */ 0x2487, /* Full stop */ + 0x24F4, /* Double Circled */ 0x2775, /* Inverted circled - No 0 */ 0x277F, /* Patterned circled - No 0 */ 0x2789, /* Inverted Patterned circled - No 0 */ 0x3020, /* Hangzhou */ + 0xA620, /* Vai */ + 0xA8D0, /* Saurashtra */ + 0xA900, /* Kayah Li */ + 0xA9D0, /* Javanese */ + 0xAA50, /* Cham */ + 0xABF0, /* Meetei Mayek */ 0xff10, /* Pliene chasse (?) */ 0xffff /* Terminator */ }; @@ -2351,8 +2574,17 @@ static void test_FoldStringW(void) 0xB9, /* Superscript 1 */ 0xB2, /* Superscript 2 */ 0xB3, /* Superscript 3 */ + 0x0C78, /* Telugu Fraction 0 */ + 0x0C79, /* Telugu Fraction 1 */ + 0x0C7A, /* Telugu Fraction 2 */ + 0x0C7B, /* Telugu Fraction 3 */ + 0x0C7C, /* Telugu Fraction 1 */ + 0x0C7D, /* Telugu Fraction 2 */ + 0x0C7E, /* Telugu Fraction 3 */ 0x0F33, /* Tibetan half zero */ + 0x19DA, /* New Tai Lue Tham 1 */ 0x24EA, /* Circled 0 */ + 0x24FF, /* Negative Circled 0 */ 0x3007, /* Ideographic number zero */ '\0' /* Terminator */ }; @@ -2361,8 +2593,10 @@ static void test_FoldStringW(void) { 0x0BE6, /* No Tamil 0 */ 0x0F29, /* No Tibetan half zero (out of sequence) */ + 0x1368, /* No Ethiopic 0 */ 0x2473, /* No Bracketed 0 */ 0x2487, /* No 0 Full stop */ + 0x24F4, /* No double circled 0 */ 0x2775, /* No inverted circled 0 */ 0x277F, /* No patterned circled */ 0x2789, /* No inverted Patterned circled */ @@ -2490,10 +2724,11 @@ static void test_FoldStringW(void) ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == ch || strchrW(outOfSequenceDigits, ch) || - /* Wine (correctly) maps all Unicode 4.0+ digits */ - isdigitW(ch) || (ch >= 0x24F5 && ch <= 0x24FD) || ch == 0x24FF || ch == 0x19da || - (ch >= 0x1369 && ch <= 0x1371), - "MAP_FOLDDIGITS: ch %d 0x%04x Expected unchanged got %d\n", ch, ch, dst[0]); + (ch >= 0xa8e0 && ch <= 0xa8e9), /* combining Devanagari on Win8 */ + "MAP_FOLDDIGITS: ch 0x%04x Expected unchanged got %04x\n", ch, dst[0]); + ok(!isdigitW(ch) || strchrW(outOfSequenceDigits, ch) || + broken( ch >= 0xbf0 && ch <= 0xbf2 ), /* win2k */ + "char %04x should not be a digit\n", ch ); } if (digitRanges[j] == 0xffff) @@ -2520,7 +2755,7 @@ static void test_FoldStringW(void) (digitRanges[j] == 0x3020 && dst[0] == ch) || /* Hangzhou not present in all Windows versions */ (digitRanges[j] == 0x0F29 && dst[0] == ch) || /* Tibetan not present in all Windows versions */ strchrW(noDigitAvailable, c), - "MAP_FOLDDIGITS: ch %d Expected %d got %d\n", + "MAP_FOLDDIGITS: ch %04x Expected %04x got %04x\n", ch, '0' + digitRanges[j] - ch, dst[0]); } prev_ch = ch; @@ -3108,6 +3343,7 @@ static void test_IdnToNameprepUnicode(void) DWORD in_len; const WCHAR in[64]; DWORD ret; + DWORD broken_ret; const WCHAR out[64]; DWORD flags; DWORD err; @@ -3115,77 +3351,77 @@ static void test_IdnToNameprepUnicode(void) } test_data[] = { { 5, {'t','e','s','t',0}, - 5, {'t','e','s','t',0}, + 5, 5, {'t','e','s','t',0}, 0, 0xdeadbeef }, { 3, {'a',0xe111,'b'}, - 0, {0}, + 0, 0, {0}, 0, ERROR_INVALID_NAME }, { 4, {'t',0,'e',0}, - 0, {0}, + 0, 0, {0}, 0, ERROR_INVALID_NAME }, { 1, {'T',0}, - 1, {'T',0}, + 1, 1, {'T',0}, 0, 0xdeadbeef }, { 1, {0}, - 0, {0}, + 0, 0, {0}, 0, ERROR_INVALID_NAME }, { 6, {' ','-','/','[',']',0}, - 6, {' ','-','/','[',']',0}, + 6, 6, {' ','-','/','[',']',0}, 0, 0xdeadbeef }, { 3, {'a','-','a'}, - 3, {'a','-','a'}, + 3, 3, {'a','-','a'}, IDN_USE_STD3_ASCII_RULES, 0xdeadbeef }, { 3, {'a','a','-'}, - 0, {0}, + 0, 0, {0}, IDN_USE_STD3_ASCII_RULES, ERROR_INVALID_NAME }, { /* FoldString is not working as expected when MAP_FOLDCZONE is specified (composition+compatibility) */ 10, {'T',0xdf,0x130,0x143,0x37a,0x6a,0x30c,' ',0xaa,0}, - 12, {'t','s','s','i',0x307,0x144,' ',0x3b9,0x1f0,' ','a',0}, + 12, 12, {'t','s','s','i',0x307,0x144,' ',0x3b9,0x1f0,' ','a',0}, 0, 0xdeadbeef, TRUE }, { 11, {'t',0xad,0x34f,0x1806,0x180b,0x180c,0x180d,0x200b,0x200c,0x200d,0}, - 2, {'t',0}, + 2, 0, {'t',0}, 0, 0xdeadbeef }, { /* Another example of incorrectly working FoldString (composition) */ 2, {0x3b0, 0}, - 2, {0x3b0, 0}, + 2, 2, {0x3b0, 0}, 0, 0xdeadbeef, TRUE }, { 2, {0x221, 0}, - 0, {0}, + 0, 2, {0}, 0, ERROR_NO_UNICODE_TRANSLATION }, { 2, {0x221, 0}, - 2, {0x221, 0}, + 2, 2, {0x221, 0}, IDN_ALLOW_UNASSIGNED, 0xdeadbeef }, { 5, {'a','.','.','a',0}, - 0, {0}, + 0, 0, {0}, 0, ERROR_INVALID_NAME }, { 3, {'a','.',0}, - 3, {'a','.',0}, + 3, 3, {'a','.',0}, 0, 0xdeadbeef }, }; @@ -3245,7 +3481,8 @@ static void test_IdnToNameprepUnicode(void) ret = pIdnToNameprepUnicode(4, NULL, 0, NULL, 0); err = GetLastError(); ok(ret == 0, "ret = %d\n", ret); - ok(err == ERROR_INVALID_FLAGS, "err = %d\n", err); + ok(err == ERROR_INVALID_FLAGS || err == ERROR_INVALID_PARAMETER /* Win8 */, + "err = %d\n", err); for (i=0; i=0) && (!done);i--) { if(path[i]=='.') - if(ext!=len) error=1; else ext=i; + if(ext!=len) error=TRUE; else ext=i; else if(path[i]=='\\') { if(i==len-1) { - error=1; + error=TRUE; } else { fil=i; - done=1; + done=TRUE; } } } @@ -293,7 +308,7 @@ static void test_setdir(CHAR *olddir,CHAR *newdir, "%s: SetCurrentDirectory did not change the directory, though it passed\n", errstr); ok(SetCurrentDirectoryA(olddir), - "%s: Couldn't set directory to it's original value\n",errstr); + "%s: Couldn't set directory to its original value\n",errstr); } else { /* else thest that it fails correctly */ chklen=lstrlenA(olddir); @@ -1058,7 +1073,7 @@ static void test_GetLongPathNameA(void) memset(temppath, 0, MAX_PATH); length = pGetLongPathNameA(tempfile, temppath, 4); /* We have a failure so length should be the minimum plus the terminating '0' */ - ok(length >= lstrlen(tempfile) + 1, "Wrong length\n"); + ok(length >= strlen(tempfile) + 1, "Wrong length\n"); ok(temppath[0] == 0, "Buffer should not have been touched\n"); /* Some UNC syntax tests */ @@ -1089,7 +1104,7 @@ static void test_GetLongPathNameA(void) /* Now an UNC path with the computername */ lstrcpyA(unc_prefix, "\\\\"); hostsize = sizeof(unc_prefix) - 2; - GetComputerName(unc_prefix + 2, &hostsize); + GetComputerNameA(unc_prefix + 2, &hostsize); lstrcatA(unc_prefix, "\\"); /* Create a short syntax for the whole unc path */ @@ -1302,7 +1317,7 @@ static void test_GetSystemDirectory(void) DWORD total; SetLastError(0xdeadbeef); - res = GetSystemDirectory(NULL, 0); + res = GetSystemDirectoryA(NULL, 0); /* res includes the terminating Zero */ ok(res > 0, "returned %d with %d (expected '>0')\n", res, GetLastError()); @@ -1310,10 +1325,10 @@ static void test_GetSystemDirectory(void) /* this crashes on XP */ if (0) - GetSystemDirectory(NULL, total); + GetSystemDirectoryA(NULL, total); SetLastError(0xdeadbeef); - res = GetSystemDirectory(NULL, total-1); + res = GetSystemDirectoryA(NULL, total-1); /* 95+NT: total (includes the terminating Zero) 98+ME: 0 with ERROR_INVALID_PARAMETER */ ok( (res == total) || (!res && (GetLastError() == ERROR_INVALID_PARAMETER)), @@ -1324,7 +1339,7 @@ static void test_GetSystemDirectory(void) buffer[0] = '\0'; SetLastError(0xdeadbeef); - res = GetSystemDirectory(buffer, total); + res = GetSystemDirectoryA(buffer, total); /* res does not include the terminating Zero */ ok( (res == (total-1)) && (buffer[0]), "returned %d with %d and '%s' (expected '%d' and a string)\n", @@ -1332,7 +1347,7 @@ static void test_GetSystemDirectory(void) buffer[0] = '\0'; SetLastError(0xdeadbeef); - res = GetSystemDirectory(buffer, total + 1); + res = GetSystemDirectoryA(buffer, total + 1); /* res does not include the terminating Zero */ ok( (res == (total-1)) && (buffer[0]), "returned %d with %d and '%s' (expected '%d' and a string)\n", @@ -1341,7 +1356,7 @@ static void test_GetSystemDirectory(void) memset(buffer, '#', total + 1); buffer[total + 2] = '\0'; SetLastError(0xdeadbeef); - res = GetSystemDirectory(buffer, total-1); + res = GetSystemDirectoryA(buffer, total-1); /* res includes the terminating Zero) */ ok( res == total, "returned %d with %d and '%s' (expected '%d')\n", res, GetLastError(), buffer, total); @@ -1349,7 +1364,7 @@ static void test_GetSystemDirectory(void) memset(buffer, '#', total + 1); buffer[total + 2] = '\0'; SetLastError(0xdeadbeef); - res = GetSystemDirectory(buffer, total-2); + res = GetSystemDirectoryA(buffer, total-2); /* res includes the terminating Zero) */ ok( res == total, "returned %d with %d and '%s' (expected '%d')\n", res, GetLastError(), buffer, total); @@ -1362,17 +1377,17 @@ static void test_GetWindowsDirectory(void) DWORD total; SetLastError(0xdeadbeef); - res = GetWindowsDirectory(NULL, 0); + res = GetWindowsDirectoryA(NULL, 0); /* res includes the terminating Zero */ ok(res > 0, "returned %d with %d (expected '>0')\n", res, GetLastError()); total = res; /* this crashes on XP */ if (0) - GetWindowsDirectory(NULL, total); + GetWindowsDirectoryA(NULL, total); SetLastError(0xdeadbeef); - res = GetWindowsDirectory(NULL, total-1); + res = GetWindowsDirectoryA(NULL, total-1); /* 95+NT: total (includes the terminating Zero) 98+ME: 0 with ERROR_INVALID_PARAMETER */ ok( (res == total) || (!res && (GetLastError() == ERROR_INVALID_PARAMETER)), @@ -1383,7 +1398,7 @@ static void test_GetWindowsDirectory(void) buffer[0] = '\0'; SetLastError(0xdeadbeef); - res = GetWindowsDirectory(buffer, total); + res = GetWindowsDirectoryA(buffer, total); /* res does not include the terminating Zero */ ok( (res == (total-1)) && (buffer[0]), "returned %d with %d and '%s' (expected '%d' and a string)\n", @@ -1391,7 +1406,7 @@ static void test_GetWindowsDirectory(void) buffer[0] = '\0'; SetLastError(0xdeadbeef); - res = GetWindowsDirectory(buffer, total + 1); + res = GetWindowsDirectoryA(buffer, total + 1); /* res does not include the terminating Zero */ ok( (res == (total-1)) && (buffer[0]), "returned %d with %d and '%s' (expected '%d' and a string)\n", @@ -1400,7 +1415,7 @@ static void test_GetWindowsDirectory(void) memset(buffer, '#', total + 1); buffer[total + 2] = '\0'; SetLastError(0xdeadbeef); - res = GetWindowsDirectory(buffer, total-1); + res = GetWindowsDirectoryA(buffer, total-1); /* res includes the terminating Zero) */ ok( res == total, "returned %d with %d and '%s' (expected '%d')\n", res, GetLastError(), buffer, total); @@ -1408,7 +1423,7 @@ static void test_GetWindowsDirectory(void) memset(buffer, '#', total + 1); buffer[total + 2] = '\0'; SetLastError(0xdeadbeef); - res = GetWindowsDirectory(buffer, total-2); + res = GetWindowsDirectoryA(buffer, total-2); /* res includes the terminating Zero) */ ok( res == total, "returned %d with %d and '%s' (expected '%d')\n", res, GetLastError(), buffer, total); @@ -1477,7 +1492,7 @@ static void test_drive_letter_case(void) memset(buf, 0, sizeof(buf)); SetLastError(0xdeadbeef); - ret = GetWindowsDirectory(buf, sizeof(buf)); + ret = GetWindowsDirectoryA(buf, sizeof(buf)); ok(ret, "GetWindowsDirectory error %u\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); @@ -1486,7 +1501,7 @@ static void test_drive_letter_case(void) /* re-use the buffer returned by GetFullPathName */ buf[2] = '/'; SetLastError(0xdeadbeef); - ret = GetFullPathName(buf + 2, sizeof(buf), buf, NULL); + ret = GetFullPathNameA(buf + 2, sizeof(buf), buf, NULL); ok(ret, "GetFullPathName error %u\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); @@ -1494,7 +1509,7 @@ static void test_drive_letter_case(void) memset(buf, 0, sizeof(buf)); SetLastError(0xdeadbeef); - ret = GetSystemDirectory(buf, sizeof(buf)); + ret = GetSystemDirectoryA(buf, sizeof(buf)); ok(ret, "GetSystemDirectory error %u\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); @@ -1502,7 +1517,7 @@ static void test_drive_letter_case(void) memset(buf, 0, sizeof(buf)); SetLastError(0xdeadbeef); - ret = GetCurrentDirectory(sizeof(buf), buf); + ret = GetCurrentDirectoryA(sizeof(buf), buf); ok(ret, "GetCurrentDirectory error %u\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); @@ -1511,7 +1526,7 @@ static void test_drive_letter_case(void) /* TEMP is an environment variable, so it can't be tested for case-sensitivity */ memset(buf, 0, sizeof(buf)); SetLastError(0xdeadbeef); - ret = GetTempPath(sizeof(buf), buf); + ret = GetTempPathA(sizeof(buf), buf); ok(ret, "GetTempPath error %u\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); if (buf[0]) @@ -1522,7 +1537,7 @@ static void test_drive_letter_case(void) memset(buf, 0, sizeof(buf)); SetLastError(0xdeadbeef); - ret = GetFullPathName(".", sizeof(buf), buf, NULL); + ret = GetFullPathNameA(".", sizeof(buf), buf, NULL); ok(ret, "GetFullPathName error %u\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); @@ -1530,7 +1545,7 @@ static void test_drive_letter_case(void) /* re-use the buffer returned by GetFullPathName */ SetLastError(0xdeadbeef); - ret = GetShortPathName(buf, buf, sizeof(buf)); + ret = GetShortPathNameA(buf, buf, sizeof(buf)); ok(ret, "GetShortPathName error %u\n", GetLastError()); ok(ret < sizeof(buf), "buffer should be %u bytes\n", ret); ok(buf[1] == ':', "expected buf[1] == ':' got %c\n", buf[1]); @@ -1549,10 +1564,90 @@ static void test_drive_letter_case(void) #undef is_upper_case_letter } +static const char manifest_dep[] = +"" +"" +" " +" " +" " +""; + +static const char manifest_main[] = +"" +"" +"" +" " +" " +" " +"" +""; + +static void create_manifest_file(const char *filename, const char *manifest) +{ + WCHAR path[MAX_PATH], manifest_path[MAX_PATH]; + HANDLE file; + DWORD size; + + MultiByteToWideChar( CP_ACP, 0, filename, -1, path, MAX_PATH ); + + GetTempPathW(sizeof(manifest_path)/sizeof(WCHAR), manifest_path); + lstrcatW(manifest_path, path); + + file = CreateFileW(manifest_path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + WriteFile(file, manifest, strlen(manifest), &size, NULL); + CloseHandle(file); +} + +static void delete_manifest_file(const char *filename) +{ + CHAR path[MAX_PATH]; + + GetTempPathA(sizeof(path), path); + strcat(path, filename); + DeleteFileA(path); +} + +static HANDLE test_create(const char *file) +{ + WCHAR path[MAX_PATH], manifest_path[MAX_PATH]; + ACTCTXW actctx; + HANDLE handle; + + MultiByteToWideChar(CP_ACP, 0, file, -1, path, MAX_PATH); + GetTempPathW(sizeof(manifest_path)/sizeof(WCHAR), manifest_path); + lstrcatW(manifest_path, path); + + memset(&actctx, 0, sizeof(ACTCTXW)); + actctx.cbSize = sizeof(ACTCTXW); + actctx.lpSource = manifest_path; + + handle = pCreateActCtxW(&actctx); + ok(handle != INVALID_HANDLE_VALUE, "failed to create context, error %u\n", GetLastError()); + + ok(actctx.cbSize == sizeof(actctx), "cbSize=%d\n", actctx.cbSize); + ok(actctx.dwFlags == 0, "dwFlags=%d\n", actctx.dwFlags); + ok(actctx.lpSource == manifest_path, "lpSource=%p\n", actctx.lpSource); + ok(actctx.wProcessorArchitecture == 0, "wProcessorArchitecture=%d\n", actctx.wProcessorArchitecture); + ok(actctx.wLangId == 0, "wLangId=%d\n", actctx.wLangId); + ok(actctx.lpAssemblyDirectory == NULL, "lpAssemblyDirectory=%p\n", actctx.lpAssemblyDirectory); + ok(actctx.lpResourceName == NULL, "lpResourceName=%p\n", actctx.lpResourceName); + ok(actctx.lpApplicationName == NULL, "lpApplicationName=%p\n", actctx.lpApplicationName); + ok(actctx.hModule == NULL, "hModule=%p\n", actctx.hModule); + + return handle; +} + static void test_SearchPathA(void) { - CHAR pathA[MAX_PATH], fileA[] = "", buffA[MAX_PATH]; + static const CHAR testdepA[] = "testdep.dll"; + static const CHAR testdeprelA[] = "./testdep.dll"; + static const CHAR kernel32A[] = "kernel32.dll"; + static const CHAR fileA[] = ""; + CHAR pathA[MAX_PATH], buffA[MAX_PATH], path2A[MAX_PATH]; CHAR *ptrA = NULL; + ULONG_PTR cookie; + HANDLE handle; DWORD ret; if (!pSearchPathA) @@ -1576,12 +1671,73 @@ static void test_SearchPathA(void) ok(ret == 0, "Expected failure, got %d\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError()); + + if (!pActivateActCtx) + return; + + create_manifest_file("testdep1.manifest", manifest_dep); + create_manifest_file("main.manifest", manifest_main); + + handle = test_create("main.manifest"); + delete_manifest_file("testdep1.manifest"); + delete_manifest_file("main.manifest"); + + /* search fails without active context */ + ret = pSearchPathA(NULL, testdepA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, NULL); + ok(ret == 0, "got %d\n", ret); + + ret = pSearchPathA(NULL, kernel32A, NULL, sizeof(path2A)/sizeof(CHAR), path2A, NULL); + ok(ret && ret == strlen(path2A), "got %d\n", ret); + + ret = pActivateActCtx(handle, &cookie); + ok(ret, "failed to activate context, %u\n", GetLastError()); + + /* works when activated */ + ret = pSearchPathA(NULL, testdepA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, NULL); + ok(ret && ret == strlen(buffA), "got %d\n", ret); + + ret = pSearchPathA(NULL, "testdep.dll", ".ext", sizeof(buffA)/sizeof(CHAR), buffA, NULL); + ok(ret && ret == strlen(buffA), "got %d\n", ret); + + ret = pSearchPathA(NULL, "testdep", ".dll", sizeof(buffA)/sizeof(CHAR), buffA, NULL); + ok(ret && ret == strlen(buffA), "got %d\n", ret); + + ret = pSearchPathA(NULL, "testdep", ".ext", sizeof(buffA)/sizeof(CHAR), buffA, NULL); + ok(!ret, "got %d\n", ret); + + /* name contains path */ + ret = pSearchPathA(NULL, testdeprelA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, NULL); + ok(!ret, "got %d\n", ret); + + /* fails with specified path that doesn't contain this file */ + ret = pSearchPathA(pathA, testdepA, NULL, sizeof(buffA)/sizeof(CHAR), buffA, NULL); + ok(!ret, "got %d\n", ret); + + /* path is redirected for wellknown names too */ + ret = pSearchPathA(NULL, kernel32A, NULL, sizeof(buffA)/sizeof(CHAR), buffA, NULL); + ok(ret && ret == strlen(buffA), "got %d\n", ret); + ok(strcmp(buffA, path2A), "got wrong path %s, %s\n", buffA, path2A); + + ret = pDeactivateActCtx(0, cookie); + ok(ret, "failed to deactivate context, %u\n", GetLastError()); + pReleaseActCtx(handle); } static void test_SearchPathW(void) { - WCHAR pathW[MAX_PATH], fileW[] = { 0 }, buffW[MAX_PATH]; + static const WCHAR testdeprelW[] = {'.','/','t','e','s','t','d','e','p','.','d','l','l',0}; + static const WCHAR testdepW[] = {'t','e','s','t','d','e','p','.','d','l','l',0}; + static const WCHAR testdep1W[] = {'t','e','s','t','d','e','p',0}; + static const WCHAR kernel32dllW[] = {'k','e','r','n','e','l','3','2','.','d','l','l',0}; + static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2',0}; + static const WCHAR ole32W[] = {'o','l','e','3','2',0}; + static const WCHAR extW[] = {'.','e','x','t',0}; + static const WCHAR dllW[] = {'.','d','l','l',0}; + static const WCHAR fileW[] = { 0 }; + WCHAR pathW[MAX_PATH], buffW[MAX_PATH], path2W[MAX_PATH]; WCHAR *ptrW = NULL; + ULONG_PTR cookie; + HANDLE handle; DWORD ret; if (!pSearchPathW) @@ -1596,12 +1752,75 @@ if (0) pSearchPathW(pathW, NULL, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, &ptrW); } + GetWindowsDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR)); + /* empty filename */ SetLastError(0xdeadbeef); ret = pSearchPathW(pathW, fileW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, &ptrW); ok(ret == 0, "Expected failure, got %d\n", ret); ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %x\n", GetLastError()); + + if (!pActivateActCtx) + return; + + create_manifest_file("testdep1.manifest", manifest_dep); + create_manifest_file("main.manifest", manifest_main); + + handle = test_create("main.manifest"); + delete_manifest_file("testdep1.manifest"); + delete_manifest_file("main.manifest"); + + /* search fails without active context */ + ret = pSearchPathW(NULL, testdepW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL); + ok(ret == 0, "got %d\n", ret); + + ret = pSearchPathW(NULL, kernel32dllW, NULL, sizeof(path2W)/sizeof(WCHAR), path2W, NULL); + ok(ret && ret == lstrlenW(path2W), "got %d\n", ret); + + /* full path, name without 'dll' extension */ + GetSystemDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR)); + ret = pSearchPathW(pathW, kernel32W, NULL, sizeof(path2W)/sizeof(WCHAR), path2W, NULL); + ok(ret == 0, "got %d\n", ret); + + GetWindowsDirectoryW(pathW, sizeof(pathW)/sizeof(WCHAR)); + + ret = pActivateActCtx(handle, &cookie); + ok(ret, "failed to activate context, %u\n", GetLastError()); + + /* works when activated */ + ret = pSearchPathW(NULL, testdepW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL); + ok(ret && ret == lstrlenW(buffW), "got %d\n", ret); + + ret = pSearchPathW(NULL, testdepW, extW, sizeof(buffW)/sizeof(WCHAR), buffW, NULL); + ok(ret && ret == lstrlenW(buffW), "got %d\n", ret); + + ret = pSearchPathW(NULL, testdep1W, dllW, sizeof(buffW)/sizeof(WCHAR), buffW, NULL); + ok(ret && ret == lstrlenW(buffW), "got %d\n", ret); + + ret = pSearchPathW(NULL, testdep1W, extW, sizeof(buffW)/sizeof(WCHAR), buffW, NULL); + ok(!ret, "got %d\n", ret); + + /* name contains path */ + ret = pSearchPathW(NULL, testdeprelW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL); + ok(!ret, "got %d\n", ret); + + /* fails with specified path that doesn't contain this file */ + ret = pSearchPathW(pathW, testdepW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL); + ok(!ret, "got %d\n", ret); + + /* path is redirected for wellknown names too, meaning it takes precedence over normal search order */ + ret = pSearchPathW(NULL, kernel32dllW, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL); + ok(ret && ret == lstrlenW(buffW), "got %d\n", ret); + ok(lstrcmpW(buffW, path2W), "got wrong path %s, %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(path2W)); + + /* path is built using on manifest file name */ + ret = pSearchPathW(NULL, ole32W, NULL, sizeof(buffW)/sizeof(WCHAR), buffW, NULL); + ok(ret && ret == lstrlenW(buffW), "got %d\n", ret); + + ret = pDeactivateActCtx(0, cookie); + ok(ret, "failed to deactivate context, %u\n", GetLastError()); + pReleaseActCtx(handle); } static void test_GetFullPathNameA(void) @@ -1717,9 +1936,72 @@ static void init_pointers(void) MAKEFUNC(NeedCurrentDirectoryForExePathW); MAKEFUNC(SearchPathA); MAKEFUNC(SearchPathW); + MAKEFUNC(ActivateActCtx); + MAKEFUNC(CreateActCtxW); + MAKEFUNC(DeactivateActCtx); + MAKEFUNC(GetCurrentActCtx); + MAKEFUNC(ReleaseActCtx); #undef MAKEFUNC } +static void test_relative_path(void) +{ + char path[MAX_PATH], buf[MAX_PATH]; + HANDLE file; + int ret; + + if (!pGetLongPathNameA) return; + + GetTempPathA(MAX_PATH, path); + ret = SetCurrentDirectoryA(path); + ok(ret, "SetCurrentDirectory error %d\n", GetLastError()); + + ret = CreateDirectoryA("foo", NULL); + ok(ret, "CreateDirectory error %d\n", GetLastError()); + file = CreateFileA("foo\\file", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + ok(file != INVALID_HANDLE_VALUE, "failed to create temp file\n"); + CloseHandle(file); + ret = CreateDirectoryA("bar", NULL); + ok(ret, "CreateDirectory error %d\n", GetLastError()); + ret = SetCurrentDirectoryA("bar"); + ok(ret, "SetCurrentDirectory error %d\n", GetLastError()); + + ret = GetFileAttributesA("..\\foo\\file"); + ok(ret != INVALID_FILE_ATTRIBUTES, "GetFileAttributes error %d\n", GetLastError()); + + strcpy(buf, "deadbeef"); + ret = pGetLongPathNameA(".", buf, MAX_PATH); + ok(ret, "GetLongPathName error %d\n", GetLastError()); + ok(!strcmp(buf, "."), "expected ., got %s\n", buf); + strcpy(buf, "deadbeef"); + ret = GetShortPathNameA(".", buf, MAX_PATH); + ok(ret, "GetShortPathName error %d\n", GetLastError()); + ok(!strcmp(buf, "."), "expected ., got %s\n", buf); + + strcpy(buf, "deadbeef"); + ret = pGetLongPathNameA("..", buf, MAX_PATH); + ok(ret, "GetLongPathName error %d\n", GetLastError()); + ok(!strcmp(buf, ".."), "expected .., got %s\n", buf); + strcpy(buf, "deadbeef"); + ret = GetShortPathNameA("..", buf, MAX_PATH); + ok(ret, "GetShortPathName error %d\n", GetLastError()); + ok(!strcmp(buf, ".."), "expected .., got %s\n", buf); + + strcpy(buf, "deadbeef"); + ret = pGetLongPathNameA("..\\foo\\file", buf, MAX_PATH); + ok(ret, "GetLongPathName error %d\n", GetLastError()); + ok(!strcmp(buf, "..\\foo\\file"), "expected ..\\foo\\file, got %s\n", buf); + strcpy(buf, "deadbeef"); + ret = GetShortPathNameA("..\\foo\\file", buf, MAX_PATH); + ok(ret, "GetShortPathName error %d\n", GetLastError()); + ok(!strcmp(buf, "..\\foo\\file"), "expected ..\\foo\\file, got %s\n", buf); + + SetCurrentDirectoryA(".."); + DeleteFileA("foo\\file"); + RemoveDirectoryA("foo"); + RemoveDirectoryA("bar"); +} + START_TEST(path) { CHAR origdir[MAX_PATH],curdir[MAX_PATH], curDrive, otherDrive; @@ -1731,7 +2013,10 @@ START_TEST(path) win_skip("GetLongPathNameA is not available\n"); if (!pGetLongPathNameW) win_skip("GetLongPathNameW is not available\n"); + if (!pActivateActCtx) + win_skip("Activation contexts not supported, some tests will be skipped\n"); + test_relative_path(); test_InitPathA(curdir, &curDrive, &otherDrive); test_CurrentDirectoryA(origdir,curdir); test_PathNameA(curdir, curDrive, otherDrive); diff --git a/rostests/winetests/kernel32/pipe.c b/rostests/winetests/kernel32/pipe.c index 923c0e7adc3..b192f967d51 100755 --- a/rostests/winetests/kernel32/pipe.c +++ b/rostests/winetests/kernel32/pipe.c @@ -21,12 +21,11 @@ #include #include -#include -#include -#include -#include -#include - +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winternl.h" #include "wine/test.h" #define PIPENAME "\\\\.\\PiPe\\tests_pipe.c" @@ -62,7 +61,7 @@ static void test_CreateNamedPipe(int pipemode) else trace("test_CreateNamedPipe starting in message mode\n"); /* Bad parameter checks */ - hnp = CreateNamedPipe("not a named pipe", PIPE_ACCESS_DUPLEX, pipemode | PIPE_WAIT, + hnp = CreateNamedPipeA("not a named pipe", PIPE_ACCESS_DUPLEX, pipemode | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -74,7 +73,7 @@ static void test_CreateNamedPipe(int pipemode) if (pipemode == PIPE_TYPE_BYTE) { /* Bad parameter checks */ - hnp = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_MESSAGE, + hnp = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_MESSAGE, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -84,7 +83,7 @@ static void test_CreateNamedPipe(int pipemode) "CreateNamedPipe should fail with PIPE_TYPE_BYTE | PIPE_READMODE_MESSAGE\n"); } - hnp = CreateNamedPipe(NULL, + hnp = CreateNamedPipeA(NULL, PIPE_ACCESS_DUPLEX, pipemode | PIPE_WAIT, 1, 1024, 1024, NMPWAIT_USE_DEFAULT_WAIT, NULL); ok(hnp == INVALID_HANDLE_VALUE && GetLastError() == ERROR_PATH_NOT_FOUND, @@ -97,7 +96,7 @@ static void test_CreateNamedPipe(int pipemode) /* Functional checks */ - hnp = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, pipemode | PIPE_WAIT, + hnp = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, pipemode | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -338,7 +337,7 @@ static void test_CreateNamedPipe_instances_must_match(void) HANDLE hnp, hnp2; /* Check no mismatch */ - hnp = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, + hnp = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 2, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -346,7 +345,7 @@ static void test_CreateNamedPipe_instances_must_match(void) /* lpSecurityAttrib */ NULL); ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n"); - hnp2 = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, + hnp2 = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 2, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -358,7 +357,7 @@ static void test_CreateNamedPipe_instances_must_match(void) ok(CloseHandle(hnp2), "CloseHandle\n"); /* Check nMaxInstances */ - hnp = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, + hnp = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -366,7 +365,7 @@ static void test_CreateNamedPipe_instances_must_match(void) /* lpSecurityAttrib */ NULL); ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n"); - hnp2 = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, + hnp2 = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -378,7 +377,7 @@ static void test_CreateNamedPipe_instances_must_match(void) ok(CloseHandle(hnp), "CloseHandle\n"); /* Check PIPE_ACCESS_* */ - hnp = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, + hnp = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 2, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -386,7 +385,7 @@ static void test_CreateNamedPipe_instances_must_match(void) /* lpSecurityAttrib */ NULL); ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n"); - hnp2 = CreateNamedPipe(PIPENAME, PIPE_ACCESS_INBOUND, PIPE_TYPE_BYTE | PIPE_WAIT, + hnp2 = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_INBOUND, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 2, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -398,7 +397,7 @@ static void test_CreateNamedPipe_instances_must_match(void) ok(CloseHandle(hnp), "CloseHandle\n"); /* check everything else */ - hnp = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, + hnp = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 4, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -406,7 +405,7 @@ static void test_CreateNamedPipe_instances_must_match(void) /* lpSecurityAttrib */ NULL); ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n"); - hnp2 = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE, + hnp2 = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_MESSAGE, /* nMaxInstances */ 3, /* nOutBufSize */ 102, /* nInBufSize */ 24, @@ -440,7 +439,7 @@ static DWORD CALLBACK serverThreadMain1(LPVOID arg) trace("serverThreadMain1 start\n"); /* Set up a simple echo server */ - hnp = CreateNamedPipe(PIPENAME "serverThreadMain1", PIPE_ACCESS_DUPLEX, + hnp = CreateNamedPipeA(PIPENAME "serverThreadMain1", PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, @@ -453,7 +452,7 @@ static DWORD CALLBACK serverThreadMain1(LPVOID arg) char buf[512]; DWORD written; DWORD readden; - DWORD success; + BOOL success; /* Wait for client to connect */ trace("Server calling ConnectNamedPipe...\n"); @@ -492,7 +491,7 @@ static DWORD CALLBACK serverThreadMain2(LPVOID arg) trace("serverThreadMain2\n"); /* Set up a simple echo server */ - hnp = CreateNamedPipe(PIPENAME "serverThreadMain2", PIPE_ACCESS_DUPLEX, + hnp = CreateNamedPipeA(PIPENAME "serverThreadMain2", PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 2, /* nOutBufSize */ 1024, @@ -505,13 +504,15 @@ static DWORD CALLBACK serverThreadMain2(LPVOID arg) char buf[512]; DWORD written; DWORD readden; - DWORD success; + DWORD ret; + BOOL success; + user_apc_ran = FALSE; if (i == 0 && pQueueUserAPC) { trace("Queueing an user APC\n"); /* verify the pipe is non alerable */ - success = pQueueUserAPC(&user_apc, GetCurrentThread(), 0); - ok(success, "QueueUserAPC failed: %d\n", GetLastError()); + ret = pQueueUserAPC(&user_apc, GetCurrentThread(), 0); + ok(ret, "QueueUserAPC failed: %d\n", GetLastError()); } /* Wait for client to connect */ @@ -544,7 +545,7 @@ static DWORD CALLBACK serverThreadMain2(LPVOID arg) /* Set up next echo server */ hnpNext = - CreateNamedPipe(PIPENAME "serverThreadMain2", PIPE_ACCESS_DUPLEX, + CreateNamedPipeA(PIPENAME "serverThreadMain2", PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 2, /* nOutBufSize */ 1024, @@ -568,7 +569,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg) trace("serverThreadMain3\n"); /* Set up a simple echo server */ - hnp = CreateNamedPipe(PIPENAME "serverThreadMain3", PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + hnp = CreateNamedPipeA(PIPENAME "serverThreadMain3", PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, @@ -577,7 +578,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg) /* lpSecurityAttrib */ NULL); ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n"); - hEvent = CreateEvent(NULL, /* security attribute */ + hEvent = CreateEventW(NULL, /* security attribute */ TRUE, /* manual reset event */ FALSE, /* initial state */ NULL); /* name */ @@ -588,7 +589,7 @@ static DWORD CALLBACK serverThreadMain3(LPVOID arg) DWORD written; DWORD readden; DWORD dummy; - DWORD success; + BOOL success; OVERLAPPED oOverlap; int letWFSOEwait = (i & 2); int letGORwait = (i & 1); @@ -697,7 +698,7 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg) trace("serverThreadMain4\n"); /* Set up a simple echo server */ - hnp = CreateNamedPipe(PIPENAME "serverThreadMain4", PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + hnp = CreateNamedPipeA(PIPENAME "serverThreadMain4", PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, @@ -714,7 +715,7 @@ static DWORD CALLBACK serverThreadMain4(LPVOID arg) DWORD written; DWORD readden; DWORD dummy; - DWORD success; + BOOL success; OVERLAPPED oConnect; OVERLAPPED oRead; OVERLAPPED oWrite; @@ -820,7 +821,7 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg) trace("serverThreadMain5\n"); /* Set up a simple echo server */ - hnp = CreateNamedPipe(PIPENAME "serverThreadMain5", PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, + hnp = CreateNamedPipeA(PIPENAME "serverThreadMain5", PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, @@ -829,7 +830,7 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg) /* lpSecurityAttrib */ NULL); ok(hnp != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n"); - hEvent = CreateEvent(NULL, /* security attribute */ + hEvent = CreateEventW(NULL, /* security attribute */ TRUE, /* manual reset event */ FALSE, /* initial state */ NULL); /* name */ @@ -838,7 +839,7 @@ static DWORD CALLBACK serverThreadMain5(LPVOID arg) for (i = 0; i < NB_SERVER_LOOPS; i++) { char buf[512]; DWORD readden; - DWORD success; + BOOL success; OVERLAPPED oOverlap; DWORD err; @@ -964,7 +965,7 @@ static void test_NamedPipe_2(void) trace("test_NamedPipe_2 starting\n"); /* Set up a twenty second timeout */ - alarm_event = CreateEvent( NULL, TRUE, FALSE, NULL ); + alarm_event = CreateEventW( NULL, TRUE, FALSE, NULL ); SetLastError(0xdeadbeef); alarmThread = CreateThread(NULL, 0, alarmThreadMain, (void *) 20000, 0, &alarmThreadId); ok(alarmThread != NULL, "CreateThread failed: %d\n", GetLastError()); @@ -1020,7 +1021,7 @@ static int test_DisconnectNamedPipe(void) DWORD ret; SetLastError(0xdeadbeef); - hnp = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, + hnp = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, /* nInBufSize */ 1024, @@ -1177,7 +1178,7 @@ static DWORD CALLBACK named_pipe_client_func(LPVOID p) CloseHandle(process_token); } - pipe = CreateFile(PIPE_NAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, params->security_flags, NULL); + pipe = CreateFileA(PIPE_NAME, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, params->security_flags, NULL); ok(pipe != INVALID_HANDLE_VALUE, "CreateFile for pipe failed with error %d\n", GetLastError()); ret = WriteFile(pipe, message, sizeof(message), &bytes_written, NULL); @@ -1258,7 +1259,7 @@ static void test_ImpersonateNamedPipeClient(HANDLE hClientToken, DWORD security_ SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; DWORD size; - hPipeServer = CreateNamedPipe(PIPE_NAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, 1, 100, 100, NMPWAIT_USE_DEFAULT_WAIT, NULL); + hPipeServer = CreateNamedPipeA(PIPE_NAME, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT, 1, 100, 100, NMPWAIT_USE_DEFAULT_WAIT, NULL); ok(hPipeServer != INVALID_HANDLE_VALUE, "CreateNamedPipe failed with error %d\n", GetLastError()); params.security_flags = security_flags; @@ -1646,7 +1647,7 @@ static void test_NamedPipeHandleState(void) DWORD state, instances, maxCollectionCount, collectDataTimeout; char userName[MAX_PATH]; - server = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, + server = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, /* dwOpenMode */ PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, @@ -1654,10 +1655,10 @@ static void test_NamedPipeHandleState(void) /* nDefaultWait */ NMPWAIT_USE_DEFAULT_WAIT, /* lpSecurityAttrib */ NULL); ok(server != INVALID_HANDLE_VALUE, "cf failed\n"); - ret = GetNamedPipeHandleState(server, NULL, NULL, NULL, NULL, NULL, 0); + ret = GetNamedPipeHandleStateA(server, NULL, NULL, NULL, NULL, NULL, 0); todo_wine ok(ret, "GetNamedPipeHandleState failed: %d\n", GetLastError()); - ret = GetNamedPipeHandleState(server, &state, &instances, NULL, NULL, NULL, + ret = GetNamedPipeHandleStateA(server, &state, &instances, NULL, NULL, NULL, 0); todo_wine ok(ret, "GetNamedPipeHandleState failed: %d\n", GetLastError()); @@ -1670,7 +1671,7 @@ static void test_NamedPipeHandleState(void) * on a local pipe. */ SetLastError(0xdeadbeef); - ret = GetNamedPipeHandleState(server, &state, &instances, + ret = GetNamedPipeHandleStateA(server, &state, &instances, &maxCollectionCount, &collectDataTimeout, userName, sizeof(userName) / sizeof(userName[0])); todo_wine @@ -1703,7 +1704,7 @@ static void test_NamedPipeHandleState(void) CloseHandle(client); CloseHandle(server); - server = CreateNamedPipe(PIPENAME, PIPE_ACCESS_DUPLEX, + server = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX, /* dwOpenMode */ PIPE_TYPE_MESSAGE | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, @@ -1711,10 +1712,10 @@ static void test_NamedPipeHandleState(void) /* nDefaultWait */ NMPWAIT_USE_DEFAULT_WAIT, /* lpSecurityAttrib */ NULL); ok(server != INVALID_HANDLE_VALUE, "cf failed\n"); - ret = GetNamedPipeHandleState(server, NULL, NULL, NULL, NULL, NULL, 0); + ret = GetNamedPipeHandleStateA(server, NULL, NULL, NULL, NULL, NULL, 0); todo_wine ok(ret, "GetNamedPipeHandleState failed: %d\n", GetLastError()); - ret = GetNamedPipeHandleState(server, &state, &instances, NULL, NULL, NULL, + ret = GetNamedPipeHandleStateA(server, &state, &instances, NULL, NULL, NULL, 0); todo_wine ok(ret, "GetNamedPipeHandleState failed: %d\n", GetLastError()); @@ -1761,7 +1762,7 @@ static void test_readfileex_pending(void) const char test_string[] = "test"; int i; - server = CreateNamedPipe(PIPENAME, FILE_FLAG_OVERLAPPED | PIPE_ACCESS_DUPLEX, + server = CreateNamedPipeA(PIPENAME, FILE_FLAG_OVERLAPPED | PIPE_ACCESS_DUPLEX, /* dwOpenMode */ PIPE_TYPE_BYTE | PIPE_WAIT, /* nMaxInstances */ 1, /* nOutBufSize */ 1024, @@ -1855,6 +1856,51 @@ static void test_readfileex_pending(void) ok(completion_errorcode == 0, "completion called with error %x\n", completion_errorcode); ok(completion_lpoverlapped == &overlapped, "completion called with wrong overlapped pointer\n"); + num_bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadFile(INVALID_HANDLE_VALUE, read_buf, 0, &num_bytes, NULL); + ok(!ret, "ReadFile should fail\n"); + ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError()); + ok(num_bytes == 0, "expected 0, got %u\n", num_bytes); + + S(U(overlapped)).Offset = 0; + S(U(overlapped)).OffsetHigh = 0; + overlapped.Internal = -1; + overlapped.InternalHigh = -1; + overlapped.hEvent = event; + num_bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadFile(server, read_buf, 0, &num_bytes, &overlapped); +todo_wine + ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); + ok(num_bytes == 0, "bytes %u\n", num_bytes); + ok((NTSTATUS)overlapped.Internal == STATUS_PENDING, "expected STATUS_PENDING, got %#lx\n", overlapped.Internal); +todo_wine + ok(overlapped.InternalHigh == -1, "expected -1, got %lu\n", overlapped.InternalHigh); + + wait = WaitForSingleObject(event, 100); + ok(wait == WAIT_TIMEOUT, "WaitForSingleObject returned %x\n", wait); + + num_bytes = 0xdeadbeef; + ret = WriteFile(client, test_string, 1, &num_bytes, NULL); + ok(ret, "WriteFile failed\n"); + ok(num_bytes == 1, "bytes %u\n", num_bytes); + + wait = WaitForSingleObject(event, 100); +todo_wine + ok(wait == WAIT_OBJECT_0, "WaitForSingleObject returned %x\n", wait); + + ok(num_bytes == 1, "bytes %u\n", num_bytes); +todo_wine + ok((NTSTATUS)overlapped.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", overlapped.Internal); + ok(overlapped.InternalHigh == 0, "expected 0, got %lu\n", overlapped.InternalHigh); + + /* read the pending byte and clear the pipe */ + num_bytes = 0xdeadbeef; + ret = ReadFile(server, read_buf, 1, &num_bytes, &overlapped); + ok(ret, "ReadFile failed\n"); + ok(num_bytes == 1, "bytes %u\n", num_bytes); + CloseHandle(client); CloseHandle(server); CloseHandle(event); @@ -1864,9 +1910,9 @@ START_TEST(pipe) { HMODULE hmod; - hmod = GetModuleHandle("advapi32.dll"); + hmod = GetModuleHandleA("advapi32.dll"); pDuplicateTokenEx = (void *) GetProcAddress(hmod, "DuplicateTokenEx"); - hmod = GetModuleHandle("kernel32.dll"); + hmod = GetModuleHandleA("kernel32.dll"); pQueueUserAPC = (void *) GetProcAddress(hmod, "QueueUserAPC"); if (test_DisconnectNamedPipe()) diff --git a/rostests/winetests/kernel32/process.c b/rostests/winetests/kernel32/process.c index 34396058360..aa6658da6c3 100755 --- a/rostests/winetests/kernel32/process.c +++ b/rostests/winetests/kernel32/process.c @@ -35,6 +35,9 @@ #include "wine/test.h" +/* PROCESS_ALL_ACCESS in Vista+ PSDKs is incompatible with older Windows versions */ +#define PROCESS_ALL_ACCESS_NT4 (PROCESS_ALL_ACCESS & ~0xf000) + #define expect_eq_d(expected, actual) \ do { \ int value = (actual); \ @@ -183,12 +186,12 @@ static WCHAR* decodeW(const char* str) * exename: executable without the path * function-pointers, which are not implemented in all windows versions */ -static int init(void) +static BOOL init(void) { char *p; myARGC = winetest_get_mainargs( &myARGV ); - if (!GetCurrentDirectoryA(sizeof(base), base)) return 0; + if (!GetCurrentDirectoryA(sizeof(base), base)) return FALSE; strcpy(selfname, myARGV[0]); /* Strip the path of selfname */ @@ -206,7 +209,7 @@ static int init(void) pQueryFullProcessImageNameA = (void *) GetProcAddress(hkernel32, "QueryFullProcessImageNameA"); pQueryFullProcessImageNameW = (void *) GetProcAddress(hkernel32, "QueryFullProcessImageNameW"); pK32GetProcessImageFileNameA = (void *) GetProcAddress(hkernel32, "K32GetProcessImageFileNameA"); - return 1; + return TRUE; } /****************************************************************** @@ -1522,7 +1525,7 @@ static void test_OpenProcess(void) } /* without PROCESS_VM_OPERATION */ - hproc = OpenProcess(PROCESS_ALL_ACCESS & ~PROCESS_VM_OPERATION, FALSE, GetCurrentProcessId()); + hproc = OpenProcess(PROCESS_ALL_ACCESS_NT4 & ~PROCESS_VM_OPERATION, FALSE, GetCurrentProcessId()); ok(hproc != NULL, "OpenProcess error %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -1665,7 +1668,7 @@ static void test_GetProcessImageFileNameA(void) length = sizeof(image); expect_eq_d(TRUE, pQueryFullProcessImageNameA(GetCurrentProcess(), PROCESS_NAME_NATIVE, image, &length)); expect_eq_d(length, lstrlenA(image)); - ok(lstrcmpi(process, image) == 0, "expected '%s' to be equal to '%s'\n", process, image); + ok(lstrcmpiA(process, image) == 0, "expected '%s' to be equal to '%s'\n", process, image); } } @@ -1691,7 +1694,7 @@ static void test_QueryFullProcessImageNameA(void) expect_eq_d(TRUE, pQueryFullProcessImageNameA(GetCurrentProcess(), 0, buf, &length)); expect_eq_d(length, lstrlenA(buf)); ok((buf[0] == '\\' && buf[1] == '\\') || - lstrcmpi(buf, module) == 0, "expected %s to match %s\n", buf, module); + lstrcmpiA(buf, module) == 0, "expected %s to match %s\n", buf, module); /* when the buffer is too small * - function fail with error ERROR_INSUFFICIENT_BUFFER @@ -1930,14 +1933,14 @@ static void test_TerminateProcess(void) { static char cmdline[] = "winver.exe"; PROCESS_INFORMATION pi; - STARTUPINFO si; + STARTUPINFOA si; DWORD ret; HANDLE dummy, thread; memset(&si, 0, sizeof(si)); si.cb = sizeof(si); SetLastError(0xdeadbeef); - ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi); + ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, CREATE_SUSPENDED, NULL, NULL, &si, &pi); ok(ret, "CreateProcess error %u\n", GetLastError()); SetLastError(0xdeadbeef); @@ -1990,9 +1993,9 @@ static void test_DuplicateHandle(void) ok(out != GetCurrentProcess(), "out = GetCurrentProcess()\n"); CloseHandle(out); - GetTempPath(MAX_PATH, path); - GetTempFileName(path, "wt", 0, file_name); - f = CreateFile(file_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + GetTempPathA(MAX_PATH, path); + GetTempFileNameA(path, "wt", 0, file_name); + f = CreateFileA(file_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); if (f == INVALID_HANDLE_VALUE) { ok(0, "could not create %s\n", file_name); @@ -2043,9 +2046,9 @@ static void test_DuplicateHandle(void) ok(r, "DuplicateHandle error %u\n", GetLastError()); ok(f == out, "f != out\n"); CloseHandle(out); - DeleteFile(file_name); + DeleteFileA(file_name); - f = CreateFile("CONIN$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); + f = CreateFileA("CONIN$", GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, 0); if (!is_console(f)) { skip("DuplicateHandle on console handle\n"); @@ -2062,7 +2065,7 @@ static void test_DuplicateHandle(void) START_TEST(process) { - int b = init(); + BOOL b = init(); ok(b, "Basic init of CreateProcess test\n"); if (!b) return; diff --git a/rostests/winetests/kernel32/profile.c b/rostests/winetests/kernel32/profile.c index 211d0c6075d..2eb90a83ad8 100755 --- a/rostests/winetests/kernel32/profile.c +++ b/rostests/winetests/kernel32/profile.c @@ -92,12 +92,12 @@ static void test_profile_int(void) static void test_profile_string(void) { - static WCHAR emptyW[] = { 0 }; - static WCHAR keyW[] = { 'k','e','y',0 }; - static WCHAR sW[] = { 's',0 }; - static WCHAR TESTFILE2W[] = {'.','\\','t','e','s','t','w','i','n','e','2','.','i','n','i',0}; - static WCHAR valsectionW[] = {'v','a','l','_','e','_','s','e','c','t','i','o','n',0 }; - static WCHAR valnokeyW[] = {'v','a','l','_','n','o','_','k','e','y',0}; + static WCHAR emptyW[] = { 0 }; /* if "const", GetPrivateProfileStringW(emptyW, ...) crashes on win2k */ + static const WCHAR keyW[] = { 'k','e','y',0 }; + static const WCHAR sW[] = { 's',0 }; + static const WCHAR TESTFILE2W[] = {'.','\\','t','e','s','t','w','i','n','e','2','.','i','n','i',0}; + static const WCHAR valsectionW[] = {'v','a','l','_','e','_','s','e','c','t','i','o','n',0 }; + static const WCHAR valnokeyW[] = {'v','a','l','_','n','o','_','k','e','y',0}; HANDLE h; int ret; DWORD count; @@ -382,19 +382,19 @@ static void test_profile_existing(void) for (i=0; i < sizeof(pe)/sizeof(pe[0]); i++) { - h = CreateFile(testfile1, pe[i].dwDesiredAccess, pe[i].dwShareMode, NULL, + h = CreateFileA(testfile1, pe[i].dwDesiredAccess, pe[i].dwShareMode, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); ok(INVALID_HANDLE_VALUE != h, "%d: CreateFile failed\n",i); SetLastError(0xdeadbeef); - ret = WritePrivateProfileString(SECTION, KEY, "12345", testfile1); + ret = WritePrivateProfileStringA(SECTION, KEY, "12345", testfile1); if (!pe[i].write_error) { if (!ret) ok( broken(GetLastError() == pe[i].broken_error), "%d: WritePrivateProfileString failed with error %u\n", i, GetLastError() ); CloseHandle(h); - size = GetPrivateProfileString(SECTION, KEY, 0, buffer, MAX_PATH, testfile1); + size = GetPrivateProfileStringA(SECTION, KEY, 0, buffer, MAX_PATH, testfile1); if (ret) ok( size == 5, "%d: test failed, number of characters copied: %d instead of 5\n", i, size ); else @@ -408,21 +408,21 @@ static void test_profile_existing(void) ok( err == pe[i].write_error, "%d: WritePrivateProfileString failed with error %u/%u\n", i, err, pe[i].write_error ); CloseHandle(h); - size = GetPrivateProfileString(SECTION, KEY, 0, buffer, MAX_PATH, testfile1); + size = GetPrivateProfileStringA(SECTION, KEY, 0, buffer, MAX_PATH, testfile1); ok( !size, "%d: test failed, number of characters copied: %d instead of 0\n", i, size ); } - ok( DeleteFile(testfile1), "delete failed\n" ); + ok( DeleteFileA(testfile1), "delete failed\n" ); } - h = CreateFile(testfile2, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + h = CreateFileA(testfile2, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); sprintf( buffer, "[%s]\r\n%s=123\r\n", SECTION, KEY ); ok( WriteFile( h, buffer, strlen(buffer), &size, NULL ), "failed to write\n" ); CloseHandle( h ); for (i=0; i < sizeof(pe)/sizeof(pe[0]); i++) { - h = CreateFile(testfile2, pe[i].dwDesiredAccess, pe[i].dwShareMode, NULL, + h = CreateFileA(testfile2, pe[i].dwDesiredAccess, pe[i].dwShareMode, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); ok(INVALID_HANDLE_VALUE != h, "%d: CreateFile failed\n",i); SetLastError(0xdeadbeef); @@ -436,24 +436,24 @@ static void test_profile_existing(void) ok( !ret, "%d: GetPrivateProfileString succeeded\n", i ); CloseHandle(h); } - ok( DeleteFile(testfile2), "delete failed\n" ); + ok( DeleteFileA(testfile2), "delete failed\n" ); } static void test_profile_delete_on_close(void) { - static CHAR testfile[] = ".\\testwine5.ini"; HANDLE h; DWORD size, res; + static const CHAR testfile[] = ".\\testwine5.ini"; static const char contents[] = "[" SECTION "]\n" KEY "=123\n"; - h = CreateFile(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, + h = CreateFileA(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); res = WriteFile( h, contents, sizeof contents - 1, &size, NULL ); ok( res, "Cannot write test file: %x\n", GetLastError() ); ok( size == sizeof contents - 1, "Test file: partial write\n"); SetLastError(0xdeadbeef); - res = GetPrivateProfileInt(SECTION, KEY, 0, testfile); + res = GetPrivateProfileIntA(SECTION, KEY, 0, testfile); ok( res == 123 || broken(res == 0 && GetLastError() == ERROR_SHARING_VIOLATION), /* Win9x, WinME */ "Got %d instead of 123\n", res); @@ -464,20 +464,20 @@ static void test_profile_delete_on_close(void) static void test_profile_refresh(void) { - static CHAR testfile[] = ".\\winetest4.ini"; + static const CHAR testfile[] = ".\\winetest4.ini"; HANDLE h; DWORD size, res; static const char contents1[] = "[" SECTION "]\n" KEY "=123\n"; static const char contents2[] = "[" SECTION "]\n" KEY "=124\n"; - h = CreateFile(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, + h = CreateFileA(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); res = WriteFile( h, contents1, sizeof contents1 - 1, &size, NULL ); ok( res, "Cannot write test file: %x\n", GetLastError() ); ok( size == sizeof contents1 - 1, "Test file: partial write\n"); SetLastError(0xdeadbeef); - res = GetPrivateProfileInt(SECTION, KEY, 0, testfile); + res = GetPrivateProfileIntA(SECTION, KEY, 0, testfile); ok( res == 123 || broken(res == 0 && GetLastError() == ERROR_SHARING_VIOLATION), /* Win9x, WinME */ "Got %d instead of 123\n", res); @@ -486,14 +486,14 @@ static void test_profile_refresh(void) /* Test proper invalidation of wine's profile file cache */ - h = CreateFile(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, + h = CreateFileA(testfile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL); res = WriteFile( h, contents2, sizeof contents2 - 1, &size, NULL ); ok( res, "Cannot write test file: %x\n", GetLastError() ); ok( size == sizeof contents2 - 1, "Test file: partial write\n"); SetLastError(0xdeadbeef); - res = GetPrivateProfileInt(SECTION, KEY, 0, testfile); + res = GetPrivateProfileIntA(SECTION, KEY, 0, testfile); ok( res == 124 || broken(res == 0 && GetLastError() == 0xdeadbeef), /* Win9x, WinME */ "Got %d instead of 124\n", res); @@ -503,7 +503,7 @@ static void test_profile_refresh(void) /* Cache must be invalidated if file no longer exists and default must be returned */ SetLastError(0xdeadbeef); - res = GetPrivateProfileInt(SECTION, KEY, 421, testfile); + res = GetPrivateProfileIntA(SECTION, KEY, 421, testfile); ok( res == 421 || broken(res == 0 && GetLastError() == 0xdeadbeef), /* Win9x, WinME */ "Got %d instead of 421\n", res); @@ -1019,18 +1019,22 @@ static void test_WritePrivateProfileString(void) broken(GetLastError() == ERROR_PATH_NOT_FOUND), /* Win9x and WinME */ "Expected ERROR_ACCESS_DENIED, got %d\n", GetLastError()); - /* The resulting file will be X:\\%WINDIR%\\win1.tmp */ + /* Relative paths are relative to X:\\%WINDIR% */ GetWindowsDirectoryA(temp, MAX_PATH); GetTempFileNameA(temp, "win", 1, path); - DeleteFileA(path); + if (GetFileAttributesA(path) == INVALID_FILE_ATTRIBUTES) + skip("Not allowed to create a file in the Windows directory\n"); + else + { + DeleteFileA(path); - /* relative path in lpFileName */ - data = "[App]\r\n" - "key=string\r\n"; - ret = WritePrivateProfileStringA("App", "key", "string", "win1.tmp"); - ok(ret == TRUE, "Expected TRUE, got %d\n", ret); - ok(check_file_data(path, data), "File doesn't match\n"); - DeleteFileA(path); + data = "[App]\r\n" + "key=string\r\n"; + ret = WritePrivateProfileStringA("App", "key", "string", "win1.tmp"); + ok(ret == TRUE, "Expected TRUE, got %d, le=%u\n", ret, GetLastError()); + ok(check_file_data(path, data), "File doesn't match\n"); + DeleteFileA(path); + } GetTempPathA(MAX_PATH, temp); GetTempFileNameA(temp, "wine", 0, path); diff --git a/rostests/winetests/kernel32/resource.c b/rostests/winetests/kernel32/resource.c index a85e6d2daa1..f94fed644ad 100644 --- a/rostests/winetests/kernel32/resource.c +++ b/rostests/winetests/kernel32/resource.c @@ -255,7 +255,7 @@ static int build_exe( const sec_build* sec_descr ) file_size = phys_end_of_section; } - file = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + file = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); ok (file != INVALID_HANDLE_VALUE, "failed to create file\n"); /* write out the header */ @@ -279,7 +279,7 @@ static void update_missing_exe( void ) HANDLE res; SetLastError(0xdeadbeef); - res = BeginUpdateResource( filename, TRUE ); + res = BeginUpdateResourceA( filename, TRUE ); GLE = GetLastError(); ok( res == NULL, "BeginUpdateResource should fail\n"); } @@ -289,29 +289,29 @@ static void update_empty_exe( void ) HANDLE file, res, test; BOOL r; - file = CreateFile(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); + file = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); ok (file != INVALID_HANDLE_VALUE, "failed to create file\n"); CloseHandle( file ); - res = BeginUpdateResource( filename, TRUE ); + res = BeginUpdateResourceA( filename, TRUE ); if ( res != NULL || GetLastError() != ERROR_FILE_INVALID ) { ok( res != NULL, "BeginUpdateResource failed\n"); /* check if it's possible to open the file now */ - test = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); + test = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); ok (test != INVALID_HANDLE_VALUE, "failed to create file\n"); CloseHandle( test ); - r = EndUpdateResource( res, FALSE ); + r = EndUpdateResourceA( res, FALSE ); ok( r == FALSE, "EndUpdateResource failed\n"); } else skip( "Can't update resource in empty file\n" ); - res = BeginUpdateResource( filename, FALSE ); + res = BeginUpdateResourceA( filename, FALSE ); ok( res == NULL, "BeginUpdateResource failed\n"); } @@ -320,10 +320,10 @@ static void update_resources_none( void ) HMODULE res; BOOL r; - res = BeginUpdateResource( filename, FALSE ); + res = BeginUpdateResourceA( filename, FALSE ); ok( res != NULL, "BeginUpdateResource failed\n"); - r = EndUpdateResource( res, FALSE ); + r = EndUpdateResourceA( res, FALSE ); ok( r, "EndUpdateResource failed\n"); } @@ -332,10 +332,10 @@ static void update_resources_delete( void ) HMODULE res; BOOL r; - res = BeginUpdateResource( filename, TRUE ); + res = BeginUpdateResourceA( filename, TRUE ); ok( res != NULL, "BeginUpdateResource failed\n"); - r = EndUpdateResource( res, FALSE ); + r = EndUpdateResourceA( res, FALSE ); ok( r, "EndUpdateResource failed\n"); } @@ -345,27 +345,27 @@ static void update_resources_version( void ) BOOL r; char foo[] = "red and white"; - res = BeginUpdateResource( filename, TRUE ); + res = BeginUpdateResourceA( filename, TRUE ); ok( res != NULL, "BeginUpdateResource failed\n"); if (0) /* this causes subsequent tests to fail on Vista */ { - r = UpdateResource( res, - MAKEINTRESOURCE(0x1230), - MAKEINTRESOURCE(0x4567), + r = UpdateResourceA( res, + MAKEINTRESOURCEA(0x1230), + MAKEINTRESOURCEA(0x4567), 0xabcd, NULL, 0 ); ok( r == FALSE, "UpdateResource failed\n"); } - r = UpdateResource( res, - MAKEINTRESOURCE(0x1230), - MAKEINTRESOURCE(0x4567), + r = UpdateResourceA( res, + MAKEINTRESOURCEA(0x1230), + MAKEINTRESOURCEA(0x4567), 0xabcd, foo, sizeof foo ); ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError()); - r = EndUpdateResource( res, FALSE ); + r = EndUpdateResourceA( res, FALSE ); ok( r, "EndUpdateResource failed: %d\n", GetLastError()); } @@ -375,17 +375,17 @@ static void update_resources_bigdata( void ) BOOL r; char foo[2*page_size] = "foobar"; - res = BeginUpdateResource( filename, TRUE ); + res = BeginUpdateResourceA( filename, TRUE ); ok( res != NULL, "BeginUpdateResource succeeded\n"); - r = UpdateResource( res, - MAKEINTRESOURCE(0x3012), - MAKEINTRESOURCE(0x5647), + r = UpdateResourceA( res, + MAKEINTRESOURCEA(0x3012), + MAKEINTRESOURCEA(0x5647), 0xcdba, foo, sizeof foo ); ok( r == TRUE, "UpdateResource failed: %d\n", GetLastError()); - r = EndUpdateResource( res, FALSE ); + r = EndUpdateResourceA( res, FALSE ); ok( r, "EndUpdateResource failed\n"); } @@ -399,13 +399,13 @@ static void check_exe( const sec_verify *verify ) HANDLE file, mapping; DWORD length, sec_count = 0; - file = CreateFile(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); + file = CreateFileA(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); ok (file != INVALID_HANDLE_VALUE, "failed to create file (%d)\n", GetLastError()); length = GetFileSize( file, NULL ); ok( length >= verify->length, "file size wrong\n"); - mapping = CreateFileMapping( file, NULL, PAGE_READONLY, 0, 0, NULL ); + mapping = CreateFileMappingA( file, NULL, PAGE_READONLY, 0, 0, NULL ); ok (mapping != NULL, "failed to create file\n"); dos = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, length ); @@ -458,33 +458,33 @@ static void test_find_resource(void) { HRSRC rsrc; - rsrc = FindResourceW( GetModuleHandle(0), (LPCWSTR)MAKEINTRESOURCE(1), (LPCWSTR)RT_MENU ); + rsrc = FindResourceW( GetModuleHandleW(NULL), MAKEINTRESOURCEW(1), (LPCWSTR)RT_MENU ); ok( rsrc != 0, "resource not found\n" ); - rsrc = FindResourceExW( GetModuleHandle(0), (LPCWSTR)RT_MENU, (LPCWSTR)MAKEINTRESOURCE(1), + rsrc = FindResourceExW( GetModuleHandleW(NULL), (LPCWSTR)RT_MENU, MAKEINTRESOURCEW(1), MAKELANGID( LANG_NEUTRAL, SUBLANG_NEUTRAL )); ok( rsrc != 0, "resource not found\n" ); - rsrc = FindResourceExW( GetModuleHandle(0), (LPCWSTR)RT_MENU, (LPCWSTR)MAKEINTRESOURCE(1), + rsrc = FindResourceExW( GetModuleHandleW(NULL), (LPCWSTR)RT_MENU, MAKEINTRESOURCEW(1), MAKELANGID( LANG_GERMAN, SUBLANG_DEFAULT )); ok( rsrc != 0, "resource not found\n" ); SetLastError( 0xdeadbeef ); - rsrc = FindResourceW( GetModuleHandle(0), (LPCWSTR)MAKEINTRESOURCE(1), (LPCWSTR)RT_DIALOG ); + rsrc = FindResourceW( GetModuleHandleW(NULL), MAKEINTRESOURCEW(1), (LPCWSTR)RT_DIALOG ); ok( !rsrc, "resource found\n" ); ok( GetLastError() == ERROR_RESOURCE_TYPE_NOT_FOUND, "wrong error %u\n", GetLastError() ); SetLastError( 0xdeadbeef ); - rsrc = FindResourceW( GetModuleHandle(0), (LPCWSTR)MAKEINTRESOURCE(2), (LPCWSTR)RT_MENU ); + rsrc = FindResourceW( GetModuleHandleW(NULL), MAKEINTRESOURCEW(2), (LPCWSTR)RT_MENU ); ok( !rsrc, "resource found\n" ); ok( GetLastError() == ERROR_RESOURCE_NAME_NOT_FOUND, "wrong error %u\n", GetLastError() ); SetLastError( 0xdeadbeef ); - rsrc = FindResourceExW( GetModuleHandle(0), (LPCWSTR)RT_MENU, (LPCWSTR)MAKEINTRESOURCE(1), + rsrc = FindResourceExW( GetModuleHandleW(NULL), (LPCWSTR)RT_MENU, MAKEINTRESOURCEW(1), MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT ) ); ok( !rsrc, "resource found\n" ); ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %u\n", GetLastError() ); SetLastError( 0xdeadbeef ); - rsrc = FindResourceExW( GetModuleHandle(0), (LPCWSTR)RT_MENU, (LPCWSTR)MAKEINTRESOURCE(1), + rsrc = FindResourceExW( GetModuleHandleW(NULL), (LPCWSTR)RT_MENU, MAKEINTRESOURCEW(1), MAKELANGID( LANG_FRENCH, SUBLANG_DEFAULT ) ); ok( !rsrc, "resource found\n" ); ok( GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND, "wrong error %u\n", GetLastError() ); @@ -494,7 +494,7 @@ START_TEST(resource) { DWORD i; - DeleteFile( filename ); + DeleteFileA( filename ); update_missing_exe(); if (GLE == ERROR_CALL_NOT_IMPLEMENTED) @@ -517,7 +517,7 @@ START_TEST(resource) check_exe( &sec->chk_version ); update_resources_bigdata(); check_exe( &sec->chk_bigdata ); - DeleteFile( filename ); + DeleteFileA( filename ); } test_find_resource(); } diff --git a/rostests/winetests/kernel32/sync.c b/rostests/winetests/kernel32/sync.c index 7b9612bb96f..674e2ec3141 100755 --- a/rostests/winetests/kernel32/sync.c +++ b/rostests/winetests/kernel32/sync.c @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define _WIN32_WINNT 0x600 +//#define _WIN32_WINNT 0x500 #include #include #include @@ -44,9 +44,18 @@ static BOOL (WINAPI *pInitOnceComplete)(PINIT_ONCE,DWORD,LPVOID); static VOID (WINAPI *pInitializeConditionVariable)(PCONDITION_VARIABLE); static BOOL (WINAPI *pSleepConditionVariableCS)(PCONDITION_VARIABLE,PCRITICAL_SECTION,DWORD); +static BOOL (WINAPI *pSleepConditionVariableSRW)(PCONDITION_VARIABLE,PSRWLOCK,DWORD,ULONG); static VOID (WINAPI *pWakeAllConditionVariable)(PCONDITION_VARIABLE); static VOID (WINAPI *pWakeConditionVariable)(PCONDITION_VARIABLE); +static VOID (WINAPI *pInitializeSRWLock)(PSRWLOCK); +static VOID (WINAPI *pAcquireSRWLockExclusive)(PSRWLOCK); +static VOID (WINAPI *pAcquireSRWLockShared)(PSRWLOCK); +static VOID (WINAPI *pReleaseSRWLockExclusive)(PSRWLOCK); +static VOID (WINAPI *pReleaseSRWLockShared)(PSRWLOCK); +static BOOLEAN (WINAPI *pTryAcquireSRWLockExclusive)(PSRWLOCK); +static BOOLEAN (WINAPI *pTryAcquireSRWLockShared)(PSRWLOCK); + static void test_signalandwait(void) { DWORD (WINAPI *pSignalObjectAndWait)(HANDLE, HANDLE, DWORD, BOOL); @@ -54,7 +63,7 @@ static void test_signalandwait(void) DWORD r; HANDLE event[2], semaphore[2], file; - kernel32 = GetModuleHandle("kernel32"); + kernel32 = GetModuleHandleA("kernel32.dll"); pSignalObjectAndWait = (void*) GetProcAddress(kernel32, "SignalObjectAndWait"); if (!pSignalObjectAndWait) @@ -69,8 +78,8 @@ static void test_signalandwait(void) } ok( r == WAIT_FAILED, "should fail\n"); - event[0] = CreateEvent(NULL, 0, 0, NULL); - event[1] = CreateEvent(NULL, 1, 1, NULL); + event[0] = CreateEventW(NULL, 0, 0, NULL); + event[1] = CreateEventW(NULL, 1, 1, NULL); ok( event[0] && event[1], "failed to create event flags\n"); @@ -105,8 +114,8 @@ static void test_signalandwait(void) CloseHandle(event[1]); /* semaphores */ - semaphore[0] = CreateSemaphore( NULL, 0, 1, NULL ); - semaphore[1] = CreateSemaphore( NULL, 1, 1, NULL ); + semaphore[0] = CreateSemaphoreW( NULL, 0, 1, NULL ); + semaphore[1] = CreateSemaphoreW( NULL, 1, 1, NULL ); ok( semaphore[0] && semaphore[1], "failed to create semaphore\n"); r = pSignalObjectAndWait(semaphore[0], semaphore[1], 0, FALSE); @@ -125,7 +134,7 @@ static void test_signalandwait(void) CloseHandle(semaphore[1]); /* try a registry key */ - file = CreateFile("x", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + file = CreateFileA("x", GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_DELETE_ON_CLOSE, NULL); r = pSignalObjectAndWait(file, file, 0, FALSE); ok( r == WAIT_FAILED, "should fail\n"); @@ -143,23 +152,23 @@ static void test_mutex(void) DWORD failed = 0; SetLastError(0xdeadbeef); - hOpened = OpenMutex(0, FALSE, "WineTestMutex"); + hOpened = OpenMutexA(0, FALSE, "WineTestMutex"); ok(hOpened == NULL, "OpenMutex succeeded\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); SetLastError(0xdeadbeef); - hCreated = CreateMutex(NULL, FALSE, "WineTestMutex"); + hCreated = CreateMutexA(NULL, FALSE, "WineTestMutex"); ok(hCreated != NULL, "CreateMutex failed with error %d\n", GetLastError()); SetLastError(0xdeadbeef); - hOpened = OpenMutex(0, FALSE, "WineTestMutex"); + hOpened = OpenMutexA(0, FALSE, "WineTestMutex"); todo_wine ok(hOpened == NULL, "OpenMutex succeeded\n"); todo_wine ok(GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError()); SetLastError(0xdeadbeef); - hOpened = OpenMutex(GENERIC_EXECUTE, FALSE, "WineTestMutex"); + hOpened = OpenMutexA(GENERIC_EXECUTE, FALSE, "WineTestMutex"); ok(hOpened != NULL, "OpenMutex failed with error %d\n", GetLastError()); wait_ret = WaitForSingleObject(hOpened, INFINITE); ok(wait_ret == WAIT_OBJECT_0, "WaitForSingleObject failed with error %d\n", GetLastError()); @@ -172,7 +181,7 @@ todo_wine } SetLastError(0xdeadbeef); - hOpened = OpenMutex(GENERIC_READ | GENERIC_WRITE, FALSE, "WineTestMutex"); + hOpened = OpenMutexA(GENERIC_READ | GENERIC_WRITE, FALSE, "WineTestMutex"); ok(hOpened != NULL, "OpenMutex failed with error %d\n", GetLastError()); wait_ret = WaitForSingleObject(hOpened, INFINITE); ok(wait_ret == WAIT_FAILED, "WaitForSingleObject succeeded\n"); @@ -181,7 +190,7 @@ todo_wine for (i = 0; i < 32; i++) { SetLastError(0xdeadbeef); - hOpened = OpenMutex(0x1 << i, FALSE, "WineTestMutex"); + hOpened = OpenMutexA(0x1 << i, FALSE, "WineTestMutex"); if(hOpened != NULL) { SetLastError(0xdeadbeef); @@ -211,23 +220,23 @@ todo_wine /* test case sensitivity */ SetLastError(0xdeadbeef); - hOpened = OpenMutex(READ_CONTROL, FALSE, "WINETESTMUTEX"); + hOpened = OpenMutexA(READ_CONTROL, FALSE, "WINETESTMUTEX"); ok(!hOpened, "OpenMutex succeeded\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); SetLastError(0xdeadbeef); - hOpened = OpenMutex(READ_CONTROL, FALSE, "winetestmutex"); + hOpened = OpenMutexA(READ_CONTROL, FALSE, "winetestmutex"); ok(!hOpened, "OpenMutex succeeded\n"); ok(GetLastError() == ERROR_FILE_NOT_FOUND, "wrong error %u\n", GetLastError()); SetLastError(0xdeadbeef); - hOpened = CreateMutex(NULL, FALSE, "WineTestMutex"); + hOpened = CreateMutexA(NULL, FALSE, "WineTestMutex"); ok(hOpened != NULL, "CreateMutex failed with error %d\n", GetLastError()); ok(GetLastError() == ERROR_ALREADY_EXISTS, "wrong error %u\n", GetLastError()); CloseHandle(hOpened); SetLastError(0xdeadbeef); - hOpened = CreateMutex(NULL, FALSE, "WINETESTMUTEX"); + hOpened = CreateMutexA(NULL, FALSE, "WINETESTMUTEX"); ok(hOpened != NULL, "CreateMutex failed with error %d\n", GetLastError()); ok(GetLastError() == 0, "wrong error %u\n", GetLastError()); CloseHandle(hOpened); @@ -244,8 +253,9 @@ static void test_slist(void) } item1, item2, item3, *pitem; SLIST_HEADER slist_header; - PSLIST_ENTRY entry; + PSLIST_ENTRY entry, next; USHORT size; + int i; VOID (WINAPI *pInitializeSListHead)(PSLIST_HEADER); USHORT (WINAPI *pQueryDepthSList)(PSLIST_HEADER); @@ -254,7 +264,7 @@ static void test_slist(void) PSLIST_ENTRY (WINAPI *pInterlockedPushEntrySList)(PSLIST_HEADER,PSLIST_ENTRY); HMODULE kernel32; - kernel32 = GetModuleHandle("KERNEL32.DLL"); + kernel32 = GetModuleHandleA("KERNEL32.DLL"); pInitializeSListHead = (void*) GetProcAddress(kernel32, "InitializeSListHead"); pQueryDepthSList = (void*) GetProcAddress(kernel32, "QueryDepthSList"); pInterlockedFlushSList = (void*) GetProcAddress(kernel32, "InterlockedFlushSList"); @@ -323,6 +333,21 @@ static void test_slist(void) } ok(((struct item*)entry)->value == 2, "item 2 not in front of list\n"); ok(((struct item*)entry->Next)->value == 1, "item 1 not at the back of list\n"); + + for (i = 0; i < 65536; i++) + { + entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry)); + pInterlockedPushEntrySList(&slist_header, entry); + } + + entry = pInterlockedFlushSList(&slist_header); + ok(entry != NULL, "not flushed\n"); + while (entry) + { + next = entry->Next; + HeapFree(GetProcessHeap(), 0, entry); + entry = next; + } } static void test_event(void) @@ -536,7 +561,7 @@ static void test_iocp_callback(void) return; } - sem = CreateSemaphore(NULL, 0, 1, NULL); + sem = CreateSemaphoreW(NULL, 0, 1, NULL); ok(sem != INVALID_HANDLE_VALUE, "Creating a semaphore failed\n"); ret = GetTempPathA(MAX_PATH, temp_path); @@ -813,9 +838,9 @@ static void test_timer_queue(void) ok(n5 == 1, "Timer callback 5 expected 1 got %d\n", n5); /* Test synchronous deletion of the timer/queue with event trigger. */ - e = CreateEvent(NULL, TRUE, FALSE, NULL); - et1 = CreateEvent(NULL, TRUE, FALSE, NULL); - et2 = CreateEvent(NULL, TRUE, FALSE, NULL); + e = CreateEventW(NULL, TRUE, FALSE, NULL); + et1 = CreateEventW(NULL, TRUE, FALSE, NULL); + et2 = CreateEventW(NULL, TRUE, FALSE, NULL); if (!e || !et1 || !et2) { skip("Failed to create timer queue descruction event\n"); @@ -1123,7 +1148,7 @@ static void test_WaitForMultipleObjects(void) * we can wait on that many */ for (i=0; i #include #include -#include "wine/test.h" +#include + #include #include #include #include +#include + +/* THREAD_ALL_ACCESS in Vista+ PSDKs is incompatible with older Windows versions */ +#define THREAD_ALL_ACCESS_NT4 (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3ff) /* Specify the number of simultaneous threads to test */ #define NUM_THREADS 4 @@ -54,6 +59,14 @@ # endif #endif +#ifdef __i386__ +#define ARCH "x86" +#elif defined __x86_64__ +#define ARCH "amd64" +#else +#define ARCH "none" +#endif + static BOOL (WINAPI *pGetThreadPriorityBoost)(HANDLE,PBOOL); static HANDLE (WINAPI *pOpenThread)(DWORD,BOOL,DWORD); static BOOL (WINAPI *pQueueUserWorkItem)(LPTHREAD_START_ROUTINE,PVOID,ULONG); @@ -65,6 +78,16 @@ static BOOL (WINAPI *pIsWow64Process)(HANDLE,PBOOL); static BOOL (WINAPI *pSetThreadErrorMode)(DWORD,PDWORD); static DWORD (WINAPI *pGetThreadErrorMode)(void); static DWORD (WINAPI *pRtlGetThreadErrorMode)(void); +static BOOL (WINAPI *pActivateActCtx)(HANDLE,ULONG_PTR*); +static HANDLE (WINAPI *pCreateActCtxW)(PCACTCTXW); +static BOOL (WINAPI *pDeactivateActCtx)(DWORD,ULONG_PTR); +static BOOL (WINAPI *pGetCurrentActCtx)(HANDLE *); +static void (WINAPI *pReleaseActCtx)(HANDLE); +static PTP_POOL (WINAPI *pCreateThreadpool)(PVOID); +static PTP_WORK (WINAPI *pCreateThreadpoolWork)(PTP_WORK_CALLBACK,PVOID,PTP_CALLBACK_ENVIRON); +static void (WINAPI *pSubmitThreadpoolWork)(PTP_WORK); +static void (WINAPI *pWaitForThreadpoolWorkCallbacks)(PTP_WORK,BOOL); +static void (WINAPI *pCloseThreadpoolWork)(PTP_WORK); static HANDLE create_target_process(const char *arg) { @@ -72,12 +95,12 @@ static HANDLE create_target_process(const char *arg) char cmdline[MAX_PATH]; PROCESS_INFORMATION pi; BOOL ret; - STARTUPINFO si = { 0 }; + STARTUPINFOA si = { 0 }; si.cb = sizeof(si); winetest_get_mainargs( &argv ); sprintf(cmdline, "%s %s %s", argv[0], argv[1], arg); - ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "error: %u\n", GetLastError()); ret = CloseHandle(pi.hThread); ok(ret, "error %u\n", GetLastError()); @@ -102,9 +125,9 @@ static LONG num_synced; static void init_thread_sync_helpers(void) { - start_event = CreateEvent(NULL, TRUE, FALSE, NULL); + start_event = CreateEventW(NULL, TRUE, FALSE, NULL); ok(start_event != NULL, "CreateEvent failed\n"); - stop_event = CreateEvent(NULL, TRUE, FALSE, NULL); + stop_event = CreateEventW(NULL, TRUE, FALSE, NULL); ok(stop_event != NULL, "CreateEvent failed\n"); num_synced = -1; } @@ -258,15 +281,36 @@ static DWORD WINAPI threadFunc_CloseHandle(LPVOID p) return 0; } +struct thread_actctx_param +{ + HANDLE thread_context; + HANDLE handle; +}; + +static DWORD WINAPI thread_actctx_func(void *p) +{ + struct thread_actctx_param *param = (struct thread_actctx_param*)p; + HANDLE cur; + BOOL ret; + + cur = (void*)0xdeadbeef; + ret = pGetCurrentActCtx(&cur); + ok(ret, "thread GetCurrentActCtx failed, %u\n", GetLastError()); + ok(cur == param->handle, "got %p, expected %p\n", cur, param->handle); + param->thread_context = cur; + + return 0; +} + static void create_function_addr_events(HANDLE events[2]) { char buffer[256]; sprintf(buffer, "threadFunc_SetEvent %p", threadFunc_SetEvent); - events[0] = CreateEvent(NULL, FALSE, FALSE, buffer); + events[0] = CreateEventA(NULL, FALSE, FALSE, buffer); sprintf(buffer, "threadFunc_CloseHandle %p", threadFunc_CloseHandle); - events[1] = CreateEvent(NULL, FALSE, FALSE, buffer); + events[1] = CreateEventA(NULL, FALSE, FALSE, buffer); } /* check CreateRemoteThread */ @@ -290,7 +334,7 @@ static VOID test_CreateRemoteThread(void) } ok(ret == WAIT_OBJECT_0 || broken(ret == WAIT_OBJECT_0+1 /* nt4,w2k */), "WaitForAllObjects 2 events %d\n", ret); - hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + hEvent = CreateEventW(NULL, FALSE, FALSE, NULL); ok(hEvent != NULL, "Can't create event, err=%u\n", GetLastError()); ret = DuplicateHandle(GetCurrentProcess(), hEvent, hProcess, &hRemoteEvent, 0, FALSE, DUPLICATE_SAME_ACCESS); @@ -522,7 +566,7 @@ static VOID test_SuspendThread(void) ok(error==1,"SuspendThread did not work\n"); /* check that access restrictions are obeyed */ if (pOpenThread) { - access_thread=pOpenThread(THREAD_ALL_ACCESS & (~THREAD_SUSPEND_RESUME), + access_thread=pOpenThread(THREAD_ALL_ACCESS_NT4 & (~THREAD_SUSPEND_RESUME), 0,threadId); ok(access_thread!=NULL,"OpenThread returned an invalid handle\n"); if (access_thread!=NULL) { @@ -567,7 +611,7 @@ static VOID test_TerminateThread(void) "TerminateThread didn't work\n"); /* check that access restrictions are obeyed */ if (pOpenThread) { - access_thread=pOpenThread(THREAD_ALL_ACCESS & (~THREAD_TERMINATE), + access_thread=pOpenThread(THREAD_ALL_ACCESS_NT4 & (~THREAD_TERMINATE), 0,threadId); ok(access_thread!=NULL,"OpenThread returned an invalid handle\n"); if (access_thread!=NULL) { @@ -636,7 +680,7 @@ static VOID test_thread_priority(void) if (pOpenThread) { /* check that access control is obeyed */ - access_thread=pOpenThread(THREAD_ALL_ACCESS & + access_thread=pOpenThread(THREAD_ALL_ACCESS_NT4 & (~THREAD_QUERY_INFORMATION) & (~THREAD_SET_INFORMATION), 0,curthreadId); ok(access_thread!=NULL,"OpenThread returned an invalid handle\n"); @@ -708,7 +752,7 @@ static VOID test_thread_priority(void) if (pOpenThread) { /* check that access control is obeyed */ - access_thread=pOpenThread(THREAD_ALL_ACCESS & + access_thread=pOpenThread(THREAD_ALL_ACCESS_NT4 & (~THREAD_QUERY_INFORMATION) & (~THREAD_SET_INFORMATION), 0,curthreadId); ok(access_thread!=NULL,"OpenThread returned an invalid handle\n"); @@ -748,7 +792,7 @@ static VOID test_GetThreadTimes(void) ok(thread!=NULL,"Create Thread failed\n"); /* check that access control is obeyed */ if (pOpenThread) { - access_thread=pOpenThread(THREAD_ALL_ACCESS & + access_thread=pOpenThread(THREAD_ALL_ACCESS_NT4 & (~THREAD_QUERY_INFORMATION), 0,threadId); ok(access_thread!=NULL, "OpenThread returned an invalid handle\n"); @@ -918,7 +962,7 @@ static void test_SetThreadContext(void) BOOL ret; SetLastError(0xdeadbeef); - event = CreateEvent( NULL, TRUE, FALSE, NULL ); + event = CreateEventW( NULL, TRUE, FALSE, NULL ); thread = CreateThread( NULL, 0, threadFunc6, (void *)2, 0, &threadid ); ok( thread != NULL, "CreateThread failed : (%d)\n", GetLastError() ); if (!thread) @@ -999,7 +1043,7 @@ static void test_QueueUserWorkItem(void) /* QueueUserWorkItem not present on win9x */ if (!pQueueUserWorkItem) return; - finish_event = CreateEvent(NULL, TRUE, FALSE, NULL); + finish_event = CreateEventW(NULL, TRUE, FALSE, NULL); before = GetTickCount(); @@ -1047,8 +1091,8 @@ static void test_RegisterWaitForSingleObject(void) /* test signaled case */ - handle = CreateEvent(NULL, TRUE, TRUE, NULL); - complete_event = CreateEvent(NULL, FALSE, FALSE, NULL); + handle = CreateEventW(NULL, TRUE, TRUE, NULL); + complete_event = CreateEventW(NULL, FALSE, FALSE, NULL); ret = pRegisterWaitForSingleObject(&wait_handle, handle, signaled_function, complete_event, INFINITE, WT_EXECUTEONLYONCE); ok(ret, "RegisterWaitForSingleObject failed with error %d\n", GetLastError()); @@ -1391,7 +1435,7 @@ static WORD get_thread_fpu_cw(void) DWORD tid, res; HANDLE thread; - ctx.finished = CreateEvent(NULL, FALSE, FALSE, NULL); + ctx.finished = CreateEventW(NULL, FALSE, FALSE, NULL); ok(!!ctx.finished, "Failed to create event, last error %#x.\n", GetLastError()); thread = CreateThread(NULL, 0, fpu_thread, &ctx, 0, &tid); @@ -1432,28 +1476,243 @@ static void test_thread_fpu_cw(void) } #endif +static const char manifest_dep[] = +"" +"" +" " +""; + +static const char manifest_main[] = +"" +"" +"" +" " +" " +" " +"" +""; + +static void create_manifest_file(const char *filename, const char *manifest) +{ + WCHAR path[MAX_PATH]; + HANDLE file; + DWORD size; + + MultiByteToWideChar( CP_ACP, 0, filename, -1, path, MAX_PATH ); + file = CreateFileW(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError()); + WriteFile(file, manifest, strlen(manifest), &size, NULL); + CloseHandle(file); +} + +static HANDLE test_create(const char *file) +{ + WCHAR path[MAX_PATH]; + ACTCTXW actctx; + HANDLE handle; + + MultiByteToWideChar(CP_ACP, 0, file, -1, path, MAX_PATH); + memset(&actctx, 0, sizeof(ACTCTXW)); + actctx.cbSize = sizeof(ACTCTXW); + actctx.lpSource = path; + + handle = pCreateActCtxW(&actctx); + ok(handle != INVALID_HANDLE_VALUE, "failed to create context, error %u\n", GetLastError()); + + ok(actctx.cbSize == sizeof(actctx), "cbSize=%d\n", actctx.cbSize); + ok(actctx.dwFlags == 0, "dwFlags=%d\n", actctx.dwFlags); + ok(actctx.lpSource == path, "lpSource=%p\n", actctx.lpSource); + ok(actctx.wProcessorArchitecture == 0, "wProcessorArchitecture=%d\n", actctx.wProcessorArchitecture); + ok(actctx.wLangId == 0, "wLangId=%d\n", actctx.wLangId); + ok(actctx.lpAssemblyDirectory == NULL, "lpAssemblyDirectory=%p\n", actctx.lpAssemblyDirectory); + ok(actctx.lpResourceName == NULL, "lpResourceName=%p\n", actctx.lpResourceName); + ok(actctx.lpApplicationName == NULL, "lpApplicationName=%p\n", actctx.lpApplicationName); + ok(actctx.hModule == NULL, "hModule=%p\n", actctx.hModule); + + return handle; +} + +static void test_thread_actctx(void) +{ + struct thread_actctx_param param; + HANDLE thread, handle, context; + ULONG_PTR cookie; + DWORD tid, ret; + BOOL b; + + if (!pActivateActCtx) + { + win_skip("skipping activation context tests\n"); + return; + } + + create_manifest_file("testdep1.manifest", manifest_dep); + create_manifest_file("main.manifest", manifest_main); + + context = test_create("main.manifest"); + DeleteFileA("testdep1.manifest"); + DeleteFileA("main.manifest"); + + handle = (void*)0xdeadbeef; + b = pGetCurrentActCtx(&handle); + ok(b, "GetCurentActCtx failed: %u\n", GetLastError()); + ok(handle == 0, "active context %p\n", handle); + + /* without active context */ + param.thread_context = (void*)0xdeadbeef; + param.handle = NULL; + thread = CreateThread(NULL, 0, thread_actctx_func, ¶m, 0, &tid); + ok(thread != NULL, "failed, got %u\n", GetLastError()); + + ret = WaitForSingleObject(thread, 1000); + ok(ret == WAIT_OBJECT_0, "wait timeout\n"); + ok(param.thread_context == NULL, "got wrong thread context %p\n", param.thread_context); + CloseHandle(thread); + + b = pActivateActCtx(context, &cookie); + ok(b, "activation failed: %u\n", GetLastError()); + + handle = 0; + b = pGetCurrentActCtx(&handle); + ok(b, "GetCurentActCtx failed: %u\n", GetLastError()); + ok(handle != 0, "no active context\n"); + + param.handle = NULL; + b = pGetCurrentActCtx(¶m.handle); + ok(b && param.handle != NULL, "failed to get context, %u\n", GetLastError()); + + param.thread_context = (void*)0xdeadbeef; + thread = CreateThread(NULL, 0, thread_actctx_func, ¶m, 0, &tid); + ok(thread != NULL, "failed, got %u\n", GetLastError()); + + ret = WaitForSingleObject(thread, 1000); + ok(ret == WAIT_OBJECT_0, "wait timeout\n"); + ok(param.thread_context == context, "got wrong thread context %p, %p\n", param.thread_context, context); + CloseHandle(thread); + + /* similar test for CreateRemoteThread() */ + param.thread_context = (void*)0xdeadbeef; + thread = CreateRemoteThread(GetCurrentProcess(), NULL, 0, thread_actctx_func, ¶m, 0, &tid); + ok(thread != NULL, "failed, got %u\n", GetLastError()); + + ret = WaitForSingleObject(thread, 1000); + ok(ret == WAIT_OBJECT_0, "wait timeout\n"); + ok(param.thread_context == context, "got wrong thread context %p, %p\n", param.thread_context, context); + CloseHandle(thread); + + b = pDeactivateActCtx(0, cookie); + ok(b, "DeactivateActCtx failed: %u\n", GetLastError()); + pReleaseActCtx(context); +} + + +static void WINAPI threadpool_workcallback(PTP_CALLBACK_INSTANCE instance, void *context, PTP_WORK work) { + int *foo = (int*)context; + + (*foo)++; +} + + +static void test_threadpool(void) +{ + PTP_POOL pool; + PTP_WORK work; + int workcalled = 0; + + if (!pCreateThreadpool) { + todo_wine win_skip("thread pool apis not supported.\n"); + return; + } + + work = pCreateThreadpoolWork(threadpool_workcallback, &workcalled, NULL); + ok (work != NULL, "Error %d in CreateThreadpoolWork\n", GetLastError()); + pSubmitThreadpoolWork(work); + pWaitForThreadpoolWorkCallbacks(work, FALSE); + pCloseThreadpoolWork(work); + + ok (workcalled == 1, "expected work to be called once, got %d\n", workcalled); + + pool = pCreateThreadpool(NULL); + todo_wine ok (pool != NULL, "CreateThreadpool failed\n"); +} + +static void test_reserved_tls(void) +{ + void *val; + DWORD tls; + BOOL ret; + + /* This seems to be a WinXP SP2+ feature. */ + if(!pIsWow64Process) { + win_skip("Skipping reserved TLS slot on too old Windows.\n"); + return; + } + + val = TlsGetValue(0); + ok(!val, "TlsGetValue(0) = %p\n", val); + + /* Also make sure that there is a TLS allocated. */ + tls = TlsAlloc(); + ok(tls && tls != TLS_OUT_OF_INDEXES, "tls = %x\n", tls); + TlsSetValue(tls, (void*)1); + + val = TlsGetValue(0); + ok(!val, "TlsGetValue(0) = %p\n", val); + + TlsFree(tls); + + /* The following is too ugly to be run by default */ + if(0) { + /* Set TLS index 0 value and see that this works and doesn't cause problems + * for remaining tests. */ + ret = TlsSetValue(0, (void*)1); + ok(ret, "TlsSetValue(0, 1) failed: %u\n", GetLastError()); + + val = TlsGetValue(0); + ok(val == (void*)1, "TlsGetValue(0) = %p\n", val); + } +} + +static void init_funcs(void) +{ + HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); + +/* Neither Cygwin nor mingW export OpenThread, so do a dynamic check + so that the compile passes */ + +#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f) + X(GetThreadPriorityBoost); + X(OpenThread); + X(QueueUserWorkItem); + X(SetThreadIdealProcessor); + X(SetThreadPriorityBoost); + X(RegisterWaitForSingleObject); + X(UnregisterWait); + X(IsWow64Process); + X(SetThreadErrorMode); + X(GetThreadErrorMode); + X(ActivateActCtx); + X(CreateActCtxW); + X(DeactivateActCtx); + X(GetCurrentActCtx); + X(ReleaseActCtx); + + X(CreateThreadpool); + X(CreateThreadpoolWork); + X(SubmitThreadpoolWork); + X(WaitForThreadpoolWorkCallbacks); + X(CloseThreadpoolWork); +#undef X +} + START_TEST(thread) { - HINSTANCE lib; HINSTANCE ntdll; int argc; char **argv; argc = winetest_get_mainargs( &argv ); -/* Neither Cygwin nor mingW export OpenThread, so do a dynamic check - so that the compile passes -*/ - lib=GetModuleHandleA("kernel32.dll"); - ok(lib!=NULL,"Couldn't get a handle for kernel32.dll\n"); - pGetThreadPriorityBoost=(void *)GetProcAddress(lib,"GetThreadPriorityBoost"); - pOpenThread=(void *)GetProcAddress(lib,"OpenThread"); - pQueueUserWorkItem=(void *)GetProcAddress(lib,"QueueUserWorkItem"); - pSetThreadIdealProcessor=(void *)GetProcAddress(lib,"SetThreadIdealProcessor"); - pSetThreadPriorityBoost=(void *)GetProcAddress(lib,"SetThreadPriorityBoost"); - pRegisterWaitForSingleObject=(void *)GetProcAddress(lib,"RegisterWaitForSingleObject"); - pUnregisterWait=(void *)GetProcAddress(lib,"UnregisterWait"); - pIsWow64Process=(void *)GetProcAddress(lib,"IsWow64Process"); - pSetThreadErrorMode=(void *)GetProcAddress(lib,"SetThreadErrorMode"); - pGetThreadErrorMode=(void *)GetProcAddress(lib,"GetThreadErrorMode"); + + init_funcs(); ntdll=GetModuleHandleA("ntdll.dll"); if (ntdll) @@ -1487,6 +1746,7 @@ START_TEST(thread) return; } + test_reserved_tls(); test_CreateRemoteThread(); test_CreateThread_basic(); test_CreateThread_suspended(); @@ -1507,4 +1767,7 @@ START_TEST(thread) #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) test_thread_fpu_cw(); #endif + test_thread_actctx(); + + test_threadpool(); } diff --git a/rostests/winetests/kernel32/time.c b/rostests/winetests/kernel32/time.c index 2f7118462a5..0cc4485cbbe 100755 --- a/rostests/winetests/kernel32/time.c +++ b/rostests/winetests/kernel32/time.c @@ -720,7 +720,7 @@ static void test_GetCalendarInfo(void) START_TEST(time) { - HMODULE hKernel = GetModuleHandle("kernel32"); + HMODULE hKernel = GetModuleHandleA("kernel32"); pTzSpecificLocalTimeToSystemTime = (void *)GetProcAddress(hKernel, "TzSpecificLocalTimeToSystemTime"); pSystemTimeToTzSpecificLocalTime = (void *)GetProcAddress( hKernel, "SystemTimeToTzSpecificLocalTime"); pGetCalendarInfoA = (void *)GetProcAddress(hKernel, "GetCalendarInfoA"); diff --git a/rostests/winetests/kernel32/timer.c b/rostests/winetests/kernel32/timer.c index a06217a1886..bcc800c494f 100755 --- a/rostests/winetests/kernel32/timer.c +++ b/rostests/winetests/kernel32/timer.c @@ -28,7 +28,7 @@ static void test_timer(void) { HANDLE (WINAPI *pCreateWaitableTimerA)( SECURITY_ATTRIBUTES*, BOOL, LPSTR ); BOOL (WINAPI *pSetWaitableTimer)(HANDLE, LARGE_INTEGER*, LONG, PTIMERAPCROUTINE, LPVOID, BOOL); - HMODULE hker = GetModuleHandle("kernel32"); + HMODULE hker = GetModuleHandleA("kernel32.dll"); HANDLE handle; BOOL r; LARGE_INTEGER due; diff --git a/rostests/winetests/kernel32/toolhelp.c b/rostests/winetests/kernel32/toolhelp.c index bfa31277400..ed76c9c6fe8 100644 --- a/rostests/winetests/kernel32/toolhelp.c +++ b/rostests/winetests/kernel32/toolhelp.c @@ -75,13 +75,13 @@ static int init(void) case 4: /* the sub-process */ ev1 = (HANDLE)(INT_PTR)atoi(argv[2]); ev2 = (HANDLE)(INT_PTR)atoi(argv[3]); - ev3 = CreateEvent(NULL, FALSE, FALSE, NULL); + ev3 = CreateEventW(NULL, FALSE, FALSE, NULL); if (ev3 == NULL) ExitProcess(WAIT_ABANDONED); hThread = CreateThread(NULL, 0, sub_thread, ev3, 0, &tid); if (hThread == NULL) ExitProcess(WAIT_ABANDONED); if (!LoadLibraryA("shell32.dll")) ExitProcess(WAIT_ABANDONED); - + /* signal init of sub-process is done */ SetEvent(ev1); /* wait for parent to have done all its queries */ @@ -204,17 +204,19 @@ static void test_thread(DWORD curr_pid, DWORD sub_pcs_pid) static const char* curr_expected_modules[] = { - "kernel32_test.exe" + "kernel32_test.exe", "kernel32.dll", - "ntdll.dll", + "ntdll.dll" }; + static const char* sub_expected_modules[] = { "kernel32_test.exe", "kernel32.dll", "shell32.dll", - "ntdll.dll", + "ntdll.dll" }; + #define NUM_OF(x) (sizeof(x) / sizeof(x[0])) static void test_module(DWORD pid, const char* expected[], unsigned num_expected) @@ -242,7 +244,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected me.th32ProcessID, me.modBaseAddr, me.modBaseSize, me.szExePath, me.szModule); ok(me.th32ProcessID == pid, "wrong returned process id\n"); for (i = 0; i < num_expected; i++) - if (!lstrcmpi(expected[i], me.szModule)) found[i]++; + if (!lstrcmpiA(expected[i], me.szModule)) found[i]++; num++; } while (pModule32Next( hSnapshot, &me )); } @@ -260,7 +262,7 @@ static void test_module(DWORD pid, const char* expected[], unsigned num_expected trace("PID=%x base=%p size=%x %s %s\n", me.th32ProcessID, me.modBaseAddr, me.modBaseSize, me.szExePath, me.szModule); for (i = 0; i < num_expected; i++) - if (!lstrcmpi(expected[i], me.szModule)) found[i]++; + if (!lstrcmpiA(expected[i], me.szModule)) found[i]++; num--; } while (pModule32Next( hSnapshot, &me )); } @@ -317,8 +319,8 @@ START_TEST(toolhelp) sa.lpSecurityDescriptor = NULL; sa.bInheritHandle = TRUE; - ev1 = CreateEvent(&sa, FALSE, FALSE, NULL); - ev2 = CreateEvent(&sa, FALSE, FALSE, NULL); + ev1 = CreateEventW(&sa, FALSE, FALSE, NULL); + ev2 = CreateEventW(&sa, FALSE, FALSE, NULL); ok (ev1 != NULL && ev2 != NULL, "Couldn't create events\n"); memset(&startup, 0, sizeof(startup)); startup.cb = sizeof(startup); diff --git a/rostests/winetests/kernel32/version.c b/rostests/winetests/kernel32/version.c index 4b9a4f30241..e27ea4c7984 100644 --- a/rostests/winetests/kernel32/version.c +++ b/rostests/winetests/kernel32/version.c @@ -21,8 +21,6 @@ /* Needed for PRODUCT_* defines and GetProductInfo() */ #define _WIN32_WINNT 0x0600 -#include - #include "wine/test.h" #include "winbase.h" @@ -156,7 +154,7 @@ static void test_GetVersionEx(void) static void test_VerifyVersionInfo(void) { - OSVERSIONINFOEX info; + OSVERSIONINFOEXA info; BOOL ret; DWORD servicepack, error; @@ -169,8 +167,8 @@ static void test_VerifyVersionInfo(void) /* Before we start doing some tests we should check what the version of * the ServicePack is. Tests on a box with no ServicePack will fail otherwise. */ - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionExA((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); servicepack = info.wServicePackMajor; memset(&info, 0, sizeof(info)); @@ -223,8 +221,8 @@ static void test_VerifyVersionInfo(void) VER_MAJORVERSION, VER_GREATER_EQUAL)); ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError()); - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.wServicePackMinor++; SetLastError(0xdeadbeef); ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, @@ -240,37 +238,37 @@ static void test_VerifyVersionInfo(void) } else { - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.wServicePackMajor--; ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER)); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.wServicePackMajor--; ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL)); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); } - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.wServicePackMajor++; ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, pVerSetConditionMask(0, VER_MINORVERSION, VER_LESS)); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.wServicePackMajor++; ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, pVerSetConditionMask(0, VER_MINORVERSION, VER_LESS_EQUAL)); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.wServicePackMajor--; SetLastError(0xdeadbeef); ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, @@ -282,8 +280,8 @@ static void test_VerifyVersionInfo(void) /* test the failure hierarchy for the four version fields */ - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.wServicePackMajor++; SetLastError(0xdeadbeef); ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, @@ -293,8 +291,8 @@ static void test_VerifyVersionInfo(void) ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */, "VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error); - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.dwMinorVersion++; SetLastError(0xdeadbeef); ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, @@ -304,8 +302,8 @@ static void test_VerifyVersionInfo(void) ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */, "VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error); - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.dwMajorVersion++; SetLastError(0xdeadbeef); ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, @@ -319,8 +317,8 @@ static void test_VerifyVersionInfo(void) pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL)); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.dwBuildNumber++; SetLastError(0xdeadbeef); ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, @@ -335,8 +333,8 @@ static void test_VerifyVersionInfo(void) ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); /* test bad dwOSVersionInfoSize */ - info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - GetVersionEx((OSVERSIONINFO *)&info); + info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA); + GetVersionExA((OSVERSIONINFOA *)&info); info.dwOSVersionInfoSize = 0; ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, pVerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL)); diff --git a/rostests/winetests/kernel32/virtual.c b/rostests/winetests/kernel32/virtual.c index 99d32864d16..0d417a6b74c 100755 --- a/rostests/winetests/kernel32/virtual.c +++ b/rostests/winetests/kernel32/virtual.c @@ -49,12 +49,12 @@ static HANDLE create_target_process(const char *arg) char cmdline[MAX_PATH]; PROCESS_INFORMATION pi; BOOL ret; - STARTUPINFO si = { 0 }; + STARTUPINFOA si = { 0 }; si.cb = sizeof(si); winetest_get_mainargs( &argv ); sprintf(cmdline, "%s %s %s", argv[0], argv[1], arg); - ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "error: %u\n", GetLastError()); ret = CloseHandle(pi.hThread); ok(ret, "error %u\n", GetLastError()); @@ -586,17 +586,17 @@ static void test_MapViewOfFile(void) SetLastError(0xdeadbeef); name = "Local\\Foo"; - file = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, name ); + file = CreateFileMappingA( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, name ); /* nt4 doesn't have Local\\ */ if (!file && GetLastError() == ERROR_PATH_NOT_FOUND) { name = "Foo"; - file = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, name ); + file = CreateFileMappingA( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, name ); } ok( file != 0, "CreateFileMapping PAGE_READWRITE error %u\n", GetLastError() ); SetLastError(0xdeadbeef); - mapping = OpenFileMapping( FILE_MAP_READ, FALSE, name ); + mapping = OpenFileMappingA( FILE_MAP_READ, FALSE, name ); ok( mapping != 0, "OpenFileMapping FILE_MAP_READ error %u\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 0 ); @@ -623,7 +623,7 @@ static void test_MapViewOfFile(void) CloseHandle( mapping ); SetLastError(0xdeadbeef); - mapping = OpenFileMapping( FILE_MAP_WRITE, FALSE, name ); + mapping = OpenFileMappingA( FILE_MAP_WRITE, FALSE, name ); ok( mapping != 0, "OpenFileMapping FILE_MAP_WRITE error %u\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 ); @@ -1053,10 +1053,12 @@ static void test_NtAreMappedFilesTheSame(void) CloseHandle( file2 ); status = pNtAreMappedFilesTheSame( ptr, ptr ); - ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_SUCCESS || broken(status == STATUS_NOT_SAME_DEVICE), + "NtAreMappedFilesTheSame returned %x\n", status ); status = pNtAreMappedFilesTheSame( ptr, (char *)ptr + 30 ); - ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status ); + ok( status == STATUS_SUCCESS || broken(status == STATUS_NOT_SAME_DEVICE), + "NtAreMappedFilesTheSame returned %x\n", status ); status = pNtAreMappedFilesTheSame( ptr, GetModuleHandleA("kernel32.dll") ); ok( status == STATUS_NOT_SAME_DEVICE, "NtAreMappedFilesTheSame returned %x\n", status ); @@ -1283,7 +1285,7 @@ static void test_write_watch(void) "wrong error %u\n", GetLastError() ); SetLastError( 0xdeadbeef ); - ret = pGetWriteWatch( 0, GetModuleHandle(0), size, results, &count, &pagesize ); + ret = pGetWriteWatch( 0, GetModuleHandleW(NULL), size, results, &count, &pagesize ); if (ret) { ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); @@ -1459,7 +1461,7 @@ static void test_write_watch(void) ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); SetLastError( 0xdeadbeef ); - ret = pResetWriteWatch( GetModuleHandle(0), size ); + ret = pResetWriteWatch( GetModuleHandleW(NULL), size ); ok( ret == ~0u, "ResetWriteWatch succeeded %u\n", ret ); ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); } @@ -1486,7 +1488,7 @@ static void test_write_watch(void) ret = pResetWriteWatch( base, 0 ); ok( !ret, "ResetWriteWatch failed %u\n", ret ); - ret = pResetWriteWatch( GetModuleHandle(0), size ); + ret = pResetWriteWatch( GetModuleHandleW(NULL), size ); ok( !ret, "ResetWriteWatch failed %u\n", ret ); } @@ -1861,11 +1863,11 @@ static void test_CreateFileMapping_protection(void) GetSystemInfo(&si); trace("system page size %#x\n", si.dwPageSize); - GetTempPath(MAX_PATH, temp_path); - GetTempFileName(temp_path, "map", 0, file_name); + GetTempPathA(MAX_PATH, temp_path); + GetTempFileNameA(temp_path, "map", 0, file_name); SetLastError(0xdeadbeef); - hfile = CreateFile(file_name, GENERIC_READ|GENERIC_WRITE|GENERIC_EXECUTE, 0, NULL, CREATE_ALWAYS, 0, 0); + hfile = CreateFileA(file_name, GENERIC_READ|GENERIC_WRITE|GENERIC_EXECUTE, 0, NULL, CREATE_ALWAYS, 0, 0); ok(hfile != INVALID_HANDLE_VALUE, "CreateFile(%s) error %d\n", file_name, GetLastError()); SetFilePointer(hfile, si.dwPageSize, NULL, FILE_BEGIN); SetEndOfFile(hfile); @@ -1873,7 +1875,7 @@ static void test_CreateFileMapping_protection(void) for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { SetLastError(0xdeadbeef); - hmap = CreateFileMapping(hfile, NULL, td[i].prot | SEC_COMMIT, 0, si.dwPageSize, NULL); + hmap = CreateFileMappingW(hfile, NULL, td[i].prot | SEC_COMMIT, 0, si.dwPageSize, NULL); if (td[i].success) { @@ -1954,7 +1956,7 @@ todo_wine if (page_exec_supported) alloc_prot = PAGE_EXECUTE_READWRITE; else alloc_prot = PAGE_READWRITE; SetLastError(0xdeadbeef); - hmap = CreateFileMapping(hfile, NULL, alloc_prot, 0, si.dwPageSize, NULL); + hmap = CreateFileMappingW(hfile, NULL, alloc_prot, 0, si.dwPageSize, NULL); ok(hmap != 0, "%d: CreateFileMapping error %d\n", i, GetLastError()); SetLastError(0xdeadbeef); @@ -2065,7 +2067,7 @@ todo_wine CloseHandle(hmap); CloseHandle(hfile); - DeleteFile(file_name); + DeleteFileA(file_name); } #define ACCESS_READ 0x01 @@ -2252,11 +2254,11 @@ static void test_mapping(void) GetSystemInfo(&si); trace("system page size %#x\n", si.dwPageSize); - GetTempPath(MAX_PATH, temp_path); - GetTempFileName(temp_path, "map", 0, file_name); + GetTempPathA(MAX_PATH, temp_path); + GetTempFileNameA(temp_path, "map", 0, file_name); SetLastError(0xdeadbeef); - hfile = CreateFile(file_name, GENERIC_READ|GENERIC_WRITE|GENERIC_EXECUTE, 0, NULL, CREATE_ALWAYS, 0, 0); + hfile = CreateFileA(file_name, GENERIC_READ|GENERIC_WRITE|GENERIC_EXECUTE, 0, NULL, CREATE_ALWAYS, 0, 0); ok(hfile != INVALID_HANDLE_VALUE, "CreateFile(%s) error %d\n", file_name, GetLastError()); SetFilePointer(hfile, si.dwPageSize, NULL, FILE_BEGIN); SetEndOfFile(hfile); @@ -2264,7 +2266,7 @@ static void test_mapping(void) for (i = 0; i < sizeof(page_prot)/sizeof(page_prot[0]); i++) { SetLastError(0xdeadbeef); - hmap = CreateFileMapping(hfile, NULL, page_prot[i] | SEC_COMMIT, 0, si.dwPageSize, NULL); + hmap = CreateFileMappingW(hfile, NULL, page_prot[i] | SEC_COMMIT, 0, si.dwPageSize, NULL); if (page_prot[i] == PAGE_NOACCESS) { @@ -2275,7 +2277,7 @@ static void test_mapping(void) /* A trick to create a not accessible mapping */ SetLastError(0xdeadbeef); - hmap = CreateFileMapping(hfile, NULL, PAGE_READWRITE | SEC_COMMIT, 0, si.dwPageSize, NULL); + hmap = CreateFileMappingW(hfile, NULL, PAGE_READWRITE | SEC_COMMIT, 0, si.dwPageSize, NULL); ok(hmap != 0, "CreateFileMapping(PAGE_READWRITE) error %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = DuplicateHandle(GetCurrentProcess(), hmap, GetCurrentProcess(), &hmap2, 0, FALSE, 0); @@ -2442,7 +2444,7 @@ todo_wine } CloseHandle(hfile); - DeleteFile(file_name); + DeleteFileA(file_name); } static void test_shared_memory(int is_child) @@ -2451,7 +2453,7 @@ static void test_shared_memory(int is_child) LONG *p; SetLastError(0xdeadbef); - mapping = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, "winetest_virtual.c"); + mapping = CreateFileMappingA(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, "winetest_virtual.c"); ok(mapping != 0, "CreateFileMapping error %d\n", GetLastError()); if (is_child) ok(GetLastError() == ERROR_ALREADY_EXISTS, "expected ERROR_ALREADY_EXISTS, got %d\n", GetLastError()); @@ -2469,14 +2471,14 @@ static void test_shared_memory(int is_child) char **argv; char cmdline[MAX_PATH]; PROCESS_INFORMATION pi; - STARTUPINFO si = { sizeof(si) }; + STARTUPINFOA si = { sizeof(si) }; DWORD ret; *p = 0x1a2b3c4d; winetest_get_mainargs(&argv); sprintf(cmdline, "\"%s\" virtual sharedmem", argv[0]); - ret = CreateProcess(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); + ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError()); winetest_wait_child_process(pi.hProcess); CloseHandle(pi.hThread); @@ -2525,10 +2527,10 @@ START_TEST(virtual) pVirtualFreeEx = (void *) GetProcAddress(hkernel32, "VirtualFreeEx"); pGetWriteWatch = (void *) GetProcAddress(hkernel32, "GetWriteWatch"); pResetWriteWatch = (void *) GetProcAddress(hkernel32, "ResetWriteWatch"); - pNtAreMappedFilesTheSame = (void *)GetProcAddress( GetModuleHandle("ntdll.dll"), + pNtAreMappedFilesTheSame = (void *)GetProcAddress( GetModuleHandleA("ntdll.dll"), "NtAreMappedFilesTheSame" ); - pNtMapViewOfSection = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtMapViewOfSection"); - pNtUnmapViewOfSection = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"), "NtUnmapViewOfSection"); + pNtMapViewOfSection = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtMapViewOfSection"); + pNtUnmapViewOfSection = (void *)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtUnmapViewOfSection"); test_shared_memory(0); test_mapping(); diff --git a/rostests/winetests/kernel32/volume.c b/rostests/winetests/kernel32/volume.c index 5a5b11c1f9c..fd52a2a9274 100644 --- a/rostests/winetests/kernel32/volume.c +++ b/rostests/winetests/kernel32/volume.c @@ -122,7 +122,7 @@ static void test_define_dos_deviceA(void) } /* Map it to point to the current directory */ - ret = GetCurrentDirectory(sizeof(buf), buf); + ret = GetCurrentDirectoryA(sizeof(buf), buf); ok(ret, "GetCurrentDir\n"); ret = DefineDosDeviceA(0, drivestr, buf); @@ -214,7 +214,7 @@ static void test_GetVolumeNameForVolumeMountPointA(void) "GetVolumeNameForVolumeMountPointA failed, wrong error returned, was %d, should be ERROR_FILENAME_EXCED_RANGE\n", GetLastError()); - /* Try on a arbitrary directory */ + /* Try on an arbitrary directory */ /* On FAT filesystems it seems that GetLastError() is set to ERROR_INVALID_FUNCTION. */ ret = pGetVolumeNameForVolumeMountPointA(temp_path, volume, len); @@ -368,26 +368,26 @@ static void test_GetVolumeInformationA(void) } /* get windows drive letter and update strings for testing */ - result = GetWindowsDirectory(windowsdir, sizeof(windowsdir)); + result = GetWindowsDirectoryA(windowsdir, sizeof(windowsdir)); ok(result < sizeof(windowsdir), "windowsdir is abnormally long!\n"); ok(result != 0, "GetWindowsDirectory: error %d\n", GetLastError()); Root_Colon[0] = windowsdir[0]; Root_Slash[0] = windowsdir[0]; Root_UNC[4] = windowsdir[0]; - result = GetCurrentDirectory(MAX_PATH, currentdir); + result = GetCurrentDirectoryA(MAX_PATH, currentdir); ok(result, "GetCurrentDirectory: error %d\n", GetLastError()); /* Note that GetCurrentDir yields no trailing slash for subdirs */ /* check for NO error on no trailing \ when current dir is root dir */ - ret = SetCurrentDirectory(Root_Slash); + ret = SetCurrentDirectoryA(Root_Slash); ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); ret = pGetVolumeInformationA(Root_Colon, vol_name_buf, vol_name_size, NULL, NULL, NULL, fs_name_buf, fs_name_len); ok(ret, "GetVolumeInformationA root failed, last error %u\n", GetLastError()); /* check for error on no trailing \ when current dir is subdir (windows) of queried drive */ - ret = SetCurrentDirectory(windowsdir); + ret = SetCurrentDirectoryA(windowsdir); ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); SetLastError(0xdeadbeef); ret = pGetVolumeInformationA(Root_Colon, vol_name_buf, vol_name_size, NULL, @@ -396,7 +396,7 @@ static void test_GetVolumeInformationA(void) "GetVolumeInformationA did%s fail, last error %u\n", ret ? " not":"", GetLastError()); /* reset current directory */ - ret = SetCurrentDirectory(currentdir); + ret = SetCurrentDirectoryA(currentdir); ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); if (toupper(currentdir[0]) == toupper(windowsdir[0])) { @@ -408,12 +408,12 @@ static void test_GetVolumeInformationA(void) /* C:\windows becomes the current directory on drive C: */ /* Note that paths to subdirs are stored without trailing slash, like what GetCurrentDir yields. */ - ret = SetEnvironmentVariable(Root_Env, windowsdir); + ret = SetEnvironmentVariableA(Root_Env, windowsdir); ok(ret, "SetEnvironmentVariable %s failed\n", Root_Env); - ret = SetCurrentDirectory(windowsdir); + ret = SetCurrentDirectoryA(windowsdir); ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); - ret = SetCurrentDirectory(currentdir); + ret = SetCurrentDirectoryA(currentdir); ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); /* windows dir is current on the root drive, call fails */ @@ -428,9 +428,9 @@ static void test_GetVolumeInformationA(void) NULL, NULL, fs_name_buf, fs_name_len); ok(ret, "GetVolumeInformationA with \\ failed, last error %u\n", GetLastError()); - ret = SetCurrentDirectory(Root_Slash); + ret = SetCurrentDirectoryA(Root_Slash); ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); - ret = SetCurrentDirectory(currentdir); + ret = SetCurrentDirectoryA(currentdir); ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); /* windows dir is STILL CURRENT on root drive; the call fails as before, */ @@ -442,7 +442,7 @@ static void test_GetVolumeInformationA(void) "GetVolumeInformationA did%s fail, last error %u\n", ret ? " not":"", GetLastError()); /* Now C:\ becomes the current directory on drive C: */ - ret = SetEnvironmentVariable(Root_Env, Root_Slash); /* set =C:=C:\ */ + ret = SetEnvironmentVariableA(Root_Env, Root_Slash); /* set =C:=C:\ */ ok(ret, "SetEnvironmentVariable %s failed\n", Root_Env); /* \ is current on root drive, call succeeds */ @@ -451,9 +451,9 @@ static void test_GetVolumeInformationA(void) ok(ret, "GetVolumeInformationA failed, last error %u\n", GetLastError()); /* again, SetCurrentDirectory on another drive does not matter */ - ret = SetCurrentDirectory(Root_Slash); + ret = SetCurrentDirectoryA(Root_Slash); ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); - ret = SetCurrentDirectory(currentdir); + ret = SetCurrentDirectoryA(currentdir); ok(ret, "SetCurrentDirectory: error %d\n", GetLastError()); /* \ is current on root drive, call succeeds */ @@ -533,7 +533,7 @@ static void test_enum_vols(void) } /*get windows drive letter and update strings for testing */ - ret = GetWindowsDirectory( windowsdir, sizeof(windowsdir) ); + ret = GetWindowsDirectoryA( windowsdir, sizeof(windowsdir) ); ok(ret < sizeof(windowsdir), "windowsdir is abnormally long!\n"); ok(ret != 0, "GetWindowsDirecory: error %d\n", GetLastError()); path[0] = windowsdir[0]; @@ -608,7 +608,6 @@ static void test_GetVolumePathNameA(void) ret = pGetVolumePathNameA(NULL, NULL, 0); error = GetLastError(); ok(!ret, "expected failure\n"); -todo_wine ok(error == ERROR_INVALID_PARAMETER || broken( error == 0xdeadbeef) /* <=XP */, "expected ERROR_INVALID_PARAMETER got %u\n", error); @@ -617,7 +616,6 @@ todo_wine ret = pGetVolumePathNameA("", NULL, 0); error = GetLastError(); ok(!ret, "expected failure\n"); -todo_wine ok(error == ERROR_INVALID_PARAMETER || broken( error == 0xdeadbeef) /* <=XP */, "expected ERROR_INVALID_PARAMETER got %u\n", error); @@ -626,7 +624,6 @@ todo_wine ret = pGetVolumePathNameA(pathC1, NULL, 0); error = GetLastError(); ok(!ret, "expected failure\n"); -todo_wine ok(error == ERROR_INVALID_PARAMETER || broken(error == ERROR_FILENAME_EXCED_RANGE) /* <=XP */, "expected ERROR_INVALID_PARAMETER got %u\n", error); @@ -635,7 +632,6 @@ todo_wine ret = pGetVolumePathNameA(pathC1, volume, 0); error = GetLastError(); ok(!ret, "expected failure\n"); -todo_wine ok(error == ERROR_INVALID_PARAMETER || broken(error == ERROR_FILENAME_EXCED_RANGE ) /* <=XP */, "expected ERROR_INVALID_PARAMETER got %u\n", error); @@ -644,7 +640,6 @@ todo_wine ret = pGetVolumePathNameA(pathC1, volume, 1); error = GetLastError(); ok(!ret, "expected failure\n"); -todo_wine ok(error == ERROR_FILENAME_EXCED_RANGE, "expected ERROR_FILENAME_EXCED_RANGE got %u\n", error); volume[0] = '\0'; @@ -666,6 +661,14 @@ todo_wine ok(ret, "expected success\n"); todo_wine ok(!strcmp(expected, volume), "expected name '%s', returned '%s'\n", expected, volume); + + /* test an invalid path */ + SetLastError( 0xdeadbeef ); + ret = pGetVolumePathNameA("\\\\$$$", volume, 1); + error = GetLastError(); + ok(!ret, "expected failure\n"); + ok(error == ERROR_INVALID_NAME || broken(ERROR_FILENAME_EXCED_RANGE) /* <=2000 */, + "expected ERROR_INVALID_NAME got %u\n", error); } static void test_GetVolumePathNamesForVolumeNameA(void) From 8f27232d24faab213f3ac42854c9f2a60e93c62f Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 22:54:06 +0000 Subject: [PATCH 360/419] [PSDK] * Import delayloadhandler.h and fileapi.h from Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62788 --- reactos/include/psdk/delayloadhandler.h | 55 +++++++++++++++++++++++++ reactos/include/psdk/fileapi.h | 41 ++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 reactos/include/psdk/delayloadhandler.h create mode 100644 reactos/include/psdk/fileapi.h diff --git a/reactos/include/psdk/delayloadhandler.h b/reactos/include/psdk/delayloadhandler.h new file mode 100644 index 00000000000..06b658990c4 --- /dev/null +++ b/reactos/include/psdk/delayloadhandler.h @@ -0,0 +1,55 @@ +/* + * Copyright 2013 André Hentschel + * + * 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 __WINE_DELAYLOADHANDLER_H +#define __WINE_DELAYLOADHANDLER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define DELAYLOAD_GPA_FAILURE 4 + +typedef struct _DELAYLOAD_PROC_DESCRIPTOR +{ + ULONG ImportDescribedByName; + union { + LPCSTR Name; + ULONG Ordinal; + } Description; +} DELAYLOAD_PROC_DESCRIPTOR, *PDELAYLOAD_PROC_DESCRIPTOR; + +typedef struct _DELAYLOAD_INFO +{ + ULONG Size; + PCIMAGE_DELAYLOAD_DESCRIPTOR DelayloadDescriptor; + PIMAGE_THUNK_DATA ThunkAddress; + LPCSTR TargetDllName; + DELAYLOAD_PROC_DESCRIPTOR TargetApiDescriptor; + PVOID TargetModuleBase; + PVOID Unused; + ULONG LastError; +} DELAYLOAD_INFO, *PDELAYLOAD_INFO; + +typedef PVOID (WINAPI *PDELAYLOAD_FAILURE_DLL_CALLBACK)(ULONG, PDELAYLOAD_INFO); + +#ifdef __cplusplus +} +#endif + +#endif /* __WINE_DELAYLOADHANDLER_H */ diff --git a/reactos/include/psdk/fileapi.h b/reactos/include/psdk/fileapi.h new file mode 100644 index 00000000000..02bbbd4d920 --- /dev/null +++ b/reactos/include/psdk/fileapi.h @@ -0,0 +1,41 @@ +/* + * Copyright 2013 André Hentschel + * + * 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 __WINE_FILEAPI_H +#define __WINE_FILEAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _CREATEFILE2_EXTENDED_PARAMETERS { + DWORD dwSize; + DWORD dwFileAttributes; + DWORD dwFileFlags; + DWORD dwSecurityQosFlags; + LPSECURITY_ATTRIBUTES lpSecurityAttributes; + HANDLE hTemplateFile; +} CREATEFILE2_EXTENDED_PARAMETERS, *PCREATEFILE2_EXTENDED_PARAMETERS, *LPCREATEFILE2_EXTENDED_PARAMETERS; + +WINBASEAPI HANDLE WINAPI CreateFile2(LPCWSTR,DWORD,DWORD,DWORD,LPCREATEFILE2_EXTENDED_PARAMETERS); + +#ifdef __cplusplus +} +#endif + +#endif /* __WINE_FILEAPI_H */ From 35550fac67adc3a8dcd607f9d4192f29ee57e603 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 22:57:46 +0000 Subject: [PATCH 361/419] [PSDK] * Add some missing definition from Wine 1.7.17 CORE-8080 svn path=/trunk/; revision=62789 --- reactos/include/psdk/winbase.h | 118 +++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/reactos/include/psdk/winbase.h b/reactos/include/psdk/winbase.h index d826ec16ae6..d6f9da628a2 100644 --- a/reactos/include/psdk/winbase.h +++ b/reactos/include/psdk/winbase.h @@ -3641,6 +3641,124 @@ typedef BOOL _Inout_opt_ PVOID Parameter, _Outptr_opt_result_maybenull_ PVOID *Context); +#if _WIN32_WINNT >= 0x0601 + +#define COPYFILE2_MESSAGE_COPY_OFFLOAD 0x00000001L + +typedef enum _COPYFILE2_MESSAGE_TYPE { + COPYFILE2_CALLBACK_NONE = 0, + COPYFILE2_CALLBACK_CHUNK_STARTED, + COPYFILE2_CALLBACK_CHUNK_FINISHED, + COPYFILE2_CALLBACK_STREAM_STARTED, + COPYFILE2_CALLBACK_STREAM_FINISHED, + COPYFILE2_CALLBACK_POLL_CONTINUE, + COPYFILE2_CALLBACK_ERROR, + COPYFILE2_CALLBACK_MAX, +} COPYFILE2_MESSAGE_TYPE; + +typedef enum _COPYFILE2_MESSAGE_ACTION { + COPYFILE2_PROGRESS_CONTINUE = 0, + COPYFILE2_PROGRESS_CANCEL, + COPYFILE2_PROGRESS_STOP, + COPYFILE2_PROGRESS_QUIET, + COPYFILE2_PROGRESS_PAUSE, +} COPYFILE2_MESSAGE_ACTION; + +typedef enum _COPYFILE2_COPY_PHASE { + COPYFILE2_PHASE_NONE = 0, + COPYFILE2_PHASE_PREPARE_SOURCE, + COPYFILE2_PHASE_PREPARE_DEST, + COPYFILE2_PHASE_READ_SOURCE, + COPYFILE2_PHASE_WRITE_DESTINATION, + COPYFILE2_PHASE_SERVER_COPY, + COPYFILE2_PHASE_NAMEGRAFT_COPY, + COPYFILE2_PHASE_MAX, +} COPYFILE2_COPY_PHASE; + +typedef struct COPYFILE2_MESSAGE { + COPYFILE2_MESSAGE_TYPE Type; + DWORD dwPadding; + union { + struct { + DWORD dwStreamNumber; + DWORD dwReserved; + HANDLE hSourceFile; + HANDLE hDestinationFile; + ULARGE_INTEGER uliChunkNumber; + ULARGE_INTEGER uliChunkSize; + ULARGE_INTEGER uliStreamSize; + ULARGE_INTEGER uliTotalFileSize; + } ChunkStarted; + struct { + DWORD dwStreamNumber; + DWORD dwFlags; + HANDLE hSourceFile; + HANDLE hDestinationFile; + ULARGE_INTEGER uliChunkNumber; + ULARGE_INTEGER uliChunkSize; + ULARGE_INTEGER uliStreamSize; + ULARGE_INTEGER uliStreamBytesTransferred; + ULARGE_INTEGER uliTotalFileSize; + ULARGE_INTEGER uliTotalBytesTransferred; + } ChunkFinished; + struct { + DWORD dwStreamNumber; + DWORD dwReserved; + HANDLE hSourceFile; + HANDLE hDestinationFile; + ULARGE_INTEGER uliStreamSize; + ULARGE_INTEGER uliTotalFileSize; + } StreamStarted; + struct { + DWORD dwStreamNumber; + DWORD dwReserved; + HANDLE hSourceFile; + HANDLE hDestinationFile; + ULARGE_INTEGER uliStreamSize; + ULARGE_INTEGER uliStreamBytesTransferred; + ULARGE_INTEGER uliTotalFileSize; + ULARGE_INTEGER uliTotalBytesTransferred; + } StreamFinished; + struct { + DWORD dwReserved; + } PollContinue; + struct { + COPYFILE2_COPY_PHASE CopyPhase; + DWORD dwStreamNumber; + HRESULT hrFailure; + DWORD dwReserved; + ULARGE_INTEGER uliChunkNumber; + ULARGE_INTEGER uliStreamSize; + ULARGE_INTEGER uliStreamBytesTransferred; + ULARGE_INTEGER uliTotalFileSize; + ULARGE_INTEGER uliTotalBytesTransferred; + } Error; + } Info; +} COPYFILE2_MESSAGE; + +typedef COPYFILE2_MESSAGE_ACTION +(CALLBACK *PCOPYFILE2_PROGRESS_ROUTINE)( + _In_ const COPYFILE2_MESSAGE *pMessage, + _In_opt_ PVOID pvCallbackContext); + +typedef struct COPYFILE2_EXTENDED_PARAMETERS { + DWORD dwSize; + DWORD dwCopyFlags; + BOOL *pfCancel; + PCOPYFILE2_PROGRESS_ROUTINE pProgressRoutine; + PVOID pvCallbackContext; +} COPYFILE2_EXTENDED_PARAMETERS; + +WINBASEAPI +HRESULT +WINAPI +CopyFile2( + _In_ PCWSTR pwszExistingFileName, + _In_ PCWSTR pwszNewFileName, + _In_opt_ COPYFILE2_EXTENDED_PARAMETERS *pExtendedParameters); + +#endif /* _WIN32_WINNT >= 0x0601 */ + #ifdef _MSC_VER #pragma warning(pop) #endif From bc61ac0dc51a0bf9b70368c5e1d7aa6b641a06a9 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Fri, 18 Apr 2014 23:05:43 +0000 Subject: [PATCH 362/419] [PSDK] * Add some missing definitions from Wine 1.7.17 CORE-8080 svn path=/trunk/; revision=62790 --- reactos/include/psdk/winnt.h | 91 ++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) diff --git a/reactos/include/psdk/winnt.h b/reactos/include/psdk/winnt.h index 41f2ae14d18..039cf6073a0 100644 --- a/reactos/include/psdk/winnt.h +++ b/reactos/include/psdk/winnt.h @@ -4638,6 +4638,25 @@ typedef struct _IMAGE_BOUND_FORWARDER_REF { WORD Reserved; } IMAGE_BOUND_FORWARDER_REF, *PIMAGE_BOUND_FORWARDER_REF; +typedef struct _IMAGE_DELAYLOAD_DESCRIPTOR { + union { + DWORD AllAttributes; + struct { + DWORD RvaBased:1; + DWORD ReservedAttributes:31; + }; + } Attributes; + DWORD DllNameRVA; + DWORD ModuleHandleRVA; + DWORD ImportAddressTableRVA; + DWORD ImportNameTableRVA; + DWORD BoundImportAddressTableRVA; + DWORD UnloadInformationTableRVA; + DWORD TimeDateStamp; +} IMAGE_DELAYLOAD_DESCRIPTOR, *PIMAGE_DELAYLOAD_DESCRIPTOR; + +typedef const IMAGE_DELAYLOAD_DESCRIPTOR *PCIMAGE_DELAYLOAD_DESCRIPTOR; + typedef struct _IMAGE_RESOURCE_DIRECTORY { DWORD Characteristics; DWORD TimeDateStamp; @@ -5695,6 +5714,78 @@ DbgRaiseAssertionFailure(VOID) #endif +typedef struct _TP_POOL TP_POOL, *PTP_POOL; +typedef struct _TP_WORK TP_WORK, *PTP_WORK; +typedef struct _TP_CALLBACK_INSTANCE TP_CALLBACK_INSTANCE, *PTP_CALLBACK_INSTANCE; + +typedef DWORD TP_VERSION, *PTP_VERSION; + +typedef enum _TP_CALLBACK_PRIORITY { + TP_CALLBACK_PRIORITY_HIGH, + TP_CALLBACK_PRIORITY_NORMAL, + TP_CALLBACK_PRIORITY_LOW, + TP_CALLBACK_PRIORITY_INVALID, + TP_CALLBACK_PRIORITY_COUNT = TP_CALLBACK_PRIORITY_INVALID +} TP_CALLBACK_PRIORITY; + +typedef VOID +(NTAPI *PTP_WORK_CALLBACK)( + _Inout_ PTP_CALLBACK_INSTANCE Instance, + _Inout_opt_ PVOID Context, + _Inout_ PTP_WORK Work); + +typedef struct _TP_CLEANUP_GROUP TP_CLEANUP_GROUP, *PTP_CLEANUP_GROUP; + +typedef VOID +(NTAPI *PTP_SIMPLE_CALLBACK)( + _Inout_ PTP_CALLBACK_INSTANCE Instance, + _Inout_opt_ PVOID Context); + +typedef VOID +(NTAPI *PTP_CLEANUP_GROUP_CANCEL_CALLBACK)( + _Inout_opt_ PVOID ObjectContext, + _Inout_opt_ PVOID CleanupContext); + +#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) +typedef struct _TP_CALLBACK_ENVIRON_V3 { + TP_VERSION Version; + PTP_POOL Pool; + PTP_CLEANUP_GROUP CleanupGroup; + PTP_CLEANUP_GROUP_CANCEL_CALLBACK CleanupGroupCancelCallback; + PVOID RaceDll; + struct _ACTIVATION_CONTEXT *ActivationContext; + PTP_SIMPLE_CALLBACK FinalizationCallback; + union { + DWORD Flags; + struct { + DWORD LongFunction:1; + DWORD Persistent:1; + DWORD Private:30; + } s; + } u; + TP_CALLBACK_PRIORITY CallbackPriority; + DWORD Size; +} TP_CALLBACK_ENVIRON_V3, TP_CALLBACK_ENVIRON, *PTP_CALLBACK_ENVIRON; +#else +typedef struct _TP_CALLBACK_ENVIRON_V1 { + TP_VERSION Version; + PTP_POOL Pool; + PTP_CLEANUP_GROUP CleanupGroup; + PTP_CLEANUP_GROUP_CANCEL_CALLBACK CleanupGroupCancelCallback; + PVOID RaceDll; + struct _ACTIVATION_CONTEXT *ActivationContext; + PTP_SIMPLE_CALLBACK FinalizationCallback; + union { + DWORD Flags; + struct { + DWORD LongFunction:1; + DWORD Persistent:1; + DWORD Private:30; + } s; + } u; +} TP_CALLBACK_ENVIRON_V1, TP_CALLBACK_ENVIRON, *PTP_CALLBACK_ENVIRON; +#endif /* (_WIN32_WINNT >= _WIN32_WINNT_WIN7) */ + #ifdef _MSC_VER #pragma warning(pop) #endif From 4c86c611f15495a5b52a408253ed78ceb9175360 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 19 Apr 2014 06:32:58 +0000 Subject: [PATCH 363/419] [CDFS] Don't attempt anything during the cleanup of stream file (or of an unopened file). Fix crash on boot. svn path=/trunk/; revision=62791 --- reactos/drivers/filesystems/cdfs/cleanup.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/reactos/drivers/filesystems/cdfs/cleanup.c b/reactos/drivers/filesystems/cdfs/cleanup.c index 19d866de6fd..ea7fe5b0a0c 100644 --- a/reactos/drivers/filesystems/cdfs/cleanup.c +++ b/reactos/drivers/filesystems/cdfs/cleanup.c @@ -46,6 +46,12 @@ CdfsCleanupFile(PDEVICE_EXTENSION DeviceExt, DeviceExt, FileObject); + PFCB Fcb = FileObject->FsContext; + if (!Fcb) + { + return STATUS_SUCCESS; + } + /* Notify about the cleanup */ FsRtlNotifyCleanup(DeviceExt->NotifySync, &(DeviceExt->NotifyList), From c023028768eb5b3260c96ef141331599c51748c2 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 19 Apr 2014 06:38:25 +0000 Subject: [PATCH 364/419] [CDFS] Fix MSVC build svn path=/trunk/; revision=62792 --- reactos/drivers/filesystems/cdfs/cleanup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/drivers/filesystems/cdfs/cleanup.c b/reactos/drivers/filesystems/cdfs/cleanup.c index ea7fe5b0a0c..f46ecdbe0fd 100644 --- a/reactos/drivers/filesystems/cdfs/cleanup.c +++ b/reactos/drivers/filesystems/cdfs/cleanup.c @@ -41,12 +41,13 @@ CdfsCleanupFile(PDEVICE_EXTENSION DeviceExt, * FUNCTION: Cleans up after a file has been closed. */ { + PFCB Fcb; DPRINT("CdfsCleanupFile(DeviceExt %p, FileObject %p)\n", DeviceExt, FileObject); - PFCB Fcb = FileObject->FsContext; + Fcb = FileObject->FsContext; if (!Fcb) { return STATUS_SUCCESS; From 5888821aa442d07b8f0627a2365ea94bb5bae2c0 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 19 Apr 2014 09:09:12 +0000 Subject: [PATCH 365/419] [MSGINA] - Allways add the computer name to the domain list. - Notify the user about required password changes and repeat the logon using the new password. svn path=/trunk/; revision=62793 --- reactos/dll/win32/msgina/gui.c | 72 +++++++++++++++++++++++++- reactos/dll/win32/msgina/lang/bg-BG.rc | 2 + reactos/dll/win32/msgina/lang/cs-CZ.rc | 2 + reactos/dll/win32/msgina/lang/de-DE.rc | 2 + reactos/dll/win32/msgina/lang/en-US.rc | 2 + reactos/dll/win32/msgina/lang/es-ES.rc | 2 + reactos/dll/win32/msgina/lang/fr-FR.rc | 2 + reactos/dll/win32/msgina/lang/he-IL.rc | 2 + reactos/dll/win32/msgina/lang/id-ID.rc | 2 + reactos/dll/win32/msgina/lang/it-IT.rc | 2 + reactos/dll/win32/msgina/lang/ja-JP.rc | 2 + reactos/dll/win32/msgina/lang/no-NO.rc | 2 + reactos/dll/win32/msgina/lang/pl-PL.rc | 2 + reactos/dll/win32/msgina/lang/ro-RO.rc | 2 + reactos/dll/win32/msgina/lang/ru-RU.rc | 2 + reactos/dll/win32/msgina/lang/sk-SK.rc | 2 + reactos/dll/win32/msgina/lang/sq-AL.rc | 2 + reactos/dll/win32/msgina/lang/tr-TR.rc | 2 + reactos/dll/win32/msgina/lang/uk-UA.rc | 2 + reactos/dll/win32/msgina/resource.h | 2 + 20 files changed, 108 insertions(+), 2 deletions(-) diff --git a/reactos/dll/win32/msgina/gui.c b/reactos/dll/win32/msgina/gui.c index 1bd863ea108..41b7689f470 100644 --- a/reactos/dll/win32/msgina/gui.c +++ b/reactos/dll/win32/msgina/gui.c @@ -975,6 +975,38 @@ TRACE("Account locked!\n"); MB_OK | MB_ICONERROR); goto done; } + else if ((SubStatus == STATUS_PASSWORD_MUST_CHANGE) || + (SubStatus == STATUS_PASSWORD_EXPIRED)) + { + if (SubStatus == STATUS_PASSWORD_MUST_CHANGE) + ResourceMessageBox(pgContext, + hwndDlg, + MB_OK | MB_ICONSTOP, + IDS_LOGONTITLE, + IDS_PASSWORDMUSTCHANGE); + else + ResourceMessageBox(pgContext, + hwndDlg, + MB_OK | MB_ICONSTOP, + IDS_LOGONTITLE, + IDS_PASSWORDEXPIRED); + + if (!OnChangePassword(hwndDlg, + pgContext)) + goto done; + + Status = DoLoginTasks(pgContext, + pgContext->UserName, + pgContext->Domain, + pgContext->Password, + &SubStatus); + if (!NT_SUCCESS(Status)) + { + TRACE("Login after password change failed! (Status 0x%08lx)\n", Status); + + goto done; + } + } else { TRACE("Other error!\n"); @@ -1018,6 +1050,43 @@ done: return result; } + +static +VOID +SetDomainComboBox( + HWND hwndDomainComboBox, + PGINA_CONTEXT pgContext) +{ + WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1]; + DWORD dwComputerNameLength; + LONG lIndex = 0; + LONG lFindIndex; + + SendMessageW(hwndDomainComboBox, CB_RESETCONTENT, 0, 0); + + dwComputerNameLength = sizeof(szComputerName) / sizeof(WCHAR); + if (GetComputerNameW(szComputerName, &dwComputerNameLength)) + { + lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)szComputerName); + } + + if (wcslen(pgContext->Domain) != 0) + { + lFindIndex = SendMessageW(hwndDomainComboBox, CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)pgContext->Domain); + if (lFindIndex == CB_ERR) + { + lIndex = SendMessageW(hwndDomainComboBox, CB_ADDSTRING, 0, (LPARAM)pgContext->Domain); + } + else + { + lIndex = lFindIndex; + } + } + + SendMessageW(hwndDomainComboBox, CB_SETCURSEL, lIndex, 0); +} + + static INT_PTR CALLBACK LoggedOutWindowProc( IN HWND hwndDlg, @@ -1045,8 +1114,7 @@ LoggedOutWindowProc( if (pgContext->bShutdownWithoutLogon == FALSE) EnableWindow(GetDlgItem(hwndDlg, IDC_SHUTDOWN), FALSE); - SendDlgItemMessageW(hwndDlg, IDC_LOGON_TO, CB_ADDSTRING, 0, (LPARAM)pgContext->Domain); - SendDlgItemMessageW(hwndDlg, IDC_LOGON_TO, CB_SETCURSEL, 0, 0); + SetDomainComboBox(GetDlgItem(hwndDlg, IDC_LOGON_TO), pgContext); SetFocus(GetDlgItem(hwndDlg, pgContext->bDontDisplayLastUserName ? IDC_USERNAME : IDC_PASSWORD)); diff --git a/reactos/dll/win32/msgina/lang/bg-BG.rc b/reactos/dll/win32/msgina/lang/bg-BG.rc index c6e41603d98..cee7c055f8e 100644 --- a/reactos/dll/win32/msgina/lang/bg-BG.rc +++ b/reactos/dll/win32/msgina/lang/bg-BG.rc @@ -148,6 +148,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/cs-CZ.rc b/reactos/dll/win32/msgina/lang/cs-CZ.rc index fb7c834e92c..05c71e7f97c 100644 --- a/reactos/dll/win32/msgina/lang/cs-CZ.rc +++ b/reactos/dll/win32/msgina/lang/cs-CZ.rc @@ -153,6 +153,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/de-DE.rc b/reactos/dll/win32/msgina/lang/de-DE.rc index 612afcf8a6e..e71838cc2be 100644 --- a/reactos/dll/win32/msgina/lang/de-DE.rc +++ b/reactos/dll/win32/msgina/lang/de-DE.rc @@ -148,6 +148,8 @@ BEGIN IDS_LOGONTITLE "Anmeldemeldung" IDS_LOGONWRONGUSERORPWD "Sie konnten nicht angemeldet werden. Prüfen Sie Benutzername und Domäne, und geben Sie das Passwort erneut ein. Bei Passworten wird Groß- und Kleinschreibung unterschieden." IDS_LOGONUSERDISABLED "Ihr Konto wurde deaktiviert. Wenden Sie sich an Ihren Systemadministrator." + IDS_PASSWORDMUSTCHANGE "Sie müssen Ihr Paasswort bei der ersten Anmeldung ändern." + IDS_PASSWORDEXPIRED "Ihr Passwort ist abgelaufen und muss geändert werden." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/en-US.rc b/reactos/dll/win32/msgina/lang/en-US.rc index b699b34c2b6..c8828ca2313 100644 --- a/reactos/dll/win32/msgina/lang/en-US.rc +++ b/reactos/dll/win32/msgina/lang/en-US.rc @@ -148,6 +148,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/es-ES.rc b/reactos/dll/win32/msgina/lang/es-ES.rc index 83c9cb9981f..45a0f3dd9eb 100644 --- a/reactos/dll/win32/msgina/lang/es-ES.rc +++ b/reactos/dll/win32/msgina/lang/es-ES.rc @@ -150,6 +150,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/fr-FR.rc b/reactos/dll/win32/msgina/lang/fr-FR.rc index 60b838c355d..4f0d3242a07 100644 --- a/reactos/dll/win32/msgina/lang/fr-FR.rc +++ b/reactos/dll/win32/msgina/lang/fr-FR.rc @@ -148,6 +148,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/he-IL.rc b/reactos/dll/win32/msgina/lang/he-IL.rc index 89be4d60945..bb76396143e 100644 --- a/reactos/dll/win32/msgina/lang/he-IL.rc +++ b/reactos/dll/win32/msgina/lang/he-IL.rc @@ -148,6 +148,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/id-ID.rc b/reactos/dll/win32/msgina/lang/id-ID.rc index 4e45a682551..6e33eb6a7fe 100644 --- a/reactos/dll/win32/msgina/lang/id-ID.rc +++ b/reactos/dll/win32/msgina/lang/id-ID.rc @@ -148,6 +148,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/it-IT.rc b/reactos/dll/win32/msgina/lang/it-IT.rc index a1e442e1024..eef95f8767f 100644 --- a/reactos/dll/win32/msgina/lang/it-IT.rc +++ b/reactos/dll/win32/msgina/lang/it-IT.rc @@ -156,6 +156,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/ja-JP.rc b/reactos/dll/win32/msgina/lang/ja-JP.rc index b3af12c5549..118f1b10ce8 100644 --- a/reactos/dll/win32/msgina/lang/ja-JP.rc +++ b/reactos/dll/win32/msgina/lang/ja-JP.rc @@ -148,6 +148,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/no-NO.rc b/reactos/dll/win32/msgina/lang/no-NO.rc index bce3ee2d0c3..062cc610a9b 100644 --- a/reactos/dll/win32/msgina/lang/no-NO.rc +++ b/reactos/dll/win32/msgina/lang/no-NO.rc @@ -148,6 +148,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/pl-PL.rc b/reactos/dll/win32/msgina/lang/pl-PL.rc index a1d56bec798..80c2020e19b 100644 --- a/reactos/dll/win32/msgina/lang/pl-PL.rc +++ b/reactos/dll/win32/msgina/lang/pl-PL.rc @@ -157,6 +157,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/ro-RO.rc b/reactos/dll/win32/msgina/lang/ro-RO.rc index 4e517e63095..853a394f80a 100644 --- a/reactos/dll/win32/msgina/lang/ro-RO.rc +++ b/reactos/dll/win32/msgina/lang/ro-RO.rc @@ -150,6 +150,8 @@ BEGIN IDS_LOGONTITLE "Mesaj de autentificare" IDS_LOGONWRONGUSERORPWD "Sistemul nu vă poate autentifica. Asigurați-vă că numele și domeniul sunt corecte apoi tastați din nou parola. În parolă se face distincție între majuscule și minuscule." IDS_LOGONUSERDISABLED "Contul dumneavoastră a fost dezactivat. Contactați administratorul de sistem." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/ru-RU.rc b/reactos/dll/win32/msgina/lang/ru-RU.rc index 1061218abb7..dc7cea38602 100644 --- a/reactos/dll/win32/msgina/lang/ru-RU.rc +++ b/reactos/dll/win32/msgina/lang/ru-RU.rc @@ -150,6 +150,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "Системе не удается войти в. Убедитесь в том, ваше имя пользователя и домен верны, то введите пароль еще раз. Символы в Пароли вводятся с учетом регистра" IDS_LOGONUSERDISABLED "Ваш аккаунт был отключен. Пожалуйста, обратитесь к системному администратору." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/sk-SK.rc b/reactos/dll/win32/msgina/lang/sk-SK.rc index 31d4ab2418f..3b624ab09a1 100644 --- a/reactos/dll/win32/msgina/lang/sk-SK.rc +++ b/reactos/dll/win32/msgina/lang/sk-SK.rc @@ -153,6 +153,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/sq-AL.rc b/reactos/dll/win32/msgina/lang/sq-AL.rc index cb9a93fb962..17257a22837 100644 --- a/reactos/dll/win32/msgina/lang/sq-AL.rc +++ b/reactos/dll/win32/msgina/lang/sq-AL.rc @@ -151,6 +151,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/tr-TR.rc b/reactos/dll/win32/msgina/lang/tr-TR.rc index c216ef7b5f6..b6e731a5353 100644 --- a/reactos/dll/win32/msgina/lang/tr-TR.rc +++ b/reactos/dll/win32/msgina/lang/tr-TR.rc @@ -150,6 +150,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/lang/uk-UA.rc b/reactos/dll/win32/msgina/lang/uk-UA.rc index b125c5473c9..191b3053dd2 100644 --- a/reactos/dll/win32/msgina/lang/uk-UA.rc +++ b/reactos/dll/win32/msgina/lang/uk-UA.rc @@ -156,6 +156,8 @@ BEGIN IDS_LOGONTITLE "Logon Message" IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." + IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END /* Shutdown Dialog Strings */ diff --git a/reactos/dll/win32/msgina/resource.h b/reactos/dll/win32/msgina/resource.h index e310dcf9a07..cee14bea090 100644 --- a/reactos/dll/win32/msgina/resource.h +++ b/reactos/dll/win32/msgina/resource.h @@ -57,6 +57,8 @@ #define IDS_LOGONTITLE 40015 #define IDS_LOGONWRONGUSERORPWD 40016 #define IDS_LOGONUSERDISABLED 40017 +#define IDS_PASSWORDMUSTCHANGE 40018 +#define IDS_PASSWORDEXPIRED 40019 #define IDS_SHUTDOWN_SHUTDOWN 50000 #define IDS_SHUTDOWN_LOGOFF 50001 From f3f734fbddbeda509315d55653902030ea121495 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 19 Apr 2014 09:40:15 +0000 Subject: [PATCH 366/419] =?UTF-8?q?[SYSDM][USRMGR][MSGINA]=20Polish=20tran?= =?UTF-8?q?slation=20of=20msgina,=20sysdm=20and=20usrmgr.=20Patch=20by=20W?= =?UTF-8?q?ojciech=20Koz=C5=82owski=20and=20Adam=20Stachowicz.=20Thanks=20?= =?UTF-8?q?a=20lot!=20CORE-8068=20#resolve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=62794 --- reactos/dll/cpl/sysdm/lang/pl-PL.rc | 8 ++--- reactos/dll/cpl/usrmgr/lang/pl-PL.rc | 17 +++++----- reactos/dll/win32/msgina/lang/pl-PL.rc | 47 +++++++++++++------------- 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/reactos/dll/cpl/sysdm/lang/pl-PL.rc b/reactos/dll/cpl/sysdm/lang/pl-PL.rc index 33add887c43..8632f75e68b 100644 --- a/reactos/dll/cpl/sysdm/lang/pl-PL.rc +++ b/reactos/dll/cpl/sysdm/lang/pl-PL.rc @@ -4,7 +4,7 @@ * https://sourceforge.net/projects/reactospl * Updated by Caemyr - Olaf Siejka (Jan, 2008) * UTF-8 conversion by Caemyr (May, 2011) - * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (August, 2011) + * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (April, 2014) */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -284,8 +284,8 @@ BEGIN IDS_WARNMAXIMUMSIZE "Wprowadź wielkość dla maksymalnego rozmiaru pliku stronicowania." IDS_WARNINITIALRANGE "Początkowy rozmiar pliku stronicowania nie może być mniejszy niż 2MB i nie może przekraczać dostępnej ilości miejsca w wybranym napędzie." IDS_WARNMAXIMUMRANGE "Maksymalny rozmiar pliku stronicowania nie może być mniejszy niż jego rozmiar początkowy i nie może przekraczać dostępnej ilości miejsca w wybranym napędzie." - IDS_PAGEFILE_NONE "none" - IDS_PAGEFILE_SYSTEM "system managed" - IDS_INFOREBOOT "You have to reboot the computer, in order to apply the changes." + IDS_PAGEFILE_NONE "brak" + IDS_PAGEFILE_SYSTEM "Kontrolowany przez system" + IDS_INFOREBOOT "Musisz ponownie uruchomić komputer, aby zastosować zmiany." IDS_DEVS "\nEkipa ReactOS\n\nKoordynator Projektu\n\nAleksey Bragin\n\nEkipa Programistów\n\nAleksey Bragin\nAndrew Greenwood\nAndrey Korotaev\nArt Yerkes\nChristoph von Wittich\nColin Finck\nDaniel Reimer\nDmitry Chapyshev\nEric Kohl\nGed Murphy\nGregor Brunmar\nHervé Poussineau\nJames Tabor\nJeffrey Morlan\nJohannes Anderwald\nKJK::Hyperion\nMaarten Bosma\nMagnus Olsen\nMarc Piulachs\nMatthias Kupfer\nMike Nordell\nPeter Ward\nPierre Schweitzer\nSaveliy Tretiakov\nStefan Ginsberg\nSylvain Petreolle\nThomas Blümel\nTimo Kreuzer \n\nAlex Ionescu\nFilip Navara\nGunnar Dalsnes\nMartin Fuchs\nRoyce Mitchell III\nBrandon Turner\nBrian Palmer\nCasper Hornstrup\nDavid Welch\nEmanuele Aliberti\nGé van Geldorp\nGregor Anich\nJason Filby\nJens Collin\nMichael Wirth\nNathan Woods\nRobert Dickenson\nRex Jolliff\nVizzini \n\nInżynierowie Wydań\n\nColin Finck\nZ98\n\nEkipa WWW\n\nColin Finck\nJaix Bly\nKlemens Friedl\nZ98\n\nEkipa PR\n\nMindflyer\nWierd_W\n\nPodziękowania dla\n\nwszystkich współpracowników\nEkipy Wine\n\n"//FIXME END diff --git a/reactos/dll/cpl/usrmgr/lang/pl-PL.rc b/reactos/dll/cpl/usrmgr/lang/pl-PL.rc index 20ea393270b..ebe1aa08106 100644 --- a/reactos/dll/cpl/usrmgr/lang/pl-PL.rc +++ b/reactos/dll/cpl/usrmgr/lang/pl-PL.rc @@ -5,6 +5,7 @@ * http://www.reactos.org * IRC: irc.freenode.net #reactos-pl * UTF-8 conversion by Caemyr (May, 2011) + * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (April, 2014) */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -18,11 +19,11 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_USERS_LIST, "SysListView32", LVS_REPORT | LVS_EDITLABELS | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 7, 7, 238, 85, WS_EX_CLIENTEDGE - PUSHBUTTON "A&dd...", IDC_USERS_ADD, 87, 98, 50, 14 - PUSHBUTTON "&Remove", IDC_USERS_REMOVE, 141, 98, 50, 14 - PUSHBUTTON "Pr&operties", IDC_USERS_PROPERTIES, 195, 98, 50, 14 - AUTOCHECKBOX "Require user name and password on system startup.", IDC_USERS_STARTUP_REQUIRE, 10, 118, 200, 14, WS_DISABLED - PUSHBUTTON "Reset Password", IDC_USERS_RESET, 165, 200, 80, 14, WS_DISABLED + PUSHBUTTON "&Dodaj...", IDC_USERS_ADD, 87, 98, 50, 14 + PUSHBUTTON "&Usuń", IDC_USERS_REMOVE, 141, 98, 50, 14 + PUSHBUTTON "Właściw&ości", IDC_USERS_PROPERTIES, 195, 98, 50, 14 + AUTOCHECKBOX "Wymagaj nazwy użytkownika i hasła przy starcie systemu.", IDC_USERS_STARTUP_REQUIRE, 10, 118, 200, 14, WS_DISABLED + PUSHBUTTON "Resetuj hasło", IDC_USERS_RESET, 165, 200, 80, 14, WS_DISABLED END IDD_GROUPS DIALOGEX 0, 0, 252, 223 @@ -32,9 +33,9 @@ FONT 8, "MS Shell Dlg" BEGIN CONTROL "", IDC_GROUPS_LIST, "SysListView32", LVS_REPORT | LVS_EDITLABELS | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING | WS_BORDER | WS_TABSTOP, 7, 7, 238, 85, WS_EX_CLIENTEDGE - PUSHBUTTON "A&dd...", IDC_GROUPS_ADD, 87, 98, 50, 14 - PUSHBUTTON "&Remove", IDC_GROUPS_REMOVE, 141, 98, 50, 14 - PUSHBUTTON "Pr&operties", IDC_GROUPS_PROPERTIES, 195, 98, 50, 14 + PUSHBUTTON "&Dodaj...", IDC_GROUPS_ADD, 87, 98, 50, 14 + PUSHBUTTON "&Usuń", IDC_GROUPS_REMOVE, 141, 98, 50, 14 + PUSHBUTTON "Właściw&ości", IDC_GROUPS_PROPERTIES, 195, 98, 50, 14 END IDD_EXTRA DIALOGEX 0, 0, 252, 223 diff --git a/reactos/dll/win32/msgina/lang/pl-PL.rc b/reactos/dll/win32/msgina/lang/pl-PL.rc index 80c2020e19b..81f1d5bd45b 100644 --- a/reactos/dll/win32/msgina/lang/pl-PL.rc +++ b/reactos/dll/win32/msgina/lang/pl-PL.rc @@ -4,6 +4,7 @@ * https://sourceforge.net/projects/reactospl * UTF-8 conversion by Caemyr (May, 2011) * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (November, 2013) + * Updated by wojo664 - Wojtek Kozlowski (wojo664@gmail.com, wojtekkozlo664@op.pl) (April 2014) */ @@ -38,7 +39,7 @@ BEGIN EDITTEXT IDC_USERNAME, 73, 57, 142, 14, ES_AUTOHSCROLL LTEXT "Hasło:", IDC_STATIC, 6, 78, 52, 8 EDITTEXT IDC_PASSWORD, 73, 76, 142, 14, ES_AUTOHSCROLL | ES_PASSWORD - LTEXT "Log on to:", IDC_STATIC, 6, 96, 52, 8 + LTEXT "Zaloguj do:", IDC_STATIC, 6, 96, 52, 8 COMBOBOX IDC_LOGON_TO, 73, 95, 142, 14, CBS_DROPDOWNLIST | WS_VSCROLL PUSHBUTTON "OK", IDOK, 106, 122, 50, 14, BS_DEFPUSHBUTTON PUSHBUTTON "Anuluj", IDCANCEL, 160, 122, 50, 14 @@ -114,13 +115,13 @@ END IDD_LOGOFF_DLG DIALOGEX 0, 0, 188, 60 STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_SYSMENU | WS_POPUP -CAPTION "Log Off ReactOS" +CAPTION "ReactOS - Wylogowywanie z systemu" FONT 8, "MS Shell Dlg", 400, 0, 1 BEGIN ICON IDI_LOCKICON, -1, 7, 7, 20, 20 - LTEXT "Are you sure you want to log off?", IDC_STATIC, 35, 16, 146, 8 - PUSHBUTTON "Yes", IDYES, 41, 39, 50, 14, BS_DEFPUSHBUTTON - PUSHBUTTON "No", IDNO, 95, 39, 50, 14 + LTEXT "Czy na pewno chcesz się wylogować?", IDC_STATIC, 35, 16, 146, 8 + PUSHBUTTON "Tak", IDYES, 41, 39, 50, 14, BS_DEFPUSHBUTTON + PUSHBUTTON "Nie", IDNO, 95, 39, 50, 14 END IDD_SHUTDOWN_DLG DIALOGEX 0, 0, 275, 146 @@ -148,15 +149,15 @@ BEGIN IDS_LOCKMSG "Tylko %s lub Administrator może odblokować ten komputer." IDS_LOGONMSG "Jesteś zalogowany jako %s." IDS_LOGONDATE "Data logowania: %s %s" - IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." - IDS_CHANGEPWDTITLE "Change Password" - IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." - IDS_PASSWORDCHANGED "Your password has been changed." - IDS_LOGONTITLE "Logon Message" - IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." - IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." + IDS_COMPUTERLOCKED "Komputer zablokowany" + IDS_LOCKEDWRONGPASSWORD "Hasło jest niewłaściwe. Wpisz hasło ponownie. Wielkość liter w haśle ma znaczenie." + IDS_LOCKEDWRONGUSER "Ten komputer jest zablokowany. Tylko %s\\%s lub Administrator może odblokować ten komputer." + IDS_CHANGEPWDTITLE "Zmień hasło" + IDS_NONMATCHINGPASSWORDS "Wpisane hasła nie są zgodne. Wpisz takie same hasła w obu polach." + IDS_PASSWORDCHANGED "Twoje hasło zostało zmienione." + IDS_LOGONTITLE "Logowanie - wiadomość" + IDS_LOGONWRONGUSERORPWD "Logowanie w systemie nie jest możliwe. Upewnij się, że nazwa użytkownika i domena jest poprawna, a następnie wpisz ponownie hasło. Wielkość liter w haśle ma znaczenie." + IDS_LOGONUSERDISABLED "Twoje konto zostało wyłączone. Skontaktuj się z administratorem systemu." IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END @@ -164,15 +165,15 @@ END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN - IDS_SHUTDOWN_LOGOFF "Log off ""%s""" - IDS_SHUTDOWN_SHUTDOWN "Shut down" + IDS_SHUTDOWN_LOGOFF "Wyloguj ""%s""" + IDS_SHUTDOWN_SHUTDOWN "Wyłącz" IDS_SHUTDOWN_RESTART "Restart" - IDS_SHUTDOWN_SLEEP "Sleep" - IDS_SHUTDOWN_HIBERNATE "Hibernate" + IDS_SHUTDOWN_SLEEP "Uśpij" + IDS_SHUTDOWN_HIBERNATE "Hibernacja" /* Shut down descriptions */ - IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." - IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." - IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." - IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." + IDS_SHUTDOWN_LOGOFF_DESC "Kończy obecną sesję i pozwala na zalogowanie się innym użytkownikom do systemu." + IDS_SHUTDOWN_SHUTDOWN_DESC "Kończy obecną sesję i wyłącza sytem, pozwalając na bezpieczne wyłączenie zasilania." + IDS_SHUTDOWN_RESTART_DESC "Kończy obecną sesję i resetuje komputer." + IDS_SHUTDOWN_SLEEP_DESC "Przełącza system w tryb uśpienia." + IDS_SHUTDOWN_HIBERNATE_DESC "Zapisuje obecną sesję i wyłącza komputer." END From e17914e7c057a958af84f3c150d865c464facfc8 Mon Sep 17 00:00:00 2001 From: Daniel Reimer Date: Sat, 19 Apr 2014 10:27:52 +0000 Subject: [PATCH 367/419] Rapps DB Update (1/2) svn path=/trunk/; revision=62795 --- .../rapps/rapps/doublecommander.txt | 10 +++---- .../base/applications/rapps/rapps/firefox.txt | 30 +++++++++---------- .../applications/rapps/rapps/lazaruside.txt | 8 ++--- .../applications/rapps/rapps/libreoffice.txt | 12 ++++---- .../applications/rapps/rapps/mirandaim.txt | 12 ++++---- reactos/base/applications/rapps/rapps/mpc.txt | 12 ++++---- reactos/base/applications/rapps/rapps/npp.txt | 12 ++++---- .../base/applications/rapps/rapps/openttd.txt | 12 ++++---- .../base/applications/rapps/rapps/python.txt | 12 ++++---- .../base/applications/rapps/rapps/qb64sdl.txt | 10 +++---- .../base/applications/rapps/rapps/scite.txt | 12 ++++---- .../applications/rapps/rapps/seamonkey.txt | 22 +++++++------- .../applications/rapps/rapps/smplayer.txt | 12 ++++---- .../applications/rapps/rapps/thunderbird.txt | 24 +++++++-------- .../rapps/rapps/totalcommander.txt | 10 +++---- .../applications/rapps/rapps/utorrent.txt | 10 +++---- reactos/base/applications/rapps/rapps/vlc.txt | 12 ++++---- 17 files changed, 116 insertions(+), 116 deletions(-) diff --git a/reactos/base/applications/rapps/rapps/doublecommander.txt b/reactos/base/applications/rapps/rapps/doublecommander.txt index fe5df184479..422148d8700 100644 --- a/reactos/base/applications/rapps/rapps/doublecommander.txt +++ b/reactos/base/applications/rapps/rapps/doublecommander.txt @@ -2,13 +2,13 @@ [Section] Name = Double Commander -Version = 0.5.8 Beta +Version = 0.5.9 Beta Licence = GPL Description = Double Commander is an open source file manager with two panels side by side. You need 7-Zip or a similar Utility to extract it. -Size = 7.5 MB +Size = 7.6 MB Category = 12 URLSite = http://doublecmd.sourceforge.net/ -URLDownload = http://download.sourceforge.net/project/doublecmd/DC%20for%20Windows%2032%20bit/Double%20Commander%200.5.8%20beta/doublecmd-0.5.8.i386-win32.exe +URLDownload = http://download.sourceforge.net/project/doublecmd/DC%20for%20Windows%2032%20bit/Double%20Commander%200.5.9%20beta/doublecmd-0.5.9.i386-win32.exe CDPath = none [Section.0407] @@ -25,7 +25,7 @@ Description = Double Commander to menedżer plików, o otwartym źródle, z klas [Section.0418] Description = Double Commander este un gestionar (open-source) de fișiere după modelul «două paneluri alăturate». Este necesar 7-Zip sau un utilitar similar de dezarhivare pentru a-l putea extrage. -Size = 7,5 Mo +Size = 7,6 Mo [Section.0419] Description = Double Commander - это открытый двухпанельный файловый менеджер. Вам нужен 7-Zip или подобная утилита для его распаковки. @@ -33,7 +33,7 @@ Description = Double Commander - это открытый двухпанельн [Section.041f] Version = 0.5.8 Gelişme Description = Double Commander, yan yana duran iki bölmenin bulunduğu bir açık kaynak kütük yöneticisidir. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. -Size = 7,5 MB +Size = 7,6 MB [Section.0422] Description = Double Commander - це відкритий двопанельний файловий менеджер. Вам потрібен 7-Zip або подібна утиліта щоб розпакувати його. diff --git a/reactos/base/applications/rapps/rapps/firefox.txt b/reactos/base/applications/rapps/rapps/firefox.txt index 32c2681f22a..89df72c9dcf 100644 --- a/reactos/base/applications/rapps/rapps/firefox.txt +++ b/reactos/base/applications/rapps/rapps/firefox.txt @@ -1,83 +1,83 @@ ; UTF-8 [Section] -Name = Mozilla Firefox 26 -Version = 26.0 +Name = Mozilla Firefox 28 +Version = 28.0 Licence = MPL/GPL/LGPL Description = The most popular and one of the best free Web Browsers out there. Size = 22.9 MB Category = 5 URLSite = http://www.mozilla.org/en-US/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/en-US/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/en-US/Firefox%20Setup%2028.0.exe CDPath = none [Section.0407] Description = Der populärste und einer der besten freien Webbrowser. Size = 22.8 MB URLSite = http://www.mozilla.org/de/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/de/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/de/Firefox%20Setup%2028.0.exe [Section.040a] Description = El más popular y uno de los mejores navegadores web gratuitos que hay. Size = 22.7 MB URLSite = http://www.mozilla.org/es-ES/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/es-ES/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/es-ES/Firefox%20Setup%2028.0.exe [Section.040c] Description = Le navigateur web gratuit le plus populaire et l'un des meilleurs. Size = 23,0 Mo URLSite = http://www.mozilla.org/fr/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/fr/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/fr/Firefox%20Setup%2028.0.exe [Section.0410] Description = Il più popolare e uno dei migliori web browser gratuiti. Size = 22.7 MB URLSite = http://www.mozilla.org/it/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/it/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/it/Firefox%20Setup%2028.0.exe [Section.0413] Description = De meest populaire en een van de beste gratis Web browsers. Size = 23.4 MB URLSite = http://www.mozilla.org/nl/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/nl/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/nl/Firefox%20Setup%2028.0.exe [Section.0414] Description = Mest populære og best også gratis nettleserene der ute. Size = 22.8 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/nb-NO/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/nb-NO/Firefox%20Setup%2028.0.exe [Section.0415] Description = Najpopularniejsza i jedna z najlepszych darmowych przeglądarek internetowych. Size = 23.7 MB URLSite = http://www.mozilla.org/pl/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/pl/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/pl/Firefox%20Setup%2028.0.exe [Section.0418] Description = Cel mai popular și unul dintre cele mai bune navigatoare web gratuite existente. Size = 23,3 Mo URLSite = http://www.mozilla.org/ro/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/ro/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/ro/Firefox%20Setup%2028.0.exe [Section.0419] Description = Один из самых популярных и лучших бесплатных браузеров. Size = 23,2 MB URLSite = http://www.mozilla.org/ru/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/ru/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/ru/Firefox%20Setup%2028.0.exe [Section.041b] Description = Najpopulárnejší a jeden z najlepších slobodný webových prehliadačov. Size = 23,4 MB URLSite = http://www.mozilla.org/sk/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/sk/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/sk/Firefox%20Setup%2028.0.exe [Section.041f] Description = Özgür Umûmî Ağ tarayıcıları arasında en tutulanı ve en iyisi. Size = 22,8 MB URLSite = http://www.mozilla.org/tr/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/tr/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/tr/Firefox%20Setup%2028.0.exe [Section.0422] Description = Найпопулярніший та один з кращих безплатних веб-браузерів. Size = 23,2 MB URLSite = http://www.mozilla.org/uk/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/26.0/win32/uk/Firefox%20Setup%2026.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/28.0/win32/uk/Firefox%20Setup%2028.0.exe diff --git a/reactos/base/applications/rapps/rapps/lazaruside.txt b/reactos/base/applications/rapps/rapps/lazaruside.txt index 517eba86618..d38bc5aefaf 100644 --- a/reactos/base/applications/rapps/rapps/lazaruside.txt +++ b/reactos/base/applications/rapps/rapps/lazaruside.txt @@ -2,13 +2,13 @@ [Section] Name = Lazarus -Version = 1.0.14 +Version = 1.2 Licence = modified LGPL, GPL Description = A cross-platform integrated development environment (IDE) that lets you create visual (GUI) and non-visual Object Pascal programs, and uses the Free Pascal compiler to generate your executable. -Size = 111 MB +Size = 112 MB Category = 7 URLSite = http://www.lazarus.freepascal.org/ -URLDownload = http://download.sourceforge.net/project/lazarus/Lazarus%20Windows%2032%20bits/Lazarus%201.0.14/lazarus-1.0.14-fpc-2.6.2-win32.exe +URLDownload = http://download.sourceforge.net/project/lazarus/Lazarus%20Windows%2032%20bits/Lazarus%201.2/lazarus-1.2.0-fpc-2.6.2-win32.exe CDPath = none [Section.0407] @@ -20,7 +20,7 @@ Description = Un ambiente di sviluppo integrato (IDE) cross-platform che consent [Section.0418] Licence = GPL, LGPL modificată Description = Un mediu integrat de dezvoltare (IDE) multi-platformă care vă permite crearea de programe Object Pascal, atât vizuale (GUI) cât și ne-vizuale, și utilizează compilatorul Free Pascal pentru a genera executabile. -Size = 111 Mo +Size = 112 Mo [Section.041f] Licence = Değiştirilmiş LGPL, GPL diff --git a/reactos/base/applications/rapps/rapps/libreoffice.txt b/reactos/base/applications/rapps/rapps/libreoffice.txt index 12359386821..605e24e9b85 100644 --- a/reactos/base/applications/rapps/rapps/libreoffice.txt +++ b/reactos/base/applications/rapps/rapps/libreoffice.txt @@ -2,13 +2,13 @@ [Section] Name = LibreOffice -Version = 4.1.4 +Version = 4.2.3 Licence = LGPL Description = Former called OpenOffice. Open Source Office Suite. -Size = 205.9 MB +Size = 211.0 MB Category = 6 URLSite = http://www.documentfoundation.org/ -URLDownload = http://download.documentfoundation.org/libreoffice/stable/4.1.4/win/x86/LibreOffice_4.1.4_Win_x86.msi +URLDownload = http://download.documentfoundation.org/libreoffice/stable/4.2.3/win/x86/LibreOffice_4.2.3_Win_x86.msi CDPath = none [Section.0407] @@ -19,7 +19,7 @@ Description = La suite de ofimática de código abierto. [Section.040c] Description = Précédemment appelé OpenOffice. Suite bureautique open source. -Size = 205,9 Mo +Size = 211,0 Mo [Section.0410] Description = Precedentemente chiamato OpenOffice. Open Source Office Suite. @@ -32,11 +32,11 @@ Description = Otwarty pakiet biurowy. [Section.0418] Description = Fostul OpenOffice. Suita de aplicații de birotică open-source. -Size = 205,9 Mo +Size = 211,0 Mo [Section.041f] Description = OpenOffice gibi bir açık kaynak büro takımı. -Size = 205,9 MB +Size = 211,0 MB [Section.0422] Description = Відкритий офісний пакет. diff --git a/reactos/base/applications/rapps/rapps/mirandaim.txt b/reactos/base/applications/rapps/rapps/mirandaim.txt index 983de88a861..3205655075f 100644 --- a/reactos/base/applications/rapps/rapps/mirandaim.txt +++ b/reactos/base/applications/rapps/rapps/mirandaim.txt @@ -2,13 +2,13 @@ [Section] Name = Miranda IM -Version = 0.10.21 +Version = 0.10.22 Licence = GPL Description = Open source multiprotocol instant messaging application - May not work completely. -Size = 2.82 MB +Size = 2.8 MB Category = 5 URLSite = http://www.miranda-im.org/ -URLDownload = http://files.miranda-im.org/stable/0.10.21.0/miranda-im-v0.10.21-unicode.exe +URLDownload = http://files.miranda-im.org/stable/0.10.22.0/miranda-im-v0.10.22-unicode.exe CDPath = none [Section.0407] @@ -19,7 +19,7 @@ Description = Aplicación de mensajería instantánea multiprotocolo de código [Section.040c] Description = Application de messagerie instantannée multi-protocoles open source - pourrait ne pas fonctionner complètement. -Size = 2,82 Mo +Size = 2,8 Mo [Section.0410] Description = Multi-protocollo open source per applicazioni di messaggistica istantanea - potrebbe non funzionare del tutto. @@ -32,11 +32,11 @@ Description = Otwarty komunikator internetowy, obsługujący wiele różnych pro [Section.0418] Description = Aplicație de mesagerie instant multiprotocol (open-source) - posibil cu limitări în funcționalitate. -Size = 2,82 Mo +Size = 2,8 Mo [Section.041f] Description = Bir açık kaynak, çoklu iletişim kurallı ve evgin iletileşme yazılımı. Eksiksiz olarak çalışmayabilir. -Size = 2,82 MB +Size = 2,8 MB [Section.0422] Description = Відкрита мультипротокольна програма миттєвих повідомлень - може не працювати повністю. diff --git a/reactos/base/applications/rapps/rapps/mpc.txt b/reactos/base/applications/rapps/rapps/mpc.txt index d34223602c9..0184f79f16d 100644 --- a/reactos/base/applications/rapps/rapps/mpc.txt +++ b/reactos/base/applications/rapps/rapps/mpc.txt @@ -2,13 +2,13 @@ [Section] Name = Media Player Classic Home Cinema -Version = 1.7.1 +Version = 1.7.4 Licence = GPL Description = A media player. -Size = 9.8 MB +Size = 10.1 MB Category = 2 URLSite = http://mpc-hc.org/ -URLDownload = http://download.sourceforge.net/project/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC_v1.7.1_x86/MPC-HC.1.7.1.x86.exe +URLDownload = http://download.sourceforge.net/project/mpc-hc/MPC%20HomeCinema%20-%20Win32/MPC-HC_v1.7.4_x86/MPC-HC.1.7.4.x86.exe CDPath = none [Section.0407] @@ -19,7 +19,7 @@ Description = Reproductor multimedia. [Section.040c] Description = Un lecteur media. -Size = 9,8 Mo +Size = 10,1 Mo [Section.0410] Description = Lettore multimediale. @@ -32,7 +32,7 @@ Description = Odtwarzacz multimediów. [Section.0418] Description = Lector multimedia. -Size = 9,8 Mo +Size = 10,1 Mo [Section.0419] Description = Мультимедийный проигрыватель. @@ -42,7 +42,7 @@ Description = Multimediálny prehrávač. [Section.041f] Description = Bir ortam oynatıcısı. -Size = 9,8 MB +Size = 10,1 MB [Section.0422] Description = Мультимедійний програвач. diff --git a/reactos/base/applications/rapps/rapps/npp.txt b/reactos/base/applications/rapps/rapps/npp.txt index 71fcf0bb734..50b7a72e64c 100644 --- a/reactos/base/applications/rapps/rapps/npp.txt +++ b/reactos/base/applications/rapps/rapps/npp.txt @@ -2,13 +2,13 @@ [Section] Name = Notepad++ -Version = 6.5.3 +Version = 6.5.5 Licence = GPL Description = A text editor. -Size = 7.25 MB +Size = 7.3 MB Category = 6 URLSite = http://notepad-plus-plus.org/ -URLDownload = http://download.tuxfamily.org/notepadplus/6.5.3/npp.6.5.3.Installer.exe +URLDownload = http://download.tuxfamily.org/notepadplus/6.5.5/npp.6.5.5.Installer.exe CDPath = none [Section.0407] @@ -19,7 +19,7 @@ Description = Un editor de text. [Section.040c] Description = Un éditeur de texte. -Size = 7,25 Mo +Size = 7,3 Mo [Section.0410] Description = Un editor di testo. @@ -32,7 +32,7 @@ Description = Edytor tekstu. [Section.0418] Description = Un editor de text. -Size = 7,25 Mo +Size = 7,3 Mo [Section.0419] Description = Текстовый редактор. @@ -42,7 +42,7 @@ Description = Textový editor. [Section.041f] Description = Bir metin düzenleyicisi. -Size = 7,25 MB +Size = 7,3 MB [Section.0422] Description = Текстовый редактор. diff --git a/reactos/base/applications/rapps/rapps/openttd.txt b/reactos/base/applications/rapps/rapps/openttd.txt index 7f4b0358d6c..cca8069cf2a 100644 --- a/reactos/base/applications/rapps/rapps/openttd.txt +++ b/reactos/base/applications/rapps/rapps/openttd.txt @@ -2,13 +2,13 @@ [Section] Name = OpenTTD -Version = 1.3.3 +Version = 1.4.0 Licence = GPL v2 Description = Open Source clone of the "Transport Tycoon Deluxe" game engine. You need a copy of Transport Tycoon. -Size = 6.75 MB +Size = 7.0 MB Category = 4 URLSite = http://www.openttd.org/ -URLDownload = http://binaries.openttd.org/releases/1.3.3/openttd-1.3.3-windows-win32.exe +URLDownload = http://binaries.openttd.org/releases/1.4.0/openttd-1.4.0-windows-win32.exe CDPath = none [Section.0407] @@ -19,7 +19,7 @@ Description = Clon del motor de juegos "Transport Tycoon Deluxe" de código abie [Section.040c] Description = Clone open source du moteur de jeu "Transport Tycoon Deluxe". Vous aurez besoin d'une copie de Transport Tycoon. -Size = 6,75 Mo +Size = 7,0 Mo [Section.0410] Description = Clone open source del motore di gioco di "Transport Tycoon Deluxe". Hai bisogno di una copia di Transport Tycoon. @@ -32,11 +32,11 @@ Description = Otwarty klon silnika gry "Transport Tycoon Deluxe". Do poprawnego [Section.0418] Description = Clona (open-source a) motorului de joc "Transport Tycoon Deluxe". Este necesară o copie a jocului Transport Tycoon. -Size = 6,75 Mo +Size = 7,0 Mo [Section.041f] Description = Transport Tycoon Deluxe oyun motorunun bir açık kaynak taklidi. Transport Tycoon'un bir kopyası gerekir. -Size = 6,75 MB +Size = 7,0 MB [Section.0422] Description = Відкритий клон двигуна гри "Transport Tycoon Deluxe". Вам потрібна копія гри Transport Tycoon. diff --git a/reactos/base/applications/rapps/rapps/python.txt b/reactos/base/applications/rapps/rapps/python.txt index 69d5e276f64..16418b4813b 100644 --- a/reactos/base/applications/rapps/rapps/python.txt +++ b/reactos/base/applications/rapps/rapps/python.txt @@ -2,13 +2,13 @@ [Section] Name = Python 3 -Version = 3.3.3 +Version = 3.4.0 Licence = GPL/LGPL Description = A remarkably powerful dynamic programming language. -Size = 19.6 MB +Size = 23.4 MB Category = 7 URLSite = http://www.python.org/ -URLDownload = http://www.python.org/ftp/python/3.3.3/python-3.3.3.msi +URLDownload = http://www.python.org/ftp/python/3.4.0/python-3.4.0.msi CDPath = none [Section.0407] @@ -19,7 +19,7 @@ Description = Un lenguaje de programación dinámico sumamente potente. [Section.040c] Description = Un langage de programmation dynamique remarquablement puissant. -Size = 19,6 Mo +Size = 23,4 Mo [Section.0410] Description = Un Linguaggio di programmazione dinamico e potente. @@ -32,11 +32,11 @@ Description = Potęży i dynamiczny język programowania. [Section.0418] Description = Un limbaj de programare dinamic și puternic. -Size = 19,6 Mo +Size = 23,4 Mo [Section.041f] Description = İlgi çekici, güçlü ve devingen bir izlenceleme dili. -Size = 19,6 MB +Size = 23,4 MB [Section.0422] Description = Дуже потужна динамічна мова програмування. diff --git a/reactos/base/applications/rapps/rapps/qb64sdl.txt b/reactos/base/applications/rapps/rapps/qb64sdl.txt index 91ec3cd06ad..6d96cb35dc0 100644 --- a/reactos/base/applications/rapps/rapps/qb64sdl.txt +++ b/reactos/base/applications/rapps/rapps/qb64sdl.txt @@ -2,13 +2,13 @@ [Section] Name = QB64 (SDL version) -Version = 0.954 +Version = 0.980 Licence = Freeware Description = QB64 is a self-hosting BASIC compiler for Microsoft Windows, Linux and Mac OS X, designed to be compatible with Microsoft QBasic and Microsoft QuickBASIC. You need 7-Zip or a similar utility to extract it. -Size = 33.1 MB +Size = 39.0 MB Category = 7 URLSite = http://www.qb64.net/ -URLDownload = http://www.qb64.net/qb64v0954-win.7z +URLDownload = http://www.qb64.net/qb64v0980-win.7z CDPath = none [Section.0407] @@ -17,10 +17,10 @@ Description = QB64 ist ein Self-Hosting BASIC-Compiler für Microsoft Windows, L [Section.0418] Licence = Gratuită Description = QB64 este un compilator BASIC auto-compilabil pentru Windows, Linux și Mac OS X, conceput pentru a fi compatibil cu Microsoft QBasic și Microsoft QuickBASIC. Este necesar un utilitar de derarhivare de tip ZIP. -Size = 33,1 Mo +Size = 39,0 Mo [Section.041f] Name = QB64 (SDL Sürümü) Licence = Ücretsiz Description = QB64; Microsoft Windows, Linux ve Mac OS X için yapılmış, Microsoft QBasic ve Microsoft QuickBASIC ile uyumlu olarak tasarlanan, kendi kendini derleyen bir BASIC derleyicisidir. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. -Size = 33,1 MB +Size = 39,0 MB diff --git a/reactos/base/applications/rapps/rapps/scite.txt b/reactos/base/applications/rapps/rapps/scite.txt index 0b4789cbf80..52300c0fb42 100644 --- a/reactos/base/applications/rapps/rapps/scite.txt +++ b/reactos/base/applications/rapps/rapps/scite.txt @@ -2,13 +2,13 @@ [Section] Name = SciTE -Version = 3.3.7 +Version = 3.4.1 Licence = Freeware Description = SciTE is a SCIntilla based Text Editor. Originally built to demonstrate Scintilla, it has grown to be a generally useful editor with facilities for building and running programs. -Size = 722 kB +Size = 730 kB Category = 7 URLSite = http://www.scintilla.org/ -URLDownload = http://download.sourceforge.net/project/scintilla/SciTE/3.3.7/Sc337.exe +URLDownload = http://download.sourceforge.net/project/scintilla/SciTE/3.4.1/Sc341.exe CDPath = none [Section.0407] @@ -19,7 +19,7 @@ Description = Editor de texto basado en SCIntilla. Originalmente creado para dem [Section.040c] Description = SciTE est un éditeur de texte basé sur SCIntilla. Originelement réalisé pour montrer Scintilla, il a évolué pour devenir un éditeur généralement utile avec des options pour compiler et lancer des programmes. -Size = 722 ko +Size = 730 ko [Section.0410] Description = SciTE è un editor di testo basato scintilla. Originariamente costruito per dimostrare Scintilla, è cresciuto fino a essere un editor generalmente utile con strutture per la creazione e l'esecuzione di programmi. @@ -33,12 +33,12 @@ Description = SciTE to edytor tekstu bazowany na SCIntilla. Oryginalnie stworzon [Section.0418] Licence = Gratuită Description = SciTE este un editor de text bazat pe SCIntilla. Construit inițial pentru a demonstra Scintilla, a crescut ulterior într-un editor de uz general cu funcționalități de compilare și execuție a programelor. -Size = 722 ko +Size = 730 ko [Section.041f] Licence = Ücretsiz Description = SciTE, Scintilla tabanlı bir metin düzenleyicisidir. Başlangıçta, Scintilla'yı göstermek için yapılmıştır ancak umûmiyetle izlenceleri yapmak ve çalıştırmak yetenekleriyle birlikte kullanışlı bir düzenleyici olarak geliştirilmiştir. -Size = 722 KB +Size = 730 KB [Section.0422] Description = Текстовий редактор на основі SCIntilla. Був зібраний як презентація Scintilla, але виріс до редактора загального користування з засобами збирання та запуску програм. diff --git a/reactos/base/applications/rapps/rapps/seamonkey.txt b/reactos/base/applications/rapps/rapps/seamonkey.txt index 14b2a6b83d7..4355489b8e7 100644 --- a/reactos/base/applications/rapps/rapps/seamonkey.txt +++ b/reactos/base/applications/rapps/rapps/seamonkey.txt @@ -2,44 +2,44 @@ [Section] Name = Mozilla SeaMonkey -Version = 2.23 +Version = 2.25 Licence = MPL/GPL/LGPL Description = Mozilla Suite is alive. This is the one and only Browser, Mail, Chat, and Composer bundle you will ever need. Size = 23.90 MB Category = 5 URLSite = http://www.seamonkey-project.org/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.23/win32/en-US/SeaMonkey%20Setup%202.23.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/en-US/SeaMonkey%20Setup%202.25.exe CDPath = none [Section.0407] Description = Mozilla Suite lebt. Dies ist das einzige Browser-, Mail-, Chat- and Composerwerkzeug-Bundle welches Sie benötigen. Size = 23.80 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.23/win32/de/SeaMonkey%20Setup%202.23.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/de/SeaMonkey%20Setup%202.25.exe [Section.040a] Description = La suite de Mozilla está viva. Es el primero y único navegador web, gestor de correo, lector de noticias, Chat y editor HTML que necesitarás. Size = 23.79 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.23/win32/es-ES/SeaMonkey%20Setup%202.23.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/es-ES/SeaMonkey%20Setup%202.25.exe [Section.040c] Description = La suite Mozilla est en vie. Ceci est le seul et l'unique package navigateur, client mail, client chat et composer dont vous aurez besoin. Size = 24,06 Mo -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.23/win32/fr/SeaMonkey%20Setup%202.23.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/fr/SeaMonkey%20Setup%202.25.exe [Section.0410] Description = Mozilla Suite è vivo. Questo è l'unico e solo Browser, Mail, Chat, e Composer di cui avrete mai bisogno... Size = 23.71 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.23/win32/it/SeaMonkey%20Setup%202.23.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/it/SeaMonkey%20Setup%202.25.exe [Section.0413] Description = Mozilla Suite bundelt alle applicaties voor het Web: Browser, Mail, Chat, Composer. Size = 24.40 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.23/win32/nl/SeaMonkey%20Setup%202.23.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/nl/SeaMonkey%20Setup%202.25.exe [Section.0415] Description = Pakiet Mozilla żyje. W zestawie: przeglądarka, klient poczty, IRC oraz Edytor HTML - wszystko, czego potrzebujesz. Size = 24.72 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.23/win32/pl/SeaMonkey%20Setup%202.23.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/pl/SeaMonkey%20Setup%202.25.exe [Section.0418] Description = Suita Mozilla. Acest pachet ce încorporează navigator, poștă electronică, client IRC și editor HTML, acoperind astfel o arie largă de necesități. @@ -48,14 +48,14 @@ Size = 23,90 Mo [Section.0419] Description = Продолжение Mozilla Suite. Включает браузер, почтовый клиент, IRC-клиент и HTML-редактор. Size = 24.27 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.23/win32/ru/SeaMonkey%20Setup%202.23.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/ru/SeaMonkey%20Setup%202.25.exe [Section.041f] Description = Bu; yalnızca Tarayıcı, Mail, Söyleşi ve Yazar'dan oluşan, hiç gereksinim duymayacağınız bir bohçadır. Size = 23,83 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.23/win32/tr/SeaMonkey%20Setup%202.23.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/tr/SeaMonkey%20Setup%202.25.exe [Section.0422] Description = Продовження Mozilla Suite. Включає в себе браузер, поштовий клієнт, IRC-клієнт та HTML-редактор. Size = 24.27 MB -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.23/win32/ru/SeaMonkey%20Setup%202.23.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/2.25/win32/ru/SeaMonkey%20Setup%202.25.exe diff --git a/reactos/base/applications/rapps/rapps/smplayer.txt b/reactos/base/applications/rapps/rapps/smplayer.txt index 8d8b423e675..b203cb6dad1 100644 --- a/reactos/base/applications/rapps/rapps/smplayer.txt +++ b/reactos/base/applications/rapps/rapps/smplayer.txt @@ -2,13 +2,13 @@ [Section] Name = SMPlayer -Version = 0.8.6 +Version = 14.3.0 Licence = GPL Description = Graphical Frontend for MPlayer. -Size = 16.98 MB +Size = 20.7 MB Category = 2 URLSite = http://smplayer.sourceforge.net/en/info -URLDownload = http://download.sourceforge.net/project/smplayer/SMPlayer/0.8.6/smplayer-0.8.6-win32.exe +URLDownload = http://download.sourceforge.net/project/smplayer/SMPlayer/14.3.0/smplayer-14.3.0-oc2-win32.exe CDPath = none [Section.0407] @@ -20,7 +20,7 @@ Description = Interfaz gráfico para Mplayer (reproductor multimedia). URLSite = http://smplayer.sourceforge.net/es/info [Section.040c] -Size = 16,98 Mo +Size = 20,7 Mo URLSite = http://smplayer.sourceforge.net/fr/info [Section.0410] @@ -35,11 +35,11 @@ URLSite = http://smplayer.sourceforge.net/pl/info [Section.0418] Description = Lector multimedia (interfață pentru MPlayer). -Size = 16,98 Mo +Size = 20,7 Mo [Section.041f] Description = MPlayer için çizgelik önyüz. -Size = 16,98 MB +Size = 20,7 MB URLSite = http://smplayer.sourceforge.net/tr/info [Section.0422] diff --git a/reactos/base/applications/rapps/rapps/thunderbird.txt b/reactos/base/applications/rapps/rapps/thunderbird.txt index 5c8dd295d07..a25ed479ffb 100644 --- a/reactos/base/applications/rapps/rapps/thunderbird.txt +++ b/reactos/base/applications/rapps/rapps/thunderbird.txt @@ -2,71 +2,71 @@ [Section] Name = Mozilla Thunderbird 24 -Version = 24.2.0 +Version = 24.4.0 Licence = MPL/GPL/LGPL Description = The most popular and one of the best free Mail Clients out there. Size = 21.12 MB Category = 5 URLSite = https://www.mozilla.org/en-US/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/en-US/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/en-US/Thunderbird%20Setup%2024.4.0.exe CDPath = none [Section.0407] Description = Der populärste und einer der besten freien Mail-Clients. Size = 20.96 MB URLSite = https://www.mozilla.org/de/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/de/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/de/Thunderbird%20Setup%2024.4.0.exe [Section.040a] Description = El más popular y uno de los mejores clientes mail que hay. Size = 20.92 MB URLSite = https://www.mozilla.org/es-ES/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/es-ES/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/es-ES/Thunderbird%20Setup%2024.4.0.exe [Section.040c] Description = Le plus populaire et l'un des meilleurs clients mail gratuits disponible. Size = 21,27 Mo URLSite = https://www.mozilla.org/fr/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/fr/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/fr/Thunderbird%20Setup%2024.4.0.exe [Section.0410] Description = Il più popolare e il migliore Clients mail gratuito. Size = 20.91 MB URLSite = https://www.mozilla.org/it/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/it/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/it/Thunderbird%20Setup%2024.4.0.exe [Section.0413] Description = De meest populaire en een van de beste gratis e-mail-programma's. Size = 21.61 MB URLSite = https://www.mozilla.org/nl/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/nl/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/nl/Thunderbird%20Setup%2024.4.0.exe [Section.0415] Description = Najpopularniejszy i jeden z najlepszych darmowych klientów poczty. Size = 21.80 MB URLSite = https://www.mozilla.org/pl/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/pl/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/pl/Thunderbird%20Setup%2024.4.0.exe [Section.0418] Description = Cel mai popular și unul dintre cele mai bune clientele gratuite de poștă electronică. Size = 21,48 Mo URLSite = https://www.mozilla.org/ro/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/ro/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/ro/Thunderbird%20Setup%2024.4.0.exe [Section.0419] Description = Один из самых популярных и лучших бесплатных почтовых клиентов. Size = 21.38 MB URLSite = https://www.mozilla.org/ru/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/ru/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/ru/Thunderbird%20Setup%2024.4.0.exe [Section.041f] Description = Özgür mail istemcileri arasında en tutulanı ve en iyisi. Size = 20,99 MB URLSite = https://www.mozilla.org/tr/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/tr/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/tr/Thunderbird%20Setup%2024.4.0.exe [Section.0422] Description = Найпопулярніший та один з кращих поштових клієнтів. Size = 21.41 MB URLSite = https://www.mozilla.org/uk/thunderbird/ -URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.2.0/win32/uk/Thunderbird%20Setup%2024.2.0.exe +URLDownload = http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/24.4.0/win32/uk/Thunderbird%20Setup%2024.4.0.exe diff --git a/reactos/base/applications/rapps/rapps/totalcommander.txt b/reactos/base/applications/rapps/rapps/totalcommander.txt index 9623432847f..0503119ca76 100644 --- a/reactos/base/applications/rapps/rapps/totalcommander.txt +++ b/reactos/base/applications/rapps/rapps/totalcommander.txt @@ -2,13 +2,13 @@ [Section] Name = Total Commander -Version = 8.01 +Version = 8.50 Licence = Shareware Description = Total Commander is a file manager with two panels side by side. -Size = 3.3 MB +Size = 3.5 MB Category = 12 URLSite = http://www.ghisler.com/ -URLDownload = http://www.slo.ru/download/total_commander/tcm801x32.exe +URLDownload = http://www.slo.ru/download/total_commander/tcm850x32.exe CDPath = none [Section.0407] @@ -26,12 +26,12 @@ Description = Total Commander to popularny menedżer plików z dwoma panelami, u [Section.0418] Licence = Versiune de evaluare Description = Total Commander este un gestionar de fișiere după modelul «două paneluri alăturate». -Size = 3,3 Mo +Size = 3,5 Mo [Section.041f] Licence = Kısıtlı Description = Total Commander, yan yana iki bölmenin bulunduğu bir kütük yöneticisidir. -Size = 3,3 MB +Size = 3,5 MB [Section.0813] Description = Total Commander is een bestandsbeheerder met twee panelen zij aan zij. diff --git a/reactos/base/applications/rapps/rapps/utorrent.txt b/reactos/base/applications/rapps/rapps/utorrent.txt index 8d179d9f8d8..3a3cb8baf2c 100644 --- a/reactos/base/applications/rapps/rapps/utorrent.txt +++ b/reactos/base/applications/rapps/rapps/utorrent.txt @@ -2,10 +2,10 @@ [Section] Name = µTorrent -Version = 3.3.2 +Version = 3.4.1 Licence = Freeware for non-commercial uses Description = Small and fast BitTorrent Client. -Size = 1020.58 kB +Size = 1.6 MB Category = 5 URLSite = http://www.utorrent.com/ URLDownload = http://download-new.utorrent.com/endpoint/utorrent/os/windows/track/stable/utorrent.exe @@ -22,7 +22,7 @@ Description = Pequeño y rápido cliente BitTorrent. [Section.040c] Licence = Gratuit pour une utilisation non-commerciale Description = Client BitTorrent petit et rapide. -Size = 1020,58 ko +Size = 1,6 Mo [Section.040c] Licence = Gratita per un uso non-commerciale @@ -43,7 +43,7 @@ Description = Mały i szybki klient BitTorrent. [Section.0418] Licence = Gratuită pentru uz necomercial Description = Client BitTorrent, mic și rapid. -Size = 1020,58 ko +Size = 1,6 Mo [Section.0419] Licence = Бесплатная для некоммерческого использования @@ -52,7 +52,7 @@ Description = Маленький и быстрый клиент BitTorrent. [Section.041f] Licence = Ticârî olmayan kullanımlarda ücretsiz. Description = Küçük ve hızlı bir BitTorrent istemcisi. -Size = 1020,58 KB +Size = 1,6 MB [Section.0422] Licence = Безплатна для некомерційного використання diff --git a/reactos/base/applications/rapps/rapps/vlc.txt b/reactos/base/applications/rapps/rapps/vlc.txt index cf1f9023d80..6faef05b095 100644 --- a/reactos/base/applications/rapps/rapps/vlc.txt +++ b/reactos/base/applications/rapps/rapps/vlc.txt @@ -2,13 +2,13 @@ [Section] Name = VLC media player -Version = 2.1.2 +Version = 2.1.3 Licence = GPL Description = A media player. -Size = 23.0 MB +Size = 23.5 MB Category = 2 URLSite = http://www.videolan.org/vlc/ -URLDownload = http://mirror.de.leaseweb.net/videolan/vlc/2.1.2/win32/vlc-2.1.2-win32.exe +URLDownload = http://mirror.de.leaseweb.net/videolan/vlc/2.1.3/win32/vlc-2.1.3-win32.exe CDPath = none [Section.0407] @@ -19,7 +19,7 @@ Description = Reproductor multimedia. [Section.040c] Description = Un lecteur media. -Size = 23,0 Mo +Size = 23,5 Mo [Section.0410] Description = Lettore multimediale. @@ -32,7 +32,7 @@ Description = Odtwarzacz multimediów. [Section.0418] Description = Lector multimedia. -Size = 23,0 Mo +Size = 23,5 Mo [Section.0419] Description = Мультимедийный проигрыватель. @@ -43,7 +43,7 @@ Description = Multimediálny prehrávač. [Section.041f] Name = VLC Ortam Oynatıcısı Description = Bir ortam oynatıcısı. -Size = 23,0 MB +Size = 23,5 MB [Section.0422] Description = Мультимедійний програвач. From c67395ad8d4703c9db5ef74eb1758cb42ceb2978 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 10:40:15 +0000 Subject: [PATCH 368/419] [PSDK] * Add some missing definitions. svn path=/trunk/; revision=62796 --- reactos/include/psdk/vfwmsgs.h | 297 +++++++++++++++++---------------- 1 file changed, 154 insertions(+), 143 deletions(-) diff --git a/reactos/include/psdk/vfwmsgs.h b/reactos/include/psdk/vfwmsgs.h index 16b25c30033..b7b0fae273c 100644 --- a/reactos/include/psdk/vfwmsgs.h +++ b/reactos/include/psdk/vfwmsgs.h @@ -16,151 +16,162 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define VFW_S_NO_MORE_ITEMS ((HRESULT)0x00040103) -#define VFW_S_DUPLICATE_NAME ((HRESULT)0x0004022D) -#define VFW_S_STATE_INTERMEDIATE ((HRESULT)0x00040237) -#define VFW_S_PARTIAL_RENDER ((HRESULT)0x00040242) -#define VFW_S_SOME_DATA_IGNORED ((HRESULT)0x00040245) -#define VFW_S_CONNECTIONS_DEFERRED ((HRESULT)0x00040246) -#define VFW_S_RESOURCE_NOT_NEEDED ((HRESULT)0x00040250) -#define VFW_S_MEDIA_TYPE_IGNORED ((HRESULT)0x00040254) -#define VFW_S_VIDEO_NOT_RENDERED ((HRESULT)0x00040257) -#define VFW_S_AUDIO_NOT_RENDERED ((HRESULT)0x00040258) -#define VFW_S_RPZA ((HRESULT)0x0004025A) -#define VFW_S_ESTIMATED ((HRESULT)0x00040260) -#define VFW_S_RESERVED ((HRESULT)0x00040263) -#define VFW_S_STREAM_OFF ((HRESULT)0x00040267) -#define VFW_S_CANT_CUE ((HRESULT)0x00040268) -#define VFW_S_NO_STOP_TIME ((HRESULT)0x00040270) -#define VFW_S_NOPREVIEWPIN ((HRESULT)0x0004027E) -#define VFW_S_DVD_NON_ONE_SEQUENTIAL ((HRESULT)0x00040280) -#define VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE ((HRESULT)0x0004028C) -#define VFW_S_DVD_NOT_ACCURATE ((HRESULT)0x0004028D) -#define VFW_E_INVALIDMEDIATYPE ((HRESULT)0x80040200) -#define VFW_E_INVALIDSUBTYPE ((HRESULT)0x80040201) -#define VFW_E_NEED_OWNER ((HRESULT)0x80040202) -#define VFW_E_ENUM_OUT_OF_SYNC ((HRESULT)0x80040203) -#define VFW_E_ALREADY_CONNECTED ((HRESULT)0x80040204) -#define VFW_E_FILTER_ACTIVE ((HRESULT)0x80040205) -#define VFW_E_NO_TYPES ((HRESULT)0x80040206) -#define VFW_E_NO_ACCEPTABLE_TYPES ((HRESULT)0x80040207) -#define VFW_E_INVALID_DIRECTION ((HRESULT)0x80040208) -#define VFW_E_NOT_CONNECTED ((HRESULT)0x80040209) -#define VFW_E_NO_ALLOCATOR ((HRESULT)0x8004020A) -#define VFW_E_RUNTIME_ERROR ((HRESULT)0x8004020B) -#define VFW_E_BUFFER_NOTSET ((HRESULT)0x8004020C) -#define VFW_E_BUFFER_OVERFLOW ((HRESULT)0x8004020D) -#define VFW_E_BADALIGN ((HRESULT)0x8004020E) -#define VFW_E_ALREADY_COMMITTED ((HRESULT)0x8004020F) -#define VFW_E_BUFFERS_OUTSTANDING ((HRESULT)0x80040210) -#define VFW_E_NOT_COMMITTED ((HRESULT)0x80040211) -#define VFW_E_SIZENOTSET ((HRESULT)0x80040212) -#define VFW_E_NO_CLOCK ((HRESULT)0x80040213) -#define VFW_E_NO_SINK ((HRESULT)0x80040214) -#define VFW_E_NO_INTERFACE ((HRESULT)0x80040215) -#define VFW_E_NOT_FOUND ((HRESULT)0x80040216) -#define VFW_E_CANNOT_CONNECT ((HRESULT)0x80040217) -#define VFW_E_CANNOT_RENDER ((HRESULT)0x80040218) -#define VFW_E_CHANGING_FORMAT ((HRESULT)0x80040219) -#define VFW_E_NO_COLOR_KEY_SET ((HRESULT)0x8004021A) -#define VFW_E_NOT_OVERLAY_CONNECTION ((HRESULT)0x8004021B) -#define VFW_E_NOT_SAMPLE_CONNECTION ((HRESULT)0x8004021C) -#define VFW_E_PALETTE_SET ((HRESULT)0x8004021D) -#define VFW_E_COLOR_KEY_SET ((HRESULT)0x8004021E) -#define VFW_E_NO_COLOR_KEY_FOUND ((HRESULT)0x8004021F) -#define VFW_E_NO_PALETTE_AVAILABLE ((HRESULT)0x80040220) -#define VFW_E_NO_DISPLAY_PALETTE ((HRESULT)0x80040221) -#define VFW_E_TOO_MANY_COLORS ((HRESULT)0x80040222) -#define VFW_E_STATE_CHANGED ((HRESULT)0x80040223) -#define VFW_E_NOT_STOPPED ((HRESULT)0x80040224) -#define VFW_E_NOT_PAUSED ((HRESULT)0x80040225) -#define VFW_E_NOT_RUNNING ((HRESULT)0x80040226) -#define VFW_E_WRONG_STATE ((HRESULT)0x80040227) -#define VFW_E_START_TIME_AFTER_END ((HRESULT)0x80040228) -#define VFW_E_INVALID_RECT ((HRESULT)0x80040229) -#define VFW_E_TYPE_NOT_ACCEPTED ((HRESULT)0x8004022A) -#define VFW_E_SAMPLE_REJECTED ((HRESULT)0x8004022B) -#define VFW_E_SAMPLE_REJECTED_EOS ((HRESULT)0x8004022C) -#define VFW_E_DUPLICATE_NAME ((HRESULT)0x8004022D) -#define VFW_E_TIMEOUT ((HRESULT)0x8004022E) -#define VFW_E_INVALID_FILE_FORMAT ((HRESULT)0x8004022F) -#define VFW_E_ENUM_OUT_OF_RANGE ((HRESULT)0x80040230) -#define VFW_E_CIRCULAR_GRAPH ((HRESULT)0x80040231) -#define VFW_E_NOT_ALLOWED_TO_SAVE ((HRESULT)0x80040232) -#define VFW_E_TIME_ALREADY_PASSED ((HRESULT)0x80040233) -#define VFW_E_ALREADY_CANCELLED ((HRESULT)0x80040234) -#define VFW_E_CORRUPT_GRAPH_FILE ((HRESULT)0x80040235) -#define VFW_E_ADVISE_ALREADY_SET ((HRESULT)0x80040236) -#define VFW_E_NO_MODEX_AVAILABLE ((HRESULT)0x80040238) -#define VFW_E_NO_ADVISE_SET ((HRESULT)0x80040239) -#define VFW_E_NO_FULLSCREEN ((HRESULT)0x8004023A) -#define VFW_E_IN_FULLSCREEN_MODE ((HRESULT)0x8004023B) -#define VFW_E_UNKNOWN_FILE_TYPE ((HRESULT)0x80040240) -#define VFW_E_CANNOT_LOAD_SOURCE_FILTER ((HRESULT)0x80040241) -#define VFW_E_FILE_TOO_SHORT ((HRESULT)0x80040243) -#define VFW_E_INVALID_FILE_VERSION ((HRESULT)0x80040244) -#define VFW_E_INVALID_CLSID ((HRESULT)0x80040247) -#define VFW_E_INVALID_MEDIA_TYPE ((HRESULT)0x80040248) -#define VFW_E_SAMPLE_TIME_NOT_SET ((HRESULT)0x80040249) -#define VFW_E_MEDIA_TIME_NOT_SET ((HRESULT)0x80040251) -#define VFW_E_NO_TIME_FORMAT_SET ((HRESULT)0x80040252) -#define VFW_E_MONO_AUDIO_HW ((HRESULT)0x80040253) -#define VFW_E_NO_DECOMPRESSOR ((HRESULT)0x80040255) -#define VFW_E_NO_AUDIO_HARDWARE ((HRESULT)0x80040256) -#define VFW_E_RPZA ((HRESULT)0x80040259) -#define VFW_E_PROCESSOR_NOT_SUITABLE ((HRESULT)0x8004025B) -#define VFW_E_UNSUPPORTED_AUDIO ((HRESULT)0x8004025C) -#define VFW_E_UNSUPPORTED_VIDEO ((HRESULT)0x8004025D) -#define VFW_E_MPEG_NOT_CONSTRAINED ((HRESULT)0x8004025E) -#define VFW_E_NOT_IN_GRAPH ((HRESULT)0x8004025F) -#define VFW_E_NO_TIME_FORMAT ((HRESULT)0x80040261) -#define VFW_E_READ_ONLY ((HRESULT)0x80040262) -#define VFW_E_BUFFER_UNDERFLOW ((HRESULT)0x80040264) -#define VFW_E_UNSUPPORTED_STREAM ((HRESULT)0x80040265) -#define VFW_E_NO_TRANSPORT ((HRESULT)0x80040266) -#define VFW_E_BAD_VIDEOCD ((HRESULT)0x80040269) -#define VFW_E_OUT_OF_VIDEO_MEMORY ((HRESULT)0x80040271) -#define VFW_E_VP_NEGOTIATION_FAILED ((HRESULT)0x80040272) -#define VFW_E_DDRAW_CAPS_NOT_SUITABLE ((HRESULT)0x80040273) -#define VFW_E_NO_VP_HARDWARE ((HRESULT)0x80040274) -#define VFW_E_NO_CAPTURE_HARDWARE ((HRESULT)0x80040275) -#define VFW_E_DVD_OPERATION_INHIBITED ((HRESULT)0x80040276) -#define VFW_E_DVD_INVALIDDOMAIN ((HRESULT)0x80040277) -#define VFW_E_DVD_NO_BUTTON ((HRESULT)0x80040278) -#define VFW_E_DVD_GRAPHNOTREADY ((HRESULT)0x80040279) -#define VFW_E_DVD_RENDERFAIL ((HRESULT)0x8004027A) -#define VFW_E_DVD_DECNOTENOUGH ((HRESULT)0x8004027B) -#define VFW_E_DDRAW_VERSION_NOT_SUITABLE ((HRESULT)0x8004027C) -#define VFW_E_COPYPROT_FAILED ((HRESULT)0x8004027D) -#define VFW_E_TIME_EXPIRED ((HRESULT)0x8004027F) -#define VFW_E_DVD_WRONG_SPEED ((HRESULT)0x80040281) -#define VFW_E_DVD_MENU_DOES_NOT_EXIST ((HRESULT)0x80040282) -#define VFW_E_DVD_CMD_CANCELLED ((HRESULT)0x80040283) -#define VFW_E_DVD_STATE_WRONG_VERSION ((HRESULT)0x80040284) -#define VFW_E_DVD_STATE_CORRUPT ((HRESULT)0x80040285) -#define VFW_E_DVD_STATE_WRONG_DISC ((HRESULT)0x80040286) -#define VFW_E_DVD_INCOMPATIBLE_REGION ((HRESULT)0x80040287) -#define VFW_E_DVD_NO_ATTRIBUTES ((HRESULT)0x80040288) -#define VFW_E_DVD_NO_GOUP_PGC ((HRESULT)0x80040289) -#define VFW_E_DVD_LOW_PARENTAL_LEVEL ((HRESULT)0x8004028A) -#define VFW_E_DVD_NOT_IN_KARAOKE_MODE ((HRESULT)0x8004028B) -#define VFW_E_FRAME_STEP_UNSUPPORTED ((HRESULT)0x8004028E) -#define VFW_E_DVD_STREAM_DISABLED ((HRESULT)0x8004028F) -#define VFW_E_DVD_TITLE_UNKNOWN ((HRESULT)0x80040290) -#define VFW_E_DVD_INVALID_DISC ((HRESULT)0x80040291) -#define VFW_E_DVD_NO_RESUME_INFORMATION ((HRESULT)0x80040292) -#define VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD ((HRESULT)0x80040293) -#define VFW_E_PIN_ALREADY_BLOCKED ((HRESULT)0x80040294) -#define VFW_E_CERTIFICATION_FAILURE ((HRESULT)0x80040295) -#define VFW_E_VMR_NOT_IN_MIXER_MODE ((HRESULT)0x80040296) -#define VFW_E_VMR_NO_AP_SUPPLIED ((HRESULT)0x80040297) -#define VFW_E_VMR_NO_DEINTERLACE_HW ((HRESULT)0x80040298) -#define VFW_E_DVD_VMR9_INCOMPATIBLEDEC ((HRESULT)0x8004029A) -#define VFW_E_BAD_KEY ((HRESULT)0x800403F2) +#define VFW_S_NO_MORE_ITEMS ((HRESULT)0x00040103) +#define VFW_S_DUPLICATE_NAME ((HRESULT)0x0004022D) +#define VFW_S_STATE_INTERMEDIATE ((HRESULT)0x00040237) +#define VFW_S_PARTIAL_RENDER ((HRESULT)0x00040242) +#define VFW_S_SOME_DATA_IGNORED ((HRESULT)0x00040245) +#define VFW_S_CONNECTIONS_DEFERRED ((HRESULT)0x00040246) +#define VFW_S_RESOURCE_NOT_NEEDED ((HRESULT)0x00040250) +#define VFW_S_MEDIA_TYPE_IGNORED ((HRESULT)0x00040254) +#define VFW_S_VIDEO_NOT_RENDERED ((HRESULT)0x00040257) +#define VFW_S_AUDIO_NOT_RENDERED ((HRESULT)0x00040258) +#define VFW_S_RPZA ((HRESULT)0x0004025A) +#define VFW_S_ESTIMATED ((HRESULT)0x00040260) +#define VFW_S_RESERVED ((HRESULT)0x00040263) +#define VFW_S_STREAM_OFF ((HRESULT)0x00040267) +#define VFW_S_CANT_CUE ((HRESULT)0x00040268) +#define VFW_S_NO_STOP_TIME ((HRESULT)0x00040270) +#define VFW_S_NOPREVIEWPIN ((HRESULT)0x0004027E) +#define VFW_S_DVD_NON_ONE_SEQUENTIAL ((HRESULT)0x00040280) +#define VFW_S_DVD_CHANNEL_CONTENTS_NOT_AVAILABLE ((HRESULT)0x0004028C) +#define VFW_S_DVD_NOT_ACCURATE ((HRESULT)0x0004028D) +#define VFW_E_INVALIDMEDIATYPE ((HRESULT)0x80040200) +#define VFW_E_INVALIDSUBTYPE ((HRESULT)0x80040201) +#define VFW_E_NEED_OWNER ((HRESULT)0x80040202) +#define VFW_E_ENUM_OUT_OF_SYNC ((HRESULT)0x80040203) +#define VFW_E_ALREADY_CONNECTED ((HRESULT)0x80040204) +#define VFW_E_FILTER_ACTIVE ((HRESULT)0x80040205) +#define VFW_E_NO_TYPES ((HRESULT)0x80040206) +#define VFW_E_NO_ACCEPTABLE_TYPES ((HRESULT)0x80040207) +#define VFW_E_INVALID_DIRECTION ((HRESULT)0x80040208) +#define VFW_E_NOT_CONNECTED ((HRESULT)0x80040209) +#define VFW_E_NO_ALLOCATOR ((HRESULT)0x8004020A) +#define VFW_E_RUNTIME_ERROR ((HRESULT)0x8004020B) +#define VFW_E_BUFFER_NOTSET ((HRESULT)0x8004020C) +#define VFW_E_BUFFER_OVERFLOW ((HRESULT)0x8004020D) +#define VFW_E_BADALIGN ((HRESULT)0x8004020E) +#define VFW_E_ALREADY_COMMITTED ((HRESULT)0x8004020F) +#define VFW_E_BUFFERS_OUTSTANDING ((HRESULT)0x80040210) +#define VFW_E_NOT_COMMITTED ((HRESULT)0x80040211) +#define VFW_E_SIZENOTSET ((HRESULT)0x80040212) +#define VFW_E_NO_CLOCK ((HRESULT)0x80040213) +#define VFW_E_NO_SINK ((HRESULT)0x80040214) +#define VFW_E_NO_INTERFACE ((HRESULT)0x80040215) +#define VFW_E_NOT_FOUND ((HRESULT)0x80040216) +#define VFW_E_CANNOT_CONNECT ((HRESULT)0x80040217) +#define VFW_E_CANNOT_RENDER ((HRESULT)0x80040218) +#define VFW_E_CHANGING_FORMAT ((HRESULT)0x80040219) +#define VFW_E_NO_COLOR_KEY_SET ((HRESULT)0x8004021A) +#define VFW_E_NOT_OVERLAY_CONNECTION ((HRESULT)0x8004021B) +#define VFW_E_NOT_SAMPLE_CONNECTION ((HRESULT)0x8004021C) +#define VFW_E_PALETTE_SET ((HRESULT)0x8004021D) +#define VFW_E_COLOR_KEY_SET ((HRESULT)0x8004021E) +#define VFW_E_NO_COLOR_KEY_FOUND ((HRESULT)0x8004021F) +#define VFW_E_NO_PALETTE_AVAILABLE ((HRESULT)0x80040220) +#define VFW_E_NO_DISPLAY_PALETTE ((HRESULT)0x80040221) +#define VFW_E_TOO_MANY_COLORS ((HRESULT)0x80040222) +#define VFW_E_STATE_CHANGED ((HRESULT)0x80040223) +#define VFW_E_NOT_STOPPED ((HRESULT)0x80040224) +#define VFW_E_NOT_PAUSED ((HRESULT)0x80040225) +#define VFW_E_NOT_RUNNING ((HRESULT)0x80040226) +#define VFW_E_WRONG_STATE ((HRESULT)0x80040227) +#define VFW_E_START_TIME_AFTER_END ((HRESULT)0x80040228) +#define VFW_E_INVALID_RECT ((HRESULT)0x80040229) +#define VFW_E_TYPE_NOT_ACCEPTED ((HRESULT)0x8004022A) +#define VFW_E_SAMPLE_REJECTED ((HRESULT)0x8004022B) +#define VFW_E_SAMPLE_REJECTED_EOS ((HRESULT)0x8004022C) +#define VFW_E_DUPLICATE_NAME ((HRESULT)0x8004022D) +#define VFW_E_TIMEOUT ((HRESULT)0x8004022E) +#define VFW_E_INVALID_FILE_FORMAT ((HRESULT)0x8004022F) +#define VFW_E_ENUM_OUT_OF_RANGE ((HRESULT)0x80040230) +#define VFW_E_CIRCULAR_GRAPH ((HRESULT)0x80040231) +#define VFW_E_NOT_ALLOWED_TO_SAVE ((HRESULT)0x80040232) +#define VFW_E_TIME_ALREADY_PASSED ((HRESULT)0x80040233) +#define VFW_E_ALREADY_CANCELLED ((HRESULT)0x80040234) +#define VFW_E_CORRUPT_GRAPH_FILE ((HRESULT)0x80040235) +#define VFW_E_ADVISE_ALREADY_SET ((HRESULT)0x80040236) +#define VFW_E_NO_MODEX_AVAILABLE ((HRESULT)0x80040238) +#define VFW_E_NO_ADVISE_SET ((HRESULT)0x80040239) +#define VFW_E_NO_FULLSCREEN ((HRESULT)0x8004023A) +#define VFW_E_IN_FULLSCREEN_MODE ((HRESULT)0x8004023B) +#define VFW_E_UNKNOWN_FILE_TYPE ((HRESULT)0x80040240) +#define VFW_E_CANNOT_LOAD_SOURCE_FILTER ((HRESULT)0x80040241) +#define VFW_E_FILE_TOO_SHORT ((HRESULT)0x80040243) +#define VFW_E_INVALID_FILE_VERSION ((HRESULT)0x80040244) +#define VFW_E_INVALID_CLSID ((HRESULT)0x80040247) +#define VFW_E_INVALID_MEDIA_TYPE ((HRESULT)0x80040248) +#define VFW_E_SAMPLE_TIME_NOT_SET ((HRESULT)0x80040249) +#define VFW_E_MEDIA_TIME_NOT_SET ((HRESULT)0x80040251) +#define VFW_E_NO_TIME_FORMAT_SET ((HRESULT)0x80040252) +#define VFW_E_MONO_AUDIO_HW ((HRESULT)0x80040253) +#define VFW_E_NO_DECOMPRESSOR ((HRESULT)0x80040255) +#define VFW_E_NO_AUDIO_HARDWARE ((HRESULT)0x80040256) +#define VFW_E_RPZA ((HRESULT)0x80040259) +#define VFW_E_PROCESSOR_NOT_SUITABLE ((HRESULT)0x8004025B) +#define VFW_E_UNSUPPORTED_AUDIO ((HRESULT)0x8004025C) +#define VFW_E_UNSUPPORTED_VIDEO ((HRESULT)0x8004025D) +#define VFW_E_MPEG_NOT_CONSTRAINED ((HRESULT)0x8004025E) +#define VFW_E_NOT_IN_GRAPH ((HRESULT)0x8004025F) +#define VFW_E_NO_TIME_FORMAT ((HRESULT)0x80040261) +#define VFW_E_READ_ONLY ((HRESULT)0x80040262) +#define VFW_E_BUFFER_UNDERFLOW ((HRESULT)0x80040264) +#define VFW_E_UNSUPPORTED_STREAM ((HRESULT)0x80040265) +#define VFW_E_NO_TRANSPORT ((HRESULT)0x80040266) +#define VFW_E_BAD_VIDEOCD ((HRESULT)0x80040269) +#define VFW_E_OUT_OF_VIDEO_MEMORY ((HRESULT)0x80040271) +#define VFW_E_VP_NEGOTIATION_FAILED ((HRESULT)0x80040272) +#define VFW_E_DDRAW_CAPS_NOT_SUITABLE ((HRESULT)0x80040273) +#define VFW_E_NO_VP_HARDWARE ((HRESULT)0x80040274) +#define VFW_E_NO_CAPTURE_HARDWARE ((HRESULT)0x80040275) +#define VFW_E_DVD_OPERATION_INHIBITED ((HRESULT)0x80040276) +#define VFW_E_DVD_INVALIDDOMAIN ((HRESULT)0x80040277) +#define VFW_E_DVD_NO_BUTTON ((HRESULT)0x80040278) +#define VFW_E_DVD_GRAPHNOTREADY ((HRESULT)0x80040279) +#define VFW_E_DVD_RENDERFAIL ((HRESULT)0x8004027A) +#define VFW_E_DVD_DECNOTENOUGH ((HRESULT)0x8004027B) +#define VFW_E_DDRAW_VERSION_NOT_SUITABLE ((HRESULT)0x8004027C) +#define VFW_E_COPYPROT_FAILED ((HRESULT)0x8004027D) +#define VFW_E_TIME_EXPIRED ((HRESULT)0x8004027F) +#define VFW_E_DVD_WRONG_SPEED ((HRESULT)0x80040281) +#define VFW_E_DVD_MENU_DOES_NOT_EXIST ((HRESULT)0x80040282) +#define VFW_E_DVD_CMD_CANCELLED ((HRESULT)0x80040283) +#define VFW_E_DVD_STATE_WRONG_VERSION ((HRESULT)0x80040284) +#define VFW_E_DVD_STATE_CORRUPT ((HRESULT)0x80040285) +#define VFW_E_DVD_STATE_WRONG_DISC ((HRESULT)0x80040286) +#define VFW_E_DVD_INCOMPATIBLE_REGION ((HRESULT)0x80040287) +#define VFW_E_DVD_NO_ATTRIBUTES ((HRESULT)0x80040288) +#define VFW_E_DVD_NO_GOUP_PGC ((HRESULT)0x80040289) +#define VFW_E_DVD_LOW_PARENTAL_LEVEL ((HRESULT)0x8004028A) +#define VFW_E_DVD_NOT_IN_KARAOKE_MODE ((HRESULT)0x8004028B) +#define VFW_E_FRAME_STEP_UNSUPPORTED ((HRESULT)0x8004028E) +#define VFW_E_DVD_STREAM_DISABLED ((HRESULT)0x8004028F) +#define VFW_E_DVD_TITLE_UNKNOWN ((HRESULT)0x80040290) +#define VFW_E_DVD_INVALID_DISC ((HRESULT)0x80040291) +#define VFW_E_DVD_NO_RESUME_INFORMATION ((HRESULT)0x80040292) +#define VFW_E_PIN_ALREADY_BLOCKED_ON_THIS_THREAD ((HRESULT)0x80040293) +#define VFW_E_PIN_ALREADY_BLOCKED ((HRESULT)0x80040294) +#define VFW_E_CERTIFICATION_FAILURE ((HRESULT)0x80040295) +#define VFW_E_VMR_NOT_IN_MIXER_MODE ((HRESULT)0x80040296) +#define VFW_E_VMR_NO_AP_SUPPLIED ((HRESULT)0x80040297) +#define VFW_E_VMR_NO_DEINTERLACE_HW ((HRESULT)0x80040298) +#define VFW_E_VMR_NO_PROCAMP_HW ((HRESULT)0x80040299) +#define VFW_E_DVD_VMR9_INCOMPATIBLEDEC ((HRESULT)0x8004029A) +#define VFW_E_NO_COPP_HW ((HRESULT)0x8004029B) +#define VFW_E_DVD_NONBLOCKING ((HRESULT)0x8004029C) +#define VFW_E_DVD_TOO_MANY_RENDERERS_IN_FILTER_GRAPH ((HRESULT)0x8004029D) +#define VFW_E_DVD_NON_EVR_RENDERER_IN_FILTER_GRAPH ((HRESULT)0x8004029E) +#define VFW_E_DVD_RESOLUTION_ERROR ((HRESULT)0x8004029F) +#define VFW_E_CODECAPI_LINEAR_RANGE ((HRESULT)0x80040310) +#define VFW_E_CODECAPI_ENUMERATED ((HRESULT)0x80040311) +#define VFW_E_CODECAPI_NO_DEFAULT ((HRESULT)0x80040313) +#define VFW_E_CODECAPI_NO_CURRENT_VALUE ((HRESULT)0x80040314) +#define VFW_E_DVD_CHAPTER_DOES_NOT_EXIST ((HRESULT)0x80040315) +#define VFW_E_BAD_KEY ((HRESULT)0x800403F2) #ifndef E_PROP_ID_UNSUPPORTED -#define E_PROP_ID_UNSUPPORTED ((HRESULT)0x80070490) +#define E_PROP_ID_UNSUPPORTED ((HRESULT)0x80070490) #endif #ifndef E_PROP_SET_UNSUPPORTED -#define E_PROP_SET_UNSUPPORTED ((HRESULT)0x80070492) +#define E_PROP_SET_UNSUPPORTED ((HRESULT)0x80070492) #endif From 99101a3534ba0b586a7653d5d0be4a4638f11f14 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 10:46:27 +0000 Subject: [PATCH 369/419] [MSGINA] * Italian translation update. By Marco Maria Emanuele Bartucci. CORE-8085 #resolve #comment Committed in r62797. Thanks! svn path=/trunk/; revision=62797 --- reactos/dll/win32/msgina/lang/it-IT.rc | 71 +++++++++++++------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/reactos/dll/win32/msgina/lang/it-IT.rc b/reactos/dll/win32/msgina/lang/it-IT.rc index eef95f8767f..fdeb2ecf79f 100644 --- a/reactos/dll/win32/msgina/lang/it-IT.rc +++ b/reactos/dll/win32/msgina/lang/it-IT.rc @@ -1,9 +1,10 @@ -/* - * PROJECT: ReactOS Console Configuration DLL - * LICENSE: GPL - See COPYING in the top level directory - * FILE: dll/win32/msgina/lang/it-IT.rc - * PURPOSE: Italian resource file - * TRANSLATOR: Paolo Devoti, devotip at tiscali.it, 2007-11-02 +/* + * PROJECT: ReactOS Console Configuration DLL + * LICENSE: GPL - See COPYING in the top level directory + * FILE: dll/win32/msgina/lang/it-IT.rc + * PURPOSE: Italian resource file + * TRANSLATORS: Paolo Devoti, devotip at tiscali.it, 2007-11-02 + Marco Maria Emanuele Bartucci, 2014-04-19 */ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL @@ -37,7 +38,7 @@ BEGIN EDITTEXT IDC_USERNAME, 60, 57, 155, 14, ES_AUTOHSCROLL LTEXT "Password:", IDC_STATIC, 6, 78, 52, 8 EDITTEXT IDC_PASSWORD, 60, 76, 155, 14, ES_AUTOHSCROLL | ES_PASSWORD - LTEXT "Log on to:", IDC_STATIC, 6, 96, 52, 8 + LTEXT "Accedi a:", IDC_STATIC, 6, 96, 52, 8 COMBOBOX IDC_LOGON_TO, 60, 95, 155, 14, CBS_DROPDOWNLIST | WS_VSCROLL PUSHBUTTON "OK", IDOK, 106, 122, 50, 14, BS_DEFPUSHBUTTON PUSHBUTTON "Annulla", IDCANCEL, 160, 122, 50, 14 @@ -57,8 +58,8 @@ BEGIN PUSHBUTTON "Bloccare il computer", IDC_LOCK, 10, 135, 70, 14 PUSHBUTTON "Fine sessione", IDC_LOGOFF, 90, 135, 70, 14 PUSHBUTTON "Spegnimento", IDC_SHUTDOWN, 170, 135, 70, 14 - PUSHBUTTON "Change Password", IDC_CHANGEPWD, 10, 154, 76, 14 - PUSHBUTTON "Task manager", IDC_TASKMGR, 90, 154, 70, 14 + PUSHBUTTON "Cambia password", IDC_CHANGEPWD, 10, 154, 76, 14 + PUSHBUTTON "Gestione attività", IDC_TASKMGR, 90, 154, 70, 14 PUSHBUTTON "Annulla", IDCANCEL, 170, 154, 70, 14 END @@ -70,7 +71,7 @@ BEGIN CONTROL IDI_ROSLOGO, IDC_ROSLOGO, "Static", SS_BITMAP, 0, 0, 275, 54 ICON IDI_LOCKICON, -1, 7, 59, 20, 20 LTEXT "Questo computer è in uso ed è stato bloccato.", IDC_STATIC, 37, 61, 231, 8 - LTEXT "Message", IDC_LOCKMSG, 37, 75, 231, 26 + LTEXT "Messaggio", IDC_LOCKMSG, 37, 75, 231, 26 LTEXT "Premere Ctrl-Alt-Canc per sbloccare questo computer.", IDC_STATIC, 37, 106, 231, 8 END @@ -93,7 +94,7 @@ END IDD_CHANGE_PASSWORD DIALOGEX 0, 0, 275, 166 STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP -CAPTION "Change Password" +CAPTION "Cambia password" FONT 8, "MS Shell Dlg", 400, 0, 1 BEGIN CONTROL IDI_ROSLOGO, IDC_ROSLOGO, "Static", SS_BITMAP, 0, 0, 275, 54 @@ -113,12 +114,12 @@ END IDD_LOGOFF_DLG DIALOGEX 0, 0, 188, 60 STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_SYSMENU | WS_POPUP -CAPTION "Log Off ReactOS" +CAPTION "Disconetti da ReactOS" FONT 8, "MS Shell Dlg", 400, 0, 1 BEGIN ICON IDI_LOCKICON, -1, 7, 7, 20, 20 - LTEXT "Are you sure you want to log off?", IDC_STATIC, 35, 16, 146, 8 - PUSHBUTTON "Yes", IDYES, 41, 39, 50, 14, BS_DEFPUSHBUTTON + LTEXT "Sei sicuro di volerti disconettere?", IDC_STATIC, 35, 16, 146, 8 + PUSHBUTTON "Si", IDYES, 41, 39, 50, 14, BS_DEFPUSHBUTTON PUSHBUTTON "No", IDNO, 95, 39, 50, 14 END @@ -145,33 +146,33 @@ BEGIN IDS_ASKFORPASSWORD "Password: " IDS_FORCELOGOFF "Verrà terminata la sessione dell'utente attuale e tutti i dati non salvati verranno persi. Volete procedere?" IDS_LOCKMSG "Solo %s o un Amministratore possono sbloccare questo computer." - IDS_LOGONMSG "You are logged on as %s." + IDS_LOGONMSG "Sei entrato come %s." IDS_LOGONDATE "Dati di accesso: %s %s" - IDS_COMPUTERLOCKED "Computer locked" - IDS_LOCKEDWRONGPASSWORD "The password is wrong. Please enter your password again. Letters in passwords must be typed using the correct case." - IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." - IDS_CHANGEPWDTITLE "Change Password" - IDS_NONMATCHINGPASSWORDS "The passwords you typed do not match. Type the same password in both text boxes." - IDS_PASSWORDCHANGED "Your password has been changed." - IDS_LOGONTITLE "Logon Message" - IDS_LOGONWRONGUSERORPWD "The system could not log you on. Make sure your User name and domain are correct, then type your password again. Letters in passwords must be typed using the correct case." - IDS_LOGONUSERDISABLED "Your account has been disabled. Please see your system administrator." - IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." - IDS_PASSWORDEXPIRED "Your password has expired and must be changed." + IDS_COMPUTERLOCKED "Computer Bloccato" + IDS_LOCKEDWRONGPASSWORD "La password è sbagliata. Per favore reinserisca la password. Le lettere nella password devono essere digitate differenziando le minuscole dalle maiuscole." + IDS_LOCKEDWRONGUSER "Il computer è bloccato. Solo %s\\%s o un amministratore può sbloccare questo computer." + IDS_CHANGEPWDTITLE "Cambia password" + IDS_NONMATCHINGPASSWORDS "Le password che hai digitato non corrispondono. Digita la stessa password in entrambe le caselle di testo." + IDS_PASSWORDCHANGED "La tua password è stata cambiata." + IDS_LOGONTITLE "Messaggio di accesso" + IDS_LOGONWRONGUSERORPWD "il sistema non ha potuto eseguire l'accesso. Si assicuri che nome utente e dominio sono corretti, allora digita nuovamente la password. Le lettere nella password devono essere digitate differenziando le minuscole dalle maiuscole." + IDS_LOGONUSERDISABLED "Il tuo account è stato disattivato. Per favore contatti l'amministratore di sistema." + IDS_PASSWORDMUSTCHANGE "Ti è chiesto di cambiare password al primo login." + IDS_PASSWORDEXPIRED "La tua password è scaduta e devi cambiarla." END /* Shutdown Dialog Strings */ STRINGTABLE BEGIN - IDS_SHUTDOWN_LOGOFF "Log off ""%s""" - IDS_SHUTDOWN_SHUTDOWN "Shut down" - IDS_SHUTDOWN_RESTART "Restart" + IDS_SHUTDOWN_LOGOFF "Disconetti ""%s""" + IDS_SHUTDOWN_SHUTDOWN "Spegni" + IDS_SHUTDOWN_RESTART "Riavvia" IDS_SHUTDOWN_SLEEP "Sleep" - IDS_SHUTDOWN_HIBERNATE "Hibernate" + IDS_SHUTDOWN_HIBERNATE "Ibernazione" /* Shut down descriptions */ - IDS_SHUTDOWN_LOGOFF_DESC "Ends your current session and allows other users to log on to the system." - IDS_SHUTDOWN_SHUTDOWN_DESC "Ends your current session and shuts down the system so you can safely shut down the power." - IDS_SHUTDOWN_RESTART_DESC "Ends your current session and reboots the system." - IDS_SHUTDOWN_SLEEP_DESC "Puts the system in sleep mode." - IDS_SHUTDOWN_HIBERNATE_DESC "Saves the current session and shuts down the computer." + IDS_SHUTDOWN_LOGOFF_DESC "Termina la sessione attuale e permette ad altri utenti di accedere al sistema." + IDS_SHUTDOWN_SHUTDOWN_DESC "Termina la sessione attuale e spegne il sistema così puoi staccare la corrente in sicurezza." + IDS_SHUTDOWN_RESTART_DESC "Termina la sessione attuale e riavvia il sistema." + IDS_SHUTDOWN_SLEEP_DESC "Mette il sistema in modalità riposo." + IDS_SHUTDOWN_HIBERNATE_DESC "Salva la sessione attuale e spegne il computer." END From 4684054570e30bf1f6bc0755bb2438501bed7138 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 10:47:47 +0000 Subject: [PATCH 370/419] * A BOM sneaked in ;) svn path=/trunk/; revision=62798 --- reactos/dll/win32/msgina/lang/it-IT.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/dll/win32/msgina/lang/it-IT.rc b/reactos/dll/win32/msgina/lang/it-IT.rc index fdeb2ecf79f..a672b590a4f 100644 --- a/reactos/dll/win32/msgina/lang/it-IT.rc +++ b/reactos/dll/win32/msgina/lang/it-IT.rc @@ -1,4 +1,4 @@ -/* +/* * PROJECT: ReactOS Console Configuration DLL * LICENSE: GPL - See COPYING in the top level directory * FILE: dll/win32/msgina/lang/it-IT.rc From ad56db3061e598045384f4b6cb3fa0f96572ae0e Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 19 Apr 2014 11:03:26 +0000 Subject: [PATCH 371/419] [CDFS] Rely on RTL when possible. Spotted by Thomas. svn path=/trunk/; revision=62799 --- reactos/drivers/filesystems/cdfs/dirctl.c | 11 ++++------- reactos/drivers/filesystems/cdfs/fcb.c | 3 +-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/reactos/drivers/filesystems/cdfs/dirctl.c b/reactos/drivers/filesystems/cdfs/dirctl.c index ed6e5c9c2fd..5677c83954a 100644 --- a/reactos/drivers/filesystems/cdfs/dirctl.c +++ b/reactos/drivers/filesystems/cdfs/dirctl.c @@ -215,15 +215,14 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt, { /* it's root : complete essentials fields then return ok */ RtlZeroMemory(Fcb, sizeof(FCB)); + RtlInitEmptyUnicodeString(&Fcb->PathName, Fcb->PathNameBuffer, sizeof(Fcb->PathNameBuffer)); Fcb->PathNameBuffer[0] = '\\'; + Fcb->PathName.Length = sizeof(WCHAR); Fcb->ObjectName = &Fcb->PathNameBuffer[1]; Fcb->Entry.ExtentLocationL = DeviceExt->CdInfo.RootStart; Fcb->Entry.DataLengthL = DeviceExt->CdInfo.RootSize; Fcb->Entry.FileFlags = 0x02; //FILE_ATTRIBUTE_DIRECTORY; - Fcb->PathName.Length = sizeof(WCHAR); - Fcb->PathName.MaximumLength = sizeof(Fcb->PathNameBuffer); - Fcb->PathName.Buffer = Fcb->PathNameBuffer; if (pDirIndex) *pDirIndex = 0; @@ -308,9 +307,8 @@ CdfsFindFile(PDEVICE_EXTENSION DeviceExt, { if (Parent->PathName.Buffer[0]) { + RtlCopyUnicodeString(&Fcb->PathName, &Parent->PathName); len = Parent->PathName.Length / sizeof(WCHAR); - memcpy(Fcb->PathName.Buffer, Parent->PathName.Buffer, Parent->PathName.Length); - Fcb->PathName.Length = Parent->PathName.Length; Fcb->ObjectName=&Fcb->PathName.Buffer[len]; if (len != 1 || Fcb->PathName.Buffer[0] != '\\') { @@ -576,8 +574,7 @@ CdfsQueryDirectory(PDEVICE_OBJECT DeviceObject, DeviceExtension = DeviceObject->DeviceExtension; Stack = IoGetCurrentIrpStackLocation(Irp); FileObject = Stack->FileObject; - TempFcb.PathName.Buffer = TempFcb.PathNameBuffer; - TempFcb.PathName.MaximumLength = sizeof(TempFcb.PathNameBuffer); + RtlInitEmptyUnicodeString(&TempFcb.PathName, TempFcb.PathNameBuffer, sizeof(TempFcb.PathNameBuffer)); Ccb = (PCCB)FileObject->FsContext2; Fcb = (PFCB)FileObject->FsContext; diff --git a/reactos/drivers/filesystems/cdfs/fcb.c b/reactos/drivers/filesystems/cdfs/fcb.c index 1bd06c181c1..ee2e9105948 100644 --- a/reactos/drivers/filesystems/cdfs/fcb.c +++ b/reactos/drivers/filesystems/cdfs/fcb.c @@ -73,8 +73,7 @@ CdfsCreateFCB(PCWSTR FileName) if(!Fcb) return NULL; RtlZeroMemory(Fcb, sizeof(FCB)); - Fcb->PathName.Buffer = Fcb->PathNameBuffer; - Fcb->PathName.MaximumLength = sizeof(Fcb->PathNameBuffer); + RtlInitEmptyUnicodeString(&Fcb->PathName, Fcb->PathNameBuffer, sizeof(Fcb->PathNameBuffer)); if (FileName) { From f5406f85f2a5fbe194f7769dd6f7dd1d21eaf5f3 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 11:19:14 +0000 Subject: [PATCH 372/419] [DXSDK] * Update axextend.idl. svn path=/trunk/; revision=62800 --- reactos/include/dxsdk/axextend.idl | 117 +++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) diff --git a/reactos/include/dxsdk/axextend.idl b/reactos/include/dxsdk/axextend.idl index 9b472019836..cd4955d38ab 100644 --- a/reactos/include/dxsdk/axextend.idl +++ b/reactos/include/dxsdk/axextend.idl @@ -22,6 +22,7 @@ interface IAMAudioInputMixer; interface IAMAudioRendererStats; interface IAMBufferNegotiation; interface IAMCameraControl; +interface IAMCertifiedOutputProtection; interface IAMCopyCaptureFileProgress; interface IAMCrossbar; interface IAMDevMemoryAllocator; @@ -746,6 +747,122 @@ interface ICaptureGraphBuilder2 : IUnknown [out] IPin **ppPin); } +[ + local, + object, + uuid(5acd6aa0-f482-11ce-8b67-00aa00a3f1a6), + pointer_default(unique) +] +interface IConfigAviMux : IUnknown +{ + HRESULT SetMasterStream( + [in] LONG iStream); + + HRESULT GetMasterStream( + [out] LONG *pStream); + + HRESULT SetOutputCompatibilityIndex( + [in] BOOL fOldIndex); + + HRESULT GetOutputCompatibilityIndex( + [out] BOOL *pfOldIndex); +} + +[ + local, + object, + uuid(bee3d220-157b-11d0-bd23-00a0c911ce86), + pointer_default(unique) +] +interface IConfigInterleaving : IUnknown +{ + typedef enum InterleavingMode { + INTERLEAVE_NONE, + INTERLEAVE_CAPTURE, + INTERLEAVE_FULL, + INTERLEAVE_NONE_BUFFERED + } InterleavingMode; + + HRESULT put_Mode( + [in] InterleavingMode mode); + + HRESULT get_Mode( + [out] InterleavingMode *pMode); + + HRESULT put_Interleaving( + [in] const REFERENCE_TIME *prtInterleave, + [in] const REFERENCE_TIME *prtPreroll); + + HRESULT get_Interleaving( + [out] REFERENCE_TIME *prtInterleave, + [out] REFERENCE_TIME *prtPreroll); +} + +[ + local, + object, + uuid(9fd52741-176d-4b36-8f51-ca8f933223be), + pointer_default(unique) +] +interface IAMClockSlave : IUnknown +{ + HRESULT SetErrorTolerance( + [in] DWORD dwTolerance); + + HRESULT GetErrorTolerance( + [out] DWORD *pdwTolerance); +} + +typedef struct _AMCOPPSignature { + BYTE Signature[256]; +} AMCOPPSignature; + +typedef struct _AMCOPPCommand { + GUID macKDI; + GUID guidCommandID; + DWORD dwSequence; + DWORD bSizeData; + BYTE CommandData[4056]; +} AMCOPPCommand, *LPAMCOPPCommand; + +typedef struct _AMCOPPStatusInput { + GUID rApp; + GUID guidStatusRequestID; + DWORD dwSequence; + DWORD cbSizeData; + BYTE StatusData[4056]; +} AMCOPPStatusInput, *LPAMCOPPStatusInput; + +typedef struct _AMCOPPStatusOutput { + GUID macKDI; + DWORD cbSizeData; + BYTE COPPStatus[4076]; +} AMCOPPStatusOutput, *LPAMCOPPStatusOutput; + +[ + local, + object, + uuid(6feded3e-0ff1-4901-a2f1-43f7012c8515), + pointer_default(unique) +] +interface IAMCertifiedOutputProtection : IUnknown +{ + HRESULT KeyExchange ( + [out] GUID* pRandom, + [out] BYTE** VarLenCertGH, + [out] DWORD* pdwLengthCertGH); + + HRESULT SessionSequenceStart( + [in] AMCOPPSignature* pSig); + + HRESULT ProtectionCommand( + [in] const AMCOPPCommand* cmd); + + HRESULT ProtectionStatus( + [in] const AMCOPPStatusInput* pStatusInput, + [out] AMCOPPStatusOutput* pStatusOutput); +}; + enum _AM_RENSDEREXFLAGS { AM_RENDEREX_RENDERTOEXISTINGRENDERERS = 0x01 From 8a5720ba419f581b43af6aa6b0b58162ebc649cb Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 19 Apr 2014 12:12:44 +0000 Subject: [PATCH 373/419] [SOLITAIRE] Solitaire: Timed games and scoring. Patch by Ricardo Hanke. Thanks a lot! CORE-8031 #resolve svn path=/trunk/; revision=62801 --- .../games/solitaire/lang/bg-BG.rc | 9 +- .../games/solitaire/lang/ca-ES.rc | 9 +- .../games/solitaire/lang/cs-CZ.rc | 9 +- .../games/solitaire/lang/de-DE.rc | 9 +- .../games/solitaire/lang/el-GR.rc | 9 +- .../games/solitaire/lang/en-US.rc | 9 +- .../games/solitaire/lang/es-ES.rc | 9 +- .../games/solitaire/lang/eu-ES.rc | 9 +- .../games/solitaire/lang/fr-FR.rc | 9 +- .../games/solitaire/lang/he-IL.rc | 9 +- .../games/solitaire/lang/hu-HU.rc | 9 +- .../games/solitaire/lang/id-ID.rc | 9 +- .../games/solitaire/lang/it-IT.rc | 9 +- .../games/solitaire/lang/ja-JP.rc | 9 +- .../games/solitaire/lang/ko-KR.rc | 9 +- .../games/solitaire/lang/lt-LT.rc | 9 +- .../games/solitaire/lang/nl-NL.rc | 9 +- .../games/solitaire/lang/no-NO.rc | 9 +- .../games/solitaire/lang/pl-PL.rc | 9 +- .../games/solitaire/lang/ro-RO.rc | 9 +- .../games/solitaire/lang/ru-RU.rc | 9 +- .../games/solitaire/lang/sk-SK.rc | 9 +- .../games/solitaire/lang/sq-AL.rc | 9 +- .../games/solitaire/lang/sv-SE.rc | 9 +- .../games/solitaire/lang/th-TH.rc | 9 +- .../games/solitaire/lang/tr-TR.rc | 9 +- .../games/solitaire/lang/uk-UA.rc | 9 +- .../games/solitaire/lang/zh-CN.rc | 9 +- .../games/solitaire/lang/zh-TW.rc | 9 +- .../applications/games/solitaire/resource.h | 6 + .../games/solitaire/solcreate.cpp | 2 + .../applications/games/solitaire/solgame.cpp | 191 +++++++++++++++++- .../games/solitaire/solitaire.cpp | 163 ++++++++++++++- .../applications/games/solitaire/solitaire.h | 25 +++ 34 files changed, 613 insertions(+), 35 deletions(-) diff --git a/reactos/base/applications/games/solitaire/lang/bg-BG.rc b/reactos/base/applications/games/solitaire/lang/bg-BG.rc index eafedfcd0e9..2714612b1e3 100644 --- a/reactos/base/applications/games/solitaire/lang/bg-BG.rc +++ b/reactos/base/applications/games/solitaire/lang/bg-BG.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Карти", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Изтегли &една", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Изтегли &три", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Показване на времето", IDC_OPT_SHOWTIME, 7 ,51 ,100 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Показване на времето", IDC_OPT_SHOWTIME, 7 ,51 ,100 ,10, WS_TABSTOP AUTOCHECKBOX "Лента &състояние", IDC_OPT_STATUSBAR, 7, 66, 100, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "Добре", IDOK, 35, 97, 50, 14 PUSHBUTTON "Отказ", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Да прекратя ли играта?" IDS_SOL_WIN "Поздравления, победихте!!" IDS_SOL_DEAL "Ново раздаване?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/ca-ES.rc b/reactos/base/applications/games/solitaire/lang/ca-ES.rc index 12dc410b5f3..3d88376835a 100644 --- a/reactos/base/applications/games/solitaire/lang/ca-ES.rc +++ b/reactos/base/applications/games/solitaire/lang/ca-ES.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Cartes", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Treu-ne &Una", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Treu-ne &Tres", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Mostra el temps", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Mostra el temps", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "&Barra d'estat", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "Acceptar", IDOK, 35, 97, 50, 14 PUSHBUTTON "Cancel·lar", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Voleu sortir del joc actual?" IDS_SOL_WIN "Felicitats, heu guanyat!!" IDS_SOL_DEAL "Deal again?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/cs-CZ.rc b/reactos/base/applications/games/solitaire/lang/cs-CZ.rc index 49f038f9ca3..64de79d9d56 100644 --- a/reactos/base/applications/games/solitaire/lang/cs-CZ.rc +++ b/reactos/base/applications/games/solitaire/lang/cs-CZ.rc @@ -16,8 +16,13 @@ BEGIN GROUPBOX "Karty", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Sejmout &jednu", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Sejmout &tři", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "Zobrazit č&as", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "Zobrazit č&as", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "Stavový řád&ek", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Storno", IDCANCEL, 101, 97, 50, 14 END @@ -52,6 +57,8 @@ BEGIN IDS_SOL_QUIT "Ukončit rozehranou hru?" IDS_SOL_WIN "Gratulujeme, zvítězili jste!!" IDS_SOL_DEAL "Rozdat znova?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/de-DE.rc b/reactos/base/applications/games/solitaire/lang/de-DE.rc index c5674745e6c..819772c2d53 100644 --- a/reactos/base/applications/games/solitaire/lang/de-DE.rc +++ b/reactos/base/applications/games/solitaire/lang/de-DE.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Karten", -1, 7, 7, 90, 40 AUTORADIOBUTTON "&Eine ziehen", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "&Drei ziehen", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Zeit anzeigen", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Punkte zählen", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "Ke&ine", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Zeit anzeigen", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "S&tatusleiste", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "P&unkte behalten", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Abbrechen",IDCANCEL,101,97,50,14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Laufendes Spiel beenden?" IDS_SOL_WIN "Glückwunsch, Sie haben gewonnen!" IDS_SOL_DEAL "Neu geben?" + IDS_SOL_SCORE "Punkte: %d" + IDS_SOL_TIME "Zeit: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/el-GR.rc b/reactos/base/applications/games/solitaire/lang/el-GR.rc index 31794e5705c..b84cb5d9225 100644 --- a/reactos/base/applications/games/solitaire/lang/el-GR.rc +++ b/reactos/base/applications/games/solitaire/lang/el-GR.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Κάρτες", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Ρίξε Έ&να", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Ρίξε &Τρία", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Εμφάνιση Ώρας", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Εμφάνιση Ώρας", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "Γ&ραμμή κατάστασης", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Ακύρωση", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Τερματισμός του πιαχνιδιού αυτού;" IDS_SOL_WIN "Συγχαρητήρια, κερδίσατε!!" IDS_SOL_DEAL "Deal again?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/en-US.rc b/reactos/base/applications/games/solitaire/lang/en-US.rc index 42138c63890..9d2c65215b9 100644 --- a/reactos/base/applications/games/solitaire/lang/en-US.rc +++ b/reactos/base/applications/games/solitaire/lang/en-US.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Cards", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Draw &One", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Draw &Three", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Show Time", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Show Time", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "S&tatus bar", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Cancel", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Quit the current game?" IDS_SOL_WIN "Congratulations, you win!" IDS_SOL_DEAL "Deal again?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/es-ES.rc b/reactos/base/applications/games/solitaire/lang/es-ES.rc index 67b2001b837..76d6833bff7 100644 --- a/reactos/base/applications/games/solitaire/lang/es-ES.rc +++ b/reactos/base/applications/games/solitaire/lang/es-ES.rc @@ -19,8 +19,13 @@ BEGIN GROUPBOX "Cartas", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Sacar &Una", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Sacar &Tres", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Mostrar tiempo", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Mostrar tiempo", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "&Barra de estado", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "Aceptar", IDOK, 35, 97, 50, 14 PUSHBUTTON "Cancelar", IDCANCEL, 101, 97, 50, 14 END @@ -55,6 +60,8 @@ BEGIN IDS_SOL_QUIT "¿Finalizar el juego actual?" IDS_SOL_WIN "Felicidades, ¡¡Has ganado!!" IDS_SOL_DEAL "¿Repartir de nuevo?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/eu-ES.rc b/reactos/base/applications/games/solitaire/lang/eu-ES.rc index 3f29a3ed421..d30ed76cd45 100644 --- a/reactos/base/applications/games/solitaire/lang/eu-ES.rc +++ b/reactos/base/applications/games/solitaire/lang/eu-ES.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Kartak ", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Banaka &atera", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Hirunaka &atera", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Denbora erakutsi", IDC_OPT_SHOWTIME, 7 ,51 ,67 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Denbora erakutsi", IDC_OPT_SHOWTIME, 7 ,51 ,67 ,10, WS_TABSTOP AUTOCHECKBOX "&Egoera barra", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "Ados", IDOK, 35, 97, 50, 14 PUSHBUTTON "Utzi", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Uneko jokoa amaitu?" IDS_SOL_WIN "Zorionak, irabazi duzu!!" IDS_SOL_DEAL "Deal again?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/fr-FR.rc b/reactos/base/applications/games/solitaire/lang/fr-FR.rc index 3ab493c1a2b..e9a66d5f335 100644 --- a/reactos/base/applications/games/solitaire/lang/fr-FR.rc +++ b/reactos/base/applications/games/solitaire/lang/fr-FR.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Cartes", -1, 7, 7, 90, 40 AUTORADIOBUTTON "En tirer une", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "En tirer trois", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "Afficher le temp&s", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "Afficher le temp&s", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "Barre de s&tatut", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Annuler", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Quitter le jeu actuel ?" IDS_SOL_WIN "Félicitations ! Vous avez gagné !" IDS_SOL_DEAL "Redistribuer ?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/he-IL.rc b/reactos/base/applications/games/solitaire/lang/he-IL.rc index 28375736ed4..39cabae99f3 100644 --- a/reactos/base/applications/games/solitaire/lang/he-IL.rc +++ b/reactos/base/applications/games/solitaire/lang/he-IL.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "משיכה", -1, 7, 7, 90, 40 AUTORADIOBUTTON "משוך &אחד", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "משוך &שלושה", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "משחק קצוב בזמן", IDC_OPT_SHOWTIME, 7 ,51 ,72 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "משחק קצוב בזמן", IDC_OPT_SHOWTIME, 7 ,51 ,72 ,10, WS_TABSTOP AUTOCHECKBOX "שורת מצב", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "אישור", IDOK, 35, 97, 50, 14 PUSHBUTTON "ביטול", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "להפסיק את המשחק הנוכחי?" IDS_SOL_WIN "כל הכבוד, ניצחת!" IDS_SOL_DEAL "לחלק שוב?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/hu-HU.rc b/reactos/base/applications/games/solitaire/lang/hu-HU.rc index 6d17826659a..6bc2723232a 100644 --- a/reactos/base/applications/games/solitaire/lang/hu-HU.rc +++ b/reactos/base/applications/games/solitaire/lang/hu-HU.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Kártyák", -1, 7, 7, 90, 40 AUTORADIOBUTTON "&Egy lap", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "&Három lap", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Idõ mutatása", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Idõ mutatása", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "Á&llapotsor", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Mégsem", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Kilépés ebbõl a játékból?" IDS_SOL_WIN "Gratulálok, Ön nyert!" IDS_SOL_DEAL "Új leosztás?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/id-ID.rc b/reactos/base/applications/games/solitaire/lang/id-ID.rc index 55833eb3f63..feed12ac668 100644 --- a/reactos/base/applications/games/solitaire/lang/id-ID.rc +++ b/reactos/base/applications/games/solitaire/lang/id-ID.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Cards", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Draw &One", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Draw &Three", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Show Time", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Show Time", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "S&tatus bar", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Batal", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Quit the current game?" IDS_SOL_WIN "Congratulations, you win!" IDS_SOL_DEAL "Deal again?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/it-IT.rc b/reactos/base/applications/games/solitaire/lang/it-IT.rc index 0419197d78e..63e55ff007a 100644 --- a/reactos/base/applications/games/solitaire/lang/it-IT.rc +++ b/reactos/base/applications/games/solitaire/lang/it-IT.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Carte", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Girane &Una", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Girane &Tre", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Visualizza il tempo", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Visualizza il tempo", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "&Barra di stato", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Annulla", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Chiudere la partita in corso?" IDS_SOL_WIN "Congratulazioni, hai vinto!!" IDS_SOL_DEAL "Nuova partita?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/ja-JP.rc b/reactos/base/applications/games/solitaire/lang/ja-JP.rc index 370c03089f5..14bd313293d 100644 --- a/reactos/base/applications/games/solitaire/lang/ja-JP.rc +++ b/reactos/base/applications/games/solitaire/lang/ja-JP.rc @@ -17,8 +17,13 @@ BEGIN GROUPBOX "カード", -1, 7, 7, 90, 40 AUTORADIOBUTTON "1 枚ずつ取る(&O)", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "3 枚ずつ取る(&T)", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "時間を表示する(&S)", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "時間を表示する(&S)", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "ステータスバーを表示する(&T)", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "キャンセル", IDCANCEL, 101, 97, 50, 14 END @@ -53,6 +58,8 @@ BEGIN IDS_SOL_QUIT "現在のゲームを終了しますか?" IDS_SOL_WIN "おめでとう、あなたの勝ちです!" IDS_SOL_DEAL "もう一度カードを配りますか?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/ko-KR.rc b/reactos/base/applications/games/solitaire/lang/ko-KR.rc index 2414a991d68..b5c84f34e29 100644 --- a/reactos/base/applications/games/solitaire/lang/ko-KR.rc +++ b/reactos/base/applications/games/solitaire/lang/ko-KR.rc @@ -12,8 +12,13 @@ BEGIN GROUPBOX "카드", -1, 7, 7, 90, 40 AUTORADIOBUTTON "한 장씩(&O)", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "세 장씩(&T)", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "시간 보이기(&S)", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "시간 보이기(&S)", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "상태 표시줄(&T)", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "확인", IDOK, 35, 97, 50, 14 PUSHBUTTON "취소", IDCANCEL, 101, 97, 50, 14 END @@ -48,6 +53,8 @@ BEGIN IDS_SOL_QUIT "현재 게임을 끝낼가요?" IDS_SOL_WIN "축하합니다!!" IDS_SOL_DEAL "Deal again?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/lt-LT.rc b/reactos/base/applications/games/solitaire/lang/lt-LT.rc index 4200bb0abef..ee60886ae06 100644 --- a/reactos/base/applications/games/solitaire/lang/lt-LT.rc +++ b/reactos/base/applications/games/solitaire/lang/lt-LT.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Kortos", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Dalinti po &vieną", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Dalinti po &tris", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Rodyti laiką", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Rodyti laiką", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "&Būsenos juosta", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "Gerai", IDOK, 35, 97, 50, 14 PUSHBUTTON "Atsisakyti", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Baigti žaidimą?" IDS_SOL_WIN "Sveikiname, jūs laimėjote!!" IDS_SOL_DEAL "Dalinti vėl?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/nl-NL.rc b/reactos/base/applications/games/solitaire/lang/nl-NL.rc index 9223cf47c98..bb3906ca592 100644 --- a/reactos/base/applications/games/solitaire/lang/nl-NL.rc +++ b/reactos/base/applications/games/solitaire/lang/nl-NL.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Delen", -1, 7, 7, 90, 40 AUTORADIOBUTTON "&Eén kaart", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "&Drie kaarten", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "Tijd &weergeven", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "Tijd &weergeven", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "S&tatusbalk", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Annuleren", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Het huidige spel afsluiten?" IDS_SOL_WIN "Gefeliciteerd, u heeft gewonnen!" IDS_SOL_DEAL "Nogmaals spelen?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/no-NO.rc b/reactos/base/applications/games/solitaire/lang/no-NO.rc index f490db18f9e..78ee4941222 100644 --- a/reactos/base/applications/games/solitaire/lang/no-NO.rc +++ b/reactos/base/applications/games/solitaire/lang/no-NO.rc @@ -10,8 +10,13 @@ BEGIN GROUPBOX "Kort", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Velg &et", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Velg &tre", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Vis tid", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Vis tid", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "S&tatuslinje", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Avbryt", IDCANCEL, 101, 97, 50, 14 END @@ -46,6 +51,8 @@ BEGIN IDS_SOL_QUIT "Slutt nåværende spill?" IDS_SOL_WIN "Gratulerer, du vant!!" IDS_SOL_DEAL "Del ut igjen?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/pl-PL.rc b/reactos/base/applications/games/solitaire/lang/pl-PL.rc index 3579a3cf237..85521de110c 100644 --- a/reactos/base/applications/games/solitaire/lang/pl-PL.rc +++ b/reactos/base/applications/games/solitaire/lang/pl-PL.rc @@ -19,8 +19,13 @@ BEGIN GROUPBOX "Karty", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Rozdaj &jedną", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Rozdaj &dwie", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Pokazuj czas gry", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Pokazuj czas gry", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "Pokazuj pa&sek stanu", IDC_OPT_STATUSBAR, 7, 66, 77, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Anuluj", IDCANCEL, 101, 97, 50, 14 END @@ -55,6 +60,8 @@ BEGIN IDS_SOL_QUIT "Zakończyć aktualną grę?" IDS_SOL_WIN "Gratulacje, wygrałeś!" IDS_SOL_DEAL "Nowe rozdanie?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/ro-RO.rc b/reactos/base/applications/games/solitaire/lang/ro-RO.rc index 18e3b937faa..bf3609e011b 100644 --- a/reactos/base/applications/games/solitaire/lang/ro-RO.rc +++ b/reactos/base/applications/games/solitaire/lang/ro-RO.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Cărți", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Câte &una", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Câte t&rei", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Afișează timp", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Afișează timp", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "&Bară de stare", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "Con&firmă", IDOK, 35, 97, 50, 14 PUSHBUTTON "A&nulează", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Abandonați jocul curent?" IDS_SOL_WIN "Felicitări, ați câștigat!" IDS_SOL_DEAL "O nouă rundă?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/ru-RU.rc b/reactos/base/applications/games/solitaire/lang/ru-RU.rc index 45900bdddae..ebaebb7896f 100644 --- a/reactos/base/applications/games/solitaire/lang/ru-RU.rc +++ b/reactos/base/applications/games/solitaire/lang/ru-RU.rc @@ -12,8 +12,13 @@ BEGIN GROUPBOX "Карты", -1, 7, 7, 90, 40 AUTORADIOBUTTON "По &одной", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "По &три", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Показывать время", IDC_OPT_SHOWTIME, 7 ,51 ,75 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Показывать время", IDC_OPT_SHOWTIME, 7 ,51 ,75 ,10, WS_TABSTOP AUTOCHECKBOX "&Строка состояния", IDC_OPT_STATUSBAR, 7, 66, 75, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Отмена", IDCANCEL, 101, 97, 50, 14 END @@ -48,6 +53,8 @@ BEGIN IDS_SOL_QUIT "Закончить текущую игру?" IDS_SOL_WIN "Congratulations, you win!!" IDS_SOL_DEAL "Deal again?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Меню */ diff --git a/reactos/base/applications/games/solitaire/lang/sk-SK.rc b/reactos/base/applications/games/solitaire/lang/sk-SK.rc index f5aaa38dab3..a907a0c0630 100644 --- a/reactos/base/applications/games/solitaire/lang/sk-SK.rc +++ b/reactos/base/applications/games/solitaire/lang/sk-SK.rc @@ -19,8 +19,13 @@ BEGIN GROUPBOX "Karty", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Ťahať &jednu", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Ťahať &tri", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "Ča&sový limit", IDC_OPT_SHOWTIME, 7 ,51 ,64 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "Ča&sový limit", IDC_OPT_SHOWTIME, 7 ,51 ,64 ,10, WS_TABSTOP AUTOCHECKBOX "Stavový riad&ok", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Zrušiť", IDCANCEL, 101, 97, 50, 14 END @@ -55,6 +60,8 @@ BEGIN IDS_SOL_QUIT "Naozaj chcete skončiť aktuálnu hru?" IDS_SOL_WIN "Blahoželám, vyhrali ste!" IDS_SOL_DEAL "Rozdať znova?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/sq-AL.rc b/reactos/base/applications/games/solitaire/lang/sq-AL.rc index 8f55a015c65..f677504c99a 100644 --- a/reactos/base/applications/games/solitaire/lang/sq-AL.rc +++ b/reactos/base/applications/games/solitaire/lang/sq-AL.rc @@ -19,8 +19,13 @@ BEGIN GROUPBOX "Letra", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Barazim &Nje", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Barazim &tRE", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Shfaq Kohen", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Shfaq Kohen", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "T&abela e Statusit", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Anulo", IDCANCEL, 101, 97, 50, 14 END @@ -55,6 +60,8 @@ BEGIN IDS_SOL_QUIT "Largohu Nga Loja?" IDS_SOL_WIN "Urime, keni fituar!" IDS_SOL_DEAL "Fillo Perseri?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/sv-SE.rc b/reactos/base/applications/games/solitaire/lang/sv-SE.rc index 02c9947ec27..795407d6797 100644 --- a/reactos/base/applications/games/solitaire/lang/sv-SE.rc +++ b/reactos/base/applications/games/solitaire/lang/sv-SE.rc @@ -10,8 +10,13 @@ BEGIN GROUPBOX "Kort", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Dra &En", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Dra &Tre", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Visa Tid", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Visa Tid", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "&Statusfält", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Avbryt", IDCANCEL, 101, 97, 50, 14 END @@ -46,6 +51,8 @@ BEGIN IDS_SOL_QUIT "Avsluta nuvarande spel?" IDS_SOL_WIN "Grattis, du vann!" IDS_SOL_DEAL "Ge igen?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/th-TH.rc b/reactos/base/applications/games/solitaire/lang/th-TH.rc index 9bfbec4da3b..0017ad42b18 100644 --- a/reactos/base/applications/games/solitaire/lang/th-TH.rc +++ b/reactos/base/applications/games/solitaire/lang/th-TH.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Cards", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Draw &One", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Draw &Three", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Show Time", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Show Time", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "S&tatus bar", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "ตกลง", IDOK, 35, 97, 50, 14 PUSHBUTTON "ยกเลิก", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Quit the current game?" IDS_SOL_WIN "Congratulations, you win!" IDS_SOL_DEAL "Deal again?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/tr-TR.rc b/reactos/base/applications/games/solitaire/lang/tr-TR.rc index 5df4d84d81f..d3c6a86ad1e 100644 --- a/reactos/base/applications/games/solitaire/lang/tr-TR.rc +++ b/reactos/base/applications/games/solitaire/lang/tr-TR.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Kâğıtlar", -1, 7, 7, 90, 40 AUTORADIOBUTTON "&Tekli Çek", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "&Üçlü Çek", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Süreyi Göster", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Süreyi Göster", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "&Durum Çubuğu", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "Tamam", IDOK, 35, 97, 50, 14 PUSHBUTTON "İptal", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Bu oyundan çıkılsın mı?" IDS_SOL_WIN "Tebrikler, kazandınız!" IDS_SOL_DEAL "Yine dağıtılsın mı?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/uk-UA.rc b/reactos/base/applications/games/solitaire/lang/uk-UA.rc index 26d6ff3d5cb..bac156f72dd 100644 --- a/reactos/base/applications/games/solitaire/lang/uk-UA.rc +++ b/reactos/base/applications/games/solitaire/lang/uk-UA.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "Карти", -1, 7, 7, 90, 40 AUTORADIOBUTTON "По &одній", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "По &три", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "&Гра за часом", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "&Гра за часом", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "&Рядок стану", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Скасувати", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "Вийти з поточної гри?" IDS_SOL_WIN "Вітання, Ви виграли!!" IDS_SOL_DEAL "Роздати знову?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/zh-CN.rc b/reactos/base/applications/games/solitaire/lang/zh-CN.rc index 665ca20a135..14eb3813a1b 100644 --- a/reactos/base/applications/games/solitaire/lang/zh-CN.rc +++ b/reactos/base/applications/games/solitaire/lang/zh-CN.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "翻牌", -1, 7, 7, 90, 40 AUTORADIOBUTTON "翻一张(&O)", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "翻三张(&T)", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "计时(&S)", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "计时(&S)", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "状态栏(&T)", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "确定", IDOK, 35, 97, 50, 14 PUSHBUTTON "取消", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "退出当前游戏?" IDS_SOL_WIN "恭喜你,你赢了!!" IDS_SOL_DEAL "再玩一次?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/lang/zh-TW.rc b/reactos/base/applications/games/solitaire/lang/zh-TW.rc index f68a31e008a..f80b9aa53d2 100644 --- a/reactos/base/applications/games/solitaire/lang/zh-TW.rc +++ b/reactos/base/applications/games/solitaire/lang/zh-TW.rc @@ -18,8 +18,13 @@ BEGIN GROUPBOX "發牌", -1, 7, 7, 90, 40 AUTORADIOBUTTON "發一張牌(&O)", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "發三張牌(&T)", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - AUTOCHECKBOX "計時(&S)", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP | WS_DISABLED + GROUPBOX "Scoring", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 + AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTOCHECKBOX "計時(&S)", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "狀態列(&T)", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP + AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "確定", IDOK, 35, 97, 50, 14 PUSHBUTTON "取消", IDCANCEL, 101, 97, 50, 14 END @@ -54,6 +59,8 @@ BEGIN IDS_SOL_QUIT "退出目前遊戲?" IDS_SOL_WIN "恭喜你,你嬴了!!" IDS_SOL_DEAL "再玩一次?" + IDS_SOL_SCORE "Score: %d" + IDS_SOL_TIME "Time: %d" END /* Menus */ diff --git a/reactos/base/applications/games/solitaire/resource.h b/reactos/base/applications/games/solitaire/resource.h index 5c0d255fcdb..0b221bc4f9c 100644 --- a/reactos/base/applications/games/solitaire/resource.h +++ b/reactos/base/applications/games/solitaire/resource.h @@ -20,6 +20,10 @@ #define IDC_OPT_DRAWTHREE 1202 #define IDC_OPT_SHOWTIME 1203 #define IDC_OPT_STATUSBAR 1204 +#define IDC_OPT_STANDARD 1205 +#define IDC_OPT_VEGAS 1206 +#define IDC_OPT_NOSCORE 1207 +#define IDC_OPT_KEEPSCORE 1208 #define IDD_CARDBACK 1250 #define IDC_CARDBACK1 1251 #define IDC_CARDBACK2 1252 @@ -40,3 +44,5 @@ #define IDS_SOL_QUIT 1302 #define IDS_SOL_WIN 1303 #define IDS_SOL_DEAL 1304 +#define IDS_SOL_SCORE 1305 +#define IDS_SOL_TIME 1306 diff --git a/reactos/base/applications/games/solitaire/solcreate.cpp b/reactos/base/applications/games/solitaire/solcreate.cpp index 6f0f35106e7..1f185713b41 100644 --- a/reactos/base/applications/games/solitaire/solcreate.cpp +++ b/reactos/base/applications/games/solitaire/solcreate.cpp @@ -38,6 +38,7 @@ void CreateSol() pPile->SetDropRule(CS_DROP_NONE, 0); pPile->SetDblClickProc(PileDblClickProc); pPile->SetRemoveCardProc(PileRemoveProc); + pPile->SetClickProc(PileClickProc); // // Create the suit stacks @@ -50,6 +51,7 @@ void CreateSol() pSuitStack[i]->SetDropRule(CS_DROP_CALLBACK, SuitStackDropProc); pSuitStack[i]->SetDragRule(CS_DRAG_TOP); + pSuitStack[i]->SetClickProc(SuitStackClickProc); pSuitStack[i]->SetAddCardProc(SuitStackAddProc); } diff --git a/reactos/base/applications/games/solitaire/solgame.cpp b/reactos/base/applications/games/solitaire/solgame.cpp index b34dcc8b91b..58ef8e23622 100644 --- a/reactos/base/applications/games/solitaire/solgame.cpp +++ b/reactos/base/applications/games/solitaire/solgame.cpp @@ -10,6 +10,7 @@ extern TCHAR MsgWin[128]; extern TCHAR MsgDeal[128]; CardStack activepile; +int LastId; bool fGameStarted = false; void NewGame(void) @@ -17,6 +18,33 @@ void NewGame(void) TRACE("ENTER NewGame()\n"); int i, j; + if (GetScoreMode() == SCORE_VEGAS) + { + if ((dwOptions & OPTION_KEEP_SCORE) && (dwPrevMode == SCORE_VEGAS)) + lScore = lScore - 52; + else + lScore = -52; + + if (dwOptions & OPTION_THREE_CARDS) + dwWasteTreshold = 2; + else + dwWasteTreshold = 0; + + } + else + { + if (dwOptions & OPTION_THREE_CARDS) + dwWasteTreshold = 3; + else + dwWasteTreshold = 0; + + lScore = 0; + } + + dwTime = 0; + dwWasteCount = 0; + LastId = 0; + SolWnd.EmptyStacks(); //create a new card-stack @@ -52,7 +80,13 @@ void NewGame(void) SolWnd.Redraw(); fGameStarted = false; + + dwPrevMode = GetScoreMode(); + + UpdateStatusBar(); + TRACE("EXIT NewGame()\n"); + } // @@ -69,6 +103,8 @@ bool CARDLIBPROC RowStackDragProc(CardRegion &stackobj, int iNumDragCards) int numfacedown; int numcards; + SetPlayTimer(); + stackobj.GetFaceDirection(&numfacedown); numcards = stackobj.NumCards(); @@ -90,6 +126,8 @@ bool CARDLIBPROC RowStackDropProc(CardRegion &stackobj, CardStack &dragcards) TRACE("ENTER RowStackDropProc()\n"); Card dragcard = dragcards[dragcards.NumCards() - 1]; + SetPlayTimer(); + //if we are empty, can only drop a stack with a King at bottom if(stackobj.NumCards() == 0) { @@ -121,6 +159,27 @@ bool CARDLIBPROC RowStackDropProc(CardRegion &stackobj, CardStack &dragcards) fGameStarted = true; + if (LastId == PILE_ID) + { + if (GetScoreMode() == SCORE_STD) + { + lScore = lScore + 5; + } + } + else if ((LastId >= SUIT_ID) && (LastId <= SUIT_ID + 3)) + { + if (GetScoreMode() == SCORE_STD) + { + lScore = lScore >= 15 ? lScore - 15 : 0; + } + else if (GetScoreMode() == SCORE_VEGAS) + { + lScore = lScore >= -47 ? lScore - 5 : -52; + } + } + + UpdateStatusBar(); + TRACE("EXIT RowStackDropProc(true)\n"); return true; } @@ -136,6 +195,8 @@ bool CanDrop(CardRegion &stackobj, Card card) const CardStack &cardstack = stackobj.GetCardStack(); + SetPlayTimer(); + if(cardstack.NumCards() > 0) { if(card.Suit() != cardstack[0].Suit()) @@ -168,6 +229,9 @@ bool CanDrop(CardRegion &stackobj, Card card) bool CARDLIBPROC SuitStackDropProc(CardRegion &stackobj, CardStack &dragcards) { TRACE("ENTER SuitStackDropProc()\n"); + + SetPlayTimer(); + //only drop 1 card at a time if(dragcards.NumCards() != 1) { @@ -177,9 +241,41 @@ bool CARDLIBPROC SuitStackDropProc(CardRegion &stackobj, CardStack &dragcards) bool b = CanDrop(stackobj, dragcards[0]); TRACE("EXIT SuitStackDropProc()\n"); + + if (b) + { + if ((LastId == PILE_ID) || (LastId >= ROW_ID)) + { + if (GetScoreMode() == SCORE_VEGAS) + { + lScore = lScore + 5; + } + else if (GetScoreMode() == SCORE_STD) + { + lScore = lScore + 10; + } + + UpdateStatusBar(); + } + } + return b; } +// +// Single-click on one of the suit-stacks +// +void CARDLIBPROC SuitStackClickProc(CardRegion &stackobj, int iNumClicked) +{ + TRACE("ENTER SuitStackClickProc()\n"); + + fGameStarted = true; + + LastId = stackobj.Id(); + + TRACE("EXIT SuitStackClickProc()\n"); +} + // // Single-click on one of the row-stacks // Turn the top-card over if they are all face-down @@ -197,7 +293,18 @@ void CARDLIBPROC RowStackClickProc(CardRegion &stackobj, int iNumClicked) if(numfacedown > 0) numfacedown--; stackobj.SetFaceDirection(CS_FACE_DOWNUP, numfacedown); stackobj.Redraw(); + + if (GetScoreMode() == SCORE_STD) + { + lScore = lScore + 5; + UpdateStatusBar(); + } } + + LastId = stackobj.Id(); + + fGameStarted = true; + TRACE("EXIT RowStackClickProc()\n"); } @@ -207,6 +314,7 @@ void CARDLIBPROC RowStackClickProc(CardRegion &stackobj, int iNumClicked) CardRegion *FindSuitStackFromCard(Card card) { TRACE("ENTER FindSuitStackFromCard()\n"); + for(int i = 0; i < 4; i++) { if(CanDrop(*pSuitStack[i], card)) @@ -231,17 +339,30 @@ void CARDLIBPROC SuitStackAddProc(CardRegion &stackobj, const CardStack &added) TRACE("ENTER SuitStackAddProc()\n"); bool fGameOver = true; + SetPlayTimer(); + for(int i = 0; i < 4; i++) { if(pSuitStack[i]->NumCards() != 13) { fGameOver = false; + break; } } if(fGameOver) { + KillTimer(hwndMain, IDT_PLAYTIMER); + PlayTimer = 0; + + if ((dwOptions & OPTION_SHOW_TIME) && (GetScoreMode() == SCORE_STD)) + { + lScore = lScore + (700000 / dwTime); + } + + UpdateStatusBar(); + MessageBox(SolWnd, MsgWin, szAppName, MB_OK | MB_ICONINFORMATION); for(int i = 0; i < 4; i++) @@ -272,6 +393,9 @@ void CARDLIBPROC SuitStackAddProc(CardRegion &stackobj, const CardStack &added) void CARDLIBPROC RowStackDblClickProc(CardRegion &stackobj, int iNumClicked) { TRACE("ENTER RowStackDblClickProc()\n"); + + SetPlayTimer(); + //can only move 1 card at a time if(iNumClicked != 1) { @@ -286,6 +410,7 @@ void CARDLIBPROC RowStackDblClickProc(CardRegion &stackobj, int iNumClicked) if(pDest != 0) { fGameStarted = true; + SetPlayTimer(); //stackobj.MoveCards(pDest, 1, true); //use the SimulateDrag funcion, because we get the @@ -295,12 +420,29 @@ void CARDLIBPROC RowStackDblClickProc(CardRegion &stackobj, int iNumClicked) TRACE("EXIT RowStackDblClickProc()\n"); } +// +// Face-up pile single-click +// +void CARDLIBPROC PileClickProc(CardRegion &stackobj, int iNumClicked) +{ + TRACE("ENTER SuitStackClickProc()\n"); + + fGameStarted = true; + + LastId = stackobj.Id(); + + TRACE("EXIT SuitStackClickProc()\n"); +} + // // Face-up pile double-click // void CARDLIBPROC PileDblClickProc(CardRegion &stackobj, int iNumClicked) { TRACE("ENTER PileDblClickProc()\n"); + + SetPlayTimer(); + RowStackDblClickProc(stackobj, iNumClicked); TRACE("EXIT PileDblClickProc()\n"); } @@ -311,6 +453,9 @@ void CARDLIBPROC PileDblClickProc(CardRegion &stackobj, int iNumClicked) void CARDLIBPROC PileRemoveProc(CardRegion &stackobj, int iItems) { TRACE("ENTER PileRemoveProc()\n"); + + SetPlayTimer(); + //modify our "virtual" pile by removing the same card //that was removed from the physical card stack activepile.Pop(iItems); @@ -334,10 +479,14 @@ void CARDLIBPROC PileRemoveProc(CardRegion &stackobj, int iItems) void CARDLIBPROC DeckClickProc(CardRegion &stackobj, int iNumClicked) { TRACE("ENTER DeckClickProc()\n"); + + SetPlayTimer(); + CardStack cardstack = stackobj.GetCardStack(); CardStack pile = pPile->GetCardStack(); fGameStarted = true; + SetPlayTimer(); //reset the face-up pile to represent 3 cards if(dwOptions & OPTION_THREE_CARDS) @@ -345,11 +494,45 @@ void CARDLIBPROC DeckClickProc(CardRegion &stackobj, int iNumClicked) if(cardstack.NumCards() == 0) { - pile.Clear(); + if (GetScoreMode() == SCORE_VEGAS) + { + if (dwWasteCount < dwWasteTreshold) + { + pile.Clear(); - activepile.Reverse(); - cardstack.Push(activepile); - activepile.Clear(); + activepile.Reverse(); + cardstack.Push(activepile); + activepile.Clear(); + } + } + else if (GetScoreMode() == SCORE_STD) + { + if ((dwWasteCount >= dwWasteTreshold) && (activepile.NumCards() != 0)) + { + if (dwOptions & OPTION_THREE_CARDS) + lScore = lScore >= 20 ? lScore - 20 : 0; + else + lScore = lScore >= 100 ? lScore - 100 : 0; + } + + pile.Clear(); + + activepile.Reverse(); + cardstack.Push(activepile); + activepile.Clear(); + + UpdateStatusBar(); + } + else + { + pile.Clear(); + + activepile.Reverse(); + cardstack.Push(activepile); + activepile.Clear(); + } + + dwWasteCount++; } else { diff --git a/reactos/base/applications/games/solitaire/solitaire.cpp b/reactos/base/applications/games/solitaire/solitaire.cpp index 38087d9c892..7ad7f0f1754 100644 --- a/reactos/base/applications/games/solitaire/solitaire.cpp +++ b/reactos/base/applications/games/solitaire/solitaire.cpp @@ -14,12 +14,21 @@ HWND hwndStatus; HINSTANCE hInstance; TCHAR szAppName[128]; +TCHAR szScore[64]; +TCHAR szTime[64]; TCHAR MsgQuit[128]; TCHAR MsgAbout[128]; TCHAR MsgWin[128]; TCHAR MsgDeal[128]; DWORD dwOptions = OPTION_THREE_CARDS; +DWORD dwTime; +DWORD dwWasteCount; +DWORD dwWasteTreshold; +DWORD dwPrevMode; +long lScore; +UINT_PTR PlayTimer = 0; + CardWindow SolWnd; typedef struct _CardBack @@ -115,6 +124,60 @@ VOID SaveSettings(VOID) RegCloseKey(hKey); } +// Returns 0 for no points, 1 for Standard and 2 for Vegas +int GetScoreMode(void) +{ + if ((dwOptions & OPTION_SCORE_STD) && (dwOptions & OPTION_SCORE_VEGAS)) + { + return SCORE_NONE; + } + + if (dwOptions & OPTION_SCORE_STD) + { + return SCORE_STD; + } + + if (dwOptions & OPTION_SCORE_VEGAS) + { + return SCORE_VEGAS; + } + + return 0; +} + +void UpdateStatusBar(void) +{ + TCHAR szStatusText[128]; + TCHAR szTempText[64]; + + ZeroMemory(szStatusText, sizeof(szStatusText) / sizeof(TCHAR)); + + if (GetScoreMode() != SCORE_NONE) + { + _stprintf(szStatusText, szScore, lScore); + _tcscat(szStatusText, _T(" ")); + } + + if (dwOptions & OPTION_SHOW_TIME) + { + _stprintf(szTempText, szTime, dwTime); + _tcscat(szStatusText, szTempText); + } + + SendMessage(hwndStatus, SB_SETTEXT, 0 | SBT_NOBORDERS, (LPARAM)(LPTSTR)szStatusText); +} + +void SetPlayTimer(void) +{ + if (dwOptions & OPTION_SHOW_TIME) + { + if (!PlayTimer) + { + PlayTimer = SetTimer(hwndMain, IDT_PLAYTIMER, 1000, NULL); + } + } +} + // // Main entry point // @@ -136,6 +199,9 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm LoadString(hInst, IDS_SOL_WIN, MsgWin, sizeof(MsgWin) / sizeof(MsgWin[0])); LoadString(hInst, IDS_SOL_DEAL, MsgDeal, sizeof(MsgDeal) / sizeof(MsgDeal[0])); + LoadString(hInst, IDS_SOL_SCORE, szScore, sizeof(szScore) / sizeof(TCHAR)); + LoadString(hInst, IDS_SOL_TIME, szTime, sizeof(szTime) / sizeof(TCHAR)); + //Window class for the main application parent window wndclass.style = 0;//CS_HREDRAW | CS_VREDRAW; wndclass.lpfnWndProc = WndProc; @@ -160,6 +226,8 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm LoadSettings(); + dwPrevMode = GetScoreMode(); + //Construct the path to our help file MakePath(szHelpPath, MAX_PATH, _T(".hlp")); @@ -178,6 +246,8 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm hwndMain = hwnd; + UpdateStatusBar(); + ShowWindow(hwnd, iCmdShow); UpdateWindow(hwnd); @@ -200,6 +270,8 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { + HWND hCtrl; + switch (uMsg) { case WM_INITDIALOG: @@ -209,11 +281,47 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar CheckDlgButton(hDlg, IDC_OPT_STATUSBAR, (dwOptions & OPTION_SHOW_STATUS) ? BST_CHECKED : BST_UNCHECKED); + + CheckDlgButton(hDlg, + IDC_OPT_SHOWTIME, + (dwOptions & OPTION_SHOW_TIME) ? BST_CHECKED : BST_UNCHECKED); + + CheckDlgButton(hDlg, + IDC_OPT_KEEPSCORE, + (dwOptions & OPTION_KEEP_SCORE) ? BST_CHECKED : BST_UNCHECKED); + + hCtrl = GetDlgItem(hDlg, IDC_OPT_KEEPSCORE); + + if (GetScoreMode() == SCORE_NONE) + { + CheckRadioButton(hDlg, IDC_OPT_STANDARD, IDC_OPT_NOSCORE, IDC_OPT_NOSCORE); + EnableWindow(hCtrl, FALSE); + } + else if (GetScoreMode() == SCORE_STD) + { + CheckRadioButton(hDlg, IDC_OPT_STANDARD, IDC_OPT_NOSCORE, IDC_OPT_STANDARD); + EnableWindow(hCtrl, FALSE); + } + else if (GetScoreMode() == SCORE_VEGAS) + { + CheckRadioButton(hDlg, IDC_OPT_STANDARD, IDC_OPT_NOSCORE, IDC_OPT_VEGAS); + EnableWindow(hCtrl, TRUE); + } return TRUE; case WM_COMMAND: switch(LOWORD(wParam)) { + case IDC_OPT_NOSCORE: + case IDC_OPT_STANDARD: + case IDC_OPT_VEGAS: + hCtrl = GetDlgItem(hDlg, IDC_OPT_KEEPSCORE); + if (wParam == IDC_OPT_VEGAS) + EnableWindow(hCtrl, TRUE); + else + EnableWindow(hCtrl, FALSE); + return TRUE; + case IDOK: dwOptions &= ~OPTION_THREE_CARDS; if (IsDlgButtonChecked(hDlg, IDC_OPT_DRAWTHREE) == BST_CHECKED) @@ -224,6 +332,34 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPar else dwOptions &= ~OPTION_SHOW_STATUS; + if (IsDlgButtonChecked(hDlg, IDC_OPT_SHOWTIME) == BST_CHECKED) + dwOptions |= OPTION_SHOW_TIME; + else + dwOptions &= ~OPTION_SHOW_TIME; + + if (IsDlgButtonChecked(hDlg, IDC_OPT_KEEPSCORE) == BST_CHECKED) + dwOptions |= OPTION_KEEP_SCORE; + else + dwOptions &= ~OPTION_KEEP_SCORE; + + if (IsDlgButtonChecked(hDlg, IDC_OPT_STANDARD) == BST_CHECKED) + { + dwOptions |= OPTION_SCORE_STD; + dwOptions &= ~OPTION_SCORE_VEGAS; + } + else if (IsDlgButtonChecked(hDlg, IDC_OPT_VEGAS) == BST_CHECKED) + { + dwOptions |= OPTION_SCORE_VEGAS; + dwOptions &= ~OPTION_SCORE_STD; + } + else if (IsDlgButtonChecked(hDlg, IDC_OPT_NOSCORE) == BST_CHECKED) + { + dwOptions |= OPTION_SCORE_VEGAS; + dwOptions |= OPTION_SCORE_STD; + } + + UpdateStatusBar(); + EndDialog(hDlg, TRUE); return TRUE; @@ -241,9 +377,13 @@ VOID ShowGameOptionsDlg(HWND hwnd) DWORD dwOldOptions = dwOptions; RECT rcMain, rcStatus; + int iOldScoreMode = GetScoreMode(); + if (DialogBox(hInstance, MAKEINTRESOURCE(IDD_OPTIONS), hwnd, OptionsDlgProc)) { - if ((dwOldOptions & OPTION_THREE_CARDS) != (dwOptions & OPTION_THREE_CARDS)) + if (((dwOldOptions & OPTION_THREE_CARDS) != (dwOptions & OPTION_THREE_CARDS)) || + ((dwOldOptions & OPTION_SHOW_TIME) != (dwOptions & OPTION_SHOW_TIME)) || + (iOldScoreMode != GetScoreMode())) NewGame(); if ((dwOldOptions & OPTION_SHOW_STATUS) != (dwOptions & OPTION_SHOW_STATUS)) @@ -458,7 +598,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) { case WM_CREATE: { - int parts[] = { 100, -1 }; + int parts[] = { 150, -1 }; RECT rcStatus; hwndStatus = CreateStatusWindow(WS_CHILD | WS_VISIBLE | CCS_BOTTOM | SBARS_SIZEGRIP, _T("Ready"), hwnd, 0); @@ -496,6 +636,25 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam) PostQuitMessage(0); return 0; + case WM_TIMER: + if (!fGameStarted) + { + KillTimer(hwndMain, IDT_PLAYTIMER); + PlayTimer = 0; + } + else if (dwOptions & OPTION_SHOW_TIME) + { + if (((dwTime + 1) % 10 == 0) && (GetScoreMode() == SCORE_STD)) + { + lScore = lScore >= 2 ? lScore - 2 : 0; + } + + dwTime++; + } + + UpdateStatusBar(); + return 0; + case WM_SIZE: nWidth = LOWORD(lParam); nHeight = HIWORD(lParam); diff --git a/reactos/base/applications/games/solitaire/solitaire.h b/reactos/base/applications/games/solitaire/solitaire.h index cc9c960f01d..f05b2f4a797 100644 --- a/reactos/base/applications/games/solitaire/solitaire.h +++ b/reactos/base/applications/games/solitaire/solitaire.h @@ -9,6 +9,10 @@ extern bool fGameStarted; #define OPTION_SHOW_STATUS 4 #define OPTION_THREE_CARDS 8 +#define OPTION_SHOW_TIME 16 +#define OPTION_KEEP_SCORE 32 +#define OPTION_SCORE_STD 64 +#define OPTION_SCORE_VEGAS 128 #define CARDBACK_START IDC_CARDBACK1 #define CARDBACK_END IDC_CARDBACK12 #define NUM_CARDBACKS (CARDBACK_END - CARDBACK_START + 1) @@ -19,6 +23,16 @@ extern bool fGameStarted; extern DWORD dwOptions; +extern DWORD dwTime; +extern DWORD dwWasteCount; +extern DWORD dwWasteTreshold; +extern DWORD dwPrevMode; +extern long lScore; +extern HWND hwndMain; +extern UINT_PTR PlayTimer; + +#define IDT_PLAYTIMER 1000 + void CreateSol(void); void NewGame(void); @@ -28,6 +42,10 @@ void NewGame(void); #define SUIT_ID 4 #define ROW_ID 10 +#define SCORE_NONE 0 +#define SCORE_STD 1 +#define SCORE_VEGAS 2 + // Various metrics used for placing the objects and computing the minimum window size #define X_BORDER 20 #define X_PILE_BORDER 18 @@ -42,18 +60,25 @@ extern CardRegion *pPile; extern CardRegion *pSuitStack[]; extern CardRegion *pRowStack[]; +extern void UpdateStatusBar(void); +extern void SetPlayTimer(void); +extern int GetScoreMode(void); + bool CARDLIBPROC RowStackDragProc(CardRegion &stackobj, int iNumCards); bool CARDLIBPROC RowStackDropProc(CardRegion &stackobj, CardStack &dragcards); bool CARDLIBPROC SuitStackDropProc(CardRegion &stackobj, CardStack &dragcards); void CARDLIBPROC SuitStackAddProc(CardRegion &stackobj, const CardStack &added); +void CARDLIBPROC SuitStackClickProc(CardRegion &stackobj, int iNumClicked); void CARDLIBPROC RowStackClickProc(CardRegion &stackobj, int iNumClicked); void CARDLIBPROC RowStackDblClickProc(CardRegion &stackobj, int iNumClicked); void CARDLIBPROC DeckClickProc(CardRegion &stackobj, int iNumClicked); void CARDLIBPROC PileDblClickProc(CardRegion &stackobj, int iNumClicked); +void CARDLIBPROC PileClickProc(CardRegion &stackobj, int iNumClicked); void CARDLIBPROC PileRemoveProc(CardRegion &stackobj, int iRemoved); + #endif /* _SOL_PCH_ */ From 9f009100c6196c78c49a9fc88d7a538d24dc1528 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 12:14:16 +0000 Subject: [PATCH 374/419] [PSDK] * Remove a __WINESRC__ case. CORE-5743 svn path=/trunk/; revision=62802 --- reactos/include/psdk/winternl.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/reactos/include/psdk/winternl.h b/reactos/include/psdk/winternl.h index b3d59dc005d..aa95b5db06a 100644 --- a/reactos/include/psdk/winternl.h +++ b/reactos/include/psdk/winternl.h @@ -1160,18 +1160,11 @@ typedef struct _SYSTEM_TIMEOFDAY_INFORMATION { /* System Information Class 0x08 */ typedef struct _SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION { -#ifdef __WINESRC__ - LARGE_INTEGER liIdleTime; - LARGE_INTEGER liKernelTime; - LARGE_INTEGER liUserTime; - DWORD dwSpare[5]; -#else LARGE_INTEGER IdleTime; LARGE_INTEGER KernelTime; LARGE_INTEGER UserTime; LARGE_INTEGER Reserved1[2]; ULONG Reserved2; -#endif } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION, *PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; /* System Information Class 0x0b */ From 276ab2e979bb12ce76242ab21ec8609fb89fb6b9 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 19 Apr 2014 14:16:55 +0000 Subject: [PATCH 375/419] [MSGINA][SOLITAIRE] Italian translation updates Patches by Marco Maria Emanuele Bartucci. Thanks a lot! CORE-8086 #resolve svn path=/trunk/; revision=62803 --- reactos/base/applications/games/solitaire/lang/it-IT.rc | 9 +++++---- reactos/dll/win32/msgina/lang/it-IT.rc | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/reactos/base/applications/games/solitaire/lang/it-IT.rc b/reactos/base/applications/games/solitaire/lang/it-IT.rc index 63e55ff007a..464a6b92091 100644 --- a/reactos/base/applications/games/solitaire/lang/it-IT.rc +++ b/reactos/base/applications/games/solitaire/lang/it-IT.rc @@ -4,6 +4,7 @@ * FILE: base/applications/games/solitaire/lang/it-IT.rc * PURPOSE: Italian Language File for Solitaire * TRANSLATOR: Gabriel Ilardi + * Marco Maria Emanuele Bartucci, 2014-04-19 */ LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL @@ -18,13 +19,13 @@ BEGIN GROUPBOX "Carte", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Girane &Una", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Girane &Tre", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - GROUPBOX "Scoring", -1, 100, 7, 75, 53 + GROUPBOX "Punteggio", -1, 100, 7, 75, 53 AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 AUTOCHECKBOX "&Visualizza il tempo", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "&Barra di stato", IDC_OPT_STATUSBAR, 7, 66, 64, 10, WS_TABSTOP - AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP + AUTOCHECKBOX "&Mantieni il punteggio", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Annulla", IDCANCEL, 101, 97, 50, 14 END @@ -59,8 +60,8 @@ BEGIN IDS_SOL_QUIT "Chiudere la partita in corso?" IDS_SOL_WIN "Congratulazioni, hai vinto!!" IDS_SOL_DEAL "Nuova partita?" - IDS_SOL_SCORE "Score: %d" - IDS_SOL_TIME "Time: %d" + IDS_SOL_SCORE "Punteggio: %d" + IDS_SOL_TIME "Tempo: %d" END /* Menus */ diff --git a/reactos/dll/win32/msgina/lang/it-IT.rc b/reactos/dll/win32/msgina/lang/it-IT.rc index a672b590a4f..30a3facf970 100644 --- a/reactos/dll/win32/msgina/lang/it-IT.rc +++ b/reactos/dll/win32/msgina/lang/it-IT.rc @@ -167,7 +167,7 @@ BEGIN IDS_SHUTDOWN_LOGOFF "Disconetti ""%s""" IDS_SHUTDOWN_SHUTDOWN "Spegni" IDS_SHUTDOWN_RESTART "Riavvia" - IDS_SHUTDOWN_SLEEP "Sleep" + IDS_SHUTDOWN_SLEEP "Sospendi" IDS_SHUTDOWN_HIBERNATE "Ibernazione" /* Shut down descriptions */ IDS_SHUTDOWN_LOGOFF_DESC "Termina la sessione attuale e permette ad altri utenti di accedere al sistema." From 5c64f9b039dbfdccee360a063de208a88a5aa756 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sat, 19 Apr 2014 14:29:27 +0000 Subject: [PATCH 376/419] [TASKMGR][MSGINA] msgina and taskmgr: correction Russian translation Patch by petr akhlamov. Thanks a lot! CORE-7996 #resolve svn path=/trunk/; revision=62804 --- reactos/base/applications/taskmgr/lang/ru-RU.rc | 2 +- reactos/dll/win32/msgina/lang/ru-RU.rc | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/reactos/base/applications/taskmgr/lang/ru-RU.rc b/reactos/base/applications/taskmgr/lang/ru-RU.rc index c24544221c8..476189cf438 100644 --- a/reactos/base/applications/taskmgr/lang/ru-RU.rc +++ b/reactos/base/applications/taskmgr/lang/ru-RU.rc @@ -111,7 +111,7 @@ IDR_PROCESS_PAGE_CONTEXT MENU BEGIN POPUP "DUMMY" BEGIN - MENUITEM "&Заверщить процесс", ID_PROCESS_PAGE_ENDPROCESS + MENUITEM "&Завершить процесс", ID_PROCESS_PAGE_ENDPROCESS MENUITEM "З&авершить дерево процессов", ID_PROCESS_PAGE_ENDPROCESSTREE MENUITEM "&Отладка", ID_PROCESS_PAGE_DEBUG MENUITEM SEPARATOR diff --git a/reactos/dll/win32/msgina/lang/ru-RU.rc b/reactos/dll/win32/msgina/lang/ru-RU.rc index dc7cea38602..da9d9756297 100644 --- a/reactos/dll/win32/msgina/lang/ru-RU.rc +++ b/reactos/dll/win32/msgina/lang/ru-RU.rc @@ -51,7 +51,7 @@ BEGIN PUSHBUTTON "Заблокировать", IDC_LOCK, 7, 135, 86, 14 PUSHBUTTON "Завершение сеанса", IDC_LOGOFF, 102, 135, 86, 14 PUSHBUTTON "Выключение", IDC_SHUTDOWN, 198, 135, 70, 14 - PUSHBUTTON "Изменение пароля", IDC_CHANGEPWD, 7, 155, 86, 14 + PUSHBUTTON "Смена пароля", IDC_CHANGEPWD, 7, 155, 86, 14 PUSHBUTTON "Диспетчер задач", IDC_TASKMGR, 102, 154, 86, 14 PUSHBUTTON "Отмена", IDCANCEL, 198, 154, 70, 14 END @@ -87,7 +87,7 @@ END IDD_CHANGE_PASSWORD DIALOGEX 0, 0, 275, 166 STYLE NOT WS_VISIBLE | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_CAPTION | WS_DLGFRAME | WS_POPUP -CAPTION "Изменение пароля" +CAPTION "Смена пароля" FONT 8, "MS Shell Dlg", 400, 0, 1 BEGIN CONTROL IDI_ROSLOGO, IDC_ROSLOGO, "Static", SS_BITMAP, 0, 0, 275, 54 @@ -142,14 +142,14 @@ BEGIN IDS_LOGONMSG "Вы вошли в систему как %s." IDS_LOGONDATE "Дата входа: %s %s" IDS_COMPUTERLOCKED "Компьютер заблокирован" - IDS_LOCKEDWRONGPASSWORD "Неверный пароль. Пожалуйста, введите пароль еще раз. Символы в Пароли вводятся с учетом регистра." + IDS_LOCKEDWRONGPASSWORD "Неверный пароль. Пожалуйста, введите пароль еще раз. Символы в пароле вводятся с учетом регистра." IDS_LOCKEDWRONGUSER "This computer is locked. Only %s\\%s or an Administrator can unlock this computer." - IDS_CHANGEPWDTITLE "Изменить пароль" + IDS_CHANGEPWDTITLE "Сменить пароль" IDS_NONMATCHINGPASSWORDS "Введенные пароли несовпадают. Введите пароль в оба поля" IDS_PASSWORDCHANGED "Ваш пароль был изменен." IDS_LOGONTITLE "Logon Message" - IDS_LOGONWRONGUSERORPWD "Системе не удается войти в. Убедитесь в том, ваше имя пользователя и домен верны, то введите пароль еще раз. Символы в Пароли вводятся с учетом регистра" - IDS_LOGONUSERDISABLED "Ваш аккаунт был отключен. Пожалуйста, обратитесь к системному администратору." + IDS_LOGONWRONGUSERORPWD "Системе не удается войти в. Проверьте правильность имени пользователя и домена и повторите ввод. Пароли вводятся с учетом регистра" + IDS_LOGONUSERDISABLED "Ваш аккаунт отключен. Пожалуйста, обратитесь к системному администратору." IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." IDS_PASSWORDEXPIRED "Your password has expired and must be changed." END @@ -164,8 +164,8 @@ BEGIN IDS_SHUTDOWN_HIBERNATE "Гибернация" /* Shut down descriptions */ IDS_SHUTDOWN_LOGOFF_DESC "Завершает текущий сеанс и позволяет другим пользователям войти в систему." - IDS_SHUTDOWN_SHUTDOWN_DESC "Завершает текущий сеанс и отключает систему так что можно спокойно выключить питание." + IDS_SHUTDOWN_SHUTDOWN_DESC "Закрывает все программы, завершает работу ReactOS и выключает компьютер." IDS_SHUTDOWN_RESTART_DESC "Завершает текущий сеанс и перезагружает систему." IDS_SHUTDOWN_SLEEP_DESC "Переводит систему в режим ожидания." - IDS_SHUTDOWN_HIBERNATE_DESC "Сохраняет текущий сеанс и выключит компьютер." + IDS_SHUTDOWN_HIBERNATE_DESC "Сохраняет текущий сеанс и выключает компьютер." END From 52610eed263e5f7d02b0fd0e68bf16f7f6c0b646 Mon Sep 17 00:00:00 2001 From: Daniel Reimer Date: Sat, 19 Apr 2014 14:46:57 +0000 Subject: [PATCH 377/419] Rapps - Polish Translation for multiple description files + a small translation in the program itself. By wojo664 Rapps entries were integrated into the previous update. SF mirrors were kept as they were instead of using the freesoft.ru ones of the patch. CORE-7882 #resolve #comment Committed. Thx for helping. svn path=/trunk/; revision=62805 --- reactos/base/applications/rapps/lang/pl-PL.rc | 8 ++++---- reactos/base/applications/rapps/rapps/alreader.txt | 8 +++++--- reactos/base/applications/rapps/rapps/ants.txt | 6 +++++- reactos/base/applications/rapps/rapps/bochs.txt | 4 ++++ reactos/base/applications/rapps/rapps/boswars.txt | 7 ++++++- reactos/base/applications/rapps/rapps/chromium.txt | 5 ++++- .../base/applications/rapps/rapps/dvdwritenow.txt | 8 ++++++-- reactos/base/applications/rapps/rapps/fira.txt | 9 +++++++-- .../base/applications/rapps/rapps/globulation2.txt | 5 ++++- reactos/base/applications/rapps/rapps/hover.txt | 6 +++++- reactos/base/applications/rapps/rapps/hxd.txt | 4 ++++ reactos/base/applications/rapps/rapps/indiftpd.txt | 4 ++++ reactos/base/applications/rapps/rapps/kyodai.txt | 5 ++++- .../base/applications/rapps/rapps/lazaruside.txt | 6 +++++- reactos/base/applications/rapps/rapps/mpxplay.txt | 7 +++++-- .../base/applications/rapps/rapps/opencodecs.txt | 4 ++++ reactos/base/applications/rapps/rapps/pengupop.txt | 5 ++++- .../base/applications/rapps/rapps/photofiltre.txt | 6 +++++- reactos/base/applications/rapps/rapps/pingus.txt | 6 +++++- reactos/base/applications/rapps/rapps/pspad.txt | 4 ++++ reactos/base/applications/rapps/rapps/ptanks.txt | 7 ++++++- reactos/base/applications/rapps/rapps/qb64sdl.txt | 7 +++++-- reactos/base/applications/rapps/rapps/qmmp.txt | 6 +++++- reactos/base/applications/rapps/rapps/reshack.txt | 7 ++++++- reactos/base/applications/rapps/rapps/rocks.txt | 6 +++++- reactos/base/applications/rapps/rapps/stamina.txt | 14 +++++++++----- reactos/base/applications/rapps/rapps/superdxb.txt | 8 ++++++-- reactos/base/applications/rapps/rapps/supertux.txt | 5 ++++- reactos/base/applications/rapps/rapps/zaz.txt | 4 ++++ 29 files changed, 144 insertions(+), 37 deletions(-) diff --git a/reactos/base/applications/rapps/lang/pl-PL.rc b/reactos/base/applications/rapps/lang/pl-PL.rc index b60efaf3b64..397af7fba16 100644 --- a/reactos/base/applications/rapps/lang/pl-PL.rc +++ b/reactos/base/applications/rapps/lang/pl-PL.rc @@ -1,4 +1,4 @@ -/* +/* * Translated by Caemyr - Olaf Siejka (Aug, 2009) * Use ReactOS forum PM or IRC to contact me * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (Apr, 2011) @@ -26,7 +26,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "O&dśwież", ID_REFRESH MENUITEM SEPARATOR - MENUITEM "Update Da&tabase", ID_RESETDB + MENUITEM "Aktualizuj ba&zę pogramów", ID_RESETDB END POPUP "Pomoc" BEGIN @@ -56,7 +56,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Odśwież", ID_REFRESH MENUITEM SEPARATOR - MENUITEM "Update Da&tabase", ID_RESETDB + MENUITEM "Aktualizuj ba&zę pogramów", ID_RESETDB END END @@ -71,7 +71,7 @@ BEGIN AUTOCHECKBOX "Zap&isuj dziennik instalacji i usuwania programów", IDC_LOG_ENABLED, 15, 46, 219, 12 GROUPBOX "Pobieranie", -1, 4, 65, 240, 51 LTEXT "Katalog dla pobranych plików:", -1, 16, 75, 100, 9 - EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP | ES_AUTOHSCROLL + EDITTEXT IDC_DOWNLOAD_DIR_EDIT, 15, 86, 166, 12, WS_CHILD | WS_VISIBLE | WS_GROUP PUSHBUTTON "&Wybierz", IDC_CHOOSE, 187, 85, 50, 14 AUTOCHECKBOX "&Usuń instalatory programów po ich zainstalowaniu", IDC_DEL_AFTER_INSTALL, 16, 100, 218, 12 PUSHBUTTON "Domyślne", IDC_DEFAULT_SETTINGS, 8, 124, 60, 14 diff --git a/reactos/base/applications/rapps/rapps/alreader.txt b/reactos/base/applications/rapps/rapps/alreader.txt index e50dc1f338d..4dd4561fcff 100644 --- a/reactos/base/applications/rapps/rapps/alreader.txt +++ b/reactos/base/applications/rapps/rapps/alreader.txt @@ -2,8 +2,7 @@ [Section] Name = AlReader -Version = 110502 -Description = A FB2 eBook Reader. +Description = A FB2 eBook Reader. Read formats: fb2, fbz, txt, epub, html, doc, docx, odt, rtf, mobi, prc (PalmDoc), tcr. Supported ZIP and GZ archives. URLSite = http://www.alreader.com Size = 4.6 MB Category = 6 @@ -11,11 +10,14 @@ URLDownload = http://svn.reactos.org/packages/AlReader2Setup.exe CDPath = none [Section.0407] -Description = Ein FB2 eBook Reader. +Description = Ein FB2 eBook Reader. Unterstützung für folgende Formate: fb2, fbz, txt, epub, html, doc, docx, odt, rtf, mobi, prc (PalmDoc), tcr. ZIP und GZ Archive werden ebenfalls unterstützt. [Section.0410] Description = Un eBook Reader. +[Section.0415] +Description = Czytnik eBooków. Obsługuje formaty: fb2, fbz, txt, epub, html, doc, docx, odt, rtf, mobi, prc (PalmDoc), tcr. Obsługiwane są także pliki w archivach ZIP i GZ. + [Section.0418] Description = Cititor de cărți electronice în format FB2. Size = 4,6 Mo diff --git a/reactos/base/applications/rapps/rapps/ants.txt b/reactos/base/applications/rapps/rapps/ants.txt index 9710f3f604f..629b5484da0 100644 --- a/reactos/base/applications/rapps/rapps/ants.txt +++ b/reactos/base/applications/rapps/rapps/ants.txt @@ -1,5 +1,5 @@ ; UTF-8 - +; PL translation by wojo664 [Section] Name = Ants Version = N/A @@ -14,12 +14,16 @@ CDPath = none [Section.0407] Description = Ein strategisches Kartenspiel. Sie bauen Ihr eigenes Schloss und versuchen, die gegnerische Burg zu zerstören. Sie benötigen ein ZIP-Programm, um es zu installieren. +[Section.0415] +Description = Karciana gra strategiczna. Budujesz zamek, przy okazji próbujesz zniszczyć zamek wroga. Wymaga programu archiwizującego do wypakowania. + [Section.0418] Licence = Gratuită Description = Un joc strategic de cărți. Jucătorul își va construi un castel și încerca să distrugă castelele oponenților. Este necesar un utilitar de dezarhivare ZIP pentru a instala acest joc. Size = 632 ko [Section.041f] +Name = Karıncalar Licence = Ücretsiz Description = Bir kartlarla izlem oyunu. Kalenizi bitirmeye veyâ rakip kaleyi yıkmaya çalışın. Yazılımı kurmak için ZIP biçiminde çıkartma yeteneği olan bir yazılım gerekir. Size = 632 KB diff --git a/reactos/base/applications/rapps/rapps/bochs.txt b/reactos/base/applications/rapps/rapps/bochs.txt index 4073d999e42..4707c75bbca 100644 --- a/reactos/base/applications/rapps/rapps/bochs.txt +++ b/reactos/base/applications/rapps/rapps/bochs.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = Bochs @@ -14,6 +15,9 @@ CDPath = none [Section.0407] Description = Bochs ist ein portabler Open-Source IA-32 (x86) PC-Emulator geschrieben in C++, der auf den meisten populären Plattformen läuft. +[Section.0415] +Description = Bochs to przenośny (portable) emulator platformy IA-32 (x86) napisany w C++, działa na wielu popularnych platformach sprzętowych. + [Section.0418] Description = Bochs este un emulator PC (x86) cu surse publice și portabilitate înaltă, scris în C++, compatibil cu majoritatea platformelor. Size = 4,7 Mo diff --git a/reactos/base/applications/rapps/rapps/boswars.txt b/reactos/base/applications/rapps/rapps/boswars.txt index 9985088fb71..dd3435ea7aa 100644 --- a/reactos/base/applications/rapps/rapps/boswars.txt +++ b/reactos/base/applications/rapps/rapps/boswars.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = Bos Wars @@ -17,10 +18,14 @@ Description = Bos Wars ist ein futuristisches Echtzeitstrategiespiel. Um das Spi [Section.0410] Description = Bos Wars è un gioco futuristico di strategia in tempo reale. Per iniziare il gioco, installare Microsoft Visual C + + 2008 runtime. +[Section.0415] +Description = Bos Wars to futurystyczna gra strategiczna czasu rzeczywistego. Aby uruchomić grę, zainstaluj Microsoft Visual C++ 2008 runtime. + [Section.0418] Description = Bos Wars e o strategie în timp real, futuristă. Pentru a porni jocul, instalați Microsoft Visual C++ 2008 Runtime. Size = 62,3 Mo [Section.041f] -Description = Bos Wars, gelecekçi ve gerçek zamanlı bir izlem oyunudur. Oyunu başlatmak için Microsoft Visual C++ 2008 Yürütücüsü'nü kurunuz. +Name = Bos Savaşları +Description = Bos Savaşları, gelecekçi ve gerçek zamanlı bir izlem oyunudur. Oyunu başlatmak için Mikroyazılım Basarî C++ 2008 Yürütücüsü'nü kurunuz. Size = 62,3 MB diff --git a/reactos/base/applications/rapps/rapps/chromium.txt b/reactos/base/applications/rapps/rapps/chromium.txt index 4caa26e13f6..1ebd82226a8 100644 --- a/reactos/base/applications/rapps/rapps/chromium.txt +++ b/reactos/base/applications/rapps/rapps/chromium.txt @@ -1,5 +1,5 @@ ; UTF-8 - +; PL translation by wojo664 [Section] Name = Chromium B.S.U. Version = 0.9.13.2 @@ -17,6 +17,9 @@ Description = Chromium B.S.U. ist ein Arcade-Style, Top-Scrolling Space Shooter. [Section.0410] Description = Cromo B.S.U. è sparatutto spaziale. +[Section.0415] +Description = Chromium B.S.U to gra w stylu Arcade, z widokiem z góry. + [Section.0418] Description = Chromium B.S.U. este un joc de vânătoare în spațiul cosmic (arcadă 2D). Size = 2,3 Mo diff --git a/reactos/base/applications/rapps/rapps/dvdwritenow.txt b/reactos/base/applications/rapps/rapps/dvdwritenow.txt index 9d9ce9898d2..c403f526041 100644 --- a/reactos/base/applications/rapps/rapps/dvdwritenow.txt +++ b/reactos/base/applications/rapps/rapps/dvdwritenow.txt @@ -1,5 +1,5 @@ ; UTF-8 - +; PL translation by wojo664 [Section] Name = DVD Write Now Version = 1.5.12 sp2 @@ -17,6 +17,9 @@ Description = Eine kostenlose CD/DVD Brennsoftware. Sobald es installiert ist, k [Section.0410] Description = Un software di masterizzazione CD/DVD diretto e gratuito. Una volta installato, è possibile utilizzare il CD/DVD RW da flash USB o dischi rigidi rimovibili. Insieme a questo è possibile scrivere CD/DVD RW registrati con filesystem UDF. È anche possibile leggere i dischi UDF creati con altri software. (Microsoft DVD-ROM, dischi RW registrati con InCD Ahead). Il programma ha bisogno di un programma di decompressione ZIP per installarlo. +[Section.0415] +Description = Darmowe oprogramowanie do nagrywania CD/DVD. Po zainstalowaniu, możesz używać płyty CD RW i DVD RW tak, jak dyski przenośne / pendrive. Możesz także zapisywać (i odczytywać dyski utworzone przez inne programy) dane do dysków RW zapisanych w systemie UDF. Wymaga programu archiwizującego do wypakowania i instalacji. + [Section.0418] Licence = Gratuită Description = Un program de înscriere CD/DVD directă. Odată instalat, puteți utiliza CD/DVD ca memorie USB sau disc dur detașabil. Pe lângă aceasta, veți putea scrie pe CD/DVD inscripționate cu sistem de fișiere UDF. Se pot de asemenea citi discuri UDF create cu alte programe. (Microsoft DVD-ROM, discuri RW inscripționate cu Ahead InCD). Este necesar un program de decompresie ZIP pentru a-l instala. @@ -27,6 +30,7 @@ Description = DVD Write Now - бесплатная программа для п URLSite = http://dwn.alter.org.ua/ru/ [Section.041f] +Name = DVD Şimdi Yaz Licence = Ücretsiz -Description = Ücretsiz bir doğrudan CD/DVD kaydedicisi. Kurulur kurulmaz CD/DVD RW'leri çıkartılabilir disk olarak kullanabilirsiniz. Bununla birlikte CD/DVD RW'leri UDF kütük dizgesiyle kaydedebilirsiniz. Ayrıca, Microsoft DVD−ROM'ları, Ahead InCD ile kaydedilen RW diskleri gibi diğer yazılımlarla oluşturulan UDF diskleri okutabilirsiniz. Yazılımı kurmak için ZIP biçiminde çıkartma yeteneği olan bir yazılım gerekir. +Description = Ücretsiz bir doğrudan CD/DVD kaydedicisi. Kurulur kurulmaz CD/DVD RW'leri çıkartılabilir disk olarak kullanabilirsiniz. Bununla birlikte CD/DVD RW'leri UDF kütük dizgesiyle kaydedebilirsiniz. Ayrıca, Mikroyazılım DVD−ROM'ları, Ahead InCD ile kaydedilen RW diskleri gibi diğer yazılımlarla oluşturulan UDF diskleri okutabilirsiniz. Yazılımı kurmak için ZIP biçiminde çıkartma yeteneği olan bir yazılım gerekir. Size = 1,2 MB diff --git a/reactos/base/applications/rapps/rapps/fira.txt b/reactos/base/applications/rapps/rapps/fira.txt index de6649f3d71..b27dee4a663 100644 --- a/reactos/base/applications/rapps/rapps/fira.txt +++ b/reactos/base/applications/rapps/rapps/fira.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = Mozilla Fira Font @@ -15,13 +16,17 @@ CDPath = none Licence = Unbekannt Description = Mozilla Fira Font Pack, Beinhaltet Mono und Sans Schriften. Bitte in den "ReactOS" Ordner entpacken. +[Section.0415] +Description = Pakiet czcionek Mozilla Fira Font, zawiera czcionki Mono i Sans. Wypakuj do folderu "ReactOS". +Licence = Nieznana + [Section.0418] Licence = Nespecificată Description = Pachetul Mozilla Fira Font, include fonturile Mono și Sans. Dezarhivați în dosarul „ReactOS”. Size = 543 ko [Section.041f] -Name = Mozilla Fira Yazı Tipi +Name = Mozilla Fira Yazı Türü Licence = Bilinmiyor -Description = Mozilla Fira Yazı Tipi Paketi, Mono ve Sans yazı tiplerini kapsar. ReactOS dizinine çıkartınız. +Description = Mozilla Fira Yazı Türü Paketi, Mono ve Sans yazı türlerini kapsar. ReactOS'un "Fonts" dizinine çıkartınız. Size = 543 KB diff --git a/reactos/base/applications/rapps/rapps/globulation2.txt b/reactos/base/applications/rapps/rapps/globulation2.txt index 1beb181b9d8..4ecca2c89ca 100644 --- a/reactos/base/applications/rapps/rapps/globulation2.txt +++ b/reactos/base/applications/rapps/rapps/globulation2.txt @@ -1,5 +1,5 @@ ; UTF-8 - +; PL translation by wojo664 [Section] Name = Globulation2 Version = 0.9.4.4 @@ -17,6 +17,9 @@ Description = Globulation 2 ist ein Echtzeitstrategiespiel. Das Spiel vereinfach [Section.0410] Description = Globulation 2 è un gioco di strategia in tempo reale. +[Section.0415] +Description = Globulation 2 to gra strategiczna czasu rzeczywistego. Gra minimalizuje zarządzanie automatycznie przydzielając zadania jednostkom. + [Section.0418] Description = Globulation 2 este un joc de strategie în timp real. Jocul minimizează microgestiunea prin alocarea automată de sarcini unităților. Size = 13,5 Mo diff --git a/reactos/base/applications/rapps/rapps/hover.txt b/reactos/base/applications/rapps/rapps/hover.txt index 526b6f66960..d2048ceb54e 100644 --- a/reactos/base/applications/rapps/rapps/hover.txt +++ b/reactos/base/applications/rapps/rapps/hover.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = Hover! @@ -16,10 +17,13 @@ Description = Das klassische Hover CTF Spiel, dass auf der Windows 95 CD zu find [Section.0410] Description = Il classico gioco Hover CTF che trovate sul CD di Windows 95. +[Section.0415] +Description = Klasyczna gra Hover CTF znaleziona na dysku Windows 95 + [Section.0418] Description = Jocul clasic Hover CTF, care se găsea pe CD-ul Windows 95. Size = 6,2 Mo [Section.041f] -Description = Windows 95 CD'sinde bulunan bir bayrak kapmaca oyunu. +Description = Pencereler 95 CD'sinde bulunan bir bayrak kapmaca oyunu. Size = 6,2 MB diff --git a/reactos/base/applications/rapps/rapps/hxd.txt b/reactos/base/applications/rapps/rapps/hxd.txt index f98ce350f0b..9e54d7a5c43 100644 --- a/reactos/base/applications/rapps/rapps/hxd.txt +++ b/reactos/base/applications/rapps/rapps/hxd.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = HxD @@ -17,6 +18,9 @@ Size = 854 kB URLSite = http://mh-nexus.de/de/ URLDownload = http://mh-nexus.de/downloads/HxDSetupDE.zip +[Section.0415] +Description = Dobry edytor Hex. Do wypakowania pliku potrzebny jest program archiwizujący np. 7-Zip. + [Section.0418] Licence = Gratuită Description = Un bun editor hexazecimal. E necesar un utilitar de dezarhivare de tip ZIP. diff --git a/reactos/base/applications/rapps/rapps/indiftpd.txt b/reactos/base/applications/rapps/rapps/indiftpd.txt index a53d9b78773..2f71b9a9570 100644 --- a/reactos/base/applications/rapps/rapps/indiftpd.txt +++ b/reactos/base/applications/rapps/rapps/indiftpd.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = IndiFTPD @@ -17,6 +18,9 @@ Description = IndiFTPD ist ein eigenständiger FTP Server in einer einzigen Anwe [Section.0410] Description = IndiFTPD è un server FTP autonomo che funziona come un unico eseguibile. È stato progettato per le situazioni quando un utente non vuole installare / configurare un server sul sistema (o non ha il permesso di farlo), e vuole ottenere rapidamente un server che esegue. +[Section.0415] +Description = IndiFTPD to samodzielny serwer FTP składający sie z jednego pliku wykonywalnego. Zaprojektowany z myślą o użytkownikach, którzy nie chcą instalować / konfigurować serwera w systemie (lub nie mają uprawnień) i chcą szybko uruchomić serwer FTP. + [Section.0418] Description = IndiFTPD este un server FTP de sine stătător, într-un singur executabil. A fost gândit pentru situațiile în care un utilizator nu dorește instalarea/configurarea unui server în sistem (sau nu deține privelegiile necesare) însă dorește obținerea rapidă a unui server funcțional. Size = 556 ko diff --git a/reactos/base/applications/rapps/rapps/kyodai.txt b/reactos/base/applications/rapps/rapps/kyodai.txt index 9779a6508f9..9b205d52dab 100644 --- a/reactos/base/applications/rapps/rapps/kyodai.txt +++ b/reactos/base/applications/rapps/rapps/kyodai.txt @@ -1,5 +1,5 @@ ; UTF-8 - +; PL translation by wojo664 [Section] Name = Kyodai Mahjongg Version = 21.42 @@ -16,6 +16,9 @@ Description = Eines der besten Mahjongg Solitaire Spiele im Netz. [Section.0410] Description = Uno dei migliori giochi di Mahjongg Solitaire. +[Section.0415] +Description = Jedna z najlepszych gier Mahjongg Solitaire. + [Section.0418] Licence = Versiune de evaluare Description = Unul dintre cele mai bune jocuri de pasiență Mahjongg. diff --git a/reactos/base/applications/rapps/rapps/lazaruside.txt b/reactos/base/applications/rapps/rapps/lazaruside.txt index d38bc5aefaf..903f58b2e73 100644 --- a/reactos/base/applications/rapps/rapps/lazaruside.txt +++ b/reactos/base/applications/rapps/rapps/lazaruside.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = Lazarus @@ -14,6 +15,9 @@ CDPath = none [Section.0407] Description = Eine plattformunabhängige, integrierte Entwicklungsumgebung (IDE), mit der man grafische (GUI) und nicht-grafische Pascal-Programme erstellen kann. Es verwendet den Free Pascal Compiler um die Programme zu erzeugen. +[Section.0415] +Description = Wielopratformowe zintegrowane środowisko programistyczne (IDE) które pozwala na tworzenie graficznych (GUI) i niegraficznych (działających w konsoli) programów obiektowych w języku Pascal. Program używa darmowego kompilatora Free Pascal. + [Section.0410] Description = Un ambiente di sviluppo integrato (IDE) cross-platform che consente di creare interfacce grafiche (GUI) e programmi non visivi Object Pascal, e utilizza il compilatore Free Pascal per generare l'eseguibile. @@ -24,4 +28,4 @@ Size = 112 Mo [Section.041f] Licence = Değiştirilmiş LGPL, GPL -Description = Basarî ve basarî olmayan Nesne Paskal izlenceleri oluşturmayı sağlayan, Özgür Paskal derleyicisini kullanarak çalıştırabilir kütük oluşturan bir çapraz platform tümleşik geliştirme ortamı. +Description = Basarî ve basarî olmayan Nesne Paskal çizeylemleri oluşturmayı sağlayan, Özgür Paskal derleyicisini kullanarak çalıştırabilir kütük oluşturan bir çapraz platform tümleşik geliştirme ortamı. diff --git a/reactos/base/applications/rapps/rapps/mpxplay.txt b/reactos/base/applications/rapps/rapps/mpxplay.txt index 1b785603dc4..6246d0a89d4 100644 --- a/reactos/base/applications/rapps/rapps/mpxplay.txt +++ b/reactos/base/applications/rapps/rapps/mpxplay.txt @@ -1,5 +1,5 @@ ; UTF-8 - +; PL translation by wojo664 [Section] Name = Mpxplay Version = 1.60b @@ -14,6 +14,9 @@ CDPath = none [Section.0407] Description = Mpxplay ist ein konsolenbasierter 32-bit Audio Player für Windows. Zum extrahieren wird 7-Zip oder ein ähnliches Tool benötigt. +[Section.0415] +Description = Mpxplay to 32 bitowy odtwarzacz audio (działający w konsoli) dla Windows. Wymaga programu archiwizującego (np. 7-Zip) do wypakowania. + [Section.0418] Description = Mpxplay este un lector audio de tip consolă, pe 32-biți pentru Windows. E necesar un utilitar de dezarhivare de tip ZIP. Size = 520 ko @@ -22,5 +25,5 @@ Size = 520 ko Description = Mpxplay - 32-разрядный консольный аудиоплеер для Windows. Вам нужен 7-Zip или подобная утилита для его распаковки. [Section.041f] -Description = Mpxplay, Windows için 32 bitlik, konsolluk bir ses oynatıcısıdır. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. +Description = Mpxplay, Pencereler için 32 ikillik, konsolluk bir ses oynatıcısıdır. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. Size = 520 KB diff --git a/reactos/base/applications/rapps/rapps/opencodecs.txt b/reactos/base/applications/rapps/rapps/opencodecs.txt index d44e219e61b..9dbb401462d 100644 --- a/reactos/base/applications/rapps/rapps/opencodecs.txt +++ b/reactos/base/applications/rapps/rapps/opencodecs.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL trans by wojo664 [Section] Name = xiph.org OpenCodecs @@ -17,6 +18,9 @@ Description = DirectShow Filter für Ogg Vorbis, Speex, Theora, FLAC, und WebM D [Section.0410] Description = I filtri DirectShow per la Ogg Vorbis, Speex, Theora, FLAC e formati di file WebM. +[Section.0415] +Description = Filtry DirectShow dla Ogg Vorbis, Speex, Theora, FLAC, i plików w formacie WebM. + [Section.0418] Description = Filtrele DirectShow pentru formatele de fișiere Ogg Vorbis, Speex, Theora, FLAC și WebM. Size = 2,53 Mo diff --git a/reactos/base/applications/rapps/rapps/pengupop.txt b/reactos/base/applications/rapps/rapps/pengupop.txt index f69ab6eb7d3..9804859b834 100644 --- a/reactos/base/applications/rapps/rapps/pengupop.txt +++ b/reactos/base/applications/rapps/rapps/pengupop.txt @@ -1,5 +1,5 @@ ; UTF-8 - +; PL translation by wojo664 [Section] Name = Pengupop Version = 2.2.3 @@ -16,6 +16,9 @@ Description = Das Ziel des Spiels ist es farbige Orbs ins Spielfeld zu feuern, s [Section.0410] Description = Lo scopo di questo gioco è quello di sparare sfere colorate nel vostro campo di gioco, in modo da formare gruppi di tre o più. +[Section.0415] +Description = Celem tej gry jest strzelanie kolorowymi kulkami tak, aby utworzyć rzędy trzech lub więcej kulek w tym samym kolorze. + [Section.0418] Description = Scopul acestui joc este de a arunca globuri colorate în propriul teren pentru a forma grupuri de câte trei sau mai multe. Size = 384 ko diff --git a/reactos/base/applications/rapps/rapps/photofiltre.txt b/reactos/base/applications/rapps/rapps/photofiltre.txt index 2ed9682f28f..174a39674e8 100644 --- a/reactos/base/applications/rapps/rapps/photofiltre.txt +++ b/reactos/base/applications/rapps/rapps/photofiltre.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = PhotoFiltre 7 @@ -14,6 +15,9 @@ CDPath = none [Section.0407] Description = Version mit Layers, aber eingeschänkter als die Studio-X Version. PhotoFiltre Studio ist ein komplettes Bildretuschier-Programm. +[Section.0415] +Description = Ta wersja obsługuje warstwy, ale ma większe ograniczenia od Studio X. PhotoFiltre Studio to program do retuszu zdjęć. + [Section.0418] Licence = Gratuită Description = PhotoFiltre Studio este o aplicație completă de retușare a imaginilor. @@ -21,5 +25,5 @@ Size = 4,99 Mo [Section.041f] Licence = Ücretsiz -Description = Bu sürüm, katmanlarla gelmektedir ancak Studio X sürümünden daha kısıtlıdır. PhotoFiltre Studio, eksiksiz bir resim düzeltme yazılımıdır. +Description = Bu sürüm, katmanlarla gelmektedir ancak Stüdyo X sürümünden daha kısıtlıdır. PhotoFiltre Stüdyo, eksiksiz bir resim düzeltme yazılımıdır. Size = 4,99 MB diff --git a/reactos/base/applications/rapps/rapps/pingus.txt b/reactos/base/applications/rapps/rapps/pingus.txt index af175849314..6e4208a9162 100644 --- a/reactos/base/applications/rapps/rapps/pingus.txt +++ b/reactos/base/applications/rapps/rapps/pingus.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = Pingus @@ -17,10 +18,13 @@ Description = Pingus ist ein freies Lemings-ähnliches Puzzle Spiel. [Section.0410] Description = Pingus è un gioco gratuito simile a Lemmings. +[Section.0415] +Description = Pingus to darmowa gra logiczna podobna do gry Lemmings + [Section.0418] Description = Pingus este un joc-enigmă asemănător cu Lemmings. Size = 16,0 Mo [Section.041f] -Description = Pingus, ücretsiz, Lemmings gibi bir bulmaca oyunudur. +Description = Pingus, ücretsiz, Yaban Sıçanları gibi bir bulmaca oyunudur. Size = 16,0 MB diff --git a/reactos/base/applications/rapps/rapps/pspad.txt b/reactos/base/applications/rapps/rapps/pspad.txt index 82588542615..1f02aa24c28 100644 --- a/reactos/base/applications/rapps/rapps/pspad.txt +++ b/reactos/base/applications/rapps/rapps/pspad.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = PSPad @@ -24,6 +25,9 @@ Size = 4,46 Mo [Section.0410] Description = Un editor di testo. +Section.0415] +Description = Edytor tekstu. + [Section.0413] Description = Een teksteditor. diff --git a/reactos/base/applications/rapps/rapps/ptanks.txt b/reactos/base/applications/rapps/rapps/ptanks.txt index ef8bfaa0063..220317a01fa 100644 --- a/reactos/base/applications/rapps/rapps/ptanks.txt +++ b/reactos/base/applications/rapps/rapps/ptanks.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = Pocket Tanks @@ -14,12 +15,16 @@ CDPath = none [Section.0407] Description = Das schnellste Artillerie-Spiel, das Sie jemals gespielt haben. +[Section.0415] +Description = Szybka gra artyleryjska + [Section.0418] Licence = Versiune de evaluare Description = Cel mai rapid joc de artilerie pe care-l veți juca vreodată. Size = 2,86 Mo [Section.041f] +Name = Küçük Tanklar Licence = Kısıtlı -Description = Bu güne dek oynadığınız en hızlı topçu oyunu. +Description = Bu güne kadar oynadığınız en hızlı topçu oyunu. Size = 2,86 MB diff --git a/reactos/base/applications/rapps/rapps/qb64sdl.txt b/reactos/base/applications/rapps/rapps/qb64sdl.txt index 6d96cb35dc0..ef97238df67 100644 --- a/reactos/base/applications/rapps/rapps/qb64sdl.txt +++ b/reactos/base/applications/rapps/rapps/qb64sdl.txt @@ -1,5 +1,5 @@ ; UTF-8 - +; PL translation by wojo664 [Section] Name = QB64 (SDL version) Version = 0.980 @@ -14,6 +14,9 @@ CDPath = none [Section.0407] Description = QB64 ist ein Self-Hosting BASIC-Compiler für Microsoft Windows, Linux und Mac OS X, entwickelt, um mit Microsoft QBasic und Microsoft QuickBASIC kompatibel zu sein. Sie müssen 7-Zip oder ein ähnliches Dienstprogramm installiert haben, um es zu extrahieren. +[Section.0415] +Description = QB64 to kompilator BASIC zdolny do kompilacji własnego kodu źródłowego. Działa w systemach Windows, Linux i Mac OS X. Jest kompatybilny z Microsoft QBasic i QuickBASIC. Wymaga programu archiwizującego do wypakowania. + [Section.0418] Licence = Gratuită Description = QB64 este un compilator BASIC auto-compilabil pentru Windows, Linux și Mac OS X, conceput pentru a fi compatibil cu Microsoft QBasic și Microsoft QuickBASIC. Este necesar un utilitar de derarhivare de tip ZIP. @@ -22,5 +25,5 @@ Size = 39,0 Mo [Section.041f] Name = QB64 (SDL Sürümü) Licence = Ücretsiz -Description = QB64; Microsoft Windows, Linux ve Mac OS X için yapılmış, Microsoft QBasic ve Microsoft QuickBASIC ile uyumlu olarak tasarlanan, kendi kendini derleyen bir BASIC derleyicisidir. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. +Description = QB64; Mikroyazılım Pencereler, Linux ve Mac OS X için yapılmış, Mikroyazılım QBasic ve Mikroyazılım QuickBASIC ile uyumlu olarak tasarlanan, kendi kendini derleyen bir BASIC derleyicisidir. Bunu çıkartmak için 7-Zip ya da 7-Zip benzeri bir yazılım kullanmanız gerekir. Size = 39,0 MB diff --git a/reactos/base/applications/rapps/rapps/qmmp.txt b/reactos/base/applications/rapps/rapps/qmmp.txt index 465f29cda7c..a666c7261c6 100644 --- a/reactos/base/applications/rapps/rapps/qmmp.txt +++ b/reactos/base/applications/rapps/rapps/qmmp.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = Qmmp (Qt-based Multimedia Player) @@ -14,6 +15,9 @@ CDPath = none [Section.0407] Description = Qmmp ist ein Audio-Player, der mit Hilfe der Qt Bibliothek geschrieben wurde. Die Benutzeroberfläche ist ähnlich zu WinAMP oder XMMS. Alternative Benutzeroberflächen sind ebenfalls verfügbar. +[Section.0415] +Description = Gmmp to odtwarzacz audio, napisany z pomocą biblioteki Qt. Interfejs podobny jest do Winampa lub XMMS. Dostępnme są także dodatkowe skórki. + [Section.0418] Description = Qmmp este un lector audio, ce utilizează biblioteca QT. Interfața de utilizare e asemănătoare cu cea din WinAMP sau XMMS. De asemenea sunt disponibile interfețe de utilizare alternative. Size = 16,0 Mo @@ -22,6 +26,6 @@ Size = 16,0 Mo Description = Аудиоплеер Qmmp (Qt-based Multimedia Player). [Section.041f] -Name = Qmmp (Qt Tabanlı Çokluortam Oynatıcısı) +Name = Qt Tabanlı Çokluortam Oynatıcısı Description = Qmmp, Qt kitaplığının yardımıyla yazılan bir ses oynatıcısıdır. Kullanıcı arayüzüsü WinAMP'ınkine ve XMMS'ninkine benzer. Ayrıca değişik kullanıcı arayüzleri de vardır. Size = 16,0 MB diff --git a/reactos/base/applications/rapps/rapps/reshack.txt b/reactos/base/applications/rapps/rapps/reshack.txt index 6751dfe16c3..18e22d6455c 100644 --- a/reactos/base/applications/rapps/rapps/reshack.txt +++ b/reactos/base/applications/rapps/rapps/reshack.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = Resource Hacker @@ -14,12 +15,16 @@ CDPath = none [Section.0407] Description = Resource Hacker ist ein Freeware-Tool zum anzeigen, ändern, umbenennen, hinzufügen, löschen und extrahieren von Ressourcen in 32-Bit & 64-Bit-Windows Anwendungen und Ressourcen-Dateien (*. Res). +[Section.0415] +Description = Resource Hacker to darmowe narzędzie do podglądu, modyfikacji, zmiany nazw, dodawania, kasowania i wypakowywania zasobów w plikach wykonywalnych 32bit i 64bit, oraz w plikach zasobów (*.res). + [Section.0418] Licence = Gratuită Description = Resource Hacker este un utilitar gratuit pentru inspectarea, modificarea, redenumirea, adăugarea, ștergerea și extragerea resurselor din fișierele resursă (*.res) și fișierele executabile pe 32 și 64 de biți pentru Windows. Size = 730 ko [Section.041f] +Name = Kaynak Korsancısı Licence = Ücretsiz -Description = Resource Hacker, 32 ya da 64 bitlik Windows çaılştırabilirlerini ve .res uzantılı kaynak kütüklerindeki kaynakları görüntüleyen, değiştiren, yeniden adlandıran, ekleyen, silen ve çıkartan ücretsiz bir araçtır. +Description = Kaynak Korsancısı, 32 ya da 64 ikillik Pencereler çaılştırabilirlerini ve .res uzantılı kaynak kütüklerindeki kaynakları görüntüleyen, değiştiren, yeniden adlandıran, ekleyen, silen ve çıkartan ücretsiz bir araçtır. Size = 730 KB diff --git a/reactos/base/applications/rapps/rapps/rocks.txt b/reactos/base/applications/rapps/rapps/rocks.txt index 743a9c238ae..5e8f0b29462 100644 --- a/reactos/base/applications/rapps/rapps/rocks.txt +++ b/reactos/base/applications/rapps/rapps/rocks.txt @@ -1,4 +1,5 @@ ; UTF-8 +; PL translation by wojo664 [Section] Name = Rocks'n'Diamonds @@ -14,10 +15,13 @@ CDPath = none [Section.0407] Description = Arcade-Style Spiel für UNIX, Mac OS X, Windows und DOS in der Tradition von: "Boulder Dash" (C64), "Emerald Mine" (Amiga), "Supaplex" (Amiga / PC), "Sokoban" (PC). Sie benötigen ein ZIP-Programm, um es zu installieren. +Section.0415] +Description = Gra typu Arcade dla UNIX, Mac OS X, Windows i DOS. Bazująca na "Boulder Dash" (C64), "Emerald Mine" (Amiga), "Supaplex" (Amiga/PC), "Sokoban" (PC). Aby zainstalować te grę, potrzebny jest program archiwizujący np. 7-Zip. + [Section.0418] Description = Un joc de tip arcadă pentru UNIX, Mac OS X, Windows și DOS; respectând tradiția: "Boulder Dash" (C64), "Emerald Mine" (Amiga), "Supaplex" (Amiga/PC), "Sokoban" (PC). Size = 2,42 Mo [Section.041f] -Description = UNIX, Mac OS X, Windows ve DOS için yapılmış, atari oyun salonu türünde bir oyun. Şu gelenekleri içerir: "Boulder Dash" (C64), "Emerald Mine" (Amiga), "Supaplex" (Amiga ve PC), "Sokoban" (PC). Yazılımı kurmak için ZIP biçiminde çıkartma yeteneği olan bir yazılım gerekir. +Description = UNIX, Mac OS X, Pencereler ve DOS için yapılmış, atari oyun salonu türünde bir oyun. Şu gelenekleri içerir: "Boulder Dash" (C64), "Zümrüt Mâdeni" (Amiga), "Supaplex" (Amiga ve PC), "Sokoban" (PC). Yazılımı kurmak için ZIP biçiminde çıkartma yeteneği olan bir yazılım gerekir. Size = 2,42 MB diff --git a/reactos/base/applications/rapps/rapps/stamina.txt b/reactos/base/applications/rapps/rapps/stamina.txt index 2fd20f0c050..e2c97693eec 100644 --- a/reactos/base/applications/rapps/rapps/stamina.txt +++ b/reactos/base/applications/rapps/rapps/stamina.txt @@ -1,8 +1,9 @@ -; UTF-8 +; UTF-8 +; PL translation by wojo664 [Section] Name = Stamina 2.5 -Description = Free typing tutor. To run this program, please install the Microsoft Visual C++ 6 Redistributable Package. +Description = Free typing tutor. URLSite = http://stamina.ru Size = 4.7 MB Category = 8 @@ -10,12 +11,15 @@ URLDownload = http://stamina.ru/files/StaminaSetup.exe CDPath = none [Section.0407] -Description = Ein freies Schreiblernprogramm. Um dieses Programm nutzen zu können, müssen Sie das Microsoft Visual C++ 6 Redistributable Package installieren. +Description = Ein freies Schreiblernprogramm. + +[Section.0415] +Description = Darmowy program do nauki pisania na klawiaturze. [Section.0418] -Description = Tutor gratuit pentru dactilografiere. Pentru a putea lansa acest program, asigurați-vă că aveți instalat pachetul Microsoft Visual C++ 6 Redistributable. +Description = Tutor gratuit pentru dactilografiere. Size = 4,7 Mo [Section.041f] -Description = Ücretsiz bir düğme takımında yazma öğreticisi. Yazılımı çalıştırmk için Microsoft Visual C++ 6 Yeniden Dağıtılabilir Paket'i kurunuz. +Description = Ücretsiz bir düğme takımında yazma öğreticisi. Size = 4,7 MB diff --git a/reactos/base/applications/rapps/rapps/superdxb.txt b/reactos/base/applications/rapps/rapps/superdxb.txt index 1db2325cadc..370b20b2b0d 100644 --- a/reactos/base/applications/rapps/rapps/superdxb.txt +++ b/reactos/base/applications/rapps/rapps/superdxb.txt @@ -1,5 +1,5 @@ ; UTF-8 - +; PL translation by wojo664 [Section] Name = Super DX-Ball Version = 1.1 @@ -14,12 +14,16 @@ CDPath = none [Section.0407] Description = Super DX-Ball ist ein lebendiges und buntes Brick-Breaking-Spiel. +[Section.0415] +Description = Super DX-Ball - pełna koloru i animacji gra polegająca na zbijaniu klocków. + [Section.0418] Licence = Versiune de evaluare Description = Un joc ce implică spargerea de cărămizi. Size = 3,8 Mo [Section.041f] +Name = Süper DX-Ball Licence = Kısıtlı -Description = Super DX-Ball, canlı ve renkli bir tuğla kırma oyunudur. +Description = Süper DX-Ball, canlı ve renkli bir tuğla kırma oyunudur. Size = 3,8 MB diff --git a/reactos/base/applications/rapps/rapps/supertux.txt b/reactos/base/applications/rapps/rapps/supertux.txt index 40c119431fb..6f6cfac8db5 100644 --- a/reactos/base/applications/rapps/rapps/supertux.txt +++ b/reactos/base/applications/rapps/rapps/supertux.txt @@ -1,5 +1,5 @@ ; UTF-8 - +; PL translation by wojo664 [Section] Name = SuperTux Version = 0.1.3 @@ -17,6 +17,9 @@ Description = SuperTux ist ein zweidimensionales, freies, Open Source Plattforms [Section.0410] Description = SuperTux è un gioco open-source a 2D. +[Section.0415] +Description = SuperTux to darmowa dwu wymiarowa gra platformowa OpenSource. + [Section.0418] Description = SuperTux este un joc gratuit, cu surse publice, pe platformă bi-dimensională. Size = 7,3 Mo diff --git a/reactos/base/applications/rapps/rapps/zaz.txt b/reactos/base/applications/rapps/rapps/zaz.txt index b0c50ad2036..12604c87972 100644 --- a/reactos/base/applications/rapps/rapps/zaz.txt +++ b/reactos/base/applications/rapps/rapps/zaz.txt @@ -1,4 +1,5 @@ ; UTF-8 +;PL translation by wojo664 [Section] Name = Zaz @@ -17,6 +18,9 @@ Description = Zaz ist ein freies Arcade Action Puzzle Spiel, ein wenig wie Froze [Section.0410] Description = Zaz è un puzzle game gratuito, simile a Frozen Bubble. +[Section.0415] +Description = Zaz to darmowa gra logiczno-zręcznościowa, trochę podobna do gry Frozen Bubble + [Section.0418] Description = Zaz este un joc de acțiune de tip enigmă/arcadă, asemănător cu Frozen Bubble. Size = 21,0 Mo From 9e1f355c665efc7adae869c9fb788884a45bc270 Mon Sep 17 00:00:00 2001 From: Daniel Reimer Date: Sat, 19 Apr 2014 15:16:25 +0000 Subject: [PATCH 378/419] Adding New Apps for Rapps by Erdem Ersoy German translations, version updates and mirror fixes by me. CORE-7493 #resolve #comment Committed. Thx for helping. svn path=/trunk/; revision=62806 --- .../applications/rapps/rapps/boundaround.txt | 20 +++++++++++++++++++ .../rapps/rapps/christmasbound.txt | 20 +++++++++++++++++++ .../applications/rapps/rapps/codeblocks.txt | 20 +++++++++++++++++++ .../rapps/rapps/codeblocks_gcc.txt | 20 +++++++++++++++++++ .../rapps/rapps/codeblocks_gcc_2.txt | 20 +++++++++++++++++++ .../rapps/rapps/devcpp_mingw32.txt | 19 ++++++++++++++++++ .../rapps/rapps/devcpp_tdm_gcc_x64.txt | 19 ++++++++++++++++++ .../base/applications/rapps/rapps/peazip.txt | 19 ++++++++++++++++++ .../base/applications/rapps/rapps/snoopy.txt | 20 +++++++++++++++++++ .../applications/rapps/rapps/summerbound.txt | 20 +++++++++++++++++++ 10 files changed, 197 insertions(+) create mode 100644 reactos/base/applications/rapps/rapps/boundaround.txt create mode 100644 reactos/base/applications/rapps/rapps/christmasbound.txt create mode 100644 reactos/base/applications/rapps/rapps/codeblocks.txt create mode 100644 reactos/base/applications/rapps/rapps/codeblocks_gcc.txt create mode 100644 reactos/base/applications/rapps/rapps/codeblocks_gcc_2.txt create mode 100644 reactos/base/applications/rapps/rapps/devcpp_mingw32.txt create mode 100644 reactos/base/applications/rapps/rapps/devcpp_tdm_gcc_x64.txt create mode 100644 reactos/base/applications/rapps/rapps/peazip.txt create mode 100644 reactos/base/applications/rapps/rapps/snoopy.txt create mode 100644 reactos/base/applications/rapps/rapps/summerbound.txt diff --git a/reactos/base/applications/rapps/rapps/boundaround.txt b/reactos/base/applications/rapps/rapps/boundaround.txt new file mode 100644 index 00000000000..6c50c4304cf --- /dev/null +++ b/reactos/base/applications/rapps/rapps/boundaround.txt @@ -0,0 +1,20 @@ +; UTF-8 + +[Section] +Name = Bound Around (Demo) +Licence = Shareware +Description = A game similar Frozen Fruits. +Size = 1.95 MB +Category = 4 +URLSite = http://www.blueskied.com/boundaround.htm +URLDownload = http://www.blueskied.com/BoundAround_Demo.exe +CDPath = none + +[Section.0407] +Description = Ein Spiel, ähnlich zu Frozen Fruits. + +[Section.041f] +Name = Bound Around (Göstermelik) +Licence = Kısıtlı +Description = Frozen Fruits'e benzeyen bir oyun. +Size = 1,95 MB diff --git a/reactos/base/applications/rapps/rapps/christmasbound.txt b/reactos/base/applications/rapps/rapps/christmasbound.txt new file mode 100644 index 00000000000..dac37a48392 --- /dev/null +++ b/reactos/base/applications/rapps/rapps/christmasbound.txt @@ -0,0 +1,20 @@ +; UTF-8 + +[Section] +Name = Christmas Bound +Version = 1.4 +Licence = Freeware +Description = A game similar Frozen Fruits. +Size = 892 kB +Category = 4 +URLSite = http://www.blueskied.com/xmas/christmas_main.htm +URLDownload = http://www.blueskied.com/xmas/ChristmasBound_setup.exe +CDPath = none + +[Section.0407] +Description = Ein Spiel, ähnlich zu Frozen Fruits. + +[Section.041f] +Licence = Ücretsiz +Description = Frozen Fruits'e benzeyen bir oyun. +Size = 892 KB diff --git a/reactos/base/applications/rapps/rapps/codeblocks.txt b/reactos/base/applications/rapps/rapps/codeblocks.txt new file mode 100644 index 00000000000..a21ed29d735 --- /dev/null +++ b/reactos/base/applications/rapps/rapps/codeblocks.txt @@ -0,0 +1,20 @@ +; UTF-8 + +[Section] +Name = Code::Blocks (no compiler) +Version = 13.12 +Licence = GPLv3 +Description = A open source, cross-platform, powerful IDE. It doesn't contain a compiler. +Size = 29.2 MB +Category = 7 +URLSite = http://www.codeblocks.org/ +URLDownload = http://sourceforge.net/projects/codeblocks/files/Binaries/13.12/Windows/codeblocks-13.12-setup.exe +CDPath = none + +[Section.0407] +Description = Eine quelloffene, plattformübergreifende, mächtige IDE. Diese enthält keinen Compiler. + +[Section.041f] +Name = Code::Blocks (Derleyicisiz) +Description = Açık kaynak, çapraz platform, güçlü bir tümleşik geliştirme ortamı. Bir derleyici içermez. +Size = 29,2 MB diff --git a/reactos/base/applications/rapps/rapps/codeblocks_gcc.txt b/reactos/base/applications/rapps/rapps/codeblocks_gcc.txt new file mode 100644 index 00000000000..8f0f87d8367 --- /dev/null +++ b/reactos/base/applications/rapps/rapps/codeblocks_gcc.txt @@ -0,0 +1,20 @@ +; UTF-8 + +[Section] +Name = Code::Blocks TDM-GCC (version 4.7.1, 32 bit) +Version = 13.12 +Licence = GPLv3 +Description = A open source, cross-platform, powerful IDE. It contains TDM-GCC (version 4.7.1, 32 bit) compiler. +Size = 97.8 MB +Category = 7 +URLSite = http://www.codeblocks.org/ +URLDownload = http://sourceforge.net/projects/codeblocks/files/Binaries/13.12/Windows/codeblocks-13.12mingw-setup.exe +CDPath = none + +[Section.0407] +Description = Eine quelloffene, plattformübergreifende, mächtige IDE. Diese enthält den TDM-GCC (version 4.7.1, 32 bit) Compiler. + +[Section.041f] +Name = Code::Blocks TDM-GCC (sürüm 4.7.1, 32 bitlik) +Description = Açık kaynak, çapraz platform, güçlü bir tümleşik geliştirme ortamı. TDM-GCC (sürüm 4.7.1, 32 bitlik) derleyicisini içerir. +Size = 97,8 MB diff --git a/reactos/base/applications/rapps/rapps/codeblocks_gcc_2.txt b/reactos/base/applications/rapps/rapps/codeblocks_gcc_2.txt new file mode 100644 index 00000000000..20e15bf5dff --- /dev/null +++ b/reactos/base/applications/rapps/rapps/codeblocks_gcc_2.txt @@ -0,0 +1,20 @@ +; UTF-8 + +[Section] +Name = Code::Blocks TDM-GCC (version 4.8.1, 32 bit) +Version = 13.12 +Licence = GPLv3 +Description = A open source, cross-platform, powerful IDE. It contains TDM-GCC (version 4.8.1, 32 bit) compiler. +Size = 100 MB +Category = 7 +URLSite = http://www.codeblocks.org/ +URLDownload = http://sourceforge.net/projects/codeblocks/files/Binaries/13.12/Windows/codeblocks-13.12mingw-setup-TDM-GCC-481.exe +CDPath = none + +[Section.0407] +Description = Eine quelloffene, plattformübergreifende, mächtige IDE. Diese enthät den TDM-GCC (version 4.8.1, 32 bit) Compiler. + +[Section.041f] +Name = Code::Blocks TDM-GCC (sürüm 4.8.1, 32 bitlik) +Description = Açık kaynak, çapraz platform, güçlü bir tümleşik geliştirme ortamı. TDM-GCC (sürüm 4.8.1, 32 bitlik) derleyicisini içerir. +Size = 100 MB diff --git a/reactos/base/applications/rapps/rapps/devcpp_mingw32.txt b/reactos/base/applications/rapps/rapps/devcpp_mingw32.txt new file mode 100644 index 00000000000..de51e041100 --- /dev/null +++ b/reactos/base/applications/rapps/rapps/devcpp_mingw32.txt @@ -0,0 +1,19 @@ +; UTF-8 + +[Section] +Name = Orwell Dev-C++ MinGW32 +Version = 5.6.2 +Licence = GPLv2 +Description = A maintained version of Dev-C++. It contains MinGW32 compiler. +Size = 60.2 MB +Category = 7 +URLSite = http://orwelldevcpp.blogspot.com/ +URLDownload = http://sourceforge.net/projects/orwelldevcpp/files/Setup%20Releases/Dev-Cpp%205.6.2%20MinGW%204.8.1%20Setup.exe +CDPath = none + +[Section.0407] +Description = Eine gepflegte Version von Dev-C++. Der MinGW32 Compiler liegt bei. + +[Section.041f] +Description = Dev-C++'nın sürdürülen bir sürümü. MinGW32 derleyicisini içerir. +Size = 60,2 MB diff --git a/reactos/base/applications/rapps/rapps/devcpp_tdm_gcc_x64.txt b/reactos/base/applications/rapps/rapps/devcpp_tdm_gcc_x64.txt new file mode 100644 index 00000000000..2761f212b10 --- /dev/null +++ b/reactos/base/applications/rapps/rapps/devcpp_tdm_gcc_x64.txt @@ -0,0 +1,19 @@ +; UTF-8 + +[Section] +Name = Orwell Dev-C++ TDM GCC x64 +Version = 5.6.2 +Licence = GPLv2 +Description = A maintained version of Dev-C++. It contains 64 bit TDM-GCC compiler. +Size = 44.8 MB +Category = 7 +URLSite = http://orwelldevcpp.blogspot.com/ +URLDownload = http://sourceforge.net/projects/orwelldevcpp/files/Setup%20Releases/Dev-Cpp%205.6.2%20TDM-GCC%20x64%204.8.1%20Setup.exe +CDPath = none + +[Section.0407] +Description = Eine gepflegte Version von Dev-C++. Der 64 bit TDM-GCC Compiler liegt bei. + +[Section.041f] +Description = Dev-C++'nın sürdürülen bir sürümü. 64 bitlik TDM-GCC derleyicisini içerir. +Size = 44,8 MB diff --git a/reactos/base/applications/rapps/rapps/peazip.txt b/reactos/base/applications/rapps/rapps/peazip.txt new file mode 100644 index 00000000000..52857bd448c --- /dev/null +++ b/reactos/base/applications/rapps/rapps/peazip.txt @@ -0,0 +1,19 @@ +; UTF-8 + +[Section] +Name = PeaZip +Version = 5.3.0 +Licence = LGPL v3, OpenCandy EULA +Description = PeaZip is a free, cross-platform, open source file and archive manager. It supports over 150 archive formats. +Size = 5.8 MB +Category = 12 +URLSite = http://peazip.sourceforge.net/ +URLDownload = http://sourceforge.net/projects/peazip/files/5.3.0/peazip-5.3.0.WINDOWS.exe +CDPath = none + +[Section.0407] +Description = PeaZip ist ein freier, plattformübergreifender, quelloffener Datei- und Archivmanager. Er unterstützt über 150 Archiv-Formate. + +[Section.041f] +Description = PeaZip; ücretsiz, çapraz platform, açık kaynak bir kütük ve belgelik yöneticisidir. 150'den çok belgelikleme biçimini destekler. +Size = 5,8 MB diff --git a/reactos/base/applications/rapps/rapps/snoopy.txt b/reactos/base/applications/rapps/rapps/snoopy.txt new file mode 100644 index 00000000000..8ae0a8a6eab --- /dev/null +++ b/reactos/base/applications/rapps/rapps/snoopy.txt @@ -0,0 +1,20 @@ +; UTF-8 + +[Section] +Name = Snoopy +Version = 1.0 +Licence = Freeware +Description = The original C64 Snoopy remake. +Size = 704 kB +Category = 4 +URLSite = http://www.blueskied.com/snoopinfo.htm +URLDownload = http://www.blueskied.com/snoop/Snoop_install.exe +CDPath = none + +[Section.0407] +Description = Das Original C64 Snoopy Remake. + +[Section.041f] +Licence = Ücretsiz +Description = Özgün C64 Snoppy'nın yeniden yapılmışı. +Size = 704 KB diff --git a/reactos/base/applications/rapps/rapps/summerbound.txt b/reactos/base/applications/rapps/rapps/summerbound.txt new file mode 100644 index 00000000000..e17a8d4c813 --- /dev/null +++ b/reactos/base/applications/rapps/rapps/summerbound.txt @@ -0,0 +1,20 @@ +; UTF-8 + +[Section] +Name = Summer Bound +Version = 1.4 +Licence = Freeware +Description = A game similar Frozen Fruits. +Size = 764 kB +Category = 4 +URLSite = http://www.blueskied.com/summer_bound.htm +URLDownload = http://www.blueskied.com/summer/SummerBound_setup.exe +CDPath = none + +[Section.0407] +Description = Ein Spiel, ähnlich zu Frozen Fruits. + +[Section.041f] +Licence = Ücretsiz +Description = Frozen Fruits'e benzeyen bir oyun. +Size = 764 KB From f4dcf7950b29f890c8580a74290efd0d2ba1a251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 19 Apr 2014 15:17:28 +0000 Subject: [PATCH 379/419] [CDFS]: Fix typo spotted by Alexander and confirmed by Pierre (see rev 62779). svn path=/trunk/; revision=62807 --- reactos/drivers/filesystems/cdfs/fcb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/drivers/filesystems/cdfs/fcb.c b/reactos/drivers/filesystems/cdfs/fcb.c index ee2e9105948..28e0e8ebcf4 100644 --- a/reactos/drivers/filesystems/cdfs/fcb.c +++ b/reactos/drivers/filesystems/cdfs/fcb.c @@ -130,7 +130,7 @@ CdfsFCBIsDirectory(PFCB Fcb) BOOLEAN CdfsFCBIsRoot(PFCB Fcb) { - return (Fcb->PathName.Length = sizeof(WCHAR) && Fcb->PathName.Buffer[0] == L'\\'); + return (Fcb->PathName.Length == sizeof(WCHAR) && Fcb->PathName.Buffer[0] == L'\\'); } From 4b97514e49a2777245cd89e2606c63bd31fec607 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 15:24:56 +0000 Subject: [PATCH 380/419] [DXSDK] * Add missing CLSID_VideoMixingRenderer. svn path=/trunk/; revision=62808 --- reactos/include/dxsdk/uuids.h | 1 + 1 file changed, 1 insertion(+) diff --git a/reactos/include/dxsdk/uuids.h b/reactos/include/dxsdk/uuids.h index 376cca748fc..c385f3e9148 100644 --- a/reactos/include/dxsdk/uuids.h +++ b/reactos/include/dxsdk/uuids.h @@ -275,6 +275,7 @@ OUR_GUID_ENTRY(CLSID_VideoProcAmpPropertyPage, 0x71f96464, 0x78f3, 0x11d0, OUR_GUID_ENTRY(CLSID_CameraControlPropertyPage, 0x71f96465, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56) OUR_GUID_ENTRY(CLSID_AnalogVideoDecoderPropertyPage, 0x71f96466, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56) OUR_GUID_ENTRY(CLSID_VideoStreamConfigPropertyPage, 0x71f96467, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56) +OUR_GUID_ENTRY(CLSID_VideoMixingRenderer, 0xb87beb7b, 0x8d29, 0x423f, 0xae, 0x4d, 0x65, 0x82, 0xc1, 0x01, 0x75, 0xac) OUR_GUID_ENTRY(CLSID_VideoMixingRenderer9, 0x51b4abf3, 0x748f, 0x4e3b, 0xa2, 0x76, 0xc8, 0x28, 0x33, 0x0e, 0x92, 0x6a) #undef OUR_GUID_ENTRY From 6069c46a4d0dd25062b83def9ee2c96196857476 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 16:26:49 +0000 Subject: [PATCH 381/419] [AMSTREAM][QUARTZ][STRMBASE] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62809 --- .../wine/amstream/amstream_classes.idl | 2 + .../directx/wine/amstream/mediastreamfilter.c | 16 +- reactos/dll/directx/wine/quartz/avisplit.c | 10 +- .../dll/directx/wine/quartz/control_tlb.idl | 2 + reactos/dll/directx/wine/quartz/filesource.c | 15 +- reactos/dll/directx/wine/quartz/filtergraph.c | 16 +- reactos/dll/directx/wine/quartz/main.c | 1 + reactos/dll/directx/wine/quartz/parser.c | 15 +- reactos/dll/directx/wine/quartz/pin.c | 4 +- .../dll/directx/wine/quartz/quartz_private.h | 1 + .../dll/directx/wine/quartz/quartz_strmif.idl | 10 + .../dll/directx/wine/quartz/quartz_strmif.rgs | 4 + reactos/dll/directx/wine/quartz/regsvr.c | 44 +- .../dll/directx/wine/quartz/videorenderer.c | 2 +- reactos/dll/directx/wine/quartz/vmr9.c | 1079 +++++++++++++++-- reactos/include/reactos/wine/strmbase.h | 9 +- reactos/lib/3rdparty/strmbase/dllfunc.c | 78 +- reactos/lib/3rdparty/strmbase/filter.c | 16 +- reactos/lib/3rdparty/strmbase/pin.c | 44 +- reactos/lib/3rdparty/strmbase/pospass.c | 10 +- .../lib/3rdparty/strmbase/qualitycontrol.c | 5 +- reactos/lib/3rdparty/strmbase/renderer.c | 22 +- reactos/lib/3rdparty/strmbase/transform.c | 33 +- reactos/media/doc/README.WINE | 6 +- 24 files changed, 1112 insertions(+), 332 deletions(-) diff --git a/reactos/dll/directx/wine/amstream/amstream_classes.idl b/reactos/dll/directx/wine/amstream/amstream_classes.idl index 064ce00060d..e6bda830b40 100644 --- a/reactos/dll/directx/wine/amstream/amstream_classes.idl +++ b/reactos/dll/directx/wine/amstream/amstream_classes.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("SFilter Class"), threading(both), diff --git a/reactos/dll/directx/wine/amstream/mediastreamfilter.c b/reactos/dll/directx/wine/amstream/mediastreamfilter.c index 3ec6fcf62cd..4b7a3b3b9cb 100644 --- a/reactos/dll/directx/wine/amstream/mediastreamfilter.c +++ b/reactos/dll/directx/wine/amstream/mediastreamfilter.c @@ -178,14 +178,13 @@ static HRESULT WINAPI BasePinImp_GetMediaType(BasePin *This, int index, AM_MEDIA return S_OK; } -static const BasePinFuncTable input_BaseFuncTable = { - BasePinImpl_CheckMediaType, - NULL, - BasePinImp_GetMediaTypeVersion, - BasePinImp_GetMediaType -}; - static const BaseInputPinFuncTable input_BaseInputFuncTable = { + { + BasePinImpl_CheckMediaType, + NULL, + BasePinImp_GetMediaTypeVersion, + BasePinImp_GetMediaType + }, NULL }; @@ -354,7 +353,8 @@ static HRESULT WINAPI MediaStreamFilterImpl_AddMediaStream(IMediaStreamFilter* i /* Pin name is "I{guid MSPID_PrimaryVideo or MSPID_PrimaryAudio}" */ info.achName[0] = 'I'; StringFromGUID2(&purpose_id, info.achName + 1, 40); - hr = BaseInputPin_Construct(&MediaStreamFilter_InputPin_Vtbl, &info, &input_BaseFuncTable, &input_BaseInputFuncTable, &This->filter.csFilter, NULL, &This->pins[This->nb_streams]); + hr = BaseInputPin_Construct(&MediaStreamFilter_InputPin_Vtbl, sizeof(BaseInputPin), &info, + &input_BaseInputFuncTable, &This->filter.csFilter, NULL, &This->pins[This->nb_streams]); if (FAILED(hr)) return hr; diff --git a/reactos/dll/directx/wine/quartz/avisplit.c b/reactos/dll/directx/wine/quartz/avisplit.c index 1ae30ad75d6..f3c8ddce968 100644 --- a/reactos/dll/directx/wine/quartz/avisplit.c +++ b/reactos/dll/directx/wine/quartz/avisplit.c @@ -47,7 +47,7 @@ typedef struct StreamData DWORD entries; AVISTDINDEX **stdindex; DWORD frames; - DWORD seek; + BOOL seek; /* Position, in index units */ DWORD pos, pos_next, index, index_next; @@ -431,7 +431,7 @@ static HRESULT AVISplitter_first_request(LPVOID iface) stream->index_next = stream->index; /* This was sent after stopped->paused or stopped->playing, so set seek */ - stream->seek = 1; + stream->seek = TRUE; /* There should be a packet queued from AVISplitter_next_request last time * It needs to be done now because this is the only way to ensure that every @@ -956,7 +956,7 @@ static HRESULT AVISplitter_InitializeStreams(AVISplitterImpl *This) DWORD y; DWORD64 frames = 0; - stream->seek = 1; + stream->seek = TRUE; if (stream->stdindex) { @@ -1303,7 +1303,7 @@ static HRESULT WINAPI AVISplitter_seek(IMediaSeeking *iface) pin->dwSamplesProcessed = 0; stream->index = 0; stream->pos = 0; - stream->seek = 1; + stream->seek = TRUE; if (stream->stdindex) { DWORD y, z = 0; @@ -1379,7 +1379,7 @@ static HRESULT WINAPI AVISplitter_seek(IMediaSeeking *iface) stream->index = 0; } stream->preroll = preroll; - stream->seek = 1; + stream->seek = TRUE; } LeaveCriticalSection(&This->Parser.filter.csFilter); diff --git a/reactos/dll/directx/wine/quartz/control_tlb.idl b/reactos/dll/directx/wine/quartz/control_tlb.idl index 6d1855252a7..b131a1ba3a8 100644 --- a/reactos/dll/directx/wine/quartz/control_tlb.idl +++ b/reactos/dll/directx/wine/quartz/control_tlb.idl @@ -14,4 +14,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep regtypelib + #include "control.idl" diff --git a/reactos/dll/directx/wine/quartz/filesource.c b/reactos/dll/directx/wine/quartz/filesource.c index be07306225f..4a26313ba2c 100644 --- a/reactos/dll/directx/wine/quartz/filesource.c +++ b/reactos/dll/directx/wine/quartz/filesource.c @@ -911,14 +911,13 @@ static HRESULT WINAPI FileAsyncReaderPin_DecideBufferSize(BaseOutputPin *iface, return IMemAllocator_SetProperties(pAlloc, &This->allocProps, &actual); } -static const BasePinFuncTable output_BaseFuncTable = { - NULL, - FileAsyncReaderPin_AttemptConnection, - BasePinImpl_GetMediaTypeVersion, - FileAsyncReaderPin_GetMediaType -}; - static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { + { + NULL, + FileAsyncReaderPin_AttemptConnection, + BasePinImpl_GetMediaTypeVersion, + FileAsyncReaderPin_GetMediaType + }, FileAsyncReaderPin_DecideBufferSize, BaseOutputPinImpl_DecideAllocator, BaseOutputPinImpl_BreakConnect @@ -933,7 +932,7 @@ static HRESULT FileAsyncReader_Construct(HANDLE hFile, IBaseFilter * pBaseFilter piOutput.dir = PINDIR_OUTPUT; piOutput.pFilter = pBaseFilter; strcpyW(piOutput.achName, wszOutputPinName); - hr = BaseOutputPin_Construct(&FileAsyncReaderPin_Vtbl, sizeof(FileAsyncReader), &piOutput, &output_BaseFuncTable, &output_BaseOutputFuncTable, pCritSec, ppPin); + hr = BaseOutputPin_Construct(&FileAsyncReaderPin_Vtbl, sizeof(FileAsyncReader), &piOutput, &output_BaseOutputFuncTable, pCritSec, ppPin); if (SUCCEEDED(hr)) { diff --git a/reactos/dll/directx/wine/quartz/filtergraph.c b/reactos/dll/directx/wine/quartz/filtergraph.c index 2edcdfc8cb0..9aff4a2d610 100644 --- a/reactos/dll/directx/wine/quartz/filtergraph.c +++ b/reactos/dll/directx/wine/quartz/filtergraph.c @@ -67,7 +67,7 @@ static int EventsQueue_Destroy(EventsQueue* omr) return TRUE; } -static int EventsQueue_PutEvent(EventsQueue* omr, const Event* evt) +static BOOL EventsQueue_PutEvent(EventsQueue* omr, const Event* evt) { EnterCriticalSection(&omr->msg_crst); if (omr->msg_toget == ((omr->msg_tosave + 1) % omr->ring_buffer_size)) @@ -96,7 +96,7 @@ static int EventsQueue_PutEvent(EventsQueue* omr, const Event* evt) return TRUE; } -static int EventsQueue_GetEvent(EventsQueue* omr, Event* evt, LONG msTimeOut) +static BOOL EventsQueue_GetEvent(EventsQueue* omr, Event* evt, LONG msTimeOut) { if (WaitForSingleObject(omr->msg_event, msTimeOut) != WAIT_OBJECT_0) return FALSE; @@ -356,7 +356,7 @@ static HRESULT WINAPI FilterGraph2_AddFilter(IFilterGraph2 *iface, IBaseFilter * HRESULT hr; int i,j; WCHAR* wszFilterName = NULL; - int duplicate_name = FALSE; + BOOL duplicate_name = FALSE; TRACE("(%p/%p)->(%p, %s (%p))\n", This, iface, pFilter, debugstr_w(pName), pName); @@ -429,7 +429,7 @@ static HRESULT WINAPI FilterGraph2_AddFilter(IFilterGraph2 *iface, IBaseFilter * This->filterCapacity = newCapacity; } - hr = IBaseFilter_JoinFilterGraph(pFilter, (IFilterGraph *)This, wszFilterName); + hr = IBaseFilter_JoinFilterGraph(pFilter, (IFilterGraph *)&This->IFilterGraph2_iface, wszFilterName); if (SUCCEEDED(hr)) { @@ -469,7 +469,7 @@ static HRESULT WINAPI FilterGraph2_RemoveFilter(IFilterGraph2 *iface, IBaseFilte if (This->defaultclock && This->refClockProvider == pFilter) { IMediaFilter_SetSyncSource(&This->IMediaFilter_iface, NULL); - This->defaultclock = 1; + This->defaultclock = TRUE; } TRACE("Removing filter %s\n", debugstr_w(This->pFilterNames[i])); @@ -1481,7 +1481,7 @@ static HRESULT WINAPI FilterGraph2_RenderFile(IFilterGraph2 *iface, LPCWSTR lpcw IEnumPins* penumpins = NULL; HRESULT hr; BOOL partial = FALSE; - HRESULT any = FALSE; + BOOL any = FALSE; TRACE("(%p/%p)->(%s, %s)\n", This, iface, debugstr_w(lpcwstrFile), debugstr_w(lpcwstrPlayList)); @@ -1659,7 +1659,7 @@ static HRESULT WINAPI FilterGraph2_AddSourceFilter(IFilterGraph2 *iface, LPCWSTR } /* The file has been already loaded */ - IFileSourceFilter_GetCurFile(pfile, &filename, &mt); + hr = IFileSourceFilter_GetCurFile(pfile, &filename, &mt); if (FAILED(hr)) { WARN("GetCurFile (%x)\n", hr); goto error; @@ -5257,7 +5257,7 @@ static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceC IMediaEventSink *pEventSink; HRESULT eshr; - eshr = IMediaFilter_QueryInterface(iface, &IID_IMediaEventSink, (LPVOID)&pEventSink); + eshr = IMediaFilter_QueryInterface(iface, &IID_IMediaEventSink, (void **)&pEventSink); if (SUCCEEDED(eshr)) { IMediaEventSink_Notify(pEventSink, EC_CLOCK_CHANGED, 0, 0); diff --git a/reactos/dll/directx/wine/quartz/main.c b/reactos/dll/directx/wine/quartz/main.c index 1c16b1f5904..8c0e8803bfe 100644 --- a/reactos/dll/directx/wine/quartz/main.c +++ b/reactos/dll/directx/wine/quartz/main.c @@ -69,6 +69,7 @@ static const struct object_creation_info object_creation[] = { &CLSID_MPEG1Splitter, MPEGSplitter_create }, { &CLSID_VideoRenderer, VideoRenderer_create }, { &CLSID_NullRenderer, NullRenderer_create }, + { &CLSID_VideoMixingRenderer, VMR7Impl_create }, { &CLSID_VideoMixingRenderer9, VMR9Impl_create }, { &CLSID_VideoRendererDefault, VideoRendererDefault_create }, { &CLSID_DSoundRender, DSoundRender_create }, diff --git a/reactos/dll/directx/wine/quartz/parser.c b/reactos/dll/directx/wine/quartz/parser.c index 709e62b73c6..8476838984b 100644 --- a/reactos/dll/directx/wine/quartz/parser.c +++ b/reactos/dll/directx/wine/quartz/parser.c @@ -405,14 +405,13 @@ HRESULT WINAPI Parser_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo) return BaseFilterImpl_QueryVendorInfo(iface, pVendorInfo); } -static const BasePinFuncTable output_BaseFuncTable = { - NULL, - BaseOutputPinImpl_AttemptConnection, - BasePinImpl_GetMediaTypeVersion, - Parser_OutputPin_GetMediaType -}; - static const BaseOutputPinFuncTable output_BaseOutputFuncTable = { + { + NULL, + BaseOutputPinImpl_AttemptConnection, + BasePinImpl_GetMediaTypeVersion, + Parser_OutputPin_GetMediaType + }, Parser_OutputPin_DecideBufferSize, Parser_OutputPin_DecideAllocator, Parser_OutputPin_BreakConnect @@ -428,7 +427,7 @@ HRESULT Parser_AddPin(ParserImpl * This, const PIN_INFO * piOutput, ALLOCATOR_PR This->ppPins = CoTaskMemAlloc((This->cStreams + 2) * sizeof(IPin *)); memcpy(This->ppPins, ppOldPins, (This->cStreams + 1) * sizeof(IPin *)); - hr = BaseOutputPin_Construct(&Parser_OutputPin_Vtbl, sizeof(Parser_OutputPin), piOutput, &output_BaseFuncTable, &output_BaseOutputFuncTable, &This->filter.csFilter, This->ppPins + (This->cStreams + 1)); + hr = BaseOutputPin_Construct(&Parser_OutputPin_Vtbl, sizeof(Parser_OutputPin), piOutput, &output_BaseOutputFuncTable, &This->filter.csFilter, This->ppPins + (This->cStreams + 1)); if (SUCCEEDED(hr)) { diff --git a/reactos/dll/directx/wine/quartz/pin.c b/reactos/dll/directx/wine/quartz/pin.c index 93dcbbbfa09..efa0ec01a5e 100644 --- a/reactos/dll/directx/wine/quartz/pin.c +++ b/reactos/dll/directx/wine/quartz/pin.c @@ -256,7 +256,7 @@ HRESULT WINAPI PullPin_ReceiveConnection(IPin * iface, IPin * pReceivePin, const ALLOCATOR_PROPERTIES props; props.cBuffers = 3; - props.cbBuffer = 64 * 1024; /* 64k bytes */ + props.cbBuffer = 64 * 1024; /* 64 KB */ props.cbAlign = 1; props.cbPrefix = 0; @@ -589,7 +589,7 @@ static HRESULT PullPin_InitProcessing(PullPin * This) assert(WaitForSingleObject(This->thread_sleepy, 0) == WAIT_TIMEOUT); This->state = Req_Sleepy; - /* AddRef the filter to make sure it and it's pins will be around + /* AddRef the filter to make sure it and its pins will be around * as long as the thread */ IBaseFilter_AddRef(This->pin.pinInfo.pFilter); diff --git a/reactos/dll/directx/wine/quartz/quartz_private.h b/reactos/dll/directx/wine/quartz/quartz_private.h index 10cc56ab1c2..ae3a276fda1 100644 --- a/reactos/dll/directx/wine/quartz/quartz_private.h +++ b/reactos/dll/directx/wine/quartz/quartz_private.h @@ -72,6 +72,7 @@ HRESULT VideoRendererDefault_create(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC HRESULT QUARTZ_CreateSystemClock(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC_HIDDEN; HRESULT ACMWrapper_create(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC_HIDDEN; HRESULT WAVEParser_create(IUnknown * pUnkOuter, LPVOID * ppv) DECLSPEC_HIDDEN; +HRESULT VMR7Impl_create(IUnknown *pUnkOuter, LPVOID *ppv) DECLSPEC_HIDDEN; HRESULT VMR9Impl_create(IUnknown *pUnkOuter, LPVOID *ppv) DECLSPEC_HIDDEN; HRESULT EnumMonikerImpl_Create(IMoniker ** ppMoniker, ULONG nMonikerCount, IEnumMoniker ** ppEnum) DECLSPEC_HIDDEN; diff --git a/reactos/dll/directx/wine/quartz/quartz_strmif.idl b/reactos/dll/directx/wine/quartz/quartz_strmif.idl index ed7abe6b21a..44dc668ae51 100644 --- a/reactos/dll/directx/wine/quartz/quartz_strmif.idl +++ b/reactos/dll/directx/wine/quartz/quartz_strmif.idl @@ -16,6 +16,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep proxy +#pragma makedep register + cpp_quote("#include ") #include "strmif.idl" @@ -151,6 +154,13 @@ coclass ACMWrapper { interface IBaseFilter; } ] coclass WAVEParser { interface IBaseFilter; } +[ + helpstring("Video Mixing Renderer"), + threading(both), + uuid(b87beb7b-8d29-423f-ae4d-6582c10175ac) +] +coclass VideoMixingRenderer { interface IBaseFilter; } + [ helpstring("Video Mixing Renderer 9"), threading(both), diff --git a/reactos/dll/directx/wine/quartz/quartz_strmif.rgs b/reactos/dll/directx/wine/quartz/quartz_strmif.rgs index 69c6a05c7fa..5c090335f87 100644 --- a/reactos/dll/directx/wine/quartz/quartz_strmif.rgs +++ b/reactos/dll/directx/wine/quartz/quartz_strmif.rgs @@ -261,6 +261,10 @@ HKCR { InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } } + '{B87BEB7B-8D29-423F-AE4D-6582C10175AC}' = s 'Video Mixing Renderer' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } '{51B4ABF3-748F-4E3B-A276-C828330E926A}' = s 'Video Mixing Renderer 9' { InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } diff --git a/reactos/dll/directx/wine/quartz/regsvr.c b/reactos/dll/directx/wine/quartz/regsvr.c index 3c516111f53..bbf519c8877 100644 --- a/reactos/dll/directx/wine/quartz/regsvr.c +++ b/reactos/dll/directx/wine/quartz/regsvr.c @@ -177,8 +177,7 @@ static HRESULT register_interfaces(struct regsvr_interface const *list) if (res != ERROR_SUCCESS) goto error_close_interface_key; if (list->name) { - res = RegSetValueExA(iid_key, NULL, 0, REG_SZ, - (CONST BYTE*)(list->name), + res = RegSetValueExA(iid_key, NULL, 0, REG_SZ, (const BYTE*)list->name, strlen(list->name) + 1); if (res != ERROR_SUCCESS) goto error_close_iid_key; } @@ -197,8 +196,7 @@ static HRESULT register_interfaces(struct regsvr_interface const *list) if (res != ERROR_SUCCESS) goto error_close_iid_key; sprintfW(buf, fmt, list->num_methods); - res = RegSetValueExW(key, NULL, 0, REG_SZ, - (CONST BYTE*)buf, + res = RegSetValueExW(key, NULL, 0, REG_SZ, (const BYTE*)buf, (lstrlenW(buf) + 1) * sizeof(WCHAR)); RegCloseKey(key); @@ -273,8 +271,7 @@ static HRESULT register_coclasses(struct regsvr_coclass const *list) if (res != ERROR_SUCCESS) goto error_close_coclass_key; if (list->name) { - res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ, - (CONST BYTE*)(list->name), + res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ, (const BYTE*)list->name, strlen(list->name) + 1); if (res != ERROR_SUCCESS) goto error_close_clsid_key; } @@ -292,12 +289,11 @@ static HRESULT register_coclasses(struct regsvr_coclass const *list) &ips32_key, NULL); if (res != ERROR_SUCCESS) goto error_close_clsid_key; - res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ, - (CONST BYTE*)list->ips32, + res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ, (const BYTE*)list->ips32, lstrlenA(list->ips32) + 1); if (res == ERROR_SUCCESS && list->ips32_tmodel) res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ, - (CONST BYTE*)list->ips32_tmodel, + (const BYTE*)list->ips32_tmodel, strlen(list->ips32_tmodel) + 1); RegCloseKey(ips32_key); if (res != ERROR_SUCCESS) goto error_close_clsid_key; @@ -402,14 +398,14 @@ static HRESULT register_mediatypes_parsing(struct regsvr_mediatype_parsing const if (res != ERROR_SUCCESS) goto error_close_keys; StringFromGUID2(&CLSID_AsyncReader, buf, 39); - res = RegSetValueExW(subtype_key, sourcefilter_valuename, 0, REG_SZ, (CONST BYTE*)buf, + res = RegSetValueExW(subtype_key, sourcefilter_valuename, 0, REG_SZ, (const BYTE*)buf, (lstrlenW(buf) + 1) * sizeof(WCHAR)); if (res != ERROR_SUCCESS) goto error_close_keys; for(i = 0; list->line[i]; i++) { char buffer[3]; wsprintfA(buffer, "%d", i); - res = RegSetValueExA(subtype_key, buffer, 0, REG_SZ, (CONST BYTE*)list->line[i], + res = RegSetValueExA(subtype_key, buffer, 0, REG_SZ, (const BYTE*)list->line[i], lstrlenA(list->line[i])); if (res != ERROR_SUCCESS) goto error_close_keys; } @@ -452,17 +448,17 @@ static HRESULT register_mediatypes_extension(struct regsvr_mediatype_extension c if (res != ERROR_SUCCESS) break; StringFromGUID2(list->majortype, buf, 39); - res = RegSetValueExW(extension_key, mediatype_name, 0, REG_SZ, (CONST BYTE*)buf, + res = RegSetValueExW(extension_key, mediatype_name, 0, REG_SZ, (const BYTE*)buf, (lstrlenW(buf) + 1) * sizeof(WCHAR)); if (res != ERROR_SUCCESS) goto error_close_key; StringFromGUID2(list->subtype, buf, 39); - res = RegSetValueExW(extension_key, subtype_valuename, 0, REG_SZ, (CONST BYTE*)buf, + res = RegSetValueExW(extension_key, subtype_valuename, 0, REG_SZ, (const BYTE*)buf, (lstrlenW(buf) + 1) * sizeof(WCHAR)); if (res != ERROR_SUCCESS) goto error_close_key; StringFromGUID2(&CLSID_AsyncReader, buf, 39); - res = RegSetValueExW(extension_key, sourcefilter_valuename, 0, REG_SZ, (CONST BYTE*)buf, + res = RegSetValueExW(extension_key, sourcefilter_valuename, 0, REG_SZ, (const BYTE*)buf, (lstrlenW(buf) + 1) * sizeof(WCHAR)); if (res != ERROR_SUCCESS) goto error_close_key; @@ -682,7 +678,7 @@ static LONG register_key_defvalueW( res = RegCreateKeyExW(base, name, 0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &key, NULL); if (res != ERROR_SUCCESS) return res; - res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value, + res = RegSetValueExW(key, NULL, 0, REG_SZ, (const BYTE*)value, (lstrlenW(value) + 1) * sizeof(WCHAR)); RegCloseKey(key); return res; @@ -702,8 +698,7 @@ static LONG register_key_defvalueA( res = RegCreateKeyExW(base, name, 0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &key, NULL); if (res != ERROR_SUCCESS) return res; - res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value, - lstrlenA(value) + 1); + res = RegSetValueExA(key, NULL, 0, REG_SZ, (const BYTE*)value, lstrlenA(value) + 1); RegCloseKey(key); return res; } @@ -727,8 +722,7 @@ static LONG register_progid( if (res != ERROR_SUCCESS) return res; if (name) { - res = RegSetValueExA(progid_key, NULL, 0, REG_SZ, - (CONST BYTE*)name, strlen(name) + 1); + res = RegSetValueExA(progid_key, NULL, 0, REG_SZ, (const BYTE*)name, strlen(name) + 1); if (res != ERROR_SUCCESS) goto error_close_progid_key; } @@ -938,6 +932,18 @@ static struct regsvr_filter const filter_list[] = { { 0xFFFFFFFF }, } }, + { &CLSID_VideoMixingRenderer, + &CLSID_LegacyAmFilterCategory, + {'V','i','d','e','o',' ','M','i','x','i','n','g',' ','R','e','n','d','e','r','e','r',0}, + 0x200000, + { { REG_PINFLAG_B_RENDERER, + { { &MEDIATYPE_Video, &GUID_NULL }, + { NULL } + }, + }, + { 0xFFFFFFFF }, + } + }, { &CLSID_VideoMixingRenderer9, &CLSID_LegacyAmFilterCategory, {'V','i','d','e','o',' ','M','i','x','i','n','g',' ','R','e','n','d','e','r','e','r',' ','9',0}, diff --git a/reactos/dll/directx/wine/quartz/videorenderer.c b/reactos/dll/directx/wine/quartz/videorenderer.c index 4070a8f65d4..42b29f1a447 100644 --- a/reactos/dll/directx/wine/quartz/videorenderer.c +++ b/reactos/dll/directx/wine/quartz/videorenderer.c @@ -1009,7 +1009,7 @@ HRESULT VideoRenderer_create(IUnknown *pUnkOuter, void **ppv) pVideoRenderer->IUnknown_inner.lpVtbl = &IInner_VTable; pVideoRenderer->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_Vtbl; - pVideoRenderer->init = 0; + pVideoRenderer->init = FALSE; ZeroMemory(&pVideoRenderer->SourceRect, sizeof(RECT)); ZeroMemory(&pVideoRenderer->DestRect, sizeof(RECT)); ZeroMemory(&pVideoRenderer->WindowPos, sizeof(RECT)); diff --git a/reactos/dll/directx/wine/quartz/vmr9.c b/reactos/dll/directx/wine/quartz/vmr9.c index 3ddf5b79e1c..5968ac9dead 100644 --- a/reactos/dll/directx/wine/quartz/vmr9.c +++ b/reactos/dll/directx/wine/quartz/vmr9.c @@ -24,18 +24,25 @@ #include #include +#include -typedef struct +struct quartz_vmr { BaseRenderer renderer; BaseControlWindow baseControlWindow; BaseControlVideo baseControlVideo; IUnknown IUnknown_inner; + IAMCertifiedOutputProtection IAMCertifiedOutputProtection_iface; IAMFilterMiscFlags IAMFilterMiscFlags_iface; + IVMRFilterConfig IVMRFilterConfig_iface; IVMRFilterConfig9 IVMRFilterConfig9_iface; - IVMRWindowlessControl9 IVMRWindowlessControl9_iface; + IVMRMonitorConfig IVMRMonitorConfig_iface; + IVMRMonitorConfig9 IVMRMonitorConfig9_iface; + IVMRSurfaceAllocatorNotify IVMRSurfaceAllocatorNotify_iface; IVMRSurfaceAllocatorNotify9 IVMRSurfaceAllocatorNotify9_iface; + IVMRWindowlessControl IVMRWindowlessControl_iface; + IVMRWindowlessControl9 IVMRWindowlessControl9_iface; IVMRSurfaceAllocatorEx9 *allocator; IVMRImagePresenter9 *presenter; @@ -68,51 +75,81 @@ typedef struct RECT target_rect; LONG VideoWidth; LONG VideoHeight; -} VMR9Impl; +}; -static inline VMR9Impl *impl_from_inner_IUnknown(IUnknown *iface) +static inline struct quartz_vmr *impl_from_inner_IUnknown(IUnknown *iface) { - return CONTAINING_RECORD(iface, VMR9Impl, IUnknown_inner); + return CONTAINING_RECORD(iface, struct quartz_vmr, IUnknown_inner); } -static inline VMR9Impl *impl_from_BaseWindow( BaseWindow *wnd ) +static inline struct quartz_vmr *impl_from_BaseWindow(BaseWindow *wnd) { - return CONTAINING_RECORD(wnd, VMR9Impl, baseControlWindow.baseWindow); + return CONTAINING_RECORD(wnd, struct quartz_vmr, baseControlWindow.baseWindow); } -static inline VMR9Impl *impl_from_IVideoWindow( IVideoWindow *iface) +static inline struct quartz_vmr *impl_from_IVideoWindow(IVideoWindow *iface) { - return CONTAINING_RECORD(iface, VMR9Impl, baseControlWindow.IVideoWindow_iface); + return CONTAINING_RECORD(iface, struct quartz_vmr, baseControlWindow.IVideoWindow_iface); } -static inline VMR9Impl *impl_from_BaseControlVideo( BaseControlVideo *cvid ) +static inline struct quartz_vmr *impl_from_BaseControlVideo(BaseControlVideo *cvid) { - return CONTAINING_RECORD(cvid, VMR9Impl, baseControlVideo); + return CONTAINING_RECORD(cvid, struct quartz_vmr, baseControlVideo); } -static inline VMR9Impl *impl_from_IBasicVideo( IBasicVideo *iface) +static inline struct quartz_vmr *impl_from_IBasicVideo(IBasicVideo *iface) { - return CONTAINING_RECORD(iface, VMR9Impl, baseControlVideo.IBasicVideo_iface); + return CONTAINING_RECORD(iface, struct quartz_vmr, baseControlVideo.IBasicVideo_iface); } -static inline VMR9Impl *impl_from_IAMFilterMiscFlags( IAMFilterMiscFlags *iface) +static inline struct quartz_vmr *impl_from_IAMCertifiedOutputProtection(IAMCertifiedOutputProtection *iface) { - return CONTAINING_RECORD(iface, VMR9Impl, IAMFilterMiscFlags_iface); + return CONTAINING_RECORD(iface, struct quartz_vmr, IAMCertifiedOutputProtection_iface); } -static inline VMR9Impl *impl_from_IVMRFilterConfig9( IVMRFilterConfig9 *iface) +static inline struct quartz_vmr *impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface) { - return CONTAINING_RECORD(iface, VMR9Impl, IVMRFilterConfig9_iface); + return CONTAINING_RECORD(iface, struct quartz_vmr, IAMFilterMiscFlags_iface); } -static inline VMR9Impl *impl_from_IVMRWindowlessControl9( IVMRWindowlessControl9 *iface) +static inline struct quartz_vmr *impl_from_IVMRFilterConfig(IVMRFilterConfig *iface) { - return CONTAINING_RECORD(iface, VMR9Impl, IVMRWindowlessControl9_iface); + return CONTAINING_RECORD(iface, struct quartz_vmr, IVMRFilterConfig_iface); } -static inline VMR9Impl *impl_from_IVMRSurfaceAllocatorNotify9( IVMRSurfaceAllocatorNotify9 *iface) +static inline struct quartz_vmr *impl_from_IVMRFilterConfig9(IVMRFilterConfig9 *iface) { - return CONTAINING_RECORD(iface, VMR9Impl, IVMRSurfaceAllocatorNotify9_iface); + return CONTAINING_RECORD(iface, struct quartz_vmr, IVMRFilterConfig9_iface); +} + +static inline struct quartz_vmr *impl_from_IVMRMonitorConfig(IVMRMonitorConfig *iface) +{ + return CONTAINING_RECORD(iface, struct quartz_vmr, IVMRMonitorConfig_iface); +} + +static inline struct quartz_vmr *impl_from_IVMRMonitorConfig9(IVMRMonitorConfig9 *iface) +{ + return CONTAINING_RECORD(iface, struct quartz_vmr, IVMRMonitorConfig9_iface); +} + +static inline struct quartz_vmr *impl_from_IVMRSurfaceAllocatorNotify(IVMRSurfaceAllocatorNotify *iface) +{ + return CONTAINING_RECORD(iface, struct quartz_vmr, IVMRSurfaceAllocatorNotify_iface); +} + +static inline struct quartz_vmr *impl_from_IVMRSurfaceAllocatorNotify9(IVMRSurfaceAllocatorNotify9 *iface) +{ + return CONTAINING_RECORD(iface, struct quartz_vmr, IVMRSurfaceAllocatorNotify9_iface); +} + +static inline struct quartz_vmr *impl_from_IVMRWindowlessControl(IVMRWindowlessControl *iface) +{ + return CONTAINING_RECORD(iface, struct quartz_vmr, IVMRWindowlessControl_iface); +} + +static inline struct quartz_vmr *impl_from_IVMRWindowlessControl9(IVMRWindowlessControl9 *iface) +{ + return CONTAINING_RECORD(iface, struct quartz_vmr, IVMRWindowlessControl9_iface); } typedef struct @@ -136,7 +173,7 @@ typedef struct BOOL reset; VMR9AllocationInfo info; - VMR9Impl* pVMR9; + struct quartz_vmr* pVMR9; IVMRSurfaceAllocatorNotify9 *SurfaceAllocatorNotify; } VMR9DefaultAllocatorPresenterImpl; @@ -150,9 +187,10 @@ static inline VMR9DefaultAllocatorPresenterImpl *impl_from_IVMRSurfaceAllocatorE return CONTAINING_RECORD(iface, VMR9DefaultAllocatorPresenterImpl, IVMRSurfaceAllocatorEx9_iface); } -static HRESULT VMR9DefaultAllocatorPresenterImpl_create(VMR9Impl *parent, LPVOID * ppv); +static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *parent, LPVOID * ppv); -static DWORD VMR9_SendSampleData(VMR9Impl *This, VMR9PresentationInfo *info, LPBYTE data, DWORD size) +static DWORD VMR9_SendSampleData(struct quartz_vmr *This, VMR9PresentationInfo *info, LPBYTE data, + DWORD size) { AM_MEDIA_TYPE *amt; HRESULT hr = S_OK; @@ -221,7 +259,7 @@ static DWORD VMR9_SendSampleData(VMR9Impl *This, VMR9PresentationInfo *info, LPB static HRESULT WINAPI VMR9_DoRenderSample(BaseRenderer *iface, IMediaSample * pSample) { - VMR9Impl *This = (VMR9Impl *)iface; + struct quartz_vmr *This = (struct quartz_vmr*)iface; LPBYTE pbSrcStream = NULL; long cbSrcStream = 0; REFERENCE_TIME tStart, tStop; @@ -286,7 +324,7 @@ static HRESULT WINAPI VMR9_DoRenderSample(BaseRenderer *iface, IMediaSample * pS static HRESULT WINAPI VMR9_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE * pmt) { - VMR9Impl *This = (VMR9Impl*)iface; + struct quartz_vmr *This = (struct quartz_vmr*)iface; if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) || !pmt->pbFormat) return S_FALSE; @@ -323,7 +361,7 @@ static HRESULT WINAPI VMR9_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TY return S_OK; } -static HRESULT VMR9_maybe_init(VMR9Impl *This, BOOL force) +static HRESULT VMR9_maybe_init(struct quartz_vmr *This, BOOL force) { VMR9AllocationInfo info; DWORD buffers; @@ -382,7 +420,7 @@ static HRESULT VMR9_maybe_init(VMR9Impl *This, BOOL force) static VOID WINAPI VMR9_OnStartStreaming(BaseRenderer* iface) { - VMR9Impl *This = (VMR9Impl*)iface; + struct quartz_vmr *This = (struct quartz_vmr*)iface; TRACE("(%p)\n", This); @@ -400,7 +438,7 @@ static VOID WINAPI VMR9_OnStartStreaming(BaseRenderer* iface) static VOID WINAPI VMR9_OnStopStreaming(BaseRenderer* iface) { - VMR9Impl *This = (VMR9Impl*)iface; + struct quartz_vmr *This = (struct quartz_vmr*)iface; TRACE("(%p)\n", This); @@ -418,7 +456,7 @@ static HRESULT WINAPI VMR9_ShouldDrawSampleNow(BaseRenderer *This, IMediaSample static HRESULT WINAPI VMR9_CompleteConnect(BaseRenderer *This, IPin *pReceivePin) { - VMR9Impl *pVMR9 = (VMR9Impl*)This; + struct quartz_vmr *pVMR9 = (struct quartz_vmr*)This; HRESULT hr = S_OK; TRACE("(%p)\n", This); @@ -434,7 +472,7 @@ static HRESULT WINAPI VMR9_CompleteConnect(BaseRenderer *This, IPin *pReceivePin static HRESULT WINAPI VMR9_BreakConnect(BaseRenderer *This) { - VMR9Impl *pVMR9 = (VMR9Impl*)This; + struct quartz_vmr *pVMR9 = (struct quartz_vmr*)This; HRESULT hr = S_OK; if (!pVMR9->mode) @@ -488,7 +526,7 @@ static LPWSTR WINAPI VMR9_GetClassWindowStyles(BaseWindow *This, DWORD *pClassSt static RECT WINAPI VMR9_GetDefaultRect(BaseWindow *This) { - VMR9Impl* pVMR9 = impl_from_BaseWindow(This); + struct quartz_vmr* pVMR9 = impl_from_BaseWindow(This); static RECT defRect; defRect.left = defRect.top = 0; @@ -500,7 +538,7 @@ static RECT WINAPI VMR9_GetDefaultRect(BaseWindow *This) static BOOL WINAPI VMR9_OnSize(BaseWindow *This, LONG Width, LONG Height) { - VMR9Impl* pVMR9 = impl_from_BaseWindow(This); + struct quartz_vmr* pVMR9 = impl_from_BaseWindow(This); TRACE("WM_SIZE %d %d\n", Width, Height); GetClientRect(This->hWnd, &pVMR9->target_rect); @@ -522,14 +560,14 @@ static const BaseWindowFuncTable renderer_BaseWindowFuncTable = { static HRESULT WINAPI VMR9_GetSourceRect(BaseControlVideo* This, RECT *pSourceRect) { - VMR9Impl* pVMR9 = impl_from_BaseControlVideo(This); + struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); CopyRect(pSourceRect,&pVMR9->source_rect); return S_OK; } static HRESULT WINAPI VMR9_GetStaticImage(BaseControlVideo* This, LONG *pBufferSize, LONG *pDIBImage) { - VMR9Impl* pVMR9 = impl_from_BaseControlVideo(This); + struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); BITMAPINFOHEADER *bmiHeader; LONG needed_size; AM_MEDIA_TYPE *amt = &pVMR9->renderer.pInputPin->pin.mtCurrent; @@ -588,14 +626,14 @@ static HRESULT WINAPI VMR9_GetStaticImage(BaseControlVideo* This, LONG *pBufferS static HRESULT WINAPI VMR9_GetTargetRect(BaseControlVideo* This, RECT *pTargetRect) { - VMR9Impl* pVMR9 = impl_from_BaseControlVideo(This); + struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); CopyRect(pTargetRect,&pVMR9->target_rect); return S_OK; } static VIDEOINFOHEADER* WINAPI VMR9_GetVideoFormat(BaseControlVideo* This) { - VMR9Impl* pVMR9 = impl_from_BaseControlVideo(This); + struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); AM_MEDIA_TYPE *pmt; TRACE("(%p/%p)\n", pVMR9, This); @@ -617,7 +655,7 @@ static VIDEOINFOHEADER* WINAPI VMR9_GetVideoFormat(BaseControlVideo* This) static HRESULT WINAPI VMR9_IsDefaultSourceRect(BaseControlVideo* This) { - VMR9Impl* pVMR9 = impl_from_BaseControlVideo(This); + struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); FIXME("(%p/%p)->(): stub !!!\n", pVMR9, This); return S_OK; @@ -625,7 +663,7 @@ static HRESULT WINAPI VMR9_IsDefaultSourceRect(BaseControlVideo* This) static HRESULT WINAPI VMR9_IsDefaultTargetRect(BaseControlVideo* This) { - VMR9Impl* pVMR9 = impl_from_BaseControlVideo(This); + struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); FIXME("(%p/%p)->(): stub !!!\n", pVMR9, This); return S_OK; @@ -633,7 +671,7 @@ static HRESULT WINAPI VMR9_IsDefaultTargetRect(BaseControlVideo* This) static HRESULT WINAPI VMR9_SetDefaultSourceRect(BaseControlVideo* This) { - VMR9Impl* pVMR9 = impl_from_BaseControlVideo(This); + struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); pVMR9->source_rect.left = 0; pVMR9->source_rect.top = 0; @@ -646,7 +684,7 @@ static HRESULT WINAPI VMR9_SetDefaultSourceRect(BaseControlVideo* This) static HRESULT WINAPI VMR9_SetDefaultTargetRect(BaseControlVideo* This) { RECT rect; - VMR9Impl* pVMR9 = impl_from_BaseControlVideo(This); + struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); if (!GetClientRect(pVMR9->baseControlWindow.baseWindow.hWnd, &rect)) return E_FAIL; @@ -661,14 +699,14 @@ static HRESULT WINAPI VMR9_SetDefaultTargetRect(BaseControlVideo* This) static HRESULT WINAPI VMR9_SetSourceRect(BaseControlVideo* This, RECT *pSourceRect) { - VMR9Impl* pVMR9 = impl_from_BaseControlVideo(This); + struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); CopyRect(&pVMR9->source_rect,pSourceRect); return S_OK; } static HRESULT WINAPI VMR9_SetTargetRect(BaseControlVideo* This, RECT *pTargetRect) { - VMR9Impl* pVMR9 = impl_from_BaseControlVideo(This); + struct quartz_vmr* pVMR9 = impl_from_BaseControlVideo(This); CopyRect(&pVMR9->target_rect,pTargetRect); return S_OK; } @@ -688,7 +726,7 @@ static const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable = { static HRESULT WINAPI VMR9Inner_QueryInterface(IUnknown * iface, REFIID riid, LPVOID * ppv) { - VMR9Impl *This = impl_from_inner_IUnknown(iface); + struct quartz_vmr *This = impl_from_inner_IUnknown(iface); TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv); if (This->bAggregatable) @@ -702,14 +740,26 @@ static HRESULT WINAPI VMR9Inner_QueryInterface(IUnknown * iface, REFIID riid, LP *ppv = &This->baseControlWindow.IVideoWindow_iface; else if (IsEqualIID(riid, &IID_IBasicVideo)) *ppv = &This->baseControlVideo.IBasicVideo_iface; + else if (IsEqualIID(riid, &IID_IAMCertifiedOutputProtection)) + *ppv = &This->IAMCertifiedOutputProtection_iface; else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags)) *ppv = &This->IAMFilterMiscFlags_iface; + else if (IsEqualIID(riid, &IID_IVMRFilterConfig)) + *ppv = &This->IVMRFilterConfig_iface; else if (IsEqualIID(riid, &IID_IVMRFilterConfig9)) *ppv = &This->IVMRFilterConfig9_iface; - else if (IsEqualIID(riid, &IID_IVMRWindowlessControl9) && This->mode == VMR9Mode_Windowless) - *ppv = &This->IVMRWindowlessControl9_iface; + else if (IsEqualIID(riid, &IID_IVMRMonitorConfig)) + *ppv = &This->IVMRMonitorConfig_iface; + else if (IsEqualIID(riid, &IID_IVMRMonitorConfig9)) + *ppv = &This->IVMRMonitorConfig9_iface; + else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorNotify) && This->mode == (VMR9Mode)VMRMode_Renderless) + *ppv = &This->IVMRSurfaceAllocatorNotify_iface; else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorNotify9) && This->mode == VMR9Mode_Renderless) *ppv = &This->IVMRSurfaceAllocatorNotify9_iface; + else if (IsEqualIID(riid, &IID_IVMRWindowlessControl) && This->mode == (VMR9Mode)VMRMode_Windowless) + *ppv = &This->IVMRWindowlessControl_iface; + else if (IsEqualIID(riid, &IID_IVMRWindowlessControl9) && This->mode == VMR9Mode_Windowless) + *ppv = &This->IVMRWindowlessControl9_iface; else { HRESULT hr; @@ -740,8 +790,6 @@ static HRESULT WINAPI VMR9Inner_QueryInterface(IUnknown * iface, REFIID riid, LP FIXME("No interface for IID_IVMRDeinterlaceControl9\n"); else if (IsEqualIID(riid, &IID_IVMRMixerBitmap9)) FIXME("No interface for IID_IVMRMixerBitmap9\n"); - else if (IsEqualIID(riid, &IID_IVMRMonitorConfig9)) - FIXME("No interface for IID_IVMRMonitorConfig9\n"); else if (IsEqualIID(riid, &IID_IVMRMixerControl9)) FIXME("No interface for IID_IVMRMixerControl9\n"); else @@ -752,7 +800,7 @@ static HRESULT WINAPI VMR9Inner_QueryInterface(IUnknown * iface, REFIID riid, LP static ULONG WINAPI VMR9Inner_AddRef(IUnknown * iface) { - VMR9Impl *This = impl_from_inner_IUnknown(iface); + struct quartz_vmr *This = impl_from_inner_IUnknown(iface); ULONG refCount = BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface); TRACE("(%p/%p)->() AddRef from %d\n", This, iface, refCount - 1); @@ -762,7 +810,7 @@ static ULONG WINAPI VMR9Inner_AddRef(IUnknown * iface) static ULONG WINAPI VMR9Inner_Release(IUnknown * iface) { - VMR9Impl *This = impl_from_inner_IUnknown(iface); + struct quartz_vmr *This = impl_from_inner_IUnknown(iface); ULONG refCount = BaseRendererImpl_Release(&This->renderer.filter.IBaseFilter_iface); TRACE("(%p/%p)->() Release from %d\n", This, iface, refCount + 1); @@ -771,7 +819,7 @@ static ULONG WINAPI VMR9Inner_Release(IUnknown * iface) { TRACE("Destroying\n"); BaseControlWindow_Destroy(&This->baseControlWindow); - CloseHandle(This->hD3d9); + FreeLibrary(This->hD3d9); if (This->allocator) IVMRSurfaceAllocatorEx9_Release(This->allocator); @@ -799,7 +847,7 @@ static const IUnknownVtbl IInner_VTable = static HRESULT WINAPI VMR9_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv) { - VMR9Impl *This = (VMR9Impl *)iface; + struct quartz_vmr *This = (struct quartz_vmr*)iface; if (This->bAggregatable) This->bUnkOuterValid = TRUE; @@ -829,7 +877,7 @@ static HRESULT WINAPI VMR9_QueryInterface(IBaseFilter * iface, REFIID riid, LPVO static ULONG WINAPI VMR9_AddRef(IBaseFilter * iface) { - VMR9Impl *This = (VMR9Impl *)iface; + struct quartz_vmr *This = (struct quartz_vmr*)iface; LONG ret; if (This->outer_unk && This->bUnkOuterValid) @@ -844,7 +892,7 @@ static ULONG WINAPI VMR9_AddRef(IBaseFilter * iface) static ULONG WINAPI VMR9_Release(IBaseFilter * iface) { - VMR9Impl *This = (VMR9Impl *)iface; + struct quartz_vmr *This = (struct quartz_vmr*)iface; LONG ret; if (This->outer_unk && This->bUnkOuterValid) @@ -859,7 +907,7 @@ static ULONG WINAPI VMR9_Release(IBaseFilter * iface) return 0; } -static const IBaseFilterVtbl VMR9_Vtbl = +static const IBaseFilterVtbl VMR_Vtbl = { VMR9_QueryInterface, VMR9_AddRef, @@ -881,7 +929,7 @@ static const IBaseFilterVtbl VMR9_Vtbl = /*** IUnknown methods ***/ static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface, REFIID riid, LPVOID*ppvObj) { - VMR9Impl *This = impl_from_IVideoWindow(iface); + struct quartz_vmr *This = impl_from_IVideoWindow(iface); TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj); @@ -890,7 +938,7 @@ static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface, REFIID rii static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) { - VMR9Impl *This = impl_from_IVideoWindow(iface); + struct quartz_vmr *This = impl_from_IVideoWindow(iface); TRACE("(%p/%p)->()\n", This, iface); @@ -899,7 +947,7 @@ static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) { - VMR9Impl *This = impl_from_IVideoWindow(iface); + struct quartz_vmr *This = impl_from_IVideoWindow(iface); TRACE("(%p/%p)->()\n", This, iface); @@ -959,7 +1007,7 @@ static const IVideoWindowVtbl IVideoWindow_VTable = /*** IUnknown methods ***/ static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface, REFIID riid, LPVOID * ppvObj) { - VMR9Impl *This = impl_from_IBasicVideo(iface); + struct quartz_vmr *This = impl_from_IBasicVideo(iface); TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj); @@ -968,7 +1016,7 @@ static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface, REFIID riid, static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) { - VMR9Impl *This = impl_from_IBasicVideo(iface); + struct quartz_vmr *This = impl_from_IBasicVideo(iface); TRACE("(%p/%p)->()\n", This, iface); @@ -977,7 +1025,7 @@ static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) { - VMR9Impl *This = impl_from_IBasicVideo(iface); + struct quartz_vmr *This = impl_from_IBasicVideo(iface); TRACE("(%p/%p)->()\n", This, iface); @@ -1027,18 +1075,86 @@ static const IBasicVideoVtbl IBasicVideo_VTable = BaseControlVideoImpl_IsUsingDefaultDestination }; +static HRESULT WINAPI AMCertifiedOutputProtection_QueryInterface(IAMCertifiedOutputProtection *iface, + REFIID riid, void **ppv) +{ + struct quartz_vmr *This = impl_from_IAMCertifiedOutputProtection(iface); + return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv); +} + +static ULONG WINAPI AMCertifiedOutputProtection_AddRef(IAMCertifiedOutputProtection *iface) +{ + struct quartz_vmr *This = impl_from_IAMCertifiedOutputProtection(iface); + return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface); +} + +static ULONG WINAPI AMCertifiedOutputProtection_Release(IAMCertifiedOutputProtection *iface) +{ + struct quartz_vmr *This = impl_from_IAMCertifiedOutputProtection(iface); + return VMR9_Release(&This->renderer.filter.IBaseFilter_iface); +} + +static HRESULT WINAPI AMCertifiedOutputProtection_KeyExchange(IAMCertifiedOutputProtection *iface, + GUID* pRandom, BYTE** VarLenCertGH, + DWORD* pdwLengthCertGH) +{ + struct quartz_vmr *This = impl_from_IAMCertifiedOutputProtection(iface); + + FIXME("(%p/%p)->(%p, %p, %p) stub\n", iface, This, pRandom, VarLenCertGH, pdwLengthCertGH); + return VFW_E_NO_COPP_HW; +} + +static HRESULT WINAPI AMCertifiedOutputProtection_SessionSequenceStart(IAMCertifiedOutputProtection *iface, + AMCOPPSignature* pSig) +{ + struct quartz_vmr *This = impl_from_IAMCertifiedOutputProtection(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, pSig); + return VFW_E_NO_COPP_HW; +} + +static HRESULT WINAPI AMCertifiedOutputProtection_ProtectionCommand(IAMCertifiedOutputProtection *iface, + const AMCOPPCommand* cmd) +{ + struct quartz_vmr *This = impl_from_IAMCertifiedOutputProtection(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, cmd); + return VFW_E_NO_COPP_HW; +} + +static HRESULT WINAPI AMCertifiedOutputProtection_ProtectionStatus(IAMCertifiedOutputProtection *iface, + const AMCOPPStatusInput* pStatusInput, + AMCOPPStatusOutput* pStatusOutput) +{ + struct quartz_vmr *This = impl_from_IAMCertifiedOutputProtection(iface); + + FIXME("(%p/%p)->(%p, %p) stub\n", iface, This, pStatusInput, pStatusOutput); + return VFW_E_NO_COPP_HW; +} + +static const IAMCertifiedOutputProtectionVtbl IAMCertifiedOutputProtection_Vtbl = +{ + AMCertifiedOutputProtection_QueryInterface, + AMCertifiedOutputProtection_AddRef, + AMCertifiedOutputProtection_Release, + AMCertifiedOutputProtection_KeyExchange, + AMCertifiedOutputProtection_SessionSequenceStart, + AMCertifiedOutputProtection_ProtectionCommand, + AMCertifiedOutputProtection_ProtectionStatus +}; + static HRESULT WINAPI AMFilterMiscFlags_QueryInterface(IAMFilterMiscFlags *iface, REFIID riid, void **ppv) { - VMR9Impl *This = impl_from_IAMFilterMiscFlags(iface); + struct quartz_vmr *This = impl_from_IAMFilterMiscFlags(iface); return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv); } static ULONG WINAPI AMFilterMiscFlags_AddRef(IAMFilterMiscFlags *iface) { - VMR9Impl *This = impl_from_IAMFilterMiscFlags(iface); + struct quartz_vmr *This = impl_from_IAMFilterMiscFlags(iface); return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface); } static ULONG WINAPI AMFilterMiscFlags_Release(IAMFilterMiscFlags *iface) { - VMR9Impl *This = impl_from_IAMFilterMiscFlags(iface); + struct quartz_vmr *This = impl_from_IAMFilterMiscFlags(iface); return VMR9_Release(&This->renderer.filter.IBaseFilter_iface); } @@ -1053,27 +1169,406 @@ static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl = { AMFilterMiscFlags_GetMiscFlags }; +static HRESULT WINAPI VMR7FilterConfig_QueryInterface(IVMRFilterConfig *iface, REFIID riid, + void** ppv) +{ + struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv); +} + +static ULONG WINAPI VMR7FilterConfig_AddRef(IVMRFilterConfig *iface) +{ + struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface); +} + +static ULONG WINAPI VMR7FilterConfig_Release(IVMRFilterConfig *iface) +{ + struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + return VMR9_Release(&This->renderer.filter.IBaseFilter_iface); +} + +static HRESULT WINAPI VMR7FilterConfig_SetImageCompositor(IVMRFilterConfig *iface, + IVMRImageCompositor *compositor) +{ + struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, compositor); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7FilterConfig_SetNumberOfStreams(IVMRFilterConfig *iface, DWORD max) +{ + struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + + FIXME("(%p/%p)->(%u) stub\n", iface, This, max); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7FilterConfig_GetNumberOfStreams(IVMRFilterConfig *iface, DWORD *max) +{ + struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, max); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7FilterConfig_SetRenderingPrefs(IVMRFilterConfig *iface, DWORD renderflags) +{ + struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + + FIXME("(%p/%p)->(%u) stub\n", iface, This, renderflags); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7FilterConfig_GetRenderingPrefs(IVMRFilterConfig *iface, DWORD *renderflags) +{ + struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, renderflags); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7FilterConfig_SetRenderingMode(IVMRFilterConfig *iface, DWORD mode) +{ + struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + + FIXME("(%p/%p)->(%u) stub\n", iface, This, mode); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7FilterConfig_GetRenderingMode(IVMRFilterConfig *iface, DWORD *mode) +{ + struct quartz_vmr *This = impl_from_IVMRFilterConfig(iface); + + TRACE("(%p/%p)->(%p) stub\n", iface, This, mode); + if (!mode) return E_POINTER; + + if (This->mode) + *mode = This->mode; + else + *mode = VMRMode_Windowed; + + return S_OK; +} + +static const IVMRFilterConfigVtbl VMR7_FilterConfig_Vtbl = +{ + VMR7FilterConfig_QueryInterface, + VMR7FilterConfig_AddRef, + VMR7FilterConfig_Release, + VMR7FilterConfig_SetImageCompositor, + VMR7FilterConfig_SetNumberOfStreams, + VMR7FilterConfig_GetNumberOfStreams, + VMR7FilterConfig_SetRenderingPrefs, + VMR7FilterConfig_GetRenderingPrefs, + VMR7FilterConfig_SetRenderingMode, + VMR7FilterConfig_GetRenderingMode +}; + +struct get_available_monitors_args +{ + VMRMONITORINFO *info7; + VMR9MonitorInfo *info9; + DWORD arraysize; + DWORD numdev; +}; + +static BOOL CALLBACK get_available_monitors_proc(HMONITOR hmon, HDC hdc, LPRECT lprc, LPARAM lparam) +{ + struct get_available_monitors_args *args = (struct get_available_monitors_args *)lparam; + MONITORINFOEXW mi; + + if (args->info7 || args->info9) + { + + if (!args->arraysize) + return FALSE; + + mi.cbSize = sizeof(mi); + if (!GetMonitorInfoW(hmon, (MONITORINFO*)&mi)) + return TRUE; + + /* fill VMRMONITORINFO struct */ + if (args->info7) + { + VMRMONITORINFO *info = args->info7++; + memset(info, 0, sizeof(*info)); + + if (args->numdev > 0) + { + info->guid.pGUID = &info->guid.GUID; + info->guid.GUID.Data4[7] = args->numdev; + } + else + info->guid.pGUID = NULL; + + CopyRect(&info->rcMonitor, &mi.rcMonitor); + info->hMon = hmon; + info->dwFlags = mi.dwFlags; + + lstrcpynW(info->szDevice, mi.szDevice, sizeof(info->szDevice)/sizeof(WCHAR)); + + /* FIXME: how to get these values? */ + info->szDescription[0] = 0; + } + + /* fill VMR9MonitorInfo struct */ + if (args->info9) + { + VMR9MonitorInfo *info = args->info9++; + memset(info, 0, sizeof(*info)); + + info->uDevID = 0; /* FIXME */ + CopyRect(&info->rcMonitor, &mi.rcMonitor); + info->hMon = hmon; + info->dwFlags = mi.dwFlags; + + lstrcpynW(info->szDevice, mi.szDevice, sizeof(info->szDevice)/sizeof(WCHAR)); + + /* FIXME: how to get these values? */ + info->szDescription[0] = 0; + info->dwVendorId = 0; + info->dwDeviceId = 0; + info->dwSubSysId = 0; + info->dwRevision = 0; + } + + args->arraysize--; + } + + args->numdev++; + return TRUE; +} + +static HRESULT WINAPI VMR7MonitorConfig_QueryInterface(IVMRMonitorConfig *iface, REFIID riid, + LPVOID * ppv) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig(iface); + return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv); +} + +static ULONG WINAPI VMR7MonitorConfig_AddRef(IVMRMonitorConfig *iface) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig(iface); + return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface); +} + +static ULONG WINAPI VMR7MonitorConfig_Release(IVMRMonitorConfig *iface) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig(iface); + return VMR9_Release(&This->renderer.filter.IBaseFilter_iface); +} + +static HRESULT WINAPI VMR7MonitorConfig_SetMonitor(IVMRMonitorConfig *iface, const VMRGUID *pGUID) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID); + + if (!pGUID) + return E_POINTER; + + return S_OK; +} + +static HRESULT WINAPI VMR7MonitorConfig_GetMonitor(IVMRMonitorConfig *iface, VMRGUID *pGUID) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID); + + if (!pGUID) + return E_POINTER; + + pGUID->pGUID = NULL; /* default DirectDraw device */ + return S_OK; +} + +static HRESULT WINAPI VMR7MonitorConfig_SetDefaultMonitor(IVMRMonitorConfig *iface, + const VMRGUID *pGUID) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID); + + if (!pGUID) + return E_POINTER; + + return S_OK; +} + +static HRESULT WINAPI VMR7MonitorConfig_GetDefaultMonitor(IVMRMonitorConfig *iface, VMRGUID *pGUID) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID); + + if (!pGUID) + return E_POINTER; + + pGUID->pGUID = NULL; /* default DirectDraw device */ + return S_OK; +} + +static HRESULT WINAPI VMR7MonitorConfig_GetAvailableMonitors(IVMRMonitorConfig *iface, + VMRMONITORINFO *info, DWORD arraysize, + DWORD *numdev) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig(iface); + struct get_available_monitors_args args; + + FIXME("(%p/%p)->(%p, %u, %p) semi-stub\n", iface, This, info, arraysize, numdev); + + if (!numdev) + return E_POINTER; + + if (info && arraysize == 0) + return E_INVALIDARG; + + args.info7 = info; + args.info9 = NULL; + args.arraysize = arraysize; + args.numdev = 0; + EnumDisplayMonitors(NULL, NULL, get_available_monitors_proc, (LPARAM)&args); + + *numdev = args.numdev; + return S_OK; +} + +static const IVMRMonitorConfigVtbl VMR7_MonitorConfig_Vtbl = +{ + VMR7MonitorConfig_QueryInterface, + VMR7MonitorConfig_AddRef, + VMR7MonitorConfig_Release, + VMR7MonitorConfig_SetMonitor, + VMR7MonitorConfig_GetMonitor, + VMR7MonitorConfig_SetDefaultMonitor, + VMR7MonitorConfig_GetDefaultMonitor, + VMR7MonitorConfig_GetAvailableMonitors +}; + +static HRESULT WINAPI VMR9MonitorConfig_QueryInterface(IVMRMonitorConfig9 *iface, REFIID riid, + LPVOID * ppv) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig9(iface); + return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv); +} + +static ULONG WINAPI VMR9MonitorConfig_AddRef(IVMRMonitorConfig9 *iface) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig9(iface); + return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface); +} + +static ULONG WINAPI VMR9MonitorConfig_Release(IVMRMonitorConfig9 *iface) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig9(iface); + return VMR9_Release(&This->renderer.filter.IBaseFilter_iface); +} + +static HRESULT WINAPI VMR9MonitorConfig_SetMonitor(IVMRMonitorConfig9 *iface, UINT uDev) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig9(iface); + + FIXME("(%p/%p)->(%u) stub\n", iface, This, uDev); + + return S_OK; +} + +static HRESULT WINAPI VMR9MonitorConfig_GetMonitor(IVMRMonitorConfig9 *iface, UINT *uDev) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig9(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, uDev); + + if (!uDev) + return E_POINTER; + + *uDev = 0; + return S_OK; +} + +static HRESULT WINAPI VMR9MonitorConfig_SetDefaultMonitor(IVMRMonitorConfig9 *iface, UINT uDev) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig9(iface); + + FIXME("(%p/%p)->(%u) stub\n", iface, This, uDev); + + return S_OK; +} + +static HRESULT WINAPI VMR9MonitorConfig_GetDefaultMonitor(IVMRMonitorConfig9 *iface, UINT *uDev) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig9(iface); + + FIXME("(%p/%p)->(%p) stub\n", iface, This, uDev); + + if (!uDev) + return E_POINTER; + + *uDev = 0; + return S_OK; +} + +static HRESULT WINAPI VMR9MonitorConfig_GetAvailableMonitors(IVMRMonitorConfig9 *iface, + VMR9MonitorInfo *info, DWORD arraysize, + DWORD *numdev) +{ + struct quartz_vmr *This = impl_from_IVMRMonitorConfig9(iface); + struct get_available_monitors_args args; + + FIXME("(%p/%p)->(%p, %u, %p) semi-stub\n", iface, This, info, arraysize, numdev); + + if (!numdev) + return E_POINTER; + + if (info && arraysize == 0) + return E_INVALIDARG; + + args.info7 = NULL; + args.info9 = info; + args.arraysize = arraysize; + args.numdev = 0; + EnumDisplayMonitors(NULL, NULL, get_available_monitors_proc, (LPARAM)&args); + + *numdev = args.numdev; + return S_OK; +} + +static const IVMRMonitorConfig9Vtbl VMR9_MonitorConfig_Vtbl = +{ + VMR9MonitorConfig_QueryInterface, + VMR9MonitorConfig_AddRef, + VMR9MonitorConfig_Release, + VMR9MonitorConfig_SetMonitor, + VMR9MonitorConfig_GetMonitor, + VMR9MonitorConfig_SetDefaultMonitor, + VMR9MonitorConfig_GetDefaultMonitor, + VMR9MonitorConfig_GetAvailableMonitors +}; + static HRESULT WINAPI VMR9FilterConfig_QueryInterface(IVMRFilterConfig9 *iface, REFIID riid, LPVOID * ppv) { - VMR9Impl *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv); } static ULONG WINAPI VMR9FilterConfig_AddRef(IVMRFilterConfig9 *iface) { - VMR9Impl *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface); } static ULONG WINAPI VMR9FilterConfig_Release(IVMRFilterConfig9 *iface) { - VMR9Impl *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); return VMR9_Release(&This->renderer.filter.IBaseFilter_iface); } static HRESULT WINAPI VMR9FilterConfig_SetImageCompositor(IVMRFilterConfig9 *iface, IVMRImageCompositor9 *compositor) { - VMR9Impl *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); FIXME("(%p/%p)->(%p) stub\n", iface, This, compositor); return E_NOTIMPL; @@ -1081,7 +1576,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetImageCompositor(IVMRFilterConfig9 *ifa static HRESULT WINAPI VMR9FilterConfig_SetNumberOfStreams(IVMRFilterConfig9 *iface, DWORD max) { - VMR9Impl *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); FIXME("(%p/%p)->(%u) stub\n", iface, This, max); return E_NOTIMPL; @@ -1089,7 +1584,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetNumberOfStreams(IVMRFilterConfig9 *ifa static HRESULT WINAPI VMR9FilterConfig_GetNumberOfStreams(IVMRFilterConfig9 *iface, DWORD *max) { - VMR9Impl *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); FIXME("(%p/%p)->(%p) stub\n", iface, This, max); return E_NOTIMPL; @@ -1097,7 +1592,7 @@ static HRESULT WINAPI VMR9FilterConfig_GetNumberOfStreams(IVMRFilterConfig9 *ifa static HRESULT WINAPI VMR9FilterConfig_SetRenderingPrefs(IVMRFilterConfig9 *iface, DWORD renderflags) { - VMR9Impl *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); FIXME("(%p/%p)->(%u) stub\n", iface, This, renderflags); return E_NOTIMPL; @@ -1105,7 +1600,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingPrefs(IVMRFilterConfig9 *ifac static HRESULT WINAPI VMR9FilterConfig_GetRenderingPrefs(IVMRFilterConfig9 *iface, DWORD *renderflags) { - VMR9Impl *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); FIXME("(%p/%p)->(%p) stub\n", iface, This, renderflags); return E_NOTIMPL; @@ -1114,7 +1609,7 @@ static HRESULT WINAPI VMR9FilterConfig_GetRenderingPrefs(IVMRFilterConfig9 *ifac static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface, DWORD mode) { HRESULT hr = S_OK; - VMR9Impl *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); TRACE("(%p/%p)->(%u)\n", iface, This, mode); @@ -1167,7 +1662,7 @@ static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode(IVMRFilterConfig9 *iface static HRESULT WINAPI VMR9FilterConfig_GetRenderingMode(IVMRFilterConfig9 *iface, DWORD *mode) { - VMR9Impl *This = impl_from_IVMRFilterConfig9(iface); + struct quartz_vmr *This = impl_from_IVMRFilterConfig9(iface); TRACE("(%p/%p)->(%p) stub\n", iface, This, mode); if (!mode) @@ -1195,27 +1690,238 @@ static const IVMRFilterConfig9Vtbl VMR9_FilterConfig_Vtbl = VMR9FilterConfig_GetRenderingMode }; +static HRESULT WINAPI VMR7WindowlessControl_QueryInterface(IVMRWindowlessControl *iface, REFIID riid, + LPVOID * ppv) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv); +} + +static ULONG WINAPI VMR7WindowlessControl_AddRef(IVMRWindowlessControl *iface) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface); +} + +static ULONG WINAPI VMR7WindowlessControl_Release(IVMRWindowlessControl *iface) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + return VMR9_Release(&This->renderer.filter.IBaseFilter_iface); +} + +static HRESULT WINAPI VMR7WindowlessControl_GetNativeVideoSize(IVMRWindowlessControl *iface, + LONG *width, LONG *height, + LONG *arwidth, LONG *arheight) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + TRACE("(%p/%p)->(%p, %p, %p, %p)\n", iface, This, width, height, arwidth, arheight); + + if (!width || !height || !arwidth || !arheight) + { + ERR("Got no pointer\n"); + return E_POINTER; + } + + *width = This->bmiheader.biWidth; + *height = This->bmiheader.biHeight; + *arwidth = This->bmiheader.biWidth; + *arheight = This->bmiheader.biHeight; + + return S_OK; +} + +static HRESULT WINAPI VMR7WindowlessControl_GetMinIdealVideoSize(IVMRWindowlessControl *iface, + LONG *width, LONG *height) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_GetMaxIdealVideoSize(IVMRWindowlessControl *iface, + LONG *width, LONG *height) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_SetVideoPosition(IVMRWindowlessControl *iface, + const RECT *source, const RECT *dest) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + TRACE("(%p/%p)->(%p, %p)\n", iface, This, source, dest); + + EnterCriticalSection(&This->renderer.filter.csFilter); + + if (source) + This->source_rect = *source; + if (dest) + { + This->target_rect = *dest; + if (This->baseControlWindow.baseWindow.hWnd) + { + FIXME("Output rectangle: starting at %dx%d, up to point %dx%d\n", + dest->left, dest->top, dest->right, dest->bottom); + SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL, + dest->left, dest->top, dest->right - dest->left, dest->bottom-dest->top, + SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_NOOWNERZORDER|SWP_NOREDRAW); + } + } + + LeaveCriticalSection(&This->renderer.filter.csFilter); + + return S_OK; +} + +static HRESULT WINAPI VMR7WindowlessControl_GetVideoPosition(IVMRWindowlessControl *iface, + RECT *source, RECT *dest) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + if (source) + *source = This->source_rect; + + if (dest) + *dest = This->target_rect; + + FIXME("(%p/%p)->(%p/%p) stub\n", iface, This, source, dest); + return S_OK; +} + +static HRESULT WINAPI VMR7WindowlessControl_GetAspectRatioMode(IVMRWindowlessControl *iface, + DWORD *mode) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_SetAspectRatioMode(IVMRWindowlessControl *iface, + DWORD mode) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_SetVideoClippingWindow(IVMRWindowlessControl *iface, + HWND hwnd) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_RepaintVideo(IVMRWindowlessControl *iface, + HWND hwnd, HDC hdc) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_DisplayModeChanged(IVMRWindowlessControl *iface) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_GetCurrentImage(IVMRWindowlessControl *iface, + BYTE **dib) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_SetBorderColor(IVMRWindowlessControl *iface, + COLORREF color) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_GetBorderColor(IVMRWindowlessControl *iface, + COLORREF *color) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_SetColorKey(IVMRWindowlessControl *iface, COLORREF color) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7WindowlessControl_GetColorKey(IVMRWindowlessControl *iface, COLORREF *color) +{ + struct quartz_vmr *This = impl_from_IVMRWindowlessControl(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static const IVMRWindowlessControlVtbl VMR7_WindowlessControl_Vtbl = +{ + VMR7WindowlessControl_QueryInterface, + VMR7WindowlessControl_AddRef, + VMR7WindowlessControl_Release, + VMR7WindowlessControl_GetNativeVideoSize, + VMR7WindowlessControl_GetMinIdealVideoSize, + VMR7WindowlessControl_GetMaxIdealVideoSize, + VMR7WindowlessControl_SetVideoPosition, + VMR7WindowlessControl_GetVideoPosition, + VMR7WindowlessControl_GetAspectRatioMode, + VMR7WindowlessControl_SetAspectRatioMode, + VMR7WindowlessControl_SetVideoClippingWindow, + VMR7WindowlessControl_RepaintVideo, + VMR7WindowlessControl_DisplayModeChanged, + VMR7WindowlessControl_GetCurrentImage, + VMR7WindowlessControl_SetBorderColor, + VMR7WindowlessControl_GetBorderColor, + VMR7WindowlessControl_SetColorKey, + VMR7WindowlessControl_GetColorKey +}; + static HRESULT WINAPI VMR9WindowlessControl_QueryInterface(IVMRWindowlessControl9 *iface, REFIID riid, LPVOID * ppv) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv); } static ULONG WINAPI VMR9WindowlessControl_AddRef(IVMRWindowlessControl9 *iface) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface); } static ULONG WINAPI VMR9WindowlessControl_Release(IVMRWindowlessControl9 *iface) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); return VMR9_Release(&This->renderer.filter.IBaseFilter_iface); } static HRESULT WINAPI VMR9WindowlessControl_GetNativeVideoSize(IVMRWindowlessControl9 *iface, LONG *width, LONG *height, LONG *arwidth, LONG *arheight) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); TRACE("(%p/%p)->(%p, %p, %p, %p)\n", iface, This, width, height, arwidth, arheight); if (!width || !height || !arwidth || !arheight) @@ -1234,7 +1940,7 @@ static HRESULT WINAPI VMR9WindowlessControl_GetNativeVideoSize(IVMRWindowlessCon static HRESULT WINAPI VMR9WindowlessControl_GetMinIdealVideoSize(IVMRWindowlessControl9 *iface, LONG *width, LONG *height) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); FIXME("(%p/%p)->(...) stub\n", iface, This); return E_NOTIMPL; @@ -1242,7 +1948,7 @@ static HRESULT WINAPI VMR9WindowlessControl_GetMinIdealVideoSize(IVMRWindowlessC static HRESULT WINAPI VMR9WindowlessControl_GetMaxIdealVideoSize(IVMRWindowlessControl9 *iface, LONG *width, LONG *height) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); FIXME("(%p/%p)->(...) stub\n", iface, This); return E_NOTIMPL; @@ -1250,7 +1956,7 @@ static HRESULT WINAPI VMR9WindowlessControl_GetMaxIdealVideoSize(IVMRWindowlessC static HRESULT WINAPI VMR9WindowlessControl_SetVideoPosition(IVMRWindowlessControl9 *iface, const RECT *source, const RECT *dest) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); TRACE("(%p/%p)->(%p, %p)\n", iface, This, source, dest); @@ -1276,7 +1982,7 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoPosition(IVMRWindowlessContr static HRESULT WINAPI VMR9WindowlessControl_GetVideoPosition(IVMRWindowlessControl9 *iface, RECT *source, RECT *dest) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); if (source) *source = This->source_rect; @@ -1290,7 +1996,7 @@ static HRESULT WINAPI VMR9WindowlessControl_GetVideoPosition(IVMRWindowlessContr static HRESULT WINAPI VMR9WindowlessControl_GetAspectRatioMode(IVMRWindowlessControl9 *iface, DWORD *mode) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); FIXME("(%p/%p)->(...) stub\n", iface, This); return E_NOTIMPL; @@ -1298,7 +2004,7 @@ static HRESULT WINAPI VMR9WindowlessControl_GetAspectRatioMode(IVMRWindowlessCon static HRESULT WINAPI VMR9WindowlessControl_SetAspectRatioMode(IVMRWindowlessControl9 *iface, DWORD mode) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); FIXME("(%p/%p)->(...) stub\n", iface, This); return E_NOTIMPL; @@ -1306,7 +2012,7 @@ static HRESULT WINAPI VMR9WindowlessControl_SetAspectRatioMode(IVMRWindowlessCon static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowlessControl9 *iface, HWND hwnd) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); TRACE("(%p/%p)->(%p)\n", iface, This, hwnd); @@ -1321,7 +2027,7 @@ static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow(IVMRWindowles static HRESULT WINAPI VMR9WindowlessControl_RepaintVideo(IVMRWindowlessControl9 *iface, HWND hwnd, HDC hdc) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); HRESULT hr; FIXME("(%p/%p)->(...) semi-stub\n", iface, This); @@ -1350,7 +2056,7 @@ static HRESULT WINAPI VMR9WindowlessControl_RepaintVideo(IVMRWindowlessControl9 static HRESULT WINAPI VMR9WindowlessControl_DisplayModeChanged(IVMRWindowlessControl9 *iface) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); FIXME("(%p/%p)->(...) stub\n", iface, This); return E_NOTIMPL; @@ -1358,7 +2064,7 @@ static HRESULT WINAPI VMR9WindowlessControl_DisplayModeChanged(IVMRWindowlessCon static HRESULT WINAPI VMR9WindowlessControl_GetCurrentImage(IVMRWindowlessControl9 *iface, BYTE **dib) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); FIXME("(%p/%p)->(...) stub\n", iface, This); return E_NOTIMPL; @@ -1366,7 +2072,7 @@ static HRESULT WINAPI VMR9WindowlessControl_GetCurrentImage(IVMRWindowlessContro static HRESULT WINAPI VMR9WindowlessControl_SetBorderColor(IVMRWindowlessControl9 *iface, COLORREF color) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); FIXME("(%p/%p)->(...) stub\n", iface, This); return E_NOTIMPL; @@ -1374,7 +2080,7 @@ static HRESULT WINAPI VMR9WindowlessControl_SetBorderColor(IVMRWindowlessControl static HRESULT WINAPI VMR9WindowlessControl_GetBorderColor(IVMRWindowlessControl9 *iface, COLORREF *color) { - VMR9Impl *This = impl_from_IVMRWindowlessControl9(iface); + struct quartz_vmr *This = impl_from_IVMRWindowlessControl9(iface); FIXME("(%p/%p)->(...) stub\n", iface, This); return E_NOTIMPL; @@ -1400,27 +2106,113 @@ static const IVMRWindowlessControl9Vtbl VMR9_WindowlessControl_Vtbl = VMR9WindowlessControl_GetBorderColor }; +static HRESULT WINAPI VMR7SurfaceAllocatorNotify_QueryInterface(IVMRSurfaceAllocatorNotify *iface, + REFIID riid, LPVOID * ppv) +{ + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify(iface); + return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv); +} + +static ULONG WINAPI VMR7SurfaceAllocatorNotify_AddRef(IVMRSurfaceAllocatorNotify *iface) +{ + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify(iface); + return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface); +} + +static ULONG WINAPI VMR7SurfaceAllocatorNotify_Release(IVMRSurfaceAllocatorNotify *iface) +{ + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify(iface); + return VMR9_Release(&This->renderer.filter.IBaseFilter_iface); +} + +static HRESULT WINAPI VMR7SurfaceAllocatorNotify_AdviseSurfaceAllocator(IVMRSurfaceAllocatorNotify *iface, + DWORD_PTR id, + IVMRSurfaceAllocator *alloc) +{ + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7SurfaceAllocatorNotify_SetDDrawDevice(IVMRSurfaceAllocatorNotify *iface, + IDirectDraw7 *device, HMONITOR monitor) +{ + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7SurfaceAllocatorNotify_ChangeDDrawDevice(IVMRSurfaceAllocatorNotify *iface, + IDirectDraw7 *device, HMONITOR monitor) +{ + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7SurfaceAllocatorNotify_RestoreDDrawSurfaces(IVMRSurfaceAllocatorNotify *iface) +{ + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7SurfaceAllocatorNotify_NotifyEvent(IVMRSurfaceAllocatorNotify *iface, LONG code, + LONG_PTR param1, LONG_PTR param2) +{ + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static HRESULT WINAPI VMR7SurfaceAllocatorNotify_SetBorderColor(IVMRSurfaceAllocatorNotify *iface, + COLORREF clrBorder) +{ + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify(iface); + + FIXME("(%p/%p)->(...) stub\n", iface, This); + return E_NOTIMPL; +} + +static const IVMRSurfaceAllocatorNotifyVtbl VMR7_SurfaceAllocatorNotify_Vtbl = +{ + VMR7SurfaceAllocatorNotify_QueryInterface, + VMR7SurfaceAllocatorNotify_AddRef, + VMR7SurfaceAllocatorNotify_Release, + VMR7SurfaceAllocatorNotify_AdviseSurfaceAllocator, + VMR7SurfaceAllocatorNotify_SetDDrawDevice, + VMR7SurfaceAllocatorNotify_ChangeDDrawDevice, + VMR7SurfaceAllocatorNotify_RestoreDDrawSurfaces, + VMR7SurfaceAllocatorNotify_NotifyEvent, + VMR7SurfaceAllocatorNotify_SetBorderColor +}; + static HRESULT WINAPI VMR9SurfaceAllocatorNotify_QueryInterface(IVMRSurfaceAllocatorNotify9 *iface, REFIID riid, LPVOID * ppv) { - VMR9Impl *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv); } static ULONG WINAPI VMR9SurfaceAllocatorNotify_AddRef(IVMRSurfaceAllocatorNotify9 *iface) { - VMR9Impl *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface); } static ULONG WINAPI VMR9SurfaceAllocatorNotify_Release(IVMRSurfaceAllocatorNotify9 *iface) { - VMR9Impl *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); return VMR9_Release(&This->renderer.filter.IBaseFilter_iface); } static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator(IVMRSurfaceAllocatorNotify9 *iface, DWORD_PTR id, IVMRSurfaceAllocator9 *alloc) { - VMR9Impl *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); /* FIXME: This code is not tested!!! */ FIXME("(%p/%p)->(...) stub\n", iface, This); @@ -1446,7 +2238,7 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator(IVMRSurf static HRESULT WINAPI VMR9SurfaceAllocatorNotify_SetD3DDevice(IVMRSurfaceAllocatorNotify9 *iface, IDirect3DDevice9 *device, HMONITOR monitor) { - VMR9Impl *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); FIXME("(%p/%p)->(...) semi-stub\n", iface, This); if (This->allocator_d3d9_dev) @@ -1460,7 +2252,7 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_SetD3DDevice(IVMRSurfaceAllocat static HRESULT WINAPI VMR9SurfaceAllocatorNotify_ChangeD3DDevice(IVMRSurfaceAllocatorNotify9 *iface, IDirect3DDevice9 *device, HMONITOR monitor) { - VMR9Impl *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); FIXME("(%p/%p)->(...) semi-stub\n", iface, This); if (This->allocator_d3d9_dev) @@ -1474,7 +2266,7 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_ChangeD3DDevice(IVMRSurfaceAllo static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AllocateSurfaceHelper(IVMRSurfaceAllocatorNotify9 *iface, VMR9AllocationInfo *allocinfo, DWORD *numbuffers, IDirect3DSurface9 **surface) { - VMR9Impl *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); DWORD i; HRESULT hr = S_OK; @@ -1542,13 +2334,13 @@ static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AllocateSurfaceHelper(IVMRSurfa static HRESULT WINAPI VMR9SurfaceAllocatorNotify_NotifyEvent(IVMRSurfaceAllocatorNotify9 *iface, LONG code, LONG_PTR param1, LONG_PTR param2) { - VMR9Impl *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); + struct quartz_vmr *This = impl_from_IVMRSurfaceAllocatorNotify9(iface); FIXME("(%p/%p)->(...) stub\n", iface, This); return E_NOTIMPL; } -static const IVMRSurfaceAllocatorNotify9Vtbl IVMRSurfaceAllocatorNotify9_Vtbl = +static const IVMRSurfaceAllocatorNotify9Vtbl VMR9_SurfaceAllocatorNotify_Vtbl = { VMR9SurfaceAllocatorNotify_QueryInterface, VMR9SurfaceAllocatorNotify_AddRef, @@ -1560,67 +2352,92 @@ static const IVMRSurfaceAllocatorNotify9Vtbl IVMRSurfaceAllocatorNotify9_Vtbl = VMR9SurfaceAllocatorNotify_NotifyEvent }; -HRESULT VMR9Impl_create(IUnknown * outer_unk, LPVOID * ppv) +static HRESULT vmr_create(IUnknown *outer_unk, LPVOID *ppv, const CLSID *clsid) { HRESULT hr; - VMR9Impl * pVMR9; + struct quartz_vmr* pVMR; TRACE("(%p, %p)\n", outer_unk, ppv); *ppv = NULL; - pVMR9 = CoTaskMemAlloc(sizeof(VMR9Impl)); + pVMR = CoTaskMemAlloc(sizeof(struct quartz_vmr)); - pVMR9->hD3d9 = LoadLibraryA("d3d9.dll"); - if (!pVMR9->hD3d9 ) + pVMR->hD3d9 = LoadLibraryA("d3d9.dll"); + if (!pVMR->hD3d9 ) { WARN("Could not load d3d9.dll\n"); - CoTaskMemFree(pVMR9); + CoTaskMemFree(pVMR); return VFW_E_DDRAW_CAPS_NOT_SUITABLE; } - pVMR9->outer_unk = outer_unk; - pVMR9->bUnkOuterValid = FALSE; - pVMR9->bAggregatable = FALSE; - pVMR9->IUnknown_inner.lpVtbl = &IInner_VTable; - pVMR9->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_Vtbl; + pVMR->outer_unk = outer_unk; + pVMR->bUnkOuterValid = FALSE; + pVMR->bAggregatable = FALSE; + pVMR->IUnknown_inner.lpVtbl = &IInner_VTable; + pVMR->IAMCertifiedOutputProtection_iface.lpVtbl = &IAMCertifiedOutputProtection_Vtbl; + pVMR->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_Vtbl; - pVMR9->mode = 0; - pVMR9->allocator_d3d9_dev = NULL; - pVMR9->allocator_mon= NULL; - pVMR9->num_surfaces = pVMR9->cur_surface = 0; - pVMR9->allocator = NULL; - pVMR9->presenter = NULL; - pVMR9->hWndClippingWindow = NULL; - pVMR9->IVMRFilterConfig9_iface.lpVtbl = &VMR9_FilterConfig_Vtbl; - pVMR9->IVMRWindowlessControl9_iface.lpVtbl = &VMR9_WindowlessControl_Vtbl; - pVMR9->IVMRSurfaceAllocatorNotify9_iface.lpVtbl = &IVMRSurfaceAllocatorNotify9_Vtbl; + pVMR->mode = 0; + pVMR->allocator_d3d9_dev = NULL; + pVMR->allocator_mon= NULL; + pVMR->num_surfaces = pVMR->cur_surface = 0; + pVMR->allocator = NULL; + pVMR->presenter = NULL; + pVMR->hWndClippingWindow = NULL; + pVMR->IVMRFilterConfig_iface.lpVtbl = &VMR7_FilterConfig_Vtbl; + pVMR->IVMRFilterConfig9_iface.lpVtbl = &VMR9_FilterConfig_Vtbl; + pVMR->IVMRMonitorConfig_iface.lpVtbl = &VMR7_MonitorConfig_Vtbl; + pVMR->IVMRMonitorConfig9_iface.lpVtbl = &VMR9_MonitorConfig_Vtbl; + pVMR->IVMRSurfaceAllocatorNotify_iface.lpVtbl = &VMR7_SurfaceAllocatorNotify_Vtbl; + pVMR->IVMRSurfaceAllocatorNotify9_iface.lpVtbl = &VMR9_SurfaceAllocatorNotify_Vtbl; + pVMR->IVMRWindowlessControl_iface.lpVtbl = &VMR7_WindowlessControl_Vtbl; + pVMR->IVMRWindowlessControl9_iface.lpVtbl = &VMR9_WindowlessControl_Vtbl; + + if (IsEqualGUID(clsid, &CLSID_VideoMixingRenderer)) + hr = BaseRenderer_Init(&pVMR->renderer, &VMR_Vtbl, outer_unk, &CLSID_VideoMixingRenderer, + (DWORD_PTR)(__FILE__ ": VMR7Impl.csFilter"), &BaseFuncTable); + else + hr = BaseRenderer_Init(&pVMR->renderer, &VMR_Vtbl, outer_unk, &CLSID_VideoMixingRenderer9, + (DWORD_PTR)(__FILE__ ": VMR9Impl.csFilter"), &BaseFuncTable); - hr = BaseRenderer_Init(&pVMR9->renderer, &VMR9_Vtbl, outer_unk, &CLSID_VideoMixingRenderer9, (DWORD_PTR)(__FILE__ ": VMR9Impl.csFilter"), &BaseFuncTable); if (FAILED(hr)) goto fail; - hr = BaseControlWindow_Init(&pVMR9->baseControlWindow, &IVideoWindow_VTable, &pVMR9->renderer.filter, &pVMR9->renderer.filter.csFilter, &pVMR9->renderer.pInputPin->pin, &renderer_BaseWindowFuncTable); + hr = BaseControlWindow_Init(&pVMR->baseControlWindow, &IVideoWindow_VTable, &pVMR->renderer.filter, + &pVMR->renderer.filter.csFilter, &pVMR->renderer.pInputPin->pin, + &renderer_BaseWindowFuncTable); if (FAILED(hr)) goto fail; - hr = BaseControlVideo_Init(&pVMR9->baseControlVideo, &IBasicVideo_VTable, &pVMR9->renderer.filter, &pVMR9->renderer.filter.csFilter, &pVMR9->renderer.pInputPin->pin, &renderer_BaseControlVideoFuncTable); + hr = BaseControlVideo_Init(&pVMR->baseControlVideo, &IBasicVideo_VTable, &pVMR->renderer.filter, + &pVMR->renderer.filter.csFilter, &pVMR->renderer.pInputPin->pin, + &renderer_BaseControlVideoFuncTable); if (FAILED(hr)) goto fail; - *ppv = (LPVOID)pVMR9; - ZeroMemory(&pVMR9->source_rect, sizeof(RECT)); - ZeroMemory(&pVMR9->target_rect, sizeof(RECT)); - TRACE("Created at %p\n", pVMR9); + *ppv = (LPVOID)pVMR; + ZeroMemory(&pVMR->source_rect, sizeof(RECT)); + ZeroMemory(&pVMR->target_rect, sizeof(RECT)); + TRACE("Created at %p\n", pVMR); return hr; fail: - BaseRendererImpl_Release(&pVMR9->renderer.filter.IBaseFilter_iface); - CloseHandle(pVMR9->hD3d9); - CoTaskMemFree(pVMR9); + BaseRendererImpl_Release(&pVMR->renderer.filter.IBaseFilter_iface); + FreeLibrary(pVMR->hD3d9); + CoTaskMemFree(pVMR); return hr; } +HRESULT VMR7Impl_create(IUnknown *outer_unk, LPVOID *ppv) +{ + return vmr_create(outer_unk, ppv, &CLSID_VideoMixingRenderer); +} + +HRESULT VMR9Impl_create(IUnknown *outer_unk, LPVOID *ppv) +{ + return vmr_create(outer_unk, ppv, &CLSID_VideoMixingRenderer9); +} static HRESULT WINAPI VMR9_ImagePresenter_QueryInterface(IVMRImagePresenter9 *iface, REFIID riid, LPVOID * ppv) @@ -2229,7 +3046,7 @@ static IDirect3D9 *init_d3d9(HMODULE d3d9_handle) return d3d9_create(D3D_SDK_VERSION); } -static HRESULT VMR9DefaultAllocatorPresenterImpl_create(VMR9Impl *parent, LPVOID * ppv) +static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *parent, LPVOID * ppv) { HRESULT hr = S_OK; int i; diff --git a/reactos/include/reactos/wine/strmbase.h b/reactos/include/reactos/wine/strmbase.h index ecb53c41c6d..9727fb419e2 100644 --- a/reactos/include/reactos/wine/strmbase.h +++ b/reactos/include/reactos/wine/strmbase.h @@ -71,6 +71,8 @@ typedef HRESULT (WINAPI *BaseOutputPin_DecideAllocator)(BaseOutputPin *This, IMe typedef HRESULT (WINAPI *BaseOutputPin_BreakConnect)(BaseOutputPin * This); typedef struct BaseOutputPinFuncTable { + BasePinFuncTable base; + /* Required for BaseOutputPinImpl_DecideAllocator */ BaseOutputPin_DecideBufferSize pfnDecideBufferSize; /* Required for BaseOutputPinImpl_AttemptConnection */ @@ -94,6 +96,7 @@ typedef struct BaseInputPin typedef HRESULT (WINAPI *BaseInputPin_Receive)(BaseInputPin *This, IMediaSample *pSample); typedef struct BaseInputPinFuncTable { + BasePinFuncTable base; /* Optional */ BaseInputPin_Receive pfnReceive; } BaseInputPinFuncTable; @@ -132,7 +135,7 @@ HRESULT WINAPI BaseOutputPinImpl_InitAllocator(BaseOutputPin *This, IMemAllocato HRESULT WINAPI BaseOutputPinImpl_DecideAllocator(BaseOutputPin *This, IMemInputPin *pPin, IMemAllocator **pAlloc); HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin *This, IPin * pReceivePin, const AM_MEDIA_TYPE * pmt); -HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BasePinFuncTable* pBaseFuncsTable, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin ** ppPin); +HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin ** ppPin); /* Base Input Pin */ HRESULT WINAPI BaseInputPinImpl_QueryInterface(IPin * iface, REFIID riid, LPVOID * ppv); @@ -145,7 +148,9 @@ HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface); HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface); HRESULT WINAPI BaseInputPinImpl_NewSegment(IPin * iface, REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); -HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, const BasePinFuncTable* pBaseFuncsTable, const BaseInputPinFuncTable* pBaseInputFuncsTable, LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin ** ppPin); +HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO * pPinInfo, + const BaseInputPinFuncTable* pBaseInputFuncsTable, + LPCRITICAL_SECTION pCritSec, IMemAllocator *, IPin ** ppPin); typedef struct BaseFilter { diff --git a/reactos/lib/3rdparty/strmbase/dllfunc.c b/reactos/lib/3rdparty/strmbase/dllfunc.c index 4a210e1facc..eb7ab647590 100644 --- a/reactos/lib/3rdparty/strmbase/dllfunc.c +++ b/reactos/lib/3rdparty/strmbase/dllfunc.c @@ -21,6 +21,12 @@ #include "strmbase_private.h" +#define NO_SHLWAPI_PATH +#define NO_SHLWAPI_STRFCNS +#define NO_SHLWAPI_GDI +#define NO_SHLWAPI_STREAM +#include + extern const int g_cTemplates; extern const FactoryTemplate g_Templates[]; @@ -37,76 +43,6 @@ static const WCHAR ips32_keyname[] = {'I','n','P','r','o','c','S','e','r','v','e static const WCHAR tmodel_keyname[] = {'T','h','r','e','a','d','i','n','g','M','o','d','e','l',0}; static const WCHAR tmodel_both[] = {'B','o','t','h',0}; -#ifdef __REACTOS__ -static LSTATUS WINAPI RegDeleteTreeW(HKEY hKey, LPCWSTR lpszSubKey) -{ - LONG ret; - DWORD dwMaxSubkeyLen, dwMaxValueLen; - DWORD dwMaxLen, dwSize; - WCHAR szNameBuf[MAX_PATH], *lpszName = szNameBuf; - HKEY hSubKey = hKey; - - TRACE("(hkey=%p,%p %s)\n", hKey, lpszSubKey, debugstr_w(lpszSubKey)); - - if(lpszSubKey) - { - ret = RegOpenKeyExW(hKey, lpszSubKey, 0, KEY_READ, &hSubKey); - if (ret) return ret; - } - - /* Get highest length for keys, values */ - ret = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL, - &dwMaxSubkeyLen, NULL, NULL, &dwMaxValueLen, NULL, NULL, NULL); - if (ret) goto cleanup; - - dwMaxSubkeyLen++; - dwMaxValueLen++; - dwMaxLen = max(dwMaxSubkeyLen, dwMaxValueLen); - if (dwMaxLen > sizeof(szNameBuf)/sizeof(WCHAR)) - { - /* Name too big: alloc a buffer for it */ - if (!(lpszName = HeapAlloc( GetProcessHeap(), 0, dwMaxLen*sizeof(WCHAR)))) - { - ret = ERROR_NOT_ENOUGH_MEMORY; - goto cleanup; - } - } - - - /* Recursively delete all the subkeys */ - while (TRUE) - { - dwSize = dwMaxLen; - if (RegEnumKeyExW(hSubKey, 0, lpszName, &dwSize, NULL, - NULL, NULL, NULL)) break; - - ret = RegDeleteTreeW(hSubKey, lpszName); - if (ret) goto cleanup; - } - - if (lpszSubKey) - ret = RegDeleteKeyW(hKey, lpszSubKey); - else - while (TRUE) - { - dwSize = dwMaxLen; - if (RegEnumValueW(hKey, 0, lpszName, &dwSize, - NULL, NULL, NULL, NULL)) break; - - ret = RegDeleteValueW(hKey, lpszName); - if (ret) goto cleanup; - } - -cleanup: - /* Free buffer if allocated */ - if (lpszName != szNameBuf) - HeapFree( GetProcessHeap(), 0, lpszName); - if(lpszSubKey) - RegCloseKey(hSubKey); - return ret; -} -#endif - /* * SetupRegisterClass() */ @@ -174,7 +110,7 @@ static HRESULT SetupRegisterAllClasses(const FactoryTemplate * pList, int num, pList->m_Name, szFileName, ips32_keyname, tmodel_both); else - hr = RegDeleteTreeW(hkey, szCLSID); + hr = SHDeleteKeyW(hkey, szCLSID); } } RegCloseKey(hkey); diff --git a/reactos/lib/3rdparty/strmbase/filter.c b/reactos/lib/3rdparty/strmbase/filter.c index 456a47c417a..10d946034ba 100644 --- a/reactos/lib/3rdparty/strmbase/filter.c +++ b/reactos/lib/3rdparty/strmbase/filter.c @@ -27,23 +27,15 @@ static inline BaseFilter *impl_from_IBaseFilter(IBaseFilter *iface) HRESULT WINAPI BaseFilterImpl_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv) { - BaseFilter *This = impl_from_IBaseFilter(iface); TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ppv); *ppv = NULL; - if (IsEqualIID(riid, &IID_IUnknown)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IPersist)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IMediaFilter)) - *ppv = This; - else if (IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = This; - - if (*ppv) + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IPersist) || + IsEqualIID(riid, &IID_IMediaFilter) || IsEqualIID(riid, &IID_IBaseFilter)) { - IUnknown_AddRef((IUnknown *)(*ppv)); + *ppv = iface; + IBaseFilter_AddRef(iface); return S_OK; } diff --git a/reactos/lib/3rdparty/strmbase/pin.c b/reactos/lib/3rdparty/strmbase/pin.c index 07741fd54b1..ee0cf7c6beb 100644 --- a/reactos/lib/3rdparty/strmbase/pin.c +++ b/reactos/lib/3rdparty/strmbase/pin.c @@ -409,6 +409,9 @@ HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const TRACE("(%p/%p)->(%p, %p)\n", This, iface, pReceivePin, pmt); dump_AM_MEDIA_TYPE(pmt); + if (!pReceivePin) + return E_POINTER; + /* If we try to connect to ourselves, we will definitely deadlock. * There are other cases where we could deadlock too, but this * catches the obvious case */ @@ -455,9 +458,11 @@ HRESULT WINAPI BaseOutputPinImpl_Connect(IPin * iface, IPin * pReceivePin, const /* then try receiver filter's media types */ if (hr != S_OK && SUCCEEDED(hr = IPin_EnumMediaTypes(pReceivePin, &pEnumCandidates))) /* if we haven't already connected successfully */ { + ULONG fetched; + hr = VFW_E_NO_ACCEPTABLE_TYPES; /* Assume the worst, but set to S_OK if connected successfully */ - while (S_OK == IEnumMediaTypes_Next(pEnumCandidates, 1, &pmtCandidate, NULL)) + while (S_OK == IEnumMediaTypes_Next(pEnumCandidates, 1, &pmtCandidate, &fetched)) { assert(pmtCandidate); dump_AM_MEDIA_TYPE(pmtCandidate); @@ -780,7 +785,7 @@ HRESULT WINAPI BaseOutputPinImpl_AttemptConnection(BasePin* iface, IPin * pRecei return hr; } -static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * pPinInfo, const BasePinFuncTable* pBaseFuncsTable, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, BaseOutputPin * pPinImpl) +static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * pPinInfo, const BaseOutputPinFuncTable* vtbl, LPCRITICAL_SECTION pCritSec, BaseOutputPin * pPinImpl) { TRACE("\n"); @@ -793,18 +798,18 @@ static HRESULT OutputPin_Init(const IPinVtbl *OutputPin_Vtbl, const PIN_INFO * p pPinImpl->pin.tStop = 0; pPinImpl->pin.dRate = 1.0; Copy_PinInfo(&pPinImpl->pin.pinInfo, pPinInfo); - pPinImpl->pin.pFuncsTable = pBaseFuncsTable; + pPinImpl->pin.pFuncsTable = &vtbl->base; ZeroMemory(&pPinImpl->pin.mtCurrent, sizeof(AM_MEDIA_TYPE)); /* Output pin attributes */ pPinImpl->pMemInputPin = NULL; pPinImpl->pAllocator = NULL; - pPinImpl->pFuncsTable = pBaseOutputFuncsTable; + pPinImpl->pFuncsTable = vtbl; return S_OK; } -HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BasePinFuncTable* pBaseFuncsTable, const BaseOutputPinFuncTable* pBaseOutputFuncsTable, LPCRITICAL_SECTION pCritSec, IPin ** ppPin) +HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outputpin_size, const PIN_INFO * pPinInfo, const BaseOutputPinFuncTable* vtbl, LPCRITICAL_SECTION pCritSec, IPin ** ppPin) { BaseOutputPin * pPinImpl; @@ -817,14 +822,14 @@ HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outp } assert(outputpin_size >= sizeof(BaseOutputPin)); - assert(pBaseFuncsTable->pfnAttemptConnection); + assert(vtbl->base.pfnAttemptConnection); pPinImpl = CoTaskMemAlloc(outputpin_size); if (!pPinImpl) return E_OUTOFMEMORY; - if (SUCCEEDED(OutputPin_Init(OutputPin_Vtbl, pPinInfo, pBaseFuncsTable, pBaseOutputFuncsTable, pCritSec, pPinImpl))) + if (SUCCEEDED(OutputPin_Init(OutputPin_Vtbl, pPinInfo, vtbl, pCritSec, pPinImpl))) { *ppPin = &pPinImpl->pin.IPin_iface; return S_OK; @@ -971,7 +976,7 @@ HRESULT WINAPI BaseInputPinImpl_EndOfStream(IPin * iface) if (This->flushing) hr = S_FALSE; else - This->end_of_stream = 1; + This->end_of_stream = TRUE; LeaveCriticalSection(This->pin.pCritSec); if (hr == S_OK) @@ -991,7 +996,7 @@ HRESULT WINAPI BaseInputPinImpl_BeginFlush(IPin * iface) TRACE("() semi-stub\n"); EnterCriticalSection(This->pin.pCritSec); - This->flushing = 1; + This->flushing = TRUE; hr = SendFurther( iface, deliver_beginflush, NULL, NULL ); LeaveCriticalSection(This->pin.pCritSec); @@ -1011,7 +1016,7 @@ HRESULT WINAPI BaseInputPinImpl_EndFlush(IPin * iface) TRACE("(%p)\n", This); EnterCriticalSection(This->pin.pCritSec); - This->flushing = This->end_of_stream = 0; + This->flushing = This->end_of_stream = FALSE; hr = SendFurther( iface, deliver_endflush, NULL, NULL ); LeaveCriticalSection(This->pin.pCritSec); @@ -1199,7 +1204,7 @@ static const IMemInputPinVtbl MemInputPin_Vtbl = }; static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, - const BasePinFuncTable* pBaseFuncsTable, const BaseInputPinFuncTable* pBaseInputFuncsTable, + const BaseInputPinFuncTable* vtbl, LPCRITICAL_SECTION pCritSec, IMemAllocator *allocator, BaseInputPin * pPinImpl) { TRACE("\n"); @@ -1213,29 +1218,30 @@ static HRESULT InputPin_Init(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPi pPinImpl->pin.dRate = 1.0; Copy_PinInfo(&pPinImpl->pin.pinInfo, pPinInfo); ZeroMemory(&pPinImpl->pin.mtCurrent, sizeof(AM_MEDIA_TYPE)); - pPinImpl->pin.pFuncsTable = pBaseFuncsTable; + pPinImpl->pin.pFuncsTable = &vtbl->base; /* Input pin attributes */ - pPinImpl->pFuncsTable = pBaseInputFuncsTable; + pPinImpl->pFuncsTable = vtbl; pPinImpl->pAllocator = pPinImpl->preferred_allocator = allocator; if (pPinImpl->preferred_allocator) IMemAllocator_AddRef(pPinImpl->preferred_allocator); pPinImpl->pin.IPin_iface.lpVtbl = InputPin_Vtbl; pPinImpl->IMemInputPin_iface.lpVtbl = &MemInputPin_Vtbl; - pPinImpl->flushing = pPinImpl->end_of_stream = 0; + pPinImpl->flushing = pPinImpl->end_of_stream = FALSE; return S_OK; } -HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * pPinInfo, - const BasePinFuncTable* pBaseFuncsTable, const BaseInputPinFuncTable* pBaseInputFuncsTable, +HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size, const PIN_INFO * pPinInfo, + const BaseInputPinFuncTable* vtbl, LPCRITICAL_SECTION pCritSec, IMemAllocator *allocator, IPin ** ppPin) { BaseInputPin * pPinImpl; *ppPin = NULL; - assert(pBaseFuncsTable->pfnCheckMediaType); + assert(inputpin_size >= sizeof(BaseInputPin)); + assert(vtbl->base.pfnCheckMediaType); if (pPinInfo->dir != PINDIR_INPUT) { @@ -1243,12 +1249,12 @@ HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, const PIN_INFO * p return E_INVALIDARG; } - pPinImpl = CoTaskMemAlloc(sizeof(*pPinImpl)); + pPinImpl = CoTaskMemAlloc(inputpin_size); if (!pPinImpl) return E_OUTOFMEMORY; - if (SUCCEEDED(InputPin_Init(InputPin_Vtbl, pPinInfo, pBaseFuncsTable, pBaseInputFuncsTable, pCritSec, allocator, pPinImpl))) + if (SUCCEEDED(InputPin_Init(InputPin_Vtbl, pPinInfo, vtbl, pCritSec, allocator, pPinImpl))) { *ppPin = (IPin *)pPinImpl; return S_OK; diff --git a/reactos/lib/3rdparty/strmbase/pospass.c b/reactos/lib/3rdparty/strmbase/pospass.c index c56a317ec86..57a5999ec9f 100644 --- a/reactos/lib/3rdparty/strmbase/pospass.c +++ b/reactos/lib/3rdparty/strmbase/pospass.c @@ -253,7 +253,7 @@ HRESULT WINAPI PosPassThru_Construct(IUnknown *pUnkOuter, LPVOID *ppPassThru) fimpl->IMediaPosition_iface.lpVtbl = &IMediaPositionPassThru_Vtbl; fimpl->ref = 1; fimpl->pin = NULL; - fimpl->timevalid = 0; + fimpl->timevalid = FALSE; InitializeCriticalSection(&fimpl->time_cs); fimpl->time_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PassThruImpl.time_cs"); BaseDispatch_Init(&fimpl->baseDispatch, &IID_IMediaPosition); @@ -589,7 +589,7 @@ HRESULT WINAPI RendererPosPassThru_RegisterMediaTime(IUnknown *iface, REFERENCE_ PassThruImpl *This = impl_from_IUnknown_inner(iface); EnterCriticalSection(&This->time_cs); This->time_earliest = start; - This->timevalid = 1; + This->timevalid = TRUE; LeaveCriticalSection(&This->time_cs); return S_OK; } @@ -598,7 +598,7 @@ HRESULT WINAPI RendererPosPassThru_ResetMediaTime(IUnknown *iface) { PassThruImpl *This = impl_from_IUnknown_inner(iface); EnterCriticalSection(&This->time_cs); - This->timevalid = 0; + This->timevalid = FALSE; LeaveCriticalSection(&This->time_cs); return S_OK; } @@ -611,10 +611,10 @@ HRESULT WINAPI RendererPosPassThru_EOS(IUnknown *iface) hr = IMediaSeeking_GetStopPosition(&This->IMediaSeeking_iface, &time); EnterCriticalSection(&This->time_cs); if (SUCCEEDED(hr)) { - This->timevalid = 1; + This->timevalid = TRUE; This->time_earliest = time; } else - This->timevalid = 0; + This->timevalid = FALSE; LeaveCriticalSection(&This->time_cs); return hr; } diff --git a/reactos/lib/3rdparty/strmbase/qualitycontrol.c b/reactos/lib/3rdparty/strmbase/qualitycontrol.c index 1048592190b..623964ade19 100644 --- a/reactos/lib/3rdparty/strmbase/qualitycontrol.c +++ b/reactos/lib/3rdparty/strmbase/qualitycontrol.c @@ -101,8 +101,9 @@ void QualityControlRender_Start(QualityControlImpl *This, REFERENCE_TIME tStart) This->avg_render = This->last_in_time = This->last_left = This->avg_duration = This->avg_pt = -1; This->clockstart = tStart; This->avg_rate = -1.0; - This->rendered = This->dropped = This->is_dropped = 0; - This->qos_handled = 1; /* Lie that will be corrected on first adjustment */ + This->rendered = This->dropped = 0; + This->is_dropped = FALSE; + This->qos_handled = TRUE; /* Lie that will be corrected on first adjustment */ } diff --git a/reactos/lib/3rdparty/strmbase/renderer.c b/reactos/lib/3rdparty/strmbase/renderer.c index 1815f0fd4c5..433bcba730f 100644 --- a/reactos/lib/3rdparty/strmbase/renderer.c +++ b/reactos/lib/3rdparty/strmbase/renderer.c @@ -217,15 +217,14 @@ static const BaseFilterFuncTable RendererBaseFilterFuncTable = { BaseRenderer_GetPinCount }; -static const BasePinFuncTable input_BaseFuncTable = { - BaseRenderer_Input_CheckMediaType, - NULL, - BasePinImpl_GetMediaTypeVersion, - BasePinImpl_GetMediaType -}; - static const BaseInputPinFuncTable input_BaseInputFuncTable = { - BaseRenderer_Receive + { + BaseRenderer_Input_CheckMediaType, + NULL, + BasePinImpl_GetMediaTypeVersion, + BasePinImpl_GetMediaType + }, + BaseRenderer_Receive }; @@ -243,7 +242,8 @@ HRESULT WINAPI BaseRenderer_Init(BaseRenderer * This, const IBaseFilterVtbl *Vtb piInput.pFilter = &This->filter.IBaseFilter_iface; lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0])); - hr = BaseInputPin_Construct(&BaseRenderer_InputPin_Vtbl, &piInput, &input_BaseFuncTable, &input_BaseInputFuncTable, &This->filter.csFilter, NULL, (IPin **)&This->pInputPin); + hr = BaseInputPin_Construct(&BaseRenderer_InputPin_Vtbl, sizeof(BaseInputPin), &piInput, + &input_BaseInputFuncTable, &This->filter.csFilter, NULL, (IPin **)&This->pInputPin); if (SUCCEEDED(hr)) { @@ -461,7 +461,7 @@ HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStart) if (This->pInputPin->pin.pConnectedTo) { - This->pInputPin->end_of_stream = 0; + This->pInputPin->end_of_stream = FALSE; } else if (This->filter.filterInfo.pGraph) { @@ -504,7 +504,7 @@ HRESULT WINAPI BaseRendererImpl_Pause(IBaseFilter * iface) { if (This->pInputPin->pin.pConnectedTo) ResetEvent(This->evComplete); - This->pInputPin->end_of_stream = 0; + This->pInputPin->end_of_stream = FALSE; } else if (This->pFuncsTable->pfnOnStopStreaming) This->pFuncsTable->pfnOnStopStreaming(This); diff --git a/reactos/lib/3rdparty/strmbase/transform.c b/reactos/lib/3rdparty/strmbase/transform.c index 7ca5db9c46e..8f5815a2bfd 100644 --- a/reactos/lib/3rdparty/strmbase/transform.c +++ b/reactos/lib/3rdparty/strmbase/transform.c @@ -157,25 +157,23 @@ static const BaseFilterFuncTable tfBaseFuncTable = { TransformFilter_GetPinCount }; -static const BasePinFuncTable tf_input_BaseFuncTable = { - TransformFilter_Input_CheckMediaType, - NULL, - BasePinImpl_GetMediaTypeVersion, - BasePinImpl_GetMediaType -}; - static const BaseInputPinFuncTable tf_input_BaseInputFuncTable = { + { + TransformFilter_Input_CheckMediaType, + NULL, + BasePinImpl_GetMediaTypeVersion, + BasePinImpl_GetMediaType + }, TransformFilter_Input_Receive }; -static const BasePinFuncTable tf_output_BaseFuncTable = { - NULL, - BaseOutputPinImpl_AttemptConnection, - BasePinImpl_GetMediaTypeVersion, - TransformFilter_Output_GetMediaType -}; - static const BaseOutputPinFuncTable tf_output_BaseOutputFuncTable = { + { + NULL, + BaseOutputPinImpl_AttemptConnection, + BasePinImpl_GetMediaTypeVersion, + TransformFilter_Output_GetMediaType + }, TransformFilter_Output_DecideBufferSize, BaseOutputPinImpl_DecideAllocator, BaseOutputPinImpl_BreakConnect @@ -207,11 +205,12 @@ static HRESULT TransformFilter_Init(const IBaseFilterVtbl *pVtbl, const CLSID* p piOutput.pFilter = &pTransformFilter->filter.IBaseFilter_iface; lstrcpynW(piOutput.achName, wcsOutputPinName, sizeof(piOutput.achName) / sizeof(piOutput.achName[0])); - hr = BaseInputPin_Construct(&TransformFilter_InputPin_Vtbl, &piInput, &tf_input_BaseFuncTable, &tf_input_BaseInputFuncTable, &pTransformFilter->filter.csFilter, NULL, &pTransformFilter->ppPins[0]); + hr = BaseInputPin_Construct(&TransformFilter_InputPin_Vtbl, sizeof(BaseInputPin), &piInput, + &tf_input_BaseInputFuncTable, &pTransformFilter->filter.csFilter, NULL, &pTransformFilter->ppPins[0]); if (SUCCEEDED(hr)) { - hr = BaseOutputPin_Construct(&TransformFilter_OutputPin_Vtbl, sizeof(BaseOutputPin), &piOutput, &tf_output_BaseFuncTable, &tf_output_BaseOutputFuncTable, &pTransformFilter->filter.csFilter, &pTransformFilter->ppPins[1]); + hr = BaseOutputPin_Construct(&TransformFilter_OutputPin_Vtbl, sizeof(BaseOutputPin), &piOutput, &tf_output_BaseOutputFuncTable, &pTransformFilter->filter.csFilter, &pTransformFilter->ppPins[1]); if (FAILED(hr)) ERR("Cannot create output pin (%x)\n", hr); @@ -387,7 +386,7 @@ HRESULT WINAPI TransformFilterImpl_Run(IBaseFilter * iface, REFERENCE_TIME tStar { if (This->filter.state == State_Stopped) { - impl_BaseInputPin_from_IPin(This->ppPins[0])->end_of_stream = 0; + impl_BaseInputPin_from_IPin(This->ppPins[0])->end_of_stream = FALSE; if (This->pFuncsTable->pfnStartStreaming) hr = This->pFuncsTable->pfnStartStreaming(This); if (SUCCEEDED(hr)) diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 76dfc87078b..282b51a09c9 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -27,7 +27,7 @@ reactos/tools/wpp # Synced to Wine-1.7.1 The following libraries are shared with Wine. -reactos/dll/directx/wine/amstream # Synced to Wine-1.7.1 +reactos/dll/directx/wine/amstream # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3d8 # Synced to Wine-1.7.11 reactos/dll/directx/wine/d3d9 # Synced to Wine-1.7.11 reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.1 @@ -45,7 +45,7 @@ reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.1 reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.1 reactos/dll/directx/wine/msdmo # Synced to Wine-1.7.1 reactos/dll/directx/wine/qedit # Synced to Wine-1.7.1 -reactos/dll/directx/wine/quartz # Synced to Wine-1.7.1 +reactos/dll/directx/wine/quartz # Synced to Wine-1.7.17 reactos/dll/directx/wine/wined3d # Synced to Wine-1.7.11 reactos/dll/win32/activeds # Synced to Wine-1.7.1 @@ -246,7 +246,7 @@ In addition the following libs, dlls and source files are mostly based on code p from Winehq CVS. If you are looking to update something in these files check Wine current souces first as it may already be fixed. -reactos/lib/3rdparty/strmbase # Synced to Wine-1.7.1 +reactos/lib/3rdparty/strmbase # Synced to Wine-1.7.17 advapi32 - reactos/dll/win32/advapi32/crypt/*.c # Synced to Wine-1.7.1 From fa2c5bdeb0ffa84d4db58d337a8c82e8130d962d Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 16:28:22 +0000 Subject: [PATCH 382/419] [QUARTZ_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62810 --- rostests/winetests/quartz/CMakeLists.txt | 5 ++++- rostests/winetests/quartz/avisplitter.c | 4 ++-- rostests/winetests/quartz/dsoundrender.c | 4 ++-- rostests/winetests/quartz/filtergraph.c | 20 +++++++++----------- rostests/winetests/quartz/filtermapper.c | 2 +- rostests/winetests/quartz/videorenderer.c | 2 +- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/rostests/winetests/quartz/CMakeLists.txt b/rostests/winetests/quartz/CMakeLists.txt index 901dc06ebbb..086628c460a 100644 --- a/rostests/winetests/quartz/CMakeLists.txt +++ b/rostests/winetests/quartz/CMakeLists.txt @@ -15,5 +15,8 @@ add_executable(quartz_winetest ${SOURCE}) target_link_libraries(quartz_winetest uuid) add_dependencies(quartz_winetest quartz_test_idlheader) set_module_type(quartz_winetest win32cui) -add_importlibs(quartz_winetest ole32 oleaut32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(quartz_winetest ole32 oleaut32 advapi32 msvcrt kernel32) +if(MSVC) + add_importlibs(quartz_winetest ntdll) +endif() add_cd_file(TARGET quartz_winetest DESTINATION reactos/bin FOR all) diff --git a/rostests/winetests/quartz/avisplitter.c b/rostests/winetests/quartz/avisplitter.c index ad019060632..2fa7f91db28 100644 --- a/rostests/winetests/quartz/avisplitter.c +++ b/rostests/winetests/quartz/avisplitter.c @@ -57,7 +57,7 @@ static int count_threads(void) return threads; } -static int create_avisplitter(void) +static BOOL create_avisplitter(void) { HRESULT hr; @@ -128,7 +128,7 @@ static void test_basefilter(void) ULONG ref; HRESULT hr; - IUnknown_QueryInterface(pAviSplitter, &IID_IBaseFilter, (void *)&base); + IUnknown_QueryInterface(pAviSplitter, &IID_IBaseFilter, (void **)&base); if (base == NULL) { /* test_query_interface handles this case */ diff --git a/rostests/winetests/quartz/dsoundrender.c b/rostests/winetests/quartz/dsoundrender.c index 336cbfaa8e2..3a8f8da343c 100644 --- a/rostests/winetests/quartz/dsoundrender.c +++ b/rostests/winetests/quartz/dsoundrender.c @@ -39,7 +39,7 @@ static IUnknown *pDSRender = NULL; -static int create_dsound_renderer(void) +static BOOL create_dsound_renderer(void) { HRESULT hr; @@ -179,7 +179,7 @@ static void test_basefilter(void) ULONG ref; HRESULT hr; - IUnknown_QueryInterface(pDSRender, &IID_IBaseFilter, (void *)&base); + IUnknown_QueryInterface(pDSRender, &IID_IBaseFilter, (void **)&base); if (base == NULL) { /* test_query_interface handles this case */ diff --git a/rostests/winetests/quartz/filtergraph.c b/rostests/winetests/quartz/filtergraph.c index 50ab5cfc4ca..166472d2a7f 100644 --- a/rostests/winetests/quartz/filtergraph.c +++ b/rostests/winetests/quartz/filtergraph.c @@ -1094,7 +1094,6 @@ static HRESULT createtestfilter(const CLSID* pClsid, const TestFilterPinData *pi pTestFilter->IBaseFilter_iface.lpVtbl = &TestFilter_Vtbl; pTestFilter->refCount = 1; InitializeCriticalSection(&pTestFilter->csFilter); - pTestFilter->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": TestFilterImpl.csFilter"); pTestFilter->state = State_Stopped; ZeroMemory(&pTestFilter->filterInfo, sizeof(FILTER_INFO)); @@ -1149,7 +1148,6 @@ static HRESULT createtestfilter(const CLSID* pClsid, const TestFilterPinData *pi } } CoTaskMemFree(pTestFilter->ppPins); - pTestFilter->csFilter.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&pTestFilter->csFilter); CoTaskMemFree(pTestFilter); @@ -1213,7 +1211,6 @@ static ULONG WINAPI TestFilter_Release(IBaseFilter * iface) CoTaskMemFree(This->ppPins); - This->csFilter.DebugInfo->Spare[0] = 0; DeleteCriticalSection(&This->csFilter); CoTaskMemFree(This); @@ -1559,9 +1556,10 @@ static void test_render_filter_priority(void) static const WCHAR wszFilterInstanceName4[] = {'T', 'e', 's', 't', 'f', 'i', 'l', 't', 'e', 'r', 'I', 'n', 's', 't', 'a', 'n', 'c', 'e', '4', 0 }; - /* Test which renderer of two already added to the graph will be chosen (one is "exact" match, other is - "wildcard" match. Seems to very by order in which filters are added to the graph, thus indicating - no preference given to exact match. */ + /* Test which renderer of two already added to the graph will be chosen + * (one is "exact" match, other is "wildcard" match. Seems to depend + * on the order in which filters are added to the graph, thus indicating + * no preference given to exact match. */ hr = CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterGraph2, (LPVOID*)&pgraph2); ok(hr == S_OK, "CoCreateInstance failed with %08x\n", hr); if (!pgraph2) return; @@ -1643,7 +1641,7 @@ static void test_render_filter_priority(void) ok(hr == E_POINTER, "IFilterGraph2_Disconnect failed. Expected E_POINTER, received %08x\n", hr); get_connected_filter_name(ptestfilter, ConnectedFilterName2); - ok(lstrcmp(ConnectedFilterName1, ConnectedFilterName2), + ok(strcmp(ConnectedFilterName1, ConnectedFilterName2), "expected connected filters to be different but got %s both times\n", ConnectedFilterName1); IFilterGraph2_Release(pgraph2); @@ -1699,7 +1697,7 @@ static void test_render_filter_priority(void) ok(hr == S_OK, "IFilterGraph2_Render failed with %08x\n", hr); get_connected_filter_name(ptestfilter, ConnectedFilterName1); - ok(!lstrcmp(ConnectedFilterName1, "TestfilterInstance3") || !lstrcmp(ConnectedFilterName1, "TestfilterInstance2"), + ok(!strcmp(ConnectedFilterName1, "TestfilterInstance3") || !strcmp(ConnectedFilterName1, "TestfilterInstance2"), "unexpected connected filter: %s\n", ConnectedFilterName1); IFilterGraph2_Release(pgraph2); @@ -1751,9 +1749,9 @@ static void test_render_filter_priority(void) ok(hr == S_OK, "IFilterGraph2_Render failed with %08x\n", hr); get_connected_filter_name(ptestfilter, ConnectedFilterName2); - ok(!lstrcmp(ConnectedFilterName2, "TestfilterInstance3") || !lstrcmp(ConnectedFilterName2, "TestfilterInstance2"), + ok(!strcmp(ConnectedFilterName2, "TestfilterInstance3") || !strcmp(ConnectedFilterName2, "TestfilterInstance2"), "unexpected connected filter: %s\n", ConnectedFilterName2); - ok(lstrcmp(ConnectedFilterName1, ConnectedFilterName2), + ok(strcmp(ConnectedFilterName1, ConnectedFilterName2), "expected connected filters to be different but got %s both times\n", ConnectedFilterName1); IFilterGraph2_Release(pgraph2); @@ -1847,7 +1845,7 @@ static void test_render_filter_priority(void) ok(hr == S_OK, "IFilterGraph2_Render failed with %08x\n", hr); get_connected_filter_name(ptestfilter, ConnectedFilterName1); - ok(!lstrcmp(ConnectedFilterName1, "TestfilterInstance3"), + ok(!strcmp(ConnectedFilterName1, "TestfilterInstance3"), "unexpected connected filter: %s\n", ConnectedFilterName1); } diff --git a/rostests/winetests/quartz/filtermapper.c b/rostests/winetests/quartz/filtermapper.c index b52d17e1221..a67df1d8f9b 100644 --- a/rostests/winetests/quartz/filtermapper.c +++ b/rostests/winetests/quartz/filtermapper.c @@ -233,7 +233,7 @@ static void test_legacy_filter_registration(void) ok(hr == S_OK, "CoCreateInstance failed with %x\n", hr); if (FAILED(hr)) goto out; - hr = IFilterMapper2_QueryInterface(pMapper2, &IID_IFilterMapper, (LPVOID)&pMapper); + hr = IFilterMapper2_QueryInterface(pMapper2, &IID_IFilterMapper, (void **)&pMapper); ok(hr == S_OK, "IFilterMapper2_QueryInterface failed with %x\n", hr); if (FAILED(hr)) goto out; diff --git a/rostests/winetests/quartz/videorenderer.c b/rostests/winetests/quartz/videorenderer.c index 67f7dd89ba4..d826ce93bea 100644 --- a/rostests/winetests/quartz/videorenderer.c +++ b/rostests/winetests/quartz/videorenderer.c @@ -110,7 +110,7 @@ static void test_basefilter(void) ULONG ref; HRESULT hr; - IUnknown_QueryInterface(pVideoRenderer, &IID_IBaseFilter, (void *)&base); + IUnknown_QueryInterface(pVideoRenderer, &IID_IBaseFilter, (void **)&base); if (base == NULL) { /* test_query_interface handles this case */ From fecdf105f74d5496c1c4b7c5381ce38089afd7af Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 17:30:00 +0000 Subject: [PATCH 383/419] [D3D8][D3D9][DDRAW][DXGI][QEDIT][WINED3D] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62811 --- reactos/dll/directx/wine/d3d8/buffer.c | 80 +- reactos/dll/directx/wine/d3d8/d3d8_main.c | 78 ++ reactos/dll/directx/wine/d3d8/d3d8_private.h | 24 +- reactos/dll/directx/wine/d3d8/device.c | 2 +- reactos/dll/directx/wine/d3d8/directx.c | 2 +- reactos/dll/directx/wine/d3d8/surface.c | 40 +- reactos/dll/directx/wine/d3d8/texture.c | 112 +-- reactos/dll/directx/wine/d3d8/volume.c | 42 +- reactos/dll/directx/wine/d3d9/buffer.c | 80 +- reactos/dll/directx/wine/d3d9/d3d9_main.c | 78 ++ reactos/dll/directx/wine/d3d9/d3d9_private.h | 24 +- reactos/dll/directx/wine/d3d9/device.c | 6 +- reactos/dll/directx/wine/d3d9/directx.c | 11 +- reactos/dll/directx/wine/d3d9/query.c | 21 +- reactos/dll/directx/wine/d3d9/surface.c | 40 +- reactos/dll/directx/wine/d3d9/texture.c | 112 +-- reactos/dll/directx/wine/d3d9/volume.c | 40 +- reactos/dll/directx/wine/ddraw/ddraw.c | 49 +- reactos/dll/directx/wine/ddraw/ddraw.rc | 2 +- .../ddraw/{ddraw.rgs => ddraw_classes.rgs} | 0 .../dll/directx/wine/ddraw/ddraw_private.h | 3 +- reactos/dll/directx/wine/ddraw/device.c | 6 - reactos/dll/directx/wine/ddraw/main.c | 4 +- reactos/dll/directx/wine/ddraw/surface.c | 215 +++-- reactos/dll/directx/wine/ddraw/utils.c | 2 +- reactos/dll/directx/wine/ddraw/vertexbuffer.c | 5 +- reactos/dll/directx/wine/ddraw/viewport.c | 4 +- reactos/dll/directx/wine/dxgi/adapter.c | 64 +- reactos/dll/directx/wine/dxgi/dxgi.spec | 1 + reactos/dll/directx/wine/dxgi/dxgi_main.c | 47 +- reactos/dll/directx/wine/dxgi/dxgi_private.h | 5 +- reactos/dll/directx/wine/dxgi/factory.c | 73 +- reactos/dll/directx/wine/dxgi/guid.c | 1 + reactos/dll/directx/wine/dxgi/output.c | 13 +- reactos/dll/directx/wine/dxgi/surface.c | 4 - reactos/dll/directx/wine/qedit/CMakeLists.txt | 2 +- .../dll/directx/wine/qedit/qedit_classes.idl | 2 + .../dll/directx/wine/qedit/samplegrabber.c | 366 ++------ .../directx/wine/wined3d/arb_program_shader.c | 484 ++++++---- reactos/dll/directx/wine/wined3d/buffer.c | 35 +- reactos/dll/directx/wine/wined3d/context.c | 219 ++++- reactos/dll/directx/wine/wined3d/cs.c | 1 + reactos/dll/directx/wine/wined3d/device.c | 15 +- reactos/dll/directx/wine/wined3d/directx.c | 256 +++--- reactos/dll/directx/wine/wined3d/query.c | 197 +++- reactos/dll/directx/wine/wined3d/resource.c | 150 --- reactos/dll/directx/wine/wined3d/surface.c | 15 +- reactos/dll/directx/wine/wined3d/utils.c | 13 + reactos/dll/directx/wine/wined3d/wined3d.spec | 5 +- reactos/dll/directx/wine/wined3d/wined3d_gl.h | 8 + .../dll/directx/wine/wined3d/wined3d_main.c | 8 +- .../directx/wine/wined3d/wined3d_private.h | 40 +- reactos/include/reactos/wine/wgl_driver.h | 860 +++++++++++------- reactos/include/reactos/wine/wined3d.h | 110 ++- reactos/include/reactos/wine/winedxgi.idl | 4 +- reactos/media/doc/README.WINE | 12 +- 56 files changed, 2310 insertions(+), 1782 deletions(-) rename reactos/dll/directx/wine/ddraw/{ddraw.rgs => ddraw_classes.rgs} (100%) diff --git a/reactos/dll/directx/wine/d3d8/buffer.c b/reactos/dll/directx/wine/d3d8/buffer.c index 93a3cf0eff6..e230519dae0 100644 --- a/reactos/dll/directx/wine/d3d8/buffer.c +++ b/reactos/dll/directx/wine/d3d8/buffer.c @@ -45,7 +45,7 @@ static HRESULT WINAPI d3d8_vertexbuffer_QueryInterface(IDirect3DVertexBuffer8 *i static ULONG WINAPI d3d8_vertexbuffer_AddRef(IDirect3DVertexBuffer8 *iface) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); - ULONG refcount = InterlockedIncrement(&buffer->refcount); + ULONG refcount = InterlockedIncrement(&buffer->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -63,7 +63,7 @@ static ULONG WINAPI d3d8_vertexbuffer_AddRef(IDirect3DVertexBuffer8 *iface) static ULONG WINAPI d3d8_vertexbuffer_Release(IDirect3DVertexBuffer8 *iface) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); - ULONG refcount = InterlockedDecrement(&buffer->refcount); + ULONG refcount = InterlockedDecrement(&buffer->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); @@ -101,52 +101,28 @@ static HRESULT WINAPI d3d8_vertexbuffer_SetPrivateData(IDirect3DVertexBuffer8 *i REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&buffer->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_vertexbuffer_GetPrivateData(IDirect3DVertexBuffer8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&buffer->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_vertexbuffer_FreePrivateData(IDirect3DVertexBuffer8 *iface, REFGUID guid) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&buffer->resource, guid); } static DWORD WINAPI d3d8_vertexbuffer_SetPriority(IDirect3DVertexBuffer8 *iface, DWORD priority) @@ -271,7 +247,9 @@ static const IDirect3DVertexBuffer8Vtbl Direct3DVertexBuffer8_Vtbl = static void STDMETHODCALLTYPE d3d8_vertexbuffer_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d8_vertexbuffer *buffer = parent; + d3d8_resource_cleanup(&buffer->resource); + HeapFree(GetProcessHeap(), 0, buffer); } static const struct wined3d_parent_ops d3d8_vertexbuffer_wined3d_parent_ops = @@ -285,7 +263,7 @@ HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device * HRESULT hr; buffer->IDirect3DVertexBuffer8_iface.lpVtbl = &Direct3DVertexBuffer8_Vtbl; - buffer->refcount = 1; + d3d8_resource_init(&buffer->resource); buffer->fvf = fvf; wined3d_mutex_lock(); @@ -340,7 +318,7 @@ static HRESULT WINAPI d3d8_indexbuffer_QueryInterface(IDirect3DIndexBuffer8 *ifa static ULONG WINAPI d3d8_indexbuffer_AddRef(IDirect3DIndexBuffer8 *iface) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); - ULONG refcount = InterlockedIncrement(&buffer->refcount); + ULONG refcount = InterlockedIncrement(&buffer->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -358,7 +336,7 @@ static ULONG WINAPI d3d8_indexbuffer_AddRef(IDirect3DIndexBuffer8 *iface) static ULONG WINAPI d3d8_indexbuffer_Release(IDirect3DIndexBuffer8 *iface) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); - ULONG refcount = InterlockedDecrement(&buffer->refcount); + ULONG refcount = InterlockedDecrement(&buffer->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); @@ -396,52 +374,28 @@ static HRESULT WINAPI d3d8_indexbuffer_SetPrivateData(IDirect3DIndexBuffer8 *ifa REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&buffer->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_indexbuffer_GetPrivateData(IDirect3DIndexBuffer8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&buffer->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_indexbuffer_FreePrivateData(IDirect3DIndexBuffer8 *iface, REFGUID guid) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&buffer->resource, guid); } static DWORD WINAPI d3d8_indexbuffer_SetPriority(IDirect3DIndexBuffer8 *iface, DWORD priority) @@ -565,7 +519,9 @@ static const IDirect3DIndexBuffer8Vtbl d3d8_indexbuffer_vtbl = static void STDMETHODCALLTYPE d3d8_indexbuffer_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d8_indexbuffer *buffer = parent; + d3d8_resource_cleanup(&buffer->resource); + HeapFree(GetProcessHeap(), 0, buffer); } static const struct wined3d_parent_ops d3d8_indexbuffer_wined3d_parent_ops = @@ -579,7 +535,7 @@ HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *de HRESULT hr; buffer->IDirect3DIndexBuffer8_iface.lpVtbl = &d3d8_indexbuffer_vtbl; - buffer->refcount = 1; + d3d8_resource_init(&buffer->resource); buffer->format = wined3dformat_from_d3dformat(format); wined3d_mutex_lock(); diff --git a/reactos/dll/directx/wine/d3d8/d3d8_main.c b/reactos/dll/directx/wine/d3d8/d3d8_main.c index 51e59915d40..a4dc5e69e2f 100644 --- a/reactos/dll/directx/wine/d3d8/d3d8_main.c +++ b/reactos/dll/directx/wine/d3d8/d3d8_main.c @@ -132,3 +132,81 @@ HRESULT WINAPI ValidatePixelShader(DWORD* pixelshader, DWORD* reserved1, BOOL bo } return ret; } + +void d3d8_resource_cleanup(struct d3d8_resource *resource) +{ + wined3d_private_store_cleanup(&resource->private_store); +} + +HRESULT d3d8_resource_free_private_data(struct d3d8_resource *resource, const GUID *guid) +{ + struct wined3d_private_data *entry; + + wined3d_mutex_lock(); + entry = wined3d_private_store_get_private_data(&resource->private_store, guid); + if (!entry) + { + wined3d_mutex_unlock(); + return D3DERR_NOTFOUND; + } + + wined3d_private_store_free_private_data(&resource->private_store, entry); + wined3d_mutex_unlock(); + + return D3D_OK; +} + +HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid, + void *data, DWORD *data_size) +{ + const struct wined3d_private_data *stored_data; + DWORD size_in; + HRESULT hr; + + wined3d_mutex_lock(); + stored_data = wined3d_private_store_get_private_data(&resource->private_store, guid); + if (!stored_data) + { + hr = D3DERR_NOTFOUND; + goto done; + } + + size_in = *data_size; + *data_size = stored_data->size; + if (!data) + { + hr = D3D_OK; + goto done; + } + if (size_in < stored_data->size) + { + hr = D3DERR_MOREDATA; + goto done; + } + + if (stored_data->flags & WINED3DSPD_IUNKNOWN) + IUnknown_AddRef(stored_data->content.object); + memcpy(data, stored_data->content.data, stored_data->size); + hr = D3D_OK; + +done: + wined3d_mutex_unlock(); + return hr; +} + +void d3d8_resource_init(struct d3d8_resource *resource) +{ + resource->refcount = 1; + wined3d_private_store_init(&resource->private_store); +} + +HRESULT d3d8_resource_set_private_data(struct d3d8_resource *resource, const GUID *guid, + const void *data, DWORD data_size, DWORD flags) +{ + HRESULT hr; + + wined3d_mutex_lock(); + hr = wined3d_private_store_set_private_data(&resource->private_store, guid, data, data_size, flags); + wined3d_mutex_unlock(); + return hr; +} diff --git a/reactos/dll/directx/wine/d3d8/d3d8_private.h b/reactos/dll/directx/wine/d3d8/d3d8_private.h index 9f4c224ab93..a60652d78f3 100644 --- a/reactos/dll/directx/wine/d3d8/d3d8_private.h +++ b/reactos/dll/directx/wine/d3d8/d3d8_private.h @@ -183,10 +183,24 @@ struct d3d8_device HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) DECLSPEC_HIDDEN; +struct d3d8_resource +{ + LONG refcount; + struct wined3d_private_store private_store; +}; + +void d3d8_resource_cleanup(struct d3d8_resource *resource) DECLSPEC_HIDDEN; +HRESULT d3d8_resource_free_private_data(struct d3d8_resource *resource, const GUID *guid) DECLSPEC_HIDDEN; +HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid, + void *data, DWORD *data_size) DECLSPEC_HIDDEN; +void d3d8_resource_init(struct d3d8_resource *resource) DECLSPEC_HIDDEN; +HRESULT d3d8_resource_set_private_data(struct d3d8_resource *resource, const GUID *guid, + const void *data, DWORD data_size, DWORD flags) DECLSPEC_HIDDEN; + struct d3d8_volume { IDirect3DVolume8 IDirect3DVolume8_iface; - LONG refcount; + struct d3d8_resource resource; struct wined3d_volume *wined3d_volume; IUnknown *container; IUnknown *forwardReference; @@ -209,7 +223,7 @@ HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapcha struct d3d8_surface { IDirect3DSurface8 IDirect3DSurface8_iface; - LONG refcount; + struct d3d8_resource resource; struct wined3d_surface *wined3d_surface; IDirect3DDevice8 *parent_device; @@ -227,7 +241,7 @@ struct d3d8_surface *unsafe_impl_from_IDirect3DSurface8(IDirect3DSurface8 *iface struct d3d8_vertexbuffer { IDirect3DVertexBuffer8 IDirect3DVertexBuffer8_iface; - LONG refcount; + struct d3d8_resource resource; struct wined3d_buffer *wined3d_buffer; IDirect3DDevice8 *parent_device; DWORD fvf; @@ -240,7 +254,7 @@ struct d3d8_vertexbuffer *unsafe_impl_from_IDirect3DVertexBuffer8(IDirect3DVerte struct d3d8_indexbuffer { IDirect3DIndexBuffer8 IDirect3DIndexBuffer8_iface; - LONG refcount; + struct d3d8_resource resource; struct wined3d_buffer *wined3d_buffer; IDirect3DDevice8 *parent_device; enum wined3d_format_id format; @@ -253,7 +267,7 @@ struct d3d8_indexbuffer *unsafe_impl_from_IDirect3DIndexBuffer8(IDirect3DIndexBu struct d3d8_texture { IDirect3DBaseTexture8 IDirect3DBaseTexture8_iface; - LONG refcount; + struct d3d8_resource resource; struct wined3d_texture *wined3d_texture; IDirect3DDevice8 *parent_device; }; diff --git a/reactos/dll/directx/wine/d3d8/device.c b/reactos/dll/directx/wine/d3d8/device.c index 3737a74b2df..c519f80f0ea 100644 --- a/reactos/dll/directx/wine/d3d8/device.c +++ b/reactos/dll/directx/wine/d3d8/device.c @@ -585,7 +585,7 @@ static HRESULT CDECL reset_enum_callback(struct wined3d_resource *resource) } surface = wined3d_resource_get_parent(resource); - if (surface->refcount) + if (surface->resource.refcount) { WARN("Surface %p (resource %p) in pool D3DPOOL_DEFAULT blocks the Reset call.\n", surface, resource); return D3DERR_DEVICELOST; diff --git a/reactos/dll/directx/wine/d3d8/directx.c b/reactos/dll/directx/wine/d3d8/directx.c index 954bf493f04..10b4ea0a2df 100644 --- a/reactos/dll/directx/wine/d3d8/directx.c +++ b/reactos/dll/directx/wine/d3d8/directx.c @@ -395,7 +395,7 @@ BOOL d3d8_init(struct d3d8 *d3d8) d3d8->refcount = 1; wined3d_mutex_lock(); - d3d8->wined3d = wined3d_create(8, flags); + d3d8->wined3d = wined3d_create(flags); wined3d_mutex_unlock(); if (!d3d8->wined3d) return FALSE; diff --git a/reactos/dll/directx/wine/d3d8/surface.c b/reactos/dll/directx/wine/d3d8/surface.c index 10abee875b0..116b5b94a12 100644 --- a/reactos/dll/directx/wine/d3d8/surface.c +++ b/reactos/dll/directx/wine/d3d8/surface.c @@ -59,7 +59,7 @@ static ULONG WINAPI d3d8_surface_AddRef(IDirect3DSurface8 *iface) else { /* No container, handle our own refcounting */ - ULONG ref = InterlockedIncrement(&surface->refcount); + ULONG ref = InterlockedIncrement(&surface->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -91,7 +91,7 @@ static ULONG WINAPI d3d8_surface_Release(IDirect3DSurface8 *iface) else { /* No container, handle our own refcounting */ - ULONG ref = InterlockedDecrement(&surface->refcount); + ULONG ref = InterlockedDecrement(&surface->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -147,52 +147,28 @@ static HRESULT WINAPI d3d8_surface_SetPrivateData(IDirect3DSurface8 *iface, REFG const void *data, DWORD data_size, DWORD flags) { struct d3d8_surface *surface = impl_from_IDirect3DSurface8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&surface->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_surface_GetPrivateData(IDirect3DSurface8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_surface *surface = impl_from_IDirect3DSurface8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&surface->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_surface_FreePrivateData(IDirect3DSurface8 *iface, REFGUID guid) { struct d3d8_surface *surface = impl_from_IDirect3DSurface8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&surface->resource, guid); } static HRESULT WINAPI d3d8_surface_GetContainer(IDirect3DSurface8 *iface, REFIID riid, void **container) @@ -322,7 +298,9 @@ static const IDirect3DSurface8Vtbl d3d8_surface_vtbl = static void STDMETHODCALLTYPE surface_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d8_surface *surface = parent; + d3d8_resource_cleanup(&surface->resource); + HeapFree(GetProcessHeap(), 0, surface); } static const struct wined3d_parent_ops d3d8_surface_wined3d_parent_ops = @@ -334,7 +312,7 @@ void surface_init(struct d3d8_surface *surface, struct wined3d_surface *wined3d_ struct d3d8_device *device, const struct wined3d_parent_ops **parent_ops) { surface->IDirect3DSurface8_iface.lpVtbl = &d3d8_surface_vtbl; - surface->refcount = 1; + d3d8_resource_init(&surface->resource); wined3d_surface_incref(wined3d_surface); surface->wined3d_surface = wined3d_surface; surface->parent_device = &device->IDirect3DDevice8_iface; diff --git a/reactos/dll/directx/wine/d3d8/texture.c b/reactos/dll/directx/wine/d3d8/texture.c index 9ea83e7d938..7aadf5b3dab 100644 --- a/reactos/dll/directx/wine/d3d8/texture.c +++ b/reactos/dll/directx/wine/d3d8/texture.c @@ -56,7 +56,7 @@ static HRESULT WINAPI d3d8_texture_2d_QueryInterface(IDirect3DTexture8 *iface, R static ULONG WINAPI d3d8_texture_2d_AddRef(IDirect3DTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -74,7 +74,7 @@ static ULONG WINAPI d3d8_texture_2d_AddRef(IDirect3DTexture8 *iface) static ULONG WINAPI d3d8_texture_2d_Release(IDirect3DTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -110,52 +110,28 @@ static HRESULT WINAPI d3d8_texture_2d_SetPrivateData(IDirect3DTexture8 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_texture_2d_GetPrivateData(IDirect3DTexture8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_texture_2d_FreePrivateData(IDirect3DTexture8 *iface, REFGUID guid) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d8_texture_2d_SetPriority(IDirect3DTexture8 *iface, DWORD priority) @@ -424,7 +400,7 @@ static HRESULT WINAPI d3d8_texture_cube_QueryInterface(IDirect3DCubeTexture8 *if static ULONG WINAPI d3d8_texture_cube_AddRef(IDirect3DCubeTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -442,7 +418,7 @@ static ULONG WINAPI d3d8_texture_cube_AddRef(IDirect3DCubeTexture8 *iface) static ULONG WINAPI d3d8_texture_cube_Release(IDirect3DCubeTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -480,52 +456,28 @@ static HRESULT WINAPI d3d8_texture_cube_SetPrivateData(IDirect3DCubeTexture8 *if REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_texture_cube_GetPrivateData(IDirect3DCubeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_texture_cube_FreePrivateData(IDirect3DCubeTexture8 *iface, REFGUID guid) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d8_texture_cube_SetPriority(IDirect3DCubeTexture8 *iface, DWORD priority) @@ -817,7 +769,7 @@ static HRESULT WINAPI d3d8_texture_3d_QueryInterface(IDirect3DVolumeTexture8 *if static ULONG WINAPI d3d8_texture_3d_AddRef(IDirect3DVolumeTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -835,7 +787,7 @@ static ULONG WINAPI d3d8_texture_3d_AddRef(IDirect3DVolumeTexture8 *iface) static ULONG WINAPI d3d8_texture_3d_Release(IDirect3DVolumeTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -871,52 +823,28 @@ static HRESULT WINAPI d3d8_texture_3d_SetPrivateData(IDirect3DVolumeTexture8 *if REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_texture_3d_GetPrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_texture_3d_FreePrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d8_texture_3d_SetPriority(IDirect3DVolumeTexture8 *iface, DWORD priority) @@ -1171,7 +1099,9 @@ struct d3d8_texture *unsafe_impl_from_IDirect3DBaseTexture8(IDirect3DBaseTexture static void STDMETHODCALLTYPE d3d8_texture_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d8_texture *texture = parent; + d3d8_resource_cleanup(&texture->resource); + HeapFree(GetProcessHeap(), 0, texture); } static const struct wined3d_parent_ops d3d8_texture_wined3d_parent_ops = @@ -1187,7 +1117,7 @@ HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device, HRESULT hr; texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DTexture8_Vtbl; - texture->refcount = 1; + d3d8_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); @@ -1228,7 +1158,7 @@ HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *devic HRESULT hr; texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DCubeTexture8_Vtbl; - texture->refcount = 1; + d3d8_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_CUBE_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); @@ -1268,7 +1198,7 @@ HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *dev HRESULT hr; texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DVolumeTexture8_Vtbl; - texture->refcount = 1; + d3d8_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_VOLUME_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); diff --git a/reactos/dll/directx/wine/d3d8/volume.c b/reactos/dll/directx/wine/d3d8/volume.c index d2399d51e4b..6396887e7cf 100644 --- a/reactos/dll/directx/wine/d3d8/volume.c +++ b/reactos/dll/directx/wine/d3d8/volume.c @@ -58,7 +58,7 @@ static ULONG WINAPI d3d8_volume_AddRef(IDirect3DVolume8 *iface) else { /* No container, handle our own refcounting */ - ULONG ref = InterlockedIncrement(&volume->refcount); + ULONG ref = InterlockedIncrement(&volume->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -88,7 +88,7 @@ static ULONG WINAPI d3d8_volume_Release(IDirect3DVolume8 *iface) else { /* No container, handle our own refcounting */ - ULONG ref = InterlockedDecrement(&volume->refcount); + ULONG ref = InterlockedDecrement(&volume->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -127,52 +127,28 @@ static HRESULT WINAPI d3d8_volume_SetPrivateData(IDirect3DVolume8 *iface, REFGUI const void *data, DWORD data_size, DWORD flags) { struct d3d8_volume *volume = impl_from_IDirect3DVolume8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&volume->resource, guid, data, data_size, flags); } -static HRESULT WINAPI d3d8_volume_GetPrivateData(IDirect3DVolume8 *iface, REFGUID guid, +static HRESULT WINAPI d3d8_volume_GetPrivateData(IDirect3DVolume8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_volume *volume = impl_from_IDirect3DVolume8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&volume->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_volume_FreePrivateData(IDirect3DVolume8 *iface, REFGUID guid) { struct d3d8_volume *volume = impl_from_IDirect3DVolume8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&volume->resource, guid); } static HRESULT WINAPI d3d8_volume_GetContainer(IDirect3DVolume8 *iface, REFIID riid, void **container) @@ -272,7 +248,9 @@ static const IDirect3DVolume8Vtbl d3d8_volume_vtbl = static void STDMETHODCALLTYPE volume_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d8_volume *volume = parent; + d3d8_resource_cleanup(&volume->resource); + HeapFree(GetProcessHeap(), 0, volume); } static const struct wined3d_parent_ops d3d8_volume_wined3d_parent_ops = @@ -284,7 +262,7 @@ void volume_init(struct d3d8_volume *volume, struct wined3d_volume *wined3d_volu const struct wined3d_parent_ops **parent_ops) { volume->IDirect3DVolume8_iface.lpVtbl = &d3d8_volume_vtbl; - volume->refcount = 1; + d3d8_resource_init(&volume->resource); wined3d_volume_incref(wined3d_volume); volume->wined3d_volume = wined3d_volume; diff --git a/reactos/dll/directx/wine/d3d9/buffer.c b/reactos/dll/directx/wine/d3d9/buffer.c index 92691b26de1..bb91b2aa5dc 100644 --- a/reactos/dll/directx/wine/d3d9/buffer.c +++ b/reactos/dll/directx/wine/d3d9/buffer.c @@ -47,7 +47,7 @@ static HRESULT WINAPI d3d9_vertexbuffer_QueryInterface(IDirect3DVertexBuffer9 *i static ULONG WINAPI d3d9_vertexbuffer_AddRef(IDirect3DVertexBuffer9 *iface) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); - ULONG refcount = InterlockedIncrement(&buffer->refcount); + ULONG refcount = InterlockedIncrement(&buffer->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -65,7 +65,7 @@ static ULONG WINAPI d3d9_vertexbuffer_AddRef(IDirect3DVertexBuffer9 *iface) static ULONG WINAPI d3d9_vertexbuffer_Release(IDirect3DVertexBuffer9 *iface) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); - ULONG refcount = InterlockedDecrement(&buffer->refcount); + ULONG refcount = InterlockedDecrement(&buffer->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); @@ -102,52 +102,28 @@ static HRESULT WINAPI d3d9_vertexbuffer_SetPrivateData(IDirect3DVertexBuffer9 *i REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&buffer->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_vertexbuffer_GetPrivateData(IDirect3DVertexBuffer9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&buffer->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_vertexbuffer_FreePrivateData(IDirect3DVertexBuffer9 *iface, REFGUID guid) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&buffer->resource, guid); } static DWORD WINAPI d3d9_vertexbuffer_SetPriority(IDirect3DVertexBuffer9 *iface, DWORD priority) @@ -272,7 +248,9 @@ static const IDirect3DVertexBuffer9Vtbl d3d9_vertexbuffer_vtbl = static void STDMETHODCALLTYPE d3d9_vertexbuffer_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d9_vertexbuffer *buffer = parent; + d3d9_resource_cleanup(&buffer->resource); + HeapFree(GetProcessHeap(), 0, buffer); } static const struct wined3d_parent_ops d3d9_vertexbuffer_wined3d_parent_ops = @@ -286,8 +264,8 @@ HRESULT vertexbuffer_init(struct d3d9_vertexbuffer *buffer, struct d3d9_device * HRESULT hr; buffer->IDirect3DVertexBuffer9_iface.lpVtbl = &d3d9_vertexbuffer_vtbl; - buffer->refcount = 1; buffer->fvf = fvf; + d3d9_resource_init(&buffer->resource); wined3d_mutex_lock(); hr = wined3d_buffer_create_vb(device->wined3d_device, size, usage & WINED3DUSAGE_MASK, @@ -341,7 +319,7 @@ static HRESULT WINAPI d3d9_indexbuffer_QueryInterface(IDirect3DIndexBuffer9 *ifa static ULONG WINAPI d3d9_indexbuffer_AddRef(IDirect3DIndexBuffer9 *iface) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); - ULONG refcount = InterlockedIncrement(&buffer->refcount); + ULONG refcount = InterlockedIncrement(&buffer->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -359,7 +337,7 @@ static ULONG WINAPI d3d9_indexbuffer_AddRef(IDirect3DIndexBuffer9 *iface) static ULONG WINAPI d3d9_indexbuffer_Release(IDirect3DIndexBuffer9 *iface) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); - ULONG refcount = InterlockedDecrement(&buffer->refcount); + ULONG refcount = InterlockedDecrement(&buffer->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); @@ -396,52 +374,28 @@ static HRESULT WINAPI d3d9_indexbuffer_SetPrivateData(IDirect3DIndexBuffer9 *ifa REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&buffer->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_indexbuffer_GetPrivateData(IDirect3DIndexBuffer9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&buffer->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_indexbuffer_FreePrivateData(IDirect3DIndexBuffer9 *iface, REFGUID guid) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&buffer->resource, guid); } static DWORD WINAPI d3d9_indexbuffer_SetPriority(IDirect3DIndexBuffer9 *iface, DWORD priority) @@ -564,7 +518,9 @@ static const IDirect3DIndexBuffer9Vtbl d3d9_indexbuffer_vtbl = static void STDMETHODCALLTYPE d3d9_indexbuffer_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d9_indexbuffer *buffer = parent; + d3d9_resource_cleanup(&buffer->resource); + HeapFree(GetProcessHeap(), 0, buffer); } static const struct wined3d_parent_ops d3d9_indexbuffer_wined3d_parent_ops = @@ -578,8 +534,8 @@ HRESULT indexbuffer_init(struct d3d9_indexbuffer *buffer, struct d3d9_device *de HRESULT hr; buffer->IDirect3DIndexBuffer9_iface.lpVtbl = &d3d9_indexbuffer_vtbl; - buffer->refcount = 1; buffer->format = wined3dformat_from_d3dformat(format); + d3d9_resource_init(&buffer->resource); wined3d_mutex_lock(); hr = wined3d_buffer_create_ib(device->wined3d_device, size, usage & WINED3DUSAGE_MASK, diff --git a/reactos/dll/directx/wine/d3d9/d3d9_main.c b/reactos/dll/directx/wine/d3d9/d3d9_main.c index b2a1c68a7f6..c0518562919 100644 --- a/reactos/dll/directx/wine/d3d9/d3d9_main.c +++ b/reactos/dll/directx/wine/d3d9/d3d9_main.c @@ -158,3 +158,81 @@ void WINAPI D3DPERF_SetRegion(D3DCOLOR color, const WCHAR *name) { FIXME("color 0x%08x, name %s stub!\n", color, debugstr_w(name)); } + +void d3d9_resource_cleanup(struct d3d9_resource *resource) +{ + wined3d_private_store_cleanup(&resource->private_store); +} + +HRESULT d3d9_resource_free_private_data(struct d3d9_resource *resource, const GUID *guid) +{ + struct wined3d_private_data *entry; + + wined3d_mutex_lock(); + entry = wined3d_private_store_get_private_data(&resource->private_store, guid); + if (!entry) + { + wined3d_mutex_unlock(); + return D3DERR_NOTFOUND; + } + + wined3d_private_store_free_private_data(&resource->private_store, entry); + wined3d_mutex_unlock(); + + return D3D_OK; +} + +HRESULT d3d9_resource_get_private_data(struct d3d9_resource *resource, const GUID *guid, + void *data, DWORD *data_size) +{ + const struct wined3d_private_data *stored_data; + DWORD size_in; + HRESULT hr; + + wined3d_mutex_lock(); + stored_data = wined3d_private_store_get_private_data(&resource->private_store, guid); + if (!stored_data) + { + hr = D3DERR_NOTFOUND; + goto done; + } + + size_in = *data_size; + *data_size = stored_data->size; + if (!data) + { + hr = D3D_OK; + goto done; + } + if (size_in < stored_data->size) + { + hr = D3DERR_MOREDATA; + goto done; + } + + if (stored_data->flags & WINED3DSPD_IUNKNOWN) + IUnknown_AddRef(stored_data->content.object); + memcpy(data, stored_data->content.data, stored_data->size); + hr = D3D_OK; + +done: + wined3d_mutex_unlock(); + return hr; +} + +void d3d9_resource_init(struct d3d9_resource *resource) +{ + resource->refcount = 1; + wined3d_private_store_init(&resource->private_store); +} + +HRESULT d3d9_resource_set_private_data(struct d3d9_resource *resource, const GUID *guid, + const void *data, DWORD data_size, DWORD flags) +{ + HRESULT hr; + + wined3d_mutex_lock(); + hr = wined3d_private_store_set_private_data(&resource->private_store, guid, data, data_size, flags); + wined3d_mutex_unlock(); + return hr; +} diff --git a/reactos/dll/directx/wine/d3d9/d3d9_private.h b/reactos/dll/directx/wine/d3d9/d3d9_private.h index e896c280c41..fb8d1666c9b 100644 --- a/reactos/dll/directx/wine/d3d9/d3d9_private.h +++ b/reactos/dll/directx/wine/d3d9/d3d9_private.h @@ -172,10 +172,24 @@ HRESULT device_init(struct d3d9_device *device, struct d3d9 *parent, struct wine UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters, D3DDISPLAYMODEEX *mode) DECLSPEC_HIDDEN; +struct d3d9_resource +{ + LONG refcount; + struct wined3d_private_store private_store; +}; + +void d3d9_resource_cleanup(struct d3d9_resource *resource) DECLSPEC_HIDDEN; +HRESULT d3d9_resource_free_private_data(struct d3d9_resource *resource, const GUID *guid) DECLSPEC_HIDDEN; +HRESULT d3d9_resource_get_private_data(struct d3d9_resource *resource, const GUID *guid, + void *data, DWORD *data_size) DECLSPEC_HIDDEN; +void d3d9_resource_init(struct d3d9_resource *resource) DECLSPEC_HIDDEN; +HRESULT d3d9_resource_set_private_data(struct d3d9_resource *resource, const GUID *guid, + const void *data, DWORD data_size, DWORD flags) DECLSPEC_HIDDEN; + struct d3d9_volume { IDirect3DVolume9 IDirect3DVolume9_iface; - LONG refcount; + struct d3d9_resource resource; struct wined3d_volume *wined3d_volume; IUnknown *container; IUnknown *forwardReference; @@ -198,7 +212,7 @@ HRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapcha struct d3d9_surface { IDirect3DSurface9 IDirect3DSurface9_iface; - LONG refcount; + struct d3d9_resource resource; struct wined3d_surface *wined3d_surface; IDirect3DDevice9Ex *parent_device; IUnknown *container; @@ -213,7 +227,7 @@ struct d3d9_surface *unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface struct d3d9_vertexbuffer { IDirect3DVertexBuffer9 IDirect3DVertexBuffer9_iface; - LONG refcount; + struct d3d9_resource resource; struct wined3d_buffer *wined3d_buffer; IDirect3DDevice9Ex *parent_device; DWORD fvf; @@ -226,7 +240,7 @@ struct d3d9_vertexbuffer *unsafe_impl_from_IDirect3DVertexBuffer9(IDirect3DVerte struct d3d9_indexbuffer { IDirect3DIndexBuffer9 IDirect3DIndexBuffer9_iface; - LONG refcount; + struct d3d9_resource resource; struct wined3d_buffer *wined3d_buffer; IDirect3DDevice9Ex *parent_device; enum wined3d_format_id format; @@ -239,7 +253,7 @@ struct d3d9_indexbuffer *unsafe_impl_from_IDirect3DIndexBuffer9(IDirect3DIndexBu struct d3d9_texture { IDirect3DBaseTexture9 IDirect3DBaseTexture9_iface; - LONG refcount; + struct d3d9_resource resource; struct wined3d_texture *wined3d_texture; IDirect3DDevice9Ex *parent_device; }; diff --git a/reactos/dll/directx/wine/d3d9/device.c b/reactos/dll/directx/wine/d3d9/device.c index efff993cfac..7306d0851ba 100644 --- a/reactos/dll/directx/wine/d3d9/device.c +++ b/reactos/dll/directx/wine/d3d9/device.c @@ -578,7 +578,7 @@ static HRESULT CDECL reset_enum_callback(struct wined3d_resource *resource) } surface = wined3d_resource_get_parent(resource); - if (surface->refcount) + if (surface->resource.refcount) { WARN("Surface %p (resource %p) in pool D3DPOOL_DEFAULT blocks the Reset call.\n", surface, resource); return D3DERR_INVALIDCALL; @@ -3063,7 +3063,7 @@ static HRESULT WINAPI d3d9_device_ComposeRects(IDirect3DDevice9Ex *iface, return E_NOTIMPL; } -static HRESULT WINAPI d3d9_device_PresentEx(IDirect3DDevice9Ex *iface, +static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_PresentEx(IDirect3DDevice9Ex *iface, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region, DWORD flags) { @@ -3182,7 +3182,7 @@ static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx(IDirect3DDevice9Ex return E_NOTIMPL; } -static HRESULT WINAPI d3d9_device_ResetEx(IDirect3DDevice9Ex *iface, +static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_ResetEx(IDirect3DDevice9Ex *iface, D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode) { struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); diff --git a/reactos/dll/directx/wine/d3d9/directx.c b/reactos/dll/directx/wine/d3d9/directx.c index be1917c216c..6b68838ed08 100644 --- a/reactos/dll/directx/wine/d3d9/directx.c +++ b/reactos/dll/directx/wine/d3d9/directx.c @@ -229,6 +229,10 @@ static HRESULT WINAPI d3d9_CheckDeviceType(IDirect3D9Ex *iface, UINT adapter, D3 TRACE("iface %p, adapter %u, device_type %#x, display_format %#x, backbuffer_format %#x, windowed %#x.\n", iface, adapter, device_type, display_format, backbuffer_format, windowed); + /* Others than that not supported by d3d9, but reported by wined3d for ddraw. Filter them out. */ + if (!windowed && display_format != D3DFMT_X8R8G8B8 && display_format != D3DFMT_R5G6B5) + return WINED3DERR_NOTAVAILABLE; + wined3d_mutex_lock(); hr = wined3d_check_device_type(d3d9->wined3d, adapter, device_type, wined3dformat_from_d3dformat(display_format), wined3dformat_from_d3dformat(backbuffer_format), windowed); @@ -629,12 +633,15 @@ static const struct IDirect3D9ExVtbl d3d9_vtbl = BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended) { - DWORD flags = extended ? 0 : WINED3D_VIDMEM_ACCOUNTING; + DWORD flags = WINED3D_PRESENT_CONVERSION; + + if (!extended) + flags |= WINED3D_VIDMEM_ACCOUNTING; d3d9->IDirect3D9Ex_iface.lpVtbl = &d3d9_vtbl; d3d9->refcount = 1; wined3d_mutex_lock(); - d3d9->wined3d = wined3d_create(9, flags); + d3d9->wined3d = wined3d_create(flags); wined3d_mutex_unlock(); if (!d3d9->wined3d) return FALSE; diff --git a/reactos/dll/directx/wine/d3d9/query.c b/reactos/dll/directx/wine/d3d9/query.c index 87cc54d8ed3..044a2ad4f9b 100644 --- a/reactos/dll/directx/wine/d3d9/query.c +++ b/reactos/dll/directx/wine/d3d9/query.c @@ -105,12 +105,17 @@ static D3DQUERYTYPE WINAPI d3d9_query_GetType(IDirect3DQuery9 *iface) static DWORD WINAPI d3d9_query_GetDataSize(IDirect3DQuery9 *iface) { struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); + enum wined3d_query_type type; DWORD ret; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - ret = wined3d_query_get_data_size(query->wined3d_query); + type = wined3d_query_get_type(query->wined3d_query); + if (type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) + ret = sizeof(BOOL); + else + ret = wined3d_query_get_data_size(query->wined3d_query); wined3d_mutex_unlock(); return ret; @@ -133,13 +138,25 @@ static HRESULT WINAPI d3d9_query_Issue(IDirect3DQuery9 *iface, DWORD flags) static HRESULT WINAPI d3d9_query_GetData(IDirect3DQuery9 *iface, void *data, DWORD size, DWORD flags) { struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); + enum wined3d_query_type type; HRESULT hr; TRACE("iface %p, data %p, size %u, flags %#x.\n", iface, data, size, flags); wined3d_mutex_lock(); - hr = wined3d_query_get_data(query->wined3d_query, data, size, flags); + type = wined3d_query_get_type(query->wined3d_query); + if (type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT && data) + { + struct wined3d_query_data_timestamp_disjoint data_disjoint; + + hr = wined3d_query_get_data(query->wined3d_query, &data_disjoint, sizeof(data_disjoint), flags); + *(BOOL *)data = data_disjoint.disjoint; + } + else + { + hr = wined3d_query_get_data(query->wined3d_query, data, size, flags); + } wined3d_mutex_unlock(); return hr; diff --git a/reactos/dll/directx/wine/d3d9/surface.c b/reactos/dll/directx/wine/d3d9/surface.c index 27e6744c80f..785e8604a88 100644 --- a/reactos/dll/directx/wine/d3d9/surface.c +++ b/reactos/dll/directx/wine/d3d9/surface.c @@ -58,7 +58,7 @@ static ULONG WINAPI d3d9_surface_AddRef(IDirect3DSurface9 *iface) return IUnknown_AddRef(surface->forwardReference); } - refcount = InterlockedIncrement(&surface->refcount); + refcount = InterlockedIncrement(&surface->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); if (refcount == 1) @@ -86,7 +86,7 @@ static ULONG WINAPI d3d9_surface_Release(IDirect3DSurface9 *iface) return IUnknown_Release(surface->forwardReference); } - refcount = InterlockedDecrement(&surface->refcount); + refcount = InterlockedDecrement(&surface->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) @@ -140,52 +140,28 @@ static HRESULT WINAPI d3d9_surface_SetPrivateData(IDirect3DSurface9 *iface, REFG const void *data, DWORD data_size, DWORD flags) { struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&surface->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_surface_GetPrivateData(IDirect3DSurface9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&surface->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_surface_FreePrivateData(IDirect3DSurface9 *iface, REFGUID guid) { struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&surface->resource, guid); } static DWORD WINAPI d3d9_surface_SetPriority(IDirect3DSurface9 *iface, DWORD priority) @@ -382,7 +358,9 @@ static const struct IDirect3DSurface9Vtbl d3d9_surface_vtbl = static void STDMETHODCALLTYPE surface_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d9_surface *surface = parent; + d3d9_resource_cleanup(&surface->resource); + HeapFree(GetProcessHeap(), 0, surface); } static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops = @@ -396,7 +374,7 @@ void surface_init(struct d3d9_surface *surface, struct wined3d_surface *wined3d_ struct wined3d_resource_desc desc; surface->IDirect3DSurface9_iface.lpVtbl = &d3d9_surface_vtbl; - surface->refcount = 1; + d3d9_resource_init(&surface->resource); wined3d_resource_get_desc(wined3d_surface_get_resource(wined3d_surface), &desc); switch (d3dformat_from_wined3dformat(desc.format)) diff --git a/reactos/dll/directx/wine/d3d9/texture.c b/reactos/dll/directx/wine/d3d9/texture.c index 2cddc57e09a..5f14bf25c4a 100644 --- a/reactos/dll/directx/wine/d3d9/texture.c +++ b/reactos/dll/directx/wine/d3d9/texture.c @@ -58,7 +58,7 @@ static HRESULT WINAPI d3d9_texture_2d_QueryInterface(IDirect3DTexture9 *iface, R static ULONG WINAPI d3d9_texture_2d_AddRef(IDirect3DTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -76,7 +76,7 @@ static ULONG WINAPI d3d9_texture_2d_AddRef(IDirect3DTexture9 *iface) static ULONG WINAPI d3d9_texture_2d_Release(IDirect3DTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -112,52 +112,28 @@ static HRESULT WINAPI d3d9_texture_2d_SetPrivateData(IDirect3DTexture9 *iface, REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_texture_2d_GetPrivateData(IDirect3DTexture9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_texture_2d_FreePrivateData(IDirect3DTexture9 *iface, REFGUID guid) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d9_texture_2d_SetPriority(IDirect3DTexture9 *iface, DWORD priority) @@ -469,7 +445,7 @@ static HRESULT WINAPI d3d9_texture_cube_QueryInterface(IDirect3DCubeTexture9 *if static ULONG WINAPI d3d9_texture_cube_AddRef(IDirect3DCubeTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -487,7 +463,7 @@ static ULONG WINAPI d3d9_texture_cube_AddRef(IDirect3DCubeTexture9 *iface) static ULONG WINAPI d3d9_texture_cube_Release(IDirect3DCubeTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -525,52 +501,28 @@ static HRESULT WINAPI d3d9_texture_cube_SetPrivateData(IDirect3DCubeTexture9 *if REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_texture_cube_GetPrivateData(IDirect3DCubeTexture9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_texture_cube_FreePrivateData(IDirect3DCubeTexture9 *iface, REFGUID guid) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d9_texture_cube_SetPriority(IDirect3DCubeTexture9 *iface, DWORD priority) @@ -908,7 +860,7 @@ static HRESULT WINAPI d3d9_texture_3d_QueryInterface(IDirect3DVolumeTexture9 *if static ULONG WINAPI d3d9_texture_3d_AddRef(IDirect3DVolumeTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -926,7 +878,7 @@ static ULONG WINAPI d3d9_texture_3d_AddRef(IDirect3DVolumeTexture9 *iface) static ULONG WINAPI d3d9_texture_3d_Release(IDirect3DVolumeTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -962,52 +914,28 @@ static HRESULT WINAPI d3d9_texture_3d_SetPrivateData(IDirect3DVolumeTexture9 *if REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_texture_3d_GetPrivateData(IDirect3DVolumeTexture9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_texture_3d_FreePrivateData(IDirect3DVolumeTexture9 *iface, REFGUID guid) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d9_texture_3d_SetPriority(IDirect3DVolumeTexture9 *iface, DWORD priority) @@ -1295,7 +1223,9 @@ struct d3d9_texture *unsafe_impl_from_IDirect3DBaseTexture9(IDirect3DBaseTexture static void STDMETHODCALLTYPE d3d9_texture_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d9_texture *texture = parent; + d3d9_resource_cleanup(&texture->resource); + HeapFree(GetProcessHeap(), 0, texture); } static const struct wined3d_parent_ops d3d9_texture_wined3d_parent_ops = @@ -1311,7 +1241,7 @@ HRESULT texture_init(struct d3d9_texture *texture, struct d3d9_device *device, HRESULT hr; texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_2d_vtbl; - texture->refcount = 1; + d3d9_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); @@ -1352,7 +1282,7 @@ HRESULT cubetexture_init(struct d3d9_texture *texture, struct d3d9_device *devic HRESULT hr; texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_cube_vtbl; - texture->refcount = 1; + d3d9_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_CUBE_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); @@ -1392,7 +1322,7 @@ HRESULT volumetexture_init(struct d3d9_texture *texture, struct d3d9_device *dev HRESULT hr; texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_3d_vtbl; - texture->refcount = 1; + d3d9_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_VOLUME_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); diff --git a/reactos/dll/directx/wine/d3d9/volume.c b/reactos/dll/directx/wine/d3d9/volume.c index b0a629080bc..9a3419d295f 100644 --- a/reactos/dll/directx/wine/d3d9/volume.c +++ b/reactos/dll/directx/wine/d3d9/volume.c @@ -57,7 +57,7 @@ static ULONG WINAPI d3d9_volume_AddRef(IDirect3DVolume9 *iface) return IUnknown_AddRef(volume->forwardReference); } - refcount = InterlockedIncrement(&volume->refcount); + refcount = InterlockedIncrement(&volume->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); if (refcount == 1) @@ -83,7 +83,7 @@ static ULONG WINAPI d3d9_volume_Release(IDirect3DVolume9 *iface) return IUnknown_Release(volume->forwardReference); } - refcount = InterlockedDecrement(&volume->refcount); + refcount = InterlockedDecrement(&volume->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) @@ -120,52 +120,28 @@ static HRESULT WINAPI d3d9_volume_SetPrivateData(IDirect3DVolume9 *iface, REFGUI const void *data, DWORD data_size, DWORD flags) { struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&volume->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_volume_GetPrivateData(IDirect3DVolume9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&volume->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_volume_FreePrivateData(IDirect3DVolume9 *iface, REFGUID guid) { struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&volume->resource, guid); } static HRESULT WINAPI d3d9_volume_GetContainer(IDirect3DVolume9 *iface, REFIID riid, void **container) @@ -263,7 +239,9 @@ static const struct IDirect3DVolume9Vtbl d3d9_volume_vtbl = static void STDMETHODCALLTYPE volume_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d9_volume *volume = parent; + d3d9_resource_cleanup(&volume->resource); + HeapFree(GetProcessHeap(), 0, volume); } static const struct wined3d_parent_ops d3d9_volume_wined3d_parent_ops = @@ -275,7 +253,7 @@ void volume_init(struct d3d9_volume *volume, struct wined3d_volume *wined3d_volu const struct wined3d_parent_ops **parent_ops) { volume->IDirect3DVolume9_iface.lpVtbl = &d3d9_volume_vtbl; - volume->refcount = 1; + d3d9_resource_init(&volume->resource); wined3d_volume_incref(wined3d_volume); volume->wined3d_volume = wined3d_volume; diff --git a/reactos/dll/directx/wine/ddraw/ddraw.c b/reactos/dll/directx/wine/ddraw/ddraw.c index 272e10969a9..e16a23d7e7e 100644 --- a/reactos/dll/directx/wine/ddraw/ddraw.c +++ b/reactos/dll/directx/wine/ddraw/ddraw.c @@ -30,7 +30,7 @@ static BOOL restore_mode; /* Device identifier. Don't relay it to WineD3D */ static const DDDEVICEIDENTIFIER2 deviceidentifier = { - "display", + "vga.dll", /* default 2D driver */ "DirectDraw HAL", { { 0x00010001, 0x00010001 } }, 0, 0, 0, 0, @@ -2556,19 +2556,46 @@ static HRESULT WINAPI ddraw7_EvaluateMode(IDirectDraw7 *iface, DWORD Flags, DWOR static HRESULT WINAPI ddraw7_GetDeviceIdentifier(IDirectDraw7 *iface, DDDEVICEIDENTIFIER2 *DDDI, DWORD Flags) { + struct ddraw *ddraw = impl_from_IDirectDraw7(iface); + struct wined3d_adapter_identifier adapter_id; + HRESULT hr = S_OK; + TRACE("iface %p, device_identifier %p, flags %#x.\n", iface, DDDI, Flags); - if(!DDDI) + if (!DDDI) return DDERR_INVALIDPARAMS; - /* The DDGDI_GETHOSTIDENTIFIER returns the information about the 2D - * host adapter, if there's a secondary 3D adapter. This doesn't apply - * to any modern hardware, nor is it interesting for Wine, so ignore it. - * Size of DDDEVICEIDENTIFIER2 may be aligned to 8 bytes and thus 4 - * bytes too long. So only copy the relevant part of the structure - */ + if (Flags & DDGDI_GETHOSTIDENTIFIER) + { + /* The DDGDI_GETHOSTIDENTIFIER returns the information about the 2D + * host adapter, if there's a secondary 3D adapter. This doesn't apply + * to any modern hardware, nor is it interesting for Wine, so ignore it. + * Size of DDDEVICEIDENTIFIER2 may be aligned to 8 bytes and thus 4 + * bytes too long. So only copy the relevant part of the structure + */ - memcpy(DDDI, &deviceidentifier, FIELD_OFFSET(DDDEVICEIDENTIFIER2, dwWHQLLevel) + sizeof(DWORD)); + memcpy(DDDI, &deviceidentifier, FIELD_OFFSET(DDDEVICEIDENTIFIER2, dwWHQLLevel) + sizeof(DWORD)); + return DD_OK; + } + + /* Drakan: Order of the Flame expects accurate D3D device information from ddraw */ + adapter_id.driver = DDDI->szDriver; + adapter_id.driver_size = sizeof(DDDI->szDriver); + adapter_id.description = DDDI->szDescription; + adapter_id.description_size = sizeof(DDDI->szDescription); + adapter_id.device_name_size = 0; + wined3d_mutex_lock(); + hr = wined3d_get_adapter_identifier(ddraw->wined3d, WINED3DADAPTER_DEFAULT, 0x0, &adapter_id); + wined3d_mutex_unlock(); + if (FAILED(hr)) return hr; + + DDDI->liDriverVersion = adapter_id.driver_version; + DDDI->dwVendorId = adapter_id.vendor_id; + DDDI->dwDeviceId = adapter_id.device_id; + DDDI->dwSubSysId = adapter_id.subsystem_id; + DDDI->dwRevision = adapter_id.revision; + DDDI->guidDeviceIdentifier = adapter_id.device_identifier; + DDDI->dwWHQLLevel = adapter_id.whql_level; return DD_OK; } @@ -4839,9 +4866,9 @@ HRESULT ddraw_init(struct ddraw *ddraw, enum wined3d_device_type device_type) ddraw->ref7 = 1; flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING; - if (!(ddraw->wined3d = wined3d_create(7, flags))) + if (!(ddraw->wined3d = wined3d_create(flags))) { - if (!(ddraw->wined3d = wined3d_create(7, flags | WINED3D_NO3D))) + if (!(ddraw->wined3d = wined3d_create(flags | WINED3D_NO3D))) { WARN("Failed to create a wined3d object.\n"); return E_FAIL; diff --git a/reactos/dll/directx/wine/ddraw/ddraw.rc b/reactos/dll/directx/wine/ddraw/ddraw.rc index 3926bb44eae..6ab8c4e7ea1 100644 --- a/reactos/dll/directx/wine/ddraw/ddraw.rc +++ b/reactos/dll/directx/wine/ddraw/ddraw.rc @@ -1,3 +1,3 @@ #include "version.rc" -1 WINE_REGISTRY ddraw.rgs +1 WINE_REGISTRY ddraw_classes.rgs diff --git a/reactos/dll/directx/wine/ddraw/ddraw.rgs b/reactos/dll/directx/wine/ddraw/ddraw_classes.rgs similarity index 100% rename from reactos/dll/directx/wine/ddraw/ddraw.rgs rename to reactos/dll/directx/wine/ddraw/ddraw_classes.rgs diff --git a/reactos/dll/directx/wine/ddraw/ddraw_private.h b/reactos/dll/directx/wine/ddraw/ddraw_private.h index a312ed7dad2..ae2adbd218a 100644 --- a/reactos/dll/directx/wine/ddraw/ddraw_private.h +++ b/reactos/dll/directx/wine/ddraw/ddraw_private.h @@ -157,6 +157,7 @@ struct ddraw_surface struct ddraw *ddraw; struct wined3d_surface *wined3d_surface; struct wined3d_texture *wined3d_texture; + struct wined3d_private_store private_store; struct d3d_device *device1; /* This implementation handles attaching surfaces to other surfaces */ @@ -550,8 +551,6 @@ struct d3d_vertex_buffer DWORD fvf; DWORD size; BOOL dynamic; - - BOOL read_since_last_map; }; HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **buffer, struct ddraw *ddraw, diff --git a/reactos/dll/directx/wine/ddraw/device.c b/reactos/dll/directx/wine/ddraw/device.c index cfad802e46d..c53f69b1633 100644 --- a/reactos/dll/directx/wine/ddraw/device.c +++ b/reactos/dll/directx/wine/ddraw/device.c @@ -4264,9 +4264,6 @@ static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVE wined3d_device_set_primitive_type(device->wined3d_device, PrimitiveType); hr = wined3d_device_draw_primitive(device->wined3d_device, StartVertex, NumVertices); - if (SUCCEEDED(hr)) - vb->read_since_last_map = TRUE; - wined3d_mutex_unlock(); return hr; @@ -4392,9 +4389,6 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface, wined3d_device_set_primitive_type(This->wined3d_device, PrimitiveType); hr = wined3d_device_draw_indexed_primitive(This->wined3d_device, ib_pos / sizeof(WORD), IndexCount); - if (SUCCEEDED(hr)) - vb->read_since_last_map = TRUE; - wined3d_mutex_unlock(); return hr; diff --git a/reactos/dll/directx/wine/ddraw/main.c b/reactos/dll/directx/wine/ddraw/main.c index 9387cc09bc7..bac39e8d2d8 100644 --- a/reactos/dll/directx/wine/ddraw/main.c +++ b/reactos/dll/directx/wine/ddraw/main.c @@ -402,9 +402,9 @@ HRESULT WINAPI DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA callback, void *contex FIXME("flags 0x%08x not handled\n", flags & ~DDENUM_ATTACHEDSECONDARYDEVICES); TRACE("Enumerating ddraw interfaces\n"); - if (!(wined3d = wined3d_create(7, WINED3D_LEGACY_DEPTH_BIAS))) + if (!(wined3d = wined3d_create(WINED3D_LEGACY_DEPTH_BIAS))) { - if (!(wined3d = wined3d_create(7, WINED3D_LEGACY_DEPTH_BIAS | WINED3D_NO3D))) + if (!(wined3d = wined3d_create(WINED3D_LEGACY_DEPTH_BIAS | WINED3D_NO3D))) { WARN("Failed to create a wined3d object.\n"); return E_FAIL; diff --git a/reactos/dll/directx/wine/ddraw/surface.c b/reactos/dll/directx/wine/ddraw/surface.c index 9a35b1ad452..4e465d3727c 100644 --- a/reactos/dll/directx/wine/ddraw/surface.c +++ b/reactos/dll/directx/wine/ddraw/surface.c @@ -1665,106 +1665,94 @@ static HRESULT WINAPI ddraw_surface7_AddAttachedSurface(IDirectDrawSurface7 *ifa static HRESULT WINAPI ddraw_surface4_AddAttachedSurface(IDirectDrawSurface4 *iface, IDirectDrawSurface4 *attachment) { - struct ddraw_surface *This = impl_from_IDirectDrawSurface4(iface); + struct ddraw_surface *surface = impl_from_IDirectDrawSurface4(iface); struct ddraw_surface *attachment_impl = unsafe_impl_from_IDirectDrawSurface4(attachment); HRESULT hr; TRACE("iface %p, attachment %p.\n", iface, attachment); - hr = ddraw_surface7_AddAttachedSurface(&This->IDirectDrawSurface7_iface, - attachment_impl ? &attachment_impl->IDirectDrawSurface7_iface : NULL); - if (FAILED(hr)) - { - return hr; - } - attachment_impl->attached_iface = (IUnknown *)attachment; - IUnknown_AddRef(attachment_impl->attached_iface); - ddraw_surface7_Release(&attachment_impl->IDirectDrawSurface7_iface); - return hr; -} -static HRESULT WINAPI ddraw_surface3_AddAttachedSurface(IDirectDrawSurface3 *iface, IDirectDrawSurface3 *attachment) -{ - struct ddraw_surface *This = impl_from_IDirectDrawSurface3(iface); - struct ddraw_surface *attachment_impl = unsafe_impl_from_IDirectDrawSurface3(attachment); - HRESULT hr; - - TRACE("iface %p, attachment %p.\n", iface, attachment); - /* Tests suggest that * -> offscreen plain surfaces can be attached to other offscreen plain surfaces * -> offscreen plain surfaces can be attached to primaries * -> primaries can be attached to offscreen plain surfaces * -> z buffers can be attached to primaries */ - if (This->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_OFFSCREENPLAIN) + if (surface->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_OFFSCREENPLAIN) && attachment_impl->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_OFFSCREENPLAIN)) { /* Sizes have to match */ - if (attachment_impl->surface_desc.dwWidth != This->surface_desc.dwWidth - || attachment_impl->surface_desc.dwHeight != This->surface_desc.dwHeight) + if (attachment_impl->surface_desc.dwWidth != surface->surface_desc.dwWidth + || attachment_impl->surface_desc.dwHeight != surface->surface_desc.dwHeight) { WARN("Surface sizes do not match.\n"); return DDERR_CANNOTATTACHSURFACE; } - /* OK */ } - else if (This->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE) - && attachment_impl->surface_desc.ddsCaps.dwCaps & (DDSCAPS_ZBUFFER)) - { - /* OK */ - } - else + else if (!(surface->surface_desc.ddsCaps.dwCaps & (DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE)) + || !(attachment_impl->surface_desc.ddsCaps.dwCaps & (DDSCAPS_ZBUFFER))) { WARN("Invalid attachment combination.\n"); return DDERR_CANNOTATTACHSURFACE; } - hr = ddraw_surface_attach_surface(This, attachment_impl); - if (FAILED(hr)) - { + if (FAILED(hr = ddraw_surface_attach_surface(surface, attachment_impl))) return hr; - } + attachment_impl->attached_iface = (IUnknown *)attachment; IUnknown_AddRef(attachment_impl->attached_iface); return hr; } +static HRESULT WINAPI ddraw_surface3_AddAttachedSurface(IDirectDrawSurface3 *iface, IDirectDrawSurface3 *attachment) +{ + struct ddraw_surface *surface = impl_from_IDirectDrawSurface3(iface); + struct ddraw_surface *attachment_impl = unsafe_impl_from_IDirectDrawSurface3(attachment); + HRESULT hr; + + TRACE("iface %p, attachment %p.\n", iface, attachment); + + if (FAILED(hr = ddraw_surface4_AddAttachedSurface(&surface->IDirectDrawSurface4_iface, + attachment_impl ? &attachment_impl->IDirectDrawSurface4_iface : NULL))) + return hr; + + attachment_impl->attached_iface = (IUnknown *)attachment; + IUnknown_AddRef(attachment_impl->attached_iface); + ddraw_surface4_Release(&attachment_impl->IDirectDrawSurface4_iface); + return hr; +} + static HRESULT WINAPI ddraw_surface2_AddAttachedSurface(IDirectDrawSurface2 *iface, IDirectDrawSurface2 *attachment) { - struct ddraw_surface *This = impl_from_IDirectDrawSurface2(iface); + struct ddraw_surface *surface = impl_from_IDirectDrawSurface2(iface); struct ddraw_surface *attachment_impl = unsafe_impl_from_IDirectDrawSurface2(attachment); HRESULT hr; TRACE("iface %p, attachment %p.\n", iface, attachment); - hr = ddraw_surface3_AddAttachedSurface(&This->IDirectDrawSurface3_iface, - attachment_impl ? &attachment_impl->IDirectDrawSurface3_iface : NULL); - if (FAILED(hr)) - { + if (FAILED(hr = ddraw_surface4_AddAttachedSurface(&surface->IDirectDrawSurface4_iface, + attachment_impl ? &attachment_impl->IDirectDrawSurface4_iface : NULL))) return hr; - } + attachment_impl->attached_iface = (IUnknown *)attachment; IUnknown_AddRef(attachment_impl->attached_iface); - ddraw_surface3_Release(&attachment_impl->IDirectDrawSurface3_iface); + ddraw_surface4_Release(&attachment_impl->IDirectDrawSurface4_iface); return hr; } static HRESULT WINAPI ddraw_surface1_AddAttachedSurface(IDirectDrawSurface *iface, IDirectDrawSurface *attachment) { - struct ddraw_surface *This = impl_from_IDirectDrawSurface(iface); + struct ddraw_surface *surface = impl_from_IDirectDrawSurface(iface); struct ddraw_surface *attachment_impl = unsafe_impl_from_IDirectDrawSurface(attachment); HRESULT hr; TRACE("iface %p, attachment %p.\n", iface, attachment); - hr = ddraw_surface3_AddAttachedSurface(&This->IDirectDrawSurface3_iface, - attachment_impl ? &attachment_impl->IDirectDrawSurface3_iface : NULL); - if (FAILED(hr)) - { + if (FAILED(hr = ddraw_surface4_AddAttachedSurface(&surface->IDirectDrawSurface4_iface, + attachment_impl ? &attachment_impl->IDirectDrawSurface4_iface : NULL))) return hr; - } + attachment_impl->attached_iface = (IUnknown *)attachment; IUnknown_AddRef(attachment_impl->attached_iface); - ddraw_surface3_Release(&attachment_impl->IDirectDrawSurface3_iface); + ddraw_surface4_Release(&attachment_impl->IDirectDrawSurface4_iface); return hr; } @@ -2253,25 +2241,24 @@ static HRESULT WINAPI ddraw_surface7_GetPriority(IDirectDrawSurface7 *iface, DWO * *****************************************************************************/ static HRESULT WINAPI ddraw_surface7_SetPrivateData(IDirectDrawSurface7 *iface, - REFGUID tag, void *Data, DWORD Size, DWORD Flags) + REFGUID tag, void *data, DWORD size, DWORD flags) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); - struct wined3d_resource *resource; HRESULT hr; TRACE("iface %p, tag %s, data %p, data_size %u, flags %#x.\n", - iface, debugstr_guid(tag), Data, Size, Flags); + iface, debugstr_guid(tag), data, size, flags); + + if (!data) + { + WARN("data is NULL, returning DDERR_INVALIDPARAMS.\n"); + return DDERR_INVALIDPARAMS; + } wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_set_private_data(resource, tag, Data, Size, Flags); + hr = wined3d_private_store_set_private_data(&surface->private_store, tag, data, size, flags); wined3d_mutex_unlock(); - - switch(hr) - { - case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS; - default: return hr; - } + return hr_ddraw_from_wined3d(hr); } static HRESULT WINAPI ddraw_surface4_SetPrivateData(IDirectDrawSurface4 *iface, @@ -2301,23 +2288,45 @@ static HRESULT WINAPI ddraw_surface4_SetPrivateData(IDirectDrawSurface4 *iface, * For more details, see IWineD3DSurface::GetPrivateData * *****************************************************************************/ -static HRESULT WINAPI ddraw_surface7_GetPrivateData(IDirectDrawSurface7 *iface, REFGUID tag, void *Data, DWORD *Size) +static HRESULT WINAPI ddraw_surface7_GetPrivateData(IDirectDrawSurface7 *iface, REFGUID tag, void *data, DWORD *size) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); - struct wined3d_resource *resource; + const struct wined3d_private_data *stored_data; HRESULT hr; TRACE("iface %p, tag %s, data %p, data_size %p.\n", - iface, debugstr_guid(tag), Data, Size); - - if(!Data) - return DDERR_INVALIDPARAMS; + iface, debugstr_guid(tag), data, size); wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_get_private_data(resource, tag, Data, Size); - wined3d_mutex_unlock(); + stored_data = wined3d_private_store_get_private_data(&surface->private_store, tag); + if (!stored_data) + { + hr = DDERR_NOTFOUND; + goto done; + } + if (!size) + { + hr = DDERR_INVALIDPARAMS; + goto done; + } + if (*size < stored_data->size) + { + *size = stored_data->size; + hr = DDERR_MOREDATA; + goto done; + } + if (!data) + { + hr = DDERR_INVALIDPARAMS; + goto done; + } + *size = stored_data->size; + memcpy(data, stored_data->content.data, stored_data->size); + hr = DD_OK; + +done: + wined3d_mutex_unlock(); return hr; } @@ -2347,17 +2356,22 @@ static HRESULT WINAPI ddraw_surface4_GetPrivateData(IDirectDrawSurface4 *iface, static HRESULT WINAPI ddraw_surface7_FreePrivateData(IDirectDrawSurface7 *iface, REFGUID tag) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); - struct wined3d_resource *resource; - HRESULT hr; + struct wined3d_private_data *entry; TRACE("iface %p, tag %s.\n", iface, debugstr_guid(tag)); wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_free_private_data(resource, tag); + entry = wined3d_private_store_get_private_data(&surface->private_store, tag); + if (!entry) + { + wined3d_mutex_unlock(); + return DDERR_NOTFOUND; + } + + wined3d_private_store_free_private_data(&surface->private_store, entry); wined3d_mutex_unlock(); - return hr; + return DD_OK; } static HRESULT WINAPI ddraw_surface4_FreePrivateData(IDirectDrawSurface4 *iface, REFGUID tag) @@ -5476,6 +5490,8 @@ static void STDMETHODCALLTYPE ddraw_surface_wined3d_object_destroyed(void *paren if (surface == surface->ddraw->primary) surface->ddraw->primary = NULL; + wined3d_private_store_cleanup(&surface->private_store); + HeapFree(GetProcessHeap(), 0, surface); } @@ -5538,11 +5554,6 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ /* Ensure DDSD_CAPS is always set. */ desc->dwFlags |= DDSD_CAPS; - /* If the surface is of the 'ALLOCONLOAD' type, ignore the LPSURFACE - * field. Frank Herbert's Dune specifies a NULL pointer for lpSurface. */ - if ((desc->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD) || !desc->lpSurface) - desc->dwFlags &= ~DDSD_LPSURFACE; - if (desc->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) { DWORD flippable = desc->ddsCaps.dwCaps & (DDSCAPS_FLIP | DDSCAPS_COMPLEX); @@ -5820,6 +5831,34 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ } } + /* If the surface is of the 'ALLOCONLOAD' type, ignore the LPSURFACE + * field. Frank Herbert's Dune specifies a NULL pointer for lpSurface. */ + if ((desc->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD) || !desc->lpSurface) + desc->dwFlags &= ~DDSD_LPSURFACE; + if (desc->dwFlags & DDSD_LPSURFACE) + { + if (wined3d_desc.pool != WINED3D_POOL_SYSTEM_MEM) + { + WARN("User memory surfaces should be in the system memory pool.\n"); + HeapFree(GetProcessHeap(), 0, texture); + return DDERR_INVALIDCAPS; + } + + if (version < 4) + { + WARN("User memory surfaces not supported before version 4.\n"); + HeapFree(GetProcessHeap(), 0, texture); + return DDERR_INVALIDPARAMS; + } + + if (!(desc->dwFlags & DDSD_PITCH)) + { + WARN("User memory surfaces should explicitly specify the pitch.\n"); + HeapFree(GetProcessHeap(), 0, texture); + return DDERR_INVALIDPARAMS; + } + } + if (desc->ddsCaps.dwCaps & (DDSCAPS_OVERLAY)) wined3d_desc.usage |= WINED3DUSAGE_OVERLAY; @@ -6050,34 +6089,36 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s else surface->surface_desc.u1.dwLinearSize = max(4, desc->dwWidth) * max(4, desc->dwHeight); } - else + else if (!(desc->dwFlags & DDSD_LPSURFACE)) { - surface->surface_desc.dwFlags |= DDSD_PITCH; - surface->surface_desc.u1.lPitch = wined3d_surface_get_pitch(wined3d_surface); + desc->dwFlags |= DDSD_PITCH; + desc->u1.lPitch = wined3d_surface_get_pitch(wined3d_surface); } if (desc->dwFlags & DDSD_LPSURFACE) { - UINT pitch = 0; - - if (desc->dwFlags & DDSD_PITCH) + if (desc->u1.lPitch < wined3d_surface_get_pitch(wined3d_surface) || desc->u1.lPitch & 3) { - pitch = desc->u1.lPitch; - surface->surface_desc.u1.lPitch = pitch; + WARN("Invalid pitch %u specified.\n", desc->u1.lPitch); + return DDERR_INVALIDPARAMS; } if (FAILED(hr = wined3d_surface_update_desc(wined3d_surface, wined3d_desc.width, wined3d_desc.height, wined3d_desc.format, WINED3D_MULTISAMPLE_NONE, 0, - desc->lpSurface, pitch))) + desc->lpSurface, desc->u1.lPitch))) { ERR("Failed to set surface memory, hr %#x.\n", hr); return hr; } + + desc->dwFlags &= ~DDSD_LPSURFACE; } wined3d_surface_incref(wined3d_surface); surface->wined3d_surface = wined3d_surface; *parent_ops = &ddraw_surface_wined3d_parent_ops; + wined3d_private_store_init(&surface->private_store); + return DD_OK; } diff --git a/reactos/dll/directx/wine/ddraw/utils.c b/reactos/dll/directx/wine/ddraw/utils.c index 6f9dd9c5059..daf0f6ca7d5 100644 --- a/reactos/dll/directx/wine/ddraw/utils.c +++ b/reactos/dll/directx/wine/ddraw/utils.c @@ -751,7 +751,7 @@ DDRAW_dump_pixelformat(const DDPIXELFORMAT *pf) case 16: cmd = "%04lx"; break; case 24: cmd = "%06lx"; break; case 32: cmd = "%08lx"; break; - default: ERR("Unexpected bit depth !\n"); cmd = "%d"; break; + default: ERR("Unexpected bit depth!\n"); cmd = "%d"; break; } TRACE(" R "); TRACE(cmd, pf->u2.dwRBitMask); TRACE(" G "); TRACE(cmd, pf->u3.dwGBitMask); diff --git a/reactos/dll/directx/wine/ddraw/vertexbuffer.c b/reactos/dll/directx/wine/ddraw/vertexbuffer.c index 4c0569808d0..842a3bd2ad7 100644 --- a/reactos/dll/directx/wine/ddraw/vertexbuffer.c +++ b/reactos/dll/directx/wine/ddraw/vertexbuffer.c @@ -240,7 +240,7 @@ static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface, wined3d_flags |= WINED3D_MAP_READONLY; if (flags & DDLOCK_NOOVERWRITE) wined3d_flags |= WINED3D_MAP_NOOVERWRITE; - if (flags & DDLOCK_DISCARDCONTENTS && buffer->read_since_last_map) + if (flags & DDLOCK_DISCARDCONTENTS) { wined3d_flags |= WINED3D_MAP_DISCARD; @@ -274,9 +274,6 @@ static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface, hr = wined3d_buffer_map(buffer->wineD3DVertexBuffer, 0, 0, (BYTE **)data, wined3d_flags); - if (SUCCEEDED(hr)) - buffer->read_since_last_map = FALSE; - wined3d_mutex_unlock(); return hr; diff --git a/reactos/dll/directx/wine/ddraw/viewport.c b/reactos/dll/directx/wine/ddraw/viewport.c index 373a1808460..42640055611 100644 --- a/reactos/dll/directx/wine/ddraw/viewport.c +++ b/reactos/dll/directx/wine/ddraw/viewport.c @@ -672,7 +672,7 @@ static HRESULT WINAPI d3d_viewport_Clear(IDirect3DViewport3 *iface, } if (This->active_device == NULL) { - ERR(" Trying to clear a viewport not attached to a device !\n"); + ERR(" Trying to clear a viewport not attached to a device!\n"); return D3DERR_VIEWPORTHASNODEVICE; } d3d_device3 = &This->active_device->IDirect3DDevice3_iface; @@ -682,7 +682,7 @@ static HRESULT WINAPI d3d_viewport_Clear(IDirect3DViewport3 *iface, if (flags & D3DCLEAR_TARGET) { if (This->background == NULL) { - ERR(" Trying to clear the color buffer without background material !\n"); + ERR(" Trying to clear the color buffer without background material!\n"); } else { diff --git a/reactos/dll/directx/wine/dxgi/adapter.c b/reactos/dll/directx/wine/dxgi/adapter.c index 6195c30a174..b6d26953b1c 100644 --- a/reactos/dll/directx/wine/dxgi/adapter.c +++ b/reactos/dll/directx/wine/dxgi/adapter.c @@ -33,6 +33,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IWineDXGIAdapter *i if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDXGIObject) || IsEqualGUID(riid, &IID_IDXGIAdapter) + || IsEqualGUID(riid, &IID_IDXGIAdapter1) || IsEqualGUID(riid, &IID_IWineDXGIAdapter)) { IUnknown_AddRef(iface); @@ -130,9 +131,9 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *ifac return S_OK; } -static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IWineDXGIAdapter *iface, DXGI_ADAPTER_DESC *desc) +static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc1(IWineDXGIAdapter *iface, DXGI_ADAPTER_DESC1 *desc) { - struct dxgi_adapter *This = impl_from_IWineDXGIAdapter(iface); + struct dxgi_adapter *adapter = impl_from_IWineDXGIAdapter(iface); struct wined3d_adapter_identifier adapter_id; char description[128]; struct wined3d *wined3d; @@ -140,38 +141,57 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IWineDXGIAdapter *iface, D TRACE("iface %p, desc %p.\n", iface, desc); - if (!desc) return E_INVALIDARG; + if (!desc) + return E_INVALIDARG; - wined3d = IWineDXGIFactory_get_wined3d(This->parent); + wined3d = IWineDXGIFactory_get_wined3d(adapter->parent); adapter_id.driver_size = 0; adapter_id.description = description; adapter_id.description_size = sizeof(description); adapter_id.device_name_size = 0; EnterCriticalSection(&dxgi_cs); - hr = wined3d_get_adapter_identifier(wined3d, This->ordinal, 0, &adapter_id); + hr = wined3d_get_adapter_identifier(wined3d, adapter->ordinal, 0, &adapter_id); wined3d_decref(wined3d); LeaveCriticalSection(&dxgi_cs); - if (SUCCEEDED(hr)) - { - if (!MultiByteToWideChar(CP_ACP, 0, description, -1, desc->Description, 128)) - { - DWORD err = GetLastError(); - ERR("Failed to translate description %s (%#x).\n", debugstr_a(description), err); - hr = E_FAIL; - } + if (FAILED(hr)) + return hr; - desc->VendorId = adapter_id.vendor_id; - desc->DeviceId = adapter_id.device_id; - desc->SubSysId = adapter_id.subsystem_id; - desc->Revision = adapter_id.revision; - desc->DedicatedVideoMemory = adapter_id.video_memory; - desc->DedicatedSystemMemory = 0; /* FIXME */ - desc->SharedSystemMemory = 0; /* FIXME */ - memcpy(&desc->AdapterLuid, &adapter_id.adapter_luid, sizeof(desc->AdapterLuid)); + if (!MultiByteToWideChar(CP_ACP, 0, description, -1, desc->Description, 128)) + { + DWORD err = GetLastError(); + ERR("Failed to translate description %s (%#x).\n", debugstr_a(description), err); + hr = E_FAIL; } + desc->VendorId = adapter_id.vendor_id; + desc->DeviceId = adapter_id.device_id; + desc->SubSysId = adapter_id.subsystem_id; + desc->Revision = adapter_id.revision; + desc->DedicatedVideoMemory = adapter_id.video_memory; + desc->DedicatedSystemMemory = 0; /* FIXME */ + desc->SharedSystemMemory = 0; /* FIXME */ + memcpy(&desc->AdapterLuid, &adapter_id.adapter_luid, sizeof(desc->AdapterLuid)); + desc->Flags = 0; + + return hr; +} + +static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IWineDXGIAdapter *iface, DXGI_ADAPTER_DESC *desc) +{ + DXGI_ADAPTER_DESC1 desc1; + HRESULT hr; + + TRACE("iface %p, desc %p.\n", iface, desc); + + if (!desc) + return E_INVALIDARG; + + if (FAILED(hr = dxgi_adapter_GetDesc1(iface, &desc1))) + return hr; + memcpy(desc, &desc1, sizeof(*desc)); + return hr; } @@ -209,6 +229,8 @@ static const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl = dxgi_adapter_EnumOutputs, dxgi_adapter_GetDesc, dxgi_adapter_CheckInterfaceSupport, + /* IDXGIAdapter1 methods */ + dxgi_adapter_GetDesc1, /* IWineDXGIAdapter methods */ dxgi_adapter_get_ordinal, }; diff --git a/reactos/dll/directx/wine/dxgi/dxgi.spec b/reactos/dll/directx/wine/dxgi/dxgi.spec index 853d8e28d13..2232f88df07 100644 --- a/reactos/dll/directx/wine/dxgi/dxgi.spec +++ b/reactos/dll/directx/wine/dxgi/dxgi.spec @@ -1,3 +1,4 @@ @ stdcall CreateDXGIFactory(ptr ptr) +@ stdcall CreateDXGIFactory1(ptr ptr) @ stdcall DXGID3D10CreateDevice(ptr ptr ptr long ptr ptr) @ stdcall DXGID3D10RegisterLayers(ptr long) diff --git a/reactos/dll/directx/wine/dxgi/dxgi_main.c b/reactos/dll/directx/wine/dxgi/dxgi_main.c index e20be15917d..a12f3a6048f 100644 --- a/reactos/dll/directx/wine/dxgi/dxgi_main.c +++ b/reactos/dll/directx/wine/dxgi/dxgi_main.c @@ -43,55 +43,35 @@ static void dxgi_main_cleanup(void) DeleteCriticalSection(&dxgi_cs); } -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) +BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) { - TRACE("fdwReason %u\n", fdwReason); - - switch(fdwReason) + switch (reason) { case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hInstDLL); + DisableThreadLibraryCalls(inst); break; case DLL_PROCESS_DETACH: - if (lpv) break; - dxgi_main_cleanup(); + if (!reserved) + dxgi_main_cleanup(); break; } return TRUE; } -HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory) +HRESULT WINAPI CreateDXGIFactory1(REFIID riid, void **factory) { - struct dxgi_factory *object; - HRESULT hr; - TRACE("riid %s, factory %p\n", debugstr_guid(riid), factory); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); - if (!object) - { - ERR("Failed to allocate DXGI factory object memory\n"); - *factory = NULL; - return E_OUTOFMEMORY; - } + return dxgi_factory_create(riid, factory, TRUE); +} - hr = dxgi_factory_init(object); - if (FAILED(hr)) - { - WARN("Failed to initialize swapchain, hr %#x.\n", hr); - HeapFree(GetProcessHeap(), 0, object); - *factory = NULL; - return hr; - } +HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory) +{ + TRACE("riid %s, factory %p\n", debugstr_guid(riid), factory); - TRACE("Created IDXGIFactory %p\n", object); - - hr = IDXGIFactory_QueryInterface((IDXGIFactory *)object, riid, factory); - IDXGIFactory_Release((IDXGIFactory *)object); - - return hr; + return dxgi_factory_create(riid, factory, FALSE); } static BOOL get_layer(enum dxgi_device_layer_id id, struct dxgi_device_layer *layer) @@ -125,8 +105,7 @@ static HRESULT register_d3d10core_layers(HMODULE d3d10core) HMODULE mod; BOOL ret; - ret = GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (LPCSTR)d3d10core, &mod); - if (!ret) + if (!(ret = GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, (const char *)d3d10core, &mod))) { LeaveCriticalSection(&dxgi_cs); return E_FAIL; diff --git a/reactos/dll/directx/wine/dxgi/dxgi_private.h b/reactos/dll/directx/wine/dxgi/dxgi_private.h index 1921e9a5ffb..15d8e21a986 100644 --- a/reactos/dll/directx/wine/dxgi/dxgi_private.h +++ b/reactos/dll/directx/wine/dxgi/dxgi_private.h @@ -90,10 +90,11 @@ struct dxgi_factory LONG refcount; struct wined3d *wined3d; UINT adapter_count; - IDXGIAdapter **adapters; + IWineDXGIAdapter **adapters; + BOOL extended; }; -HRESULT dxgi_factory_init(struct dxgi_factory *factory) DECLSPEC_HIDDEN; +HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) DECLSPEC_HIDDEN; /* IDXGIDevice */ struct dxgi_device diff --git a/reactos/dll/directx/wine/dxgi/factory.c b/reactos/dll/directx/wine/dxgi/factory.c index 55705665905..a0c0937a301 100644 --- a/reactos/dll/directx/wine/dxgi/factory.c +++ b/reactos/dll/directx/wine/dxgi/factory.c @@ -28,11 +28,14 @@ static inline struct dxgi_factory *impl_from_IWineDXGIFactory(IWineDXGIFactory * static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IWineDXGIFactory *iface, REFIID riid, void **object) { + struct dxgi_factory *factory = impl_from_IWineDXGIFactory(iface); + TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDXGIObject) || IsEqualGUID(riid, &IID_IDXGIFactory) + || (factory->extended && IsEqualGUID(riid, &IID_IDXGIFactory1)) || IsEqualGUID(riid, &IID_IWineDXGIFactory)) { IUnknown_AddRef(iface); @@ -69,7 +72,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IWineDXGIFactory *iface) for (i = 0; i < This->adapter_count; ++i) { - IDXGIAdapter_Release(This->adapters[i]); + IWineDXGIAdapter_Release(This->adapters[i]); } HeapFree(GetProcessHeap(), 0, This->adapters); @@ -119,29 +122,38 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IWineDXGIFactory *iface, /* IDXGIFactory methods */ -static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *iface, - UINT adapter_idx, IDXGIAdapter **adapter) +static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters1(IWineDXGIFactory *iface, + UINT adapter_idx, IDXGIAdapter1 **adapter) { - struct dxgi_factory *This = impl_from_IWineDXGIFactory(iface); + struct dxgi_factory *factory = impl_from_IWineDXGIFactory(iface); TRACE("iface %p, adapter_idx %u, adapter %p\n", iface, adapter_idx, adapter); - if (!adapter) return DXGI_ERROR_INVALID_CALL; + if (!adapter) + return DXGI_ERROR_INVALID_CALL; - if (adapter_idx >= This->adapter_count) + if (adapter_idx >= factory->adapter_count) { *adapter = NULL; return DXGI_ERROR_NOT_FOUND; } - *adapter = This->adapters[adapter_idx]; - IDXGIAdapter_AddRef(*adapter); + *adapter = (IDXGIAdapter1 *)factory->adapters[adapter_idx]; + IDXGIAdapter1_AddRef(*adapter); TRACE("Returning adapter %p\n", *adapter); return S_OK; } +static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *iface, + UINT adapter_idx, IDXGIAdapter **adapter) +{ + TRACE("iface %p, adapter_idx %u, adapter %p\n", iface, adapter_idx, adapter); + + return dxgi_factory_EnumAdapters1(iface, adapter_idx, (IDXGIAdapter1 **)adapter); +} + static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IWineDXGIFactory *iface, HWND window, UINT flags) { FIXME("iface %p, window %p, flags %#x stub!\n\n", iface, window, flags); @@ -258,6 +270,13 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IWineDXGIFac return E_NOTIMPL; } +static BOOL STDMETHODCALLTYPE dxgi_factory_IsCurrent(IWineDXGIFactory *iface) +{ + FIXME("iface %p stub!\n", iface); + + return TRUE; +} + /* IWineDXGIFactory methods */ static struct wined3d * STDMETHODCALLTYPE dxgi_factory_get_wined3d(IWineDXGIFactory *iface) @@ -289,11 +308,14 @@ static const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl = dxgi_factory_GetWindowAssociation, dxgi_factory_CreateSwapChain, dxgi_factory_CreateSoftwareAdapter, + /* IDXGIFactory1 methods */ + dxgi_factory_EnumAdapters1, + dxgi_factory_IsCurrent, /* IWineDXGIFactory methods */ dxgi_factory_get_wined3d, }; -HRESULT dxgi_factory_init(struct dxgi_factory *factory) +static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended) { HRESULT hr; UINT i; @@ -302,7 +324,7 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory) factory->refcount = 1; EnterCriticalSection(&dxgi_cs); - factory->wined3d = wined3d_create(10, 0); + factory->wined3d = wined3d_create(0); if (!factory->wined3d) { LeaveCriticalSection(&dxgi_cs); @@ -330,7 +352,7 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory) for (j = 0; j < i; ++j) { - IDXGIAdapter_Release(factory->adapters[j]); + IWineDXGIAdapter_Release(factory->adapters[j]); } hr = E_OUTOFMEMORY; goto fail; @@ -346,14 +368,16 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory) HeapFree(GetProcessHeap(), 0, adapter); for (j = 0; j < i; ++j) { - IDXGIAdapter_Release(factory->adapters[j]); + IWineDXGIAdapter_Release(factory->adapters[j]); } goto fail; } - factory->adapters[i] = (IDXGIAdapter *)adapter; + factory->adapters[i] = &adapter->IWineDXGIAdapter_iface; } + factory->extended = extended; + return S_OK; fail: @@ -363,3 +387,26 @@ fail: LeaveCriticalSection(&dxgi_cs); return hr; } + +HRESULT dxgi_factory_create(REFIID riid, void **factory, BOOL extended) +{ + struct dxgi_factory *object; + HRESULT hr; + + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + return E_OUTOFMEMORY; + + if (FAILED(hr = dxgi_factory_init(object, extended))) + { + WARN("Failed to initialize factory, hr %#x.\n", hr); + HeapFree(GetProcessHeap(), 0, object); + return hr; + } + + TRACE("Created factory %p.\n", object); + + hr = IWineDXGIFactory_QueryInterface(&object->IWineDXGIFactory_iface, riid, factory); + IWineDXGIFactory_Release(&object->IWineDXGIFactory_iface); + + return hr; +} diff --git a/reactos/dll/directx/wine/dxgi/guid.c b/reactos/dll/directx/wine/dxgi/guid.c index c971ac461a6..69259442ed1 100644 --- a/reactos/dll/directx/wine/dxgi/guid.c +++ b/reactos/dll/directx/wine/dxgi/guid.c @@ -5,6 +5,7 @@ #define WIN32_NO_STATUS #define _INC_WINDOWS #define COM_NO_WINDOWS_H +#define COBJMACROS #include #include diff --git a/reactos/dll/directx/wine/dxgi/output.c b/reactos/dll/directx/wine/dxgi/output.c index 1a9f9e4fc19..1b8c64781eb 100644 --- a/reactos/dll/directx/wine/dxgi/output.c +++ b/reactos/dll/directx/wine/dxgi/output.c @@ -127,9 +127,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa iface, debug_dxgi_format(format), flags, mode_count, desc); if (!mode_count) - { - return S_OK; - } + return DXGI_ERROR_INVALID_CALL; if (format == DXGI_FORMAT_UNKNOWN) { @@ -152,7 +150,14 @@ static HRESULT STDMETHODCALLTYPE dxgi_output_GetDisplayModeList(IDXGIOutput *ifa return S_OK; } - *mode_count = min(*mode_count,max_count); + if (max_count > *mode_count) + { + wined3d_decref(wined3d); + LeaveCriticalSection(&dxgi_cs); + return DXGI_ERROR_MORE_DATA; + } + + *mode_count = max_count; for (i = 0; i < *mode_count; ++i) { diff --git a/reactos/dll/directx/wine/dxgi/surface.c b/reactos/dll/directx/wine/dxgi/surface.c index bd12cc6ccce..5aae215c064 100644 --- a/reactos/dll/directx/wine/dxgi/surface.c +++ b/reactos/dll/directx/wine/dxgi/surface.c @@ -66,10 +66,7 @@ static ULONG STDMETHODCALLTYPE dxgi_surface_inner_Release(IUnknown *iface) TRACE("%p decreasing refcount to %u.\n", surface, refcount); if (!refcount) - { - IDXGIDevice_Release(surface->device); HeapFree(GetProcessHeap(), 0, surface); - } return refcount; } @@ -205,7 +202,6 @@ HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, IUn surface->refcount = 1; surface->outer_unknown = outer ? outer : &surface->IUnknown_iface; surface->device = device; - IDXGIDevice_AddRef(device); return S_OK; } diff --git a/reactos/dll/directx/wine/qedit/CMakeLists.txt b/reactos/dll/directx/wine/qedit/CMakeLists.txt index 00f965b7dbf..5d844ac1ee3 100644 --- a/reactos/dll/directx/wine/qedit/CMakeLists.txt +++ b/reactos/dll/directx/wine/qedit/CMakeLists.txt @@ -15,7 +15,7 @@ add_library(qedit SHARED ${CMAKE_CURRENT_BINARY_DIR}/qedit.def) set_module_type(qedit win32dll) -target_link_libraries(qedit strmiids uuid wine) +target_link_libraries(qedit strmbase strmiids uuid wine) add_importlibs(qedit ole32 oleaut32 msvcrt kernel32 ntdll) add_pch(qedit qedit_private.h SOURCE) add_cd_file(TARGET qedit DESTINATION reactos/system32 FOR all) diff --git a/reactos/dll/directx/wine/qedit/qedit_classes.idl b/reactos/dll/directx/wine/qedit/qedit_classes.idl index 3106f4c7426..138e1a6396c 100644 --- a/reactos/dll/directx/wine/qedit/qedit_classes.idl +++ b/reactos/dll/directx/wine/qedit/qedit_classes.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ threading(both), uuid(65bd0711-24d2-4ff7-9324-ed2e5d3abafa) diff --git a/reactos/dll/directx/wine/qedit/samplegrabber.c b/reactos/dll/directx/wine/qedit/samplegrabber.c index edae0ae27da..3af5c3c2cef 100644 --- a/reactos/dll/directx/wine/qedit/samplegrabber.c +++ b/reactos/dll/directx/wine/qedit/samplegrabber.c @@ -19,165 +19,14 @@ #include "qedit_private.h" +#include + static const WCHAR vendor_name[] = { 'W', 'i', 'n', 'e', 0 }; static const WCHAR pin_in_name[] = { 'I', 'n', 0 }; static const WCHAR pin_out_name[] = { 'O', 'u', 't', 0 }; -static IEnumPins *pinsenum_create(IBaseFilter *filter, IPin **pins, ULONG pinCount); static IEnumMediaTypes *mediaenum_create(const AM_MEDIA_TYPE *mtype); -/* Fixed pins enumerator, holds filter referenced */ -typedef struct _PE_Impl { - IEnumPins pe; - IBaseFilter *filter; - LONG refCount; - ULONG numPins; - ULONG index; - IPin *pins[0]; -} PE_Impl; - - -/* IEnumPins interface implementation */ - -/* IUnknown */ -static ULONG WINAPI -Fixed_IEnumPins_AddRef(IEnumPins *iface) -{ - PE_Impl *This = (PE_Impl *)iface; - ULONG refCount = InterlockedIncrement(&This->refCount); - TRACE("(%p) new ref = %u\n", This, refCount); - return refCount; -} - -/* IUnknown */ -static ULONG WINAPI -Fixed_IEnumPins_Release(IEnumPins *iface) -{ - PE_Impl *This = (PE_Impl *)iface; - ULONG refCount = InterlockedDecrement(&This->refCount); - TRACE("(%p) new ref = %u\n", This, refCount); - if (refCount == 0) - { - IBaseFilter_Release(This->filter); - CoTaskMemFree(This); - return 0; - } - return refCount; -} - -/* IUnknown */ -static HRESULT WINAPI -Fixed_IEnumPins_QueryInterface(IEnumPins *iface, REFIID riid, void **ppvObject) -{ - PE_Impl *This = (PE_Impl *)iface; - TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject); - - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IEnumPins)) { - Fixed_IEnumPins_AddRef(iface); - *ppvObject = This->pins; - return S_OK; - } - *ppvObject = NULL; - WARN("(%p, %s,%p): not found\n", This, debugstr_guid(riid), ppvObject); - return E_NOINTERFACE; -} - -/* IEnumPins */ -static HRESULT WINAPI -Fixed_IEnumPins_Next(IEnumPins *iface, ULONG nPins, IPin **pins, ULONG *fetched) -{ - PE_Impl *This = (PE_Impl *)iface; - ULONG count = 0; - TRACE("(%p)->(%u, %p, %p) index = %u\n", This, nPins, pins, fetched, This->index); - if (!nPins) - return E_INVALIDARG; - if (!pins || ((nPins != 1) && !fetched)) - return E_POINTER; - while ((count < nPins) && (This->index < This->numPins)) { - IPin *pin = This->pins[This->index++]; - IPin_AddRef(pin); - pins[count++] = pin; - } - if (fetched) - *fetched = count; - return (count == nPins) ? S_OK : S_FALSE; -} - -/* IEnumPins */ -static HRESULT WINAPI -Fixed_IEnumPins_Skip(IEnumPins *iface, ULONG nPins) -{ - PE_Impl *This = (PE_Impl *)iface; - TRACE("(%p)->(%u) index = %u\n", This, nPins, This->index); - nPins += This->index; - if (nPins >= This->numPins) { - This->index = This->numPins; - return S_FALSE; - } - This->index = nPins; - return S_OK; -} - -/* IEnumPins */ -static HRESULT WINAPI -Fixed_IEnumPins_Reset(IEnumPins *iface) -{ - PE_Impl *This = (PE_Impl *)iface; - TRACE("(%p)->() index = %u\n", This, This->index); - This->index = 0; - return S_OK; -} - -/* IEnumPins */ -static HRESULT WINAPI -Fixed_IEnumPins_Clone(IEnumPins *iface, IEnumPins **pins) -{ - PE_Impl *This = (PE_Impl *)iface; - TRACE("(%p)->(%p) index = %u\n", This, pins, This->index); - if (!pins) - return E_POINTER; - *pins = pinsenum_create(This->filter, This->pins, This->numPins); - if (!*pins) - return E_OUTOFMEMORY; - ((PE_Impl *)*pins)->index = This->index; - return S_OK; -} - - -/* Virtual tables and constructor */ - -static const IEnumPinsVtbl IEnumPins_VTable = -{ - Fixed_IEnumPins_QueryInterface, - Fixed_IEnumPins_AddRef, - Fixed_IEnumPins_Release, - Fixed_IEnumPins_Next, - Fixed_IEnumPins_Skip, - Fixed_IEnumPins_Reset, - Fixed_IEnumPins_Clone, -}; - -static IEnumPins *pinsenum_create(IBaseFilter *filter, IPin **pins, ULONG pinCount) -{ - ULONG len = sizeof(PE_Impl) + (pinCount * sizeof(IPin *)); - PE_Impl *obj = CoTaskMemAlloc(len); - if (obj) { - ULONG i; - ZeroMemory(obj, len); - obj->pe.lpVtbl = &IEnumPins_VTable; - obj->refCount = 1; - obj->filter = filter; - obj->numPins = pinCount; - obj->index = 0; - for (i=0; ipins[i] = pins[i]; - IBaseFilter_AddRef(filter); - } - return &obj->pe; -} - - /* Single media type enumerator */ typedef struct _ME_Impl { IEnumMediaTypes me; @@ -353,22 +202,16 @@ static inline SG_Pin *impl_from_IPin(IPin *iface) /* Sample Grabber filter implementation */ typedef struct _SG_Impl { IUnknown IUnknown_inner; - IBaseFilter IBaseFilter_iface; + BaseFilter filter; ISampleGrabber ISampleGrabber_iface; - IMemInputPin IMemInputPin_iface; /* IMediaSeeking and IMediaPosition are implemented by ISeekingPassThru */ IUnknown* seekthru_unk; - /* TODO: IQualityControl */ IUnknown *outer_unk; - LONG ref; - CRITICAL_SECTION critSect; - FILTER_INFO info; - FILTER_STATE state; AM_MEDIA_TYPE mtype; SG_Pin pin_in; SG_Pin pin_out; + IMemInputPin IMemInputPin_iface; IMemAllocator *allocator; - IReferenceClock *refClock; IMemInputPin *memOutput; ISampleGrabberCB *grabberIface; LONG grabberMethod; @@ -388,9 +231,14 @@ static inline SG_Impl *impl_from_IUnknown(IUnknown *iface) return CONTAINING_RECORD(iface, SG_Impl, IUnknown_inner); } +static inline SG_Impl *impl_from_BaseFilter(BaseFilter *iface) +{ + return CONTAINING_RECORD(iface, SG_Impl, filter); +} + static inline SG_Impl *impl_from_IBaseFilter(IBaseFilter *iface) { - return CONTAINING_RECORD(iface, SG_Impl, IBaseFilter_iface); + return CONTAINING_RECORD(iface, SG_Impl, filter.IBaseFilter_iface); } static inline SG_Impl *impl_from_ISampleGrabber(ISampleGrabber *iface) @@ -408,12 +256,10 @@ static inline SG_Impl *impl_from_IMemInputPin(IMemInputPin *iface) static void SampleGrabber_cleanup(SG_Impl *This) { TRACE("(%p)\n", This); - if (This->info.pGraph) - WARN("(%p) still joined to filter graph %p\n", This, This->info.pGraph); + if (This->filter.filterInfo.pGraph) + WARN("(%p) still joined to filter graph %p\n", This, This->filter.filterInfo.pGraph); if (This->allocator) IMemAllocator_Release(This->allocator); - if (This->refClock) - IReferenceClock_Release(This->refClock); if (This->memOutput) IMemInputPin_Release(This->memOutput); if (This->grabberIface) @@ -424,8 +270,6 @@ static void SampleGrabber_cleanup(SG_Impl *This) CoTaskMemFree(This->bufferData); if(This->seekthru_unk) IUnknown_Release(This->seekthru_unk); - This->critSect.DebugInfo->Spare[0] = 0; - DeleteCriticalSection(&This->critSect); } /* SampleGrabber inner IUnknown */ @@ -440,17 +284,13 @@ static HRESULT WINAPI SampleGrabber_QueryInterface(IUnknown *iface, REFIID riid, *ppv = &This->IUnknown_inner; else if (IsEqualIID(riid, &IID_IPersist) || IsEqualIID(riid, &IID_IMediaFilter) || IsEqualIID(riid, &IID_IBaseFilter)) - *ppv = &This->IBaseFilter_iface; + *ppv = &This->filter.IBaseFilter_iface; else if (IsEqualIID(riid, &IID_ISampleGrabber)) *ppv = &This->ISampleGrabber_iface; - else if (IsEqualIID(riid, &IID_IMemInputPin)) - *ppv = &This->IMemInputPin_iface; else if (IsEqualIID(riid, &IID_IMediaPosition)) return IUnknown_QueryInterface(This->seekthru_unk, riid, ppv); else if (IsEqualIID(riid, &IID_IMediaSeeking)) return IUnknown_QueryInterface(This->seekthru_unk, riid, ppv); - else if (IsEqualIID(riid, &IID_IQualityControl)) - FIXME("IQualityControl not implemented\n"); else WARN("(%p, %s,%p): not found\n", This, debugstr_guid(riid), ppv); @@ -464,9 +304,9 @@ static HRESULT WINAPI SampleGrabber_QueryInterface(IUnknown *iface, REFIID riid, static ULONG WINAPI SampleGrabber_AddRef(IUnknown *iface) { SG_Impl *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedIncrement(&This->ref); + ULONG ref = BaseFilterImpl_AddRef(&This->filter.IBaseFilter_iface); - TRACE("(%p) new ref = %u\n", This, ref); + TRACE("(%p) ref=%d\n", This, ref); return ref; } @@ -474,9 +314,9 @@ static ULONG WINAPI SampleGrabber_AddRef(IUnknown *iface) static ULONG WINAPI SampleGrabber_Release(IUnknown *iface) { SG_Impl *This = impl_from_IUnknown(iface); - ULONG ref = InterlockedDecrement(&This->ref); + ULONG ref = BaseFilterImpl_Release(&This->filter.IBaseFilter_iface); - TRACE("(%p) new ref = %u\n", This, ref); + TRACE("(%p) ref=%d\n", This, ref); if (ref == 0) { @@ -494,6 +334,32 @@ static const IUnknownVtbl samplegrabber_vtbl = SampleGrabber_Release, }; +static IPin *WINAPI SampleGrabber_GetPin(BaseFilter *iface, int pos) +{ + SG_Impl *This = impl_from_BaseFilter(iface); + IPin *pin; + + if (pos == 0) + pin = &This->pin_in.IPin_iface; + else if (pos == 1) + pin = &This->pin_out.IPin_iface; + else + return NULL; + + IPin_AddRef(pin); + return pin; +} + +static LONG WINAPI SampleGrabber_GetPinCount(BaseFilter *iface) +{ + return 2; +} + +static const BaseFilterFuncTable basefunc_vtbl = { + SampleGrabber_GetPin, + SampleGrabber_GetPinCount +}; + /* Helper that buffers data and/or calls installed sample callbacks */ static void SampleGrabber_callback(SG_Impl *This, IMediaSample *sample) { @@ -505,7 +371,7 @@ static void SampleGrabber_callback(SG_Impl *This, IMediaSample *sample) if (size >= 0 && SUCCEEDED(IMediaSample_GetPointer(sample, &data))) { if (!data) size = 0; - EnterCriticalSection(&This->critSect); + EnterCriticalSection(&This->filter.csFilter); if (This->bufferLen != size) { if (This->bufferData) CoTaskMemFree(This->bufferData); @@ -514,7 +380,7 @@ static void SampleGrabber_callback(SG_Impl *This, IMediaSample *sample) } if (size) CopyMemory(This->bufferData, data, size); - LeaveCriticalSection(&This->critSect); + LeaveCriticalSection(&This->filter.csFilter); } } if (!This->grabberIface) @@ -580,24 +446,13 @@ SampleGrabber_IBaseFilter_Release(IBaseFilter *iface) return IUnknown_Release(This->outer_unk); } -/* IPersist */ -static HRESULT WINAPI -SampleGrabber_IBaseFilter_GetClassID(IBaseFilter *iface, CLSID *pClassID) -{ - TRACE("(%p)\n", pClassID); - if (!pClassID) - return E_POINTER; - *pClassID = CLSID_SampleGrabber; - return S_OK; -} - /* IMediaFilter */ static HRESULT WINAPI SampleGrabber_IBaseFilter_Stop(IBaseFilter *iface) { SG_Impl *This = impl_from_IBaseFilter(iface); TRACE("(%p)\n", This); - This->state = State_Stopped; + This->filter.state = State_Stopped; return S_OK; } @@ -607,7 +462,7 @@ SampleGrabber_IBaseFilter_Pause(IBaseFilter *iface) { SG_Impl *This = impl_from_IBaseFilter(iface); TRACE("(%p)\n", This); - This->state = State_Paused; + This->filter.state = State_Paused; return S_OK; } @@ -617,68 +472,10 @@ SampleGrabber_IBaseFilter_Run(IBaseFilter *iface, REFERENCE_TIME tStart) { SG_Impl *This = impl_from_IBaseFilter(iface); TRACE("(%p)\n", This); - This->state = State_Running; + This->filter.state = State_Running; return S_OK; } -/* IMediaFilter */ -static HRESULT WINAPI -SampleGrabber_IBaseFilter_GetState(IBaseFilter *iface, DWORD msTout, FILTER_STATE *state) -{ - SG_Impl *This = impl_from_IBaseFilter(iface); - TRACE("(%p)->(%u, %p)\n", This, msTout, state); - if (!state) - return E_POINTER; - *state = This->state; - return S_OK; -} - -/* IMediaFilter */ -static HRESULT WINAPI -SampleGrabber_IBaseFilter_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock) -{ - SG_Impl *This = impl_from_IBaseFilter(iface); - TRACE("(%p)->(%p)\n", This, clock); - if (clock != This->refClock) - { - if (clock) - IReferenceClock_AddRef(clock); - if (This->refClock) - IReferenceClock_Release(This->refClock); - This->refClock = clock; - } - return S_OK; -} - -/* IMediaFilter */ -static HRESULT WINAPI -SampleGrabber_IBaseFilter_GetSyncSource(IBaseFilter *iface, IReferenceClock **clock) -{ - SG_Impl *This = impl_from_IBaseFilter(iface); - TRACE("(%p)->(%p)\n", This, clock); - if (!clock) - return E_POINTER; - if (This->refClock) - IReferenceClock_AddRef(This->refClock); - *clock = This->refClock; - return S_OK; -} - -/* IBaseFilter */ -static HRESULT WINAPI -SampleGrabber_IBaseFilter_EnumPins(IBaseFilter *iface, IEnumPins **pins) -{ - SG_Impl *This = impl_from_IBaseFilter(iface); - IPin *pin[2]; - TRACE("(%p)->(%p)\n", This, pins); - if (!pins) - return E_POINTER; - pin[0] = &This->pin_in.IPin_iface; - pin[1] = &This->pin_out.IPin_iface; - *pins = pinsenum_create(iface, pin, 2); - return *pins ? S_OK : E_OUTOFMEMORY; -} - /* IBaseFilter */ static HRESULT WINAPI SampleGrabber_IBaseFilter_FindPin(IBaseFilter *iface, LPCWSTR id, IPin **pin) @@ -703,30 +500,17 @@ SampleGrabber_IBaseFilter_FindPin(IBaseFilter *iface, LPCWSTR id, IPin **pin) return VFW_E_NOT_FOUND; } -/* IBaseFilter */ -static HRESULT WINAPI -SampleGrabber_IBaseFilter_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *info) -{ - SG_Impl *This = impl_from_IBaseFilter(iface); - TRACE("(%p)->(%p)\n", This, info); - if (!info) - return E_POINTER; - if (This->info.pGraph) - IFilterGraph_AddRef(This->info.pGraph); - *info = This->info; - return S_OK; -} - /* IBaseFilter */ static HRESULT WINAPI SampleGrabber_IBaseFilter_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *graph, LPCWSTR name) { SG_Impl *This = impl_from_IBaseFilter(iface); + TRACE("(%p)->(%p, %s)\n", This, graph, debugstr_w(name)); - This->info.pGraph = graph; - if (name) - lstrcpynW(This->info.achName,name,MAX_FILTER_NAME); + + BaseFilterImpl_JoinFilterGraph(iface, graph, name); This->oneShot = OneShot_None; + return S_OK; } @@ -828,14 +612,14 @@ SampleGrabber_ISampleGrabber_SetBufferSamples(ISampleGrabber *iface, BOOL buffer { SG_Impl *This = impl_from_ISampleGrabber(iface); TRACE("(%p)->(%u)\n", This, bufferEm); - EnterCriticalSection(&This->critSect); + EnterCriticalSection(&This->filter.csFilter); if (bufferEm) { if (This->bufferLen < 0) This->bufferLen = 0; } else This->bufferLen = -1; - LeaveCriticalSection(&This->critSect); + LeaveCriticalSection(&This->filter.csFilter); return S_OK; } @@ -848,7 +632,7 @@ SampleGrabber_ISampleGrabber_GetCurrentBuffer(ISampleGrabber *iface, LONG *bufSi TRACE("(%p)->(%p, %p)\n", This, bufSize, buffer); if (!bufSize) return E_POINTER; - EnterCriticalSection(&This->critSect); + EnterCriticalSection(&This->filter.csFilter); if (!This->pin_in.pair) ret = VFW_E_NOT_CONNECTED; else if (This->bufferLen < 0) @@ -864,7 +648,7 @@ SampleGrabber_ISampleGrabber_GetCurrentBuffer(ISampleGrabber *iface, LONG *bufSi } *bufSize = This->bufferLen; } - LeaveCriticalSection(&This->critSect); + LeaveCriticalSection(&This->filter.csFilter); return ret; } @@ -970,7 +754,7 @@ SampleGrabber_IMemInputPin_Receive(IMemInputPin *iface, IMediaSample *sample) TRACE("(%p)->(%p) output = %p, grabber = %p\n", This, sample, This->memOutput, This->grabberIface); if (!sample) return E_POINTER; - if ((This->state != State_Running) || (This->oneShot == OneShot_Past)) + if ((This->filter.state != State_Running) || (This->oneShot == OneShot_Past)) return S_FALSE; SampleGrabber_callback(This, sample); hr = This->memOutput ? IMemInputPin_Receive(This->memOutput, sample) : S_OK; @@ -992,7 +776,7 @@ SampleGrabber_IMemInputPin_ReceiveMultiple(IMemInputPin *iface, IMediaSample **s TRACE("(%p)->(%p, %u, %p) output = %p, grabber = %p\n", This, samples, nSamples, nProcessed, This->memOutput, This->grabberIface); if (!samples || !nProcessed) return E_POINTER; - if ((This->state != State_Running) || (This->oneShot == OneShot_Past)) + if ((This->filter.state != State_Running) || (This->oneShot == OneShot_Past)) return S_FALSE; for (idx = 0; idx < nSamples; idx++) SampleGrabber_callback(This, samples[idx]); @@ -1072,7 +856,7 @@ SampleGrabber_Out_IPin_Connect(IPin *iface, IPin *receiver, const AM_MEDIA_TYPE return E_POINTER; if (This->pair) return VFW_E_ALREADY_CONNECTED; - if (This->sg->state != State_Stopped) + if (This->sg->filter.state != State_Stopped) return VFW_E_NOT_STOPPED; if (type) { TRACE("Media type: %s/%s ssize: %u format: %s (%u bytes)\n", @@ -1120,7 +904,7 @@ SampleGrabber_In_IPin_ReceiveConnection(IPin *iface, IPin *connector, const AM_M return E_POINTER; if (This->pair) return VFW_E_ALREADY_CONNECTED; - if (This->sg->state != State_Stopped) + if (This->sg->filter.state != State_Stopped) return VFW_E_NOT_STOPPED; if (type) { TRACE("Media type: %s/%s ssize: %u format: %s (%u bytes)\n", @@ -1172,7 +956,7 @@ SampleGrabber_In_IPin_Disconnect(IPin *iface) SG_Pin *This = impl_from_IPin(iface); TRACE("(%p)->() pair = %p\n", This, This->pair); - if (This->sg->state != State_Stopped) + if (This->sg->filter.state != State_Stopped) return VFW_E_NOT_STOPPED; if (This->pair) { This->pair = NULL; @@ -1188,7 +972,7 @@ SampleGrabber_Out_IPin_Disconnect(IPin *iface) SG_Pin *This = impl_from_IPin(iface); TRACE("(%p)->() pair = %p\n", This, This->pair); - if (This->sg->state != State_Stopped) + if (This->sg->filter.state != State_Stopped) return VFW_E_NOT_STOPPED; if (This->pair) { This->pair = NULL; @@ -1246,8 +1030,8 @@ SampleGrabber_IPin_QueryPinInfo(IPin *iface, PIN_INFO *info) TRACE("(%p)->(%p)\n", This, info); if (!info) return E_POINTER; - IBaseFilter_AddRef(&This->sg->IBaseFilter_iface); - info->pFilter = &This->sg->IBaseFilter_iface; + info->pFilter = &This->sg->filter.IBaseFilter_iface; + IBaseFilter_AddRef(info->pFilter); info->dir = This->dir; lstrcpynW(info->achName,This->name,MAX_PIN_NAME); return S_OK; @@ -1374,16 +1158,16 @@ static const IBaseFilterVtbl IBaseFilter_VTable = SampleGrabber_IBaseFilter_QueryInterface, SampleGrabber_IBaseFilter_AddRef, SampleGrabber_IBaseFilter_Release, - SampleGrabber_IBaseFilter_GetClassID, + BaseFilterImpl_GetClassID, SampleGrabber_IBaseFilter_Stop, SampleGrabber_IBaseFilter_Pause, SampleGrabber_IBaseFilter_Run, - SampleGrabber_IBaseFilter_GetState, - SampleGrabber_IBaseFilter_SetSyncSource, - SampleGrabber_IBaseFilter_GetSyncSource, - SampleGrabber_IBaseFilter_EnumPins, + BaseFilterImpl_GetState, + BaseFilterImpl_SetSyncSource, + BaseFilterImpl_GetSyncSource, + BaseFilterImpl_EnumPins, SampleGrabber_IBaseFilter_FindPin, - SampleGrabber_IBaseFilter_QueryFilterInfo, + BaseFilterImpl_QueryFilterInfo, SampleGrabber_IBaseFilter_JoinFilterGraph, SampleGrabber_IBaseFilter_QueryVendorInfo, }; @@ -1474,9 +1258,9 @@ HRESULT SampleGrabber_create(IUnknown *pUnkOuter, LPVOID *ppv) } ZeroMemory(obj, sizeof(SG_Impl)); - obj->ref = 1; + BaseFilter_Init(&obj->filter, &IBaseFilter_VTable, &CLSID_SampleGrabber, + (DWORD_PTR)(__FILE__ ": SG_Impl.csFilter"), &basefunc_vtbl); obj->IUnknown_inner.lpVtbl = &samplegrabber_vtbl; - obj->IBaseFilter_iface.lpVtbl = &IBaseFilter_VTable; obj->ISampleGrabber_iface.lpVtbl = &ISampleGrabber_VTable; obj->IMemInputPin_iface.lpVtbl = &IMemInputPin_VTable; obj->pin_in.IPin_iface.lpVtbl = &IPin_In_VTable; @@ -1489,16 +1273,10 @@ HRESULT SampleGrabber_create(IUnknown *pUnkOuter, LPVOID *ppv) obj->pin_out.name = pin_out_name; obj->pin_out.sg = obj; obj->pin_out.pair = NULL; - InitializeCriticalSection(&obj->critSect); - obj->critSect.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SG_Impl.critSect"); - obj->info.achName[0] = 0; - obj->info.pGraph = NULL; - obj->state = State_Stopped; obj->mtype.majortype = GUID_NULL; obj->mtype.subtype = MEDIASUBTYPE_None; obj->mtype.formattype = FORMAT_None; obj->allocator = NULL; - obj->refClock = NULL; obj->memOutput = NULL; obj->grabberIface = NULL; obj->grabberMethod = -1; diff --git a/reactos/dll/directx/wine/wined3d/arb_program_shader.c b/reactos/dll/directx/wine/wined3d/arb_program_shader.c index 2d30dd2d5f5..3519c783b1c 100644 --- a/reactos/dll/directx/wine/wined3d/arb_program_shader.c +++ b/reactos/dll/directx/wine/wined3d/arb_program_shader.c @@ -9,7 +9,7 @@ * Copyright 2006 Ivan Gyurdiev * Copyright 2006 Jason Green * Copyright 2006 Henri Verbeet - * Copyright 2007-2011, 2013 Stefan Dösinger for CodeWeavers + * Copyright 2007-2011, 2013-2014 Stefan Dösinger for CodeWeavers * Copyright 2009 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or @@ -1786,6 +1786,11 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins) static void shader_hw_nop(const struct wined3d_shader_instruction *ins) {} +static DWORD shader_arb_select_component(DWORD swizzle, DWORD component) +{ + return ((swizzle >> 2 * component) & 0x3) * 0x55; +} + static void shader_hw_mov(const struct wined3d_shader_instruction *ins) { const struct wined3d_shader *shader = ins->ctx->shader; @@ -1856,7 +1861,7 @@ static void shader_hw_mov(const struct wined3d_shader_instruction *ins) * with more than one component. Thus replicate the first source argument over all * 4 components. For example, .xyzw -> .x (or better: .xxxx), .zwxy -> .z, etc) */ struct wined3d_shader_src_param tmp_src = ins->src[0]; - tmp_src.swizzle = (tmp_src.swizzle & 0x3) * 0x55; + tmp_src.swizzle = shader_arb_select_component(tmp_src.swizzle, 0); shader_arb_get_src_param(ins, &tmp_src, 0, src0_param); shader_addline(buffer, "ARL A0.x, %s;\n", src0_param); } @@ -2466,30 +2471,36 @@ static void shader_hw_mnxn(const struct wined3d_shader_instruction *ins) } } -static void shader_hw_rcp(const struct wined3d_shader_instruction *ins) +static DWORD abs_modifier(DWORD mod, BOOL *need_abs) { - struct wined3d_shader_buffer *buffer = ins->ctx->buffer; + *need_abs = FALSE; - char dst[50]; - char src[50]; - - shader_arb_get_dst_param(ins, &ins->dst[0], dst); /* Destination */ - shader_arb_get_src_param(ins, &ins->src[0], 0, src); - if (ins->src[0].swizzle == WINED3DSP_NOSWIZZLE) + switch(mod) { - /* Dx sdk says .x is used if no swizzle is given, but our test shows that - * .w is used - */ - strcat(src, ".w"); + case WINED3DSPSM_NONE: return WINED3DSPSM_ABS; + case WINED3DSPSM_NEG: return WINED3DSPSM_ABS; + case WINED3DSPSM_BIAS: *need_abs = TRUE; return WINED3DSPSM_BIAS; + case WINED3DSPSM_BIASNEG: *need_abs = TRUE; return WINED3DSPSM_BIASNEG; + case WINED3DSPSM_SIGN: *need_abs = TRUE; return WINED3DSPSM_SIGN; + case WINED3DSPSM_SIGNNEG: *need_abs = TRUE; return WINED3DSPSM_SIGNNEG; + case WINED3DSPSM_COMP: *need_abs = TRUE; return WINED3DSPSM_COMP; + case WINED3DSPSM_X2: *need_abs = TRUE; return WINED3DSPSM_X2; + case WINED3DSPSM_X2NEG: *need_abs = TRUE; return WINED3DSPSM_X2NEG; + case WINED3DSPSM_DZ: *need_abs = TRUE; return WINED3DSPSM_DZ; + case WINED3DSPSM_DW: *need_abs = TRUE; return WINED3DSPSM_DW; + case WINED3DSPSM_ABS: return WINED3DSPSM_ABS; + case WINED3DSPSM_ABSNEG: return WINED3DSPSM_ABS; } - - shader_addline(buffer, "RCP%s %s, %s;\n", shader_arb_get_modifier(ins), dst, src); + FIXME("Unknown modifier %u\n", mod); + return mod; } static void shader_hw_scalar_op(const struct wined3d_shader_instruction *ins) { struct wined3d_shader_buffer *buffer = ins->ctx->buffer; const char *instruction; + struct wined3d_shader_src_param src0_copy = ins->src[0]; + BOOL need_abs = FALSE; char dst[50]; char src[50]; @@ -2498,24 +2509,46 @@ static void shader_hw_scalar_op(const struct wined3d_shader_instruction *ins) { case WINED3DSIH_RSQ: instruction = "RSQ"; break; case WINED3DSIH_RCP: instruction = "RCP"; break; - case WINED3DSIH_EXP: instruction = "EX2"; break; - case WINED3DSIH_EXPP: instruction = "EXP"; break; + case WINED3DSIH_EXPP: + if (ins->ctx->reg_maps->shader_version.major < 2) + { + instruction = "EXP"; + break; + } + /* Drop through. */ + case WINED3DSIH_EXP: + instruction = "EX2"; + break; + case WINED3DSIH_LOG: + case WINED3DSIH_LOGP: + /* The precision requirements suggest that LOGP matches ARBvp's LOG + * instruction, but notice that the output of those instructions is + * different. */ + src0_copy.modifiers = abs_modifier(src0_copy.modifiers, &need_abs); + instruction = "LG2"; + break; default: instruction = ""; FIXME("Unhandled opcode %#x\n", ins->handler_idx); break; } + /* Dx sdk says .x is used if no swizzle is given, but our test shows that + * .w is used. */ + src0_copy.swizzle = shader_arb_select_component(src0_copy.swizzle, 3); + shader_arb_get_dst_param(ins, &ins->dst[0], dst); /* Destination */ - shader_arb_get_src_param(ins, &ins->src[0], 0, src); - if (ins->src[0].swizzle == WINED3DSP_NOSWIZZLE) + shader_arb_get_src_param(ins, &src0_copy, 0, src); + + if(need_abs) { - /* Dx sdk says .x is used if no swizzle is given, but our test shows that - * .w is used - */ - strcat(src, ".w"); + shader_addline(buffer, "ABS TA.w, %s;\n", src); + shader_addline(buffer, "%s%s %s, TA.w;\n", instruction, shader_arb_get_modifier(ins), dst); + } + else + { + shader_addline(buffer, "%s%s %s, %s;\n", instruction, shader_arb_get_modifier(ins), dst, src); } - shader_addline(buffer, "%s%s %s, %s;\n", instruction, shader_arb_get_modifier(ins), dst, src); } static void shader_hw_nrm(const struct wined3d_shader_instruction *ins) @@ -2755,64 +2788,6 @@ static void shader_hw_dsy(const struct wined3d_shader_instruction *ins) shader_addline(buffer, "MUL%s %s, %s, ycorrection.y;\n", shader_arb_get_modifier(ins), dst, dst_name); } -static DWORD abs_modifier(DWORD mod, BOOL *need_abs) -{ - *need_abs = FALSE; - - switch(mod) - { - case WINED3DSPSM_NONE: return WINED3DSPSM_ABS; - case WINED3DSPSM_NEG: return WINED3DSPSM_ABS; - case WINED3DSPSM_BIAS: *need_abs = TRUE; return WINED3DSPSM_BIAS; - case WINED3DSPSM_BIASNEG: *need_abs = TRUE; return WINED3DSPSM_BIASNEG; - case WINED3DSPSM_SIGN: *need_abs = TRUE; return WINED3DSPSM_SIGN; - case WINED3DSPSM_SIGNNEG: *need_abs = TRUE; return WINED3DSPSM_SIGNNEG; - case WINED3DSPSM_COMP: *need_abs = TRUE; return WINED3DSPSM_COMP; - case WINED3DSPSM_X2: *need_abs = TRUE; return WINED3DSPSM_X2; - case WINED3DSPSM_X2NEG: *need_abs = TRUE; return WINED3DSPSM_X2NEG; - case WINED3DSPSM_DZ: *need_abs = TRUE; return WINED3DSPSM_DZ; - case WINED3DSPSM_DW: *need_abs = TRUE; return WINED3DSPSM_DW; - case WINED3DSPSM_ABS: return WINED3DSPSM_ABS; - case WINED3DSPSM_ABSNEG: return WINED3DSPSM_ABS; - } - FIXME("Unknown modifier %u\n", mod); - return mod; -} - -static void shader_hw_log(const struct wined3d_shader_instruction *ins) -{ - struct wined3d_shader_buffer *buffer = ins->ctx->buffer; - char src0[50], dst[50]; - struct wined3d_shader_src_param src0_copy = ins->src[0]; - BOOL need_abs = FALSE; - const char *instr; - - switch(ins->handler_idx) - { - case WINED3DSIH_LOG: instr = "LG2"; break; - case WINED3DSIH_LOGP: instr = "LOG"; break; - default: - ERR("Unexpected instruction %d\n", ins->handler_idx); - return; - } - - /* LOG and LOGP operate on the absolute value of the input */ - src0_copy.modifiers = abs_modifier(src0_copy.modifiers, &need_abs); - - shader_arb_get_dst_param(ins, &ins->dst[0], dst); - shader_arb_get_src_param(ins, &src0_copy, 0, src0); - - if(need_abs) - { - shader_addline(buffer, "ABS TA, %s;\n", src0); - shader_addline(buffer, "%s%s %s, TA;\n", instr, shader_arb_get_modifier(ins), dst); - } - else - { - shader_addline(buffer, "%s%s %s, %s;\n", instr, shader_arb_get_modifier(ins), dst, src0); - } -} - static void shader_hw_pow(const struct wined3d_shader_instruction *ins) { struct wined3d_shader_buffer *buffer = ins->ctx->buffer; @@ -5046,8 +5021,12 @@ static BOOL shader_arb_allocate_context_data(struct wined3d_context *context) static void shader_arb_free_context_data(struct wined3d_context *context) { - struct shader_arb_priv *priv = context->swapchain->device->shader_priv; + struct shader_arb_priv *priv; + if (!context->swapchain) + return; + + priv = context->swapchain->device->shader_priv; if (priv->last_context == context) priv->last_context = NULL; } @@ -5233,8 +5212,8 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_LABEL */ shader_hw_label, /* WINED3DSIH_LD */ NULL, /* WINED3DSIH_LIT */ shader_hw_map2gl, - /* WINED3DSIH_LOG */ shader_hw_log, - /* WINED3DSIH_LOGP */ shader_hw_log, + /* WINED3DSIH_LOG */ shader_hw_scalar_op, + /* WINED3DSIH_LOGP */ shader_hw_scalar_op, /* WINED3DSIH_LOOP */ shader_hw_loop, /* WINED3DSIH_LRP */ shader_hw_lrp, /* WINED3DSIH_LT */ NULL, @@ -5254,7 +5233,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_NRM */ shader_hw_nrm, /* WINED3DSIH_PHASE */ shader_hw_nop, /* WINED3DSIH_POW */ shader_hw_pow, - /* WINED3DSIH_RCP */ shader_hw_rcp, + /* WINED3DSIH_RCP */ shader_hw_scalar_op, /* WINED3DSIH_REP */ shader_hw_rep, /* WINED3DSIH_RET */ shader_hw_ret, /* WINED3DSIH_ROUND_NI */ NULL, @@ -6762,21 +6741,72 @@ const struct fragment_pipeline arbfp_fragment_pipeline = { arbfp_fragmentstate_template, }; -struct arbfp_blit_priv { - GLenum yuy2_rect_shader, yuy2_2d_shader; - GLenum uyvy_rect_shader, uyvy_2d_shader; - GLenum yv12_rect_shader, yv12_2d_shader; - GLenum p8_rect_shader, p8_2d_shader; +struct arbfp_blit_type +{ + enum complex_fixup fixup; + GLenum textype; +}; + +struct arbfp_blit_desc +{ + GLenum shader; + struct arbfp_blit_type type; + struct wine_rb_entry entry; +}; + +struct arbfp_blit_priv +{ + struct wine_rb_tree shaders; GLuint palette_texture; }; +static int arbfp_blit_type_compare(const void *key, const struct wine_rb_entry *entry) +{ + const struct arbfp_blit_type *ka = key; + const struct arbfp_blit_type *kb = &WINE_RB_ENTRY_VALUE(entry, const struct arbfp_blit_desc, entry)->type; + + if (ka->fixup != kb->fixup) + return ka->fixup < kb->fixup ? -1 : 1; + if (ka->textype != kb->textype) + return ka->textype < kb->textype ? -1 : 1; + return 0; +} + +/* Context activation is done by the caller. */ +static void arbfp_free_blit_shader(struct wine_rb_entry *entry, void *context) +{ + const struct wined3d_gl_info *gl_info = context; + struct arbfp_blit_desc *entry_arb = WINE_RB_ENTRY_VALUE(entry, struct arbfp_blit_desc, entry); + + GL_EXTCALL(glDeleteProgramsARB(1, &entry_arb->shader)); + checkGLcall("glDeleteProgramsARB(1, &entry_arb->shader)"); + HeapFree(GetProcessHeap(), 0, entry_arb); +} + +const struct wine_rb_functions wined3d_arbfp_blit_rb_functions = +{ + wined3d_rb_alloc, + wined3d_rb_realloc, + wined3d_rb_free, + arbfp_blit_type_compare, +}; + static HRESULT arbfp_blit_alloc(struct wined3d_device *device) { - device->blit_priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct arbfp_blit_priv)); - if(!device->blit_priv) { - ERR("Out of memory\n"); + struct arbfp_blit_priv *priv; + + if (!(priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*priv)))) + return E_OUTOFMEMORY; + + if (wine_rb_init(&priv->shaders, &wined3d_arbfp_blit_rb_functions) == -1) + { + ERR("Failed to initialize rbtree.\n"); + HeapFree(GetProcessHeap(), 0, priv); return E_OUTOFMEMORY; } + + device->blit_priv = priv; + return WINED3D_OK; } @@ -6786,15 +6816,8 @@ static void arbfp_blit_free(struct wined3d_device *device) const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; struct arbfp_blit_priv *priv = device->blit_priv; - GL_EXTCALL(glDeleteProgramsARB(1, &priv->yuy2_rect_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->yuy2_2d_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->uyvy_rect_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->uyvy_2d_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->yv12_rect_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->yv12_2d_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->p8_rect_shader)); - GL_EXTCALL(glDeleteProgramsARB(1, &priv->p8_2d_shader)); - checkGLcall("Delete yuv and p8 programs"); + wine_rb_destroy(&priv->shaders, arbfp_free_blit_shader, &device->adapter->gl_info); + checkGLcall("Delete blit programs"); if (priv->palette_texture) gl_info->gl_ops.gl.p_glDeleteTextures(1, &priv->palette_texture); @@ -6926,11 +6949,11 @@ static BOOL gen_yv12_read(struct wined3d_shader_buffer *buffer, GLenum textype, * | | * +----------------+-----------------+---- * | | | - * | U even rows | U odd rows | + * | V even rows | V odd rows | * | | | 1 * +----------------+------------------ - * | | | 3 - * | V even rows | V odd rows | + * | U even rows | U odd rows | * | | | * +----------------+-----------------+---- * | | | @@ -6997,7 +7020,7 @@ static BOOL gen_yv12_read(struct wined3d_shader_buffer *buffer, GLenum textype, shader_addline(buffer, "MAD temp.y, size.y, coef.w, size.y;\n"); shader_addline(buffer, "ADD temp.y, temp.y, -coef.y;\n"); shader_addline(buffer, "MIN texcrd.y, temp.y, texcrd.y;\n"); - shader_addline(buffer, "ADD temp.y, size.y, -coef.y;\n"); + shader_addline(buffer, "ADD temp.y, size.y, coef.y;\n"); shader_addline(buffer, "MAX texcrd.y, temp.y, texcrd.y;\n"); } /* Read the texture, put the result into the output register */ @@ -7040,6 +7063,154 @@ static BOOL gen_yv12_read(struct wined3d_shader_buffer *buffer, GLenum textype, return TRUE; } +static BOOL gen_nv12_read(struct wined3d_shader_buffer *buffer, GLenum textype, + char *luminance) +{ + const char *tex; + static const float nv12_coef[] + = {2.0f / 3.0f, 1.0f / 3.0f, 1.0f, 1.0f}; + + switch (textype) + { + case GL_TEXTURE_2D: + tex = "2D"; + break; + case GL_TEXTURE_RECTANGLE_ARB: + tex = "RECT"; + break; + default: + FIXME("Implement nv12 correction for non-2d, non-rect textures\n"); + return FALSE; + } + + /* NV12 surfaces contain a WxH sized luminance plane, followed by a (W/2)x(H/2) + * sized plane where each component is an UV pair. So the effective + * bitdepth is 12 bits per pixel If the whole texture is interpreted as luminance + * data it looks approximately like this: + * + * +----------------------------------+---- + * | | + * | | + * | | + * | | + * | | 2 + * | LUMINANCE | - + * | | 3 + * | | + * | | + * | | + * | | + * +----------------------------------+---- + * |UVUVUVUVUVUVUVUVUVUVUVUVUVUVUVUVUV| + * |UVUVUVUVUVUVUVUVUVUVUVUVUVUVUVUVUV| + * | | 1 + * | | - + * | | 3 + * | | + * | | + * +----------------------------------+---- + * + * When reading from rectangle textures, keep in mind that the input y coordinates + * go from 0 to d3d_height, whereas the opengl texture height is 1.5 * d3d_height. */ + + shader_addline(buffer, "PARAM nv12_coef = "); + shader_arb_append_imm_vec4(buffer, nv12_coef); + shader_addline(buffer, ";\n"); + + shader_addline(buffer, "MOV texcrd, fragment.texcoord[0];\n"); + /* We only have half the number of chroma pixels. */ + shader_addline(buffer, "MUL texcrd.x, texcrd.x, coef.y;\n"); + + if (textype == GL_TEXTURE_2D) + { + shader_addline(buffer, "RCP chroma.w, size.x;\n"); + shader_addline(buffer, "RCP chroma.z, size.y;\n"); + + shader_addline(buffer, "MAD texcrd.y, texcrd.y, nv12_coef.y, nv12_coef.x;\n"); + + /* We must not allow filtering horizontally, this would mix U and V. + * Vertical filtering is ok. However, bear in mind that the pixel center is at + * 0.5, so add 0.5. */ + + /* Convert to non-normalized coordinates so we can find the + * individual pixel. */ + shader_addline(buffer, "MUL texcrd.x, texcrd.x, size.x;\n"); + shader_addline(buffer, "FLR texcrd.x, texcrd.x;\n"); + /* Multiply by 2 since chroma components are stored in UV pixel pairs, + * add 0.5 to hit the center of the pixel. */ + shader_addline(buffer, "MAD texcrd.x, texcrd.x, coef.z, coef.y;\n"); + + /* Convert back to normalized coordinates. */ + shader_addline(buffer, "MUL texcrd.x, texcrd.x, chroma.w;\n"); + + /* Clamp, keep the half pixel origin in mind. */ + shader_addline(buffer, "MAD temp.y, coef.y, chroma.z, nv12_coef.x;\n"); + shader_addline(buffer, "MAX texcrd.y, temp.y, texcrd.y;\n"); + shader_addline(buffer, "MAD temp.y, -coef.y, chroma.z, nv12_coef.z;\n"); + shader_addline(buffer, "MIN texcrd.y, temp.y, texcrd.y;\n"); + } + else + { + /* Read from [size - size+size/2] */ + shader_addline(buffer, "MAD texcrd.y, texcrd.y, coef.y, size.y;\n"); + + shader_addline(buffer, "FLR texcrd.x, texcrd.x;\n"); + /* Multiply by 2 since chroma components are stored in UV pixel pairs, + * add 0.5 to hit the center of the pixel. */ + shader_addline(buffer, "MAD texcrd.x, texcrd.x, coef.z, coef.y;\n"); + + /* Clamp */ + shader_addline(buffer, "MAD temp.y, size.y, coef.y, size.y;\n"); + shader_addline(buffer, "ADD temp.y, temp.y, -coef.y;\n"); + shader_addline(buffer, "MIN texcrd.y, temp.y, texcrd.y;\n"); + shader_addline(buffer, "ADD temp.y, size.y, coef.y;\n"); + shader_addline(buffer, "MAX texcrd.y, temp.y, texcrd.y;\n"); + } + /* Read the texture, put the result into the output register. */ + shader_addline(buffer, "TEX temp, texcrd, texture[0], %s;\n", tex); + shader_addline(buffer, "MOV chroma.y, temp.w;\n"); + + if (textype == GL_TEXTURE_2D) + { + /* Add 1/size.x */ + shader_addline(buffer, "ADD texcrd.x, texcrd.x, chroma.w;\n"); + } + else + { + /* Add 1 */ + shader_addline(buffer, "ADD texcrd.x, texcrd.x, coef.x;\n"); + } + shader_addline(buffer, "TEX temp, texcrd, texture[0], %s;\n", tex); + shader_addline(buffer, "MOV chroma.x, temp.w;\n"); + + /* Sample the luminance value. It is in the top 2/3rd of the texture, so scale the y coordinate. + * Clamp the y coordinate to prevent the chroma values from bleeding into the sampled luminance + * values due to filtering. */ + shader_addline(buffer, "MOV texcrd, fragment.texcoord[0];\n"); + if (textype == GL_TEXTURE_2D) + { + /* Multiply the y coordinate by 2/3 and clamp it */ + shader_addline(buffer, "MUL texcrd.y, texcrd.y, nv12_coef.x;\n"); + shader_addline(buffer, "MAD temp.y, -coef.y, chroma.w, nv12_coef.x;\n"); + shader_addline(buffer, "MIN texcrd.y, temp.y, texcrd.y;\n"); + shader_addline(buffer, "TEX luminance, texcrd, texture[0], %s;\n", tex); + } + else + { + /* Reading from texture_rectangles is pretty straightforward, just use the unmodified + * texture coordinate. It is still a good idea to clamp it though, since the opengl texture + * is bigger + */ + shader_addline(buffer, "ADD temp.x, size.y, -coef.y;\n"); + shader_addline(buffer, "MIN texcrd.y, texcrd.y, size.x;\n"); + shader_addline(buffer, "TEX luminance, texcrd, texture[0], %s;\n", tex); + } + *luminance = 'a'; + + return TRUE; +} + +/* Context activation is done by the caller. */ static GLuint gen_p8_shader(struct arbfp_blit_priv *priv, const struct wined3d_gl_info *gl_info, GLenum textype) { @@ -7093,11 +7264,6 @@ static GLuint gen_p8_shader(struct arbfp_blit_priv *priv, shader_arb_dump_program_source(buffer.buffer); } - if (textype == GL_TEXTURE_RECTANGLE_ARB) - priv->p8_rect_shader = shader; - else - priv->p8_2d_shader = shader; - shader_buffer_free(&buffer); return shader; @@ -7224,6 +7390,14 @@ static GLuint gen_yuv_shader(struct arbfp_blit_priv *priv, const struct wined3d_ } break; + case COMPLEX_FIXUP_NV12: + if (!gen_nv12_read(&buffer, textype, &luminance_component)) + { + shader_buffer_free(&buffer); + return 0; + } + break; + default: FIXME("Unsupported YUV fixup %#x\n", yuv_fixup); shader_buffer_free(&buffer); @@ -7264,26 +7438,6 @@ static GLuint gen_yuv_shader(struct arbfp_blit_priv *priv, const struct wined3d_ shader_buffer_free(&buffer); - switch (yuv_fixup) - { - case COMPLEX_FIXUP_YUY2: - if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->yuy2_rect_shader = shader; - else priv->yuy2_2d_shader = shader; - break; - - case COMPLEX_FIXUP_UYVY: - if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->uyvy_rect_shader = shader; - else priv->uyvy_2d_shader = shader; - break; - - case COMPLEX_FIXUP_YV12: - if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->yv12_rect_shader = shader; - else priv->yv12_2d_shader = shader; - break; - default: - ERR("Unsupported complex fixup: %d\n", yuv_fixup); - } - return shader; } @@ -7296,6 +7450,9 @@ static HRESULT arbfp_blit_set(void *blit_priv, struct wined3d_context *context, enum complex_fixup fixup; const struct wined3d_gl_info *gl_info = context->gl_info; GLenum textype = surface->container->target; + struct wine_rb_entry *entry; + struct arbfp_blit_type type; + struct arbfp_blit_desc *desc; if (surface->flags & SFLAG_CONVERTED) { @@ -7316,35 +7473,57 @@ static HRESULT arbfp_blit_set(void *blit_priv, struct wined3d_context *context, fixup = get_complex_fixup(surface->resource.format->color_fixup); - switch(fixup) + type.fixup = fixup; + type.textype = textype; + entry = wine_rb_get(&priv->shaders, &type); + if (entry) { - case COMPLEX_FIXUP_YUY2: - shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->yuy2_rect_shader : priv->yuy2_2d_shader; - break; + desc = WINE_RB_ENTRY_VALUE(entry, struct arbfp_blit_desc, entry); + shader = desc->shader; + } + else + { + switch (fixup) + { + case COMPLEX_FIXUP_P8: + shader = gen_p8_shader(priv, gl_info, textype); + break; - case COMPLEX_FIXUP_UYVY: - shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->uyvy_rect_shader : priv->uyvy_2d_shader; - break; + default: + shader = gen_yuv_shader(priv, gl_info, fixup, textype); + break; + } - case COMPLEX_FIXUP_YV12: - shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->yv12_rect_shader : priv->yv12_2d_shader; - break; - - case COMPLEX_FIXUP_P8: - shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->p8_rect_shader : priv->p8_2d_shader; - if (!shader) shader = gen_p8_shader(priv, gl_info, textype); - - upload_palette(surface, context); - break; - - default: + if (!shader) + { FIXME("Unsupported complex fixup %#x, not setting a shader\n", fixup); gl_info->gl_ops.gl.p_glEnable(textype); checkGLcall("glEnable(textype)"); return E_NOTIMPL; + } + + desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc)); + if (!desc) + goto err_out; + + desc->type.textype = textype; + desc->type.fixup = fixup; + desc->shader = shader; + if (wine_rb_put(&priv->shaders, &desc->type, &desc->entry) == -1) + { +err_out: + ERR("Out of memory\n"); + GL_EXTCALL(glDeleteProgramsARB(1, &shader)); + checkGLcall("GL_EXTCALL(glDeleteProgramsARB(1, &shader))"); + GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0)); + checkGLcall("glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0)"); + HeapFree(GetProcessHeap(), 0, desc); + return E_OUTOFMEMORY; + } } - if (!shader) shader = gen_yuv_shader(priv, gl_info, fixup, textype); + if (fixup == COMPLEX_FIXUP_P8) + upload_palette(surface, context); gl_info->gl_ops.gl.p_glEnable(GL_FRAGMENT_PROGRAM_ARB); checkGLcall("glEnable(GL_FRAGMENT_PROGRAM_ARB)"); @@ -7424,6 +7603,7 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum win case COMPLEX_FIXUP_YUY2: case COMPLEX_FIXUP_UYVY: case COMPLEX_FIXUP_YV12: + case COMPLEX_FIXUP_NV12: case COMPLEX_FIXUP_P8: TRACE("[OK]\n"); return TRUE; diff --git a/reactos/dll/directx/wine/wined3d/buffer.c b/reactos/dll/directx/wine/wined3d/buffer.c index 6a6fbcf2776..2bffe83e7ae 100644 --- a/reactos/dll/directx/wine/wined3d/buffer.c +++ b/reactos/dll/directx/wine/wined3d/buffer.c @@ -941,13 +941,20 @@ struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffe HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UINT size, BYTE **data, DWORD flags) { - BOOL dirty = buffer_is_dirty(buffer); LONG count; BYTE *base; TRACE("buffer %p, offset %u, size %u, data %p, flags %#x\n", buffer, offset, size, data, flags); flags = wined3d_resource_sanitize_map_flags(&buffer->resource, flags); + /* Filter redundant WINED3D_MAP_DISCARD maps. The 3DMark2001 multitexture + * fill rate test seems to depend on this. When we map a buffer with + * GL_MAP_INVALIDATE_BUFFER_BIT, the driver is free to discard the + * previous contents of the buffer. The r600g driver only does this when + * the buffer is currently in use, while the proprietary NVIDIA driver + * appears to do this unconditionally. */ + if (buffer->flags & WINED3D_BUFFER_DISCARD) + flags &= ~WINED3D_MAP_DISCARD; count = ++buffer->resource.map_count; if (buffer->buffer_object) @@ -1023,25 +1030,14 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN context_release(context); } } - else - { - if (dirty) - { - if (buffer->flags & WINED3D_BUFFER_NOSYNC && !(flags & WINED3D_MAP_NOOVERWRITE)) - { - buffer->flags &= ~WINED3D_BUFFER_NOSYNC; - } - } - else if(flags & WINED3D_MAP_NOOVERWRITE) - { - buffer->flags |= WINED3D_BUFFER_NOSYNC; - } - if (flags & WINED3D_MAP_DISCARD) - { - buffer->flags |= WINED3D_BUFFER_DISCARD; - } - } + if (flags & WINED3D_MAP_DISCARD) + buffer->flags |= WINED3D_BUFFER_DISCARD; + + if (!(flags & WINED3D_MAP_NOOVERWRITE)) + buffer->flags &= ~WINED3D_BUFFER_NOSYNC; + else if (!buffer_is_dirty(buffer)) + buffer->flags |= WINED3D_BUFFER_NOSYNC; } base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.heap_memory; @@ -1114,6 +1110,7 @@ void CDECL wined3d_buffer_unmap(struct wined3d_buffer *buffer) context_release(context); buffer_clear_dirty_areas(buffer); + buffer->map_ptr = NULL; } else if (buffer->flags & WINED3D_BUFFER_HASDESC) { diff --git a/reactos/dll/directx/wine/wined3d/context.c b/reactos/dll/directx/wine/wined3d/context.c index b9afbe1f8b4..a8d30335b43 100644 --- a/reactos/dll/directx/wine/wined3d/context.c +++ b/reactos/dll/directx/wine/wined3d/context.c @@ -606,6 +606,53 @@ void context_free_event_query(struct wined3d_event_query *query) context->free_event_queries[context->free_event_query_count++] = query->object; } +/* Context activation is done by the caller. */ +void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) +{ + const struct wined3d_gl_info *gl_info = context->gl_info; + + if (context->free_timestamp_query_count) + { + query->id = context->free_timestamp_queries[--context->free_timestamp_query_count]; + } + else + { + GL_EXTCALL(glGenQueriesARB(1, &query->id)); + checkGLcall("glGenQueriesARB"); + + TRACE("Allocated timestamp query %u in context %p.\n", query->id, context); + } + + query->context = context; + list_add_head(&context->timestamp_queries, &query->entry); +} + +void context_free_timestamp_query(struct wined3d_timestamp_query *query) +{ + struct wined3d_context *context = query->context; + + list_remove(&query->entry); + query->context = NULL; + + if (context->free_timestamp_query_count >= context->free_timestamp_query_size - 1) + { + UINT new_size = context->free_timestamp_query_size << 1; + GLuint *new_data = HeapReAlloc(GetProcessHeap(), 0, context->free_timestamp_queries, + new_size * sizeof(*context->free_timestamp_queries)); + + if (!new_data) + { + ERR("Failed to grow free list, leaking query %u in context %p.\n", query->id, context); + return; + } + + context->free_timestamp_query_size = new_size; + context->free_timestamp_queries = new_data; + } + + context->free_timestamp_queries[context->free_timestamp_query_count++] = query->id; +} + typedef void (context_fbo_entry_func_t)(struct wined3d_context *context, struct fbo_entry *entry); static void context_enum_surface_fbo_entries(const struct wined3d_device *device, @@ -711,11 +758,47 @@ void context_surface_update(struct wined3d_context *context, const struct wined3 } } -static BOOL context_set_pixel_format(const struct wined3d_gl_info *gl_info, HDC dc, int format) +static BOOL context_restore_pixel_format(struct wined3d_context *ctx) { - int current = GetPixelFormat(dc); + const struct wined3d_gl_info *gl_info = ctx->gl_info; + BOOL ret = FALSE; - if (current == format) return TRUE; + if (ctx->restore_pf && IsWindow(ctx->restore_pf_win)) + { + if (ctx->gl_info->supported[WGL_WINE_PIXEL_FORMAT_PASSTHROUGH]) + { + HDC dc = GetDC(ctx->restore_pf_win); + if (dc) + { + if (!(ret = GL_EXTCALL(wglSetPixelFormatWINE(dc, ctx->restore_pf)))) + { + ERR("wglSetPixelFormatWINE failed to restore pixel format %d on window %p.\n", + ctx->restore_pf, ctx->restore_pf_win); + } + ReleaseDC(ctx->restore_pf_win, dc); + } + } + else + { + ERR("can't restore pixel format %d on window %p\n", ctx->restore_pf, ctx->restore_pf_win); + } + } + + ctx->restore_pf = 0; + ctx->restore_pf_win = NULL; + return ret; +} + +static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BOOL private, int format) +{ + const struct wined3d_gl_info *gl_info = context->gl_info; + int current; + + if (dc == context->hdc && context->hdc_is_private && context->hdc_has_format) + return TRUE; + + current = GetPixelFormat(dc); + if (current == format) goto success; if (!current) { @@ -726,7 +809,10 @@ static BOOL context_set_pixel_format(const struct wined3d_gl_info *gl_info, HDC format, dc, GetLastError()); return FALSE; } - return TRUE; + + context->restore_pf = 0; + context->restore_pf_win = private ? NULL : WindowFromDC(dc); + goto success; } /* By default WGL doesn't allow pixel format adjustments but we need it @@ -735,13 +821,25 @@ static BOOL context_set_pixel_format(const struct wined3d_gl_info *gl_info, HDC * when really needed. */ if (gl_info->supported[WGL_WINE_PIXEL_FORMAT_PASSTHROUGH]) { + HWND win; + if (!GL_EXTCALL(wglSetPixelFormatWINE(dc, format))) { ERR("wglSetPixelFormatWINE failed to set pixel format %d on device context %p.\n", format, dc); return FALSE; } - return TRUE; + + win = private ? NULL : WindowFromDC(dc); + if (win != context->restore_pf_win) + { + context_restore_pixel_format(context); + + context->restore_pf = private ? 0 : current; + context->restore_pf_win = win; + } + + goto success; } /* OpenGL doesn't allow pixel format adjustments. Print an error and @@ -751,6 +849,11 @@ static BOOL context_set_pixel_format(const struct wined3d_gl_info *gl_info, HDC ERR("Unable to set pixel format %d on device context %p. Already using format %d.\n", format, dc, current); return TRUE; + +success: + if (dc == context->hdc && context->hdc_is_private) + context->hdc_has_format = TRUE; + return TRUE; } static BOOL context_set_gl_context(struct wined3d_context *ctx) @@ -758,7 +861,7 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx) struct wined3d_swapchain *swapchain = ctx->swapchain; BOOL backup = FALSE; - if (!context_set_pixel_format(ctx->gl_info, ctx->hdc, ctx->pixel_format)) + if (!context_set_pixel_format(ctx, ctx->hdc, ctx->hdc_is_private, ctx->pixel_format)) { WARN("Failed to set pixel format %d on device context %p.\n", ctx->pixel_format, ctx->hdc); @@ -791,7 +894,7 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx) return FALSE; } - if (!context_set_pixel_format(ctx->gl_info, dc, ctx->pixel_format)) + if (!context_set_pixel_format(ctx, dc, TRUE, ctx->pixel_format)) { ERR("Failed to set pixel format %d on device context %p.\n", ctx->pixel_format, dc); @@ -809,18 +912,12 @@ static BOOL context_set_gl_context(struct wined3d_context *ctx) ctx->valid = 1; } + ctx->needs_set = 0; return TRUE; } -static void context_restore_gl_context(const struct wined3d_gl_info *gl_info, HDC dc, HGLRC gl_ctx, int pf) +static void context_restore_gl_context(const struct wined3d_gl_info *gl_info, HDC dc, HGLRC gl_ctx) { - if (!context_set_pixel_format(gl_info, dc, pf)) - { - ERR("Failed to restore pixel format %d on device context %p.\n", pf, dc); - context_set_current(NULL); - return; - } - if (!wglMakeCurrent(dc, gl_ctx)) { ERR("Failed to restore GL context %p on device context %p, last error %#x.\n", @@ -837,53 +934,47 @@ static void context_update_window(struct wined3d_context *context) TRACE("Updating context %p window from %p to %p.\n", context, context->win_handle, context->swapchain->win_handle); - if (context->valid) + if (context->hdc) wined3d_release_dc(context->win_handle, context->hdc); - else - context->valid = 1; context->win_handle = context->swapchain->win_handle; + context->hdc_is_private = FALSE; + context->hdc_has_format = FALSE; + context->needs_set = 1; + context->valid = 1; if (!(context->hdc = GetDC(context->win_handle))) { ERR("Failed to get a device context for window %p.\n", context->win_handle); - goto err; + context->valid = 0; } - - if (!context_set_pixel_format(context->gl_info, context->hdc, context->pixel_format)) - { - ERR("Failed to set pixel format %d on device context %p.\n", - context->pixel_format, context->hdc); - goto err; - } - - context_set_gl_context(context); - - return; - -err: - context->valid = 0; } static void context_destroy_gl_resources(struct wined3d_context *context) { const struct wined3d_gl_info *gl_info = context->gl_info; + struct wined3d_timestamp_query *timestamp_query; struct wined3d_occlusion_query *occlusion_query; struct wined3d_event_query *event_query; struct fbo_entry *entry, *entry2; HGLRC restore_ctx; HDC restore_dc; unsigned int i; - int restore_pf; restore_ctx = wglGetCurrentContext(); restore_dc = wglGetCurrentDC(); - restore_pf = GetPixelFormat(restore_dc); - if (context->valid && restore_ctx != context->glCtx) - context_set_gl_context(context); - else + if (restore_ctx == context->glCtx) restore_ctx = NULL; + else if (context->valid) + context_set_gl_context(context); + + LIST_FOR_EACH_ENTRY(timestamp_query, &context->timestamp_queries, struct wined3d_timestamp_query, entry) + { + if (context->valid) + GL_EXTCALL(glDeleteQueriesARB(1, ×tamp_query->id)); + timestamp_query->context = NULL; + } LIST_FOR_EACH_ENTRY(occlusion_query, &context->occlusion_queries, struct wined3d_occlusion_query, entry) { @@ -925,6 +1016,9 @@ static void context_destroy_gl_resources(struct wined3d_context *context) GL_EXTCALL(glDeleteProgramsARB(1, &context->dummy_arbfp_prog)); } + if (gl_info->supported[ARB_TIMER_QUERY]) + GL_EXTCALL(glDeleteQueriesARB(context->free_timestamp_query_count, context->free_timestamp_queries)); + if (gl_info->supported[ARB_OCCLUSION_QUERY]) GL_EXTCALL(glDeleteQueriesARB(context->free_occlusion_query_count, context->free_occlusion_queries)); @@ -953,12 +1047,14 @@ static void context_destroy_gl_resources(struct wined3d_context *context) checkGLcall("context cleanup"); } + HeapFree(GetProcessHeap(), 0, context->free_timestamp_queries); HeapFree(GetProcessHeap(), 0, context->free_occlusion_queries); HeapFree(GetProcessHeap(), 0, context->free_event_queries); + context_restore_pixel_format(context); if (restore_ctx) { - context_restore_gl_context(gl_info, restore_dc, restore_ctx, restore_pf); + context_restore_gl_context(gl_info, restore_dc, restore_ctx); } else if (wglGetCurrentContext() && !wglMakeCurrent(NULL, NULL)) { @@ -1054,12 +1150,17 @@ void context_release(struct wined3d_context *context) WARN("Context %p is not the current context.\n", context); } - if (!--context->level && context->restore_ctx) + if (!--context->level) { - TRACE("Restoring GL context %p on device context %p.\n", context->restore_ctx, context->restore_dc); - context_restore_gl_context(context->gl_info, context->restore_dc, context->restore_ctx, context->restore_pf); - context->restore_ctx = NULL; - context->restore_dc = NULL; + if (context_restore_pixel_format(context)) + context->needs_set = 1; + if (context->restore_ctx) + { + TRACE("Restoring GL context %p on device context %p.\n", context->restore_ctx, context->restore_dc); + context_restore_gl_context(context->gl_info, context->restore_dc, context->restore_ctx); + context->restore_ctx = NULL; + context->restore_dc = NULL; + } } } @@ -1078,8 +1179,11 @@ static void context_enter(struct wined3d_context *context) current_gl, wglGetCurrentDC()); context->restore_ctx = current_gl; context->restore_dc = wglGetCurrentDC(); - context->restore_pf = GetPixelFormat(context->restore_dc); + context->needs_set = 1; } + else if (!context->needs_set && !(context->hdc_is_private && context->hdc_has_format) + && context->pixel_format != GetPixelFormat(context->hdc)) + context->needs_set = 1; } } @@ -1287,6 +1391,7 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, int swap_interval; DWORD state; HDC hdc; + BOOL hdc_is_private = FALSE; TRACE("swapchain %p, target %p, window %p.\n", swapchain, target, swapchain->win_handle); @@ -1304,6 +1409,13 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, if (!ret->draw_buffers) goto out; + ret->free_timestamp_query_size = 4; + ret->free_timestamp_queries = HeapAlloc(GetProcessHeap(), 0, + ret->free_timestamp_query_size * sizeof(*ret->free_timestamp_queries)); + if (!ret->free_timestamp_queries) + goto out; + list_init(&ret->timestamp_queries); + ret->free_occlusion_query_size = 4; ret->free_occlusion_queries = HeapAlloc(GetProcessHeap(), 0, ret->free_occlusion_query_size * sizeof(*ret->free_occlusion_queries)); @@ -1347,7 +1459,9 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, { WARN("Failed to retireve device context, trying swapchain backup.\n"); - if (!(hdc = swapchain_get_backup_dc(swapchain))) + if ((hdc = swapchain_get_backup_dc(swapchain))) + hdc_is_private = TRUE; + else { ERR("Failed to retrieve a device context.\n"); goto out; @@ -1396,7 +1510,9 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, context_enter(ret); - if (!context_set_pixel_format(gl_info, hdc, pixel_format)) + ret->gl_info = gl_info; + + if (!context_set_pixel_format(ret, hdc, hdc_is_private, pixel_format)) { ERR("Failed to set pixel format %d on device context %p.\n", pixel_format, hdc); context_release(ret); @@ -1451,7 +1567,6 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, goto out; } - ret->gl_info = gl_info; ret->d3d_info = &device->adapter->d3d_info; ret->state_table = device->StateTable; @@ -1474,7 +1589,10 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, ret->glCtx = ctx; ret->win_handle = swapchain->win_handle; ret->hdc = hdc; + ret->hdc_is_private = hdc_is_private; + ret->hdc_has_format = TRUE; ret->pixel_format = pixel_format; + ret->needs_set = 1; /* Set up the context defaults */ if (!context_set_current(ret)) @@ -1640,6 +1758,7 @@ out: device->shader_backend->shader_free_context_data(ret); HeapFree(GetProcessHeap(), 0, ret->free_event_queries); HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); + HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); HeapFree(GetProcessHeap(), 0, ret->draw_buffers); HeapFree(GetProcessHeap(), 0, ret->blit_targets); HeapFree(GetProcessHeap(), 0, ret); @@ -2992,9 +3111,9 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str context = swapchain_get_context(device->swapchains[0]); } + context_enter(context); context_update_window(context); context_setup_target(context, target); - context_enter(context); if (!context->valid) return context; if (context != current_context) @@ -3002,7 +3121,7 @@ struct wined3d_context *context_acquire(const struct wined3d_device *device, str if (!context_set_current(context)) ERR("Failed to activate the new context.\n"); } - else if (context->restore_ctx) + else if (context->needs_set) { context_set_gl_context(context); } diff --git a/reactos/dll/directx/wine/wined3d/cs.c b/reactos/dll/directx/wine/wined3d/cs.c index 338a3e13971..f85cf982b1c 100644 --- a/reactos/dll/directx/wine/wined3d/cs.c +++ b/reactos/dll/directx/wine/wined3d/cs.c @@ -937,5 +937,6 @@ void wined3d_cs_destroy(struct wined3d_cs *cs) { state_cleanup(&cs->state); HeapFree(GetProcessHeap(), 0, cs->fb.render_targets); + HeapFree(GetProcessHeap(), 0, cs->data); HeapFree(GetProcessHeap(), 0, cs); } diff --git a/reactos/dll/directx/wine/wined3d/device.c b/reactos/dll/directx/wine/wined3d/device.c index 7e60fe3b7ec..37d9acb24da 100644 --- a/reactos/dll/directx/wine/wined3d/device.c +++ b/reactos/dll/directx/wine/wined3d/device.c @@ -1008,9 +1008,6 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) if (!device->d3d_initialized) return WINED3DERR_INVALIDCALL; - /* Force making the context current again, to verify it is still valid - * (workaround for broken drivers) */ - context_set_current(NULL); /* I don't think that the interface guarantees that the device is destroyed from the same thread * it was created. Thus make sure a context is active for the glDelete* calls */ @@ -4129,7 +4126,19 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, } if (reset_state) + { + if (device->logo_texture) + { + wined3d_texture_decref(device->logo_texture); + device->logo_texture = NULL; + } + if (device->cursor_texture) + { + wined3d_texture_decref(device->cursor_texture); + device->cursor_texture = NULL; + } state_unbind_resources(&device->state); + } if (device->fb.render_targets) { diff --git a/reactos/dll/directx/wine/wined3d/directx.c b/reactos/dll/directx/wine/wined3d/directx.c index ffdcc664e6d..4ecbf6e7de3 100644 --- a/reactos/dll/directx/wine/wined3d/directx.c +++ b/reactos/dll/directx/wine/wined3d/directx.c @@ -50,6 +50,7 @@ enum wined3d_display_driver DRIVER_NVIDIA_GEFORCE2MX, DRIVER_NVIDIA_GEFORCEFX, DRIVER_NVIDIA_GEFORCE6, + DRIVER_VMWARE, DRIVER_UNKNOWN }; @@ -66,7 +67,6 @@ enum wined3d_gl_vendor GL_VENDOR_UNKNOWN, GL_VENDOR_APPLE, GL_VENDOR_FGLRX, - GL_VENDOR_INTEL, GL_VENDOR_MESA, GL_VENDOR_NVIDIA, }; @@ -91,6 +91,7 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_APPLE_ycbcr_422", APPLE_YCBCR_422 }, /* ARB */ + {"GL_ARB_blend_func_extended", ARB_BLEND_FUNC_EXTENDED }, {"GL_ARB_color_buffer_float", ARB_COLOR_BUFFER_FLOAT }, {"GL_ARB_debug_output", ARB_DEBUG_OUTPUT }, {"GL_ARB_depth_buffer_float", ARB_DEPTH_BUFFER_FLOAT }, @@ -136,6 +137,7 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_ARB_texture_non_power_of_two", ARB_TEXTURE_NON_POWER_OF_TWO }, {"GL_ARB_texture_rectangle", ARB_TEXTURE_RECTANGLE }, {"GL_ARB_texture_rg", ARB_TEXTURE_RG }, + {"GL_ARB_timer_query", ARB_TIMER_QUERY }, {"GL_ARB_vertex_array_bgra", ARB_VERTEX_ARRAY_BGRA }, {"GL_ARB_vertex_blend", ARB_VERTEX_BLEND }, {"GL_ARB_vertex_buffer_object", ARB_VERTEX_BUFFER_OBJECT }, @@ -601,7 +603,7 @@ static BOOL match_dx10_capable(const struct wined3d_gl_info *gl_info, const char /* DX9 cards support 40 single float varyings in hardware, most drivers report 32. ATI misreports * 44 varyings. So assume that if we have more than 44 varyings we have a dx10 card. * This detection is for the gl_ClipPos varying quirk. If a d3d9 card really supports more than 44 - * varyings and we subtract one in dx9 shaders its not going to hurt us because the dx9 limit is + * varyings and we subtract one in dx9 shaders it's not going to hurt us because the dx9 limit is * hardcoded * * dx10 cards usually have 64 varyings */ @@ -1166,6 +1168,9 @@ static const struct driver_version_information driver_version_table[] = {DRIVER_NVIDIA_GEFORCEFX, DRIVER_MODEL_NT5X, "nv4_disp.dll", 14, 11, 7516}, {DRIVER_NVIDIA_GEFORCE6, DRIVER_MODEL_NT5X, "nv4_disp.dll", 15, 12, 6658}, {DRIVER_NVIDIA_GEFORCE6, DRIVER_MODEL_NT6X, "nvd3dum.dll", 15, 12, 6658}, + + /* VMware */ + {DRIVER_VMWARE, DRIVER_MODEL_NT5X, "vm3dum.dll", 14, 1, 1134}, }; struct gpu_description @@ -1256,6 +1261,9 @@ static const struct gpu_description gpu_description_table[] = {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX670, "NVIDIA GeForce GTX 670", DRIVER_NVIDIA_GEFORCE6, 2048}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX670MX, "NVIDIA GeForce GTX 670MX", DRIVER_NVIDIA_GEFORCE6, 3072}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX680, "NVIDIA GeForce GTX 680", DRIVER_NVIDIA_GEFORCE6, 2048}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX750, "NVIDIA GeForce GTX 750", DRIVER_NVIDIA_GEFORCE6, 1024}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX750TI, "NVIDIA GeForce GTX 750 Ti", DRIVER_NVIDIA_GEFORCE6, 2048}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX760, "NVIDIA Geforce GTX 760", DRIVER_NVIDIA_GEFORCE6, 2048}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX765M, "NVIDIA GeForce GTX 765M", DRIVER_NVIDIA_GEFORCE6, 2048}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX770M, "NVIDIA GeForce GTX 770M", DRIVER_NVIDIA_GEFORCE6, 3072}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX770, "NVIDIA GeForce GTX 770", DRIVER_NVIDIA_GEFORCE6, 2048}, @@ -1294,6 +1302,10 @@ static const struct gpu_description gpu_description_table[] = {HW_VENDOR_AMD, CARD_AMD_RADEON_HD7700, "AMD Radeon HD 7700 Series", DRIVER_AMD_R600, 1024}, {HW_VENDOR_AMD, CARD_AMD_RADEON_HD7800, "AMD Radeon HD 7800 Series", DRIVER_AMD_R600, 2048}, {HW_VENDOR_AMD, CARD_AMD_RADEON_HD7900, "AMD Radeon HD 7900 Series", DRIVER_AMD_R600, 2048}, + + /* VMware */ + {HW_VENDOR_VMWARE, CARD_VMWARE_SVGA3D, "VMware SVGA 3D (Microsoft Corporation - WDDM)", DRIVER_VMWARE, 1024}, + /* Intel cards */ {HW_VENDOR_INTEL, CARD_INTEL_830M, "Intel(R) 82830M Graphics Controller", DRIVER_INTEL_GMA800, 32 }, {HW_VENDOR_INTEL, CARD_INTEL_855GM, "Intel(R) 82852/82855 GM/GME Graphics Controller", DRIVER_INTEL_GMA800, 32 }, @@ -1376,7 +1388,7 @@ static void init_driver_info(struct wined3d_driver_info *driver_info, } driver_info->device = device; - /* Set a default amount of video memory (64MB). In general this code isn't used unless the user + /* Set a default amount of video memory (64 MB). In general this code isn't used unless the user * overrides the pci ids to a card which is not in our database. */ driver_info->vidmem = WINE_DEFAULT_VIDMEM; @@ -1567,20 +1579,16 @@ static enum wined3d_gl_vendor wined3d_guess_gl_vendor(const struct wined3d_gl_in if (strstr(gl_vendor_string, "ATI")) return GL_VENDOR_FGLRX; - if (strstr(gl_vendor_string, "Intel(R)") - /* Intel switched from Intel(R) to Intel® recently, so just match Intel. */ - || strstr(gl_renderer, "Intel") - || strstr(gl_vendor_string, "Intel Inc.")) - return GL_VENDOR_INTEL; - if (strstr(gl_vendor_string, "Mesa") || strstr(gl_vendor_string, "X.Org") || strstr(gl_vendor_string, "Advanced Micro Devices, Inc.") || strstr(gl_vendor_string, "DRI R300 Project") || strstr(gl_vendor_string, "Tungsten Graphics, Inc") || strstr(gl_vendor_string, "VMware, Inc.") + || strstr(gl_vendor_string, "Intel") || strstr(gl_renderer, "Mesa") - || strstr(gl_renderer, "Gallium")) + || strstr(gl_renderer, "Gallium") + || strstr(gl_renderer, "Intel")) return GL_VENDOR_MESA; FIXME("Received unrecognized GL_VENDOR %s. Returning GL_VENDOR_UNKNOWN.\n", @@ -1614,6 +1622,9 @@ static enum wined3d_pci_vendor wined3d_guess_card_vendor(const char *gl_vendor_s || strstr(gl_vendor_string, "Intel Inc.")) return HW_VENDOR_INTEL; + if (strstr(gl_renderer, "SVGA3D")) + return HW_VENDOR_VMWARE; + if (strstr(gl_vendor_string, "Mesa") || strstr(gl_vendor_string, "Brian Paul") || strstr(gl_vendor_string, "Tungsten Graphics, Inc") @@ -1665,6 +1676,9 @@ static enum wined3d_pci_device select_card_nvidia_binary(const struct wined3d_gl {"GTX 770M", CARD_NVIDIA_GEFORCE_GTX770M}, /* Geforce 700 - midend high mobile */ {"GTX 770", CARD_NVIDIA_GEFORCE_GTX770}, /* Geforce 700 - highend */ {"GTX 765M", CARD_NVIDIA_GEFORCE_GTX765M}, /* Geforce 700 - midend high mobile */ + {"GTX 760", CARD_NVIDIA_GEFORCE_GTX760}, /* Geforce 700 - midend high */ + {"GTX 750 Ti", CARD_NVIDIA_GEFORCE_GTX750TI}, /* Geforce 700 - midend */ + {"GTX 750", CARD_NVIDIA_GEFORCE_GTX750}, /* Geforce 700 - midend */ {"GTX 680", CARD_NVIDIA_GEFORCE_GTX680}, /* Geforce 600 - highend */ {"GTX 670MX", CARD_NVIDIA_GEFORCE_GTX670MX}, /* Geforce 600 - highend */ {"GTX 670", CARD_NVIDIA_GEFORCE_GTX670}, /* Geforce 600 - midend high */ @@ -1971,7 +1985,7 @@ static enum wined3d_pci_device select_card_amd_binary(const struct wined3d_gl_in return CARD_AMD_RADEON_X700; } - /* Radeon Xpress Series - onboard, DX9b, Shader 2.0, 300-400MHz */ + /* Radeon Xpress Series - onboard, DX9b, Shader 2.0, 300-400 MHz */ if (strstr(gl_renderer, "Radeon Xpress")) { return CARD_AMD_RADEON_XPRESS_200M; @@ -2119,7 +2133,7 @@ static enum wined3d_pci_device select_card_amd_mesa(const struct wined3d_gl_info {"R420", CARD_AMD_RADEON_X700}, {"R410", CARD_AMD_RADEON_X700}, {"RV410", CARD_AMD_RADEON_X700}, - /* Radeon Xpress - onboard, DX9b, Shader 2.0, 300-400MHz */ + /* Radeon Xpress - onboard, DX9b, Shader 2.0, 300-400 MHz */ {"RS740", CARD_AMD_RADEON_XPRESS_200M}, {"RS690", CARD_AMD_RADEON_XPRESS_200M}, {"RS600", CARD_AMD_RADEON_XPRESS_200M}, @@ -2158,6 +2172,8 @@ static enum wined3d_pci_device select_card_nvidia_mesa(const struct wined3d_gl_i } cards[] = { + /* Maxwell */ + {"NV117", CARD_NVIDIA_GEFORCE_GTX750}, /* Kepler */ {"NVE6", CARD_NVIDIA_GEFORCE_GTX770M}, {"NVE4", CARD_NVIDIA_GEFORCE_GTX680}, @@ -2236,29 +2252,40 @@ static enum wined3d_pci_device select_card_nvidia_mesa(const struct wined3d_gl_i return PCI_DEVICE_NONE; } +static enum wined3d_pci_device select_card_vmware(const struct wined3d_gl_info *gl_info, const char *gl_renderer) +{ + if (strstr(gl_renderer, "SVGA3D")) + return CARD_VMWARE_SVGA3D; + + return PCI_DEVICE_NONE; +} + static const struct gl_vendor_selection { enum wined3d_gl_vendor gl_vendor; const char *description; /* Description of the card selector i.e. Apple OS/X Intel */ enum wined3d_pci_device (*select_card)(const struct wined3d_gl_info *gl_info, const char *gl_renderer); } -nvidia_gl_vendor_table[] = -{ - {GL_VENDOR_NVIDIA, "Nvidia binary driver", select_card_nvidia_binary}, - {GL_VENDOR_APPLE, "Apple OSX NVidia binary driver", select_card_nvidia_binary}, - {GL_VENDOR_MESA, "Mesa Nouveau driver", select_card_nvidia_mesa}, -}, amd_gl_vendor_table[] = { - {GL_VENDOR_APPLE, "Apple OSX AMD/ATI binary driver", select_card_amd_binary}, - {GL_VENDOR_FGLRX, "AMD/ATI binary driver", select_card_amd_binary}, - {GL_VENDOR_MESA, "Mesa AMD/ATI driver", select_card_amd_mesa}, + {GL_VENDOR_APPLE, "Apple OSX AMD/ATI binary driver", select_card_amd_binary}, + {GL_VENDOR_FGLRX, "AMD/ATI binary driver", select_card_amd_binary}, + {GL_VENDOR_MESA, "Mesa AMD/ATI driver", select_card_amd_mesa}, +}, +nvidia_gl_vendor_table[] = +{ + {GL_VENDOR_APPLE, "Apple OSX NVidia binary driver", select_card_nvidia_binary}, + {GL_VENDOR_MESA, "Mesa Nouveau driver", select_card_nvidia_mesa}, + {GL_VENDOR_NVIDIA, "Nvidia binary driver", select_card_nvidia_binary}, +}, +vmware_gl_vendor_table[] = +{ + {GL_VENDOR_MESA, "VMware driver", select_card_vmware}, }, intel_gl_vendor_table[] = { - {GL_VENDOR_APPLE, "Apple OSX Intel binary driver", select_card_intel}, - {GL_VENDOR_INTEL, "Mesa Intel driver", select_card_intel}, - {GL_VENDOR_MESA, "Mesa Intel driver", select_card_intel}, + {GL_VENDOR_APPLE, "Apple OSX Intel binary driver", select_card_intel}, + {GL_VENDOR_MESA, "Mesa Intel driver", select_card_intel}, }; static enum wined3d_pci_device select_card_fallback_nvidia(const struct wined3d_gl_info *gl_info) @@ -2331,14 +2358,17 @@ static const struct } card_vendor_table[] = { - {HW_VENDOR_NVIDIA, "Nvidia", nvidia_gl_vendor_table, - sizeof(nvidia_gl_vendor_table) / sizeof(nvidia_gl_vendor_table[0]), - select_card_fallback_nvidia}, - {HW_VENDOR_AMD, "AMD", amd_gl_vendor_table, - sizeof(amd_gl_vendor_table) / sizeof(amd_gl_vendor_table[0]), + {HW_VENDOR_AMD, "AMD", amd_gl_vendor_table, + sizeof(amd_gl_vendor_table) / sizeof(*amd_gl_vendor_table), select_card_fallback_amd}, - {HW_VENDOR_INTEL, "Intel", intel_gl_vendor_table, - sizeof(intel_gl_vendor_table) / sizeof(intel_gl_vendor_table[0]), + {HW_VENDOR_NVIDIA, "Nvidia", nvidia_gl_vendor_table, + sizeof(nvidia_gl_vendor_table) / sizeof(*nvidia_gl_vendor_table), + select_card_fallback_nvidia}, + {HW_VENDOR_VMWARE, "VMware", vmware_gl_vendor_table, + sizeof(vmware_gl_vendor_table) / sizeof(*vmware_gl_vendor_table), + select_card_fallback_amd}, + {HW_VENDOR_INTEL, "Intel", intel_gl_vendor_table, + sizeof(intel_gl_vendor_table) / sizeof(*intel_gl_vendor_table), select_card_fallback_intel}, }; @@ -2937,6 +2967,15 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter) if (!counter_bits) gl_info->supported[ARB_OCCLUSION_QUERY] = FALSE; } + if (gl_info->supported[ARB_TIMER_QUERY]) + { + GLint counter_bits; + + GL_EXTCALL(glGetQueryivARB(GL_TIMESTAMP, GL_QUERY_COUNTER_BITS_ARB, &counter_bits)); + TRACE("Timestamp query counter has %d bits.\n", counter_bits); + if (!counter_bits) + gl_info->supported[ARB_TIMER_QUERY] = FALSE; + } if (!gl_info->supported[ATI_TEXTURE_MIRROR_ONCE] && gl_info->supported[EXT_TEXTURE_MIRROR_CLAMP]) { TRACE(" IMPLIED: ATI_texture_mirror_once support (by EXT_texture_mirror_clamp).\n"); @@ -3411,7 +3450,7 @@ HRESULT CDECL wined3d_get_adapter_identifier(const struct wined3d *wined3d, const char *name = adapter->driver_info.name; len = min(strlen(name), identifier->driver_size - 1); memcpy(identifier->driver, name, len); - identifier->driver[len] = '\0'; + memset(&identifier->driver[len], 0, identifier->driver_size - len); } if (identifier->description_size) @@ -3419,7 +3458,7 @@ HRESULT CDECL wined3d_get_adapter_identifier(const struct wined3d *wined3d, const char *description = adapter->driver_info.description; len = min(strlen(description), identifier->description_size - 1); memcpy(identifier->description, description, len); - identifier->description[len] = '\0'; + memset(&identifier->description[len], 0, identifier->description_size - len); } /* Note that d3d8 doesn't supply a device name. */ @@ -3998,8 +4037,7 @@ HRESULT CDECL wined3d_check_device_type(const struct wined3d *wined3d, UINT adap enum wined3d_device_type device_type, enum wined3d_format_id display_format, enum wined3d_format_id backbuffer_format, BOOL windowed) { - UINT mode_count; - HRESULT hr; + BOOL present_conversion = wined3d->flags & WINED3D_PRESENT_CONVERSION; TRACE("wined3d %p, adapter_idx %u, device_type %s, display_format %s, backbuffer_format %s, windowed %#x.\n", wined3d, adapter_idx, debug_d3ddevicetype(device_type), debug_d3dformat(display_format), @@ -4012,10 +4050,7 @@ HRESULT CDECL wined3d_check_device_type(const struct wined3d *wined3d, UINT adap * combination is available on the given adapter. In fullscreen mode microsoft specified * that the display format shouldn't provide alpha and that ignoring alpha the backbuffer * and display format should match exactly. - * In windowed mode format conversion can occur and this depends on the driver. When format - * conversion is done, this function should nevertheless fail and applications need to use - * CheckDeviceFormatConversion. - * At the moment we assume that fullscreen and windowed have the same capabilities. */ + * In windowed mode format conversion can occur and this depends on the driver. */ /* There are only 4 display formats. */ if (!(display_format == WINED3DFMT_B5G6R5_UNORM @@ -4027,72 +4062,88 @@ HRESULT CDECL wined3d_check_device_type(const struct wined3d *wined3d, UINT adap return WINED3DERR_NOTAVAILABLE; } - /* If the requested display format is not available, don't continue. */ - mode_count = wined3d_get_adapter_mode_count(wined3d, adapter_idx, - display_format, WINED3D_SCANLINE_ORDERING_UNKNOWN); - if (!mode_count) + if (!windowed) { - TRACE("No available modes for display format %s.\n", debug_d3dformat(display_format)); - return WINED3DERR_NOTAVAILABLE; - } + /* If the requested display format is not available, don't continue. */ + if (!wined3d_get_adapter_mode_count(wined3d, adapter_idx, + display_format, WINED3D_SCANLINE_ORDERING_UNKNOWN)) + { + TRACE("No available modes for display format %s.\n", debug_d3dformat(display_format)); + return WINED3DERR_NOTAVAILABLE; + } - /* Windowed mode allows you to specify WINED3DFMT_UNKNOWN for the backbuffer format, - * it means 'reuse' the display format for the backbuffer. */ - if (!windowed && backbuffer_format == WINED3DFMT_UNKNOWN) - { - TRACE("backbuffer_format WINED3FMT_UNKNOWN only available in windowed mode.\n"); - return WINED3DERR_NOTAVAILABLE; + present_conversion = FALSE; } - - /* In FULLSCREEN mode WINED3DFMT_B5G6R5_UNORM can only be mixed with - * backbuffer format WINED3DFMT_B5G6R5_UNORM. */ - if (display_format == WINED3DFMT_B5G6R5_UNORM && backbuffer_format != WINED3DFMT_B5G6R5_UNORM) + else if (display_format == WINED3DFMT_B10G10R10A2_UNORM) { - TRACE("Unsupported display/backbuffer format combination %s / %s.\n", + /* WINED3DFMT_B10G10R10A2_UNORM is only allowed in fullscreen mode. */ + TRACE("Unsupported format combination %s / %s in windowed mode.\n", debug_d3dformat(display_format), debug_d3dformat(backbuffer_format)); return WINED3DERR_NOTAVAILABLE; } - /* In FULLSCREEN mode WINED3DFMT_B5G5R5X1_UNORM can only be mixed with - * backbuffer formats WINED3DFMT_B5G5R5X1_UNORM and - * WINED3DFMT_B5G5R5A1_UNORM. */ - if (display_format == WINED3DFMT_B5G5R5X1_UNORM - && !(backbuffer_format == WINED3DFMT_B5G5R5X1_UNORM || backbuffer_format == WINED3DFMT_B5G5R5A1_UNORM)) + if (present_conversion) { - TRACE("Unsupported display/backbuffer format combination %s / %s.\n", - debug_d3dformat(display_format), debug_d3dformat(backbuffer_format)); + /* Use the display format as back buffer format if the latter is + * WINED3DFMT_UNKNOWN. */ + if (backbuffer_format == WINED3DFMT_UNKNOWN) + backbuffer_format = display_format; + + if (FAILED(wined3d_check_device_format_conversion(wined3d, adapter_idx, + device_type, backbuffer_format, display_format))) + { + TRACE("Format conversion from %s to %s not supported.\n", + debug_d3dformat(backbuffer_format), debug_d3dformat(display_format)); + return WINED3DERR_NOTAVAILABLE; + } + } + else + { + /* When format conversion from the back buffer format to the display + * format is not allowed, only a limited number of combinations are + * valid. */ + + if (display_format == WINED3DFMT_B5G6R5_UNORM && backbuffer_format != WINED3DFMT_B5G6R5_UNORM) + { + TRACE("Unsupported format combination %s / %s.\n", + debug_d3dformat(display_format), debug_d3dformat(backbuffer_format)); + return WINED3DERR_NOTAVAILABLE; + } + + if (display_format == WINED3DFMT_B5G5R5X1_UNORM + && !(backbuffer_format == WINED3DFMT_B5G5R5X1_UNORM || backbuffer_format == WINED3DFMT_B5G5R5A1_UNORM)) + { + TRACE("Unsupported format combination %s / %s.\n", + debug_d3dformat(display_format), debug_d3dformat(backbuffer_format)); + return WINED3DERR_NOTAVAILABLE; + } + + if (display_format == WINED3DFMT_B8G8R8X8_UNORM + && !(backbuffer_format == WINED3DFMT_B8G8R8X8_UNORM || backbuffer_format == WINED3DFMT_B8G8R8A8_UNORM)) + { + TRACE("Unsupported format combination %s / %s.\n", + debug_d3dformat(display_format), debug_d3dformat(backbuffer_format)); + return WINED3DERR_NOTAVAILABLE; + } + + if (display_format == WINED3DFMT_B10G10R10A2_UNORM + && backbuffer_format != WINED3DFMT_B10G10R10A2_UNORM) + { + TRACE("Unsupported format combination %s / %s.\n", + debug_d3dformat(display_format), debug_d3dformat(backbuffer_format)); + return WINED3DERR_NOTAVAILABLE; + } + } + + /* Validate that the back buffer format is usable for render targets. */ + if (FAILED(wined3d_check_device_format(wined3d, adapter_idx, device_type, display_format, + WINED3DUSAGE_RENDERTARGET, WINED3D_RTYPE_SURFACE, backbuffer_format))) + { + TRACE("Format %s not allowed for render targets.\n", debug_d3dformat(backbuffer_format)); return WINED3DERR_NOTAVAILABLE; } - /* In FULLSCREEN mode WINED3DFMT_B8G8R8X8_UNORM can only be mixed with - * backbuffer formats WINED3DFMT_B8G8R8X8_UNORM and - * WINED3DFMT_B8G8R8A8_UNORM. */ - if (display_format == WINED3DFMT_B8G8R8X8_UNORM - && !(backbuffer_format == WINED3DFMT_B8G8R8X8_UNORM || backbuffer_format == WINED3DFMT_B8G8R8A8_UNORM)) - { - TRACE("Unsupported display/backbuffer format combination %s / %s.\n", - debug_d3dformat(display_format), debug_d3dformat(backbuffer_format)); - return WINED3DERR_NOTAVAILABLE; - } - - /* WINED3DFMT_B10G10R10A2_UNORM is only allowed in fullscreen mode and it - * can only be mixed with backbuffer format WINED3DFMT_B10G10R10A2_UNORM. */ - if (display_format == WINED3DFMT_B10G10R10A2_UNORM - && (backbuffer_format != WINED3DFMT_B10G10R10A2_UNORM || windowed)) - { - TRACE("Unsupported display/backbuffer format combination %s / %s.\n", - debug_d3dformat(display_format), debug_d3dformat(backbuffer_format)); - return WINED3DERR_NOTAVAILABLE; - } - - /* Use CheckDeviceFormat to see if the backbuffer_format is usable with the given display_format */ - hr = wined3d_check_device_format(wined3d, adapter_idx, device_type, display_format, - WINED3DUSAGE_RENDERTARGET, WINED3D_RTYPE_SURFACE, backbuffer_format); - if (FAILED(hr)) - TRACE("Unsupported display/backbuffer format combination %s / %s.\n", - debug_d3dformat(display_format), debug_d3dformat(backbuffer_format)); - - return hr; + return WINED3D_OK; } HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapter_idx, @@ -4197,6 +4248,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte WINED3DPCMPCAPS_NEVER | WINED3DPCMPCAPS_NOTEQUAL; + /* WINED3DPBLENDCAPS_BOTHINVSRCALPHA and WINED3DPBLENDCAPS_BOTHSRCALPHA + * are legacy settings for srcblend only. */ caps->SrcBlendCaps = WINED3DPBLENDCAPS_BOTHINVSRCALPHA | WINED3DPBLENDCAPS_BOTHSRCALPHA | WINED3DPBLENDCAPS_DESTALPHA | @@ -4221,12 +4274,9 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte WINED3DPBLENDCAPS_SRCALPHA | WINED3DPBLENDCAPS_SRCCOLOR | WINED3DPBLENDCAPS_ZERO; - /* NOTE: WINED3DPBLENDCAPS_SRCALPHASAT is not supported as dest blend factor, - * according to the glBlendFunc manpage - * - * WINED3DPBLENDCAPS_BOTHINVSRCALPHA and WINED3DPBLENDCAPS_BOTHSRCALPHA are - * legacy settings for srcblend only - */ + + if (gl_info->supported[ARB_BLEND_FUNC_EXTENDED]) + caps->DestBlendCaps |= WINED3DPBLENDCAPS_SRCALPHASAT; if (gl_info->supported[EXT_BLEND_COLOR]) { @@ -4439,8 +4489,8 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte caps->MaxAnisotropy = gl_info->limits.anisotropy; caps->MaxPointSize = gl_info->limits.pointsize_max; - caps->MaxPrimitiveCount = 0xfffff; /* For now set 2^20-1 which is used by most >=Geforce3/Radeon8500 cards */ - caps->MaxVertexIndex = 0xfffff; + caps->MaxPrimitiveCount = 0x555555; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */ + caps->MaxVertexIndex = 0xffffff; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */ caps->MaxStreams = MAX_STREAMS; caps->MaxStreamStride = 1024; @@ -4504,6 +4554,7 @@ HRESULT CDECL wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapte caps->MaxVShaderInstructionsExecuted = 65535; /* VS 3.0 needs at least 65535, some cards even use 2^32-1 */ caps->MaxVertexShader30InstructionSlots = max(512, adapter->gl_info.limits.arb_vs_instructions); + caps->VertexTextureFilterCaps = WINED3DPTFILTERCAPS_MINFPOINT | WINED3DPTFILTERCAPS_MAGFPOINT; } else if (caps->VertexShaderVersion == 2) { @@ -5170,9 +5221,8 @@ const struct wined3d_parent_ops wined3d_null_parent_ops = wined3d_null_wined3d_object_destroyed, }; -HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags) +HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags) { - wined3d->dxVersion = version; wined3d->ref = 1; wined3d->flags = flags; diff --git a/reactos/dll/directx/wine/wined3d/query.c b/reactos/dll/directx/wine/wined3d/query.c index becea1b76f8..6ebb53c7eac 100644 --- a/reactos/dll/directx/wine/wined3d/query.c +++ b/reactos/dll/directx/wine/wined3d/query.c @@ -255,6 +255,14 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query) if (oq->context) context_free_occlusion_query(oq); HeapFree(GetProcessHeap(), 0, query->extendedData); } + else if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP) + { + struct wined3d_timestamp_query *tq = query->extendedData; + + if (tq->context) + context_free_timestamp_query(tq); + HeapFree(GetProcessHeap(), 0, query->extendedData); + } HeapFree(GetProcessHeap(), 0, query); } @@ -517,6 +525,148 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW return WINED3D_OK; /* can be WINED3DERR_INVALIDCALL. */ } +static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, + void *data, DWORD size, DWORD flags) +{ + struct wined3d_timestamp_query *tq = query->extendedData; + struct wined3d_device *device = query->device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct wined3d_context *context; + UINT64 *u64data = data; + GLuint available; + GLuint64 timestamp; + HRESULT res; + + TRACE("(%p) : type D3DQUERY_TIMESTAMP, data %p, size %#x, flags %#x.\n", query, data, size, flags); + + if (!tq->context) + query->state = QUERY_CREATED; + + if (query->state == QUERY_CREATED) + { + /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves. */ + TRACE("Query wasn't yet started, returning S_OK.\n"); + if (u64data) + *u64data = 0; + return S_OK; + } + + if (tq->context->tid != GetCurrentThreadId()) + { + FIXME("%p Wrong thread, returning 1.\n", query); + if (u64data) + *u64data = 1; + return S_OK; + } + + context = context_acquire(query->device, tq->context->current_rt); + + GL_EXTCALL(glGetQueryObjectuivARB(tq->id, GL_QUERY_RESULT_AVAILABLE_ARB, &available)); + checkGLcall("glGetQueryObjectuivARB(GL_QUERY_RESULT_AVAILABLE)"); + TRACE("available %#x.\n", available); + + if (available) + { + if (u64data) + { + GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT_ARB, ×tamp)); + checkGLcall("glGetQueryObjectuivARB(GL_QUERY_RESULT)"); + TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp)); + *u64data = timestamp; + } + res = S_OK; + } + else + { + res = S_FALSE; + } + + context_release(context); + + return res; +} + +static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) +{ + struct wined3d_device *device = query->device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + + TRACE("query %p, flags %#x.\n", query, flags); + + if (gl_info->supported[ARB_TIMER_QUERY]) + { + struct wined3d_timestamp_query *tq = query->extendedData; + struct wined3d_context *context; + + if (flags & WINED3DISSUE_BEGIN) + { + WARN("Ignoring WINED3DISSUE_BEGIN with a TIMESTAMP query.\n"); + } + if (flags & WINED3DISSUE_END) + { + if (tq->context) + context_free_timestamp_query(tq); + context = context_acquire(query->device, NULL); + context_alloc_timestamp_query(context, tq); + GL_EXTCALL(glQueryCounter(tq->id, GL_TIMESTAMP)); + checkGLcall("glQueryCounter()"); + context_release(context); + } + } + else + { + ERR("Timestamp queries not supported.\n"); + } + + if (flags & WINED3DISSUE_END) + query->state = QUERY_SIGNALLED; + + return WINED3D_OK; +} + +static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, + void *data, DWORD size, DWORD flags) +{ + TRACE("(%p) : type D3DQUERY_TIMESTAMP_DISJOINT, data %p, size %#x, flags %#x.\n", query, data, size, flags); + + if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) + { + struct wined3d_query_data_timestamp_disjoint *disjoint_data = data; + + if (query->state == QUERY_BUILDING) + { + TRACE("Query is building, returning S_FALSE.\n"); + return S_FALSE; + } + + if (disjoint_data) + { + disjoint_data->disjoint = FALSE; + disjoint_data->frequency = 1000 * 1000 * 1000; + } + } + else + { + UINT64 *u64data = data; + + if (u64data) + *u64data = 1000 * 1000 * 1000; + } + return S_OK; +} + +static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) +{ + TRACE("query %p, flags %#x.\n", query, flags); + + if (flags & WINED3DISSUE_BEGIN) + query->state = QUERY_BUILDING; + if (flags & WINED3DISSUE_END) + query->state = QUERY_SIGNALLED; + + return WINED3D_OK; +} + static const struct wined3d_query_ops event_query_ops = { wined3d_event_query_ops_get_data, @@ -529,6 +679,18 @@ static const struct wined3d_query_ops occlusion_query_ops = wined3d_occlusion_query_ops_issue, }; +static const struct wined3d_query_ops timestamp_query_ops = +{ + wined3d_timestamp_query_ops_get_data, + wined3d_timestamp_query_ops_issue, +}; + +static const struct wined3d_query_ops timestamp_disjoint_query_ops = +{ + wined3d_timestamp_disjoint_query_ops_get_data, + wined3d_timestamp_disjoint_query_ops_issue, +}; + static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *device, enum wined3d_query_type type) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; @@ -573,12 +735,41 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de } break; + case WINED3D_QUERY_TYPE_TIMESTAMP: + TRACE("Timestamp query.\n"); + if (!gl_info->supported[ARB_TIMER_QUERY]) + { + WARN("Unsupported in local OpenGL implementation: ARB_TIMER_QUERY.\n"); + return WINED3DERR_NOTAVAILABLE; + } + query->query_ops = ×tamp_query_ops; + query->data_size = sizeof(UINT64); + query->extendedData = HeapAlloc(GetProcessHeap(), 0, sizeof(struct wined3d_timestamp_query)); + if (!query->extendedData) + { + ERR("Failed to allocate timestamp query extended data.\n"); + return E_OUTOFMEMORY; + } + ((struct wined3d_timestamp_query *)query->extendedData)->context = NULL; + break; + + case WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT: + case WINED3D_QUERY_TYPE_TIMESTAMP_FREQ: + TRACE("TIMESTAMP_DISJOINT query.\n"); + if (!gl_info->supported[ARB_TIMER_QUERY]) + { + WARN("Unsupported in local OpenGL implementation: ARB_TIMER_QUERY.\n"); + return WINED3DERR_NOTAVAILABLE; + } + query->query_ops = ×tamp_disjoint_query_ops; + query->data_size = type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT + ? sizeof(struct wined3d_query_data_timestamp_disjoint) : sizeof(UINT64); + query->extendedData = NULL; + break; + case WINED3D_QUERY_TYPE_VCACHE: case WINED3D_QUERY_TYPE_RESOURCE_MANAGER: case WINED3D_QUERY_TYPE_VERTEX_STATS: - case WINED3D_QUERY_TYPE_TIMESTAMP: - case WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT: - case WINED3D_QUERY_TYPE_TIMESTAMP_FREQ: case WINED3D_QUERY_TYPE_PIPELINE_TIMINGS: case WINED3D_QUERY_TYPE_INTERFACE_TIMINGS: case WINED3D_QUERY_TYPE_VERTEX_TIMINGS: diff --git a/reactos/dll/directx/wine/wined3d/resource.c b/reactos/dll/directx/wine/wined3d/resource.c index 5c7bc8178e9..d65cc2944de 100644 --- a/reactos/dll/directx/wine/wined3d/resource.c +++ b/reactos/dll/directx/wine/wined3d/resource.c @@ -25,22 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); -struct private_data -{ - struct list entry; - - GUID tag; - DWORD flags; /* DDSPD_* */ - - union - { - void *data; - IUnknown *object; - } ptr; - - DWORD size; -}; - static DWORD resource_access_from_pool(enum wined3d_pool pool) { switch (pool) @@ -114,7 +98,6 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * resource->parent = parent; resource->parent_ops = parent_ops; resource->resource_ops = resource_ops; - list_init(&resource->privateData); if (size) { @@ -149,9 +132,6 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device * void resource_cleanup(struct wined3d_resource *resource) { const struct wined3d *d3d = resource->device->wined3d; - struct private_data *data; - struct list *e1, *e2; - HRESULT hr; TRACE("Cleaning up resource %p.\n", resource); @@ -161,14 +141,6 @@ void resource_cleanup(struct wined3d_resource *resource) adapter_adjust_memory(resource->device->adapter, 0 - resource->size); } - LIST_FOR_EACH_SAFE(e1, e2, &resource->privateData) - { - data = LIST_ENTRY(e1, struct private_data, entry); - hr = wined3d_resource_free_private_data(resource, &data->tag); - if (FAILED(hr)) - ERR("Failed to free private data when destroying resource %p, hr = %#x.\n", resource, hr); - } - wined3d_resource_free_sysmem(resource); device_resource_released(resource->device, resource); @@ -183,128 +155,6 @@ void resource_unload(struct wined3d_resource *resource) resource, resource->type); } -static struct private_data *resource_find_private_data(const struct wined3d_resource *resource, REFGUID tag) -{ - struct private_data *data; - struct list *entry; - - TRACE("Searching for private data %s\n", debugstr_guid(tag)); - LIST_FOR_EACH(entry, &resource->privateData) - { - data = LIST_ENTRY(entry, struct private_data, entry); - if (IsEqualGUID(&data->tag, tag)) { - TRACE("Found %p\n", data); - return data; - } - } - TRACE("Not found\n"); - return NULL; -} - -HRESULT CDECL wined3d_resource_set_private_data(struct wined3d_resource *resource, REFGUID guid, - const void *data, DWORD data_size, DWORD flags) -{ - struct private_data *d; - - TRACE("resource %p, riid %s, data %p, data_size %u, flags %#x.\n", - resource, debugstr_guid(guid), data, data_size, flags); - - wined3d_resource_free_private_data(resource, guid); - - d = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d)); - if (!d) return E_OUTOFMEMORY; - - d->tag = *guid; - d->flags = flags; - - if (flags & WINED3DSPD_IUNKNOWN) - { - if (data_size != sizeof(IUnknown *)) - { - WARN("IUnknown data with size %u, returning WINED3DERR_INVALIDCALL.\n", data_size); - HeapFree(GetProcessHeap(), 0, d); - return WINED3DERR_INVALIDCALL; - } - d->ptr.object = (IUnknown *)data; - d->size = sizeof(IUnknown *); - IUnknown_AddRef(d->ptr.object); - } - else - { - d->ptr.data = HeapAlloc(GetProcessHeap(), 0, data_size); - if (!d->ptr.data) - { - HeapFree(GetProcessHeap(), 0, d); - return E_OUTOFMEMORY; - } - d->size = data_size; - memcpy(d->ptr.data, data, data_size); - } - list_add_tail(&resource->privateData, &d->entry); - - return WINED3D_OK; -} - -HRESULT CDECL wined3d_resource_get_private_data(const struct wined3d_resource *resource, REFGUID guid, - void *data, DWORD *data_size) -{ - const struct private_data *d; - - TRACE("resource %p, guid %s, data %p, data_size %p.\n", - resource, debugstr_guid(guid), data, data_size); - - d = resource_find_private_data(resource, guid); - if (!d) return WINED3DERR_NOTFOUND; - - if (*data_size < d->size) - { - *data_size = d->size; - return WINED3DERR_MOREDATA; - } - - if (d->flags & WINED3DSPD_IUNKNOWN) - { - *(IUnknown **)data = d->ptr.object; - if (resource->device->wined3d->dxVersion != 7) - { - /* D3D8 and D3D9 addref the private data, DDraw does not. This - * can't be handled in ddraw because it doesn't know if the - * pointer returned is an IUnknown * or just a blob. */ - IUnknown_AddRef(d->ptr.object); - } - } - else - { - memcpy(data, d->ptr.data, d->size); - } - - return WINED3D_OK; -} -HRESULT CDECL wined3d_resource_free_private_data(struct wined3d_resource *resource, REFGUID guid) -{ - struct private_data *data; - - TRACE("resource %p, guid %s.\n", resource, debugstr_guid(guid)); - - data = resource_find_private_data(resource, guid); - if (!data) return WINED3DERR_NOTFOUND; - - if (data->flags & WINED3DSPD_IUNKNOWN) - { - if (data->ptr.object) - IUnknown_Release(data->ptr.object); - } - else - { - HeapFree(GetProcessHeap(), 0, data->ptr.data); - } - list_remove(&data->entry); - - HeapFree(GetProcessHeap(), 0, data); - - return WINED3D_OK; -} - DWORD resource_set_priority(struct wined3d_resource *resource, DWORD priority) { DWORD prev = resource->priority; diff --git a/reactos/dll/directx/wine/wined3d/surface.c b/reactos/dll/directx/wine/wined3d/surface.c index aea626d7c1c..b995b359478 100644 --- a/reactos/dll/directx/wine/wined3d/surface.c +++ b/reactos/dll/directx/wine/wined3d/surface.c @@ -672,7 +672,8 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) surface->texture_target = GL_TEXTURE_2D; /* Non-power2 support */ - if (gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] || gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT]) + if (gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] || gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT] + || gl_info->supported[ARB_TEXTURE_RECTANGLE]) { pow2Width = surface->resource.width; pow2Height = surface->resource.height; @@ -692,9 +693,9 @@ static HRESULT surface_private_setup(struct wined3d_surface *surface) if (pow2Width > surface->resource.width || pow2Height > surface->resource.height) { /* TODO: Add support for non power two compressed textures. */ - if (surface->resource.format->flags & WINED3DFMT_FLAG_COMPRESSED) + if (surface->resource.format->flags & (WINED3DFMT_FLAG_COMPRESSED | WINED3DFMT_FLAG_HEIGHT_SCALE)) { - FIXME("(%p) Compressed non-power-two textures are not supported w(%d) h(%d)\n", + FIXME("(%p) Compressed or height scaled non-power-two textures are not supported w(%d) h(%d)\n", surface, surface->resource.width, surface->resource.height); return WINED3DERR_NOTAVAILABLE; } @@ -2602,8 +2603,9 @@ HRESULT CDECL wined3d_surface_update_desc(struct wined3d_surface *surface, HRESULT hr; DWORD valid_location = 0; - TRACE("surface %p, width %u, height %u, format %s, multisample_type %#x, multisample_quality %u.\n", - surface, width, height, debug_d3dformat(format_id), multisample_type, multisample_type); + TRACE("surface %p, width %u, height %u, format %s, multisample_type %#x, multisample_quality %u, " + "mem %p, pitch %u.\n", + surface, width, height, debug_d3dformat(format_id), multisample_type, multisample_type, mem, pitch); if (!resource_size) return WINED3DERR_INVALIDCALL; @@ -5119,7 +5121,8 @@ HRESULT surface_load_location(struct wined3d_surface *surface, DWORD location) if (surface->resource.usage & WINED3DUSAGE_DEPTHSTENCIL) { - if (location == WINED3D_LOCATION_TEXTURE_RGB && surface->locations & WINED3D_LOCATION_DRAWABLE) + if (location == WINED3D_LOCATION_TEXTURE_RGB + && surface->locations & (WINED3D_LOCATION_DRAWABLE | WINED3D_LOCATION_DISCARDED)) { struct wined3d_context *context = context_acquire(device, NULL); surface_load_ds_location(surface, context, location); diff --git a/reactos/dll/directx/wine/wined3d/utils.c b/reactos/dll/directx/wine/wined3d/utils.c index 18ee65e7b39..cd55f2e3bd0 100644 --- a/reactos/dll/directx/wine/wined3d/utils.c +++ b/reactos/dll/directx/wine/wined3d/utils.c @@ -50,6 +50,7 @@ static const struct wined3d_format_channels formats[] = {WINED3DFMT_UYVY, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, {WINED3DFMT_YUY2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0}, {WINED3DFMT_YV12, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, + {WINED3DFMT_NV12, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {WINED3DFMT_DXT1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {WINED3DFMT_DXT2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {WINED3DFMT_DXT3, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, @@ -665,6 +666,10 @@ static const struct wined3d_format_texture_info format_texture_info[] = GL_ALPHA, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_FILTERING, WINED3D_GL_EXT_NONE, NULL}, + {WINED3DFMT_NV12, GL_ALPHA, GL_ALPHA, 0, + GL_ALPHA, GL_UNSIGNED_BYTE, 0, + WINED3DFMT_FLAG_FILTERING, + WINED3D_GL_EXT_NONE, NULL}, {WINED3DFMT_DXT1, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING @@ -1832,6 +1837,12 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ gl_info->formats[idx].height_scale.denominator = 2; gl_info->formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_YV12); + idx = getFmtIdx(WINED3DFMT_NV12); + gl_info->formats[idx].flags |= WINED3DFMT_FLAG_HEIGHT_SCALE; + gl_info->formats[idx].height_scale.numerator = 3; + gl_info->formats[idx].height_scale.denominator = 2; + gl_info->formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_NV12); + if (gl_info->supported[ARB_FRAGMENT_PROGRAM]) { idx = getFmtIdx(WINED3DFMT_P8_UINT); @@ -2068,6 +2079,7 @@ const char *debug_d3dformat(enum wined3d_format_id format_id) FMT_TO_STR(WINED3DFMT_UYVY); FMT_TO_STR(WINED3DFMT_YUY2); FMT_TO_STR(WINED3DFMT_YV12); + FMT_TO_STR(WINED3DFMT_NV12); FMT_TO_STR(WINED3DFMT_DXT1); FMT_TO_STR(WINED3DFMT_DXT2); FMT_TO_STR(WINED3DFMT_DXT3); @@ -2771,6 +2783,7 @@ static const char *debug_complex_fixup(enum complex_fixup fixup) WINED3D_TO_STR(COMPLEX_FIXUP_YUY2); WINED3D_TO_STR(COMPLEX_FIXUP_UYVY); WINED3D_TO_STR(COMPLEX_FIXUP_YV12); + WINED3D_TO_STR(COMPLEX_FIXUP_NV12); WINED3D_TO_STR(COMPLEX_FIXUP_P8); #undef WINED3D_TO_STR default: diff --git a/reactos/dll/directx/wine/wined3d/wined3d.spec b/reactos/dll/directx/wine/wined3d/wined3d.spec index 3a6dd333081..bdfe017b670 100644 --- a/reactos/dll/directx/wine/wined3d/wined3d.spec +++ b/reactos/dll/directx/wine/wined3d/wined3d.spec @@ -6,7 +6,7 @@ @ cdecl wined3d_check_device_format_conversion(ptr long long long long) @ cdecl wined3d_check_device_multisample_type(ptr long long long long long ptr) @ cdecl wined3d_check_device_type(ptr long long long long long) -@ cdecl wined3d_create(long long) +@ cdecl wined3d_create(long) @ cdecl wined3d_decref(ptr) @ cdecl wined3d_enum_adapter_modes(ptr long long long long ptr) @ cdecl wined3d_get_adapter_count(ptr) @@ -170,12 +170,9 @@ @ cdecl wined3d_query_incref(ptr) @ cdecl wined3d_query_issue(ptr long) -@ cdecl wined3d_resource_free_private_data(ptr ptr) @ cdecl wined3d_resource_get_desc(ptr ptr) @ cdecl wined3d_resource_get_parent(ptr) -@ cdecl wined3d_resource_get_private_data(ptr ptr ptr ptr) @ cdecl wined3d_resource_set_parent(ptr ptr) -@ cdecl wined3d_resource_set_private_data(ptr ptr ptr long long) @ cdecl wined3d_rendertarget_view_create(ptr ptr ptr) @ cdecl wined3d_rendertarget_view_decref(ptr) diff --git a/reactos/dll/directx/wine/wined3d/wined3d_gl.h b/reactos/dll/directx/wine/wined3d/wined3d_gl.h index b357bb180db..acfbe3cebfd 100644 --- a/reactos/dll/directx/wine/wined3d/wined3d_gl.h +++ b/reactos/dll/directx/wine/wined3d/wined3d_gl.h @@ -43,6 +43,7 @@ enum wined3d_gl_extension APPLE_FLUSH_BUFFER_RANGE, APPLE_YCBCR_422, /* ARB */ + ARB_BLEND_FUNC_EXTENDED, ARB_COLOR_BUFFER_FLOAT, ARB_DEBUG_OUTPUT, ARB_DEPTH_BUFFER_FLOAT, @@ -88,6 +89,7 @@ enum wined3d_gl_extension ARB_TEXTURE_NON_POWER_OF_TWO, ARB_TEXTURE_RECTANGLE, ARB_TEXTURE_RG, + ARB_TIMER_QUERY, ARB_VERTEX_ARRAY_BGRA, ARB_VERTEX_BLEND, ARB_VERTEX_BUFFER_OBJECT, @@ -180,6 +182,9 @@ enum wined3d_gl_extension /* GL_APPLE_flush_buffer_range */ \ USE_GL_FUNC(glBufferParameteriAPPLE) \ USE_GL_FUNC(glFlushMappedBufferRangeAPPLE) \ + /* GL_ARB_blend_func_extended */ \ + USE_GL_FUNC(glBindFragDataLocationIndexed) \ + USE_GL_FUNC(glGetFragDataIndex) \ /* GL_ARB_color_buffer_float */ \ USE_GL_FUNC(glClampColorARB) \ /* GL_ARB_debug_output */ \ @@ -317,6 +322,9 @@ enum wined3d_gl_extension USE_GL_FUNC(glCompressedTexSubImage2DARB) \ USE_GL_FUNC(glCompressedTexSubImage3DARB) \ USE_GL_FUNC(glGetCompressedTexImageARB) \ + /* GL_ARB_timer_query */ \ + USE_GL_FUNC(glQueryCounter) \ + USE_GL_FUNC(glGetQueryObjectui64v) \ /* GL_ARB_vertex_blend */ \ USE_GL_FUNC(glVertexBlendARB) \ USE_GL_FUNC(glWeightPointerARB) \ diff --git a/reactos/dll/directx/wine/wined3d/wined3d_main.c b/reactos/dll/directx/wine/wined3d/wined3d_main.c index d290a6f362a..c62d1f56f3b 100644 --- a/reactos/dll/directx/wine/wined3d/wined3d_main.c +++ b/reactos/dll/directx/wine/wined3d/wined3d_main.c @@ -85,7 +85,7 @@ struct wined3d_settings wined3d_settings = FALSE, /* 3D support enabled by default. */ }; -struct wined3d * CDECL wined3d_create(UINT version, DWORD flags) +struct wined3d * CDECL wined3d_create(DWORD flags) { struct wined3d *object; HRESULT hr; @@ -97,10 +97,10 @@ struct wined3d * CDECL wined3d_create(UINT version, DWORD flags) return NULL; } - if (version == 7 && wined3d_settings.no_3d) + if (wined3d_settings.no_3d) flags |= WINED3D_NO3D; - hr = wined3d_init(object, version, flags); + hr = wined3d_init(object, flags); if (FAILED(hr)) { WARN("Failed to initialize wined3d object, hr %#x.\n", hr); @@ -108,7 +108,7 @@ struct wined3d * CDECL wined3d_create(UINT version, DWORD flags) return NULL; } - TRACE("Created wined3d object %p for d3d%d support.\n", object, version); + TRACE("Created wined3d object %p.\n", object); return object; } diff --git a/reactos/dll/directx/wine/wined3d/wined3d_private.h b/reactos/dll/directx/wine/wined3d/wined3d_private.h index abfcb7a1dc9..6863f141ed9 100644 --- a/reactos/dll/directx/wine/wined3d/wined3d_private.h +++ b/reactos/dll/directx/wine/wined3d/wined3d_private.h @@ -94,6 +94,7 @@ enum complex_fixup COMPLEX_FIXUP_UYVY = 2, COMPLEX_FIXUP_YV12 = 3, COMPLEX_FIXUP_P8 = 4, + COMPLEX_FIXUP_NV12 = 5, }; #include @@ -1053,6 +1054,16 @@ enum wined3d_event_query_result wined3d_event_query_finish(const struct wined3d_ void wined3d_event_query_issue(struct wined3d_event_query *query, const struct wined3d_device *device) DECLSPEC_HIDDEN; BOOL wined3d_event_query_supported(const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; +struct wined3d_timestamp_query +{ + struct list entry; + GLuint id; + struct wined3d_context *context; +}; + +void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; +void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; + struct wined3d_context { const struct wined3d_gl_info *gl_info; @@ -1093,7 +1104,10 @@ struct wined3d_context DWORD fixed_function_usage_map : 8; /* MAX_TEXTURES, 8 */ DWORD lowest_disabled_stage : 4; /* Max MAX_TEXTURES, 8 */ DWORD rebind_fbo : 1; - DWORD padding : 19; + DWORD needs_set : 1; + DWORD hdc_is_private : 1; + DWORD hdc_has_format : 1; /* only meaningful if hdc_is_private */ + DWORD padding : 16; DWORD shader_update_mask; DWORD constant_update_mask; DWORD numbered_array_mask; @@ -1111,6 +1125,7 @@ struct wined3d_context HGLRC restore_ctx; HDC restore_dc; int restore_pf; + HWND restore_pf_win; HGLRC glCtx; HWND win_handle; HDC hdc; @@ -1141,6 +1156,11 @@ struct wined3d_context UINT free_event_query_count; struct list event_queries; + GLuint *free_timestamp_queries; + UINT free_timestamp_query_size; + UINT free_timestamp_query_count; + struct list timestamp_queries; + struct wined3d_stream_info stream_info; /* Fences for GL_APPLE_flush_buffer_range */ @@ -1356,10 +1376,11 @@ struct wined3d_pixel_format enum wined3d_pci_vendor { - HW_VENDOR_SOFTWARE = 0x0000, - HW_VENDOR_AMD = 0x1002, - HW_VENDOR_NVIDIA = 0x10de, - HW_VENDOR_INTEL = 0x8086, + HW_VENDOR_SOFTWARE = 0x0000, + HW_VENDOR_AMD = 0x1002, + HW_VENDOR_NVIDIA = 0x10de, + HW_VENDOR_VMWARE = 0x15ad, + HW_VENDOR_INTEL = 0x8086, }; enum wined3d_pci_device @@ -1477,10 +1498,15 @@ enum wined3d_pci_device CARD_NVIDIA_GEFORCE_GTX670 = 0x1189, CARD_NVIDIA_GEFORCE_GTX670MX = 0x11a1, CARD_NVIDIA_GEFORCE_GTX680 = 0x1180, + CARD_NVIDIA_GEFORCE_GTX750 = 0x1381, + CARD_NVIDIA_GEFORCE_GTX750TI = 0x1380, + CARD_NVIDIA_GEFORCE_GTX760 = 0x1187, CARD_NVIDIA_GEFORCE_GTX765M = 0x11e2, CARD_NVIDIA_GEFORCE_GTX770M = 0x11e0, CARD_NVIDIA_GEFORCE_GTX770 = 0x1184, + CARD_VMWARE_SVGA3D = 0x0405, + CARD_INTEL_830M = 0x3577, CARD_INTEL_855GM = 0x3582, CARD_INTEL_845G = 0x2562, @@ -1788,12 +1814,11 @@ struct wined3d { LONG ref; DWORD flags; - UINT dxVersion; UINT adapter_count; struct wined3d_adapter adapters[1]; }; -HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags) DECLSPEC_HIDDEN; +HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags) DECLSPEC_HIDDEN; BOOL wined3d_register_window(HWND window, struct wined3d_device *device) DECLSPEC_HIDDEN; void wined3d_unregister_window(HWND window) DECLSPEC_HIDDEN; @@ -2009,7 +2034,6 @@ struct wined3d_resource UINT size; DWORD priority; void *heap_memory; - struct list privateData; struct list resource_list_entry; void *parent; diff --git a/reactos/include/reactos/wine/wgl_driver.h b/reactos/include/reactos/wine/wgl_driver.h index 8d235017b84..7dbf6a14994 100644 --- a/reactos/include/reactos/wine/wgl_driver.h +++ b/reactos/include/reactos/wine/wgl_driver.h @@ -1,4 +1,4 @@ -/* Automatically generated from http://www.opengl.org/registry/api files; DO NOT EDIT! */ +/* Automatically generated from http://www.opengl.org/registry files; DO NOT EDIT! */ #ifndef __WINE_WGL_DRIVER_H #define __WINE_WGL_DRIVER_H @@ -7,7 +7,7 @@ #define WINE_GLAPI #endif -#define WINE_WGL_DRIVER_VERSION 10 +#define WINE_WGL_DRIVER_VERSION 11 struct wgl_context; struct wgl_pbuffer; @@ -39,7 +39,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glBitmap)(GLsizei,GLsizei,GLfloat,GLfloat,GLfloat,GLfloat,const GLubyte*); void (WINE_GLAPI *p_glBlendFunc)(GLenum,GLenum); void (WINE_GLAPI *p_glCallList)(GLuint); - void (WINE_GLAPI *p_glCallLists)(GLsizei,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glCallLists)(GLsizei,GLenum,const void*); void (WINE_GLAPI *p_glClear)(GLbitfield); void (WINE_GLAPI *p_glClearAccum)(GLfloat,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glClearColor)(GLfloat,GLfloat,GLfloat,GLfloat); @@ -81,7 +81,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glColor4usv)(const GLushort*); void (WINE_GLAPI *p_glColorMask)(GLboolean,GLboolean,GLboolean,GLboolean); void (WINE_GLAPI *p_glColorMaterial)(GLenum,GLenum); - void (WINE_GLAPI *p_glColorPointer)(GLint,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glColorPointer)(GLint,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glCopyPixels)(GLint,GLint,GLsizei,GLsizei,GLenum); void (WINE_GLAPI *p_glCopyTexImage1D)(GLenum,GLint,GLenum,GLint,GLint,GLsizei,GLint); void (WINE_GLAPI *p_glCopyTexImage2D)(GLenum,GLint,GLenum,GLint,GLint,GLsizei,GLsizei,GLint); @@ -97,10 +97,10 @@ struct opengl_funcs void (WINE_GLAPI *p_glDisableClientState)(GLenum); void (WINE_GLAPI *p_glDrawArrays)(GLenum,GLint,GLsizei); void (WINE_GLAPI *p_glDrawBuffer)(GLenum); - void (WINE_GLAPI *p_glDrawElements)(GLenum,GLsizei,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glDrawPixels)(GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glDrawElements)(GLenum,GLsizei,GLenum,const void*); + void (WINE_GLAPI *p_glDrawPixels)(GLsizei,GLsizei,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glEdgeFlag)(GLboolean); - void (WINE_GLAPI *p_glEdgeFlagPointer)(GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glEdgeFlagPointer)(GLsizei,const void*); void (WINE_GLAPI *p_glEdgeFlagv)(const GLboolean*); void (WINE_GLAPI *p_glEnable)(GLenum); void (WINE_GLAPI *p_glEnableClientState)(GLenum); @@ -145,22 +145,22 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetPixelMapfv)(GLenum,GLfloat*); void (WINE_GLAPI *p_glGetPixelMapuiv)(GLenum,GLuint*); void (WINE_GLAPI *p_glGetPixelMapusv)(GLenum,GLushort*); - void (WINE_GLAPI *p_glGetPointerv)(GLenum,GLvoid**); + void (WINE_GLAPI *p_glGetPointerv)(GLenum,void**); void (WINE_GLAPI *p_glGetPolygonStipple)(GLubyte*); - const GLubyte * (WINE_GLAPI *p_glGetString)(GLenum); + const GLubyte* (WINE_GLAPI *p_glGetString)(GLenum); void (WINE_GLAPI *p_glGetTexEnvfv)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetTexEnviv)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetTexGendv)(GLenum,GLenum,GLdouble*); void (WINE_GLAPI *p_glGetTexGenfv)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetTexGeniv)(GLenum,GLenum,GLint*); - void (WINE_GLAPI *p_glGetTexImage)(GLenum,GLint,GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetTexImage)(GLenum,GLint,GLenum,GLenum,void*); void (WINE_GLAPI *p_glGetTexLevelParameterfv)(GLenum,GLint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetTexLevelParameteriv)(GLenum,GLint,GLenum,GLint*); void (WINE_GLAPI *p_glGetTexParameterfv)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetTexParameteriv)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glHint)(GLenum,GLenum); void (WINE_GLAPI *p_glIndexMask)(GLuint); - void (WINE_GLAPI *p_glIndexPointer)(GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glIndexPointer)(GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glIndexd)(GLdouble); void (WINE_GLAPI *p_glIndexdv)(const GLdouble*); void (WINE_GLAPI *p_glIndexf)(GLfloat); @@ -172,7 +172,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glIndexub)(GLubyte); void (WINE_GLAPI *p_glIndexubv)(const GLubyte*); void (WINE_GLAPI *p_glInitNames)(void); - void (WINE_GLAPI *p_glInterleavedArrays)(GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glInterleavedArrays)(GLenum,GLsizei,const void*); GLboolean (WINE_GLAPI *p_glIsEnabled)(GLenum); GLboolean (WINE_GLAPI *p_glIsList)(GLuint); GLboolean (WINE_GLAPI *p_glIsTexture)(GLuint); @@ -218,12 +218,12 @@ struct opengl_funcs void (WINE_GLAPI *p_glNormal3iv)(const GLint*); void (WINE_GLAPI *p_glNormal3s)(GLshort,GLshort,GLshort); void (WINE_GLAPI *p_glNormal3sv)(const GLshort*); - void (WINE_GLAPI *p_glNormalPointer)(GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glNormalPointer)(GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glOrtho)(GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glPassThrough)(GLfloat); - void (WINE_GLAPI *p_glPixelMapfv)(GLenum,GLint,const GLfloat*); - void (WINE_GLAPI *p_glPixelMapuiv)(GLenum,GLint,const GLuint*); - void (WINE_GLAPI *p_glPixelMapusv)(GLenum,GLint,const GLushort*); + void (WINE_GLAPI *p_glPixelMapfv)(GLenum,GLsizei,const GLfloat*); + void (WINE_GLAPI *p_glPixelMapuiv)(GLenum,GLsizei,const GLuint*); + void (WINE_GLAPI *p_glPixelMapusv)(GLenum,GLsizei,const GLushort*); void (WINE_GLAPI *p_glPixelStoref)(GLenum,GLfloat); void (WINE_GLAPI *p_glPixelStorei)(GLenum,GLint); void (WINE_GLAPI *p_glPixelTransferf)(GLenum,GLfloat); @@ -267,7 +267,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glRasterPos4s)(GLshort,GLshort,GLshort,GLshort); void (WINE_GLAPI *p_glRasterPos4sv)(const GLshort*); void (WINE_GLAPI *p_glReadBuffer)(GLenum); - void (WINE_GLAPI *p_glReadPixels)(GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glReadPixels)(GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,void*); void (WINE_GLAPI *p_glRectd)(GLdouble,GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glRectdv)(const GLdouble*,const GLdouble*); void (WINE_GLAPI *p_glRectf)(GLfloat,GLfloat,GLfloat,GLfloat); @@ -319,7 +319,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glTexCoord4iv)(const GLint*); void (WINE_GLAPI *p_glTexCoord4s)(GLshort,GLshort,GLshort,GLshort); void (WINE_GLAPI *p_glTexCoord4sv)(const GLshort*); - void (WINE_GLAPI *p_glTexCoordPointer)(GLint,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glTexCoordPointer)(GLint,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glTexEnvf)(GLenum,GLenum,GLfloat); void (WINE_GLAPI *p_glTexEnvfv)(GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glTexEnvi)(GLenum,GLenum,GLint); @@ -330,14 +330,14 @@ struct opengl_funcs void (WINE_GLAPI *p_glTexGenfv)(GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glTexGeni)(GLenum,GLenum,GLint); void (WINE_GLAPI *p_glTexGeniv)(GLenum,GLenum,const GLint*); - void (WINE_GLAPI *p_glTexImage1D)(GLenum,GLint,GLint,GLsizei,GLint,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTexImage2D)(GLenum,GLint,GLint,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glTexImage1D)(GLenum,GLint,GLint,GLsizei,GLint,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTexImage2D)(GLenum,GLint,GLint,GLsizei,GLsizei,GLint,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glTexParameterf)(GLenum,GLenum,GLfloat); void (WINE_GLAPI *p_glTexParameterfv)(GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glTexParameteri)(GLenum,GLenum,GLint); void (WINE_GLAPI *p_glTexParameteriv)(GLenum,GLenum,const GLint*); - void (WINE_GLAPI *p_glTexSubImage1D)(GLenum,GLint,GLint,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTexSubImage2D)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glTexSubImage1D)(GLenum,GLint,GLint,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTexSubImage2D)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glTranslated)(GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glTranslatef)(GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glVertex2d)(GLdouble,GLdouble); @@ -364,12 +364,13 @@ struct opengl_funcs void (WINE_GLAPI *p_glVertex4iv)(const GLint*); void (WINE_GLAPI *p_glVertex4s)(GLshort,GLshort,GLshort,GLshort); void (WINE_GLAPI *p_glVertex4sv)(const GLshort*); - void (WINE_GLAPI *p_glVertexPointer)(GLint,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glVertexPointer)(GLint,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glViewport)(GLint,GLint,GLsizei,GLsizei); } gl; struct { + void (WINE_GLAPI *p_glAccumxOES)(GLenum,GLfixed); void (WINE_GLAPI *p_glActiveProgramEXT)(GLuint); void (WINE_GLAPI *p_glActiveShaderProgram)(GLuint,GLuint); void (WINE_GLAPI *p_glActiveStencilFaceEXT)(GLenum); @@ -379,6 +380,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glAlphaFragmentOp1ATI)(GLenum,GLuint,GLuint,GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glAlphaFragmentOp2ATI)(GLenum,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glAlphaFragmentOp3ATI)(GLenum,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint); + void (WINE_GLAPI *p_glAlphaFuncxOES)(GLenum,GLfixed); void (WINE_GLAPI *p_glApplyTextureEXT)(GLenum); GLboolean (WINE_GLAPI *p_glAreProgramsResidentNV)(GLsizei,const GLuint*,GLboolean*); GLboolean (WINE_GLAPI *p_glAreTexturesResidentEXT)(GLsizei,const GLuint*,GLboolean*); @@ -389,6 +391,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glAttachShader)(GLuint,GLuint); void (WINE_GLAPI *p_glBeginConditionalRender)(GLuint,GLenum); void (WINE_GLAPI *p_glBeginConditionalRenderNV)(GLuint,GLenum); + void (WINE_GLAPI *p_glBeginConditionalRenderNVX)(GLuint); void (WINE_GLAPI *p_glBeginFragmentShaderATI)(void); void (WINE_GLAPI *p_glBeginOcclusionQueryNV)(GLuint); void (WINE_GLAPI *p_glBeginPerfMonitorAMD)(GLuint); @@ -412,6 +415,8 @@ struct opengl_funcs void (WINE_GLAPI *p_glBindBufferRange)(GLenum,GLuint,GLuint,GLintptr,GLsizeiptr); void (WINE_GLAPI *p_glBindBufferRangeEXT)(GLenum,GLuint,GLuint,GLintptr,GLsizeiptr); void (WINE_GLAPI *p_glBindBufferRangeNV)(GLenum,GLuint,GLuint,GLintptr,GLsizeiptr); + void (WINE_GLAPI *p_glBindBuffersBase)(GLenum,GLuint,GLsizei,const GLuint*); + void (WINE_GLAPI *p_glBindBuffersRange)(GLenum,GLuint,GLsizei,const GLuint*,const GLintptr*,const GLsizeiptr*); void (WINE_GLAPI *p_glBindFragDataLocation)(GLuint,GLuint,const GLchar*); void (WINE_GLAPI *p_glBindFragDataLocationEXT)(GLuint,GLuint,const GLchar*); void (WINE_GLAPI *p_glBindFragDataLocationIndexed)(GLuint,GLuint,GLuint,const GLchar*); @@ -420,6 +425,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glBindFramebufferEXT)(GLenum,GLuint); void (WINE_GLAPI *p_glBindImageTexture)(GLuint,GLuint,GLint,GLboolean,GLint,GLenum,GLenum); void (WINE_GLAPI *p_glBindImageTextureEXT)(GLuint,GLuint,GLint,GLboolean,GLint,GLenum,GLint); + void (WINE_GLAPI *p_glBindImageTextures)(GLuint,GLsizei,const GLuint*); GLuint (WINE_GLAPI *p_glBindLightParameterEXT)(GLenum,GLenum); GLuint (WINE_GLAPI *p_glBindMaterialParameterEXT)(GLenum,GLenum); void (WINE_GLAPI *p_glBindMultiTextureEXT)(GLenum,GLenum,GLuint); @@ -430,14 +436,17 @@ struct opengl_funcs void (WINE_GLAPI *p_glBindRenderbuffer)(GLenum,GLuint); void (WINE_GLAPI *p_glBindRenderbufferEXT)(GLenum,GLuint); void (WINE_GLAPI *p_glBindSampler)(GLuint,GLuint); + void (WINE_GLAPI *p_glBindSamplers)(GLuint,GLsizei,const GLuint*); GLuint (WINE_GLAPI *p_glBindTexGenParameterEXT)(GLenum,GLenum,GLenum); void (WINE_GLAPI *p_glBindTextureEXT)(GLenum,GLuint); GLuint (WINE_GLAPI *p_glBindTextureUnitParameterEXT)(GLenum,GLenum); + void (WINE_GLAPI *p_glBindTextures)(GLuint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glBindTransformFeedback)(GLenum,GLuint); void (WINE_GLAPI *p_glBindTransformFeedbackNV)(GLenum,GLuint); void (WINE_GLAPI *p_glBindVertexArray)(GLuint); void (WINE_GLAPI *p_glBindVertexArrayAPPLE)(GLuint); void (WINE_GLAPI *p_glBindVertexBuffer)(GLuint,GLuint,GLintptr,GLsizei); + void (WINE_GLAPI *p_glBindVertexBuffers)(GLuint,GLsizei,const GLuint*,const GLintptr*,const GLsizei*); void (WINE_GLAPI *p_glBindVertexShaderEXT)(GLuint); void (WINE_GLAPI *p_glBindVideoCaptureStreamBufferNV)(GLuint,GLuint,GLenum,GLintptrARB); void (WINE_GLAPI *p_glBindVideoCaptureStreamTextureNV)(GLuint,GLuint,GLenum,GLenum,GLuint); @@ -451,9 +460,12 @@ struct opengl_funcs void (WINE_GLAPI *p_glBinormal3ivEXT)(const GLint*); void (WINE_GLAPI *p_glBinormal3sEXT)(GLshort,GLshort,GLshort); void (WINE_GLAPI *p_glBinormal3svEXT)(const GLshort*); - void (WINE_GLAPI *p_glBinormalPointerEXT)(GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glBinormalPointerEXT)(GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glBitmapxOES)(GLsizei,GLsizei,GLfixed,GLfixed,GLfixed,GLfixed,const GLubyte*); + void (WINE_GLAPI *p_glBlendBarrierNV)(void); void (WINE_GLAPI *p_glBlendColor)(GLfloat,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glBlendColorEXT)(GLfloat,GLfloat,GLfloat,GLfloat); + void (WINE_GLAPI *p_glBlendColorxOES)(GLfixed,GLfixed,GLfixed,GLfixed); void (WINE_GLAPI *p_glBlendEquation)(GLenum); void (WINE_GLAPI *p_glBlendEquationEXT)(GLenum); void (WINE_GLAPI *p_glBlendEquationIndexedAMD)(GLuint,GLenum); @@ -473,20 +485,23 @@ struct opengl_funcs void (WINE_GLAPI *p_glBlendFuncSeparateiARB)(GLuint,GLenum,GLenum,GLenum,GLenum); void (WINE_GLAPI *p_glBlendFunci)(GLuint,GLenum,GLenum); void (WINE_GLAPI *p_glBlendFunciARB)(GLuint,GLenum,GLenum); + void (WINE_GLAPI *p_glBlendParameteriNV)(GLenum,GLint); void (WINE_GLAPI *p_glBlitFramebuffer)(GLint,GLint,GLint,GLint,GLint,GLint,GLint,GLint,GLbitfield,GLenum); void (WINE_GLAPI *p_glBlitFramebufferEXT)(GLint,GLint,GLint,GLint,GLint,GLint,GLint,GLint,GLbitfield,GLenum); - void (WINE_GLAPI *p_glBufferAddressRangeNV)(GLenum,GLuint,UINT64,GLsizeiptr); - void (WINE_GLAPI *p_glBufferData)(GLenum,GLsizeiptr,const GLvoid*,GLenum); - void (WINE_GLAPI *p_glBufferDataARB)(GLenum,GLsizeiptrARB,const GLvoid*,GLenum); + void (WINE_GLAPI *p_glBufferAddressRangeNV)(GLenum,GLuint,GLuint64EXT,GLsizeiptr); + void (WINE_GLAPI *p_glBufferData)(GLenum,GLsizeiptr,const void*,GLenum); + void (WINE_GLAPI *p_glBufferDataARB)(GLenum,GLsizeiptrARB,const void*,GLenum); void (WINE_GLAPI *p_glBufferParameteriAPPLE)(GLenum,GLenum,GLint); GLuint (WINE_GLAPI *p_glBufferRegionEnabled)(void); - void (WINE_GLAPI *p_glBufferSubData)(GLenum,GLintptr,GLsizeiptr,const GLvoid*); - void (WINE_GLAPI *p_glBufferSubDataARB)(GLenum,GLintptrARB,GLsizeiptrARB,const GLvoid*); + void (WINE_GLAPI *p_glBufferStorage)(GLenum,GLsizeiptr,const void*,GLbitfield); + void (WINE_GLAPI *p_glBufferSubData)(GLenum,GLintptr,GLsizeiptr,const void*); + void (WINE_GLAPI *p_glBufferSubDataARB)(GLenum,GLintptrARB,GLsizeiptrARB,const void*); GLenum (WINE_GLAPI *p_glCheckFramebufferStatus)(GLenum); GLenum (WINE_GLAPI *p_glCheckFramebufferStatusEXT)(GLenum); GLenum (WINE_GLAPI *p_glCheckNamedFramebufferStatusEXT)(GLuint,GLenum); void (WINE_GLAPI *p_glClampColor)(GLenum,GLenum); void (WINE_GLAPI *p_glClampColorARB)(GLenum,GLenum); + void (WINE_GLAPI *p_glClearAccumxOES)(GLfixed,GLfixed,GLfixed,GLfixed); void (WINE_GLAPI *p_glClearBufferData)(GLenum,GLenum,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glClearBufferSubData)(GLenum,GLenum,GLintptr,GLsizeiptr,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glClearBufferfi)(GLenum,GLint,GLfloat,GLint); @@ -495,19 +510,28 @@ struct opengl_funcs void (WINE_GLAPI *p_glClearBufferuiv)(GLenum,GLint,const GLuint*); void (WINE_GLAPI *p_glClearColorIiEXT)(GLint,GLint,GLint,GLint); void (WINE_GLAPI *p_glClearColorIuiEXT)(GLuint,GLuint,GLuint,GLuint); + void (WINE_GLAPI *p_glClearColorxOES)(GLfixed,GLfixed,GLfixed,GLfixed); void (WINE_GLAPI *p_glClearDepthdNV)(GLdouble); void (WINE_GLAPI *p_glClearDepthf)(GLfloat); + void (WINE_GLAPI *p_glClearDepthfOES)(GLclampf); + void (WINE_GLAPI *p_glClearDepthxOES)(GLfixed); void (WINE_GLAPI *p_glClearNamedBufferDataEXT)(GLuint,GLenum,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glClearNamedBufferSubDataEXT)(GLuint,GLenum,GLenum,GLenum,GLsizeiptr,GLsizeiptr,const void*); + void (WINE_GLAPI *p_glClearTexImage)(GLuint,GLint,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glClearTexSubImage)(GLuint,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glClientActiveTexture)(GLenum); void (WINE_GLAPI *p_glClientActiveTextureARB)(GLenum); void (WINE_GLAPI *p_glClientActiveVertexStreamATI)(GLenum); void (WINE_GLAPI *p_glClientAttribDefaultEXT)(GLbitfield); - GLenum (WINE_GLAPI *p_glClientWaitSync)(GLvoid*,GLbitfield,UINT64); + GLenum (WINE_GLAPI *p_glClientWaitSync)(GLsync,GLbitfield,GLuint64); + void (WINE_GLAPI *p_glClipPlanefOES)(GLenum,const GLfloat*); + void (WINE_GLAPI *p_glClipPlanexOES)(GLenum,const GLfixed*); void (WINE_GLAPI *p_glColor3fVertex3fSUN)(GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glColor3fVertex3fvSUN)(const GLfloat*,const GLfloat*); void (WINE_GLAPI *p_glColor3hNV)(GLhalfNV,GLhalfNV,GLhalfNV); void (WINE_GLAPI *p_glColor3hvNV)(const GLhalfNV*); + void (WINE_GLAPI *p_glColor3xOES)(GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glColor3xvOES)(const GLfixed*); void (WINE_GLAPI *p_glColor4fNormal3fVertex3fSUN)(GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glColor4fNormal3fVertex3fvSUN)(const GLfloat*,const GLfloat*,const GLfloat*); void (WINE_GLAPI *p_glColor4hNV)(GLhalfNV,GLhalfNV,GLhalfNV,GLhalfNV); @@ -516,6 +540,8 @@ struct opengl_funcs void (WINE_GLAPI *p_glColor4ubVertex2fvSUN)(const GLubyte*,const GLfloat*); void (WINE_GLAPI *p_glColor4ubVertex3fSUN)(GLubyte,GLubyte,GLubyte,GLubyte,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glColor4ubVertex3fvSUN)(const GLubyte*,const GLfloat*); + void (WINE_GLAPI *p_glColor4xOES)(GLfixed,GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glColor4xvOES)(const GLfixed*); void (WINE_GLAPI *p_glColorFormatNV)(GLint,GLenum,GLsizei); void (WINE_GLAPI *p_glColorFragmentOp1ATI)(GLenum,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glColorFragmentOp2ATI)(GLenum,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint,GLuint); @@ -526,18 +552,18 @@ struct opengl_funcs void (WINE_GLAPI *p_glColorP3uiv)(GLenum,const GLuint*); void (WINE_GLAPI *p_glColorP4ui)(GLenum,GLuint); void (WINE_GLAPI *p_glColorP4uiv)(GLenum,const GLuint*); - void (WINE_GLAPI *p_glColorPointerEXT)(GLint,GLenum,GLsizei,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glColorPointerListIBM)(GLint,GLenum,GLint,const GLvoid**,GLint); - void (WINE_GLAPI *p_glColorPointervINTEL)(GLint,GLenum,const GLvoid**); - void (WINE_GLAPI *p_glColorSubTable)(GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glColorSubTableEXT)(GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glColorTable)(GLenum,GLenum,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glColorTableEXT)(GLenum,GLenum,GLsizei,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glColorPointerEXT)(GLint,GLenum,GLsizei,GLsizei,const void*); + void (WINE_GLAPI *p_glColorPointerListIBM)(GLint,GLenum,GLint,const void**,GLint); + void (WINE_GLAPI *p_glColorPointervINTEL)(GLint,GLenum,const void**); + void (WINE_GLAPI *p_glColorSubTable)(GLenum,GLsizei,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glColorSubTableEXT)(GLenum,GLsizei,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glColorTable)(GLenum,GLenum,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glColorTableEXT)(GLenum,GLenum,GLsizei,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glColorTableParameterfv)(GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glColorTableParameterfvSGI)(GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glColorTableParameteriv)(GLenum,GLenum,const GLint*); void (WINE_GLAPI *p_glColorTableParameterivSGI)(GLenum,GLenum,const GLint*); - void (WINE_GLAPI *p_glColorTableSGI)(GLenum,GLenum,GLsizei,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glColorTableSGI)(GLenum,GLenum,GLsizei,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glCombinerInputNV)(GLenum,GLenum,GLenum,GLenum,GLenum,GLenum); void (WINE_GLAPI *p_glCombinerOutputNV)(GLenum,GLenum,GLenum,GLenum,GLenum,GLenum,GLenum,GLboolean,GLboolean,GLboolean); void (WINE_GLAPI *p_glCombinerParameterfNV)(GLenum,GLfloat); @@ -547,35 +573,35 @@ struct opengl_funcs void (WINE_GLAPI *p_glCombinerStageParameterfvNV)(GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glCompileShader)(GLuint); void (WINE_GLAPI *p_glCompileShaderARB)(GLhandleARB); - void (WINE_GLAPI *p_glCompileShaderIncludeARB)(GLuint,GLsizei,const GLchar**,const GLint*); - void (WINE_GLAPI *p_glCompressedMultiTexImage1DEXT)(GLenum,GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedMultiTexImage2DEXT)(GLenum,GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedMultiTexImage3DEXT)(GLenum,GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedMultiTexSubImage1DEXT)(GLenum,GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedMultiTexSubImage2DEXT)(GLenum,GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedMultiTexSubImage3DEXT)(GLenum,GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexImage1D)(GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexImage1DARB)(GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexImage2D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexImage2DARB)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexImage3D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexImage3DARB)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexSubImage1D)(GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexSubImage1DARB)(GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexSubImage2D)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexSubImage2DARB)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTexSubImage3DARB)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTextureImage1DEXT)(GLuint,GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTextureImage2DEXT)(GLuint,GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTextureImage3DEXT)(GLuint,GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTextureSubImage1DEXT)(GLuint,GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTextureSubImage2DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glCompressedTextureSubImage3DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glConvolutionFilter1D)(GLenum,GLenum,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glConvolutionFilter1DEXT)(GLenum,GLenum,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glConvolutionFilter2D)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glConvolutionFilter2DEXT)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glCompileShaderIncludeARB)(GLuint,GLsizei,const GLchar*const*,const GLint*); + void (WINE_GLAPI *p_glCompressedMultiTexImage1DEXT)(GLenum,GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedMultiTexImage2DEXT)(GLenum,GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedMultiTexImage3DEXT)(GLenum,GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedMultiTexSubImage1DEXT)(GLenum,GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedMultiTexSubImage2DEXT)(GLenum,GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedMultiTexSubImage3DEXT)(GLenum,GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexImage1D)(GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexImage1DARB)(GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexImage2D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexImage2DARB)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexImage3D)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexImage3DARB)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexSubImage1D)(GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexSubImage1DARB)(GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexSubImage2D)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexSubImage2DARB)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTexSubImage3DARB)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTextureImage1DEXT)(GLuint,GLenum,GLint,GLenum,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTextureImage2DEXT)(GLuint,GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTextureImage3DEXT)(GLuint,GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTextureSubImage1DEXT)(GLuint,GLenum,GLint,GLint,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTextureSubImage2DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glCompressedTextureSubImage3DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glConvolutionFilter1D)(GLenum,GLenum,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glConvolutionFilter1DEXT)(GLenum,GLenum,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glConvolutionFilter2D)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glConvolutionFilter2DEXT)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glConvolutionParameterf)(GLenum,GLenum,GLfloat); void (WINE_GLAPI *p_glConvolutionParameterfEXT)(GLenum,GLenum,GLfloat); void (WINE_GLAPI *p_glConvolutionParameterfv)(GLenum,GLenum,const GLfloat*); @@ -584,6 +610,8 @@ struct opengl_funcs void (WINE_GLAPI *p_glConvolutionParameteriEXT)(GLenum,GLenum,GLint); void (WINE_GLAPI *p_glConvolutionParameteriv)(GLenum,GLenum,const GLint*); void (WINE_GLAPI *p_glConvolutionParameterivEXT)(GLenum,GLenum,const GLint*); + void (WINE_GLAPI *p_glConvolutionParameterxOES)(GLenum,GLenum,GLfixed); + void (WINE_GLAPI *p_glConvolutionParameterxvOES)(GLenum,GLenum,const GLfixed*); void (WINE_GLAPI *p_glCopyBufferSubData)(GLenum,GLenum,GLintptr,GLintptr,GLsizeiptr); void (WINE_GLAPI *p_glCopyColorSubTable)(GLenum,GLsizei,GLint,GLint,GLsizei); void (WINE_GLAPI *p_glCopyColorSubTableEXT)(GLenum,GLsizei,GLint,GLint,GLsizei); @@ -612,23 +640,23 @@ struct opengl_funcs void (WINE_GLAPI *p_glCopyTextureSubImage1DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLint,GLsizei); void (WINE_GLAPI *p_glCopyTextureSubImage2DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLint,GLint,GLsizei,GLsizei); void (WINE_GLAPI *p_glCopyTextureSubImage3DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLint,GLint,GLint,GLsizei,GLsizei); - void (WINE_GLAPI *p_glCoverFillPathInstancedNV)(GLsizei,GLenum,const GLvoid*,GLuint,GLenum,GLenum,const GLfloat*); + void (WINE_GLAPI *p_glCoverFillPathInstancedNV)(GLsizei,GLenum,const void*,GLuint,GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glCoverFillPathNV)(GLuint,GLenum); - void (WINE_GLAPI *p_glCoverStrokePathInstancedNV)(GLsizei,GLenum,const GLvoid*,GLuint,GLenum,GLenum,const GLfloat*); + void (WINE_GLAPI *p_glCoverStrokePathInstancedNV)(GLsizei,GLenum,const void*,GLuint,GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glCoverStrokePathNV)(GLuint,GLenum); GLuint (WINE_GLAPI *p_glCreateProgram)(void); GLhandleARB (WINE_GLAPI *p_glCreateProgramObjectARB)(void); GLuint (WINE_GLAPI *p_glCreateShader)(GLenum); GLhandleARB (WINE_GLAPI *p_glCreateShaderObjectARB)(GLenum); GLuint (WINE_GLAPI *p_glCreateShaderProgramEXT)(GLenum,const GLchar*); - GLuint (WINE_GLAPI *p_glCreateShaderProgramv)(GLenum,GLsizei,const GLchar* const*); - GLvoid* (WINE_GLAPI *p_glCreateSyncFromCLeventARB)(void *,void *,GLbitfield); + GLuint (WINE_GLAPI *p_glCreateShaderProgramv)(GLenum,GLsizei,const GLchar*const*); + GLsync (WINE_GLAPI *p_glCreateSyncFromCLeventARB)(void*,void*,GLbitfield); void (WINE_GLAPI *p_glCullParameterdvEXT)(GLenum,GLdouble*); void (WINE_GLAPI *p_glCullParameterfvEXT)(GLenum,GLfloat*); void (WINE_GLAPI *p_glCurrentPaletteMatrixARB)(GLint); void (WINE_GLAPI *p_glDebugMessageCallback)(void *,const void*); - void (WINE_GLAPI *p_glDebugMessageCallbackAMD)(void *,GLvoid*); - void (WINE_GLAPI *p_glDebugMessageCallbackARB)(void *,const GLvoid*); + void (WINE_GLAPI *p_glDebugMessageCallbackAMD)(void *,void*); + void (WINE_GLAPI *p_glDebugMessageCallbackARB)(void *,const void*); void (WINE_GLAPI *p_glDebugMessageControl)(GLenum,GLenum,GLenum,GLsizei,const GLuint*,GLboolean); void (WINE_GLAPI *p_glDebugMessageControlARB)(GLenum,GLenum,GLenum,GLsizei,const GLuint*,GLboolean); void (WINE_GLAPI *p_glDebugMessageEnableAMD)(GLenum,GLenum,GLsizei,const GLuint*,GLboolean); @@ -664,7 +692,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glDeleteRenderbuffersEXT)(GLsizei,const GLuint*); void (WINE_GLAPI *p_glDeleteSamplers)(GLsizei,const GLuint*); void (WINE_GLAPI *p_glDeleteShader)(GLuint); - void (WINE_GLAPI *p_glDeleteSync)(GLvoid*); + void (WINE_GLAPI *p_glDeleteSync)(GLsync); void (WINE_GLAPI *p_glDeleteTexturesEXT)(GLsizei,const GLuint*); void (WINE_GLAPI *p_glDeleteTransformFeedbacks)(GLsizei,const GLuint*); void (WINE_GLAPI *p_glDeleteTransformFeedbacksNV)(GLsizei,const GLuint*); @@ -677,20 +705,26 @@ struct opengl_funcs void (WINE_GLAPI *p_glDepthRangeIndexed)(GLuint,GLdouble,GLdouble); void (WINE_GLAPI *p_glDepthRangedNV)(GLdouble,GLdouble); void (WINE_GLAPI *p_glDepthRangef)(GLfloat,GLfloat); + void (WINE_GLAPI *p_glDepthRangefOES)(GLclampf,GLclampf); + void (WINE_GLAPI *p_glDepthRangexOES)(GLfixed,GLfixed); void (WINE_GLAPI *p_glDetachObjectARB)(GLhandleARB,GLhandleARB); void (WINE_GLAPI *p_glDetachShader)(GLuint,GLuint); void (WINE_GLAPI *p_glDetailTexFuncSGIS)(GLenum,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glDisableClientStateIndexedEXT)(GLenum,GLuint); + void (WINE_GLAPI *p_glDisableClientStateiEXT)(GLenum,GLuint); void (WINE_GLAPI *p_glDisableIndexedEXT)(GLenum,GLuint); void (WINE_GLAPI *p_glDisableVariantClientStateEXT)(GLuint); + void (WINE_GLAPI *p_glDisableVertexArrayAttribEXT)(GLuint,GLuint); + void (WINE_GLAPI *p_glDisableVertexArrayEXT)(GLuint,GLenum); void (WINE_GLAPI *p_glDisableVertexAttribAPPLE)(GLuint,GLenum); void (WINE_GLAPI *p_glDisableVertexAttribArray)(GLuint); void (WINE_GLAPI *p_glDisableVertexAttribArrayARB)(GLuint); void (WINE_GLAPI *p_glDisablei)(GLenum,GLuint); void (WINE_GLAPI *p_glDispatchCompute)(GLuint,GLuint,GLuint); + void (WINE_GLAPI *p_glDispatchComputeGroupSizeARB)(GLuint,GLuint,GLuint,GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glDispatchComputeIndirect)(GLintptr); void (WINE_GLAPI *p_glDrawArraysEXT)(GLenum,GLint,GLsizei); - void (WINE_GLAPI *p_glDrawArraysIndirect)(GLenum,const GLvoid*); + void (WINE_GLAPI *p_glDrawArraysIndirect)(GLenum,const void*); void (WINE_GLAPI *p_glDrawArraysInstanced)(GLenum,GLint,GLsizei,GLsizei); void (WINE_GLAPI *p_glDrawArraysInstancedARB)(GLenum,GLint,GLsizei,GLsizei); void (WINE_GLAPI *p_glDrawArraysInstancedBaseInstance)(GLenum,GLint,GLsizei,GLsizei,GLuint); @@ -701,20 +735,21 @@ struct opengl_funcs void (WINE_GLAPI *p_glDrawBuffersATI)(GLsizei,const GLenum*); void (WINE_GLAPI *p_glDrawElementArrayAPPLE)(GLenum,GLint,GLsizei); void (WINE_GLAPI *p_glDrawElementArrayATI)(GLenum,GLsizei); - void (WINE_GLAPI *p_glDrawElementsBaseVertex)(GLenum,GLsizei,GLenum,const GLvoid*,GLint); - void (WINE_GLAPI *p_glDrawElementsIndirect)(GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glDrawElementsInstanced)(GLenum,GLsizei,GLenum,const GLvoid*,GLsizei); - void (WINE_GLAPI *p_glDrawElementsInstancedARB)(GLenum,GLsizei,GLenum,const GLvoid*,GLsizei); + void (WINE_GLAPI *p_glDrawElementsBaseVertex)(GLenum,GLsizei,GLenum,const void*,GLint); + void (WINE_GLAPI *p_glDrawElementsIndirect)(GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glDrawElementsInstanced)(GLenum,GLsizei,GLenum,const void*,GLsizei); + void (WINE_GLAPI *p_glDrawElementsInstancedARB)(GLenum,GLsizei,GLenum,const void*,GLsizei); void (WINE_GLAPI *p_glDrawElementsInstancedBaseInstance)(GLenum,GLsizei,GLenum,const void*,GLsizei,GLuint); - void (WINE_GLAPI *p_glDrawElementsInstancedBaseVertex)(GLenum,GLsizei,GLenum,const GLvoid*,GLsizei,GLint); + void (WINE_GLAPI *p_glDrawElementsInstancedBaseVertex)(GLenum,GLsizei,GLenum,const void*,GLsizei,GLint); void (WINE_GLAPI *p_glDrawElementsInstancedBaseVertexBaseInstance)(GLenum,GLsizei,GLenum,const void*,GLsizei,GLint,GLuint); - void (WINE_GLAPI *p_glDrawElementsInstancedEXT)(GLenum,GLsizei,GLenum,const GLvoid*,GLsizei); + void (WINE_GLAPI *p_glDrawElementsInstancedEXT)(GLenum,GLsizei,GLenum,const void*,GLsizei); void (WINE_GLAPI *p_glDrawMeshArraysSUN)(GLenum,GLint,GLsizei,GLsizei); void (WINE_GLAPI *p_glDrawRangeElementArrayAPPLE)(GLenum,GLuint,GLuint,GLint,GLsizei); void (WINE_GLAPI *p_glDrawRangeElementArrayATI)(GLenum,GLuint,GLuint,GLsizei); - void (WINE_GLAPI *p_glDrawRangeElements)(GLenum,GLuint,GLuint,GLsizei,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glDrawRangeElementsBaseVertex)(GLenum,GLuint,GLuint,GLsizei,GLenum,const GLvoid*,GLint); - void (WINE_GLAPI *p_glDrawRangeElementsEXT)(GLenum,GLuint,GLuint,GLsizei,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glDrawRangeElements)(GLenum,GLuint,GLuint,GLsizei,GLenum,const void*); + void (WINE_GLAPI *p_glDrawRangeElementsBaseVertex)(GLenum,GLuint,GLuint,GLsizei,GLenum,const void*,GLint); + void (WINE_GLAPI *p_glDrawRangeElementsEXT)(GLenum,GLuint,GLuint,GLsizei,GLenum,const void*); + void (WINE_GLAPI *p_glDrawTextureNV)(GLuint,GLuint,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glDrawTransformFeedback)(GLenum,GLuint); void (WINE_GLAPI *p_glDrawTransformFeedbackInstanced)(GLenum,GLuint,GLsizei); void (WINE_GLAPI *p_glDrawTransformFeedbackNV)(GLenum,GLuint); @@ -723,17 +758,21 @@ struct opengl_funcs void (WINE_GLAPI *p_glEdgeFlagFormatNV)(GLsizei); void (WINE_GLAPI *p_glEdgeFlagPointerEXT)(GLsizei,GLsizei,const GLboolean*); void (WINE_GLAPI *p_glEdgeFlagPointerListIBM)(GLint,const GLboolean**,GLint); - void (WINE_GLAPI *p_glElementPointerAPPLE)(GLenum,const GLvoid*); - void (WINE_GLAPI *p_glElementPointerATI)(GLenum,const GLvoid*); + void (WINE_GLAPI *p_glElementPointerAPPLE)(GLenum,const void*); + void (WINE_GLAPI *p_glElementPointerATI)(GLenum,const void*); void (WINE_GLAPI *p_glEnableClientStateIndexedEXT)(GLenum,GLuint); + void (WINE_GLAPI *p_glEnableClientStateiEXT)(GLenum,GLuint); void (WINE_GLAPI *p_glEnableIndexedEXT)(GLenum,GLuint); void (WINE_GLAPI *p_glEnableVariantClientStateEXT)(GLuint); + void (WINE_GLAPI *p_glEnableVertexArrayAttribEXT)(GLuint,GLuint); + void (WINE_GLAPI *p_glEnableVertexArrayEXT)(GLuint,GLenum); void (WINE_GLAPI *p_glEnableVertexAttribAPPLE)(GLuint,GLenum); void (WINE_GLAPI *p_glEnableVertexAttribArray)(GLuint); void (WINE_GLAPI *p_glEnableVertexAttribArrayARB)(GLuint); void (WINE_GLAPI *p_glEnablei)(GLenum,GLuint); void (WINE_GLAPI *p_glEndConditionalRender)(void); void (WINE_GLAPI *p_glEndConditionalRenderNV)(void); + void (WINE_GLAPI *p_glEndConditionalRenderNVX)(void); void (WINE_GLAPI *p_glEndFragmentShaderATI)(void); void (WINE_GLAPI *p_glEndOcclusionQueryNV)(void); void (WINE_GLAPI *p_glEndPerfMonitorAMD)(GLuint); @@ -745,10 +784,15 @@ struct opengl_funcs void (WINE_GLAPI *p_glEndTransformFeedbackNV)(void); void (WINE_GLAPI *p_glEndVertexShaderEXT)(void); void (WINE_GLAPI *p_glEndVideoCaptureNV)(GLuint); + void (WINE_GLAPI *p_glEvalCoord1xOES)(GLfixed); + void (WINE_GLAPI *p_glEvalCoord1xvOES)(const GLfixed*); + void (WINE_GLAPI *p_glEvalCoord2xOES)(GLfixed,GLfixed); + void (WINE_GLAPI *p_glEvalCoord2xvOES)(const GLfixed*); void (WINE_GLAPI *p_glEvalMapsNV)(GLenum,GLenum); void (WINE_GLAPI *p_glExecuteProgramNV)(GLenum,GLuint,const GLfloat*); void (WINE_GLAPI *p_glExtractComponentEXT)(GLuint,GLuint,GLuint); - GLvoid* (WINE_GLAPI *p_glFenceSync)(GLenum,GLbitfield); + void (WINE_GLAPI *p_glFeedbackBufferxOES)(GLsizei,GLenum,const GLfixed*); + GLsync (WINE_GLAPI *p_glFenceSync)(GLenum,GLbitfield); void (WINE_GLAPI *p_glFinalCombinerInputNV)(GLenum,GLenum,GLenum,GLenum); GLint (WINE_GLAPI *p_glFinishAsyncSGIX)(GLuint*); void (WINE_GLAPI *p_glFinishFenceAPPLE)(GLuint); @@ -760,12 +804,13 @@ struct opengl_funcs void (WINE_GLAPI *p_glFlushMappedNamedBufferRangeEXT)(GLuint,GLintptr,GLsizeiptr); void (WINE_GLAPI *p_glFlushPixelDataRangeNV)(GLenum); void (WINE_GLAPI *p_glFlushRasterSGIX)(void); - void (WINE_GLAPI *p_glFlushVertexArrayRangeAPPLE)(GLsizei,GLvoid*); + void (WINE_GLAPI *p_glFlushStaticDataIBM)(GLenum); + void (WINE_GLAPI *p_glFlushVertexArrayRangeAPPLE)(GLsizei,void*); void (WINE_GLAPI *p_glFlushVertexArrayRangeNV)(void); void (WINE_GLAPI *p_glFogCoordFormatNV)(GLenum,GLsizei); - void (WINE_GLAPI *p_glFogCoordPointer)(GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glFogCoordPointerEXT)(GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glFogCoordPointerListIBM)(GLenum,GLint,const GLvoid**,GLint); + void (WINE_GLAPI *p_glFogCoordPointer)(GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glFogCoordPointerEXT)(GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glFogCoordPointerListIBM)(GLenum,GLint,const void**,GLint); void (WINE_GLAPI *p_glFogCoordd)(GLdouble); void (WINE_GLAPI *p_glFogCoorddEXT)(GLdouble); void (WINE_GLAPI *p_glFogCoorddv)(const GLdouble*); @@ -777,6 +822,8 @@ struct opengl_funcs void (WINE_GLAPI *p_glFogCoordhNV)(GLhalfNV); void (WINE_GLAPI *p_glFogCoordhvNV)(const GLhalfNV*); void (WINE_GLAPI *p_glFogFuncSGIS)(GLsizei,const GLfloat*); + void (WINE_GLAPI *p_glFogxOES)(GLenum,GLfixed); + void (WINE_GLAPI *p_glFogxvOES)(GLenum,const GLfixed*); void (WINE_GLAPI *p_glFragmentColorMaterialSGIX)(GLenum,GLenum); void (WINE_GLAPI *p_glFragmentLightModelfSGIX)(GLenum,GLfloat); void (WINE_GLAPI *p_glFragmentLightModelfvSGIX)(GLenum,const GLfloat*); @@ -813,6 +860,8 @@ struct opengl_funcs void (WINE_GLAPI *p_glFramebufferTextureLayerARB)(GLenum,GLenum,GLuint,GLint,GLint); void (WINE_GLAPI *p_glFramebufferTextureLayerEXT)(GLenum,GLenum,GLuint,GLint,GLint); void (WINE_GLAPI *p_glFreeObjectBufferATI)(GLuint); + void (WINE_GLAPI *p_glFrustumfOES)(GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); + void (WINE_GLAPI *p_glFrustumxOES)(GLfixed,GLfixed,GLfixed,GLfixed,GLfixed,GLfixed); GLuint (WINE_GLAPI *p_glGenAsyncMarkersSGIX)(GLsizei); void (WINE_GLAPI *p_glGenBuffers)(GLsizei,GLuint*); void (WINE_GLAPI *p_glGenBuffersARB)(GLsizei,GLuint*); @@ -865,49 +914,55 @@ struct opengl_funcs GLint (WINE_GLAPI *p_glGetAttribLocationARB)(GLhandleARB,const GLcharARB*); void (WINE_GLAPI *p_glGetBooleanIndexedvEXT)(GLenum,GLuint,GLboolean*); void (WINE_GLAPI *p_glGetBooleani_v)(GLenum,GLuint,GLboolean*); - void (WINE_GLAPI *p_glGetBufferParameteri64v)(GLenum,GLenum,INT64*); + void (WINE_GLAPI *p_glGetBufferParameteri64v)(GLenum,GLenum,GLint64*); void (WINE_GLAPI *p_glGetBufferParameteriv)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetBufferParameterivARB)(GLenum,GLenum,GLint*); - void (WINE_GLAPI *p_glGetBufferParameterui64vNV)(GLenum,GLenum,UINT64*); - void (WINE_GLAPI *p_glGetBufferPointerv)(GLenum,GLenum,GLvoid**); - void (WINE_GLAPI *p_glGetBufferPointervARB)(GLenum,GLenum,GLvoid**); - void (WINE_GLAPI *p_glGetBufferSubData)(GLenum,GLintptr,GLsizeiptr,GLvoid*); - void (WINE_GLAPI *p_glGetBufferSubDataARB)(GLenum,GLintptrARB,GLsizeiptrARB,GLvoid*); - void (WINE_GLAPI *p_glGetColorTable)(GLenum,GLenum,GLenum,GLvoid*); - void (WINE_GLAPI *p_glGetColorTableEXT)(GLenum,GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetBufferParameterui64vNV)(GLenum,GLenum,GLuint64EXT*); + void (WINE_GLAPI *p_glGetBufferPointerv)(GLenum,GLenum,void**); + void (WINE_GLAPI *p_glGetBufferPointervARB)(GLenum,GLenum,void**); + void (WINE_GLAPI *p_glGetBufferSubData)(GLenum,GLintptr,GLsizeiptr,void*); + void (WINE_GLAPI *p_glGetBufferSubDataARB)(GLenum,GLintptrARB,GLsizeiptrARB,void*); + void (WINE_GLAPI *p_glGetClipPlanefOES)(GLenum,GLfloat*); + void (WINE_GLAPI *p_glGetClipPlanexOES)(GLenum,GLfixed*); + void (WINE_GLAPI *p_glGetColorTable)(GLenum,GLenum,GLenum,void*); + void (WINE_GLAPI *p_glGetColorTableEXT)(GLenum,GLenum,GLenum,void*); void (WINE_GLAPI *p_glGetColorTableParameterfv)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetColorTableParameterfvEXT)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetColorTableParameterfvSGI)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetColorTableParameteriv)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetColorTableParameterivEXT)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetColorTableParameterivSGI)(GLenum,GLenum,GLint*); - void (WINE_GLAPI *p_glGetColorTableSGI)(GLenum,GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetColorTableSGI)(GLenum,GLenum,GLenum,void*); void (WINE_GLAPI *p_glGetCombinerInputParameterfvNV)(GLenum,GLenum,GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetCombinerInputParameterivNV)(GLenum,GLenum,GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetCombinerOutputParameterfvNV)(GLenum,GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetCombinerOutputParameterivNV)(GLenum,GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetCombinerStageParameterfvNV)(GLenum,GLenum,GLfloat*); - void (WINE_GLAPI *p_glGetCompressedMultiTexImageEXT)(GLenum,GLenum,GLint,GLvoid*); - void (WINE_GLAPI *p_glGetCompressedTexImage)(GLenum,GLint,GLvoid*); - void (WINE_GLAPI *p_glGetCompressedTexImageARB)(GLenum,GLint,GLvoid*); - void (WINE_GLAPI *p_glGetCompressedTextureImageEXT)(GLuint,GLenum,GLint,GLvoid*); - void (WINE_GLAPI *p_glGetConvolutionFilter)(GLenum,GLenum,GLenum,GLvoid*); - void (WINE_GLAPI *p_glGetConvolutionFilterEXT)(GLenum,GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetCompressedMultiTexImageEXT)(GLenum,GLenum,GLint,void*); + void (WINE_GLAPI *p_glGetCompressedTexImage)(GLenum,GLint,void*); + void (WINE_GLAPI *p_glGetCompressedTexImageARB)(GLenum,GLint,void*); + void (WINE_GLAPI *p_glGetCompressedTextureImageEXT)(GLuint,GLenum,GLint,void*); + void (WINE_GLAPI *p_glGetConvolutionFilter)(GLenum,GLenum,GLenum,void*); + void (WINE_GLAPI *p_glGetConvolutionFilterEXT)(GLenum,GLenum,GLenum,void*); void (WINE_GLAPI *p_glGetConvolutionParameterfv)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetConvolutionParameterfvEXT)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetConvolutionParameteriv)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetConvolutionParameterivEXT)(GLenum,GLenum,GLint*); + void (WINE_GLAPI *p_glGetConvolutionParameterxvOES)(GLenum,GLenum,GLfixed*); GLuint (WINE_GLAPI *p_glGetDebugMessageLog)(GLuint,GLsizei,GLenum*,GLenum*,GLuint*,GLenum*,GLsizei*,GLchar*); GLuint (WINE_GLAPI *p_glGetDebugMessageLogAMD)(GLuint,GLsizei,GLenum*,GLuint*,GLuint*,GLsizei*,GLchar*); GLuint (WINE_GLAPI *p_glGetDebugMessageLogARB)(GLuint,GLsizei,GLenum*,GLenum*,GLuint*,GLenum*,GLsizei*,GLchar*); void (WINE_GLAPI *p_glGetDetailTexFuncSGIS)(GLenum,GLfloat*); void (WINE_GLAPI *p_glGetDoubleIndexedvEXT)(GLenum,GLuint,GLdouble*); void (WINE_GLAPI *p_glGetDoublei_v)(GLenum,GLuint,GLdouble*); + void (WINE_GLAPI *p_glGetDoublei_vEXT)(GLenum,GLuint,GLdouble*); void (WINE_GLAPI *p_glGetFenceivNV)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetFinalCombinerInputParameterfvNV)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetFinalCombinerInputParameterivNV)(GLenum,GLenum,GLint*); + void (WINE_GLAPI *p_glGetFixedvOES)(GLenum,GLfixed*); void (WINE_GLAPI *p_glGetFloatIndexedvEXT)(GLenum,GLuint,GLfloat*); void (WINE_GLAPI *p_glGetFloati_v)(GLenum,GLuint,GLfloat*); + void (WINE_GLAPI *p_glGetFloati_vEXT)(GLenum,GLuint,GLfloat*); void (WINE_GLAPI *p_glGetFogFuncSGIS)(GLfloat*); GLint (WINE_GLAPI *p_glGetFragDataIndex)(GLuint,const GLchar*); GLint (WINE_GLAPI *p_glGetFragDataLocation)(GLuint,const GLchar*); @@ -922,28 +977,31 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetFramebufferParameterivEXT)(GLuint,GLenum,GLint*); GLenum (WINE_GLAPI *p_glGetGraphicsResetStatusARB)(void); GLhandleARB (WINE_GLAPI *p_glGetHandleARB)(GLenum); - void (WINE_GLAPI *p_glGetHistogram)(GLenum,GLboolean,GLenum,GLenum,GLvoid*); - void (WINE_GLAPI *p_glGetHistogramEXT)(GLenum,GLboolean,GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetHistogram)(GLenum,GLboolean,GLenum,GLenum,void*); + void (WINE_GLAPI *p_glGetHistogramEXT)(GLenum,GLboolean,GLenum,GLenum,void*); void (WINE_GLAPI *p_glGetHistogramParameterfv)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetHistogramParameterfvEXT)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetHistogramParameteriv)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetHistogramParameterivEXT)(GLenum,GLenum,GLint*); - UINT64 (WINE_GLAPI *p_glGetImageHandleNV)(GLuint,GLint,GLboolean,GLint,GLenum); + void (WINE_GLAPI *p_glGetHistogramParameterxvOES)(GLenum,GLenum,GLfixed*); + GLuint64 (WINE_GLAPI *p_glGetImageHandleARB)(GLuint,GLint,GLboolean,GLint,GLenum); + GLuint64 (WINE_GLAPI *p_glGetImageHandleNV)(GLuint,GLint,GLboolean,GLint,GLenum); void (WINE_GLAPI *p_glGetImageTransformParameterfvHP)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetImageTransformParameterivHP)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetInfoLogARB)(GLhandleARB,GLsizei,GLsizei*,GLcharARB*); GLint (WINE_GLAPI *p_glGetInstrumentsSGIX)(void); - void (WINE_GLAPI *p_glGetInteger64i_v)(GLenum,GLuint,INT64*); - void (WINE_GLAPI *p_glGetInteger64v)(GLenum,INT64*); + void (WINE_GLAPI *p_glGetInteger64i_v)(GLenum,GLuint,GLint64*); + void (WINE_GLAPI *p_glGetInteger64v)(GLenum,GLint64*); void (WINE_GLAPI *p_glGetIntegerIndexedvEXT)(GLenum,GLuint,GLint*); void (WINE_GLAPI *p_glGetIntegeri_v)(GLenum,GLuint,GLint*); - void (WINE_GLAPI *p_glGetIntegerui64i_vNV)(GLenum,GLuint,UINT64*); - void (WINE_GLAPI *p_glGetIntegerui64vNV)(GLenum,UINT64*); - void (WINE_GLAPI *p_glGetInternalformati64v)(GLenum,GLenum,GLenum,GLsizei,INT64*); + void (WINE_GLAPI *p_glGetIntegerui64i_vNV)(GLenum,GLuint,GLuint64EXT*); + void (WINE_GLAPI *p_glGetIntegerui64vNV)(GLenum,GLuint64EXT*); + void (WINE_GLAPI *p_glGetInternalformati64v)(GLenum,GLenum,GLenum,GLsizei,GLint64*); void (WINE_GLAPI *p_glGetInternalformativ)(GLenum,GLenum,GLenum,GLsizei,GLint*); void (WINE_GLAPI *p_glGetInvariantBooleanvEXT)(GLuint,GLenum,GLboolean*); void (WINE_GLAPI *p_glGetInvariantFloatvEXT)(GLuint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetInvariantIntegervEXT)(GLuint,GLenum,GLint*); + void (WINE_GLAPI *p_glGetLightxOES)(GLenum,GLenum,GLfixed*); void (WINE_GLAPI *p_glGetListParameterfvSGIX)(GLuint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetListParameterivSGIX)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetLocalConstantBooleanvEXT)(GLuint,GLenum,GLboolean*); @@ -951,11 +1009,13 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetLocalConstantIntegervEXT)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetMapAttribParameterfvNV)(GLenum,GLuint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetMapAttribParameterivNV)(GLenum,GLuint,GLenum,GLint*); - void (WINE_GLAPI *p_glGetMapControlPointsNV)(GLenum,GLuint,GLenum,GLsizei,GLsizei,GLboolean,GLvoid*); + void (WINE_GLAPI *p_glGetMapControlPointsNV)(GLenum,GLuint,GLenum,GLsizei,GLsizei,GLboolean,void*); void (WINE_GLAPI *p_glGetMapParameterfvNV)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetMapParameterivNV)(GLenum,GLenum,GLint*); - void (WINE_GLAPI *p_glGetMinmax)(GLenum,GLboolean,GLenum,GLenum,GLvoid*); - void (WINE_GLAPI *p_glGetMinmaxEXT)(GLenum,GLboolean,GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetMapxvOES)(GLenum,GLenum,GLfixed*); + void (WINE_GLAPI *p_glGetMaterialxOES)(GLenum,GLenum,GLfixed); + void (WINE_GLAPI *p_glGetMinmax)(GLenum,GLboolean,GLenum,GLenum,void*); + void (WINE_GLAPI *p_glGetMinmaxEXT)(GLenum,GLboolean,GLenum,GLenum,void*); void (WINE_GLAPI *p_glGetMinmaxParameterfv)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetMinmaxParameterfvEXT)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetMinmaxParameteriv)(GLenum,GLenum,GLint*); @@ -965,7 +1025,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetMultiTexGendvEXT)(GLenum,GLenum,GLenum,GLdouble*); void (WINE_GLAPI *p_glGetMultiTexGenfvEXT)(GLenum,GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetMultiTexGenivEXT)(GLenum,GLenum,GLenum,GLint*); - void (WINE_GLAPI *p_glGetMultiTexImageEXT)(GLenum,GLenum,GLint,GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetMultiTexImageEXT)(GLenum,GLenum,GLint,GLenum,GLenum,void*); void (WINE_GLAPI *p_glGetMultiTexLevelParameterfvEXT)(GLenum,GLenum,GLint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetMultiTexLevelParameterivEXT)(GLenum,GLenum,GLint,GLenum,GLint*); void (WINE_GLAPI *p_glGetMultiTexParameterIivEXT)(GLenum,GLenum,GLenum,GLint*); @@ -975,16 +1035,16 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetMultisamplefv)(GLenum,GLuint,GLfloat*); void (WINE_GLAPI *p_glGetMultisamplefvNV)(GLenum,GLuint,GLfloat*); void (WINE_GLAPI *p_glGetNamedBufferParameterivEXT)(GLuint,GLenum,GLint*); - void (WINE_GLAPI *p_glGetNamedBufferParameterui64vNV)(GLuint,GLenum,UINT64*); - void (WINE_GLAPI *p_glGetNamedBufferPointervEXT)(GLuint,GLenum,GLvoid**); - void (WINE_GLAPI *p_glGetNamedBufferSubDataEXT)(GLuint,GLintptr,GLsizeiptr,GLvoid*); + void (WINE_GLAPI *p_glGetNamedBufferParameterui64vNV)(GLuint,GLenum,GLuint64EXT*); + void (WINE_GLAPI *p_glGetNamedBufferPointervEXT)(GLuint,GLenum,void**); + void (WINE_GLAPI *p_glGetNamedBufferSubDataEXT)(GLuint,GLintptr,GLsizeiptr,void*); void (WINE_GLAPI *p_glGetNamedFramebufferAttachmentParameterivEXT)(GLuint,GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetNamedFramebufferParameterivEXT)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetNamedProgramLocalParameterIivEXT)(GLuint,GLenum,GLuint,GLint*); void (WINE_GLAPI *p_glGetNamedProgramLocalParameterIuivEXT)(GLuint,GLenum,GLuint,GLuint*); void (WINE_GLAPI *p_glGetNamedProgramLocalParameterdvEXT)(GLuint,GLenum,GLuint,GLdouble*); void (WINE_GLAPI *p_glGetNamedProgramLocalParameterfvEXT)(GLuint,GLenum,GLuint,GLfloat*); - void (WINE_GLAPI *p_glGetNamedProgramStringEXT)(GLuint,GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetNamedProgramStringEXT)(GLuint,GLenum,GLenum,void*); void (WINE_GLAPI *p_glGetNamedProgramivEXT)(GLuint,GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetNamedRenderbufferParameterivEXT)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetNamedStringARB)(GLint,const GLchar*,GLsizei,GLint*,GLchar*); @@ -992,6 +1052,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetObjectBufferfvATI)(GLuint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetObjectBufferivATI)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetObjectLabel)(GLenum,GLuint,GLsizei,GLsizei*,GLchar*); + void (WINE_GLAPI *p_glGetObjectLabelEXT)(GLenum,GLuint,GLsizei,GLsizei*,GLchar*); void (WINE_GLAPI *p_glGetObjectParameterfvARB)(GLhandleARB,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetObjectParameterivAPPLE)(GLenum,GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetObjectParameterivARB)(GLhandleARB,GLenum,GLint*); @@ -1005,25 +1066,27 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetPathDashArrayNV)(GLuint,GLfloat*); GLfloat (WINE_GLAPI *p_glGetPathLengthNV)(GLuint,GLsizei,GLsizei); void (WINE_GLAPI *p_glGetPathMetricRangeNV)(GLbitfield,GLuint,GLsizei,GLsizei,GLfloat*); - void (WINE_GLAPI *p_glGetPathMetricsNV)(GLbitfield,GLsizei,GLenum,const GLvoid*,GLuint,GLsizei,GLfloat*); + void (WINE_GLAPI *p_glGetPathMetricsNV)(GLbitfield,GLsizei,GLenum,const void*,GLuint,GLsizei,GLfloat*); void (WINE_GLAPI *p_glGetPathParameterfvNV)(GLuint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetPathParameterivNV)(GLuint,GLenum,GLint*); - void (WINE_GLAPI *p_glGetPathSpacingNV)(GLenum,GLsizei,GLenum,const GLvoid*,GLuint,GLfloat,GLfloat,GLenum,GLfloat*); + void (WINE_GLAPI *p_glGetPathSpacingNV)(GLenum,GLsizei,GLenum,const void*,GLuint,GLfloat,GLfloat,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetPathTexGenfvNV)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetPathTexGenivNV)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetPerfMonitorCounterDataAMD)(GLuint,GLenum,GLsizei,GLuint*,GLint*); - void (WINE_GLAPI *p_glGetPerfMonitorCounterInfoAMD)(GLuint,GLuint,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetPerfMonitorCounterInfoAMD)(GLuint,GLuint,GLenum,void*); void (WINE_GLAPI *p_glGetPerfMonitorCounterStringAMD)(GLuint,GLuint,GLsizei,GLsizei*,GLchar*); void (WINE_GLAPI *p_glGetPerfMonitorCountersAMD)(GLuint,GLint*,GLint*,GLsizei,GLuint*); void (WINE_GLAPI *p_glGetPerfMonitorGroupStringAMD)(GLuint,GLsizei,GLsizei*,GLchar*); void (WINE_GLAPI *p_glGetPerfMonitorGroupsAMD)(GLint*,GLsizei,GLuint*); + void (WINE_GLAPI *p_glGetPixelMapxv)(GLenum,GLint,GLfixed*); void (WINE_GLAPI *p_glGetPixelTexGenParameterfvSGIS)(GLenum,GLfloat*); void (WINE_GLAPI *p_glGetPixelTexGenParameterivSGIS)(GLenum,GLint*); void (WINE_GLAPI *p_glGetPixelTransformParameterfvEXT)(GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetPixelTransformParameterivEXT)(GLenum,GLenum,GLint*); - void (WINE_GLAPI *p_glGetPointerIndexedvEXT)(GLenum,GLuint,GLvoid**); - void (WINE_GLAPI *p_glGetPointervEXT)(GLenum,GLvoid**); - void (WINE_GLAPI *p_glGetProgramBinary)(GLuint,GLsizei,GLsizei*,GLenum*,GLvoid*); + void (WINE_GLAPI *p_glGetPointerIndexedvEXT)(GLenum,GLuint,void**); + void (WINE_GLAPI *p_glGetPointeri_vEXT)(GLenum,GLuint,void**); + void (WINE_GLAPI *p_glGetPointervEXT)(GLenum,void**); + void (WINE_GLAPI *p_glGetProgramBinary)(GLuint,GLsizei,GLsizei*,GLenum*,void*); void (WINE_GLAPI *p_glGetProgramEnvParameterIivNV)(GLenum,GLuint,GLint*); void (WINE_GLAPI *p_glGetProgramEnvParameterIuivNV)(GLenum,GLuint,GLuint*); void (WINE_GLAPI *p_glGetProgramEnvParameterdvARB)(GLenum,GLuint,GLdouble*); @@ -1046,19 +1109,19 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetProgramResourceName)(GLuint,GLenum,GLuint,GLsizei,GLsizei*,GLchar*); void (WINE_GLAPI *p_glGetProgramResourceiv)(GLuint,GLenum,GLuint,GLsizei,const GLenum*,GLsizei,GLsizei*,GLint*); void (WINE_GLAPI *p_glGetProgramStageiv)(GLuint,GLenum,GLenum,GLint*); - void (WINE_GLAPI *p_glGetProgramStringARB)(GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetProgramStringARB)(GLenum,GLenum,void*); void (WINE_GLAPI *p_glGetProgramStringNV)(GLuint,GLenum,GLubyte*); void (WINE_GLAPI *p_glGetProgramSubroutineParameteruivNV)(GLenum,GLuint,GLuint*); void (WINE_GLAPI *p_glGetProgramiv)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetProgramivARB)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetProgramivNV)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetQueryIndexediv)(GLenum,GLuint,GLenum,GLint*); - void (WINE_GLAPI *p_glGetQueryObjecti64v)(GLuint,GLenum,INT64*); - void (WINE_GLAPI *p_glGetQueryObjecti64vEXT)(GLuint,GLenum,INT64*); + void (WINE_GLAPI *p_glGetQueryObjecti64v)(GLuint,GLenum,GLint64*); + void (WINE_GLAPI *p_glGetQueryObjecti64vEXT)(GLuint,GLenum,GLint64*); void (WINE_GLAPI *p_glGetQueryObjectiv)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetQueryObjectivARB)(GLuint,GLenum,GLint*); - void (WINE_GLAPI *p_glGetQueryObjectui64v)(GLuint,GLenum,UINT64*); - void (WINE_GLAPI *p_glGetQueryObjectui64vEXT)(GLuint,GLenum,UINT64*); + void (WINE_GLAPI *p_glGetQueryObjectui64v)(GLuint,GLenum,GLuint64*); + void (WINE_GLAPI *p_glGetQueryObjectui64vEXT)(GLuint,GLenum,GLuint64*); void (WINE_GLAPI *p_glGetQueryObjectuiv)(GLuint,GLenum,GLuint*); void (WINE_GLAPI *p_glGetQueryObjectuivARB)(GLuint,GLenum,GLuint*); void (WINE_GLAPI *p_glGetQueryiv)(GLenum,GLenum,GLint*); @@ -1069,42 +1132,48 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetSamplerParameterIuiv)(GLuint,GLenum,GLuint*); void (WINE_GLAPI *p_glGetSamplerParameterfv)(GLuint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetSamplerParameteriv)(GLuint,GLenum,GLint*); - void (WINE_GLAPI *p_glGetSeparableFilter)(GLenum,GLenum,GLenum,GLvoid*,GLvoid*,GLvoid*); - void (WINE_GLAPI *p_glGetSeparableFilterEXT)(GLenum,GLenum,GLenum,GLvoid*,GLvoid*,GLvoid*); + void (WINE_GLAPI *p_glGetSeparableFilter)(GLenum,GLenum,GLenum,void*,void*,void*); + void (WINE_GLAPI *p_glGetSeparableFilterEXT)(GLenum,GLenum,GLenum,void*,void*,void*); void (WINE_GLAPI *p_glGetShaderInfoLog)(GLuint,GLsizei,GLsizei*,GLchar*); void (WINE_GLAPI *p_glGetShaderPrecisionFormat)(GLenum,GLenum,GLint*,GLint*); void (WINE_GLAPI *p_glGetShaderSource)(GLuint,GLsizei,GLsizei*,GLchar*); void (WINE_GLAPI *p_glGetShaderSourceARB)(GLhandleARB,GLsizei,GLsizei*,GLcharARB*); void (WINE_GLAPI *p_glGetShaderiv)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetSharpenTexFuncSGIS)(GLenum,GLfloat*); - const GLubyte * (WINE_GLAPI *p_glGetStringi)(GLenum,GLuint); + const GLubyte* (WINE_GLAPI *p_glGetStringi)(GLenum,GLuint); GLuint (WINE_GLAPI *p_glGetSubroutineIndex)(GLuint,GLenum,const GLchar*); GLint (WINE_GLAPI *p_glGetSubroutineUniformLocation)(GLuint,GLenum,const GLchar*); - void (WINE_GLAPI *p_glGetSynciv)(GLvoid*,GLenum,GLsizei,GLsizei*,GLint*); + void (WINE_GLAPI *p_glGetSynciv)(GLsync,GLenum,GLsizei,GLsizei*,GLint*); void (WINE_GLAPI *p_glGetTexBumpParameterfvATI)(GLenum,GLfloat*); void (WINE_GLAPI *p_glGetTexBumpParameterivATI)(GLenum,GLint*); + void (WINE_GLAPI *p_glGetTexEnvxvOES)(GLenum,GLenum,GLfixed*); void (WINE_GLAPI *p_glGetTexFilterFuncSGIS)(GLenum,GLenum,GLfloat*); + void (WINE_GLAPI *p_glGetTexGenxvOES)(GLenum,GLenum,GLfixed*); + void (WINE_GLAPI *p_glGetTexLevelParameterxvOES)(GLenum,GLint,GLenum,GLfixed*); void (WINE_GLAPI *p_glGetTexParameterIiv)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetTexParameterIivEXT)(GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetTexParameterIuiv)(GLenum,GLenum,GLuint*); void (WINE_GLAPI *p_glGetTexParameterIuivEXT)(GLenum,GLenum,GLuint*); - void (WINE_GLAPI *p_glGetTexParameterPointervAPPLE)(GLenum,GLenum,GLvoid**); - UINT64 (WINE_GLAPI *p_glGetTextureHandleNV)(GLuint); - void (WINE_GLAPI *p_glGetTextureImageEXT)(GLuint,GLenum,GLint,GLenum,GLenum,GLvoid*); + void (WINE_GLAPI *p_glGetTexParameterPointervAPPLE)(GLenum,GLenum,void**); + void (WINE_GLAPI *p_glGetTexParameterxvOES)(GLenum,GLenum,GLfixed*); + GLuint64 (WINE_GLAPI *p_glGetTextureHandleARB)(GLuint); + GLuint64 (WINE_GLAPI *p_glGetTextureHandleNV)(GLuint); + void (WINE_GLAPI *p_glGetTextureImageEXT)(GLuint,GLenum,GLint,GLenum,GLenum,void*); void (WINE_GLAPI *p_glGetTextureLevelParameterfvEXT)(GLuint,GLenum,GLint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetTextureLevelParameterivEXT)(GLuint,GLenum,GLint,GLenum,GLint*); void (WINE_GLAPI *p_glGetTextureParameterIivEXT)(GLuint,GLenum,GLenum,GLint*); void (WINE_GLAPI *p_glGetTextureParameterIuivEXT)(GLuint,GLenum,GLenum,GLuint*); void (WINE_GLAPI *p_glGetTextureParameterfvEXT)(GLuint,GLenum,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetTextureParameterivEXT)(GLuint,GLenum,GLenum,GLint*); - UINT64 (WINE_GLAPI *p_glGetTextureSamplerHandleNV)(GLuint,GLuint); + GLuint64 (WINE_GLAPI *p_glGetTextureSamplerHandleARB)(GLuint,GLuint); + GLuint64 (WINE_GLAPI *p_glGetTextureSamplerHandleNV)(GLuint,GLuint); void (WINE_GLAPI *p_glGetTrackMatrixivNV)(GLenum,GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetTransformFeedbackVarying)(GLuint,GLuint,GLsizei,GLsizei*,GLsizei*,GLenum*,GLchar*); void (WINE_GLAPI *p_glGetTransformFeedbackVaryingEXT)(GLuint,GLuint,GLsizei,GLsizei*,GLsizei*,GLenum*,GLchar*); void (WINE_GLAPI *p_glGetTransformFeedbackVaryingNV)(GLuint,GLuint,GLint*); GLuint (WINE_GLAPI *p_glGetUniformBlockIndex)(GLuint,const GLchar*); GLint (WINE_GLAPI *p_glGetUniformBufferSizeEXT)(GLuint,GLint); - void (WINE_GLAPI *p_glGetUniformIndices)(GLuint,GLsizei,const GLchar* const*,GLuint*); + void (WINE_GLAPI *p_glGetUniformIndices)(GLuint,GLsizei,const GLchar*const*,GLuint*); GLint (WINE_GLAPI *p_glGetUniformLocation)(GLuint,const GLchar*); GLint (WINE_GLAPI *p_glGetUniformLocationARB)(GLhandleARB,const GLcharARB*); GLintptr (WINE_GLAPI *p_glGetUniformOffsetEXT)(GLuint,GLint); @@ -1112,10 +1181,10 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetUniformdv)(GLuint,GLint,GLdouble*); void (WINE_GLAPI *p_glGetUniformfv)(GLuint,GLint,GLfloat*); void (WINE_GLAPI *p_glGetUniformfvARB)(GLhandleARB,GLint,GLfloat*); - void (WINE_GLAPI *p_glGetUniformi64vNV)(GLuint,GLint,INT64*); + void (WINE_GLAPI *p_glGetUniformi64vNV)(GLuint,GLint,GLint64EXT*); void (WINE_GLAPI *p_glGetUniformiv)(GLuint,GLint,GLint*); void (WINE_GLAPI *p_glGetUniformivARB)(GLhandleARB,GLint,GLint*); - void (WINE_GLAPI *p_glGetUniformui64vNV)(GLuint,GLint,UINT64*); + void (WINE_GLAPI *p_glGetUniformui64vNV)(GLuint,GLint,GLuint64EXT*); void (WINE_GLAPI *p_glGetUniformuiv)(GLuint,GLint,GLuint*); void (WINE_GLAPI *p_glGetUniformuivEXT)(GLuint,GLint,GLuint*); void (WINE_GLAPI *p_glGetVariantArrayObjectfvATI)(GLuint,GLenum,GLfloat*); @@ -1123,8 +1192,12 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetVariantBooleanvEXT)(GLuint,GLenum,GLboolean*); void (WINE_GLAPI *p_glGetVariantFloatvEXT)(GLuint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetVariantIntegervEXT)(GLuint,GLenum,GLint*); - void (WINE_GLAPI *p_glGetVariantPointervEXT)(GLuint,GLenum,GLvoid**); + void (WINE_GLAPI *p_glGetVariantPointervEXT)(GLuint,GLenum,void**); GLint (WINE_GLAPI *p_glGetVaryingLocationNV)(GLuint,const GLchar*); + void (WINE_GLAPI *p_glGetVertexArrayIntegeri_vEXT)(GLuint,GLuint,GLenum,GLint*); + void (WINE_GLAPI *p_glGetVertexArrayIntegervEXT)(GLuint,GLenum,GLint*); + void (WINE_GLAPI *p_glGetVertexArrayPointeri_vEXT)(GLuint,GLuint,GLenum,void**); + void (WINE_GLAPI *p_glGetVertexArrayPointervEXT)(GLuint,GLenum,void**); void (WINE_GLAPI *p_glGetVertexAttribArrayObjectfvATI)(GLuint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetVertexAttribArrayObjectivATI)(GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetVertexAttribIiv)(GLuint,GLenum,GLint*); @@ -1133,11 +1206,12 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetVertexAttribIuivEXT)(GLuint,GLenum,GLuint*); void (WINE_GLAPI *p_glGetVertexAttribLdv)(GLuint,GLenum,GLdouble*); void (WINE_GLAPI *p_glGetVertexAttribLdvEXT)(GLuint,GLenum,GLdouble*); - void (WINE_GLAPI *p_glGetVertexAttribLi64vNV)(GLuint,GLenum,INT64*); - void (WINE_GLAPI *p_glGetVertexAttribLui64vNV)(GLuint,GLenum,UINT64*); - void (WINE_GLAPI *p_glGetVertexAttribPointerv)(GLuint,GLenum,GLvoid**); - void (WINE_GLAPI *p_glGetVertexAttribPointervARB)(GLuint,GLenum,GLvoid**); - void (WINE_GLAPI *p_glGetVertexAttribPointervNV)(GLuint,GLenum,GLvoid**); + void (WINE_GLAPI *p_glGetVertexAttribLi64vNV)(GLuint,GLenum,GLint64EXT*); + void (WINE_GLAPI *p_glGetVertexAttribLui64vARB)(GLuint,GLenum,GLuint64EXT*); + void (WINE_GLAPI *p_glGetVertexAttribLui64vNV)(GLuint,GLenum,GLuint64EXT*); + void (WINE_GLAPI *p_glGetVertexAttribPointerv)(GLuint,GLenum,void**); + void (WINE_GLAPI *p_glGetVertexAttribPointervARB)(GLuint,GLenum,void**); + void (WINE_GLAPI *p_glGetVertexAttribPointervNV)(GLuint,GLenum,void**); void (WINE_GLAPI *p_glGetVertexAttribdv)(GLuint,GLenum,GLdouble*); void (WINE_GLAPI *p_glGetVertexAttribdvARB)(GLuint,GLenum,GLdouble*); void (WINE_GLAPI *p_glGetVertexAttribdvNV)(GLuint,GLenum,GLdouble*); @@ -1151,24 +1225,24 @@ struct opengl_funcs void (WINE_GLAPI *p_glGetVideoCaptureStreamfvNV)(GLuint,GLuint,GLenum,GLfloat*); void (WINE_GLAPI *p_glGetVideoCaptureStreamivNV)(GLuint,GLuint,GLenum,GLint*); void (WINE_GLAPI *p_glGetVideoCaptureivNV)(GLuint,GLenum,GLint*); - void (WINE_GLAPI *p_glGetVideoi64vNV)(GLuint,GLenum,INT64*); + void (WINE_GLAPI *p_glGetVideoi64vNV)(GLuint,GLenum,GLint64EXT*); void (WINE_GLAPI *p_glGetVideoivNV)(GLuint,GLenum,GLint*); - void (WINE_GLAPI *p_glGetVideoui64vNV)(GLuint,GLenum,UINT64*); + void (WINE_GLAPI *p_glGetVideoui64vNV)(GLuint,GLenum,GLuint64EXT*); void (WINE_GLAPI *p_glGetVideouivNV)(GLuint,GLenum,GLuint*); - void (WINE_GLAPI *p_glGetnColorTableARB)(GLenum,GLenum,GLenum,GLsizei,GLvoid*); - void (WINE_GLAPI *p_glGetnCompressedTexImageARB)(GLenum,GLint,GLsizei,GLvoid*); - void (WINE_GLAPI *p_glGetnConvolutionFilterARB)(GLenum,GLenum,GLenum,GLsizei,GLvoid*); - void (WINE_GLAPI *p_glGetnHistogramARB)(GLenum,GLboolean,GLenum,GLenum,GLsizei,GLvoid*); + void (WINE_GLAPI *p_glGetnColorTableARB)(GLenum,GLenum,GLenum,GLsizei,void*); + void (WINE_GLAPI *p_glGetnCompressedTexImageARB)(GLenum,GLint,GLsizei,void*); + void (WINE_GLAPI *p_glGetnConvolutionFilterARB)(GLenum,GLenum,GLenum,GLsizei,void*); + void (WINE_GLAPI *p_glGetnHistogramARB)(GLenum,GLboolean,GLenum,GLenum,GLsizei,void*); void (WINE_GLAPI *p_glGetnMapdvARB)(GLenum,GLenum,GLsizei,GLdouble*); void (WINE_GLAPI *p_glGetnMapfvARB)(GLenum,GLenum,GLsizei,GLfloat*); void (WINE_GLAPI *p_glGetnMapivARB)(GLenum,GLenum,GLsizei,GLint*); - void (WINE_GLAPI *p_glGetnMinmaxARB)(GLenum,GLboolean,GLenum,GLenum,GLsizei,GLvoid*); + void (WINE_GLAPI *p_glGetnMinmaxARB)(GLenum,GLboolean,GLenum,GLenum,GLsizei,void*); void (WINE_GLAPI *p_glGetnPixelMapfvARB)(GLenum,GLsizei,GLfloat*); void (WINE_GLAPI *p_glGetnPixelMapuivARB)(GLenum,GLsizei,GLuint*); void (WINE_GLAPI *p_glGetnPixelMapusvARB)(GLenum,GLsizei,GLushort*); void (WINE_GLAPI *p_glGetnPolygonStippleARB)(GLsizei,GLubyte*); - void (WINE_GLAPI *p_glGetnSeparableFilterARB)(GLenum,GLenum,GLenum,GLsizei,GLvoid*,GLsizei,GLvoid*,GLvoid*); - void (WINE_GLAPI *p_glGetnTexImageARB)(GLenum,GLint,GLenum,GLenum,GLsizei,GLvoid*); + void (WINE_GLAPI *p_glGetnSeparableFilterARB)(GLenum,GLenum,GLenum,GLsizei,void*,GLsizei,void*,void*); + void (WINE_GLAPI *p_glGetnTexImageARB)(GLenum,GLint,GLenum,GLenum,GLsizei,void*); void (WINE_GLAPI *p_glGetnUniformdvARB)(GLuint,GLint,GLsizei,GLdouble*); void (WINE_GLAPI *p_glGetnUniformfvARB)(GLuint,GLint,GLsizei,GLfloat*); void (WINE_GLAPI *p_glGetnUniformivARB)(GLuint,GLint,GLsizei,GLint*); @@ -1184,18 +1258,21 @@ struct opengl_funcs void (WINE_GLAPI *p_glHintPGI)(GLenum,GLint); void (WINE_GLAPI *p_glHistogram)(GLenum,GLsizei,GLenum,GLboolean); void (WINE_GLAPI *p_glHistogramEXT)(GLenum,GLsizei,GLenum,GLboolean); - void (WINE_GLAPI *p_glIglooInterfaceSGIX)(GLenum,const GLvoid*); + void (WINE_GLAPI *p_glIglooInterfaceSGIX)(GLenum,const void*); void (WINE_GLAPI *p_glImageTransformParameterfHP)(GLenum,GLenum,GLfloat); void (WINE_GLAPI *p_glImageTransformParameterfvHP)(GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glImageTransformParameteriHP)(GLenum,GLenum,GLint); void (WINE_GLAPI *p_glImageTransformParameterivHP)(GLenum,GLenum,const GLint*); - GLvoid* (WINE_GLAPI *p_glImportSyncEXT)(GLenum,GLintptr,GLbitfield); + GLsync (WINE_GLAPI *p_glImportSyncEXT)(GLenum,GLintptr,GLbitfield); void (WINE_GLAPI *p_glIndexFormatNV)(GLenum,GLsizei); void (WINE_GLAPI *p_glIndexFuncEXT)(GLenum,GLclampf); void (WINE_GLAPI *p_glIndexMaterialEXT)(GLenum,GLenum); - void (WINE_GLAPI *p_glIndexPointerEXT)(GLenum,GLsizei,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glIndexPointerListIBM)(GLenum,GLint,const GLvoid**,GLint); + void (WINE_GLAPI *p_glIndexPointerEXT)(GLenum,GLsizei,GLsizei,const void*); + void (WINE_GLAPI *p_glIndexPointerListIBM)(GLenum,GLint,const void**,GLint); + void (WINE_GLAPI *p_glIndexxOES)(GLfixed); + void (WINE_GLAPI *p_glIndexxvOES)(const GLfixed*); void (WINE_GLAPI *p_glInsertComponentEXT)(GLuint,GLuint,GLuint); + void (WINE_GLAPI *p_glInsertEventMarkerEXT)(GLsizei,const GLchar*); void (WINE_GLAPI *p_glInstrumentsBufferSGIX)(GLsizei,GLint*); void (WINE_GLAPI *p_glInterpolatePathsNV)(GLuint,GLuint,GLuint,GLfloat); void (WINE_GLAPI *p_glInvalidateBufferData)(GLuint); @@ -1214,7 +1291,8 @@ struct opengl_funcs GLboolean (WINE_GLAPI *p_glIsFenceNV)(GLuint); GLboolean (WINE_GLAPI *p_glIsFramebuffer)(GLuint); GLboolean (WINE_GLAPI *p_glIsFramebufferEXT)(GLuint); - GLboolean (WINE_GLAPI *p_glIsImageHandleResidentNV)(UINT64); + GLboolean (WINE_GLAPI *p_glIsImageHandleResidentARB)(GLuint64); + GLboolean (WINE_GLAPI *p_glIsImageHandleResidentNV)(GLuint64); GLboolean (WINE_GLAPI *p_glIsNameAMD)(GLenum,GLuint); GLboolean (WINE_GLAPI *p_glIsNamedBufferResidentNV)(GLuint); GLboolean (WINE_GLAPI *p_glIsNamedStringARB)(GLint,const GLchar*); @@ -1233,16 +1311,23 @@ struct opengl_funcs GLboolean (WINE_GLAPI *p_glIsRenderbufferEXT)(GLuint); GLboolean (WINE_GLAPI *p_glIsSampler)(GLuint); GLboolean (WINE_GLAPI *p_glIsShader)(GLuint); - GLboolean (WINE_GLAPI *p_glIsSync)(GLvoid*); + GLboolean (WINE_GLAPI *p_glIsSync)(GLsync); GLboolean (WINE_GLAPI *p_glIsTextureEXT)(GLuint); - GLboolean (WINE_GLAPI *p_glIsTextureHandleResidentNV)(UINT64); + GLboolean (WINE_GLAPI *p_glIsTextureHandleResidentARB)(GLuint64); + GLboolean (WINE_GLAPI *p_glIsTextureHandleResidentNV)(GLuint64); GLboolean (WINE_GLAPI *p_glIsTransformFeedback)(GLuint); GLboolean (WINE_GLAPI *p_glIsTransformFeedbackNV)(GLuint); GLboolean (WINE_GLAPI *p_glIsVariantEnabledEXT)(GLuint,GLenum); GLboolean (WINE_GLAPI *p_glIsVertexArray)(GLuint); GLboolean (WINE_GLAPI *p_glIsVertexArrayAPPLE)(GLuint); GLboolean (WINE_GLAPI *p_glIsVertexAttribEnabledAPPLE)(GLuint,GLenum); + void (WINE_GLAPI *p_glLabelObjectEXT)(GLenum,GLuint,GLsizei,const GLchar*); void (WINE_GLAPI *p_glLightEnviSGIX)(GLenum,GLint); + void (WINE_GLAPI *p_glLightModelxOES)(GLenum,GLfixed); + void (WINE_GLAPI *p_glLightModelxvOES)(GLenum,const GLfixed*); + void (WINE_GLAPI *p_glLightxOES)(GLenum,GLenum,GLfixed); + void (WINE_GLAPI *p_glLightxvOES)(GLenum,GLenum,const GLfixed*); + void (WINE_GLAPI *p_glLineWidthxOES)(GLfixed); void (WINE_GLAPI *p_glLinkProgram)(GLuint); void (WINE_GLAPI *p_glLinkProgramARB)(GLhandleARB); void (WINE_GLAPI *p_glListParameterfSGIX)(GLuint,GLenum,GLfloat); @@ -1250,37 +1335,50 @@ struct opengl_funcs void (WINE_GLAPI *p_glListParameteriSGIX)(GLuint,GLenum,GLint); void (WINE_GLAPI *p_glListParameterivSGIX)(GLuint,GLenum,const GLint*); void (WINE_GLAPI *p_glLoadIdentityDeformationMapSGIX)(GLbitfield); + void (WINE_GLAPI *p_glLoadMatrixxOES)(const GLfixed*); void (WINE_GLAPI *p_glLoadProgramNV)(GLenum,GLuint,GLsizei,const GLubyte*); void (WINE_GLAPI *p_glLoadTransposeMatrixd)(const GLdouble*); void (WINE_GLAPI *p_glLoadTransposeMatrixdARB)(const GLdouble*); void (WINE_GLAPI *p_glLoadTransposeMatrixf)(const GLfloat*); void (WINE_GLAPI *p_glLoadTransposeMatrixfARB)(const GLfloat*); + void (WINE_GLAPI *p_glLoadTransposeMatrixxOES)(const GLfixed*); void (WINE_GLAPI *p_glLockArraysEXT)(GLint,GLsizei); void (WINE_GLAPI *p_glMTexCoord2fSGIS)(GLenum,GLfloat,GLfloat); void (WINE_GLAPI *p_glMTexCoord2fvSGIS)(GLenum,GLfloat *); void (WINE_GLAPI *p_glMakeBufferNonResidentNV)(GLenum); void (WINE_GLAPI *p_glMakeBufferResidentNV)(GLenum,GLenum); - void (WINE_GLAPI *p_glMakeImageHandleNonResidentNV)(UINT64); - void (WINE_GLAPI *p_glMakeImageHandleResidentNV)(UINT64,GLenum); + void (WINE_GLAPI *p_glMakeImageHandleNonResidentARB)(GLuint64); + void (WINE_GLAPI *p_glMakeImageHandleNonResidentNV)(GLuint64); + void (WINE_GLAPI *p_glMakeImageHandleResidentARB)(GLuint64,GLenum); + void (WINE_GLAPI *p_glMakeImageHandleResidentNV)(GLuint64,GLenum); void (WINE_GLAPI *p_glMakeNamedBufferNonResidentNV)(GLuint); void (WINE_GLAPI *p_glMakeNamedBufferResidentNV)(GLuint,GLenum); - void (WINE_GLAPI *p_glMakeTextureHandleNonResidentNV)(UINT64); - void (WINE_GLAPI *p_glMakeTextureHandleResidentNV)(UINT64); - GLvoid* (WINE_GLAPI *p_glMapBuffer)(GLenum,GLenum); - GLvoid* (WINE_GLAPI *p_glMapBufferARB)(GLenum,GLenum); - GLvoid* (WINE_GLAPI *p_glMapBufferRange)(GLenum,GLintptr,GLsizeiptr,GLbitfield); - void (WINE_GLAPI *p_glMapControlPointsNV)(GLenum,GLuint,GLenum,GLsizei,GLsizei,GLint,GLint,GLboolean,const GLvoid*); - GLvoid* (WINE_GLAPI *p_glMapNamedBufferEXT)(GLuint,GLenum); - GLvoid* (WINE_GLAPI *p_glMapNamedBufferRangeEXT)(GLuint,GLintptr,GLsizeiptr,GLbitfield); - GLvoid* (WINE_GLAPI *p_glMapObjectBufferATI)(GLuint); + void (WINE_GLAPI *p_glMakeTextureHandleNonResidentARB)(GLuint64); + void (WINE_GLAPI *p_glMakeTextureHandleNonResidentNV)(GLuint64); + void (WINE_GLAPI *p_glMakeTextureHandleResidentARB)(GLuint64); + void (WINE_GLAPI *p_glMakeTextureHandleResidentNV)(GLuint64); + void (WINE_GLAPI *p_glMap1xOES)(GLenum,GLfixed,GLfixed,GLint,GLint,GLfixed); + void (WINE_GLAPI *p_glMap2xOES)(GLenum,GLfixed,GLfixed,GLint,GLint,GLfixed,GLfixed,GLint,GLint,GLfixed); + void* (WINE_GLAPI *p_glMapBuffer)(GLenum,GLenum); + void* (WINE_GLAPI *p_glMapBufferARB)(GLenum,GLenum); + void* (WINE_GLAPI *p_glMapBufferRange)(GLenum,GLintptr,GLsizeiptr,GLbitfield); + void (WINE_GLAPI *p_glMapControlPointsNV)(GLenum,GLuint,GLenum,GLsizei,GLsizei,GLint,GLint,GLboolean,const void*); + void (WINE_GLAPI *p_glMapGrid1xOES)(GLint,GLfixed,GLfixed); + void (WINE_GLAPI *p_glMapGrid2xOES)(GLint,GLfixed,GLfixed,GLfixed,GLfixed); + void* (WINE_GLAPI *p_glMapNamedBufferEXT)(GLuint,GLenum); + void* (WINE_GLAPI *p_glMapNamedBufferRangeEXT)(GLuint,GLintptr,GLsizeiptr,GLbitfield); + void* (WINE_GLAPI *p_glMapObjectBufferATI)(GLuint); void (WINE_GLAPI *p_glMapParameterfvNV)(GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glMapParameterivNV)(GLenum,GLenum,const GLint*); + void* (WINE_GLAPI *p_glMapTexture2DINTEL)(GLuint,GLint,GLbitfield,GLint*,GLenum*); void (WINE_GLAPI *p_glMapVertexAttrib1dAPPLE)(GLuint,GLuint,GLdouble,GLdouble,GLint,GLint,const GLdouble*); void (WINE_GLAPI *p_glMapVertexAttrib1fAPPLE)(GLuint,GLuint,GLfloat,GLfloat,GLint,GLint,const GLfloat*); void (WINE_GLAPI *p_glMapVertexAttrib2dAPPLE)(GLuint,GLuint,GLdouble,GLdouble,GLint,GLint,GLdouble,GLdouble,GLint,GLint,const GLdouble*); void (WINE_GLAPI *p_glMapVertexAttrib2fAPPLE)(GLuint,GLuint,GLfloat,GLfloat,GLint,GLint,GLfloat,GLfloat,GLint,GLint,const GLfloat*); + void (WINE_GLAPI *p_glMaterialxOES)(GLenum,GLenum,GLfixed); + void (WINE_GLAPI *p_glMaterialxvOES)(GLenum,GLenum,const GLfixed*); void (WINE_GLAPI *p_glMatrixFrustumEXT)(GLenum,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble,GLdouble); - void (WINE_GLAPI *p_glMatrixIndexPointerARB)(GLint,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glMatrixIndexPointerARB)(GLint,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glMatrixIndexubvARB)(GLint,const GLubyte*); void (WINE_GLAPI *p_glMatrixIndexuivARB)(GLint,const GLuint*); void (WINE_GLAPI *p_glMatrixIndexusvARB)(GLint,const GLushort*); @@ -1308,24 +1406,32 @@ struct opengl_funcs void (WINE_GLAPI *p_glMinSampleShadingARB)(GLfloat); void (WINE_GLAPI *p_glMinmax)(GLenum,GLenum,GLboolean); void (WINE_GLAPI *p_glMinmaxEXT)(GLenum,GLenum,GLboolean); + void (WINE_GLAPI *p_glMultMatrixxOES)(const GLfixed*); void (WINE_GLAPI *p_glMultTransposeMatrixd)(const GLdouble*); void (WINE_GLAPI *p_glMultTransposeMatrixdARB)(const GLdouble*); void (WINE_GLAPI *p_glMultTransposeMatrixf)(const GLfloat*); void (WINE_GLAPI *p_glMultTransposeMatrixfARB)(const GLfloat*); + void (WINE_GLAPI *p_glMultTransposeMatrixxOES)(const GLfixed*); void (WINE_GLAPI *p_glMultiDrawArrays)(GLenum,const GLint*,const GLsizei*,GLsizei); void (WINE_GLAPI *p_glMultiDrawArraysEXT)(GLenum,const GLint*,const GLsizei*,GLsizei); void (WINE_GLAPI *p_glMultiDrawArraysIndirect)(GLenum,const void*,GLsizei,GLsizei); - void (WINE_GLAPI *p_glMultiDrawArraysIndirectAMD)(GLenum,const GLvoid*,GLsizei,GLsizei); + void (WINE_GLAPI *p_glMultiDrawArraysIndirectAMD)(GLenum,const void*,GLsizei,GLsizei); + void (WINE_GLAPI *p_glMultiDrawArraysIndirectBindlessNV)(GLenum,const void*,GLsizei,GLsizei,GLint); + void (WINE_GLAPI *p_glMultiDrawArraysIndirectCountARB)(GLenum,GLintptr,GLintptr,GLsizei,GLsizei); void (WINE_GLAPI *p_glMultiDrawElementArrayAPPLE)(GLenum,const GLint*,const GLsizei*,GLsizei); - void (WINE_GLAPI *p_glMultiDrawElements)(GLenum,const GLsizei*,GLenum,const GLvoid* const*,GLsizei); - void (WINE_GLAPI *p_glMultiDrawElementsBaseVertex)(GLenum,const GLsizei*,GLenum,const GLvoid* const*,GLsizei,const GLint*); - void (WINE_GLAPI *p_glMultiDrawElementsEXT)(GLenum,const GLsizei*,GLenum,const GLvoid**,GLsizei); + void (WINE_GLAPI *p_glMultiDrawElements)(GLenum,const GLsizei*,GLenum,const void*const*,GLsizei); + void (WINE_GLAPI *p_glMultiDrawElementsBaseVertex)(GLenum,const GLsizei*,GLenum,const void*const*,GLsizei,const GLint*); + void (WINE_GLAPI *p_glMultiDrawElementsEXT)(GLenum,const GLsizei*,GLenum,const void*const*,GLsizei); void (WINE_GLAPI *p_glMultiDrawElementsIndirect)(GLenum,GLenum,const void*,GLsizei,GLsizei); - void (WINE_GLAPI *p_glMultiDrawElementsIndirectAMD)(GLenum,GLenum,const GLvoid*,GLsizei,GLsizei); + void (WINE_GLAPI *p_glMultiDrawElementsIndirectAMD)(GLenum,GLenum,const void*,GLsizei,GLsizei); + void (WINE_GLAPI *p_glMultiDrawElementsIndirectBindlessNV)(GLenum,GLenum,const void*,GLsizei,GLsizei,GLint); + void (WINE_GLAPI *p_glMultiDrawElementsIndirectCountARB)(GLenum,GLenum,GLintptr,GLintptr,GLsizei,GLsizei); void (WINE_GLAPI *p_glMultiDrawRangeElementArrayAPPLE)(GLenum,GLuint,GLuint,const GLint*,const GLsizei*,GLsizei); void (WINE_GLAPI *p_glMultiModeDrawArraysIBM)(const GLenum*,const GLint*,const GLsizei*,GLsizei,GLint); - void (WINE_GLAPI *p_glMultiModeDrawElementsIBM)(const GLenum*,const GLsizei*,GLenum,const GLvoid* const*,GLsizei,GLint); + void (WINE_GLAPI *p_glMultiModeDrawElementsIBM)(const GLenum*,const GLsizei*,GLenum,const void*const*,GLsizei,GLint); void (WINE_GLAPI *p_glMultiTexBufferEXT)(GLenum,GLenum,GLenum,GLuint); + void (WINE_GLAPI *p_glMultiTexCoord1bOES)(GLenum,GLbyte); + void (WINE_GLAPI *p_glMultiTexCoord1bvOES)(GLenum,const GLbyte*); void (WINE_GLAPI *p_glMultiTexCoord1d)(GLenum,GLdouble); void (WINE_GLAPI *p_glMultiTexCoord1dARB)(GLenum,GLdouble); void (WINE_GLAPI *p_glMultiTexCoord1dSGIS)(GLenum,GLdouble); @@ -1352,6 +1458,10 @@ struct opengl_funcs void (WINE_GLAPI *p_glMultiTexCoord1sv)(GLenum,const GLshort*); void (WINE_GLAPI *p_glMultiTexCoord1svARB)(GLenum,const GLshort*); void (WINE_GLAPI *p_glMultiTexCoord1svSGIS)(GLenum,GLshort *); + void (WINE_GLAPI *p_glMultiTexCoord1xOES)(GLenum,GLfixed); + void (WINE_GLAPI *p_glMultiTexCoord1xvOES)(GLenum,const GLfixed*); + void (WINE_GLAPI *p_glMultiTexCoord2bOES)(GLenum,GLbyte,GLbyte); + void (WINE_GLAPI *p_glMultiTexCoord2bvOES)(GLenum,const GLbyte*); void (WINE_GLAPI *p_glMultiTexCoord2d)(GLenum,GLdouble,GLdouble); void (WINE_GLAPI *p_glMultiTexCoord2dARB)(GLenum,GLdouble,GLdouble); void (WINE_GLAPI *p_glMultiTexCoord2dSGIS)(GLenum,GLdouble,GLdouble); @@ -1378,6 +1488,10 @@ struct opengl_funcs void (WINE_GLAPI *p_glMultiTexCoord2sv)(GLenum,const GLshort*); void (WINE_GLAPI *p_glMultiTexCoord2svARB)(GLenum,const GLshort*); void (WINE_GLAPI *p_glMultiTexCoord2svSGIS)(GLenum,GLshort *); + void (WINE_GLAPI *p_glMultiTexCoord2xOES)(GLenum,GLfixed,GLfixed); + void (WINE_GLAPI *p_glMultiTexCoord2xvOES)(GLenum,const GLfixed*); + void (WINE_GLAPI *p_glMultiTexCoord3bOES)(GLenum,GLbyte,GLbyte,GLbyte); + void (WINE_GLAPI *p_glMultiTexCoord3bvOES)(GLenum,const GLbyte*); void (WINE_GLAPI *p_glMultiTexCoord3d)(GLenum,GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glMultiTexCoord3dARB)(GLenum,GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glMultiTexCoord3dSGIS)(GLenum,GLdouble,GLdouble,GLdouble); @@ -1404,6 +1518,10 @@ struct opengl_funcs void (WINE_GLAPI *p_glMultiTexCoord3sv)(GLenum,const GLshort*); void (WINE_GLAPI *p_glMultiTexCoord3svARB)(GLenum,const GLshort*); void (WINE_GLAPI *p_glMultiTexCoord3svSGIS)(GLenum,GLshort *); + void (WINE_GLAPI *p_glMultiTexCoord3xOES)(GLenum,GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glMultiTexCoord3xvOES)(GLenum,const GLfixed*); + void (WINE_GLAPI *p_glMultiTexCoord4bOES)(GLenum,GLbyte,GLbyte,GLbyte,GLbyte); + void (WINE_GLAPI *p_glMultiTexCoord4bvOES)(GLenum,const GLbyte*); void (WINE_GLAPI *p_glMultiTexCoord4d)(GLenum,GLdouble,GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glMultiTexCoord4dARB)(GLenum,GLdouble,GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glMultiTexCoord4dSGIS)(GLenum,GLdouble,GLdouble,GLdouble,GLdouble); @@ -1430,6 +1548,8 @@ struct opengl_funcs void (WINE_GLAPI *p_glMultiTexCoord4sv)(GLenum,const GLshort*); void (WINE_GLAPI *p_glMultiTexCoord4svARB)(GLenum,const GLshort*); void (WINE_GLAPI *p_glMultiTexCoord4svSGIS)(GLenum,GLshort *); + void (WINE_GLAPI *p_glMultiTexCoord4xOES)(GLenum,GLfixed,GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glMultiTexCoord4xvOES)(GLenum,const GLfixed*); void (WINE_GLAPI *p_glMultiTexCoordP1ui)(GLenum,GLenum,GLuint); void (WINE_GLAPI *p_glMultiTexCoordP1uiv)(GLenum,GLenum,const GLuint*); void (WINE_GLAPI *p_glMultiTexCoordP2ui)(GLenum,GLenum,GLuint); @@ -1438,7 +1558,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glMultiTexCoordP3uiv)(GLenum,GLenum,const GLuint*); void (WINE_GLAPI *p_glMultiTexCoordP4ui)(GLenum,GLenum,GLuint); void (WINE_GLAPI *p_glMultiTexCoordP4uiv)(GLenum,GLenum,const GLuint*); - void (WINE_GLAPI *p_glMultiTexCoordPointerEXT)(GLenum,GLint,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glMultiTexCoordPointerEXT)(GLenum,GLint,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glMultiTexCoordPointerSGIS)(GLenum,GLint,GLenum,GLsizei,GLvoid *); void (WINE_GLAPI *p_glMultiTexEnvfEXT)(GLenum,GLenum,GLenum,GLfloat); void (WINE_GLAPI *p_glMultiTexEnvfvEXT)(GLenum,GLenum,GLenum,const GLfloat*); @@ -1450,9 +1570,9 @@ struct opengl_funcs void (WINE_GLAPI *p_glMultiTexGenfvEXT)(GLenum,GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glMultiTexGeniEXT)(GLenum,GLenum,GLenum,GLint); void (WINE_GLAPI *p_glMultiTexGenivEXT)(GLenum,GLenum,GLenum,const GLint*); - void (WINE_GLAPI *p_glMultiTexImage1DEXT)(GLenum,GLenum,GLint,GLenum,GLsizei,GLint,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glMultiTexImage2DEXT)(GLenum,GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glMultiTexImage3DEXT)(GLenum,GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glMultiTexImage1DEXT)(GLenum,GLenum,GLint,GLint,GLsizei,GLint,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glMultiTexImage2DEXT)(GLenum,GLenum,GLint,GLint,GLsizei,GLsizei,GLint,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glMultiTexImage3DEXT)(GLenum,GLenum,GLint,GLint,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glMultiTexParameterIivEXT)(GLenum,GLenum,GLenum,const GLint*); void (WINE_GLAPI *p_glMultiTexParameterIuivEXT)(GLenum,GLenum,GLenum,const GLuint*); void (WINE_GLAPI *p_glMultiTexParameterfEXT)(GLenum,GLenum,GLenum,GLfloat); @@ -1460,11 +1580,12 @@ struct opengl_funcs void (WINE_GLAPI *p_glMultiTexParameteriEXT)(GLenum,GLenum,GLenum,GLint); void (WINE_GLAPI *p_glMultiTexParameterivEXT)(GLenum,GLenum,GLenum,const GLint*); void (WINE_GLAPI *p_glMultiTexRenderbufferEXT)(GLenum,GLenum,GLuint); - void (WINE_GLAPI *p_glMultiTexSubImage1DEXT)(GLenum,GLenum,GLint,GLint,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glMultiTexSubImage2DEXT)(GLenum,GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glMultiTexSubImage3DEXT)(GLenum,GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glNamedBufferDataEXT)(GLuint,GLsizeiptr,const GLvoid*,GLenum); - void (WINE_GLAPI *p_glNamedBufferSubDataEXT)(GLuint,GLintptr,GLsizeiptr,const GLvoid*); + void (WINE_GLAPI *p_glMultiTexSubImage1DEXT)(GLenum,GLenum,GLint,GLint,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glMultiTexSubImage2DEXT)(GLenum,GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glMultiTexSubImage3DEXT)(GLenum,GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glNamedBufferDataEXT)(GLuint,GLsizeiptr,const void*,GLenum); + void (WINE_GLAPI *p_glNamedBufferStorageEXT)(GLuint,GLsizeiptr,const void*,GLbitfield); + void (WINE_GLAPI *p_glNamedBufferSubDataEXT)(GLuint,GLintptr,GLsizeiptr,const void*); void (WINE_GLAPI *p_glNamedCopyBufferSubDataEXT)(GLuint,GLuint,GLintptr,GLintptr,GLsizeiptr); void (WINE_GLAPI *p_glNamedFramebufferParameteriEXT)(GLuint,GLenum,GLint); void (WINE_GLAPI *p_glNamedFramebufferRenderbufferEXT)(GLuint,GLenum,GLenum,GLuint); @@ -1485,23 +1606,25 @@ struct opengl_funcs void (WINE_GLAPI *p_glNamedProgramLocalParameters4fvEXT)(GLuint,GLenum,GLuint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glNamedProgramLocalParametersI4ivEXT)(GLuint,GLenum,GLuint,GLsizei,const GLint*); void (WINE_GLAPI *p_glNamedProgramLocalParametersI4uivEXT)(GLuint,GLenum,GLuint,GLsizei,const GLuint*); - void (WINE_GLAPI *p_glNamedProgramStringEXT)(GLuint,GLenum,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glNamedProgramStringEXT)(GLuint,GLenum,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glNamedRenderbufferStorageEXT)(GLuint,GLenum,GLsizei,GLsizei); void (WINE_GLAPI *p_glNamedRenderbufferStorageMultisampleCoverageEXT)(GLuint,GLsizei,GLsizei,GLenum,GLsizei,GLsizei); void (WINE_GLAPI *p_glNamedRenderbufferStorageMultisampleEXT)(GLuint,GLsizei,GLenum,GLsizei,GLsizei); void (WINE_GLAPI *p_glNamedStringARB)(GLenum,GLint,const GLchar*,GLint,const GLchar*); GLuint (WINE_GLAPI *p_glNewBufferRegion)(GLenum); - GLuint (WINE_GLAPI *p_glNewObjectBufferATI)(GLsizei,const GLvoid*,GLenum); + GLuint (WINE_GLAPI *p_glNewObjectBufferATI)(GLsizei,const void*,GLenum); void (WINE_GLAPI *p_glNormal3fVertex3fSUN)(GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glNormal3fVertex3fvSUN)(const GLfloat*,const GLfloat*); void (WINE_GLAPI *p_glNormal3hNV)(GLhalfNV,GLhalfNV,GLhalfNV); void (WINE_GLAPI *p_glNormal3hvNV)(const GLhalfNV*); + void (WINE_GLAPI *p_glNormal3xOES)(GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glNormal3xvOES)(const GLfixed*); void (WINE_GLAPI *p_glNormalFormatNV)(GLenum,GLsizei); void (WINE_GLAPI *p_glNormalP3ui)(GLenum,GLuint); void (WINE_GLAPI *p_glNormalP3uiv)(GLenum,const GLuint*); - void (WINE_GLAPI *p_glNormalPointerEXT)(GLenum,GLsizei,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glNormalPointerListIBM)(GLenum,GLint,const GLvoid**,GLint); - void (WINE_GLAPI *p_glNormalPointervINTEL)(GLenum,const GLvoid**); + void (WINE_GLAPI *p_glNormalPointerEXT)(GLenum,GLsizei,GLsizei,const void*); + void (WINE_GLAPI *p_glNormalPointerListIBM)(GLenum,GLint,const void**,GLint); + void (WINE_GLAPI *p_glNormalPointervINTEL)(GLenum,const void**); void (WINE_GLAPI *p_glNormalStream3bATI)(GLenum,GLbyte,GLbyte,GLbyte); void (WINE_GLAPI *p_glNormalStream3bvATI)(GLenum,const GLbyte*); void (WINE_GLAPI *p_glNormalStream3dATI)(GLenum,GLdouble,GLdouble,GLdouble); @@ -1516,41 +1639,48 @@ struct opengl_funcs void (WINE_GLAPI *p_glObjectPtrLabel)(const void*,GLsizei,const GLchar*); GLenum (WINE_GLAPI *p_glObjectPurgeableAPPLE)(GLenum,GLuint,GLenum); GLenum (WINE_GLAPI *p_glObjectUnpurgeableAPPLE)(GLenum,GLuint,GLenum); + void (WINE_GLAPI *p_glOrthofOES)(GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); + void (WINE_GLAPI *p_glOrthoxOES)(GLfixed,GLfixed,GLfixed,GLfixed,GLfixed,GLfixed); void (WINE_GLAPI *p_glPNTrianglesfATI)(GLenum,GLfloat); void (WINE_GLAPI *p_glPNTrianglesiATI)(GLenum,GLint); void (WINE_GLAPI *p_glPassTexCoordATI)(GLuint,GLuint,GLenum); + void (WINE_GLAPI *p_glPassThroughxOES)(GLfixed); void (WINE_GLAPI *p_glPatchParameterfv)(GLenum,const GLfloat*); void (WINE_GLAPI *p_glPatchParameteri)(GLenum,GLint); void (WINE_GLAPI *p_glPathColorGenNV)(GLenum,GLenum,GLenum,const GLfloat*); - void (WINE_GLAPI *p_glPathCommandsNV)(GLuint,GLsizei,const GLubyte*,GLsizei,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glPathCoordsNV)(GLuint,GLsizei,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glPathCommandsNV)(GLuint,GLsizei,const GLubyte*,GLsizei,GLenum,const void*); + void (WINE_GLAPI *p_glPathCoordsNV)(GLuint,GLsizei,GLenum,const void*); void (WINE_GLAPI *p_glPathCoverDepthFuncNV)(GLenum); void (WINE_GLAPI *p_glPathDashArrayNV)(GLuint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glPathFogGenNV)(GLenum); - void (WINE_GLAPI *p_glPathGlyphRangeNV)(GLuint,GLenum,const GLvoid*,GLbitfield,GLuint,GLsizei,GLenum,GLuint,GLfloat); - void (WINE_GLAPI *p_glPathGlyphsNV)(GLuint,GLenum,const GLvoid*,GLbitfield,GLsizei,GLenum,const GLvoid*,GLenum,GLuint,GLfloat); + void (WINE_GLAPI *p_glPathGlyphRangeNV)(GLuint,GLenum,const void*,GLbitfield,GLuint,GLsizei,GLenum,GLuint,GLfloat); + void (WINE_GLAPI *p_glPathGlyphsNV)(GLuint,GLenum,const void*,GLbitfield,GLsizei,GLenum,const void*,GLenum,GLuint,GLfloat); void (WINE_GLAPI *p_glPathParameterfNV)(GLuint,GLenum,GLfloat); void (WINE_GLAPI *p_glPathParameterfvNV)(GLuint,GLenum,const GLfloat*); void (WINE_GLAPI *p_glPathParameteriNV)(GLuint,GLenum,GLint); void (WINE_GLAPI *p_glPathParameterivNV)(GLuint,GLenum,const GLint*); void (WINE_GLAPI *p_glPathStencilDepthOffsetNV)(GLfloat,GLfloat); void (WINE_GLAPI *p_glPathStencilFuncNV)(GLenum,GLint,GLuint); - void (WINE_GLAPI *p_glPathStringNV)(GLuint,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glPathSubCommandsNV)(GLuint,GLsizei,GLsizei,GLsizei,const GLubyte*,GLsizei,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glPathSubCoordsNV)(GLuint,GLsizei,GLsizei,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glPathStringNV)(GLuint,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glPathSubCommandsNV)(GLuint,GLsizei,GLsizei,GLsizei,const GLubyte*,GLsizei,GLenum,const void*); + void (WINE_GLAPI *p_glPathSubCoordsNV)(GLuint,GLsizei,GLsizei,GLenum,const void*); void (WINE_GLAPI *p_glPathTexGenNV)(GLenum,GLenum,GLint,const GLfloat*); void (WINE_GLAPI *p_glPauseTransformFeedback)(void); void (WINE_GLAPI *p_glPauseTransformFeedbackNV)(void); - void (WINE_GLAPI *p_glPixelDataRangeNV)(GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glPixelDataRangeNV)(GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glPixelMapx)(GLenum,GLint,const GLfixed*); + void (WINE_GLAPI *p_glPixelStorex)(GLenum,GLfixed); void (WINE_GLAPI *p_glPixelTexGenParameterfSGIS)(GLenum,GLfloat); void (WINE_GLAPI *p_glPixelTexGenParameterfvSGIS)(GLenum,const GLfloat*); void (WINE_GLAPI *p_glPixelTexGenParameteriSGIS)(GLenum,GLint); void (WINE_GLAPI *p_glPixelTexGenParameterivSGIS)(GLenum,const GLint*); void (WINE_GLAPI *p_glPixelTexGenSGIX)(GLenum); + void (WINE_GLAPI *p_glPixelTransferxOES)(GLenum,GLfixed); void (WINE_GLAPI *p_glPixelTransformParameterfEXT)(GLenum,GLenum,GLfloat); void (WINE_GLAPI *p_glPixelTransformParameterfvEXT)(GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glPixelTransformParameteriEXT)(GLenum,GLenum,GLint); void (WINE_GLAPI *p_glPixelTransformParameterivEXT)(GLenum,GLenum,const GLint*); + void (WINE_GLAPI *p_glPixelZoomxOES)(GLfixed,GLfixed); GLboolean (WINE_GLAPI *p_glPointAlongPathNV)(GLuint,GLsizei,GLsizei,GLfloat,GLfloat*,GLfloat*,GLfloat*,GLfloat*); void (WINE_GLAPI *p_glPointParameterf)(GLenum,GLfloat); void (WINE_GLAPI *p_glPointParameterfARB)(GLenum,GLfloat); @@ -1564,17 +1694,22 @@ struct opengl_funcs void (WINE_GLAPI *p_glPointParameteriNV)(GLenum,GLint); void (WINE_GLAPI *p_glPointParameteriv)(GLenum,const GLint*); void (WINE_GLAPI *p_glPointParameterivNV)(GLenum,const GLint*); + void (WINE_GLAPI *p_glPointParameterxvOES)(GLenum,const GLfixed*); + void (WINE_GLAPI *p_glPointSizexOES)(GLfixed); GLint (WINE_GLAPI *p_glPollAsyncSGIX)(GLuint*); GLint (WINE_GLAPI *p_glPollInstrumentsSGIX)(GLint*); void (WINE_GLAPI *p_glPolygonOffsetEXT)(GLfloat,GLfloat); + void (WINE_GLAPI *p_glPolygonOffsetxOES)(GLfixed,GLfixed); void (WINE_GLAPI *p_glPopDebugGroup)(void); - void (WINE_GLAPI *p_glPresentFrameDualFillNV)(GLuint,UINT64,GLuint,GLuint,GLenum,GLenum,GLuint,GLenum,GLuint,GLenum,GLuint,GLenum,GLuint); - void (WINE_GLAPI *p_glPresentFrameKeyedNV)(GLuint,UINT64,GLuint,GLuint,GLenum,GLenum,GLuint,GLuint,GLenum,GLuint,GLuint); + void (WINE_GLAPI *p_glPopGroupMarkerEXT)(void); + void (WINE_GLAPI *p_glPresentFrameDualFillNV)(GLuint,GLuint64EXT,GLuint,GLuint,GLenum,GLenum,GLuint,GLenum,GLuint,GLenum,GLuint,GLenum,GLuint); + void (WINE_GLAPI *p_glPresentFrameKeyedNV)(GLuint,GLuint64EXT,GLuint,GLuint,GLenum,GLenum,GLuint,GLuint,GLenum,GLuint,GLuint); void (WINE_GLAPI *p_glPrimitiveRestartIndex)(GLuint); void (WINE_GLAPI *p_glPrimitiveRestartIndexNV)(GLuint); void (WINE_GLAPI *p_glPrimitiveRestartNV)(void); void (WINE_GLAPI *p_glPrioritizeTexturesEXT)(GLsizei,const GLuint*,const GLclampf*); - void (WINE_GLAPI *p_glProgramBinary)(GLuint,GLenum,const GLvoid*,GLsizei); + void (WINE_GLAPI *p_glPrioritizeTexturesxOES)(GLsizei,const GLuint*,const GLfixed*); + void (WINE_GLAPI *p_glProgramBinary)(GLuint,GLenum,const void*,GLsizei); void (WINE_GLAPI *p_glProgramBufferParametersIivNV)(GLenum,GLuint,GLuint,GLsizei,const GLint*); void (WINE_GLAPI *p_glProgramBufferParametersIuivNV)(GLenum,GLuint,GLuint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glProgramBufferParametersfvNV)(GLenum,GLuint,GLuint,GLsizei,const GLfloat*); @@ -1613,7 +1748,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glProgramParameteriEXT)(GLuint,GLenum,GLint); void (WINE_GLAPI *p_glProgramParameters4dvNV)(GLenum,GLuint,GLsizei,const GLdouble*); void (WINE_GLAPI *p_glProgramParameters4fvNV)(GLenum,GLuint,GLsizei,const GLfloat*); - void (WINE_GLAPI *p_glProgramStringARB)(GLenum,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glProgramStringARB)(GLenum,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glProgramSubroutineParametersuivNV)(GLenum,GLsizei,const GLuint*); void (WINE_GLAPI *p_glProgramUniform1d)(GLuint,GLint,GLdouble); void (WINE_GLAPI *p_glProgramUniform1dEXT)(GLuint,GLint,GLdouble); @@ -1624,14 +1759,14 @@ struct opengl_funcs void (WINE_GLAPI *p_glProgramUniform1fv)(GLuint,GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glProgramUniform1fvEXT)(GLuint,GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glProgramUniform1i)(GLuint,GLint,GLint); - void (WINE_GLAPI *p_glProgramUniform1i64NV)(GLuint,GLint,INT64); - void (WINE_GLAPI *p_glProgramUniform1i64vNV)(GLuint,GLint,GLsizei,const INT64*); + void (WINE_GLAPI *p_glProgramUniform1i64NV)(GLuint,GLint,GLint64EXT); + void (WINE_GLAPI *p_glProgramUniform1i64vNV)(GLuint,GLint,GLsizei,const GLint64EXT*); void (WINE_GLAPI *p_glProgramUniform1iEXT)(GLuint,GLint,GLint); void (WINE_GLAPI *p_glProgramUniform1iv)(GLuint,GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glProgramUniform1ivEXT)(GLuint,GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glProgramUniform1ui)(GLuint,GLint,GLuint); - void (WINE_GLAPI *p_glProgramUniform1ui64NV)(GLuint,GLint,UINT64); - void (WINE_GLAPI *p_glProgramUniform1ui64vNV)(GLuint,GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glProgramUniform1ui64NV)(GLuint,GLint,GLuint64EXT); + void (WINE_GLAPI *p_glProgramUniform1ui64vNV)(GLuint,GLint,GLsizei,const GLuint64EXT*); void (WINE_GLAPI *p_glProgramUniform1uiEXT)(GLuint,GLint,GLuint); void (WINE_GLAPI *p_glProgramUniform1uiv)(GLuint,GLint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glProgramUniform1uivEXT)(GLuint,GLint,GLsizei,const GLuint*); @@ -1644,14 +1779,14 @@ struct opengl_funcs void (WINE_GLAPI *p_glProgramUniform2fv)(GLuint,GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glProgramUniform2fvEXT)(GLuint,GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glProgramUniform2i)(GLuint,GLint,GLint,GLint); - void (WINE_GLAPI *p_glProgramUniform2i64NV)(GLuint,GLint,INT64,INT64); - void (WINE_GLAPI *p_glProgramUniform2i64vNV)(GLuint,GLint,GLsizei,const INT64*); + void (WINE_GLAPI *p_glProgramUniform2i64NV)(GLuint,GLint,GLint64EXT,GLint64EXT); + void (WINE_GLAPI *p_glProgramUniform2i64vNV)(GLuint,GLint,GLsizei,const GLint64EXT*); void (WINE_GLAPI *p_glProgramUniform2iEXT)(GLuint,GLint,GLint,GLint); void (WINE_GLAPI *p_glProgramUniform2iv)(GLuint,GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glProgramUniform2ivEXT)(GLuint,GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glProgramUniform2ui)(GLuint,GLint,GLuint,GLuint); - void (WINE_GLAPI *p_glProgramUniform2ui64NV)(GLuint,GLint,UINT64,UINT64); - void (WINE_GLAPI *p_glProgramUniform2ui64vNV)(GLuint,GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glProgramUniform2ui64NV)(GLuint,GLint,GLuint64EXT,GLuint64EXT); + void (WINE_GLAPI *p_glProgramUniform2ui64vNV)(GLuint,GLint,GLsizei,const GLuint64EXT*); void (WINE_GLAPI *p_glProgramUniform2uiEXT)(GLuint,GLint,GLuint,GLuint); void (WINE_GLAPI *p_glProgramUniform2uiv)(GLuint,GLint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glProgramUniform2uivEXT)(GLuint,GLint,GLsizei,const GLuint*); @@ -1664,14 +1799,14 @@ struct opengl_funcs void (WINE_GLAPI *p_glProgramUniform3fv)(GLuint,GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glProgramUniform3fvEXT)(GLuint,GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glProgramUniform3i)(GLuint,GLint,GLint,GLint,GLint); - void (WINE_GLAPI *p_glProgramUniform3i64NV)(GLuint,GLint,INT64,INT64,INT64); - void (WINE_GLAPI *p_glProgramUniform3i64vNV)(GLuint,GLint,GLsizei,const INT64*); + void (WINE_GLAPI *p_glProgramUniform3i64NV)(GLuint,GLint,GLint64EXT,GLint64EXT,GLint64EXT); + void (WINE_GLAPI *p_glProgramUniform3i64vNV)(GLuint,GLint,GLsizei,const GLint64EXT*); void (WINE_GLAPI *p_glProgramUniform3iEXT)(GLuint,GLint,GLint,GLint,GLint); void (WINE_GLAPI *p_glProgramUniform3iv)(GLuint,GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glProgramUniform3ivEXT)(GLuint,GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glProgramUniform3ui)(GLuint,GLint,GLuint,GLuint,GLuint); - void (WINE_GLAPI *p_glProgramUniform3ui64NV)(GLuint,GLint,UINT64,UINT64,UINT64); - void (WINE_GLAPI *p_glProgramUniform3ui64vNV)(GLuint,GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glProgramUniform3ui64NV)(GLuint,GLint,GLuint64EXT,GLuint64EXT,GLuint64EXT); + void (WINE_GLAPI *p_glProgramUniform3ui64vNV)(GLuint,GLint,GLsizei,const GLuint64EXT*); void (WINE_GLAPI *p_glProgramUniform3uiEXT)(GLuint,GLint,GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glProgramUniform3uiv)(GLuint,GLint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glProgramUniform3uivEXT)(GLuint,GLint,GLsizei,const GLuint*); @@ -1684,19 +1819,21 @@ struct opengl_funcs void (WINE_GLAPI *p_glProgramUniform4fv)(GLuint,GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glProgramUniform4fvEXT)(GLuint,GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glProgramUniform4i)(GLuint,GLint,GLint,GLint,GLint,GLint); - void (WINE_GLAPI *p_glProgramUniform4i64NV)(GLuint,GLint,INT64,INT64,INT64,INT64); - void (WINE_GLAPI *p_glProgramUniform4i64vNV)(GLuint,GLint,GLsizei,const INT64*); + void (WINE_GLAPI *p_glProgramUniform4i64NV)(GLuint,GLint,GLint64EXT,GLint64EXT,GLint64EXT,GLint64EXT); + void (WINE_GLAPI *p_glProgramUniform4i64vNV)(GLuint,GLint,GLsizei,const GLint64EXT*); void (WINE_GLAPI *p_glProgramUniform4iEXT)(GLuint,GLint,GLint,GLint,GLint,GLint); void (WINE_GLAPI *p_glProgramUniform4iv)(GLuint,GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glProgramUniform4ivEXT)(GLuint,GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glProgramUniform4ui)(GLuint,GLint,GLuint,GLuint,GLuint,GLuint); - void (WINE_GLAPI *p_glProgramUniform4ui64NV)(GLuint,GLint,UINT64,UINT64,UINT64,UINT64); - void (WINE_GLAPI *p_glProgramUniform4ui64vNV)(GLuint,GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glProgramUniform4ui64NV)(GLuint,GLint,GLuint64EXT,GLuint64EXT,GLuint64EXT,GLuint64EXT); + void (WINE_GLAPI *p_glProgramUniform4ui64vNV)(GLuint,GLint,GLsizei,const GLuint64EXT*); void (WINE_GLAPI *p_glProgramUniform4uiEXT)(GLuint,GLint,GLuint,GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glProgramUniform4uiv)(GLuint,GLint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glProgramUniform4uivEXT)(GLuint,GLint,GLsizei,const GLuint*); - void (WINE_GLAPI *p_glProgramUniformHandleui64NV)(GLuint,GLint,UINT64); - void (WINE_GLAPI *p_glProgramUniformHandleui64vNV)(GLuint,GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glProgramUniformHandleui64ARB)(GLuint,GLint,GLuint64); + void (WINE_GLAPI *p_glProgramUniformHandleui64NV)(GLuint,GLint,GLuint64); + void (WINE_GLAPI *p_glProgramUniformHandleui64vARB)(GLuint,GLint,GLsizei,const GLuint64*); + void (WINE_GLAPI *p_glProgramUniformHandleui64vNV)(GLuint,GLint,GLsizei,const GLuint64*); void (WINE_GLAPI *p_glProgramUniformMatrix2dv)(GLuint,GLint,GLsizei,GLboolean,const GLdouble*); void (WINE_GLAPI *p_glProgramUniformMatrix2dvEXT)(GLuint,GLint,GLsizei,GLboolean,const GLdouble*); void (WINE_GLAPI *p_glProgramUniformMatrix2fv)(GLuint,GLint,GLsizei,GLboolean,const GLfloat*); @@ -1733,17 +1870,27 @@ struct opengl_funcs void (WINE_GLAPI *p_glProgramUniformMatrix4x3dvEXT)(GLuint,GLint,GLsizei,GLboolean,const GLdouble*); void (WINE_GLAPI *p_glProgramUniformMatrix4x3fv)(GLuint,GLint,GLsizei,GLboolean,const GLfloat*); void (WINE_GLAPI *p_glProgramUniformMatrix4x3fvEXT)(GLuint,GLint,GLsizei,GLboolean,const GLfloat*); - void (WINE_GLAPI *p_glProgramUniformui64NV)(GLuint,GLint,UINT64); - void (WINE_GLAPI *p_glProgramUniformui64vNV)(GLuint,GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glProgramUniformui64NV)(GLuint,GLint,GLuint64EXT); + void (WINE_GLAPI *p_glProgramUniformui64vNV)(GLuint,GLint,GLsizei,const GLuint64EXT*); void (WINE_GLAPI *p_glProgramVertexLimitNV)(GLenum,GLint); void (WINE_GLAPI *p_glProvokingVertex)(GLenum); void (WINE_GLAPI *p_glProvokingVertexEXT)(GLenum); void (WINE_GLAPI *p_glPushClientAttribDefaultEXT)(GLbitfield); void (WINE_GLAPI *p_glPushDebugGroup)(GLenum,GLuint,GLsizei,const GLchar*); + void (WINE_GLAPI *p_glPushGroupMarkerEXT)(GLsizei,const GLchar*); void (WINE_GLAPI *p_glQueryCounter)(GLuint,GLenum); + GLbitfield (WINE_GLAPI *p_glQueryMatrixxOES)(GLfixed*,GLint*); + void (WINE_GLAPI *p_glRasterPos2xOES)(GLfixed,GLfixed); + void (WINE_GLAPI *p_glRasterPos2xvOES)(const GLfixed*); + void (WINE_GLAPI *p_glRasterPos3xOES)(GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glRasterPos3xvOES)(const GLfixed*); + void (WINE_GLAPI *p_glRasterPos4xOES)(GLfixed,GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glRasterPos4xvOES)(const GLfixed*); void (WINE_GLAPI *p_glReadBufferRegion)(GLenum,GLint,GLint,GLsizei,GLsizei); void (WINE_GLAPI *p_glReadInstrumentsSGIX)(GLint); - void (WINE_GLAPI *p_glReadnPixelsARB)(GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,GLsizei,GLvoid*); + void (WINE_GLAPI *p_glReadnPixelsARB)(GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,GLsizei,void*); + void (WINE_GLAPI *p_glRectxOES)(GLfixed,GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glRectxvOES)(const GLfixed*,const GLfixed*); void (WINE_GLAPI *p_glReferencePlaneSGIX)(const GLdouble*); void (WINE_GLAPI *p_glReleaseShaderCompiler)(void); void (WINE_GLAPI *p_glRenderbufferStorage)(GLenum,GLenum,GLsizei,GLsizei); @@ -1751,7 +1898,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glRenderbufferStorageMultisample)(GLenum,GLsizei,GLenum,GLsizei,GLsizei); void (WINE_GLAPI *p_glRenderbufferStorageMultisampleCoverageNV)(GLenum,GLsizei,GLsizei,GLenum,GLsizei,GLsizei); void (WINE_GLAPI *p_glRenderbufferStorageMultisampleEXT)(GLenum,GLsizei,GLenum,GLsizei,GLsizei); - void (WINE_GLAPI *p_glReplacementCodePointerSUN)(GLenum,GLsizei,const GLvoid**); + void (WINE_GLAPI *p_glReplacementCodePointerSUN)(GLenum,GLsizei,const void**); void (WINE_GLAPI *p_glReplacementCodeubSUN)(GLubyte); void (WINE_GLAPI *p_glReplacementCodeubvSUN)(const GLubyte*); void (WINE_GLAPI *p_glReplacementCodeuiColor3fVertex3fSUN)(GLuint,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); @@ -1782,8 +1929,10 @@ struct opengl_funcs void (WINE_GLAPI *p_glResizeBuffersMESA)(void); void (WINE_GLAPI *p_glResumeTransformFeedback)(void); void (WINE_GLAPI *p_glResumeTransformFeedbackNV)(void); + void (WINE_GLAPI *p_glRotatexOES)(GLfixed,GLfixed,GLfixed,GLfixed); void (WINE_GLAPI *p_glSampleCoverage)(GLfloat,GLboolean); void (WINE_GLAPI *p_glSampleCoverageARB)(GLfloat,GLboolean); + void (WINE_GLAPI *p_glSampleCoverageOES)(GLfixed,GLboolean); void (WINE_GLAPI *p_glSampleMapATI)(GLuint,GLuint,GLenum); void (WINE_GLAPI *p_glSampleMaskEXT)(GLclampf,GLboolean); void (WINE_GLAPI *p_glSampleMaskIndexedNV)(GLuint,GLbitfield); @@ -1797,6 +1946,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glSamplerParameterfv)(GLuint,GLenum,const GLfloat*); void (WINE_GLAPI *p_glSamplerParameteri)(GLuint,GLenum,GLint); void (WINE_GLAPI *p_glSamplerParameteriv)(GLuint,GLenum,const GLint*); + void (WINE_GLAPI *p_glScalexOES)(GLfixed,GLfixed,GLfixed); void (WINE_GLAPI *p_glScissorArrayv)(GLuint,GLsizei,const GLint*); void (WINE_GLAPI *p_glScissorIndexed)(GLuint,GLint,GLint,GLsizei,GLsizei); void (WINE_GLAPI *p_glScissorIndexedv)(GLuint,const GLint*); @@ -1837,25 +1987,25 @@ struct opengl_funcs void (WINE_GLAPI *p_glSecondaryColorFormatNV)(GLint,GLenum,GLsizei); void (WINE_GLAPI *p_glSecondaryColorP3ui)(GLenum,GLuint); void (WINE_GLAPI *p_glSecondaryColorP3uiv)(GLenum,const GLuint*); - void (WINE_GLAPI *p_glSecondaryColorPointer)(GLint,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glSecondaryColorPointerEXT)(GLint,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glSecondaryColorPointerListIBM)(GLint,GLenum,GLint,const GLvoid**,GLint); + void (WINE_GLAPI *p_glSecondaryColorPointer)(GLint,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glSecondaryColorPointerEXT)(GLint,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glSecondaryColorPointerListIBM)(GLint,GLenum,GLint,const void**,GLint); void (WINE_GLAPI *p_glSelectPerfMonitorCountersAMD)(GLuint,GLboolean,GLuint,GLint,GLuint*); void (WINE_GLAPI *p_glSelectTextureCoordSetSGIS)(GLenum); void (WINE_GLAPI *p_glSelectTextureSGIS)(GLenum); - void (WINE_GLAPI *p_glSeparableFilter2D)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*,const GLvoid*); - void (WINE_GLAPI *p_glSeparableFilter2DEXT)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*,const GLvoid*); + void (WINE_GLAPI *p_glSeparableFilter2D)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const void*,const void*); + void (WINE_GLAPI *p_glSeparableFilter2DEXT)(GLenum,GLenum,GLsizei,GLsizei,GLenum,GLenum,const void*,const void*); void (WINE_GLAPI *p_glSetFenceAPPLE)(GLuint); void (WINE_GLAPI *p_glSetFenceNV)(GLuint,GLenum); void (WINE_GLAPI *p_glSetFragmentShaderConstantATI)(GLuint,const GLfloat*); - void (WINE_GLAPI *p_glSetInvariantEXT)(GLuint,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glSetLocalConstantEXT)(GLuint,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glSetInvariantEXT)(GLuint,GLenum,const void*); + void (WINE_GLAPI *p_glSetLocalConstantEXT)(GLuint,GLenum,const void*); void (WINE_GLAPI *p_glSetMultisamplefvAMD)(GLenum,GLuint,const GLfloat*); - void (WINE_GLAPI *p_glShaderBinary)(GLsizei,const GLuint*,GLenum,const GLvoid*,GLsizei); + void (WINE_GLAPI *p_glShaderBinary)(GLsizei,const GLuint*,GLenum,const void*,GLsizei); void (WINE_GLAPI *p_glShaderOp1EXT)(GLenum,GLuint,GLuint); void (WINE_GLAPI *p_glShaderOp2EXT)(GLenum,GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glShaderOp3EXT)(GLenum,GLuint,GLuint,GLuint,GLuint); - void (WINE_GLAPI *p_glShaderSource)(GLuint,GLsizei,const GLchar* const*,const GLint*); + void (WINE_GLAPI *p_glShaderSource)(GLuint,GLsizei,const GLchar*const*,const GLint*); void (WINE_GLAPI *p_glShaderSourceARB)(GLhandleARB,GLsizei,const GLcharARB**,const GLint*); void (WINE_GLAPI *p_glShaderStorageBlockBinding)(GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glSharpenTexFuncSGIS)(GLenum,GLsizei,const GLfloat*); @@ -1865,7 +2015,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glSpriteParameterivSGIX)(GLenum,const GLint*); void (WINE_GLAPI *p_glStartInstrumentsSGIX)(void); void (WINE_GLAPI *p_glStencilClearTagEXT)(GLsizei,GLuint); - void (WINE_GLAPI *p_glStencilFillPathInstancedNV)(GLsizei,GLenum,const GLvoid*,GLuint,GLenum,GLuint,GLenum,const GLfloat*); + void (WINE_GLAPI *p_glStencilFillPathInstancedNV)(GLsizei,GLenum,const void*,GLuint,GLenum,GLuint,GLenum,const GLfloat*); void (WINE_GLAPI *p_glStencilFillPathNV)(GLuint,GLenum,GLuint); void (WINE_GLAPI *p_glStencilFuncSeparate)(GLenum,GLenum,GLint,GLuint); void (WINE_GLAPI *p_glStencilFuncSeparateATI)(GLenum,GLenum,GLint,GLuint); @@ -1873,11 +2023,12 @@ struct opengl_funcs void (WINE_GLAPI *p_glStencilOpSeparate)(GLenum,GLenum,GLenum,GLenum); void (WINE_GLAPI *p_glStencilOpSeparateATI)(GLenum,GLenum,GLenum,GLenum); void (WINE_GLAPI *p_glStencilOpValueAMD)(GLenum,GLuint); - void (WINE_GLAPI *p_glStencilStrokePathInstancedNV)(GLsizei,GLenum,const GLvoid*,GLuint,GLint,GLuint,GLenum,const GLfloat*); + void (WINE_GLAPI *p_glStencilStrokePathInstancedNV)(GLsizei,GLenum,const void*,GLuint,GLint,GLuint,GLenum,const GLfloat*); void (WINE_GLAPI *p_glStencilStrokePathNV)(GLuint,GLint,GLuint); void (WINE_GLAPI *p_glStopInstrumentsSGIX)(GLint); - void (WINE_GLAPI *p_glStringMarkerGREMEDY)(GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glStringMarkerGREMEDY)(GLsizei,const void*); void (WINE_GLAPI *p_glSwizzleEXT)(GLuint,GLuint,GLenum,GLenum,GLenum,GLenum); + void (WINE_GLAPI *p_glSyncTextureINTEL)(GLuint); void (WINE_GLAPI *p_glTagSampleBufferSGIX)(void); void (WINE_GLAPI *p_glTangent3bEXT)(GLbyte,GLbyte,GLbyte); void (WINE_GLAPI *p_glTangent3bvEXT)(const GLbyte*); @@ -1889,7 +2040,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glTangent3ivEXT)(const GLint*); void (WINE_GLAPI *p_glTangent3sEXT)(GLshort,GLshort,GLshort); void (WINE_GLAPI *p_glTangent3svEXT)(const GLshort*); - void (WINE_GLAPI *p_glTangentPointerEXT)(GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glTangentPointerEXT)(GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glTbufferMask3DFX)(GLuint); void (WINE_GLAPI *p_glTessellationFactorAMD)(GLfloat); void (WINE_GLAPI *p_glTessellationModeAMD)(GLenum); @@ -1902,8 +2053,14 @@ struct opengl_funcs void (WINE_GLAPI *p_glTexBufferRange)(GLenum,GLenum,GLuint,GLintptr,GLsizeiptr); void (WINE_GLAPI *p_glTexBumpParameterfvATI)(GLenum,const GLfloat*); void (WINE_GLAPI *p_glTexBumpParameterivATI)(GLenum,const GLint*); + void (WINE_GLAPI *p_glTexCoord1bOES)(GLbyte); + void (WINE_GLAPI *p_glTexCoord1bvOES)(const GLbyte*); void (WINE_GLAPI *p_glTexCoord1hNV)(GLhalfNV); void (WINE_GLAPI *p_glTexCoord1hvNV)(const GLhalfNV*); + void (WINE_GLAPI *p_glTexCoord1xOES)(GLfixed); + void (WINE_GLAPI *p_glTexCoord1xvOES)(const GLfixed*); + void (WINE_GLAPI *p_glTexCoord2bOES)(GLbyte,GLbyte); + void (WINE_GLAPI *p_glTexCoord2bvOES)(const GLbyte*); void (WINE_GLAPI *p_glTexCoord2fColor3fVertex3fSUN)(GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glTexCoord2fColor3fVertex3fvSUN)(const GLfloat*,const GLfloat*,const GLfloat*); void (WINE_GLAPI *p_glTexCoord2fColor4fNormal3fVertex3fSUN)(GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); @@ -1916,14 +2073,24 @@ struct opengl_funcs void (WINE_GLAPI *p_glTexCoord2fVertex3fvSUN)(const GLfloat*,const GLfloat*); void (WINE_GLAPI *p_glTexCoord2hNV)(GLhalfNV,GLhalfNV); void (WINE_GLAPI *p_glTexCoord2hvNV)(const GLhalfNV*); + void (WINE_GLAPI *p_glTexCoord2xOES)(GLfixed,GLfixed); + void (WINE_GLAPI *p_glTexCoord2xvOES)(const GLfixed*); + void (WINE_GLAPI *p_glTexCoord3bOES)(GLbyte,GLbyte,GLbyte); + void (WINE_GLAPI *p_glTexCoord3bvOES)(const GLbyte*); void (WINE_GLAPI *p_glTexCoord3hNV)(GLhalfNV,GLhalfNV,GLhalfNV); void (WINE_GLAPI *p_glTexCoord3hvNV)(const GLhalfNV*); + void (WINE_GLAPI *p_glTexCoord3xOES)(GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glTexCoord3xvOES)(const GLfixed*); + void (WINE_GLAPI *p_glTexCoord4bOES)(GLbyte,GLbyte,GLbyte,GLbyte); + void (WINE_GLAPI *p_glTexCoord4bvOES)(const GLbyte*); void (WINE_GLAPI *p_glTexCoord4fColor4fNormal3fVertex4fSUN)(GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glTexCoord4fColor4fNormal3fVertex4fvSUN)(const GLfloat*,const GLfloat*,const GLfloat*,const GLfloat*); void (WINE_GLAPI *p_glTexCoord4fVertex4fSUN)(GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glTexCoord4fVertex4fvSUN)(const GLfloat*,const GLfloat*); void (WINE_GLAPI *p_glTexCoord4hNV)(GLhalfNV,GLhalfNV,GLhalfNV,GLhalfNV); void (WINE_GLAPI *p_glTexCoord4hvNV)(const GLhalfNV*); + void (WINE_GLAPI *p_glTexCoord4xOES)(GLfixed,GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glTexCoord4xvOES)(const GLfixed*); void (WINE_GLAPI *p_glTexCoordFormatNV)(GLint,GLenum,GLsizei); void (WINE_GLAPI *p_glTexCoordP1ui)(GLenum,GLuint); void (WINE_GLAPI *p_glTexCoordP1uiv)(GLenum,const GLuint*); @@ -1933,21 +2100,28 @@ struct opengl_funcs void (WINE_GLAPI *p_glTexCoordP3uiv)(GLenum,const GLuint*); void (WINE_GLAPI *p_glTexCoordP4ui)(GLenum,GLuint); void (WINE_GLAPI *p_glTexCoordP4uiv)(GLenum,const GLuint*); - void (WINE_GLAPI *p_glTexCoordPointerEXT)(GLint,GLenum,GLsizei,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glTexCoordPointerListIBM)(GLint,GLenum,GLint,const GLvoid**,GLint); - void (WINE_GLAPI *p_glTexCoordPointervINTEL)(GLint,GLenum,const GLvoid**); + void (WINE_GLAPI *p_glTexCoordPointerEXT)(GLint,GLenum,GLsizei,GLsizei,const void*); + void (WINE_GLAPI *p_glTexCoordPointerListIBM)(GLint,GLenum,GLint,const void**,GLint); + void (WINE_GLAPI *p_glTexCoordPointervINTEL)(GLint,GLenum,const void**); + void (WINE_GLAPI *p_glTexEnvxOES)(GLenum,GLenum,GLfixed); + void (WINE_GLAPI *p_glTexEnvxvOES)(GLenum,GLenum,const GLfixed*); void (WINE_GLAPI *p_glTexFilterFuncSGIS)(GLenum,GLenum,GLsizei,const GLfloat*); - void (WINE_GLAPI *p_glTexImage2DMultisample)(GLenum,GLsizei,GLint,GLsizei,GLsizei,GLboolean); + void (WINE_GLAPI *p_glTexGenxOES)(GLenum,GLenum,GLfixed); + void (WINE_GLAPI *p_glTexGenxvOES)(GLenum,GLenum,const GLfixed*); + void (WINE_GLAPI *p_glTexImage2DMultisample)(GLenum,GLsizei,GLenum,GLsizei,GLsizei,GLboolean); void (WINE_GLAPI *p_glTexImage2DMultisampleCoverageNV)(GLenum,GLsizei,GLsizei,GLint,GLsizei,GLsizei,GLboolean); - void (WINE_GLAPI *p_glTexImage3D)(GLenum,GLint,GLint,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTexImage3DEXT)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTexImage3DMultisample)(GLenum,GLsizei,GLint,GLsizei,GLsizei,GLsizei,GLboolean); + void (WINE_GLAPI *p_glTexImage3D)(GLenum,GLint,GLint,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTexImage3DEXT)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTexImage3DMultisample)(GLenum,GLsizei,GLenum,GLsizei,GLsizei,GLsizei,GLboolean); void (WINE_GLAPI *p_glTexImage3DMultisampleCoverageNV)(GLenum,GLsizei,GLsizei,GLint,GLsizei,GLsizei,GLsizei,GLboolean); - void (WINE_GLAPI *p_glTexImage4DSGIS)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glTexImage4DSGIS)(GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTexPageCommitmentARB)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLboolean); void (WINE_GLAPI *p_glTexParameterIiv)(GLenum,GLenum,const GLint*); void (WINE_GLAPI *p_glTexParameterIivEXT)(GLenum,GLenum,const GLint*); void (WINE_GLAPI *p_glTexParameterIuiv)(GLenum,GLenum,const GLuint*); void (WINE_GLAPI *p_glTexParameterIuivEXT)(GLenum,GLenum,const GLuint*); + void (WINE_GLAPI *p_glTexParameterxOES)(GLenum,GLenum,GLfixed); + void (WINE_GLAPI *p_glTexParameterxvOES)(GLenum,GLenum,const GLfixed*); void (WINE_GLAPI *p_glTexRenderbufferNV)(GLenum,GLuint); void (WINE_GLAPI *p_glTexStorage1D)(GLenum,GLsizei,GLenum,GLsizei); void (WINE_GLAPI *p_glTexStorage2D)(GLenum,GLsizei,GLenum,GLsizei,GLsizei); @@ -1955,32 +2129,33 @@ struct opengl_funcs void (WINE_GLAPI *p_glTexStorage3D)(GLenum,GLsizei,GLenum,GLsizei,GLsizei,GLsizei); void (WINE_GLAPI *p_glTexStorage3DMultisample)(GLenum,GLsizei,GLenum,GLsizei,GLsizei,GLsizei,GLboolean); void (WINE_GLAPI *p_glTexStorageSparseAMD)(GLenum,GLenum,GLsizei,GLsizei,GLsizei,GLsizei,GLbitfield); - void (WINE_GLAPI *p_glTexSubImage1DEXT)(GLenum,GLint,GLint,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTexSubImage2DEXT)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTexSubImage3DEXT)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTexSubImage4DSGIS)(GLenum,GLint,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glTexSubImage1DEXT)(GLenum,GLint,GLint,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTexSubImage2DEXT)(GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTexSubImage3D)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTexSubImage3DEXT)(GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTexSubImage4DSGIS)(GLenum,GLint,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glTextureBarrierNV)(void); void (WINE_GLAPI *p_glTextureBufferEXT)(GLuint,GLenum,GLenum,GLuint); void (WINE_GLAPI *p_glTextureBufferRangeEXT)(GLuint,GLenum,GLenum,GLuint,GLintptr,GLsizeiptr); void (WINE_GLAPI *p_glTextureColorMaskSGIS)(GLboolean,GLboolean,GLboolean,GLboolean); - void (WINE_GLAPI *p_glTextureImage1DEXT)(GLuint,GLenum,GLint,GLenum,GLsizei,GLint,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTextureImage2DEXT)(GLuint,GLenum,GLint,GLenum,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glTextureImage1DEXT)(GLuint,GLenum,GLint,GLint,GLsizei,GLint,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTextureImage2DEXT)(GLuint,GLenum,GLint,GLint,GLsizei,GLsizei,GLint,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glTextureImage2DMultisampleCoverageNV)(GLuint,GLenum,GLsizei,GLsizei,GLint,GLsizei,GLsizei,GLboolean); void (WINE_GLAPI *p_glTextureImage2DMultisampleNV)(GLuint,GLenum,GLsizei,GLint,GLsizei,GLsizei,GLboolean); - void (WINE_GLAPI *p_glTextureImage3DEXT)(GLuint,GLenum,GLint,GLenum,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glTextureImage3DEXT)(GLuint,GLenum,GLint,GLint,GLsizei,GLsizei,GLsizei,GLint,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glTextureImage3DMultisampleCoverageNV)(GLuint,GLenum,GLsizei,GLsizei,GLint,GLsizei,GLsizei,GLsizei,GLboolean); void (WINE_GLAPI *p_glTextureImage3DMultisampleNV)(GLuint,GLenum,GLsizei,GLint,GLsizei,GLsizei,GLsizei,GLboolean); void (WINE_GLAPI *p_glTextureLightEXT)(GLenum); void (WINE_GLAPI *p_glTextureMaterialEXT)(GLenum,GLenum); void (WINE_GLAPI *p_glTextureNormalEXT)(GLenum); + void (WINE_GLAPI *p_glTexturePageCommitmentEXT)(GLuint,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLboolean); void (WINE_GLAPI *p_glTextureParameterIivEXT)(GLuint,GLenum,GLenum,const GLint*); void (WINE_GLAPI *p_glTextureParameterIuivEXT)(GLuint,GLenum,GLenum,const GLuint*); void (WINE_GLAPI *p_glTextureParameterfEXT)(GLuint,GLenum,GLenum,GLfloat); void (WINE_GLAPI *p_glTextureParameterfvEXT)(GLuint,GLenum,GLenum,const GLfloat*); void (WINE_GLAPI *p_glTextureParameteriEXT)(GLuint,GLenum,GLenum,GLint); void (WINE_GLAPI *p_glTextureParameterivEXT)(GLuint,GLenum,GLenum,const GLint*); - void (WINE_GLAPI *p_glTextureRangeAPPLE)(GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glTextureRangeAPPLE)(GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glTextureRenderbufferEXT)(GLuint,GLenum,GLuint); void (WINE_GLAPI *p_glTextureStorage1DEXT)(GLuint,GLenum,GLsizei,GLenum,GLsizei); void (WINE_GLAPI *p_glTextureStorage2DEXT)(GLuint,GLenum,GLsizei,GLenum,GLsizei,GLsizei); @@ -1988,17 +2163,18 @@ struct opengl_funcs void (WINE_GLAPI *p_glTextureStorage3DEXT)(GLuint,GLenum,GLsizei,GLenum,GLsizei,GLsizei,GLsizei); void (WINE_GLAPI *p_glTextureStorage3DMultisampleEXT)(GLuint,GLenum,GLsizei,GLenum,GLsizei,GLsizei,GLsizei,GLboolean); void (WINE_GLAPI *p_glTextureStorageSparseAMD)(GLuint,GLenum,GLenum,GLsizei,GLsizei,GLsizei,GLsizei,GLbitfield); - void (WINE_GLAPI *p_glTextureSubImage1DEXT)(GLuint,GLenum,GLint,GLint,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTextureSubImage2DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); - void (WINE_GLAPI *p_glTextureSubImage3DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const GLvoid*); + void (WINE_GLAPI *p_glTextureSubImage1DEXT)(GLuint,GLenum,GLint,GLint,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTextureSubImage2DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLsizei,GLsizei,GLenum,GLenum,const void*); + void (WINE_GLAPI *p_glTextureSubImage3DEXT)(GLuint,GLenum,GLint,GLint,GLint,GLint,GLsizei,GLsizei,GLsizei,GLenum,GLenum,const void*); void (WINE_GLAPI *p_glTextureView)(GLuint,GLenum,GLuint,GLenum,GLuint,GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glTrackMatrixNV)(GLenum,GLuint,GLenum,GLenum); void (WINE_GLAPI *p_glTransformFeedbackAttribsNV)(GLuint,const GLint*,GLenum); void (WINE_GLAPI *p_glTransformFeedbackStreamAttribsNV)(GLsizei,const GLint*,GLsizei,const GLint*,GLenum); - void (WINE_GLAPI *p_glTransformFeedbackVaryings)(GLuint,GLsizei,const GLchar* const*,GLenum); - void (WINE_GLAPI *p_glTransformFeedbackVaryingsEXT)(GLuint,GLsizei,const GLchar**,GLenum); + void (WINE_GLAPI *p_glTransformFeedbackVaryings)(GLuint,GLsizei,const GLchar*const*,GLenum); + void (WINE_GLAPI *p_glTransformFeedbackVaryingsEXT)(GLuint,GLsizei,const GLchar*const*,GLenum); void (WINE_GLAPI *p_glTransformFeedbackVaryingsNV)(GLuint,GLsizei,const GLint*,GLenum); void (WINE_GLAPI *p_glTransformPathNV)(GLuint,GLuint,GLenum,const GLfloat*); + void (WINE_GLAPI *p_glTranslatexOES)(GLfixed,GLfixed,GLfixed); void (WINE_GLAPI *p_glUniform1d)(GLint,GLdouble); void (WINE_GLAPI *p_glUniform1dv)(GLint,GLsizei,const GLdouble*); void (WINE_GLAPI *p_glUniform1f)(GLint,GLfloat); @@ -2006,14 +2182,14 @@ struct opengl_funcs void (WINE_GLAPI *p_glUniform1fv)(GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glUniform1fvARB)(GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glUniform1i)(GLint,GLint); - void (WINE_GLAPI *p_glUniform1i64NV)(GLint,INT64); - void (WINE_GLAPI *p_glUniform1i64vNV)(GLint,GLsizei,const INT64*); + void (WINE_GLAPI *p_glUniform1i64NV)(GLint,GLint64EXT); + void (WINE_GLAPI *p_glUniform1i64vNV)(GLint,GLsizei,const GLint64EXT*); void (WINE_GLAPI *p_glUniform1iARB)(GLint,GLint); void (WINE_GLAPI *p_glUniform1iv)(GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glUniform1ivARB)(GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glUniform1ui)(GLint,GLuint); - void (WINE_GLAPI *p_glUniform1ui64NV)(GLint,UINT64); - void (WINE_GLAPI *p_glUniform1ui64vNV)(GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glUniform1ui64NV)(GLint,GLuint64EXT); + void (WINE_GLAPI *p_glUniform1ui64vNV)(GLint,GLsizei,const GLuint64EXT*); void (WINE_GLAPI *p_glUniform1uiEXT)(GLint,GLuint); void (WINE_GLAPI *p_glUniform1uiv)(GLint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glUniform1uivEXT)(GLint,GLsizei,const GLuint*); @@ -2024,14 +2200,14 @@ struct opengl_funcs void (WINE_GLAPI *p_glUniform2fv)(GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glUniform2fvARB)(GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glUniform2i)(GLint,GLint,GLint); - void (WINE_GLAPI *p_glUniform2i64NV)(GLint,INT64,INT64); - void (WINE_GLAPI *p_glUniform2i64vNV)(GLint,GLsizei,const INT64*); + void (WINE_GLAPI *p_glUniform2i64NV)(GLint,GLint64EXT,GLint64EXT); + void (WINE_GLAPI *p_glUniform2i64vNV)(GLint,GLsizei,const GLint64EXT*); void (WINE_GLAPI *p_glUniform2iARB)(GLint,GLint,GLint); void (WINE_GLAPI *p_glUniform2iv)(GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glUniform2ivARB)(GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glUniform2ui)(GLint,GLuint,GLuint); - void (WINE_GLAPI *p_glUniform2ui64NV)(GLint,UINT64,UINT64); - void (WINE_GLAPI *p_glUniform2ui64vNV)(GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glUniform2ui64NV)(GLint,GLuint64EXT,GLuint64EXT); + void (WINE_GLAPI *p_glUniform2ui64vNV)(GLint,GLsizei,const GLuint64EXT*); void (WINE_GLAPI *p_glUniform2uiEXT)(GLint,GLuint,GLuint); void (WINE_GLAPI *p_glUniform2uiv)(GLint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glUniform2uivEXT)(GLint,GLsizei,const GLuint*); @@ -2042,14 +2218,14 @@ struct opengl_funcs void (WINE_GLAPI *p_glUniform3fv)(GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glUniform3fvARB)(GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glUniform3i)(GLint,GLint,GLint,GLint); - void (WINE_GLAPI *p_glUniform3i64NV)(GLint,INT64,INT64,INT64); - void (WINE_GLAPI *p_glUniform3i64vNV)(GLint,GLsizei,const INT64*); + void (WINE_GLAPI *p_glUniform3i64NV)(GLint,GLint64EXT,GLint64EXT,GLint64EXT); + void (WINE_GLAPI *p_glUniform3i64vNV)(GLint,GLsizei,const GLint64EXT*); void (WINE_GLAPI *p_glUniform3iARB)(GLint,GLint,GLint,GLint); void (WINE_GLAPI *p_glUniform3iv)(GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glUniform3ivARB)(GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glUniform3ui)(GLint,GLuint,GLuint,GLuint); - void (WINE_GLAPI *p_glUniform3ui64NV)(GLint,UINT64,UINT64,UINT64); - void (WINE_GLAPI *p_glUniform3ui64vNV)(GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glUniform3ui64NV)(GLint,GLuint64EXT,GLuint64EXT,GLuint64EXT); + void (WINE_GLAPI *p_glUniform3ui64vNV)(GLint,GLsizei,const GLuint64EXT*); void (WINE_GLAPI *p_glUniform3uiEXT)(GLint,GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glUniform3uiv)(GLint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glUniform3uivEXT)(GLint,GLsizei,const GLuint*); @@ -2060,21 +2236,23 @@ struct opengl_funcs void (WINE_GLAPI *p_glUniform4fv)(GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glUniform4fvARB)(GLint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glUniform4i)(GLint,GLint,GLint,GLint,GLint); - void (WINE_GLAPI *p_glUniform4i64NV)(GLint,INT64,INT64,INT64,INT64); - void (WINE_GLAPI *p_glUniform4i64vNV)(GLint,GLsizei,const INT64*); + void (WINE_GLAPI *p_glUniform4i64NV)(GLint,GLint64EXT,GLint64EXT,GLint64EXT,GLint64EXT); + void (WINE_GLAPI *p_glUniform4i64vNV)(GLint,GLsizei,const GLint64EXT*); void (WINE_GLAPI *p_glUniform4iARB)(GLint,GLint,GLint,GLint,GLint); void (WINE_GLAPI *p_glUniform4iv)(GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glUniform4ivARB)(GLint,GLsizei,const GLint*); void (WINE_GLAPI *p_glUniform4ui)(GLint,GLuint,GLuint,GLuint,GLuint); - void (WINE_GLAPI *p_glUniform4ui64NV)(GLint,UINT64,UINT64,UINT64,UINT64); - void (WINE_GLAPI *p_glUniform4ui64vNV)(GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glUniform4ui64NV)(GLint,GLuint64EXT,GLuint64EXT,GLuint64EXT,GLuint64EXT); + void (WINE_GLAPI *p_glUniform4ui64vNV)(GLint,GLsizei,const GLuint64EXT*); void (WINE_GLAPI *p_glUniform4uiEXT)(GLint,GLuint,GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glUniform4uiv)(GLint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glUniform4uivEXT)(GLint,GLsizei,const GLuint*); void (WINE_GLAPI *p_glUniformBlockBinding)(GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glUniformBufferEXT)(GLuint,GLint,GLuint); - void (WINE_GLAPI *p_glUniformHandleui64NV)(GLint,UINT64); - void (WINE_GLAPI *p_glUniformHandleui64vNV)(GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glUniformHandleui64ARB)(GLint,GLuint64); + void (WINE_GLAPI *p_glUniformHandleui64NV)(GLint,GLuint64); + void (WINE_GLAPI *p_glUniformHandleui64vARB)(GLint,GLsizei,const GLuint64*); + void (WINE_GLAPI *p_glUniformHandleui64vNV)(GLint,GLsizei,const GLuint64*); void (WINE_GLAPI *p_glUniformMatrix2dv)(GLint,GLsizei,GLboolean,const GLdouble*); void (WINE_GLAPI *p_glUniformMatrix2fv)(GLint,GLsizei,GLboolean,const GLfloat*); void (WINE_GLAPI *p_glUniformMatrix2fvARB)(GLint,GLsizei,GLboolean,const GLfloat*); @@ -2097,25 +2275,26 @@ struct opengl_funcs void (WINE_GLAPI *p_glUniformMatrix4x3dv)(GLint,GLsizei,GLboolean,const GLdouble*); void (WINE_GLAPI *p_glUniformMatrix4x3fv)(GLint,GLsizei,GLboolean,const GLfloat*); void (WINE_GLAPI *p_glUniformSubroutinesuiv)(GLenum,GLsizei,const GLuint*); - void (WINE_GLAPI *p_glUniformui64NV)(GLint,UINT64); - void (WINE_GLAPI *p_glUniformui64vNV)(GLint,GLsizei,const UINT64*); + void (WINE_GLAPI *p_glUniformui64NV)(GLint,GLuint64EXT); + void (WINE_GLAPI *p_glUniformui64vNV)(GLint,GLsizei,const GLuint64EXT*); void (WINE_GLAPI *p_glUnlockArraysEXT)(void); GLboolean (WINE_GLAPI *p_glUnmapBuffer)(GLenum); GLboolean (WINE_GLAPI *p_glUnmapBufferARB)(GLenum); GLboolean (WINE_GLAPI *p_glUnmapNamedBufferEXT)(GLuint); void (WINE_GLAPI *p_glUnmapObjectBufferATI)(GLuint); - void (WINE_GLAPI *p_glUpdateObjectBufferATI)(GLuint,GLuint,GLsizei,const GLvoid*,GLenum); + void (WINE_GLAPI *p_glUnmapTexture2DINTEL)(GLuint,GLint); + void (WINE_GLAPI *p_glUpdateObjectBufferATI)(GLuint,GLuint,GLsizei,const void*,GLenum); void (WINE_GLAPI *p_glUseProgram)(GLuint); void (WINE_GLAPI *p_glUseProgramObjectARB)(GLhandleARB); void (WINE_GLAPI *p_glUseProgramStages)(GLuint,GLbitfield,GLuint); void (WINE_GLAPI *p_glUseShaderProgramEXT)(GLenum,GLuint); void (WINE_GLAPI *p_glVDPAUFiniNV)(void); void (WINE_GLAPI *p_glVDPAUGetSurfaceivNV)(GLvdpauSurfaceNV,GLenum,GLsizei,GLsizei*,GLint*); - void (WINE_GLAPI *p_glVDPAUInitNV)(const GLvoid*,const GLvoid*); + void (WINE_GLAPI *p_glVDPAUInitNV)(const void*,const void*); void (WINE_GLAPI *p_glVDPAUIsSurfaceNV)(GLvdpauSurfaceNV); void (WINE_GLAPI *p_glVDPAUMapSurfacesNV)(GLsizei,const GLvdpauSurfaceNV*); - GLvdpauSurfaceNV (WINE_GLAPI *p_glVDPAURegisterOutputSurfaceNV)(GLvoid*,GLenum,GLsizei,const GLuint*); - GLvdpauSurfaceNV (WINE_GLAPI *p_glVDPAURegisterVideoSurfaceNV)(const GLvoid*,GLenum,GLsizei,const GLuint*); + GLvdpauSurfaceNV (WINE_GLAPI *p_glVDPAURegisterOutputSurfaceNV)(const void*,GLenum,GLsizei,const GLuint*); + GLvdpauSurfaceNV (WINE_GLAPI *p_glVDPAURegisterVideoSurfaceNV)(const void*,GLenum,GLsizei,const GLuint*); void (WINE_GLAPI *p_glVDPAUSurfaceAccessNV)(GLvdpauSurfaceNV,GLenum); void (WINE_GLAPI *p_glVDPAUUnmapSurfacesNV)(GLsizei,const GLvdpauSurfaceNV*); void (WINE_GLAPI *p_glVDPAUUnregisterSurfaceNV)(GLvdpauSurfaceNV); @@ -2123,7 +2302,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glValidateProgramARB)(GLhandleARB); void (WINE_GLAPI *p_glValidateProgramPipeline)(GLuint); void (WINE_GLAPI *p_glVariantArrayObjectATI)(GLuint,GLenum,GLsizei,GLuint,GLuint); - void (WINE_GLAPI *p_glVariantPointerEXT)(GLuint,GLenum,GLuint,const GLvoid*); + void (WINE_GLAPI *p_glVariantPointerEXT)(GLuint,GLenum,GLuint,const void*); void (WINE_GLAPI *p_glVariantbvEXT)(GLuint,const GLbyte*); void (WINE_GLAPI *p_glVariantdvEXT)(GLuint,const GLdouble*); void (WINE_GLAPI *p_glVariantfvEXT)(GLuint,const GLfloat*); @@ -2132,22 +2311,46 @@ struct opengl_funcs void (WINE_GLAPI *p_glVariantubvEXT)(GLuint,const GLubyte*); void (WINE_GLAPI *p_glVariantuivEXT)(GLuint,const GLuint*); void (WINE_GLAPI *p_glVariantusvEXT)(GLuint,const GLushort*); + void (WINE_GLAPI *p_glVertex2bOES)(GLbyte); + void (WINE_GLAPI *p_glVertex2bvOES)(const GLbyte*); void (WINE_GLAPI *p_glVertex2hNV)(GLhalfNV,GLhalfNV); void (WINE_GLAPI *p_glVertex2hvNV)(const GLhalfNV*); + void (WINE_GLAPI *p_glVertex2xOES)(GLfixed); + void (WINE_GLAPI *p_glVertex2xvOES)(const GLfixed*); + void (WINE_GLAPI *p_glVertex3bOES)(GLbyte,GLbyte); + void (WINE_GLAPI *p_glVertex3bvOES)(const GLbyte*); void (WINE_GLAPI *p_glVertex3hNV)(GLhalfNV,GLhalfNV,GLhalfNV); void (WINE_GLAPI *p_glVertex3hvNV)(const GLhalfNV*); + void (WINE_GLAPI *p_glVertex3xOES)(GLfixed,GLfixed); + void (WINE_GLAPI *p_glVertex3xvOES)(const GLfixed*); + void (WINE_GLAPI *p_glVertex4bOES)(GLbyte,GLbyte,GLbyte); + void (WINE_GLAPI *p_glVertex4bvOES)(const GLbyte*); void (WINE_GLAPI *p_glVertex4hNV)(GLhalfNV,GLhalfNV,GLhalfNV,GLhalfNV); void (WINE_GLAPI *p_glVertex4hvNV)(const GLhalfNV*); + void (WINE_GLAPI *p_glVertex4xOES)(GLfixed,GLfixed,GLfixed); + void (WINE_GLAPI *p_glVertex4xvOES)(const GLfixed*); void (WINE_GLAPI *p_glVertexArrayBindVertexBufferEXT)(GLuint,GLuint,GLuint,GLintptr,GLsizei); + void (WINE_GLAPI *p_glVertexArrayColorOffsetEXT)(GLuint,GLuint,GLint,GLenum,GLsizei,GLintptr); + void (WINE_GLAPI *p_glVertexArrayEdgeFlagOffsetEXT)(GLuint,GLuint,GLsizei,GLintptr); + void (WINE_GLAPI *p_glVertexArrayFogCoordOffsetEXT)(GLuint,GLuint,GLenum,GLsizei,GLintptr); + void (WINE_GLAPI *p_glVertexArrayIndexOffsetEXT)(GLuint,GLuint,GLenum,GLsizei,GLintptr); + void (WINE_GLAPI *p_glVertexArrayMultiTexCoordOffsetEXT)(GLuint,GLuint,GLenum,GLint,GLenum,GLsizei,GLintptr); + void (WINE_GLAPI *p_glVertexArrayNormalOffsetEXT)(GLuint,GLuint,GLenum,GLsizei,GLintptr); void (WINE_GLAPI *p_glVertexArrayParameteriAPPLE)(GLenum,GLint); - void (WINE_GLAPI *p_glVertexArrayRangeAPPLE)(GLsizei,GLvoid*); - void (WINE_GLAPI *p_glVertexArrayRangeNV)(GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glVertexArrayRangeAPPLE)(GLsizei,void*); + void (WINE_GLAPI *p_glVertexArrayRangeNV)(GLsizei,const void*); + void (WINE_GLAPI *p_glVertexArraySecondaryColorOffsetEXT)(GLuint,GLuint,GLint,GLenum,GLsizei,GLintptr); + void (WINE_GLAPI *p_glVertexArrayTexCoordOffsetEXT)(GLuint,GLuint,GLint,GLenum,GLsizei,GLintptr); void (WINE_GLAPI *p_glVertexArrayVertexAttribBindingEXT)(GLuint,GLuint,GLuint); + void (WINE_GLAPI *p_glVertexArrayVertexAttribDivisorEXT)(GLuint,GLuint,GLuint); void (WINE_GLAPI *p_glVertexArrayVertexAttribFormatEXT)(GLuint,GLuint,GLint,GLenum,GLboolean,GLuint); void (WINE_GLAPI *p_glVertexArrayVertexAttribIFormatEXT)(GLuint,GLuint,GLint,GLenum,GLuint); + void (WINE_GLAPI *p_glVertexArrayVertexAttribIOffsetEXT)(GLuint,GLuint,GLuint,GLint,GLenum,GLsizei,GLintptr); void (WINE_GLAPI *p_glVertexArrayVertexAttribLFormatEXT)(GLuint,GLuint,GLint,GLenum,GLuint); void (WINE_GLAPI *p_glVertexArrayVertexAttribLOffsetEXT)(GLuint,GLuint,GLuint,GLint,GLenum,GLsizei,GLintptr); + void (WINE_GLAPI *p_glVertexArrayVertexAttribOffsetEXT)(GLuint,GLuint,GLuint,GLint,GLenum,GLboolean,GLsizei,GLintptr); void (WINE_GLAPI *p_glVertexArrayVertexBindingDivisorEXT)(GLuint,GLuint,GLuint); + void (WINE_GLAPI *p_glVertexArrayVertexOffsetEXT)(GLuint,GLuint,GLint,GLenum,GLsizei,GLintptr); void (WINE_GLAPI *p_glVertexAttrib1d)(GLuint,GLdouble); void (WINE_GLAPI *p_glVertexAttrib1dARB)(GLuint,GLdouble); void (WINE_GLAPI *p_glVertexAttrib1dNV)(GLuint,GLdouble); @@ -2302,44 +2505,46 @@ struct opengl_funcs void (WINE_GLAPI *p_glVertexAttribI4usvEXT)(GLuint,const GLushort*); void (WINE_GLAPI *p_glVertexAttribIFormat)(GLuint,GLint,GLenum,GLuint); void (WINE_GLAPI *p_glVertexAttribIFormatNV)(GLuint,GLint,GLenum,GLsizei); - void (WINE_GLAPI *p_glVertexAttribIPointer)(GLuint,GLint,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glVertexAttribIPointerEXT)(GLuint,GLint,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glVertexAttribIPointer)(GLuint,GLint,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glVertexAttribIPointerEXT)(GLuint,GLint,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glVertexAttribL1d)(GLuint,GLdouble); void (WINE_GLAPI *p_glVertexAttribL1dEXT)(GLuint,GLdouble); void (WINE_GLAPI *p_glVertexAttribL1dv)(GLuint,const GLdouble*); void (WINE_GLAPI *p_glVertexAttribL1dvEXT)(GLuint,const GLdouble*); - void (WINE_GLAPI *p_glVertexAttribL1i64NV)(GLuint,INT64); - void (WINE_GLAPI *p_glVertexAttribL1i64vNV)(GLuint,const INT64*); - void (WINE_GLAPI *p_glVertexAttribL1ui64NV)(GLuint,UINT64); - void (WINE_GLAPI *p_glVertexAttribL1ui64vNV)(GLuint,const UINT64*); + void (WINE_GLAPI *p_glVertexAttribL1i64NV)(GLuint,GLint64EXT); + void (WINE_GLAPI *p_glVertexAttribL1i64vNV)(GLuint,const GLint64EXT*); + void (WINE_GLAPI *p_glVertexAttribL1ui64ARB)(GLuint,GLuint64EXT); + void (WINE_GLAPI *p_glVertexAttribL1ui64NV)(GLuint,GLuint64EXT); + void (WINE_GLAPI *p_glVertexAttribL1ui64vARB)(GLuint,const GLuint64EXT*); + void (WINE_GLAPI *p_glVertexAttribL1ui64vNV)(GLuint,const GLuint64EXT*); void (WINE_GLAPI *p_glVertexAttribL2d)(GLuint,GLdouble,GLdouble); void (WINE_GLAPI *p_glVertexAttribL2dEXT)(GLuint,GLdouble,GLdouble); void (WINE_GLAPI *p_glVertexAttribL2dv)(GLuint,const GLdouble*); void (WINE_GLAPI *p_glVertexAttribL2dvEXT)(GLuint,const GLdouble*); - void (WINE_GLAPI *p_glVertexAttribL2i64NV)(GLuint,INT64,INT64); - void (WINE_GLAPI *p_glVertexAttribL2i64vNV)(GLuint,const INT64*); - void (WINE_GLAPI *p_glVertexAttribL2ui64NV)(GLuint,UINT64,UINT64); - void (WINE_GLAPI *p_glVertexAttribL2ui64vNV)(GLuint,const UINT64*); + void (WINE_GLAPI *p_glVertexAttribL2i64NV)(GLuint,GLint64EXT,GLint64EXT); + void (WINE_GLAPI *p_glVertexAttribL2i64vNV)(GLuint,const GLint64EXT*); + void (WINE_GLAPI *p_glVertexAttribL2ui64NV)(GLuint,GLuint64EXT,GLuint64EXT); + void (WINE_GLAPI *p_glVertexAttribL2ui64vNV)(GLuint,const GLuint64EXT*); void (WINE_GLAPI *p_glVertexAttribL3d)(GLuint,GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glVertexAttribL3dEXT)(GLuint,GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glVertexAttribL3dv)(GLuint,const GLdouble*); void (WINE_GLAPI *p_glVertexAttribL3dvEXT)(GLuint,const GLdouble*); - void (WINE_GLAPI *p_glVertexAttribL3i64NV)(GLuint,INT64,INT64,INT64); - void (WINE_GLAPI *p_glVertexAttribL3i64vNV)(GLuint,const INT64*); - void (WINE_GLAPI *p_glVertexAttribL3ui64NV)(GLuint,UINT64,UINT64,UINT64); - void (WINE_GLAPI *p_glVertexAttribL3ui64vNV)(GLuint,const UINT64*); + void (WINE_GLAPI *p_glVertexAttribL3i64NV)(GLuint,GLint64EXT,GLint64EXT,GLint64EXT); + void (WINE_GLAPI *p_glVertexAttribL3i64vNV)(GLuint,const GLint64EXT*); + void (WINE_GLAPI *p_glVertexAttribL3ui64NV)(GLuint,GLuint64EXT,GLuint64EXT,GLuint64EXT); + void (WINE_GLAPI *p_glVertexAttribL3ui64vNV)(GLuint,const GLuint64EXT*); void (WINE_GLAPI *p_glVertexAttribL4d)(GLuint,GLdouble,GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glVertexAttribL4dEXT)(GLuint,GLdouble,GLdouble,GLdouble,GLdouble); void (WINE_GLAPI *p_glVertexAttribL4dv)(GLuint,const GLdouble*); void (WINE_GLAPI *p_glVertexAttribL4dvEXT)(GLuint,const GLdouble*); - void (WINE_GLAPI *p_glVertexAttribL4i64NV)(GLuint,INT64,INT64,INT64,INT64); - void (WINE_GLAPI *p_glVertexAttribL4i64vNV)(GLuint,const INT64*); - void (WINE_GLAPI *p_glVertexAttribL4ui64NV)(GLuint,UINT64,UINT64,UINT64,UINT64); - void (WINE_GLAPI *p_glVertexAttribL4ui64vNV)(GLuint,const UINT64*); + void (WINE_GLAPI *p_glVertexAttribL4i64NV)(GLuint,GLint64EXT,GLint64EXT,GLint64EXT,GLint64EXT); + void (WINE_GLAPI *p_glVertexAttribL4i64vNV)(GLuint,const GLint64EXT*); + void (WINE_GLAPI *p_glVertexAttribL4ui64NV)(GLuint,GLuint64EXT,GLuint64EXT,GLuint64EXT,GLuint64EXT); + void (WINE_GLAPI *p_glVertexAttribL4ui64vNV)(GLuint,const GLuint64EXT*); void (WINE_GLAPI *p_glVertexAttribLFormat)(GLuint,GLint,GLenum,GLuint); void (WINE_GLAPI *p_glVertexAttribLFormatNV)(GLuint,GLint,GLenum,GLsizei); - void (WINE_GLAPI *p_glVertexAttribLPointer)(GLuint,GLint,GLenum,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glVertexAttribLPointerEXT)(GLuint,GLint,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glVertexAttribLPointer)(GLuint,GLint,GLenum,GLsizei,const void*); + void (WINE_GLAPI *p_glVertexAttribLPointerEXT)(GLuint,GLint,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glVertexAttribP1ui)(GLuint,GLenum,GLboolean,GLuint); void (WINE_GLAPI *p_glVertexAttribP1uiv)(GLuint,GLenum,GLboolean,const GLuint*); void (WINE_GLAPI *p_glVertexAttribP2ui)(GLuint,GLenum,GLboolean,GLuint); @@ -2348,9 +2553,10 @@ struct opengl_funcs void (WINE_GLAPI *p_glVertexAttribP3uiv)(GLuint,GLenum,GLboolean,const GLuint*); void (WINE_GLAPI *p_glVertexAttribP4ui)(GLuint,GLenum,GLboolean,GLuint); void (WINE_GLAPI *p_glVertexAttribP4uiv)(GLuint,GLenum,GLboolean,const GLuint*); - void (WINE_GLAPI *p_glVertexAttribPointer)(GLuint,GLint,GLenum,GLboolean,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glVertexAttribPointerARB)(GLuint,GLint,GLenum,GLboolean,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glVertexAttribPointerNV)(GLuint,GLint,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glVertexAttribParameteriAMD)(GLuint,GLenum,GLint); + void (WINE_GLAPI *p_glVertexAttribPointer)(GLuint,GLint,GLenum,GLboolean,GLsizei,const void*); + void (WINE_GLAPI *p_glVertexAttribPointerARB)(GLuint,GLint,GLenum,GLboolean,GLsizei,const void*); + void (WINE_GLAPI *p_glVertexAttribPointerNV)(GLuint,GLint,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glVertexAttribs1dvNV)(GLuint,GLsizei,const GLdouble*); void (WINE_GLAPI *p_glVertexAttribs1fvNV)(GLuint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glVertexAttribs1hvNV)(GLuint,GLsizei,const GLhalfNV*); @@ -2379,9 +2585,9 @@ struct opengl_funcs void (WINE_GLAPI *p_glVertexP3uiv)(GLenum,const GLuint*); void (WINE_GLAPI *p_glVertexP4ui)(GLenum,GLuint); void (WINE_GLAPI *p_glVertexP4uiv)(GLenum,const GLuint*); - void (WINE_GLAPI *p_glVertexPointerEXT)(GLint,GLenum,GLsizei,GLsizei,const GLvoid*); - void (WINE_GLAPI *p_glVertexPointerListIBM)(GLint,GLenum,GLint,const GLvoid**,GLint); - void (WINE_GLAPI *p_glVertexPointervINTEL)(GLint,GLenum,const GLvoid**); + void (WINE_GLAPI *p_glVertexPointerEXT)(GLint,GLenum,GLsizei,GLsizei,const void*); + void (WINE_GLAPI *p_glVertexPointerListIBM)(GLint,GLenum,GLint,const void**,GLint); + void (WINE_GLAPI *p_glVertexPointervINTEL)(GLint,GLenum,const void**); void (WINE_GLAPI *p_glVertexStream1dATI)(GLenum,GLdouble); void (WINE_GLAPI *p_glVertexStream1dvATI)(GLenum,const GLdouble*); void (WINE_GLAPI *p_glVertexStream1fATI)(GLenum,GLfloat); @@ -2414,21 +2620,21 @@ struct opengl_funcs void (WINE_GLAPI *p_glVertexStream4ivATI)(GLenum,const GLint*); void (WINE_GLAPI *p_glVertexStream4sATI)(GLenum,GLshort,GLshort,GLshort,GLshort); void (WINE_GLAPI *p_glVertexStream4svATI)(GLenum,const GLshort*); - void (WINE_GLAPI *p_glVertexWeightPointerEXT)(GLint,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glVertexWeightPointerEXT)(GLint,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glVertexWeightfEXT)(GLfloat); void (WINE_GLAPI *p_glVertexWeightfvEXT)(const GLfloat*); void (WINE_GLAPI *p_glVertexWeighthNV)(GLhalfNV); void (WINE_GLAPI *p_glVertexWeighthvNV)(const GLhalfNV*); - GLenum (WINE_GLAPI *p_glVideoCaptureNV)(GLuint,GLuint*,UINT64*); + GLenum (WINE_GLAPI *p_glVideoCaptureNV)(GLuint,GLuint*,GLuint64EXT*); void (WINE_GLAPI *p_glVideoCaptureStreamParameterdvNV)(GLuint,GLuint,GLenum,const GLdouble*); void (WINE_GLAPI *p_glVideoCaptureStreamParameterfvNV)(GLuint,GLuint,GLenum,const GLfloat*); void (WINE_GLAPI *p_glVideoCaptureStreamParameterivNV)(GLuint,GLuint,GLenum,const GLint*); void (WINE_GLAPI *p_glViewportArrayv)(GLuint,GLsizei,const GLfloat*); void (WINE_GLAPI *p_glViewportIndexedf)(GLuint,GLfloat,GLfloat,GLfloat,GLfloat); void (WINE_GLAPI *p_glViewportIndexedfv)(GLuint,const GLfloat*); - void (WINE_GLAPI *p_glWaitSync)(GLvoid*,GLbitfield,UINT64); + void (WINE_GLAPI *p_glWaitSync)(GLsync,GLbitfield,GLuint64); void (WINE_GLAPI *p_glWeightPathsNV)(GLuint,GLsizei,const GLuint*,const GLfloat*); - void (WINE_GLAPI *p_glWeightPointerARB)(GLint,GLenum,GLsizei,const GLvoid*); + void (WINE_GLAPI *p_glWeightPointerARB)(GLint,GLenum,GLsizei,const void*); void (WINE_GLAPI *p_glWeightbvARB)(GLint,const GLbyte*); void (WINE_GLAPI *p_glWeightdvARB)(GLint,const GLdouble*); void (WINE_GLAPI *p_glWeightfvARB)(GLint,const GLfloat*); @@ -2494,7 +2700,7 @@ struct opengl_funcs void (WINE_GLAPI *p_glWindowPos4sMESA)(GLshort,GLshort,GLshort,GLshort); void (WINE_GLAPI *p_glWindowPos4svMESA)(const GLshort*); void (WINE_GLAPI *p_glWriteMaskEXT)(GLuint,GLuint,GLenum,GLenum,GLenum,GLenum); - GLvoid* (WINE_GLAPI *p_wglAllocateMemoryNV)(GLsizei,GLfloat,GLfloat,GLfloat); + void* (WINE_GLAPI *p_wglAllocateMemoryNV)(GLsizei,GLfloat,GLfloat,GLfloat); BOOL (WINE_GLAPI *p_wglBindTexImageARB)(struct wgl_pbuffer *,int); BOOL (WINE_GLAPI *p_wglChoosePixelFormatARB)(HDC,const int*,const FLOAT*,UINT,int*,UINT*); struct wgl_context * (WINE_GLAPI *p_wglCreateContextAttribsARB)(HDC,struct wgl_context *,const int*); @@ -2502,8 +2708,8 @@ struct opengl_funcs BOOL (WINE_GLAPI *p_wglDestroyPbufferARB)(struct wgl_pbuffer *); void (WINE_GLAPI *p_wglFreeMemoryNV)(void*); HDC (WINE_GLAPI *p_wglGetCurrentReadDCARB)(void); - const GLubyte * (WINE_GLAPI *p_wglGetExtensionsStringARB)(HDC); - const GLubyte * (WINE_GLAPI *p_wglGetExtensionsStringEXT)(void); + const char* (WINE_GLAPI *p_wglGetExtensionsStringARB)(HDC); + const char* (WINE_GLAPI *p_wglGetExtensionsStringEXT)(void); HDC (WINE_GLAPI *p_wglGetPbufferDCARB)(struct wgl_pbuffer *); BOOL (WINE_GLAPI *p_wglGetPixelFormatAttribfvARB)(HDC,int,int,UINT,const int*,FLOAT*); BOOL (WINE_GLAPI *p_wglGetPixelFormatAttribivARB)(HDC,int,int,UINT,const int*,int*); diff --git a/reactos/include/reactos/wine/wined3d.h b/reactos/include/reactos/wine/wined3d.h index 7ddd4664bff..50bacdd59c1 100644 --- a/reactos/include/reactos/wine/wined3d.h +++ b/reactos/include/reactos/wine/wined3d.h @@ -26,6 +26,8 @@ #ifndef __WINE_WINED3D_H #define __WINE_WINED3D_H +#include + #define WINED3D_OK S_OK #define _FACWINED3D 0x876 @@ -249,6 +251,7 @@ enum wined3d_format_id WINED3DFMT_NULL = WINEMAKEFOURCC('N','U','L','L'), WINED3DFMT_R16 = WINEMAKEFOURCC(' ','R','1','6'), WINED3DFMT_AL16 = WINEMAKEFOURCC('A','L','1','6'), + WINED3DFMT_NV12 = WINEMAKEFOURCC('N','V','1','2'), WINED3DFMT_FORCE_DWORD = 0xffffffff }; @@ -707,6 +710,12 @@ enum wined3d_query_type WINED3D_QUERY_TYPE_CACHE_UTILIZATION = 18 }; +struct wined3d_query_data_timestamp_disjoint +{ + UINT64 frequency; + BOOL disjoint; +}; + #define WINED3DISSUE_BEGIN (1 << 1) #define WINED3DISSUE_END (1 << 0) #define WINED3DGETDATA_FLUSH (1 << 0) @@ -1217,6 +1226,7 @@ enum wined3d_display_rotation #define WINED3D_LEGACY_DEPTH_BIAS 0x00000001 #define WINED3D_NO3D 0x00000002 #define WINED3D_VIDMEM_ACCOUNTING 0x00000004 +#define WINED3D_PRESENT_CONVERSION 0x00000008 #define WINED3D_RESZ_CODE 0x7fa05000 @@ -1981,6 +1991,25 @@ struct wined3d_device_parent_ops struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain); }; +struct wined3d_private_store +{ + struct list content; +}; + +struct wined3d_private_data +{ + struct list entry; + + GUID tag; + DWORD flags; /* DDSPD_* */ + DWORD size; + union + { + BYTE data[1]; + IUnknown *object; + } content; +}; + typedef HRESULT (CDECL *wined3d_device_reset_cb)(struct wined3d_resource *resource); void __stdcall wined3d_mutex_lock(void); @@ -2001,7 +2030,7 @@ HRESULT __cdecl wined3d_check_device_multisample_type(const struct wined3d *wine HRESULT __cdecl wined3d_check_device_type(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id display_format_id, enum wined3d_format_id backbuffer_format_id, BOOL windowed); -struct wined3d * __cdecl wined3d_create(UINT version, DWORD flags); +struct wined3d * __cdecl wined3d_create(DWORD flags); ULONG __cdecl wined3d_decref(struct wined3d *wined3d); HRESULT __cdecl wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering, @@ -2243,15 +2272,84 @@ enum wined3d_query_type __cdecl wined3d_query_get_type(const struct wined3d_quer ULONG __cdecl wined3d_query_incref(struct wined3d_query *query); HRESULT __cdecl wined3d_query_issue(struct wined3d_query *query, DWORD flags); -HRESULT __cdecl wined3d_resource_free_private_data(struct wined3d_resource *resource, REFGUID guid); +static inline void wined3d_private_store_init(struct wined3d_private_store *store) +{ + list_init(&store->content); +} + +static inline struct wined3d_private_data *wined3d_private_store_get_private_data( + const struct wined3d_private_store *store, const GUID *tag) +{ + struct wined3d_private_data *data; + struct list *entry; + + LIST_FOR_EACH(entry, &store->content) + { + data = LIST_ENTRY(entry, struct wined3d_private_data, entry); + if (IsEqualGUID(&data->tag, tag)) + return data; + } + return NULL; +} + +static inline void wined3d_private_store_free_private_data(struct wined3d_private_store *store, + struct wined3d_private_data *entry) +{ + if (entry->flags & WINED3DSPD_IUNKNOWN) + IUnknown_Release(entry->content.object); + list_remove(&entry->entry); + HeapFree(GetProcessHeap(), 0, entry); +} + +static inline void wined3d_private_store_cleanup(struct wined3d_private_store *store) +{ + struct wined3d_private_data *data; + struct list *e1, *e2; + + LIST_FOR_EACH_SAFE(e1, e2, &store->content) + { + data = LIST_ENTRY(e1, struct wined3d_private_data, entry); + wined3d_private_store_free_private_data(store, data); + } +} + +static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_private_store *store, + const GUID *guid, const void *data, DWORD data_size, DWORD flags) +{ + struct wined3d_private_data *d, *old; + const void *ptr = data; + + if (flags & WINED3DSPD_IUNKNOWN) + { + if (data_size != sizeof(IUnknown *)) + return WINED3DERR_INVALIDCALL; + ptr = &data; + } + + if (!(d = HeapAlloc(GetProcessHeap(), 0, + FIELD_OFFSET(struct wined3d_private_data, content.data[data_size])))) + return E_OUTOFMEMORY; + + d->tag = *guid; + d->flags = flags; + d->size = data_size; + + memcpy(d->content.data, ptr, data_size); + if (flags & WINED3DSPD_IUNKNOWN) + IUnknown_AddRef(d->content.object); + + old = wined3d_private_store_get_private_data(store, guid); + if (old) + wined3d_private_store_free_private_data(store, old); + list_add_tail(&store->content, &d->entry); + + return WINED3D_OK; +} + void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc); void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource); -HRESULT __cdecl wined3d_resource_get_private_data(const struct wined3d_resource *resource, - REFGUID guid, void *data, DWORD *data_size); void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent); -HRESULT __cdecl wined3d_resource_set_private_data(struct wined3d_resource *resource, - REFGUID guid, const void *data, DWORD data_size, DWORD flags); HRESULT __cdecl wined3d_rendertarget_view_create(struct wined3d_resource *resource, void *parent, struct wined3d_rendertarget_view **rendertarget_view); diff --git a/reactos/include/reactos/wine/winedxgi.idl b/reactos/include/reactos/wine/winedxgi.idl index 363030a0018..26f29e385fd 100644 --- a/reactos/include/reactos/wine/winedxgi.idl +++ b/reactos/include/reactos/wine/winedxgi.idl @@ -23,7 +23,7 @@ import "dxgi.idl"; local, uuid(a07ad9ab-fb01-4574-8bfb-0a70a7373f04) ] -interface IWineDXGIFactory : IDXGIFactory +interface IWineDXGIFactory : IDXGIFactory1 { struct wined3d *get_wined3d(); } @@ -33,7 +33,7 @@ interface IWineDXGIFactory : IDXGIFactory local, uuid(ab1de34c-2963-4ffd-8493-40f580e510e5) ] -interface IWineDXGIAdapter : IDXGIAdapter +interface IWineDXGIAdapter : IDXGIAdapter1 { UINT get_ordinal(); } diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 282b51a09c9..fc459e9df2d 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -28,12 +28,12 @@ reactos/tools/wpp # Synced to Wine-1.7.1 The following libraries are shared with Wine. reactos/dll/directx/wine/amstream # Synced to Wine-1.7.17 -reactos/dll/directx/wine/d3d8 # Synced to Wine-1.7.11 -reactos/dll/directx/wine/d3d9 # Synced to Wine-1.7.11 +reactos/dll/directx/wine/d3d8 # Synced to Wine-1.7.17 +reactos/dll/directx/wine/d3d9 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.1 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.1 reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.1 -reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.11 +reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.17 reactos/dll/directx/wine/devenum # Synced to Wine-1.7.1 reactos/dll/directx/wine/dinput # Synced to Wine-1.7.1 reactos/dll/directx/wine/dinput8 # Synced to Wine-1.7.1 @@ -42,11 +42,11 @@ reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1 reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.1 reactos/dll/directx/wine/dsound # Synced to Wine-1.5.26 reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.1 -reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.1 +reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.17 reactos/dll/directx/wine/msdmo # Synced to Wine-1.7.1 -reactos/dll/directx/wine/qedit # Synced to Wine-1.7.1 +reactos/dll/directx/wine/qedit # Synced to Wine-1.7.17 reactos/dll/directx/wine/quartz # Synced to Wine-1.7.17 -reactos/dll/directx/wine/wined3d # Synced to Wine-1.7.11 +reactos/dll/directx/wine/wined3d # Synced to Wine-1.7.17 reactos/dll/win32/activeds # Synced to Wine-1.7.1 reactos/dll/win32/actxprxy # Synced to Wine-1.7.1 From 8462bb2dd850ed0a39613b42d52adf1776e99ce8 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 18:06:05 +0000 Subject: [PATCH 384/419] [PSDK] * Add missing CRYPT_USERDATA definition. svn path=/trunk/; revision=62812 --- reactos/include/psdk/wincrypt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/include/psdk/wincrypt.h b/reactos/include/psdk/wincrypt.h index 0d4f0678cd5..0ad401c686c 100644 --- a/reactos/include/psdk/wincrypt.h +++ b/reactos/include/psdk/wincrypt.h @@ -4027,6 +4027,8 @@ typedef BOOL #define EXPORT_PRIVATE_KEYS 0x00000004 #define PKCS12_EXPORT_RESERVED_MASK 0xffff0000 +#define CRYPT_USERDATA 0x00000001 + /* function declarations */ /* advapi32.dll */ WINADVAPI From bb00a030bbc13aa7373f1bb690e342e44180563b Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 18:11:58 +0000 Subject: [PATCH 385/419] [RSAENH] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62813 --- reactos/dll/win32/rsaenh/handle.c | 74 ++++----- reactos/dll/win32/rsaenh/handle.h | 8 +- reactos/dll/win32/rsaenh/implglue.c | 14 +- reactos/dll/win32/rsaenh/implglue.h | 14 +- reactos/dll/win32/rsaenh/mpi.c | 16 +- reactos/dll/win32/rsaenh/rsaenh.c | 240 ++++++++++++++++++---------- reactos/media/doc/README.WINE | 2 +- 7 files changed, 223 insertions(+), 145 deletions(-) diff --git a/reactos/dll/win32/rsaenh/handle.c b/reactos/dll/win32/rsaenh/handle.c index 0812dccc7f0..86d8c0cd9d5 100644 --- a/reactos/dll/win32/rsaenh/handle.c +++ b/reactos/dll/win32/rsaenh/handle.c @@ -90,13 +90,13 @@ void destroy_handle_table(struct handle_table *lpTable) * dwType [I] A magic value that identifies the referenced object's type. * * RETURNS - * non zero, if handle is valid. - * zero, if handle is not valid. + * TRUE, if handle is valid. + * FALSE, if handle is not valid. */ -int is_valid_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType) +BOOL is_valid_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType) { unsigned int index = HANDLE2INDEX(handle); - int ret = 0; + BOOL ret = FALSE; TRACE("(lpTable=%p, handle=%ld)\n", lpTable, handle); @@ -113,8 +113,8 @@ int is_valid_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType /* Check if this handle references an object of the correct type. */ if (lpTable->paEntries[index].pObject->dwType != dwType) goto exit; - - ret = 1; + + ret = TRUE; exit: LeaveCriticalSection(&lpTable->mutex); return ret; @@ -129,13 +129,13 @@ exit: * lpTable [I] Pointer to the table, which is to be grown * * RETURNS - * non zero, if successful - * zero, if not successful (out of memory on process heap) + * TRUE, if successful + * FALSE, if not successful (out of memory on process heap) * * NOTES * This is a support function for alloc_handle. Do not call! */ -static int grow_handle_table(struct handle_table *lpTable) +static BOOL grow_handle_table(struct handle_table *lpTable) { struct handle_table_entry *newEntries; unsigned int i, newIEntries; @@ -143,8 +143,8 @@ static int grow_handle_table(struct handle_table *lpTable) newIEntries = lpTable->iEntries + TABLE_SIZE_INCREMENT; newEntries = HeapAlloc(GetProcessHeap(), 0, sizeof(struct handle_table_entry)*newIEntries); - if (!newEntries) - return 0; + if (!newEntries) + return FALSE; if (lpTable->paEntries) { @@ -161,7 +161,7 @@ static int grow_handle_table(struct handle_table *lpTable) lpTable->paEntries = newEntries; lpTable->iEntries = newIEntries; - return 1; + return TRUE; } /****************************************************************************** @@ -177,12 +177,12 @@ static int grow_handle_table(struct handle_table *lpTable) * be stored. If not successful, this will be * INVALID_HANDLE_VALUE * RETURNS - * non zero, if successful - * zero, if not successful (no free handle) + * TRUE, if successful + * FALSE, if not successful (no free handle) */ -static int alloc_handle(struct handle_table *lpTable, OBJECTHDR *lpObject, HCRYPTKEY *lpHandle) +static BOOL alloc_handle(struct handle_table *lpTable, OBJECTHDR *lpObject, HCRYPTKEY *lpHandle) { - int ret = 0; + BOOL ret = FALSE; TRACE("(lpTable=%p, lpObject=%p, lpHandle=%p)\n", lpTable, lpObject, lpHandle); @@ -200,7 +200,7 @@ static int alloc_handle(struct handle_table *lpTable, OBJECTHDR *lpObject, HCRYP lpTable->iFirstFree = lpTable->paEntries[lpTable->iFirstFree].iNextFree; InterlockedIncrement(&lpObject->refcount); - ret = 1; + ret = TRUE; exit: LeaveCriticalSection(&lpTable->mutex); return ret; @@ -224,14 +224,14 @@ exit: * to be released. * * RETURNS - * non zero, if successful - * zero, if not successful (invalid handle) + * TRUE, if successful + * FALSE, if not successful (invalid handle) */ -int release_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType) +BOOL release_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType) { unsigned int index = HANDLE2INDEX(handle); OBJECTHDR *pObject; - int ret = 0; + BOOL ret = FALSE; TRACE("(lpTable=%p, handle=%ld)\n", lpTable, handle); @@ -251,8 +251,8 @@ int release_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType) lpTable->paEntries[index].pObject = NULL; lpTable->paEntries[index].iNextFree = lpTable->iFirstFree; lpTable->iFirstFree = index; - - ret = 1; + + ret = TRUE; exit: LeaveCriticalSection(&lpTable->mutex); return ret; @@ -266,16 +266,16 @@ exit: * PARAMS * lpTable [I] Pointer to the handle table, in which the handle is looked up. * handle [I] The handle, which is to be looked up - * lplpObject [O] Pointer to the variable, into which the pointer to the - * object looked up is copied. + * lplpObject [O] Pointer to the variable, into which the pointer to the + * object looked up is copied. * RETURNS - * non zero, if successful - * zero, if not successful (invalid handle) + * TRUE, if successful + * FALSE, if not successful (invalid handle) */ -int lookup_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType, OBJECTHDR **lplpObject) +BOOL lookup_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType, OBJECTHDR **lplpObject) { - int ret = 0; - + BOOL ret = FALSE; + TRACE("(lpTable=%p, handle=%ld, lplpObject=%p)\n", lpTable, handle, lplpObject); EnterCriticalSection(&lpTable->mutex); @@ -286,7 +286,7 @@ int lookup_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType, } *lplpObject = lpTable->paEntries[HANDLE2INDEX(handle)].pObject; - ret = 1; + ret = TRUE; exit: LeaveCriticalSection(&lpTable->mutex); return ret; @@ -304,14 +304,14 @@ exit: * copy [O] Pointer to a handle variable, where the copied handle is put. * * RETURNS - * non zero, if successful - * zero, if not successful (invalid handle or out of memory) + * TRUE, if successful + * FALSE, if not successful (invalid handle or out of memory) */ -int copy_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType, HCRYPTKEY *copy) +BOOL copy_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType, HCRYPTKEY *copy) { OBJECTHDR *pObject; - int ret; - + BOOL ret; + TRACE("(lpTable=%p, handle=%ld, copy=%p)\n", lpTable, handle, copy); EnterCriticalSection(&lpTable->mutex); @@ -319,7 +319,7 @@ int copy_handle(struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType, HC { *copy = (HCRYPTKEY)INVALID_HANDLE_VALUE; LeaveCriticalSection(&lpTable->mutex); - return 0; + return FALSE; } ret = alloc_handle(lpTable, pObject, copy); diff --git a/reactos/dll/win32/rsaenh/handle.h b/reactos/dll/win32/rsaenh/handle.h index 7dc70206c43..d3207a59e47 100644 --- a/reactos/dll/win32/rsaenh/handle.h +++ b/reactos/dll/win32/rsaenh/handle.h @@ -58,10 +58,10 @@ struct handle_table void init_handle_table (struct handle_table *lpTable) DECLSPEC_HIDDEN; void destroy_handle_table(struct handle_table *lpTable) DECLSPEC_HIDDEN; -int release_handle (struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType) DECLSPEC_HIDDEN; -int copy_handle (struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType, HCRYPTKEY *copy) DECLSPEC_HIDDEN; -int lookup_handle (struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType, OBJECTHDR **lplpObject) DECLSPEC_HIDDEN; -int is_valid_handle (struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType) DECLSPEC_HIDDEN; +BOOL release_handle (struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType) DECLSPEC_HIDDEN; +BOOL copy_handle (struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType, HCRYPTKEY *copy) DECLSPEC_HIDDEN; +BOOL lookup_handle (struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType, OBJECTHDR **lplpObject) DECLSPEC_HIDDEN; +BOOL is_valid_handle (struct handle_table *lpTable, HCRYPTKEY handle, DWORD dwType) DECLSPEC_HIDDEN; HCRYPTKEY new_object (struct handle_table *lpTable, size_t cbSize, DWORD dwType, DESTRUCTOR destructor, OBJECTHDR **ppObject) DECLSPEC_HIDDEN; diff --git a/reactos/dll/win32/rsaenh/implglue.c b/reactos/dll/win32/rsaenh/implglue.c index 2084b1f8ca6..3115973028a 100644 --- a/reactos/dll/win32/rsaenh/implglue.c +++ b/reactos/dll/win32/rsaenh/implglue.c @@ -87,7 +87,7 @@ BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext) return TRUE; } -BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, CONST BYTE *pbData, +BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, const BYTE *pbData, DWORD dwDataLen) { switch (aiAlgid) @@ -170,7 +170,7 @@ BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHash return TRUE; } -BOOL duplicate_hash_impl(ALG_ID aiAlgid, CONST HASH_CONTEXT *pSrcHashContext, +BOOL duplicate_hash_impl(ALG_ID aiAlgid, const HASH_CONTEXT *pSrcHashContext, HASH_CONTEXT *pDestHashContext) { *pDestHashContext = *pSrcHashContext; @@ -252,7 +252,7 @@ BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, return TRUE; } -BOOL duplicate_key_impl(ALG_ID aiAlgid, CONST KEY_CONTEXT *pSrcKeyContext, +BOOL duplicate_key_impl(ALG_ID aiAlgid, const KEY_CONTEXT *pSrcKeyContext, KEY_CONTEXT *pDestKeyContext) { switch (aiAlgid) @@ -300,8 +300,8 @@ static inline void reverse_bytes(BYTE *pbData, DWORD dwLen) { } } -BOOL encrypt_block_impl(ALG_ID aiAlgid, DWORD dwKeySpec, KEY_CONTEXT *pKeyContext, CONST BYTE *in, BYTE *out, - DWORD enc) +BOOL encrypt_block_impl(ALG_ID aiAlgid, DWORD dwKeySpec, KEY_CONTEXT *pKeyContext, const BYTE *in, + BYTE *out, DWORD enc) { unsigned long inlen, outlen; BYTE *in_reversed = NULL; @@ -409,7 +409,7 @@ BOOL export_public_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD return TRUE; } -BOOL import_public_key_impl(CONST BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, +BOOL import_public_key_impl(const BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DWORD dwPubExp) { BYTE *pbTemp; @@ -484,7 +484,7 @@ BOOL export_private_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD return TRUE; } -BOOL import_private_key_impl(CONST BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, +BOOL import_private_key_impl(const BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DWORD dwDataLen, DWORD dwPubExp) { BYTE *pbTemp, *pbBigNum; diff --git a/reactos/dll/win32/rsaenh/implglue.h b/reactos/dll/win32/rsaenh/implglue.h index efb58918bc7..3ac7eef62a1 100644 --- a/reactos/dll/win32/rsaenh/implglue.h +++ b/reactos/dll/win32/rsaenh/implglue.h @@ -73,31 +73,31 @@ typedef union tagKEY_CONTEXT { } KEY_CONTEXT; BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext) DECLSPEC_HIDDEN; -BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, CONST BYTE *pbData, +BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, const BYTE *pbData, DWORD dwDataLen) DECLSPEC_HIDDEN; BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHashValue) DECLSPEC_HIDDEN; -BOOL duplicate_hash_impl(ALG_ID aiAlgid, CONST HASH_CONTEXT *pSrcHashContext, +BOOL duplicate_hash_impl(ALG_ID aiAlgid, const HASH_CONTEXT *pSrcHashContext, HASH_CONTEXT *pDestHashContext) DECLSPEC_HIDDEN; BOOL new_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen) DECLSPEC_HIDDEN; BOOL free_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext) DECLSPEC_HIDDEN; BOOL setup_key_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DWORD dwEffectiveKeyLen, DWORD dwSaltLen, BYTE *abKeyValue) DECLSPEC_HIDDEN; -BOOL duplicate_key_impl(ALG_ID aiAlgid, CONST KEY_CONTEXT *pSrcKeyContext, +BOOL duplicate_key_impl(ALG_ID aiAlgid, const KEY_CONTEXT *pSrcKeyContext, KEY_CONTEXT *pDestKeyContext) DECLSPEC_HIDDEN; /* dwKeySpec is optional for symmetric key algorithms */ -BOOL encrypt_block_impl(ALG_ID aiAlgid, DWORD dwKeySpec, KEY_CONTEXT *pKeyContext, CONST BYTE *pbIn, BYTE *pbOut, - DWORD enc) DECLSPEC_HIDDEN; +BOOL encrypt_block_impl(ALG_ID aiAlgid, DWORD dwKeySpec, KEY_CONTEXT *pKeyContext, const BYTE *pbIn, + BYTE *pbOut, DWORD enc) DECLSPEC_HIDDEN; BOOL encrypt_stream_impl(ALG_ID aiAlgid, KEY_CONTEXT *pKeyContext, BYTE *pbInOut, DWORD dwLen) DECLSPEC_HIDDEN; BOOL export_public_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DWORD *pdwPubExp) DECLSPEC_HIDDEN; -BOOL import_public_key_impl(CONST BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, +BOOL import_public_key_impl(const BYTE *pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DWORD dwPubExp) DECLSPEC_HIDDEN; BOOL export_private_key_impl(BYTE *pbDest, const KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DWORD *pdwPubExp) DECLSPEC_HIDDEN; -BOOL import_private_key_impl(CONST BYTE* pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, +BOOL import_private_key_impl(const BYTE* pbSrc, KEY_CONTEXT *pKeyContext, DWORD dwKeyLen, DWORD dwDataLen, DWORD dwPubExp) DECLSPEC_HIDDEN; BOOL gen_rand_impl(BYTE *pbBuffer, DWORD dwLen) DECLSPEC_HIDDEN; diff --git a/reactos/dll/win32/rsaenh/mpi.c b/reactos/dll/win32/rsaenh/mpi.c index 8feefa3c2b6..73bdf5f6ce9 100644 --- a/reactos/dll/win32/rsaenh/mpi.c +++ b/reactos/dll/win32/rsaenh/mpi.c @@ -1387,7 +1387,7 @@ static int mp_lshd (mp_int * a, int b) { int x, res; - /* if its less than zero return */ + /* if it's less than zero return */ if (b <= 0) { return MP_OKAY; } @@ -1624,7 +1624,7 @@ static int mp_div (const mp_int * a, const mp_int * b, mp_int * c, mp_int * d) norm = 0; } - /* note hac does 0 based, so if used==5 then its 0,1,2,3,4, e.g. use 4 */ + /* note hac does 0 based, so if used==5 then it's 0,1,2,3,4, e.g. use 4 */ n = x.used - 1; t = y.used - 1; @@ -1745,17 +1745,17 @@ __Q:mp_clear (&q); return res; } -static int s_is_power_of_two(mp_digit b, int *p) +static BOOL s_is_power_of_two(mp_digit b, int *p) { int x; for (x = 1; x < DIGIT_BIT; x++) { if (b == (((mp_digit)1)< //#include "winbase.h" #include -//#include "wincrypt.h" +#include #include "handle.h" #include "implglue.h" #include #include +#include WINE_DEFAULT_DEBUG_CHANNEL(crypt); @@ -335,7 +336,7 @@ static BOOL crypt_export_key( static BOOL import_key( HCRYPTPROV hProv, - CONST BYTE *pbData, + const BYTE *pbData, DWORD dwDataLen, HCRYPTKEY hPubKey, DWORD dwFlags, @@ -347,7 +348,7 @@ BOOL WINAPI RSAENH_CPHashData( HCRYPTPROV hProv, HCRYPTHASH hHash, - CONST BYTE *pbData, + const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags ); @@ -398,8 +399,8 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID reserved) * Success: TRUE (pbParam was copied into pbBuffer or pbBuffer is NULL) * Failure: FALSE (pbBuffer is not large enough to hold pbParam). Last error: ERROR_MORE_DATA */ -static inline BOOL copy_param( - BYTE *pbBuffer, DWORD *pdwBufferSize, CONST BYTE *pbParam, DWORD dwParamSize) +static inline BOOL copy_param(BYTE *pbBuffer, DWORD *pdwBufferSize, const BYTE *pbParam, + DWORD dwParamSize) { if (pbBuffer) { @@ -461,7 +462,8 @@ static inline const PROV_ENUMALGS_EX* get_algid_info(HCRYPTPROV hProv, ALG_ID al * NOTES * Use free_data_blob to release resources occupied by copy_data_blob. */ -static inline BOOL copy_data_blob(PCRYPT_DATA_BLOB dst, CONST PCRYPT_DATA_BLOB src) { +static inline BOOL copy_data_blob(PCRYPT_DATA_BLOB dst, const PCRYPT_DATA_BLOB src) +{ dst->pbData = HeapAlloc(GetProcessHeap(), 0, src->cbData); if (!dst->pbData) { SetLastError(NTE_NO_MEMORY); @@ -489,8 +491,8 @@ static inline BOOL copy_data_blob(PCRYPT_DATA_BLOB dst, CONST PCRYPT_DATA_BLOB s * NOTES * Release resources occupied by concat_data_blobs with free_data_blobs */ -static inline BOOL concat_data_blobs(PCRYPT_DATA_BLOB dst, CONST PCRYPT_DATA_BLOB src1, - CONST PCRYPT_DATA_BLOB src2) +static inline BOOL concat_data_blobs(PCRYPT_DATA_BLOB dst, const PCRYPT_DATA_BLOB src1, + const PCRYPT_DATA_BLOB src2) { dst->cbData = src1->cbData + src2->cbData; dst->pbData = HeapAlloc(GetProcessHeap(), 0, dst->cbData); @@ -655,7 +657,8 @@ static inline BOOL init_hash(CRYPTHASH *pCryptHash) { * pbData [I] Pointer to data stream to be hashed. * dwDataLen [I] Length of data stream. */ -static inline void update_hash(CRYPTHASH *pCryptHash, CONST BYTE *pbData, DWORD dwDataLen) { +static inline void update_hash(CRYPTHASH *pCryptHash, const BYTE *pbData, DWORD dwDataLen) +{ BYTE *pbTemp; switch (pCryptHash->aiAlgid) @@ -1099,7 +1102,7 @@ static BOOL create_container_key(KEYCONTAINER *pKeyContainer, REGSAM sam, HKEY * * dwFlags [I] Flags indicating which keyset to be opened. * phKey [O] Returned key */ -static BOOL open_container_key(LPCSTR pszContainerName, DWORD dwFlags, HKEY *phKey) +static BOOL open_container_key(LPCSTR pszContainerName, DWORD dwFlags, REGSAM access, HKEY *phKey) { CHAR szRSABase[MAX_PATH]; HKEY hRootKey; @@ -1113,7 +1116,7 @@ static BOOL open_container_key(LPCSTR pszContainerName, DWORD dwFlags, HKEY *phK /* @@ Wine registry key: HKLM\Software\Wine\Crypto\RSA */ /* @@ Wine registry key: HKCU\Software\Wine\Crypto\RSA */ - return RegOpenKeyExA(hRootKey, szRSABase, 0, KEY_READ, phKey) == + return RegOpenKeyExA(hRootKey, szRSABase, 0, access, phKey) == ERROR_SUCCESS; } @@ -1383,7 +1386,7 @@ static HCRYPTPROV read_key_container(PCHAR pszContainerName, DWORD dwFlags, cons HCRYPTPROV hKeyContainer; HCRYPTKEY hCryptKey; - if (!open_container_key(pszContainerName, dwFlags, &hKey)) + if (!open_container_key(pszContainerName, dwFlags, KEY_READ, &hKey)) { SetLastError(NTE_BAD_KEYSET); return (HCRYPTPROV)INVALID_HANDLE_VALUE; @@ -1434,14 +1437,14 @@ static HCRYPTPROV read_key_container(PCHAR pszContainerName, DWORD dwFlags, cons * Failure: FALSE (NTE_BAD_ALGID) */ static BOOL build_hash_signature(BYTE *pbSignature, DWORD dwLen, ALG_ID aiAlgid, - CONST BYTE *abHashValue, DWORD dwHashLen, DWORD dwFlags) + const BYTE *abHashValue, DWORD dwHashLen, DWORD dwFlags) { /* These prefixes are meant to be concatenated with hash values of the * respective kind to form a PKCS #7 DigestInfo. */ static const struct tagOIDDescriptor { ALG_ID aiAlgid; DWORD dwLen; - CONST BYTE abOID[19]; + const BYTE abOID[19]; } aOIDDescriptor[] = { { CALG_MD2, 18, { 0x30, 0x20, 0x30, 0x0c, 0x06, 0x08, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x02, 0x05, 0x00, 0x04, 0x10 } }, @@ -1529,7 +1532,8 @@ static BOOL build_hash_signature(BYTE *pbSignature, DWORD dwLen, ALG_ID aiAlgid, * Success: TRUE * Failure: FALSE */ -static BOOL tls1_p(HCRYPTHASH hHMAC, CONST PCRYPT_DATA_BLOB pblobSeed, PBYTE pbBuffer, DWORD dwBufferLen) +static BOOL tls1_p(HCRYPTHASH hHMAC, const PCRYPT_DATA_BLOB pblobSeed, BYTE *pbBuffer, + DWORD dwBufferLen) { CRYPTHASH *pHMAC; BYTE abAi[RSAENH_MAX_HASH_SIZE]; @@ -1587,8 +1591,8 @@ static BOOL tls1_p(HCRYPTHASH hHMAC, CONST PCRYPT_DATA_BLOB pblobSeed, PBYTE pbB * Success: TRUE * Failure: FALSE */ -static BOOL tls1_prf(HCRYPTPROV hProv, HCRYPTPROV hSecret, CONST PCRYPT_DATA_BLOB pblobLabel, - CONST PCRYPT_DATA_BLOB pblobSeed, PBYTE pbBuffer, DWORD dwBufferLen) +static BOOL tls1_prf(HCRYPTPROV hProv, HCRYPTPROV hSecret, const PCRYPT_DATA_BLOB pblobLabel, + const PCRYPT_DATA_BLOB pblobSeed, BYTE *pbBuffer, DWORD dwBufferLen) { HMAC_INFO hmacInfo = { 0, NULL, 0, NULL, 0 }; HCRYPTHASH hHMAC = (HCRYPTHASH)INVALID_HANDLE_VALUE; @@ -1656,7 +1660,7 @@ exit: * Success: TRUE * Failure: FALSE (NTE_BAD_LEN, too much data to pad) */ -static BOOL pad_data(CONST BYTE *abData, DWORD dwDataLen, BYTE *abBuffer, DWORD dwBufferLen, +static BOOL pad_data(const BYTE *abData, DWORD dwDataLen, BYTE *abBuffer, DWORD dwBufferLen, DWORD dwFlags) { DWORD i; @@ -1697,7 +1701,7 @@ static BOOL pad_data(CONST BYTE *abData, DWORD dwDataLen, BYTE *abBuffer, DWORD * Success: TRUE * Failure: FALSE, (NTE_BAD_DATA, no valid PKCS1 padding or buffer too small) */ -static BOOL unpad_data(CONST BYTE *abData, DWORD dwDataLen, BYTE *abBuffer, DWORD *dwBufferLen, +static BOOL unpad_data(const BYTE *abData, DWORD dwDataLen, BYTE *abBuffer, DWORD *dwBufferLen, DWORD dwFlags) { DWORD i; @@ -2721,13 +2725,13 @@ static void release_and_install_key(HCRYPTPROV hProv, HCRYPTKEY src, * Success: TRUE. * Failure: FALSE. */ -static BOOL import_private_key(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDataLen, +static BOOL import_private_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags, BOOL fStoreKey, HCRYPTKEY *phKey) { KEYCONTAINER *pKeyContainer; CRYPTKEY *pCryptKey; - CONST BLOBHEADER *pBlobHeader = (CONST BLOBHEADER*)pbData; - CONST RSAPUBKEY *pRSAPubKey = (CONST RSAPUBKEY*)(pBlobHeader+1); + const BLOBHEADER *pBlobHeader = (const BLOBHEADER*)pbData; + const RSAPUBKEY *pRSAPubKey = (const RSAPUBKEY*)(pBlobHeader+1); BOOL ret; if (dwFlags & CRYPT_IPSEC_HMAC_KEY) @@ -2771,7 +2775,7 @@ static BOOL import_private_key(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDat *phKey = new_key(hProv, pBlobHeader->aiKeyAlg, MAKELONG(0,pRSAPubKey->bitlen), &pCryptKey); if (*phKey == (HCRYPTKEY)INVALID_HANDLE_VALUE) return FALSE; setup_key(pCryptKey); - ret = import_private_key_impl((CONST BYTE*)(pRSAPubKey+1), &pCryptKey->context, + ret = import_private_key_impl((const BYTE*)(pRSAPubKey+1), &pCryptKey->context, pRSAPubKey->bitlen/8, dwDataLen, pRSAPubKey->pubexp); if (ret) { if (dwFlags & CRYPT_EXPORTABLE) @@ -2818,13 +2822,13 @@ static BOOL import_private_key(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDat * Success: TRUE. * Failure: FALSE. */ -static BOOL import_public_key(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDataLen, +static BOOL import_public_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags, BOOL fStoreKey, HCRYPTKEY *phKey) { KEYCONTAINER *pKeyContainer; CRYPTKEY *pCryptKey; - CONST BLOBHEADER *pBlobHeader = (CONST BLOBHEADER*)pbData; - CONST RSAPUBKEY *pRSAPubKey = (CONST RSAPUBKEY*)(pBlobHeader+1); + const BLOBHEADER *pBlobHeader = (const BLOBHEADER*)pbData; + const RSAPUBKEY *pRSAPubKey = (const RSAPUBKEY*)(pBlobHeader+1); ALG_ID algID; BOOL ret; @@ -2856,7 +2860,7 @@ static BOOL import_public_key(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwData *phKey = new_key(hProv, algID, MAKELONG(0,pRSAPubKey->bitlen), &pCryptKey); if (*phKey == (HCRYPTKEY)INVALID_HANDLE_VALUE) return FALSE; setup_key(pCryptKey); - ret = import_public_key_impl((CONST BYTE*)(pRSAPubKey+1), &pCryptKey->context, + ret = import_public_key_impl((const BYTE*)(pRSAPubKey+1), &pCryptKey->context, pRSAPubKey->bitlen >> 3, pRSAPubKey->pubexp); if (ret) { if (dwFlags & CRYPT_EXPORTABLE) @@ -2897,14 +2901,13 @@ static BOOL import_public_key(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwData * Success: TRUE. * Failure: FALSE. */ -static BOOL import_symmetric_key(HCRYPTPROV hProv, CONST BYTE *pbData, - DWORD dwDataLen, HCRYPTKEY hPubKey, - DWORD dwFlags, HCRYPTKEY *phKey) +static BOOL import_symmetric_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, + HCRYPTKEY hPubKey, DWORD dwFlags, HCRYPTKEY *phKey) { CRYPTKEY *pCryptKey, *pPubKey; - CONST BLOBHEADER *pBlobHeader = (CONST BLOBHEADER*)pbData; - CONST ALG_ID *pAlgid = (CONST ALG_ID*)(pBlobHeader+1); - CONST BYTE *pbKeyStream = (CONST BYTE*)(pAlgid + 1); + const BLOBHEADER *pBlobHeader = (const BLOBHEADER*)pbData; + const ALG_ID *pAlgid = (const ALG_ID*)(pBlobHeader+1); + const BYTE *pbKeyStream = (const BYTE*)(pAlgid + 1); BYTE *pbDecrypted; DWORD dwKeyLen; @@ -2974,14 +2977,13 @@ static BOOL import_symmetric_key(HCRYPTPROV hProv, CONST BYTE *pbData, * Success: TRUE. * Failure: FALSE. */ -static BOOL import_plaintext_key(HCRYPTPROV hProv, CONST BYTE *pbData, - DWORD dwDataLen, DWORD dwFlags, - HCRYPTKEY *phKey) +static BOOL import_plaintext_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, + DWORD dwFlags, HCRYPTKEY *phKey) { CRYPTKEY *pCryptKey; - CONST BLOBHEADER *pBlobHeader = (CONST BLOBHEADER*)pbData; - CONST DWORD *pKeyLen = (CONST DWORD *)(pBlobHeader + 1); - CONST BYTE *pbKeyStream = (CONST BYTE*)(pKeyLen + 1); + const BLOBHEADER *pBlobHeader = (const BLOBHEADER*)pbData; + const DWORD *pKeyLen = (const DWORD *)(pBlobHeader + 1); + const BYTE *pbKeyStream = (const BYTE*)(pKeyLen + 1); if (dwDataLen < sizeof(BLOBHEADER)+sizeof(DWORD)+*pKeyLen) { @@ -3053,12 +3055,11 @@ static BOOL import_plaintext_key(HCRYPTPROV hProv, CONST BYTE *pbData, * Success: TRUE. * Failure: FALSE. */ -static BOOL import_key(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDataLen, - HCRYPTKEY hPubKey, DWORD dwFlags, BOOL fStoreKey, - HCRYPTKEY *phKey) +static BOOL import_key(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, HCRYPTKEY hPubKey, + DWORD dwFlags, BOOL fStoreKey, HCRYPTKEY *phKey) { KEYCONTAINER *pKeyContainer; - CONST BLOBHEADER *pBlobHeader = (CONST BLOBHEADER*)pbData; + const BLOBHEADER *pBlobHeader = (const BLOBHEADER*)pbData; if (!lookup_handle(&handle_table, hProv, RSAENH_MAGIC_CONTAINER, (OBJECTHDR**)&pKeyContainer)) @@ -3124,7 +3125,7 @@ static BOOL import_key(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDataLen, * Success: TRUE. * Failure: FALSE. */ -BOOL WINAPI RSAENH_CPImportKey(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDataLen, +BOOL WINAPI RSAENH_CPImportKey(HCRYPTPROV hProv, const BYTE *pbData, DWORD dwDataLen, HCRYPTKEY hPubKey, DWORD dwFlags, HCRYPTKEY *phKey) { TRACE("(hProv=%08lx, pbData=%p, dwDataLen=%d, hPubKey=%08lx, dwFlags=%08x, phKey=%p)\n", @@ -3321,11 +3322,11 @@ BOOL WINAPI RSAENH_CPGetHashParam(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwPa switch (dwParam) { case HP_ALGID: - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&pCryptHash->aiAlgid, + return copy_param(pbData, pdwDataLen, (const BYTE*)&pCryptHash->aiAlgid, sizeof(ALG_ID)); case HP_HASHSIZE: - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&pCryptHash->dwHashSize, + return copy_param(pbData, pdwDataLen, (const BYTE*)&pCryptHash->dwHashSize, sizeof(DWORD)); case HP_HASHVAL: @@ -3619,37 +3620,37 @@ BOOL WINAPI RSAENH_CPGetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam case KP_PADDING: dwValue = PKCS5_PADDING; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwValue, sizeof(DWORD)); + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwValue, sizeof(DWORD)); case KP_KEYLEN: dwValue = pCryptKey->dwKeyLen << 3; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwValue, sizeof(DWORD)); - + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwValue, sizeof(DWORD)); + case KP_EFFECTIVE_KEYLEN: if (pCryptKey->dwEffectiveKeyLen) dwValue = pCryptKey->dwEffectiveKeyLen; else dwValue = pCryptKey->dwKeyLen << 3; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwValue, sizeof(DWORD)); + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwValue, sizeof(DWORD)); case KP_BLOCKLEN: dwValue = pCryptKey->dwBlockLen << 3; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwValue, sizeof(DWORD)); - + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwValue, sizeof(DWORD)); + case KP_MODE: - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&pCryptKey->dwMode, sizeof(DWORD)); + return copy_param(pbData, pdwDataLen, (const BYTE*)&pCryptKey->dwMode, sizeof(DWORD)); case KP_MODE_BITS: - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&pCryptKey->dwModeBits, + return copy_param(pbData, pdwDataLen, (const BYTE*)&pCryptKey->dwModeBits, sizeof(DWORD)); - + case KP_PERMISSIONS: - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&pCryptKey->dwPermissions, + return copy_param(pbData, pdwDataLen, (const BYTE*)&pCryptKey->dwPermissions, sizeof(DWORD)); case KP_ALGID: - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&pCryptKey->aiAlgid, sizeof(DWORD)); - + return copy_param(pbData, pdwDataLen, (const BYTE*)&pCryptKey->aiAlgid, sizeof(DWORD)); + default: SetLastError(NTE_BAD_TYPE); return FALSE; @@ -3678,6 +3679,7 @@ BOOL WINAPI RSAENH_CPGetKeyParam(HCRYPTPROV hProv, HCRYPTKEY hKey, DWORD dwParam * - PP_SIG_KEYSIZE_INC: RSA signature keywidth granularity in bits. * - PP_KEYX_KEYSIZE_INC: RSA key-exchange keywidth granularity in bits. * - PP_ENUMALGS{_EX}: Query provider capabilities. + * - PP_KEYSET_SEC_DESCR: Retrieve security descriptor on container. */ BOOL WINAPI RSAENH_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags) @@ -3692,7 +3694,7 @@ BOOL WINAPI RSAENH_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, * Returning this BLOB seems to satisfy IE. The marked 0x00 seem * to be 'don't care's. If you know anything more specific about * this provider parameter, please report to wine-devel@winehq.org */ - static CONST BYTE abWTF[96] = { + static const BYTE abWTF[96] = { 0xb0, 0x25, 0x63, 0x86, 0x9c, 0xab, 0xb6, 0x37, 0xe8, 0x82, /**/0x00,/**/ 0x72, 0x06, 0xb2, /**/0x00,/**/ 0x3b, 0x60, 0x35, /**/0x00,/**/ 0x3b, 0x88, 0xce, /**/0x00,/**/ 0x82, @@ -3727,42 +3729,42 @@ BOOL WINAPI RSAENH_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, { case PP_CONTAINER: case PP_UNIQUE_CONTAINER:/* MSDN says we can return the same value as PP_CONTAINER */ - return copy_param(pbData, pdwDataLen, (CONST BYTE*)pKeyContainer->szName, + return copy_param(pbData, pdwDataLen, (const BYTE*)pKeyContainer->szName, strlen(pKeyContainer->szName)+1); case PP_NAME: - return copy_param(pbData, pdwDataLen, (CONST BYTE*)pKeyContainer->szProvName, + return copy_param(pbData, pdwDataLen, (const BYTE*)pKeyContainer->szProvName, strlen(pKeyContainer->szProvName)+1); case PP_PROVTYPE: dwTemp = PROV_RSA_FULL; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwTemp, sizeof(dwTemp)); + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwTemp, sizeof(dwTemp)); case PP_KEYSPEC: dwTemp = AT_SIGNATURE | AT_KEYEXCHANGE; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwTemp, sizeof(dwTemp)); + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwTemp, sizeof(dwTemp)); case PP_KEYSET_TYPE: dwTemp = pKeyContainer->dwFlags & CRYPT_MACHINE_KEYSET; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwTemp, sizeof(dwTemp)); + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwTemp, sizeof(dwTemp)); case PP_KEYSTORAGE: dwTemp = CRYPT_SEC_DESCR; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwTemp, sizeof(dwTemp)); + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwTemp, sizeof(dwTemp)); case PP_SIG_KEYSIZE_INC: case PP_KEYX_KEYSIZE_INC: dwTemp = 8; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwTemp, sizeof(dwTemp)); + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwTemp, sizeof(dwTemp)); case PP_IMPTYPE: dwTemp = CRYPT_IMPL_SOFTWARE; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwTemp, sizeof(dwTemp)); + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwTemp, sizeof(dwTemp)); case PP_VERSION: dwTemp = 0x00000200; - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&dwTemp, sizeof(dwTemp)); - + return copy_param(pbData, pdwDataLen, (const BYTE*)&dwTemp, sizeof(dwTemp)); + case PP_ENUMCONTAINERS: if ((dwFlags & CRYPT_FIRST) == CRYPT_FIRST) pKeyContainer->dwEnumContainersCtr = 0; @@ -3771,7 +3773,7 @@ BOOL WINAPI RSAENH_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, return TRUE; } - if (!open_container_key("", dwFlags, &hKey)) + if (!open_container_key("", dwFlags, KEY_READ, &hKey)) { SetLastError(ERROR_NO_MORE_ITEMS); return FALSE; @@ -3821,16 +3823,16 @@ BOOL WINAPI RSAENH_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, memcpy(provEnumalgs.szName, aProvEnumAlgsEx [pKeyContainer->dwPersonality][pKeyContainer->dwEnumAlgsCtr].szName, 20*sizeof(CHAR)); - - return copy_param(pbData, pdwDataLen, (CONST BYTE*)&provEnumalgs, + + return copy_param(pbData, pdwDataLen, (const BYTE*)&provEnumalgs, sizeof(PROV_ENUMALGS)); } else { if (pbData && (*pdwDataLen >= sizeof(PROV_ENUMALGS_EX))) pKeyContainer->dwEnumAlgsCtr = ((dwFlags & CRYPT_FIRST) == CRYPT_FIRST) ? 0 : pKeyContainer->dwEnumAlgsCtr+1; - + return copy_param(pbData, pdwDataLen, - (CONST BYTE*)&aProvEnumAlgsEx + (const BYTE*)&aProvEnumAlgsEx [pKeyContainer->dwPersonality][pKeyContainer->dwEnumAlgsCtr], sizeof(PROV_ENUMALGS_EX)); } @@ -3838,6 +3840,34 @@ BOOL WINAPI RSAENH_CPGetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, case PP_CRYPT_COUNT_KEY_USE: /* Asked for by IE About dialog */ return copy_param(pbData, pdwDataLen, abWTF, sizeof(abWTF)); + case PP_KEYSET_SEC_DESCR: + { + SECURITY_DESCRIPTOR *sd; + DWORD err, len, flags = (pKeyContainer->dwFlags & CRYPT_MACHINE_KEYSET); + + if (!open_container_key(pKeyContainer->szName, flags, KEY_READ, &hKey)) + { + SetLastError(NTE_BAD_KEYSET); + return FALSE; + } + + err = GetSecurityInfo(hKey, SE_REGISTRY_KEY, dwFlags, NULL, NULL, NULL, NULL, (void **)&sd); + RegCloseKey(hKey); + if (err) + { + SetLastError(err); + return FALSE; + } + + len = GetSecurityDescriptorLength(sd); + if (*pdwDataLen >= len) memcpy(pbData, sd, len); + else SetLastError(ERROR_INSUFFICIENT_BUFFER); + *pdwDataLen = len; + + LocalFree(sd); + return TRUE; + } + default: /* MSDN: Unknown parameter number in dwParam */ SetLastError(NTE_BAD_TYPE); @@ -4080,7 +4110,7 @@ BOOL WINAPI RSAENH_CPGetUserKey(HCRYPTPROV hProv, DWORD dwKeySpec, HCRYPTKEY *ph * The actual hash value is queried with CPGetHashParam, which will finalize * the hash. Updating a finalized hash will fail with a last error NTE_BAD_HASH_STATE. */ -BOOL WINAPI RSAENH_CPHashData(HCRYPTPROV hProv, HCRYPTHASH hHash, CONST BYTE *pbData, +BOOL WINAPI RSAENH_CPHashData(HCRYPTPROV hProv, HCRYPTHASH hHash, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags) { CRYPTHASH *pCryptHash; @@ -4088,7 +4118,7 @@ BOOL WINAPI RSAENH_CPHashData(HCRYPTPROV hProv, HCRYPTHASH hHash, CONST BYTE *pb TRACE("(hProv=%08lx, hHash=%08lx, pbData=%p, dwDataLen=%d, dwFlags=%08x)\n", hProv, hHash, pbData, dwDataLen, dwFlags); - if (dwFlags) + if (dwFlags & ~CRYPT_USERDATA) { SetLastError(NTE_BAD_FLAGS); return FALSE; @@ -4313,8 +4343,56 @@ BOOL WINAPI RSAENH_CPSetHashParam(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwPa */ BOOL WINAPI RSAENH_CPSetProvParam(HCRYPTPROV hProv, DWORD dwParam, BYTE *pbData, DWORD dwFlags) { - FIXME("(stub)\n"); - return FALSE; + KEYCONTAINER *pKeyContainer; + HKEY hKey; + + TRACE("(hProv=%08lx, dwParam=%08x, pbData=%p, dwFlags=%08x)\n", hProv, dwParam, pbData, dwFlags); + + if (!lookup_handle(&handle_table, hProv, RSAENH_MAGIC_CONTAINER, (OBJECTHDR **)&pKeyContainer)) + { + SetLastError(NTE_BAD_UID); + return FALSE; + } + + switch (dwParam) + { + case PP_KEYSET_SEC_DESCR: + { + SECURITY_DESCRIPTOR *sd = (SECURITY_DESCRIPTOR *)pbData; + DWORD err, flags = (pKeyContainer->dwFlags & CRYPT_MACHINE_KEYSET); + BOOL def, present; + REGSAM access = WRITE_DAC | WRITE_OWNER | ACCESS_SYSTEM_SECURITY; + PSID owner = NULL, group = NULL; + PACL dacl = NULL, sacl = NULL; + + if (!open_container_key(pKeyContainer->szName, flags, access, &hKey)) + { + SetLastError(NTE_BAD_KEYSET); + return FALSE; + } + + if ((dwFlags & OWNER_SECURITY_INFORMATION && !GetSecurityDescriptorOwner(sd, &owner, &def)) || + (dwFlags & GROUP_SECURITY_INFORMATION && !GetSecurityDescriptorGroup(sd, &group, &def)) || + (dwFlags & DACL_SECURITY_INFORMATION && !GetSecurityDescriptorDacl(sd, &present, &dacl, &def)) || + (dwFlags & SACL_SECURITY_INFORMATION && !GetSecurityDescriptorSacl(sd, &present, &sacl, &def))) + { + RegCloseKey(hKey); + return FALSE; + } + + err = SetSecurityInfo(hKey, SE_REGISTRY_KEY, dwFlags, owner, group, dacl, sacl); + RegCloseKey(hKey); + if (err) + { + SetLastError(err); + return FALSE; + } + return TRUE; + } + default: + FIXME("unimplemented parameter %08x\n", dwParam); + return FALSE; + } } /****************************************************************************** @@ -4378,7 +4456,7 @@ BOOL WINAPI RSAENH_CPSignHash(HCRYPTPROV hProv, HCRYPTHASH hHash, DWORD dwKeySpe *pdwSigLen = pCryptKey->dwKeyLen; if (sDescription) { - if (!RSAENH_CPHashData(hProv, hHash, (CONST BYTE*)sDescription, + if (!RSAENH_CPHashData(hProv, hHash, (const BYTE*)sDescription, (DWORD)lstrlenW(sDescription)*sizeof(WCHAR), 0)) { goto out; @@ -4420,7 +4498,7 @@ out: * Success: TRUE (Signature is valid) * Failure: FALSE (GetLastError() == NTE_BAD_SIGNATURE, if signature is invalid) */ -BOOL WINAPI RSAENH_CPVerifySignature(HCRYPTPROV hProv, HCRYPTHASH hHash, CONST BYTE *pbSignature, +BOOL WINAPI RSAENH_CPVerifySignature(HCRYPTPROV hProv, HCRYPTHASH hHash, const BYTE *pbSignature, DWORD dwSigLen, HCRYPTKEY hPubKey, LPCWSTR sDescription, DWORD dwFlags) { @@ -4469,7 +4547,7 @@ BOOL WINAPI RSAENH_CPVerifySignature(HCRYPTPROV hProv, HCRYPTHASH hHash, CONST B } if (sDescription) { - if (!RSAENH_CPHashData(hProv, hHash, (CONST BYTE*)sDescription, + if (!RSAENH_CPHashData(hProv, hHash, (const BYTE*)sDescription, (DWORD)lstrlenW(sDescription)*sizeof(WCHAR), 0)) { return FALSE; diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index fc459e9df2d..e9b129cf6b1 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -167,7 +167,7 @@ reactos/dll/win32/riched20 # Synced to Wine-1.7.1 reactos/dll/win32/riched32 # Synced to Wine-1.7.1 reactos/dll/win32/rpcrt4 # Synced to Wine-1.7.1 reactos/dll/win32/rsabase # Synced to Wine-1.7.1 -reactos/dll/win32/rsaenh # Synced to Wine-1.7.1 +reactos/dll/win32/rsaenh # Synced to Wine-1.7.17 reactos/dll/win32/sccbase # Synced to Wine-1.7.1 reactos/dll/win32/schannel # Synced to Wine-1.7.1 reactos/dll/win32/scrrun # Synced to Wine-1.7.1 From b25de4f582a5b71806b346ca46d6ffb5f755fdde Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 18:12:06 +0000 Subject: [PATCH 386/419] [RSAENH_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62814 --- rostests/winetests/rsaenh/rsaenh.c | 200 +++++++++++++++-------------- 1 file changed, 103 insertions(+), 97 deletions(-) diff --git a/rostests/winetests/rsaenh/rsaenh.c b/rostests/winetests/rsaenh/rsaenh.c index f43a4e4f0cd..babc43540a8 100644 --- a/rostests/winetests/rsaenh/rsaenh.c +++ b/rostests/winetests/rsaenh/rsaenh.c @@ -84,9 +84,9 @@ static void uniquecontainer(char *unique) RegQueryValueExA(hkey, szMachineGuid, NULL, NULL, (LPBYTE)guid, &size); RegCloseKey(hkey); - lstrcpy(unique, szContainer_md5); - lstrcat(unique, "_"); - lstrcat(unique, guid); + lstrcpyA(unique, szContainer_md5); + lstrcatA(unique, "_"); + lstrcatA(unique, guid); } static void printBytes(const char *heading, const BYTE *pb, size_t cb) @@ -118,7 +118,7 @@ static void trace_hex(BYTE *pbData, DWORD dwLen) { } */ -static int init_base_environment(DWORD dwKeyFlags) +static BOOL init_base_environment(DWORD dwKeyFlags) { HCRYPTKEY hKey; BOOL result; @@ -127,12 +127,12 @@ static int init_base_environment(DWORD dwKeyFlags) hProv = (HCRYPTPROV)INVALID_HANDLE_VALUE; - result = CryptAcquireContext(&hProv, szContainer, szProvider, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); + result = CryptAcquireContextA(&hProv, szContainer, szProvider, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); ok(!result && (GetLastError()==NTE_BAD_FLAGS || broken(GetLastError() == NTE_KEYSET_NOT_DEF /* Win9x/NT4 */)), "%d, %08x\n", result, GetLastError()); - if (!CryptAcquireContext(&hProv, szContainer, szProvider, PROV_RSA_FULL, 0)) + if (!CryptAcquireContextA(&hProv, szContainer, szProvider, PROV_RSA_FULL, 0)) { ok(GetLastError()==NTE_BAD_KEYSET || broken(GetLastError() == NTE_TEMPORARY_PROFILE /* some Win7 setups */) || @@ -141,15 +141,15 @@ static int init_base_environment(DWORD dwKeyFlags) if (GetLastError()!=NTE_BAD_KEYSET) { win_skip("RSA full provider not available\n"); - return 0; + return FALSE; } - result = CryptAcquireContext(&hProv, szContainer, szProvider, PROV_RSA_FULL, + result = CryptAcquireContextA(&hProv, szContainer, szProvider, PROV_RSA_FULL, CRYPT_NEWKEYSET); ok(result, "%08x\n", GetLastError()); if (!result) { win_skip("Couldn't create crypto provider\n"); - return 0; + return FALSE; } result = CryptGenKey(hProv, AT_KEYEXCHANGE, dwKeyFlags, &hKey); ok(result, "%08x\n", GetLastError()); @@ -158,7 +158,7 @@ static int init_base_environment(DWORD dwKeyFlags) ok(result, "%08x\n", GetLastError()); if (result) CryptDestroyKey(hKey); } - return 1; + return TRUE; } static void clean_up_base_environment(void) @@ -175,10 +175,10 @@ static void clean_up_base_environment(void) result = CryptReleaseContext(hProv, 0); ok(!result && GetLastError()==ERROR_INVALID_PARAMETER, "%08x\n", GetLastError()); - CryptAcquireContext(&hProv, szContainer, szProvider, PROV_RSA_FULL, CRYPT_DELETEKEYSET); + CryptAcquireContextA(&hProv, szContainer, szProvider, PROV_RSA_FULL, CRYPT_DELETEKEYSET); } -static int init_aes_environment(void) +static BOOL init_aes_environment(void) { HCRYPTKEY hKey; BOOL result; @@ -188,26 +188,26 @@ static int init_aes_environment(void) hProv = (HCRYPTPROV)INVALID_HANDLE_VALUE; /* we are using NULL as provider name for RSA_AES provider as the provider - * names are different in Windows XP and Vista. Its different as to what - * its defined in the SDK on Windows XP. + * names are different in Windows XP and Vista. It's different to what + * is defined in the SDK on Windows XP. * This provider is available on Windows XP, Windows 2003 and Vista. */ - result = CryptAcquireContext(&hProv, szContainer, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT); + result = CryptAcquireContextA(&hProv, szContainer, NULL, PROV_RSA_AES, CRYPT_VERIFYCONTEXT); if (!result && GetLastError() == NTE_PROV_TYPE_NOT_DEF) { win_skip("RSA_AES provider not supported\n"); - return 0; + return FALSE; } ok(!result && GetLastError()==NTE_BAD_FLAGS, "%d, %08x\n", result, GetLastError()); - if (!CryptAcquireContext(&hProv, szContainer, NULL, PROV_RSA_AES, 0)) + if (!CryptAcquireContextA(&hProv, szContainer, NULL, PROV_RSA_AES, 0)) { ok(GetLastError()==NTE_BAD_KEYSET, "%08x\n", GetLastError()); - if (GetLastError()!=NTE_BAD_KEYSET) return 0; - result = CryptAcquireContext(&hProv, szContainer, NULL, PROV_RSA_AES, + if (GetLastError()!=NTE_BAD_KEYSET) return FALSE; + result = CryptAcquireContextA(&hProv, szContainer, NULL, PROV_RSA_AES, CRYPT_NEWKEYSET); ok(result, "%08x\n", GetLastError()); - if (!result) return 0; + if (!result) return FALSE; result = CryptGenKey(hProv, AT_KEYEXCHANGE, 0, &hKey); ok(result, "%08x\n", GetLastError()); if (result) CryptDestroyKey(hKey); @@ -215,7 +215,7 @@ static int init_aes_environment(void) ok(result, "%08x\n", GetLastError()); if (result) CryptDestroyKey(hKey); } - return 1; + return TRUE; } static void clean_up_aes_environment(void) @@ -225,7 +225,7 @@ static void clean_up_aes_environment(void) result = CryptReleaseContext(hProv, 1); ok(!result && GetLastError()==NTE_BAD_FLAGS, "%08x\n", GetLastError()); - CryptAcquireContext(&hProv, szContainer, NULL, PROV_RSA_AES, CRYPT_DELETEKEYSET); + CryptAcquireContextA(&hProv, szContainer, NULL, PROV_RSA_AES, CRYPT_DELETEKEYSET); } static void test_prov(void) @@ -446,7 +446,10 @@ static void test_hashes(void) result = CryptCreateHash(hProv, CALG_MD4, 0, 0, &hHash); ok(result, "%08x\n", GetLastError()); - result = CryptHashData(hHash, pbData, sizeof(pbData), 0); + result = CryptHashData(hHash, pbData, sizeof(pbData), ~0); + ok(!result && GetLastError() == NTE_BAD_FLAGS, "%08x\n", GetLastError()); + + result = CryptHashData(hHash, pbData, sizeof(pbData), CRYPT_USERDATA); ok(result, "%08x\n", GetLastError()); len = sizeof(DWORD); @@ -470,7 +473,10 @@ static void test_hashes(void) result = CryptGetHashParam(hHash, HP_HASHSIZE, (BYTE*)&hashlen, &len, 0); ok(result && (hashlen == 16), "%08x, hashlen: %d\n", GetLastError(), hashlen); - result = CryptHashData(hHash, pbData, sizeof(pbData), 0); + result = CryptHashData(hHash, pbData, sizeof(pbData), ~0); + ok(!result && GetLastError() == NTE_BAD_FLAGS, "%08x\n", GetLastError()); + + result = CryptHashData(hHash, pbData, sizeof(pbData), CRYPT_USERDATA); ok(result, "%08x\n", GetLastError()); len = 16; @@ -519,7 +525,7 @@ static void test_hashes(void) result = CryptCreateHash(hProv, CALG_SHA, 0, 0, &hHash); ok(result, "%08x\n", GetLastError()); - result = CryptHashData(hHash, pbData, 5, 0); + result = CryptHashData(hHash, pbData, 5, CRYPT_USERDATA); ok(result, "%08x\n", GetLastError()); if(pCryptDuplicateHash) { @@ -558,7 +564,7 @@ static void test_hashes(void) "expected NTE_BAD_ALGID, got %08x\n", GetLastError()); result = CryptAcquireContextA(&prov, NULL, szProvider, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); - ok(result, "CryptAcquireContext failed 0x%08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed 0x%08x\n", GetLastError()); result = CryptCreateHash(prov, CALG_SHA1, 0, 0, &hHash); ok(result, "CryptCreateHash failed 0x%08x\n", GetLastError()); @@ -586,7 +592,7 @@ static void test_hashes(void) } result = CryptAcquireContextA(&prov, NULL, szProvider, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); - ok(result, "CryptAcquireContext failed 0x%08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed 0x%08x\n", GetLastError()); result = CryptCreateHash(hProv, CALG_SHA1, 0, 0, &hHash); ok(result, "CryptCreateHash failed 0x%08x\n", GetLastError()); @@ -616,7 +622,7 @@ static void test_hashes(void) /* Test CALG_SSL3_SHAMD5 */ result = CryptAcquireContextA(&prov, NULL, szProvider, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); - ok(result, "CryptAcquireContext failed 0x%08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed 0x%08x\n", GetLastError()); /* Step 1: create an MD5 hash of the data */ result = CryptCreateHash(hProv, CALG_MD5, 0, 0, &hHash); @@ -650,10 +656,10 @@ static void test_hashes(void) result = CryptImportKey(hProv, abPlainPrivateKey, len, 0, 0, &hKeyExchangeKey); ok(result, "%08x\n", GetLastError()); len = 0; - result = CryptSignHash(hHash, AT_KEYEXCHANGE, NULL, 0, NULL, &len); + result = CryptSignHashA(hHash, AT_KEYEXCHANGE, NULL, 0, NULL, &len); ok(result, "%08x\n", GetLastError()); ok(len == 128, "expected len 128, got %d\n", len); - result = CryptSignHash(hHash, AT_KEYEXCHANGE, NULL, 0, pbSigValue, &len); + result = CryptSignHashA(hHash, AT_KEYEXCHANGE, NULL, 0, pbSigValue, &len); ok(result, "%08x\n", GetLastError()); ok(!memcmp(pbSigValue, signed_ssl3_shamd5_hash, len), "unexpected value\n"); if (len != 128 || memcmp(pbSigValue, signed_ssl3_shamd5_hash, len)) @@ -1916,28 +1922,28 @@ static void test_verify_signature(void) { if (!result) return; /*check that a NULL pointer signature is correctly handled*/ - result = CryptVerifySignature(hHash, NULL, 128, hPubSignKey, NULL, 0); + result = CryptVerifySignatureA(hHash, NULL, 128, hPubSignKey, NULL, 0); ok(!result && ERROR_INVALID_PARAMETER == GetLastError(), "Expected ERROR_INVALID_PARAMETER error, got %08x\n", GetLastError()); if (result) return; /* check that we get a bad signature error when the signature is too short*/ SetLastError(0xdeadbeef); - result = CryptVerifySignature(hHash, abSignatureMD2, 64, hPubSignKey, NULL, 0); + result = CryptVerifySignatureA(hHash, abSignatureMD2, 64, hPubSignKey, NULL, 0); ok((!result && NTE_BAD_SIGNATURE == GetLastError()) || broken(result), /* Win9x, WinMe, NT4 */ "Expected NTE_BAD_SIGNATURE, got %08x\n", GetLastError()); - result = CryptVerifySignature(hHash, abSignatureMD2, 128, hPubSignKey, NULL, 0); + result = CryptVerifySignatureA(hHash, abSignatureMD2, 128, hPubSignKey, NULL, 0); ok(result, "%08x\n", GetLastError()); if (!result) return; /* It seems that CPVerifySignature doesn't care about the OID at all. */ - result = CryptVerifySignature(hHash, abSignatureMD2NoOID, 128, hPubSignKey, NULL, 0); + result = CryptVerifySignatureA(hHash, abSignatureMD2NoOID, 128, hPubSignKey, NULL, 0); ok(result, "%08x\n", GetLastError()); if (!result) return; - result = CryptVerifySignature(hHash, abSignatureMD2NoOID, 128, hPubSignKey, NULL, CRYPT_NOHASHOID); + result = CryptVerifySignatureA(hHash, abSignatureMD2NoOID, 128, hPubSignKey, NULL, CRYPT_NOHASHOID); ok(result, "%08x\n", GetLastError()); if (!result) return; @@ -1951,15 +1957,15 @@ static void test_verify_signature(void) { ok(result, "%08x\n", GetLastError()); if (!result) return; - result = CryptVerifySignature(hHash, abSignatureMD4, 128, hPubSignKey, NULL, 0); + result = CryptVerifySignatureA(hHash, abSignatureMD4, 128, hPubSignKey, NULL, 0); ok(result, "%08x\n", GetLastError()); if (!result) return; - result = CryptVerifySignature(hHash, abSignatureMD4NoOID, 128, hPubSignKey, NULL, 0); + result = CryptVerifySignatureA(hHash, abSignatureMD4NoOID, 128, hPubSignKey, NULL, 0); ok(result, "%08x\n", GetLastError()); if (!result) return; - result = CryptVerifySignature(hHash, abSignatureMD4NoOID, 128, hPubSignKey, NULL, CRYPT_NOHASHOID); + result = CryptVerifySignatureA(hHash, abSignatureMD4NoOID, 128, hPubSignKey, NULL, CRYPT_NOHASHOID); ok(result, "%08x\n", GetLastError()); if (!result) return; @@ -1973,15 +1979,15 @@ static void test_verify_signature(void) { ok(result, "%08x\n", GetLastError()); if (!result) return; - result = CryptVerifySignature(hHash, abSignatureMD5, 128, hPubSignKey, NULL, 0); + result = CryptVerifySignatureA(hHash, abSignatureMD5, 128, hPubSignKey, NULL, 0); ok(result, "%08x\n", GetLastError()); if (!result) return; - result = CryptVerifySignature(hHash, abSignatureMD5NoOID, 128, hPubSignKey, NULL, 0); + result = CryptVerifySignatureA(hHash, abSignatureMD5NoOID, 128, hPubSignKey, NULL, 0); ok(result, "%08x\n", GetLastError()); if (!result) return; - result = CryptVerifySignature(hHash, abSignatureMD5NoOID, 128, hPubSignKey, NULL, CRYPT_NOHASHOID); + result = CryptVerifySignatureA(hHash, abSignatureMD5NoOID, 128, hPubSignKey, NULL, CRYPT_NOHASHOID); ok(result, "%08x\n", GetLastError()); if (!result) return; @@ -1995,15 +2001,15 @@ static void test_verify_signature(void) { ok(result, "%08x\n", GetLastError()); if (!result) return; - result = CryptVerifySignature(hHash, abSignatureSHA, 128, hPubSignKey, NULL, 0); + result = CryptVerifySignatureA(hHash, abSignatureSHA, 128, hPubSignKey, NULL, 0); ok(result, "%08x\n", GetLastError()); if (!result) return; - result = CryptVerifySignature(hHash, abSignatureSHANoOID, 128, hPubSignKey, NULL, 0); + result = CryptVerifySignatureA(hHash, abSignatureSHANoOID, 128, hPubSignKey, NULL, 0); ok(result, "%08x\n", GetLastError()); if (!result) return; - result = CryptVerifySignature(hHash, abSignatureSHANoOID, 128, hPubSignKey, NULL, CRYPT_NOHASHOID); + result = CryptVerifySignatureA(hHash, abSignatureSHANoOID, 128, hPubSignKey, NULL, CRYPT_NOHASHOID); ok(result, "%08x\n", GetLastError()); if (!result) return; @@ -2487,7 +2493,7 @@ static void test_schannel_provider(void) 0x3d, 0xca, 0x6a, 0x6f, 0xfa, 0x15, 0x4e, 0xaa }; - result = CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_SCHANNEL, CRYPT_VERIFYCONTEXT|CRYPT_NEWKEYSET); + result = CryptAcquireContextA(&hProv, NULL, NULL, PROV_RSA_SCHANNEL, CRYPT_VERIFYCONTEXT|CRYPT_NEWKEYSET); if (!result) { win_skip("no PROV_RSA_SCHANNEL support\n"); @@ -2497,7 +2503,7 @@ static void test_schannel_provider(void) if (result) CryptReleaseContext(hProv, 0); - result = CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_SCHANNEL, CRYPT_VERIFYCONTEXT); + result = CryptAcquireContextA(&hProv, NULL, NULL, PROV_RSA_SCHANNEL, CRYPT_VERIFYCONTEXT); ok (result, "%08x\n", GetLastError()); if (!result) return; @@ -2636,7 +2642,7 @@ static void test_schannel_provider(void) CryptDestroyKey(hRSAKey); CryptDestroyKey(hMasterSecret); CryptReleaseContext(hProv, 0); - CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_SCHANNEL, CRYPT_DELETEKEYSET); + CryptAcquireContextA(&hProv, NULL, NULL, PROV_RSA_SCHANNEL, CRYPT_DELETEKEYSET); } /* Test that a key can be used to encrypt data and exported, and that, when @@ -2652,13 +2658,13 @@ static void test_rsa_round_trip(void) BYTE data[256], *exportedKey; DWORD dataLen, keyLen; - CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); /* Generate a new key... */ - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); - ok(result, "CryptAcquireContext failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed: %08x\n", GetLastError()); result = CryptGenKey(prov, CALG_RSA_KEYX, CRYPT_EXPORTABLE, &signKey); ok(result, "CryptGenKey with CALG_RSA_KEYX failed with error %08x\n", GetLastError()); result = CryptGetUserKey(prov, AT_KEYEXCHANGE, &keyExchangeKey); @@ -2701,7 +2707,7 @@ static void test_rsa_round_trip(void) CryptDestroyKey(keyExchangeKey); CryptReleaseContext(prov, 0); - CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); } @@ -2764,36 +2770,36 @@ static void test_null_provider(void) DWORD keySpec, dataLen,dwParam; char szName[MAX_PATH]; - result = CryptAcquireContext(NULL, szContainer, NULL, 0, 0); + result = CryptAcquireContextA(NULL, szContainer, NULL, 0, 0); ok(!result && GetLastError() == NTE_BAD_PROV_TYPE, "Expected NTE_BAD_PROV_TYPE, got %08x\n", GetLastError()); - result = CryptAcquireContext(NULL, szContainer, NULL, PROV_RSA_FULL, 0); + result = CryptAcquireContextA(NULL, szContainer, NULL, PROV_RSA_FULL, 0); ok(!result && (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == NTE_BAD_KEYSET), "Expected ERROR_INVALID_PARAMETER or NTE_BAD_KEYSET, got %08x\n", GetLastError()); - result = CryptAcquireContext(NULL, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(NULL, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); ok(!result && ( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == NTE_BAD_KEYSET), "Expected ERROR_INVALID_PARAMETER or NTE_BAD_KEYSET, got %08x\n", GetLastError()); - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); ok(!result && GetLastError() == NTE_BAD_KEYSET, "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError()); - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, 0); + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, 0); ok(!result && GetLastError() == NTE_BAD_KEYSET, "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError()); /* Delete the default container. */ - CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); + CryptAcquireContextA(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); /* Once you've deleted the default container you can't open it as if it * already exists. */ - result = CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, 0); + result = CryptAcquireContextA(&prov, NULL, NULL, PROV_RSA_FULL, 0); ok(!result && GetLastError() == NTE_BAD_KEYSET, "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError()); /* But you can always open the default container for CRYPT_VERIFYCONTEXT. */ - result = CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); - ok(result, "CryptAcquireContext failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed: %08x\n", GetLastError()); if (!result) return; dataLen = sizeof(keySpec); result = CryptGetProvParam(prov, PP_KEYSPEC, (LPBYTE)&keySpec, &dataLen, 0); @@ -2812,9 +2818,9 @@ static void test_null_provider(void) result = CryptReleaseContext(prov, 0); ok(result, "CryptReleaseContext failed: %08x\n", GetLastError()); /* You can create a new default container. */ - result = CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); - ok(result, "CryptAcquireContext failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed: %08x\n", GetLastError()); /* But you still can't get the keys (until one's been generated.) */ result = CryptGetUserKey(prov, AT_KEYEXCHANGE, &key); ok(!result && GetLastError() == NTE_NO_KEY, @@ -2823,20 +2829,20 @@ static void test_null_provider(void) ok(!result && GetLastError() == NTE_NO_KEY, "Expected NTE_NO_KEY, got %08x\n", GetLastError()); CryptReleaseContext(prov, 0); - CryptAcquireContext(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); + CryptAcquireContextA(&prov, NULL, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); - CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, 0); + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, 0); ok(!result && GetLastError() == NTE_BAD_KEYSET, "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError()); - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); ok(!result && GetLastError() == NTE_BAD_FLAGS, "Expected NTE_BAD_FLAGS, got %08x\n", GetLastError()); - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); - ok(result, "CryptAcquireContext failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed: %08x\n", GetLastError()); if (!result) return; /* Test provider parameters getter */ dataLen = sizeof(dwParam); @@ -2910,13 +2916,13 @@ static void test_null_provider(void) ok(!result && GetLastError() == NTE_NO_KEY, "Expected NTE_NO_KEY, got %08x\n", GetLastError()); CryptReleaseContext(prov, 0); - CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); /* Whereas importing a sign blob.. */ - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); - ok(result, "CryptAcquireContext failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed: %08x\n", GetLastError()); if (!result) return; result = CryptImportKey(prov, signBlob, sizeof(signBlob), 0, 0, &key); ok(result, "CryptImportKey failed: %08x\n", GetLastError()); @@ -2931,13 +2937,13 @@ static void test_null_provider(void) CryptDestroyKey(key); CryptReleaseContext(prov, 0); - CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); /* Test for being able to get a key generated with CALG_RSA_SIGN. */ - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); - ok(result, "CryptAcquireContext failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed: %08x\n", GetLastError()); result = CryptGenKey(prov, CALG_RSA_SIGN, 0, &key); ok(result, "CryptGenKey with CALG_RSA_SIGN failed with error %08x\n", GetLastError()); CryptDestroyKey(key); @@ -2948,13 +2954,13 @@ static void test_null_provider(void) CryptDestroyKey(key); CryptReleaseContext(prov, 0); - CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); /* Test for being able to get a key generated with CALG_RSA_KEYX. */ - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); - ok(result, "CryptAcquireContext failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed: %08x\n", GetLastError()); result = CryptGenKey(prov, CALG_RSA_KEYX, 0, &key); ok(result, "CryptGenKey with CALG_RSA_KEYX failed with error %08x\n", GetLastError()); CryptDestroyKey(key); @@ -2965,44 +2971,44 @@ static void test_null_provider(void) ok(!result, "expected CryptGetUserKey to fail\n"); CryptReleaseContext(prov, 0); - CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); /* test for the bug in accessing the user key in a container */ - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET); - ok(result, "CryptAcquireContext failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed: %08x\n", GetLastError()); result = CryptGenKey(prov, AT_KEYEXCHANGE, 0, &key); ok(result, "CryptGenKey with AT_KEYEXCHANGE failed with error %08x\n", GetLastError()); CryptDestroyKey(key); CryptReleaseContext(prov,0); - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL,0); - ok(result, "CryptAcquireContext failed: 0x%08x\n", GetLastError()); + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL,0); + ok(result, "CryptAcquireContextA failed: 0x%08x\n", GetLastError()); result = CryptGetUserKey(prov, AT_KEYEXCHANGE, &key); ok (result, "CryptGetUserKey failed with error %08x\n", GetLastError()); CryptDestroyKey(key); CryptReleaseContext(prov, 0); - CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); /* test the machine key set */ - CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET|CRYPT_MACHINE_KEYSET); - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_NEWKEYSET|CRYPT_MACHINE_KEYSET); - ok(result, "CryptAcquireContext with CRYPT_MACHINE_KEYSET failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA with CRYPT_MACHINE_KEYSET failed: %08x\n", GetLastError()); CryptReleaseContext(prov, 0); - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET); - ok(result, "CryptAcquireContext with CRYPT_MACHINE_KEYSET failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA with CRYPT_MACHINE_KEYSET failed: %08x\n", GetLastError()); CryptReleaseContext(prov,0); - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET|CRYPT_MACHINE_KEYSET); - ok(result, "CryptAcquireContext with CRYPT_DELETEKEYSET|CRYPT_MACHINE_KEYSET failed: %08x\n", + ok(result, "CryptAcquireContextA with CRYPT_DELETEKEYSET|CRYPT_MACHINE_KEYSET failed: %08x\n", GetLastError()); - result = CryptAcquireContext(&prov, szContainer, NULL, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov, szContainer, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET); ok(!result && GetLastError() == NTE_BAD_KEYSET , "Expected NTE_BAD_KEYSET, got %08x\n", GetLastError()); @@ -3114,11 +3120,11 @@ static void test_key_initialization(void) /* Like init_base_environment, but doesn't generate new keys, as they'll * be imported instead. */ - if (!CryptAcquireContext(&prov1, szContainer, szProvider, PROV_RSA_FULL, 0)) + if (!CryptAcquireContextA(&prov1, szContainer, szProvider, PROV_RSA_FULL, 0)) { - result = CryptAcquireContext(&prov1, szContainer, szProvider, PROV_RSA_FULL, + result = CryptAcquireContextA(&prov1, szContainer, szProvider, PROV_RSA_FULL, CRYPT_NEWKEYSET); - ok(result, "CryptAcquireContext failed: %08x\n", GetLastError()); + ok(result, "CryptAcquireContextA failed: %08x\n", GetLastError()); } dwLen = (DWORD)sizeof(abPlainPrivateKey); result = CryptImportKey(prov1, abPlainPrivateKey, dwLen, 0, 0, &hKeyExchangeKey); @@ -3131,8 +3137,8 @@ static void test_key_initialization(void) /* Once the key has been imported, subsequently acquiring a context with * the same name will allow retrieving the key. */ - result = CryptAcquireContext(&prov2, szContainer, szProvider, PROV_RSA_FULL, 0); - ok(result, "CryptAcquireContext failed: %08x\n", GetLastError()); + result = CryptAcquireContextA(&prov2, szContainer, szProvider, PROV_RSA_FULL, 0); + ok(result, "CryptAcquireContextA failed: %08x\n", GetLastError()); result = CryptGetUserKey(prov2, AT_KEYEXCHANGE, &hKey); ok(result, "CryptGetUserKey failed: %08x\n", GetLastError()); if (result) CryptDestroyKey(hKey); @@ -3141,7 +3147,7 @@ static void test_key_initialization(void) CryptDestroyKey(hSessionKey); CryptDestroyKey(hKeyExchangeKey); CryptReleaseContext(prov1, 0); - CryptAcquireContext(&prov1, szContainer, NULL, PROV_RSA_FULL, + CryptAcquireContextA(&prov1, szContainer, NULL, PROV_RSA_FULL, CRYPT_DELETEKEYSET); } From 4dd28abbe5bb646b874de8d36f9fdf6c4d5b12da Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 18:26:34 +0000 Subject: [PATCH 387/419] [D3DCOMPILER_43] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62815 --- .../directx/wine/d3dcompiler_43/asmparser.c | 9 ++-- .../wine/d3dcompiler_43/asmshader.tab.c | 4 +- .../wine/d3dcompiler_43/asmshader.tab.h | 4 +- .../directx/wine/d3dcompiler_43/asmshader.y | 4 +- .../wine/d3dcompiler_43/asmshader.yy.c | 2 +- .../directx/wine/d3dcompiler_43/compiler.c | 15 +++--- .../wine/d3dcompiler_43/d3dcompiler_43_main.c | 2 +- .../wine/d3dcompiler_43/d3dcompiler_private.h | 53 ++++++++++--------- .../dll/directx/wine/d3dcompiler_43/hlsl.yy.c | 2 +- .../directx/wine/d3dcompiler_43/reflection.c | 18 +++---- .../dll/directx/wine/d3dcompiler_43/utils.c | 6 +-- reactos/media/doc/README.WINE | 2 +- 12 files changed, 63 insertions(+), 58 deletions(-) diff --git a/reactos/dll/directx/wine/d3dcompiler_43/asmparser.c b/reactos/dll/directx/wine/d3dcompiler_43/asmparser.c index 12d5fc3fa1d..1e7d1072762 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/asmparser.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/asmparser.c @@ -497,11 +497,10 @@ static void asmparser_texreg2rgb(struct asm_parser *This, DWORD mod, DWORD shift * go through asmparser_instr). */ -static void asmparser_instr(struct asm_parser *This, DWORD opcode, - DWORD mod, DWORD shift, - BWRITER_COMPARISON_TYPE comp, - const struct shader_reg *dst, - const struct src_regs *srcs, int expectednsrcs) { +static void asmparser_instr(struct asm_parser *This, DWORD opcode, DWORD mod, DWORD shift, + enum bwriter_comparison_type comp, const struct shader_reg *dst, + const struct src_regs *srcs, int expectednsrcs) +{ struct instruction *instr; unsigned int i; BOOL firstreg = TRUE; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.c b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.c index c8d80d3ceef..9c8604b7969 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.c @@ -343,12 +343,12 @@ typedef union YYSTYPE DWORD mod; DWORD shift; } modshift; - BWRITER_COMPARISON_TYPE comptype; + enum bwriter_comparison_type comptype; struct { DWORD dclusage; unsigned int regnum; } declaration; - BWRITERSAMPLER_TEXTURE_TYPE samplertype; + enum bwritersampler_texture_type samplertype; struct rel_reg rel_reg; struct src_regs sregs; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.h b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.h index 04e200d4e05..145e94774bb 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.h +++ b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.tab.h @@ -233,12 +233,12 @@ typedef union YYSTYPE DWORD mod; DWORD shift; } modshift; - BWRITER_COMPARISON_TYPE comptype; + enum bwriter_comparison_type comptype; struct { DWORD dclusage; unsigned int regnum; } declaration; - BWRITERSAMPLER_TEXTURE_TYPE samplertype; + enum bwritersampler_texture_type samplertype; struct rel_reg rel_reg; struct src_regs sregs; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.y b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.y index 4109745a6a8..5948d57d5ed 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.y +++ b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.y @@ -92,12 +92,12 @@ int asmshader_lex(void); DWORD mod; DWORD shift; } modshift; - BWRITER_COMPARISON_TYPE comptype; + enum bwriter_comparison_type comptype; struct { DWORD dclusage; unsigned int regnum; } declaration; - BWRITERSAMPLER_TEXTURE_TYPE samplertype; + enum bwritersampler_texture_type samplertype; struct rel_reg rel_reg; struct src_regs sregs; } diff --git a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c index 446779b3932..1b31cec460f 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/asmshader.yy.c @@ -360,7 +360,7 @@ void asmshader_free (void * ); /* Begin user sect3 */ -#define asmshader_wrap() 1 +#define asmshader_wrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/compiler.c b/reactos/dll/directx/wine/d3dcompiler_43/compiler.c index c5f3bfead9a..9b2ec54d24b 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/compiler.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/compiler.c @@ -144,8 +144,10 @@ static char *wpp_lookup_mem(const char *filename, int type, const char *parent_n char *path; int i; + TRACE("Looking for include %s.\n", debugstr_a(filename)); + parent_include = NULL; - if(parent_name[0] != '\0') + if (strcmp(parent_name, initial_filename)) { for(i = 0; i < includes_size; i++) { @@ -157,7 +159,7 @@ static char *wpp_lookup_mem(const char *filename, int type, const char *parent_n } if(parent_include == NULL) { - ERR("Parent include file missing\n"); + ERR("Parent include %s missing.\n", debugstr_a(parent_name)); return NULL; } } @@ -173,6 +175,8 @@ static void *wpp_open_mem(const char *filename, int type) struct mem_file_desc *desc; HRESULT hr; + TRACE("Opening include %s.\n", debugstr_a(filename)); + if(!strcmp(filename, initial_filename)) { current_shader.pos = 0; @@ -184,11 +188,8 @@ static void *wpp_open_mem(const char *filename, int type) if(!desc) return NULL; - hr = ID3DInclude_Open(current_include, - type ? D3D_INCLUDE_LOCAL : D3D_INCLUDE_SYSTEM, - filename, parent_include, (LPCVOID *)&desc->buffer, - &desc->size); - if(FAILED(hr)) + if (FAILED(hr = ID3DInclude_Open(current_include, type ? D3D_INCLUDE_LOCAL : D3D_INCLUDE_SYSTEM, + filename, parent_include, (const void **)&desc->buffer, &desc->size))) { HeapFree(GetProcessHeap(), 0, desc); return NULL; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_43_main.c b/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_43_main.c index 983031d5d95..f67f3a63f49 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_43_main.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_43_main.c @@ -21,7 +21,7 @@ #include "d3dcompiler_private.h" -BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) +BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) { switch (reason) { diff --git a/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h b/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h index c5304899ab3..0e887d0c66a 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h +++ b/reactos/dll/directx/wine/d3dcompiler_43/d3dcompiler_private.h @@ -57,7 +57,8 @@ enum shader_type ST_PIXEL }; -typedef enum BWRITER_COMPARISON_TYPE { +enum bwriter_comparison_type +{ BWRITER_COMPARISON_NONE, BWRITER_COMPARISON_GT, BWRITER_COMPARISON_EQ, @@ -65,7 +66,7 @@ typedef enum BWRITER_COMPARISON_TYPE { BWRITER_COMPARISON_LT, BWRITER_COMPARISON_NE, BWRITER_COMPARISON_LE -} BWRITER_COMPARISON_TYPE; +}; struct constant { DWORD regnum; @@ -92,7 +93,7 @@ struct instruction { DWORD opcode; DWORD dstmod; DWORD shift; - BWRITER_COMPARISON_TYPE comptype; + enum bwriter_comparison_type comptype; BOOL has_dst; struct shader_reg dst; struct shader_reg *src; @@ -218,9 +219,9 @@ struct asmparser_backend { void (*end)(struct asm_parser *This); - void (*instr)(struct asm_parser *This, DWORD opcode, DWORD mod, DWORD shift, - BWRITER_COMPARISON_TYPE comp, const struct shader_reg *dst, - const struct src_regs *srcs, int expectednsrcs); + void (*instr)(struct asm_parser *parser, DWORD opcode, DWORD mod, DWORD shift, + enum bwriter_comparison_type comp, const struct shader_reg *dst, + const struct src_regs *srcs, int expectednsrcs); }; struct instruction *alloc_instr(unsigned int srcs) DECLSPEC_HIDDEN; @@ -367,11 +368,10 @@ const char *debug_print_opcode(DWORD opcode) DECLSPEC_HIDDEN; /* Used to signal an incorrect swizzle/writemask */ #define SWIZZLE_ERR ~0U -/* - Enumerations and defines used in the bytecode writer - intermediate representation -*/ -typedef enum _BWRITERSHADER_INSTRUCTION_OPCODE_TYPE { +/* Enumerations and defines used in the bytecode writer intermediate + * representation. */ +enum bwritershader_instruction_opcode_type +{ BWRITERSIO_NOP, BWRITERSIO_MOV, BWRITERSIO_ADD, @@ -460,9 +460,10 @@ typedef enum _BWRITERSHADER_INSTRUCTION_OPCODE_TYPE { BWRITERSIO_PHASE, BWRITERSIO_COMMENT, BWRITERSIO_END, -} BWRITERSHADER_INSTRUCTION_OPCODE_TYPE; +}; -typedef enum _BWRITERSHADER_PARAM_REGISTER_TYPE { +enum bwritershader_param_register_type +{ BWRITERSPR_TEMP, BWRITERSPR_INPUT, BWRITERSPR_CONST, @@ -481,14 +482,14 @@ typedef enum _BWRITERSHADER_PARAM_REGISTER_TYPE { BWRITERSPR_MISCTYPE, BWRITERSPR_LABEL, BWRITERSPR_PREDICATE -} BWRITERSHADER_PARAM_REGISTER_TYPE; +}; -typedef enum _BWRITERVS_RASTOUT_OFFSETS +enum bwritervs_rastout_offsets { BWRITERSRO_POSITION, BWRITERSRO_FOG, BWRITERSRO_POINT_SIZE -} BWRITERVS_RASTOUT_OFFSETS; +}; #define BWRITERSP_WRITEMASK_0 0x1 /* .x r */ #define BWRITERSP_WRITEMASK_1 0x2 /* .y g */ @@ -496,25 +497,28 @@ typedef enum _BWRITERVS_RASTOUT_OFFSETS #define BWRITERSP_WRITEMASK_3 0x8 /* .w a */ #define BWRITERSP_WRITEMASK_ALL 0xf /* all */ -typedef enum _BWRITERSHADER_PARAM_DSTMOD_TYPE { +enum bwritershader_param_dstmod_type +{ BWRITERSPDM_NONE = 0, BWRITERSPDM_SATURATE = 1, BWRITERSPDM_PARTIALPRECISION = 2, BWRITERSPDM_MSAMPCENTROID = 4, -} BWRITERSHADER_PARAM_DSTMOD_TYPE; +}; -typedef enum _BWRITERSAMPLER_TEXTURE_TYPE { +enum bwritersampler_texture_type +{ BWRITERSTT_UNKNOWN = 0, BWRITERSTT_1D = 1, BWRITERSTT_2D = 2, BWRITERSTT_CUBE = 3, BWRITERSTT_VOLUME = 4, -} BWRITERSAMPLER_TEXTURE_TYPE; +}; #define BWRITERSI_TEXLD_PROJECT 1 #define BWRITERSI_TEXLD_BIAS 2 -typedef enum _BWRITERSHADER_PARAM_SRCMOD_TYPE { +enum bwritershader_param_srcmod_type +{ BWRITERSPSM_NONE = 0, BWRITERSPSM_NEG, BWRITERSPSM_BIAS, @@ -529,7 +533,7 @@ typedef enum _BWRITERSHADER_PARAM_SRCMOD_TYPE { BWRITERSPSM_ABS, BWRITERSPSM_ABSNEG, BWRITERSPSM_NOT, -} BWRITERSHADER_PARAM_SRCMOD_TYPE; +}; #define BWRITER_SM1_VS 0xfffe #define BWRITER_SM1_PS 0xffff @@ -567,7 +571,8 @@ typedef enum _BWRITERSHADER_PARAM_SRCMOD_TYPE { #define BWRITERVS_SWIZZLE_Z (BWRITERVS_X_Z | BWRITERVS_Y_Z | BWRITERVS_Z_Z | BWRITERVS_W_Z) #define BWRITERVS_SWIZZLE_W (BWRITERVS_X_W | BWRITERVS_Y_W | BWRITERVS_Z_W | BWRITERVS_W_W) -typedef enum _BWRITERDECLUSAGE { +enum bwriterdeclusage +{ BWRITERDECLUSAGE_POSITION, BWRITERDECLUSAGE_BLENDWEIGHT, BWRITERDECLUSAGE_BLENDINDICES, @@ -582,7 +587,7 @@ typedef enum _BWRITERDECLUSAGE { BWRITERDECLUSAGE_FOG, BWRITERDECLUSAGE_DEPTH, BWRITERDECLUSAGE_SAMPLE -} BWRITERDECLUSAGE; +}; /* ps 1.x texture registers mappings */ #define T0_REG 2 diff --git a/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c b/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c index c6fc3e4a4e2..a3e98d5543c 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/hlsl.yy.c @@ -360,7 +360,7 @@ void hlsl_free (void * ); /* Begin user sect3 */ -#define hlsl_wrap() 1 +#define hlsl_wrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; diff --git a/reactos/dll/directx/wine/d3dcompiler_43/reflection.c b/reactos/dll/directx/wine/d3dcompiler_43/reflection.c index 8cc1fe44f6c..becdee36acc 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/reflection.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/reflection.c @@ -69,7 +69,7 @@ struct d3dcompiler_shader_reflection_variable UINT start_offset; UINT size; UINT flags; - LPVOID default_value; + void *default_value; }; struct d3dcompiler_shader_reflection_constant_buffer @@ -179,7 +179,7 @@ static BOOL copy_value(const char *ptr, void **value, DWORD size) *value = HeapAlloc(GetProcessHeap(), 0, size); if (!*value) { - ERR("Failed to allocate vlaue memory.\n"); + ERR("Failed to allocate value memory.\n"); return FALSE; } @@ -442,7 +442,7 @@ static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompil } static struct ID3D11ShaderReflectionConstantBuffer * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetConstantBufferByName( - ID3D11ShaderReflection *iface, LPCSTR name) + ID3D11ShaderReflection *iface, const char *name) { struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface); unsigned int i; @@ -544,7 +544,7 @@ static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetPatchConstantP } static struct ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetVariableByName( - ID3D11ShaderReflection *iface, LPCSTR name) + ID3D11ShaderReflection *iface, const char *name) { struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface); unsigned int i, k; @@ -579,7 +579,7 @@ static struct ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_sha } static HRESULT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetResourceBindingDescByName( - ID3D11ShaderReflection *iface, LPCSTR name, D3D11_SHADER_INPUT_BIND_DESC *desc) + ID3D11ShaderReflection *iface, const char *name, D3D11_SHADER_INPUT_BIND_DESC *desc) { struct d3dcompiler_shader_reflection *This = impl_from_ID3D11ShaderReflection(iface); unsigned int i; @@ -658,7 +658,7 @@ static BOOL STDMETHODCALLTYPE d3dcompiler_shader_reflection_IsSampleFrequencySha { FIXME("iface %p stub!\n", iface); - return 0; + return FALSE; } static UINT STDMETHODCALLTYPE d3dcompiler_shader_reflection_GetNumInterfaceSlots( @@ -764,7 +764,7 @@ static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_ref } static ID3D11ShaderReflectionVariable * STDMETHODCALLTYPE d3dcompiler_shader_reflection_constant_buffer_GetVariableByName( - ID3D11ShaderReflectionConstantBuffer *iface, LPCSTR name) + ID3D11ShaderReflectionConstantBuffer *iface, const char *name) { struct d3dcompiler_shader_reflection_constant_buffer *This = impl_from_ID3D11ShaderReflectionConstantBuffer(iface); unsigned int i; @@ -921,7 +921,7 @@ static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect } static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeByName( - ID3D11ShaderReflectionType *iface, LPCSTR name) + ID3D11ShaderReflectionType *iface, const char *name) { struct d3dcompiler_shader_reflection_type *This = impl_from_ID3D11ShaderReflectionType(iface); unsigned int i; @@ -950,7 +950,7 @@ static ID3D11ShaderReflectionType * STDMETHODCALLTYPE d3dcompiler_shader_reflect return &null_type.ID3D11ShaderReflectionType_iface; } -static LPCSTR STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeName( +static const char * STDMETHODCALLTYPE d3dcompiler_shader_reflection_type_GetMemberTypeName( ID3D11ShaderReflectionType *iface, UINT index) { struct d3dcompiler_shader_reflection_type *This = impl_from_ID3D11ShaderReflectionType(iface); diff --git a/reactos/dll/directx/wine/d3dcompiler_43/utils.c b/reactos/dll/directx/wine/d3dcompiler_43/utils.c index 001ba8ec55f..daa11b1b3ba 100644 --- a/reactos/dll/directx/wine/d3dcompiler_43/utils.c +++ b/reactos/dll/directx/wine/d3dcompiler_43/utils.c @@ -1683,7 +1683,7 @@ struct hlsl_ir_node *make_assignment(struct hlsl_ir_node *left, enum parse_assig static int compare_hlsl_types_rb(const void *key, const struct wine_rb_entry *entry) { - const char *name = (const char *)key; + const char *name = key; const struct hlsl_type *type = WINE_RB_ENTRY_VALUE(entry, const struct hlsl_type, scope_entry); if (name == type->name) @@ -1820,7 +1820,7 @@ static int compare_param_hlsl_types(const struct hlsl_type *t1, const struct hls static int compare_function_decl_rb(const void *key, const struct wine_rb_entry *entry) { - const struct list *params = (const struct list *)key; + const struct list *params = key; const struct hlsl_ir_function_decl *decl = WINE_RB_ENTRY_VALUE(entry, const struct hlsl_ir_function_decl, entry); int params_count = params ? list_count(params) : 0; int decl_params_count = decl->parameters ? list_count(decl->parameters) : 0; @@ -1855,7 +1855,7 @@ static const struct wine_rb_functions hlsl_ir_function_decl_rb_funcs = static int compare_function_rb(const void *key, const struct wine_rb_entry *entry) { - const char *name = (const char *)key; + const char *name = key; const struct hlsl_ir_function *func = WINE_RB_ENTRY_VALUE(entry, const struct hlsl_ir_function,entry); return strcmp(name, func->name); diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index e9b129cf6b1..43bbfd0396a 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -30,7 +30,7 @@ The following libraries are shared with Wine. reactos/dll/directx/wine/amstream # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3d8 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3d9 # Synced to Wine-1.7.17 -reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.1 +reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.1 reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.1 reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.17 From 7df8e0d0613275b30f4c858f105e4f41238b6383 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 18:35:05 +0000 Subject: [PATCH 388/419] [D3DX9_24] => [D3DX9_35] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62816 --- reactos/dll/directx/wine/d3dx9_24/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_25/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_26/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_27/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_28/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_29/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_30/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_31/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_32/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_33/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_34/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_35/version.rc | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/reactos/dll/directx/wine/d3dx9_24/version.rc b/reactos/dll/directx/wine/d3dx9_24/version.rc index 8deff200d3e..80a48cb373d 100644 --- a/reactos/dll/directx/wine/d3dx9_24/version.rc +++ b/reactos/dll/directx/wine/d3dx9_24/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_24.dll" #define WINE_FILEVERSION 9,5,132,0 #define WINE_FILEVERSION_STR "9.5.132.0" #define WINE_PRODUCTVERSION 9,5,132,0 diff --git a/reactos/dll/directx/wine/d3dx9_25/version.rc b/reactos/dll/directx/wine/d3dx9_25/version.rc index 922770c5db3..6f89654bbac 100644 --- a/reactos/dll/directx/wine/d3dx9_25/version.rc +++ b/reactos/dll/directx/wine/d3dx9_25/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_25.dll" #define WINE_FILEVERSION 9,6,168,0 #define WINE_FILEVERSION_STR "9.6.168.0" #define WINE_PRODUCTVERSION 9,6,168,0 diff --git a/reactos/dll/directx/wine/d3dx9_26/version.rc b/reactos/dll/directx/wine/d3dx9_26/version.rc index 56edd133534..0497ee5473a 100644 --- a/reactos/dll/directx/wine/d3dx9_26/version.rc +++ b/reactos/dll/directx/wine/d3dx9_26/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_26.dll" #define WINE_FILEVERSION 9,7,239,0 #define WINE_FILEVERSION_STR "9.7.239.0" #define WINE_PRODUCTVERSION 9,7,239,0 diff --git a/reactos/dll/directx/wine/d3dx9_27/version.rc b/reactos/dll/directx/wine/d3dx9_27/version.rc index 82be05ef485..0ecef4b267d 100644 --- a/reactos/dll/directx/wine/d3dx9_27/version.rc +++ b/reactos/dll/directx/wine/d3dx9_27/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_27.dll" #define WINE_FILEVERSION 9,8,299,0 #define WINE_FILEVERSION_STR "9.8.299.0" #define WINE_PRODUCTVERSION 9,8,299,0 diff --git a/reactos/dll/directx/wine/d3dx9_28/version.rc b/reactos/dll/directx/wine/d3dx9_28/version.rc index 0f61f70880e..67f9e5527ef 100644 --- a/reactos/dll/directx/wine/d3dx9_28/version.rc +++ b/reactos/dll/directx/wine/d3dx9_28/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_28.dll" #define WINE_FILEVERSION 9,10,455,0 #define WINE_FILEVERSION_STR "9.10.455.0" #define WINE_PRODUCTVERSION 9,10,455,0 diff --git a/reactos/dll/directx/wine/d3dx9_29/version.rc b/reactos/dll/directx/wine/d3dx9_29/version.rc index f6f7b1351d9..8fcd63d7dd9 100644 --- a/reactos/dll/directx/wine/d3dx9_29/version.rc +++ b/reactos/dll/directx/wine/d3dx9_29/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_29.dll" #define WINE_FILEVERSION 9,11,519,0 #define WINE_FILEVERSION_STR "9.11.519.0" #define WINE_PRODUCTVERSION 9,11,519,0 diff --git a/reactos/dll/directx/wine/d3dx9_30/version.rc b/reactos/dll/directx/wine/d3dx9_30/version.rc index b10286e6b81..575cbfe715f 100644 --- a/reactos/dll/directx/wine/d3dx9_30/version.rc +++ b/reactos/dll/directx/wine/d3dx9_30/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_30.dll" #define WINE_FILEVERSION 9,12,589,0 #define WINE_FILEVERSION_STR "9.12.589.0" #define WINE_PRODUCTVERSION 9,12,589,0 diff --git a/reactos/dll/directx/wine/d3dx9_31/version.rc b/reactos/dll/directx/wine/d3dx9_31/version.rc index eb974540014..b9d5432783e 100644 --- a/reactos/dll/directx/wine/d3dx9_31/version.rc +++ b/reactos/dll/directx/wine/d3dx9_31/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_31.dll" #define WINE_FILEVERSION 9,15,779,0 #define WINE_FILEVERSION_STR "9.15.779.0" #define WINE_PRODUCTVERSION 9,15,779,0 diff --git a/reactos/dll/directx/wine/d3dx9_32/version.rc b/reactos/dll/directx/wine/d3dx9_32/version.rc index 330f8be684f..ca1ebdecdba 100644 --- a/reactos/dll/directx/wine/d3dx9_32/version.rc +++ b/reactos/dll/directx/wine/d3dx9_32/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_32.dll" #define WINE_FILEVERSION 9,16,843,0 #define WINE_FILEVERSION_STR "9.16.843.0" #define WINE_PRODUCTVERSION 9,16,843,0 diff --git a/reactos/dll/directx/wine/d3dx9_33/version.rc b/reactos/dll/directx/wine/d3dx9_33/version.rc index 06eba53b470..2de5aa08cd2 100644 --- a/reactos/dll/directx/wine/d3dx9_33/version.rc +++ b/reactos/dll/directx/wine/d3dx9_33/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_33.dll" #define WINE_FILEVERSION 9,18,904,15 #define WINE_FILEVERSION_STR "9.18.904.15" #define WINE_PRODUCTVERSION 9,18,904,15 diff --git a/reactos/dll/directx/wine/d3dx9_34/version.rc b/reactos/dll/directx/wine/d3dx9_34/version.rc index 5045d8fa852..f5385d14a8c 100644 --- a/reactos/dll/directx/wine/d3dx9_34/version.rc +++ b/reactos/dll/directx/wine/d3dx9_34/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_34.dll" #define WINE_FILEVERSION 9,19,949,46 #define WINE_FILEVERSION_STR "9.19.949.46" #define WINE_PRODUCTVERSION 9,19,949,46 diff --git a/reactos/dll/directx/wine/d3dx9_35/version.rc b/reactos/dll/directx/wine/d3dx9_35/version.rc index 6ffaafb4b47..8a6f11ff787 100644 --- a/reactos/dll/directx/wine/d3dx9_35/version.rc +++ b/reactos/dll/directx/wine/d3dx9_35/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_35.dll" #define WINE_FILEVERSION 9,19,949,1104 #define WINE_FILEVERSION_STR "9.19.949.1104" #define WINE_PRODUCTVERSION 9,19,949,1104 From 61411ec7fd18f2c3c1ed1cb8810ef1bd2b96c749 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 18:48:40 +0000 Subject: [PATCH 389/419] [DXSDK] * Sync the d3dx9 headers with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62817 --- reactos/include/dxsdk/d3dx9anim.h | 67 ++++---- reactos/include/dxsdk/d3dx9core.h | 30 ++-- reactos/include/dxsdk/d3dx9effect.h | 187 ++++++++++----------- reactos/include/dxsdk/d3dx9math.h | 2 +- reactos/include/dxsdk/d3dx9math.inl | 244 ++++++++++++++-------------- reactos/include/dxsdk/d3dx9mesh.h | 126 +++++++------- reactos/include/dxsdk/d3dx9shader.h | 81 +++++++-- reactos/include/dxsdk/d3dx9tex.h | 17 +- reactos/include/dxsdk/d3dx9xof.h | 32 ++-- 9 files changed, 435 insertions(+), 351 deletions(-) diff --git a/reactos/include/dxsdk/d3dx9anim.h b/reactos/include/dxsdk/d3dx9anim.h index 2ae780d157a..b5f2232fdb2 100644 --- a/reactos/include/dxsdk/d3dx9anim.h +++ b/reactos/include/dxsdk/d3dx9anim.h @@ -92,7 +92,7 @@ typedef struct _D3DXMESHDATA typedef struct _D3DXMESHCONTAINER { - LPSTR Name; + char *Name; D3DXMESHDATA MeshData; LPD3DXMATERIAL pMaterials; LPD3DXEFFECTINSTANCE pEffects; @@ -104,7 +104,7 @@ typedef struct _D3DXMESHCONTAINER typedef struct _D3DXFRAME { - LPSTR Name; + char *Name; D3DXMATRIX TransformationMatrix; LPD3DXMESHCONTAINER pMeshContainer; struct _D3DXFRAME *pFrameSibling; @@ -125,8 +125,8 @@ typedef struct _D3DXKEY_QUATERNION typedef struct _D3DXKEY_CALLBACK { - FLOAT Time; - LPVOID pCallbackData; + float Time; + void *pCallbackData; } D3DXKEY_CALLBACK, *LPD3DXKEY_CALLBACK; typedef struct _D3DXTRACK_DESC @@ -170,7 +170,7 @@ typedef interface ID3DXAnimationController *LPD3DXANIMATIONCONTROLLER; #define INTERFACE ID3DXAllocateHierarchy DECLARE_INTERFACE(ID3DXAllocateHierarchy) { - STDMETHOD(CreateFrame)(THIS_ LPCSTR Name, LPD3DXFRAME *new_frame) PURE; + STDMETHOD(CreateFrame)(THIS_ const char *name, D3DXFRAME **new_frame) PURE; STDMETHOD(CreateMeshContainer)(THIS_ const char *name, const D3DXMESHDATA *mesh_data, const D3DXMATERIAL *materials, const D3DXEFFECTINSTANCE *effect_instances, DWORD num_materials, const DWORD *adjacency, ID3DXSkinInfo *skin_info, @@ -207,20 +207,20 @@ DECLARE_INTERFACE(ID3DXSaveUserData) DECLARE_INTERFACE_(ID3DXAnimationSet, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXAnimationSet methods ***/ - STDMETHOD_(LPCSTR, GetName)(THIS) PURE; + STDMETHOD_(const char *, GetName)(THIS) PURE; STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE position) PURE; STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; - STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT index, LPCSTR *name) PURE; - STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR name, UINT *index) PURE; + STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT index, const char **name) PURE; + STDMETHOD(GetAnimationIndexByName)(THIS_ const char *name, UINT *index) PURE; STDMETHOD(GetSRT)(THIS_ DOUBLE periodic_position, UINT animation, D3DXVECTOR3 *scale, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation) PURE; - STDMETHOD(GetCallback)(THIS_ DOUBLE position, DWORD flags, DOUBLE *callback_position, - LPVOID *callback_data) PURE; + STDMETHOD(GetCallback)(THIS_ double position, DWORD flags, double *callback_position, + void **callback_data) PURE; }; #undef INTERFACE @@ -228,20 +228,20 @@ DECLARE_INTERFACE_(ID3DXAnimationSet, IUnknown) DECLARE_INTERFACE_(ID3DXKeyframedAnimationSet, ID3DXAnimationSet) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXAnimationSet methods ***/ - STDMETHOD_(LPCSTR, GetName)(THIS) PURE; + STDMETHOD_(const char *, GetName)(THIS) PURE; STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE position) PURE; STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; - STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT index, LPCSTR *name) PURE; - STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR name, UINT *index) PURE; + STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT index, const char **name) PURE; + STDMETHOD(GetAnimationIndexByName)(THIS_ const char *name, UINT *index) PURE; STDMETHOD(GetSRT)(THIS_ DOUBLE periodic_position, UINT animation, D3DXVECTOR3 *scale, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation) PURE; - STDMETHOD(GetCallback)(THIS_ DOUBLE position, DWORD flags, DOUBLE *callback_position, - LPVOID *callback_data) PURE; + STDMETHOD(GetCallback)(THIS_ double position, DWORD flags, double *callback_position, + void **callback_data) PURE; /*** ID3DXKeyframedAnimationSet methods ***/ STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE; STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE; @@ -264,9 +264,9 @@ DECLARE_INTERFACE_(ID3DXKeyframedAnimationSet, ID3DXAnimationSet) STDMETHOD(UnregisterScaleKey)(THIS_ UINT animation, UINT key) PURE; STDMETHOD(UnregisterRotationKey)(THIS_ UINT animation, UINT key) PURE; STDMETHOD(UnregisterTranslationKey)(THIS_ UINT animation, UINT key) PURE; - STDMETHOD(RegisterAnimationSRTKeys)(THIS_ LPCSTR name, UINT num_scale_keys, - UINT num_rotation_keys, UINT num_translation_keys, CONST D3DXKEY_VECTOR3 *scale_keys, - CONST D3DXKEY_QUATERNION *rotation_keys, CONST D3DXKEY_VECTOR3 *translation_keys, + STDMETHOD(RegisterAnimationSRTKeys)(THIS_ const char *name, UINT num_scale_keys, + UINT num_rotation_keys, UINT num_translation_keys, const D3DXKEY_VECTOR3 *scale_keys, + const D3DXKEY_QUATERNION *rotation_keys, const D3DXKEY_VECTOR3 *translation_keys, DWORD *animation_index) PURE; STDMETHOD(Compress)(THIS_ DWORD flags, float lossiness, D3DXFRAME *hierarchy, ID3DXBuffer **compressed_data) PURE; @@ -278,20 +278,20 @@ DECLARE_INTERFACE_(ID3DXKeyframedAnimationSet, ID3DXAnimationSet) DECLARE_INTERFACE_(ID3DXCompressedAnimationSet, ID3DXAnimationSet) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXAnimationSet methods ***/ - STDMETHOD_(LPCSTR, GetName)(THIS) PURE; + STDMETHOD_(const char *, GetName)(THIS) PURE; STDMETHOD_(DOUBLE, GetPeriod)(THIS) PURE; STDMETHOD_(DOUBLE, GetPeriodicPosition)(THIS_ DOUBLE position) PURE; STDMETHOD_(UINT, GetNumAnimations)(THIS) PURE; - STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT index, LPCSTR *name) PURE; - STDMETHOD(GetAnimationIndexByName)(THIS_ LPCSTR name, UINT *index) PURE; + STDMETHOD(GetAnimationNameByIndex)(THIS_ UINT index, const char **name) PURE; + STDMETHOD(GetAnimationIndexByName)(THIS_ const char *name, UINT *index) PURE; STDMETHOD(GetSRT)(THIS_ DOUBLE periodic_position, UINT animation, D3DXVECTOR3 *scale, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation) PURE; - STDMETHOD(GetCallback)(THIS_ DOUBLE position, DWORD flags, DOUBLE *callback_position, - LPVOID *callback_data) PURE; + STDMETHOD(GetCallback)(THIS_ double position, DWORD flags, double *callback_position, + void **callback_data) PURE; /*** ID3DXCompressedAnimationSet methods ***/ STDMETHOD_(D3DXPLAYBACK_TYPE, GetPlaybackType)(THIS) PURE; STDMETHOD_(DOUBLE, GetSourceTicksPerSecond)(THIS) PURE; @@ -304,7 +304,7 @@ DECLARE_INTERFACE_(ID3DXCompressedAnimationSet, ID3DXAnimationSet) #define INTERFACE ID3DXAnimationCallbackHandler DECLARE_INTERFACE(ID3DXAnimationCallbackHandler) { - STDMETHOD(HandleCallback)(THIS_ UINT track, LPVOID callback_data) PURE; + STDMETHOD(HandleCallback)(THIS_ UINT track, void *callback_data) PURE; }; #undef INTERFACE @@ -312,7 +312,7 @@ DECLARE_INTERFACE(ID3DXAnimationCallbackHandler) DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXAnimationController methods ***/ @@ -320,7 +320,7 @@ DECLARE_INTERFACE_(ID3DXAnimationController, IUnknown) STDMETHOD_(UINT, GetMaxNumAnimationSets)(THIS) PURE; STDMETHOD_(UINT, GetMaxNumTracks)(THIS) PURE; STDMETHOD_(UINT, GetMaxNumEvents)(THIS) PURE; - STDMETHOD(RegisterAnimationOutput)(THIS_ LPCSTR name, D3DXMATRIX *matrix, + STDMETHOD(RegisterAnimationOutput)(THIS_ const char *name, D3DXMATRIX *matrix, D3DXVECTOR3 *scale, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation) PURE; STDMETHOD(RegisterAnimationSet)(THIS_ ID3DXAnimationSet *anim_set) PURE; STDMETHOD(UnregisterAnimationSet)(THIS_ ID3DXAnimationSet *anim_set) PURE; @@ -386,11 +386,12 @@ HRESULT WINAPI D3DXSaveMeshHierarchyToFileW(const WCHAR *filename, DWORD format, ID3DXSaveUserData *user_data_saver); #define D3DXSaveMeshHierarchyToFile WINELIB_NAME_AW(D3DXSaveMeshHierarchyToFile) HRESULT WINAPI D3DXFrameDestroy(D3DXFRAME *frame_root, ID3DXAllocateHierarchy *alloc); -HRESULT WINAPI D3DXFrameAppendChild(LPD3DXFRAME, CONST D3DXFRAME*); -LPD3DXFRAME WINAPI D3DXFrameFind(CONST D3DXFRAME*, LPCSTR); +HRESULT WINAPI D3DXFrameAppendChild(D3DXFRAME *parent, const D3DXFRAME *child); +D3DXFRAME * WINAPI D3DXFrameFind(const D3DXFRAME *root, const char *name); HRESULT WINAPI D3DXFrameRegisterNamedMatrices(D3DXFRAME *frame_root, ID3DXAnimationController *animation_controller); -UINT WINAPI D3DXFrameNumNamedMatrices(CONST D3DXFRAME *frame_root); -HRESULT WINAPI D3DXFrameCalculateBoundingSphere(CONST D3DXFRAME*, LPD3DXVECTOR3, FLOAT*); +UINT WINAPI D3DXFrameNumNamedMatrices(const D3DXFRAME *frame_root); +HRESULT WINAPI D3DXFrameCalculateBoundingSphere(const D3DXFRAME *frame_root, D3DXVECTOR3 *center, + FLOAT *radius); HRESULT WINAPI D3DXCreateKeyframedAnimationSet(const char *name, double ticks_per_second, D3DXPLAYBACK_TYPE playback_type, UINT animation_count, UINT callback_key_count, const D3DXKEY_CALLBACK *callback_keys, ID3DXKeyframedAnimationSet **animation_set); diff --git a/reactos/include/dxsdk/d3dx9core.h b/reactos/include/dxsdk/d3dx9core.h index c28fe7128bc..5233317bc04 100644 --- a/reactos/include/dxsdk/d3dx9core.h +++ b/reactos/include/dxsdk/d3dx9core.h @@ -27,7 +27,9 @@ /* D3DX_VERSION will be completely ignored since we are implementing all dlls from d3dx9_24 to d3dx9_36 */ #define D3DX_VERSION 0x0902 +#ifndef D3DX_SDK_VERSION #define D3DX_SDK_VERSION 36 +#endif #define D3DXSPRITE_DONOTSAVESTATE 0x00000001 #define D3DXSPRITE_DONOTMODIFY_RENDERSTATE 0x00000002 #define D3DXSPRITE_OBJECTSPACE 0x00000004 @@ -65,11 +67,11 @@ typedef struct ID3DXSprite *LPD3DXSPRITE; DECLARE_INTERFACE_(ID3DXBuffer, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXBuffer methods ***/ - STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; + STDMETHOD_(void *, GetBufferPointer)(THIS) PURE; STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; }; #undef INTERFACE @@ -127,7 +129,7 @@ DECL_WINELIB_TYPE_AW(LPD3DXFONT_DESC) DECLARE_INTERFACE_(ID3DXFont, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXFont methods ***/ @@ -143,7 +145,7 @@ DECLARE_INTERFACE_(ID3DXFont, IUnknown) STDMETHOD(PreloadCharacters)(THIS_ UINT first, UINT last) PURE; STDMETHOD(PreloadGlyphs)(THIS_ UINT first, UINT last) PURE; - STDMETHOD(PreloadTextA)(THIS_ LPCSTR string, INT count) PURE; + STDMETHOD(PreloadTextA)(THIS_ const char *string, INT count) PURE; STDMETHOD(PreloadTextW)(THIS_ const WCHAR *string, INT count) PURE; STDMETHOD_(INT, DrawTextA)(THIS_ struct ID3DXSprite *sprite, const char *string, @@ -209,7 +211,7 @@ DECLARE_INTERFACE_(ID3DXFont, IUnknown) DECLARE_INTERFACE_(ID3DXLine, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; @@ -217,9 +219,9 @@ DECLARE_INTERFACE_(ID3DXLine, IUnknown) STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9 **device) PURE; STDMETHOD(Begin)(THIS) PURE; - STDMETHOD(Draw)(THIS_ CONST D3DXVECTOR2 *vertexlist, DWORD vertexlistcount, D3DCOLOR color) PURE; - STDMETHOD(DrawTransform)(THIS_ CONST D3DXVECTOR3 *vertexlist, DWORD vertexlistcount, - CONST D3DXMATRIX *transform, D3DCOLOR color) PURE; + STDMETHOD(Draw)(THIS_ const D3DXVECTOR2 *vertexlist, DWORD vertexlistcount, D3DCOLOR color) PURE; + STDMETHOD(DrawTransform)(THIS_ const D3DXVECTOR3 *vertexlist, DWORD vertexlistcount, + const D3DXMATRIX *transform, D3DCOLOR color) PURE; STDMETHOD(SetPattern)(THIS_ DWORD pattern) PURE; STDMETHOD_(DWORD, GetPattern)(THIS) PURE; STDMETHOD(SetPatternScale)(THIS_ FLOAT scale) PURE; @@ -298,7 +300,7 @@ typedef struct _D3DXRTE_DESC DECLARE_INTERFACE_(ID3DXRenderToEnvMap, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; @@ -366,7 +368,7 @@ typedef struct _D3DXRTS_DESC DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXRenderToSurface methods ***/ @@ -411,16 +413,16 @@ DECLARE_INTERFACE_(ID3DXRenderToSurface, IUnknown) DECLARE_INTERFACE_(ID3DXSprite, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID *object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **object) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXSprite methods ***/ STDMETHOD(GetDevice)(THIS_ struct IDirect3DDevice9 **device) PURE; STDMETHOD(GetTransform)(THIS_ D3DXMATRIX *transform) PURE; - STDMETHOD(SetTransform)(THIS_ CONST D3DXMATRIX *transform) PURE; - STDMETHOD(SetWorldViewRH)(THIS_ CONST D3DXMATRIX *world, CONST D3DXMATRIX *view) PURE; - STDMETHOD(SetWorldViewLH)(THIS_ CONST D3DXMATRIX *world, CONST D3DXMATRIX *view) PURE; + STDMETHOD(SetTransform)(THIS_ const D3DXMATRIX *transform) PURE; + STDMETHOD(SetWorldViewRH)(THIS_ const D3DXMATRIX *world, const D3DXMATRIX *view) PURE; + STDMETHOD(SetWorldViewLH)(THIS_ const D3DXMATRIX *world, const D3DXMATRIX *view) PURE; STDMETHOD(Begin)(THIS_ DWORD flags) PURE; STDMETHOD(Draw)(THIS_ struct IDirect3DTexture9 *texture, const RECT *rect, diff --git a/reactos/include/dxsdk/d3dx9effect.h b/reactos/include/dxsdk/d3dx9effect.h index 0fd27ff0989..25d1fd23f96 100644 --- a/reactos/include/dxsdk/d3dx9effect.h +++ b/reactos/include/dxsdk/d3dx9effect.h @@ -31,16 +31,18 @@ #define D3DX_PARAMETER_LITERAL 2 #define D3DX_PARAMETER_ANNOTATION 4 -typedef struct _D3DXEFFECT_DESC { - LPCSTR Creator; +typedef struct _D3DXEFFECT_DESC +{ + const char *Creator; UINT Parameters; UINT Techniques; UINT Functions; } D3DXEFFECT_DESC; -typedef struct _D3DXPARAMETER_DESC { - LPCSTR Name; - LPCSTR Semantic; +typedef struct _D3DXPARAMETER_DESC +{ + const char *Name; + const char *Semantic; D3DXPARAMETER_CLASS Class; D3DXPARAMETER_TYPE Type; UINT Rows; @@ -52,21 +54,24 @@ typedef struct _D3DXPARAMETER_DESC { UINT Bytes; } D3DXPARAMETER_DESC; -typedef struct _D3DXTECHNIQUE_DESC { - LPCSTR Name; +typedef struct _D3DXTECHNIQUE_DESC +{ + const char *Name; UINT Passes; UINT Annotations; } D3DXTECHNIQUE_DESC; -typedef struct _D3DXPASS_DESC { - LPCSTR Name; +typedef struct _D3DXPASS_DESC +{ + const char *Name; UINT Annotations; - CONST DWORD *pVertexShaderFunction; - CONST DWORD *pPixelShaderFunction; + const DWORD *pVertexShaderFunction; + const DWORD *pPixelShaderFunction; } D3DXPASS_DESC; -typedef struct _D3DXFUNCTION_DESC { - LPCSTR Name; +typedef struct _D3DXFUNCTION_DESC +{ + const char *Name; UINT Annotations; } D3DXFUNCTION_DESC; @@ -80,7 +85,7 @@ DEFINE_GUID(IID_ID3DXEffectPool, 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0 DECLARE_INTERFACE_(ID3DXEffectPool, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; }; @@ -95,7 +100,7 @@ DEFINE_GUID(IID_ID3DXBaseEffect, 0x17c18ac, 0x103f, 0x4417, 0x8c, 0x51, 0x6b, 0x DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXBaseEffect methods ***/ @@ -105,49 +110,49 @@ DECLARE_INTERFACE_(ID3DXBaseEffect, IUnknown) STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE pass, D3DXPASS_DESC* desc) PURE; STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE shader, D3DXFUNCTION_DESC* desc) PURE; STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE parameter, UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE parameter, LPCSTR name) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE parameter, LPCSTR semantic) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE parameter, const char *name) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE parameter, const char *semantic) PURE; STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE parameter, UINT index) PURE; STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR name) PURE; + STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ const char *name) PURE; STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE technique, UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE technique, LPCSTR name) PURE; + STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE technique, const char *name) PURE; STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT index); - STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR name); + STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ const char *name); STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE object, UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE object, LPCSTR name) PURE; - STDMETHOD(SetValue)(THIS_ D3DXHANDLE parameter, LPCVOID data, UINT bytes) PURE; - STDMETHOD(GetValue)(THIS_ D3DXHANDLE parameter, LPVOID data, UINT bytes) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE object, const char *name) PURE; + STDMETHOD(SetValue)(THIS_ D3DXHANDLE parameter, const void *data, UINT bytes) PURE; + STDMETHOD(GetValue)(THIS_ D3DXHANDLE parameter, void *data, UINT bytes) PURE; STDMETHOD(SetBool)(THIS_ D3DXHANDLE parameter, BOOL b) PURE; STDMETHOD(GetBool)(THIS_ D3DXHANDLE parameter, BOOL* b) PURE; - STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE parameter, CONST BOOL* b, UINT count) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE parameter, const BOOL *b, UINT count) PURE; STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE parameter, BOOL* b, UINT count) PURE; STDMETHOD(SetInt)(THIS_ D3DXHANDLE parameter, INT n) PURE; STDMETHOD(GetInt)(THIS_ D3DXHANDLE parameter, INT* n) PURE; - STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE parameter, CONST INT* n, UINT count) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE parameter, const INT *n, UINT count) PURE; STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE parameter, INT* n, UINT count) PURE; STDMETHOD(SetFloat)(THIS_ D3DXHANDLE parameter, FLOAT f) PURE; STDMETHOD(GetFloat)(THIS_ D3DXHANDLE parameter, FLOAT* f) PURE; - STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE parameter, CONST FLOAT* f, UINT count) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE parameter, const FLOAT *f, UINT count) PURE; STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE parameter, FLOAT* f, UINT count) PURE; - STDMETHOD(SetVector)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE parameter, const D3DXVECTOR4 *vector) PURE; STDMETHOD(GetVector)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector) PURE; - STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector, UINT count) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE parameter, const D3DXVECTOR4 *vector, UINT count) PURE; STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector, UINT count) PURE; - STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix) PURE; STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE; - STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix, UINT count) PURE; STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE; - STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX **matrix, UINT count) PURE; STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE; - STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix) PURE; STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE; - STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix, UINT count) PURE; STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE; - STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX **matrix, UINT count) PURE; STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE; - STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, LPCSTR string) PURE; - STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE; + STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, const char *string) PURE; + STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, const char **string) PURE; STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 *texture) PURE; STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 **texture) PURE; STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader) PURE; @@ -165,13 +170,13 @@ DEFINE_GUID(IID_ID3DXEffectStateManager, 0x79aab587, 0x6dbc, 0x4fa7, 0x82, 0xde, DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXEffectStateManager methods ***/ - STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE state, CONST D3DMATRIX* matrix) PURE; - STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* material) PURE; - STDMETHOD(SetLight)(THIS_ DWORD index, CONST D3DLIGHT9* light) PURE; + STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix) PURE; + STDMETHOD(SetMaterial)(THIS_ const D3DMATERIAL9 *material) PURE; + STDMETHOD(SetLight)(THIS_ DWORD index, const D3DLIGHT9 *light) PURE; STDMETHOD(LightEnable)(THIS_ DWORD index, BOOL enable) PURE; STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE state, DWORD value) PURE; STDMETHOD(SetTexture)(THIS_ DWORD stage, struct IDirect3DBaseTexture9 *texture) PURE; @@ -180,13 +185,13 @@ DECLARE_INTERFACE_(ID3DXEffectStateManager, IUnknown) STDMETHOD(SetNPatchMode)(THIS_ FLOAT num_segments) PURE; STDMETHOD(SetFVF)(THIS_ DWORD format) PURE; STDMETHOD(SetVertexShader)(THIS_ struct IDirect3DVertexShader9 *shader) PURE; - STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT register_index, CONST FLOAT* constant_data, UINT register_count) PURE; - STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT register_index, CONST INT* constant_data, UINT register_count) PURE; - STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT register_index, CONST BOOL* constant_data, UINT register_count) PURE; + STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT register_index, const FLOAT *constant_data, UINT register_count) PURE; + STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT register_index, const INT *constant_data, UINT register_count) PURE; + STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT register_index, const BOOL *constant_data, UINT register_count) PURE; STDMETHOD(SetPixelShader)(THIS_ struct IDirect3DPixelShader9 *shader) PURE; - STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT register_index, CONST FLOAT* constant_data, UINT register_count) PURE; - STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT register_index, CONST INT * constant_data, UINT register_count) PURE; - STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT register_index, CONST BOOL* constant_data, UINT register_count) PURE; + STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT register_index, const FLOAT *constant_data, UINT register_count) PURE; + STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT register_index, const INT *constant_data, UINT register_count) PURE; + STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT register_index, const BOOL *constant_data, UINT register_count) PURE; }; #undef INTERFACE @@ -199,7 +204,7 @@ DEFINE_GUID(IID_ID3DXEffect, 0xf6ceb4b3, 0x4e4c, 0x40dd, 0xb8, 0x83, 0x8d, 0x8d, DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXBaseEffect methods ***/ @@ -209,49 +214,49 @@ DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect) STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE pass, D3DXPASS_DESC* desc) PURE; STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE shader, D3DXFUNCTION_DESC* desc) PURE; STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE parameter, UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE parameter, LPCSTR name) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE parameter, LPCSTR semantic) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE parameter, const char *name) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE parameter, const char *semantic) PURE; STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE parameter, UINT index) PURE; STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR name) PURE; + STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ const char *name) PURE; STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE technique, UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE technique, LPCSTR name) PURE; + STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE technique, const char *name) PURE; STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT index); - STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR name); + STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ const char *name); STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE object, UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE object, LPCSTR name) PURE; - STDMETHOD(SetValue)(THIS_ D3DXHANDLE parameter, LPCVOID data, UINT bytes) PURE; - STDMETHOD(GetValue)(THIS_ D3DXHANDLE parameter, LPVOID data, UINT bytes) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE object, const char *name) PURE; + STDMETHOD(SetValue)(THIS_ D3DXHANDLE parameter, const void *data, UINT bytes) PURE; + STDMETHOD(GetValue)(THIS_ D3DXHANDLE parameter, void *data, UINT bytes) PURE; STDMETHOD(SetBool)(THIS_ D3DXHANDLE parameter, BOOL b) PURE; STDMETHOD(GetBool)(THIS_ D3DXHANDLE parameter, BOOL* b) PURE; - STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE parameter, CONST BOOL* b, UINT count) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE parameter, const BOOL *b, UINT count) PURE; STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE parameter, BOOL* b, UINT count) PURE; STDMETHOD(SetInt)(THIS_ D3DXHANDLE parameter, INT n) PURE; STDMETHOD(GetInt)(THIS_ D3DXHANDLE parameter, INT* n) PURE; - STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE parameter, CONST INT* n, UINT count) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE parameter, const INT *n, UINT count) PURE; STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE parameter, INT* n, UINT count) PURE; STDMETHOD(SetFloat)(THIS_ D3DXHANDLE parameter, FLOAT f) PURE; STDMETHOD(GetFloat)(THIS_ D3DXHANDLE parameter, FLOAT* f) PURE; - STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE parameter, CONST FLOAT* f, UINT count) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE parameter, const FLOAT *f, UINT count) PURE; STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE parameter, FLOAT* f, UINT count) PURE; - STDMETHOD(SetVector)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE parameter, const D3DXVECTOR4 *vector) PURE; STDMETHOD(GetVector)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector) PURE; - STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector, UINT count) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE parameter, const D3DXVECTOR4 *vector, UINT count) PURE; STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector, UINT count) PURE; - STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix) PURE; STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE; - STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix, UINT count) PURE; STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE; - STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX **matrix, UINT count) PURE; STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE; - STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix) PURE; STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE; - STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix, UINT count) PURE; STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE; - STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX **matrix, UINT count) PURE; STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE; - STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, LPCSTR string) PURE; - STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE; + STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, const char *string) PURE; + STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, const char **string) PURE; STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 *texture) PURE; STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 **texture) PURE; STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader) PURE; @@ -279,7 +284,7 @@ DECLARE_INTERFACE_(ID3DXEffect, ID3DXBaseEffect) STDMETHOD(ApplyParameterBlock)(THIS_ D3DXHANDLE parameter_block) PURE; STDMETHOD(DeleteParameterBlock)(THIS_ D3DXHANDLE parameter_block) PURE; STDMETHOD(CloneEffect)(THIS_ struct IDirect3DDevice9 *device, struct ID3DXEffect **effect) PURE; - STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE parameter, LPCVOID data, UINT byte_offset, UINT bytes) PURE; + STDMETHOD(SetRawValue)(THIS_ D3DXHANDLE parameter, const void *data, UINT byte_offset, UINT bytes) PURE; }; #undef INTERFACE @@ -292,7 +297,7 @@ DEFINE_GUID(IID_ID3DXEffectCompiler, 0x51b8a949, 0x1a31, 0x47e6, 0xbe, 0xa0, 0x4 DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXBaseEffect methods ***/ @@ -302,49 +307,49 @@ DECLARE_INTERFACE_(ID3DXEffectCompiler, ID3DXBaseEffect) STDMETHOD(GetPassDesc)(THIS_ D3DXHANDLE pass, D3DXPASS_DESC* desc) PURE; STDMETHOD(GetFunctionDesc)(THIS_ D3DXHANDLE shader, D3DXFUNCTION_DESC* desc) PURE; STDMETHOD_(D3DXHANDLE, GetParameter)(THIS_ D3DXHANDLE parameter, UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE parameter, LPCSTR name) PURE; - STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE parameter, LPCSTR semantic) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterByName)(THIS_ D3DXHANDLE parameter, const char *name) PURE; + STDMETHOD_(D3DXHANDLE, GetParameterBySemantic)(THIS_ D3DXHANDLE parameter, const char *semantic) PURE; STDMETHOD_(D3DXHANDLE, GetParameterElement)(THIS_ D3DXHANDLE parameter, UINT index) PURE; STDMETHOD_(D3DXHANDLE, GetTechnique)(THIS_ UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ LPCSTR name) PURE; + STDMETHOD_(D3DXHANDLE, GetTechniqueByName)(THIS_ const char *name) PURE; STDMETHOD_(D3DXHANDLE, GetPass)(THIS_ D3DXHANDLE technique, UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE technique, LPCSTR name) PURE; + STDMETHOD_(D3DXHANDLE, GetPassByName)(THIS_ D3DXHANDLE technique, const char *name) PURE; STDMETHOD_(D3DXHANDLE, GetFunction)(THIS_ UINT index); - STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ LPCSTR name); + STDMETHOD_(D3DXHANDLE, GetFunctionByName)(THIS_ const char *name); STDMETHOD_(D3DXHANDLE, GetAnnotation)(THIS_ D3DXHANDLE object, UINT index) PURE; - STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE object, LPCSTR name) PURE; - STDMETHOD(SetValue)(THIS_ D3DXHANDLE parameter, LPCVOID data, UINT bytes) PURE; - STDMETHOD(GetValue)(THIS_ D3DXHANDLE parameter, LPVOID data, UINT bytes) PURE; + STDMETHOD_(D3DXHANDLE, GetAnnotationByName)(THIS_ D3DXHANDLE object, const char *name) PURE; + STDMETHOD(SetValue)(THIS_ D3DXHANDLE parameter, const void *data, UINT bytes) PURE; + STDMETHOD(GetValue)(THIS_ D3DXHANDLE parameter, void *data, UINT bytes) PURE; STDMETHOD(SetBool)(THIS_ D3DXHANDLE parameter, BOOL b) PURE; STDMETHOD(GetBool)(THIS_ D3DXHANDLE parameter, BOOL* b) PURE; - STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE parameter, CONST BOOL* b, UINT count) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE parameter, const BOOL *b, UINT count) PURE; STDMETHOD(GetBoolArray)(THIS_ D3DXHANDLE parameter, BOOL* b, UINT count) PURE; STDMETHOD(SetInt)(THIS_ D3DXHANDLE parameter, INT n) PURE; STDMETHOD(GetInt)(THIS_ D3DXHANDLE parameter, INT* n) PURE; - STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE parameter, CONST INT* n, UINT count) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE parameter, const INT *n, UINT count) PURE; STDMETHOD(GetIntArray)(THIS_ D3DXHANDLE parameter, INT* n, UINT count) PURE; STDMETHOD(SetFloat)(THIS_ D3DXHANDLE parameter, FLOAT f) PURE; STDMETHOD(GetFloat)(THIS_ D3DXHANDLE parameter, FLOAT* f) PURE; - STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE parameter, CONST FLOAT* f, UINT count) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE parameter, const FLOAT *f, UINT count) PURE; STDMETHOD(GetFloatArray)(THIS_ D3DXHANDLE parameter, FLOAT* f, UINT count) PURE; - STDMETHOD(SetVector)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE parameter, const D3DXVECTOR4 *vector) PURE; STDMETHOD(GetVector)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector) PURE; - STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE parameter, CONST D3DXVECTOR4* vector, UINT count) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE parameter, const D3DXVECTOR4 *vector, UINT count) PURE; STDMETHOD(GetVectorArray)(THIS_ D3DXHANDLE parameter, D3DXVECTOR4* vector, UINT count) PURE; - STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix) PURE; STDMETHOD(GetMatrix)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE; - STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix, UINT count) PURE; STDMETHOD(GetMatrixArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE; - STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX **matrix, UINT count) PURE; STDMETHOD(GetMatrixPointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE; - STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix) PURE; STDMETHOD(GetMatrixTranspose)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix) PURE; - STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX* matrix, UINT count) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX *matrix, UINT count) PURE; STDMETHOD(GetMatrixTransposeArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX* matrix, UINT count) PURE; - STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, CONST D3DXMATRIX** matrix, UINT count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, const D3DXMATRIX **matrix, UINT count) PURE; STDMETHOD(GetMatrixTransposePointerArray)(THIS_ D3DXHANDLE parameter, D3DXMATRIX** matrix, UINT count) PURE; - STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, LPCSTR string) PURE; - STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, LPCSTR* string) PURE; + STDMETHOD(SetString)(THIS_ D3DXHANDLE parameter, const char *string) PURE; + STDMETHOD(GetString)(THIS_ D3DXHANDLE parameter, const char **string) PURE; STDMETHOD(SetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 *texture) PURE; STDMETHOD(GetTexture)(THIS_ D3DXHANDLE parameter, struct IDirect3DBaseTexture9 **texture) PURE; STDMETHOD(GetPixelShader)(THIS_ D3DXHANDLE parameter, struct IDirect3DPixelShader9 **shader) PURE; diff --git a/reactos/include/dxsdk/d3dx9math.h b/reactos/include/dxsdk/d3dx9math.h index 36c9df0d95f..2c41b73d423 100644 --- a/reactos/include/dxsdk/d3dx9math.h +++ b/reactos/include/dxsdk/d3dx9math.h @@ -414,7 +414,7 @@ DEFINE_GUID(IID_ID3DXMatrixStack, DECLARE_INTERFACE_(ID3DXMatrixStack, IUnknown) { - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; STDMETHOD(Pop)(THIS) PURE; diff --git a/reactos/include/dxsdk/d3dx9math.inl b/reactos/include/dxsdk/d3dx9math.inl index 84c0c623d3b..ee2f82b851c 100644 --- a/reactos/include/dxsdk/d3dx9math.inl +++ b/reactos/include/dxsdk/d3dx9math.inl @@ -27,7 +27,7 @@ inline D3DXVECTOR2::D3DXVECTOR2() { } -inline D3DXVECTOR2::D3DXVECTOR2(CONST FLOAT *pf) +inline D3DXVECTOR2::D3DXVECTOR2(const FLOAT *pf) { if(!pf) return; x = pf[0]; @@ -45,19 +45,19 @@ inline D3DXVECTOR2::operator FLOAT* () return (FLOAT*)&x; } -inline D3DXVECTOR2::operator CONST FLOAT* () const +inline D3DXVECTOR2::operator const FLOAT* () const { - return (CONST FLOAT*)&x; + return (const FLOAT*)&x; } -inline D3DXVECTOR2& D3DXVECTOR2::operator += (CONST D3DXVECTOR2& v) +inline D3DXVECTOR2& D3DXVECTOR2::operator += (const D3DXVECTOR2& v) { x += v.x; y += v.y; return *this; } -inline D3DXVECTOR2& D3DXVECTOR2::operator -= (CONST D3DXVECTOR2& v) +inline D3DXVECTOR2& D3DXVECTOR2::operator -= (const D3DXVECTOR2& v) { x -= v.x; y -= v.y; @@ -88,12 +88,12 @@ inline D3DXVECTOR2 D3DXVECTOR2::operator - () const return D3DXVECTOR2(-x, -y); } -inline D3DXVECTOR2 D3DXVECTOR2::operator + (CONST D3DXVECTOR2& v) const +inline D3DXVECTOR2 D3DXVECTOR2::operator + (const D3DXVECTOR2& v) const { return D3DXVECTOR2(x + v.x, y + v.y); } -inline D3DXVECTOR2 D3DXVECTOR2::operator - (CONST D3DXVECTOR2& v) const +inline D3DXVECTOR2 D3DXVECTOR2::operator - (const D3DXVECTOR2& v) const { return D3DXVECTOR2(x - v.x, y - v.y); } @@ -108,17 +108,17 @@ inline D3DXVECTOR2 D3DXVECTOR2::operator / (FLOAT f) const return D3DXVECTOR2(x / f, y / f); } -inline D3DXVECTOR2 operator * (FLOAT f, CONST D3DXVECTOR2& v) +inline D3DXVECTOR2 operator * (FLOAT f, const D3DXVECTOR2& v) { return D3DXVECTOR2(f * v.x, f * v.y); } -inline BOOL D3DXVECTOR2::operator == (CONST D3DXVECTOR2& v) const +inline BOOL D3DXVECTOR2::operator == (const D3DXVECTOR2& v) const { return x == v.x && y == v.y; } -inline BOOL D3DXVECTOR2::operator != (CONST D3DXVECTOR2& v) const +inline BOOL D3DXVECTOR2::operator != (const D3DXVECTOR2& v) const { return x != v.x || y != v.y; } @@ -127,7 +127,7 @@ inline D3DXVECTOR3::D3DXVECTOR3() { } -inline D3DXVECTOR3::D3DXVECTOR3(CONST FLOAT *pf) +inline D3DXVECTOR3::D3DXVECTOR3(const FLOAT *pf) { if(!pf) return; x = pf[0]; @@ -135,7 +135,7 @@ inline D3DXVECTOR3::D3DXVECTOR3(CONST FLOAT *pf) z = pf[2]; } -inline D3DXVECTOR3::D3DXVECTOR3(CONST D3DVECTOR& v) +inline D3DXVECTOR3::D3DXVECTOR3(const D3DVECTOR& v) { x = v.x; y = v.y; @@ -154,12 +154,12 @@ inline D3DXVECTOR3::operator FLOAT* () return (FLOAT*)&x; } -inline D3DXVECTOR3::operator CONST FLOAT* () const +inline D3DXVECTOR3::operator const FLOAT* () const { - return (CONST FLOAT*)&x; + return (const FLOAT*)&x; } -inline D3DXVECTOR3& D3DXVECTOR3::operator += (CONST D3DXVECTOR3& v) +inline D3DXVECTOR3& D3DXVECTOR3::operator += (const D3DXVECTOR3& v) { x += v.x; y += v.y; @@ -167,7 +167,7 @@ inline D3DXVECTOR3& D3DXVECTOR3::operator += (CONST D3DXVECTOR3& v) return *this; } -inline D3DXVECTOR3& D3DXVECTOR3::operator -= (CONST D3DXVECTOR3& v) +inline D3DXVECTOR3& D3DXVECTOR3::operator -= (const D3DXVECTOR3& v) { x -= v.x; y -= v.y; @@ -201,12 +201,12 @@ inline D3DXVECTOR3 D3DXVECTOR3::operator - () const return D3DXVECTOR3(-x, -y, -z); } -inline D3DXVECTOR3 D3DXVECTOR3::operator + (CONST D3DXVECTOR3& v) const +inline D3DXVECTOR3 D3DXVECTOR3::operator + (const D3DXVECTOR3& v) const { return D3DXVECTOR3(x + v.x, y + v.y, z + v.z); } -inline D3DXVECTOR3 D3DXVECTOR3::operator - (CONST D3DXVECTOR3& v) const +inline D3DXVECTOR3 D3DXVECTOR3::operator - (const D3DXVECTOR3& v) const { return D3DXVECTOR3(x - v.x, y - v.y, z - v.z); } @@ -221,17 +221,17 @@ inline D3DXVECTOR3 D3DXVECTOR3::operator / (FLOAT f) const return D3DXVECTOR3(x / f, y / f, z / f); } -inline D3DXVECTOR3 operator * (FLOAT f, CONST D3DXVECTOR3& v) +inline D3DXVECTOR3 operator * (FLOAT f, const D3DXVECTOR3& v) { return D3DXVECTOR3(f * v.x, f * v.y, f * v.z); } -inline BOOL D3DXVECTOR3::operator == (CONST D3DXVECTOR3& v) const +inline BOOL D3DXVECTOR3::operator == (const D3DXVECTOR3& v) const { return x == v.x && y == v.y && z == v.z; } -inline BOOL D3DXVECTOR3::operator != (CONST D3DXVECTOR3& v) const +inline BOOL D3DXVECTOR3::operator != (const D3DXVECTOR3& v) const { return x != v.x || y != v.y || z != v.z; } @@ -240,7 +240,7 @@ inline D3DXVECTOR4::D3DXVECTOR4() { } -inline D3DXVECTOR4::D3DXVECTOR4(CONST FLOAT *pf) +inline D3DXVECTOR4::D3DXVECTOR4(const FLOAT *pf) { if(!pf) return; x = pf[0]; @@ -262,12 +262,12 @@ inline D3DXVECTOR4::operator FLOAT* () return (FLOAT*)&x; } -inline D3DXVECTOR4::operator CONST FLOAT* () const +inline D3DXVECTOR4::operator const FLOAT* () const { - return (CONST FLOAT*)&x; + return (const FLOAT*)&x; } -inline D3DXVECTOR4& D3DXVECTOR4::operator += (CONST D3DXVECTOR4& v) +inline D3DXVECTOR4& D3DXVECTOR4::operator += (const D3DXVECTOR4& v) { x += v.x; y += v.y; @@ -276,7 +276,7 @@ inline D3DXVECTOR4& D3DXVECTOR4::operator += (CONST D3DXVECTOR4& v) return *this; } -inline D3DXVECTOR4& D3DXVECTOR4::operator -= (CONST D3DXVECTOR4& v) +inline D3DXVECTOR4& D3DXVECTOR4::operator -= (const D3DXVECTOR4& v) { x -= v.x; y -= v.y; @@ -313,12 +313,12 @@ inline D3DXVECTOR4 D3DXVECTOR4::operator - () const return D3DXVECTOR4(-x, -y, -z, -w); } -inline D3DXVECTOR4 D3DXVECTOR4::operator + (CONST D3DXVECTOR4& v) const +inline D3DXVECTOR4 D3DXVECTOR4::operator + (const D3DXVECTOR4& v) const { return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w); } -inline D3DXVECTOR4 D3DXVECTOR4::operator - (CONST D3DXVECTOR4& v) const +inline D3DXVECTOR4 D3DXVECTOR4::operator - (const D3DXVECTOR4& v) const { return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w); } @@ -333,17 +333,17 @@ inline D3DXVECTOR4 D3DXVECTOR4::operator / (FLOAT f) const return D3DXVECTOR4(x / f, y / f, z / f, w / f); } -inline D3DXVECTOR4 operator * (FLOAT f, CONST D3DXVECTOR4& v) +inline D3DXVECTOR4 operator * (FLOAT f, const D3DXVECTOR4& v) { return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w); } -inline BOOL D3DXVECTOR4::operator == (CONST D3DXVECTOR4& v) const +inline BOOL D3DXVECTOR4::operator == (const D3DXVECTOR4& v) const { return x == v.x && y == v.y && z == v.z && w == v.w; } -inline BOOL D3DXVECTOR4::operator != (CONST D3DXVECTOR4& v) const +inline BOOL D3DXVECTOR4::operator != (const D3DXVECTOR4& v) const { return x != v.x || y != v.y || z != v.z || w != v.w; } @@ -352,13 +352,13 @@ inline D3DXMATRIX::D3DXMATRIX() { } -inline D3DXMATRIX::D3DXMATRIX(CONST FLOAT *pf) +inline D3DXMATRIX::D3DXMATRIX(const FLOAT *pf) { if(!pf) return; memcpy(&_11, pf, sizeof(D3DXMATRIX)); } -inline D3DXMATRIX::D3DXMATRIX(CONST D3DMATRIX& mat) +inline D3DXMATRIX::D3DXMATRIX(const D3DMATRIX& mat) { memcpy(&_11, &mat, sizeof(D3DXMATRIX)); } @@ -389,18 +389,18 @@ inline D3DXMATRIX::operator FLOAT* () return (FLOAT*)&_11; } -inline D3DXMATRIX::operator CONST FLOAT* () const +inline D3DXMATRIX::operator const FLOAT* () const { - return (CONST FLOAT*)&_11; + return (const FLOAT*)&_11; } -inline D3DXMATRIX& D3DXMATRIX::operator *= (CONST D3DXMATRIX& mat) +inline D3DXMATRIX& D3DXMATRIX::operator *= (const D3DXMATRIX& mat) { D3DXMatrixMultiply(this, this, &mat); return *this; } -inline D3DXMATRIX& D3DXMATRIX::operator += (CONST D3DXMATRIX& mat) +inline D3DXMATRIX& D3DXMATRIX::operator += (const D3DXMATRIX& mat) { _11 += mat._11; _12 += mat._12; _13 += mat._13; _14 += mat._14; _21 += mat._21; _22 += mat._22; _23 += mat._23; _24 += mat._24; @@ -409,7 +409,7 @@ inline D3DXMATRIX& D3DXMATRIX::operator += (CONST D3DXMATRIX& mat) return *this; } -inline D3DXMATRIX& D3DXMATRIX::operator -= (CONST D3DXMATRIX& mat) +inline D3DXMATRIX& D3DXMATRIX::operator -= (const D3DXMATRIX& mat) { _11 -= mat._11; _12 -= mat._12; _13 -= mat._13; _14 -= mat._14; _21 -= mat._21; _22 -= mat._22; _23 -= mat._23; _24 -= mat._24; @@ -450,14 +450,14 @@ inline D3DXMATRIX D3DXMATRIX::operator - () const -_41, -_42, -_43, -_44); } -inline D3DXMATRIX D3DXMATRIX::operator * (CONST D3DXMATRIX& mat) const +inline D3DXMATRIX D3DXMATRIX::operator * (const D3DXMATRIX& mat) const { D3DXMATRIX buf; D3DXMatrixMultiply(&buf, this, &mat); return buf; } -inline D3DXMATRIX D3DXMATRIX::operator + (CONST D3DXMATRIX& mat) const +inline D3DXMATRIX D3DXMATRIX::operator + (const D3DXMATRIX& mat) const { return D3DXMATRIX(_11 + mat._11, _12 + mat._12, _13 + mat._13, _14 + mat._14, _21 + mat._21, _22 + mat._22, _23 + mat._23, _24 + mat._24, @@ -465,7 +465,7 @@ inline D3DXMATRIX D3DXMATRIX::operator + (CONST D3DXMATRIX& mat) const _41 + mat._41, _42 + mat._42, _43 + mat._43, _44 + mat._44); } -inline D3DXMATRIX D3DXMATRIX::operator - (CONST D3DXMATRIX& mat) const +inline D3DXMATRIX D3DXMATRIX::operator - (const D3DXMATRIX& mat) const { return D3DXMATRIX(_11 - mat._11, _12 - mat._12, _13 - mat._13, _14 - mat._14, _21 - mat._21, _22 - mat._22, _23 - mat._23, _24 - mat._24, @@ -490,7 +490,7 @@ inline D3DXMATRIX D3DXMATRIX::operator / (FLOAT f) const _41 * inv, _42 * inv, _43 * inv, _44 * inv); } -inline D3DXMATRIX operator * (FLOAT f, CONST D3DXMATRIX& mat) +inline D3DXMATRIX operator * (FLOAT f, const D3DXMATRIX& mat) { return D3DXMATRIX(f * mat._11, f * mat._12, f * mat._13, f * mat._14, f * mat._21, f * mat._22, f * mat._23, f * mat._24, @@ -498,12 +498,12 @@ inline D3DXMATRIX operator * (FLOAT f, CONST D3DXMATRIX& mat) f * mat._41, f * mat._42, f * mat._43, f * mat._44); } -inline BOOL D3DXMATRIX::operator == (CONST D3DXMATRIX& mat) const +inline BOOL D3DXMATRIX::operator == (const D3DXMATRIX& mat) const { return (memcmp(this, &mat, sizeof(D3DXMATRIX)) == 0); } -inline BOOL D3DXMATRIX::operator != (CONST D3DXMATRIX& mat) const +inline BOOL D3DXMATRIX::operator != (const D3DXMATRIX& mat) const { return (memcmp(this, &mat, sizeof(D3DXMATRIX)) != 0); } @@ -512,7 +512,7 @@ inline D3DXQUATERNION::D3DXQUATERNION() { } -inline D3DXQUATERNION::D3DXQUATERNION(CONST FLOAT *pf) +inline D3DXQUATERNION::D3DXQUATERNION(const FLOAT *pf) { if(!pf) return; x = pf[0]; @@ -534,12 +534,12 @@ inline D3DXQUATERNION::operator FLOAT* () return (FLOAT*)&x; } -inline D3DXQUATERNION::operator CONST FLOAT* () const +inline D3DXQUATERNION::operator const FLOAT* () const { - return (CONST FLOAT*)&x; + return (const FLOAT*)&x; } -inline D3DXQUATERNION& D3DXQUATERNION::operator += (CONST D3DXQUATERNION& quat) +inline D3DXQUATERNION& D3DXQUATERNION::operator += (const D3DXQUATERNION& quat) { x += quat.x; y += quat.y; @@ -548,7 +548,7 @@ inline D3DXQUATERNION& D3DXQUATERNION::operator += (CONST D3DXQUATERNION& quat) return *this; } -inline D3DXQUATERNION& D3DXQUATERNION::operator -= (CONST D3DXQUATERNION& quat) +inline D3DXQUATERNION& D3DXQUATERNION::operator -= (const D3DXQUATERNION& quat) { x -= quat.x; y -= quat.y; @@ -557,7 +557,7 @@ inline D3DXQUATERNION& D3DXQUATERNION::operator -= (CONST D3DXQUATERNION& quat) return *this; } -inline D3DXQUATERNION& D3DXQUATERNION::operator *= (CONST D3DXQUATERNION& quat) +inline D3DXQUATERNION& D3DXQUATERNION::operator *= (const D3DXQUATERNION& quat) { D3DXQuaternionMultiply(this, this, &quat); return *this; @@ -592,17 +592,17 @@ inline D3DXQUATERNION D3DXQUATERNION::operator - () const return D3DXQUATERNION(-x, -y, -z, -w); } -inline D3DXQUATERNION D3DXQUATERNION::operator + (CONST D3DXQUATERNION& quat) const +inline D3DXQUATERNION D3DXQUATERNION::operator + (const D3DXQUATERNION& quat) const { return D3DXQUATERNION(x + quat.x, y + quat.y, z + quat.z, w + quat.w); } -inline D3DXQUATERNION D3DXQUATERNION::operator - (CONST D3DXQUATERNION& quat) const +inline D3DXQUATERNION D3DXQUATERNION::operator - (const D3DXQUATERNION& quat) const { return D3DXQUATERNION(x - quat.x, y - quat.y, z - quat.z, w - quat.w); } -inline D3DXQUATERNION D3DXQUATERNION::operator * (CONST D3DXQUATERNION& quat) const +inline D3DXQUATERNION D3DXQUATERNION::operator * (const D3DXQUATERNION& quat) const { D3DXQUATERNION buf; D3DXQuaternionMultiply(&buf, this, &quat); @@ -620,17 +620,17 @@ inline D3DXQUATERNION D3DXQUATERNION::operator / (FLOAT f) const return D3DXQUATERNION(x * inv, y * inv, z * inv, w * inv); } -inline D3DXQUATERNION operator * (FLOAT f, CONST D3DXQUATERNION& quat) +inline D3DXQUATERNION operator * (FLOAT f, const D3DXQUATERNION& quat) { return D3DXQUATERNION(f * quat.x, f * quat.y, f * quat.z, f * quat.w); } -inline BOOL D3DXQUATERNION::operator == (CONST D3DXQUATERNION& quat) const +inline BOOL D3DXQUATERNION::operator == (const D3DXQUATERNION& quat) const { return x == quat.x && y == quat.y && z == quat.z && w == quat.w; } -inline BOOL D3DXQUATERNION::operator != (CONST D3DXQUATERNION& quat) const +inline BOOL D3DXQUATERNION::operator != (const D3DXQUATERNION& quat) const { return x != quat.x || y != quat.y || z != quat.z || w != quat.w; } @@ -639,7 +639,7 @@ inline D3DXPLANE::D3DXPLANE() { } -inline D3DXPLANE::D3DXPLANE(CONST FLOAT *pf) +inline D3DXPLANE::D3DXPLANE(const FLOAT *pf) { if(!pf) return; a = pf[0]; @@ -661,9 +661,9 @@ inline D3DXPLANE::operator FLOAT* () return (FLOAT*)&a; } -inline D3DXPLANE::operator CONST FLOAT* () const +inline D3DXPLANE::operator const FLOAT* () const { - return (CONST FLOAT*)&a; + return (const FLOAT*)&a; } inline D3DXPLANE D3DXPLANE::operator + () const @@ -676,12 +676,12 @@ inline D3DXPLANE D3DXPLANE::operator - () const return D3DXPLANE(-a, -b, -c, -d); } -inline BOOL D3DXPLANE::operator == (CONST D3DXPLANE& pl) const +inline BOOL D3DXPLANE::operator == (const D3DXPLANE& pl) const { return a == pl.a && b == pl.b && c == pl.c && d == pl.d; } -inline BOOL D3DXPLANE::operator != (CONST D3DXPLANE& pl) const +inline BOOL D3DXPLANE::operator != (const D3DXPLANE& pl) const { return a != pl.a || b != pl.b || c != pl.c || d != pl.d; } @@ -692,14 +692,14 @@ inline D3DXCOLOR::D3DXCOLOR() inline D3DXCOLOR::D3DXCOLOR(DWORD col) { - CONST FLOAT f = 1.0f / 255.0f; + const FLOAT f = 1.0f / 255.0f; r = f * (FLOAT)(unsigned char)(col >> 16); g = f * (FLOAT)(unsigned char)(col >> 8); b = f * (FLOAT)(unsigned char)col; a = f * (FLOAT)(unsigned char)(col >> 24); } -inline D3DXCOLOR::D3DXCOLOR(CONST FLOAT *pf) +inline D3DXCOLOR::D3DXCOLOR(const FLOAT *pf) { if(!pf) return; r = pf[0]; @@ -708,7 +708,7 @@ inline D3DXCOLOR::D3DXCOLOR(CONST FLOAT *pf) a = pf[3]; } -inline D3DXCOLOR::D3DXCOLOR(CONST D3DCOLORVALUE& col) +inline D3DXCOLOR::D3DXCOLOR(const D3DCOLORVALUE& col) { r = col.r; g = col.g; @@ -739,9 +739,9 @@ inline D3DXCOLOR::operator FLOAT * () return (FLOAT*)&r; } -inline D3DXCOLOR::operator CONST FLOAT * () const +inline D3DXCOLOR::operator const FLOAT * () const { - return (CONST FLOAT*)&r; + return (const FLOAT*)&r; } inline D3DXCOLOR::operator D3DCOLORVALUE * () @@ -749,9 +749,9 @@ inline D3DXCOLOR::operator D3DCOLORVALUE * () return (D3DCOLORVALUE*)&r; } -inline D3DXCOLOR::operator CONST D3DCOLORVALUE * () const +inline D3DXCOLOR::operator const D3DCOLORVALUE * () const { - return (CONST D3DCOLORVALUE*)&r; + return (const D3DCOLORVALUE*)&r; } inline D3DXCOLOR::operator D3DCOLORVALUE& () @@ -759,12 +759,12 @@ inline D3DXCOLOR::operator D3DCOLORVALUE& () return *((D3DCOLORVALUE*)&r); } -inline D3DXCOLOR::operator CONST D3DCOLORVALUE& () const +inline D3DXCOLOR::operator const D3DCOLORVALUE& () const { - return *((CONST D3DCOLORVALUE*)&r); + return *((const D3DCOLORVALUE*)&r); } -inline D3DXCOLOR& D3DXCOLOR::operator += (CONST D3DXCOLOR& col) +inline D3DXCOLOR& D3DXCOLOR::operator += (const D3DXCOLOR& col) { r += col.r; g += col.g; @@ -773,7 +773,7 @@ inline D3DXCOLOR& D3DXCOLOR::operator += (CONST D3DXCOLOR& col) return *this; } -inline D3DXCOLOR& D3DXCOLOR::operator -= (CONST D3DXCOLOR& col) +inline D3DXCOLOR& D3DXCOLOR::operator -= (const D3DXCOLOR& col) { r -= col.r; g -= col.g; @@ -811,12 +811,12 @@ inline D3DXCOLOR D3DXCOLOR::operator - () const return D3DXCOLOR(-r, -g, -b, -a); } -inline D3DXCOLOR D3DXCOLOR::operator + (CONST D3DXCOLOR& col) const +inline D3DXCOLOR D3DXCOLOR::operator + (const D3DXCOLOR& col) const { return D3DXCOLOR(r + col.r, g + col.g, b + col.b, a + col.a); } -inline D3DXCOLOR D3DXCOLOR::operator - (CONST D3DXCOLOR& col) const +inline D3DXCOLOR D3DXCOLOR::operator - (const D3DXCOLOR& col) const { return D3DXCOLOR(r - col.r, g - col.g, b - col.b, a - col.a); } @@ -832,17 +832,17 @@ inline D3DXCOLOR D3DXCOLOR::operator / (FLOAT f) const return D3DXCOLOR(r * inv, g * inv, b * inv, a * inv); } -inline D3DXCOLOR operator * (FLOAT f, CONST D3DXCOLOR& col) +inline D3DXCOLOR operator * (FLOAT f, const D3DXCOLOR& col) { return D3DXCOLOR(f * col.r, f * col.g, f * col.b, f * col.a); } -inline BOOL D3DXCOLOR::operator == (CONST D3DXCOLOR& col) const +inline BOOL D3DXCOLOR::operator == (const D3DXCOLOR& col) const { return r == col.r && g == col.g && b == col.b && a == col.a; } -inline BOOL D3DXCOLOR::operator != (CONST D3DXCOLOR& col) const +inline BOOL D3DXCOLOR::operator != (const D3DXCOLOR& col) const { return r != col.r || g != col.g || b != col.b || a != col.a; } @@ -856,7 +856,7 @@ inline D3DXFLOAT16::D3DXFLOAT16(FLOAT f) D3DXFloat32To16Array(this, &f, 1); } -inline D3DXFLOAT16::D3DXFLOAT16(CONST D3DXFLOAT16 &f) +inline D3DXFLOAT16::D3DXFLOAT16(const D3DXFLOAT16 &f) { value = f.value; } @@ -868,12 +868,12 @@ inline D3DXFLOAT16::operator FLOAT () return f; } -inline BOOL D3DXFLOAT16::operator == (CONST D3DXFLOAT16 &f) const +inline BOOL D3DXFLOAT16::operator == (const D3DXFLOAT16 &f) const { return value == f.value; } -inline BOOL D3DXFLOAT16::operator != (CONST D3DXFLOAT16 &f) const +inline BOOL D3DXFLOAT16::operator != (const D3DXFLOAT16 &f) const { return value != f.value; } @@ -882,7 +882,7 @@ inline BOOL D3DXFLOAT16::operator != (CONST D3DXFLOAT16 &f) const /*_______________D3DXCOLOR_____________________*/ -static inline D3DXCOLOR* D3DXColorAdd(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2) +static inline D3DXCOLOR* D3DXColorAdd(D3DXCOLOR *pout, const D3DXCOLOR *pc1, const D3DXCOLOR *pc2) { if ( !pout || !pc1 || !pc2 ) return NULL; pout->r = (pc1->r) + (pc2->r); @@ -892,7 +892,7 @@ static inline D3DXCOLOR* D3DXColorAdd(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CON return pout; } -static inline D3DXCOLOR* D3DXColorLerp(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2, FLOAT s) +static inline D3DXCOLOR* D3DXColorLerp(D3DXCOLOR *pout, const D3DXCOLOR *pc1, const D3DXCOLOR *pc2, FLOAT s) { if ( !pout || !pc1 || !pc2 ) return NULL; pout->r = (1-s) * (pc1->r) + s *(pc2->r); @@ -902,7 +902,7 @@ static inline D3DXCOLOR* D3DXColorLerp(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CO return pout; } -static inline D3DXCOLOR* D3DXColorModulate(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2) +static inline D3DXCOLOR* D3DXColorModulate(D3DXCOLOR *pout, const D3DXCOLOR *pc1, const D3DXCOLOR *pc2) { if ( !pout || !pc1 || !pc2 ) return NULL; pout->r = (pc1->r) * (pc2->r); @@ -912,7 +912,7 @@ static inline D3DXCOLOR* D3DXColorModulate(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1 return pout; } -static inline D3DXCOLOR* D3DXColorNegative(D3DXCOLOR *pout, CONST D3DXCOLOR *pc) +static inline D3DXCOLOR* D3DXColorNegative(D3DXCOLOR *pout, const D3DXCOLOR *pc) { if ( !pout || !pc ) return NULL; pout->r = 1.0f - pc->r; @@ -922,7 +922,7 @@ static inline D3DXCOLOR* D3DXColorNegative(D3DXCOLOR *pout, CONST D3DXCOLOR *pc) return pout; } -static inline D3DXCOLOR* D3DXColorScale(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s) +static inline D3DXCOLOR* D3DXColorScale(D3DXCOLOR *pout, const D3DXCOLOR *pc, FLOAT s) { if ( !pout || !pc ) return NULL; pout->r = s* (pc->r); @@ -932,7 +932,7 @@ static inline D3DXCOLOR* D3DXColorScale(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FL return pout; } -static inline D3DXCOLOR* D3DXColorSubtract(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2) +static inline D3DXCOLOR* D3DXColorSubtract(D3DXCOLOR *pout, const D3DXCOLOR *pc1, const D3DXCOLOR *pc2) { if ( !pout || !pc1 || !pc2 ) return NULL; pout->r = (pc1->r) - (pc2->r); @@ -944,7 +944,7 @@ static inline D3DXCOLOR* D3DXColorSubtract(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1 /*_______________D3DXVECTOR2________________________*/ -static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x + pv2->x; @@ -952,31 +952,31 @@ static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1 return pout; } -static inline FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline FLOAT D3DXVec2CCW(const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2) { if ( !pv1 || !pv2) return 0.0f; return ( (pv1->x) * (pv2->y) - (pv1->y) * (pv2->x) ); } -static inline FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline FLOAT D3DXVec2Dot(const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2) { if ( !pv1 || !pv2) return 0.0f; return ( (pv1->x * pv2->x + pv1->y * pv2->y) ); } -static inline FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv) +static inline FLOAT D3DXVec2Length(const D3DXVECTOR2 *pv) { if (!pv) return 0.0f; return sqrtf( pv->x * pv->x + pv->y * pv->y ); } -static inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv) +static inline FLOAT D3DXVec2LengthSq(const D3DXVECTOR2 *pv) { if (!pv) return 0.0f; return( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); } -static inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s) +static inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2, FLOAT s) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = (1-s) * (pv1->x) + s * (pv2->x); @@ -984,7 +984,7 @@ static inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv return pout; } -static inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x > pv2->x ? pv1->x : pv2->x; @@ -992,7 +992,7 @@ static inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 return pout; } -static inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x < pv2->x ? pv1->x : pv2->x; @@ -1000,7 +1000,7 @@ static inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 return pout; } -static inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s) +static inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv, FLOAT s) { if ( !pout || !pv) return NULL; pout->x = s * (pv->x); @@ -1008,7 +1008,7 @@ static inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *p return pout; } -static inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x - pv2->x; @@ -1018,7 +1018,7 @@ static inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 /*__________________D3DXVECTOR3_______________________*/ -static inline D3DXVECTOR3* D3DXVec3Add(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) +static inline D3DXVECTOR3* D3DXVec3Add(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x + pv2->x; @@ -1027,7 +1027,7 @@ static inline D3DXVECTOR3* D3DXVec3Add(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1 return pout; } -static inline D3DXVECTOR3* D3DXVec3Cross(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) +static inline D3DXVECTOR3* D3DXVec3Cross(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2) { D3DXVECTOR3 temp; @@ -1039,25 +1039,25 @@ static inline D3DXVECTOR3* D3DXVec3Cross(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *p return pout; } -static inline FLOAT D3DXVec3Dot(CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) +static inline FLOAT D3DXVec3Dot(const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2) { if ( !pv1 || !pv2 ) return 0.0f; return (pv1->x) * (pv2->x) + (pv1->y) * (pv2->y) + (pv1->z) * (pv2->z); } -static inline FLOAT D3DXVec3Length(CONST D3DXVECTOR3 *pv) +static inline FLOAT D3DXVec3Length(const D3DXVECTOR3 *pv) { if (!pv) return 0.0f; return sqrtf( pv->x * pv->x + pv->y * pv->y + pv->z * pv->z ); } -static inline FLOAT D3DXVec3LengthSq(CONST D3DXVECTOR3 *pv) +static inline FLOAT D3DXVec3LengthSq(const D3DXVECTOR3 *pv) { if (!pv) return 0.0f; return (pv->x) * (pv->x) + (pv->y) * (pv->y) + (pv->z) * (pv->z); } -static inline D3DXVECTOR3* D3DXVec3Lerp(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, FLOAT s) +static inline D3DXVECTOR3* D3DXVec3Lerp(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2, FLOAT s) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = (1-s) * (pv1->x) + s * (pv2->x); @@ -1066,7 +1066,7 @@ static inline D3DXVECTOR3* D3DXVec3Lerp(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv return pout; } -static inline D3DXVECTOR3* D3DXVec3Maximize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) +static inline D3DXVECTOR3* D3DXVec3Maximize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x > pv2->x ? pv1->x : pv2->x; @@ -1075,7 +1075,7 @@ static inline D3DXVECTOR3* D3DXVec3Maximize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 return pout; } -static inline D3DXVECTOR3* D3DXVec3Minimize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) +static inline D3DXVECTOR3* D3DXVec3Minimize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x < pv2->x ? pv1->x : pv2->x; @@ -1084,7 +1084,7 @@ static inline D3DXVECTOR3* D3DXVec3Minimize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 return pout; } -static inline D3DXVECTOR3* D3DXVec3Scale(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv, FLOAT s) +static inline D3DXVECTOR3* D3DXVec3Scale(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, FLOAT s) { if ( !pout || !pv) return NULL; pout->x = s * (pv->x); @@ -1093,7 +1093,7 @@ static inline D3DXVECTOR3* D3DXVec3Scale(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *p return pout; } -static inline D3DXVECTOR3* D3DXVec3Subtract(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2) +static inline D3DXVECTOR3* D3DXVec3Subtract(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x - pv2->x; @@ -1103,7 +1103,7 @@ static inline D3DXVECTOR3* D3DXVec3Subtract(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 } /*__________________D3DXVECTOR4_______________________*/ -static inline D3DXVECTOR4* D3DXVec4Add(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) +static inline D3DXVECTOR4* D3DXVec4Add(D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv1, const D3DXVECTOR4 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x + pv2->x; @@ -1113,25 +1113,25 @@ static inline D3DXVECTOR4* D3DXVec4Add(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1 return pout; } -static inline FLOAT D3DXVec4Dot(CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) +static inline FLOAT D3DXVec4Dot(const D3DXVECTOR4 *pv1, const D3DXVECTOR4 *pv2) { if (!pv1 || !pv2 ) return 0.0f; return (pv1->x) * (pv2->x) + (pv1->y) * (pv2->y) + (pv1->z) * (pv2->z) + (pv1->w) * (pv2->w); } -static inline FLOAT D3DXVec4Length(CONST D3DXVECTOR4 *pv) +static inline FLOAT D3DXVec4Length(const D3DXVECTOR4 *pv) { if (!pv) return 0.0f; return sqrtf( pv->x * pv->x + pv->y * pv->y + pv->z * pv->z + pv->w * pv->w ); } -static inline FLOAT D3DXVec4LengthSq(CONST D3DXVECTOR4 *pv) +static inline FLOAT D3DXVec4LengthSq(const D3DXVECTOR4 *pv) { if (!pv) return 0.0f; return (pv->x) * (pv->x) + (pv->y) * (pv->y) + (pv->z) * (pv->z) + (pv->w) * (pv->w); } -static inline D3DXVECTOR4* D3DXVec4Lerp(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, FLOAT s) +static inline D3DXVECTOR4* D3DXVec4Lerp(D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv1, const D3DXVECTOR4 *pv2, FLOAT s) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = (1-s) * (pv1->x) + s * (pv2->x); @@ -1142,7 +1142,7 @@ static inline D3DXVECTOR4* D3DXVec4Lerp(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv } -static inline D3DXVECTOR4* D3DXVec4Maximize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) +static inline D3DXVECTOR4* D3DXVec4Maximize(D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv1, const D3DXVECTOR4 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x > pv2->x ? pv1->x : pv2->x; @@ -1152,7 +1152,7 @@ static inline D3DXVECTOR4* D3DXVec4Maximize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 return pout; } -static inline D3DXVECTOR4* D3DXVec4Minimize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) +static inline D3DXVECTOR4* D3DXVec4Minimize(D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv1, const D3DXVECTOR4 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x < pv2->x ? pv1->x : pv2->x; @@ -1162,7 +1162,7 @@ static inline D3DXVECTOR4* D3DXVec4Minimize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 return pout; } -static inline D3DXVECTOR4* D3DXVec4Scale(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv, FLOAT s) +static inline D3DXVECTOR4* D3DXVec4Scale(D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv, FLOAT s) { if ( !pout || !pv) return NULL; pout->x = s * (pv->x); @@ -1172,7 +1172,7 @@ static inline D3DXVECTOR4* D3DXVec4Scale(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *p return pout; } -static inline D3DXVECTOR4* D3DXVec4Subtract(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2) +static inline D3DXVECTOR4* D3DXVec4Subtract(D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv1, const D3DXVECTOR4 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x - pv2->x; @@ -1231,19 +1231,19 @@ static inline BOOL D3DXMatrixIsIdentity(D3DXMATRIX *pm) /*__________________D3DXPLANE____________________*/ -static inline FLOAT D3DXPlaneDot(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv) +static inline FLOAT D3DXPlaneDot(const D3DXPLANE *pp, const D3DXVECTOR4 *pv) { if ( !pp || !pv ) return 0.0f; return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) + (pp->d) * (pv->w) ); } -static inline FLOAT D3DXPlaneDotCoord(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv) +static inline FLOAT D3DXPlaneDotCoord(const D3DXPLANE *pp, const D3DXVECTOR4 *pv) { if ( !pp || !pv ) return 0.0f; return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) + (pp->d) ); } -static inline FLOAT D3DXPlaneDotNormal(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv) +static inline FLOAT D3DXPlaneDotNormal(const D3DXPLANE *pp, const D3DXVECTOR4 *pv) { if ( !pp || !pv ) return 0.0f; return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) ); @@ -1251,7 +1251,7 @@ static inline FLOAT D3DXPlaneDotNormal(CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *p /*__________________D3DXQUATERNION____________________*/ -static inline D3DXQUATERNION* D3DXQuaternionConjugate(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) +static inline D3DXQUATERNION* D3DXQuaternionConjugate(D3DXQUATERNION *pout, const D3DXQUATERNION *pq) { if ( !pout || !pq) return NULL; pout->x = -pq->x; @@ -1261,7 +1261,7 @@ static inline D3DXQUATERNION* D3DXQuaternionConjugate(D3DXQUATERNION *pout, CONS return pout; } -static inline FLOAT D3DXQuaternionDot(CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2) +static inline FLOAT D3DXQuaternionDot(const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2) { if ( !pq1 || !pq2 ) return 0.0f; return (pq1->x) * (pq2->x) + (pq1->y) * (pq2->y) + (pq1->z) * (pq2->z) + (pq1->w) * (pq2->w); @@ -1283,13 +1283,13 @@ static inline BOOL D3DXQuaternionIsIdentity(D3DXQUATERNION *pq) return ( (pq->x == 0.0f) && (pq->y == 0.0f) && (pq->z == 0.0f) && (pq->w == 1.0f) ); } -static inline FLOAT D3DXQuaternionLength(CONST D3DXQUATERNION *pq) +static inline FLOAT D3DXQuaternionLength(const D3DXQUATERNION *pq) { if (!pq) return 0.0f; return sqrtf( pq->x * pq->x + pq->y * pq->y + pq->z * pq->z + pq->w * pq->w ); } -static inline FLOAT D3DXQuaternionLengthSq(CONST D3DXQUATERNION *pq) +static inline FLOAT D3DXQuaternionLengthSq(const D3DXQUATERNION *pq) { if (!pq) return 0.0f; return (pq->x) * (pq->x) + (pq->y) * (pq->y) + (pq->z) * (pq->z) + (pq->w) * (pq->w); diff --git a/reactos/include/dxsdk/d3dx9mesh.h b/reactos/include/dxsdk/d3dx9mesh.h index 1347a79e009..1dcc2443d7b 100644 --- a/reactos/include/dxsdk/d3dx9mesh.h +++ b/reactos/include/dxsdk/d3dx9mesh.h @@ -193,20 +193,20 @@ typedef D3DXATTRIBUTERANGE* LPD3DXATTRIBUTERANGE; typedef struct _D3DXMATERIAL { D3DMATERIAL9 MatD3D; - LPSTR pTextureFilename; + char *pTextureFilename; } D3DXMATERIAL, *LPD3DXMATERIAL; typedef struct _D3DXEFFECTDEFAULT { - LPSTR pParamName; + char *pParamName; D3DXEFFECTDEFAULTTYPE Type; DWORD NumBytes; - LPVOID pValue; + void *pValue; } D3DXEFFECTDEFAULT, *LPD3DXEFFECTDEFAULT; typedef struct _D3DXEFFECTINSTANCE { - LPSTR pEffectFilename; + char *pEffectFilename; DWORD NumDefaults; LPD3DXEFFECTDEFAULT pDefaults; } D3DXEFFECTINSTANCE, *LPD3DXEFFECTINSTANCE; @@ -297,9 +297,9 @@ typedef struct _XFILECOMPRESSEDANIMATIONSET DWORD BufferLength; } XFILECOMPRESSEDANIMATIONSET; -typedef HRESULT (WINAPI *LPD3DXUVATLASCB)(FLOAT, LPVOID); -typedef HRESULT (WINAPI *LPD3DXIMTSIGNALCALLBACK)(CONST D3DXVECTOR2 *, UINT, UINT, VOID *, FLOAT *); -typedef HRESULT (WINAPI *LPD3DXSHPRTSIMCB)(float, LPVOID); +typedef HRESULT (WINAPI *LPD3DXUVATLASCB)(float complete, void *ctx); +typedef HRESULT (WINAPI *LPD3DXIMTSIGNALCALLBACK)(const D3DXVECTOR2 *, UINT, UINT, void *, FLOAT *); +typedef HRESULT (WINAPI *LPD3DXSHPRTSIMCB)(float complete, void *ctx); #undef INTERFACE #define INTERFACE ID3DXBaseMesh @@ -307,7 +307,7 @@ typedef HRESULT (WINAPI *LPD3DXSHPRTSIMCB)(float, LPVOID); DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXBaseMesh ***/ @@ -325,13 +325,13 @@ DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown) struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh) PURE; STDMETHOD(GetVertexBuffer)(THIS_ struct IDirect3DVertexBuffer9 **vertex_buffer) PURE; STDMETHOD(GetIndexBuffer)(THIS_ struct IDirect3DIndexBuffer9 **index_buffer) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, void **data) PURE; STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, void **data) PURE; STDMETHOD(UnlockIndexBuffer)(THIS) PURE; STDMETHOD(GetAttributeTable)(THIS_ D3DXATTRIBUTERANGE* attrib_table, DWORD* attrib_table_size) PURE; - STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* point_reps, DWORD* adjacency) PURE; - STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* adjacency, DWORD* point_reps) PURE; + STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ const DWORD *point_reps, DWORD *adjacency) PURE; + STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ const DWORD *adjacency, DWORD *point_reps) PURE; STDMETHOD(GenerateAdjacency)(THIS_ FLOAT epsilon, DWORD* adjacency) PURE; STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE; }; @@ -341,7 +341,7 @@ DECLARE_INTERFACE_(ID3DXBaseMesh, IUnknown) DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXBaseMesh ***/ @@ -359,13 +359,13 @@ DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh) struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh) PURE; STDMETHOD(GetVertexBuffer)(THIS_ struct IDirect3DVertexBuffer9 **vertex_buffer) PURE; STDMETHOD(GetIndexBuffer)(THIS_ struct IDirect3DIndexBuffer9 **index_buffer) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, void **data) PURE; STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, void **data) PURE; STDMETHOD(UnlockIndexBuffer)(THIS) PURE; STDMETHOD(GetAttributeTable)(THIS_ D3DXATTRIBUTERANGE* attrib_table, DWORD* attrib_table_size) PURE; - STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* point_reps, DWORD* adjacency) PURE; - STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* adjacency, DWORD* point_reps) PURE; + STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ const DWORD *point_reps, DWORD *adjacency) PURE; + STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ const DWORD *adjacency, DWORD *point_reps) PURE; STDMETHOD(GenerateAdjacency)(THIS_ FLOAT epsilon, DWORD* adjacency) PURE; STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE; /*** ID3DXMesh ***/ @@ -375,7 +375,8 @@ DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh) DWORD *face_remap, ID3DXBuffer **vertex_remap, ID3DXMesh **opt_mesh) PURE; STDMETHOD(OptimizeInplace)(THIS_ DWORD flags, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap) PURE; - STDMETHOD(SetAttributeTable)(THIS_ CONST D3DXATTRIBUTERANGE* attrib_table, DWORD attrib_table_size) PURE; + STDMETHOD(SetAttributeTable)(THIS_ const D3DXATTRIBUTERANGE *attrib_table, + DWORD attrib_table_size) PURE; }; #undef INTERFACE @@ -383,7 +384,7 @@ DECLARE_INTERFACE_(ID3DXMesh, ID3DXBaseMesh) DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXBaseMesh ***/ @@ -401,13 +402,13 @@ DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh) struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh) PURE; STDMETHOD(GetVertexBuffer)(THIS_ struct IDirect3DVertexBuffer9 **vertex_buffer) PURE; STDMETHOD(GetIndexBuffer)(THIS_ struct IDirect3DIndexBuffer9 **index_buffer) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, void **data) PURE; STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, void **data) PURE; STDMETHOD(UnlockIndexBuffer)(THIS) PURE; STDMETHOD(GetAttributeTable)(THIS_ D3DXATTRIBUTERANGE* attrib_table, DWORD* attrib_table_size) PURE; - STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ CONST DWORD* point_reps, DWORD* adjacency) PURE; - STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ CONST DWORD* adjacency, DWORD* point_reps) PURE; + STDMETHOD(ConvertPointRepsToAdjacency)(THIS_ const DWORD *point_reps, DWORD *adjacency) PURE; + STDMETHOD(ConvertAdjacencyToPointReps)(THIS_ const DWORD *adjacency, DWORD *point_reps) PURE; STDMETHOD(GenerateAdjacency)(THIS_ FLOAT epsilon, DWORD* adjacency) PURE; STDMETHOD(UpdateSemantics)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE; /*** ID3DXPMesh ***/ @@ -421,7 +422,8 @@ DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh) STDMETHOD_(DWORD, GetMinFaces)(THIS) PURE; STDMETHOD_(DWORD, GetMaxVertices)(THIS) PURE; STDMETHOD_(DWORD, GetMinVertices)(THIS) PURE; - STDMETHOD(Save)(THIS_ IStream *stream, CONST D3DXMATERIAL* material, CONST D3DXEFFECTINSTANCE* effect_instance, DWORD num_materials) PURE; + STDMETHOD(Save)(THIS_ IStream *stream, const D3DXMATERIAL *material, + const D3DXEFFECTINSTANCE *effect_instance, DWORD num_materials) PURE; STDMETHOD(Optimize)(THIS_ DWORD flags, DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap, ID3DXMesh **opt_mesh) PURE; STDMETHOD(OptimizeBaseLOD)(THIS_ DWORD flags, DWORD* face_remap) PURE; @@ -436,7 +438,7 @@ DECLARE_INTERFACE_(ID3DXPMesh, ID3DXBaseMesh) DECLARE_INTERFACE_(ID3DXSPMesh, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXSPMesh ***/ @@ -471,7 +473,7 @@ DECLARE_INTERFACE_(ID3DXSPMesh, IUnknown) DECLARE_INTERFACE_(ID3DXPatchMesh, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXPatchMesh ***/ @@ -484,9 +486,9 @@ DECLARE_INTERFACE_(ID3DXPatchMesh, IUnknown) STDMETHOD(GetPatchInfo)(THIS_ LPD3DXPATCHINFO patch_info) PURE; STDMETHOD(GetVertexBuffer)(THIS_ struct IDirect3DVertexBuffer9 **vertex_buffer) PURE; STDMETHOD(GetIndexBuffer)(THIS_ struct IDirect3DIndexBuffer9 **index_buffer) PURE; - STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE; + STDMETHOD(LockVertexBuffer)(THIS_ DWORD flags, void **data) PURE; STDMETHOD(UnlockVertexBuffer)(THIS) PURE; - STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, LPVOID* data) PURE; + STDMETHOD(LockIndexBuffer)(THIS_ DWORD flags, void **data) PURE; STDMETHOD(UnlockIndexBuffer)(THIS) PURE; STDMETHOD(LockAttributeBuffer)(THIS_ DWORD flags, DWORD** data) PURE; STDMETHOD(UnlockAttributeBuffer)(THIS) PURE; @@ -510,11 +512,12 @@ DECLARE_INTERFACE_(ID3DXPatchMesh, IUnknown) DECLARE_INTERFACE_(ID3DXSkinInfo, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXSkinInfo ***/ - STDMETHOD(SetBoneInfluence)(THIS_ DWORD bone, DWORD num_influences, CONST DWORD* vertices, CONST FLOAT* weights) PURE; + STDMETHOD(SetBoneInfluence)(THIS_ DWORD bone, DWORD num_influences, const DWORD *vertices, + const FLOAT *weights) PURE; STDMETHOD(SetBoneVertexInfluence)(THIS_ DWORD bone_num, DWORD influence_num, float weight) PURE; STDMETHOD_(DWORD, GetNumBoneInfluences)(THIS_ DWORD bone) PURE; STDMETHOD(GetBoneInfluence)(THIS_ DWORD bone, DWORD* vertices, FLOAT* weights) PURE; @@ -526,18 +529,18 @@ DECLARE_INTERFACE_(ID3DXSkinInfo, IUnknown) DWORD num_faces, DWORD *max_face_influences) PURE; STDMETHOD(SetMinBoneInfluence)(THIS_ FLOAT min_influence) PURE; STDMETHOD_(FLOAT, GetMinBoneInfluence)(THIS) PURE; - STDMETHOD(SetBoneName)(THIS_ DWORD bone, LPCSTR name) PURE; - STDMETHOD_(LPCSTR, GetBoneName)(THIS_ DWORD bone) PURE; - STDMETHOD(SetBoneOffsetMatrix)(THIS_ DWORD bone, CONST D3DXMATRIX* bone_transform) PURE; + STDMETHOD(SetBoneName)(THIS_ DWORD bone_idx, const char *name) PURE; + STDMETHOD_(const char *, GetBoneName)(THIS_ DWORD bone_idx) PURE; + STDMETHOD(SetBoneOffsetMatrix)(THIS_ DWORD bone, const D3DXMATRIX *bone_transform) PURE; STDMETHOD_(D3DXMATRIX *, GetBoneOffsetMatrix)(THIS_ DWORD bone) PURE; STDMETHOD(Clone)(THIS_ ID3DXSkinInfo **skin_info) PURE; STDMETHOD(Remap)(THIS_ DWORD num_vertices, DWORD* vertex_remap) PURE; STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE; - STDMETHOD(SetDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* declaration) PURE; + STDMETHOD(SetDeclaration)(THIS_ const D3DVERTEXELEMENT9 *declaration) PURE; STDMETHOD_(DWORD, GetFVF)(THIS) PURE; STDMETHOD(GetDeclaration)(THIS_ D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) PURE; - STDMETHOD(UpdateSkinnedMesh)(THIS_ CONST D3DXMATRIX* bone_transforms, - CONST D3DXMATRIX* bone_inv_transpose_transforms, LPCVOID vertices_src, PVOID vertices_dest) PURE; + STDMETHOD(UpdateSkinnedMesh)(THIS_ const D3DXMATRIX *bone_transforms, + const D3DXMATRIX *bone_inv_transpose_transforms, const void *src_vertices, void *dst_vertices) PURE; STDMETHOD(ConvertToBlendedMesh)(THIS_ ID3DXMesh *mesh_in, DWORD options, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap, DWORD *max_face_infl, DWORD *num_bone_combinations, ID3DXBuffer **bone_combination_table, ID3DXMesh **mesh_out) PURE; @@ -551,7 +554,7 @@ DECLARE_INTERFACE_(ID3DXSkinInfo, IUnknown) DECLARE_INTERFACE_(ID3DXPRTBuffer, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXPRTBuffer methods ***/ @@ -580,7 +583,7 @@ DECLARE_INTERFACE_(ID3DXPRTBuffer, IUnknown) DECLARE_INTERFACE_(ID3DXPRTCompBuffer, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXPRTCompBuffer methods ***/ @@ -605,7 +608,7 @@ DECLARE_INTERFACE_(ID3DXPRTCompBuffer, IUnknown) DECLARE_INTERFACE_(ID3DXTextureGutterHelper, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXTextureGutterHelper methods ***/ @@ -632,13 +635,13 @@ DECLARE_INTERFACE_(ID3DXTextureGutterHelper, IUnknown) DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* object) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXPRTEngine methods ***/ - STDMETHOD(SetMeshMaterials)(THIS_ CONST D3DXSHMATERIAL **materials, UINT num_meshes, + STDMETHOD(SetMeshMaterials)(THIS_ const D3DXSHMATERIAL **materials, UINT num_meshes, UINT num_channels, BOOL set_albedo, FLOAT length_scale) PURE; - STDMETHOD(SetPerVertexAlbedo)(THIS_ CONST VOID *data_in, UINT num_channels, UINT stride) PURE; + STDMETHOD(SetPerVertexAlbedo)(THIS_ const void *data_in, UINT num_channels, UINT stride) PURE; STDMETHOD(SetPerTexelAlbedo)(THIS_ struct IDirect3DTexture9 *albedo_texture, UINT num_channels, struct ID3DXTextureGutterHelper *gh) PURE; STDMETHOD(GetVertexAlbedo)(THIS_ D3DXCOLOR *vert_colors, UINT num_verts) PURE; @@ -681,10 +684,11 @@ DECLARE_INTERFACE_(ID3DXPRTEngine, IUnknown) ID3DXPRTBuffer *data_out) PURE; STDMETHOD(ScaleMeshChunk)(THIS_ UINT mesh_chunk, float scale, ID3DXPRTBuffer *data_out) PURE; STDMETHOD(MultiplyAlbedo)(THIS_ ID3DXPRTBuffer *data_out) PURE; - STDMETHOD(SetCallback)(THIS_ LPD3DXSHPRTSIMCB cb, FLOAT frequency, LPVOID user_context) PURE; - STDMETHOD_(BOOL, ShadowRayIntersects)(THIS_ CONST D3DXVECTOR3 *ray_pos, CONST D3DXVECTOR3 *ray_dir) PURE; - STDMETHOD_(BOOL, ClosestRayIntersects)(THIS_ CONST D3DXVECTOR3 *ray_pos, CONST D3DXVECTOR3 *ray_dir, - DWORD *face_index, FLOAT *u, FLOAT *v, FLOAT *dist) PURE; + STDMETHOD(SetCallback)(THIS_ LPD3DXSHPRTSIMCB cb, float frequency, void *user_context) PURE; + STDMETHOD_(BOOL, ShadowRayIntersects)(THIS_ const D3DXVECTOR3 *ray_pos, + const D3DXVECTOR3 *ray_dir) PURE; + STDMETHOD_(BOOL, ClosestRayIntersects)(THIS_ const D3DXVECTOR3 *ray_pos, + const D3DXVECTOR3 *ray_dir, DWORD *face_index, FLOAT *u, FLOAT *v, FLOAT *dist) PURE; }; #undef INTERFACE @@ -762,15 +766,19 @@ HRESULT WINAPI D3DXSavePRTCompBufferToFileW(const WCHAR *filename, ID3DXPRTCompB UINT WINAPI D3DXGetDeclLength(const D3DVERTEXELEMENT9 *decl); UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_idx); UINT WINAPI D3DXGetFVFVertexSize(DWORD); -BOOL WINAPI D3DXBoxBoundProbe(CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *); -BOOL WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *,FLOAT,CONST D3DXVECTOR3 *,CONST D3DXVECTOR3 *); +BOOL WINAPI D3DXBoxBoundProbe(const D3DXVECTOR3 *vmin, const D3DXVECTOR3 *vmax, + const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir); +BOOL WINAPI D3DXSphereBoundProbe(const D3DXVECTOR3 *center, FLOAT radius, + const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir); HRESULT WINAPI D3DXCleanMesh(D3DXCLEANTYPE clean_type, ID3DXMesh *mesh_in, const DWORD *adjacency_in, ID3DXMesh **mesh_out, DWORD *adjacency_out, ID3DXBuffer **errors); HRESULT WINAPI D3DXConcatenateMeshes(struct ID3DXMesh **meshes, UINT mesh_count, DWORD flags, const D3DXMATRIX *geometry_matrices, const D3DXMATRIX *texture_matrices, const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh); -HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *, DWORD, DWORD, D3DXVECTOR3 *, D3DXVECTOR3 *); -HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3 *, DWORD, DWORD, D3DXVECTOR3 *, FLOAT *); +HRESULT WINAPI D3DXComputeBoundingBox(const D3DXVECTOR3 *first_pos, DWORD num_vertices, + DWORD stride, D3DXVECTOR3 *vmin, D3DXVECTOR3 *vmax); +HRESULT WINAPI D3DXComputeBoundingSphere(const D3DXVECTOR3 *first_pos, DWORD num_vertices, + DWORD stride, D3DXVECTOR3 *center, FLOAT *radius); HRESULT WINAPI D3DXComputeIMTFromPerTexelSignal(ID3DXMesh *mesh, DWORD texture_idx, float *texel_signal, UINT width, UINT height, UINT signal_dimension, UINT component_count, DWORD flags, LPD3DXUVATLASCB cb, void *ctx, ID3DXBuffer **buffer); @@ -797,7 +805,7 @@ HRESULT WINAPI D3DXConvertMeshSubsetToStrips(struct ID3DXBaseMesh *mesh_in, DWOR struct ID3DXBuffer **strip_lengths, DWORD *strip_count); HRESULT WINAPI D3DXDeclaratorFromFVF(DWORD, D3DVERTEXELEMENT9[MAX_FVF_DECL_SIZE]); HRESULT WINAPI D3DXFVFFromDeclarator(const D3DVERTEXELEMENT9 *decl, DWORD *fvf); -HRESULT WINAPI D3DXGenerateOutputDecl(D3DVERTEXELEMENT9 *, CONST D3DVERTEXELEMENT9 *); +HRESULT WINAPI D3DXGenerateOutputDecl(D3DVERTEXELEMENT9 *decl_out, const D3DVERTEXELEMENT9 *decl_in); HRESULT WINAPI D3DXGeneratePMesh(ID3DXMesh *mesh, const DWORD *adjacency, const D3DXATTRIBUTEWEIGHTS *attribute_weights, const float *vertex_weights, DWORD min_value, DWORD flags, ID3DXPMesh **pmesh); @@ -806,10 +814,15 @@ HRESULT WINAPI D3DXIntersect(ID3DXBaseMesh *mesh, const D3DXVECTOR3 *ray_positio HRESULT WINAPI D3DXIntersectSubset(ID3DXBaseMesh *mesh, DWORD attribute_id, const D3DXVECTOR3 *ray_position, const D3DXVECTOR3 *ray_direction, BOOL *hit, DWORD *face_idx, float *u, float *v, float *distance, ID3DXBuffer **hits, DWORD *hit_count); -BOOL WINAPI D3DXIntersectTri(CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3 *, CONST D3DXVECTOR3*, FLOAT *, FLOAT *, FLOAT *); -HRESULT WINAPI D3DXOptimizeFaces(LPCVOID, UINT, UINT, BOOL, DWORD *); -HRESULT WINAPI D3DXOptimizeVertices(LPCVOID, UINT, UINT, BOOL, DWORD *); -HRESULT WINAPI D3DXRectPatchSize(CONST FLOAT *, DWORD *, DWORD *); +BOOL WINAPI D3DXIntersectTri(const D3DXVECTOR3 *vtx0, const D3DXVECTOR3 *vtx1, + const D3DXVECTOR3 *vtx2, const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir, FLOAT *u, + FLOAT *v, FLOAT *dist); +HRESULT WINAPI D3DXOptimizeFaces(const void *indices, UINT face_count, + UINT vertex_count, BOOL idx_32bit, DWORD *face_remap); +HRESULT WINAPI D3DXOptimizeVertices(const void *indices, UINT face_count, + UINT vertex_count, BOOL idx_32bit, DWORD *vertex_remap); +HRESULT WINAPI D3DXRectPatchSize(const FLOAT *segment_count, DWORD *num_triangles, + DWORD *num_vertices); HRESULT WINAPI D3DXSHPRTCompSuperCluster(UINT *cluster_ids, ID3DXMesh *scene, UINT max_cluster_count, UINT cluster_count, UINT *scluster_ids, UINT *scluster_count); HRESULT WINAPI D3DXSHPRTCompSplitMeshSC(UINT *cluster_idx, UINT vertex_count, UINT cluster_count, UINT *scluster_ids, @@ -828,7 +841,8 @@ HRESULT WINAPI D3DXTesselateRectPatch(struct IDirect3DVertexBuffer9 *buffer, con const D3DVERTEXELEMENT9 *declaration, const D3DRECTPATCH_INFO *patch_info, struct ID3DXMesh *mesh); HRESULT WINAPI D3DXTesselateTriPatch(struct IDirect3DVertexBuffer9 *buffer, const float *segment_count, const D3DVERTEXELEMENT9 *declaration, const D3DTRIPATCH_INFO *patch_info, struct ID3DXMesh *mesh); -HRESULT WINAPI D3DXTriPatchSize(CONST FLOAT *, DWORD *, DWORD *); +HRESULT WINAPI D3DXTriPatchSize(const FLOAT *segment_count, DWORD *num_triangles, + DWORD *num_vertices); HRESULT WINAPI D3DXUVAtlasCreate(ID3DXMesh *mesh_in, UINT max_chart_count, float max_stretch_in, UINT width, UINT height, float gutter, DWORD texture_idx, const DWORD *adjacency, const DWORD *false_edges, const float *imt_array, LPD3DXUVATLASCB cb, float cb_freq, void *ctx, DWORD flags, ID3DXMesh **mesh_out, diff --git a/reactos/include/dxsdk/d3dx9shader.h b/reactos/include/dxsdk/d3dx9shader.h index 0b30519962c..d665f72e0e5 100644 --- a/reactos/include/dxsdk/d3dx9shader.h +++ b/reactos/include/dxsdk/d3dx9shader.h @@ -1,5 +1,6 @@ /* * Copyright 2008 Luis Busquets + * Copyright 2014 Kai Tietz * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -42,7 +43,10 @@ #define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL 0x10000 -typedef LPCSTR D3DXHANDLE; +#define D3DXCONSTTABLE_LARGEADDRESSAWARE 0x20000 + +typedef const char *D3DXHANDLE; +typedef D3DXHANDLE *LPD3DXHANDLE; typedef enum _D3DXREGISTER_SET { @@ -91,14 +95,14 @@ typedef enum D3DXPARAMETER_TYPE typedef struct _D3DXCONSTANTTABLE_DESC { - LPCSTR Creator; + const char *Creator; DWORD Version; UINT Constants; } D3DXCONSTANTTABLE_DESC, *LPD3DXCONSTANTTABLE_DESC; typedef struct _D3DXCONSTANT_DESC { - LPCSTR Name; + const char *Name; D3DXREGISTER_SET RegisterSet; UINT RegisterIndex; UINT RegisterCount; @@ -109,10 +113,14 @@ typedef struct _D3DXCONSTANT_DESC UINT Elements; UINT StructMembers; UINT Bytes; - LPCVOID DefaultValue; + const void *DefaultValue; } D3DXCONSTANT_DESC, *LPD3DXCONSTANT_DESC; +#if D3DX_SDK_VERSION < 43 DEFINE_GUID(IID_ID3DXConstantTable, 0x9dca3190, 0x38b9, 0x4fc3, 0x92, 0xe3, 0x39, 0xc6, 0xdd, 0xfb, 0x35, 0x8b); +#else +DEFINE_GUID(IID_ID3DXConstantTable, 0xab3c758f, 0x093e, 0x4356, 0xb7, 0x62, 0x4d, 0xb1, 0x8f, 0x1b, 0x3a, 0x01); +#endif #undef INTERFACE #define INTERFACE ID3DXConstantTable @@ -120,18 +128,18 @@ DEFINE_GUID(IID_ID3DXConstantTable, 0x9dca3190, 0x38b9, 0x4fc3, 0x92, 0xe3, 0x39 DECLARE_INTERFACE_(ID3DXConstantTable, ID3DXBuffer) { /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID iid, LPVOID *ppv) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE; STDMETHOD_(ULONG, AddRef)(THIS) PURE; STDMETHOD_(ULONG, Release)(THIS) PURE; /*** ID3DXBuffer methods ***/ - STDMETHOD_(LPVOID, GetBufferPointer)(THIS) PURE; + STDMETHOD_(void *, GetBufferPointer)(THIS) PURE; STDMETHOD_(DWORD, GetBufferSize)(THIS) PURE; /*** ID3DXConstantTable methods ***/ STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE; STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE; STDMETHOD_(UINT, GetSamplerIndex)(THIS_ D3DXHANDLE hConstant) PURE; STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; - STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, LPCSTR pName) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE constant, const char *name) PURE; STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; STDMETHOD(SetDefaults)(THIS_ struct IDirect3DDevice9 *device) PURE; STDMETHOD(SetValue)(THIS_ struct IDirect3DDevice9 *device, D3DXHANDLE constant, @@ -228,9 +236,46 @@ DECLARE_INTERFACE_(ID3DXConstantTable, ID3DXBuffer) typedef struct ID3DXConstantTable *LPD3DXCONSTANTTABLE; -typedef struct _D3DXMACRO { - LPCSTR Name; - LPCSTR Definition; +typedef interface ID3DXTextureShader *LPD3DXTEXTURESHADER; + +DEFINE_GUID(IID_ID3DXTextureShader, 0x3e3d67f8, 0xaa7a, 0x405d, 0xa8, 0x57, 0xba, 0x1, 0xd4, 0x75, 0x84, 0x26); + +#define INTERFACE ID3DXTextureShader +DECLARE_INTERFACE_(ID3DXTextureShader, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + STDMETHOD(GetFunction)(THIS_ struct ID3DXBuffer **ppFunction) PURE; + STDMETHOD(GetConstantBuffer)(THIS_ struct ID3DXBuffer **ppConstantBuffer) PURE; + STDMETHOD(GetDesc)(THIS_ D3DXCONSTANTTABLE_DESC *pDesc) PURE; + STDMETHOD(GetConstantDesc)(THIS_ D3DXHANDLE hConstant, D3DXCONSTANT_DESC *pConstantDesc, UINT *pCount) PURE; + STDMETHOD_(D3DXHANDLE, GetConstant)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantByName)(THIS_ D3DXHANDLE hConstant, const char *pName) PURE; + STDMETHOD_(D3DXHANDLE, GetConstantElement)(THIS_ D3DXHANDLE hConstant, UINT Index) PURE; + STDMETHOD(SetDefaults)(THIS) PURE; + STDMETHOD(SetValue)(THIS_ D3DXHANDLE hConstant, const void *pData, UINT Bytes) PURE; + STDMETHOD(SetBool)(THIS_ D3DXHANDLE hConstant, BOOL b) PURE; + STDMETHOD(SetBoolArray)(THIS_ D3DXHANDLE hConstant, const BOOL *pb, UINT Count) PURE; + STDMETHOD(SetInt)(THIS_ D3DXHANDLE hConstant, INT n) PURE; + STDMETHOD(SetIntArray)(THIS_ D3DXHANDLE hConstant, const INT *pn, UINT Count) PURE; + STDMETHOD(SetFloat)(THIS_ D3DXHANDLE hConstant, FLOAT f) PURE; + STDMETHOD(SetFloatArray)(THIS_ D3DXHANDLE hConstant, const FLOAT *pf, UINT Count) PURE; + STDMETHOD(SetVector)(THIS_ D3DXHANDLE hConstant, const D3DXVECTOR4 *pVector) PURE; + STDMETHOD(SetVectorArray)(THIS_ D3DXHANDLE hConstant, const D3DXVECTOR4 *pVector, UINT Count) PURE; + STDMETHOD(SetMatrix)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX *pMatrix) PURE; + STDMETHOD(SetMatrixArray)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX *pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixPointerArray)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX **ppMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTranspose)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX *pMatrix) PURE; + STDMETHOD(SetMatrixTransposeArray)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX *pMatrix, UINT Count) PURE; + STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hConstant, const D3DXMATRIX **ppMatrix, UINT Count) PURE; +}; +#undef INTERFACE + +typedef struct _D3DXMACRO +{ + const char *Name; + const char *Definition; } D3DXMACRO, *LPD3DXMACRO; typedef struct _D3DXSEMANTIC { @@ -249,8 +294,9 @@ typedef enum _D3DXINCLUDE_TYPE DECLARE_INTERFACE(ID3DXInclude) { - STDMETHOD(Open)(THIS_ D3DXINCLUDE_TYPE include_type, LPCSTR filename, LPCVOID parent_data, LPCVOID *data, UINT *bytes) PURE; - STDMETHOD(Close)(THIS_ LPCVOID data) PURE; + STDMETHOD(Open)(THIS_ D3DXINCLUDE_TYPE include_type, const char *filename, + const void *parent_data, const void **data, UINT *bytes) PURE; + STDMETHOD(Close)(THIS_ const void *data) PURE; }; #undef INTERFACE @@ -267,8 +313,8 @@ const char * WINAPI D3DXGetPixelShaderProfile(struct IDirect3DDevice9 *device); UINT WINAPI D3DXGetShaderSize(const DWORD *byte_code); DWORD WINAPI D3DXGetShaderVersion(const DWORD *byte_code); const char * WINAPI D3DXGetVertexShaderProfile(struct IDirect3DDevice9 *device); -HRESULT WINAPI D3DXFindShaderComment(CONST DWORD* byte_code, DWORD fourcc, LPCVOID* data, UINT* size); -HRESULT WINAPI D3DXGetShaderSamplers(CONST DWORD *byte_code, LPCSTR *samplers, UINT *count); +HRESULT WINAPI D3DXFindShaderComment(const DWORD *byte_code, DWORD fourcc, const void **data, UINT *size); +HRESULT WINAPI D3DXGetShaderSamplers(const DWORD *byte_code, const char **samplers, UINT *count); HRESULT WINAPI D3DXAssembleShaderFromFileA(const char *filename, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages); @@ -289,6 +335,8 @@ HRESULT WINAPI D3DXCompileShader(const char *src_data, UINT data_len, const D3DX ID3DXInclude *include, const char *function_name, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table); +HRESULT WINAPI D3DXDisassembleShader(const DWORD *pShader, BOOL EnableColorCode, const char *pComments, struct ID3DXBuffer **ppDisassembly); + HRESULT WINAPI D3DXCompileShaderFromFileA(const char *filename, const D3DXMACRO *defines, ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table); @@ -324,6 +372,11 @@ HRESULT WINAPI D3DXGetShaderConstantTableEx(const DWORD *byte_code, DWORD flags, HRESULT WINAPI D3DXGetShaderConstantTable(const DWORD *byte_code, ID3DXConstantTable **constant_table); +HRESULT WINAPI D3DXGetShaderInputSemantics(const DWORD *pFunction, D3DXSEMANTIC *pSemantics, UINT *pCount); +HRESULT WINAPI D3DXGetShaderOutputSemantics(const DWORD *pFunction, D3DXSEMANTIC *pSemantics, UINT *pCount); + +HRESULT WINAPI D3DXCreateTextureShader(const DWORD *pFunction, ID3DXTextureShader **ppTextureShader); + #ifdef __cplusplus } #endif diff --git a/reactos/include/dxsdk/d3dx9tex.h b/reactos/include/dxsdk/d3dx9tex.h index 295a3243d77..542460f7362 100644 --- a/reactos/include/dxsdk/d3dx9tex.h +++ b/reactos/include/dxsdk/d3dx9tex.h @@ -39,6 +39,11 @@ #define D3DX_FILTER_SRGB_OUT 0x00400000 #define D3DX_FILTER_SRGB 0x00600000 +#define D3DX_SKIP_DDS_MIP_LEVELS_MASK 0x1f +#define D3DX_SKIP_DDS_MIP_LEVELS_SHIFT 26 +#define D3DX_SKIP_DDS_MIP_LEVELS(l, f) ((((l) & D3DX_SKIP_DDS_MIP_LEVELS_MASK) \ + << D3DX_SKIP_DDS_MIP_LEVELS_SHIFT) | ((f) == D3DX_DEFAULT ? D3DX_FILTER_BOX : (f))) + #define D3DX_NORMALMAP_MIRROR_U 0x00010000 #define D3DX_NORMALMAP_MIRROR_V 0x00020000 #define D3DX_NORMALMAP_MIRROR 0x00030000 @@ -83,8 +88,10 @@ typedef struct _D3DXIMAGE_INFO ****************** Functions ***************** **********************************************/ /* Typedefs for callback functions */ -typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *out, CONST D3DXVECTOR2 *texcoord, CONST D3DXVECTOR2 *texelsize, LPVOID data); -typedef VOID (WINAPI *LPD3DXFILL3D)(D3DXVECTOR4 *out, CONST D3DXVECTOR3 *texcoord, CONST D3DXVECTOR3 *texelsize, LPVOID data); +typedef void (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *out, const D3DXVECTOR2 *texcoord, + const D3DXVECTOR2 *texelsize, void *data); +typedef void (WINAPI *LPD3DXFILL3D)(D3DXVECTOR4 *out, const D3DXVECTOR3 *texcoord, + const D3DXVECTOR3 *texelsize, void *data); #ifdef __cplusplus extern "C" { @@ -92,15 +99,15 @@ extern "C" { /* Image Information */ -HRESULT WINAPI D3DXGetImageInfoFromFileA(LPCSTR file, D3DXIMAGE_INFO *info); +HRESULT WINAPI D3DXGetImageInfoFromFileA(const char *file, D3DXIMAGE_INFO *info); HRESULT WINAPI D3DXGetImageInfoFromFileW(const WCHAR *file, D3DXIMAGE_INFO *info); #define D3DXGetImageInfoFromFile WINELIB_NAME_AW(D3DXGetImageInfoFromFile) -HRESULT WINAPI D3DXGetImageInfoFromResourceA(HMODULE module, LPCSTR resource, D3DXIMAGE_INFO *info); +HRESULT WINAPI D3DXGetImageInfoFromResourceA(HMODULE module, const char *resource, D3DXIMAGE_INFO *info); HRESULT WINAPI D3DXGetImageInfoFromResourceW(HMODULE module, const WCHAR *resource, D3DXIMAGE_INFO *info); #define D3DXGetImageInfoFromResource WINELIB_NAME_AW(D3DXGetImageInfoFromResource) -HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(LPCVOID data, UINT datasize, D3DXIMAGE_INFO *info); +HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT data_size, D3DXIMAGE_INFO *info); /* Surface Loading/Saving */ diff --git a/reactos/include/dxsdk/d3dx9xof.h b/reactos/include/dxsdk/d3dx9xof.h index 785bc1c56a1..35019f26d4e 100644 --- a/reactos/include/dxsdk/d3dx9xof.h +++ b/reactos/include/dxsdk/d3dx9xof.h @@ -40,14 +40,16 @@ typedef DWORD D3DXF_FILELOADOPTIONS; #define D3DXF_FILELOAD_FROMRESOURCE 0x02 #define D3DXF_FILELOAD_FROMMEMORY 0x03 -typedef struct _D3DXF_FILELOADRESOURCE { +typedef struct _D3DXF_FILELOADRESOURCE +{ HMODULE hModule; - LPCSTR lpName; - LPCSTR lpType; + const char *lpName; + const char *lpType; } D3DXF_FILELOADRESOURCE; -typedef struct _D3DXF_FILELOADMEMORY { - LPVOID lpMemory; +typedef struct _D3DXF_FILELOADMEMORY +{ + void *lpMemory; SIZE_T dSize; } D3DXF_FILELOADMEMORY; @@ -72,7 +74,7 @@ STDAPI D3DXFileCreate(struct ID3DXFile **file); DECLARE_INTERFACE_IID_(ID3DXFile,IUnknown,"cef08cf9-7b4f-4429-9624-2a690a933201") { /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, LPVOID*) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; /*** ID3DXFile methods ***/ @@ -80,7 +82,7 @@ DECLARE_INTERFACE_IID_(ID3DXFile,IUnknown,"cef08cf9-7b4f-4429-9624-2a690a933201" struct ID3DXFileEnumObject **enum_obj) PURE; STDMETHOD(CreateSaveObject)(THIS_ const void *data, D3DXF_FILESAVEOPTIONS flags, D3DXF_FILEFORMAT format, struct ID3DXFileSaveObject **save_obj) PURE; - STDMETHOD(RegisterTemplates)(THIS_ LPCVOID, SIZE_T) PURE; + STDMETHOD(RegisterTemplates)(THIS_ const void *data, SIZE_T data_size) PURE; STDMETHOD(RegisterEnumTemplates)(THIS_ struct ID3DXFileEnumObject *enum_obj) PURE; }; #undef INTERFACE @@ -89,7 +91,7 @@ DECLARE_INTERFACE_IID_(ID3DXFile,IUnknown,"cef08cf9-7b4f-4429-9624-2a690a933201" DECLARE_INTERFACE_IID_(ID3DXFileSaveObject,IUnknown,"cef08cfa-7b4f-4429-9624-2a690a933201") { /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, LPVOID*) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; /*** ID3DXFileSaveObject methods ***/ @@ -104,17 +106,17 @@ DECLARE_INTERFACE_IID_(ID3DXFileSaveObject,IUnknown,"cef08cfa-7b4f-4429-9624-2a6 DECLARE_INTERFACE_IID_(ID3DXFileSaveData,IUnknown,"cef08cfb-7b4f-4429-9624-2a690a933201") { /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, LPVOID*) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; /*** ID3DXFileSaveObject methods ***/ STDMETHOD(GetSave)(THIS_ ID3DXFileSaveObject **save_obj) PURE; - STDMETHOD(GetName)(THIS_ LPSTR, SIZE_T*) PURE; + STDMETHOD(GetName)(THIS_ char *name, SIZE_T *size) PURE; STDMETHOD(GetId)(THIS_ LPGUID) PURE; STDMETHOD(GetType)(THIS_ GUID*) PURE; STDMETHOD(AddDataObject)(THIS_ REFGUID template_guid, const char *name, const GUID *guid, SIZE_T data_size, const void *data, ID3DXFileSaveData **obj) PURE; - STDMETHOD(AddDataReference)(THIS_ LPCSTR, CONST GUID*) PURE; + STDMETHOD(AddDataReference)(THIS_ const char *name, const GUID *id) PURE; }; #undef INTERFACE @@ -123,7 +125,7 @@ DECLARE_INTERFACE_IID_(ID3DXFileSaveData,IUnknown,"cef08cfb-7b4f-4429-9624-2a690 DECLARE_INTERFACE_IID_(ID3DXFileEnumObject,IUnknown,"cef08cfc-7b4f-4429-9624-2a690a933201") { /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, LPVOID*) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; /*** ID3DXFileEnumObject methods ***/ @@ -139,14 +141,14 @@ DECLARE_INTERFACE_IID_(ID3DXFileEnumObject,IUnknown,"cef08cfc-7b4f-4429-9624-2a6 DECLARE_INTERFACE_IID_(ID3DXFileData,IUnknown,"cef08cfd-7b4f-4429-9624-2a690a933201") { /*** IUnknown methods ***/ - STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID, LPVOID*) PURE; + STDMETHOD(QueryInterface)(THIS_ REFIID iid, void **out) PURE; STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; /*** ID3DXFileData methods ***/ STDMETHOD(GetEnum)(THIS_ ID3DXFileEnumObject **enum_obj) PURE; - STDMETHOD(GetName)(THIS_ LPSTR, SIZE_T*) PURE; + STDMETHOD(GetName)(THIS_ char *name, SIZE_T *size) PURE; STDMETHOD(GetId)(THIS_ LPGUID) PURE; - STDMETHOD(Lock)(THIS_ SIZE_T*, LPCVOID*) PURE; + STDMETHOD(Lock)(THIS_ SIZE_T *data_size, const void **data) PURE; STDMETHOD(Unlock)(THIS) PURE; STDMETHOD(GetType)(THIS_ GUID*) PURE; STDMETHOD_(BOOL,IsReference)(THIS) PURE; From 482c3d3d9bd199d6e76cc3bba1f0dd35d279b87e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 18:55:57 +0000 Subject: [PATCH 390/419] [D3DX9_37] => [D3DX9_43] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62818 --- reactos/dll/directx/wine/d3dx9_37/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_38/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_39/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_40/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_41/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_42/version.rc | 2 +- .../dll/directx/wine/d3dx9_43/d3dx9_43_main.c | 20 +++++++++++-------- reactos/dll/directx/wine/d3dx9_43/version.rc | 4 ++-- 8 files changed, 20 insertions(+), 16 deletions(-) diff --git a/reactos/dll/directx/wine/d3dx9_37/version.rc b/reactos/dll/directx/wine/d3dx9_37/version.rc index aeb99d2cf9c..996388eec21 100644 --- a/reactos/dll/directx/wine/d3dx9_37/version.rc +++ b/reactos/dll/directx/wine/d3dx9_37/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_37.dll" #define WINE_FILEVERSION 9,22,949,2248 #define WINE_FILEVERSION_STR "9.22.949.2248" #define WINE_PRODUCTVERSION 9,22,949,2248 diff --git a/reactos/dll/directx/wine/d3dx9_38/version.rc b/reactos/dll/directx/wine/d3dx9_38/version.rc index a8fdca8e3bc..5c33e25f16d 100644 --- a/reactos/dll/directx/wine/d3dx9_38/version.rc +++ b/reactos/dll/directx/wine/d3dx9_38/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_38.dll" #define WINE_FILEVERSION 9,23,949,2378 #define WINE_FILEVERSION_STR "9.23.949.2378" #define WINE_PRODUCTVERSION 9,23,949,2378 diff --git a/reactos/dll/directx/wine/d3dx9_39/version.rc b/reactos/dll/directx/wine/d3dx9_39/version.rc index 234dcb9149c..d33fc41a425 100644 --- a/reactos/dll/directx/wine/d3dx9_39/version.rc +++ b/reactos/dll/directx/wine/d3dx9_39/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_39.dll" #define WINE_FILEVERSION 9,24,949,2307 #define WINE_FILEVERSION_STR "9.24.949.2307" #define WINE_PRODUCTVERSION 9,24,949,2307 diff --git a/reactos/dll/directx/wine/d3dx9_40/version.rc b/reactos/dll/directx/wine/d3dx9_40/version.rc index f951079abd0..79894fd491d 100644 --- a/reactos/dll/directx/wine/d3dx9_40/version.rc +++ b/reactos/dll/directx/wine/d3dx9_40/version.rc @@ -18,7 +18,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_40.dll" #define WINE_FILEVERSION 9,24,950,2656 #define WINE_FILEVERSION_STR "9.24.950.2656" #define WINE_PRODUCTVERSION 9,24,950,2656 diff --git a/reactos/dll/directx/wine/d3dx9_41/version.rc b/reactos/dll/directx/wine/d3dx9_41/version.rc index 6db7842c738..2419a7da57e 100644 --- a/reactos/dll/directx/wine/d3dx9_41/version.rc +++ b/reactos/dll/directx/wine/d3dx9_41/version.rc @@ -18,7 +18,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_41.dll" #define WINE_FILEVERSION 9,26,952,2844 #define WINE_FILEVERSION_STR "9.26.952.2844" #define WINE_PRODUCTVERSION 9,26,952,2844 diff --git a/reactos/dll/directx/wine/d3dx9_42/version.rc b/reactos/dll/directx/wine/d3dx9_42/version.rc index 5733eb975e0..16afffc4174 100644 --- a/reactos/dll/directx/wine/d3dx9_42/version.rc +++ b/reactos/dll/directx/wine/d3dx9_42/version.rc @@ -19,7 +19,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_42.dll" #define WINE_FILEVERSION 9,27,952,3001 #define WINE_FILEVERSION_STR "9.27.952.3001" #define WINE_PRODUCTVERSION 9,27,952,3001 diff --git a/reactos/dll/directx/wine/d3dx9_43/d3dx9_43_main.c b/reactos/dll/directx/wine/d3dx9_43/d3dx9_43_main.c index b3d74cbf56d..67cc17a9f1e 100644 --- a/reactos/dll/directx/wine/d3dx9_43/d3dx9_43_main.c +++ b/reactos/dll/directx/wine/d3dx9_43/d3dx9_43_main.c @@ -2,7 +2,7 @@ * Direct3D X 9 main file * * Copyright (C) 2007 David Adam - * Copyright (C) 2009 Rico Schأ¼ller + * Copyright (C) 2009 Rico Schüller * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -20,17 +20,21 @@ * */ -#include "config.h" -#include "wine/port.h" +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +#include +//#include "wine/port.h" #include -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "winuser.h" +#include +#include +#include +//#include "winuser.h" -#include "d3dx9.h" +#include /*********************************************************************** * DllMain. diff --git a/reactos/dll/directx/wine/d3dx9_43/version.rc b/reactos/dll/directx/wine/d3dx9_43/version.rc index 90a4c2b62d0..7220bd2a908 100644 --- a/reactos/dll/directx/wine/d3dx9_43/version.rc +++ b/reactos/dll/directx/wine/d3dx9_43/version.rc @@ -1,6 +1,6 @@ /* * Copyright 2008 Louis Lenders - * Copyright 2009 Rico Schأ¼ller + * Copyright 2009 Rico Schüller * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,7 +18,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_43.dll" #define WINE_FILEVERSION 9,29,952,3111 #define WINE_FILEVERSION_STR "9.29.952.3111" #define WINE_PRODUCTVERSION 9,29,952,3111 From b47789c216ae24e583d432453371753f9e332edc Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 18:58:53 +0000 Subject: [PATCH 391/419] [D3DX9_36] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62819 --- reactos/dll/directx/wine/d3dx9_36/core.c | 2 +- .../dll/directx/wine/d3dx9_36/d3dx9_36_main.c | 2 +- .../directx/wine/d3dx9_36/d3dx9_36_private.h | 9 +- reactos/dll/directx/wine/d3dx9_36/effect.c | 829 +++++++++++------- reactos/dll/directx/wine/d3dx9_36/line.c | 302 +++---- reactos/dll/directx/wine/d3dx9_36/math.c | 68 +- reactos/dll/directx/wine/d3dx9_36/mesh.c | 704 ++++++++------- reactos/dll/directx/wine/d3dx9_36/render.c | 2 +- reactos/dll/directx/wine/d3dx9_36/shader.c | 196 +++-- reactos/dll/directx/wine/d3dx9_36/skin.c | 336 ++++--- reactos/dll/directx/wine/d3dx9_36/sprite.c | 271 +++--- reactos/dll/directx/wine/d3dx9_36/surface.c | 272 +++--- reactos/dll/directx/wine/d3dx9_36/texture.c | 212 +++-- reactos/dll/directx/wine/d3dx9_36/util.c | 22 +- reactos/dll/directx/wine/d3dx9_36/version.rc | 2 +- reactos/dll/directx/wine/d3dx9_36/volume.c | 4 + reactos/dll/directx/wine/d3dx9_36/xfile.c | 411 ++++----- reactos/media/doc/README.WINE | 2 +- 18 files changed, 1994 insertions(+), 1652 deletions(-) diff --git a/reactos/dll/directx/wine/d3dx9_36/core.c b/reactos/dll/directx/wine/d3dx9_36/core.c index d0167a4e1b1..51cb53a40de 100644 --- a/reactos/dll/directx/wine/d3dx9_36/core.c +++ b/reactos/dll/directx/wine/d3dx9_36/core.c @@ -76,7 +76,7 @@ static ULONG WINAPI ID3DXBufferImpl_Release(ID3DXBuffer *iface) return ref; } -static LPVOID WINAPI ID3DXBufferImpl_GetBufferPointer(ID3DXBuffer *iface) +static void * WINAPI ID3DXBufferImpl_GetBufferPointer(ID3DXBuffer *iface) { struct ID3DXBufferImpl *This = impl_from_ID3DXBuffer(iface); diff --git a/reactos/dll/directx/wine/d3dx9_36/d3dx9_36_main.c b/reactos/dll/directx/wine/d3dx9_36/d3dx9_36_main.c index e85b2150cc7..a335475a3df 100644 --- a/reactos/dll/directx/wine/d3dx9_36/d3dx9_36_main.c +++ b/reactos/dll/directx/wine/d3dx9_36/d3dx9_36_main.c @@ -25,7 +25,7 @@ /*********************************************************************** * DllMain. */ -BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, LPVOID reserved) +BOOL WINAPI DllMain(HINSTANCE inst, DWORD reason, void *reserved) { switch(reason) { diff --git a/reactos/dll/directx/wine/d3dx9_36/d3dx9_36_private.h b/reactos/dll/directx/wine/d3dx9_36/d3dx9_36_private.h index a505372de5f..fef9ac65742 100644 --- a/reactos/dll/directx/wine/d3dx9_36/d3dx9_36_private.h +++ b/reactos/dll/directx/wine/d3dx9_36/d3dx9_36_private.h @@ -84,7 +84,7 @@ struct pixel_format_desc { }; HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length) DECLSPEC_HIDDEN; -HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, LPVOID *buffer, DWORD *length) DECLSPEC_HIDDEN; +HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN; HRESULT write_buffer_to_file(const WCHAR *filename, ID3DXBuffer *buffer) DECLSPEC_HIDDEN; @@ -104,7 +104,8 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic const struct pixel_format_desc *dst_format, D3DCOLOR color_key, const PALETTEENTRY *palette) DECLSPEC_HIDDEN; HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, const PALETTEENTRY *palette, - DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN; + DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info, unsigned int skip_levels, + unsigned int *loaded_miplevels) DECLSPEC_HIDDEN; HRESULT load_cube_texture_from_dds(IDirect3DCubeTexture9 *cube_texture, const void *src_data, const PALETTEENTRY *palette, DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN; HRESULT load_volume_from_dds(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *dst_palette, @@ -114,6 +115,7 @@ HRESULT load_volume_texture_from_dds(IDirect3DVolumeTexture9 *volume_texture, co const PALETTEENTRY *palette, DWORD filter, DWORD color_key, const D3DXIMAGE_INFO *src_info) DECLSPEC_HIDDEN; unsigned short float_32_to_16(const float in) DECLSPEC_HIDDEN; +float float_16_to_32(const unsigned short in) DECLSPEC_HIDDEN; /* debug helpers */ const char *debug_d3dxparameter_class(D3DXPARAMETER_CLASS c) DECLSPEC_HIDDEN; @@ -121,6 +123,7 @@ const char *debug_d3dxparameter_type(D3DXPARAMETER_TYPE t) DECLSPEC_HIDDEN; const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r) DECLSPEC_HIDDEN; /* parameter type conversion helpers */ -void set_number(LPVOID outdata, D3DXPARAMETER_TYPE outtype, LPCVOID indata, D3DXPARAMETER_TYPE intype) DECLSPEC_HIDDEN; +void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, + const void *indata, D3DXPARAMETER_TYPE intype) DECLSPEC_HIDDEN; #endif /* __WINE_D3DX9_36_PRIVATE_H */ diff --git a/reactos/dll/directx/wine/d3dx9_36/effect.c b/reactos/dll/directx/wine/d3dx9_36/effect.c index eaaaa16a15c..98d9c43761d 100644 --- a/reactos/dll/directx/wine/d3dx9_36/effect.c +++ b/reactos/dll/directx/wine/d3dx9_36/effect.c @@ -1,6 +1,6 @@ /* * Copyright 2010 Christian Costa - * Copyright 2011 Rico Schأ¼ller + * Copyright 2011 Rico Schüller * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,10 +19,14 @@ #include "d3dx9_36_private.h" +#include + /* Constants for special INT/FLOAT conversation */ #define INT_FLOAT_MULTI 255.0f #define INT_FLOAT_MULTI_INVERSE (1/INT_FLOAT_MULTI) +#define INITIAL_PARAM_TABLE_SIZE 16 + enum STATE_CLASS { SC_LIGHTENABLE, @@ -83,6 +87,7 @@ enum STATE_TYPE ST_CONSTANT, ST_PARAMETER, ST_FXLC, + ST_ARRAY_SELECTOR, }; struct d3dx_parameter @@ -99,9 +104,21 @@ struct d3dx_parameter UINT member_count; DWORD flags; UINT bytes; + DWORD object_id; + + D3DXHANDLE handle; struct d3dx_parameter *annotations; struct d3dx_parameter *members; + + struct d3dx_parameter *referenced_param; +}; + +struct d3dx_object +{ + UINT size; + void *data; + struct d3dx_parameter *param; }; struct d3dx_state @@ -109,7 +126,7 @@ struct d3dx_state UINT operation; UINT index; enum STATE_TYPE type; - struct d3dx_parameter *parameter; + struct d3dx_parameter parameter; }; struct d3dx_sampler @@ -138,15 +155,25 @@ struct d3dx_technique struct d3dx_pass *passes; }; +struct param_table +{ + struct d3dx_parameter **table; + unsigned int count, size; +}; + struct d3dx9_base_effect { struct ID3DXEffectImpl *effect; UINT parameter_count; UINT technique_count; + UINT object_count; struct d3dx_parameter *parameters; struct d3dx_technique *techniques; + struct d3dx_object *objects; + + struct param_table param_table; }; struct ID3DXEffectImpl @@ -177,8 +204,9 @@ static struct d3dx_parameter *get_parameter_by_name(struct d3dx9_base_effect *ba struct d3dx_parameter *parameter, const char *name); static struct d3dx_parameter *get_annotation_by_name(UINT count, struct d3dx_parameter *parameters, const char *name); -static HRESULT d3dx9_parse_state(struct d3dx_state *state, const char *data, const char **ptr, D3DXHANDLE *objects); -static void free_parameter_state(struct d3dx_parameter *param, BOOL element, BOOL child, enum STATE_TYPE st); +static HRESULT d3dx9_parse_state(struct d3dx9_base_effect *base, struct d3dx_state *state, + const char *data, const char **ptr, struct d3dx_object *objects); +static void free_parameter(struct d3dx_parameter *param, BOOL element, BOOL child); static const struct { @@ -402,14 +430,9 @@ static void skip_dword_unknown(const char **ptr, unsigned int count) } } -static inline struct d3dx_parameter *get_parameter_struct(D3DXHANDLE handle) -{ - return (struct d3dx_parameter *) handle; -} - static inline D3DXHANDLE get_parameter_handle(struct d3dx_parameter *parameter) { - return (D3DXHANDLE) parameter; + return parameter ? parameter->handle : NULL; } static inline D3DXHANDLE get_technique_handle(struct d3dx_technique *technique) @@ -468,81 +491,24 @@ static struct d3dx_pass *get_valid_pass(struct d3dx9_base_effect *base, D3DXHAND return NULL; } -static struct d3dx_parameter *get_valid_sub_parameter(struct d3dx_parameter *param, D3DXHANDLE parameter) -{ - unsigned int i, count; - struct d3dx_parameter *p; - - for (i = 0; i < param->annotation_count; ++i) - { - if (get_parameter_handle(¶m->annotations[i]) == parameter) - return ¶m->annotations[i]; - - p = get_valid_sub_parameter(¶m->annotations[i], parameter); - if (p) return p; - } - - count = param->element_count ? param->element_count : param->member_count; - for (i = 0; i < count; ++i) - { - if (get_parameter_handle(¶m->members[i]) == parameter) - return ¶m->members[i]; - - p = get_valid_sub_parameter(¶m->members[i], parameter); - if (p) return p; - } - - return NULL; -} - static struct d3dx_parameter *get_valid_parameter(struct d3dx9_base_effect *base, D3DXHANDLE parameter) { - unsigned int i, k, m; - struct d3dx_parameter *p; + struct d3dx_parameter **handle_param = (struct d3dx_parameter **)parameter; - for (i = 0; i < base->parameter_count; ++i) - { - if (get_parameter_handle(&base->parameters[i]) == parameter) - return &base->parameters[i]; - - p = get_valid_sub_parameter(&base->parameters[i], parameter); - if (p) return p; - } - - for (i = 0; i < base->technique_count; ++i) - { - struct d3dx_technique *technique = &base->techniques[i]; - - for (k = 0; k < technique->pass_count; ++k) - { - struct d3dx_pass *pass = &technique->passes[k]; - - for (m = 0; m < pass->annotation_count; ++m) - { - if (get_parameter_handle(&pass->annotations[m]) == parameter) - return &pass->annotations[m]; - - p = get_valid_sub_parameter(&pass->annotations[m], parameter); - if (p) return p; - } - } - - for (k = 0; k < technique->annotation_count; ++k) - { - if (get_parameter_handle(&technique->annotations[k]) == parameter) - return &technique->annotations[k]; - - p = get_valid_sub_parameter(&technique->annotations[k], parameter); - if (p) return p; - } - } + if (handle_param >= base->param_table.table && handle_param < base->param_table.table + base->param_table.count) + return *handle_param; return get_parameter_by_name(base, NULL, parameter); } static void free_state(struct d3dx_state *state) { - free_parameter_state(state->parameter, FALSE, FALSE, state->type); + free_parameter(&state->parameter, FALSE, FALSE); +} + +static void free_object(struct d3dx_object *object) +{ + HeapFree(GetProcessHeap(), 0, object->data); } static void free_sampler(struct d3dx_sampler *sampler) @@ -557,16 +523,11 @@ static void free_sampler(struct d3dx_sampler *sampler) } static void free_parameter(struct d3dx_parameter *param, BOOL element, BOOL child) -{ - free_parameter_state(param, element, child, ST_CONSTANT); -} - -static void free_parameter_state(struct d3dx_parameter *param, BOOL element, BOOL child, enum STATE_TYPE st) { unsigned int i; - TRACE("Free parameter %p, name %s, type %s, child %s, state_type %x\n", param, param->name, - debug_d3dxparameter_type(param->type), child ? "yes" : "no", st); + TRACE("Free parameter %p, name %s, type %s, child %s\n", param, param->name, + debug_d3dxparameter_type(param->type), child ? "yes" : "no"); if (!param) return; @@ -594,8 +555,7 @@ static void free_parameter_state(struct d3dx_parameter *param, BOOL element, BOO switch (param->type) { case D3DXPT_STRING: - HeapFree(GetProcessHeap(), 0, *(LPSTR *)param->data); - if (!child) HeapFree(GetProcessHeap(), 0, param->data); + HeapFree(GetProcessHeap(), 0, *(char **)param->data); break; case D3DXPT_TEXTURE: @@ -605,15 +565,7 @@ static void free_parameter_state(struct d3dx_parameter *param, BOOL element, BOO case D3DXPT_TEXTURECUBE: case D3DXPT_PIXELSHADER: case D3DXPT_VERTEXSHADER: - if (st == ST_CONSTANT) - { - if (*(IUnknown **)param->data) IUnknown_Release(*(IUnknown **)param->data); - } - else - { - HeapFree(GetProcessHeap(), 0, *(LPSTR *)param->data); - } - if (!child) HeapFree(GetProcessHeap(), 0, param->data); + if (*(IUnknown **)param->data) IUnknown_Release(*(IUnknown **)param->data); break; case D3DXPT_SAMPLER: @@ -621,16 +573,7 @@ static void free_parameter_state(struct d3dx_parameter *param, BOOL element, BOO case D3DXPT_SAMPLER2D: case D3DXPT_SAMPLER3D: case D3DXPT_SAMPLERCUBE: - if (st == ST_CONSTANT) - { - free_sampler((struct d3dx_sampler *)param->data); - } - else - { - HeapFree(GetProcessHeap(), 0, *(LPSTR *)param->data); - } - /* samplers have always own data, so free that */ - HeapFree(GetProcessHeap(), 0, param->data); + free_sampler((struct d3dx_sampler *)param->data); break; default: @@ -638,16 +581,10 @@ static void free_parameter_state(struct d3dx_parameter *param, BOOL element, BOO break; } } - else + + if (!child) { - if (!child) - { - if (st != ST_CONSTANT) - { - HeapFree(GetProcessHeap(), 0, *(LPSTR *)param->data); - } - HeapFree(GetProcessHeap(), 0, param->data); - } + HeapFree(GetProcessHeap(), 0, param->data); } /* only the parent has to release name and semantic */ @@ -722,6 +659,8 @@ static void d3dx9_base_effect_cleanup(struct d3dx9_base_effect *base) TRACE("base %p.\n", base); + HeapFree(GetProcessHeap(), 0, base->param_table.table); + if (base->parameters) { for (i = 0; i < base->parameter_count; ++i) @@ -737,6 +676,16 @@ static void d3dx9_base_effect_cleanup(struct d3dx9_base_effect *base) HeapFree(GetProcessHeap(), 0, base->techniques); base->techniques = NULL; } + + if (base->objects) + { + for (i = 0; i < base->object_count; ++i) + { + free_object(&base->objects[i]); + } + HeapFree(GetProcessHeap(), 0, base->objects); + base->objects = NULL; + } } static void free_effect(struct ID3DXEffectImpl *effect) @@ -778,7 +727,7 @@ static void get_vector(struct d3dx_parameter *param, D3DXVECTOR4 *vector) } } -static void set_vector(struct d3dx_parameter *param, CONST D3DXVECTOR4 *vector) +static void set_vector(struct d3dx_parameter *param, const D3DXVECTOR4 *vector) { UINT i; @@ -806,7 +755,31 @@ static void get_matrix(struct d3dx_parameter *param, D3DXMATRIX *matrix, BOOL tr } } -static void set_matrix(struct d3dx_parameter *param, const D3DXMATRIX *matrix, BOOL transpose) +static void set_matrix(struct d3dx_parameter *param, const D3DXMATRIX *matrix) +{ + UINT i, k; + + if (param->type == D3DXPT_FLOAT) + { + if (param->columns == 4) + memcpy(param->data, matrix->u.m, param->rows * 4 * sizeof(float)); + else + for (i = 0; i < param->rows; ++i) + memcpy((float *)param->data + i * param->columns, matrix->u.m + i, param->columns * sizeof(float)); + return; + } + + for (i = 0; i < param->rows; ++i) + { + for (k = 0; k < param->columns; ++k) + { + set_number((FLOAT *)param->data + i * param->columns + k, param->type, + &matrix->u.m[i][k], D3DXPT_FLOAT); + } + } +} + +static void set_matrix_transpose(struct d3dx_parameter *param, const D3DXMATRIX *matrix) { UINT i, k; @@ -815,7 +788,7 @@ static void set_matrix(struct d3dx_parameter *param, const D3DXMATRIX *matrix, B for (k = 0; k < param->columns; ++k) { set_number((FLOAT *)param->data + i * param->columns + k, param->type, - transpose ? &matrix->u.m[k][i] : &matrix->u.m[i][k], D3DXPT_FLOAT); + &matrix->u.m[k][i], D3DXPT_FLOAT); } } } @@ -1082,7 +1055,7 @@ static D3DXHANDLE d3dx9_base_effect_get_parameter(struct d3dx9_base_effect *base } } - WARN("Invalid argument specified.\n"); + WARN("Parameter not found.\n"); return NULL; } @@ -1160,7 +1133,7 @@ static D3DXHANDLE d3dx9_base_effect_get_parameter_by_semantic(struct d3dx9_base_ } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return NULL; } @@ -1187,7 +1160,7 @@ static D3DXHANDLE d3dx9_base_effect_get_parameter_element(struct d3dx9_base_effe } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return NULL; } @@ -1216,7 +1189,7 @@ static D3DXHANDLE d3dx9_base_effect_get_technique_by_name(struct d3dx9_base_effe return t; } - WARN("Invalid argument specified.\n"); + WARN("Technique not found.\n"); return NULL; } @@ -1232,7 +1205,7 @@ static D3DXHANDLE d3dx9_base_effect_get_pass(struct d3dx9_base_effect *base, return get_pass_handle(&tech->passes[index]); } - WARN("Invalid argument specified.\n"); + WARN("Pass not found.\n"); return NULL; } @@ -1258,7 +1231,7 @@ static D3DXHANDLE d3dx9_base_effect_get_pass_by_name(struct d3dx9_base_effect *b } } - WARN("Invalid argument specified.\n"); + WARN("Pass not found.\n"); return NULL; } @@ -1320,7 +1293,7 @@ static D3DXHANDLE d3dx9_base_effect_get_annotation(struct d3dx9_base_effect *bas return get_parameter_handle(&annotations[index]); } - WARN("Invalid argument specified\n"); + WARN("Annotation not found.\n"); return NULL; } @@ -1347,7 +1320,7 @@ static D3DXHANDLE d3dx9_base_effect_get_annotation_by_name(struct d3dx9_base_eff return get_parameter_handle(annotation); } - WARN("Invalid argument specified\n"); + WARN("Annotation not found.\n"); return NULL; } @@ -1458,7 +1431,7 @@ static HRESULT d3dx9_base_effect_get_value(struct d3dx9_base_effect *base, return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1473,7 +1446,7 @@ static HRESULT d3dx9_base_effect_set_bool(struct d3dx9_base_effect *base, D3DXHA return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1489,7 +1462,7 @@ static HRESULT d3dx9_base_effect_get_bool(struct d3dx9_base_effect *base, D3DXHA return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1527,7 +1500,7 @@ static HRESULT d3dx9_base_effect_set_bool_array(struct d3dx9_base_effect *base, } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1551,7 +1524,7 @@ static HRESULT d3dx9_base_effect_get_bool_array(struct d3dx9_base_effect *base, return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1588,7 +1561,7 @@ static HRESULT d3dx9_base_effect_set_int(struct d3dx9_base_effect *base, D3DXHAN } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1626,7 +1599,7 @@ static HRESULT d3dx9_base_effect_get_int(struct d3dx9_base_effect *base, D3DXHAN } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1663,7 +1636,7 @@ static HRESULT d3dx9_base_effect_set_int_array(struct d3dx9_base_effect *base, } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1687,7 +1660,7 @@ static HRESULT d3dx9_base_effect_get_int_array(struct d3dx9_base_effect *base, return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1702,7 +1675,7 @@ static HRESULT d3dx9_base_effect_set_float(struct d3dx9_base_effect *base, D3DXH return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1718,7 +1691,7 @@ static HRESULT d3dx9_base_effect_get_float(struct d3dx9_base_effect *base, D3DXH return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1755,7 +1728,7 @@ static HRESULT d3dx9_base_effect_set_float_array(struct d3dx9_base_effect *base, } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1779,7 +1752,7 @@ static HRESULT d3dx9_base_effect_get_float_array(struct d3dx9_base_effect *base, return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1810,6 +1783,12 @@ static HRESULT d3dx9_base_effect_set_vector(struct d3dx9_base_effect *base, *(INT *)param->data = tmp; return D3D_OK; } + if (param->type == D3DXPT_FLOAT) + { + memcpy(param->data, vector, param->columns * sizeof(float)); + return D3D_OK; + } + set_vector(param, vector); return D3D_OK; @@ -1824,7 +1803,7 @@ static HRESULT d3dx9_base_effect_set_vector(struct d3dx9_base_effect *base, } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1865,7 +1844,7 @@ static HRESULT d3dx9_base_effect_get_vector(struct d3dx9_base_effect *base, } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1884,6 +1863,17 @@ static HRESULT d3dx9_base_effect_set_vector_array(struct d3dx9_base_effect *base switch (param->class) { case D3DXPC_VECTOR: + if (param->type == D3DXPT_FLOAT) + { + if (param->columns == 4) + memcpy(param->data, vector, count * 4 * sizeof(float)); + else + for (i = 0; i < count; ++i) + memcpy((float *)param->data + param->columns * i, vector + i, + param->columns * sizeof(float)); + return D3D_OK; + } + for (i = 0; i < count; ++i) { set_vector(¶m->members[i], &vector[i]); @@ -1902,7 +1892,7 @@ static HRESULT d3dx9_base_effect_set_vector_array(struct d3dx9_base_effect *base } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1941,7 +1931,7 @@ static HRESULT d3dx9_base_effect_get_vector_array(struct d3dx9_base_effect *base } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -1958,7 +1948,7 @@ static HRESULT d3dx9_base_effect_set_matrix(struct d3dx9_base_effect *base, switch (param->class) { case D3DXPC_MATRIX_ROWS: - set_matrix(param, matrix, FALSE); + set_matrix(param, matrix); return D3D_OK; case D3DXPC_SCALAR: @@ -1973,7 +1963,7 @@ static HRESULT d3dx9_base_effect_set_matrix(struct d3dx9_base_effect *base, } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2005,7 +1995,7 @@ static HRESULT d3dx9_base_effect_get_matrix(struct d3dx9_base_effect *base, } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2026,7 +2016,7 @@ static HRESULT d3dx9_base_effect_set_matrix_array(struct d3dx9_base_effect *base case D3DXPC_MATRIX_ROWS: for (i = 0; i < count; ++i) { - set_matrix(¶m->members[i], &matrix[i], FALSE); + set_matrix(¶m->members[i], &matrix[i]); } return D3D_OK; @@ -2042,7 +2032,7 @@ static HRESULT d3dx9_base_effect_set_matrix_array(struct d3dx9_base_effect *base } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2081,7 +2071,7 @@ static HRESULT d3dx9_base_effect_get_matrix_array(struct d3dx9_base_effect *base } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2100,7 +2090,7 @@ static HRESULT d3dx9_base_effect_set_matrix_pointer_array(struct d3dx9_base_effe case D3DXPC_MATRIX_ROWS: for (i = 0; i < count; ++i) { - set_matrix(¶m->members[i], matrix[i], FALSE); + set_matrix(¶m->members[i], matrix[i]); } return D3D_OK; @@ -2115,7 +2105,7 @@ static HRESULT d3dx9_base_effect_set_matrix_pointer_array(struct d3dx9_base_effe } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2153,7 +2143,7 @@ static HRESULT d3dx9_base_effect_get_matrix_pointer_array(struct d3dx9_base_effe } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2170,7 +2160,7 @@ static HRESULT d3dx9_base_effect_set_matrix_transpose(struct d3dx9_base_effect * switch (param->class) { case D3DXPC_MATRIX_ROWS: - set_matrix(param, matrix, TRUE); + set_matrix_transpose(param, matrix); return D3D_OK; case D3DXPC_SCALAR: @@ -2185,7 +2175,7 @@ static HRESULT d3dx9_base_effect_set_matrix_transpose(struct d3dx9_base_effect * } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2220,7 +2210,7 @@ static HRESULT d3dx9_base_effect_get_matrix_transpose(struct d3dx9_base_effect * } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2241,7 +2231,7 @@ static HRESULT d3dx9_base_effect_set_matrix_transpose_array(struct d3dx9_base_ef case D3DXPC_MATRIX_ROWS: for (i = 0; i < count; ++i) { - set_matrix(¶m->members[i], &matrix[i], TRUE); + set_matrix_transpose(¶m->members[i], &matrix[i]); } return D3D_OK; @@ -2257,7 +2247,7 @@ static HRESULT d3dx9_base_effect_set_matrix_transpose_array(struct d3dx9_base_ef } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2296,7 +2286,7 @@ static HRESULT d3dx9_base_effect_get_matrix_transpose_array(struct d3dx9_base_ef } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2315,7 +2305,7 @@ static HRESULT d3dx9_base_effect_set_matrix_transpose_pointer_array(struct d3dx9 case D3DXPC_MATRIX_ROWS: for (i = 0; i < count; ++i) { - set_matrix(¶m->members[i], matrix[i], TRUE); + set_matrix_transpose(¶m->members[i], matrix[i]); } return D3D_OK; @@ -2330,7 +2320,7 @@ static HRESULT d3dx9_base_effect_set_matrix_transpose_pointer_array(struct d3dx9 } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2368,7 +2358,7 @@ static HRESULT d3dx9_base_effect_get_matrix_transpose_pointer_array(struct d3dx9 } } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2388,12 +2378,12 @@ static HRESULT d3dx9_base_effect_get_string(struct d3dx9_base_effect *base, if (string && param && !param->element_count && param->type == D3DXPT_STRING) { - *string = *(LPCSTR *)param->data; - TRACE("Returning %s\n", debugstr_a(*string)); + *string = *(const char **)param->data; + TRACE("Returning %s.\n", debugstr_a(*string)); return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2410,6 +2400,9 @@ static HRESULT d3dx9_base_effect_set_texture(struct d3dx9_base_effect *base, { struct IDirect3DBaseTexture9 *oltexture = *(struct IDirect3DBaseTexture9 **)param->data; + if (texture == oltexture) + return D3D_OK; + if (texture) IDirect3DBaseTexture9_AddRef(texture); if (oltexture) IDirect3DBaseTexture9_Release(oltexture); @@ -2418,7 +2411,7 @@ static HRESULT d3dx9_base_effect_set_texture(struct d3dx9_base_effect *base, return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2439,7 +2432,7 @@ static HRESULT d3dx9_base_effect_get_texture(struct d3dx9_base_effect *base, return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2457,7 +2450,7 @@ static HRESULT d3dx9_base_effect_get_pixel_shader(struct d3dx9_base_effect *base return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -2475,7 +2468,7 @@ static HRESULT d3dx9_base_effect_get_vertex_shader(struct d3dx9_base_effect *bas return D3D_OK; } - WARN("Invalid argument specified\n"); + WARN("Parameter not found.\n"); return D3DERR_INVALIDCALL; } @@ -3097,7 +3090,7 @@ static HRESULT WINAPI ID3DXEffectImpl_SetTechnique(ID3DXEffect *iface, D3DXHANDL return D3D_OK; } - WARN("Invalid argument supplied.\n"); + WARN("Technique not found.\n"); return D3DERR_INVALIDCALL; } @@ -3143,7 +3136,7 @@ static HRESULT WINAPI ID3DXEffectImpl_Begin(ID3DXEffect *iface, UINT *passes, DW struct ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface); struct d3dx_technique *technique = This->active_technique; - FIXME("iface %p, passes %p, flags %#x partial stub\n", iface, passes, flags); + TRACE("iface %p, passes %p, flags %#x.\n", iface, passes, flags); if (passes && technique) { @@ -3198,6 +3191,12 @@ static HRESULT WINAPI ID3DXEffectImpl_CommitChanges(ID3DXEffect* iface) FIXME("(%p)->(): stub\n", This); + if (!This->active_pass) + { + WARN("Called without an active pass.\n"); + return D3D_OK; + } + return E_NOTIMPL; } @@ -3222,7 +3221,7 @@ static HRESULT WINAPI ID3DXEffectImpl_End(ID3DXEffect *iface) { struct ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface); - FIXME("iface %p partial stub\n", iface); + TRACE("iface %p.\n", iface); if (!This->started) return D3D_OK; @@ -3358,11 +3357,11 @@ static HRESULT WINAPI ID3DXEffectImpl_CloneEffect(ID3DXEffect *iface, return E_NOTIMPL; } -static HRESULT WINAPI ID3DXEffectImpl_SetRawValue(ID3DXEffect* iface, D3DXHANDLE parameter, LPCVOID data, UINT byte_offset, UINT bytes) +static HRESULT WINAPI ID3DXEffectImpl_SetRawValue(ID3DXEffect *iface, + D3DXHANDLE parameter, const void *data, UINT byte_offset, UINT bytes) { - struct ID3DXEffectImpl *This = impl_from_ID3DXEffect(iface); - - FIXME("(%p)->(%p, %p, %u, %u): stub\n", This, parameter, data, byte_offset, bytes); + FIXME("iface %p, parameter %p, data %p, byte_offset %u, bytes %u stub!\n", + iface, parameter, data, byte_offset, bytes); return E_NOTIMPL; } @@ -4139,17 +4138,17 @@ static const struct ID3DXEffectCompilerVtbl ID3DXEffectCompiler_Vtbl = ID3DXEffectCompilerImpl_CompileShader, }; -static HRESULT d3dx9_parse_sampler(struct d3dx_sampler *sampler, const char *data, const char **ptr, D3DXHANDLE *objects) +static HRESULT d3dx9_parse_sampler(struct d3dx9_base_effect *base, struct d3dx_sampler *sampler, + const char *data, const char **ptr, struct d3dx_object *objects) { HRESULT hr; UINT i; - struct d3dx_state *states; read_dword(ptr, &sampler->state_count); TRACE("Count: %u\n", sampler->state_count); - states = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*states) * sampler->state_count); - if (!states) + sampler->states = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*sampler->states) * sampler->state_count); + if (!sampler->states) { ERR("Out of memory\n"); return E_OUTOFMEMORY; @@ -4157,7 +4156,7 @@ static HRESULT d3dx9_parse_sampler(struct d3dx_sampler *sampler, const char *dat for (i = 0; i < sampler->state_count; ++i) { - hr = d3dx9_parse_state(&states[i], data, ptr, objects); + hr = d3dx9_parse_state(base, &sampler->states[i], data, ptr, objects); if (hr != D3D_OK) { WARN("Failed to parse state %u\n", i); @@ -4165,28 +4164,26 @@ static HRESULT d3dx9_parse_sampler(struct d3dx_sampler *sampler, const char *dat } } - sampler->states = states; - return D3D_OK; err_out: for (i = 0; i < sampler->state_count; ++i) { - free_state(&states[i]); + free_state(&sampler->states[i]); } - - HeapFree(GetProcessHeap(), 0, states); + HeapFree(GetProcessHeap(), 0, sampler->states); + sampler->states = NULL; return hr; } -static HRESULT d3dx9_parse_value(struct d3dx_parameter *param, void *value, const char *data, const char **ptr, D3DXHANDLE *objects) +static HRESULT d3dx9_parse_value(struct d3dx9_base_effect *base, struct d3dx_parameter *param, + void *value, const char *data, const char **ptr, struct d3dx_object *objects) { unsigned int i; HRESULT hr; UINT old_size = 0; - DWORD id; if (param->element_count) { @@ -4196,7 +4193,7 @@ static HRESULT d3dx9_parse_value(struct d3dx_parameter *param, void *value, cons { struct d3dx_parameter *member = ¶m->members[i]; - hr = d3dx9_parse_value(member, value ? (char *)value + old_size : NULL, data, ptr, objects); + hr = d3dx9_parse_value(base, member, value ? (char *)value + old_size : NULL, data, ptr, objects); if (hr != D3D_OK) { WARN("Failed to parse value %u\n", i); @@ -4225,7 +4222,7 @@ static HRESULT d3dx9_parse_value(struct d3dx_parameter *param, void *value, cons { struct d3dx_parameter *member = ¶m->members[i]; - hr = d3dx9_parse_value(member, (char *)value + old_size, data, ptr, objects); + hr = d3dx9_parse_value(base, member, (char *)value + old_size, data, ptr, objects); if (hr != D3D_OK) { WARN("Failed to parse value %u\n", i); @@ -4247,9 +4244,9 @@ static HRESULT d3dx9_parse_value(struct d3dx_parameter *param, void *value, cons case D3DXPT_TEXTURECUBE: case D3DXPT_PIXELSHADER: case D3DXPT_VERTEXSHADER: - read_dword(ptr, &id); - TRACE("Id: %u\n", id); - objects[id] = get_parameter_handle(param); + read_dword(ptr, ¶m->object_id); + TRACE("Id: %u\n", param->object_id); + objects[param->object_id].param = param; param->data = value; break; @@ -4265,7 +4262,7 @@ static HRESULT d3dx9_parse_value(struct d3dx_parameter *param, void *value, cons if (!sampler) return E_OUTOFMEMORY; - hr = d3dx9_parse_sampler(sampler, data, ptr, objects); + hr = d3dx9_parse_sampler(base, sampler, data, ptr, objects); if (hr != D3D_OK) { HeapFree(GetProcessHeap(), 0, sampler); @@ -4291,7 +4288,8 @@ static HRESULT d3dx9_parse_value(struct d3dx_parameter *param, void *value, cons return D3D_OK; } -static HRESULT d3dx9_parse_init_value(struct d3dx_parameter *param, const char *data, const char *ptr, D3DXHANDLE *objects) +static HRESULT d3dx9_parse_init_value(struct d3dx9_base_effect *base, struct d3dx_parameter *param, + const char *data, const char *ptr, struct d3dx_object *objects) { UINT size = param->bytes; HRESULT hr; @@ -4328,7 +4326,7 @@ static HRESULT d3dx9_parse_init_value(struct d3dx_parameter *param, const char * } } - hr = d3dx9_parse_value(param, value, data, &ptr, objects); + hr = d3dx9_parse_value(base, param, value, data, &ptr, objects); if (hr != D3D_OK) { WARN("Failed to parse value\n"); @@ -4364,86 +4362,89 @@ static HRESULT d3dx9_parse_name(char **name, const char *ptr) return D3D_OK; } -static HRESULT d3dx9_copy_data(char **str, const char **ptr) +static HRESULT d3dx9_copy_data(struct d3dx_object *object, const char **ptr) { - DWORD size; + if (object->size || object->data) + FIXME("Object already initialized!\n"); - read_dword(ptr, &size); - TRACE("Data size: %#x\n", size); + read_dword(ptr, &object->size); + TRACE("Data size: %#x\n", object->size); - *str = HeapAlloc(GetProcessHeap(), 0, size); - if (!*str) + if (!object->size) + return D3D_OK; + + object->data = HeapAlloc(GetProcessHeap(), 0, object->size); + if (!object->data) { - ERR("Failed to allocate name memory.\n"); + ERR("Failed to allocate object memory.\n"); return E_OUTOFMEMORY; } - TRACE("Data: %s.\n", debugstr_an(*ptr, size)); - memcpy(*str, *ptr, size); + TRACE("Data: %s.\n", debugstr_an(*ptr, object->size)); + memcpy(object->data, *ptr, object->size); - *ptr += ((size + 3) & ~3); + *ptr += ((object->size + 3) & ~3); return D3D_OK; } -static HRESULT d3dx9_parse_data(struct d3dx_parameter *param, const char **ptr, struct IDirect3DDevice9 *device) +static void add_param_to_table(struct d3dx9_base_effect *base, struct d3dx_parameter *param) { - DWORD size; - HRESULT hr; + struct param_table *table = &base->param_table; - TRACE("Parse data for parameter %s, type %s\n", debugstr_a(param->name), debug_d3dxparameter_type(param->type)); - - read_dword(ptr, &size); - TRACE("Data size: %#x\n", size); - - if (!size) + if (table->count >= table->size) { - TRACE("Size is 0\n"); - *(void **)param->data = NULL; - return D3D_OK; + unsigned int new_size; + struct d3dx_parameter **new_alloc; + + if (!table->size) + { + new_size = INITIAL_PARAM_TABLE_SIZE; + new_alloc = HeapAlloc(GetProcessHeap(), 0, sizeof(*table->table) * new_size); + if (!new_alloc) + { + ERR("Out of memory.\n"); + return; + } + } + else + { + new_size = table->size * 2; + new_alloc = HeapReAlloc(GetProcessHeap(), 0, table->table, sizeof(*table->table) * new_size); + if (!new_alloc) + { + ERR("Out of memory.\n"); + return; + } + } + table->table = new_alloc; + table->size = new_size; } - switch (param->type) - { - case D3DXPT_STRING: - /* re-read with size (sizeof(DWORD) = 4) */ - hr = d3dx9_parse_name((LPSTR *)param->data, *ptr - 4); - if (hr != D3D_OK) - { - WARN("Failed to parse string data\n"); - return hr; - } - break; - - case D3DXPT_VERTEXSHADER: - if (FAILED(hr = IDirect3DDevice9_CreateVertexShader(device, (DWORD *)*ptr, param->data))) - { - WARN("Failed to create vertex shader\n"); - return hr; - } - break; - - case D3DXPT_PIXELSHADER: - if (FAILED(hr = IDirect3DDevice9_CreatePixelShader(device, (DWORD *)*ptr, param->data))) - { - WARN("Failed to create pixel shader\n"); - return hr; - } - break; - - default: - FIXME("Unhandled type %s\n", debug_d3dxparameter_type(param->type)); - break; - } - - - *ptr += ((size + 3) & ~3); - - return D3D_OK; + table->table[table->count++] = param; } -static HRESULT d3dx9_parse_effect_typedef(struct d3dx_parameter *param, const char *data, const char **ptr, - struct d3dx_parameter *parent, UINT flags) +static void sync_param_handles(struct d3dx9_base_effect *base) +{ + struct param_table *table = &base->param_table; + struct d3dx_parameter **new_alloc; + unsigned int i; + + if (table->count) + { + new_alloc = HeapReAlloc(GetProcessHeap(), 0, table->table, sizeof(*table->table) * table->count); + if (new_alloc) + table->table = new_alloc; + else + ERR("Out of memory.\n"); + } + + for (i = 0; i < table->count; ++i) + table->table[i]->handle = (D3DXHANDLE)&table->table[i]; +} + +static HRESULT d3dx9_parse_effect_typedef(struct d3dx9_base_effect *base, struct d3dx_parameter *param, + const char *data, const char **ptr, struct d3dx_parameter *parent, UINT flags) { DWORD offset; HRESULT hr; @@ -4453,10 +4454,10 @@ static HRESULT d3dx9_parse_effect_typedef(struct d3dx_parameter *param, const ch if (!parent) { - read_dword(ptr, ¶m->type); + read_dword(ptr, (DWORD *)¶m->type); TRACE("Type: %s\n", debug_d3dxparameter_type(param->type)); - read_dword(ptr, ¶m->class); + read_dword(ptr, (DWORD *)¶m->class); TRACE("Class: %s\n", debug_d3dxparameter_class(param->class)); read_dword(ptr, &offset); @@ -4576,7 +4577,8 @@ static HRESULT d3dx9_parse_effect_typedef(struct d3dx_parameter *param, const ch { *ptr = save_ptr; - hr = d3dx9_parse_effect_typedef(¶m->members[i], data, ptr, param, flags); + add_param_to_table(base, ¶m->members[i]); + hr = d3dx9_parse_effect_typedef(base, ¶m->members[i], data, ptr, param, flags); if (hr != D3D_OK) { WARN("Failed to parse member %u\n", i); @@ -4600,7 +4602,8 @@ static HRESULT d3dx9_parse_effect_typedef(struct d3dx_parameter *param, const ch for (i = 0; i < param->member_count; ++i) { - hr = d3dx9_parse_effect_typedef(¶m->members[i], data, ptr, NULL, flags); + add_param_to_table(base, ¶m->members[i]); + hr = d3dx9_parse_effect_typedef(base, ¶m->members[i], data, ptr, NULL, flags); if (hr != D3D_OK) { WARN("Failed to parse member %u\n", i); @@ -4635,7 +4638,8 @@ err_out: return hr; } -static HRESULT d3dx9_parse_effect_annotation(struct d3dx_parameter *anno, const char *data, const char **ptr, D3DXHANDLE *objects) +static HRESULT d3dx9_parse_effect_annotation(struct d3dx9_base_effect *base, struct d3dx_parameter *anno, + const char *data, const char **ptr, struct d3dx_object *objects) { DWORD offset; const char *ptr2; @@ -4646,7 +4650,7 @@ static HRESULT d3dx9_parse_effect_annotation(struct d3dx_parameter *anno, const read_dword(ptr, &offset); TRACE("Typedef offset: %#x\n", offset); ptr2 = data + offset; - hr = d3dx9_parse_effect_typedef(anno, data, &ptr2, NULL, D3DX_PARAMETER_ANNOTATION); + hr = d3dx9_parse_effect_typedef(base, anno, data, &ptr2, NULL, D3DX_PARAMETER_ANNOTATION); if (hr != D3D_OK) { WARN("Failed to parse type definition\n"); @@ -4655,7 +4659,7 @@ static HRESULT d3dx9_parse_effect_annotation(struct d3dx_parameter *anno, const read_dword(ptr, &offset); TRACE("Value offset: %#x\n", offset); - hr = d3dx9_parse_init_value(anno, data, data + offset, objects); + hr = d3dx9_parse_init_value(base, anno, data, data + offset, objects); if (hr != D3D_OK) { WARN("Failed to parse value\n"); @@ -4665,16 +4669,12 @@ static HRESULT d3dx9_parse_effect_annotation(struct d3dx_parameter *anno, const return D3D_OK; } -static HRESULT d3dx9_parse_state(struct d3dx_state *state, const char *data, const char **ptr, D3DXHANDLE *objects) +static HRESULT d3dx9_parse_state(struct d3dx9_base_effect *base, struct d3dx_state *state, + const char *data, const char **ptr, struct d3dx_object *objects) { DWORD offset; const char *ptr2; HRESULT hr; - struct d3dx_parameter *parameter; - - parameter = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*parameter)); - if (!parameter) - return E_OUTOFMEMORY; state->type = ST_CONSTANT; @@ -4687,7 +4687,7 @@ static HRESULT d3dx9_parse_state(struct d3dx_state *state, const char *data, con read_dword(ptr, &offset); TRACE("Typedef offset: %#x\n", offset); ptr2 = data + offset; - hr = d3dx9_parse_effect_typedef(parameter, data, &ptr2, NULL, 0); + hr = d3dx9_parse_effect_typedef(base, &state->parameter, data, &ptr2, NULL, 0); if (hr != D3D_OK) { WARN("Failed to parse type definition\n"); @@ -4696,25 +4696,24 @@ static HRESULT d3dx9_parse_state(struct d3dx_state *state, const char *data, con read_dword(ptr, &offset); TRACE("Value offset: %#x\n", offset); - hr = d3dx9_parse_init_value(parameter, data, data + offset, objects); + hr = d3dx9_parse_init_value(base, &state->parameter, data, data + offset, objects); if (hr != D3D_OK) { WARN("Failed to parse value\n"); goto err_out; } - state->parameter = parameter; - return D3D_OK; err_out: - free_parameter(parameter, FALSE, FALSE); + free_parameter(&state->parameter, FALSE, FALSE); return hr; } -static HRESULT d3dx9_parse_effect_parameter(struct d3dx_parameter *param, const char *data, const char **ptr, D3DXHANDLE *objects) +static HRESULT d3dx9_parse_effect_parameter(struct d3dx9_base_effect *base, struct d3dx_parameter *param, + const char *data, const char **ptr, struct d3dx_object *objects) { DWORD offset; HRESULT hr; @@ -4734,14 +4733,14 @@ static HRESULT d3dx9_parse_effect_parameter(struct d3dx_parameter *param, const read_dword(ptr, ¶m->annotation_count); TRACE("Annotation count: %u\n", param->annotation_count); - hr = d3dx9_parse_effect_typedef(param, data, &ptr2, NULL, param->flags); + hr = d3dx9_parse_effect_typedef(base, param, data, &ptr2, NULL, param->flags); if (hr != D3D_OK) { WARN("Failed to parse type definition\n"); return hr; } - hr = d3dx9_parse_init_value(param, data, data + offset, objects); + hr = d3dx9_parse_init_value(base, param, data, data + offset, objects); if (hr != D3D_OK) { WARN("Failed to parse value\n"); @@ -4761,7 +4760,8 @@ static HRESULT d3dx9_parse_effect_parameter(struct d3dx_parameter *param, const for (i = 0; i < param->annotation_count; ++i) { - hr = d3dx9_parse_effect_annotation(¶m->annotations[i], data, ptr, objects); + add_param_to_table(base, ¶m->annotations[i]); + hr = d3dx9_parse_effect_annotation(base, ¶m->annotations[i], data, ptr, objects); if (hr != D3D_OK) { WARN("Failed to parse annotation\n"); @@ -4785,7 +4785,8 @@ err_out: return hr; } -static HRESULT d3dx9_parse_effect_pass(struct d3dx_pass *pass, const char *data, const char **ptr, D3DXHANDLE *objects) +static HRESULT d3dx9_parse_effect_pass(struct d3dx9_base_effect *base, struct d3dx_pass *pass, + const char *data, const char **ptr, struct d3dx_object *objects) { DWORD offset; HRESULT hr; @@ -4821,7 +4822,8 @@ static HRESULT d3dx9_parse_effect_pass(struct d3dx_pass *pass, const char *data, for (i = 0; i < pass->annotation_count; ++i) { - hr = d3dx9_parse_effect_annotation(&pass->annotations[i], data, ptr, objects); + add_param_to_table(base, &pass->annotations[i]); + hr = d3dx9_parse_effect_annotation(base, &pass->annotations[i], data, ptr, objects); if (hr != D3D_OK) { WARN("Failed to parse annotation %u\n", i); @@ -4842,7 +4844,7 @@ static HRESULT d3dx9_parse_effect_pass(struct d3dx_pass *pass, const char *data, for (i = 0; i < pass->state_count; ++i) { - hr = d3dx9_parse_state(&states[i], data, ptr, objects); + hr = d3dx9_parse_state(base, &states[i], data, ptr, objects); if (hr != D3D_OK) { WARN("Failed to parse annotation %u\n", i); @@ -4880,7 +4882,8 @@ err_out: return hr; } -static HRESULT d3dx9_parse_effect_technique(struct d3dx_technique *technique, const char *data, const char **ptr, D3DXHANDLE *objects) +static HRESULT d3dx9_parse_effect_technique(struct d3dx9_base_effect *base, struct d3dx_technique *technique, + const char *data, const char **ptr, struct d3dx_object *objects) { DWORD offset; HRESULT hr; @@ -4915,7 +4918,8 @@ static HRESULT d3dx9_parse_effect_technique(struct d3dx_technique *technique, co for (i = 0; i < technique->annotation_count; ++i) { - hr = d3dx9_parse_effect_annotation(&technique->annotations[i], data, ptr, objects); + add_param_to_table(base, &technique->annotations[i]); + hr = d3dx9_parse_effect_annotation(base, &technique->annotations[i], data, ptr, objects); if (hr != D3D_OK) { WARN("Failed to parse annotation %u\n", i); @@ -4937,7 +4941,7 @@ static HRESULT d3dx9_parse_effect_technique(struct d3dx_technique *technique, co for (i = 0; i < technique->pass_count; ++i) { - hr = d3dx9_parse_effect_pass(&technique->passes[i], data, ptr, objects); + hr = d3dx9_parse_effect_pass(base, &technique->passes[i], data, ptr, objects); if (hr != D3D_OK) { WARN("Failed to parse pass %u\n", i); @@ -4973,12 +4977,81 @@ err_out: return hr; } +static HRESULT d3dx9_create_object(struct d3dx9_base_effect *base, struct d3dx_object *object) +{ + struct d3dx_parameter *param = object->param; + struct IDirect3DDevice9 *device = base->effect->device; + HRESULT hr; + + if (*(char **)param->data) + ERR("Parameter data already allocated.\n"); + + switch (param->type) + { + case D3DXPT_STRING: + *(char **)param->data = HeapAlloc(GetProcessHeap(), 0, object->size); + if (!*(char **)param->data) + { + ERR("Out of memory.\n"); + return E_OUTOFMEMORY; + } + memcpy(*(char **)param->data, object->data, object->size); + break; + case D3DXPT_VERTEXSHADER: + if (FAILED(hr = IDirect3DDevice9_CreateVertexShader(device, object->data, + (IDirect3DVertexShader9 **)param->data))) + { + WARN("Failed to create vertex shader.\n"); + return hr; + } + break; + case D3DXPT_PIXELSHADER: + if (FAILED(hr = IDirect3DDevice9_CreatePixelShader(device, object->data, + (IDirect3DPixelShader9 **)param->data))) + { + WARN("Failed to create pixel shader.\n"); + return hr; + } + break; + default: + break; + } + return D3D_OK; +} + +static HRESULT d3dx9_parse_array_selector(struct d3dx9_base_effect *base, struct d3dx_parameter *param) +{ + DWORD string_size; + struct d3dx_object *object = &base->objects[param->object_id]; + char *ptr = object->data; + + TRACE("Parsing array entry selection state for parameter %p.\n", param); + + string_size = *(DWORD *)ptr; + param->referenced_param = get_parameter_by_name(base, NULL, ptr + 4); + if (param->referenced_param) + { + TRACE("Mapping to parameter %s.\n", debugstr_a(param->referenced_param->name)); + } + else + { + FIXME("Referenced parameter %s not found.\n", ptr + 4); + return D3DXERR_INVALIDDATA; + } + TRACE("Unknown DWORD: 0x%.8x.\n", *(DWORD *)(ptr + string_size)); + + FIXME("Parse preshader.\n"); + + return D3D_OK; +} + static HRESULT d3dx9_parse_resource(struct d3dx9_base_effect *base, const char *data, const char **ptr) { DWORD technique_index; DWORD index, state_index, usage, element_index; struct d3dx_state *state; struct d3dx_parameter *param; + struct d3dx_object *object; HRESULT hr = E_FAIL; read_dword(ptr, &technique_index); @@ -5056,18 +5129,26 @@ static HRESULT d3dx9_parse_resource(struct d3dx9_base_effect *base, const char * state = &pass->states[state_index]; } - param = state->parameter; + TRACE("State operation %#x (%s).\n", state->operation, state_table[state->operation].name); + param = &state->parameter; + TRACE("Using object id %u.\n", param->object_id); + object = &base->objects[param->object_id]; + TRACE("Usage %u: class %s, type %s.\n", usage, debug_d3dxparameter_class(param->class), + debug_d3dxparameter_type(param->type)); switch (usage) { case 0: - TRACE("usage 0: type %s\n", debug_d3dxparameter_type(param->type)); switch (param->type) { case D3DXPT_VERTEXSHADER: case D3DXPT_PIXELSHADER: state->type = ST_CONSTANT; - hr = d3dx9_parse_data(param, ptr, base->effect->device); + if (FAILED(hr = d3dx9_copy_data(&base->objects[param->object_id], ptr))) + return hr; + + if (object->data) + hr = d3dx9_create_object(base, object); break; case D3DXPT_BOOL: @@ -5075,7 +5156,7 @@ static HRESULT d3dx9_parse_resource(struct d3dx9_base_effect *base, const char * case D3DXPT_FLOAT: case D3DXPT_STRING: state->type = ST_FXLC; - hr = d3dx9_copy_data(param->data, ptr); + hr = d3dx9_copy_data(&base->objects[param->object_id], ptr); break; default: @@ -5086,11 +5167,27 @@ static HRESULT d3dx9_parse_resource(struct d3dx9_base_effect *base, const char * case 1: state->type = ST_PARAMETER; - hr = d3dx9_copy_data(param->data, ptr); - if (hr == D3D_OK) + if (FAILED(hr = d3dx9_copy_data(&base->objects[param->object_id], ptr))) + return hr; + + TRACE("Looking for parameter %s.\n", debugstr_a(object->data)); + param->referenced_param = get_parameter_by_name(base, NULL, object->data); + if (param->referenced_param) { - TRACE("Mapping to parameter %s\n", *(char **)param->data); + TRACE("Mapping to parameter %p.\n", param->referenced_param); } + else + { + FIXME("Referenced parameter %s not found.\n", (char *)object->data); + return D3DXERR_INVALIDDATA; + } + break; + + case 2: + state->type = ST_ARRAY_SELECTOR; + if (FAILED(hr = d3dx9_copy_data(object, ptr))) + return hr; + hr = d3dx9_parse_array_selector(base, param); break; default: @@ -5104,8 +5201,7 @@ static HRESULT d3dx9_parse_resource(struct d3dx9_base_effect *base, const char * static HRESULT d3dx9_parse_effect(struct d3dx9_base_effect *base, const char *data, UINT data_size, DWORD start) { const char *ptr = data + start; - D3DXHANDLE *objects = NULL; - UINT stringcount, objectcount, resourcecount; + UINT stringcount, resourcecount; HRESULT hr; UINT i; @@ -5117,11 +5213,11 @@ static HRESULT d3dx9_parse_effect(struct d3dx9_base_effect *base, const char *da skip_dword_unknown(&ptr, 1); - read_dword(&ptr, &objectcount); - TRACE("Object count: %u\n", objectcount); + read_dword(&ptr, &base->object_count); + TRACE("Object count: %u\n", base->object_count); - objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*objects) * objectcount); - if (!objects) + base->objects = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*base->objects) * base->object_count); + if (!base->objects) { ERR("Out of memory\n"); hr = E_OUTOFMEMORY; @@ -5141,7 +5237,8 @@ static HRESULT d3dx9_parse_effect(struct d3dx9_base_effect *base, const char *da for (i = 0; i < base->parameter_count; ++i) { - hr = d3dx9_parse_effect_parameter(&base->parameters[i], data, &ptr, objects); + add_param_to_table(base, &base->parameters[i]); + hr = d3dx9_parse_effect_parameter(base, &base->parameters[i], data, &ptr, base->objects); if (hr != D3D_OK) { WARN("Failed to parse parameter %u\n", i); @@ -5163,7 +5260,8 @@ static HRESULT d3dx9_parse_effect(struct d3dx9_base_effect *base, const char *da for (i = 0; i < base->technique_count; ++i) { - hr = d3dx9_parse_effect_technique(&base->techniques[i], data, &ptr, objects); + TRACE("Parsing technique %u.\n", i); + hr = d3dx9_parse_effect_technique(base, &base->techniques[i], data, &ptr, base->objects); if (hr != D3D_OK) { WARN("Failed to parse technique %u\n", i); @@ -5172,6 +5270,8 @@ static HRESULT d3dx9_parse_effect(struct d3dx9_base_effect *base, const char *da } } + sync_param_handles(base); + read_dword(&ptr, &stringcount); TRACE("String count: %u\n", stringcount); @@ -5181,18 +5281,17 @@ static HRESULT d3dx9_parse_effect(struct d3dx9_base_effect *base, const char *da for (i = 0; i < stringcount; ++i) { DWORD id; - struct d3dx_parameter *param; read_dword(&ptr, &id); TRACE("Id: %u\n", id); - param = get_parameter_struct(objects[id]); - - hr = d3dx9_parse_data(param, &ptr, base->effect->device); - if (hr != D3D_OK) - { - WARN("Failed to parse data %u\n", i); + if (FAILED(hr = d3dx9_copy_data(&base->objects[id], &ptr))) goto err_out; + + if (base->objects[id].data) + { + if (FAILED(hr = d3dx9_create_object(base, &base->objects[id]))) + goto err_out; } } @@ -5208,8 +5307,6 @@ static HRESULT d3dx9_parse_effect(struct d3dx9_base_effect *base, const char *da } } - HeapFree(GetProcessHeap(), 0, objects); - return D3D_OK; err_out: @@ -5232,17 +5329,27 @@ err_out: base->parameters = NULL; } - HeapFree(GetProcessHeap(), 0, objects); + if (base->objects) + { + for (i = 0; i < base->object_count; ++i) + { + free_object(&base->objects[i]); + } + HeapFree(GetProcessHeap(), 0, base->objects); + base->objects = NULL; + } return hr; } static HRESULT d3dx9_base_effect_init(struct d3dx9_base_effect *base, - const char *data, SIZE_T data_size, struct ID3DXEffectImpl *effect) + const char *data, SIZE_T data_size, const D3D_SHADER_MACRO *defines, ID3DInclude *include, + UINT eflags, ID3DBlob **errors, struct ID3DXEffectImpl *effect) { DWORD tag, offset; const char *ptr = data; HRESULT hr; + ID3DBlob *bytecode = NULL, *temp_errors = NULL; TRACE("base %p, data %p, data_size %lu, effect %p\n", base, data, data_size, effect); @@ -5253,30 +5360,55 @@ static HRESULT d3dx9_base_effect_init(struct d3dx9_base_effect *base, if (tag != d3dx9_effect_version(9, 1)) { - /* todo: compile hlsl ascii code */ - FIXME("HLSL ascii effects not supported, yet\n"); - - /* Show the start of the shader for debugging info. */ - TRACE("effect:\n%s\n", debugstr_an(data, data_size > 40 ? 40 : data_size)); - } - else - { - read_dword(&ptr, &offset); - TRACE("Offset: %x\n", offset); - - hr = d3dx9_parse_effect(base, ptr, data_size, offset); - if (hr != D3D_OK) + TRACE("HLSL ASCII effect, trying to compile it.\n"); + hr = D3DCompile(data, data_size, NULL, defines, include, + "main", "fx_2_0", 0, eflags, &bytecode, &temp_errors); + if (FAILED(hr)) { - FIXME("Failed to parse effect.\n"); + WARN("Failed to compile ASCII effect.\n"); + if (bytecode) + ID3D10Blob_Release(bytecode); + if (temp_errors) + TRACE("%s\n", (char *)ID3D10Blob_GetBufferPointer(temp_errors)); + if (errors) + *errors = temp_errors; + else if (temp_errors) + ID3D10Blob_Release(temp_errors); return hr; } + if (!bytecode) + { + FIXME("No output from effect compilation.\n"); + return D3DERR_INVALIDCALL; + } + if (errors) + *errors = temp_errors; + else if (temp_errors) + ID3D10Blob_Release(temp_errors); + + ptr = ID3D10Blob_GetBufferPointer(bytecode); + read_dword(&ptr, &tag); + TRACE("Tag: %x\n", tag); + } + + read_dword(&ptr, &offset); + TRACE("Offset: %x\n", offset); + + hr = d3dx9_parse_effect(base, ptr, data_size, offset); + if (bytecode) + ID3D10Blob_Release(bytecode); + if (hr != D3D_OK) + { + FIXME("Failed to parse effect.\n"); + return hr; } return D3D_OK; } static HRESULT d3dx9_effect_init(struct ID3DXEffectImpl *effect, struct IDirect3DDevice9 *device, - const char *data, SIZE_T data_size, struct ID3DXEffectPool *pool) + const char *data, SIZE_T data_size, const D3D_SHADER_MACRO *defines, ID3DInclude *include, + UINT eflags, ID3DBlob **error_messages, struct ID3DXEffectPool *pool) { HRESULT hr; @@ -5291,7 +5423,8 @@ static HRESULT d3dx9_effect_init(struct ID3DXEffectImpl *effect, struct IDirect3 IDirect3DDevice9_AddRef(device); effect->device = device; - if (FAILED(hr = d3dx9_base_effect_init(&effect->base_effect, data, data_size, effect))) + if (FAILED(hr = d3dx9_base_effect_init(&effect->base_effect, data, data_size, defines, include, + eflags, error_messages, effect))) { FIXME("Failed to parse effect, hr %#x.\n", hr); free_effect(effect); @@ -5315,8 +5448,10 @@ HRESULT WINAPI D3DXCreateEffectEx(struct IDirect3DDevice9 *device, const void *s struct ID3DXEffectImpl *object; HRESULT hr; - FIXME("(%p, %p, %u, %p, %p, %p, %#x, %p, %p, %p): semi-stub\n", device, srcdata, srcdatalen, defines, include, - skip_constants, flags, pool, effect, compilation_errors); + TRACE("device %p, srcdata %p, srcdatalen %u, defines %p, include %p," + " skip_constants %p, flags %#x, pool %p, effect %p, compilation_errors %p.\n", + device, srcdata, srcdatalen, defines, include, + skip_constants, flags, pool, effect, compilation_errors); if (compilation_errors) *compilation_errors = NULL; @@ -5331,14 +5466,18 @@ HRESULT WINAPI D3DXCreateEffectEx(struct IDirect3DDevice9 *device, const void *s if (!effect) return D3D_OK; + if (skip_constants) + FIXME("skip_constants is not NULL, not supported yet.\n"); + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) return E_OUTOFMEMORY; - hr = d3dx9_effect_init(object, device, srcdata, srcdatalen, pool); + hr = d3dx9_effect_init(object, device, srcdata, srcdatalen, (const D3D_SHADER_MACRO *)defines, + (ID3DInclude *)include, flags, (ID3DBlob **)compilation_errors, pool); if (FAILED(hr)) { - WARN("Failed to initialize shader reflection\n"); + WARN("Failed to create effect object.\n"); HeapFree(GetProcessHeap(), 0, object); return hr; } @@ -5360,7 +5499,9 @@ HRESULT WINAPI D3DXCreateEffect(struct IDirect3DDevice9 *device, const void *src return D3DXCreateEffectEx(device, srcdata, srcdatalen, defines, include, NULL, flags, pool, effect, compilation_errors); } -static HRESULT d3dx9_effect_compiler_init(struct ID3DXEffectCompilerImpl *compiler, const char *data, SIZE_T data_size) +static HRESULT d3dx9_effect_compiler_init(struct ID3DXEffectCompilerImpl *compiler, + const char *data, SIZE_T data_size, const D3D_SHADER_MACRO *defines, ID3DInclude *include, + UINT eflags, ID3DBlob **error_messages) { HRESULT hr; @@ -5369,7 +5510,8 @@ static HRESULT d3dx9_effect_compiler_init(struct ID3DXEffectCompilerImpl *compil compiler->ID3DXEffectCompiler_iface.lpVtbl = &ID3DXEffectCompiler_Vtbl; compiler->ref = 1; - if (FAILED(hr = d3dx9_base_effect_init(&compiler->base_effect, data, data_size, NULL))) + if (FAILED(hr = d3dx9_base_effect_init(&compiler->base_effect, data, data_size, defines, + include, eflags, error_messages, NULL))) { FIXME("Failed to parse effect, hr %#x.\n", hr); free_effect_compiler(compiler); @@ -5398,7 +5540,8 @@ HRESULT WINAPI D3DXCreateEffectCompiler(const char *srcdata, UINT srcdatalen, co if (!object) return E_OUTOFMEMORY; - hr = d3dx9_effect_compiler_init(object, srcdata, srcdatalen); + hr = d3dx9_effect_compiler_init(object, srcdata, srcdatalen, (const D3D_SHADER_MACRO *)defines, + (ID3DInclude *)include, flags, (ID3DBlob **)parse_errors); if (FAILED(hr)) { WARN("Failed to initialize effect compiler\n"); @@ -5497,11 +5640,14 @@ HRESULT WINAPI D3DXCreateEffectFromFileExW(struct IDirect3DDevice9 *device, cons const D3DXMACRO *defines, struct ID3DXInclude *include, const char *skipconstants, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors) { - LPVOID buffer; + void *buffer; HRESULT ret; DWORD size; - TRACE("(%s): relay\n", debugstr_w(srcfile)); + TRACE("device %p, srcfile %s, defines %p, include %p, skipconstants %s, " + "flags %#x, pool %p, effect %p, compilationerrors %p.\n", + device, debugstr_w(srcfile), defines, include, debugstr_a(skipconstants), + flags, pool, effect, compilationerrors); if (!device || !srcfile) return D3DERR_INVALIDCALL; @@ -5521,11 +5667,14 @@ HRESULT WINAPI D3DXCreateEffectFromFileExA(struct IDirect3DDevice9 *device, cons const D3DXMACRO *defines, struct ID3DXInclude *include, const char *skipconstants, DWORD flags, struct ID3DXEffectPool *pool, struct ID3DXEffect **effect, struct ID3DXBuffer **compilationerrors) { - LPWSTR srcfileW; + WCHAR *srcfileW; HRESULT ret; DWORD len; - TRACE("(void): relay\n"); + TRACE("device %p, srcfile %s, defines %p, include %p, skipconstants %s, " + "flags %#x, pool %p, effect %p, compilationerrors %p.\n", + device, debugstr_a(srcfile), defines, include, debugstr_a(skipconstants), + flags, pool, effect, compilationerrors); if (!srcfile) return D3DERR_INVALIDCALL; @@ -5627,11 +5776,12 @@ HRESULT WINAPI D3DXCreateEffectFromResourceA(struct IDirect3DDevice9 *device, HM HRESULT WINAPI D3DXCreateEffectCompilerFromFileW(const WCHAR *srcfile, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors) { - LPVOID buffer; + void *buffer; HRESULT ret; DWORD size; - TRACE("(%s): relay\n", debugstr_w(srcfile)); + TRACE("srcfile %s, defines %p, include %p, flags %#x, effectcompiler %p, parseerrors %p.\n", + debugstr_w(srcfile), defines, include, flags, effectcompiler, parseerrors); if (!srcfile) return D3DERR_INVALIDCALL; @@ -5650,11 +5800,12 @@ HRESULT WINAPI D3DXCreateEffectCompilerFromFileW(const WCHAR *srcfile, const D3D HRESULT WINAPI D3DXCreateEffectCompilerFromFileA(const char *srcfile, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXEffectCompiler **effectcompiler, ID3DXBuffer **parseerrors) { - LPWSTR srcfileW; + WCHAR *srcfileW; HRESULT ret; DWORD len; - TRACE("(void): relay\n"); + TRACE("srcfile %s, defines %p, include %p, flags %#x, effectcompiler %p, parseerrors %p.\n", + debugstr_a(srcfile), defines, include, flags, effectcompiler, parseerrors); if (!srcfile) return D3DERR_INVALIDCALL; diff --git a/reactos/dll/directx/wine/d3dx9_36/line.c b/reactos/dll/directx/wine/d3dx9_36/line.c index cac954e71f2..e1b691a07bb 100644 --- a/reactos/dll/directx/wine/d3dx9_36/line.c +++ b/reactos/dll/directx/wine/d3dx9_36/line.c @@ -19,327 +19,289 @@ #include "d3dx9_36_private.h" -typedef struct ID3DXLineImpl { +struct d3dx9_line +{ ID3DXLine ID3DXLine_iface; LONG ref; IDirect3DDevice9 *device; IDirect3DStateBlock9 *state; -} ID3DXLineImpl; +}; -static inline ID3DXLineImpl *impl_from_ID3DXLine(ID3DXLine *iface) +static inline struct d3dx9_line *impl_from_ID3DXLine(ID3DXLine *iface) { - return CONTAINING_RECORD(iface, ID3DXLineImpl, ID3DXLine_iface); + return CONTAINING_RECORD(iface, struct d3dx9_line, ID3DXLine_iface); } -/*** IUnknown methods ***/ -static HRESULT WINAPI ID3DXLineImpl_QueryInterface(ID3DXLine* iface, REFIID riid, LPVOID* object) +static HRESULT WINAPI d3dx9_line_QueryInterface(ID3DXLine *iface, REFIID riid, void **out) { - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), object); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - if (IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_ID3DXLine)) + if (IsEqualGUID(riid, &IID_ID3DXLine) + || IsEqualGUID(riid, &IID_IUnknown)) { ID3DXLine_AddRef(iface); - *object = iface; + *out = iface; return S_OK; } - ERR("Interface %s not found\n", debugstr_guid(riid)); + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + *out = NULL; return E_NOINTERFACE; } -static ULONG WINAPI ID3DXLineImpl_AddRef(ID3DXLine* iface) +static ULONG WINAPI d3dx9_line_AddRef(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); + struct d3dx9_line *line = impl_from_ID3DXLine(iface); + ULONG refcount = InterlockedIncrement(&line->ref); - TRACE("(%p)->(): AddRef from %u\n", This, This->ref); + TRACE("%p increasing refcount to %u.\n", line, refcount); - return InterlockedIncrement(&This->ref); + return refcount; } -static ULONG WINAPI ID3DXLineImpl_Release(ID3DXLine* iface) +static ULONG WINAPI d3dx9_line_Release(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - ULONG ref = InterlockedDecrement(&This->ref); + struct d3dx9_line *line = impl_from_ID3DXLine(iface); + ULONG refcount = InterlockedDecrement(&line->ref); - TRACE("(%p)->(): Release from %u\n", This, ref + 1); + TRACE("%p decreasing refcount to %u.\n", line, refcount); - if (!ref) + if (!refcount) { - IDirect3DDevice9_Release(This->device); - HeapFree(GetProcessHeap(), 0, This); + IDirect3DDevice9_Release(line->device); + HeapFree(GetProcessHeap(), 0, line); } - return ref; + return refcount; } -/*** ID3DXLine methods ***/ -static HRESULT WINAPI ID3DXLineImpl_GetDevice(struct ID3DXLine *iface, struct IDirect3DDevice9 **device) +static HRESULT WINAPI d3dx9_line_GetDevice(struct ID3DXLine *iface, struct IDirect3DDevice9 **device) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); + struct d3dx9_line *line = impl_from_ID3DXLine(iface); - TRACE ("(%p)->(%p)\n", This, device); + TRACE("iface %p, device %p.\n", iface, line); - if (device == NULL) return D3DERR_INVALIDCALL; + if (!device) + return D3DERR_INVALIDCALL; - *device = This->device; - IDirect3DDevice9_AddRef(This->device); + *device = line->device; + IDirect3DDevice9_AddRef(line->device); return D3D_OK; } -static HRESULT WINAPI ID3DXLineImpl_Begin(ID3DXLine* iface) +static HRESULT WINAPI d3dx9_line_Begin(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - HRESULT hr; + struct d3dx9_line *line = impl_from_ID3DXLine(iface); D3DXMATRIX identity, projection; D3DVIEWPORT9 vp; - TRACE ("(%p)->()\n", This); + TRACE("iface %p.\n", iface); - if (This->state != NULL) /* We already began. Return error. */ + if (line->state) return D3DERR_INVALIDCALL; - hr = IDirect3DDevice9_CreateStateBlock(This->device, D3DSBT_ALL, &This->state); - if (FAILED(hr)) return D3DXERR_INVALIDDATA; + if (FAILED(IDirect3DDevice9_CreateStateBlock(line->device, D3DSBT_ALL, &line->state))) + return D3DXERR_INVALIDDATA; - hr = IDirect3DDevice9_GetViewport(This->device, &vp); - if (FAILED(hr)) goto failed; + if (FAILED(IDirect3DDevice9_GetViewport(line->device, &vp))) + goto failed; D3DXMatrixIdentity(&identity); - D3DXMatrixOrthoOffCenterLH(&projection, - 0.0, vp.Width, /* Min and max x */ - vp.Height, 0.0, /* Min and max y. Screen y is on top so this is inverted */ - 0.0, 1.0); /* Min and max z */ + D3DXMatrixOrthoOffCenterLH(&projection, 0.0, (FLOAT)vp.Width, (FLOAT)vp.Height, 0.0, 0.0, 1.0); - hr = IDirect3DDevice9_SetTransform(This->device, D3DTS_WORLD, &identity); - if (FAILED(hr)) goto failed; + if (FAILED(IDirect3DDevice9_SetTransform(line->device, D3DTS_WORLD, &identity))) + goto failed; + if (FAILED(IDirect3DDevice9_SetTransform(line->device, D3DTS_VIEW, &identity))) + goto failed; + if (FAILED(IDirect3DDevice9_SetTransform(line->device, D3DTS_PROJECTION, &projection))) + goto failed; - hr = IDirect3DDevice9_SetTransform(This->device, D3DTS_VIEW, &identity); - if (FAILED(hr)) goto failed; - - hr = IDirect3DDevice9_SetTransform(This->device, D3DTS_PROJECTION, &projection); - if (FAILED(hr)) goto failed; - - /* Windows sets similar states so we do the same */ - - hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_LIGHTING, FALSE); - if (FAILED(hr)) goto failed; - - hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_FOGENABLE, FALSE); - if (FAILED(hr)) goto failed; - - hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_SHADEMODE, D3DSHADE_FLAT); - if (FAILED(hr)) goto failed; - - hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_ALPHABLENDENABLE, TRUE); - if (FAILED(hr)) goto failed; - - hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - if (FAILED(hr)) goto failed; - - hr = IDirect3DDevice9_SetRenderState(This->device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - if (FAILED(hr)) goto failed; + if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_LIGHTING, FALSE))) + goto failed; + if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_FOGENABLE, FALSE))) + goto failed; + if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_SHADEMODE, D3DSHADE_FLAT))) + goto failed; + if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_ALPHABLENDENABLE, TRUE))) + goto failed; + if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA))) + goto failed; + if (FAILED(IDirect3DDevice9_SetRenderState(line->device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA))) + goto failed; return D3D_OK; + failed: - IDirect3DStateBlock9_Apply(This->state); - IDirect3DStateBlock9_Release(This->state); - This->state = NULL; + IDirect3DStateBlock9_Apply(line->state); + IDirect3DStateBlock9_Release(line->state); + line->state = NULL; return D3DXERR_INVALIDDATA; } -static HRESULT WINAPI ID3DXLineImpl_Draw(ID3DXLine* iface, CONST D3DXVECTOR2* vertexlist, DWORD vertexlistcount, D3DCOLOR color) +static HRESULT WINAPI d3dx9_line_Draw(ID3DXLine *iface, const D3DXVECTOR2 *vertex_list, + DWORD vertex_list_count, D3DCOLOR color) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(%p, %u, %#x): stub\n", This, vertexlist, vertexlistcount, color); + FIXME("iface %p, vertex_list %p, vertex_list_count %u, color 0x%08x stub!\n", + iface, vertex_list, vertex_list_count, color); return E_NOTIMPL; } -static HRESULT WINAPI ID3DXLineImpl_DrawTransform(ID3DXLine* iface, CONST D3DXVECTOR3* vertexlist, DWORD vertexlistcount, - CONST D3DXMATRIX* transform, D3DCOLOR color) +static HRESULT WINAPI d3dx9_line_DrawTransform(ID3DXLine *iface, const D3DXVECTOR3 *vertex_list, + DWORD vertex_list_count, const D3DXMATRIX *transform, D3DCOLOR color) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(%p, %u, %p, %#x): stub\n", This, vertexlist, vertexlistcount, transform, color); + FIXME("iface %p, vertex_list %p, vertex_list_count %u, transform %p, color 0x%08x stub!\n", + iface, vertex_list, vertex_list_count, transform, color); return E_NOTIMPL; } -static HRESULT WINAPI ID3DXLineImpl_SetPattern(ID3DXLine* iface, DWORD pattern) +static HRESULT WINAPI d3dx9_line_SetPattern(ID3DXLine *iface, DWORD pattern) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(%#x): stub\n", This, pattern); + FIXME("iface %p, pattern 0x%08x stub!\n", iface, pattern); return E_NOTIMPL; } -static DWORD WINAPI ID3DXLineImpl_GetPattern(ID3DXLine* iface) +static DWORD WINAPI d3dx9_line_GetPattern(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); + FIXME("iface %p stub!\n", iface); - FIXME("(%p)->(): stub\n", This); - - return 0xFFFFFFFF; + return 0xffffffff; } -static HRESULT WINAPI ID3DXLineImpl_SetPatternScale(ID3DXLine* iface, FLOAT scale) +static HRESULT WINAPI d3dx9_line_SetPatternScale(ID3DXLine *iface, float scale) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(%f): stub\n", This, scale); + FIXME("iface %p, scale %.8e stub!\n", iface, scale); return E_NOTIMPL; } -static FLOAT WINAPI ID3DXLineImpl_GetPatternScale(ID3DXLine* iface) +static float WINAPI d3dx9_line_GetPatternScale(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(): stub\n", This); + FIXME("iface %p stub!\n", iface); return 1.0f; } -static HRESULT WINAPI ID3DXLineImpl_SetWidth(ID3DXLine* iface, FLOAT width) +static HRESULT WINAPI d3dx9_line_SetWidth(ID3DXLine *iface, float width) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(%f): stub\n", This, width); + FIXME("iface %p, width %.8e stub!\n", iface, width); return E_NOTIMPL; } -static FLOAT WINAPI ID3DXLineImpl_GetWidth(ID3DXLine* iface) +static float WINAPI d3dx9_line_GetWidth(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(): stub\n", This); + FIXME("iface %p stub!\n", iface); return 1.0f; } -static HRESULT WINAPI ID3DXLineImpl_SetAntialias(ID3DXLine* iface, BOOL antialias) +static HRESULT WINAPI d3dx9_line_SetAntialias(ID3DXLine *iface, BOOL antialias) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(%u): stub\n", This, antialias); + FIXME("iface %p, antialias %#x stub!\n", iface, antialias); return E_NOTIMPL; } -static BOOL WINAPI ID3DXLineImpl_GetAntialias(ID3DXLine* iface) +static BOOL WINAPI d3dx9_line_GetAntialias(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(): stub\n", This); + FIXME("iface %p stub!\n", iface); return FALSE; } -static HRESULT WINAPI ID3DXLineImpl_SetGLLines(ID3DXLine* iface, BOOL gl_lines) +static HRESULT WINAPI d3dx9_line_SetGLLines(ID3DXLine *iface, BOOL gl_lines) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(%u): stub\n", This, gl_lines); + FIXME("iface %p, gl_lines %#x stub!\n", iface, gl_lines); return E_NOTIMPL; } -static BOOL WINAPI ID3DXLineImpl_GetGLLines(ID3DXLine* iface) +static BOOL WINAPI d3dx9_line_GetGLLines(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(): stub\n", This); + FIXME("iface %p stub!\n", iface); return FALSE; } -static HRESULT WINAPI ID3DXLineImpl_End(ID3DXLine* iface) +static HRESULT WINAPI d3dx9_line_End(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); + struct d3dx9_line *line = impl_from_ID3DXLine(iface); HRESULT hr; - TRACE ("(%p)->()\n", This); + TRACE("iface %p.\n", iface); - if (This->state == NULL) /* We haven't begun yet. */ + if (!line->state) return D3DERR_INVALIDCALL; - hr = IDirect3DStateBlock9_Apply(This->state); - IDirect3DStateBlock9_Release(This->state); - This->state = NULL; + hr = IDirect3DStateBlock9_Apply(line->state); + IDirect3DStateBlock9_Release(line->state); + line->state = NULL; - if (FAILED(hr)) return D3DXERR_INVALIDDATA; - else return D3D_OK; + if (FAILED(hr)) + return D3DXERR_INVALIDDATA; + + return D3D_OK; } -static HRESULT WINAPI ID3DXLineImpl_OnLostDevice(ID3DXLine* iface) +static HRESULT WINAPI d3dx9_line_OnLostDevice(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(): stub\n", This); + FIXME("iface %p stub!\n", iface); return E_NOTIMPL; } -static HRESULT WINAPI ID3DXLineImpl_OnResetDevice(ID3DXLine* iface) +static HRESULT WINAPI d3dx9_line_OnResetDevice(ID3DXLine *iface) { - ID3DXLineImpl *This = impl_from_ID3DXLine(iface); - - FIXME("(%p)->(): stub\n", This); + FIXME("iface %p stub!\n", iface); return E_NOTIMPL; } -static const struct ID3DXLineVtbl ID3DXLine_Vtbl = +static const struct ID3DXLineVtbl d3dx9_line_vtbl = { - /*** IUnknown methods ***/ - ID3DXLineImpl_QueryInterface, - ID3DXLineImpl_AddRef, - ID3DXLineImpl_Release, - /*** ID3DXLine methods ***/ - ID3DXLineImpl_GetDevice, - ID3DXLineImpl_Begin, - ID3DXLineImpl_Draw, - ID3DXLineImpl_DrawTransform, - ID3DXLineImpl_SetPattern, - ID3DXLineImpl_GetPattern, - ID3DXLineImpl_SetPatternScale, - ID3DXLineImpl_GetPatternScale, - ID3DXLineImpl_SetWidth, - ID3DXLineImpl_GetWidth, - ID3DXLineImpl_SetAntialias, - ID3DXLineImpl_GetAntialias, - ID3DXLineImpl_SetGLLines, - ID3DXLineImpl_GetGLLines, - ID3DXLineImpl_End, - ID3DXLineImpl_OnLostDevice, - ID3DXLineImpl_OnResetDevice + d3dx9_line_QueryInterface, + d3dx9_line_AddRef, + d3dx9_line_Release, + d3dx9_line_GetDevice, + d3dx9_line_Begin, + d3dx9_line_Draw, + d3dx9_line_DrawTransform, + d3dx9_line_SetPattern, + d3dx9_line_GetPattern, + d3dx9_line_SetPatternScale, + d3dx9_line_GetPatternScale, + d3dx9_line_SetWidth, + d3dx9_line_GetWidth, + d3dx9_line_SetAntialias, + d3dx9_line_GetAntialias, + d3dx9_line_SetGLLines, + d3dx9_line_GetGLLines, + d3dx9_line_End, + d3dx9_line_OnLostDevice, + d3dx9_line_OnResetDevice, }; HRESULT WINAPI D3DXCreateLine(struct IDirect3DDevice9 *device, struct ID3DXLine **line) { - ID3DXLineImpl* object; + struct d3dx9_line *object; - TRACE("(%p, %p)\n", device, line); + TRACE("device %p, line %p.\n", device, line); if (!device || !line) return D3DERR_INVALIDCALL; - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXLineImpl)); - if (!object) + if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; - object->ID3DXLine_iface.lpVtbl = &ID3DXLine_Vtbl; + object->ID3DXLine_iface.lpVtbl = &d3dx9_line_vtbl; object->ref = 1; object->device = device; - object->state = NULL; /* We only initialize it on Begin */ IDirect3DDevice9_AddRef(device); *line = &object->ID3DXLine_iface; diff --git a/reactos/dll/directx/wine/d3dx9_36/math.c b/reactos/dll/directx/wine/d3dx9_36/math.c index e168062eb86..2e1182116bd 100644 --- a/reactos/dll/directx/wine/d3dx9_36/math.c +++ b/reactos/dll/directx/wine/d3dx9_36/math.c @@ -155,7 +155,7 @@ D3DXMATRIX * WINAPI D3DXMatrixAffineTransformation2D(D3DXMATRIX *out, FLOAT scal s = sinf(rotation / 2.0f); tmp1 = 1.0f - 2.0f * s * s; - tmp2 = 2.0 * s * cosf(rotation / 2.0f); + tmp2 = 2.0f * s * cosf(rotation / 2.0f); D3DXMatrixIdentity(out); out->u.m[0][0] = scaling * tmp1; @@ -480,8 +480,8 @@ D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH(D3DXMATRIX *pout, FLOAT fovy, FLOA TRACE("pout %p, fovy %f, aspect %f, zn %f, zf %f\n", pout, fovy, aspect, zn, zf); D3DXMatrixIdentity(pout); - pout->u.m[0][0] = 1.0f / (aspect * tan(fovy/2.0f)); - pout->u.m[1][1] = 1.0f / tan(fovy/2.0f); + pout->u.m[0][0] = 1.0f / (aspect * tanf(fovy/2.0f)); + pout->u.m[1][1] = 1.0f / tanf(fovy/2.0f); pout->u.m[2][2] = zf / (zf - zn); pout->u.m[2][3] = 1.0f; pout->u.m[3][2] = (zf * zn) / (zn - zf); @@ -494,8 +494,8 @@ D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH(D3DXMATRIX *pout, FLOAT fovy, FLOA TRACE("pout %p, fovy %f, aspect %f, zn %f, zf %f\n", pout, fovy, aspect, zn, zf); D3DXMatrixIdentity(pout); - pout->u.m[0][0] = 1.0f / (aspect * tan(fovy/2.0f)); - pout->u.m[1][1] = 1.0f / tan(fovy/2.0f); + pout->u.m[0][0] = 1.0f / (aspect * tanf(fovy/2.0f)); + pout->u.m[1][1] = 1.0f / tanf(fovy/2.0f); pout->u.m[2][2] = zf / (zn - zf); pout->u.m[2][3] = -1.0f; pout->u.m[3][2] = (zf * zn) / (zn - zf); @@ -640,10 +640,10 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle) TRACE("pout %p, angle %f\n", pout, angle); D3DXMatrixIdentity(pout); - pout->u.m[1][1] = cos(angle); - pout->u.m[2][2] = cos(angle); - pout->u.m[1][2] = sin(angle); - pout->u.m[2][1] = -sin(angle); + pout->u.m[1][1] = cosf(angle); + pout->u.m[2][2] = cosf(angle); + pout->u.m[1][2] = sinf(angle); + pout->u.m[2][1] = -sinf(angle); return pout; } @@ -652,10 +652,10 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle) TRACE("pout %p, angle %f\n", pout, angle); D3DXMatrixIdentity(pout); - pout->u.m[0][0] = cos(angle); - pout->u.m[2][2] = cos(angle); - pout->u.m[0][2] = -sin(angle); - pout->u.m[2][0] = sin(angle); + pout->u.m[0][0] = cosf(angle); + pout->u.m[2][2] = cosf(angle); + pout->u.m[0][2] = -sinf(angle); + pout->u.m[2][0] = sinf(angle); return pout; } @@ -697,10 +697,10 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle) TRACE("pout %p, angle %f\n", pout, angle); D3DXMatrixIdentity(pout); - pout->u.m[0][0] = cos(angle); - pout->u.m[1][1] = cos(angle); - pout->u.m[0][1] = sin(angle); - pout->u.m[1][0] = -sin(angle); + pout->u.m[0][0] = cosf(angle); + pout->u.m[1][1] = cosf(angle); + pout->u.m[0][1] = sinf(angle); + pout->u.m[1][0] = -sinf(angle); return pout; } @@ -881,15 +881,15 @@ D3DXMATRIX* WINAPI D3DXMatrixTransformation2D(D3DXMATRIX *pout, const D3DXVECTOR trans.z=0.0f; } - rot.w=cos(rotation/2.0f); + rot.w=cosf(rotation/2.0f); rot.x=0.0f; rot.y=0.0f; - rot.z=sin(rotation/2.0f); + rot.z=sinf(rotation/2.0f); - sca_rot.w=cos(scalingrotation/2.0f); + sca_rot.w=cosf(scalingrotation/2.0f); sca_rot.x=0.0f; sca_rot.y=0.0f; - sca_rot.z=sin(scalingrotation/2.0f); + sca_rot.z=sinf(scalingrotation/2.0f); D3DXMatrixTransformation(pout, &sca_center, &sca_rot, &sca, &rot_center, &rot, &trans); @@ -1648,7 +1648,7 @@ void WINAPI D3DXQuaternionToAxisAngle(const D3DXQUATERNION *pq, D3DXVECTOR3 *pax paxis->x = pq->x; paxis->y = pq->y; paxis->z = pq->z; - *pangle = 2.0f * acos(pq->w); + *pangle = 2.0f * acosf(pq->w); } /*_________________D3DXVec2_____________________*/ @@ -2121,7 +2121,7 @@ D3DXVECTOR4* WINAPI D3DXVec4TransformArray(D3DXVECTOR4* out, UINT outstride, con unsigned short float_32_to_16(const float in) { int exp = 0, origexp; - float tmp = fabs(in); + float tmp = fabsf(in); int sign = (copysignf(1, in) < 0); unsigned int mantissa; unsigned short ret; @@ -2219,7 +2219,7 @@ D3DXFLOAT16 *WINAPI D3DXFloat32To16Array(D3DXFLOAT16 *pout, const FLOAT *pin, UI /* Native d3dx9's D3DXFloat16to32Array lacks support for NaN and Inf. Specifically, e = 16 is treated as a * regular number - e.g., 0x7fff is converted to 131008.0 and 0xffff to -131008.0. */ -static inline float float_16_to_32(const unsigned short in) +float float_16_to_32(const unsigned short in) { const unsigned short s = (in & 0x8000); const unsigned short e = (in & 0x7C00) >> 10; @@ -2279,7 +2279,7 @@ FLOAT WINAPI D3DXSHDot(UINT order, const FLOAT *a, const FLOAT *b) return s; } -static void weightedcapintegrale(FLOAT *out, FLOAT order, FLOAT angle) +static void weightedcapintegrale(FLOAT *out, UINT order, FLOAT angle) { FLOAT coeff[3]; @@ -2387,9 +2387,9 @@ FLOAT* WINAPI D3DXSHEvalDirection(FLOAT *out, UINT order, const D3DXVECTOR3 *dir out[9] = -sqrtf(70.0f / D3DX_PI) / 8.0f * dir->y * (3.0f * dirxx - diryy); out[10] = sqrtf(105.0f / D3DX_PI) / 2.0f * dirxy * dir->z; - out[11] = -sqrtf(42.0 / D3DX_PI) / 8.0f * dir->y * (-1.0f + 5.0f * dirzz); + out[11] = -sqrtf(42.0f / D3DX_PI) / 8.0f * dir->y * (-1.0f + 5.0f * dirzz); out[12] = sqrtf(7.0f / D3DX_PI) / 4.0f * dir->z * (5.0f * dirzz - 3.0f); - out[13] = sqrtf(42.0 / D3DX_PI) / 8.0f * dir->x * (1.0f - 5.0f * dirzz); + out[13] = sqrtf(42.0f / D3DX_PI) / 8.0f * dir->x * (1.0f - 5.0f * dirzz); out[14] = sqrtf(105.0f / D3DX_PI) / 4.0f * dir->z * (dirxx - diryy); out[15] = -sqrtf(70.0f / D3DX_PI) / 8.0f * dir->x * (dirxx - 3.0f * diryy); if (order == 4) @@ -2402,7 +2402,7 @@ FLOAT* WINAPI D3DXSHEvalDirection(FLOAT *out, UINT order, const D3DXVECTOR3 *dir out[20] = 3.0f / (16.0f * sqrtf(D3DX_PI)) * (35.0f * dirzzzz - 30.f * dirzz + 3.0f); out[21] = 0.375f * sqrtf(10.0f / D3DX_PI) * dirxz * (3.0f - 7.0f * dirzz); out[22] = 0.375f * sqrtf(5.0f / D3DX_PI) * (dirxx - diryy) * (7.0f * dirzz - 1.0f); - out[23] = 3.0 * dir->z * out[15]; + out[23] = 3.0f * dir->z * out[15]; out[24] = 3.0f / 16.0f * sqrtf(35.0f / D3DX_PI) * (dirxxxx - 6.0f * dirxyxy + diryyyy); if (order == 5) return out; @@ -2416,7 +2416,7 @@ FLOAT* WINAPI D3DXSHEvalDirection(FLOAT *out, UINT order, const D3DXVECTOR3 *dir out[31] = sqrtf(165.0f / D3DX_PI) / 16.0f * dir->x * (14.0f * dirzz - 21.0f * dirzzzz - 1.0f); out[32] = sqrtf(1155.0f / D3DX_PI) / 8.0f * dir->z * (dirxx - diryy) * (3.0f * dirzz - 1.0f); out[33] = sqrtf(770.0f / D3DX_PI) / 32.0f * dir->x * (dirxx - 3.0f * diryy) * (1.0f - 9.0f * dirzz); - out[34] = 3.0f / 16.0f * sqrtf(385.0f / D3DX_PI) * dir->z * (dirxxxx - 6.0 * dirxyxy + diryyyy); + out[34] = 3.0f / 16.0f * sqrtf(385.0f / D3DX_PI) * dir->z * (dirxxxx - 6.0f * dirxyxy + diryyyy); out[35] = -3.0f/ 32.0f * sqrtf(154.0f / D3DX_PI) * dir->x * (dirxxxx - 10.0f * dirxyxy + 5.0f * diryyyy); return out; @@ -2622,8 +2622,8 @@ FLOAT * WINAPI D3DXSHMultiply3(FLOAT *out, const FLOAT *a, const FLOAT *b) t = a[4] * b[5] + a[5] * b[4]; out[7] += 0.15607834f * t; - ta = 0.28209479f * a[0] + 0.09011186 * a[6] - 0.15607835f * a[8]; - tb = 0.28209479f * b[0] + 0.09011186 * b[6] - 0.15607835f * b[8]; + ta = 0.28209479f * a[0] + 0.09011186f * a[6] - 0.15607835f * a[8]; + tb = 0.28209479f * b[0] + 0.09011186f * b[6] - 0.15607835f * b[8]; out[5] += ta * b[5] + tb * a[5]; t = a[5] * b[5]; out[0] += 0.28209479f * t; @@ -2637,8 +2637,8 @@ FLOAT * WINAPI D3DXSHMultiply3(FLOAT *out, const FLOAT *a, const FLOAT *b) out[0] += 0.28209480f * t; out[6] += 0.18022376f * t; - ta = 0.28209479f * a[0] + 0.09011186 * a[6] + 0.15607835f * a[8]; - tb = 0.28209479f * b[0] + 0.09011186 * b[6] + 0.15607835f * b[8]; + ta = 0.28209479f * a[0] + 0.09011186f * a[6] + 0.15607835f * a[8]; + tb = 0.28209479f * b[0] + 0.09011186f * b[6] + 0.15607835f * b[8]; out[7] += ta * b[7] + tb * a[7]; t = a[7] * b[7]; out[0] += 0.28209479f * t; @@ -2981,7 +2981,7 @@ static void rotate_X(FLOAT *out, UINT order, FLOAT a, FLOAT *in) out[25] = a * 0.7015607357f * in[30] - a * 0.6846531630f * in[32] + a * 0.1976423711f * in[34]; out[26] = -0.5f * in[26] + 0.8660253882f * in[28]; - out[27] = a * 0.5229125023f * in[30] + a * 0.3061861992f * in[32] - a * 0.7954951525 * in[34]; + out[27] = a * 0.5229125023f * in[30] + a * 0.3061861992f * in[32] - a * 0.7954951525f * in[34]; out[28] = 0.8660253882f * in[26] + 0.5f * in[28]; out[29] = a * 0.4841229022f * in[30] + a * 0.6614378691f * in[32] + a * 0.5728219748f * in[34]; out[30] = -a * 0.7015607357f * in[25] - a * 0.5229125023f * in[27] - a * 0.4841229022f * in[29]; diff --git a/reactos/dll/directx/wine/d3dx9_36/mesh.c b/reactos/dll/directx/wine/d3dx9_36/mesh.c index ba9755284a0..aa74c7afb23 100644 --- a/reactos/dll/directx/wine/d3dx9_36/mesh.c +++ b/reactos/dll/directx/wine/d3dx9_36/mesh.c @@ -37,9 +37,7 @@ #include "rmxftmpl.h" #include "wine/list.h" -#define fmax(a, b) ((a) > (b) ? (a) : (b)) - -typedef struct ID3DXMeshImpl +struct d3dx9_mesh { ID3DXMesh ID3DXMesh_iface; LONG ref; @@ -59,7 +57,7 @@ typedef struct ID3DXMeshImpl int attrib_buffer_lock_count; DWORD attrib_table_size; D3DXATTRIBUTERANGE *attrib_table; -} ID3DXMeshImpl; +}; const UINT d3dx_decltype_size[] = { @@ -82,21 +80,21 @@ const UINT d3dx_decltype_size[] = /* D3DDECLTYPE_FLOAT16_4 */ 4 * sizeof(D3DXFLOAT16), }; -static inline ID3DXMeshImpl *impl_from_ID3DXMesh(ID3DXMesh *iface) +static inline struct d3dx9_mesh *impl_from_ID3DXMesh(ID3DXMesh *iface) { - return CONTAINING_RECORD(iface, ID3DXMeshImpl, ID3DXMesh_iface); + return CONTAINING_RECORD(iface, struct d3dx9_mesh, ID3DXMesh_iface); } -static HRESULT WINAPI ID3DXMeshImpl_QueryInterface(ID3DXMesh *iface, REFIID riid, LPVOID *object) +static HRESULT WINAPI d3dx9_mesh_QueryInterface(ID3DXMesh *iface, REFIID riid, void **out) { - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), object); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ID3DXBaseMesh) || IsEqualGUID(riid, &IID_ID3DXMesh)) { iface->lpVtbl->AddRef(iface); - *object = iface; + *out = iface; return S_OK; } @@ -105,47 +103,47 @@ static HRESULT WINAPI ID3DXMeshImpl_QueryInterface(ID3DXMesh *iface, REFIID riid return E_NOINTERFACE; } -static ULONG WINAPI ID3DXMeshImpl_AddRef(ID3DXMesh *iface) +static ULONG WINAPI d3dx9_mesh_AddRef(ID3DXMesh *iface) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); + ULONG refcount = InterlockedIncrement(&mesh->ref); - TRACE("(%p)->(): AddRef from %d\n", This, This->ref); + TRACE("%p increasing refcount to %u.\n", mesh, refcount); - return InterlockedIncrement(&This->ref); + return refcount; } -static ULONG WINAPI ID3DXMeshImpl_Release(ID3DXMesh *iface) +static ULONG WINAPI d3dx9_mesh_Release(ID3DXMesh *iface) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); - ULONG ref = InterlockedDecrement(&This->ref); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); + ULONG refcount = InterlockedDecrement(&mesh->ref); - TRACE("(%p)->(): Release from %d\n", This, ref + 1); + TRACE("%p decreasing refcount to %u.\n", mesh, refcount); - if (!ref) + if (!refcount) { - IDirect3DIndexBuffer9_Release(This->index_buffer); - IDirect3DVertexBuffer9_Release(This->vertex_buffer); - if (This->vertex_declaration) - IDirect3DVertexDeclaration9_Release(This->vertex_declaration); - IDirect3DDevice9_Release(This->device); - HeapFree(GetProcessHeap(), 0, This->attrib_buffer); - HeapFree(GetProcessHeap(), 0, This->attrib_table); - HeapFree(GetProcessHeap(), 0, This); + IDirect3DIndexBuffer9_Release(mesh->index_buffer); + IDirect3DVertexBuffer9_Release(mesh->vertex_buffer); + if (mesh->vertex_declaration) + IDirect3DVertexDeclaration9_Release(mesh->vertex_declaration); + IDirect3DDevice9_Release(mesh->device); + HeapFree(GetProcessHeap(), 0, mesh->attrib_buffer); + HeapFree(GetProcessHeap(), 0, mesh->attrib_table); + HeapFree(GetProcessHeap(), 0, mesh); } - return ref; + return refcount; } -/*** ID3DXBaseMesh ***/ -static HRESULT WINAPI ID3DXMeshImpl_DrawSubset(ID3DXMesh *iface, DWORD attrib_id) +static HRESULT WINAPI d3dx9_mesh_DrawSubset(ID3DXMesh *iface, DWORD attrib_id) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *This = impl_from_ID3DXMesh(iface); HRESULT hr; DWORD face_start; DWORD face_end = 0; DWORD vertex_size; - TRACE("(%p)->(%u)\n", This, attrib_id); + TRACE("iface %p, attrib_id %u.\n", iface, attrib_id); if (!This->vertex_declaration) { @@ -185,31 +183,31 @@ static HRESULT WINAPI ID3DXMeshImpl_DrawSubset(ID3DXMesh *iface, DWORD attrib_id return D3D_OK; } -static DWORD WINAPI ID3DXMeshImpl_GetNumFaces(ID3DXMesh *iface) +static DWORD WINAPI d3dx9_mesh_GetNumFaces(ID3DXMesh *iface) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)\n", This); + TRACE("iface %p.\n", iface); - return This->numfaces; + return mesh->numfaces; } -static DWORD WINAPI ID3DXMeshImpl_GetNumVertices(ID3DXMesh *iface) +static DWORD WINAPI d3dx9_mesh_GetNumVertices(ID3DXMesh *iface) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)\n", This); + TRACE("iface %p.\n", iface); - return This->numvertices; + return mesh->numvertices; } -static DWORD WINAPI ID3DXMeshImpl_GetFVF(ID3DXMesh *iface) +static DWORD WINAPI d3dx9_mesh_GetFVF(ID3DXMesh *iface) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)\n", This); + TRACE("iface %p.\n", iface); - return This->fvf; + return mesh->fvf; } static void copy_declaration(D3DVERTEXELEMENT9 *dst, const D3DVERTEXELEMENT9 *src, UINT num_elem) @@ -217,61 +215,63 @@ static void copy_declaration(D3DVERTEXELEMENT9 *dst, const D3DVERTEXELEMENT9 *sr memcpy(dst, src, num_elem * sizeof(*src)); } -static HRESULT WINAPI ID3DXMeshImpl_GetDeclaration(ID3DXMesh *iface, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) +static HRESULT WINAPI d3dx9_mesh_GetDeclaration(ID3DXMesh *iface, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)\n", This); + TRACE("iface %p, declaration %p.\n", iface, declaration); - if (declaration == NULL) return D3DERR_INVALIDCALL; + if (!declaration) + return D3DERR_INVALIDCALL; - copy_declaration(declaration, This->cached_declaration, This->num_elem); + copy_declaration(declaration, mesh->cached_declaration, mesh->num_elem); return D3D_OK; } -static DWORD WINAPI ID3DXMeshImpl_GetNumBytesPerVertex(ID3DXMesh *iface) +static DWORD WINAPI d3dx9_mesh_GetNumBytesPerVertex(ID3DXMesh *iface) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("iface (%p)\n", This); + TRACE("iface %p.\n", iface); - return This->vertex_declaration_size; + return mesh->vertex_declaration_size; } -static DWORD WINAPI ID3DXMeshImpl_GetOptions(ID3DXMesh *iface) +static DWORD WINAPI d3dx9_mesh_GetOptions(ID3DXMesh *iface) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)\n", This); + TRACE("iface %p.\n", iface); - return This->options; + return mesh->options; } -static HRESULT WINAPI ID3DXMeshImpl_GetDevice(struct ID3DXMesh *iface, struct IDirect3DDevice9 **device) +static HRESULT WINAPI d3dx9_mesh_GetDevice(struct ID3DXMesh *iface, struct IDirect3DDevice9 **device) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)->(%p)\n", This, device); + TRACE("iface %p, device %p.\n", iface, device); - if (device == NULL) return D3DERR_INVALIDCALL; - *device = This->device; - IDirect3DDevice9_AddRef(This->device); + if (!device) + return D3DERR_INVALIDCALL; + *device = mesh->device; + IDirect3DDevice9_AddRef(mesh->device); return D3D_OK; } -static HRESULT WINAPI ID3DXMeshImpl_CloneMeshFVF(struct ID3DXMesh *iface, DWORD options, DWORD fvf, +static HRESULT WINAPI d3dx9_mesh_CloneMeshFVF(struct ID3DXMesh *iface, DWORD options, DWORD fvf, struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); HRESULT hr; D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]; - TRACE("(%p)->(%x,%x,%p,%p)\n", This, options, fvf, device, clone_mesh); + TRACE("iface %p, options %#x, fvf %#x, device %p, clone_mesh %p.\n", + iface, options, fvf, device, clone_mesh); - hr = D3DXDeclaratorFromFVF(fvf, declaration); - if (FAILED(hr)) return hr; + if (FAILED(hr = D3DXDeclaratorFromFVF(fvf, declaration))) + return hr; return iface->lpVtbl->CloneMesh(iface, options, declaration, device, clone_mesh); } @@ -336,7 +336,7 @@ static INT simple_round(FLOAT value) return res; } -static void convert_float4(BYTE *dst, CONST D3DXVECTOR4 *src, D3DDECLTYPE type_dst) +static void convert_float4(BYTE *dst, const D3DXVECTOR4 *src, D3DDECLTYPE type_dst) { BOOL fixme_once = FALSE; @@ -650,7 +650,7 @@ cleanup: return hr; } -static BOOL declaration_equals(CONST D3DVERTEXELEMENT9 *declaration1, CONST D3DVERTEXELEMENT9 *declaration2) +static BOOL declaration_equals(const D3DVERTEXELEMENT9 *declaration1, const D3DVERTEXELEMENT9 *declaration2) { UINT size1 = 0, size2 = 0; @@ -669,11 +669,11 @@ static BOOL declaration_equals(CONST D3DVERTEXELEMENT9 *declaration1, CONST D3DV return FALSE; } -static HRESULT WINAPI ID3DXMeshImpl_CloneMesh(struct ID3DXMesh *iface, DWORD options, +static HRESULT WINAPI d3dx9_mesh_CloneMesh(struct ID3DXMesh *iface, DWORD options, const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh_out) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); - ID3DXMeshImpl *cloned_this; + struct d3dx9_mesh *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *cloned_this; ID3DXMesh *clone_mesh; D3DVERTEXELEMENT9 orig_declaration[MAX_FVF_DECL_SIZE] = { D3DDECL_END() }; void *data_in, *data_out; @@ -681,7 +681,8 @@ static HRESULT WINAPI ID3DXMeshImpl_CloneMesh(struct ID3DXMesh *iface, DWORD opt HRESULT hr; BOOL same_declaration; - TRACE("(%p)->(%x,%p,%p,%p)\n", This, options, declaration, device, clone_mesh_out); + TRACE("iface %p, options %#x, declaration %p, device %p, clone_mesh_out %p.\n", + iface, options, declaration, device, clone_mesh_out); if (!clone_mesh_out) return D3DERR_INVALIDCALL; @@ -765,81 +766,87 @@ error: return hr; } -static HRESULT WINAPI ID3DXMeshImpl_GetVertexBuffer(struct ID3DXMesh *iface, +static HRESULT WINAPI d3dx9_mesh_GetVertexBuffer(struct ID3DXMesh *iface, struct IDirect3DVertexBuffer9 **vertex_buffer) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)->(%p)\n", This, vertex_buffer); + TRACE("iface %p, vertex_buffer %p.\n", iface, vertex_buffer); - if (vertex_buffer == NULL) return D3DERR_INVALIDCALL; - *vertex_buffer = This->vertex_buffer; - IDirect3DVertexBuffer9_AddRef(This->vertex_buffer); + if (!vertex_buffer) + return D3DERR_INVALIDCALL; + *vertex_buffer = mesh->vertex_buffer; + IDirect3DVertexBuffer9_AddRef(mesh->vertex_buffer); return D3D_OK; } -static HRESULT WINAPI ID3DXMeshImpl_GetIndexBuffer(struct ID3DXMesh *iface, +static HRESULT WINAPI d3dx9_mesh_GetIndexBuffer(struct ID3DXMesh *iface, struct IDirect3DIndexBuffer9 **index_buffer) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)->(%p)\n", This, index_buffer); + TRACE("iface %p, index_buffer %p.\n", iface, index_buffer); - if (index_buffer == NULL) return D3DERR_INVALIDCALL; - *index_buffer = This->index_buffer; - IDirect3DIndexBuffer9_AddRef(This->index_buffer); + if (!index_buffer) + return D3DERR_INVALIDCALL; + *index_buffer = mesh->index_buffer; + IDirect3DIndexBuffer9_AddRef(mesh->index_buffer); return D3D_OK; } -static HRESULT WINAPI ID3DXMeshImpl_LockVertexBuffer(ID3DXMesh *iface, DWORD flags, LPVOID *data) +static HRESULT WINAPI d3dx9_mesh_LockVertexBuffer(ID3DXMesh *iface, DWORD flags, void **data) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)->(%u,%p)\n", This, flags, data); + TRACE("iface %p, flags %#x, data %p.\n", iface, flags, data); - return IDirect3DVertexBuffer9_Lock(This->vertex_buffer, 0, 0, data, flags); + return IDirect3DVertexBuffer9_Lock(mesh->vertex_buffer, 0, 0, data, flags); } -static HRESULT WINAPI ID3DXMeshImpl_UnlockVertexBuffer(ID3DXMesh *iface) +static HRESULT WINAPI d3dx9_mesh_UnlockVertexBuffer(ID3DXMesh *iface) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)\n", This); + TRACE("iface %p.\n", iface); - return IDirect3DVertexBuffer9_Unlock(This->vertex_buffer); + return IDirect3DVertexBuffer9_Unlock(mesh->vertex_buffer); } -static HRESULT WINAPI ID3DXMeshImpl_LockIndexBuffer(ID3DXMesh *iface, DWORD flags, LPVOID *data) +static HRESULT WINAPI d3dx9_mesh_LockIndexBuffer(ID3DXMesh *iface, DWORD flags, void **data) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)->(%u,%p)\n", This, flags, data); + TRACE("iface %p, flags %#x, data %p.\n", iface, flags, data); - return IDirect3DIndexBuffer9_Lock(This->index_buffer, 0, 0, data, flags); + return IDirect3DIndexBuffer9_Lock(mesh->index_buffer, 0, 0, data, flags); } -static HRESULT WINAPI ID3DXMeshImpl_UnlockIndexBuffer(ID3DXMesh *iface) +static HRESULT WINAPI d3dx9_mesh_UnlockIndexBuffer(ID3DXMesh *iface) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)\n", This); + TRACE("iface %p.\n", iface); - return IDirect3DIndexBuffer9_Unlock(This->index_buffer); + return IDirect3DIndexBuffer9_Unlock(mesh->index_buffer); } -static HRESULT WINAPI ID3DXMeshImpl_GetAttributeTable(ID3DXMesh *iface, D3DXATTRIBUTERANGE *attrib_table, DWORD *attrib_table_size) +/* FIXME: This looks just wrong, we never check *attrib_table_size before + * copying the data. */ +static HRESULT WINAPI d3dx9_mesh_GetAttributeTable(ID3DXMesh *iface, + D3DXATTRIBUTERANGE *attrib_table, DWORD *attrib_table_size) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)->(%p,%p)\n", This, attrib_table, attrib_table_size); + TRACE("iface %p, attrib_table %p, attrib_table_size %p.\n", + iface, attrib_table, attrib_table_size); if (attrib_table_size) - *attrib_table_size = This->attrib_table_size; + *attrib_table_size = mesh->attrib_table_size; if (attrib_table) - CopyMemory(attrib_table, This->attrib_table, This->attrib_table_size * sizeof(*attrib_table)); + memcpy(attrib_table, mesh->attrib_table, mesh->attrib_table_size * sizeof(*attrib_table)); return D3D_OK; } @@ -867,7 +874,8 @@ struct edge_face_map * is at most one edge to face mapping, i.e. an edge can only belong to one * face. */ -static HRESULT init_edge_face_map(struct edge_face_map *edge_face_map, CONST DWORD *index_buffer, CONST DWORD *point_reps, CONST DWORD num_faces) +static HRESULT init_edge_face_map(struct edge_face_map *edge_face_map, const DWORD *index_buffer, + const DWORD *point_reps, DWORD num_faces) { DWORD face, edge; DWORD i; @@ -907,7 +915,7 @@ static HRESULT init_edge_face_map(struct edge_face_map *edge_face_map, CONST DWO return D3D_OK; } -static DWORD find_adjacent_face(struct edge_face_map *edge_face_map, DWORD vertex1, DWORD vertex2, CONST DWORD num_faces) +static DWORD find_adjacent_face(struct edge_face_map *edge_face_map, DWORD vertex1, DWORD vertex2, DWORD num_faces) { struct edge_face *edge_face_ptr; @@ -937,9 +945,9 @@ static DWORD *generate_identity_point_reps(DWORD num_vertices) return id_point_reps; } -static HRESULT WINAPI ID3DXMeshImpl_ConvertPointRepsToAdjacency(ID3DXMesh *iface, CONST DWORD *point_reps, DWORD *adjacency) +static HRESULT WINAPI d3dx9_mesh_ConvertPointRepsToAdjacency(ID3DXMesh *iface, + const DWORD *point_reps, DWORD *adjacency) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); HRESULT hr; DWORD num_faces = iface->lpVtbl->GetNumFaces(iface); DWORD num_vertices = iface->lpVtbl->GetNumVertices(iface); @@ -950,10 +958,10 @@ static HRESULT WINAPI ID3DXMeshImpl_ConvertPointRepsToAdjacency(ID3DXMesh *iface DWORD face; DWORD edge; struct edge_face_map edge_face_map = {0}; - CONST DWORD *point_reps_ptr = NULL; + const DWORD *point_reps_ptr = NULL; DWORD *id_point_reps = NULL; - TRACE("(%p)->(%p,%p)\n", This, point_reps, adjacency); + TRACE("iface %p, point_reps %p, adjacency %p.\n", iface, point_reps, adjacency); if (!adjacency) return D3DERR_INVALIDCALL; @@ -1038,9 +1046,8 @@ cleanup: * vertex 5 is replaced by vertex 3 then index 5 would contain 3. If no vertex * replaces it, then it contains the same number as the index itself, e.g. * index 5 would contain 5. */ -static HRESULT propagate_face_vertices(CONST DWORD *adjacency, DWORD *point_reps, - CONST DWORD *indices, DWORD *new_indices, - CONST DWORD face, CONST DWORD numfaces) +static HRESULT propagate_face_vertices(const DWORD *adjacency, DWORD *point_reps, + const DWORD *indices, DWORD *new_indices, DWORD face, DWORD numfaces) { const unsigned int VERTS_PER_FACE = 3; DWORD edge, opp_edge; @@ -1088,8 +1095,10 @@ static HRESULT propagate_face_vertices(CONST DWORD *adjacency, DWORD *point_reps return D3D_OK; } -static HRESULT WINAPI ID3DXMeshImpl_ConvertAdjacencyToPointReps(ID3DXMesh *iface, CONST DWORD *adjacency, DWORD *point_reps) +static HRESULT WINAPI d3dx9_mesh_ConvertAdjacencyToPointReps(ID3DXMesh *iface, + const DWORD *adjacency, DWORD *point_reps) { + struct d3dx9_mesh *This = impl_from_ID3DXMesh(iface); HRESULT hr; DWORD face; DWORD i; @@ -1098,9 +1107,7 @@ static HRESULT WINAPI ID3DXMeshImpl_ConvertAdjacencyToPointReps(ID3DXMesh *iface DWORD *new_indices = NULL; const unsigned int VERTS_PER_FACE = 3; - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); - - TRACE("(%p)->(%p,%p)\n", This, adjacency, point_reps); + TRACE("iface %p, adjacency %p, point_reps %p.\n", iface, adjacency, point_reps); if (!adjacency) { @@ -1209,9 +1216,9 @@ static int compare_vertex_keys(const void *a, const void *b) return left->key < right->key ? -1 : 1; } -static HRESULT WINAPI ID3DXMeshImpl_GenerateAdjacency(ID3DXMesh *iface, FLOAT epsilon, DWORD *adjacency) +static HRESULT WINAPI d3dx9_mesh_GenerateAdjacency(ID3DXMesh *iface, float epsilon, DWORD *adjacency) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *This = impl_from_ID3DXMesh(iface); HRESULT hr; BYTE *vertices = NULL; const DWORD *indices = NULL; @@ -1225,7 +1232,7 @@ static HRESULT WINAPI ID3DXMeshImpl_GenerateAdjacency(ID3DXMesh *iface, FLOAT ep const FLOAT epsilon_sq = epsilon * epsilon; DWORD i; - TRACE("(%p)->(%f,%p)\n", This, epsilon, adjacency); + TRACE("iface %p, epsilon %.8e, adjacency %p.\n", iface, epsilon, adjacency); if (!adjacency) return D3DERR_INVALIDCALL; @@ -1355,14 +1362,14 @@ cleanup: return hr; } -static HRESULT WINAPI ID3DXMeshImpl_UpdateSemantics(ID3DXMesh *iface, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) +static HRESULT WINAPI d3dx9_mesh_UpdateSemantics(ID3DXMesh *iface, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) { + struct d3dx9_mesh *This = impl_from_ID3DXMesh(iface); HRESULT hr; - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); UINT vertex_declaration_size; int i; - TRACE("(%p)->(%p)\n", This, declaration); + TRACE("iface %p, declaration %p.\n", iface, declaration); if (!declaration) { @@ -1414,53 +1421,54 @@ static HRESULT WINAPI ID3DXMeshImpl_UpdateSemantics(ID3DXMesh *iface, D3DVERTEXE return D3D_OK; } -/*** ID3DXMesh ***/ -static HRESULT WINAPI ID3DXMeshImpl_LockAttributeBuffer(ID3DXMesh *iface, DWORD flags, DWORD **data) +static HRESULT WINAPI d3dx9_mesh_LockAttributeBuffer(ID3DXMesh *iface, DWORD flags, DWORD **data) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); - TRACE("(%p)->(%u,%p)\n", This, flags, data); + TRACE("iface %p, flags %#x, data %p.\n", iface, flags, data); - InterlockedIncrement(&This->attrib_buffer_lock_count); + InterlockedIncrement(&mesh->attrib_buffer_lock_count); - if (!(flags & D3DLOCK_READONLY)) { - D3DXATTRIBUTERANGE *attrib_table = This->attrib_table; - This->attrib_table_size = 0; - This->attrib_table = NULL; + if (!(flags & D3DLOCK_READONLY)) + { + D3DXATTRIBUTERANGE *attrib_table = mesh->attrib_table; + mesh->attrib_table_size = 0; + mesh->attrib_table = NULL; HeapFree(GetProcessHeap(), 0, attrib_table); } - *data = This->attrib_buffer; + *data = mesh->attrib_buffer; return D3D_OK; } -static HRESULT WINAPI ID3DXMeshImpl_UnlockAttributeBuffer(ID3DXMesh *iface) +static HRESULT WINAPI d3dx9_mesh_UnlockAttributeBuffer(ID3DXMesh *iface) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); int lock_count; - TRACE("(%p)\n", This); + TRACE("iface %p.\n", iface); - lock_count = InterlockedDecrement(&This->attrib_buffer_lock_count); - - if (lock_count < 0) { - InterlockedIncrement(&This->attrib_buffer_lock_count); + lock_count = InterlockedDecrement(&mesh->attrib_buffer_lock_count); + if (lock_count < 0) + { + InterlockedIncrement(&mesh->attrib_buffer_lock_count); return D3DERR_INVALIDCALL; } return D3D_OK; } -static HRESULT WINAPI ID3DXMeshImpl_Optimize(ID3DXMesh *iface, DWORD flags, const DWORD *adjacency_in, +static HRESULT WINAPI d3dx9_mesh_Optimize(ID3DXMesh *iface, DWORD flags, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap, ID3DXMesh **opt_mesh) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); HRESULT hr; D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE] = { D3DDECL_END() }; ID3DXMesh *optimized_mesh; - TRACE("(%p)->(%x,%p,%p,%p,%p,%p)\n", This, flags, adjacency_in, adjacency_out, face_remap, vertex_remap, opt_mesh); + TRACE("iface %p, flags %#x, adjacency_in %p, adjacency_out %p, face_remap %p, vertex_remap %p, opt_mesh %p.\n", + iface, flags, adjacency_in, adjacency_out, face_remap, vertex_remap, opt_mesh); if (!opt_mesh) return D3DERR_INVALIDCALL; @@ -1468,8 +1476,8 @@ static HRESULT WINAPI ID3DXMeshImpl_Optimize(ID3DXMesh *iface, DWORD flags, cons hr = iface->lpVtbl->GetDeclaration(iface, declaration); if (FAILED(hr)) return hr; - hr = iface->lpVtbl->CloneMesh(iface, This->options, declaration, This->device, &optimized_mesh); - if (FAILED(hr)) return hr; + if (FAILED(hr = iface->lpVtbl->CloneMesh(iface, mesh->options, declaration, mesh->device, &optimized_mesh))) + return hr; hr = optimized_mesh->lpVtbl->OptimizeInplace(optimized_mesh, flags, adjacency_in, adjacency_out, face_remap, vertex_remap); if (SUCCEEDED(hr)) @@ -1481,7 +1489,8 @@ static HRESULT WINAPI ID3DXMeshImpl_Optimize(ID3DXMesh *iface, DWORD flags, cons /* Creates a vertex_remap that removes unused vertices. * Indices are updated according to the vertex_remap. */ -static HRESULT compact_mesh(ID3DXMeshImpl *This, DWORD *indices, DWORD *new_num_vertices, ID3DXBuffer **vertex_remap) +static HRESULT compact_mesh(struct d3dx9_mesh *This, DWORD *indices, + DWORD *new_num_vertices, ID3DXBuffer **vertex_remap) { HRESULT hr; DWORD *vertex_remap_ptr; @@ -1590,18 +1599,23 @@ static int attrib_entry_compare(const DWORD **a, const DWORD **b) } /* Create face_remap, a new attribute buffer for attribute sort optimization. */ -static HRESULT remap_faces_for_attrsort(ID3DXMeshImpl *This, const DWORD *indices, - const DWORD *attrib_buffer, DWORD **sorted_attrib_buffer, DWORD **face_remap) +static HRESULT remap_faces_for_attrsort(struct d3dx9_mesh *This, const DWORD *indices, + DWORD *attrib_buffer, DWORD **sorted_attrib_buffer, DWORD **face_remap) { - const DWORD **sorted_attrib_ptr_buffer = NULL; + DWORD **sorted_attrib_ptr_buffer = NULL; DWORD i; - *face_remap = HeapAlloc(GetProcessHeap(), 0, This->numfaces * sizeof(**face_remap)); sorted_attrib_ptr_buffer = HeapAlloc(GetProcessHeap(), 0, This->numfaces * sizeof(*sorted_attrib_ptr_buffer)); - if (!*face_remap || !sorted_attrib_ptr_buffer) { + if (!sorted_attrib_ptr_buffer) + return E_OUTOFMEMORY; + + *face_remap = HeapAlloc(GetProcessHeap(), 0, This->numfaces * sizeof(**face_remap)); + if (!*face_remap) + { HeapFree(GetProcessHeap(), 0, sorted_attrib_ptr_buffer); return E_OUTOFMEMORY; } + for (i = 0; i < This->numfaces; i++) sorted_attrib_ptr_buffer[i] = &attrib_buffer[i]; qsort(sorted_attrib_ptr_buffer, This->numfaces, sizeof(*sorted_attrib_ptr_buffer), @@ -1621,10 +1635,10 @@ static HRESULT remap_faces_for_attrsort(ID3DXMeshImpl *This, const DWORD *indice return D3D_OK; } -static HRESULT WINAPI ID3DXMeshImpl_OptimizeInplace(ID3DXMesh *iface, DWORD flags, const DWORD *adjacency_in, +static HRESULT WINAPI d3dx9_mesh_OptimizeInplace(ID3DXMesh *iface, DWORD flags, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap_out, ID3DXBuffer **vertex_remap_out) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *This = impl_from_ID3DXMesh(iface); void *indices = NULL; DWORD *attrib_buffer = NULL; HRESULT hr; @@ -1637,7 +1651,8 @@ static HRESULT WINAPI ID3DXMeshImpl_OptimizeInplace(ID3DXMesh *iface, DWORD flag DWORD *sorted_attrib_buffer = NULL; DWORD i; - TRACE("(%p)->(%x,%p,%p,%p,%p)\n", This, flags, adjacency_in, adjacency_out, face_remap_out, vertex_remap_out); + TRACE("iface %p, flags %#x, adjacency_in %p, adjacency_out %p, face_remap_out %p, vertex_remap_out %p.\n", + iface, flags, adjacency_in, adjacency_out, face_remap_out, vertex_remap_out); if (!flags) return D3DERR_INVALIDCALL; @@ -1818,12 +1833,13 @@ cleanup: return hr; } -static HRESULT WINAPI ID3DXMeshImpl_SetAttributeTable(ID3DXMesh *iface, CONST D3DXATTRIBUTERANGE *attrib_table, DWORD attrib_table_size) +static HRESULT WINAPI d3dx9_mesh_SetAttributeTable(ID3DXMesh *iface, + const D3DXATTRIBUTERANGE *attrib_table, DWORD attrib_table_size) { - ID3DXMeshImpl *This = impl_from_ID3DXMesh(iface); + struct d3dx9_mesh *mesh = impl_from_ID3DXMesh(iface); D3DXATTRIBUTERANGE *new_table = NULL; - TRACE("(%p)->(%p,%u)\n", This, attrib_table, attrib_table_size); + TRACE("iface %p, attrib_table %p, attrib_table_size %u.\n", iface, attrib_table, attrib_table_size); if (attrib_table_size) { size_t size = attrib_table_size * sizeof(*attrib_table); @@ -1836,53 +1852,46 @@ static HRESULT WINAPI ID3DXMeshImpl_SetAttributeTable(ID3DXMesh *iface, CONST D3 } else if (attrib_table) { return D3DERR_INVALIDCALL; } - HeapFree(GetProcessHeap(), 0, This->attrib_table); - This->attrib_table = new_table; - This->attrib_table_size = attrib_table_size; + HeapFree(GetProcessHeap(), 0, mesh->attrib_table); + mesh->attrib_table = new_table; + mesh->attrib_table_size = attrib_table_size; return D3D_OK; } static const struct ID3DXMeshVtbl D3DXMesh_Vtbl = { - /*** IUnknown methods ***/ - ID3DXMeshImpl_QueryInterface, - ID3DXMeshImpl_AddRef, - ID3DXMeshImpl_Release, - /*** ID3DXBaseMesh ***/ - ID3DXMeshImpl_DrawSubset, - ID3DXMeshImpl_GetNumFaces, - ID3DXMeshImpl_GetNumVertices, - ID3DXMeshImpl_GetFVF, - ID3DXMeshImpl_GetDeclaration, - ID3DXMeshImpl_GetNumBytesPerVertex, - ID3DXMeshImpl_GetOptions, - ID3DXMeshImpl_GetDevice, - ID3DXMeshImpl_CloneMeshFVF, - ID3DXMeshImpl_CloneMesh, - ID3DXMeshImpl_GetVertexBuffer, - ID3DXMeshImpl_GetIndexBuffer, - ID3DXMeshImpl_LockVertexBuffer, - ID3DXMeshImpl_UnlockVertexBuffer, - ID3DXMeshImpl_LockIndexBuffer, - ID3DXMeshImpl_UnlockIndexBuffer, - ID3DXMeshImpl_GetAttributeTable, - ID3DXMeshImpl_ConvertPointRepsToAdjacency, - ID3DXMeshImpl_ConvertAdjacencyToPointReps, - ID3DXMeshImpl_GenerateAdjacency, - ID3DXMeshImpl_UpdateSemantics, - /*** ID3DXMesh ***/ - ID3DXMeshImpl_LockAttributeBuffer, - ID3DXMeshImpl_UnlockAttributeBuffer, - ID3DXMeshImpl_Optimize, - ID3DXMeshImpl_OptimizeInplace, - ID3DXMeshImpl_SetAttributeTable + d3dx9_mesh_QueryInterface, + d3dx9_mesh_AddRef, + d3dx9_mesh_Release, + d3dx9_mesh_DrawSubset, + d3dx9_mesh_GetNumFaces, + d3dx9_mesh_GetNumVertices, + d3dx9_mesh_GetFVF, + d3dx9_mesh_GetDeclaration, + d3dx9_mesh_GetNumBytesPerVertex, + d3dx9_mesh_GetOptions, + d3dx9_mesh_GetDevice, + d3dx9_mesh_CloneMeshFVF, + d3dx9_mesh_CloneMesh, + d3dx9_mesh_GetVertexBuffer, + d3dx9_mesh_GetIndexBuffer, + d3dx9_mesh_LockVertexBuffer, + d3dx9_mesh_UnlockVertexBuffer, + d3dx9_mesh_LockIndexBuffer, + d3dx9_mesh_UnlockIndexBuffer, + d3dx9_mesh_GetAttributeTable, + d3dx9_mesh_ConvertPointRepsToAdjacency, + d3dx9_mesh_ConvertAdjacencyToPointReps, + d3dx9_mesh_GenerateAdjacency, + d3dx9_mesh_UpdateSemantics, + d3dx9_mesh_LockAttributeBuffer, + d3dx9_mesh_UnlockAttributeBuffer, + d3dx9_mesh_Optimize, + d3dx9_mesh_OptimizeInplace, + d3dx9_mesh_SetAttributeTable, }; -/************************************************************************* - * D3DXBoxBoundProbe - */ -BOOL WINAPI D3DXBoxBoundProbe(CONST D3DXVECTOR3 *pmin, CONST D3DXVECTOR3 *pmax, CONST D3DXVECTOR3 *prayposition, CONST D3DXVECTOR3 *praydirection) /* Algorithm taken from the article: An Efficient and Robust Ray-Box Intersection Algorithm Amy Williams University of Utah @@ -1898,9 +1907,9 @@ This algorithm is free of patents or of copyrights, as confirmed by Peter Shirle Algorithm: Consider the box as the intersection of three slabs. Clip the ray against each slab, if there's anything left of the ray after we're -done we've got an intersection of the ray with the box. -*/ - +done we've got an intersection of the ray with the box. */ +BOOL WINAPI D3DXBoxBoundProbe(const D3DXVECTOR3 *pmin, const D3DXVECTOR3 *pmax, + const D3DXVECTOR3 *prayposition, const D3DXVECTOR3 *praydirection) { FLOAT div, tmin, tmax, tymin, tymax, tzmin, tzmax; @@ -1952,10 +1961,8 @@ done we've got an intersection of the ray with the box. return TRUE; } -/************************************************************************* - * D3DXComputeBoundingBox - */ -HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pmin, D3DXVECTOR3 *pmax) +HRESULT WINAPI D3DXComputeBoundingBox(const D3DXVECTOR3 *pfirstposition, + DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pmin, D3DXVECTOR3 *pmax) { D3DXVECTOR3 vec; unsigned int i; @@ -1982,10 +1989,8 @@ HRESULT WINAPI D3DXComputeBoundingBox(CONST D3DXVECTOR3 *pfirstposition, DWORD n return D3D_OK; } -/************************************************************************* - * D3DXComputeBoundingSphere - */ -HRESULT WINAPI D3DXComputeBoundingSphere(CONST D3DXVECTOR3* pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pcenter, FLOAT *pradius) +HRESULT WINAPI D3DXComputeBoundingSphere(const D3DXVECTOR3 *pfirstposition, + DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pcenter, float *pradius) { D3DXVECTOR3 temp; FLOAT d; @@ -2359,10 +2364,8 @@ UINT WINAPI D3DXGetDeclLength(const D3DVERTEXELEMENT9 *decl) return element - decl; } -/************************************************************************* - * D3DXIntersectTri - */ -BOOL WINAPI D3DXIntersectTri(CONST D3DXVECTOR3 *p0, CONST D3DXVECTOR3 *p1, CONST D3DXVECTOR3 *p2, CONST D3DXVECTOR3 *praypos, CONST D3DXVECTOR3 *praydir, FLOAT *pu, FLOAT *pv, FLOAT *pdist) +BOOL WINAPI D3DXIntersectTri(const D3DXVECTOR3 *p0, const D3DXVECTOR3 *p1, const D3DXVECTOR3 *p2, + const D3DXVECTOR3 *praypos, const D3DXVECTOR3 *praydir, float *pu, float *pv, float *pdist) { D3DXMATRIX m; D3DXVECTOR4 vec; @@ -2396,7 +2399,7 @@ BOOL WINAPI D3DXIntersectTri(CONST D3DXVECTOR3 *p0, CONST D3DXVECTOR3 *p1, CONST { *pu = vec.x; *pv = vec.y; - *pdist = fabs( vec.z ); + *pdist = fabsf( vec.z ); return TRUE; } } @@ -2404,10 +2407,8 @@ BOOL WINAPI D3DXIntersectTri(CONST D3DXVECTOR3 *p0, CONST D3DXVECTOR3 *p1, CONST return FALSE; } -/************************************************************************* - * D3DXSphereBoundProbe - */ -BOOL WINAPI D3DXSphereBoundProbe(CONST D3DXVECTOR3 *pcenter, FLOAT radius, CONST D3DXVECTOR3 *prayposition, CONST D3DXVECTOR3 *praydirection) +BOOL WINAPI D3DXSphereBoundProbe(const D3DXVECTOR3 *pcenter, float radius, + const D3DXVECTOR3 *prayposition, const D3DXVECTOR3 *praydirection) { D3DXVECTOR3 difference; FLOAT a, b, c, d; @@ -2436,7 +2437,7 @@ HRESULT WINAPI D3DXCreateMesh(DWORD numfaces, DWORD numvertices, DWORD options, IDirect3DVertexBuffer9 *vertex_buffer; IDirect3DIndexBuffer9 *index_buffer; DWORD *attrib_buffer; - ID3DXMeshImpl *object; + struct d3dx9_mesh *object; DWORD index_usage = 0; D3DPOOL index_pool = D3DPOOL_DEFAULT; D3DFORMAT index_format = D3DFMT_INDEX16; @@ -2444,7 +2445,8 @@ HRESULT WINAPI D3DXCreateMesh(DWORD numfaces, DWORD numvertices, DWORD options, D3DPOOL vertex_pool = D3DPOOL_DEFAULT; int i; - TRACE("(%d, %d, %x, %p, %p, %p)\n", numfaces, numvertices, options, declaration, device, mesh); + TRACE("numfaces %u, numvertices %u, options %#x, declaration %p, device %p, mesh %p.\n", + numfaces, numvertices, options, declaration, device, mesh); if (numfaces == 0 || numvertices == 0 || declaration == NULL || device == NULL || mesh == NULL || /* D3DXMESH_VB_SHARE is for cloning, and D3DXMESH_USEHWONLY is for ConvertToBlendedMesh */ @@ -2550,7 +2552,7 @@ HRESULT WINAPI D3DXCreateMesh(DWORD numfaces, DWORD numvertices, DWORD options, } attrib_buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, numfaces * sizeof(*attrib_buffer)); - object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXMeshImpl)); + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (object == NULL || attrib_buffer == NULL) { HeapFree(GetProcessHeap(), 0, object); @@ -2630,7 +2632,7 @@ struct mesh_data { DWORD nb_bones; }; -static HRESULT parse_texture_filename(ID3DXFileData *filedata, LPSTR *filename_out) +static HRESULT parse_texture_filename(ID3DXFileData *filedata, char **filename_out) { HRESULT hr; SIZE_T data_size; @@ -2650,12 +2652,13 @@ static HRESULT parse_texture_filename(ID3DXFileData *filedata, LPSTR *filename_o if (FAILED(hr)) return hr; /* FIXME: String must be retrieved directly instead of through a pointer once ID3DXFILE is fixed */ - if (data_size < sizeof(LPSTR)) { + if (data_size < sizeof(filename_in)) + { WARN("truncated data (%lu bytes)\n", data_size); filedata->lpVtbl->Unlock(filedata); return E_FAIL; } - filename_in = *(LPSTR*)data; + filename_in = *(char **)data; filename = HeapAlloc(GetProcessHeap(), 0, strlen(filename_in) + 1); if (!filename) { @@ -2678,8 +2681,7 @@ static HRESULT parse_material(ID3DXFileData *filedata, D3DXMATERIAL *material) const BYTE *data; GUID type; ID3DXFileData *child; - SIZE_T nb_children; - int i; + SIZE_T i, nb_children; material->pTextureFilename = NULL; @@ -3390,7 +3392,7 @@ static HRESULT generate_effects(ID3DXBuffer *materials, DWORD num_materials, for (j = 0; j < ARRAY_SIZE(material_effects); j++) { - defaults->pParamName = (LPSTR)out_ptr; + defaults->pParamName = (char *)out_ptr; strcpy(defaults->pParamName, material_effects[j].param_name); defaults->pValue = defaults->pParamName + material_effects[j].name_size; defaults->Type = D3DXEDT_FLOATS; @@ -3400,8 +3402,9 @@ static HRESULT generate_effects(ID3DXBuffer *materials, DWORD num_materials, defaults++; } - if (material_ptr->pTextureFilename) { - defaults->pParamName = (LPSTR)out_ptr; + if (material_ptr->pTextureFilename) + { + defaults->pParamName = (char *)out_ptr; strcpy(defaults->pParamName, texture_paramname); defaults->pValue = defaults->pParamName + sizeof(texture_paramname); defaults->Type = D3DXEDT_STRING; @@ -3665,12 +3668,14 @@ HRESULT WINAPI D3DXLoadMeshHierarchyFromXA(const char *filename, DWORD options, struct ID3DXAllocateHierarchy *alloc_hier, struct ID3DXLoadUserData *load_user_data, D3DXFRAME **frame_hierarchy, struct ID3DXAnimationController **anim_controller) { + WCHAR *filenameW; HRESULT hr; int len; - LPWSTR filenameW; - TRACE("(%s, %x, %p, %p, %p, %p, %p)\n", debugstr_a(filename), options, - device, alloc_hier, load_user_data, frame_hierarchy, anim_controller); + TRACE("filename %s, options %#x, device %p, alloc_hier %p, " + "load_user_data %p, frame_hierarchy %p, anim_controller %p.\n", + debugstr_a(filename), options, device, alloc_hier, + load_user_data, frame_hierarchy, anim_controller); if (!filename) return D3DERR_INVALIDCALL; @@ -3691,12 +3696,14 @@ HRESULT WINAPI D3DXLoadMeshHierarchyFromXW(const WCHAR *filename, DWORD options, struct ID3DXAllocateHierarchy *alloc_hier, struct ID3DXLoadUserData *load_user_data, D3DXFRAME **frame_hierarchy, struct ID3DXAnimationController **anim_controller) { + void *buffer; HRESULT hr; DWORD size; - LPVOID buffer; - TRACE("(%s, %x, %p, %p, %p, %p, %p)\n", debugstr_w(filename), options, - device, alloc_hier, load_user_data, frame_hierarchy, anim_controller); + TRACE("filename %s, options %#x, device %p, alloc_hier %p, " + "load_user_data %p, frame_hierarchy %p, anim_controller %p.\n", + debugstr_w(filename), options, device, alloc_hier, + load_user_data, frame_hierarchy, anim_controller); if (!filename) return D3DERR_INVALIDCALL; @@ -3814,8 +3821,7 @@ static HRESULT load_frame(struct ID3DXFileData *filedata, DWORD options, struct D3DXFRAME *frame = NULL; D3DXMESHCONTAINER **next_container; D3DXFRAME **next_child; - SIZE_T nb_children; - int i; + SIZE_T i, nb_children; hr = filedata_get_name(filedata, &name); if (FAILED(hr)) return hr; @@ -3872,9 +3878,8 @@ HRESULT WINAPI D3DXLoadMeshHierarchyFromXInMemory(const void *memory, DWORD memo D3DXF_FILELOADMEMORY source; D3DXFRAME *first_frame = NULL; D3DXFRAME **next_frame = &first_frame; - SIZE_T nb_children; + SIZE_T i, nb_children; GUID guid; - int i; TRACE("(%p, %u, %x, %p, %p, %p, %p, %p)\n", memory, memory_size, options, device, alloc_hier, load_user_data, frame_hierarchy, anim_controller); @@ -4017,12 +4022,14 @@ HRESULT WINAPI D3DXLoadMeshFromXA(const char *filename, DWORD options, struct ID struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *num_materials, struct ID3DXMesh **mesh) { + WCHAR *filenameW; HRESULT hr; int len; - LPWSTR filenameW; - TRACE("(%s, %x, %p, %p, %p, %p, %p, %p)\n", debugstr_a(filename), options, - device, adjacency, materials, effect_instances, num_materials, mesh); + TRACE("filename %s, options %#x, device %p, adjacency %p, materials %p, " + "effect_instances %p, num_materials %p, mesh %p.\n", + debugstr_a(filename), options, device, adjacency, materials, + effect_instances, num_materials, mesh); if (!filename) return D3DERR_INVALIDCALL; @@ -4043,12 +4050,14 @@ HRESULT WINAPI D3DXLoadMeshFromXW(const WCHAR *filename, DWORD options, struct I struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *num_materials, struct ID3DXMesh **mesh) { + void *buffer; HRESULT hr; DWORD size; - LPVOID buffer; - TRACE("(%s, %x, %p, %p, %p, %p, %p, %p)\n", debugstr_w(filename), options, - device, adjacency, materials, effect_instances, num_materials, mesh); + TRACE("filename %s, options %#x, device %p, adjacency %p, materials %p, " + "effect_instances %p, num_materials %p, mesh %p.\n", + debugstr_w(filename), options, device, adjacency, materials, + effect_instances, num_materials, mesh); if (!filename) return D3DERR_INVALIDCALL; @@ -4071,12 +4080,13 @@ HRESULT WINAPI D3DXLoadMeshFromXResource(HMODULE module, const char *name, const { HRESULT hr; HRSRC resinfo; + void *buffer; DWORD size; - LPVOID buffer; - TRACE("(%p, %s, %s, %x, %p, %p, %p, %p, %p, %p)\n", - module, debugstr_a(name), debugstr_a(type), options, device, - adjacency, materials, effect_instances, num_materials, mesh); + TRACE("module %p, name %s, type %s, options %#x, device %p, adjacency %p, " + "materials %p, effect_instances %p, num_materials %p, mesh %p.\n", + module, debugstr_a(name), debugstr_a(type), options, device, adjacency, + materials, effect_instances, num_materials, mesh); resinfo = FindResourceA(module, name, type); if (!resinfo) return D3DXERR_INVALIDDATA; @@ -4106,8 +4116,7 @@ static HRESULT parse_frame(struct ID3DXFileData *filedata, DWORD options, struct D3DXMATRIX transform = *parent_transform; ID3DXFileData *child; GUID type; - SIZE_T nb_children; - int i; + SIZE_T i, nb_children; hr = filedata->lpVtbl->GetChildren(filedata, &nb_children); if (FAILED(hr)) @@ -4172,9 +4181,8 @@ HRESULT WINAPI D3DXLoadMeshFromXInMemory(const void *memory, DWORD memory_size, void *concat_indices = NULL; DWORD index_offset; DWORD concat_vertex_size; - SIZE_T nb_children; + SIZE_T i, nb_children; GUID guid; - int i; TRACE("(%p, %u, %x, %p, %p, %p, %p, %p, %p)\n", memory, memory_size, options, device, adjacency_out, materials_out, effects_out, num_materials_out, mesh_out); @@ -4507,20 +4515,106 @@ cleanup: return hr; } -HRESULT WINAPI D3DXCreateBox(struct IDirect3DDevice9 *device, float width, float height, - float depth, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency) -{ - FIXME("(%p, %f, %f, %f, %p, %p): stub\n", device, width, height, depth, mesh, adjacency); - - return E_NOTIMPL; -} - struct vertex { D3DXVECTOR3 position; D3DXVECTOR3 normal; }; +HRESULT WINAPI D3DXCreateBox(struct IDirect3DDevice9 *device, float width, float height, + float depth, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency) +{ + HRESULT hr; + ID3DXMesh *box; + struct vertex *vertices; + WORD (*faces)[3]; + DWORD *adjacency_buf; + unsigned int i, face; + static const D3DXVECTOR3 unit_box[] = + { + {-0.5f, -0.5f, -0.5f}, {-0.5f, -0.5f, 0.5f}, {-0.5f, 0.5f, 0.5f}, {-0.5f, 0.5f, -0.5f}, + {-0.5f, 0.5f, -0.5f}, {-0.5f, 0.5f, 0.5f}, { 0.5f, 0.5f, 0.5f}, { 0.5f, 0.5f, -0.5f}, + { 0.5f, 0.5f, -0.5f}, { 0.5f, 0.5f, 0.5f}, { 0.5f, -0.5f, 0.5f}, { 0.5f, -0.5f, -0.5f}, + {-0.5f, -0.5f, 0.5f}, {-0.5f, -0.5f, -0.5f}, { 0.5f, -0.5f, -0.5f}, { 0.5f, -0.5f, 0.5f}, + {-0.5f, -0.5f, 0.5f}, { 0.5f, -0.5f, 0.5f}, { 0.5f, 0.5f, 0.5f}, {-0.5f, 0.5f, 0.5f}, + {-0.5f, -0.5f, -0.5f}, {-0.5f, 0.5f, -0.5f}, { 0.5f, 0.5f, -0.5f}, { 0.5f, -0.5f, -0.5f} + }; + static const D3DXVECTOR3 normals[] = + { + {-1.0f, 0.0f, 0.0f}, { 0.0f, 1.0f, 0.0f}, { 1.0f, 0.0f, 0.0f}, + { 0.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 1.0f}, { 0.0f, 0.0f, -1.0f} + }; + static const DWORD adjacency_table[] = + { + 6, 9, 1, 2, 10, 0, 1, 9, 3, 4, 10, 2, + 3, 8, 5, 7, 11, 4, 0, 11, 7, 5, 8, 6, + 7, 4, 9, 2, 0, 8, 1, 3, 11, 5, 6, 10 + }; + + TRACE("device %p, width %f, height %f, depth %f, mesh %p, adjacency %p\n", + device, width, height, depth, mesh, adjacency); + + if (!device || width < 0.0f || height < 0.0f || depth < 0.0f || !mesh) + { + return D3DERR_INVALIDCALL; + } + + if (FAILED(hr = D3DXCreateMeshFVF(12, 24, D3DXMESH_MANAGED, D3DFVF_XYZ | D3DFVF_NORMAL, device, &box))) + { + return hr; + } + + if (FAILED(hr = box->lpVtbl->LockVertexBuffer(box, 0, (void **)&vertices))) + { + box->lpVtbl->Release(box); + return hr; + } + + if (FAILED(hr = box->lpVtbl->LockIndexBuffer(box, 0, (void **)&faces))) + { + box->lpVtbl->UnlockVertexBuffer(box); + box->lpVtbl->Release(box); + return hr; + } + + for (i = 0; i < 24; i++) + { + vertices[i].position.x = width * unit_box[i].x; + vertices[i].position.y = height * unit_box[i].y; + vertices[i].position.z = depth * unit_box[i].z; + vertices[i].normal.x = normals[i / 4].x; + vertices[i].normal.y = normals[i / 4].y; + vertices[i].normal.z = normals[i / 4].z; + } + + face = 0; + for (i = 0; i < 12; i++) + { + faces[i][0] = face++; + faces[i][1] = face++; + faces[i][2] = (i % 2) ? face - 4 : face; + } + + box->lpVtbl->UnlockIndexBuffer(box); + box->lpVtbl->UnlockVertexBuffer(box); + + if (adjacency) + { + if (FAILED(hr = D3DXCreateBuffer(sizeof(adjacency_table), adjacency))) + { + box->lpVtbl->Release(box); + return hr; + } + + adjacency_buf = ID3DXBuffer_GetBufferPointer(*adjacency); + memcpy(adjacency_buf, adjacency_table, sizeof(adjacency_table)); + } + + *mesh = box; + + return D3D_OK; +} + typedef WORD face[3]; struct sincos_table @@ -4556,8 +4650,8 @@ static BOOL compute_sincos_table(struct sincos_table *sincos_table, float angle_ angle = angle_start; for (i = 0; i < n; i++) { - sincos_table->sin[i] = sin(angle); - sincos_table->cos[i] = cos(angle); + sincos_table->sin[i] = sinf(angle); + sincos_table->cos[i] = cosf(angle); angle += angle_step; } @@ -4605,15 +4699,13 @@ HRESULT WINAPI D3DXCreateSphere(struct IDirect3DDevice9 *device, float radius, U return hr; } - hr = sphere->lpVtbl->LockVertexBuffer(sphere, 0, (LPVOID *)&vertices); - if (FAILED(hr)) + if (FAILED(hr = sphere->lpVtbl->LockVertexBuffer(sphere, 0, (void **)&vertices))) { sphere->lpVtbl->Release(sphere); return hr; } - hr = sphere->lpVtbl->LockIndexBuffer(sphere, 0, (LPVOID *)&faces); - if (FAILED(hr)) + if (FAILED(hr = sphere->lpVtbl->LockIndexBuffer(sphere, 0, (void **)&faces))) { sphere->lpVtbl->UnlockVertexBuffer(sphere); sphere->lpVtbl->Release(sphere); @@ -4621,8 +4713,8 @@ HRESULT WINAPI D3DXCreateSphere(struct IDirect3DDevice9 *device, float radius, U } /* phi = angle on xz plane wrt z axis */ - phi_step = -2 * M_PI / slices; - phi_start = M_PI / 2; + phi_step = -2.0f * D3DX_PI / slices; + phi_start = D3DX_PI / 2.0f; if (!compute_sincos_table(&phi, phi_start, phi_step, slices)) { @@ -4633,7 +4725,7 @@ HRESULT WINAPI D3DXCreateSphere(struct IDirect3DDevice9 *device, float radius, U } /* theta = angle on xy plane wrt x axis */ - theta_step = M_PI / stacks; + theta_step = D3DX_PI / stacks; theta = theta_step; vertex = 0; @@ -4649,8 +4741,8 @@ HRESULT WINAPI D3DXCreateSphere(struct IDirect3DDevice9 *device, float radius, U for (stack = 0; stack < stacks - 1; stack++) { - sin_theta = sin(theta); - cos_theta = cos(theta); + sin_theta = sinf(theta); + cos_theta = cosf(theta); for (slice = 0; slice < slices; slice++) { @@ -4776,15 +4868,13 @@ HRESULT WINAPI D3DXCreateCylinder(struct IDirect3DDevice9 *device, float radius1 return hr; } - hr = cylinder->lpVtbl->LockVertexBuffer(cylinder, 0, (LPVOID *)&vertices); - if (FAILED(hr)) + if (FAILED(hr = cylinder->lpVtbl->LockVertexBuffer(cylinder, 0, (void **)&vertices))) { cylinder->lpVtbl->Release(cylinder); return hr; } - hr = cylinder->lpVtbl->LockIndexBuffer(cylinder, 0, (LPVOID *)&faces); - if (FAILED(hr)) + if (FAILED(hr = cylinder->lpVtbl->LockIndexBuffer(cylinder, 0, (void **)&faces))) { cylinder->lpVtbl->UnlockVertexBuffer(cylinder); cylinder->lpVtbl->Release(cylinder); @@ -4792,8 +4882,8 @@ HRESULT WINAPI D3DXCreateCylinder(struct IDirect3DDevice9 *device, float radius1 } /* theta = angle on xy plane wrt x axis */ - theta_step = -2 * M_PI / slices; - theta_start = M_PI / 2; + theta_step = -2.0f * D3DX_PI / slices; + theta_start = D3DX_PI / 2.0f; if (!compute_sincos_table(&theta, theta_start, theta_step, slices)) { @@ -4935,12 +5025,12 @@ HRESULT WINAPI D3DXCreateTeapot(struct IDirect3DDevice9 *device, HRESULT WINAPI D3DXCreateTextA(struct IDirect3DDevice9 *device, HDC hdc, const char *text, float deviation, float extrusion, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency, GLYPHMETRICSFLOAT *glyphmetrics) { + WCHAR *textW; HRESULT hr; int len; - LPWSTR textW; - TRACE("(%p, %p, %s, %f, %f, %p, %p, %p)\n", device, hdc, - debugstr_a(text), deviation, extrusion, mesh, adjacency, glyphmetrics); + TRACE("device %p, hdc %p, text %s, deviation %.8e, extrusion %.8e, mesh %p, adjacency %p, glyphmetrics %p.\n", + device, hdc, debugstr_a(text), deviation, extrusion, mesh, adjacency, glyphmetrics); if (!text) return D3DERR_INVALIDCALL; @@ -5114,7 +5204,7 @@ static HRESULT add_vertex_index(struct word_array *array, WORD vertex_index) C_ASSERT(sizeof(FIXED) == sizeof(float)); C_ASSERT(sizeof(POINTFX) == sizeof(D3DXVECTOR2)); -static inline D3DXVECTOR2 *convert_fixed_to_float(POINTFX *pt, int count, float emsquare) +static inline D3DXVECTOR2 *convert_fixed_to_float(POINTFX *pt, int count, unsigned int emsquare) { D3DXVECTOR2 *ret = (D3DXVECTOR2*)pt; while (count--) { @@ -5219,7 +5309,8 @@ static BOOL attempt_line_merge(struct outline *outline, } static HRESULT create_outline(struct glyphinfo *glyph, void *raw_outline, int datasize, - float max_deviation_sq, float emsquare, const struct cos_table *cos_table) + float max_deviation_sq, unsigned int emsquare, + const struct cos_table *cos_table) { TTPOLYGONHEADER *header = (TTPOLYGONHEADER *)raw_outline; @@ -5763,9 +5854,9 @@ HRESULT WINAPI D3DXCreateTextW(struct IDirect3DDevice9 *device, HDC hdc, const W face *face_ptr; float max_deviation_sq; const struct cos_table cos_table = { - cos(D3DXToRadian(0.5f)), - cos(D3DXToRadian(45.0f)), - cos(D3DXToRadian(90.0f)), + cosf(D3DXToRadian(0.5f)), + cosf(D3DXToRadian(45.0f)), + cosf(D3DXToRadian(90.0f)), }; int f1, f2; @@ -5883,12 +5974,10 @@ HRESULT WINAPI D3DXCreateTextW(struct IDirect3DDevice9 *device, HDC hdc, const W if (FAILED(hr)) goto error; - hr = mesh->lpVtbl->LockVertexBuffer(mesh, 0, (LPVOID *)&vertices); - if (FAILED(hr)) + if (FAILED(hr = mesh->lpVtbl->LockVertexBuffer(mesh, 0, (void **)&vertices))) goto error; - hr = mesh->lpVtbl->LockIndexBuffer(mesh, 0, (LPVOID *)&faces); - if (FAILED(hr)) + if (FAILED(hr = mesh->lpVtbl->LockIndexBuffer(mesh, 0, (void **)&faces))) goto error; /* convert 2D vertices and faces into 3D mesh */ @@ -6147,7 +6236,7 @@ static BOOL weld_float4(void *to, void *from, FLOAT epsilon) FLOAT diff_y = fabsf(v1->y - v2->y); FLOAT diff_z = fabsf(v1->z - v2->z); FLOAT diff_w = fabsf(v1->w - v2->w); - FLOAT max_abs_diff = fmax(diff_x, diff_y); + FLOAT max_abs_diff = max(diff_x, diff_y); max_abs_diff = max(diff_z, max_abs_diff); max_abs_diff = max(diff_w, max_abs_diff); @@ -6386,9 +6475,9 @@ static BOOL weld_float16_2(void *to, void *from, FLOAT epsilon) FLOAT diff_x; FLOAT diff_y; FLOAT max_abs_diff; - const UINT NUM_ELEM = 2; - FLOAT v1[2]; - FLOAT v2[2]; +#define NUM_ELEM 2 + FLOAT v1[NUM_ELEM]; + FLOAT v2[NUM_ELEM]; D3DXFloat16To32Array(v1, v1_float16, NUM_ELEM); D3DXFloat16To32Array(v2, v2_float16, NUM_ELEM); @@ -6405,6 +6494,7 @@ static BOOL weld_float16_2(void *to, void *from, FLOAT epsilon) } return FALSE; +#undef NUM_ELEM } static BOOL weld_float16_4(void *to, void *from, FLOAT epsilon) @@ -6416,9 +6506,9 @@ static BOOL weld_float16_4(void *to, void *from, FLOAT epsilon) FLOAT diff_z; FLOAT diff_w; FLOAT max_abs_diff; - const UINT NUM_ELEM = 4; - FLOAT v1[4]; - FLOAT v2[4]; +#define NUM_ELEM 4 + FLOAT v1[NUM_ELEM]; + FLOAT v2[NUM_ELEM]; D3DXFloat16To32Array(v1, v1_float16, NUM_ELEM); D3DXFloat16To32Array(v2, v2_float16, NUM_ELEM); @@ -6439,6 +6529,7 @@ static BOOL weld_float16_4(void *to, void *from, FLOAT epsilon) } return FALSE; +#undef NUM_ELEM } /* Sets the vertex components to the same value if they are within epsilon. */ @@ -6663,13 +6754,13 @@ HRESULT WINAPI D3DXWeldVertices(ID3DXMesh *mesh, DWORD flags, const D3DXWELDEPSI BOOL indices_are_32bit = mesh->lpVtbl->GetOptions(mesh) & D3DXMESH_32BIT; DWORD optimize_flags; DWORD *point_reps = NULL; - ID3DXMeshImpl *This = impl_from_ID3DXMesh(mesh); + struct d3dx9_mesh *This = impl_from_ID3DXMesh(mesh); DWORD *vertex_face_map = NULL; ID3DXBuffer *vertex_remap = NULL; BYTE *vertices = NULL; - TRACE("(%p, %x, %p, %p, %p, %p, %p)\n", mesh, flags, epsilons, - adjacency, adjacency_out, face_remap_out, vertex_remap_out); + TRACE("mesh %p, flags %#x, epsilons %p, adjacency %p, adjacency_out %p, face_remap_out %p, vertex_remap_out %p.\n", + mesh, flags, epsilons, adjacency, adjacency_out, face_remap_out, vertex_remap_out); if (flags == 0) { @@ -6858,20 +6949,17 @@ cleanup: * The face re-ordering does not use the vertex cache optimally. * */ -HRESULT WINAPI D3DXOptimizeFaces(LPCVOID indices, - UINT num_faces, - UINT num_vertices, - BOOL indices_are_32bit, - DWORD *face_remap) +HRESULT WINAPI D3DXOptimizeFaces(const void *indices, UINT num_faces, + UINT num_vertices, BOOL indices_are_32bit, DWORD *face_remap) { UINT i; UINT j = num_faces - 1; UINT limit_16_bit = 2 << 15; /* According to MSDN */ HRESULT hr = D3D_OK; - FIXME("(%p, %u, %u, %s, %p): semi-stub. Face order will not be optimal.\n", - indices, num_faces, num_vertices, - indices_are_32bit ? "TRUE" : "FALSE", face_remap); + FIXME("indices %p, num_faces %u, num_vertices %u, indices_are_32bit %#x, face_remap %p semi-stub. " + "Face order will not be optimal.\n", + indices, num_faces, num_vertices, indices_are_32bit, face_remap); if (!indices_are_32bit && num_faces >= limit_16_bit) { diff --git a/reactos/dll/directx/wine/d3dx9_36/render.c b/reactos/dll/directx/wine/d3dx9_36/render.c index 00cece9f948..02e6caa8eb7 100644 --- a/reactos/dll/directx/wine/d3dx9_36/render.c +++ b/reactos/dll/directx/wine/d3dx9_36/render.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Jأ³zef Kucia + * Copyright (C) 2012 Józef Kucia * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/reactos/dll/directx/wine/d3dx9_36/shader.c b/reactos/dll/directx/wine/d3dx9_36/shader.c index 1ef31590927..36b100713ba 100644 --- a/reactos/dll/directx/wine/d3dx9_36/shader.c +++ b/reactos/dll/directx/wine/d3dx9_36/shader.c @@ -21,11 +21,11 @@ #include "d3dx9_36_private.h" #include "d3dcompiler.h" -/* This function is not declared in the SDK headers yet */ -HRESULT WINAPI D3DAssemble(LPCVOID data, SIZE_T datasize, LPCSTR filename, - const D3D_SHADER_MACRO *defines, ID3DInclude *include, - UINT flags, - ID3DBlob **shader, ID3DBlob **error_messages); + +/* This function is not declared in the SDK headers yet. */ +HRESULT WINAPI D3DAssemble(const void *data, SIZE_T datasize, const char *filename, + const D3D_SHADER_MACRO *defines, ID3DInclude *include, UINT flags, + ID3DBlob **shader, ID3DBlob **error_messages); static inline BOOL is_valid_bytecode(DWORD token) { @@ -142,6 +142,7 @@ const char * WINAPI D3DXGetVertexShaderProfile(struct IDirect3DDevice9 *device) HRESULT WINAPI D3DXFindShaderComment(const DWORD *byte_code, DWORD fourcc, const void **data, UINT *size) { const DWORD *ptr = byte_code; + DWORD version; TRACE("byte_code %p, fourcc %x, data %p, size %p\n", byte_code, fourcc, data, size); @@ -149,7 +150,18 @@ HRESULT WINAPI D3DXFindShaderComment(const DWORD *byte_code, DWORD fourcc, const if (size) *size = 0; if (!byte_code) return D3DERR_INVALIDCALL; - if (!is_valid_bytecode(*byte_code)) return D3DXERR_INVALIDDATA; + + version = *ptr >> 16; + if (version != 0x4658 /* FX */ + && version != 0x5458 /* TX */ + && version != 0x7ffe + && version != 0x7fff + && version != 0xfffe /* VS */ + && version != 0xffff) /* PS */ + { + WARN("Invalid data supplied\n"); + return D3DXERR_INVALIDDATA; + } while (*++ptr != D3DSIO_END) { @@ -162,7 +174,7 @@ HRESULT WINAPI D3DXFindShaderComment(const DWORD *byte_code, DWORD fourcc, const if (*(ptr + 1) == fourcc) { UINT ctab_size = (comment_size - 1) * sizeof(DWORD); - LPCVOID ctab_data = ptr + 2; + const void *ctab_data = ptr + 2; if (size) *size = ctab_size; if (data) @@ -196,14 +208,13 @@ HRESULT WINAPI D3DXAssembleShader(const char *data, UINT data_len, const D3DXMAC } /* D3DXInclude private implementation, used to implement - D3DXAssembleShaderFromFile from D3DXAssembleShader */ -/* To be able to correctly resolve include search paths we have to store - the pathname of each include file. We store the pathname pointer right - before the file data. */ -static HRESULT WINAPI d3dincludefromfile_open(ID3DXInclude *iface, - D3DXINCLUDE_TYPE include_type, - LPCSTR filename, LPCVOID parent_data, - LPCVOID *data, UINT *bytes) { + * D3DXAssembleShaderFromFile() from D3DXAssembleShader(). */ +/* To be able to correctly resolve include search paths we have to store the + * pathname of each include file. We store the pathname pointer right before + * the file data. */ +static HRESULT WINAPI d3dincludefromfile_open(ID3DXInclude *iface, D3DXINCLUDE_TYPE include_type, + const char *filename, const void *parent_data, const void **data, UINT *bytes) +{ const char *p, *parent_name = ""; char *pathname = NULL; char **buffer = NULL; @@ -253,7 +264,8 @@ error: return HRESULT_FROM_WIN32(GetLastError()); } -static HRESULT WINAPI d3dincludefromfile_close(ID3DXInclude *iface, LPCVOID data) { +static HRESULT WINAPI d3dincludefromfile_close(ID3DXInclude *iface, const void *data) +{ HeapFree(GetProcessHeap(), 0, *((char **)data - 1)); HeapFree(GetProcessHeap(), 0, (char **)data - 1); return S_OK; @@ -271,10 +283,13 @@ struct D3DXIncludeImpl { HRESULT WINAPI D3DXAssembleShaderFromFileA(const char *filename, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages) { - LPWSTR filename_w = NULL; + WCHAR *filename_w; DWORD len; HRESULT ret; + TRACE("filename %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n", + debugstr_a(filename), defines, include, flags, shader, error_messages); + if (!filename) return D3DXERR_INVALIDDATA; len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0); @@ -291,13 +306,14 @@ HRESULT WINAPI D3DXAssembleShaderFromFileA(const char *filename, const D3DXMACRO HRESULT WINAPI D3DXAssembleShaderFromFileW(const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages) { - void *buffer; + const void *buffer; DWORD len; HRESULT hr; struct D3DXIncludeImpl includefromfile; + char *filename_a; - if(FAILED(map_view_of_file(filename, &buffer, &len))) - return D3DXERR_INVALIDDATA; + TRACE("filename %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n", + debugstr_w(filename), defines, include, flags, shader, error_messages); if(!include) { @@ -305,10 +321,23 @@ HRESULT WINAPI D3DXAssembleShaderFromFileW(const WCHAR *filename, const D3DXMACR include = &includefromfile.ID3DXInclude_iface; } - hr = D3DXAssembleShader(buffer, len, defines, include, flags, - shader, error_messages); + len = WideCharToMultiByte(CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL); + filename_a = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char)); + if (!filename_a) + return E_OUTOFMEMORY; + WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, len, NULL, NULL); - UnmapViewOfFile(buffer); + hr = ID3DXInclude_Open(include, D3D_INCLUDE_LOCAL, filename_a, NULL, &buffer, &len); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, filename_a); + return D3DXERR_INVALIDDATA; + } + + hr = D3DXAssembleShader(buffer, len, defines, include, flags, shader, error_messages); + + ID3DXInclude_Close(include, buffer); + HeapFree(GetProcessHeap(), 0, filename_a); return hr; } @@ -319,7 +348,10 @@ HRESULT WINAPI D3DXAssembleShaderFromResourceA(HMODULE module, const char *resou HRSRC res; DWORD len; - if (!(res = FindResourceA(module, resource, (LPCSTR)RT_RCDATA))) + TRACE("module %p, resource %s, defines %p, include %p, flags %#x, shader %p, error_messages %p.\n", + module, debugstr_a(resource), defines, include, flags, shader, error_messages); + + if (!(res = FindResourceA(module, resource, (const char *)RT_RCDATA))) return D3DXERR_INVALIDDATA; if (FAILED(load_resource_into_memory(module, res, &buffer, &len))) return D3DXERR_INVALIDDATA; @@ -351,8 +383,10 @@ HRESULT WINAPI D3DXCompileShader(const char *data, UINT length, const D3DXMACRO { HRESULT hr; - TRACE("data %p, length %u, defines %p, include %p, function %s, profile %s, flags %#x, shader %p, error_msgs %p, constant_table %p\n", - data, length, defines, include, function, profile, flags, shader, error_msgs, constant_table); + TRACE("data %s, length %u, defines %p, include %p, function %s, profile %s, " + "flags %#x, shader %p, error_msgs %p, constant_table %p.\n", + debugstr_a(data), length, defines, include, debugstr_a(function), debugstr_a(profile), + flags, shader, error_msgs, constant_table); hr = D3DCompile(data, length, NULL, (D3D_SHADER_MACRO *)defines, (ID3DInclude *)include, function, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_msgs); @@ -374,10 +408,15 @@ HRESULT WINAPI D3DXCompileShaderFromFileA(const char *filename, const D3DXMACRO ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table) { - LPWSTR filename_w = NULL; + WCHAR *filename_w; DWORD len; HRESULT ret; + TRACE("filename %s, defines %p, include %p, entrypoint %s, profile %s, " + "flags %#x, shader %p, error_messages %p, constant_table %p.\n", + debugstr_a(filename), defines, include, debugstr_a(entrypoint), + debugstr_a(profile), flags, shader, error_messages, constant_table); + if (!filename) return D3DXERR_INVALIDDATA; len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0); @@ -397,14 +436,16 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO ID3DXInclude *include, const char *entrypoint, const char *profile, DWORD flags, ID3DXBuffer **shader, ID3DXBuffer **error_messages, ID3DXConstantTable **constant_table) { - void *buffer; + const void *buffer; DWORD len, filename_len; HRESULT hr; struct D3DXIncludeImpl includefromfile; char *filename_a; - if (FAILED(map_view_of_file(filename, &buffer, &len))) - return D3DXERR_INVALIDDATA; + TRACE("filename %s, defines %p, include %p, entrypoint %s, profile %s, " + "flags %#x, shader %p, error_messages %p, constant_table %p.\n", + debugstr_w(filename), defines, include, debugstr_a(entrypoint), debugstr_a(profile), + flags, shader, error_messages, constant_table); if (!include) { @@ -415,12 +456,16 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO filename_len = WideCharToMultiByte(CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL); filename_a = HeapAlloc(GetProcessHeap(), 0, filename_len * sizeof(char)); if (!filename_a) - { - UnmapViewOfFile(buffer); return E_OUTOFMEMORY; - } WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, filename_len, NULL, NULL); + hr = ID3DXInclude_Open(include, D3D_INCLUDE_LOCAL, filename_a, NULL, &buffer, &len); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, filename_a); + return D3DXERR_INVALIDDATA; + } + hr = D3DCompile(buffer, len, filename_a, (const D3D_SHADER_MACRO *)defines, (ID3DInclude *)include, entrypoint, profile, flags, 0, (ID3DBlob **)shader, (ID3DBlob **)error_messages); @@ -429,8 +474,8 @@ HRESULT WINAPI D3DXCompileShaderFromFileW(const WCHAR *filename, const D3DXMACRO hr = D3DXGetShaderConstantTable(ID3DXBuffer_GetBufferPointer(*shader), constant_table); + ID3DXInclude_Close(include, buffer); HeapFree(GetProcessHeap(), 0, filename_a); - UnmapViewOfFile(buffer); return hr; } @@ -442,7 +487,12 @@ HRESULT WINAPI D3DXCompileShaderFromResourceA(HMODULE module, const char *resour HRSRC res; DWORD len; - if (!(res = FindResourceA(module, resource, (LPCSTR)RT_RCDATA))) + TRACE("module %p, resource %s, defines %p, include %p, entrypoint %s, profile %s, " + "flags %#x, shader %p, error_messages %p, constant_table %p.\n", + module, debugstr_a(resource), defines, include, debugstr_a(entrypoint), debugstr_a(profile), + flags, shader, error_messages, constant_table); + + if (!(res = FindResourceA(module, resource, (const char *)RT_RCDATA))) return D3DXERR_INVALIDDATA; if (FAILED(load_resource_into_memory(module, res, &buffer, &len))) return D3DXERR_INVALIDDATA; @@ -474,7 +524,9 @@ HRESULT WINAPI D3DXCompileShaderFromResourceW(HMODULE module, const WCHAR *resou HRESULT WINAPI D3DXPreprocessShader(const char *data, UINT data_len, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages) { - TRACE("Forward to D3DPreprocess\n"); + TRACE("data %s, data_len %u, defines %p, include %p, shader %p, error_messages %p.\n", + debugstr_a(data), data_len, defines, include, shader, error_messages); + return D3DPreprocess(data, data_len, NULL, (const D3D_SHADER_MACRO *)defines, (ID3DInclude *)include, (ID3DBlob **)shader, (ID3DBlob **)error_messages); @@ -487,6 +539,9 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileA(const char *filename, const D3DXMAC DWORD len; HRESULT ret; + TRACE("filename %s, defines %p, include %p, shader %p, error_messages %p.\n", + debugstr_a(filename), defines, include, shader, error_messages); + if (!filename) return D3DXERR_INVALIDDATA; len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0); @@ -503,13 +558,14 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileA(const char *filename, const D3DXMAC HRESULT WINAPI D3DXPreprocessShaderFromFileW(const WCHAR *filename, const D3DXMACRO *defines, ID3DXInclude *include, ID3DXBuffer **shader, ID3DXBuffer **error_messages) { - void *buffer; + const void *buffer; DWORD len; HRESULT hr; struct D3DXIncludeImpl includefromfile; + char *filename_a; - if (FAILED(map_view_of_file(filename, &buffer, &len))) - return D3DXERR_INVALIDDATA; + TRACE("filename %s, defines %p, include %p, shader %p, error_messages %p.\n", + debugstr_w(filename), defines, include, shader, error_messages); if (!include) { @@ -517,12 +573,26 @@ HRESULT WINAPI D3DXPreprocessShaderFromFileW(const WCHAR *filename, const D3DXMA include = &includefromfile.ID3DXInclude_iface; } + len = WideCharToMultiByte(CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL); + filename_a = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char)); + if (!filename_a) + return E_OUTOFMEMORY; + WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, len, NULL, NULL); + + hr = ID3DXInclude_Open(include, D3D_INCLUDE_LOCAL, filename_a, NULL, &buffer, &len); + if (FAILED(hr)) + { + HeapFree(GetProcessHeap(), 0, filename_a); + return D3DXERR_INVALIDDATA; + } + hr = D3DPreprocess(buffer, len, NULL, (const D3D_SHADER_MACRO *)defines, (ID3DInclude *) include, (ID3DBlob **)shader, (ID3DBlob **)error_messages); - UnmapViewOfFile(buffer); + ID3DXInclude_Close(include, buffer); + HeapFree(GetProcessHeap(), 0, filename_a); return hr; } @@ -533,7 +603,10 @@ HRESULT WINAPI D3DXPreprocessShaderFromResourceA(HMODULE module, const char *res HRSRC res; DWORD len; - if (!(res = FindResourceA(module, resource, (LPCSTR)RT_RCDATA))) + TRACE("module %p, resource %s, defines %p, include %p, shader %p, error_messages %p.\n", + module, debugstr_a(resource), defines, include, shader, error_messages); + + if (!(res = FindResourceA(module, resource, (const char *)RT_RCDATA))) return D3DXERR_INVALIDDATA; if (FAILED(load_resource_into_memory(module, res, &buffer, &len))) return D3DXERR_INVALIDDATA; @@ -548,6 +621,9 @@ HRESULT WINAPI D3DXPreprocessShaderFromResourceW(HMODULE module, const WCHAR *re HRSRC res; DWORD len; + TRACE("module %p, resource %s, defines %p, include %p, shader %p, error_messages %p.\n", + module, debugstr_w(resource), defines, include, shader, error_messages); + if (!(res = FindResourceW(module, resource, (const WCHAR *)RT_RCDATA))) return D3DXERR_INVALIDDATA; if (FAILED(load_resource_into_memory(module, res, &buffer, &len))) @@ -615,12 +691,13 @@ static inline D3DXHANDLE handle_from_constant(struct ctab_constant *constant) return (D3DXHANDLE)constant; } -static struct ctab_constant *get_constant_by_name(struct ID3DXConstantTableImpl *, struct ctab_constant *, LPCSTR); +static struct ctab_constant *get_constant_by_name(struct ID3DXConstantTableImpl *table, + struct ctab_constant *constant, const char *name); -static struct ctab_constant *get_constant_element_by_name(struct ctab_constant *constant, LPCSTR name) +static struct ctab_constant *get_constant_element_by_name(struct ctab_constant *constant, const char *name) { + const char *part; UINT element; - LPCSTR part; TRACE("constant %p, name %s\n", constant, debugstr_a(name)); @@ -656,11 +733,11 @@ static struct ctab_constant *get_constant_element_by_name(struct ctab_constant * } static struct ctab_constant *get_constant_by_name(struct ID3DXConstantTableImpl *table, - struct ctab_constant *constant, LPCSTR name) + struct ctab_constant *constant, const char *name) { UINT i, count, length; struct ctab_constant *handles; - LPCSTR part; + const char *part; TRACE("table %p, constant %p, name %s\n", table, constant, debugstr_a(name)); @@ -788,13 +865,13 @@ static ULONG WINAPI ID3DXConstantTableImpl_Release(ID3DXConstantTable *iface) } /*** ID3DXBuffer methods ***/ -static LPVOID WINAPI ID3DXConstantTableImpl_GetBufferPointer(ID3DXConstantTable *iface) +static void * WINAPI ID3DXConstantTableImpl_GetBufferPointer(ID3DXConstantTable *iface) { - struct ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface); + struct ID3DXConstantTableImpl *table = impl_from_ID3DXConstantTable(iface); - TRACE("(%p)->()\n", This); + TRACE("iface %p.\n", iface); - return This->ctab; + return table->ctab; } static DWORD WINAPI ID3DXConstantTableImpl_GetBufferSize(ID3DXConstantTable *iface) @@ -889,12 +966,13 @@ static D3DXHANDLE WINAPI ID3DXConstantTableImpl_GetConstant(ID3DXConstantTable * return NULL; } -static D3DXHANDLE WINAPI ID3DXConstantTableImpl_GetConstantByName(ID3DXConstantTable *iface, D3DXHANDLE constant, LPCSTR name) +static D3DXHANDLE WINAPI ID3DXConstantTableImpl_GetConstantByName(ID3DXConstantTable *iface, + D3DXHANDLE constant, const char *name) { struct ID3DXConstantTableImpl *This = impl_from_ID3DXConstantTable(iface); struct ctab_constant *c = get_valid_constant(This, constant); - TRACE("(%p)->(%p, %s)\n", This, constant, name); + TRACE("iface %p, constant %p, name %s.\n", iface, constant, debugstr_a(name)); c = get_constant_by_name(This, c, name); TRACE("Returning constant %p\n", c); @@ -939,7 +1017,7 @@ static UINT set(struct ID3DXConstantTableImpl *table, IDirect3DDevice9 *device, UINT l, i, regcount = 1, regsize = 1, cin = 1, rin = 1, ret, last = 0; DWORD tmp; - /* size to small to set anything */ + /* size too small to set anything */ if (*size < desc->Rows * desc->Columns) { *size = 0; @@ -1059,7 +1137,7 @@ static UINT set(struct ID3DXConstantTableImpl *table, IDirect3DDevice9 *device, break; case D3DXPC_MATRIX_COLUMNS: - regcount = desc->Columns; + regcount = min(desc->RegisterCount, desc->Columns); if (inclass == D3DXPC_MATRIX_ROWS) rin = incol; else cin = incol; regsize = desc->Rows; @@ -1685,7 +1763,7 @@ static const struct ID3DXConstantTableVtbl ID3DXConstantTable_Vtbl = }; static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, struct ctab_constant *constant, - BOOL is_element, WORD index, WORD max, DWORD *offset, DWORD nameoffset, UINT regset) + BOOL is_element, WORD index, WORD max_index, DWORD *offset, DWORD nameoffset, UINT regset) { const D3DXSHADER_TYPEINFO *type = (LPD3DXSHADER_TYPEINFO)(ctab + typeoffset); const D3DXSHADER_STRUCTMEMBERINFO *memberinfo = NULL; @@ -1734,7 +1812,7 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru for (i = 0; i < count; ++i) { hr = parse_ctab_constant_type(ctab, memberinfo ? memberinfo[i].TypeInfo : typeoffset, - &constant->constants[i], memberinfo == NULL, index + size, max, offset, + &constant->constants[i], memberinfo == NULL, index + size, max_index, offset, memberinfo ? memberinfo[i].Name : nameoffset, regset); if (hr != D3D_OK) goto error; @@ -1769,7 +1847,7 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru case D3DXPC_MATRIX_ROWS: offsetdiff = type->Rows * 4; - size = is_element ? type->Rows : max(type->Rows, type->Columns); + size = type->Rows; break; case D3DXPC_MATRIX_COLUMNS: @@ -1803,7 +1881,7 @@ static HRESULT parse_ctab_constant_type(const char *ctab, DWORD typeoffset, stru if (offset) *offset += offsetdiff * 4; } - constant->desc.RegisterCount = max(0, min(max - index, size)); + constant->desc.RegisterCount = max(0, min(max_index - index, size)); constant->desc.Bytes = 4 * constant->desc.Elements * type->Rows * type->Columns; return D3D_OK; @@ -1825,8 +1903,8 @@ error: HRESULT WINAPI D3DXGetShaderConstantTableEx(const DWORD *byte_code, DWORD flags, ID3DXConstantTable **constant_table) { struct ID3DXConstantTableImpl *object = NULL; + const void *data; HRESULT hr; - LPCVOID data; UINT size; const D3DXSHADER_CONSTANTTABLE *ctab_header; const D3DXSHADER_CONSTANTINFO *constant_info; diff --git a/reactos/dll/directx/wine/d3dx9_36/skin.c b/reactos/dll/directx/wine/d3dx9_36/skin.c index 3ac5799bd0f..125823654d4 100644 --- a/reactos/dll/directx/wine/d3dx9_36/skin.c +++ b/reactos/dll/directx/wine/d3dx9_36/skin.c @@ -29,7 +29,7 @@ struct bone FLOAT *weights; }; -typedef struct ID3DXSkinInfoImpl +struct d3dx9_skin_info { ID3DXSkinInfo ID3DXSkinInfo_iface; LONG ref; @@ -39,21 +39,21 @@ typedef struct ID3DXSkinInfoImpl DWORD num_vertices; DWORD num_bones; struct bone *bones; -} ID3DXSkinInfoImpl; +}; -static inline struct ID3DXSkinInfoImpl *impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface) +static inline struct d3dx9_skin_info *impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface) { - return CONTAINING_RECORD(iface, struct ID3DXSkinInfoImpl, ID3DXSkinInfo_iface); + return CONTAINING_RECORD(iface, struct d3dx9_skin_info, ID3DXSkinInfo_iface); } -static HRESULT WINAPI ID3DXSkinInfoImpl_QueryInterface(ID3DXSkinInfo *iface, REFIID riid, void **ppobj) +static HRESULT WINAPI d3dx9_skin_info_QueryInterface(ID3DXSkinInfo *iface, REFIID riid, void **out) { - TRACE("(%p, %s, %p)\n", iface, debugstr_guid(riid), ppobj); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ID3DXSkinInfo)) { IUnknown_AddRef(iface); - *ppobj = iface; + *out = iface; return D3D_OK; } @@ -62,47 +62,52 @@ static HRESULT WINAPI ID3DXSkinInfoImpl_QueryInterface(ID3DXSkinInfo *iface, REF return E_NOINTERFACE; } -static ULONG WINAPI ID3DXSkinInfoImpl_AddRef(ID3DXSkinInfo *iface) +static ULONG WINAPI d3dx9_skin_info_AddRef(ID3DXSkinInfo *iface) { - struct ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - ULONG ref = InterlockedIncrement(&This->ref); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); + ULONG refcount = InterlockedIncrement(&skin->ref); - TRACE("%p increasing refcount to %u\n", This, ref); + TRACE("%p increasing refcount to %u.\n", skin, refcount); - return ref; + return refcount; } -static ULONG WINAPI ID3DXSkinInfoImpl_Release(ID3DXSkinInfo *iface) +static ULONG WINAPI d3dx9_skin_info_Release(ID3DXSkinInfo *iface) { - struct ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - ULONG ref = InterlockedDecrement(&This->ref); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); + ULONG refcount = InterlockedDecrement(&skin->ref); - TRACE("%p decreasing refcount to %u\n", This, ref); + TRACE("%p decreasing refcount to %u.\n", skin, refcount); - if (ref == 0) { + if (!refcount) + { DWORD i; - for (i = 0; i < This->num_bones; i++) { - HeapFree(GetProcessHeap(), 0, This->bones[i].name); - HeapFree(GetProcessHeap(), 0, This->bones[i].vertices); - HeapFree(GetProcessHeap(), 0, This->bones[i].weights); + + for (i = 0; i < skin->num_bones; ++i) + { + HeapFree(GetProcessHeap(), 0, skin->bones[i].name); + HeapFree(GetProcessHeap(), 0, skin->bones[i].vertices); + HeapFree(GetProcessHeap(), 0, skin->bones[i].weights); } - HeapFree(GetProcessHeap(), 0, This->bones); - HeapFree(GetProcessHeap(), 0, This); + HeapFree(GetProcessHeap(), 0, skin->bones); + HeapFree(GetProcessHeap(), 0, skin); } - return ref; + return refcount; } -static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneInfluence(ID3DXSkinInfo *iface, DWORD bone_num, DWORD num_influences, CONST DWORD *vertices, CONST FLOAT *weights) +static HRESULT WINAPI d3dx9_skin_info_SetBoneInfluence(ID3DXSkinInfo *iface, + DWORD bone_num, DWORD num_influences, const DWORD *vertices, const float *weights) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); struct bone *bone; DWORD *new_vertices = NULL; FLOAT *new_weights = NULL; - TRACE("(%p, %u, %u, %p, %p)\n", This, bone_num, num_influences, vertices, weights); + TRACE("iface %p, bone_num %u, num_influences %u, vertices %p, weights %p.\n", + iface, bone_num, num_influences, vertices, weights); - if (bone_num >= This->num_bones || !vertices || !weights) + if (bone_num >= skin->num_bones || !vertices || !weights) return D3DERR_INVALIDCALL; if (num_influences) { @@ -117,7 +122,7 @@ static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneInfluence(ID3DXSkinInfo *iface, D memcpy(new_vertices, vertices, num_influences * sizeof(*vertices)); memcpy(new_weights, weights, num_influences * sizeof(*weights)); } - bone = &This->bones[bone_num]; + bone = &skin->bones[bone_num]; bone->num_influences = num_influences; HeapFree(GetProcessHeap(), 0, bone->vertices); HeapFree(GetProcessHeap(), 0, bone->weights); @@ -127,38 +132,40 @@ static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneInfluence(ID3DXSkinInfo *iface, D return D3D_OK; } -static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneVertexInfluence(ID3DXSkinInfo *iface, DWORD bone_num, DWORD influence_num, float weight) +static HRESULT WINAPI d3dx9_skin_info_SetBoneVertexInfluence(ID3DXSkinInfo *iface, + DWORD bone_num, DWORD influence_num, float weight) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %u, %u, %g): stub\n", This, bone_num, influence_num, weight); + FIXME("iface %p, bone_num %u, influence_num %u, weight %.8e stub!\n", + iface, bone_num, influence_num, weight); return E_NOTIMPL; } -static DWORD WINAPI ID3DXSkinInfoImpl_GetNumBoneInfluences(ID3DXSkinInfo *iface, DWORD bone_num) +static DWORD WINAPI d3dx9_skin_info_GetNumBoneInfluences(ID3DXSkinInfo *iface, DWORD bone_num) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); - TRACE("(%p, %u)\n", This, bone_num); + TRACE("iface %p, bone_num %u.\n", iface, bone_num); - if (bone_num >= This->num_bones) + if (bone_num >= skin->num_bones) return 0; - return This->bones[bone_num].num_influences; + return skin->bones[bone_num].num_influences; } -static HRESULT WINAPI ID3DXSkinInfoImpl_GetBoneInfluence(ID3DXSkinInfo *iface, DWORD bone_num, DWORD *vertices, FLOAT *weights) +static HRESULT WINAPI d3dx9_skin_info_GetBoneInfluence(ID3DXSkinInfo *iface, + DWORD bone_num, DWORD *vertices, float *weights) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); struct bone *bone; - TRACE("(%p, %u, %p, %p)\n", This, bone_num, vertices, weights); + TRACE("iface %p, bone_num %u, vertices %p, weights %p.\n", + iface, bone_num, vertices, weights); - if (bone_num >= This->num_bones || !vertices) + if (bone_num >= skin->num_bones || !vertices) return D3DERR_INVALIDCALL; - bone = &This->bones[bone_num]; + bone = &skin->bones[bone_num]; if (!bone->num_influences) return D3D_OK; @@ -169,81 +176,72 @@ static HRESULT WINAPI ID3DXSkinInfoImpl_GetBoneInfluence(ID3DXSkinInfo *iface, D return D3D_OK; } -static HRESULT WINAPI ID3DXSkinInfoImpl_GetBoneVertexInfluence(ID3DXSkinInfo *iface, DWORD bone_num, - DWORD influence_num, float *weight, DWORD *vertex_num) +static HRESULT WINAPI d3dx9_skin_info_GetBoneVertexInfluence(ID3DXSkinInfo *iface, + DWORD bone_num, DWORD influence_num, float *weight, DWORD *vertex_num) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %u, %u, %p, %p): stub\n", This, bone_num, influence_num, weight, vertex_num); + FIXME("iface %p, bone_num %u, influence_num %u, weight %p, vertex_num %p stub!\n", + iface, bone_num, influence_num, weight, vertex_num); return E_NOTIMPL; } -static HRESULT WINAPI ID3DXSkinInfoImpl_GetMaxVertexInfluences(ID3DXSkinInfo *iface, DWORD *max_vertex_influences) +static HRESULT WINAPI d3dx9_skin_info_GetMaxVertexInfluences(ID3DXSkinInfo *iface, DWORD *max_vertex_influences) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %p): stub\n", This, max_vertex_influences); + FIXME("iface %p, max_vertex_influences %p stub!\n", iface, max_vertex_influences); return E_NOTIMPL; } -static DWORD WINAPI ID3DXSkinInfoImpl_GetNumBones(ID3DXSkinInfo *iface) +static DWORD WINAPI d3dx9_skin_info_GetNumBones(ID3DXSkinInfo *iface) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); - TRACE("(%p)\n", This); + TRACE("iface %p.\n", iface); - return This->num_bones; + return skin->num_bones; } -static HRESULT WINAPI ID3DXSkinInfoImpl_FindBoneVertexInfluenceIndex(ID3DXSkinInfo *iface, DWORD bone_num, - DWORD vertex_num, DWORD *influence_index) +static HRESULT WINAPI d3dx9_skin_info_FindBoneVertexInfluenceIndex(ID3DXSkinInfo *iface, + DWORD bone_num, DWORD vertex_num, DWORD *influence_index) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %u, %u, %p): stub\n", This, bone_num, vertex_num, influence_index); + FIXME("iface %p, bone_num %u, vertex_num %u, influence_index %p stub!\n", + iface, bone_num, vertex_num, influence_index); return E_NOTIMPL; } -static HRESULT WINAPI ID3DXSkinInfoImpl_GetMaxFaceInfluences(struct ID3DXSkinInfo *iface, +static HRESULT WINAPI d3dx9_skin_info_GetMaxFaceInfluences(struct ID3DXSkinInfo *iface, struct IDirect3DIndexBuffer9 *index_buffer, DWORD num_faces, DWORD *max_face_influences) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %p, %u, %p): stub\n", This, index_buffer, num_faces, max_face_influences); + FIXME("iface %p, index_buffer %p, num_faces %u, max_face_influences %p stub!\n", + iface, index_buffer, num_faces, max_face_influences); return E_NOTIMPL; } -static HRESULT WINAPI ID3DXSkinInfoImpl_SetMinBoneInfluence(ID3DXSkinInfo *iface, FLOAT min_influence) +static HRESULT WINAPI d3dx9_skin_info_SetMinBoneInfluence(ID3DXSkinInfo *iface, float min_influence) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %g): stub\n", This, min_influence); + FIXME("iface %p, min_influence %.8e stub!\n", iface, min_influence); return E_NOTIMPL; } -static FLOAT WINAPI ID3DXSkinInfoImpl_GetMinBoneInfluence(ID3DXSkinInfo *iface) +static float WINAPI d3dx9_skin_info_GetMinBoneInfluence(ID3DXSkinInfo *iface) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p): stub\n", This); + FIXME("iface %p stub!\n", iface); return 0.0f; } -static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneName(ID3DXSkinInfo *iface, DWORD bone_num, LPCSTR name) +static HRESULT WINAPI d3dx9_skin_info_SetBoneName(ID3DXSkinInfo *iface, DWORD bone_idx, const char *name) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); char *new_name; size_t size; - TRACE("(%p, %u, %s)\n", This, bone_num, debugstr_a(name)); + TRACE("iface %p, bone_idx %u, name %s.\n", iface, bone_idx, debugstr_a(name)); - if (bone_num >= This->num_bones || !name) + if (bone_idx >= skin->num_bones || !name) return D3DERR_INVALIDCALL; size = strlen(name) + 1; @@ -251,74 +249,70 @@ static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneName(ID3DXSkinInfo *iface, DWORD if (!new_name) return E_OUTOFMEMORY; memcpy(new_name, name, size); - HeapFree(GetProcessHeap(), 0, This->bones[bone_num].name); - This->bones[bone_num].name = new_name; + HeapFree(GetProcessHeap(), 0, skin->bones[bone_idx].name); + skin->bones[bone_idx].name = new_name; return D3D_OK; } -static LPCSTR WINAPI ID3DXSkinInfoImpl_GetBoneName(ID3DXSkinInfo *iface, DWORD bone_num) +static const char * WINAPI d3dx9_skin_info_GetBoneName(ID3DXSkinInfo *iface, DWORD bone_idx) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); - TRACE("(%p, %u)\n", This, bone_num); + TRACE("iface %p, bone_idx %u.\n", iface, bone_idx); - if (bone_num >= This->num_bones) + if (bone_idx >= skin->num_bones) return NULL; - return This->bones[bone_num].name; + return skin->bones[bone_idx].name; } -static HRESULT WINAPI ID3DXSkinInfoImpl_SetBoneOffsetMatrix(ID3DXSkinInfo *iface, DWORD bone_num, CONST D3DXMATRIX *bone_transform) +static HRESULT WINAPI d3dx9_skin_info_SetBoneOffsetMatrix(ID3DXSkinInfo *iface, + DWORD bone_num, const D3DXMATRIX *bone_transform) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); - TRACE("(%p, %u, %p)\n", This, bone_num, bone_transform); + TRACE("iface %p, bone_num %u, bone_transform %p.\n", iface, bone_num, bone_transform); - if (bone_num >= This->num_bones || !bone_transform) + if (bone_num >= skin->num_bones || !bone_transform) return D3DERR_INVALIDCALL; - This->bones[bone_num].transform = *bone_transform; + skin->bones[bone_num].transform = *bone_transform; return D3D_OK; } -static D3DXMATRIX * WINAPI ID3DXSkinInfoImpl_GetBoneOffsetMatrix(ID3DXSkinInfo *iface, DWORD bone_num) +static D3DXMATRIX * WINAPI d3dx9_skin_info_GetBoneOffsetMatrix(ID3DXSkinInfo *iface, DWORD bone_num) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); - TRACE("(%p, %u)\n", This, bone_num); + TRACE("iface %p, bone_num %u.\n", iface, bone_num); - if (bone_num >= This->num_bones) + if (bone_num >= skin->num_bones) return NULL; - return &This->bones[bone_num].transform; + return &skin->bones[bone_num].transform; } -static HRESULT WINAPI ID3DXSkinInfoImpl_Clone(ID3DXSkinInfo *iface, ID3DXSkinInfo **skin_info) +static HRESULT WINAPI d3dx9_skin_info_Clone(ID3DXSkinInfo *iface, ID3DXSkinInfo **skin_info) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %p): stub\n", This, skin_info); + FIXME("iface %p, skin_info %p stub!\n", iface, skin_info); return E_NOTIMPL; } -static HRESULT WINAPI ID3DXSkinInfoImpl_Remap(ID3DXSkinInfo *iface, DWORD num_vertices, DWORD *vertex_remap) +static HRESULT WINAPI d3dx9_skin_info_Remap(ID3DXSkinInfo *iface, DWORD num_vertices, DWORD *vertex_remap) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %u, %p): stub\n", This, num_vertices, vertex_remap); + FIXME("iface %p, num_vertices %u, vertex_remap %p stub!\n", iface, num_vertices, vertex_remap); return E_NOTIMPL; } -static HRESULT WINAPI ID3DXSkinInfoImpl_SetFVF(ID3DXSkinInfo *iface, DWORD fvf) +static HRESULT WINAPI d3dx9_skin_info_SetFVF(ID3DXSkinInfo *iface, DWORD fvf) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); HRESULT hr; D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]; - TRACE("(%p, %x)\n", This, fvf); + TRACE("iface %p, fvf %#x.\n", iface, fvf); hr = D3DXDeclaratorFromFVF(fvf, declaration); if (FAILED(hr)) return hr; @@ -326,13 +320,13 @@ static HRESULT WINAPI ID3DXSkinInfoImpl_SetFVF(ID3DXSkinInfo *iface, DWORD fvf) return iface->lpVtbl->SetDeclaration(iface, declaration); } -static HRESULT WINAPI ID3DXSkinInfoImpl_SetDeclaration(ID3DXSkinInfo *iface, CONST D3DVERTEXELEMENT9 *declaration) +static HRESULT WINAPI d3dx9_skin_info_SetDeclaration(ID3DXSkinInfo *iface, const D3DVERTEXELEMENT9 *declaration) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); HRESULT hr; int count; - TRACE("(%p, %p)\n", This, declaration); + TRACE("iface %p, declaration %p.\n", iface, declaration); if (!declaration) return D3DERR_INVALIDCALL; @@ -345,115 +339,111 @@ static HRESULT WINAPI ID3DXSkinInfoImpl_SetDeclaration(ID3DXSkinInfo *iface, CON } count++; - memcpy(This->vertex_declaration, declaration, count * sizeof(*declaration)); + memcpy(skin->vertex_declaration, declaration, count * sizeof(*declaration)); - hr = D3DXFVFFromDeclarator(This->vertex_declaration, &This->fvf); - if (FAILED(hr)) - This->fvf = 0; + if (FAILED(hr = D3DXFVFFromDeclarator(skin->vertex_declaration, &skin->fvf))) + skin->fvf = 0; return D3D_OK; } -static DWORD WINAPI ID3DXSkinInfoImpl_GetFVF(ID3DXSkinInfo *iface) +static DWORD WINAPI d3dx9_skin_info_GetFVF(ID3DXSkinInfo *iface) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); - TRACE("(%p)\n", This); + TRACE("iface %p.\n", iface); - return This->fvf; + return skin->fvf; } -static HRESULT WINAPI ID3DXSkinInfoImpl_GetDeclaration(ID3DXSkinInfo *iface, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) +static HRESULT WINAPI d3dx9_skin_info_GetDeclaration(ID3DXSkinInfo *iface, + D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); UINT count = 0; - TRACE("(%p)\n", This); + TRACE("iface %p, declaration %p.\n", iface, declaration); - while (This->vertex_declaration[count++].Stream != 0xff); - memcpy(declaration, This->vertex_declaration, count * sizeof(declaration[0])); + while (skin->vertex_declaration[count++].Stream != 0xff); + memcpy(declaration, skin->vertex_declaration, count * sizeof(declaration[0])); return D3D_OK; } -static HRESULT WINAPI ID3DXSkinInfoImpl_UpdateSkinnedMesh(ID3DXSkinInfo *iface, CONST D3DXMATRIX *bone_transforms, - CONST D3DXMATRIX *bone_inv_transpose_transforms, LPCVOID vertices_src, PVOID vertices_dest) +static HRESULT WINAPI d3dx9_skin_info_UpdateSkinnedMesh(ID3DXSkinInfo *iface, const D3DXMATRIX *bone_transforms, + const D3DXMATRIX *bone_inv_transpose_transforms, const void *src_vertices, void *dst_vertices) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %p, %p, %p, %p): stub\n", This, bone_transforms, bone_inv_transpose_transforms, vertices_src, vertices_dest); + FIXME("iface %p, bone_transforms %p, bone_inv_transpose_transforms %p, src_vertices %p, dst_vertices %p stub!\n", + iface, bone_transforms, bone_inv_transpose_transforms, src_vertices, dst_vertices); return E_NOTIMPL; } -static HRESULT WINAPI ID3DXSkinInfoImpl_ConvertToBlendedMesh(ID3DXSkinInfo *iface, ID3DXMesh *mesh_in, +static HRESULT WINAPI d3dx9_skin_info_ConvertToBlendedMesh(ID3DXSkinInfo *iface, ID3DXMesh *mesh_in, DWORD options, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap, DWORD *max_face_infl, DWORD *num_bone_combinations, ID3DXBuffer **bone_combination_table, ID3DXMesh **mesh_out) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %p, %x, %p, %p, %p, %p, %p, %p, %p, %p): stub\n", - This, mesh_in, options, adjacency_in, adjacency_out, face_remap, vertex_remap, - max_face_infl, num_bone_combinations, bone_combination_table, mesh_out); + FIXME("iface %p, mesh_in %p, options %#x, adjacency_in %p, adjacency_out %p, face_remap %p, vertex_remap %p, " + "max_face_infl %p, num_bone_combinations %p, bone_combination_table %p, mesh_out %p stub!\n", + iface, mesh_in, options, adjacency_in, adjacency_out, face_remap, vertex_remap, + max_face_infl, num_bone_combinations, bone_combination_table, mesh_out); return E_NOTIMPL; } -static HRESULT WINAPI ID3DXSkinInfoImpl_ConvertToIndexedBlendedMesh(ID3DXSkinInfo *iface, ID3DXMesh *mesh_in, +static HRESULT WINAPI d3dx9_skin_info_ConvertToIndexedBlendedMesh(ID3DXSkinInfo *iface, ID3DXMesh *mesh_in, DWORD options, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap, DWORD *max_face_infl, DWORD *num_bone_combinations, ID3DXBuffer **bone_combination_table, ID3DXMesh **mesh_out) { - ID3DXSkinInfoImpl *This = impl_from_ID3DXSkinInfo(iface); - - FIXME("(%p, %p, %x, %p, %p, %p, %p, %p, %p, %p, %p): stub\n", - This, mesh_in, options, adjacency_in, adjacency_out, face_remap, vertex_remap, - max_face_infl, num_bone_combinations, bone_combination_table, mesh_out); + FIXME("iface %p, mesh_in %p, options %#x, adjacency_in %p, adjacency_out %p, face_remap %p, vertex_remap %p, " + "max_face_infl %p, num_bone_combinations %p, bone_combination_table %p, mesh_out %p stub!\n", + iface, mesh_in, options, adjacency_in, adjacency_out, face_remap, vertex_remap, + max_face_infl, num_bone_combinations, bone_combination_table, mesh_out); return E_NOTIMPL; } -static const struct ID3DXSkinInfoVtbl ID3DXSkinInfoImpl_Vtbl = +static const struct ID3DXSkinInfoVtbl d3dx9_skin_info_vtbl = { - /* IUnknown methods */ - ID3DXSkinInfoImpl_QueryInterface, - ID3DXSkinInfoImpl_AddRef, - ID3DXSkinInfoImpl_Release, - /* ID3DXSkinInfo */ - ID3DXSkinInfoImpl_SetBoneInfluence, - ID3DXSkinInfoImpl_SetBoneVertexInfluence, - ID3DXSkinInfoImpl_GetNumBoneInfluences, - ID3DXSkinInfoImpl_GetBoneInfluence, - ID3DXSkinInfoImpl_GetBoneVertexInfluence, - ID3DXSkinInfoImpl_GetMaxVertexInfluences, - ID3DXSkinInfoImpl_GetNumBones, - ID3DXSkinInfoImpl_FindBoneVertexInfluenceIndex, - ID3DXSkinInfoImpl_GetMaxFaceInfluences, - ID3DXSkinInfoImpl_SetMinBoneInfluence, - ID3DXSkinInfoImpl_GetMinBoneInfluence, - ID3DXSkinInfoImpl_SetBoneName, - ID3DXSkinInfoImpl_GetBoneName, - ID3DXSkinInfoImpl_SetBoneOffsetMatrix, - ID3DXSkinInfoImpl_GetBoneOffsetMatrix, - ID3DXSkinInfoImpl_Clone, - ID3DXSkinInfoImpl_Remap, - ID3DXSkinInfoImpl_SetFVF, - ID3DXSkinInfoImpl_SetDeclaration, - ID3DXSkinInfoImpl_GetFVF, - ID3DXSkinInfoImpl_GetDeclaration, - ID3DXSkinInfoImpl_UpdateSkinnedMesh, - ID3DXSkinInfoImpl_ConvertToBlendedMesh, - ID3DXSkinInfoImpl_ConvertToIndexedBlendedMesh + d3dx9_skin_info_QueryInterface, + d3dx9_skin_info_AddRef, + d3dx9_skin_info_Release, + d3dx9_skin_info_SetBoneInfluence, + d3dx9_skin_info_SetBoneVertexInfluence, + d3dx9_skin_info_GetNumBoneInfluences, + d3dx9_skin_info_GetBoneInfluence, + d3dx9_skin_info_GetBoneVertexInfluence, + d3dx9_skin_info_GetMaxVertexInfluences, + d3dx9_skin_info_GetNumBones, + d3dx9_skin_info_FindBoneVertexInfluenceIndex, + d3dx9_skin_info_GetMaxFaceInfluences, + d3dx9_skin_info_SetMinBoneInfluence, + d3dx9_skin_info_GetMinBoneInfluence, + d3dx9_skin_info_SetBoneName, + d3dx9_skin_info_GetBoneName, + d3dx9_skin_info_SetBoneOffsetMatrix, + d3dx9_skin_info_GetBoneOffsetMatrix, + d3dx9_skin_info_Clone, + d3dx9_skin_info_Remap, + d3dx9_skin_info_SetFVF, + d3dx9_skin_info_SetDeclaration, + d3dx9_skin_info_GetFVF, + d3dx9_skin_info_GetDeclaration, + d3dx9_skin_info_UpdateSkinnedMesh, + d3dx9_skin_info_ConvertToBlendedMesh, + d3dx9_skin_info_ConvertToIndexedBlendedMesh, }; HRESULT WINAPI D3DXCreateSkinInfo(DWORD num_vertices, const D3DVERTEXELEMENT9 *declaration, DWORD num_bones, ID3DXSkinInfo **skin_info) { HRESULT hr; - ID3DXSkinInfoImpl *object = NULL; static const D3DVERTEXELEMENT9 empty_declaration = D3DDECL_END(); + struct d3dx9_skin_info *object = NULL; - TRACE("(%u, %p, %u, %p)\n", num_vertices, declaration, num_bones, skin_info); + TRACE("num_vertices %u, declaration %p, num_bones %u, skin_info %p.\n", + num_vertices, declaration, num_bones, skin_info); if (!skin_info || !declaration) return D3DERR_INVALIDCALL; @@ -462,7 +452,7 @@ HRESULT WINAPI D3DXCreateSkinInfo(DWORD num_vertices, const D3DVERTEXELEMENT9 *d if (!object) return E_OUTOFMEMORY; - object->ID3DXSkinInfo_iface.lpVtbl = &ID3DXSkinInfoImpl_Vtbl; + object->ID3DXSkinInfo_iface.lpVtbl = &d3dx9_skin_info_vtbl; object->ref = 1; object->num_vertices = num_vertices; object->num_bones = num_bones; @@ -475,8 +465,8 @@ HRESULT WINAPI D3DXCreateSkinInfo(DWORD num_vertices, const D3DVERTEXELEMENT9 *d goto error; } - hr = ID3DXSkinInfoImpl_SetDeclaration(&object->ID3DXSkinInfo_iface, declaration); - if (FAILED(hr)) goto error; + if (FAILED(hr = d3dx9_skin_info_SetDeclaration(&object->ID3DXSkinInfo_iface, declaration))) + goto error; *skin_info = &object->ID3DXSkinInfo_iface; diff --git a/reactos/dll/directx/wine/d3dx9_36/sprite.c b/reactos/dll/directx/wine/d3dx9_36/sprite.c index f320eaffb5f..4fdec6a5863 100644 --- a/reactos/dll/directx/wine/d3dx9_36/sprite.c +++ b/reactos/dll/directx/wine/d3dx9_36/sprite.c @@ -22,13 +22,15 @@ /* the combination of all possible D3DXSPRITE flags */ #define D3DXSPRITE_FLAGLIMIT 511 -typedef struct _SPRITEVERTEX { +struct sprite_vertex +{ D3DXVECTOR3 pos; DWORD col; D3DXVECTOR2 tex; -} SPRITEVERTEX; +}; -typedef struct _SPRITE { +struct sprite +{ IDirect3DTexture9 *texture; UINT texw, texh; RECT rect; @@ -36,9 +38,9 @@ typedef struct _SPRITE { D3DXVECTOR3 pos; D3DCOLOR color; D3DXMATRIX transform; -} SPRITE; +}; -typedef struct ID3DXSpriteImpl +struct d3dx9_sprite { ID3DXSprite ID3DXSprite_iface; LONG ref; @@ -56,17 +58,17 @@ typedef struct ID3DXSpriteImpl DWORD maxanisotropy; DWORD alphacmp_caps; - SPRITE *sprites; + struct sprite *sprites; int sprite_count; /* number of sprites to be drawn */ int allocated_sprites; /* number of (pre-)allocated sprites */ -} ID3DXSpriteImpl; +}; -static inline ID3DXSpriteImpl *impl_from_ID3DXSprite(ID3DXSprite *iface) +static inline struct d3dx9_sprite *impl_from_ID3DXSprite(ID3DXSprite *iface) { - return CONTAINING_RECORD(iface, ID3DXSpriteImpl, ID3DXSprite_iface); + return CONTAINING_RECORD(iface, struct d3dx9_sprite, ID3DXSprite_iface); } -static HRESULT WINAPI ID3DXSpriteImpl_QueryInterface(ID3DXSprite *iface, REFIID riid, void **out) +static HRESULT WINAPI d3dx9_sprite_QueryInterface(ID3DXSprite *iface, REFIID riid, void **out) { TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); @@ -84,93 +86,108 @@ static HRESULT WINAPI ID3DXSpriteImpl_QueryInterface(ID3DXSprite *iface, REFIID return E_NOINTERFACE; } -static ULONG WINAPI ID3DXSpriteImpl_AddRef(ID3DXSprite *iface) +static ULONG WINAPI d3dx9_sprite_AddRef(ID3DXSprite *iface) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); - ULONG ref=InterlockedIncrement(&This->ref); - TRACE("(%p)->(): AddRef from %d\n", This, ref-1); - return ref; + struct d3dx9_sprite *sprite = impl_from_ID3DXSprite(iface); + ULONG refcount = InterlockedIncrement(&sprite->ref); + + TRACE("%p increasing refcount to %u.\n", sprite, refcount); + + return refcount; } -static ULONG WINAPI ID3DXSpriteImpl_Release(ID3DXSprite *iface) +static ULONG WINAPI d3dx9_sprite_Release(ID3DXSprite *iface) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); - ULONG ref=InterlockedDecrement(&This->ref); + struct d3dx9_sprite *sprite = impl_from_ID3DXSprite(iface); + ULONG refcount = InterlockedDecrement(&sprite->ref); - TRACE("(%p)->(): ReleaseRef to %d\n", This, ref); + TRACE("%p decreasing refcount to %u.\n", sprite, refcount); - if(ref==0) { - if(This->sprites) { + if (!refcount) + { + if (sprite->sprites) + { int i; - for(i=0;isprite_count;i++) - if(This->sprites[i].texture) - IDirect3DTexture9_Release(This->sprites[i].texture); - HeapFree(GetProcessHeap(), 0, This->sprites); + for (i = 0; i < sprite->sprite_count; ++i) + { + if (sprite->sprites[i].texture) + IDirect3DTexture9_Release(sprite->sprites[i].texture); + } + + HeapFree(GetProcessHeap(), 0, sprite->sprites); } - if(This->stateblock) IDirect3DStateBlock9_Release(This->stateblock); - if(This->vdecl) IDirect3DVertexDeclaration9_Release(This->vdecl); - if(This->device) IDirect3DDevice9_Release(This->device); - HeapFree(GetProcessHeap(), 0, This); + + if (sprite->stateblock) + IDirect3DStateBlock9_Release(sprite->stateblock); + if (sprite->vdecl) + IDirect3DVertexDeclaration9_Release(sprite->vdecl); + if (sprite->device) + IDirect3DDevice9_Release(sprite->device); + HeapFree(GetProcessHeap(), 0, sprite); } - return ref; + + return refcount; } -static HRESULT WINAPI ID3DXSpriteImpl_GetDevice(struct ID3DXSprite *iface, struct IDirect3DDevice9 **device) +static HRESULT WINAPI d3dx9_sprite_GetDevice(struct ID3DXSprite *iface, struct IDirect3DDevice9 **device) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); + struct d3dx9_sprite *sprite = impl_from_ID3DXSprite(iface); - TRACE("(%p)->(%p)\n", This, device); + TRACE("iface %p, device %p.\n", iface, device); - if(device==NULL) return D3DERR_INVALIDCALL; - *device=This->device; - IDirect3DDevice9_AddRef(This->device); + if (!device) + return D3DERR_INVALIDCALL; + *device = sprite->device; + IDirect3DDevice9_AddRef(sprite->device); return D3D_OK; } -static HRESULT WINAPI ID3DXSpriteImpl_GetTransform(ID3DXSprite *iface, D3DXMATRIX *transform) +static HRESULT WINAPI d3dx9_sprite_GetTransform(ID3DXSprite *iface, D3DXMATRIX *transform) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); + struct d3dx9_sprite *sprite = impl_from_ID3DXSprite(iface); - TRACE("(%p)->(%p)\n", This, transform); + TRACE("iface %p, transform %p.\n", iface, transform); - if(transform==NULL) return D3DERR_INVALIDCALL; - *transform=This->transform; + if (!transform) + return D3DERR_INVALIDCALL; + *transform = sprite->transform; return D3D_OK; } -static HRESULT WINAPI ID3DXSpriteImpl_SetTransform(ID3DXSprite *iface, CONST D3DXMATRIX *transform) +static HRESULT WINAPI d3dx9_sprite_SetTransform(ID3DXSprite *iface, const D3DXMATRIX *transform) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); + struct d3dx9_sprite *sprite = impl_from_ID3DXSprite(iface); - TRACE("(%p)->(%p)\n", This, transform); + TRACE("iface %p, transform %p.\n", iface, transform); - if(transform==NULL) return D3DERR_INVALIDCALL; - This->transform=*transform; + if (!transform) + return D3DERR_INVALIDCALL; + sprite->transform = *transform; return D3D_OK; } -static HRESULT WINAPI ID3DXSpriteImpl_SetWorldViewRH(ID3DXSprite *iface, CONST D3DXMATRIX *world, - CONST D3DXMATRIX *view) +static HRESULT WINAPI d3dx9_sprite_SetWorldViewRH(ID3DXSprite *iface, + const D3DXMATRIX *world, const D3DXMATRIX *view) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); - FIXME("(%p)->(%p, %p): stub\n", This, world, view); + FIXME("iface %p, world %p, view %p stub!\n", iface, world, view); + return E_NOTIMPL; } -static HRESULT WINAPI ID3DXSpriteImpl_SetWorldViewLH(ID3DXSprite *iface, CONST D3DXMATRIX *world, - CONST D3DXMATRIX *view) +static HRESULT WINAPI d3dx9_sprite_SetWorldViewLH(ID3DXSprite *iface, + const D3DXMATRIX *world, const D3DXMATRIX *view) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); - FIXME("(%p)->(%p, %p): stub\n", This, world, view); + FIXME("iface %p, world %p, view %p stub!\n", iface, world, view); + return E_NOTIMPL; } /* Helper function */ -static void set_states(ID3DXSpriteImpl *object) +static void set_states(struct d3dx9_sprite *object) { D3DXMATRIX mat; D3DVIEWPORT9 vp; @@ -251,12 +268,12 @@ static void set_states(ID3DXSpriteImpl *object) IDirect3DDevice9_SetTransform(object->device, D3DTS_PROJECTION, &mat); } -static HRESULT WINAPI ID3DXSpriteImpl_Begin(ID3DXSprite *iface, DWORD flags) +static HRESULT WINAPI d3dx9_sprite_Begin(ID3DXSprite *iface, DWORD flags) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); + struct d3dx9_sprite *This = impl_from_ID3DXSprite(iface); HRESULT hr; - TRACE("(%p)->(%#x)\n", This, flags); + TRACE("iface %p, flags %#x.\n", iface, flags); if(flags>D3DXSPRITE_FLAGLIMIT || This->ready) return D3DERR_INVALIDCALL; @@ -273,7 +290,7 @@ D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often) D3DXSPRITE_DONOTMODIFY_RENDERSTATE | D3DXSPRITE_OBJECTSPACE | D3DXSPRITE_SORT_DEPTH_BACKTOFRONT)) FIXME("Flags unsupported: %#x\n", flags); - /* These flags should only matter to performances */ + /* These flags should only matter to performance */ else if(flags & (D3DXSPRITE_SORT_DEPTH_FRONTTOBACK | D3DXSPRITE_SORT_TEXTURE)) TRACE("Flags unsupported: %#x\n", flags); @@ -297,7 +314,7 @@ D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often) set_states(This); IDirect3DDevice9_SetVertexDeclaration(This->device, This->vdecl); - IDirect3DDevice9_SetStreamSource(This->device, 0, NULL, 0, sizeof(SPRITEVERTEX)); + IDirect3DDevice9_SetStreamSource(This->device, 0, NULL, 0, sizeof(struct sprite_vertex)); IDirect3DDevice9_SetIndices(This->device, NULL); IDirect3DDevice9_SetTexture(This->device, 0, NULL); @@ -315,10 +332,10 @@ D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often) return D3D_OK; } -static HRESULT WINAPI ID3DXSpriteImpl_Draw(ID3DXSprite *iface, IDirect3DTexture9 *texture, +static HRESULT WINAPI d3dx9_sprite_Draw(ID3DXSprite *iface, IDirect3DTexture9 *texture, const RECT *rect, const D3DXVECTOR3 *center, const D3DXVECTOR3 *position, D3DCOLOR color) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); + struct d3dx9_sprite *This = impl_from_ID3DXSprite(iface); D3DSURFACE_DESC texdesc; TRACE("iface %p, texture %p, rect %s, center %p, position %p, color 0x%08x.\n", @@ -327,12 +344,16 @@ static HRESULT WINAPI ID3DXSpriteImpl_Draw(ID3DXSprite *iface, IDirect3DTexture9 if(texture==NULL) return D3DERR_INVALIDCALL; if(!This->ready) return D3DERR_INVALIDCALL; - if(This->allocated_sprites==0) { - This->sprites=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 32*sizeof(SPRITE)); - This->allocated_sprites=32; - } else if(This->allocated_sprites<=This->sprite_count) { - This->allocated_sprites=This->allocated_sprites*3/2; - This->sprites=HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, This->sprites, This->allocated_sprites*sizeof(SPRITE)); + if (!This->allocated_sprites) + { + This->sprites = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 32 * sizeof(*This->sprites)); + This->allocated_sprites = 32; + } + else if (This->allocated_sprites <= This->sprite_count) + { + This->allocated_sprites += This->allocated_sprites / 2; + This->sprites = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, + This->sprites, This->allocated_sprites * sizeof(*This->sprites)); } This->sprites[This->sprite_count].texture=texture; if(!(This->flags & D3DXSPRITE_DO_NOT_ADDREF_TEXTURE)) @@ -377,19 +398,19 @@ static HRESULT WINAPI ID3DXSpriteImpl_Draw(ID3DXSprite *iface, IDirect3DTexture9 return D3D_OK; } -static HRESULT WINAPI ID3DXSpriteImpl_Flush(ID3DXSprite *iface) +static HRESULT WINAPI d3dx9_sprite_Flush(ID3DXSprite *iface) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); - SPRITEVERTEX *vertices; + struct d3dx9_sprite *This = impl_from_ID3DXSprite(iface); + struct sprite_vertex *vertices; int i, count=0, start; - TRACE("(%p)->()\n", This); + TRACE("iface %p.\n", iface); if(!This->ready) return D3DERR_INVALIDCALL; if(!This->sprite_count) return D3D_OK; /* TODO: use of a vertex buffer here */ - vertices=HeapAlloc(GetProcessHeap(), 0, sizeof(SPRITEVERTEX)*6*This->sprite_count); + vertices = HeapAlloc(GetProcessHeap(), 0, sizeof(*vertices) * 6 * This->sprite_count); for(start=0;startsprite_count;start+=count,count=0) { i=start; @@ -426,9 +447,8 @@ static HRESULT WINAPI ID3DXSpriteImpl_Flush(ID3DXSprite *iface) vertices[6*i+4]=vertices[6*i]; vertices[6*i+5]=vertices[6*i+2]; - D3DXVec3TransformCoordArray(&vertices[6*i].pos, sizeof(SPRITEVERTEX), - &vertices[6*i].pos, sizeof(SPRITEVERTEX), - &This->sprites[i].transform, 6); + D3DXVec3TransformCoordArray(&vertices[6 * i].pos, sizeof(*vertices), + &vertices[6 * i].pos, sizeof(*vertices), &This->sprites[i].transform, 6); count++; i++; } @@ -436,7 +456,8 @@ static HRESULT WINAPI ID3DXSpriteImpl_Flush(ID3DXSprite *iface) IDirect3DDevice9_SetTexture(This->device, 0, (struct IDirect3DBaseTexture9 *)This->sprites[start].texture); IDirect3DDevice9_SetVertexDeclaration(This->device, This->vdecl); - IDirect3DDevice9_DrawPrimitiveUP(This->device, D3DPT_TRIANGLELIST, 2*count, vertices+6*start, sizeof(SPRITEVERTEX)); + IDirect3DDevice9_DrawPrimitiveUP(This->device, D3DPT_TRIANGLELIST, + 2 * count, vertices + 6 * start, sizeof(*vertices)); } HeapFree(GetProcessHeap(), 0, vertices); @@ -451,34 +472,37 @@ static HRESULT WINAPI ID3DXSpriteImpl_Flush(ID3DXSprite *iface) return D3D_OK; } -static HRESULT WINAPI ID3DXSpriteImpl_End(ID3DXSprite *iface) +static HRESULT WINAPI d3dx9_sprite_End(ID3DXSprite *iface) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); + struct d3dx9_sprite *sprite = impl_from_ID3DXSprite(iface); - TRACE("(%p)->()\n", This); + TRACE("iface %p.\n", iface); - if(!This->ready) return D3DERR_INVALIDCALL; + if (!sprite->ready) + return D3DERR_INVALIDCALL; ID3DXSprite_Flush(iface); - if(!(This->flags & D3DXSPRITE_DONOTSAVESTATE)) - if(This->stateblock) IDirect3DStateBlock9_Apply(This->stateblock); /* Restore old state */ + if (sprite->stateblock && !(sprite->flags & D3DXSPRITE_DONOTSAVESTATE)) + IDirect3DStateBlock9_Apply(sprite->stateblock); /* Restore old state */ - This->ready=FALSE; + sprite->ready = FALSE; return D3D_OK; } -static HRESULT WINAPI ID3DXSpriteImpl_OnLostDevice(ID3DXSprite *iface) +static HRESULT WINAPI d3dx9_sprite_OnLostDevice(ID3DXSprite *iface) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); + struct d3dx9_sprite *sprite = impl_from_ID3DXSprite(iface); - TRACE("(%p)->()\n", This); + TRACE("iface %p.\n", iface); - if(This->stateblock) IDirect3DStateBlock9_Release(This->stateblock); - if(This->vdecl) IDirect3DVertexDeclaration9_Release(This->vdecl); - This->vdecl=NULL; - This->stateblock=NULL; + if (sprite->stateblock) + IDirect3DStateBlock9_Release(sprite->stateblock); + if (sprite->vdecl) + IDirect3DVertexDeclaration9_Release(sprite->vdecl); + sprite->vdecl = NULL; + sprite->stateblock = NULL; /* Reset some variables */ ID3DXSprite_OnResetDevice(iface); @@ -486,21 +510,22 @@ static HRESULT WINAPI ID3DXSpriteImpl_OnLostDevice(ID3DXSprite *iface) return D3D_OK; } -static HRESULT WINAPI ID3DXSpriteImpl_OnResetDevice(ID3DXSprite *iface) +static HRESULT WINAPI d3dx9_sprite_OnResetDevice(ID3DXSprite *iface) { - ID3DXSpriteImpl *This = impl_from_ID3DXSprite(iface); + struct d3dx9_sprite *sprite = impl_from_ID3DXSprite(iface); int i; - TRACE("(%p)->()\n", This); + TRACE("iface %p.\n", iface); - for(i=0;isprite_count;i++) - if(This->sprites[i].texture) - IDirect3DTexture9_Release(This->sprites[i].texture); + for (i = 0; i < sprite->sprite_count; ++i) + { + if (sprite->sprites[i].texture) + IDirect3DTexture9_Release(sprite->sprites[i].texture); + } - This->sprite_count=0; - - This->flags=0; - This->ready=FALSE; + sprite->sprite_count = 0; + sprite->flags = 0; + sprite->ready = FALSE; /* keep matrices */ /* device objects get restored on Begin */ @@ -508,41 +533,39 @@ static HRESULT WINAPI ID3DXSpriteImpl_OnResetDevice(ID3DXSprite *iface) return D3D_OK; } -static const ID3DXSpriteVtbl D3DXSprite_Vtbl = +static const ID3DXSpriteVtbl d3dx9_sprite_vtbl = { - /*** IUnknown methods ***/ - ID3DXSpriteImpl_QueryInterface, - ID3DXSpriteImpl_AddRef, - ID3DXSpriteImpl_Release, - /*** ID3DXSprite methods ***/ - ID3DXSpriteImpl_GetDevice, - ID3DXSpriteImpl_GetTransform, - ID3DXSpriteImpl_SetTransform, - ID3DXSpriteImpl_SetWorldViewRH, - ID3DXSpriteImpl_SetWorldViewLH, - ID3DXSpriteImpl_Begin, - ID3DXSpriteImpl_Draw, - ID3DXSpriteImpl_Flush, - ID3DXSpriteImpl_End, - ID3DXSpriteImpl_OnLostDevice, - ID3DXSpriteImpl_OnResetDevice + d3dx9_sprite_QueryInterface, + d3dx9_sprite_AddRef, + d3dx9_sprite_Release, + d3dx9_sprite_GetDevice, + d3dx9_sprite_GetTransform, + d3dx9_sprite_SetTransform, + d3dx9_sprite_SetWorldViewRH, + d3dx9_sprite_SetWorldViewLH, + d3dx9_sprite_Begin, + d3dx9_sprite_Draw, + d3dx9_sprite_Flush, + d3dx9_sprite_End, + d3dx9_sprite_OnLostDevice, + d3dx9_sprite_OnResetDevice, }; HRESULT WINAPI D3DXCreateSprite(struct IDirect3DDevice9 *device, struct ID3DXSprite **sprite) { - ID3DXSpriteImpl *object; + struct d3dx9_sprite *object; D3DCAPS9 caps; - TRACE("(%p, %p)\n", device, sprite); + TRACE("device %p, sprite %p.\n", device, sprite); if(device==NULL || sprite==NULL) return D3DERR_INVALIDCALL; - object=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ID3DXSpriteImpl)); - if(object==NULL) { - *sprite=NULL; + if (!(object=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) + { + *sprite = NULL; return E_OUTOFMEMORY; } - object->ID3DXSprite_iface.lpVtbl = &D3DXSprite_Vtbl; + object->ID3DXSprite_iface.lpVtbl = &d3dx9_sprite_vtbl; object->ref=1; object->device=device; IUnknown_AddRef(device); diff --git a/reactos/dll/directx/wine/d3dx9_36/surface.c b/reactos/dll/directx/wine/d3dx9_36/surface.c index bd141c18563..29914c5b4d8 100644 --- a/reactos/dll/directx/wine/d3dx9_36/surface.c +++ b/reactos/dll/directx/wine/d3dx9_36/surface.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2009-2010 Tony Wasserka - * Copyright (C) 2012 Jأ³zef Kucia + * Copyright (C) 2012 Józef Kucia * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -149,7 +149,13 @@ static D3DFORMAT dds_fourcc_to_d3dformat(DWORD fourcc) MAKEFOURCC('D','X','T','2'), MAKEFOURCC('D','X','T','3'), MAKEFOURCC('D','X','T','4'), - MAKEFOURCC('D','X','T','5') + MAKEFOURCC('D','X','T','5'), + D3DFMT_R16F, + D3DFMT_G16R16F, + D3DFMT_A16B16G16R16F, + D3DFMT_R32F, + D3DFMT_G32R32F, + D3DFMT_A32B32G32R32F, }; for (i = 0; i < sizeof(known_fourcc) / sizeof(known_fourcc[0]); i++) @@ -255,6 +261,11 @@ static D3DFORMAT dds_bump_to_d3dformat(const struct dds_pixel_format *pixel_form static D3DFORMAT dds_pixel_format_to_d3dformat(const struct dds_pixel_format *pixel_format) { + TRACE("pixel_format: size %u, flags %#x, fourcc %#x, bpp %u.\n", pixel_format->size, + pixel_format->flags, pixel_format->fourcc, pixel_format->bpp); + TRACE("rmask %#x, gmask %#x, bmask %#x, amask %#x.\n", pixel_format->rmask, pixel_format->gmask, + pixel_format->bmask, pixel_format->amask); + if (pixel_format->flags & DDS_PF_FOURCC) return dds_fourcc_to_d3dformat(pixel_format->fourcc); if (pixel_format->flags & DDS_PF_RGB) @@ -524,8 +535,8 @@ HRESULT load_volume_from_dds(IDirect3DVolume9 *dst_volume, const PALETTEENTRY *d } HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, const PALETTEENTRY *palette, - DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info) - + DWORD filter, D3DCOLOR color_key, const D3DXIMAGE_INFO *src_info, unsigned int skip_levels, + unsigned int *loaded_miplevels) { HRESULT hr; RECT src_rect; @@ -538,31 +549,45 @@ HRESULT load_texture_from_dds(IDirect3DTexture9 *texture, const void *src_data, const struct dds_header *header = src_data; const BYTE *pixels = (BYTE *)(header + 1); - /* Loading a cube texture as a simple texture is also supported (only first face texture is taken) */ - if ((src_info->ResourceType != D3DRTYPE_TEXTURE) && (src_info->ResourceType != D3DRTYPE_CUBETEXTURE)) + /* Loading a cube texture as a simple texture is also supported + * (only first face texture is taken). Same with volume textures. */ + if ((src_info->ResourceType != D3DRTYPE_TEXTURE) + && (src_info->ResourceType != D3DRTYPE_CUBETEXTURE) + && (src_info->ResourceType != D3DRTYPE_VOLUMETEXTURE)) + { + WARN("Trying to load a %u resource as a 2D texture, returning failure.\n", src_info->ResourceType); return D3DXERR_INVALIDDATA; + } width = src_info->Width; height = src_info->Height; mip_levels = min(src_info->MipLevels, IDirect3DTexture9_GetLevelCount(texture)); - for (mip_level = 0; mip_level < mip_levels; mip_level++) + if (src_info->ResourceType == D3DRTYPE_VOLUMETEXTURE) + mip_levels = 1; + for (mip_level = 0; mip_level < mip_levels + skip_levels; ++mip_level) { hr = calculate_dds_surface_size(src_info->Format, width, height, &src_pitch, &mip_level_size); if (FAILED(hr)) return hr; - SetRect(&src_rect, 0, 0, width, height); + if (mip_level >= skip_levels) + { + SetRect(&src_rect, 0, 0, width, height); - IDirect3DTexture9_GetSurfaceLevel(texture, mip_level, &surface); - hr = D3DXLoadSurfaceFromMemory(surface, palette, NULL, pixels, src_info->Format, src_pitch, - NULL, &src_rect, filter, color_key); - IDirect3DSurface9_Release(surface); - if (FAILED(hr)) return hr; + IDirect3DTexture9_GetSurfaceLevel(texture, mip_level - skip_levels, &surface); + hr = D3DXLoadSurfaceFromMemory(surface, palette, NULL, pixels, src_info->Format, src_pitch, + NULL, &src_rect, filter, color_key); + IDirect3DSurface9_Release(surface); + if (FAILED(hr)) + return hr; + } pixels += mip_level_size; width = max(1, width / 2); height = max(1, height / 2); } + *loaded_miplevels = mip_levels - skip_levels; + return D3D_OK; } @@ -895,13 +920,13 @@ HRESULT WINAPI D3DXGetImageInfoFromFileInMemory(const void *data, UINT datasize, * D3DERR_INVALIDCALL, if file is NULL * */ -HRESULT WINAPI D3DXGetImageInfoFromFileA(LPCSTR file, D3DXIMAGE_INFO *info) +HRESULT WINAPI D3DXGetImageInfoFromFileA(const char *file, D3DXIMAGE_INFO *info) { - LPWSTR widename; + WCHAR *widename; HRESULT hr; int strlength; - TRACE("(%s, %p): relay\n", debugstr_a(file), info); + TRACE("file %s, info %p.\n", debugstr_a(file), info); if( !file ) return D3DERR_INVALIDCALL; @@ -1010,7 +1035,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface, const RECT *pSrcRect, DWORD dwFilter, D3DCOLOR Colorkey, D3DXIMAGE_INFO *pSrcInfo) { D3DXIMAGE_INFO imginfo; - HRESULT hr; + HRESULT hr, com_init; IWICImagingFactory *factory = NULL; IWICBitmapDecoder *decoder; @@ -1063,7 +1088,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileInMemory(IDirect3DSurface9 *pDestSurface, if (imginfo.ImageFileFormat == D3DXIFF_DIB) convert_dib_to_bmp((void**)&pSrcData, &SrcDataSize); - CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + com_init = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); if (FAILED(CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IWICImagingFactory, (void**)&factory))) goto cleanup_err; @@ -1166,7 +1191,8 @@ cleanup_err: if (factory) IWICImagingFactory_Release(factory); - CoUninitialize(); + if (SUCCEEDED(com_init)) + CoUninitialize(); if (imginfo.ImageFileFormat == D3DXIFF_DIB) HeapFree(GetProcessHeap(), 0, (void*)pSrcData); @@ -1184,7 +1210,7 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface, const PALETTEENTRY *dst_palette, const RECT *dst_rect, const char *src_file, const RECT *src_rect, DWORD filter, D3DCOLOR color_key, D3DXIMAGE_INFO *src_info) { - LPWSTR pWidename; + WCHAR *src_file_w; HRESULT hr; int strlength; @@ -1197,12 +1223,12 @@ HRESULT WINAPI D3DXLoadSurfaceFromFileA(IDirect3DSurface9 *dst_surface, return D3DERR_INVALIDCALL; strlength = MultiByteToWideChar(CP_ACP, 0, src_file, -1, NULL, 0); - pWidename = HeapAlloc(GetProcessHeap(), 0, strlength * sizeof(*pWidename)); - MultiByteToWideChar(CP_ACP, 0, src_file, -1, pWidename, strlength); + src_file_w = HeapAlloc(GetProcessHeap(), 0, strlength * sizeof(*src_file_w)); + MultiByteToWideChar(CP_ACP, 0, src_file, -1, src_file_w, strlength); hr = D3DXLoadSurfaceFromFileW(dst_surface, dst_palette, dst_rect, - pWidename, src_rect, filter, color_key, src_info); - HeapFree(GetProcessHeap(), 0, pWidename); + src_file_w, src_rect, filter, color_key, src_info); + HeapFree(GetProcessHeap(), 0, src_file_w); return hr; } @@ -1330,40 +1356,13 @@ static void init_argb_conversion_info(const struct pixel_format_desc *srcformat, } } -static DWORD dword_from_bytes(CONST BYTE *src, UINT bytes_per_pixel) -{ - DWORD ret = 0; - static BOOL fixme_once; - - if(bytes_per_pixel > sizeof(DWORD)) { - if(!fixme_once++) FIXME("Unsupported image: %u bytes per pixel\n", bytes_per_pixel); - bytes_per_pixel = sizeof(DWORD); - } - - memcpy(&ret, src, bytes_per_pixel); - return ret; -} - -static void dword_to_bytes(BYTE *dst, DWORD dword, UINT bytes_per_pixel) -{ - static BOOL fixme_once; - - if(bytes_per_pixel > sizeof(DWORD)) { - if(!fixme_once++) FIXME("Unsupported image: %u bytes per pixel\n", bytes_per_pixel); - ZeroMemory(dst, bytes_per_pixel); - bytes_per_pixel = sizeof(DWORD); - } - - memcpy(dst, &dword, bytes_per_pixel); -} - /************************************************************ * get_relevant_argb_components * * Extracts the relevant components from the source color and * drops the less significant bits if they aren't used by the destination format. */ -static void get_relevant_argb_components(CONST struct argb_conversion_info *info, CONST DWORD col, DWORD *out) +static void get_relevant_argb_components(const struct argb_conversion_info *info, DWORD col, DWORD *out) { UINT i = 0; for(;i < 4;i++) @@ -1377,7 +1376,7 @@ static void get_relevant_argb_components(CONST struct argb_conversion_info *info * Recombines the output of get_relevant_argb_components and converts * it to the destination format. */ -static DWORD make_argb_color(CONST struct argb_conversion_info *info, CONST DWORD *in) +static DWORD make_argb_color(const struct argb_conversion_info *info, const DWORD *in) { UINT i; DWORD val = 0; @@ -1394,55 +1393,78 @@ static DWORD make_argb_color(CONST struct argb_conversion_info *info, CONST DWOR return val; } -static void format_to_vec4(const struct pixel_format_desc *format, const DWORD *src, struct vec4 *dst) +/* It doesn't work for components bigger than 32 bits (or somewhat smaller but unaligned). */ +static void format_to_vec4(const struct pixel_format_desc *format, const BYTE *src, struct vec4 *dst) { - DWORD mask; + DWORD mask, tmp; + unsigned int c; - if (format->bits[1]) + for (c = 0; c < 4; ++c) { - mask = (1 << format->bits[1]) - 1; - dst->x = (float)((*src >> format->shift[1]) & mask) / mask; - } - else - dst->x = 1.0f; + static const unsigned int component_offsets[4] = {3, 0, 1, 2}; + float *dst_component = (float *)dst + component_offsets[c]; - if (format->bits[2]) - { - mask = (1 << format->bits[2]) - 1; - dst->y = (float)((*src >> format->shift[2]) & mask) / mask; - } - else - dst->y = 1.0f; + if (format->bits[c]) + { + mask = ~0u >> (32 - format->bits[c]); - if (format->bits[3]) - { - mask = (1 << format->bits[3]) - 1; - dst->z = (float)((*src >> format->shift[3]) & mask) / mask; - } - else - dst->z = 1.0f; + memcpy(&tmp, src + format->shift[c] / 8, + min(sizeof(DWORD), (format->shift[c] % 8 + format->bits[c] + 7) / 8)); - if (format->bits[0]) - { - mask = (1 << format->bits[0]) - 1; - dst->w = (float)((*src >> format->shift[0]) & mask) / mask; + if (format->type == FORMAT_ARGBF16) + *dst_component = float_16_to_32(tmp); + else if (format->type == FORMAT_ARGBF) + *dst_component = *(float *)&tmp; + else + *dst_component = (float)((tmp >> format->shift[c] % 8) & mask) / mask; + } + else + *dst_component = 1.0f; } - else - dst->w = 1.0f; } -static void format_from_vec4(const struct pixel_format_desc *format, const struct vec4 *src, DWORD *dst) +/* It doesn't work for components bigger than 32 bits. */ +static void format_from_vec4(const struct pixel_format_desc *format, const struct vec4 *src, BYTE *dst) { - *dst = 0; + DWORD v, mask32; + unsigned int c, i; - if (format->bits[1]) - *dst |= (DWORD)(src->x * ((1 << format->bits[1]) - 1) + 0.5f) << format->shift[1]; - if (format->bits[2]) - *dst |= (DWORD)(src->y * ((1 << format->bits[2]) - 1) + 0.5f) << format->shift[2]; - if (format->bits[3]) - *dst |= (DWORD)(src->z * ((1 << format->bits[3]) - 1) + 0.5f) << format->shift[3]; - if (format->bits[0]) - *dst |= (DWORD)(src->w * ((1 << format->bits[0]) - 1) + 0.5f) << format->shift[0]; + memset(dst, 0, format->bytes_per_pixel); + + for (c = 0; c < 4; ++c) + { + static const unsigned int component_offsets[4] = {3, 0, 1, 2}; + const float src_component = *((const float *)src + component_offsets[c]); + + if (!format->bits[c]) + continue; + + mask32 = ~0u >> (32 - format->bits[c]); + + if (format->type == FORMAT_ARGBF16) + v = float_32_to_16(src_component); + else if (format->type == FORMAT_ARGBF) + v = *(DWORD *)&src_component; + else + v = (DWORD)(src_component * ((1 << format->bits[c]) - 1) + 0.5f); + + for (i = format->shift[c] / 8 * 8; i < format->shift[c] + format->bits[c]; i += 8) + { + BYTE mask, byte; + + if (format->shift[c] > i) + { + mask = mask32 << (format->shift[c] - i); + byte = (v << (format->shift[c] - i)) & mask; + } + else + { + mask = mask32 >> (i - format->shift[c]); + byte = (v >> (i - format->shift[c])) & mask; + } + dst[i / 8] |= byte; + } + } } /************************************************************ @@ -1491,7 +1513,7 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit { struct argb_conversion_info conv_info, ck_conv_info; const struct pixel_format_desc *ck_format = NULL; - DWORD channels[4], pixel; + DWORD channels[4]; UINT min_width, min_height, min_depth; UINT x, y, z; @@ -1516,30 +1538,32 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit for (y = 0; y < min_height; y++) { const BYTE *src_ptr = src_slice_ptr + y * src_row_pitch; BYTE *dst_ptr = dst_slice_ptr + y * dst_row_pitch; - DWORD val; for (x = 0; x < min_width; x++) { - /* extract source color components */ - pixel = dword_from_bytes(src_ptr, src_format->bytes_per_pixel); - - if (!src_format->to_rgba && !dst_format->from_rgba) + if (!src_format->to_rgba && !dst_format->from_rgba + && src_format->bytes_per_pixel <= 4 && dst_format->bytes_per_pixel <= 4) { - get_relevant_argb_components(&conv_info, pixel, channels); + DWORD val; + + get_relevant_argb_components(&conv_info, *(DWORD *)src_ptr, channels); val = make_argb_color(&conv_info, channels); if (color_key) { - get_relevant_argb_components(&ck_conv_info, pixel, channels); - pixel = make_argb_color(&ck_conv_info, channels); - if (pixel == color_key) + DWORD ck_pixel; + + get_relevant_argb_components(&ck_conv_info, *(DWORD *)src_ptr, channels); + ck_pixel = make_argb_color(&ck_conv_info, channels); + if (ck_pixel == color_key) val &= ~conv_info.destmask[0]; } + memcpy(dst_ptr, &val, dst_format->bytes_per_pixel); } else { struct vec4 color, tmp; - format_to_vec4(src_format, &pixel, &color); + format_to_vec4(src_format, src_ptr, &color); if (src_format->to_rgba) src_format->to_rgba(&color, &tmp, palette); else @@ -1547,8 +1571,10 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit if (ck_format) { - format_from_vec4(ck_format, &tmp, &pixel); - if (pixel == color_key) + DWORD ck_pixel; + + format_from_vec4(ck_format, &tmp, (BYTE *)&ck_pixel); + if (ck_pixel == color_key) tmp.w = 0.0f; } @@ -1557,11 +1583,10 @@ void convert_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pit else color = tmp; - format_from_vec4(dst_format, &color, &val); + format_from_vec4(dst_format, &color, dst_ptr); } - dword_to_bytes(dst_ptr, val, dst_format->bytes_per_pixel); - src_ptr += src_format->bytes_per_pixel; + src_ptr += src_format->bytes_per_pixel; dst_ptr += dst_format->bytes_per_pixel; } @@ -1591,7 +1616,7 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic { struct argb_conversion_info conv_info, ck_conv_info; const struct pixel_format_desc *ck_format = NULL; - DWORD channels[4], pixel; + DWORD channels[4]; UINT x, y, z; ZeroMemory(channels, sizeof(channels)); @@ -1617,29 +1642,31 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic for (x = 0; x < dst_size->width; x++) { const BYTE *src_ptr = src_row_ptr + (x * src_size->width / dst_size->width) * src_format->bytes_per_pixel; - DWORD val; - /* extract source color components */ - pixel = dword_from_bytes(src_ptr, src_format->bytes_per_pixel); - - if (!src_format->to_rgba && !dst_format->from_rgba) + if (!src_format->to_rgba && !dst_format->from_rgba + && src_format->bytes_per_pixel <= 4 && dst_format->bytes_per_pixel <= 4) { - get_relevant_argb_components(&conv_info, pixel, channels); + DWORD val; + + get_relevant_argb_components(&conv_info, *(DWORD *)src_ptr, channels); val = make_argb_color(&conv_info, channels); if (color_key) { - get_relevant_argb_components(&ck_conv_info, pixel, channels); - pixel = make_argb_color(&ck_conv_info, channels); - if (pixel == color_key) + DWORD ck_pixel; + + get_relevant_argb_components(&ck_conv_info, *(DWORD *)src_ptr, channels); + ck_pixel = make_argb_color(&ck_conv_info, channels); + if (ck_pixel == color_key) val &= ~conv_info.destmask[0]; } + memcpy(dst_ptr, &val, dst_format->bytes_per_pixel); } else { struct vec4 color, tmp; - format_to_vec4(src_format, &pixel, &color); + format_to_vec4(src_format, src_ptr, &color); if (src_format->to_rgba) src_format->to_rgba(&color, &tmp, palette); else @@ -1647,8 +1674,10 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic if (ck_format) { - format_from_vec4(ck_format, &tmp, &pixel); - if (pixel == color_key) + DWORD ck_pixel; + + format_from_vec4(ck_format, &tmp, (BYTE *)&ck_pixel); + if (ck_pixel == color_key) tmp.w = 0.0f; } @@ -1657,10 +1686,9 @@ void point_filter_argb_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slic else color = tmp; - format_from_vec4(dst_format, &color, &val); + format_from_vec4(dst_format, &color, dst_ptr); } - dword_to_bytes(dst_ptr, val, dst_format->bytes_per_pixel); dst_ptr += dst_format->bytes_per_pixel; } } diff --git a/reactos/dll/directx/wine/d3dx9_36/texture.c b/reactos/dll/directx/wine/d3dx9_36/texture.c index bc3daf6bc1d..5ed137e60bb 100644 --- a/reactos/dll/directx/wine/d3dx9_36/texture.c +++ b/reactos/dll/directx/wine/d3dx9_36/texture.c @@ -191,6 +191,7 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN D3DDISPLAYMODE mode; HRESULT hr; D3DFORMAT usedformat = D3DFMT_UNKNOWN; + const struct pixel_format_desc *fmt; TRACE("(%p, %p, %p, %p, %u, %p, %u)\n", device, width, height, miplevels, usage, format, pool); @@ -207,73 +208,6 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN if ((pool != D3DPOOL_DEFAULT) && (pool != D3DPOOL_MANAGED) && (pool != D3DPOOL_SYSTEMMEM) && (pool != D3DPOOL_SCRATCH)) return D3DERR_INVALIDCALL; - /* width and height */ - if (FAILED(IDirect3DDevice9_GetDeviceCaps(device, &caps))) - return D3DERR_INVALIDCALL; - - /* 256 x 256 default width/height */ - if ((w == D3DX_DEFAULT) && (h == D3DX_DEFAULT)) - w = h = 256; - else if (w == D3DX_DEFAULT) - w = (height ? h : 256); - else if (h == D3DX_DEFAULT) - h = (width ? w : 256); - - /* ensure width/height is power of 2 */ - if ((caps.TextureCaps & D3DPTEXTURECAPS_POW2) && (!is_pow2(w))) - w = make_pow2(w); - - if (w > caps.MaxTextureWidth) - w = caps.MaxTextureWidth; - - if ((caps.TextureCaps & D3DPTEXTURECAPS_POW2) && (!is_pow2(h))) - h = make_pow2(h); - - if (h > caps.MaxTextureHeight) - h = caps.MaxTextureHeight; - - /* texture must be square? */ - if (caps.TextureCaps & D3DPTEXTURECAPS_SQUAREONLY) - { - if (w > h) - h = w; - else - w = h; - } - - if (width) - *width = w; - - if (height) - *height = h; - - /* miplevels */ - if (miplevels && (usage & D3DUSAGE_AUTOGENMIPMAP)) - { - if (*miplevels > 1) - *miplevels = 0; - } - else if (miplevels) - { - UINT max_mipmaps = 1; - - if (!width && !height) - max_mipmaps = 9; /* number of mipmaps in a 256x256 texture */ - else - { - UINT max_dimen = max(w, h); - - while (max_dimen > 1) - { - max_dimen >>= 1; - max_mipmaps++; - } - } - - if (*miplevels == 0 || *miplevels > max_mipmaps) - *miplevels = max_mipmaps; - } - /* format */ if (format) { @@ -299,17 +233,18 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN if ((usedformat == D3DFMT_UNKNOWN) || (usedformat == D3DX_DEFAULT)) usedformat = D3DFMT_A8R8G8B8; + fmt = get_format_info(usedformat); + hr = IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, mode.Format, usage, D3DRTYPE_TEXTURE, usedformat); - if (FAILED(hr)) { - /* Heuristic to choose the fallback format */ - const struct pixel_format_desc *fmt = get_format_info(usedformat); BOOL allow_24bits; int bestscore = INT_MIN, i = 0, j; unsigned int channels; - const struct pixel_format_desc *curfmt; + const struct pixel_format_desc *curfmt, *bestfmt = NULL; + + TRACE("Requested format not supported, looking for a fallback.\n"); if (!fmt) { @@ -354,11 +289,83 @@ HRESULT WINAPI D3DXCheckTextureRequirements(struct IDirect3DDevice9 *device, UIN { bestscore = score; usedformat = curfmt->format; + bestfmt = curfmt; } } + fmt = bestfmt; hr = D3D_OK; } + if (FAILED(IDirect3DDevice9_GetDeviceCaps(device, &caps))) + return D3DERR_INVALIDCALL; + + if ((w == D3DX_DEFAULT) && (h == D3DX_DEFAULT)) + w = h = 256; + else if (w == D3DX_DEFAULT) + w = (height ? h : 256); + else if (h == D3DX_DEFAULT) + h = (width ? w : 256); + + if (fmt->block_width != 1 || fmt->block_height != 1) + { + if (w < fmt->block_width) + w = fmt->block_width; + if (h < fmt->block_height) + h = fmt->block_height; + } + + if ((caps.TextureCaps & D3DPTEXTURECAPS_POW2) && (!is_pow2(w))) + w = make_pow2(w); + + if (w > caps.MaxTextureWidth) + w = caps.MaxTextureWidth; + + if ((caps.TextureCaps & D3DPTEXTURECAPS_POW2) && (!is_pow2(h))) + h = make_pow2(h); + + if (h > caps.MaxTextureHeight) + h = caps.MaxTextureHeight; + + if (caps.TextureCaps & D3DPTEXTURECAPS_SQUAREONLY) + { + if (w > h) + h = w; + else + w = h; + } + + if (width) + *width = w; + + if (height) + *height = h; + + if (miplevels && (usage & D3DUSAGE_AUTOGENMIPMAP)) + { + if (*miplevels > 1) + *miplevels = 0; + } + else if (miplevels) + { + UINT max_mipmaps = 1; + + if (!width && !height) + max_mipmaps = 9; /* number of mipmaps in a 256x256 texture */ + else + { + UINT max_dimen = max(w, h); + + while (max_dimen > 1) + { + max_dimen >>= 1; + max_mipmaps++; + } + } + + if (*miplevels == 0 || *miplevels > max_mipmaps) + *miplevels = max_mipmaps; + } + cleanup: if (d3d) @@ -518,21 +525,24 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi BOOL file_format = FALSE, file_miplevels = FALSE; BOOL dynamic_texture; D3DXIMAGE_INFO imginfo; - UINT loaded_miplevels; + UINT loaded_miplevels, skip_levels; D3DCAPS9 caps; HRESULT hr; - TRACE("(%p, %p, %u, %u, %u, %u, %x, %x, %x, %u, %u, %x, %p, %p, %p)\n", device, srcdata, srcdatasize, width, - height, miplevels, usage, format, pool, filter, mipfilter, colorkey, srcinfo, palette, texture); + TRACE("device %p, srcdata %p, srcdatasize %u, width %u, height %u, miplevels %u," + " usage %#x, format %#x, pool %#x, filter %#x, mipfilter %#x, colorkey %#x," + " srcinfo %p, palette %p, texture %p.\n", + device, srcdata, srcdatasize, width, height, miplevels, usage, format, pool, + filter, mipfilter, colorkey, srcinfo, palette, texture); /* check for invalid parameters */ if (!device || !texture || !srcdata || !srcdatasize) return D3DERR_INVALIDCALL; hr = D3DXGetImageInfoFromFileInMemory(srcdata, srcdatasize, &imginfo); - if (FAILED(hr)) { + FIXME("Unrecognized file format, returning failure.\n"); *texture = NULL; return hr; } @@ -577,11 +587,26 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi miplevels = imginfo.MipLevels; } + skip_levels = mipfilter != D3DX_DEFAULT ? mipfilter >> D3DX_SKIP_DDS_MIP_LEVELS_SHIFT : 0; + if (skip_levels && imginfo.MipLevels > skip_levels) + { + TRACE("Skipping the first %u (of %u) levels of a DDS mipmapped texture.\n", + skip_levels, imginfo.MipLevels); + TRACE("Texture level 0 dimensions are %ux%u.\n", imginfo.Width, imginfo.Height); + width >>= skip_levels; + height >>= skip_levels; + miplevels -= skip_levels; + } + else + { + skip_levels = 0; + } + /* fix texture creation parameters */ hr = D3DXCheckTextureRequirements(device, &width, &height, &miplevels, usage, &format, pool); - if (FAILED(hr)) { + FIXME("Couldn't find suitable texture parameters.\n"); *texture = NULL; return hr; } @@ -591,6 +616,12 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi FIXME("Generation of mipmaps for compressed pixel formats is not implemented yet\n"); miplevels = imginfo.MipLevels; } + if (imginfo.ResourceType == D3DRTYPE_VOLUMETEXTURE + && D3DFMT_DXT1 <= imginfo.Format && imginfo.Format <= D3DFMT_DXT5 && miplevels > 1) + { + FIXME("Generation of mipmaps for compressed pixel formats is not implemented yet.\n"); + miplevels = 1; + } if (((file_width) && (width != imginfo.Width)) || ((file_height) && (height != imginfo.Height)) || @@ -618,34 +649,37 @@ HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx(struct IDirect3DDevice9 *devi if (FAILED(hr)) { + FIXME("Texture creation failed.\n"); *texture = NULL; return hr; } - /* Load the file */ + TRACE("Texture created correctly. Now loading the texture data into it.\n"); if (imginfo.ImageFileFormat != D3DXIFF_DDS) { IDirect3DTexture9_GetSurfaceLevel(*texptr, 0, &surface); hr = D3DXLoadSurfaceFromFileInMemory(surface, palette, NULL, srcdata, srcdatasize, NULL, filter, colorkey, NULL); IDirect3DSurface9_Release(surface); + loaded_miplevels = min(IDirect3DTexture9_GetLevelCount(*texptr), imginfo.MipLevels); } else { - hr = load_texture_from_dds(*texptr, srcdata, palette, filter, colorkey, &imginfo); + hr = load_texture_from_dds(*texptr, srcdata, palette, filter, colorkey, &imginfo, skip_levels, + &loaded_miplevels); } if (FAILED(hr)) { + FIXME("Texture loading failed.\n"); IDirect3DTexture9_Release(*texptr); *texture = NULL; return hr; } - loaded_miplevels = min(IDirect3DTexture9_GetLevelCount(*texptr), imginfo.MipLevels); hr = D3DXFilterTexture((IDirect3DBaseTexture9*) *texptr, palette, loaded_miplevels - 1, mipfilter); - if (FAILED(hr)) { + FIXME("Texture filtering failed.\n"); IDirect3DTexture9_Release(*texptr); *texture = NULL; return hr; @@ -687,13 +721,14 @@ HRESULT WINAPI D3DXCreateTextureFromFileExW(struct IDirect3DDevice9 *device, con D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo, PALETTEENTRY *palette, struct IDirect3DTexture9 **texture) { + void *buffer; HRESULT hr; DWORD size; - LPVOID buffer; - TRACE("(%p, %s, %u, %u, %u, %x, %x, %x, %u, %u, %x, %p, %p, %p): relay\n", - device, debugstr_w(srcfile), width, height, miplevels, usage, format, pool, filter, - mipfilter, colorkey, srcinfo, palette, texture); + TRACE("device %p, srcfile %s, width %u, height %u, miplevels %u, usage %#x, format %#x, " + "pool %#x, filter %#x, mipfilter %#x, colorkey 0x%08x, srcinfo %p, palette %p, texture %p.\n", + device, debugstr_w(srcfile), width, height, miplevels, usage, format, + pool, filter, mipfilter, colorkey, srcinfo, palette, texture); if (!srcfile) return D3DERR_INVALIDCALL; @@ -715,13 +750,14 @@ HRESULT WINAPI D3DXCreateTextureFromFileExA(struct IDirect3DDevice9 *device, con D3DPOOL pool, DWORD filter, DWORD mipfilter, D3DCOLOR colorkey, D3DXIMAGE_INFO *srcinfo, PALETTEENTRY *palette, struct IDirect3DTexture9 **texture) { - LPWSTR widename; + WCHAR *widename; HRESULT hr; DWORD len; - TRACE("(%p, %s, %u, %u, %u, %x, %x, %x, %u, %u, %x, %p, %p, %p): relay\n", - device, debugstr_a(srcfile), width, height, miplevels, usage, format, pool, filter, - mipfilter, colorkey, srcinfo, palette, texture); + TRACE("device %p, srcfile %s, width %u, height %u, miplevels %u, usage %#x, format %#x, " + "pool %#x, filter %#x, mipfilter %#x, colorkey 0x%08x, srcinfo %p, palette %p, texture %p.\n", + device, debugstr_a(srcfile), width, height, miplevels, usage, format, + pool, filter, mipfilter, colorkey, srcinfo, palette, texture); if (!device || !srcfile || !texture) return D3DERR_INVALIDCALL; diff --git a/reactos/dll/directx/wine/d3dx9_36/util.c b/reactos/dll/directx/wine/d3dx9_36/util.c index 783122a09a5..a137418c212 100644 --- a/reactos/dll/directx/wine/d3dx9_36/util.c +++ b/reactos/dll/directx/wine/d3dx9_36/util.c @@ -78,7 +78,11 @@ static const struct pixel_format_desc formats[] = {D3DFMT_DXT3, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL }, {D3DFMT_DXT4, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL }, {D3DFMT_DXT5, { 0, 0, 0, 0}, { 0, 0, 0, 0}, 1, 4, 4, 16, FORMAT_DXT, NULL, NULL }, + {D3DFMT_R16F, { 0, 16, 0, 0}, { 0, 0, 0, 0}, 2, 1, 1, 2, FORMAT_ARGBF16, NULL, NULL }, + {D3DFMT_G16R16F, { 0, 16, 16, 0}, { 0, 0, 16, 0}, 4, 1, 1, 4, FORMAT_ARGBF16, NULL, NULL }, {D3DFMT_A16B16G16R16F, {16, 16, 16, 16}, {48, 0, 16, 32}, 8, 1, 1, 8, FORMAT_ARGBF16, NULL, NULL }, + {D3DFMT_R32F, { 0, 32, 0, 0}, { 0, 0, 0, 0}, 4, 1, 1, 4, FORMAT_ARGBF, NULL, NULL }, + {D3DFMT_G32R32F, { 0, 32, 32, 0}, { 0, 0, 32, 0}, 8, 1, 1, 8, FORMAT_ARGBF, NULL, NULL }, {D3DFMT_A32B32G32R32F, {32, 32, 32, 32}, {96, 0, 32, 64}, 16, 1, 1, 16, FORMAT_ARGBF, NULL, NULL }, {D3DFMT_P8, { 8, 8, 8, 8}, { 0, 0, 0, 0}, 1, 1, 1, 1, FORMAT_INDEX, NULL, index_to_rgba}, /* marks last element */ @@ -153,7 +157,7 @@ error: * The memory doesn't need to be freed by the caller manually * */ -HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, LPVOID *buffer, DWORD *length) +HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) { HGLOBAL resource; @@ -282,7 +286,7 @@ const char *debug_d3dxparameter_registerset(D3DXREGISTER_SET r) #undef WINE_D3DX_TO_STR /* parameter type conversion helpers */ -static BOOL get_bool(D3DXPARAMETER_TYPE type, LPCVOID data) +static BOOL get_bool(D3DXPARAMETER_TYPE type, const void *data) { switch (type) { @@ -300,12 +304,12 @@ static BOOL get_bool(D3DXPARAMETER_TYPE type, LPCVOID data) } } -static INT get_int(D3DXPARAMETER_TYPE type, LPCVOID data) +static INT get_int(D3DXPARAMETER_TYPE type, const void *data) { switch (type) { case D3DXPT_FLOAT: - return *(FLOAT *)data; + return (INT)(*(FLOAT *)data); case D3DXPT_INT: case D3DXPT_VOID: @@ -320,7 +324,7 @@ static INT get_int(D3DXPARAMETER_TYPE type, LPCVOID data) } } -static FLOAT get_float(D3DXPARAMETER_TYPE type, LPCVOID data) +static FLOAT get_float(D3DXPARAMETER_TYPE type, const void *data) { switch (type) { @@ -329,10 +333,10 @@ static FLOAT get_float(D3DXPARAMETER_TYPE type, LPCVOID data) return *(FLOAT *)data; case D3DXPT_INT: - return *(INT *)data; + return (FLOAT)(*(INT *)data); case D3DXPT_BOOL: - return get_bool(type, data); + return (FLOAT)get_bool(type, data); default: FIXME("Unhandled type %s.\n", debug_d3dxparameter_type(type)); @@ -340,10 +344,8 @@ static FLOAT get_float(D3DXPARAMETER_TYPE type, LPCVOID data) } } -void set_number(LPVOID outdata, D3DXPARAMETER_TYPE outtype, LPCVOID indata, D3DXPARAMETER_TYPE intype) +void set_number(void *outdata, D3DXPARAMETER_TYPE outtype, const void *indata, D3DXPARAMETER_TYPE intype) { - TRACE("Changing from type %s to type %s\n", debug_d3dxparameter_type(intype), debug_d3dxparameter_type(outtype)); - if (outtype == intype) { *(DWORD *)outdata = *(DWORD *)indata; diff --git a/reactos/dll/directx/wine/d3dx9_36/version.rc b/reactos/dll/directx/wine/d3dx9_36/version.rc index 8ca195d5c66..38c29425f53 100644 --- a/reactos/dll/directx/wine/d3dx9_36/version.rc +++ b/reactos/dll/directx/wine/d3dx9_36/version.rc @@ -17,7 +17,7 @@ */ #define WINE_FILEDESCRIPTION_STR "Wine D3DX9" -#define WINE_FILENAME_STR "d3dx9.dll" +#define WINE_FILENAME_STR "d3dx9_36.dll" #define WINE_FILEVERSION 9,19,949,2111 #define WINE_FILEVERSION_STR "9.19.949.2111" #define WINE_PRODUCTVERSION 9,19,949,2111 diff --git a/reactos/dll/directx/wine/d3dx9_36/volume.c b/reactos/dll/directx/wine/d3dx9_36/volume.c index d409e29775c..756f270e776 100644 --- a/reactos/dll/directx/wine/d3dx9_36/volume.c +++ b/reactos/dll/directx/wine/d3dx9_36/volume.c @@ -235,6 +235,10 @@ HRESULT WINAPI D3DXLoadVolumeFromFileInMemory(IDirect3DVolume9 *dst_volume, D3DBOX box; D3DXIMAGE_INFO image_info; + TRACE("dst_volume %p, dst_palette %p, dst_box %p, src_data %p, src_data_size %u, src_box %p,\n", + dst_volume, dst_palette, dst_box, src_data, src_data_size, src_box); + TRACE("filter %#x, color_key %#x, src_info %p.\n", filter, color_key, src_info); + if (!dst_volume || !src_data) return D3DERR_INVALIDCALL; hr = D3DXGetImageInfoFromFileInMemory(src_data, src_data_size, &image_info); diff --git a/reactos/dll/directx/wine/d3dx9_36/xfile.c b/reactos/dll/directx/wine/d3dx9_36/xfile.c index 956f51078ba..7cc0ba817eb 100644 --- a/reactos/dll/directx/wine/d3dx9_36/xfile.c +++ b/reactos/dll/directx/wine/d3dx9_36/xfile.c @@ -43,119 +43,119 @@ static HRESULT error_dxfile_to_d3dxfile(HRESULT error) } } -typedef struct { +struct d3dx9_file +{ ID3DXFile ID3DXFile_iface; LONG ref; IDirectXFile *dxfile; -} ID3DXFileImpl; +}; -typedef struct { +struct d3dx9_file_enum_object +{ ID3DXFileEnumObject ID3DXFileEnumObject_iface; LONG ref; ULONG nb_children; ID3DXFileData **children; -} ID3DXFileEnumObjectImpl; +}; -typedef struct { +struct d3dx9_file_data +{ ID3DXFileData ID3DXFileData_iface; LONG ref; BOOL reference; IDirectXFileData *dxfile_data; ULONG nb_children; ID3DXFileData **children; -} ID3DXFileDataImpl; +}; - -static inline ID3DXFileImpl* impl_from_ID3DXFile(ID3DXFile *iface) +static inline struct d3dx9_file *impl_from_ID3DXFile(ID3DXFile *iface) { - return CONTAINING_RECORD(iface, ID3DXFileImpl, ID3DXFile_iface); + return CONTAINING_RECORD(iface, struct d3dx9_file, ID3DXFile_iface); } -static inline ID3DXFileEnumObjectImpl* impl_from_ID3DXFileEnumObject(ID3DXFileEnumObject *iface) +static inline struct d3dx9_file_enum_object *impl_from_ID3DXFileEnumObject(ID3DXFileEnumObject *iface) { - return CONTAINING_RECORD(iface, ID3DXFileEnumObjectImpl, ID3DXFileEnumObject_iface); + return CONTAINING_RECORD(iface, struct d3dx9_file_enum_object, ID3DXFileEnumObject_iface); } -static inline ID3DXFileDataImpl* impl_from_ID3DXFileData(ID3DXFileData *iface) +static inline struct d3dx9_file_data *impl_from_ID3DXFileData(ID3DXFileData *iface) { - return CONTAINING_RECORD(iface, ID3DXFileDataImpl, ID3DXFileData_iface); + return CONTAINING_RECORD(iface, struct d3dx9_file_data, ID3DXFileData_iface); } -/*** IUnknown methods ***/ - -static HRESULT WINAPI ID3DXFileDataImpl_QueryInterface(ID3DXFileData *iface, REFIID riid, void **ret_iface) +static HRESULT WINAPI d3dx9_file_data_QueryInterface(ID3DXFileData *iface, REFIID riid, void **out) { - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ret_iface); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - if (IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_ID3DXFileData)) + if (IsEqualGUID(riid, &IID_ID3DXFileData) + || IsEqualGUID(riid, &IID_IUnknown)) { iface->lpVtbl->AddRef(iface); - *ret_iface = iface; + *out = iface; return S_OK; } - WARN("(%p)->(%s, %p), not found\n", iface, debugstr_guid(riid), ret_iface); - *ret_iface = NULL; + WARN("Interface %s not found.\n", debugstr_guid(riid)); + + *out = NULL; return E_NOINTERFACE; } -static ULONG WINAPI ID3DXFileDataImpl_AddRef(ID3DXFileData *iface) +static ULONG WINAPI d3dx9_file_data_AddRef(ID3DXFileData *iface) { - ID3DXFileDataImpl *This = impl_from_ID3DXFileData(iface); - ULONG ref = InterlockedIncrement(&This->ref); + struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface); + ULONG refcount = InterlockedIncrement(&file_data->ref); - TRACE("(%p)->(): new ref = %u\n", iface, ref); + TRACE("%p increasing refcount to %u.\n", file_data, refcount); - return ref; + return refcount; } -static ULONG WINAPI ID3DXFileDataImpl_Release(ID3DXFileData *iface) +static ULONG WINAPI d3dx9_file_data_Release(ID3DXFileData *iface) { - ID3DXFileDataImpl *This = impl_from_ID3DXFileData(iface); - ULONG ref = InterlockedDecrement(&This->ref); + struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface); + ULONG refcount = InterlockedDecrement(&file_data->ref); - TRACE("(%p)->(): new ref = %u\n", iface, ref); + TRACE("%p decreasing refcount to %u.\n", file_data, refcount); - if (!ref) + if (!refcount) { ULONG i; - for (i = 0; i < This->nb_children; i++) - (This->children[i])->lpVtbl->Release(This->children[i]); - HeapFree(GetProcessHeap(), 0, This->children); - IDirectXFileData_Release(This->dxfile_data); - HeapFree(GetProcessHeap(), 0, This); + for (i = 0; i < file_data->nb_children; ++i) + { + ID3DXFileData *child = file_data->children[i]; + child->lpVtbl->Release(child); + } + HeapFree(GetProcessHeap(), 0, file_data->children); + IDirectXFileData_Release(file_data->dxfile_data); + HeapFree(GetProcessHeap(), 0, file_data); } - return ref; + return refcount; } - -/*** ID3DXFileData methods ***/ - -static HRESULT WINAPI ID3DXFileDataImpl_GetEnum(ID3DXFileData *iface, ID3DXFileEnumObject **enum_object) +static HRESULT WINAPI d3dx9_file_data_GetEnum(ID3DXFileData *iface, ID3DXFileEnumObject **enum_object) { - FIXME("(%p)->(%p): stub\n", iface, enum_object); + FIXME("iface %p, enum_object %p stub!\n", iface, enum_object); return E_NOTIMPL; } - -static HRESULT WINAPI ID3DXFileDataImpl_GetName(ID3DXFileData *iface, char *name, SIZE_T *size) +static HRESULT WINAPI d3dx9_file_data_GetName(ID3DXFileData *iface, char *name, SIZE_T *size) { - ID3DXFileDataImpl *This = impl_from_ID3DXFileData(iface); + struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface); DWORD dxfile_size; HRESULT ret; - TRACE("(%p)->(%p, %p)\n", iface, name, size); + TRACE("iface %p, name %p, size %p.\n", iface, name, size); if (!size) return D3DXFERR_BADVALUE; dxfile_size = *size; - ret = IDirectXFileData_GetName(This->dxfile_data, name, &dxfile_size); + ret = IDirectXFileData_GetName(file_data->dxfile_data, name, &dxfile_size); if (ret != DXFILE_OK) return error_dxfile_to_d3dxfile(ret); @@ -173,37 +173,35 @@ static HRESULT WINAPI ID3DXFileDataImpl_GetName(ID3DXFileData *iface, char *name return S_OK; } - -static HRESULT WINAPI ID3DXFileDataImpl_GetId(ID3DXFileData *iface, GUID *guid) +static HRESULT WINAPI d3dx9_file_data_GetId(ID3DXFileData *iface, GUID *guid) { - ID3DXFileDataImpl *This = impl_from_ID3DXFileData(iface); + struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface); HRESULT ret; - TRACE("(%p)->(%p)\n", iface, guid); + TRACE("iface %p, guid %p.\n", iface, guid); if (!guid) return E_POINTER; - ret = IDirectXFileData_GetId(This->dxfile_data, guid); + ret = IDirectXFileData_GetId(file_data->dxfile_data, guid); if (ret != DXFILE_OK) return error_dxfile_to_d3dxfile(ret); return S_OK; } - -static HRESULT WINAPI ID3DXFileDataImpl_Lock(ID3DXFileData *iface, SIZE_T *size, const void **data) +static HRESULT WINAPI d3dx9_file_data_Lock(ID3DXFileData *iface, SIZE_T *size, const void **data) { - ID3DXFileDataImpl *This = impl_from_ID3DXFileData(iface); + struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface); DWORD dxfile_size; HRESULT ret; - TRACE("(%p)->(%p, %p)\n", iface, size, data); + TRACE("iface %p, size %p, data %p.\n", iface, size, data); if (!size || !data) return E_POINTER; - ret = IDirectXFileData_GetData(This->dxfile_data, NULL, &dxfile_size, (void**)data); + ret = IDirectXFileData_GetData(file_data->dxfile_data, NULL, &dxfile_size, (void **)data); if (ret != DXFILE_OK) return error_dxfile_to_d3dxfile(ret); @@ -212,26 +210,24 @@ static HRESULT WINAPI ID3DXFileDataImpl_Lock(ID3DXFileData *iface, SIZE_T *size, return S_OK; } - -static HRESULT WINAPI ID3DXFileDataImpl_Unlock(ID3DXFileData *iface) +static HRESULT WINAPI d3dx9_file_data_Unlock(ID3DXFileData *iface) { - TRACE("(%p)->()\n", iface); + TRACE("iface %p.\n", iface); /* Nothing to do */ return S_OK; } - -static HRESULT WINAPI ID3DXFileDataImpl_GetType(ID3DXFileData *iface, GUID *guid) +static HRESULT WINAPI d3dx9_file_data_GetType(ID3DXFileData *iface, GUID *guid) { - ID3DXFileDataImpl *This = impl_from_ID3DXFileData(iface); + struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface); const GUID *dxfile_guid; HRESULT ret; - TRACE("(%p)->(%p)\n", iface, guid); + TRACE("iface %p, guid %p.\n", iface, guid); - ret = IDirectXFileData_GetType(This->dxfile_data, &dxfile_guid); + ret = IDirectXFileData_GetType(file_data->dxfile_data, &dxfile_guid); if (ret != DXFILE_OK) return error_dxfile_to_d3dxfile(ret); @@ -240,72 +236,67 @@ static HRESULT WINAPI ID3DXFileDataImpl_GetType(ID3DXFileData *iface, GUID *guid return S_OK; } - -static BOOL WINAPI ID3DXFileDataImpl_IsReference(ID3DXFileData *iface) +static BOOL WINAPI d3dx9_file_data_IsReference(ID3DXFileData *iface) { - ID3DXFileDataImpl *This = impl_from_ID3DXFileData(iface); + struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface); - TRACE("(%p)->()\n", iface); + TRACE("iface %p.\n", iface); - return This->reference; + return file_data->reference; } - -static HRESULT WINAPI ID3DXFileDataImpl_GetChildren(ID3DXFileData *iface, SIZE_T *children) +static HRESULT WINAPI d3dx9_file_data_GetChildren(ID3DXFileData *iface, SIZE_T *children) { - ID3DXFileDataImpl *This = impl_from_ID3DXFileData(iface); + struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface); - TRACE("(%p)->(%p)\n", iface, children); + TRACE("iface %p, children %p.\n", iface, children); if (!children) return E_POINTER; - *children = This->nb_children; + *children = file_data->nb_children; return S_OK; } - -static HRESULT WINAPI ID3DXFileDataImpl_GetChild(ID3DXFileData *iface, SIZE_T id, ID3DXFileData **object) +static HRESULT WINAPI d3dx9_file_data_GetChild(ID3DXFileData *iface, SIZE_T id, ID3DXFileData **object) { - ID3DXFileDataImpl *This = impl_from_ID3DXFileData(iface); + struct d3dx9_file_data *file_data = impl_from_ID3DXFileData(iface); - TRACE("(%p)->(%lu, %p)\n", iface, id, object); + TRACE("iface %p, id %#lx, object %p.\n", iface, id, object); if (!object) return E_POINTER; - *object = This->children[id]; + *object = file_data->children[id]; (*object)->lpVtbl->AddRef(*object); return S_OK; } - -static const ID3DXFileDataVtbl ID3DXFileData_Vtbl = +static const ID3DXFileDataVtbl d3dx9_file_data_vtbl = { - ID3DXFileDataImpl_QueryInterface, - ID3DXFileDataImpl_AddRef, - ID3DXFileDataImpl_Release, - ID3DXFileDataImpl_GetEnum, - ID3DXFileDataImpl_GetName, - ID3DXFileDataImpl_GetId, - ID3DXFileDataImpl_Lock, - ID3DXFileDataImpl_Unlock, - ID3DXFileDataImpl_GetType, - ID3DXFileDataImpl_IsReference, - ID3DXFileDataImpl_GetChildren, - ID3DXFileDataImpl_GetChild + d3dx9_file_data_QueryInterface, + d3dx9_file_data_AddRef, + d3dx9_file_data_Release, + d3dx9_file_data_GetEnum, + d3dx9_file_data_GetName, + d3dx9_file_data_GetId, + d3dx9_file_data_Lock, + d3dx9_file_data_Unlock, + d3dx9_file_data_GetType, + d3dx9_file_data_IsReference, + d3dx9_file_data_GetChildren, + d3dx9_file_data_GetChild, }; - -static HRESULT ID3DXFileDataImpl_Create(IDirectXFileObject *dxfile_object, ID3DXFileData **ret_iface) +static HRESULT d3dx9_file_data_create(IDirectXFileObject *dxfile_object, ID3DXFileData **ret_iface) { - ID3DXFileDataImpl *object; + struct d3dx9_file_data *object; IDirectXFileObject *data_object; HRESULT ret; - TRACE("(%p, %p)\n", dxfile_object, ret_iface); + TRACE("dxfile_object %p, ret_iface %p.\n", dxfile_object, ret_iface); *ret_iface = NULL; @@ -313,7 +304,7 @@ static HRESULT ID3DXFileDataImpl_Create(IDirectXFileObject *dxfile_object, ID3DX if (!object) return E_OUTOFMEMORY; - object->ID3DXFileData_iface.lpVtbl = &ID3DXFileData_Vtbl; + object->ID3DXFileData_iface.lpVtbl = &d3dx9_file_data_vtbl; object->ref = 1; ret = IDirectXFileObject_QueryInterface(dxfile_object, &IID_IDirectXFileData, (void **)&object->dxfile_data); @@ -351,8 +342,7 @@ static HRESULT ID3DXFileDataImpl_Create(IDirectXFileObject *dxfile_object, ID3DX ret = E_OUTOFMEMORY; break; } - ret = ID3DXFileDataImpl_Create(data_object, &object->children[object->nb_children]); - if (ret != S_OK) + if (FAILED(ret = d3dx9_file_data_create(data_object, &object->children[object->nb_children]))) break; object->nb_children++; } @@ -370,181 +360,170 @@ static HRESULT ID3DXFileDataImpl_Create(IDirectXFileObject *dxfile_object, ID3DX return S_OK; } - -/*** IUnknown methods ***/ - -static HRESULT WINAPI ID3DXFileEnumObjectImpl_QueryInterface(ID3DXFileEnumObject *iface, REFIID riid, void **ret_iface) +static HRESULT WINAPI d3dx9_file_enum_object_QueryInterface(ID3DXFileEnumObject *iface, REFIID riid, void **out) { - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ret_iface); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - if (IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_ID3DXFileEnumObject)) + if (IsEqualGUID(riid, &IID_ID3DXFileEnumObject) + || IsEqualGUID(riid, &IID_IUnknown)) { iface->lpVtbl->AddRef(iface); - *ret_iface = iface; + *out = iface; return S_OK; } - WARN("(%p)->(%s, %p), not found\n", iface, debugstr_guid(riid), ret_iface); - *ret_iface = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *out = NULL; return E_NOINTERFACE; } -static ULONG WINAPI ID3DXFileEnumObjectImpl_AddRef(ID3DXFileEnumObject *iface) +static ULONG WINAPI d3dx9_file_enum_object_AddRef(ID3DXFileEnumObject *iface) { - ID3DXFileEnumObjectImpl *This = impl_from_ID3DXFileEnumObject(iface); - ULONG ref = InterlockedIncrement(&This->ref); + struct d3dx9_file_enum_object *file_enum = impl_from_ID3DXFileEnumObject(iface); + ULONG refcount = InterlockedIncrement(&file_enum->ref); - TRACE("(%p)->(): new ref = %u\n", iface, ref); + TRACE("%p increasing refcount to %u.\n", file_enum, refcount); - return ref; + return refcount; } -static ULONG WINAPI ID3DXFileEnumObjectImpl_Release(ID3DXFileEnumObject *iface) +static ULONG WINAPI d3dx9_file_enum_object_Release(ID3DXFileEnumObject *iface) { - ID3DXFileEnumObjectImpl *This = impl_from_ID3DXFileEnumObject(iface); - ULONG ref = InterlockedDecrement(&This->ref); + struct d3dx9_file_enum_object *file_enum = impl_from_ID3DXFileEnumObject(iface); + ULONG refcount = InterlockedDecrement(&file_enum->ref); - TRACE("(%p)->(): new ref = %u\n", iface, ref); + TRACE("%p decreasing refcount to %u.\n", file_enum, refcount); - if (!ref) + if (!refcount) { ULONG i; - for (i = 0; i < This->nb_children; i++) - (This->children[i])->lpVtbl->Release(This->children[i]); - HeapFree(GetProcessHeap(), 0, This->children); - HeapFree(GetProcessHeap(), 0, This); + for (i = 0; i < file_enum->nb_children; ++i) + { + ID3DXFileData *child = file_enum->children[i]; + child->lpVtbl->Release(child); + } + HeapFree(GetProcessHeap(), 0, file_enum->children); + HeapFree(GetProcessHeap(), 0, file_enum); } - return ref; + return refcount; } - -/*** ID3DXFileEnumObject methods ***/ - -static HRESULT WINAPI ID3DXFileEnumObjectImpl_GetFile(ID3DXFileEnumObject *iface, ID3DXFile **file) +static HRESULT WINAPI d3dx9_file_enum_object_GetFile(ID3DXFileEnumObject *iface, ID3DXFile **file) { - FIXME("(%p)->(%p): stub\n", iface, file); + FIXME("iface %p, file %p stub!\n", iface, file); return E_NOTIMPL; } - -static HRESULT WINAPI ID3DXFileEnumObjectImpl_GetChildren(ID3DXFileEnumObject *iface, SIZE_T *children) +static HRESULT WINAPI d3dx9_file_enum_object_GetChildren(ID3DXFileEnumObject *iface, SIZE_T *children) { - ID3DXFileEnumObjectImpl *This = impl_from_ID3DXFileEnumObject(iface); + struct d3dx9_file_enum_object *file_enum = impl_from_ID3DXFileEnumObject(iface); - TRACE("(%p)->(%p)\n", iface, children); + TRACE("iface %p, children %p.\n", iface, children); if (!children) return E_POINTER; - *children = This->nb_children; + *children = file_enum->nb_children; return S_OK; } - -static HRESULT WINAPI ID3DXFileEnumObjectImpl_GetChild(ID3DXFileEnumObject *iface, SIZE_T id, ID3DXFileData **object) +static HRESULT WINAPI d3dx9_file_enum_object_GetChild(ID3DXFileEnumObject *iface, SIZE_T id, ID3DXFileData **object) { - ID3DXFileEnumObjectImpl *This = impl_from_ID3DXFileEnumObject(iface); + struct d3dx9_file_enum_object *file_enum = impl_from_ID3DXFileEnumObject(iface); - TRACE("(%p)->(%lu, %p)\n", iface, id, object); + TRACE("iface %p, id %#lx, object %p.\n", iface, id, object); if (!object) return E_POINTER; - *object = This->children[id]; + *object = file_enum->children[id]; (*object)->lpVtbl->AddRef(*object); return S_OK; } - -static HRESULT WINAPI ID3DXFileEnumObjectImpl_GetDataObjectById(ID3DXFileEnumObject *iface, REFGUID guid, ID3DXFileData **object) +static HRESULT WINAPI d3dx9_file_enum_object_GetDataObjectById(ID3DXFileEnumObject *iface, + REFGUID guid, ID3DXFileData **object) { - FIXME("(%p)->(%s, %p): stub\n", iface, debugstr_guid(guid), object); + FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); return E_NOTIMPL; } - -static HRESULT WINAPI ID3DXFileEnumObjectImpl_GetDataObjectByName(ID3DXFileEnumObject *iface, const char *name, ID3DXFileData **object) +static HRESULT WINAPI d3dx9_file_enum_object_GetDataObjectByName(ID3DXFileEnumObject *iface, + const char *name, ID3DXFileData **object) { - FIXME("(%p)->(%s, %p): stub\n", iface, debugstr_a(name), object); + FIXME("iface %p, name %s, object %p stub!\n", iface, debugstr_a(name), object); return E_NOTIMPL; } - -static const ID3DXFileEnumObjectVtbl ID3DXFileEnumObject_Vtbl = +static const ID3DXFileEnumObjectVtbl d3dx9_file_enum_object_vtbl = { - ID3DXFileEnumObjectImpl_QueryInterface, - ID3DXFileEnumObjectImpl_AddRef, - ID3DXFileEnumObjectImpl_Release, - ID3DXFileEnumObjectImpl_GetFile, - ID3DXFileEnumObjectImpl_GetChildren, - ID3DXFileEnumObjectImpl_GetChild, - ID3DXFileEnumObjectImpl_GetDataObjectById, - ID3DXFileEnumObjectImpl_GetDataObjectByName + d3dx9_file_enum_object_QueryInterface, + d3dx9_file_enum_object_AddRef, + d3dx9_file_enum_object_Release, + d3dx9_file_enum_object_GetFile, + d3dx9_file_enum_object_GetChildren, + d3dx9_file_enum_object_GetChild, + d3dx9_file_enum_object_GetDataObjectById, + d3dx9_file_enum_object_GetDataObjectByName, }; - -/*** IUnknown methods ***/ - -static HRESULT WINAPI ID3DXFileImpl_QueryInterface(ID3DXFile *iface, REFIID riid, void **ret_iface) +static HRESULT WINAPI d3dx9_file_QueryInterface(ID3DXFile *iface, REFIID riid, void **out) { - TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ret_iface); + TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); - if (IsEqualGUID(riid, &IID_IUnknown) || - IsEqualGUID(riid, &IID_ID3DXFile)) + if (IsEqualGUID(riid, &IID_ID3DXFile) + || IsEqualGUID(riid, &IID_IUnknown)) { iface->lpVtbl->AddRef(iface); - *ret_iface = iface; + *out = iface; return S_OK; } - WARN("(%p)->(%s, %p), not found\n", iface, debugstr_guid(riid), ret_iface); - *ret_iface = NULL; + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); + + *out = NULL; return E_NOINTERFACE; } - -static ULONG WINAPI ID3DXFileImpl_AddRef(ID3DXFile *iface) +static ULONG WINAPI d3dx9_file_AddRef(ID3DXFile *iface) { - ID3DXFileImpl *This = impl_from_ID3DXFile(iface); - ULONG ref = InterlockedIncrement(&This->ref); + struct d3dx9_file *file = impl_from_ID3DXFile(iface); + ULONG refcount = InterlockedIncrement(&file->ref); - TRACE("(%p)->(): new ref = %u\n", iface, ref); + TRACE("%p increasing refcount to %u.\n", file, refcount); - return ref; + return refcount; } - -static ULONG WINAPI ID3DXFileImpl_Release(ID3DXFile *iface) +static ULONG WINAPI d3dx9_file_Release(ID3DXFile *iface) { - ID3DXFileImpl *This = impl_from_ID3DXFile(iface); - ULONG ref = InterlockedDecrement(&This->ref); + struct d3dx9_file *file = impl_from_ID3DXFile(iface); + ULONG refcount = InterlockedDecrement(&file->ref); - TRACE("(%p)->(): new ref = %u\n", iface, ref); + TRACE("%p decreasing refcount to %u.\n", file, refcount); - if (!ref) + if (!refcount) { - IDirectXFile_Release(This->dxfile); - HeapFree(GetProcessHeap(), 0, This); + IDirectXFile_Release(file->dxfile); + HeapFree(GetProcessHeap(), 0, file); } - return ref; + return refcount; } - -/*** ID3DXFile methods ***/ - -static HRESULT WINAPI ID3DXFileImpl_CreateEnumObject(ID3DXFile *iface, const void *source, D3DXF_FILELOADOPTIONS options, ID3DXFileEnumObject **enum_object) +static HRESULT WINAPI d3dx9_file_CreateEnumObject(ID3DXFile *iface, const void *source, + D3DXF_FILELOADOPTIONS options, ID3DXFileEnumObject **enum_object) { - ID3DXFileImpl *This = impl_from_ID3DXFile(iface); - ID3DXFileEnumObjectImpl *object; + struct d3dx9_file *file = impl_from_ID3DXFile(iface); + struct d3dx9_file_enum_object *object; IDirectXFileEnumObject *dxfile_enum_object; void *dxfile_source; DXFILELOADOPTIONS dxfile_options; @@ -553,7 +532,7 @@ static HRESULT WINAPI ID3DXFileImpl_CreateEnumObject(ID3DXFile *iface, const voi IDirectXFileData *data_object; HRESULT ret; - TRACE("(%p)->(%p, %x, %p)\n", iface, source, options, enum_object); + TRACE("iface %p, source %p, options %#x, enum_object %p.\n", iface, source, options, enum_object); if (!enum_object) return E_POINTER; @@ -594,10 +573,10 @@ static HRESULT WINAPI ID3DXFileImpl_CreateEnumObject(ID3DXFile *iface, const voi if (!object) return E_OUTOFMEMORY; - object->ID3DXFileEnumObject_iface.lpVtbl = &ID3DXFileEnumObject_Vtbl; + object->ID3DXFileEnumObject_iface.lpVtbl = &d3dx9_file_enum_object_vtbl; object->ref = 1; - ret = IDirectXFile_CreateEnumObject(This->dxfile, dxfile_source, dxfile_options, &dxfile_enum_object); + ret = IDirectXFile_CreateEnumObject(file->dxfile, dxfile_source, dxfile_options, &dxfile_enum_object); if (ret != S_OK) { @@ -617,8 +596,8 @@ static HRESULT WINAPI ID3DXFileImpl_CreateEnumObject(ID3DXFile *iface, const voi ret = E_OUTOFMEMORY; break; } - ret = ID3DXFileDataImpl_Create((IDirectXFileObject*)data_object, &object->children[object->nb_children]); - if (ret != S_OK) + if (FAILED(ret = d3dx9_file_data_create((IDirectXFileObject*)data_object, + &object->children[object->nb_children]))) break; object->nb_children++; } @@ -635,23 +614,23 @@ static HRESULT WINAPI ID3DXFileImpl_CreateEnumObject(ID3DXFile *iface, const voi return S_OK; } - -static HRESULT WINAPI ID3DXFileImpl_CreateSaveObject(ID3DXFile *iface, const void *data, D3DXF_FILESAVEOPTIONS options, D3DXF_FILEFORMAT format, ID3DXFileSaveObject **save_object) +static HRESULT WINAPI d3dx9_file_CreateSaveObject(ID3DXFile *iface, const void *data, + D3DXF_FILESAVEOPTIONS options, D3DXF_FILEFORMAT format, ID3DXFileSaveObject **save_object) { - FIXME("(%p)->(%p, %x, %u, %p): stub\n", iface, data, options, format, save_object); + FIXME("iface %p, data %p, options %#x, format %#x, save_object %p stub!\n", + iface, data, options, format, save_object); return E_NOTIMPL; } - -static HRESULT WINAPI ID3DXFileImpl_RegisterTemplates(ID3DXFile *iface, const void *data, SIZE_T size) +static HRESULT WINAPI d3dx9_file_RegisterTemplates(ID3DXFile *iface, const void *data, SIZE_T size) { - ID3DXFileImpl *This = impl_from_ID3DXFile(iface); + struct d3dx9_file *file = impl_from_ID3DXFile(iface); HRESULT ret; - TRACE("(%p)->(%p, %lu)\n", iface, data, size); + TRACE("iface %p, data %p, size %lu.\n", iface, data, size); - ret = IDirectXFile_RegisterTemplates(This->dxfile, (void*)data, size); + ret = IDirectXFile_RegisterTemplates(file->dxfile, (void *)data, size); if (ret != DXFILE_OK) { WARN("Error %#x\n", ret); @@ -661,32 +640,30 @@ static HRESULT WINAPI ID3DXFileImpl_RegisterTemplates(ID3DXFile *iface, const vo return S_OK; } - -static HRESULT WINAPI ID3DXFileImpl_RegisterEnumTemplates(ID3DXFile *iface, ID3DXFileEnumObject *enum_object) +static HRESULT WINAPI d3dx9_file_RegisterEnumTemplates(ID3DXFile *iface, ID3DXFileEnumObject *enum_object) { - FIXME("(%p)->(%p): stub\n", iface, enum_object); + FIXME("iface %p, enum_object %p stub!\n", iface, enum_object); return E_NOTIMPL; } - -static const ID3DXFileVtbl ID3DXFile_Vtbl = +static const ID3DXFileVtbl d3dx9_file_vtbl = { - ID3DXFileImpl_QueryInterface, - ID3DXFileImpl_AddRef, - ID3DXFileImpl_Release, - ID3DXFileImpl_CreateEnumObject, - ID3DXFileImpl_CreateSaveObject, - ID3DXFileImpl_RegisterTemplates, - ID3DXFileImpl_RegisterEnumTemplates + d3dx9_file_QueryInterface, + d3dx9_file_AddRef, + d3dx9_file_Release, + d3dx9_file_CreateEnumObject, + d3dx9_file_CreateSaveObject, + d3dx9_file_RegisterTemplates, + d3dx9_file_RegisterEnumTemplates, }; HRESULT WINAPI D3DXFileCreate(ID3DXFile **d3dxfile) { - ID3DXFileImpl *object; + struct d3dx9_file *object; HRESULT ret; - TRACE("(%p)\n", d3dxfile); + TRACE("d3dxfile %p.\n", d3dxfile); if (!d3dxfile) return E_POINTER; @@ -706,7 +683,7 @@ HRESULT WINAPI D3DXFileCreate(ID3DXFile **d3dxfile) return E_FAIL; } - object->ID3DXFile_iface.lpVtbl = &ID3DXFile_Vtbl; + object->ID3DXFile_iface.lpVtbl = &d3dx9_file_vtbl; object->ref = 1; *d3dxfile = &object->ID3DXFile_iface; diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 43bbfd0396a..4ce0a8ba071 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -31,7 +31,7 @@ reactos/dll/directx/wine/amstream # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3d8 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3d9 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.17 -reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.1 +reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.1 reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.17 reactos/dll/directx/wine/devenum # Synced to Wine-1.7.1 From 67996b30a470dc51906f1a5c89e6b3d89840083d Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 19:13:01 +0000 Subject: [PATCH 392/419] [D3DXOF] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62820 --- reactos/dll/directx/wine/d3dxof/d3dxof.c | 2 +- reactos/dll/directx/wine/d3dxof/d3dxof.idl | 2 ++ reactos/dll/directx/wine/d3dxof/d3dxof.rgs | 13 +++++++++++++ reactos/dll/directx/wine/d3dxof/main.c | 2 +- reactos/dll/directx/wine/d3dxof/parsing.c | 20 ++++++++++---------- reactos/dll/directx/wine/d3dxof/version.rc | 4 +++- reactos/media/doc/README.WINE | 2 +- reactos/media/inf/syssetup.inf | 1 + 8 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 reactos/dll/directx/wine/d3dxof/d3dxof.rgs diff --git a/reactos/dll/directx/wine/d3dxof/d3dxof.c b/reactos/dll/directx/wine/d3dxof/d3dxof.c index 0cab8277874..8b8f3de4f1b 100644 --- a/reactos/dll/directx/wine/d3dxof/d3dxof.c +++ b/reactos/dll/directx/wine/d3dxof/d3dxof.c @@ -176,7 +176,7 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV HGLOBAL resource_data; LPDXFILELOADRESOURCE lpdxflr = pvSource; - TRACE("Source in resource (module = %p, name = %s, type = %s\n", lpdxflr->hModule, debugstr_a(lpdxflr->lpName), debugstr_a(lpdxflr->lpType)); + TRACE("Source in resource (module = %p, name = %s, type = %s)\n", lpdxflr->hModule, debugstr_a(lpdxflr->lpName), debugstr_a(lpdxflr->lpType)); resource_info = FindResourceA(lpdxflr->hModule, lpdxflr->lpName, lpdxflr->lpType); if (!resource_info) diff --git a/reactos/dll/directx/wine/d3dxof/d3dxof.idl b/reactos/dll/directx/wine/d3dxof/d3dxof.idl index ea72a6e36e0..79d35cc3b2e 100644 --- a/reactos/dll/directx/wine/d3dxof/d3dxof.idl +++ b/reactos/dll/directx/wine/d3dxof/d3dxof.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("DirectX File"), threading(both), diff --git a/reactos/dll/directx/wine/d3dxof/d3dxof.rgs b/reactos/dll/directx/wine/d3dxof/d3dxof.rgs new file mode 100644 index 00000000000..f6fa4382d63 --- /dev/null +++ b/reactos/dll/directx/wine/d3dxof/d3dxof.rgs @@ -0,0 +1,13 @@ +HKCR +{ + NoRemove Interface + { + } + NoRemove CLSID + { + '{4516EC43-8F20-11D0-9B6D-0000C0781BC3}' = s 'DirectX File' + { + InprocServer32 = s '%MODULE%' { val ThreadingModel = s 'Both' } + } + } +} diff --git a/reactos/dll/directx/wine/d3dxof/main.c b/reactos/dll/directx/wine/d3dxof/main.c index 103c771c91c..c2f82529f6e 100644 --- a/reactos/dll/directx/wine/d3dxof/main.c +++ b/reactos/dll/directx/wine/d3dxof/main.c @@ -119,7 +119,7 @@ static HRESULT WINAPI XFCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter static HRESULT WINAPI XFCF_LockServer(LPCLASSFACTORY iface, BOOL dolock) { IClassFactoryImpl *This = impl_from_IClassFactory(iface); - FIXME("(%p)->(%d),stub!\n",This,dolock); + FIXME("(%p)->(%d), stub!\n",This,dolock); return S_OK; } diff --git a/reactos/dll/directx/wine/d3dxof/parsing.c b/reactos/dll/directx/wine/d3dxof/parsing.c index 224c83db294..564fe22d6d1 100644 --- a/reactos/dll/directx/wine/d3dxof/parsing.c +++ b/reactos/dll/directx/wine/d3dxof/parsing.c @@ -79,7 +79,7 @@ static const char *debugstr_fourcc(DWORD fourcc) (char)(fourcc >> 16), (char)(fourcc >> 24)); } -static const char* get_primitive_string(WORD token) +static const char* get_primitive_string(DWORD token) { switch(token) { @@ -499,11 +499,11 @@ static BOOL is_name(parse_buffer* buf) char tmp[512]; DWORD pos = 0; char c; - BOOL error = 0; + BOOL error = FALSE; while (pos < buf->rem_bytes && !is_separator(c = *(buf->buffer+pos))) { if (!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9')) || (c == '_') || (c == '-'))) - error = 1; + error = TRUE; if (pos < sizeof(tmp)) tmp[pos] = c; pos++; @@ -531,7 +531,7 @@ static BOOL is_float(parse_buffer* buf) DWORD pos = 0; char c; float decimal; - BOOL dot = 0; + BOOL dot = FALSE; while (pos < buf->rem_bytes && !is_separator(c = *(buf->buffer+pos))) { @@ -591,7 +591,7 @@ static BOOL is_string(parse_buffer* buf) char tmp[512]; DWORD pos = 0; char c; - BOOL ok = 0; + BOOL ok = FALSE; if (*buf->buffer != '"') return FALSE; @@ -601,7 +601,7 @@ static BOOL is_string(parse_buffer* buf) c = *(buf->buffer+pos+1); if (c == '"') { - ok = 1; + ok = TRUE; break; } if (pos < sizeof(tmp)) @@ -888,10 +888,10 @@ static inline BOOL is_primitive_type(WORD token) case TOKEN_LPSTR: case TOKEN_UNICODE: case TOKEN_CSTRING: - ret = 1; + ret = TRUE; break; default: - ret = 0; + ret = FALSE; break; } return ret; @@ -937,14 +937,14 @@ static BOOL parse_template_members_list(parse_buffer * buf) while (1) { - BOOL array = 0; + BOOL array = FALSE; int nb_dims = 0; cur_member = &buf->pdxf->xtemplates[buf->pdxf->nb_xtemplates].members[idx_member]; if (check_TOKEN(buf) == TOKEN_ARRAY) { get_TOKEN(buf); - array = 1; + array = TRUE; } if (check_TOKEN(buf) == TOKEN_NAME) diff --git a/reactos/dll/directx/wine/d3dxof/version.rc b/reactos/dll/directx/wine/d3dxof/version.rc index 93c1371c7c0..f7e4e7c30d3 100644 --- a/reactos/dll/directx/wine/d3dxof/version.rc +++ b/reactos/dll/directx/wine/d3dxof/version.rc @@ -23,4 +23,6 @@ #define WINE_PRODUCTVERSION 5,0,2135,1 #define WINE_PRODUCTVERSION_STR "5.0.2135.1" -#include "wine/wine_common_ver.rc" +1 WINE_REGISTRY d3dxof.rgs + +#include diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 4ce0a8ba071..6b716b81850 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -32,7 +32,7 @@ reactos/dll/directx/wine/d3d8 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3d9 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.17 -reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.1 +reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.17 reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.17 reactos/dll/directx/wine/devenum # Synced to Wine-1.7.1 reactos/dll/directx/wine/dinput # Synced to Wine-1.7.1 diff --git a/reactos/media/inf/syssetup.inf b/reactos/media/inf/syssetup.inf index 51bd7101547..06328771038 100644 --- a/reactos/media/inf/syssetup.inf +++ b/reactos/media/inf/syssetup.inf @@ -42,6 +42,7 @@ AddReg=Classes 11,,comctl32.dll,2 11,,cryptdlg.dll,1 11,,cryptnet.dll,1 +11,,d3dxof.dll,1 11,,ddraw.dll,1 11,,devenum.dll,1 11,,dinput.dll,1 From c5a095eadbd307bed43f2a9cd5abd729a48594e1 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 19:30:15 +0000 Subject: [PATCH 393/419] [DEVENUM] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62821 --- .../dll/directx/wine/devenum/CMakeLists.txt | 1 + .../dll/directx/wine/devenum/createdevenum.c | 129 +++++++++++++++--- .../directx/wine/devenum/devenum_classes.idl | 2 + .../directx/wine/devenum/devenum_private.h | 2 +- .../dll/directx/wine/devenum/mediacatenum.c | 32 +++-- reactos/media/doc/README.WINE | 2 +- 6 files changed, 137 insertions(+), 31 deletions(-) diff --git a/reactos/dll/directx/wine/devenum/CMakeLists.txt b/reactos/dll/directx/wine/devenum/CMakeLists.txt index 52d6f4a01a7..5768de217ba 100644 --- a/reactos/dll/directx/wine/devenum/CMakeLists.txt +++ b/reactos/dll/directx/wine/devenum/CMakeLists.txt @@ -23,5 +23,6 @@ set_source_files_properties(devenum.rc PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT set_module_type(devenum win32dll UNICODE) target_link_libraries(devenum strmiids uuid wine) add_importlibs(devenum advapi32 ole32 oleaut32 winmm user32 avicap32 msvcrt kernel32 ntdll) +add_delay_importlibs(devenum msvfw32) add_pch(devenum devenum_private.h SOURCE) add_cd_file(TARGET devenum DESTINATION reactos/system32 FOR all) diff --git a/reactos/dll/directx/wine/devenum/createdevenum.c b/reactos/dll/directx/wine/devenum/createdevenum.c index c69849b69b3..29ba0e8ca33 100644 --- a/reactos/dll/directx/wine/devenum/createdevenum.c +++ b/reactos/dll/directx/wine/devenum/createdevenum.c @@ -26,12 +26,13 @@ #include "devenum_private.h" #include +#include #include "resource.h" extern HINSTANCE DEVENUM_hInstance; -const WCHAR wszInstanceKeyName[] ={'I','n','s','t','a','n','c','e',0}; +const WCHAR wszInstanceKeyName[] ={'\\','I','n','s','t','a','n','c','e',0}; static const WCHAR wszRegSeparator[] = {'\\', 0 }; static const WCHAR wszActiveMovieKey[] = {'S','o','f','t','w','a','r','e','\\', @@ -101,12 +102,18 @@ static ULONG WINAPI DEVENUM_ICreateDevEnum_Release(ICreateDevEnum * iface) return 1; /* non-heap based object */ } +static BOOL IsSpecialCategory(const CLSID *clsid) +{ + return IsEqualGUID(clsid, &CLSID_AudioRendererCategory) || + IsEqualGUID(clsid, &CLSID_AudioInputDeviceCategory) || + IsEqualGUID(clsid, &CLSID_VideoInputDeviceCategory) || + IsEqualGUID(clsid, &CLSID_VideoCompressorCategory) || + IsEqualGUID(clsid, &CLSID_MidiRendererCategory); +} + HRESULT DEVENUM_GetCategoryKey(REFCLSID clsidDeviceClass, HKEY *pBaseKey, WCHAR *wszRegKeyName, UINT maxLen) { - if (IsEqualGUID(clsidDeviceClass, &CLSID_AudioRendererCategory) || - IsEqualGUID(clsidDeviceClass, &CLSID_AudioInputDeviceCategory) || - IsEqualGUID(clsidDeviceClass, &CLSID_VideoInputDeviceCategory) || - IsEqualGUID(clsidDeviceClass, &CLSID_MidiRendererCategory)) + if (IsSpecialCategory(clsidDeviceClass)) { *pBaseKey = HKEY_CURRENT_USER; strcpyW(wszRegKeyName, wszActiveMovieKey); @@ -123,13 +130,57 @@ HRESULT DEVENUM_GetCategoryKey(REFCLSID clsidDeviceClass, HKEY *pBaseKey, WCHAR if (!StringFromGUID2(clsidDeviceClass, wszRegKeyName + CLSID_STR_LEN, maxLen - CLSID_STR_LEN)) return E_OUTOFMEMORY; - strcatW(wszRegKeyName, wszRegSeparator); strcatW(wszRegKeyName, wszInstanceKeyName); } return S_OK; } +static HKEY open_category_key(const CLSID *clsid) +{ + WCHAR key_name[sizeof(wszInstanceKeyName)/sizeof(WCHAR) + CHARS_IN_GUID-1 + 6 /* strlen("CLSID\") */], *ptr; + HKEY ret; + + strcpyW(key_name, clsid_keyname); + ptr = key_name + strlenW(key_name); + *ptr++ = '\\'; + + if (!StringFromGUID2(clsid, ptr, CHARS_IN_GUID)) + return NULL; + + ptr += strlenW(ptr); + strcpyW(ptr, wszInstanceKeyName); + + if (RegOpenKeyExW(HKEY_CLASSES_ROOT, key_name, 0, KEY_READ, &ret) != ERROR_SUCCESS) { + WARN("Could not open %s\n", debugstr_w(key_name)); + return NULL; + } + + return ret; +} + +static HKEY open_special_category_key(const CLSID *clsid, BOOL create) +{ + WCHAR key_name[sizeof(wszActiveMovieKey)/sizeof(WCHAR) + CHARS_IN_GUID-1]; + HKEY ret; + LONG res; + + strcpyW(key_name, wszActiveMovieKey); + if (!StringFromGUID2(clsid, key_name + sizeof(wszActiveMovieKey)/sizeof(WCHAR)-1, CHARS_IN_GUID)) + return NULL; + + if(create) + res = RegCreateKeyW(HKEY_CURRENT_USER, key_name, &ret); + else + res = RegOpenKeyExW(HKEY_CURRENT_USER, key_name, 0, KEY_READ, &ret); + if (res != ERROR_SUCCESS) { + WARN("Could not open %s\n", debugstr_w(key_name)); + return NULL; + } + + return ret; +} + static void DEVENUM_ReadPinTypes(HKEY hkeyPinKey, REGFILTERPINS *rgPin) { HKEY hkeyTypes = NULL; @@ -455,9 +506,7 @@ static HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator( IEnumMoniker **ppEnumMoniker, DWORD dwFlags) { - WCHAR wszRegKey[MAX_PATH]; - HKEY hkey; - HKEY hbasekey; + HKEY hkey, special_hkey = NULL; HRESULT hr; TRACE("(%p)->(%s, %p, %x)\n", iface, debugstr_guid(clsidDeviceClass), ppEnumMoniker, dwFlags); @@ -472,32 +521,29 @@ static HRESULT WINAPI DEVENUM_ICreateDevEnum_CreateClassEnumerator( DEVENUM_RegisterLegacyAmFilters(); } - hr = DEVENUM_GetCategoryKey(clsidDeviceClass, &hbasekey, wszRegKey, MAX_PATH); - if (FAILED(hr)) - return hr; - - if (IsEqualGUID(clsidDeviceClass, &CLSID_AudioRendererCategory) || - IsEqualGUID(clsidDeviceClass, &CLSID_AudioInputDeviceCategory) || - IsEqualGUID(clsidDeviceClass, &CLSID_VideoInputDeviceCategory) || - IsEqualGUID(clsidDeviceClass, &CLSID_MidiRendererCategory)) + if (IsSpecialCategory(clsidDeviceClass)) { hr = DEVENUM_CreateSpecialCategories(); if (FAILED(hr)) return hr; - if (RegOpenKeyW(hbasekey, wszRegKey, &hkey) != ERROR_SUCCESS) + + special_hkey = open_special_category_key(clsidDeviceClass, FALSE); + if (!special_hkey) { ERR("Couldn't open registry key for special device: %s\n", debugstr_guid(clsidDeviceClass)); return S_FALSE; } } - else if (RegOpenKeyW(hbasekey, wszRegKey, &hkey) != ERROR_SUCCESS) + + hkey = open_category_key(clsidDeviceClass); + if (!hkey && !special_hkey) { FIXME("Category %s not found\n", debugstr_guid(clsidDeviceClass)); return S_FALSE; } - return DEVENUM_IEnumMoniker_Construct(hkey, ppEnumMoniker); + return DEVENUM_IEnumMoniker_Construct(hkey, special_hkey, ppEnumMoniker); } /********************************************************************** @@ -548,6 +594,44 @@ static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID * clsidCategory) return res; } +static void register_vfw_codecs(void) +{ + WCHAR avico_clsid_str[CHARS_IN_GUID]; + HKEY basekey, key; + ICINFO icinfo; + DWORD i, res; + + static const WCHAR CLSIDW[] = {'C','L','S','I','D',0}; + static const WCHAR FccHandlerW[] = {'F','c','c','H','a','n','d','l','e','r',0}; + static const WCHAR FriendlyNameW[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0}; + + StringFromGUID2(&CLSID_AVICo, avico_clsid_str, sizeof(avico_clsid_str)/sizeof(WCHAR)); + + basekey = open_special_category_key(&CLSID_VideoCompressorCategory, TRUE); + if(!basekey) { + ERR("Could not create key\n"); + return; + } + + for(i=0; ICInfo(FCC('v','i','d','c'), i, &icinfo); i++) { + WCHAR fcc_str[5] = {LOBYTE(LOWORD(icinfo.fccHandler)), HIBYTE(LOWORD(icinfo.fccHandler)), + LOBYTE(HIWORD(icinfo.fccHandler)), HIBYTE(HIWORD(icinfo.fccHandler))}; + + res = RegCreateKeyW(basekey, fcc_str, &key); + if(res != ERROR_SUCCESS) + continue; + + RegSetValueExW(key, CLSIDW, 0, REG_SZ, (const BYTE*)avico_clsid_str, sizeof(avico_clsid_str)); + RegSetValueExW(key, FccHandlerW, 0, REG_SZ, (const BYTE*)fcc_str, sizeof(fcc_str)); + RegSetValueExW(key, FriendlyNameW, 0, REG_SZ, (const BYTE*)icinfo.szName, (strlenW(icinfo.szName)+1)*sizeof(WCHAR)); + /* FIXME: Set ClassManagerFlags and FilterData values */ + + RegCloseKey(key); + } + + RegCloseKey(basekey); +} + static HANDLE DEVENUM_populate_handle; static const WCHAR DEVENUM_populate_handle_nameW[] = {'_','_','W','I','N','E','_', @@ -598,6 +682,8 @@ static HRESULT DEVENUM_CreateSpecialCategories(void) RegDeleteTreeW(basekey, path); if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_MidiRendererCategory, &basekey, path, MAX_PATH))) RegDeleteTreeW(basekey, path); + if (SUCCEEDED(DEVENUM_GetCategoryKey(&CLSID_VideoCompressorCategory, &basekey, path, MAX_PATH))) + RegDeleteTreeW(basekey, path); rf2.dwVersion = 2; rf2.dwMerit = MERIT_PREFERRED; @@ -877,6 +963,9 @@ static HRESULT DEVENUM_CreateSpecialCategories(void) if (pMapper) IFilterMapper2_Release(pMapper); + + register_vfw_codecs(); + SetEvent(DEVENUM_populate_handle); return res; } diff --git a/reactos/dll/directx/wine/devenum/devenum_classes.idl b/reactos/dll/directx/wine/devenum/devenum_classes.idl index 872291026e8..81052e15825 100644 --- a/reactos/dll/directx/wine/devenum/devenum_classes.idl +++ b/reactos/dll/directx/wine/devenum/devenum_classes.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("System Device Enum"), threading(both), diff --git a/reactos/dll/directx/wine/devenum/devenum_private.h b/reactos/dll/directx/wine/devenum/devenum_private.h index 35d4d46ba90..32e71da6839 100644 --- a/reactos/dll/directx/wine/devenum/devenum_private.h +++ b/reactos/dll/directx/wine/devenum/devenum_private.h @@ -77,7 +77,7 @@ typedef struct } MediaCatMoniker; MediaCatMoniker * DEVENUM_IMediaCatMoniker_Construct(void) DECLSPEC_HIDDEN; -HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker) DECLSPEC_HIDDEN; +HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, HKEY special_hkey, IEnumMoniker ** ppEnumMoniker) DECLSPEC_HIDDEN; extern ClassFactoryImpl DEVENUM_ClassFactory DECLSPEC_HIDDEN; extern ICreateDevEnum DEVENUM_CreateDevEnum DECLSPEC_HIDDEN; diff --git a/reactos/dll/directx/wine/devenum/mediacatenum.c b/reactos/dll/directx/wine/devenum/mediacatenum.c index 58022096831..3f28d2675cd 100644 --- a/reactos/dll/directx/wine/devenum/mediacatenum.c +++ b/reactos/dll/directx/wine/devenum/mediacatenum.c @@ -32,7 +32,9 @@ typedef struct IEnumMoniker IEnumMoniker_iface; LONG ref; DWORD index; + DWORD subkey_cnt; HKEY hkey; + HKEY special_hkey; } EnumMonikerImpl; typedef struct @@ -714,6 +716,8 @@ static ULONG WINAPI DEVENUM_IEnumMoniker_Release(IEnumMoniker *iface) if (!ref) { + if(This->special_hkey) + RegCloseKey(This->special_hkey); RegCloseKey(This->hkey); CoTaskMemFree(This); DEVENUM_UnlockModule(); @@ -735,7 +739,12 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt, while (fetched < celt) { - res = RegEnumKeyW(This->hkey, This->index, buffer, sizeof(buffer) / sizeof(WCHAR)); + if(This->index+fetched < This->subkey_cnt) + res = RegEnumKeyW(This->hkey, This->index+fetched, buffer, sizeof(buffer) / sizeof(WCHAR)); + else if(This->special_hkey) + res = RegEnumKeyW(This->special_hkey, This->index+fetched-This->subkey_cnt, buffer, sizeof(buffer) / sizeof(WCHAR)); + else + break; if (res != ERROR_SUCCESS) { break; @@ -744,7 +753,8 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt, if (!pMoniker) return E_OUTOFMEMORY; - if (RegOpenKeyW(This->hkey, buffer, &pMoniker->hkey) != ERROR_SUCCESS) + if (RegOpenKeyW(This->index+fetched < This->subkey_cnt ? This->hkey : This->special_hkey, + buffer, &pMoniker->hkey) != ERROR_SUCCESS) { IMoniker_Release(&pMoniker->IMoniker_iface); break; @@ -769,17 +779,16 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt, static HRESULT WINAPI DEVENUM_IEnumMoniker_Skip(IEnumMoniker *iface, ULONG celt) { EnumMonikerImpl *This = impl_from_IEnumMoniker(iface); - DWORD subKeys; + DWORD special_subkeys = 0; TRACE("(%p)->(%d)\n", iface, celt); /* Before incrementing, check if there are any more values to run through. Some programs use the Skip() function to get the number of devices */ - if(RegQueryInfoKeyW(This->hkey, NULL, NULL, NULL, &subKeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) - { - return S_FALSE; - } - if((This->index + celt) >= subKeys) + if(This->special_hkey) + RegQueryInfoKeyW(This->special_hkey, NULL, NULL, NULL, &special_subkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + + if((This->index + celt) >= This->subkey_cnt + special_subkeys) { return S_FALSE; } @@ -821,7 +830,7 @@ static const IEnumMonikerVtbl IEnumMoniker_Vtbl = DEVENUM_IEnumMoniker_Clone }; -HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker) +HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, HKEY special_hkey, IEnumMoniker ** ppEnumMoniker) { EnumMonikerImpl * pEnumMoniker = CoTaskMemAlloc(sizeof(EnumMonikerImpl)); if (!pEnumMoniker) @@ -831,9 +840,14 @@ HRESULT DEVENUM_IEnumMoniker_Construct(HKEY hkey, IEnumMoniker ** ppEnumMoniker) pEnumMoniker->ref = 1; pEnumMoniker->index = 0; pEnumMoniker->hkey = hkey; + pEnumMoniker->special_hkey = special_hkey; *ppEnumMoniker = &pEnumMoniker->IEnumMoniker_iface; + if(RegQueryInfoKeyW(pEnumMoniker->hkey, NULL, NULL, NULL, &pEnumMoniker->subkey_cnt, NULL, NULL, NULL, NULL, NULL, NULL, NULL) != ERROR_SUCCESS) + pEnumMoniker->subkey_cnt = 0; + + DEVENUM_LockModule(); return S_OK; diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 6b716b81850..3184ddebe2b 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -34,7 +34,7 @@ reactos/dll/directx/wine/d3dcompiler_43 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.17 reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.17 -reactos/dll/directx/wine/devenum # Synced to Wine-1.7.1 +reactos/dll/directx/wine/devenum # Synced to Wine-1.7.17 reactos/dll/directx/wine/dinput # Synced to Wine-1.7.1 reactos/dll/directx/wine/dinput8 # Synced to Wine-1.7.1 reactos/dll/directx/wine/dmusic # Synced to Wine-1.7.1 From 117d0c43e71aa9858a61ca0dc8722812b4f33c3b Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 19:30:34 +0000 Subject: [PATCH 394/419] [DEVENUM_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62822 --- rostests/winetests/devenum/devenum.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/rostests/winetests/devenum/devenum.c b/rostests/winetests/devenum/devenum.c index afcfa8e2715..7e25857f7d1 100644 --- a/rostests/winetests/devenum/devenum.c +++ b/rostests/winetests/devenum/devenum.c @@ -34,6 +34,8 @@ #include static const WCHAR friendly_name[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0}; +static const WCHAR fcc_handlerW[] = {'F','c','c','H','a','n','d','l','e','r',0}; +static const WCHAR mrleW[] = {'m','r','l','e',0}; struct category { @@ -57,6 +59,7 @@ static void test_devenum(IBindCtx *bind_ctx) HRESULT res; ICreateDevEnum* create_devenum; IEnumMoniker* enum_moniker = NULL; + BOOL have_mrle = FALSE; int i; res = CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC, @@ -101,6 +104,17 @@ static void test_devenum(IBindCtx *bind_ctx) { trace(" ???\n"); } + + if (IsEqualGUID(&CLSID_VideoCompressorCategory, am_categories[i].clsid)) { + /* Test well known compressor to ensure that we really enumerate codecs */ + hr = IPropertyBag_Read(prop_bag, fcc_handlerW, &var, NULL); + if (SUCCEEDED(hr)) { + ok(V_VT(&var) == VT_BSTR, "V_VT(var) = %d\n", V_VT(&var)); + if(!lstrcmpW(V_BSTR(&var), mrleW)) + have_mrle = TRUE; + VariantClear(&var); + } + } } if (prop_bag) @@ -112,6 +126,10 @@ static void test_devenum(IBindCtx *bind_ctx) } ICreateDevEnum_Release(create_devenum); + + /* 64-bit windows are missing mrle codec */ + if(sizeof(void*) == 4) + ok(have_mrle, "mrle codec not found\n"); } /* CLSID_CDeviceMoniker */ From a5b446bbaa066b7e22be0817c570a4171d66c728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 19 Apr 2014 23:18:29 +0000 Subject: [PATCH 395/419] =?UTF-8?q?[SOLITAIRE][RAPPS][MSGINA]=20Polish=20t?= =?UTF-8?q?ranslation=20of=20solitaire,=20rapps=20and=20msgina=20Patch=20b?= =?UTF-8?q?y=20Wojciech=20Koz=C5=82owski=20and=20Adam=20Stachowicz.=20Than?= =?UTF-8?q?ks=20a=20lot!=20CORE-8068=20#resolve=20#comment=20Second=20patc?= =?UTF-8?q?h=20committed=20in=20revision=2062823,=20thanks=20;)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=62823 --- .../applications/games/solitaire/lang/pl-PL.rc | 15 ++++++++------- reactos/base/applications/rapps/lang/pl-PL.rc | 4 ++-- reactos/dll/win32/msgina/lang/pl-PL.rc | 11 +++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/reactos/base/applications/games/solitaire/lang/pl-PL.rc b/reactos/base/applications/games/solitaire/lang/pl-PL.rc index 85521de110c..8ba4f725869 100644 --- a/reactos/base/applications/games/solitaire/lang/pl-PL.rc +++ b/reactos/base/applications/games/solitaire/lang/pl-PL.rc @@ -5,6 +5,7 @@ * Updated by Caemyr (olaf_siejka@o2.pl), Nov, 2008 * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (Apr, 2011) * UTF-8 conversion by Caemyr (May, 2011) + * updated by Wojciech Kozłowski (wojo664@gmail.com) (April, 2014) */ LANGUAGE LANG_POLISH, SUBLANG_DEFAULT @@ -19,13 +20,13 @@ BEGIN GROUPBOX "Karty", -1, 7, 7, 90, 40 AUTORADIOBUTTON "Rozdaj &jedną", IDC_OPT_DRAWONE, 14, 19, 70, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Rozdaj &dwie", IDC_OPT_DRAWTHREE, 14, 32, 70, 10 - GROUPBOX "Scoring", -1, 100, 7, 75, 53 - AUTORADIOBUTTON "&Standard", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP + GROUPBOX "Punktowanie", -1, 100, 7, 75, 53 + AUTORADIOBUTTON "&Standardowe", IDC_OPT_STANDARD, 107, 19, 60, 10, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "&Vegas", IDC_OPT_VEGAS, 107, 32, 60, 10 - AUTORADIOBUTTON "&None", IDC_OPT_NOSCORE, 107, 45, 60, 10 + AUTORADIOBUTTON "&Brak", IDC_OPT_NOSCORE, 107, 45, 60, 10 AUTOCHECKBOX "&Pokazuj czas gry", IDC_OPT_SHOWTIME, 7 ,51 ,65 ,10, WS_TABSTOP AUTOCHECKBOX "Pokazuj pa&sek stanu", IDC_OPT_STATUSBAR, 7, 66, 77, 10, WS_TABSTOP - AUTOCHECKBOX "&Keep Score", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP + AUTOCHECKBOX "Pamiętaj punkty", IDC_OPT_KEEPSCORE, 100, 66, 65, 10, WS_TABSTOP DEFPUSHBUTTON "OK", IDOK, 35, 97, 50, 14 PUSHBUTTON "Anuluj", IDCANCEL, 101, 97, 50, 14 END @@ -56,12 +57,12 @@ END STRINGTABLE BEGIN IDS_SOL_NAME "Pasjans" - IDS_SOL_ABOUT "Pasjans by J. Brown\n\nCardLib version 1.0." + IDS_SOL_ABOUT "Pasjans - autor: J. Brown\n\nCardLib wersja 1.0." IDS_SOL_QUIT "Zakończyć aktualną grę?" IDS_SOL_WIN "Gratulacje, wygrałeś!" IDS_SOL_DEAL "Nowe rozdanie?" - IDS_SOL_SCORE "Score: %d" - IDS_SOL_TIME "Time: %d" + IDS_SOL_SCORE "Wynik: %d" + IDS_SOL_TIME "Czas: %d" END /* Menus */ diff --git a/reactos/base/applications/rapps/lang/pl-PL.rc b/reactos/base/applications/rapps/lang/pl-PL.rc index 397af7fba16..7b1bca716f9 100644 --- a/reactos/base/applications/rapps/lang/pl-PL.rc +++ b/reactos/base/applications/rapps/lang/pl-PL.rc @@ -26,7 +26,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "O&dśwież", ID_REFRESH MENUITEM SEPARATOR - MENUITEM "Aktualizuj ba&zę pogramów", ID_RESETDB + MENUITEM "Ak&tualizuj bazę programów", ID_RESETDB END POPUP "Pomoc" BEGIN @@ -56,7 +56,7 @@ BEGIN MENUITEM SEPARATOR MENUITEM "&Odśwież", ID_REFRESH MENUITEM SEPARATOR - MENUITEM "Aktualizuj ba&zę pogramów", ID_RESETDB + MENUITEM "Ak&tualizuj bazę programów", ID_RESETDB END END diff --git a/reactos/dll/win32/msgina/lang/pl-PL.rc b/reactos/dll/win32/msgina/lang/pl-PL.rc index 81f1d5bd45b..86520561671 100644 --- a/reactos/dll/win32/msgina/lang/pl-PL.rc +++ b/reactos/dll/win32/msgina/lang/pl-PL.rc @@ -3,8 +3,8 @@ * testament@users.sourceforge.net * https://sourceforge.net/projects/reactospl * UTF-8 conversion by Caemyr (May, 2011) - * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (November, 2013) - * Updated by wojo664 - Wojtek Kozlowski (wojo664@gmail.com, wojtekkozlo664@op.pl) (April 2014) + * Updated by Saibamen - Adam Stachowicz (saibamenppl@gmail.com) (April, 2014) + * Updated by wojo664 - Wojtek Kozłowski (wojo664@gmail.com, wojtekkozlo664@op.pl) (April, 2014) */ @@ -158,12 +158,11 @@ BEGIN IDS_LOGONTITLE "Logowanie - wiadomość" IDS_LOGONWRONGUSERORPWD "Logowanie w systemie nie jest możliwe. Upewnij się, że nazwa użytkownika i domena jest poprawna, a następnie wpisz ponownie hasło. Wielkość liter w haśle ma znaczenie." IDS_LOGONUSERDISABLED "Twoje konto zostało wyłączone. Skontaktuj się z administratorem systemu." - IDS_PASSWORDMUSTCHANGE "You are required to change your password at first logon." - IDS_PASSWORDEXPIRED "Your password has expired and must be changed." + IDS_PASSWORDMUSTCHANGE "Jesteś zobowiązany do zmiany hasła przy pierwszym logowaniu." + IDS_PASSWORDEXPIRED "Twoje hasło wygasło i musi zostać zmienione." END -/* Shutdown Dialog Strings */ -STRINGTABLE +/* Shutdown Dialog Strings */STRINGTABLE BEGIN IDS_SHUTDOWN_LOGOFF "Wyloguj ""%s""" IDS_SHUTDOWN_SHUTDOWN "Wyłącz" From 66d0027638a3d3d92afe0d326c8ee07800904f3a Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 23:43:51 +0000 Subject: [PATCH 396/419] [DINPUT] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62824 --- reactos/dll/directx/wine/dinput/device.c | 10 +- .../directx/wine/dinput/dinput_classes.idl | 2 + .../directx/wine/dinput/effect_linuxinput.c | 2 +- reactos/dll/directx/wine/dinput/joystick.c | 4 +- .../dll/directx/wine/dinput/joystick_linux.c | 5 +- .../directx/wine/dinput/joystick_linuxinput.c | 18 +- .../dll/directx/wine/dinput/joystick_osx.c | 482 +++++++++++------- reactos/dll/directx/wine/dinput/keyboard.c | 2 +- reactos/media/doc/README.WINE | 2 +- 9 files changed, 315 insertions(+), 212 deletions(-) diff --git a/reactos/dll/directx/wine/dinput/device.c b/reactos/dll/directx/wine/dinput/device.c index 2abde287402..715e03dcb2d 100644 --- a/reactos/dll/directx/wine/dinput/device.c +++ b/reactos/dll/directx/wine/dinput/device.c @@ -561,7 +561,7 @@ static DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic) DWORD type = (0x0000ff00 & dwSemantic) >> 8; DWORD offset = 0x000000ff & dwSemantic; DWORD obj_instance = 0; - DWORD found = 0; + BOOL found = FALSE; int i; for (i = 0; i < This->data_format.wine_df->dwNumObjs; i++) @@ -571,7 +571,7 @@ static DWORD semantic_to_obj_id(IDirectInputDeviceImpl* This, DWORD dwSemantic) if (odf->dwOfs == offset) { obj_instance = DIDFT_GETINSTANCE(odf->dwType); - found = 1; + found = TRUE; break; } } @@ -705,8 +705,8 @@ HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8W(iface); WCHAR username[MAX_PATH]; DWORD username_size = MAX_PATH; - int i, has_actions = 0; - BOOL load_success = FALSE; + int i; + BOOL load_success = FALSE, has_actions = FALSE; /* Unless asked the contrary by these flags, try to load a previous mapping */ if (!(dwFlags & DIDBAM_HWDEFAULTS)) @@ -746,7 +746,7 @@ HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, lpdiaf->rgoAction[i].dwObjID = obj_id; lpdiaf->rgoAction[i].guidInstance = This->guid; lpdiaf->rgoAction[i].dwHow = DIAH_DEFAULT; - has_actions = 1; + has_actions = TRUE; } } else if (!(dwFlags & DIDBAM_PRESERVE)) diff --git a/reactos/dll/directx/wine/dinput/dinput_classes.idl b/reactos/dll/directx/wine/dinput/dinput_classes.idl index 1945b57efde..1471f554dfb 100644 --- a/reactos/dll/directx/wine/dinput/dinput_classes.idl +++ b/reactos/dll/directx/wine/dinput/dinput_classes.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("DirectInput Object"), threading(both), diff --git a/reactos/dll/directx/wine/dinput/effect_linuxinput.c b/reactos/dll/directx/wine/dinput/effect_linuxinput.c index da1fb85dff5..3f172172494 100644 --- a/reactos/dll/directx/wine/dinput/effect_linuxinput.c +++ b/reactos/dll/directx/wine/dinput/effect_linuxinput.c @@ -57,7 +57,7 @@ struct LinuxInputEffectImpl struct ff_effect effect; /* Effect data */ int gain; /* Effect gain */ - int first_axis_is_x; + BOOL first_axis_is_x; int* fd; /* Parent device */ struct list *entry; /* Entry into the parent's list of effects */ }; diff --git a/reactos/dll/directx/wine/dinput/joystick.c b/reactos/dll/directx/wine/dinput/joystick.c index 5019efdd239..a67596ff0b8 100644 --- a/reactos/dll/directx/wine/dinput/joystick.c +++ b/reactos/dll/directx/wine/dinput/joystick.c @@ -706,7 +706,7 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface, { JoystickGenericImpl *This = impl_from_IDirectInputDevice8W(iface); unsigned int i, j; - int has_actions = 0; + BOOL has_actions = FALSE; DWORD object_types[] = { DIDFT_AXIS, DIDFT_BUTTON }; DWORD type_map[] = { DIDFT_RELAXIS, DIDFT_PSHBUTTON }; @@ -737,7 +737,7 @@ HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface, lpdiaf->rgoAction[i].guidInstance = This->base.guid; lpdiaf->rgoAction[i].dwHow = DIAH_DEFAULT; - has_actions = 1; + has_actions = TRUE; /* No need to try other types if the action was already mapped */ break; diff --git a/reactos/dll/directx/wine/dinput/joystick_linux.c b/reactos/dll/directx/wine/dinput/joystick_linux.c index 04d0d039d12..10aa350c068 100644 --- a/reactos/dll/directx/wine/dinput/joystick_linux.c +++ b/reactos/dll/directx/wine/dinput/joystick_linux.c @@ -160,7 +160,7 @@ static INT find_joystick_devices(void) if (ioctl(fd, JSIOCGAXMAP, axes_map) < 0) { - WARN("ioctl(%s,JSIOCGNAME) failed: %s\n", joydev.device, strerror(errno)); + WARN("ioctl(%s,JSIOCGAXMAP) failed: %s\n", joydev.device, strerror(errno)); joydev.dev_axes_map = NULL; } else @@ -669,8 +669,7 @@ static void joy_polldev(LPDIRECTINPUTDEVICE8A iface) } } if (inst_id >= 0) - queue_event(iface, inst_id, - value, jse.time, This->generic.base.dinput->evsequence++); + queue_event(iface, inst_id, value, GetCurrentTime(), This->generic.base.dinput->evsequence++); } } diff --git a/reactos/dll/directx/wine/dinput/joystick_linuxinput.c b/reactos/dll/directx/wine/dinput/joystick_linuxinput.c index 896155304b1..2b754f2bd43 100644 --- a/reactos/dll/directx/wine/dinput/joystick_linuxinput.c +++ b/reactos/dll/directx/wine/dinput/joystick_linuxinput.c @@ -78,7 +78,7 @@ struct JoyDev { char *name; GUID guid; - int has_ff; + BOOL has_ff; int num_effects; /* data returned by EVIOCGBIT for caps, EV_ABS, EV_KEY, and EV_FF */ @@ -165,7 +165,7 @@ static void find_joydevs(void) char buf[MAX_PATH]; struct JoyDev joydev = {0}; int fd; - int no_ff_check = 0; + BOOL no_ff_check = FALSE; int j; struct JoyDev *new_joydevs; struct input_id device_id = {0}; @@ -175,7 +175,7 @@ static void find_joydevs(void) if ((fd = open(buf, O_RDWR)) == -1) { fd = open(buf, O_RDONLY); - no_ff_check = 1; + no_ff_check = TRUE; } if (fd == -1) @@ -186,19 +186,19 @@ static void find_joydevs(void) if (ioctl(fd, EVIOCGBIT(0, sizeof(joydev.evbits)), joydev.evbits) == -1) { - WARN("ioct(EVIOCGBIT, 0) failed: %d %s\n", errno, strerror(errno)); + WARN("ioctl(EVIOCGBIT, 0) failed: %d %s\n", errno, strerror(errno)); close(fd); continue; } if (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(joydev.absbits)), joydev.absbits) == -1) { - WARN("ioct(EVIOCGBIT, EV_ABS) failed: %d %s\n", errno, strerror(errno)); + WARN("ioctl(EVIOCGBIT, EV_ABS) failed: %d %s\n", errno, strerror(errno)); close(fd); continue; } if (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(joydev.keybits)), joydev.keybits) == -1) { - WARN("ioct(EVIOCGBIT, EV_KEY) failed: %d %s\n", errno, strerror(errno)); + WARN("ioctl(EVIOCGBIT, EV_KEY) failed: %d %s\n", errno, strerror(errno)); close(fd); continue; } @@ -256,7 +256,7 @@ static void find_joydevs(void) joydev.num_effects > 0) { TRACE(" ... with force feedback\n"); - joydev.has_ff = 1; + joydev.has_ff = TRUE; } #endif @@ -277,7 +277,7 @@ static void find_joydevs(void) } if (ioctl(fd, EVIOCGID, &device_id) == -1) - WARN("ioct(EVIOCGBIT, EV_ABS) failed: %d %s\n", errno, strerror(errno)); + WARN("ioctl(EVIOCGID) failed: %d %s\n", errno, strerror(errno)); else { joydev.vendor_id = device_id.vendor; @@ -854,7 +854,7 @@ static void joy_polldev(LPDIRECTINPUTDEVICE8A iface) } if (inst_id >= 0) queue_event(iface, inst_id, - value, ie.time.tv_usec, This->generic.base.dinput->evsequence++); + value, GetCurrentTime(), This->generic.base.dinput->evsequence++); } } diff --git a/reactos/dll/directx/wine/dinput/joystick_osx.c b/reactos/dll/directx/wine/dinput/joystick_osx.c index 6058cc06482..d5f54c23b3d 100644 --- a/reactos/dll/directx/wine/dinput/joystick_osx.c +++ b/reactos/dll/directx/wine/dinput/joystick_osx.c @@ -95,8 +95,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dinput); -static IOHIDManagerRef gIOHIDManagerRef = NULL; -static CFArrayRef gCollections = NULL; +static CFMutableArrayRef device_main_elements = NULL; typedef struct JoystickImpl JoystickImpl; static const IDirectInputDevice8AVtbl JoystickAvt; @@ -108,7 +107,7 @@ struct JoystickImpl /* osx private */ int id; - CFMutableArrayRef elementCFArrayRef; + CFArrayRef elements; ObjProps **propmap; FFDeviceObjectReference ff; struct list effects; @@ -181,36 +180,85 @@ static void CFSetApplierFunctionCopyToCFArray(const void *value, void *context) CFArrayAppendValue( ( CFMutableArrayRef ) context, value ); } +static const char* debugstr_cf(CFTypeRef t) +{ + CFStringRef s; + const char* ret; + + if (!t) return "(null)"; + + if (CFGetTypeID(t) == CFStringGetTypeID()) + s = t; + else + s = CFCopyDescription(t); + ret = CFStringGetCStringPtr(s, kCFStringEncodingUTF8); + if (ret) ret = debugstr_a(ret); + if (!ret) + { + const UniChar* u = CFStringGetCharactersPtr(s); + if (u) + ret = debugstr_wn((const WCHAR*)u, CFStringGetLength(s)); + } + if (!ret) + { + UniChar buf[200]; + int len = min(CFStringGetLength(s), sizeof(buf)/sizeof(buf[0])); + CFStringGetCharacters(s, CFRangeMake(0, len), buf); + ret = debugstr_wn(buf, len); + } + if (s != t) CFRelease(s); + return ret; +} + +static const char* debugstr_device(IOHIDDeviceRef device) +{ + return wine_dbg_sprintf("", device, + debugstr_cf(IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey)))); +} + +static const char* debugstr_element(IOHIDElementRef element) +{ + return wine_dbg_sprintf("", element, + IOHIDElementGetType(element), IOHIDElementGetUsagePage(element), + IOHIDElementGetUsage(element), IOHIDElementGetDevice(element)); +} + static IOHIDDeviceRef get_device_ref(int id) { - IOHIDElementRef tIOHIDElementRef; - IOHIDDeviceRef tIOHIDDeviceRef; + IOHIDElementRef device_main_element; + IOHIDDeviceRef hid_device; - if (!gCollections) + TRACE("id %d\n", id); + + if (!device_main_elements || id >= CFArrayGetCount(device_main_elements)) return 0; - tIOHIDElementRef = (IOHIDElementRef)CFArrayGetValueAtIndex(gCollections, id); - if (!tIOHIDElementRef) + device_main_element = (IOHIDElementRef)CFArrayGetValueAtIndex(device_main_elements, id); + if (!device_main_element) { ERR("Invalid Element requested %i\n",id); return 0; } - tIOHIDDeviceRef = IOHIDElementGetDevice(tIOHIDElementRef); - if (!tIOHIDDeviceRef) + hid_device = IOHIDElementGetDevice(device_main_element); + if (!hid_device) { ERR("Invalid Device requested %i\n",id); return 0; } - return tIOHIDDeviceRef; + TRACE("-> %s\n", debugstr_device(hid_device)); + return hid_device; } static HRESULT get_ff(IOHIDDeviceRef device, FFDeviceObjectReference *ret) { io_service_t service; CFMutableDictionaryRef matching; - CFTypeRef type; + CFTypeRef location_id; + HRESULT hr; + + TRACE("device %s\n", debugstr_device(device)); matching = IOServiceMatching(kIOHIDDeviceKey); if(!matching){ @@ -218,61 +266,67 @@ static HRESULT get_ff(IOHIDDeviceRef device, FFDeviceObjectReference *ret) return DIERR_DEVICENOTREG; } - type = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDLocationIDKey)); - if(!matching){ + location_id = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDLocationIDKey)); + if(!location_id){ CFRelease(matching); WARN("IOHIDDeviceGetProperty failed, force feedback disabled\n"); return DIERR_DEVICENOTREG; } - CFDictionaryAddValue(matching, CFSTR(kIOHIDLocationIDKey), type); + CFDictionaryAddValue(matching, CFSTR(kIOHIDLocationIDKey), location_id); service = IOServiceGetMatchingService(kIOMasterPortDefault, matching); - if(!ret) - return FFIsForceFeedback(service) == FF_OK ? S_OK : S_FALSE; + if (ret) + hr = osx_to_win32_hresult(FFCreateDevice(service, ret)); + else + hr = FFIsForceFeedback(service) == FF_OK ? S_OK : S_FALSE; - return osx_to_win32_hresult(FFCreateDevice(service, ret)); + IOObjectRelease(service); + TRACE("-> hr 0x%08x *ret %p\n", hr, ret ? *ret : NULL); + return hr; } -static CFMutableDictionaryRef creates_osx_device_match(int usage) +static CFMutableDictionaryRef create_osx_device_match(int usage) { CFMutableDictionaryRef result; + TRACE("usage %d\n", usage); + result = CFDictionaryCreateMutable( kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks ); if ( result ) { int number = kHIDPage_GenericDesktop; - CFNumberRef pageCFNumberRef = CFNumberCreate( kCFAllocatorDefault, + CFNumberRef page = CFNumberCreate( kCFAllocatorDefault, kCFNumberIntType, &number); - if ( pageCFNumberRef ) + if (page) { - CFNumberRef usageCFNumberRef; + CFNumberRef cf_usage; - CFDictionarySetValue( result, CFSTR( kIOHIDDeviceUsagePageKey ), - pageCFNumberRef ); - CFRelease( pageCFNumberRef ); + CFDictionarySetValue( result, CFSTR( kIOHIDDeviceUsagePageKey ), page ); + CFRelease( page ); - usageCFNumberRef = CFNumberCreate( kCFAllocatorDefault, + cf_usage = CFNumberCreate( kCFAllocatorDefault, kCFNumberIntType, &usage); - if ( usageCFNumberRef ) + if (cf_usage) { - CFDictionarySetValue( result, CFSTR( kIOHIDDeviceUsageKey ), - usageCFNumberRef ); - CFRelease( usageCFNumberRef ); + CFDictionarySetValue( result, CFSTR( kIOHIDDeviceUsageKey ), cf_usage ); + CFRelease( cf_usage ); } else { ERR("CFNumberCreate() failed.\n"); + CFRelease(result); return NULL; } } else { ERR("CFNumberCreate failed.\n"); + CFRelease(result); return NULL; } } @@ -285,76 +339,86 @@ static CFMutableDictionaryRef creates_osx_device_match(int usage) return result; } -static CFIndex find_top_level(IOHIDDeviceRef tIOHIDDeviceRef, CFArrayRef topLevels) +static CFIndex find_top_level(IOHIDDeviceRef hid_device, CFMutableArrayRef main_elements) { - CFArrayRef gElementCFArrayRef; - CFIndex numTops = 0; + CFArrayRef elements; + CFIndex total = 0; - if (!tIOHIDDeviceRef) + TRACE("hid_device %s\n", debugstr_device(hid_device)); + + if (!hid_device) return 0; - gElementCFArrayRef = IOHIDDeviceCopyMatchingElements(tIOHIDDeviceRef, NULL, 0); + elements = IOHIDDeviceCopyMatchingElements(hid_device, NULL, 0); - if (gElementCFArrayRef) + if (elements) { - CFIndex idx, cnt = CFArrayGetCount(gElementCFArrayRef); + CFIndex idx, cnt = CFArrayGetCount(elements); for (idx=0; idx total %d\n", (int)total); + return total; } -static void get_element_children(IOHIDElementRef tElement, CFArrayRef childElements) +static void get_element_children(IOHIDElementRef element, CFMutableArrayRef all_children) { CFIndex idx, cnt; - CFArrayRef tElementChildrenArray = IOHIDElementGetChildren(tElement); + CFArrayRef element_children = IOHIDElementGetChildren(element); - cnt = CFArrayGetCount(tElementChildrenArray); - if (cnt < 1) - return; + TRACE("element %s\n", debugstr_element(element)); + + cnt = CFArrayGetCount(element_children); /* Either add the element to the array or grab its children */ for (idx=0; idx usage2) + return kCFCompareGreaterThan; + return kCFCompareEqualTo; } static void get_osx_device_elements(JoystickImpl *device, int axis_map[8]) { - IOHIDElementRef tIOHIDElementRef; - CFArrayRef gElementCFArrayRef; - DWORD axes = 0; + IOHIDElementRef device_main_element; + CFMutableArrayRef elements; DWORD sliders = 0; - DWORD buttons = 0; - DWORD povs = 0; - device->elementCFArrayRef = NULL; + TRACE("device %p device->id %d\n", device, device->id); - if (!gCollections) + device->elements = NULL; + + if (!device_main_elements || device->id >= CFArrayGetCount(device_main_elements)) return; - tIOHIDElementRef = (IOHIDElementRef)CFArrayGetValueAtIndex(gCollections, device->id); - - if (!tIOHIDElementRef) + device_main_element = (IOHIDElementRef)CFArrayGetValueAtIndex(device_main_elements, device->id); + TRACE("device_main_element %s\n", debugstr_element(device_main_element)); + if (!device_main_element) return; - gElementCFArrayRef = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); - get_element_children(tIOHIDElementRef, gElementCFArrayRef); + elements = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); + get_element_children(device_main_element, elements); - if (gElementCFArrayRef) + if (elements) { - CFIndex idx, cnt = CFArrayGetCount( gElementCFArrayRef ); - /* build our element array in the order that dinput expects */ - device->elementCFArrayRef = CFArrayCreateMutable(NULL,0,NULL); + CFIndex idx, cnt = CFArrayGetCount( elements ); + CFMutableArrayRef axes = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); + CFMutableArrayRef buttons = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); + CFMutableArrayRef povs = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); for ( idx = 0; idx < cnt; idx++ ) { - IOHIDElementRef tIOHIDElementRef = ( IOHIDElementRef ) CFArrayGetValueAtIndex( gElementCFArrayRef, idx ); - int eleType = IOHIDElementGetType( tIOHIDElementRef ); - switch(eleType) + IOHIDElementRef element = ( IOHIDElementRef ) CFArrayGetValueAtIndex( elements, idx ); + int type = IOHIDElementGetType( element ); + + TRACE("element %s\n", debugstr_element(element)); + + switch(type) { case kIOHIDElementTypeInput_Button: { - int usagePage = IOHIDElementGetUsagePage( tIOHIDElementRef ); - if (usagePage != kHIDPage_Button) + int usage_page = IOHIDElementGetUsagePage( element ); + TRACE("kIOHIDElementTypeInput_Button usage_page %d\n", usage_page); + if (usage_page != kHIDPage_Button) { /* avoid strange elements found on the 360 controller */ continue; } - if (buttons < 128) - { - CFArrayInsertValueAtIndex(device->elementCFArrayRef, (axes+povs+buttons), tIOHIDElementRef); - buttons++; - } + if (CFArrayGetCount(buttons) < 128) + CFArrayAppendValue(buttons, element); break; } case kIOHIDElementTypeInput_Axis: { - CFArrayInsertValueAtIndex(device->elementCFArrayRef, axes, tIOHIDElementRef); - axes++; + TRACE("kIOHIDElementTypeInput_Axis\n"); + CFArrayAppendValue(axes, element); break; } case kIOHIDElementTypeInput_Misc: { - uint32_t usage = IOHIDElementGetUsage( tIOHIDElementRef ); + uint32_t usage = IOHIDElementGetUsage( element ); switch(usage) { case kHIDUsage_GD_Hatswitch: { - CFArrayInsertValueAtIndex(device->elementCFArrayRef, (axes+povs), tIOHIDElementRef); - povs++; + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Hatswitch\n"); + CFArrayAppendValue(povs, element); break; } case kHIDUsage_GD_Slider: @@ -538,53 +607,65 @@ static void get_osx_device_elements(JoystickImpl *device, int axis_map[8]) case kHIDUsage_GD_Ry: case kHIDUsage_GD_Rz: { - CFArrayInsertValueAtIndex(device->elementCFArrayRef, axes, tIOHIDElementRef); - axis_map[axes]=usage; - axes++; + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_* (%d)\n", usage); + axis_map[CFArrayGetCount(axes)]=usage; + CFArrayAppendValue(axes, element); break; } default: - FIXME("Unhandled usage %i\n",usage); + FIXME("kIOHIDElementTypeInput_Misc / Unhandled usage %i\n", usage); } break; } default: - FIXME("Unhandled type %i\n",eleType); + FIXME("Unhandled type %i\n",type); } } + + /* Sort buttons into correct order */ + CFArraySortValues(buttons, CFRangeMake(0, CFArrayGetCount(buttons)), button_usage_comparator, NULL); + + device->generic.devcaps.dwAxes = CFArrayGetCount(axes); + device->generic.devcaps.dwButtons = CFArrayGetCount(buttons); + device->generic.devcaps.dwPOVs = CFArrayGetCount(povs); + + TRACE("axes %u povs %u buttons %u\n", device->generic.devcaps.dwAxes, device->generic.devcaps.dwPOVs, + device->generic.devcaps.dwButtons); + + /* build our element array in the order that dinput expects */ + CFArrayAppendArray(axes, povs, CFRangeMake(0, device->generic.devcaps.dwPOVs)); + CFArrayAppendArray(axes, buttons, CFRangeMake(0, device->generic.devcaps.dwButtons)); + device->elements = axes; + axes = NULL; + + CFRelease(povs); + CFRelease(buttons); + CFRelease(elements); } - - device->generic.devcaps.dwAxes = axes; - device->generic.devcaps.dwButtons = buttons; - device->generic.devcaps.dwPOVs = povs; - - /* Sort buttons into correct order */ - for (buttons = 0; buttons < device->generic.devcaps.dwButtons; buttons++) + else { - IOHIDElementRef tIOHIDElementRef = ( IOHIDElementRef ) CFArrayGetValueAtIndex( device->elementCFArrayRef, axes+povs+buttons); - uint32_t usage = IOHIDElementGetUsage( tIOHIDElementRef ); - usage --; /* usage is 1 indexed we need 0 indexed */ - if (usage == buttons) - continue; - - insert_sort_button(axes+povs, tIOHIDElementRef, device->elementCFArrayRef,buttons,usage); + device->generic.devcaps.dwAxes = 0; + device->generic.devcaps.dwButtons = 0; + device->generic.devcaps.dwPOVs = 0; } } static void get_osx_device_elements_props(JoystickImpl *device) { - CFArrayRef gElementCFArrayRef = device->elementCFArrayRef; + TRACE("device %p\n", device); - if (gElementCFArrayRef) + if (device->elements) { - CFIndex idx, cnt = CFArrayGetCount( gElementCFArrayRef ); + CFIndex idx, cnt = CFArrayGetCount( device->elements ); for ( idx = 0; idx < cnt; idx++ ) { - IOHIDElementRef tIOHIDElementRef = ( IOHIDElementRef ) CFArrayGetValueAtIndex( gElementCFArrayRef, idx ); + IOHIDElementRef element = ( IOHIDElementRef ) CFArrayGetValueAtIndex( device->elements, idx ); - device->generic.props[idx].lDevMin = IOHIDElementGetLogicalMin(tIOHIDElementRef); - device->generic.props[idx].lDevMax = IOHIDElementGetLogicalMax(tIOHIDElementRef); + TRACE("element %s\n", debugstr_element(element)); + + device->generic.props[idx].lDevMin = IOHIDElementGetLogicalMin(element); + device->generic.props[idx].lDevMax = IOHIDElementGetLogicalMax(element); device->generic.props[idx].lMin = 0; device->generic.props[idx].lMax = 0xffff; device->generic.props[idx].lDeadZone = 0; @@ -596,46 +677,49 @@ static void get_osx_device_elements_props(JoystickImpl *device) static void poll_osx_device_state(LPDIRECTINPUTDEVICE8A iface) { JoystickImpl *device = impl_from_IDirectInputDevice8A(iface); - IOHIDElementRef tIOHIDTopElementRef; - IOHIDDeviceRef tIOHIDDeviceRef; - CFArrayRef gElementCFArrayRef = device->elementCFArrayRef; + IOHIDElementRef device_main_element; + IOHIDDeviceRef hid_device; - TRACE("polling device %i\n",device->id); + TRACE("device %p device->id %i\n", device, device->id); - if (!gCollections) + if (!device_main_elements || device->id >= CFArrayGetCount(device_main_elements)) return; - tIOHIDTopElementRef = (IOHIDElementRef) CFArrayGetValueAtIndex(gCollections, device->id); - tIOHIDDeviceRef = IOHIDElementGetDevice(tIOHIDTopElementRef); - - if (!tIOHIDDeviceRef) + device_main_element = (IOHIDElementRef) CFArrayGetValueAtIndex(device_main_elements, device->id); + hid_device = IOHIDElementGetDevice(device_main_element); + TRACE("main element %s hid_device %s\n", debugstr_element(device_main_element), debugstr_device(hid_device)); + if (!hid_device) return; - if (gElementCFArrayRef) + if (device->elements) { int button_idx = 0; int pov_idx = 0; int slider_idx = 0; int inst_id; - CFIndex idx, cnt = CFArrayGetCount( gElementCFArrayRef ); + CFIndex idx, cnt = CFArrayGetCount( device->elements ); for ( idx = 0; idx < cnt; idx++ ) { IOHIDValueRef valueRef; int val, oldVal, newVal; - IOHIDElementRef tIOHIDElementRef = ( IOHIDElementRef ) CFArrayGetValueAtIndex( gElementCFArrayRef, idx ); - int eleType = IOHIDElementGetType( tIOHIDElementRef ); + IOHIDElementRef element = ( IOHIDElementRef ) CFArrayGetValueAtIndex( device->elements, idx ); + int type = IOHIDElementGetType( element ); - switch(eleType) + TRACE("element %s\n", debugstr_element(element)); + + switch(type) { case kIOHIDElementTypeInput_Button: + TRACE("kIOHIDElementTypeInput_Button\n"); if(button_idx < 128) { - IOHIDDeviceGetValue(tIOHIDDeviceRef, tIOHIDElementRef, &valueRef); + IOHIDDeviceGetValue(hid_device, element, &valueRef); val = IOHIDValueGetIntegerValue(valueRef); newVal = val ? 0x80 : 0x0; oldVal = device->generic.js.rgbButtons[button_idx]; device->generic.js.rgbButtons[button_idx] = newVal; + TRACE("valueRef %s val %d oldVal %d newVal %d\n", debugstr_cf(valueRef), val, oldVal, newVal); if (oldVal != newVal) { inst_id = DIDFT_MAKEINSTANCE(button_idx) | DIDFT_PSHBUTTON; @@ -646,12 +730,13 @@ static void poll_osx_device_state(LPDIRECTINPUTDEVICE8A iface) break; case kIOHIDElementTypeInput_Misc: { - uint32_t usage = IOHIDElementGetUsage( tIOHIDElementRef ); + uint32_t usage = IOHIDElementGetUsage( element ); switch(usage) { case kHIDUsage_GD_Hatswitch: { - IOHIDDeviceGetValue(tIOHIDDeviceRef, tIOHIDElementRef, &valueRef); + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Hatswitch\n"); + IOHIDDeviceGetValue(hid_device, element, &valueRef); val = IOHIDValueGetIntegerValue(valueRef); oldVal = device->generic.js.rgdwPOV[pov_idx]; if (val >= 8) @@ -659,6 +744,7 @@ static void poll_osx_device_state(LPDIRECTINPUTDEVICE8A iface) else newVal = val * 4500; device->generic.js.rgdwPOV[pov_idx] = newVal; + TRACE("valueRef %s val %d oldVal %d newVal %d\n", debugstr_cf(valueRef), val, oldVal, newVal); if (oldVal != newVal) { inst_id = DIDFT_MAKEINSTANCE(pov_idx) | DIDFT_POV; @@ -677,48 +763,56 @@ static void poll_osx_device_state(LPDIRECTINPUTDEVICE8A iface) { int wine_obj = -1; - IOHIDDeviceGetValue(tIOHIDDeviceRef, tIOHIDElementRef, &valueRef); + IOHIDDeviceGetValue(hid_device, element, &valueRef); val = IOHIDValueGetIntegerValue(valueRef); newVal = joystick_map_axis(&device->generic.props[idx], val); switch (usage) { case kHIDUsage_GD_X: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_X\n"); wine_obj = 0; oldVal = device->generic.js.lX; device->generic.js.lX = newVal; break; case kHIDUsage_GD_Y: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Y\n"); wine_obj = 1; oldVal = device->generic.js.lY; device->generic.js.lY = newVal; break; case kHIDUsage_GD_Z: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Z\n"); wine_obj = 2; oldVal = device->generic.js.lZ; device->generic.js.lZ = newVal; break; case kHIDUsage_GD_Rx: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Rx\n"); wine_obj = 3; oldVal = device->generic.js.lRx; device->generic.js.lRx = newVal; break; case kHIDUsage_GD_Ry: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Ry\n"); wine_obj = 4; oldVal = device->generic.js.lRy; device->generic.js.lRy = newVal; break; case kHIDUsage_GD_Rz: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Rz\n"); wine_obj = 5; oldVal = device->generic.js.lRz; device->generic.js.lRz = newVal; break; case kHIDUsage_GD_Slider: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Slider\n"); wine_obj = 6 + slider_idx; oldVal = device->generic.js.rglSlider[slider_idx]; device->generic.js.rglSlider[slider_idx] = newVal; slider_idx ++; break; } + TRACE("valueRef %s val %d oldVal %d newVal %d\n", debugstr_cf(valueRef), val, oldVal, newVal); if ((wine_obj != -1) && (oldVal != newVal)) { @@ -729,12 +823,12 @@ static void poll_osx_device_state(LPDIRECTINPUTDEVICE8A iface) break; } default: - FIXME("unhandled usage %i\n",usage); + FIXME("kIOHIDElementTypeInput_Misc / unhandled usage %i\n", usage); } break; } default: - FIXME("Unhandled type %i\n",eleType); + FIXME("Unhandled type %i\n",type); } } } @@ -753,6 +847,8 @@ static INT find_joystick_devices(void) static HRESULT joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id) { + TRACE("dwDevType %u dwFlags 0x%08x version 0x%04x id %d\n", dwDevType, dwFlags, version, id); + if (id >= find_joystick_devices()) return E_FAIL; if ((dwDevType == 0) || @@ -792,6 +888,8 @@ static HRESULT joydev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINS char name[MAX_PATH]; char friendly[32]; + TRACE("dwDevType %u dwFlags 0x%08x version 0x%04x id %d\n", dwDevType, dwFlags, version, id); + if (id >= find_joystick_devices()) return E_FAIL; if ((dwDevType == 0) || @@ -841,13 +939,13 @@ static const char *osx_ff_axis_name(UInt8 axis) return ret; } -static int osx_axis_has_ff(FFCAPABILITIES *ffcaps, UInt8 axis) +static BOOL osx_axis_has_ff(FFCAPABILITIES *ffcaps, UInt8 axis) { int i; for(i = 0; i < ffcaps->numFfAxes; ++i) if(ffcaps->ffAxes[i] == axis) - return 1; - return 0; + return TRUE; + return FALSE; } static HRESULT alloc_device(REFGUID rguid, IDirectInputImpl *dinput, @@ -948,7 +1046,8 @@ static HRESULT alloc_device(REFGUID rguid, IDirectInputImpl *dinput, for (i = 0; i < newDevice->generic.devcaps.dwAxes; i++) { - int wine_obj = -1, has_ff = 0; + int wine_obj = -1; + BOOL has_ff = FALSE; switch (axis_map[i]) { case kHIDUsage_GD_X: @@ -1026,6 +1125,7 @@ static HRESULT alloc_device(REFGUID rguid, IDirectInputImpl *dinput, newDevice->generic.devcaps.dwFFDriverVersion = 0; if (TRACE_ON(dinput)) { + TRACE("allocated device %p\n", newDevice); _dump_DIDATAFORMAT(newDevice->generic.base.data_format.wine_df); _dump_DIDEVCAPS(&newDevice->generic.devcaps); } @@ -1036,6 +1136,8 @@ static HRESULT alloc_device(REFGUID rguid, IDirectInputImpl *dinput, FAILED: hr = DIERR_OUTOFMEMORY; + if (newDevice->ff) FFReleaseDevice(newDevice->ff); + if (newDevice->elements) CFRelease(newDevice->elements); if (df) HeapFree(GetProcessHeap(), 0, df->rgodf); HeapFree(GetProcessHeap(), 0, df); release_DataFormat(&newDevice->generic.base.data_format); diff --git a/reactos/dll/directx/wine/dinput/keyboard.c b/reactos/dll/directx/wine/dinput/keyboard.c index 21415f505be..28e7bd23ce8 100644 --- a/reactos/dll/directx/wine/dinput/keyboard.c +++ b/reactos/dll/directx/wine/dinput/keyboard.c @@ -110,7 +110,7 @@ static int KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM EnterCriticalSection(&This->base.crit); queue_event(iface, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON, - new_diks, hook->time, This->base.dinput->evsequence++); + new_diks, GetCurrentTime(), This->base.dinput->evsequence++); LeaveCriticalSection(&This->base.crit); return ret; diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 3184ddebe2b..efcc136056b 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -35,7 +35,7 @@ reactos/dll/directx/wine/d3dx9_24 => 43 # Synced to Wine-1.7.17 reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.17 reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.17 reactos/dll/directx/wine/devenum # Synced to Wine-1.7.17 -reactos/dll/directx/wine/dinput # Synced to Wine-1.7.1 +reactos/dll/directx/wine/dinput # Synced to Wine-1.7.17 reactos/dll/directx/wine/dinput8 # Synced to Wine-1.7.1 reactos/dll/directx/wine/dmusic # Synced to Wine-1.7.1 reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1 From d9b7959228a21ac63c485da68972078a2debbd4e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 23:44:04 +0000 Subject: [PATCH 397/419] [DINPUT_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62825 --- rostests/winetests/dinput/device.c | 26 ++++++++--------- rostests/winetests/dinput/joystick.c | 43 ++++++++++++---------------- rostests/winetests/dinput/keyboard.c | 32 ++++++++++----------- rostests/winetests/dinput/mouse.c | 28 +++++++++--------- 4 files changed, 62 insertions(+), 67 deletions(-) diff --git a/rostests/winetests/dinput/device.c b/rostests/winetests/dinput/device.c index 76960087b46..20d211d4e66 100644 --- a/rostests/winetests/dinput/device.c +++ b/rostests/winetests/dinput/device.c @@ -59,7 +59,7 @@ static const DIDATAFORMAT data_format = { (LPDIOBJECTDATAFORMAT)obj_data_format }; -static BOOL CALLBACK enum_callback(LPCDIDEVICEOBJECTINSTANCE oi, LPVOID info) +static BOOL CALLBACK enum_callback(const DIDEVICEOBJECTINSTANCEA *oi, void *info) { if (winetest_debug > 1) trace(" Type:%4x Ofs:%3d Flags:%08x Name:%s\n", @@ -68,18 +68,18 @@ static BOOL CALLBACK enum_callback(LPCDIDEVICEOBJECTINSTANCE oi, LPVOID info) return DIENUM_CONTINUE; } -static BOOL CALLBACK enum_type_callback(LPCDIDEVICEOBJECTINSTANCE oi, LPVOID info) +static BOOL CALLBACK enum_type_callback(const DIDEVICEOBJECTINSTANCEA *oi, void *info) { DWORD expected = *(DWORD*)info; ok (expected & DIDFT_GETTYPE(oi->dwType), "EnumObjects() enumerated wrong type for obj %s, expected: %08x got: %08x\n", oi->tszName, expected, oi->dwType); return DIENUM_CONTINUE; } -static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd) +static void test_object_info(IDirectInputDeviceA *device, HWND hwnd) { HRESULT hr; DIPROPDWORD dp; - DIDEVICEOBJECTINSTANCE obj_info; + DIDEVICEOBJECTINSTANCEA obj_info; DWORD obj_types[] = {DIDFT_BUTTON, DIDFT_AXIS, DIDFT_POV}; int type_index; int cnt1 = 0; @@ -174,14 +174,14 @@ static void test_object_info(LPDIRECTINPUTDEVICE device, HWND hwnd) struct enum_data { - LPDIRECTINPUT pDI; + IDirectInputA *pDI; HWND hwnd; }; -static BOOL CALLBACK enum_devices(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) +static BOOL CALLBACK enum_devices(const DIDEVICEINSTANCEA *lpddi, void *pvRef) { struct enum_data *data = pvRef; - LPDIRECTINPUTDEVICE device, obj = NULL; + IDirectInputDeviceA *device, *obj = NULL; HRESULT hr; hr = IDirectInput_GetDeviceStatus(data->pDI, &lpddi->guidInstance); @@ -212,8 +212,8 @@ static BOOL CALLBACK enum_devices(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef) static void device_tests(void) { HRESULT hr; - LPDIRECTINPUT pDI = NULL, obj = NULL; - HINSTANCE hInstance = GetModuleHandle(NULL); + IDirectInputA *pDI = NULL, *obj = NULL; + HINSTANCE hInstance = GetModuleHandleW(NULL); HWND hwnd; struct enum_data data; @@ -223,7 +223,7 @@ static void device_tests(void) skip("Tests require a newer dinput version\n"); return; } - ok(SUCCEEDED(hr), "DirectInputCreate() failed: %08x\n", hr); + ok(SUCCEEDED(hr), "DirectInputCreateA() failed: %08x\n", hr); if (FAILED(hr)) return; hr = IDirectInput_Initialize(pDI, hInstance, DIRECTINPUT_VERSION); @@ -233,8 +233,8 @@ static void device_tests(void) hr = IUnknown_QueryInterface(pDI, &IID_IDirectInput2W, (LPVOID*)&obj); ok(SUCCEEDED(hr), "QueryInterface(IDirectInput7W) failed: %08x\n", hr); - hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW, - 10, 10, 200, 200, NULL, NULL, NULL, NULL); + hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW, 10, 10, 200, 200, NULL, NULL, + NULL, NULL); ok(hwnd != NULL, "err: %d\n", GetLastError()); if (hwnd) { @@ -250,7 +250,7 @@ static void device_tests(void) hr = IDirectInput_GetDeviceStatus(pDI, &GUID_Joystick); if (hr == DI_OK) { - LPDIRECTINPUTDEVICE device = NULL; + IDirectInputDeviceA *device = NULL; hr = IDirectInput_CreateDevice(pDI, &GUID_Joystick, &device, NULL); ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n", hr); diff --git a/rostests/winetests/dinput/joystick.c b/rostests/winetests/dinput/joystick.c index b961de0043d..eb60f6484f8 100644 --- a/rostests/winetests/dinput/joystick.c +++ b/rostests/winetests/dinput/joystick.c @@ -38,7 +38,7 @@ #define numObjects(x) (sizeof(x) / sizeof(x[0])) typedef struct tagUserData { - LPDIRECTINPUT pDI; + IDirectInputA *pDI; DWORD version; } UserData; @@ -81,7 +81,7 @@ static HWND get_hwnd(void) typedef struct tagJoystickInfo { - LPDIRECTINPUTDEVICE pJoystick; + IDirectInputDeviceA *pJoystick; DWORD axis; DWORD pov; DWORD button; @@ -95,9 +95,7 @@ static int get_refcount(IUnknown *object) return IUnknown_Release( object ); } -static BOOL CALLBACK EnumAxes( - const DIDEVICEOBJECTINSTANCE* pdidoi, - VOID* pContext) +static BOOL CALLBACK EnumAxes(const DIDEVICEOBJECTINSTANCEA *pdidoi, void *pContext) { HRESULT hr; JoystickInfo * info = pContext; @@ -170,21 +168,19 @@ static const HRESULT SetCoop_real_window[16] = { E_INVALIDARG, S_OK, S_OK, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG}; -static BOOL CALLBACK EnumJoysticks( - LPCDIDEVICEINSTANCE lpddi, - LPVOID pvRef) +static BOOL CALLBACK EnumJoysticks(const DIDEVICEINSTANCEA *lpddi, void *pvRef) { HRESULT hr; UserData * data = pvRef; - LPDIRECTINPUTDEVICE pJoystick; + IDirectInputDeviceA *pJoystick; DIDATAFORMAT format; DIDEVCAPS caps; DIJOYSTATE2 js; JoystickInfo info; int i, count; ULONG ref; - DIDEVICEINSTANCE inst; - DIDEVICEINSTANCE_DX3 inst3; + DIDEVICEINSTANCEA inst; + DIDEVICEINSTANCE_DX3A inst3; DIPROPDWORD dipw; DIPROPSTRING dps; DIPROPGUIDANDPATH dpg; @@ -340,7 +336,7 @@ static BOOL CALLBACK EnumJoysticks( ok(hr==DI_OK,"IDirectInputDevice_GetDeviceInfo() failed: %08x\n", hr); inst3.dwSize = sizeof(inst3); - hr = IDirectInputDevice_GetDeviceInfo(pJoystick, (LPDIDEVICEINSTANCE)&inst3); + hr = IDirectInputDevice_GetDeviceInfo(pJoystick, (DIDEVICEINSTANCEA*)&inst3); ok(hr==DI_OK,"IDirectInputDevice_GetDeviceInfo() failed: %08x\n", hr); hr = IDirectInputDevice_Unacquire(pJoystick); @@ -370,7 +366,7 @@ static BOOL CALLBACK EnumJoysticks( LPDIRECTINPUTEFFECT effect = NULL; LONG cnt1, cnt2; HWND real_hWnd; - HINSTANCE hInstance = GetModuleHandle(NULL); + HINSTANCE hInstance = GetModuleHandleW(NULL); DIPROPDWORD dip_gain_set, dip_gain_get; trace("Testing force-feedback\n"); @@ -393,9 +389,9 @@ static BOOL CALLBACK EnumJoysticks( * IDirectInputDevice_SetCooperativeLevel * - a visible window */ - real_hWnd = CreateWindowEx(0, "EDIT", "Test text", 0, 10, 10, 300, - 300, NULL, NULL, hInstance, NULL); - ok(real_hWnd!=0,"CreateWindowEx failed: %p\n", real_hWnd); + real_hWnd = CreateWindowExA(0, "EDIT", "Test text", 0, 10, 10, 300, 300, NULL, NULL, + hInstance, NULL); + ok(real_hWnd!=0,"CreateWindowExA failed: %p\n", real_hWnd); ShowWindow(real_hWnd, SW_SHOW); hr = IDirectInputDevice_Unacquire(pJoystick); ok(hr==DI_OK,"IDirectInputDevice_Unacquire() failed: %08x\n", hr); @@ -407,7 +403,7 @@ static BOOL CALLBACK EnumJoysticks( cnt1 = get_refcount((IUnknown*)pJoystick); - hr = IDirectInputDevice2_CreateEffect((LPDIRECTINPUTDEVICE2)pJoystick, &GUID_ConstantForce, + hr = IDirectInputDevice2_CreateEffect((IDirectInputDevice2A*)pJoystick, &GUID_ConstantForce, &eff, &effect, NULL); ok(hr == DI_OK, "IDirectInputDevice_CreateEffect() failed: %08x\n", hr); cnt2 = get_refcount((IUnknown*)pJoystick); @@ -559,7 +555,7 @@ static BOOL CALLBACK EnumJoysticks( ok(hr==DI_OK, "IDirectInputDevice_SetProperty() failed: %08x\n", hr); hr = IDirectInputDevice_GetProperty(pJoystick, DIPROP_FFGAIN, &dip_gain_get.diph); ok(hr==DI_OK, "IDirectInputDevice_GetProperty() failed: %08x\n", hr); - ok(dip_gain_get.dwData==dip_gain_set.dwData, "Gain not udated: %i\n", dip_gain_get.dwData); + ok(dip_gain_get.dwData==dip_gain_set.dwData, "Gain not updated: %i\n", dip_gain_get.dwData); hr = IDirectInputDevice_Acquire(pJoystick); ok(hr==DI_OK,"IDirectInputDevice_Acquire() failed: %08x\n", hr); dip_gain_set.dwData = 2; @@ -567,7 +563,7 @@ static BOOL CALLBACK EnumJoysticks( ok(hr==DI_OK, "IDirectInputDevice_SetProperty() failed: %08x\n", hr); hr = IDirectInputDevice_GetProperty(pJoystick, DIPROP_FFGAIN, &dip_gain_get.diph); ok(hr==DI_OK, "IDirectInputDevice_GetProperty() failed: %08x\n", hr); - ok(dip_gain_get.dwData==dip_gain_set.dwData, "Gain not udated: %i\n", dip_gain_get.dwData); + ok(dip_gain_get.dwData==dip_gain_set.dwData, "Gain not updated: %i\n", dip_gain_get.dwData); /* Test range and internal clamping. */ dip_gain_set.dwData = -1; hr = IDirectInputDevice_SetProperty(pJoystick, DIPROP_FFGAIN, &dip_gain_set.diph); @@ -656,14 +652,13 @@ DONE: static void joystick_tests(DWORD version) { HRESULT hr; - LPDIRECTINPUT pDI; + IDirectInputA *pDI; ULONG ref; - HINSTANCE hInstance = GetModuleHandle(NULL); + HINSTANCE hInstance = GetModuleHandleW(NULL); trace("-- Testing Direct Input Version 0x%04x --\n", version); - hr = DirectInputCreate(hInstance, version, &pDI, NULL); - ok(hr==DI_OK||hr==DIERR_OLDDIRECTINPUTVERSION, - "DirectInputCreate() failed: %08x\n", hr); + hr = DirectInputCreateA(hInstance, version, &pDI, NULL); + ok(hr==DI_OK||hr==DIERR_OLDDIRECTINPUTVERSION, "DirectInputCreateA() failed: %08x\n", hr); if (hr==DI_OK && pDI!=0) { UserData data; data.pDI = pDI; diff --git a/rostests/winetests/dinput/keyboard.c b/rostests/winetests/dinput/keyboard.c index 650961e2522..5a9ac5100b0 100644 --- a/rostests/winetests/dinput/keyboard.c +++ b/rostests/winetests/dinput/keyboard.c @@ -34,10 +34,10 @@ //#include "wingdi.h" #include -static void acquire_tests(LPDIRECTINPUT pDI, HWND hwnd) +static void acquire_tests(IDirectInputA *pDI, HWND hwnd) { HRESULT hr; - LPDIRECTINPUTDEVICE pKeyboard; + IDirectInputDeviceA *pKeyboard; BYTE kbd_state[256]; LONG custom_state[6]; int i; @@ -116,10 +116,10 @@ static const HRESULT SetCoop_child_window[16] = { E_INVALIDARG, E_HANDLE, E_HANDLE, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG}; -static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd) +static void test_set_coop(IDirectInputA *pDI, HWND hwnd) { HRESULT hr; - LPDIRECTINPUTDEVICE pKeyboard = NULL; + IDirectInputDeviceA *pKeyboard = NULL; int i; HWND child; @@ -138,8 +138,8 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd) ok(hr == SetCoop_real_window[i], "SetCooperativeLevel(hwnd, %d): %08x\n", i, hr); } - child = CreateWindow("static", "Title", WS_CHILD | WS_VISIBLE, - 10, 10, 50, 50, hwnd, NULL, NULL, NULL); + child = CreateWindowA("static", "Title", WS_CHILD | WS_VISIBLE, 10, 10, 50, 50, hwnd, NULL, + NULL, NULL); ok(child != NULL, "err: %d\n", GetLastError()); for (i=0; i<16; i++) @@ -152,10 +152,10 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd) if (pKeyboard) IUnknown_Release(pKeyboard); } -static void test_get_prop(LPDIRECTINPUT pDI, HWND hwnd) +static void test_get_prop(IDirectInputA *pDI, HWND hwnd) { HRESULT hr; - LPDIRECTINPUTDEVICE pKeyboard = NULL; + IDirectInputDeviceA *pKeyboard = NULL; DIPROPRANGE diprg; hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL); @@ -174,10 +174,10 @@ static void test_get_prop(LPDIRECTINPUT pDI, HWND hwnd) if (pKeyboard) IUnknown_Release(pKeyboard); } -static void test_capabilities(LPDIRECTINPUT pDI, HWND hwnd) +static void test_capabilities(IDirectInputA *pDI, HWND hwnd) { HRESULT hr; - LPDIRECTINPUTDEVICE pKeyboard = NULL; + IDirectInputDeviceA *pKeyboard = NULL; DIDEVCAPS caps; hr = IDirectInput_CreateDevice(pDI, &GUID_SysKeyboard, &pKeyboard, NULL); @@ -200,22 +200,22 @@ static void test_capabilities(LPDIRECTINPUT pDI, HWND hwnd) static void keyboard_tests(DWORD version) { HRESULT hr; - LPDIRECTINPUT pDI = NULL; - HINSTANCE hInstance = GetModuleHandle(NULL); + IDirectInputA *pDI = NULL; + HINSTANCE hInstance = GetModuleHandleW(NULL); HWND hwnd; ULONG ref = 0; - hr = DirectInputCreate(hInstance, version, &pDI, NULL); + hr = DirectInputCreateA(hInstance, version, &pDI, NULL); if (hr == DIERR_OLDDIRECTINPUTVERSION) { skip("Tests require a newer dinput version\n"); return; } - ok(SUCCEEDED(hr), "DirectInputCreate() failed: %08x\n", hr); + ok(SUCCEEDED(hr), "DirectInputCreateA() failed: %08x\n", hr); if (FAILED(hr)) return; - hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW | WS_VISIBLE, - 10, 10, 200, 200, NULL, NULL, NULL, NULL); + hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 10, 10, 200, 200, + NULL, NULL, NULL, NULL); ok(hwnd != NULL, "err: %d\n", GetLastError()); if (hwnd) diff --git a/rostests/winetests/dinput/mouse.c b/rostests/winetests/dinput/mouse.c index bd848566e77..fa47786c059 100644 --- a/rostests/winetests/dinput/mouse.c +++ b/rostests/winetests/dinput/mouse.c @@ -52,10 +52,10 @@ static const HRESULT SetCoop_child_window[16] = { E_INVALIDARG, E_HANDLE, E_HANDLE, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG, E_INVALIDARG}; -static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd) +static void test_set_coop(IDirectInputA *pDI, HWND hwnd) { HRESULT hr; - LPDIRECTINPUTDEVICE pMouse = NULL; + IDirectInputDeviceA *pMouse = NULL; int i; HWND child; @@ -74,8 +74,8 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd) ok(hr == SetCoop_real_window[i], "SetCooperativeLevel(hwnd, %d): %08x\n", i, hr); } - child = CreateWindow("static", "Title", WS_CHILD | WS_VISIBLE, - 10, 10, 50, 50, hwnd, NULL, NULL, NULL); + child = CreateWindowA("static", "Title", WS_CHILD | WS_VISIBLE, 10, 10, 50, 50, hwnd, NULL, + NULL, NULL); ok(child != NULL, "err: %d\n", GetLastError()); for (i=0; i<16; i++) @@ -88,10 +88,10 @@ static void test_set_coop(LPDIRECTINPUT pDI, HWND hwnd) if (pMouse) IUnknown_Release(pMouse); } -static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd) +static void test_acquire(IDirectInputA *pDI, HWND hwnd) { HRESULT hr; - LPDIRECTINPUTDEVICE pMouse = NULL; + IDirectInputDeviceA *pMouse = NULL; DIMOUSESTATE m_state; HWND hwnd2; DIPROPDWORD di_op; @@ -132,8 +132,8 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd) /* Foreground coop level requires window to have focus */ /* Create a temporary window, this should make dinput * loose mouse input */ - hwnd2 = CreateWindow("static", "Temporary", WS_VISIBLE, - 10, 210, 200, 200, NULL, NULL, NULL, NULL); + hwnd2 = CreateWindowA("static", "Temporary", WS_VISIBLE, 10, 210, 200, 200, NULL, NULL, NULL, + NULL); hr = IDirectInputDevice_GetDeviceState(pMouse, sizeof(m_state), &m_state); ok(hr == DIERR_NOTACQUIRED, "GetDeviceState() should have failed: %08x\n", hr); @@ -185,22 +185,22 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd) static void mouse_tests(void) { HRESULT hr; - LPDIRECTINPUT pDI = NULL; - HINSTANCE hInstance = GetModuleHandle(NULL); + IDirectInputA *pDI = NULL; + HINSTANCE hInstance = GetModuleHandleW(NULL); HWND hwnd; ULONG ref = 0; - hr = DirectInputCreate(hInstance, DIRECTINPUT_VERSION, &pDI, NULL); + hr = DirectInputCreateA(hInstance, DIRECTINPUT_VERSION, &pDI, NULL); if (hr == DIERR_OLDDIRECTINPUTVERSION) { skip("Tests require a newer dinput version\n"); return; } - ok(SUCCEEDED(hr), "DirectInputCreate() failed: %08x\n", hr); + ok(SUCCEEDED(hr), "DirectInputCreateA() failed: %08x\n", hr); if (FAILED(hr)) return; - hwnd = CreateWindow("static", "Title", WS_OVERLAPPEDWINDOW, - 10, 10, 200, 200, NULL, NULL, NULL, NULL); + hwnd = CreateWindowA("static", "Title", WS_OVERLAPPEDWINDOW, 10, 10, 200, 200, NULL, NULL, + NULL, NULL); ok(hwnd != NULL, "err: %d\n", GetLastError()); if (hwnd) { From 70cf88624c188f60b5d5adc8b19a75ea7e7bc1f6 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 19 Apr 2014 23:50:01 +0000 Subject: [PATCH 398/419] [DINPUT8] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62826 --- reactos/dll/directx/wine/dinput8/dinput8.idl | 2 ++ reactos/dll/directx/wine/dinput8/dinput8_main.c | 2 +- reactos/media/doc/README.WINE | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/reactos/dll/directx/wine/dinput8/dinput8.idl b/reactos/dll/directx/wine/dinput8/dinput8.idl index 4e988f4ca9e..2f9d3e80e9b 100644 --- a/reactos/dll/directx/wine/dinput8/dinput8.idl +++ b/reactos/dll/directx/wine/dinput8/dinput8.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("DirectInput8 Object"), threading(both), diff --git a/reactos/dll/directx/wine/dinput8/dinput8_main.c b/reactos/dll/directx/wine/dinput8/dinput8_main.c index 121dbfbb1e8..eb545ed7a3f 100644 --- a/reactos/dll/directx/wine/dinput8/dinput8_main.c +++ b/reactos/dll/directx/wine/dinput8/dinput8_main.c @@ -61,7 +61,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create(HINSTANCE hinst, DWORD dwVer IDirectInputA *pDI; HRESULT hr, hrCo; - TRACE("hInst (%p), dwVersion: %d, riid (%s), punkOuter (%p))\n", hinst, dwVersion, debugstr_guid(riid), punkOuter); + TRACE("hInst (%p), dwVersion: %d, riid (%s), punkOuter (%p)\n", hinst, dwVersion, debugstr_guid(riid), punkOuter); if (!ppDI) return E_POINTER; diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index efcc136056b..ea7bcd632bf 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -36,7 +36,7 @@ reactos/dll/directx/wine/d3dxof # Synced to Wine-1.7.17 reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.17 reactos/dll/directx/wine/devenum # Synced to Wine-1.7.17 reactos/dll/directx/wine/dinput # Synced to Wine-1.7.17 -reactos/dll/directx/wine/dinput8 # Synced to Wine-1.7.1 +reactos/dll/directx/wine/dinput8 # Synced to Wine-1.7.17 reactos/dll/directx/wine/dmusic # Synced to Wine-1.7.1 reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1 reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.1 From 98bf344a4b38e9e8a8f09f1585c98d9c3215463e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 00:00:52 +0000 Subject: [PATCH 399/419] [DMUSIC] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62827 --- reactos/dll/directx/wine/dmusic/collection.c | 79 +-- reactos/dll/directx/wine/dmusic/dmusic.c | 2 + reactos/dll/directx/wine/dmusic/dmusic.idl | 2 + reactos/dll/directx/wine/dmusic/dmusic_main.c | 1 - reactos/dll/directx/wine/dmusic/port.c | 2 +- reactos/dll/directx/wine/dmusic/regsvr.c | 473 ------------------ reactos/media/doc/README.WINE | 2 +- 7 files changed, 48 insertions(+), 513 deletions(-) delete mode 100644 reactos/dll/directx/wine/dmusic/regsvr.c diff --git a/reactos/dll/directx/wine/dmusic/collection.c b/reactos/dll/directx/wine/dmusic/collection.c index 330f3d55e3b..797709372ef 100644 --- a/reactos/dll/directx/wine/dmusic/collection.c +++ b/reactos/dll/directx/wine/dmusic/collection.c @@ -49,31 +49,22 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_QueryInt TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_dmguid(riid), ret_iface); - if (IsEqualIID(riid, &IID_IUnknown) || - IsEqualIID(riid, &IID_IDirectMusicCollection)) - { - *ret_iface = iface; - IDirectMusicCollection_AddRef(iface); - return S_OK; - } - else if (IsEqualIID(riid, &IID_IDirectMusicObject)) - { - *ret_iface = &This->IDirectMusicObject_iface; - IDirectMusicCollection_AddRef(iface); - return S_OK; - } - else if (IsEqualIID(riid, &IID_IPersistStream)) - { - *ret_iface = &This->IPersistStream_iface; - IDirectMusicCollection_AddRef(iface); - return S_OK; - } - *ret_iface = NULL; - WARN("(%p/%p)->(%s, %p): not found\n", iface, This, debugstr_dmguid(riid), ret_iface); + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectMusicCollection)) + *ret_iface = iface; + else if (IsEqualIID(riid, &IID_IDirectMusicObject)) + *ret_iface = &This->IDirectMusicObject_iface; + else if (IsEqualIID(riid, &IID_IPersistStream)) + *ret_iface = &This->IPersistStream_iface; + else + { + WARN("(%p/%p)->(%s, %p): not found\n", iface, This, debugstr_dmguid(riid), ret_iface); + return E_NOINTERFACE; + } - return E_NOINTERFACE; + IUnknown_AddRef((IUnknown*)*ret_iface); + return S_OK; } static ULONG WINAPI IDirectMusicCollectionImpl_IDirectMusicCollection_AddRef(LPDIRECTMUSICCOLLECTION iface) @@ -191,7 +182,9 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_GetDescripto TRACE("(%p/%p)->(%p)\n", iface, This, pDesc); - /* I think we shouldn't return pointer here since then values can be changed; it'd be a mess */ + if (!pDesc) + return E_POINTER; + memcpy (pDesc, This->pDesc, This->pDesc->dwSize); return S_OK; @@ -199,7 +192,9 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_GetDescripto static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_SetDescriptor(LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { - IDirectMusicCollectionImpl *This = impl_from_IDirectMusicObject(iface); + IDirectMusicCollectionImpl *This = impl_from_IDirectMusicObject(iface); + HRESULT ret = S_OK; + TRACE("(%p, %p)\n", iface, pDesc); @@ -216,7 +211,10 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_SetDescripto if (pDesc->dwValidData & DMUS_OBJ_OBJECT) This->pDesc->guidObject = pDesc->guidObject; if (pDesc->dwValidData & DMUS_OBJ_CLASS) - This->pDesc->guidClass = pDesc->guidClass; + { + pDesc->dwValidData &= ~DMUS_OBJ_CLASS; + ret = S_FALSE; + } if (pDesc->dwValidData & DMUS_OBJ_NAME) lstrcpynW(This->pDesc->wszName, pDesc->wszName, DMUS_MAX_NAME); if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) @@ -239,7 +237,7 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_SetDescripto /* add new flags */ This->pDesc->dwValidData |= pDesc->dwValidData; - return S_OK; + return ret; } static HRESULT read_from_stream(IStream *stream, void *data, ULONG size) @@ -272,7 +270,7 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_ParseDescrip /* FIXME: should this be determined from stream? */ desc->dwValidData |= DMUS_OBJ_CLASS; - desc->guidClass = CLSID_DirectMusicCollection; + desc->guidClass = This->pDesc->guidClass; hr = read_from_stream(stream, &chunk, sizeof(FOURCC) + sizeof(DWORD)); if (FAILED(hr)) @@ -292,7 +290,7 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_ParseDescrip TRACE_(dmfile)(": RIFF chunk of type %s", debugstr_fourcc(chunk.fccID)); StreamSize = chunk.dwSize - sizeof(FOURCC); - if (chunk.fccID != mmioFOURCC('D','L','S',' ')) { + if (chunk.fccID != FOURCC_DLS) { TRACE_(dmfile)(": unexpected chunk; loading failed)\n"); liMove.QuadPart = StreamSize; IStream_Seek(stream, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */ @@ -342,7 +340,7 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IDirectMusicObject_ParseDescrip ListCount[0] = 0; switch (chunk.fccID) { /* pure INFO list, such can be found in dls collections */ - case mmioFOURCC('I','N','F','O'): + case DMUS_FOURCC_INFO_LIST: TRACE_(dmfile)(": INFO list\n"); do { hr = read_from_stream(stream, &chunk, sizeof(FOURCC) + sizeof(DWORD)); @@ -561,7 +559,7 @@ static HRESULT WINAPI IDirectMusicCollectionImpl_IPersistStream_Load(LPPERSISTST ListSize[0] = chunk.dwSize - sizeof(FOURCC); ListCount[0] = 0; switch (chunk.fccID) { - case mmioFOURCC('I','N','F','O'): { + case DMUS_FOURCC_INFO_LIST: { TRACE_(dmfile)(": INFO list\n"); do { IStream_Read(stream, &chunk, sizeof(FOURCC) + sizeof(DWORD), NULL); @@ -815,12 +813,16 @@ static const IPersistStreamVtbl DirectMusicCollection_PersistStream_Vtbl = { HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl(LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) { IDirectMusicCollectionImpl* obj; - + HRESULT hr; + + *ppobj = NULL; + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicCollectionImpl)); - if (NULL == obj) { - *ppobj = NULL; - return E_OUTOFMEMORY; - } + if (!obj) + return E_OUTOFMEMORY; + obj->IDirectMusicCollection_iface.lpVtbl = &DirectMusicCollection_Collection_Vtbl; obj->IDirectMusicObject_iface.lpVtbl = &DirectMusicCollection_Object_Vtbl; obj->IPersistStream_iface.lpVtbl = &DirectMusicCollection_PersistStream_Vtbl; @@ -828,8 +830,11 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicCollectionImpl(LPCGUID lpcGUID, LPVOID* p DM_STRUCT_INIT(obj->pDesc); obj->pDesc->dwValidData |= DMUS_OBJ_CLASS; obj->pDesc->guidClass = CLSID_DirectMusicCollection; - obj->ref = 0; /* will be inited by QueryInterface */ + obj->ref = 1; list_init (&obj->Instruments); - return IDirectMusicCollection_QueryInterface(&obj->IDirectMusicCollection_iface, lpcGUID, ppobj); + hr = IDirectMusicCollection_QueryInterface(&obj->IDirectMusicCollection_iface, lpcGUID, ppobj); + IDirectMusicCollection_Release(&obj->IDirectMusicCollection_iface); + + return hr; } diff --git a/reactos/dll/directx/wine/dmusic/dmusic.c b/reactos/dll/directx/wine/dmusic/dmusic.c index 6991c20d49a..fb73112162c 100644 --- a/reactos/dll/directx/wine/dmusic/dmusic.c +++ b/reactos/dll/directx/wine/dmusic/dmusic.c @@ -406,6 +406,8 @@ HRESULT WINAPI DMUSIC_CreateDirectMusicImpl(LPCGUID riid, LPVOID* ret_iface, LPU TRACE("(%p,%p,%p)\n", riid, ret_iface, unkouter); *ret_iface = NULL; + if (unkouter) + return CLASS_E_NOAGGREGATION; dmusic = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusic8Impl)); if (!dmusic) diff --git a/reactos/dll/directx/wine/dmusic/dmusic.idl b/reactos/dll/directx/wine/dmusic/dmusic.idl index efa0b9652b1..99b54c5229d 100644 --- a/reactos/dll/directx/wine/dmusic/dmusic.idl +++ b/reactos/dll/directx/wine/dmusic/dmusic.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ threading(both), progid("Microsoft.DirectMusic.1"), diff --git a/reactos/dll/directx/wine/dmusic/dmusic_main.c b/reactos/dll/directx/wine/dmusic/dmusic_main.c index 655713cf3a5..3aae6168dd0 100644 --- a/reactos/dll/directx/wine/dmusic/dmusic_main.c +++ b/reactos/dll/directx/wine/dmusic/dmusic_main.c @@ -221,7 +221,6 @@ const char *debugstr_dmguid (const GUID *id) { /* CLSIDs */ GE(CLSID_AudioVBScript), GE(CLSID_DirectMusic), - GE(CLSID_DirectMusicAudioPath), GE(CLSID_DirectMusicAudioPathConfig), GE(CLSID_DirectMusicAuditionTrack), GE(CLSID_DirectMusicBand), diff --git a/reactos/dll/directx/wine/dmusic/port.c b/reactos/dll/directx/wine/dmusic/port.c index 18a9d52d7f4..a7824c3710d 100644 --- a/reactos/dll/directx/wine/dmusic/port.c +++ b/reactos/dll/directx/wine/dmusic/port.c @@ -685,7 +685,7 @@ HRESULT DMUSIC_CreateSynthPortImpl(LPCGUID guid, LPVOID *object, LPUNKNOWN unkou HRESULT hr = E_FAIL; int i; - TRACE("(%p,%p,%p,%p,%p%d)\n", guid, object, unkouter, port_params, port_caps, device); + TRACE("(%p,%p,%p,%p,%p,%d)\n", guid, object, unkouter, port_params, port_caps, device); *object = NULL; diff --git a/reactos/dll/directx/wine/dmusic/regsvr.c b/reactos/dll/directx/wine/dmusic/regsvr.c deleted file mode 100644 index dc82e86e67f..00000000000 --- a/reactos/dll/directx/wine/dmusic/regsvr.c +++ /dev/null @@ -1,473 +0,0 @@ -/* - * self-registerable dll functions for dmusic.dll - * - * Copyright (C) 2003 John K. Hohm - * - * 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 "dmusic_private.h" - -/* - * Near the bottom of this file are the exported DllRegisterServer and - * DllUnregisterServer, which make all this worthwhile. - */ - -/*********************************************************************** - * interface for self-registering - */ -struct regsvr_interface { - IID const *iid; /* NULL for end of list */ - LPCSTR name; /* can be NULL to omit */ - IID const *base_iid; /* can be NULL to omit */ - int num_methods; /* can be <0 to omit */ - CLSID const *ps_clsid; /* can be NULL to omit */ - CLSID const *ps_clsid32; /* can be NULL to omit */ -}; - -static HRESULT register_interfaces(struct regsvr_interface const *list); -static HRESULT unregister_interfaces(struct regsvr_interface const *list); - -struct regsvr_coclass { - CLSID const *clsid; /* NULL for end of list */ - LPCSTR name; /* can be NULL to omit */ - LPCSTR ips; /* can be NULL to omit */ - LPCSTR ips32; /* can be NULL to omit */ - LPCSTR ips32_tmodel; /* can be NULL to omit */ - LPCSTR progid; /* can be NULL to omit */ - LPCSTR viprogid; /* can be NULL to omit */ - LPCSTR progid_extra; /* can be NULL to omit */ -}; - -static HRESULT register_coclasses(struct regsvr_coclass const *list); -static HRESULT unregister_coclasses(struct regsvr_coclass const *list); - -/*********************************************************************** - * static string constants - */ -static WCHAR const interface_keyname[10] = { - 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', 'e', 0 }; -static WCHAR const base_ifa_keyname[14] = { - 'B', 'a', 's', 'e', 'I', 'n', 't', 'e', 'r', 'f', 'a', 'c', - 'e', 0 }; -static WCHAR const num_methods_keyname[11] = { - 'N', 'u', 'm', 'M', 'e', 't', 'h', 'o', 'd', 's', 0 }; -static WCHAR const ps_clsid_keyname[15] = { - 'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's', - 'i', 'd', 0 }; -static WCHAR const ps_clsid32_keyname[17] = { - 'P', 'r', 'o', 'x', 'y', 'S', 't', 'u', 'b', 'C', 'l', 's', - 'i', 'd', '3', '2', 0 }; -static WCHAR const clsid_keyname[6] = { - 'C', 'L', 'S', 'I', 'D', 0 }; -static WCHAR const curver_keyname[7] = { - 'C', 'u', 'r', 'V', 'e', 'r', 0 }; -static WCHAR const ips_keyname[13] = { - 'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r', - 0 }; -static WCHAR const ips32_keyname[15] = { - 'I', 'n', 'P', 'r', 'o', 'c', 'S', 'e', 'r', 'v', 'e', 'r', - '3', '2', 0 }; -static WCHAR const progid_keyname[7] = { - 'P', 'r', 'o', 'g', 'I', 'D', 0 }; -static WCHAR const viprogid_keyname[25] = { - 'V', 'e', 'r', 's', 'i', 'o', 'n', 'I', 'n', 'd', 'e', 'p', - 'e', 'n', 'd', 'e', 'n', 't', 'P', 'r', 'o', 'g', 'I', 'D', - 0 }; -static char const tmodel_valuename[] = "ThreadingModel"; - -/*********************************************************************** - * static helper functions - */ -static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid); -static LONG register_key_defvalueW(HKEY base, WCHAR const *name, - WCHAR const *value); -static LONG register_key_defvalueA(HKEY base, WCHAR const *name, - char const *value); -static LONG register_progid(WCHAR const *clsid, - char const *progid, char const *curver_progid, - char const *name, char const *extra); - -/*********************************************************************** - * register_interfaces - */ -static HRESULT register_interfaces(struct regsvr_interface const *list) { - LONG res = ERROR_SUCCESS; - HKEY interface_key; - - res = RegCreateKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, NULL, 0, - KEY_READ | KEY_WRITE, NULL, &interface_key, NULL); - if (res != ERROR_SUCCESS) goto error_return; - - for (; res == ERROR_SUCCESS && list->iid; ++list) { - WCHAR buf[39]; - HKEY iid_key; - - StringFromGUID2(list->iid, buf, 39); - res = RegCreateKeyExW(interface_key, buf, 0, NULL, 0, - KEY_READ | KEY_WRITE, NULL, &iid_key, NULL); - if (res != ERROR_SUCCESS) goto error_close_interface_key; - - if (list->name) { - res = RegSetValueExA(iid_key, NULL, 0, REG_SZ, - (CONST BYTE*)(list->name), - strlen(list->name) + 1); - if (res != ERROR_SUCCESS) goto error_close_iid_key; - } - - if (list->base_iid) { - res = register_key_guid(iid_key, base_ifa_keyname, list->base_iid); - if (res != ERROR_SUCCESS) goto error_close_iid_key; - } - - if (0 <= list->num_methods) { - static WCHAR const fmt[3] = { '%', 'd', 0 }; - HKEY key; - - res = RegCreateKeyExW(iid_key, num_methods_keyname, 0, NULL, 0, - KEY_READ | KEY_WRITE, NULL, &key, NULL); - if (res != ERROR_SUCCESS) goto error_close_iid_key; - - sprintfW(buf, fmt, list->num_methods); - res = RegSetValueExW(key, NULL, 0, REG_SZ, - (CONST BYTE*)buf, - (lstrlenW(buf) + 1) * sizeof(WCHAR)); - RegCloseKey(key); - - if (res != ERROR_SUCCESS) goto error_close_iid_key; - } - - if (list->ps_clsid) { - res = register_key_guid(iid_key, ps_clsid_keyname, list->ps_clsid); - if (res != ERROR_SUCCESS) goto error_close_iid_key; - } - - if (list->ps_clsid32) { - res = register_key_guid(iid_key, ps_clsid32_keyname, list->ps_clsid32); - if (res != ERROR_SUCCESS) goto error_close_iid_key; - } - - error_close_iid_key: - RegCloseKey(iid_key); - } - -error_close_interface_key: - RegCloseKey(interface_key); -error_return: - return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK; -} - -/*********************************************************************** - * unregister_interfaces - */ -static HRESULT unregister_interfaces(struct regsvr_interface const *list) { - LONG res = ERROR_SUCCESS; - HKEY interface_key; - - res = RegOpenKeyExW(HKEY_CLASSES_ROOT, interface_keyname, 0, - KEY_READ | KEY_WRITE, &interface_key); - if (res == ERROR_FILE_NOT_FOUND) return S_OK; - if (res != ERROR_SUCCESS) goto error_return; - - for (; res == ERROR_SUCCESS && list->iid; ++list) { - WCHAR buf[39]; - - StringFromGUID2(list->iid, buf, 39); - res = RegDeleteTreeW(interface_key, buf); - if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; - } - - RegCloseKey(interface_key); -error_return: - return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK; -} - -/*********************************************************************** - * register_coclasses - */ -static HRESULT register_coclasses(struct regsvr_coclass const *list) { - LONG res = ERROR_SUCCESS; - HKEY coclass_key; - - res = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, NULL, 0, - KEY_READ | KEY_WRITE, NULL, &coclass_key, NULL); - if (res != ERROR_SUCCESS) goto error_return; - - for (; res == ERROR_SUCCESS && list->clsid; ++list) { - WCHAR buf[39]; - HKEY clsid_key; - - StringFromGUID2(list->clsid, buf, 39); - res = RegCreateKeyExW(coclass_key, buf, 0, NULL, 0, - KEY_READ | KEY_WRITE, NULL, &clsid_key, NULL); - if (res != ERROR_SUCCESS) goto error_close_coclass_key; - - if (list->name) { - res = RegSetValueExA(clsid_key, NULL, 0, REG_SZ, - (CONST BYTE*)(list->name), - strlen(list->name) + 1); - if (res != ERROR_SUCCESS) goto error_close_clsid_key; - } - - if (list->ips) { - res = register_key_defvalueA(clsid_key, ips_keyname, list->ips); - if (res != ERROR_SUCCESS) goto error_close_clsid_key; - } - - if (list->ips32) { - HKEY ips32_key; - - res = RegCreateKeyExW(clsid_key, ips32_keyname, 0, NULL, 0, - KEY_READ | KEY_WRITE, NULL, - &ips32_key, NULL); - if (res != ERROR_SUCCESS) goto error_close_clsid_key; - - res = RegSetValueExA(ips32_key, NULL, 0, REG_SZ, - (CONST BYTE*)list->ips32, - lstrlenA(list->ips32) + 1); - if (res == ERROR_SUCCESS && list->ips32_tmodel) - res = RegSetValueExA(ips32_key, tmodel_valuename, 0, REG_SZ, - (CONST BYTE*)list->ips32_tmodel, - strlen(list->ips32_tmodel) + 1); - RegCloseKey(ips32_key); - if (res != ERROR_SUCCESS) goto error_close_clsid_key; - } - - if (list->progid) { - res = register_key_defvalueA(clsid_key, progid_keyname, - list->progid); - if (res != ERROR_SUCCESS) goto error_close_clsid_key; - - res = register_progid(buf, list->progid, NULL, - list->name, list->progid_extra); - if (res != ERROR_SUCCESS) goto error_close_clsid_key; - } - - if (list->viprogid) { - res = register_key_defvalueA(clsid_key, viprogid_keyname, - list->viprogid); - if (res != ERROR_SUCCESS) goto error_close_clsid_key; - - res = register_progid(buf, list->viprogid, list->progid, - list->name, list->progid_extra); - if (res != ERROR_SUCCESS) goto error_close_clsid_key; - } - - error_close_clsid_key: - RegCloseKey(clsid_key); - } - -error_close_coclass_key: - RegCloseKey(coclass_key); -error_return: - return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK; -} - -/*********************************************************************** - * unregister_coclasses - */ -static HRESULT unregister_coclasses(struct regsvr_coclass const *list) { - LONG res = ERROR_SUCCESS; - HKEY coclass_key; - - res = RegOpenKeyExW(HKEY_CLASSES_ROOT, clsid_keyname, 0, - KEY_READ | KEY_WRITE, &coclass_key); - if (res == ERROR_FILE_NOT_FOUND) return S_OK; - if (res != ERROR_SUCCESS) goto error_return; - - for (; res == ERROR_SUCCESS && list->clsid; ++list) { - WCHAR buf[39]; - - StringFromGUID2(list->clsid, buf, 39); - res = RegDeleteTreeW(coclass_key, buf); - if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; - if (res != ERROR_SUCCESS) goto error_close_coclass_key; - - if (list->progid) { - res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->progid); - if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; - if (res != ERROR_SUCCESS) goto error_close_coclass_key; - } - - if (list->viprogid) { - res = RegDeleteTreeA(HKEY_CLASSES_ROOT, list->viprogid); - if (res == ERROR_FILE_NOT_FOUND) res = ERROR_SUCCESS; - if (res != ERROR_SUCCESS) goto error_close_coclass_key; - } - } - -error_close_coclass_key: - RegCloseKey(coclass_key); -error_return: - return res != ERROR_SUCCESS ? HRESULT_FROM_WIN32(res) : S_OK; -} - -/*********************************************************************** - * regsvr_key_guid - */ -static LONG register_key_guid(HKEY base, WCHAR const *name, GUID const *guid) { - WCHAR buf[39]; - - StringFromGUID2(guid, buf, 39); - return register_key_defvalueW(base, name, buf); -} - -/*********************************************************************** - * regsvr_key_defvalueW - */ -static LONG register_key_defvalueW( - HKEY base, - WCHAR const *name, - WCHAR const *value) { - LONG res; - HKEY key; - - res = RegCreateKeyExW(base, name, 0, NULL, 0, - KEY_READ | KEY_WRITE, NULL, &key, NULL); - if (res != ERROR_SUCCESS) return res; - res = RegSetValueExW(key, NULL, 0, REG_SZ, (CONST BYTE*)value, - (lstrlenW(value) + 1) * sizeof(WCHAR)); - RegCloseKey(key); - return res; -} - -/*********************************************************************** - * regsvr_key_defvalueA - */ -static LONG register_key_defvalueA( - HKEY base, - WCHAR const *name, - char const *value) { - LONG res; - HKEY key; - - res = RegCreateKeyExW(base, name, 0, NULL, 0, - KEY_READ | KEY_WRITE, NULL, &key, NULL); - if (res != ERROR_SUCCESS) return res; - res = RegSetValueExA(key, NULL, 0, REG_SZ, (CONST BYTE*)value, - lstrlenA(value) + 1); - RegCloseKey(key); - return res; -} - -/*********************************************************************** - * regsvr_progid - */ -static LONG register_progid( - WCHAR const *clsid, - char const *progid, - char const *curver_progid, - char const *name, - char const *extra) { - LONG res; - HKEY progid_key; - - res = RegCreateKeyExA(HKEY_CLASSES_ROOT, progid, 0, - NULL, 0, KEY_READ | KEY_WRITE, NULL, - &progid_key, NULL); - if (res != ERROR_SUCCESS) return res; - - if (name) { - res = RegSetValueExA(progid_key, NULL, 0, REG_SZ, - (CONST BYTE*)name, strlen(name) + 1); - if (res != ERROR_SUCCESS) goto error_close_progid_key; - } - - if (clsid) { - res = register_key_defvalueW(progid_key, clsid_keyname, clsid); - if (res != ERROR_SUCCESS) goto error_close_progid_key; - } - - if (curver_progid) { - res = register_key_defvalueA(progid_key, curver_keyname, - curver_progid); - if (res != ERROR_SUCCESS) goto error_close_progid_key; - } - - if (extra) { - HKEY extra_key; - - res = RegCreateKeyExA(progid_key, extra, 0, - NULL, 0, KEY_READ | KEY_WRITE, NULL, - &extra_key, NULL); - if (res == ERROR_SUCCESS) - RegCloseKey(extra_key); - } - -error_close_progid_key: - RegCloseKey(progid_key); - return res; -} - -/*********************************************************************** - * coclass list - */ -static struct regsvr_coclass const coclass_list[] = { - { &CLSID_DirectMusic, - "DirectMusic", - NULL, - "dmusic.dll", - "Both", - "Microsoft.DirectMusic.1", - "Microsoft.DirectMusic" - }, - { &CLSID_DirectMusicCollection, - "DirectMusicCollection", - NULL, - "dmusic.dll", - "Both", - "Microsoft.DirectMusicCollection.1", - "Microsoft.DirectMusicCollection" - }, - { NULL } /* list terminator */ -}; - -/*********************************************************************** - * interface list - */ - -static struct regsvr_interface const interface_list[] = { - { NULL } /* list terminator */ -}; - -/*********************************************************************** - * DllRegisterServer (DMUSIC.3) - */ -HRESULT WINAPI DllRegisterServer(void) -{ - HRESULT hr; - - TRACE("\n"); - - hr = register_coclasses(coclass_list); - if (SUCCEEDED(hr)) - hr = register_interfaces(interface_list); - return hr; -} - -/*********************************************************************** - * DllUnregisterServer (DMUSIC.4) - */ -HRESULT WINAPI DllUnregisterServer(void) -{ - HRESULT hr; - - TRACE("\n"); - - hr = unregister_coclasses(coclass_list); - if (SUCCEEDED(hr)) - hr = unregister_interfaces(interface_list); - return hr; -} diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index ea7bcd632bf..9614c7f288a 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -37,7 +37,7 @@ reactos/dll/directx/wine/ddraw # Synced to Wine-1.7.17 reactos/dll/directx/wine/devenum # Synced to Wine-1.7.17 reactos/dll/directx/wine/dinput # Synced to Wine-1.7.17 reactos/dll/directx/wine/dinput8 # Synced to Wine-1.7.17 -reactos/dll/directx/wine/dmusic # Synced to Wine-1.7.1 +reactos/dll/directx/wine/dmusic # Synced to Wine-1.7.17 reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1 reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.1 reactos/dll/directx/wine/dsound # Synced to Wine-1.5.26 From 28f0d85f4820302317900c5080712741ea711c21 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 00:08:13 +0000 Subject: [PATCH 400/419] [DPLAYX] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62828 --- reactos/dll/directx/wine/dplayx/dplay.c | 22 +- .../dll/directx/wine/dplayx/dplay_global.h | 4 +- reactos/dll/directx/wine/dplayx/dplaysp.c | 454 +++++------------- reactos/dll/directx/wine/dplayx/dplayx.idl | 2 + .../dll/directx/wine/dplayx/dplayx_global.c | 19 +- reactos/dll/directx/wine/dplayx/lobbysp.c | 390 ++++----------- reactos/media/doc/README.WINE | 2 +- 7 files changed, 236 insertions(+), 657 deletions(-) diff --git a/reactos/dll/directx/wine/dplayx/dplay.c b/reactos/dll/directx/wine/dplayx/dplay.c index 01243fd7ff8..96ef87ff15c 100644 --- a/reactos/dll/directx/wine/dplayx/dplay.c +++ b/reactos/dll/directx/wine/dplayx/dplay.c @@ -149,9 +149,7 @@ static BOOL DP_CreateDirectPlay2( LPVOID lpDP ) This->dp2->spData.lpCB->dwVersion = DPSP_MAJORVERSION; /* This is the pointer to the service provider */ - if( FAILED( DPSP_CreateInterface( &IID_IDirectPlaySP, - (LPVOID*)&This->dp2->spData.lpISP, This ) ) - ) + if ( FAILED( dplaysp_create( &IID_IDirectPlaySP, (void**)&This->dp2->spData.lpISP, This ) ) ) { /* FIXME: Memory leak */ return FALSE; @@ -163,8 +161,7 @@ static BOOL DP_CreateDirectPlay2( LPVOID lpDP ) sizeof( *This->dp2->dplspData.lpCB ) ); This->dp2->dplspData.lpCB->dwSize = sizeof( *This->dp2->dplspData.lpCB ); - if( FAILED( DPLSP_CreateInterface( &IID_IDPLobbySP, - (LPVOID*)&This->dp2->dplspData.lpISP, This ) ) + if( FAILED( dplobbysp_create( &IID_IDPLobbySP, (void**)&This->dp2->dplspData.lpISP, This ) ) ) { /* FIXME: Memory leak */ @@ -303,28 +300,17 @@ HRESULT DP_HandleMessage( IDirectPlayImpl *This, const void *lpcMessageBody, case DPMSGCMD_GETNAMETABLEREPLY: case DPMSGCMD_NEWPLAYERIDREPLY: -#if 0 - if( wCommandId == DPMSGCMD_NEWPLAYERIDREPLY ) - DebugBreak(); -#endif DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize ); break; -#if 1 case DPMSGCMD_JUSTENVELOPE: TRACE( "GOT THE SELF MESSAGE: %p -> 0x%08x\n", lpcMessageHeader, ((const DWORD *)lpcMessageHeader)[1] ); NS_SetLocalAddr( This->dp2->lpNameServerData, lpcMessageHeader, 20 ); DP_MSG_ReplyReceived( This, wCommandId, lpcMessageBody, dwMessageBodySize ); -#endif case DPMSGCMD_FORWARDADDPLAYER: -#if 0 - DebugBreak(); -#endif -#if 1 TRACE( "Sending message to self to get my addr\n" ); DP_MSG_ToSelf( This, 1 ); /* This is a hack right now */ -#endif break; case DPMSGCMD_FORWARDADDPLAYERNACK: @@ -1650,7 +1636,7 @@ static HRESULT DP_IF_CreatePlayer( IDirectPlayImpl *This, void *lpMsgHdr, DPID * } #if 1 - if( This->dp2->bHostInterface == FALSE ) + if( !This->dp2->bHostInterface ) { /* Let the name server know about the creation of this player */ /* FIXME: Is this only to be done for the creation of a server player or @@ -4624,7 +4610,7 @@ static HMODULE DP_LoadSP( LPCGUID lpcGuid, LPSPINITDATA lpSpData, LPBOOL lpbIsDp FILETIME filetime; (i == 0) ? (searchSubKey = spSubKey ) : (searchSubKey = lpSubKey ); - *lpbIsDpSp = (i == 0) ? TRUE : FALSE; + *lpbIsDpSp = (i == 0); /* Need to loop over the service providers in the registry */ diff --git a/reactos/dll/directx/wine/dplayx/dplay_global.h b/reactos/dll/directx/wine/dplayx/dplay_global.h index 6acb120b87f..f5473d0f435 100644 --- a/reactos/dll/directx/wine/dplayx/dplay_global.h +++ b/reactos/dll/directx/wine/dplayx/dplay_global.h @@ -200,7 +200,7 @@ extern LPVOID DPSP_CreateSPPlayerData(void) DECLSPEC_HIDDEN; extern HRESULT dplay_create( REFIID riid, void **ppv ) DECLSPEC_HIDDEN; extern HRESULT dplobby_create( REFIID riid, void **ppv ) DECLSPEC_HIDDEN; -extern HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp ) DECLSPEC_HIDDEN; -extern HRESULT DPLSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp ) DECLSPEC_HIDDEN; +extern HRESULT dplaysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp ) DECLSPEC_HIDDEN; +extern HRESULT dplobbysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp ) DECLSPEC_HIDDEN; #endif /* __WINE_DPLAY_GLOBAL_INCLUDED */ diff --git a/reactos/dll/directx/wine/dplayx/dplaysp.c b/reactos/dll/directx/wine/dplayx/dplaysp.c index d01e1c102b5..2322a311d07 100644 --- a/reactos/dll/directx/wine/dplayx/dplaysp.c +++ b/reactos/dll/directx/wine/dplayx/dplaysp.c @@ -22,46 +22,16 @@ /* FIXME: Need to add interface locking inside procedures */ -/* Prototypes */ -static BOOL DPSP_CreateIUnknown( LPVOID lpSP ); -static BOOL DPSP_DestroyIUnknown( LPVOID lpSP ); -static BOOL DPSP_CreateDirectPlaySP( void *lpSP, IDirectPlayImpl *dp ); -static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP ); - -/* Predefine the interface */ -typedef struct IDirectPlaySPImpl IDirectPlaySPImpl; - -typedef struct tagDirectPlaySPIUnknownData +typedef struct IDirectPlaySPImpl { - LONG ulObjRef; - CRITICAL_SECTION DPSP_lock; -} DirectPlaySPIUnknownData; - -typedef struct tagDirectPlaySPData -{ - LPVOID lpSpRemoteData; - DWORD dwSpRemoteDataSize; /* Size of data pointed to by lpSpRemoteData */ - - LPVOID lpSpLocalData; - DWORD dwSpLocalDataSize; /* Size of data pointed to by lpSpLocalData */ - + IDirectPlaySP IDirectPlaySP_iface; + LONG ref; + void *remote_data; + DWORD remote_data_size; + void *local_data; + DWORD local_data_size; IDirectPlayImpl *dplay; /* FIXME: This should perhaps be iface not impl */ - -} DirectPlaySPData; - -#define DPSP_IMPL_FIELDS \ - LONG ulInterfaceRef; \ - DirectPlaySPIUnknownData* unk; \ - DirectPlaySPData* sp; - -struct IDirectPlaySPImpl -{ - const IDirectPlaySPVtbl *lpVtbl; - DPSP_IMPL_FIELDS -}; - -/* Forward declaration of virtual tables */ -static const IDirectPlaySPVtbl directPlaySPVT; +} IDirectPlaySPImpl; /* This structure is passed to the DP object for safe keeping */ typedef struct tagDP_SPPLAYERDATA @@ -73,202 +43,60 @@ typedef struct tagDP_SPPLAYERDATA DWORD dwPlayerRemoteDataSize; } DP_SPPLAYERDATA, *LPDP_SPPLAYERDATA; -/* Create the SP interface */ -HRESULT DPSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp ) + +static inline IDirectPlaySPImpl *impl_from_IDirectPlaySP( IDirectPlaySP *iface ) { - TRACE( " for %s\n", debugstr_guid( riid ) ); + return CONTAINING_RECORD( iface, IDirectPlaySPImpl, IDirectPlaySP_iface ); +} - *ppvObj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof( IDirectPlaySPImpl ) ); +static HRESULT WINAPI IDirectPlaySPImpl_QueryInterface( IDirectPlaySP *iface, REFIID riid, + void **ppv ) +{ + TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid( riid ), ppv ); - if( *ppvObj == NULL ) + if ( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDirectPlaySP, riid ) ) { - return DPERR_OUTOFMEMORY; - } - - if( IsEqualGUID( &IID_IDirectPlaySP, riid ) ) - { - IDirectPlaySPImpl *This = *ppvObj; - This->lpVtbl = &directPlaySPVT; - } - else - { - /* Unsupported interface */ - HeapFree( GetProcessHeap(), 0, *ppvObj ); - *ppvObj = NULL; - - return E_NOINTERFACE; - } - - /* Initialize it */ - if( DPSP_CreateIUnknown( *ppvObj ) && - DPSP_CreateDirectPlaySP( *ppvObj, dp ) - ) - { - IDirectPlaySP_AddRef( (LPDIRECTPLAYSP)*ppvObj ); + *ppv = iface; + IDirectPlaySP_AddRef( iface ); return S_OK; } - /* Initialize failed, destroy it */ - DPSP_DestroyDirectPlaySP( *ppvObj ); - DPSP_DestroyIUnknown( *ppvObj ); - - HeapFree( GetProcessHeap(), 0, *ppvObj ); - *ppvObj = NULL; - - return DPERR_NOMEMORY; + FIXME( "Unsupported interface %s\n", debugstr_guid( riid ) ); + *ppv = NULL; + return E_NOINTERFACE; } -static BOOL DPSP_CreateIUnknown( LPVOID lpSP ) +static ULONG WINAPI IDirectPlaySPImpl_AddRef( IDirectPlaySP *iface ) { - IDirectPlaySPImpl *This = lpSP; + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); - This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) ); + TRACE( "(%p) ref=%d\n", This, ref ); - if ( This->unk == NULL ) - { - return FALSE; - } - - InitializeCriticalSection( &This->unk->DPSP_lock ); - This->unk->DPSP_lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDirectPlaySPImpl*->DirectPlaySPIUnknownData*->DPSP_lock"); - - return TRUE; + return ref; } -static BOOL DPSP_DestroyIUnknown( LPVOID lpSP ) +static ULONG WINAPI IDirectPlaySPImpl_Release( IDirectPlaySP *iface ) { - IDirectPlaySPImpl *This = lpSP; + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); + ULONG ref = InterlockedDecrement( &This->ref ); - This->unk->DPSP_lock.DebugInfo->Spare[0] = 0; - DeleteCriticalSection( &This->unk->DPSP_lock ); - HeapFree( GetProcessHeap(), 0, This->unk ); + TRACE( "(%p) ref=%d\n", This, ref ); - return TRUE; -} - - -static BOOL DPSP_CreateDirectPlaySP( void *lpSP, IDirectPlayImpl *dp ) -{ - IDirectPlaySPImpl *This = lpSP; - - This->sp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->sp) ) ); - - if ( This->sp == NULL ) - { - return FALSE; - } - - This->sp->dplay = dp; - - return TRUE; -} - -static BOOL DPSP_DestroyDirectPlaySP( LPVOID lpSP ) -{ - IDirectPlaySPImpl *This = lpSP; - - HeapFree( GetProcessHeap(), 0, This->sp->lpSpRemoteData ); - HeapFree( GetProcessHeap(), 0, This->sp->lpSpLocalData ); - - /* FIXME: Need to delete player queue */ - - HeapFree( GetProcessHeap(), 0, This->sp ); - return TRUE; -} - -/* Interface implementation */ - -static HRESULT WINAPI DPSP_QueryInterface -( LPDIRECTPLAYSP iface, - REFIID riid, - LPVOID* ppvObj ) -{ - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; - TRACE("(%p)->(%s,%p)\n", This, debugstr_guid( riid ), ppvObj ); - - *ppvObj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof( *This ) ); - - if( *ppvObj == NULL ) - { - return DPERR_OUTOFMEMORY; - } - - CopyMemory( *ppvObj, This, sizeof( *This ) ); - (*(IDirectPlaySPImpl**)ppvObj)->ulInterfaceRef = 0; - - if( IsEqualGUID( &IID_IDirectPlaySP, riid ) ) - { - IDirectPlaySPImpl *This = *ppvObj; - This->lpVtbl = &directPlaySPVT; - } - else - { - /* Unsupported interface */ - HeapFree( GetProcessHeap(), 0, *ppvObj ); - *ppvObj = NULL; - - return E_NOINTERFACE; - } - - IDirectPlaySP_AddRef( (LPDIRECTPLAYSP)*ppvObj ); - - return S_OK; -} - -static ULONG WINAPI DPSP_AddRef -( LPDIRECTPLAYSP iface ) -{ - ULONG ulInterfaceRefCount, ulObjRefCount; - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; - - ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef ); - ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef ); - - TRACE( "ref count incremented to %u:%u for %p\n", - ulInterfaceRefCount, ulObjRefCount, This ); - - return ulObjRefCount; -} - -static ULONG WINAPI DPSP_Release -( LPDIRECTPLAYSP iface ) -{ - ULONG ulInterfaceRefCount, ulObjRefCount; - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; - - ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef ); - ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef ); - - TRACE( "ref count decremented to %u:%u for %p\n", - ulInterfaceRefCount, ulObjRefCount, This ); - - /* Deallocate if this is the last reference to the object */ - if( ulObjRefCount == 0 ) - { - DPSP_DestroyDirectPlaySP( This ); - DPSP_DestroyIUnknown( This ); - } - - if( ulInterfaceRefCount == 0 ) + if( !ref ) { + HeapFree( GetProcessHeap(), 0, This->remote_data ); + HeapFree( GetProcessHeap(), 0, This->local_data ); HeapFree( GetProcessHeap(), 0, This ); } - return ulInterfaceRefCount; + return ref; } -static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry -( LPDIRECTPLAYSP iface, - LPCWSTR lpSection, - LPCWSTR lpKey, - LPCVOID lpData, - DWORD dwDataSize, - DWORD dwMaxEntries -) +static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry( IDirectPlaySP *iface, LPCWSTR lpSection, + LPCWSTR lpKey, const void *lpData, DWORD dwDataSize, DWORD dwMaxEntries ) { - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); /* Should be able to call the comctl32 undocumented MRU routines. I suspect that the interface works appropriately */ @@ -278,17 +106,11 @@ static HRESULT WINAPI IDirectPlaySPImpl_AddMRUEntry return DP_OK; } -static HRESULT WINAPI IDirectPlaySPImpl_CreateAddress -( LPDIRECTPLAYSP iface, - REFGUID guidSP, - REFGUID guidDataType, - LPCVOID lpData, - DWORD dwDataSize, - LPVOID lpAddress, - LPDWORD lpdwAddressSize -) +static HRESULT WINAPI IDirectPlaySPImpl_CreateAddress( IDirectPlaySP *iface, REFGUID guidSP, + REFGUID guidDataType, const void *lpData, DWORD dwDataSize, void *lpAddress, + DWORD *lpdwAddressSize ) { - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); FIXME( "(%p)->(%s,%s,%p,0x%08x,%p,%p): stub\n", This, debugstr_guid(guidSP), debugstr_guid(guidDataType), @@ -297,15 +119,11 @@ static HRESULT WINAPI IDirectPlaySPImpl_CreateAddress return DP_OK; } -static HRESULT WINAPI IDirectPlaySPImpl_EnumAddress -( LPDIRECTPLAYSP iface, - LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, - LPCVOID lpAddress, - DWORD dwAddressSize, - LPVOID lpContext -) +static HRESULT WINAPI IDirectPlaySPImpl_EnumAddress( IDirectPlaySP *iface, + LPDPENUMADDRESSCALLBACK lpEnumAddressCallback, const void *lpAddress, DWORD dwAddressSize, + void *lpContext ) { - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); TRACE( "(%p)->(%p,%p,0x%08x,%p)\n", This, lpEnumAddressCallback, lpAddress, dwAddressSize, lpContext ); @@ -315,31 +133,23 @@ static HRESULT WINAPI IDirectPlaySPImpl_EnumAddress return DP_OK; } -static HRESULT WINAPI IDirectPlaySPImpl_EnumMRUEntries -( LPDIRECTPLAYSP iface, - LPCWSTR lpSection, - LPCWSTR lpKey, - LPENUMMRUCALLBACK lpEnumMRUCallback, - LPVOID lpContext -) +static HRESULT WINAPI IDirectPlaySPImpl_EnumMRUEntries( IDirectPlaySP *iface, LPCWSTR lpSection, + LPCWSTR lpKey, LPENUMMRUCALLBACK lpEnumMRUCallback, void *lpContext ) { - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); /* Should be able to call the comctl32 undocumented MRU routines. I suspect that the interface works appropriately */ - FIXME( "(%p)->(%p,%p,%p,%p,): stub\n", + FIXME( "(%p)->(%p,%p,%p,%p): stub\n", This, lpSection, lpKey, lpEnumMRUCallback, lpContext ); return DP_OK; } -static HRESULT WINAPI IDirectPlaySPImpl_GetPlayerFlags -( LPDIRECTPLAYSP iface, - DPID idPlayer, - LPDWORD lpdwPlayerFlags -) +static HRESULT WINAPI IDirectPlaySPImpl_GetPlayerFlags( IDirectPlaySP *iface, DPID idPlayer, + DWORD *lpdwPlayerFlags ) { - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); FIXME( "(%p)->(0x%08x,%p): stub\n", This, idPlayer, lpdwPlayerFlags ); @@ -347,22 +157,17 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetPlayerFlags return DP_OK; } -static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData -( LPDIRECTPLAYSP iface, - DPID idPlayer, - LPVOID* lplpData, - LPDWORD lpdwDataSize, - DWORD dwFlags -) +static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData( IDirectPlaySP *iface, DPID idPlayer, + void **lplpData, DWORD *lpdwDataSize, DWORD dwFlags ) { + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); HRESULT hr; LPDP_SPPLAYERDATA lpPlayerData; - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; TRACE( "(%p)->(0x%08x,%p,%p,0x%08x)\n", This, idPlayer, lplpData, lpdwDataSize, dwFlags ); - hr = DP_GetSPPlayerData( This->sp->dplay, idPlayer, (LPVOID*)&lpPlayerData ); + hr = DP_GetSPPlayerData( This->dplay, idPlayer, (void**)&lpPlayerData ); if( FAILED(hr) ) { @@ -390,21 +195,16 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPPlayerData return hr; } -static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage -( LPDIRECTPLAYSP iface, - LPVOID lpMessageBody, - DWORD dwMessageBodySize, - LPVOID lpMessageHeader -) +static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage( IDirectPlaySP *iface, void *lpMessageBody, + DWORD dwMessageBodySize, void *lpMessageHeader ) { + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); LPDPMSG_SENDENVELOPE lpMsg = lpMessageBody; HRESULT hr = DPERR_GENERIC; WORD wCommandId; WORD wVersion; DPSP_REPLYDATA data; - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; - FIXME( "(%p)->(%p,0x%08x,%p): mostly stub\n", This, lpMessageBody, dwMessageBodySize, lpMessageHeader ); @@ -434,9 +234,8 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage data.dwMessageSize = 0; /* Pass this message to the dplay interface to handle */ - hr = DP_HandleMessage( This->sp->dplay, lpMessageBody, dwMessageBodySize, - lpMessageHeader, wCommandId, wVersion, - &data.lpMessage, &data.dwMessageSize ); + hr = DP_HandleMessage( This->dplay, lpMessageBody, dwMessageBodySize, lpMessageHeader, + wCommandId, wVersion, &data.lpMessage, &data.dwMessageSize ); if( FAILED(hr) ) { @@ -450,7 +249,7 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage data.idNameServer = 0; data.lpISP = iface; - hr = (This->sp->dplay->dp2->spData.lpCB->Reply)( &data ); + hr = This->dplay->dp2->spData.lpCB->Reply( &data ); if( FAILED(hr) ) { @@ -704,25 +503,17 @@ static HRESULT WINAPI IDirectPlaySPImpl_HandleMessage #endif } -static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData -( LPDIRECTPLAYSP iface, - DPID idPlayer, - LPVOID lpData, - DWORD dwDataSize, - DWORD dwFlags -) +static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData( IDirectPlaySP *iface, DPID idPlayer, + void *lpData, DWORD dwDataSize, DWORD dwFlags ) { + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); HRESULT hr; LPDP_SPPLAYERDATA lpPlayerEntry; LPVOID lpPlayerData; - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; + TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x)\n", This, idPlayer, lpData, dwDataSize, dwFlags ); -/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */ - TRACE( "(%p)->(0x%08x,%p,0x%08x,0x%08x)\n", - This, idPlayer, lpData, dwDataSize, dwFlags ); - - hr = DP_GetSPPlayerData( This->sp->dplay, idPlayer, (LPVOID*)&lpPlayerEntry ); + hr = DP_GetSPPlayerData( This->dplay, idPlayer, (void**)&lpPlayerEntry ); if( FAILED(hr) ) { /* Player must not exist */ @@ -743,20 +534,16 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPPlayerData lpPlayerEntry->dwPlayerRemoteDataSize = dwDataSize; } - hr = DP_SetSPPlayerData( This->sp->dplay, idPlayer, lpPlayerEntry ); + hr = DP_SetSPPlayerData( This->dplay, idPlayer, lpPlayerEntry ); return hr; } -static HRESULT WINAPI IDirectPlaySPImpl_CreateCompoundAddress -( LPDIRECTPLAYSP iface, - LPCDPCOMPOUNDADDRESSELEMENT lpElements, - DWORD dwElementCount, - LPVOID lpAddress, - LPDWORD lpdwAddressSize -) +static HRESULT WINAPI IDirectPlaySPImpl_CreateCompoundAddress( IDirectPlaySP *iface, + const DPCOMPOUNDADDRESSELEMENT *lpElements, DWORD dwElementCount, void *lpAddress, + DWORD *lpdwAddressSize ) { - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); FIXME( "(%p)->(%p,0x%08x,%p,%p): stub\n", This, lpElements, dwElementCount, lpAddress, lpdwAddressSize ); @@ -764,19 +551,13 @@ static HRESULT WINAPI IDirectPlaySPImpl_CreateCompoundAddress return DP_OK; } -static HRESULT WINAPI IDirectPlaySPImpl_GetSPData -( LPDIRECTPLAYSP iface, - LPVOID* lplpData, - LPDWORD lpdwDataSize, - DWORD dwFlags -) +static HRESULT WINAPI IDirectPlaySPImpl_GetSPData( IDirectPlaySP *iface, void **lplpData, + DWORD *lpdwDataSize, DWORD dwFlags ) { + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); HRESULT hr = DP_OK; - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; -/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */ - TRACE( "(%p)->(%p,%p,0x%08x)\n", - This, lplpData, lpdwDataSize, dwFlags ); + TRACE( "(%p)->(%p,%p,0x%08x)\n", This, lplpData, lpdwDataSize, dwFlags ); #if 0 /* This is what the documentation says... */ @@ -800,42 +581,31 @@ static HRESULT WINAPI IDirectPlaySPImpl_GetSPData /* Yes, we're supposed to return a pointer to the memory we have stored! */ if( dwFlags == DPSET_REMOTE ) { - *lpdwDataSize = This->sp->dwSpRemoteDataSize; - *lplpData = This->sp->lpSpRemoteData; + *lpdwDataSize = This->remote_data_size; + *lplpData = This->remote_data; - if( This->sp->lpSpRemoteData == NULL ) - { + if( !This->remote_data ) hr = DPERR_GENERIC; - } } else if( dwFlags == DPSET_LOCAL ) { - *lpdwDataSize = This->sp->dwSpLocalDataSize; - *lplpData = This->sp->lpSpLocalData; + *lpdwDataSize = This->local_data_size; + *lplpData = This->local_data; - if( This->sp->lpSpLocalData == NULL ) - { + if( !This->local_data ) hr = DPERR_GENERIC; - } } return hr; } -static HRESULT WINAPI IDirectPlaySPImpl_SetSPData -( LPDIRECTPLAYSP iface, - LPVOID lpData, - DWORD dwDataSize, - DWORD dwFlags -) +static HRESULT WINAPI IDirectPlaySPImpl_SetSPData( IDirectPlaySP *iface, void *lpData, + DWORD dwDataSize, DWORD dwFlags ) { + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); LPVOID lpSpData; - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; - -/* TRACE( "Called on process 0x%08lx\n", GetCurrentProcessId() ); */ - TRACE( "(%p)->(%p,0x%08x,0x%08x)\n", - This, lpData, dwDataSize, dwFlags ); + TRACE( "(%p)->(%p,0x%08x,0x%08x)\n", This, lpData, dwDataSize, dwFlags ); #if 0 /* This is what the documentation says... */ @@ -860,27 +630,24 @@ static HRESULT WINAPI IDirectPlaySPImpl_SetSPData /* If we have data already allocated, free it and replace it */ if( dwFlags == DPSET_REMOTE ) { - HeapFree( GetProcessHeap(), 0, This->sp->lpSpRemoteData ); - This->sp->dwSpRemoteDataSize = dwDataSize; - This->sp->lpSpRemoteData = lpSpData; + HeapFree( GetProcessHeap(), 0, This->remote_data ); + This->remote_data_size = dwDataSize; + This->remote_data = lpSpData; } else if ( dwFlags == DPSET_LOCAL ) { - HeapFree( GetProcessHeap(), 0, This->sp->lpSpLocalData ); - This->sp->lpSpLocalData = lpSpData; - This->sp->dwSpLocalDataSize = dwDataSize; + HeapFree( GetProcessHeap(), 0, This->local_data ); + This->local_data = lpSpData; + This->local_data_size = dwDataSize; } return DP_OK; } -static VOID WINAPI IDirectPlaySPImpl_SendComplete -( LPDIRECTPLAYSP iface, - LPVOID unknownA, - DWORD unknownB -) +static void WINAPI IDirectPlaySPImpl_SendComplete( IDirectPlaySP *iface, void *unknownA, + DWORD unknownB ) { - IDirectPlaySPImpl *This = (IDirectPlaySPImpl *)iface; + IDirectPlaySPImpl *This = impl_from_IDirectPlaySP( iface ); FIXME( "(%p)->(%p,0x%08x): stub\n", This, unknownA, unknownB ); @@ -888,11 +655,9 @@ static VOID WINAPI IDirectPlaySPImpl_SendComplete static const IDirectPlaySPVtbl directPlaySPVT = { - - DPSP_QueryInterface, - DPSP_AddRef, - DPSP_Release, - + IDirectPlaySPImpl_QueryInterface, + IDirectPlaySPImpl_AddRef, + IDirectPlaySPImpl_Release, IDirectPlaySPImpl_AddMRUEntry, IDirectPlaySPImpl_CreateAddress, IDirectPlaySPImpl_EnumAddress, @@ -907,6 +672,27 @@ static const IDirectPlaySPVtbl directPlaySPVT = IDirectPlaySPImpl_SendComplete }; +HRESULT dplaysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp ) +{ + IDirectPlaySPImpl *obj; + HRESULT hr; + + TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv ); + + *ppv = NULL; + obj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *obj ) ); + if ( !obj ) + return DPERR_OUTOFMEMORY; + + obj->IDirectPlaySP_iface.lpVtbl = &directPlaySPVT; + obj->ref = 1; + obj->dplay = dp; + + hr = IDirectPlaySP_QueryInterface( &obj->IDirectPlaySP_iface, riid, ppv ); + IDirectPlaySP_Release( &obj->IDirectPlaySP_iface ); + + return hr; +} /* DP external interfaces to call into DPSP interface */ diff --git a/reactos/dll/directx/wine/dplayx/dplayx.idl b/reactos/dll/directx/wine/dplayx/dplayx.idl index cf9dd206535..901a2dcff21 100644 --- a/reactos/dll/directx/wine/dplayx/dplayx.idl +++ b/reactos/dll/directx/wine/dplayx/dplayx.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("DirectPlay Object"), threading(both), diff --git a/reactos/dll/directx/wine/dplayx/dplayx_global.c b/reactos/dll/directx/wine/dplayx/dplayx_global.c index 723744cf06e..f5e2f42316c 100644 --- a/reactos/dll/directx/wine/dplayx/dplayx_global.c +++ b/reactos/dll/directx/wine/dplayx/dplayx_global.c @@ -66,9 +66,10 @@ static LPVOID lpSharedStaticData = NULL; typedef struct { - DWORD used; - DWORD data[dwBlockSize-sizeof(DWORD)]; + BOOL used; + BYTE data[dwBlockSize - sizeof(BOOL)]; } DPLAYX_MEM_SLICE; +C_ASSERT(sizeof(DPLAYX_MEM_SLICE) == dwBlockSize); static DPLAYX_MEM_SLICE* lpMemArea; @@ -83,10 +84,10 @@ static void DPLAYX_PrivHeapFree( LPVOID addr ) return; } - lpAddrStart = (char*)addr - sizeof(DWORD); /* Find block header */ + lpAddrStart = CONTAINING_RECORD(addr, DPLAYX_MEM_SLICE, data); /* Find block header */ dwBlockUsed = ((BYTE*)lpAddrStart - (BYTE*)lpMemArea)/dwBlockSize; - lpMemArea[ dwBlockUsed ].used = 0; + lpMemArea[ dwBlockUsed ].used = FALSE; } static LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size ) @@ -94,20 +95,20 @@ static LPVOID DPLAYX_PrivHeapAlloc( DWORD flags, DWORD size ) LPVOID lpvArea = NULL; UINT uBlockUsed; - if( size > (dwBlockSize - sizeof(DWORD)) ) + if( size > (dwBlockSize - sizeof(BOOL)) ) { FIXME( "Size exceeded. Request of 0x%08x\n", size ); - size = dwBlockSize - sizeof(DWORD); + size = dwBlockSize - sizeof(BOOL); } /* Find blank area */ uBlockUsed = 0; - while( ( lpMemArea[ uBlockUsed ].used != 0 ) && ( uBlockUsed <= dwMaxBlock ) ) { uBlockUsed++; } + while( lpMemArea[ uBlockUsed ].used && uBlockUsed <= dwMaxBlock ) { uBlockUsed++; } if( uBlockUsed <= dwMaxBlock ) { /* Set the area used */ - lpMemArea[ uBlockUsed ].used = 1; + lpMemArea[ uBlockUsed ].used = TRUE; lpvArea = lpMemArea[ uBlockUsed ].data; } else @@ -1183,7 +1184,7 @@ LPCSTR DPLAYX_HresultToString(HRESULT hr) /* For errors not in the list, return HRESULT as a string This part is not thread safe */ WARN( "Unknown error 0x%08x\n", hr ); - wsprintfA( szTempStr, "0x%08lx", hr ); + wsprintfA( szTempStr, "0x%08x", hr ); return szTempStr; } } diff --git a/reactos/dll/directx/wine/dplayx/lobbysp.c b/reactos/dll/directx/wine/dplayx/lobbysp.c index 3ed5e989eec..7b1da09cf17 100644 --- a/reactos/dll/directx/wine/dplayx/lobbysp.c +++ b/reactos/dll/directx/wine/dplayx/lobbysp.c @@ -20,395 +20,180 @@ #include "dplayx_global.h" -/* Prototypes */ -static BOOL DPLSP_CreateIUnknown( LPVOID lpSP ); -static BOOL DPLSP_DestroyIUnknown( LPVOID lpSP ); -static BOOL DPLSP_CreateDPLobbySP( void *lpSP, IDirectPlayImpl *dp ); -static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP ); - -/* Predefine the interface */ -typedef struct IDPLobbySPImpl IDPLobbySPImpl; - -typedef struct tagDPLobbySPIUnknownData -{ - LONG ulObjRef; - CRITICAL_SECTION DPLSP_lock; -} DPLobbySPIUnknownData; - -typedef struct tagDPLobbySPData +typedef struct IDPLobbySPImpl { + IDPLobbySP IDPLobbySP_iface; + LONG ref; IDirectPlayImpl *dplay; -} DPLobbySPData; +} IDPLobbySPImpl; -#define DPLSP_IMPL_FIELDS \ - LONG ulInterfaceRef; \ - DPLobbySPIUnknownData* unk; \ - DPLobbySPData* sp; - -struct IDPLobbySPImpl +static inline IDPLobbySPImpl *impl_from_IDPLobbySP(IDPLobbySP *iface) { - const IDPLobbySPVtbl *lpVtbl; - DPLSP_IMPL_FIELDS -}; + return CONTAINING_RECORD(iface, IDPLobbySPImpl, IDPLobbySP_iface); +} -/* Forward declaration of virtual tables */ -static const IDPLobbySPVtbl dpLobbySPVT; - -HRESULT DPLSP_CreateInterface( REFIID riid, void **ppvObj, IDirectPlayImpl *dp ) +static HRESULT WINAPI IDPLobbySPImpl_QueryInterface( IDPLobbySP *iface, REFIID riid, + void **ppv ) { - TRACE( " for %s\n", debugstr_guid( riid ) ); + TRACE("(%p)->(%s,%p)\n", iface, debugstr_guid( riid ), ppv ); - *ppvObj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof( IDPLobbySPImpl ) ); - - if( *ppvObj == NULL ) + if ( IsEqualGUID( &IID_IUnknown, riid ) || IsEqualGUID( &IID_IDPLobbySP, riid ) ) { - return DPERR_OUTOFMEMORY; - } - - if( IsEqualGUID( &IID_IDPLobbySP, riid ) ) - { - IDPLobbySPImpl *This = *ppvObj; - This->lpVtbl = &dpLobbySPVT; - } - else - { - /* Unsupported interface */ - HeapFree( GetProcessHeap(), 0, *ppvObj ); - *ppvObj = NULL; - - return E_NOINTERFACE; - } - - /* Initialize it */ - if( DPLSP_CreateIUnknown( *ppvObj ) && - DPLSP_CreateDPLobbySP( *ppvObj, dp ) - ) - { - IDPLobbySP_AddRef( (LPDPLOBBYSP)*ppvObj ); + *ppv = iface; + IDPLobbySP_AddRef(iface); return S_OK; } - /* Initialize failed, destroy it */ - DPLSP_DestroyDPLobbySP( *ppvObj ); - DPLSP_DestroyIUnknown( *ppvObj ); - - HeapFree( GetProcessHeap(), 0, *ppvObj ); - *ppvObj = NULL; - - return DPERR_NOMEMORY; + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); + *ppv = NULL; + return E_NOINTERFACE; } -static BOOL DPLSP_CreateIUnknown( LPVOID lpSP ) +static ULONG WINAPI IDPLobbySPImpl_AddRef( IDPLobbySP *iface ) { - IDPLobbySPImpl *This = lpSP; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); + ULONG ref = InterlockedIncrement( &This->ref ); - This->unk = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->unk) ) ); + TRACE( "(%p) ref=%d\n", This, ref ); - if ( This->unk == NULL ) - { - return FALSE; - } - - InitializeCriticalSection( &This->unk->DPLSP_lock ); - This->unk->DPLSP_lock.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": IDPLobbySPImpl*->DPLobbySPIUnknownData*->DPLSP_lock"); - - return TRUE; + return ref; } -static BOOL DPLSP_DestroyIUnknown( LPVOID lpSP ) +static ULONG WINAPI IDPLobbySPImpl_Release( IDPLobbySP *iface ) { - IDPLobbySPImpl *This = lpSP; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); + ULONG ref = InterlockedDecrement( &This->ref ); - This->unk->DPLSP_lock.DebugInfo->Spare[0] = 0; - DeleteCriticalSection( &This->unk->DPLSP_lock ); - HeapFree( GetProcessHeap(), 0, This->unk ); + TRACE( "(%p) ref=%d\n", This, ref ); - return TRUE; -} - -static BOOL DPLSP_CreateDPLobbySP( void *lpSP, IDirectPlayImpl *dp ) -{ - IDPLobbySPImpl *This = lpSP; - - This->sp = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *(This->sp) ) ); - - if ( This->sp == NULL ) - { - return FALSE; - } - - This->sp->dplay = dp; - - return TRUE; -} - -static BOOL DPLSP_DestroyDPLobbySP( LPVOID lpSP ) -{ - IDPLobbySPImpl *This = lpSP; - - HeapFree( GetProcessHeap(), 0, This->sp ); - - return TRUE; -} - -static -HRESULT WINAPI DPLSP_QueryInterface -( LPDPLOBBYSP iface, - REFIID riid, - LPVOID* ppvObj -) -{ - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; - TRACE("(%p)->(%s,%p)\n", This, debugstr_guid( riid ), ppvObj ); - - *ppvObj = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof( *This ) ); - - if( *ppvObj == NULL ) - { - return DPERR_OUTOFMEMORY; - } - - CopyMemory( *ppvObj, This, sizeof( *This ) ); - (*(IDPLobbySPImpl**)ppvObj)->ulInterfaceRef = 0; - - if( IsEqualGUID( &IID_IDPLobbySP, riid ) ) - { - IDPLobbySPImpl *This = *ppvObj; - This->lpVtbl = &dpLobbySPVT; - } - else - { - /* Unsupported interface */ - HeapFree( GetProcessHeap(), 0, *ppvObj ); - *ppvObj = NULL; - - return E_NOINTERFACE; - } - - IDPLobbySP_AddRef( (LPDPLOBBYSP)*ppvObj ); - - return S_OK; -} - -static -ULONG WINAPI DPLSP_AddRef -( LPDPLOBBYSP iface ) -{ - ULONG ulInterfaceRefCount, ulObjRefCount; - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; - - ulObjRefCount = InterlockedIncrement( &This->unk->ulObjRef ); - ulInterfaceRefCount = InterlockedIncrement( &This->ulInterfaceRef ); - - TRACE( "ref count incremented to %u:%u for %p\n", - ulInterfaceRefCount, ulObjRefCount, This ); - - return ulObjRefCount; -} - -static -ULONG WINAPI DPLSP_Release -( LPDPLOBBYSP iface ) -{ - ULONG ulInterfaceRefCount, ulObjRefCount; - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; - - ulObjRefCount = InterlockedDecrement( &This->unk->ulObjRef ); - ulInterfaceRefCount = InterlockedDecrement( &This->ulInterfaceRef ); - - TRACE( "ref count decremented to %u:%u for %p\n", - ulInterfaceRefCount, ulObjRefCount, This ); - - /* Deallocate if this is the last reference to the object */ - if( ulObjRefCount == 0 ) - { - DPLSP_DestroyDPLobbySP( This ); - DPLSP_DestroyIUnknown( This ); - } - - if( ulInterfaceRefCount == 0 ) - { + if( !ref ) HeapFree( GetProcessHeap(), 0, This ); - } - return ulInterfaceRefCount; + return ref; } -static -HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup -( LPDPLOBBYSP iface, - LPSPDATA_ADDREMOTEGROUPTOGROUP argtg -) +static HRESULT WINAPI IDPLobbySPImpl_AddGroupToGroup( IDPLobbySP *iface, + SPDATA_ADDREMOTEGROUPTOGROUP *argtg ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, argtg ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup -( LPDPLOBBYSP iface, - LPSPDATA_ADDREMOTEPLAYERTOGROUP arptg -) +static HRESULT WINAPI IDPLobbySPImpl_AddPlayerToGroup( IDPLobbySP *iface, + SPDATA_ADDREMOTEPLAYERTOGROUP *arptg ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, arptg ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_CreateGroup -( LPDPLOBBYSP iface, - LPSPDATA_CREATEREMOTEGROUP crg -) +static HRESULT WINAPI IDPLobbySPImpl_CreateGroup( IDPLobbySP *iface, + SPDATA_CREATEREMOTEGROUP *crg ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, crg ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup -( LPDPLOBBYSP iface, - LPSPDATA_CREATEREMOTEGROUPINGROUP crgig -) +static HRESULT WINAPI IDPLobbySPImpl_CreateGroupInGroup( IDPLobbySP *iface, + SPDATA_CREATEREMOTEGROUPINGROUP *crgig ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, crgig ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup -( LPDPLOBBYSP iface, - LPSPDATA_DELETEREMOTEGROUPFROMGROUP drgfg -) +static HRESULT WINAPI IDPLobbySPImpl_DeleteGroupFromGroup( IDPLobbySP *iface, + SPDATA_DELETEREMOTEGROUPFROMGROUP *drgfg ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, drgfg ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup -( LPDPLOBBYSP iface, - LPSPDATA_DELETEREMOTEPLAYERFROMGROUP drpfg -) +static HRESULT WINAPI IDPLobbySPImpl_DeletePlayerFromGroup( IDPLobbySP *iface, + SPDATA_DELETEREMOTEPLAYERFROMGROUP *drpfg ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, drpfg ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_DestroyGroup -( LPDPLOBBYSP iface, - LPSPDATA_DESTROYREMOTEGROUP drg -) +static HRESULT WINAPI IDPLobbySPImpl_DestroyGroup( IDPLobbySP *iface, + SPDATA_DESTROYREMOTEGROUP *drg ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, drg ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse -( LPDPLOBBYSP iface, - LPSPDATA_ENUMSESSIONSRESPONSE er -) +static HRESULT WINAPI IDPLobbySPImpl_EnumSessionsResponse( IDPLobbySP *iface, + SPDATA_ENUMSESSIONSRESPONSE *er ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, er ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer -( LPDPLOBBYSP iface, - LPVOID* lplpData -) +static HRESULT WINAPI IDPLobbySPImpl_GetSPDataPointer( IDPLobbySP *iface, LPVOID* lplpData ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, lplpData ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_HandleMessage -( LPDPLOBBYSP iface, - LPSPDATA_HANDLEMESSAGE hm -) +static HRESULT WINAPI IDPLobbySPImpl_HandleMessage( IDPLobbySP *iface, SPDATA_HANDLEMESSAGE *hm ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, hm ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_SendChatMessage -( LPDPLOBBYSP iface, - LPSPDATA_CHATMESSAGE cm -) +static HRESULT WINAPI IDPLobbySPImpl_SendChatMessage( IDPLobbySP *iface, + SPDATA_CHATMESSAGE *cm ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, cm ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_SetGroupName -( LPDPLOBBYSP iface, - LPSPDATA_SETREMOTEGROUPNAME srgn -) +static HRESULT WINAPI IDPLobbySPImpl_SetGroupName( IDPLobbySP *iface, + SPDATA_SETREMOTEGROUPNAME *srgn ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, srgn ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_SetPlayerName -( LPDPLOBBYSP iface, - LPSPDATA_SETREMOTEPLAYERNAME srpn -) +static HRESULT WINAPI IDPLobbySPImpl_SetPlayerName( IDPLobbySP *iface, + SPDATA_SETREMOTEPLAYERNAME *srpn ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, srpn ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc -( LPDPLOBBYSP iface, - LPSPDATA_SETSESSIONDESC ssd -) +static HRESULT WINAPI IDPLobbySPImpl_SetSessionDesc( IDPLobbySP *iface, + SPDATA_SETSESSIONDESC *ssd ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, ssd ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer -( LPDPLOBBYSP iface, - LPVOID lpData -) +static HRESULT WINAPI IDPLobbySPImpl_SetSPDataPointer( IDPLobbySP *iface, void *lpData ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, lpData ); return DP_OK; } -static -HRESULT WINAPI IDPLobbySPImpl_StartSession -( LPDPLOBBYSP iface, - LPSPDATA_STARTSESSIONCOMMAND ssc -) +static HRESULT WINAPI IDPLobbySPImpl_StartSession( IDPLobbySP *iface, + SPDATA_STARTSESSIONCOMMAND *ssc ) { - IDPLobbySPImpl *This = (IDPLobbySPImpl *)iface; + IDPLobbySPImpl *This = impl_from_IDPLobbySP( iface ); FIXME( "(%p)->(%p):stub\n", This, ssc ); return DP_OK; } @@ -416,11 +201,9 @@ HRESULT WINAPI IDPLobbySPImpl_StartSession static const IDPLobbySPVtbl dpLobbySPVT = { - - DPLSP_QueryInterface, - DPLSP_AddRef, - DPLSP_Release, - + IDPLobbySPImpl_QueryInterface, + IDPLobbySPImpl_AddRef, + IDPLobbySPImpl_Release, IDPLobbySPImpl_AddGroupToGroup, IDPLobbySPImpl_AddPlayerToGroup, IDPLobbySPImpl_CreateGroup, @@ -437,5 +220,26 @@ static const IDPLobbySPVtbl dpLobbySPVT = IDPLobbySPImpl_SetSessionDesc, IDPLobbySPImpl_SetSPDataPointer, IDPLobbySPImpl_StartSession - }; + +HRESULT dplobbysp_create( REFIID riid, void **ppv, IDirectPlayImpl *dp ) +{ + IDPLobbySPImpl *obj; + HRESULT hr; + + TRACE( "(%s, %p)\n", debugstr_guid( riid ), ppv ); + + *ppv = NULL; + obj = HeapAlloc( GetProcessHeap(), 0, sizeof( *obj ) ); + if ( !obj ) + return DPERR_OUTOFMEMORY; + + obj->IDPLobbySP_iface.lpVtbl = &dpLobbySPVT; + obj->ref = 1; + obj->dplay = dp; + + hr = IDPLobbySP_QueryInterface( &obj->IDPLobbySP_iface, riid, ppv ); + IDPLobbySP_Release( &obj->IDPLobbySP_iface ); + + return hr; +} diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 9614c7f288a..8c424c44b19 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -39,7 +39,7 @@ reactos/dll/directx/wine/dinput # Synced to Wine-1.7.17 reactos/dll/directx/wine/dinput8 # Synced to Wine-1.7.17 reactos/dll/directx/wine/dmusic # Synced to Wine-1.7.17 reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1 -reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.1 +reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.17 reactos/dll/directx/wine/dsound # Synced to Wine-1.5.26 reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.1 reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.17 From ccad9a39815953174c6880b6ef549e5d211125a6 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 00:08:29 +0000 Subject: [PATCH 401/419] [DPLAYX_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62829 --- rostests/winetests/dplayx/dplayx.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/rostests/winetests/dplayx/dplayx.c b/rostests/winetests/dplayx/dplayx.c index 17ab59d4031..7b6c0c01e6b 100644 --- a/rostests/winetests/dplayx/dplayx.c +++ b/rostests/winetests/dplayx/dplayx.c @@ -87,8 +87,6 @@ static LPSTR get_temp_buffer(void) static LPCSTR Guid2str(const GUID *guid) { - LPSTR buffer = get_temp_buffer(); - if (!guid) return "(null)"; /* Service providers */ @@ -124,12 +122,7 @@ static LPCSTR Guid2str(const GUID *guid) if (IsEqualGUID(guid, &DPAID_ComPort)) return "DPAID_ComPort"; - sprintf( buffer, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - guid->Data1, guid->Data2, guid->Data3, - guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], - guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] ); - return buffer; - + return wine_dbgstr_guid(guid); } @@ -667,7 +660,7 @@ static void init_TCPIP_provider( IDirectPlay4 *pDP, LPCSTR strIPAddressString, W /* IP address string */ addressElements[1].guidDataType = DPAID_INet; - addressElements[1].dwDataSize = lstrlen(strIPAddressString) + 1; + addressElements[1].dwDataSize = lstrlenA(strIPAddressString) + 1; addressElements[1].lpData = (LPVOID) strIPAddressString; /* Optional Port number */ @@ -6470,7 +6463,7 @@ static void test_COM_dplobby(void) &IID_IUnknown, (void**)&dpl); ok(hr == CLASS_E_NOAGGREGATION || broken(hr == E_INVALIDARG), "DirectPlayLobby create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr); - ok(!dpl || dpl == (IDirectPlayLobby*)0xdeadbeef, "dp4 = %p\n", dpl); + ok(!dpl || dpl == (IDirectPlayLobby*)0xdeadbeef, "dpl = %p\n", dpl); /* Invalid RIID */ hr = CoCreateInstance(&CLSID_DirectPlayLobby, NULL, CLSCTX_INPROC_SERVER, &IID_IDirectPlay, From 56f1ee3f9aaed2dbbd8b102f96af1f3f258ee90f Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 00:20:21 +0000 Subject: [PATCH 402/419] [DXDIAGN] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62830 --- reactos/dll/directx/wine/dxdiagn/dxdiagn.idl | 2 + reactos/dll/directx/wine/dxdiagn/provider.c | 44 ++++++++++++++++++-- reactos/media/doc/README.WINE | 2 +- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/reactos/dll/directx/wine/dxdiagn/dxdiagn.idl b/reactos/dll/directx/wine/dxdiagn/dxdiagn.idl index 3a6b88fe04b..45828fcbc62 100644 --- a/reactos/dll/directx/wine/dxdiagn/dxdiagn.idl +++ b/reactos/dll/directx/wine/dxdiagn/dxdiagn.idl @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#pragma makedep register + [ helpstring("DxDiagProvider Class"), threading(apartment), diff --git a/reactos/dll/directx/wine/dxdiagn/provider.c b/reactos/dll/directx/wine/dxdiagn/provider.c index 093a34d3365..deac71b06bf 100644 --- a/reactos/dll/directx/wine/dxdiagn/provider.c +++ b/reactos/dll/directx/wine/dxdiagn/provider.c @@ -52,6 +52,9 @@ static const WCHAR szSubSysId[] = {'s','z','S','u','b','S','y','s','I','d',0}; static const WCHAR szRevisionId[] = {'s','z','R','e','v','i','s','i','o','n','I','d',0}; static const WCHAR dwRefreshRate[] = {'d','w','R','e','f','r','e','s','h','R','a','t','e',0}; static const WCHAR szManufacturer[] = {'s','z','M','a','n','u','f','a','c','t','u','r','e','r',0}; +static const WCHAR szChipType[] = {'s','z','C','h','i','p','T','y','p','e',0}; +static const WCHAR szDACType[] = {'s','z','D','A','C','T','y','p','e',0}; +static const WCHAR szRevision[] = {'s','z','R','e','v','i','s','i','o','n',0}; struct IDxDiagProviderImpl { @@ -898,10 +901,15 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node static const WCHAR id_fmtW[] = {'0','x','%','0','4','x',0}; static const WCHAR subsysid_fmtW[] = {'0','x','%','0','8','x',0}; static const WCHAR mem_fmt[] = {'%','.','1','f',' ','M','B',0}; + static const WCHAR b3DAccelerationExists[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','x','i','s','t','s',0}; + static const WCHAR b3DAccelerationEnabled[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; + static const WCHAR bDDAccelerationEnabled[] = {'b','D','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; D3DADAPTER_IDENTIFIER9 adapter_info; D3DDISPLAYMODE adapter_mode; + D3DCAPS9 device_caps; DWORD available_mem = 0; + BOOL hardware_accel; snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), adapterid_fmtW, index); display_adapter = allocate_information_node(buffer); @@ -1002,6 +1010,18 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node if (FAILED(hr)) goto cleanup; + hr = add_bstr_property(display_adapter, szChipType, szEmpty); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(display_adapter, szDACType, szEmpty); + if (FAILED(hr)) + goto cleanup; + + hr = add_bstr_property(display_adapter, szRevision, szEmpty); + if (FAILED(hr)) + goto cleanup; + if (!get_texture_memory(&adapter_info.DeviceIdentifier, &available_mem)) WARN("get_texture_memory helper failed\n"); @@ -1014,6 +1034,21 @@ static HRESULT fill_display_information_d3d(IDxDiagContainerImpl_Container *node hr = add_bstr_property(display_adapter, szDisplayMemoryEnglish, buffer); if (FAILED(hr)) goto cleanup; + + hr = IDirect3D9_GetDeviceCaps(pDirect3D9, index, D3DDEVTYPE_HAL, &device_caps); + hardware_accel = SUCCEEDED(hr); + + hr = add_bool_property(display_adapter, b3DAccelerationEnabled, hardware_accel); + if (FAILED(hr)) + goto cleanup; + + hr = add_bool_property(display_adapter, b3DAccelerationExists, hardware_accel); + if (FAILED(hr)) + goto cleanup; + + hr = add_bool_property(display_adapter, bDDAccelerationEnabled, hardware_accel); + if (FAILED(hr)) + goto cleanup; } hr = S_OK; @@ -1028,7 +1063,7 @@ static HRESULT fill_display_information_fallback(IDxDiagContainerImpl_Container static const WCHAR *empty_properties[] = {szDeviceIdentifier, szVendorId, szDeviceId, szKeyDeviceKey, szKeyDeviceID, szDriverName, szDriverVersion, szSubSysId, szRevisionId, - szManufacturer}; + szManufacturer, szChipType, szDACType, szRevision}; IDxDiagContainerImpl_Container *display_adapter; HRESULT hr; @@ -1603,16 +1638,17 @@ static HRESULT build_directshowfilters_tree(IDxDiagContainerImpl_Container *node } hr = fill_filter_container(subcont, pMoniker); + IMoniker_Release(pMoniker); if (FAILED(hr)) { + WARN("Skipping invalid filter\n"); free_information_tree(subcont); - IMoniker_Release(pMoniker); - break; + hr = S_OK; + continue; } add_subcontainer(node, subcont); i++; - IMoniker_Release(pMoniker); } IEnumMoniker_Release(pEnum); diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 8c424c44b19..0e8c14d8071 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -41,7 +41,7 @@ reactos/dll/directx/wine/dmusic # Synced to Wine-1.7.17 reactos/dll/directx/wine/dplay # Synced to Wine-1.7.1 reactos/dll/directx/wine/dplayx # Synced to Wine-1.7.17 reactos/dll/directx/wine/dsound # Synced to Wine-1.5.26 -reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.1 +reactos/dll/directx/wine/dxdiagn # Synced to Wine-1.7.17 reactos/dll/directx/wine/dxgi # Synced to Wine-1.7.17 reactos/dll/directx/wine/msdmo # Synced to Wine-1.7.1 reactos/dll/directx/wine/qedit # Synced to Wine-1.7.17 From b84bae08193ad0f2e55ea0ce1b7bf051ce262a57 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 00:20:32 +0000 Subject: [PATCH 403/419] [DXDIAGN_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62831 --- rostests/winetests/dxdiagn/container.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rostests/winetests/dxdiagn/container.c b/rostests/winetests/dxdiagn/container.c index 8e6d19178a4..4d6d13aec4b 100644 --- a/rostests/winetests/dxdiagn/container.c +++ b/rostests/winetests/dxdiagn/container.c @@ -938,6 +938,9 @@ static void test_DxDiag_DisplayDevices(void) static const WCHAR szRevisionId[] = {'s','z','R','e','v','i','s','i','o','n','I','d',0}; static const WCHAR dwRefreshRate[] = {'d','w','R','e','f','r','e','s','h','R','a','t','e',0}; static const WCHAR szManufacturer[] = {'s','z','M','a','n','u','f','a','c','t','u','r','e','r',0}; + static const WCHAR b3DAccelerationExists[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','x','i','s','t','s',0}; + static const WCHAR b3DAccelerationEnabled[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; + static const WCHAR bDDAccelerationEnabled[] = {'b','D','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; static const struct property_test property_tests[] = { @@ -959,6 +962,9 @@ static void test_DxDiag_DisplayDevices(void) {szRevisionId, VT_BSTR}, {dwRefreshRate, VT_UI4}, {szManufacturer, VT_BSTR}, + {b3DAccelerationExists, VT_BOOL}, + {b3DAccelerationEnabled, VT_BOOL}, + {bDDAccelerationEnabled, VT_BOOL}, }; IDxDiagContainer *display_cont = NULL; From 53976acc2294914ba5a005c9a383c24c6e44aeec Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 00:25:16 +0000 Subject: [PATCH 404/419] [ACTXPRXY] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62832 --- reactos/dll/win32/actxprxy/actxprxy_activscp.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_comcat.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_docobj.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_hlink.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_htiface.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_htiframe.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_objsafe.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_ocmm.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_servprov.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_shldisp.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_shobjidl.idl | 3 +++ reactos/dll/win32/actxprxy/actxprxy_urlhist.idl | 3 +++ reactos/media/doc/README.WINE | 2 +- 13 files changed, 37 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/actxprxy/actxprxy_activscp.idl b/reactos/dll/win32/actxprxy/actxprxy_activscp.idl index 3f0fda76cd2..514c4640e88 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_activscp.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_activscp.idl @@ -18,6 +18,9 @@ /* just a wrapper for activscp.idl */ +#pragma makedep proxy +#pragma makedep register + #include "activscp.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_comcat.idl b/reactos/dll/win32/actxprxy/actxprxy_comcat.idl index 548aa0d17a0..7832513e932 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_comcat.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_comcat.idl @@ -18,6 +18,9 @@ /* just a wrapper for comcat.idl */ +#pragma makedep proxy +#pragma makedep register + #include "comcat.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_docobj.idl b/reactos/dll/win32/actxprxy/actxprxy_docobj.idl index 8b2a83f65f2..99b9caa420f 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_docobj.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_docobj.idl @@ -18,6 +18,9 @@ /* just a wrapper for docobj.idl */ +#pragma makedep proxy +#pragma makedep register + #include "docobj.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_hlink.idl b/reactos/dll/win32/actxprxy/actxprxy_hlink.idl index 479e937cbf1..519ac5943e7 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_hlink.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_hlink.idl @@ -18,6 +18,9 @@ /* just a wrapper for hlink.idl */ +#pragma makedep proxy +#pragma makedep register + #include "hlink.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_htiface.idl b/reactos/dll/win32/actxprxy/actxprxy_htiface.idl index 8ecf7e664b9..e2d9ab7dd58 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_htiface.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_htiface.idl @@ -18,6 +18,9 @@ /* just a wrapper for htiface.idl */ +#pragma makedep proxy +#pragma makedep register + #include "htiface.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_htiframe.idl b/reactos/dll/win32/actxprxy/actxprxy_htiframe.idl index e3d5f723c91..d0ece4a0281 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_htiframe.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_htiframe.idl @@ -18,6 +18,9 @@ /* just a wrapper for htiframe.idl */ +#pragma makedep proxy +#pragma makedep register + #include "htiframe.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_objsafe.idl b/reactos/dll/win32/actxprxy/actxprxy_objsafe.idl index 771a4d9ccb0..01d39ac3a63 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_objsafe.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_objsafe.idl @@ -18,6 +18,9 @@ /* just a wrapper for objsafe.idl */ +#pragma makedep proxy +#pragma makedep register + #include "objsafe.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_ocmm.idl b/reactos/dll/win32/actxprxy/actxprxy_ocmm.idl index 75e4788aa54..b1ac316ba78 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_ocmm.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_ocmm.idl @@ -18,6 +18,9 @@ /* just a wrapper for ocmm.idl */ +#pragma makedep proxy +#pragma makedep register + #include "ocmm.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_servprov.idl b/reactos/dll/win32/actxprxy/actxprxy_servprov.idl index 1388f23e43b..98ac626530f 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_servprov.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_servprov.idl @@ -1,3 +1,6 @@ +#pragma makedep proxy +#pragma makedep register + #include "servprov.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_shldisp.idl b/reactos/dll/win32/actxprxy/actxprxy_shldisp.idl index e5ddb18cfc4..041c675ef5b 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_shldisp.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_shldisp.idl @@ -18,6 +18,9 @@ /* just a wrapper for shldisp.idl */ +#pragma makedep proxy +#pragma makedep register + #include "shldisp.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_shobjidl.idl b/reactos/dll/win32/actxprxy/actxprxy_shobjidl.idl index ccff236dca3..2a6dac117f4 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_shobjidl.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_shobjidl.idl @@ -18,6 +18,9 @@ /* just a wrapper for shobjidl.idl */ +#pragma makedep proxy +#pragma makedep register + #include "shobjidl.idl" [ diff --git a/reactos/dll/win32/actxprxy/actxprxy_urlhist.idl b/reactos/dll/win32/actxprxy/actxprxy_urlhist.idl index f9877527e88..7e933a999f6 100644 --- a/reactos/dll/win32/actxprxy/actxprxy_urlhist.idl +++ b/reactos/dll/win32/actxprxy/actxprxy_urlhist.idl @@ -18,6 +18,9 @@ /* just a wrapper for urlhist.idl */ +#pragma makedep proxy +#pragma makedep register + #include "urlhist.idl" [ diff --git a/reactos/media/doc/README.WINE b/reactos/media/doc/README.WINE index 0e8c14d8071..19e4221cc18 100644 --- a/reactos/media/doc/README.WINE +++ b/reactos/media/doc/README.WINE @@ -49,7 +49,7 @@ reactos/dll/directx/wine/quartz # Synced to Wine-1.7.17 reactos/dll/directx/wine/wined3d # Synced to Wine-1.7.17 reactos/dll/win32/activeds # Synced to Wine-1.7.1 -reactos/dll/win32/actxprxy # Synced to Wine-1.7.1 +reactos/dll/win32/actxprxy # Synced to Wine-1.7.17 reactos/dll/win32/advpack # Synced to Wine-1.7.1 reactos/dll/win32/atl # Synced to Wine-1.7.1 reactos/dll/win32/atl100 # Synced to Wine-1.7.1 From 5188874df06442668462f6330e3b496e985d2774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 20 Apr 2014 11:25:38 +0000 Subject: [PATCH 405/419] [KERNEL32][CONSRV] Make kernel32 / winsrv console CSR structures Win2k3-compliant. The aim is to be able to put our kernel32.dll or winsrv.dll on win2k3, and vice-versa. Part 2/X CORE-7931 svn path=/trunk/; revision=62833 --- .../win32/kernel32/client/console/console.c | 493 +++++++++--------- reactos/include/reactos/subsys/win/conmsg.h | 54 +- .../user/winsrv/consrv/condrv/coninput.c | 8 +- .../user/winsrv/consrv/condrv/console.c | 95 +++- .../win32ss/user/winsrv/consrv/condrv/text.c | 4 +- reactos/win32ss/user/winsrv/consrv/coninput.c | 4 +- .../win32ss/user/winsrv/consrv/conoutput.c | 4 +- reactos/win32ss/user/winsrv/consrv/console.c | 21 +- reactos/win32ss/user/winsrv/consrv/handle.c | 28 +- .../user/winsrv/consrv/include/conio.h | 2 +- 10 files changed, 394 insertions(+), 319 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/console/console.c b/reactos/dll/win32/kernel32/client/console/console.c index e4a3367bf97..e99b1be5cd5 100644 --- a/reactos/dll/win32/kernel32/client/console/console.c +++ b/reactos/dll/win32/kernel32/client/console/console.c @@ -277,7 +277,6 @@ DuplicateConsoleHandle(HANDLE hConsole, BOOL bInheritHandle, DWORD dwOptions) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_DUPLICATEHANDLE DuplicateHandleRequest = &ApiMessage.Data.DuplicateHandleRequest; @@ -285,26 +284,27 @@ DuplicateConsoleHandle(HANDLE hConsole, (!(dwOptions & DUPLICATE_SAME_ACCESS) && (dwDesiredAccess & ~(GENERIC_READ | GENERIC_WRITE))) ) { - SetLastError (ERROR_INVALID_PARAMETER); + SetLastError(ERROR_INVALID_PARAMETER); return INVALID_HANDLE_VALUE; } - DuplicateHandleRequest->ConsoleHandle = hConsole; - DuplicateHandleRequest->Access = dwDesiredAccess; - DuplicateHandleRequest->Inheritable = bInheritHandle; - DuplicateHandleRequest->Options = dwOptions; + DuplicateHandleRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + DuplicateHandleRequest->SourceHandle = hConsole; + DuplicateHandleRequest->DesiredAccess = dwDesiredAccess; + DuplicateHandleRequest->InheritHandle = bInheritHandle; + DuplicateHandleRequest->Options = dwOptions; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepDuplicateHandle), - sizeof(CONSOLE_DUPLICATEHANDLE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepDuplicateHandle), + sizeof(*DuplicateHandleRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return INVALID_HANDLE_VALUE; } - return DuplicateHandleRequest->ConsoleHandle; + return DuplicateHandleRequest->TargetHandle; } @@ -337,6 +337,7 @@ GetConsoleDisplayMode(LPDWORD lpModeFlags) } *lpModeFlags = GetDisplayModeRequest->DisplayMode; // ModeFlags + return TRUE; } @@ -407,6 +408,7 @@ GetConsoleHardwareState(HANDLE hConsoleOutput, *Flags = HardwareStateRequest->Flags; *State = HardwareStateRequest->State; + return TRUE; } @@ -496,16 +498,15 @@ OpenConsoleW(LPCWSTR wsName, BOOL bInheritHandle, DWORD dwShareMode) { - NTSTATUS Status = STATUS_SUCCESS; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_OPENCONSOLE OpenConsoleRequest = &ApiMessage.Data.OpenConsoleRequest; CONSOLE_HANDLE_TYPE HandleType; - if (wsName && 0 == _wcsicmp(wsName, BaseConInputFileName)) + if (wsName && (_wcsicmp(wsName, BaseConInputFileName) == 0)) { HandleType = HANDLE_INPUT; } - else if (wsName && 0 == _wcsicmp(wsName, BaseConOutputFileName)) + else if (wsName && (_wcsicmp(wsName, BaseConOutputFileName) == 0)) { HandleType = HANDLE_OUTPUT; } @@ -522,22 +523,23 @@ OpenConsoleW(LPCWSTR wsName, return INVALID_HANDLE_VALUE; } - OpenConsoleRequest->HandleType = HandleType; - OpenConsoleRequest->Access = dwDesiredAccess; - OpenConsoleRequest->Inheritable = bInheritHandle; - OpenConsoleRequest->ShareMode = dwShareMode; + OpenConsoleRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + OpenConsoleRequest->HandleType = HandleType; + OpenConsoleRequest->DesiredAccess = dwDesiredAccess; + OpenConsoleRequest->InheritHandle = bInheritHandle; + OpenConsoleRequest->ShareMode = dwShareMode; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepOpenConsole), - sizeof(CONSOLE_OPENCONSOLE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepOpenConsole), + sizeof(*OpenConsoleRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return INVALID_HANDLE_VALUE; } - return OpenConsoleRequest->ConsoleHandle; + return OpenConsoleRequest->Handle; } @@ -1082,19 +1084,20 @@ WINAPI SetConsoleCursorPosition(HANDLE hConsoleOutput, COORD dwCursorPosition) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_SETCURSORPOSITION SetCursorPositionRequest = &ApiMessage.Data.SetCursorPositionRequest; - ApiMessage.Data.SetCursorPositionRequest.OutputHandle = hConsoleOutput; - ApiMessage.Data.SetCursorPositionRequest.Position = dwCursorPosition; + SetCursorPositionRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetCursorPositionRequest->OutputHandle = hConsoleOutput; + SetCursorPositionRequest->Position = dwCursorPosition; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCursorPosition), - sizeof(CONSOLE_SETCURSORPOSITION)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCursorPosition), + sizeof(*SetCursorPositionRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -1112,7 +1115,6 @@ WINAPI GetConsoleMode(HANDLE hConsoleHandle, LPDWORD lpMode) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_GETSETCONSOLEMODE ConsoleModeRequest = &ApiMessage.Data.ConsoleModeRequest; @@ -1122,19 +1124,51 @@ GetConsoleMode(HANDLE hConsoleHandle, return FALSE; } - ConsoleModeRequest->ConsoleHandle = hConsoleHandle; + ConsoleModeRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + ConsoleModeRequest->Handle = hConsoleHandle; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetMode), - sizeof(CONSOLE_GETSETCONSOLEMODE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetMode), + sizeof(*ConsoleModeRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } - *lpMode = ConsoleModeRequest->ConsoleMode; + *lpMode = ConsoleModeRequest->Mode; + + return TRUE; +} + + +/*-------------------------------------------------------------- + * SetConsoleMode + * + * @implemented + */ +BOOL +WINAPI +SetConsoleMode(HANDLE hConsoleHandle, + DWORD dwMode) +{ + CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_GETSETCONSOLEMODE ConsoleModeRequest = &ApiMessage.Data.ConsoleModeRequest; + + ConsoleModeRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + ConsoleModeRequest->Handle = hConsoleHandle; + ConsoleModeRequest->Mode = dwMode; + + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetMode), + sizeof(*ConsoleModeRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) + { + BaseSetLastNTError(ApiMessage.Status); + return FALSE; + } return TRUE; } @@ -1150,20 +1184,20 @@ WINAPI GetNumberOfConsoleInputEvents(HANDLE hConsoleInput, LPDWORD lpNumberOfEvents) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_GETNUMINPUTEVENTS GetNumInputEventsRequest = &ApiMessage.Data.GetNumInputEventsRequest; - GetNumInputEventsRequest->InputHandle = hConsoleInput; - GetNumInputEventsRequest->NumInputEvents = 0; + GetNumInputEventsRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + GetNumInputEventsRequest->InputHandle = hConsoleInput; + GetNumInputEventsRequest->NumberOfEvents = 0; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetNumberOfInputEvents), - sizeof(CONSOLE_GETNUMINPUTEVENTS)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetNumberOfInputEvents), + sizeof(*GetNumInputEventsRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -1173,7 +1207,7 @@ GetNumberOfConsoleInputEvents(HANDLE hConsoleInput, return FALSE; } - *lpNumberOfEvents = GetNumInputEventsRequest->NumInputEvents; + *lpNumberOfEvents = GetNumInputEventsRequest->NumberOfEvents; return TRUE; } @@ -1188,21 +1222,21 @@ COORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_GETLARGESTWINDOWSIZE GetLargestWindowSizeRequest = &ApiMessage.Data.GetLargestWindowSizeRequest; - GetLargestWindowSizeRequest->OutputHandle = hConsoleOutput; + GetLargestWindowSizeRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + GetLargestWindowSizeRequest->OutputHandle = hConsoleOutput; GetLargestWindowSizeRequest->Size.X = 0; GetLargestWindowSizeRequest->Size.Y = 0; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetLargestWindowSize), - sizeof(CONSOLE_GETLARGESTWINDOWSIZE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetLargestWindowSize), + sizeof(*GetLargestWindowSizeRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); } DPRINT1("GetLargestConsoleWindowSize, X = %d, Y = %d\n", GetLargestWindowSizeRequest->Size.X, GetLargestWindowSizeRequest->Size.Y); @@ -1220,8 +1254,8 @@ WINAPI GetConsoleCursorInfo(HANDLE hConsoleOutput, PCONSOLE_CURSOR_INFO lpConsoleCursorInfo) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_GETSETCURSORINFO CursorInfoRequest = &ApiMessage.Data.CursorInfoRequest; if (!lpConsoleCursorInfo) { @@ -1233,19 +1267,51 @@ GetConsoleCursorInfo(HANDLE hConsoleOutput, return FALSE; } - ApiMessage.Data.CursorInfoRequest.OutputHandle = hConsoleOutput; + CursorInfoRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + CursorInfoRequest->OutputHandle = hConsoleOutput; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetCursorInfo), - sizeof(CONSOLE_GETSETCURSORINFO)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetCursorInfo), + sizeof(*CursorInfoRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } - *lpConsoleCursorInfo = ApiMessage.Data.CursorInfoRequest.Info; + *lpConsoleCursorInfo = CursorInfoRequest->Info; + + return TRUE; +} + + +/*-------------------------------------------------------------- + * SetConsoleCursorInfo + * + * @implemented + */ +BOOL +WINAPI +SetConsoleCursorInfo(HANDLE hConsoleOutput, + CONST CONSOLE_CURSOR_INFO *lpConsoleCursorInfo) +{ + CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_GETSETCURSORINFO CursorInfoRequest = &ApiMessage.Data.CursorInfoRequest; + + CursorInfoRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + CursorInfoRequest->OutputHandle = hConsoleOutput; + CursorInfoRequest->Info = *lpConsoleCursorInfo; + + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCursorInfo), + sizeof(*CursorInfoRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) + { + BaseSetLastNTError(ApiMessage.Status); + return FALSE; + } return TRUE; } @@ -1266,37 +1332,6 @@ GetNumberOfConsoleMouseButtons(LPDWORD lpNumberOfMouseButtons) } -/*-------------------------------------------------------------- - * SetConsoleMode - * - * @implemented - */ -BOOL -WINAPI -SetConsoleMode(HANDLE hConsoleHandle, - DWORD dwMode) -{ - NTSTATUS Status; - CONSOLE_API_MESSAGE ApiMessage; - PCONSOLE_GETSETCONSOLEMODE ConsoleModeRequest = &ApiMessage.Data.ConsoleModeRequest; - - ConsoleModeRequest->ConsoleHandle = hConsoleHandle; - ConsoleModeRequest->ConsoleMode = dwMode; - - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetMode), - sizeof(CONSOLE_GETSETCONSOLEMODE)); - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); - return FALSE; - } - - return TRUE; -} - - /*-------------------------------------------------------------- * SetConsoleActiveScreenBuffer * @@ -1306,18 +1341,19 @@ BOOL WINAPI SetConsoleActiveScreenBuffer(HANDLE hConsoleOutput) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_SETACTIVESCREENBUFFER SetScreenBufferRequest = &ApiMessage.Data.SetScreenBufferRequest; - ApiMessage.Data.SetScreenBufferRequest.OutputHandle = hConsoleOutput; + SetScreenBufferRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetScreenBufferRequest->OutputHandle = hConsoleOutput; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetActiveScreenBuffer), - sizeof(CONSOLE_SETACTIVESCREENBUFFER)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetActiveScreenBuffer), + sizeof(*SetScreenBufferRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -1334,18 +1370,19 @@ BOOL WINAPI FlushConsoleInputBuffer(HANDLE hConsoleInput) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_FLUSHINPUTBUFFER FlushInputBufferRequest = &ApiMessage.Data.FlushInputBufferRequest; - ApiMessage.Data.FlushInputBufferRequest.InputHandle = hConsoleInput; + FlushInputBufferRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + FlushInputBufferRequest->InputHandle = hConsoleInput; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepFlushInputBuffer), - sizeof(CONSOLE_FLUSHINPUTBUFFER)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepFlushInputBuffer), + sizeof(*FlushInputBufferRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -1363,49 +1400,20 @@ WINAPI SetConsoleScreenBufferSize(HANDLE hConsoleOutput, COORD dwSize) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_SETSCREENBUFFERSIZE SetScreenBufferSizeRequest = &ApiMessage.Data.SetScreenBufferSizeRequest; - ApiMessage.Data.SetScreenBufferSizeRequest.OutputHandle = hConsoleOutput; - ApiMessage.Data.SetScreenBufferSizeRequest.Size = dwSize; + SetScreenBufferSizeRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetScreenBufferSizeRequest->OutputHandle = hConsoleOutput; + SetScreenBufferSizeRequest->Size = dwSize; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetScreenBufferSize), - sizeof(CONSOLE_SETSCREENBUFFERSIZE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetScreenBufferSize), + sizeof(*SetScreenBufferSizeRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); - return FALSE; - } - - return TRUE; -} - - -/*-------------------------------------------------------------- - * SetConsoleCursorInfo - * - * @implemented - */ -BOOL -WINAPI -SetConsoleCursorInfo(HANDLE hConsoleOutput, - CONST CONSOLE_CURSOR_INFO *lpConsoleCursorInfo) -{ - NTSTATUS Status; - CONSOLE_API_MESSAGE ApiMessage; - - ApiMessage.Data.CursorInfoRequest.OutputHandle = hConsoleOutput; - ApiMessage.Data.CursorInfoRequest.Info = *lpConsoleCursorInfo; - - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetCursorInfo), - sizeof(CONSOLE_GETSETCURSORINFO)); - if (!NT_SUCCESS(Status)) - { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -1513,7 +1521,6 @@ SetConsoleWindowInfo(HANDLE hConsoleOutput, BOOL bAbsolute, CONST SMALL_RECT *lpConsoleWindow) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_SETWINDOWINFO SetWindowInfoRequest = &ApiMessage.Data.SetWindowInfoRequest; @@ -1523,17 +1530,18 @@ SetConsoleWindowInfo(HANDLE hConsoleOutput, return FALSE; } - SetWindowInfoRequest->OutputHandle = hConsoleOutput; - SetWindowInfoRequest->Absolute = bAbsolute; - SetWindowInfoRequest->WindowRect = *lpConsoleWindow; + SetWindowInfoRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetWindowInfoRequest->OutputHandle = hConsoleOutput; + SetWindowInfoRequest->Absolute = bAbsolute; + SetWindowInfoRequest->WindowRect = *lpConsoleWindow; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetWindowInfo), - sizeof(CONSOLE_SETWINDOWINFO)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetWindowInfo), + sizeof(*SetWindowInfoRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -1551,19 +1559,20 @@ WINAPI SetConsoleTextAttribute(HANDLE hConsoleOutput, WORD wAttributes) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_SETTEXTATTRIB SetTextAttribRequest = &ApiMessage.Data.SetTextAttribRequest; - ApiMessage.Data.SetTextAttribRequest.OutputHandle = hConsoleOutput; - ApiMessage.Data.SetTextAttribRequest.Attrib = wAttributes; + SetTextAttribRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetTextAttribRequest->OutputHandle = hConsoleOutput; + SetTextAttribRequest->Attributes = wAttributes; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetTextAttribute), - sizeof(CONSOLE_SETTEXTATTRIB)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetTextAttribute), + sizeof(*SetTextAttribRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -1677,8 +1686,8 @@ WINAPI GenerateConsoleCtrlEvent(DWORD dwCtrlEvent, DWORD dwProcessGroupId) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_GENERATECTRLEVENT GenerateCtrlEventRequest = &ApiMessage.Data.GenerateCtrlEventRequest; if (dwCtrlEvent != CTRL_C_EVENT && dwCtrlEvent != CTRL_BREAK_EVENT) { @@ -1686,16 +1695,17 @@ GenerateConsoleCtrlEvent(DWORD dwCtrlEvent, return FALSE; } - ApiMessage.Data.GenerateCtrlEventRequest.Event = dwCtrlEvent; - ApiMessage.Data.GenerateCtrlEventRequest.ProcessGroup = dwProcessGroupId; + GenerateCtrlEventRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + GenerateCtrlEventRequest->CtrlEvent = dwCtrlEvent; + GenerateCtrlEventRequest->ProcessGroupId = dwProcessGroupId; - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - NULL, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGenerateCtrlEvent), - sizeof(CONSOLE_GENERATECTRLEVENT)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGenerateCtrlEvent), + sizeof(*GenerateCtrlEventRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } @@ -1704,16 +1714,18 @@ GenerateConsoleCtrlEvent(DWORD dwCtrlEvent, static DWORD -IntGetConsoleTitle(LPVOID lpConsoleTitle, DWORD nSize, BOOL bUnicode) +IntGetConsoleTitle(LPVOID lpConsoleTitle, DWORD dwNumChars, BOOLEAN bUnicode) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_GETSETCONSOLETITLE TitleRequest = &ApiMessage.Data.TitleRequest; PCSR_CAPTURE_BUFFER CaptureBuffer; - if (nSize == 0) return 0; + if (dwNumChars == 0) return 0; + + TitleRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + TitleRequest->Length = dwNumChars * (bUnicode ? sizeof(WCHAR) : sizeof(CHAR)); + TitleRequest->Unicode = bUnicode; - TitleRequest->Length = nSize * (bUnicode ? 1 : sizeof(WCHAR)); CaptureBuffer = CsrAllocateCaptureBuffer(1, TitleRequest->Length); if (CaptureBuffer == NULL) { @@ -1726,42 +1738,32 @@ IntGetConsoleTitle(LPVOID lpConsoleTitle, DWORD nSize, BOOL bUnicode) TitleRequest->Length, (PVOID*)&TitleRequest->Title); - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - CaptureBuffer, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetTitle), - sizeof(CONSOLE_GETSETCONSOLETITLE)); - if (!NT_SUCCESS(Status)) + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + CaptureBuffer, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetTitle), + sizeof(*TitleRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) { CsrFreeCaptureBuffer(CaptureBuffer); - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return 0; } - if (bUnicode) + dwNumChars = TitleRequest->Length / (bUnicode ? sizeof(WCHAR) : sizeof(CHAR)); + + if (dwNumChars > 0) { - if (nSize >= sizeof(WCHAR)) - wcscpy((LPWSTR)lpConsoleTitle, TitleRequest->Title); - } - else - { - if (nSize < TitleRequest->Length / sizeof(WCHAR) || - !WideCharToMultiByte(CP_ACP, // ANSI code page - 0, // performance and mapping flags - TitleRequest->Title, // address of wide-character string - -1, // number of characters in string - (LPSTR)lpConsoleTitle, // address of buffer for new string - nSize, // size of buffer - NULL, // FAST - NULL)) - { - /* Yes, if the buffer isn't big enough, it returns 0... Bad API */ - *(LPSTR)lpConsoleTitle = '\0'; - TitleRequest->Length = 0; - } + memcpy(lpConsoleTitle, TitleRequest->Title, TitleRequest->Length); + + if (bUnicode) + ((LPWSTR)lpConsoleTitle)[dwNumChars] = L'\0'; + else + ((LPSTR)lpConsoleTitle)[dwNumChars] = '\0'; } + CsrFreeCaptureBuffer(CaptureBuffer); - return TitleRequest->Length / sizeof(WCHAR); + return dwNumChars; } @@ -1793,21 +1795,16 @@ GetConsoleTitleA(LPSTR lpConsoleTitle, } -/*-------------------------------------------------------------- - * SetConsoleTitleW - * - * @implemented - */ -BOOL -WINAPI -SetConsoleTitleW(LPCWSTR lpConsoleTitle) +static BOOL +IntSetConsoleTitle(CONST VOID *lpConsoleTitle, DWORD dwNumChars, BOOLEAN bUnicode) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_GETSETCONSOLETITLE TitleRequest = &ApiMessage.Data.TitleRequest; PCSR_CAPTURE_BUFFER CaptureBuffer; - TitleRequest->Length = wcslen(lpConsoleTitle) * sizeof(WCHAR); + TitleRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + TitleRequest->Length = dwNumChars * (bUnicode ? sizeof(WCHAR) : sizeof(CHAR)); + TitleRequest->Unicode = bUnicode; CaptureBuffer = CsrAllocateCaptureBuffer(1, TitleRequest->Length); if (CaptureBuffer == NULL) @@ -1822,22 +1819,34 @@ SetConsoleTitleW(LPCWSTR lpConsoleTitle) TitleRequest->Length, (PVOID*)&TitleRequest->Title); - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - CaptureBuffer, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetTitle), - sizeof(CONSOLE_GETSETCONSOLETITLE)); + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + CaptureBuffer, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetTitle), + sizeof(*TitleRequest)); CsrFreeCaptureBuffer(CaptureBuffer); - if (!NT_SUCCESS(Status)) + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return FALSE; } return TRUE; } +/*-------------------------------------------------------------- + * SetConsoleTitleW + * + * @implemented + */ +BOOL +WINAPI +SetConsoleTitleW(LPCWSTR lpConsoleTitle) +{ + return IntSetConsoleTitle(lpConsoleTitle, wcslen(lpConsoleTitle), TRUE); +} + /*-------------------------------------------------------------- * SetConsoleTitleA @@ -1848,22 +1857,7 @@ BOOL WINAPI SetConsoleTitleA(LPCSTR lpConsoleTitle) { - BOOL Ret; - ULONG Length = strlen(lpConsoleTitle) + 1; - LPWSTR WideTitle = HeapAlloc(GetProcessHeap(), 0, Length * sizeof(WCHAR)); - - if (!WideTitle) - { - SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; - } - - MultiByteToWideChar(CP_ACP, 0, lpConsoleTitle, -1, WideTitle, Length); - - Ret = SetConsoleTitleW(WideTitle); - - HeapFree(GetProcessHeap(), 0, WideTitle); - return Ret; + return IntSetConsoleTitle(lpConsoleTitle, strlen(lpConsoleTitle), FALSE); } @@ -2160,6 +2154,7 @@ GetConsoleSelectionInfo(PCONSOLE_SELECTION_INFO lpConsoleSelectionInfo) } *lpConsoleSelectionInfo = GetSelectionInfoRequest->Info; + return TRUE; } diff --git a/reactos/include/reactos/subsys/win/conmsg.h b/reactos/include/reactos/subsys/win/conmsg.h index 04bb3bd65b5..b6481a9ff06 100644 --- a/reactos/include/reactos/subsys/win/conmsg.h +++ b/reactos/include/reactos/subsys/win/conmsg.h @@ -274,8 +274,9 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; - COORD Position; + COORD Position; } CONSOLE_SETCURSORPOSITION, *PCONSOLE_SETCURSORPOSITION; typedef struct @@ -295,20 +296,27 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; CONSOLE_CURSOR_INFO Info; +/* + DWORD Size; + BOOLEAN Visible; +*/ } CONSOLE_GETSETCURSORINFO, *PCONSOLE_GETSETCURSORINFO; typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; - WORD Attrib; + WORD Attributes; } CONSOLE_SETTEXTATTRIB, *PCONSOLE_SETTEXTATTRIB; typedef struct { - HANDLE ConsoleHandle; /* A valid input or output console handle */ - DWORD ConsoleMode; + HANDLE ConsoleHandle; + HANDLE Handle; + DWORD Mode; } CONSOLE_GETSETCONSOLEMODE, *PCONSOLE_GETSETCONSOLEMODE; typedef struct @@ -358,6 +366,7 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; /* Handle to screen buffer to switch to */ } CONSOLE_SETACTIVESCREENBUFFER, *PCONSOLE_SETACTIVESCREENBUFFER; @@ -378,8 +387,10 @@ typedef struct typedef struct { - DWORD Length; - PWCHAR Title; + HANDLE ConsoleHandle; + DWORD Length; + PVOID Title; + BOOLEAN Unicode; } CONSOLE_GETSETCONSOLETITLE, *PCONSOLE_GETSETCONSOLETITLE; typedef struct @@ -395,6 +406,7 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE InputHandle; } CONSOLE_FLUSHINPUTBUFFER, *PCONSOLE_FLUSHINPUTBUFFER; @@ -527,10 +539,12 @@ typedef struct typedef struct { - HANDLE ConsoleHandle; - DWORD Access; - BOOL Inheritable; - DWORD Options; + HANDLE ConsoleHandle; + HANDLE SourceHandle; + DWORD DesiredAccess; + BOOLEAN InheritHandle; + DWORD Options; + HANDLE TargetHandle; } CONSOLE_DUPLICATEHANDLE, *PCONSOLE_DUPLICATEHANDLE; /* @@ -546,14 +560,16 @@ typedef struct { HANDLE ConsoleHandle; CONSOLE_HANDLE_TYPE HandleType; - DWORD Access; - BOOL Inheritable; - DWORD ShareMode; + DWORD DesiredAccess; + BOOL InheritHandle; + DWORD ShareMode; + HANDLE Handle; } CONSOLE_OPENCONSOLE, *PCONSOLE_OPENCONSOLE; typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; COORD Size; } CONSOLE_GETLARGESTWINDOWSIZE, *PCONSOLE_GETLARGESTWINDOWSIZE; @@ -575,6 +591,7 @@ typedef struct typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; BOOL Absolute; SMALL_RECT WindowRect; // New console window position in the screen-buffer frame (Absolute == TRUE) @@ -668,20 +685,23 @@ typedef struct typedef struct { - DWORD Event; - DWORD ProcessGroup; + HANDLE ConsoleHandle; + DWORD CtrlEvent; + DWORD ProcessGroupId; } CONSOLE_GENERATECTRLEVENT, *PCONSOLE_GENERATECTRLEVENT; typedef struct { + HANDLE ConsoleHandle; HANDLE InputHandle; - DWORD NumInputEvents; + DWORD NumberOfEvents; } CONSOLE_GETNUMINPUTEVENTS, *PCONSOLE_GETNUMINPUTEVENTS; typedef struct { + HANDLE ConsoleHandle; HANDLE OutputHandle; - COORD Size; + COORD Size; } CONSOLE_SETSCREENBUFFERSIZE, *PCONSOLE_SETSCREENBUFFERSIZE; typedef struct diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c b/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c index eaf94a8a19a..27c6b3670c6 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/coninput.c @@ -519,24 +519,24 @@ ConDrvFlushConsoleInputBuffer(IN PCONSOLE Console, NTSTATUS NTAPI ConDrvGetConsoleNumberOfInputEvents(IN PCONSOLE Console, IN PCONSOLE_INPUT_BUFFER InputBuffer, - OUT PULONG NumEvents) + OUT PULONG NumberOfEvents) { PLIST_ENTRY CurrentInput; - if (Console == NULL || InputBuffer == NULL || NumEvents == NULL) + if (Console == NULL || InputBuffer == NULL || NumberOfEvents == NULL) return STATUS_INVALID_PARAMETER; /* Validity check */ ASSERT(Console == InputBuffer->Header.Console); - *NumEvents = 0; + *NumberOfEvents = 0; /* If there are any events ... */ CurrentInput = InputBuffer->InputEvents.Flink; while (CurrentInput != &InputBuffer->InputEvents) { CurrentInput = CurrentInput->Flink; - (*NumEvents)++; + (*NumberOfEvents)++; } return STATUS_SUCCESS; diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/console.c b/reactos/win32ss/user/winsrv/consrv/condrv/console.c index e756eb526cb..b4b1111de48 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/console.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/console.c @@ -197,7 +197,7 @@ VOID ResetFrontEnd(IN PCONSOLE Console); /* PRIVATE FUNCTIONS **********************************************************/ static NTSTATUS -ConDrvConsoleCtrlEventTimeout(IN ULONG Event, +ConDrvConsoleCtrlEventTimeout(IN ULONG CtrlEvent, IN PCONSOLE_PROCESS_DATA ProcessData, IN ULONG Timeout) { @@ -215,7 +215,7 @@ ConDrvConsoleCtrlEventTimeout(IN ULONG Event, { Thread = CreateRemoteThread(ProcessData->Process->ProcessHandle, NULL, 0, ProcessData->CtrlDispatcher, - UlongToPtr(Event), 0, NULL); + UlongToPtr(CtrlEvent), 0, NULL); if (NULL == Thread) { Status = RtlGetLastNtStatus(); @@ -245,10 +245,10 @@ ConDrvConsoleCtrlEventTimeout(IN ULONG Event, } static NTSTATUS -ConDrvConsoleCtrlEvent(IN ULONG Event, +ConDrvConsoleCtrlEvent(IN ULONG CtrlEvent, IN PCONSOLE_PROCESS_DATA ProcessData) { - return ConDrvConsoleCtrlEventTimeout(Event, ProcessData, 0); + return ConDrvConsoleCtrlEventTimeout(CtrlEvent, ProcessData, 0); } VOID FASTCALL @@ -879,7 +879,8 @@ ConDrvSetConsoleMode(IN PCONSOLE Console, IN PCONSOLE_IO_OBJECT Object, IN ULONG ConsoleMode) { -#define CONSOLE_VALID_CONTROL_MODES ( ENABLE_EXTENDED_FLAGS | ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE ) +#define CONSOLE_VALID_CONTROL_MODES ( ENABLE_EXTENDED_FLAGS | \ + ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE ) #define CONSOLE_VALID_INPUT_MODES ( ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | \ ENABLE_ECHO_INPUT | ENABLE_WINDOW_INPUT | \ ENABLE_MOUSE_INPUT ) @@ -956,39 +957,80 @@ Quit: NTSTATUS NTAPI ConDrvGetConsoleTitle(IN PCONSOLE Console, - IN OUT PWCHAR Title, + IN BOOLEAN Unicode, + IN OUT PVOID TitleBuffer, IN OUT PULONG BufLength) { ULONG Length; - if (Console == NULL || Title == NULL || BufLength == NULL) + if (Console == NULL || TitleBuffer == NULL || BufLength == NULL) return STATUS_INVALID_PARAMETER; /* Copy title of the console to the user title buffer */ - if (*BufLength >= sizeof(WCHAR)) + if (Unicode) { - Length = min(*BufLength - sizeof(WCHAR), Console->Title.Length); - RtlCopyMemory(Title, Console->Title.Buffer, Length); - Title[Length / sizeof(WCHAR)] = L'\0'; + if (*BufLength >= sizeof(WCHAR)) + { + Length = min(*BufLength - sizeof(WCHAR), Console->Title.Length); + RtlCopyMemory(TitleBuffer, Console->Title.Buffer, Length); + ((PWCHAR)TitleBuffer)[Length / sizeof(WCHAR)] = L'\0'; + *BufLength = Length; + } + else + { + *BufLength = Console->Title.Length; + } + } + else + { + if (*BufLength >= sizeof(CHAR)) + { + Length = min(*BufLength - sizeof(CHAR), Console->Title.Length / sizeof(WCHAR)); + Length = WideCharToMultiByte(Console->CodePage, 0, + Console->Title.Buffer, Length, + TitleBuffer, Length, + NULL, NULL); + ((PCHAR)TitleBuffer)[Length] = '\0'; + *BufLength = Length; + } + else + { + *BufLength = Console->Title.Length / sizeof(WCHAR); + } } - - *BufLength = Console->Title.Length; return STATUS_SUCCESS; } NTSTATUS NTAPI ConDrvSetConsoleTitle(IN PCONSOLE Console, - IN PWCHAR Title, + IN BOOLEAN Unicode, + IN PVOID TitleBuffer, IN ULONG BufLength) { PWCHAR Buffer; + ULONG Length; - if (Console == NULL || Title == NULL) + if (Console == NULL || TitleBuffer == NULL) return STATUS_INVALID_PARAMETER; + if (Unicode) + { + /* Length is in bytes */ + Length = BufLength; + } + else + { + /* Use the console input CP for the conversion */ + Length = MultiByteToWideChar(Console->CodePage, 0, + TitleBuffer, BufLength, + NULL, 0); + /* The returned Length was in number of wchars, convert it in bytes */ + Length *= sizeof(WCHAR); + } + /* Allocate a new buffer to hold the new title (NULL-terminated) */ - Buffer = ConsoleAllocHeap(0, BufLength + sizeof(WCHAR)); + Buffer = ConsoleAllocHeap(HEAP_ZERO_MEMORY, Length + sizeof(WCHAR)); if (!Buffer) return STATUS_NO_MEMORY; /* Free the old title */ @@ -996,9 +1038,22 @@ ConDrvSetConsoleTitle(IN PCONSOLE Console, /* Copy title to console */ Console->Title.Buffer = Buffer; - Console->Title.Length = BufLength; + Console->Title.Length = Length; Console->Title.MaximumLength = Console->Title.Length + sizeof(WCHAR); - RtlCopyMemory(Console->Title.Buffer, Title, Console->Title.Length); + + if (Unicode) + { + RtlCopyMemory(Console->Title.Buffer, TitleBuffer, Console->Title.Length); + } + else + { + MultiByteToWideChar(Console->CodePage, 0, + TitleBuffer, BufLength, + Console->Title.Buffer, + Console->Title.Length / sizeof(WCHAR)); + } + + /* NULL-terminate */ Console->Title.Buffer[Console->Title.Length / sizeof(WCHAR)] = L'\0'; // TermChangeTitle(Console); @@ -1066,7 +1121,7 @@ ConDrvGetConsoleProcessList(IN PCONSOLE Console, NTSTATUS NTAPI ConDrvConsoleProcessCtrlEvent(IN PCONSOLE Console, IN ULONG ProcessGroupId, - IN ULONG Event) + IN ULONG CtrlEvent) { NTSTATUS Status = STATUS_SUCCESS; PLIST_ENTRY current_entry; @@ -1094,7 +1149,7 @@ ConDrvConsoleProcessCtrlEvent(IN PCONSOLE Console, */ if (ProcessGroupId == 0 || current->Process->ProcessGroupId == ProcessGroupId) { - Status = ConDrvConsoleCtrlEvent(Event, current); + Status = ConDrvConsoleCtrlEvent(CtrlEvent, current); } } diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/text.c b/reactos/win32ss/user/winsrv/consrv/condrv/text.c index fe99b38e67d..da6459d3e7c 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/text.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/text.c @@ -1259,7 +1259,7 @@ ConDrvGetConsoleScreenBufferInfo(IN PCONSOLE Console, NTSTATUS NTAPI ConDrvSetConsoleTextAttribute(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, - IN WORD Attribute) + IN WORD Attributes) { if (Console == NULL || Buffer == NULL) return STATUS_INVALID_PARAMETER; @@ -1267,7 +1267,7 @@ ConDrvSetConsoleTextAttribute(IN PCONSOLE Console, /* Validity check */ ASSERT(Console == Buffer->Header.Console); - Buffer->ScreenDefaultAttrib = Attribute; + Buffer->ScreenDefaultAttrib = Attributes; return STATUS_SUCCESS; } diff --git a/reactos/win32ss/user/winsrv/consrv/coninput.c b/reactos/win32ss/user/winsrv/consrv/coninput.c index d0b01e25b1b..97e1ee560dc 100644 --- a/reactos/win32ss/user/winsrv/consrv/coninput.c +++ b/reactos/win32ss/user/winsrv/consrv/coninput.c @@ -444,7 +444,7 @@ CSR_API(SrvFlushConsoleInputBuffer) NTSTATUS NTAPI ConDrvGetConsoleNumberOfInputEvents(IN PCONSOLE Console, IN PCONSOLE_INPUT_BUFFER InputBuffer, - OUT PULONG NumEvents); + OUT PULONG NumberOfEvents); CSR_API(SrvGetConsoleNumberOfInputEvents) { NTSTATUS Status; @@ -460,7 +460,7 @@ CSR_API(SrvGetConsoleNumberOfInputEvents) Status = ConDrvGetConsoleNumberOfInputEvents(InputBuffer->Header.Console, InputBuffer, - &GetNumInputEventsRequest->NumInputEvents); + &GetNumInputEventsRequest->NumberOfEvents); ConSrvReleaseInputBuffer(InputBuffer, TRUE); return Status; diff --git a/reactos/win32ss/user/winsrv/consrv/conoutput.c b/reactos/win32ss/user/winsrv/consrv/conoutput.c index fe04b8bd5fc..9c01dd4241d 100644 --- a/reactos/win32ss/user/winsrv/consrv/conoutput.c +++ b/reactos/win32ss/user/winsrv/consrv/conoutput.c @@ -720,7 +720,7 @@ CSR_API(SrvGetConsoleScreenBufferInfo) NTSTATUS NTAPI ConDrvSetConsoleTextAttribute(IN PCONSOLE Console, IN PTEXTMODE_SCREEN_BUFFER Buffer, - IN WORD Attribute); + IN WORD Attributes); CSR_API(SrvSetConsoleTextAttribute) { NTSTATUS Status; @@ -736,7 +736,7 @@ CSR_API(SrvSetConsoleTextAttribute) Status = ConDrvSetConsoleTextAttribute(Buffer->Header.Console, Buffer, - SetTextAttribRequest->Attrib); + SetTextAttribRequest->Attributes); ConSrvReleaseScreenBuffer(Buffer, TRUE); return Status; diff --git a/reactos/win32ss/user/winsrv/consrv/console.c b/reactos/win32ss/user/winsrv/consrv/console.c index 8cc401abe5b..8ecd567fa7b 100644 --- a/reactos/win32ss/user/winsrv/consrv/console.c +++ b/reactos/win32ss/user/winsrv/consrv/console.c @@ -439,12 +439,12 @@ CSR_API(SrvGetConsoleMode) PCONSOLE_IO_OBJECT Object; Status = ConSrvGetObject(ConsoleGetPerProcessData(CsrGetClientThread()->Process), - ConsoleModeRequest->ConsoleHandle, + ConsoleModeRequest->Handle, &Object, NULL, GENERIC_READ, TRUE, 0); if (!NT_SUCCESS(Status)) return Status; Status = ConDrvGetConsoleMode(Object->Console, Object, - &ConsoleModeRequest->ConsoleMode); + &ConsoleModeRequest->Mode); ConSrvReleaseObject(Object, TRUE); return Status; @@ -461,12 +461,12 @@ CSR_API(SrvSetConsoleMode) PCONSOLE_IO_OBJECT Object; Status = ConSrvGetObject(ConsoleGetPerProcessData(CsrGetClientThread()->Process), - ConsoleModeRequest->ConsoleHandle, + ConsoleModeRequest->Handle, &Object, NULL, GENERIC_WRITE, TRUE, 0); if (!NT_SUCCESS(Status)) return Status; Status = ConDrvSetConsoleMode(Object->Console, Object, - ConsoleModeRequest->ConsoleMode); + ConsoleModeRequest->Mode); ConSrvReleaseObject(Object, TRUE); return Status; @@ -474,7 +474,8 @@ CSR_API(SrvSetConsoleMode) NTSTATUS NTAPI ConDrvGetConsoleTitle(IN PCONSOLE Console, - IN OUT PWCHAR Title, + IN BOOLEAN Unicode, + IN OUT PVOID TitleBuffer, IN OUT PULONG BufLength); CSR_API(SrvGetConsoleTitle) { @@ -498,6 +499,7 @@ CSR_API(SrvGetConsoleTitle) } Status = ConDrvGetConsoleTitle(Console, + TitleRequest->Unicode, TitleRequest->Title, &TitleRequest->Length); @@ -507,7 +509,8 @@ CSR_API(SrvGetConsoleTitle) NTSTATUS NTAPI ConDrvSetConsoleTitle(IN PCONSOLE Console, - IN PWCHAR Title, + IN BOOLEAN Unicode, + IN PVOID TitleBuffer, IN ULONG BufLength); CSR_API(SrvSetConsoleTitle) { @@ -531,9 +534,9 @@ CSR_API(SrvSetConsoleTitle) } Status = ConDrvSetConsoleTitle(Console, + TitleRequest->Unicode, TitleRequest->Title, TitleRequest->Length); - if (NT_SUCCESS(Status)) TermChangeTitle(Console); ConSrvReleaseConsole(Console, TRUE); @@ -629,8 +632,8 @@ CSR_API(SrvGenerateConsoleCtrlEvent) if (!NT_SUCCESS(Status)) return Status; Status = ConDrvConsoleProcessCtrlEvent(Console, - GenerateCtrlEventRequest->ProcessGroup, - GenerateCtrlEventRequest->Event); + GenerateCtrlEventRequest->ProcessGroupId, + GenerateCtrlEventRequest->CtrlEvent); ConSrvReleaseConsole(Console, TRUE); return Status; diff --git a/reactos/win32ss/user/winsrv/consrv/handle.c b/reactos/win32ss/user/winsrv/consrv/handle.c index 9f268d2513c..6ad1cdf8789 100644 --- a/reactos/win32ss/user/winsrv/consrv/handle.c +++ b/reactos/win32ss/user/winsrv/consrv/handle.c @@ -688,11 +688,11 @@ CSR_API(SrvOpenConsole) PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); PCONSOLE Console; - DWORD DesiredAccess = OpenConsoleRequest->Access; + DWORD DesiredAccess = OpenConsoleRequest->DesiredAccess; DWORD ShareMode = OpenConsoleRequest->ShareMode; PCONSOLE_IO_OBJECT Object; - OpenConsoleRequest->ConsoleHandle = INVALID_HANDLE_VALUE; + OpenConsoleRequest->Handle = INVALID_HANDLE_VALUE; Status = ConSrvGetConsole(ProcessData, &Console, TRUE); if (!NT_SUCCESS(Status)) @@ -726,10 +726,10 @@ CSR_API(SrvOpenConsole) else { Status = ConSrvInsertObject(ProcessData, - &OpenConsoleRequest->ConsoleHandle, + &OpenConsoleRequest->Handle, Object, DesiredAccess, - OpenConsoleRequest->Inheritable, + OpenConsoleRequest->InheritHandle, ShareMode); } @@ -746,11 +746,13 @@ CSR_API(SrvDuplicateHandle) PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); PCONSOLE Console; - HANDLE ConsoleHandle = DuplicateHandleRequest->ConsoleHandle; - ULONG Index = HandleToULong(ConsoleHandle) >> 2; + HANDLE SourceHandle = DuplicateHandleRequest->SourceHandle; + ULONG Index = HandleToULong(SourceHandle) >> 2; PCONSOLE_IO_HANDLE Entry; DWORD DesiredAccess; + DuplicateHandleRequest->TargetHandle = INVALID_HANDLE_VALUE; + Status = ConSrvGetConsole(ProcessData, &Console, TRUE); if (!NT_SUCCESS(Status)) { @@ -763,11 +765,11 @@ CSR_API(SrvDuplicateHandle) // ASSERT( (ProcessData->HandleTable == NULL && ProcessData->HandleTableSize == 0) || // (ProcessData->HandleTable != NULL && ProcessData->HandleTableSize != 0) ); - if ( /** !IsConsoleHandle(ConsoleHandle) || **/ + if ( /** !IsConsoleHandle(SourceHandle) || **/ Index >= ProcessData->HandleTableSize || (Entry = &ProcessData->HandleTable[Index])->Object == NULL) { - DPRINT1("Couldn't duplicate invalid handle %p\n", ConsoleHandle); + DPRINT1("Couldn't duplicate invalid handle 0x%p\n", SourceHandle); Status = STATUS_INVALID_HANDLE; goto Quit; } @@ -778,12 +780,12 @@ CSR_API(SrvDuplicateHandle) } else { - DesiredAccess = DuplicateHandleRequest->Access; + DesiredAccess = DuplicateHandleRequest->DesiredAccess; /* Make sure the source handle has all the desired flags */ if ((Entry->Access & DesiredAccess) == 0) { - DPRINT1("Handle %p only has access %X; requested %X\n", - ConsoleHandle, Entry->Access, DesiredAccess); + DPRINT1("Handle 0x%p only has access %X; requested %X\n", + SourceHandle, Entry->Access, DesiredAccess); Status = STATUS_INVALID_PARAMETER; goto Quit; } @@ -791,10 +793,10 @@ CSR_API(SrvDuplicateHandle) /* Insert the new handle inside the process handles table */ Status = ConSrvInsertObject(ProcessData, - &DuplicateHandleRequest->ConsoleHandle, // Use the new handle value! + &DuplicateHandleRequest->TargetHandle, Entry->Object, DesiredAccess, - DuplicateHandleRequest->Inheritable, + DuplicateHandleRequest->InheritHandle, Entry->ShareMode); if (NT_SUCCESS(Status) && (DuplicateHandleRequest->Options & DUPLICATE_CLOSE_SOURCE)) diff --git a/reactos/win32ss/user/winsrv/consrv/include/conio.h b/reactos/win32ss/user/winsrv/consrv/include/conio.h index a60e95f8ca6..30a70eaae60 100644 --- a/reactos/win32ss/user/winsrv/consrv/include/conio.h +++ b/reactos/win32ss/user/winsrv/consrv/include/conio.h @@ -344,7 +344,7 @@ VOID FASTCALL ConioUnpause(PCONSOLE Console, UINT Flags); NTSTATUS NTAPI ConDrvConsoleProcessCtrlEvent(IN PCONSOLE Console, IN ULONG ProcessGroupId, - IN ULONG Event); + IN ULONG CtrlEvent); /* coninput.c */ VOID NTAPI ConioProcessKey(PCONSOLE Console, MSG* msg); From ca20207552b22ca9497d56d3b5e0efff9784c929 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 12:37:05 +0000 Subject: [PATCH 406/419] [SETUPAPI_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62834 --- rostests/winetests/setupapi/devclass.c | 1 + rostests/winetests/setupapi/devinst.c | 196 +++++++++++----------- rostests/winetests/setupapi/diskspace.c | 8 +- rostests/winetests/setupapi/install.c | 80 ++++----- rostests/winetests/setupapi/misc.c | 60 +++---- rostests/winetests/setupapi/parser.c | 60 +++---- rostests/winetests/setupapi/query.c | 4 +- rostests/winetests/setupapi/setupcab.c | 4 +- rostests/winetests/setupapi/stringtable.c | 4 - 9 files changed, 210 insertions(+), 207 deletions(-) diff --git a/rostests/winetests/setupapi/devclass.c b/rostests/winetests/setupapi/devclass.c index b525c980b57..63e8985c124 100644 --- a/rostests/winetests/setupapi/devclass.c +++ b/rostests/winetests/setupapi/devclass.c @@ -22,6 +22,7 @@ #include #include +#undef __WINESRC__ #undef __ROS_LONG64__ #include "windef.h" #include "winbase.h" diff --git a/rostests/winetests/setupapi/devinst.c b/rostests/winetests/setupapi/devinst.c index f21f1efb2f0..fe729b9e5bd 100644 --- a/rostests/winetests/setupapi/devinst.c +++ b/rostests/winetests/setupapi/devinst.c @@ -52,8 +52,8 @@ static BOOL (WINAPI *pSetupDiGetDeviceInstanceIdA)(HDEVINFO, PSP_DEVINFO_DAT static BOOL (WINAPI *pSetupDiGetDeviceInterfaceDetailA)(HDEVINFO, PSP_DEVICE_INTERFACE_DATA, PSP_DEVICE_INTERFACE_DETAIL_DATA_A, DWORD, PDWORD, PSP_DEVINFO_DATA); static BOOL (WINAPI *pSetupDiGetDeviceInterfaceDetailW)(HDEVINFO, PSP_DEVICE_INTERFACE_DATA, PSP_DEVICE_INTERFACE_DETAIL_DATA_W, DWORD, PDWORD, PSP_DEVINFO_DATA); static BOOL (WINAPI *pSetupDiRegisterDeviceInfo)(HDEVINFO, PSP_DEVINFO_DATA, DWORD, PSP_DETSIG_CMPPROC, PVOID, PSP_DEVINFO_DATA); -static HDEVINFO (WINAPI *pSetupDiGetClassDevsA)(CONST GUID *, LPCSTR, HWND, DWORD); -static HDEVINFO (WINAPI *pSetupDiGetClassDevsW)(CONST GUID *, LPCWSTR, HWND, DWORD); +static HDEVINFO (WINAPI *pSetupDiGetClassDevsA)(const GUID *, LPCSTR, HWND, DWORD); +static HDEVINFO (WINAPI *pSetupDiGetClassDevsW)(const GUID *, LPCWSTR, HWND, DWORD); static BOOL (WINAPI *pSetupDiSetDeviceRegistryPropertyA)(HDEVINFO, PSP_DEVINFO_DATA, DWORD, const BYTE *, DWORD); static BOOL (WINAPI *pSetupDiSetDeviceRegistryPropertyW)(HDEVINFO, PSP_DEVINFO_DATA, DWORD, const BYTE *, DWORD); static BOOL (WINAPI *pSetupDiGetDeviceRegistryPropertyA)(HDEVINFO, PSP_DEVINFO_DATA, DWORD, PDWORD, PBYTE, DWORD, PDWORD); @@ -241,7 +241,7 @@ static void clean_devclass_key(void) * the keys under the DeviceClasses key after a SetupDiDestroyDeviceInfoList. */ RegOpenKeyW(HKEY_LOCAL_MACHINE, devclass, &key); - RegQueryInfoKey(key, NULL, NULL, NULL, &subkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + RegQueryInfoKeyW(key, NULL, NULL, NULL, &subkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL); if (subkeys > 0) { trace("We are most likely on Windows 2000\n"); @@ -342,8 +342,8 @@ static void test_SetupDiOpenClassRegKeyExA(void) static void create_inf_file(LPCSTR filename) { DWORD dwNumberOfBytesWritten; - HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE hf = CreateFileA(filename, GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); static const char data[] = "[Version]\n" @@ -410,7 +410,7 @@ static void testInstallClass(void) ok(!RegDeleteKeyW(HKEY_LOCAL_MACHINE, classKey), "Couldn't delete classkey\n"); - DeleteFile(tmpfile); + DeleteFileA(tmpfile); } static void testCreateDeviceInfo(void) @@ -533,7 +533,7 @@ static void testCreateDeviceInfo(void) DWORD subkeys; /* Check if we have subkeys */ - RegQueryInfoKey(key, NULL, NULL, NULL, &subkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + RegQueryInfoKeyA(key, NULL, NULL, NULL, &subkeys, NULL, NULL, NULL, NULL, NULL, NULL, NULL); if (subkeys > 0) { int i; @@ -1370,6 +1370,7 @@ static void testSetupDiGetINFClassA(void) { static const char inffile[] = "winetest.inf"; static const char content[] = "[Version]\r\n\r\n"; + static const char* signatures[] = {"\"$CHICAGO$\"", "\"$Windows NT$\""}; char cn[MAX_PATH]; char filename[MAX_PATH]; @@ -1377,6 +1378,7 @@ static void testSetupDiGetINFClassA(void) BOOL retval; GUID guid; HANDLE h; + int i; if(!pSetupDiGetINFClassA) { @@ -1444,96 +1446,100 @@ static void testSetupDiGetINFClassA(void) retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); - h = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, NULL); - if(h == INVALID_HANDLE_VALUE) + for(i=0; i < sizeof(signatures)/sizeof(char*); i++) { - win_skip("failed to create file %s (error %u)\n", filename, GetLastError()); - return; + trace("testing signarture %s\n", signatures[i]); + h = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + if(h == INVALID_HANDLE_VALUE) + { + win_skip("failed to create file %s (error %u)\n", filename, GetLastError()); + return; + } + WriteFile( h, content, sizeof(content), &count, NULL); + CloseHandle( h); + + retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); + ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); + + WritePrivateProfileStringA("Version", "Signature", signatures[i], filename); + + retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); + ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); + + WritePrivateProfileStringA("Version", "Class", "WINE", filename); + + count = 0xdeadbeef; + retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); + ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError()); + ok(count == 5, "expected count==5, got %u\n", count); + + count = 0xdeadbeef; + retval = SetupDiGetINFClassA(filename, &guid, cn, 5, &count); + ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError()); + ok(count == 5, "expected count==5, got %u\n", count); + + count = 0xdeadbeef; + SetLastError(0xdeadbeef); + retval = SetupDiGetINFClassA(filename, &guid, cn, 4, &count); + ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); + ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), + "expected error ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); + ok(count == 5, "expected count==5, got %u\n", count); + + /* invalid parameter */ + SetLastError(0xdeadbeef); + retval = SetupDiGetINFClassA(NULL, &guid, cn, MAX_PATH, &count); + ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); + ok(ERROR_INVALID_PARAMETER == GetLastError(), + "expected error ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + retval = SetupDiGetINFClassA(filename, NULL, cn, MAX_PATH, &count); + ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); + ok(ERROR_INVALID_PARAMETER == GetLastError(), + "expected error ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + retval = SetupDiGetINFClassA(filename, &guid, NULL, MAX_PATH, &count); + ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); + ok(ERROR_INVALID_PARAMETER == GetLastError(), + "expected error ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); + + SetLastError(0xdeadbeef); + retval = SetupDiGetINFClassA(filename, &guid, cn, 0, &count); + ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); + ok(ERROR_INSUFFICIENT_BUFFER == GetLastError() || + ERROR_INVALID_PARAMETER == GetLastError(), + "expected error ERROR_INSUFFICIENT_BUFFER or ERROR_INVALID_PARAMETER, " + "got %u\n", GetLastError()); + + DeleteFileA(filename); + + WritePrivateProfileStringA("Version", "Signature", signatures[i], filename); + WritePrivateProfileStringA("Version", "ClassGUID", "WINE", filename); + + SetLastError(0xdeadbeef); + retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); + ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); + ok(RPC_S_INVALID_STRING_UUID == GetLastError() || + ERROR_INVALID_PARAMETER == GetLastError(), + "expected error RPC_S_INVALID_STRING_UUID or ERROR_INVALID_PARAMETER, " + "got %u\n", GetLastError()); + + /* network adapter guid */ + WritePrivateProfileStringA("Version", "ClassGUID", + "{4d36e972-e325-11ce-bfc1-08002be10318}", filename); + + /* this test succeeds only if the guid is known to the system */ + count = 0xdeadbeef; + retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); + ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError()); + todo_wine + ok(count == 4, "expected count==4, got %u(%s)\n", count, cn); + + DeleteFileA(filename); } - WriteFile( h, content, sizeof(content), &count, NULL); - CloseHandle( h); - - retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); - ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); - - WritePrivateProfileStringA("Version", "Signature", "\"$CHICAGO$\"", filename); - - retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); - ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); - - WritePrivateProfileStringA("Version", "Class", "WINE", filename); - - count = 0xdeadbeef; - retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); - ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError()); - ok(count == 5, "expected count==5, got %u\n", count); - - count = 0xdeadbeef; - retval = SetupDiGetINFClassA(filename, &guid, cn, 5, &count); - ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError()); - ok(count == 5, "expected count==5, got %u\n", count); - - count = 0xdeadbeef; - SetLastError(0xdeadbeef); - retval = SetupDiGetINFClassA(filename, &guid, cn, 4, &count); - ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); - ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), - "expected error ERROR_INSUFFICIENT_BUFFER, got %u\n", GetLastError()); - ok(count == 5, "expected count==5, got %u\n", count); - - /* invalid parameter */ - SetLastError(0xdeadbeef); - retval = SetupDiGetINFClassA(NULL, &guid, cn, MAX_PATH, &count); - ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); - ok(ERROR_INVALID_PARAMETER == GetLastError(), - "expected error ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); - - SetLastError(0xdeadbeef); - retval = SetupDiGetINFClassA(filename, NULL, cn, MAX_PATH, &count); - ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); - ok(ERROR_INVALID_PARAMETER == GetLastError(), - "expected error ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); - - SetLastError(0xdeadbeef); - retval = SetupDiGetINFClassA(filename, &guid, NULL, MAX_PATH, &count); - ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); - ok(ERROR_INVALID_PARAMETER == GetLastError(), - "expected error ERROR_INVALID_PARAMETER, got %u\n", GetLastError()); - - SetLastError(0xdeadbeef); - retval = SetupDiGetINFClassA(filename, &guid, cn, 0, &count); - ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); - ok(ERROR_INSUFFICIENT_BUFFER == GetLastError() || - ERROR_INVALID_PARAMETER == GetLastError(), - "expected error ERROR_INSUFFICIENT_BUFFER or ERROR_INVALID_PARAMETER, " - "got %u\n", GetLastError()); - - DeleteFileA(filename); - - WritePrivateProfileStringA("Version", "Signature", "\"$CHICAGO$\"", filename); - WritePrivateProfileStringA("Version", "ClassGUID", "WINE", filename); - - SetLastError(0xdeadbeef); - retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); - ok(!retval, "expected SetupDiGetINFClassA to fail!\n"); - ok(RPC_S_INVALID_STRING_UUID == GetLastError() || - ERROR_INVALID_PARAMETER == GetLastError(), - "expected error RPC_S_INVALID_STRING_UUID or ERROR_INVALID_PARAMETER, " - "got %u\n", GetLastError()); - - /* network adapter guid */ - WritePrivateProfileStringA("Version", "ClassGUID", - "{4d36e972-e325-11ce-bfc1-08002be10318}", filename); - - /* this test succeeds only if the guid is known to the system */ - count = 0xdeadbeef; - retval = SetupDiGetINFClassA(filename, &guid, cn, MAX_PATH, &count); - ok(retval, "expected SetupDiGetINFClassA to succeed! error %u\n", GetLastError()); - todo_wine - ok(count == 4, "expected count==4, got %u(%s)\n", count, cn); - - DeleteFileA(filename); } START_TEST(devinst) diff --git a/rostests/winetests/setupapi/diskspace.c b/rostests/winetests/setupapi/diskspace.c index 573eb734536..4e87ea905e0 100644 --- a/rostests/winetests/setupapi/diskspace.c +++ b/rostests/winetests/setupapi/diskspace.c @@ -29,6 +29,8 @@ #include "wine/test.h" +static BOOL is_win9x; + static void test_SetupCreateDiskSpaceListA(void) { HDSKSPC ret; @@ -149,8 +151,6 @@ static void test_SetupCreateDiskSpaceListW(void) static void test_SetupDuplicateDiskSpaceListA(void) { HDSKSPC handle, duplicate; - int is_win9x = !SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0xdeadbeef, 0) && - GetLastError() == ERROR_CALL_NOT_IMPLEMENTED; if (is_win9x) win_skip("SetupDuplicateDiskSpaceListA crashes with NULL disk space handle on Win9x\n"); @@ -305,8 +305,6 @@ static void test_SetupQuerySpaceRequiredOnDriveA(void) BOOL ret; HDSKSPC handle; LONGLONG space; - int is_win9x = !SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0xdeadbeef, 0) && - GetLastError() == ERROR_CALL_NOT_IMPLEMENTED; if (is_win9x) win_skip("SetupQuerySpaceRequiredOnDriveA crashes with NULL disk space handle on Win9x\n"); @@ -476,6 +474,8 @@ static void test_SetupQuerySpaceRequiredOnDriveW(void) START_TEST(diskspace) { + is_win9x = !SetupCreateDiskSpaceListW((void *)0xdeadbeef, 0xdeadbeef, 0) && + GetLastError() == ERROR_CALL_NOT_IMPLEMENTED; test_SetupCreateDiskSpaceListA(); test_SetupCreateDiskSpaceListW(); test_SetupDuplicateDiskSpaceListA(); diff --git a/rostests/winetests/setupapi/install.c b/rostests/winetests/setupapi/install.c index a2fa00bc7a6..fdee52424fc 100644 --- a/rostests/winetests/setupapi/install.c +++ b/rostests/winetests/setupapi/install.c @@ -63,7 +63,7 @@ static BOOL (WINAPI *pSetupGetInfFileListW)(PCWSTR, DWORD, PWSTR, DWORD, PDWORD) static void create_inf_file(LPCSTR filename, const char *data) { DWORD res; - HANDLE handle = CreateFile(filename, GENERIC_WRITE, 0, NULL, + HANDLE handle = CreateFileA(filename, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); assert(handle != INVALID_HANDLE_VALUE); assert(WriteFile(handle, data, strlen(data), &res, NULL)); @@ -107,7 +107,7 @@ static void ok_registry(BOOL expectsuccess) LONG ret; /* Functional tests for success of install and clean up */ - ret = RegDeleteKey(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest"); + ret = RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest"); ok((expectsuccess && ret == ERROR_SUCCESS) || (!expectsuccess && ret == ERROR_FILE_NOT_FOUND), "Expected registry key Software\\Wine\\setupapitest to %s, RegDeleteKey returned %d\n", @@ -126,7 +126,7 @@ static void test_cmdline(void) sprintf(path, "%s\\%s", CURR_DIR, inffile); run_cmdline("DefaultInstall", 128, path); ok_registry(TRUE); - ret = DeleteFile(inffile); + ret = DeleteFileA(inffile); ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError()); /* Test handling of spaces in path, unquoted and quoted */ @@ -140,7 +140,7 @@ static void test_cmdline(void) run_cmdline("DefaultInstall", 128, path); ok_registry(FALSE); - ret = DeleteFile(infwithspaces); + ret = DeleteFileA(infwithspaces); ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError()); } @@ -180,7 +180,7 @@ static void test_registry(void) RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest\\setupapitest"); RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Wine\\setupapitest"); } - ret = DeleteFile(inffile); + ret = DeleteFileA(inffile); ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError()); } @@ -216,7 +216,7 @@ static void test_install_svc_from(void) ok(GetLastError() == ERROR_SECTION_NOT_FOUND, "Expected ERROR_SECTION_NOT_FOUND, got %08x\n", GetLastError()); SetupCloseInfFile(infhandle); - DeleteFile(inffile); + DeleteFileA(inffile); /* Add the section */ strcat(inf, "[Winetest.Services]\n"); @@ -228,7 +228,7 @@ static void test_install_svc_from(void) ok(GetLastError() == ERROR_SECTION_NOT_FOUND, "Expected ERROR_SECTION_NOT_FOUND, got %08x\n", GetLastError()); SetupCloseInfFile(infhandle); - DeleteFile(inffile); + DeleteFileA(inffile); /* Add a reference */ strcat(inf, "AddService=Winetest,,Winetest.Service\n"); @@ -240,7 +240,7 @@ static void test_install_svc_from(void) ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT, "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError()); SetupCloseInfFile(infhandle); - DeleteFile(inffile); + DeleteFileA(inffile); /* Add the section */ strcat(inf, "[Winetest.Service]\n"); @@ -252,7 +252,7 @@ static void test_install_svc_from(void) ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT, "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError()); SetupCloseInfFile(infhandle); - DeleteFile(inffile); + DeleteFileA(inffile); /* Just the ServiceBinary */ strcat(inf, "ServiceBinary=%12%\\winetest.sys\n"); @@ -264,7 +264,7 @@ static void test_install_svc_from(void) ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT, "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError()); SetupCloseInfFile(infhandle); - DeleteFile(inffile); + DeleteFileA(inffile); /* Add the ServiceType */ strcat(inf, "ServiceType=1\n"); @@ -276,7 +276,7 @@ static void test_install_svc_from(void) ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT, "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError()); SetupCloseInfFile(infhandle); - DeleteFile(inffile); + DeleteFileA(inffile); /* Add the StartType */ strcat(inf, "StartType=4\n"); @@ -288,7 +288,7 @@ static void test_install_svc_from(void) ok(GetLastError() == ERROR_BAD_SERVICE_INSTALLSECT, "Expected ERROR_BAD_SERVICE_INSTALLSECT, got %08x\n", GetLastError()); SetupCloseInfFile(infhandle); - DeleteFile(inffile); + DeleteFileA(inffile); /* This should be it, the minimal entries to install a service */ strcat(inf, "ErrorControl=1"); @@ -300,14 +300,14 @@ static void test_install_svc_from(void) { skip("Not enough rights to install the service\n"); SetupCloseInfFile(infhandle); - DeleteFile(inffile); + DeleteFileA(inffile); return; } ok(ret, "Expected success\n"); ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08x\n", GetLastError()); SetupCloseInfFile(infhandle); - DeleteFile(inffile); + DeleteFileA(inffile); scm_handle = OpenSCManagerA(NULL, NULL, GENERIC_ALL); @@ -334,7 +334,7 @@ static void test_install_svc_from(void) ok(ret, "Expected success\n"); ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %08x\n", GetLastError()); SetupCloseInfFile(infhandle); - DeleteFile(inffile); + DeleteFileA(inffile); /* TODO: Test the Flags */ } @@ -395,7 +395,7 @@ static void test_driver_install(void) run_cmdline("DefaultInstall", 128, path); /* Driver should have been installed */ - attrs = GetFileAttributes(driver); + attrs = GetFileAttributesA(driver); ok(attrs != INVALID_FILE_ATTRIBUTES, "Expected driver to exist\n"); scm_handle = OpenSCManagerA(NULL, NULL, GENERIC_ALL); @@ -412,9 +412,9 @@ static void test_driver_install(void) CloseServiceHandle(scm_handle); /* File cleanup */ - DeleteFile(inffile); - DeleteFile("winetest.sys"); - DeleteFile(driver); + DeleteFileA(inffile); + DeleteFileA("winetest.sys"); + DeleteFileA(driver); } static void test_profile_items(void) @@ -458,34 +458,34 @@ static void test_profile_items(void) run_cmdline("DefaultInstall", 128, path); snprintf(path, MAX_PATH, "%s\\TestItem.lnk", commonprogs); - if (INVALID_FILE_ATTRIBUTES == GetFileAttributes(path)) + if (INVALID_FILE_ATTRIBUTES == GetFileAttributesA(path)) { win_skip("ProfileItems not implemented on this system\n"); } else { snprintf(path, MAX_PATH, "%s\\TestDir", commonprogs); - ok(INVALID_FILE_ATTRIBUTES != GetFileAttributes(path), "directory not created\n"); + ok(INVALID_FILE_ATTRIBUTES != GetFileAttributesA(path), "directory not created\n"); snprintf(path, MAX_PATH, "%s\\TestDir\\TestItem2.lnk", commonprogs); - ok(INVALID_FILE_ATTRIBUTES != GetFileAttributes(path), "link not created\n"); + ok(INVALID_FILE_ATTRIBUTES != GetFileAttributesA(path), "link not created\n"); snprintf(path, MAX_PATH, "%s\\TestGroup", commonprogs); - ok(INVALID_FILE_ATTRIBUTES != GetFileAttributes(path), "group not created\n"); + ok(INVALID_FILE_ATTRIBUTES != GetFileAttributesA(path), "group not created\n"); } snprintf(path, MAX_PATH, "%s\\TestItem.lnk", commonprogs); - DeleteFile(path); + DeleteFileA(path); snprintf(path, MAX_PATH, "%s\\TestDir\\TestItem2.lnk", commonprogs); - DeleteFile(path); + DeleteFileA(path); snprintf(path, MAX_PATH, "%s\\TestItem2.lnk", commonprogs); - DeleteFile(path); + DeleteFileA(path); snprintf(path, MAX_PATH, "%s\\TestDir", commonprogs); - RemoveDirectory(path); + RemoveDirectoryA(path); snprintf(path, MAX_PATH, "%s\\TestGroup", commonprogs); - RemoveDirectory(path); + RemoveDirectoryA(path); cleanup: if (hShell32) FreeLibrary(hShell32); - DeleteFile(inffile); + DeleteFileA(inffile); } static void test_inffilelistA(void) @@ -541,8 +541,8 @@ static void test_inffilelistA(void) ok(!lstrcmpA(p,inffile2) || !lstrcmpA(p,inffile), "unexpected filename %s\n",p); - DeleteFile(inffile); - DeleteFile(inffile2); + DeleteFileA(inffile); + DeleteFileA(inffile2); SetCurrentDirectoryA(CURR_DIR); RemoveDirectoryA(dir); } @@ -711,22 +711,22 @@ static void test_inffilelist(void) ok(!lstrcmpW(p,inffile2W) || !lstrcmpW(p,inffileW) || !lstrcmpW(p,invalid_infW), "unexpected filename %s\n",wine_dbgstr_w(p)); - DeleteFile(inffile); - DeleteFile(inffile2); - DeleteFile(invalid_inf); + DeleteFileA(inffile); + DeleteFileA(inffile2); + DeleteFileA(invalid_inf); SetCurrentDirectoryA(CURR_DIR); RemoveDirectoryA(dirA); } START_TEST(install) { - HMODULE hsetupapi = GetModuleHandle("setupapi.dll"); + HMODULE hsetupapi = GetModuleHandleA("setupapi.dll"); char temp_path[MAX_PATH], prev_path[MAX_PATH]; DWORD len; - GetCurrentDirectory(MAX_PATH, prev_path); - GetTempPath(MAX_PATH, temp_path); - SetCurrentDirectory(temp_path); + GetCurrentDirectoryA(MAX_PATH, prev_path); + GetTempPathA(MAX_PATH, temp_path); + SetCurrentDirectoryA(temp_path); strcpy(CURR_DIR, temp_path); len = strlen(CURR_DIR); @@ -753,7 +753,7 @@ START_TEST(install) skip("InstallHinfSectionA is broken (stub)\n"); pInstallHinfSectionA = NULL; } - ret = DeleteFile(inffile); + ret = DeleteFileA(inffile); ok(ret, "Expected source inf to exist, last error was %d\n", GetLastError()); } if (!pInstallHinfSectionW && !pInstallHinfSectionA) @@ -779,5 +779,5 @@ START_TEST(install) test_inffilelist(); test_inffilelistA(); - SetCurrentDirectory(prev_path); + SetCurrentDirectoryA(prev_path); } diff --git a/rostests/winetests/setupapi/misc.c b/rostests/winetests/setupapi/misc.c index 493e6cb5747..db74fcbb26b 100644 --- a/rostests/winetests/setupapi/misc.c +++ b/rostests/winetests/setupapi/misc.c @@ -51,8 +51,8 @@ static BOOL (WINAPI *pSetupUninstallOEMInfA)(PCSTR, DWORD, PVOID); static void create_inf_file(LPCSTR filename) { DWORD dwNumberOfBytesWritten; - HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE hf = CreateFileA(filename, GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); static const char data[] = "[Version]\n" @@ -72,15 +72,15 @@ static void get_temp_filename(LPSTR path) CHAR temp[MAX_PATH]; LPSTR ptr; - GetTempFileName(CURR_DIR, "set", 0, temp); + GetTempFileNameA(CURR_DIR, "set", 0, temp); ptr = strrchr(temp, '\\'); - lstrcpy(path, ptr + 1); + strcpy(path, ptr + 1); } static BOOL file_exists(LPSTR path) { - return GetFileAttributes(path) != INVALID_FILE_ATTRIBUTES; + return GetFileAttributesA(path) != INVALID_FILE_ATTRIBUTES; } static BOOL check_format(LPSTR path, LPSTR inf) @@ -90,19 +90,19 @@ static BOOL check_format(LPSTR path, LPSTR inf) static const CHAR format[] = "\\INF\\oem"; - GetWindowsDirectory(check, MAX_PATH); - lstrcat(check, format); - res = CompareString(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, check, -1, path, lstrlen(check)) == CSTR_EQUAL && - path[lstrlen(check)] != '\\'; + GetWindowsDirectoryA(check, MAX_PATH); + strcat(check, format); + res = CompareStringA(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, check, -1, path, strlen(check)) == CSTR_EQUAL && + path[strlen(check)] != '\\'; - return (!inf) ? res : res && (inf == path + lstrlen(check) - 3); + return (!inf) ? res : res && (inf == path + strlen(check) - 3); } static void test_original_file_name(LPCSTR original, LPCSTR dest) { HINF hinf; PSP_INF_INFORMATION pspii; - SP_ORIGINAL_FILE_INFO spofi; + SP_ORIGINAL_FILE_INFO_A spofi; BOOL res; DWORD size; @@ -115,12 +115,12 @@ static void test_original_file_name(LPCSTR original, LPCSTR dest) hinf = SetupOpenInfFileA(dest, NULL, INF_STYLE_WIN4, NULL); ok(hinf != NULL, "SetupOpenInfFileA failed with error %d\n", GetLastError()); - res = SetupGetInfInformation(hinf, INFINFO_INF_SPEC_IS_HINF, NULL, 0, &size); + res = SetupGetInfInformationA(hinf, INFINFO_INF_SPEC_IS_HINF, NULL, 0, &size); ok(res, "SetupGetInfInformation failed with error %d\n", GetLastError()); pspii = HeapAlloc(GetProcessHeap(), 0, size); - res = SetupGetInfInformation(hinf, INFINFO_INF_SPEC_IS_HINF, pspii, size, NULL); + res = SetupGetInfInformationA(hinf, INFINFO_INF_SPEC_IS_HINF, pspii, size, NULL); ok(res, "SetupGetInfInformation failed with error %d\n", GetLastError()); spofi.cbSize = 0; @@ -173,8 +173,8 @@ static void test_SetupCopyOEMInf(void) "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); /* try an absolute nonexistent SourceInfFileName */ - lstrcpy(path, CURR_DIR); - lstrcat(path, "\\nonexistent"); + strcpy(path, CURR_DIR); + strcat(path, "\\nonexistent"); SetLastError(0xdeadbeef); res = pSetupCopyOEMInfA(path, NULL, 0, SP_COPY_NOOVERWRITE, NULL, 0, NULL, NULL); ok(res == FALSE, "Expected FALSE, got %d\n", res); @@ -207,7 +207,7 @@ static void test_SetupCopyOEMInf(void) * popups during the installation though as it also needs a catalog file (signed?). */ win_skip("Needs a different inf file on Vista+\n"); - DeleteFile(tmpfile); + DeleteFileA(tmpfile); return; } @@ -225,9 +225,9 @@ static void test_SetupCopyOEMInf(void) ok(file_exists(tmpfile), "Expected source inf to exist\n"); /* try an absolute SourceInfFileName, without DestinationInfFileName */ - lstrcpy(path, CURR_DIR); - lstrcat(path, "\\"); - lstrcat(path, tmpfile); + strcpy(path, CURR_DIR); + strcat(path, "\\"); + strcat(path, tmpfile); SetLastError(0xdeadbeef); res = pSetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, NULL, 0, NULL, NULL); ok(res == TRUE, "Expected TRUE, got %d\n", res); @@ -253,18 +253,18 @@ static void test_SetupCopyOEMInf(void) res = pSetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, MAX_PATH, NULL, NULL); ok(res == TRUE, "Expected TRUE, got %d\n", res); ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError()); - ok(lstrlen(dest) != 0, "Expected a non-zero length string\n"); + ok(strlen(dest) != 0, "Expected a non-zero length string\n"); ok(file_exists(dest), "Expected destination inf to exist\n"); ok(check_format(dest, NULL), "Expected %%windir%%\\inf\\OEMx.inf, got %s\n", dest); ok(file_exists(path), "Expected source inf to exist\n"); - lstrcpy(dest_save, dest); - DeleteFile(dest_save); + strcpy(dest_save, dest); + DeleteFileA(dest_save); /* get the DestinationInfFileName, DestinationInfFileNameSize is too small * - inf is still copied */ - lstrcpy(dest, "aaa"); + strcpy(dest, "aaa"); size = 0; SetLastError(0xdeadbeef); res = pSetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, 5, &size, NULL); @@ -273,19 +273,19 @@ static void test_SetupCopyOEMInf(void) "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); ok(file_exists(path), "Expected source inf to exist\n"); ok(file_exists(dest_save), "Expected dest inf to exist\n"); - ok(!lstrcmp(dest, "aaa"), "Expected dest to be unchanged\n"); - ok(size == lstrlen(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n"); + ok(!strcmp(dest, "aaa"), "Expected dest to be unchanged\n"); + ok(size == strlen(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n"); /* get the DestinationInfFileName and DestinationInfFileNameSize */ SetLastError(0xdeadbeef); res = pSetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, MAX_PATH, &size, NULL); ok(res == TRUE, "Expected TRUE, got %d\n", res); ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError()); - ok(lstrlen(dest) + 1 == size, "Expected sizes to match, got (%d, %d)\n", lstrlen(dest), size); + ok(lstrlenA(dest) + 1 == size, "Expected sizes to match, got (%d, %d)\n", lstrlenA(dest), size); ok(file_exists(dest), "Expected destination inf to exist\n"); ok(check_format(dest, NULL), "Expected %%windir%%\\inf\\OEMx.inf, got %s\n", dest); ok(file_exists(path), "Expected source inf to exist\n"); - ok(size == lstrlen(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n"); + ok(size == lstrlenA(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n"); test_original_file_name(strrchr(path, '\\') + 1, dest); @@ -294,14 +294,14 @@ static void test_SetupCopyOEMInf(void) res = pSetupCopyOEMInfA(path, NULL, SPOST_NONE, 0, dest, MAX_PATH, &size, &inf); ok(res == TRUE, "Expected TRUE, got %d\n", res); ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError()); - ok(lstrlen(dest) + 1 == size, "Expected sizes to match, got (%d, %d)\n", lstrlen(dest), size); + ok(lstrlenA(dest) + 1 == size, "Expected sizes to match, got (%d, %d)\n", lstrlenA(dest), size); ok(file_exists(dest), "Expected destination inf to exist\n"); ok((inf && inf[0] != 0) || broken(!inf), /* Win98 */ "Expected inf to point to the filename\n"); ok(check_format(dest, inf), "Expected %%windir%%\\inf\\OEMx.inf, got %s\n", dest); ok(file_exists(path), "Expected source inf to exist\n"); - ok(size == lstrlen(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n"); + ok(size == lstrlenA(dest_save) + 1, "Expected size to be lstrlen(dest_save) + 1\n"); /* try SP_COPY_DELETESOURCE */ SetLastError(0xdeadbeef); @@ -733,7 +733,7 @@ static void test_SetupUninstallOEMInf(void) START_TEST(misc) { - HMODULE hsetupapi = GetModuleHandle("setupapi.dll"); + HMODULE hsetupapi = GetModuleHandleA("setupapi.dll"); pSetupGetFileCompressionInfoExA = (void*)GetProcAddress(hsetupapi, "SetupGetFileCompressionInfoExA"); pSetupCopyOEMInfA = (void*)GetProcAddress(hsetupapi, "SetupCopyOEMInfA"); diff --git a/rostests/winetests/setupapi/parser.c b/rostests/winetests/setupapi/parser.c index 5a994235ba5..c2d554a6616 100644 --- a/rostests/winetests/setupapi/parser.c +++ b/rostests/winetests/setupapi/parser.c @@ -103,36 +103,36 @@ static const struct const char *data; DWORD error; UINT err_line; - int todo; + BOOL todo; } invalid_files[] = { /* file contents expected error (or 0) errline todo */ - { "\r\n", ERROR_WRONG_INF_STYLE, 0, 0 }, - { "abcd\r\n", ERROR_WRONG_INF_STYLE, 0, 1 }, - { "[Version]\r\n", ERROR_WRONG_INF_STYLE, 0, 0 }, - { "[Version]\nSignature=", ERROR_WRONG_INF_STYLE, 0, 0 }, - { "[Version]\nSignature=foo", ERROR_WRONG_INF_STYLE, 0, 0 }, - { "[version]\nsignature=$chicago$", 0, 0, 0 }, - { "[VERSION]\nSIGNATURE=$CHICAGO$", 0, 0, 0 }, - { "[Version]\nSignature=$chicago$,abcd", 0, 0, 0 }, - { "[Version]\nabc=def\nSignature=$chicago$", 0, 0, 0 }, - { "[Version]\nabc=def\n[Version]\nSignature=$chicago$", 0, 0, 0 }, - { STD_HEADER, 0, 0, 0 }, - { STD_HEADER "[]\r\n", 0, 0, 0 }, - { STD_HEADER "]\r\n", 0, 0, 0 }, - { STD_HEADER "[" A255 "]\r\n", 0, 0, 0 }, - { STD_HEADER "[ab\r\n", ERROR_BAD_SECTION_NAME_LINE, 3, 0 }, - { STD_HEADER "\n\n[ab\x1a]\n", ERROR_BAD_SECTION_NAME_LINE, 5, 0 }, - { STD_HEADER "[" A256 "]\r\n", ERROR_SECTION_NAME_TOO_LONG, 3, 0 }, - { "[abc]\n" STD_HEADER, 0, 0, 0 }, - { "abc\r\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 1, 0 }, - { ";\n;\nabc\r\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 3, 0 }, - { ";\n;\nab\nab\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 3, 0 }, - { ";aa\n;bb\n" STD_HEADER, 0, 0, 0 }, - { STD_HEADER " [TestSection\x00]\n", ERROR_BAD_SECTION_NAME_LINE, 3, 0 }, - { STD_HEADER " [Test\x00Section]\n", ERROR_BAD_SECTION_NAME_LINE, 3, 0 }, - { STD_HEADER " [TestSection\x00]\n", ERROR_BAD_SECTION_NAME_LINE, 3, 0 }, - { STD_HEADER " [Test\x00Section]\n", ERROR_BAD_SECTION_NAME_LINE, 3, 0 }, + { "\r\n", ERROR_WRONG_INF_STYLE, 0, FALSE }, + { "abcd\r\n", ERROR_WRONG_INF_STYLE, 0, TRUE }, + { "[Version]\r\n", ERROR_WRONG_INF_STYLE, 0, FALSE }, + { "[Version]\nSignature=", ERROR_WRONG_INF_STYLE, 0, FALSE }, + { "[Version]\nSignature=foo", ERROR_WRONG_INF_STYLE, 0, FALSE }, + { "[version]\nsignature=$chicago$", 0, 0, FALSE }, + { "[VERSION]\nSIGNATURE=$CHICAGO$", 0, 0, FALSE }, + { "[Version]\nSignature=$chicago$,abcd", 0, 0, FALSE }, + { "[Version]\nabc=def\nSignature=$chicago$", 0, 0, FALSE }, + { "[Version]\nabc=def\n[Version]\nSignature=$chicago$", 0, 0, FALSE }, + { STD_HEADER, 0, 0, FALSE }, + { STD_HEADER "[]\r\n", 0, 0, FALSE }, + { STD_HEADER "]\r\n", 0, 0, FALSE }, + { STD_HEADER "[" A255 "]\r\n", 0, 0, FALSE }, + { STD_HEADER "[ab\r\n", ERROR_BAD_SECTION_NAME_LINE, 3, FALSE }, + { STD_HEADER "\n\n[ab\x1a]\n", ERROR_BAD_SECTION_NAME_LINE, 5, FALSE }, + { STD_HEADER "[" A256 "]\r\n", ERROR_SECTION_NAME_TOO_LONG, 3, FALSE }, + { "[abc]\n" STD_HEADER, 0, 0, FALSE }, + { "abc\r\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 1, FALSE }, + { ";\n;\nabc\r\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 3, FALSE }, + { ";\n;\nab\nab\n" STD_HEADER, ERROR_EXPECTED_SECTION_NAME, 3, FALSE }, + { ";aa\n;bb\n" STD_HEADER, 0, 0, FALSE }, + { STD_HEADER " [TestSection\x00]\n", ERROR_BAD_SECTION_NAME_LINE, 3, FALSE }, + { STD_HEADER " [Test\x00Section]\n", ERROR_BAD_SECTION_NAME_LINE, 3, FALSE }, + { STD_HEADER " [TestSection\x00]\n", ERROR_BAD_SECTION_NAME_LINE, 3, FALSE }, + { STD_HEADER " [Test\x00Section]\n", ERROR_BAD_SECTION_NAME_LINE, 3, FALSE }, }; static void test_invalid_files(void) @@ -290,8 +290,8 @@ static void test_enum_sections(void) ret = pSetupEnumInfSectionsA( hinf, index, buffer, sizeof(buffer), &len ); ok( ret, "SetupEnumInfSectionsA failed err %u\n", GetLastError() ); ok( len == 3 || len == 8, "wrong len %u\n", len ); - ok( !lstrcmpi( buffer, "version" ) || !lstrcmpi( buffer, "s1" ) || - !lstrcmpi( buffer, "s2" ) || !lstrcmpi( buffer, "s3" ) || !lstrcmpi( buffer, "strings" ), + ok( !lstrcmpiA( buffer, "version" ) || !lstrcmpiA( buffer, "s1" ) || + !lstrcmpiA( buffer, "s2" ) || !lstrcmpiA( buffer, "s3" ) || !lstrcmpiA( buffer, "strings" ), "bad section '%s'\n", buffer ); } SetupCloseInfFile( hinf ); @@ -542,7 +542,7 @@ static void test_pSetupGetField(void) hinf = test_file_contents( contents, &err ); ok( hinf != NULL, "Expected valid INF file\n" ); - ret = SetupFindFirstLine( hinf, "FileBranchInfo", NULL, &context ); + ret = SetupFindFirstLineA( hinf, "FileBranchInfo", NULL, &context ); ok( ret, "Failed to find first line\n" ); /* native Windows crashes if a NULL context is sent in */ diff --git a/rostests/winetests/setupapi/query.c b/rostests/winetests/setupapi/query.c index b77827cc754..17c24bfb8c7 100644 --- a/rostests/winetests/setupapi/query.c +++ b/rostests/winetests/setupapi/query.c @@ -102,8 +102,8 @@ static const char inf_data6[] = static void create_inf_file(LPSTR filename, const char *data, DWORD size) { DWORD dwNumberOfBytesWritten; - HANDLE hf = CreateFile(filename, GENERIC_WRITE, 0, NULL, - CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + HANDLE hf = CreateFileA(filename, GENERIC_WRITE, 0, NULL, + CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); WriteFile(hf, data, size, &dwNumberOfBytesWritten, NULL); CloseHandle(hf); } diff --git a/rostests/winetests/setupapi/setupcab.c b/rostests/winetests/setupapi/setupcab.c index 47a9ab95126..6c76321b435 100644 --- a/rostests/winetests/setupapi/setupcab.c +++ b/rostests/winetests/setupapi/setupcab.c @@ -91,7 +91,7 @@ static void test_invalid_parametersA(void) const struct { PCSTR CabinetFile; - PSP_FILE_CALLBACK MsgHandler; + PSP_FILE_CALLBACK_A MsgHandler; DWORD expected_lasterror; int todo_lasterror; } invalid_parameters[] = @@ -161,7 +161,7 @@ static void test_invalid_parametersW(void) const struct { PCWSTR CabinetFile; - PSP_FILE_CALLBACK MsgHandler; + PSP_FILE_CALLBACK_W MsgHandler; DWORD expected_lasterror; int todo_lasterror; } invalid_parameters[] = diff --git a/rostests/winetests/setupapi/stringtable.c b/rostests/winetests/setupapi/stringtable.c index ab152c244d9..e9f739bfdff 100644 --- a/rostests/winetests/setupapi/stringtable.c +++ b/rostests/winetests/setupapi/stringtable.c @@ -48,10 +48,6 @@ static HSTRING_TABLE (WINAPI *pStringTableInitializeEx)(DWORD, DWORD); static DWORD (WINAPI *pStringTableLookUpString)(HSTRING_TABLE, LPWSTR, DWORD); static DWORD (WINAPI *pStringTableLookUpStringEx)(HSTRING_TABLE, LPWSTR, DWORD, LPVOID, DWORD); static LPWSTR (WINAPI *pStringTableStringFromId)(HSTRING_TABLE, DWORD); -#if 0 -static BOOL (WINAPI *pStringTableStringFromIdEx)(HSTRING_TABLE, DWORD, LPWSTR, LPDWORD); -static VOID (WINAPI *pStringTableTrim)(HSTRING_TABLE); -#endif static HMODULE hdll; static WCHAR string[] = {'s','t','r','i','n','g',0}; From 52a7f09dd3573677a4a7e37d697c4d702efb0926 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 13:01:01 +0000 Subject: [PATCH 407/419] [GDI32_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62835 --- rostests/winetests/gdi32/CMakeLists.txt | 6 +- rostests/winetests/gdi32/bitmap.c | 143 +- rostests/winetests/gdi32/brush.c | 12 +- rostests/winetests/gdi32/clipping.c | 46 +- rostests/winetests/gdi32/dc.c | 72 +- rostests/winetests/gdi32/dib.c | 235 +++- rostests/winetests/gdi32/font.c | 1644 ++++++++++++++++++----- rostests/winetests/gdi32/gdiobj.c | 12 +- rostests/winetests/gdi32/generated.c | 15 - rostests/winetests/gdi32/mapping.c | 4 +- rostests/winetests/gdi32/metafile.c | 8 +- rostests/winetests/gdi32/palette.c | 8 +- rostests/winetests/gdi32/path.c | 3 +- rostests/winetests/gdi32/pen.c | 91 +- rostests/winetests/gdi32/resource.rc | 2 + rostests/winetests/gdi32/testlist.c | 5 +- rostests/winetests/gdi32/vertical.sfd | 1060 +++++++++++++-- rostests/winetests/gdi32/vertical.ttf | Bin 2372 -> 3560 bytes rostests/winetests/gdi32/wine_test.sfd | 60 +- rostests/winetests/gdi32/wine_test.ttf | Bin 1652 -> 1760 bytes rostests/winetests/gdi32/wine_vdmx.sfd | 271 ++++ rostests/winetests/gdi32/wine_vdmx.ttf | Bin 0 -> 3280 bytes 22 files changed, 3049 insertions(+), 648 deletions(-) create mode 100644 rostests/winetests/gdi32/wine_vdmx.sfd create mode 100644 rostests/winetests/gdi32/wine_vdmx.ttf diff --git a/rostests/winetests/gdi32/CMakeLists.txt b/rostests/winetests/gdi32/CMakeLists.txt index 90dede3a217..908ea213b5e 100644 --- a/rostests/winetests/gdi32/CMakeLists.txt +++ b/rostests/winetests/gdi32/CMakeLists.txt @@ -19,7 +19,9 @@ list(APPEND SOURCE testlist.c) add_executable(gdi32_winetest ${SOURCE} resource.rc) - set_module_type(gdi32_winetest win32cui) -add_importlibs(gdi32_winetest gdi32 user32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(gdi32_winetest gdi32 user32 advapi32 msvcrt kernel32) +if(MSVC) + add_importlibs(gdi32_winetest ntdll) +endif() add_cd_file(TARGET gdi32_winetest DESTINATION reactos/bin FOR all) diff --git a/rostests/winetests/gdi32/bitmap.c b/rostests/winetests/gdi32/bitmap.c index 84f1d11929d..bb021a4001a 100755 --- a/rostests/winetests/gdi32/bitmap.c +++ b/rostests/winetests/gdi32/bitmap.c @@ -59,7 +59,7 @@ static void test_bitmap_info(HBITMAP hbm, INT expected_depth, const BITMAPINFOHE INT ret, width_bytes; BYTE buf[512], buf_cmp[512]; - ret = GetObject(hbm, sizeof(bm), &bm); + ret = GetObjectW(hbm, sizeof(bm), &bm); ok(ret == sizeof(bm), "GetObject returned %d\n", ret); ok(bm.bmType == 0, "wrong bm.bmType %d\n", bm.bmType); @@ -88,19 +88,19 @@ static void test_bitmap_info(HBITMAP hbm, INT expected_depth, const BITMAPINFOHE "buffers do not match, depth %d\n", bmih->biBitCount); /* test various buffer sizes for GetObject */ - ret = GetObject(hbm, sizeof(*bma) * 2, bma); + ret = GetObjectW(hbm, sizeof(*bma) * 2, bma); ok(ret == sizeof(*bma), "wrong size %d\n", ret); - ret = GetObject(hbm, sizeof(bm) / 2, &bm); + ret = GetObjectW(hbm, sizeof(bm) / 2, &bm); ok(ret == 0, "%d != 0\n", ret); - ret = GetObject(hbm, 0, &bm); + ret = GetObjectW(hbm, 0, &bm); ok(ret == 0, "%d != 0\n", ret); - ret = GetObject(hbm, 1, &bm); + ret = GetObjectW(hbm, 1, &bm); ok(ret == 0, "%d != 0\n", ret); - ret = GetObject(hbm, 0, NULL); + ret = GetObjectW(hbm, 0, NULL); ok(ret == sizeof(bm), "wrong size %d\n", ret); } @@ -248,7 +248,7 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER INT ret, bm_width_bytes, dib_width_bytes; BYTE *buf; - ret = GetObject(hbm, sizeof(bm), &bm); + ret = GetObjectW(hbm, sizeof(bm), &bm); ok(ret == sizeof(bm), "GetObject returned %d\n", ret); ok(bm.bmType == 0, "wrong bm.bmType %d\n", bm.bmType); @@ -280,30 +280,30 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER /* test various buffer sizes for GetObject */ memset(&ds, 0xAA, sizeof(ds)); - ret = GetObject(hbm, sizeof(*bma) * 2, bma); + ret = GetObjectW(hbm, sizeof(*bma) * 2, bma); ok(ret == sizeof(*bma), "wrong size %d\n", ret); ok(bm.bmWidth == bmih->biWidth, "wrong bm.bmWidth %d\n", bm.bmWidth); ok(bm.bmHeight == abs(bmih->biHeight), "wrong bm.bmHeight %d\n", bm.bmHeight); ok(bm.bmBits == bits, "wrong bm.bmBits %p != %p\n", bm.bmBits, bits); - ret = GetObject(hbm, sizeof(bm) / 2, &bm); + ret = GetObjectW(hbm, sizeof(bm) / 2, &bm); ok(ret == 0, "%d != 0\n", ret); - ret = GetObject(hbm, 0, &bm); + ret = GetObjectW(hbm, 0, &bm); ok(ret == 0, "%d != 0\n", ret); - ret = GetObject(hbm, 1, &bm); + ret = GetObjectW(hbm, 1, &bm); ok(ret == 0, "%d != 0\n", ret); /* test various buffer sizes for GetObject */ - ret = GetObject(hbm, 0, NULL); + ret = GetObjectW(hbm, 0, NULL); ok(ret == sizeof(bm), "wrong size %d\n", ret); - ret = GetObject(hbm, sizeof(*dsa) * 2, dsa); + ret = GetObjectW(hbm, sizeof(*dsa) * 2, dsa); ok(ret == sizeof(*dsa), "wrong size %d\n", ret); memset(&ds, 0xAA, sizeof(ds)); - ret = GetObject(hbm, sizeof(ds), &ds); + ret = GetObjectW(hbm, sizeof(ds), &ds); ok(ret == sizeof(ds), "wrong size %d\n", ret); ok(ds.dsBm.bmBits == bits, "wrong bm.bmBits %p != %p\n", ds.dsBm.bmBits, bits); @@ -326,16 +326,16 @@ static void test_dib_info(HBITMAP hbm, const void *bits, const BITMAPINFOHEADER ok(ds.dsBmih.biYPelsPerMeter == bmih->biYPelsPerMeter, "%d != %d\n", ds.dsBmih.biYPelsPerMeter, bmih->biYPelsPerMeter); memset(&ds, 0xAA, sizeof(ds)); - ret = GetObject(hbm, sizeof(ds) - 4, &ds); + ret = GetObjectW(hbm, sizeof(ds) - 4, &ds); ok(ret == sizeof(ds.dsBm), "wrong size %d\n", ret); ok(ds.dsBm.bmWidth == bmih->biWidth, "%d != %d\n", ds.dsBmih.biWidth, bmih->biWidth); ok(ds.dsBm.bmHeight == abs(bmih->biHeight), "%d != %d\n", ds.dsBmih.biHeight, abs(bmih->biHeight)); ok(ds.dsBm.bmBits == bits, "%p != %p\n", ds.dsBm.bmBits, bits); - ret = GetObject(hbm, 0, &ds); + ret = GetObjectW(hbm, 0, &ds); ok(ret == 0, "%d != 0\n", ret); - ret = GetObject(hbm, 1, &ds); + ret = GetObjectW(hbm, 1, &ds); ok(ret == 0, "%d != 0\n", ret); } @@ -457,7 +457,7 @@ static void test_dibsections(void) hdib = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection error %d\n", GetLastError()); - ok(GetObject(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIBSection\n"); + ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIBSection\n"); ok(dibsec.dsBm.bmBits == bits, "dibsec.dsBits %p != bits %p\n", dibsec.dsBm.bmBits, bits); /* test the DIB memory */ @@ -530,12 +530,12 @@ static void test_dibsections(void) hdib = CreateDIBSection(hdc, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); - ok(GetObject(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIBSection\n"); + ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIBSection\n"); ok(dibsec.dsBmih.biClrUsed == 2, "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 2); - /* Test if the old BITMAPCOREINFO structure is supported */ - + /* Test if the old BITMAPCOREINFO structure is supported */ + pbci->bmciHeader.bcSize = sizeof(BITMAPCOREHEADER); pbci->bmciHeader.bcBitCount = 0; @@ -626,7 +626,7 @@ static void test_dibsections(void) } hdib = CreateDIBSection(hdcmem, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); - ok(GetObject(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); + ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); ok(dibsec.dsBmih.biClrUsed == 16, "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 16); test_dib_info(hdib, bits, &pbmi->bmiHeader); @@ -644,7 +644,7 @@ static void test_dibsections(void) } hdib = CreateDIBSection(hdcmem, pbmi, DIB_RGB_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); - ok(GetObject(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); + ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); ok(dibsec.dsBmih.biClrUsed == 256, "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 256); @@ -678,7 +678,7 @@ static void test_dibsections(void) oldpal = SelectPalette(hdc, hpal, TRUE); hdib = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); - ok(GetObject(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); + ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); ok(dibsec.dsBmih.biClrUsed == 2, "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 2); /* The colour table has already been grabbed from the dc, so we select back the @@ -767,7 +767,7 @@ static void test_dibsections(void) oldpal = SelectPalette(hdc, hpal, TRUE); hdib = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); - ok(GetObject(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); + ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); ok(dibsec.dsBmih.biClrUsed == 256, "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 256); test_dib_info(hdib, bits, &pbmi->bmiHeader); @@ -805,7 +805,7 @@ static void test_dibsections(void) pbmi->bmiHeader.biClrUsed = 142; hdib = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); - ok(GetObject(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); + ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); ok(dibsec.dsBmih.biClrUsed == 256, "created DIBSection: wrong biClrUsed field: %u, should be: %u\n", dibsec.dsBmih.biClrUsed, 256); test_dib_info(hdib, bits, &pbmi->bmiHeader); @@ -863,7 +863,7 @@ static void test_dibsections(void) pbmi->bmiHeader.biClrUsed = 37; hdib = CreateDIBSection(hdc, pbmi, DIB_PAL_COLORS, (void**)&bits, NULL, 0); ok(hdib != NULL, "CreateDIBSection failed\n"); - ok(GetObject(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); + ok(GetObjectW(hdib, sizeof(DIBSECTION), &dibsec) != 0, "GetObject failed for DIB Section\n"); ok(dibsec.dsBmih.biClrUsed == 0, "created DIBSection: wrong biClrUsed field: %u\n", dibsec.dsBmih.biClrUsed); oldbm = SelectObject(hdcmem, hdib); ret = GetDIBColorTable(hdcmem, 0, 256, rgb); @@ -1209,6 +1209,49 @@ static void test_dib_formats(void) ret = GetDIBits(hdc, hbmp, 0, 0, NULL, bi, DIB_PAL_COLORS+2); ok( !ret, "GetDIBits succeeded with DIB_PAL_COLORS+2\n" ); + bi->bmiHeader.biWidth = 0x4000; + bi->bmiHeader.biHeight = 0x4000; + bi->bmiHeader.biBitCount = 1; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib != NULL, "CreateDIBSection failed with large size\n" ); + DeleteObject( hdib ); + + bi->bmiHeader.biWidth = 0x8001; + bi->bmiHeader.biHeight = 0x8001; + bi->bmiHeader.biBitCount = 32; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib == NULL, "CreateDIBSection succeeded with size overflow\n" ); + + bi->bmiHeader.biWidth = 1; + bi->bmiHeader.biHeight = 0x40000001; + bi->bmiHeader.biBitCount = 32; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib == NULL, "CreateDIBSection succeeded with size overflow\n" ); + + bi->bmiHeader.biWidth = 2; + bi->bmiHeader.biHeight = 0x40000001; + bi->bmiHeader.biBitCount = 16; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib == NULL, "CreateDIBSection succeeded with size overflow\n" ); + + bi->bmiHeader.biWidth = 0x40000001; + bi->bmiHeader.biHeight = 1; + bi->bmiHeader.biBitCount = 32; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib == NULL, "CreateDIBSection succeeded with size overflow\n" ); + + bi->bmiHeader.biWidth = 0x40000001; + bi->bmiHeader.biHeight = 4; + bi->bmiHeader.biBitCount = 8; + bi->bmiHeader.biCompression = BI_RGB; + hdib = CreateDIBSection(hdc, bi, DIB_RGB_COLORS, &bits, NULL, 0); + ok( hdib == NULL, "CreateDIBSection succeeded with size overflow\n" ); + DeleteDC( memdc ); DeleteObject( hbmp ); ReleaseDC( 0, hdc ); @@ -1305,7 +1348,7 @@ static void test_mono_dibsection(void) SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10, bits, pbmi, DIB_RGB_COLORS); ok(ds_bits[0] == 0xaa, "out_bits %02x\n", ds_bits[0]); - /* SetDIBitsToDevice with a inverted bmi -> normal dib section */ + /* SetDIBitsToDevice with an inverted bmi -> normal dib section */ colors[0].rgbRed = 0xff; colors[0].rgbGreen = 0xff; @@ -1390,7 +1433,7 @@ static void test_mono_dibsection(void) SetDIBitsToDevice(memdc, 0, 0, 10, 10, 0, 0, 0, 10, bits, pbmi, DIB_RGB_COLORS); ok(ds_bits[0] == 0x55, "out_bits %02x\n", ds_bits[0]); - /* SetDIBitsToDevice with a inverted bmi -> inverted dib section */ + /* SetDIBitsToDevice with an inverted bmi -> inverted dib section */ colors[0].rgbRed = 0xff; colors[0].rgbGreen = 0xff; @@ -1455,7 +1498,7 @@ static void test_bitmap(void) hbmp = CreateBitmap(15, 15, 1, 1, NULL); assert(hbmp != NULL); - ret = GetObject(hbmp, sizeof(bm), &bm); + ret = GetObjectW(hbmp, sizeof(bm), &bm); ok(ret == sizeof(bm), "wrong size %d\n", ret); ok(bm.bmType == 0, "wrong bm.bmType %d\n", bm.bmType); @@ -1482,7 +1525,7 @@ static void test_bitmap(void) hbmp_old = SelectObject(hdc, hbmp); - ret = GetObject(hbmp, sizeof(bm), &bm); + ret = GetObjectW(hbmp, sizeof(bm), &bm); ok(ret == sizeof(bm), "wrong size %d\n", ret); ok(bm.bmType == 0, "wrong bm.bmType %d\n", bm.bmType); @@ -1502,16 +1545,16 @@ static void test_bitmap(void) ok(hbmp_old == hbmp, "wrong old bitmap %p\n", hbmp_old); /* test various buffer sizes for GetObject */ - ret = GetObject(hbmp, sizeof(*bma) * 2, bma); + ret = GetObjectW(hbmp, sizeof(*bma) * 2, bma); ok(ret == sizeof(*bma), "wrong size %d\n", ret); - ret = GetObject(hbmp, sizeof(bm) / 2, &bm); + ret = GetObjectW(hbmp, sizeof(bm) / 2, &bm); ok(ret == 0, "%d != 0\n", ret); - ret = GetObject(hbmp, 0, &bm); + ret = GetObjectW(hbmp, 0, &bm); ok(ret == 0, "%d != 0\n", ret); - ret = GetObject(hbmp, 1, &bm); + ret = GetObjectW(hbmp, 1, &bm); ok(ret == 0, "%d != 0\n", ret); DeleteObject(hbmp); @@ -1523,7 +1566,7 @@ static COLORREF get_nearest( int r, int g, int b ) return (r*r + g*g + b*b < (255-r)*(255-r) + (255-g)*(255-g) + (255-b)*(255-b)) ? 0x000000 : 0xffffff; } -static int is_black_pen( COLORREF fg, COLORREF bg, int r, int g, int b ) +static BOOL is_black_pen( COLORREF fg, COLORREF bg, int r, int g, int b ) { if (fg == 0 || bg == 0xffffff) return RGB(r,g,b) != 0xffffff && RGB(r,g,b) != bg; return RGB(r,g,b) == 0x000000 || RGB(r,g,b) == bg; @@ -1532,8 +1575,9 @@ static int is_black_pen( COLORREF fg, COLORREF bg, int r, int g, int b ) static void test_bitmap_colors( HDC hdc, COLORREF fg, COLORREF bg, int r, int g, int b ) { static const WORD pattern_bits[] = { 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa, 0x5555, 0xaaaa }; - BITMAPINFO *info; - RGBQUAD *colors; + char buffer[FIELD_OFFSET( BITMAPINFO, bmiColors ) + 256 * sizeof(RGBQUAD)]; + BITMAPINFO *info = (BITMAPINFO *)buffer; + RGBQUAD *colors = info->bmiColors; WORD bits[16]; void *bits_ptr; COLORREF res; @@ -1569,7 +1613,7 @@ static void test_bitmap_colors( HDC hdc, COLORREF fg, COLORREF bg, int r, int g, old_brush = SelectObject( hdc, CreatePatternBrush( bitmap )); PatBlt( hdc, 0, 0, 16, 16, PATCOPY ); GetBitmapBits( GetCurrentObject( hdc, OBJ_BITMAP ), sizeof(bits), bits ); - ok( bits[0] == 0x5555, + ok( bits[0] == 0x5555 || broken(bits[0] == 0xaada) /* XP SP1 & 2003 SP0 */, "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); DeleteObject( SelectObject( hdc, old_brush )); @@ -1588,8 +1632,7 @@ static void test_bitmap_colors( HDC hdc, COLORREF fg, COLORREF bg, int r, int g, "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); /* mono DIB section */ - info = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, FIELD_OFFSET( BITMAPINFO, bmiColors[256] ) ); - colors = info->bmiColors; + memset( buffer, 0, sizeof(buffer) ); info->bmiHeader.biSize = sizeof(info->bmiHeader); info->bmiHeader.biHeight = -16; info->bmiHeader.biWidth = 16; @@ -1639,7 +1682,6 @@ static void test_bitmap_colors( HDC hdc, COLORREF fg, COLORREF bg, int r, int g, "wrong bits %04x for %02x,%02x,%02x fg %06x bg %06x\n", bits[0], r, g, b, fg, bg ); DeleteDC( memdc ); DeleteObject( bitmap ); - HeapFree( GetProcessHeap(), 0, info ); } static void test_mono_bitmap(void) @@ -1691,6 +1733,7 @@ static void test_mono_bitmap(void) test_color( hdc, PALETTEINDEX(i), get_nearest( ent.peRed, ent.peGreen, ent.peBlue )); test_color( hdc, DIBINDEX(i), (i == 1) ? 0xffffff : 0x000000 ); } + for (r = 0; r < 256; r += 15) for (g = 0; g < 256; g += 15) for (b = 0; b < 256; b += 15) @@ -1712,7 +1755,7 @@ static void test_bmBits(void) ok(hbmp != NULL, "CreateBitmap failed\n"); memset(&bmp, 0xFF, sizeof(bmp)); - ok(GetObject(hbmp, sizeof(bmp), &bmp) == sizeof(bmp), + ok(GetObjectW(hbmp, sizeof(bmp), &bmp) == sizeof(bmp), "GetObject failed or returned a wrong structure size\n"); ok(!bmp.bmBits, "bmBits must be NULL for device-dependent bitmaps\n"); @@ -2048,7 +2091,7 @@ static void test_GetDIBits(void) ok(hbmp != 0, "CreateBitmap failed\n"); memset(&bm, 0xAA, sizeof(bm)); - bytes = GetObject(hbmp, sizeof(bm), &bm); + bytes = GetObjectW(hbmp, sizeof(bm), &bm); ok(bytes == sizeof(bm), "GetObject returned %d\n", bytes); ok(bm.bmType == 0, "wrong bmType %d\n", bm.bmType); ok(bm.bmWidth == 16, "wrong bmWidth %d\n", bm.bmWidth); @@ -2164,7 +2207,7 @@ static void test_GetDIBits(void) lines, bm.bmHeight, GetLastError()); memset(&bm, 0xAA, sizeof(bm)); - bytes = GetObject(hbmp, sizeof(bm), &bm); + bytes = GetObjectW(hbmp, sizeof(bm), &bm); ok(bytes == sizeof(bm), "GetObject returned %d\n", bytes); ok(bm.bmType == 0, "wrong bmType %d\n", bm.bmType); ok(bm.bmWidth == 16, "wrong bmWidth %d\n", bm.bmWidth); @@ -2640,7 +2683,7 @@ static void test_select_object(void) } memset(&bm, 0xAA, sizeof(bm)); - bytes = GetObject(hbm, sizeof(bm), &bm); + bytes = GetObjectW(hbm, sizeof(bm), &bm); ok(bytes == sizeof(bm), "GetObject returned %d\n", bytes); ok(bm.bmType == 0, "wrong bmType %d\n", bm.bmType); ok(bm.bmWidth == 10, "wrong bmWidth %d\n", bm.bmWidth); @@ -2668,12 +2711,12 @@ static void test_mono_1x1_bmp_dbg(HBITMAP hbmp, int line) ret = GetObjectType(hbmp); ok_(__FILE__, line)(ret == OBJ_BITMAP, "the object %p is not bitmap\n", hbmp); - ret = GetObject(hbmp, 0, 0); + ret = GetObjectW(hbmp, 0, 0); ok_(__FILE__, line)(ret == sizeof(BITMAP), "object size %d\n", ret); memset(&bm, 0xDA, sizeof(bm)); SetLastError(0xdeadbeef); - ret = GetObject(hbmp, sizeof(bm), &bm); + ret = GetObjectW(hbmp, sizeof(bm), &bm); if (!ret) /* XP, only for curObj2 */ return; ok_(__FILE__, line)(ret == sizeof(BITMAP), "GetObject returned %d, error %u\n", ret, GetLastError()); ok_(__FILE__, line)(bm.bmType == 0, "wrong bmType, expected 0 got %d\n", bm.bmType); @@ -2770,7 +2813,7 @@ todo_wine continue; } ok(bm != 0, "CreateBitmapIndirect error %u\n", GetLastError()); - GetObject(bm, sizeof(bmp), &bmp); + GetObjectW(bm, sizeof(bmp), &bmp); if(i == 1) { expect = 1; } else if(i <= 4) { @@ -5585,7 +5628,7 @@ START_TEST(bitmap) { HMODULE hdll; - hdll = GetModuleHandle("gdi32.dll"); + hdll = GetModuleHandleA("gdi32.dll"); pGdiAlphaBlend = (void*)GetProcAddress(hdll, "GdiAlphaBlend"); pGdiGradientFill = (void*)GetProcAddress(hdll, "GdiGradientFill"); pSetLayout = (void*)GetProcAddress(hdll, "SetLayout"); diff --git a/rostests/winetests/gdi32/brush.c b/rostests/winetests/gdi32/brush.c index 76e158d926a..9026a4ac522 100755 --- a/rostests/winetests/gdi32/brush.c +++ b/rostests/winetests/gdi32/brush.c @@ -49,7 +49,7 @@ static void test_solidbrush(void) for(i=0; i 1), "expected SIMPLEREGION, got %d\n", ret); @@ -450,9 +476,9 @@ static void test_window_dc_clipping(void) ret = GetRgnBox(hrgn, &rc); ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); - ok(rc.left == 0 && rc.top == 0 && rc.right == screen_width && rc.bottom == screen_height, - "expected 0,0-%d,%d, got %d,%d-%d,%d\n", screen_width, screen_height, - rc.left, rc.top, rc.right, rc.bottom); + ok(EqualRect(&rc, &virtual_rect), "expected %d,%d-%d,%d, got %d,%d-%d,%d\n", + virtual_rect.left, virtual_rect.top, virtual_rect.right, virtual_rect.bottom, + rc.left, rc.top, rc.right, rc.bottom); SetRect( &rc, 10, 10, 20, 20 ); ret = RectVisible( hdc, &rc ); @@ -462,6 +488,18 @@ static void test_window_dc_clipping(void) ret = RectVisible( hdc, &rc ); ok( ret, "RectVisible failed for %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom ); + ret = ExtSelectClipRgn(hdc, 0, RGN_DIFF); + ok(ret == 0, "expected 0, got %d\n", ret); + + ret = GetClipRgn(hdc, hrgn); + ok(ret == 1, "expected 1, got %d\n", ret); + + ret = GetRgnBox(hrgn, &rc); + ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); + ok(EqualRect(&rc, &virtual_rect), "expected %d,%d-%d,%d, got %d,%d-%d,%d\n", + virtual_rect.left, virtual_rect.top, virtual_rect.right, virtual_rect.bottom, + rc.left, rc.top, rc.right, rc.bottom); + ret = ExtSelectClipRgn(hdc, 0, RGN_COPY); ok(ret == SIMPLEREGION || (ret == COMPLEXREGION && GetSystemMetrics(SM_CMONITORS) > 1), "expected SIMPLEREGION, got %d\n", ret); diff --git a/rostests/winetests/gdi32/dc.c b/rostests/winetests/gdi32/dc.c index 5f193705e9b..d215d9c50c5 100644 --- a/rostests/winetests/gdi32/dc.c +++ b/rostests/winetests/gdi32/dc.c @@ -457,12 +457,46 @@ static void test_device_caps( HDC hdc, HDC ref_dc, const char *descr, int scale type = GetClipBox( ref_dc, &rect ); if (type != COMPLEXREGION && type != ERROR) /* region can be complex on multi-monitor setups */ { + RECT ref_rect; + ok( type == SIMPLEREGION, "GetClipBox returned %d on %s\n", type, descr ); - ok( rect.left == 0 && rect.top == 0 && - rect.right == GetDeviceCaps( ref_dc, DESKTOPHORZRES ) && - rect.bottom == GetDeviceCaps( ref_dc, DESKTOPVERTRES ), - "GetClipBox returned %d,%d,%d,%d on %s\n", - rect.left, rect.top, rect.right, rect.bottom, descr ); + if (GetDeviceCaps( ref_dc, TECHNOLOGY ) == DT_RASDISPLAY) + { + if (GetSystemMetrics( SM_CXSCREEN ) != GetSystemMetrics( SM_CXVIRTUALSCREEN )) + todo_wine ok( GetDeviceCaps( ref_dc, DESKTOPHORZRES ) == GetSystemMetrics( SM_CXSCREEN ), + "Got DESKTOPHORZRES %d on %s, expected %d\n", + GetDeviceCaps( ref_dc, DESKTOPHORZRES ), descr, GetSystemMetrics( SM_CXSCREEN ) ); + else + ok( GetDeviceCaps( ref_dc, DESKTOPHORZRES ) == GetSystemMetrics( SM_CXSCREEN ), + "Got DESKTOPHORZRES %d on %s, expected %d\n", + GetDeviceCaps( ref_dc, DESKTOPHORZRES ), descr, GetSystemMetrics( SM_CXSCREEN ) ); + + if (GetSystemMetrics( SM_CYSCREEN ) != GetSystemMetrics( SM_CYVIRTUALSCREEN )) + todo_wine ok( GetDeviceCaps( ref_dc, DESKTOPVERTRES ) == GetSystemMetrics( SM_CYSCREEN ), + "Got DESKTOPVERTRES %d on %s, expected %d\n", + GetDeviceCaps( ref_dc, DESKTOPVERTRES ), descr, GetSystemMetrics( SM_CYSCREEN ) ); + else + ok( GetDeviceCaps( ref_dc, DESKTOPVERTRES ) == GetSystemMetrics( SM_CYSCREEN ), + "Got DESKTOPVERTRES %d on %s, expected %d\n", + GetDeviceCaps( ref_dc, DESKTOPVERTRES ), descr, GetSystemMetrics( SM_CYSCREEN ) ); + + SetRect( &ref_rect, GetSystemMetrics( SM_XVIRTUALSCREEN ), GetSystemMetrics( SM_YVIRTUALSCREEN ), + GetSystemMetrics( SM_XVIRTUALSCREEN ) + GetSystemMetrics( SM_CXVIRTUALSCREEN ), + GetSystemMetrics( SM_YVIRTUALSCREEN ) + GetSystemMetrics( SM_CYVIRTUALSCREEN ) ); + } + else + { + SetRect( &ref_rect, 0, 0, GetDeviceCaps( ref_dc, DESKTOPHORZRES ), + GetDeviceCaps( ref_dc, DESKTOPVERTRES ) ); + } + + if (GetDeviceCaps( ref_dc, TECHNOLOGY ) == DT_RASDISPLAY && GetObjectType( hdc ) != OBJ_ENHMETADC && + (GetSystemMetrics( SM_XVIRTUALSCREEN ) || GetSystemMetrics( SM_YVIRTUALSCREEN ))) + todo_wine ok( EqualRect( &rect, &ref_rect ), "GetClipBox returned %d,%d,%d,%d on %s\n", + rect.left, rect.top, rect.right, rect.bottom, descr ); + else + ok( EqualRect( &rect, &ref_rect ), "GetClipBox returned %d,%d,%d,%d on %s\n", + rect.left, rect.top, rect.right, rect.bottom, descr ); } SetBoundsRect( ref_dc, NULL, DCB_RESET | DCB_ACCUMULATE ); @@ -531,19 +565,19 @@ static void test_CreateCompatibleDC(void) HDC hdc, hNewDC, hdcMetafile, screen_dc; HBITMAP bitmap; INT caps; - DEVMODE dm; + DEVMODEA dm; bitmap = CreateBitmap( 10, 10, 1, 1, NULL ); - bRet = EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm); + bRet = EnumDisplaySettingsA(NULL, ENUM_CURRENT_SETTINGS, &dm); ok(bRet, "EnumDisplaySettingsEx failed\n"); dm.u1.s1.dmScale = 200; dm.dmFields |= DM_SCALE; - hdc = CreateDC( "DISPLAY", NULL, NULL, &dm ); + hdc = CreateDCA( "DISPLAY", NULL, NULL, &dm ); - screen_dc = CreateDC( "DISPLAY", NULL, NULL, NULL ); + screen_dc = CreateDCA( "DISPLAY", NULL, NULL, NULL ); test_device_caps( hdc, screen_dc, "display dc", 1 ); - ResetDC( hdc, &dm ); + ResetDCA( hdc, &dm ); test_device_caps( hdc, screen_dc, "display dc", 1 ); DeleteDC( hdc ); @@ -573,7 +607,7 @@ static void test_CreateCompatibleDC(void) caps = GetDeviceCaps( hdcMetafile, TECHNOLOGY ); ok( caps == DT_RASDISPLAY, "wrong caps %u\n", caps ); test_device_caps( hdcMetafile, hdc, "enhmetafile dc", 1 ); - ResetDC( hdcMetafile, &dm ); + ResetDCA( hdcMetafile, &dm ); test_device_caps( hdcMetafile, hdc, "enhmetafile dc", 1 ); DeleteDC( hNewDC ); DeleteEnhMetaFile( CloseEnhMetaFile( hdcMetafile )); @@ -586,7 +620,7 @@ static void test_CreateCompatibleDC(void) caps = GetDeviceCaps( hdcMetafile, TECHNOLOGY ); ok( caps == DT_METAFILE, "wrong caps %u\n", caps ); test_device_caps( hdcMetafile, screen_dc, "metafile dc", 1 ); - ResetDC( hdcMetafile, &dm ); + ResetDCA( hdcMetafile, &dm ); test_device_caps( hdcMetafile, screen_dc, "metafile dc", 1 ); DeleteMetaFile( CloseMetaFile( hdcMetafile )); @@ -673,7 +707,7 @@ static void test_DeleteDC(void) { HWND hwnd; HDC hdc, hdc_test; - WNDCLASSEX cls; + WNDCLASSEXA cls; int ret; /* window DC */ @@ -727,7 +761,7 @@ static void test_DeleteDC(void) memset(&cls, 0, sizeof(cls)); cls.cbSize = sizeof(cls); cls.style = CS_CLASSDC; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.lpszClassName = "Wine class DC"; cls.lpfnWndProc = DefWindowProcA; ret = RegisterClassExA(&cls); @@ -766,7 +800,7 @@ static void test_DeleteDC(void) ret = GetObjectType(hdc_test); ok(ret == OBJ_DC, "expected OBJ_DC, got %d\n", ret); - ret = UnregisterClassA("Wine class DC", GetModuleHandle(NULL)); + ret = UnregisterClassA("Wine class DC", GetModuleHandleA(NULL)); ok(ret, "UnregisterClassA failed\n"); ret = GetObjectType(hdc_test); @@ -777,7 +811,7 @@ todo_wine memset(&cls, 0, sizeof(cls)); cls.cbSize = sizeof(cls); cls.style = CS_OWNDC; - cls.hInstance = GetModuleHandle(0); + cls.hInstance = GetModuleHandleA(NULL); cls.lpszClassName = "Wine own DC"; cls.lpfnWndProc = DefWindowProcA; ret = RegisterClassExA(&cls); @@ -811,7 +845,7 @@ todo_wine DestroyWindow(hwnd); - ret = UnregisterClassA("Wine own DC", GetModuleHandle(NULL)); + ret = UnregisterClassA("Wine own DC", GetModuleHandleA(NULL)); ok(ret, "UnregisterClassA failed\n"); } @@ -1262,7 +1296,7 @@ static HDC create_printer_dc(int scale, BOOL reset) dbuf->pDriverPath, pbuf->pPrinterName, pbuf->pPortName, is_postscript_printer(hdc) ? "" : "NOT " ); - if (reset) ResetDC( hdc, pbuf->pDevMode ); + if (reset) ResetDCA( hdc, pbuf->pDevMode ); done: HeapFree( GetProcessHeap(), 0, dbuf ); HeapFree( GetProcessHeap(), 0, pbuf ); @@ -1346,7 +1380,7 @@ static void test_printer_dc(void) START_TEST(dc) { - pSetLayout = (void *)GetProcAddress( GetModuleHandle("gdi32.dll"), "SetLayout"); + pSetLayout = (void *)GetProcAddress( GetModuleHandleA("gdi32.dll"), "SetLayout"); test_dc_values(); test_savedc(); test_savedc_2(); diff --git a/rostests/winetests/gdi32/dib.c b/rostests/winetests/gdi32/dib.c index 9a11405641f..6b2b9be3c96 100644 --- a/rostests/winetests/gdi32/dib.c +++ b/rostests/winetests/gdi32/dib.c @@ -136,8 +136,8 @@ static const char *sha1_graphics_a8r8g8b8[] = "d7dd4700f49808541bba99244b7eb5840e0a2439", "af99228aa4cfbd1f61bd824db046144a3c6c2ed7", "568f87f0194ca19b69a5b2bcdef795d89c5721ce", - "50d19fe68b2ab4fdbb5d590cdca6dc84a95bab68", - "a1fde1094d2c19ddb20871842dae1da73618709e", + "a37810f46dee8741fe5adbb3f1f2e87012ffc929", + "50a09678c49c208f71d40452daca5411279aa674", "e462052a03dbe4ec3814db7700e166d00d4d686f", "a27917d4db49ce77989fae246015aeb2a28520ee", "657514a4ca1f2b6ca7a125ad58dfed82099a37d1", @@ -209,8 +209,8 @@ static const char *sha1_graphics_a8r8g8b8_bitfields[] = "d7dd4700f49808541bba99244b7eb5840e0a2439", "af99228aa4cfbd1f61bd824db046144a3c6c2ed7", "568f87f0194ca19b69a5b2bcdef795d89c5721ce", - "50d19fe68b2ab4fdbb5d590cdca6dc84a95bab68", - "a1fde1094d2c19ddb20871842dae1da73618709e", + "a37810f46dee8741fe5adbb3f1f2e87012ffc929", + "50a09678c49c208f71d40452daca5411279aa674", "0cda6b3297003b3ccd6d5baa17e1ca9bb7c56f08", "b2c8e1ebb9435031fe068442f479d1304096e79f", "657514a4ca1f2b6ca7a125ad58dfed82099a37d1", @@ -282,8 +282,8 @@ static const char *sha1_graphics_a8b8g8r8[] = "86c84cc8306975edecc6d4a89a8aff29f59b55a7", "af99228aa4cfbd1f61bd824db046144a3c6c2ed7", "25675c30adfe24d6cae60793b156dfdaa36ac3ba", - "1cb1810b127f509117b38d62a15b67b2347b9145", - "f05b3294f25de5fa6d1114104bca97871052ea5a", + "849d4abf4b690128a5f70e9b8ac78f20c437de06", + "e768fc9f3167ef3144a4cfb1e20126a577f7dd5b", "87f57a31253a38dbf3dc3070473328fa04b68a48", "db64cc4d830fc35ed170b53943e722b2342954d4", "9988ceca44dafbee247aece1f027c06c27c01652", @@ -355,8 +355,8 @@ static const char *sha1_graphics_r10g10b10[] = "fc0c32afb719295f28bcfef22803bef94f798e20", "36f6db4fbe2a1630a7597d3a446f2902755c96ef", "d3f08946300e1700865042aed121870e292d1095", - "467ff4af1e105855874f27fbf84d1d2b0417ab5d", - "fb0dcff8a67a88313557ee8b588aaa2004fe7b8b", + "4782df8e24127e66a434b4e839adebf2dbb223fb", + "739707cc85ca63e0580c79618dc0bb8a4a338d95", "8ea5d7e4bebc40a1d91b04b12e1c11a42c188095", "317521e576801acaea62c76fe16813cdfe20f4ad", "ce0fc29bb0281d6c955d64e239254ef9e6dbc06d", @@ -428,8 +428,8 @@ static const char *sha1_graphics_r6g6b6[] = "49341c297a887186bd47d7465d827ab3147f05e3", "325279e76367200d3fd7194d81c09fd139988ece", "c3def160a1e847605ff0fc7edd30397fa90635a0", - "a9c2158329c207638cfd2c82cd8a6218efdb28d2", - "7f0c4e6874f0c36cee64ff5dec76258ca8822cb2", + "2b3e87e0b705b03c7c08f403409ab82cce095ba1", + "45c08e11fffc78b2a3574263419e0cb7f8cd9b45", "aecb242c31f31a90f071b6455ea7d808d4ea22e3", "77ea86e51a94b11a8081b29696cb4115687843e3", "d67b897cad72d31e75359094007b1346fd8806ea", @@ -501,8 +501,8 @@ static const char *sha1_graphics_24[] = "b25ba91487ec945410deb2b51bc1156890c032a8", "d347ca5c6c4b6a61389247c3b6f61564033e8c25", "ee315634ed92da3a32c2675ecd1b369471c60936", - "6776e0612410e7e200c853721b4ab6ad8b6b81f5", - "620a5a520d81971a2d9c30b8d836ba696e11b8dd", + "099c688a920f606655b485e8f0a433dc811bc976", + "9c044a733335bca43766bda2b317249309155079", "354b92008a8409c62d0fa1dff1532c5943aa37a2", "8dc9cb7deae5c24d1eae004d53893fa6caf4723c", "cf311a96d41bd98fdbdfb5dfaac4ba1ba9b7d6da", @@ -578,8 +578,8 @@ static const char *sha1_graphics_r5g5b5[] = "3772003c7fb420003512d0c437b3659d96d89ce4", "dab47c9dc149e570045d699598b14a613bf319b3", "2daca4d26a086ed34894693be0b0374402232809", - "e313ae8f7261b88999757ed0c6f26df85b4f01a5", - "47d0bab8664ae0aaa927495d07bb3537cce35f16", + "904f1d82159bcf5485f323bd12b859dc5e83f8eb", + "5bd29f94844351e9a5bd01f25d85608b9b0701b2", "295ec16530126046790fb734e99f86f5b3b74ed8", "d98b0561010606b55a1b9b85fbc93640f681d256", "1c1499051860b7caa25173b328ca9c862f01dd1a", @@ -650,8 +650,8 @@ static const char *sha1_graphics_r4g4b4[] = "f0acb3cfcda62e95bee5f7bc8830ffeb3dd7e5a7", "07b10c3f191d0a93e5e5694aae37dcad407e10f5", "f7900e60347029876ba55e8f0c4c02e89deb36b6", - "7d80b8289da8a65931f03c74a9ef0aff5f8eb551", - "a7a986097e5b553c71bd93fd0ec6037e6bd0f2d1", + "f373a5f37b82e7523c64c08eb509b6191e49b173", + "9f0760a05190c9edf9ce2e8be6aaa5557601fe91", "7587a9c87cab1eca827807f351bb67ca184d1ac5", "b53ef0b5c674822e784903a9dbdd3b386d9f2350", "5505d2ed20dc61ffe48832ecf5329162a5ceb734", @@ -728,8 +728,8 @@ static const char *sha1_graphics_8_color[] = "9ae38bb94c7b4c0c6dfebbee23d1de4db9b77488", "678979a45126a76eb629992cd64734862f53a555", "2f7ba8803604c032cb1a1228bc021f0f1c03e245", - "9b1cc7b24f8ce15db2af7f4aa8cde8687784dfa2", - "cc4a4cea622d825700bccef7d90a5a447d9ca39d", + "52e7c2f8b01592898c13f1e7633881e350244209", + "d9d5556b77301952b4caf113337720966bc8e1f5", "e58d9c0acf0219d0839e1dbd162e08a765ed7f0f", "34ca0f9660e1889f9f2c0deb80535d3c4f349fa4", "2c07272462c68cf5944b03e2aa049475b99143c5", @@ -810,9 +810,9 @@ static const char *sha1_graphics_8_grayscale[] = "fb63bbb2f944fb63ed2d7399f07b168740c1034b", "3685c9ae95118a83db3569832c29753276fa1264", "09640bad951c33e7d70a1fced83b1869f65b3fc5", - "cb9ea8137eca1450e049879772f5c11a0e11ff0a", - "a4b04ed35484de0de61832a8a28bbc7def645622", - "515897610714251dd3b54f54fe76a9ed3fd12c53", + "5eb00252664ec39e61359adb1dade4906a87a248", + "ee7b9b292ea9fb559ef5ebf6a2a5586d38c7f854", + "dcad1a146c1d0ec2c4cc7f64bd4f45c57a604bfe", "0ca8775d9a61ccc251d1e6f2e3cfd26a24ae24a2", "17ae603c199a5d6695d198a7f36e6d7263990951", "1918a33f59d3500204ffc573318a39e9ff754221", @@ -887,8 +887,8 @@ static const char *sha1_graphics_8[] = "31e667c2dbb81dcf81d01cb88f794e88ddb90ff2", "465d9cd0a77ab4fcf035aa67544b2a26269e0b09", "600d6b2713d5e4c0d90c02660245ed26c7ae3033", - "d4f3a5ea033adc405c44e1ca137dc908c606dad6", - "7103d428ec9a959778120fd6f0dc62dd608ddd63", + "0025a440866a404523a8a20e79a8891e45a2ff56", + "c04d335933895f836f0a28c1e3f7f444352c3b8e", "bd28d77cd85b20a2384d6b25082cfd884bba683e", "7e591ec8ae9bb61c3a443c93f071cab2b8978394", "f81c70b6ee2d4690f9f7c797c66582b176f8dcef", @@ -959,8 +959,8 @@ static const char *sha1_graphics_4[] = "df5feb905a31c288008cf5e82d73ac818a160d82", "d8af3868c66c7d6dac35ec8ee0317b38a6910bb1", "ec8e2aebfb4a1c28ebcd0e053b9e4d8638b50951", - "1a23839d71d2379ed4e709a5ae6c14639fbe3ab8", - "09f8416a780d80be61cbda3d8a05aee418d0ea00", + "ccf8d11b1e81895e9781f17c227c821228d8714b", + "f751e26578193afe6a727ee2a52318c404c56555", "28a6b9f7927e99e53cf46f0333d29168cb10e920", "029552113292cc110fd6b7888e766628950aaeef", "297f6ad15200bffbf15198324ee8f27a61a6f2d4", @@ -1031,8 +1031,8 @@ static const char *sha1_graphics_4_grayscale[] = "f8681c09f1abfc38d31e47622cb8798cd896a00e", "b5ee51cfc73acb59a2f6124509ea236f8fc7f9f7", "d374d4d92c940ae42a9b42c14d744341b68a8c14", - "43560b856907f552df3b9dd1f91e1aa8ab9ff17e", - "8cefa6dcb658487d0715598d5d120677dbfdab42", + "06a6a224be0f5cdc51ac4704f9f57fc1f3813d6f", + "c47c2dc806b6b8ff28f300949695d013a46c0083", "ada3b7c34946e584dcdf4203e07cfa3dad02bc63", "c2f61571b067a44b30f56b4658c9606f0edfc0f3", "58f400c9bb78e49a879276fb049edfc9c981740a", @@ -1052,14 +1052,14 @@ static const char *sha1_graphics_4_grayscale[] = static const char *sha1_graphics_1[] = { "23366004515f3bc46796ea505d748f8d0f97fbe1", - "ad674a4104c6a1eacaee8f20effdfe31775b4409", - "a7cc69f957d7b533a0a330859a143d701daac73c", - "a955bf088c5edb129289ce65caace48ec95632e4", - "5316d3c558c254479883133cf58cd07ab521d3f0", - "fcbfdb5d60716ea05f2d1896fae7a6e7a8249d35", - "2c140b39cc8d21358fded8959cd655f03d7f0f89", - "121423a38b4ac4743bd516e0a7e88a3863796313", - "7c17635c6c7f62dbf8fd4773d0c503358553d2c7", + "61ade9054d4477fb89cf830539a5e8b4e45f0688", + "ac530c5dbaf837e15b2337347e974184fad73643", + "95fdcda26262d5948a9ade77d83fd698e0031050", + "1dd5cee06af78d026e5da8bfe3f45e1cf51faa13", + "f6b61ecf03ad11752775faca1d4404c6bb5065f5", + "d7ad44d6f377598268e9968333ae2cf23a0715ca", + "5871339cd7e6cee12d4dc45934a89071c73efe6b", + "69e9b85b34caf736069ba91e57a5c3fa7c891653", "21d5d9e47bb07de2cf7bc99b7725390d03a6cde6", "f69ee65ea25676429a28eea79b5b9cb9206b8d01", "39ff81f77ef4ee772367ed1a63785987c060126e", @@ -1122,7 +1122,7 @@ static const char *sha1_graphics_1[] = "88763f8e8fcf4f78fa864325791a9dd35a0bd279", "013cee26bac8f815eadad4bfc012d9b5d01c3b7f", "44a28536466dc895feb824b23dfd4a47c6948af8", - "f0316a5765a0404760e94cd05b7dc956cae07d26", + "17468a3789f0a6d65c302bda735a01dc2c1a74d9", "781d8c5cbc28591fd48fce06f984c502fdc6b363", "df510792a7790cc699532b1420d43c6d4da2ae2f", "55c26d22f11d80b73383fa57d0fac552d705b092", @@ -1131,14 +1131,14 @@ static const char *sha1_graphics_1[] = "4842a30dd7fdf38ddc3ddec85c08efe13a0e2e0b", "cc76db6da5ba1776f20240a5ad97a26a9cdf96b0", "014f477664a7f4ce4a948d6359a2707119afc8e2", - "1ee4e951743efc8764249fbc7adecefbfec0428e", + "74d01690e344bc22e7a0478e7a09ccd92354c486", "9ab50a663b74577b656e9849484a909d7ac52eeb", "128eefd2ee043d59dc37918065f687e378e5ca95", - "c642abc651f525332d9d635049646d309e877839", + "d7e2daab98ce1f698c4bfedfc01c0d79fcb76b8e", "8d34215487088b5d4ef63062270ce25c2862643d", - "3dc3075b0c87fdcaabbbae8928303fb2358c15c2", + "826562eb11a0d0bba77fa21245f7406a194e9225", "bbae6f0659e095a42b420082079663f937065813", - "ca711c69165e1fa5be72993b9a7870ef6d485249", + "bbabe686a6955402c90530e7c67f1428868369b3", NULL }; @@ -1488,6 +1488,129 @@ static const DWORD four_by_four_data[16] = { 0x000000, 0xff0000, 0x00ff00, 0x000 static const DWORD ddb_brush_bits[8] = { 0x11112222, 0x33334444, 0x55556666, 0x77778888, 0xaaaaaaaa, 0x00000000, 0x98765432, 0xabcdef00 }; +static const RGBQUAD default_palette_1[2] = +{ + { 0x00, 0x00, 0x00 }, { 0xff, 0xff, 0xff } +}; + +static const RGBQUAD default_palette_4[16] = +{ + { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x80 }, { 0x00, 0x80, 0x00 }, { 0x00, 0x80, 0x80 }, + { 0x80, 0x00, 0x00 }, { 0x80, 0x00, 0x80 }, { 0x80, 0x80, 0x00 }, { 0x80, 0x80, 0x80 }, + { 0xc0, 0xc0, 0xc0 }, { 0x00, 0x00, 0xff }, { 0x00, 0xff, 0x00 }, { 0x00, 0xff, 0xff }, + { 0xff, 0x00, 0x00 }, { 0xff, 0x00, 0xff }, { 0xff, 0xff, 0x00 }, { 0xff, 0xff, 0xff }, +}; + +static const RGBQUAD default_palette_8[256] = +{ + { 0x00, 0x00, 0x00 }, { 0x00, 0x00, 0x80 }, { 0x00, 0x80, 0x00 }, { 0x00, 0x80, 0x80 }, + { 0x80, 0x00, 0x00 }, { 0x80, 0x00, 0x80 }, { 0x80, 0x80, 0x00 }, { 0xc0, 0xc0, 0xc0 }, + { 0xc0, 0xdc, 0xc0 }, { 0xf0, 0xca, 0xa6 }, { 0x00, 0x20, 0x40 }, { 0x00, 0x20, 0x60 }, + { 0x00, 0x20, 0x80 }, { 0x00, 0x20, 0xa0 }, { 0x00, 0x20, 0xc0 }, { 0x00, 0x20, 0xe0 }, + { 0x00, 0x40, 0x00 }, { 0x00, 0x40, 0x20 }, { 0x00, 0x40, 0x40 }, { 0x00, 0x40, 0x60 }, + { 0x00, 0x40, 0x80 }, { 0x00, 0x40, 0xa0 }, { 0x00, 0x40, 0xc0 }, { 0x00, 0x40, 0xe0 }, + { 0x00, 0x60, 0x00 }, { 0x00, 0x60, 0x20 }, { 0x00, 0x60, 0x40 }, { 0x00, 0x60, 0x60 }, + { 0x00, 0x60, 0x80 }, { 0x00, 0x60, 0xa0 }, { 0x00, 0x60, 0xc0 }, { 0x00, 0x60, 0xe0 }, + { 0x00, 0x80, 0x00 }, { 0x00, 0x80, 0x20 }, { 0x00, 0x80, 0x40 }, { 0x00, 0x80, 0x60 }, + { 0x00, 0x80, 0x80 }, { 0x00, 0x80, 0xa0 }, { 0x00, 0x80, 0xc0 }, { 0x00, 0x80, 0xe0 }, + { 0x00, 0xa0, 0x00 }, { 0x00, 0xa0, 0x20 }, { 0x00, 0xa0, 0x40 }, { 0x00, 0xa0, 0x60 }, + { 0x00, 0xa0, 0x80 }, { 0x00, 0xa0, 0xa0 }, { 0x00, 0xa0, 0xc0 }, { 0x00, 0xa0, 0xe0 }, + { 0x00, 0xc0, 0x00 }, { 0x00, 0xc0, 0x20 }, { 0x00, 0xc0, 0x40 }, { 0x00, 0xc0, 0x60 }, + { 0x00, 0xc0, 0x80 }, { 0x00, 0xc0, 0xa0 }, { 0x00, 0xc0, 0xc0 }, { 0x00, 0xc0, 0xe0 }, + { 0x00, 0xe0, 0x00 }, { 0x00, 0xe0, 0x20 }, { 0x00, 0xe0, 0x40 }, { 0x00, 0xe0, 0x60 }, + { 0x00, 0xe0, 0x80 }, { 0x00, 0xe0, 0xa0 }, { 0x00, 0xe0, 0xc0 }, { 0x00, 0xe0, 0xe0 }, + { 0x40, 0x00, 0x00 }, { 0x40, 0x00, 0x20 }, { 0x40, 0x00, 0x40 }, { 0x40, 0x00, 0x60 }, + { 0x40, 0x00, 0x80 }, { 0x40, 0x00, 0xa0 }, { 0x40, 0x00, 0xc0 }, { 0x40, 0x00, 0xe0 }, + { 0x40, 0x20, 0x00 }, { 0x40, 0x20, 0x20 }, { 0x40, 0x20, 0x40 }, { 0x40, 0x20, 0x60 }, + { 0x40, 0x20, 0x80 }, { 0x40, 0x20, 0xa0 }, { 0x40, 0x20, 0xc0 }, { 0x40, 0x20, 0xe0 }, + { 0x40, 0x40, 0x00 }, { 0x40, 0x40, 0x20 }, { 0x40, 0x40, 0x40 }, { 0x40, 0x40, 0x60 }, + { 0x40, 0x40, 0x80 }, { 0x40, 0x40, 0xa0 }, { 0x40, 0x40, 0xc0 }, { 0x40, 0x40, 0xe0 }, + { 0x40, 0x60, 0x00 }, { 0x40, 0x60, 0x20 }, { 0x40, 0x60, 0x40 }, { 0x40, 0x60, 0x60 }, + { 0x40, 0x60, 0x80 }, { 0x40, 0x60, 0xa0 }, { 0x40, 0x60, 0xc0 }, { 0x40, 0x60, 0xe0 }, + { 0x40, 0x80, 0x00 }, { 0x40, 0x80, 0x20 }, { 0x40, 0x80, 0x40 }, { 0x40, 0x80, 0x60 }, + { 0x40, 0x80, 0x80 }, { 0x40, 0x80, 0xa0 }, { 0x40, 0x80, 0xc0 }, { 0x40, 0x80, 0xe0 }, + { 0x40, 0xa0, 0x00 }, { 0x40, 0xa0, 0x20 }, { 0x40, 0xa0, 0x40 }, { 0x40, 0xa0, 0x60 }, + { 0x40, 0xa0, 0x80 }, { 0x40, 0xa0, 0xa0 }, { 0x40, 0xa0, 0xc0 }, { 0x40, 0xa0, 0xe0 }, + { 0x40, 0xc0, 0x00 }, { 0x40, 0xc0, 0x20 }, { 0x40, 0xc0, 0x40 }, { 0x40, 0xc0, 0x60 }, + { 0x40, 0xc0, 0x80 }, { 0x40, 0xc0, 0xa0 }, { 0x40, 0xc0, 0xc0 }, { 0x40, 0xc0, 0xe0 }, + { 0x40, 0xe0, 0x00 }, { 0x40, 0xe0, 0x20 }, { 0x40, 0xe0, 0x40 }, { 0x40, 0xe0, 0x60 }, + { 0x40, 0xe0, 0x80 }, { 0x40, 0xe0, 0xa0 }, { 0x40, 0xe0, 0xc0 }, { 0x40, 0xe0, 0xe0 }, + { 0x80, 0x00, 0x00 }, { 0x80, 0x00, 0x20 }, { 0x80, 0x00, 0x40 }, { 0x80, 0x00, 0x60 }, + { 0x80, 0x00, 0x80 }, { 0x80, 0x00, 0xa0 }, { 0x80, 0x00, 0xc0 }, { 0x80, 0x00, 0xe0 }, + { 0x80, 0x20, 0x00 }, { 0x80, 0x20, 0x20 }, { 0x80, 0x20, 0x40 }, { 0x80, 0x20, 0x60 }, + { 0x80, 0x20, 0x80 }, { 0x80, 0x20, 0xa0 }, { 0x80, 0x20, 0xc0 }, { 0x80, 0x20, 0xe0 }, + { 0x80, 0x40, 0x00 }, { 0x80, 0x40, 0x20 }, { 0x80, 0x40, 0x40 }, { 0x80, 0x40, 0x60 }, + { 0x80, 0x40, 0x80 }, { 0x80, 0x40, 0xa0 }, { 0x80, 0x40, 0xc0 }, { 0x80, 0x40, 0xe0 }, + { 0x80, 0x60, 0x00 }, { 0x80, 0x60, 0x20 }, { 0x80, 0x60, 0x40 }, { 0x80, 0x60, 0x60 }, + { 0x80, 0x60, 0x80 }, { 0x80, 0x60, 0xa0 }, { 0x80, 0x60, 0xc0 }, { 0x80, 0x60, 0xe0 }, + { 0x80, 0x80, 0x00 }, { 0x80, 0x80, 0x20 }, { 0x80, 0x80, 0x40 }, { 0x80, 0x80, 0x60 }, + { 0x80, 0x80, 0x80 }, { 0x80, 0x80, 0xa0 }, { 0x80, 0x80, 0xc0 }, { 0x80, 0x80, 0xe0 }, + { 0x80, 0xa0, 0x00 }, { 0x80, 0xa0, 0x20 }, { 0x80, 0xa0, 0x40 }, { 0x80, 0xa0, 0x60 }, + { 0x80, 0xa0, 0x80 }, { 0x80, 0xa0, 0xa0 }, { 0x80, 0xa0, 0xc0 }, { 0x80, 0xa0, 0xe0 }, + { 0x80, 0xc0, 0x00 }, { 0x80, 0xc0, 0x20 }, { 0x80, 0xc0, 0x40 }, { 0x80, 0xc0, 0x60 }, + { 0x80, 0xc0, 0x80 }, { 0x80, 0xc0, 0xa0 }, { 0x80, 0xc0, 0xc0 }, { 0x80, 0xc0, 0xe0 }, + { 0x80, 0xe0, 0x00 }, { 0x80, 0xe0, 0x20 }, { 0x80, 0xe0, 0x40 }, { 0x80, 0xe0, 0x60 }, + { 0x80, 0xe0, 0x80 }, { 0x80, 0xe0, 0xa0 }, { 0x80, 0xe0, 0xc0 }, { 0x80, 0xe0, 0xe0 }, + { 0xc0, 0x00, 0x00 }, { 0xc0, 0x00, 0x20 }, { 0xc0, 0x00, 0x40 }, { 0xc0, 0x00, 0x60 }, + { 0xc0, 0x00, 0x80 }, { 0xc0, 0x00, 0xa0 }, { 0xc0, 0x00, 0xc0 }, { 0xc0, 0x00, 0xe0 }, + { 0xc0, 0x20, 0x00 }, { 0xc0, 0x20, 0x20 }, { 0xc0, 0x20, 0x40 }, { 0xc0, 0x20, 0x60 }, + { 0xc0, 0x20, 0x80 }, { 0xc0, 0x20, 0xa0 }, { 0xc0, 0x20, 0xc0 }, { 0xc0, 0x20, 0xe0 }, + { 0xc0, 0x40, 0x00 }, { 0xc0, 0x40, 0x20 }, { 0xc0, 0x40, 0x40 }, { 0xc0, 0x40, 0x60 }, + { 0xc0, 0x40, 0x80 }, { 0xc0, 0x40, 0xa0 }, { 0xc0, 0x40, 0xc0 }, { 0xc0, 0x40, 0xe0 }, + { 0xc0, 0x60, 0x00 }, { 0xc0, 0x60, 0x20 }, { 0xc0, 0x60, 0x40 }, { 0xc0, 0x60, 0x60 }, + { 0xc0, 0x60, 0x80 }, { 0xc0, 0x60, 0xa0 }, { 0xc0, 0x60, 0xc0 }, { 0xc0, 0x60, 0xe0 }, + { 0xc0, 0x80, 0x00 }, { 0xc0, 0x80, 0x20 }, { 0xc0, 0x80, 0x40 }, { 0xc0, 0x80, 0x60 }, + { 0xc0, 0x80, 0x80 }, { 0xc0, 0x80, 0xa0 }, { 0xc0, 0x80, 0xc0 }, { 0xc0, 0x80, 0xe0 }, + { 0xc0, 0xa0, 0x00 }, { 0xc0, 0xa0, 0x20 }, { 0xc0, 0xa0, 0x40 }, { 0xc0, 0xa0, 0x60 }, + { 0xc0, 0xa0, 0x80 }, { 0xc0, 0xa0, 0xa0 }, { 0xc0, 0xa0, 0xc0 }, { 0xc0, 0xa0, 0xe0 }, + { 0xc0, 0xc0, 0x00 }, { 0xc0, 0xc0, 0x20 }, { 0xc0, 0xc0, 0x40 }, { 0xc0, 0xc0, 0x60 }, + { 0xc0, 0xc0, 0x80 }, { 0xc0, 0xc0, 0xa0 }, { 0xf0, 0xfb, 0xff }, { 0xa4, 0xa0, 0xa0 }, + { 0x80, 0x80, 0x80 }, { 0x00, 0x00, 0xff }, { 0x00, 0xff, 0x00 }, { 0x00, 0xff, 0xff }, + { 0xff, 0x00, 0x00 }, { 0xff, 0x00, 0xff }, { 0xff, 0xff, 0x00 }, { 0xff, 0xff, 0xff } +}; + +static HPALETTE create_default_palette( int bpp ) +{ + char pal_buffer[sizeof(LOGPALETTE) + 255 * sizeof(PALETTEENTRY)]; + LOGPALETTE *pal = (LOGPALETTE *)pal_buffer; + PALETTEENTRY *entries = pal->palPalEntry; + int i; + + pal->palVersion = 0x300; + pal->palNumEntries = 1 << bpp; + switch (bpp) + { + case 1: + for (i = 0; i < 2; i++) + { + entries[i].peRed = default_palette_1[i].rgbRed; + entries[i].peGreen = default_palette_1[i].rgbGreen; + entries[i].peBlue = default_palette_1[i].rgbBlue; + entries[i].peFlags = 0; + } + break; + case 4: + for (i = 0; i < 16; i++) + { + entries[i].peRed = default_palette_4[i].rgbRed; + entries[i].peGreen = default_palette_4[i].rgbGreen; + entries[i].peBlue = default_palette_4[i].rgbBlue; + entries[i].peFlags = 0; + } + break; + case 8: + for (i = 0; i < 256; i++) + { + entries[i].peRed = default_palette_8[i].rgbRed; + entries[i].peGreen = default_palette_8[i].rgbGreen; + entries[i].peBlue = default_palette_8[i].rgbBlue; + entries[i].peFlags = 0; + } + break; + } + return CreatePalette( pal ); +} + static inline void solid_patblt( HDC hdc, int x, int y, int width, int height, COLORREF color ) { HBRUSH brush = CreateSolidBrush( color ); @@ -1518,7 +1641,7 @@ static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits) BOOL dib_is_8bpp_gray = (bmi->bmiHeader.biBitCount == 8 && bmi->bmiColors[1].rgbRed == 1); BLENDFUNCTION blend; COLORREF old_text, old_bkgnd; - HPALETTE hpal; + HPALETTE hpal, old_hpal; blend.BlendOp = AC_SRC_OVER; blend.BlendFlags = 0; @@ -2605,7 +2728,7 @@ static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits) entries[i].peFlags = 0; } hpal = CreatePalette( pal ); - SelectPalette( hdc, hpal, FALSE ); + old_hpal = SelectPalette( hdc, hpal, FALSE ); solid_patblt( hdc, 20, 10, 10, 10, PALETTEINDEX(15) ); Rectangle( hdc, 0, 0, 10, 10 ); @@ -2632,7 +2755,7 @@ static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits) SelectObject( hdc, orig_brush ); DeleteObject( dib_brush ); - SelectPalette( hdc, GetStockObject(DEFAULT_PALETTE), FALSE ); + SelectPalette( hdc, old_hpal, FALSE ); DeleteObject( hpal ); /* NT4 broken for all cases, W2K for 1 bpp only */ @@ -2655,7 +2778,7 @@ static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits) SelectObject( hdc, solid_brush ); ret = ExtFloodFill( hdc, 100, 100, RGB( 0, 0xff, 0 ), FLOODFILLSURFACE ); - ok (!ret == !!dib_is_1bpp, "got ret %d\n", ret); + ok (ret, "got ret %d\n", ret); compare_hash(hdc, bmi, bits, "flood fill" ); ExtSelectClipRgn( hdc, NULL, RGN_COPY ); @@ -2724,17 +2847,17 @@ static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; static void draw_text_2( HDC hdc, BITMAPINFO *bmi, BYTE *bits, BOOL aa ) { DWORD dib_size = get_dib_size(bmi), ret; - LOGFONT lf; + LOGFONTA lf; HFONT font; GLYPHMETRICS gm; BYTE g_buf[10000]; int i, stride, x, y; static const MAT2 identity = { {0,1}, {0,0}, {0,0}, {0,1} }; char *eto_hash = NULL, *diy_hash = NULL; - static const char *str = "Hello Wine"; + static const char str[] = "Hello Wine"; POINT origin, g_org; static const BYTE vals[4] = { 0x00, 0x00, 0x00, 0x00 }; - TEXTMETRIC tm; + TEXTMETRICA tm; COLORREF text_color; for(i = 0; i < dib_size; i++) @@ -2745,10 +2868,10 @@ static void draw_text_2( HDC hdc, BITMAPINFO *bmi, BYTE *bits, BOOL aa ) lf.lfHeight = 24; lf.lfQuality = aa ? ANTIALIASED_QUALITY : NONANTIALIASED_QUALITY; - font = CreateFontIndirect( &lf ); + font = CreateFontIndirectA( &lf ); font = SelectObject( hdc, font ); - GetTextMetrics( hdc, &tm ); + GetTextMetricsA( hdc, &tm ); if (!(tm.tmPitchAndFamily & TMPF_VECTOR)) { skip( "skipping as a bitmap font has been selected for Tahoma.\n" ); @@ -2762,7 +2885,7 @@ static void draw_text_2( HDC hdc, BITMAPINFO *bmi, BYTE *bits, BOOL aa ) origin.x = 10; origin.y = 100; - ExtTextOut( hdc, origin.x, origin.y, 0, NULL, str, strlen(str), NULL ); + ExtTextOutA( hdc, origin.x, origin.y, 0, NULL, str, strlen(str), NULL ); eto_hash = hash_dib( bmi, bits ); for(i = 0; i < dib_size; i++) @@ -2775,11 +2898,11 @@ static void draw_text_2( HDC hdc, BITMAPINFO *bmi, BYTE *bits, BOOL aa ) { DWORD ggo_flags = aa ? GGO_GRAY4_BITMAP : GGO_BITMAP; - ret = GetGlyphOutline( hdc, str[i], ggo_flags, &gm, 0, NULL, &identity ); + ret = GetGlyphOutlineA( hdc, str[i], ggo_flags, &gm, 0, NULL, &identity ); if (ret == GDI_ERROR) continue; - if (ret) GetGlyphOutline( hdc, str[i], ggo_flags, &gm, sizeof(g_buf), g_buf, &identity ); + if (ret) GetGlyphOutlineA( hdc, str[i], ggo_flags, &gm, sizeof(g_buf), g_buf, &identity ); g_org.x = origin.x + gm.gmptGlyphOrigin.x; g_org.y = origin.y - gm.gmptGlyphOrigin.y; @@ -2859,6 +2982,7 @@ static void test_simple_graphics(void) BYTE *bits; HBITMAP dib, orig_bm; DIBSECTION ds; + HPALETTE default_palette, old_hpal; int i; mem_dc = CreateCompatibleDC(NULL); @@ -2885,6 +3009,9 @@ static void test_simple_graphics(void) orig_bm = SelectObject(mem_dc, dib); + default_palette = create_default_palette( 8 ); + old_hpal = SelectPalette( mem_dc, default_palette, FALSE ); + dst_format = "8888"; current_sha1 = sha1_graphics_a8r8g8b8; draw_graphics(mem_dc, bmi, bits); @@ -2910,6 +3037,7 @@ static void test_simple_graphics(void) ok(ds.dsBmih.biCompression == BI_BITFIELDS, "got %x\n", ds.dsBmih.biCompression); orig_bm = SelectObject(mem_dc, dib); + SelectPalette( mem_dc, default_palette, FALSE ); dst_format = "8888 - bitfields"; current_sha1 = sha1_graphics_a8r8g8b8_bitfields; @@ -3148,6 +3276,7 @@ static void test_simple_graphics(void) ok(dib != NULL, "ret NULL\n"); orig_bm = SelectObject(mem_dc, dib); + DeleteObject( SelectPalette( mem_dc, create_default_palette(4), FALSE )); dst_format = "4"; current_sha1 = sha1_graphics_4; @@ -3191,12 +3320,14 @@ static void test_simple_graphics(void) ok(dib != NULL, "ret NULL\n"); orig_bm = SelectObject(mem_dc, dib); + DeleteObject( SelectPalette( mem_dc, create_default_palette(1), FALSE )); dst_format = "1"; current_sha1 = sha1_graphics_1; draw_graphics(mem_dc, bmi, bits); draw_text(mem_dc, bmi, bits); + DeleteObject( SelectPalette( mem_dc, old_hpal, FALSE )); SelectObject(mem_dc, orig_bm); DeleteObject(dib); diff --git a/rostests/winetests/gdi32/font.c b/rostests/winetests/gdi32/font.c index 394ffb4dfb1..f0427c54db7 100644 --- a/rostests/winetests/gdi32/font.c +++ b/rostests/winetests/gdi32/font.c @@ -31,7 +31,7 @@ #include "wine/test.h" /* Do not allow more than 1 deviation here */ -#define match_off_by_1(a, b) (abs((a) - (b)) <= 1) +#define match_off_by_1(a, b, exact) (abs((a) - (b)) <= ((exact) ? 0 : 1)) #define near_match(a, b) (abs((a) - (b)) <= 6) #define expect(expected, got) ok(got == expected, "Expected %.8x, got %.8x\n", expected, got) @@ -42,13 +42,15 @@ static BOOL (WINAPI *pGetCharABCWidthsI)(HDC hdc, UINT first, UINT count, LPWOR static BOOL (WINAPI *pGetCharABCWidthsA)(HDC hdc, UINT first, UINT last, LPABC abc); static BOOL (WINAPI *pGetCharABCWidthsW)(HDC hdc, UINT first, UINT last, LPABC abc); static BOOL (WINAPI *pGetCharABCWidthsFloatW)(HDC hdc, UINT first, UINT last, LPABCFLOAT abc); +static BOOL (WINAPI *pGetCharWidth32A)(HDC hdc, UINT first, UINT last, LPINT buffer); +static BOOL (WINAPI *pGetCharWidth32W)(HDC hdc, UINT first, UINT last, LPINT buffer); static DWORD (WINAPI *pGetFontUnicodeRanges)(HDC hdc, LPGLYPHSET lpgs); static DWORD (WINAPI *pGetGlyphIndicesA)(HDC hdc, LPCSTR lpstr, INT count, LPWORD pgi, DWORD flags); static DWORD (WINAPI *pGetGlyphIndicesW)(HDC hdc, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags); static BOOL (WINAPI *pGetTextExtentExPointI)(HDC hdc, const WORD *indices, INT count, INT max_ext, LPINT nfit, LPINT dxs, LPSIZE size ); static BOOL (WINAPI *pGdiRealizationInfo)(HDC hdc, DWORD *); -static HFONT (WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDV *); +static HFONT (WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *); static HANDLE (WINAPI *pAddFontMemResourceEx)(PVOID, DWORD, PVOID, DWORD *); static BOOL (WINAPI *pRemoveFontMemResourceEx)(HANDLE); static INT (WINAPI *pAddFontResourceExA)(LPCSTR, DWORD, PVOID); @@ -58,6 +60,21 @@ static HMODULE hgdi32 = 0; static const MAT2 mat = { {0,1}, {0,0}, {0,0}, {0,1} }; static WORD system_lang_id; +#ifdef WORDS_BIGENDIAN +#define GET_BE_WORD(x) (x) +#define GET_BE_DWORD(x) (x) +#else +#define GET_BE_WORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x)) +#define GET_BE_DWORD(x) MAKELONG(GET_BE_WORD(HIWORD(x)), GET_BE_WORD(LOWORD(x))); +#endif + +#define MS_MAKE_TAG(ch0, ch1, ch2, ch3) \ + ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ + ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24)) +#define MS_OS2_TAG MS_MAKE_TAG('O','S','/','2') +#define MS_CMAP_TAG MS_MAKE_TAG('c','m','a','p') +#define MS_NAME_TAG MS_MAKE_TAG('n','a','m','e') + static void init(void) { hgdi32 = GetModuleHandleA("gdi32.dll"); @@ -68,6 +85,8 @@ static void init(void) pGetCharABCWidthsA = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsA"); pGetCharABCWidthsW = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsW"); pGetCharABCWidthsFloatW = (void *)GetProcAddress(hgdi32, "GetCharABCWidthsFloatW"); + pGetCharWidth32A = (void *)GetProcAddress(hgdi32, "GetCharWidth32A"); + pGetCharWidth32W = (void *)GetProcAddress(hgdi32, "GetCharWidth32W"); pGetFontUnicodeRanges = (void *)GetProcAddress(hgdi32, "GetFontUnicodeRanges"); pGetGlyphIndicesA = (void *)GetProcAddress(hgdi32, "GetGlyphIndicesA"); pGetGlyphIndicesW = (void *)GetProcAddress(hgdi32, "GetGlyphIndicesW"); @@ -82,7 +101,7 @@ static void init(void) system_lang_id = PRIMARYLANGID(GetSystemDefaultLangID()); } -static INT CALLBACK is_truetype_font_installed_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK is_truetype_font_installed_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { if (type != TRUETYPE_FONTTYPE) return 1; @@ -101,7 +120,7 @@ static BOOL is_truetype_font_installed(const char *name) return ret; } -static INT CALLBACK is_font_installed_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK is_font_installed_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { return 0; } @@ -118,6 +137,52 @@ static BOOL is_font_installed(const char *name) return ret; } +static void *get_res_data(const char *fontname, DWORD *rsrc_size) +{ + HRSRC rsrc; + void *rsrc_data; + + rsrc = FindResourceA(GetModuleHandleA(NULL), fontname, (LPCSTR)RT_RCDATA); + if (!rsrc) return NULL; + + rsrc_data = LockResource(LoadResource(GetModuleHandleA(NULL), rsrc)); + if (!rsrc_data) return NULL; + + *rsrc_size = SizeofResource(GetModuleHandleA(NULL), rsrc); + if (!*rsrc_size) return NULL; + + return rsrc_data; +} + +static BOOL write_tmp_file( const void *data, DWORD *size, char *tmp_name ) +{ + char tmp_path[MAX_PATH]; + HANDLE hfile; + BOOL ret; + + GetTempPathA(MAX_PATH, tmp_path); + GetTempFileNameA(tmp_path, "ttf", 0, tmp_name); + + hfile = CreateFileA(tmp_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + if (hfile == INVALID_HANDLE_VALUE) return FALSE; + + ret = WriteFile(hfile, data, *size, size, NULL); + + CloseHandle(hfile); + return ret; +} + +static BOOL write_ttf_file(const char *fontname, char *tmp_name) +{ + void *rsrc_data; + DWORD rsrc_size; + + rsrc_data = get_res_data( fontname, &rsrc_size ); + if (!rsrc_data) return FALSE; + + return write_tmp_file( rsrc_data, &rsrc_size, tmp_name ); +} + static void check_font(const char* test, const LOGFONTA* lf, HFONT hfont) { LOGFONTA getobj_lf; @@ -126,7 +191,7 @@ static void check_font(const char* test, const LOGFONTA* lf, HFONT hfont) if (!hfont) return; - ret = GetObject(hfont, sizeof(getobj_lf), &getobj_lf); + ret = GetObjectA(hfont, sizeof(getobj_lf), &getobj_lf); /* NT4 tries to be clever and only returns the minimum length */ while (lf->lfFaceName[minlen] && minlen < LF_FACESIZE-1) minlen++; @@ -196,11 +261,11 @@ static void test_logfont(void) DeleteObject(hfont); } -static INT CALLBACK font_enum_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK font_enum_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { if (type & RASTER_FONTTYPE) { - LOGFONT *lf = (LOGFONT *)lParam; + LOGFONTA *lf = (LOGFONTA *)lParam; *lf = *elf; return 0; /* stop enumeration */ } @@ -239,7 +304,7 @@ static void test_font_metrics(HDC hdc, HFONT hfont, LONG lfHeight, INT scale_x, INT scale_y) { LOGFONTA lf; - OUTLINETEXTMETRIC otm; + OUTLINETEXTMETRICA otm; TEXTMETRICA tm; SIZE size; INT width_of_A, cx, cy; @@ -674,9 +739,9 @@ static void test_outline_font(void) DeleteDC(hdc); } -static INT CALLBACK find_font_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK find_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { - LOGFONT *lf = (LOGFONT *)lParam; + LOGFONTA *lf = (LOGFONTA *)lParam; if (elf->lfHeight == lf->lfHeight && !strcmp(elf->lfFaceName, lf->lfFaceName)) { @@ -847,9 +912,9 @@ static void test_bitmap_font_metrics(void) }; static const int font_log_pixels[] = { 96, 120 }; HDC hdc; - LOGFONT lf; + LOGFONTA lf; HFONT hfont, old_hfont; - TEXTMETRIC tm; + TEXTMETRICA tm; INT ret, i, expected_cs, screen_log_pixels, diff, font_res; char face_name[LF_FACESIZE]; CHARSETINFO csi; @@ -908,7 +973,7 @@ static void test_bitmap_font_metrics(void) lf.lfCharSet = csi.ciCharset; trace("looking for %s height %d charset %d\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet); - ret = EnumFontFamiliesEx(hdc, &lf, find_font_proc, (LPARAM)&lf, 0); + ret = EnumFontFamiliesExA(hdc, &lf, find_font_proc, (LPARAM)&lf, 0); if (fd[i].height & FH_SCALE) ok(ret, "scaled font height %d should not be enumerated\n", height); else @@ -928,10 +993,10 @@ static void test_bitmap_font_metrics(void) old_hfont = SelectObject(hdc, hfont); SetLastError(0xdeadbeef); - ret = GetTextFace(hdc, sizeof(face_name), face_name); + ret = GetTextFaceA(hdc, sizeof(face_name), face_name); ok(ret, "GetTextFace error %u\n", GetLastError()); - if (lstrcmp(face_name, fd[i].face_name) != 0) + if (strcmp(face_name, fd[i].face_name) != 0) { ok(ret != ANSI_CHARSET, "font charset should not be ANSI_CHARSET\n"); ok(ret != expected_cs, "font charset %d should not be %d\n", ret, expected_cs); @@ -943,13 +1008,13 @@ static void test_bitmap_font_metrics(void) memset(&gm, 0, sizeof(gm)); SetLastError(0xdeadbeef); - ret = GetGlyphOutline(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); + ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); todo_wine { ok(ret == GDI_ERROR, "GetGlyphOutline should fail for a bitmap font\n"); ok(GetLastError() == ERROR_CAN_NOT_COMPLETE, "expected ERROR_CAN_NOT_COMPLETE, got %u\n", GetLastError()); } - bRet = GetTextMetrics(hdc, &tm); + bRet = GetTextMetricsA(hdc, &tm); ok(bRet, "GetTextMetrics error %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -988,7 +1053,7 @@ static void test_bitmap_font_metrics(void) /* Don't run the max char width test on System/ANSI_CHARSET. We have extra characters in our font that make the max width bigger */ - if(strcmp(lf.lfFaceName, "System") || lf.lfCharSet != ANSI_CHARSET) + if ((strcmp(lf.lfFaceName, "System") || lf.lfCharSet != ANSI_CHARSET) && tm.tmDigitizedAspectX == 96) ok(tm.tmMaxCharWidth == fd[i].max_char_width, "%s(%d): tm.tmMaxCharWidth %d != %d\n", fd[i].face_name, height, tm.tmMaxCharWidth, fd[i].max_char_width); } else @@ -1020,7 +1085,7 @@ static void test_GdiGetCharDimensions(void) hdc = CreateCompatibleDC(NULL); - GetTextExtentPoint(hdc, szAlphabet, strlen(szAlphabet), &size); + GetTextExtentPointA(hdc, szAlphabet, strlen(szAlphabet), &size); avgwidth = ((size.cx / 26) + 1) / 2; ret = pGdiGetCharDimensions(hdc, &tm, &height); @@ -1041,15 +1106,15 @@ static void test_GdiGetCharDimensions(void) DeleteDC(hdc); } -static int CALLBACK create_font_proc(const LOGFONT *lpelfe, - const TEXTMETRIC *lpntme, +static int CALLBACK create_font_proc(const LOGFONTA *lpelfe, + const TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam) { if (FontType & TRUETYPE_FONTTYPE) { HFONT hfont; - hfont = CreateFontIndirect(lpelfe); + hfont = CreateFontIndirectA(lpelfe); if (hfont) { *(HFONT *)lParam = hfont; @@ -1060,17 +1125,50 @@ static int CALLBACK create_font_proc(const LOGFONT *lpelfe, return 1; } +static void ABCWidths_helper(const char* description, HDC hdc, WORD *glyphs, ABC *base_abci, ABC *base_abcw, ABCFLOAT *base_abcf, INT todo) +{ + ABC abc[1]; + ABCFLOAT abcf[1]; + BOOL ret = FALSE; + + ret = pGetCharABCWidthsI(hdc, 0, 1, glyphs, abc); + ok(ret, "%s: GetCharABCWidthsI should have succeeded\n", description); + ok ((INT)abc->abcB > 0, "%s: abcB should be positive\n", description); + if (todo) todo_wine ok(abc->abcA * base_abci->abcA >= 0, "%s: abcA's sign should be unchanged\n", description); + else ok(abc->abcA * base_abci->abcA >= 0, "%s: abcA's sign should be unchanged\n", description); + if (todo) todo_wine ok(abc->abcC * base_abci->abcC >= 0, "%s: abcC's sign should be unchanged\n", description); + else ok(abc->abcC * base_abci->abcC >= 0, "%s: abcC's sign should be unchanged\n", description); + + ret = pGetCharABCWidthsW(hdc, 'i', 'i', abc); + ok(ret, "%s: GetCharABCWidthsW should have succeeded\n", description); + ok ((INT)abc->abcB > 0, "%s: abcB should be positive\n", description); + if (todo) todo_wine ok(abc->abcA * base_abcw->abcA >= 0, "%s: abcA's sign should be unchanged\n", description); + else ok(abc->abcA * base_abcw->abcA >= 0, "%s: abcA's sign should be unchanged\n", description); + if (todo) todo_wine ok(abc->abcC * base_abcw->abcC >= 0, "%s: abcC's sign should be unchanged\n", description); + else ok(abc->abcC * base_abcw->abcC >= 0, "%s: abcC's should be unchanged\n", description); + + ret = pGetCharABCWidthsFloatW(hdc, 'i', 'i', abcf); + ok(ret, "%s: GetCharABCWidthsFloatW should have succeeded\n", description); + ok (abcf->abcfB > 0.0, "%s: abcfB should be positive\n", description); + if (todo) todo_wine ok(abcf->abcfA * base_abcf->abcfA >= 0.0, "%s: abcfA's sign should be unchanged\n", description); + else ok(abcf->abcfA * base_abcf->abcfA >= 0.0, "%s: abcfA's should be unchanged\n", description); + if (todo) todo_wine ok(abcf->abcfC * base_abcf->abcfC >= 0.0, "%s: abcfC's sign should be unchanged\n", description); + else ok(abcf->abcfC * base_abcf->abcfC >= 0.0, "%s: abcfC's sign should be unchanged\n", description); +} + static void test_GetCharABCWidths(void) { - static const WCHAR str[] = {'a',0}; + static const WCHAR str[] = {'i',0}; BOOL ret; HDC hdc; LOGFONTA lf; HFONT hfont; ABC abc[1]; + ABC abcw[1]; ABCFLOAT abcf[1]; WORD glyphs[1]; DWORD nb; + HWND hwnd; static const struct { UINT first; @@ -1104,8 +1202,6 @@ static void test_GetCharABCWidths(void) {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}}, {HANGEUL_CHARSET, 0x8141, 0xac02, {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}}, - {JOHAB_CHARSET, 0x8446, 0x3135, - {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}}, {GB2312_CHARSET, 0x8141, 0x4e04, {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}}, {CHINESEBIG5_CHARSET, 0xa142, 0x3001, @@ -1169,7 +1265,7 @@ static void test_GetCharABCWidths(void) lf.lfFaceName[0] = '\0'; lf.lfCharSet = c[i].cs; lf.lfPitchAndFamily = 0; - if (EnumFontFamiliesEx(hdc, &lf, create_font_proc, (LPARAM)&hfont, 0)) + if (EnumFontFamiliesExA(hdc, &lf, create_font_proc, (LPARAM)&hfont, 0)) { skip("TrueType font for charset %u is not installed\n", c[i].cs); continue; @@ -1212,14 +1308,108 @@ static void test_GetCharABCWidths(void) DeleteObject(hfont); } + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "Tahoma"); + lf.lfHeight = 200; + hfont = CreateFontIndirectA(&lf); + + /* test empty glyph's metrics */ + hfont = SelectObject(hdc, hfont); + ret = pGetCharABCWidthsFloatW(hdc, ' ', ' ', abcf); + ok(ret, "GetCharABCWidthsFloatW should have succeeded\n"); + ok(abcf[0].abcfB == 1.0, "got %f\n", abcf[0].abcfB); + ret = pGetCharABCWidthsW(hdc, ' ', ' ', abcw); + ok(ret, "GetCharABCWidthsW should have succeeded\n"); + ok(abcw[0].abcB == 1, "got %u\n", abcw[0].abcB); + + /* 1) prepare unrotated font metrics */ + ret = pGetCharABCWidthsW(hdc, 'a', 'a', abcw); + ok(ret, "GetCharABCWidthsW should have succeeded\n"); + DeleteObject(SelectObject(hdc, hfont)); + + /* 2) get rotated font metrics */ + lf.lfEscapement = lf.lfOrientation = 900; + hfont = CreateFontIndirectA(&lf); + hfont = SelectObject(hdc, hfont); + ret = pGetCharABCWidthsW(hdc, 'a', 'a', abc); + ok(ret, "GetCharABCWidthsW should have succeeded\n"); + + /* 3) compare ABC results */ + ok(match_off_by_1(abcw[0].abcA, abc[0].abcA, FALSE), + "got %d, expected %d (A)\n", abc[0].abcA, abcw[0].abcA); + ok(match_off_by_1(abcw[0].abcB, abc[0].abcB, FALSE), + "got %d, expected %d (B)\n", abc[0].abcB, abcw[0].abcB); + ok(match_off_by_1(abcw[0].abcC, abc[0].abcC, FALSE), + "got %d, expected %d (C)\n", abc[0].abcC, abcw[0].abcC); + + DeleteObject(SelectObject(hdc, hfont)); ReleaseDC(NULL, hdc); + + trace("ABC sign test for a variety of transforms:\n"); + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "Tahoma"); + lf.lfHeight = 20; + hfont = CreateFontIndirectA(&lf); + hwnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100, + 0, 0, 0, NULL); + hdc = GetDC(hwnd); + SetMapMode(hdc, MM_ANISOTROPIC); + SelectObject(hdc, hfont); + + nb = pGetGlyphIndicesW(hdc, str, 1, glyphs, 0); + ok(nb == 1, "GetGlyphIndicesW should have returned 1\n"); + + ret = pGetCharABCWidthsI(hdc, 0, 1, glyphs, abc); + ok(ret, "GetCharABCWidthsI should have succeeded\n"); + ret = pGetCharABCWidthsW(hdc, 'i', 'i', abcw); + ok(ret, "GetCharABCWidthsW should have succeeded\n"); + ret = pGetCharABCWidthsFloatW(hdc, 'i', 'i', abcf); + ok(ret, "GetCharABCWidthsFloatW should have succeeded\n"); + + ABCWidths_helper("LTR", hdc, glyphs, abc, abcw, abcf, 0); + SetWindowExtEx(hdc, -1, -1, NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ABCWidths_helper("LTR -1 compatible", hdc, glyphs, abc, abcw, abcf, 0); + SetGraphicsMode(hdc, GM_ADVANCED); + ABCWidths_helper("LTR -1 advanced", hdc, glyphs, abc, abcw, abcf, 1); + SetWindowExtEx(hdc, 1, 1, NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ABCWidths_helper("LTR 1 compatible", hdc, glyphs, abc, abcw, abcf, 0); + SetGraphicsMode(hdc, GM_ADVANCED); + ABCWidths_helper("LTR 1 advanced", hdc, glyphs, abc, abcw, abcf, 0); + + ReleaseDC(hwnd, hdc); + DestroyWindow(hwnd); + + trace("RTL layout\n"); + hwnd = CreateWindowExA(WS_EX_LAYOUTRTL, "static", "", WS_POPUP, 0,0,100,100, + 0, 0, 0, NULL); + hdc = GetDC(hwnd); + SetMapMode(hdc, MM_ANISOTROPIC); + SelectObject(hdc, hfont); + + ABCWidths_helper("RTL", hdc, glyphs, abc, abcw, abcf, 0); + SetWindowExtEx(hdc, -1, -1, NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ABCWidths_helper("RTL -1 compatible", hdc, glyphs, abc, abcw, abcf, 0); + SetGraphicsMode(hdc, GM_ADVANCED); + ABCWidths_helper("RTL -1 advanced", hdc, glyphs, abc, abcw, abcf, 0); + SetWindowExtEx(hdc, 1, 1, NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ABCWidths_helper("RTL 1 compatible", hdc, glyphs, abc, abcw, abcf, 0); + SetGraphicsMode(hdc, GM_ADVANCED); + ABCWidths_helper("RTL 1 advanced", hdc, glyphs, abc, abcw, abcf, 1); + + ReleaseDC(hwnd, hdc); + DestroyWindow(hwnd); + DeleteObject(hfont); } static void test_text_extents(void) { static const WCHAR wt[] = {'O','n','e','\n','t','w','o',' ','3',0}; LPINT extents; - INT i, len, fit1, fit2; + INT i, len, fit1, fit2, extents2[3]; LOGFONTA lf; TEXTMETRICA tm; HDC hdc; @@ -1281,7 +1471,6 @@ static void test_text_extents(void) GetTextExtentExPointW(hdc, wt, 2, 0, NULL, NULL, &sz1); ok(sz1.cx == sz2.cx && sz1.cy == sz2.cy, "GetTextExtentExPointW with lpnFit and alpDx both NULL returns incorrect results\n"); - HeapFree(GetProcessHeap(), 0, extents); /* extents functions fail with -ve counts (the interesting case being -1) */ ret = GetTextExtentPointA(hdc, "o", -1, &sz); @@ -1326,6 +1515,27 @@ static void test_text_extents(void) hfont = SelectObject(hdc, hfont); DeleteObject(hfont); + + /* non-MM_TEXT mapping mode */ + lf.lfHeight = 2000; + hfont = CreateFontIndirectA(&lf); + hfont = SelectObject(hdc, hfont); + + SetMapMode( hdc, MM_HIMETRIC ); + ret = GetTextExtentExPointW(hdc, wt, 3, 0, NULL, extents, &sz); + ok(ret, "got %d\n", ret); + ok(sz.cx == extents[2], "got %d vs %d\n", sz.cx, extents[2]); + + ret = GetTextExtentExPointW(hdc, wt, 3, extents[1], &fit1, extents2, &sz2); + ok(ret, "got %d\n", ret); + ok(fit1 == 2, "got %d\n", fit1); + ok(sz2.cx == sz.cx, "got %d vs %d\n", sz2.cx, sz.cx); + for(i = 0; i < 2; i++) + ok(extents2[i] == extents[i], "%d: %d, %d\n", i, extents2[i], extents[i]); + + hfont = SelectObject(hdc, hfont); + DeleteObject(hfont); + HeapFree(GetProcessHeap(), 0, extents); ReleaseDC(NULL, hdc); } @@ -1338,7 +1548,7 @@ static void test_GetGlyphIndices(void) DWORD flags = 0; WCHAR testtext[] = {'T','e','s','t',0xffff,0}; WORD glyphs[(sizeof(testtext)/2)-1]; - TEXTMETRIC textm; + TEXTMETRICA textm; HFONT hOldFont; if (!pGetGlyphIndicesW) { @@ -1355,7 +1565,7 @@ static void test_GetGlyphIndices(void) hfont = CreateFontIndirectA(&lf); ok(hfont != 0, "CreateFontIndirectEx failed\n"); - ok(GetTextMetrics(hdc, &textm), "GetTextMetric failed\n"); + ok(GetTextMetricsA(hdc, &textm), "GetTextMetric failed\n"); if (textm.tmCharSet == ANSI_CHARSET) { flags |= GGI_MARK_NONEXISTING_GLYPHS; @@ -1383,7 +1593,7 @@ static void test_GetGlyphIndices(void) hfont = CreateFontIndirectA(&lf); hOldFont = SelectObject(hdc, hfont); - ok(GetTextMetrics(hdc, &textm), "GetTextMetric failed\n"); + ok(GetTextMetricsA(hdc, &textm), "GetTextMetric failed\n"); flags |= GGI_MARK_NONEXISTING_GLYPHS; charcount = pGetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); ok(charcount == 5, "GetGlyphIndicesW count of glyphs should = 5 not %d\n", charcount); @@ -1475,7 +1685,7 @@ static void test_GetKerningPairs(void) } #endif }; - LOGFONT lf; + LOGFONTA lf; HFONT hfont, hfont_old; KERNINGPAIR *kern_pair; HDC hdc; @@ -1511,7 +1721,7 @@ static void test_GetKerningPairs(void) memset(&lf, 0, sizeof(lf)); strcpy(lf.lfFaceName, kd[i].face_name); lf.lfHeight = kd[i].height; - hfont = CreateFontIndirect(&lf); + hfont = CreateFontIndirectA(&lf); assert(hfont != 0); hfont_old = SelectObject(hdc, hfont); @@ -1521,9 +1731,9 @@ static void test_GetKerningPairs(void) uiRet = GetOutlineTextMetricsW(hdc, sizeof(otm), &otm); ok(uiRet == sizeof(otm), "GetOutlineTextMetricsW error %d\n", GetLastError()); - ok(match_off_by_1(kd[i].tmHeight, otm.otmTextMetrics.tmHeight), "expected %d, got %d\n", + ok(match_off_by_1(kd[i].tmHeight, otm.otmTextMetrics.tmHeight, FALSE), "expected %d, got %d\n", kd[i].tmHeight, otm.otmTextMetrics.tmHeight); - ok(match_off_by_1(kd[i].tmAscent, otm.otmTextMetrics.tmAscent), "expected %d, got %d\n", + ok(match_off_by_1(kd[i].tmAscent, otm.otmTextMetrics.tmAscent, FALSE), "expected %d, got %d\n", kd[i].tmAscent, otm.otmTextMetrics.tmAscent); ok(kd[i].tmDescent == otm.otmTextMetrics.tmDescent, "expected %d, got %d\n", kd[i].tmDescent, otm.otmTextMetrics.tmDescent); @@ -1609,36 +1819,22 @@ todo_wine { ReleaseDC(0, hdc); } -static void test_height_selection(void) +struct font_data { - static const struct font_data - { - const char face_name[LF_FACESIZE]; - int requested_height; - int weight, height, ascent, descent, int_leading, ext_leading, dpi; - } fd[] = - { - {"Tahoma", -12, FW_NORMAL, 14, 12, 2, 2, 0, 96 }, - {"Tahoma", -24, FW_NORMAL, 29, 24, 5, 5, 0, 96 }, - {"Tahoma", -48, FW_NORMAL, 58, 48, 10, 10, 0, 96 }, - {"Tahoma", -96, FW_NORMAL, 116, 96, 20, 20, 0, 96 }, - {"Tahoma", -192, FW_NORMAL, 232, 192, 40, 40, 0, 96 }, - {"Tahoma", 12, FW_NORMAL, 12, 10, 2, 2, 0, 96 }, - {"Tahoma", 24, FW_NORMAL, 24, 20, 4, 4, 0, 96 }, - {"Tahoma", 48, FW_NORMAL, 48, 40, 8, 8, 0, 96 }, - {"Tahoma", 96, FW_NORMAL, 96, 80, 16, 17, 0, 96 }, - {"Tahoma", 192, FW_NORMAL, 192, 159, 33, 33, 0, 96 } - }; - HDC hdc; - LOGFONT lf; + const char face_name[LF_FACESIZE]; + int requested_height; + int weight, height, ascent, descent, int_leading, ext_leading, dpi; + BOOL exact; +}; + +static void test_height( HDC hdc, const struct font_data *fd ) +{ + LOGFONTA lf; HFONT hfont, old_hfont; - TEXTMETRIC tm; + TEXTMETRICA tm; INT ret, i; - hdc = CreateCompatibleDC(0); - assert(hdc); - - for (i = 0; i < sizeof(fd)/sizeof(fd[0]); i++) + for (i = 0; fd[i].face_name[0]; i++) { if (!is_truetype_font_installed(fd[i].face_name)) { @@ -1651,36 +1847,241 @@ static void test_height_selection(void) lf.lfWeight = fd[i].weight; strcpy(lf.lfFaceName, fd[i].face_name); - hfont = CreateFontIndirect(&lf); + hfont = CreateFontIndirectA(&lf); assert(hfont); old_hfont = SelectObject(hdc, hfont); - ret = GetTextMetrics(hdc, &tm); + ret = GetTextMetricsA(hdc, &tm); ok(ret, "GetTextMetrics error %d\n", GetLastError()); if(fd[i].dpi == tm.tmDigitizedAspectX) { trace("found font %s, height %d charset %x dpi %d\n", lf.lfFaceName, lf.lfHeight, lf.lfCharSet, fd[i].dpi); ok(tm.tmWeight == fd[i].weight, "%s(%d): tm.tmWeight %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmWeight, fd[i].weight); - ok(match_off_by_1(tm.tmHeight, fd[i].height), "%s(%d): tm.tmHeight %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmHeight, fd[i].height); - ok(match_off_by_1(tm.tmAscent, fd[i].ascent), "%s(%d): tm.tmAscent %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmAscent, fd[i].ascent); - ok(match_off_by_1(tm.tmDescent, fd[i].descent), "%s(%d): tm.tmDescent %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmDescent, fd[i].descent); -#if 0 /* FIXME: calculation of tmInternalLeading in Wine doesn't match what Windows does */ - ok(tm.tmInternalLeading == fd[i].int_leading, "%s(%d): tm.tmInternalLeading %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmInternalLeading, fd[i].int_leading); -#endif + ok(match_off_by_1(tm.tmHeight, fd[i].height, fd[i].exact), "%s(%d): tm.tmHeight %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmHeight, fd[i].height); + ok(match_off_by_1(tm.tmAscent, fd[i].ascent, fd[i].exact), "%s(%d): tm.tmAscent %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmAscent, fd[i].ascent); + ok(match_off_by_1(tm.tmDescent, fd[i].descent, fd[i].exact), "%s(%d): tm.tmDescent %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmDescent, fd[i].descent); + ok(match_off_by_1(tm.tmInternalLeading, fd[i].int_leading, fd[i].exact), "%s(%d): tm.tmInternalLeading %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmInternalLeading, fd[i].int_leading); ok(tm.tmExternalLeading == fd[i].ext_leading, "%s(%d): tm.tmExternalLeading %d != %d\n", fd[i].face_name, fd[i].requested_height, tm.tmExternalLeading, fd[i].ext_leading); } SelectObject(hdc, old_hfont); DeleteObject(hfont); } +} + +static void *find_ttf_table( void *ttf, DWORD size, DWORD tag ) +{ + WORD i, num_tables = GET_BE_WORD(*((WORD *)ttf + 2)); + DWORD *table = (DWORD *)ttf + 3; + + for (i = 0; i < num_tables; i++) + { + if (table[0] == tag) + return (BYTE *)ttf + GET_BE_DWORD(table[2]); + table += 4; + } + return NULL; +} + +static void test_height_selection_vdmx( HDC hdc ) +{ + static const struct font_data charset_0[] = /* doesn't use VDMX */ + { + { "wine_vdmx", 10, FW_NORMAL, 10, 8, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 11, FW_NORMAL, 11, 9, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 12, FW_NORMAL, 12, 10, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 13, FW_NORMAL, 13, 11, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 14, FW_NORMAL, 14, 12, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 15, FW_NORMAL, 15, 12, 3, 3, 0, 96, FALSE }, + { "wine_vdmx", 16, FW_NORMAL, 16, 13, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", 17, FW_NORMAL, 17, 14, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", 18, FW_NORMAL, 18, 15, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", 19, FW_NORMAL, 19, 16, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", 20, FW_NORMAL, 20, 17, 3, 4, 0, 96, FALSE }, + { "wine_vdmx", 21, FW_NORMAL, 21, 17, 4, 4, 0, 96, TRUE }, + { "wine_vdmx", 22, FW_NORMAL, 22, 18, 4, 4, 0, 96, TRUE }, + { "wine_vdmx", 23, FW_NORMAL, 23, 19, 4, 4, 0, 96, TRUE }, + { "wine_vdmx", 24, FW_NORMAL, 24, 20, 4, 4, 0, 96, TRUE }, + { "wine_vdmx", 25, FW_NORMAL, 25, 21, 4, 4, 0, 96, TRUE }, + { "wine_vdmx", 26, FW_NORMAL, 26, 22, 4, 5, 0, 96, FALSE }, + { "wine_vdmx", 27, FW_NORMAL, 27, 22, 5, 5, 0, 96, TRUE }, + { "wine_vdmx", 28, FW_NORMAL, 28, 23, 5, 5, 0, 96, TRUE }, + { "wine_vdmx", 29, FW_NORMAL, 29, 24, 5, 5, 0, 96, TRUE }, + { "wine_vdmx", 30, FW_NORMAL, 30, 25, 5, 5, 0, 96, TRUE }, + { "wine_vdmx", 31, FW_NORMAL, 31, 26, 5, 5, 0, 96, TRUE }, + { "wine_vdmx", 32, FW_NORMAL, 32, 27, 5, 6, 0, 96, FALSE }, + { "wine_vdmx", 48, FW_NORMAL, 48, 40, 8, 8, 0, 96, TRUE }, + { "wine_vdmx", 64, FW_NORMAL, 64, 53, 11, 11, 0, 96, TRUE }, + { "wine_vdmx", 96, FW_NORMAL, 96, 80, 16, 17, 0, 96, FALSE }, + { "wine_vdmx", -10, FW_NORMAL, 12, 10, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", -11, FW_NORMAL, 13, 11, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", -12, FW_NORMAL, 14, 12, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", -13, FW_NORMAL, 16, 13, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", -14, FW_NORMAL, 17, 14, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", -15, FW_NORMAL, 18, 15, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", -16, FW_NORMAL, 19, 16, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", -17, FW_NORMAL, 21, 17, 4, 4, 0, 96, TRUE }, + { "wine_vdmx", -18, FW_NORMAL, 22, 18, 4, 4, 0, 96, TRUE }, + { "wine_vdmx", -19, FW_NORMAL, 23, 19, 4, 4, 0, 96, TRUE }, + { "wine_vdmx", -20, FW_NORMAL, 24, 20, 4, 4, 0, 96, TRUE }, + { "wine_vdmx", -21, FW_NORMAL, 25, 21, 4, 4, 0, 96, TRUE }, + { "wine_vdmx", -22, FW_NORMAL, 27, 22, 5, 5, 0, 96, TRUE }, + { "wine_vdmx", -23, FW_NORMAL, 28, 23, 5, 5, 0, 96, TRUE }, + { "wine_vdmx", -24, FW_NORMAL, 29, 24, 5, 5, 0, 96, TRUE }, + { "wine_vdmx", -25, FW_NORMAL, 30, 25, 5, 5, 0, 96, TRUE }, + { "wine_vdmx", -26, FW_NORMAL, 31, 26, 5, 5, 0, 96, TRUE }, + { "wine_vdmx", -27, FW_NORMAL, 33, 27, 6, 6, 0, 96, TRUE }, + { "wine_vdmx", -28, FW_NORMAL, 34, 28, 6, 6, 0, 96, TRUE }, + { "wine_vdmx", -29, FW_NORMAL, 35, 29, 6, 6, 0, 96, TRUE }, + { "wine_vdmx", -30, FW_NORMAL, 36, 30, 6, 6, 0, 96, TRUE }, + { "wine_vdmx", -31, FW_NORMAL, 37, 31, 6, 6, 0, 96, TRUE }, + { "wine_vdmx", -32, FW_NORMAL, 39, 32, 7, 7, 0, 96, TRUE }, + { "wine_vdmx", -48, FW_NORMAL, 58, 48, 10, 10, 0, 96, TRUE }, + { "wine_vdmx", -64, FW_NORMAL, 77, 64, 13, 13, 0, 96, TRUE }, + { "wine_vdmx", -96, FW_NORMAL, 116, 96, 20, 20, 0, 96, TRUE }, + { "", 0, 0, 0, 0, 0, 0, 0, 0, 0 } + }; + + static const struct font_data charset_1[] = /* Uses VDMX */ + { + { "wine_vdmx", 10, FW_NORMAL, 10, 8, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 11, FW_NORMAL, 11, 9, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 12, FW_NORMAL, 12, 10, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 13, FW_NORMAL, 13, 11, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 14, FW_NORMAL, 13, 11, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 15, FW_NORMAL, 13, 11, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", 16, FW_NORMAL, 16, 13, 3, 4, 0, 96, TRUE }, + { "wine_vdmx", 17, FW_NORMAL, 16, 13, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", 18, FW_NORMAL, 16, 13, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", 19, FW_NORMAL, 19, 15, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", 20, FW_NORMAL, 20, 16, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", 21, FW_NORMAL, 21, 17, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", 22, FW_NORMAL, 22, 18, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", 23, FW_NORMAL, 23, 19, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", 24, FW_NORMAL, 23, 19, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", 25, FW_NORMAL, 25, 21, 4, 6, 0, 96, TRUE }, + { "wine_vdmx", 26, FW_NORMAL, 26, 22, 4, 6, 0, 96, TRUE }, + { "wine_vdmx", 27, FW_NORMAL, 27, 23, 4, 6, 0, 96, TRUE }, + { "wine_vdmx", 28, FW_NORMAL, 27, 23, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", 29, FW_NORMAL, 29, 24, 5, 6, 0, 96, TRUE }, + { "wine_vdmx", 30, FW_NORMAL, 29, 24, 5, 6, 0, 96, TRUE }, + { "wine_vdmx", 31, FW_NORMAL, 29, 24, 5, 6, 0, 96, TRUE }, + { "wine_vdmx", 32, FW_NORMAL, 32, 26, 6, 8, 0, 96, TRUE }, + { "wine_vdmx", 48, FW_NORMAL, 48, 40, 8, 10, 0, 96, TRUE }, + { "wine_vdmx", 64, FW_NORMAL, 64, 54, 10, 13, 0, 96, TRUE }, + { "wine_vdmx", 96, FW_NORMAL, 95, 79, 16, 18, 0, 96, TRUE }, + { "wine_vdmx", -10, FW_NORMAL, 12, 10, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", -11, FW_NORMAL, 13, 11, 2, 2, 0, 96, TRUE }, + { "wine_vdmx", -12, FW_NORMAL, 16, 13, 3, 4, 0, 96, TRUE }, + { "wine_vdmx", -13, FW_NORMAL, 16, 13, 3, 3, 0, 96, TRUE }, + { "wine_vdmx", -14, FW_NORMAL, 19, 15, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", -15, FW_NORMAL, 20, 16, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", -16, FW_NORMAL, 21, 17, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", -17, FW_NORMAL, 22, 18, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", -18, FW_NORMAL, 23, 19, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", -19, FW_NORMAL, 25, 21, 4, 6, 0, 96, TRUE }, + { "wine_vdmx", -20, FW_NORMAL, 26, 22, 4, 6, 0, 96, TRUE }, + { "wine_vdmx", -21, FW_NORMAL, 27, 23, 4, 6, 0, 96, TRUE }, + { "wine_vdmx", -22, FW_NORMAL, 27, 23, 4, 5, 0, 96, TRUE }, + { "wine_vdmx", -23, FW_NORMAL, 29, 24, 5, 6, 0, 96, TRUE }, + { "wine_vdmx", -24, FW_NORMAL, 32, 26, 6, 8, 0, 96, TRUE }, + { "wine_vdmx", -25, FW_NORMAL, 32, 26, 6, 7, 0, 96, TRUE }, + { "wine_vdmx", -26, FW_NORMAL, 33, 27, 6, 7, 0, 96, TRUE }, + { "wine_vdmx", -27, FW_NORMAL, 35, 29, 6, 8, 0, 96, TRUE }, + { "wine_vdmx", -28, FW_NORMAL, 36, 30, 6, 8, 0, 96, TRUE }, + { "wine_vdmx", -29, FW_NORMAL, 36, 30, 6, 7, 0, 96, TRUE }, + { "wine_vdmx", -30, FW_NORMAL, 38, 32, 6, 8, 0, 96, TRUE }, + { "wine_vdmx", -31, FW_NORMAL, 39, 33, 6, 8, 0, 96, TRUE }, + { "wine_vdmx", -32, FW_NORMAL, 40, 33, 7, 8, 0, 96, TRUE }, + { "wine_vdmx", -48, FW_NORMAL, 60, 50, 10, 12, 0, 96, TRUE }, + { "wine_vdmx", -64, FW_NORMAL, 81, 67, 14, 17, 0, 96, TRUE }, + { "wine_vdmx", -96, FW_NORMAL, 119, 99, 20, 23, 0, 96, TRUE }, + { "", 0, 0, 0, 0, 0, 0, 0, 0, 0 } + }; + + static const struct vdmx_data + { + WORD version; + BYTE bCharSet; + const struct font_data *fd; + } data[] = + { + { 0, 0, charset_0 }, + { 0, 1, charset_1 }, + { 1, 0, charset_0 }, + { 1, 1, charset_1 } + }; + int i; + DWORD size, num; + WORD *vdmx_header; + BYTE *ratio_rec; + char ttf_name[MAX_PATH]; + void *res, *copy; + + if (!pAddFontResourceExA) + { + win_skip("AddFontResourceExA unavailable\n"); + return; + } + + for (i = 0; i < sizeof(data) / sizeof(data[0]); i++) + { + res = get_res_data( "wine_vdmx.ttf", &size ); + + copy = HeapAlloc( GetProcessHeap(), 0, size ); + memcpy( copy, res, size ); + vdmx_header = find_ttf_table( copy, size, MS_MAKE_TAG('V','D','M','X') ); + vdmx_header[0] = GET_BE_WORD( data[i].version ); + ok( GET_BE_WORD( vdmx_header[1] ) == 1, "got %04x\n", GET_BE_WORD( vdmx_header[1] ) ); + ok( GET_BE_WORD( vdmx_header[2] ) == 1, "got %04x\n", GET_BE_WORD( vdmx_header[2] ) ); + ratio_rec = (BYTE *)&vdmx_header[3]; + ratio_rec[0] = data[i].bCharSet; + + write_tmp_file( copy, &size, ttf_name ); + HeapFree( GetProcessHeap(), 0, copy ); + + ok( !is_truetype_font_installed("wine_vdmx"), "Already installed\n" ); + num = pAddFontResourceExA( ttf_name, FR_PRIVATE, 0 ); + if (!num) win_skip("Unable to add ttf font resource\n"); + else + { + ok( is_truetype_font_installed("wine_vdmx"), "Not installed\n" ); + test_height( hdc, data[i].fd ); + pRemoveFontResourceExA( ttf_name, FR_PRIVATE, 0 ); + } + DeleteFileA( ttf_name ); + } +} + +static void test_height_selection(void) +{ + static const struct font_data tahoma[] = + { + {"Tahoma", -12, FW_NORMAL, 14, 12, 2, 2, 0, 96, TRUE }, + {"Tahoma", -24, FW_NORMAL, 29, 24, 5, 5, 0, 96, TRUE }, + {"Tahoma", -48, FW_NORMAL, 58, 48, 10, 10, 0, 96, TRUE }, + {"Tahoma", -96, FW_NORMAL, 116, 96, 20, 20, 0, 96, TRUE }, + {"Tahoma", -192, FW_NORMAL, 232, 192, 40, 40, 0, 96, TRUE }, + {"Tahoma", 12, FW_NORMAL, 12, 10, 2, 2, 0, 96, TRUE }, + {"Tahoma", 24, FW_NORMAL, 24, 20, 4, 4, 0, 96, TRUE }, + {"Tahoma", 48, FW_NORMAL, 48, 40, 8, 8, 0, 96, TRUE }, + {"Tahoma", 96, FW_NORMAL, 96, 80, 16, 17, 0, 96, FALSE }, + {"Tahoma", 192, FW_NORMAL, 192, 159, 33, 33, 0, 96, TRUE }, + {"", 0, 0, 0, 0, 0, 0, 0, 0, 0 } + }; + HDC hdc = CreateCompatibleDC(0); + assert(hdc); + + test_height( hdc, tahoma ); + test_height_selection_vdmx( hdc ); DeleteDC(hdc); } static void test_GetOutlineTextMetrics(void) { - OUTLINETEXTMETRIC *otm; - LOGFONT lf; + OUTLINETEXTMETRICA *otm; + LOGFONTA lf; HFONT hfont, hfont_old; HDC hdc; DWORD ret, otm_size; @@ -1700,11 +2101,11 @@ static void test_GetOutlineTextMetrics(void) lf.lfWeight = FW_NORMAL; lf.lfPitchAndFamily = DEFAULT_PITCH; lf.lfQuality = PROOF_QUALITY; - hfont = CreateFontIndirect(&lf); + hfont = CreateFontIndirectA(&lf); assert(hfont != 0); hfont_old = SelectObject(hdc, hfont); - otm_size = GetOutlineTextMetrics(hdc, 0, NULL); + otm_size = GetOutlineTextMetricsA(hdc, 0, NULL); trace("otm buffer size %u (0x%x)\n", otm_size, otm_size); otm = HeapAlloc(GetProcessHeap(), 0, otm_size); @@ -1712,7 +2113,7 @@ static void test_GetOutlineTextMetrics(void) memset(otm, 0xAA, otm_size); SetLastError(0xdeadbeef); otm->otmSize = sizeof(*otm); /* just in case for Win9x compatibility */ - ret = GetOutlineTextMetrics(hdc, otm->otmSize, otm); + ret = GetOutlineTextMetricsA(hdc, otm->otmSize, otm); ok(ret == 1 /* Win9x */ || ret == otm->otmSize /* XP*/, "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); @@ -1727,7 +2128,7 @@ static void test_GetOutlineTextMetrics(void) memset(otm, 0xAA, otm_size); SetLastError(0xdeadbeef); otm->otmSize = otm_size; /* just in case for Win9x compatibility */ - ret = GetOutlineTextMetrics(hdc, otm->otmSize, otm); + ret = GetOutlineTextMetricsA(hdc, otm->otmSize, otm); ok(ret == 1 /* Win9x */ || ret == otm->otmSize /* XP*/, "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); @@ -1744,7 +2145,7 @@ static void test_GetOutlineTextMetrics(void) memset(&unset_ptr, 0xAA, sizeof(unset_ptr)); SetLastError(0xdeadbeef); otm->otmSize = sizeof(*otm) - sizeof(LPSTR); /* just in case for Win9x compatibility */ - ret = GetOutlineTextMetrics(hdc, otm->otmSize, otm); + ret = GetOutlineTextMetricsA(hdc, otm->otmSize, otm); ok(ret == 1 /* Win9x */ || ret == otm->otmSize /* XP*/, "expected %u, got %u, error %d\n", otm->otmSize, ret, GetLastError()); @@ -1764,18 +2165,18 @@ static void test_GetOutlineTextMetrics(void) ReleaseDC(0, hdc); } -static void testJustification(HDC hdc, PSTR str, RECT *clientArea) +static void testJustification(HDC hdc, PCSTR str, RECT *clientArea) { INT y, breakCount, areaWidth = clientArea->right - clientArea->left, nErrors = 0, e; - PSTR pFirstChar, pLastChar; + const char *pFirstChar, *pLastChar; SIZE size; TEXTMETRICA tm; struct err { - char *start; + const char *start; int len; int GetTextExtentExPointWWidth; } error[20]; @@ -1796,7 +2197,7 @@ static void testJustification(HDC hdc, PSTR str, RECT *clientArea) while (*str != '\0' && *str++ != tm.tmBreakChar); breakCount++; SetTextJustification(hdc, 0, 0); - GetTextExtentPoint32(hdc, pFirstChar, str - pFirstChar - 1, &size); + GetTextExtentPoint32A(hdc, pFirstChar, str - pFirstChar - 1, &size); } while ((int) size.cx < areaWidth); /* ignore trailing break chars */ @@ -1810,13 +2211,13 @@ static void testJustification(HDC hdc, PSTR str, RECT *clientArea) if (*str == '\0' || breakCount <= 0) pLastChar = str; SetTextJustification(hdc, 0, 0); - GetTextExtentPoint32(hdc, pFirstChar, pLastChar - pFirstChar, &size); + GetTextExtentPoint32A(hdc, pFirstChar, pLastChar - pFirstChar, &size); /* do not justify the last extent */ if (*str != '\0' && breakCount > 0) { SetTextJustification(hdc, areaWidth - size.cx, breakCount); - GetTextExtentPoint32(hdc, pFirstChar, pLastChar - pFirstChar, &size); + GetTextExtentPoint32A(hdc, pFirstChar, pLastChar - pFirstChar, &size); if (size.cx != areaWidth && nErrors < sizeof(error)/sizeof(error[0]) - 1) { error[nErrors].start = pFirstChar; @@ -1852,7 +2253,7 @@ static void test_SetTextJustification(void) SIZE size, expect; int i; WORD indices[2]; - static char testText[] = + static const char testText[] = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do " "eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut " "enim ad minim veniam, quis nostrud exercitation ullamco laboris " @@ -1865,6 +2266,12 @@ static void test_SetTextJustification(void) GetClientRect( hwnd, &clientArea ); hdc = GetDC( hwnd ); + if (!is_font_installed("Times New Roman")) + { + skip("Times New Roman is not installed\n"); + return; + } + memset(&lf, 0, sizeof lf); lf.lfCharSet = ANSI_CHARSET; lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; @@ -1881,26 +2288,26 @@ static void test_SetTextJustification(void) pGetGlyphIndicesA( hdc, "A ", 2, indices, 0 ); SetTextJustification(hdc, 0, 0); - GetTextExtentPoint32(hdc, " ", 1, &expect); - GetTextExtentPoint32(hdc, " ", 3, &size); + GetTextExtentPoint32A(hdc, " ", 1, &expect); + GetTextExtentPoint32A(hdc, " ", 3, &size); ok( size.cx == 3 * expect.cx, "wrong size %d/%d\n", size.cx, expect.cx ); SetTextJustification(hdc, 4, 1); - GetTextExtentPoint32(hdc, " ", 1, &size); + GetTextExtentPoint32A(hdc, " ", 1, &size); ok( size.cx == expect.cx + 4, "wrong size %d/%d\n", size.cx, expect.cx ); SetTextJustification(hdc, 9, 2); - GetTextExtentPoint32(hdc, " ", 2, &size); + GetTextExtentPoint32A(hdc, " ", 2, &size); ok( size.cx == 2 * expect.cx + 9, "wrong size %d/%d\n", size.cx, expect.cx ); SetTextJustification(hdc, 7, 3); - GetTextExtentPoint32(hdc, " ", 3, &size); + GetTextExtentPoint32A(hdc, " ", 3, &size); ok( size.cx == 3 * expect.cx + 7, "wrong size %d/%d\n", size.cx, expect.cx ); SetTextJustification(hdc, 7, 3); SetTextCharacterExtra(hdc, 2 ); - GetTextExtentPoint32(hdc, " ", 3, &size); + GetTextExtentPoint32A(hdc, " ", 3, &size); ok( size.cx == 3 * (expect.cx + 2) + 7, "wrong size %d/%d\n", size.cx, expect.cx ); SetTextJustification(hdc, 0, 0); SetTextCharacterExtra(hdc, 0); size.cx = size.cy = 1234; - GetTextExtentPoint32(hdc, " ", 0, &size); + GetTextExtentPoint32A(hdc, " ", 0, &size); ok( size.cx == 0 && size.cy == 0, "wrong size %d,%d\n", size.cx, size.cy ); pGetTextExtentExPointI(hdc, indices, 2, -1, NULL, NULL, &expect); SetTextJustification(hdc, 5, 1); @@ -1914,11 +2321,11 @@ static void test_SetTextJustification(void) DPtoLP( hdc, (POINT *)&clientArea, 2 ); testJustification(hdc, testText, &clientArea); - GetTextExtentPoint32(hdc, "A", 1, &expect); + GetTextExtentPoint32A(hdc, "A", 1, &expect); for (i = 0; i < 10; i++) { SetTextCharacterExtra(hdc, i); - GetTextExtentPoint32(hdc, "A", 1, &size); + GetTextExtentPoint32A(hdc, "A", 1, &size); ok( size.cx == expect.cx + i, "wrong size %d/%d+%d\n", size.cx, expect.cx, i ); } SetTextCharacterExtra(hdc, 0); @@ -1936,11 +2343,11 @@ static void test_SetTextJustification(void) DPtoLP( hdc, (POINT *)&clientArea, 2 ); testJustification(hdc, testText, &clientArea); - GetTextExtentPoint32(hdc, "A", 1, &expect); + GetTextExtentPoint32A(hdc, "A", 1, &expect); for (i = 0; i < 10; i++) { SetTextCharacterExtra(hdc, i); - GetTextExtentPoint32(hdc, "A", 1, &size); + GetTextExtentPoint32A(hdc, "A", 1, &size); ok( size.cx == expect.cx + i, "wrong size %d/%d+%d\n", size.cx, expect.cx, i ); } @@ -2130,7 +2537,7 @@ static void test_GdiGetCodePage(void) { 950, "PMingLiU", ANSI_CHARSET, 950}, }; HDC hdc; - LOGFONT lf; + LOGFONTA lf; HFONT hfont; UINT charset, acp; DWORD codepage; @@ -2229,13 +2636,13 @@ static void test_GetFontUnicodeRanges(void) struct enum_font_data { int total; - LOGFONT lf[MAX_ENUM_FONTS]; + LOGFONTA lf[MAX_ENUM_FONTS]; }; struct enum_fullname_data { int total; - ENUMLOGFONT elf[MAX_ENUM_FONTS]; + ENUMLOGFONTA elf[MAX_ENUM_FONTS]; }; struct enum_font_dataW @@ -2244,10 +2651,10 @@ struct enum_font_dataW LOGFONTW lf[MAX_ENUM_FONTS]; }; -static INT CALLBACK arial_enum_proc(const LOGFONT *lf, const TEXTMETRIC *tm, DWORD type, LPARAM lParam) +static INT CALLBACK arial_enum_proc(const LOGFONTA *lf, const TEXTMETRICA *tm, DWORD type, LPARAM lParam) { struct enum_font_data *efd = (struct enum_font_data *)lParam; - const NEWTEXTMETRIC *ntm = (const NEWTEXTMETRIC *)tm; + const NEWTEXTMETRICA *ntm = (const NEWTEXTMETRICA *)tm; ok(lf->lfHeight == tm->tmHeight, "lfHeight %d != tmHeight %d\n", lf->lfHeight, tm->tmHeight); ok(lf->lfHeight > 0 && lf->lfHeight < 200, "enumerated font height %d\n", lf->lfHeight); @@ -2348,7 +2755,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset) { struct enum_font_data efd; struct enum_font_dataW efdw; - LOGFONT lf; + LOGFONTA lf; HDC hdc; int i, ret, ansi_charset, symbol_charset, russian_charset; @@ -2406,7 +2813,7 @@ static void test_EnumFontFamilies(const char *font_name, INT font_charset) efd.total = 0; SetLastError(0xdeadbeef); - ret = EnumFontFamilies(hdc, font_name, arial_enum_proc, (LPARAM)&efd); + ret = EnumFontFamiliesA(hdc, font_name, arial_enum_proc, (LPARAM)&efd); ok(ret, "EnumFontFamilies error %u\n", GetLastError()); get_charset_stats(&efd, &ansi_charset, &symbol_charset, &russian_charset); trace("enumerated ansi %d, symbol %d, russian %d fonts for %s\n", @@ -2426,16 +2833,16 @@ todo_wine } else ok(efd.lf[i].lfCharSet == font_charset, "%d: got charset %d\n", i, efd.lf[i].lfCharSet); - ok(!lstrcmp(efd.lf[i].lfFaceName, font_name), "expected %s, got %s\n", + ok(!strcmp(efd.lf[i].lfFaceName, font_name), "expected %s, got %s\n", font_name, efd.lf[i].lfFaceName); } memset(&lf, 0, sizeof(lf)); lf.lfCharSet = ANSI_CHARSET; - lstrcpy(lf.lfFaceName, font_name); + strcpy(lf.lfFaceName, font_name); efd.total = 0; SetLastError(0xdeadbeef); - ret = EnumFontFamiliesEx(hdc, &lf, arial_enum_proc, (LPARAM)&efd, 0); + ret = EnumFontFamiliesExA(hdc, &lf, arial_enum_proc, (LPARAM)&efd, 0); ok(ret, "EnumFontFamiliesEx error %u\n", GetLastError()); get_charset_stats(&efd, &ansi_charset, &symbol_charset, &russian_charset); trace("enumerated ansi %d, symbol %d, russian %d fonts for %s ANSI_CHARSET\n", @@ -2455,7 +2862,7 @@ else { ok(efd.lf[i].lfCharSet == ANSI_CHARSET, "%d: got charset %d\n", i, efd.lf[i].lfCharSet); if (*font_name) - ok(!lstrcmp(efd.lf[i].lfFaceName, font_name), "expected %s, got %s\n", + ok(!strcmp(efd.lf[i].lfFaceName, font_name), "expected %s, got %s\n", font_name, efd.lf[i].lfFaceName); } } @@ -2463,10 +2870,10 @@ else /* DEFAULT_CHARSET should enumerate all available charsets */ memset(&lf, 0, sizeof(lf)); lf.lfCharSet = DEFAULT_CHARSET; - lstrcpy(lf.lfFaceName, font_name); + strcpy(lf.lfFaceName, font_name); efd.total = 0; SetLastError(0xdeadbeef); - EnumFontFamiliesEx(hdc, &lf, arial_enum_proc, (LPARAM)&efd, 0); + EnumFontFamiliesExA(hdc, &lf, arial_enum_proc, (LPARAM)&efd, 0); ok(ret, "EnumFontFamiliesEx error %u\n", GetLastError()); get_charset_stats(&efd, &ansi_charset, &symbol_charset, &russian_charset); trace("enumerated ansi %d, symbol %d, russian %d fonts for %s DEFAULT_CHARSET\n", @@ -2476,7 +2883,7 @@ else for (i = 0; i < efd.total; i++) { if (*font_name) - ok(!lstrcmp(efd.lf[i].lfFaceName, font_name), "expected %s, got %s\n", + ok(!strcmp(efd.lf[i].lfFaceName, font_name), "expected %s, got %s\n", font_name, efd.lf[i].lfFaceName); } if (*font_name) @@ -2521,10 +2928,10 @@ else memset(&lf, 0, sizeof(lf)); lf.lfCharSet = SYMBOL_CHARSET; - lstrcpy(lf.lfFaceName, font_name); + strcpy(lf.lfFaceName, font_name); efd.total = 0; SetLastError(0xdeadbeef); - EnumFontFamiliesEx(hdc, &lf, arial_enum_proc, (LPARAM)&efd, 0); + EnumFontFamiliesExA(hdc, &lf, arial_enum_proc, (LPARAM)&efd, 0); ok(ret, "EnumFontFamiliesEx error %u\n", GetLastError()); get_charset_stats(&efd, &ansi_charset, &symbol_charset, &russian_charset); trace("enumerated ansi %d, symbol %d, russian %d fonts for %s SYMBOL_CHARSET\n", @@ -2539,7 +2946,7 @@ else { ok(efd.lf[i].lfCharSet == SYMBOL_CHARSET, "%d: got charset %d\n", i, efd.lf[i].lfCharSet); if (*font_name) - ok(!lstrcmp(efd.lf[i].lfFaceName, font_name), "expected %s, got %s\n", + ok(!strcmp(efd.lf[i].lfFaceName, font_name), "expected %s, got %s\n", font_name, efd.lf[i].lfFaceName); } @@ -2554,7 +2961,28 @@ else ReleaseDC(0, hdc); } -static INT CALLBACK enum_font_data_proc(const LOGFONT *lf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK enum_multi_charset_font_proc(const LOGFONTA *lf, const TEXTMETRICA *tm, DWORD type, LPARAM lParam) +{ + const NEWTEXTMETRICEXA *ntm = (const NEWTEXTMETRICEXA *)tm; + LOGFONTA *target = (LOGFONTA *)lParam; + const DWORD valid_bits = 0x003f01ff; + CHARSETINFO csi; + DWORD fs; + + if (type != TRUETYPE_FONTTYPE) return TRUE; + + if (TranslateCharsetInfo(ULongToPtr(target->lfCharSet), &csi, TCI_SRCCHARSET)) { + fs = ntm->ntmFontSig.fsCsb[0] & valid_bits; + if ((fs & csi.fs.fsCsb[0]) && (fs & ~csi.fs.fsCsb[0]) && (fs & FS_LATIN1)) { + *target = *lf; + return FALSE; + } + } + + return TRUE; +} + +static INT CALLBACK enum_font_data_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { struct enum_font_data *efd = (struct enum_font_data *)lParam; @@ -2568,14 +2996,14 @@ static INT CALLBACK enum_font_data_proc(const LOGFONT *lf, const TEXTMETRIC *ntm return 1; } -static INT CALLBACK enum_fullname_data_proc(const LOGFONT *lf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK enum_fullname_data_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { struct enum_fullname_data *efnd = (struct enum_fullname_data *)lParam; if (type != TRUETYPE_FONTTYPE) return 1; if (efnd->total < MAX_ENUM_FONTS) - efnd->elf[efnd->total++] = *(ENUMLOGFONT*)lf; + efnd->elf[efnd->total++] = *(ENUMLOGFONTA *)lf; else trace("enum tests invalid; you have more than %d fonts\n", MAX_ENUM_FONTS); @@ -2585,33 +3013,48 @@ static INT CALLBACK enum_fullname_data_proc(const LOGFONT *lf, const TEXTMETRIC static void test_EnumFontFamiliesEx_default_charset(void) { struct enum_font_data efd; - LOGFONT gui_font, enum_font; - DWORD ret; + LOGFONTA target, enum_font; + UINT acp; HDC hdc; + CHARSETINFO csi; - ret = GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof(gui_font), &gui_font); - ok(ret, "GetObject failed.\n"); - if (!ret) + acp = GetACP(); + if (!TranslateCharsetInfo(ULongToPtr(acp), &csi, TCI_SRCCODEPAGE)) { + skip("TranslateCharsetInfo failed for code page %u.\n", acp); return; - - efd.total = 0; + } hdc = GetDC(0); memset(&enum_font, 0, sizeof(enum_font)); - lstrcpy(enum_font.lfFaceName, gui_font.lfFaceName); - enum_font.lfCharSet = DEFAULT_CHARSET; - EnumFontFamiliesEx(hdc, &enum_font, enum_font_data_proc, (LPARAM)&efd, 0); - ReleaseDC(0, hdc); - - if (efd.total == 0) { - skip("'%s' is not found or not a TrueType font.\n", gui_font.lfFaceName); + enum_font.lfCharSet = csi.ciCharset; + target.lfFaceName[0] = '\0'; + target.lfCharSet = csi.ciCharset; + EnumFontFamiliesExA(hdc, &enum_font, enum_multi_charset_font_proc, (LPARAM)&target, 0); + if (target.lfFaceName[0] == '\0') { + skip("suitable font isn't found for charset %d.\n", enum_font.lfCharSet); return; } - trace("'%s' has %d charsets.\n", gui_font.lfFaceName, efd.total); + if (acp == 874 || acp == 1255 || acp == 1256) { + /* these codepage use complex script, expecting ANSI_CHARSET here. */ + target.lfCharSet = ANSI_CHARSET; + } - ok(efd.lf[0].lfCharSet == gui_font.lfCharSet || broken(system_lang_id == LANG_ARABIC), + efd.total = 0; + memset(&enum_font, 0, sizeof(enum_font)); + strcpy(enum_font.lfFaceName, target.lfFaceName); + enum_font.lfCharSet = DEFAULT_CHARSET; + EnumFontFamiliesExA(hdc, &enum_font, enum_font_data_proc, (LPARAM)&efd, 0); + ReleaseDC(0, hdc); + + trace("'%s' has %d charsets.\n", target.lfFaceName, efd.total); + if (efd.total < 2) { + ok(0, "EnumFontFamilies is broken. Expected >= 2, got %d.\n", efd.total); + return; + } + + ok(efd.lf[0].lfCharSet == target.lfCharSet, "(%s) got charset %d expected %d\n", - efd.lf[0].lfFaceName, efd.lf[0].lfCharSet, gui_font.lfCharSet); + efd.lf[0].lfFaceName, efd.lf[0].lfCharSet, target.lfCharSet); return; } @@ -2733,21 +3176,6 @@ typedef struct } TT_OS2_V2; #include "poppack.h" -#ifdef WORDS_BIGENDIAN -#define GET_BE_WORD(x) (x) -#define GET_BE_DWORD(x) (x) -#else -#define GET_BE_WORD(x) MAKEWORD(HIBYTE(x), LOBYTE(x)) -#define GET_BE_DWORD(x) MAKELONG(GET_BE_WORD(HIWORD(x)), GET_BE_WORD(LOWORD(x))); -#endif - -#define MS_MAKE_TAG(ch0, ch1, ch2, ch3) \ - ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ - ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24)) -#define MS_OS2_TAG MS_MAKE_TAG('O','S','/','2') -#define MS_CMAP_TAG MS_MAKE_TAG('c','m','a','p') -#define MS_NAME_TAG MS_MAKE_TAG('n','a','m','e') - typedef struct { USHORT version; @@ -3051,7 +3479,7 @@ out: return r; } -static void test_text_metrics(const LOGFONT *lf, const NEWTEXTMETRIC *ntm) +static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm) { HDC hdc; HFONT hfont, hfont_old; @@ -3089,19 +3517,13 @@ static void test_text_metrics(const LOGFONT *lf, const NEWTEXTMETRIC *ntm) ret = GetFontData(hdc, MS_OS2_TAG, 0, &tt_os2, size); ok(ret == size, "GetFontData should return %u not %u\n", size, ret); - ascent = GET_BE_WORD(tt_os2.usWinAscent); - descent = GET_BE_WORD(tt_os2.usWinDescent); - cell_height = ascent + descent; - ok(ntm->ntmCellHeight == cell_height, "%s: ntmCellHeight %u != %u, os2.usWinAscent/os2.usWinDescent %u/%u\n", - font_name, ntm->ntmCellHeight, cell_height, ascent, descent); - SetLastError(0xdeadbeef); ret = GetTextMetricsA(hdc, &tmA); ok(ret, "GetTextMetricsA error %u\n", GetLastError()); if(!get_first_last_from_cmap(hdc, &cmap_first, &cmap_last, &cmap_type)) { - skip("Unable to retrieve first and last glyphs from cmap\n"); + skip("%s is not a Windows font, OS/2 metrics may be invalid.\n",font_name); } else { @@ -3111,6 +3533,12 @@ static void test_text_metrics(const LOGFONT *lf, const NEWTEXTMETRIC *ntm) USHORT version; TEXTMETRICW tmW; + ascent = GET_BE_WORD(tt_os2.usWinAscent); + descent = GET_BE_WORD(tt_os2.usWinDescent); + cell_height = ascent + descent; + ok(ntm->ntmCellHeight == cell_height, "%s: ntmCellHeight %u != %u, os2.usWinAscent/os2.usWinDescent %u/%u\n", + font_name, ntm->ntmCellHeight, cell_height, ascent, descent); + version = GET_BE_WORD(tt_os2.version); os2_first_char = GET_BE_WORD(tt_os2.usFirstCharIndex); @@ -3276,14 +3704,14 @@ end_of_test: ReleaseDC(0, hdc); } -static INT CALLBACK enum_truetype_font_proc(const LOGFONT *lf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK enum_truetype_font_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { INT *enumed = (INT *)lParam; if (type == TRUETYPE_FONTTYPE) { (*enumed)++; - test_text_metrics(lf, (const NEWTEXTMETRIC *)ntm); + test_text_metrics(lf, (const NEWTEXTMETRICA *)ntm); } return 1; } @@ -3648,14 +4076,15 @@ todo_wine DeleteDC(hdc); } -static int CALLBACK create_fixed_pitch_font_proc(const LOGFONT *lpelfe, - const TEXTMETRIC *lpntme, +static int CALLBACK create_fixed_pitch_font_proc(const LOGFONTA *lpelfe, + const TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam) { - const NEWTEXTMETRICEX *lpntmex = (const NEWTEXTMETRICEX *)lpntme; + const NEWTEXTMETRICEXA *lpntmex = (const NEWTEXTMETRICEXA *)lpntme; CHARSETINFO csi; - LOGFONT lf = *lpelfe; + LOGFONTA lf = *lpelfe; HFONT hfont; + DWORD found_subset; /* skip bitmap, proportional or vertical font */ if ((FontType & TRUETYPE_FONTTYPE) == 0 || @@ -3668,10 +4097,29 @@ static int CALLBACK create_fixed_pitch_font_proc(const LOGFONT *lpelfe, (lpntmex->ntmFontSig.fsCsb[0] & csi.fs.fsCsb[0]) == 0) return 1; + /* skip linked font, like SimSun-ExtB */ + switch (lpelfe->lfCharSet) { + case SHIFTJIS_CHARSET: + found_subset = lpntmex->ntmFontSig.fsUsb[1] & (1 << 17); /* Hiragana */ + break; + case GB2312_CHARSET: + case CHINESEBIG5_CHARSET: + found_subset = lpntmex->ntmFontSig.fsUsb[1] & (1 << 16); /* CJK Symbols And Punctuation */ + break; + case HANGEUL_CHARSET: + found_subset = lpntmex->ntmFontSig.fsUsb[1] & (1 << 24); /* Hangul Syllables */ + break; + default: + found_subset = lpntmex->ntmFontSig.fsUsb[0] & (1 << 0); /* Basic Latin */ + break; + } + if (!found_subset) + return 1; + /* test with an odd height */ lf.lfHeight = -19; lf.lfWidth = 0; - hfont = CreateFontIndirect(&lf); + hfont = CreateFontIndirectA(&lf); if (hfont) { *(HFONT *)lParam = hfont; @@ -3687,6 +4135,8 @@ static void test_GetGlyphOutline(void) LOGFONTA lf; HFONT hfont, old_hfont; INT ret, ret2; + const UINT fmt[] = { GGO_METRICS, GGO_BITMAP, GGO_GRAY2_BITMAP, + GGO_GRAY4_BITMAP, GGO_GRAY8_BITMAP }; static const struct { UINT cs; @@ -3697,7 +4147,6 @@ static void test_GetGlyphOutline(void) {ANSI_CHARSET, 0x30, 0x30}, {SHIFTJIS_CHARSET, 0x82a0, 0x3042}, {HANGEUL_CHARSET, 0x8141, 0xac02}, - {JOHAB_CHARSET, 0x8446, 0x3135}, {GB2312_CHARSET, 0x8141, 0x4e04}, {CHINESEBIG5_CHARSET, 0xa142, 0x3001} }; @@ -3763,17 +4212,81 @@ static void test_GetGlyphOutline(void) ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %u\n", GetLastError()); } + for (i = 0; i < sizeof(fmt) / sizeof(fmt[0]); ++i) + { + DWORD dummy; + + memset(&gm, 0xab, sizeof(gm)); + SetLastError(0xdeadbeef); + ret = GetGlyphOutlineW(hdc, ' ', fmt[i], &gm, 0, NULL, &mat); + if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) + { + if (fmt[i] == GGO_METRICS) + ok(ret != GDI_ERROR, "%2d:GetGlyphOutlineW should succeed, got %d\n", fmt[i], ret); + else + ok(ret == 0, "%2d:GetGlyphOutlineW should return 0, got %d\n", fmt[i], ret); + ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX); + ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY); + } + + memset(&gm, 0xab, sizeof(gm)); + SetLastError(0xdeadbeef); + ret = GetGlyphOutlineW(hdc, ' ', fmt[i], &gm, 0, &dummy, &mat); + if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) + { + if (fmt[i] == GGO_METRICS) + ok(ret != GDI_ERROR, "%2d:GetGlyphOutlineW should succeed, got %d\n", fmt[i], ret); + else + ok(ret == 0, "%2d:GetGlyphOutlineW should return 0, got %d\n", fmt[i], ret); + ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX); + ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY); + } + + memset(&gm, 0xab, sizeof(gm)); + SetLastError(0xdeadbeef); + ret = GetGlyphOutlineW(hdc, ' ', fmt[i], &gm, sizeof(dummy), NULL, &mat); + if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) + { + if (fmt[i] == GGO_METRICS) + ok(ret != GDI_ERROR, "%2d:GetGlyphOutlineW should succeed, got %d\n", fmt[i], ret); + else + ok(ret == 0, "%2d:GetGlyphOutlineW should return 0, got %d\n", fmt[i], ret); + ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX); + ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY); + } + + memset(&gm, 0xab, sizeof(gm)); + SetLastError(0xdeadbeef); + ret = GetGlyphOutlineW(hdc, ' ', fmt[i], &gm, sizeof(dummy), &dummy, &mat); + if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) + { + if (fmt[i] == GGO_METRICS) { + ok(ret != GDI_ERROR, "%2d:GetGlyphOutlineW should succeed, got %d\n", fmt[i], ret); + ok(gm.gmBlackBoxX == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxX); + ok(gm.gmBlackBoxY == 1, "%2d:expected 1, got %u\n", fmt[i], gm.gmBlackBoxY); + } + else + { + ok(ret == GDI_ERROR, "%2d:GetGlyphOutlineW should return GDI_ERROR, got %d\n", fmt[i], ret); + memset(&gm2, 0xab, sizeof(gm2)); + ok(memcmp(&gm, &gm2, sizeof(GLYPHMETRICS)) == 0, + "%2d:GLYPHMETRICS shouldn't be touched on error\n", fmt[i]); + } + } + } + SelectObject(hdc, old_hfont); DeleteObject(hfont); for (i = 0; i < sizeof c / sizeof c[0]; ++i) { static const MAT2 rotate_mat = {{0, 0}, {0, -1}, {0, 1}, {0, 0}}; + TEXTMETRICA tm; lf.lfFaceName[0] = '\0'; lf.lfCharSet = c[i].cs; lf.lfPitchAndFamily = 0; - if (EnumFontFamiliesEx(hdc, &lf, create_font_proc, (LPARAM)&hfont, 0)) + if (EnumFontFamiliesExA(hdc, &lf, create_font_proc, (LPARAM)&hfont, 0)) { skip("TrueType font for charset %u is not installed\n", c[i].cs); continue; @@ -3800,7 +4313,7 @@ static void test_GetGlyphOutline(void) ret2 = GetGlyphOutlineW(hdc, c[i].w, GGO_BITMAP, &gm2, 0, NULL, &mat); ok(ret == ret2 && memcmp(&gm, &gm2, sizeof gm) == 0, "%d %d\n", ret, ret2); - if (EnumFontFamiliesEx(hdc, &lf, create_fixed_pitch_font_proc, (LPARAM)&hfont, 0)) + if (EnumFontFamiliesExA(hdc, &lf, create_fixed_pitch_font_proc, (LPARAM)&hfont, 0)) { skip("Fixed-pitch TrueType font for charset %u is not available\n", c[i].cs); continue; @@ -3812,18 +4325,18 @@ static void test_GetGlyphOutline(void) continue; } - ret = GetObject(hfont, sizeof lf, &lf); + ret = GetObjectA(hfont, sizeof lf, &lf); ok(ret > 0, "GetObject error %u\n", GetLastError()); - ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); + ret = GetTextMetricsA(hdc, &tm); + ok(ret, "GetTextMetrics error %u\n", GetLastError()); ret = GetGlyphOutlineA(hdc, c[i].a, GGO_METRICS, &gm2, 0, NULL, &mat); ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); - trace("Tests with height=%d,half=%d,full=%d,face=%s,charset=%d\n", - -lf.lfHeight, gm.gmCellIncX, gm2.gmCellIncX, lf.lfFaceName, lf.lfCharSet); - ok(gm2.gmCellIncX == gm.gmCellIncX * 2 || broken(gm2.gmCellIncX == -lf.lfHeight), + trace("Tests with height=%d,avg=%d,full=%d,face=%s,charset=%d\n", + -lf.lfHeight, tm.tmAveCharWidth, gm2.gmCellIncX, lf.lfFaceName, lf.lfCharSet); + ok(gm2.gmCellIncX == tm.tmAveCharWidth * 2 || broken(gm2.gmCellIncX == -lf.lfHeight), "expected %d, got %d (%s:%d)\n", - gm.gmCellIncX * 2, gm2.gmCellIncX, lf.lfFaceName, lf.lfCharSet); + tm.tmAveCharWidth * 2, gm2.gmCellIncX, lf.lfFaceName, lf.lfCharSet); ret = GetGlyphOutlineA(hdc, c[i].a, GGO_METRICS, &gm2, 0, NULL, &rotate_mat); ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); @@ -3832,20 +4345,20 @@ static void test_GetGlyphOutline(void) -lf.lfHeight, gm2.gmCellIncY, lf.lfFaceName, lf.lfCharSet); lf.lfItalic = TRUE; - hfont = CreateFontIndirect(&lf); + hfont = CreateFontIndirectA(&lf); ok(hfont != NULL, "CreateFontIndirect error %u\n", GetLastError()); DeleteObject(SelectObject(hdc, hfont)); - ret = GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); - ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); + ret = GetTextMetricsA(hdc, &tm); + ok(ret, "GetTextMetrics error %u\n", GetLastError()); ret = GetGlyphOutlineA(hdc, c[i].a, GGO_METRICS, &gm2, 0, NULL, &mat); ok(ret != GDI_ERROR, "GetGlyphOutlineA error %u\n", GetLastError()); - ok(gm2.gmCellIncX == gm.gmCellIncX * 2 || broken(gm2.gmCellIncX == -lf.lfHeight), + ok(gm2.gmCellIncX == tm.tmAveCharWidth * 2 || broken(gm2.gmCellIncX == -lf.lfHeight), "expected %d, got %d (%s:%d)\n", - gm.gmCellIncX * 2, gm2.gmCellIncX, lf.lfFaceName, lf.lfCharSet); + tm.tmAveCharWidth * 2, gm2.gmCellIncX, lf.lfFaceName, lf.lfCharSet); lf.lfItalic = FALSE; lf.lfEscapement = lf.lfOrientation = 2700; - hfont = CreateFontIndirect(&lf); + hfont = CreateFontIndirectA(&lf); ok(hfont != NULL, "CreateFontIndirect error %u\n", GetLastError()); DeleteObject(SelectObject(hdc, hfont)); ret = GetGlyphOutlineA(hdc, c[i].a, GGO_METRICS, &gm2, 0, NULL, &mat); @@ -3894,17 +4407,17 @@ static void test_GetTextMetrics2(const char *fontname, int font_height) for (width = ave_width * 2; /* nothing*/; width += ave_width) { - hf = CreateFont(height, width, 0, 0, FW_REGULAR, FALSE, FALSE, FALSE, + hf = CreateFontA(height, width, 0, 0, FW_REGULAR, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_TT_PRECIS, CLIP_LH_ANGLES, DEFAULT_QUALITY, VARIABLE_PITCH, fontname); ok(hf != 0, "CreateFont failed\n"); of = SelectObject(hdc, hf); - ret = GetTextMetrics(hdc, &tm); + ret = GetTextMetricsA(hdc, &tm); ok(ret, "GetTextMetrics error %u\n", GetLastError()); SelectObject(hdc, of); DeleteObject(hf); - if (match_off_by_1(tm.tmAveCharWidth, ave_width) || width / height > 200) + if (match_off_by_1(tm.tmAveCharWidth, ave_width, FALSE) || width / height > 200) break; } @@ -3941,7 +4454,7 @@ static void test_CreateFontIndirect(void) hfont = CreateFontIndirectA(&lf); ok(hfont != 0, "CreateFontIndirectA failed\n"); SetLastError(0xdeadbeef); - ret = GetObject(hfont, sizeof(getobj_lf), &getobj_lf); + ret = GetObjectA(hfont, sizeof(getobj_lf), &getobj_lf); ok(ret, "GetObject failed: %d\n", GetLastError()); ok(lf.lfItalic == getobj_lf.lfItalic, "lfItalic: expect %02x got %02x\n", lf.lfItalic, getobj_lf.lfItalic); ok(lf.lfWeight == getobj_lf.lfWeight || @@ -3996,16 +4509,16 @@ static void *load_font(const char *font_name, DWORD *font_size) HANDLE file, mapping; void *font; - if (!GetWindowsDirectory(file_name, sizeof(file_name))) return NULL; + if (!GetWindowsDirectoryA(file_name, sizeof(file_name))) return NULL; strcat(file_name, "\\fonts\\"); strcat(file_name, font_name); - file = CreateFile(file_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); + file = CreateFileA(file_name, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); if (file == INVALID_HANDLE_VALUE) return NULL; *font_size = GetFileSize(file, NULL); - mapping = CreateFileMapping(file, NULL, PAGE_READONLY, 0, 0, NULL); + mapping = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, NULL); if (!mapping) { CloseHandle(file); @@ -4136,27 +4649,27 @@ static void test_AddFontMemResource(void) free_font(font); } -static INT CALLBACK enum_fonts_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lparam) +static INT CALLBACK enum_fonts_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lparam) { - LOGFONT *lf; + LOGFONTA *lf; if (type != TRUETYPE_FONTTYPE) return 1; ok(ntm->tmWeight == elf->lfWeight, "expected %d got %d\n", ntm->tmWeight, elf->lfWeight); - lf = (LOGFONT *)lparam; + lf = (LOGFONTA *)lparam; *lf = *elf; return 0; } -static INT CALLBACK enum_all_fonts_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lparam) +static INT CALLBACK enum_all_fonts_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lparam) { int ret; - LOGFONT *lf; + LOGFONTA *lf; if (type != TRUETYPE_FONTTYPE) return 1; - lf = (LOGFONT *)lparam; + lf = (LOGFONTA *)lparam; ret = strcmp(lf->lfFaceName, elf->lfFaceName); if(ret == 0) { @@ -4167,7 +4680,7 @@ static INT CALLBACK enum_all_fonts_proc(const LOGFONT *elf, const TEXTMETRIC *nt return 1; } -static INT CALLBACK enum_with_magic_retval_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DWORD type, LPARAM lparam) +static INT CALLBACK enum_with_magic_retval_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lparam) { return lparam; } @@ -4175,7 +4688,7 @@ static INT CALLBACK enum_with_magic_retval_proc(const LOGFONT *elf, const TEXTME static void test_EnumFonts(void) { int ret; - LOGFONT lf; + LOGFONTA lf; HDC hdc; if (!is_truetype_font_installed("Arial")) @@ -4194,55 +4707,55 @@ static void test_EnumFonts(void) hdc = CreateCompatibleDC(0); /* check that the enumproc's retval is returned */ - ret = EnumFontFamilies(hdc, NULL, enum_with_magic_retval_proc, 0xcafe); + ret = EnumFontFamiliesA(hdc, NULL, enum_with_magic_retval_proc, 0xcafe); ok(ret == 0xcafe, "got %08x\n", ret); - ret = EnumFontFamilies(hdc, "Arial", enum_fonts_proc, (LPARAM)&lf); + ret = EnumFontFamiliesA(hdc, "Arial", enum_fonts_proc, (LPARAM)&lf); ok(!ret, "font Arial is not enumerated\n"); ret = strcmp(lf.lfFaceName, "Arial"); ok(!ret, "expected Arial got %s\n", lf.lfFaceName); ok(lf.lfWeight == FW_NORMAL, "expected FW_NORMAL got %d\n", lf.lfWeight); - lstrcpy(lf.lfFaceName, "Arial"); - ret = EnumFontFamilies(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); + strcpy(lf.lfFaceName, "Arial"); + ret = EnumFontFamiliesA(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); ok(!ret, "font Arial is not enumerated\n"); ret = strcmp(lf.lfFaceName, "Arial"); ok(!ret, "expected Arial got %s\n", lf.lfFaceName); ok(lf.lfWeight == FW_NORMAL, "expected FW_NORMAL got %d\n", lf.lfWeight); - ret = EnumFontFamilies(hdc, "Arial Bold", enum_fonts_proc, (LPARAM)&lf); + ret = EnumFontFamiliesA(hdc, "Arial Bold", enum_fonts_proc, (LPARAM)&lf); ok(!ret, "font Arial Bold is not enumerated\n"); ret = strcmp(lf.lfFaceName, "Arial"); ok(!ret, "expected Arial got %s\n", lf.lfFaceName); ok(lf.lfWeight == FW_BOLD, "expected FW_BOLD got %d\n", lf.lfWeight); - lstrcpy(lf.lfFaceName, "Arial Bold"); - ret = EnumFontFamilies(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); + strcpy(lf.lfFaceName, "Arial Bold"); + ret = EnumFontFamiliesA(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); ok(ret, "font Arial Bold should not be enumerated\n"); - ret = EnumFontFamilies(hdc, "Arial Bold Italic", enum_fonts_proc, (LPARAM)&lf); + ret = EnumFontFamiliesA(hdc, "Arial Bold Italic", enum_fonts_proc, (LPARAM)&lf); ok(!ret, "font Arial Bold Italic is not enumerated\n"); ret = strcmp(lf.lfFaceName, "Arial"); ok(!ret, "expected Arial got %s\n", lf.lfFaceName); ok(lf.lfWeight == FW_BOLD, "expected FW_BOLD got %d\n", lf.lfWeight); - lstrcpy(lf.lfFaceName, "Arial Bold Italic"); - ret = EnumFontFamilies(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); + strcpy(lf.lfFaceName, "Arial Bold Italic"); + ret = EnumFontFamiliesA(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); ok(ret, "font Arial Bold Italic should not be enumerated\n"); - ret = EnumFontFamilies(hdc, "Arial Italic Bold", enum_fonts_proc, (LPARAM)&lf); + ret = EnumFontFamiliesA(hdc, "Arial Italic Bold", enum_fonts_proc, (LPARAM)&lf); ok(ret, "font Arial Italic Bold should not be enumerated\n"); - lstrcpy(lf.lfFaceName, "Arial Italic Bold"); - ret = EnumFontFamilies(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); + strcpy(lf.lfFaceName, "Arial Italic Bold"); + ret = EnumFontFamiliesA(hdc, NULL, enum_all_fonts_proc, (LPARAM)&lf); ok(ret, "font Arial Italic Bold should not be enumerated\n"); DeleteDC(hdc); } -static INT CALLBACK is_font_installed_fullname_proc(const LOGFONT *lf, const TEXTMETRIC *ntm, DWORD type, LPARAM lParam) +static INT CALLBACK is_font_installed_fullname_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { - const ENUMLOGFONT *elf = (const ENUMLOGFONT *)lf; + const ENUMLOGFONTA *elf = (const ENUMLOGFONTA *)lf; const char *fullname = (const char *)lParam; if (!strcmp((const char *)elf->elfFullName, fullname)) return 0; @@ -4346,7 +4859,7 @@ static void test_fullname2_helper(const char *Family) lf.lfQuality = DEFAULT_QUALITY; lf.lfItalic = FALSE; lf.lfWeight = FW_DONTCARE; - lstrcpy(lf.lfFaceName, Family); + strcpy(lf.lfFaceName, Family); efnd.total = 0; EnumFontFamiliesExA(hdc, &lf, enum_fullname_data_proc, (LPARAM)&efnd, 0); if (efnd.total == 0) @@ -4378,7 +4891,7 @@ static void test_fullname2_helper(const char *Family) otm_size = GetOutlineTextMetricsA(hdc, 0, NULL); otm = HeapAlloc(GetProcessHeap(), 0, otm_size); memset(otm, 0, otm_size); - ret = GetOutlineTextMetrics(hdc, otm_size, otm); + ret = GetOutlineTextMetricsA(hdc, otm_size, otm); ok(ret != 0, "GetOutlineTextMetrics fails!\n"); if (ret == 0) continue; @@ -4490,48 +5003,6 @@ static void test_fullname2(void) } -static BOOL write_ttf_file(const char *fontname, char *tmp_name) -{ - char tmp_path[MAX_PATH]; - HRSRC rsrc; - void *rsrc_data; - DWORD rsrc_size; - HANDLE hfile; - BOOL ret; - - SetLastError(0xdeadbeef); - rsrc = FindResource(GetModuleHandle(0), fontname, RT_RCDATA); - ok(rsrc != 0, "FindResource error %d\n", GetLastError()); - if (!rsrc) return FALSE; - SetLastError(0xdeadbeef); - rsrc_data = LockResource(LoadResource(GetModuleHandle(0), rsrc)); - ok(rsrc_data != 0, "LockResource error %d\n", GetLastError()); - if (!rsrc_data) return FALSE; - SetLastError(0xdeadbeef); - rsrc_size = SizeofResource(GetModuleHandle(0), rsrc); - ok(rsrc_size != 0, "SizeofResource error %d\n", GetLastError()); - if (!rsrc_size) return FALSE; - - SetLastError(0xdeadbeef); - ret = GetTempPath(MAX_PATH, tmp_path); - ok(ret, "GetTempPath() error %d\n", GetLastError()); - SetLastError(0xdeadbeef); - ret = GetTempFileName(tmp_path, "ttf", 0, tmp_name); - ok(ret, "GetTempFileName() error %d\n", GetLastError()); - - SetLastError(0xdeadbeef); - hfile = CreateFile(tmp_name, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - ok(hfile != INVALID_HANDLE_VALUE, "CreateFile() error %d\n", GetLastError()); - if (hfile == INVALID_HANDLE_VALUE) return FALSE; - - SetLastError(0xdeadbeef); - ret = WriteFile(hfile, rsrc_data, rsrc_size, &rsrc_size, NULL); - ok(ret, "WriteFile() error %d\n", GetLastError()); - - CloseHandle(hfile); - return ret; -} - static void test_GetGlyphOutline_empty_contour(void) { HDC hdc; @@ -4572,6 +5043,46 @@ static void test_GetGlyphOutline_empty_contour(void) ReleaseDC(NULL, hdc); } +static void test_GetGlyphOutline_metric_clipping(void) +{ + HDC hdc; + LOGFONTA lf; + HFONT hfont, hfont_prev; + GLYPHMETRICS gm; + TEXTMETRICA tm; + DWORD ret; + + memset(&lf, 0, sizeof(lf)); + lf.lfHeight = 72; + lstrcpyA(lf.lfFaceName, "wine_test"); + + SetLastError(0xdeadbeef); + hfont = CreateFontIndirectA(&lf); + ok(hfont != 0, "CreateFontIndirectA error %u\n", GetLastError()); + + hdc = GetDC(NULL); + + hfont_prev = SelectObject(hdc, hfont); + ok(hfont_prev != NULL, "SelectObject failed\n"); + + SetLastError(0xdeadbeef); + ret = GetTextMetricsA(hdc, &tm); + ok(ret, "GetTextMetrics error %u\n", GetLastError()); + + GetGlyphOutlineA(hdc, 'A', GGO_METRICS, &gm, 0, NULL, &mat); + ok(gm.gmptGlyphOrigin.y <= tm.tmAscent, + "Glyph top(%d) exceeds ascent(%d)\n", + gm.gmptGlyphOrigin.y, tm.tmAscent); + GetGlyphOutlineA(hdc, 'D', GGO_METRICS, &gm, 0, NULL, &mat); + ok(gm.gmptGlyphOrigin.y - gm.gmBlackBoxY >= -tm.tmDescent, + "Glyph bottom(%d) exceeds descent(%d)\n", + gm.gmptGlyphOrigin.y - gm.gmBlackBoxY, -tm.tmDescent); + + SelectObject(hdc, hfont_prev); + DeleteObject(hfont); + ReleaseDC(NULL, hdc); +} + static void test_CreateScalableFontResource(void) { char ttf_name[MAX_PATH]; @@ -4598,41 +5109,41 @@ static void test_CreateScalableFontResource(void) ret = is_truetype_font_installed("wine_test"); ok(!ret, "font wine_test should not be enumerated\n"); - ret = GetTempPath(MAX_PATH, tmp_path); + ret = GetTempPathA(MAX_PATH, tmp_path); ok(ret, "GetTempPath() error %d\n", GetLastError()); - ret = GetTempFileName(tmp_path, "fot", 0, fot_name); + ret = GetTempFileNameA(tmp_path, "fot", 0, fot_name); ok(ret, "GetTempFileName() error %d\n", GetLastError()); - ret = GetFileAttributes(fot_name); + ret = GetFileAttributesA(fot_name); ok(ret != INVALID_FILE_ATTRIBUTES, "file %s does not exist\n", fot_name); SetLastError(0xdeadbeef); - ret = CreateScalableFontResource(0, fot_name, ttf_name, NULL); + ret = CreateScalableFontResourceA(0, fot_name, ttf_name, NULL); ok(!ret, "CreateScalableFontResource() should fail\n"); ok(GetLastError() == ERROR_FILE_EXISTS, "not expected error %d\n", GetLastError()); SetLastError(0xdeadbeef); - ret = CreateScalableFontResource(0, fot_name, ttf_name, ""); + ret = CreateScalableFontResourceA(0, fot_name, ttf_name, ""); ok(!ret, "CreateScalableFontResource() should fail\n"); ok(GetLastError() == ERROR_FILE_EXISTS, "not expected error %d\n", GetLastError()); file_part = strrchr(ttf_name, '\\'); SetLastError(0xdeadbeef); - ret = CreateScalableFontResource(0, fot_name, file_part, tmp_path); + ret = CreateScalableFontResourceA(0, fot_name, file_part, tmp_path); ok(!ret, "CreateScalableFontResource() should fail\n"); ok(GetLastError() == ERROR_FILE_EXISTS, "not expected error %d\n", GetLastError()); SetLastError(0xdeadbeef); - ret = CreateScalableFontResource(0, fot_name, "random file name", tmp_path); + ret = CreateScalableFontResourceA(0, fot_name, "random file name", tmp_path); ok(!ret, "CreateScalableFontResource() should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %d\n", GetLastError()); SetLastError(0xdeadbeef); - ret = CreateScalableFontResource(0, fot_name, NULL, ttf_name); + ret = CreateScalableFontResourceA(0, fot_name, NULL, ttf_name); ok(!ret, "CreateScalableFontResource() should fail\n"); ok(GetLastError() == ERROR_INVALID_PARAMETER, "not expected error %d\n", GetLastError()); - ret = DeleteFile(fot_name); + ret = DeleteFileA(fot_name); ok(ret, "DeleteFile() error %d\n", GetLastError()); ret = pRemoveFontResourceExA(fot_name, 0, 0); @@ -4640,7 +5151,7 @@ static void test_CreateScalableFontResource(void) /* test public font resource */ SetLastError(0xdeadbeef); - ret = CreateScalableFontResource(0, fot_name, ttf_name, NULL); + ret = CreateScalableFontResourceA(0, fot_name, ttf_name, NULL); ok(ret, "CreateScalableFontResource() error %d\n", GetLastError()); ret = is_truetype_font_installed("wine_test"); @@ -4654,6 +5165,7 @@ static void test_CreateScalableFontResource(void) ok(ret, "font wine_test should be enumerated\n"); test_GetGlyphOutline_empty_contour(); + test_GetGlyphOutline_metric_clipping(); ret = pRemoveFontResourceExA(fot_name, FR_PRIVATE, 0); ok(!ret, "RemoveFontResourceEx() with not matching flags should fail\n"); @@ -4684,11 +5196,11 @@ static void test_CreateScalableFontResource(void) ret = pRemoveFontResourceExA(fot_name, 0, 0); ok(!ret, "RemoveFontResourceEx() should fail\n"); - DeleteFile(fot_name); + DeleteFileA(fot_name); /* test hidden font resource */ SetLastError(0xdeadbeef); - ret = CreateScalableFontResource(1, fot_name, ttf_name, NULL); + ret = CreateScalableFontResourceA(1, fot_name, ttf_name, NULL); ok(ret, "CreateScalableFontResource() error %d\n", GetLastError()); ret = is_truetype_font_installed("wine_test"); @@ -4713,8 +5225,8 @@ static void test_CreateScalableFontResource(void) ret = pRemoveFontResourceExA(fot_name, 0, 0); ok(!ret, "RemoveFontResourceEx() should fail\n"); - DeleteFile(fot_name); - DeleteFile(ttf_name); + DeleteFileA(fot_name); + DeleteFileA(ttf_name); } static void check_vertical_font(const char *name, BOOL *installed, BOOL *selected, GLYPHMETRICS *gm, WORD *gi) @@ -4768,13 +5280,103 @@ static void check_vertical_font(const char *name, BOOL *installed, BOOL *selecte ReleaseDC(NULL, hdc); } +static void check_vertical_metrics(const char *face) +{ + LOGFONTA lf; + HFONT hfont, hfont_prev; + HDC hdc; + DWORD ret; + GLYPHMETRICS rgm, vgm; + const UINT code = 0x5EAD, height = 1000; + WORD idx; + ABC abc; + OUTLINETEXTMETRICA otm; + USHORT numOfLongVerMetrics; + + hdc = GetDC(NULL); + + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, face); + lf.lfHeight = -height; + lf.lfCharSet = DEFAULT_CHARSET; + lf.lfEscapement = lf.lfOrientation = 900; + hfont = CreateFontIndirectA(&lf); + hfont_prev = SelectObject(hdc, hfont); + ret = GetGlyphOutlineW(hdc, code, GGO_METRICS, &rgm, 0, NULL, &mat); + ok(ret != GDI_ERROR, "GetGlyphOutlineW failed\n"); + ret = GetCharABCWidthsW(hdc, code, code, &abc); + ok(ret, "GetCharABCWidthsW failed\n"); + DeleteObject(SelectObject(hdc, hfont_prev)); + + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "@"); + strcat(lf.lfFaceName, face); + lf.lfHeight = -height; + lf.lfCharSet = DEFAULT_CHARSET; + hfont = CreateFontIndirectA(&lf); + hfont_prev = SelectObject(hdc, hfont); + ret = GetGlyphOutlineW(hdc, code, GGO_METRICS, &vgm, 0, NULL, &mat); + ok(ret != GDI_ERROR, "GetGlyphOutlineW failed\n"); + + memset(&otm, 0, sizeof(otm)); + otm.otmSize = sizeof(otm); + ret = GetOutlineTextMetricsA(hdc, sizeof(otm), &otm); + ok(ret != 0, "GetOutlineTextMetricsA failed\n"); + + if (GetFontData(hdc, MS_MAKE_TAG('v','h','e','a'), sizeof(SHORT) * 17, + &numOfLongVerMetrics, sizeof(numOfLongVerMetrics)) != GDI_ERROR) { + int offset; + SHORT topSideBearing; + + if (!pGetGlyphIndicesW) { + win_skip("GetGlyphIndices is not available on this platform\n"); + } + else { + ret = pGetGlyphIndicesW(hdc, (LPCWSTR)&code, 1, &idx, 0); + ok(ret != 0, "GetGlyphIndicesW failed\n"); + numOfLongVerMetrics = GET_BE_WORD(numOfLongVerMetrics); + if (numOfLongVerMetrics > idx) + offset = idx * 2 + 1; + else + offset = numOfLongVerMetrics * 2 + (idx - numOfLongVerMetrics); + ret = GetFontData(hdc, MS_MAKE_TAG('v','m','t','x'), offset * sizeof(SHORT), + &topSideBearing, sizeof(SHORT)); + ok(ret != GDI_ERROR, "GetFontData(vmtx) failed\n"); + topSideBearing = GET_BE_WORD(topSideBearing); + ok(match_off_by_1(vgm.gmptGlyphOrigin.x, + MulDiv(topSideBearing, height, otm.otmEMSquare), FALSE), + "expected %d, got %d\n", + MulDiv(topSideBearing, height, otm.otmEMSquare), vgm.gmptGlyphOrigin.x); + } + } + else + { + ok(vgm.gmptGlyphOrigin.x == rgm.gmptGlyphOrigin.x + vgm.gmCellIncX + otm.otmDescent, + "got %d, expected rgm.origin.x(%d) + vgm.cellIncX(%d) + descent(%d)\n", + vgm.gmptGlyphOrigin.x, rgm.gmptGlyphOrigin.x, vgm.gmCellIncX, otm.otmDescent); + } + + ok(vgm.gmptGlyphOrigin.y == abc.abcA + abc.abcB + otm.otmDescent || + broken(vgm.gmptGlyphOrigin.y == abc.abcA + abc.abcB - otm.otmTextMetrics.tmDescent) /* win2k */, + "got %d, expected abcA(%d) + abcB(%u) + descent(%d)\n", + (INT)vgm.gmptGlyphOrigin.y, abc.abcA, abc.abcB, otm.otmDescent); + + DeleteObject(SelectObject(hdc, hfont_prev)); + ReleaseDC(NULL, hdc); +} + static void test_vertical_font(void) { char ttf_name[MAX_PATH]; - int num; + int num, i; BOOL ret, installed, selected; GLYPHMETRICS gm; WORD hgi, vgi; + const char* face_list[] = { + "@WineTestVertical", /* has vmtx table */ + "@Ume Gothic", /* doesn't have vmtx table */ + "@MS UI Gothic", /* has vmtx table, available on native */ + }; if (!pAddFontResourceExA || !pRemoveFontResourceExA || !pGetGlyphIndicesW) { @@ -4791,29 +5393,39 @@ static void test_vertical_font(void) num = pAddFontResourceExA(ttf_name, FR_PRIVATE, 0); ok(num == 2, "AddFontResourceExA should add 2 fonts from vertical.ttf\n"); - check_vertical_font("@WineTestVertical", &installed, &selected, &gm, &hgi); - ok(installed, "@WineTestVertical is not installed\n"); - ok(selected, "@WineTestVertical is not selected\n"); + check_vertical_font("WineTestVertical", &installed, &selected, &gm, &hgi); + ok(installed, "WineTestVertical is not installed\n"); + ok(selected, "WineTestVertical is not selected\n"); ok(gm.gmBlackBoxX > gm.gmBlackBoxY, "gmBlackBoxX(%u) should be greater than gmBlackBoxY(%u) if horizontal\n", gm.gmBlackBoxX, gm.gmBlackBoxY); - check_vertical_font("@@WineTestVertical", &installed, &selected, &gm, &vgi); - ok(installed, "@@WineTestVertical is not installed\n"); - ok(selected, "@@WineTestVertical is not selected\n"); - ok(gm.gmBlackBoxX < gm.gmBlackBoxY, + check_vertical_font("@WineTestVertical", &installed, &selected, &gm, &vgi); + ok(installed, "@WineTestVertical is not installed\n"); + ok(selected, "@WineTestVertical is not selected\n"); + ok(gm.gmBlackBoxX > gm.gmBlackBoxY, "gmBlackBoxX(%u) should be less than gmBlackBoxY(%u) if vertical\n", gm.gmBlackBoxX, gm.gmBlackBoxY); - ok(hgi == vgi, "different glyph h:%u v:%u\n", hgi, vgi); + ok(hgi != vgi, "same glyph h:%u v:%u\n", hgi, vgi); + + for (i = 0; i < sizeof(face_list)/sizeof(face_list[0]); i++) { + const char* face = face_list[i]; + if (!is_truetype_font_installed(face)) { + skip("%s is not installed\n", face); + continue; + } + trace("Testing %s...\n", face); + check_vertical_metrics(&face[1]); + } ret = pRemoveFontResourceExA(ttf_name, FR_PRIVATE, 0); ok(ret, "RemoveFontResourceEx() error %d\n", GetLastError()); - DeleteFile(ttf_name); + DeleteFileA(ttf_name); } -static INT CALLBACK has_vertical_font_proc(const LOGFONT *lf, const TEXTMETRIC *ntm, +static INT CALLBACK has_vertical_font_proc(const LOGFONTA *lf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) { if (lf->lfFaceName[0] == '@') { @@ -4842,7 +5454,7 @@ static void test_east_asian_font_selection(void) lf.lfFaceName[0] = '\0'; lf.lfCharSet = charset[i]; - if (EnumFontFamiliesEx(hdc, &lf, has_vertical_font_proc, 0, 0)) + if (EnumFontFamiliesExA(hdc, &lf, has_vertical_font_proc, 0, 0)) { skip("Vertical font for charset %u is not installed\n", charset[i]); continue; @@ -4870,20 +5482,21 @@ static void test_east_asian_font_selection(void) ReleaseDC(NULL, hdc); } -static int get_font_dpi(const LOGFONT *lf) +static int get_font_dpi(const LOGFONTA *lf, int *height) { HDC hdc = CreateCompatibleDC(0); HFONT hfont; - TEXTMETRIC tm; + TEXTMETRICA tm; int ret; - hfont = CreateFontIndirect(lf); + hfont = CreateFontIndirectA(lf); ok(hfont != 0, "CreateFontIndirect failed\n"); SelectObject(hdc, hfont); - ret = GetTextMetrics(hdc, &tm); + ret = GetTextMetricsA(hdc, &tm); ok(ret, "GetTextMetrics failed\n"); ret = tm.tmDigitizedAspectX; + if (height) *height = tm.tmHeight; DeleteDC(hdc); DeleteObject(hfont); @@ -4900,49 +5513,49 @@ static void test_stock_fonts(void) }; static const struct test_data { - int charset, weight, height, dpi; + int charset, weight, height, height_pixels, dpi; const char face_name[LF_FACESIZE]; } td[][11] = { { /* ANSI_FIXED_FONT */ - { DEFAULT_CHARSET, FW_NORMAL, 12, 96, "Courier" }, - { DEFAULT_CHARSET, FW_NORMAL, 12, 120, "Courier" }, + { DEFAULT_CHARSET, FW_NORMAL, 12, 13, 96, "Courier" }, + { DEFAULT_CHARSET, FW_NORMAL, 12, 13, 120, "Courier" }, { 0 } }, { /* ANSI_VAR_FONT */ - { DEFAULT_CHARSET, FW_NORMAL, 12, 96, "MS Sans Serif" }, - { DEFAULT_CHARSET, FW_NORMAL, 12, 120, "MS Sans Serif" }, + { DEFAULT_CHARSET, FW_NORMAL, 12, 13, 96, "MS Sans Serif" }, + { DEFAULT_CHARSET, FW_NORMAL, 12, 13, 120, "MS Sans Serif" }, { 0 } }, { /* SYSTEM_FONT */ - { SHIFTJIS_CHARSET, FW_NORMAL, 18, 96, "System" }, - { SHIFTJIS_CHARSET, FW_NORMAL, 22, 120, "System" }, - { HANGEUL_CHARSET, FW_NORMAL, 16, 96, "System" }, - { HANGEUL_CHARSET, FW_NORMAL, 20, 120, "System" }, - { DEFAULT_CHARSET, FW_BOLD, 16, 96, "System" }, - { DEFAULT_CHARSET, FW_BOLD, 20, 120, "System" }, + { SHIFTJIS_CHARSET, FW_NORMAL, 18, 18, 96, "System" }, + { SHIFTJIS_CHARSET, FW_NORMAL, 22, 22, 120, "System" }, + { HANGEUL_CHARSET, FW_NORMAL, 16, 16, 96, "System" }, + { HANGEUL_CHARSET, FW_NORMAL, 20, 20, 120, "System" }, + { DEFAULT_CHARSET, FW_BOLD, 16, 16, 96, "System" }, + { DEFAULT_CHARSET, FW_BOLD, 20, 20, 120, "System" }, { 0 } }, { /* DEVICE_DEFAULT_FONT */ - { SHIFTJIS_CHARSET, FW_NORMAL, 18, 96, "System" }, - { SHIFTJIS_CHARSET, FW_NORMAL, 22, 120, "System" }, - { HANGEUL_CHARSET, FW_NORMAL, 16, 96, "System" }, - { HANGEUL_CHARSET, FW_NORMAL, 20, 120, "System" }, - { DEFAULT_CHARSET, FW_BOLD, 16, 96, "System" }, - { DEFAULT_CHARSET, FW_BOLD, 20, 120, "System" }, + { SHIFTJIS_CHARSET, FW_NORMAL, 18, 18, 96, "System" }, + { SHIFTJIS_CHARSET, FW_NORMAL, 22, 22, 120, "System" }, + { HANGEUL_CHARSET, FW_NORMAL, 16, 16, 96, "System" }, + { HANGEUL_CHARSET, FW_NORMAL, 20, 20, 120, "System" }, + { DEFAULT_CHARSET, FW_BOLD, 16, 16, 96, "System" }, + { DEFAULT_CHARSET, FW_BOLD, 20, 20, 120, "System" }, { 0 } }, { /* DEFAULT_GUI_FONT */ - { SHIFTJIS_CHARSET, FW_NORMAL, -12, 96, "?MS UI Gothic" }, - { SHIFTJIS_CHARSET, FW_NORMAL, -15, 120, "?MS UI Gothic" }, - { HANGEUL_CHARSET, FW_NORMAL, -12, 96, "?Gulim" }, - { HANGEUL_CHARSET, FW_NORMAL, -15, 120, "?Gulim" }, - { GB2312_CHARSET, FW_NORMAL, -12, 96, "?SimHei" }, - { GB2312_CHARSET, FW_NORMAL, -15, 120, "?SimHei" }, - { CHINESEBIG5_CHARSET, FW_NORMAL, -12, 96, "?MingLiU" }, - { CHINESEBIG5_CHARSET, FW_NORMAL, -15, 120, "?MingLiU" }, - { DEFAULT_CHARSET, FW_NORMAL, -11, 96, "MS Shell Dlg" }, - { DEFAULT_CHARSET, FW_NORMAL, -13, 120, "MS Shell Dlg" }, + { SHIFTJIS_CHARSET, FW_NORMAL, -12, 15, 96, "?MS UI Gothic" }, + { SHIFTJIS_CHARSET, FW_NORMAL, -15, 18, 120, "?MS UI Gothic" }, + { HANGEUL_CHARSET, FW_NORMAL, -12, 15, 96, "?Gulim" }, + { HANGEUL_CHARSET, FW_NORMAL, -15, 18, 120, "?Gulim" }, + { GB2312_CHARSET, FW_NORMAL, -12, 15, 96, "?SimHei" }, + { GB2312_CHARSET, FW_NORMAL, -15, 18, 120, "?SimHei" }, + { CHINESEBIG5_CHARSET, FW_NORMAL, -12, 15, 96, "?MingLiU" }, + { CHINESEBIG5_CHARSET, FW_NORMAL, -15, 18, 120, "?MingLiU" }, + { DEFAULT_CHARSET, FW_NORMAL, -11, 13, 96, "MS Shell Dlg" }, + { DEFAULT_CHARSET, FW_NORMAL, -13, 16, 120, "MS Shell Dlg" }, { 0 } } }; @@ -4951,13 +5564,13 @@ static void test_stock_fonts(void) for (i = 0; i < sizeof(font)/sizeof(font[0]); i++) { HFONT hfont; - LOGFONT lf; - int ret; + LOGFONTA lf; + int ret, height; hfont = GetStockObject(font[i]); ok(hfont != 0, "%d: GetStockObject(%d) failed\n", i, font[i]); - ret = GetObject(hfont, sizeof(lf), &lf); + ret = GetObjectA(hfont, sizeof(lf), &lf); if (ret != sizeof(lf)) { /* NT4 */ @@ -4972,7 +5585,7 @@ static void test_stock_fonts(void) continue; } - ret = get_font_dpi(&lf); + ret = get_font_dpi(&lf, &height); if (ret != td[i][j].dpi) { trace("%d(%d): font %s %d dpi doesn't match test data %d\n", @@ -4980,6 +5593,17 @@ static void test_stock_fonts(void) continue; } + /* FIXME: Remove once Wine is fixed */ + if (td[i][j].dpi != 96 && + /* MS Sans Serif for 120 dpi and higher should include 12 pixel bitmap set */ + ((!strcmp(td[i][j].face_name, "MS Sans Serif") && td[i][j].height == 12) || + /* System for 120 dpi and higher should include 20 pixel bitmap set */ + (!strcmp(td[i][j].face_name, "System") && td[i][j].height > 16))) + todo_wine + ok(height == td[i][j].height_pixels, "%d(%d): expected height %d, got %d\n", i, j, td[i][j].height_pixels, height); + else + ok(height == td[i][j].height_pixels, "%d(%d): expected height %d, got %d\n", i, j, td[i][j].height_pixels, height); + ok(td[i][j].weight == lf.lfWeight, "%d(%d): expected lfWeight %d, got %d\n", i, j, td[i][j].weight, lf.lfWeight); ok(td[i][j].height == lf.lfHeight, "%d(%d): expected lfHeight %d, got %d\n", i, j, td[i][j].height, lf.lfHeight); if (td[i][j].face_name[0] == '?') @@ -4991,13 +5615,402 @@ static void test_stock_fonts(void) } else { - ok(!lstrcmp(td[i][j].face_name, lf.lfFaceName), "%d(%d): expected lfFaceName %s, got %s\n", i, j, td[i][j].face_name, lf.lfFaceName); + ok(!strcmp(td[i][j].face_name, lf.lfFaceName), "%d(%d): expected lfFaceName %s, got %s\n", i, j, td[i][j].face_name, lf.lfFaceName); } break; } } } +static void test_max_height(void) +{ + HDC hdc; + LOGFONTA lf; + HFONT hfont, hfont_old; + TEXTMETRICA tm1, tm; + BOOL r; + LONG invalid_height[] = { -65536, -123456, 123456 }; + size_t i; + + memset(&tm1, 0, sizeof(tm1)); + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "Tahoma"); + lf.lfHeight = -1; + + hdc = GetDC(NULL); + + /* get 1 ppem value */ + hfont = CreateFontIndirectA(&lf); + hfont_old = SelectObject(hdc, hfont); + r = GetTextMetricsA(hdc, &tm1); + ok(r, "GetTextMetrics failed\n"); + ok(tm1.tmHeight > 0, "expected a positive value, got %d\n", tm1.tmHeight); + ok(tm1.tmAveCharWidth > 0, "expected a positive value, got %d\n", tm1.tmHeight); + DeleteObject(SelectObject(hdc, hfont_old)); + + /* test the largest value */ + lf.lfHeight = -((1 << 16) - 1); + hfont = CreateFontIndirectA(&lf); + hfont_old = SelectObject(hdc, hfont); + memset(&tm, 0, sizeof(tm)); + r = GetTextMetricsA(hdc, &tm); + ok(r, "GetTextMetrics failed\n"); + ok(tm.tmHeight > tm1.tmHeight, + "expected greater than 1 ppem value (%d), got %d\n", tm1.tmHeight, tm.tmHeight); + ok(tm.tmAveCharWidth > tm1.tmAveCharWidth, + "expected greater than 1 ppem value (%d), got %d\n", tm1.tmAveCharWidth, tm.tmAveCharWidth); + DeleteObject(SelectObject(hdc, hfont_old)); + + /* test an invalid value */ + for (i = 0; i < sizeof(invalid_height)/sizeof(invalid_height[0]); i++) { + lf.lfHeight = invalid_height[i]; + hfont = CreateFontIndirectA(&lf); + hfont_old = SelectObject(hdc, hfont); + memset(&tm, 0, sizeof(tm)); + r = GetTextMetricsA(hdc, &tm); + ok(r, "GetTextMetrics failed\n"); + ok(tm.tmHeight == tm1.tmHeight, + "expected 1 ppem value (%d), got %d\n", tm1.tmHeight, tm.tmHeight); + ok(tm.tmAveCharWidth == tm1.tmAveCharWidth, + "expected 1 ppem value (%d), got %d\n", tm1.tmAveCharWidth, tm.tmAveCharWidth); + DeleteObject(SelectObject(hdc, hfont_old)); + } + + ReleaseDC(NULL, hdc); + return; +} + +static void test_vertical_order(void) +{ + struct enum_font_data efd; + LOGFONTA lf; + HDC hdc; + int i, j; + + hdc = CreateCompatibleDC(0); + ok(hdc != NULL, "CreateCompatibleDC failed\n"); + + memset(&lf, 0, sizeof(lf)); + lf.lfCharSet = DEFAULT_CHARSET; + lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf.lfHeight = 16; + lf.lfWidth = 16; + lf.lfQuality = DEFAULT_QUALITY; + lf.lfItalic = FALSE; + lf.lfWeight = FW_DONTCARE; + efd.total = 0; + EnumFontFamiliesExA(hdc, &lf, enum_font_data_proc, (LPARAM)&efd, 0); + for (i = 0; i < efd.total; i++) + { + if (efd.lf[i].lfFaceName[0] != '@') continue; + for (j = 0; j < efd.total; j++) + { + if (!strcmp(efd.lf[i].lfFaceName + 1, efd.lf[j].lfFaceName)) + { + ok(i > j,"Found vertical font %s before its horizontal version\n", efd.lf[i].lfFaceName); + break; + } + } + } + DeleteDC( hdc ); +} + +static void test_GetCharWidth32(void) +{ + BOOL ret; + HDC hdc; + LOGFONTA lf; + HFONT hfont; + INT bufferA; + INT bufferW; + HWND hwnd; + + if (!pGetCharWidth32A || !pGetCharWidth32W) + { + win_skip("GetCharWidth32A/W not available on this platform\n"); + return; + } + + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "System"); + lf.lfHeight = 20; + + hfont = CreateFontIndirectA(&lf); + hdc = GetDC(0); + hfont = SelectObject(hdc, hfont); + + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ret = pGetCharWidth32A(hdc, 'a', 'a', &bufferA); + ok(ret, "GetCharWidth32A should have succeeded\n"); + ok (bufferA == bufferW, "Widths should be the same\n"); + ok (bufferA > 0," Width should be greater than zero\n"); + + hfont = SelectObject(hdc, hfont); + DeleteObject(hfont); + ReleaseDC(NULL, hdc); + + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "Tahoma"); + lf.lfHeight = 20; + + hfont = CreateFontIndirectA(&lf); + hwnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100, + 0, 0, 0, NULL); + hdc = GetDC(hwnd); + SetMapMode( hdc, MM_ANISOTROPIC ); + SelectObject(hdc, hfont); + + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetWindowExtEx(hdc, -1,-1,NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetGraphicsMode(hdc, GM_ADVANCED); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + todo_wine ok (bufferW > 0," Width should be greater than zero\n"); + SetWindowExtEx(hdc, 1,1,NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetGraphicsMode(hdc, GM_ADVANCED); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + + ReleaseDC(hwnd, hdc); + DestroyWindow(hwnd); + + hwnd = CreateWindowExA(WS_EX_LAYOUTRTL, "static", "", WS_POPUP, 0,0,100,100, + 0, 0, 0, NULL); + hdc = GetDC(hwnd); + SetMapMode( hdc, MM_ANISOTROPIC ); + SelectObject(hdc, hfont); + + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetWindowExtEx(hdc, -1,-1,NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetGraphicsMode(hdc, GM_ADVANCED); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetWindowExtEx(hdc, 1,1,NULL); + SetGraphicsMode(hdc, GM_COMPATIBLE); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + ok (bufferW > 0," Width should be greater than zero\n"); + SetGraphicsMode(hdc, GM_ADVANCED); + ret = pGetCharWidth32W(hdc, 'a', 'a', &bufferW); + ok(ret, "GetCharWidth32W should have succeeded\n"); + todo_wine ok (bufferW > 0," Width should be greater than zero\n"); + + ReleaseDC(hwnd, hdc); + DestroyWindow(hwnd); + DeleteObject(hfont); +} + +static void test_fake_bold_font(void) +{ + HDC hdc; + HFONT hfont, hfont_old; + LOGFONTA lf; + BOOL ret; + TEXTMETRICA tm[2]; + ABC abc[2]; + INT w[2]; + + if (!pGetCharWidth32A || !pGetCharABCWidthsA) { + win_skip("GetCharWidth32A/GetCharABCWidthA is not available on this platform\n"); + return; + } + + /* Test outline font */ + memset(&lf, 0, sizeof(lf)); + strcpy(lf.lfFaceName, "Wingdings"); + lf.lfWeight = FW_NORMAL; + lf.lfCharSet = SYMBOL_CHARSET; + hfont = CreateFontIndirectA(&lf); + + hdc = GetDC(NULL); + hfont_old = SelectObject(hdc, hfont); + + /* base metrics */ + ret = GetTextMetricsA(hdc, &tm[0]); + ok(ret, "got %d\n", ret); + ret = pGetCharABCWidthsA(hdc, 0x76, 0x76, &abc[0]); + ok(ret, "got %d\n", ret); + + lf.lfWeight = FW_BOLD; + hfont = CreateFontIndirectA(&lf); + DeleteObject(SelectObject(hdc, hfont)); + + /* bold metrics */ + ret = GetTextMetricsA(hdc, &tm[1]); + ok(ret, "got %d\n", ret); + ret = pGetCharABCWidthsA(hdc, 0x76, 0x76, &abc[1]); + ok(ret, "got %d\n", ret); + + DeleteObject(SelectObject(hdc, hfont_old)); + ReleaseDC(NULL, hdc); + + /* compare results (outline) */ + ok(tm[0].tmHeight == tm[1].tmHeight, "expected %d, got %d\n", tm[0].tmHeight, tm[1].tmHeight); + ok(tm[0].tmAscent == tm[1].tmAscent, "expected %d, got %d\n", tm[0].tmAscent, tm[1].tmAscent); + ok(tm[0].tmDescent == tm[1].tmDescent, "expected %d, got %d\n", tm[0].tmDescent, tm[1].tmDescent); + ok((tm[0].tmAveCharWidth + 1) == tm[1].tmAveCharWidth, + "expected %d, got %d\n", tm[0].tmAveCharWidth + 1, tm[1].tmAveCharWidth); + ok((tm[0].tmMaxCharWidth + 1) == tm[1].tmMaxCharWidth, + "expected %d, got %d\n", tm[0].tmMaxCharWidth + 1, tm[1].tmMaxCharWidth); + ok(tm[0].tmOverhang == tm[1].tmOverhang, "expected %d, got %d\n", tm[0].tmOverhang, tm[1].tmOverhang); + w[0] = abc[0].abcA + abc[0].abcB + abc[0].abcC; + w[1] = abc[1].abcA + abc[1].abcB + abc[1].abcC; + ok((w[0] + 1) == w[1], "expected %d, got %d\n", w[0] + 1, w[1]); + +} + +static void test_bitmap_font_glyph_index(void) +{ + const WCHAR text[] = {'#','!','/','b','i','n','/','s','h',0}; + const struct { + LPCSTR face; + BYTE charset; + } bitmap_font_list[] = { + { "Courier", ANSI_CHARSET }, + { "Small Fonts", ANSI_CHARSET }, + { "Fixedsys", DEFAULT_CHARSET }, + { "System", DEFAULT_CHARSET } + }; + HDC hdc; + LOGFONTA lf; + HFONT hFont; + CHAR facename[LF_FACESIZE]; + BITMAPINFO bmi; + HBITMAP hBmp[2]; + void *pixels[2]; + int i, j; + DWORD ret; + BITMAP bmp; + TEXTMETRICA tm; + CHARSETINFO ci; + BYTE chr = '\xA9'; + + if (!pGetGlyphIndicesW || !pGetGlyphIndicesA) { + win_skip("GetGlyphIndices is unavailable\n"); + return; + } + + hdc = CreateCompatibleDC(0); + ok(hdc != NULL, "CreateCompatibleDC failed\n"); + + memset(&bmi, 0, sizeof(bmi)); + bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi.bmiHeader.biBitCount = 32; + bmi.bmiHeader.biPlanes = 1; + bmi.bmiHeader.biWidth = 128; + bmi.bmiHeader.biHeight = 32; + bmi.bmiHeader.biCompression = BI_RGB; + + for (i = 0; i < sizeof(bitmap_font_list)/sizeof(bitmap_font_list[0]); i++) { + memset(&lf, 0, sizeof(lf)); + lf.lfCharSet = bitmap_font_list[i].charset; + strcpy(lf.lfFaceName, bitmap_font_list[i].face); + hFont = CreateFontIndirectA(&lf); + ok(hFont != NULL, "Can't create font (%s:%d)\n", lf.lfFaceName, lf.lfCharSet); + hFont = SelectObject(hdc, hFont); + ret = GetTextMetricsA(hdc, &tm); + ok(ret, "GetTextMetric failed\n"); + ret = GetTextFaceA(hdc, sizeof(facename), facename); + ok(ret, "GetTextFace failed\n"); + if (tm.tmPitchAndFamily & TMPF_TRUETYPE) { + skip("TrueType font (%s) was selected for \"%s\"\n", facename, bitmap_font_list[i].face); + continue; + } + if (lstrcmpiA(facename, lf.lfFaceName) != 0) { + skip("expected %s, got %s\n", lf.lfFaceName, facename); + continue; + } + + for (j = 0; j < 2; j++) { + HBITMAP hBmpPrev; + hBmp[j] = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &pixels[j], NULL, 0); + ok(hBmp[j] != NULL, "Can't create DIB\n"); + hBmpPrev = SelectObject(hdc, hBmp[j]); + switch (j) { + case 0: + ret = ExtTextOutW(hdc, 0, 0, 0, NULL, text, lstrlenW(text), NULL); + break; + case 1: + { + int len = lstrlenW(text); + LPWORD indices = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WORD)); + ret = pGetGlyphIndicesW(hdc, text, len, indices, 0); + ok(ret, "GetGlyphIndices failed\n"); + ok(memcmp(indices, text, sizeof(WORD) * len) == 0, + "Glyph indices and text are different for %s:%d\n", lf.lfFaceName, tm.tmCharSet); + ret = ExtTextOutW(hdc, 0, 0, ETO_GLYPH_INDEX, NULL, indices, len, NULL); + HeapFree(GetProcessHeap(), 0, indices); + break; + } + } + ok(ret, "ExtTextOutW failed\n"); + SelectObject(hdc, hBmpPrev); + } + + GetObjectA(hBmp[0], sizeof(bmp), &bmp); + ok(memcmp(pixels[0], pixels[1], bmp.bmHeight * bmp.bmWidthBytes) == 0, + "Images are different (%s:%d)\n", lf.lfFaceName, tm.tmCharSet); + + ret = TranslateCharsetInfo((LPDWORD)(DWORD_PTR)tm.tmCharSet, &ci, TCI_SRCCHARSET); + if (!ret) { + skip("Can't get charset info for (%s:%d)\n", lf.lfFaceName, tm.tmCharSet); + goto next; + } + if (IsDBCSLeadByteEx(ci.ciACP, chr)) { + skip("High-ascii character is not defined in codepage %d\n", ci.ciACP); + goto next; + } + + for (j = 0; j < 2; j++) { + HBITMAP hBmpPrev; + WORD code; + hBmpPrev = SelectObject(hdc, hBmp[j]); + switch (j) { + case 0: + ret = ExtTextOutA(hdc, 100, 0, 0, NULL, (LPCSTR)&chr, 1, NULL); + break; + case 1: + ret = pGetGlyphIndicesA(hdc, (LPCSTR)&chr, 1, &code, 0); + ok(ret, "GetGlyphIndices failed\n"); + ok(code == chr, "expected %02x, got %02x (%s:%d)\n", chr, code, lf.lfFaceName, tm.tmCharSet); + ret = ExtTextOutA(hdc, 100, 0, ETO_GLYPH_INDEX, NULL, (LPCSTR)&code, 1, NULL); + break; + } + ok(ret, "ExtTextOutA failed\n"); + SelectObject(hdc, hBmpPrev); + } + + ok(memcmp(pixels[0], pixels[1], bmp.bmHeight * bmp.bmWidthBytes) == 0, + "Images are different (%s:%d)\n", lf.lfFaceName, tm.tmCharSet); + next: + for (j = 0; j < 2; j++) + DeleteObject(hBmp[j]); + hFont = SelectObject(hdc, hFont); + DeleteObject(hFont); + } + + DeleteDC(hdc); +} + START_TEST(font) { init(); @@ -5054,6 +6067,11 @@ START_TEST(font) test_fullname(); test_fullname2(); test_east_asian_font_selection(); + test_max_height(); + test_vertical_order(); + test_GetCharWidth32(); + test_fake_bold_font(); + test_bitmap_font_glyph_index(); /* These tests should be last test until RemoveFontResource * is properly implemented. diff --git a/rostests/winetests/gdi32/gdiobj.c b/rostests/winetests/gdi32/gdiobj.c index 3b9f73441ef..65374ea85dc 100755 --- a/rostests/winetests/gdi32/gdiobj.c +++ b/rostests/winetests/gdi32/gdiobj.c @@ -121,7 +121,7 @@ static DWORD WINAPI thread_proc(void *param) DWORD status; struct hgdiobj_event *hgdiobj_event = param; - hgdiobj_event->hdc = CreateDC("display", NULL, NULL, NULL); + hgdiobj_event->hdc = CreateDCA("display", NULL, NULL, NULL); ok(hgdiobj_event->hdc != NULL, "CreateDC error %u\n", GetLastError()); hgdiobj_event->hgdiobj1 = CreatePen(PS_DASHDOTDOT, 17, RGB(1, 2, 3)); @@ -134,7 +134,7 @@ static DWORD WINAPI thread_proc(void *param) status = WaitForSingleObject(hgdiobj_event->stop_event, INFINITE); ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError()); - ok(!GetObject(hgdiobj_event->hgdiobj1, sizeof(lp), &lp), "GetObject should fail\n"); + ok(!GetObjectA(hgdiobj_event->hgdiobj1, sizeof(lp), &lp), "GetObject should fail\n"); ok(!GetDeviceCaps(hgdiobj_event->hdc, TECHNOLOGY), "GetDeviceCaps(TECHNOLOGY) should fail\n"); @@ -151,9 +151,9 @@ static void test_thread_objects(void) DWORD status; BOOL bRet; - hgdiobj_event.stop_event = CreateEvent(NULL, 0, 0, NULL); + hgdiobj_event.stop_event = CreateEventA(NULL, 0, 0, NULL); ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %u\n", GetLastError()); - hgdiobj_event.ready_event = CreateEvent(NULL, 0, 0, NULL); + hgdiobj_event.ready_event = CreateEventA(NULL, 0, 0, NULL); ok(hgdiobj_event.ready_event != NULL, "CreateEvent error %u\n", GetLastError()); hthread = CreateThread(NULL, 0, thread_proc, &hgdiobj_event, 0, &tid); @@ -162,7 +162,7 @@ static void test_thread_objects(void) status = WaitForSingleObject(hgdiobj_event.ready_event, INFINITE); ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError()); - ret = GetObject(hgdiobj_event.hgdiobj1, sizeof(lp), &lp); + ret = GetObjectA(hgdiobj_event.hgdiobj1, sizeof(lp), &lp); ok(ret == sizeof(lp), "GetObject error %u\n", GetLastError()); ok(lp.lopnStyle == PS_DASHDOTDOT, "wrong pen style %d\n", lp.lopnStyle); ok(lp.lopnWidth.x == 17, "wrong pen width.y %d\n", lp.lopnWidth.x); @@ -249,7 +249,7 @@ static void test_GetCurrentObject(void) hobj = GetCurrentObject(hdc, OBJ_BITMAP); ok(hobj == hbmp, "OBJ_BITMAP is wrong: %p\n", hobj); - assert(GetObject(hbrush, sizeof(lb), &lb) == sizeof(lb)); + assert(GetObjectA(hbrush, sizeof(lb), &lb) == sizeof(lb)); hpen = ExtCreatePen(PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_SQUARE | PS_JOIN_BEVEL, 10, &lb, 0, NULL); assert(hpen != 0); diff --git a/rostests/winetests/gdi32/generated.c b/rostests/winetests/gdi32/generated.c index 497d90084fb..019524df86c 100644 --- a/rostests/winetests/gdi32/generated.c +++ b/rostests/winetests/gdi32/generated.c @@ -4434,13 +4434,6 @@ static void test_pack_NPEXTLOGPEN(void) TEST_TARGET_ALIGN(NPEXTLOGPEN, 8) } -static void test_pack_OLDFONTENUMPROC(void) -{ - /* OLDFONTENUMPROC */ - TEST_TYPE_SIZE (OLDFONTENUMPROC, 8) - TEST_TYPE_ALIGN (OLDFONTENUMPROC, 8) -} - static void test_pack_OLDFONTENUMPROCA(void) { /* OLDFONTENUMPROCA */ @@ -10964,13 +10957,6 @@ static void test_pack_NPEXTLOGPEN(void) TEST_TARGET_ALIGN(NPEXTLOGPEN, 4) } -static void test_pack_OLDFONTENUMPROC(void) -{ - /* OLDFONTENUMPROC */ - TEST_TYPE_SIZE (OLDFONTENUMPROC, 4) - TEST_TYPE_ALIGN (OLDFONTENUMPROC, 4) -} - static void test_pack_OLDFONTENUMPROCA(void) { /* OLDFONTENUMPROCA */ @@ -13386,7 +13372,6 @@ static void test_pack(void) test_pack_NEWTEXTMETRICEXW(); test_pack_NEWTEXTMETRICW(); test_pack_NPEXTLOGPEN(); - test_pack_OLDFONTENUMPROC(); test_pack_OLDFONTENUMPROCA(); test_pack_OLDFONTENUMPROCW(); test_pack_OUTLINETEXTMETRICA(); diff --git a/rostests/winetests/gdi32/mapping.c b/rostests/winetests/gdi32/mapping.c index 4850c29662f..b8dd8ee6ee9 100644 --- a/rostests/winetests/gdi32/mapping.c +++ b/rostests/winetests/gdi32/mapping.c @@ -32,7 +32,7 @@ static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout); static DWORD (WINAPI *pGetLayout)(HDC hdc); static INT (WINAPI *pGetRandomRgn)(HDC hDC, HRGN hRgn, INT iCode); static BOOL (WINAPI *pGetTransform)(HDC, DWORD, XFORM *); -static DWORD (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD); +static BOOL (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD); #define rough_match(got, expected) (abs( MulDiv( (got) - (expected), 1000, (expected) )) <= 5) @@ -513,7 +513,7 @@ static void test_isotropic_mapping(void) static void test_setvirtualresolution(void) { HDC hdc = CreateICA("DISPLAY", NULL, NULL, NULL); - DWORD r; + BOOL r; INT horz_res = GetDeviceCaps(hdc, HORZRES); INT horz_size = GetDeviceCaps(hdc, HORZSIZE); INT log_pixels_x = GetDeviceCaps(hdc, LOGPIXELSX); diff --git a/rostests/winetests/gdi32/metafile.c b/rostests/winetests/gdi32/metafile.c index e10a72da752..aae5995eeab 100755 --- a/rostests/winetests/gdi32/metafile.c +++ b/rostests/winetests/gdi32/metafile.c @@ -2724,7 +2724,7 @@ static HENHMETAFILE create_converted_emf(const METAFILEPICT *mfp) UINT size; LPBYTE pBits; - hdcMf = CreateMetaFile(NULL); + hdcMf = CreateMetaFileA(NULL); ok(hdcMf != NULL, "CreateMetaFile failed with error %d\n", GetLastError()); ret = LineTo(hdcMf, (INT)LINE_X, (INT)LINE_Y); ok(ret, "LineTo failed with error %d\n", GetLastError()); @@ -2904,7 +2904,7 @@ static void test_SetWinMetaFileBits(void) HDC dc; LONG diffx, diffy; - wmfDC = CreateMetaFile(NULL); + wmfDC = CreateMetaFileA(NULL); ok(wmfDC != NULL, "CreateMetaFile failed\n"); if (!wmfDC) return; @@ -3251,7 +3251,7 @@ static void test_gdiis(void) HMODULE hgdi32; /* resolve all the functions */ - hgdi32 = GetModuleHandle("gdi32"); + hgdi32 = GetModuleHandleA("gdi32.dll"); pGdiIsMetaPrintDC = (void*) GetProcAddress(hgdi32, "GdiIsMetaPrintDC"); pGdiIsMetaFileDC = (void*) GetProcAddress(hgdi32, "GdiIsMetaFileDC"); pGdiIsPlayMetafileDC = (void*) GetProcAddress(hgdi32, "GdiIsPlayMetafileDC"); @@ -3268,7 +3268,7 @@ static void test_gdiis(void) ok(!pGdiIsPlayMetafileDC(NULL), "isplaymetafile with NULL parameter\n"); /* try with a metafile */ - hmfDC = CreateMetaFile(NULL); + hmfDC = CreateMetaFileA(NULL); ok(!pGdiIsMetaPrintDC(hmfDC), "ismetaprint on metafile\n"); ok(pGdiIsMetaFileDC(hmfDC), "ismetafile on metafile\n"); ok(!pGdiIsPlayMetafileDC(hmfDC), "isplaymetafile on metafile\n"); diff --git a/rostests/winetests/gdi32/palette.c b/rostests/winetests/gdi32/palette.c index ebdc4e44ce1..f95c0d3cef6 100644 --- a/rostests/winetests/gdi32/palette.c +++ b/rostests/winetests/gdi32/palette.c @@ -96,7 +96,7 @@ static void test_DIB_PAL_COLORS(void) { getColor = GetPixel( memhdc, 0, 0 ); ok( getColor == chkColor, "getColor=%08X\n", (UINT)getColor ); - /* Test with a invalid DIBINDEX to DIB_PAL_COLORS */ + /* Test with an invalid DIBINDEX to DIB_PAL_COLORS */ setColor = DIBINDEX( 12 ); SetPixel( memhdc, 0, 0, setColor ); chkColor = RGB( 0, 0, 0 ); @@ -162,10 +162,10 @@ static void test_halftone_palette(void) ok( count == 256 || broken(count <= 20), /* nt 4 */ "wrong size %u\n", count ); - /* first and last 10 match the default palette */ + /* first and last 8 match the default palette */ if (count >= 20) { - for (i = 0; i < 10; i++) + for (i = 0; i < 8; i++) { ok( entries[i].peRed == defpal[i].peRed && entries[i].peGreen == defpal[i].peGreen && @@ -175,7 +175,7 @@ static void test_halftone_palette(void) entries[i].peRed, entries[i].peGreen, entries[i].peBlue, entries[i].peFlags, defpal[i].peRed, defpal[i].peGreen, defpal[i].peBlue ); } - for (i = count - 10; i < count; i++) + for (i = count - 8; i < count; i++) { int idx = i - count + 20; ok( entries[i].peRed == defpal[idx].peRed && diff --git a/rostests/winetests/gdi32/path.c b/rostests/winetests/gdi32/path.c index 8399b19f3b2..0b350bc9886 100644 --- a/rostests/winetests/gdi32/path.c +++ b/rostests/winetests/gdi32/path.c @@ -270,7 +270,8 @@ static void test_widenpath(void) HDC hdc = GetDC(0); HPEN greenPen, narrowPen; POINT pnt[6]; - INT nSize, ret; + INT nSize; + BOOL ret; /* Create a pen to be used in WidenPath */ greenPen = CreatePen(PS_SOLID, 10, RGB(0,0,0)); diff --git a/rostests/winetests/gdi32/pen.c b/rostests/winetests/gdi32/pen.c index ed7927a3343..43f00d8f50f 100644 --- a/rostests/winetests/gdi32/pen.c +++ b/rostests/winetests/gdi32/pen.c @@ -95,7 +95,7 @@ static void test_logpen(void) memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(lp), &lp); + size = GetObjectW(hpen, sizeof(lp), &lp); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); @@ -114,30 +114,30 @@ static void test_logpen(void) ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type); /* check what's the real size of the object */ - size = GetObject(hpen, 0, NULL); + size = GetObjectW(hpen, 0, NULL); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); /* ask for truncated data */ memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(lp.lopnStyle), &lp); + size = GetObjectW(hpen, sizeof(lp.lopnStyle), &lp); ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError()); /* see how larger buffer sizes are handled */ memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(lp) * 4, &lp); + size = GetObjectW(hpen, sizeof(lp) * 4, &lp); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); /* see how larger buffer sizes are handled */ memset(&elp, 0xb0, sizeof(elp)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(elp) * 2, &elp); + size = GetObjectW(hpen, sizeof(elp) * 2, &elp); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(lp), &lp); + size = GetObjectW(hpen, sizeof(lp), &lp); ok(size == sizeof(lp), "GetObject returned %d, error %d\n", size, GetLastError()); ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); @@ -147,13 +147,14 @@ static void test_logpen(void) memset(&elp, 0xb0, sizeof(elp)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(elp), &elp); + size = GetObjectW(hpen, sizeof(elp), &elp); /* for some reason XP differentiates PS_NULL here */ if (pen[i].style == PS_NULL) { ok(hpen == GetStockObject(NULL_PEN), "hpen should be a stock NULL_PEN\n"); - ok(size == sizeof(EXTLOGPEN), "GetObject returned %d, error %d\n", size, GetLastError()); + ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]), "GetObject returned %d, error %d\n", + size, GetLastError()); ok(elp.elpPenStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, elp.elpPenStyle); ok(elp.elpWidth == 0, "expected 0, got %u\n", elp.elpWidth); ok(elp.elpColor == pen[i].ret_color, "expected %08x, got %08x\n", pen[i].ret_color, elp.elpColor); @@ -230,7 +231,7 @@ static void test_logpen(void) /* check what's the real size of the object */ SetLastError(0xdeadbeef); - size = GetObject(hpen, 0, NULL); + size = GetObjectW(hpen, 0, NULL); switch (pen[i].style) { case PS_NULL: @@ -239,12 +240,12 @@ static void test_logpen(void) break; case PS_USERSTYLE: - ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry[2] ), + ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ), "GetObject returned %d, error %d\n", size, GetLastError()); break; default: - ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), + ok(size == offsetof( EXTLOGPEN, elpStyleEntry ), "GetObject returned %d, error %d\n", size, GetLastError()); break; } @@ -252,13 +253,13 @@ static void test_logpen(void) /* ask for truncated data */ memset(&elp, 0xb0, sizeof(elp)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(elp.elpPenStyle), &elp); + size = GetObjectW(hpen, sizeof(elp.elpPenStyle), &elp); ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError()); /* see how larger buffer sizes are handled */ memset(elp_buffer, 0xb0, sizeof(elp_buffer)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(elp_buffer), elp_buffer); + size = GetObjectW(hpen, sizeof(elp_buffer), elp_buffer); switch (pen[i].style) { case PS_NULL: @@ -274,15 +275,15 @@ static void test_logpen(void) memset(&elp, 0xb0, sizeof(elp)); memset(&unset_hatch, 0xb0, sizeof(unset_hatch)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(elp), &elp); - ok(size == sizeof(EXTLOGPEN), + size = GetObjectW(hpen, sizeof(elp), &elp); + ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]), "GetObject returned %d, error %d\n", size, GetLastError()); ok(ext_pen->elpHatch == unset_hatch, "expected 0xb0b0b0b0, got %p\n", (void *)ext_pen->elpHatch); ok(ext_pen->elpNumEntries == 0xb0b0b0b0, "expected 0xb0b0b0b0, got %x\n", ext_pen->elpNumEntries); break; case PS_USERSTYLE: - ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry[2] ), + ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ), "GetObject returned %d, error %d\n", size, GetLastError()); ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch); ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries); @@ -291,7 +292,7 @@ static void test_logpen(void) break; default: - ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), + ok(size == offsetof( EXTLOGPEN, elpStyleEntry ), "GetObject returned %d, error %d\n", size, GetLastError()); ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch); ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries); @@ -340,7 +341,7 @@ test_geometric_pens: ok(obj_type == OBJ_EXTPEN, "wrong object type %u\n", obj_type); /* check what's the real size of the object */ - size = GetObject(hpen, 0, NULL); + size = GetObjectW(hpen, 0, NULL); switch (pen[i].style) { case PS_NULL: @@ -349,12 +350,12 @@ test_geometric_pens: break; case PS_USERSTYLE: - ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry[2] ), + ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ), "GetObject returned %d, error %d\n", size, GetLastError()); break; default: - ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), + ok(size == offsetof( EXTLOGPEN, elpStyleEntry ), "GetObject returned %d, error %d\n", size, GetLastError()); break; } @@ -362,12 +363,12 @@ test_geometric_pens: /* ask for truncated data */ memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(lp.lopnStyle), &lp); + size = GetObjectW(hpen, sizeof(lp.lopnStyle), &lp); ok(!size, "GetObject should fail: size %d, error %d\n", size, GetLastError()); memset(&lp, 0xb0, sizeof(lp)); SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(lp), &lp); + size = GetObjectW(hpen, sizeof(lp), &lp); /* for some reason XP differentiates PS_NULL here */ if (pen[i].style == PS_NULL) { @@ -385,18 +386,18 @@ test_geometric_pens: memset(elp_buffer, 0xb0, sizeof(elp_buffer)); SetLastError(0xdeadbeef); /* buffer is too small for user styles */ - size = GetObject(hpen, sizeof(EXTLOGPEN), elp_buffer); + size = GetObjectW(hpen, offsetof(EXTLOGPEN, elpStyleEntry[1]), elp_buffer); switch (pen[i].style) { case PS_NULL: - ok(size == sizeof(EXTLOGPEN), + ok(size == offsetof(EXTLOGPEN, elpStyleEntry[1]), "GetObject returned %d, error %d\n", size, GetLastError()); ok(ext_pen->elpHatch == 0, "expected 0, got %p\n", (void *)ext_pen->elpHatch); ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries); /* for PS_NULL it also works this way */ SetLastError(0xdeadbeef); - size = GetObject(hpen, sizeof(elp_buffer), &lp); + size = GetObjectW(hpen, sizeof(elp_buffer), &lp); ok(size == sizeof(LOGPEN), "GetObject returned %d, error %d\n", size, GetLastError()); ok(lp.lopnStyle == pen[i].ret_style, "expected %u, got %u\n", pen[i].ret_style, lp.lopnStyle); @@ -408,8 +409,8 @@ test_geometric_pens: case PS_USERSTYLE: ok(!size /*&& GetLastError() == ERROR_INVALID_PARAMETER*/, "GetObject should fail: size %d, error %d\n", size, GetLastError()); - size = GetObject(hpen, sizeof(elp_buffer), elp_buffer); - ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry[2] ), + size = GetObjectW(hpen, sizeof(elp_buffer), elp_buffer); + ok(size == offsetof( EXTLOGPEN, elpStyleEntry[2] ), "GetObject returned %d, error %d\n", size, GetLastError()); ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch); ok(ext_pen->elpNumEntries == 2, "expected 0, got %x\n", ext_pen->elpNumEntries); @@ -418,7 +419,7 @@ test_geometric_pens: break; default: - ok(size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), + ok(size == offsetof( EXTLOGPEN, elpStyleEntry ), "GetObject returned %d, error %d\n", size, GetLastError()); ok(ext_pen->elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen->elpHatch); ok(ext_pen->elpNumEntries == 0, "expected 0, got %x\n", ext_pen->elpNumEntries); @@ -511,12 +512,8 @@ static void test_ps_userstyle(void) LOGBRUSH lb; HPEN pen; INT size, i; - - struct - { - EXTLOGPEN elp; - DWORD style_data[15]; - } ext_pen; + char buffer[offsetof(EXTLOGPEN, elpStyleEntry) + 16 * sizeof(DWORD)]; + EXTLOGPEN *ext_pen = (EXTLOGPEN *)buffer; lb.lbColor = 0x00ff0000; lb.lbStyle = BS_SOLID; @@ -561,18 +558,18 @@ static void test_ps_userstyle(void) pen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 50, &lb, 16, style); ok(pen != 0, "ExtCreatePen should not fail\n"); - size = GetObject(pen, sizeof(ext_pen), &ext_pen); - expect(FIELD_OFFSET(EXTLOGPEN,elpStyleEntry[16]), size); + size = GetObjectW(pen, sizeof(buffer), ext_pen); + ok(size == offsetof(EXTLOGPEN, elpStyleEntry[16]), "wrong size %d\n", size); for(i = 0; i < 16; i++) - expect(style[i], ext_pen.elp.elpStyleEntry[i]); + expect(style[i], ext_pen->elpStyleEntry[i]); DeleteObject(pen); } static void test_brush_pens(void) { - char buffer[sizeof(EXTLOGPEN) + 15 * sizeof(DWORD)]; + char buffer[offsetof(EXTLOGPEN, elpStyleEntry) + 16 * sizeof(DWORD)]; EXTLOGPEN *elp = (EXTLOGPEN *)buffer; LOGBRUSH lb; HPEN pen = 0; @@ -604,8 +601,8 @@ static void test_brush_pens(void) lb.lbHatch = HS_CROSS; pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL ); ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); - size = GetObject( pen, sizeof(buffer), elp ); - ok( size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); + size = GetObjectW( pen, sizeof(buffer), elp ); + ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle ); ok( elp->elpBrushStyle == lb.lbStyle, "wrong brush style %x\n", elp->elpBrushStyle ); ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor ); @@ -616,7 +613,7 @@ static void test_brush_pens(void) case BS_NULL: pen = ExtCreatePen( PS_SOLID | PS_GEOMETRIC, 3, &lb, 0, NULL ); ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); - size = GetObject( pen, sizeof(buffer), elp ); + size = GetObjectW( pen, sizeof(buffer), elp ); ok( size == sizeof(LOGPEN), "wrong size %u\n", size ); ok( ((LOGPEN *)elp)->lopnStyle == PS_NULL, "wrong pen style %x\n", ((LOGPEN *)elp)->lopnStyle ); @@ -629,8 +626,8 @@ static void test_brush_pens(void) lb.lbHatch = (ULONG_PTR)bmp; pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL ); ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); - size = GetObject( pen, sizeof(buffer), elp ); - ok( size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); + size = GetObjectW( pen, sizeof(buffer), elp ); + ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle ); ok( elp->elpBrushStyle == BS_PATTERN, "wrong brush style %x\n", elp->elpBrushStyle ); ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor ); @@ -644,8 +641,8 @@ static void test_brush_pens(void) lb.lbHatch = lb.lbStyle == BS_DIBPATTERN ? (ULONG_PTR)hmem : (ULONG_PTR)info; pen = ExtCreatePen( PS_DOT | PS_GEOMETRIC, 3, &lb, 0, NULL ); ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); - size = GetObject( pen, sizeof(buffer), elp ); - ok( size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); + size = GetObjectW( pen, sizeof(buffer), elp ); + ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); ok( elp->elpPenStyle == (PS_DOT | PS_GEOMETRIC), "wrong pen style %x\n", elp->elpPenStyle ); ok( elp->elpBrushStyle == BS_DIBPATTERNPT, "wrong brush style %x\n", elp->elpBrushStyle ); ok( elp->elpColor == 0, "wrong color %x\n", elp->elpColor ); @@ -670,8 +667,8 @@ static void test_brush_pens(void) if (lb.lbStyle == BS_SOLID) { ok( pen != 0, "ExtCreatePen failed err %u\n", GetLastError() ); - size = GetObject( pen, sizeof(buffer), elp ); - ok( size == FIELD_OFFSET( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); + size = GetObjectW( pen, sizeof(buffer), elp ); + ok( size == offsetof( EXTLOGPEN, elpStyleEntry ), "wrong size %u\n", size ); ok( elp->elpPenStyle == PS_DOT, "wrong pen style %x\n", elp->elpPenStyle ); ok( elp->elpBrushStyle == BS_SOLID, "wrong brush style %x\n", elp->elpBrushStyle ); ok( elp->elpColor == RGB(12,34,56), "wrong color %x\n", elp->elpColor ); diff --git a/rostests/winetests/gdi32/resource.rc b/rostests/winetests/gdi32/resource.rc index 34a3cdd2e0c..fdd95f687ad 100644 --- a/rostests/winetests/gdi32/resource.rc +++ b/rostests/winetests/gdi32/resource.rc @@ -23,6 +23,8 @@ /* @makedep: wine_test.ttf */ wine_test.ttf RCDATA wine_test.ttf +/* @makedep: wine_vdmx.ttf */ +wine_vdmx.ttf RCDATA wine_vdmx.ttf /* @makedep: vertical.ttf */ vertical.ttf RCDATA vertical.ttf diff --git a/rostests/winetests/gdi32/testlist.c b/rostests/winetests/gdi32/testlist.c index 370d1a1a45c..86be6ef285c 100644 --- a/rostests/winetests/gdi32/testlist.c +++ b/rostests/winetests/gdi32/testlist.c @@ -1,10 +1,7 @@ /* Automatically generated file; DO NOT EDIT!! */ -#define WIN32_LEAN_AND_MEAN -#include - #define STANDALONE -#include "wine/test.h" +#include extern void func_bitmap(void); extern void func_brush(void); diff --git a/rostests/winetests/gdi32/vertical.sfd b/rostests/winetests/gdi32/vertical.sfd index 9ec5f043d41..9d085247cae 100644 --- a/rostests/winetests/gdi32/vertical.sfd +++ b/rostests/winetests/gdi32/vertical.sfd @@ -1,46 +1,46 @@ SplineFontDB: 3.0 -FontName: mplus-1p-regular -FullName: M+ 1p regular -FamilyName: M+ 1p regular -Weight: Book -Copyright: Copyright(c) 2011 M+ FONTS PROJECT -Version: 1.044 +FontName: WineTestVertical +FullName: WineTestVertical +FamilyName: WineTestVertical +Weight: Regular +Copyright: Copyright(c) 2013 Wine Project +Version: 1.055 ItalicAngle: 0 UnderlinePosition: -100 UnderlineWidth: 50 Ascent: 860 Descent: 140 -sfntRevision: 0x00010b43 +sfntRevision: 0x00010e14 LayerCount: 2 Layer: 0 1 "Back" 1 Layer: 1 1 "Fore" 0 -NeedsXUIDChange: 1 -XUID: [1021 311 1688707159 7641229] +HasVMetrics: 1 +XUID: [1021 564 53499222 16482262] FSType: 0 OS2Version: 1 OS2_WeightWidthSlopeOnly: 0 OS2_UseTypoMetrics: 1 CreationTime: 1314095750 -ModificationTime: 1323339383 +ModificationTime: 1368817482 PfmFamily: 17 TTFWeight: 400 TTFWidth: 5 LineGap: 90 VLineGap: 0 -Panose: 2 11 5 2 2 2 3 2 2 7 -OS2TypoAscent: 0 -OS2TypoAOffset: 1 -OS2TypoDescent: 0 -OS2TypoDOffset: 1 +Panose: 2 11 5 9 2 2 3 2 2 7 +OS2TypoAscent: 860 +OS2TypoAOffset: 0 +OS2TypoDescent: -140 +OS2TypoDOffset: 0 OS2TypoLinegap: 90 -OS2WinAscent: 0 -OS2WinAOffset: 1 -OS2WinDescent: -23 -OS2WinDOffset: 1 -HheadAscent: 0 -HheadAOffset: 1 -HheadDescent: 23 -HheadDOffset: 1 +OS2WinAscent: 1075 +OS2WinAOffset: 0 +OS2WinDescent: 320 +OS2WinDOffset: 0 +HheadAscent: 1075 +HheadAOffset: 0 +HheadDescent: -320 +HheadDOffset: 0 OS2SubXSize: 650 OS2SubYSize: 700 OS2SubXOff: 0 @@ -51,110 +51,812 @@ OS2SupXOff: 0 OS2SupYOff: 480 OS2StrikeYSize: 49 OS2StrikeYPos: 258 -OS2FamilyClass: 2054 +OS2FamilyClass: 2057 OS2Vendor: 'M+ ' -OS2CodePages: 601201bf.dff70000 -OS2UnicodeRanges: e1000aff.4a47fdfb.02000012.00000000 -Lookup: 4 0 1 "kana semi-voiced lookup" {"kana semi-voiced table" } ['ccmp' ('kana' <'dflt' > ) 'liga' ('kana' <'dflt' > ) ] +OS2CodePages: 4012019f.dfd70000 +OS2UnicodeRanges: e00002ff.4a47fdeb.00000012.00000000 Lookup: 1 0 0 "gsubvert" {"j-vert" } ['vert' ('cyrl' <'dflt' > 'grek' <'dflt' > 'hani' <'dflt' > 'kana' <'JAN ' 'dflt' > 'latn' <'dflt' > ) ] -Lookup: 4 0 1 "ligalookup01" {"ligalookup01 subtable" } ['liga' ('cyrl' <'dflt' > 'grek' <'dflt' > 'hani' <'dflt' > 'kana' <'dflt' > 'latn' <'dflt' > ) ] -Lookup: 4 0 0 "ccmplookup01" {"ccmplookup01 subtable" } ['ccmp' ('hani' <'dflt' > 'kana' <'JAN ' 'dflt' > 'latn' <'dflt' > ) ] -Lookup: 4 0 0 "ccmplookup02" {"ccmplookup02 subtable" } ['ccmp' ('cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ] -Lookup: 1 0 0 "SingleSubstitutionlookupDotless" {"SingleSubstitutionlookupDotless subtable" } [] -Lookup: 6 0 0 "ccmplookup03" {"ccmplookup03 contextual 0" "ccmplookup03 contextual 1" "ccmplookup03 contextual 2" } ['ccmp' ('cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ] -Lookup: 258 0 0 "kerning pairs" {"kp" } ['kern' ('latn' <'dflt' > ) ] -Lookup: 262 4 0 "mkmklookup1" {"mkmklookup1 subtable" } ['mkmk' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ] -Lookup: 260 4 0 "marklookup2" {"marklookup2 subtable" } ['mark' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ] -Lookup: 260 4 0 "marklookup1" {"marklookup1 subtable" } ['mark' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'grek' <'dflt' > 'latn' <'dflt' > ) ] -Lookup: 262 4 0 "mkmklookup2" {"mkmklookup2 subtable" } ['mkmk' ('DFLT' <'dflt' > 'cyrl' <'dflt' > 'latn' <'dflt' > ) ] +MarkAttachClasses: 1 DEI: 91125 -ChainSub2: coverage "ccmplookup03 contextual 2" 0 0 0 1 - 1 0 3 - Coverage: 19 i j uni0249 uni03F3 - FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353 - FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353 - FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486 - 1 - SeqLookup: 0 "SingleSubstitutionlookupDotless" -EndFPST -ChainSub2: coverage "ccmplookup03 contextual 1" 0 0 0 1 - 1 0 2 - Coverage: 19 i j uni0249 uni03F3 - FCoverage: 271 uni0316 uni0317 uni0318 uni0319 uni031C uni031D uni031E uni031F uni0320 uni0321 uni0322 uni0324 uni0325 uni0326 uni0327 uni0328 uni0329 uni032A uni032B uni032C uni032D uni032E uni032F uni0330 uni0331 uni0332 uni0333 uni0339 uni033A uni033B uni033C uni0345 uni0347 uni0353 - FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486 - 1 - SeqLookup: 0 "SingleSubstitutionlookupDotless" -EndFPST -ChainSub2: coverage "ccmplookup03 contextual 0" 0 0 0 1 - 1 0 1 - Coverage: 19 i j uni0249 uni03F3 - FCoverage: 307 gravecomb acutecomb uni0302 tildecomb uni0304 uni0305 uni0306 uni0307 uni0308 hookabovecomb uni030A uni030B uni030C uni030D uni030E uni030F uni0310 uni0311 uni0312 uni0313 uni0314 uni033D uni033E uni033F uni0340 uni0341 uni0342 uni0343 uni0344 uni0346 uni0351 uni0352 uni0357 uni0483 uni0484 uni0485 uni0486 - 1 - SeqLookup: 0 "SingleSubstitutionlookupDotless" -EndFPST -MacFeat: 0 0 0 -MacName: 0 0 24 "All Typographic Features" -MacName: 0 1 24 "Fonctions typographiques" -MacName: 0 2 33 "Alle typografischen M\232glichkeiten" -MacName: 0 3 21 "Funzioni Tipografiche" -MacName: 0 4 28 "Alle typografische kenmerken" -MacSetting: 0 -MacName: 0 0 17 "All Type Features" -MacName: 0 1 31 "Toutes fonctions typographiques" -MacName: 0 2 23 "Alle Auszeichnungsarten" -MacName: 0 3 17 "Tutte le Funzioni" -MacName: 0 4 18 "Alle typekenmerken" -MacFeat: 1 0 0 -MacName: 0 0 9 "Ligatures" -MacName: 0 1 9 "Ligatures" -MacName: 0 2 9 "Ligaturen" -MacName: 0 3 8 "Legature" -MacName: 0 4 9 "Ligaturen" -MacSetting: 2 -MacName: 0 0 16 "Common Ligatures" -MacName: 0 1 18 "Ligatures Usuelles" -MacName: 0 2 17 "Normale Ligaturen" -MacName: 0 3 19 "Legature pi\235 Comuni" -MacName: 0 4 28 "Gemeenschappelijke Ligaturen" -EndMacFeatures TtTable: prep -PUSHW_2 +PUSHW_1 511 - 0 -SCANTYPE SCANCTRL +PUSHB_1 + 1 +SCANTYPE +SVTCA[y-axis] +MPPEM +PUSHB_1 + 8 +LT +IF +PUSHB_2 + 1 + 1 +INSTCTRL +EIF +PUSHB_2 + 70 + 6 +CALL +IF +POP +PUSHB_1 + 16 +EIF +MPPEM +PUSHB_1 + 20 +GT +IF +POP +PUSHB_1 + 128 +EIF +SCVTCI +PUSHB_1 + 6 +CALL +NOT +IF +EIF +PUSHB_1 + 20 +CALL EndTTInstrs +TtTable: fpgm +PUSHB_1 + 0 +FDEF +PUSHB_1 + 0 +SZP0 +MPPEM +PUSHB_1 + 42 +LT +IF +PUSHB_1 + 74 +SROUND +EIF +PUSHB_1 + 0 +SWAP +MIAP[rnd] +RTG +PUSHB_1 + 6 +CALL +IF +RTDG +EIF +MPPEM +PUSHB_1 + 42 +LT +IF +RDTG +EIF +DUP +MDRP[rp0,rnd,grey] +PUSHB_1 + 1 +SZP0 +MDAP[no-rnd] +RTG +ENDF +PUSHB_1 + 1 +FDEF +DUP +MDRP[rp0,min,white] +PUSHB_1 + 12 +CALL +ENDF +PUSHB_1 + 2 +FDEF +MPPEM +GT +IF +RCVT +SWAP +EIF +POP +ENDF +PUSHB_1 + 3 +FDEF +ROUND[Black] +RTG +DUP +PUSHB_1 + 64 +LT +IF +POP +PUSHB_1 + 64 +EIF +ENDF +PUSHB_1 + 4 +FDEF +PUSHB_1 + 6 +CALL +IF +POP +SWAP +POP +ROFF +IF +MDRP[rp0,min,rnd,black] +ELSE +MDRP[min,rnd,black] +EIF +ELSE +MPPEM +GT +IF +IF +MIRP[rp0,min,rnd,black] +ELSE +MIRP[min,rnd,black] +EIF +ELSE +SWAP +POP +PUSHB_1 + 5 +CALL +IF +PUSHB_1 + 70 +SROUND +EIF +IF +MDRP[rp0,min,rnd,black] +ELSE +MDRP[min,rnd,black] +EIF +EIF +EIF +RTG +ENDF +PUSHB_1 + 5 +FDEF +GFV +NOT +AND +ENDF +PUSHB_1 + 6 +FDEF +PUSHB_2 + 34 + 1 +GETINFO +LT +IF +PUSHB_1 + 32 +GETINFO +NOT +NOT +ELSE +PUSHB_1 + 0 +EIF +ENDF +PUSHB_1 + 7 +FDEF +PUSHB_2 + 36 + 1 +GETINFO +LT +IF +PUSHB_1 + 64 +GETINFO +NOT +NOT +ELSE +PUSHB_1 + 0 +EIF +ENDF +PUSHB_1 + 8 +FDEF +SRP2 +SRP1 +DUP +IP +MDAP[rnd] +ENDF +PUSHB_1 + 9 +FDEF +DUP +RDTG +PUSHB_1 + 6 +CALL +IF +MDRP[rnd,grey] +ELSE +MDRP[min,rnd,black] +EIF +DUP +PUSHB_1 + 3 +CINDEX +MD[grid] +SWAP +DUP +PUSHB_1 + 4 +MINDEX +MD[orig] +PUSHB_1 + 0 +LT +IF +ROLL +NEG +ROLL +SUB +DUP +PUSHB_1 + 0 +LT +IF +SHPIX +ELSE +POP +POP +EIF +ELSE +ROLL +ROLL +SUB +DUP +PUSHB_1 + 0 +GT +IF +SHPIX +ELSE +POP +POP +EIF +EIF +RTG +ENDF +PUSHB_1 + 10 +FDEF +PUSHB_1 + 6 +CALL +IF +POP +SRP0 +ELSE +SRP0 +POP +EIF +ENDF +PUSHB_1 + 11 +FDEF +DUP +MDRP[rp0,white] +PUSHB_1 + 12 +CALL +ENDF +PUSHB_1 + 12 +FDEF +DUP +MDAP[rnd] +PUSHB_1 + 7 +CALL +NOT +IF +DUP +DUP +GC[orig] +SWAP +GC[cur] +SUB +ROUND[White] +DUP +IF +DUP +ABS +DIV +SHPIX +ELSE +POP +POP +EIF +ELSE +POP +EIF +ENDF +PUSHB_1 + 13 +FDEF +SRP2 +SRP1 +DUP +DUP +IP +MDAP[rnd] +DUP +ROLL +DUP +GC[orig] +ROLL +GC[cur] +SUB +SWAP +ROLL +DUP +ROLL +SWAP +MD[orig] +PUSHB_1 + 0 +LT +IF +SWAP +PUSHB_1 + 0 +GT +IF +PUSHB_1 + 64 +SHPIX +ELSE +POP +EIF +ELSE +SWAP +PUSHB_1 + 0 +LT +IF +PUSHB_1 + 64 +NEG +SHPIX +ELSE +POP +EIF +EIF +ENDF +PUSHB_1 + 14 +FDEF +PUSHB_1 + 6 +CALL +IF +RTDG +MDRP[rp0,rnd,white] +RTG +POP +POP +ELSE +DUP +MDRP[rp0,rnd,white] +ROLL +MPPEM +GT +IF +DUP +ROLL +SWAP +MD[grid] +DUP +PUSHB_1 + 0 +NEQ +IF +SHPIX +ELSE +POP +POP +EIF +ELSE +POP +POP +EIF +EIF +ENDF +PUSHB_1 + 15 +FDEF +SWAP +DUP +MDRP[rp0,rnd,white] +DUP +MDAP[rnd] +PUSHB_1 + 7 +CALL +NOT +IF +SWAP +DUP +IF +MPPEM +GTEQ +ELSE +POP +PUSHB_1 + 1 +EIF +IF +ROLL +PUSHB_1 + 4 +MINDEX +MD[grid] +SWAP +ROLL +SWAP +DUP +ROLL +MD[grid] +ROLL +SWAP +SUB +SHPIX +ELSE +POP +POP +POP +POP +EIF +ELSE +POP +POP +POP +POP +POP +EIF +ENDF +PUSHB_1 + 16 +FDEF +DUP +MDRP[rp0,min,white] +PUSHB_1 + 18 +CALL +ENDF +PUSHB_1 + 17 +FDEF +DUP +MDRP[rp0,white] +PUSHB_1 + 18 +CALL +ENDF +PUSHB_1 + 18 +FDEF +DUP +MDAP[rnd] +PUSHB_1 + 7 +CALL +NOT +IF +DUP +DUP +GC[orig] +SWAP +GC[cur] +SUB +ROUND[White] +ROLL +DUP +GC[orig] +SWAP +GC[cur] +SWAP +SUB +ROUND[White] +ADD +DUP +IF +DUP +ABS +DIV +SHPIX +ELSE +POP +POP +EIF +ELSE +POP +POP +EIF +ENDF +PUSHB_1 + 19 +FDEF +DUP +ROLL +DUP +ROLL +SDPVTL[orthog] +DUP +PUSHB_1 + 3 +CINDEX +MD[orig] +ABS +SWAP +ROLL +SPVTL[orthog] +PUSHB_1 + 32 +LT +IF +ALIGNRP +ELSE +MDRP[grey] +EIF +ENDF +PUSHB_1 + 20 +FDEF +PUSHB_4 + 0 + 64 + 1 + 64 +WS +WS +SVTCA[x-axis] +MPPEM +PUSHW_1 + 4096 +MUL +SVTCA[y-axis] +MPPEM +PUSHW_1 + 4096 +MUL +DUP +ROLL +DUP +ROLL +NEQ +IF +DUP +ROLL +DUP +ROLL +GT +IF +SWAP +DIV +DUP +PUSHB_1 + 0 +SWAP +WS +ELSE +DIV +DUP +PUSHB_1 + 1 +SWAP +WS +EIF +DUP +PUSHB_1 + 64 +GT +IF +PUSHB_3 + 0 + 32 + 0 +RS +MUL +WS +PUSHB_3 + 1 + 32 + 1 +RS +MUL +WS +PUSHB_1 + 32 +MUL +PUSHB_1 + 25 +NEG +JMPR +POP +EIF +ELSE +POP +POP +EIF +ENDF +PUSHB_1 + 21 +FDEF +PUSHB_1 + 1 +RS +MUL +SWAP +PUSHB_1 + 0 +RS +MUL +SWAP +ENDF +EndTTInstrs +ShortTable: cvt 6 + -220 + 0 + 520 + 730 + 33 + 633 +EndShort ShortTable: maxp 16 1 0 - 6439 - 216 - 18 - 0 - 0 + 7223 + 192 + 22 + 102 + 11 2 + 1 + 2 + 22 0 - 0 - 0 - 0 - 4 - 0 - 0 - 0 + 256 + 46 + 1 + 1 EndShort -LangName: 1033 "" "@WineTestVertical" "Regular" "FontForge 2.0 : M+- 1p regular : 2-11-2011" "" "" "" "" "" "" "" "http://mplus-fonts.sourceforge.jp" "" "" "" "" "M+- 1p" "regular" -GaspTable: 1 65535 2 +LangName: 1033 "" "" "" "FontForge 2.0 : WineTestVertical: 11-3-2013" "" "Version 1.055" "" "" "" "" "" "http://www.winehq.com" "" "" "" "" "WineTestVertical" "regular" +GaspTable: 1 65535 2 0 Encoding: UnicodeFull UnicodeInterp: none NameList: Adobe Glyph List -DisplaySize: -24 +DisplaySize: -36 AntiAlias: 1 FitToEm: 1 -AnchorClass2: "TopMark" "mkmklookup1 subtable" "Bottom" "marklookup2 subtable" "Top" "marklookup1 subtable" "BottomMark" "mkmklookup2 subtable" -BeginChars: 1114185 2 +WinInfo: 1114120 23 9 +BeginPrivate: 0 +EndPrivate +TeXData: 1 0 0 346030 173015 115343 0 1048576 115343 783286 444596 497025 792723 393216 433062 380633 303038 157286 324010 404750 52429 2506097 1059062 262144 +BeginChars: 1114326 14 + +StartChar: .notdef +Encoding: 1114112 -1 0 +Width: 364 +Flags: W +TtInstrs: +PUSHB_2 + 1 + 0 +MDAP[rnd] +ALIGNRP +PUSHB_3 + 7 + 4 + 4 +MIRP[min,rnd,black] +SHP[rp2] +PUSHB_2 + 6 + 5 +MDRP[rp0,min,rnd,grey] +ALIGNRP +PUSHB_3 + 3 + 2 + 4 +MIRP[min,rnd,black] +SHP[rp2] +SVTCA[y-axis] +PUSHB_2 + 3 + 0 +MDAP[rnd] +ALIGNRP +PUSHB_3 + 5 + 4 + 4 +MIRP[min,rnd,black] +SHP[rp2] +PUSHB_3 + 7 + 6 + 5 +MIRP[rp0,min,rnd,grey] +ALIGNRP +PUSHB_3 + 1 + 2 + 4 +MIRP[min,rnd,black] +SHP[rp2] +EndTTInstrs +LayerCount: 2 +Fore +SplineSet +33 0 m 1,0,-1 + 33 666 l 1,1,-1 + 298 666 l 1,2,-1 + 298 0 l 1,3,-1 + 33 0 l 1,0,-1 +66 33 m 1,4,-1 + 265 33 l 1,5,-1 + 265 633 l 1,6,-1 + 66 633 l 1,7,-1 + 66 33 l 1,4,-1 +EndSplineSet +EndChar + +StartChar: glyph1 +Encoding: 1114113 -1 1 +Width: 0 +Flags: W +LayerCount: 2 +EndChar + +StartChar: glyph2 +Encoding: 1114114 -1 2 +Width: 333 +Flags: W +LayerCount: 2 +EndChar + +StartChar: W +Encoding: 87 87 3 +Width: 500 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +415 0 m 1,0,-1 + 257 725 l 1,1,-1 + 85 0 l 1,2,-1 + 415 0 l 1,0,-1 +EndSplineSet +EndChar StartChar: twodotenleader -Encoding: 8229 8229 0 +Encoding: 8229 8229 4 Width: 1000 GlyphClass: 2 Flags: W @@ -175,8 +877,41 @@ EndSplineSet Substitution2: "j-vert" twodotenleader.vert EndChar -StartChar: twodotenleader.vert -Encoding: 1114131 -1 1 +StartChar: uni3042 +Encoding: 12354 12354 5 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +133 677 m 1,0,-1 + 133 613 l 1,1,-1 + 487 0 l 5,2,-1 + 867 613 l 1,3,-1 + 867 677 l 1,4,-1 + 133 677 l 1,0,-1 +EndSplineSet +EndChar + +StartChar: uni5EAD +Encoding: 24237 24237 6 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +21 -21 m 1,0,1 +876 741.3 m 1,2,-1 + 122 815.3 l 1,3,-1 + 122 683.3 l 1,4,-1 + 876 741.3 l 1,2,-1 +EndSplineSet +EndChar + +StartChar: uniFE30 +Encoding: 65072 65072 7 Width: 1000 GlyphClass: 2 Flags: W @@ -195,5 +930,112 @@ SplineSet 453 40 l 1,4,-1 EndSplineSet EndChar + +StartChar: uniFF37 +Encoding: 65335 65335 8 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +945 641 m 17,0,-1 + 519 797 l 5,1,-1 + 97 637 l 9,2,-1 + 527 0 l 25,3,-1 + 945 641 l 17,0,-1 +EndSplineSet +EndChar + +StartChar: uniFF5B +Encoding: 65371 65371 9 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +892 755 m 17,0,-1 + 428 392 l 1,1,-1 + 428 328 l 1,2,-1 + 892 -35 l 9,3,-1 + 892 755 l 17,0,-1 +EndSplineSet +Substitution2: "j-vert" uniFF5B.vert +EndChar + +StartChar: uniFF9D +Encoding: 65437 65437 10 +Width: 500 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +467 623 m 17,0,-1 + 397 637 l 1,1,-1 + 77 322.2 l 17,2,-1 + 100 -10 l 1,3,-1 + 467 623 l 17,0,-1 +EndSplineSet +EndChar + +StartChar: twodotenleader.vert +Encoding: 1114272 -1 11 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +453 40 m 1,0,-1 + 453 180 l 1,1,-1 + 547 180 l 1,2,-1 + 547 40 l 1,3,-1 + 453 40 l 1,0,-1 +453 540 m 1,4,-1 + 453 680 l 1,5,-1 + 547 680 l 1,6,-1 + 547 540 l 1,7,-1 + 453 540 l 1,4,-1 +EndSplineSet +EndChar + +StartChar: uni3041.vert +Encoding: 1114293 -1 12 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +522 557 m 1,0,-1 + 875 557 l 1,1,-1 + 875 617 l 1,2,-1 + 522 617 l 1,3,-1 + 522 715 l 1,4,-1 + 454 715 l 1,5,-1 + 454 617 l 1,6,-1 + 285 617 l 1,7,-1 + 285 557 l 1,8,-1 + 522 557 l 1,0,-1 +EndSplineSet +EndChar + +StartChar: uniFF5B.vert +Encoding: 1114321 -1 13 +Width: 1000 +GlyphClass: 2 +Flags: W +LayerCount: 2 +Fore +SplineSet +543 340 m 25,0,-1 + 29 -30 l 25,1,-1 + 971 -32 l 1,2,-1 + 521 112 l 1,3,-1 + 543 340 l 25,0,-1 +EndSplineSet +EndChar EndChars EndSplineFont diff --git a/rostests/winetests/gdi32/vertical.ttf b/rostests/winetests/gdi32/vertical.ttf index c48b3c1580732f4f512fc2724f9e8f7285ec0f1f..0fc077960479e2a4023ceea892344b7abf70dfef 100644 GIT binary patch literal 3560 zcmdT{ZERE58Ghe$W9K_KA8y&4bjMs$Qex-JWTjaE6Tlf^X`>Lp&a#w?W0F8(yN*d3 z23x0s)>&D_k5#SMI@lyMCMdc|JBdk1L)%cN2GnjHpj9wfrEOGI|CFx#v)FsiwF$7b zn#8}It8?G)^FHr6_nvz$F%ebamPh_Tps#yq!gidf^dhv?of|g=XbmkVDj9-Y*V*&b z)>3EP2e3m&J3F^->$tS=!QWt?f&9u-TN_(ezx?`1BK{rZ?cs4Fekt<)--$#Ybo;}T zNy*)|twi<_*h_ZDhsT$^(fBhW?H%|;hK-4MCPNxb1F#nik4^9X%i19W{y#wc#gT|H zls+}5#`+rUUmk&?pkMp~@*&8}N5+%S>JQ~#!&nmXs*BGAN|KP&>{R193xZaV0~$d)WNlN&;A`oo%;TA_ zXI{nX(|_wSr*GVN`!_!c@m2agouTpEm~g$fvE7;tOT}tt@67HUCzb!fnyTjiq?zO~ zsd9_CvL|SEO@>U;*DW>e^}#hEOLs6N|7db$!&0xw9{HYGQtvf|XG?EzlOA$=P0cg9 zRGR*tpxg9^yk?$9g}Qb3{@``jrH~7L!3EbxA(!qpZS_GjFd4E8p%BKic}fTRy{6qW zyNq8zcKO1ssc|%xqPD0YZiLsL6zjU7+;!N?Pgt?d5?CP)Duia zQifE_YM0v`a-}S(H!G=xMOkzXm&1)D#UA+wtDF*#Y&7%h2ZB;|>H%Yq49cNh*&&o) zsmhGhG9^1x0Ygv8ly0TdP3jGret4ojmDcn}lz^BrE7O`QOWkglypqB+AZRnNZOdT; zKDaIM=<-S~xh{iSwz}LVhk_{-v{_H-GPOCS8w!akN8J@3hgyaTEJL{}Krt2nQ2>DI z0o~ZM^WI8SXr%{5q`s@Bt!qe6<(sl6*zP(HOO@w!^0U9AgSVV@P?)T{a^42yGSwT@ zcLBZL;R0d312gaM4bG9I4dISCmJDLbu=#~ZwS^QTIz1+|m>1lzVbWR795(s;w8bpw z3C=RV7@7^JXT@~jL96No^IWI~3p)@DnN{^f8GJEBfq0MHVjAHqt!p)PQ9q5*b997` zlS#j(D}=8J-dyZCyiy#+9+6KCvrLWcbNP9BAGOTdZP(i8Gy#@oHKn#G^<2K)_OJFi zR(fB#yL^SOTz7NftvBBkM;CUx1-2ZfZMYp1m({-DE@nRVy>Vz&%-p!*S4__D@92C_vGwBi}LSr(JYgVg)A91aX zwb}IcbU&XF-}%w;h3AR+G`=DS#BF6SWG8C}(oOu1xSf8b)OFEif$NsGFJLPgK2JBfQ#PF^}&QvAfmXsylV3C}JahY~#;` zw|&>H_AJ(#%uQ{c`?6SUwc<+)Y3)pUE%&8g6i47vMV|suwmm{?b3Ee<@a-Hgu*%1C zyhinK&idz(gP+XtHY(+B=6E~wr*eETIr&zOcaTHK9A8fPVm&Z%ULjH|s9By#(l>Iv zpfWspS-nQvNv(_W&m+m69B-p9^3yrq4*mCXd@-%$b2;7teLBaNQ<-R{4HTm|O;dtK zX_!VRNp*M)A4BdIYNBTHf!hIFlp^4I;1{Dk;KT5w4YBxiVsv;USr>jxwlp>S@j?*#TCU;+W#K@*^(2siLLk#g^gOeD8Q63Nl90ZlJlhG`#+23)B(GQ4lh z024soC_)uYz(b*Fp$1@-)OHWX&r79znsIqik$15+3dEwxKrAsFku42PvdzMOFQ7Kr z-0byvRc#McPPXC+RIK1D2nup5E<(){qp_%LZfI(S_yBXIRx63sYokV7Q`Xghdv>)( z=ousnBk?%VNHQ63YiyjFnrfKBoR2)y5RO6p07(<~FHqvn0;%0fwaoLF-Op-ecv%E% z)W&&iV>{<_0T*%+7jp@h+Hr)Ak2GgVOIdO%HWW)nqGLEnM-ut_qNBd1RV|9PZd$)l z(ZD8OlSKo*$FsDxBTJvySb2YV!z7-rlI$4Gi$WmK+F=P95a$pJn$-#Ft&>NJidsy zYyFdwiayhm6@0a~a8eeg1^jC{AiM;kmRzf48Z5urwFf T{Pb<5erwu?GqL*rXngD6D?8b$ literal 2372 zcmds2T~8cU7=F%~-G%a1*n&06{S)eu4u%0f^+1f&hA3zKEo-F82wvjY~B zUR4t{H1;1D?|OxowTTJwq8Ex6{sL;?~f!_FB#N- z3W&(ed~ag8W$!K0cc@=X7c2+I&-?_)X39n~R@vF#hq7OxzB-fNT>Euz;vK-qlYcjB zTdRL3e*B%buakcxOF_g8F}_$Oe>Pk2uGindF4rTAXug!T5XGzXUm;&tu&z6(Lk;bT z2WHVK*k6tAUZegSzGF_Q?EUumqbTE3jSn2xcJ6)gF-hYRKUEuy7g{_){Kx9ZpWR@* z=!DoN-$y@Yiw%ljUd!}hEoiHiRDv!flwCupnXa29>dxC|z^~qs+>YPf}x7}#ti89m? z6z9*ioaQTcQct#1qJ4`4k~`2T&+xodYz*3n`>9k)wr*`bt)r11&Dg8dvK`5Q7HGn) zfR>E%bwC^F614#xLcMq|pu=boHv&3>Mq*R@4AkPZ^!FTSL|DcHc@wJSxH=7?W3;-! z*QW*Akqc;v27DRN2Ig=#phGw%&IfcDtztQ#BQV8QK-XeK>;!ZpYGg-1H=#kkiBXi` zU=uE5Wsrr3PNdPrGnqgi;(Sa@p_|_%W-yHf%#)rah8av^jQ$J2Xvx`hbD6ByneH+Z zeet--e8oa!7PbZ)BV-c;e0|7qre;!qbPZphK#xwYr;;X; zrJ|QCxf$C`#QMwul|tMxT|XlEL{B{4qmttdpbPS%)z#&2=*25r=U8Tr3a`nS3S&PX zlSLua|q`PEUXedc!=r4WO6L(FN9m3Y8hL zOnRM*rHMw#{ffnKg`UWIo-@$f>#x1WB9vq0(z=_r*HkfLS7>sWub&^D2Ufwu(;M7Q z`!`wI!;6b#FnHq%DGU)3;RqX+la2dRqQU#Hv|94)VxDcwc27LZ#x{5;{3QhMNU8sx z1`1AUq2h(UL)HDRFbKXi1iFQAdehCr%((Vd#IjZ~hrz2>(ZWRD@`_lZ7l&R`dA*oZ ztJgqGzCCTKen@LS-ce7PP8S?BXrS!R+QP>n5#b-K5D7GsR{!`(Zp{+_rGx~Ujd{p zd%c&C#TmeUOWc0#=Gk*I^ACRl5)j|d75$P-HLVb@G6r*x%V~JlA;9P+Zx;NqQWU{p z{S0xUF!E%$9;~d9zfL`ZAwNGjyZDXVCgVcDM8mwi11geXA`=wL@;`9T*IP~$?t9H)j0F^9_j+LYHa+C)0D^2WUb z-G9)UU;=n{;zRY{?rqnU`@?aWNI>Z{KNdOeb}c+DZQ_IjlCRjqGPg@;K9;8;Y7?Hu zYEiHB`CBGr5*zxs7pd3%pDXtH|Pw;FaCclt#p%ys3{nN9ymr_()d$g7e*6!oB#j- delta 478 zcmX|7-z!657=FIUhpsIrV(+`#jJ4yyxqCuKV&8{e>iez-T-%f(Uv5PmDY~J=fQN zTruwep_8wq4b2qsniTmXF`nMe1rb*p0lAC5vaW5JwhftihkMsIcGeCb&Tr@sl9%*V zEwglXIm^CG4CoZRukt5Q5FrX7-N@x@_e39;-;y_PWYZdwC~-lQ+-GQc6B9_#A0rQL zYR2l-(@~iI8z42A*{z)ILj_QO=|>@W5+B|Dh2@5!Z?t&B9iPBOz`X%DBfDJy3cBcdSOtI9 zfpb0>s?~n6QxI0KG-(y31)@bL)&aX=xn3l#8F}&gM?R4vDg#bf!Ku@6f#fdtk+q`D LWde#-^2GiCB4}Ik diff --git a/rostests/winetests/gdi32/wine_vdmx.sfd b/rostests/winetests/gdi32/wine_vdmx.sfd new file mode 100644 index 00000000000..d1ccad65455 --- /dev/null +++ b/rostests/winetests/gdi32/wine_vdmx.sfd @@ -0,0 +1,271 @@ +SplineFontDB: 3.0 +FontName: wine_vdmx +FullName: wine_vdmx +FamilyName: wine_vdmx +Weight: Medium +Copyright: Copyright (c) 2010 Dmitry Timoshkov +Version: 001.000 +ItalicAngle: 0 +UnderlinePosition: -170 +UnderlineWidth: 130 +Ascent: 1638 +Descent: 410 +sfntRevision: 0x00010000 +LayerCount: 2 +Layer: 0 1 "Back" 1 +Layer: 1 1 "Fore" 0 +XUID: [1021 905 592216984 1247726] +FSType: 0 +OS2Version: 2 +OS2_WeightWidthSlopeOnly: 0 +OS2_UseTypoMetrics: 1 +PfmFamily: 33 +TTFWeight: 400 +TTFWidth: 5 +LineGap: 0 +VLineGap: 0 +Panose: 2 11 6 4 3 5 4 4 2 4 +OS2TypoAscent: 1566 +OS2TypoAOffset: 0 +OS2TypoDescent: -423 +OS2TypoDOffset: 0 +OS2TypoLinegap: 59 +OS2WinAscent: 2049 +OS2WinAOffset: 0 +OS2WinDescent: 423 +OS2WinDOffset: 0 +HheadAscent: 2049 +HheadAOffset: 0 +HheadDescent: -423 +HheadDOffset: 0 +OS2SubXSize: 1331 +OS2SubYSize: 1433 +OS2SubXOff: 0 +OS2SubYOff: 2861 +OS2SupXSize: 1331 +OS2SupYSize: 1433 +OS2SupXOff: 0 +OS2SupYOff: 983 +OS2StrikeYSize: 102 +OS2StrikeYPos: 530 +OS2Vendor: 'Wine' +OS2CodePages: 00000001.00000000 +OS2UnicodeRanges: 00000001.00000000.00000000.00000000 +MarkAttachClasses: 1 +DEI: 91125 +ShortTable: cvt 2 + 68 + 1297 +EndShort +ShortTable: maxp 16 + 1 + 0 + 4 + 8 + 2 + 0 + 0 + 2 + 0 + 1 + 1 + 0 + 64 + 46 + 0 + 0 +EndShort +TtfTable: VDMX 1504 +!!!!"!!*'#!s82j- +!"f2.!"],Bs82j/!##>0!"o8Fs82j1!#>P3!#,DKs82j3!#P\5!#>PNs82j5!#Yb5!#P\Ss7u^5 +!#kn6!#bhVs7u^7!$2+9!#tt[s7u^9!$;1:!$2+_s7u^;!$VC=!$D7bs7lX +!%%[@!$hOks7lX@!%7gA!%%[os7cRA!%@mB!%7gss7ZLB!%\*D!%It"s7ZLD!%n6F!%\+&s7QFE +!&"!/^c:s5O*;!0I6@!/po?s5O*=!0dHB!0.&Cs5F$>!0mNC!0@2Gs5F$@ +!1!TD!0R>Ks5F$B!1ElG!0dJOs5s4RI^!5/?c!4W$Ds4RI` +!5JQf!4i0Gs4RIb!5\]g!5&o!5nl\s4@=j!6kJp!6,#_s477k!7(Vq!6>/es4.1l!7:bs!6P;hs4.1n!7Lnu!6bGls4.1p +!7_&"!6tSqs4.1r!8%8$!71_ts4%+s!8.>%!7Cl#s4%+u!8@J'!7V#'s3q&!!8[\)!7h/,s3q&# +!8db)!8%;0s3gu$!9*t,!87G3s3gu&!94%,!8IS7s3^o'!9O7/!8[_!:g-ds3:W9!;ulB!;$9hs3:W; +!<)rC!;6Els31Q%&7nq}JB zZM}8fYBkhN$nNc?*~L&y(Gw zUI+l)Pz?i0($X?B*kVtYwLJDtcci8v0pV=VXFGEAn3%X_i>A9dq>}Bsvm6=YE1G9! zv3&|K9dNpHO2quGjeun<`zAUo%B^si0s!BE9B<6eDJzkZpM);6+4jjVteSGr-pK5m ztbc4lUQX`B`86APuAO^A0XzH}v~-?}XFI&WU0&&L(wuBJu^m!a?99O`5yI>3Yu|jAk;LtD8YCIS6)8>e|SgJ;HCPJVKF8WA5m5=O%FMO#V{HQ;jq#Eh>#ayLnMt*M&f#T0oP#wy&ePU07TJ&h?eIO zrHqE1IR>%RjyM{NK{O8WbPy6~JUxd$BatRxFilhr#!z_{Ly$yoz>RdMG6}<&Z^TV> z7?R}=xCz7M8UANd=y2r-IG9tAMjc3}sme6m%$$yq^k&>DPvaKcCQo4`GU%MbevdnpW01w1iE(tSG7A&rNsPlpIv$f`8z$gRIuUo#NtjIU zq$h9}vgu^pL$j54!^xb3TzMS#D4m$XoQrN#_}Tak}@X#onUOL;Hc%u`V$zeAzY zjr*93P)dtYMoVZ5?n5~(MFlOxbXtxoIt};BW2jJ0#|-95%%oL#kls&^Vg??f58z=s z6OYgbF^fKg+42agl@DVM^CNha&cfq#HvJZJFpoZpC+J+|V_3laIG&V;F;Dpf7BbJr zQ*;5Ik%#c4@~?Q7c_E&oPbr_qBIakXL>|Pm%IC0@`EOW87vXt%0E_VgU4j?sQoKx; zDWAtH%rD?o`3+uFzJ%A9U&ib76)dNJr~C0L-k`6chQ6-+2UapK$11rGE3lfrfj4Ol z*2ukBsa%Cx=GAzM{u68Io60qKhq)H-$~~x4zJ>Rh*Wv^Ew(=c(D0kysd_>>F$Mk*W z2Uy4aA=b-ge5CvrHZcDipUEbCjL+#hd_mV^BmD$l(haDmpJEgJ44dUHe6IWgTjWk` z#8&#HvL4%*H=&Vk#&+6(9drwJ(yy>fevPflZD?X{L^Iuv-E;@`$Q}3^`{+*Wr@QEO zG~obk#zDGUxd(@2BlhAj-G?J|KaSFGaEu;63q7bjgjVLmI4-y0Tb!Ur&_<8qBt1sA zq6MeucQ{R3afTjOp1@h=Hk_AV;UwLH?{R^i!bN&oc?Or5e?U7ut2~De=JV*34Y&YF zFAB)b_)!RYNoe#ZVW928NIQg?b}FT?FtaFm_uk%`kjWmsI`n2O8qA}gs$?49vBUXR zTEU8pU$Q(TH^}vJ@_*D52=gxmM(DLn-+#U7_t!u7_cm5Cmb*V><8=QYn_A1TvUvWI z`OdB8H^Dlq<(kIw`7Ma96^Kcyvl!79S8F!yO{z0!jHor}-6p-e&SDnrNp<`h+u{ZV zga-5v4G48;*3NLTxU;}C_R>m+v4N8pVvey@%i+pH|Ly}ViNRq8vB_{t{p<2o;Mr#yMD==jU02{n@zBap5AOm50TDVT+9ko#meJi{VHJ9 zu_6*qt{<#i4cNIZuroQ}=J|4ts$wgX*{xSEj-Se71&~r)QdR28FDSQ0IxvGm`b!CfhAx-`F cyRsF+S?KQ=eZ_3%Zd5J(8qa=NHvfD387?}>+5i9m literal 0 HcmV?d00001 From 6937da105c08a46562d7d0bab50df3ed6a2ebdf3 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 13:10:24 +0000 Subject: [PATCH 408/419] [MSVCRT_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62836 --- rostests/winetests/msvcrt/CMakeLists.txt | 11 +- rostests/winetests/msvcrt/cpp.c | 81 ++- rostests/winetests/msvcrt/data.c | 120 +++- rostests/winetests/msvcrt/dir.c | 45 +- rostests/winetests/msvcrt/file.c | 650 +++++++++++++++++++++- rostests/winetests/msvcrt/heap.c | 2 +- rostests/winetests/msvcrt/locale.c | 55 +- rostests/winetests/msvcrt/misc.c | 46 ++ rostests/winetests/msvcrt/msvcrt_test.dsp | 107 ---- rostests/winetests/msvcrt/printf.c | 171 +++++- rostests/winetests/msvcrt/scanf.c | 7 + rostests/winetests/msvcrt/signal.c | 32 ++ rostests/winetests/msvcrt/string.c | 341 +++++++++++- rostests/winetests/msvcrt/testlist.c | 5 +- rostests/winetests/msvcrt/time.c | 76 ++- 15 files changed, 1554 insertions(+), 195 deletions(-) delete mode 100644 rostests/winetests/msvcrt/msvcrt_test.dsp diff --git a/rostests/winetests/msvcrt/CMakeLists.txt b/rostests/winetests/msvcrt/CMakeLists.txt index 875f4859532..5e0d8480412 100644 --- a/rostests/winetests/msvcrt/CMakeLists.txt +++ b/rostests/winetests/msvcrt/CMakeLists.txt @@ -1,8 +1,5 @@ -add_definitions( - -D__ROS_LONG64__ - -D_CRT_NONSTDC_NO_DEPRECATE - -D__msvcrt_ulong=ULONG) +add_definitions(-D__msvcrt_ulong=ULONG) list(APPEND SOURCE cpp.c @@ -23,12 +20,14 @@ list(APPEND SOURCE add_executable(msvcrt_winetest ${SOURCE}) +set_module_type(msvcrt_winetest win32cui) +add_importlibs(msvcrt_winetest msvcrt kernel32) + if(MSVC) target_link_libraries(msvcrt_winetest oldnames) + add_importlibs(msvcrt_winetest ntdll) else() add_target_compile_flags(msvcrt_winetest "-Wno-format") endif() -set_module_type(msvcrt_winetest win32cui) -add_importlibs(msvcrt_winetest msvcrt kernel32 ntdll) add_cd_file(TARGET msvcrt_winetest DESTINATION reactos/bin FOR all) diff --git a/rostests/winetests/msvcrt/cpp.c b/rostests/winetests/msvcrt/cpp.c index 8baf9b66d0e..c331db1bc4a 100644 --- a/rostests/winetests/msvcrt/cpp.c +++ b/rostests/winetests/msvcrt/cpp.c @@ -238,6 +238,55 @@ static BOOL InitFunctionPtrs(void) } else { +#ifdef __arm__ + SETNOFAIL(poperator_new, "??_U@YAPAXI@Z"); + SETNOFAIL(poperator_delete, "??_V@YAXPAX@Z"); + + SET(pexception_ctor, "??0exception@std@@QAA@ABQBD@Z"); + SET(pexception_copy_ctor, "??0exception@std@@QAA@ABV01@@Z"); + SET(pexception_default_ctor, "??0exception@std@@QAA@XZ"); + SET(pexception_dtor, "??1exception@std@@UAA@XZ"); + SET(pexception_opequals, "??4exception@std@@QAAAAV01@ABV01@@Z"); + SET(pexception_what, "?what@exception@std@@UBAPBDXZ"); + SET(pexception_vector_dtor, "??_Eexception@@UAEPAXI@Z");/**/ + SET(pexception_scalar_dtor, "??_Gexception@@UAEPAXI@Z");/**/ + + SET(pbad_typeid_ctor, "??0bad_typeid@std@@QAA@PBD@Z"); + SETNOFAIL(pbad_typeid_ctor_closure, "??_Fbad_typeid@std@@QAAXXZ"); + SET(pbad_typeid_copy_ctor, "??0bad_typeid@std@@QAA@ABV01@@Z"); + SET(pbad_typeid_dtor, "??1bad_typeid@std@@UAA@XZ"); + SET(pbad_typeid_opequals, "??4bad_typeid@std@@QAAAAV01@ABV01@@Z"); + SET(pbad_typeid_what, "?what@exception@std@@UBAPBDXZ"); + SET(pbad_typeid_vector_dtor, "??_Ebad_cast@@UAEPAXI@Z"); + SET(pbad_typeid_scalar_dtor, "??_Gbad_cast@@UAEPAXI@Z"); + + SETNOFAIL(pbad_cast_ctor, "??0bad_cast@@QAE@ABQBD@Z"); + if (!pbad_cast_ctor) + SET(pbad_cast_ctor, "??0bad_cast@std@@AAA@PBQBD@Z"); + SETNOFAIL(pbad_cast_ctor2, "??0bad_cast@std@@QAA@PBD@Z"); + SETNOFAIL(pbad_cast_ctor_closure, "??_Fbad_cast@std@@QAAXXZ"); + /* FIXME: No ARM equivalent for "??0bad_cast@@QAE@ABV0@@Z" */ + SET(pbad_cast_dtor, "??1bad_cast@std@@UAA@XZ"); + SET(pbad_cast_opequals, "??4bad_cast@std@@QAAAAV01@ABV01@@Z"); + SET(pbad_cast_what, "?what@exception@std@@UBAPBDXZ"); + SET(pbad_cast_vector_dtor, "??_Ebad_cast@@UAEPAXI@Z"); + SET(pbad_cast_scalar_dtor, "??_Gbad_cast@@UAEPAXI@Z"); + + SET(p__non_rtti_object_ctor, "??0__non_rtti_object@std@@QAA@PBD@Z"); + SET(p__non_rtti_object_copy_ctor, "??0__non_rtti_object@std@@QAA@ABV01@@Z"); + SET(p__non_rtti_object_dtor, "??1__non_rtti_object@std@@UAA@XZ"); + SET(p__non_rtti_object_opequals, "??4__non_rtti_object@std@@QAAAAV01@ABV01@@Z"); + SET(p__non_rtti_object_what, "?what@exception@std@@UBAPBDXZ"); + SET(p__non_rtti_object_vector_dtor, "??_E__non_rtti_object@@UAEPAXI@Z"); + SET(p__non_rtti_object_scalar_dtor, "??_G__non_rtti_object@@UAEPAXI@Z"); + + SET(ptype_info_dtor, "??1type_info@@UAA@XZ"); + SET(ptype_info_raw_name, "?raw_name@type_info@@QBAPBDXZ"); + SET(ptype_info_name, "?name@type_info@@QBEPBDXZ"); + SET(ptype_info_before, "?before@type_info@@QBA_NABV1@@Z"); + SET(ptype_info_opequals_equals, "??8type_info@@QBA_NABV0@@Z"); + SET(ptype_info_opnot_equals, "??9type_info@@QBA_NABV0@@Z"); +#else SETNOFAIL(poperator_new, "??_U@YAPAXI@Z"); SETNOFAIL(poperator_delete, "??_V@YAXPAX@Z"); @@ -285,6 +334,7 @@ static BOOL InitFunctionPtrs(void) SET(ptype_info_before, "?before@type_info@@QBEHABV1@@Z"); SET(ptype_info_opequals_equals, "??8type_info@@QBEHABV0@@Z"); SET(ptype_info_opnot_equals, "??9type_info@@QBEHABV0@@Z"); +#endif /* __arm__ */ } if (!poperator_new) @@ -901,6 +951,12 @@ static void test_rtti(void) { {RTTI_REF(child_class_rtti, base_descriptor[0]), RTTI_REF(child_class_rtti, base_descriptor[1])} }, {0, 0, 2, RTTI_REF(child_class_rtti, base_array)}, {1, 0, 0, RTTI_REF(child_class_rtti, type_info[1]), RTTI_REF(child_class_rtti, object_hierarchy), RTTI_REF(child_class_rtti, object_locator)} + }, virtual_base_class_rtti = { + { {NULL, NULL, "simple_class"}, {NULL, NULL, "child_class"} }, + { {RTTI_REF(virtual_base_class_rtti, type_info[1]), 0, {0x10, sizeof(void*), sizeof(int)}, 0}, {RTTI_REF(virtual_base_class_rtti, type_info[0]), 0, {8, -1, 0}, 0} }, + { {RTTI_REF(virtual_base_class_rtti, base_descriptor[0]), RTTI_REF(virtual_base_class_rtti, base_descriptor[1])} }, + {0, 0, 2, RTTI_REF(virtual_base_class_rtti, base_array)}, + {1, 0, 0, RTTI_REF(virtual_base_class_rtti, type_info[1]), RTTI_REF(virtual_base_class_rtti, object_hierarchy), RTTI_REF(virtual_base_class_rtti, object_locator)} }; static struct rtti_data simple_class_sig0_rtti, child_class_sig0_rtti; @@ -912,6 +968,9 @@ static void test_rtti(void) void *simple_class_sig0 = &simple_class_sig0_vtbl[1]; void *child_class_sig0_vtbl[2] = {&child_class_sig0_rtti.object_locator}; void *child_class_sig0 = &child_class_sig0_vtbl[1]; + void *virtual_base_class_vtbl[2] = {&virtual_base_class_rtti.object_locator}; + int virtual_base_class_vbtbl[2] = {0, 0x100}; + void *virtual_base_class[2] = {&virtual_base_class_vtbl[1], virtual_base_class_vbtbl}; static const char* e_name = "name"; type_info *ti,*bti; @@ -958,7 +1017,7 @@ static void test_rtti(void) call_func1(pexception_dtor, &e); call_func1(pbad_typeid_dtor, &b); - memcpy(&simple_class_sig0_rtti, &simple_class_rtti, sizeof(struct rtti_data)); + simple_class_sig0_rtti = simple_class_rtti; simple_class_sig0_rtti.object_locator.signature = 0; simple_class_sig0_rtti.base_descriptor[0].type_descriptor = RTTI_REF_SIG0(simple_class_sig0_rtti, type_info[0], base); simple_class_sig0_rtti.base_array.bases[0] = RTTI_REF_SIG0(simple_class_sig0_rtti, base_descriptor[0], base); @@ -966,7 +1025,7 @@ static void test_rtti(void) simple_class_sig0_rtti.object_locator.type_descriptor = RTTI_REF_SIG0(simple_class_sig0_rtti, type_info[0], base); simple_class_sig0_rtti.object_locator.type_hierarchy = RTTI_REF_SIG0(simple_class_sig0_rtti, object_hierarchy, base); - memcpy(&child_class_sig0_rtti, &child_class_rtti, sizeof(struct rtti_data)); + child_class_sig0_rtti = child_class_rtti; child_class_sig0_rtti.object_locator.signature = 0; child_class_sig0_rtti.base_descriptor[0].type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[1], base); child_class_sig0_rtti.base_descriptor[1].type_descriptor = RTTI_REF_SIG0(child_class_sig0_rtti, type_info[0], base); @@ -1026,6 +1085,9 @@ static void test_rtti(void) casted = p__RTDynamicCast(&child_class, 0, &child_class_rtti.type_info[0], &child_class_rtti.type_info[1], 0); ok(casted == (char*)&child_class+4, "failed cast to child class (%p %p)\n", casted, &child_class); + + casted = p__RTDynamicCast(&virtual_base_class, 0, &virtual_base_class_rtti.type_info[0], &virtual_base_class_rtti.type_info[1], 0); + ok(casted == (char*)&virtual_base_class+0x110+sizeof(void*), "failed cast to child class (%p %p)\n", casted, &virtual_base_class); } struct _demangle { @@ -1247,7 +1309,20 @@ static void test_demangle(void) /* 122 */ {"?_R2@?BN@???$_Fabs@N@std@@YANAEBV?$complex@N@1@PEAH@Z@4NB", "double const `double __cdecl std::_Fabs(class std::complex const & __ptr64,int * __ptr64)'::`29'::_R2", "?_R2@?BN@???$_Fabs@N@std@@YANAEBV?$complex@N@1@PEAH@Z@4NB"}, - +/* 123 */ {"?vtordisp_thunk@std@@$4PPPPPPPM@3EAA_NXZ", + "[thunk]:public: virtual bool __cdecl std::vtordisp_thunk`vtordisp{4294967292,4}' (void) __ptr64", + "[thunk]:public: virtual bool __cdecl std::vtordisp_thunk`vtordisp{-4,4}' (void) __ptr64"}, +/* 124 */ {"??_9CView@@$BBII@AE", + "[thunk]: __thiscall CView::`vcall'{392,{flat}}' }'", + "[thunk]: __thiscall CView::`vcall'{392,{flat}}' "}, +/* 125 */ {"?_dispatch@_impl_Engine@SalomeApp@@$R4CE@BA@PPPPPPPM@7AE_NAAVomniCallHandle@@@Z", + "[thunk]:public: virtual bool __thiscall SalomeApp::_impl_Engine::_dispatch`vtordispex{36,16,4294967292,8}' (class omniCallHandle &)", + "?_dispatch@_impl_Engine@SalomeApp@@$R4CE@BA@PPPPPPPM@7AE_NAAVomniCallHandle@@@Z"}, +/* 126 */ {"?_Doraise@bad_cast@std@@MEBAXXZ", "protected: virtual void __cdecl std::bad_cast::_Doraise(void)", NULL, 0x60}, +/* 127 */ {"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", "class std::complex & ptr64 cdecl std::operator*=(class std::complex & ptr64,class std::complex const & ptr64)", NULL, 1}, +/* 128 */ {"??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", + "class std::complex & std::operator*=(class std::complex &,class std::complex const &)", + "??Xstd@@YAAEAV?$complex@M@0@AEAV10@AEBV10@@Z", 2}, }; int i, num_test = (sizeof(test)/sizeof(test[0])); char* name; diff --git a/rostests/winetests/msvcrt/data.c b/rostests/winetests/msvcrt/data.c index c20be18df3e..efd7d1af1cf 100644 --- a/rostests/winetests/msvcrt/data.c +++ b/rostests/winetests/msvcrt/data.c @@ -30,6 +30,11 @@ #include #include #include +#include + +void __cdecl __getmainargs(int *, char ***, char ***, int, int *); +static int* (__cdecl *p___p___argc)(void); +static char*** (__cdecl *p___p___argv)(void); typedef void (__cdecl *_INITTERMFUN)(void); static void (__cdecl *p_initterm)(_INITTERMFUN *start, _INITTERMFUN *end); @@ -71,7 +76,7 @@ static void test_initterm(void) static void test_initvar( HMODULE hmsvcrt ) { - OSVERSIONINFO osvi = { sizeof(OSVERSIONINFO) }; + OSVERSIONINFOA osvi = { sizeof(OSVERSIONINFOA) }; int *pp_winver = (int*)GetProcAddress(hmsvcrt, "_winver"); int *pp_winmajor = (int*)GetProcAddress(hmsvcrt, "_winmajor"); int *pp_winminor = (int*)GetProcAddress(hmsvcrt, "_winminor"); @@ -86,7 +91,7 @@ static void test_initvar( HMODULE hmsvcrt ) winver = *pp_winver; winminor = *pp_winminor; winmajor = *pp_winmajor; - GetVersionEx( &osvi); + GetVersionExA( &osvi); ok( winminor == osvi.dwMinorVersion, "Wrong value for _winminor %02x expected %02x\n", winminor, osvi.dwMinorVersion); ok( winmajor == osvi.dwMajorVersion, "Wrong value for _winmajor %02x expected %02x\n", @@ -124,9 +129,110 @@ static void test_get_pgmptr(void) ok( pgm != NULL, "_get_pgmptr returned a NULL pointer\n" ); } +static void test___getmainargs(void) +{ + int argc, new_argc, mode; + char **argv, **new_argv, **envp; + char tmppath[MAX_PATH], filepath[MAX_PATH]; + FILE *f; + + ok(GetTempPathA(MAX_PATH, tmppath) != 0, "GetTempPath failed\n"); + + mode = 0; + __getmainargs(&argc, &argv, &envp, 0, &mode); + ok(argc == 4, "argc = %d\n", argc); + ok(!strcmp(argv[1], "data"), "argv[1] = %s\n", argv[1]); + sprintf(filepath, "%s*\\*", tmppath); + ok(!strcmp(argv[2], filepath), "argv[2] = %s\n", argv[2]); + sprintf(filepath, "%swine_test/*", tmppath); + ok(!strcmp(argv[3], filepath), "argv[3] = %s\n", argv[3]); + ok(!argv[4], "argv[4] != NULL\n"); + + if(p___p___argc && p___p___argv) { + new_argc = *p___p___argc(); + new_argv = *p___p___argv(); + ok(new_argc == 4, "*__p___argc() = %d\n", new_argc); + ok(new_argv == argv, "*__p___argv() = %p, epxected %p\n", new_argv, argv); + }else { + win_skip("__p___argc or __p___argv is not available\n"); + } + + mode = 0; + __getmainargs(&argc, &argv, &envp, 1, &mode); + ok(argc == 5, "argc = %d\n", argc); + ok(!strcmp(argv[1], "data"), "argv[1] = %s\n", argv[1]); + sprintf(filepath, "%s*\\*", tmppath); + ok(!strcmp(argv[2], filepath), "argv[2] = %s\n", argv[2]); + sprintf(filepath, "%swine_test/a", tmppath); + if(argv[3][strlen(argv[3])-1] == 'a') { + ok(!strcmp(argv[3], filepath), "argv[3] = %s\n", argv[3]); + sprintf(filepath, "%swine_test/test", tmppath); + ok(!strcmp(argv[4], filepath), "argv[4] = %s\n", argv[4]); + }else { + ok(!strcmp(argv[4], filepath), "argv[4] = %s\n", argv[4]); + sprintf(filepath, "%swine_test/test", tmppath); + ok(!strcmp(argv[3], filepath), "argv[3] = %s\n", argv[3]); + } + ok(!argv[5], "argv[5] != NULL\n"); + + if(p___p___argc && p___p___argv) { + new_argc = *p___p___argc(); + new_argv = *p___p___argv(); + ok(new_argc == argc, "*__p___argc() = %d, expected %d\n", new_argc, argc); + ok(new_argv == argv, "*__p___argv() = %p, epxected %p\n", new_argv, argv); + } + + sprintf(filepath, "%swine_test/b", tmppath); + f = fopen(filepath, "w"); + ok(f != NULL, "fopen(%s) failed: %d\n", filepath, errno); + fclose(f); + mode = 0; + __getmainargs(&new_argc, &new_argv, &envp, 1, &mode); + ok(new_argc == argc+1, "new_argc = %d, expected %d\n", new_argc, argc+1); + _unlink(filepath); +} + +static void test___getmainargs_parent(char *name) +{ + char cmdline[3*MAX_PATH]; + char tmppath[MAX_PATH], filepath[MAX_PATH]; + STARTUPINFOA startup; + PROCESS_INFORMATION proc; + FILE *f; + int ret; + + ok(GetTempPathA(MAX_PATH, tmppath) != 0, "GetTempPath failed\n"); + sprintf(cmdline, "%s data %s*\\* %swine_test/*", name, tmppath, tmppath); + + sprintf(filepath, "%swine_test", tmppath); + ret = _mkdir(filepath); + ok(!ret, "_mkdir failed: %d\n", errno); + sprintf(filepath, "%swine_test\\a", tmppath); + f = fopen(filepath, "w"); + ok(f != NULL, "fopen(%s) failed: %d\n", filepath, errno); + fclose(f); + sprintf(filepath, "%swine_test\\test", tmppath); + f = fopen(filepath, "w"); + ok(f != NULL, "fopen(%s) failed: %d\n", filepath, errno); + fclose(f); + + memset(&startup, 0, sizeof(startup)); + startup.cb = sizeof(startup); + CreateProcessA(NULL, cmdline, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE|NORMAL_PRIORITY_CLASS, NULL, NULL, &startup, &proc); + winetest_wait_child_process(proc.hProcess); + + _unlink(filepath); + sprintf(filepath, "%swine_test\\a", tmppath); + _unlink(filepath); + sprintf(filepath, "%swine_test", tmppath); + _rmdir(filepath); +} + START_TEST(data) { HMODULE hmsvcrt; + int arg_c; + char** arg_v; hmsvcrt = GetModuleHandleA("msvcrt.dll"); if (!hmsvcrt) @@ -135,8 +241,18 @@ START_TEST(data) { p_initterm=(void*)GetProcAddress(hmsvcrt, "_initterm"); p_get_pgmptr=(void*)GetProcAddress(hmsvcrt, "_get_pgmptr"); + p___p___argc=(void*)GetProcAddress(hmsvcrt, "__p___argc"); + p___p___argv=(void*)GetProcAddress(hmsvcrt, "__p___argv"); } + + arg_c = winetest_get_mainargs(&arg_v); + if(arg_c >= 3) { + test___getmainargs(); + return; + } + test_initterm(); test_initvar(hmsvcrt); test_get_pgmptr(); + test___getmainargs_parent(arg_v[0]); } diff --git a/rostests/winetests/msvcrt/dir.c b/rostests/winetests/msvcrt/dir.c index 83c533b5e52..aa273ea85e0 100644 --- a/rostests/winetests/msvcrt/dir.c +++ b/rostests/winetests/msvcrt/dir.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -345,28 +346,28 @@ static void test_fullpath(void) BOOL rc,free1,free2; free1=free2=TRUE; - GetCurrentDirectory(MAX_PATH, prevpath); - GetTempPath(MAX_PATH,tmppath); + GetCurrentDirectoryA(MAX_PATH, prevpath); + GetTempPathA(MAX_PATH,tmppath); strcpy(level1,tmppath); strcat(level1,"msvcrt-test\\"); - rc = CreateDirectory(level1,NULL); + rc = CreateDirectoryA(level1,NULL); if (!rc && GetLastError()==ERROR_ALREADY_EXISTS) free1=FALSE; strcpy(level2,level1); strcat(level2,"nextlevel\\"); - rc = CreateDirectory(level2,NULL); + rc = CreateDirectoryA(level2,NULL); if (!rc && GetLastError()==ERROR_ALREADY_EXISTS) free2=FALSE; - SetCurrentDirectory(level2); + SetCurrentDirectoryA(level2); ok(_fullpath(full,"test", MAX_PATH)!=NULL,"_fullpath failed\n"); strcpy(teststring,level2); strcat(teststring,"test"); ok(strcmp(full,teststring)==0,"Invalid Path returned %s\n",full); ok(_fullpath(full,"\\test", MAX_PATH)!=NULL,"_fullpath failed\n"); - strncpy(teststring,level2,3); + memcpy(teststring,level2,3); teststring[3]=0; strcat(teststring,"test"); ok(strcmp(full,teststring)==0,"Invalid Path returned %s\n",full); @@ -383,11 +384,36 @@ static void test_fullpath(void) ok(strcmp(freeme,teststring)==0,"Invalid Path returned %s\n",freeme); free(freeme); - SetCurrentDirectory(prevpath); + SetCurrentDirectoryA(prevpath); if (free2) - RemoveDirectory(level2); + RemoveDirectoryA(level2); if (free1) - RemoveDirectory(level1); + RemoveDirectoryA(level1); +} + +static void test_splitpath(void) +{ + const char* path = "c:\\\x83\x5c\x83\x74\x83\x67.bin"; + char drive[3], dir[MAX_PATH], fname[MAX_PATH], ext[MAX_PATH]; + int prev_cp = _getmbcp(); + + /* SBCS codepage */ + _setmbcp(1252); + _splitpath(path, drive, dir, fname, ext); + ok(!strcmp(drive, "c:"), "got %s\n", drive); + ok(!strcmp(dir, "\\\x83\x5c"), "got %s\n", dir); + ok(!strcmp(fname, "\x83\x74\x83\x67"), "got %s\n", fname); + ok(!strcmp(ext, ".bin"), "got %s\n", ext); + + /* MBCS (Japanese) codepage */ + _setmbcp(932); + _splitpath(path, drive, dir, fname, ext); + ok(!strcmp(drive, "c:"), "got %s\n", drive); + ok(!strcmp(dir, "\\"), "got %s\n", dir); + ok(!strcmp(fname, "\x83\x5c\x83\x74\x83\x67"), "got %s\n", fname); + ok(!strcmp(ext, ".bin"), "got %s\n", ext); + + _setmbcp(prev_cp); } START_TEST(dir) @@ -397,4 +423,5 @@ START_TEST(dir) test_fullpath(); test_makepath(); test_makepath_s(); + test_splitpath(); } diff --git a/rostests/winetests/msvcrt/file.c b/rostests/winetests/msvcrt/file.c index e450b725147..f6a1624d820 100644 --- a/rostests/winetests/msvcrt/file.c +++ b/rostests/winetests/msvcrt/file.c @@ -33,18 +33,44 @@ #include #include #include +#include + +#define MSVCRT_FD_BLOCK_SIZE 32 +typedef struct { + HANDLE handle; + unsigned char wxflag; + char lookahead[3]; + int exflag; + CRITICAL_SECTION crit; +} ioinfo; +static ioinfo **__pioinfo; static HANDLE proc_handles[2]; static int (__cdecl *p_fopen_s)(FILE**, const char*, const char*); static int (__cdecl *p__wfopen_s)(FILE**, const wchar_t*, const wchar_t*); +static const char* get_base_name(const char *path) +{ + const char *ret = path+strlen(path)-1; + + while(ret >= path) { + if(*ret=='\\' || *ret=='/') + break; + ret--; + } + return ret+1; +} + static void init(void) { HMODULE hmod = GetModuleHandleA("msvcrt.dll"); + setlocale(LC_CTYPE, "C"); + p_fopen_s = (void*)GetProcAddress(hmod, "fopen_s"); p__wfopen_s = (void*)GetProcAddress(hmod, "_wfopen_s"); + __pioinfo = (void*)GetProcAddress(hmod, "__pioinfo"); } static void test_filbuf( void ) @@ -443,11 +469,11 @@ static void test_filemodeT(void) FILE* f; size_t bytesWritten; size_t bytesRead; - WIN32_FIND_DATA findData; + WIN32_FIND_DATAA findData; HANDLE h; - GetTempPath (MAX_PATH, temppath); - GetTempFileName (temppath, "", 0, tempfile); + GetTempPathA(MAX_PATH, temppath); + GetTempFileNameA(temppath, "", 0, tempfile); f = fopen(tempfile, "w+bDT"); bytesWritten = fwrite(DATA, 1, sizeof(DATA), f); @@ -458,7 +484,7 @@ static void test_filemodeT(void) ok (bytesRead == bytesWritten && bytesRead == sizeof(DATA), "fopen file mode 'T' wrongly interpreted as 't'\n" ); - h = FindFirstFile(tempfile, &findData); + h = FindFirstFileA(tempfile, &findData); ok (h == INVALID_HANDLE_VALUE, "file wasn't deleted when closed.\n" ); @@ -708,7 +734,7 @@ static void test_fgetwc( void ) ok(l==BUFSIZ-2, "ftell expected %d got %d\n", BUFSIZ-2, l); fgetws(wtextW,LLEN,tempfh); l=ftell(tempfh); - ok(l==BUFSIZ-2+strlen(mytext), "ftell expected %d got %d\n", BUFSIZ-2+lstrlen(mytext), l); + ok(l==BUFSIZ-2+strlen(mytext), "ftell expected %d got %d\n", BUFSIZ-2+lstrlenA(mytext), l); mytextW = AtoW (mytext); aptr = mytextW; wptr = wtextW; @@ -792,6 +818,190 @@ static void test_fgetwc( void ) free(tempf); } +static void test_fgetwc_locale(const char* text, const char* locale, int codepage) +{ + char temppath[MAX_PATH], tempfile[MAX_PATH]; + FILE *tempfh; + static const WCHAR wchar_text[] = { 0xfeff, 0xff1f, '!' }; + WCHAR wtextW[BUFSIZ]; + int ret = 0, i; + wint_t ch; + + if (!setlocale(LC_CTYPE, locale)) + { + win_skip("%s locale not available\n", locale); + return; + } + + GetTempPathA(MAX_PATH, temppath); + GetTempFileNameA(temppath, "", 0, tempfile); + + tempfh = fopen(tempfile, "wb"); + ok(tempfh != NULL, "can't open tempfile\n"); + fwrite(text, 1, strlen(text), tempfh); + fclose(tempfh); + + if (codepage != 0) + { + /* mbstowcs rejects invalid multibyte sequence, + so we use MultiByteToWideChar here. */ + ret = MultiByteToWideChar(codepage, 0, text, -1, + wtextW, sizeof(wtextW)/sizeof(wtextW[0])); + ok(ret > 0, "MultiByteToWideChar failed\n"); + } + else + { + /* C locale */ + const char *p; + for (p = text; *p != '\0'; p++) + wtextW[ret++] = (unsigned char)*p; + wtextW[ret++] = 0; + } + + tempfh = fopen(tempfile, "rt"); + ok(tempfh != NULL, "can't open tempfile\n"); + + for (i = 0; i < ret-1; i++) + { + ch = fgetwc(tempfh); + ok(ch == wtextW[i], "got %04hx, expected %04hx (cp%d[%d])\n", ch, wtextW[i], codepage, i); + } + ch = fgetwc(tempfh); + ok(ch == WEOF, "got %04hx, expected WEOF (cp%d)\n", ch, codepage); + fclose(tempfh); + + tempfh = fopen(tempfile, "wb"); + ok(tempfh != NULL, "can't open tempfile\n"); + fwrite(wchar_text, 1, sizeof(wchar_text), tempfh); + fclose(tempfh); + + tempfh = fopen(tempfile, "rb"); + ok(tempfh != NULL, "can't open tempfile\n"); + for (i = 0; i < sizeof(wchar_text)/sizeof(wchar_text[0]); i++) + { + ch = fgetwc(tempfh); + ok(ch == wchar_text[i], "got %04hx, expected %04x (cp%d[%d])\n", ch, wchar_text[i], codepage, i); + } + ch = fgetwc(tempfh); + ok(ch == WEOF, "got %04hx, expected WEOF (cp%d)\n", ch, codepage); + fclose(tempfh); + unlink(tempfile); +} + +static void test_fgetwc_unicode(void) +{ + char temppath[MAX_PATH], tempfile[MAX_PATH]; + FILE *tempfh; + static const WCHAR wchar_text[] = { 0xfeff, 0xff1f, '!' }; + char utf8_text[BUFSIZ]; + int ret, i; + wint_t ch; + + GetTempPathA(MAX_PATH, temppath); + GetTempFileNameA(temppath, "", 0, tempfile); + + if (!p_fopen_s) + { + win_skip("fopen_s not available\n"); + return; + } + + tempfh = fopen(tempfile, "wb"); + ok(tempfh != NULL, "can't open tempfile\n"); + fwrite(wchar_text, 1, sizeof(wchar_text), tempfh); + fclose(tempfh); + + tempfh = fopen(tempfile, "rt,ccs=unicode"); + ok(tempfh != NULL, "can't open tempfile\n"); + for (i = 1; i < sizeof(wchar_text)/sizeof(wchar_text[0]); i++) + { + ch = fgetwc(tempfh); + ok(ch == wchar_text[i], + "got %04hx, expected %04x (unicode[%d])\n", ch, wchar_text[i], i-1); + } + ch = fgetwc(tempfh); + ok(ch == WEOF, "got %04hx, expected WEOF (unicode)\n", ch); + fclose(tempfh); + + tempfh = fopen(tempfile, "wb"); + ok(tempfh != NULL, "can't open tempfile\n"); + ret = WideCharToMultiByte(CP_UTF8, 0, wchar_text, sizeof(wchar_text)/sizeof(wchar_text[0]), + utf8_text, sizeof(utf8_text), NULL, NULL); + ok(ret > 0, "utf-8 conversion failed\n"); + fwrite(utf8_text, sizeof(char), ret, tempfh); + fclose(tempfh); + + tempfh = fopen(tempfile, "rt, ccs=UTF-8"); + ok(tempfh != NULL, "can't open tempfile\n"); + for (i = 1; i < sizeof(wchar_text)/sizeof(wchar_text[0]); i++) + { + ch = fgetwc(tempfh); + ok(ch == wchar_text[i], + "got %04hx, expected %04x (utf8[%d])\n", ch, wchar_text[i], i-1); + } + ch = fgetwc(tempfh); + ok(ch == WEOF, "got %04hx, expected WEOF (utf8)\n", ch); + fclose(tempfh); + unlink(temppath); +} + +static void test_fputwc(void) +{ + char temppath[MAX_PATH]; + char tempfile[MAX_PATH]; + FILE *f; + char buf[1024]; + int ret; + + GetTempPathA(MAX_PATH, temppath); + GetTempFileNameA(temppath, "", 0, tempfile); + + f = fopen(tempfile, "w"); + ret = fputwc('a', f); + ok(ret == 'a', "fputwc returned %x, expected 'a'\n", ret); + ret = fputwc('\n', f); + ok(ret == '\n', "fputwc returned %x, expected '\\n'\n", ret); + fclose(f); + + f = fopen(tempfile, "rb"); + ret = fread(buf, 1, sizeof(buf), f); + ok(ret == 3, "fread returned %d, expected 3\n", ret); + ok(!memcmp(buf, "a\r\n", 3), "incorrect file data\n"); + fclose(f); + + if(p_fopen_s) { + f = fopen(tempfile, "w,ccs=unicode"); + ret = fputwc('a', f); + ok(ret == 'a', "fputwc returned %x, expected 'a'\n", ret); + ret = fputwc('\n', f); + ok(ret == '\n', "fputwc returned %x, expected '\\n'\n", ret); + fclose(f); + + f = fopen(tempfile, "rb"); + ret = fread(buf, 1, sizeof(buf), f); + ok(ret == 8, "fread returned %d, expected 8\n", ret); + ok(!memcmp(buf, "\xff\xfe\x61\x00\r\x00\n\x00", 8), "incorrect file data\n"); + fclose(f); + + f = fopen(tempfile, "w,ccs=utf-8"); + ret = fputwc('a', f); + ok(ret == 'a', "fputwc returned %x, expected 'a'\n", ret); + ret = fputwc('\n', f); + ok(ret == '\n', "fputwc returned %x, expected '\\n'\n", ret); + fclose(f); + + f = fopen(tempfile, "rb"); + ret = fread(buf, 1, sizeof(buf), f); + ok(ret == 6, "fread returned %d, expected 6\n", ret); + ok(!memcmp(buf, "\xef\xbb\xbf\x61\r\n", 6), "incorrect file data\n"); + fclose(f); + }else { + win_skip("fputwc tests on unicode files\n"); + } + + _unlink(tempfile); +} + static void test_ctrlz( void ) { char* tempf; @@ -956,6 +1166,11 @@ static void test_file_write_read( void ) _lseek(tempfd, -2, FILE_END); ret = _read(tempfd,btext,LLEN); ok(ret == 1 && *btext == '\n', "_read expected '\\n' got bad length: %d\n", ret); + _lseek(tempfd, -2, FILE_END); + ret = _read(tempfd,btext,1); + ok(ret == 1 && *btext == '\n', "_read returned %d, buf: %d\n", ret, *btext); + ret = read(tempfd,btext,1); + ok(ret == 0, "_read returned %d, expected 0\n", ret); _lseek(tempfd, -3, FILE_END); ret = _read(tempfd,btext,1); ok(ret == 1 && *btext == 'e', "_read expected 'e' got \"%.*s\" bad length: %d\n", ret, btext, ret); @@ -975,7 +1190,7 @@ static void test_file_write_read( void ) free(tempf); tempf=_tempnam(".","wne"); - tempfd = _open(tempf,_O_CREAT|_O_TRUNC|_O_BINARY|_O_RDWR,0); + tempfd = _open(tempf, _O_CREAT|_O_TRUNC|_O_BINARY|_O_RDWR, _S_IWRITE); ok( tempfd != -1, "Can't open '%s': %d\n", tempf, errno); /* open in BINARY mode */ ok(_write(tempfd,dostext,strlen(dostext)) == lstrlenA(dostext), @@ -1011,6 +1226,95 @@ static void test_file_write_read( void ) ok(i == strlen(mytext)-1, "_read_i %d\n", i); _close(tempfd); + /* test read/write in unicode mode */ + if(p_fopen_s) + { + tempfd = _open(tempf, _O_CREAT|_O_TRUNC|_O_WRONLY|_O_WTEXT, _S_IWRITE); + ok(tempfd != -1, "_open failed with error: %d\n", errno); + ret = _write(tempfd, "a", 1); + ok(ret == -1, "_write returned %d, expected -1\n", ret); + ret = _write(tempfd, "a\x00\n\x00\xff\xff", 6); + ok(ret == 6, "_write returned %d, expected 6\n", ret); + _close(tempfd); + + tempfd = _open(tempf, _O_RDONLY|_O_BINARY, 0); + ok(tempfd != -1, "_open failed with error: %d\n", errno); + ret = _read(tempfd, btext, sizeof(btext)); + ok(ret == 10, "_read returned %d, expected 10\n", ret); + ok(!memcmp(btext, "\xff\xfe\x61\x00\r\x00\n\x00\xff\xff", 10), "btext is incorrect\n"); + _close(tempfd); + + tempfd = _open(tempf, _O_RDONLY|_O_WTEXT, 0); + ok(tempfd != -1, "_open failed with error: %d\n", errno); + errno = 0xdeadbeef; + ret = _read(tempfd, btext, 3); + ok(ret == -1, "_read returned %d, expected -1\n", ret); + ok(errno == 22, "errno = %d\n", errno); + ret = _read(tempfd, btext, sizeof(btext)); + ok(ret == 6, "_read returned %d, expected 6\n", ret); + ok(!memcmp(btext, "\x61\x00\n\x00\xff\xff", 6), "btext is incorrect\n"); + _close(tempfd); + + tempfd = _open(tempf, _O_CREAT|_O_TRUNC|_O_WRONLY|_O_U8TEXT, _S_IWRITE); + ok(tempfd != -1, "_open failed with error: %d\n", errno); + errno = 0xdeadbeef; + ret = _write(tempfd, "a", 1); + ok(ret == -1, "_write returned %d, expected -1\n", ret); + ok(errno == 22, "errno = %d\n", errno); + ret = _write(tempfd, "a\x00\n\x00\x62\x00", 6); + ok(ret == 6, "_write returned %d, expected 6\n", ret); + _close(tempfd); + + tempfd = _open(tempf, _O_RDONLY|_O_BINARY, 0); + ok(tempfd != -1, "_open failed with error: %d\n", errno); + ret = _read(tempfd, btext, sizeof(btext)); + ok(ret == 7, "_read returned %d, expected 7\n", ret); + ok(!memcmp(btext, "\xef\xbb\xbf\x61\r\n\x62", 7), "btext is incorrect\n"); + _close(tempfd); + + tempfd = _open(tempf, _O_RDONLY|_O_WTEXT, 0); + ok(tempfd != -1, "_open failed with error: %d\n", errno); + ret = _read(tempfd, btext, sizeof(btext)); + ok(ret == 6, "_read returned %d, expected 6\n", ret); + ok(!memcmp(btext, "\x61\x00\n\x00\x62\x00", 6), "btext is incorrect\n"); + + /* when buffer is small read sometimes fails in native implementation */ + lseek(tempfd, 3 /* skip bom */, SEEK_SET); + ret = _read(tempfd, btext, 4); + todo_wine ok(ret == -1, "_read returned %d, expected -1\n", ret); + + lseek(tempfd, 6, SEEK_SET); + ret = _read(tempfd, btext, 2); + ok(ret == 2, "_read returned %d, expected 2\n", ret); + ok(!memcmp(btext, "\x62\x00", 2), "btext is incorrect\n"); + _close(tempfd); + + tempfd = _open(tempf, _O_CREAT|_O_TRUNC|_O_WRONLY|_O_BINARY, _S_IWRITE); + ok(tempfd != -1, "_open failed with error: %d\n", errno); + ret = _write(tempfd, "\xef\xbb\xbf\x61\xc4\x85\x62\xc5\xbc\r\r\n", 12); + ok(ret == 12, "_write returned %d, expected 9\n", ret); + _close(tempfd); + + tempfd = _open(tempf, _O_RDONLY|_O_WTEXT, 0); + ok(tempfd != -1, "_open failed with error: %d\n", errno); + ret = _read(tempfd, btext, sizeof(btext)); + ok(ret == 12, "_read returned %d, expected 12\n", ret); + ok(!memcmp(btext, "\x61\x00\x05\x01\x62\x00\x7c\x01\x0d\x00\x0a\x00", 12), "btext is incorrect\n"); + + /* test invalid utf8 sequence */ + lseek(tempfd, 5, SEEK_SET); + ret = _read(tempfd, btext, sizeof(btext)); + todo_wine ok(ret == 10, "_read returned %d, expected 10\n", ret); + /* invalid char should be replaced by U+FFFD in MultiByteToWideChar */ + todo_wine ok(!memcmp(btext, "\xfd\xff", 2), "invalid UTF8 character was not replaced by U+FFFD\n"); + ok(!memcmp(btext+ret-8, "\x62\x00\x7c\x01\x0d\x00\x0a\x00", 8), "btext is incorrect\n"); + _close(tempfd); + } + else + { + win_skip("unicode mode tests on file\n"); + } + ret =_chmod (tempf, _S_IREAD | _S_IWRITE); ok( ret == 0, "Can't chmod '%s' to read-write: %d\n", tempf, errno); @@ -1042,7 +1346,7 @@ static void test_file_inherit_child_no(const char* fd_s) "Wrong write result in child process on %d (%s)\n", fd, strerror(errno)); } -static void create_io_inherit_block( STARTUPINFO *startup, unsigned int count, const HANDLE *handles ) +static void create_io_inherit_block( STARTUPINFOA *startup, unsigned int count, const HANDLE *handles ) { static BYTE block[1024]; BYTE *wxflag_ptr; @@ -1072,7 +1376,7 @@ static const char *read_file( HANDLE file ) return buffer; } -static void test_stdout_handle( STARTUPINFO *startup, char *cmdline, HANDLE hstdout, BOOL expect_stdout, +static void test_stdout_handle( STARTUPINFOA *startup, char *cmdline, HANDLE hstdout, BOOL expect_stdout, const char *descr ) { const char *data; @@ -1112,7 +1416,7 @@ static void test_stdout_handle( STARTUPINFO *startup, char *cmdline, HANDLE hstd } CloseHandle( hErrorFile ); - DeleteFile( "fdopen.err" ); + DeleteFileA( "fdopen.err" ); } static void test_file_inherit( const char* selfname ) @@ -1121,13 +1425,13 @@ static void test_file_inherit( const char* selfname ) const char* arg_v[5]; char buffer[16]; char cmdline[MAX_PATH]; - STARTUPINFO startup; + STARTUPINFOA startup; SECURITY_ATTRIBUTES sa; HANDLE handles[3]; fd = open ("fdopen.tst", O_CREAT | O_RDWR | O_BINARY, _S_IREAD |_S_IWRITE); ok(fd != -1, "Couldn't create test file\n"); - arg_v[0] = selfname; + arg_v[0] = get_base_name(selfname); arg_v[1] = "tests/file.c"; arg_v[2] = "inherit"; arg_v[3] = buffer; sprintf(buffer, "%d", fd); @@ -1141,7 +1445,6 @@ static void test_file_inherit( const char* selfname ) fd = open ("fdopen.tst", O_CREAT | O_RDWR | O_BINARY | O_NOINHERIT, _S_IREAD |_S_IWRITE); ok(fd != -1, "Couldn't create test file\n"); - arg_v[0] = selfname; arg_v[1] = "tests/file.c"; arg_v[2] = "inherit_no"; arg_v[3] = buffer; sprintf(buffer, "%d", fd); @@ -1159,7 +1462,7 @@ static void test_file_inherit( const char* selfname ) sprintf(cmdline, "%s file inherit 1", selfname); /* init an empty Reserved2, which should not be recognized as inherit-block */ - ZeroMemory(&startup, sizeof(STARTUPINFO)); + ZeroMemory(&startup, sizeof(startup)); startup.cb = sizeof(startup); create_io_inherit_block( &startup, 0, NULL ); test_stdout_handle( &startup, cmdline, 0, FALSE, "empty block" ); @@ -1172,7 +1475,7 @@ static void test_file_inherit( const char* selfname ) create_io_inherit_block( &startup, 3, handles ); test_stdout_handle( &startup, cmdline, handles[1], TRUE, "valid block" ); CloseHandle( handles[1] ); - DeleteFile("fdopen.tst"); + DeleteFileA("fdopen.tst"); /* test inherit block starting with unsigned zero */ handles[1] = CreateFileA( "fdopen.tst", GENERIC_READ|GENERIC_WRITE, @@ -1181,7 +1484,7 @@ static void test_file_inherit( const char* selfname ) *(unsigned int *)startup.lpReserved2 = 0; test_stdout_handle( &startup, cmdline, handles[1], FALSE, "zero count block" ); CloseHandle( handles[1] ); - DeleteFile("fdopen.tst"); + DeleteFileA("fdopen.tst"); /* test inherit block with smaller size */ handles[1] = CreateFileA( "fdopen.tst", GENERIC_READ|GENERIC_WRITE, @@ -1190,7 +1493,7 @@ static void test_file_inherit( const char* selfname ) startup.cbReserved2 -= 3; test_stdout_handle( &startup, cmdline, handles[1], TRUE, "small size block" ); CloseHandle( handles[1] ); - DeleteFile("fdopen.tst"); + DeleteFileA("fdopen.tst"); /* test inherit block with even smaller size */ handles[1] = CreateFileA( "fdopen.tst", GENERIC_READ|GENERIC_WRITE, @@ -1199,7 +1502,7 @@ static void test_file_inherit( const char* selfname ) startup.cbReserved2 = sizeof(unsigned int) + sizeof(HANDLE) + sizeof(char); test_stdout_handle( &startup, cmdline, handles[1], FALSE, "smaller size block" ); CloseHandle( handles[1] ); - DeleteFile("fdopen.tst"); + DeleteFileA("fdopen.tst"); /* test inherit block with larger size */ handles[1] = CreateFileA( "fdopen.tst", GENERIC_READ|GENERIC_WRITE, @@ -1208,7 +1511,7 @@ static void test_file_inherit( const char* selfname ) startup.cbReserved2 += 7; test_stdout_handle( &startup, cmdline, handles[1], TRUE, "large size block" ); CloseHandle( handles[1] ); - DeleteFile("fdopen.tst"); + DeleteFileA("fdopen.tst"); } static void test_tmpnam( void ) @@ -1320,6 +1623,7 @@ static void test_fopen_s( void ) { const char name[] = "empty1"; char buff[16]; + unsigned char *ubuff = (unsigned char*)buff; FILE *file; int ret; int len; @@ -1348,6 +1652,69 @@ static void test_fopen_s( void ) ret = fclose(file); ok(ret != EOF, "File failed to close\n"); + ret = p_fopen_s(&file, name, "w, ccs=UNIcode"); + ok(ret == 0, "fopen_s failed with %d\n", ret); + ret = fwrite("a", 1, 2, file); + ok(ret == 2, "fwrite returned %d\n", ret); + fclose(file); + + ret = p_fopen_s(&file, name, "r"); + ok(ret == 0, "fopen_s failed with %d\n", ret); + len = fread(buff, 1, 2, file); + ok(len == 2, "len = %d\n", len); + ok(ubuff[0]==0xff && ubuff[1]==0xfe, "buff[0]=%02x, buff[1]=%02x\n", + ubuff[0], ubuff[1]); + fclose(file); + + ret = p_fopen_s(&file, name, "r,ccs=unicode"); + ok(ret == 0, "fopen_s failed with %d\n", ret); + len = fread(buff, 1, 2, file); + ok(len == 2, "len = %d\n", len); + ok(ubuff[0]=='a' && ubuff[1]==0, "buff[0]=%02x, buff[1]=%02x\n", + ubuff[0], ubuff[1]); + fclose(file); + + ret = p_fopen_s(&file, name, "r,ccs=utf-16le"); + ok(ret == 0, "fopen_s failed with %d\n", ret); + len = fread(buff, 1, 2, file); + ok(len == 2, "len = %d\n", len); + ok(ubuff[0]=='a' && ubuff[1]==0, "buff[0]=%02x, buff[1]=%02x\n", + ubuff[0], ubuff[1]); + fclose(file); + + ret = p_fopen_s(&file, name, "r,ccs=utf-8"); + ok(ret == 0, "fopen_s failed with %d\n", ret); + len = fread(buff, 1, 2, file); + ok(len == 2, "len = %d\n", len); + ok(ubuff[0]=='a' && ubuff[1]==0, "buff[0]=%02x, buff[1]=%02x\n", + ubuff[0], ubuff[1]); + fclose(file); + + ret = p_fopen_s(&file, name, "w,ccs=utf-16le"); + ok(ret == 0, "fopen_s failed with %d\n", ret); + fclose(file); + + ret = p_fopen_s(&file, name, "r"); + ok(ret == 0, "fopen_s failed with %d\n", ret); + len = fread(buff, 1, 3, file); + ok(len == 2, "len = %d\n", len); + ok(ubuff[0]==0xff && ubuff[1]==0xfe, "buff[0]=%02x, buff[1]=%02x\n", + ubuff[0], ubuff[1]); + fclose(file); + + ret = p_fopen_s(&file, name, "w,ccs=utf-8"); + ok(ret == 0, "fopen_s failed with %d\n", ret); + fclose(file); + + ret = p_fopen_s(&file, name, "r"); + ok(ret == 0, "fopen_s failed with %d\n", ret); + len = fread(buff, 1, 4, file); + ok(len == 3, "len = %d\n", len); + ok(ubuff[0]==0xef && ubuff[1]==0xbb && ubuff[2]==0xbf, + "buff[0]=%02x, buff[1]=%02x, buff[2]=%02x\n", + ubuff[0], ubuff[1], ubuff[2]); + fclose(file); + ok(_unlink(name) == 0, "Couldn't unlink file named '%s'\n", name); } @@ -1392,6 +1759,61 @@ static void test__wfopen_s( void ) ok(_unlink(name) == 0, "Couldn't unlink file named '%s'\n", name); } +static void test_setmode(void) +{ + const char name[] = "empty1"; + int fd, ret; + + if(!p_fopen_s) { + win_skip("unicode file modes are not available, skipping setmode tests\n"); + return; + } + + fd = _open(name, _O_CREAT|_O_WRONLY, _S_IWRITE); + ok(fd != -1, "failed to open file\n"); + + errno = 0xdeadbeef; + ret = _setmode(fd, 0xffffffff); + ok(ret == -1, "_setmode returned %x, expected -1\n", ret); + ok(errno == EINVAL, "errno = %d\n", errno); + + errno = 0xdeadbeef; + ret = _setmode(fd, 0); + ok(ret == -1, "_setmode returned %x, expected -1\n", ret); + ok(errno == EINVAL, "errno = %d\n", errno); + + errno = 0xdeadbeef; + ret = _setmode(fd, _O_BINARY|_O_TEXT); + ok(ret == -1, "_setmode returned %x, expected -1\n", ret); + ok(errno == EINVAL, "errno = %d\n", errno); + + errno = 0xdeadbeef; + ret = _setmode(fd, _O_WTEXT|_O_U16TEXT); + ok(ret == -1, "_setmode returned %x, expected -1\n", ret); + ok(errno == EINVAL, "errno = %d\n", errno); + + ret = _setmode(fd, _O_BINARY); + ok(ret == _O_TEXT, "_setmode returned %x, expected _O_TEXT\n", ret); + + ret = _setmode(fd, _O_WTEXT); + ok(ret == _O_BINARY, "_setmode returned %x, expected _O_BINARY\n", ret); + + ret = _setmode(fd, _O_TEXT); + ok(ret == _O_WTEXT, "_setmode returned %x, expected _O_WTEXT\n", ret); + + ret = _setmode(fd, _O_U16TEXT); + ok(ret == _O_TEXT, "_setmode returned %x, expected _O_TEXT\n", ret); + + ret = _setmode(fd, _O_U8TEXT); + ok(ret == _O_WTEXT, "_setmode returned %x, expected _O_WTEXT\n", ret); + + ret = _setmode(fd, _O_TEXT); + ok(ret == _O_WTEXT, "_setmode returned %x, expected _O_WTEXT\n", ret); + + _close(fd); + _unlink(name); +} + static void test_get_osfhandle(void) { int fd; @@ -1444,6 +1866,11 @@ static void test_stat(void) ok(buf.st_nlink == 1, "st_nlink is %d, expected 1\n", buf.st_nlink); ok(buf.st_size == 0, "st_size is %d, expected 0\n", buf.st_size); + errno = 0xdeadbeef; + ret = stat("stat.tst\\", &buf); + ok(ret == -1, "stat returned %d\n", ret); + ok(errno == ENOENT, "errno = %d\n", errno); + close(fd); remove("stat.tst"); } @@ -1483,6 +1910,35 @@ static void test_stat(void) } else skip("pipe failed with errno %d\n", errno); + + /* Tests for directory */ + if(mkdir("stat.tst") == 0) + { + ret = stat("stat.tst ", &buf); + ok(!ret, "stat(directory) failed: errno=%d\n", errno); + ok((buf.st_mode & _S_IFMT) == _S_IFDIR, "bad format = %06o\n", buf.st_mode); + ok((buf.st_mode & 0777) == 0777, "bad st_mode = %06o\n", buf.st_mode); + ok(buf.st_dev == buf.st_rdev, "st_dev (%d) and st_rdev (%d) differ\n", buf.st_dev, buf.st_rdev); + ok(buf.st_nlink == 1, "st_nlink is %d, expected 1\n", buf.st_nlink); + + errno = 0xdeadbeef; + ret = stat("stat.tst\\ ", &buf); + ok(ret == -1, "stat returned %d\n", ret); + ok(errno == ENOENT, "errno = %d\n", errno); + rmdir( "stat.tst" ); + } + else + skip("mkdir failed with errno %d\n", errno); + + errno = 0xdeadbeef; + ret = stat("c:", &buf); + ok(ret == -1, "stat returned %d\n", ret); + ok(errno == ENOENT, "errno = %d\n", errno); + + ret = stat("c:/", &buf); + ok(!ret, "stat returned %d\n", ret); + ok(buf.st_dev == 2, "st_dev = %d\n", buf.st_dev); + ok(buf.st_rdev == 2, "st_rdev = %d\n", buf.st_rdev); } static const char* pipe_string="Hello world"; @@ -1538,7 +1994,7 @@ static void test_pipes(const char* selfname) return; } - arg_v[0] = selfname; + arg_v[0] = get_base_name(selfname); arg_v[1] = "tests/file.c"; arg_v[2] = "pipes"; arg_v[3] = str_fdr; sprintf(str_fdr, "%d", pipes[0]); @@ -1568,7 +2024,6 @@ static void test_pipes(const char* selfname) return; } - arg_v[0] = selfname; arg_v[1] = "tests/file.c"; arg_v[2] = "pipes"; arg_v[3] = str_fdr; sprintf(str_fdr, "%d", pipes[0]); @@ -1601,6 +2056,56 @@ static void test_pipes(const char* selfname) i=fclose(file); ok(!i, "unable to close the pipe: %d\n", errno); + + /* test \r handling when it's the last character read */ + if (_pipe(pipes, 1024, O_BINARY) < 0) + { + ok(0, "pipe failed with errno %d\n", errno); + return; + } + r = write(pipes[1], "\r\n\rab\r\n", 7); + ok(r == 7, "write returned %d, errno = %d\n", r, errno); + setmode(pipes[0], O_TEXT); + r = read(pipes[0], buf, 1); + ok(r == 1, "read returned %d, expected 1\n", r); + ok(buf[0] == '\n', "buf[0] = %x, expected '\\n'\n", buf[0]); + r = read(pipes[0], buf, 1); + ok(r == 1, "read returned %d, expected 1\n", r); + ok(buf[0] == '\r', "buf[0] = %x, expected '\\r'\n", buf[0]); + r = read(pipes[0], buf, 1); + ok(r == 1, "read returned %d, expected 1\n", r); + ok(buf[0] == 'a', "buf[0] = %x, expected 'a'\n", buf[0]); + r = read(pipes[0], buf, 2); + ok(r == 2, "read returned %d, expected 1\n", r); + ok(buf[0] == 'b', "buf[0] = %x, expected 'b'\n", buf[0]); + ok(buf[1] == '\n', "buf[1] = %x, expected '\\n'\n", buf[1]); + + if (p_fopen_s) + { + /* test utf16 read with insufficient data */ + r = write(pipes[1], "a\0b", 3); + ok(r == 3, "write returned %d, errno = %d\n", r, errno); + buf[2] = 'z'; + buf[3] = 'z'; + setmode(pipes[0], _O_WTEXT); + r = read(pipes[0], buf, 4); + ok(r == 2, "read returned %d, expected 2\n", r); + ok(!memcmp(buf, "a\0bz", 4), "read returned incorrect data\n"); + r = write(pipes[1], "\0", 1); + ok(r == 1, "write returned %d, errno = %d\n", r, errno); + buf[0] = 'z'; + buf[1] = 'z'; + r = read(pipes[0], buf, 2); + ok(r == 0, "read returned %d, expected 0\n", r); + ok(!memcmp(buf, "\0z", 2), "read returned incorrect data\n"); + } + else + { + win_skip("unicode mode tests on pipe\n"); + } + + close(pipes[1]); + close(pipes[0]); } static void test_unlink(void) @@ -1621,6 +2126,99 @@ static void test_dup2(void) ok(-1 == _dup2(0, -1), "expected _dup2 to fail when second arg is negative\n" ); } +static void test_stdin(void) +{ + HANDLE stdinh = GetStdHandle(STD_INPUT_HANDLE); + int stdin_dup, fd; + HANDLE h; + DWORD r; + + stdin_dup = _dup(STDIN_FILENO); + ok(stdin_dup != -1, "_dup(STDIN_FILENO) failed\n"); + + ok(stdinh == (HANDLE)_get_osfhandle(STDIN_FILENO), + "GetStdHandle(STD_INPUT_HANDLE) != _get_osfhandle(STDIN_FILENO)\n"); + + r = SetStdHandle(STD_INPUT_HANDLE, INVALID_HANDLE_VALUE); + ok(r == TRUE, "SetStdHandle returned %x, expected TRUE\n", r); + h = GetStdHandle(STD_INPUT_HANDLE); + ok(h == INVALID_HANDLE_VALUE, "h = %p\n", h); + + close(STDIN_FILENO); + h = GetStdHandle(STD_INPUT_HANDLE); + ok(h == NULL, "h != NULL\n"); + + fd = open("stdin.tst", O_WRONLY | O_CREAT, _S_IREAD |_S_IWRITE); + ok(fd != -1, "open failed\n"); + ok(fd == STDIN_FILENO, "fd = %d, expected STDIN_FILENO\n", fd); + h = GetStdHandle(STD_INPUT_HANDLE); + ok(h != NULL, "h == NULL\n"); + close(fd); + unlink("stdin.tst"); + + r = _dup2(stdin_dup, STDIN_FILENO); + ok(r != -1, "_dup2 failed\n"); + h = GetStdHandle(STD_INPUT_HANDLE); + ok(h != NULL, "h == NULL\n"); +} + +static void test_mktemp(void) +{ + char buf[16]; + + strcpy(buf, "a"); + ok(!_mktemp(buf), "_mktemp(\"a\") != NULL\n"); + + strcpy(buf, "testXXXXX"); + ok(!_mktemp(buf), "_mktemp(\"testXXXXX\") != NULL\n"); + + strcpy(buf, "testXXXXXX"); + ok(_mktemp(buf) != NULL, "_mktemp(\"testXXXXXX\") == NULL\n"); + + strcpy(buf, "testXXXXXXa"); + ok(!_mktemp(buf), "_mktemp(\"testXXXXXXa\") != NULL\n"); + + strcpy(buf, "**XXXXXX"); + ok(_mktemp(buf) != NULL, "_mktemp(\"**XXXXXX\") == NULL\n"); +} + +static void test__open_osfhandle(void) +{ + ioinfo *info; + HANDLE h, tmp; + int fd; + + errno = 0xdeadbeef; + fd = _open_osfhandle((intptr_t)INVALID_HANDLE_VALUE, 0); + ok(fd == -1, "_open_osfhandle returned %d\n", fd); + ok(errno == EBADF, "errno = %d\n", errno); + + h = CreateFileA("open_osfhandle.tst", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL); + fd = _open_osfhandle((intptr_t)h, 0); + ok(fd > 0, "_open_osfhandle returned %d (%d)\n", fd, errno); + info = &__pioinfo[fd/MSVCRT_FD_BLOCK_SIZE][fd%MSVCRT_FD_BLOCK_SIZE]; + ok(info->handle == h, "info->handle = %p, expected %p\n", info->handle, h); + ok(info->wxflag == 1, "info->wxflag = %x, expected 1\n", info->wxflag); + close(fd); + ok(info->handle == INVALID_HANDLE_VALUE, "info->handle = %p, expected INVALID_HANDLE_VALUE\n", info->handle); + ok(info->wxflag == 0, "info->wxflag = %x, expected 0\n", info->wxflag); + DeleteFileA("open_osfhandle.tst"); + + errno = 0xdeadbeef; + fd = _open_osfhandle((intptr_t)h, 0); + ok(fd == -1, "_open_osfhandle returned %d\n", fd); + ok(errno == EBADF, "errno = %d\n", errno); + + ok(CreatePipe(&h, &tmp, NULL, 0), "CreatePipe failed\n"); + fd = _open_osfhandle((intptr_t)h, 0); + ok(fd > 0, "_open_osfhandle returned %d (%d)\n", fd, errno); + info = &__pioinfo[fd/MSVCRT_FD_BLOCK_SIZE][fd%MSVCRT_FD_BLOCK_SIZE]; + ok(info->handle == h, "info->handle = %p, expected %p\n", info->handle, h); + ok(info->wxflag == 9, "info->wxflag = %x, expected 9\n", info->wxflag); + close(fd); + CloseHandle(tmp); +} + START_TEST(file) { int arg_c; @@ -1656,6 +2254,7 @@ START_TEST(file) test_fopen_fclose_fcloseall(); test_fopen_s(); test__wfopen_s(); + test_setmode(); test_fileops(); test_asciimode(); test_asciimode2(); @@ -1668,12 +2267,23 @@ START_TEST(file) test_flsbuf(); test_fflush(); test_fgetwc(); + /* \x83\xa9 is double byte character, \xe0\x7f is not (undefined). */ + test_fgetwc_locale("AB\x83\xa9\xe0\x7f", "Japanese_Japan.932", 932); + /* \x83 is U+0192 */ + test_fgetwc_locale("AB\x83\xa9", "English", 1252); + /* \x83 is U+0083 */ + test_fgetwc_locale("AB\x83\xa9", "C", 0); + test_fgetwc_unicode(); + test_fputwc(); test_ctrlz(); test_file_put_get(); test_tmpnam(); test_get_osfhandle(); test_setmaxstdio(); test_pipes(arg_v[0]); + test_stdin(); + test_mktemp(); + test__open_osfhandle(); /* Wait for the (_P_NOWAIT) spawned processes to finish to make sure the report * file contains lines in the correct order diff --git a/rostests/winetests/msvcrt/heap.c b/rostests/winetests/msvcrt/heap.c index 3587e0e56f5..309e194d035 100644 --- a/rostests/winetests/msvcrt/heap.c +++ b/rostests/winetests/msvcrt/heap.c @@ -233,7 +233,7 @@ static void test_aligned_offset_realloc(unsigned int size1, unsigned int size2, static void test_aligned(void) { - HMODULE msvcrt = GetModuleHandle("msvcrt.dll"); + HMODULE msvcrt = GetModuleHandleA("msvcrt.dll"); if (msvcrt == NULL) return; diff --git a/rostests/winetests/msvcrt/locale.c b/rostests/winetests/msvcrt/locale.c index 6b09cdf26d0..dfb21460b33 100644 --- a/rostests/winetests/msvcrt/locale.c +++ b/rostests/winetests/msvcrt/locale.c @@ -49,9 +49,6 @@ static void test_setlocale(void) ret = setlocale(20, "C"); ok(ret == NULL, "ret = %s\n", ret); - ret = setlocale(LC_ALL, ""); - ok(ret != NULL, "ret == NULL\n"); - ret = setlocale(LC_ALL, "C"); ok(!strcmp(ret, "C"), "ret = %s\n", ret); @@ -116,12 +113,14 @@ static void test_setlocale(void) ok(ret != NULL || broken (ret == NULL), "ret == NULL\n"); if(ret) ok(!strcmp(ret, "Chinese (Simplified)_People's Republic of China.936") + || !strcmp(ret, "Chinese (Simplified)_China.936") || broken(!strcmp(ret, "Chinese_Taiwan.950")), "ret = %s\n", ret); ret = setlocale(LC_ALL, "chinese-simplified"); ok(ret != NULL || broken (ret == NULL), "ret == NULL\n"); if(ret) ok(!strcmp(ret, "Chinese (Simplified)_People's Republic of China.936") + || !strcmp(ret, "Chinese (Simplified)_China.936") || broken(!strcmp(ret, "Chinese_People's Republic of China.936")) || broken(!strcmp(ret, "Chinese_Taiwan.950")), "ret = %s\n", ret); @@ -135,6 +134,7 @@ static void test_setlocale(void) ok(ret != NULL || broken (ret == NULL), "ret == NULL\n"); if(ret) ok(!strcmp(ret, "Chinese (Simplified)_People's Republic of China.936") + || !strcmp(ret, "Chinese (Simplified)_China.936") || broken(!strcmp(ret, "Chinese_People's Republic of China.936")), "ret = %s\n", ret); ret = setlocale(LC_ALL, "cht"); @@ -143,6 +143,18 @@ static void test_setlocale(void) ok(!strcmp(ret, "Chinese (Traditional)_Taiwan.950") || broken(!strcmp(ret, "Chinese_Taiwan.950")), "ret = %s\n", ret); + ret = setlocale(LC_ALL, "Chinese_China.936"); +todo_wine + ok(ret != NULL || broken (ret == NULL), "ret == NULL\n"); + if(ret) + { +todo_wine + ok(!strcmp(ret, "Chinese (Simplified)_People's Republic of China.936") + || !strcmp(ret, "Chinese (Simplified)_China.936") + || broken(!strcmp(ret, "Chinese_People's Republic of China.936")), "ret = %s\n", ret); + trace("ret is %s\n", ret); + } + ret = setlocale(LC_ALL, "csy"); ok(ret != NULL || broken (ret == NULL), "ret == NULL\n"); if(ret) @@ -575,6 +587,27 @@ static void test_setlocale(void) ok(ret != NULL || broken (ret == NULL), "ret == NULL\n"); if(ret) ok(!strcmp(ret, "English_United States.1252"), "ret = %s\n", ret); + + ret = setlocale(LC_ALL, "English_United States.ACP"); + ok(ret != NULL || broken (ret == NULL), "ret == NULL\n"); + if(ret) { + strcpy(buf, "English_United States."); + GetLocaleInfoA(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT), + LOCALE_IDEFAULTANSICODEPAGE, buf+strlen(buf), 80); + ok(!strcmp(ret, buf), "ret = %s, expected %s\n", ret, buf); + } + + ret = setlocale(LC_ALL, "English_United States.OCP"); + ok(ret != NULL || broken (ret == NULL), "ret == NULL\n"); + if(ret) { + strcpy(buf, "English_United States."); + GetLocaleInfoA(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT), + LOCALE_IDEFAULTCODEPAGE, buf+strlen(buf), 80); + ok(!strcmp(ret, buf), "ret = %s, expected %s\n", ret, buf); + } + + ret = setlocale(LC_ALL, "English_United States.UTF8"); + ok(ret == NULL, "ret != NULL\n"); } static void test_crtGetStringTypeW(void) @@ -632,6 +665,7 @@ static void test__Gettnames(void) char data[1]; } *ret; int size; + char buf[64]; if(!setlocale(LC_ALL, "english")) return; @@ -688,7 +722,10 @@ static void test__Gettnames(void) ok(!strcmp(ret->str[39], "PM"), "ret->str[39] = %s\n", ret->str[39]); ok(!strcmp(ret->str[40], "M/d/yyyy") || broken(!strcmp(ret->str[40], "M/d/yy"))/*NT*/, "ret->str[40] = %s\n", ret->str[40]); - ok(!strcmp(ret->str[41], "dddd, MMMM dd, yyyy"), "ret->str[41] = %s\n", ret->str[41]); + size = GetLocaleInfoA(MAKELCID(LANG_ENGLISH, SORT_DEFAULT), + LOCALE_SLONGDATE|LOCALE_NOUSEROVERRIDE, buf, sizeof(buf)); + ok(size, "GetLocaleInfo failed: %x\n", GetLastError()); + ok(!strcmp(ret->str[41], buf), "ret->str[41] = %s, expected %s\n", ret->str[41], buf); free(ret); if(!setlocale(LC_TIME, "german")) @@ -745,10 +782,8 @@ static void test__Gettnames(void) static void test___mb_cur_max_func(void) { int mb_cur_max; - CPINFO cp; setlocale(LC_ALL, "C"); - GetCPInfo(CP_ACP, &cp); /* for newer Windows */ if(!p___mb_cur_max_func) @@ -772,13 +807,7 @@ static void test___mb_cur_max_func(void) win_skip("Skipping __p___mb_cur_max tests\n"); else { mb_cur_max = *p__p___mb_cur_max(); - if (cp.MaxCharSize != 1) { - todo_wine ok(mb_cur_max == cp.MaxCharSize, "mb_cur_max = %d, expected %d\n", - mb_cur_max, cp.MaxCharSize); - } - else { - ok(mb_cur_max == 1, "mb_cur_max = %d, expected 1\n", mb_cur_max); - } + ok(mb_cur_max == 1, "mb_cur_max = %d, expected 1\n", mb_cur_max); /* some old Windows don't set chinese */ if (!setlocale(LC_ALL, "chinese")) diff --git a/rostests/winetests/msvcrt/misc.c b/rostests/winetests/msvcrt/misc.c index a2bf0cb8345..26225f34ce1 100644 --- a/rostests/winetests/msvcrt/misc.c +++ b/rostests/winetests/msvcrt/misc.c @@ -20,6 +20,7 @@ #include "wine/test.h" #include +#include #include "msvcrt.h" static int (__cdecl *prand_s)(unsigned int *); @@ -309,10 +310,54 @@ static void test__set_errno(void) ok(errno == 0xdeadbeef, "Expected errno to be 0xdeadbeef, got %d\n", errno); } +static void test__popen_child(void) +{ + /* don't execute any tests here */ + /* ExitProcess is used to set return code of _pclose */ + printf("child output\n"); + ExitProcess(0x37); +} + +static void test__popen(const char *name) +{ + FILE *pipe; + char buf[1024]; + int ret; + + sprintf(buf, "%s misc popen", name); + pipe = _popen(buf, "r"); + ok(pipe != NULL, "_popen failed with error: %d\n", errno); + + fgets(buf, sizeof(buf), pipe); + ok(!strcmp(buf, "child output\n"), "buf = %s\n", buf); + + ret = _pclose(pipe); + ok(ret == 0x37, "_pclose returned %x, expected 0x37\n", ret); + + errno = 0xdeadbeef; + ret = _pclose((FILE*)0xdeadbeef); + ok(ret == -1, "_pclose returned %x, expected -1\n", ret); + if(p_set_errno) + ok(errno == EBADF, "errno = %d\n", errno); +} + START_TEST(misc) { + int arg_c; + char** arg_v; + init(); + arg_c = winetest_get_mainargs(&arg_v); + if(arg_c >= 3) { + if(!strcmp(arg_v[2], "popen")) + test__popen_child(); + else + ok(0, "invalid argument '%s'\n", arg_v[2]); + + return; + } + test_rand_s(); test_I10_OUTPUT(); test_strerror_s(); @@ -320,4 +365,5 @@ START_TEST(misc) test__get_errno(); test__set_doserrno(); test__set_errno(); + test__popen(arg_v[0]); } diff --git a/rostests/winetests/msvcrt/msvcrt_test.dsp b/rostests/winetests/msvcrt/msvcrt_test.dsp deleted file mode 100644 index 1e27830971b..00000000000 --- a/rostests/winetests/msvcrt/msvcrt_test.dsp +++ /dev/null @@ -1,107 +0,0 @@ -# Microsoft Developer Studio Project File - Name="msvcrt_test" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Console Application" 0x0103 - -CFG=msvcrt_test - Win32 Wine Headers -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "msvcrt_test.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "msvcrt_test.mak" CFG="msvcrt_test - Win32 Wine Headers" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "msvcrt_test - Win32 MSVC Headers" (based on "Win32 (x86) Console Application") -!MESSAGE "msvcrt_test - Win32 Wine Headers" (based on "Win32 (x86) Console Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -RSC=rc.exe -!IF "$(CFG)" == "msvcrt_test - Win32 MSVC Headers" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Output\Win32_MSVC_Headers" -# PROP BASE Intermediate_Dir "Output\Win32_MSVC_Headers" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Output\Win32_MSVC_Headers" -# PROP Intermediate_Dir "Output\Win32_MSVC_Headers" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WINVER=0x0501" /D "_WIN32_WINNT=0x0501" /D "_WIN32_IE=0x0600" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I ..\..\..\Output\\Win32_MSVC_Headers /D "WINVER=0x0501" /D "_WIN32_WINNT=0x0501" /D "_WIN32_IE=0x0600" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_MSVCRT_TEST_" /D "__WINE_USE_NATIVE_HEADERS" /D __WINETEST_OUTPUT_DIR=\"Output\\Win32_MSVC_Headers\" /D "__i386__" /D "_X86_" /D inline=__inline /FR /FD /GZ /c -# ADD BASE RSC /l 0x41d /d "_DEBUG" -# ADD RSC /l 0x41d /i "..\..\..\Output\\Win32_MSVC_Headers" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ELSEIF "$(CFG)" == "msvcrt_test - Win32 Wine Headers" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Output\Win32_Wine_Headers" -# PROP BASE Intermediate_Dir "Output\Win32_Wine_Headers" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Output\Win32_Wine_Headers" -# PROP Intermediate_Dir "Output\Win32_Wine_Headers" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WINVER=0x0501" /D "_WIN32_WINNT=0x0501" /D "_WIN32_IE=0x0600" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I ..\..\..\Output\\Win32_Wine_Headers /I ..\..\..\include /D "WINVER=0x0501" /D "_WIN32_WINNT=0x0501" /D "_WIN32_IE=0x0600" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "_MSVCRT_TEST_" /D __WINETEST_OUTPUT_DIR=\"Output\\Win32_Wine_Headers\" /D "__i386__" /D "_X86_" /D inline=__inline /FR /FD /GZ /c -# ADD BASE RSC /l 0x41d /d "_DEBUG" -# ADD RSC /l 0x41d /i "..\..\..\Output\\Win32_Wine_Headers" /i "..\..\..\include" /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "msvcrt_test - Win32 MSVC Headers" -# Name "msvcrt_test - Win32 Wine Headers" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\cpp.c -# End Source File -# Begin Source File - -SOURCE=.\\ -# End Source File -# Begin Source File - -SOURCE=.\testlist.c -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/rostests/winetests/msvcrt/printf.c b/rostests/winetests/msvcrt/printf.c index 1507a0185d1..829b2e0501b 100644 --- a/rostests/winetests/msvcrt/printf.c +++ b/rostests/winetests/msvcrt/printf.c @@ -27,6 +27,7 @@ #include #include +#include #include "windef.h" #include "winbase.h" @@ -44,6 +45,7 @@ static int (__cdecl *p__ecvt_s)(char *buffer, size_t length, double number, static int (__cdecl *p__fcvt_s)(char *buffer, size_t length, double number, int ndigits, int *decpt, int *sign); static unsigned int (__cdecl *p__get_output_format)(void); +static unsigned int (__cdecl *p__set_output_format)(unsigned int); static int (__cdecl *p__vsprintf_p)(char*, size_t, const char*, __ms_va_list); static int (__cdecl *p_vswprintf)(wchar_t *str, const wchar_t *format, __ms_va_list valist); static int (__cdecl *p__vswprintf)(wchar_t *str, const wchar_t *format, __ms_va_list valist); @@ -66,6 +68,7 @@ static void init( void ) p__ecvt_s = (void *)GetProcAddress(hmod, "_ecvt_s"); p__fcvt_s = (void *)GetProcAddress(hmod, "_fcvt_s"); p__get_output_format = (void *)GetProcAddress(hmod, "_get_output_format"); + p__set_output_format = (void *)GetProcAddress(hmod, "_set_output_format"); p__vsprintf_p = (void*)GetProcAddress(hmod, "_vsprintf_p"); p_vswprintf = (void*)GetProcAddress(hmod, "vswprintf"); p__vswprintf = (void*)GetProcAddress(hmod, "_vswprintf"); @@ -79,7 +82,7 @@ static void test_sprintf( void ) { char buffer[100]; const char *format; - double pnumber=789456123; + double pnumber=789456123, inf, nan; int x, r; WCHAR wide[] = { 'w','i','d','e',0}; @@ -326,18 +329,52 @@ static void test_sprintf( void ) format = "%#012x"; r = sprintf(buffer,format,1); ok(!strcmp(buffer,"0x0000000001"),"Hexadecimal zero-padded \"%s\"\n",buffer); + ok( r==12, "return count wrong\n"); + + r = sprintf(buffer,format,0); + ok(!strcmp(buffer,"000000000000"),"Hexadecimal zero-padded \"%s\"\n",buffer); + ok( r==12, "return count wrong\n"); format = "%#04.8x"; r = sprintf(buffer,format,1); ok(!strcmp(buffer,"0x00000001"), "Hexadecimal zero-padded precision \"%s\"\n",buffer); + ok( r==10, "return count wrong\n"); + + r = sprintf(buffer,format,0); + ok(!strcmp(buffer,"00000000"), "Hexadecimal zero-padded precision \"%s\"\n",buffer); + ok( r==8, "return count wrong\n"); format = "%#-08.2x"; r = sprintf(buffer,format,1); ok(!strcmp(buffer,"0x01 "), "Hexadecimal zero-padded not left-adjusted \"%s\"\n",buffer); + ok( r==8, "return count wrong\n"); + + r = sprintf(buffer,format,0); + ok(!strcmp(buffer,"00 "), "Hexadecimal zero-padded not left-adjusted \"%s\"\n",buffer); + ok( r==8, "return count wrong\n"); + + format = "%#.0x"; + r = sprintf(buffer,format,1); + ok(!strcmp(buffer,"0x1"), "Hexadecimal zero-padded zero-precision \"%s\"\n",buffer); + ok( r==3, "return count wrong\n"); + + r = sprintf(buffer,format,0); + ok(!strcmp(buffer,""), "Hexadecimal zero-padded zero-precision \"%s\"\n",buffer); + ok( r==0, "return count wrong\n"); format = "%#08o"; r = sprintf(buffer,format,1); ok(!strcmp(buffer,"00000001"), "Octal zero-padded \"%s\"\n",buffer); + ok( r==8, "return count wrong\n"); + + format = "%#o"; + r = sprintf(buffer,format,1); + ok(!strcmp(buffer,"01"), "Octal zero-padded \"%s\"\n",buffer); + ok( r==2, "return count wrong\n"); + + r = sprintf(buffer,format,0); + ok(!strcmp(buffer,"0"), "Octal zero-padded \"%s\"\n",buffer); + ok( r==1, "return count wrong\n"); if (sizeof(void *) == 8) { @@ -515,6 +552,26 @@ static void test_sprintf( void ) ok(!strcmp(buffer,"8.6000e+000"), "failed\n"); ok( r==11, "return count wrong\n"); + format = "% 2.4e"; + r = sprintf(buffer, format,8.6); + ok(!strcmp(buffer," 8.6000e+000"), "failed: %s\n", buffer); + ok( r==12, "return count wrong\n"); + + format = "% 014.4e"; + r = sprintf(buffer, format,8.6); + ok(!strcmp(buffer," 008.6000e+000"), "failed: %s\n", buffer); + ok( r==14, "return count wrong\n"); + + format = "% 2.4e"; + r = sprintf(buffer, format,-8.6); + ok(!strcmp(buffer,"-8.6000e+000"), "failed: %s\n", buffer); + ok( r==12, "return count wrong\n"); + + format = "%+2.4e"; + r = sprintf(buffer, format,8.6); + ok(!strcmp(buffer,"+8.6000e+000"), "failed: %s\n", buffer); + ok( r==12, "return count wrong\n"); + format = "%2.4g"; r = sprintf(buffer, format,8.6); ok(!strcmp(buffer,"8.6"), "failed\n"); @@ -617,6 +674,41 @@ static void test_sprintf( void ) ok(!strcmp(buffer,"123"), "failed: \"%s\"\n", buffer); r = sprintf(buffer, format, 0x12345); ok(!strcmp(buffer,"2345"), "failed \"%s\"\n", buffer); + + nan = 0.0; + inf = 1.0/nan; + nan = sqrt(-1); + format = "%lf"; + r = sprintf(buffer, format, nan); + ok(r==9, "r = %d\n", r); + ok(!strcmp(buffer, "-1.#IND00"), "failed: \"%s\"\n", buffer); + r = sprintf(buffer, format, inf); + ok(r==8, "r = %d\n", r); + ok(!strcmp(buffer, "1.#INF00"), "failed: \"%s\"\n", buffer); + + format = "%le"; + r = sprintf(buffer, format, nan); + ok(r==14, "r = %d\n", r); + ok(!strcmp(buffer, "-1.#IND00e+000"), "failed: \"%s\"\n", buffer); + r = sprintf(buffer, format, inf); + ok(r==13, "r = %d\n", r); + ok(!strcmp(buffer, "1.#INF00e+000"), "failed: \"%s\"\n", buffer); + + format = "%lg"; + r = sprintf(buffer, format, nan); + ok(r==7, "r = %d\n", r); + ok(!strcmp(buffer, "-1.#IND"), "failed: \"%s\"\n", buffer); + r = sprintf(buffer, format, inf); + ok(r==6, "r = %d\n", r); + ok(!strcmp(buffer, "1.#INF"), "failed: \"%s\"\n", buffer); + + format = "%010.2lf"; + r = sprintf(buffer, format, nan); + ok(r==10, "r = %d\n", r); + ok(!strcmp(buffer, "-000001.#J"), "failed: \"%s\"\n", buffer); + r = sprintf(buffer, format, inf); + ok(r==10, "r = %d\n", r); + ok(!strcmp(buffer, "0000001.#J"), "failed: \"%s\"\n", buffer); } static void test_swprintf( void ) @@ -671,7 +763,9 @@ static void test_snprintf (void) static void test_fprintf(void) { - static char file_name[] = "fprintf.tst"; + static const char file_name[] = "fprintf.tst"; + static const WCHAR utf16_test[] = {'u','n','i','c','o','d','e','\n',0}; + FILE *fp = fopen(file_name, "wb"); char buf[1024]; int ret; @@ -686,6 +780,11 @@ static void test_fprintf(void) ret = ftell(fp); ok(ret == 26, "ftell returned %d\n", ret); + ret = fwprintf(fp, utf16_test); + ok(ret == 8, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 42, "ftell returned %d\n", ret); + fclose(fp); fp = fopen(file_name, "rb"); @@ -700,6 +799,51 @@ static void test_fprintf(void) ok(ret == 26, "ret = %d\n", ret); ok(!memcmp(buf, "contains\0null\n", 14), "buf = %s\n", buf); + memset(buf, 0, sizeof(buf)); + fgets(buf, sizeof(buf), fp); + ret = ftell(fp); + ok(ret == 41, "ret = %d\n", ret); + ok(!memcmp(buf, utf16_test, sizeof(utf16_test)), + "buf = %s\n", wine_dbgstr_w((WCHAR*)buf)); + + fclose(fp); + + fp = fopen(file_name, "wt"); + + ret = fprintf(fp, "simple test\n"); + ok(ret == 12, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 13, "ftell returned %d\n", ret); + + ret = fprintf(fp, "contains%cnull\n", '\0'); + ok(ret == 14, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 28, "ftell returned %d\n", ret); + + ret = fwprintf(fp, utf16_test); + ok(ret == 8, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 37, "ftell returned %d\n", ret); + + fclose(fp); + + fp = fopen(file_name, "rb"); + ret = fscanf(fp, "%[^\n] ", buf); + ok(ret == 1, "ret = %d\n", ret); + ret = ftell(fp); + ok(ret == 13, "ftell returned %d\n", ret); + ok(!strcmp(buf, "simple test\r"), "buf = %s\n", buf); + + fgets(buf, sizeof(buf), fp); + ret = ftell(fp); + ok(ret == 28, "ret = %d\n", ret); + ok(!memcmp(buf, "contains\0null\r\n", 15), "buf = %s\n", buf); + + fgets(buf, sizeof(buf), fp); + ret = ftell(fp); + ok(ret == 37, "ret = %d\n", ret); + ok(!strcmp(buf, "unicode\r\n"), "buf = %s\n", buf); + fclose(fp); unlink(file_name); } @@ -1244,15 +1388,34 @@ static void test_vsprintf_p(void) static void test__get_output_format(void) { unsigned int ret; + char buf[64]; + int c; - if (!p__get_output_format) + if (!p__get_output_format || !p__set_output_format) { - win_skip("_get_output_format not available\n"); + win_skip("_get_output_format or _set_output_format is not available\n"); return; } ret = p__get_output_format(); ok(ret == 0, "got %d\n", ret); + + c = sprintf(buf, "%E", 1.23); + ok(c == 13, "c = %d\n", c); + ok(!strcmp(buf, "1.230000E+000"), "buf = %s\n", buf); + + ret = p__set_output_format(_TWO_DIGIT_EXPONENT); + ok(ret == 0, "got %d\n", ret); + + c = sprintf(buf, "%E", 1.23); + ok(c == 12, "c = %d\n", c); + ok(!strcmp(buf, "1.230000E+00"), "buf = %s\n", buf); + + ret = p__get_output_format(); + ok(ret == _TWO_DIGIT_EXPONENT, "got %d\n", ret); + + ret = p__set_output_format(_TWO_DIGIT_EXPONENT); + ok(ret == _TWO_DIGIT_EXPONENT, "got %d\n", ret); } START_TEST(printf) diff --git a/rostests/winetests/msvcrt/scanf.c b/rostests/winetests/msvcrt/scanf.c index b09e7dfd2d9..97b8074bc02 100644 --- a/rostests/winetests/msvcrt/scanf.c +++ b/rostests/winetests/msvcrt/scanf.c @@ -131,6 +131,13 @@ static void test_sscanf( void ) ok( ret == 1, "Error with format \"%s\"\n","%*[a-cd-dg-e]%c"); ok( buffer[0] == 'h', "Error with \"abcefgdh\" \"%c\"\n", buffer[0]); + buffer1[0] = 'b'; + ret = sscanf("a","%s%s", buffer, buffer1); + ok( ret == 1, "expected 1, got %u\n", ret); + ok( buffer[0] == 'a', "buffer[0] = '%c'\n", buffer[0]); + ok( buffer[1] == '\0', "buffer[1] = '%c'\n", buffer[1]); + ok( buffer1[0] == 'b', "buffer1[0] = '%c'\n", buffer1[0]); + /* check digits */ ret = sprintf(buffer,"%d:%d:%d",hour,min,sec); ok( ret == 8, "expected 8, got %u\n", ret); diff --git a/rostests/winetests/msvcrt/signal.c b/rostests/winetests/msvcrt/signal.c index d33498bd537..ad6ea6ecf90 100644 --- a/rostests/winetests/msvcrt/signal.c +++ b/rostests/winetests/msvcrt/signal.c @@ -26,6 +26,13 @@ static int test_value = 0; static void __cdecl sighandler(int signum) { + void **ret = __pxcptinfoptrs(); + + ok(ret != NULL, "ret = NULL\n"); + if(signum == SIGABRT) + ok(*ret == (void*)0xdeadbeef, "*ret = %p\n", *ret); + else if(signum == SIGSEGV) + ok(*ret == NULL, "*ret = %p\n", *ret); ++test_value; } @@ -42,7 +49,32 @@ static void test_signal(void) ok(test_value == 1, "SIGBREAK handler not invoked\n"); } +static void test___pxcptinfoptrs(void) +{ + void **ret = __pxcptinfoptrs(); + int res; + + ok(ret != NULL, "ret == NULL\n"); + ok(*ret == NULL, "*ret != NULL\n"); + + test_value = 0; + + *ret = (void*)0xdeadbeef; + signal(SIGSEGV, sighandler); + res = raise(SIGSEGV); + ok(res == 0, "failed to raise SIGSEGV\n"); + ok(*ret == (void*)0xdeadbeef, "*ret = %p\n", *ret); + + signal(SIGABRT, sighandler); + res = raise(SIGABRT); + ok(res == 0, "failed to raise SIGBREAK\n"); + ok(*ret == (void*)0xdeadbeef, "*ret = %p\n", *ret); + + ok(test_value == 2, "test_value = %d\n", test_value); +} + START_TEST(signal) { test_signal(); + test___pxcptinfoptrs(); } diff --git a/rostests/winetests/msvcrt/string.c b/rostests/winetests/msvcrt/string.c index d606ebb444c..7d820e1c7df 100644 --- a/rostests/winetests/msvcrt/string.c +++ b/rostests/winetests/msvcrt/string.c @@ -19,8 +19,6 @@ */ #include "wine/test.h" -#include "winbase.h" -#include "winnls.h" #include #include #include @@ -30,6 +28,12 @@ #include #include #include +#include + +/* make it use a definition from string.h */ +#undef strncpy +#include "winbase.h" +#include "winnls.h" static char *buf_to_string(const unsigned char *bin, int len, int nr) { @@ -70,6 +74,8 @@ static int (__cdecl *p_wcsupr_s)(wchar_t *str, size_t size); static size_t (__cdecl *p_strnlen)(const char *, size_t); static __int64 (__cdecl *p_strtoi64)(const char *, char **, int); static unsigned __int64 (__cdecl *p_strtoui64)(const char *, char **, int); +static __int64 (__cdecl *p_wcstoi64)(const wchar_t *, wchar_t **, int); +static unsigned __int64 (__cdecl *p_wcstoui64)(const wchar_t *, wchar_t **, int); static int (__cdecl *pwcstombs_s)(size_t*,char*,size_t,const wchar_t*,size_t); static int (__cdecl *pmbstowcs_s)(size_t*,wchar_t*,size_t,const char*,size_t); static size_t (__cdecl *p_mbsrtowcs)(wchar_t*, const char**, size_t, mbstate_t*); @@ -89,6 +95,7 @@ static size_t (__cdecl *p_wcrtomb)(char*, wchar_t, mbstate_t*); static int (__cdecl *p_tolower)(int); static size_t (__cdecl *p_mbrlen)(const char*, size_t, mbstate_t*); static size_t (__cdecl *p_mbrtowc)(wchar_t*, const char*, size_t, mbstate_t*); +static int (__cdecl *p__atodbl_l)(_CRT_DOUBLE*,char*,_locale_t); #define SETNOFAIL(x,y) x = (void*)GetProcAddress(hMsvcrt,y) #define SET(x,y) SETNOFAIL(x,y); ok(x != NULL, "Export '%s' not found\n", y) @@ -428,9 +435,7 @@ static void test_mbcp(void) expect_eq(_ismbblead(0x84), 1, int, "%d"); expect_eq(_ismbblead(0xd3), 1, int, "%d"); expect_eq(_ismbblead(0xd7), 0, int, "%d"); - todo_wine { - expect_eq(_ismbblead(0xd8), 1, int, "%d"); - } + expect_eq(_ismbblead(0xd8), 1, int, "%d"); expect_eq(_ismbblead(0xd9), 1, int, "%d"); expect_eq(_ismbbtrail(0x30), 0, int, "%d"); @@ -806,23 +811,33 @@ static void test_wcscpy_s(void) return; } + if (p_set_invalid_parameter_handler) + ok(p_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL, + "Invalid parameter handler was already set\n"); + /* Test NULL Dest */ + errno = EBADF; ret = p_wcscpy_s(NULL, 18, szLongText); ok(ret == EINVAL, "p_wcscpy_s expect EINVAL got %d\n", ret); + ok(errno == EINVAL, "expected errno EINVAL got %d\n", errno); /* Test NULL Source */ + errno = EBADF; szDest[0] = 'A'; ret = p_wcscpy_s(szDest, 18, NULL); ok(ret == EINVAL, "expected EINVAL got %d\n", ret); - ok(szDest[0] == 0, "szDest[0] not 0\n"); + ok(errno == EINVAL, "expected errno EINVAL got %d\n", errno); + ok(szDest[0] == 0, "szDest[0] not 0, got %c\n", szDest[0]); /* Test invalid size */ + errno = EBADF; szDest[0] = 'A'; ret = p_wcscpy_s(szDest, 0, szLongText); /* Later versions changed the return value for this case to EINVAL, * and don't modify the result if the dest size is 0. */ ok(ret == ERANGE || ret == EINVAL, "expected ERANGE/EINVAL got %d\n", ret); + ok(errno == ERANGE || errno == EINVAL, "expected errno ERANGE/EINVAL got %d\n", errno); ok(szDest[0] == 0 || ret == EINVAL, "szDest[0] not 0\n"); /* Copy same buffer size */ @@ -831,14 +846,20 @@ static void test_wcscpy_s(void) ok(lstrcmpW(szDest, szLongText) == 0, "szDest != szLongText\n"); /* Copy smaller buffer size */ + errno = EBADF; szDest[0] = 'A'; ret = p_wcscpy_s(szDestShort, 8, szLongText); ok(ret == ERANGE || ret == EINVAL, "expected ERANGE/EINVAL got %d\n", ret); + ok(errno == ERANGE || errno == EINVAL, "expected errno ERANGE/EINVAL got %d\n", errno); ok(szDestShort[0] == 0, "szDestShort[0] not 0\n"); if(!p_wcsncpy_s) { win_skip("wcsncpy_s not found\n"); + + if (p_set_invalid_parameter_handler) + ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, + "Cannot reset invalid parameter handler\n"); return; } @@ -884,6 +905,10 @@ static void test_wcscpy_s(void) ok(ret == STRUNCATE, "expected ERROR_SUCCESS got %d\n", ret); ok(szDestShort[0]=='1' && szDestShort[1]=='1' && szDestShort[2]=='1' && szDestShort[3]=='1', "szDestShort = %s\n", wine_dbgstr_w(szDestShort)); + + if (p_set_invalid_parameter_handler) + ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, + "Cannot reset invalid parameter handler\n"); } static void test__wcsupr_s(void) @@ -1319,6 +1344,26 @@ static void test_strtol(void) ul = strtoul("9223372036854775807L", &e, 0); ok(ul==4294967295ul, "wrong value %u\n", ul); ok(errno == ERANGE, "wrong errno %d\n", errno); + + errno = 0; + ul = strtoul("-2", NULL, 0); + ok(ul == -2, "wrong value %u\n", ul); + ok(errno == 0, "wrong errno %d\n", errno); + + errno = 0; + ul = strtoul("-4294967294", NULL, 0); + ok(ul == 2, "wrong value %u\n", ul); + ok(errno == 0, "wrong errno %d\n", errno); + + errno = 0; + ul = strtoul("-4294967295", NULL, 0); + ok(ul==1, "wrong value %u\n", ul); + ok(errno == 0, "wrong errno %d\n", errno); + + errno = 0; + ul = strtoul("-4294967296", NULL, 0); + ok(ul == 1, "wrong value %u\n", ul); + ok(errno == ERANGE, "wrong errno %d\n", errno); } static void test_strnlen(void) @@ -1590,6 +1635,14 @@ static void test_mbstowcs(void) wOut[4] = '!'; wOut[5] = '\0'; mOut[4] = '!'; mOut[5] = '\0'; + if(pmbstowcs_s) { + /* crashes on some systems */ + errno = 0xdeadbeef; + ret = mbstowcs(wOut, NULL, 4); + ok(ret == -1, "mbstowcs did not return -1\n"); + ok(errno == EINVAL, "errno = %d\n", errno); + } + ret = mbstowcs(NULL, mSimple, 0); ok(ret == 4, "mbstowcs did not return 4\n"); @@ -1840,6 +1893,11 @@ static void test__itoa_s(void) ok(!strcmp(buffer, "-12345678"), "Expected output buffer string to be \"-12345678\", got \"%s\"\n", buffer); + + itoa(100, buffer, 100); + ok(!strcmp(buffer, "10"), + "Expected output buffer string to be \"10\", got \"%s\"\n", buffer); + if (p_set_invalid_parameter_handler) ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, "Cannot reset invalid parameter handler\n"); @@ -2189,6 +2247,24 @@ static void test__mbslwr_s(void) buffer); } +static void test__mbstok(void) +{ + const unsigned char delim[] = "t"; + + char str[] = "!.!test"; + unsigned char *ret; + + strtok(str, "!"); + + ret = _mbstok(NULL, delim); + /* most versions of msvcrt use the same buffer for strtok and _mbstok */ + ok(!ret || broken((char*)ret==str+4), + "_mbstok(NULL, \"t\") = %p, expected NULL (%p)\n", ret, str); + + ret = _mbstok(NULL, delim); + ok(!ret, "_mbstok(NULL, \"t\") = %p, expected NULL\n", ret); +} + static void test__ultoa_s(void) { errno_t ret; @@ -2336,36 +2412,66 @@ static void test_wctomb(void) ret = p_wcrtomb((char*)dst, 0xffff, NULL); ok(ret == -1, "wcrtomb did not return -1\n"); - ok(dst[0] == 0x3f, "dst[0] = %x, expected 0x20\n", dst[0]); + ok(dst[0] == 0x3f, "dst[0] = %x, expected 0x3f\n", dst[0]); setlocale(LC_ALL, "C"); } static void test_tolower(void) { - int ret; + char ch, lch; + int ret, len; + /* test C locale when locale was never changed */ ret = p_tolower(0x41); ok(ret == 0x61, "ret = %x\n", ret); ret = p_tolower(0xF4); ok(ret == 0xF4, "ret = %x\n", ret); + errno = 0xdeadbeef; ret = p_tolower((char)0xF4); - ok(ret==0xF4/*Vista+*/ || ret==(char)0xF4, "ret = %x\n", ret); + todo_wine ok(ret == (char)0xF4, "ret = %x\n", ret); + todo_wine ok(errno == 0xdeadbeef, "errno = %d\n", errno); - /* is it using different locale (CP_ACP) for negative values?? */ - /* current implementation matches msvcr90 behaviour */ + errno = 0xdeadbeef; ret = p_tolower((char)0xD0); - todo_wine ok(ret==0xF0/*Vista+*/ || ret==(char)0xD0, "ret = %x\n", ret); - - ret = p_tolower(0xD0); - ok(ret == 0xD0, "ret = %x\n", ret); + todo_wine ok(ret == (char)0xD0, "ret = %x\n", ret); + todo_wine ok(errno == 0xdeadbeef, "errno = %d\n", errno); + /* test C locale after setting locale */ if(!setlocale(LC_ALL, "us")) { win_skip("skipping tolower tests that depends on locale\n"); return; } + setlocale(LC_ALL, "C"); + + ch = 0xF4; + errno = 0xdeadbeef; + ret = p_tolower(ch); + len = LCMapStringA(0, LCMAP_LOWERCASE, &ch, 1, &lch, 1); + if(len) + ok(ret==(unsigned char)lch || broken(ret==ch)/*WinXP-*/, "ret = %x\n", ret); + else + ok(ret == ch, "ret = %x\n", ret); + if(!len || ret==(unsigned char)lch) + ok(errno == EILSEQ, "errno = %d\n", errno); + + ch = 0xD0; + errno = 0xdeadbeef; + ret = p_tolower(ch); + len = LCMapStringA(0, LCMAP_LOWERCASE, &ch, 1, &lch, 1); + if(len) + ok(ret==(unsigned char)lch || broken(ret==ch)/*WinXP-*/, "ret = %x\n", ret); + else + ok(ret == ch, "ret = %x\n", ret); + if(!len || ret==(unsigned char)lch) + ok(errno == EILSEQ, "errno = %d\n", errno); + + ret = p_tolower(0xD0); + ok(ret == 0xD0, "ret = %x\n", ret); + + ok(setlocale(LC_ALL, "us") != NULL, "setlocale failed\n"); ret = p_tolower((char)0xD0); ok(ret == 0xF0, "ret = %x\n", ret); @@ -2376,6 +2482,194 @@ static void test_tolower(void) setlocale(LC_ALL, "C"); } +static void test__atodbl(void) +{ + _CRT_DOUBLE d; + char num[32]; + int ret; + + if(!p__atodbl_l) { + /* Old versions of msvcrt use different values for _OVERFLOW and _UNDERFLOW + * Because of this lets skip _atodbl tests when _atodbl_l is not available */ + win_skip("_atodbl_l is not available\n"); + return; + } + + num[0] = 0; + ret = p__atodbl_l(&d, num, NULL); + ok(ret == 0, "_atodbl_l(&d, \"\", NULL) returned %d, expected 0\n", ret); + ok(d.x == 0, "d.x = %lf, expected 0\n", d.x); + ret = _atodbl(&d, num); + ok(ret == 0, "_atodbl(&d, \"\") returned %d, expected 0\n", ret); + ok(d.x == 0, "d.x = %lf, expected 0\n", d.x); + + strcpy(num, "t"); + ret = p__atodbl_l(&d, num, NULL); + ok(ret == 0, "_atodbl_l(&d, \"t\", NULL) returned %d, expected 0\n", ret); + ok(d.x == 0, "d.x = %lf, expected 0\n", d.x); + ret = _atodbl(&d, num); + ok(ret == 0, "_atodbl(&d, \"t\") returned %d, expected 0\n", ret); + ok(d.x == 0, "d.x = %lf, expected 0\n", d.x); + + strcpy(num, "0"); + ret = p__atodbl_l(&d, num, NULL); + ok(ret == 0, "_atodbl_l(&d, \"0\", NULL) returned %d, expected 0\n", ret); + ok(d.x == 0, "d.x = %lf, expected 0\n", d.x); + ret = _atodbl(&d, num); + ok(ret == 0, "_atodbl(&d, \"0\") returned %d, expected 0\n", ret); + ok(d.x == 0, "d.x = %lf, expected 0\n", d.x); + + strcpy(num, "123"); + ret = p__atodbl_l(&d, num, NULL); + ok(ret == 0, "_atodbl_l(&d, \"123\", NULL) returned %d, expected 0\n", ret); + ok(d.x == 123, "d.x = %lf, expected 123\n", d.x); + ret = _atodbl(&d, num); + ok(ret == 0, "_atodbl(&d, \"123\") returned %d, expected 0\n", ret); + ok(d.x == 123, "d.x = %lf, expected 123\n", d.x); + + strcpy(num, "1e-309"); + ret = p__atodbl_l(&d, num, NULL); + ok(ret == _UNDERFLOW, "_atodbl_l(&d, \"1e-309\", NULL) returned %d, expected _UNDERFLOW\n", ret); + ok(d.x!=0 && almost_equal(d.x, 0), "d.x = %le, expected 0\n", d.x); + ret = _atodbl(&d, num); + ok(ret == _UNDERFLOW, "_atodbl(&d, \"1e-309\") returned %d, expected _UNDERFLOW\n", ret); + ok(d.x!=0 && almost_equal(d.x, 0), "d.x = %le, expected 0\n", d.x); + + strcpy(num, "1e309"); + ret = p__atodbl_l(&d, num, NULL); + ok(ret == _OVERFLOW, "_atodbl_l(&d, \"1e309\", NULL) returned %d, expected _OVERFLOW\n", ret); + ret = _atodbl(&d, num); + ok(ret == _OVERFLOW, "_atodbl(&d, \"1e309\") returned %d, expected _OVERFLOW\n", ret); +} + +static void test__stricmp(void) +{ + int ret; + + ret = _stricmp("test", "test"); + ok(ret == 0, "_stricmp returned %d\n", ret); + ret = _stricmp("a", "z"); + ok(ret < 0, "_stricmp returned %d\n", ret); + ret = _stricmp("z", "a"); + ok(ret > 0, "_stricmp returned %d\n", ret); + ret = _stricmp("\xa5", "\xb9"); + ok(ret < 0, "_stricmp returned %d\n", ret); + + if(!setlocale(LC_ALL, "polish")) { + win_skip("stricmp tests\n"); + return; + } + + ret = _stricmp("test", "test"); + ok(ret == 0, "_stricmp returned %d\n", ret); + ret = _stricmp("a", "z"); + ok(ret < 0, "_stricmp returned %d\n", ret); + ret = _stricmp("z", "a"); + ok(ret > 0, "_stricmp returned %d\n", ret); + ret = _stricmp("\xa5", "\xb9"); + ok(ret == 0, "_stricmp returned %d\n", ret); + + setlocale(LC_ALL, "C"); +} + +static void test__wcstoi64(void) +{ + static const WCHAR digit[] = { '9', 0 }; + static const WCHAR stock[] = { 0x3231, 0 }; /* PARENTHESIZED IDEOGRAPH STOCK */ + static const WCHAR tamil[] = { 0x0bef, 0 }; /* TAMIL DIGIT NINE */ + static const WCHAR thai[] = { 0x0e59, 0 }; /* THAI DIGIT NINE */ + static const WCHAR fullwidth[] = { 0xff19, 0 }; /* FULLWIDTH DIGIT NINE */ + static const WCHAR hex[] = { 0xff19, 'f', 0x0e59, 0xff46, 0 }; + + __int64 res; + unsigned __int64 ures; + WCHAR *endpos; + + if (!p_wcstoi64 || !p_wcstoui64) { + win_skip("_wcstoi64 or _wcstoui64 not found\n"); + return; + } + + res = p_wcstoi64(digit, NULL, 10); + ok(res == 9, "res != 9\n"); + res = p_wcstoi64(stock, &endpos, 10); + ok(res == 0, "res != 0\n"); + ok(endpos == stock, "Incorrect endpos (%p-%p)\n", stock, endpos); + res = p_wcstoi64(tamil, &endpos, 10); + ok(res == 0, "res != 0\n"); + ok(endpos == tamil, "Incorrect endpos (%p-%p)\n", tamil, endpos); + res = p_wcstoi64(thai, NULL, 10); + todo_wine ok(res == 9, "res != 9\n"); + res = p_wcstoi64(fullwidth, NULL, 10); + todo_wine ok(res == 9, "res != 9\n"); + res = p_wcstoi64(hex, NULL, 16); + todo_wine ok(res == 0x9f9, "res != 0x9f9\n"); + + ures = p_wcstoui64(digit, NULL, 10); + ok(ures == 9, "ures != 9\n"); + ures = p_wcstoui64(stock, &endpos, 10); + ok(ures == 0, "ures != 0\n"); + ok(endpos == stock, "Incorrect endpos (%p-%p)\n", stock, endpos); + ures = p_wcstoui64(tamil, &endpos, 10); + ok(ures == 0, "ures != 0\n"); + ok(endpos == tamil, "Incorrect endpos (%p-%p)\n", tamil, endpos); + ures = p_wcstoui64(thai, NULL, 10); + todo_wine ok(ures == 9, "ures != 9\n"); + ures = p_wcstoui64(fullwidth, NULL, 10); + todo_wine ok(ures == 9, "ures != 9\n"); + ures = p_wcstoui64(hex, NULL, 16); + todo_wine ok(ures == 0x9f9, "ures != 0x9f9\n"); + + return; +} + +static void test_atoi(void) +{ + int r; + + r = atoi("0"); + ok(r == 0, "atoi(0) = %d\n", r); + + r = atoi("-1"); + ok(r == -1, "atoi(-1) = %d\n", r); + + r = atoi("1"); + ok(r == 1, "atoi(1) = %d\n", r); + + r = atoi("4294967296"); + ok(r == 0, "atoi(4294967296) = %d\n", r); +} + +static void test_strncpy(void) +{ +#define TEST_STRNCPY_LEN 10 + char *ret; + char dst[TEST_STRNCPY_LEN + 1]; + char not_null_terminated[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}; + + /* strlen(src) > TEST_STRNCPY_LEN */ + ret = strncpy(dst, "01234567890123456789", TEST_STRNCPY_LEN); + ok(ret == dst, "ret != dst\n"); + ok(!strncmp(dst, "0123456789", TEST_STRNCPY_LEN), "dst != 0123456789\n"); + + /* without null-terminated */ + ret = strncpy(dst, not_null_terminated, TEST_STRNCPY_LEN); + ok(ret == dst, "ret != dst\n"); + ok(!strncmp(dst, "0123456789", TEST_STRNCPY_LEN), "dst != 0123456789\n"); + + /* strlen(src) < TEST_STRNCPY_LEN */ + strcpy(dst, "0123456789"); + ret = strncpy(dst, "012345", TEST_STRNCPY_LEN); + ok(ret == dst, "ret != dst\n"); + ok(!strcmp(dst, "012345"), "dst != 012345\n"); + ok(dst[TEST_STRNCPY_LEN - 1] == '\0', "dst[TEST_STRNCPY_LEN - 1] != 0\n"); + + /* strlen(src) == TEST_STRNCPY_LEN */ + ret = strncpy(dst, "0123456789", TEST_STRNCPY_LEN); + ok(ret == dst, "ret != dst\n"); + ok(!strncmp(dst, "0123456789", TEST_STRNCPY_LEN), "dst != 0123456789\n"); +} + START_TEST(string) { char mem[100]; @@ -2403,6 +2697,8 @@ START_TEST(string) p_strnlen = (void *)GetProcAddress( hMsvcrt,"strnlen" ); p_strtoi64 = (void *)GetProcAddress(hMsvcrt, "_strtoi64"); p_strtoui64 = (void *)GetProcAddress(hMsvcrt, "_strtoui64"); + p_wcstoi64 = (void *)GetProcAddress(hMsvcrt, "_wcstoi64"); + p_wcstoui64 = (void *)GetProcAddress(hMsvcrt, "_wcstoui64"); pmbstowcs_s = (void *)GetProcAddress(hMsvcrt, "mbstowcs_s"); pwcstombs_s = (void *)GetProcAddress(hMsvcrt, "wcstombs_s"); pwcsrtombs = (void *)GetProcAddress(hMsvcrt, "wcsrtombs"); @@ -2420,6 +2716,7 @@ START_TEST(string) p_mbrlen = (void*)GetProcAddress(hMsvcrt, "mbrlen"); p_mbrtowc = (void*)GetProcAddress(hMsvcrt, "mbrtowc"); p_mbsrtowcs = (void*)GetProcAddress(hMsvcrt, "mbsrtowcs"); + p__atodbl_l = (void*)GetProcAddress(hMsvcrt, "_atodbl_l"); /* MSVCRT memcpy behaves like memmove for overlapping moves, MFC42 CString::Insert seems to rely on that behaviour */ @@ -2429,15 +2726,12 @@ START_TEST(string) ok(pmemcmp(mem+5,xilstring, nLen) == 0, "Got result %s\n",mem+5); - /* Test _swab function */ + /* run tolower tests first */ + test_tolower(); test_swab(); - - /* Test ismbblead*/ test_mbcp(); - /* test _mbsspn */ test_mbsspn(); test_mbsspnp(); - /* test _strdup */ test_strdup(); test_strcpy_s(); test_memcpy_s(); @@ -2450,6 +2744,7 @@ START_TEST(string) test_mbctombb(); test_ismbclegal(); test_strtok(); + test__mbstok(); test_wcscpy_s(); test__wcsupr_s(); test_strtol(); @@ -2468,5 +2763,9 @@ START_TEST(string) test__mbslwr_s(); test_wctob(); test_wctomb(); - test_tolower(); + test__atodbl(); + test__stricmp(); + test__wcstoi64(); + test_atoi(); + test_strncpy(); } diff --git a/rostests/winetests/msvcrt/testlist.c b/rostests/winetests/msvcrt/testlist.c index a4d020fe124..7a62c633441 100644 --- a/rostests/winetests/msvcrt/testlist.c +++ b/rostests/winetests/msvcrt/testlist.c @@ -1,10 +1,7 @@ /* Automatically generated file; DO NOT EDIT!! */ -#define WIN32_LEAN_AND_MEAN -#include - #define STANDALONE -#include "wine/test.h" +#include extern void func_cpp(void); extern void func_data(void); diff --git a/rostests/winetests/msvcrt/time.c b/rostests/winetests/msvcrt/time.c index c6e2a9cd31a..71e58bac69c 100644 --- a/rostests/winetests/msvcrt/time.c +++ b/rostests/winetests/msvcrt/time.c @@ -46,13 +46,15 @@ static errno_t (__cdecl *p_localtime32_s)(struct tm*, __time32_t*); static errno_t (__cdecl *p_localtime64_s)(struct tm*, __time64_t*); static int* (__cdecl *p__daylight)(void); static int* (__cdecl *p___p__daylight)(void); +static long* (__cdecl *p___p__dstbias)(void); +static long* (__cdecl *p___p__timezone)(void); static size_t (__cdecl *p_strftime)(char *, size_t, const char *, const struct tm *); static size_t (__cdecl *p_wcsftime)(wchar_t *, size_t, const wchar_t *, const struct tm *); static char* (__cdecl *p_asctime)(const struct tm *); static void init(void) { - HMODULE hmod = LoadLibrary("msvcrt.dll"); + HMODULE hmod = LoadLibraryA("msvcrt.dll"); p_gmtime32 = (void*)GetProcAddress(hmod, "_gmtime32"); p_gmtime = (void*)GetProcAddress(hmod, "gmtime"); @@ -64,6 +66,8 @@ static void init(void) p_localtime64_s = (void*)GetProcAddress(hmod, "_localtime64_s"); p__daylight = (void*)GetProcAddress(hmod, "__daylight"); p___p__daylight = (void*)GetProcAddress(hmod, "__p__daylight"); + p___p__dstbias = (void*)GetProcAddress(hmod, "__p__dstbias"); + p___p__timezone = (void*)GetProcAddress(hmod, "__p__timezone"); p_strftime = (void*)GetProcAddress(hmod, "strftime"); p_wcsftime = (void*)GetProcAddress(hmod, "wcsftime"); p_asctime = (void*)GetProcAddress(hmod, "asctime"); @@ -105,7 +109,7 @@ static void test_gmtime(void) gmt = -1; gmt_tm = p_gmtime32(&gmt); - ok(gmt_tm == NULL, "gmt_tm != NULL\n"); + ok(gmt_tm==NULL || broken(gmt_tm->tm_year==70 && gmt_tm->tm_sec<0), "gmt_tm != NULL\n"); gmt = valid = 0; gmt_tm = p_gmtime32(&gmt); @@ -177,9 +181,12 @@ static void test_gmtime(void) errno = 0; gmt = -1; err = p_gmtime32_s(&gmt_tm_s, &gmt); - ok(err == EINVAL, "err = %d\n", err); - ok(errno == EINVAL, "errno = %d\n", errno); - ok(gmt_tm_s.tm_year == -1, "tm_year = %d\n", gmt_tm_s.tm_year); + ok(gmt_tm_s.tm_year == -1 || broken(gmt_tm_s.tm_year == 70 && gmt_tm_s.tm_sec < 0), + "tm_year = %d, tm_sec = %d\n", gmt_tm_s.tm_year, gmt_tm_s.tm_sec); + if(gmt_tm_s.tm_year == -1) { + ok(err==EINVAL, "err = %d\n", err); + ok(errno==EINVAL, "errno = %d\n", errno); + } } static void test_mktime(void) @@ -804,10 +811,68 @@ static void test_asctime(void) ok(errno==EINVAL || broken(errno==0xdeadbeef), "errno = %d\n", errno); } +static void test__tzset(void) +{ + char TZ_env[256]; + int ret; + + if(!p___p__daylight || !p___p__timezone || !p___p__dstbias) { + win_skip("__p__daylight, __p__timezone or __p__dstbias is not available\n"); + return; + } + + _snprintf(TZ_env,255,"TZ=%s",(getenv("TZ")?getenv("TZ"):"")); + + ret = *p___p__daylight(); + ok(ret == 1, "*__p__daylight() = %d\n", ret); + ret = *p___p__timezone(); + ok(ret == 28800, "*__p__timezone() = %d\n", ret); + ret = *p___p__dstbias(); + ok(ret == -3600, "*__p__dstbias() = %d\n", ret); + + _putenv("TZ=xxx+1yyy"); + _tzset(); + ret = *p___p__daylight(); + ok(ret == 121, "*__p__daylight() = %d\n", ret); + ret = *p___p__timezone(); + ok(ret == 3600, "*__p__timezone() = %d\n", ret); + ret = *p___p__dstbias(); + ok(ret == -3600, "*__p__dstbias() = %d\n", ret); + + *p___p__dstbias() = 0; + _putenv("TZ=xxx+1:3:5zzz"); + _tzset(); + ret = *p___p__daylight(); + ok(ret == 122, "*__p__daylight() = %d\n", ret); + ret = *p___p__timezone(); + ok(ret == 3785, "*__p__timezone() = %d\n", ret); + ret = *p___p__dstbias(); + ok(ret == 0, "*__p__dstbias() = %d\n", ret); + + _putenv(TZ_env); +} + +static void test_clock(void) +{ + static const int THRESH = 50; + clock_t s, e; + int i; + + for (i = 0; i < 10; i++) + { + s = clock(); + Sleep(1000); + e = clock(); + + ok(abs((e-s) - 1000) < THRESH, "clock off on loop %i: %i\n", i, e-s); + } +} + START_TEST(time) { init(); + test__tzset(); test_strftime(); test_ctime(); test_gmtime(); @@ -821,4 +886,5 @@ START_TEST(time) test_localtime64_s(); test_daylight(); test_asctime(); + test_clock(); } From 842c3e00d09b1aa0e87f7c73c690dcc7a2be300a Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 13:14:11 +0000 Subject: [PATCH 409/419] [MSVCRT_WINETEST] * Fix *nix build. svn path=/trunk/; revision=62837 --- rostests/winetests/msvcrt/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rostests/winetests/msvcrt/CMakeLists.txt b/rostests/winetests/msvcrt/CMakeLists.txt index 5e0d8480412..1d9d73c1d54 100644 --- a/rostests/winetests/msvcrt/CMakeLists.txt +++ b/rostests/winetests/msvcrt/CMakeLists.txt @@ -1,5 +1,7 @@ -add_definitions(-D__msvcrt_ulong=ULONG) +add_definitions( + -D_CRT_NONSTDC_NO_DEPRECATE + -D__msvcrt_ulong=ULONG) list(APPEND SOURCE cpp.c From aa2170e490b9a6d0fef3c3a0597f1a7970ec086a Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 13:19:24 +0000 Subject: [PATCH 410/419] [SHELL32_WINETEST] * Sync with Wine 1.7.17. * Speedup build. CORE-8080 svn path=/trunk/; revision=62838 --- rostests/winetests/shell32/CMakeLists.txt | 9 +- rostests/winetests/shell32/appbar.c | 13 +- rostests/winetests/shell32/assoc.c | 121 ++++++- rostests/winetests/shell32/autocomplete.c | 4 +- rostests/winetests/shell32/brsfolder.c | 66 ++-- rostests/winetests/shell32/ebrowser.c | 64 ++-- rostests/winetests/shell32/msg.h | 2 +- rostests/winetests/shell32/progman_dde.c | 16 +- rostests/winetests/shell32/shelllink.c | 217 +++++++++++-- rostests/winetests/shell32/shellole.c | 314 ++++++++++++++++++ rostests/winetests/shell32/shellpath.c | 48 +-- rostests/winetests/shell32/shlexec.c | 347 +++++++++++--------- rostests/winetests/shell32/shlfileop.c | 377 +++++++++++++++------- rostests/winetests/shell32/shlfolder.c | 78 +++-- rostests/winetests/shell32/string.c | 5 +- rostests/winetests/shell32/systray.c | 8 +- rostests/winetests/shell32/testlist.c | 5 +- 17 files changed, 1232 insertions(+), 462 deletions(-) diff --git a/rostests/winetests/shell32/CMakeLists.txt b/rostests/winetests/shell32/CMakeLists.txt index 6f2663fc34f..e42a50c43bb 100644 --- a/rostests/winetests/shell32/CMakeLists.txt +++ b/rostests/winetests/shell32/CMakeLists.txt @@ -1,8 +1,6 @@ remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) -add_definitions(-D__ROS_LONG64__) - list(APPEND SOURCE appbar.c assoc.c @@ -27,7 +25,10 @@ list(APPEND SOURCE rsrc.rc) add_executable(shell32_winetest ${SOURCE}) -target_link_libraries(shell32_winetest wine uuid) +target_link_libraries(shell32_winetest uuid) set_module_type(shell32_winetest win32cui) -add_importlibs(shell32_winetest shell32 ole32 oleaut32 user32 advapi32 msvcrt kernel32 ntdll) +add_importlibs(shell32_winetest shell32 ole32 oleaut32 user32 advapi32 msvcrt kernel32) +if(MSVC) + add_importlibs(shell32_winetest ntdll) +endif() add_cd_file(TARGET shell32_winetest DESTINATION reactos/bin FOR all) diff --git a/rostests/winetests/shell32/appbar.c b/rostests/winetests/shell32/appbar.c index 2bba332eed0..7675493747e 100644 --- a/rostests/winetests/shell32/appbar.c +++ b/rostests/winetests/shell32/appbar.c @@ -20,6 +20,7 @@ #include #include +#include "shellapi.h" #include "wine/test.h" @@ -47,7 +48,7 @@ static int expected_bottom; static void testwindow_setpos(HWND hwnd) { - struct testwindow_info* info = (struct testwindow_info*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + struct testwindow_info* info = (struct testwindow_info*)GetWindowLongPtrA(hwnd, GWLP_USERDATA); APPBARDATA abd; BOOL ret; @@ -113,7 +114,7 @@ static LRESULT CALLBACK testwindow_wndproc(HWND hwnd, UINT msg, WPARAM wparam, L } } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } /* process pending messages until a condition is true or 3 seconds pass */ @@ -185,7 +186,7 @@ static void register_testwindow_class(void) cls.style = 0; cls.lpfnWndProc = testwindow_wndproc; cls.hInstance = NULL; - cls.hCursor = LoadCursor(0, IDC_ARROW); + cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW); cls.hbrBackground = (HBRUSH) COLOR_WINDOW; cls.lpszClassName = testwindow_class; @@ -234,7 +235,7 @@ static void test_setpos(void) windows[0].desired_rect.right = screen_width; windows[0].desired_rect.top = screen_height - 15; windows[0].desired_rect.bottom = screen_height; - SetWindowLongPtr(windows[0].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[0]); + SetWindowLongPtrA(windows[0].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[0]); testwindow_setpos(windows[0].hwnd); do_events(); @@ -255,7 +256,7 @@ static void test_setpos(void) windows[1].desired_rect.right = screen_width; windows[1].desired_rect.top = screen_height - 10; windows[1].desired_rect.bottom = screen_height; - SetWindowLongPtr(windows[1].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[1]); + SetWindowLongPtrA(windows[1].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[1]); testwindow_setpos(windows[1].hwnd); /* the windows are adjusted to they don't overlap */ @@ -287,7 +288,7 @@ static void test_setpos(void) windows[2].desired_rect.right = screen_width; windows[2].desired_rect.top = screen_height - 10; windows[2].desired_rect.bottom = screen_height; - SetWindowLongPtr(windows[2].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[2]); + SetWindowLongPtrA(windows[2].hwnd, GWLP_USERDATA, (LONG_PTR)&windows[2]); testwindow_setpos(windows[2].hwnd); do_events_until(no_appbars_intersect); diff --git a/rostests/winetests/shell32/assoc.c b/rostests/winetests/shell32/assoc.c index 29524dc601a..ff999e98dc7 100644 --- a/rostests/winetests/shell32/assoc.c +++ b/rostests/winetests/shell32/assoc.c @@ -35,13 +35,8 @@ static void test_IQueryAssociations_QueryInterface(void) IUnknown *unk; HRESULT hr; - /* this works since XP */ hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&qa); - - if (FAILED(hr)) { - win_skip("CoCreateInstance for IQueryAssociations returned 0x%x\n", hr); - return; - } + ok(hr == S_OK, "got 0x%08x\n", hr); hr = IQueryAssociations_QueryInterface(qa, &IID_IQueryAssociations, (void**)&qa2); ok(hr == S_OK, "QueryInterface (IQueryAssociations) returned 0x%x\n", hr); @@ -97,12 +92,124 @@ static void test_IApplicationAssociationRegistration_QueryInterface(void) IApplicationAssociationRegistration_Release(appreg); } +struct assoc_getstring_test +{ + const WCHAR *key; + ASSOCF flags; + ASSOCSTR str; + DWORD len; + HRESULT hr; + HRESULT brokenhr; +}; + +static const WCHAR httpW[] = {'h','t','t','p',0}; +static const WCHAR httpsW[] = {'h','t','t','p','s',0}; +static const WCHAR badW[] = {'b','a','d','b','a','d',0}; + +static struct assoc_getstring_test getstring_tests[] = +{ + { httpW, 0, ASSOCSTR_EXECUTABLE, 2, 0x8007007a /* E_NOT_SUFFICIENT_BUFFER */, S_OK }, + { httpW, ASSOCF_NOTRUNCATE, ASSOCSTR_EXECUTABLE, 2, E_POINTER }, + { NULL } +}; + +static void test_IQueryAssociations_GetString(void) +{ + struct assoc_getstring_test *ptr = getstring_tests; + IQueryAssociations *assoc; + HRESULT hr; + DWORD len; + int i = 0; + + hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc); + ok(hr == S_OK, "failed to create object, 0x%x\n", hr); + + hr = IQueryAssociations_Init(assoc, 0, httpW, NULL, NULL); + ok(hr == S_OK, "Init failed, 0x%x\n", hr); + + len = 0; + hr = IQueryAssociations_GetString(assoc, 0, ASSOCSTR_EXECUTABLE, NULL, NULL, &len); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + ok(len > 0, "got wrong needed length, %d\n", len); + + while (ptr->key) + { + WCHAR buffW[MAX_PATH]; + DWORD len; + + hr = IQueryAssociations_Init(assoc, 0, ptr->key, NULL, NULL); + ok(hr == S_OK, "%d: Init failed, 0x%x\n", i, hr); + + len = ptr->len; + buffW[0] = ptr->flags & ASSOCF_NOTRUNCATE ? 0x1 : 0; + hr = IQueryAssociations_GetString(assoc, ptr->flags, ptr->str, NULL, buffW, &len); + if (hr != ptr->hr) + ok(broken(hr == ptr->brokenhr), "%d: GetString failed, 0x%08x\n", i, hr); + else + { + ok(hr == ptr->hr, "%d: GetString failed, 0x%08x\n", i, hr); + ok(len > ptr->len, "%d: got needed length %d\n", i, len); + } + + /* even with ASSOCF_NOTRUNCATE it's null terminated */ + if ((ptr->flags & ASSOCF_NOTRUNCATE) && (ptr->len > 0)) + ok(buffW[0] == 0 || broken(buffW[0] == 0x1) /* pre win7 */, "%d: got %x\n", i, buffW[0]); + + if (!(ptr->flags & ASSOCF_NOTRUNCATE) && ptr->len && FAILED(ptr->hr)) + ok(buffW[0] != 0, "%d: got %x\n", i, buffW[0]); + + i++; + ptr++; + } + + IQueryAssociations_Release(assoc); +} + +static void test_IQueryAssociations_Init(void) +{ + IQueryAssociations *assoc; + HRESULT hr; + DWORD len; + + hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&assoc); + ok(hr == S_OK, "failed to create object, 0x%x\n", hr); + + hr = IQueryAssociations_Init(assoc, 0, NULL, NULL, NULL); + ok(hr == E_INVALIDARG, "Init failed, 0x%08x\n", hr); + + hr = IQueryAssociations_Init(assoc, 0, httpW, NULL, NULL); + ok(hr == S_OK, "Init failed, 0x%08x\n", hr); + + hr = IQueryAssociations_Init(assoc, 0, badW, NULL, NULL); + ok(hr == S_OK || broken(hr == S_FALSE) /* pre-vista */, "Init failed, 0x%08x\n", hr); + + len = 0; + hr = IQueryAssociations_GetString(assoc, 0, ASSOCSTR_EXECUTABLE, NULL, NULL, &len); + ok(hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) || broken(hr == E_FAIL) /* pre-vista */, "got 0x%08x\n", hr); + + IQueryAssociations_Release(assoc); +} START_TEST(assoc) { + IQueryAssociations *qa; + HRESULT hr; + CoInitialize(NULL); - test_IQueryAssociations_QueryInterface(); + /* this works since XP */ + hr = CoCreateInstance(&CLSID_QueryAssociations, NULL, CLSCTX_INPROC_SERVER, &IID_IQueryAssociations, (void*)&qa); + if (hr == S_OK) + { + test_IQueryAssociations_QueryInterface(); + test_IQueryAssociations_GetString(); + test_IQueryAssociations_Init(); + + IQueryAssociations_Release(qa); + } + else + win_skip("IQueryAssociations not supported, 0x%x\n", hr); + test_IApplicationAssociationRegistration_QueryInterface(); CoUninitialize(); diff --git a/rostests/winetests/shell32/autocomplete.c b/rostests/winetests/shell32/autocomplete.c index 5ff88479c1a..63a2eb2b11e 100644 --- a/rostests/winetests/shell32/autocomplete.c +++ b/rostests/winetests/shell32/autocomplete.c @@ -194,7 +194,7 @@ static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa switch(msg) { case WM_CREATE: /* create edit control */ - hEdit = CreateWindowEx(0, "EDIT", "Some text", 0, 10, 10, 300, 300, + hEdit = CreateWindowExA(0, "EDIT", "Some text", 0, 10, 10, 300, 300, hWnd, NULL, hinst, NULL); ok(hEdit != NULL, "Can't create edit control\n"); break; @@ -214,7 +214,7 @@ static void createMainWnd(void) wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; - wc.hCursor = LoadCursorA(NULL, IDC_IBEAM); + wc.hCursor = LoadCursorA(NULL, (LPSTR)IDC_IBEAM); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = "MyTestWnd"; diff --git a/rostests/winetests/shell32/brsfolder.c b/rostests/winetests/shell32/brsfolder.c index f8e8e16a554..0ef5bb15fe4 100644 --- a/rostests/winetests/shell32/brsfolder.c +++ b/rostests/winetests/shell32/brsfolder.c @@ -18,10 +18,14 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ + +#define COBJMACROS + #include #include #include #include +#include "shellapi.h" #include "wine/test.h" #define IDD_MAKENEWFOLDER 0x3746 /* From "../shresdef.h" */ @@ -37,13 +41,13 @@ static int get_number_of_folders(LPCSTR path) { int number_of_folders = 0; char path_search_string[MAX_PATH]; - WIN32_FIND_DATA find_data; + WIN32_FIND_DATAA find_data; HANDLE find_handle; - strncpy(path_search_string, path, MAX_PATH); + lstrcpynA(path_search_string, path, MAX_PATH); strncat(path_search_string, "*", 1); - find_handle = FindFirstFile(path_search_string, &find_data); + find_handle = FindFirstFileA(path_search_string, &find_data); if (find_handle == INVALID_HANDLE_VALUE) return -1; @@ -56,7 +60,7 @@ static int get_number_of_folders(LPCSTR path) number_of_folders++; } } - while (FindNextFile(find_handle, &find_data) != 0); + while (FindNextFileA(find_handle, &find_data) != 0); FindClose(find_handle); return number_of_folders; @@ -81,11 +85,11 @@ static void CALLBACK make_new_folder_timer_callback(HWND hwnd, UINT uMsg, { case 0: /* Click "Make New Folder" button */ - PostMessage(hwnd, WM_COMMAND, IDD_MAKENEWFOLDER, 0); + PostMessageA(hwnd, WM_COMMAND, IDD_MAKENEWFOLDER, 0); break; case 1: /* Set the new folder name to foo by replacing text in edit control */ - SendMessage(GetFocus(), EM_REPLACESEL, 0, (LPARAM) new_folder_name); + SendMessageA(GetFocus(), EM_REPLACESEL, 0, (LPARAM) new_folder_name); SetFocus(hwnd); break; case 2: @@ -104,7 +108,7 @@ static void CALLBACK make_new_folder_timer_callback(HWND hwnd, UINT uMsg, case 4: KillTimer(hwnd, idEvent); /* Close dialog box */ - SendMessage(hwnd, WM_COMMAND, IDOK, 0); + SendMessageA(hwnd, WM_COMMAND, IDOK, 0); break; default: break; @@ -150,7 +154,7 @@ static int CALLBACK create_new_folder_callback(HWND hwnd, UINT uMsg, static void test_click_make_new_folder_button(void) { HRESULT resCoInit, hr; - BROWSEINFO bi; + BROWSEINFOA bi; LPITEMIDLIST pidl = NULL; LPITEMIDLIST test_folder_pidl; IShellFolder *test_folder_object; @@ -161,7 +165,7 @@ static void test_click_make_new_folder_button(void) char selected_folder[MAX_PATH]; const CHAR title[] = "test_click_make_new_folder_button"; int number_of_folders = -1; - SHFILEOPSTRUCT shfileop; + SHFILEOPSTRUCTA shfileop; if (does_folder_or_file_exist(title)) { @@ -195,8 +199,8 @@ static void test_click_make_new_folder_button(void) /* Initialize browse info struct for SHBrowseForFolder */ bi.hwndOwner = NULL; - bi.pszDisplayName = (LPTSTR) &selected_folder; - bi.lpszTitle = (LPTSTR) title; + bi.pszDisplayName = selected_folder; + bi.lpszTitle = title; bi.ulFlags = BIF_NEWDIALOGSTYLE; bi.lpfn = create_new_folder_callback; /* Use test folder as the root folder for dialog box */ @@ -213,7 +217,7 @@ static void test_click_make_new_folder_button(void) bi.pidlRoot = test_folder_pidl; /* Display dialog box and let callback click the buttons */ - pidl = SHBrowseForFolder(&bi); + pidl = SHBrowseForFolderA(&bi); number_of_folders = get_number_of_folders(test_folder_path); ok(number_of_folders == 1 || broken(number_of_folders == 0) /* W95, W98 */, @@ -242,7 +246,7 @@ static void test_click_make_new_folder_button(void) shfileop.pFrom = test_folder_path; shfileop.pTo = NULL; shfileop.fFlags = FOF_NOCONFIRMATION|FOF_NOERRORUI|FOF_SILENT; - SHFileOperation(&shfileop); + SHFileOperationA(&shfileop); if (pidl) CoTaskMemFree(pidl); @@ -265,47 +269,47 @@ static int CALLBACK selection_callback(HWND hwnd, UINT uMsg, LPARAM lParam, LPAR { case BFFM_INITIALIZED: /* test with zero values */ - ret = SendMessage(hwnd, BFFM_SETSELECTIONA, 0, 0); + ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 0, 0); ok(!ret, "SendMessage returned: %u\n", ret); - ret = SendMessage(hwnd, BFFM_SETSELECTIONW, 0, 0); + ret = SendMessageA(hwnd, BFFM_SETSELECTIONW, 0, 0); ok(!ret, "SendMessage returned: %u\n", ret); - ret = SendMessage(hwnd, BFFM_SETSELECTIONA, 1, 0); + ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 1, 0); ok(!ret, "SendMessage returned: %u\n", ret); if(0) { /* Crashes on NT4 */ - ret = SendMessage(hwnd, BFFM_SETSELECTIONW, 1, 0); + ret = SendMessageA(hwnd, BFFM_SETSELECTIONW, 1, 0); ok(!ret, "SendMessage returned: %u\n", ret); } - ret = SendMessage(hwnd, BFFM_SETSELECTIONA, 0, (LPARAM)selected_folder_pidl); + ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 0, (LPARAM)selected_folder_pidl); ok(!ret, "SendMessage returned: %u\n", ret); - ret = SendMessage(hwnd, BFFM_SETSELECTIONW, 0, (LPARAM)selected_folder_pidl); + ret = SendMessageW(hwnd, BFFM_SETSELECTIONW, 0, (LPARAM)selected_folder_pidl); ok(!ret, "SendMessage returned: %u\n", ret); - ret = SendMessage(hwnd, BFFM_SETSELECTIONA, 1, (LPARAM)selected_folder_pidl); + ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 1, (LPARAM)selected_folder_pidl); ok(!ret, "SendMessage returned: %u\n", ret); - ret = SendMessage(hwnd, BFFM_SETSELECTIONW, 1, (LPARAM)selected_folder_pidl); + ret = SendMessageW(hwnd, BFFM_SETSELECTIONW, 1, (LPARAM)selected_folder_pidl); ok(!ret, "SendMessage returned: %u\n", ret); - ret = SendMessage(hwnd, BFFM_SETSELECTIONA, 1, (LPARAM)new_folder_name); + ret = SendMessageA(hwnd, BFFM_SETSELECTIONA, 1, (LPARAM)new_folder_name); ok(!ret, "SendMessage returned: %u\n", ret); - ret = SendMessage(hwnd, BFFM_SETSELECTIONW, 1, (LPARAM)new_folder_name); + ret = SendMessageW(hwnd, BFFM_SETSELECTIONW, 1, (LPARAM)new_folder_name); ok(!ret, "SendMessage returned: %u\n", ret); - SendMessage(hwnd, WM_COMMAND, IDOK, 0); - return TRUE; + SendMessageA(hwnd, WM_COMMAND, IDOK, 0); + return 1; default: - return FALSE; + return 0; } } static void test_selection(void) { HRESULT resCoInit, hr; - BROWSEINFO bi; + BROWSEINFOA bi; LPITEMIDLIST pidl = NULL; IShellFolder *desktop_object; WCHAR selected_folderW[MAX_PATH]; @@ -326,7 +330,7 @@ static void test_selection(void) /* Initialize browse info struct for SHBrowseForFolder */ bi.hwndOwner = NULL; bi.pszDisplayName = NULL; - bi.lpszTitle = (LPTSTR) title; + bi.lpszTitle = title; bi.lpfn = selection_callback; hr = SHGetDesktopFolder(&desktop_object); @@ -341,19 +345,19 @@ static void test_selection(void) /* test without flags */ bi.ulFlags = 0; - pidl = SHBrowseForFolder(&bi); + pidl = SHBrowseForFolderA(&bi); if (pidl) CoTaskMemFree(pidl); /* test with flag */ bi.ulFlags = BIF_NEWDIALOGSTYLE; - pidl = SHBrowseForFolder(&bi); + pidl = SHBrowseForFolderA(&bi); if (pidl) CoTaskMemFree(pidl); - desktop_object->lpVtbl->Release(desktop_object); + IShellFolder_Release(desktop_object); CoUninitialize(); } diff --git a/rostests/winetests/shell32/ebrowser.c b/rostests/winetests/shell32/ebrowser.c index 8149f8f95a4..1936cf9ec11 100644 --- a/rostests/winetests/shell32/ebrowser.c +++ b/rostests/winetests/shell32/ebrowser.c @@ -61,6 +61,16 @@ DEFINE_GUID(IID_UnknownInterface7, 0x68A4FDBA, 0xA48A, 0x4A86, 0xA3,0x29, 0x1 DEFINE_GUID(IID_UnknownInterface8, 0xD3B1CAF5, 0xEC4F, 0x4B2E, 0xBC,0xB0, 0x60,0xD7,0x15,0xC9,0x3C,0xB2); DEFINE_GUID(IID_UnknownInterface9, 0x9536CA39, 0x1ACB, 0x4AE6, 0xAD,0x27, 0x24,0x03,0xD0,0x4C,0xA2,0x8F); DEFINE_GUID(IID_UnknownInterface10, 0xB722BE00, 0x4E68, 0x101B, 0xA2,0xBC, 0x00,0xAA,0x00,0x40,0x47,0x70); +DEFINE_GUID(IID_UnknownInterface11, 0x691ecf9f, 0x6b9c, 0x4311, 0xa1,0x7b, 0xad,0x15,0x4c,0x30,0xe9,0x1f); +DEFINE_GUID(IID_UnknownInterface12, 0x7e3159f5, 0x21ca, 0x4ec2, 0x8f,0xbe, 0x66,0x2d,0x08,0x2c,0xa3,0xeb); +DEFINE_GUID(IID_UnknownInterface13, 0xa36a3ace, 0x8332, 0x45ce, 0xaa,0x29, 0x50,0x3c,0xb7,0x6b,0x25,0x87); +DEFINE_GUID(IID_UnknownInterface14, 0x16770868, 0x239c, 0x445b, 0xa0,0x1d, 0xf2,0x6c,0x7f,0xbb,0xf2,0x6c); +DEFINE_GUID(IID_UnknownInterface15, 0x05a89298, 0x6246, 0x4c63, 0xbb,0x0d, 0x9b,0xda,0xf1,0x40,0xbf,0x3b); +DEFINE_GUID(IID_UnknownInterface16, 0x35094a87, 0x8bb1, 0x4237, 0x96,0xc6, 0xc4,0x17,0xee,0xbd,0xb0,0x78); +DEFINE_GUID(IID_UnknownInterface17, 0x3d5d8c60, 0x21e4, 0x4b03, 0x83,0xb8, 0xc7,0x3f,0x8c,0x94,0x00,0x78); +DEFINE_GUID(IID_UnknownInterface18, 0x1fc45c07, 0x9e35, 0x4276, 0xad,0x7f, 0x08,0x60,0x3a,0xa0,0xf6,0x0f); +DEFINE_GUID(IID_UnknownInterface19, 0xacd9b67a, 0xceab, 0x4c6c, 0x90,0xa1, 0xe8,0x57,0xc6,0x59,0xe3,0x9d); +DEFINE_GUID(IID_UnknownInterface20, 0xd0fe6f62, 0xdea4, 0x46c9, 0x9d,0xae, 0x36,0xcb,0x13,0x99,0x78,0xfa); static HWND hwnd; @@ -106,20 +116,13 @@ static HRESULT ebrowser_browse_to_desktop(IExplorerBrowser *peb) static void process_msgs(void) { MSG msg; - while(PeekMessage( &msg, NULL, 0, 0, PM_REMOVE)) + while(PeekMessageA( &msg, NULL, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageA(&msg); } } -static void dbg_print_guid(const GUID *guid) { - WCHAR buf[MAX_PATH]; - - StringFromGUID2(guid, buf, MAX_PATH); - printf("guid:[%s]\n", wine_dbgstr_wn(buf, lstrlenW(buf))); -} - /********************************************************************* * IExplorerBrowserEvents implementation */ @@ -215,8 +218,7 @@ static inline IExplorerPaneVisibilityImpl *impl_from_IExplorerPaneVisibility(IEx static HRESULT WINAPI IExplorerPaneVisibility_fnQueryInterface(IExplorerPaneVisibility *iface, REFIID riid, LPVOID *ppvObj) { - ok(0, "Not called.\n"); - trace("REFIID:"); dbg_print_guid(riid); + ok(0, "unexpected, %s\n", wine_dbgstr_guid(riid)); *ppvObj = NULL; return E_NOINTERFACE; } @@ -260,7 +262,7 @@ static HRESULT WINAPI IExplorerPaneVisibility_fnGetPaneState(IExplorerPaneVisibi else if(IsEqualGUID(&EP_AdvQueryPane, ep)) This->aqp++; else { - trace("Unknown explorer pane: "); dbg_print_guid(ep); + trace("Unknown explorer pane: %s\n", wine_dbgstr_guid(ep)); This->unk++; } @@ -305,8 +307,7 @@ static inline ICommDlgBrowser3Impl *impl_from_ICommDlgBrowser3(ICommDlgBrowser3 static HRESULT WINAPI ICommDlgBrowser3_fnQueryInterface(ICommDlgBrowser3 *iface, REFIID riid, LPVOID *ppvObj) { - ok(0, "Not called.\n"); - trace("riid:"); dbg_print_guid(riid); + ok(0, "unexpected %s\n", wine_dbgstr_guid(riid)); *ppvObj = NULL; return E_NOINTERFACE; } @@ -476,8 +477,7 @@ static HRESULT WINAPI IServiceProvider_fnQueryInterface(IServiceProvider *iface, return E_NOINTERFACE; } - ok(0, "Unexpected interface requested.\n"); - trace("riid: "); dbg_print_guid(riid); + ok(0, "Unexpected interface requested, %s\n", wine_dbgstr_guid(riid)); return E_NOINTERFACE; } @@ -521,12 +521,7 @@ static HRESULT WINAPI IServiceProvider_fnQueryService(IServiceProvider *iface, } } - ok(was_in_list, "-- Unknown service requested --\n"); - if(!was_in_list) - { - trace("guidService: "); dbg_print_guid(guidService); - trace("riid: "); dbg_print_guid(riid); - } + ok(was_in_list, "unknown service, serviceID: %s, riid: %s\n", wine_dbgstr_guid(guidService), wine_dbgstr_guid(riid)); /* Give back an interface, if any. */ if(punk) @@ -617,22 +612,25 @@ static void test_SB_misc(void) } /* Some unimplemented methods */ - retHwnd = (HWND)0xDEADBEEF; + retHwnd = (HWND)0xdeadbeef; hr = IShellBrowser_GetControlWindow(psb, FCW_TOOLBAR, &retHwnd); ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr); - ok(retHwnd == (HWND)0xDEADBEEF, "HWND overwritten\n"); + ok(retHwnd == NULL || broken(retHwnd == (HWND)0xdeadbeef), "got %p\n", retHwnd); + retHwnd = (HWND)0xdeadbeef; hr = IShellBrowser_GetControlWindow(psb, FCW_STATUS, &retHwnd); ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr); - ok(retHwnd == (HWND)0xDEADBEEF, "HWND overwritten\n"); + ok(retHwnd == NULL || broken(retHwnd == (HWND)0xdeadbeef), "got %p\n", retHwnd); + retHwnd = (HWND)0xdeadbeef; hr = IShellBrowser_GetControlWindow(psb, FCW_TREE, &retHwnd); ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr); - ok(retHwnd == (HWND)0xDEADBEEF, "HWND overwritten\n"); + ok(retHwnd == NULL || broken(retHwnd == (HWND)0xdeadbeef), "got %p\n", retHwnd); + retHwnd = (HWND)0xdeadbeef; hr = IShellBrowser_GetControlWindow(psb, FCW_PROGRESS, &retHwnd); ok(hr == E_NOTIMPL, "got (0x%08x)\n", hr); - ok(retHwnd == (HWND)0xDEADBEEF, "HWND overwritten\n"); + ok(retHwnd == NULL || broken(retHwnd == (HWND)0xdeadbeef), "got %p\n", retHwnd); /* ::InsertMenuSB */ hr = IShellBrowser_InsertMenusSB(psb, NULL, NULL); @@ -927,6 +925,18 @@ static void test_SetSite(void) { &IID_UnknownInterface4, &IID_IUnknown, 0, NULL }, { &IID_UnknownInterface6, &IID_UnknownInterface7, 0, NULL }, { &IID_IBrowserWithActivationNotification, &IID_IBrowserWithActivationNotification, 0, NULL }, + /* Win 8 */ + { &IID_ICommDlgBrowser, &IID_UnknownInterface11, 0, NULL }, + { &IID_ICommDlgBrowser, &IID_UnknownInterface12, 0, NULL }, + { &IID_ICommDlgBrowser, &IID_UnknownInterface20, 0, NULL }, + { &IID_UnknownInterface13, &IID_IUnknown, 0, NULL }, + { &IID_UnknownInterface13, &IID_UnknownInterface13, 0, NULL }, + { &IID_UnknownInterface13, &IID_UnknownInterface18, 0, NULL }, + { &IID_UnknownInterface14, &IID_UnknownInterface14, 0, NULL }, + { &IID_UnknownInterface15, &IID_UnknownInterface15, 0, NULL }, + { &IID_UnknownInterface16, &IID_UnknownInterface16, 0, NULL }, + { &IID_UnknownInterface17, &IID_UnknownInterface17, 0, NULL }, + { &IID_UnknownInterface17, &IID_UnknownInterface19, 0, NULL }, /* Other services requested in Vista, Windows 2008 but not in Windows 7 */ { &IID_IBrowserSettings_Vista, &IID_IBrowserSettings_Vista, 0, NULL }, diff --git a/rostests/winetests/shell32/msg.h b/rostests/winetests/shell32/msg.h index 361ccdbf598..a457fd4fce5 100644 --- a/rostests/winetests/shell32/msg.h +++ b/rostests/winetests/shell32/msg.h @@ -106,7 +106,7 @@ static void flush_sequences(struct msg_sequence **seq, int n) } static void ok_sequence_(struct msg_sequence **seq, int sequence_index, - const struct message *expected, const char *context, int todo, + const struct message *expected, const char *context, BOOL todo, const char *file, int line) { struct msg_sequence *msg_seq = seq[sequence_index]; diff --git a/rostests/winetests/shell32/progman_dde.c b/rostests/winetests/shell32/progman_dde.c index f94c783ba2a..540c6d439c1 100644 --- a/rostests/winetests/shell32/progman_dde.c +++ b/rostests/winetests/shell32/progman_dde.c @@ -363,7 +363,7 @@ static void DdeExecuteCommand(DWORD instance, HCONV hConv, const char *strCmd, H * window creation happened were not encouraging (not including * SetWindowsHookEx). */ -static void CheckWindowCreated(const char *winName, int closeWindow, int testParams) +static void CheckWindowCreated(const char *winName, BOOL closeWindow, int testParams) { HWND window = NULL; int i; @@ -387,7 +387,7 @@ static void CheckWindowCreated(const char *winName, int closeWindow, int testPar /* Check for Existence (or non-existence) of a file or group * When testing for existence of a group, groupName is not needed */ -static void CheckFileExistsInProgramGroups(const char *nameToCheck, int shouldExist, int isGroup, +static void CheckFileExistsInProgramGroups(const char *nameToCheck, BOOL shouldExist, BOOL isGroup, const char *groupName, int testParams) { char path[MAX_PATH]; @@ -411,7 +411,7 @@ static void CheckFileExistsInProgramGroups(const char *nameToCheck, int shouldEx } strcat(path, "\\"); strcat(path, nameToCheck); - attributes = GetFileAttributes(path); + attributes = GetFileAttributesA(path); if (!shouldExist) { ok (attributes == INVALID_FILE_ATTRIBUTES , "File exists and shouldn't %s.%s\n", @@ -469,7 +469,7 @@ static void CreateGroupTest(DWORD instance, HCONV hConv, const char *command, UI * 1. window is open */ static void ShowGroupTest(DWORD instance, HCONV hConv, const char *command, UINT expected_result, - const char *groupName, const char *windowTitle, int closeAfterShowing, int testParams) + const char *groupName, const char *windowTitle, BOOL closeAfterShowing, int testParams) { HDDEDATA hData; UINT error; @@ -711,11 +711,11 @@ START_TEST(progman_dde) init_strings(); /* Initialize DDE Instance */ - err = DdeInitialize(&instance, DdeCallback, APPCMD_CLIENTONLY, 0); + err = DdeInitializeA(&instance, DdeCallback, APPCMD_CLIENTONLY, 0); ok (err == DMLERR_NO_ERROR, "DdeInitialize Error %s\n", GetStringFromError(err)); /* Create Connection */ - hszProgman = DdeCreateStringHandle(instance, "PROGMAN", CP_WINANSI); + hszProgman = DdeCreateStringHandleA(instance, "PROGMAN", CP_WINANSI); ok (hszProgman != NULL, "DdeCreateStringHandle Error %s\n", GetDdeLastErrorStr(instance)); hConv = DdeConnect(instance, hszProgman, hszProgman, NULL); ok (DdeFreeStringHandle(instance, hszProgman), "DdeFreeStringHandle failure\n"); @@ -736,11 +736,11 @@ START_TEST(progman_dde) /* 2nd Instance (Followup Tests) */ /* Initialize DDE Instance */ instance = 0; - err = DdeInitialize(&instance, DdeCallback, APPCMD_CLIENTONLY, 0); + err = DdeInitializeA(&instance, DdeCallback, APPCMD_CLIENTONLY, 0); ok (err == DMLERR_NO_ERROR, "DdeInitialize Error %s\n", GetStringFromError(err)); /* Create Connection */ - hszProgman = DdeCreateStringHandle(instance, "PROGMAN", CP_WINANSI); + hszProgman = DdeCreateStringHandleA(instance, "PROGMAN", CP_WINANSI); ok (hszProgman != NULL, "DdeCreateStringHandle Error %s\n", GetDdeLastErrorStr(instance)); hConv = DdeConnect(instance, hszProgman, hszProgman, NULL); ok (hConv != NULL, "DdeConnect Error %s\n", GetDdeLastErrorStr(instance)); diff --git a/rostests/winetests/shell32/shelllink.c b/rostests/winetests/shell32/shelllink.c index b22079c7e85..0b2b7be226f 100755 --- a/rostests/winetests/shell32/shelllink.c +++ b/rostests/winetests/shell32/shelllink.c @@ -26,6 +26,7 @@ #include "shlguid.h" #include "shobjidl.h" #include "shlobj.h" +#include "shellapi.h" #include "wine/test.h" #include "shell32_test.h" @@ -38,9 +39,10 @@ static void (WINAPI *pILFree)(LPITEMIDLIST); static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST); static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*); static HRESULT (WINAPI *pSHDefExtractIconA)(LPCSTR, int, UINT, HICON*, HICON*, UINT); - +static HRESULT (WINAPI *pSHGetStockIconInfo)(SHSTOCKICONID, UINT, SHSTOCKICONINFO *); static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR, LPSTR, DWORD); static DWORD (WINAPI *pGetShortPathNameA)(LPCSTR, LPSTR, DWORD); +static UINT (WINAPI *pSHExtractIconsW)(LPCWSTR, int, int, int, HICON *, UINT *, UINT, UINT); static const GUID _IID_IShellLinkDataList = { 0x45e2b4ae, 0xb1c3, 0x11d0, @@ -126,7 +128,7 @@ static void test_get_set(void) strcpy(buffer,"garbage"); r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer)); ok(r == S_OK, "GetDescription failed (0x%08x)\n", r); - ok(lstrcmp(buffer,str)==0, "GetDescription returned '%s'\n", buffer); + ok(strcmp(buffer,str)==0, "GetDescription returned '%s'\n", buffer); r = IShellLinkA_SetDescription(sl, NULL); ok(r == S_OK, "SetDescription failed (0x%08x)\n", r); @@ -134,8 +136,7 @@ static void test_get_set(void) strcpy(buffer,"garbage"); r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer)); ok(r == S_OK, "GetDescription failed (0x%08x)\n", r); - ok(*buffer=='\0' || broken(lstrcmp(buffer,str)==0), "GetDescription returned '%s'\n", buffer); /* NT4 */ - + ok(*buffer=='\0' || broken(strcmp(buffer,str)==0), "GetDescription returned '%s'\n", buffer); /* NT4 */ /* Test Getting / Setting the work directory */ strcpy(buffer,"garbage"); @@ -150,7 +151,7 @@ static void test_get_set(void) strcpy(buffer,"garbage"); r = IShellLinkA_GetWorkingDirectory(sl, buffer, sizeof(buffer)); ok(r == S_OK, "GetWorkingDirectory failed (0x%08x)\n", r); - ok(lstrcmpi(buffer,str)==0, "GetWorkingDirectory returned '%s'\n", buffer); + ok(lstrcmpiA(buffer,str)==0, "GetWorkingDirectory returned '%s'\n", buffer); /* Test Getting / Setting the path */ strcpy(buffer,"garbage"); @@ -187,7 +188,7 @@ static void test_get_set(void) strcpy(buffer,"garbage"); r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); ok(r == S_OK, "GetPath failed (0x%08x)\n", r); - ok(lstrcmpi(buffer,str)==0, "GetPath returned '%s'\n", buffer); + ok(lstrcmpiA(buffer,str)==0, "GetPath returned '%s'\n", buffer); /* Get some real path to play with */ GetWindowsDirectoryA( mypath, sizeof(mypath)-12 ); @@ -205,7 +206,7 @@ static void test_get_set(void) ret = SHGetPathFromIDListA(tmp_pidl, buffer); ok(ret, "SHGetPathFromIDListA failed\n"); if (ret) - ok(lstrcmpi(buffer,str)==0, "GetIDList returned '%s'\n", buffer); + ok(lstrcmpiA(buffer,str)==0, "GetIDList returned '%s'\n", buffer); pILFree(tmp_pidl); } @@ -239,8 +240,7 @@ static void test_get_set(void) r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); ok(r == S_OK, "GetPath failed (0x%08x)\n", r); todo_wine - ok(lstrcmpi(buffer, mypath)==0, "GetPath returned '%s'\n", buffer); - + ok(lstrcmpiA(buffer, mypath)==0, "GetPath returned '%s'\n", buffer); } /* test path with quotes (IShellLinkA_SetPath returns S_FALSE on W2K and below and S_OK on XP and above */ @@ -250,8 +250,8 @@ static void test_get_set(void) strcpy(buffer,"garbage"); r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); ok(r==S_OK, "GetPath failed (0x%08x)\n", r); - ok(!lstrcmp(buffer, "C:\\nonexistent\\file") || - broken(!lstrcmp(buffer, "C:\\\"c:\\nonexistent\\file\"")), /* NT4 */ + ok(!strcmp(buffer, "C:\\nonexistent\\file") || + broken(!strcmp(buffer, "C:\\\"c:\\nonexistent\\file\"")), /* NT4 */ "case doesn't match\n"); r = IShellLinkA_SetPath(sl, "\"c:\\foo"); @@ -282,14 +282,14 @@ static void test_get_set(void) strcpy(buffer,"garbage"); r = IShellLinkA_GetArguments(sl, buffer, sizeof(buffer)); ok(r == S_OK, "GetArguments failed (0x%08x)\n", r); - ok(lstrcmp(buffer,str)==0, "GetArguments returned '%s'\n", buffer); + ok(strcmp(buffer,str)==0, "GetArguments returned '%s'\n", buffer); strcpy(buffer,"garbage"); r = IShellLinkA_SetArguments(sl, NULL); ok(r == S_OK, "SetArguments failed (0x%08x)\n", r); r = IShellLinkA_GetArguments(sl, buffer, sizeof(buffer)); ok(r == S_OK, "GetArguments failed (0x%08x)\n", r); - ok(!buffer[0] || lstrcmp(buffer,str)==0, "GetArguments returned '%s'\n", buffer); + ok(!buffer[0] || strcmp(buffer,str)==0, "GetArguments returned '%s'\n", buffer); strcpy(buffer,"garbage"); r = IShellLinkA_SetArguments(sl, ""); @@ -327,7 +327,7 @@ static void test_get_set(void) i=0xdeadbeef; r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i); ok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r); - ok(lstrcmpi(buffer,str)==0, "GetIconLocation returned '%s'\n", buffer); + ok(lstrcmpiA(buffer,str)==0, "GetIconLocation returned '%s'\n", buffer); ok(i==0xbabecafe, "GetIconLocation returned %d'\n", i); /* Test Getting / Setting the hot key */ @@ -535,7 +535,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo) strcpy(buffer,"garbage"); r = IShellLinkA_GetDescription(sl, buffer, sizeof(buffer)); lok(r == S_OK, "GetDescription failed (0x%08x)\n", r); - lok_todo_4(0x1, lstrcmp(buffer, desc->description)==0, + lok_todo_4(0x1, strcmp(buffer, desc->description)==0, "GetDescription returned '%s' instead of '%s'\n", buffer, desc->description); } @@ -544,7 +544,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo) strcpy(buffer,"garbage"); r = IShellLinkA_GetWorkingDirectory(sl, buffer, sizeof(buffer)); lok(r == S_OK, "GetWorkingDirectory failed (0x%08x)\n", r); - lok_todo_4(0x2, lstrcmpi(buffer, desc->workdir)==0, + lok_todo_4(0x2, lstrcmpiA(buffer, desc->workdir)==0, "GetWorkingDirectory returned '%s' instead of '%s'\n", buffer, desc->workdir); } @@ -553,7 +553,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo) strcpy(buffer,"garbage"); r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); lok(SUCCEEDED(r), "GetPath failed (0x%08x)\n", r); - lok_todo_4(0x4, lstrcmpi(buffer, desc->path)==0, + lok_todo_4(0x4, lstrcmpiA(buffer, desc->path)==0, "GetPath returned '%s' instead of '%s'\n", buffer, desc->path); } @@ -580,7 +580,7 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo) strcpy(buffer,"garbage"); r = IShellLinkA_GetIconLocation(sl, buffer, sizeof(buffer), &i); lok(r == S_OK, "GetIconLocation failed (0x%08x)\n", r); - lok_todo_4(0x20, lstrcmpi(buffer, desc->icon)==0, + lok_todo_4(0x20, lstrcmpiA(buffer, desc->icon)==0, "GetIconLocation returned '%s' instead of '%s'\n", buffer, desc->icon); lok_todo_4(0x20, i==desc->icon_id, @@ -650,7 +650,7 @@ static void test_load_save(void) create_lnk(lnkfile, &desc, 0); check_lnk(lnkfile, &desc, 0x0); - r=GetModuleFileName(NULL, mypath, sizeof(mypath)); + r=GetModuleFileNameA(NULL, mypath, sizeof(mypath)); ok(rcbSize = sizeof(SHSTOCKICONINFO); + hr = pSHGetStockIconInfo(-1, SHGSI_ICONLOCATION, sii); + ok(hr == E_INVALIDARG, "-1: got 0x%x (expected E_INVALIDARG)\n", hr); + + /* max. id for vista is 140 (no definition exists for this value) */ + for (i = 0; i <= 140; i++) + { + memset(buffer, '#', sizeof(buffer)); + sii->cbSize = sizeof(SHSTOCKICONINFO); + hr = pSHGetStockIconInfo(i, SHGSI_ICONLOCATION, sii); + + ok(hr == S_OK, + "%3d: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x (expected S_OK)\n", + i, hr, sii->iSysImageIndex, sii->iIcon); + + if ((hr == S_OK) && (winetest_debug > 1)) + trace("%3d: got iSysImageIndex %3d, iIcon %3d and %s\n", i, sii->iSysImageIndex, + sii->iIcon, wine_dbgstr_w(sii->szPath)); + } + + /* there are more icons since win7 */ + memset(buffer, '#', sizeof(buffer)); + sii->cbSize = sizeof(SHSTOCKICONINFO); + hr = pSHGetStockIconInfo(i, SHGSI_ICONLOCATION, sii); + atleast_win7 = (!hr); + + for (; i < (SIID_MAX_ICONS + 25) ; i++) + { + memset(buffer, '#', sizeof(buffer)); + sii->cbSize = sizeof(SHSTOCKICONINFO); + hr = pSHGetStockIconInfo(i, SHGSI_ICONLOCATION, sii); + + if (atleast_win7 && (i == (SIID_MAX_ICONS - 1)) && broken(hr == E_INVALIDARG)) + { + /* Off by one windows bug: there are SIID_MAX_ICONS icons from 0 + * up to SIID_MAX_ICONS-1 on Windows 8, but the last one is missing + * on Windows 7. + */ + trace("%3d: got E_INVALIDARG (windows bug: off by one)\n", i); + } + else if (atleast_win7 && (i < (SIID_MAX_ICONS))) + { + ok(hr == S_OK, + "%3d: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x (expected S_OK)\n", + i, hr, sii->iSysImageIndex, sii->iIcon); + + if ((hr == S_OK) && (winetest_debug > 1)) + trace("%3d: got iSysImageIndex %3d, iIcon %3d and %s\n", i, sii->iSysImageIndex, + sii->iIcon, wine_dbgstr_w(sii->szPath)); + } + else + ok(hr == E_INVALIDARG, "%3d: got 0x%x (expected E_INVALIDARG)\n", i, hr); + } + + /* test more returned SHSTOCKICONINFO elements without extra flags */ + memset(buffer, '#', sizeof(buffer)); + sii->cbSize = sizeof(SHSTOCKICONINFO); + hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, sii); + ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); + ok(!sii->hIcon, "got %p (expected NULL)\n", sii->hIcon); + ok(sii->iSysImageIndex == -1, "got %d (expected -1)\n", sii->iSysImageIndex); + + /* the exact size is required of the struct */ + memset(buffer, '#', sizeof(buffer)); + sii->cbSize = sizeof(SHSTOCKICONINFO) + 2; + hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, sii); + ok(hr == E_INVALIDARG, "+2: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon); + + memset(buffer, '#', sizeof(buffer)); + sii->cbSize = sizeof(SHSTOCKICONINFO) + 1; + hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, sii); + ok(hr == E_INVALIDARG, "+1: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon); + + memset(buffer, '#', sizeof(buffer)); + sii->cbSize = sizeof(SHSTOCKICONINFO) - 1; + hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, sii); + ok(hr == E_INVALIDARG, "-1: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon); + + memset(buffer, '#', sizeof(buffer)); + sii->cbSize = sizeof(SHSTOCKICONINFO) - 2; + hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, sii); + ok(hr == E_INVALIDARG, "-2: got 0x%x, iSysImageIndex: 0x%x, iIcon: 0x%x\n", hr, sii->iSysImageIndex, sii->iIcon); + + /* there is a NULL check for the struct */ + hr = pSHGetStockIconInfo(SIID_FOLDER, SHGSI_ICONLOCATION, NULL); + ok(hr == E_INVALIDARG, "NULL: got 0x%x\n", hr); +} + +static void test_SHExtractIcons(void) +{ + static const WCHAR notepadW[] = {'n','o','t','e','p','a','d','.','e','x','e',0}; + static const WCHAR shell32W[] = {'s','h','e','l','l','3','2','.','d','l','l',0}; + static const WCHAR emptyW[] = {0}; + UINT ret, ret2; + HICON icons[256]; + UINT ids[256], i; + + if (!pSHExtractIconsW) + { + win_skip("SHExtractIconsW not available\n"); + return; + } + + ret = pSHExtractIconsW(emptyW, 0, 16, 16, icons, ids, 1, 0); + ok(ret == ~0u, "got %u\n", ret); + + ret = pSHExtractIconsW(notepadW, 0, 16, 16, NULL, NULL, 1, 0); + ok(ret == 1 || broken(ret == 2) /* win2k */, "got %u\n", ret); + + icons[0] = (HICON)0xdeadbeef; + ret = pSHExtractIconsW(notepadW, 0, 16, 16, icons, NULL, 1, 0); + ok(ret == 1, "got %u\n", ret); + ok(icons[0] != (HICON)0xdeadbeef, "icon not set\n"); + DestroyIcon(icons[0]); + + icons[0] = (HICON)0xdeadbeef; + ids[0] = 0xdeadbeef; + ret = pSHExtractIconsW(notepadW, 0, 16, 16, icons, ids, 1, 0); + ok(ret == 1, "got %u\n", ret); + ok(icons[0] != (HICON)0xdeadbeef, "icon not set\n"); + ok(ids[0] != 0xdeadbeef, "id not set\n"); + DestroyIcon(icons[0]); + + ret = pSHExtractIconsW(shell32W, 0, 16, 16, NULL, NULL, 0, 0); + ret2 = pSHExtractIconsW(shell32W, 4, MAKELONG(32,16), MAKELONG(32,16), NULL, NULL, 256, 0); + ok(ret && ret == ret2, + "icon count should be independent of requested icon sizes and base icon index\n"); + + ret = pSHExtractIconsW(shell32W, 0, 16, 16, icons, ids, 0, 0); + ok(ret == ~0u || !ret /* < vista */, "got %u\n", ret); + + ret = pSHExtractIconsW(shell32W, 0, 16, 16, icons, ids, 3, 0); + ok(ret == 3, "got %u\n", ret); + for (i = 0; i < ret; i++) DestroyIcon(icons[i]); + + /* count must be a multiple of two when getting two sizes */ + ret = pSHExtractIconsW(shell32W, 0, MAKELONG(16,32), MAKELONG(16,32), icons, ids, 3, 0); + ok(!ret /* vista */ || ret == 4, "got %u\n", ret); + for (i = 0; i < ret; i++) DestroyIcon(icons[i]); + + ret = pSHExtractIconsW(shell32W, 0, MAKELONG(16,32), MAKELONG(16,32), icons, ids, 4, 0); + ok(ret == 4, "got %u\n", ret); + for (i = 0; i < ret; i++) DestroyIcon(icons[i]); +} + START_TEST(shelllink) { HRESULT r; @@ -1001,9 +1163,10 @@ START_TEST(shelllink) pILIsEqual = (void *)GetProcAddress(hmod, (LPSTR)21); pSHILCreateFromPath = (void *)GetProcAddress(hmod, (LPSTR)28); pSHDefExtractIconA = (void *)GetProcAddress(hmod, "SHDefExtractIconA"); - + pSHGetStockIconInfo = (void *)GetProcAddress(hmod, "SHGetStockIconInfo"); pGetLongPathNameA = (void *)GetProcAddress(hkernel32, "GetLongPathNameA"); pGetShortPathNameA = (void *)GetProcAddress(hkernel32, "GetShortPathNameA"); + pSHExtractIconsW = (void *)GetProcAddress(hmod, "SHExtractIconsW"); r = CoInitialize(NULL); ok(r == S_OK, "CoInitialize failed (0x%08x)\n", r); @@ -1015,6 +1178,8 @@ START_TEST(shelllink) test_datalink(); test_shdefextracticon(); test_GetIconLocation(); + test_SHGetStockIconInfo(); + test_SHExtractIcons(); CoUninitialize(); } diff --git a/rostests/winetests/shell32/shellole.c b/rostests/winetests/shell32/shellole.c index da1f667932e..3f0b490e600 100644 --- a/rostests/winetests/shell32/shellole.c +++ b/rostests/winetests/shell32/shellole.c @@ -29,6 +29,7 @@ DEFINE_GUID(FMTID_Test,0x12345678,0x1234,0x1234,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12); DEFINE_GUID(FMTID_NotExisting, 0x12345678,0x1234,0x1234,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x13); +DEFINE_GUID(CLSID_ClassMoniker, 0x0000031a,0x0000,0x0000,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46); #define DEFINE_EXPECT(func) \ static BOOL expect_ ## func = FALSE, called_ ## func = FALSE @@ -63,12 +64,16 @@ DEFINE_EXPECT(Release); DEFINE_EXPECT(Stat); DEFINE_EXPECT(WriteMultiple); +DEFINE_EXPECT(autoplay_BindToObject); +DEFINE_EXPECT(autoplay_GetClassObject); + static HRESULT (WINAPI *pSHPropStgCreate)(IPropertySetStorage*, REFFMTID, const CLSID*, DWORD, DWORD, DWORD, IPropertyStorage**, UINT*); static HRESULT (WINAPI *pSHPropStgReadMultiple)(IPropertyStorage*, UINT, ULONG, const PROPSPEC*, PROPVARIANT*); static HRESULT (WINAPI *pSHPropStgWriteMultiple)(IPropertyStorage*, UINT*, ULONG, const PROPSPEC*, PROPVARIANT*, PROPID); +static HRESULT (WINAPI *pSHCreateQueryCancelAutoPlayMoniker)(IMoniker**); static void init(void) { @@ -77,6 +82,7 @@ static void init(void) pSHPropStgCreate = (void*)GetProcAddress(hmod, "SHPropStgCreate"); pSHPropStgReadMultiple = (void*)GetProcAddress(hmod, "SHPropStgReadMultiple"); pSHPropStgWriteMultiple = (void*)GetProcAddress(hmod, "SHPropStgWriteMultiple"); + pSHCreateQueryCancelAutoPlayMoniker = (void*)GetProcAddress(hmod, "SHCreateQueryCancelAutoPlayMoniker"); } static HRESULT WINAPI PropertyStorage_QueryInterface(IPropertyStorage *This, @@ -429,9 +435,317 @@ static void test_SHPropStg_functions(void) CHECK_CALLED(Stat); } +static HRESULT WINAPI test_activator_QI(IClassActivator *iface, REFIID riid, void **ppv) +{ + *ppv = NULL; + + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IClassActivator)) + { + *ppv = iface; + } + + if (!*ppv) return E_NOINTERFACE; + + IClassActivator_AddRef(iface); + + return S_OK; +} + +static ULONG WINAPI test_activator_AddRef(IClassActivator *iface) +{ + return 2; +} + +static ULONG WINAPI test_activator_Release(IClassActivator *iface) +{ + return 1; +} + +static HRESULT WINAPI test_activator_GetClassObject(IClassActivator *iface, REFCLSID clsid, + DWORD context, LCID locale, REFIID riid, void **ppv) +{ + CHECK_EXPECT(autoplay_GetClassObject); + ok(IsEqualGUID(clsid, &CLSID_QueryCancelAutoPlay), "clsid %s\n", wine_dbgstr_guid(clsid)); + ok(IsEqualIID(riid, &IID_IQueryCancelAutoPlay), "riid %s\n", wine_dbgstr_guid(riid)); + return E_NOTIMPL; +} + +static const IClassActivatorVtbl test_activator_vtbl = { + test_activator_QI, + test_activator_AddRef, + test_activator_Release, + test_activator_GetClassObject +}; + +static IClassActivator test_activator = { &test_activator_vtbl }; + +static HRESULT WINAPI test_moniker_QueryInterface(IMoniker* iface, REFIID riid, void **ppvObject) +{ + *ppvObject = 0; + + if (IsEqualIID(&IID_IUnknown, riid) || + IsEqualIID(&IID_IPersist, riid) || + IsEqualIID(&IID_IPersistStream, riid) || + IsEqualIID(&IID_IMoniker, riid)) + { + *ppvObject = iface; + } + + if (!*ppvObject) + return E_NOINTERFACE; + + return S_OK; +} + +static ULONG WINAPI test_moniker_AddRef(IMoniker* iface) +{ + return 2; +} + +static ULONG WINAPI test_moniker_Release(IMoniker* iface) +{ + return 1; +} + +static HRESULT WINAPI test_moniker_GetClassID(IMoniker* iface, CLSID *pClassID) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_IsDirty(IMoniker* iface) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_Load(IMoniker* iface, IStream* pStm) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_Save(IMoniker* iface, IStream* pStm, BOOL fClearDirty) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_GetSizeMax(IMoniker* iface, ULARGE_INTEGER* pcbSize) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_BindToObject(IMoniker* iface, + IBindCtx* pbc, + IMoniker* moniker_to_left, + REFIID riid, + void** ppv) +{ + CHECK_EXPECT(autoplay_BindToObject); + ok(pbc != NULL, "got %p\n", pbc); + ok(moniker_to_left == NULL, "got %p\n", moniker_to_left); + ok(IsEqualIID(riid, &IID_IClassActivator), "got riid %s\n", wine_dbgstr_guid(riid)); + + if (IsEqualIID(riid, &IID_IClassActivator)) + { + *ppv = &test_activator; + return S_OK; + } + + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_BindToStorage(IMoniker* iface, + IBindCtx* pbc, + IMoniker* pmkToLeft, + REFIID riid, + VOID** ppvResult) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_Reduce(IMoniker* iface, + IBindCtx* pbc, + DWORD dwReduceHowFar, + IMoniker** ppmkToLeft, + IMoniker** ppmkReduced) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_ComposeWith(IMoniker* iface, + IMoniker* pmkRight, + BOOL fOnlyIfNotGeneric, + IMoniker** ppmkComposite) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_Enum(IMoniker* iface,BOOL fForward, IEnumMoniker** ppenumMoniker) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_IsEqual(IMoniker* iface, IMoniker* pmkOtherMoniker) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_Hash(IMoniker* iface, DWORD* pdwHash) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_IsRunning(IMoniker* iface, + IBindCtx* pbc, + IMoniker* pmkToLeft, + IMoniker* pmkNewlyRunning) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_GetTimeOfLastChange(IMoniker* iface, + IBindCtx* pbc, + IMoniker* pmkToLeft, + FILETIME* pItemTime) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_Inverse(IMoniker* iface, IMoniker** ppmk) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_RelativePathTo(IMoniker* iface,IMoniker* pmOther, IMoniker** ppmkRelPath) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_GetDisplayName(IMoniker* iface, + IBindCtx* pbc, + IMoniker* pmkToLeft, + LPOLESTR *ppszDisplayName) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_ParseDisplayName(IMoniker* iface, + IBindCtx* pbc, + IMoniker* pmkToLeft, + LPOLESTR pszDisplayName, + ULONG* pchEaten, + IMoniker** ppmkOut) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI test_moniker_IsSystemMoniker(IMoniker* iface,DWORD* pwdMksys) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static const IMonikerVtbl test_moniker_vtbl = +{ + test_moniker_QueryInterface, + test_moniker_AddRef, + test_moniker_Release, + test_moniker_GetClassID, + test_moniker_IsDirty, + test_moniker_Load, + test_moniker_Save, + test_moniker_GetSizeMax, + test_moniker_BindToObject, + test_moniker_BindToStorage, + test_moniker_Reduce, + test_moniker_ComposeWith, + test_moniker_Enum, + test_moniker_IsEqual, + test_moniker_Hash, + test_moniker_IsRunning, + test_moniker_GetTimeOfLastChange, + test_moniker_Inverse, + test_moniker_CommonPrefixWith, + test_moniker_RelativePathTo, + test_moniker_GetDisplayName, + test_moniker_ParseDisplayName, + test_moniker_IsSystemMoniker +}; + +static IMoniker test_moniker = { &test_moniker_vtbl }; + +static void test_SHCreateQueryCancelAutoPlayMoniker(void) +{ + IBindCtx *ctxt; + IMoniker *mon; + IUnknown *unk; + CLSID clsid; + HRESULT hr; + DWORD sys; + + if (!pSHCreateQueryCancelAutoPlayMoniker) + { + win_skip("SHCreateQueryCancelAutoPlayMoniker is not available, skipping tests.\n"); + return; + } + + hr = pSHCreateQueryCancelAutoPlayMoniker(NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = pSHCreateQueryCancelAutoPlayMoniker(&mon); + ok(hr == S_OK, "got 0x%08x\n", hr); + + sys = -1; + hr = IMoniker_IsSystemMoniker(mon, &sys); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(sys == MKSYS_CLASSMONIKER, "got %d\n", sys); + + memset(&clsid, 0, sizeof(clsid)); + hr = IMoniker_GetClassID(mon, &clsid); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsEqualGUID(&clsid, &CLSID_ClassMoniker), "got %s\n", wine_dbgstr_guid(&clsid)); + + /* extract used CLSID that implements this hook */ + SET_EXPECT(autoplay_BindToObject); + SET_EXPECT(autoplay_GetClassObject); + + CreateBindCtx(0, &ctxt); + hr = IMoniker_BindToObject(mon, ctxt, &test_moniker, &IID_IQueryCancelAutoPlay, (void**)&unk); + ok(hr == E_NOTIMPL, "got 0x%08x\n", hr); + IBindCtx_Release(ctxt); + + CHECK_CALLED(autoplay_BindToObject); + CHECK_CALLED(autoplay_GetClassObject); + + IMoniker_Release(mon); +} + START_TEST(shellole) { init(); test_SHPropStg_functions(); + test_SHCreateQueryCancelAutoPlayMoniker(); } diff --git a/rostests/winetests/shell32/shellpath.c b/rostests/winetests/shell32/shellpath.c index e6b70d01a5e..7486fac4df9 100644 --- a/rostests/winetests/shell32/shellpath.c +++ b/rostests/winetests/shell32/shellpath.c @@ -29,9 +29,9 @@ #include "winbase.h" #include "shlguid.h" #include "shlobj.h" -#include "shellapi.h" #include "shlwapi.h" #include "knownfolders.h" +#include "shellapi.h" #include "wine/test.h" #include "initguid.h" @@ -304,17 +304,6 @@ static const char *getFolderName(int folder) } } -static const char *printGUID(const GUID *guid, char * guidSTR) -{ - if (!guid) return NULL; - - sprintf(guidSTR, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", - guid->Data1, guid->Data2, guid->Data3, - guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], - guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); - return guidSTR; -} - static void test_parameters(void) { LPITEMIDLIST pidl = NULL; @@ -549,18 +538,16 @@ static void matchGUID(int folder, const GUID *guid, const GUID *guid_alt) pidlLast->mkid.abID[0] == PT_GUID)) { GUID *shellGuid = (GUID *)(pidlLast->mkid.abID + 2); - char shellGuidStr[39], guidStr[39], guid_altStr[39]; if (!guid_alt) ok(IsEqualIID(shellGuid, guid), "%s: got GUID %s, expected %s\n", getFolderName(folder), - printGUID(shellGuid, shellGuidStr), printGUID(guid, guidStr)); + wine_dbgstr_guid(shellGuid), wine_dbgstr_guid(guid)); else ok(IsEqualIID(shellGuid, guid) || IsEqualIID(shellGuid, guid_alt), "%s: got GUID %s, expected %s or %s\n", getFolderName(folder), - printGUID(shellGuid, shellGuidStr), printGUID(guid, guidStr), - printGUID(guid_alt, guid_altStr)); + wine_dbgstr_guid(shellGuid), wine_dbgstr_guid(guid), wine_dbgstr_guid(guid_alt)); } IMalloc_Free(pMalloc, pidl); } @@ -688,12 +675,12 @@ static char **myARGV; static char base[MAX_PATH]; static char selfname[MAX_PATH]; -static int init(void) +static BOOL init(void) { myARGC = winetest_get_mainargs(&myARGV); - if (!GetCurrentDirectoryA(sizeof(base), base)) return 0; + if (!GetCurrentDirectoryA(sizeof(base), base)) return FALSE; strcpy(selfname, myARGV[0]); - return 1; + return TRUE; } static void doChild(const char *arg) @@ -1911,7 +1898,6 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId IKnownFolder *folder; WCHAR sName[1024], sRelativePath[MAX_PATH], sParsingName[MAX_PATH]; BOOL validPath; - char sParentGuid[39]; BOOL *current_known_folder_found = &known_folder_found[0]; BOOL found = FALSE; const char *srcParsingName; @@ -1953,8 +1939,9 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId ok_(__FILE__, known_folder->line)(kfd.category == known_folder->category, "invalid known folder category for %s: %d expected, but %d retrieved\n", known_folder->sFolderId, known_folder->category, kfd.category); - printGUID(&kfd.fidParent, sParentGuid); - ok_(__FILE__, known_folder->line)(IsEqualGUID(known_folder->fidParent, &kfd.fidParent), "invalid known folder parent for %s: %s expected, but %s retrieved\n", known_folder->sFolderId, known_folder->sParent, sParentGuid); + ok_(__FILE__, known_folder->line)(IsEqualGUID(known_folder->fidParent, &kfd.fidParent), + "invalid known folder parent for %s: %s expected, but %s retrieved\n", + known_folder->sFolderId, known_folder->sParent, wine_dbgstr_guid(&kfd.fidParent)); if(!known_folder->sRelativePath) validPath = (kfd.pszRelativePath==NULL); @@ -2012,23 +1999,21 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId if(!found) { - printGUID(folderId, sParentGuid); - trace("unknown known folder found: %s\n", sParentGuid); + trace("unknown known folder found: %s\n", wine_dbgstr_guid(folderId)); hr = IKnownFolderManager_GetFolder(mgr, folderId, &folder); - ok(hr == S_OK, "cannot get known folder for %s\n", sParentGuid); + ok(hr == S_OK, "cannot get known folder for %s\n", wine_dbgstr_guid(folderId)); if(SUCCEEDED(hr)) { hr = IKnownFolder_GetFolderDefinition(folder, &kfd); todo_wine - ok(hr == S_OK, "cannot get known folder definition for %s\n", sParentGuid); + ok(hr == S_OK, "cannot get known folder definition for %s\n", wine_dbgstr_guid(folderId)); if(SUCCEEDED(hr)) { trace(" category: %d\n", kfd.category); trace(" name: %s\n", wine_dbgstr_w(kfd.pszName)); trace(" description: %s\n", wine_dbgstr_w(kfd.pszDescription)); - printGUID(&kfd.fidParent, sParentGuid); - trace(" parent: %s\n", sParentGuid); + trace(" parent: %s\n", wine_dbgstr_guid(&kfd.fidParent)); trace(" relative path: %s\n", wine_dbgstr_w(kfd.pszRelativePath)); trace(" parsing name: %s\n", wine_dbgstr_w(kfd.pszParsingName)); trace(" tooltip: %s\n", wine_dbgstr_w(kfd.pszTooltip)); @@ -2037,8 +2022,7 @@ static void check_known_folder(IKnownFolderManager *mgr, KNOWNFOLDERID *folderId trace(" security: %s\n", wine_dbgstr_w(kfd.pszSecurity)); trace(" attributes: 0x%08x\n", kfd.dwAttributes); trace(" flags: 0x%08x\n", kfd.kfdFlags); - printGUID(&kfd.ftidType, sParentGuid); - trace(" type: %s\n", sParentGuid); + trace(" type: %s\n", wine_dbgstr_guid(&kfd.ftidType)); FreeKnownFolderDefinitionFields(&kfd); } @@ -2259,7 +2243,7 @@ static void test_knownFolders(void) ok(lstrcmpiW(folderPath, sExample2Path)==0, "invalid known folder path retrieved: \"%s\" when \"%s\" was expected\n", wine_dbgstr_w(folderPath), wine_dbgstr_w(sExample2Path)); CoTaskMemFree(folderPath); - /* verify sub folder - it should fail now, as we redirected it's parent folder, but we have no sub folder in new location */ + /* verify sub folder - it should fail now, as we redirected its parent folder, but we have no sub folder in new location */ hr = IKnownFolder_GetPath(subFolder, 0, &folderPath); ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "unexpected value from GetPath(): 0x%08x\n", hr); ok(folderPath==NULL, "invalid known folder path retrieved: \"%s\" when NULL pointer was expected\n", wine_dbgstr_w(folderPath)); @@ -2597,7 +2581,7 @@ static void test_DoEnvironmentSubst(void) " 0: got %s (expected %s)\n", wine_dbgstr_w(bufferW), wine_dbgstr_w(expectedW)); - /* buffer to small */ + /* Buffer too small */ /* result: FALSE / provided buffer length / the buffer is untouched */ memset(bufferA, '#', MAX_PATH - 1); bufferA[len + 2] = 0; diff --git a/rostests/winetests/shell32/shlexec.c b/rostests/winetests/shell32/shlexec.c index db6f25d4967..597b38c33a3 100755 --- a/rostests/winetests/shell32/shlexec.c +++ b/rostests/winetests/shell32/shlexec.c @@ -43,9 +43,9 @@ #include "wtypes.h" #include "winbase.h" #include "windef.h" -#include "ddeml.h" #include "shellapi.h" #include "shlwapi.h" +#include "ddeml.h" #include "wine/test.h" #include "shell32_test.h" @@ -57,6 +57,7 @@ static char** myARGV; static char tmpdir[MAX_PATH]; static char child_file[MAX_PATH]; static DLLVERSIONINFO dllver; +static BOOL skip_shlexec_tests = FALSE; static BOOL skip_noassoc_tests = FALSE; static HANDLE dde_ready_event; @@ -73,7 +74,7 @@ static void init_event(const char* child_file) { char* event_name; event_name=strrchr(child_file, '\\')+1; - hEvent=CreateEvent(NULL, FALSE, FALSE, event_name); + hEvent=CreateEventA(NULL, FALSE, FALSE, event_name); } static void strcat_param(char* str, const char* name, const char* param) @@ -110,14 +111,14 @@ static INT_PTR shell_execute(LPCSTR verb, LPCSTR file, LPCSTR parameters, LPCSTR if (winetest_debug > 1) trace("%s\n", shell_call); - DeleteFile(child_file); + DeleteFileA(child_file); SetLastError(0xcafebabe); /* FIXME: We cannot use ShellExecuteEx() here because if there is no * association it displays the 'Open With' dialog and I could not find * a flag to prevent this. */ - rc=(INT_PTR)ShellExecute(NULL, verb, file, parameters, directory, SW_SHOWNORMAL); + rc=(INT_PTR)ShellExecuteA(NULL, verb, file, parameters, directory, SW_SHOWNORMAL); if (rc > 32) { @@ -128,7 +129,7 @@ static INT_PTR shell_execute(LPCSTR verb, LPCSTR file, LPCSTR parameters, LPCSTR HWND wnd = FindWindowA("#32770", "Windows"); if (wnd != NULL) { - SendMessage(wnd, WM_CLOSE, 0, 0); + SendMessageA(wnd, WM_CLOSE, 0, 0); win_skip("Skipping shellexecute of file with unassociated extension\n"); skip_noassoc_tests = TRUE; rc = SE_ERR_NOASSOC; @@ -161,7 +162,7 @@ static INT_PTR shell_execute_ex(DWORD mask, LPCSTR verb, LPCSTR file, LPCSTR parameters, LPCSTR directory, LPCSTR class) { - SHELLEXECUTEINFO sei; + SHELLEXECUTEINFOA sei; BOOL success; INT_PTR rc; @@ -197,9 +198,9 @@ static INT_PTR shell_execute_ex(DWORD mask, LPCSTR verb, LPCSTR file, U(sei).hIcon=NULL; sei.hProcess=NULL; /* Out */ - DeleteFile(child_file); + DeleteFileA(child_file); SetLastError(0xcafebabe); - success=ShellExecuteEx(&sei); + success=ShellExecuteExA(&sei); rc=(INT_PTR)sei.hInstApp; ok((success && rc > 32) || (!success && rc <= 32), "%s rc=%d and hInstApp=%ld is not allowed\n", shell_call, success, rc); @@ -243,21 +244,21 @@ static BOOL create_test_association(const char* extension) LONG rc; sprintf(class, "shlexec%s", extension); - rc=RegCreateKeyEx(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey, NULL); + rc=RegCreateKeyExA(HKEY_CLASSES_ROOT, extension, 0, NULL, 0, KEY_SET_VALUE, + NULL, &hkey, NULL); if (rc != ERROR_SUCCESS) return FALSE; - rc=RegSetValueEx(hkey, NULL, 0, REG_SZ, (LPBYTE) class, strlen(class)+1); + rc=RegSetValueExA(hkey, NULL, 0, REG_SZ, (LPBYTE) class, strlen(class)+1); ok(rc==ERROR_SUCCESS, "RegSetValueEx '%s' failed, expected ERROR_SUCCESS, got %d\n", class, rc); CloseHandle(hkey); - rc=RegCreateKeyEx(HKEY_CLASSES_ROOT, class, 0, NULL, 0, - KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS, NULL, &hkey, NULL); + rc=RegCreateKeyExA(HKEY_CLASSES_ROOT, class, 0, NULL, 0, + KEY_CREATE_SUB_KEY | KEY_ENUMERATE_SUB_KEYS, NULL, &hkey, NULL); ok(rc==ERROR_SUCCESS, "RegCreateKeyEx '%s' failed, expected ERROR_SUCCESS, got %d\n", class, rc); - rc=RegCreateKeyEx(hkey, "shell", 0, NULL, 0, - KEY_CREATE_SUB_KEY, NULL, &hkey_shell, NULL); + rc=RegCreateKeyExA(hkey, "shell", 0, NULL, 0, + KEY_CREATE_SUB_KEY, NULL, &hkey_shell, NULL); ok(rc==ERROR_SUCCESS, "RegCreateKeyEx 'shell' failed, expected ERROR_SUCCESS, got %d\n", rc); CloseHandle(hkey); @@ -353,26 +354,28 @@ static void create_test_verb_dde(const char* extension, const char* verb, LONG rc; sprintf(shell, "shlexec%s\\shell", extension); - rc=RegOpenKeyEx(HKEY_CLASSES_ROOT, shell, 0, - KEY_CREATE_SUB_KEY, &hkey_shell); - assert(rc==ERROR_SUCCESS); - rc=RegCreateKeyEx(hkey_shell, verb, 0, NULL, 0, KEY_CREATE_SUB_KEY, - NULL, &hkey_verb, NULL); - assert(rc==ERROR_SUCCESS); - rc=RegCreateKeyEx(hkey_verb, "command", 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey_cmd, NULL); - assert(rc==ERROR_SUCCESS); + rc=RegOpenKeyExA(HKEY_CLASSES_ROOT, shell, 0, + KEY_CREATE_SUB_KEY, &hkey_shell); + ok(rc == ERROR_SUCCESS, "%s key creation failed with %d\n", shell, rc); + + rc=RegCreateKeyExA(hkey_shell, verb, 0, NULL, 0, KEY_CREATE_SUB_KEY, + NULL, &hkey_verb, NULL); + ok(rc == ERROR_SUCCESS, "%s verb key creation failed with %d\n", verb, rc); + + rc=RegCreateKeyExA(hkey_verb, "command", 0, NULL, 0, KEY_SET_VALUE, + NULL, &hkey_cmd, NULL); + ok(rc == ERROR_SUCCESS, "\'command\' key creation failed with %d\n", rc); if (rawcmd) { - rc=RegSetValueEx(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmdtail, strlen(cmdtail)+1); + rc=RegSetValueExA(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmdtail, strlen(cmdtail)+1); } else { cmd=HeapAlloc(GetProcessHeap(), 0, strlen(argv0)+10+strlen(child_file)+2+strlen(cmdtail)+1); sprintf(cmd,"%s shlexec \"%s\" %s", argv0, child_file, cmdtail); - rc=RegSetValueEx(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmd, strlen(cmd)+1); - assert(rc==ERROR_SUCCESS); + rc=RegSetValueExA(hkey_cmd, NULL, 0, REG_SZ, (LPBYTE)cmd, strlen(cmd)+1); + ok(rc == ERROR_SUCCESS, "setting command failed with %d\n", rc); HeapFree(GetProcessHeap(), 0, cmd); } @@ -380,40 +383,42 @@ static void create_test_verb_dde(const char* extension, const char* verb, { HKEY hkey_ddeexec, hkey_application, hkey_topic, hkey_ifexec; - rc=RegCreateKeyEx(hkey_verb, "ddeexec", 0, NULL, 0, KEY_SET_VALUE | - KEY_CREATE_SUB_KEY, NULL, &hkey_ddeexec, NULL); - assert(rc==ERROR_SUCCESS); - rc=RegSetValueEx(hkey_ddeexec, NULL, 0, REG_SZ, (LPBYTE)ddeexec, - strlen(ddeexec)+1); - assert(rc==ERROR_SUCCESS); + rc=RegCreateKeyExA(hkey_verb, "ddeexec", 0, NULL, 0, KEY_SET_VALUE | + KEY_CREATE_SUB_KEY, NULL, &hkey_ddeexec, NULL); + ok(rc == ERROR_SUCCESS, "\'ddeexec\' key creation failed with %d\n", rc); + rc=RegSetValueExA(hkey_ddeexec, NULL, 0, REG_SZ, (LPBYTE)ddeexec, + strlen(ddeexec)+1); + ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc); + if (application) { - rc=RegCreateKeyEx(hkey_ddeexec, "application", 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey_application, NULL); - assert(rc==ERROR_SUCCESS); - rc=RegSetValueEx(hkey_application, NULL, 0, REG_SZ, (LPBYTE)application, - strlen(application)+1); - assert(rc==ERROR_SUCCESS); + rc=RegCreateKeyExA(hkey_ddeexec, "application", 0, NULL, 0, KEY_SET_VALUE, + NULL, &hkey_application, NULL); + ok(rc == ERROR_SUCCESS, "\'application\' key creation failed with %d\n", rc); + + rc=RegSetValueExA(hkey_application, NULL, 0, REG_SZ, (LPBYTE)application, + strlen(application)+1); + ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc); CloseHandle(hkey_application); } if (topic) { - rc=RegCreateKeyEx(hkey_ddeexec, "topic", 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey_topic, NULL); - assert(rc==ERROR_SUCCESS); - rc=RegSetValueEx(hkey_topic, NULL, 0, REG_SZ, (LPBYTE)topic, - strlen(topic)+1); - assert(rc==ERROR_SUCCESS); + rc=RegCreateKeyExA(hkey_ddeexec, "topic", 0, NULL, 0, KEY_SET_VALUE, + NULL, &hkey_topic, NULL); + ok(rc == ERROR_SUCCESS, "\'topic\' key creation failed with %d\n", rc); + rc=RegSetValueExA(hkey_topic, NULL, 0, REG_SZ, (LPBYTE)topic, + strlen(topic)+1); + ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc); CloseHandle(hkey_topic); } if (ifexec) { - rc=RegCreateKeyEx(hkey_ddeexec, "ifexec", 0, NULL, 0, KEY_SET_VALUE, - NULL, &hkey_ifexec, NULL); - assert(rc==ERROR_SUCCESS); - rc=RegSetValueEx(hkey_ifexec, NULL, 0, REG_SZ, (LPBYTE)ifexec, - strlen(ifexec)+1); - assert(rc==ERROR_SUCCESS); + rc=RegCreateKeyExA(hkey_ddeexec, "ifexec", 0, NULL, 0, KEY_SET_VALUE, + NULL, &hkey_ifexec, NULL); + ok(rc == ERROR_SUCCESS, "\'ifexec\' key creation failed with %d\n", rc); + rc=RegSetValueExA(hkey_ifexec, NULL, 0, REG_SZ, (LPBYTE)ifexec, + strlen(ifexec)+1); + ok(rc == ERROR_SUCCESS, "set value failed with %d\n", rc); CloseHandle(hkey_ifexec); } CloseHandle(hkey_ddeexec); @@ -518,14 +523,16 @@ static HDDEDATA CALLBACK ddeCb(UINT uType, UINT uFmt, HCONV hConv, case XTYP_CONNECT: if (!DdeCmpStringHandles(hsz1, hszTopic)) { - size = DdeQueryString(ddeInst, hsz2, ddeApplication, MAX_PATH, CP_WINANSI); + size = DdeQueryStringA(ddeInst, hsz2, ddeApplication, MAX_PATH, CP_WINANSI); + ok(size < MAX_PATH, "got size %d\n", size); assert(size < MAX_PATH); return (HDDEDATA)TRUE; } return (HDDEDATA)FALSE; case XTYP_EXECUTE: - size = DdeGetData(hData, (LPBYTE)ddeExec, MAX_PATH, 0L); + size = DdeGetData(hData, (LPBYTE)ddeExec, MAX_PATH, 0); + ok(size < MAX_PATH, "got size %d\n", size); assert(size < MAX_PATH); DdeFreeDataHandle(hData); if (post_quit_on_execute) @@ -593,32 +600,32 @@ static void doChild(int argc, char** argv) post_quit_on_execute = TRUE; ddeInst = 0; rc = DdeInitializeA(&ddeInst, ddeCb, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES | - CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0L); - assert(rc == DMLERR_NO_ERROR); + CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0); + ok(rc == DMLERR_NO_ERROR, "got %d\n", rc); hszApplication = DdeCreateStringHandleA(ddeInst, shared_block, CP_WINANSI); hszTopic = DdeCreateStringHandleA(ddeInst, shared_block + strlen(shared_block) + 1, CP_WINANSI); assert(hszApplication && hszTopic); - assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_REGISTER | DNS_FILTEROFF)); + assert(DdeNameService(ddeInst, hszApplication, 0, DNS_REGISTER | DNS_FILTEROFF)); timer = SetTimer(NULL, 0, 2500, childTimeout); - dde_ready = OpenEvent(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready"); + dde_ready = OpenEventA(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready"); SetEvent(dde_ready); CloseHandle(dde_ready); - while (GetMessage(&msg, NULL, 0, 0)) - DispatchMessage(&msg); + while (GetMessageA(&msg, NULL, 0, 0)) + DispatchMessageA(&msg); Sleep(500); KillTimer(NULL, timer); - assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_UNREGISTER)); + assert(DdeNameService(ddeInst, hszApplication, 0, DNS_UNREGISTER)); assert(DdeFreeStringHandle(ddeInst, hszTopic)); assert(DdeFreeStringHandle(ddeInst, hszApplication)); assert(DdeUninitialize(ddeInst)); } else { - dde_ready = OpenEvent(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready"); + dde_ready = OpenEventA(EVENT_MODIFY_STATE, FALSE, "winetest_shlexec_dde_ready"); SetEvent(dde_ready); CloseHandle(dde_ready); } @@ -740,10 +747,19 @@ static void _okChildInt(const char* file, int line, const char* key, int expecte "%s expected %d, but got %d\n", key, expected, result); } +static void _okChildIntBroken(const char* file, int line, const char* key, int expected) +{ + INT result; + result=GetPrivateProfileIntA("Arguments", key, expected, child_file); + ok_(file, line)(result == expected || broken(result != expected), + "%s expected %d, but got %d\n", key, expected, result); +} + #define okChildString(key, expected) _okChildString(__FILE__, __LINE__, (key), (expected), (expected)) #define okChildStringBroken(key, expected, broken) _okChildString(__FILE__, __LINE__, (key), (expected), (broken)) #define okChildPath(key, expected) _okChildPath(__FILE__, __LINE__, (key), (expected)) -#define okChildInt(key, expected) _okChildInt(__FILE__, __LINE__, (key), (expected)) +#define okChildInt(key, expected) _okChildInt(__FILE__, __LINE__, (key), (expected)) +#define okChildIntBroken(key, expected) _okChildIntBroken(__FILE__, __LINE__, (key), (expected)) /*** * @@ -793,7 +809,7 @@ static DWORD get_long_path_name(const char* shortpath, char* longpath, DWORD lon } for (; *p && *p != '/' && *p != '\\'; p++); tmplen = p - (shortpath + sp); - lstrcpyn(tmplongpath + lp, shortpath + sp, tmplen + 1); + lstrcpynA(tmplongpath + lp, shortpath + sp, tmplen + 1); /* Check if the file exists and use the existing file name */ goit = FindFirstFileA(tmplongpath, &wfd); if (goit == INVALID_HANDLE_VALUE) @@ -906,6 +922,12 @@ static void test_lpFile_parsed(void) char fileA[MAX_PATH]; INT_PTR rc; + if (skip_shlexec_tests) + { + skip("No filename parsing tests due to lack of .shlexec association\n"); + return; + } + /* existing "drawback_file.noassoc" prevents finding "drawback_file.noassoc foo.shlexec" on wine */ sprintf(fileA, "%s\\drawback_file.noassoc foo.shlexec", tmpdir); rc=shell_execute(NULL, fileA, NULL, NULL); @@ -1386,6 +1408,12 @@ static void test_argify(void) const char* cmd; unsigned i, count; + if (skip_shlexec_tests) + { + skip("No argify tests due to lack of .shlexec association\n"); + return; + } + create_test_verb(".shlexec", "Params232S", 0, "Params232S %2 %3 \"%2\" \"%*\""); create_test_verb(".shlexec", "Params23456", 0, "Params23456 \"%2\" \"%3\" \"%4\" \"%5\" \"%6\""); create_test_verb(".shlexec", "Params23456789", 0, "Params23456789 \"%2\" \"%3\" \"%4\" \"%5\" \"%6\" \"%7\" \"%8\" \"%9\""); @@ -1465,6 +1493,12 @@ static void test_filename(void) char* c; INT_PTR rc; + if (skip_shlexec_tests) + { + skip("No ShellExecute/filename tests due to lack of .shlexec association\n"); + return; + } + test=filename_tests; while (test->basename) { @@ -1686,7 +1720,13 @@ static void test_fileurls(void) char *s; INT_PTR rc; - rc = (INT_PTR)ShellExecute(NULL, NULL, "file:///nosuchfile.shlexec", NULL, NULL, SW_SHOWNORMAL); + if (skip_shlexec_tests) + { + skip("No file URL tests due to lack of .shlexec association\n"); + return; + } + + rc = (INT_PTR)ShellExecuteA(NULL, NULL, "file:///nosuchfile.shlexec", NULL, NULL, SW_SHOWNORMAL); if (rc > 32) { win_skip("shell32 is too old (likely < 4.72). Skipping the file URL tests\n"); @@ -1694,7 +1734,7 @@ static void test_fileurls(void) } get_long_path_name(tmpdir, longtmpdir, sizeof(longtmpdir)/sizeof(*longtmpdir)); - SetEnvironmentVariable("urlprefix", "file:///"); + SetEnvironmentVariableA("urlprefix", "file:///"); test=fileurl_tests; while (test->basename) @@ -1765,7 +1805,7 @@ static void test_fileurls(void) test++; } - SetEnvironmentVariable("urlprefix", NULL); + SetEnvironmentVariableA("urlprefix", NULL); } static void test_find_executable(void) @@ -1856,6 +1896,12 @@ static void test_find_executable(void) return; } + if (skip_shlexec_tests) + { + skip("No FindExecutable/filename tests due to lack of .shlexec association\n"); + return; + } + test=filename_tests; while (test->basename) { @@ -1886,7 +1932,7 @@ static void test_find_executable(void) } if (rc > 32) { - int equal; + BOOL equal; equal=strcmp(command, argv0) == 0 || /* NT4 returns an extra 0x8 character! */ (strlen(command) == strlen(argv0)+1 && strncmp(command, argv0, strlen(argv0)) == 0); @@ -1929,23 +1975,28 @@ static void test_lnks(void) const filename_tests_t* test; INT_PTR rc; - /* Should open through our association */ - sprintf(filename, "%s\\test_shortcut_shlexec.lnk", tmpdir); - rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL, NULL); - ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); - okChildInt("argcA", 5); - okChildString("argvA3", "Open"); - sprintf(params, "%s\\test file.shlexec", tmpdir); - get_long_path_name(params, filename, sizeof(filename)); - okChildPath("argvA4", filename); + if (skip_shlexec_tests) + skip("No FindExecutable/filename tests due to lack of .shlexec association\n"); + else + { + /* Should open through our association */ + sprintf(filename, "%s\\test_shortcut_shlexec.lnk", tmpdir); + rc=shell_execute_ex(SEE_MASK_NOZONECHECKS, NULL, filename, NULL, NULL, NULL); + ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); + okChildInt("argcA", 5); + okChildString("argvA3", "Open"); + sprintf(params, "%s\\test file.shlexec", tmpdir); + get_long_path_name(params, filename, sizeof(filename)); + okChildPath("argvA4", filename); - todo_wait rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_DOENVSUBST, NULL, "%TMPDIR%\\test_shortcut_shlexec.lnk", NULL, NULL, NULL); - ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); - okChildInt("argcA", 5); - todo_wine okChildString("argvA3", "Open"); - sprintf(params, "%s\\test file.shlexec", tmpdir); - get_long_path_name(params, filename, sizeof(filename)); - todo_wine okChildPath("argvA4", filename); + todo_wait rc=shell_execute_ex(SEE_MASK_NOZONECHECKS|SEE_MASK_DOENVSUBST, NULL, "%TMPDIR%\\test_shortcut_shlexec.lnk", NULL, NULL, NULL); + ok(rc > 32, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); + okChildInt("argcA", 5); + todo_wine okChildString("argvA3", "Open"); + sprintf(params, "%s\\test file.shlexec", tmpdir); + get_long_path_name(params, filename, sizeof(filename)); + todo_wine okChildPath("argvA4", filename); + } /* Should just run our executable */ sprintf(filename, "%s\\test_shortcut_exe.lnk", tmpdir); @@ -2053,7 +2104,7 @@ static void test_exes(void) if (! skip_noassoc_tests) { sprintf(filename, "%s\\test file.noassoc", tmpdir); - if (CopyFile(argv0, filename, FALSE)) + if (CopyFileA(argv0, filename, FALSE)) { rc=shell_execute(NULL, filename, params, NULL); todo_wine { @@ -2076,35 +2127,35 @@ typedef struct const char* ifexec; int expectedArgs; const char* expectedDdeExec; - int todo; + BOOL broken; } dde_tests_t; static dde_tests_t dde_tests[] = { /* Test passing and not passing command-line * argument, no DDE */ - {"", NULL, NULL, NULL, NULL, FALSE, "", 0x0}, - {"\"%1\"", NULL, NULL, NULL, NULL, TRUE, "", 0x0}, + {"", NULL, NULL, NULL, NULL, FALSE, ""}, + {"\"%1\"", NULL, NULL, NULL, NULL, TRUE, ""}, /* Test passing and not passing command-line * argument, with DDE */ - {"", "[open(\"%1\")]", "shlexec", "dde", NULL, FALSE, "[open(\"%s\")]", 0x0}, - {"\"%1\"", "[open(\"%1\")]", "shlexec", "dde", NULL, TRUE, "[open(\"%s\")]", 0x0}, + {"", "[open(\"%1\")]", "shlexec", "dde", NULL, FALSE, "[open(\"%s\")]"}, + {"\"%1\"", "[open(\"%1\")]", "shlexec", "dde", NULL, TRUE, "[open(\"%s\")]"}, /* Test unquoted %1 in command and ddeexec * (test filename has space) */ - {"%1", "[open(%1)]", "shlexec", "dde", NULL, 2, "[open(%s)]", 0x0}, + {"%1", "[open(%1)]", "shlexec", "dde", NULL, 2, "[open(%s)]", TRUE /* before vista */}, /* Test ifexec precedence over ddeexec */ - {"", "[open(\"%1\")]", "shlexec", "dde", "[ifexec(\"%1\")]", FALSE, "[ifexec(\"%s\")]", 0x0}, + {"", "[open(\"%1\")]", "shlexec", "dde", "[ifexec(\"%1\")]", FALSE, "[ifexec(\"%s\")]"}, /* Test default DDE topic */ - {"", "[open(\"%1\")]", "shlexec", NULL, NULL, FALSE, "[open(\"%s\")]", 0x0}, + {"", "[open(\"%1\")]", "shlexec", NULL, NULL, FALSE, "[open(\"%s\")]"}, /* Test default DDE application */ - {"", "[open(\"%1\")]", NULL, "dde", NULL, FALSE, "[open(\"%s\")]", 0x0}, + {"", "[open(\"%1\")]", NULL, "dde", NULL, FALSE, "[open(\"%s\")]"}, - {NULL, NULL, NULL, NULL, NULL, 0, 0x0} + {NULL} }; static DWORD WINAPI hooked_WaitForInputIdle(HANDLE process, DWORD timeout) @@ -2224,47 +2275,19 @@ static void test_dde(void) dde_ready_event = CreateEventA(NULL, FALSE, FALSE, "winetest_shlexec_dde_ready"); rc = shell_execute_ex(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI, NULL, filename, NULL, NULL, NULL); CloseHandle(dde_ready_event); - if ((test->todo & 0x1)==0) - { - ok(32 < rc, "%s failed: rc=%lu err=%u\n", shell_call, - rc, GetLastError()); - } - else todo_wine - { - ok(32 < rc, "%s failed: rc=%lu err=%u\n", shell_call, - rc, GetLastError()); - } + ok(32 < rc, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); + if (32 < rc) { - if ((test->todo & 0x2)==0) - { + if (test->broken) + okChildIntBroken("argcA", test->expectedArgs + 3); + else okChildInt("argcA", test->expectedArgs + 3); - } - else todo_wine - { - okChildInt("argcA", test->expectedArgs + 3); - } - if (test->expectedArgs == 1) - { - if ((test->todo & 0x4) == 0) - { - okChildPath("argvA3", filename); - } - else todo_wine - { - okChildPath("argvA3", filename); - } - } - if ((test->todo & 0x8) == 0) - { - sprintf(params, test->expectedDdeExec, filename); - okChildPath("ddeExec", params); - } - else todo_wine - { - sprintf(params, test->expectedDdeExec, filename); - okChildPath("ddeExec", params); - } + + if (test->expectedArgs == 1) okChildPath("argvA3", filename); + + sprintf(params, test->expectedDdeExec, filename); + okChildPath("ddeExec", params); } delete_test_association(".sde"); @@ -2337,10 +2360,10 @@ static DWORD CALLBACK ddeThread(LPVOID arg) { dde_thread_info_t *info = arg; assert(info && info->filename); - PostThreadMessage(info->threadIdParent, - WM_QUIT, - shell_execute_ex(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI, NULL, info->filename, NULL, NULL, NULL), - 0L); + PostThreadMessageA(info->threadIdParent, + WM_QUIT, + shell_execute_ex(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI, NULL, info->filename, NULL, NULL, NULL), + 0); ExitThread(0); } @@ -2355,26 +2378,31 @@ static void test_dde_default_app(void) MSG msg; INT_PTR rc; int which = 0; + HDDEDATA ret; + BOOL b; post_quit_on_execute = FALSE; ddeInst = 0; rc = DdeInitializeA(&ddeInst, ddeCb, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES | - CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0L); - assert(rc == DMLERR_NO_ERROR); + CBF_FAIL_POKES | CBF_FAIL_REQUESTS, 0); + ok(rc == DMLERR_NO_ERROR, "got %lx\n", rc); sprintf(filename, "%s\\test file.sde", tmpdir); /* It is strictly not necessary to register an application name here, but wine's - * DdeNameService implementation complains if 0L is passed instead of + * DdeNameService implementation complains if 0 is passed instead of * hszApplication with DNS_FILTEROFF */ hszApplication = DdeCreateStringHandleA(ddeInst, "shlexec", CP_WINANSI); hszTopic = DdeCreateStringHandleA(ddeInst, "shlexec", CP_WINANSI); - assert(hszApplication && hszTopic); - assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_REGISTER | DNS_FILTEROFF)); + ok(hszApplication && hszTopic, "got %p and %p\n", hszApplication, hszTopic); + ret = DdeNameService(ddeInst, hszApplication, 0, DNS_REGISTER | DNS_FILTEROFF); + ok(ret != 0, "got %p\n", ret); test = dde_default_app_tests; while (test->command) { + HANDLE thread; + if (!create_test_association(".sde")) { skip("Unable to create association for '.sde'\n"); @@ -2389,8 +2417,9 @@ static void test_dde_default_app(void) * so don't wait for it */ SetEvent(hEvent); - assert(CreateThread(NULL, 0, ddeThread, &info, 0, &threadId)); - while (GetMessage(&msg, NULL, 0, 0)) DispatchMessage(&msg); + thread = CreateThread(NULL, 0, ddeThread, &info, 0, &threadId); + ok(thread != NULL, "got %p\n", thread); + while (GetMessageA(&msg, NULL, 0, 0)) DispatchMessageA(&msg); rc = msg.wParam > 32 ? 33 : msg.wParam; /* First test, find which set of test data we expect to see */ @@ -2439,10 +2468,14 @@ static void test_dde_default_app(void) test++; } - assert(DdeNameService(ddeInst, hszApplication, 0L, DNS_UNREGISTER)); - assert(DdeFreeStringHandle(ddeInst, hszTopic)); - assert(DdeFreeStringHandle(ddeInst, hszApplication)); - assert(DdeUninitialize(ddeInst)); + ret = DdeNameService(ddeInst, hszApplication, 0, DNS_UNREGISTER); + ok(ret != 0, "got %p\n", ret); + b = DdeFreeStringHandle(ddeInst, hszTopic); + ok(b, "got %d\n", b); + b = DdeFreeStringHandle(ddeInst, hszApplication); + ok(b, "got %d\n", b); + b = DdeUninitialize(ddeInst); + ok(b, "got %d\n", b); } static void init_test(void) @@ -2477,17 +2510,18 @@ static void init_test(void) if (FAILED(r)) exit(1); - rc=GetModuleFileName(NULL, argv0, sizeof(argv0)); - assert(rc!=0 && rcData1, riid->Data2, riid->Data3, riid->Data4[0], - riid->Data4[1], riid->Data4[2], riid->Data4[3], riid->Data4[4], - riid->Data4[5], riid->Data4[6], riid->Data4[7]); - - return buf; -} - static WCHAR *make_wstr(const char *str) { WCHAR *ret; @@ -232,10 +220,13 @@ static void test_ParseDisplayName(void) /* Tests crash on W2K and below (SHCreateShellItem available as of XP) */ if (pSHCreateShellItem) { - /* null name and pidl */ - hr = IShellFolder_ParseDisplayName(IDesktopFolder, - NULL, NULL, NULL, NULL, NULL, 0); - ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr); + if (0) + { + /* null name and pidl, also crashes on Windows 8 */ + hr = IShellFolder_ParseDisplayName(IDesktopFolder, NULL, NULL, + NULL, NULL, NULL, 0); + ok(hr == E_INVALIDARG, "returned %08x, expected E_INVALIDARG\n", hr); + } /* null name */ newPIDL = (ITEMIDLIST*)0xdeadbeef; @@ -584,7 +575,7 @@ if (0) ok(hr == S_OK, "Got 0x%08x\n", hr); /* CLSID_ShellFSFolder on some w2k systems */ ok(IsEqualIID(&id, &CLSID_ShellDocObjView) || broken(IsEqualIID(&id, &CLSID_ShellFSFolder)), - "Unexpected classid %s\n", debugstr_guid(&id)); + "Unexpected classid %s\n", wine_dbgstr_guid(&id)); IPersist_Release(pp); } @@ -1967,8 +1958,8 @@ static void test_SHGetFolderPathAndSubDirA(void) BOOL delret; DWORD dwret; int i; - static char wine[] = "wine"; - static char winetemp[] = "wine\\temp"; + static const char wine[] = "wine"; + static const char winetemp[] = "wine\\temp"; static char appdata[MAX_PATH]; static char testpath[MAX_PATH]; static char toolongpath[MAX_PATH+1]; @@ -2063,7 +2054,7 @@ static void test_SHGetFolderPathAndSubDirA(void) "expected %s to start with %s\n", testpath, appdata); ok(!lstrcmpA(&testpath[1 + strlen(appdata)], winetemp), "expected %s to end with %s\n", testpath, winetemp); - dwret = GetFileAttributes(testpath); + dwret = GetFileAttributesA(testpath); ok(FILE_ATTRIBUTE_DIRECTORY | dwret, "expected %x to contain FILE_ATTRIBUTE_DIRECTORY\n", dwret); /* cleanup */ @@ -3005,13 +2996,14 @@ static inline IUnknownImpl *impl_from_IUnknown(IUnknown *iface) static HRESULT WINAPI unk_fnQueryInterface(IUnknown *iunk, REFIID riid, void** punk) { IUnknownImpl *This = impl_from_IUnknown(iunk); - UINT i, found; - for(i = found = 0; This->ifaces[i].id != NULL; i++) + UINT i; + BOOL found = FALSE; + for(i = 0; This->ifaces[i].id != NULL; i++) { if(IsEqualIID(This->ifaces[i].id, riid)) { This->ifaces[i].count++; - found = 1; + found = TRUE; break; } } @@ -3647,10 +3639,23 @@ static void test_ShellItemBindToHandler(void) ok(hr == S_OK, "Got 0x%08x\n", hr); if(SUCCEEDED(hr)) IUnknown_Release(punk); - /* BHID_Transfer */ - hr = IShellItem_BindToHandler(psi, NULL, &BHID_Transfer, &IID_IUnknown, (void**)&punk); - ok(hr == E_NOINTERFACE || broken(hr == MK_E_NOOBJECT /* XP */), "Got 0x%08x\n", hr); - if(SUCCEEDED(hr)) IUnknown_Release(punk); + /* BHID_Transfer + ITransferSource and ITransferDestination are accessible starting Vista, IUnknown is + supported start Win8. */ + hr = IShellItem_BindToHandler(psi, NULL, &BHID_Transfer, &IID_ITransferSource, (void**)&punk); + ok(hr == S_OK || broken(FAILED(hr)) /* pre-Vista */, "Got 0x%08x\n", hr); + if(SUCCEEDED(hr)) + { + IUnknown_Release(punk); + + hr = IShellItem_BindToHandler(psi, NULL, &BHID_Transfer, &IID_ITransferDestination, (void**)&punk); + ok(hr == S_OK, "Got 0x%08x\n", hr); + if(SUCCEEDED(hr)) IUnknown_Release(punk); + + hr = IShellItem_BindToHandler(psi, NULL, &BHID_Transfer, &IID_IUnknown, (void**)&punk); + ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* pre-Win8 */, "Got 0x%08x\n", hr); + if(SUCCEEDED(hr)) IUnknown_Release(punk); + } /* BHID_EnumItems */ hr = IShellItem_BindToHandler(psi, NULL, &BHID_EnumItems, &IID_IEnumShellItems, (void**)&punk); @@ -3921,11 +3926,12 @@ static void test_GetUIObject(void) ok(hr == S_OK, "Got 0x%08x\n", hr); if(SUCCEEDED(hr)) { + const int baseItem = 0x40; HMENU hmenu = CreatePopupMenu(); INT max_id, max_id_check; UINT count, i; const int id_upper_limit = 32767; - hr = IContextMenu_QueryContextMenu(pcm, hmenu, 0, 0, id_upper_limit, CMF_NORMAL); + hr = IContextMenu_QueryContextMenu(pcm, hmenu, 0, baseItem, id_upper_limit, CMF_NORMAL); ok(SUCCEEDED(hr), "Got 0x%08x\n", hr); max_id = HRESULT_CODE(hr) - 1; /* returns max_id + 1 */ ok(max_id <= id_upper_limit, "Got %d\n", max_id); @@ -3937,9 +3943,12 @@ static void test_GetUIObject(void) { MENUITEMINFOA mii; INT res; + char buf[255], buf2[255]; ZeroMemory(&mii, sizeof(MENUITEMINFOA)); mii.cbSize = sizeof(MENUITEMINFOA); - mii.fMask = MIIM_ID | MIIM_FTYPE; + mii.fMask = MIIM_ID | MIIM_FTYPE | MIIM_STRING; + mii.dwTypeData = buf2; + mii.cch = sizeof(buf2); SetLastError(0); res = GetMenuItemInfoA(hmenu, i, TRUE, &mii); @@ -3948,8 +3957,17 @@ static void test_GetUIObject(void) ok( (mii.wID <= id_upper_limit) || (mii.fType & MFT_SEPARATOR), "Got non-separator ID out of range: %d (type: %x)\n", mii.wID, mii.fType); if(!(mii.fType & MFT_SEPARATOR)) + { max_id_check = (mii.wID>max_id_check)?mii.wID:max_id_check; + hr = IContextMenu_GetCommandString(pcm, mii.wID - baseItem, GCS_VERBA, 0, buf, sizeof(buf)); + ok(SUCCEEDED(hr) || hr == E_NOTIMPL, "for id 0x%x got 0x%08x (menustr: %s)\n", mii.wID - baseItem, hr, mii.dwTypeData); + if (SUCCEEDED(hr)) + trace("for id 0x%x got string %s (menu string: %s)\n", mii.wID - baseItem, buf, mii.dwTypeData); + else if (hr == E_NOTIMPL) + trace("for id 0x%x got E_NOTIMPL (menu string: %s)\n", mii.wID - baseItem, mii.dwTypeData); + } } + max_id_check -= baseItem; ok((max_id_check == max_id) || (max_id_check == max_id-1 /* Win 7 */), "Not equal (or near equal), got %d and %d\n", max_id_check, max_id); @@ -4403,7 +4421,7 @@ static LRESULT CALLBACK testwindow_wndproc(HWND hwnd, UINT msg, WPARAM wparam, L ok(0, "Didn't expect a WM_USER_NOTIFY message (event: %x)\n", signal); return 0; } - return DefWindowProc(hwnd, msg, wparam, lparam); + return DefWindowProcA(hwnd, msg, wparam, lparam); } static void register_testwindow_class(void) diff --git a/rostests/winetests/shell32/string.c b/rostests/winetests/shell32/string.c index 1d55ecf9221..81f47547aa0 100755 --- a/rostests/winetests/shell32/string.c +++ b/rostests/winetests/shell32/string.c @@ -87,13 +87,14 @@ static void test_StrRetToStringNW(void) "STRRET_OFFSET: dup failed, ret=%d\n", ret); /* The next test crashes on W2K, WinXP and W2K3, so we don't test. */ -#if 0 +if (0) +{ /* Invalid dest - should return FALSE, except NT4 does not, so we don't check. */ strret.uType = STRRET_WSTR; U(strret).pOleStr = CoDupStrW("Test"); pStrRetToStrNAW(NULL, sizeof(buff)/sizeof(WCHAR), &strret, NULL); trace("NULL dest: ret=%d\n", ret); -#endif +} } START_TEST(string) diff --git a/rostests/winetests/shell32/systray.c b/rostests/winetests/shell32/systray.c index 6699350cf68..c554262f830 100644 --- a/rostests/winetests/shell32/systray.c +++ b/rostests/winetests/shell32/systray.c @@ -41,7 +41,7 @@ static void test_cbsize(void) nidW.hWnd = hMainWnd; nidW.uID = 1; nidW.uFlags = NIF_ICON|NIF_MESSAGE; - nidW.hIcon = LoadIcon(NULL, IDI_APPLICATION); + nidW.hIcon = LoadIconA(NULL, (LPSTR)IDI_APPLICATION); nidW.uCallbackMessage = WM_USER+17; ret = pShell_NotifyIconW(NIM_ADD, &nidW); /* using an invalid cbSize does work */ @@ -61,7 +61,7 @@ static void test_cbsize(void) nidA.hWnd = hMainWnd; nidA.uID = 1; nidA.uFlags = NIF_ICON|NIF_MESSAGE; - nidA.hIcon = LoadIcon(NULL, IDI_APPLICATION); + nidA.hIcon = LoadIconA(NULL, (LPSTR)IDI_APPLICATION); nidA.uCallbackMessage = WM_USER+17; ok(Shell_NotifyIconA(NIM_ADD, &nidA), "NIM_ADD failed!\n"); @@ -91,11 +91,11 @@ START_TEST(systray) wc.cbWndExtra = 0; wc.hInstance = GetModuleHandleA(NULL); wc.hIcon = NULL; - wc.hCursor = LoadCursorA(NULL, IDC_IBEAM); + wc.hCursor = LoadCursorA(NULL, (LPSTR)IDC_IBEAM); wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW); wc.lpszMenuName = NULL; wc.lpszClassName = "MyTestWnd"; - wc.lpfnWndProc = DefWindowProc; + wc.lpfnWndProc = DefWindowProcA; RegisterClassA(&wc); hMainWnd = CreateWindowExA(0, "MyTestWnd", "Blah", WS_OVERLAPPEDWINDOW, diff --git a/rostests/winetests/shell32/testlist.c b/rostests/winetests/shell32/testlist.c index 757db385028..13e3a3eeb4a 100644 --- a/rostests/winetests/shell32/testlist.c +++ b/rostests/winetests/shell32/testlist.c @@ -1,10 +1,7 @@ /* Automatically generated file; DO NOT EDIT!! */ -#define WIN32_LEAN_AND_MEAN -#include - #define STANDALONE -#include "wine/test.h" +#include extern void func_appbar(void); extern void func_assoc(void); From cc3fcbf96f01ee869a2a0ed003ed98f0dc67a457 Mon Sep 17 00:00:00 2001 From: Kamil Hornicek Date: Sun, 20 Apr 2014 13:29:53 +0000 Subject: [PATCH 411/419] [WIN32K] - apply r61265 for win32k, for consistency svn path=/trunk/; revision=62839 --- reactos/win32ss/user/ntuser/win32kdebug.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/user/ntuser/win32kdebug.h b/reactos/win32ss/user/ntuser/win32kdebug.h index d26c4c18796..0d405c80e7a 100644 --- a/reactos/win32ss/user/ntuser/win32kdebug.h +++ b/reactos/win32ss/user/ntuser/win32kdebug.h @@ -29,6 +29,12 @@ #if DBG + #include + + #if !defined(__RELFILE__) + #define __RELFILE__ __FILE__ + #endif + typedef struct { PWCHAR Name; @@ -129,7 +135,7 @@ #define DBG_PRINT(ppi,ch,level,fmt, ...) do { \ if((level == ERR_LEVEL) || (ppi && DBG_IS_CHANNEL_ENABLED(ppi,ch,level))) \ - DbgPrint("(%s:%d) " fmt, __FILE__, __LINE__, ##__VA_ARGS__); \ + DbgPrint("(%s:%d) " fmt, __RELFILE__, __LINE__, ##__VA_ARGS__); \ }while(0); #define ERR(fmt, ...) DBG_PRINT(DBG_GET_PPI, DbgDefaultChannel, ERR_LEVEL,"err: " fmt, ##__VA_ARGS__) @@ -147,7 +153,7 @@ #define WARN_PPI(ppi,ch,fmt, ...) DBG_PRINT(ppi, DbgCh##ch, WARN_LEVEL,"warn: " fmt, ##__VA_ARGS__) #define TRACE_PPI(ppi,ch,fmt, ...) DBG_PRINT(ppi, DbgCh##ch, TRACE_LEVEL,"trace: " fmt, ##__VA_ARGS__) - #define STUB DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__FILE__,__LINE__); + #define STUB DbgPrint("WARNING: %s at %s:%d is UNIMPLEMENTED!\n",__FUNCTION__,__RELFILE__,__LINE__); #else #define DBG_GET_PPI From 1ba0dbbee816c21fe8e4d7090b7ca4329648fefa Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 13:34:54 +0000 Subject: [PATCH 412/419] [PSDK] * Add some missing definitions. svn path=/trunk/; revision=62840 --- reactos/include/psdk/shellapi.h | 121 ++++++++++++++++++++++++++ reactos/include/psdk/shobjidl.idl | 139 ++++++++++++++++++++++++++++++ 2 files changed, 260 insertions(+) diff --git a/reactos/include/psdk/shellapi.h b/reactos/include/psdk/shellapi.h index a116c918b95..13b5a236506 100644 --- a/reactos/include/psdk/shellapi.h +++ b/reactos/include/psdk/shellapi.h @@ -652,6 +652,127 @@ typedef LPSHNAMEMAPPINGA LPSHNAMEMAPPING; #define DoEnvironmentSubst DoEnvironmentSubstA #endif +#if (NTDDI_VERSION >= NTDDI_VISTA) + +typedef struct _SHSTOCKICONINFO { + DWORD cbSize; + HICON hIcon; + int iSysImageIndex; + int iIcon; + WCHAR szPath[MAX_PATH]; +} SHSTOCKICONINFO; + +#define SHGSI_ICONLOCATION 0 + +typedef enum SHSTOCKICONID +{ + SIID_INVALID=-1, + SIID_DOCNOASSOC, + SIID_DOCASSOC, + SIID_APPLICATION, + SIID_FOLDER, + SIID_FOLDEROPEN, + SIID_DRIVE525, + SIID_DRIVE35, + SIID_DRIVERREMOVE, + SIID_DRIVERFIXED, + SIID_DRIVERNET, + SIID_DRIVERNETDISABLE, + SIID_DRIVERCD, + SIID_DRIVERRAM, + SIID_WORLD, + /* Missing: 14 */ + SIID_SERVER = 15, + SIID_PRINTER, + SIID_MYNETWORK, + /* Missing: 18 - 21 */ + SIID_FIND = 22, + SIID_HELP, + /* Missing: 24 - 27 */ + SIID_SHARE = 28, + SIID_LINK, + SIID_SLOWFILE, + SIID_RECYCLER, + SIID_RECYCLERFULL, + /* Missing: 33 - 39 */ + SIID_MEDIACDAUDIO = 40, + /* Missing: 41 - 46 */ + SIID_LOCK = 47, + /* Missing: 48 */ + SIID_AUTOLIST = 49, + SIID_PRINTERNET, + SIID_SERVERSHARE, + SIID_PRINTERFAX, + SIID_PRINTERFAXNET, + SIID_PRINTERFILE, + SIID_STACK, + SIID_MEDIASVCD, + SIID_STUFFEDFOLDER, + SIID_DRIVEUNKNOWN, + SIID_DRIVEDVD, + SIID_MEDIADVD, + SIID_MEDIADVDRAM, + SIID_MEDIADVDRW, + SIID_MEDIADVDR, + SIID_MEDIADVDROM, + SIID_MEDIACDAUDIOPLUS, + SIID_MEDIACDRW, + SIID_MEDIACDR, + SIID_MEDIACDBURN, + SIID_MEDIABLANKCD, + SIID_MEDIACDROM, + SIID_AUDIOFILES, + SIID_IMAGEFILES, + SIID_VIDEOFILES, + SIID_MIXEDFILES, + SIID_FOLDERBACK, + SIID_FOLDERFRONT, + SIID_SHIELD, + SIID_WARNING, + SIID_INFO, + SIID_ERROR, + SIID_KEY, + SIID_SOFTWARE, + SIID_RENAME, + SIID_DELETE, + SIID_MEDIAAUDIODVD, + SIID_MEDIAMOVIEDVD, + SIID_MEDIAENHANCEDCD, + SIID_MEDIAENHANCEDDVD, + SIID_MEDIAHDDVD, + SIID_MEDIABLUERAY, + SIID_MEDIAVCD, + SIID_MEDIADVDPLUSR, + SIID_MEDIADVDPLUSRW, + SIID_DESKTOPPC, + SIID_MOBILEPC, + SIID_USERS, + SIID_MEDIASMARTMEDIA, + SIID_MEDIACOMPACTFLASH, + SIID_DEVICECELLPHONE, + SIID_DEVICECAMERA, + SIID_DEVICEVIDEOCAMERA, + SIID_DEVICEAUDIOPLAYER, + SIID_NETWORKCONNECT, + SIID_INTERNET, + SIID_ZIPFILE, + SIID_SETTINGS, + /* Missing: 107 - 131 */ + SIID_DRIVEHDDVD = 132, + SIID_DRIVEBD, + SIID_MEDIAHDDVDROM, + SIID_MEDIAHDDVDR, + SIID_MEDIAHDDVDRAM, + SIID_MEDIABDROM, + SIID_MEDIABDR, + SIID_MEDIABDRE, + SIID_CLUSTEREDDRIVE, + /* Missing: 141 - 174 */ + SIID_MAX_ICONS = 175 +} SHSTOCKICONID; + +#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ + #if !defined(_WIN64) #include #endif diff --git a/reactos/include/psdk/shobjidl.idl b/reactos/include/psdk/shobjidl.idl index 4ab0fa86c0d..44a549ff470 100644 --- a/reactos/include/psdk/shobjidl.idl +++ b/reactos/include/psdk/shobjidl.idl @@ -3813,6 +3813,137 @@ interface ICustomDestinationList : IUnknown HRESULT AbortList(); } +[ + uuid(ddefe873-6997-4e68-be26-39b633adbe12), + object, + pointer_default(unique) +] +interface IQueryCancelAutoPlay : IUnknown +{ + HRESULT AllowAutoPlay([in, string] LPCWSTR path, + [in] DWORD content_type, + [in, string] LPCWSTR label, + [in] DWORD serial_number); +} + +[ + uuid(d594d0d8-8da7-457b-b3b4-ce5dbaac0b88), + pointer_default(unique) +] +interface ITransferAdviseSink : IUnknown +{ + [v1_enum] enum _TRANSFER_ADVISE_STATE + { + TS_NONE = 0, + TS_PERFORMING = 1, + TS_PREPARING = 2, + TS_INDETERMINATE = 4 + }; + typedef DWORD TRANSFER_ADVISE_STATE; + + HRESULT UpdateProgress([in] ULONGLONG size_current, + [in] ULONGLONG size_total, + [in] INT files_current, + [in] INT files_total, + [in] INT folders_current, + [in] INT folders_total); + HRESULT UpdateTransferState([in] TRANSFER_ADVISE_STATE state); + HRESULT ConfirmOverwrite([in] IShellItem *source, + [in] IShellItem *dest_parent, + [in, string] LPCWSTR name); + HRESULT ConfirmEncryptLoss([in] IShellItem *source); + HRESULT FileFailure([in] IShellItem *item, + [in, unique, string] LPCWSTR itemname, + [in] HRESULT hr, + [out, unique, size_is(crename)] LPWSTR rename, + [in] ULONG crename); + HRESULT SubStreamFailure([in] IShellItem *item, + [in, string] LPCWSTR stream, + [in] HRESULT hr); + HRESULT PropertyFailure([in] IShellItem *item, + [in, unique] const PROPERTYKEY *key, + [in] HRESULT hr); +} + +[v1_enum] enum _TRANSFER_SOURCE_FLAGS +{ + TSF_NORMAL = 0, + TSF_FAIL_EXIST = 0, + TSF_RENAME_EXIST = 0x1, + TSF_OVERWRITE_EXIST = 0x2, + TSF_ALLOW_DECRYPTION = 0x4, + TSF_NO_SECURITY = 0x8, + TSF_COPY_CREATION_TIME = 0x10, + TSF_COPY_WRITE_TIME = 0x20, + TSF_USE_FULL_ACCESS = 0x40, + TSF_DELETE_RECYCLE_IF_POSSIBLE = 0x80, + TSF_COPY_HARD_LINK = 0x100, + TSF_COPY_LOCALIZED_NAME = 0x200, + TSF_MOVE_AS_COPY_DELETE = 0x400, + TSF_SUSPEND_SHELLEVENTS = 0x800 +}; +typedef DWORD TRANSFER_SOURCE_FLAGS; + +[ + uuid(00adb003-bde9-45c6-8e29-d09f9353e108), + object, + pointer_default(unique) +] +interface ITransferSource : IUnknown +{ + HRESULT Advise([in] ITransferAdviseSink *sink, [out] DWORD *cookie); + HRESULT Unadvise([in] DWORD cookie); + HRESULT SetProperties([in] IPropertyChangeArray *array); + HRESULT OpenItem([in] IShellItem *item, + [in] TRANSFER_SOURCE_FLAGS flags, + [in] REFIID riid, + [out, iid_is(riid)] void **ppv); + HRESULT MoveItem([in] IShellItem *item, + [in] IShellItem *parent_dest, + [in, string] LPCWSTR name_dest, + [in] TRANSFER_SOURCE_FLAGS flags, + [out] IShellItem **newitem); + HRESULT RecycleItem([in] IShellItem *source, + [in] IShellItem *parent_dest, + [in] TRANSFER_SOURCE_FLAGS flags, + [out] IShellItem **new_dest); + HRESULT RemoveItem([in] IShellItem *source, [in] TRANSFER_SOURCE_FLAGS flags); + HRESULT RenameItem([in] IShellItem *source, + [in, string] LPCWSTR newname, + [in] TRANSFER_SOURCE_FLAGS flags, + [out] IShellItem **new_dest); + HRESULT LinkItem([in] IShellItem *source, + [in] IShellItem *parent_dest, + [in, unique, string] LPCWSTR new_name, + [in] TRANSFER_SOURCE_FLAGS flags, + [out] IShellItem **new_dest); + HRESULT ApplyPropertiesToItem([in] IShellItem *source, [out] IShellItem **newitem); + HRESULT GetDefaultDestinationName([in] IShellItem *source, + [in] IShellItem *parent_dest, + [out, string] LPWSTR *dest_name); + HRESULT EnterFolder([in] IShellItem *child_folder); + HRESULT LeaveFolder([in] IShellItem *child_folder); +} + +[ + uuid(48addd32-3ca5-4124-abe3-b5a72531b207), + object, + pointer_default(unique) +] +interface ITransferDestination : IUnknown +{ + HRESULT Advise([in] ITransferAdviseSink *sink, [out] DWORD *cookie); + HRESULT Unadvise([in] DWORD cookie); + HRESULT CreateItem([in, string] LPCWSTR name, + [in] DWORD attr, + [in] ULONGLONG size, + [in] TRANSFER_SOURCE_FLAGS flags, + [in] REFIID riid, + [out, iid_is(riid)] void **ppv, + [in] REFIID resources, + [out, iid_is(riid)] void **presources); +} + /***************************************************************************** * ShellObjects typelibrary */ @@ -3894,6 +4025,14 @@ library ShellObjects interface ICustomDestinationList; } + [ + uuid(331f1768-05a9-4ddd-b86e-dae34ddc998a) + ] + coclass QueryCancelAutoPlay + { + interface IQueryCancelAutoPlay; + } + [ uuid(9ac9fbe1-e0a2-4ad6-b4ee-e212013ea917) ] From 05557a4614038081e77e313ca76a25f5f1a32407 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 13:42:12 +0000 Subject: [PATCH 413/419] [PSDK] * Add some missing LDR_ADDREF_DLL_PIN definition. svn path=/trunk/; revision=62841 --- reactos/include/psdk/winternl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/include/psdk/winternl.h b/reactos/include/psdk/winternl.h index aa95b5db06a..ff1cdd3c9a7 100644 --- a/reactos/include/psdk/winternl.h +++ b/reactos/include/psdk/winternl.h @@ -2448,6 +2448,9 @@ typedef struct _LDR_MODULE #define LDR_DONT_RESOLVE_REFS 0x40000000 #define LDR_WINE_INTERNAL 0x80000000 +/* flag for LdrAddRefDll */ +#define LDR_ADDREF_DLL_PIN 0x00000001 + /* FIXME: to be checked */ #define MAXIMUM_FILENAME_LENGTH 256 From cd9c73cf39195b585c90fcaee182ebdde177bf10 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sun, 20 Apr 2014 13:44:55 +0000 Subject: [PATCH 414/419] [NTDLL_WINETEST] * Sync with Wine 1.7.17. CORE-8080 svn path=/trunk/; revision=62842 --- rostests/winetests/ntdll/CMakeLists.txt | 2 +- rostests/winetests/ntdll/atom.c | 6 +- rostests/winetests/ntdll/change.c | 6 +- rostests/winetests/ntdll/directory.c | 4 +- rostests/winetests/ntdll/error.c | 6 +- rostests/winetests/ntdll/exception.c | 150 ++++- rostests/winetests/ntdll/file.c | 717 ++++++++++++++++++------ rostests/winetests/ntdll/generated.c | 45 -- rostests/winetests/ntdll/info.c | 43 +- rostests/winetests/ntdll/om.c | 2 +- rostests/winetests/ntdll/path.c | 45 +- rostests/winetests/ntdll/pipe.c | 4 +- rostests/winetests/ntdll/port.c | 42 +- rostests/winetests/ntdll/reg.c | 4 +- rostests/winetests/ntdll/rtl.c | 58 ++ rostests/winetests/ntdll/rtlstr.c | 527 +++++++++++++++++ rostests/winetests/ntdll/string.c | 36 ++ rostests/winetests/ntdll/testlist.c | 5 +- rostests/winetests/ntdll/time.c | 4 +- 19 files changed, 1394 insertions(+), 312 deletions(-) diff --git a/rostests/winetests/ntdll/CMakeLists.txt b/rostests/winetests/ntdll/CMakeLists.txt index e9020f410fa..872874c3da7 100644 --- a/rostests/winetests/ntdll/CMakeLists.txt +++ b/rostests/winetests/ntdll/CMakeLists.txt @@ -1,7 +1,7 @@ remove_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502) -add_definitions(-D__ROS_LONG64__) +add_definitions(-D__WINESRC__) list(APPEND SOURCE atom.c diff --git a/rostests/winetests/ntdll/atom.c b/rostests/winetests/ntdll/atom.c index 1741f55963c..0fed6308e33 100755 --- a/rostests/winetests/ntdll/atom.c +++ b/rostests/winetests/ntdll/atom.c @@ -25,7 +25,7 @@ #include #include "ntstatus.h" -/* Define WIN32_NO_STATUS so MSVC does not give us duplicate macro +/* Define WIN32_NO_STATUS so MSVC does not give us duplicate macro * definition errors when we get to winnt.h */ #define WIN32_NO_STATUS @@ -432,7 +432,7 @@ static void test_Global(void) { NTSTATUS res; RTL_ATOM atom; - ULONG ptr[(sizeof(ATOM_BASIC_INFORMATION) + 255 * sizeof(WCHAR) + sizeof(ULONG)) / sizeof(ULONG)]; + char ptr[sizeof(ATOM_BASIC_INFORMATION) + 255 * sizeof(WCHAR)]; ATOM_BASIC_INFORMATION* abi = (ATOM_BASIC_INFORMATION*)ptr; ULONG ptr_size = sizeof(ATOM_BASIC_INFORMATION) + 255 * sizeof(WCHAR); @@ -445,7 +445,7 @@ static void test_Global(void) memset( ptr, 0xcc, sizeof(ptr) ); res = pNtQueryInformationAtom( atom, AtomBasicInformation, (void*)ptr, ptr_size, NULL ); - ok(!res, "atom lookup failed with status = 0x%x\n", res); + ok(!res, "atom lookup\n"); ok(!lstrcmpW(abi->Name, testAtom1), "ok strings\n"); ok(abi->NameLength == lstrlenW(testAtom1) * sizeof(WCHAR), "wrong string length\n"); ok(abi->Name[lstrlenW(testAtom1)] == 0, "wrong string termination %x\n", abi->Name[lstrlenW(testAtom1)]); diff --git a/rostests/winetests/ntdll/change.c b/rostests/winetests/ntdll/change.c index 297af9ec11f..84e281c0235 100644 --- a/rostests/winetests/ntdll/change.c +++ b/rostests/winetests/ntdll/change.c @@ -69,7 +69,7 @@ static void test_ntncdf(void) OPEN_EXISTING, fflags, NULL); ok( hdir != INVALID_HANDLE_VALUE, "failed to open directory\n"); - hEvent = CreateEvent( NULL, 0, 0, NULL ); + hEvent = CreateEventA( NULL, 0, 0, NULL ); r = pNtNotifyChangeDirectoryFile(hdir,NULL,NULL,NULL,&iosb,NULL,0,0,0); ok(r==STATUS_INVALID_PARAMETER, "should return invalid parameter\n"); @@ -197,7 +197,7 @@ static void test_ntncdf_async(void) OPEN_EXISTING, fflags, NULL); ok( hdir != INVALID_HANDLE_VALUE, "failed to open directory\n"); - hEvent = CreateEvent( NULL, 0, 0, NULL ); + hEvent = CreateEventA( NULL, 0, 0, NULL ); filter = FILE_NOTIFY_CHANGE_FILE_NAME; filter |= FILE_NOTIFY_CHANGE_DIR_NAME; @@ -312,7 +312,7 @@ static void test_ntncdf_async(void) START_TEST(change) { - HMODULE hntdll = GetModuleHandle("ntdll"); + HMODULE hntdll = GetModuleHandleA("ntdll"); if (!hntdll) { win_skip("not running on NT, skipping test\n"); diff --git a/rostests/winetests/ntdll/directory.c b/rostests/winetests/ntdll/directory.c index f495fb33997..f190ff452d5 100644 --- a/rostests/winetests/ntdll/directory.c +++ b/rostests/winetests/ntdll/directory.c @@ -120,11 +120,11 @@ static void tear_down_attribute_test(const char *testdirA) continue; sprintf(buf, "%s\\%s", testdirA, testfiles[i].name); if (testfiles[i].attr & FILE_ATTRIBUTE_DIRECTORY) { - ret = RemoveDirectory(buf); + ret = RemoveDirectoryA(buf); ok(ret || (GetLastError() == ERROR_PATH_NOT_FOUND), "Failed to rmdir %s, error %d\n", buf, GetLastError()); } else { - ret = DeleteFile(buf); + ret = DeleteFileA(buf); ok(ret || (GetLastError() == ERROR_PATH_NOT_FOUND), "Failed to rm %s, error %d\n", buf, GetLastError()); } diff --git a/rostests/winetests/ntdll/error.c b/rostests/winetests/ntdll/error.c index d9c83b3dcac..862f0a96ff6 100755 --- a/rostests/winetests/ntdll/error.c +++ b/rostests/winetests/ntdll/error.c @@ -50,7 +50,7 @@ static ULONG (WINAPI *pRtlNtStatusToDosError)(NTSTATUS Status); static int strict; -static int prepare_test(void) +static BOOL prepare_test(void) { HMODULE ntdll; int argc; @@ -61,12 +61,12 @@ static int prepare_test(void) if (!pRtlNtStatusToDosError) { win_skip("RtlNtStatusToDosError is not available\n"); - return 0; + return FALSE; } argc = winetest_get_mainargs(&argv); strict=(argc >= 3 && strcmp(argv[2],"strict")==0); - return 1; + return TRUE; } static void cmp_call(NTSTATUS win_nt, ULONG win32, const char* message) diff --git a/rostests/winetests/ntdll/exception.c b/rostests/winetests/ntdll/exception.c index ac138055347..1e45d827286 100644 --- a/rostests/winetests/ntdll/exception.c +++ b/rostests/winetests/ntdll/exception.c @@ -51,6 +51,13 @@ static NTSTATUS (WINAPI *pNtQueryInformationProcess)(HANDLE, PROCESSINFOCLASS, static NTSTATUS (WINAPI *pNtSetInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); +#if defined(__x86_64__) +static BOOLEAN (CDECL *pRtlAddFunctionTable)(RUNTIME_FUNCTION*, DWORD, DWORD64); +static BOOLEAN (CDECL *pRtlDeleteFunctionTable)(RUNTIME_FUNCTION*); +static BOOLEAN (CDECL *pRtlInstallFunctionTableCallback)(DWORD64, DWORD64, DWORD, PGET_RUNTIME_FUNCTION_CALLBACK, PVOID, PCWSTR); +static PRUNTIME_FUNCTION (WINAPI *pRtlLookupFunctionEntry)(ULONG64, ULONG64*, UNWIND_HISTORY_TABLE*); +#endif + #ifdef __i386__ #ifndef __WINE_WINTRNL_H @@ -314,7 +321,7 @@ static DWORD rtlraiseexception_handler( EXCEPTION_RECORD *rec, EXCEPTION_REGISTR return ExceptionContinueSearch; /* Eip in context is decreased by 1 - * Increase it again, else execution will continue in the middle of a instruction */ + * Increase it again, else execution will continue in the middle of an instruction */ if(rec->ExceptionCode == EXCEPTION_BREAKPOINT && (context->Eip == (DWORD)code_mem + 0xa)) context->Eip += 1; return ExceptionContinueExecution; @@ -731,7 +738,7 @@ static void test_debugger(void) { char cmdline[MAX_PATH]; PROCESS_INFORMATION pi; - STARTUPINFO si = { 0 }; + STARTUPINFOA si = { 0 }; DEBUG_EVENT de; DWORD continuestatus; PVOID code_mem_address = NULL; @@ -748,7 +755,7 @@ static void test_debugger(void) } sprintf(cmdline, "%s %s %s %p", my_argv[0], my_argv[1], "debuggee", &test_stage); - ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi); + ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi); ok(ret, "could not create child process error: %u\n", GetLastError()); if (!ret) return; @@ -796,7 +803,7 @@ static void test_debugger(void) if (counter > 100) { - ok(FALSE, "got way too many exceptions, probably caught in a infinite loop, terminating child\n"); + ok(FALSE, "got way too many exceptions, probably caught in an infinite loop, terminating child\n"); pNtTerminateProcess(pi.hProcess, 1); } else if (counter >= 2) /* skip startup breakpoint */ @@ -1057,7 +1064,7 @@ static DWORD dpe_exception_handler(EXCEPTION_RECORD *rec, EXCEPTION_REGISTRATION static void test_dpe_exceptions(void) { - static char single_ret[] = {0xC3}; + static const BYTE single_ret[] = {0xC3}; struct dpe_exception_info info; NTSTATUS stat; BOOL has_hw_support; @@ -1065,7 +1072,7 @@ static void test_dpe_exceptions(void) DWORD val; ULONG len; - /* Query DEP with len to small */ + /* Query DEP with len too small */ stat = pNtQueryInformationProcess(GetCurrentProcess(), ProcessExecuteFlags, &val, sizeof val - 1, &len); if(stat == STATUS_INVALID_INFO_CLASS) { @@ -1447,6 +1454,122 @@ static void test_virtual_unwind(void) call_virtual_unwind( i, &tests[i] ); } +static RUNTIME_FUNCTION* CALLBACK dynamic_unwind_callback( DWORD64 pc, PVOID context ) +{ + static const int code_offset = 1024; + static RUNTIME_FUNCTION runtime_func; + (*(DWORD *)context)++; + + runtime_func.BeginAddress = code_offset + 16; + runtime_func.EndAddress = code_offset + 32; + runtime_func.UnwindData = 0; + return &runtime_func; +} + +static void test_dynamic_unwind(void) +{ + static const int code_offset = 1024; + char buf[sizeof(RUNTIME_FUNCTION) + 4]; + RUNTIME_FUNCTION *runtime_func, *func; + ULONG_PTR table, base; + DWORD count; + + /* Test RtlAddFunctionTable with aligned RUNTIME_FUNCTION pointer */ + runtime_func = (RUNTIME_FUNCTION *)buf; + runtime_func->BeginAddress = code_offset; + runtime_func->EndAddress = code_offset + 16; + runtime_func->UnwindData = 0; + ok( pRtlAddFunctionTable( runtime_func, 1, (ULONG_PTR)code_mem ), + "RtlAddFunctionTable failed for runtime_func = %p (aligned)\n", runtime_func ); + + /* Lookup function outside of any function table */ + base = 0xdeadbeef; + func = pRtlLookupFunctionEntry( (ULONG_PTR)code_mem + code_offset + 16, &base, NULL ); + ok( func == NULL, + "RtlLookupFunctionEntry returned unexpected function, expected: NULL, got: %p\n", func ); + ok( base == 0xdeadbeef, + "RtlLookupFunctionEntry modified base address, expected: 0xdeadbeef, got: %lx\n", base ); + + /* Test with pointer inside of our function */ + base = 0xdeadbeef; + func = pRtlLookupFunctionEntry( (ULONG_PTR)code_mem + code_offset + 8, &base, NULL ); + ok( func == runtime_func, + "RtlLookupFunctionEntry didn't return expected function, expected: %p, got: %p\n", runtime_func, func ); + ok( base == (ULONG_PTR)code_mem, + "RtlLookupFunctionEntry returned invalid base, expected: %lx, got: %lx\n", (ULONG_PTR)code_mem, base ); + + /* Test RtlDeleteFunctionTable */ + ok( pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable failed for runtime_func = %p (aligned)\n", runtime_func ); + ok( !pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable returned success for nonexistent table runtime_func = %p\n", runtime_func ); + + /* Unaligned RUNTIME_FUNCTION pointer */ + runtime_func = (RUNTIME_FUNCTION *)((ULONG_PTR)buf | 0x3); + runtime_func->BeginAddress = code_offset; + runtime_func->EndAddress = code_offset + 16; + runtime_func->UnwindData = 0; + ok( pRtlAddFunctionTable( runtime_func, 1, (ULONG_PTR)code_mem ), + "RtlAddFunctionTable failed for runtime_func = %p (unaligned)\n", runtime_func ); + ok( pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable failed for runtime_func = %p (unaligned)\n", runtime_func ); + + /* Attempt to insert the same entry twice */ + runtime_func = (RUNTIME_FUNCTION *)buf; + runtime_func->BeginAddress = code_offset; + runtime_func->EndAddress = code_offset + 16; + runtime_func->UnwindData = 0; + ok( pRtlAddFunctionTable( runtime_func, 1, (ULONG_PTR)code_mem ), + "RtlAddFunctionTable failed for runtime_func = %p (first attempt)\n", runtime_func ); + ok( pRtlAddFunctionTable( runtime_func, 1, (ULONG_PTR)code_mem ), + "RtlAddFunctionTable failed for runtime_func = %p (second attempt)\n", runtime_func ); + ok( pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable failed for runtime_func = %p (first attempt)\n", runtime_func ); + ok( pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable failed for runtime_func = %p (second attempt)\n", runtime_func ); + ok( !pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable returned success for nonexistent table runtime_func = %p\n", runtime_func ); + + /* Test RtlInstallFunctionTableCallback with both low bits unset */ + table = (ULONG_PTR)code_mem; + ok( !pRtlInstallFunctionTableCallback( table, (ULONG_PTR)code_mem, code_offset + 32, &dynamic_unwind_callback, (PVOID*)&count, NULL ), + "RtlInstallFunctionTableCallback returned success for table = %lx\n", table ); + + /* Test RtlInstallFunctionTableCallback with both low bits set */ + table = (ULONG_PTR)code_mem | 0x3; + ok( pRtlInstallFunctionTableCallback( table, (ULONG_PTR)code_mem, code_offset + 32, &dynamic_unwind_callback, (PVOID*)&count, NULL ), + "RtlInstallFunctionTableCallback failed for table = %lx\n", table ); + + /* Lookup function outside of any function table */ + count = 0; + base = 0xdeadbeef; + func = pRtlLookupFunctionEntry( (ULONG_PTR)code_mem + code_offset + 32, &base, NULL ); + ok( func == NULL, + "RtlLookupFunctionEntry returned unexpected function, expected: NULL, got: %p\n", func ); + ok( base == 0xdeadbeef, + "RtlLookupFunctionEntry modified base address, expected: 0xdeadbeef, got: %lx\n", base ); + ok( !count, + "RtlLookupFunctionEntry issued %d unexpected calls to dynamic_unwind_callback\n", count ); + + /* Test with pointer inside of our function */ + count = 0; + base = 0xdeadbeef; + func = pRtlLookupFunctionEntry( (ULONG_PTR)code_mem + code_offset + 24, &base, NULL ); + ok( func != NULL && func->BeginAddress == code_offset + 16 && func->EndAddress == code_offset + 32, + "RtlLookupFunctionEntry didn't return expected function, got: %p\n", func ); + ok( base == (ULONG_PTR)code_mem, + "RtlLookupFunctionEntry returned invalid base, expected: %lx, got: %lx\n", (ULONG_PTR)code_mem, base ); + ok( count == 1, + "RtlLookupFunctionEntry issued %d calls to dynamic_unwind_callback, expected: 1\n", count ); + + /* Clean up again */ + ok( pRtlDeleteFunctionTable( (PRUNTIME_FUNCTION)table ), + "RtlDeleteFunctionTable failed for table = %p\n", (PVOID)table ); + ok( !pRtlDeleteFunctionTable( (PRUNTIME_FUNCTION)table ), + "RtlDeleteFunctionTable returned success for nonexistent table = %p\n", (PVOID)table ); + +} + #endif /* __x86_64__ */ START_TEST(exception) @@ -1473,7 +1596,7 @@ START_TEST(exception) "NtQueryInformationProcess" ); pNtSetInformationProcess = (void*)GetProcAddress( hntdll, "NtSetInformationProcess" ); - pIsWow64Process = (void *)GetProcAddress(GetModuleHandle("kernel32.dll"), "IsWow64Process"); + pIsWow64Process = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsWow64Process"); #ifdef __i386__ if (!pNtCurrentTeb) @@ -1534,9 +1657,22 @@ START_TEST(exception) test_dpe_exceptions(); #elif defined(__x86_64__) + pRtlAddFunctionTable = (void *)GetProcAddress( hntdll, + "RtlAddFunctionTable" ); + pRtlDeleteFunctionTable = (void *)GetProcAddress( hntdll, + "RtlDeleteFunctionTable" ); + pRtlInstallFunctionTableCallback = (void *)GetProcAddress( hntdll, + "RtlInstallFunctionTableCallback" ); + pRtlLookupFunctionEntry = (void *)GetProcAddress( hntdll, + "RtlLookupFunctionEntry" ); test_virtual_unwind(); + if (pRtlAddFunctionTable && pRtlDeleteFunctionTable && pRtlInstallFunctionTableCallback && pRtlLookupFunctionEntry) + test_dynamic_unwind(); + else + skip( "Dynamic unwind functions not found\n" ); + #endif VirtualFree(code_mem, 0, MEM_FREE); diff --git a/rostests/winetests/ntdll/file.c b/rostests/winetests/ntdll/file.c index ea152d18467..de64a856c99 100644 --- a/rostests/winetests/ntdll/file.c +++ b/rostests/winetests/ntdll/file.c @@ -89,7 +89,7 @@ static inline BOOL is_signaled( HANDLE obj ) static BOOL create_pipe( HANDLE *read, HANDLE *write, ULONG flags, ULONG size ) { - *read = CreateNamedPipe(PIPENAME, PIPE_ACCESS_INBOUND | flags, PIPE_TYPE_BYTE | PIPE_WAIT, + *read = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_INBOUND | flags, PIPE_TYPE_BYTE | PIPE_WAIT, 1, size, size, NMPWAIT_USE_DEFAULT_WAIT, NULL); ok(*read != INVALID_HANDLE_VALUE, "CreateNamedPipe failed\n"); @@ -782,8 +782,7 @@ static void read_file_test(void) iosb.Information = 0xdeadbeef; offset.QuadPart = strlen(text) + 2; status = pNtReadFile( handle, event, apc, &apc_count, &iosb, buffer, 2, &offset, NULL ); -todo_wine - ok(status == STATUS_PENDING || broken(status == STATUS_END_OF_FILE) /* before Vista */, "expected STATUS_PENDING, got %#x\n", status); + ok(status == STATUS_PENDING || status == STATUS_END_OF_FILE /* before Vista */, "expected STATUS_PENDING or STATUS_END_OF_FILE, got %#x\n", status); if (status == STATUS_PENDING) /* vista */ { WaitForSingleObject( event, 1000 ); @@ -837,9 +836,9 @@ todo_wine ResetEvent( event ); status = pNtReadFile( handle, event, apc, &apc_count, &iosb, buffer, 2, &offset, NULL ); ok( status == STATUS_END_OF_FILE, "wrong status %x\n", status ); - todo_wine ok( U(iosb).Status == STATUS_END_OF_FILE, "wrong status %x\n", U(iosb).Status ); - todo_wine ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); - todo_wine ok( is_signaled( event ), "event is not signaled\n" ); + ok( U(iosb).Status == STATUS_END_OF_FILE, "wrong status %x\n", U(iosb).Status ); + ok( iosb.Information == 0, "wrong info %lu\n", iosb.Information ); + ok( is_signaled( event ), "event is not signaled\n" ); ok( !apc_count, "apc was called\n" ); SleepEx( 1, TRUE ); /* alertable sleep */ ok( !apc_count, "apc was called\n" ); @@ -851,43 +850,93 @@ todo_wine static void append_file_test(void) { - const char text[] = "foobar"; + static const char text[6] = "foobar"; HANDLE handle; NTSTATUS status; IO_STATUS_BLOCK iosb; - DWORD written; - char path[MAX_PATH], buffer[MAX_PATH]; + LARGE_INTEGER offset; + char path[MAX_PATH], buffer[MAX_PATH], buf[16]; + DWORD ret; GetTempPathA( MAX_PATH, path ); GetTempFileNameA( path, "foo", 0, buffer ); - /* It is possible to open a file with only FILE_APPEND_DATA access flags. - It matches the O_WRONLY|O_APPEND open() posix behavior */ - handle = CreateFileA(buffer, FILE_APPEND_DATA, 0, NULL, CREATE_ALWAYS, - FILE_FLAG_DELETE_ON_CLOSE, 0); - ok( handle != INVALID_HANDLE_VALUE, "Failed to create a temp file in FILE_APPEND_DATA mode.\n" ); - if(handle == INVALID_HANDLE_VALUE) - { - skip("Couldn't create a temporary file, skipping FILE_APPEND_DATA test\n"); - return; - } - U(iosb).Status = STATUS_PENDING; - iosb.Information = 0; + handle = CreateFileA(buffer, FILE_WRITE_DATA, 0, NULL, CREATE_ALWAYS, 0, 0); + ok(handle != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); - status = pNtWriteFile(handle, NULL, NULL, NULL, &iosb, - text, sizeof(text), NULL, NULL); - - if (status == STATUS_PENDING) - { - WaitForSingleObject( handle, 1000 ); - status = U(iosb).Status; - } - written = iosb.Information; - - todo_wine - ok(status == STATUS_SUCCESS && written == sizeof(text), "FILE_APPEND_DATA NtWriteFile failed\n"); + U(iosb).Status = -1; + iosb.Information = -1; + status = pNtWriteFile(handle, NULL, NULL, NULL, &iosb, text, 2, NULL, NULL); + ok(status == STATUS_SUCCESS, "NtWriteFile error %#x\n", status); + ok(U(iosb).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iosb).Status); + ok(iosb.Information == 2, "expected 2, got %lu\n", iosb.Information); CloseHandle(handle); + + /* It is possible to open a file with only FILE_APPEND_DATA access flags. + It matches the O_WRONLY|O_APPEND open() posix behavior */ + handle = CreateFileA(buffer, FILE_APPEND_DATA, 0, NULL, OPEN_EXISTING, 0, 0); + ok(handle != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + + U(iosb).Status = -1; + iosb.Information = -1; + offset.QuadPart = 1; + status = pNtWriteFile(handle, NULL, NULL, NULL, &iosb, text + 2, 2, &offset, NULL); + ok(status == STATUS_SUCCESS, "NtWriteFile error %#x\n", status); + ok(U(iosb).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iosb).Status); + ok(iosb.Information == 2, "expected 2, got %lu\n", iosb.Information); + + ret = SetFilePointer(handle, 0, NULL, FILE_CURRENT); + ok(ret == 4, "expected 4, got %u\n", ret); + + U(iosb).Status = -1; + iosb.Information = -1; + offset.QuadPart = 3; + status = pNtWriteFile(handle, NULL, NULL, NULL, &iosb, text + 4, 2, &offset, NULL); + ok(status == STATUS_SUCCESS, "NtWriteFile error %#x\n", status); + ok(U(iosb).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iosb).Status); + ok(iosb.Information == 2, "expected 2, got %lu\n", iosb.Information); + + ret = SetFilePointer(handle, 0, NULL, FILE_CURRENT); + ok(ret == 6, "expected 6, got %u\n", ret); + + CloseHandle(handle); + + handle = CreateFileA(buffer, FILE_READ_DATA | FILE_WRITE_DATA | FILE_APPEND_DATA, 0, NULL, OPEN_EXISTING, 0, 0); + ok(handle != INVALID_HANDLE_VALUE, "CreateFile error %d\n", GetLastError()); + + memset(buf, 0, sizeof(buf)); + U(iosb).Status = -1; + iosb.Information = -1; + offset.QuadPart = 0; + status = pNtReadFile(handle, 0, NULL, NULL, &iosb, buf, sizeof(buf), &offset, NULL); + ok(status == STATUS_SUCCESS, "NtReadFile error %#x\n", status); + ok(U(iosb).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iosb).Status); + ok(iosb.Information == 6, "expected 6, got %lu\n", iosb.Information); + buf[6] = 0; + ok(memcmp(buf, text, 6) == 0, "wrong file contents: %s\n", buf); + + U(iosb).Status = -1; + iosb.Information = -1; + offset.QuadPart = 0; + status = pNtWriteFile(handle, NULL, NULL, NULL, &iosb, text + 3, 3, &offset, NULL); + ok(status == STATUS_SUCCESS, "NtWriteFile error %#x\n", status); + ok(U(iosb).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iosb).Status); + ok(iosb.Information == 3, "expected 3, got %lu\n", iosb.Information); + + memset(buf, 0, sizeof(buf)); + U(iosb).Status = -1; + iosb.Information = -1; + offset.QuadPart = 0; + status = pNtReadFile(handle, 0, NULL, NULL, &iosb, buf, sizeof(buf), &offset, NULL); + ok(status == STATUS_SUCCESS, "NtReadFile error %#x\n", status); + ok(U(iosb).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iosb).Status); + ok(iosb.Information == 6, "expected 6, got %lu\n", iosb.Information); + buf[6] = 0; + ok(memcmp(buf, "barbar", 6) == 0, "wrong file contents: %s\n", buf); + + CloseHandle(handle); + DeleteFileA(buffer); } static void nt_mailslot_test(void) @@ -1302,7 +1351,7 @@ static void test_file_both_information(void) static void test_file_disposition_information(void) { - char buffer[MAX_PATH + 16]; + char tmp_path[MAX_PATH], buffer[MAX_PATH + 16]; DWORD dirpos; HANDLE handle, handle2; NTSTATUS res; @@ -1310,8 +1359,10 @@ static void test_file_disposition_information(void) FILE_DISPOSITION_INFORMATION fdi; BOOL fileDeleted; + GetTempPathA( MAX_PATH, tmp_path ); + /* cannot set disposition on file not opened with delete access */ - GetTempFileNameA( ".", "dis", 0, buffer ); + GetTempFileNameA( tmp_path, "dis", 0, buffer ); handle = CreateFileA(buffer, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0); ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); res = pNtQueryInformationFile( handle, &io, &fdi, sizeof fdi, FileDispositionInformation ); @@ -1326,7 +1377,7 @@ static void test_file_disposition_information(void) DeleteFileA( buffer ); /* can set disposition on file opened with proper access */ - GetTempFileNameA( ".", "dis", 0, buffer ); + GetTempFileNameA( tmp_path, "dis", 0, buffer ); handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0); ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); fdi.DoDeleteFile = TRUE; @@ -1340,7 +1391,7 @@ static void test_file_disposition_information(void) DeleteFileA( buffer ); /* cannot set disposition on readonly file */ - GetTempFileNameA( ".", "dis", 0, buffer ); + GetTempFileNameA( tmp_path, "dis", 0, buffer ); handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_READONLY, 0); ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); fdi.DoDeleteFile = TRUE; @@ -1354,7 +1405,7 @@ static void test_file_disposition_information(void) DeleteFileA( buffer ); /* can set disposition on file and then reset it */ - GetTempFileNameA( ".", "dis", 0, buffer ); + GetTempFileNameA( tmp_path, "dis", 0, buffer ); handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, 0, 0); ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); fdi.DoDeleteFile = TRUE; @@ -1371,7 +1422,7 @@ static void test_file_disposition_information(void) DeleteFileA( buffer ); /* Delete-on-close flag doesn't change file disposition until a handle is closed */ - GetTempFileNameA( ".", "dis", 0, buffer ); + GetTempFileNameA( tmp_path, "dis", 0, buffer ); handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0); ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); fdi.DoDeleteFile = FALSE; @@ -1384,7 +1435,7 @@ static void test_file_disposition_information(void) DeleteFileA( buffer ); /* Delete-on-close flag sets disposition when a handle is closed and then it could be changed back */ - GetTempFileNameA( ".", "dis", 0, buffer ); + GetTempFileNameA( tmp_path, "dis", 0, buffer ); handle = CreateFileA(buffer, GENERIC_WRITE | DELETE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, 0); ok( handle != INVALID_HANDLE_VALUE, "failed to create temp file\n" ); ok( DuplicateHandle( GetCurrentProcess(), handle, GetCurrentProcess(), &handle2, 0, FALSE, DUPLICATE_SAME_ACCESS ), "DuplicateHandle failed\n" ); @@ -1399,7 +1450,7 @@ static void test_file_disposition_information(void) DeleteFileA( buffer ); /* can set disposition on a directory opened with proper access */ - GetTempFileNameA( ".", "dis", 0, buffer ); + GetTempFileNameA( tmp_path, "dis", 0, buffer ); DeleteFileA( buffer ); ok( CreateDirectoryA( buffer, NULL ), "CreateDirectory failed\n" ); handle = CreateFileA(buffer, DELETE, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); @@ -1415,7 +1466,7 @@ static void test_file_disposition_information(void) RemoveDirectoryA( buffer ); /* RemoveDirectory sets directory disposition and it can be undone */ - GetTempFileNameA( ".", "dis", 0, buffer ); + GetTempFileNameA( tmp_path, "dis", 0, buffer ); DeleteFileA( buffer ); ok( CreateDirectoryA( buffer, NULL ), "CreateDirectory failed\n" ); handle = CreateFileA(buffer, DELETE, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); @@ -1431,7 +1482,7 @@ static void test_file_disposition_information(void) RemoveDirectoryA( buffer ); /* cannot set disposition on a non-empty directory */ - GetTempFileNameA( ".", "dis", 0, buffer ); + GetTempFileNameA( tmp_path, "dis", 0, buffer ); DeleteFileA( buffer ); ok( CreateDirectoryA( buffer, NULL ), "CreateDirectory failed\n" ); handle = CreateFileA(buffer, DELETE, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0); @@ -1921,53 +1972,81 @@ static void test_NtCreateFile(void) static void test_read_write(void) { - static const char contents[] = "1234567890abcd"; + static const char contents[14] = "1234567890abcd"; char buf[256]; HANDLE hfile; OVERLAPPED ovl; IO_STATUS_BLOCK iob; - DWORD ret, bytes, status; + DWORD ret, bytes, status, off; LARGE_INTEGER offset; + LONG i; - iob.Status = -1; + U(iob).Status = -1; iob.Information = -1; offset.QuadPart = 0; status = pNtReadFile(INVALID_HANDLE_VALUE, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); ok(status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE, "expected STATUS_OBJECT_TYPE_MISMATCH, got %#x\n", status); - ok(iob.Status == -1, "expected -1, got %#x\n", iob.Status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); ok(iob.Information == -1, "expected -1, got %lu\n", iob.Information); - iob.Status = -1; + U(iob).Status = -1; iob.Information = -1; offset.QuadPart = 0; status = pNtWriteFile(INVALID_HANDLE_VALUE, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); ok(status == STATUS_OBJECT_TYPE_MISMATCH || status == STATUS_INVALID_HANDLE, "expected STATUS_OBJECT_TYPE_MISMATCH, got %#x\n", status); - ok(iob.Status == -1, "expected -1, got %#x\n", iob.Status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); ok(iob.Information == -1, "expected -1, got %lu\n", iob.Information); hfile = create_temp_file(0); if (!hfile) return; - iob.Status = -1; + U(iob).Status = -1; iob.Information = -1; status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, NULL, sizeof(contents), NULL, NULL); ok(status == STATUS_INVALID_USER_BUFFER, "expected STATUS_INVALID_USER_BUFFER, got %#x\n", status); - ok(iob.Status == -1, "expected -1, got %#x\n", iob.Status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); ok(iob.Information == -1, "expected -1, got %lu\n", iob.Information); - iob.Status = -1; + U(iob).Status = -1; iob.Information = -1; status = pNtReadFile(hfile, 0, NULL, NULL, &iob, NULL, sizeof(contents), NULL, NULL); ok(status == STATUS_ACCESS_VIOLATION, "expected STATUS_ACCESS_VIOLATION, got %#x\n", status); - ok(iob.Status == -1, "expected -1, got %#x\n", iob.Status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); ok(iob.Information == -1, "expected -1, got %lu\n", iob.Information); - iob.Status = -1; + U(iob).Status = -1; iob.Information = -1; - status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents, sizeof(contents), NULL, NULL); + status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents, 7, NULL, NULL); ok(status == STATUS_SUCCESS, "NtWriteFile error %#x\n", status); - ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status); - ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); + ok(iob.Information == 7, "expected 7, got %lu\n", iob.Information); + + SetFilePointer(hfile, 0, NULL, FILE_BEGIN); + + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = (LONGLONG)-1 /* FILE_WRITE_TO_END_OF_FILE */; + status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents + 7, sizeof(contents) - 7, &offset, NULL); + ok(status == STATUS_SUCCESS, "NtWriteFile error %#x\n", status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); + ok(iob.Information == sizeof(contents) - 7, "expected sizeof(contents)-7, got %lu\n", iob.Information); + + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == sizeof(contents), "expected sizeof(contents), got %u\n", off); + + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadFile(INVALID_HANDLE_VALUE, buf, 0, &bytes, NULL); + ok(!ret, "ReadFile should fail\n"); + ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadFile(hfile, buf, 0, &bytes, NULL); + ok(ret, "ReadFile error %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); bytes = 0xdeadbeef; SetLastError(0xdeadbeef); @@ -1985,16 +2064,39 @@ static void test_read_write(void) ok(bytes == sizeof(contents), "bytes %u\n", bytes); ok(!memcmp(contents, buf, sizeof(contents)), "file contents mismatch\n"); + for (i = -20; i < -1; i++) + { + if (i == -2) continue; + + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = (LONGLONG)i; + status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents, sizeof(contents), &offset, NULL); + ok(status == STATUS_INVALID_PARAMETER, "%d: expected STATUS_INVALID_PARAMETER, got %#x\n", i, status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); + ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); + } + SetFilePointer(hfile, sizeof(contents) - 4, NULL, FILE_BEGIN); - iob.Status = -1; + U(iob).Status = -1; iob.Information = -1; offset.QuadPart = (LONGLONG)-2 /* FILE_USE_FILE_POINTER_POSITION */; status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, "DCBA", 4, &offset, NULL); ok(status == STATUS_SUCCESS, "NtWriteFile error %#x\n", status); - ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == 4, "expected 4, got %lu\n", iob.Information); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == sizeof(contents), "expected sizeof(contents), got %u\n", off); + + U(iob).Status = -1; + iob.Information = -1; + status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), NULL, NULL); + ok(status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", status); + ok(U(iob).Status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", U(iob).Status); + ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + SetFilePointer(hfile, 0, NULL, FILE_BEGIN); bytes = 0; @@ -2005,6 +2107,9 @@ static void test_read_write(void) ok(!memcmp(contents, buf, sizeof(contents) - 4), "file contents mismatch\n"); ok(!memcmp(buf + sizeof(contents) - 4, "DCBA", 4), "file contents mismatch\n"); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == sizeof(contents), "expected sizeof(contents), got %u\n", off); + SetFilePointer(hfile, 0, NULL, FILE_BEGIN); bytes = 0; @@ -2013,25 +2118,118 @@ static void test_read_write(void) ok(ret, "WriteFile error %d\n", GetLastError()); ok(bytes == sizeof(contents), "bytes %u\n", bytes); - iob.Status = -1; + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == sizeof(contents), "expected sizeof(contents), got %u\n", off); + + /* test reading beyond EOF */ + bytes = -1; + SetLastError(0xdeadbeef); + ret = ReadFile(hfile, buf, sizeof(buf), &bytes, NULL); + ok(ret, "ReadFile error %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + + bytes = -1; + SetLastError(0xdeadbeef); + ret = ReadFile(hfile, buf, 0, &bytes, NULL); + ok(ret, "ReadFile error %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + + bytes = -1; + SetLastError(0xdeadbeef); + ret = ReadFile(hfile, NULL, 0, &bytes, NULL); + ok(ret, "ReadFile error %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + + S(U(ovl)).Offset = sizeof(contents); + S(U(ovl)).OffsetHigh = 0; + ovl.Internal = -1; + ovl.InternalHigh = -1; + ovl.hEvent = 0; + bytes = -1; + SetLastError(0xdeadbeef); + ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl); + ok(!ret, "ReadFile should fail\n"); + ok(GetLastError() == ERROR_HANDLE_EOF, "expected ERROR_HANDLE_EOF, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + ok((NTSTATUS)ovl.Internal == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#lx\n", ovl.Internal); + ok(ovl.InternalHigh == 0, "expected 0, got %lu\n", ovl.InternalHigh); + + S(U(ovl)).Offset = sizeof(contents); + S(U(ovl)).OffsetHigh = 0; + ovl.Internal = -1; + ovl.InternalHigh = -1; + ovl.hEvent = 0; + bytes = -1; + SetLastError(0xdeadbeef); + ret = ReadFile(hfile, buf, 0, &bytes, &ovl); + ok(ret, "ReadFile error %d\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", ovl.Internal); + ok(ovl.InternalHigh == 0, "expected 0, got %lu\n", ovl.InternalHigh); + + U(iob).Status = -1; iob.Information = -1; status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), NULL, NULL); ok(status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", status); -todo_wine - ok(iob.Status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", iob.Status); -todo_wine + ok(U(iob).Status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", U(iob).Status); ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); - iob.Status = -1; + U(iob).Status = -1; + iob.Information = -1; + status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, 0, NULL, NULL); + ok(status == STATUS_SUCCESS, "NtReadFile error %#x\n", status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); + ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = sizeof(contents); + status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); + ok(status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", status); + ok(U(iob).Status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", U(iob).Status); + ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = sizeof(contents); + status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, 0, &offset, NULL); + ok(status == STATUS_SUCCESS, "NtReadFile error %#x\n", status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); + ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + + U(iob).Status = -1; iob.Information = -1; offset.QuadPart = (LONGLONG)-2 /* FILE_USE_FILE_POINTER_POSITION */; status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); ok(status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", status); -todo_wine - ok(iob.Status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", iob.Status); -todo_wine + ok(U(iob).Status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", U(iob).Status); ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = (LONGLONG)-2 /* FILE_USE_FILE_POINTER_POSITION */; + status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, 0, &offset, NULL); + ok(status == STATUS_SUCCESS, "NtReadFile error %#x\n", status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); + ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + + for (i = -20; i < 0; i++) + { + if (i == -2) continue; + + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = (LONGLONG)i; + status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); + ok(status == STATUS_INVALID_PARAMETER, "%d: expected STATUS_INVALID_PARAMETER, got %#x\n", i, status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); + ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); + } + SetFilePointer(hfile, 0, NULL, FILE_BEGIN); bytes = 0; @@ -2041,42 +2239,45 @@ todo_wine ok(bytes == sizeof(contents), "bytes %u\n", bytes); ok(!memcmp(contents, buf, sizeof(contents)), "file contents mismatch\n"); - iob.Status = -1; - iob.Information = -1; - status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), NULL, NULL); - ok(status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", status); -todo_wine - ok(iob.Status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", iob.Status); -todo_wine - ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == sizeof(contents), "expected sizeof(contents), got %u\n", off); - iob.Status = -1; + U(iob).Status = -1; iob.Information = -1; offset.QuadPart = 0; status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); ok(status == STATUS_SUCCESS, "NtReadFile error %#x\n", status); - ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information); ok(!memcmp(contents, buf, sizeof(contents)), "file contents mismatch\n"); - iob.Status = -1; + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == sizeof(contents), "expected sizeof(contents), got %u\n", off); + + U(iob).Status = -1; iob.Information = -1; offset.QuadPart = sizeof(contents) - 4; status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, "DCBA", 4, &offset, NULL); ok(status == STATUS_SUCCESS, "NtWriteFile error %#x\n", status); - ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == 4, "expected 4, got %lu\n", iob.Information); - iob.Status = -1; + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == sizeof(contents), "expected sizeof(contents), got %u\n", off); + + U(iob).Status = -1; iob.Information = -1; offset.QuadPart = 0; status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); ok(status == STATUS_SUCCESS, "NtReadFile error %#x\n", status); - ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information); ok(!memcmp(contents, buf, sizeof(contents) - 4), "file contents mismatch\n"); ok(!memcmp(buf + sizeof(contents) - 4, "DCBA", 4), "file contents mismatch\n"); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == sizeof(contents), "expected sizeof(contents), got %u\n", off); + S(U(ovl)).Offset = sizeof(contents) - 4; S(U(ovl)).OffsetHigh = 0; ovl.hEvent = 0; @@ -2086,6 +2287,9 @@ todo_wine ok(ret, "WriteFile error %d\n", GetLastError()); ok(bytes == 4, "bytes %u\n", bytes); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == sizeof(contents), "expected sizeof(contents), got %u\n", off); + S(U(ovl)).Offset = 0; S(U(ovl)).OffsetHigh = 0; ovl.Internal = -1; @@ -2101,6 +2305,9 @@ todo_wine ok(!memcmp(contents, buf, sizeof(contents) - 4), "file contents mismatch\n"); ok(!memcmp(buf + sizeof(contents) - 4, "ABCD", 4), "file contents mismatch\n"); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == sizeof(contents), "expected sizeof(contents), got %u\n", off); + CloseHandle(hfile); hfile = create_temp_file(FILE_FLAG_OVERLAPPED); @@ -2108,58 +2315,64 @@ todo_wine bytes = 0xdeadbeef; SetLastError(0xdeadbeef); - ret = WriteFile(hfile, contents, sizeof(contents), &bytes, NULL); -todo_wine - ok(!ret, "WriteFile should fail\n"); -todo_wine - ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); -todo_wine + ret = ReadFile(INVALID_HANDLE_VALUE, buf, 0, &bytes, NULL); + ok(!ret, "ReadFile should fail\n"); + ok(GetLastError() == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %d\n", GetLastError()); ok(bytes == 0, "bytes %u\n", bytes); - iob.Status = -1; + S(U(ovl)).Offset = 0; + S(U(ovl)).OffsetHigh = 0; + ovl.Internal = -1; + ovl.InternalHigh = -1; + ovl.hEvent = 0; + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + /* ReadFile return value depends on Windows version and testing it is not practical */ + ReadFile(hfile, buf, 0, &bytes, &ovl); + ok(bytes == 0, "bytes %u\n", bytes); + ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", ovl.Internal); + ok(ovl.InternalHigh == 0, "expected 0, got %lu\n", ovl.InternalHigh); + + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = WriteFile(hfile, contents, sizeof(contents), &bytes, NULL); + ok(!ret, "WriteFile should fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + + U(iob).Status = -1; iob.Information = -1; status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents, sizeof(contents), NULL, NULL); -todo_wine ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#x\n", status); -todo_wine - ok(iob.Status == -1, "expected -1, got %#x\n", iob.Status); -todo_wine + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); - iob.Status = -1; - iob.Information = -1; - offset.QuadPart = (LONGLONG)-2 /* FILE_USE_FILE_POINTER_POSITION */; - status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents, sizeof(contents), &offset, NULL); -todo_wine - ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#x\n", status); -todo_wine - ok(iob.Status == -1, "expected -1, got %#x\n", iob.Status); -todo_wine - ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); + for (i = -20; i < -1; i++) + { + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = (LONGLONG)i; + status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents, sizeof(contents), &offset, NULL); + ok(status == STATUS_INVALID_PARAMETER, "%d: expected STATUS_INVALID_PARAMETER, got %#x\n", i, status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); + ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); + } - iob.Status = -1; + U(iob).Status = -1; iob.Information = -1; offset.QuadPart = 0; status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents, sizeof(contents), &offset, NULL); -todo_wine - ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* see below */, "expected STATUS_PENDING, got %#x\n", status); - ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status); - ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information); - /* even fully updated XP passes this test, but it looks like some VMs - * in a testbot get never updated, so overlapped IO is broken. Instead - * of fighting with broken tests and adding a bunch of broken() statements - * it's better to skip further tests completely. - */ - if (status != STATUS_PENDING) + ok(status == STATUS_PENDING || status == STATUS_SUCCESS /* before Vista */, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status); + if (status == STATUS_PENDING) { -todo_wine - win_skip("broken overlapped IO implementation, update your OS\n"); - CloseHandle(hfile); - return; + ret = WaitForSingleObject(hfile, 3000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); } + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); + ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information); - ret = WaitForSingleObject(hfile, 3000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); bytes = 0xdeadbeef; SetLastError(0xdeadbeef); @@ -2168,21 +2381,28 @@ todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); ok(bytes == 0, "bytes %u\n", bytes); - iob.Status = -1; + U(iob).Status = -1; iob.Information = -1; status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), NULL, NULL); ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#x\n", status); - ok(iob.Status == -1, "expected -1, got %#x\n", iob.Status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); - iob.Status = -1; - iob.Information = -1; - offset.QuadPart = (LONGLONG)-2 /* FILE_USE_FILE_POINTER_POSITION */; - status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); - ok(status == STATUS_INVALID_PARAMETER, "expected STATUS_INVALID_PARAMETER, got %#x\n", status); - ok(iob.Status == -1, "expected -1, got %#x\n", iob.Status); - ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); + for (i = -20; i < 0; i++) + { + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = (LONGLONG)i; + status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); + ok(status == STATUS_INVALID_PARAMETER, "%d: expected STATUS_INVALID_PARAMETER, got %#x\n", i, status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); + ok(iob.Information == -1, "expected -1, got %ld\n", iob.Information); + } + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + + /* test reading beyond EOF */ offset.QuadPart = sizeof(contents); S(U(ovl)).Offset = offset.u.LowPart; S(U(ovl)).OffsetHigh = offset.u.HighPart; @@ -2193,52 +2413,131 @@ todo_wine SetLastError(0xdeadbeef); ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl); ok(!ret, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_IO_PENDING || broken(GetLastError() == ERROR_HANDLE_EOF), "expected ERROR_IO_PENDING, got %d\n", GetLastError()); - /* even fully updated XP passes this test, but it looks like some VMs - * in a testbot get never updated, so overlapped IO is broken. Instead - * of fighting with broken tests and adding a bunch of broken() statements - * it's better to skip further tests completely. - */ - if (GetLastError() != ERROR_IO_PENDING) - { - win_skip("broken overlapped IO implementation, update your OS\n"); - CloseHandle(hfile); - return; - } + ret = GetLastError(); + ok(ret == ERROR_IO_PENDING || ret == ERROR_HANDLE_EOF /* before Vista */, "expected ERROR_IO_PENDING or ERROR_HANDLE_EOF, got %d\n", ret); ok(bytes == 0, "bytes %u\n", bytes); - ok((NTSTATUS)ovl.Internal == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#lx\n", ovl.Internal); - ok(ovl.InternalHigh == 0, "expected 0, got %lu\n", ovl.InternalHigh); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + + if (ret == ERROR_IO_PENDING) + { + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = GetOverlappedResult(hfile, &ovl, &bytes, TRUE); + ok(!ret, "GetOverlappedResult should report FALSE\n"); + ok(GetLastError() == ERROR_HANDLE_EOF, "expected ERROR_HANDLE_EOF, got %d\n", GetLastError()); + ok(bytes == 0, "expected 0, read %u\n", bytes); + ok((NTSTATUS)ovl.Internal == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#lx\n", ovl.Internal); + ok(ovl.InternalHigh == 0, "expected 0, got %lu\n", ovl.InternalHigh); + } + + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + + offset.QuadPart = sizeof(contents); + S(U(ovl)).Offset = offset.u.LowPart; + S(U(ovl)).OffsetHigh = offset.u.HighPart; + ovl.Internal = -1; + ovl.InternalHigh = -1; + ovl.hEvent = 0; bytes = 0xdeadbeef; - ret = GetOverlappedResult(hfile, &ovl, &bytes, TRUE); - ok(!ret, "GetOverlappedResult should report FALSE\n"); - ok(GetLastError() == ERROR_HANDLE_EOF, "expected ERROR_HANDLE_EOF, got %d\n", GetLastError()); - ok(bytes == 0, "expected 0, read %u\n", bytes); - ok((NTSTATUS)ovl.Internal == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#lx\n", ovl.Internal); - ok(ovl.InternalHigh == 0, "expected 0, got %lu\n", ovl.InternalHigh); + SetLastError(0xdeadbeef); + ret = ReadFile(hfile, buf, 0, &bytes, &ovl); + /* ReadFile return value depends on Windows version and testing it is not practical */ + if (!ret) +todo_wine + ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); + ret = GetLastError(); + ok(bytes == 0, "bytes %u\n", bytes); - iob.Status = -1; + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + + if (ret == ERROR_IO_PENDING) + { + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = GetOverlappedResult(hfile, &ovl, &bytes, TRUE); + ok(ret, "GetOverlappedResult should report TRUE\n"); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(bytes == 0, "expected 0, read %u\n", bytes); + ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", ovl.Internal); + ok(ovl.InternalHigh == 0, "expected 0, got %lu\n", ovl.InternalHigh); + } + + offset.QuadPart = sizeof(contents); + S(U(ovl)).Offset = offset.u.LowPart; + S(U(ovl)).OffsetHigh = offset.u.HighPart; + ovl.Internal = -1; + ovl.InternalHigh = -1; + ovl.hEvent = 0; + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = ReadFile(hfile, NULL, 0, &bytes, &ovl); + /* ReadFile return value depends on Windows version and testing it is not practical */ + if (!ret) +todo_wine + ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); + ret = GetLastError(); + ok(bytes == 0, "bytes %u\n", bytes); + + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + + if (ret == ERROR_IO_PENDING) + { + bytes = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = GetOverlappedResult(hfile, &ovl, &bytes, TRUE); + ok(ret, "GetOverlappedResult should report TRUE\n"); + ok(GetLastError() == 0xdeadbeef, "expected 0xdeadbeef, got %d\n", GetLastError()); + ok(bytes == 0, "expected 0, read %u\n", bytes); + ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", ovl.Internal); + ok(ovl.InternalHigh == 0, "expected 0, got %lu\n", ovl.InternalHigh); + } + + U(iob).Status = -1; iob.Information = -1; offset.QuadPart = sizeof(contents); status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); - ok(status == STATUS_PENDING, "expected STATUS_PENDING, got %#x\n", status); - ok(iob.Status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", iob.Status); - ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + if (status == STATUS_PENDING) + { + ret = WaitForSingleObject(hfile, 3000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + ok(U(iob).Status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", U(iob).Status); + ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + } + else + { + ok(status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", status); + ok(U(iob).Status == -1, "expected -1, got %#x\n", U(iob).Status); + ok(iob.Information == -1, "expected -1, got %lu\n", iob.Information); + } - S(U(ovl)).Offset = offset.u.LowPart; - S(U(ovl)).OffsetHigh = offset.u.HighPart; - ovl.Internal = iob.Status; - ovl.InternalHigh = iob.Information; - ovl.hEvent = 0; - bytes = 0xdeadbeef; - ret = GetOverlappedResult(hfile, &ovl, &bytes, TRUE); - ok(!ret, "GetOverlappedResult should report FALSE\n"); - ok(GetLastError() == ERROR_HANDLE_EOF, "expected ERROR_HANDLE_EOF, got %d\n", GetLastError()); - ok(bytes == 0, "expected 0, read %u\n", bytes); - ok((NTSTATUS)ovl.Internal == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#lx\n", ovl.Internal); - ok(ovl.InternalHigh == 0, "expected 0, got %lu\n", ovl.InternalHigh); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); - SetFilePointer(hfile, 0, NULL, FILE_BEGIN); + U(iob).Status = -1; + iob.Information = -1; + offset.QuadPart = sizeof(contents); + status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, 0, &offset, NULL); + if (status == STATUS_PENDING) + { + ret = WaitForSingleObject(hfile, 3000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); + ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + } + else + { + ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", status); + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); + ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); + } + + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); S(U(ovl)).Offset = 0; S(U(ovl)).OffsetHigh = 0; @@ -2248,12 +2547,19 @@ todo_wine bytes = 0; SetLastError(0xdeadbeef); ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl); - ok(!ret, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); - ok(bytes == 0, "bytes %u\n", bytes); + /* ReadFile return value depends on Windows version and testing it is not practical */ + if (!ret) + { + ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + } + else ok(bytes == 14, "bytes %u\n", bytes); ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", ovl.Internal); ok(ovl.InternalHigh == sizeof(contents), "expected sizeof(contents), got %lu\n", ovl.InternalHigh); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + bytes = 0xdeadbeef; ret = GetOverlappedResult(hfile, &ovl, &bytes, TRUE); ok(ret, "GetOverlappedResult error %d\n", GetLastError()); @@ -2262,30 +2568,51 @@ todo_wine ok(ovl.InternalHigh == sizeof(contents), "expected sizeof(contents), got %lu\n", ovl.InternalHigh); ok(!memcmp(contents, buf, sizeof(contents)), "file contents mismatch\n"); - iob.Status = -1; + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + + SetFilePointer(hfile, sizeof(contents) - 4, NULL, FILE_BEGIN); + SetEndOfFile(hfile); + SetFilePointer(hfile, 0, NULL, FILE_BEGIN); + + U(iob).Status = -1; iob.Information = -1; - offset.QuadPart = sizeof(contents) - 4; + offset.QuadPart = (LONGLONG)-1 /* FILE_WRITE_TO_END_OF_FILE */; status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, "DCBA", 4, &offset, NULL); - ok(status == STATUS_PENDING || broken(status == STATUS_SUCCESS) /* before Vista */, "expected STATUS_PENDING, got %#x\n", status); - ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status); + ok(status == STATUS_PENDING || status == STATUS_SUCCESS /* before Vista */, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status); + if (status == STATUS_PENDING) + { + ret = WaitForSingleObject(hfile, 3000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + } + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == 4, "expected 4, got %lu\n", iob.Information); - ret = WaitForSingleObject(hfile, 3000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); - iob.Status = -1; + U(iob).Status = -1; iob.Information = -1; offset.QuadPart = 0; status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); - ok(status == STATUS_PENDING, "expected STATUS_PENDING, got %#x\n", status); - ok(iob.Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", iob.Status); + ok(status == STATUS_PENDING || status == STATUS_SUCCESS, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status); + if (status == STATUS_PENDING) + { + ret = WaitForSingleObject(hfile, 3000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + } + ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information); - ret = WaitForSingleObject(hfile, 3000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + ok(!memcmp(contents, buf, sizeof(contents) - 4), "file contents mismatch\n"); ok(!memcmp(buf + sizeof(contents) - 4, "DCBA", 4), "file contents mismatch\n"); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + S(U(ovl)).Offset = sizeof(contents) - 4; S(U(ovl)).OffsetHigh = 0; ovl.Internal = -1; @@ -2294,12 +2621,19 @@ todo_wine bytes = 0; SetLastError(0xdeadbeef); ret = WriteFile(hfile, "ABCD", 4, &bytes, &ovl); - ok(!ret || broken(ret) /* before Vista */, "WriteFile should fail\n"); - ok(GetLastError() == ERROR_IO_PENDING || broken(GetLastError() == 0xdeadbeef) /* before Vista */, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); - ok(bytes == 0 || broken(bytes == 4) /* before Vista */, "bytes %u\n", bytes); + /* WriteFile return value depends on Windows version and testing it is not practical */ + if (!ret) + { + ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + } + else ok(bytes == 4, "bytes %u\n", bytes); ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", ovl.Internal); ok(ovl.InternalHigh == 4, "expected 4, got %lu\n", ovl.InternalHigh); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + bytes = 0xdeadbeef; ret = GetOverlappedResult(hfile, &ovl, &bytes, TRUE); ok(ret, "GetOverlappedResult error %d\n", GetLastError()); @@ -2307,6 +2641,9 @@ todo_wine ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", ovl.Internal); ok(ovl.InternalHigh == 4, "expected 4, got %lu\n", ovl.InternalHigh); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + S(U(ovl)).Offset = 0; S(U(ovl)).OffsetHigh = 0; ovl.Internal = -1; @@ -2315,12 +2652,19 @@ todo_wine bytes = 0; SetLastError(0xdeadbeef); ret = ReadFile(hfile, buf, sizeof(buf), &bytes, &ovl); - ok(!ret, "ReadFile should fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); - ok(bytes == 0, "bytes %u\n", bytes); + /* ReadFile return value depends on Windows version and testing it is not practical */ + if (!ret) + { + ok(GetLastError() == ERROR_IO_PENDING, "expected ERROR_IO_PENDING, got %d\n", GetLastError()); + ok(bytes == 0, "bytes %u\n", bytes); + } + else ok(bytes == 14, "bytes %u\n", bytes); ok((NTSTATUS)ovl.Internal == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#lx\n", ovl.Internal); ok(ovl.InternalHigh == sizeof(contents), "expected sizeof(contents), got %lu\n", ovl.InternalHigh); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + bytes = 0xdeadbeef; ret = GetOverlappedResult(hfile, &ovl, &bytes, TRUE); ok(ret, "GetOverlappedResult error %d\n", GetLastError()); @@ -2330,6 +2674,9 @@ todo_wine ok(!memcmp(contents, buf, sizeof(contents) - 4), "file contents mismatch\n"); ok(!memcmp(buf + sizeof(contents) - 4, "ABCD", 4), "file contents mismatch\n"); + off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); + ok(off == 0, "expected 0, got %u\n", off); + CloseHandle(hfile); } diff --git a/rostests/winetests/ntdll/generated.c b/rostests/winetests/ntdll/generated.c index 9e9fc31426f..f8ef346c776 100755 --- a/rostests/winetests/ntdll/generated.c +++ b/rostests/winetests/ntdll/generated.c @@ -1903,13 +1903,6 @@ static void test_pack_PCSTR(void) TEST_TARGET_ALIGN(PCSTR, 1) } -static void test_pack_PCTSTR(void) -{ - /* PCTSTR */ - TEST_TYPE_SIZE (PCTSTR, 8) - TEST_TYPE_ALIGN (PCTSTR, 8) -} - static void test_pack_PCWCH(void) { /* PCWCH */ @@ -2574,13 +2567,6 @@ static void test_pack_PTOKEN_USER(void) TEST_TARGET_ALIGN(PTOKEN_USER, 8) } -static void test_pack_PTSTR(void) -{ - /* PTSTR */ - TEST_TYPE_SIZE (PTSTR, 8) - TEST_TYPE_ALIGN (PTSTR, 8) -} - static void test_pack_PULARGE_INTEGER(void) { /* PULARGE_INTEGER */ @@ -2935,13 +2921,6 @@ static void test_pack_SYSTEM_AUDIT_ACE(void) TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart, 8) } -static void test_pack_TCHAR(void) -{ - /* TCHAR */ - TEST_TYPE_SIZE (TCHAR, 1) - TEST_TYPE_ALIGN (TCHAR, 1) -} - static void test_pack_TOKEN_DEFAULT_DACL(void) { /* TOKEN_DEFAULT_DACL */ @@ -5271,13 +5250,6 @@ static void test_pack_PCSTR(void) TEST_TARGET_ALIGN(PCSTR, 1) } -static void test_pack_PCTSTR(void) -{ - /* PCTSTR */ - TEST_TYPE_SIZE (PCTSTR, 4) - TEST_TYPE_ALIGN (PCTSTR, 4) -} - static void test_pack_PCWCH(void) { /* PCWCH */ @@ -5940,13 +5912,6 @@ static void test_pack_PTOKEN_USER(void) TEST_TARGET_ALIGN(PTOKEN_USER, 4) } -static void test_pack_PTSTR(void) -{ - /* PTSTR */ - TEST_TYPE_SIZE (PTSTR, 4) - TEST_TYPE_ALIGN (PTSTR, 4) -} - static void test_pack_PULARGE_INTEGER(void) { /* PULARGE_INTEGER */ @@ -6301,13 +6266,6 @@ static void test_pack_SYSTEM_AUDIT_ACE(void) TEST_FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart, 8) } -static void test_pack_TCHAR(void) -{ - /* TCHAR */ - TEST_TYPE_SIZE (TCHAR, 1) - TEST_TYPE_ALIGN (TCHAR, 1) -} - static void test_pack_TOKEN_DEFAULT_DACL(void) { /* TOKEN_DEFAULT_DACL */ @@ -6935,7 +6893,6 @@ static void test_pack(void) test_pack_PCCH(); test_pack_PCH(); test_pack_PCSTR(); - test_pack_PCTSTR(); test_pack_PCWCH(); test_pack_PCWSTR(); test_pack_PEXCEPTION_POINTERS(); @@ -7022,7 +6979,6 @@ static void test_pack(void) test_pack_PTOKEN_GROUPS(); test_pack_PTOKEN_PRIVILEGES(); test_pack_PTOKEN_USER(); - test_pack_PTSTR(); test_pack_PULARGE_INTEGER(); test_pack_PVECTORED_EXCEPTION_HANDLER(); test_pack_PVOID(); @@ -7052,7 +7008,6 @@ static void test_pack(void) test_pack_SSIZE_T(); test_pack_SYSTEM_ALARM_ACE(); test_pack_SYSTEM_AUDIT_ACE(); - test_pack_TCHAR(); test_pack_TOKEN_DEFAULT_DACL(); test_pack_TOKEN_GROUPS(); test_pack_TOKEN_OWNER(); diff --git a/rostests/winetests/ntdll/info.c b/rostests/winetests/ntdll/info.c index 87f3c9c3340..af0040166f8 100755 --- a/rostests/winetests/ntdll/info.c +++ b/rostests/winetests/ntdll/info.c @@ -55,7 +55,7 @@ static DWORD one_before_last_pid = 0; static BOOL InitFunctionPtrs(void) { /* All needed functions are NT based, so using GetModuleHandle is a good check */ - HMODULE hntdll = GetModuleHandle("ntdll"); + HMODULE hntdll = GetModuleHandleA("ntdll"); if (!hntdll) { win_skip("Not running on NT\n"); @@ -78,7 +78,7 @@ static BOOL InitFunctionPtrs(void) /* not present before XP */ pNtGetCurrentProcessorNumber = (void *) GetProcAddress(hntdll, "NtGetCurrentProcessorNumber"); - pIsWow64Process = (void *)GetProcAddress(GetModuleHandle("kernel32.dll"), "IsWow64Process"); + pIsWow64Process = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsWow64Process"); if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE; return TRUE; } @@ -110,7 +110,7 @@ static void test_query_basic(void) ok( status == STATUS_ACCESS_VIOLATION || status == STATUS_INVALID_PARAMETER /* vista */, "Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_PARAMETER, got %08x\n", status); - /* Use a existing class, correct length, a pointer to a buffer but no ReturnLength pointer */ + /* Use an existing class, correct length, a pointer to a buffer but no ReturnLength pointer */ trace("Check no ReturnLength pointer\n"); status = pNtQuerySystemInformation(SystemBasicInformation, &sbi, sizeof(sbi), NULL); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); @@ -259,7 +259,7 @@ static void test_query_process(void) DWORD last_pid; ULONG ReturnLength; int i = 0, k = 0; - int is_nt = 0; + BOOL is_nt = FALSE; SYSTEM_BASIC_INFORMATION sbi; /* Copy of our winternl.h structure turned into a private one */ @@ -946,14 +946,14 @@ static void test_query_process_debug_port(int argc, char **argv) DWORD_PTR debug_port = 0xdeadbeef; char cmdline[MAX_PATH]; PROCESS_INFORMATION pi; - STARTUPINFO si = { 0 }; + STARTUPINFOA si = { 0 }; NTSTATUS status; BOOL ret; sprintf(cmdline, "%s %s %s", argv[0], argv[1], "debuggee"); si.cb = sizeof(si); - ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi); + ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi); ok(ret, "CreateProcess failed, last error %#x.\n", GetLastError()); if (!ret) return; @@ -1099,7 +1099,7 @@ static void test_query_process_image_file_name(void) static void test_query_process_debug_object_handle(int argc, char **argv) { char cmdline[MAX_PATH]; - STARTUPINFO si = {0}; + STARTUPINFOA si = {0}; PROCESS_INFORMATION pi; BOOL ret; HANDLE debug_object; @@ -1108,7 +1108,7 @@ static void test_query_process_debug_object_handle(int argc, char **argv) sprintf(cmdline, "%s %s %s", argv[0], argv[1], "debuggee"); si.cb = sizeof(si); - ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, + ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS, NULL, NULL, &si, &pi); ok(ret, "CreateProcess failed with last error %u\n", GetLastError()); if (!ret) return; @@ -1198,14 +1198,14 @@ static void test_query_process_debug_flags(int argc, char **argv) DWORD debug_flags = 0xdeadbeef; char cmdline[MAX_PATH]; PROCESS_INFORMATION pi; - STARTUPINFO si = { 0 }; + STARTUPINFOA si = { 0 }; NTSTATUS status; BOOL ret; sprintf(cmdline, "%s %s %s", argv[0], argv[1], "debuggee"); si.cb = sizeof(si); - ret = CreateProcess(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS, NULL, NULL, &si, &pi); + ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS, NULL, NULL, &si, &pi); ok(ret, "CreateProcess failed, last error %#x.\n", GetLastError()); if (!ret) return; @@ -1359,12 +1359,17 @@ static void test_mapprotection(void) addr = NULL; status = pNtMapViewOfSection ( h, GetCurrentProcess(), &addr, 0, 0, &offset, &count, ViewShare, 0, PAGE_READWRITE); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); + #if defined(__x86_64__) || defined(__i386__) - memset (addr, 0xc3, 1); /* lret ... in both i386 and x86_64 */ + *(unsigned char*)addr = 0xc3; /* lret ... in both i386 and x86_64 */ +#elif defined(__arm__) + *(unsigned long*)addr = 0xe12fff1e; /* bx lr */ +#else + ok(0, "Add a return opcode for your architecture or expect a crash in this test\n"); +#endif trace("trying to execute code in the readwrite only mapped anon file...\n"); f = addr;f(); trace("...done.\n"); -#endif status = pNtQueryVirtualMemory( GetCurrentProcess(), addr, MemoryBasicInformation, &info, sizeof(info), &retlen ); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); @@ -1390,7 +1395,7 @@ static void test_queryvirtualmemory(void) char stackbuf[42]; HMODULE module; - module = GetModuleHandle( "ntdll.dll" ); + module = GetModuleHandleA( "ntdll.dll" ); trace("Check flags of the PE header of NTDLL.DLL at %p\n", module); status = pNtQueryVirtualMemory(NtCurrentProcess(), module, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); @@ -1402,7 +1407,7 @@ static void test_queryvirtualmemory(void) ok (mbi.Type == MEM_IMAGE, "mbi.Type is 0x%x, expected 0x%x\n", mbi.Type, MEM_IMAGE); trace("Check flags of a function entry in NTDLL.DLL at %p\n", pNtQueryVirtualMemory); - module = GetModuleHandle( "ntdll.dll" ); + module = GetModuleHandleA( "ntdll.dll" ); status = pNtQueryVirtualMemory(NtCurrentProcess(), pNtQueryVirtualMemory, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); ok( readcount == sizeof(MEMORY_BASIC_INFORMATION), "Expected to read %d bytes, got %ld\n",(int)sizeof(MEMORY_BASIC_INFORMATION),readcount); @@ -1430,7 +1435,7 @@ static void test_queryvirtualmemory(void) ok (mbi.Protect == PAGE_READWRITE, "mbi.Protect is 0x%x, expected 0x%x\n", mbi.Protect, PAGE_READWRITE); trace("Check flags of read-only data at %p\n", teststring); - module = GetModuleHandle( NULL ); + module = GetModuleHandleA( NULL ); status = pNtQueryVirtualMemory(NtCurrentProcess(), teststring, MemoryBasicInformation, &mbi, sizeof(MEMORY_BASIC_INFORMATION), &readcount); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); ok( readcount == sizeof(MEMORY_BASIC_INFORMATION), "Expected to read %d bytes, got %ld\n",(int)sizeof(MEMORY_BASIC_INFORMATION),readcount); @@ -1475,7 +1480,7 @@ static void test_affinity(void) GetSystemInfo(&si); status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessBasicInformation, &pbi, sizeof(pbi), NULL ); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); - proc_affinity = (DWORD_PTR)pbi.Reserved2[0]; + proc_affinity = pbi.AffinityMask; ok( proc_affinity == (1 << si.dwNumberOfProcessors) - 1, "Unexpected process affinity\n" ); proc_affinity = 1 << si.dwNumberOfProcessors; status = pNtSetInformationProcess( GetCurrentProcess(), ProcessAffinityMask, &proc_affinity, sizeof(proc_affinity) ); @@ -1534,7 +1539,7 @@ static void test_affinity(void) ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); status = pNtQueryInformationProcess( GetCurrentProcess(), ProcessBasicInformation, &pbi, sizeof(pbi), NULL ); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); - proc_affinity = (DWORD_PTR)pbi.Reserved2[0]; + proc_affinity = pbi.AffinityMask; ok( proc_affinity == 2, "Unexpected process affinity\n" ); /* Setting the process affinity changes the thread affinity to match */ status = pNtQueryInformationThread( GetCurrentThread(), ThreadBasicInformation, &tbi, sizeof(tbi), NULL ); @@ -1578,7 +1583,7 @@ static void test_NtGetCurrentProcessorNumber(void) trace("dwNumberOfProcessors: %d, current processor: %d\n", si.dwNumberOfProcessors, current_cpu); status = pNtQueryInformationProcess(GetCurrentProcess(), ProcessBasicInformation, &pbi, sizeof(pbi), NULL); - old_process_mask = (DWORD_PTR)pbi.Reserved2[0]; + old_process_mask = pbi.AffinityMask; ok(status == STATUS_SUCCESS, "got 0x%x (expected STATUS_SUCCESS)\n", status); status = pNtQueryInformationThread(GetCurrentThread(), ThreadBasicInformation, &tbi, sizeof(tbi), NULL); @@ -1721,7 +1726,7 @@ START_TEST(info) trace("Starting test_process_debug_flags()\n"); test_query_process_debug_flags(argc, argv); - /* belongs into it's own file */ + /* belongs to its own file */ trace("Starting test_readvirtualmemory()\n"); test_readvirtualmemory(); diff --git a/rostests/winetests/ntdll/om.c b/rostests/winetests/ntdll/om.c index a5ffda7cdfb..cca05c90819 100644 --- a/rostests/winetests/ntdll/om.c +++ b/rostests/winetests/ntdll/om.c @@ -26,7 +26,7 @@ #include "stdlib.h" static HANDLE (WINAPI *pCreateWaitableTimerA)(SECURITY_ATTRIBUTES*, BOOL, LPCSTR); -static NTSTATUS (WINAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, LPCSTR); +static BOOLEAN (WINAPI *pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, LPCSTR); static VOID (WINAPI *pRtlInitUnicodeString)( PUNICODE_STRING, LPCWSTR ); static VOID (WINAPI *pRtlFreeUnicodeString)(PUNICODE_STRING); static NTSTATUS (WINAPI *pNtCreateEvent) ( PHANDLE, ACCESS_MASK, const POBJECT_ATTRIBUTES, BOOLEAN, BOOLEAN); diff --git a/rostests/winetests/ntdll/path.c b/rostests/winetests/ntdll/path.c index 29a65833d83..673bc9339b5 100755 --- a/rostests/winetests/ntdll/path.c +++ b/rostests/winetests/ntdll/path.c @@ -30,7 +30,7 @@ static BOOLEAN (WINAPI *pRtlIsNameLegalDOS8Dot3)(const UNICODE_STRING*,POEM_STRI static DWORD (WINAPI *pRtlGetFullPathName_U)(const WCHAR*,ULONG,WCHAR*,WCHAR**); -static void test_RtlDetermineDosPathNameType(void) +static void test_RtlDetermineDosPathNameType_U(void) { struct test { @@ -75,6 +75,12 @@ static void test_RtlDetermineDosPathNameType(void) WCHAR buffer[MAX_PATH]; UINT ret; + if (!pRtlDetermineDosPathNameType_U) + { + win_skip("RtlDetermineDosPathNameType_U is not available\n"); + return; + } + for (test = tests; test->path; test++) { pRtlMultiByteToUnicodeN( buffer, sizeof(buffer), NULL, test->path, strlen(test->path)+1 ); @@ -84,7 +90,7 @@ static void test_RtlDetermineDosPathNameType(void) } -static void test_RtlIsDosDeviceName(void) +static void test_RtlIsDosDeviceName_U(void) { struct test { @@ -96,8 +102,8 @@ static void test_RtlIsDosDeviceName(void) static const struct test tests[] = { - { "\\\\.\\CON", 8, 6 }, - { "\\\\.\\con", 8, 6 }, + { "\\\\.\\CON", 8, 6, TRUE }, /* fails on win8 */ + { "\\\\.\\con", 8, 6, TRUE }, /* fails on win8 */ { "\\\\.\\CON2", 0, 0 }, { "", 0, 0 }, { "\\\\foo\\nul", 0, 0 }, @@ -144,6 +150,12 @@ static void test_RtlIsDosDeviceName(void) WCHAR buffer[2000]; ULONG ret; + if (!pRtlIsDosDeviceName_U) + { + win_skip("RtlIsDosDeviceName_U is not available\n"); + return; + } + for (test = tests; test->path; test++) { pRtlMultiByteToUnicodeN( buffer, sizeof(buffer), NULL, test->path, strlen(test->path)+1 ); @@ -197,6 +209,12 @@ static void test_RtlIsNameLegalDOS8Dot3(void) char buff2[12]; BOOLEAN ret, spaces; + if (!pRtlIsNameLegalDOS8Dot3) + { + win_skip("RtlIsNameLegalDOS8Dot3 is not available\n"); + return; + } + ustr.MaximumLength = sizeof(buffer); ustr.Buffer = buffer; for (test = tests; test->path; test++) @@ -274,6 +292,12 @@ static void test_RtlGetFullPathName_U(void) DWORD reslen; UINT len; + if (!pRtlGetFullPathName_U) + { + win_skip("RtlGetFullPathName_U is not available\n"); + return; + } + file_part = (WCHAR *)0xdeadbeef; lstrcpyW(rbufferW, deadbeefW); ret = pRtlGetFullPathName_U(NULL, MAX_PATH, rbufferW, &file_part); @@ -336,12 +360,9 @@ START_TEST(path) pRtlOemStringToUnicodeString = (void *)GetProcAddress(mod,"RtlOemStringToUnicodeString"); pRtlIsNameLegalDOS8Dot3 = (void *)GetProcAddress(mod,"RtlIsNameLegalDOS8Dot3"); pRtlGetFullPathName_U = (void *)GetProcAddress(mod,"RtlGetFullPathName_U"); - if (pRtlDetermineDosPathNameType_U) - test_RtlDetermineDosPathNameType(); - if (pRtlIsDosDeviceName_U) - test_RtlIsDosDeviceName(); - if (pRtlIsNameLegalDOS8Dot3) - test_RtlIsNameLegalDOS8Dot3(); - if (pRtlGetFullPathName_U && pRtlMultiByteToUnicodeN) - test_RtlGetFullPathName_U(); + + test_RtlDetermineDosPathNameType_U(); + test_RtlIsDosDeviceName_U(); + test_RtlIsNameLegalDOS8Dot3(); + test_RtlGetFullPathName_U(); } diff --git a/rostests/winetests/ntdll/pipe.c b/rostests/winetests/ntdll/pipe.c index 3ab4d07568d..c275e3d5325 100644 --- a/rostests/winetests/ntdll/pipe.c +++ b/rostests/winetests/ntdll/pipe.c @@ -77,7 +77,7 @@ static DWORD (WINAPI *pQueueUserAPC)(PAPCFUNC pfnAPC, HANDLE hThread, ULONG_PTR static BOOL init_func_ptrs(void) { - HMODULE module = GetModuleHandle("ntdll.dll"); + HMODULE module = GetModuleHandleA("ntdll.dll"); #define loadfunc(name) if (!(p##name = (void *)GetProcAddress(module, #name))) { \ trace("GetProcAddress(%s) failed\n", #name); \ @@ -91,7 +91,7 @@ static BOOL init_func_ptrs(void) loadfunc(RtlInitUnicodeString) /* not fatal */ - module = GetModuleHandle("kernel32.dll"); + module = GetModuleHandleA("kernel32.dll"); pOpenThread = (void *)GetProcAddress(module, "OpenThread"); pQueueUserAPC = (void *)GetProcAddress(module, "QueueUserAPC"); return TRUE; diff --git a/rostests/winetests/ntdll/port.c b/rostests/winetests/ntdll/port.c index 20e5831b5db..e01316b0cbc 100644 --- a/rostests/winetests/ntdll/port.c +++ b/rostests/winetests/ntdll/port.c @@ -160,7 +160,7 @@ static BOOL init_function_ptrs(void) return FALSE; } - pIsWow64Process = (void *)GetProcAddress(GetModuleHandle("kernel32.dll"), "IsWow64Process"); + pIsWow64Process = (void *)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsWow64Process"); if (!pIsWow64Process || !pIsWow64Process( GetCurrentProcess(), &is_wow64 )) is_wow64 = FALSE; return TRUE; } @@ -197,30 +197,30 @@ static void ProcessLpcRequest(HANDLE PortHandle, union lpc_message *LpcMessage) { ok(LpcMessage->msg64.MessageType == LPC_REQUEST, "Expected LPC_REQUEST, got %d\n", LpcMessage->msg64.MessageType); - ok(!lstrcmp((LPSTR)LpcMessage->msg64.Data, REQUEST2), + ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REQUEST2), "Expected %s, got %s\n", REQUEST2, LpcMessage->msg64.Data); - lstrcpy((LPSTR)LpcMessage->msg64.Data, REPLY); + strcpy((LPSTR)LpcMessage->msg64.Data, REPLY); status = pNtReplyPort(PortHandle, &LpcMessage->msg); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(LpcMessage->msg64.MessageType == LPC_REQUEST, "Expected LPC_REQUEST, got %d\n", LpcMessage->msg64.MessageType); - ok(!lstrcmp((LPSTR)LpcMessage->msg64.Data, REPLY), + ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REPLY), "Expected %s, got %s\n", REPLY, LpcMessage->msg64.Data); } else { ok(LpcMessage->msg.MessageType == LPC_REQUEST, "Expected LPC_REQUEST, got %d\n", LpcMessage->msg.MessageType); - ok(!lstrcmp((LPSTR)LpcMessage->msg.Data, REQUEST2), + ok(!strcmp((LPSTR)LpcMessage->msg.Data, REQUEST2), "Expected %s, got %s\n", REQUEST2, LpcMessage->msg.Data); - lstrcpy((LPSTR)LpcMessage->msg.Data, REPLY); + strcpy((LPSTR)LpcMessage->msg.Data, REPLY); status = pNtReplyPort(PortHandle, &LpcMessage->msg); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(LpcMessage->msg.MessageType == LPC_REQUEST, "Expected LPC_REQUEST, got %d\n", LpcMessage->msg.MessageType); - ok(!lstrcmp((LPSTR)LpcMessage->msg.Data, REPLY), + ok(!strcmp((LPSTR)LpcMessage->msg.Data, REPLY), "Expected %s, got %s\n", REPLY, LpcMessage->msg.Data); } } @@ -251,26 +251,26 @@ static DWORD WINAPI test_ports_client(LPVOID arg) LpcMessage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); out = HeapAlloc(GetProcessHeap(), 0, size); - LpcMessage->msg64.DataSize = lstrlen(REQUEST1) + 1; + LpcMessage->msg64.DataSize = strlen(REQUEST1) + 1; LpcMessage->msg64.MessageSize = FIELD_OFFSET(LPC_MESSAGE64, Data[LpcMessage->msg64.DataSize]); - lstrcpy((LPSTR)LpcMessage->msg64.Data, REQUEST1); + strcpy((LPSTR)LpcMessage->msg64.Data, REQUEST1); status = pNtRequestPort(PortHandle, &LpcMessage->msg); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(LpcMessage->msg64.MessageType == 0, "Expected 0, got %d\n", LpcMessage->msg64.MessageType); - ok(!lstrcmp((LPSTR)LpcMessage->msg64.Data, REQUEST1), + ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REQUEST1), "Expected %s, got %s\n", REQUEST1, LpcMessage->msg64.Data); /* Fill in the message */ memset(LpcMessage, 0, size); - LpcMessage->msg64.DataSize = lstrlen(REQUEST2) + 1; + LpcMessage->msg64.DataSize = strlen(REQUEST2) + 1; LpcMessage->msg64.MessageSize = FIELD_OFFSET(LPC_MESSAGE64, Data[LpcMessage->msg64.DataSize]); - lstrcpy((LPSTR)LpcMessage->msg64.Data, REQUEST2); + strcpy((LPSTR)LpcMessage->msg64.Data, REQUEST2); /* Send the message and wait for the reply */ status = pNtRequestWaitReplyPort(PortHandle, &LpcMessage->msg, &out->msg); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); - ok(!lstrcmp((LPSTR)out->msg64.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg64.Data); + ok(!strcmp((LPSTR)out->msg64.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg64.Data); ok(out->msg64.MessageType == LPC_REPLY, "Expected LPC_REPLY, got %d\n", out->msg64.MessageType); } else @@ -279,26 +279,26 @@ static DWORD WINAPI test_ports_client(LPVOID arg) LpcMessage = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size); out = HeapAlloc(GetProcessHeap(), 0, size); - LpcMessage->msg.DataSize = lstrlen(REQUEST1) + 1; + LpcMessage->msg.DataSize = strlen(REQUEST1) + 1; LpcMessage->msg.MessageSize = FIELD_OFFSET(LPC_MESSAGE, Data[LpcMessage->msg.DataSize]); - lstrcpy((LPSTR)LpcMessage->msg.Data, REQUEST1); + strcpy((LPSTR)LpcMessage->msg.Data, REQUEST1); status = pNtRequestPort(PortHandle, &LpcMessage->msg); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); ok(LpcMessage->msg.MessageType == 0, "Expected 0, got %d\n", LpcMessage->msg.MessageType); - ok(!lstrcmp((LPSTR)LpcMessage->msg.Data, REQUEST1), + ok(!strcmp((LPSTR)LpcMessage->msg.Data, REQUEST1), "Expected %s, got %s\n", REQUEST1, LpcMessage->msg.Data); /* Fill in the message */ memset(LpcMessage, 0, size); - LpcMessage->msg.DataSize = lstrlen(REQUEST2) + 1; + LpcMessage->msg.DataSize = strlen(REQUEST2) + 1; LpcMessage->msg.MessageSize = FIELD_OFFSET(LPC_MESSAGE, Data[LpcMessage->msg.DataSize]); - lstrcpy((LPSTR)LpcMessage->msg.Data, REQUEST2); + strcpy((LPSTR)LpcMessage->msg.Data, REQUEST2); /* Send the message and wait for the reply */ status = pNtRequestWaitReplyPort(PortHandle, &LpcMessage->msg, &out->msg); ok(status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %x\n", status); - ok(!lstrcmp((LPSTR)out->msg.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg.Data); + ok(!strcmp((LPSTR)out->msg.Data, REPLY), "Expected %s, got %s\n", REPLY, out->msg.Data); ok(out->msg.MessageType == LPC_REPLY, "Expected LPC_REPLY, got %d\n", out->msg.MessageType); } @@ -345,10 +345,10 @@ static void test_ports_server( HANDLE PortHandle ) case LPC_DATAGRAM: if (is_wow64) - ok(!lstrcmp((LPSTR)LpcMessage->msg64.Data, REQUEST1), + ok(!strcmp((LPSTR)LpcMessage->msg64.Data, REQUEST1), "Expected %s, got %s\n", REQUEST1, LpcMessage->msg64.Data); else - ok(!lstrcmp((LPSTR)LpcMessage->msg.Data, REQUEST1), + ok(!strcmp((LPSTR)LpcMessage->msg.Data, REQUEST1), "Expected %s, got %s\n", REQUEST1, LpcMessage->msg.Data); break; diff --git a/rostests/winetests/ntdll/reg.c b/rostests/winetests/ntdll/reg.c index 076948e2baa..159466576eb 100755 --- a/rostests/winetests/ntdll/reg.c +++ b/rostests/winetests/ntdll/reg.c @@ -115,7 +115,7 @@ typedef enum _KEY_VALUE_INFORMATION_CLASS { #endif -static NTSTATUS (WINAPI * pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, LPCSTR); +static BOOLEAN (WINAPI * pRtlCreateUnicodeStringFromAsciiz)(PUNICODE_STRING, LPCSTR); static void (WINAPI * pRtlInitUnicodeString)(PUNICODE_STRING,PCWSTR); static NTSTATUS (WINAPI * pRtlFreeUnicodeString)(PUNICODE_STRING); static NTSTATUS (WINAPI * pNtDeleteValueKey)(IN HANDLE, IN PUNICODE_STRING); @@ -134,7 +134,7 @@ static NTSTATUS (WINAPI * pNtSetValueKey)(HANDLE, const PUNICODE_STRING, ULONG, ULONG, const void*, ULONG ); static NTSTATUS (WINAPI * pNtQueryInformationProcess)(HANDLE,PROCESSINFOCLASS,PVOID,ULONG,PULONG); static NTSTATUS (WINAPI * pRtlFormatCurrentUserKeyPath)(PUNICODE_STRING); -static NTSTATUS (WINAPI * pRtlCreateUnicodeString)( PUNICODE_STRING, LPCWSTR); +static BOOLEAN (WINAPI * pRtlCreateUnicodeString)(PUNICODE_STRING, LPCWSTR); static LPVOID (WINAPI * pRtlReAllocateHeap)(IN PVOID, IN ULONG, IN PVOID, IN ULONG); static NTSTATUS (WINAPI * pRtlAppendUnicodeToString)(PUNICODE_STRING, PCWSTR); static NTSTATUS (WINAPI * pRtlUnicodeStringToAnsiString)(PSTRING, PUNICODE_STRING, BOOL); diff --git a/rostests/winetests/ntdll/rtl.c b/rostests/winetests/ntdll/rtl.c index 38909a31d1f..6eb6de3cb04 100755 --- a/rostests/winetests/ntdll/rtl.c +++ b/rostests/winetests/ntdll/rtl.c @@ -89,6 +89,7 @@ static IMAGE_BASE_RELOCATION *(WINAPI *pLdrProcessRelocationBlock)(void*,UINT,US static CHAR * (WINAPI *pRtlIpv4AddressToStringA)(const IN_ADDR *, LPSTR); static NTSTATUS (WINAPI *pRtlIpv4AddressToStringExA)(const IN_ADDR *, USHORT, LPSTR, PULONG); static NTSTATUS (WINAPI *pRtlIpv4StringToAddressA)(PCSTR, BOOLEAN, PCSTR *, IN_ADDR *); +static NTSTATUS (WINAPI *pLdrAddRefDll)(ULONG, HMODULE); static HMODULE hkernel32 = 0; static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); @@ -133,6 +134,7 @@ static void InitFunctionPtrs(void) pRtlIpv4AddressToStringA = (void *)GetProcAddress(hntdll, "RtlIpv4AddressToStringA"); pRtlIpv4AddressToStringExA = (void *)GetProcAddress(hntdll, "RtlIpv4AddressToStringExA"); pRtlIpv4StringToAddressA = (void *)GetProcAddress(hntdll, "RtlIpv4StringToAddressA"); + pLdrAddRefDll = (void *)GetProcAddress(hntdll, "LdrAddRefDll"); } hkernel32 = LoadLibraryA("kernel32.dll"); ok(hkernel32 != 0, "LoadLibrary failed\n"); @@ -1486,6 +1488,61 @@ static void test_RtlIpv4StringToAddress(void) } } +static void test_LdrAddRefDll(void) +{ + HMODULE mod, mod2; + NTSTATUS status; + BOOL ret; + + if (!pLdrAddRefDll) + { + win_skip( "LdrAddRefDll not supported\n" ); + return; + } + + mod = LoadLibraryA("comctl32.dll"); + ok(mod != NULL, "got %p\n", mod); + ret = FreeLibrary(mod); + ok(ret, "got %d\n", ret); + + mod2 = GetModuleHandleA("comctl32.dll"); + ok(mod2 == NULL, "got %p\n", mod2); + + /* load, addref and release 2 times */ + mod = LoadLibraryA("comctl32.dll"); + ok(mod != NULL, "got %p\n", mod); + status = pLdrAddRefDll(0, mod); + ok(status == STATUS_SUCCESS, "got 0x%08x\n", status); + ret = FreeLibrary(mod); + ok(ret, "got %d\n", ret); + + mod2 = GetModuleHandleA("comctl32.dll"); + ok(mod2 != NULL, "got %p\n", mod2); + ret = FreeLibrary(mod); + ok(ret, "got %d\n", ret); + + mod2 = GetModuleHandleA("comctl32.dll"); + ok(mod2 == NULL, "got %p\n", mod2); + + /* pin refcount */ + mod = LoadLibraryA("comctl32.dll"); + ok(mod != NULL, "got %p\n", mod); + status = pLdrAddRefDll(LDR_ADDREF_DLL_PIN, mod); + ok(status == STATUS_SUCCESS, "got 0x%08x\n", status); + + ret = FreeLibrary(mod); + ok(ret, "got %d\n", ret); + ret = FreeLibrary(mod); + ok(ret, "got %d\n", ret); + ret = FreeLibrary(mod); + ok(ret, "got %d\n", ret); + ret = FreeLibrary(mod); + ok(ret, "got %d\n", ret); + + mod2 = GetModuleHandleA("comctl32.dll"); + ok(mod2 != NULL, "got %p\n", mod2); +} + START_TEST(rtl) { InitFunctionPtrs(); @@ -1510,4 +1567,5 @@ START_TEST(rtl) test_RtlIpv4AddressToString(); test_RtlIpv4AddressToStringEx(); test_RtlIpv4StringToAddress(); + test_LdrAddRefDll(); } diff --git a/rostests/winetests/ntdll/rtlstr.c b/rostests/winetests/ntdll/rtlstr.c index 240fe6127f3..dc27c3e6754 100755 --- a/rostests/winetests/ntdll/rtlstr.c +++ b/rostests/winetests/ntdll/rtlstr.c @@ -68,6 +68,8 @@ static NTSTATUS (WINAPI *pRtlGUIDFromString)(const UNICODE_STRING*,GUID*); static NTSTATUS (WINAPI *pRtlStringFromGUID)(const GUID*, UNICODE_STRING*); static BOOLEAN (WINAPI *pRtlIsTextUnicode)(LPVOID, INT, INT *); static NTSTATUS (WINAPI *pRtlHashUnicodeString)(PCUNICODE_STRING,BOOLEAN,ULONG,ULONG*); +static NTSTATUS (WINAPI *pRtlUnicodeToUTF8N)(CHAR *, ULONG, ULONG *, const WCHAR *, ULONG); +static NTSTATUS (WINAPI *pRtlUTF8ToUnicodeN)(WCHAR *, ULONG, ULONG *, const CHAR *, ULONG); /*static VOID (WINAPI *pRtlFreeOemString)(PSTRING);*/ /*static VOID (WINAPI *pRtlCopyUnicodeString)(UNICODE_STRING *, const UNICODE_STRING *);*/ @@ -137,6 +139,8 @@ static void InitFunctionPtrs(void) pRtlStringFromGUID = (void *)GetProcAddress(hntdll, "RtlStringFromGUID"); pRtlIsTextUnicode = (void *)GetProcAddress(hntdll, "RtlIsTextUnicode"); pRtlHashUnicodeString = (void*)GetProcAddress(hntdll, "RtlHashUnicodeString"); + pRtlUnicodeToUTF8N = (void*)GetProcAddress(hntdll, "RtlUnicodeToUTF8N"); + pRtlUTF8ToUnicodeN = (void*)GetProcAddress(hntdll, "RtlUTF8ToUnicodeN"); } } @@ -1971,6 +1975,527 @@ static void test_RtlHashUnicodeString(void) } } +struct unicode_to_utf8_test { + WCHAR unicode[128]; + const char *expected; + NTSTATUS status; +}; + +static const struct unicode_to_utf8_test unicode_to_utf8[] = { + { { 0 }, "", STATUS_SUCCESS }, + { { '-',0 }, "-", STATUS_SUCCESS }, + { { 'h','e','l','l','o',0 }, "hello", STATUS_SUCCESS }, + { { '-',0x7f,'-',0x80,'-',0xff,'-',0x100,'-',0 }, "-\x7F-\xC2\x80-\xC3\xBF-\xC4\x80-", STATUS_SUCCESS }, + { { '-',0x7ff,'-',0x800,'-',0 }, "-\xDF\xBF-\xE0\xA0\x80-", STATUS_SUCCESS }, + { { '-',0xd7ff,'-',0xe000,'-',0 }, "-\xED\x9F\xBF-\xEE\x80\x80-", STATUS_SUCCESS }, + /* 0x10000 */ + { { '-',0xffff,'-',0xd800,0xdc00,'-',0 }, "-\xEF\xBF\xBF-\xF0\x90\x80\x80-", STATUS_SUCCESS }, + /* 0x103ff */ /* 0x10400 */ + { { '-',0xd800,0xdfff,'-',0xd801,0xdc00,'-',0 }, "-\xF0\x90\x8F\xBF-\xF0\x90\x90\x80-", STATUS_SUCCESS }, + /* 0x10ffff */ + { { '-',0xdbff,0xdfff,'-',0 }, "-\xF4\x8F\xBF\xBF-", STATUS_SUCCESS }, + /* standalone lead surrogates become 0xFFFD */ + { { '-',0xd800,'-',0xdbff,'-',0 }, "-\xEF\xBF\xBD-\xEF\xBF\xBD-", STATUS_SOME_NOT_MAPPED }, + /* standalone trail surrogates become 0xFFFD */ + { { '-',0xdc00,'-',0xdfff,'-',0 }, "-\xEF\xBF\xBD-\xEF\xBF\xBD-", STATUS_SOME_NOT_MAPPED }, + /* reverse surrogate pair */ + { { '-',0xdfff,0xdbff,'-',0 }, "-\xEF\xBF\xBD\xEF\xBF\xBD-", STATUS_SOME_NOT_MAPPED }, + /* byte order marks */ + { { '-',0xfeff,'-',0xfffe,'-',0 }, "-\xEF\xBB\xBF-\xEF\xBF\xBE-", STATUS_SUCCESS }, + { { 0xfeff,'-',0 }, "\xEF\xBB\xBF-", STATUS_SUCCESS }, + { { 0xfffe,'-',0 }, "\xEF\xBF\xBE-", STATUS_SUCCESS }, + /* invalid code point */ + { { 0xffff,'-',0 }, "\xEF\xBF\xBF-", STATUS_SUCCESS }, + /* canonically equivalent representations -- no normalization should happen */ + { { '-',0x1e09,'-',0 }, "-\xE1\xB8\x89-", STATUS_SUCCESS }, + { { '-',0x0107,0x0327,'-',0 }, "-\xC4\x87\xCC\xA7-", STATUS_SUCCESS }, + { { '-',0x00e7,0x0301,'-',0 }, "-\xC3\xA7\xCC\x81-", STATUS_SUCCESS }, + { { '-',0x0063,0x0327,0x0301,'-',0 }, "-\x63\xCC\xA7\xCC\x81-", STATUS_SUCCESS }, + { { '-',0x0063,0x0301,0x0327,'-',0 }, "-\x63\xCC\x81\xCC\xA7-", STATUS_SUCCESS }, +}; + +static void utf8_expect_(const unsigned char *out_string, ULONG buflen, ULONG out_bytes, + const WCHAR *in_string, ULONG in_bytes, + NTSTATUS expect_status, int line) +{ + NTSTATUS status; + ULONG bytes_out; + char buffer[128]; + unsigned char *buf = (unsigned char *)buffer; + unsigned int i; + + if (buflen == (ULONG)-1) + buflen = sizeof(buffer); + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUnicodeToUTF8N( + out_string ? buffer : NULL, buflen, &bytes_out, + in_string, in_bytes); + ok_(__FILE__, line)(status == expect_status, "status = 0x%x\n", status); + ok_(__FILE__, line)(bytes_out == out_bytes, "bytes_out = %u\n", bytes_out); + if (out_string) + { + for (i = 0; i < bytes_out; i++) + ok_(__FILE__, line)(buf[i] == out_string[i], + "buffer[%d] = 0x%x, expected 0x%x\n", + i, buf[i], out_string[i]); + for (; i < sizeof(buffer); i++) + ok_(__FILE__, line)(buf[i] == 0x55, + "buffer[%d] = 0x%x, expected 0x55\n", + i, buf[i]); + } +} +#define utf8_expect(out_string, buflen, out_bytes, in_string, in_bytes, expect_status) \ + utf8_expect_(out_string, buflen, out_bytes, in_string, in_bytes, expect_status, __LINE__) + +static void test_RtlUnicodeToUTF8N(void) +{ + NTSTATUS status; + ULONG bytes_out; + ULONG bytes_out_array[2]; + void * const invalid_pointer = (void *)0x8; + char buffer[128]; + const WCHAR empty_string[] = { 0 }; + const WCHAR test_string[] = { 'A',0,'a','b','c','d','e','f','g',0 }; + const WCHAR special_string[] = { 'X',0x80,0xd800,0 }; + const unsigned char special_expected[] = { 'X',0xc2,0x80,0xef,0xbf,0xbd,0 }; + unsigned int input_len; + const unsigned int test_count = sizeof(unicode_to_utf8) / sizeof(unicode_to_utf8[0]); + unsigned int i; + + if (!pRtlUnicodeToUTF8N) + { + skip("RtlUnicodeToUTF8N unavailable\n"); + return; + } + + /* show that bytes_out is really ULONG */ + memset(bytes_out_array, 0x55, sizeof(bytes_out_array)); + status = pRtlUnicodeToUTF8N(NULL, 0, bytes_out_array, empty_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out_array[0] == 0x00000000, "Got 0x%x\n", bytes_out_array[0]); + ok(bytes_out_array[1] == 0x55555555, "Got 0x%x\n", bytes_out_array[1]); + + /* parameter checks */ + status = pRtlUnicodeToUTF8N(NULL, 0, NULL, NULL, 0); + ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status); + + status = pRtlUnicodeToUTF8N(NULL, 0, NULL, empty_string, 0); + ok(status == STATUS_INVALID_PARAMETER, "status = 0x%x\n", status); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, NULL, 0); + ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status); + ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, invalid_pointer, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, empty_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, test_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, empty_string, 1); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(invalid_pointer, 0, &bytes_out, empty_string, 1); + ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%x\n", status); + ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(invalid_pointer, 8, &bytes_out, empty_string, 1); + ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%x\n", status); + ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out); + + /* length output with special chars */ +#define length_expect(in_chars, out_bytes, expect_status) \ + utf8_expect_(NULL, 0, out_bytes, \ + special_string, in_chars * sizeof(WCHAR), \ + expect_status, __LINE__) + + length_expect(0, 0, STATUS_SUCCESS); + length_expect(1, 1, STATUS_SUCCESS); + length_expect(2, 3, STATUS_SUCCESS); + length_expect(3, 6, STATUS_SOME_NOT_MAPPED); + length_expect(4, 7, STATUS_SOME_NOT_MAPPED); +#undef length_expect + + /* output truncation */ +#define truncate_expect(buflen, out_bytes, expect_status) \ + utf8_expect_(special_expected, buflen, out_bytes, \ + special_string, sizeof(special_string), \ + expect_status, __LINE__) + + truncate_expect(0, 0, STATUS_BUFFER_TOO_SMALL); + truncate_expect(1, 1, STATUS_BUFFER_TOO_SMALL); + truncate_expect(2, 1, STATUS_BUFFER_TOO_SMALL); + truncate_expect(3, 3, STATUS_BUFFER_TOO_SMALL); + truncate_expect(4, 3, STATUS_BUFFER_TOO_SMALL); + truncate_expect(5, 3, STATUS_BUFFER_TOO_SMALL); + truncate_expect(6, 6, STATUS_BUFFER_TOO_SMALL); + truncate_expect(7, 7, STATUS_SOME_NOT_MAPPED); +#undef truncate_expect + + /* conversion behavior with varying input length */ + for (input_len = 0; input_len <= sizeof(test_string); input_len++) { + /* no output buffer, just length */ + utf8_expect(NULL, 0, input_len / sizeof(WCHAR), + test_string, input_len, STATUS_SUCCESS); + + /* write output */ + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUnicodeToUTF8N( + buffer, sizeof(buffer), &bytes_out, + test_string, input_len); + if (input_len % sizeof(WCHAR) == 0) { + ok(status == STATUS_SUCCESS, + "(len %u): status = 0x%x\n", input_len, status); + ok(bytes_out == input_len / sizeof(WCHAR), + "(len %u): bytes_out = 0x%x\n", input_len, bytes_out); + for (i = 0; i < bytes_out; i++) { + ok(buffer[i] == test_string[i], + "(len %u): buffer[%d] = 0x%x, expected 0x%x\n", + input_len, i, buffer[i], test_string[i]); + } + for (; i < sizeof(buffer); i++) { + ok(buffer[i] == 0x55, + "(len %u): buffer[%d] = 0x%x\n", input_len, i, buffer[i]); + } + } else { + ok(status == STATUS_INVALID_PARAMETER_5, + "(len %u): status = 0x%x\n", input_len, status); + ok(bytes_out == 0x55555555, + "(len %u): bytes_out = 0x%x\n", input_len, bytes_out); + for (i = 0; i < sizeof(buffer); i++) { + ok(buffer[i] == 0x55, + "(len %u): buffer[%d] = 0x%x\n", input_len, i, buffer[i]); + } + } + } + + /* test cases for special characters */ + for (i = 0; i < test_count; i++) { + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUnicodeToUTF8N( + buffer, sizeof(buffer), &bytes_out, + unicode_to_utf8[i].unicode, lstrlenW(unicode_to_utf8[i].unicode) * sizeof(WCHAR)); + ok(status == unicode_to_utf8[i].status, + "(test %d): status is 0x%x, expected 0x%x\n", + i, status, unicode_to_utf8[i].status); + ok(bytes_out == strlen(unicode_to_utf8[i].expected), + "(test %d): bytes_out is %u, expected %u\n", + i, bytes_out, lstrlenA(unicode_to_utf8[i].expected)); + ok(!memcmp(buffer, unicode_to_utf8[i].expected, bytes_out), + "(test %d): got \"%.*s\", expected \"%s\"\n", + i, bytes_out, buffer, unicode_to_utf8[i].expected); + ok(buffer[bytes_out] == 0x55, + "(test %d): behind string: 0x%x\n", i, buffer[bytes_out]); + + /* same test but include the null terminator */ + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUnicodeToUTF8N( + buffer, sizeof(buffer), &bytes_out, + unicode_to_utf8[i].unicode, (lstrlenW(unicode_to_utf8[i].unicode) + 1) * sizeof(WCHAR)); + ok(status == unicode_to_utf8[i].status, + "(test %d): status is 0x%x, expected 0x%x\n", + i, status, unicode_to_utf8[i].status); + ok(bytes_out == strlen(unicode_to_utf8[i].expected) + 1, + "(test %d): bytes_out is %u, expected %u\n", + i, bytes_out, lstrlenA(unicode_to_utf8[i].expected) + 1); + ok(!memcmp(buffer, unicode_to_utf8[i].expected, bytes_out), + "(test %d): got \"%.*s\", expected \"%s\"\n", + i, bytes_out, buffer, unicode_to_utf8[i].expected); + ok(buffer[bytes_out] == 0x55, + "(test %d): behind string: 0x%x\n", i, buffer[bytes_out]); + } +} + +struct utf8_to_unicode_test { + const char *utf8; + WCHAR expected[128]; + NTSTATUS status; +}; + +static const struct utf8_to_unicode_test utf8_to_unicode[] = { + { "", { 0 }, STATUS_SUCCESS }, + { "-", { '-',0 }, STATUS_SUCCESS }, + { "hello", { 'h','e','l','l','o',0 }, STATUS_SUCCESS }, + /* first and last of each range */ + { "-\x7F-\xC2\x80-\xC3\xBF-\xC4\x80-", { '-',0x7f,'-',0x80,'-',0xff,'-',0x100,'-',0 }, STATUS_SUCCESS }, + { "-\xDF\xBF-\xE0\xA0\x80-", { '-',0x7ff,'-',0x800,'-',0 }, STATUS_SUCCESS }, + { "-\xED\x9F\xBF-\xEE\x80\x80-", { '-',0xd7ff,'-',0xe000,'-',0 }, STATUS_SUCCESS }, + /* 0x10000 */ + { "-\xEF\xBF\xBF-\xF0\x90\x80\x80-", { '-',0xffff,'-',0xd800,0xdc00,'-',0 }, STATUS_SUCCESS }, + /* 0x103ff */ /* 0x10400 */ + { "-\xF0\x90\x8F\xBF-\xF0\x90\x90\x80-", { '-',0xd800,0xdfff,'-',0xd801,0xdc00,'-',0 }, STATUS_SUCCESS }, + /* 0x10ffff */ + { "-\xF4\x8F\xBF\xBF-", { '-',0xdbff,0xdfff,'-',0 }, STATUS_SUCCESS }, + /* standalone surrogate code points */ + /* 0xd800 */ /* 0xdbff */ + { "-\xED\xA0\x80-\xED\xAF\xBF-", { '-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0xdc00 */ /* 0xdfff */ + { "-\xED\xB0\x80-\xED\xBF\xBF-", { '-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* UTF-8 encoded surrogate pair */ + /* 0xdbff *//* 0xdfff */ + { "-\xED\xAF\xBF\xED\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* reverse surrogate pair */ + /* 0xdfff *//* 0xdbff */ + { "-\xED\xBF\xBF\xED\xAF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* code points outside the UTF-16 range */ + /* 0x110000 */ + { "-\xF4\x90\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0x1fffff */ + { "-\xF7\xBF\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0x200000 */ + { "-\xFA\x80\x80\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0x3ffffff */ + { "-\xFB\xBF\xBF\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0x4000000 */ + { "-\xFC\x84\x80\x80\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0x7fffffff */ + { "-\xFD\xBF\xBF\xBF\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* overlong encodings of each length for -, NUL, and the highest possible value */ + { "-\xC0\xAD-\xC0\x80-\xC1\xBF-", { '-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xE0\x80\xAD-\xE0\x80\x80-\xE0\x9F\xBF-", { '-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF0\x80\x80\xAD-", { '-',0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF0\x80\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF0\x8F\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF8\x80\x80\x80\xAD-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF8\x80\x80\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF8\x87\xBF\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xFC\x80\x80\x80\x80\xAD-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xFC\x80\x80\x80\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xFC\x83\xBF\xBF\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* invalid bytes */ + { "\xFE", { 0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFF", { 0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFE\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFF\x80\x80\x80\x80\x80\x80\x80\x80", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFF\x40\x80\x80\x80\x80\x80\x80\x80", { 0xfffd,0x40,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + /* lone continuation bytes */ + { "\x80", { 0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\x80\x80", { 0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xBF", { 0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xBF\xBF", { 0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + /* incomplete sequences */ + { "\xC2-", { 0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "\xE0\xA0-", { 0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "\xF0\x90\x80-", { 0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "\xF4\x8F\xBF-", { 0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFA\x80\x80\x80-", { 0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFC\x84\x80\x80\x80-", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* multibyte sequence followed by lone continuation byte */ + { "\xE0\xA0\x80\x80-", { 0x800,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* byte order marks */ + { "-\xEF\xBB\xBF-\xEF\xBF\xBE-", { '-',0xfeff,'-',0xfffe,'-',0 }, STATUS_SUCCESS }, + { "\xEF\xBB\xBF-", { 0xfeff,'-',0 }, STATUS_SUCCESS }, + { "\xEF\xBF\xBE-", { 0xfffe,'-',0 }, STATUS_SUCCESS }, + /* invalid code point */ + /* 0xffff */ + { "\xEF\xBF\xBF-", { 0xffff,'-',0 }, STATUS_SUCCESS }, + /* canonically equivalent representations -- no normalization should happen */ + { "-\xE1\xB8\x89-", { '-',0x1e09,'-',0 }, STATUS_SUCCESS }, + { "-\xC4\x87\xCC\xA7-", { '-',0x0107,0x0327,'-',0 }, STATUS_SUCCESS }, + { "-\xC3\xA7\xCC\x81-", { '-',0x00e7,0x0301,'-',0 }, STATUS_SUCCESS }, + { "-\x63\xCC\xA7\xCC\x81-", { '-',0x0063,0x0327,0x0301,'-',0 }, STATUS_SUCCESS }, + { "-\x63\xCC\x81\xCC\xA7-", { '-',0x0063,0x0301,0x0327,'-',0 }, STATUS_SUCCESS }, +}; + +static void unicode_expect_(const WCHAR *out_string, ULONG buflen, ULONG out_chars, + const char *in_string, ULONG in_chars, + NTSTATUS expect_status, int line) +{ + NTSTATUS status; + ULONG bytes_out; + WCHAR buffer[128]; + unsigned int i; + + if (buflen == (ULONG)-1) + buflen = sizeof(buffer); + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUTF8ToUnicodeN( + out_string ? buffer : NULL, buflen, &bytes_out, + in_string, in_chars); + ok_(__FILE__, line)(status == expect_status, "status = 0x%x\n", status); + ok_(__FILE__, line)(bytes_out == out_chars * sizeof(WCHAR), + "bytes_out = %u, expected %u\n", bytes_out, out_chars * (ULONG)sizeof(WCHAR)); + if (out_string) + { + for (i = 0; i < bytes_out / sizeof(WCHAR); i++) + ok_(__FILE__, line)(buffer[i] == out_string[i], + "buffer[%d] = 0x%x, expected 0x%x\n", + i, buffer[i], out_string[i]); + for (; i < sizeof(buffer) / sizeof(WCHAR); i++) + ok_(__FILE__, line)(buffer[i] == 0x5555, + "buffer[%d] = 0x%x, expected 0x5555\n", + i, buffer[i]); + } +} +#define unicode_expect(out_string, buflen, out_chars, in_string, in_chars, expect_status) \ + unicode_expect_(out_string, buflen, out_chars, in_string, in_chars, expect_status, __LINE__) + +static void test_RtlUTF8ToUnicodeN(void) +{ + NTSTATUS status; + ULONG bytes_out; + ULONG bytes_out_array[2]; + void * const invalid_pointer = (void *)0x8; + WCHAR buffer[128]; + const char empty_string[] = ""; + const char test_string[] = "A\0abcdefg"; + const WCHAR test_stringW[] = {'A',0,'a','b','c','d','e','f','g',0 }; + const char special_string[] = { 'X',0xc2,0x80,0xF0,0x90,0x80,0x80,0 }; + const WCHAR special_expected[] = { 'X',0x80,0xd800,0xdc00,0 }; + unsigned int input_len; + const unsigned int test_count = sizeof(utf8_to_unicode) / sizeof(utf8_to_unicode[0]); + unsigned int i; + + if (!pRtlUTF8ToUnicodeN) + { + skip("RtlUTF8ToUnicodeN unavailable\n"); + return; + } + + /* show that bytes_out is really ULONG */ + memset(bytes_out_array, 0x55, sizeof(bytes_out_array)); + status = pRtlUTF8ToUnicodeN(NULL, 0, bytes_out_array, empty_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out_array[0] == 0x00000000, "Got 0x%x\n", bytes_out_array[0]); + ok(bytes_out_array[1] == 0x55555555, "Got 0x%x\n", bytes_out_array[1]); + + /* parameter checks */ + status = pRtlUTF8ToUnicodeN(NULL, 0, NULL, NULL, 0); + ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status); + + status = pRtlUTF8ToUnicodeN(NULL, 0, NULL, empty_string, 0); + ok(status == STATUS_INVALID_PARAMETER, "status = 0x%x\n", status); + + bytes_out = 0x55555555; + status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, NULL, 0); + ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status); + ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, invalid_pointer, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, empty_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, test_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, empty_string, 1); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == sizeof(WCHAR), "bytes_out = 0x%x\n", bytes_out); + + /* length output with special chars */ +#define length_expect(in_chars, out_chars, expect_status) \ + unicode_expect_(NULL, 0, out_chars, special_string, in_chars, \ + expect_status, __LINE__) + + length_expect(0, 0, STATUS_SUCCESS); + length_expect(1, 1, STATUS_SUCCESS); + length_expect(2, 2, STATUS_SOME_NOT_MAPPED); + length_expect(3, 2, STATUS_SUCCESS); + length_expect(4, 3, STATUS_SOME_NOT_MAPPED); + length_expect(5, 3, STATUS_SOME_NOT_MAPPED); + length_expect(6, 3, STATUS_SOME_NOT_MAPPED); + length_expect(7, 4, STATUS_SUCCESS); + length_expect(8, 5, STATUS_SUCCESS); +#undef length_expect + + /* output truncation */ +#define truncate_expect(buflen, out_chars, expect_status) \ + unicode_expect_(special_expected, buflen, out_chars, \ + special_string, sizeof(special_string), \ + expect_status, __LINE__) + + truncate_expect( 0, 0, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 1, 0, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 2, 1, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 3, 1, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 4, 2, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 5, 2, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 6, 3, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 7, 3, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 8, 4, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 9, 4, STATUS_BUFFER_TOO_SMALL); + truncate_expect(10, 5, STATUS_SUCCESS); +#undef truncate_expect + + /* conversion behavior with varying input length */ + for (input_len = 0; input_len <= sizeof(test_string); input_len++) { + /* no output buffer, just length */ + unicode_expect(NULL, 0, input_len, + test_string, input_len, STATUS_SUCCESS); + + /* write output */ + unicode_expect(test_stringW, -1, input_len, + test_string, input_len, STATUS_SUCCESS); + } + + /* test cases for special characters */ + for (i = 0; i < test_count; i++) { + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUTF8ToUnicodeN( + buffer, sizeof(buffer), &bytes_out, + utf8_to_unicode[i].utf8, strlen(utf8_to_unicode[i].utf8)); + ok(status == utf8_to_unicode[i].status, + "(test %d): status is 0x%x, expected 0x%x\n", + i, status, utf8_to_unicode[i].status); + ok(bytes_out == lstrlenW(utf8_to_unicode[i].expected) * sizeof(WCHAR), + "(test %d): bytes_out is %u, expected %u\n", + i, bytes_out, lstrlenW(utf8_to_unicode[i].expected) * (ULONG)sizeof(WCHAR)); + ok(!memcmp(buffer, utf8_to_unicode[i].expected, bytes_out), + "(test %d): got %s, expected %s\n", + i, wine_dbgstr_wn(buffer, bytes_out / sizeof(WCHAR)), wine_dbgstr_w(utf8_to_unicode[i].expected)); + ok(buffer[bytes_out] == 0x5555, + "(test %d): behind string: 0x%x\n", i, buffer[bytes_out]); + + /* same test but include the null terminator */ + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUTF8ToUnicodeN( + buffer, sizeof(buffer), &bytes_out, + utf8_to_unicode[i].utf8, strlen(utf8_to_unicode[i].utf8) + 1); + ok(status == utf8_to_unicode[i].status, + "(test %d): status is 0x%x, expected 0x%x\n", + i, status, utf8_to_unicode[i].status); + ok(bytes_out == (lstrlenW(utf8_to_unicode[i].expected) + 1) * sizeof(WCHAR), + "(test %d): bytes_out is %u, expected %u\n", + i, bytes_out, (lstrlenW(utf8_to_unicode[i].expected) + 1) * (ULONG)sizeof(WCHAR)); + ok(!memcmp(buffer, utf8_to_unicode[i].expected, bytes_out), + "(test %d): got %s, expected %s\n", + i, wine_dbgstr_wn(buffer, bytes_out / sizeof(WCHAR)), wine_dbgstr_w(utf8_to_unicode[i].expected)); + ok(buffer[bytes_out] == 0x5555, + "(test %d): behind string: 0x%x\n", i, buffer[bytes_out]); + } +} + START_TEST(rtlstr) { InitFunctionPtrs(); @@ -2004,4 +2529,6 @@ START_TEST(rtlstr) test_RtlDowncaseUnicodeString(); } test_RtlHashUnicodeString(); + test_RtlUnicodeToUTF8N(); + test_RtlUTF8ToUnicodeN(); } diff --git a/rostests/winetests/ntdll/string.c b/rostests/winetests/ntdll/string.c index 9349f5d7473..56b75849747 100755 --- a/rostests/winetests/ntdll/string.c +++ b/rostests/winetests/ntdll/string.c @@ -59,6 +59,7 @@ static LPWSTR (WINAPIV *p_wcsrchr)(LPCWSTR, WCHAR); static void (__cdecl *p_qsort)(void *,size_t,size_t, int(__cdecl *compar)(const void *, const void *) ); static void* (__cdecl *p_bsearch)(void *,void*,size_t,size_t, int(__cdecl *compar)(const void *, const void *) ); +static int (__cdecl *p__snprintf)(char *, size_t, const char *, ...); static void InitFunctionPtrs(void) @@ -96,6 +97,8 @@ static void InitFunctionPtrs(void) p_wcsrchr= (void *)GetProcAddress(hntdll, "wcsrchr"); p_qsort= (void *)GetProcAddress(hntdll, "qsort"); p_bsearch= (void *)GetProcAddress(hntdll, "bsearch"); + + p__snprintf = (void *)GetProcAddress(hntdll, "_snprintf"); } /* if */ } @@ -1270,6 +1273,37 @@ static void test_bsearch(void) } } +static void test__snprintf(void) +{ + const char *origstring = "XXXXXXXXXXXX"; + const char *teststring = "hello world"; + char buffer[32]; + int res; + + res = p__snprintf(NULL, 0, teststring); + ok(res == lstrlenA(teststring) || broken(res == -1) /* <= w2k */, + "_snprintf returned %d, expected %d.\n", res, lstrlenA(teststring)); + + if (res != -1) + { + res = p__snprintf(NULL, 1, teststring); + ok(res == lstrlenA(teststring) /* WinXP */ || res < 0 /* Vista and greater */, + "_snprintf returned %d, expected %d or < 0.\n", res, lstrlenA(teststring)); + } + res = p__snprintf(buffer, strlen(teststring) - 1, teststring); + ok(res < 0, "_snprintf returned %d, expected < 0.\n", res); + + strcpy(buffer, origstring); + res = p__snprintf(buffer, strlen(teststring), teststring); + ok(res == lstrlenA(teststring), "_snprintf returned %d, expected %d.\n", res, lstrlenA(teststring)); + ok(!strcmp(buffer, "hello worldX"), "_snprintf returned buffer '%s', expected 'hello worldX'.\n", buffer); + + strcpy(buffer, origstring); + res = p__snprintf(buffer, strlen(teststring) + 1, teststring); + ok(res == lstrlenA(teststring), "_snprintf returned %d, expected %d.\n", res, lstrlenA(teststring)); + ok(!strcmp(buffer, teststring), "_snprintf returned buffer '%s', expected '%s'.\n", buffer, teststring); +} + START_TEST(string) { InitFunctionPtrs(); @@ -1304,4 +1338,6 @@ START_TEST(string) test_qsort(); if (p_bsearch) test_bsearch(); + if (p__snprintf) + test__snprintf(); } diff --git a/rostests/winetests/ntdll/testlist.c b/rostests/winetests/ntdll/testlist.c index f9560629ba9..ec81eed5b62 100644 --- a/rostests/winetests/ntdll/testlist.c +++ b/rostests/winetests/ntdll/testlist.c @@ -1,10 +1,7 @@ /* Automatically generated file; DO NOT EDIT!! */ -#define WIN32_LEAN_AND_MEAN -#include - #define STANDALONE -#include "wine/test.h" +#include extern void func_atom(void); extern void func_change(void); diff --git a/rostests/winetests/ntdll/time.c b/rostests/winetests/ntdll/time.c index ff80b841078..48f4640ebb8 100755 --- a/rostests/winetests/ntdll/time.c +++ b/rostests/winetests/ntdll/time.c @@ -33,9 +33,9 @@ static const int MonthLengths[2][12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } }; -static inline int IsLeapYear(int Year) +static inline BOOL IsLeapYear(int Year) { - return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0) ? 1 : 0; + return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0); } /* start time of the tests */ From 9a08d0b7dc09191fdb1169e95569ca1d5257cfd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 20 Apr 2014 14:39:38 +0000 Subject: [PATCH 415/419] [KERNEL32][CONSRV] Implement console part of Get/SetHandleInformation, needed by msvcrt / cmd.exe (at least the windows version) and other console apps... svn path=/trunk/; revision=62843 --- .../win32/kernel32/client/console/console.c | 61 ++++++++++++ reactos/dll/win32/kernel32/client/handle.c | 10 +- reactos/dll/win32/kernel32/include/console.h | 9 ++ reactos/include/reactos/subsys/win/conmsg.h | 17 ++++ reactos/win32ss/user/winsrv/consrv/handle.c | 97 +++++++++++++++++-- 5 files changed, 180 insertions(+), 14 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/console/console.c b/reactos/dll/win32/kernel32/client/console/console.c index e99b1be5cd5..1a250a10b8e 100644 --- a/reactos/dll/win32/kernel32/client/console/console.c +++ b/reactos/dll/win32/kernel32/client/console/console.c @@ -308,6 +308,67 @@ DuplicateConsoleHandle(HANDLE hConsole, } +/* + * @implemented + */ +BOOL +WINAPI +GetConsoleHandleInformation(IN HANDLE hHandle, + OUT LPDWORD lpdwFlags) +{ + CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_GETHANDLEINFO GetHandleInfoRequest = &ApiMessage.Data.GetHandleInfoRequest; + + GetHandleInfoRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + GetHandleInfoRequest->Handle = hHandle; + + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepGetHandleInformation), + sizeof(*GetHandleInfoRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) + { + BaseSetLastNTError(ApiMessage.Status); + return FALSE; + } + + *lpdwFlags = GetHandleInfoRequest->Flags; + + return TRUE; +} + + +/* + * @implemented + */ +BOOL +WINAPI +SetConsoleHandleInformation(IN HANDLE hHandle, + IN DWORD dwMask, + IN DWORD dwFlags) +{ + CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_SETHANDLEINFO SetHandleInfoRequest = &ApiMessage.Data.SetHandleInfoRequest; + + SetHandleInfoRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + SetHandleInfoRequest->Handle = hHandle; + SetHandleInfoRequest->Mask = dwMask; + SetHandleInfoRequest->Flags = dwFlags; + + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepSetHandleInformation), + sizeof(*SetHandleInfoRequest)); + if (!NT_SUCCESS(ApiMessage.Status)) + { + BaseSetLastNTError(ApiMessage.Status); + return FALSE; + } + + return TRUE; +} + + /* * @implemented */ diff --git a/reactos/dll/win32/kernel32/client/handle.c b/reactos/dll/win32/kernel32/client/handle.c index 885ea8808cc..5024f5fef94 100644 --- a/reactos/dll/win32/kernel32/client/handle.c +++ b/reactos/dll/win32/kernel32/client/handle.c @@ -50,10 +50,7 @@ GetHandleInformation(IN HANDLE hObject, if (IsConsoleHandle(hObject)) { - /* FIXME: GetConsoleHandleInformation required */ - UNIMPLEMENTED; - BaseSetLastNTError(STATUS_NOT_IMPLEMENTED); - return FALSE; + return GetConsoleHandleInformation(hObject, lpdwFlags); } Status = NtQueryObject(hObject, @@ -91,10 +88,7 @@ SetHandleInformation(IN HANDLE hObject, if (IsConsoleHandle(hObject)) { - /* FIXME: SetConsoleHandleInformation required */ - UNIMPLEMENTED; - BaseSetLastNTError(STATUS_NOT_IMPLEMENTED); - return FALSE; + return SetConsoleHandleInformation(hObject, dwMask, dwFlags); } Status = NtQueryObject(hObject, diff --git a/reactos/dll/win32/kernel32/include/console.h b/reactos/dll/win32/kernel32/include/console.h index a7e69e727f3..8edb3493964 100644 --- a/reactos/dll/win32/kernel32/include/console.h +++ b/reactos/dll/win32/kernel32/include/console.h @@ -38,6 +38,15 @@ DuplicateConsoleHandle(HANDLE hConsole, BOOL bInheritHandle, DWORD dwOptions); +BOOL WINAPI +GetConsoleHandleInformation(IN HANDLE hHandle, + OUT LPDWORD lpdwFlags); + +BOOL WINAPI +SetConsoleHandleInformation(IN HANDLE hHandle, + IN DWORD dwMask, + IN DWORD dwFlags); + BOOL WINAPI VerifyConsoleIoHandle(HANDLE Handle); diff --git a/reactos/include/reactos/subsys/win/conmsg.h b/reactos/include/reactos/subsys/win/conmsg.h index b6481a9ff06..a208d3e0cac 100644 --- a/reactos/include/reactos/subsys/win/conmsg.h +++ b/reactos/include/reactos/subsys/win/conmsg.h @@ -547,6 +547,21 @@ typedef struct HANDLE TargetHandle; } CONSOLE_DUPLICATEHANDLE, *PCONSOLE_DUPLICATEHANDLE; +typedef struct +{ + HANDLE ConsoleHandle; + HANDLE Handle; + DWORD Flags; +} CONSOLE_GETHANDLEINFO, *PCONSOLE_GETHANDLEINFO; + +typedef struct +{ + HANDLE ConsoleHandle; + HANDLE Handle; + DWORD Mask; + DWORD Flags; +} CONSOLE_SETHANDLEINFO, *PCONSOLE_SETHANDLEINFO; + /* * Type of handles. */ @@ -748,6 +763,8 @@ typedef struct _CONSOLE_API_MESSAGE CONSOLE_CLOSEHANDLE CloseHandleRequest; CONSOLE_VERIFYHANDLE VerifyHandleRequest; CONSOLE_DUPLICATEHANDLE DuplicateHandleRequest; + CONSOLE_GETHANDLEINFO GetHandleInfoRequest; + CONSOLE_SETHANDLEINFO SetHandleInfoRequest; /* Cursor */ CONSOLE_SHOWCURSOR ShowCursorRequest; diff --git a/reactos/win32ss/user/winsrv/consrv/handle.c b/reactos/win32ss/user/winsrv/consrv/handle.c index 6ad1cdf8789..b79fe527e7a 100644 --- a/reactos/win32ss/user/winsrv/consrv/handle.c +++ b/reactos/win32ss/user/winsrv/consrv/handle.c @@ -377,7 +377,6 @@ ConSrvRemoveObject(PCONSOLE_PROCESS_DATA ProcessData, HANDLE Handle) { ULONG Index = HandleToULong(Handle) >> 2; - PCONSOLE_IO_OBJECT Object; RtlEnterCriticalSection(&ProcessData->HandleTableLock); @@ -386,7 +385,7 @@ ConSrvRemoveObject(PCONSOLE_PROCESS_DATA ProcessData, // (ProcessData->HandleTable != NULL && ProcessData->HandleTableSize != 0) ); if (Index >= ProcessData->HandleTableSize || - (Object = ProcessData->HandleTable[Index].Object) == NULL) + ProcessData->HandleTable[Index].Object == NULL) { RtlLeaveCriticalSection(&ProcessData->HandleTableLock); return STATUS_INVALID_HANDLE; @@ -814,14 +813,100 @@ Quit: CSR_API(SrvGetHandleInformation) { - DPRINT1("%s not yet implemented\n", __FUNCTION__); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + PCONSOLE_GETHANDLEINFO GetHandleInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.GetHandleInfoRequest; + PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); + PCONSOLE Console; + + HANDLE Handle = GetHandleInfoRequest->Handle; + ULONG Index = HandleToULong(Handle) >> 2; + PCONSOLE_IO_HANDLE Entry; + + Status = ConSrvGetConsole(ProcessData, &Console, TRUE); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Can't get console\n"); + return Status; + } + + RtlEnterCriticalSection(&ProcessData->HandleTableLock); + + ASSERT(ProcessData->HandleTable); + // ASSERT( (ProcessData->HandleTable == NULL && ProcessData->HandleTableSize == 0) || + // (ProcessData->HandleTable != NULL && ProcessData->HandleTableSize != 0) ); + + if (!IsConsoleHandle(Handle) || + Index >= ProcessData->HandleTableSize || + (Entry = &ProcessData->HandleTable[Index])->Object == NULL) + { + Status = STATUS_INVALID_HANDLE; + goto Quit; + } + + /* + * Retrieve the handle information flags. The console server + * doesn't support HANDLE_FLAG_PROTECT_FROM_CLOSE. + */ + GetHandleInfoRequest->Flags = 0; + if (Entry->Inheritable) GetHandleInfoRequest->Flags |= HANDLE_FLAG_INHERIT; + + Status = STATUS_SUCCESS; + +Quit: + RtlLeaveCriticalSection(&ProcessData->HandleTableLock); + + ConSrvReleaseConsole(Console, TRUE); + return Status; } CSR_API(SrvSetHandleInformation) { - DPRINT1("%s not yet implemented\n", __FUNCTION__); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + PCONSOLE_SETHANDLEINFO SetHandleInfoRequest = &((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetHandleInfoRequest; + PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); + PCONSOLE Console; + + HANDLE Handle = SetHandleInfoRequest->Handle; + ULONG Index = HandleToULong(Handle) >> 2; + PCONSOLE_IO_HANDLE Entry; + + Status = ConSrvGetConsole(ProcessData, &Console, TRUE); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Can't get console\n"); + return Status; + } + + RtlEnterCriticalSection(&ProcessData->HandleTableLock); + + ASSERT(ProcessData->HandleTable); + // ASSERT( (ProcessData->HandleTable == NULL && ProcessData->HandleTableSize == 0) || + // (ProcessData->HandleTable != NULL && ProcessData->HandleTableSize != 0) ); + + if (!IsConsoleHandle(Handle) || + Index >= ProcessData->HandleTableSize || + (Entry = &ProcessData->HandleTable[Index])->Object == NULL) + { + Status = STATUS_INVALID_HANDLE; + goto Quit; + } + + /* + * Modify the handle information flags. The console server + * doesn't support HANDLE_FLAG_PROTECT_FROM_CLOSE. + */ + if (SetHandleInfoRequest->Mask & HANDLE_FLAG_INHERIT) + { + Entry->Inheritable = ((SetHandleInfoRequest->Flags & HANDLE_FLAG_INHERIT) != 0); + } + + Status = STATUS_SUCCESS; + +Quit: + RtlLeaveCriticalSection(&ProcessData->HandleTableLock); + + ConSrvReleaseConsole(Console, TRUE); + return Status; } CSR_API(SrvCloseHandle) From 023832206627277dda03a210e82fec16cbfaeb2a Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 20 Apr 2014 18:15:41 +0000 Subject: [PATCH 416/419] =?UTF-8?q?[NTDLL=5FAPITEST]=20-=20Add=20test=20fo?= =?UTF-8?q?r=20NtQueryVolumeInformationFile.=20Patch=20by=20V=C3=ADctor=20?= =?UTF-8?q?Mart=C3=ADnez.=20ROSTESTS-134=20#resolve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/trunk/; revision=62844 --- rostests/apitests/ntdll/CMakeLists.txt | 1 + .../ntdll/NtQueryVolumeInformationFile.c | 85 +++++++++++++++++++ rostests/apitests/ntdll/testlist.c | 2 + 3 files changed, 88 insertions(+) create mode 100644 rostests/apitests/ntdll/NtQueryVolumeInformationFile.c diff --git a/rostests/apitests/ntdll/CMakeLists.txt b/rostests/apitests/ntdll/CMakeLists.txt index bc6b6be5ee7..12afccf20f6 100644 --- a/rostests/apitests/ntdll/CMakeLists.txt +++ b/rostests/apitests/ntdll/CMakeLists.txt @@ -9,6 +9,7 @@ list(APPEND SOURCE NtMapViewOfSection.c NtProtectVirtualMemory.c NtQuerySystemEnvironmentValue.c + NtQueryVolumeInformationFile.c RtlBitmap.c RtlDetermineDosPathNameType.c RtlDoesFileExists.c diff --git a/rostests/apitests/ntdll/NtQueryVolumeInformationFile.c b/rostests/apitests/ntdll/NtQueryVolumeInformationFile.c new file mode 100644 index 00000000000..6de9859782e --- /dev/null +++ b/rostests/apitests/ntdll/NtQueryVolumeInformationFile.c @@ -0,0 +1,85 @@ +/* + * PROJECT: ReactOS API Tests + * LICENSE: GPLv2+ - See COPYING in the top level directory + * PURPOSE: NtQueryVolumeInformationFile tests + * PROGRAMMER: Víctor Martínez Calvo + */ + +#define WIN32_NO_STATUS +#include +#include +#include + +START_TEST(NtQueryVolumeInformationFile) +{ + IO_STATUS_BLOCK IoStatusBlock; + FILE_FS_DEVICE_INFORMATION FileFsDevice; + OBJECT_ATTRIBUTES attr; + HANDLE handle; + WCHAR path[MAX_PATH]; + UNICODE_STRING pathW; + NTSTATUS status; + + /*Store a valid Handle*/ + GetWindowsDirectoryW(path, MAX_PATH); + RtlDosPathNameToNtPathName_U(path, &pathW, NULL, NULL); + + InitializeObjectAttributes(&attr, &pathW, OBJ_CASE_INSENSITIVE, NULL, NULL); + status = NtOpenFile(&handle, SYNCHRONIZE|FILE_LIST_DIRECTORY, &attr, &IoStatusBlock, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_DIRECTORY_FILE|FILE_SYNCHRONOUS_IO_NONALERT); + + RtlFreeUnicodeString(&pathW); + + if (!NT_SUCCESS(status)) + { + skip("NtOpenFile failed: 0x%lx\n", status); + return; + } + + /*Testing VALID handle, with NULL IN parameters*/ + SetLastError(0xdeadb33f); + status = NtQueryVolumeInformationFile(handle, NULL, &FileFsDevice, sizeof(FILE_FS_DEVICE_INFORMATION), FileFsDeviceInformation); + ok(status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got 0x%lx\n", status); + ok(GetLastError() == 0xdeadb33f, "Expected 0xdeadb33f, got %lx\n", GetLastError()); + + SetLastError(0xcacacaca); + status = NtQueryVolumeInformationFile(handle, &IoStatusBlock, NULL, sizeof(FILE_FS_DEVICE_INFORMATION), FileFsDeviceInformation); + ok(status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got 0x%lx\n", status); + ok(GetLastError() == 0xcacacaca, "Expected 0xcacacaca, got %lx\n", GetLastError()); + + SetLastError(0xdadadada); + status = NtQueryVolumeInformationFile(handle, &IoStatusBlock, &FileFsDevice, 0, FileFsDeviceInformation); + ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got 0x%lx\n", status); + ok(GetLastError() == 0xdadadada, "Expected 0xdadadada, got %lx\n", GetLastError()); + + /*All valid, invalid FsInformationClass value.*/ + SetLastError(0xdeadbeef); + status = NtQueryVolumeInformationFile(handle, &IoStatusBlock, &FileFsDevice, sizeof(FILE_FS_DEVICE_INFORMATION), 0); + ok(status == STATUS_INVALID_INFO_CLASS, "Expected STATUS_INVALID_INFO_CLASS, got 0x%lx\n", status); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %lx\n", GetLastError()); + + /*Testing NULL handle*/ + SetLastError(0xdeadbeef); + status = NtQueryVolumeInformationFile(NULL, &IoStatusBlock, &FileFsDevice, sizeof(FILE_FS_DEVICE_INFORMATION), FileFsDeviceInformation); + ok(status == STATUS_INVALID_HANDLE, "Expected STATUS_INVALID_HANDLE, got 0x%lx\n", status); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %lx\n", GetLastError()); + + /*Testing INVALID_HANDLE_VALUE*/ + SetLastError(0xdeaddead); + status = NtQueryVolumeInformationFile((HANDLE)(-1), &IoStatusBlock, &FileFsDevice, sizeof(FILE_FS_DEVICE_INFORMATION), FileFsDeviceInformation); + ok(status == STATUS_OBJECT_TYPE_MISMATCH, "Expected STATUS_OBJECT_TYPE_MISMATCH, got 0x%lx\n", status); + ok(GetLastError() == 0xdeaddead, "Expected 0xdeaddead, got %lx\n", GetLastError()); + + /*Now all NULL. Priority check: FsInformationClass value!*/ + SetLastError(0xcacacaca); + status = NtQueryVolumeInformationFile(NULL, NULL, NULL, 0, 0); + ok(status == STATUS_INVALID_INFO_CLASS, "Expected STATUS_INVALID_INFO_CLASS, got 0x%lx\n", status); + ok(GetLastError() == 0xcacacaca, "Expected 0xcacacaca, got %lx\n", GetLastError()); + + /*Almost all NULL. Then it checks against the Length!*/ + SetLastError(0xdeadbeef); + status = NtQueryVolumeInformationFile(NULL, NULL, NULL, 0, FileFsDeviceInformation); + ok(status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got 0x%lx\n", status); + ok(GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %lx\n", GetLastError()); + + NtClose(handle); +} diff --git a/rostests/apitests/ntdll/testlist.c b/rostests/apitests/ntdll/testlist.c index 0f45d260e6b..ff74480ea57 100644 --- a/rostests/apitests/ntdll/testlist.c +++ b/rostests/apitests/ntdll/testlist.c @@ -12,6 +12,7 @@ extern void func_NtFreeVirtualMemory(void); extern void func_NtMapViewOfSection(void); extern void func_NtProtectVirtualMemory(void); extern void func_NtQuerySystemEnvironmentValue(void); +extern void func_NtQueryVolumeInformationFile(void); extern void func_NtSystemInformation(void); extern void func_RtlBitmap(void); extern void func_RtlDetermineDosPathNameType(void); @@ -39,6 +40,7 @@ const struct test winetest_testlist[] = { "NtMapViewOfSection", func_NtMapViewOfSection }, { "NtProtectVirtualMemory", func_NtProtectVirtualMemory }, { "NtQuerySystemEnvironmentValue", func_NtQuerySystemEnvironmentValue }, + { "NtQueryVolumeInformationFile", func_NtQueryVolumeInformationFile }, { "NtSystemInformation", func_NtSystemInformation }, { "RtlBitmapApi", func_RtlBitmap }, { "RtlDetermineDosPathNameType", func_RtlDetermineDosPathNameType }, From 38be5bceff155d8c0cbc8629c2c92e1c5c2037c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 20 Apr 2014 22:40:39 +0000 Subject: [PATCH 417/419] [KERNEL32][CONSRV] Make kernel32 / winsrv console CSR structures Win2k3-compliant for CreateConsoleScreenBuffer. The aim is to be able to put our kernel32.dll or winsrv.dll on win2k3, and vice-versa. Because of that, we need to introduce and use the redundant hMutex and lpBitMap in the CONSOLE_CREATESCREENBUFFER structure, instead of the ones that are already present in its CONSOLE_GRAPHICS_BUFFER_INFO member ... Isn't MS dumb sometimes? I also homogeneize some variable names wrt. equivalent ones that I use elsewhere, and I fix a broken return value in the case the API fails. Part 3/X CORE-7931 svn path=/trunk/; revision=62846 --- .../win32/kernel32/client/console/console.c | 35 +++++++++---------- reactos/include/reactos/subsys/win/conmsg.h | 16 +++++---- .../win32ss/user/winsrv/consrv/conoutput.c | 22 +++++++----- 3 files changed, 39 insertions(+), 34 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/console/console.c b/reactos/dll/win32/kernel32/client/console/console.c index 1a250a10b8e..f65838c4c06 100644 --- a/reactos/dll/win32/kernel32/client/console/console.c +++ b/reactos/dll/win32/kernel32/client/console/console.c @@ -1935,11 +1935,10 @@ CreateConsoleScreenBuffer(DWORD dwDesiredAccess, DWORD dwFlags, LPVOID lpScreenBufferData) { - NTSTATUS Status; CONSOLE_API_MESSAGE ApiMessage; PCONSOLE_CREATESCREENBUFFER CreateScreenBufferRequest = &ApiMessage.Data.CreateScreenBufferRequest; PCSR_CAPTURE_BUFFER CaptureBuffer = NULL; - PCONSOLE_GRAPHICS_BUFFER_INFO GraphicsBufferInfo = /*(PCONSOLE_GRAPHICS_BUFFER_INFO)*/lpScreenBufferData; + PCONSOLE_GRAPHICS_BUFFER_INFO GraphicsBufferInfo = lpScreenBufferData; if ( (dwDesiredAccess & ~(GENERIC_READ | GENERIC_WRITE)) || (dwShareMode & ~(FILE_SHARE_READ | FILE_SHARE_WRITE)) || @@ -1949,15 +1948,16 @@ CreateConsoleScreenBuffer(DWORD dwDesiredAccess, return INVALID_HANDLE_VALUE; } - CreateScreenBufferRequest->ScreenBufferType = dwFlags; - CreateScreenBufferRequest->Access = dwDesiredAccess; - CreateScreenBufferRequest->ShareMode = dwShareMode; - CreateScreenBufferRequest->Inheritable = + CreateScreenBufferRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + CreateScreenBufferRequest->DesiredAccess = dwDesiredAccess; + CreateScreenBufferRequest->InheritHandle = (lpSecurityAttributes ? lpSecurityAttributes->bInheritHandle : FALSE); + CreateScreenBufferRequest->ShareMode = dwShareMode; + CreateScreenBufferRequest->ScreenBufferType = dwFlags; if (dwFlags == CONSOLE_GRAPHICS_BUFFER) { - if (CreateScreenBufferRequest->Inheritable || GraphicsBufferInfo == NULL) + if (CreateScreenBufferRequest->InheritHandle || GraphicsBufferInfo == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return INVALID_HANDLE_VALUE; @@ -1969,7 +1969,7 @@ CreateConsoleScreenBuffer(DWORD dwDesiredAccess, if (CaptureBuffer == NULL) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return FALSE; + return INVALID_HANDLE_VALUE; } CsrCaptureMessageBuffer(CaptureBuffer, @@ -1978,24 +1978,23 @@ CreateConsoleScreenBuffer(DWORD dwDesiredAccess, (PVOID*)&CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMapInfo); } - Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, - CaptureBuffer, - CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepCreateScreenBuffer), - sizeof(CONSOLE_CREATESCREENBUFFER)); + CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + CaptureBuffer, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepCreateScreenBuffer), + sizeof(*CreateScreenBufferRequest)); - if (CaptureBuffer) - CsrFreeCaptureBuffer(CaptureBuffer); + if (CaptureBuffer) CsrFreeCaptureBuffer(CaptureBuffer); - if (!NT_SUCCESS(Status)) + if (!NT_SUCCESS(ApiMessage.Status)) { - BaseSetLastNTError(Status); + BaseSetLastNTError(ApiMessage.Status); return INVALID_HANDLE_VALUE; } if (dwFlags == CONSOLE_GRAPHICS_BUFFER && GraphicsBufferInfo) { - GraphicsBufferInfo->hMutex = CreateScreenBufferRequest->GraphicsBufferInfo.hMutex ; - GraphicsBufferInfo->lpBitMap = CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMap; + GraphicsBufferInfo->hMutex = CreateScreenBufferRequest->hMutex ; // CreateScreenBufferRequest->GraphicsBufferInfo.hMutex ; + GraphicsBufferInfo->lpBitMap = CreateScreenBufferRequest->lpBitMap; // CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMap; } return CreateScreenBufferRequest->OutputHandle; diff --git a/reactos/include/reactos/subsys/win/conmsg.h b/reactos/include/reactos/subsys/win/conmsg.h index a208d3e0cac..70bf665af7d 100644 --- a/reactos/include/reactos/subsys/win/conmsg.h +++ b/reactos/include/reactos/subsys/win/conmsg.h @@ -351,17 +351,19 @@ typedef struct typedef struct { - HANDLE OutputHandle; /* Handle to newly created screen buffer */ + HANDLE ConsoleHandle; + DWORD DesiredAccess; + BOOL InheritHandle; + DWORD ShareMode; DWORD ScreenBufferType; /* Type of the screen buffer: CONSOLE_TEXTMODE_BUFFER or CONSOLE_GRAPHICS_BUFFER */ /* - * If we are creating a graphics screen buffer, - * this structure holds the initialization information. + * This structure holds the initialization information + * for graphics screen buffers. */ CONSOLE_GRAPHICS_BUFFER_INFO GraphicsBufferInfo; - - DWORD Access; - DWORD ShareMode; - BOOL Inheritable; + HANDLE hMutex; + PVOID lpBitMap; + HANDLE OutputHandle; /* Handle to newly created screen buffer */ } CONSOLE_CREATESCREENBUFFER, *PCONSOLE_CREATESCREENBUFFER; typedef struct diff --git a/reactos/win32ss/user/winsrv/consrv/conoutput.c b/reactos/win32ss/user/winsrv/consrv/conoutput.c index 9c01dd4241d..f5dac648a2c 100644 --- a/reactos/win32ss/user/winsrv/consrv/conoutput.c +++ b/reactos/win32ss/user/winsrv/consrv/conoutput.c @@ -232,8 +232,8 @@ CSR_API(SrvCreateConsoleScreenBuffer) /* Get infos from the graphics buffer information structure */ if (!CsrValidateMessageBuffer(ApiMessage, (PVOID*)&CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMapInfo, - 1, - CreateScreenBufferRequest->GraphicsBufferInfo.dwBitMapInfoLength)) + CreateScreenBufferRequest->GraphicsBufferInfo.dwBitMapInfoLength, + sizeof(BYTE))) { Status = STATUS_INVALID_PARAMETER; goto Quit; @@ -242,11 +242,13 @@ CSR_API(SrvCreateConsoleScreenBuffer) ScreenBufferInfo = &GraphicsInfo; /* Initialize shared variables */ - CreateScreenBufferRequest->GraphicsBufferInfo.hMutex = GraphicsInfo.Info.hMutex = INVALID_HANDLE_VALUE; - CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMap = GraphicsInfo.Info.lpBitMap = NULL; + // CreateScreenBufferRequest->GraphicsBufferInfo.hMutex + CreateScreenBufferRequest->hMutex = GraphicsInfo.Info.hMutex = INVALID_HANDLE_VALUE; + // CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMap + CreateScreenBufferRequest->lpBitMap = GraphicsInfo.Info.lpBitMap = NULL; /* A graphics screen buffer is never inheritable */ - CreateScreenBufferRequest->Inheritable = FALSE; + CreateScreenBufferRequest->InheritHandle = FALSE; } Status = ConDrvCreateScreenBuffer(&Buff, @@ -261,8 +263,8 @@ CSR_API(SrvCreateConsoleScreenBuffer) Status = ConSrvInsertObject(ProcessData, &CreateScreenBufferRequest->OutputHandle, &Buff->Header, - CreateScreenBufferRequest->Access, - CreateScreenBufferRequest->Inheritable, + CreateScreenBufferRequest->DesiredAccess, + CreateScreenBufferRequest->InheritHandle, CreateScreenBufferRequest->ShareMode); RtlLeaveCriticalSection(&ProcessData->HandleTableLock); @@ -276,8 +278,10 @@ CSR_API(SrvCreateConsoleScreenBuffer) * Initialize the graphics buffer information structure * and give it back to the client. */ - CreateScreenBufferRequest->GraphicsBufferInfo.hMutex = Buffer->ClientMutex; - CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMap = Buffer->ClientBitMap; + // CreateScreenBufferRequest->GraphicsBufferInfo.hMutex + CreateScreenBufferRequest->hMutex = Buffer->ClientMutex; + // CreateScreenBufferRequest->GraphicsBufferInfo.lpBitMap + CreateScreenBufferRequest->lpBitMap = Buffer->ClientBitMap; } Quit: From 286ee4b8b144b03382ac07ad1ef08cd9595a7c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 21 Apr 2014 01:22:17 +0000 Subject: [PATCH 418/419] [KERNEL32][CONSRV] Implement (undocumented) SetLastConsoleEventActive API. Patch by Alexander Andrejevic, with a minor modification by me concerning the addition of a NotifiedLastCloseProcess member to the CONSOLE structure and a check that makes sure that only the app that asked for the notification, receives it (and so that we don't call the console control dispatcher for nothing). This API is used by ntvdm to be sure that it gets killed when all other console apps attached to the ntvdm's console are away. CORE-7250 svn path=/trunk/; revision=62847 --- .../win32/kernel32/client/console/console.c | 31 +++++++++--- reactos/include/psdk/wincon.h | 11 +++-- reactos/include/reactos/subsys/win/conmsg.h | 47 ++++++++++++------- .../user/winsrv/consrv/condrv/console.c | 4 +- reactos/win32ss/user/winsrv/consrv/console.c | 23 ++++++++- reactos/win32ss/user/winsrv/consrv/handle.c | 28 +++++++++++ .../user/winsrv/consrv/include/conio.h | 2 + 7 files changed, 114 insertions(+), 32 deletions(-) diff --git a/reactos/dll/win32/kernel32/client/console/console.c b/reactos/dll/win32/kernel32/client/console/console.c index f65838c4c06..9376a7d66d9 100644 --- a/reactos/dll/win32/kernel32/client/console/console.c +++ b/reactos/dll/win32/kernel32/client/console/console.c @@ -30,6 +30,7 @@ PHANDLER_ROUTINE InitialHandler[1]; PHANDLER_ROUTINE* CtrlHandlers; ULONG NrCtrlHandlers; ULONG NrAllocatedHandlers; +BOOL LastCloseNotify = FALSE; HANDLE InputWaitHandle = INVALID_HANDLE_VALUE; @@ -129,8 +130,14 @@ ConsoleControlDispatcher(IN LPVOID lpThreadParameter) case CTRL_SHUTDOWN_EVENT: break; - case 3: - ExitThread(0); + case CTRL_LAST_CLOSE_EVENT: + /* + * In case the console app hasn't register for last close notification, + * just kill this console handler thread. We don't want that such apps + * get killed for unexpected reasons. On the contrary apps that registered + * can be killed because they expect to be. + */ + if (!LastCloseNotify) ExitThread(0); break; case 4: @@ -2595,14 +2602,26 @@ BOOL WINAPI GetConsoleKeyboardLayoutNameW(LPWSTR name) } /* - * @unimplemented + * @implemented */ -BOOL +DWORD WINAPI SetLastConsoleEventActive(VOID) { - STUB; - return FALSE; + CONSOLE_API_MESSAGE ApiMessage; + PCONSOLE_NOTIFYLASTCLOSE NotifyLastCloseRequest = &ApiMessage.Data.NotifyLastCloseRequest; + + /* Set the flag used by the console control dispatcher */ + LastCloseNotify = TRUE; + + /* Set up the input arguments */ + NotifyLastCloseRequest->ConsoleHandle = NtCurrentPeb()->ProcessParameters->ConsoleHandle; + + /* Call CSRSS; just return the NTSTATUS cast to DWORD */ + return CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage, + NULL, + CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX, ConsolepNotifyLastClose), + sizeof(*NotifyLastCloseRequest)); } /* EOF */ diff --git a/reactos/include/psdk/wincon.h b/reactos/include/psdk/wincon.h index b36712c7911..c44e478dab0 100644 --- a/reactos/include/psdk/wincon.h +++ b/reactos/include/psdk/wincon.h @@ -65,11 +65,12 @@ extern "C" { /* * Control handler codes */ -#define CTRL_C_EVENT 0 -#define CTRL_BREAK_EVENT 1 -#define CTRL_CLOSE_EVENT 2 -#define CTRL_LOGOFF_EVENT 5 -#define CTRL_SHUTDOWN_EVENT 6 +#define CTRL_C_EVENT 0 +#define CTRL_BREAK_EVENT 1 +#define CTRL_CLOSE_EVENT 2 +#define CTRL_LAST_CLOSE_EVENT 3 /* Undocumented */ +#define CTRL_LOGOFF_EVENT 5 +#define CTRL_SHUTDOWN_EVENT 6 /* * Input mode flags diff --git a/reactos/include/reactos/subsys/win/conmsg.h b/reactos/include/reactos/subsys/win/conmsg.h index 70bf665af7d..4d117a717b6 100644 --- a/reactos/include/reactos/subsys/win/conmsg.h +++ b/reactos/include/reactos/subsys/win/conmsg.h @@ -202,6 +202,20 @@ typedef struct PDWORD ProcessIdsList; } CONSOLE_GETPROCESSLIST, *PCONSOLE_GETPROCESSLIST; +typedef struct +{ + HANDLE ConsoleHandle; + DWORD CtrlEvent; + DWORD ProcessGroupId; +} CONSOLE_GENERATECTRLEVENT, *PCONSOLE_GENERATECTRLEVENT; + +typedef struct +{ + HANDLE ConsoleHandle; +} CONSOLE_NOTIFYLASTCLOSE, *PCONSOLE_NOTIFYLASTCLOSE; + + + typedef struct { HANDLE OutputHandle; @@ -349,6 +363,7 @@ typedef struct } CONSOLE_GETSETHWSTATE, *PCONSOLE_GETSETHWSTATE; + typedef struct { HANDLE ConsoleHandle; @@ -526,6 +541,15 @@ typedef struct BOOL AppendToEnd; } CONSOLE_WRITEINPUT, *PCONSOLE_WRITEINPUT; +typedef struct +{ + HANDLE ConsoleHandle; + HANDLE InputHandle; + DWORD NumberOfEvents; +} CONSOLE_GETNUMINPUTEVENTS, *PCONSOLE_GETNUMINPUTEVENTS; + + + typedef struct { HANDLE ConsoleHandle; @@ -584,6 +608,7 @@ typedef struct } CONSOLE_OPENCONSOLE, *PCONSOLE_OPENCONSOLE; + typedef struct { HANDLE ConsoleHandle; @@ -700,20 +725,6 @@ typedef struct -typedef struct -{ - HANDLE ConsoleHandle; - DWORD CtrlEvent; - DWORD ProcessGroupId; -} CONSOLE_GENERATECTRLEVENT, *PCONSOLE_GENERATECTRLEVENT; - -typedef struct -{ - HANDLE ConsoleHandle; - HANDLE InputHandle; - DWORD NumberOfEvents; -} CONSOLE_GETNUMINPUTEVENTS, *PCONSOLE_GETNUMINPUTEVENTS; - typedef struct { HANDLE ConsoleHandle; @@ -757,8 +768,10 @@ typedef struct _CONSOLE_API_MESSAGE CONSOLE_ATTACHCONSOLE AttachConsoleRequest; CONSOLE_FREECONSOLE FreeConsoleRequest; - /* Process list */ + /* Processes */ CONSOLE_GETPROCESSLIST GetProcessListRequest; + CONSOLE_GENERATECTRLEVENT GenerateCtrlEventRequest; + CONSOLE_NOTIFYLASTCLOSE NotifyLastCloseRequest; /* Handles */ CONSOLE_OPENCONSOLE OpenConsoleRequest; @@ -806,6 +819,7 @@ typedef struct _CONSOLE_API_MESSAGE CONSOLE_GETINPUT GetInputRequest; // SrvGetConsoleInput / PeekConsoleInput & ReadConsoleInput CONSOLE_READOUTPUT ReadOutputRequest; // SrvReadConsoleOutput / ReadConsoleOutput CONSOLE_READOUTPUTCODE ReadOutputCodeRequest; // SrvReadConsoleOutputString / ReadConsoleOutputAttribute & ReadConsoleOutputCharacter + CONSOLE_GETNUMINPUTEVENTS GetNumInputEventsRequest; /* Write */ CONSOLE_WRITECONSOLE WriteConsoleRequest; // SrvWriteConsole / WriteConsole @@ -830,9 +844,6 @@ typedef struct _CONSOLE_API_MESSAGE CONSOLE_SETHISTORYNUMBERCOMMANDS SetHistoryNumberCommandsRequest; CONSOLE_GETSETHISTORYINFO HistoryInfoRequest; - CONSOLE_GENERATECTRLEVENT GenerateCtrlEventRequest; - CONSOLE_GETNUMINPUTEVENTS GetNumInputEventsRequest; - /* Input and Output Code Pages */ CONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest; CONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest; diff --git a/reactos/win32ss/user/winsrv/consrv/condrv/console.c b/reactos/win32ss/user/winsrv/consrv/condrv/console.c index b4b1111de48..3ec35f220af 100644 --- a/reactos/win32ss/user/winsrv/consrv/condrv/console.c +++ b/reactos/win32ss/user/winsrv/consrv/condrv/console.c @@ -244,7 +244,7 @@ ConDrvConsoleCtrlEventTimeout(IN ULONG CtrlEvent, return Status; } -static NTSTATUS +NTSTATUS ConDrvConsoleCtrlEvent(IN ULONG CtrlEvent, IN PCONSOLE_PROCESS_DATA ProcessData) { @@ -535,6 +535,8 @@ ConDrvInitConsole(OUT PHANDLE NewConsoleHandle, Console->ReferenceCount = 0; InitializeCriticalSection(&Console->Lock); InitializeListHead(&Console->ProcessList); + Console->NotifiedLastCloseProcess = NULL; + Console->NotifyLastClose = FALSE; /* Initialize the frontend interface */ ResetFrontEnd(Console); diff --git a/reactos/win32ss/user/winsrv/consrv/console.c b/reactos/win32ss/user/winsrv/consrv/console.c index 8ecd567fa7b..81a39c54e7f 100644 --- a/reactos/win32ss/user/winsrv/consrv/console.c +++ b/reactos/win32ss/user/winsrv/consrv/console.c @@ -641,8 +641,27 @@ CSR_API(SrvGenerateConsoleCtrlEvent) CSR_API(SrvConsoleNotifyLastClose) { - DPRINT1("%s not yet implemented\n", __FUNCTION__); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS Status; + PCONSOLE_PROCESS_DATA ProcessData = ConsoleGetPerProcessData(CsrGetClientThread()->Process); + PCONSOLE Console; + + Status = ConSrvGetConsole(ProcessData, &Console, TRUE); + if (!NT_SUCCESS(Status)) return Status; + + /* Only one process is allowed to be registered for last close notification */ + if (!Console->NotifyLastClose) + { + Console->NotifiedLastCloseProcess = ProcessData; + Console->NotifyLastClose = TRUE; + Status = STATUS_SUCCESS; + } + else + { + Status = STATUS_ACCESS_DENIED; + } + + ConSrvReleaseConsole(Console, TRUE); + return Status; } diff --git a/reactos/win32ss/user/winsrv/consrv/handle.c b/reactos/win32ss/user/winsrv/consrv/handle.c index b79fe527e7a..81fa41d2dce 100644 --- a/reactos/win32ss/user/winsrv/consrv/handle.c +++ b/reactos/win32ss/user/winsrv/consrv/handle.c @@ -633,6 +633,10 @@ Quit: return Status; } +NTSTATUS +ConDrvConsoleCtrlEvent(IN ULONG CtrlEvent, + IN PCONSOLE_PROCESS_DATA ProcessData); + VOID FASTCALL ConSrvRemoveConsole(PCONSOLE_PROCESS_DATA ProcessData) @@ -662,6 +666,30 @@ ConSrvRemoveConsole(PCONSOLE_PROCESS_DATA ProcessData) /* Update the internal info of the terminal */ TermRefreshInternalInfo(Console); + /* + * Check if there is only one process still attached to the console, + * and that the console should send a control event in this case. + */ + if ((Console->ProcessList.Flink != &Console->ProcessList) && + (Console->ProcessList.Flink->Flink == &Console->ProcessList) && + // (Console->ProcessList.Flink == Console->ProcessList.Blink) && + Console->NotifyLastClose) + { + PCONSOLE_PROCESS_DATA LastProcess = CONTAINING_RECORD(Console->ProcessList.Flink, + CONSOLE_PROCESS_DATA, + ConsoleLink); + /* If the remaining process is the one that wanted the notification... */ + if (LastProcess == Console->NotifiedLastCloseProcess) + { + /* ... notify it that it's the only one remaining on the console */ + ConDrvConsoleCtrlEvent(CTRL_LAST_CLOSE_EVENT, LastProcess); + } + + /* In any case reset the pointer and the flag */ + Console->NotifiedLastCloseProcess = NULL; + Console->NotifyLastClose = FALSE; + } + /* Release the console */ DPRINT("ConSrvRemoveConsole - Decrement Console->ReferenceCount = %lu\n", Console->ReferenceCount); ConDrvReleaseConsole(Console, TRUE); diff --git a/reactos/win32ss/user/winsrv/consrv/include/conio.h b/reactos/win32ss/user/winsrv/consrv/include/conio.h index 30a70eaae60..6dda15759fe 100644 --- a/reactos/win32ss/user/winsrv/consrv/include/conio.h +++ b/reactos/win32ss/user/winsrv/consrv/include/conio.h @@ -282,6 +282,8 @@ typedef struct _CONSOLE CONSOLE_STATE State; /* State of the console */ LIST_ENTRY ProcessList; /* List of processes owning the console. The first one is the so-called "Console Leader Process" */ + PCONSOLE_PROCESS_DATA NotifiedLastCloseProcess; /* Pointer to the unique process that needs to be notified when all the other processes have been detached from the console */ + BOOLEAN NotifyLastClose; /* TRUE if the console should send a control event to the last attached process after all the others detached, if it wanted to be notified */ FRONTEND TermIFace; /* Frontend-specific interface */ From 6e8dcec9f77aa966c51f5d12b5004e0fa244113c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Mon, 21 Apr 2014 01:36:00 +0000 Subject: [PATCH 419/419] [KERNEL32] - Add a debug output to the default console dispatcher for the CTRL_LAST_CLOSE_EVENT code; - hardcoded_value--; Addendum to revision 62847. svn path=/trunk/; revision=62848 --- reactos/dll/win32/kernel32/client/console/console.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/kernel32/client/console/console.c b/reactos/dll/win32/kernel32/client/console/console.c index 9376a7d66d9..857a30a212c 100644 --- a/reactos/dll/win32/kernel32/client/console/console.c +++ b/reactos/dll/win32/kernel32/client/console/console.c @@ -59,6 +59,10 @@ DefaultConsoleCtrlHandler(DWORD Event) DPRINT("Ctrl Close Event\n"); break; + case CTRL_LAST_CLOSE_EVENT: + DPRINT("Ctrl Last Close Event\n"); + break; + case CTRL_LOGOFF_EVENT: DPRINT("Ctrl Logoff Event\n"); break; @@ -171,9 +175,9 @@ ConsoleControlDispatcher(IN LPVOID lpThreadParameter) switch(nCode) { case CTRL_CLOSE_EVENT: + case CTRL_LAST_CLOSE_EVENT: case CTRL_LOGOFF_EVENT: case CTRL_SHUTDOWN_EVENT: - case 3: nExitCode = CodeAndFlag; break; }